polotno-node 2.11.7 → 2.11.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
`+H[ie].replace(" at new "," at ");return i.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",i.displayName)),ge}while(1<=ie&&0<=ce);break}}}finally{U=!1,Error.prepareStackTrace=C}return(i=i?i.displayName||i.name:"")?Y(i):""}function te(i){switch(i.tag){case 5:return Y(i.type);case 16:return Y("Lazy");case 13:return Y("Suspense");case 19:return Y("SuspenseList");case 0:case 2:case 15:return i=ee(i.type,!1),i;case 11:return i=ee(i.type.render,!1),i;case 1:return i=ee(i.type,!0),i;default:return""}}function Q(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case T:return"Fragment";case M:return"Portal";case F:return"Profiler";case I:return"StrictMode";case A:return"Suspense";case R:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case O:return(i.displayName||"Context")+".Consumer";case k:return(i._context.displayName||"Context")+".Provider";case N:var l=i.render;return i=i.displayName,i||(i=l.displayName||l.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case L:return l=i.displayName||null,l!==null?l:Q(i.type)||"Memo";case V:l=i._payload,i=i._init;try{return Q(i(l))}catch{}}return null}function Z(i){var l=i.type;switch(i.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=l.render,i=i.displayName||i.name||"",l.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Q(l);case 8:return l===I?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function re(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function ne(i){var l=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function ae(i){var l=ne(i)?"checked":"value",C=Object.getOwnPropertyDescriptor(i.constructor.prototype,l),D=""+i[l];if(!i.hasOwnProperty(l)&&typeof C<"u"&&typeof C.get=="function"&&typeof C.set=="function"){var H=C.get,K=C.set;return Object.defineProperty(i,l,{configurable:!0,get:function(){return H.call(this)},set:function(ie){D=""+ie,K.call(this,ie)}}),Object.defineProperty(i,l,{enumerable:C.enumerable}),{getValue:function(){return D},setValue:function(ie){D=""+ie},stopTracking:function(){i._valueTracker=null,delete i[l]}}}}function ue(i){i._valueTracker||(i._valueTracker=ae(i))}function fe(i){if(!i)return!1;var l=i._valueTracker;if(!l)return!0;var C=l.getValue(),D="";return i&&(D=ne(i)?i.checked?"true":"false":i.value),i=D,i!==C?(l.setValue(i),!0):!1}function pe(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function ye(i,l){var C=l.checked;return q({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:C??i._wrapperState.initialChecked})}function we(i,l){var C=l.defaultValue==null?"":l.defaultValue,D=l.checked!=null?l.checked:l.defaultChecked;C=re(l.value!=null?l.value:C),i._wrapperState={initialChecked:D,initialValue:C,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function je(i,l){l=l.checked,l!=null&&h(i,"checked",l,!1)}function Te(i,l){je(i,l);var C=re(l.value),D=l.type;if(C!=null)D==="number"?(C===0&&i.value===""||i.value!=C)&&(i.value=""+C):i.value!==""+C&&(i.value=""+C);else if(D==="submit"||D==="reset"){i.removeAttribute("value");return}l.hasOwnProperty("value")?_e(i,l.type,C):l.hasOwnProperty("defaultValue")&&_e(i,l.type,re(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(i.defaultChecked=!!l.defaultChecked)}function se(i,l,C){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var D=l.type;if(!(D!=="submit"&&D!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+i._wrapperState.initialValue,C||l===i.value||(i.value=l),i.defaultValue=l}C=i.name,C!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,C!==""&&(i.name=C)}function _e(i,l,C){(l!=="number"||pe(i.ownerDocument)!==i)&&(C==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+C&&(i.defaultValue=""+C))}var he=Array.isArray;function xe(i,l,C,D){if(i=i.options,l){l={};for(var H=0;H<C.length;H++)l["$"+C[H]]=!0;for(C=0;C<i.length;C++)H=l.hasOwnProperty("$"+i[C].value),i[C].selected!==H&&(i[C].selected=H),H&&D&&(i[C].defaultSelected=!0)}else{for(C=""+re(C),l=null,H=0;H<i.length;H++){if(i[H].value===C){i[H].selected=!0,D&&(i[H].defaultSelected=!0);return}l!==null||i[H].disabled||(l=i[H])}l!==null&&(l.selected=!0)}}function oe(i,l){if(l.dangerouslySetInnerHTML!=null)throw Error(t(91));return q({},l,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function ve(i,l){var C=l.value;if(C==null){if(C=l.children,l=l.defaultValue,C!=null){if(l!=null)throw Error(t(92));if(he(C)){if(1<C.length)throw Error(t(93));C=C[0]}l=C}l==null&&(l=""),C=l}i._wrapperState={initialValue:re(C)}}function de(i,l){var C=re(l.value),D=re(l.defaultValue);C!=null&&(C=""+C,C!==i.value&&(i.value=C),l.defaultValue==null&&i.defaultValue!==C&&(i.defaultValue=C)),D!=null&&(i.defaultValue=""+D)}function ke(i){var l=i.textContent;l===i._wrapperState.initialValue&&l!==""&&l!==null&&(i.value=l)}function Be(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Qe(i,l){return i==null||i==="http://www.w3.org/1999/xhtml"?Be(l):i==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var Ke,St=function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,C,D,H){MSApp.execUnsafeLocalFunction(function(){return i(l,C,D,H)})}:i}(function(i,l){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=l;else{for(Ke=Ke||document.createElement("div"),Ke.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=Ke.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;l.firstChild;)i.appendChild(l.firstChild)}});function Ue(i,l){if(l){var C=i.firstChild;if(C&&C===i.lastChild&&C.nodeType===3){C.nodeValue=l;return}}i.textContent=l}var rt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},gt=["Webkit","ms","Moz","O"];Object.keys(rt).forEach(function(i){gt.forEach(function(l){l=l+i.charAt(0).toUpperCase()+i.substring(1),rt[l]=rt[i]})});function mt(i,l,C){return l==null||typeof l=="boolean"||l===""?"":C||typeof l!="number"||l===0||rt.hasOwnProperty(i)&&rt[i]?(""+l).trim():l+"px"}function kt(i,l){i=i.style;for(var C in l)if(l.hasOwnProperty(C)){var D=C.indexOf("--")===0,H=mt(C,l[C],D);C==="float"&&(C="cssFloat"),D?i.setProperty(C,H):i[C]=H}}var jt=q({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Oe(i,l){if(l){if(jt[i]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(t(137,i));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(t(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(t(61))}if(l.style!=null&&typeof l.style!="object")throw Error(t(62))}}function Se(i,l){if(i.indexOf("-")===-1)return typeof l.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var yt=null;function Fe(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var qe=null,$e=null,Et=null;function Pt(i){if(i=bs(i)){if(typeof qe!="function")throw Error(t(280));var l=i.stateNode;l&&(l=Wr(l),qe(i.stateNode,i.type,l))}}function ht(i){$e?Et?Et.push(i):Et=[i]:$e=i}function ze(){if($e){var i=$e,l=Et;if(Et=$e=null,Pt(i),l)for(i=0;i<l.length;i++)Pt(l[i])}}function at(i,l){return i(l)}function Pe(){}var me=!1;function He(i,l,C){if(me)return i(l,C);me=!0;try{return at(i,l,C)}finally{me=!1,($e!==null||Et!==null)&&(Pe(),ze())}}function Me(i,l){var C=i.stateNode;if(C===null)return null;var D=Wr(C);if(D===null)return null;C=D[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(D=!D.disabled)||(i=i.type,D=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!D;break e;default:i=!1}if(i)return null;if(C&&typeof C!="function")throw Error(t(231,l,typeof C));return C}var Ye=!1;if(c)try{var et={};Object.defineProperty(et,"passive",{get:function(){Ye=!0}}),window.addEventListener("test",et,et),window.removeEventListener("test",et,et)}catch{Ye=!1}function ut(i,l,C,D,H,K,ie,ce,ge){var Ne=Array.prototype.slice.call(arguments,3);try{l.apply(C,Ne)}catch(Ve){this.onError(Ve)}}var wt=!1,Ct=null,Jt=!1,Wt=null,er={onError:function(i){wt=!0,Ct=i}};function cr(i,l,C,D,H,K,ie,ce,ge){wt=!1,Ct=null,ut.apply(er,arguments)}function Jn(i,l,C,D,H,K,ie,ce,ge){if(cr.apply(this,arguments),wt){if(wt){var Ne=Ct;wt=!1,Ct=null}else throw Error(t(198));Jt||(Jt=!0,Wt=Ne)}}function Nr(i){var l=i,C=i;if(i.alternate)for(;l.return;)l=l.return;else{i=l;do l=i,(l.flags&4098)!==0&&(C=l.return),i=l.return;while(i)}return l.tag===3?C:null}function ei(i){if(i.tag===13){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function lo(i){if(Nr(i)!==i)throw Error(t(188))}function ka(i){var l=i.alternate;if(!l){if(l=Nr(i),l===null)throw Error(t(188));return l!==i?null:i}for(var C=i,D=l;;){var H=C.return;if(H===null)break;var K=H.alternate;if(K===null){if(D=H.return,D!==null){C=D;continue}break}if(H.child===K.child){for(K=H.child;K;){if(K===C)return lo(H),i;if(K===D)return lo(H),l;K=K.sibling}throw Error(t(188))}if(C.return!==D.return)C=H,D=K;else{for(var ie=!1,ce=H.child;ce;){if(ce===C){ie=!0,C=H,D=K;break}if(ce===D){ie=!0,D=H,C=K;break}ce=ce.sibling}if(!ie){for(ce=K.child;ce;){if(ce===C){ie=!0,C=K,D=H;break}if(ce===D){ie=!0,D=K,C=H;break}ce=ce.sibling}if(!ie)throw Error(t(189))}}if(C.alternate!==D)throw Error(t(190))}if(C.tag!==3)throw Error(t(188));return C.stateNode.current===C?i:l}function ti(i){return i=ka(i),i!==null?Li(i):null}function Li(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var l=Li(i);if(l!==null)return l;i=i.sibling}return null}var Qs=n.unstable_scheduleCallback,rs=n.unstable_cancelCallback,Kp=n.unstable_shouldYield,Xp=n.unstable_requestPaint,Pr=n.unstable_now,Oc=n.unstable_getCurrentPriorityLevel,so=n.unstable_ImmediatePriority,Js=n.unstable_UserBlockingPriority,Qo=n.unstable_NormalPriority,Zp=n.unstable_LowPriority,eu=n.unstable_IdlePriority,Qi=null,Zr=null;function fr(i){if(Zr&&typeof Zr.onCommitFiberRoot=="function")try{Zr.onCommitFiberRoot(Qi,i,void 0,(i.current.flags&128)===128)}catch{}}var Ft=Math.clz32?Math.clz32:Mn,Aa=Math.log,un=Math.LN2;function Mn(i){return i>>>=0,i===0?32:31-(Aa(i)/un|0)|0}var Ni=64,Ji=4194304;function Gr(i){switch(i&-i){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 i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function uo(i,l){var C=i.pendingLanes;if(C===0)return 0;var D=0,H=i.suspendedLanes,K=i.pingedLanes,ie=C&268435455;if(ie!==0){var ce=ie&~H;ce!==0?D=Gr(ce):(K&=ie,K!==0&&(D=Gr(K)))}else ie=C&~H,ie!==0?D=Gr(ie):K!==0&&(D=Gr(K));if(D===0)return 0;if(l!==0&&l!==D&&(l&H)===0&&(H=D&-D,K=l&-l,H>=K||H===16&&(K&4194240)!==0))return l;if((D&4)!==0&&(D|=C&16),l=i.entangledLanes,l!==0)for(i=i.entanglements,l&=D;0<l;)C=31-Ft(l),H=1<<C,D|=i[C],l&=~H;return D}function Kd(i,l){switch(i){case 1:case 2:case 4:return l+250;case 8:case 16:case 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 l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Xd(i,l){for(var C=i.suspendedLanes,D=i.pingedLanes,H=i.expirationTimes,K=i.pendingLanes;0<K;){var ie=31-Ft(K),ce=1<<ie,ge=H[ie];ge===-1?((ce&C)===0||(ce&D)!==0)&&(H[ie]=Kd(ce,l)):ge<=l&&(i.expiredLanes|=ce),K&=~ce}}function Jo(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function Pc(){var i=Ni;return Ni<<=1,(Ni&4194240)===0&&(Ni=64),i}function zn(i){for(var l=[],C=0;31>C;C++)l.push(i);return l}function ns(i,l,C){i.pendingLanes|=l,l!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,l=31-Ft(l),i[l]=C}function Qp(i,l){var C=i.pendingLanes&~l;i.pendingLanes=l,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=l,i.mutableReadLanes&=l,i.entangledLanes&=l,l=i.entanglements;var D=i.eventTimes;for(i=i.expirationTimes;0<C;){var H=31-Ft(C),K=1<<H;l[H]=0,D[H]=-1,i[H]=-1,C&=~K}}function Cc(i,l){var C=i.entangledLanes|=l;for(i=i.entanglements;C;){var D=31-Ft(C),H=1<<D;H&l|i[D]&l&&(i[D]|=l),C&=~H}}var $t=0;function is(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var el,tl,Zd,Qd,tu,ru=!1,rl=[],ri=null,Ta=null,Ii=null,zt=new Map,nl=new Map,ji=[],Jd="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function eh(i,l){switch(i){case"focusin":case"focusout":ri=null;break;case"dragenter":case"dragleave":Ta=null;break;case"mouseover":case"mouseout":Ii=null;break;case"pointerover":case"pointerout":zt.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":nl.delete(l.pointerId)}}function as(i,l,C,D,H,K){return i===null||i.nativeEvent!==K?(i={blockedOn:l,domEventName:C,eventSystemFlags:D,nativeEvent:K,targetContainers:[H]},l!==null&&(l=bs(l),l!==null&&tl(l)),i):(i.eventSystemFlags|=D,l=i.targetContainers,H!==null&&l.indexOf(H)===-1&&l.push(H),i)}function Vr(i,l,C,D,H){switch(l){case"focusin":return ri=as(ri,i,l,C,D,H),!0;case"dragenter":return Ta=as(Ta,i,l,C,D,H),!0;case"mouseover":return Ii=as(Ii,i,l,C,D,H),!0;case"pointerover":var K=H.pointerId;return zt.set(K,as(zt.get(K)||null,i,l,C,D,H)),!0;case"gotpointercapture":return K=H.pointerId,nl.set(K,as(nl.get(K)||null,i,l,C,D,H)),!0}return!1}function nu(i){var l=Ba(i.target);if(l!==null){var C=Nr(l);if(C!==null){if(l=C.tag,l===13){if(l=ei(C),l!==null){i.blockedOn=l,tu(i.priority,function(){Zd(C)});return}}else if(l===3&&C.stateNode.current.memoizedState.isDehydrated){i.blockedOn=C.tag===3?C.stateNode.containerInfo:null;return}}}i.blockedOn=null}function iu(i){if(i.blockedOn!==null)return!1;for(var l=i.targetContainers;0<l.length;){var C=lu(i.domEventName,i.eventSystemFlags,l[0],i.nativeEvent);if(C===null){C=i.nativeEvent;var D=new C.constructor(C.type,C);yt=D,C.target.dispatchEvent(D),yt=null}else return l=bs(C),l!==null&&tl(l),i.blockedOn=C,!1;l.shift()}return!0}function au(i,l,C){iu(i)&&C.delete(l)}function Jp(){ru=!1,ri!==null&&iu(ri)&&(ri=null),Ta!==null&&iu(Ta)&&(Ta=null),Ii!==null&&iu(Ii)&&(Ii=null),zt.forEach(au),nl.forEach(au)}function Ra(i,l){i.blockedOn===l&&(i.blockedOn=null,ru||(ru=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Jp)))}function Ln(i){function l(H){return Ra(H,i)}if(0<rl.length){Ra(rl[0],i);for(var C=1;C<rl.length;C++){var D=rl[C];D.blockedOn===i&&(D.blockedOn=null)}}for(ri!==null&&Ra(ri,i),Ta!==null&&Ra(Ta,i),Ii!==null&&Ra(Ii,i),zt.forEach(l),nl.forEach(l),C=0;C<ji.length;C++)D=ji[C],D.blockedOn===i&&(D.blockedOn=null);for(;0<ji.length&&(C=ji[0],C.blockedOn===null);)nu(C),C.blockedOn===null&&ji.shift()}var il=d.ReactCurrentBatchConfig,ou=!0;function mi(i,l,C,D){var H=$t,K=il.transition;il.transition=null;try{$t=1,al(i,l,C,D)}finally{$t=H,il.transition=K}}function ea(i,l,C,D){var H=$t,K=il.transition;il.transition=null;try{$t=4,al(i,l,C,D)}finally{$t=H,il.transition=K}}function al(i,l,C,D){if(ou){var H=lu(i,l,C,D);if(H===null)Eu(i,l,D,ol,C),eh(i,D);else if(Vr(H,i,l,C,D))D.stopPropagation();else if(eh(i,D),l&4&&-1<Jd.indexOf(i)){for(;H!==null;){var K=bs(H);if(K!==null&&el(K),K=lu(i,l,C,D),K===null&&Eu(i,l,D,ol,C),K===H)break;H=K}H!==null&&D.stopPropagation()}else Eu(i,l,D,null,C)}}var ol=null;function lu(i,l,C,D){if(ol=null,i=Fe(D),i=Ba(i),i!==null)if(l=Nr(i),l===null)i=null;else if(C=l.tag,C===13){if(i=ei(l),i!==null)return i;i=null}else if(C===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;i=null}else l!==i&&(i=null);return ol=i,null}function th(i){switch(i){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Oc()){case so:return 1;case Js:return 4;case Qo:case Zp:return 16;case eu:return 536870912;default:return 16}default:return 16}}var Qr=null,Ma=null,ta=null;function os(){if(ta)return ta;var i,l=Ma,C=l.length,D,H="value"in Qr?Qr.value:Qr.textContent,K=H.length;for(i=0;i<C&&l[i]===H[i];i++);var ie=C-i;for(D=1;D<=ie&&l[C-D]===H[K-D];D++);return ta=H.slice(i,1<D?1-D:void 0)}function co(i){var l=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&l===13&&(i=13)):i=l,i===10&&(i=13),32<=i||i===13?i:0}function wn(){return!0}function Bn(){return!1}function Ir(i){function l(C,D,H,K,ie){this._reactName=C,this._targetInst=H,this.type=D,this.nativeEvent=K,this.target=ie,this.currentTarget=null;for(var ce in i)i.hasOwnProperty(ce)&&(C=i[ce],this[ce]=C?C(K):K[ce]);return this.isDefaultPrevented=(K.defaultPrevented!=null?K.defaultPrevented:K.returnValue===!1)?wn:Bn,this.isPropagationStopped=Bn,this}return q(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var C=this.nativeEvent;C&&(C.preventDefault?C.preventDefault():typeof C.returnValue!="unknown"&&(C.returnValue=!1),this.isDefaultPrevented=wn)},stopPropagation:function(){var C=this.nativeEvent;C&&(C.stopPropagation?C.stopPropagation():typeof C.cancelBubble!="unknown"&&(C.cancelBubble=!0),this.isPropagationStopped=wn)},persist:function(){},isPersistent:wn}),l}var Nn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yi=Ir(Nn),bi=q({},Nn,{view:0,detail:0}),rh=Ir(bi),ls,ss,Jr,_n=q({},bi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ho,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Jr&&(Jr&&i.type==="mousemove"?(ls=i.screenX-Jr.screenX,ss=i.screenY-Jr.screenY):ss=ls=0,Jr=i),ls)},movementY:function(i){return"movementY"in i?i.movementY:ss}}),dr=Ir(_n),us=q({},_n,{dataTransfer:0}),wi=Ir(us),nh=q({},bi,{relatedTarget:0}),su=Ir(nh),kc=q({},Nn,{animationName:0,elapsedTime:0,pseudoElement:0}),Ac=Ir(kc),ih=q({},Nn,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),uu=Ir(ih),ah=q({},Nn,{data:0}),fo=Ir(ah),Tc={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},eg={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},cu={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tg(i){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(i):(i=cu[i])?!!l[i]:!1}function ho(){return tg}var fu=q({},bi,{key:function(i){if(i.key){var l=Tc[i.key]||i.key;if(l!=="Unidentified")return l}return i.type==="keypress"?(i=co(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?eg[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ho,charCode:function(i){return i.type==="keypress"?co(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?co(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),oh=Ir(fu),lh=q({},_n,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),po=Ir(lh),sh=q({},bi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ho}),du=Ir(sh),hu=q({},Nn,{propertyName:0,elapsedTime:0,pseudoElement:0}),ll=Ir(hu),Rc=q({},_n,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),Mc=Ir(Rc),uh=[9,13,27,32],cs=c&&"CompositionEvent"in window,go=null;c&&"documentMode"in document&&(go=document.documentMode);var sl=c&&"TextEvent"in window&&!go,Un=c&&(!cs||go&&8<go&&11>=go),La=" ",pu=!1;function Lc(i,l){switch(i){case"keyup":return uh.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _i(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var qn=!1;function Nc(i,l){switch(i){case"compositionend":return _i(l);case"keypress":return l.which!==32?null:(pu=!0,La);case"textInput":return i=l.data,i===La&&pu?null:i;default:return null}}function ch(i,l){if(qn)return i==="compositionend"||!cs&&Lc(i,l)?(i=os(),ta=Ma=Qr=null,qn=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return Un&&l.locale!=="ko"?null:l.data;default:return null}}var ra={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function na(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l==="input"?!!ra[i.type]:l==="textarea"}function fs(i,l,C,D){ht(D),l=xu(l,"onChange"),0<l.length&&(C=new yi("onChange","change",null,C,D),i.push({event:C,listeners:l}))}var ul=null,Na=null;function fh(i){Vc(i,0)}function Ia(i){var l=Dr(i);if(fe(l))return i}function ni(i,l){if(i==="change")return l}var cl=!1;if(c){var ja;if(c){var ii="oninput"in document;if(!ii){var gu=document.createElement("div");gu.setAttribute("oninput","return;"),ii=typeof gu.oninput=="function"}ja=ii}else ja=!1;cl=ja&&(!document.documentMode||9<document.documentMode)}function vo(){ul&&(ul.detachEvent("onpropertychange",Ic),Na=ul=null)}function Ic(i){if(i.propertyName==="value"&&Ia(Na)){var l=[];fs(l,Na,i,Fe(i)),He(fh,l)}}function jc(i,l,C){i==="focusin"?(vo(),ul=l,Na=C,ul.attachEvent("onpropertychange",Ic)):i==="focusout"&&vo()}function _r(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Ia(Na)}function vu(i,l){if(i==="click")return Ia(l)}function Dc(i,l){if(i==="input"||i==="change")return Ia(l)}function Fc(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var In=typeof Object.is=="function"?Object.is:Fc;function mo(i,l){if(In(i,l))return!0;if(typeof i!="object"||i===null||typeof l!="object"||l===null)return!1;var C=Object.keys(i),D=Object.keys(l);if(C.length!==D.length)return!1;for(D=0;D<C.length;D++){var H=C[D];if(!m.call(l,H)||!In(i[H],l[H]))return!1}return!0}function Da(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function gr(i,l){var C=Da(i);i=0;for(var D;C;){if(C.nodeType===3){if(D=i+C.textContent.length,i<=l&&D>=l)return{node:C,offset:l-i};i=D}e:{for(;C;){if(C.nextSibling){C=C.nextSibling;break e}C=C.parentNode}C=void 0}C=Da(C)}}function Ar(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?Ar(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function jr(){for(var i=window,l=pe();l instanceof i.HTMLIFrameElement;){try{var C=typeof l.contentWindow.location.href=="string"}catch{C=!1}if(C)i=l.contentWindow;else break;l=pe(i.document)}return l}function fl(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l&&(l==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||l==="textarea"||i.contentEditable==="true")}function ds(i){var l=jr(),C=i.focusedElem,D=i.selectionRange;if(l!==C&&C&&C.ownerDocument&&Ar(C.ownerDocument.documentElement,C)){if(D!==null&&fl(C)){if(l=D.start,i=D.end,i===void 0&&(i=l),"selectionStart"in C)C.selectionStart=l,C.selectionEnd=Math.min(i,C.value.length);else if(i=(l=C.ownerDocument||document)&&l.defaultView||window,i.getSelection){i=i.getSelection();var H=C.textContent.length,K=Math.min(D.start,H);D=D.end===void 0?K:Math.min(D.end,H),!i.extend&&K>D&&(H=D,D=K,K=H),H=gr(C,K);var ie=gr(C,D);H&&ie&&(i.rangeCount!==1||i.anchorNode!==H.node||i.anchorOffset!==H.offset||i.focusNode!==ie.node||i.focusOffset!==ie.offset)&&(l=l.createRange(),l.setStart(H.node,H.offset),i.removeAllRanges(),K>D?(i.addRange(l),i.extend(ie.node,ie.offset)):(l.setEnd(ie.node,ie.offset),i.addRange(l)))}}for(l=[],i=C;i=i.parentNode;)i.nodeType===1&&l.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<l.length;C++)i=l[C],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var hs=c&&"documentMode"in document&&11>=document.documentMode,dl=null,$r=null,yo=null,ps=!1;function mu(i,l,C){var D=C.window===C?C.document:C.nodeType===9?C:C.ownerDocument;ps||dl==null||dl!==pe(D)||(D=dl,"selectionStart"in D&&fl(D)?D={start:D.selectionStart,end:D.selectionEnd}:(D=(D.ownerDocument&&D.ownerDocument.defaultView||window).getSelection(),D={anchorNode:D.anchorNode,anchorOffset:D.anchorOffset,focusNode:D.focusNode,focusOffset:D.focusOffset}),yo&&mo(yo,D)||(yo=D,D=xu($r,"onSelect"),0<D.length&&(l=new yi("onSelect","select",null,l,C),i.push({event:l,listeners:D}),l.target=dl)))}function Hn(i,l){var C={};return C[i.toLowerCase()]=l.toLowerCase(),C["Webkit"+i]="webkit"+l,C["Moz"+i]="moz"+l,C}var en={animationend:Hn("Animation","AnimationEnd"),animationiteration:Hn("Animation","AnimationIteration"),animationstart:Hn("Animation","AnimationStart"),transitionend:Hn("Transition","TransitionEnd")},bo={},yu={};c&&(yu=document.createElement("div").style,"AnimationEvent"in window||(delete en.animationend.animation,delete en.animationiteration.animation,delete en.animationstart.animation),"TransitionEvent"in window||delete en.transitionend.transition);function hl(i){if(bo[i])return bo[i];if(!en[i])return i;var l=en[i],C;for(C in l)if(l.hasOwnProperty(C)&&C in yu)return bo[i]=l[C];return i}var zc=hl("animationend"),Bc=hl("animationiteration"),Uc=hl("animationstart"),qc=hl("transitionend"),Hc=new Map,Gc="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ia(i,l){Hc.set(i,l),o(l,[i])}for(var bu=0;bu<Gc.length;bu++){var wo=Gc[bu],dh=wo.toLowerCase(),wu=wo[0].toUpperCase()+wo.slice(1);ia(dh,"on"+wu)}ia(zc,"onAnimationEnd"),ia(Bc,"onAnimationIteration"),ia(Uc,"onAnimationStart"),ia("dblclick","onDoubleClick"),ia("focusin","onFocus"),ia("focusout","onBlur"),ia(qc,"onTransitionEnd"),s("onMouseEnter",["mouseout","mouseover"]),s("onMouseLeave",["mouseout","mouseover"]),s("onPointerEnter",["pointerout","pointerover"]),s("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fa="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),hh=new Set("cancel close invalid load scroll toggle".split(" ").concat(Fa));function _u(i,l,C){var D=i.type||"unknown-event";i.currentTarget=C,Jn(D,l,void 0,i),i.currentTarget=null}function Vc(i,l){l=(l&4)!==0;for(var C=0;C<i.length;C++){var D=i[C],H=D.event;D=D.listeners;e:{var K=void 0;if(l)for(var ie=D.length-1;0<=ie;ie--){var ce=D[ie],ge=ce.instance,Ne=ce.currentTarget;if(ce=ce.listener,ge!==K&&H.isPropagationStopped())break e;_u(H,ce,Ne),K=ge}else for(ie=0;ie<D.length;ie++){if(ce=D[ie],ge=ce.instance,Ne=ce.currentTarget,ce=ce.listener,ge!==K&&H.isPropagationStopped())break e;_u(H,ce,Ne),K=ge}}}if(Jt)throw i=Wt,Jt=!1,Wt=null,i}function ar(i,l){var C=l[Pu];C===void 0&&(C=l[Pu]=new Set);var D=i+"__bubble";C.has(D)||($c(l,i,2,!1),C.add(D))}function Su(i,l,C){var D=0;l&&(D|=4),$c(C,i,D,l)}var gs="_reactListening"+Math.random().toString(36).slice(2);function _o(i){if(!i[gs]){i[gs]=!0,r.forEach(function(C){C!=="selectionchange"&&(hh.has(C)||Su(C,!1,i),Su(C,!0,i))});var l=i.nodeType===9?i:i.ownerDocument;l===null||l[gs]||(l[gs]=!0,Su("selectionchange",!1,l))}}function $c(i,l,C,D){switch(th(l)){case 1:var H=mi;break;case 4:H=ea;break;default:H=al}C=H.bind(null,l,C,i),H=void 0,!Ye||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(H=!0),D?H!==void 0?i.addEventListener(l,C,{capture:!0,passive:H}):i.addEventListener(l,C,!0):H!==void 0?i.addEventListener(l,C,{passive:H}):i.addEventListener(l,C,!1)}function Eu(i,l,C,D,H){var K=D;if((l&1)===0&&(l&2)===0&&D!==null)e:for(;;){if(D===null)return;var ie=D.tag;if(ie===3||ie===4){var ce=D.stateNode.containerInfo;if(ce===H||ce.nodeType===8&&ce.parentNode===H)break;if(ie===4)for(ie=D.return;ie!==null;){var ge=ie.tag;if((ge===3||ge===4)&&(ge=ie.stateNode.containerInfo,ge===H||ge.nodeType===8&&ge.parentNode===H))return;ie=ie.return}for(;ce!==null;){if(ie=Ba(ce),ie===null)return;if(ge=ie.tag,ge===5||ge===6){D=K=ie;continue e}ce=ce.parentNode}}D=D.return}He(function(){var Ne=K,Ve=Fe(C),We=[];e:{var Ge=Hc.get(i);if(Ge!==void 0){var ot=yi,ft=i;switch(i){case"keypress":if(co(C)===0)break e;case"keydown":case"keyup":ot=oh;break;case"focusin":ft="focus",ot=su;break;case"focusout":ft="blur",ot=su;break;case"beforeblur":case"afterblur":ot=su;break;case"click":if(C.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ot=dr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ot=wi;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ot=du;break;case zc:case Bc:case Uc:ot=Ac;break;case qc:ot=ll;break;case"scroll":ot=rh;break;case"wheel":ot=Mc;break;case"copy":case"cut":case"paste":ot=uu;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ot=po}var pt=(l&4)!==0,Ur=!pt&&i==="scroll",Ae=pt?Ge!==null?Ge+"Capture":null:Ge;pt=[];for(var be=Ne,Re;be!==null;){Re=be;var Ze=Re.stateNode;if(Re.tag===5&&Ze!==null&&(Re=Ze,Ae!==null&&(Ze=Me(be,Ae),Ze!=null&&pt.push(pl(be,Ze,Re)))),Ur)break;be=be.return}0<pt.length&&(Ge=new ot(Ge,ft,null,C,Ve),We.push({event:Ge,listeners:pt}))}}if((l&7)===0){e:{if(Ge=i==="mouseover"||i==="pointerover",ot=i==="mouseout"||i==="pointerout",Ge&&C!==yt&&(ft=C.relatedTarget||C.fromElement)&&(Ba(ft)||ft[Fi]))break e;if((ot||Ge)&&(Ge=Ve.window===Ve?Ve:(Ge=Ve.ownerDocument)?Ge.defaultView||Ge.parentWindow:window,ot?(ft=C.relatedTarget||C.toElement,ot=Ne,ft=ft?Ba(ft):null,ft!==null&&(Ur=Nr(ft),ft!==Ur||ft.tag!==5&&ft.tag!==6)&&(ft=null)):(ot=null,ft=Ne),ot!==ft)){if(pt=dr,Ze="onMouseLeave",Ae="onMouseEnter",be="mouse",(i==="pointerout"||i==="pointerover")&&(pt=po,Ze="onPointerLeave",Ae="onPointerEnter",be="pointer"),Ur=ot==null?Ge:Dr(ot),Re=ft==null?Ge:Dr(ft),Ge=new pt(Ze,be+"leave",ot,C,Ve),Ge.target=Ur,Ge.relatedTarget=Re,Ze=null,Ba(Ve)===Ne&&(pt=new pt(Ae,be+"enter",ft,C,Ve),pt.target=Re,pt.relatedTarget=Ur,Ze=pt),Ur=Ze,ot&&ft)t:{for(pt=ot,Ae=ft,be=0,Re=pt;Re;Re=So(Re))be++;for(Re=0,Ze=Ae;Ze;Ze=So(Ze))Re++;for(;0<be-Re;)pt=So(pt),be--;for(;0<Re-be;)Ae=So(Ae),Re--;for(;be--;){if(pt===Ae||Ae!==null&&pt===Ae.alternate)break t;pt=So(pt),Ae=So(Ae)}pt=null}else pt=null;ot!==null&&ph(We,Ge,ot,pt,!1),ft!==null&&Ur!==null&&ph(We,Ur,ft,pt,!0)}}e:{if(Ge=Ne?Dr(Ne):window,ot=Ge.nodeName&&Ge.nodeName.toLowerCase(),ot==="select"||ot==="input"&&Ge.type==="file")var vt=ni;else if(na(Ge))if(cl)vt=Dc;else{vt=_r;var xt=jc}else(ot=Ge.nodeName)&&ot.toLowerCase()==="input"&&(Ge.type==="checkbox"||Ge.type==="radio")&&(vt=vu);if(vt&&(vt=vt(i,Ne))){fs(We,vt,C,Ve);break e}xt&&xt(i,Ge,Ne),i==="focusout"&&(xt=Ge._wrapperState)&&xt.controlled&&Ge.type==="number"&&_e(Ge,"number",Ge.value)}switch(xt=Ne?Dr(Ne):window,i){case"focusin":(na(xt)||xt.contentEditable==="true")&&(dl=xt,$r=Ne,yo=null);break;case"focusout":yo=$r=dl=null;break;case"mousedown":ps=!0;break;case"contextmenu":case"mouseup":case"dragend":ps=!1,mu(We,C,Ve);break;case"selectionchange":if(hs)break;case"keydown":case"keyup":mu(We,C,Ve)}var Ot;if(cs)e:{switch(i){case"compositionstart":var At="onCompositionStart";break e;case"compositionend":At="onCompositionEnd";break e;case"compositionupdate":At="onCompositionUpdate";break e}At=void 0}else qn?Lc(i,C)&&(At="onCompositionEnd"):i==="keydown"&&C.keyCode===229&&(At="onCompositionStart");At&&(Un&&C.locale!=="ko"&&(qn||At!=="onCompositionStart"?At==="onCompositionEnd"&&qn&&(Ot=os()):(Qr=Ve,Ma="value"in Qr?Qr.value:Qr.textContent,qn=!0)),xt=xu(Ne,At),0<xt.length&&(At=new fo(At,i,null,C,Ve),We.push({event:At,listeners:xt}),Ot?At.data=Ot:(Ot=_i(C),Ot!==null&&(At.data=Ot)))),(Ot=sl?Nc(i,C):ch(i,C))&&(Ne=xu(Ne,"onBeforeInput"),0<Ne.length&&(Ve=new fo("onBeforeInput","beforeinput",null,C,Ve),We.push({event:Ve,listeners:Ne}),Ve.data=Ot))}Vc(We,l)})}function pl(i,l,C){return{instance:i,listener:l,currentTarget:C}}function xu(i,l){for(var C=l+"Capture",D=[];i!==null;){var H=i,K=H.stateNode;H.tag===5&&K!==null&&(H=K,K=Me(i,C),K!=null&&D.unshift(pl(i,K,H)),K=Me(i,l),K!=null&&D.push(pl(i,K,H))),i=i.return}return D}function So(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function ph(i,l,C,D,H){for(var K=l._reactName,ie=[];C!==null&&C!==D;){var ce=C,ge=ce.alternate,Ne=ce.stateNode;if(ge!==null&&ge===D)break;ce.tag===5&&Ne!==null&&(ce=Ne,H?(ge=Me(C,K),ge!=null&&ie.unshift(pl(C,ge,ce))):H||(ge=Me(C,K),ge!=null&&ie.push(pl(C,ge,ce)))),C=C.return}ie.length!==0&&i.push({event:l,listeners:ie})}var rg=/\r\n?/g,gh=/\u0000|\uFFFD/g;function Wc(i){return(typeof i=="string"?i:""+i).replace(rg,`
|
|
30
30
|
`).replace(gh,"")}function vs(i,l,C){if(l=Wc(l),Wc(i)!==l&&C)throw Error(t(425))}function Eo(){}var Yc=null,Kc=null;function Xc(i,l){return i==="textarea"||i==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var Gn=typeof setTimeout=="function"?setTimeout:void 0,Zc=typeof clearTimeout=="function"?clearTimeout:void 0,ms=typeof Promise=="function"?Promise:void 0,vh=typeof queueMicrotask=="function"?queueMicrotask:typeof ms<"u"?function(i){return ms.resolve(null).then(i).catch(mh)}:Gn;function mh(i){setTimeout(function(){throw i})}function Ou(i,l){var C=l,D=0;do{var H=C.nextSibling;if(i.removeChild(C),H&&H.nodeType===8)if(C=H.data,C==="/$"){if(D===0){i.removeChild(H),Ln(l);return}D--}else C!=="$"&&C!=="$?"&&C!=="$!"||D++;C=H}while(C);Ln(l)}function Di(i){for(;i!=null;i=i.nextSibling){var l=i.nodeType;if(l===1||l===3)break;if(l===8){if(l=i.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return i}function xo(i){i=i.previousSibling;for(var l=0;i;){if(i.nodeType===8){var C=i.data;if(C==="$"||C==="$!"||C==="$?"){if(l===0)return i;l--}else C==="/$"&&l++}i=i.previousSibling}return null}var za=Math.random().toString(36).slice(2),ai="__reactFiber$"+za,ys="__reactProps$"+za,Fi="__reactContainer$"+za,Pu="__reactEvents$"+za,yh="__reactListeners$"+za,bh="__reactHandles$"+za;function Ba(i){var l=i[ai];if(l)return l;for(var C=i.parentNode;C;){if(l=C[Fi]||C[ai]){if(C=l.alternate,l.child!==null||C!==null&&C.child!==null)for(i=xo(i);i!==null;){if(C=i[ai])return C;i=xo(i)}return l}i=C,C=i.parentNode}return null}function bs(i){return i=i[ai]||i[Fi],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function Dr(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(t(33))}function Wr(i){return i[ys]||null}var Cu=[],Oo=-1;function aa(i){return{current:i}}function or(i){0>Oo||(i.current=Cu[Oo],Cu[Oo]=null,Oo--)}function rr(i,l){Oo++,Cu[Oo]=i.current,i.current=l}var zi={},tn=aa(zi),cn=aa(!1),Ua=zi;function Po(i,l){var C=i.type.contextTypes;if(!C)return zi;var D=i.stateNode;if(D&&D.__reactInternalMemoizedUnmaskedChildContext===l)return D.__reactInternalMemoizedMaskedChildContext;var H={},K;for(K in C)H[K]=l[K];return D&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=l,i.__reactInternalMemoizedMaskedChildContext=H),H}function fn(i){return i=i.childContextTypes,i!=null}function gl(){or(cn),or(tn)}function Qc(i,l,C){if(tn.current!==zi)throw Error(t(168));rr(tn,l),rr(cn,C)}function ku(i,l,C){var D=i.stateNode;if(l=l.childContextTypes,typeof D.getChildContext!="function")return C;D=D.getChildContext();for(var H in D)if(!(H in l))throw Error(t(108,Z(i)||"Unknown",H));return q({},C,D)}function Co(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||zi,Ua=tn.current,rr(tn,i),rr(cn,cn.current),!0}function wh(i,l,C){var D=i.stateNode;if(!D)throw Error(t(169));C?(i=ku(i,l,Ua),D.__reactInternalMemoizedMergedChildContext=i,or(cn),or(tn),rr(tn,i)):or(cn),rr(cn,C)}var Bi=null,vl=!1,Au=!1;function ws(i){Bi===null?Bi=[i]:Bi.push(i)}function oa(i){vl=!0,ws(i)}function qa(){if(!Au&&Bi!==null){Au=!0;var i=0,l=$t;try{var C=Bi;for($t=1;i<C.length;i++){var D=C[i];do D=D(!0);while(D!==null)}Bi=null,vl=!1}catch(H){throw Bi!==null&&(Bi=Bi.slice(i+1)),Qs(so,qa),H}finally{$t=l,Au=!1}}return null}var Sn=[],ko=0,Ha=null,Ga=0,En=[],xn=0,Va=null,Vn=1,vr="";function Ao(i,l){Sn[ko++]=Ga,Sn[ko++]=Ha,Ha=i,Ga=l}function _h(i,l,C){En[xn++]=Vn,En[xn++]=vr,En[xn++]=Va,Va=i;var D=Vn;i=vr;var H=32-Ft(D)-1;D&=~(1<<H),C+=1;var K=32-Ft(l)+H;if(30<K){var ie=H-H%5;K=(D&(1<<ie)-1).toString(32),D>>=ie,H-=ie,Vn=1<<32-Ft(l)+H|C<<H|D,vr=K+i}else Vn=1<<K|C<<H|D,vr=i}function ml(i){i.return!==null&&(Ao(i,1),_h(i,1,0))}function Yr(i){for(;i===Ha;)Ha=Sn[--ko],Sn[ko]=null,Ga=Sn[--ko],Sn[ko]=null;for(;i===Va;)Va=En[--xn],En[xn]=null,vr=En[--xn],En[xn]=null,Vn=En[--xn],En[xn]=null}var $n=null,tt=null,Zt=!1,Wn=null;function Jc(i,l){var C=Wi(5,null,null,0);C.elementType="DELETED",C.stateNode=l,C.return=i,l=i.deletions,l===null?(i.deletions=[C],i.flags|=16):l.push(C)}function Sh(i,l){switch(i.tag){case 5:var C=i.type;return l=l.nodeType!==1||C.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(i.stateNode=l,$n=i,tt=Di(l.firstChild),!0):!1;case 6:return l=i.pendingProps===""||l.nodeType!==3?null:l,l!==null?(i.stateNode=l,$n=i,tt=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(C=Va!==null?{id:Vn,overflow:vr}:null,i.memoizedState={dehydrated:l,treeContext:C,retryLane:1073741824},C=Wi(18,null,null,0),C.stateNode=l,C.return=i,i.child=C,$n=i,tt=null,!0):!1;default:return!1}}function To(i){return(i.mode&1)!==0&&(i.flags&128)===0}function yl(i){if(Zt){var l=tt;if(l){var C=l;if(!Sh(i,l)){if(To(i))throw Error(t(418));l=Di(C.nextSibling);var D=$n;l&&Sh(i,l)?Jc(D,C):(i.flags=i.flags&-4097|2,Zt=!1,$n=i)}}else{if(To(i))throw Error(t(418));i.flags=i.flags&-4097|2,Zt=!1,$n=i}}}function Tu(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;$n=i}function _s(i){if(i!==$n)return!1;if(!Zt)return Tu(i),Zt=!0,!1;var l;if((l=i.tag!==3)&&!(l=i.tag!==5)&&(l=i.type,l=l!=="head"&&l!=="body"&&!Xc(i.type,i.memoizedProps)),l&&(l=tt)){if(To(i))throw ef(),Error(t(418));for(;l;)Jc(i,l),l=Di(l.nextSibling)}if(Tu(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(t(317));e:{for(i=i.nextSibling,l=0;i;){if(i.nodeType===8){var C=i.data;if(C==="/$"){if(l===0){tt=Di(i.nextSibling);break e}l--}else C!=="$"&&C!=="$!"&&C!=="$?"||l++}i=i.nextSibling}tt=null}}else tt=$n?Di(i.stateNode.nextSibling):null;return!0}function ef(){for(var i=tt;i;)i=Di(i.nextSibling)}function Ro(){tt=$n=null,Zt=!1}function Ss(i){Wn===null?Wn=[i]:Wn.push(i)}var tf=d.ReactCurrentBatchConfig;function Cr(i,l,C){if(i=C.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(C._owner){if(C=C._owner,C){if(C.tag!==1)throw Error(t(309));var D=C.stateNode}if(!D)throw Error(t(147,i));var H=D,K=""+i;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===K?l.ref:(l=function(ie){var ce=H.refs;ie===null?delete ce[K]:ce[K]=ie},l._stringRef=K,l)}if(typeof i!="string")throw Error(t(284));if(!C._owner)throw Error(t(290,i))}return i}function jn(i,l){throw i=Object.prototype.toString.call(l),Error(t(31,i==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":i))}function Si(i){var l=i._init;return l(i._payload)}function Ru(i){function l(Ae,be){if(i){var Re=Ae.deletions;Re===null?(Ae.deletions=[be],Ae.flags|=16):Re.push(be)}}function C(Ae,be){if(!i)return null;for(;be!==null;)l(Ae,be),be=be.sibling;return null}function D(Ae,be){for(Ae=new Map;be!==null;)be.key!==null?Ae.set(be.key,be):Ae.set(be.index,be),be=be.sibling;return Ae}function H(Ae,be){return Ae=Fl(Ae,be),Ae.index=0,Ae.sibling=null,Ae}function K(Ae,be,Re){return Ae.index=Re,i?(Re=Ae.alternate,Re!==null?(Re=Re.index,Re<be?(Ae.flags|=2,be):Re):(Ae.flags|=2,be)):(Ae.flags|=1048576,be)}function ie(Ae){return i&&Ae.alternate===null&&(Ae.flags|=2),Ae}function ce(Ae,be,Re,Ze){return be===null||be.tag!==6?(be=Eg(Re,Ae.mode,Ze),be.return=Ae,be):(be=H(be,Re),be.return=Ae,be)}function ge(Ae,be,Re,Ze){var vt=Re.type;return vt===T?Ve(Ae,be,Re.props.children,Ze,Re.key):be!==null&&(be.elementType===vt||typeof vt=="object"&&vt!==null&&vt.$$typeof===V&&Si(vt)===be.type)?(Ze=H(be,Re.props),Ze.ref=Cr(Ae,be,Re),Ze.return=Ae,Ze):(Ze=Hh(Re.type,Re.key,Re.props,null,Ae.mode,Ze),Ze.ref=Cr(Ae,be,Re),Ze.return=Ae,Ze)}function Ne(Ae,be,Re,Ze){return be===null||be.tag!==4||be.stateNode.containerInfo!==Re.containerInfo||be.stateNode.implementation!==Re.implementation?(be=xg(Re,Ae.mode,Ze),be.return=Ae,be):(be=H(be,Re.children||[]),be.return=Ae,be)}function Ve(Ae,be,Re,Ze,vt){return be===null||be.tag!==7?(be=Ls(Re,Ae.mode,Ze,vt),be.return=Ae,be):(be=H(be,Re),be.return=Ae,be)}function We(Ae,be,Re){if(typeof be=="string"&&be!==""||typeof be=="number")return be=Eg(""+be,Ae.mode,Re),be.return=Ae,be;if(typeof be=="object"&&be!==null){switch(be.$$typeof){case P:return Re=Hh(be.type,be.key,be.props,null,Ae.mode,Re),Re.ref=Cr(Ae,null,be),Re.return=Ae,Re;case M:return be=xg(be,Ae.mode,Re),be.return=Ae,be;case V:var Ze=be._init;return We(Ae,Ze(be._payload),Re)}if(he(be)||X(be))return be=Ls(be,Ae.mode,Re,null),be.return=Ae,be;jn(Ae,be)}return null}function Ge(Ae,be,Re,Ze){var vt=be!==null?be.key:null;if(typeof Re=="string"&&Re!==""||typeof Re=="number")return vt!==null?null:ce(Ae,be,""+Re,Ze);if(typeof Re=="object"&&Re!==null){switch(Re.$$typeof){case P:return Re.key===vt?ge(Ae,be,Re,Ze):null;case M:return Re.key===vt?Ne(Ae,be,Re,Ze):null;case V:return vt=Re._init,Ge(Ae,be,vt(Re._payload),Ze)}if(he(Re)||X(Re))return vt!==null?null:Ve(Ae,be,Re,Ze,null);jn(Ae,Re)}return null}function ot(Ae,be,Re,Ze,vt){if(typeof Ze=="string"&&Ze!==""||typeof Ze=="number")return Ae=Ae.get(Re)||null,ce(be,Ae,""+Ze,vt);if(typeof Ze=="object"&&Ze!==null){switch(Ze.$$typeof){case P:return Ae=Ae.get(Ze.key===null?Re:Ze.key)||null,ge(be,Ae,Ze,vt);case M:return Ae=Ae.get(Ze.key===null?Re:Ze.key)||null,Ne(be,Ae,Ze,vt);case V:var xt=Ze._init;return ot(Ae,be,Re,xt(Ze._payload),vt)}if(he(Ze)||X(Ze))return Ae=Ae.get(Re)||null,Ve(be,Ae,Ze,vt,null);jn(be,Ze)}return null}function ft(Ae,be,Re,Ze){for(var vt=null,xt=null,Ot=be,At=be=0,mn=null;Ot!==null&&At<Re.length;At++){Ot.index>At?(mn=Ot,Ot=null):mn=Ot.sibling;var Kt=Ge(Ae,Ot,Re[At],Ze);if(Kt===null){Ot===null&&(Ot=mn);break}i&&Ot&&Kt.alternate===null&&l(Ae,Ot),be=K(Kt,be,At),xt===null?vt=Kt:xt.sibling=Kt,xt=Kt,Ot=mn}if(At===Re.length)return C(Ae,Ot),Zt&&Ao(Ae,At),vt;if(Ot===null){for(;At<Re.length;At++)Ot=We(Ae,Re[At],Ze),Ot!==null&&(be=K(Ot,be,At),xt===null?vt=Ot:xt.sibling=Ot,xt=Ot);return Zt&&Ao(Ae,At),vt}for(Ot=D(Ae,Ot);At<Re.length;At++)mn=ot(Ot,Ae,At,Re[At],Ze),mn!==null&&(i&&mn.alternate!==null&&Ot.delete(mn.key===null?At:mn.key),be=K(mn,be,At),xt===null?vt=mn:xt.sibling=mn,xt=mn);return i&&Ot.forEach(function(zl){return l(Ae,zl)}),Zt&&Ao(Ae,At),vt}function pt(Ae,be,Re,Ze){var vt=X(Re);if(typeof vt!="function")throw Error(t(150));if(Re=vt.call(Re),Re==null)throw Error(t(151));for(var xt=vt=null,Ot=be,At=be=0,mn=null,Kt=Re.next();Ot!==null&&!Kt.done;At++,Kt=Re.next()){Ot.index>At?(mn=Ot,Ot=null):mn=Ot.sibling;var zl=Ge(Ae,Ot,Kt.value,Ze);if(zl===null){Ot===null&&(Ot=mn);break}i&&Ot&&zl.alternate===null&&l(Ae,Ot),be=K(zl,be,At),xt===null?vt=zl:xt.sibling=zl,xt=zl,Ot=mn}if(Kt.done)return C(Ae,Ot),Zt&&Ao(Ae,At),vt;if(Ot===null){for(;!Kt.done;At++,Kt=Re.next())Kt=We(Ae,Kt.value,Ze),Kt!==null&&(be=K(Kt,be,At),xt===null?vt=Kt:xt.sibling=Kt,xt=Kt);return Zt&&Ao(Ae,At),vt}for(Ot=D(Ae,Ot);!Kt.done;At++,Kt=Re.next())Kt=ot(Ot,Ae,At,Kt.value,Ze),Kt!==null&&(i&&Kt.alternate!==null&&Ot.delete(Kt.key===null?At:Kt.key),be=K(Kt,be,At),xt===null?vt=Kt:xt.sibling=Kt,xt=Kt);return i&&Ot.forEach(function(T_){return l(Ae,T_)}),Zt&&Ao(Ae,At),vt}function Ur(Ae,be,Re,Ze){if(typeof Re=="object"&&Re!==null&&Re.type===T&&Re.key===null&&(Re=Re.props.children),typeof Re=="object"&&Re!==null){switch(Re.$$typeof){case P:e:{for(var vt=Re.key,xt=be;xt!==null;){if(xt.key===vt){if(vt=Re.type,vt===T){if(xt.tag===7){C(Ae,xt.sibling),be=H(xt,Re.props.children),be.return=Ae,Ae=be;break e}}else if(xt.elementType===vt||typeof vt=="object"&&vt!==null&&vt.$$typeof===V&&Si(vt)===xt.type){C(Ae,xt.sibling),be=H(xt,Re.props),be.ref=Cr(Ae,xt,Re),be.return=Ae,Ae=be;break e}C(Ae,xt);break}else l(Ae,xt);xt=xt.sibling}Re.type===T?(be=Ls(Re.props.children,Ae.mode,Ze,Re.key),be.return=Ae,Ae=be):(Ze=Hh(Re.type,Re.key,Re.props,null,Ae.mode,Ze),Ze.ref=Cr(Ae,be,Re),Ze.return=Ae,Ae=Ze)}return ie(Ae);case M:e:{for(xt=Re.key;be!==null;){if(be.key===xt)if(be.tag===4&&be.stateNode.containerInfo===Re.containerInfo&&be.stateNode.implementation===Re.implementation){C(Ae,be.sibling),be=H(be,Re.children||[]),be.return=Ae,Ae=be;break e}else{C(Ae,be);break}else l(Ae,be);be=be.sibling}be=xg(Re,Ae.mode,Ze),be.return=Ae,Ae=be}return ie(Ae);case V:return xt=Re._init,Ur(Ae,be,xt(Re._payload),Ze)}if(he(Re))return ft(Ae,be,Re,Ze);if(X(Re))return pt(Ae,be,Re,Ze);jn(Ae,Re)}return typeof Re=="string"&&Re!==""||typeof Re=="number"?(Re=""+Re,be!==null&&be.tag===6?(C(Ae,be.sibling),be=H(be,Re),be.return=Ae,Ae=be):(C(Ae,be),be=Eg(Re,Ae.mode,Ze),be.return=Ae,Ae=be),ie(Ae)):C(Ae,be)}return Ur}var Mo=Ru(!0),oi=Ru(!1),Es=aa(null),Yn=null,bl=null,Mu=null;function Lu(){Mu=bl=Yn=null}function Nu(i){var l=Es.current;or(Es),i._currentValue=l}function Iu(i,l,C){for(;i!==null;){var D=i.alternate;if((i.childLanes&l)!==l?(i.childLanes|=l,D!==null&&(D.childLanes|=l)):D!==null&&(D.childLanes&l)!==l&&(D.childLanes|=l),i===C)break;i=i.return}}function la(i,l){Yn=i,Mu=bl=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&l)!==0&&(J=!0),i.firstContext=null)}function On(i){var l=i._currentValue;if(Mu!==i)if(i={context:i,memoizedValue:l,next:null},bl===null){if(Yn===null)throw Error(t(308));bl=i,Yn.dependencies={lanes:0,firstContext:i}}else bl=bl.next=i;return l}var Ui=null;function wl(i){Ui===null?Ui=[i]:Ui.push(i)}function xs(i,l,C,D){var H=l.interleaved;return H===null?(C.next=C,wl(l)):(C.next=H.next,H.next=C),l.interleaved=C,Kn(i,D)}function Kn(i,l){i.lanes|=l;var C=i.alternate;for(C!==null&&(C.lanes|=l),C=i,i=i.return;i!==null;)i.childLanes|=l,C=i.alternate,C!==null&&(C.childLanes|=l),C=i,i=i.return;return C.tag===3?C.stateNode:null}var qi=!1;function Os(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ju(i,l){i=i.updateQueue,l.updateQueue===i&&(l.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function Hi(i,l){return{eventTime:i,lane:l,tag:0,payload:null,callback:null,next:null}}function Gi(i,l,C){var D=i.updateQueue;if(D===null)return null;if(D=D.shared,(Yt&2)!==0){var H=D.pending;return H===null?l.next=l:(l.next=H.next,H.next=l),D.pending=l,Kn(i,C)}return H=D.interleaved,H===null?(l.next=l,wl(D)):(l.next=H.next,H.next=l),D.interleaved=l,Kn(i,C)}function Du(i,l,C){if(l=l.updateQueue,l!==null&&(l=l.shared,(C&4194240)!==0)){var D=l.lanes;D&=i.pendingLanes,C|=D,l.lanes=C,Cc(i,C)}}function Ps(i,l){var C=i.updateQueue,D=i.alternate;if(D!==null&&(D=D.updateQueue,C===D)){var H=null,K=null;if(C=C.firstBaseUpdate,C!==null){do{var ie={eventTime:C.eventTime,lane:C.lane,tag:C.tag,payload:C.payload,callback:C.callback,next:null};K===null?H=K=ie:K=K.next=ie,C=C.next}while(C!==null);K===null?H=K=l:K=K.next=l}else H=K=l;C={baseState:D.baseState,firstBaseUpdate:H,lastBaseUpdate:K,shared:D.shared,effects:D.effects},i.updateQueue=C;return}i=C.lastBaseUpdate,i===null?C.firstBaseUpdate=l:i.next=l,C.lastBaseUpdate=l}function _l(i,l,C,D){var H=i.updateQueue;qi=!1;var K=H.firstBaseUpdate,ie=H.lastBaseUpdate,ce=H.shared.pending;if(ce!==null){H.shared.pending=null;var ge=ce,Ne=ge.next;ge.next=null,ie===null?K=Ne:ie.next=Ne,ie=ge;var Ve=i.alternate;Ve!==null&&(Ve=Ve.updateQueue,ce=Ve.lastBaseUpdate,ce!==ie&&(ce===null?Ve.firstBaseUpdate=Ne:ce.next=Ne,Ve.lastBaseUpdate=ge))}if(K!==null){var We=H.baseState;ie=0,Ve=Ne=ge=null,ce=K;do{var Ge=ce.lane,ot=ce.eventTime;if((D&Ge)===Ge){Ve!==null&&(Ve=Ve.next={eventTime:ot,lane:0,tag:ce.tag,payload:ce.payload,callback:ce.callback,next:null});e:{var ft=i,pt=ce;switch(Ge=l,ot=C,pt.tag){case 1:if(ft=pt.payload,typeof ft=="function"){We=ft.call(ot,We,Ge);break e}We=ft;break e;case 3:ft.flags=ft.flags&-65537|128;case 0:if(ft=pt.payload,Ge=typeof ft=="function"?ft.call(ot,We,Ge):ft,Ge==null)break e;We=q({},We,Ge);break e;case 2:qi=!0}}ce.callback!==null&&ce.lane!==0&&(i.flags|=64,Ge=H.effects,Ge===null?H.effects=[ce]:Ge.push(ce))}else ot={eventTime:ot,lane:Ge,tag:ce.tag,payload:ce.payload,callback:ce.callback,next:null},Ve===null?(Ne=Ve=ot,ge=We):Ve=Ve.next=ot,ie|=Ge;if(ce=ce.next,ce===null){if(ce=H.shared.pending,ce===null)break;Ge=ce,ce=Ge.next,Ge.next=null,H.lastBaseUpdate=Ge,H.shared.pending=null}}while(!0);if(Ve===null&&(ge=We),H.baseState=ge,H.firstBaseUpdate=Ne,H.lastBaseUpdate=Ve,l=H.shared.interleaved,l!==null){H=l;do ie|=H.lane,H=H.next;while(H!==l)}else K===null&&(H.shared.lanes=0);As|=ie,i.lanes=ie,i.memoizedState=We}}function Er(i,l,C){if(i=l.effects,l.effects=null,i!==null)for(l=0;l<i.length;l++){var D=i[l],H=D.callback;if(H!==null){if(D.callback=null,D=C,typeof H!="function")throw Error(t(191,H));H.call(D)}}}var Mt={},nr=aa(Mt),mr=aa(Mt),kr=aa(Mt);function Fr(i){if(i===Mt)throw Error(t(174));return i}function $a(i,l){switch(rr(kr,l),rr(mr,i),rr(nr,Mt),i=l.nodeType,i){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:Qe(null,"");break;default:i=i===8?l.parentNode:l,l=i.namespaceURI||null,i=i.tagName,l=Qe(l,i)}or(nr),rr(nr,l)}function yr(){or(nr),or(mr),or(kr)}function Sl(i){Fr(kr.current);var l=Fr(nr.current),C=Qe(l,i.type);l!==C&&(rr(mr,i),rr(nr,C))}function sa(i){mr.current===i&&(or(nr),or(mr))}var lr=aa(0);function El(i){for(var l=i;l!==null;){if(l.tag===13){var C=l.memoizedState;if(C!==null&&(C=C.dehydrated,C===null||C.data==="$?"||C.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Lo=[];function dn(){for(var i=0;i<Lo.length;i++)Lo[i]._workInProgressVersionPrimary=null;Lo.length=0}var xl=d.ReactCurrentDispatcher,Cs=d.ReactCurrentBatchConfig,Pn=0,tr=null,xr=null,Tr=null,Ei=!1,Wa=!1,li=0,Fu=0;function Rr(){throw Error(t(321))}function ks(i,l){if(l===null)return!1;for(var C=0;C<l.length&&C<i.length;C++)if(!In(i[C],l[C]))return!1;return!0}function Ol(i,l,C,D,H,K){if(Pn=K,tr=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,xl.current=i===null||i.memoizedState===null?ig:Xa,i=C(D,H),Wa){K=0;do{if(Wa=!1,li=0,25<=K)throw Error(t(301));K+=1,Tr=xr=null,l.updateQueue=null,xl.current=Hu,i=C(D,H)}while(Wa)}if(xl.current=Al,l=xr!==null&&xr.next!==null,Pn=0,Tr=xr=tr=null,Ei=!1,l)throw Error(t(300));return i}function Pl(){var i=li!==0;return li=0,i}function hr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tr===null?tr.memoizedState=Tr=i:Tr=Tr.next=i,Tr}function zr(){if(xr===null){var i=tr.alternate;i=i!==null?i.memoizedState:null}else i=xr.next;var l=Tr===null?tr.memoizedState:Tr.next;if(l!==null)Tr=l,xr=i;else{if(i===null)throw Error(t(310));xr=i,i={memoizedState:xr.memoizedState,baseState:xr.baseState,baseQueue:xr.baseQueue,queue:xr.queue,next:null},Tr===null?tr.memoizedState=Tr=i:Tr=Tr.next=i}return Tr}function hn(i,l){return typeof l=="function"?l(i):l}function pn(i){var l=zr(),C=l.queue;if(C===null)throw Error(t(311));C.lastRenderedReducer=i;var D=xr,H=D.baseQueue,K=C.pending;if(K!==null){if(H!==null){var ie=H.next;H.next=K.next,K.next=ie}D.baseQueue=H=K,C.pending=null}if(H!==null){K=H.next,D=D.baseState;var ce=ie=null,ge=null,Ne=K;do{var Ve=Ne.lane;if((Pn&Ve)===Ve)ge!==null&&(ge=ge.next={lane:0,action:Ne.action,hasEagerState:Ne.hasEagerState,eagerState:Ne.eagerState,next:null}),D=Ne.hasEagerState?Ne.eagerState:i(D,Ne.action);else{var We={lane:Ve,action:Ne.action,hasEagerState:Ne.hasEagerState,eagerState:Ne.eagerState,next:null};ge===null?(ce=ge=We,ie=D):ge=ge.next=We,tr.lanes|=Ve,As|=Ve}Ne=Ne.next}while(Ne!==null&&Ne!==K);ge===null?ie=D:ge.next=ce,In(D,l.memoizedState)||(J=!0),l.memoizedState=D,l.baseState=ie,l.baseQueue=ge,C.lastRenderedState=D}if(i=C.interleaved,i!==null){H=i;do K=H.lane,tr.lanes|=K,As|=K,H=H.next;while(H!==i)}else H===null&&(C.lanes=0);return[l.memoizedState,C.dispatch]}function zu(i){var l=zr(),C=l.queue;if(C===null)throw Error(t(311));C.lastRenderedReducer=i;var D=C.dispatch,H=C.pending,K=l.memoizedState;if(H!==null){C.pending=null;var ie=H=H.next;do K=i(K,ie.action),ie=ie.next;while(ie!==H);In(K,l.memoizedState)||(J=!0),l.memoizedState=K,l.baseQueue===null&&(l.baseState=K),C.lastRenderedState=K}return[K,D]}function Bu(){}function Uu(i,l){var C=tr,D=zr(),H=l(),K=!In(D.memoizedState,H);if(K&&(D.memoizedState=H,J=!0),D=D.queue,of(rf.bind(null,C,D,i),[i]),D.getSnapshot!==l||K||Tr!==null&&Tr.memoizedState.tag&1){if(C.flags|=2048,Cl(9,ua.bind(null,C,D,H,l),void 0,null),vn===null)throw Error(t(349));(Pn&30)!==0||Eh(C,l,H)}return H}function Eh(i,l,C){i.flags|=16384,i={getSnapshot:l,value:C},l=tr.updateQueue,l===null?(l={lastEffect:null,stores:null},tr.updateQueue=l,l.stores=[i]):(C=l.stores,C===null?l.stores=[i]:C.push(i))}function ua(i,l,C,D){l.value=C,l.getSnapshot=D,nf(l)&&qu(i)}function rf(i,l,C){return C(function(){nf(l)&&qu(i)})}function nf(i){var l=i.getSnapshot;i=i.value;try{var C=l();return!In(i,C)}catch{return!0}}function qu(i){var l=Kn(i,1);l!==null&&ha(l,i,1,-1)}function Ya(i){var l=hr();return typeof i=="function"&&(i=i()),l.memoizedState=l.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:hn,lastRenderedState:i},l.queue=i,i=i.dispatch=Ah.bind(null,tr,i),[l.memoizedState,i]}function Cl(i,l,C,D){return i={tag:i,create:l,destroy:C,deps:D,next:null},l=tr.updateQueue,l===null?(l={lastEffect:null,stores:null},tr.updateQueue=l,l.lastEffect=i.next=i):(C=l.lastEffect,C===null?l.lastEffect=i.next=i:(D=C.next,C.next=i,i.next=D,l.lastEffect=i)),i}function af(){return zr().memoizedState}function kl(i,l,C,D){var H=hr();tr.flags|=i,H.memoizedState=Cl(1|l,C,void 0,D===void 0?null:D)}function No(i,l,C,D){var H=zr();D=D===void 0?null:D;var K=void 0;if(xr!==null){var ie=xr.memoizedState;if(K=ie.destroy,D!==null&&ks(D,ie.deps)){H.memoizedState=Cl(l,C,K,D);return}}tr.flags|=i,H.memoizedState=Cl(1|l,C,K,D)}function xh(i,l){return kl(8390656,8,i,l)}function of(i,l){return No(2048,8,i,l)}function lf(i,l){return No(4,2,i,l)}function sf(i,l){return No(4,4,i,l)}function Ka(i,l){if(typeof l=="function")return i=i(),l(i),function(){l(null)};if(l!=null)return i=i(),l.current=i,function(){l.current=null}}function Oh(i,l,C){return C=C!=null?C.concat([i]):null,No(4,4,Ka.bind(null,l,i),C)}function ca(){}function uf(i,l){var C=zr();l=l===void 0?null:l;var D=C.memoizedState;return D!==null&&l!==null&&ks(l,D[1])?D[0]:(C.memoizedState=[i,l],i)}function pr(i,l){var C=zr();l=l===void 0?null:l;var D=C.memoizedState;return D!==null&&l!==null&&ks(l,D[1])?D[0]:(i=i(),C.memoizedState=[i,l],i)}function Ph(i,l,C){return(Pn&21)===0?(i.baseState&&(i.baseState=!1,J=!0),i.memoizedState=C):(In(C,l)||(C=Pc(),tr.lanes|=C,As|=C,i.baseState=!0),l)}function Ch(i,l){var C=$t;$t=C!==0&&4>C?C:4,i(!0);var D=Cs.transition;Cs.transition={};try{i(!1),l()}finally{$t=C,Cs.transition=D}}function kh(){return zr().memoizedState}function ng(i,l,C){var D=jl(i);if(C={lane:D,action:C,hasEagerState:!1,eagerState:null,next:null},cf(i))Th(l,C);else if(C=xs(i,l,C,D),C!==null){var H=Zn();ha(C,i,D,H),Xn(C,l,D)}}function Ah(i,l,C){var D=jl(i),H={lane:D,action:C,hasEagerState:!1,eagerState:null,next:null};if(cf(i))Th(l,H);else{var K=i.alternate;if(i.lanes===0&&(K===null||K.lanes===0)&&(K=l.lastRenderedReducer,K!==null))try{var ie=l.lastRenderedState,ce=K(ie,C);if(H.hasEagerState=!0,H.eagerState=ce,In(ce,ie)){var ge=l.interleaved;ge===null?(H.next=H,wl(l)):(H.next=ge.next,ge.next=H),l.interleaved=H;return}}catch{}finally{}C=xs(i,l,H,D),C!==null&&(H=Zn(),ha(C,i,D,H),Xn(C,l,D))}}function cf(i){var l=i.alternate;return i===tr||l!==null&&l===tr}function Th(i,l){Wa=Ei=!0;var C=i.pending;C===null?l.next=l:(l.next=C.next,C.next=l),i.pending=l}function Xn(i,l,C){if((C&4194240)!==0){var D=l.lanes;D&=i.pendingLanes,C|=D,l.lanes=C,Cc(i,C)}}var Al={readContext:On,useCallback:Rr,useContext:Rr,useEffect:Rr,useImperativeHandle:Rr,useInsertionEffect:Rr,useLayoutEffect:Rr,useMemo:Rr,useReducer:Rr,useRef:Rr,useState:Rr,useDebugValue:Rr,useDeferredValue:Rr,useTransition:Rr,useMutableSource:Rr,useSyncExternalStore:Rr,useId:Rr,unstable_isNewReconciler:!1},ig={readContext:On,useCallback:function(i,l){return hr().memoizedState=[i,l===void 0?null:l],i},useContext:On,useEffect:xh,useImperativeHandle:function(i,l,C){return C=C!=null?C.concat([i]):null,kl(4194308,4,Ka.bind(null,l,i),C)},useLayoutEffect:function(i,l){return kl(4194308,4,i,l)},useInsertionEffect:function(i,l){return kl(4,2,i,l)},useMemo:function(i,l){var C=hr();return l=l===void 0?null:l,i=i(),C.memoizedState=[i,l],i},useReducer:function(i,l,C){var D=hr();return l=C!==void 0?C(l):l,D.memoizedState=D.baseState=l,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:l},D.queue=i,i=i.dispatch=ng.bind(null,tr,i),[D.memoizedState,i]},useRef:function(i){var l=hr();return i={current:i},l.memoizedState=i},useState:Ya,useDebugValue:ca,useDeferredValue:function(i){return hr().memoizedState=i},useTransition:function(){var i=Ya(!1),l=i[0];return i=Ch.bind(null,i[1]),hr().memoizedState=i,[l,i]},useMutableSource:function(){},useSyncExternalStore:function(i,l,C){var D=tr,H=hr();if(Zt){if(C===void 0)throw Error(t(407));C=C()}else{if(C=l(),vn===null)throw Error(t(349));(Pn&30)!==0||Eh(D,l,C)}H.memoizedState=C;var K={value:C,getSnapshot:l};return H.queue=K,xh(rf.bind(null,D,K,i),[i]),D.flags|=2048,Cl(9,ua.bind(null,D,K,C,l),void 0,null),C},useId:function(){var i=hr(),l=vn.identifierPrefix;if(Zt){var C=vr,D=Vn;C=(D&~(1<<32-Ft(D)-1)).toString(32)+C,l=":"+l+"R"+C,C=li++,0<C&&(l+="H"+C.toString(32)),l+=":"}else C=Fu++,l=":"+l+"r"+C.toString(32)+":";return i.memoizedState=l},unstable_isNewReconciler:!1},Xa={readContext:On,useCallback:uf,useContext:On,useEffect:of,useImperativeHandle:Oh,useInsertionEffect:lf,useLayoutEffect:sf,useMemo:pr,useReducer:pn,useRef:af,useState:function(){return pn(hn)},useDebugValue:ca,useDeferredValue:function(i){var l=zr();return Ph(l,xr.memoizedState,i)},useTransition:function(){var i=pn(hn)[0],l=zr().memoizedState;return[i,l]},useMutableSource:Bu,useSyncExternalStore:Uu,useId:kh,unstable_isNewReconciler:!1},Hu={readContext:On,useCallback:uf,useContext:On,useEffect:of,useImperativeHandle:Oh,useInsertionEffect:lf,useLayoutEffect:sf,useMemo:pr,useReducer:zu,useRef:af,useState:function(){return zu(hn)},useDebugValue:ca,useDeferredValue:function(i){var l=zr();return xr===null?l.memoizedState=i:Ph(l,xr.memoizedState,i)},useTransition:function(){var i=zu(hn)[0],l=zr().memoizedState;return[i,l]},useMutableSource:Bu,useSyncExternalStore:Uu,useId:kh,unstable_isNewReconciler:!1};function rn(i,l){if(i&&i.defaultProps){l=q({},l),i=i.defaultProps;for(var C in i)l[C]===void 0&&(l[C]=i[C]);return l}return l}function Tl(i,l,C,D){l=i.memoizedState,C=C(D,l),C=C==null?l:q({},l,C),i.memoizedState=C,i.lanes===0&&(i.updateQueue.baseState=C)}var Rl={isMounted:function(i){return(i=i._reactInternals)?Nr(i)===i:!1},enqueueSetState:function(i,l,C){i=i._reactInternals;var D=Zn(),H=jl(i),K=Hi(D,H);K.payload=l,C!=null&&(K.callback=C),l=Gi(i,K,H),l!==null&&(ha(l,i,H,D),Du(l,i,H))},enqueueReplaceState:function(i,l,C){i=i._reactInternals;var D=Zn(),H=jl(i),K=Hi(D,H);K.tag=1,K.payload=l,C!=null&&(K.callback=C),l=Gi(i,K,H),l!==null&&(ha(l,i,H,D),Du(l,i,H))},enqueueForceUpdate:function(i,l){i=i._reactInternals;var C=Zn(),D=jl(i),H=Hi(C,D);H.tag=2,l!=null&&(H.callback=l),l=Gi(i,H,D),l!==null&&(ha(l,i,D,C),Du(l,i,D))}};function Gu(i,l,C,D,H,K,ie){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(D,K,ie):l.prototype&&l.prototype.isPureReactComponent?!mo(C,D)||!mo(H,K):!0}function Rh(i,l,C){var D=!1,H=zi,K=l.contextType;return typeof K=="object"&&K!==null?K=On(K):(H=fn(l)?Ua:tn.current,D=l.contextTypes,K=(D=D!=null)?Po(i,H):zi),l=new l(C,K),i.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Rl,i.stateNode=l,l._reactInternals=i,D&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=H,i.__reactInternalMemoizedMaskedChildContext=K),l}function ff(i,l,C,D){i=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(C,D),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(C,D),l.state!==i&&Rl.enqueueReplaceState(l,l.state,null)}function Vu(i,l,C,D){var H=i.stateNode;H.props=C,H.state=i.memoizedState,H.refs={},Os(i);var K=l.contextType;typeof K=="object"&&K!==null?H.context=On(K):(K=fn(l)?Ua:tn.current,H.context=Po(i,K)),H.state=i.memoizedState,K=l.getDerivedStateFromProps,typeof K=="function"&&(Tl(i,l,K,C),H.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof H.getSnapshotBeforeUpdate=="function"||typeof H.UNSAFE_componentWillMount!="function"&&typeof H.componentWillMount!="function"||(l=H.state,typeof H.componentWillMount=="function"&&H.componentWillMount(),typeof H.UNSAFE_componentWillMount=="function"&&H.UNSAFE_componentWillMount(),l!==H.state&&Rl.enqueueReplaceState(H,H.state,null),_l(i,C,H,D),H.state=i.memoizedState),typeof H.componentDidMount=="function"&&(i.flags|=4194308)}function Io(i,l){try{var C="",D=l;do C+=te(D),D=D.return;while(D);var H=C}catch(K){H=`
|
|
31
31
|
Error generating stack: `+K.message+`
|
|
32
|
-
`+K.stack}return{value:i,source:l,stack:H,digest:null}}function $u(i,l,C){return{value:i,source:null,stack:C??null,digest:l??null}}function Ml(i,l){try{console.error(l.value)}catch(C){setTimeout(function(){throw C})}}var ag=typeof WeakMap=="function"?WeakMap:Map;function Mh(i,l,C){C=Hi(-1,C),C.tag=3,C.payload={element:null};var D=l.value;return C.callback=function(){Dh||(Dh=!0,gg=D),Ml(i,l)},C}function u(i,l,C){C=Hi(-1,C),C.tag=3;var D=i.type.getDerivedStateFromError;if(typeof D=="function"){var H=l.value;C.payload=function(){return D(H)},C.callback=function(){Ml(i,l)}}var K=i.stateNode;return K!==null&&typeof K.componentDidCatch=="function"&&(C.callback=function(){Ml(i,l),typeof D!="function"&&(Nl===null?Nl=new Set([this]):Nl.add(this));var ie=l.stack;this.componentDidCatch(l.value,{componentStack:ie!==null?ie:""})}),C}function p(i,l,C){var D=i.pingCache;if(D===null){D=i.pingCache=new ag;var H=new Set;D.set(l,H)}else H=D.get(l),H===void 0&&(H=new Set,D.set(l,H));H.has(C)||(H.add(C),i=b_.bind(null,i,l,C),l.then(i,i))}function j(i){do{var l;if((l=i.tag===13)&&(l=i.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return i;i=i.return}while(i!==null);return null}function B(i,l,C,D,H){return(i.mode&1)===0?(i===l?i.flags|=65536:(i.flags|=128,C.flags|=131072,C.flags&=-52805,C.tag===1&&(C.alternate===null?C.tag=17:(l=Hi(-1,1),l.tag=2,Gi(C,l,1))),C.lanes|=1),i):(i.flags|=65536,i.lanes=H,i)}var $=d.ReactCurrentOwner,J=!1;function le(i,l,C,D){l.child=i===null?oi(l,null,C,D):Mo(l,i.child,C,D)}function Ee(i,l,C,D,H){C=C.render;var K=l.ref;return la(l,H),D=Ol(i,l,C,D,K,H),C=Pl(),i!==null&&!J?(l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~H,gn(i,l,H)):(Zt&&C&&ml(l),l.flags|=1,le(i,l,D,H),l.child)}function Ie(i,l,C,D,H){if(i===null){var K=C.type;return typeof K=="function"&&!Sg(K)&&K.defaultProps===void 0&&C.compare===null&&C.defaultProps===void 0?(l.tag=15,l.type=K,Xe(i,l,K,D,H)):(i=Hh(C.type,null,D,l,l.mode,H),i.ref=l.ref,i.return=l,l.child=i)}if(K=i.child,(i.lanes&H)===0){var ie=K.memoizedProps;if(C=C.compare,C=C!==null?C:mo,C(ie,D)&&i.ref===l.ref)return gn(i,l,H)}return l.flags|=1,i=Fl(K,D),i.ref=l.ref,i.return=l,l.child=i}function Xe(i,l,C,D,H){if(i!==null){var K=i.memoizedProps;if(mo(K,D)&&i.ref===l.ref)if(J=!1,l.pendingProps=D=K,(i.lanes&H)!==0)(i.flags&131072)!==0&&(J=!0);else return l.lanes=i.lanes,gn(i,l,H)}return nt(i,l,C,D,H)}function st(i,l,C){var D=l.pendingProps,H=D.children,K=i!==null?i.memoizedState:null;if(D.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},rr(Yu,xi),xi|=C;else{if((C&1073741824)===0)return i=K!==null?K.baseLanes|C:C,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:i,cachePool:null,transitions:null},l.updateQueue=null,rr(Yu,xi),xi|=i,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},D=K!==null?K.baseLanes:C,rr(Yu,xi),xi|=D}else K!==null?(D=K.baseLanes|C,l.memoizedState=null):D=C,rr(Yu,xi),xi|=D;return le(i,l,H,C),l.child}function Tt(i,l){var C=l.ref;(i===null&&C!==null||i!==null&&i.ref!==C)&&(l.flags|=512,l.flags|=2097152)}function nt(i,l,C,D,H){var K=fn(C)?Ua:tn.current;return K=Po(l,K),la(l,H),C=Ol(i,l,C,D,K,H),D=Pl(),i!==null&&!J?(l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~H,gn(i,l,H)):(Zt&&D&&ml(l),l.flags|=1,le(i,l,C,H),l.child)}function sr(i,l,C,D,H){if(fn(C)){var K=!0;Co(l)}else K=!1;if(la(l,H),l.stateNode===null)Ut(i,l),Rh(l,C,D),Vu(l,C,D,H),D=!0;else if(i===null){var ie=l.stateNode,ce=l.memoizedProps;ie.props=ce;var ge=ie.context,Ne=C.contextType;typeof Ne=="object"&&Ne!==null?Ne=On(Ne):(Ne=fn(C)?Ua:tn.current,Ne=Po(l,Ne));var Ve=C.getDerivedStateFromProps,We=typeof Ve=="function"||typeof ie.getSnapshotBeforeUpdate=="function";We||typeof ie.UNSAFE_componentWillReceiveProps!="function"&&typeof ie.componentWillReceiveProps!="function"||(ce!==D||ge!==Ne)&&ff(l,ie,D,Ne),qi=!1;var Ge=l.memoizedState;ie.state=Ge,_l(l,D,ie,H),ge=l.memoizedState,ce!==D||Ge!==ge||cn.current||qi?(typeof Ve=="function"&&(Tl(l,C,Ve,D),ge=l.memoizedState),(ce=qi||Gu(l,C,ce,D,Ge,ge,Ne))?(We||typeof ie.UNSAFE_componentWillMount!="function"&&typeof ie.componentWillMount!="function"||(typeof ie.componentWillMount=="function"&&ie.componentWillMount(),typeof ie.UNSAFE_componentWillMount=="function"&&ie.UNSAFE_componentWillMount()),typeof ie.componentDidMount=="function"&&(l.flags|=4194308)):(typeof ie.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=D,l.memoizedState=ge),ie.props=D,ie.state=ge,ie.context=Ne,D=ce):(typeof ie.componentDidMount=="function"&&(l.flags|=4194308),D=!1)}else{ie=l.stateNode,ju(i,l),ce=l.memoizedProps,Ne=l.type===l.elementType?ce:rn(l.type,ce),ie.props=Ne,We=l.pendingProps,Ge=ie.context,ge=C.contextType,typeof ge=="object"&&ge!==null?ge=On(ge):(ge=fn(C)?Ua:tn.current,ge=Po(l,ge));var ot=C.getDerivedStateFromProps;(Ve=typeof ot=="function"||typeof ie.getSnapshotBeforeUpdate=="function")||typeof ie.UNSAFE_componentWillReceiveProps!="function"&&typeof ie.componentWillReceiveProps!="function"||(ce!==We||Ge!==ge)&&ff(l,ie,D,ge),qi=!1,Ge=l.memoizedState,ie.state=Ge,_l(l,D,ie,H);var ft=l.memoizedState;ce!==We||Ge!==ft||cn.current||qi?(typeof ot=="function"&&(Tl(l,C,ot,D),ft=l.memoizedState),(Ne=qi||Gu(l,C,Ne,D,Ge,ft,ge)||!1)?(Ve||typeof ie.UNSAFE_componentWillUpdate!="function"&&typeof ie.componentWillUpdate!="function"||(typeof ie.componentWillUpdate=="function"&&ie.componentWillUpdate(D,ft,ge),typeof ie.UNSAFE_componentWillUpdate=="function"&&ie.UNSAFE_componentWillUpdate(D,ft,ge)),typeof ie.componentDidUpdate=="function"&&(l.flags|=4),typeof ie.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof ie.componentDidUpdate!="function"||ce===i.memoizedProps&&Ge===i.memoizedState||(l.flags|=4),typeof ie.getSnapshotBeforeUpdate!="function"||ce===i.memoizedProps&&Ge===i.memoizedState||(l.flags|=1024),l.memoizedProps=D,l.memoizedState=ft),ie.props=D,ie.state=ft,ie.context=ge,D=Ne):(typeof ie.componentDidUpdate!="function"||ce===i.memoizedProps&&Ge===i.memoizedState||(l.flags|=4),typeof ie.getSnapshotBeforeUpdate!="function"||ce===i.memoizedProps&&Ge===i.memoizedState||(l.flags|=1024),D=!1)}return Qt(i,l,C,D,K,H)}function Qt(i,l,C,D,H,K){Tt(i,l);var ie=(l.flags&128)!==0;if(!D&&!ie)return H&&wh(l,C,!1),gn(i,l,K);D=l.stateNode,$.current=l;var ce=ie&&typeof C.getDerivedStateFromError!="function"?null:D.render();return l.flags|=1,i!==null&&ie?(l.child=Mo(l,i.child,null,K),l.child=Mo(l,null,ce,K)):le(i,l,ce,K),l.memoizedState=D.state,H&&wh(l,C,!0),l.child}function Cn(i){var l=i.stateNode;l.pendingContext?Qc(i,l.pendingContext,l.pendingContext!==l.context):l.context&&Qc(i,l.context,!1),$a(i,l.containerInfo)}function Vi(i,l,C,D,H){return Ro(),Ss(H),l.flags|=256,le(i,l,C,D),l.child}var Le={dehydrated:null,treeContext:null,retryLane:0};function Ce(i){return{baseLanes:i,cachePool:null,transitions:null}}function De(i,l,C){var D=l.pendingProps,H=lr.current,K=!1,ie=(l.flags&128)!==0,ce;if((ce=ie)||(ce=i!==null&&i.memoizedState===null?!1:(H&2)!==0),ce?(K=!0,l.flags&=-129):(i===null||i.memoizedState!==null)&&(H|=1),rr(lr,H&1),i===null)return yl(l),i=l.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((l.mode&1)===0?l.lanes=1:i.data==="$!"?l.lanes=8:l.lanes=1073741824,null):(ie=D.children,i=D.fallback,K?(D=l.mode,K=l.child,ie={mode:"hidden",children:ie},(D&1)===0&&K!==null?(K.childLanes=0,K.pendingProps=ie):K=Gh(ie,D,0,null),i=Ls(i,D,C,null),K.return=l,i.return=l,K.sibling=i,l.child=K,l.child.memoizedState=Ce(C),l.memoizedState=Le,i):it(l,ie));if(H=i.memoizedState,H!==null&&(ce=H.dehydrated,ce!==null))return It(i,l,ie,D,ce,H,C);if(K){K=D.fallback,ie=l.mode,H=i.child,ce=H.sibling;var ge={mode:"hidden",children:D.children};return(ie&1)===0&&l.child!==H?(D=l.child,D.childLanes=0,D.pendingProps=ge,l.deletions=null):(D=Fl(H,ge),D.subtreeFlags=H.subtreeFlags&14680064),ce!==null?K=Fl(ce,K):(K=Ls(K,ie,C,null),K.flags|=2),K.return=l,D.return=l,D.sibling=K,l.child=D,D=K,K=l.child,ie=i.child.memoizedState,ie=ie===null?Ce(C):{baseLanes:ie.baseLanes|C,cachePool:null,transitions:ie.transitions},K.memoizedState=ie,K.childLanes=i.childLanes&~C,l.memoizedState=Le,D}return K=i.child,i=K.sibling,D=Fl(K,{mode:"visible",children:D.children}),(l.mode&1)===0&&(D.lanes=C),D.return=l,D.sibling=null,i!==null&&(C=l.deletions,C===null?(l.deletions=[i],l.flags|=16):C.push(i)),l.child=D,l.memoizedState=null,D}function it(i,l){return l=Gh({mode:"visible",children:l},i.mode,0,null),l.return=i,i.child=l}function _t(i,l,C,D){return D!==null&&Ss(D),Mo(l,i.child,null,C),i=it(l,l.pendingProps.children),i.flags|=2,l.memoizedState=null,i}function It(i,l,C,D,H,K,ie){if(C)return l.flags&256?(l.flags&=-257,D=$u(Error(t(422))),_t(i,l,ie,D)):l.memoizedState!==null?(l.child=i.child,l.flags|=128,null):(K=D.fallback,H=l.mode,D=Gh({mode:"visible",children:D.children},H,0,null),K=Ls(K,H,ie,null),K.flags|=2,D.return=l,K.return=l,D.sibling=K,l.child=D,(l.mode&1)!==0&&Mo(l,i.child,null,ie),l.child.memoizedState=Ce(ie),l.memoizedState=Le,K);if((l.mode&1)===0)return _t(i,l,ie,null);if(H.data==="$!"){if(D=H.nextSibling&&H.nextSibling.dataset,D)var ce=D.dgst;return D=ce,K=Error(t(419)),D=$u(K,D,void 0),_t(i,l,ie,D)}if(ce=(ie&i.childLanes)!==0,J||ce){if(D=vn,D!==null){switch(ie&-ie){case 4:H=2;break;case 16:H=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:H=32;break;case 536870912:H=268435456;break;default:H=0}H=(H&(D.suspendedLanes|ie))!==0?0:H,H!==0&&H!==K.retryLane&&(K.retryLane=H,Kn(i,H),ha(D,i,H,-1))}return _g(),D=$u(Error(t(421))),_t(i,l,ie,D)}return H.data==="$?"?(l.flags|=128,l.child=i.child,l=w_.bind(null,i),H._reactRetry=l,null):(i=K.treeContext,tt=Di(H.nextSibling),$n=l,Zt=!0,Wn=null,i!==null&&(En[xn++]=Vn,En[xn++]=vr,En[xn++]=Va,Vn=i.id,vr=i.overflow,Va=l),l=it(l,D.children),l.flags|=4096,l)}function Rt(i,l,C){i.lanes|=l;var D=i.alternate;D!==null&&(D.lanes|=l),Iu(i.return,l,C)}function Ht(i,l,C,D,H){var K=i.memoizedState;K===null?i.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:D,tail:C,tailMode:H}:(K.isBackwards=l,K.rendering=null,K.renderingStartTime=0,K.last=D,K.tail=C,K.tailMode=H)}function Br(i,l,C){var D=l.pendingProps,H=D.revealOrder,K=D.tail;if(le(i,l,D.children,C),D=lr.current,(D&2)!==0)D=D&1|2,l.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=l.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Rt(i,C,l);else if(i.tag===19)Rt(i,C,l);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break e;for(;i.sibling===null;){if(i.return===null||i.return===l)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}D&=1}if(rr(lr,D),(l.mode&1)===0)l.memoizedState=null;else switch(H){case"forwards":for(C=l.child,H=null;C!==null;)i=C.alternate,i!==null&&El(i)===null&&(H=C),C=C.sibling;C=H,C===null?(H=l.child,l.child=null):(H=C.sibling,C.sibling=null),Ht(l,!1,H,C,K);break;case"backwards":for(C=null,H=l.child,l.child=null;H!==null;){if(i=H.alternate,i!==null&&El(i)===null){l.child=H;break}i=H.sibling,H.sibling=C,C=H,H=i}Ht(l,!0,C,null,K);break;case"together":Ht(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Ut(i,l){(l.mode&1)===0&&i!==null&&(i.alternate=null,l.alternate=null,l.flags|=2)}function gn(i,l,C){if(i!==null&&(l.dependencies=i.dependencies),As|=l.lanes,(C&l.childLanes)===0)return null;if(i!==null&&l.child!==i.child)throw Error(t(153));if(l.child!==null){for(i=l.child,C=Fl(i,i.pendingProps),l.child=C,C.return=l;i.sibling!==null;)i=i.sibling,C=C.sibling=Fl(i,i.pendingProps),C.return=l;C.sibling=null}return l.child}function og(i,l,C){switch(l.tag){case 3:Cn(l),Ro();break;case 5:Sl(l);break;case 1:fn(l.type)&&Co(l);break;case 4:$a(l,l.stateNode.containerInfo);break;case 10:var D=l.type._context,H=l.memoizedProps.value;rr(Es,D._currentValue),D._currentValue=H;break;case 13:if(D=l.memoizedState,D!==null)return D.dehydrated!==null?(rr(lr,lr.current&1),l.flags|=128,null):(C&l.child.childLanes)!==0?De(i,l,C):(rr(lr,lr.current&1),i=gn(i,l,C),i!==null?i.sibling:null);rr(lr,lr.current&1);break;case 19:if(D=(C&l.childLanes)!==0,(i.flags&128)!==0){if(D)return Br(i,l,C);l.flags|=128}if(H=l.memoizedState,H!==null&&(H.rendering=null,H.tail=null,H.lastEffect=null),rr(lr,lr.current),D)break;return null;case 22:case 23:return l.lanes=0,st(i,l,C)}return gn(i,l,C)}var nm,lg,im,am;nm=function(i,l){for(var C=l.child;C!==null;){if(C.tag===5||C.tag===6)i.appendChild(C.stateNode);else if(C.tag!==4&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===l)break;for(;C.sibling===null;){if(C.return===null||C.return===l)return;C=C.return}C.sibling.return=C.return,C=C.sibling}},lg=function(){},im=function(i,l,C,D){var H=i.memoizedProps;if(H!==D){i=l.stateNode,Fr(nr.current);var K=null;switch(C){case"input":H=ye(i,H),D=ye(i,D),K=[];break;case"select":H=q({},H,{value:void 0}),D=q({},D,{value:void 0}),K=[];break;case"textarea":H=oe(i,H),D=oe(i,D),K=[];break;default:typeof H.onClick!="function"&&typeof D.onClick=="function"&&(i.onclick=Eo)}Oe(C,D);var ie;C=null;for(Ne in H)if(!D.hasOwnProperty(Ne)&&H.hasOwnProperty(Ne)&&H[Ne]!=null)if(Ne==="style"){var ce=H[Ne];for(ie in ce)ce.hasOwnProperty(ie)&&(C||(C={}),C[ie]="")}else Ne!=="dangerouslySetInnerHTML"&&Ne!=="children"&&Ne!=="suppressContentEditableWarning"&&Ne!=="suppressHydrationWarning"&&Ne!=="autoFocus"&&(a.hasOwnProperty(Ne)?K||(K=[]):(K=K||[]).push(Ne,null));for(Ne in D){var ge=D[Ne];if(ce=H!=null?H[Ne]:void 0,D.hasOwnProperty(Ne)&&ge!==ce&&(ge!=null||ce!=null))if(Ne==="style")if(ce){for(ie in ce)!ce.hasOwnProperty(ie)||ge&&ge.hasOwnProperty(ie)||(C||(C={}),C[ie]="");for(ie in ge)ge.hasOwnProperty(ie)&&ce[ie]!==ge[ie]&&(C||(C={}),C[ie]=ge[ie])}else C||(K||(K=[]),K.push(Ne,C)),C=ge;else Ne==="dangerouslySetInnerHTML"?(ge=ge?ge.__html:void 0,ce=ce?ce.__html:void 0,ge!=null&&ce!==ge&&(K=K||[]).push(Ne,ge)):Ne==="children"?typeof ge!="string"&&typeof ge!="number"||(K=K||[]).push(Ne,""+ge):Ne!=="suppressContentEditableWarning"&&Ne!=="suppressHydrationWarning"&&(a.hasOwnProperty(Ne)?(ge!=null&&Ne==="onScroll"&&ar("scroll",i),K||ce===ge||(K=[])):(K=K||[]).push(Ne,ge))}C&&(K=K||[]).push("style",C);var Ne=K;(l.updateQueue=Ne)&&(l.flags|=4)}},am=function(i,l,C,D){C!==D&&(l.flags|=4)};function df(i,l){if(!Zt)switch(i.tailMode){case"hidden":l=i.tail;for(var C=null;l!==null;)l.alternate!==null&&(C=l),l=l.sibling;C===null?i.tail=null:C.sibling=null;break;case"collapsed":C=i.tail;for(var D=null;C!==null;)C.alternate!==null&&(D=C),C=C.sibling;D===null?l||i.tail===null?i.tail=null:i.tail.sibling=null:D.sibling=null}}function Dn(i){var l=i.alternate!==null&&i.alternate.child===i.child,C=0,D=0;if(l)for(var H=i.child;H!==null;)C|=H.lanes|H.childLanes,D|=H.subtreeFlags&14680064,D|=H.flags&14680064,H.return=i,H=H.sibling;else for(H=i.child;H!==null;)C|=H.lanes|H.childLanes,D|=H.subtreeFlags,D|=H.flags,H.return=i,H=H.sibling;return i.subtreeFlags|=D,i.childLanes=C,l}function u_(i,l,C){var D=l.pendingProps;switch(Yr(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Dn(l),null;case 1:return fn(l.type)&&gl(),Dn(l),null;case 3:return D=l.stateNode,yr(),or(cn),or(tn),dn(),D.pendingContext&&(D.context=D.pendingContext,D.pendingContext=null),(i===null||i.child===null)&&(_s(l)?l.flags|=4:i===null||i.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Wn!==null&&(yg(Wn),Wn=null))),lg(i,l),Dn(l),null;case 5:sa(l);var H=Fr(kr.current);if(C=l.type,i!==null&&l.stateNode!=null)im(i,l,C,D,H),i.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!D){if(l.stateNode===null)throw Error(t(166));return Dn(l),null}if(i=Fr(nr.current),_s(l)){D=l.stateNode,C=l.type;var K=l.memoizedProps;switch(D[ai]=l,D[ys]=K,i=(l.mode&1)!==0,C){case"dialog":ar("cancel",D),ar("close",D);break;case"iframe":case"object":case"embed":ar("load",D);break;case"video":case"audio":for(H=0;H<Fa.length;H++)ar(Fa[H],D);break;case"source":ar("error",D);break;case"img":case"image":case"link":ar("error",D),ar("load",D);break;case"details":ar("toggle",D);break;case"input":we(D,K),ar("invalid",D);break;case"select":D._wrapperState={wasMultiple:!!K.multiple},ar("invalid",D);break;case"textarea":ve(D,K),ar("invalid",D)}Oe(C,K),H=null;for(var ie in K)if(K.hasOwnProperty(ie)){var ce=K[ie];ie==="children"?typeof ce=="string"?D.textContent!==ce&&(K.suppressHydrationWarning!==!0&&vs(D.textContent,ce,i),H=["children",ce]):typeof ce=="number"&&D.textContent!==""+ce&&(K.suppressHydrationWarning!==!0&&vs(D.textContent,ce,i),H=["children",""+ce]):a.hasOwnProperty(ie)&&ce!=null&&ie==="onScroll"&&ar("scroll",D)}switch(C){case"input":ue(D),se(D,K,!0);break;case"textarea":ue(D),ke(D);break;case"select":case"option":break;default:typeof K.onClick=="function"&&(D.onclick=Eo)}D=H,l.updateQueue=D,D!==null&&(l.flags|=4)}else{ie=H.nodeType===9?H:H.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=Be(C)),i==="http://www.w3.org/1999/xhtml"?C==="script"?(i=ie.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof D.is=="string"?i=ie.createElement(C,{is:D.is}):(i=ie.createElement(C),C==="select"&&(ie=i,D.multiple?ie.multiple=!0:D.size&&(ie.size=D.size))):i=ie.createElementNS(i,C),i[ai]=l,i[ys]=D,nm(i,l,!1,!1),l.stateNode=i;e:{switch(ie=Se(C,D),C){case"dialog":ar("cancel",i),ar("close",i),H=D;break;case"iframe":case"object":case"embed":ar("load",i),H=D;break;case"video":case"audio":for(H=0;H<Fa.length;H++)ar(Fa[H],i);H=D;break;case"source":ar("error",i),H=D;break;case"img":case"image":case"link":ar("error",i),ar("load",i),H=D;break;case"details":ar("toggle",i),H=D;break;case"input":we(i,D),H=ye(i,D),ar("invalid",i);break;case"option":H=D;break;case"select":i._wrapperState={wasMultiple:!!D.multiple},H=q({},D,{value:void 0}),ar("invalid",i);break;case"textarea":ve(i,D),H=oe(i,D),ar("invalid",i);break;default:H=D}Oe(C,H),ce=H;for(K in ce)if(ce.hasOwnProperty(K)){var ge=ce[K];K==="style"?kt(i,ge):K==="dangerouslySetInnerHTML"?(ge=ge?ge.__html:void 0,ge!=null&&St(i,ge)):K==="children"?typeof ge=="string"?(C!=="textarea"||ge!=="")&&Ue(i,ge):typeof ge=="number"&&Ue(i,""+ge):K!=="suppressContentEditableWarning"&&K!=="suppressHydrationWarning"&&K!=="autoFocus"&&(a.hasOwnProperty(K)?ge!=null&&K==="onScroll"&&ar("scroll",i):ge!=null&&h(i,K,ge,ie))}switch(C){case"input":ue(i),se(i,D,!1);break;case"textarea":ue(i),ke(i);break;case"option":D.value!=null&&i.setAttribute("value",""+re(D.value));break;case"select":i.multiple=!!D.multiple,K=D.value,K!=null?xe(i,!!D.multiple,K,!1):D.defaultValue!=null&&xe(i,!!D.multiple,D.defaultValue,!0);break;default:typeof H.onClick=="function"&&(i.onclick=Eo)}switch(C){case"button":case"input":case"select":case"textarea":D=!!D.autoFocus;break e;case"img":D=!0;break e;default:D=!1}}D&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return Dn(l),null;case 6:if(i&&l.stateNode!=null)am(i,l,i.memoizedProps,D);else{if(typeof D!="string"&&l.stateNode===null)throw Error(t(166));if(C=Fr(kr.current),Fr(nr.current),_s(l)){if(D=l.stateNode,C=l.memoizedProps,D[ai]=l,(K=D.nodeValue!==C)&&(i=$n,i!==null))switch(i.tag){case 3:vs(D.nodeValue,C,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&vs(D.nodeValue,C,(i.mode&1)!==0)}K&&(l.flags|=4)}else D=(C.nodeType===9?C:C.ownerDocument).createTextNode(D),D[ai]=l,l.stateNode=D}return Dn(l),null;case 13:if(or(lr),D=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(Zt&&tt!==null&&(l.mode&1)!==0&&(l.flags&128)===0)ef(),Ro(),l.flags|=98560,K=!1;else if(K=_s(l),D!==null&&D.dehydrated!==null){if(i===null){if(!K)throw Error(t(318));if(K=l.memoizedState,K=K!==null?K.dehydrated:null,!K)throw Error(t(317));K[ai]=l}else Ro(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Dn(l),K=!1}else Wn!==null&&(yg(Wn),Wn=null),K=!0;if(!K)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=C,l):(D=D!==null,D!==(i!==null&&i.memoizedState!==null)&&D&&(l.child.flags|=8192,(l.mode&1)!==0&&(i===null||(lr.current&1)!==0?nn===0&&(nn=3):_g())),l.updateQueue!==null&&(l.flags|=4),Dn(l),null);case 4:return yr(),lg(i,l),i===null&&_o(l.stateNode.containerInfo),Dn(l),null;case 10:return Nu(l.type._context),Dn(l),null;case 17:return fn(l.type)&&gl(),Dn(l),null;case 19:if(or(lr),K=l.memoizedState,K===null)return Dn(l),null;if(D=(l.flags&128)!==0,ie=K.rendering,ie===null)if(D)df(K,!1);else{if(nn!==0||i!==null&&(i.flags&128)!==0)for(i=l.child;i!==null;){if(ie=El(i),ie!==null){for(l.flags|=128,df(K,!1),D=ie.updateQueue,D!==null&&(l.updateQueue=D,l.flags|=4),l.subtreeFlags=0,D=C,C=l.child;C!==null;)K=C,i=D,K.flags&=14680066,ie=K.alternate,ie===null?(K.childLanes=0,K.lanes=i,K.child=null,K.subtreeFlags=0,K.memoizedProps=null,K.memoizedState=null,K.updateQueue=null,K.dependencies=null,K.stateNode=null):(K.childLanes=ie.childLanes,K.lanes=ie.lanes,K.child=ie.child,K.subtreeFlags=0,K.deletions=null,K.memoizedProps=ie.memoizedProps,K.memoizedState=ie.memoizedState,K.updateQueue=ie.updateQueue,K.type=ie.type,i=ie.dependencies,K.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),C=C.sibling;return rr(lr,lr.current&1|2),l.child}i=i.sibling}K.tail!==null&&Pr()>Ku&&(l.flags|=128,D=!0,df(K,!1),l.lanes=4194304)}else{if(!D)if(i=El(ie),i!==null){if(l.flags|=128,D=!0,C=i.updateQueue,C!==null&&(l.updateQueue=C,l.flags|=4),df(K,!0),K.tail===null&&K.tailMode==="hidden"&&!ie.alternate&&!Zt)return Dn(l),null}else 2*Pr()-K.renderingStartTime>Ku&&C!==1073741824&&(l.flags|=128,D=!0,df(K,!1),l.lanes=4194304);K.isBackwards?(ie.sibling=l.child,l.child=ie):(C=K.last,C!==null?C.sibling=ie:l.child=ie,K.last=ie)}return K.tail!==null?(l=K.tail,K.rendering=l,K.tail=l.sibling,K.renderingStartTime=Pr(),l.sibling=null,C=lr.current,rr(lr,D?C&1|2:C&1),l):(Dn(l),null);case 22:case 23:return wg(),D=l.memoizedState!==null,i!==null&&i.memoizedState!==null!==D&&(l.flags|=8192),D&&(l.mode&1)!==0?(xi&1073741824)!==0&&(Dn(l),l.subtreeFlags&6&&(l.flags|=8192)):Dn(l),null;case 24:return null;case 25:return null}throw Error(t(156,l.tag))}function c_(i,l){switch(Yr(l),l.tag){case 1:return fn(l.type)&&gl(),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return yr(),or(cn),or(tn),dn(),i=l.flags,(i&65536)!==0&&(i&128)===0?(l.flags=i&-65537|128,l):null;case 5:return sa(l),null;case 13:if(or(lr),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(t(340));Ro()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return or(lr),null;case 4:return yr(),null;case 10:return Nu(l.type._context),null;case 22:case 23:return wg(),null;case 24:return null;default:return null}}var Lh=!1,Fn=!1,f_=typeof WeakSet=="function"?WeakSet:Set,ct=null;function Wu(i,l){var C=i.ref;if(C!==null)if(typeof C=="function")try{C(null)}catch(D){Mr(i,l,D)}else C.current=null}function sg(i,l,C){try{C()}catch(D){Mr(i,l,D)}}var om=!1;function d_(i,l){if(Yc=ou,i=jr(),fl(i)){if("selectionStart"in i)var C={start:i.selectionStart,end:i.selectionEnd};else e:{C=(C=i.ownerDocument)&&C.defaultView||window;var D=C.getSelection&&C.getSelection();if(D&&D.rangeCount!==0){C=D.anchorNode;var H=D.anchorOffset,K=D.focusNode;D=D.focusOffset;try{C.nodeType,K.nodeType}catch{C=null;break e}var ie=0,ce=-1,ge=-1,Ne=0,Ve=0,We=i,Ge=null;t:for(;;){for(var ot;We!==C||H!==0&&We.nodeType!==3||(ce=ie+H),We!==K||D!==0&&We.nodeType!==3||(ge=ie+D),We.nodeType===3&&(ie+=We.nodeValue.length),(ot=We.firstChild)!==null;)Ge=We,We=ot;for(;;){if(We===i)break t;if(Ge===C&&++Ne===H&&(ce=ie),Ge===K&&++Ve===D&&(ge=ie),(ot=We.nextSibling)!==null)break;We=Ge,Ge=We.parentNode}We=ot}C=ce===-1||ge===-1?null:{start:ce,end:ge}}else C=null}C=C||{start:0,end:0}}else C=null;for(Kc={focusedElem:i,selectionRange:C},ou=!1,ct=l;ct!==null;)if(l=ct,i=l.child,(l.subtreeFlags&1028)!==0&&i!==null)i.return=l,ct=i;else for(;ct!==null;){l=ct;try{var ft=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(ft!==null){var pt=ft.memoizedProps,Ur=ft.memoizedState,Ae=l.stateNode,be=Ae.getSnapshotBeforeUpdate(l.elementType===l.type?pt:rn(l.type,pt),Ur);Ae.__reactInternalSnapshotBeforeUpdate=be}break;case 3:var Re=l.stateNode.containerInfo;Re.nodeType===1?Re.textContent="":Re.nodeType===9&&Re.documentElement&&Re.removeChild(Re.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(Ze){Mr(l,l.return,Ze)}if(i=l.sibling,i!==null){i.return=l.return,ct=i;break}ct=l.return}return ft=om,om=!1,ft}function hf(i,l,C){var D=l.updateQueue;if(D=D!==null?D.lastEffect:null,D!==null){var H=D=D.next;do{if((H.tag&i)===i){var K=H.destroy;H.destroy=void 0,K!==void 0&&sg(l,C,K)}H=H.next}while(H!==D)}}function Nh(i,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var C=l=l.next;do{if((C.tag&i)===i){var D=C.create;C.destroy=D()}C=C.next}while(C!==l)}}function ug(i){var l=i.ref;if(l!==null){var C=i.stateNode;switch(i.tag){case 5:i=C;break;default:i=C}typeof l=="function"?l(i):l.current=i}}function lm(i){var l=i.alternate;l!==null&&(i.alternate=null,lm(l)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(l=i.stateNode,l!==null&&(delete l[ai],delete l[ys],delete l[Pu],delete l[yh],delete l[bh])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function sm(i){return i.tag===5||i.tag===3||i.tag===4}function um(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||sm(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function cg(i,l,C){var D=i.tag;if(D===5||D===6)i=i.stateNode,l?C.nodeType===8?C.parentNode.insertBefore(i,l):C.insertBefore(i,l):(C.nodeType===8?(l=C.parentNode,l.insertBefore(i,C)):(l=C,l.appendChild(i)),C=C._reactRootContainer,C!=null||l.onclick!==null||(l.onclick=Eo));else if(D!==4&&(i=i.child,i!==null))for(cg(i,l,C),i=i.sibling;i!==null;)cg(i,l,C),i=i.sibling}function fg(i,l,C){var D=i.tag;if(D===5||D===6)i=i.stateNode,l?C.insertBefore(i,l):C.appendChild(i);else if(D!==4&&(i=i.child,i!==null))for(fg(i,l,C),i=i.sibling;i!==null;)fg(i,l,C),i=i.sibling}var kn=null,fa=!1;function Ll(i,l,C){for(C=C.child;C!==null;)cm(i,l,C),C=C.sibling}function cm(i,l,C){if(Zr&&typeof Zr.onCommitFiberUnmount=="function")try{Zr.onCommitFiberUnmount(Qi,C)}catch{}switch(C.tag){case 5:Fn||Wu(C,l);case 6:var D=kn,H=fa;kn=null,Ll(i,l,C),kn=D,fa=H,kn!==null&&(fa?(i=kn,C=C.stateNode,i.nodeType===8?i.parentNode.removeChild(C):i.removeChild(C)):kn.removeChild(C.stateNode));break;case 18:kn!==null&&(fa?(i=kn,C=C.stateNode,i.nodeType===8?Ou(i.parentNode,C):i.nodeType===1&&Ou(i,C),Ln(i)):Ou(kn,C.stateNode));break;case 4:D=kn,H=fa,kn=C.stateNode.containerInfo,fa=!0,Ll(i,l,C),kn=D,fa=H;break;case 0:case 11:case 14:case 15:if(!Fn&&(D=C.updateQueue,D!==null&&(D=D.lastEffect,D!==null))){H=D=D.next;do{var K=H,ie=K.destroy;K=K.tag,ie!==void 0&&((K&2)!==0||(K&4)!==0)&&sg(C,l,ie),H=H.next}while(H!==D)}Ll(i,l,C);break;case 1:if(!Fn&&(Wu(C,l),D=C.stateNode,typeof D.componentWillUnmount=="function"))try{D.props=C.memoizedProps,D.state=C.memoizedState,D.componentWillUnmount()}catch(ce){Mr(C,l,ce)}Ll(i,l,C);break;case 21:Ll(i,l,C);break;case 22:C.mode&1?(Fn=(D=Fn)||C.memoizedState!==null,Ll(i,l,C),Fn=D):Ll(i,l,C);break;default:Ll(i,l,C)}}function fm(i){var l=i.updateQueue;if(l!==null){i.updateQueue=null;var C=i.stateNode;C===null&&(C=i.stateNode=new f_),l.forEach(function(D){var H=__.bind(null,i,D);C.has(D)||(C.add(D),D.then(H,H))})}}function da(i,l){var C=l.deletions;if(C!==null)for(var D=0;D<C.length;D++){var H=C[D];try{var K=i,ie=l,ce=ie;e:for(;ce!==null;){switch(ce.tag){case 5:kn=ce.stateNode,fa=!1;break e;case 3:kn=ce.stateNode.containerInfo,fa=!0;break e;case 4:kn=ce.stateNode.containerInfo,fa=!0;break e}ce=ce.return}if(kn===null)throw Error(t(160));cm(K,ie,H),kn=null,fa=!1;var ge=H.alternate;ge!==null&&(ge.return=null),H.return=null}catch(Ne){Mr(H,l,Ne)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)dm(l,i),l=l.sibling}function dm(i,l){var C=i.alternate,D=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(da(l,i),Za(i),D&4){try{hf(3,i,i.return),Nh(3,i)}catch(pt){Mr(i,i.return,pt)}try{hf(5,i,i.return)}catch(pt){Mr(i,i.return,pt)}}break;case 1:da(l,i),Za(i),D&512&&C!==null&&Wu(C,C.return);break;case 5:if(da(l,i),Za(i),D&512&&C!==null&&Wu(C,C.return),i.flags&32){var H=i.stateNode;try{Ue(H,"")}catch(pt){Mr(i,i.return,pt)}}if(D&4&&(H=i.stateNode,H!=null)){var K=i.memoizedProps,ie=C!==null?C.memoizedProps:K,ce=i.type,ge=i.updateQueue;if(i.updateQueue=null,ge!==null)try{ce==="input"&&K.type==="radio"&&K.name!=null&&je(H,K),Se(ce,ie);var Ne=Se(ce,K);for(ie=0;ie<ge.length;ie+=2){var Ve=ge[ie],We=ge[ie+1];Ve==="style"?kt(H,We):Ve==="dangerouslySetInnerHTML"?St(H,We):Ve==="children"?Ue(H,We):h(H,Ve,We,Ne)}switch(ce){case"input":Te(H,K);break;case"textarea":de(H,K);break;case"select":var Ge=H._wrapperState.wasMultiple;H._wrapperState.wasMultiple=!!K.multiple;var ot=K.value;ot!=null?xe(H,!!K.multiple,ot,!1):Ge!==!!K.multiple&&(K.defaultValue!=null?xe(H,!!K.multiple,K.defaultValue,!0):xe(H,!!K.multiple,K.multiple?[]:"",!1))}H[ys]=K}catch(pt){Mr(i,i.return,pt)}}break;case 6:if(da(l,i),Za(i),D&4){if(i.stateNode===null)throw Error(t(162));H=i.stateNode,K=i.memoizedProps;try{H.nodeValue=K}catch(pt){Mr(i,i.return,pt)}}break;case 3:if(da(l,i),Za(i),D&4&&C!==null&&C.memoizedState.isDehydrated)try{Ln(l.containerInfo)}catch(pt){Mr(i,i.return,pt)}break;case 4:da(l,i),Za(i);break;case 13:da(l,i),Za(i),H=i.child,H.flags&8192&&(K=H.memoizedState!==null,H.stateNode.isHidden=K,!K||H.alternate!==null&&H.alternate.memoizedState!==null||(pg=Pr())),D&4&&fm(i);break;case 22:if(Ve=C!==null&&C.memoizedState!==null,i.mode&1?(Fn=(Ne=Fn)||Ve,da(l,i),Fn=Ne):da(l,i),Za(i),D&8192){if(Ne=i.memoizedState!==null,(i.stateNode.isHidden=Ne)&&!Ve&&(i.mode&1)!==0)for(ct=i,Ve=i.child;Ve!==null;){for(We=ct=Ve;ct!==null;){switch(Ge=ct,ot=Ge.child,Ge.tag){case 0:case 11:case 14:case 15:hf(4,Ge,Ge.return);break;case 1:Wu(Ge,Ge.return);var ft=Ge.stateNode;if(typeof ft.componentWillUnmount=="function"){D=Ge,C=Ge.return;try{l=D,ft.props=l.memoizedProps,ft.state=l.memoizedState,ft.componentWillUnmount()}catch(pt){Mr(D,C,pt)}}break;case 5:Wu(Ge,Ge.return);break;case 22:if(Ge.memoizedState!==null){gm(We);continue}}ot!==null?(ot.return=Ge,ct=ot):gm(We)}Ve=Ve.sibling}e:for(Ve=null,We=i;;){if(We.tag===5){if(Ve===null){Ve=We;try{H=We.stateNode,Ne?(K=H.style,typeof K.setProperty=="function"?K.setProperty("display","none","important"):K.display="none"):(ce=We.stateNode,ge=We.memoizedProps.style,ie=ge!=null&&ge.hasOwnProperty("display")?ge.display:null,ce.style.display=mt("display",ie))}catch(pt){Mr(i,i.return,pt)}}}else if(We.tag===6){if(Ve===null)try{We.stateNode.nodeValue=Ne?"":We.memoizedProps}catch(pt){Mr(i,i.return,pt)}}else if((We.tag!==22&&We.tag!==23||We.memoizedState===null||We===i)&&We.child!==null){We.child.return=We,We=We.child;continue}if(We===i)break e;for(;We.sibling===null;){if(We.return===null||We.return===i)break e;Ve===We&&(Ve=null),We=We.return}Ve===We&&(Ve=null),We.sibling.return=We.return,We=We.sibling}}break;case 19:da(l,i),Za(i),D&4&&fm(i);break;case 21:break;default:da(l,i),Za(i)}}function Za(i){var l=i.flags;if(l&2){try{e:{for(var C=i.return;C!==null;){if(sm(C)){var D=C;break e}C=C.return}throw Error(t(160))}switch(D.tag){case 5:var H=D.stateNode;D.flags&32&&(Ue(H,""),D.flags&=-33);var K=um(i);fg(i,K,H);break;case 3:case 4:var ie=D.stateNode.containerInfo,ce=um(i);cg(i,ce,ie);break;default:throw Error(t(161))}}catch(ge){Mr(i,i.return,ge)}i.flags&=-3}l&4096&&(i.flags&=-4097)}function h_(i,l,C){ct=i,hm(i)}function hm(i,l,C){for(var D=(i.mode&1)!==0;ct!==null;){var H=ct,K=H.child;if(H.tag===22&&D){var ie=H.memoizedState!==null||Lh;if(!ie){var ce=H.alternate,ge=ce!==null&&ce.memoizedState!==null||Fn;ce=Lh;var Ne=Fn;if(Lh=ie,(Fn=ge)&&!Ne)for(ct=H;ct!==null;)ie=ct,ge=ie.child,ie.tag===22&&ie.memoizedState!==null?vm(H):ge!==null?(ge.return=ie,ct=ge):vm(H);for(;K!==null;)ct=K,hm(K),K=K.sibling;ct=H,Lh=ce,Fn=Ne}pm(i)}else(H.subtreeFlags&8772)!==0&&K!==null?(K.return=H,ct=K):pm(i)}}function pm(i){for(;ct!==null;){var l=ct;if((l.flags&8772)!==0){var C=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:Fn||Nh(5,l);break;case 1:var D=l.stateNode;if(l.flags&4&&!Fn)if(C===null)D.componentDidMount();else{var H=l.elementType===l.type?C.memoizedProps:rn(l.type,C.memoizedProps);D.componentDidUpdate(H,C.memoizedState,D.__reactInternalSnapshotBeforeUpdate)}var K=l.updateQueue;K!==null&&Er(l,K,D);break;case 3:var ie=l.updateQueue;if(ie!==null){if(C=null,l.child!==null)switch(l.child.tag){case 5:C=l.child.stateNode;break;case 1:C=l.child.stateNode}Er(l,ie,C)}break;case 5:var ce=l.stateNode;if(C===null&&l.flags&4){C=ce;var ge=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":ge.autoFocus&&C.focus();break;case"img":ge.src&&(C.src=ge.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var Ne=l.alternate;if(Ne!==null){var Ve=Ne.memoizedState;if(Ve!==null){var We=Ve.dehydrated;We!==null&&Ln(We)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}Fn||l.flags&512&&ug(l)}catch(Ge){Mr(l,l.return,Ge)}}if(l===i){ct=null;break}if(C=l.sibling,C!==null){C.return=l.return,ct=C;break}ct=l.return}}function gm(i){for(;ct!==null;){var l=ct;if(l===i){ct=null;break}var C=l.sibling;if(C!==null){C.return=l.return,ct=C;break}ct=l.return}}function vm(i){for(;ct!==null;){var l=ct;try{switch(l.tag){case 0:case 11:case 15:var C=l.return;try{Nh(4,l)}catch(ge){Mr(l,C,ge)}break;case 1:var D=l.stateNode;if(typeof D.componentDidMount=="function"){var H=l.return;try{D.componentDidMount()}catch(ge){Mr(l,H,ge)}}var K=l.return;try{ug(l)}catch(ge){Mr(l,K,ge)}break;case 5:var ie=l.return;try{ug(l)}catch(ge){Mr(l,ie,ge)}}}catch(ge){Mr(l,l.return,ge)}if(l===i){ct=null;break}var ce=l.sibling;if(ce!==null){ce.return=l.return,ct=ce;break}ct=l.return}}var p_=Math.ceil,Ih=d.ReactCurrentDispatcher,dg=d.ReactCurrentOwner,$i=d.ReactCurrentBatchConfig,Yt=0,vn=null,Kr=null,An=0,xi=0,Yu=aa(0),nn=0,pf=null,As=0,jh=0,hg=0,gf=null,si=null,pg=0,Ku=1/0,jo=null,Dh=!1,gg=null,Nl=null,Fh=!1,Il=null,zh=0,vf=0,vg=null,Bh=-1,Uh=0;function Zn(){return(Yt&6)!==0?Pr():Bh!==-1?Bh:Bh=Pr()}function jl(i){return(i.mode&1)===0?1:(Yt&2)!==0&&An!==0?An&-An:tf.transition!==null?(Uh===0&&(Uh=Pc()),Uh):(i=$t,i!==0||(i=window.event,i=i===void 0?16:th(i.type)),i)}function ha(i,l,C,D){if(50<vf)throw vf=0,vg=null,Error(t(185));ns(i,C,D),((Yt&2)===0||i!==vn)&&(i===vn&&((Yt&2)===0&&(jh|=C),nn===4&&Dl(i,An)),ui(i,D),C===1&&Yt===0&&(l.mode&1)===0&&(Ku=Pr()+500,vl&&qa()))}function ui(i,l){var C=i.callbackNode;Xd(i,l);var D=uo(i,i===vn?An:0);if(D===0)C!==null&&rs(C),i.callbackNode=null,i.callbackPriority=0;else if(l=D&-D,i.callbackPriority!==l){if(C!=null&&rs(C),l===1)i.tag===0?oa(ym.bind(null,i)):ws(ym.bind(null,i)),vh(function(){(Yt&6)===0&&qa()}),C=null;else{switch(is(D)){case 1:C=so;break;case 4:C=Js;break;case 16:C=Qo;break;case 536870912:C=eu;break;default:C=Qo}C=Pm(C,mm.bind(null,i))}i.callbackPriority=l,i.callbackNode=C}}function mm(i,l){if(Bh=-1,Uh=0,(Yt&6)!==0)throw Error(t(327));var C=i.callbackNode;if(Xu()&&i.callbackNode!==C)return null;var D=uo(i,i===vn?An:0);if(D===0)return null;if((D&30)!==0||(D&i.expiredLanes)!==0||l)l=qh(i,D);else{l=D;var H=Yt;Yt|=2;var K=wm();(vn!==i||An!==l)&&(jo=null,Ku=Pr()+500,Rs(i,l));do try{m_();break}catch(ce){bm(i,ce)}while(!0);Lu(),Ih.current=K,Yt=H,Kr!==null?l=0:(vn=null,An=0,l=nn)}if(l!==0){if(l===2&&(H=Jo(i),H!==0&&(D=H,l=mg(i,H))),l===1)throw C=pf,Rs(i,0),Dl(i,D),ui(i,Pr()),C;if(l===6)Dl(i,D);else{if(H=i.current.alternate,(D&30)===0&&!g_(H)&&(l=qh(i,D),l===2&&(K=Jo(i),K!==0&&(D=K,l=mg(i,K))),l===1))throw C=pf,Rs(i,0),Dl(i,D),ui(i,Pr()),C;switch(i.finishedWork=H,i.finishedLanes=D,l){case 0:case 1:throw Error(t(345));case 2:Ms(i,si,jo);break;case 3:if(Dl(i,D),(D&130023424)===D&&(l=pg+500-Pr(),10<l)){if(uo(i,0)!==0)break;if(H=i.suspendedLanes,(H&D)!==D){Zn(),i.pingedLanes|=i.suspendedLanes&H;break}i.timeoutHandle=Gn(Ms.bind(null,i,si,jo),l);break}Ms(i,si,jo);break;case 4:if(Dl(i,D),(D&4194240)===D)break;for(l=i.eventTimes,H=-1;0<D;){var ie=31-Ft(D);K=1<<ie,ie=l[ie],ie>H&&(H=ie),D&=~K}if(D=H,D=Pr()-D,D=(120>D?120:480>D?480:1080>D?1080:1920>D?1920:3e3>D?3e3:4320>D?4320:1960*p_(D/1960))-D,10<D){i.timeoutHandle=Gn(Ms.bind(null,i,si,jo),D);break}Ms(i,si,jo);break;case 5:Ms(i,si,jo);break;default:throw Error(t(329))}}}return ui(i,Pr()),i.callbackNode===C?mm.bind(null,i):null}function mg(i,l){var C=gf;return i.current.memoizedState.isDehydrated&&(Rs(i,l).flags|=256),i=qh(i,l),i!==2&&(l=si,si=C,l!==null&&yg(l)),i}function yg(i){si===null?si=i:si.push.apply(si,i)}function g_(i){for(var l=i;;){if(l.flags&16384){var C=l.updateQueue;if(C!==null&&(C=C.stores,C!==null))for(var D=0;D<C.length;D++){var H=C[D],K=H.getSnapshot;H=H.value;try{if(!In(K(),H))return!1}catch{return!1}}}if(C=l.child,l.subtreeFlags&16384&&C!==null)C.return=l,l=C;else{if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Dl(i,l){for(l&=~hg,l&=~jh,i.suspendedLanes|=l,i.pingedLanes&=~l,i=i.expirationTimes;0<l;){var C=31-Ft(l),D=1<<C;i[C]=-1,l&=~D}}function ym(i){if((Yt&6)!==0)throw Error(t(327));Xu();var l=uo(i,0);if((l&1)===0)return ui(i,Pr()),null;var C=qh(i,l);if(i.tag!==0&&C===2){var D=Jo(i);D!==0&&(l=D,C=mg(i,D))}if(C===1)throw C=pf,Rs(i,0),Dl(i,l),ui(i,Pr()),C;if(C===6)throw Error(t(345));return i.finishedWork=i.current.alternate,i.finishedLanes=l,Ms(i,si,jo),ui(i,Pr()),null}function bg(i,l){var C=Yt;Yt|=1;try{return i(l)}finally{Yt=C,Yt===0&&(Ku=Pr()+500,vl&&qa())}}function Ts(i){Il!==null&&Il.tag===0&&(Yt&6)===0&&Xu();var l=Yt;Yt|=1;var C=$i.transition,D=$t;try{if($i.transition=null,$t=1,i)return i()}finally{$t=D,$i.transition=C,Yt=l,(Yt&6)===0&&qa()}}function wg(){xi=Yu.current,or(Yu)}function Rs(i,l){i.finishedWork=null,i.finishedLanes=0;var C=i.timeoutHandle;if(C!==-1&&(i.timeoutHandle=-1,Zc(C)),Kr!==null)for(C=Kr.return;C!==null;){var D=C;switch(Yr(D),D.tag){case 1:D=D.type.childContextTypes,D!=null&&gl();break;case 3:yr(),or(cn),or(tn),dn();break;case 5:sa(D);break;case 4:yr();break;case 13:or(lr);break;case 19:or(lr);break;case 10:Nu(D.type._context);break;case 22:case 23:wg()}C=C.return}if(vn=i,Kr=i=Fl(i.current,null),An=xi=l,nn=0,pf=null,hg=jh=As=0,si=gf=null,Ui!==null){for(l=0;l<Ui.length;l++)if(C=Ui[l],D=C.interleaved,D!==null){C.interleaved=null;var H=D.next,K=C.pending;if(K!==null){var ie=K.next;K.next=H,D.next=ie}C.pending=D}Ui=null}return i}function bm(i,l){do{var C=Kr;try{if(Lu(),xl.current=Al,Ei){for(var D=tr.memoizedState;D!==null;){var H=D.queue;H!==null&&(H.pending=null),D=D.next}Ei=!1}if(Pn=0,Tr=xr=tr=null,Wa=!1,li=0,dg.current=null,C===null||C.return===null){nn=1,pf=l,Kr=null;break}e:{var K=i,ie=C.return,ce=C,ge=l;if(l=An,ce.flags|=32768,ge!==null&&typeof ge=="object"&&typeof ge.then=="function"){var Ne=ge,Ve=ce,We=Ve.tag;if((Ve.mode&1)===0&&(We===0||We===11||We===15)){var Ge=Ve.alternate;Ge?(Ve.updateQueue=Ge.updateQueue,Ve.memoizedState=Ge.memoizedState,Ve.lanes=Ge.lanes):(Ve.updateQueue=null,Ve.memoizedState=null)}var ot=j(ie);if(ot!==null){ot.flags&=-257,B(ot,ie,ce,K,l),ot.mode&1&&p(K,Ne,l),l=ot,ge=Ne;var ft=l.updateQueue;if(ft===null){var pt=new Set;pt.add(ge),l.updateQueue=pt}else ft.add(ge);break e}else{if((l&1)===0){p(K,Ne,l),_g();break e}ge=Error(t(426))}}else if(Zt&&ce.mode&1){var Ur=j(ie);if(Ur!==null){(Ur.flags&65536)===0&&(Ur.flags|=256),B(Ur,ie,ce,K,l),Ss(Io(ge,ce));break e}}K=ge=Io(ge,ce),nn!==4&&(nn=2),gf===null?gf=[K]:gf.push(K),K=ie;do{switch(K.tag){case 3:K.flags|=65536,l&=-l,K.lanes|=l;var Ae=Mh(K,ge,l);Ps(K,Ae);break e;case 1:ce=ge;var be=K.type,Re=K.stateNode;if((K.flags&128)===0&&(typeof be.getDerivedStateFromError=="function"||Re!==null&&typeof Re.componentDidCatch=="function"&&(Nl===null||!Nl.has(Re)))){K.flags|=65536,l&=-l,K.lanes|=l;var Ze=u(K,ce,l);Ps(K,Ze);break e}}K=K.return}while(K!==null)}Sm(C)}catch(vt){l=vt,Kr===C&&C!==null&&(Kr=C=C.return);continue}break}while(!0)}function wm(){var i=Ih.current;return Ih.current=Al,i===null?Al:i}function _g(){(nn===0||nn===3||nn===2)&&(nn=4),vn===null||(As&268435455)===0&&(jh&268435455)===0||Dl(vn,An)}function qh(i,l){var C=Yt;Yt|=2;var D=wm();(vn!==i||An!==l)&&(jo=null,Rs(i,l));do try{v_();break}catch(H){bm(i,H)}while(!0);if(Lu(),Yt=C,Ih.current=D,Kr!==null)throw Error(t(261));return vn=null,An=0,nn}function v_(){for(;Kr!==null;)_m(Kr)}function m_(){for(;Kr!==null&&!Kp();)_m(Kr)}function _m(i){var l=Om(i.alternate,i,xi);i.memoizedProps=i.pendingProps,l===null?Sm(i):Kr=l,dg.current=null}function Sm(i){var l=i;do{var C=l.alternate;if(i=l.return,(l.flags&32768)===0){if(C=u_(C,l,xi),C!==null){Kr=C;return}}else{if(C=c_(C,l),C!==null){C.flags&=32767,Kr=C;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{nn=6,Kr=null;return}}if(l=l.sibling,l!==null){Kr=l;return}Kr=l=i}while(l!==null);nn===0&&(nn=5)}function Ms(i,l,C){var D=$t,H=$i.transition;try{$i.transition=null,$t=1,y_(i,l,C,D)}finally{$i.transition=H,$t=D}return null}function y_(i,l,C,D){do Xu();while(Il!==null);if((Yt&6)!==0)throw Error(t(327));C=i.finishedWork;var H=i.finishedLanes;if(C===null)return null;if(i.finishedWork=null,i.finishedLanes=0,C===i.current)throw Error(t(177));i.callbackNode=null,i.callbackPriority=0;var K=C.lanes|C.childLanes;if(Qp(i,K),i===vn&&(Kr=vn=null,An=0),(C.subtreeFlags&2064)===0&&(C.flags&2064)===0||Fh||(Fh=!0,Pm(Qo,function(){return Xu(),null})),K=(C.flags&15990)!==0,(C.subtreeFlags&15990)!==0||K){K=$i.transition,$i.transition=null;var ie=$t;$t=1;var ce=Yt;Yt|=4,dg.current=null,d_(i,C),dm(C,i),ds(Kc),ou=!!Yc,Kc=Yc=null,i.current=C,h_(C),Xp(),Yt=ce,$t=ie,$i.transition=K}else i.current=C;if(Fh&&(Fh=!1,Il=i,zh=H),K=i.pendingLanes,K===0&&(Nl=null),fr(C.stateNode),ui(i,Pr()),l!==null)for(D=i.onRecoverableError,C=0;C<l.length;C++)H=l[C],D(H.value,{componentStack:H.stack,digest:H.digest});if(Dh)throw Dh=!1,i=gg,gg=null,i;return(zh&1)!==0&&i.tag!==0&&Xu(),K=i.pendingLanes,(K&1)!==0?i===vg?vf++:(vf=0,vg=i):vf=0,qa(),null}function Xu(){if(Il!==null){var i=is(zh),l=$i.transition,C=$t;try{if($i.transition=null,$t=16>i?16:i,Il===null)var D=!1;else{if(i=Il,Il=null,zh=0,(Yt&6)!==0)throw Error(t(331));var H=Yt;for(Yt|=4,ct=i.current;ct!==null;){var K=ct,ie=K.child;if((ct.flags&16)!==0){var ce=K.deletions;if(ce!==null){for(var ge=0;ge<ce.length;ge++){var Ne=ce[ge];for(ct=Ne;ct!==null;){var Ve=ct;switch(Ve.tag){case 0:case 11:case 15:hf(8,Ve,K)}var We=Ve.child;if(We!==null)We.return=Ve,ct=We;else for(;ct!==null;){Ve=ct;var Ge=Ve.sibling,ot=Ve.return;if(lm(Ve),Ve===Ne){ct=null;break}if(Ge!==null){Ge.return=ot,ct=Ge;break}ct=ot}}}var ft=K.alternate;if(ft!==null){var pt=ft.child;if(pt!==null){ft.child=null;do{var Ur=pt.sibling;pt.sibling=null,pt=Ur}while(pt!==null)}}ct=K}}if((K.subtreeFlags&2064)!==0&&ie!==null)ie.return=K,ct=ie;else e:for(;ct!==null;){if(K=ct,(K.flags&2048)!==0)switch(K.tag){case 0:case 11:case 15:hf(9,K,K.return)}var Ae=K.sibling;if(Ae!==null){Ae.return=K.return,ct=Ae;break e}ct=K.return}}var be=i.current;for(ct=be;ct!==null;){ie=ct;var Re=ie.child;if((ie.subtreeFlags&2064)!==0&&Re!==null)Re.return=ie,ct=Re;else e:for(ie=be;ct!==null;){if(ce=ct,(ce.flags&2048)!==0)try{switch(ce.tag){case 0:case 11:case 15:Nh(9,ce)}}catch(vt){Mr(ce,ce.return,vt)}if(ce===ie){ct=null;break e}var Ze=ce.sibling;if(Ze!==null){Ze.return=ce.return,ct=Ze;break e}ct=ce.return}}if(Yt=H,qa(),Zr&&typeof Zr.onPostCommitFiberRoot=="function")try{Zr.onPostCommitFiberRoot(Qi,i)}catch{}D=!0}return D}finally{$t=C,$i.transition=l}}return!1}function Em(i,l,C){l=Io(C,l),l=Mh(i,l,1),i=Gi(i,l,1),l=Zn(),i!==null&&(ns(i,1,l),ui(i,l))}function Mr(i,l,C){if(i.tag===3)Em(i,i,C);else for(;l!==null;){if(l.tag===3){Em(l,i,C);break}else if(l.tag===1){var D=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof D.componentDidCatch=="function"&&(Nl===null||!Nl.has(D))){i=Io(C,i),i=u(l,i,1),l=Gi(l,i,1),i=Zn(),l!==null&&(ns(l,1,i),ui(l,i));break}}l=l.return}}function b_(i,l,C){var D=i.pingCache;D!==null&&D.delete(l),l=Zn(),i.pingedLanes|=i.suspendedLanes&C,vn===i&&(An&C)===C&&(nn===4||nn===3&&(An&130023424)===An&&500>Pr()-pg?Rs(i,0):hg|=C),ui(i,l)}function xm(i,l){l===0&&((i.mode&1)===0?l=1:(l=Ji,Ji<<=1,(Ji&130023424)===0&&(Ji=4194304)));var C=Zn();i=Kn(i,l),i!==null&&(ns(i,l,C),ui(i,C))}function w_(i){var l=i.memoizedState,C=0;l!==null&&(C=l.retryLane),xm(i,C)}function __(i,l){var C=0;switch(i.tag){case 13:var D=i.stateNode,H=i.memoizedState;H!==null&&(C=H.retryLane);break;case 19:D=i.stateNode;break;default:throw Error(t(314))}D!==null&&D.delete(l),xm(i,C)}var Om;Om=function(i,l,C){if(i!==null)if(i.memoizedProps!==l.pendingProps||cn.current)J=!0;else{if((i.lanes&C)===0&&(l.flags&128)===0)return J=!1,og(i,l,C);J=(i.flags&131072)!==0}else J=!1,Zt&&(l.flags&1048576)!==0&&_h(l,Ga,l.index);switch(l.lanes=0,l.tag){case 2:var D=l.type;Ut(i,l),i=l.pendingProps;var H=Po(l,tn.current);la(l,C),H=Ol(null,l,D,i,H,C);var K=Pl();return l.flags|=1,typeof H=="object"&&H!==null&&typeof H.render=="function"&&H.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,fn(D)?(K=!0,Co(l)):K=!1,l.memoizedState=H.state!==null&&H.state!==void 0?H.state:null,Os(l),H.updater=Rl,l.stateNode=H,H._reactInternals=l,Vu(l,D,i,C),l=Qt(null,l,D,!0,K,C)):(l.tag=0,Zt&&K&&ml(l),le(null,l,H,C),l=l.child),l;case 16:D=l.elementType;e:{switch(Ut(i,l),i=l.pendingProps,H=D._init,D=H(D._payload),l.type=D,H=l.tag=E_(D),i=rn(D,i),H){case 0:l=nt(null,l,D,i,C);break e;case 1:l=sr(null,l,D,i,C);break e;case 11:l=Ee(null,l,D,i,C);break e;case 14:l=Ie(null,l,D,rn(D.type,i),C);break e}throw Error(t(306,D,""))}return l;case 0:return D=l.type,H=l.pendingProps,H=l.elementType===D?H:rn(D,H),nt(i,l,D,H,C);case 1:return D=l.type,H=l.pendingProps,H=l.elementType===D?H:rn(D,H),sr(i,l,D,H,C);case 3:e:{if(Cn(l),i===null)throw Error(t(387));D=l.pendingProps,K=l.memoizedState,H=K.element,ju(i,l),_l(l,D,null,C);var ie=l.memoizedState;if(D=ie.element,K.isDehydrated)if(K={element:D,isDehydrated:!1,cache:ie.cache,pendingSuspenseBoundaries:ie.pendingSuspenseBoundaries,transitions:ie.transitions},l.updateQueue.baseState=K,l.memoizedState=K,l.flags&256){H=Io(Error(t(423)),l),l=Vi(i,l,D,C,H);break e}else if(D!==H){H=Io(Error(t(424)),l),l=Vi(i,l,D,C,H);break e}else for(tt=Di(l.stateNode.containerInfo.firstChild),$n=l,Zt=!0,Wn=null,C=oi(l,null,D,C),l.child=C;C;)C.flags=C.flags&-3|4096,C=C.sibling;else{if(Ro(),D===H){l=gn(i,l,C);break e}le(i,l,D,C)}l=l.child}return l;case 5:return Sl(l),i===null&&yl(l),D=l.type,H=l.pendingProps,K=i!==null?i.memoizedProps:null,ie=H.children,Xc(D,H)?ie=null:K!==null&&Xc(D,K)&&(l.flags|=32),Tt(i,l),le(i,l,ie,C),l.child;case 6:return i===null&&yl(l),null;case 13:return De(i,l,C);case 4:return $a(l,l.stateNode.containerInfo),D=l.pendingProps,i===null?l.child=Mo(l,null,D,C):le(i,l,D,C),l.child;case 11:return D=l.type,H=l.pendingProps,H=l.elementType===D?H:rn(D,H),Ee(i,l,D,H,C);case 7:return le(i,l,l.pendingProps,C),l.child;case 8:return le(i,l,l.pendingProps.children,C),l.child;case 12:return le(i,l,l.pendingProps.children,C),l.child;case 10:e:{if(D=l.type._context,H=l.pendingProps,K=l.memoizedProps,ie=H.value,rr(Es,D._currentValue),D._currentValue=ie,K!==null)if(In(K.value,ie)){if(K.children===H.children&&!cn.current){l=gn(i,l,C);break e}}else for(K=l.child,K!==null&&(K.return=l);K!==null;){var ce=K.dependencies;if(ce!==null){ie=K.child;for(var ge=ce.firstContext;ge!==null;){if(ge.context===D){if(K.tag===1){ge=Hi(-1,C&-C),ge.tag=2;var Ne=K.updateQueue;if(Ne!==null){Ne=Ne.shared;var Ve=Ne.pending;Ve===null?ge.next=ge:(ge.next=Ve.next,Ve.next=ge),Ne.pending=ge}}K.lanes|=C,ge=K.alternate,ge!==null&&(ge.lanes|=C),Iu(K.return,C,l),ce.lanes|=C;break}ge=ge.next}}else if(K.tag===10)ie=K.type===l.type?null:K.child;else if(K.tag===18){if(ie=K.return,ie===null)throw Error(t(341));ie.lanes|=C,ce=ie.alternate,ce!==null&&(ce.lanes|=C),Iu(ie,C,l),ie=K.sibling}else ie=K.child;if(ie!==null)ie.return=K;else for(ie=K;ie!==null;){if(ie===l){ie=null;break}if(K=ie.sibling,K!==null){K.return=ie.return,ie=K;break}ie=ie.return}K=ie}le(i,l,H.children,C),l=l.child}return l;case 9:return H=l.type,D=l.pendingProps.children,la(l,C),H=On(H),D=D(H),l.flags|=1,le(i,l,D,C),l.child;case 14:return D=l.type,H=rn(D,l.pendingProps),H=rn(D.type,H),Ie(i,l,D,H,C);case 15:return Xe(i,l,l.type,l.pendingProps,C);case 17:return D=l.type,H=l.pendingProps,H=l.elementType===D?H:rn(D,H),Ut(i,l),l.tag=1,fn(D)?(i=!0,Co(l)):i=!1,la(l,C),Rh(l,D,H),Vu(l,D,H,C),Qt(null,l,D,!0,i,C);case 19:return Br(i,l,C);case 22:return st(i,l,C)}throw Error(t(156,l.tag))};function Pm(i,l){return Qs(i,l)}function S_(i,l,C,D){this.tag=i,this.key=C,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=D,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wi(i,l,C,D){return new S_(i,l,C,D)}function Sg(i){return i=i.prototype,!(!i||!i.isReactComponent)}function E_(i){if(typeof i=="function")return Sg(i)?1:0;if(i!=null){if(i=i.$$typeof,i===N)return 11;if(i===L)return 14}return 2}function Fl(i,l){var C=i.alternate;return C===null?(C=Wi(i.tag,l,i.key,i.mode),C.elementType=i.elementType,C.type=i.type,C.stateNode=i.stateNode,C.alternate=i,i.alternate=C):(C.pendingProps=l,C.type=i.type,C.flags=0,C.subtreeFlags=0,C.deletions=null),C.flags=i.flags&14680064,C.childLanes=i.childLanes,C.lanes=i.lanes,C.child=i.child,C.memoizedProps=i.memoizedProps,C.memoizedState=i.memoizedState,C.updateQueue=i.updateQueue,l=i.dependencies,C.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},C.sibling=i.sibling,C.index=i.index,C.ref=i.ref,C}function Hh(i,l,C,D,H,K){var ie=2;if(D=i,typeof i=="function")Sg(i)&&(ie=1);else if(typeof i=="string")ie=5;else e:switch(i){case T:return Ls(C.children,H,K,l);case I:ie=8,H|=8;break;case F:return i=Wi(12,C,l,H|2),i.elementType=F,i.lanes=K,i;case A:return i=Wi(13,C,l,H),i.elementType=A,i.lanes=K,i;case R:return i=Wi(19,C,l,H),i.elementType=R,i.lanes=K,i;case G:return Gh(C,H,K,l);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case k:ie=10;break e;case O:ie=9;break e;case N:ie=11;break e;case L:ie=14;break e;case V:ie=16,D=null;break e}throw Error(t(130,i==null?i:typeof i,""))}return l=Wi(ie,C,l,H),l.elementType=i,l.type=D,l.lanes=K,l}function Ls(i,l,C,D){return i=Wi(7,i,D,l),i.lanes=C,i}function Gh(i,l,C,D){return i=Wi(22,i,D,l),i.elementType=G,i.lanes=C,i.stateNode={isHidden:!1},i}function Eg(i,l,C){return i=Wi(6,i,null,l),i.lanes=C,i}function xg(i,l,C){return l=Wi(4,i.children!==null?i.children:[],i.key,l),l.lanes=C,l.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},l}function x_(i,l,C,D,H){this.tag=l,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zn(0),this.expirationTimes=zn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zn(0),this.identifierPrefix=D,this.onRecoverableError=H,this.mutableSourceEagerHydrationData=null}function Og(i,l,C,D,H,K,ie,ce,ge){return i=new x_(i,l,C,ce,ge),l===1?(l=1,K===!0&&(l|=8)):l=0,K=Wi(3,null,null,l),i.current=K,K.stateNode=i,K.memoizedState={element:D,isDehydrated:C,cache:null,transitions:null,pendingSuspenseBoundaries:null},Os(K),i}function O_(i,l,C){var D=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:D==null?null:""+D,children:i,containerInfo:l,implementation:C}}function Cm(i){if(!i)return zi;i=i._reactInternals;e:{if(Nr(i)!==i||i.tag!==1)throw Error(t(170));var l=i;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(fn(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(t(171))}if(i.tag===1){var C=i.type;if(fn(C))return ku(i,C,l)}return l}function km(i,l,C,D,H,K,ie,ce,ge){return i=Og(C,D,!0,i,H,K,ie,ce,ge),i.context=Cm(null),C=i.current,D=Zn(),H=jl(C),K=Hi(D,H),K.callback=l??null,Gi(C,K,H),i.current.lanes=H,ns(i,H,D),ui(i,D),i}function Vh(i,l,C,D){var H=l.current,K=Zn(),ie=jl(H);return C=Cm(C),l.context===null?l.context=C:l.pendingContext=C,l=Hi(K,ie),l.payload={element:i},D=D===void 0?null:D,D!==null&&(l.callback=D),i=Gi(H,l,ie),i!==null&&(ha(i,H,ie,K),Du(i,H,ie)),ie}function $h(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function Am(i,l){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var C=i.retryLane;i.retryLane=C!==0&&C<l?C:l}}function Pg(i,l){Am(i,l),(i=i.alternate)&&Am(i,l)}function P_(){return null}var Tm=typeof reportError=="function"?reportError:function(i){console.error(i)};function Cg(i){this._internalRoot=i}Wh.prototype.render=Cg.prototype.render=function(i){var l=this._internalRoot;if(l===null)throw Error(t(409));Vh(i,l,null,null)},Wh.prototype.unmount=Cg.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var l=i.containerInfo;Ts(function(){Vh(null,i,null,null)}),l[Fi]=null}};function Wh(i){this._internalRoot=i}Wh.prototype.unstable_scheduleHydration=function(i){if(i){var l=Qd();i={blockedOn:null,target:i,priority:l};for(var C=0;C<ji.length&&l!==0&&l<ji[C].priority;C++);ji.splice(C,0,i),C===0&&nu(i)}};function kg(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function Yh(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function Rm(){}function C_(i,l,C,D,H){if(H){if(typeof D=="function"){var K=D;D=function(){var Ne=$h(ie);K.call(Ne)}}var ie=km(l,D,i,0,null,!1,!1,"",Rm);return i._reactRootContainer=ie,i[Fi]=ie.current,_o(i.nodeType===8?i.parentNode:i),Ts(),ie}for(;H=i.lastChild;)i.removeChild(H);if(typeof D=="function"){var ce=D;D=function(){var Ne=$h(ge);ce.call(Ne)}}var ge=Og(i,0,!1,null,null,!1,!1,"",Rm);return i._reactRootContainer=ge,i[Fi]=ge.current,_o(i.nodeType===8?i.parentNode:i),Ts(function(){Vh(l,ge,C,D)}),ge}function Kh(i,l,C,D,H){var K=C._reactRootContainer;if(K){var ie=K;if(typeof H=="function"){var ce=H;H=function(){var ge=$h(ie);ce.call(ge)}}Vh(l,ie,i,H)}else ie=C_(C,l,i,H,D);return $h(ie)}el=function(i){switch(i.tag){case 3:var l=i.stateNode;if(l.current.memoizedState.isDehydrated){var C=Gr(l.pendingLanes);C!==0&&(Cc(l,C|1),ui(l,Pr()),(Yt&6)===0&&(Ku=Pr()+500,qa()))}break;case 13:Ts(function(){var D=Kn(i,1);if(D!==null){var H=Zn();ha(D,i,1,H)}}),Pg(i,1)}},tl=function(i){if(i.tag===13){var l=Kn(i,134217728);if(l!==null){var C=Zn();ha(l,i,134217728,C)}Pg(i,134217728)}},Zd=function(i){if(i.tag===13){var l=jl(i),C=Kn(i,l);if(C!==null){var D=Zn();ha(C,i,l,D)}Pg(i,l)}},Qd=function(){return $t},tu=function(i,l){var C=$t;try{return $t=i,l()}finally{$t=C}},qe=function(i,l,C){switch(l){case"input":if(Te(i,C),l=C.name,C.type==="radio"&&l!=null){for(C=i;C.parentNode;)C=C.parentNode;for(C=C.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<C.length;l++){var D=C[l];if(D!==i&&D.form===i.form){var H=Wr(D);if(!H)throw Error(t(90));fe(D),Te(D,H)}}}break;case"textarea":de(i,C);break;case"select":l=C.value,l!=null&&xe(i,!!C.multiple,l,!1)}},at=bg,Pe=Ts;var k_={usingClientEntryPoint:!1,Events:[bs,Dr,Wr,ht,ze,bg]},mf={findFiberByHostInstance:Ba,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},A_={bundleType:mf.bundleType,version:mf.version,rendererPackageName:mf.rendererPackageName,rendererConfig:mf.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:d.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=ti(i),i===null?null:i.stateNode},findFiberByHostInstance:mf.findFiberByHostInstance||P_,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xh.isDisabled&&Xh.supportsFiber)try{Qi=Xh.inject(A_),Zr=Xh}catch{}}return ci.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=k_,ci.createPortal=function(i,l){var C=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!kg(l))throw Error(t(200));return O_(i,l,null,C)},ci.createRoot=function(i,l){if(!kg(i))throw Error(t(299));var C=!1,D="",H=Tm;return l!=null&&(l.unstable_strictMode===!0&&(C=!0),l.identifierPrefix!==void 0&&(D=l.identifierPrefix),l.onRecoverableError!==void 0&&(H=l.onRecoverableError)),l=Og(i,1,!1,null,null,C,!1,D,H),i[Fi]=l.current,_o(i.nodeType===8?i.parentNode:i),new Cg(l)},ci.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var l=i._reactInternals;if(l===void 0)throw typeof i.render=="function"?Error(t(188)):(i=Object.keys(i).join(","),Error(t(268,i)));return i=ti(l),i=i===null?null:i.stateNode,i},ci.flushSync=function(i){return Ts(i)},ci.hydrate=function(i,l,C){if(!Yh(l))throw Error(t(200));return Kh(null,i,l,!0,C)},ci.hydrateRoot=function(i,l,C){if(!kg(i))throw Error(t(405));var D=C!=null&&C.hydratedSources||null,H=!1,K="",ie=Tm;if(C!=null&&(C.unstable_strictMode===!0&&(H=!0),C.identifierPrefix!==void 0&&(K=C.identifierPrefix),C.onRecoverableError!==void 0&&(ie=C.onRecoverableError)),l=km(l,null,i,1,C??null,H,!1,K,ie),i[Fi]=l.current,_o(i),D)for(i=0;i<D.length;i++)C=D[i],H=C._getVersion,H=H(C._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[C,H]:l.mutableSourceEagerHydrationData.push(C,H);return new Wh(l)},ci.render=function(i,l,C){if(!Yh(l))throw Error(t(200));return Kh(null,i,l,!1,C)},ci.unmountComponentAtNode=function(i){if(!Yh(i))throw Error(t(40));return i._reactRootContainer?(Ts(function(){Kh(null,null,i,!1,function(){i._reactRootContainer=null,i[Fi]=null})}),!0):!1},ci.unstable_batchedUpdates=bg,ci.unstable_renderSubtreeIntoContainer=function(i,l,C,D){if(!Yh(C))throw Error(t(200));if(i==null||i._reactInternals===void 0)throw Error(t(38));return Kh(i,l,C,!1,D)},ci.version="18.3.1-next-f1338f8080-20240426",ci}var Dm;function uw(){if(Dm)return Tg.exports;Dm=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Tg.exports=L_(),Tg.exports}var Fm;function N_(){if(Fm)return Zh;Fm=1;var e=uw();return Zh.createRoot=e.createRoot,Zh.hydrateRoot=e.hydrateRoot,Zh}var I_=N_();const cw=jd(I_);var yf={};function Lt(e){for(var n=arguments.length,t=new Array(n>1?n-1:0),r=1;r<n;r++)t[r-1]=arguments[r];throw new Error(typeof e=="number"?"[MobX] minified error nr: "+e+(t.length?" "+t.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+e)}var j_={};function Pp(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:j_}var fw=Object.assign,dp=Object.getOwnPropertyDescriptor,to=Object.defineProperty,Dd=Object.prototype,$1=[];Object.freeze($1);var sv={};Object.freeze(sv);var D_=typeof Proxy<"u",F_=Object.toString();function dw(){D_||Lt("Proxy not available")}function hw(e){var n=!1;return function(){if(!n)return n=!0,e.apply(this,arguments)}}var rc=function(){};function Ai(e){return typeof e=="function"}function Bs(e){var n=typeof e;switch(n){case"string":case"symbol":case"number":return!0}return!1}function Cp(e){return e!==null&&typeof e=="object"}function Ko(e){if(!Cp(e))return!1;var n=Object.getPrototypeOf(e);if(n==null)return!0;var t=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return typeof t=="function"&&t.toString()===F_}function pw(e){var n=e==null?void 0:e.constructor;return n?n.name==="GeneratorFunction"||n.displayName==="GeneratorFunction":!1}function Fd(e,n,t){to(e,n,{enumerable:!1,writable:!0,configurable:!0,value:t})}function gw(e,n,t){to(e,n,{enumerable:!1,writable:!1,configurable:!0,value:t})}function Kl(e,n){var t="isMobX"+e;return n.prototype[t]=!0,function(r){return Cp(r)&&r[t]===!0}}function yc(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function z_(e){var n=Object.getPrototypeOf(e),t=Object.getPrototypeOf(n),r=Object.getPrototypeOf(t);return r===null}function Vo(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var vw=typeof Object.getOwnPropertySymbols<"u";function B_(e){var n=Object.keys(e);if(!vw)return n;var t=Object.getOwnPropertySymbols(e);return t.length?[].concat(n,t.filter(function(r){return Dd.propertyIsEnumerable.call(e,r)})):n}var lc=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:vw?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function mw(e){return e===null?null:typeof e=="object"?""+e:e}function $o(e,n){return Dd.hasOwnProperty.call(e,n)}var U_=Object.getOwnPropertyDescriptors||function(n){var t={};return lc(n).forEach(function(r){t[r]=dp(n,r)}),t};function Ci(e,n){return!!(e&n)}function ki(e,n,t){return t?e|=n:e&=~n,e}function zm(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function q_(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,G_(r.key),r)}}function bc(e,n,t){return n&&q_(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function nc(e,n){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=V_(e))||n){t&&(e=t);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
33
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $l(){return $l=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},$l.apply(null,arguments)}function
|
|
34
|
-
'`+o.annotationType_+"' can only be used on properties with a function value."))}function l6(e,n,t,r){n.annotationType_,r.value}function ww(e,n,t,r,a){var o,s,c,m,f,v,y;a===void 0&&(a=Je.safeDescriptors),l6(e,n,t,r);var E=r.value;if((o=n.options_)!=null&&o.bound){var w;E=E.bind((w=e.proxy_)!=null?w:e.target_)}return{value:Wl((s=(c=n.options_)==null?void 0:c.name)!=null?s:t.toString(),E,(m=(f=n.options_)==null?void 0:f.autoAction)!=null?m:!1,(v=n.options_)!=null&&v.bound?(y=e.proxy_)!=null?y:e.target_:void 0),configurable:a?e.isPlainObject_:!0,enumerable:!1,writable:!a}}function _w(e,n){return{annotationType_:e,options_:n,make_:s6,extend_:u6,decorate_20223_:c6}}function s6(e,n,t,r){var a;if(r===e.target_)return this.extend_(e,n,t,!1)===null?0:2;if((a=this.options_)!=null&&a.bound&&(!$o(e.target_,n)||!fc(e.target_[n]))&&this.extend_(e,n,t,!1)===null)return 0;if(fc(t.value))return 1;var o=Sw(e,this,n,t,!1,!1);return to(r,n,o),2}function u6(e,n,t,r){var a,o=Sw(e,this,n,t,(a=this.options_)==null?void 0:a.bound);return e.defineProperty_(n,o,r)}function c6(e,n){var t,r=n.name,a=n.addInitializer;return fc(e)||(e=Gs(e)),(t=this.options_)!=null&&t.bound&&a(function(){var o=this,s=o[r].bind(o);s.isMobXFlow=!0,o[r]=s}),e}function f6(e,n,t,r){n.annotationType_,r.value}function Sw(e,n,t,r,a,o){o===void 0&&(o=Je.safeDescriptors),f6(e,n,t,r);var s=r.value;if(fc(s)||(s=Gs(s)),a){var c;s=s.bind((c=e.proxy_)!=null?c:e.target_),s.isMobXFlow=!0}return{value:s,configurable:o?e.isPlainObject_:!0,enumerable:!1,writable:!o}}function cv(e,n){return{annotationType_:e,options_:n,make_:d6,extend_:h6,decorate_20223_:p6}}function d6(e,n,t){return this.extend_(e,n,t,!1)===null?0:1}function h6(e,n,t,r){return g6(e,this,n,t),e.defineComputedProperty_(n,$l({},this.options_,{get:t.get,set:t.set}),r)}function p6(e,n){var t=this,r=n.name,a=n.addInitializer;return a(function(){var o=Ws(this)[bt],s=$l({},t.options_,{get:e,context:this});s.name||(s.name="ObservableObject."+r.toString()),o.values_.set(r,new xa(s))}),function(){return this[bt].getObservablePropValue_(r)}}function g6(e,n,t,r){n.annotationType_,r.get}function Ap(e,n){return{annotationType_:e,options_:n,make_:v6,extend_:m6,decorate_20223_:y6}}function v6(e,n,t){return this.extend_(e,n,t,!1)===null?0:1}function m6(e,n,t,r){var a,o;return b6(e,this),e.defineObservableProperty_(n,t.value,(a=(o=this.options_)==null?void 0:o.enhancer)!=null?a:qs,r)}function y6(e,n){var t=this,r=n.kind,a=n.name,o=new WeakSet;function s(c,m){var f,v,y=Ws(c)[bt],E=new Gl(m,(f=(v=t.options_)==null?void 0:v.enhancer)!=null?f:qs,"ObservableObject."+a.toString(),!1);y.values_.set(a,E),o.add(c)}if(r=="accessor")return{get:function(){return o.has(this)||s(this,e.get.call(this)),this[bt].getObservablePropValue_(a)},set:function(m){return o.has(this)||s(this,m),this[bt].setObservablePropValue_(a,m)},init:function(m){return o.has(this)||s(this,m),m}}}function b6(e,n,t,r){n.annotationType_}var w6="true",_6=Ew();function Ew(e){return{annotationType_:w6,options_:e,make_:S6,extend_:E6,decorate_20223_:x6}}function S6(e,n,t,r){var a,o;if(t.get)return Vs.make_(e,n,t,r);if(t.set){var s=Wl(n.toString(),t.set);return r===e.target_?e.defineProperty_(n,{configurable:Je.safeDescriptors?e.isPlainObject_:!0,set:s})===null?0:2:(to(r,n,{configurable:!0,set:s}),2)}if(r!==e.target_&&typeof t.value=="function"){var c;if(pw(t.value)){var m,f=(m=this.options_)!=null&&m.autoBind?Gs.bound:Gs;return f.make_(e,n,t,r)}var v=(c=this.options_)!=null&&c.autoBind?sc.bound:sc;return v.make_(e,n,t,r)}var y=((a=this.options_)==null?void 0:a.deep)===!1?ur.ref:ur;if(typeof t.value=="function"&&(o=this.options_)!=null&&o.autoBind){var E;t.value=t.value.bind((E=e.proxy_)!=null?E:e.target_)}return y.make_(e,n,t,r)}function E6(e,n,t,r){var a,o;if(t.get)return Vs.extend_(e,n,t,r);if(t.set)return e.defineProperty_(n,{configurable:Je.safeDescriptors?e.isPlainObject_:!0,set:Wl(n.toString(),t.set)},r);if(typeof t.value=="function"&&(a=this.options_)!=null&&a.autoBind){var s;t.value=t.value.bind((s=e.proxy_)!=null?s:e.target_)}var c=((o=this.options_)==null?void 0:o.deep)===!1?ur.ref:ur;return c.extend_(e,n,t,r)}function x6(e,n){Lt("'"+this.annotationType_+"' cannot be used as a decorator")}var O6="observable",P6="observable.ref",C6="observable.shallow",k6="observable.struct",xw={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(xw);function Qh(e){return e||xw}var Y1=Ap(O6),A6=Ap(P6,{enhancer:kp}),T6=Ap(C6,{enhancer:Z_}),R6=Ap(k6,{enhancer:Q_}),Ow=_a(Y1);function Jh(e){return e.deep===!0?qs:e.deep===!1?kp:L6(e.defaultDecorator)}function M6(e){var n;return e?(n=e.defaultDecorator)!=null?n:Ew(e):void 0}function L6(e){var n,t;return e&&(n=(t=e.options_)==null?void 0:t.enhancer)!=null?n:qs}function Pw(e,n,t){if(Bd(n))return Y1.decorate_20223_(e,n);if(Bs(n)){zd(e,n,Y1);return}return Ip(e)?e:Ko(e)?ur.object(e,n,t):Array.isArray(e)?ur.array(e,n):yc(e)?ur.map(e,n):Vo(e)?ur.set(e,n):typeof e=="object"&&e!==null?e:ur.box(e,n)}fw(Pw,Ow);var N6={box:function(n,t){var r=Qh(t);return new Gl(n,Jh(r),r.name,!0,r.equals)},array:function(n,t){var r=Qh(t);return(Je.useProxies===!1||r.proxy===!1?B8:T8)(n,Jh(r),r.name)},map:function(n,t){var r=Qh(t);return new Dp(n,Jh(r),r.name)},set:function(n,t){var r=Qh(t);return new Ev(n,Jh(r),r.name)},object:function(n,t,r){return Zl(function(){return vv(Je.useProxies===!1||(r==null?void 0:r.proxy)===!1?Ws({},r):P8({},r),n,t)})},ref:_a(A6),shallow:_a(T6),deep:Ow,struct:_a(R6)},ur=fw(Pw,N6),Cw="computed",I6="computed.struct",K1=cv(Cw),j6=cv(I6,{equals:Us.structural}),Vs=function(n,t){if(Bd(t))return K1.decorate_20223_(n,t);if(Bs(t))return zd(n,t,K1);if(Ko(n))return _a(cv(Cw,n));var r=Ko(t)?t:{};return r.get=n,r.name||(r.name=n.name||""),new xa(r)};Object.assign(Vs,K1);Vs.struct=_a(j6);var Bm,Um,hp=0,D6=1,F6=(Bm=(Um=dp(function(){},"name"))==null?void 0:Um.configurable)!=null?Bm:!1,qm={value:"action",configurable:!0,writable:!1,enumerable:!1};function Wl(e,n,t,r){t===void 0&&(t=!1);function a(){return kw(e,t,n,r||this,arguments)}return a.isMobxAction=!0,a.toString=function(){return n.toString()},F6&&(qm.value=e,to(a,"name",qm)),a}function kw(e,n,t,r,a){var o=Aw(e,n);try{return t.apply(r,a)}catch(s){throw o.error_=s,s}finally{Tw(o)}}function Aw(e,n,t,r){var a=!1,o=0,s=Je.trackingDerivation,c=!n||!s;di();var m=Je.allowStateChanges;c&&($s(),m=Tp(!0));var f=Mp(!0),v={runAsAction_:c,prevDerivation_:s,prevAllowStateChanges_:m,prevAllowStateReads_:f,notifySpy_:a,startTime_:o,actionId_:D6++,parentActionId_:hp};return hp=v.actionId_,v}function Tw(e){hp!==e.actionId_&&Lt(30),hp=e.parentActionId_,e.error_!==void 0&&(Je.suppressReactionErrors=!0),Rp(e.prevAllowStateChanges_),ac(e.prevAllowStateReads_),hi(),e.runAsAction_&&Wo(e.prevDerivation_),Je.suppressReactionErrors=!1}function fv(e,n){var t=Tp(e);try{return n()}finally{Rp(t)}}function Tp(e){var n=Je.allowStateChanges;return Je.allowStateChanges=e,n}function Rp(e){Je.allowStateChanges=e}var Gl=function(e){function n(r,a,o,s,c){var m;return o===void 0&&(o="ObservableValue"),c===void 0&&(c=Us.default),m=e.call(this,o)||this,m.enhancer=void 0,m.name_=void 0,m.equals=void 0,m.hasUnreportedChange_=!1,m.interceptors_=void 0,m.changeListeners_=void 0,m.value_=void 0,m.dehancer=void 0,m.enhancer=a,m.name_=o,m.equals=c,m.value_=a(r,void 0,o),m}yw(n,e);var t=n.prototype;return t.dehanceValue=function(a){return this.dehancer!==void 0?this.dehancer(a):a},t.set=function(a){this.value_,a=this.prepareNewValue_(a),a!==Je.UNCHANGED&&this.setNewValue_(a)},t.prepareNewValue_=function(a){if(Yi(this)){var o=Ki(this,{object:this,type:ro,newValue:a});if(!o)return Je.UNCHANGED;a=o.newValue}return a=this.enhancer(a,this.value_,this.name_),this.equals(this.value_,a)?Je.UNCHANGED:a},t.setNewValue_=function(a){var o=this.value_;this.value_=a,this.reportChanged(),Sa(this)&&Ea(this,{type:ro,object:this,newValue:a,oldValue:o})},t.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},t.intercept_=function(a){return qd(this,a)},t.observe_=function(a,o){return o&&a({observableKind:"value",debugObjectName:this.name_,object:this,type:ro,newValue:this.value_,oldValue:void 0}),Hd(this,a)},t.raw=function(){return this.value_},t.toJSON=function(){return this.get()},t.toString=function(){return this.name_+"["+this.value_+"]"},t.valueOf=function(){return mw(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},n}(Xl),dv=Kl("ObservableValue",Gl),xa=function(){function e(t){this.dependenciesState_=Xt.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Xt.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new gp(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=pp.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,t.get||Lt(31),this.derivation=t.get,this.name_=t.name||"ComputedValue",t.set&&(this.setter_=Wl("ComputedValue-setter",t.set)),this.equals_=t.equals||(t.compareStructural||t.struct?Us.structural:Us.default),this.scope_=t.context,this.requiresReaction_=t.requiresReaction,this.keepAlive_=!!t.keepAlive}var n=e.prototype;return n.onBecomeStale_=function(){Y6(this)},n.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},n.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},n.get=function(){if(this.isComputing&&Lt(32,this.name_,this.derivation),Je.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)X1(this)&&(this.warnAboutUntrackedRead_(),di(),this.value_=this.computeValue_(!1),hi());else if(Dw(this),X1(this)){var r=Je.trackingContext;this.keepAlive_&&!r&&(Je.trackingContext=this),this.trackAndCompute()&&W6(this),Je.trackingContext=r}var a=this.value_;if(op(a))throw a.cause;return a},n.set=function(r){if(this.setter_){this.isRunningSetter&&Lt(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,r)}finally{this.isRunningSetter=!1}}else Lt(34,this.name_)},n.trackAndCompute=function(){var r=this.value_,a=this.dependenciesState_===Xt.NOT_TRACKING_,o=this.computeValue_(!0),s=a||op(r)||op(o)||!this.equals_(r,o);return s&&(this.value_=o),s},n.computeValue_=function(r){this.isComputing=!0;var a=Tp(!1),o;if(r)o=Rw(this,this.derivation,this.scope_);else if(Je.disableErrorBoundaries===!0)o=this.derivation.call(this.scope_);else try{o=this.derivation.call(this.scope_)}catch(s){o=new gp(s)}return Rp(a),this.isComputing=!1,o},n.suspend_=function(){this.keepAlive_||(Z1(this),this.value_=void 0)},n.observe_=function(r,a){var o=this,s=!0,c=void 0;return pv(function(){var m=o.get();if(!s||a){var f=$s();r({observableKind:"computed",debugObjectName:o.name_,type:ro,object:o,newValue:m,oldValue:c}),Wo(f)}s=!1,c=m})},n.warnAboutUntrackedRead_=function(){},n.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},n.valueOf=function(){return mw(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},bc(e,[{key:"isComputing",get:function(){return Ci(this.flags_,e.isComputingMask_)},set:function(r){this.flags_=ki(this.flags_,e.isComputingMask_,r)}},{key:"isRunningSetter",get:function(){return Ci(this.flags_,e.isRunningSetterMask_)},set:function(r){this.flags_=ki(this.flags_,e.isRunningSetterMask_,r)}},{key:"isBeingObserved",get:function(){return Ci(this.flags_,e.isBeingObservedMask_)},set:function(r){this.flags_=ki(this.flags_,e.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return Ci(this.flags_,e.isPendingUnobservationMask_)},set:function(r){this.flags_=ki(this.flags_,e.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return Ci(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=ki(this.flags_,e.diffValueMask_,r===1)}}])}();xa.isComputingMask_=1;xa.isRunningSetterMask_=2;xa.isBeingObservedMask_=4;xa.isPendingUnobservationMask_=8;xa.diffValueMask_=16;var Hs=Kl("ComputedValue",xa),Xt;(function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"})(Xt||(Xt={}));var pp;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(pp||(pp={}));var gp=function(n){this.cause=void 0,this.cause=n};function op(e){return e instanceof gp}function X1(e){switch(e.dependenciesState_){case Xt.UP_TO_DATE_:return!1;case Xt.NOT_TRACKING_:case Xt.STALE_:return!0;case Xt.POSSIBLY_STALE_:{for(var n=Mp(!0),t=$s(),r=e.observing_,a=r.length,o=0;o<a;o++){var s=r[o];if(Hs(s)){if(Je.disableErrorBoundaries)s.get();else try{s.get()}catch{return Wo(t),ac(n),!0}if(e.dependenciesState_===Xt.STALE_)return Wo(t),ac(n),!0}}return Mw(e),Wo(t),ac(n),!1}}}function z6(){return Je.trackingDerivation!==null}function Rw(e,n,t){var r=Mp(!0);Mw(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++Je.runId;var a=Je.trackingDerivation;Je.trackingDerivation=e,Je.inBatch++;var o;if(Je.disableErrorBoundaries===!0)o=n.call(t);else try{o=n.call(t)}catch(s){o=new gp(s)}return Je.inBatch--,Je.trackingDerivation=a,B6(e),ac(r),o}function B6(e){for(var n=e.observing_,t=e.observing_=e.newObserving_,r=Xt.UP_TO_DATE_,a=0,o=e.unboundDepsCount_,s=0;s<o;s++){var c=t[s];c.diffValue===0&&(c.diffValue=1,a!==s&&(t[a]=c),a++),c.dependenciesState_>r&&(r=c.dependenciesState_)}for(t.length=a,e.newObserving_=null,o=n.length;o--;){var m=n[o];m.diffValue===0&&Iw(m,e),m.diffValue=0}for(;a--;){var f=t[a];f.diffValue===1&&(f.diffValue=0,$6(f,e))}r!==Xt.UP_TO_DATE_&&(e.dependenciesState_=r,e.onBecomeStale_())}function Z1(e){var n=e.observing_;e.observing_=[];for(var t=n.length;t--;)Iw(n[t],e);e.dependenciesState_=Xt.NOT_TRACKING_}function hv(e){var n=$s();try{return e()}finally{Wo(n)}}function $s(){var e=Je.trackingDerivation;return Je.trackingDerivation=null,e}function Wo(e){Je.trackingDerivation=e}function Mp(e){var n=Je.allowStateReads;return Je.allowStateReads=e,n}function ac(e){Je.allowStateReads=e}function Mw(e){if(e.dependenciesState_!==Xt.UP_TO_DATE_){e.dependenciesState_=Xt.UP_TO_DATE_;for(var n=e.observing_,t=n.length;t--;)n[t].lowestObserverState_=Xt.UP_TO_DATE_}}var U6=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED","useProxies"],Od=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},lp=!0,Lw=!1,Je=function(){var e=Pp();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(lp=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new Od().version&&(lp=!1),lp?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Od):(setTimeout(function(){Lw||Lt(35)},1),new Od)}();function q6(){if((Je.pendingReactions.length||Je.inBatch||Je.isRunningReactions)&&Lt(36),Lw=!0,lp){var e=Pp();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),Je=new Od}}function Nw(){return Je}function H6(){var e=new Od;for(var n in e)U6.indexOf(n)===-1&&(Je[n]=e[n]);Je.allowStateChanges=!Je.enforceActions}function G6(e){return e.observers_&&e.observers_.size>0}function V6(e){return e.observers_}function $6(e,n){e.observers_.add(n),e.lowestObserverState_>n.dependenciesState_&&(e.lowestObserverState_=n.dependenciesState_)}function Iw(e,n){e.observers_.delete(n),e.observers_.size===0&&jw(e)}function jw(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,Je.pendingUnobservations.push(e))}function di(){Je.inBatch++}function hi(){if(--Je.inBatch===0){zw();for(var e=Je.pendingUnobservations,n=0;n<e.length;n++){var t=e[n];t.isPendingUnobservation=!1,t.observers_.size===0&&(t.isBeingObserved&&(t.isBeingObserved=!1,t.onBUO()),t instanceof xa&&t.suspend_())}Je.pendingUnobservations=[]}}function Dw(e){var n=Je.trackingDerivation;return n!==null?(n.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=n.runId_,n.newObserving_[n.unboundDepsCount_++]=e,!e.isBeingObserved&&Je.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&Je.inBatch>0&&jw(e),!1)}function Fw(e){e.lowestObserverState_!==Xt.STALE_&&(e.lowestObserverState_=Xt.STALE_,e.observers_.forEach(function(n){n.dependenciesState_===Xt.UP_TO_DATE_&&n.onBecomeStale_(),n.dependenciesState_=Xt.STALE_}))}function W6(e){e.lowestObserverState_!==Xt.STALE_&&(e.lowestObserverState_=Xt.STALE_,e.observers_.forEach(function(n){n.dependenciesState_===Xt.POSSIBLY_STALE_?n.dependenciesState_=Xt.STALE_:n.dependenciesState_===Xt.UP_TO_DATE_&&(e.lowestObserverState_=Xt.UP_TO_DATE_)}))}function Y6(e){e.lowestObserverState_===Xt.UP_TO_DATE_&&(e.lowestObserverState_=Xt.POSSIBLY_STALE_,e.observers_.forEach(function(n){n.dependenciesState_===Xt.UP_TO_DATE_&&(n.dependenciesState_=Xt.POSSIBLY_STALE_,n.onBecomeStale_())}))}var Oa=function(){function e(t,r,a,o){t===void 0&&(t="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Xt.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=pp.NONE,this.name_=t,this.onInvalidate_=r,this.errorHandler_=a,this.requiresObservable_=o}var n=e.prototype;return n.onBecomeStale_=function(){this.schedule_()},n.schedule_=function(){this.isScheduled||(this.isScheduled=!0,Je.pendingReactions.push(this),zw())},n.runReaction_=function(){if(!this.isDisposed){di(),this.isScheduled=!1;var r=Je.trackingContext;if(Je.trackingContext=this,X1(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(a){this.reportExceptionInDerivation_(a)}}Je.trackingContext=r,hi()}},n.track=function(r){if(!this.isDisposed){di(),this.isRunning=!0;var a=Je.trackingContext;Je.trackingContext=this;var o=Rw(this,r,void 0);Je.trackingContext=a,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&Z1(this),op(o)&&this.reportExceptionInDerivation_(o.cause),hi()}},n.reportExceptionInDerivation_=function(r){var a=this;if(this.errorHandler_){this.errorHandler_(r,this);return}if(Je.disableErrorBoundaries)throw r;var o="[mobx] uncaught error in '"+this+"'";Je.suppressReactionErrors||console.error(o,r),Je.globalReactionErrorHandlers.forEach(function(s){return s(r,a)})},n.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(di(),Z1(this),hi()))},n.getDisposer_=function(r){var a=this,o=function s(){a.dispose(),r==null||r.removeEventListener==null||r.removeEventListener("abort",s)};return r==null||r.addEventListener==null||r.addEventListener("abort",o),o[bt]=this,o},n.toString=function(){return"Reaction["+this.name_+"]"},n.trace=function(r){},bc(e,[{key:"isDisposed",get:function(){return Ci(this.flags_,e.isDisposedMask_)},set:function(r){this.flags_=ki(this.flags_,e.isDisposedMask_,r)}},{key:"isScheduled",get:function(){return Ci(this.flags_,e.isScheduledMask_)},set:function(r){this.flags_=ki(this.flags_,e.isScheduledMask_,r)}},{key:"isTrackPending",get:function(){return Ci(this.flags_,e.isTrackPendingMask_)},set:function(r){this.flags_=ki(this.flags_,e.isTrackPendingMask_,r)}},{key:"isRunning",get:function(){return Ci(this.flags_,e.isRunningMask_)},set:function(r){this.flags_=ki(this.flags_,e.isRunningMask_,r)}},{key:"diffValue",get:function(){return Ci(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=ki(this.flags_,e.diffValueMask_,r===1)}}])}();Oa.isDisposedMask_=1;Oa.isScheduledMask_=2;Oa.isTrackPendingMask_=4;Oa.isRunningMask_=8;Oa.diffValueMask_=16;function K6(e){return Je.globalReactionErrorHandlers.push(e),function(){var n=Je.globalReactionErrorHandlers.indexOf(e);n>=0&&Je.globalReactionErrorHandlers.splice(n,1)}}var X6=100,Q1=function(n){return n()};function zw(){Je.inBatch>0||Je.isRunningReactions||Q1(Z6)}function Z6(){Je.isRunningReactions=!0;for(var e=Je.pendingReactions,n=0;e.length>0;){++n===X6&&(console.error("[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var t=e.splice(0),r=0,a=t.length;r<a;r++)t[r].runReaction_()}Je.isRunningReactions=!1}var vp=Kl("Reaction",Oa);function Q6(e){var n=Q1;Q1=function(r){return e(function(){return n(r)})}}function Pd(){return!1}function Bw(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var Uw="action",J6="action.bound",qw="autoAction",e8="autoAction.bound",Hw="<unnamed action>",J1=Ud(Uw),t8=Ud(J6,{bound:!0}),ev=Ud(qw,{autoAction:!0}),r8=Ud(e8,{autoAction:!0,bound:!0});function Gw(e){var n=function(r,a){if(Ai(r))return Wl(r.name||Hw,r,e);if(Ai(a))return Wl(r,a,e);if(Bd(a))return(e?ev:J1).decorate_20223_(r,a);if(Bs(a))return zd(r,a,e?ev:J1);if(Bs(r))return _a(Ud(e?qw:Uw,{name:r,autoAction:e}))};return n}var Xr=Gw(!1);Object.assign(Xr,J1);var sc=Gw(!0);Object.assign(sc,ev);Xr.bound=_a(t8);sc.bound=_a(r8);function uc(e){return kw(e.name||Hw,!1,e,this,void 0)}function cc(e){return Ai(e)&&e.isMobxAction===!0}function pv(e,n){var t,r,a,o;n===void 0&&(n=sv);var s=(t=(r=n)==null?void 0:r.name)!=null?t:"Autorun",c=!n.scheduler&&!n.delay,m;if(c)m=new Oa(s,function(){this.track(y)},n.onError,n.requiresObservable);else{var f=Vw(n),v=!1;m=new Oa(s,function(){v||(v=!0,f(function(){v=!1,m.isDisposed||m.track(y)}))},n.onError,n.requiresObservable)}function y(){e(m)}return(a=n)!=null&&(a=a.signal)!=null&&a.aborted||m.schedule_(),m.getDisposer_((o=n)==null?void 0:o.signal)}var n8=function(n){return n()};function Vw(e){return e.scheduler?e.scheduler:e.delay?function(n){return setTimeout(n,e.delay)}:n8}function $w(e,n,t){var r,a,o;t===void 0&&(t=sv);var s=(r=t.name)!=null?r:"Reaction",c=Xr(s,t.onError?i8(t.onError,n):n),m=!t.scheduler&&!t.delay,f=Vw(t),v=!0,y=!1,E,w=t.compareStructural?Us.structural:t.equals||Us.default,S=new Oa(s,function(){v||m?x():y||(y=!0,f(x))},t.onError,t.requiresObservable);function x(){if(y=!1,!S.isDisposed){var _=!1,b=E;S.track(function(){var g=fv(!1,function(){return e(S)});_=v||!w(E,g),E=g}),(v&&t.fireImmediately||!v&&_)&&c(E,b,S),v=!1}}return(a=t)!=null&&(a=a.signal)!=null&&a.aborted||S.schedule_(),S.getDisposer_((o=t)==null?void 0:o.signal)}function i8(e,n){return function(){try{return n.apply(this,arguments)}catch(t){e.call(this,t)}}}var a8="onBO",o8="onBUO";function Ww(e,n,t){return Yw(a8,e,n,t)}function gv(e,n,t){return Yw(o8,e,n,t)}function Yw(e,n,t,r){var a=typeof r=="function"?no(n,t):no(n),o=Ai(r)?r:t,s=e+"L";return a[s]?a[s].add(o):a[s]=new Set([o]),function(){var c=a[s];c&&(c.delete(o),c.size===0&&delete a[s])}}var l8="never",ep="always",s8="observed";function Kw(e){e.isolateGlobalState===!0&&q6();var n=e.useProxies,t=e.enforceActions;if(n!==void 0&&(Je.useProxies=n===ep?!0:n===l8?!1:typeof Proxy<"u"),n==="ifavailable"&&(Je.verifyProxies=!0),t!==void 0){var r=t===ep?ep:t===s8;Je.enforceActions=r,Je.allowStateChanges=!(r===!0||r===ep)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(a){a in e&&(Je[a]=!!e[a])}),Je.allowStateReads=!Je.observableRequiresReaction,e.reactionScheduler&&Q6(e.reactionScheduler)}function vv(e,n,t,r){var a=U_(n);return Zl(function(){var o=Ws(e,r)[bt];lc(a).forEach(function(s){o.extend_(s,a[s],t&&s in t?t[s]:!0)})}),e}function Xw(e,n){return Zw(no(e,n))}function Zw(e){var n={name:e.name_};return e.observing_&&e.observing_.length>0&&(n.dependencies=c8(e.observing_).map(Zw)),n}function u8(e,n){return Qw(no(e,n))}function Qw(e){var n={name:e.name_};return G6(e)&&(n.observers=Array.from(V6(e)).map(Qw)),n}function c8(e){return Array.from(new Set(e))}var f8=0;function Lp(){this.message="FLOW_CANCELLED"}Lp.prototype=Object.create(Error.prototype);function d8(e){return e instanceof Lp}var Lg=_w("flow"),h8=_w("flow.bound",{bound:!0}),Gs=Object.assign(function(n,t){if(Bd(t))return Lg.decorate_20223_(n,t);if(Bs(t))return zd(n,t,Lg);var r=n,a=r.name||"<unnamed flow>",o=function(){var c=this,m=arguments,f=++f8,v=Xr(a+" - runid: "+f+" - init",r).apply(c,m),y,E=void 0,w=new Promise(function(S,x){var _=0;y=x;function b(d){E=void 0;var P;try{P=Xr(a+" - runid: "+f+" - yield "+_++,v.next).call(v,d)}catch(M){return x(M)}h(P)}function g(d){E=void 0;var P;try{P=Xr(a+" - runid: "+f+" - yield "+_++,v.throw).call(v,d)}catch(M){return x(M)}h(P)}function h(d){if(Ai(d==null?void 0:d.then)){d.then(h,x);return}return d.done?S(d.value):(E=Promise.resolve(d.value),E.then(b,g))}b(void 0)});return w.cancel=Xr(a+" - runid: "+f+" - cancel",function(){try{E&&Hm(E);var S=v.return(void 0),x=Promise.resolve(S.value);x.then(rc,rc),Hm(x),y(new Lp)}catch(_){y(_)}}),w};return o.isMobXFlow=!0,o},Lg);Gs.bound=_a(h8);function Hm(e){Ai(e.cancel)&&e.cancel()}function p8(e){return e}function fc(e){return(e==null?void 0:e.isMobXFlow)===!0}function mv(e,n,t){var r;return Rn(e)||Qn(e)||dv(e)?r=Pa(e):yn(e)&&(r=Pa(e,n)),r.dehancer=typeof n=="function"?n:t,function(){r.dehancer=void 0}}function Np(e,n,t){return Ai(t)?v8(e,n,t):g8(e,n)}function g8(e,n){return Pa(e).intercept_(n)}function v8(e,n,t){return Pa(e,n).intercept_(t)}function Jw(e,n){if(n===void 0)return Hs(e);if(yn(e)===!1||!e[bt].values_.has(n))return!1;var t=no(e,n);return Hs(t)}function m8(e){return Jw(e)}function e5(e,n){return Jw(e,n)}function t5(e,n){return e?n!==void 0?yn(e)?e[bt].values_.has(n):!1:yn(e)||!!e[bt]||uv(e)||vp(e)||Hs(e):!1}function Ip(e){return t5(e)}function r5(e,n){return t5(e,n)}function Td(e){if(yn(e))return e[bt].keys_();if(Rn(e)||an(e))return Array.from(e.keys());if(Qn(e))return e.map(function(n,t){return t});Lt(5)}function yv(e){if(yn(e))return Td(e).map(function(n){return e[n]});if(Rn(e))return Td(e).map(function(n){return e.get(n)});if(an(e))return Array.from(e.values());if(Qn(e))return e.slice();Lt(6)}function n5(e){if(yn(e))return Td(e).map(function(n){return[n,e[n]]});if(Rn(e))return Td(e).map(function(n){return[n,e.get(n)]});if(an(e))return Array.from(e.entries());if(Qn(e))return e.map(function(n,t){return[t,n]});Lt(7)}function bv(e,n,t){if(arguments.length===2&&!an(e)){di();var r=n;try{for(var a in r)bv(e,a,r[a])}finally{hi()}return}yn(e)?e[bt].set_(n,t):Rn(e)?e.set(n,t):an(e)?e.add(n):Qn(e)?(typeof n!="number"&&(n=parseInt(n,10)),n<0&&Lt("Invalid index: '"+n+"'"),di(),n>=e.length&&(e.length=n+1),e[n]=t,hi()):Lt(8)}function y8(e,n){yn(e)?e[bt].delete_(n):Rn(e)||an(e)?e.delete(n):Qn(e)?(typeof n!="number"&&(n=parseInt(n,10)),e.splice(n,1)):Lt(9)}function i5(e,n){if(yn(e))return e[bt].has_(n);if(Rn(e))return e.has(n);if(an(e))return e.has(n);if(Qn(e))return n>=0&&n<e.length;Lt(10)}function b8(e,n){if(i5(e,n)){if(yn(e))return e[bt].get_(n);if(Rn(e))return e.get(n);if(Qn(e))return e[n];Lt(11)}}function wv(e,n,t){if(yn(e))return e[bt].defineProperty_(n,t);Lt(39)}function a5(e){if(yn(e))return e[bt].ownKeys_();Lt(38)}function jp(e,n,t,r){return Ai(t)?_8(e,n,t,r):w8(e,n,t)}function w8(e,n,t){return Pa(e).observe_(n,t)}function _8(e,n,t,r){return Pa(e,n).observe_(t,r)}function tp(e,n,t){return e.set(n,t),t}function ec(e,n){if(e==null||typeof e!="object"||e instanceof Date||!Ip(e))return e;if(dv(e)||Hs(e))return ec(e.get(),n);if(n.has(e))return n.get(e);if(Qn(e)){var t=tp(n,e,new Array(e.length));return e.forEach(function(s,c){t[c]=ec(s,n)}),t}if(an(e)){var r=tp(n,e,new Set);return e.forEach(function(s){r.add(ec(s,n))}),r}if(Rn(e)){var a=tp(n,e,new Map);return e.forEach(function(s,c){a.set(c,ec(s,n))}),a}else{var o=tp(n,e,{});return a5(e).forEach(function(s){Dd.propertyIsEnumerable.call(e,s)&&(o[s]=ec(e[s],n))}),o}}function S8(e,n){return ec(e,new Map)}function E8(){}function Ja(e,n){n===void 0&&(n=void 0),di();try{return e.apply(n)}finally{hi()}}function tv(e,n,t){return arguments.length===1||n&&typeof n=="object"?x8(e,n):o5(e,n,t||{})}function o5(e,n,t){var r;if(typeof t.timeout=="number"){var a=new Error("WHEN_TIMEOUT");r=setTimeout(function(){if(!s[bt].isDisposed)if(s(),t.onError)t.onError(a);else throw a},t.timeout)}t.name="When";var o=Wl("When-effect",n),s=pv(function(c){var m=fv(!1,e);m&&(c.dispose(),r&&clearTimeout(r),o())},t);return s}function x8(e,n){var t;if(n!=null&&(t=n.signal)!=null&&t.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var r,a,o=new Promise(function(s,c){var m,f=o5(e,s,$l({},n,{onError:c}));r=function(){f(),c(new Error("WHEN_CANCELLED"))},a=function(){f(),c(new Error("WHEN_ABORTED"))},n==null||(m=n.signal)==null||m.addEventListener==null||m.addEventListener("abort",a)}).finally(function(){var s;return n==null||(s=n.signal)==null||s.removeEventListener==null?void 0:s.removeEventListener("abort",a)});return o.cancel=r,o}function Zu(e){return e[bt]}var O8={has:function(n,t){return Zu(n).has_(t)},get:function(n,t){return Zu(n).get_(t)},set:function(n,t,r){var a;return Bs(t)?(a=Zu(n).set_(t,r,!0))!=null?a:!0:!1},deleteProperty:function(n,t){var r;return Bs(t)?(r=Zu(n).delete_(t,!0))!=null?r:!0:!1},defineProperty:function(n,t,r){var a;return(a=Zu(n).defineProperty_(t,r))!=null?a:!0},ownKeys:function(n){return Zu(n).ownKeys_()},preventExtensions:function(n){Lt(13)}};function P8(e,n){var t,r;return dw(),e=Ws(e,n),(r=(t=e[bt]).proxy_)!=null?r:t.proxy_=new Proxy(e,O8)}function Yi(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function qd(e,n){var t=e.interceptors_||(e.interceptors_=[]);return t.push(n),hw(function(){var r=t.indexOf(n);r!==-1&&t.splice(r,1)})}function Ki(e,n){var t=$s();try{for(var r=[].concat(e.interceptors_||[]),a=0,o=r.length;a<o&&(n=r[a](n),n&&!n.type&&Lt(14),!!n);a++);return n}finally{Wo(t)}}function Sa(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function Hd(e,n){var t=e.changeListeners_||(e.changeListeners_=[]);return t.push(n),hw(function(){var r=t.indexOf(n);r!==-1&&t.splice(r,1)})}function Ea(e,n){var t=$s(),r=e.changeListeners_;if(r){r=r.slice();for(var a=0,o=r.length;a<o;a++)r[a](n);Wo(t)}}function _v(e,n,t){return Zl(function(){var r,a=Ws(e,t)[bt];(r=n)!=null||(n=$_(e)),lc(n).forEach(function(o){return a.make_(o,n[o])})}),e}var Ng=Symbol("mobx-keys");function C8(e,n,t){return Ko(e)?vv(e,e,n,t):(Zl(function(){var r=Ws(e,t)[bt];if(!e[Ng]){var a=Object.getPrototypeOf(e),o=new Set([].concat(lc(e),lc(a)));o.delete("constructor"),o.delete(bt),Fd(a,Ng,o)}e[Ng].forEach(function(s){return r.make_(s,n&&s in n?n[s]:!0)})}),e)}var Gm="splice",ro="update",k8=1e4,A8={get:function(n,t){var r=n[bt];return t===bt?r:t==="length"?r.getArrayLength_():typeof t=="string"&&!isNaN(t)?r.get_(parseInt(t)):$o(mp,t)?mp[t]:n[t]},set:function(n,t,r){var a=n[bt];return t==="length"&&a.setArrayLength_(r),typeof t=="symbol"||isNaN(t)?n[t]=r:a.set_(parseInt(t),r),!0},preventExtensions:function(){Lt(15)}},Sv=function(){function e(t,r,a,o){t===void 0&&(t="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=a,this.legacyMode_=o,this.atom_=new Xl(t),this.enhancer_=function(s,c){return r(s,c,"ObservableArray[..]")}}var n=e.prototype;return n.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},n.dehanceValues_=function(r){return this.dehancer!==void 0&&r.length>0?r.map(this.dehancer):r},n.intercept_=function(r){return qd(this,r)},n.observe_=function(r,a){return a===void 0&&(a=!1),a&&r({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),Hd(this,r)},n.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},n.setArrayLength_=function(r){(typeof r!="number"||isNaN(r)||r<0)&&Lt("Out of range: "+r);var a=this.values_.length;if(r!==a)if(r>a){for(var o=new Array(r-a),s=0;s<r-a;s++)o[s]=void 0;this.spliceWithArray_(a,0,o)}else this.spliceWithArray_(r,a-r)},n.updateArrayLength_=function(r,a){r!==this.lastKnownLength_&&Lt(16),this.lastKnownLength_+=a,this.legacyMode_&&a>0&&f5(r+a+1)},n.spliceWithArray_=function(r,a,o){var s=this;this.atom_;var c=this.values_.length;if(r===void 0?r=0:r>c?r=c:r<0&&(r=Math.max(0,c+r)),arguments.length===1?a=c-r:a==null?a=0:a=Math.max(0,Math.min(a,c-r)),o===void 0&&(o=$1),Yi(this)){var m=Ki(this,{object:this.proxy_,type:Gm,index:r,removedCount:a,added:o});if(!m)return $1;a=m.removedCount,o=m.added}if(o=o.length===0?o:o.map(function(y){return s.enhancer_(y,void 0)}),this.legacyMode_){var f=o.length-a;this.updateArrayLength_(c,f)}var v=this.spliceItemsIntoValues_(r,a,o);return(a!==0||o.length!==0)&&this.notifyArraySplice_(r,o,v),this.dehanceValues_(v)},n.spliceItemsIntoValues_=function(r,a,o){if(o.length<k8){var s;return(s=this.values_).splice.apply(s,[r,a].concat(o))}else{var c=this.values_.slice(r,r+a),m=this.values_.slice(r+a);this.values_.length+=o.length-a;for(var f=0;f<o.length;f++)this.values_[r+f]=o[f];for(var v=0;v<m.length;v++)this.values_[r+o.length+v]=m[v];return c}},n.notifyArrayChildUpdate_=function(r,a,o){var s=!this.owned_&&Pd(),c=Sa(this),m=c||s?{observableKind:"array",object:this.proxy_,type:ro,debugObjectName:this.atom_.name_,index:r,newValue:a,oldValue:o}:null;this.atom_.reportChanged(),c&&Ea(this,m)},n.notifyArraySplice_=function(r,a,o){var s=!this.owned_&&Pd(),c=Sa(this),m=c||s?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:Gm,index:r,removed:o,added:a,removedCount:o.length,addedCount:a.length}:null;this.atom_.reportChanged(),c&&Ea(this,m)},n.get_=function(r){if(this.legacyMode_&&r>=this.values_.length){console.warn("[mobx] Out of bounds read: "+r);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[r])},n.set_=function(r,a){var o=this.values_;if(this.legacyMode_&&r>o.length&&Lt(17,r,o.length),r<o.length){this.atom_;var s=o[r];if(Yi(this)){var c=Ki(this,{type:ro,object:this.proxy_,index:r,newValue:a});if(!c)return;a=c.newValue}a=this.enhancer_(a,s);var m=a!==s;m&&(o[r]=a,this.notifyArrayChildUpdate_(r,a,s))}else{for(var f=new Array(r+1-o.length),v=0;v<f.length-1;v++)f[v]=void 0;f[f.length-1]=a,this.spliceWithArray_(o.length,0,f)}},e}();function T8(e,n,t,r){return t===void 0&&(t="ObservableArray"),r===void 0&&(r=!1),dw(),Zl(function(){var a=new Sv(t,n,r,!1);gw(a.values_,bt,a);var o=new Proxy(a.values_,A8);return a.proxy_=o,e&&e.length&&a.spliceWithArray_(0,0,e),o})}var mp={clear:function(){return this.splice(0)},replace:function(n){var t=this[bt];return t.spliceWithArray_(0,t.values_.length,n)},toJSON:function(){return this.slice()},splice:function(n,t){for(var r=arguments.length,a=new Array(r>2?r-2:0),o=2;o<r;o++)a[o-2]=arguments[o];var s=this[bt];switch(arguments.length){case 0:return[];case 1:return s.spliceWithArray_(n);case 2:return s.spliceWithArray_(n,t)}return s.spliceWithArray_(n,t,a)},spliceWithArray:function(n,t,r){return this[bt].spliceWithArray_(n,t,r)},push:function(){for(var n=this[bt],t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return n.spliceWithArray_(n.values_.length,0,r),n.values_.length},pop:function(){return this.splice(Math.max(this[bt].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var n=this[bt],t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return n.spliceWithArray_(0,0,r),n.values_.length},reverse:function(){return Je.trackingDerivation&&Lt(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){Je.trackingDerivation&&Lt(37,"sort");var n=this.slice();return n.sort.apply(n,arguments),this.replace(n),this},remove:function(n){var t=this[bt],r=t.dehanceValues_(t.values_).indexOf(n);return r>-1?(this.splice(r,1),!0):!1}};br("at",Ti);br("concat",Ti);br("flat",Ti);br("includes",Ti);br("indexOf",Ti);br("join",Ti);br("lastIndexOf",Ti);br("slice",Ti);br("toString",Ti);br("toLocaleString",Ti);br("toSorted",Ti);br("toSpliced",Ti);br("with",Ti);br("every",Ca);br("filter",Ca);br("find",Ca);br("findIndex",Ca);br("findLast",Ca);br("findLastIndex",Ca);br("flatMap",Ca);br("forEach",Ca);br("map",Ca);br("some",Ca);br("toReversed",Ca);br("reduce",l5);br("reduceRight",l5);function br(e,n){typeof Array.prototype[e]=="function"&&(mp[e]=n(e))}function Ti(e){return function(){var n=this[bt];n.atom_.reportObserved();var t=n.dehanceValues_(n.values_);return t[e].apply(t,arguments)}}function Ca(e){return function(n,t){var r=this,a=this[bt];a.atom_.reportObserved();var o=a.dehanceValues_(a.values_);return o[e](function(s,c){return n.call(t,s,c,r)})}}function l5(e){return function(){var n=this,t=this[bt];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_),a=arguments[0];return arguments[0]=function(o,s,c){return a(o,s,c,n)},r[e].apply(r,arguments)}}var R8=Kl("ObservableArrayAdministration",Sv);function Qn(e){return Cp(e)&&R8(e[bt])}var M8={},Hl="add",yp="delete",Dp=function(){function e(t,r,a){var o=this;r===void 0&&(r=qs),a===void 0&&(a="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[bt]=M8,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=r,this.name_=a,Ai(Map)||Lt(18),Zl(function(){o.keysAtom_=Ad("ObservableMap.keys()"),o.data_=new Map,o.hasMap_=new Map,t&&o.merge(t)})}var n=e.prototype;return n.has_=function(r){return this.data_.has(r)},n.has=function(r){var a=this;if(!Je.trackingDerivation)return this.has_(r);var o=this.hasMap_.get(r);if(!o){var s=o=new Gl(this.has_(r),kp,"ObservableMap.key?",!1);this.hasMap_.set(r,s),gv(s,function(){return a.hasMap_.delete(r)})}return o.get()},n.set=function(r,a){var o=this.has_(r);if(Yi(this)){var s=Ki(this,{type:o?ro:Hl,object:this,newValue:a,name:r});if(!s)return this;a=s.newValue}return o?this.updateValue_(r,a):this.addValue_(r,a),this},n.delete=function(r){var a=this;if(this.keysAtom_,Yi(this)){var o=Ki(this,{type:yp,object:this,name:r});if(!o)return!1}if(this.has_(r)){var s=Pd(),c=Sa(this),m=c||s?{observableKind:"map",debugObjectName:this.name_,type:yp,object:this,oldValue:this.data_.get(r).value_,name:r}:null;return Ja(function(){var f;a.keysAtom_.reportChanged(),(f=a.hasMap_.get(r))==null||f.setNewValue_(!1);var v=a.data_.get(r);v.setNewValue_(void 0),a.data_.delete(r)}),c&&Ea(this,m),!0}return!1},n.updateValue_=function(r,a){var o=this.data_.get(r);if(a=o.prepareNewValue_(a),a!==Je.UNCHANGED){var s=Pd(),c=Sa(this),m=c||s?{observableKind:"map",debugObjectName:this.name_,type:ro,object:this,oldValue:o.value_,name:r,newValue:a}:null;o.setNewValue_(a),c&&Ea(this,m)}},n.addValue_=function(r,a){var o=this;this.keysAtom_,Ja(function(){var f,v=new Gl(a,o.enhancer_,"ObservableMap.key",!1);o.data_.set(r,v),a=v.value_,(f=o.hasMap_.get(r))==null||f.setNewValue_(!0),o.keysAtom_.reportChanged()});var s=Pd(),c=Sa(this),m=c||s?{observableKind:"map",debugObjectName:this.name_,type:Hl,object:this,name:r,newValue:a}:null;c&&Ea(this,m)},n.get=function(r){return this.has(r)?this.dehanceValue_(this.data_.get(r).get()):this.dehanceValue_(void 0)},n.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},n.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},n.values=function(){var r=this,a=this.keys();return Vm({next:function(){var s=a.next(),c=s.done,m=s.value;return{done:c,value:c?void 0:r.get(m)}}})},n.entries=function(){var r=this,a=this.keys();return Vm({next:function(){var s=a.next(),c=s.done,m=s.value;return{done:c,value:c?void 0:[m,r.get(m)]}}})},n[Symbol.iterator]=function(){return this.entries()},n.forEach=function(r,a){for(var o=nc(this),s;!(s=o()).done;){var c=s.value,m=c[0],f=c[1];r.call(a,f,m,this)}},n.merge=function(r){var a=this;return Rn(r)&&(r=new Map(r)),Ja(function(){Ko(r)?B_(r).forEach(function(o){return a.set(o,r[o])}):Array.isArray(r)?r.forEach(function(o){var s=o[0],c=o[1];return a.set(s,c)}):yc(r)?(z_(r)||Lt(19,r),r.forEach(function(o,s){return a.set(s,o)})):r!=null&&Lt(20,r)}),this},n.clear=function(){var r=this;Ja(function(){hv(function(){for(var a=nc(r.keys()),o;!(o=a()).done;){var s=o.value;r.delete(s)}})})},n.replace=function(r){var a=this;return Ja(function(){for(var o=L8(r),s=new Map,c=!1,m=nc(a.data_.keys()),f;!(f=m()).done;){var v=f.value;if(!o.has(v)){var y=a.delete(v);if(y)c=!0;else{var E=a.data_.get(v);s.set(v,E)}}}for(var w=nc(o.entries()),S;!(S=w()).done;){var x=S.value,_=x[0],b=x[1],g=a.data_.has(_);if(a.set(_,b),a.data_.has(_)){var h=a.data_.get(_);s.set(_,h),g||(c=!0)}}if(!c)if(a.data_.size!==s.size)a.keysAtom_.reportChanged();else for(var d=a.data_.keys(),P=s.keys(),M=d.next(),T=P.next();!M.done;){if(M.value!==T.value){a.keysAtom_.reportChanged();break}M=d.next(),T=P.next()}a.data_=s}),this},n.toString=function(){return"[object ObservableMap]"},n.toJSON=function(){return Array.from(this)},n.observe_=function(r,a){return Hd(this,r)},n.intercept_=function(r){return qd(this,r)},bc(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),Rn=Kl("ObservableMap",Dp);function Vm(e){return e[Symbol.toStringTag]="MapIterator",Pv(e)}function L8(e){if(yc(e)||Rn(e))return e;if(Array.isArray(e))return new Map(e);if(Ko(e)){var n=new Map;for(var t in e)n.set(t,e[t]);return n}else return Lt(21,e)}var N8={},Ev=function(){function e(t,r,a){var o=this;r===void 0&&(r=qs),a===void 0&&(a="ObservableSet"),this.name_=void 0,this[bt]=N8,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=a,Ai(Set)||Lt(22),this.enhancer_=function(s,c){return r(s,c,a)},Zl(function(){o.atom_=Ad(o.name_),t&&o.replace(t)})}var n=e.prototype;return n.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},n.clear=function(){var r=this;Ja(function(){hv(function(){for(var a=nc(r.data_.values()),o;!(o=a()).done;){var s=o.value;r.delete(s)}})})},n.forEach=function(r,a){for(var o=nc(this),s;!(s=o()).done;){var c=s.value;r.call(a,c,c,this)}},n.add=function(r){var a=this;if(this.atom_,Yi(this)){var o=Ki(this,{type:Hl,object:this,newValue:r});if(!o)return this;r=o.newValue}if(!this.has(r)){Ja(function(){a.data_.add(a.enhancer_(r,void 0)),a.atom_.reportChanged()});var s=!1,c=Sa(this),m=c||s?{observableKind:"set",debugObjectName:this.name_,type:Hl,object:this,newValue:r}:null;c&&Ea(this,m)}return this},n.delete=function(r){var a=this;if(Yi(this)){var o=Ki(this,{type:yp,object:this,oldValue:r});if(!o)return!1}if(this.has(r)){var s=!1,c=Sa(this),m=c||s?{observableKind:"set",debugObjectName:this.name_,type:yp,object:this,oldValue:r}:null;return Ja(function(){a.atom_.reportChanged(),a.data_.delete(r)}),c&&Ea(this,m),!0}return!1},n.has=function(r){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(r))},n.entries=function(){var r=this.values();return $m({next:function(){var o=r.next(),s=o.value,c=o.done;return c?{value:void 0,done:c}:{value:[s,s],done:c}}})},n.keys=function(){return this.values()},n.values=function(){this.atom_.reportObserved();var r=this,a=this.data_.values();return $m({next:function(){var s=a.next(),c=s.value,m=s.done;return m?{value:void 0,done:m}:{value:r.dehanceValue_(c),done:m}}})},n.intersection=function(r){if(Vo(r)&&!an(r))return r.intersection(this);var a=new Set(this);return a.intersection(r)},n.union=function(r){if(Vo(r)&&!an(r))return r.union(this);var a=new Set(this);return a.union(r)},n.difference=function(r){return new Set(this).difference(r)},n.symmetricDifference=function(r){if(Vo(r)&&!an(r))return r.symmetricDifference(this);var a=new Set(this);return a.symmetricDifference(r)},n.isSubsetOf=function(r){return new Set(this).isSubsetOf(r)},n.isSupersetOf=function(r){return new Set(this).isSupersetOf(r)},n.isDisjointFrom=function(r){if(Vo(r)&&!an(r))return r.isDisjointFrom(this);var a=new Set(this);return a.isDisjointFrom(r)},n.replace=function(r){var a=this;return an(r)&&(r=new Set(r)),Ja(function(){Array.isArray(r)?(a.clear(),r.forEach(function(o){return a.add(o)})):Vo(r)?(a.clear(),r.forEach(function(o){return a.add(o)})):r!=null&&Lt("Cannot initialize set from "+r)}),this},n.observe_=function(r,a){return Hd(this,r)},n.intercept_=function(r){return qd(this,r)},n.toJSON=function(){return Array.from(this)},n.toString=function(){return"[object ObservableSet]"},n[Symbol.iterator]=function(){return this.values()},bc(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),an=Kl("ObservableSet",Ev);function $m(e){return e[Symbol.toStringTag]="SetIterator",Pv(e)}var Wm=Object.create(null),Ym="remove",s5=function(){function e(t,r,a,o){r===void 0&&(r=new Map),o===void 0&&(o=_6),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=t,this.values_=r,this.name_=a,this.defaultAnnotation_=o,this.keysAtom_=new Xl("ObservableObject.keys"),this.isPlainObject_=Ko(this.target_)}var n=e.prototype;return n.getObservablePropValue_=function(r){return this.values_.get(r).get()},n.setObservablePropValue_=function(r,a){var o=this.values_.get(r);if(o instanceof xa)return o.set(a),!0;if(Yi(this)){var s=Ki(this,{type:ro,object:this.proxy_||this.target_,name:r,newValue:a});if(!s)return null;a=s.newValue}if(a=o.prepareNewValue_(a),a!==Je.UNCHANGED){var c=Sa(this),m=!1,f=c||m?{type:ro,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:o.value_,name:r,newValue:a}:null;o.setNewValue_(a),c&&Ea(this,f)}return!0},n.get_=function(r){return Je.trackingDerivation&&!$o(this.target_,r)&&this.has_(r),this.target_[r]},n.set_=function(r,a,o){return o===void 0&&(o=!1),$o(this.target_,r)?this.values_.has(r)?this.setObservablePropValue_(r,a):o?Reflect.set(this.target_,r,a):(this.target_[r]=a,!0):this.extend_(r,{value:a,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,o)},n.has_=function(r){if(!Je.trackingDerivation)return r in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var a=this.pendingKeys_.get(r);return a||(a=new Gl(r in this.target_,kp,"ObservableObject.key?",!1),this.pendingKeys_.set(r,a)),a.get()},n.make_=function(r,a){if(a===!0&&(a=this.defaultAnnotation_),a!==!1){if(!(r in this.target_)){var o;if((o=this.target_[eo])!=null&&o[r])return;Lt(1,a.annotationType_,this.name_+"."+r.toString())}for(var s=this.target_;s&&s!==Dd;){var c=dp(s,r);if(c){var m=a.make_(this,r,c,s);if(m===0)return;if(m===1)break}s=Object.getPrototypeOf(s)}Xm(this,a,r)}},n.extend_=function(r,a,o,s){if(s===void 0&&(s=!1),o===!0&&(o=this.defaultAnnotation_),o===!1)return this.defineProperty_(r,a,s);var c=o.extend_(this,r,a,s);return c&&Xm(this,o,r),c},n.defineProperty_=function(r,a,o){o===void 0&&(o=!1),this.keysAtom_;try{di();var s=this.delete_(r);if(!s)return s;if(Yi(this)){var c=Ki(this,{object:this.proxy_||this.target_,name:r,type:Hl,newValue:a.value});if(!c)return null;var m=c.newValue;a.value!==m&&(a=$l({},a,{value:m}))}if(o){if(!Reflect.defineProperty(this.target_,r,a))return!1}else to(this.target_,r,a);this.notifyPropertyAddition_(r,a.value)}finally{hi()}return!0},n.defineObservableProperty_=function(r,a,o,s){s===void 0&&(s=!1),this.keysAtom_;try{di();var c=this.delete_(r);if(!c)return c;if(Yi(this)){var m=Ki(this,{object:this.proxy_||this.target_,name:r,type:Hl,newValue:a});if(!m)return null;a=m.newValue}var f=Km(r),v={configurable:Je.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:f.get,set:f.set};if(s){if(!Reflect.defineProperty(this.target_,r,v))return!1}else to(this.target_,r,v);var y=new Gl(a,o,"ObservableObject.key",!1);this.values_.set(r,y),this.notifyPropertyAddition_(r,y.value_)}finally{hi()}return!0},n.defineComputedProperty_=function(r,a,o){o===void 0&&(o=!1),this.keysAtom_;try{di();var s=this.delete_(r);if(!s)return s;if(Yi(this)){var c=Ki(this,{object:this.proxy_||this.target_,name:r,type:Hl,newValue:void 0});if(!c)return null}a.name||(a.name="ObservableObject.key"),a.context=this.proxy_||this.target_;var m=Km(r),f={configurable:Je.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:m.get,set:m.set};if(o){if(!Reflect.defineProperty(this.target_,r,f))return!1}else to(this.target_,r,f);this.values_.set(r,new xa(a)),this.notifyPropertyAddition_(r,void 0)}finally{hi()}return!0},n.delete_=function(r,a){if(a===void 0&&(a=!1),this.keysAtom_,!$o(this.target_,r))return!0;if(Yi(this)){var o=Ki(this,{object:this.proxy_||this.target_,name:r,type:Ym});if(!o)return null}try{var s;di();var c=Sa(this),m=!1,f=this.values_.get(r),v=void 0;if(!f&&(c||m)){var y;v=(y=dp(this.target_,r))==null?void 0:y.value}if(a){if(!Reflect.deleteProperty(this.target_,r))return!1}else delete this.target_[r];if(f&&(this.values_.delete(r),f instanceof Gl&&(v=f.value_),Fw(f)),this.keysAtom_.reportChanged(),(s=this.pendingKeys_)==null||(s=s.get(r))==null||s.set(r in this.target_),c||m){var E={type:Ym,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:v,name:r};c&&Ea(this,E)}}finally{hi()}return!0},n.observe_=function(r,a){return Hd(this,r)},n.intercept_=function(r){return qd(this,r)},n.notifyPropertyAddition_=function(r,a){var o,s=Sa(this),c=!1;if(s||c){var m=s||c?{type:Hl,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:r,newValue:a}:null;s&&Ea(this,m)}(o=this.pendingKeys_)==null||(o=o.get(r))==null||o.set(!0),this.keysAtom_.reportChanged()},n.ownKeys_=function(){return this.keysAtom_.reportObserved(),lc(this.target_)},n.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function Ws(e,n){var t;if($o(e,bt))return e;var r=(t=n==null?void 0:n.name)!=null?t:"ObservableObject",a=new s5(e,new Map,String(r),M6(n));return Fd(e,bt,a),e}var I8=Kl("ObservableObjectAdministration",s5);function Km(e){return Wm[e]||(Wm[e]={get:function(){return this[bt].getObservablePropValue_(e)},set:function(t){return this[bt].setObservablePropValue_(e,t)}})}function yn(e){return Cp(e)?I8(e[bt]):!1}function Xm(e,n,t){var r;(r=e.target_[eo])==null||delete r[t]}var j8=c5(0),D8=function(){var e=!1,n={};return Object.defineProperty(n,"0",{set:function(){e=!0}}),Object.create(n)[0]=1,e===!1}(),Ig=0,u5=function(){};function F8(e,n){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,n):e.prototype.__proto__!==void 0?e.prototype.__proto__=n:e.prototype=n}F8(u5,Array.prototype);var xv=function(e){function n(r,a,o,s){var c;return o===void 0&&(o="ObservableArray"),s===void 0&&(s=!1),c=e.call(this)||this,Zl(function(){var m=new Sv(o,a,s,!0);m.proxy_=c,gw(c,bt,m),r&&r.length&&c.spliceWithArray(0,0,r),D8&&Object.defineProperty(c,"0",j8)}),c}yw(n,e);var t=n.prototype;return t.concat=function(){this[bt].atom_.reportObserved();for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];return Array.prototype.concat.apply(this.slice(),o.map(function(c){return Qn(c)?c.slice():c}))},t[Symbol.iterator]=function(){var r=this,a=0;return Pv({next:function(){return a<r.length?{value:r[a++],done:!1}:{done:!0,value:void 0}}})},bc(n,[{key:"length",get:function(){return this[bt].getArrayLength_()},set:function(a){this[bt].setArrayLength_(a)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(u5);Object.entries(mp).forEach(function(e){var n=e[0],t=e[1];n!=="concat"&&Fd(xv.prototype,n,t)});function c5(e){return{enumerable:!1,configurable:!0,get:function(){return this[bt].get_(e)},set:function(t){this[bt].set_(e,t)}}}function z8(e){to(xv.prototype,""+e,c5(e))}function f5(e){if(e>Ig){for(var n=Ig;n<e+100;n++)z8(n);Ig=e}}f5(1e3);function B8(e,n,t){return new xv(e,n,t)}function no(e,n){if(typeof e=="object"&&e!==null){if(Qn(e))return n!==void 0&&Lt(23),e[bt].atom_;if(an(e))return e.atom_;if(Rn(e)){if(n===void 0)return e.keysAtom_;var t=e.data_.get(n)||e.hasMap_.get(n);return t||Lt(25,n,bp(e)),t}if(yn(e)){if(!n)return Lt(26);var r=e[bt].values_.get(n);return r||Lt(27,n,bp(e)),r}if(uv(e)||Hs(e)||vp(e))return e}else if(Ai(e)&&vp(e[bt]))return e[bt];Lt(28)}function Pa(e,n){if(e||Lt(29),n!==void 0)return Pa(no(e,n));if(uv(e)||Hs(e)||vp(e)||Rn(e)||an(e))return e;if(e[bt])return e[bt];Lt(24,e)}function bp(e,n){var t;if(n!==void 0)t=no(e,n);else{if(cc(e))return e.name;yn(e)||Rn(e)||an(e)?t=Pa(e):t=no(e)}return t.name_}function Zl(e){var n=$s(),t=Tp(!0);di();try{return e()}finally{hi(),Rp(t),Wo(n)}}var Zm=Dd.toString;function Ov(e,n,t){return t===void 0&&(t=-1),rv(e,n,t)}function rv(e,n,t,r,a){if(e===n)return e!==0||1/e===1/n;if(e==null||n==null)return!1;if(e!==e)return n!==n;var o=typeof e;if(o!=="function"&&o!=="object"&&typeof n!="object")return!1;var s=Zm.call(e);if(s!==Zm.call(n))return!1;switch(s){case"[object RegExp]":case"[object String]":return""+e==""+n;case"[object Number]":return+e!=+e?+n!=+n:+e==0?1/+e===1/n:+e==+n;case"[object Date]":case"[object Boolean]":return+e==+n;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(n);case"[object Map]":case"[object Set]":t>=0&&t++;break}e=Qm(e),n=Qm(n);var c=s==="[object Array]";if(!c){if(typeof e!="object"||typeof n!="object")return!1;var m=e.constructor,f=n.constructor;if(m!==f&&!(Ai(m)&&m instanceof m&&Ai(f)&&f instanceof f)&&"constructor"in e&&"constructor"in n)return!1}if(t===0)return!1;t<0&&(t=-1),r=r||[],a=a||[];for(var v=r.length;v--;)if(r[v]===e)return a[v]===n;if(r.push(e),a.push(n),c){if(v=e.length,v!==n.length)return!1;for(;v--;)if(!rv(e[v],n[v],t-1,r,a))return!1}else{var y=Object.keys(e),E=y.length;if(Object.keys(n).length!==E)return!1;for(var w=0;w<E;w++){var S=y[w];if(!($o(n,S)&&rv(e[S],n[S],t-1,r,a)))return!1}}return r.pop(),a.pop(),!0}function Qm(e){return Qn(e)?e.slice():yc(e)||Rn(e)||Vo(e)||an(e)?Array.from(e.entries()):e}var Jm,U8=((Jm=Pp().Iterator)==null?void 0:Jm.prototype)||{};function Pv(e){return e[Symbol.iterator]=q8,Object.assign(Object.create(U8),e)}function q8(){return this}["Symbol","Map","Set"].forEach(function(e){var n=Pp();typeof n[e]>"u"&&Lt("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Bw,extras:{getDebugName:bp},$mobx:bt});const H8=Object.freeze(Object.defineProperty({__proto__:null,$mobx:bt,FlowCancellationError:Lp,ObservableMap:Dp,ObservableSet:Ev,Reaction:Oa,_allowStateChanges:fv,_allowStateChangesInsideComputed:uc,_allowStateReadsEnd:ac,_allowStateReadsStart:Mp,_autoAction:sc,_endAction:Tw,_getAdministration:Pa,_getGlobalState:Nw,_interceptReads:mv,_isComputingDerivation:z6,_resetGlobalState:H6,_startAction:Aw,action:Xr,autorun:pv,comparer:Us,computed:Vs,configure:Kw,createAtom:Ad,defineProperty:wv,entries:n5,extendObservable:vv,flow:Gs,flowResult:p8,get:b8,getAtom:no,getDebugName:bp,getDependencyTree:Xw,getObserverTree:u8,has:i5,intercept:Np,isAction:cc,isBoxedObservable:dv,isComputed:m8,isComputedProp:e5,isFlow:fc,isFlowCancellationError:d8,isObservable:Ip,isObservableArray:Qn,isObservableMap:Rn,isObservableObject:yn,isObservableProp:r5,isObservableSet:an,keys:Td,makeAutoObservable:C8,makeObservable:_v,observable:ur,observe:jp,onBecomeObserved:Ww,onBecomeUnobserved:gv,onReactionError:K6,override:J_,ownKeys:a5,reaction:$w,remove:y8,runInAction:uc,set:bv,spy:Bw,toJS:S8,trace:E8,transaction:Ja,untracked:hv,values:yv,when:tv},Symbol.toStringTag,{value:"Module"}));if(!Sr.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!_v)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var G8=uw();function V8(e){e()}function d5(e){e||(e=V8),Kw({reactionScheduler:e})}var $8=function(){return!0};function W8(e){return Xw(e)}var h5=!1;function p5(e){h5=e}function Cv(){return h5}var Y8=1e4,K8=1e4,X8=function(){function e(n){var t=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(r){r===void 0&&(r=Y8),clearTimeout(t.sweepTimeout),t.sweepTimeout=void 0;var a=Date.now();t.registrations.forEach(function(o,s){a-o.registeredAt>=r&&(t.finalize(o.value),t.registrations.delete(s))}),t.registrations.size>0&&t.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){t.sweep(0)}})}return Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t,r){this.registrations.set(r,{value:t,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.registrations.delete(n)}}),Object.defineProperty(e.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,K8))}}),e}(),Z8=typeof FinalizationRegistry<"u"?FinalizationRegistry:X8,wp=new Z8(function(e){var n;(n=e.reaction)===null||n===void 0||n.dispose(),e.reaction=null}),jg={exports:{}},Dg={};/**
|
|
32
|
+
`+K.stack}return{value:i,source:l,stack:H,digest:null}}function $u(i,l,C){return{value:i,source:null,stack:C??null,digest:l??null}}function Ml(i,l){try{console.error(l.value)}catch(C){setTimeout(function(){throw C})}}var ag=typeof WeakMap=="function"?WeakMap:Map;function Mh(i,l,C){C=Hi(-1,C),C.tag=3,C.payload={element:null};var D=l.value;return C.callback=function(){Dh||(Dh=!0,gg=D),Ml(i,l)},C}function u(i,l,C){C=Hi(-1,C),C.tag=3;var D=i.type.getDerivedStateFromError;if(typeof D=="function"){var H=l.value;C.payload=function(){return D(H)},C.callback=function(){Ml(i,l)}}var K=i.stateNode;return K!==null&&typeof K.componentDidCatch=="function"&&(C.callback=function(){Ml(i,l),typeof D!="function"&&(Nl===null?Nl=new Set([this]):Nl.add(this));var ie=l.stack;this.componentDidCatch(l.value,{componentStack:ie!==null?ie:""})}),C}function p(i,l,C){var D=i.pingCache;if(D===null){D=i.pingCache=new ag;var H=new Set;D.set(l,H)}else H=D.get(l),H===void 0&&(H=new Set,D.set(l,H));H.has(C)||(H.add(C),i=b_.bind(null,i,l,C),l.then(i,i))}function j(i){do{var l;if((l=i.tag===13)&&(l=i.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return i;i=i.return}while(i!==null);return null}function B(i,l,C,D,H){return(i.mode&1)===0?(i===l?i.flags|=65536:(i.flags|=128,C.flags|=131072,C.flags&=-52805,C.tag===1&&(C.alternate===null?C.tag=17:(l=Hi(-1,1),l.tag=2,Gi(C,l,1))),C.lanes|=1),i):(i.flags|=65536,i.lanes=H,i)}var $=d.ReactCurrentOwner,J=!1;function le(i,l,C,D){l.child=i===null?oi(l,null,C,D):Mo(l,i.child,C,D)}function Ee(i,l,C,D,H){C=C.render;var K=l.ref;return la(l,H),D=Ol(i,l,C,D,K,H),C=Pl(),i!==null&&!J?(l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~H,gn(i,l,H)):(Zt&&C&&ml(l),l.flags|=1,le(i,l,D,H),l.child)}function Ie(i,l,C,D,H){if(i===null){var K=C.type;return typeof K=="function"&&!Sg(K)&&K.defaultProps===void 0&&C.compare===null&&C.defaultProps===void 0?(l.tag=15,l.type=K,Xe(i,l,K,D,H)):(i=Hh(C.type,null,D,l,l.mode,H),i.ref=l.ref,i.return=l,l.child=i)}if(K=i.child,(i.lanes&H)===0){var ie=K.memoizedProps;if(C=C.compare,C=C!==null?C:mo,C(ie,D)&&i.ref===l.ref)return gn(i,l,H)}return l.flags|=1,i=Fl(K,D),i.ref=l.ref,i.return=l,l.child=i}function Xe(i,l,C,D,H){if(i!==null){var K=i.memoizedProps;if(mo(K,D)&&i.ref===l.ref)if(J=!1,l.pendingProps=D=K,(i.lanes&H)!==0)(i.flags&131072)!==0&&(J=!0);else return l.lanes=i.lanes,gn(i,l,H)}return nt(i,l,C,D,H)}function st(i,l,C){var D=l.pendingProps,H=D.children,K=i!==null?i.memoizedState:null;if(D.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},rr(Yu,xi),xi|=C;else{if((C&1073741824)===0)return i=K!==null?K.baseLanes|C:C,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:i,cachePool:null,transitions:null},l.updateQueue=null,rr(Yu,xi),xi|=i,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},D=K!==null?K.baseLanes:C,rr(Yu,xi),xi|=D}else K!==null?(D=K.baseLanes|C,l.memoizedState=null):D=C,rr(Yu,xi),xi|=D;return le(i,l,H,C),l.child}function Tt(i,l){var C=l.ref;(i===null&&C!==null||i!==null&&i.ref!==C)&&(l.flags|=512,l.flags|=2097152)}function nt(i,l,C,D,H){var K=fn(C)?Ua:tn.current;return K=Po(l,K),la(l,H),C=Ol(i,l,C,D,K,H),D=Pl(),i!==null&&!J?(l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~H,gn(i,l,H)):(Zt&&D&&ml(l),l.flags|=1,le(i,l,C,H),l.child)}function sr(i,l,C,D,H){if(fn(C)){var K=!0;Co(l)}else K=!1;if(la(l,H),l.stateNode===null)Ut(i,l),Rh(l,C,D),Vu(l,C,D,H),D=!0;else if(i===null){var ie=l.stateNode,ce=l.memoizedProps;ie.props=ce;var ge=ie.context,Ne=C.contextType;typeof Ne=="object"&&Ne!==null?Ne=On(Ne):(Ne=fn(C)?Ua:tn.current,Ne=Po(l,Ne));var Ve=C.getDerivedStateFromProps,We=typeof Ve=="function"||typeof ie.getSnapshotBeforeUpdate=="function";We||typeof ie.UNSAFE_componentWillReceiveProps!="function"&&typeof ie.componentWillReceiveProps!="function"||(ce!==D||ge!==Ne)&&ff(l,ie,D,Ne),qi=!1;var Ge=l.memoizedState;ie.state=Ge,_l(l,D,ie,H),ge=l.memoizedState,ce!==D||Ge!==ge||cn.current||qi?(typeof Ve=="function"&&(Tl(l,C,Ve,D),ge=l.memoizedState),(ce=qi||Gu(l,C,ce,D,Ge,ge,Ne))?(We||typeof ie.UNSAFE_componentWillMount!="function"&&typeof ie.componentWillMount!="function"||(typeof ie.componentWillMount=="function"&&ie.componentWillMount(),typeof ie.UNSAFE_componentWillMount=="function"&&ie.UNSAFE_componentWillMount()),typeof ie.componentDidMount=="function"&&(l.flags|=4194308)):(typeof ie.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=D,l.memoizedState=ge),ie.props=D,ie.state=ge,ie.context=Ne,D=ce):(typeof ie.componentDidMount=="function"&&(l.flags|=4194308),D=!1)}else{ie=l.stateNode,ju(i,l),ce=l.memoizedProps,Ne=l.type===l.elementType?ce:rn(l.type,ce),ie.props=Ne,We=l.pendingProps,Ge=ie.context,ge=C.contextType,typeof ge=="object"&&ge!==null?ge=On(ge):(ge=fn(C)?Ua:tn.current,ge=Po(l,ge));var ot=C.getDerivedStateFromProps;(Ve=typeof ot=="function"||typeof ie.getSnapshotBeforeUpdate=="function")||typeof ie.UNSAFE_componentWillReceiveProps!="function"&&typeof ie.componentWillReceiveProps!="function"||(ce!==We||Ge!==ge)&&ff(l,ie,D,ge),qi=!1,Ge=l.memoizedState,ie.state=Ge,_l(l,D,ie,H);var ft=l.memoizedState;ce!==We||Ge!==ft||cn.current||qi?(typeof ot=="function"&&(Tl(l,C,ot,D),ft=l.memoizedState),(Ne=qi||Gu(l,C,Ne,D,Ge,ft,ge)||!1)?(Ve||typeof ie.UNSAFE_componentWillUpdate!="function"&&typeof ie.componentWillUpdate!="function"||(typeof ie.componentWillUpdate=="function"&&ie.componentWillUpdate(D,ft,ge),typeof ie.UNSAFE_componentWillUpdate=="function"&&ie.UNSAFE_componentWillUpdate(D,ft,ge)),typeof ie.componentDidUpdate=="function"&&(l.flags|=4),typeof ie.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof ie.componentDidUpdate!="function"||ce===i.memoizedProps&&Ge===i.memoizedState||(l.flags|=4),typeof ie.getSnapshotBeforeUpdate!="function"||ce===i.memoizedProps&&Ge===i.memoizedState||(l.flags|=1024),l.memoizedProps=D,l.memoizedState=ft),ie.props=D,ie.state=ft,ie.context=ge,D=Ne):(typeof ie.componentDidUpdate!="function"||ce===i.memoizedProps&&Ge===i.memoizedState||(l.flags|=4),typeof ie.getSnapshotBeforeUpdate!="function"||ce===i.memoizedProps&&Ge===i.memoizedState||(l.flags|=1024),D=!1)}return Qt(i,l,C,D,K,H)}function Qt(i,l,C,D,H,K){Tt(i,l);var ie=(l.flags&128)!==0;if(!D&&!ie)return H&&wh(l,C,!1),gn(i,l,K);D=l.stateNode,$.current=l;var ce=ie&&typeof C.getDerivedStateFromError!="function"?null:D.render();return l.flags|=1,i!==null&&ie?(l.child=Mo(l,i.child,null,K),l.child=Mo(l,null,ce,K)):le(i,l,ce,K),l.memoizedState=D.state,H&&wh(l,C,!0),l.child}function Cn(i){var l=i.stateNode;l.pendingContext?Qc(i,l.pendingContext,l.pendingContext!==l.context):l.context&&Qc(i,l.context,!1),$a(i,l.containerInfo)}function Vi(i,l,C,D,H){return Ro(),Ss(H),l.flags|=256,le(i,l,C,D),l.child}var Le={dehydrated:null,treeContext:null,retryLane:0};function Ce(i){return{baseLanes:i,cachePool:null,transitions:null}}function De(i,l,C){var D=l.pendingProps,H=lr.current,K=!1,ie=(l.flags&128)!==0,ce;if((ce=ie)||(ce=i!==null&&i.memoizedState===null?!1:(H&2)!==0),ce?(K=!0,l.flags&=-129):(i===null||i.memoizedState!==null)&&(H|=1),rr(lr,H&1),i===null)return yl(l),i=l.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((l.mode&1)===0?l.lanes=1:i.data==="$!"?l.lanes=8:l.lanes=1073741824,null):(ie=D.children,i=D.fallback,K?(D=l.mode,K=l.child,ie={mode:"hidden",children:ie},(D&1)===0&&K!==null?(K.childLanes=0,K.pendingProps=ie):K=Gh(ie,D,0,null),i=Ls(i,D,C,null),K.return=l,i.return=l,K.sibling=i,l.child=K,l.child.memoizedState=Ce(C),l.memoizedState=Le,i):it(l,ie));if(H=i.memoizedState,H!==null&&(ce=H.dehydrated,ce!==null))return It(i,l,ie,D,ce,H,C);if(K){K=D.fallback,ie=l.mode,H=i.child,ce=H.sibling;var ge={mode:"hidden",children:D.children};return(ie&1)===0&&l.child!==H?(D=l.child,D.childLanes=0,D.pendingProps=ge,l.deletions=null):(D=Fl(H,ge),D.subtreeFlags=H.subtreeFlags&14680064),ce!==null?K=Fl(ce,K):(K=Ls(K,ie,C,null),K.flags|=2),K.return=l,D.return=l,D.sibling=K,l.child=D,D=K,K=l.child,ie=i.child.memoizedState,ie=ie===null?Ce(C):{baseLanes:ie.baseLanes|C,cachePool:null,transitions:ie.transitions},K.memoizedState=ie,K.childLanes=i.childLanes&~C,l.memoizedState=Le,D}return K=i.child,i=K.sibling,D=Fl(K,{mode:"visible",children:D.children}),(l.mode&1)===0&&(D.lanes=C),D.return=l,D.sibling=null,i!==null&&(C=l.deletions,C===null?(l.deletions=[i],l.flags|=16):C.push(i)),l.child=D,l.memoizedState=null,D}function it(i,l){return l=Gh({mode:"visible",children:l},i.mode,0,null),l.return=i,i.child=l}function _t(i,l,C,D){return D!==null&&Ss(D),Mo(l,i.child,null,C),i=it(l,l.pendingProps.children),i.flags|=2,l.memoizedState=null,i}function It(i,l,C,D,H,K,ie){if(C)return l.flags&256?(l.flags&=-257,D=$u(Error(t(422))),_t(i,l,ie,D)):l.memoizedState!==null?(l.child=i.child,l.flags|=128,null):(K=D.fallback,H=l.mode,D=Gh({mode:"visible",children:D.children},H,0,null),K=Ls(K,H,ie,null),K.flags|=2,D.return=l,K.return=l,D.sibling=K,l.child=D,(l.mode&1)!==0&&Mo(l,i.child,null,ie),l.child.memoizedState=Ce(ie),l.memoizedState=Le,K);if((l.mode&1)===0)return _t(i,l,ie,null);if(H.data==="$!"){if(D=H.nextSibling&&H.nextSibling.dataset,D)var ce=D.dgst;return D=ce,K=Error(t(419)),D=$u(K,D,void 0),_t(i,l,ie,D)}if(ce=(ie&i.childLanes)!==0,J||ce){if(D=vn,D!==null){switch(ie&-ie){case 4:H=2;break;case 16:H=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:H=32;break;case 536870912:H=268435456;break;default:H=0}H=(H&(D.suspendedLanes|ie))!==0?0:H,H!==0&&H!==K.retryLane&&(K.retryLane=H,Kn(i,H),ha(D,i,H,-1))}return _g(),D=$u(Error(t(421))),_t(i,l,ie,D)}return H.data==="$?"?(l.flags|=128,l.child=i.child,l=w_.bind(null,i),H._reactRetry=l,null):(i=K.treeContext,tt=Di(H.nextSibling),$n=l,Zt=!0,Wn=null,i!==null&&(En[xn++]=Vn,En[xn++]=vr,En[xn++]=Va,Vn=i.id,vr=i.overflow,Va=l),l=it(l,D.children),l.flags|=4096,l)}function Rt(i,l,C){i.lanes|=l;var D=i.alternate;D!==null&&(D.lanes|=l),Iu(i.return,l,C)}function Ht(i,l,C,D,H){var K=i.memoizedState;K===null?i.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:D,tail:C,tailMode:H}:(K.isBackwards=l,K.rendering=null,K.renderingStartTime=0,K.last=D,K.tail=C,K.tailMode=H)}function Br(i,l,C){var D=l.pendingProps,H=D.revealOrder,K=D.tail;if(le(i,l,D.children,C),D=lr.current,(D&2)!==0)D=D&1|2,l.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=l.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Rt(i,C,l);else if(i.tag===19)Rt(i,C,l);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break e;for(;i.sibling===null;){if(i.return===null||i.return===l)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}D&=1}if(rr(lr,D),(l.mode&1)===0)l.memoizedState=null;else switch(H){case"forwards":for(C=l.child,H=null;C!==null;)i=C.alternate,i!==null&&El(i)===null&&(H=C),C=C.sibling;C=H,C===null?(H=l.child,l.child=null):(H=C.sibling,C.sibling=null),Ht(l,!1,H,C,K);break;case"backwards":for(C=null,H=l.child,l.child=null;H!==null;){if(i=H.alternate,i!==null&&El(i)===null){l.child=H;break}i=H.sibling,H.sibling=C,C=H,H=i}Ht(l,!0,C,null,K);break;case"together":Ht(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Ut(i,l){(l.mode&1)===0&&i!==null&&(i.alternate=null,l.alternate=null,l.flags|=2)}function gn(i,l,C){if(i!==null&&(l.dependencies=i.dependencies),As|=l.lanes,(C&l.childLanes)===0)return null;if(i!==null&&l.child!==i.child)throw Error(t(153));if(l.child!==null){for(i=l.child,C=Fl(i,i.pendingProps),l.child=C,C.return=l;i.sibling!==null;)i=i.sibling,C=C.sibling=Fl(i,i.pendingProps),C.return=l;C.sibling=null}return l.child}function og(i,l,C){switch(l.tag){case 3:Cn(l),Ro();break;case 5:Sl(l);break;case 1:fn(l.type)&&Co(l);break;case 4:$a(l,l.stateNode.containerInfo);break;case 10:var D=l.type._context,H=l.memoizedProps.value;rr(Es,D._currentValue),D._currentValue=H;break;case 13:if(D=l.memoizedState,D!==null)return D.dehydrated!==null?(rr(lr,lr.current&1),l.flags|=128,null):(C&l.child.childLanes)!==0?De(i,l,C):(rr(lr,lr.current&1),i=gn(i,l,C),i!==null?i.sibling:null);rr(lr,lr.current&1);break;case 19:if(D=(C&l.childLanes)!==0,(i.flags&128)!==0){if(D)return Br(i,l,C);l.flags|=128}if(H=l.memoizedState,H!==null&&(H.rendering=null,H.tail=null,H.lastEffect=null),rr(lr,lr.current),D)break;return null;case 22:case 23:return l.lanes=0,st(i,l,C)}return gn(i,l,C)}var nm,lg,im,am;nm=function(i,l){for(var C=l.child;C!==null;){if(C.tag===5||C.tag===6)i.appendChild(C.stateNode);else if(C.tag!==4&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===l)break;for(;C.sibling===null;){if(C.return===null||C.return===l)return;C=C.return}C.sibling.return=C.return,C=C.sibling}},lg=function(){},im=function(i,l,C,D){var H=i.memoizedProps;if(H!==D){i=l.stateNode,Fr(nr.current);var K=null;switch(C){case"input":H=ye(i,H),D=ye(i,D),K=[];break;case"select":H=q({},H,{value:void 0}),D=q({},D,{value:void 0}),K=[];break;case"textarea":H=oe(i,H),D=oe(i,D),K=[];break;default:typeof H.onClick!="function"&&typeof D.onClick=="function"&&(i.onclick=Eo)}Oe(C,D);var ie;C=null;for(Ne in H)if(!D.hasOwnProperty(Ne)&&H.hasOwnProperty(Ne)&&H[Ne]!=null)if(Ne==="style"){var ce=H[Ne];for(ie in ce)ce.hasOwnProperty(ie)&&(C||(C={}),C[ie]="")}else Ne!=="dangerouslySetInnerHTML"&&Ne!=="children"&&Ne!=="suppressContentEditableWarning"&&Ne!=="suppressHydrationWarning"&&Ne!=="autoFocus"&&(a.hasOwnProperty(Ne)?K||(K=[]):(K=K||[]).push(Ne,null));for(Ne in D){var ge=D[Ne];if(ce=H!=null?H[Ne]:void 0,D.hasOwnProperty(Ne)&&ge!==ce&&(ge!=null||ce!=null))if(Ne==="style")if(ce){for(ie in ce)!ce.hasOwnProperty(ie)||ge&&ge.hasOwnProperty(ie)||(C||(C={}),C[ie]="");for(ie in ge)ge.hasOwnProperty(ie)&&ce[ie]!==ge[ie]&&(C||(C={}),C[ie]=ge[ie])}else C||(K||(K=[]),K.push(Ne,C)),C=ge;else Ne==="dangerouslySetInnerHTML"?(ge=ge?ge.__html:void 0,ce=ce?ce.__html:void 0,ge!=null&&ce!==ge&&(K=K||[]).push(Ne,ge)):Ne==="children"?typeof ge!="string"&&typeof ge!="number"||(K=K||[]).push(Ne,""+ge):Ne!=="suppressContentEditableWarning"&&Ne!=="suppressHydrationWarning"&&(a.hasOwnProperty(Ne)?(ge!=null&&Ne==="onScroll"&&ar("scroll",i),K||ce===ge||(K=[])):(K=K||[]).push(Ne,ge))}C&&(K=K||[]).push("style",C);var Ne=K;(l.updateQueue=Ne)&&(l.flags|=4)}},am=function(i,l,C,D){C!==D&&(l.flags|=4)};function df(i,l){if(!Zt)switch(i.tailMode){case"hidden":l=i.tail;for(var C=null;l!==null;)l.alternate!==null&&(C=l),l=l.sibling;C===null?i.tail=null:C.sibling=null;break;case"collapsed":C=i.tail;for(var D=null;C!==null;)C.alternate!==null&&(D=C),C=C.sibling;D===null?l||i.tail===null?i.tail=null:i.tail.sibling=null:D.sibling=null}}function Dn(i){var l=i.alternate!==null&&i.alternate.child===i.child,C=0,D=0;if(l)for(var H=i.child;H!==null;)C|=H.lanes|H.childLanes,D|=H.subtreeFlags&14680064,D|=H.flags&14680064,H.return=i,H=H.sibling;else for(H=i.child;H!==null;)C|=H.lanes|H.childLanes,D|=H.subtreeFlags,D|=H.flags,H.return=i,H=H.sibling;return i.subtreeFlags|=D,i.childLanes=C,l}function u_(i,l,C){var D=l.pendingProps;switch(Yr(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Dn(l),null;case 1:return fn(l.type)&&gl(),Dn(l),null;case 3:return D=l.stateNode,yr(),or(cn),or(tn),dn(),D.pendingContext&&(D.context=D.pendingContext,D.pendingContext=null),(i===null||i.child===null)&&(_s(l)?l.flags|=4:i===null||i.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Wn!==null&&(yg(Wn),Wn=null))),lg(i,l),Dn(l),null;case 5:sa(l);var H=Fr(kr.current);if(C=l.type,i!==null&&l.stateNode!=null)im(i,l,C,D,H),i.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!D){if(l.stateNode===null)throw Error(t(166));return Dn(l),null}if(i=Fr(nr.current),_s(l)){D=l.stateNode,C=l.type;var K=l.memoizedProps;switch(D[ai]=l,D[ys]=K,i=(l.mode&1)!==0,C){case"dialog":ar("cancel",D),ar("close",D);break;case"iframe":case"object":case"embed":ar("load",D);break;case"video":case"audio":for(H=0;H<Fa.length;H++)ar(Fa[H],D);break;case"source":ar("error",D);break;case"img":case"image":case"link":ar("error",D),ar("load",D);break;case"details":ar("toggle",D);break;case"input":we(D,K),ar("invalid",D);break;case"select":D._wrapperState={wasMultiple:!!K.multiple},ar("invalid",D);break;case"textarea":ve(D,K),ar("invalid",D)}Oe(C,K),H=null;for(var ie in K)if(K.hasOwnProperty(ie)){var ce=K[ie];ie==="children"?typeof ce=="string"?D.textContent!==ce&&(K.suppressHydrationWarning!==!0&&vs(D.textContent,ce,i),H=["children",ce]):typeof ce=="number"&&D.textContent!==""+ce&&(K.suppressHydrationWarning!==!0&&vs(D.textContent,ce,i),H=["children",""+ce]):a.hasOwnProperty(ie)&&ce!=null&&ie==="onScroll"&&ar("scroll",D)}switch(C){case"input":ue(D),se(D,K,!0);break;case"textarea":ue(D),ke(D);break;case"select":case"option":break;default:typeof K.onClick=="function"&&(D.onclick=Eo)}D=H,l.updateQueue=D,D!==null&&(l.flags|=4)}else{ie=H.nodeType===9?H:H.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=Be(C)),i==="http://www.w3.org/1999/xhtml"?C==="script"?(i=ie.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof D.is=="string"?i=ie.createElement(C,{is:D.is}):(i=ie.createElement(C),C==="select"&&(ie=i,D.multiple?ie.multiple=!0:D.size&&(ie.size=D.size))):i=ie.createElementNS(i,C),i[ai]=l,i[ys]=D,nm(i,l,!1,!1),l.stateNode=i;e:{switch(ie=Se(C,D),C){case"dialog":ar("cancel",i),ar("close",i),H=D;break;case"iframe":case"object":case"embed":ar("load",i),H=D;break;case"video":case"audio":for(H=0;H<Fa.length;H++)ar(Fa[H],i);H=D;break;case"source":ar("error",i),H=D;break;case"img":case"image":case"link":ar("error",i),ar("load",i),H=D;break;case"details":ar("toggle",i),H=D;break;case"input":we(i,D),H=ye(i,D),ar("invalid",i);break;case"option":H=D;break;case"select":i._wrapperState={wasMultiple:!!D.multiple},H=q({},D,{value:void 0}),ar("invalid",i);break;case"textarea":ve(i,D),H=oe(i,D),ar("invalid",i);break;default:H=D}Oe(C,H),ce=H;for(K in ce)if(ce.hasOwnProperty(K)){var ge=ce[K];K==="style"?kt(i,ge):K==="dangerouslySetInnerHTML"?(ge=ge?ge.__html:void 0,ge!=null&&St(i,ge)):K==="children"?typeof ge=="string"?(C!=="textarea"||ge!=="")&&Ue(i,ge):typeof ge=="number"&&Ue(i,""+ge):K!=="suppressContentEditableWarning"&&K!=="suppressHydrationWarning"&&K!=="autoFocus"&&(a.hasOwnProperty(K)?ge!=null&&K==="onScroll"&&ar("scroll",i):ge!=null&&h(i,K,ge,ie))}switch(C){case"input":ue(i),se(i,D,!1);break;case"textarea":ue(i),ke(i);break;case"option":D.value!=null&&i.setAttribute("value",""+re(D.value));break;case"select":i.multiple=!!D.multiple,K=D.value,K!=null?xe(i,!!D.multiple,K,!1):D.defaultValue!=null&&xe(i,!!D.multiple,D.defaultValue,!0);break;default:typeof H.onClick=="function"&&(i.onclick=Eo)}switch(C){case"button":case"input":case"select":case"textarea":D=!!D.autoFocus;break e;case"img":D=!0;break e;default:D=!1}}D&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return Dn(l),null;case 6:if(i&&l.stateNode!=null)am(i,l,i.memoizedProps,D);else{if(typeof D!="string"&&l.stateNode===null)throw Error(t(166));if(C=Fr(kr.current),Fr(nr.current),_s(l)){if(D=l.stateNode,C=l.memoizedProps,D[ai]=l,(K=D.nodeValue!==C)&&(i=$n,i!==null))switch(i.tag){case 3:vs(D.nodeValue,C,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&vs(D.nodeValue,C,(i.mode&1)!==0)}K&&(l.flags|=4)}else D=(C.nodeType===9?C:C.ownerDocument).createTextNode(D),D[ai]=l,l.stateNode=D}return Dn(l),null;case 13:if(or(lr),D=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(Zt&&tt!==null&&(l.mode&1)!==0&&(l.flags&128)===0)ef(),Ro(),l.flags|=98560,K=!1;else if(K=_s(l),D!==null&&D.dehydrated!==null){if(i===null){if(!K)throw Error(t(318));if(K=l.memoizedState,K=K!==null?K.dehydrated:null,!K)throw Error(t(317));K[ai]=l}else Ro(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Dn(l),K=!1}else Wn!==null&&(yg(Wn),Wn=null),K=!0;if(!K)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=C,l):(D=D!==null,D!==(i!==null&&i.memoizedState!==null)&&D&&(l.child.flags|=8192,(l.mode&1)!==0&&(i===null||(lr.current&1)!==0?nn===0&&(nn=3):_g())),l.updateQueue!==null&&(l.flags|=4),Dn(l),null);case 4:return yr(),lg(i,l),i===null&&_o(l.stateNode.containerInfo),Dn(l),null;case 10:return Nu(l.type._context),Dn(l),null;case 17:return fn(l.type)&&gl(),Dn(l),null;case 19:if(or(lr),K=l.memoizedState,K===null)return Dn(l),null;if(D=(l.flags&128)!==0,ie=K.rendering,ie===null)if(D)df(K,!1);else{if(nn!==0||i!==null&&(i.flags&128)!==0)for(i=l.child;i!==null;){if(ie=El(i),ie!==null){for(l.flags|=128,df(K,!1),D=ie.updateQueue,D!==null&&(l.updateQueue=D,l.flags|=4),l.subtreeFlags=0,D=C,C=l.child;C!==null;)K=C,i=D,K.flags&=14680066,ie=K.alternate,ie===null?(K.childLanes=0,K.lanes=i,K.child=null,K.subtreeFlags=0,K.memoizedProps=null,K.memoizedState=null,K.updateQueue=null,K.dependencies=null,K.stateNode=null):(K.childLanes=ie.childLanes,K.lanes=ie.lanes,K.child=ie.child,K.subtreeFlags=0,K.deletions=null,K.memoizedProps=ie.memoizedProps,K.memoizedState=ie.memoizedState,K.updateQueue=ie.updateQueue,K.type=ie.type,i=ie.dependencies,K.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),C=C.sibling;return rr(lr,lr.current&1|2),l.child}i=i.sibling}K.tail!==null&&Pr()>Ku&&(l.flags|=128,D=!0,df(K,!1),l.lanes=4194304)}else{if(!D)if(i=El(ie),i!==null){if(l.flags|=128,D=!0,C=i.updateQueue,C!==null&&(l.updateQueue=C,l.flags|=4),df(K,!0),K.tail===null&&K.tailMode==="hidden"&&!ie.alternate&&!Zt)return Dn(l),null}else 2*Pr()-K.renderingStartTime>Ku&&C!==1073741824&&(l.flags|=128,D=!0,df(K,!1),l.lanes=4194304);K.isBackwards?(ie.sibling=l.child,l.child=ie):(C=K.last,C!==null?C.sibling=ie:l.child=ie,K.last=ie)}return K.tail!==null?(l=K.tail,K.rendering=l,K.tail=l.sibling,K.renderingStartTime=Pr(),l.sibling=null,C=lr.current,rr(lr,D?C&1|2:C&1),l):(Dn(l),null);case 22:case 23:return wg(),D=l.memoizedState!==null,i!==null&&i.memoizedState!==null!==D&&(l.flags|=8192),D&&(l.mode&1)!==0?(xi&1073741824)!==0&&(Dn(l),l.subtreeFlags&6&&(l.flags|=8192)):Dn(l),null;case 24:return null;case 25:return null}throw Error(t(156,l.tag))}function c_(i,l){switch(Yr(l),l.tag){case 1:return fn(l.type)&&gl(),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return yr(),or(cn),or(tn),dn(),i=l.flags,(i&65536)!==0&&(i&128)===0?(l.flags=i&-65537|128,l):null;case 5:return sa(l),null;case 13:if(or(lr),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(t(340));Ro()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return or(lr),null;case 4:return yr(),null;case 10:return Nu(l.type._context),null;case 22:case 23:return wg(),null;case 24:return null;default:return null}}var Lh=!1,Fn=!1,f_=typeof WeakSet=="function"?WeakSet:Set,ct=null;function Wu(i,l){var C=i.ref;if(C!==null)if(typeof C=="function")try{C(null)}catch(D){Mr(i,l,D)}else C.current=null}function sg(i,l,C){try{C()}catch(D){Mr(i,l,D)}}var om=!1;function d_(i,l){if(Yc=ou,i=jr(),fl(i)){if("selectionStart"in i)var C={start:i.selectionStart,end:i.selectionEnd};else e:{C=(C=i.ownerDocument)&&C.defaultView||window;var D=C.getSelection&&C.getSelection();if(D&&D.rangeCount!==0){C=D.anchorNode;var H=D.anchorOffset,K=D.focusNode;D=D.focusOffset;try{C.nodeType,K.nodeType}catch{C=null;break e}var ie=0,ce=-1,ge=-1,Ne=0,Ve=0,We=i,Ge=null;t:for(;;){for(var ot;We!==C||H!==0&&We.nodeType!==3||(ce=ie+H),We!==K||D!==0&&We.nodeType!==3||(ge=ie+D),We.nodeType===3&&(ie+=We.nodeValue.length),(ot=We.firstChild)!==null;)Ge=We,We=ot;for(;;){if(We===i)break t;if(Ge===C&&++Ne===H&&(ce=ie),Ge===K&&++Ve===D&&(ge=ie),(ot=We.nextSibling)!==null)break;We=Ge,Ge=We.parentNode}We=ot}C=ce===-1||ge===-1?null:{start:ce,end:ge}}else C=null}C=C||{start:0,end:0}}else C=null;for(Kc={focusedElem:i,selectionRange:C},ou=!1,ct=l;ct!==null;)if(l=ct,i=l.child,(l.subtreeFlags&1028)!==0&&i!==null)i.return=l,ct=i;else for(;ct!==null;){l=ct;try{var ft=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(ft!==null){var pt=ft.memoizedProps,Ur=ft.memoizedState,Ae=l.stateNode,be=Ae.getSnapshotBeforeUpdate(l.elementType===l.type?pt:rn(l.type,pt),Ur);Ae.__reactInternalSnapshotBeforeUpdate=be}break;case 3:var Re=l.stateNode.containerInfo;Re.nodeType===1?Re.textContent="":Re.nodeType===9&&Re.documentElement&&Re.removeChild(Re.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(Ze){Mr(l,l.return,Ze)}if(i=l.sibling,i!==null){i.return=l.return,ct=i;break}ct=l.return}return ft=om,om=!1,ft}function hf(i,l,C){var D=l.updateQueue;if(D=D!==null?D.lastEffect:null,D!==null){var H=D=D.next;do{if((H.tag&i)===i){var K=H.destroy;H.destroy=void 0,K!==void 0&&sg(l,C,K)}H=H.next}while(H!==D)}}function Nh(i,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var C=l=l.next;do{if((C.tag&i)===i){var D=C.create;C.destroy=D()}C=C.next}while(C!==l)}}function ug(i){var l=i.ref;if(l!==null){var C=i.stateNode;switch(i.tag){case 5:i=C;break;default:i=C}typeof l=="function"?l(i):l.current=i}}function lm(i){var l=i.alternate;l!==null&&(i.alternate=null,lm(l)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(l=i.stateNode,l!==null&&(delete l[ai],delete l[ys],delete l[Pu],delete l[yh],delete l[bh])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function sm(i){return i.tag===5||i.tag===3||i.tag===4}function um(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||sm(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function cg(i,l,C){var D=i.tag;if(D===5||D===6)i=i.stateNode,l?C.nodeType===8?C.parentNode.insertBefore(i,l):C.insertBefore(i,l):(C.nodeType===8?(l=C.parentNode,l.insertBefore(i,C)):(l=C,l.appendChild(i)),C=C._reactRootContainer,C!=null||l.onclick!==null||(l.onclick=Eo));else if(D!==4&&(i=i.child,i!==null))for(cg(i,l,C),i=i.sibling;i!==null;)cg(i,l,C),i=i.sibling}function fg(i,l,C){var D=i.tag;if(D===5||D===6)i=i.stateNode,l?C.insertBefore(i,l):C.appendChild(i);else if(D!==4&&(i=i.child,i!==null))for(fg(i,l,C),i=i.sibling;i!==null;)fg(i,l,C),i=i.sibling}var kn=null,fa=!1;function Ll(i,l,C){for(C=C.child;C!==null;)cm(i,l,C),C=C.sibling}function cm(i,l,C){if(Zr&&typeof Zr.onCommitFiberUnmount=="function")try{Zr.onCommitFiberUnmount(Qi,C)}catch{}switch(C.tag){case 5:Fn||Wu(C,l);case 6:var D=kn,H=fa;kn=null,Ll(i,l,C),kn=D,fa=H,kn!==null&&(fa?(i=kn,C=C.stateNode,i.nodeType===8?i.parentNode.removeChild(C):i.removeChild(C)):kn.removeChild(C.stateNode));break;case 18:kn!==null&&(fa?(i=kn,C=C.stateNode,i.nodeType===8?Ou(i.parentNode,C):i.nodeType===1&&Ou(i,C),Ln(i)):Ou(kn,C.stateNode));break;case 4:D=kn,H=fa,kn=C.stateNode.containerInfo,fa=!0,Ll(i,l,C),kn=D,fa=H;break;case 0:case 11:case 14:case 15:if(!Fn&&(D=C.updateQueue,D!==null&&(D=D.lastEffect,D!==null))){H=D=D.next;do{var K=H,ie=K.destroy;K=K.tag,ie!==void 0&&((K&2)!==0||(K&4)!==0)&&sg(C,l,ie),H=H.next}while(H!==D)}Ll(i,l,C);break;case 1:if(!Fn&&(Wu(C,l),D=C.stateNode,typeof D.componentWillUnmount=="function"))try{D.props=C.memoizedProps,D.state=C.memoizedState,D.componentWillUnmount()}catch(ce){Mr(C,l,ce)}Ll(i,l,C);break;case 21:Ll(i,l,C);break;case 22:C.mode&1?(Fn=(D=Fn)||C.memoizedState!==null,Ll(i,l,C),Fn=D):Ll(i,l,C);break;default:Ll(i,l,C)}}function fm(i){var l=i.updateQueue;if(l!==null){i.updateQueue=null;var C=i.stateNode;C===null&&(C=i.stateNode=new f_),l.forEach(function(D){var H=__.bind(null,i,D);C.has(D)||(C.add(D),D.then(H,H))})}}function da(i,l){var C=l.deletions;if(C!==null)for(var D=0;D<C.length;D++){var H=C[D];try{var K=i,ie=l,ce=ie;e:for(;ce!==null;){switch(ce.tag){case 5:kn=ce.stateNode,fa=!1;break e;case 3:kn=ce.stateNode.containerInfo,fa=!0;break e;case 4:kn=ce.stateNode.containerInfo,fa=!0;break e}ce=ce.return}if(kn===null)throw Error(t(160));cm(K,ie,H),kn=null,fa=!1;var ge=H.alternate;ge!==null&&(ge.return=null),H.return=null}catch(Ne){Mr(H,l,Ne)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)dm(l,i),l=l.sibling}function dm(i,l){var C=i.alternate,D=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(da(l,i),Za(i),D&4){try{hf(3,i,i.return),Nh(3,i)}catch(pt){Mr(i,i.return,pt)}try{hf(5,i,i.return)}catch(pt){Mr(i,i.return,pt)}}break;case 1:da(l,i),Za(i),D&512&&C!==null&&Wu(C,C.return);break;case 5:if(da(l,i),Za(i),D&512&&C!==null&&Wu(C,C.return),i.flags&32){var H=i.stateNode;try{Ue(H,"")}catch(pt){Mr(i,i.return,pt)}}if(D&4&&(H=i.stateNode,H!=null)){var K=i.memoizedProps,ie=C!==null?C.memoizedProps:K,ce=i.type,ge=i.updateQueue;if(i.updateQueue=null,ge!==null)try{ce==="input"&&K.type==="radio"&&K.name!=null&&je(H,K),Se(ce,ie);var Ne=Se(ce,K);for(ie=0;ie<ge.length;ie+=2){var Ve=ge[ie],We=ge[ie+1];Ve==="style"?kt(H,We):Ve==="dangerouslySetInnerHTML"?St(H,We):Ve==="children"?Ue(H,We):h(H,Ve,We,Ne)}switch(ce){case"input":Te(H,K);break;case"textarea":de(H,K);break;case"select":var Ge=H._wrapperState.wasMultiple;H._wrapperState.wasMultiple=!!K.multiple;var ot=K.value;ot!=null?xe(H,!!K.multiple,ot,!1):Ge!==!!K.multiple&&(K.defaultValue!=null?xe(H,!!K.multiple,K.defaultValue,!0):xe(H,!!K.multiple,K.multiple?[]:"",!1))}H[ys]=K}catch(pt){Mr(i,i.return,pt)}}break;case 6:if(da(l,i),Za(i),D&4){if(i.stateNode===null)throw Error(t(162));H=i.stateNode,K=i.memoizedProps;try{H.nodeValue=K}catch(pt){Mr(i,i.return,pt)}}break;case 3:if(da(l,i),Za(i),D&4&&C!==null&&C.memoizedState.isDehydrated)try{Ln(l.containerInfo)}catch(pt){Mr(i,i.return,pt)}break;case 4:da(l,i),Za(i);break;case 13:da(l,i),Za(i),H=i.child,H.flags&8192&&(K=H.memoizedState!==null,H.stateNode.isHidden=K,!K||H.alternate!==null&&H.alternate.memoizedState!==null||(pg=Pr())),D&4&&fm(i);break;case 22:if(Ve=C!==null&&C.memoizedState!==null,i.mode&1?(Fn=(Ne=Fn)||Ve,da(l,i),Fn=Ne):da(l,i),Za(i),D&8192){if(Ne=i.memoizedState!==null,(i.stateNode.isHidden=Ne)&&!Ve&&(i.mode&1)!==0)for(ct=i,Ve=i.child;Ve!==null;){for(We=ct=Ve;ct!==null;){switch(Ge=ct,ot=Ge.child,Ge.tag){case 0:case 11:case 14:case 15:hf(4,Ge,Ge.return);break;case 1:Wu(Ge,Ge.return);var ft=Ge.stateNode;if(typeof ft.componentWillUnmount=="function"){D=Ge,C=Ge.return;try{l=D,ft.props=l.memoizedProps,ft.state=l.memoizedState,ft.componentWillUnmount()}catch(pt){Mr(D,C,pt)}}break;case 5:Wu(Ge,Ge.return);break;case 22:if(Ge.memoizedState!==null){gm(We);continue}}ot!==null?(ot.return=Ge,ct=ot):gm(We)}Ve=Ve.sibling}e:for(Ve=null,We=i;;){if(We.tag===5){if(Ve===null){Ve=We;try{H=We.stateNode,Ne?(K=H.style,typeof K.setProperty=="function"?K.setProperty("display","none","important"):K.display="none"):(ce=We.stateNode,ge=We.memoizedProps.style,ie=ge!=null&&ge.hasOwnProperty("display")?ge.display:null,ce.style.display=mt("display",ie))}catch(pt){Mr(i,i.return,pt)}}}else if(We.tag===6){if(Ve===null)try{We.stateNode.nodeValue=Ne?"":We.memoizedProps}catch(pt){Mr(i,i.return,pt)}}else if((We.tag!==22&&We.tag!==23||We.memoizedState===null||We===i)&&We.child!==null){We.child.return=We,We=We.child;continue}if(We===i)break e;for(;We.sibling===null;){if(We.return===null||We.return===i)break e;Ve===We&&(Ve=null),We=We.return}Ve===We&&(Ve=null),We.sibling.return=We.return,We=We.sibling}}break;case 19:da(l,i),Za(i),D&4&&fm(i);break;case 21:break;default:da(l,i),Za(i)}}function Za(i){var l=i.flags;if(l&2){try{e:{for(var C=i.return;C!==null;){if(sm(C)){var D=C;break e}C=C.return}throw Error(t(160))}switch(D.tag){case 5:var H=D.stateNode;D.flags&32&&(Ue(H,""),D.flags&=-33);var K=um(i);fg(i,K,H);break;case 3:case 4:var ie=D.stateNode.containerInfo,ce=um(i);cg(i,ce,ie);break;default:throw Error(t(161))}}catch(ge){Mr(i,i.return,ge)}i.flags&=-3}l&4096&&(i.flags&=-4097)}function h_(i,l,C){ct=i,hm(i)}function hm(i,l,C){for(var D=(i.mode&1)!==0;ct!==null;){var H=ct,K=H.child;if(H.tag===22&&D){var ie=H.memoizedState!==null||Lh;if(!ie){var ce=H.alternate,ge=ce!==null&&ce.memoizedState!==null||Fn;ce=Lh;var Ne=Fn;if(Lh=ie,(Fn=ge)&&!Ne)for(ct=H;ct!==null;)ie=ct,ge=ie.child,ie.tag===22&&ie.memoizedState!==null?vm(H):ge!==null?(ge.return=ie,ct=ge):vm(H);for(;K!==null;)ct=K,hm(K),K=K.sibling;ct=H,Lh=ce,Fn=Ne}pm(i)}else(H.subtreeFlags&8772)!==0&&K!==null?(K.return=H,ct=K):pm(i)}}function pm(i){for(;ct!==null;){var l=ct;if((l.flags&8772)!==0){var C=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:Fn||Nh(5,l);break;case 1:var D=l.stateNode;if(l.flags&4&&!Fn)if(C===null)D.componentDidMount();else{var H=l.elementType===l.type?C.memoizedProps:rn(l.type,C.memoizedProps);D.componentDidUpdate(H,C.memoizedState,D.__reactInternalSnapshotBeforeUpdate)}var K=l.updateQueue;K!==null&&Er(l,K,D);break;case 3:var ie=l.updateQueue;if(ie!==null){if(C=null,l.child!==null)switch(l.child.tag){case 5:C=l.child.stateNode;break;case 1:C=l.child.stateNode}Er(l,ie,C)}break;case 5:var ce=l.stateNode;if(C===null&&l.flags&4){C=ce;var ge=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":ge.autoFocus&&C.focus();break;case"img":ge.src&&(C.src=ge.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var Ne=l.alternate;if(Ne!==null){var Ve=Ne.memoizedState;if(Ve!==null){var We=Ve.dehydrated;We!==null&&Ln(We)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}Fn||l.flags&512&&ug(l)}catch(Ge){Mr(l,l.return,Ge)}}if(l===i){ct=null;break}if(C=l.sibling,C!==null){C.return=l.return,ct=C;break}ct=l.return}}function gm(i){for(;ct!==null;){var l=ct;if(l===i){ct=null;break}var C=l.sibling;if(C!==null){C.return=l.return,ct=C;break}ct=l.return}}function vm(i){for(;ct!==null;){var l=ct;try{switch(l.tag){case 0:case 11:case 15:var C=l.return;try{Nh(4,l)}catch(ge){Mr(l,C,ge)}break;case 1:var D=l.stateNode;if(typeof D.componentDidMount=="function"){var H=l.return;try{D.componentDidMount()}catch(ge){Mr(l,H,ge)}}var K=l.return;try{ug(l)}catch(ge){Mr(l,K,ge)}break;case 5:var ie=l.return;try{ug(l)}catch(ge){Mr(l,ie,ge)}}}catch(ge){Mr(l,l.return,ge)}if(l===i){ct=null;break}var ce=l.sibling;if(ce!==null){ce.return=l.return,ct=ce;break}ct=l.return}}var p_=Math.ceil,Ih=d.ReactCurrentDispatcher,dg=d.ReactCurrentOwner,$i=d.ReactCurrentBatchConfig,Yt=0,vn=null,Kr=null,An=0,xi=0,Yu=aa(0),nn=0,pf=null,As=0,jh=0,hg=0,gf=null,si=null,pg=0,Ku=1/0,jo=null,Dh=!1,gg=null,Nl=null,Fh=!1,Il=null,zh=0,vf=0,vg=null,Bh=-1,Uh=0;function Zn(){return(Yt&6)!==0?Pr():Bh!==-1?Bh:Bh=Pr()}function jl(i){return(i.mode&1)===0?1:(Yt&2)!==0&&An!==0?An&-An:tf.transition!==null?(Uh===0&&(Uh=Pc()),Uh):(i=$t,i!==0||(i=window.event,i=i===void 0?16:th(i.type)),i)}function ha(i,l,C,D){if(50<vf)throw vf=0,vg=null,Error(t(185));ns(i,C,D),((Yt&2)===0||i!==vn)&&(i===vn&&((Yt&2)===0&&(jh|=C),nn===4&&Dl(i,An)),ui(i,D),C===1&&Yt===0&&(l.mode&1)===0&&(Ku=Pr()+500,vl&&qa()))}function ui(i,l){var C=i.callbackNode;Xd(i,l);var D=uo(i,i===vn?An:0);if(D===0)C!==null&&rs(C),i.callbackNode=null,i.callbackPriority=0;else if(l=D&-D,i.callbackPriority!==l){if(C!=null&&rs(C),l===1)i.tag===0?oa(ym.bind(null,i)):ws(ym.bind(null,i)),vh(function(){(Yt&6)===0&&qa()}),C=null;else{switch(is(D)){case 1:C=so;break;case 4:C=Js;break;case 16:C=Qo;break;case 536870912:C=eu;break;default:C=Qo}C=Pm(C,mm.bind(null,i))}i.callbackPriority=l,i.callbackNode=C}}function mm(i,l){if(Bh=-1,Uh=0,(Yt&6)!==0)throw Error(t(327));var C=i.callbackNode;if(Xu()&&i.callbackNode!==C)return null;var D=uo(i,i===vn?An:0);if(D===0)return null;if((D&30)!==0||(D&i.expiredLanes)!==0||l)l=qh(i,D);else{l=D;var H=Yt;Yt|=2;var K=wm();(vn!==i||An!==l)&&(jo=null,Ku=Pr()+500,Rs(i,l));do try{m_();break}catch(ce){bm(i,ce)}while(!0);Lu(),Ih.current=K,Yt=H,Kr!==null?l=0:(vn=null,An=0,l=nn)}if(l!==0){if(l===2&&(H=Jo(i),H!==0&&(D=H,l=mg(i,H))),l===1)throw C=pf,Rs(i,0),Dl(i,D),ui(i,Pr()),C;if(l===6)Dl(i,D);else{if(H=i.current.alternate,(D&30)===0&&!g_(H)&&(l=qh(i,D),l===2&&(K=Jo(i),K!==0&&(D=K,l=mg(i,K))),l===1))throw C=pf,Rs(i,0),Dl(i,D),ui(i,Pr()),C;switch(i.finishedWork=H,i.finishedLanes=D,l){case 0:case 1:throw Error(t(345));case 2:Ms(i,si,jo);break;case 3:if(Dl(i,D),(D&130023424)===D&&(l=pg+500-Pr(),10<l)){if(uo(i,0)!==0)break;if(H=i.suspendedLanes,(H&D)!==D){Zn(),i.pingedLanes|=i.suspendedLanes&H;break}i.timeoutHandle=Gn(Ms.bind(null,i,si,jo),l);break}Ms(i,si,jo);break;case 4:if(Dl(i,D),(D&4194240)===D)break;for(l=i.eventTimes,H=-1;0<D;){var ie=31-Ft(D);K=1<<ie,ie=l[ie],ie>H&&(H=ie),D&=~K}if(D=H,D=Pr()-D,D=(120>D?120:480>D?480:1080>D?1080:1920>D?1920:3e3>D?3e3:4320>D?4320:1960*p_(D/1960))-D,10<D){i.timeoutHandle=Gn(Ms.bind(null,i,si,jo),D);break}Ms(i,si,jo);break;case 5:Ms(i,si,jo);break;default:throw Error(t(329))}}}return ui(i,Pr()),i.callbackNode===C?mm.bind(null,i):null}function mg(i,l){var C=gf;return i.current.memoizedState.isDehydrated&&(Rs(i,l).flags|=256),i=qh(i,l),i!==2&&(l=si,si=C,l!==null&&yg(l)),i}function yg(i){si===null?si=i:si.push.apply(si,i)}function g_(i){for(var l=i;;){if(l.flags&16384){var C=l.updateQueue;if(C!==null&&(C=C.stores,C!==null))for(var D=0;D<C.length;D++){var H=C[D],K=H.getSnapshot;H=H.value;try{if(!In(K(),H))return!1}catch{return!1}}}if(C=l.child,l.subtreeFlags&16384&&C!==null)C.return=l,l=C;else{if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Dl(i,l){for(l&=~hg,l&=~jh,i.suspendedLanes|=l,i.pingedLanes&=~l,i=i.expirationTimes;0<l;){var C=31-Ft(l),D=1<<C;i[C]=-1,l&=~D}}function ym(i){if((Yt&6)!==0)throw Error(t(327));Xu();var l=uo(i,0);if((l&1)===0)return ui(i,Pr()),null;var C=qh(i,l);if(i.tag!==0&&C===2){var D=Jo(i);D!==0&&(l=D,C=mg(i,D))}if(C===1)throw C=pf,Rs(i,0),Dl(i,l),ui(i,Pr()),C;if(C===6)throw Error(t(345));return i.finishedWork=i.current.alternate,i.finishedLanes=l,Ms(i,si,jo),ui(i,Pr()),null}function bg(i,l){var C=Yt;Yt|=1;try{return i(l)}finally{Yt=C,Yt===0&&(Ku=Pr()+500,vl&&qa())}}function Ts(i){Il!==null&&Il.tag===0&&(Yt&6)===0&&Xu();var l=Yt;Yt|=1;var C=$i.transition,D=$t;try{if($i.transition=null,$t=1,i)return i()}finally{$t=D,$i.transition=C,Yt=l,(Yt&6)===0&&qa()}}function wg(){xi=Yu.current,or(Yu)}function Rs(i,l){i.finishedWork=null,i.finishedLanes=0;var C=i.timeoutHandle;if(C!==-1&&(i.timeoutHandle=-1,Zc(C)),Kr!==null)for(C=Kr.return;C!==null;){var D=C;switch(Yr(D),D.tag){case 1:D=D.type.childContextTypes,D!=null&&gl();break;case 3:yr(),or(cn),or(tn),dn();break;case 5:sa(D);break;case 4:yr();break;case 13:or(lr);break;case 19:or(lr);break;case 10:Nu(D.type._context);break;case 22:case 23:wg()}C=C.return}if(vn=i,Kr=i=Fl(i.current,null),An=xi=l,nn=0,pf=null,hg=jh=As=0,si=gf=null,Ui!==null){for(l=0;l<Ui.length;l++)if(C=Ui[l],D=C.interleaved,D!==null){C.interleaved=null;var H=D.next,K=C.pending;if(K!==null){var ie=K.next;K.next=H,D.next=ie}C.pending=D}Ui=null}return i}function bm(i,l){do{var C=Kr;try{if(Lu(),xl.current=Al,Ei){for(var D=tr.memoizedState;D!==null;){var H=D.queue;H!==null&&(H.pending=null),D=D.next}Ei=!1}if(Pn=0,Tr=xr=tr=null,Wa=!1,li=0,dg.current=null,C===null||C.return===null){nn=1,pf=l,Kr=null;break}e:{var K=i,ie=C.return,ce=C,ge=l;if(l=An,ce.flags|=32768,ge!==null&&typeof ge=="object"&&typeof ge.then=="function"){var Ne=ge,Ve=ce,We=Ve.tag;if((Ve.mode&1)===0&&(We===0||We===11||We===15)){var Ge=Ve.alternate;Ge?(Ve.updateQueue=Ge.updateQueue,Ve.memoizedState=Ge.memoizedState,Ve.lanes=Ge.lanes):(Ve.updateQueue=null,Ve.memoizedState=null)}var ot=j(ie);if(ot!==null){ot.flags&=-257,B(ot,ie,ce,K,l),ot.mode&1&&p(K,Ne,l),l=ot,ge=Ne;var ft=l.updateQueue;if(ft===null){var pt=new Set;pt.add(ge),l.updateQueue=pt}else ft.add(ge);break e}else{if((l&1)===0){p(K,Ne,l),_g();break e}ge=Error(t(426))}}else if(Zt&&ce.mode&1){var Ur=j(ie);if(Ur!==null){(Ur.flags&65536)===0&&(Ur.flags|=256),B(Ur,ie,ce,K,l),Ss(Io(ge,ce));break e}}K=ge=Io(ge,ce),nn!==4&&(nn=2),gf===null?gf=[K]:gf.push(K),K=ie;do{switch(K.tag){case 3:K.flags|=65536,l&=-l,K.lanes|=l;var Ae=Mh(K,ge,l);Ps(K,Ae);break e;case 1:ce=ge;var be=K.type,Re=K.stateNode;if((K.flags&128)===0&&(typeof be.getDerivedStateFromError=="function"||Re!==null&&typeof Re.componentDidCatch=="function"&&(Nl===null||!Nl.has(Re)))){K.flags|=65536,l&=-l,K.lanes|=l;var Ze=u(K,ce,l);Ps(K,Ze);break e}}K=K.return}while(K!==null)}Sm(C)}catch(vt){l=vt,Kr===C&&C!==null&&(Kr=C=C.return);continue}break}while(!0)}function wm(){var i=Ih.current;return Ih.current=Al,i===null?Al:i}function _g(){(nn===0||nn===3||nn===2)&&(nn=4),vn===null||(As&268435455)===0&&(jh&268435455)===0||Dl(vn,An)}function qh(i,l){var C=Yt;Yt|=2;var D=wm();(vn!==i||An!==l)&&(jo=null,Rs(i,l));do try{v_();break}catch(H){bm(i,H)}while(!0);if(Lu(),Yt=C,Ih.current=D,Kr!==null)throw Error(t(261));return vn=null,An=0,nn}function v_(){for(;Kr!==null;)_m(Kr)}function m_(){for(;Kr!==null&&!Kp();)_m(Kr)}function _m(i){var l=Om(i.alternate,i,xi);i.memoizedProps=i.pendingProps,l===null?Sm(i):Kr=l,dg.current=null}function Sm(i){var l=i;do{var C=l.alternate;if(i=l.return,(l.flags&32768)===0){if(C=u_(C,l,xi),C!==null){Kr=C;return}}else{if(C=c_(C,l),C!==null){C.flags&=32767,Kr=C;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{nn=6,Kr=null;return}}if(l=l.sibling,l!==null){Kr=l;return}Kr=l=i}while(l!==null);nn===0&&(nn=5)}function Ms(i,l,C){var D=$t,H=$i.transition;try{$i.transition=null,$t=1,y_(i,l,C,D)}finally{$i.transition=H,$t=D}return null}function y_(i,l,C,D){do Xu();while(Il!==null);if((Yt&6)!==0)throw Error(t(327));C=i.finishedWork;var H=i.finishedLanes;if(C===null)return null;if(i.finishedWork=null,i.finishedLanes=0,C===i.current)throw Error(t(177));i.callbackNode=null,i.callbackPriority=0;var K=C.lanes|C.childLanes;if(Qp(i,K),i===vn&&(Kr=vn=null,An=0),(C.subtreeFlags&2064)===0&&(C.flags&2064)===0||Fh||(Fh=!0,Pm(Qo,function(){return Xu(),null})),K=(C.flags&15990)!==0,(C.subtreeFlags&15990)!==0||K){K=$i.transition,$i.transition=null;var ie=$t;$t=1;var ce=Yt;Yt|=4,dg.current=null,d_(i,C),dm(C,i),ds(Kc),ou=!!Yc,Kc=Yc=null,i.current=C,h_(C),Xp(),Yt=ce,$t=ie,$i.transition=K}else i.current=C;if(Fh&&(Fh=!1,Il=i,zh=H),K=i.pendingLanes,K===0&&(Nl=null),fr(C.stateNode),ui(i,Pr()),l!==null)for(D=i.onRecoverableError,C=0;C<l.length;C++)H=l[C],D(H.value,{componentStack:H.stack,digest:H.digest});if(Dh)throw Dh=!1,i=gg,gg=null,i;return(zh&1)!==0&&i.tag!==0&&Xu(),K=i.pendingLanes,(K&1)!==0?i===vg?vf++:(vf=0,vg=i):vf=0,qa(),null}function Xu(){if(Il!==null){var i=is(zh),l=$i.transition,C=$t;try{if($i.transition=null,$t=16>i?16:i,Il===null)var D=!1;else{if(i=Il,Il=null,zh=0,(Yt&6)!==0)throw Error(t(331));var H=Yt;for(Yt|=4,ct=i.current;ct!==null;){var K=ct,ie=K.child;if((ct.flags&16)!==0){var ce=K.deletions;if(ce!==null){for(var ge=0;ge<ce.length;ge++){var Ne=ce[ge];for(ct=Ne;ct!==null;){var Ve=ct;switch(Ve.tag){case 0:case 11:case 15:hf(8,Ve,K)}var We=Ve.child;if(We!==null)We.return=Ve,ct=We;else for(;ct!==null;){Ve=ct;var Ge=Ve.sibling,ot=Ve.return;if(lm(Ve),Ve===Ne){ct=null;break}if(Ge!==null){Ge.return=ot,ct=Ge;break}ct=ot}}}var ft=K.alternate;if(ft!==null){var pt=ft.child;if(pt!==null){ft.child=null;do{var Ur=pt.sibling;pt.sibling=null,pt=Ur}while(pt!==null)}}ct=K}}if((K.subtreeFlags&2064)!==0&&ie!==null)ie.return=K,ct=ie;else e:for(;ct!==null;){if(K=ct,(K.flags&2048)!==0)switch(K.tag){case 0:case 11:case 15:hf(9,K,K.return)}var Ae=K.sibling;if(Ae!==null){Ae.return=K.return,ct=Ae;break e}ct=K.return}}var be=i.current;for(ct=be;ct!==null;){ie=ct;var Re=ie.child;if((ie.subtreeFlags&2064)!==0&&Re!==null)Re.return=ie,ct=Re;else e:for(ie=be;ct!==null;){if(ce=ct,(ce.flags&2048)!==0)try{switch(ce.tag){case 0:case 11:case 15:Nh(9,ce)}}catch(vt){Mr(ce,ce.return,vt)}if(ce===ie){ct=null;break e}var Ze=ce.sibling;if(Ze!==null){Ze.return=ce.return,ct=Ze;break e}ct=ce.return}}if(Yt=H,qa(),Zr&&typeof Zr.onPostCommitFiberRoot=="function")try{Zr.onPostCommitFiberRoot(Qi,i)}catch{}D=!0}return D}finally{$t=C,$i.transition=l}}return!1}function Em(i,l,C){l=Io(C,l),l=Mh(i,l,1),i=Gi(i,l,1),l=Zn(),i!==null&&(ns(i,1,l),ui(i,l))}function Mr(i,l,C){if(i.tag===3)Em(i,i,C);else for(;l!==null;){if(l.tag===3){Em(l,i,C);break}else if(l.tag===1){var D=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof D.componentDidCatch=="function"&&(Nl===null||!Nl.has(D))){i=Io(C,i),i=u(l,i,1),l=Gi(l,i,1),i=Zn(),l!==null&&(ns(l,1,i),ui(l,i));break}}l=l.return}}function b_(i,l,C){var D=i.pingCache;D!==null&&D.delete(l),l=Zn(),i.pingedLanes|=i.suspendedLanes&C,vn===i&&(An&C)===C&&(nn===4||nn===3&&(An&130023424)===An&&500>Pr()-pg?Rs(i,0):hg|=C),ui(i,l)}function xm(i,l){l===0&&((i.mode&1)===0?l=1:(l=Ji,Ji<<=1,(Ji&130023424)===0&&(Ji=4194304)));var C=Zn();i=Kn(i,l),i!==null&&(ns(i,l,C),ui(i,C))}function w_(i){var l=i.memoizedState,C=0;l!==null&&(C=l.retryLane),xm(i,C)}function __(i,l){var C=0;switch(i.tag){case 13:var D=i.stateNode,H=i.memoizedState;H!==null&&(C=H.retryLane);break;case 19:D=i.stateNode;break;default:throw Error(t(314))}D!==null&&D.delete(l),xm(i,C)}var Om;Om=function(i,l,C){if(i!==null)if(i.memoizedProps!==l.pendingProps||cn.current)J=!0;else{if((i.lanes&C)===0&&(l.flags&128)===0)return J=!1,og(i,l,C);J=(i.flags&131072)!==0}else J=!1,Zt&&(l.flags&1048576)!==0&&_h(l,Ga,l.index);switch(l.lanes=0,l.tag){case 2:var D=l.type;Ut(i,l),i=l.pendingProps;var H=Po(l,tn.current);la(l,C),H=Ol(null,l,D,i,H,C);var K=Pl();return l.flags|=1,typeof H=="object"&&H!==null&&typeof H.render=="function"&&H.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,fn(D)?(K=!0,Co(l)):K=!1,l.memoizedState=H.state!==null&&H.state!==void 0?H.state:null,Os(l),H.updater=Rl,l.stateNode=H,H._reactInternals=l,Vu(l,D,i,C),l=Qt(null,l,D,!0,K,C)):(l.tag=0,Zt&&K&&ml(l),le(null,l,H,C),l=l.child),l;case 16:D=l.elementType;e:{switch(Ut(i,l),i=l.pendingProps,H=D._init,D=H(D._payload),l.type=D,H=l.tag=E_(D),i=rn(D,i),H){case 0:l=nt(null,l,D,i,C);break e;case 1:l=sr(null,l,D,i,C);break e;case 11:l=Ee(null,l,D,i,C);break e;case 14:l=Ie(null,l,D,rn(D.type,i),C);break e}throw Error(t(306,D,""))}return l;case 0:return D=l.type,H=l.pendingProps,H=l.elementType===D?H:rn(D,H),nt(i,l,D,H,C);case 1:return D=l.type,H=l.pendingProps,H=l.elementType===D?H:rn(D,H),sr(i,l,D,H,C);case 3:e:{if(Cn(l),i===null)throw Error(t(387));D=l.pendingProps,K=l.memoizedState,H=K.element,ju(i,l),_l(l,D,null,C);var ie=l.memoizedState;if(D=ie.element,K.isDehydrated)if(K={element:D,isDehydrated:!1,cache:ie.cache,pendingSuspenseBoundaries:ie.pendingSuspenseBoundaries,transitions:ie.transitions},l.updateQueue.baseState=K,l.memoizedState=K,l.flags&256){H=Io(Error(t(423)),l),l=Vi(i,l,D,C,H);break e}else if(D!==H){H=Io(Error(t(424)),l),l=Vi(i,l,D,C,H);break e}else for(tt=Di(l.stateNode.containerInfo.firstChild),$n=l,Zt=!0,Wn=null,C=oi(l,null,D,C),l.child=C;C;)C.flags=C.flags&-3|4096,C=C.sibling;else{if(Ro(),D===H){l=gn(i,l,C);break e}le(i,l,D,C)}l=l.child}return l;case 5:return Sl(l),i===null&&yl(l),D=l.type,H=l.pendingProps,K=i!==null?i.memoizedProps:null,ie=H.children,Xc(D,H)?ie=null:K!==null&&Xc(D,K)&&(l.flags|=32),Tt(i,l),le(i,l,ie,C),l.child;case 6:return i===null&&yl(l),null;case 13:return De(i,l,C);case 4:return $a(l,l.stateNode.containerInfo),D=l.pendingProps,i===null?l.child=Mo(l,null,D,C):le(i,l,D,C),l.child;case 11:return D=l.type,H=l.pendingProps,H=l.elementType===D?H:rn(D,H),Ee(i,l,D,H,C);case 7:return le(i,l,l.pendingProps,C),l.child;case 8:return le(i,l,l.pendingProps.children,C),l.child;case 12:return le(i,l,l.pendingProps.children,C),l.child;case 10:e:{if(D=l.type._context,H=l.pendingProps,K=l.memoizedProps,ie=H.value,rr(Es,D._currentValue),D._currentValue=ie,K!==null)if(In(K.value,ie)){if(K.children===H.children&&!cn.current){l=gn(i,l,C);break e}}else for(K=l.child,K!==null&&(K.return=l);K!==null;){var ce=K.dependencies;if(ce!==null){ie=K.child;for(var ge=ce.firstContext;ge!==null;){if(ge.context===D){if(K.tag===1){ge=Hi(-1,C&-C),ge.tag=2;var Ne=K.updateQueue;if(Ne!==null){Ne=Ne.shared;var Ve=Ne.pending;Ve===null?ge.next=ge:(ge.next=Ve.next,Ve.next=ge),Ne.pending=ge}}K.lanes|=C,ge=K.alternate,ge!==null&&(ge.lanes|=C),Iu(K.return,C,l),ce.lanes|=C;break}ge=ge.next}}else if(K.tag===10)ie=K.type===l.type?null:K.child;else if(K.tag===18){if(ie=K.return,ie===null)throw Error(t(341));ie.lanes|=C,ce=ie.alternate,ce!==null&&(ce.lanes|=C),Iu(ie,C,l),ie=K.sibling}else ie=K.child;if(ie!==null)ie.return=K;else for(ie=K;ie!==null;){if(ie===l){ie=null;break}if(K=ie.sibling,K!==null){K.return=ie.return,ie=K;break}ie=ie.return}K=ie}le(i,l,H.children,C),l=l.child}return l;case 9:return H=l.type,D=l.pendingProps.children,la(l,C),H=On(H),D=D(H),l.flags|=1,le(i,l,D,C),l.child;case 14:return D=l.type,H=rn(D,l.pendingProps),H=rn(D.type,H),Ie(i,l,D,H,C);case 15:return Xe(i,l,l.type,l.pendingProps,C);case 17:return D=l.type,H=l.pendingProps,H=l.elementType===D?H:rn(D,H),Ut(i,l),l.tag=1,fn(D)?(i=!0,Co(l)):i=!1,la(l,C),Rh(l,D,H),Vu(l,D,H,C),Qt(null,l,D,!0,i,C);case 19:return Br(i,l,C);case 22:return st(i,l,C)}throw Error(t(156,l.tag))};function Pm(i,l){return Qs(i,l)}function S_(i,l,C,D){this.tag=i,this.key=C,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=D,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wi(i,l,C,D){return new S_(i,l,C,D)}function Sg(i){return i=i.prototype,!(!i||!i.isReactComponent)}function E_(i){if(typeof i=="function")return Sg(i)?1:0;if(i!=null){if(i=i.$$typeof,i===N)return 11;if(i===L)return 14}return 2}function Fl(i,l){var C=i.alternate;return C===null?(C=Wi(i.tag,l,i.key,i.mode),C.elementType=i.elementType,C.type=i.type,C.stateNode=i.stateNode,C.alternate=i,i.alternate=C):(C.pendingProps=l,C.type=i.type,C.flags=0,C.subtreeFlags=0,C.deletions=null),C.flags=i.flags&14680064,C.childLanes=i.childLanes,C.lanes=i.lanes,C.child=i.child,C.memoizedProps=i.memoizedProps,C.memoizedState=i.memoizedState,C.updateQueue=i.updateQueue,l=i.dependencies,C.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},C.sibling=i.sibling,C.index=i.index,C.ref=i.ref,C}function Hh(i,l,C,D,H,K){var ie=2;if(D=i,typeof i=="function")Sg(i)&&(ie=1);else if(typeof i=="string")ie=5;else e:switch(i){case T:return Ls(C.children,H,K,l);case I:ie=8,H|=8;break;case F:return i=Wi(12,C,l,H|2),i.elementType=F,i.lanes=K,i;case A:return i=Wi(13,C,l,H),i.elementType=A,i.lanes=K,i;case R:return i=Wi(19,C,l,H),i.elementType=R,i.lanes=K,i;case G:return Gh(C,H,K,l);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case k:ie=10;break e;case O:ie=9;break e;case N:ie=11;break e;case L:ie=14;break e;case V:ie=16,D=null;break e}throw Error(t(130,i==null?i:typeof i,""))}return l=Wi(ie,C,l,H),l.elementType=i,l.type=D,l.lanes=K,l}function Ls(i,l,C,D){return i=Wi(7,i,D,l),i.lanes=C,i}function Gh(i,l,C,D){return i=Wi(22,i,D,l),i.elementType=G,i.lanes=C,i.stateNode={isHidden:!1},i}function Eg(i,l,C){return i=Wi(6,i,null,l),i.lanes=C,i}function xg(i,l,C){return l=Wi(4,i.children!==null?i.children:[],i.key,l),l.lanes=C,l.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},l}function x_(i,l,C,D,H){this.tag=l,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zn(0),this.expirationTimes=zn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zn(0),this.identifierPrefix=D,this.onRecoverableError=H,this.mutableSourceEagerHydrationData=null}function Og(i,l,C,D,H,K,ie,ce,ge){return i=new x_(i,l,C,ce,ge),l===1?(l=1,K===!0&&(l|=8)):l=0,K=Wi(3,null,null,l),i.current=K,K.stateNode=i,K.memoizedState={element:D,isDehydrated:C,cache:null,transitions:null,pendingSuspenseBoundaries:null},Os(K),i}function O_(i,l,C){var D=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:D==null?null:""+D,children:i,containerInfo:l,implementation:C}}function Cm(i){if(!i)return zi;i=i._reactInternals;e:{if(Nr(i)!==i||i.tag!==1)throw Error(t(170));var l=i;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(fn(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(t(171))}if(i.tag===1){var C=i.type;if(fn(C))return ku(i,C,l)}return l}function km(i,l,C,D,H,K,ie,ce,ge){return i=Og(C,D,!0,i,H,K,ie,ce,ge),i.context=Cm(null),C=i.current,D=Zn(),H=jl(C),K=Hi(D,H),K.callback=l??null,Gi(C,K,H),i.current.lanes=H,ns(i,H,D),ui(i,D),i}function Vh(i,l,C,D){var H=l.current,K=Zn(),ie=jl(H);return C=Cm(C),l.context===null?l.context=C:l.pendingContext=C,l=Hi(K,ie),l.payload={element:i},D=D===void 0?null:D,D!==null&&(l.callback=D),i=Gi(H,l,ie),i!==null&&(ha(i,H,ie,K),Du(i,H,ie)),ie}function $h(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function Am(i,l){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var C=i.retryLane;i.retryLane=C!==0&&C<l?C:l}}function Pg(i,l){Am(i,l),(i=i.alternate)&&Am(i,l)}function P_(){return null}var Tm=typeof reportError=="function"?reportError:function(i){console.error(i)};function Cg(i){this._internalRoot=i}Wh.prototype.render=Cg.prototype.render=function(i){var l=this._internalRoot;if(l===null)throw Error(t(409));Vh(i,l,null,null)},Wh.prototype.unmount=Cg.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var l=i.containerInfo;Ts(function(){Vh(null,i,null,null)}),l[Fi]=null}};function Wh(i){this._internalRoot=i}Wh.prototype.unstable_scheduleHydration=function(i){if(i){var l=Qd();i={blockedOn:null,target:i,priority:l};for(var C=0;C<ji.length&&l!==0&&l<ji[C].priority;C++);ji.splice(C,0,i),C===0&&nu(i)}};function kg(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function Yh(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function Rm(){}function C_(i,l,C,D,H){if(H){if(typeof D=="function"){var K=D;D=function(){var Ne=$h(ie);K.call(Ne)}}var ie=km(l,D,i,0,null,!1,!1,"",Rm);return i._reactRootContainer=ie,i[Fi]=ie.current,_o(i.nodeType===8?i.parentNode:i),Ts(),ie}for(;H=i.lastChild;)i.removeChild(H);if(typeof D=="function"){var ce=D;D=function(){var Ne=$h(ge);ce.call(Ne)}}var ge=Og(i,0,!1,null,null,!1,!1,"",Rm);return i._reactRootContainer=ge,i[Fi]=ge.current,_o(i.nodeType===8?i.parentNode:i),Ts(function(){Vh(l,ge,C,D)}),ge}function Kh(i,l,C,D,H){var K=C._reactRootContainer;if(K){var ie=K;if(typeof H=="function"){var ce=H;H=function(){var ge=$h(ie);ce.call(ge)}}Vh(l,ie,i,H)}else ie=C_(C,l,i,H,D);return $h(ie)}el=function(i){switch(i.tag){case 3:var l=i.stateNode;if(l.current.memoizedState.isDehydrated){var C=Gr(l.pendingLanes);C!==0&&(Cc(l,C|1),ui(l,Pr()),(Yt&6)===0&&(Ku=Pr()+500,qa()))}break;case 13:Ts(function(){var D=Kn(i,1);if(D!==null){var H=Zn();ha(D,i,1,H)}}),Pg(i,1)}},tl=function(i){if(i.tag===13){var l=Kn(i,134217728);if(l!==null){var C=Zn();ha(l,i,134217728,C)}Pg(i,134217728)}},Zd=function(i){if(i.tag===13){var l=jl(i),C=Kn(i,l);if(C!==null){var D=Zn();ha(C,i,l,D)}Pg(i,l)}},Qd=function(){return $t},tu=function(i,l){var C=$t;try{return $t=i,l()}finally{$t=C}},qe=function(i,l,C){switch(l){case"input":if(Te(i,C),l=C.name,C.type==="radio"&&l!=null){for(C=i;C.parentNode;)C=C.parentNode;for(C=C.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<C.length;l++){var D=C[l];if(D!==i&&D.form===i.form){var H=Wr(D);if(!H)throw Error(t(90));fe(D),Te(D,H)}}}break;case"textarea":de(i,C);break;case"select":l=C.value,l!=null&&xe(i,!!C.multiple,l,!1)}},at=bg,Pe=Ts;var k_={usingClientEntryPoint:!1,Events:[bs,Dr,Wr,ht,ze,bg]},mf={findFiberByHostInstance:Ba,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},A_={bundleType:mf.bundleType,version:mf.version,rendererPackageName:mf.rendererPackageName,rendererConfig:mf.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:d.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=ti(i),i===null?null:i.stateNode},findFiberByHostInstance:mf.findFiberByHostInstance||P_,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xh.isDisabled&&Xh.supportsFiber)try{Qi=Xh.inject(A_),Zr=Xh}catch{}}return ci.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=k_,ci.createPortal=function(i,l){var C=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!kg(l))throw Error(t(200));return O_(i,l,null,C)},ci.createRoot=function(i,l){if(!kg(i))throw Error(t(299));var C=!1,D="",H=Tm;return l!=null&&(l.unstable_strictMode===!0&&(C=!0),l.identifierPrefix!==void 0&&(D=l.identifierPrefix),l.onRecoverableError!==void 0&&(H=l.onRecoverableError)),l=Og(i,1,!1,null,null,C,!1,D,H),i[Fi]=l.current,_o(i.nodeType===8?i.parentNode:i),new Cg(l)},ci.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var l=i._reactInternals;if(l===void 0)throw typeof i.render=="function"?Error(t(188)):(i=Object.keys(i).join(","),Error(t(268,i)));return i=ti(l),i=i===null?null:i.stateNode,i},ci.flushSync=function(i){return Ts(i)},ci.hydrate=function(i,l,C){if(!Yh(l))throw Error(t(200));return Kh(null,i,l,!0,C)},ci.hydrateRoot=function(i,l,C){if(!kg(i))throw Error(t(405));var D=C!=null&&C.hydratedSources||null,H=!1,K="",ie=Tm;if(C!=null&&(C.unstable_strictMode===!0&&(H=!0),C.identifierPrefix!==void 0&&(K=C.identifierPrefix),C.onRecoverableError!==void 0&&(ie=C.onRecoverableError)),l=km(l,null,i,1,C??null,H,!1,K,ie),i[Fi]=l.current,_o(i),D)for(i=0;i<D.length;i++)C=D[i],H=C._getVersion,H=H(C._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[C,H]:l.mutableSourceEagerHydrationData.push(C,H);return new Wh(l)},ci.render=function(i,l,C){if(!Yh(l))throw Error(t(200));return Kh(null,i,l,!1,C)},ci.unmountComponentAtNode=function(i){if(!Yh(i))throw Error(t(40));return i._reactRootContainer?(Ts(function(){Kh(null,null,i,!1,function(){i._reactRootContainer=null,i[Fi]=null})}),!0):!1},ci.unstable_batchedUpdates=bg,ci.unstable_renderSubtreeIntoContainer=function(i,l,C,D){if(!Yh(C))throw Error(t(200));if(i==null||i._reactInternals===void 0)throw Error(t(38));return Kh(i,l,C,!1,D)},ci.version="18.3.1-next-f1338f8080-20240426",ci}var Dm;function u5(){if(Dm)return Tg.exports;Dm=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Tg.exports=L_(),Tg.exports}var Fm;function N_(){if(Fm)return Zh;Fm=1;var e=u5();return Zh.createRoot=e.createRoot,Zh.hydrateRoot=e.hydrateRoot,Zh}var I_=N_();const c5=jd(I_);var yf={};function Lt(e){for(var n=arguments.length,t=new Array(n>1?n-1:0),r=1;r<n;r++)t[r-1]=arguments[r];throw new Error(typeof e=="number"?"[MobX] minified error nr: "+e+(t.length?" "+t.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+e)}var j_={};function Pp(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:j_}var f5=Object.assign,dp=Object.getOwnPropertyDescriptor,to=Object.defineProperty,Dd=Object.prototype,$1=[];Object.freeze($1);var sv={};Object.freeze(sv);var D_=typeof Proxy<"u",F_=Object.toString();function d5(){D_||Lt("Proxy not available")}function h5(e){var n=!1;return function(){if(!n)return n=!0,e.apply(this,arguments)}}var rc=function(){};function Ai(e){return typeof e=="function"}function Bs(e){var n=typeof e;switch(n){case"string":case"symbol":case"number":return!0}return!1}function Cp(e){return e!==null&&typeof e=="object"}function Ko(e){if(!Cp(e))return!1;var n=Object.getPrototypeOf(e);if(n==null)return!0;var t=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return typeof t=="function"&&t.toString()===F_}function p5(e){var n=e==null?void 0:e.constructor;return n?n.name==="GeneratorFunction"||n.displayName==="GeneratorFunction":!1}function Fd(e,n,t){to(e,n,{enumerable:!1,writable:!0,configurable:!0,value:t})}function g5(e,n,t){to(e,n,{enumerable:!1,writable:!1,configurable:!0,value:t})}function Kl(e,n){var t="isMobX"+e;return n.prototype[t]=!0,function(r){return Cp(r)&&r[t]===!0}}function yc(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function z_(e){var n=Object.getPrototypeOf(e),t=Object.getPrototypeOf(n),r=Object.getPrototypeOf(t);return r===null}function Vo(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var v5=typeof Object.getOwnPropertySymbols<"u";function B_(e){var n=Object.keys(e);if(!v5)return n;var t=Object.getOwnPropertySymbols(e);return t.length?[].concat(n,t.filter(function(r){return Dd.propertyIsEnumerable.call(e,r)})):n}var lc=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:v5?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function m5(e){return e===null?null:typeof e=="object"?""+e:e}function $o(e,n){return Dd.hasOwnProperty.call(e,n)}var U_=Object.getOwnPropertyDescriptors||function(n){var t={};return lc(n).forEach(function(r){t[r]=dp(n,r)}),t};function Ci(e,n){return!!(e&n)}function ki(e,n,t){return t?e|=n:e&=~n,e}function zm(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function q_(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,G_(r.key),r)}}function bc(e,n,t){return n&&q_(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function nc(e,n){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=V_(e))||n){t&&(e=t);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
33
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $l(){return $l=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},$l.apply(null,arguments)}function y5(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,W1(e,n)}function W1(e,n){return W1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},W1(e,n)}function H_(e,n){if(typeof e!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var r=t.call(e,n);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function G_(e){var n=H_(e,"string");return typeof n=="symbol"?n:n+""}function V_(e,n){if(e){if(typeof e=="string")return zm(e,n);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?zm(e,n):void 0}}var eo=Symbol("mobx-stored-annotations");function _a(e){function n(t,r){if(Bd(r))return e.decorate_20223_(t,r);zd(t,r,e)}return Object.assign(n,e)}function zd(e,n,t){$o(e,eo)||Fd(e,eo,$l({},e[eo])),e6(t)||(e[eo][n]=t)}function $_(e){return $o(e,eo)||Fd(e,eo,$l({},e[eo])),e[eo]}function Bd(e){return typeof e=="object"&&typeof e.kind=="string"}var bt=Symbol("mobx administration"),Xl=function(){function e(t){t===void 0&&(t="Atom"),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=Xt.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=t}var n=e.prototype;return n.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},n.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},n.reportObserved=function(){return D5(this)},n.reportChanged=function(){di(),F5(this),hi()},n.toString=function(){return this.name_},bc(e,[{key:"isBeingObserved",get:function(){return Ci(this.flags_,e.isBeingObservedMask_)},set:function(r){this.flags_=ki(this.flags_,e.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return Ci(this.flags_,e.isPendingUnobservationMask_)},set:function(r){this.flags_=ki(this.flags_,e.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return Ci(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=ki(this.flags_,e.diffValueMask_,r===1)}}])}();Xl.isBeingObservedMask_=1;Xl.isPendingUnobservationMask_=2;Xl.diffValueMask_=4;var uv=Kl("Atom",Xl);function Ad(e,n,t){n===void 0&&(n=rc),t===void 0&&(t=rc);var r=new Xl(e);return n!==rc&&W5(r,n),t!==rc&&gv(r,t),r}function W_(e,n){return e===n}function Y_(e,n){return Ov(e,n)}function K_(e,n){return Ov(e,n,1)}function X_(e,n){return Object.is?Object.is(e,n):e===n?e!==0||1/e===1/n:e!==e&&n!==n}var Us={identity:W_,structural:Y_,default:X_,shallow:K_};function qs(e,n,t){return Ip(e)?e:Array.isArray(e)?ur.array(e,{name:t}):Ko(e)?ur.object(e,void 0,{name:t}):yc(e)?ur.map(e,{name:t}):Vo(e)?ur.set(e,{name:t}):typeof e=="function"&&!cc(e)&&!fc(e)?p5(e)?Gs(e):sc(t,e):e}function Z_(e,n,t){if(e==null||yn(e)||Qn(e)||Rn(e)||an(e))return e;if(Array.isArray(e))return ur.array(e,{name:t,deep:!1});if(Ko(e))return ur.object(e,void 0,{name:t,deep:!1});if(yc(e))return ur.map(e,{name:t,deep:!1});if(Vo(e))return ur.set(e,{name:t,deep:!1})}function kp(e){return e}function Q_(e,n){return Ov(e,n)?n:e}var b5="override",J_=_a({annotationType_:b5,make_:t6,extend_:r6,decorate_20223_:n6});function e6(e){return e.annotationType_===b5}function t6(e,n){return 0}function r6(e,n,t,r){Lt("'"+this.annotationType_+"' can only be used with 'makeObservable'")}function n6(e,n){console.warn("'"+this.annotationType_+"' cannot be used with decorators - this is a no-op")}function Ud(e,n){return{annotationType_:e,options_:n,make_:i6,extend_:a6,decorate_20223_:o6}}function i6(e,n,t,r){var a;if((a=this.options_)!=null&&a.bound)return this.extend_(e,n,t,!1)===null?0:1;if(r===e.target_)return this.extend_(e,n,t,!1)===null?0:2;if(cc(t.value))return 1;var o=w5(e,this,n,t,!1);return to(r,n,o),2}function a6(e,n,t,r){var a=w5(e,this,n,t);return e.defineProperty_(n,a,r)}function o6(e,n){var t=n.kind,r=n.name,a=n.addInitializer,o=this,s=function(f){var v,y,E,w;return Wl((v=(y=o.options_)==null?void 0:y.name)!=null?v:r.toString(),f,(E=(w=o.options_)==null?void 0:w.autoAction)!=null?E:!1)};if(t=="field")return function(m){var f,v=m;return cc(v)||(v=s(v)),(f=o.options_)!=null&&f.bound&&(v=v.bind(this),v.isMobxAction=!0),v};if(t=="method"){var c;return cc(e)||(e=s(e)),(c=this.options_)!=null&&c.bound&&a(function(){var m=this,f=m[r].bind(m);f.isMobxAction=!0,m[r]=f}),e}Lt("Cannot apply '"+o.annotationType_+"' to '"+String(r)+"' (kind: "+t+"):"+(`
|
|
34
|
+
'`+o.annotationType_+"' can only be used on properties with a function value."))}function l6(e,n,t,r){n.annotationType_,r.value}function w5(e,n,t,r,a){var o,s,c,m,f,v,y;a===void 0&&(a=Je.safeDescriptors),l6(e,n,t,r);var E=r.value;if((o=n.options_)!=null&&o.bound){var w;E=E.bind((w=e.proxy_)!=null?w:e.target_)}return{value:Wl((s=(c=n.options_)==null?void 0:c.name)!=null?s:t.toString(),E,(m=(f=n.options_)==null?void 0:f.autoAction)!=null?m:!1,(v=n.options_)!=null&&v.bound?(y=e.proxy_)!=null?y:e.target_:void 0),configurable:a?e.isPlainObject_:!0,enumerable:!1,writable:!a}}function _5(e,n){return{annotationType_:e,options_:n,make_:s6,extend_:u6,decorate_20223_:c6}}function s6(e,n,t,r){var a;if(r===e.target_)return this.extend_(e,n,t,!1)===null?0:2;if((a=this.options_)!=null&&a.bound&&(!$o(e.target_,n)||!fc(e.target_[n]))&&this.extend_(e,n,t,!1)===null)return 0;if(fc(t.value))return 1;var o=S5(e,this,n,t,!1,!1);return to(r,n,o),2}function u6(e,n,t,r){var a,o=S5(e,this,n,t,(a=this.options_)==null?void 0:a.bound);return e.defineProperty_(n,o,r)}function c6(e,n){var t,r=n.name,a=n.addInitializer;return fc(e)||(e=Gs(e)),(t=this.options_)!=null&&t.bound&&a(function(){var o=this,s=o[r].bind(o);s.isMobXFlow=!0,o[r]=s}),e}function f6(e,n,t,r){n.annotationType_,r.value}function S5(e,n,t,r,a,o){o===void 0&&(o=Je.safeDescriptors),f6(e,n,t,r);var s=r.value;if(fc(s)||(s=Gs(s)),a){var c;s=s.bind((c=e.proxy_)!=null?c:e.target_),s.isMobXFlow=!0}return{value:s,configurable:o?e.isPlainObject_:!0,enumerable:!1,writable:!o}}function cv(e,n){return{annotationType_:e,options_:n,make_:d6,extend_:h6,decorate_20223_:p6}}function d6(e,n,t){return this.extend_(e,n,t,!1)===null?0:1}function h6(e,n,t,r){return g6(e,this,n,t),e.defineComputedProperty_(n,$l({},this.options_,{get:t.get,set:t.set}),r)}function p6(e,n){var t=this,r=n.name,a=n.addInitializer;return a(function(){var o=Ws(this)[bt],s=$l({},t.options_,{get:e,context:this});s.name||(s.name="ObservableObject."+r.toString()),o.values_.set(r,new xa(s))}),function(){return this[bt].getObservablePropValue_(r)}}function g6(e,n,t,r){n.annotationType_,r.get}function Ap(e,n){return{annotationType_:e,options_:n,make_:v6,extend_:m6,decorate_20223_:y6}}function v6(e,n,t){return this.extend_(e,n,t,!1)===null?0:1}function m6(e,n,t,r){var a,o;return b6(e,this),e.defineObservableProperty_(n,t.value,(a=(o=this.options_)==null?void 0:o.enhancer)!=null?a:qs,r)}function y6(e,n){var t=this,r=n.kind,a=n.name,o=new WeakSet;function s(c,m){var f,v,y=Ws(c)[bt],E=new Gl(m,(f=(v=t.options_)==null?void 0:v.enhancer)!=null?f:qs,"ObservableObject."+a.toString(),!1);y.values_.set(a,E),o.add(c)}if(r=="accessor")return{get:function(){return o.has(this)||s(this,e.get.call(this)),this[bt].getObservablePropValue_(a)},set:function(m){return o.has(this)||s(this,m),this[bt].setObservablePropValue_(a,m)},init:function(m){return o.has(this)||s(this,m),m}}}function b6(e,n,t,r){n.annotationType_}var w6="true",_6=E5();function E5(e){return{annotationType_:w6,options_:e,make_:S6,extend_:E6,decorate_20223_:x6}}function S6(e,n,t,r){var a,o;if(t.get)return Vs.make_(e,n,t,r);if(t.set){var s=Wl(n.toString(),t.set);return r===e.target_?e.defineProperty_(n,{configurable:Je.safeDescriptors?e.isPlainObject_:!0,set:s})===null?0:2:(to(r,n,{configurable:!0,set:s}),2)}if(r!==e.target_&&typeof t.value=="function"){var c;if(p5(t.value)){var m,f=(m=this.options_)!=null&&m.autoBind?Gs.bound:Gs;return f.make_(e,n,t,r)}var v=(c=this.options_)!=null&&c.autoBind?sc.bound:sc;return v.make_(e,n,t,r)}var y=((a=this.options_)==null?void 0:a.deep)===!1?ur.ref:ur;if(typeof t.value=="function"&&(o=this.options_)!=null&&o.autoBind){var E;t.value=t.value.bind((E=e.proxy_)!=null?E:e.target_)}return y.make_(e,n,t,r)}function E6(e,n,t,r){var a,o;if(t.get)return Vs.extend_(e,n,t,r);if(t.set)return e.defineProperty_(n,{configurable:Je.safeDescriptors?e.isPlainObject_:!0,set:Wl(n.toString(),t.set)},r);if(typeof t.value=="function"&&(a=this.options_)!=null&&a.autoBind){var s;t.value=t.value.bind((s=e.proxy_)!=null?s:e.target_)}var c=((o=this.options_)==null?void 0:o.deep)===!1?ur.ref:ur;return c.extend_(e,n,t,r)}function x6(e,n){Lt("'"+this.annotationType_+"' cannot be used as a decorator")}var O6="observable",P6="observable.ref",C6="observable.shallow",k6="observable.struct",x5={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(x5);function Qh(e){return e||x5}var Y1=Ap(O6),A6=Ap(P6,{enhancer:kp}),T6=Ap(C6,{enhancer:Z_}),R6=Ap(k6,{enhancer:Q_}),O5=_a(Y1);function Jh(e){return e.deep===!0?qs:e.deep===!1?kp:L6(e.defaultDecorator)}function M6(e){var n;return e?(n=e.defaultDecorator)!=null?n:E5(e):void 0}function L6(e){var n,t;return e&&(n=(t=e.options_)==null?void 0:t.enhancer)!=null?n:qs}function P5(e,n,t){if(Bd(n))return Y1.decorate_20223_(e,n);if(Bs(n)){zd(e,n,Y1);return}return Ip(e)?e:Ko(e)?ur.object(e,n,t):Array.isArray(e)?ur.array(e,n):yc(e)?ur.map(e,n):Vo(e)?ur.set(e,n):typeof e=="object"&&e!==null?e:ur.box(e,n)}f5(P5,O5);var N6={box:function(n,t){var r=Qh(t);return new Gl(n,Jh(r),r.name,!0,r.equals)},array:function(n,t){var r=Qh(t);return(Je.useProxies===!1||r.proxy===!1?B8:T8)(n,Jh(r),r.name)},map:function(n,t){var r=Qh(t);return new Dp(n,Jh(r),r.name)},set:function(n,t){var r=Qh(t);return new Ev(n,Jh(r),r.name)},object:function(n,t,r){return Zl(function(){return vv(Je.useProxies===!1||(r==null?void 0:r.proxy)===!1?Ws({},r):P8({},r),n,t)})},ref:_a(A6),shallow:_a(T6),deep:O5,struct:_a(R6)},ur=f5(P5,N6),C5="computed",I6="computed.struct",K1=cv(C5),j6=cv(I6,{equals:Us.structural}),Vs=function(n,t){if(Bd(t))return K1.decorate_20223_(n,t);if(Bs(t))return zd(n,t,K1);if(Ko(n))return _a(cv(C5,n));var r=Ko(t)?t:{};return r.get=n,r.name||(r.name=n.name||""),new xa(r)};Object.assign(Vs,K1);Vs.struct=_a(j6);var Bm,Um,hp=0,D6=1,F6=(Bm=(Um=dp(function(){},"name"))==null?void 0:Um.configurable)!=null?Bm:!1,qm={value:"action",configurable:!0,writable:!1,enumerable:!1};function Wl(e,n,t,r){t===void 0&&(t=!1);function a(){return k5(e,t,n,r||this,arguments)}return a.isMobxAction=!0,a.toString=function(){return n.toString()},F6&&(qm.value=e,to(a,"name",qm)),a}function k5(e,n,t,r,a){var o=A5(e,n);try{return t.apply(r,a)}catch(s){throw o.error_=s,s}finally{T5(o)}}function A5(e,n,t,r){var a=!1,o=0,s=Je.trackingDerivation,c=!n||!s;di();var m=Je.allowStateChanges;c&&($s(),m=Tp(!0));var f=Mp(!0),v={runAsAction_:c,prevDerivation_:s,prevAllowStateChanges_:m,prevAllowStateReads_:f,notifySpy_:a,startTime_:o,actionId_:D6++,parentActionId_:hp};return hp=v.actionId_,v}function T5(e){hp!==e.actionId_&&Lt(30),hp=e.parentActionId_,e.error_!==void 0&&(Je.suppressReactionErrors=!0),Rp(e.prevAllowStateChanges_),ac(e.prevAllowStateReads_),hi(),e.runAsAction_&&Wo(e.prevDerivation_),Je.suppressReactionErrors=!1}function fv(e,n){var t=Tp(e);try{return n()}finally{Rp(t)}}function Tp(e){var n=Je.allowStateChanges;return Je.allowStateChanges=e,n}function Rp(e){Je.allowStateChanges=e}var Gl=function(e){function n(r,a,o,s,c){var m;return o===void 0&&(o="ObservableValue"),c===void 0&&(c=Us.default),m=e.call(this,o)||this,m.enhancer=void 0,m.name_=void 0,m.equals=void 0,m.hasUnreportedChange_=!1,m.interceptors_=void 0,m.changeListeners_=void 0,m.value_=void 0,m.dehancer=void 0,m.enhancer=a,m.name_=o,m.equals=c,m.value_=a(r,void 0,o),m}y5(n,e);var t=n.prototype;return t.dehanceValue=function(a){return this.dehancer!==void 0?this.dehancer(a):a},t.set=function(a){this.value_,a=this.prepareNewValue_(a),a!==Je.UNCHANGED&&this.setNewValue_(a)},t.prepareNewValue_=function(a){if(Yi(this)){var o=Ki(this,{object:this,type:ro,newValue:a});if(!o)return Je.UNCHANGED;a=o.newValue}return a=this.enhancer(a,this.value_,this.name_),this.equals(this.value_,a)?Je.UNCHANGED:a},t.setNewValue_=function(a){var o=this.value_;this.value_=a,this.reportChanged(),Sa(this)&&Ea(this,{type:ro,object:this,newValue:a,oldValue:o})},t.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},t.intercept_=function(a){return qd(this,a)},t.observe_=function(a,o){return o&&a({observableKind:"value",debugObjectName:this.name_,object:this,type:ro,newValue:this.value_,oldValue:void 0}),Hd(this,a)},t.raw=function(){return this.value_},t.toJSON=function(){return this.get()},t.toString=function(){return this.name_+"["+this.value_+"]"},t.valueOf=function(){return m5(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},n}(Xl),dv=Kl("ObservableValue",Gl),xa=function(){function e(t){this.dependenciesState_=Xt.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Xt.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new gp(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=pp.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,t.get||Lt(31),this.derivation=t.get,this.name_=t.name||"ComputedValue",t.set&&(this.setter_=Wl("ComputedValue-setter",t.set)),this.equals_=t.equals||(t.compareStructural||t.struct?Us.structural:Us.default),this.scope_=t.context,this.requiresReaction_=t.requiresReaction,this.keepAlive_=!!t.keepAlive}var n=e.prototype;return n.onBecomeStale_=function(){Y6(this)},n.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},n.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},n.get=function(){if(this.isComputing&&Lt(32,this.name_,this.derivation),Je.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)X1(this)&&(this.warnAboutUntrackedRead_(),di(),this.value_=this.computeValue_(!1),hi());else if(D5(this),X1(this)){var r=Je.trackingContext;this.keepAlive_&&!r&&(Je.trackingContext=this),this.trackAndCompute()&&W6(this),Je.trackingContext=r}var a=this.value_;if(op(a))throw a.cause;return a},n.set=function(r){if(this.setter_){this.isRunningSetter&&Lt(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,r)}finally{this.isRunningSetter=!1}}else Lt(34,this.name_)},n.trackAndCompute=function(){var r=this.value_,a=this.dependenciesState_===Xt.NOT_TRACKING_,o=this.computeValue_(!0),s=a||op(r)||op(o)||!this.equals_(r,o);return s&&(this.value_=o),s},n.computeValue_=function(r){this.isComputing=!0;var a=Tp(!1),o;if(r)o=R5(this,this.derivation,this.scope_);else if(Je.disableErrorBoundaries===!0)o=this.derivation.call(this.scope_);else try{o=this.derivation.call(this.scope_)}catch(s){o=new gp(s)}return Rp(a),this.isComputing=!1,o},n.suspend_=function(){this.keepAlive_||(Z1(this),this.value_=void 0)},n.observe_=function(r,a){var o=this,s=!0,c=void 0;return pv(function(){var m=o.get();if(!s||a){var f=$s();r({observableKind:"computed",debugObjectName:o.name_,type:ro,object:o,newValue:m,oldValue:c}),Wo(f)}s=!1,c=m})},n.warnAboutUntrackedRead_=function(){},n.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},n.valueOf=function(){return m5(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},bc(e,[{key:"isComputing",get:function(){return Ci(this.flags_,e.isComputingMask_)},set:function(r){this.flags_=ki(this.flags_,e.isComputingMask_,r)}},{key:"isRunningSetter",get:function(){return Ci(this.flags_,e.isRunningSetterMask_)},set:function(r){this.flags_=ki(this.flags_,e.isRunningSetterMask_,r)}},{key:"isBeingObserved",get:function(){return Ci(this.flags_,e.isBeingObservedMask_)},set:function(r){this.flags_=ki(this.flags_,e.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return Ci(this.flags_,e.isPendingUnobservationMask_)},set:function(r){this.flags_=ki(this.flags_,e.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return Ci(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=ki(this.flags_,e.diffValueMask_,r===1)}}])}();xa.isComputingMask_=1;xa.isRunningSetterMask_=2;xa.isBeingObservedMask_=4;xa.isPendingUnobservationMask_=8;xa.diffValueMask_=16;var Hs=Kl("ComputedValue",xa),Xt;(function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"})(Xt||(Xt={}));var pp;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(pp||(pp={}));var gp=function(n){this.cause=void 0,this.cause=n};function op(e){return e instanceof gp}function X1(e){switch(e.dependenciesState_){case Xt.UP_TO_DATE_:return!1;case Xt.NOT_TRACKING_:case Xt.STALE_:return!0;case Xt.POSSIBLY_STALE_:{for(var n=Mp(!0),t=$s(),r=e.observing_,a=r.length,o=0;o<a;o++){var s=r[o];if(Hs(s)){if(Je.disableErrorBoundaries)s.get();else try{s.get()}catch{return Wo(t),ac(n),!0}if(e.dependenciesState_===Xt.STALE_)return Wo(t),ac(n),!0}}return M5(e),Wo(t),ac(n),!1}}}function z6(){return Je.trackingDerivation!==null}function R5(e,n,t){var r=Mp(!0);M5(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++Je.runId;var a=Je.trackingDerivation;Je.trackingDerivation=e,Je.inBatch++;var o;if(Je.disableErrorBoundaries===!0)o=n.call(t);else try{o=n.call(t)}catch(s){o=new gp(s)}return Je.inBatch--,Je.trackingDerivation=a,B6(e),ac(r),o}function B6(e){for(var n=e.observing_,t=e.observing_=e.newObserving_,r=Xt.UP_TO_DATE_,a=0,o=e.unboundDepsCount_,s=0;s<o;s++){var c=t[s];c.diffValue===0&&(c.diffValue=1,a!==s&&(t[a]=c),a++),c.dependenciesState_>r&&(r=c.dependenciesState_)}for(t.length=a,e.newObserving_=null,o=n.length;o--;){var m=n[o];m.diffValue===0&&I5(m,e),m.diffValue=0}for(;a--;){var f=t[a];f.diffValue===1&&(f.diffValue=0,$6(f,e))}r!==Xt.UP_TO_DATE_&&(e.dependenciesState_=r,e.onBecomeStale_())}function Z1(e){var n=e.observing_;e.observing_=[];for(var t=n.length;t--;)I5(n[t],e);e.dependenciesState_=Xt.NOT_TRACKING_}function hv(e){var n=$s();try{return e()}finally{Wo(n)}}function $s(){var e=Je.trackingDerivation;return Je.trackingDerivation=null,e}function Wo(e){Je.trackingDerivation=e}function Mp(e){var n=Je.allowStateReads;return Je.allowStateReads=e,n}function ac(e){Je.allowStateReads=e}function M5(e){if(e.dependenciesState_!==Xt.UP_TO_DATE_){e.dependenciesState_=Xt.UP_TO_DATE_;for(var n=e.observing_,t=n.length;t--;)n[t].lowestObserverState_=Xt.UP_TO_DATE_}}var U6=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED","useProxies"],Od=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},lp=!0,L5=!1,Je=function(){var e=Pp();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(lp=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new Od().version&&(lp=!1),lp?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Od):(setTimeout(function(){L5||Lt(35)},1),new Od)}();function q6(){if((Je.pendingReactions.length||Je.inBatch||Je.isRunningReactions)&&Lt(36),L5=!0,lp){var e=Pp();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),Je=new Od}}function N5(){return Je}function H6(){var e=new Od;for(var n in e)U6.indexOf(n)===-1&&(Je[n]=e[n]);Je.allowStateChanges=!Je.enforceActions}function G6(e){return e.observers_&&e.observers_.size>0}function V6(e){return e.observers_}function $6(e,n){e.observers_.add(n),e.lowestObserverState_>n.dependenciesState_&&(e.lowestObserverState_=n.dependenciesState_)}function I5(e,n){e.observers_.delete(n),e.observers_.size===0&&j5(e)}function j5(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,Je.pendingUnobservations.push(e))}function di(){Je.inBatch++}function hi(){if(--Je.inBatch===0){z5();for(var e=Je.pendingUnobservations,n=0;n<e.length;n++){var t=e[n];t.isPendingUnobservation=!1,t.observers_.size===0&&(t.isBeingObserved&&(t.isBeingObserved=!1,t.onBUO()),t instanceof xa&&t.suspend_())}Je.pendingUnobservations=[]}}function D5(e){var n=Je.trackingDerivation;return n!==null?(n.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=n.runId_,n.newObserving_[n.unboundDepsCount_++]=e,!e.isBeingObserved&&Je.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&Je.inBatch>0&&j5(e),!1)}function F5(e){e.lowestObserverState_!==Xt.STALE_&&(e.lowestObserverState_=Xt.STALE_,e.observers_.forEach(function(n){n.dependenciesState_===Xt.UP_TO_DATE_&&n.onBecomeStale_(),n.dependenciesState_=Xt.STALE_}))}function W6(e){e.lowestObserverState_!==Xt.STALE_&&(e.lowestObserverState_=Xt.STALE_,e.observers_.forEach(function(n){n.dependenciesState_===Xt.POSSIBLY_STALE_?n.dependenciesState_=Xt.STALE_:n.dependenciesState_===Xt.UP_TO_DATE_&&(e.lowestObserverState_=Xt.UP_TO_DATE_)}))}function Y6(e){e.lowestObserverState_===Xt.UP_TO_DATE_&&(e.lowestObserverState_=Xt.POSSIBLY_STALE_,e.observers_.forEach(function(n){n.dependenciesState_===Xt.UP_TO_DATE_&&(n.dependenciesState_=Xt.POSSIBLY_STALE_,n.onBecomeStale_())}))}var Oa=function(){function e(t,r,a,o){t===void 0&&(t="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Xt.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=pp.NONE,this.name_=t,this.onInvalidate_=r,this.errorHandler_=a,this.requiresObservable_=o}var n=e.prototype;return n.onBecomeStale_=function(){this.schedule_()},n.schedule_=function(){this.isScheduled||(this.isScheduled=!0,Je.pendingReactions.push(this),z5())},n.runReaction_=function(){if(!this.isDisposed){di(),this.isScheduled=!1;var r=Je.trackingContext;if(Je.trackingContext=this,X1(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(a){this.reportExceptionInDerivation_(a)}}Je.trackingContext=r,hi()}},n.track=function(r){if(!this.isDisposed){di(),this.isRunning=!0;var a=Je.trackingContext;Je.trackingContext=this;var o=R5(this,r,void 0);Je.trackingContext=a,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&Z1(this),op(o)&&this.reportExceptionInDerivation_(o.cause),hi()}},n.reportExceptionInDerivation_=function(r){var a=this;if(this.errorHandler_){this.errorHandler_(r,this);return}if(Je.disableErrorBoundaries)throw r;var o="[mobx] uncaught error in '"+this+"'";Je.suppressReactionErrors||console.error(o,r),Je.globalReactionErrorHandlers.forEach(function(s){return s(r,a)})},n.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(di(),Z1(this),hi()))},n.getDisposer_=function(r){var a=this,o=function s(){a.dispose(),r==null||r.removeEventListener==null||r.removeEventListener("abort",s)};return r==null||r.addEventListener==null||r.addEventListener("abort",o),o[bt]=this,o},n.toString=function(){return"Reaction["+this.name_+"]"},n.trace=function(r){},bc(e,[{key:"isDisposed",get:function(){return Ci(this.flags_,e.isDisposedMask_)},set:function(r){this.flags_=ki(this.flags_,e.isDisposedMask_,r)}},{key:"isScheduled",get:function(){return Ci(this.flags_,e.isScheduledMask_)},set:function(r){this.flags_=ki(this.flags_,e.isScheduledMask_,r)}},{key:"isTrackPending",get:function(){return Ci(this.flags_,e.isTrackPendingMask_)},set:function(r){this.flags_=ki(this.flags_,e.isTrackPendingMask_,r)}},{key:"isRunning",get:function(){return Ci(this.flags_,e.isRunningMask_)},set:function(r){this.flags_=ki(this.flags_,e.isRunningMask_,r)}},{key:"diffValue",get:function(){return Ci(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=ki(this.flags_,e.diffValueMask_,r===1)}}])}();Oa.isDisposedMask_=1;Oa.isScheduledMask_=2;Oa.isTrackPendingMask_=4;Oa.isRunningMask_=8;Oa.diffValueMask_=16;function K6(e){return Je.globalReactionErrorHandlers.push(e),function(){var n=Je.globalReactionErrorHandlers.indexOf(e);n>=0&&Je.globalReactionErrorHandlers.splice(n,1)}}var X6=100,Q1=function(n){return n()};function z5(){Je.inBatch>0||Je.isRunningReactions||Q1(Z6)}function Z6(){Je.isRunningReactions=!0;for(var e=Je.pendingReactions,n=0;e.length>0;){++n===X6&&(console.error("[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var t=e.splice(0),r=0,a=t.length;r<a;r++)t[r].runReaction_()}Je.isRunningReactions=!1}var vp=Kl("Reaction",Oa);function Q6(e){var n=Q1;Q1=function(r){return e(function(){return n(r)})}}function Pd(){return!1}function B5(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var U5="action",J6="action.bound",q5="autoAction",e8="autoAction.bound",H5="<unnamed action>",J1=Ud(U5),t8=Ud(J6,{bound:!0}),ev=Ud(q5,{autoAction:!0}),r8=Ud(e8,{autoAction:!0,bound:!0});function G5(e){var n=function(r,a){if(Ai(r))return Wl(r.name||H5,r,e);if(Ai(a))return Wl(r,a,e);if(Bd(a))return(e?ev:J1).decorate_20223_(r,a);if(Bs(a))return zd(r,a,e?ev:J1);if(Bs(r))return _a(Ud(e?q5:U5,{name:r,autoAction:e}))};return n}var Xr=G5(!1);Object.assign(Xr,J1);var sc=G5(!0);Object.assign(sc,ev);Xr.bound=_a(t8);sc.bound=_a(r8);function uc(e){return k5(e.name||H5,!1,e,this,void 0)}function cc(e){return Ai(e)&&e.isMobxAction===!0}function pv(e,n){var t,r,a,o;n===void 0&&(n=sv);var s=(t=(r=n)==null?void 0:r.name)!=null?t:"Autorun",c=!n.scheduler&&!n.delay,m;if(c)m=new Oa(s,function(){this.track(y)},n.onError,n.requiresObservable);else{var f=V5(n),v=!1;m=new Oa(s,function(){v||(v=!0,f(function(){v=!1,m.isDisposed||m.track(y)}))},n.onError,n.requiresObservable)}function y(){e(m)}return(a=n)!=null&&(a=a.signal)!=null&&a.aborted||m.schedule_(),m.getDisposer_((o=n)==null?void 0:o.signal)}var n8=function(n){return n()};function V5(e){return e.scheduler?e.scheduler:e.delay?function(n){return setTimeout(n,e.delay)}:n8}function $5(e,n,t){var r,a,o;t===void 0&&(t=sv);var s=(r=t.name)!=null?r:"Reaction",c=Xr(s,t.onError?i8(t.onError,n):n),m=!t.scheduler&&!t.delay,f=V5(t),v=!0,y=!1,E,w=t.compareStructural?Us.structural:t.equals||Us.default,S=new Oa(s,function(){v||m?x():y||(y=!0,f(x))},t.onError,t.requiresObservable);function x(){if(y=!1,!S.isDisposed){var _=!1,b=E;S.track(function(){var g=fv(!1,function(){return e(S)});_=v||!w(E,g),E=g}),(v&&t.fireImmediately||!v&&_)&&c(E,b,S),v=!1}}return(a=t)!=null&&(a=a.signal)!=null&&a.aborted||S.schedule_(),S.getDisposer_((o=t)==null?void 0:o.signal)}function i8(e,n){return function(){try{return n.apply(this,arguments)}catch(t){e.call(this,t)}}}var a8="onBO",o8="onBUO";function W5(e,n,t){return Y5(a8,e,n,t)}function gv(e,n,t){return Y5(o8,e,n,t)}function Y5(e,n,t,r){var a=typeof r=="function"?no(n,t):no(n),o=Ai(r)?r:t,s=e+"L";return a[s]?a[s].add(o):a[s]=new Set([o]),function(){var c=a[s];c&&(c.delete(o),c.size===0&&delete a[s])}}var l8="never",ep="always",s8="observed";function K5(e){e.isolateGlobalState===!0&&q6();var n=e.useProxies,t=e.enforceActions;if(n!==void 0&&(Je.useProxies=n===ep?!0:n===l8?!1:typeof Proxy<"u"),n==="ifavailable"&&(Je.verifyProxies=!0),t!==void 0){var r=t===ep?ep:t===s8;Je.enforceActions=r,Je.allowStateChanges=!(r===!0||r===ep)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(a){a in e&&(Je[a]=!!e[a])}),Je.allowStateReads=!Je.observableRequiresReaction,e.reactionScheduler&&Q6(e.reactionScheduler)}function vv(e,n,t,r){var a=U_(n);return Zl(function(){var o=Ws(e,r)[bt];lc(a).forEach(function(s){o.extend_(s,a[s],t&&s in t?t[s]:!0)})}),e}function X5(e,n){return Z5(no(e,n))}function Z5(e){var n={name:e.name_};return e.observing_&&e.observing_.length>0&&(n.dependencies=c8(e.observing_).map(Z5)),n}function u8(e,n){return Q5(no(e,n))}function Q5(e){var n={name:e.name_};return G6(e)&&(n.observers=Array.from(V6(e)).map(Q5)),n}function c8(e){return Array.from(new Set(e))}var f8=0;function Lp(){this.message="FLOW_CANCELLED"}Lp.prototype=Object.create(Error.prototype);function d8(e){return e instanceof Lp}var Lg=_5("flow"),h8=_5("flow.bound",{bound:!0}),Gs=Object.assign(function(n,t){if(Bd(t))return Lg.decorate_20223_(n,t);if(Bs(t))return zd(n,t,Lg);var r=n,a=r.name||"<unnamed flow>",o=function(){var c=this,m=arguments,f=++f8,v=Xr(a+" - runid: "+f+" - init",r).apply(c,m),y,E=void 0,w=new Promise(function(S,x){var _=0;y=x;function b(d){E=void 0;var P;try{P=Xr(a+" - runid: "+f+" - yield "+_++,v.next).call(v,d)}catch(M){return x(M)}h(P)}function g(d){E=void 0;var P;try{P=Xr(a+" - runid: "+f+" - yield "+_++,v.throw).call(v,d)}catch(M){return x(M)}h(P)}function h(d){if(Ai(d==null?void 0:d.then)){d.then(h,x);return}return d.done?S(d.value):(E=Promise.resolve(d.value),E.then(b,g))}b(void 0)});return w.cancel=Xr(a+" - runid: "+f+" - cancel",function(){try{E&&Hm(E);var S=v.return(void 0),x=Promise.resolve(S.value);x.then(rc,rc),Hm(x),y(new Lp)}catch(_){y(_)}}),w};return o.isMobXFlow=!0,o},Lg);Gs.bound=_a(h8);function Hm(e){Ai(e.cancel)&&e.cancel()}function p8(e){return e}function fc(e){return(e==null?void 0:e.isMobXFlow)===!0}function mv(e,n,t){var r;return Rn(e)||Qn(e)||dv(e)?r=Pa(e):yn(e)&&(r=Pa(e,n)),r.dehancer=typeof n=="function"?n:t,function(){r.dehancer=void 0}}function Np(e,n,t){return Ai(t)?v8(e,n,t):g8(e,n)}function g8(e,n){return Pa(e).intercept_(n)}function v8(e,n,t){return Pa(e,n).intercept_(t)}function J5(e,n){if(n===void 0)return Hs(e);if(yn(e)===!1||!e[bt].values_.has(n))return!1;var t=no(e,n);return Hs(t)}function m8(e){return J5(e)}function ew(e,n){return J5(e,n)}function tw(e,n){return e?n!==void 0?yn(e)?e[bt].values_.has(n):!1:yn(e)||!!e[bt]||uv(e)||vp(e)||Hs(e):!1}function Ip(e){return tw(e)}function rw(e,n){return tw(e,n)}function Td(e){if(yn(e))return e[bt].keys_();if(Rn(e)||an(e))return Array.from(e.keys());if(Qn(e))return e.map(function(n,t){return t});Lt(5)}function yv(e){if(yn(e))return Td(e).map(function(n){return e[n]});if(Rn(e))return Td(e).map(function(n){return e.get(n)});if(an(e))return Array.from(e.values());if(Qn(e))return e.slice();Lt(6)}function nw(e){if(yn(e))return Td(e).map(function(n){return[n,e[n]]});if(Rn(e))return Td(e).map(function(n){return[n,e.get(n)]});if(an(e))return Array.from(e.entries());if(Qn(e))return e.map(function(n,t){return[t,n]});Lt(7)}function bv(e,n,t){if(arguments.length===2&&!an(e)){di();var r=n;try{for(var a in r)bv(e,a,r[a])}finally{hi()}return}yn(e)?e[bt].set_(n,t):Rn(e)?e.set(n,t):an(e)?e.add(n):Qn(e)?(typeof n!="number"&&(n=parseInt(n,10)),n<0&&Lt("Invalid index: '"+n+"'"),di(),n>=e.length&&(e.length=n+1),e[n]=t,hi()):Lt(8)}function y8(e,n){yn(e)?e[bt].delete_(n):Rn(e)||an(e)?e.delete(n):Qn(e)?(typeof n!="number"&&(n=parseInt(n,10)),e.splice(n,1)):Lt(9)}function iw(e,n){if(yn(e))return e[bt].has_(n);if(Rn(e))return e.has(n);if(an(e))return e.has(n);if(Qn(e))return n>=0&&n<e.length;Lt(10)}function b8(e,n){if(iw(e,n)){if(yn(e))return e[bt].get_(n);if(Rn(e))return e.get(n);if(Qn(e))return e[n];Lt(11)}}function wv(e,n,t){if(yn(e))return e[bt].defineProperty_(n,t);Lt(39)}function aw(e){if(yn(e))return e[bt].ownKeys_();Lt(38)}function jp(e,n,t,r){return Ai(t)?_8(e,n,t,r):w8(e,n,t)}function w8(e,n,t){return Pa(e).observe_(n,t)}function _8(e,n,t,r){return Pa(e,n).observe_(t,r)}function tp(e,n,t){return e.set(n,t),t}function ec(e,n){if(e==null||typeof e!="object"||e instanceof Date||!Ip(e))return e;if(dv(e)||Hs(e))return ec(e.get(),n);if(n.has(e))return n.get(e);if(Qn(e)){var t=tp(n,e,new Array(e.length));return e.forEach(function(s,c){t[c]=ec(s,n)}),t}if(an(e)){var r=tp(n,e,new Set);return e.forEach(function(s){r.add(ec(s,n))}),r}if(Rn(e)){var a=tp(n,e,new Map);return e.forEach(function(s,c){a.set(c,ec(s,n))}),a}else{var o=tp(n,e,{});return aw(e).forEach(function(s){Dd.propertyIsEnumerable.call(e,s)&&(o[s]=ec(e[s],n))}),o}}function S8(e,n){return ec(e,new Map)}function E8(){}function Ja(e,n){n===void 0&&(n=void 0),di();try{return e.apply(n)}finally{hi()}}function tv(e,n,t){return arguments.length===1||n&&typeof n=="object"?x8(e,n):ow(e,n,t||{})}function ow(e,n,t){var r;if(typeof t.timeout=="number"){var a=new Error("WHEN_TIMEOUT");r=setTimeout(function(){if(!s[bt].isDisposed)if(s(),t.onError)t.onError(a);else throw a},t.timeout)}t.name="When";var o=Wl("When-effect",n),s=pv(function(c){var m=fv(!1,e);m&&(c.dispose(),r&&clearTimeout(r),o())},t);return s}function x8(e,n){var t;if(n!=null&&(t=n.signal)!=null&&t.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var r,a,o=new Promise(function(s,c){var m,f=ow(e,s,$l({},n,{onError:c}));r=function(){f(),c(new Error("WHEN_CANCELLED"))},a=function(){f(),c(new Error("WHEN_ABORTED"))},n==null||(m=n.signal)==null||m.addEventListener==null||m.addEventListener("abort",a)}).finally(function(){var s;return n==null||(s=n.signal)==null||s.removeEventListener==null?void 0:s.removeEventListener("abort",a)});return o.cancel=r,o}function Zu(e){return e[bt]}var O8={has:function(n,t){return Zu(n).has_(t)},get:function(n,t){return Zu(n).get_(t)},set:function(n,t,r){var a;return Bs(t)?(a=Zu(n).set_(t,r,!0))!=null?a:!0:!1},deleteProperty:function(n,t){var r;return Bs(t)?(r=Zu(n).delete_(t,!0))!=null?r:!0:!1},defineProperty:function(n,t,r){var a;return(a=Zu(n).defineProperty_(t,r))!=null?a:!0},ownKeys:function(n){return Zu(n).ownKeys_()},preventExtensions:function(n){Lt(13)}};function P8(e,n){var t,r;return d5(),e=Ws(e,n),(r=(t=e[bt]).proxy_)!=null?r:t.proxy_=new Proxy(e,O8)}function Yi(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function qd(e,n){var t=e.interceptors_||(e.interceptors_=[]);return t.push(n),h5(function(){var r=t.indexOf(n);r!==-1&&t.splice(r,1)})}function Ki(e,n){var t=$s();try{for(var r=[].concat(e.interceptors_||[]),a=0,o=r.length;a<o&&(n=r[a](n),n&&!n.type&&Lt(14),!!n);a++);return n}finally{Wo(t)}}function Sa(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function Hd(e,n){var t=e.changeListeners_||(e.changeListeners_=[]);return t.push(n),h5(function(){var r=t.indexOf(n);r!==-1&&t.splice(r,1)})}function Ea(e,n){var t=$s(),r=e.changeListeners_;if(r){r=r.slice();for(var a=0,o=r.length;a<o;a++)r[a](n);Wo(t)}}function _v(e,n,t){return Zl(function(){var r,a=Ws(e,t)[bt];(r=n)!=null||(n=$_(e)),lc(n).forEach(function(o){return a.make_(o,n[o])})}),e}var Ng=Symbol("mobx-keys");function C8(e,n,t){return Ko(e)?vv(e,e,n,t):(Zl(function(){var r=Ws(e,t)[bt];if(!e[Ng]){var a=Object.getPrototypeOf(e),o=new Set([].concat(lc(e),lc(a)));o.delete("constructor"),o.delete(bt),Fd(a,Ng,o)}e[Ng].forEach(function(s){return r.make_(s,n&&s in n?n[s]:!0)})}),e)}var Gm="splice",ro="update",k8=1e4,A8={get:function(n,t){var r=n[bt];return t===bt?r:t==="length"?r.getArrayLength_():typeof t=="string"&&!isNaN(t)?r.get_(parseInt(t)):$o(mp,t)?mp[t]:n[t]},set:function(n,t,r){var a=n[bt];return t==="length"&&a.setArrayLength_(r),typeof t=="symbol"||isNaN(t)?n[t]=r:a.set_(parseInt(t),r),!0},preventExtensions:function(){Lt(15)}},Sv=function(){function e(t,r,a,o){t===void 0&&(t="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=a,this.legacyMode_=o,this.atom_=new Xl(t),this.enhancer_=function(s,c){return r(s,c,"ObservableArray[..]")}}var n=e.prototype;return n.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},n.dehanceValues_=function(r){return this.dehancer!==void 0&&r.length>0?r.map(this.dehancer):r},n.intercept_=function(r){return qd(this,r)},n.observe_=function(r,a){return a===void 0&&(a=!1),a&&r({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),Hd(this,r)},n.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},n.setArrayLength_=function(r){(typeof r!="number"||isNaN(r)||r<0)&&Lt("Out of range: "+r);var a=this.values_.length;if(r!==a)if(r>a){for(var o=new Array(r-a),s=0;s<r-a;s++)o[s]=void 0;this.spliceWithArray_(a,0,o)}else this.spliceWithArray_(r,a-r)},n.updateArrayLength_=function(r,a){r!==this.lastKnownLength_&&Lt(16),this.lastKnownLength_+=a,this.legacyMode_&&a>0&&fw(r+a+1)},n.spliceWithArray_=function(r,a,o){var s=this;this.atom_;var c=this.values_.length;if(r===void 0?r=0:r>c?r=c:r<0&&(r=Math.max(0,c+r)),arguments.length===1?a=c-r:a==null?a=0:a=Math.max(0,Math.min(a,c-r)),o===void 0&&(o=$1),Yi(this)){var m=Ki(this,{object:this.proxy_,type:Gm,index:r,removedCount:a,added:o});if(!m)return $1;a=m.removedCount,o=m.added}if(o=o.length===0?o:o.map(function(y){return s.enhancer_(y,void 0)}),this.legacyMode_){var f=o.length-a;this.updateArrayLength_(c,f)}var v=this.spliceItemsIntoValues_(r,a,o);return(a!==0||o.length!==0)&&this.notifyArraySplice_(r,o,v),this.dehanceValues_(v)},n.spliceItemsIntoValues_=function(r,a,o){if(o.length<k8){var s;return(s=this.values_).splice.apply(s,[r,a].concat(o))}else{var c=this.values_.slice(r,r+a),m=this.values_.slice(r+a);this.values_.length+=o.length-a;for(var f=0;f<o.length;f++)this.values_[r+f]=o[f];for(var v=0;v<m.length;v++)this.values_[r+o.length+v]=m[v];return c}},n.notifyArrayChildUpdate_=function(r,a,o){var s=!this.owned_&&Pd(),c=Sa(this),m=c||s?{observableKind:"array",object:this.proxy_,type:ro,debugObjectName:this.atom_.name_,index:r,newValue:a,oldValue:o}:null;this.atom_.reportChanged(),c&&Ea(this,m)},n.notifyArraySplice_=function(r,a,o){var s=!this.owned_&&Pd(),c=Sa(this),m=c||s?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:Gm,index:r,removed:o,added:a,removedCount:o.length,addedCount:a.length}:null;this.atom_.reportChanged(),c&&Ea(this,m)},n.get_=function(r){if(this.legacyMode_&&r>=this.values_.length){console.warn("[mobx] Out of bounds read: "+r);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[r])},n.set_=function(r,a){var o=this.values_;if(this.legacyMode_&&r>o.length&&Lt(17,r,o.length),r<o.length){this.atom_;var s=o[r];if(Yi(this)){var c=Ki(this,{type:ro,object:this.proxy_,index:r,newValue:a});if(!c)return;a=c.newValue}a=this.enhancer_(a,s);var m=a!==s;m&&(o[r]=a,this.notifyArrayChildUpdate_(r,a,s))}else{for(var f=new Array(r+1-o.length),v=0;v<f.length-1;v++)f[v]=void 0;f[f.length-1]=a,this.spliceWithArray_(o.length,0,f)}},e}();function T8(e,n,t,r){return t===void 0&&(t="ObservableArray"),r===void 0&&(r=!1),d5(),Zl(function(){var a=new Sv(t,n,r,!1);g5(a.values_,bt,a);var o=new Proxy(a.values_,A8);return a.proxy_=o,e&&e.length&&a.spliceWithArray_(0,0,e),o})}var mp={clear:function(){return this.splice(0)},replace:function(n){var t=this[bt];return t.spliceWithArray_(0,t.values_.length,n)},toJSON:function(){return this.slice()},splice:function(n,t){for(var r=arguments.length,a=new Array(r>2?r-2:0),o=2;o<r;o++)a[o-2]=arguments[o];var s=this[bt];switch(arguments.length){case 0:return[];case 1:return s.spliceWithArray_(n);case 2:return s.spliceWithArray_(n,t)}return s.spliceWithArray_(n,t,a)},spliceWithArray:function(n,t,r){return this[bt].spliceWithArray_(n,t,r)},push:function(){for(var n=this[bt],t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return n.spliceWithArray_(n.values_.length,0,r),n.values_.length},pop:function(){return this.splice(Math.max(this[bt].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var n=this[bt],t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return n.spliceWithArray_(0,0,r),n.values_.length},reverse:function(){return Je.trackingDerivation&&Lt(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){Je.trackingDerivation&&Lt(37,"sort");var n=this.slice();return n.sort.apply(n,arguments),this.replace(n),this},remove:function(n){var t=this[bt],r=t.dehanceValues_(t.values_).indexOf(n);return r>-1?(this.splice(r,1),!0):!1}};br("at",Ti);br("concat",Ti);br("flat",Ti);br("includes",Ti);br("indexOf",Ti);br("join",Ti);br("lastIndexOf",Ti);br("slice",Ti);br("toString",Ti);br("toLocaleString",Ti);br("toSorted",Ti);br("toSpliced",Ti);br("with",Ti);br("every",Ca);br("filter",Ca);br("find",Ca);br("findIndex",Ca);br("findLast",Ca);br("findLastIndex",Ca);br("flatMap",Ca);br("forEach",Ca);br("map",Ca);br("some",Ca);br("toReversed",Ca);br("reduce",lw);br("reduceRight",lw);function br(e,n){typeof Array.prototype[e]=="function"&&(mp[e]=n(e))}function Ti(e){return function(){var n=this[bt];n.atom_.reportObserved();var t=n.dehanceValues_(n.values_);return t[e].apply(t,arguments)}}function Ca(e){return function(n,t){var r=this,a=this[bt];a.atom_.reportObserved();var o=a.dehanceValues_(a.values_);return o[e](function(s,c){return n.call(t,s,c,r)})}}function lw(e){return function(){var n=this,t=this[bt];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_),a=arguments[0];return arguments[0]=function(o,s,c){return a(o,s,c,n)},r[e].apply(r,arguments)}}var R8=Kl("ObservableArrayAdministration",Sv);function Qn(e){return Cp(e)&&R8(e[bt])}var M8={},Hl="add",yp="delete",Dp=function(){function e(t,r,a){var o=this;r===void 0&&(r=qs),a===void 0&&(a="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[bt]=M8,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=r,this.name_=a,Ai(Map)||Lt(18),Zl(function(){o.keysAtom_=Ad("ObservableMap.keys()"),o.data_=new Map,o.hasMap_=new Map,t&&o.merge(t)})}var n=e.prototype;return n.has_=function(r){return this.data_.has(r)},n.has=function(r){var a=this;if(!Je.trackingDerivation)return this.has_(r);var o=this.hasMap_.get(r);if(!o){var s=o=new Gl(this.has_(r),kp,"ObservableMap.key?",!1);this.hasMap_.set(r,s),gv(s,function(){return a.hasMap_.delete(r)})}return o.get()},n.set=function(r,a){var o=this.has_(r);if(Yi(this)){var s=Ki(this,{type:o?ro:Hl,object:this,newValue:a,name:r});if(!s)return this;a=s.newValue}return o?this.updateValue_(r,a):this.addValue_(r,a),this},n.delete=function(r){var a=this;if(this.keysAtom_,Yi(this)){var o=Ki(this,{type:yp,object:this,name:r});if(!o)return!1}if(this.has_(r)){var s=Pd(),c=Sa(this),m=c||s?{observableKind:"map",debugObjectName:this.name_,type:yp,object:this,oldValue:this.data_.get(r).value_,name:r}:null;return Ja(function(){var f;a.keysAtom_.reportChanged(),(f=a.hasMap_.get(r))==null||f.setNewValue_(!1);var v=a.data_.get(r);v.setNewValue_(void 0),a.data_.delete(r)}),c&&Ea(this,m),!0}return!1},n.updateValue_=function(r,a){var o=this.data_.get(r);if(a=o.prepareNewValue_(a),a!==Je.UNCHANGED){var s=Pd(),c=Sa(this),m=c||s?{observableKind:"map",debugObjectName:this.name_,type:ro,object:this,oldValue:o.value_,name:r,newValue:a}:null;o.setNewValue_(a),c&&Ea(this,m)}},n.addValue_=function(r,a){var o=this;this.keysAtom_,Ja(function(){var f,v=new Gl(a,o.enhancer_,"ObservableMap.key",!1);o.data_.set(r,v),a=v.value_,(f=o.hasMap_.get(r))==null||f.setNewValue_(!0),o.keysAtom_.reportChanged()});var s=Pd(),c=Sa(this),m=c||s?{observableKind:"map",debugObjectName:this.name_,type:Hl,object:this,name:r,newValue:a}:null;c&&Ea(this,m)},n.get=function(r){return this.has(r)?this.dehanceValue_(this.data_.get(r).get()):this.dehanceValue_(void 0)},n.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},n.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},n.values=function(){var r=this,a=this.keys();return Vm({next:function(){var s=a.next(),c=s.done,m=s.value;return{done:c,value:c?void 0:r.get(m)}}})},n.entries=function(){var r=this,a=this.keys();return Vm({next:function(){var s=a.next(),c=s.done,m=s.value;return{done:c,value:c?void 0:[m,r.get(m)]}}})},n[Symbol.iterator]=function(){return this.entries()},n.forEach=function(r,a){for(var o=nc(this),s;!(s=o()).done;){var c=s.value,m=c[0],f=c[1];r.call(a,f,m,this)}},n.merge=function(r){var a=this;return Rn(r)&&(r=new Map(r)),Ja(function(){Ko(r)?B_(r).forEach(function(o){return a.set(o,r[o])}):Array.isArray(r)?r.forEach(function(o){var s=o[0],c=o[1];return a.set(s,c)}):yc(r)?(z_(r)||Lt(19,r),r.forEach(function(o,s){return a.set(s,o)})):r!=null&&Lt(20,r)}),this},n.clear=function(){var r=this;Ja(function(){hv(function(){for(var a=nc(r.keys()),o;!(o=a()).done;){var s=o.value;r.delete(s)}})})},n.replace=function(r){var a=this;return Ja(function(){for(var o=L8(r),s=new Map,c=!1,m=nc(a.data_.keys()),f;!(f=m()).done;){var v=f.value;if(!o.has(v)){var y=a.delete(v);if(y)c=!0;else{var E=a.data_.get(v);s.set(v,E)}}}for(var w=nc(o.entries()),S;!(S=w()).done;){var x=S.value,_=x[0],b=x[1],g=a.data_.has(_);if(a.set(_,b),a.data_.has(_)){var h=a.data_.get(_);s.set(_,h),g||(c=!0)}}if(!c)if(a.data_.size!==s.size)a.keysAtom_.reportChanged();else for(var d=a.data_.keys(),P=s.keys(),M=d.next(),T=P.next();!M.done;){if(M.value!==T.value){a.keysAtom_.reportChanged();break}M=d.next(),T=P.next()}a.data_=s}),this},n.toString=function(){return"[object ObservableMap]"},n.toJSON=function(){return Array.from(this)},n.observe_=function(r,a){return Hd(this,r)},n.intercept_=function(r){return qd(this,r)},bc(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),Rn=Kl("ObservableMap",Dp);function Vm(e){return e[Symbol.toStringTag]="MapIterator",Pv(e)}function L8(e){if(yc(e)||Rn(e))return e;if(Array.isArray(e))return new Map(e);if(Ko(e)){var n=new Map;for(var t in e)n.set(t,e[t]);return n}else return Lt(21,e)}var N8={},Ev=function(){function e(t,r,a){var o=this;r===void 0&&(r=qs),a===void 0&&(a="ObservableSet"),this.name_=void 0,this[bt]=N8,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=a,Ai(Set)||Lt(22),this.enhancer_=function(s,c){return r(s,c,a)},Zl(function(){o.atom_=Ad(o.name_),t&&o.replace(t)})}var n=e.prototype;return n.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},n.clear=function(){var r=this;Ja(function(){hv(function(){for(var a=nc(r.data_.values()),o;!(o=a()).done;){var s=o.value;r.delete(s)}})})},n.forEach=function(r,a){for(var o=nc(this),s;!(s=o()).done;){var c=s.value;r.call(a,c,c,this)}},n.add=function(r){var a=this;if(this.atom_,Yi(this)){var o=Ki(this,{type:Hl,object:this,newValue:r});if(!o)return this;r=o.newValue}if(!this.has(r)){Ja(function(){a.data_.add(a.enhancer_(r,void 0)),a.atom_.reportChanged()});var s=!1,c=Sa(this),m=c||s?{observableKind:"set",debugObjectName:this.name_,type:Hl,object:this,newValue:r}:null;c&&Ea(this,m)}return this},n.delete=function(r){var a=this;if(Yi(this)){var o=Ki(this,{type:yp,object:this,oldValue:r});if(!o)return!1}if(this.has(r)){var s=!1,c=Sa(this),m=c||s?{observableKind:"set",debugObjectName:this.name_,type:yp,object:this,oldValue:r}:null;return Ja(function(){a.atom_.reportChanged(),a.data_.delete(r)}),c&&Ea(this,m),!0}return!1},n.has=function(r){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(r))},n.entries=function(){var r=this.values();return $m({next:function(){var o=r.next(),s=o.value,c=o.done;return c?{value:void 0,done:c}:{value:[s,s],done:c}}})},n.keys=function(){return this.values()},n.values=function(){this.atom_.reportObserved();var r=this,a=this.data_.values();return $m({next:function(){var s=a.next(),c=s.value,m=s.done;return m?{value:void 0,done:m}:{value:r.dehanceValue_(c),done:m}}})},n.intersection=function(r){if(Vo(r)&&!an(r))return r.intersection(this);var a=new Set(this);return a.intersection(r)},n.union=function(r){if(Vo(r)&&!an(r))return r.union(this);var a=new Set(this);return a.union(r)},n.difference=function(r){return new Set(this).difference(r)},n.symmetricDifference=function(r){if(Vo(r)&&!an(r))return r.symmetricDifference(this);var a=new Set(this);return a.symmetricDifference(r)},n.isSubsetOf=function(r){return new Set(this).isSubsetOf(r)},n.isSupersetOf=function(r){return new Set(this).isSupersetOf(r)},n.isDisjointFrom=function(r){if(Vo(r)&&!an(r))return r.isDisjointFrom(this);var a=new Set(this);return a.isDisjointFrom(r)},n.replace=function(r){var a=this;return an(r)&&(r=new Set(r)),Ja(function(){Array.isArray(r)?(a.clear(),r.forEach(function(o){return a.add(o)})):Vo(r)?(a.clear(),r.forEach(function(o){return a.add(o)})):r!=null&&Lt("Cannot initialize set from "+r)}),this},n.observe_=function(r,a){return Hd(this,r)},n.intercept_=function(r){return qd(this,r)},n.toJSON=function(){return Array.from(this)},n.toString=function(){return"[object ObservableSet]"},n[Symbol.iterator]=function(){return this.values()},bc(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),an=Kl("ObservableSet",Ev);function $m(e){return e[Symbol.toStringTag]="SetIterator",Pv(e)}var Wm=Object.create(null),Ym="remove",sw=function(){function e(t,r,a,o){r===void 0&&(r=new Map),o===void 0&&(o=_6),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=t,this.values_=r,this.name_=a,this.defaultAnnotation_=o,this.keysAtom_=new Xl("ObservableObject.keys"),this.isPlainObject_=Ko(this.target_)}var n=e.prototype;return n.getObservablePropValue_=function(r){return this.values_.get(r).get()},n.setObservablePropValue_=function(r,a){var o=this.values_.get(r);if(o instanceof xa)return o.set(a),!0;if(Yi(this)){var s=Ki(this,{type:ro,object:this.proxy_||this.target_,name:r,newValue:a});if(!s)return null;a=s.newValue}if(a=o.prepareNewValue_(a),a!==Je.UNCHANGED){var c=Sa(this),m=!1,f=c||m?{type:ro,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:o.value_,name:r,newValue:a}:null;o.setNewValue_(a),c&&Ea(this,f)}return!0},n.get_=function(r){return Je.trackingDerivation&&!$o(this.target_,r)&&this.has_(r),this.target_[r]},n.set_=function(r,a,o){return o===void 0&&(o=!1),$o(this.target_,r)?this.values_.has(r)?this.setObservablePropValue_(r,a):o?Reflect.set(this.target_,r,a):(this.target_[r]=a,!0):this.extend_(r,{value:a,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,o)},n.has_=function(r){if(!Je.trackingDerivation)return r in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var a=this.pendingKeys_.get(r);return a||(a=new Gl(r in this.target_,kp,"ObservableObject.key?",!1),this.pendingKeys_.set(r,a)),a.get()},n.make_=function(r,a){if(a===!0&&(a=this.defaultAnnotation_),a!==!1){if(!(r in this.target_)){var o;if((o=this.target_[eo])!=null&&o[r])return;Lt(1,a.annotationType_,this.name_+"."+r.toString())}for(var s=this.target_;s&&s!==Dd;){var c=dp(s,r);if(c){var m=a.make_(this,r,c,s);if(m===0)return;if(m===1)break}s=Object.getPrototypeOf(s)}Xm(this,a,r)}},n.extend_=function(r,a,o,s){if(s===void 0&&(s=!1),o===!0&&(o=this.defaultAnnotation_),o===!1)return this.defineProperty_(r,a,s);var c=o.extend_(this,r,a,s);return c&&Xm(this,o,r),c},n.defineProperty_=function(r,a,o){o===void 0&&(o=!1),this.keysAtom_;try{di();var s=this.delete_(r);if(!s)return s;if(Yi(this)){var c=Ki(this,{object:this.proxy_||this.target_,name:r,type:Hl,newValue:a.value});if(!c)return null;var m=c.newValue;a.value!==m&&(a=$l({},a,{value:m}))}if(o){if(!Reflect.defineProperty(this.target_,r,a))return!1}else to(this.target_,r,a);this.notifyPropertyAddition_(r,a.value)}finally{hi()}return!0},n.defineObservableProperty_=function(r,a,o,s){s===void 0&&(s=!1),this.keysAtom_;try{di();var c=this.delete_(r);if(!c)return c;if(Yi(this)){var m=Ki(this,{object:this.proxy_||this.target_,name:r,type:Hl,newValue:a});if(!m)return null;a=m.newValue}var f=Km(r),v={configurable:Je.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:f.get,set:f.set};if(s){if(!Reflect.defineProperty(this.target_,r,v))return!1}else to(this.target_,r,v);var y=new Gl(a,o,"ObservableObject.key",!1);this.values_.set(r,y),this.notifyPropertyAddition_(r,y.value_)}finally{hi()}return!0},n.defineComputedProperty_=function(r,a,o){o===void 0&&(o=!1),this.keysAtom_;try{di();var s=this.delete_(r);if(!s)return s;if(Yi(this)){var c=Ki(this,{object:this.proxy_||this.target_,name:r,type:Hl,newValue:void 0});if(!c)return null}a.name||(a.name="ObservableObject.key"),a.context=this.proxy_||this.target_;var m=Km(r),f={configurable:Je.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:m.get,set:m.set};if(o){if(!Reflect.defineProperty(this.target_,r,f))return!1}else to(this.target_,r,f);this.values_.set(r,new xa(a)),this.notifyPropertyAddition_(r,void 0)}finally{hi()}return!0},n.delete_=function(r,a){if(a===void 0&&(a=!1),this.keysAtom_,!$o(this.target_,r))return!0;if(Yi(this)){var o=Ki(this,{object:this.proxy_||this.target_,name:r,type:Ym});if(!o)return null}try{var s;di();var c=Sa(this),m=!1,f=this.values_.get(r),v=void 0;if(!f&&(c||m)){var y;v=(y=dp(this.target_,r))==null?void 0:y.value}if(a){if(!Reflect.deleteProperty(this.target_,r))return!1}else delete this.target_[r];if(f&&(this.values_.delete(r),f instanceof Gl&&(v=f.value_),F5(f)),this.keysAtom_.reportChanged(),(s=this.pendingKeys_)==null||(s=s.get(r))==null||s.set(r in this.target_),c||m){var E={type:Ym,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:v,name:r};c&&Ea(this,E)}}finally{hi()}return!0},n.observe_=function(r,a){return Hd(this,r)},n.intercept_=function(r){return qd(this,r)},n.notifyPropertyAddition_=function(r,a){var o,s=Sa(this),c=!1;if(s||c){var m=s||c?{type:Hl,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:r,newValue:a}:null;s&&Ea(this,m)}(o=this.pendingKeys_)==null||(o=o.get(r))==null||o.set(!0),this.keysAtom_.reportChanged()},n.ownKeys_=function(){return this.keysAtom_.reportObserved(),lc(this.target_)},n.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function Ws(e,n){var t;if($o(e,bt))return e;var r=(t=n==null?void 0:n.name)!=null?t:"ObservableObject",a=new sw(e,new Map,String(r),M6(n));return Fd(e,bt,a),e}var I8=Kl("ObservableObjectAdministration",sw);function Km(e){return Wm[e]||(Wm[e]={get:function(){return this[bt].getObservablePropValue_(e)},set:function(t){return this[bt].setObservablePropValue_(e,t)}})}function yn(e){return Cp(e)?I8(e[bt]):!1}function Xm(e,n,t){var r;(r=e.target_[eo])==null||delete r[t]}var j8=cw(0),D8=function(){var e=!1,n={};return Object.defineProperty(n,"0",{set:function(){e=!0}}),Object.create(n)[0]=1,e===!1}(),Ig=0,uw=function(){};function F8(e,n){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,n):e.prototype.__proto__!==void 0?e.prototype.__proto__=n:e.prototype=n}F8(uw,Array.prototype);var xv=function(e){function n(r,a,o,s){var c;return o===void 0&&(o="ObservableArray"),s===void 0&&(s=!1),c=e.call(this)||this,Zl(function(){var m=new Sv(o,a,s,!0);m.proxy_=c,g5(c,bt,m),r&&r.length&&c.spliceWithArray(0,0,r),D8&&Object.defineProperty(c,"0",j8)}),c}y5(n,e);var t=n.prototype;return t.concat=function(){this[bt].atom_.reportObserved();for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];return Array.prototype.concat.apply(this.slice(),o.map(function(c){return Qn(c)?c.slice():c}))},t[Symbol.iterator]=function(){var r=this,a=0;return Pv({next:function(){return a<r.length?{value:r[a++],done:!1}:{done:!0,value:void 0}}})},bc(n,[{key:"length",get:function(){return this[bt].getArrayLength_()},set:function(a){this[bt].setArrayLength_(a)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(uw);Object.entries(mp).forEach(function(e){var n=e[0],t=e[1];n!=="concat"&&Fd(xv.prototype,n,t)});function cw(e){return{enumerable:!1,configurable:!0,get:function(){return this[bt].get_(e)},set:function(t){this[bt].set_(e,t)}}}function z8(e){to(xv.prototype,""+e,cw(e))}function fw(e){if(e>Ig){for(var n=Ig;n<e+100;n++)z8(n);Ig=e}}fw(1e3);function B8(e,n,t){return new xv(e,n,t)}function no(e,n){if(typeof e=="object"&&e!==null){if(Qn(e))return n!==void 0&&Lt(23),e[bt].atom_;if(an(e))return e.atom_;if(Rn(e)){if(n===void 0)return e.keysAtom_;var t=e.data_.get(n)||e.hasMap_.get(n);return t||Lt(25,n,bp(e)),t}if(yn(e)){if(!n)return Lt(26);var r=e[bt].values_.get(n);return r||Lt(27,n,bp(e)),r}if(uv(e)||Hs(e)||vp(e))return e}else if(Ai(e)&&vp(e[bt]))return e[bt];Lt(28)}function Pa(e,n){if(e||Lt(29),n!==void 0)return Pa(no(e,n));if(uv(e)||Hs(e)||vp(e)||Rn(e)||an(e))return e;if(e[bt])return e[bt];Lt(24,e)}function bp(e,n){var t;if(n!==void 0)t=no(e,n);else{if(cc(e))return e.name;yn(e)||Rn(e)||an(e)?t=Pa(e):t=no(e)}return t.name_}function Zl(e){var n=$s(),t=Tp(!0);di();try{return e()}finally{hi(),Rp(t),Wo(n)}}var Zm=Dd.toString;function Ov(e,n,t){return t===void 0&&(t=-1),rv(e,n,t)}function rv(e,n,t,r,a){if(e===n)return e!==0||1/e===1/n;if(e==null||n==null)return!1;if(e!==e)return n!==n;var o=typeof e;if(o!=="function"&&o!=="object"&&typeof n!="object")return!1;var s=Zm.call(e);if(s!==Zm.call(n))return!1;switch(s){case"[object RegExp]":case"[object String]":return""+e==""+n;case"[object Number]":return+e!=+e?+n!=+n:+e==0?1/+e===1/n:+e==+n;case"[object Date]":case"[object Boolean]":return+e==+n;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(n);case"[object Map]":case"[object Set]":t>=0&&t++;break}e=Qm(e),n=Qm(n);var c=s==="[object Array]";if(!c){if(typeof e!="object"||typeof n!="object")return!1;var m=e.constructor,f=n.constructor;if(m!==f&&!(Ai(m)&&m instanceof m&&Ai(f)&&f instanceof f)&&"constructor"in e&&"constructor"in n)return!1}if(t===0)return!1;t<0&&(t=-1),r=r||[],a=a||[];for(var v=r.length;v--;)if(r[v]===e)return a[v]===n;if(r.push(e),a.push(n),c){if(v=e.length,v!==n.length)return!1;for(;v--;)if(!rv(e[v],n[v],t-1,r,a))return!1}else{var y=Object.keys(e),E=y.length;if(Object.keys(n).length!==E)return!1;for(var w=0;w<E;w++){var S=y[w];if(!($o(n,S)&&rv(e[S],n[S],t-1,r,a)))return!1}}return r.pop(),a.pop(),!0}function Qm(e){return Qn(e)?e.slice():yc(e)||Rn(e)||Vo(e)||an(e)?Array.from(e.entries()):e}var Jm,U8=((Jm=Pp().Iterator)==null?void 0:Jm.prototype)||{};function Pv(e){return e[Symbol.iterator]=q8,Object.assign(Object.create(U8),e)}function q8(){return this}["Symbol","Map","Set"].forEach(function(e){var n=Pp();typeof n[e]>"u"&&Lt("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:B5,extras:{getDebugName:bp},$mobx:bt});const H8=Object.freeze(Object.defineProperty({__proto__:null,$mobx:bt,FlowCancellationError:Lp,ObservableMap:Dp,ObservableSet:Ev,Reaction:Oa,_allowStateChanges:fv,_allowStateChangesInsideComputed:uc,_allowStateReadsEnd:ac,_allowStateReadsStart:Mp,_autoAction:sc,_endAction:T5,_getAdministration:Pa,_getGlobalState:N5,_interceptReads:mv,_isComputingDerivation:z6,_resetGlobalState:H6,_startAction:A5,action:Xr,autorun:pv,comparer:Us,computed:Vs,configure:K5,createAtom:Ad,defineProperty:wv,entries:nw,extendObservable:vv,flow:Gs,flowResult:p8,get:b8,getAtom:no,getDebugName:bp,getDependencyTree:X5,getObserverTree:u8,has:iw,intercept:Np,isAction:cc,isBoxedObservable:dv,isComputed:m8,isComputedProp:ew,isFlow:fc,isFlowCancellationError:d8,isObservable:Ip,isObservableArray:Qn,isObservableMap:Rn,isObservableObject:yn,isObservableProp:rw,isObservableSet:an,keys:Td,makeAutoObservable:C8,makeObservable:_v,observable:ur,observe:jp,onBecomeObserved:W5,onBecomeUnobserved:gv,onReactionError:K6,override:J_,ownKeys:aw,reaction:$5,remove:y8,runInAction:uc,set:bv,spy:B5,toJS:S8,trace:E8,transaction:Ja,untracked:hv,values:yv,when:tv},Symbol.toStringTag,{value:"Module"}));if(!Sr.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!_v)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var G8=u5();function V8(e){e()}function dw(e){e||(e=V8),K5({reactionScheduler:e})}var $8=function(){return!0};function W8(e){return X5(e)}var hw=!1;function pw(e){hw=e}function Cv(){return hw}var Y8=1e4,K8=1e4,X8=function(){function e(n){var t=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(r){r===void 0&&(r=Y8),clearTimeout(t.sweepTimeout),t.sweepTimeout=void 0;var a=Date.now();t.registrations.forEach(function(o,s){a-o.registeredAt>=r&&(t.finalize(o.value),t.registrations.delete(s))}),t.registrations.size>0&&t.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){t.sweep(0)}})}return Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t,r){this.registrations.set(r,{value:t,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.registrations.delete(n)}}),Object.defineProperty(e.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,K8))}}),e}(),Z8=typeof FinalizationRegistry<"u"?FinalizationRegistry:X8,wp=new Z8(function(e){var n;(n=e.reaction)===null||n===void 0||n.dispose(),e.reaction=null}),jg={exports:{}},Dg={};/**
|
|
35
35
|
* @license React
|
|
36
36
|
* use-sync-external-store-shim.production.js
|
|
37
37
|
*
|
|
@@ -39,8 +39,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
39
39
|
*
|
|
40
40
|
* This source code is licensed under the MIT license found in the
|
|
41
41
|
* LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/var ey;function Q8(){if(ey)return Dg;ey=1;var e=Or();function n(y,E){return y===E&&(y!==0||1/y===1/E)||y!==y&&E!==E}var t=typeof Object.is=="function"?Object.is:n,r=e.useState,a=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function c(y,E){var w=E(),S=r({inst:{value:w,getSnapshot:E}}),x=S[0].inst,_=S[1];return o(function(){x.value=w,x.getSnapshot=E,m(x)&&_({inst:x})},[y,w,E]),a(function(){return m(x)&&_({inst:x}),y(function(){m(x)&&_({inst:x})})},[y]),s(w),w}function m(y){var E=y.getSnapshot;y=y.value;try{var w=E();return!t(y,w)}catch{return!0}}function f(y,E){return E()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return Dg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Dg}var ty;function J8(){return ty||(ty=1,jg.exports=Q8()),jg.exports}var e9=J8();function ry(e){e.reaction=new Oa("observer".concat(e.name),function(){var n;e.stateVersion=Symbol(),(n=e.onStoreChange)===null||n===void 0||n.call(e)})}function kv(e,n){if(n===void 0&&(n="observed"),Cv())return e();var t=Gt.useRef(null);if(!t.current){var r={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:n,subscribe:function(c){return wp.unregister(r),r.onStoreChange=c,r.reaction||(ry(r),r.stateVersion=Symbol()),function(){var m;r.onStoreChange=null,(m=r.reaction)===null||m===void 0||m.dispose(),r.reaction=null}},getSnapshot:function(){return r.stateVersion}};t.current=r}var a=t.current;a.reaction||(ry(a),wp.register(t,a,a)),Gt.useDebugValue(a.reaction,W8),e9.useSyncExternalStore(a.subscribe,a.getSnapshot,a.getSnapshot);var o,s;if(a.reaction.track(function(){try{o=e()}catch(c){s=c}}),s)throw s;return o}var Fg,zg,g5=typeof Symbol=="function"&&Symbol.for,t9=(zg=(Fg=Object.getOwnPropertyDescriptor(function(){},"name"))===null||Fg===void 0?void 0:Fg.configurable)!==null&&zg!==void 0?zg:!1,ny=g5?Symbol.for("react.forward_ref"):typeof Sr.forwardRef=="function"&&Sr.forwardRef(function(e){return null}).$$typeof,iy=g5?Symbol.for("react.memo"):typeof Sr.memo=="function"&&Sr.memo(function(e){return null}).$$typeof;function r9(e,n){var t;if(iy&&e.$$typeof===iy)throw new Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");if(Cv())return e;var r=(t=n==null?void 0:n.forwardRef)!==null&&t!==void 0?t:!1,a=e,o=e.displayName||e.name;if(ny&&e.$$typeof===ny&&(r=!0,a=e.render,typeof a!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var s=function(c,m){return kv(function(){return a(c,m)},o)};return s.displayName=e.displayName,t9&&Object.defineProperty(s,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(s.contextTypes=e.contextTypes),r&&(s=Sr.forwardRef(s)),s=Sr.memo(s),i9(e,s),s}var n9={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function i9(e,n){Object.keys(e).forEach(function(t){n9[t]||Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))})}function v5(e){var n=e.children,t=e.render;n&&t&&console.error("MobX Observer: Do not use children and render in the same time in `Observer`");var r=n||t;return typeof r!="function"?null:kv(r)}v5.displayName="Observer";function a9(e,n){return Sr.useState(function(){return ur(e(),n,{autoBind:!0})})[0]}function m5(e){var n=Sr.useState(function(){return ur(e,{},{deep:!1})})[0];return uc(function(){Object.assign(n,e)}),n}function o9(e,n){var t=n&&m5(n);return Sr.useState(function(){return ur(e(t),void 0,{autoBind:!0})})[0]}var Bg;d5(G8.unstable_batchedUpdates);var l9=(Bg=wp.finalizeAllImmediately)!==null&&Bg!==void 0?Bg:function(){};function s9(e,n){return n===void 0&&(n="observed"),kv(e,n)}function u9(e){p5(e)}const c9=Object.freeze(Object.defineProperty({__proto__:null,Observer:v5,_observerFinalizationRegistry:wp,clearTimers:l9,enableStaticRendering:p5,isObserverBatched:$8,isUsingStaticRendering:Cv,observer:r9,observerBatching:d5,useAsObservableSource:m5,useLocalObservable:a9,useLocalStore:o9,useObserver:s9,useStaticRendering:u9},Symbol.toStringTag,{value:"Module"})),Ri=Yl(c9);var Ns={};const Xi=Yl(H8);var sp={exports:{}},bf={},Ug={},qg={},ay;function Dt(){return ay||(ay=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._registerNode=e.Konva=e.glob=void 0;const n=Math.PI/180;function t(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}e.glob=typeof oc<"u"?oc:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},e.Konva={_global:e.glob,version:"9.3.19",isBrowser:t(),isUnminified:/param/.test((function(a){}).toString()),dblClickWindow:400,getAngle(a){return e.Konva.angleDeg?a*n:a},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_fixTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return e.Konva.DD.isDragging},isTransforming(){var a;return(a=e.Konva.Transformer)===null||a===void 0?void 0:a.isTransforming()},isDragReady(){return!!e.Konva.DD.node},releaseCanvasOnDestroy:!0,document:e.glob.document,_injectGlobal(a){e.glob.Konva=a}};const r=a=>{e.Konva[a.prototype.getClassName()]=a};e._registerNode=r,e.Konva._injectGlobal(e.Konva)}(qg)),qg}var Hg={},oy;function Lr(){return oy||(oy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const n=Dt();class t{constructor(d=[1,0,0,1,0,0]){this.dirty=!1,this.m=d&&d.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new t(this.m)}copyInto(d){d.m[0]=this.m[0],d.m[1]=this.m[1],d.m[2]=this.m[2],d.m[3]=this.m[3],d.m[4]=this.m[4],d.m[5]=this.m[5]}point(d){const P=this.m;return{x:P[0]*d.x+P[2]*d.y+P[4],y:P[1]*d.x+P[3]*d.y+P[5]}}translate(d,P){return this.m[4]+=this.m[0]*d+this.m[2]*P,this.m[5]+=this.m[1]*d+this.m[3]*P,this}scale(d,P){return this.m[0]*=d,this.m[1]*=d,this.m[2]*=P,this.m[3]*=P,this}rotate(d){const P=Math.cos(d),M=Math.sin(d),T=this.m[0]*P+this.m[2]*M,I=this.m[1]*P+this.m[3]*M,F=this.m[0]*-M+this.m[2]*P,k=this.m[1]*-M+this.m[3]*P;return this.m[0]=T,this.m[1]=I,this.m[2]=F,this.m[3]=k,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(d,P){const M=this.m[0]+this.m[2]*P,T=this.m[1]+this.m[3]*P,I=this.m[2]+this.m[0]*d,F=this.m[3]+this.m[1]*d;return this.m[0]=M,this.m[1]=T,this.m[2]=I,this.m[3]=F,this}multiply(d){const P=this.m[0]*d.m[0]+this.m[2]*d.m[1],M=this.m[1]*d.m[0]+this.m[3]*d.m[1],T=this.m[0]*d.m[2]+this.m[2]*d.m[3],I=this.m[1]*d.m[2]+this.m[3]*d.m[3],F=this.m[0]*d.m[4]+this.m[2]*d.m[5]+this.m[4],k=this.m[1]*d.m[4]+this.m[3]*d.m[5]+this.m[5];return this.m[0]=P,this.m[1]=M,this.m[2]=T,this.m[3]=I,this.m[4]=F,this.m[5]=k,this}invert(){const d=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),P=this.m[3]*d,M=-this.m[1]*d,T=-this.m[2]*d,I=this.m[0]*d,F=d*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),k=d*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=P,this.m[1]=M,this.m[2]=T,this.m[3]=I,this.m[4]=F,this.m[5]=k,this}getMatrix(){return this.m}decompose(){const d=this.m[0],P=this.m[1],M=this.m[2],T=this.m[3],I=this.m[4],F=this.m[5],k=d*T-P*M,O={x:I,y:F,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(d!=0||P!=0){const N=Math.sqrt(d*d+P*P);O.rotation=P>0?Math.acos(d/N):-Math.acos(d/N),O.scaleX=N,O.scaleY=k/N,O.skewX=(d*M+P*T)/k,O.skewY=0}else if(M!=0||T!=0){const N=Math.sqrt(M*M+T*T);O.rotation=Math.PI/2-(T>0?Math.acos(-M/N):-Math.acos(M/N)),O.scaleX=k/N,O.scaleY=N,O.skewX=0,O.skewY=(d*M+P*T)/k}return O.rotation=e.Util._getRotation(O.rotation),O}}e.Transform=t;const r="[object Array]",a="[object Number]",o="[object String]",s="[object Boolean]",c=Math.PI/180,m=180/Math.PI,f="#",v="",y="0",E="Konva warning: ",w="Konva error: ",S="rgb(",x={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},_=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let b=[];const g=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(h){setTimeout(h,60)};e.Util={_isElement(h){return!!(h&&h.nodeType==1)},_isFunction(h){return!!(h&&h.constructor&&h.call&&h.apply)},_isPlainObject(h){return!!h&&h.constructor===Object},_isArray(h){return Object.prototype.toString.call(h)===r},_isNumber(h){return Object.prototype.toString.call(h)===a&&!isNaN(h)&&isFinite(h)},_isString(h){return Object.prototype.toString.call(h)===o},_isBoolean(h){return Object.prototype.toString.call(h)===s},isObject(h){return h instanceof Object},isValidSelector(h){if(typeof h!="string")return!1;const d=h[0];return d==="#"||d==="."||d===d.toUpperCase()},_sign(h){return h===0||h>0?1:-1},requestAnimFrame(h){b.push(h),b.length===1&&g(function(){const d=b;b=[],d.forEach(function(P){P()})})},createCanvasElement(){const h=document.createElement("canvas");try{h.style=h.style||{}}catch{}return h},createImageElement(){return document.createElement("img")},_isInDocument(h){for(;h=h.parentNode;)if(h==document)return!0;return!1},_urlToImage(h,d){const P=e.Util.createImageElement();P.onload=function(){d(P)},P.src=h},_rgbToHex(h,d,P){return((1<<24)+(h<<16)+(d<<8)+P).toString(16).slice(1)},_hexToRgb(h){h=h.replace(f,v);const d=parseInt(h,16);return{r:d>>16&255,g:d>>8&255,b:d&255}},getRandomColor(){let h=(Math.random()*16777215<<0).toString(16);for(;h.length<6;)h=y+h;return f+h},getRGB(h){let d;return h in x?(d=x[h],{r:d[0],g:d[1],b:d[2]}):h[0]===f?this._hexToRgb(h.substring(1)):h.substr(0,4)===S?(d=_.exec(h.replace(/ /g,"")),{r:parseInt(d[1],10),g:parseInt(d[2],10),b:parseInt(d[3],10)}):{r:0,g:0,b:0}},colorToRGBA(h){return h=h||"black",e.Util._namedColorToRBA(h)||e.Util._hex3ColorToRGBA(h)||e.Util._hex4ColorToRGBA(h)||e.Util._hex6ColorToRGBA(h)||e.Util._hex8ColorToRGBA(h)||e.Util._rgbColorToRGBA(h)||e.Util._rgbaColorToRGBA(h)||e.Util._hslColorToRGBA(h)},_namedColorToRBA(h){const d=x[h.toLowerCase()];return d?{r:d[0],g:d[1],b:d[2],a:1}:null},_rgbColorToRGBA(h){if(h.indexOf("rgb(")===0){h=h.match(/rgb\(([^)]+)\)/)[1];const d=h.split(/ *, */).map(Number);return{r:d[0],g:d[1],b:d[2],a:1}}},_rgbaColorToRGBA(h){if(h.indexOf("rgba(")===0){h=h.match(/rgba\(([^)]+)\)/)[1];const d=h.split(/ *, */).map((P,M)=>P.slice(-1)==="%"?M===3?parseInt(P)/100:parseInt(P)/100*255:Number(P));return{r:d[0],g:d[1],b:d[2],a:d[3]}}},_hex8ColorToRGBA(h){if(h[0]==="#"&&h.length===9)return{r:parseInt(h.slice(1,3),16),g:parseInt(h.slice(3,5),16),b:parseInt(h.slice(5,7),16),a:parseInt(h.slice(7,9),16)/255}},_hex6ColorToRGBA(h){if(h[0]==="#"&&h.length===7)return{r:parseInt(h.slice(1,3),16),g:parseInt(h.slice(3,5),16),b:parseInt(h.slice(5,7),16),a:1}},_hex4ColorToRGBA(h){if(h[0]==="#"&&h.length===5)return{r:parseInt(h[1]+h[1],16),g:parseInt(h[2]+h[2],16),b:parseInt(h[3]+h[3],16),a:parseInt(h[4]+h[4],16)/255}},_hex3ColorToRGBA(h){if(h[0]==="#"&&h.length===4)return{r:parseInt(h[1]+h[1],16),g:parseInt(h[2]+h[2],16),b:parseInt(h[3]+h[3],16),a:1}},_hslColorToRGBA(h){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(h)){const[d,...P]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(h),M=Number(P[0])/360,T=Number(P[1])/100,I=Number(P[2])/100;let F,k,O;if(T===0)return O=I*255,{r:Math.round(O),g:Math.round(O),b:Math.round(O),a:1};I<.5?F=I*(1+T):F=I+T-I*T;const N=2*I-F,A=[0,0,0];for(let R=0;R<3;R++)k=M+1/3*-(R-1),k<0&&k++,k>1&&k--,6*k<1?O=N+(F-N)*6*k:2*k<1?O=F:3*k<2?O=N+(F-N)*(2/3-k)*6:O=N,A[R]=O*255;return{r:Math.round(A[0]),g:Math.round(A[1]),b:Math.round(A[2]),a:1}}},haveIntersection(h,d){return!(d.x>h.x+h.width||d.x+d.width<h.x||d.y>h.y+h.height||d.y+d.height<h.y)},cloneObject(h){const d={};for(const P in h)this._isPlainObject(h[P])?d[P]=this.cloneObject(h[P]):this._isArray(h[P])?d[P]=this.cloneArray(h[P]):d[P]=h[P];return d},cloneArray(h){return h.slice(0)},degToRad(h){return h*c},radToDeg(h){return h*m},_degToRad(h){return e.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),e.Util.degToRad(h)},_radToDeg(h){return e.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),e.Util.radToDeg(h)},_getRotation(h){return n.Konva.angleDeg?e.Util.radToDeg(h):h},_capitalize(h){return h.charAt(0).toUpperCase()+h.slice(1)},throw(h){throw new Error(w+h)},error(h){console.error(w+h)},warn(h){n.Konva.showWarnings&&console.warn(E+h)},each(h,d){for(const P in h)d(P,h[P])},_inRange(h,d,P){return d<=h&&h<P},_getProjectionToSegment(h,d,P,M,T,I){let F,k,O;const N=(h-P)*(h-P)+(d-M)*(d-M);if(N==0)F=h,k=d,O=(T-P)*(T-P)+(I-M)*(I-M);else{const A=((T-h)*(P-h)+(I-d)*(M-d))/N;A<0?(F=h,k=d,O=(h-T)*(h-T)+(d-I)*(d-I)):A>1?(F=P,k=M,O=(P-T)*(P-T)+(M-I)*(M-I)):(F=h+A*(P-h),k=d+A*(M-d),O=(F-T)*(F-T)+(k-I)*(k-I))}return[F,k,O]},_getProjectionToLine(h,d,P){const M=e.Util.cloneObject(h);let T=Number.MAX_VALUE;return d.forEach(function(I,F){if(!P&&F===d.length-1)return;const k=d[(F+1)%d.length],O=e.Util._getProjectionToSegment(I.x,I.y,k.x,k.y,h.x,h.y),N=O[0],A=O[1],R=O[2];R<T&&(M.x=N,M.y=A,T=R)}),M},_prepareArrayForTween(h,d,P){const M=[],T=[];if(h.length>d.length){const F=d;d=h,h=F}for(let F=0;F<h.length;F+=2)M.push({x:h[F],y:h[F+1]});for(let F=0;F<d.length;F+=2)T.push({x:d[F],y:d[F+1]});const I=[];return T.forEach(function(F){const k=e.Util._getProjectionToLine(F,M,P);I.push(k.x),I.push(k.y)}),I},_prepareToStringify(h){let d;h.visitedByCircularReferenceRemoval=!0;for(const P in h)if(h.hasOwnProperty(P)&&h[P]&&typeof h[P]=="object"){if(d=Object.getOwnPropertyDescriptor(h,P),h[P].visitedByCircularReferenceRemoval||e.Util._isElement(h[P]))if(d.configurable)delete h[P];else return null;else if(e.Util._prepareToStringify(h[P])===null)if(d.configurable)delete h[P];else return null}return delete h.visitedByCircularReferenceRemoval,h},_assign(h,d){for(const P in d)h[P]=d[P];return h},_getFirstPointerId(h){return h.touches?h.changedTouches[0].identifier:h.pointerId||999},releaseCanvas(...h){n.Konva.releaseCanvasOnDestroy&&h.forEach(d=>{d.width=0,d.height=0})},drawRoundedRectPath(h,d,P,M){let T=0,I=0,F=0,k=0;typeof M=="number"?T=I=F=k=Math.min(M,d/2,P/2):(T=Math.min(M[0]||0,d/2,P/2),I=Math.min(M[1]||0,d/2,P/2),k=Math.min(M[2]||0,d/2,P/2),F=Math.min(M[3]||0,d/2,P/2)),h.moveTo(T,0),h.lineTo(d-I,0),h.arc(d-I,I,I,Math.PI*3/2,0,!1),h.lineTo(d,P-k),h.arc(d-k,P-k,k,0,Math.PI/2,!1),h.lineTo(F,P),h.arc(F,P-F,F,Math.PI/2,Math.PI,!1),h.lineTo(0,T),h.arc(T,T,T,Math.PI,Math.PI*3/2,!1)}}}(Hg)),Hg}var wf={},Gg={},fi={},ly;function Vt(){if(ly)return fi;ly=1,Object.defineProperty(fi,"__esModule",{value:!0}),fi.RGBComponent=r,fi.alphaComponent=a,fi.getNumberValidator=o,fi.getNumberOrArrayOfNumbersValidator=s,fi.getNumberOrAutoValidator=c,fi.getStringValidator=m,fi.getStringOrGradientValidator=f,fi.getFunctionValidator=v,fi.getNumberArrayValidator=y,fi.getBooleanValidator=E,fi.getComponentValidator=w;const e=Dt(),n=Lr();function t(S){return n.Util._isString(S)?'"'+S+'"':Object.prototype.toString.call(S)==="[object Number]"||n.Util._isBoolean(S)?S:Object.prototype.toString.call(S)}function r(S){return S>255?255:S<0?0:Math.round(S)}function a(S){return S>1?1:S<1e-4?1e-4:S}function o(){if(e.Konva.isUnminified)return function(S,x){return n.Util._isNumber(S)||n.Util.warn(t(S)+' is a not valid value for "'+x+'" attribute. The value should be a number.'),S}}function s(S){if(e.Konva.isUnminified)return function(x,_){let b=n.Util._isNumber(x),g=n.Util._isArray(x)&&x.length==S;return!b&&!g&&n.Util.warn(t(x)+' is a not valid value for "'+_+'" attribute. The value should be a number or Array<number>('+S+")"),x}}function c(){if(e.Konva.isUnminified)return function(S,x){var _=n.Util._isNumber(S),b=S==="auto";return _||b||n.Util.warn(t(S)+' is a not valid value for "'+x+'" attribute. The value should be a number or "auto".'),S}}function m(){if(e.Konva.isUnminified)return function(S,x){return n.Util._isString(S)||n.Util.warn(t(S)+' is a not valid value for "'+x+'" attribute. The value should be a string.'),S}}function f(){if(e.Konva.isUnminified)return function(S,x){const _=n.Util._isString(S),b=Object.prototype.toString.call(S)==="[object CanvasGradient]"||S&&S.addColorStop;return _||b||n.Util.warn(t(S)+' is a not valid value for "'+x+'" attribute. The value should be a string or a native gradient.'),S}}function v(){if(e.Konva.isUnminified)return function(S,x){return n.Util._isFunction(S)||n.Util.warn(t(S)+' is a not valid value for "'+x+'" attribute. The value should be a function.'),S}}function y(){if(e.Konva.isUnminified)return function(S,x){const _=Int8Array?Object.getPrototypeOf(Int8Array):null;return _&&S instanceof _||(n.Util._isArray(S)?S.forEach(function(b){n.Util._isNumber(b)||n.Util.warn('"'+x+'" attribute has non numeric element '+b+". Make sure that all elements are numbers.")}):n.Util.warn(t(S)+' is a not valid value for "'+x+'" attribute. The value should be a array of numbers.')),S}}function E(){if(e.Konva.isUnminified)return function(S,x){var _=S===!0||S===!1;return _||n.Util.warn(t(S)+' is a not valid value for "'+x+'" attribute. The value should be a boolean.'),S}}function w(S){if(e.Konva.isUnminified)return function(x,_){return x==null||n.Util.isObject(x)||n.Util.warn(t(x)+' is a not valid value for "'+_+'" attribute. The value should be an object with properties '+S),x}}return fi}var sy;function qt(){return sy||(sy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const n=Lr(),t=Vt(),r="get",a="set";e.Factory={addGetterSetter(o,s,c,m,f){e.Factory.addGetter(o,s,c),e.Factory.addSetter(o,s,m,f),e.Factory.addOverloadedGetterSetter(o,s)},addGetter(o,s,c){var m=r+n.Util._capitalize(s);o.prototype[m]=o.prototype[m]||function(){const f=this.attrs[s];return f===void 0?c:f}},addSetter(o,s,c,m){var f=a+n.Util._capitalize(s);o.prototype[f]||e.Factory.overWriteSetter(o,s,c,m)},overWriteSetter(o,s,c,m){var f=a+n.Util._capitalize(s);o.prototype[f]=function(v){return c&&v!==void 0&&v!==null&&(v=c.call(this,v,s)),this._setAttr(s,v),m&&m.call(this),this}},addComponentsGetterSetter(o,s,c,m,f){const v=c.length,y=n.Util._capitalize,E=r+y(s),w=a+y(s);o.prototype[E]=function(){const x={};for(let _=0;_<v;_++){const b=c[_];x[b]=this.getAttr(s+y(b))}return x};const S=(0,t.getComponentValidator)(c);o.prototype[w]=function(x){const _=this.attrs[s];m&&(x=m.call(this,x,s)),S&&S.call(this,x,s);for(const b in x)x.hasOwnProperty(b)&&this._setAttr(s+y(b),x[b]);return x||c.forEach(b=>{this._setAttr(s+y(b),void 0)}),this._fireChangeEvent(s,_,x),f&&f.call(this),this},e.Factory.addOverloadedGetterSetter(o,s)},addOverloadedGetterSetter(o,s){var c=n.Util._capitalize(s),m=a+c,f=r+c;o.prototype[s]=function(){return arguments.length?(this[m](arguments[0]),this):this[f]()}},addDeprecatedGetterSetter(o,s,c,m){n.Util.error("Adding deprecated "+s);const f=r+n.Util._capitalize(s),v=s+" property is deprecated and will be removed soon. Look at Konva change log for more information.";o.prototype[f]=function(){n.Util.error(v);const y=this.attrs[s];return y===void 0?c:y},e.Factory.addSetter(o,s,m,function(){n.Util.error(v)}),e.Factory.addOverloadedGetterSetter(o,s)},backCompat(o,s){n.Util.each(s,function(c,m){const f=o.prototype[m],v=r+n.Util._capitalize(c),y=a+n.Util._capitalize(c);function E(){f.apply(this,arguments),n.Util.error('"'+c+'" method is deprecated and will be removed soon. Use ""'+m+'" instead.')}o.prototype[c]=E,o.prototype[v]=E,o.prototype[y]=E})},afterSetFilter(){this._filterUpToDate=!1}}}(Gg)),Gg}var Do={},Fo={},uy;function y5(){if(uy)return Fo;uy=1,Object.defineProperty(Fo,"__esModule",{value:!0}),Fo.HitContext=Fo.SceneContext=Fo.Context=void 0;const e=Lr(),n=Dt();function t(b){const g=[],h=b.length,d=e.Util;for(let P=0;P<h;P++){let M=b[P];d._isNumber(M)?M=Math.round(M*1e3)/1e3:d._isString(M)||(M=M+""),g.push(M)}return g}const r=",",a="(",o=")",s="([",c="])",m=";",f="()",v="=",y=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],E=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"],w=100;let S=class{constructor(g){this.canvas=g,n.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(g){g.fillEnabled()&&this._fill(g)}_fill(g){}strokeShape(g){g.hasStroke()&&this._stroke(g)}_stroke(g){}fillStrokeShape(g){g.attrs.fillAfterStrokeEnabled?(this.strokeShape(g),this.fillShape(g)):(this.fillShape(g),this.strokeShape(g))}getTrace(g,h){let d=this.traceArr,P=d.length,M="",T,I,F,k;for(T=0;T<P;T++)I=d[T],F=I.method,F?(k=I.args,M+=F,g?M+=f:e.Util._isArray(k[0])?M+=s+k.join(r)+c:(h&&(k=k.map(O=>typeof O=="number"?Math.floor(O):O)),M+=a+k.join(r)+o)):(M+=I.property,g||(M+=v+I.val)),M+=m;return M}clearTrace(){this.traceArr=[]}_trace(g){let h=this.traceArr,d;h.push(g),d=h.length,d>=w&&h.shift()}reset(){const g=this.getCanvas().getPixelRatio();this.setTransform(1*g,0,0,1*g,0,0)}getCanvas(){return this.canvas}clear(g){const h=this.getCanvas();g?this.clearRect(g.x||0,g.y||0,g.width||0,g.height||0):this.clearRect(0,0,h.getWidth()/h.pixelRatio,h.getHeight()/h.pixelRatio)}_applyLineCap(g){const h=g.attrs.lineCap;h&&this.setAttr("lineCap",h)}_applyOpacity(g){const h=g.getAbsoluteOpacity();h!==1&&this.setAttr("globalAlpha",h)}_applyLineJoin(g){const h=g.attrs.lineJoin;h&&this.setAttr("lineJoin",h)}setAttr(g,h){this._context[g]=h}arc(g,h,d,P,M,T){this._context.arc(g,h,d,P,M,T)}arcTo(g,h,d,P,M){this._context.arcTo(g,h,d,P,M)}beginPath(){this._context.beginPath()}bezierCurveTo(g,h,d,P,M,T){this._context.bezierCurveTo(g,h,d,P,M,T)}clearRect(g,h,d,P){this._context.clearRect(g,h,d,P)}clip(...g){this._context.clip.apply(this._context,g)}closePath(){this._context.closePath()}createImageData(g,h){const d=arguments;if(d.length===2)return this._context.createImageData(g,h);if(d.length===1)return this._context.createImageData(g)}createLinearGradient(g,h,d,P){return this._context.createLinearGradient(g,h,d,P)}createPattern(g,h){return this._context.createPattern(g,h)}createRadialGradient(g,h,d,P,M,T){return this._context.createRadialGradient(g,h,d,P,M,T)}drawImage(g,h,d,P,M,T,I,F,k){const O=arguments,N=this._context;O.length===3?N.drawImage(g,h,d):O.length===5?N.drawImage(g,h,d,P,M):O.length===9&&N.drawImage(g,h,d,P,M,T,I,F,k)}ellipse(g,h,d,P,M,T,I,F){this._context.ellipse(g,h,d,P,M,T,I,F)}isPointInPath(g,h,d,P){return d?this._context.isPointInPath(d,g,h,P):this._context.isPointInPath(g,h,P)}fill(...g){this._context.fill.apply(this._context,g)}fillRect(g,h,d,P){this._context.fillRect(g,h,d,P)}strokeRect(g,h,d,P){this._context.strokeRect(g,h,d,P)}fillText(g,h,d,P){P?this._context.fillText(g,h,d,P):this._context.fillText(g,h,d)}measureText(g){return this._context.measureText(g)}getImageData(g,h,d,P){return this._context.getImageData(g,h,d,P)}lineTo(g,h){this._context.lineTo(g,h)}moveTo(g,h){this._context.moveTo(g,h)}rect(g,h,d,P){this._context.rect(g,h,d,P)}roundRect(g,h,d,P,M){this._context.roundRect(g,h,d,P,M)}putImageData(g,h,d){this._context.putImageData(g,h,d)}quadraticCurveTo(g,h,d,P){this._context.quadraticCurveTo(g,h,d,P)}restore(){this._context.restore()}rotate(g){this._context.rotate(g)}save(){this._context.save()}scale(g,h){this._context.scale(g,h)}setLineDash(g){this._context.setLineDash?this._context.setLineDash(g):"mozDash"in this._context?this._context.mozDash=g:"webkitLineDash"in this._context&&(this._context.webkitLineDash=g)}getLineDash(){return this._context.getLineDash()}setTransform(g,h,d,P,M,T){this._context.setTransform(g,h,d,P,M,T)}stroke(g){g?this._context.stroke(g):this._context.stroke()}strokeText(g,h,d,P){this._context.strokeText(g,h,d,P)}transform(g,h,d,P,M,T){this._context.transform(g,h,d,P,M,T)}translate(g,h){this._context.translate(g,h)}_enableTrace(){let g=this,h=y.length,d=this.setAttr,P,M;const T=function(I){let F=g[I],k;g[I]=function(){return M=t(Array.prototype.slice.call(arguments,0)),k=F.apply(g,arguments),g._trace({method:I,args:M}),k}};for(P=0;P<h;P++)T(y[P]);g.setAttr=function(){d.apply(g,arguments);const I=arguments[0];let F=arguments[1];(I==="shadowOffsetX"||I==="shadowOffsetY"||I==="shadowBlur")&&(F=F/this.canvas.getPixelRatio()),g._trace({property:I,val:F})}}_applyGlobalCompositeOperation(g){const h=g.attrs.globalCompositeOperation;!h||h==="source-over"||this.setAttr("globalCompositeOperation",h)}};Fo.Context=S,E.forEach(function(b){Object.defineProperty(S.prototype,b,{get(){return this._context[b]},set(g){this._context[b]=g}})});class x extends S{constructor(g,{willReadFrequently:h=!1}={}){super(g),this._context=g._canvas.getContext("2d",{willReadFrequently:h})}_fillColor(g){const h=g.fill();this.setAttr("fillStyle",h),g._fillFunc(this)}_fillPattern(g){this.setAttr("fillStyle",g._getFillPattern()),g._fillFunc(this)}_fillLinearGradient(g){const h=g._getLinearGradient();h&&(this.setAttr("fillStyle",h),g._fillFunc(this))}_fillRadialGradient(g){const h=g._getRadialGradient();h&&(this.setAttr("fillStyle",h),g._fillFunc(this))}_fill(g){const h=g.fill(),d=g.getFillPriority();if(h&&d==="color"){this._fillColor(g);return}const P=g.getFillPatternImage();if(P&&d==="pattern"){this._fillPattern(g);return}const M=g.getFillLinearGradientColorStops();if(M&&d==="linear-gradient"){this._fillLinearGradient(g);return}const T=g.getFillRadialGradientColorStops();if(T&&d==="radial-gradient"){this._fillRadialGradient(g);return}h?this._fillColor(g):P?this._fillPattern(g):M?this._fillLinearGradient(g):T&&this._fillRadialGradient(g)}_strokeLinearGradient(g){const h=g.getStrokeLinearGradientStartPoint(),d=g.getStrokeLinearGradientEndPoint(),P=g.getStrokeLinearGradientColorStops(),M=this.createLinearGradient(h.x,h.y,d.x,d.y);if(P){for(let T=0;T<P.length;T+=2)M.addColorStop(P[T],P[T+1]);this.setAttr("strokeStyle",M)}}_stroke(g){const h=g.dash(),d=g.getStrokeScaleEnabled();if(g.hasStroke()){if(!d){this.save();const M=this.getCanvas().getPixelRatio();this.setTransform(M,0,0,M,0,0)}this._applyLineCap(g),h&&g.dashEnabled()&&(this.setLineDash(h),this.setAttr("lineDashOffset",g.dashOffset())),this.setAttr("lineWidth",g.strokeWidth()),g.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),g.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(g):this.setAttr("strokeStyle",g.stroke()),g._strokeFunc(this),d||this.restore()}}_applyShadow(g){var h,d,P;const M=(h=g.getShadowRGBA())!==null&&h!==void 0?h:"black",T=(d=g.getShadowBlur())!==null&&d!==void 0?d:5,I=(P=g.getShadowOffset())!==null&&P!==void 0?P:{x:0,y:0},F=g.getAbsoluteScale(),k=this.canvas.getPixelRatio(),O=F.x*k,N=F.y*k;this.setAttr("shadowColor",M),this.setAttr("shadowBlur",T*Math.min(Math.abs(O),Math.abs(N))),this.setAttr("shadowOffsetX",I.x*O),this.setAttr("shadowOffsetY",I.y*N)}}Fo.SceneContext=x;class _ extends S{constructor(g){super(g),this._context=g._canvas.getContext("2d",{willReadFrequently:!0})}_fill(g){this.save(),this.setAttr("fillStyle",g.colorKey),g._fillFuncHit(this),this.restore()}strokeShape(g){g.hasHitStroke()&&this._stroke(g)}_stroke(g){if(g.hasHitStroke()){const h=g.getStrokeScaleEnabled();if(!h){this.save();const M=this.getCanvas().getPixelRatio();this.setTransform(M,0,0,M,0,0)}this._applyLineCap(g);const d=g.hitStrokeWidth(),P=d==="auto"?g.strokeWidth():d;this.setAttr("lineWidth",P),this.setAttr("strokeStyle",g.colorKey),g._strokeFuncHit(this),h||this.restore()}}}return Fo.HitContext=_,Fo}var cy;function Fp(){if(cy)return Do;cy=1,Object.defineProperty(Do,"__esModule",{value:!0}),Do.HitCanvas=Do.SceneCanvas=Do.Canvas=void 0;const e=Lr(),n=y5(),t=Dt();let r;function a(){if(r)return r;const m=e.Util.createCanvasElement(),f=m.getContext("2d");return r=function(){const v=t.Konva._global.devicePixelRatio||1,y=f.webkitBackingStorePixelRatio||f.mozBackingStorePixelRatio||f.msBackingStorePixelRatio||f.oBackingStorePixelRatio||f.backingStorePixelRatio||1;return v/y}(),e.Util.releaseCanvas(m),r}let o=class{constructor(f){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const y=(f||{}).pixelRatio||t.Konva.pixelRatio||a();this.pixelRatio=y,this._canvas=e.Util.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(f){const v=this.pixelRatio;this.pixelRatio=f,this.setSize(this.getWidth()/v,this.getHeight()/v)}setWidth(f){this.width=this._canvas.width=f*this.pixelRatio,this._canvas.style.width=f+"px";const v=this.pixelRatio;this.getContext()._context.scale(v,v)}setHeight(f){this.height=this._canvas.height=f*this.pixelRatio,this._canvas.style.height=f+"px";const v=this.pixelRatio;this.getContext()._context.scale(v,v)}getWidth(){return this.width}getHeight(){return this.height}setSize(f,v){this.setWidth(f||0),this.setHeight(v||0)}toDataURL(f,v){try{return this._canvas.toDataURL(f,v)}catch{try{return this._canvas.toDataURL()}catch(E){return e.Util.error("Unable to get data URL. "+E.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}};Do.Canvas=o;class s extends o{constructor(f={width:0,height:0,willReadFrequently:!1}){super(f),this.context=new n.SceneContext(this,{willReadFrequently:f.willReadFrequently}),this.setSize(f.width,f.height)}}Do.SceneCanvas=s;class c extends o{constructor(f={width:0,height:0}){super(f),this.hitCanvas=!0,this.context=new n.HitContext(this),this.setSize(f.width,f.height)}}return Do.HitCanvas=c,Do}var Vg={},fy;function Av(){return fy||(fy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const n=Dt(),t=Lr();e.DD={get isDragging(){let r=!1;return e.DD._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(r=!0)}),r},justDragged:!1,get node(){let r;return e.DD._dragElements.forEach(a=>{r=a.node}),r},_dragElements:new Map,_drag(r){const a=[];e.DD._dragElements.forEach((o,s)=>{const{node:c}=o,m=c.getStage();m.setPointersPositions(r),o.pointerId===void 0&&(o.pointerId=t.Util._getFirstPointerId(r));const f=m._changedPointerPositions.find(v=>v.id===o.pointerId);if(f){if(o.dragStatus!=="dragging"){const v=c.dragDistance();if(Math.max(Math.abs(f.x-o.startPointerPos.x),Math.abs(f.y-o.startPointerPos.y))<v||(c.startDrag({evt:r}),!c.isDragging()))return}c._setDragPosition(r,o),a.push(c)}}),a.forEach(o=>{o.fire("dragmove",{type:"dragmove",target:o,evt:r},!0)})},_endDragBefore(r){const a=[];e.DD._dragElements.forEach(o=>{const{node:s}=o,c=s.getStage();if(r&&c.setPointersPositions(r),!c._changedPointerPositions.find(v=>v.id===o.pointerId))return;(o.dragStatus==="dragging"||o.dragStatus==="stopped")&&(e.DD.justDragged=!0,n.Konva._mouseListenClick=!1,n.Konva._touchListenClick=!1,n.Konva._pointerListenClick=!1,o.dragStatus="stopped");const f=o.node.getLayer()||o.node instanceof n.Konva.Stage&&o.node;f&&a.indexOf(f)===-1&&a.push(f)}),a.forEach(o=>{o.draw()})},_endDragAfter(r){e.DD._dragElements.forEach((a,o)=>{a.dragStatus==="stopped"&&a.node.fire("dragend",{type:"dragend",target:a.node,evt:r},!0),a.dragStatus!=="dragging"&&e.DD._dragElements.delete(o)})}},n.Konva.isBrowser&&(window.addEventListener("mouseup",e.DD._endDragBefore,!0),window.addEventListener("touchend",e.DD._endDragBefore,!0),window.addEventListener("touchcancel",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),window.addEventListener("touchcancel",e.DD._endDragAfter,!1))}(Vg)),Vg}var dy;function Hr(){if(dy)return wf;dy=1,Object.defineProperty(wf,"__esModule",{value:!0}),wf.Node=void 0;const e=Lr(),n=qt(),t=Fp(),r=Dt(),a=Av(),o=Vt(),s="absoluteOpacity",c="allEventListeners",m="absoluteTransform",f="absoluteScale",v="canvas",y="Change",E="children",w="konva",S="listening",x="mouseenter",_="mouseleave",b="set",g="Shape",h=" ",d="stage",P="transform",M="Stage",T="visible",I=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(h);let F=1;class k{constructor(A){this._id=F++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(A),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(A){(A===P||A===m)&&this._cache.get(A)?this._cache.get(A).dirty=!0:A?this._cache.delete(A):this._cache.clear()}_getCache(A,R){let L=this._cache.get(A);return(L===void 0||(A===P||A===m)&&L.dirty===!0)&&(L=R.call(this),this._cache.set(A,L)),L}_calculate(A,R,L){if(!this._attachedDepsListeners.get(A)){const V=R.map(G=>G+"Change.konva").join(h);this.on(V,()=>{this._clearCache(A)}),this._attachedDepsListeners.set(A,!0)}return this._getCache(A,L)}_getCanvasCache(){return this._cache.get(v)}_clearSelfAndDescendantCache(A){this._clearCache(A),A===m&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(v)){const{scene:A,filter:R,hit:L}=this._cache.get(v);e.Util.releaseCanvas(A,R,L),this._cache.delete(v)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(A){const R=A||{};let L={};(R.x===void 0||R.y===void 0||R.width===void 0||R.height===void 0)&&(L=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let V=Math.ceil(R.width||L.width),G=Math.ceil(R.height||L.height),W=R.pixelRatio,X=R.x===void 0?Math.floor(L.x):R.x,q=R.y===void 0?Math.floor(L.y):R.y,z=R.offset||0,Y=R.drawBorder||!1,U=R.hitCanvasPixelRatio||1;if(!V||!G){e.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const ee=Math.abs(Math.round(L.x)-X)>.5?1:0,te=Math.abs(Math.round(L.y)-q)>.5?1:0;V+=z*2+ee,G+=z*2+te,X-=z,q-=z;const Q=new t.SceneCanvas({pixelRatio:W,width:V,height:G}),Z=new t.SceneCanvas({pixelRatio:W,width:0,height:0,willReadFrequently:!0}),re=new t.HitCanvas({pixelRatio:U,width:V,height:G}),ne=Q.getContext(),ae=re.getContext();return re.isCache=!0,Q.isCache=!0,this._cache.delete(v),this._filterUpToDate=!1,R.imageSmoothingEnabled===!1&&(Q.getContext()._context.imageSmoothingEnabled=!1,Z.getContext()._context.imageSmoothingEnabled=!1),ne.save(),ae.save(),ne.translate(-X,-q),ae.translate(-X,-q),this._isUnderCache=!0,this._clearSelfAndDescendantCache(s),this._clearSelfAndDescendantCache(f),this.drawScene(Q,this),this.drawHit(re,this),this._isUnderCache=!1,ne.restore(),ae.restore(),Y&&(ne.save(),ne.beginPath(),ne.rect(0,0,V,G),ne.closePath(),ne.setAttr("strokeStyle","red"),ne.setAttr("lineWidth",5),ne.stroke(),ne.restore()),this._cache.set(v,{scene:Q,filter:Z,hit:re,x:X,y:q}),this._requestDraw(),this}isCached(){return this._cache.has(v)}getClientRect(A){throw new Error('abstract "getClientRect" method call')}_transformedRect(A,R){const L=[{x:A.x,y:A.y},{x:A.x+A.width,y:A.y},{x:A.x+A.width,y:A.y+A.height},{x:A.x,y:A.y+A.height}];let V=1/0,G=1/0,W=-1/0,X=-1/0;const q=this.getAbsoluteTransform(R);return L.forEach(function(z){const Y=q.point(z);V===void 0&&(V=W=Y.x,G=X=Y.y),V=Math.min(V,Y.x),G=Math.min(G,Y.y),W=Math.max(W,Y.x),X=Math.max(X,Y.y)}),{x:V,y:G,width:W-V,height:X-G}}_drawCachedSceneCanvas(A){A.save(),A._applyOpacity(this),A._applyGlobalCompositeOperation(this);const R=this._getCanvasCache();A.translate(R.x,R.y);const L=this._getCachedSceneCanvas(),V=L.pixelRatio;A.drawImage(L._canvas,0,0,L.width/V,L.height/V),A.restore()}_drawCachedHitCanvas(A){const R=this._getCanvasCache(),L=R.hit;A.save(),A.translate(R.x,R.y),A.drawImage(L._canvas,0,0,L.width/L.pixelRatio,L.height/L.pixelRatio),A.restore()}_getCachedSceneCanvas(){let A=this.filters(),R=this._getCanvasCache(),L=R.scene,V=R.filter,G=V.getContext(),W,X,q,z;if(A){if(!this._filterUpToDate){const Y=L.pixelRatio;V.setSize(L.width/L.pixelRatio,L.height/L.pixelRatio);try{for(W=A.length,G.clear(),G.drawImage(L._canvas,0,0,L.getWidth()/Y,L.getHeight()/Y),X=G.getImageData(0,0,V.getWidth(),V.getHeight()),q=0;q<W;q++){if(z=A[q],typeof z!="function"){e.Util.error("Filter should be type of function, but got "+typeof z+" instead. Please check correct filters");continue}z.call(this,X),G.putImageData(X,0,0)}}catch(U){e.Util.error("Unable to apply filter. "+U.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return V}return L}on(A,R){if(this._cache&&this._cache.delete(c),arguments.length===3)return this._delegate.apply(this,arguments);let L=A.split(h),V=L.length,G,W,X,q,z;for(G=0;G<V;G++)W=L[G],X=W.split("."),q=X[0],z=X[1]||"",this.eventListeners[q]||(this.eventListeners[q]=[]),this.eventListeners[q].push({name:z,handler:R});return this}off(A,R){let L=(A||"").split(h),V=L.length,G,W,X,q,z,Y;if(this._cache&&this._cache.delete(c),!A)for(W in this.eventListeners)this._off(W);for(G=0;G<V;G++)if(X=L[G],q=X.split("."),z=q[0],Y=q[1],z)this.eventListeners[z]&&this._off(z,Y,R);else for(W in this.eventListeners)this._off(W,Y,R);return this}dispatchEvent(A){const R={target:this,type:A.type,evt:A};return this.fire(A.type,R),this}addEventListener(A,R){return this.on(A,function(L){R.call(this,L.evt)}),this}removeEventListener(A){return this.off(A),this}_delegate(A,R,L){const V=this;this.on(A,function(G){const W=G.target.findAncestors(R,!0,V);for(let X=0;X<W.length;X++)G=e.Util.cloneObject(G),G.currentTarget=W[X],L.call(W[X],G)})}remove(){return this.isDragging()&&this.stopDrag(),a.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(m),this._clearSelfAndDescendantCache(s),this._clearSelfAndDescendantCache(f),this._clearSelfAndDescendantCache(d),this._clearSelfAndDescendantCache(T),this._clearSelfAndDescendantCache(S)}_remove(){this._clearCaches();const A=this.getParent();A&&A.children&&(A.children.splice(this.index,1),A._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(A){const R="get"+e.Util._capitalize(A);return e.Util._isFunction(this[R])?this[R]():this.attrs[A]}getAncestors(){let A=this.getParent(),R=[];for(;A;)R.push(A),A=A.getParent();return R}getAttrs(){return this.attrs||{}}setAttrs(A){return this._batchTransformChanges(()=>{let R,L;if(!A)return this;for(R in A)R!==E&&(L=b+e.Util._capitalize(R),e.Util._isFunction(this[L])?this[L](A[R]):this._setAttr(R,A[R]))}),this}isListening(){return this._getCache(S,this._isListening)}_isListening(A){if(!this.listening())return!1;const L=this.getParent();return L&&L!==A&&this!==A?L._isListening(A):!0}isVisible(){return this._getCache(T,this._isVisible)}_isVisible(A){if(!this.visible())return!1;const L=this.getParent();return L&&L!==A&&this!==A?L._isVisible(A):!0}shouldDrawHit(A,R=!1){if(A)return this._isVisible(A)&&this._isListening(A);const L=this.getLayer();let V=!1;a.DD._dragElements.forEach(W=>{W.dragStatus==="dragging"&&(W.node.nodeType==="Stage"||W.node.getLayer()===L)&&(V=!0)});const G=!R&&!r.Konva.hitOnDragEnabled&&(V||r.Konva.isTransforming());return this.isListening()&&this.isVisible()&&!G}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let A=this.getDepth(),R=this,L=0,V,G,W,X;function q(Y){for(V=[],G=Y.length,W=0;W<G;W++)X=Y[W],L++,X.nodeType!==g&&(V=V.concat(X.getChildren().slice())),X._id===R._id&&(W=G);V.length>0&&V[0].getDepth()<=A&&q(V)}const z=this.getStage();return R.nodeType!==M&&z&&q(z.getChildren()),L}getDepth(){let A=0,R=this.parent;for(;R;)A++,R=R.parent;return A}_batchTransformChanges(A){this._batchingTransformChange=!0,A(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(P),this._clearSelfAndDescendantCache(m)),this._needClearTransformCache=!1}setPosition(A){return this._batchTransformChanges(()=>{this.x(A.x),this.y(A.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const A=this.getStage();if(!A)return null;const R=A.getPointerPosition();if(!R)return null;const L=this.getAbsoluteTransform().copy();return L.invert(),L.point(R)}getAbsolutePosition(A){let R=!1,L=this.parent;for(;L;){if(L.isCached()){R=!0;break}L=L.parent}R&&!A&&(A=!0);const V=this.getAbsoluteTransform(A).getMatrix(),G=new e.Transform,W=this.offset();return G.m=V.slice(),G.translate(W.x,W.y),G.getTranslation()}setAbsolutePosition(A){const{x:R,y:L,...V}=this._clearTransform();this.attrs.x=R,this.attrs.y=L,this._clearCache(P);const G=this._getAbsoluteTransform().copy();return G.invert(),G.translate(A.x,A.y),A={x:this.attrs.x+G.getTranslation().x,y:this.attrs.y+G.getTranslation().y},this._setTransform(V),this.setPosition({x:A.x,y:A.y}),this._clearCache(P),this._clearSelfAndDescendantCache(m),this}_setTransform(A){let R;for(R in A)this.attrs[R]=A[R]}_clearTransform(){const A={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,A}move(A){let R=A.x,L=A.y,V=this.x(),G=this.y();return R!==void 0&&(V+=R),L!==void 0&&(G+=L),this.setPosition({x:V,y:G}),this}_eachAncestorReverse(A,R){let L=[],V=this.getParent(),G,W;if(!(R&&R._id===this._id)){for(L.unshift(this);V&&(!R||V._id!==R._id);)L.unshift(V),V=V.parent;for(G=L.length,W=0;W<G;W++)A(L[W])}}rotate(A){return this.rotation(this.rotation()+A),this}moveToTop(){if(!this.parent)return e.Util.warn("Node has no parent. moveToTop function is ignored."),!1;const A=this.index,R=this.parent.getChildren().length;return A<R-1?(this.parent.children.splice(A,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return e.Util.warn("Node has no parent. moveUp function is ignored."),!1;const A=this.index,R=this.parent.getChildren().length;return A<R-1?(this.parent.children.splice(A,1),this.parent.children.splice(A+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return e.Util.warn("Node has no parent. moveDown function is ignored."),!1;const A=this.index;return A>0?(this.parent.children.splice(A,1),this.parent.children.splice(A-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return e.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;const A=this.index;return A>0?(this.parent.children.splice(A,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(A){if(!this.parent)return e.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(A<0||A>=this.parent.children.length)&&e.Util.warn("Unexpected value "+A+" 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)+".");const R=this.index;return this.parent.children.splice(R,1),this.parent.children.splice(A,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(s,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let A=this.opacity();const R=this.getParent();return R&&!R._isUnderCache&&(A*=R.getAbsoluteOpacity()),A}moveTo(A){return this.getParent()!==A&&(this._remove(),A.add(this)),this}toObject(){let A=this.getAttrs(),R,L,V,G,W;const X={attrs:{},className:this.getClassName()};for(R in A)L=A[R],W=e.Util.isObject(L)&&!e.Util._isPlainObject(L)&&!e.Util._isArray(L),!W&&(V=typeof this[R]=="function"&&this[R],delete A[R],G=V?V.call(this):null,A[R]=L,G!==L&&(X.attrs[R]=L));return e.Util._prepareToStringify(X)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(A,R,L){const V=[];R&&this._isMatch(A)&&V.push(this);let G=this.parent;for(;G;){if(G===L)return V;G._isMatch(A)&&V.push(G),G=G.parent}return V}isAncestorOf(A){return!1}findAncestor(A,R,L){return this.findAncestors(A,R,L)[0]}_isMatch(A){if(!A)return!1;if(typeof A=="function")return A(this);let R=A.replace(/ /g,"").split(","),L=R.length,V,G;for(V=0;V<L;V++)if(G=R[V],e.Util.isValidSelector(G)||(e.Util.warn('Selector "'+G+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),e.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),e.Util.warn("Konva is awesome, right?")),G.charAt(0)==="#"){if(this.id()===G.slice(1))return!0}else if(G.charAt(0)==="."){if(this.hasName(G.slice(1)))return!0}else if(this.className===G||this.nodeType===G)return!0;return!1}getLayer(){const A=this.getParent();return A?A.getLayer():null}getStage(){return this._getCache(d,this._getStage)}_getStage(){const A=this.getParent();return A?A.getStage():null}fire(A,R={},L){return R.target=R.target||this,L?this._fireAndBubble(A,R):this._fire(A,R),this}getAbsoluteTransform(A){return A?this._getAbsoluteTransform(A):this._getCache(m,this._getAbsoluteTransform)}_getAbsoluteTransform(A){let R;if(A)return R=new e.Transform,this._eachAncestorReverse(function(L){const V=L.transformsEnabled();V==="all"?R.multiply(L.getTransform()):V==="position"&&R.translate(L.x()-L.offsetX(),L.y()-L.offsetY())},A),R;{R=this._cache.get(m)||new e.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(R):R.reset();const L=this.transformsEnabled();if(L==="all")R.multiply(this.getTransform());else if(L==="position"){const V=this.attrs.x||0,G=this.attrs.y||0,W=this.attrs.offsetX||0,X=this.attrs.offsetY||0;R.translate(V-W,G-X)}return R.dirty=!1,R}}getAbsoluteScale(A){let R=this;for(;R;)R._isUnderCache&&(A=R),R=R.getParent();const V=this.getAbsoluteTransform(A).decompose();return{x:V.scaleX,y:V.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(P,this._getTransform)}_getTransform(){var A,R;const L=this._cache.get(P)||new e.Transform;L.reset();const V=this.x(),G=this.y(),W=r.Konva.getAngle(this.rotation()),X=(A=this.attrs.scaleX)!==null&&A!==void 0?A:1,q=(R=this.attrs.scaleY)!==null&&R!==void 0?R:1,z=this.attrs.skewX||0,Y=this.attrs.skewY||0,U=this.attrs.offsetX||0,ee=this.attrs.offsetY||0;return(V!==0||G!==0)&&L.translate(V,G),W!==0&&L.rotate(W),(z!==0||Y!==0)&&L.skew(z,Y),(X!==1||q!==1)&&L.scale(X,q),(U!==0||ee!==0)&&L.translate(-1*U,-1*ee),L.dirty=!1,L}clone(A){let R=e.Util.cloneObject(this.attrs),L,V,G,W,X;for(L in A)R[L]=A[L];const q=new this.constructor(R);for(L in this.eventListeners)for(V=this.eventListeners[L],G=V.length,W=0;W<G;W++)X=V[W],X.name.indexOf(w)<0&&(q.eventListeners[L]||(q.eventListeners[L]=[]),q.eventListeners[L].push(X));return q}_toKonvaCanvas(A){A=A||{};const R=this.getClientRect(),L=this.getStage(),V=A.x!==void 0?A.x:Math.floor(R.x),G=A.y!==void 0?A.y:Math.floor(R.y),W=A.pixelRatio||1,X=new t.SceneCanvas({width:A.width||Math.ceil(R.width)||(L?L.width():0),height:A.height||Math.ceil(R.height)||(L?L.height():0),pixelRatio:W}),q=X.getContext(),z=new t.SceneCanvas({width:X.width/X.pixelRatio+Math.abs(V),height:X.height/X.pixelRatio+Math.abs(G),pixelRatio:X.pixelRatio});return A.imageSmoothingEnabled===!1&&(q._context.imageSmoothingEnabled=!1),q.save(),(V||G)&&q.translate(-1*V,-1*G),this.drawScene(X,void 0,z),q.restore(),X}toCanvas(A){return this._toKonvaCanvas(A)._canvas}toDataURL(A){A=A||{};const R=A.mimeType||null,L=A.quality||null,V=this._toKonvaCanvas(A).toDataURL(R,L);return A.callback&&A.callback(V),V}toImage(A){return new Promise((R,L)=>{try{const V=A==null?void 0:A.callback;V&&delete A.callback,e.Util._urlToImage(this.toDataURL(A),function(G){R(G),V==null||V(G)})}catch(V){L(V)}})}toBlob(A){return new Promise((R,L)=>{try{const V=A==null?void 0:A.callback;V&&delete A.callback,this.toCanvas(A).toBlob(G=>{R(G),V==null||V(G)},A==null?void 0:A.mimeType,A==null?void 0:A.quality)}catch(V){L(V)}})}setSize(A){return this.width(A.width),this.height(A.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():r.Konva.dragDistance}_off(A,R,L){let V=this.eventListeners[A],G,W,X;for(G=0;G<V.length;G++)if(W=V[G].name,X=V[G].handler,(W!=="konva"||R==="konva")&&(!R||W===R)&&(!L||L===X)){if(V.splice(G,1),V.length===0){delete this.eventListeners[A];break}G--}}_fireChangeEvent(A,R,L){this._fire(A+y,{oldVal:R,newVal:L})}addName(A){if(!this.hasName(A)){const R=this.name(),L=R?R+" "+A:A;this.name(L)}return this}hasName(A){if(!A)return!1;const R=this.name();return R?(R||"").split(/\s/g).indexOf(A)!==-1:!1}removeName(A){const R=(this.name()||"").split(/\s/g),L=R.indexOf(A);return L!==-1&&(R.splice(L,1),this.name(R.join(" "))),this}setAttr(A,R){const L=this[b+e.Util._capitalize(A)];return e.Util._isFunction(L)?L.call(this,R):this._setAttr(A,R),this}_requestDraw(){if(r.Konva.autoDrawEnabled){const A=this.getLayer()||this.getStage();A==null||A.batchDraw()}}_setAttr(A,R){const L=this.attrs[A];L===R&&!e.Util.isObject(R)||(R==null?delete this.attrs[A]:this.attrs[A]=R,this._shouldFireChangeEvents&&this._fireChangeEvent(A,L,R),this._requestDraw())}_setComponentAttr(A,R,L){let V;L!==void 0&&(V=this.attrs[A],V||(this.attrs[A]=this.getAttr(A)),this.attrs[A][R]=L,this._fireChangeEvent(A,V,L))}_fireAndBubble(A,R,L){if(R&&this.nodeType===g&&(R.target=this),!((A===x||A===_)&&(L&&(this===L||this.isAncestorOf&&this.isAncestorOf(L))||this.nodeType==="Stage"&&!L))){this._fire(A,R);const G=(A===x||A===_)&&L&&L.isAncestorOf&&L.isAncestorOf(this)&&!L.isAncestorOf(this.parent);(R&&!R.cancelBubble||!R)&&this.parent&&this.parent.isListening()&&!G&&(L&&L.parent?this._fireAndBubble.call(this.parent,A,R,L):this._fireAndBubble.call(this.parent,A,R))}}_getProtoListeners(A){var R,L,V;const G=(R=this._cache.get(c))!==null&&R!==void 0?R:{};let W=G==null?void 0:G[A];if(W===void 0){W=[];let X=Object.getPrototypeOf(this);for(;X;){const q=(V=(L=X.eventListeners)===null||L===void 0?void 0:L[A])!==null&&V!==void 0?V:[];W.push(...q),X=Object.getPrototypeOf(X)}G[A]=W,this._cache.set(c,G)}return W}_fire(A,R){R=R||{},R.currentTarget=this,R.type=A;const L=this._getProtoListeners(A);if(L)for(var V=0;V<L.length;V++)L[V].handler.call(this,R);const G=this.eventListeners[A];if(G)for(var V=0;V<G.length;V++)G[V].handler.call(this,R)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(A){const R=A?A.pointerId:void 0,L=this.getStage(),V=this.getAbsolutePosition();if(!L)return;const G=L._getPointerById(R)||L._changedPointerPositions[0]||V;a.DD._dragElements.set(this._id,{node:this,startPointerPos:G,offset:{x:G.x-V.x,y:G.y-V.y},dragStatus:"ready",pointerId:R})}startDrag(A,R=!0){a.DD._dragElements.has(this._id)||this._createDragElement(A);const L=a.DD._dragElements.get(this._id);L.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:A&&A.evt},R)}_setDragPosition(A,R){const L=this.getStage()._getPointerById(R.pointerId);if(!L)return;let V={x:L.x-R.offset.x,y:L.y-R.offset.y};const G=this.dragBoundFunc();if(G!==void 0){const W=G.call(this,V,A);W?V=W:e.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==V.x||this._lastPos.y!==V.y)&&(this.setAbsolutePosition(V),this._requestDraw()),this._lastPos=V}stopDrag(A){const R=a.DD._dragElements.get(this._id);R&&(R.dragStatus="stopped"),a.DD._endDragBefore(A),a.DD._endDragAfter(A)}setDraggable(A){this._setAttr("draggable",A),this._dragChange()}isDragging(){const A=a.DD._dragElements.get(this._id);return A?A.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(A){if(!(!(A.evt.button!==void 0)||r.Konva.dragButtons.indexOf(A.evt.button)>=0)||this.isDragging())return;let V=!1;a.DD._dragElements.forEach(G=>{this.isAncestorOf(G.node)&&(V=!0)}),V||this._createDragElement(A)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const R=a.DD._dragElements.get(this._id),L=R&&R.dragStatus==="dragging",V=R&&R.dragStatus==="ready";L?this.stopDrag():V&&a.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(A={x:0,y:0}){const R=this.getStage();if(!R)return!1;const L={x:-A.x,y:-A.y,width:R.width()+2*A.x,height:R.height()+2*A.y};return e.Util.haveIntersection(L,this.getClientRect())}static create(A,R){return e.Util._isString(A)&&(A=JSON.parse(A)),this._createNode(A,R)}static _createNode(A,R){let L=k.prototype.getClassName.call(A),V=A.children,G,W,X;R&&(A.attrs.container=R),r.Konva[L]||(e.Util.warn('Can not find a node with class name "'+L+'". Fallback to "Shape".'),L="Shape");const q=r.Konva[L];if(G=new q(A.attrs),V)for(W=V.length,X=0;X<W;X++)G.add(k._createNode(V[X]));return G}}wf.Node=k,k.prototype.nodeType="Node",k.prototype._attrsAffectingSize=[],k.prototype.eventListeners={},k.prototype.on.call(k.prototype,I,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(P),this._clearSelfAndDescendantCache(m)}),k.prototype.on.call(k.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(T)}),k.prototype.on.call(k.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(S)}),k.prototype.on.call(k.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(s)});const O=n.Factory.addGetterSetter;return O(k,"zIndex"),O(k,"absolutePosition"),O(k,"position"),O(k,"x",0,(0,o.getNumberValidator)()),O(k,"y",0,(0,o.getNumberValidator)()),O(k,"globalCompositeOperation","source-over",(0,o.getStringValidator)()),O(k,"opacity",1,(0,o.getNumberValidator)()),O(k,"name","",(0,o.getStringValidator)()),O(k,"id","",(0,o.getStringValidator)()),O(k,"rotation",0,(0,o.getNumberValidator)()),n.Factory.addComponentsGetterSetter(k,"scale",["x","y"]),O(k,"scaleX",1,(0,o.getNumberValidator)()),O(k,"scaleY",1,(0,o.getNumberValidator)()),n.Factory.addComponentsGetterSetter(k,"skew",["x","y"]),O(k,"skewX",0,(0,o.getNumberValidator)()),O(k,"skewY",0,(0,o.getNumberValidator)()),n.Factory.addComponentsGetterSetter(k,"offset",["x","y"]),O(k,"offsetX",0,(0,o.getNumberValidator)()),O(k,"offsetY",0,(0,o.getNumberValidator)()),O(k,"dragDistance",void 0,(0,o.getNumberValidator)()),O(k,"width",0,(0,o.getNumberValidator)()),O(k,"height",0,(0,o.getNumberValidator)()),O(k,"listening",!0,(0,o.getBooleanValidator)()),O(k,"preventDefault",!0,(0,o.getBooleanValidator)()),O(k,"filters",void 0,function(N){return this._filterUpToDate=!1,N}),O(k,"visible",!0,(0,o.getBooleanValidator)()),O(k,"transformsEnabled","all",(0,o.getStringValidator)()),O(k,"size"),O(k,"dragBoundFunc"),O(k,"draggable",!1,(0,o.getBooleanValidator)()),n.Factory.backCompat(k,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"}),wf}var _f={},hy;function zp(){if(hy)return _f;hy=1,Object.defineProperty(_f,"__esModule",{value:!0}),_f.Container=void 0;const e=qt(),n=Hr(),t=Vt();let r=class extends n.Node{constructor(){super(...arguments),this.children=[]}getChildren(o){if(!o)return this.children||[];const s=this.children||[],c=[];return s.forEach(function(m){o(m)&&c.push(m)}),c}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(o=>{o.parent=null,o.index=0,o.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(o=>{o.parent=null,o.index=0,o.destroy()}),this.children=[],this._requestDraw(),this}add(...o){if(o.length===0)return this;if(o.length>1){for(let c=0;c<o.length;c++)this.add(o[c]);return this}const s=o[0];return s.getParent()?(s.moveTo(this),this):(this._validateAdd(s),s.index=this.getChildren().length,s.parent=this,s._clearCaches(),this.getChildren().push(s),this._fire("add",{child:s}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(o){return this._generalFind(o,!1)}findOne(o){const s=this._generalFind(o,!0);return s.length>0?s[0]:void 0}_generalFind(o,s){const c=[];return this._descendants(m=>{const f=m._isMatch(o);return f&&c.push(m),!!(f&&s)}),c}_descendants(o){let s=!1;const c=this.getChildren();for(const m of c){if(s=o(m),s)return!0;if(m.hasChildren()&&(s=m._descendants(o),s))return!0}return!1}toObject(){const o=n.Node.prototype.toObject.call(this);return o.children=[],this.getChildren().forEach(s=>{o.children.push(s.toObject())}),o}isAncestorOf(o){let s=o.getParent();for(;s;){if(s._id===this._id)return!0;s=s.getParent()}return!1}clone(o){const s=n.Node.prototype.clone.call(this,o);return this.getChildren().forEach(function(c){s.add(c.clone())}),s}getAllIntersections(o){const s=[];return this.find("Shape").forEach(c=>{c.isVisible()&&c.intersects(o)&&s.push(c)}),s}_clearSelfAndDescendantCache(o){var s;super._clearSelfAndDescendantCache(o),!this.isCached()&&((s=this.children)===null||s===void 0||s.forEach(function(c){c._clearSelfAndDescendantCache(o)}))}_setChildrenIndices(){var o;(o=this.children)===null||o===void 0||o.forEach(function(s,c){s.index=c}),this._requestDraw()}drawScene(o,s,c){const m=this.getLayer(),f=o||m&&m.getCanvas(),v=f&&f.getContext(),y=this._getCanvasCache(),E=y&&y.scene,w=f&&f.isCache;if(!this.isVisible()&&!w)return this;if(E){v.save();const S=this.getAbsoluteTransform(s).getMatrix();v.transform(S[0],S[1],S[2],S[3],S[4],S[5]),this._drawCachedSceneCanvas(v),v.restore()}else this._drawChildren("drawScene",f,s,c);return this}drawHit(o,s){if(!this.shouldDrawHit(s))return this;const c=this.getLayer(),m=o||c&&c.hitCanvas,f=m&&m.getContext(),v=this._getCanvasCache();if(v&&v.hit){f.save();const E=this.getAbsoluteTransform(s).getMatrix();f.transform(E[0],E[1],E[2],E[3],E[4],E[5]),this._drawCachedHitCanvas(f),f.restore()}else this._drawChildren("drawHit",m,s);return this}_drawChildren(o,s,c,m){var f;const v=s&&s.getContext(),y=this.clipWidth(),E=this.clipHeight(),w=this.clipFunc(),S=typeof y=="number"&&typeof E=="number"||w,x=c===this;if(S){v.save();const b=this.getAbsoluteTransform(c);let g=b.getMatrix();v.transform(g[0],g[1],g[2],g[3],g[4],g[5]),v.beginPath();let h;if(w)h=w.call(this,v,this);else{const d=this.clipX(),P=this.clipY();v.rect(d||0,P||0,y,E)}v.clip.apply(v,h),g=b.copy().invert().getMatrix(),v.transform(g[0],g[1],g[2],g[3],g[4],g[5])}const _=!x&&this.globalCompositeOperation()!=="source-over"&&o==="drawScene";_&&(v.save(),v._applyGlobalCompositeOperation(this)),(f=this.children)===null||f===void 0||f.forEach(function(b){b[o](s,c,m)}),_&&v.restore(),S&&v.restore()}getClientRect(o={}){var s;const c=o.skipTransform,m=o.relativeTo;let f,v,y,E,w={x:1/0,y:1/0,width:0,height:0};const S=this;(s=this.children)===null||s===void 0||s.forEach(function(b){if(!b.visible())return;const g=b.getClientRect({relativeTo:S,skipShadow:o.skipShadow,skipStroke:o.skipStroke});g.width===0&&g.height===0||(f===void 0?(f=g.x,v=g.y,y=g.x+g.width,E=g.y+g.height):(f=Math.min(f,g.x),v=Math.min(v,g.y),y=Math.max(y,g.x+g.width),E=Math.max(E,g.y+g.height)))});const x=this.find("Shape");let _=!1;for(let b=0;b<x.length;b++)if(x[b]._isVisible(this)){_=!0;break}return _&&f!==void 0?w={x:f,y:v,width:y-f,height:E-v}:w={x:0,y:0,width:0,height:0},c?w:this._transformedRect(w,m)}};return _f.Container=r,e.Factory.addComponentsGetterSetter(r,"clip",["x","y","width","height"]),e.Factory.addGetterSetter(r,"clipX",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(r,"clipY",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(r,"clipWidth",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(r,"clipHeight",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(r,"clipFunc"),_f}var $g={},Bl={},py;function b5(){if(py)return Bl;py=1,Object.defineProperty(Bl,"__esModule",{value:!0}),Bl.getCapturedShape=r,Bl.createEvent=a,Bl.hasPointerCapture=o,Bl.setPointerCapture=s,Bl.releaseCapture=c;const e=Dt(),n=new Map,t=e.Konva._global.PointerEvent!==void 0;function r(m){return n.get(m)}function a(m){return{evt:m,pointerId:m.pointerId}}function o(m,f){return n.get(m)===f}function s(m,f){c(m),f.getStage()&&(n.set(m,f),t&&f._fire("gotpointercapture",a(new PointerEvent("gotpointercapture"))))}function c(m,f){const v=n.get(m);if(!v)return;const y=v.getStage();y&&y.content,n.delete(m),t&&v._fire("lostpointercapture",a(new PointerEvent("lostpointercapture")))}return Bl}var gy;function f9(){return gy||(gy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const n=Lr(),t=qt(),r=zp(),a=Dt(),o=Fp(),s=Av(),c=Dt(),m=b5(),f="Stage",v="string",y="px",E="mouseout",w="mouseleave",S="mouseover",x="mouseenter",_="mousemove",b="mousedown",g="mouseup",h="pointermove",d="pointerdown",P="pointerup",M="pointercancel",T="lostpointercapture",I="pointerout",F="pointerleave",k="pointerover",O="pointerenter",N="contextmenu",A="touchstart",R="touchend",L="touchmove",V="touchcancel",G="wheel",W=5,X=[[x,"_pointerenter"],[b,"_pointerdown"],[_,"_pointermove"],[g,"_pointerup"],[w,"_pointerleave"],[A,"_pointerdown"],[L,"_pointermove"],[R,"_pointerup"],[V,"_pointercancel"],[S,"_pointerover"],[G,"_wheel"],[N,"_contextmenu"],[d,"_pointerdown"],[h,"_pointermove"],[P,"_pointerup"],[M,"_pointercancel"],[T,"_lostpointercapture"]],q={mouse:{[I]:E,[F]:w,[k]:S,[O]:x,[h]:_,[d]:b,[P]:g,[M]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[I]:"touchout",[F]:"touchleave",[k]:"touchover",[O]:"touchenter",[h]:L,[d]:A,[P]:R,[M]:V,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[I]:I,[F]:F,[k]:k,[O]:O,[h]:h,[d]:d,[P]:P,[M]:M,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},z=Q=>Q.indexOf("pointer")>=0?"pointer":Q.indexOf("touch")>=0?"touch":"mouse",Y=Q=>{const Z=z(Q);if(Z==="pointer")return a.Konva.pointerEventsEnabled&&q.pointer;if(Z==="touch")return q.touch;if(Z==="mouse")return q.mouse};function U(Q={}){return(Q.clipFunc||Q.clipWidth||Q.clipHeight)&&n.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),Q}const ee="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);";e.stages=[];class te extends r.Container{constructor(Z){super(U(Z)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),e.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{U(this.attrs)}),this._checkVisibility()}_validateAdd(Z){const re=Z.getType()==="Layer",ne=Z.getType()==="FastLayer";re||ne||n.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const Z=this.visible()?"":"none";this.content.style.display=Z}setContainer(Z){if(typeof Z===v){if(Z.charAt(0)==="."){const ne=Z.slice(1);Z=document.getElementsByClassName(ne)[0]}else{var re;Z.charAt(0)!=="#"?re=Z:re=Z.slice(1),Z=document.getElementById(re)}if(!Z)throw"Can not find container in document with id "+re}return this._setAttr("container",Z),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),Z.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const Z=this.children,re=Z.length;for(let ne=0;ne<re;ne++)Z[ne].clear();return this}clone(Z){return Z||(Z={}),Z.container=typeof document<"u"&&document.createElement("div"),r.Container.prototype.clone.call(this,Z)}destroy(){super.destroy();const Z=this.content;Z&&n.Util._isInDocument(Z)&&this.container().removeChild(Z);const re=e.stages.indexOf(this);return re>-1&&e.stages.splice(re,1),n.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const Z=this._pointerPositions[0]||this._changedPointerPositions[0];return Z?{x:Z.x,y:Z.y}:(n.Util.warn(ee),null)}_getPointerById(Z){return this._pointerPositions.find(re=>re.id===Z)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(Z){Z=Z||{},Z.x=Z.x||0,Z.y=Z.y||0,Z.width=Z.width||this.width(),Z.height=Z.height||this.height();const re=new o.SceneCanvas({width:Z.width,height:Z.height,pixelRatio:Z.pixelRatio||1}),ne=re.getContext()._context,ae=this.children;return(Z.x||Z.y)&&ne.translate(-1*Z.x,-1*Z.y),ae.forEach(function(ue){if(!ue.isVisible())return;const fe=ue._toKonvaCanvas(Z);ne.drawImage(fe._canvas,Z.x,Z.y,fe.getWidth()/fe.getPixelRatio(),fe.getHeight()/fe.getPixelRatio())}),re}getIntersection(Z){if(!Z)return null;const re=this.children,ne=re.length,ae=ne-1;for(let ue=ae;ue>=0;ue--){const fe=re[ue].getIntersection(Z);if(fe)return fe}return null}_resizeDOM(){const Z=this.width(),re=this.height();this.content&&(this.content.style.width=Z+y,this.content.style.height=re+y),this.bufferCanvas.setSize(Z,re),this.bufferHitCanvas.setSize(Z,re),this.children.forEach(ne=>{ne.setSize({width:Z,height:re}),ne.draw()})}add(Z,...re){if(arguments.length>1){for(let ae=0;ae<arguments.length;ae++)this.add(arguments[ae]);return this}super.add(Z);const ne=this.children.length;return ne>W&&n.Util.warn("The stage has "+ne+" 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."),Z.setSize({width:this.width(),height:this.height()}),Z.draw(),a.Konva.isBrowser&&this.content.appendChild(Z.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(Z){return m.hasPointerCapture(Z,this)}setPointerCapture(Z){m.setPointerCapture(Z,this)}releaseCapture(Z){m.releaseCapture(Z,this)}getLayers(){return this.children}_bindContentEvents(){a.Konva.isBrowser&&X.forEach(([Z,re])=>{this.content.addEventListener(Z,ne=>{this[re](ne)},{passive:!1})})}_pointerenter(Z){this.setPointersPositions(Z);const re=Y(Z.type);re&&this._fire(re.pointerenter,{evt:Z,target:this,currentTarget:this})}_pointerover(Z){this.setPointersPositions(Z);const re=Y(Z.type);re&&this._fire(re.pointerover,{evt:Z,target:this,currentTarget:this})}_getTargetShape(Z){let re=this[Z+"targetShape"];return re&&!re.getStage()&&(re=null),re}_pointerleave(Z){const re=Y(Z.type),ne=z(Z.type);if(!re)return;this.setPointersPositions(Z);const ae=this._getTargetShape(ne),ue=!(a.Konva.isDragging()||a.Konva.isTransforming())||a.Konva.hitOnDragEnabled;ae&&ue?(ae._fireAndBubble(re.pointerout,{evt:Z}),ae._fireAndBubble(re.pointerleave,{evt:Z}),this._fire(re.pointerleave,{evt:Z,target:this,currentTarget:this}),this[ne+"targetShape"]=null):ue&&(this._fire(re.pointerleave,{evt:Z,target:this,currentTarget:this}),this._fire(re.pointerout,{evt:Z,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(Z){const re=Y(Z.type),ne=z(Z.type);if(!re)return;this.setPointersPositions(Z);let ae=!1;this._changedPointerPositions.forEach(ue=>{const fe=this.getIntersection(ue);if(s.DD.justDragged=!1,a.Konva["_"+ne+"ListenClick"]=!0,!fe||!fe.isListening()){this[ne+"ClickStartShape"]=void 0;return}a.Konva.capturePointerEventsEnabled&&fe.setPointerCapture(ue.id),this[ne+"ClickStartShape"]=fe,fe._fireAndBubble(re.pointerdown,{evt:Z,pointerId:ue.id}),ae=!0;const pe=Z.type.indexOf("touch")>=0;fe.preventDefault()&&Z.cancelable&&pe&&Z.preventDefault()}),ae||this._fire(re.pointerdown,{evt:Z,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(Z){const re=Y(Z.type),ne=z(Z.type);if(!re||(a.Konva.isDragging()&&s.DD.node.preventDefault()&&Z.cancelable&&Z.preventDefault(),this.setPointersPositions(Z),!(!(a.Konva.isDragging()||a.Konva.isTransforming())||a.Konva.hitOnDragEnabled)))return;const ue={};let fe=!1;const pe=this._getTargetShape(ne);this._changedPointerPositions.forEach(ye=>{const we=m.getCapturedShape(ye.id)||this.getIntersection(ye),je=ye.id,Te={evt:Z,pointerId:je},se=pe!==we;if(se&&pe&&(pe._fireAndBubble(re.pointerout,{...Te},we),pe._fireAndBubble(re.pointerleave,{...Te},we)),we){if(ue[we._id])return;ue[we._id]=!0}we&&we.isListening()?(fe=!0,se&&(we._fireAndBubble(re.pointerover,{...Te},pe),we._fireAndBubble(re.pointerenter,{...Te},pe),this[ne+"targetShape"]=we),we._fireAndBubble(re.pointermove,{...Te})):pe&&(this._fire(re.pointerover,{evt:Z,target:this,currentTarget:this,pointerId:je}),this[ne+"targetShape"]=null)}),fe||this._fire(re.pointermove,{evt:Z,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(Z){const re=Y(Z.type),ne=z(Z.type);if(!re)return;this.setPointersPositions(Z);const ae=this[ne+"ClickStartShape"],ue=this[ne+"ClickEndShape"],fe={};let pe=!1;this._changedPointerPositions.forEach(ye=>{const we=m.getCapturedShape(ye.id)||this.getIntersection(ye);if(we){if(we.releaseCapture(ye.id),fe[we._id])return;fe[we._id]=!0}const je=ye.id,Te={evt:Z,pointerId:je};let se=!1;a.Konva["_"+ne+"InDblClickWindow"]?(se=!0,clearTimeout(this[ne+"DblTimeout"])):s.DD.justDragged||(a.Konva["_"+ne+"InDblClickWindow"]=!0,clearTimeout(this[ne+"DblTimeout"])),this[ne+"DblTimeout"]=setTimeout(function(){a.Konva["_"+ne+"InDblClickWindow"]=!1},a.Konva.dblClickWindow),we&&we.isListening()?(pe=!0,this[ne+"ClickEndShape"]=we,we._fireAndBubble(re.pointerup,{...Te}),a.Konva["_"+ne+"ListenClick"]&&ae&&ae===we&&(we._fireAndBubble(re.pointerclick,{...Te}),se&&ue&&ue===we&&we._fireAndBubble(re.pointerdblclick,{...Te}))):(this[ne+"ClickEndShape"]=null,a.Konva["_"+ne+"ListenClick"]&&this._fire(re.pointerclick,{evt:Z,target:this,currentTarget:this,pointerId:je}),se&&this._fire(re.pointerdblclick,{evt:Z,target:this,currentTarget:this,pointerId:je}))}),pe||this._fire(re.pointerup,{evt:Z,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),a.Konva["_"+ne+"ListenClick"]=!1,Z.cancelable&&ne!=="touch"&&ne!=="pointer"&&Z.preventDefault()}_contextmenu(Z){this.setPointersPositions(Z);const re=this.getIntersection(this.getPointerPosition());re&&re.isListening()?re._fireAndBubble(N,{evt:Z}):this._fire(N,{evt:Z,target:this,currentTarget:this})}_wheel(Z){this.setPointersPositions(Z);const re=this.getIntersection(this.getPointerPosition());re&&re.isListening()?re._fireAndBubble(G,{evt:Z}):this._fire(G,{evt:Z,target:this,currentTarget:this})}_pointercancel(Z){this.setPointersPositions(Z);const re=m.getCapturedShape(Z.pointerId)||this.getIntersection(this.getPointerPosition());re&&re._fireAndBubble(P,m.createEvent(Z)),m.releaseCapture(Z.pointerId)}_lostpointercapture(Z){m.releaseCapture(Z.pointerId)}setPointersPositions(Z){const re=this._getContentPosition();let ne=null,ae=null;Z=Z||window.event,Z.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(Z.touches,ue=>{this._pointerPositions.push({id:ue.identifier,x:(ue.clientX-re.left)/re.scaleX,y:(ue.clientY-re.top)/re.scaleY})}),Array.prototype.forEach.call(Z.changedTouches||Z.touches,ue=>{this._changedPointerPositions.push({id:ue.identifier,x:(ue.clientX-re.left)/re.scaleX,y:(ue.clientY-re.top)/re.scaleY})})):(ne=(Z.clientX-re.left)/re.scaleX,ae=(Z.clientY-re.top)/re.scaleY,this.pointerPos={x:ne,y:ae},this._pointerPositions=[{x:ne,y:ae,id:n.Util._getFirstPointerId(Z)}],this._changedPointerPositions=[{x:ne,y:ae,id:n.Util._getFirstPointerId(Z)}])}_setPointerPosition(Z){n.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(Z)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const Z=this.content.getBoundingClientRect();return{top:Z.top,left:Z.left,scaleX:Z.width/this.content.clientWidth||1,scaleY:Z.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new o.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new o.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!a.Konva.isBrowser)return;const Z=this.container();if(!Z)throw"Stage has no container. A container is required.";Z.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),Z.appendChild(this.content),this._resizeDOM()}cache(){return n.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(Z){Z.batchDraw()}),this}}e.Stage=te,te.prototype.nodeType=f,(0,c._registerNode)(te),t.Factory.addGetterSetter(te,"container"),a.Konva.isBrowser&&document.addEventListener("visibilitychange",()=>{e.stages.forEach(Q=>{Q.batchDraw()})})}($g)),$g}var Sf={},Wg={},vy;function bn(){return vy||(vy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const n=Dt(),t=Lr(),r=qt(),a=Hr(),o=Vt(),s=Dt(),c=b5(),m="hasShadow",f="shadowRGBA",v="patternImage",y="linearGradient",E="radialGradient";let w;function S(){return w||(w=t.Util.createCanvasElement().getContext("2d"),w)}e.shapes={};function x(F){const k=this.attrs.fillRule;k?F.fill(k):F.fill()}function _(F){F.stroke()}function b(F){const k=this.attrs.fillRule;k?F.fill(k):F.fill()}function g(F){F.stroke()}function h(){this._clearCache(m)}function d(){this._clearCache(f)}function P(){this._clearCache(v)}function M(){this._clearCache(y)}function T(){this._clearCache(E)}class I extends a.Node{constructor(k){super(k);let O;for(;O=t.Util.getRandomColor(),!(O&&!(O in e.shapes)););this.colorKey=O,e.shapes[O]=this}getContext(){return t.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return t.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(m,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(v,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const O=S().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(O&&O.setTransform){const N=new t.Transform;N.translate(this.fillPatternX(),this.fillPatternY()),N.rotate(n.Konva.getAngle(this.fillPatternRotation())),N.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),N.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const A=N.getMatrix(),R=typeof DOMMatrix>"u"?{a:A[0],b:A[1],c:A[2],d:A[3],e:A[4],f:A[5]}:new DOMMatrix(A);O.setTransform(R)}return O}}_getLinearGradient(){return this._getCache(y,this.__getLinearGradient)}__getLinearGradient(){const k=this.fillLinearGradientColorStops();if(k){const O=S(),N=this.fillLinearGradientStartPoint(),A=this.fillLinearGradientEndPoint(),R=O.createLinearGradient(N.x,N.y,A.x,A.y);for(let L=0;L<k.length;L+=2)R.addColorStop(k[L],k[L+1]);return R}}_getRadialGradient(){return this._getCache(E,this.__getRadialGradient)}__getRadialGradient(){const k=this.fillRadialGradientColorStops();if(k){const O=S(),N=this.fillRadialGradientStartPoint(),A=this.fillRadialGradientEndPoint(),R=O.createRadialGradient(N.x,N.y,this.fillRadialGradientStartRadius(),A.x,A.y,this.fillRadialGradientEndRadius());for(let L=0;L<k.length;L+=2)R.addColorStop(k[L],k[L+1]);return R}}getShadowRGBA(){return this._getCache(f,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const k=t.Util.colorToRGBA(this.shadowColor());if(k)return"rgba("+k.r+","+k.g+","+k.b+","+k.a*(this.shadowOpacity()||1)+")"}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const k=this.hitStrokeWidth();return k==="auto"?this.hasStroke():this.strokeEnabled()&&!!k}intersects(k){const O=this.getStage();if(!O)return!1;const N=O.bufferHitCanvas;return N.getContext().clear(),this.drawHit(N,void 0,!0),N.context.getImageData(Math.round(k.x),Math.round(k.y),1,1).data[3]>0}destroy(){return a.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(k){var O;if(!((O=this.attrs.perfectDrawEnabled)!==null&&O!==void 0?O:!0))return!1;const A=k||this.hasFill(),R=this.hasStroke(),L=this.getAbsoluteOpacity()!==1;if(A&&R&&L)return!0;const V=this.hasShadow(),G=this.shadowForStrokeEnabled();return!!(A&&R&&V&&G)}setStrokeHitEnabled(k){t.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),k?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const k=this.size();return{x:this._centroid?-k.width/2:0,y:this._centroid?-k.height/2:0,width:k.width,height:k.height}}getClientRect(k={}){let O=!1,N=this.getParent();for(;N;){if(N.isCached()){O=!0;break}N=N.getParent()}const A=k.skipTransform,R=k.relativeTo||O&&this.getStage()||void 0,L=this.getSelfRect(),G=!k.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,W=L.width+G,X=L.height+G,q=!k.skipShadow&&this.hasShadow(),z=q?this.shadowOffsetX():0,Y=q?this.shadowOffsetY():0,U=W+Math.abs(z),ee=X+Math.abs(Y),te=q&&this.shadowBlur()||0,Q=U+te*2,Z=ee+te*2,re={width:Q,height:Z,x:-(G/2+te)+Math.min(z,0)+L.x,y:-(G/2+te)+Math.min(Y,0)+L.y};return A?re:this._transformedRect(re,R)}drawScene(k,O,N){const A=this.getLayer();let R=k||A.getCanvas(),L=R.getContext(),V=this._getCanvasCache(),G=this.getSceneFunc(),W=this.hasShadow(),X,q;const z=R.isCache,Y=O===this;if(!this.isVisible()&&!Y)return this;if(V){L.save();const ee=this.getAbsoluteTransform(O).getMatrix();return L.transform(ee[0],ee[1],ee[2],ee[3],ee[4],ee[5]),this._drawCachedSceneCanvas(L),L.restore(),this}if(!G)return this;if(L.save(),this._useBufferCanvas()&&!z){X=this.getStage();const ee=N||X.bufferCanvas;q=ee.getContext(),q.clear(),q.save(),q._applyLineJoin(this);var U=this.getAbsoluteTransform(O).getMatrix();q.transform(U[0],U[1],U[2],U[3],U[4],U[5]),G.call(this,q,this),q.restore();const te=ee.pixelRatio;W&&L._applyShadow(this),L._applyOpacity(this),L._applyGlobalCompositeOperation(this),L.drawImage(ee._canvas,0,0,ee.width/te,ee.height/te)}else{if(L._applyLineJoin(this),!Y){var U=this.getAbsoluteTransform(O).getMatrix();L.transform(U[0],U[1],U[2],U[3],U[4],U[5]),L._applyOpacity(this),L._applyGlobalCompositeOperation(this)}W&&L._applyShadow(this),G.call(this,L,this)}return L.restore(),this}drawHit(k,O,N=!1){if(!this.shouldDrawHit(O,N))return this;const A=this.getLayer(),R=k||A.hitCanvas,L=R&&R.getContext(),V=this.hitFunc()||this.sceneFunc(),G=this._getCanvasCache(),W=G&&G.hit;if(this.colorKey||t.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),W){L.save();const q=this.getAbsoluteTransform(O).getMatrix();return L.transform(q[0],q[1],q[2],q[3],q[4],q[5]),this._drawCachedHitCanvas(L),L.restore(),this}if(!V)return this;if(L.save(),L._applyLineJoin(this),!(this===O)){const q=this.getAbsoluteTransform(O).getMatrix();L.transform(q[0],q[1],q[2],q[3],q[4],q[5])}return V.call(this,L,this),L.restore(),this}drawHitFromCache(k=0){const O=this._getCanvasCache(),N=this._getCachedSceneCanvas(),A=O.hit,R=A.getContext(),L=A.getWidth(),V=A.getHeight();R.clear(),R.drawImage(N._canvas,0,0,L,V);try{const G=R.getImageData(0,0,L,V),W=G.data,X=W.length,q=t.Util._hexToRgb(this.colorKey);for(let z=0;z<X;z+=4)W[z+3]>k?(W[z]=q.r,W[z+1]=q.g,W[z+2]=q.b,W[z+3]=255):W[z+3]=0;R.putImageData(G,0,0)}catch(G){t.Util.error("Unable to draw hit graph from cached scene canvas. "+G.message)}return this}hasPointerCapture(k){return c.hasPointerCapture(k,this)}setPointerCapture(k){c.setPointerCapture(k,this)}releaseCapture(k){c.releaseCapture(k,this)}}e.Shape=I,I.prototype._fillFunc=x,I.prototype._strokeFunc=_,I.prototype._fillFuncHit=b,I.prototype._strokeFuncHit=g,I.prototype._centroid=!1,I.prototype.nodeType="Shape",(0,s._registerNode)(I),I.prototype.eventListeners={},I.prototype.on.call(I.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",h),I.prototype.on.call(I.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",d),I.prototype.on.call(I.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",P),I.prototype.on.call(I.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",M),I.prototype.on.call(I.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",T),r.Factory.addGetterSetter(I,"stroke",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(I,"strokeWidth",2,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillAfterStrokeEnabled",!1),r.Factory.addGetterSetter(I,"hitStrokeWidth","auto",(0,o.getNumberOrAutoValidator)()),r.Factory.addGetterSetter(I,"strokeHitEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(I,"perfectDrawEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(I,"shadowForStrokeEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(I,"lineJoin"),r.Factory.addGetterSetter(I,"lineCap"),r.Factory.addGetterSetter(I,"sceneFunc"),r.Factory.addGetterSetter(I,"hitFunc"),r.Factory.addGetterSetter(I,"dash"),r.Factory.addGetterSetter(I,"dashOffset",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"shadowColor",void 0,(0,o.getStringValidator)()),r.Factory.addGetterSetter(I,"shadowBlur",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"shadowOpacity",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(I,"shadowOffset",["x","y"]),r.Factory.addGetterSetter(I,"shadowOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"shadowOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillPatternImage"),r.Factory.addGetterSetter(I,"fill",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(I,"fillPatternX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillPatternY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillLinearGradientColorStops"),r.Factory.addGetterSetter(I,"strokeLinearGradientColorStops"),r.Factory.addGetterSetter(I,"fillRadialGradientStartRadius",0),r.Factory.addGetterSetter(I,"fillRadialGradientEndRadius",0),r.Factory.addGetterSetter(I,"fillRadialGradientColorStops"),r.Factory.addGetterSetter(I,"fillPatternRepeat","repeat"),r.Factory.addGetterSetter(I,"fillEnabled",!0),r.Factory.addGetterSetter(I,"strokeEnabled",!0),r.Factory.addGetterSetter(I,"shadowEnabled",!0),r.Factory.addGetterSetter(I,"dashEnabled",!0),r.Factory.addGetterSetter(I,"strokeScaleEnabled",!0),r.Factory.addGetterSetter(I,"fillPriority","color"),r.Factory.addComponentsGetterSetter(I,"fillPatternOffset",["x","y"]),r.Factory.addGetterSetter(I,"fillPatternOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillPatternOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(I,"fillPatternScale",["x","y"]),r.Factory.addGetterSetter(I,"fillPatternScaleX",1,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillPatternScaleY",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(I,"fillLinearGradientStartPoint",["x","y"]),r.Factory.addComponentsGetterSetter(I,"strokeLinearGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(I,"fillLinearGradientStartPointX",0),r.Factory.addGetterSetter(I,"strokeLinearGradientStartPointX",0),r.Factory.addGetterSetter(I,"fillLinearGradientStartPointY",0),r.Factory.addGetterSetter(I,"strokeLinearGradientStartPointY",0),r.Factory.addComponentsGetterSetter(I,"fillLinearGradientEndPoint",["x","y"]),r.Factory.addComponentsGetterSetter(I,"strokeLinearGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(I,"fillLinearGradientEndPointX",0),r.Factory.addGetterSetter(I,"strokeLinearGradientEndPointX",0),r.Factory.addGetterSetter(I,"fillLinearGradientEndPointY",0),r.Factory.addGetterSetter(I,"strokeLinearGradientEndPointY",0),r.Factory.addComponentsGetterSetter(I,"fillRadialGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(I,"fillRadialGradientStartPointX",0),r.Factory.addGetterSetter(I,"fillRadialGradientStartPointY",0),r.Factory.addComponentsGetterSetter(I,"fillRadialGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(I,"fillRadialGradientEndPointX",0),r.Factory.addGetterSetter(I,"fillRadialGradientEndPointY",0),r.Factory.addGetterSetter(I,"fillPatternRotation",0),r.Factory.addGetterSetter(I,"fillRule",void 0,(0,o.getStringValidator)()),r.Factory.backCompat(I,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})}(Wg)),Wg}var my;function w5(){if(my)return Sf;my=1,Object.defineProperty(Sf,"__esModule",{value:!0}),Sf.Layer=void 0;const e=Lr(),n=zp(),t=Hr(),r=qt(),a=Fp(),o=Vt(),s=bn(),c=Dt(),m="#",f="beforeDraw",v="draw",y=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],E=y.length;class w extends n.Container{constructor(x){super(x),this.canvas=new a.SceneCanvas,this.hitCanvas=new a.HitCanvas({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(x){return this.getContext().clear(x),this.getHitCanvas().getContext().clear(x),this}setZIndex(x){super.setZIndex(x);const _=this.getStage();return _&&_.content&&(_.content.removeChild(this.getNativeCanvasElement()),x<_.children.length-1?_.content.insertBefore(this.getNativeCanvasElement(),_.children[x+1].getCanvas()._canvas):_.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){t.Node.prototype.moveToTop.call(this);const x=this.getStage();return x&&x.content&&(x.content.removeChild(this.getNativeCanvasElement()),x.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!t.Node.prototype.moveUp.call(this))return!1;const _=this.getStage();return!_||!_.content?!1:(_.content.removeChild(this.getNativeCanvasElement()),this.index<_.children.length-1?_.content.insertBefore(this.getNativeCanvasElement(),_.children[this.index+1].getCanvas()._canvas):_.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(t.Node.prototype.moveDown.call(this)){const x=this.getStage();if(x){const _=x.children;x.content&&(x.content.removeChild(this.getNativeCanvasElement()),x.content.insertBefore(this.getNativeCanvasElement(),_[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(t.Node.prototype.moveToBottom.call(this)){const x=this.getStage();if(x){const _=x.children;x.content&&(x.content.removeChild(this.getNativeCanvasElement()),x.content.insertBefore(this.getNativeCanvasElement(),_[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const x=this.getNativeCanvasElement();return t.Node.prototype.remove.call(this),x&&x.parentNode&&e.Util._isInDocument(x)&&x.parentNode.removeChild(x),this}getStage(){return this.parent}setSize({width:x,height:_}){return this.canvas.setSize(x,_),this.hitCanvas.setSize(x,_),this._setSmoothEnabled(),this}_validateAdd(x){const _=x.getType();_!=="Group"&&_!=="Shape"&&e.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(x){return x=x||{},x.width=x.width||this.getWidth(),x.height=x.height||this.getHeight(),x.x=x.x!==void 0?x.x:this.x(),x.y=x.y!==void 0?x.y:this.y(),t.Node.prototype._toKonvaCanvas.call(this,x)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){e.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){e.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,e.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(x){if(!this.isListening()||!this.isVisible())return null;let _=1,b=!1;for(;;){for(let g=0;g<E;g++){const h=y[g],d=this._getIntersection({x:x.x+h.x*_,y:x.y+h.y*_}),P=d.shape;if(P)return P;if(b=!!d.antialiased,!d.antialiased)break}if(b)_+=1;else return null}}_getIntersection(x){const _=this.hitCanvas.pixelRatio,b=this.hitCanvas.context.getImageData(Math.round(x.x*_),Math.round(x.y*_),1,1).data,g=b[3];if(g===255){const h=e.Util._rgbToHex(b[0],b[1],b[2]),d=s.shapes[m+h];return d?{shape:d}:{antialiased:!0}}else if(g>0)return{antialiased:!0};return{}}drawScene(x,_){const b=this.getLayer(),g=x||b&&b.getCanvas();return this._fire(f,{node:this}),this.clearBeforeDraw()&&g.getContext().clear(),n.Container.prototype.drawScene.call(this,g,_),this._fire(v,{node:this}),this}drawHit(x,_){const b=this.getLayer(),g=x||b&&b.hitCanvas;return b&&b.clearBeforeDraw()&&b.getHitCanvas().getContext().clear(),n.Container.prototype.drawHit.call(this,g,_),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(x){e.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(x)}getHitGraphEnabled(x){return e.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const x=this.parent;!!this.hitCanvas._canvas.parentNode?x.content.removeChild(this.hitCanvas._canvas):x.content.appendChild(this.hitCanvas._canvas)}destroy(){return e.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}return Sf.Layer=w,w.prototype.nodeType="Layer",(0,c._registerNode)(w),r.Factory.addGetterSetter(w,"imageSmoothingEnabled",!0),r.Factory.addGetterSetter(w,"clearBeforeDraw",!0),r.Factory.addGetterSetter(w,"hitGraphEnabled",!0,(0,o.getBooleanValidator)()),Sf}var Ef={},yy;function d9(){if(yy)return Ef;yy=1,Object.defineProperty(Ef,"__esModule",{value:!0}),Ef.FastLayer=void 0;const e=Lr(),n=w5(),t=Dt();class r extends n.Layer{constructor(o){super(o),this.listening(!1),e.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}return Ef.FastLayer=r,r.prototype.nodeType="FastLayer",(0,t._registerNode)(r),Ef}var xf={},by;function Tv(){if(by)return xf;by=1,Object.defineProperty(xf,"__esModule",{value:!0}),xf.Group=void 0;const e=Lr(),n=zp(),t=Dt();class r extends n.Container{_validateAdd(o){const s=o.getType();s!=="Group"&&s!=="Shape"&&e.Util.throw("You may only add groups and shapes to groups.")}}return xf.Group=r,r.prototype.nodeType="Group",(0,t._registerNode)(r),xf}var Of={},wy;function Rv(){if(wy)return Of;wy=1,Object.defineProperty(Of,"__esModule",{value:!0}),Of.Animation=void 0;const e=Dt(),n=Lr(),t=function(){return e.glob.performance&&e.glob.performance.now?function(){return e.glob.performance.now()}:function(){return new Date().getTime()}}();let r=class tc{constructor(o,s){this.id=tc.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:t(),frameRate:0},this.func=o,this.setLayers(s)}setLayers(o){let s=[];return o&&(s=Array.isArray(o)?o:[o]),this.layers=s,this}getLayers(){return this.layers}addLayer(o){const s=this.layers,c=s.length;for(let m=0;m<c;m++)if(s[m]._id===o._id)return!1;return this.layers.push(o),!0}isRunning(){const s=tc.animations,c=s.length;for(let m=0;m<c;m++)if(s[m].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=t(),tc._addAnimation(this),this}stop(){return tc._removeAnimation(this),this}_updateFrameObject(o){this.frame.timeDiff=o-this.frame.lastTime,this.frame.lastTime=o,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(o){this.animations.push(o),this._handleAnimation()}static _removeAnimation(o){const s=o.id,c=this.animations,m=c.length;for(let f=0;f<m;f++)if(c[f].id===s){this.animations.splice(f,1);break}}static _runFrames(){const o={},s=this.animations;for(let c=0;c<s.length;c++){const m=s[c],f=m.layers,v=m.func;m._updateFrameObject(t());const y=f.length;let E;if(v?E=v.call(m,m.frame)!==!1:E=!0,!!E)for(let w=0;w<y;w++){const S=f[w];S._id!==void 0&&(o[S._id]=S)}}for(const c in o)o.hasOwnProperty(c)&&o[c].batchDraw()}static _animationLoop(){const o=tc;o.animations.length?(o._runFrames(),n.Util.requestAnimFrame(o._animationLoop)):o.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,n.Util.requestAnimFrame(this._animationLoop))}};return Of.Animation=r,r.animations=[],r.animIdCounter=0,r.animRunning=!1,Of}var Yg={},_y;function h9(){return _y||(_y=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const n=Lr(),t=Rv(),r=Hr(),a=Dt(),o={node:1,duration:1,easing:1,onFinish:1,yoyo:1},s=1,c=2,m=3,f=["fill","stroke","shadowColor"];let v=0;class y{constructor(S,x,_,b,g,h,d){this.prop=S,this.propFunc=x,this.begin=b,this._pos=b,this.duration=h,this._change=0,this.prevPos=0,this.yoyo=d,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=_,this._change=g-this.begin,this.pause()}fire(S){const x=this[S];x&&x()}setTime(S){S>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():S<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=S,this.update())}getTime(){return this._time}setPosition(S){this.prevPos=this._pos,this.propFunc(S),this._pos=S}getPosition(S){return S===void 0&&(S=this._time),this.func(S,this.begin,this._change,this.duration)}play(){this.state=c,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=m,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(S){this.pause(),this._time=S,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 S=this.getTimer()-this._startTime;this.state===c?this.setTime(S):this.state===m&&this.setTime(this.duration-S)}pause(){this.state=s,this.fire("onPause")}getTimer(){return new Date().getTime()}}class E{constructor(S){const x=this,_=S.node,b=_._id,g=S.easing||e.Easings.Linear,h=!!S.yoyo;let d,P;typeof S.duration>"u"?d=.3:S.duration===0?d=.001:d=S.duration,this.node=_,this._id=v++;const M=_.getLayer()||(_ instanceof a.Konva.Stage?_.getLayers():null);M||n.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new t.Animation(function(){x.tween.onEnterFrame()},M),this.tween=new y(P,function(T){x._tweenFunc(T)},g,0,1,d*1e3,h),this._addListeners(),E.attrs[b]||(E.attrs[b]={}),E.attrs[b][this._id]||(E.attrs[b][this._id]={}),E.tweens[b]||(E.tweens[b]={});for(P in S)o[P]===void 0&&this._addAttr(P,S[P]);this.reset(),this.onFinish=S.onFinish,this.onReset=S.onReset,this.onUpdate=S.onUpdate}_addAttr(S,x){const _=this.node,b=_._id;let g,h,d,P,M;const T=E.tweens[b][S];T&&delete E.attrs[b][T][S];let I=_.getAttr(S);if(n.Util._isArray(x))if(g=[],h=Math.max(x.length,I.length),S==="points"&&x.length!==I.length&&(x.length>I.length?(P=I,I=n.Util._prepareArrayForTween(I,x,_.closed())):(d=x,x=n.Util._prepareArrayForTween(x,I,_.closed()))),S.indexOf("fill")===0)for(let F=0;F<h;F++)if(F%2===0)g.push(x[F]-I[F]);else{const k=n.Util.colorToRGBA(I[F]);M=n.Util.colorToRGBA(x[F]),I[F]=k,g.push({r:M.r-k.r,g:M.g-k.g,b:M.b-k.b,a:M.a-k.a})}else for(let F=0;F<h;F++)g.push(x[F]-I[F]);else f.indexOf(S)!==-1?(I=n.Util.colorToRGBA(I),M=n.Util.colorToRGBA(x),g={r:M.r-I.r,g:M.g-I.g,b:M.b-I.b,a:M.a-I.a}):g=x-I;E.attrs[b][this._id][S]={start:I,diff:g,end:x,trueEnd:d,trueStart:P},E.tweens[b][S]=this._id}_tweenFunc(S){const x=this.node,_=E.attrs[x._id][this._id];let b,g,h,d,P,M,T,I;for(b in _){if(g=_[b],h=g.start,d=g.diff,I=g.end,n.Util._isArray(h))if(P=[],T=Math.max(h.length,I.length),b.indexOf("fill")===0)for(M=0;M<T;M++)M%2===0?P.push((h[M]||0)+d[M]*S):P.push("rgba("+Math.round(h[M].r+d[M].r*S)+","+Math.round(h[M].g+d[M].g*S)+","+Math.round(h[M].b+d[M].b*S)+","+(h[M].a+d[M].a*S)+")");else for(M=0;M<T;M++)P.push((h[M]||0)+d[M]*S);else f.indexOf(b)!==-1?P="rgba("+Math.round(h.r+d.r*S)+","+Math.round(h.g+d.g*S)+","+Math.round(h.b+d.b*S)+","+(h.a+d.a*S)+")":P=h+d*S;x.setAttr(b,P)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const S=this.node,x=E.attrs[S._id][this._id];x.points&&x.points.trueEnd&&S.setAttr("points",x.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const S=this.node,x=E.attrs[S._id][this._id];x.points&&x.points.trueStart&&S.points(x.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(S){return this.tween.seek(S*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const S=this.node._id,x=this._id,_=E.tweens[S];this.pause();for(const b in _)delete E.tweens[S][b];delete E.attrs[S][x]}}e.Tween=E,E.attrs={},E.tweens={},r.Node.prototype.to=function(w){const S=w.onFinish;w.node=this,w.onFinish=function(){this.destroy(),S&&S()},new E(w).play()},e.Easings={BackEaseIn(w,S,x,_){return x*(w/=_)*w*((1.70158+1)*w-1.70158)+S},BackEaseOut(w,S,x,_){return x*((w=w/_-1)*w*((1.70158+1)*w+1.70158)+1)+S},BackEaseInOut(w,S,x,_){let b=1.70158;return(w/=_/2)<1?x/2*(w*w*(((b*=1.525)+1)*w-b))+S:x/2*((w-=2)*w*(((b*=1.525)+1)*w+b)+2)+S},ElasticEaseIn(w,S,x,_,b,g){let h=0;return w===0?S:(w/=_)===1?S+x:(g||(g=_*.3),!b||b<Math.abs(x)?(b=x,h=g/4):h=g/(2*Math.PI)*Math.asin(x/b),-(b*Math.pow(2,10*(w-=1))*Math.sin((w*_-h)*(2*Math.PI)/g))+S)},ElasticEaseOut(w,S,x,_,b,g){let h=0;return w===0?S:(w/=_)===1?S+x:(g||(g=_*.3),!b||b<Math.abs(x)?(b=x,h=g/4):h=g/(2*Math.PI)*Math.asin(x/b),b*Math.pow(2,-10*w)*Math.sin((w*_-h)*(2*Math.PI)/g)+x+S)},ElasticEaseInOut(w,S,x,_,b,g){let h=0;return w===0?S:(w/=_/2)===2?S+x:(g||(g=_*(.3*1.5)),!b||b<Math.abs(x)?(b=x,h=g/4):h=g/(2*Math.PI)*Math.asin(x/b),w<1?-.5*(b*Math.pow(2,10*(w-=1))*Math.sin((w*_-h)*(2*Math.PI)/g))+S:b*Math.pow(2,-10*(w-=1))*Math.sin((w*_-h)*(2*Math.PI)/g)*.5+x+S)},BounceEaseOut(w,S,x,_){return(w/=_)<1/2.75?x*(7.5625*w*w)+S:w<2/2.75?x*(7.5625*(w-=1.5/2.75)*w+.75)+S:w<2.5/2.75?x*(7.5625*(w-=2.25/2.75)*w+.9375)+S:x*(7.5625*(w-=2.625/2.75)*w+.984375)+S},BounceEaseIn(w,S,x,_){return x-e.Easings.BounceEaseOut(_-w,0,x,_)+S},BounceEaseInOut(w,S,x,_){return w<_/2?e.Easings.BounceEaseIn(w*2,0,x,_)*.5+S:e.Easings.BounceEaseOut(w*2-_,0,x,_)*.5+x*.5+S},EaseIn(w,S,x,_){return x*(w/=_)*w+S},EaseOut(w,S,x,_){return-x*(w/=_)*(w-2)+S},EaseInOut(w,S,x,_){return(w/=_/2)<1?x/2*w*w+S:-x/2*(--w*(w-2)-1)+S},StrongEaseIn(w,S,x,_){return x*(w/=_)*w*w*w*w+S},StrongEaseOut(w,S,x,_){return x*((w=w/_-1)*w*w*w*w+1)+S},StrongEaseInOut(w,S,x,_){return(w/=_/2)<1?x/2*w*w*w*w*w+S:x/2*((w-=2)*w*w*w*w+2)+S},Linear(w,S,x,_){return x*w/_+S}}}(Yg)),Yg}var Sy;function nv(){return Sy||(Sy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const n=Dt(),t=Lr(),r=Hr(),a=zp(),o=f9(),s=w5(),c=d9(),m=Tv(),f=Av(),v=bn(),y=Rv(),E=h9(),w=y5(),S=Fp();e.Konva=t.Util._assign(n.Konva,{Util:t.Util,Transform:t.Transform,Node:r.Node,Container:a.Container,Stage:o.Stage,stages:o.stages,Layer:s.Layer,FastLayer:c.FastLayer,Group:m.Group,DD:f.DD,Shape:v.Shape,shapes:v.shapes,Animation:y.Animation,Tween:E.Tween,Easings:E.Easings,Context:w.Context,Canvas:S.Canvas}),e.default=e.Konva}(Ug)),Ug}var Pf={},Ey;function p9(){if(Ey)return Pf;Ey=1,Object.defineProperty(Pf,"__esModule",{value:!0}),Pf.Arc=void 0;const e=qt(),n=bn(),t=Dt(),r=Vt(),a=Dt();class o extends n.Shape{_sceneFunc(c){const m=t.Konva.getAngle(this.angle()),f=this.clockwise();c.beginPath(),c.arc(0,0,this.outerRadius(),0,m,f),c.arc(0,0,this.innerRadius(),m,0,!f),c.closePath(),c.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(c){this.outerRadius(c/2)}setHeight(c){this.outerRadius(c/2)}getSelfRect(){const c=this.innerRadius(),m=this.outerRadius(),f=this.clockwise(),v=t.Konva.getAngle(f?360-this.angle():this.angle()),y=Math.cos(Math.min(v,Math.PI)),E=1,w=Math.sin(Math.min(Math.max(Math.PI,v),3*Math.PI/2)),S=Math.sin(Math.min(v,Math.PI/2)),x=y*(y>0?c:m),_=E*m,b=w*(w>0?c:m),g=S*(S>0?m:c);return{x,y:f?-1*g:b,width:_-x,height:g-b}}}return Pf.Arc=o,o.prototype._centroid=!0,o.prototype.className="Arc",o.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"],(0,a._registerNode)(o),e.Factory.addGetterSetter(o,"innerRadius",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(o,"outerRadius",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(o,"angle",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(o,"clockwise",!1,(0,r.getBooleanValidator)()),Pf}var Cf={},kf={},xy;function _5(){if(xy)return kf;xy=1,Object.defineProperty(kf,"__esModule",{value:!0}),kf.Line=void 0;const e=qt(),n=Dt(),t=bn(),r=Vt();function a(c,m,f,v,y,E,w){const S=Math.sqrt(Math.pow(f-c,2)+Math.pow(v-m,2)),x=Math.sqrt(Math.pow(y-f,2)+Math.pow(E-v,2)),_=w*S/(S+x),b=w*x/(S+x),g=f-_*(y-c),h=v-_*(E-m),d=f+b*(y-c),P=v+b*(E-m);return[g,h,d,P]}function o(c,m){const f=c.length,v=[];for(let y=2;y<f-2;y+=2){const E=a(c[y-2],c[y-1],c[y],c[y+1],c[y+2],c[y+3],m);isNaN(E[0])||(v.push(E[0]),v.push(E[1]),v.push(c[y]),v.push(c[y+1]),v.push(E[2]),v.push(E[3]))}return v}class s extends t.Shape{constructor(m){super(m),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(m){let f=this.points(),v=f.length,y=this.tension(),E=this.closed(),w=this.bezier(),S,x,_;if(v){if(m.beginPath(),m.moveTo(f[0],f[1]),y!==0&&v>4){for(S=this.getTensionPoints(),x=S.length,_=E?0:4,E||m.quadraticCurveTo(S[0],S[1],S[2],S[3]);_<x-2;)m.bezierCurveTo(S[_++],S[_++],S[_++],S[_++],S[_++],S[_++]);E||m.quadraticCurveTo(S[x-2],S[x-1],f[v-2],f[v-1])}else if(w)for(_=2;_<v;)m.bezierCurveTo(f[_++],f[_++],f[_++],f[_++],f[_++],f[_++]);else for(_=2;_<v;_+=2)m.lineTo(f[_],f[_+1]);E?(m.closePath(),m.fillStrokeShape(this)):m.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():o(this.points(),this.tension())}_getTensionPointsClosed(){const m=this.points(),f=m.length,v=this.tension(),y=a(m[f-2],m[f-1],m[0],m[1],m[2],m[3],v),E=a(m[f-4],m[f-3],m[f-2],m[f-1],m[0],m[1],v),w=o(m,v);return[y[2],y[3]].concat(w).concat([E[0],E[1],m[f-2],m[f-1],E[2],E[3],y[0],y[1],m[0],m[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let m=this.points();if(m.length<4)return{x:m[0]||0,y:m[1]||0,width:0,height:0};this.tension()!==0?m=[m[0],m[1],...this._getTensionPoints(),m[m.length-2],m[m.length-1]]:m=this.points();let f=m[0],v=m[0],y=m[1],E=m[1],w,S;for(let x=0;x<m.length/2;x++)w=m[x*2],S=m[x*2+1],f=Math.min(f,w),v=Math.max(v,w),y=Math.min(y,S),E=Math.max(E,S);return{x:f,y,width:v-f,height:E-y}}}return kf.Line=s,s.prototype.className="Line",s.prototype._attrsAffectingSize=["points","bezier","tension"],(0,n._registerNode)(s),e.Factory.addGetterSetter(s,"closed",!1),e.Factory.addGetterSetter(s,"bezier",!1),e.Factory.addGetterSetter(s,"tension",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(s,"points",[],(0,r.getNumberArrayValidator)()),kf}var Af={},Kg={},Oy;function g9(){return Oy||(Oy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t2length=e.getQuadraticArcLength=e.getCubicArcLength=e.binomialCoefficients=e.cValues=e.tValues=void 0,e.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],e.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],e.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const n=(s,c,m)=>{let f,v;const E=m/2;f=0;for(let w=0;w<20;w++)v=E*e.tValues[20][w]+E,f+=e.cValues[20][w]*r(s,c,v);return E*f};e.getCubicArcLength=n;const t=(s,c,m)=>{m===void 0&&(m=1);const f=s[0]-2*s[1]+s[2],v=c[0]-2*c[1]+c[2],y=2*s[1]-2*s[0],E=2*c[1]-2*c[0],w=4*(f*f+v*v),S=4*(f*y+v*E),x=y*y+E*E;if(w===0)return m*Math.sqrt(Math.pow(s[2]-s[0],2)+Math.pow(c[2]-c[0],2));const _=S/(2*w),b=x/w,g=m+_,h=b-_*_,d=g*g+h>0?Math.sqrt(g*g+h):0,P=_*_+h>0?Math.sqrt(_*_+h):0,M=_+Math.sqrt(_*_+h)!==0?h*Math.log(Math.abs((g+d)/(_+P))):0;return Math.sqrt(w)/2*(g*d-_*P+M)};e.getQuadraticArcLength=t;function r(s,c,m){const f=a(1,m,s),v=a(1,m,c),y=f*f+v*v;return Math.sqrt(y)}const a=(s,c,m)=>{const f=m.length-1;let v,y;if(f===0)return 0;if(s===0){y=0;for(let E=0;E<=f;E++)y+=e.binomialCoefficients[f][E]*Math.pow(1-c,f-E)*Math.pow(c,E)*m[E];return y}else{v=new Array(f);for(let E=0;E<f;E++)v[E]=f*(m[E+1]-m[E]);return a(s-1,c,v)}},o=(s,c,m)=>{let f=1,v=s/c,y=(s-m(v))/c,E=0;for(;f>.001;){const w=m(v+y),S=Math.abs(s-w)/c;if(S<f)f=S,v+=y;else{const x=m(v-y),_=Math.abs(s-x)/c;_<f?(f=_,v-=y):y/=2}if(E++,E>500)break}return v};e.t2length=o}(Kg)),Kg}var Py;function Mv(){if(Py)return Af;Py=1,Object.defineProperty(Af,"__esModule",{value:!0}),Af.Path=void 0;const e=qt(),n=bn(),t=Dt(),r=g9();class a extends n.Shape{constructor(s){super(s),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=a.parsePathData(this.data()),this.pathLength=a.getPathLength(this.dataArray)}_sceneFunc(s){const c=this.dataArray;s.beginPath();let m=!1;for(let d=0;d<c.length;d++){const P=c[d].command,M=c[d].points;switch(P){case"L":s.lineTo(M[0],M[1]);break;case"M":s.moveTo(M[0],M[1]);break;case"C":s.bezierCurveTo(M[0],M[1],M[2],M[3],M[4],M[5]);break;case"Q":s.quadraticCurveTo(M[0],M[1],M[2],M[3]);break;case"A":var f=M[0],v=M[1],y=M[2],E=M[3],w=M[4],S=M[5],x=M[6],_=M[7],b=y>E?y:E,g=y>E?1:y/E,h=y>E?E/y:1;s.translate(f,v),s.rotate(x),s.scale(g,h),s.arc(0,0,b,w,w+S,1-_),s.scale(1/g,1/h),s.rotate(-x),s.translate(-f,-v);break;case"z":m=!0,s.closePath();break}}!m&&!this.hasFill()?s.strokeShape(this):s.fillStrokeShape(this)}getSelfRect(){let s=[];this.dataArray.forEach(function(w){if(w.command==="A"){const S=w.points[4],x=w.points[5],_=w.points[4]+x;let b=Math.PI/180;if(Math.abs(S-_)<b&&(b=Math.abs(S-_)),x<0)for(let g=S-b;g>_;g-=b){const h=a.getPointOnEllipticalArc(w.points[0],w.points[1],w.points[2],w.points[3],g,0);s.push(h.x,h.y)}else for(let g=S+b;g<_;g+=b){const h=a.getPointOnEllipticalArc(w.points[0],w.points[1],w.points[2],w.points[3],g,0);s.push(h.x,h.y)}}else if(w.command==="C")for(let S=0;S<=1;S+=.01){const x=a.getPointOnCubicBezier(S,w.start.x,w.start.y,w.points[0],w.points[1],w.points[2],w.points[3],w.points[4],w.points[5]);s.push(x.x,x.y)}else s=s.concat(w.points)});let c=s[0],m=s[0],f=s[1],v=s[1],y,E;for(let w=0;w<s.length/2;w++)y=s[w*2],E=s[w*2+1],isNaN(y)||(c=Math.min(c,y),m=Math.max(m,y)),isNaN(E)||(f=Math.min(f,E),v=Math.max(v,E));return{x:c,y:f,width:m-c,height:v-f}}getLength(){return this.pathLength}getPointAtLength(s){return a.getPointAtLengthOfDataArray(s,this.dataArray)}static getLineLength(s,c,m,f){return Math.sqrt((m-s)*(m-s)+(f-c)*(f-c))}static getPathLength(s){let c=0;for(let m=0;m<s.length;++m)c+=s[m].pathLength;return c}static getPointAtLengthOfDataArray(s,c){let m,f=0,v=c.length;if(!v)return null;for(;f<v&&s>c[f].pathLength;)s-=c[f].pathLength,++f;if(f===v)return m=c[f-1].points.slice(-2),{x:m[0],y:m[1]};if(s<.01)return m=c[f].points.slice(0,2),{x:m[0],y:m[1]};const y=c[f],E=y.points;switch(y.command){case"L":return a.getPointOnLine(s,y.start.x,y.start.y,E[0],E[1]);case"C":return a.getPointOnCubicBezier((0,r.t2length)(s,a.getPathLength(c),d=>(0,r.getCubicArcLength)([y.start.x,E[0],E[2],E[4]],[y.start.y,E[1],E[3],E[5]],d)),y.start.x,y.start.y,E[0],E[1],E[2],E[3],E[4],E[5]);case"Q":return a.getPointOnQuadraticBezier((0,r.t2length)(s,a.getPathLength(c),d=>(0,r.getQuadraticArcLength)([y.start.x,E[0],E[2]],[y.start.y,E[1],E[3]],d)),y.start.x,y.start.y,E[0],E[1],E[2],E[3]);case"A":var w=E[0],S=E[1],x=E[2],_=E[3],b=E[4],g=E[5],h=E[6];return b+=g*s/y.pathLength,a.getPointOnEllipticalArc(w,S,x,_,b,h)}return null}static getPointOnLine(s,c,m,f,v,y,E){y=y??c,E=E??m;const w=this.getLineLength(c,m,f,v);if(w<1e-10)return{x:c,y:m};if(f===c)return{x:y,y:E+(v>m?s:-s)};const S=(v-m)/(f-c),x=Math.sqrt(s*s/(1+S*S))*(f<c?-1:1),_=S*x;if(Math.abs(E-m-S*(y-c))<1e-10)return{x:y+x,y:E+_};const b=((y-c)*(f-c)+(E-m)*(v-m))/(w*w),g=c+b*(f-c),h=m+b*(v-m),d=this.getLineLength(y,E,g,h),P=Math.sqrt(s*s-d*d),M=Math.sqrt(P*P/(1+S*S))*(f<c?-1:1),T=S*M;return{x:g+M,y:h+T}}static getPointOnCubicBezier(s,c,m,f,v,y,E,w,S){function x(P){return P*P*P}function _(P){return 3*P*P*(1-P)}function b(P){return 3*P*(1-P)*(1-P)}function g(P){return(1-P)*(1-P)*(1-P)}const h=w*x(s)+y*_(s)+f*b(s)+c*g(s),d=S*x(s)+E*_(s)+v*b(s)+m*g(s);return{x:h,y:d}}static getPointOnQuadraticBezier(s,c,m,f,v,y,E){function w(g){return g*g}function S(g){return 2*g*(1-g)}function x(g){return(1-g)*(1-g)}const _=y*w(s)+f*S(s)+c*x(s),b=E*w(s)+v*S(s)+m*x(s);return{x:_,y:b}}static getPointOnEllipticalArc(s,c,m,f,v,y){const E=Math.cos(y),w=Math.sin(y),S={x:m*Math.cos(v),y:f*Math.sin(v)};return{x:s+(S.x*E-S.y*w),y:c+(S.x*w+S.y*E)}}static parsePathData(s){if(!s)return[];let c=s;const m=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];c=c.replace(new RegExp(" ","g"),",");for(var f=0;f<m.length;f++)c=c.replace(new RegExp(m[f],"g"),"|"+m[f]);const v=c.split("|"),y=[],E=[];let w=0,S=0;const x=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let _;for(f=1;f<v.length;f++){let A=v[f],R=A.charAt(0);for(A=A.slice(1),E.length=0;_=x.exec(A);)E.push(_[0]);const L=[];for(let V=0,G=E.length;V<G;V++){if(E[V]==="00"){L.push(0,0);continue}const W=parseFloat(E[V]);isNaN(W)?L.push(0):L.push(W)}for(;L.length>0&&!isNaN(L[0]);){let V="",G=[];const W=w,X=S;var b,g,h,d,P,M,T,I,F,k;switch(R){case"l":w+=L.shift(),S+=L.shift(),V="L",G.push(w,S);break;case"L":w=L.shift(),S=L.shift(),G.push(w,S);break;case"m":var O=L.shift(),N=L.shift();if(w+=O,S+=N,V="M",y.length>2&&y[y.length-1].command==="z"){for(let q=y.length-2;q>=0;q--)if(y[q].command==="M"){w=y[q].points[0]+O,S=y[q].points[1]+N;break}}G.push(w,S),R="l";break;case"M":w=L.shift(),S=L.shift(),V="M",G.push(w,S),R="L";break;case"h":w+=L.shift(),V="L",G.push(w,S);break;case"H":w=L.shift(),V="L",G.push(w,S);break;case"v":S+=L.shift(),V="L",G.push(w,S);break;case"V":S=L.shift(),V="L",G.push(w,S);break;case"C":G.push(L.shift(),L.shift(),L.shift(),L.shift()),w=L.shift(),S=L.shift(),G.push(w,S);break;case"c":G.push(w+L.shift(),S+L.shift(),w+L.shift(),S+L.shift()),w+=L.shift(),S+=L.shift(),V="C",G.push(w,S);break;case"S":g=w,h=S,b=y[y.length-1],b.command==="C"&&(g=w+(w-b.points[2]),h=S+(S-b.points[3])),G.push(g,h,L.shift(),L.shift()),w=L.shift(),S=L.shift(),V="C",G.push(w,S);break;case"s":g=w,h=S,b=y[y.length-1],b.command==="C"&&(g=w+(w-b.points[2]),h=S+(S-b.points[3])),G.push(g,h,w+L.shift(),S+L.shift()),w+=L.shift(),S+=L.shift(),V="C",G.push(w,S);break;case"Q":G.push(L.shift(),L.shift()),w=L.shift(),S=L.shift(),G.push(w,S);break;case"q":G.push(w+L.shift(),S+L.shift()),w+=L.shift(),S+=L.shift(),V="Q",G.push(w,S);break;case"T":g=w,h=S,b=y[y.length-1],b.command==="Q"&&(g=w+(w-b.points[0]),h=S+(S-b.points[1])),w=L.shift(),S=L.shift(),V="Q",G.push(g,h,w,S);break;case"t":g=w,h=S,b=y[y.length-1],b.command==="Q"&&(g=w+(w-b.points[0]),h=S+(S-b.points[1])),w+=L.shift(),S+=L.shift(),V="Q",G.push(g,h,w,S);break;case"A":d=L.shift(),P=L.shift(),M=L.shift(),T=L.shift(),I=L.shift(),F=w,k=S,w=L.shift(),S=L.shift(),V="A",G=this.convertEndpointToCenterParameterization(F,k,w,S,T,I,d,P,M);break;case"a":d=L.shift(),P=L.shift(),M=L.shift(),T=L.shift(),I=L.shift(),F=w,k=S,w+=L.shift(),S+=L.shift(),V="A",G=this.convertEndpointToCenterParameterization(F,k,w,S,T,I,d,P,M);break}y.push({command:V||R,points:G,start:{x:W,y:X},pathLength:this.calcLength(W,X,V||R,G)})}(R==="z"||R==="Z")&&y.push({command:"z",points:[],start:void 0,pathLength:0})}return y}static calcLength(s,c,m,f){let v,y,E,w;const S=a;switch(m){case"L":return S.getLineLength(s,c,f[0],f[1]);case"C":return(0,r.getCubicArcLength)([s,f[0],f[2],f[4]],[c,f[1],f[3],f[5]],1);case"Q":return(0,r.getQuadraticArcLength)([s,f[0],f[2]],[c,f[1],f[3]],1);case"A":v=0;var x=f[4],_=f[5],b=f[4]+_,g=Math.PI/180;if(Math.abs(x-b)<g&&(g=Math.abs(x-b)),y=S.getPointOnEllipticalArc(f[0],f[1],f[2],f[3],x,0),_<0)for(w=x-g;w>b;w-=g)E=S.getPointOnEllipticalArc(f[0],f[1],f[2],f[3],w,0),v+=S.getLineLength(y.x,y.y,E.x,E.y),y=E;else for(w=x+g;w<b;w+=g)E=S.getPointOnEllipticalArc(f[0],f[1],f[2],f[3],w,0),v+=S.getLineLength(y.x,y.y,E.x,E.y),y=E;return E=S.getPointOnEllipticalArc(f[0],f[1],f[2],f[3],b,0),v+=S.getLineLength(y.x,y.y,E.x,E.y),v}return 0}static convertEndpointToCenterParameterization(s,c,m,f,v,y,E,w,S){const x=S*(Math.PI/180),_=Math.cos(x)*(s-m)/2+Math.sin(x)*(c-f)/2,b=-1*Math.sin(x)*(s-m)/2+Math.cos(x)*(c-f)/2,g=_*_/(E*E)+b*b/(w*w);g>1&&(E*=Math.sqrt(g),w*=Math.sqrt(g));let h=Math.sqrt((E*E*(w*w)-E*E*(b*b)-w*w*(_*_))/(E*E*(b*b)+w*w*(_*_)));v===y&&(h*=-1),isNaN(h)&&(h=0);const d=h*E*b/w,P=h*-w*_/E,M=(s+m)/2+Math.cos(x)*d-Math.sin(x)*P,T=(c+f)/2+Math.sin(x)*d+Math.cos(x)*P,I=function(L){return Math.sqrt(L[0]*L[0]+L[1]*L[1])},F=function(L,V){return(L[0]*V[0]+L[1]*V[1])/(I(L)*I(V))},k=function(L,V){return(L[0]*V[1]<L[1]*V[0]?-1:1)*Math.acos(F(L,V))},O=k([1,0],[(_-d)/E,(b-P)/w]),N=[(_-d)/E,(b-P)/w],A=[(-1*_-d)/E,(-1*b-P)/w];let R=k(N,A);return F(N,A)<=-1&&(R=Math.PI),F(N,A)>=1&&(R=0),y===0&&R>0&&(R=R-2*Math.PI),y===1&&R<0&&(R=R+2*Math.PI),[M,T,E,w,O,R,x,y]}}return Af.Path=a,a.prototype.className="Path",a.prototype._attrsAffectingSize=["data"],(0,t._registerNode)(a),e.Factory.addGetterSetter(a,"data"),Af}var Cy;function v9(){if(Cy)return Cf;Cy=1,Object.defineProperty(Cf,"__esModule",{value:!0}),Cf.Arrow=void 0;const e=qt(),n=_5(),t=Vt(),r=Dt(),a=Mv();class o extends n.Line{_sceneFunc(c){super._sceneFunc(c);const m=Math.PI*2,f=this.points();let v=f;const y=this.tension()!==0&&f.length>4;y&&(v=this.getTensionPoints());const E=this.pointerLength(),w=f.length;let S,x;if(y){const g=[v[v.length-4],v[v.length-3],v[v.length-2],v[v.length-1],f[w-2],f[w-1]],h=a.Path.calcLength(v[v.length-4],v[v.length-3],"C",g),d=a.Path.getPointOnQuadraticBezier(Math.min(1,1-E/h),g[0],g[1],g[2],g[3],g[4],g[5]);S=f[w-2]-d.x,x=f[w-1]-d.y}else S=f[w-2]-f[w-4],x=f[w-1]-f[w-3];const _=(Math.atan2(x,S)+m)%m,b=this.pointerWidth();this.pointerAtEnding()&&(c.save(),c.beginPath(),c.translate(f[w-2],f[w-1]),c.rotate(_),c.moveTo(0,0),c.lineTo(-E,b/2),c.lineTo(-E,-b/2),c.closePath(),c.restore(),this.__fillStroke(c)),this.pointerAtBeginning()&&(c.save(),c.beginPath(),c.translate(f[0],f[1]),y?(S=(v[0]+v[2])/2-f[0],x=(v[1]+v[3])/2-f[1]):(S=f[2]-f[0],x=f[3]-f[1]),c.rotate((Math.atan2(-x,-S)+m)%m),c.moveTo(0,0),c.lineTo(-E,b/2),c.lineTo(-E,-b/2),c.closePath(),c.restore(),this.__fillStroke(c))}__fillStroke(c){const m=this.dashEnabled();m&&(this.attrs.dashEnabled=!1,c.setLineDash([])),c.fillStrokeShape(this),m&&(this.attrs.dashEnabled=!0)}getSelfRect(){const c=super.getSelfRect(),m=this.pointerWidth()/2;return{x:c.x,y:c.y-m,width:c.width,height:c.height+m*2}}}return Cf.Arrow=o,o.prototype.className="Arrow",(0,r._registerNode)(o),e.Factory.addGetterSetter(o,"pointerLength",10,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(o,"pointerWidth",10,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(o,"pointerAtBeginning",!1),e.Factory.addGetterSetter(o,"pointerAtEnding",!0),Cf}var Tf={},ky;function m9(){if(ky)return Tf;ky=1,Object.defineProperty(Tf,"__esModule",{value:!0}),Tf.Circle=void 0;const e=qt(),n=bn(),t=Vt(),r=Dt();class a extends n.Shape{_sceneFunc(s){s.beginPath(),s.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),s.closePath(),s.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(s){this.radius()!==s/2&&this.radius(s/2)}setHeight(s){this.radius()!==s/2&&this.radius(s/2)}}return Tf.Circle=a,a.prototype._centroid=!0,a.prototype.className="Circle",a.prototype._attrsAffectingSize=["radius"],(0,r._registerNode)(a),e.Factory.addGetterSetter(a,"radius",0,(0,t.getNumberValidator)()),Tf}var Rf={},Ay;function y9(){if(Ay)return Rf;Ay=1,Object.defineProperty(Rf,"__esModule",{value:!0}),Rf.Ellipse=void 0;const e=qt(),n=bn(),t=Vt(),r=Dt();class a extends n.Shape{_sceneFunc(s){const c=this.radiusX(),m=this.radiusY();s.beginPath(),s.save(),c!==m&&s.scale(1,m/c),s.arc(0,0,c,0,Math.PI*2,!1),s.restore(),s.closePath(),s.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(s){this.radiusX(s/2)}setHeight(s){this.radiusY(s/2)}}return Rf.Ellipse=a,a.prototype.className="Ellipse",a.prototype._centroid=!0,a.prototype._attrsAffectingSize=["radiusX","radiusY"],(0,r._registerNode)(a),e.Factory.addComponentsGetterSetter(a,"radius",["x","y"]),e.Factory.addGetterSetter(a,"radiusX",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(a,"radiusY",0,(0,t.getNumberValidator)()),Rf}var Mf={},Ty;function b9(){if(Ty)return Mf;Ty=1,Object.defineProperty(Mf,"__esModule",{value:!0}),Mf.Image=void 0;const e=Lr(),n=qt(),t=bn(),r=Dt(),a=Vt();class o extends t.Shape{constructor(c){super(c),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",m=>{this._removeImageLoad(m.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const c=this.image();c&&c.complete||c&&c.readyState===4||c&&c.addEventListener&&c.addEventListener("load",this._loadListener)}_removeImageLoad(c){c&&c.removeEventListener&&c.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const c=!!this.cornerRadius(),m=this.hasShadow();return c&&m?!0:super._useBufferCanvas(!0)}_sceneFunc(c){const m=this.getWidth(),f=this.getHeight(),v=this.cornerRadius(),y=this.attrs.image;let E;if(y){const w=this.attrs.cropWidth,S=this.attrs.cropHeight;w&&S?E=[y,this.cropX(),this.cropY(),w,S,0,0,m,f]:E=[y,0,0,m,f]}(this.hasFill()||this.hasStroke()||v)&&(c.beginPath(),v?e.Util.drawRoundedRectPath(c,m,f,v):c.rect(0,0,m,f),c.closePath(),c.fillStrokeShape(this)),y&&(v&&c.clip(),c.drawImage.apply(c,E))}_hitFunc(c){const m=this.width(),f=this.height(),v=this.cornerRadius();c.beginPath(),v?e.Util.drawRoundedRectPath(c,m,f,v):c.rect(0,0,m,f),c.closePath(),c.fillStrokeShape(this)}getWidth(){var c,m;return(c=this.attrs.width)!==null&&c!==void 0?c:(m=this.image())===null||m===void 0?void 0:m.width}getHeight(){var c,m;return(c=this.attrs.height)!==null&&c!==void 0?c:(m=this.image())===null||m===void 0?void 0:m.height}static fromURL(c,m,f=null){const v=e.Util.createImageElement();v.onload=function(){const y=new o({image:v});m(y)},v.onerror=f,v.crossOrigin="Anonymous",v.src=c}}return Mf.Image=o,o.prototype.className="Image",(0,r._registerNode)(o),n.Factory.addGetterSetter(o,"cornerRadius",0,(0,a.getNumberOrArrayOfNumbersValidator)(4)),n.Factory.addGetterSetter(o,"image"),n.Factory.addComponentsGetterSetter(o,"crop",["x","y","width","height"]),n.Factory.addGetterSetter(o,"cropX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(o,"cropY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(o,"cropWidth",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(o,"cropHeight",0,(0,a.getNumberValidator)()),Mf}var Is={},Ry;function w9(){if(Ry)return Is;Ry=1,Object.defineProperty(Is,"__esModule",{value:!0}),Is.Tag=Is.Label=void 0;const e=qt(),n=bn(),t=Tv(),r=Vt(),a=Dt(),o=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],s="Change.konva",c="none",m="up",f="right",v="down",y="left",E=o.length;class w extends t.Group{constructor(_){super(_),this.on("add.konva",function(b){this._addListeners(b.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(_){let b=this,g;const h=function(){b._sync()};for(g=0;g<E;g++)_.on(o[g]+s,h)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let _=this.getText(),b=this.getTag(),g,h,d,P,M,T,I;if(_&&b){switch(g=_.width(),h=_.height(),d=b.pointerDirection(),P=b.pointerWidth(),I=b.pointerHeight(),M=0,T=0,d){case m:M=g/2,T=-1*I;break;case f:M=g+P,T=h/2;break;case v:M=g/2,T=h+I;break;case y:M=-1*P,T=h/2;break}b.setAttrs({x:-1*M,y:-1*T,width:g,height:h}),_.setAttrs({x:-1*M,y:-1*T})}}}Is.Label=w,w.prototype.className="Label",(0,a._registerNode)(w);class S extends n.Shape{_sceneFunc(_){const b=this.width(),g=this.height(),h=this.pointerDirection(),d=this.pointerWidth(),P=this.pointerHeight(),M=this.cornerRadius();let T=0,I=0,F=0,k=0;typeof M=="number"?T=I=F=k=Math.min(M,b/2,g/2):(T=Math.min(M[0]||0,b/2,g/2),I=Math.min(M[1]||0,b/2,g/2),k=Math.min(M[2]||0,b/2,g/2),F=Math.min(M[3]||0,b/2,g/2)),_.beginPath(),_.moveTo(T,0),h===m&&(_.lineTo((b-d)/2,0),_.lineTo(b/2,-1*P),_.lineTo((b+d)/2,0)),_.lineTo(b-I,0),_.arc(b-I,I,I,Math.PI*3/2,0,!1),h===f&&(_.lineTo(b,(g-P)/2),_.lineTo(b+d,g/2),_.lineTo(b,(g+P)/2)),_.lineTo(b,g-k),_.arc(b-k,g-k,k,0,Math.PI/2,!1),h===v&&(_.lineTo((b+d)/2,g),_.lineTo(b/2,g+P),_.lineTo((b-d)/2,g)),_.lineTo(F,g),_.arc(F,g-F,F,Math.PI/2,Math.PI,!1),h===y&&(_.lineTo(0,(g+P)/2),_.lineTo(-1*d,g/2),_.lineTo(0,(g-P)/2)),_.lineTo(0,T),_.arc(T,T,T,Math.PI,Math.PI*3/2,!1),_.closePath(),_.fillStrokeShape(this)}getSelfRect(){let _=0,b=0,g=this.pointerWidth(),h=this.pointerHeight(),d=this.pointerDirection(),P=this.width(),M=this.height();return d===m?(b-=h,M+=h):d===v?M+=h:d===y?(_-=g*1.5,P+=g):d===f&&(P+=g*1.5),{x:_,y:b,width:P,height:M}}}return Is.Tag=S,S.prototype.className="Tag",(0,a._registerNode)(S),e.Factory.addGetterSetter(S,"pointerDirection",c),e.Factory.addGetterSetter(S,"pointerWidth",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(S,"pointerHeight",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(S,"cornerRadius",0,(0,r.getNumberOrArrayOfNumbersValidator)(4)),Is}var Lf={},My;function S5(){if(My)return Lf;My=1,Object.defineProperty(Lf,"__esModule",{value:!0}),Lf.Rect=void 0;const e=qt(),n=bn(),t=Dt(),r=Lr(),a=Vt();class o extends n.Shape{_sceneFunc(c){const m=this.cornerRadius(),f=this.width(),v=this.height();c.beginPath(),m?r.Util.drawRoundedRectPath(c,f,v,m):c.rect(0,0,f,v),c.closePath(),c.fillStrokeShape(this)}}return Lf.Rect=o,o.prototype.className="Rect",(0,t._registerNode)(o),e.Factory.addGetterSetter(o,"cornerRadius",0,(0,a.getNumberOrArrayOfNumbersValidator)(4)),Lf}var Nf={},Ly;function _9(){if(Ly)return Nf;Ly=1,Object.defineProperty(Nf,"__esModule",{value:!0}),Nf.RegularPolygon=void 0;const e=qt(),n=bn(),t=Vt(),r=Dt();class a extends n.Shape{_sceneFunc(s){const c=this._getPoints();s.beginPath(),s.moveTo(c[0].x,c[0].y);for(let m=1;m<c.length;m++)s.lineTo(c[m].x,c[m].y);s.closePath(),s.fillStrokeShape(this)}_getPoints(){const s=this.attrs.sides,c=this.attrs.radius||0,m=[];for(let f=0;f<s;f++)m.push({x:c*Math.sin(f*2*Math.PI/s),y:-1*c*Math.cos(f*2*Math.PI/s)});return m}getSelfRect(){const s=this._getPoints();let c=s[0].x,m=s[0].y,f=s[0].x,v=s[0].y;return s.forEach(y=>{c=Math.min(c,y.x),m=Math.max(m,y.x),f=Math.min(f,y.y),v=Math.max(v,y.y)}),{x:c,y:f,width:m-c,height:v-f}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(s){this.radius(s/2)}setHeight(s){this.radius(s/2)}}return Nf.RegularPolygon=a,a.prototype.className="RegularPolygon",a.prototype._centroid=!0,a.prototype._attrsAffectingSize=["radius"],(0,r._registerNode)(a),e.Factory.addGetterSetter(a,"radius",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(a,"sides",0,(0,t.getNumberValidator)()),Nf}var If={},Ny;function S9(){if(Ny)return If;Ny=1,Object.defineProperty(If,"__esModule",{value:!0}),If.Ring=void 0;const e=qt(),n=bn(),t=Vt(),r=Dt(),a=Math.PI*2;class o extends n.Shape{_sceneFunc(c){c.beginPath(),c.arc(0,0,this.innerRadius(),0,a,!1),c.moveTo(this.outerRadius(),0),c.arc(0,0,this.outerRadius(),a,0,!0),c.closePath(),c.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(c){this.outerRadius(c/2)}setHeight(c){this.outerRadius(c/2)}}return If.Ring=o,o.prototype.className="Ring",o.prototype._centroid=!0,o.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,r._registerNode)(o),e.Factory.addGetterSetter(o,"innerRadius",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(o,"outerRadius",0,(0,t.getNumberValidator)()),If}var jf={},Iy;function E9(){if(Iy)return jf;Iy=1,Object.defineProperty(jf,"__esModule",{value:!0}),jf.Sprite=void 0;const e=qt(),n=bn(),t=Rv(),r=Vt(),a=Dt();class o extends n.Shape{constructor(c){super(c),this._updated=!0,this.anim=new t.Animation(()=>{const m=this._updated;return this._updated=!1,m}),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(c){const m=this.animation(),f=this.frameIndex(),v=f*4,y=this.animations()[m],E=this.frameOffsets(),w=y[v+0],S=y[v+1],x=y[v+2],_=y[v+3],b=this.image();if((this.hasFill()||this.hasStroke())&&(c.beginPath(),c.rect(0,0,x,_),c.closePath(),c.fillStrokeShape(this)),b)if(E){const g=E[m],h=f*2;c.drawImage(b,w,S,x,_,g[h+0],g[h+1],x,_)}else c.drawImage(b,w,S,x,_,0,0,x,_)}_hitFunc(c){const m=this.animation(),f=this.frameIndex(),v=f*4,y=this.animations()[m],E=this.frameOffsets(),w=y[v+2],S=y[v+3];if(c.beginPath(),E){const x=E[m],_=f*2;c.rect(x[_+0],x[_+1],w,S)}else c.rect(0,0,w,S);c.closePath(),c.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const c=this;this.interval=setInterval(function(){c._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const c=this.getLayer();this.anim.setLayers(c),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const c=this.frameIndex(),m=this.animation(),f=this.animations(),v=f[m],y=v.length/4;c<y-1?this.frameIndex(c+1):this.frameIndex(0)}}return jf.Sprite=o,o.prototype.className="Sprite",(0,a._registerNode)(o),e.Factory.addGetterSetter(o,"animation"),e.Factory.addGetterSetter(o,"animations"),e.Factory.addGetterSetter(o,"frameOffsets"),e.Factory.addGetterSetter(o,"image"),e.Factory.addGetterSetter(o,"frameIndex",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(o,"frameRate",17,(0,r.getNumberValidator)()),e.Factory.backCompat(o,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"}),jf}var Df={},jy;function x9(){if(jy)return Df;jy=1,Object.defineProperty(Df,"__esModule",{value:!0}),Df.Star=void 0;const e=qt(),n=bn(),t=Vt(),r=Dt();class a extends n.Shape{_sceneFunc(s){const c=this.innerRadius(),m=this.outerRadius(),f=this.numPoints();s.beginPath(),s.moveTo(0,0-m);for(let v=1;v<f*2;v++){const y=v%2===0?m:c,E=y*Math.sin(v*Math.PI/f),w=-1*y*Math.cos(v*Math.PI/f);s.lineTo(E,w)}s.closePath(),s.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(s){this.outerRadius(s/2)}setHeight(s){this.outerRadius(s/2)}}return Df.Star=a,a.prototype.className="Star",a.prototype._centroid=!0,a.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,r._registerNode)(a),e.Factory.addGetterSetter(a,"numPoints",5,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(a,"innerRadius",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(a,"outerRadius",0,(0,t.getNumberValidator)()),Df}var Qu={},Dy;function E5(){if(Dy)return Qu;Dy=1,Object.defineProperty(Qu,"__esModule",{value:!0}),Qu.Text=void 0,Qu.stringToArray=s;const e=Lr(),n=qt(),t=bn(),r=Dt(),a=Vt(),o=Dt();function s(Y){return[...Y].reduce((U,ee,te,Q)=>{if(new RegExp("\\p{Emoji}","u").test(ee)){const Z=Q[te+1];Z&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(Z)?(U.push(ee+Z),Q[te+1]=""):U.push(ee)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(ee+(Q[te+1]||""))?U.push(ee+Q[te+1]):te>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(ee)?U[U.length-1]+=ee:ee&&U.push(ee);return U},[])}const c="auto",m="center",f="inherit",v="justify",y="Change.konva",E="2d",w="-",S="left",x="text",_="Text",b="top",g="bottom",h="middle",d="normal",P="px ",M=" ",T="right",I="rtl",F="word",k="char",O="none",N="…",A=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],R=A.length;function L(Y){return Y.split(",").map(U=>{U=U.trim();const ee=U.indexOf(" ")>=0,te=U.indexOf('"')>=0||U.indexOf("'")>=0;return ee&&!te&&(U=`"${U}"`),U}).join(", ")}let V;function G(){return V||(V=e.Util.createCanvasElement().getContext(E),V)}function W(Y){Y.fillText(this._partialText,this._partialTextX,this._partialTextY)}function X(Y){Y.setAttr("miterLimit",2),Y.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function q(Y){return Y=Y||{},!Y.fillLinearGradientColorStops&&!Y.fillRadialGradientColorStops&&!Y.fillPatternImage&&(Y.fill=Y.fill||"black"),Y}class z extends t.Shape{constructor(U){super(q(U)),this._partialTextX=0,this._partialTextY=0;for(let ee=0;ee<R;ee++)this.on(A[ee]+y,this._setTextData);this._setTextData()}_sceneFunc(U){const ee=this.textArr,te=ee.length;if(!this.text())return;let Q=this.padding(),Z=this.fontSize(),re=this.lineHeight()*Z,ne=this.verticalAlign(),ae=this.direction(),ue=0,fe=this.align(),pe=this.getWidth(),ye=this.letterSpacing(),we=this.fill(),je=this.textDecoration(),Te=je.indexOf("underline")!==-1,se=je.indexOf("line-through")!==-1,_e;ae=ae===f?U.direction:ae;let he=re/2,xe=h;if(r.Konva._fixTextRendering){const Ue=this.measureSize("M");xe="alphabetic",he=(Ue.fontBoundingBoxAscent-Ue.fontBoundingBoxDescent)/2+re/2}var oe=0,ve=0;for(ae===I&&U.setAttr("direction",ae),U.setAttr("font",this._getContextFont()),U.setAttr("textBaseline",xe),U.setAttr("textAlign",S),ne===h?ue=(this.getHeight()-te*re-Q*2)/2:ne===g&&(ue=this.getHeight()-te*re-Q*2),U.translate(Q,ue+Q),_e=0;_e<te;_e++){var oe=0,ve=0,de=ee[_e],ke=de.text,Be=de.width,Qe=de.lastInParagraph,Ke,St;if(U.save(),fe===T?oe+=pe-Be-Q*2:fe===m&&(oe+=(pe-Be-Q*2)/2),Te){U.save(),U.beginPath();const gt=r.Konva._fixTextRendering?Math.round(Z/4):Math.round(Z/2),mt=oe,kt=he+ve+gt;U.moveTo(mt,kt),Ke=ke.split(" ").length-1,St=fe===v&&!Qe?pe-Q*2:Be,U.lineTo(mt+Math.round(St),kt),U.lineWidth=Z/15;const jt=this._getLinearGradient();U.strokeStyle=jt||we,U.stroke(),U.restore()}if(se){U.save(),U.beginPath();const gt=r.Konva._fixTextRendering?-Math.round(Z/4):0;U.moveTo(oe,he+ve+gt),Ke=ke.split(" ").length-1,St=fe===v&&!Qe?pe-Q*2:Be,U.lineTo(oe+Math.round(St),he+ve+gt),U.lineWidth=Z/15;const mt=this._getLinearGradient();U.strokeStyle=mt||we,U.stroke(),U.restore()}if(ae!==I&&(ye!==0||fe===v)){Ke=ke.split(" ").length-1;const gt=s(ke);for(let mt=0;mt<gt.length;mt++){const kt=gt[mt];kt===" "&&!Qe&&fe===v&&(oe+=(pe-Q*2-Be)/Ke),this._partialTextX=oe,this._partialTextY=he+ve,this._partialText=kt,U.fillStrokeShape(this),oe+=this.measureSize(kt).width+ye}}else ye!==0&&U.setAttr("letterSpacing",`${ye}px`),this._partialTextX=oe,this._partialTextY=he+ve,this._partialText=ke,U.fillStrokeShape(this);U.restore(),te>1&&(he+=re)}}_hitFunc(U){const ee=this.getWidth(),te=this.getHeight();U.beginPath(),U.rect(0,0,ee,te),U.closePath(),U.fillStrokeShape(this)}setText(U){const ee=e.Util._isString(U)?U:U==null?"":U+"";return this._setAttr(x,ee),this}getWidth(){return this.attrs.width===c||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===c||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return e.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(U){var ee,te,Q,Z,re,ne,ae,ue,fe,pe,ye;let we=G(),je=this.fontSize(),Te;we.save(),we.font=this._getContextFont(),Te=we.measureText(U),we.restore();const se=je/100;return{actualBoundingBoxAscent:(ee=Te.actualBoundingBoxAscent)!==null&&ee!==void 0?ee:71.58203125*se,actualBoundingBoxDescent:(te=Te.actualBoundingBoxDescent)!==null&&te!==void 0?te:0,actualBoundingBoxLeft:(Q=Te.actualBoundingBoxLeft)!==null&&Q!==void 0?Q:-7.421875*se,actualBoundingBoxRight:(Z=Te.actualBoundingBoxRight)!==null&&Z!==void 0?Z:75.732421875*se,alphabeticBaseline:(re=Te.alphabeticBaseline)!==null&&re!==void 0?re:0,emHeightAscent:(ne=Te.emHeightAscent)!==null&&ne!==void 0?ne:100*se,emHeightDescent:(ae=Te.emHeightDescent)!==null&&ae!==void 0?ae:-20*se,fontBoundingBoxAscent:(ue=Te.fontBoundingBoxAscent)!==null&&ue!==void 0?ue:91*se,fontBoundingBoxDescent:(fe=Te.fontBoundingBoxDescent)!==null&&fe!==void 0?fe:21*se,hangingBaseline:(pe=Te.hangingBaseline)!==null&&pe!==void 0?pe:72.80000305175781*se,ideographicBaseline:(ye=Te.ideographicBaseline)!==null&&ye!==void 0?ye:-21*se,width:Te.width,height:je}}_getContextFont(){return this.fontStyle()+M+this.fontVariant()+M+(this.fontSize()+P)+L(this.fontFamily())}_addTextLine(U){this.align()===v&&(U=U.trim());const te=this._getTextWidth(U);return this.textArr.push({text:U,width:te,lastInParagraph:!1})}_getTextWidth(U){const ee=this.letterSpacing(),te=U.length;return G().measureText(U).width+ee*te}_setTextData(){let U=this.text().split(`
|
|
43
|
-
`),ee=+this.fontSize(),te=0,Q=this.lineHeight()*ee,Z=this.attrs.width,re=this.attrs.height,ne=Z!==c&&Z!==void 0,ae=re!==c&&re!==void 0,ue=this.padding(),fe=Z-ue*2,pe=re-ue*2,ye=0,we=this.wrap(),je=we!==O,Te=we!==k&&je,se=this.ellipsis();this.textArr=[],G().font=this._getContextFont();const _e=se?this._getTextWidth(N):0;for(let he=0,xe=U.length;he<xe;++he){let oe=U[he],ve=this._getTextWidth(oe);if(ne&&ve>fe)for(;oe.length>0;){let de=0,ke=s(oe).length,Be="",Qe=0;for(;de<ke;){const Ke=de+ke>>>1,St=s(oe),Ue=St.slice(0,Ke+1).join(""),rt=this._getTextWidth(Ue)+_e;rt<=fe?(de=Ke+1,Be=Ue,Qe=rt):ke=Ke}if(Be){if(Te){const Ue=s(oe),rt=s(Be),gt=Ue[rt.length],mt=gt===M||gt===w;let kt;if(mt&&Qe<=fe)kt=rt.length;else{const jt=rt.lastIndexOf(M),Oe=rt.lastIndexOf(w);kt=Math.max(jt,Oe)+1}kt>0&&(de=kt,Be=Ue.slice(0,de).join(""),Qe=this._getTextWidth(Be))}if(Be=Be.trimRight(),this._addTextLine(Be),te=Math.max(te,Qe),ye+=Q,this._shouldHandleEllipsis(ye)){this._tryToAddEllipsisToLastLine();break}if(oe=s(oe).slice(de).join("").trimLeft(),oe.length>0&&(ve=this._getTextWidth(oe),ve<=fe)){this._addTextLine(oe),ye+=Q,te=Math.max(te,ve);break}}else break}else this._addTextLine(oe),ye+=Q,te=Math.max(te,ve),this._shouldHandleEllipsis(ye)&&he<xe-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),ae&&ye+Q>pe)break}this.textHeight=ee,this.textWidth=te}_shouldHandleEllipsis(U){const ee=+this.fontSize(),te=this.lineHeight()*ee,Q=this.attrs.height,Z=Q!==c&&Q!==void 0,re=this.padding(),ne=Q-re*2;return!(this.wrap()!==O)||Z&&U+te>ne}_tryToAddEllipsisToLastLine(){const U=this.attrs.width,ee=U!==c&&U!==void 0,te=this.padding(),Q=U-te*2,Z=this.ellipsis(),re=this.textArr[this.textArr.length-1];!re||!Z||(ee&&(this._getTextWidth(re.text+N)<Q||(re.text=re.text.slice(0,re.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(re.text+N))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const U=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,ee=this.hasShadow();return U&&ee?!0:super._useBufferCanvas()}}return Qu.Text=z,z.prototype._fillFunc=W,z.prototype._strokeFunc=X,z.prototype.className=_,z.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"],(0,o._registerNode)(z),n.Factory.overWriteSetter(z,"width",(0,a.getNumberOrAutoValidator)()),n.Factory.overWriteSetter(z,"height",(0,a.getNumberOrAutoValidator)()),n.Factory.addGetterSetter(z,"direction",f),n.Factory.addGetterSetter(z,"fontFamily","Arial"),n.Factory.addGetterSetter(z,"fontSize",12,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(z,"fontStyle",d),n.Factory.addGetterSetter(z,"fontVariant",d),n.Factory.addGetterSetter(z,"padding",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(z,"align",S),n.Factory.addGetterSetter(z,"verticalAlign",b),n.Factory.addGetterSetter(z,"lineHeight",1,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(z,"wrap",F),n.Factory.addGetterSetter(z,"ellipsis",!1,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(z,"letterSpacing",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(z,"text","",(0,a.getStringValidator)()),n.Factory.addGetterSetter(z,"textDecoration",""),Qu}var Ff={},Fy;function O9(){if(Fy)return Ff;Fy=1,Object.defineProperty(Ff,"__esModule",{value:!0}),Ff.TextPath=void 0;const e=Lr(),n=qt(),t=bn(),r=Mv(),a=E5(),o=Vt(),s=Dt(),c="",m="normal";function f(E){E.fillText(this.partialText,0,0)}function v(E){E.strokeText(this.partialText,0,0)}class y extends t.Shape{constructor(w){super(w),this.dummyCanvas=e.Util.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return r.Path.getPathLength(this.dataArray)}_getPointAtLength(w){if(!this.attrs.data)return null;const S=this.pathLength;return w-1>S?null:r.Path.getPointAtLengthOfDataArray(w,this.dataArray)}_readDataAttribute(){this.dataArray=r.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(w){w.setAttr("font",this._getContextFont()),w.setAttr("textBaseline",this.textBaseline()),w.setAttr("textAlign","left"),w.save();const S=this.textDecoration(),x=this.fill(),_=this.fontSize(),b=this.glyphInfo;S==="underline"&&w.beginPath();for(let g=0;g<b.length;g++){w.save();const h=b[g].p0;w.translate(h.x,h.y),w.rotate(b[g].rotation),this.partialText=b[g].text,w.fillStrokeShape(this),S==="underline"&&(g===0&&w.moveTo(0,_/2+1),w.lineTo(_,_/2+1)),w.restore()}S==="underline"&&(w.strokeStyle=x,w.lineWidth=_/20,w.stroke()),w.restore()}_hitFunc(w){w.beginPath();const S=this.glyphInfo;if(S.length>=1){const x=S[0].p0;w.moveTo(x.x,x.y)}for(let x=0;x<S.length;x++){const _=S[x].p1;w.lineTo(_.x,_.y)}w.setAttr("lineWidth",this.fontSize()),w.setAttr("strokeStyle",this.colorKey),w.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return e.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(w){return a.Text.prototype.setText.call(this,w)}_getContextFont(){return a.Text.prototype._getContextFont.call(this)}_getTextSize(w){const x=this.dummyCanvas.getContext("2d");x.save(),x.font=this._getContextFont();const _=x.measureText(w);return x.restore(),{width:_.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:w,height:S}=this._getTextSize(this.attrs.text);if(this.textWidth=w,this.textHeight=S,this.glyphInfo=[],!this.attrs.data)return null;const x=this.letterSpacing(),_=this.align(),b=this.kerningFunc(),g=Math.max(this.textWidth+((this.attrs.text||"").length-1)*x,0);let h=0;_==="center"&&(h=Math.max(0,this.pathLength/2-g/2)),_==="right"&&(h=Math.max(0,this.pathLength-g));const d=(0,a.stringToArray)(this.text());let P=h;for(let M=0;M<d.length;M++){const T=this._getPointAtLength(P);if(!T)return;let I=this._getTextSize(d[M]).width+x;if(d[M]===" "&&_==="justify"){const R=this.text().split(" ").length-1;I+=(this.pathLength-g)/R}const F=this._getPointAtLength(P+I);if(!F)return;const k=r.Path.getLineLength(T.x,T.y,F.x,F.y);let O=0;if(b)try{O=b(d[M-1],d[M])*this.fontSize()}catch{O=0}T.x+=O,F.x+=O,this.textWidth+=O;const N=r.Path.getPointOnLine(O+k/2,T.x,T.y,F.x,F.y),A=Math.atan2(F.y-T.y,F.x-T.x);this.glyphInfo.push({transposeX:N.x,transposeY:N.y,text:d[M],rotation:A,p0:T,p1:F}),P+=I}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const w=[];this.glyphInfo.forEach(function(P){w.push(P.p0.x),w.push(P.p0.y),w.push(P.p1.x),w.push(P.p1.y)});let S=w[0]||0,x=w[0]||0,_=w[1]||0,b=w[1]||0,g,h;for(let P=0;P<w.length/2;P++)g=w[P*2],h=w[P*2+1],S=Math.min(S,g),x=Math.max(x,g),_=Math.min(_,h),b=Math.max(b,h);const d=this.fontSize();return{x:S-d/2,y:_-d/2,width:x-S+d,height:b-_+d}}destroy(){return e.Util.releaseCanvas(this.dummyCanvas),super.destroy()}}return Ff.TextPath=y,y.prototype._fillFunc=f,y.prototype._strokeFunc=v,y.prototype._fillFuncHit=f,y.prototype._strokeFuncHit=v,y.prototype.className="TextPath",y.prototype._attrsAffectingSize=["text","fontSize","data"],(0,s._registerNode)(y),n.Factory.addGetterSetter(y,"data"),n.Factory.addGetterSetter(y,"fontFamily","Arial"),n.Factory.addGetterSetter(y,"fontSize",12,(0,o.getNumberValidator)()),n.Factory.addGetterSetter(y,"fontStyle",m),n.Factory.addGetterSetter(y,"align","left"),n.Factory.addGetterSetter(y,"letterSpacing",0,(0,o.getNumberValidator)()),n.Factory.addGetterSetter(y,"textBaseline","middle"),n.Factory.addGetterSetter(y,"fontVariant",m),n.Factory.addGetterSetter(y,"text",c),n.Factory.addGetterSetter(y,"textDecoration",""),n.Factory.addGetterSetter(y,"kerningFunc",void 0),Ff}var zf={},zy;function P9(){if(zy)return zf;zy=1,Object.defineProperty(zf,"__esModule",{value:!0}),zf.Transformer=void 0;const e=Lr(),n=qt(),t=Hr(),r=bn(),a=S5(),o=Tv(),s=Dt(),c=Vt(),m=Dt(),f="tr-konva",v=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(I=>I+`.${f}`).join(" "),y="nodesRect",E=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],w={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},S="ontouchstart"in s.Konva._global;function x(I,F,k){if(I==="rotater")return k;F+=e.Util.degToRad(w[I]||0);const O=(e.Util.radToDeg(F)%360+360)%360;return e.Util._inRange(O,315+22.5,360)||e.Util._inRange(O,0,22.5)?"ns-resize":e.Util._inRange(O,45-22.5,45+22.5)?"nesw-resize":e.Util._inRange(O,90-22.5,90+22.5)?"ew-resize":e.Util._inRange(O,135-22.5,135+22.5)?"nwse-resize":e.Util._inRange(O,180-22.5,180+22.5)?"ns-resize":e.Util._inRange(O,225-22.5,225+22.5)?"nesw-resize":e.Util._inRange(O,270-22.5,270+22.5)?"ew-resize":e.Util._inRange(O,315-22.5,315+22.5)?"nwse-resize":(e.Util.error("Transformer has unknown angle for cursor detection: "+O),"pointer")}const _=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function b(I){return{x:I.x+I.width/2*Math.cos(I.rotation)+I.height/2*Math.sin(-I.rotation),y:I.y+I.height/2*Math.cos(I.rotation)+I.width/2*Math.sin(I.rotation)}}function g(I,F,k){const O=k.x+(I.x-k.x)*Math.cos(F)-(I.y-k.y)*Math.sin(F),N=k.y+(I.x-k.x)*Math.sin(F)+(I.y-k.y)*Math.cos(F);return{...I,rotation:I.rotation+F,x:O,y:N}}function h(I,F){const k=b(I);return g(I,F,k)}function d(I,F,k){let O=F;for(let N=0;N<I.length;N++){const A=s.Konva.getAngle(I[N]),R=Math.abs(A-F)%(Math.PI*2);Math.min(R,Math.PI*2-R)<k&&(O=A)}return O}let P=0;class M extends o.Group{constructor(F){super(F),this._movingAnchorName=null,this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(v,this.update),this.getNode()&&this.update()}attachTo(F){return this.setNode(F),this}setNode(F){return e.Util.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([F])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return f+this._id}setNodes(F=[]){this._nodes&&this._nodes.length&&this.detach();const k=F.filter(N=>N.isAncestorOf(this)?(e.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=F=k,F.length===1&&this.useSingleNodeRotation()?this.rotation(F[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(N=>{const A=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(N._attrsAffectingSize.length){const R=N._attrsAffectingSize.map(L=>L+"Change."+this._getEventNamespace()).join(" ");N.on(R,A)}N.on(E.map(R=>R+`.${this._getEventNamespace()}`).join(" "),A),N.on(`absoluteTransformChange.${this._getEventNamespace()}`,A),this._proxyDrag(N)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(F){let k;F.on(`dragstart.${this._getEventNamespace()}`,O=>{k=F.getAbsolutePosition(),!this.isDragging()&&F!==this.findOne(".back")&&this.startDrag(O,!1)}),F.on(`dragmove.${this._getEventNamespace()}`,O=>{if(!k)return;const N=F.getAbsolutePosition(),A=N.x-k.x,R=N.y-k.y;this.nodes().forEach(L=>{if(L===F||L.isDragging())return;const V=L.getAbsolutePosition();L.setAbsolutePosition({x:V.x+A,y:V.y+R}),L.startDrag(O)}),k=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(F=>{F.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(y),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(y,this.__getNodeRect)}__getNodeShape(F,k=this.rotation(),O){const N=F.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),A=F.getAbsoluteScale(O),R=F.getAbsolutePosition(O),L=N.x*A.x-F.offsetX()*A.x,V=N.y*A.y-F.offsetY()*A.y,G=(s.Konva.getAngle(F.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),W={x:R.x+L*Math.cos(G)+V*Math.sin(-G),y:R.y+V*Math.cos(G)+L*Math.sin(G),width:N.width*A.x,height:N.height*A.y,rotation:G};return g(W,-s.Konva.getAngle(k),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const k=[];this.nodes().map(G=>{const W=G.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),X=[{x:W.x,y:W.y},{x:W.x+W.width,y:W.y},{x:W.x+W.width,y:W.y+W.height},{x:W.x,y:W.y+W.height}],q=G.getAbsoluteTransform();X.forEach(function(z){const Y=q.point(z);k.push(Y)})});const O=new e.Transform;O.rotate(-s.Konva.getAngle(this.rotation()));let N=1/0,A=1/0,R=-1/0,L=-1/0;k.forEach(function(G){const W=O.point(G);N===void 0&&(N=R=W.x,A=L=W.y),N=Math.min(N,W.x),A=Math.min(A,W.y),R=Math.max(R,W.x),L=Math.max(L,W.y)}),O.invert();const V=O.point({x:N,y:A});return{x:V.x,y:V.y,width:R-N,height:L-A,rotation:s.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(),_.forEach(F=>{this._createAnchor(F)}),this._createAnchor("rotater")}_createAnchor(F){const k=new a.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:F+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:S?10:"auto"}),O=this;k.on("mousedown touchstart",function(N){O._handleMouseDown(N)}),k.on("dragstart",N=>{k.stopDrag(),N.cancelBubble=!0}),k.on("dragend",N=>{N.cancelBubble=!0}),k.on("mouseenter",()=>{const N=s.Konva.getAngle(this.rotation()),A=this.rotateAnchorCursor(),R=x(F,N,A);k.getStage().content&&(k.getStage().content.style.cursor=R),this._cursorChange=!0}),k.on("mouseout",()=>{k.getStage().content&&(k.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(k)}_createBack(){const F=new r.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(k,O){const N=O.getParent(),A=N.padding();k.beginPath(),k.rect(-A,-A,O.width()+A*2,O.height()+A*2),k.moveTo(O.width()/2,-A),N.rotateEnabled()&&N.rotateLineVisible()&&k.lineTo(O.width()/2,-N.rotateAnchorOffset()*e.Util._sign(O.height())-A),k.fillStrokeShape(O)},hitFunc:(k,O)=>{if(!this.shouldOverdrawWholeArea())return;const N=this.padding();k.beginPath(),k.rect(-N,-N,O.width()+N*2,O.height()+N*2),k.fillStrokeShape(O)}});this.add(F),this._proxyDrag(F),F.on("dragstart",k=>{k.cancelBubble=!0}),F.on("dragmove",k=>{k.cancelBubble=!0}),F.on("dragend",k=>{k.cancelBubble=!0}),this.on("dragmove",k=>{this.update()})}_handleMouseDown(F){if(this._transforming)return;this._movingAnchorName=F.target.name().split(" ")[0];const k=this._getNodeRect(),O=k.width,N=k.height,A=Math.sqrt(Math.pow(O,2)+Math.pow(N,2));this.sin=Math.abs(N/A),this.cos=Math.abs(O/A),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 R=F.target.getAbsolutePosition(),L=F.target.getStage().getPointerPosition();this._anchorDragOffset={x:L.x-R.x,y:L.y-R.y},P++,this._fire("transformstart",{evt:F.evt,target:this.getNode()}),this._nodes.forEach(V=>{V._fire("transformstart",{evt:F.evt,target:V})})}_handleMouseMove(F){let k,O,N;const A=this.findOne("."+this._movingAnchorName),R=A.getStage();R.setPointersPositions(F);const L=R.getPointerPosition();let V={x:L.x-this._anchorDragOffset.x,y:L.y-this._anchorDragOffset.y};const G=A.getAbsolutePosition();this.anchorDragBoundFunc()&&(V=this.anchorDragBoundFunc()(G,V,F)),A.setAbsolutePosition(V);const W=A.getAbsolutePosition();if(G.x===W.x&&G.y===W.y)return;if(this._movingAnchorName==="rotater"){const ne=this._getNodeRect();k=A.x()-ne.width/2,O=-A.y()+ne.height/2;let ae=Math.atan2(-O,k)+Math.PI/2;ne.height<0&&(ae-=Math.PI);const fe=s.Konva.getAngle(this.rotation())+ae,pe=s.Konva.getAngle(this.rotationSnapTolerance()),we=d(this.rotationSnaps(),fe,pe)-ne.rotation,je=h(ne,we);this._fitNodesInto(je,F);return}const X=this.shiftBehavior();let q;X==="inverted"?q=this.keepRatio()&&!F.shiftKey:X==="none"?q=this.keepRatio():q=this.keepRatio()||F.shiftKey;var te=this.centeredScaling()||F.altKey;if(this._movingAnchorName==="top-left"){if(q){var z=te?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};N=Math.sqrt(Math.pow(z.x-A.x(),2)+Math.pow(z.y-A.y(),2));var Y=this.findOne(".top-left").x()>z.x?-1:1,U=this.findOne(".top-left").y()>z.y?-1:1;k=N*this.cos*Y,O=N*this.sin*U,this.findOne(".top-left").x(z.x-k),this.findOne(".top-left").y(z.y-O)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(A.y());else if(this._movingAnchorName==="top-right"){if(q){var z=te?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};N=Math.sqrt(Math.pow(A.x()-z.x,2)+Math.pow(z.y-A.y(),2));var Y=this.findOne(".top-right").x()<z.x?-1:1,U=this.findOne(".top-right").y()>z.y?-1:1;k=N*this.cos*Y,O=N*this.sin*U,this.findOne(".top-right").x(z.x+k),this.findOne(".top-right").y(z.y-O)}var ee=A.position();this.findOne(".top-left").y(ee.y),this.findOne(".bottom-right").x(ee.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(A.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(A.x());else if(this._movingAnchorName==="bottom-left"){if(q){var z=te?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};N=Math.sqrt(Math.pow(z.x-A.x(),2)+Math.pow(A.y()-z.y,2));var Y=z.x<A.x()?-1:1,U=A.y()<z.y?-1:1;k=N*this.cos*Y,O=N*this.sin*U,A.x(z.x-k),A.y(z.y+O)}ee=A.position(),this.findOne(".top-left").x(ee.x),this.findOne(".bottom-right").y(ee.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(A.y());else if(this._movingAnchorName==="bottom-right"){if(q){var z=te?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};N=Math.sqrt(Math.pow(A.x()-z.x,2)+Math.pow(A.y()-z.y,2));var Y=this.findOne(".bottom-right").x()<z.x?-1:1,U=this.findOne(".bottom-right").y()<z.y?-1:1;k=N*this.cos*Y,O=N*this.sin*U,this.findOne(".bottom-right").x(z.x+k),this.findOne(".bottom-right").y(z.y+O)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var te=this.centeredScaling()||F.altKey;if(te){const ne=this.findOne(".top-left"),ae=this.findOne(".bottom-right"),ue=ne.x(),fe=ne.y(),pe=this.getWidth()-ae.x(),ye=this.getHeight()-ae.y();ae.move({x:-ue,y:-fe}),ne.move({x:pe,y:ye})}const Q=this.findOne(".top-left").getAbsolutePosition();k=Q.x,O=Q.y;const Z=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),re=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:k,y:O,width:Z,height:re,rotation:s.Konva.getAngle(this.rotation())},F)}_handleMouseUp(F){this._removeEvents(F)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(F){var k;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));const O=this.getNode();P--,this._fire("transformend",{evt:F,target:O}),(k=this.getLayer())===null||k===void 0||k.batchDraw(),O&&this._nodes.forEach(N=>{var A;N._fire("transformend",{evt:F,target:N}),(A=N.getLayer())===null||A===void 0||A.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(F,k){const O=this._getNodeRect(),N=1;if(e.Util._inRange(F.width,-this.padding()*2-N,N)){this.update();return}if(e.Util._inRange(F.height,-this.padding()*2-N,N)){this.update();return}const A=new e.Transform;if(A.rotate(s.Konva.getAngle(this.rotation())),this._movingAnchorName&&F.width<0&&this._movingAnchorName.indexOf("left")>=0){const q=A.point({x:-this.padding()*2,y:0});F.x+=q.x,F.y+=q.y,F.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=q.x,this._anchorDragOffset.y-=q.y}else if(this._movingAnchorName&&F.width<0&&this._movingAnchorName.indexOf("right")>=0){const q=A.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=q.x,this._anchorDragOffset.y-=q.y,F.width+=this.padding()*2}if(this._movingAnchorName&&F.height<0&&this._movingAnchorName.indexOf("top")>=0){const q=A.point({x:0,y:-this.padding()*2});F.x+=q.x,F.y+=q.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=q.x,this._anchorDragOffset.y-=q.y,F.height+=this.padding()*2}else if(this._movingAnchorName&&F.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const q=A.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=q.x,this._anchorDragOffset.y-=q.y,F.height+=this.padding()*2}if(this.boundBoxFunc()){const q=this.boundBoxFunc()(O,F);q?F=q:e.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const R=1e7,L=new e.Transform;L.translate(O.x,O.y),L.rotate(O.rotation),L.scale(O.width/R,O.height/R);const V=new e.Transform,G=F.width/R,W=F.height/R;this.flipEnabled()===!1?(V.translate(F.x,F.y),V.rotate(F.rotation),V.translate(F.width<0?F.width:0,F.height<0?F.height:0),V.scale(Math.abs(G),Math.abs(W))):(V.translate(F.x,F.y),V.rotate(F.rotation),V.scale(G,W));const X=V.multiply(L.invert());this._nodes.forEach(q=>{var z;const Y=q.getParent().getAbsoluteTransform(),U=q.getTransform().copy();U.translate(q.offsetX(),q.offsetY());const ee=new e.Transform;ee.multiply(Y.copy().invert()).multiply(X).multiply(Y).multiply(U);const te=ee.decompose();q.setAttrs(te),(z=q.getLayer())===null||z===void 0||z.batchDraw()}),this.rotation(e.Util._getRotation(F.rotation)),this._nodes.forEach(q=>{this._fire("transform",{evt:k,target:q}),q._fire("transform",{evt:k,target:q})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(F,k){this.findOne(F).setAttrs(k)}update(){var F;const k=this._getNodeRect();this.rotation(e.Util._getRotation(k.rotation));const O=k.width,N=k.height,A=this.enabledAnchors(),R=this.resizeEnabled(),L=this.padding(),V=this.anchorSize(),G=this.find("._anchor");G.forEach(X=>{X.setAttrs({width:V,height:V,offsetX:V/2,offsetY:V/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:V/2+L,offsetY:V/2+L,visible:R&&A.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:O/2,y:0,offsetY:V/2+L,visible:R&&A.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:O,y:0,offsetX:V/2-L,offsetY:V/2+L,visible:R&&A.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:N/2,offsetX:V/2+L,visible:R&&A.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:O,y:N/2,offsetX:V/2-L,visible:R&&A.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:N,offsetX:V/2+L,offsetY:V/2-L,visible:R&&A.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:O/2,y:N,offsetY:V/2-L,visible:R&&A.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:O,y:N,offsetX:V/2-L,offsetY:V/2-L,visible:R&&A.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:O/2,y:-this.rotateAnchorOffset()*e.Util._sign(N)-L,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:O,height:N,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const W=this.anchorStyleFunc();W&&G.forEach(X=>{W(X)}),(F=this.getLayer())===null||F===void 0||F.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const F=this.findOne("."+this._movingAnchorName);F&&F.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),o.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return t.Node.prototype.toObject.call(this)}clone(F){return t.Node.prototype.clone.call(this,F)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}zf.Transformer=M,M.isTransforming=()=>P>0;function T(I){return I instanceof Array||e.Util.warn("enabledAnchors value should be an array"),I instanceof Array&&I.forEach(function(F){_.indexOf(F)===-1&&e.Util.warn("Unknown anchor name: "+F+". Available names are: "+_.join(", "))}),I||[]}return M.prototype.className="Transformer",(0,m._registerNode)(M),n.Factory.addGetterSetter(M,"enabledAnchors",_,T),n.Factory.addGetterSetter(M,"flipEnabled",!0,(0,c.getBooleanValidator)()),n.Factory.addGetterSetter(M,"resizeEnabled",!0),n.Factory.addGetterSetter(M,"anchorSize",10,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(M,"rotateEnabled",!0),n.Factory.addGetterSetter(M,"rotateLineVisible",!0),n.Factory.addGetterSetter(M,"rotationSnaps",[]),n.Factory.addGetterSetter(M,"rotateAnchorOffset",50,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(M,"rotateAnchorCursor","crosshair"),n.Factory.addGetterSetter(M,"rotationSnapTolerance",5,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(M,"borderEnabled",!0),n.Factory.addGetterSetter(M,"anchorStroke","rgb(0, 161, 255)"),n.Factory.addGetterSetter(M,"anchorStrokeWidth",1,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(M,"anchorFill","white"),n.Factory.addGetterSetter(M,"anchorCornerRadius",0,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(M,"borderStroke","rgb(0, 161, 255)"),n.Factory.addGetterSetter(M,"borderStrokeWidth",1,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(M,"borderDash"),n.Factory.addGetterSetter(M,"keepRatio",!0),n.Factory.addGetterSetter(M,"shiftBehavior","default"),n.Factory.addGetterSetter(M,"centeredScaling",!1),n.Factory.addGetterSetter(M,"ignoreStroke",!1),n.Factory.addGetterSetter(M,"padding",0,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(M,"nodes"),n.Factory.addGetterSetter(M,"node"),n.Factory.addGetterSetter(M,"boundBoxFunc"),n.Factory.addGetterSetter(M,"anchorDragBoundFunc"),n.Factory.addGetterSetter(M,"anchorStyleFunc"),n.Factory.addGetterSetter(M,"shouldOverdrawWholeArea",!1),n.Factory.addGetterSetter(M,"useSingleNodeRotation",!0),n.Factory.backCompat(M,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"}),zf}var Bf={},By;function C9(){if(By)return Bf;By=1,Object.defineProperty(Bf,"__esModule",{value:!0}),Bf.Wedge=void 0;const e=qt(),n=bn(),t=Dt(),r=Vt(),a=Dt();class o extends n.Shape{_sceneFunc(c){c.beginPath(),c.arc(0,0,this.radius(),0,t.Konva.getAngle(this.angle()),this.clockwise()),c.lineTo(0,0),c.closePath(),c.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(c){this.radius(c/2)}setHeight(c){this.radius(c/2)}}return Bf.Wedge=o,o.prototype.className="Wedge",o.prototype._centroid=!0,o.prototype._attrsAffectingSize=["radius"],(0,a._registerNode)(o),e.Factory.addGetterSetter(o,"radius",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(o,"angle",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(o,"clockwise",!1),e.Factory.backCompat(o,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"}),Bf}var Uf={},Uy;function k9(){if(Uy)return Uf;Uy=1,Object.defineProperty(Uf,"__esModule",{value:!0}),Uf.Blur=void 0;const e=qt(),n=Hr(),t=Vt();function r(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const a=[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],o=[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 s(m,f){const v=m.data,y=m.width,E=m.height;let w,S,x,_,b,g,h,d,P,M,T,I,F,k,O,N,A,R,L,V,G,W,X,q;const z=f+f+1,Y=y-1,U=E-1,ee=f+1,te=ee*(ee+1)/2,Q=new r,Z=a[f],re=o[f];let ne=null,ae=Q,ue=null,fe=null;for(x=1;x<z;x++)ae=ae.next=new r,x===ee&&(ne=ae);for(ae.next=Q,h=g=0,S=0;S<E;S++){for(N=A=R=L=d=P=M=T=0,I=ee*(V=v[g]),F=ee*(G=v[g+1]),k=ee*(W=v[g+2]),O=ee*(X=v[g+3]),d+=te*V,P+=te*G,M+=te*W,T+=te*X,ae=Q,x=0;x<ee;x++)ae.r=V,ae.g=G,ae.b=W,ae.a=X,ae=ae.next;for(x=1;x<ee;x++)_=g+((Y<x?Y:x)<<2),d+=(ae.r=V=v[_])*(q=ee-x),P+=(ae.g=G=v[_+1])*q,M+=(ae.b=W=v[_+2])*q,T+=(ae.a=X=v[_+3])*q,N+=V,A+=G,R+=W,L+=X,ae=ae.next;for(ue=Q,fe=ne,w=0;w<y;w++)v[g+3]=X=T*Z>>re,X!==0?(X=255/X,v[g]=(d*Z>>re)*X,v[g+1]=(P*Z>>re)*X,v[g+2]=(M*Z>>re)*X):v[g]=v[g+1]=v[g+2]=0,d-=I,P-=F,M-=k,T-=O,I-=ue.r,F-=ue.g,k-=ue.b,O-=ue.a,_=h+((_=w+f+1)<Y?_:Y)<<2,N+=ue.r=v[_],A+=ue.g=v[_+1],R+=ue.b=v[_+2],L+=ue.a=v[_+3],d+=N,P+=A,M+=R,T+=L,ue=ue.next,I+=V=fe.r,F+=G=fe.g,k+=W=fe.b,O+=X=fe.a,N-=V,A-=G,R-=W,L-=X,fe=fe.next,g+=4;h+=y}for(w=0;w<y;w++){for(A=R=L=N=P=M=T=d=0,g=w<<2,I=ee*(V=v[g]),F=ee*(G=v[g+1]),k=ee*(W=v[g+2]),O=ee*(X=v[g+3]),d+=te*V,P+=te*G,M+=te*W,T+=te*X,ae=Q,x=0;x<ee;x++)ae.r=V,ae.g=G,ae.b=W,ae.a=X,ae=ae.next;for(b=y,x=1;x<=f;x++)g=b+w<<2,d+=(ae.r=V=v[g])*(q=ee-x),P+=(ae.g=G=v[g+1])*q,M+=(ae.b=W=v[g+2])*q,T+=(ae.a=X=v[g+3])*q,N+=V,A+=G,R+=W,L+=X,ae=ae.next,x<U&&(b+=y);for(g=w,ue=Q,fe=ne,S=0;S<E;S++)_=g<<2,v[_+3]=X=T*Z>>re,X>0?(X=255/X,v[_]=(d*Z>>re)*X,v[_+1]=(P*Z>>re)*X,v[_+2]=(M*Z>>re)*X):v[_]=v[_+1]=v[_+2]=0,d-=I,P-=F,M-=k,T-=O,I-=ue.r,F-=ue.g,k-=ue.b,O-=ue.a,_=w+((_=S+ee)<U?_:U)*y<<2,d+=N+=ue.r=v[_],P+=A+=ue.g=v[_+1],M+=R+=ue.b=v[_+2],T+=L+=ue.a=v[_+3],ue=ue.next,I+=V=fe.r,F+=G=fe.g,k+=W=fe.b,O+=X=fe.a,N-=V,A-=G,R-=W,L-=X,fe=fe.next,g+=y}}const c=function(f){const v=Math.round(this.blurRadius());v>0&&s(f,v)};return Uf.Blur=c,e.Factory.addGetterSetter(n.Node,"blurRadius",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Uf}var qf={},qy;function A9(){if(qy)return qf;qy=1,Object.defineProperty(qf,"__esModule",{value:!0}),qf.Brighten=void 0;const e=qt(),n=Hr(),t=Vt(),r=function(a){const o=this.brightness()*255,s=a.data,c=s.length;for(let m=0;m<c;m+=4)s[m]+=o,s[m+1]+=o,s[m+2]+=o};return qf.Brighten=r,e.Factory.addGetterSetter(n.Node,"brightness",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),qf}var Hf={},Hy;function T9(){if(Hy)return Hf;Hy=1,Object.defineProperty(Hf,"__esModule",{value:!0}),Hf.Contrast=void 0;const e=qt(),n=Hr(),t=Vt(),r=function(a){const o=Math.pow((this.contrast()+100)/100,2),s=a.data,c=s.length;let m=150,f=150,v=150;for(let y=0;y<c;y+=4)m=s[y],f=s[y+1],v=s[y+2],m/=255,m-=.5,m*=o,m+=.5,m*=255,f/=255,f-=.5,f*=o,f+=.5,f*=255,v/=255,v-=.5,v*=o,v+=.5,v*=255,m=m<0?0:m>255?255:m,f=f<0?0:f>255?255:f,v=v<0?0:v>255?255:v,s[y]=m,s[y+1]=f,s[y+2]=v};return Hf.Contrast=r,e.Factory.addGetterSetter(n.Node,"contrast",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Hf}var Gf={},Gy;function R9(){if(Gy)return Gf;Gy=1,Object.defineProperty(Gf,"__esModule",{value:!0}),Gf.Emboss=void 0;const e=qt(),n=Hr(),t=Lr(),r=Vt(),a=function(o){const s=this.embossStrength()*10,c=this.embossWhiteLevel()*255,m=this.embossDirection(),f=this.embossBlend(),v=o.data,y=o.width,E=o.height,w=y*4;let S=0,x=0,_=E;switch(m){case"top-left":S=-1,x=-1;break;case"top":S=-1,x=0;break;case"top-right":S=-1,x=1;break;case"right":S=0,x=1;break;case"bottom-right":S=1,x=1;break;case"bottom":S=1,x=0;break;case"bottom-left":S=1,x=-1;break;case"left":S=0,x=-1;break;default:t.Util.error("Unknown emboss direction: "+m)}do{const b=(_-1)*w;let g=S;_+g<1&&(g=0),_+g>E&&(g=0);const h=(_-1+g)*y*4;let d=y;do{const P=b+(d-1)*4;let M=x;d+M<1&&(M=0),d+M>y&&(M=0);const T=h+(d-1+M)*4,I=v[P]-v[T],F=v[P+1]-v[T+1],k=v[P+2]-v[T+2];let O=I;const N=O>0?O:-O,A=F>0?F:-F,R=k>0?k:-k;if(A>N&&(O=F),R>N&&(O=k),O*=s,f){const L=v[P]+O,V=v[P+1]+O,G=v[P+2]+O;v[P]=L>255?255:L<0?0:L,v[P+1]=V>255?255:V<0?0:V,v[P+2]=G>255?255:G<0?0:G}else{let L=c-O;L<0?L=0:L>255&&(L=255),v[P]=v[P+1]=v[P+2]=L}}while(--d)}while(--_)};return Gf.Emboss=a,e.Factory.addGetterSetter(n.Node,"embossStrength",.5,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"embossWhiteLevel",.5,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"embossDirection","top-left",void 0,e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"embossBlend",!1,void 0,e.Factory.afterSetFilter),Gf}var Vf={},Vy;function M9(){if(Vy)return Vf;Vy=1,Object.defineProperty(Vf,"__esModule",{value:!0}),Vf.Enhance=void 0;const e=qt(),n=Hr(),t=Vt();function r(o,s,c,m,f){const v=c-s,y=f-m;if(v===0)return m+y/2;if(y===0)return m;let E=(o-s)/v;return E=y*E+m,E}const a=function(o){const s=o.data,c=s.length;let m=s[0],f=m,v,y=s[1],E=y,w,S=s[2],x=S,_;const b=this.enhance();if(b===0)return;for(let O=0;O<c;O+=4)v=s[O+0],v<m?m=v:v>f&&(f=v),w=s[O+1],w<y?y=w:w>E&&(E=w),_=s[O+2],_<S?S=_:_>x&&(x=_);f===m&&(f=255,m=0),E===y&&(E=255,y=0),x===S&&(x=255,S=0);let g,h,d,P,M,T,I,F,k;b>0?(h=f+b*(255-f),d=m-b*(m-0),M=E+b*(255-E),T=y-b*(y-0),F=x+b*(255-x),k=S-b*(S-0)):(g=(f+m)*.5,h=f+b*(f-g),d=m+b*(m-g),P=(E+y)*.5,M=E+b*(E-P),T=y+b*(y-P),I=(x+S)*.5,F=x+b*(x-I),k=S+b*(S-I));for(let O=0;O<c;O+=4)s[O+0]=r(s[O+0],m,f,d,h),s[O+1]=r(s[O+1],y,E,T,M),s[O+2]=r(s[O+2],S,x,k,F)};return Vf.Enhance=a,e.Factory.addGetterSetter(n.Node,"enhance",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Vf}var $f={},$y;function L9(){if($y)return $f;$y=1,Object.defineProperty($f,"__esModule",{value:!0}),$f.Grayscale=void 0;const e=function(n){const t=n.data,r=t.length;for(let a=0;a<r;a+=4){const o=.34*t[a]+.5*t[a+1]+.16*t[a+2];t[a]=o,t[a+1]=o,t[a+2]=o}};return $f.Grayscale=e,$f}var Wf={},Wy;function N9(){if(Wy)return Wf;Wy=1,Object.defineProperty(Wf,"__esModule",{value:!0}),Wf.HSL=void 0;const e=qt(),n=Hr(),t=Vt();e.Factory.addGetterSetter(n.Node,"hue",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"saturation",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"luminance",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter);const r=function(a){const o=a.data,s=o.length,c=1,m=Math.pow(2,this.saturation()),f=Math.abs(this.hue()+360)%360,v=this.luminance()*127,y=c*m*Math.cos(f*Math.PI/180),E=c*m*Math.sin(f*Math.PI/180),w=.299*c+.701*y+.167*E,S=.587*c-.587*y+.33*E,x=.114*c-.114*y-.497*E,_=.299*c-.299*y-.328*E,b=.587*c+.413*y+.035*E,g=.114*c-.114*y+.293*E,h=.299*c-.3*y+1.25*E,d=.587*c-.586*y-1.05*E,P=.114*c+.886*y-.2*E;let M,T,I,F;for(let k=0;k<s;k+=4)M=o[k+0],T=o[k+1],I=o[k+2],F=o[k+3],o[k+0]=w*M+S*T+x*I+v,o[k+1]=_*M+b*T+g*I+v,o[k+2]=h*M+d*T+P*I+v,o[k+3]=F};return Wf.HSL=r,Wf}var Yf={},Yy;function I9(){if(Yy)return Yf;Yy=1,Object.defineProperty(Yf,"__esModule",{value:!0}),Yf.HSV=void 0;const e=qt(),n=Hr(),t=Vt(),r=function(a){const o=a.data,s=o.length,c=Math.pow(2,this.value()),m=Math.pow(2,this.saturation()),f=Math.abs(this.hue()+360)%360,v=c*m*Math.cos(f*Math.PI/180),y=c*m*Math.sin(f*Math.PI/180),E=.299*c+.701*v+.167*y,w=.587*c-.587*v+.33*y,S=.114*c-.114*v-.497*y,x=.299*c-.299*v-.328*y,_=.587*c+.413*v+.035*y,b=.114*c-.114*v+.293*y,g=.299*c-.3*v+1.25*y,h=.587*c-.586*v-1.05*y,d=.114*c+.886*v-.2*y;let P,M,T,I;for(let F=0;F<s;F+=4)P=o[F+0],M=o[F+1],T=o[F+2],I=o[F+3],o[F+0]=E*P+w*M+S*T,o[F+1]=x*P+_*M+b*T,o[F+2]=g*P+h*M+d*T,o[F+3]=I};return Yf.HSV=r,e.Factory.addGetterSetter(n.Node,"hue",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"saturation",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"value",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Yf}var Kf={},Ky;function j9(){if(Ky)return Kf;Ky=1,Object.defineProperty(Kf,"__esModule",{value:!0}),Kf.Invert=void 0;const e=function(n){const t=n.data,r=t.length;for(let a=0;a<r;a+=4)t[a]=255-t[a],t[a+1]=255-t[a+1],t[a+2]=255-t[a+2]};return Kf.Invert=e,Kf}var Xf={},Xy;function D9(){if(Xy)return Xf;Xy=1,Object.defineProperty(Xf,"__esModule",{value:!0}),Xf.Kaleidoscope=void 0;const e=qt(),n=Hr(),t=Lr(),r=Vt(),a=function(c,m,f){const v=c.data,y=m.data,E=c.width,w=c.height,S=f.polarCenterX||E/2,x=f.polarCenterY||w/2;let _=Math.sqrt(S*S+x*x),b=E-S,g=w-x;const h=Math.sqrt(b*b+g*g);_=h>_?h:_;const d=w,P=E,M=360/P*Math.PI/180;for(let T=0;T<P;T+=1){const I=Math.sin(T*M),F=Math.cos(T*M);for(let k=0;k<d;k+=1){b=Math.floor(S+_*k/d*F),g=Math.floor(x+_*k/d*I);let O=(g*E+b)*4;const N=v[O+0],A=v[O+1],R=v[O+2],L=v[O+3];O=(T+k*E)*4,y[O+0]=N,y[O+1]=A,y[O+2]=R,y[O+3]=L}}},o=function(c,m,f){const v=c.data,y=m.data,E=c.width,w=c.height,S=f.polarCenterX||E/2,x=f.polarCenterY||w/2;let _=Math.sqrt(S*S+x*x),b=E-S,g=w-x;const h=Math.sqrt(b*b+g*g);_=h>_?h:_;const d=w,P=E,M=0;let T,I;for(b=0;b<E;b+=1)for(g=0;g<w;g+=1){const F=b-S,k=g-x,O=Math.sqrt(F*F+k*k)*d/_;let N=(Math.atan2(k,F)*180/Math.PI+360+M)%360;N=N*P/360,T=Math.floor(N),I=Math.floor(O);let A=(I*E+T)*4;const R=v[A+0],L=v[A+1],V=v[A+2],G=v[A+3];A=(g*E+b)*4,y[A+0]=R,y[A+1]=L,y[A+2]=V,y[A+3]=G}},s=function(c){const m=c.width,f=c.height;let v,y,E,w,S,x,_,b,g,h,d=Math.round(this.kaleidoscopePower());const P=Math.round(this.kaleidoscopeAngle()),M=Math.floor(m*(P%360)/360);if(d<1)return;const T=t.Util.createCanvasElement();T.width=m,T.height=f;const I=T.getContext("2d").getImageData(0,0,m,f);t.Util.releaseCanvas(T),a(c,I,{polarCenterX:m/2,polarCenterY:f/2});let F=m/Math.pow(2,d);for(;F<=8;)F=F*2,d-=1;F=Math.ceil(F);let k=F,O=0,N=k,A=1;for(M+F>m&&(O=k,N=0,A=-1),y=0;y<f;y+=1)for(v=O;v!==N;v+=A)E=Math.round(v+M)%m,g=(m*y+E)*4,S=I.data[g+0],x=I.data[g+1],_=I.data[g+2],b=I.data[g+3],h=(m*y+v)*4,I.data[h+0]=S,I.data[h+1]=x,I.data[h+2]=_,I.data[h+3]=b;for(y=0;y<f;y+=1)for(k=Math.floor(F),w=0;w<d;w+=1){for(v=0;v<k+1;v+=1)g=(m*y+v)*4,S=I.data[g+0],x=I.data[g+1],_=I.data[g+2],b=I.data[g+3],h=(m*y+k*2-v-1)*4,I.data[h+0]=S,I.data[h+1]=x,I.data[h+2]=_,I.data[h+3]=b;k*=2}o(I,c,{})};return Xf.Kaleidoscope=s,e.Factory.addGetterSetter(n.Node,"kaleidoscopePower",2,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"kaleidoscopeAngle",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),Xf}var Zf={},Zy;function F9(){if(Zy)return Zf;Zy=1,Object.defineProperty(Zf,"__esModule",{value:!0}),Zf.Mask=void 0;const e=qt(),n=Hr(),t=Vt();function r(E,w,S){let x=(S*E.width+w)*4;const _=[];return _.push(E.data[x++],E.data[x++],E.data[x++],E.data[x++]),_}function a(E,w){return Math.sqrt(Math.pow(E[0]-w[0],2)+Math.pow(E[1]-w[1],2)+Math.pow(E[2]-w[2],2))}function o(E){const w=[0,0,0];for(let S=0;S<E.length;S++)w[0]+=E[S][0],w[1]+=E[S][1],w[2]+=E[S][2];return w[0]/=E.length,w[1]/=E.length,w[2]/=E.length,w}function s(E,w){const S=r(E,0,0),x=r(E,E.width-1,0),_=r(E,0,E.height-1),b=r(E,E.width-1,E.height-1),g=w||10;if(a(S,x)<g&&a(x,b)<g&&a(b,_)<g&&a(_,S)<g){const h=o([x,S,b,_]),d=[];for(let P=0;P<E.width*E.height;P++){const M=a(h,[E.data[P*4],E.data[P*4+1],E.data[P*4+2]]);d[P]=M<g?0:255}return d}}function c(E,w){for(let S=0;S<E.width*E.height;S++)E.data[4*S+3]=w[S]}function m(E,w,S){const x=[1,1,1,1,0,1,1,1,1],_=Math.round(Math.sqrt(x.length)),b=Math.floor(_/2),g=[];for(let h=0;h<S;h++)for(let d=0;d<w;d++){const P=h*w+d;let M=0;for(let T=0;T<_;T++)for(let I=0;I<_;I++){const F=h+T-b,k=d+I-b;if(F>=0&&F<S&&k>=0&&k<w){const O=F*w+k,N=x[T*_+I];M+=E[O]*N}}g[P]=M===255*8?255:0}return g}function f(E,w,S){const x=[1,1,1,1,1,1,1,1,1],_=Math.round(Math.sqrt(x.length)),b=Math.floor(_/2),g=[];for(let h=0;h<S;h++)for(let d=0;d<w;d++){const P=h*w+d;let M=0;for(let T=0;T<_;T++)for(let I=0;I<_;I++){const F=h+T-b,k=d+I-b;if(F>=0&&F<S&&k>=0&&k<w){const O=F*w+k,N=x[T*_+I];M+=E[O]*N}}g[P]=M>=255*4?255:0}return g}function v(E,w,S){const x=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],_=Math.round(Math.sqrt(x.length)),b=Math.floor(_/2),g=[];for(let h=0;h<S;h++)for(let d=0;d<w;d++){const P=h*w+d;let M=0;for(let T=0;T<_;T++)for(let I=0;I<_;I++){const F=h+T-b,k=d+I-b;if(F>=0&&F<S&&k>=0&&k<w){const O=F*w+k,N=x[T*_+I];M+=E[O]*N}}g[P]=M}return g}const y=function(E){const w=this.threshold();let S=s(E,w);return S&&(S=m(S,E.width,E.height),S=f(S,E.width,E.height),S=v(S,E.width,E.height),c(E,S)),E};return Zf.Mask=y,e.Factory.addGetterSetter(n.Node,"threshold",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Zf}var Qf={},Qy;function z9(){if(Qy)return Qf;Qy=1,Object.defineProperty(Qf,"__esModule",{value:!0}),Qf.Noise=void 0;const e=qt(),n=Hr(),t=Vt(),r=function(a){const o=this.noise()*255,s=a.data,c=s.length,m=o/2;for(let f=0;f<c;f+=4)s[f+0]+=m-2*m*Math.random(),s[f+1]+=m-2*m*Math.random(),s[f+2]+=m-2*m*Math.random()};return Qf.Noise=r,e.Factory.addGetterSetter(n.Node,"noise",.2,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Qf}var Jf={},Jy;function B9(){if(Jy)return Jf;Jy=1,Object.defineProperty(Jf,"__esModule",{value:!0}),Jf.Pixelate=void 0;const e=qt(),n=Lr(),t=Hr(),r=Vt(),a=function(o){let s=Math.ceil(this.pixelSize()),c=o.width,m=o.height,f,v,y,E,w,S,x,_=Math.ceil(c/s),b=Math.ceil(m/s),g,h,d,P,M,T,I,F=o.data;if(s<=0){n.Util.error("pixelSize value can not be <= 0");return}for(M=0;M<_;M+=1)for(T=0;T<b;T+=1){for(E=0,w=0,S=0,x=0,g=M*s,h=g+s,d=T*s,P=d+s,I=0,f=g;f<h;f+=1)if(!(f>=c))for(v=d;v<P;v+=1)v>=m||(y=(c*v+f)*4,E+=F[y+0],w+=F[y+1],S+=F[y+2],x+=F[y+3],I+=1);for(E=E/I,w=w/I,S=S/I,x=x/I,f=g;f<h;f+=1)if(!(f>=c))for(v=d;v<P;v+=1)v>=m||(y=(c*v+f)*4,F[y+0]=E,F[y+1]=w,F[y+2]=S,F[y+3]=x)}};return Jf.Pixelate=a,e.Factory.addGetterSetter(t.Node,"pixelSize",8,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),Jf}var ed={},e2;function U9(){if(e2)return ed;e2=1,Object.defineProperty(ed,"__esModule",{value:!0}),ed.Posterize=void 0;const e=qt(),n=Hr(),t=Vt(),r=function(a){const o=Math.round(this.levels()*254)+1,s=a.data,c=s.length,m=255/o;for(let f=0;f<c;f+=1)s[f]=Math.floor(s[f]/m)*m};return ed.Posterize=r,e.Factory.addGetterSetter(n.Node,"levels",.5,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),ed}var td={},t2;function q9(){if(t2)return td;t2=1,Object.defineProperty(td,"__esModule",{value:!0}),td.RGB=void 0;const e=qt(),n=Hr(),t=Vt(),r=function(a){const o=a.data,s=o.length,c=this.red(),m=this.green(),f=this.blue();for(let v=0;v<s;v+=4){const y=(.34*o[v]+.5*o[v+1]+.16*o[v+2])/255;o[v]=y*c,o[v+1]=y*m,o[v+2]=y*f,o[v+3]=o[v+3]}};return td.RGB=r,e.Factory.addGetterSetter(n.Node,"red",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(n.Node,"green",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(n.Node,"blue",0,t.RGBComponent,e.Factory.afterSetFilter),td}var rd={},r2;function H9(){if(r2)return rd;r2=1,Object.defineProperty(rd,"__esModule",{value:!0}),rd.RGBA=void 0;const e=qt(),n=Hr(),t=Vt(),r=function(a){const o=a.data,s=o.length,c=this.red(),m=this.green(),f=this.blue(),v=this.alpha();for(let y=0;y<s;y+=4){const E=1-v;o[y]=c*v+o[y]*E,o[y+1]=m*v+o[y+1]*E,o[y+2]=f*v+o[y+2]*E}};return rd.RGBA=r,e.Factory.addGetterSetter(n.Node,"red",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(n.Node,"green",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(n.Node,"blue",0,t.RGBComponent,e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"alpha",1,function(a){return this._filterUpToDate=!1,a>1?1:a<0?0:a}),rd}var nd={},n2;function G9(){if(n2)return nd;n2=1,Object.defineProperty(nd,"__esModule",{value:!0}),nd.Sepia=void 0;const e=function(n){const t=n.data,r=t.length;for(let a=0;a<r;a+=4){const o=t[a+0],s=t[a+1],c=t[a+2];t[a+0]=Math.min(255,o*.393+s*.769+c*.189),t[a+1]=Math.min(255,o*.349+s*.686+c*.168),t[a+2]=Math.min(255,o*.272+s*.534+c*.131)}};return nd.Sepia=e,nd}var id={},i2;function V9(){if(i2)return id;i2=1,Object.defineProperty(id,"__esModule",{value:!0}),id.Solarize=void 0;const e=function(n){const t=n.data,r=n.width,a=n.height,o=r*4;let s=a;do{const c=(s-1)*o;let m=r;do{const f=c+(m-1)*4;let v=t[f],y=t[f+1],E=t[f+2];v>127&&(v=255-v),y>127&&(y=255-y),E>127&&(E=255-E),t[f]=v,t[f+1]=y,t[f+2]=E}while(--m)}while(--s)};return id.Solarize=e,id}var ad={},a2;function $9(){if(a2)return ad;a2=1,Object.defineProperty(ad,"__esModule",{value:!0}),ad.Threshold=void 0;const e=qt(),n=Hr(),t=Vt(),r=function(a){const o=this.threshold()*255,s=a.data,c=s.length;for(let m=0;m<c;m+=1)s[m]=s[m]<o?0:255};return ad.Threshold=r,e.Factory.addGetterSetter(n.Node,"threshold",.5,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),ad}var o2;function W9(){if(o2)return bf;o2=1,Object.defineProperty(bf,"__esModule",{value:!0}),bf.Konva=void 0;const e=nv(),n=p9(),t=v9(),r=m9(),a=y9(),o=b9(),s=w9(),c=_5(),m=Mv(),f=S5(),v=_9(),y=S9(),E=E9(),w=x9(),S=E5(),x=O9(),_=P9(),b=C9(),g=k9(),h=A9(),d=T9(),P=R9(),M=M9(),T=L9(),I=N9(),F=I9(),k=j9(),O=D9(),N=F9(),A=z9(),R=B9(),L=U9(),V=q9(),G=H9(),W=G9(),X=V9(),q=$9();return bf.Konva=e.Konva.Util._assign(e.Konva,{Arc:n.Arc,Arrow:t.Arrow,Circle:r.Circle,Ellipse:a.Ellipse,Image:o.Image,Label:s.Label,Tag:s.Tag,Line:c.Line,Path:m.Path,Rect:f.Rect,RegularPolygon:v.RegularPolygon,Ring:y.Ring,Sprite:E.Sprite,Star:w.Star,Text:S.Text,TextPath:x.TextPath,Transformer:_.Transformer,Wedge:b.Wedge,Filters:{Blur:g.Blur,Brighten:h.Brighten,Contrast:d.Contrast,Emboss:P.Emboss,Enhance:M.Enhance,Grayscale:T.Grayscale,HSL:I.HSL,HSV:F.HSV,Invert:k.Invert,Kaleidoscope:O.Kaleidoscope,Mask:N.Mask,Noise:A.Noise,Pixelate:R.Pixelate,Posterize:L.Posterize,RGB:V.RGB,RGBA:G.RGBA,Sepia:W.Sepia,Solarize:X.Solarize,Threshold:q.Threshold}}),bf}var Y9=sp.exports,l2;function Mi(){if(l2)return sp.exports;l2=1,Object.defineProperty(Y9,"__esModule",{value:!0});const e=W9();return sp.exports=e.Konva,sp.exports}Mi();var rp={exports:{}},s2;function K9(){return s2||(s2=1,function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.Konva=void 0;var t=nv();Object.defineProperty(n,"Konva",{enumerable:!0,get:function(){return t.Konva}});const r=nv();e.exports=r.Konva}(rp,rp.exports)),rp.exports}var X9=K9();const Rd=jd(X9);var Xg={exports:{}};/**
|
|
42
|
+
*/var ey;function Q8(){if(ey)return Dg;ey=1;var e=Or();function n(y,E){return y===E&&(y!==0||1/y===1/E)||y!==y&&E!==E}var t=typeof Object.is=="function"?Object.is:n,r=e.useState,a=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function c(y,E){var w=E(),S=r({inst:{value:w,getSnapshot:E}}),x=S[0].inst,_=S[1];return o(function(){x.value=w,x.getSnapshot=E,m(x)&&_({inst:x})},[y,w,E]),a(function(){return m(x)&&_({inst:x}),y(function(){m(x)&&_({inst:x})})},[y]),s(w),w}function m(y){var E=y.getSnapshot;y=y.value;try{var w=E();return!t(y,w)}catch{return!0}}function f(y,E){return E()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return Dg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Dg}var ty;function J8(){return ty||(ty=1,jg.exports=Q8()),jg.exports}var e9=J8();function ry(e){e.reaction=new Oa("observer".concat(e.name),function(){var n;e.stateVersion=Symbol(),(n=e.onStoreChange)===null||n===void 0||n.call(e)})}function kv(e,n){if(n===void 0&&(n="observed"),Cv())return e();var t=Gt.useRef(null);if(!t.current){var r={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:n,subscribe:function(c){return wp.unregister(r),r.onStoreChange=c,r.reaction||(ry(r),r.stateVersion=Symbol()),function(){var m;r.onStoreChange=null,(m=r.reaction)===null||m===void 0||m.dispose(),r.reaction=null}},getSnapshot:function(){return r.stateVersion}};t.current=r}var a=t.current;a.reaction||(ry(a),wp.register(t,a,a)),Gt.useDebugValue(a.reaction,W8),e9.useSyncExternalStore(a.subscribe,a.getSnapshot,a.getSnapshot);var o,s;if(a.reaction.track(function(){try{o=e()}catch(c){s=c}}),s)throw s;return o}var Fg,zg,gw=typeof Symbol=="function"&&Symbol.for,t9=(zg=(Fg=Object.getOwnPropertyDescriptor(function(){},"name"))===null||Fg===void 0?void 0:Fg.configurable)!==null&&zg!==void 0?zg:!1,ny=gw?Symbol.for("react.forward_ref"):typeof Sr.forwardRef=="function"&&Sr.forwardRef(function(e){return null}).$$typeof,iy=gw?Symbol.for("react.memo"):typeof Sr.memo=="function"&&Sr.memo(function(e){return null}).$$typeof;function r9(e,n){var t;if(iy&&e.$$typeof===iy)throw new Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");if(Cv())return e;var r=(t=n==null?void 0:n.forwardRef)!==null&&t!==void 0?t:!1,a=e,o=e.displayName||e.name;if(ny&&e.$$typeof===ny&&(r=!0,a=e.render,typeof a!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var s=function(c,m){return kv(function(){return a(c,m)},o)};return s.displayName=e.displayName,t9&&Object.defineProperty(s,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(s.contextTypes=e.contextTypes),r&&(s=Sr.forwardRef(s)),s=Sr.memo(s),i9(e,s),s}var n9={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function i9(e,n){Object.keys(e).forEach(function(t){n9[t]||Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))})}function vw(e){var n=e.children,t=e.render;n&&t&&console.error("MobX Observer: Do not use children and render in the same time in `Observer`");var r=n||t;return typeof r!="function"?null:kv(r)}vw.displayName="Observer";function a9(e,n){return Sr.useState(function(){return ur(e(),n,{autoBind:!0})})[0]}function mw(e){var n=Sr.useState(function(){return ur(e,{},{deep:!1})})[0];return uc(function(){Object.assign(n,e)}),n}function o9(e,n){var t=n&&mw(n);return Sr.useState(function(){return ur(e(t),void 0,{autoBind:!0})})[0]}var Bg;dw(G8.unstable_batchedUpdates);var l9=(Bg=wp.finalizeAllImmediately)!==null&&Bg!==void 0?Bg:function(){};function s9(e,n){return n===void 0&&(n="observed"),kv(e,n)}function u9(e){pw(e)}const c9=Object.freeze(Object.defineProperty({__proto__:null,Observer:vw,_observerFinalizationRegistry:wp,clearTimers:l9,enableStaticRendering:pw,isObserverBatched:$8,isUsingStaticRendering:Cv,observer:r9,observerBatching:dw,useAsObservableSource:mw,useLocalObservable:a9,useLocalStore:o9,useObserver:s9,useStaticRendering:u9},Symbol.toStringTag,{value:"Module"})),Ri=Yl(c9);var Ns={};const Xi=Yl(H8);var sp={exports:{}},bf={},Ug={},qg={},ay;function Dt(){return ay||(ay=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._registerNode=e.Konva=e.glob=void 0;const n=Math.PI/180;function t(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}e.glob=typeof oc<"u"?oc:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},e.Konva={_global:e.glob,version:"9.3.19",isBrowser:t(),isUnminified:/param/.test((function(a){}).toString()),dblClickWindow:400,getAngle(a){return e.Konva.angleDeg?a*n:a},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_fixTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return e.Konva.DD.isDragging},isTransforming(){var a;return(a=e.Konva.Transformer)===null||a===void 0?void 0:a.isTransforming()},isDragReady(){return!!e.Konva.DD.node},releaseCanvasOnDestroy:!0,document:e.glob.document,_injectGlobal(a){e.glob.Konva=a}};const r=a=>{e.Konva[a.prototype.getClassName()]=a};e._registerNode=r,e.Konva._injectGlobal(e.Konva)}(qg)),qg}var Hg={},oy;function Lr(){return oy||(oy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const n=Dt();class t{constructor(d=[1,0,0,1,0,0]){this.dirty=!1,this.m=d&&d.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new t(this.m)}copyInto(d){d.m[0]=this.m[0],d.m[1]=this.m[1],d.m[2]=this.m[2],d.m[3]=this.m[3],d.m[4]=this.m[4],d.m[5]=this.m[5]}point(d){const P=this.m;return{x:P[0]*d.x+P[2]*d.y+P[4],y:P[1]*d.x+P[3]*d.y+P[5]}}translate(d,P){return this.m[4]+=this.m[0]*d+this.m[2]*P,this.m[5]+=this.m[1]*d+this.m[3]*P,this}scale(d,P){return this.m[0]*=d,this.m[1]*=d,this.m[2]*=P,this.m[3]*=P,this}rotate(d){const P=Math.cos(d),M=Math.sin(d),T=this.m[0]*P+this.m[2]*M,I=this.m[1]*P+this.m[3]*M,F=this.m[0]*-M+this.m[2]*P,k=this.m[1]*-M+this.m[3]*P;return this.m[0]=T,this.m[1]=I,this.m[2]=F,this.m[3]=k,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(d,P){const M=this.m[0]+this.m[2]*P,T=this.m[1]+this.m[3]*P,I=this.m[2]+this.m[0]*d,F=this.m[3]+this.m[1]*d;return this.m[0]=M,this.m[1]=T,this.m[2]=I,this.m[3]=F,this}multiply(d){const P=this.m[0]*d.m[0]+this.m[2]*d.m[1],M=this.m[1]*d.m[0]+this.m[3]*d.m[1],T=this.m[0]*d.m[2]+this.m[2]*d.m[3],I=this.m[1]*d.m[2]+this.m[3]*d.m[3],F=this.m[0]*d.m[4]+this.m[2]*d.m[5]+this.m[4],k=this.m[1]*d.m[4]+this.m[3]*d.m[5]+this.m[5];return this.m[0]=P,this.m[1]=M,this.m[2]=T,this.m[3]=I,this.m[4]=F,this.m[5]=k,this}invert(){const d=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),P=this.m[3]*d,M=-this.m[1]*d,T=-this.m[2]*d,I=this.m[0]*d,F=d*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),k=d*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=P,this.m[1]=M,this.m[2]=T,this.m[3]=I,this.m[4]=F,this.m[5]=k,this}getMatrix(){return this.m}decompose(){const d=this.m[0],P=this.m[1],M=this.m[2],T=this.m[3],I=this.m[4],F=this.m[5],k=d*T-P*M,O={x:I,y:F,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(d!=0||P!=0){const N=Math.sqrt(d*d+P*P);O.rotation=P>0?Math.acos(d/N):-Math.acos(d/N),O.scaleX=N,O.scaleY=k/N,O.skewX=(d*M+P*T)/k,O.skewY=0}else if(M!=0||T!=0){const N=Math.sqrt(M*M+T*T);O.rotation=Math.PI/2-(T>0?Math.acos(-M/N):-Math.acos(M/N)),O.scaleX=k/N,O.scaleY=N,O.skewX=0,O.skewY=(d*M+P*T)/k}return O.rotation=e.Util._getRotation(O.rotation),O}}e.Transform=t;const r="[object Array]",a="[object Number]",o="[object String]",s="[object Boolean]",c=Math.PI/180,m=180/Math.PI,f="#",v="",y="0",E="Konva warning: ",w="Konva error: ",S="rgb(",x={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},_=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let b=[];const g=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(h){setTimeout(h,60)};e.Util={_isElement(h){return!!(h&&h.nodeType==1)},_isFunction(h){return!!(h&&h.constructor&&h.call&&h.apply)},_isPlainObject(h){return!!h&&h.constructor===Object},_isArray(h){return Object.prototype.toString.call(h)===r},_isNumber(h){return Object.prototype.toString.call(h)===a&&!isNaN(h)&&isFinite(h)},_isString(h){return Object.prototype.toString.call(h)===o},_isBoolean(h){return Object.prototype.toString.call(h)===s},isObject(h){return h instanceof Object},isValidSelector(h){if(typeof h!="string")return!1;const d=h[0];return d==="#"||d==="."||d===d.toUpperCase()},_sign(h){return h===0||h>0?1:-1},requestAnimFrame(h){b.push(h),b.length===1&&g(function(){const d=b;b=[],d.forEach(function(P){P()})})},createCanvasElement(){const h=document.createElement("canvas");try{h.style=h.style||{}}catch{}return h},createImageElement(){return document.createElement("img")},_isInDocument(h){for(;h=h.parentNode;)if(h==document)return!0;return!1},_urlToImage(h,d){const P=e.Util.createImageElement();P.onload=function(){d(P)},P.src=h},_rgbToHex(h,d,P){return((1<<24)+(h<<16)+(d<<8)+P).toString(16).slice(1)},_hexToRgb(h){h=h.replace(f,v);const d=parseInt(h,16);return{r:d>>16&255,g:d>>8&255,b:d&255}},getRandomColor(){let h=(Math.random()*16777215<<0).toString(16);for(;h.length<6;)h=y+h;return f+h},getRGB(h){let d;return h in x?(d=x[h],{r:d[0],g:d[1],b:d[2]}):h[0]===f?this._hexToRgb(h.substring(1)):h.substr(0,4)===S?(d=_.exec(h.replace(/ /g,"")),{r:parseInt(d[1],10),g:parseInt(d[2],10),b:parseInt(d[3],10)}):{r:0,g:0,b:0}},colorToRGBA(h){return h=h||"black",e.Util._namedColorToRBA(h)||e.Util._hex3ColorToRGBA(h)||e.Util._hex4ColorToRGBA(h)||e.Util._hex6ColorToRGBA(h)||e.Util._hex8ColorToRGBA(h)||e.Util._rgbColorToRGBA(h)||e.Util._rgbaColorToRGBA(h)||e.Util._hslColorToRGBA(h)},_namedColorToRBA(h){const d=x[h.toLowerCase()];return d?{r:d[0],g:d[1],b:d[2],a:1}:null},_rgbColorToRGBA(h){if(h.indexOf("rgb(")===0){h=h.match(/rgb\(([^)]+)\)/)[1];const d=h.split(/ *, */).map(Number);return{r:d[0],g:d[1],b:d[2],a:1}}},_rgbaColorToRGBA(h){if(h.indexOf("rgba(")===0){h=h.match(/rgba\(([^)]+)\)/)[1];const d=h.split(/ *, */).map((P,M)=>P.slice(-1)==="%"?M===3?parseInt(P)/100:parseInt(P)/100*255:Number(P));return{r:d[0],g:d[1],b:d[2],a:d[3]}}},_hex8ColorToRGBA(h){if(h[0]==="#"&&h.length===9)return{r:parseInt(h.slice(1,3),16),g:parseInt(h.slice(3,5),16),b:parseInt(h.slice(5,7),16),a:parseInt(h.slice(7,9),16)/255}},_hex6ColorToRGBA(h){if(h[0]==="#"&&h.length===7)return{r:parseInt(h.slice(1,3),16),g:parseInt(h.slice(3,5),16),b:parseInt(h.slice(5,7),16),a:1}},_hex4ColorToRGBA(h){if(h[0]==="#"&&h.length===5)return{r:parseInt(h[1]+h[1],16),g:parseInt(h[2]+h[2],16),b:parseInt(h[3]+h[3],16),a:parseInt(h[4]+h[4],16)/255}},_hex3ColorToRGBA(h){if(h[0]==="#"&&h.length===4)return{r:parseInt(h[1]+h[1],16),g:parseInt(h[2]+h[2],16),b:parseInt(h[3]+h[3],16),a:1}},_hslColorToRGBA(h){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(h)){const[d,...P]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(h),M=Number(P[0])/360,T=Number(P[1])/100,I=Number(P[2])/100;let F,k,O;if(T===0)return O=I*255,{r:Math.round(O),g:Math.round(O),b:Math.round(O),a:1};I<.5?F=I*(1+T):F=I+T-I*T;const N=2*I-F,A=[0,0,0];for(let R=0;R<3;R++)k=M+1/3*-(R-1),k<0&&k++,k>1&&k--,6*k<1?O=N+(F-N)*6*k:2*k<1?O=F:3*k<2?O=N+(F-N)*(2/3-k)*6:O=N,A[R]=O*255;return{r:Math.round(A[0]),g:Math.round(A[1]),b:Math.round(A[2]),a:1}}},haveIntersection(h,d){return!(d.x>h.x+h.width||d.x+d.width<h.x||d.y>h.y+h.height||d.y+d.height<h.y)},cloneObject(h){const d={};for(const P in h)this._isPlainObject(h[P])?d[P]=this.cloneObject(h[P]):this._isArray(h[P])?d[P]=this.cloneArray(h[P]):d[P]=h[P];return d},cloneArray(h){return h.slice(0)},degToRad(h){return h*c},radToDeg(h){return h*m},_degToRad(h){return e.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),e.Util.degToRad(h)},_radToDeg(h){return e.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),e.Util.radToDeg(h)},_getRotation(h){return n.Konva.angleDeg?e.Util.radToDeg(h):h},_capitalize(h){return h.charAt(0).toUpperCase()+h.slice(1)},throw(h){throw new Error(w+h)},error(h){console.error(w+h)},warn(h){n.Konva.showWarnings&&console.warn(E+h)},each(h,d){for(const P in h)d(P,h[P])},_inRange(h,d,P){return d<=h&&h<P},_getProjectionToSegment(h,d,P,M,T,I){let F,k,O;const N=(h-P)*(h-P)+(d-M)*(d-M);if(N==0)F=h,k=d,O=(T-P)*(T-P)+(I-M)*(I-M);else{const A=((T-h)*(P-h)+(I-d)*(M-d))/N;A<0?(F=h,k=d,O=(h-T)*(h-T)+(d-I)*(d-I)):A>1?(F=P,k=M,O=(P-T)*(P-T)+(M-I)*(M-I)):(F=h+A*(P-h),k=d+A*(M-d),O=(F-T)*(F-T)+(k-I)*(k-I))}return[F,k,O]},_getProjectionToLine(h,d,P){const M=e.Util.cloneObject(h);let T=Number.MAX_VALUE;return d.forEach(function(I,F){if(!P&&F===d.length-1)return;const k=d[(F+1)%d.length],O=e.Util._getProjectionToSegment(I.x,I.y,k.x,k.y,h.x,h.y),N=O[0],A=O[1],R=O[2];R<T&&(M.x=N,M.y=A,T=R)}),M},_prepareArrayForTween(h,d,P){const M=[],T=[];if(h.length>d.length){const F=d;d=h,h=F}for(let F=0;F<h.length;F+=2)M.push({x:h[F],y:h[F+1]});for(let F=0;F<d.length;F+=2)T.push({x:d[F],y:d[F+1]});const I=[];return T.forEach(function(F){const k=e.Util._getProjectionToLine(F,M,P);I.push(k.x),I.push(k.y)}),I},_prepareToStringify(h){let d;h.visitedByCircularReferenceRemoval=!0;for(const P in h)if(h.hasOwnProperty(P)&&h[P]&&typeof h[P]=="object"){if(d=Object.getOwnPropertyDescriptor(h,P),h[P].visitedByCircularReferenceRemoval||e.Util._isElement(h[P]))if(d.configurable)delete h[P];else return null;else if(e.Util._prepareToStringify(h[P])===null)if(d.configurable)delete h[P];else return null}return delete h.visitedByCircularReferenceRemoval,h},_assign(h,d){for(const P in d)h[P]=d[P];return h},_getFirstPointerId(h){return h.touches?h.changedTouches[0].identifier:h.pointerId||999},releaseCanvas(...h){n.Konva.releaseCanvasOnDestroy&&h.forEach(d=>{d.width=0,d.height=0})},drawRoundedRectPath(h,d,P,M){let T=0,I=0,F=0,k=0;typeof M=="number"?T=I=F=k=Math.min(M,d/2,P/2):(T=Math.min(M[0]||0,d/2,P/2),I=Math.min(M[1]||0,d/2,P/2),k=Math.min(M[2]||0,d/2,P/2),F=Math.min(M[3]||0,d/2,P/2)),h.moveTo(T,0),h.lineTo(d-I,0),h.arc(d-I,I,I,Math.PI*3/2,0,!1),h.lineTo(d,P-k),h.arc(d-k,P-k,k,0,Math.PI/2,!1),h.lineTo(F,P),h.arc(F,P-F,F,Math.PI/2,Math.PI,!1),h.lineTo(0,T),h.arc(T,T,T,Math.PI,Math.PI*3/2,!1)}}}(Hg)),Hg}var wf={},Gg={},fi={},ly;function Vt(){if(ly)return fi;ly=1,Object.defineProperty(fi,"__esModule",{value:!0}),fi.RGBComponent=r,fi.alphaComponent=a,fi.getNumberValidator=o,fi.getNumberOrArrayOfNumbersValidator=s,fi.getNumberOrAutoValidator=c,fi.getStringValidator=m,fi.getStringOrGradientValidator=f,fi.getFunctionValidator=v,fi.getNumberArrayValidator=y,fi.getBooleanValidator=E,fi.getComponentValidator=w;const e=Dt(),n=Lr();function t(S){return n.Util._isString(S)?'"'+S+'"':Object.prototype.toString.call(S)==="[object Number]"||n.Util._isBoolean(S)?S:Object.prototype.toString.call(S)}function r(S){return S>255?255:S<0?0:Math.round(S)}function a(S){return S>1?1:S<1e-4?1e-4:S}function o(){if(e.Konva.isUnminified)return function(S,x){return n.Util._isNumber(S)||n.Util.warn(t(S)+' is a not valid value for "'+x+'" attribute. The value should be a number.'),S}}function s(S){if(e.Konva.isUnminified)return function(x,_){let b=n.Util._isNumber(x),g=n.Util._isArray(x)&&x.length==S;return!b&&!g&&n.Util.warn(t(x)+' is a not valid value for "'+_+'" attribute. The value should be a number or Array<number>('+S+")"),x}}function c(){if(e.Konva.isUnminified)return function(S,x){var _=n.Util._isNumber(S),b=S==="auto";return _||b||n.Util.warn(t(S)+' is a not valid value for "'+x+'" attribute. The value should be a number or "auto".'),S}}function m(){if(e.Konva.isUnminified)return function(S,x){return n.Util._isString(S)||n.Util.warn(t(S)+' is a not valid value for "'+x+'" attribute. The value should be a string.'),S}}function f(){if(e.Konva.isUnminified)return function(S,x){const _=n.Util._isString(S),b=Object.prototype.toString.call(S)==="[object CanvasGradient]"||S&&S.addColorStop;return _||b||n.Util.warn(t(S)+' is a not valid value for "'+x+'" attribute. The value should be a string or a native gradient.'),S}}function v(){if(e.Konva.isUnminified)return function(S,x){return n.Util._isFunction(S)||n.Util.warn(t(S)+' is a not valid value for "'+x+'" attribute. The value should be a function.'),S}}function y(){if(e.Konva.isUnminified)return function(S,x){const _=Int8Array?Object.getPrototypeOf(Int8Array):null;return _&&S instanceof _||(n.Util._isArray(S)?S.forEach(function(b){n.Util._isNumber(b)||n.Util.warn('"'+x+'" attribute has non numeric element '+b+". Make sure that all elements are numbers.")}):n.Util.warn(t(S)+' is a not valid value for "'+x+'" attribute. The value should be a array of numbers.')),S}}function E(){if(e.Konva.isUnminified)return function(S,x){var _=S===!0||S===!1;return _||n.Util.warn(t(S)+' is a not valid value for "'+x+'" attribute. The value should be a boolean.'),S}}function w(S){if(e.Konva.isUnminified)return function(x,_){return x==null||n.Util.isObject(x)||n.Util.warn(t(x)+' is a not valid value for "'+_+'" attribute. The value should be an object with properties '+S),x}}return fi}var sy;function qt(){return sy||(sy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const n=Lr(),t=Vt(),r="get",a="set";e.Factory={addGetterSetter(o,s,c,m,f){e.Factory.addGetter(o,s,c),e.Factory.addSetter(o,s,m,f),e.Factory.addOverloadedGetterSetter(o,s)},addGetter(o,s,c){var m=r+n.Util._capitalize(s);o.prototype[m]=o.prototype[m]||function(){const f=this.attrs[s];return f===void 0?c:f}},addSetter(o,s,c,m){var f=a+n.Util._capitalize(s);o.prototype[f]||e.Factory.overWriteSetter(o,s,c,m)},overWriteSetter(o,s,c,m){var f=a+n.Util._capitalize(s);o.prototype[f]=function(v){return c&&v!==void 0&&v!==null&&(v=c.call(this,v,s)),this._setAttr(s,v),m&&m.call(this),this}},addComponentsGetterSetter(o,s,c,m,f){const v=c.length,y=n.Util._capitalize,E=r+y(s),w=a+y(s);o.prototype[E]=function(){const x={};for(let _=0;_<v;_++){const b=c[_];x[b]=this.getAttr(s+y(b))}return x};const S=(0,t.getComponentValidator)(c);o.prototype[w]=function(x){const _=this.attrs[s];m&&(x=m.call(this,x,s)),S&&S.call(this,x,s);for(const b in x)x.hasOwnProperty(b)&&this._setAttr(s+y(b),x[b]);return x||c.forEach(b=>{this._setAttr(s+y(b),void 0)}),this._fireChangeEvent(s,_,x),f&&f.call(this),this},e.Factory.addOverloadedGetterSetter(o,s)},addOverloadedGetterSetter(o,s){var c=n.Util._capitalize(s),m=a+c,f=r+c;o.prototype[s]=function(){return arguments.length?(this[m](arguments[0]),this):this[f]()}},addDeprecatedGetterSetter(o,s,c,m){n.Util.error("Adding deprecated "+s);const f=r+n.Util._capitalize(s),v=s+" property is deprecated and will be removed soon. Look at Konva change log for more information.";o.prototype[f]=function(){n.Util.error(v);const y=this.attrs[s];return y===void 0?c:y},e.Factory.addSetter(o,s,m,function(){n.Util.error(v)}),e.Factory.addOverloadedGetterSetter(o,s)},backCompat(o,s){n.Util.each(s,function(c,m){const f=o.prototype[m],v=r+n.Util._capitalize(c),y=a+n.Util._capitalize(c);function E(){f.apply(this,arguments),n.Util.error('"'+c+'" method is deprecated and will be removed soon. Use ""'+m+'" instead.')}o.prototype[c]=E,o.prototype[v]=E,o.prototype[y]=E})},afterSetFilter(){this._filterUpToDate=!1}}}(Gg)),Gg}var Do={},Fo={},uy;function yw(){if(uy)return Fo;uy=1,Object.defineProperty(Fo,"__esModule",{value:!0}),Fo.HitContext=Fo.SceneContext=Fo.Context=void 0;const e=Lr(),n=Dt();function t(b){const g=[],h=b.length,d=e.Util;for(let P=0;P<h;P++){let M=b[P];d._isNumber(M)?M=Math.round(M*1e3)/1e3:d._isString(M)||(M=M+""),g.push(M)}return g}const r=",",a="(",o=")",s="([",c="])",m=";",f="()",v="=",y=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],E=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"],w=100;let S=class{constructor(g){this.canvas=g,n.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(g){g.fillEnabled()&&this._fill(g)}_fill(g){}strokeShape(g){g.hasStroke()&&this._stroke(g)}_stroke(g){}fillStrokeShape(g){g.attrs.fillAfterStrokeEnabled?(this.strokeShape(g),this.fillShape(g)):(this.fillShape(g),this.strokeShape(g))}getTrace(g,h){let d=this.traceArr,P=d.length,M="",T,I,F,k;for(T=0;T<P;T++)I=d[T],F=I.method,F?(k=I.args,M+=F,g?M+=f:e.Util._isArray(k[0])?M+=s+k.join(r)+c:(h&&(k=k.map(O=>typeof O=="number"?Math.floor(O):O)),M+=a+k.join(r)+o)):(M+=I.property,g||(M+=v+I.val)),M+=m;return M}clearTrace(){this.traceArr=[]}_trace(g){let h=this.traceArr,d;h.push(g),d=h.length,d>=w&&h.shift()}reset(){const g=this.getCanvas().getPixelRatio();this.setTransform(1*g,0,0,1*g,0,0)}getCanvas(){return this.canvas}clear(g){const h=this.getCanvas();g?this.clearRect(g.x||0,g.y||0,g.width||0,g.height||0):this.clearRect(0,0,h.getWidth()/h.pixelRatio,h.getHeight()/h.pixelRatio)}_applyLineCap(g){const h=g.attrs.lineCap;h&&this.setAttr("lineCap",h)}_applyOpacity(g){const h=g.getAbsoluteOpacity();h!==1&&this.setAttr("globalAlpha",h)}_applyLineJoin(g){const h=g.attrs.lineJoin;h&&this.setAttr("lineJoin",h)}setAttr(g,h){this._context[g]=h}arc(g,h,d,P,M,T){this._context.arc(g,h,d,P,M,T)}arcTo(g,h,d,P,M){this._context.arcTo(g,h,d,P,M)}beginPath(){this._context.beginPath()}bezierCurveTo(g,h,d,P,M,T){this._context.bezierCurveTo(g,h,d,P,M,T)}clearRect(g,h,d,P){this._context.clearRect(g,h,d,P)}clip(...g){this._context.clip.apply(this._context,g)}closePath(){this._context.closePath()}createImageData(g,h){const d=arguments;if(d.length===2)return this._context.createImageData(g,h);if(d.length===1)return this._context.createImageData(g)}createLinearGradient(g,h,d,P){return this._context.createLinearGradient(g,h,d,P)}createPattern(g,h){return this._context.createPattern(g,h)}createRadialGradient(g,h,d,P,M,T){return this._context.createRadialGradient(g,h,d,P,M,T)}drawImage(g,h,d,P,M,T,I,F,k){const O=arguments,N=this._context;O.length===3?N.drawImage(g,h,d):O.length===5?N.drawImage(g,h,d,P,M):O.length===9&&N.drawImage(g,h,d,P,M,T,I,F,k)}ellipse(g,h,d,P,M,T,I,F){this._context.ellipse(g,h,d,P,M,T,I,F)}isPointInPath(g,h,d,P){return d?this._context.isPointInPath(d,g,h,P):this._context.isPointInPath(g,h,P)}fill(...g){this._context.fill.apply(this._context,g)}fillRect(g,h,d,P){this._context.fillRect(g,h,d,P)}strokeRect(g,h,d,P){this._context.strokeRect(g,h,d,P)}fillText(g,h,d,P){P?this._context.fillText(g,h,d,P):this._context.fillText(g,h,d)}measureText(g){return this._context.measureText(g)}getImageData(g,h,d,P){return this._context.getImageData(g,h,d,P)}lineTo(g,h){this._context.lineTo(g,h)}moveTo(g,h){this._context.moveTo(g,h)}rect(g,h,d,P){this._context.rect(g,h,d,P)}roundRect(g,h,d,P,M){this._context.roundRect(g,h,d,P,M)}putImageData(g,h,d){this._context.putImageData(g,h,d)}quadraticCurveTo(g,h,d,P){this._context.quadraticCurveTo(g,h,d,P)}restore(){this._context.restore()}rotate(g){this._context.rotate(g)}save(){this._context.save()}scale(g,h){this._context.scale(g,h)}setLineDash(g){this._context.setLineDash?this._context.setLineDash(g):"mozDash"in this._context?this._context.mozDash=g:"webkitLineDash"in this._context&&(this._context.webkitLineDash=g)}getLineDash(){return this._context.getLineDash()}setTransform(g,h,d,P,M,T){this._context.setTransform(g,h,d,P,M,T)}stroke(g){g?this._context.stroke(g):this._context.stroke()}strokeText(g,h,d,P){this._context.strokeText(g,h,d,P)}transform(g,h,d,P,M,T){this._context.transform(g,h,d,P,M,T)}translate(g,h){this._context.translate(g,h)}_enableTrace(){let g=this,h=y.length,d=this.setAttr,P,M;const T=function(I){let F=g[I],k;g[I]=function(){return M=t(Array.prototype.slice.call(arguments,0)),k=F.apply(g,arguments),g._trace({method:I,args:M}),k}};for(P=0;P<h;P++)T(y[P]);g.setAttr=function(){d.apply(g,arguments);const I=arguments[0];let F=arguments[1];(I==="shadowOffsetX"||I==="shadowOffsetY"||I==="shadowBlur")&&(F=F/this.canvas.getPixelRatio()),g._trace({property:I,val:F})}}_applyGlobalCompositeOperation(g){const h=g.attrs.globalCompositeOperation;!h||h==="source-over"||this.setAttr("globalCompositeOperation",h)}};Fo.Context=S,E.forEach(function(b){Object.defineProperty(S.prototype,b,{get(){return this._context[b]},set(g){this._context[b]=g}})});class x extends S{constructor(g,{willReadFrequently:h=!1}={}){super(g),this._context=g._canvas.getContext("2d",{willReadFrequently:h})}_fillColor(g){const h=g.fill();this.setAttr("fillStyle",h),g._fillFunc(this)}_fillPattern(g){this.setAttr("fillStyle",g._getFillPattern()),g._fillFunc(this)}_fillLinearGradient(g){const h=g._getLinearGradient();h&&(this.setAttr("fillStyle",h),g._fillFunc(this))}_fillRadialGradient(g){const h=g._getRadialGradient();h&&(this.setAttr("fillStyle",h),g._fillFunc(this))}_fill(g){const h=g.fill(),d=g.getFillPriority();if(h&&d==="color"){this._fillColor(g);return}const P=g.getFillPatternImage();if(P&&d==="pattern"){this._fillPattern(g);return}const M=g.getFillLinearGradientColorStops();if(M&&d==="linear-gradient"){this._fillLinearGradient(g);return}const T=g.getFillRadialGradientColorStops();if(T&&d==="radial-gradient"){this._fillRadialGradient(g);return}h?this._fillColor(g):P?this._fillPattern(g):M?this._fillLinearGradient(g):T&&this._fillRadialGradient(g)}_strokeLinearGradient(g){const h=g.getStrokeLinearGradientStartPoint(),d=g.getStrokeLinearGradientEndPoint(),P=g.getStrokeLinearGradientColorStops(),M=this.createLinearGradient(h.x,h.y,d.x,d.y);if(P){for(let T=0;T<P.length;T+=2)M.addColorStop(P[T],P[T+1]);this.setAttr("strokeStyle",M)}}_stroke(g){const h=g.dash(),d=g.getStrokeScaleEnabled();if(g.hasStroke()){if(!d){this.save();const M=this.getCanvas().getPixelRatio();this.setTransform(M,0,0,M,0,0)}this._applyLineCap(g),h&&g.dashEnabled()&&(this.setLineDash(h),this.setAttr("lineDashOffset",g.dashOffset())),this.setAttr("lineWidth",g.strokeWidth()),g.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),g.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(g):this.setAttr("strokeStyle",g.stroke()),g._strokeFunc(this),d||this.restore()}}_applyShadow(g){var h,d,P;const M=(h=g.getShadowRGBA())!==null&&h!==void 0?h:"black",T=(d=g.getShadowBlur())!==null&&d!==void 0?d:5,I=(P=g.getShadowOffset())!==null&&P!==void 0?P:{x:0,y:0},F=g.getAbsoluteScale(),k=this.canvas.getPixelRatio(),O=F.x*k,N=F.y*k;this.setAttr("shadowColor",M),this.setAttr("shadowBlur",T*Math.min(Math.abs(O),Math.abs(N))),this.setAttr("shadowOffsetX",I.x*O),this.setAttr("shadowOffsetY",I.y*N)}}Fo.SceneContext=x;class _ extends S{constructor(g){super(g),this._context=g._canvas.getContext("2d",{willReadFrequently:!0})}_fill(g){this.save(),this.setAttr("fillStyle",g.colorKey),g._fillFuncHit(this),this.restore()}strokeShape(g){g.hasHitStroke()&&this._stroke(g)}_stroke(g){if(g.hasHitStroke()){const h=g.getStrokeScaleEnabled();if(!h){this.save();const M=this.getCanvas().getPixelRatio();this.setTransform(M,0,0,M,0,0)}this._applyLineCap(g);const d=g.hitStrokeWidth(),P=d==="auto"?g.strokeWidth():d;this.setAttr("lineWidth",P),this.setAttr("strokeStyle",g.colorKey),g._strokeFuncHit(this),h||this.restore()}}}return Fo.HitContext=_,Fo}var cy;function Fp(){if(cy)return Do;cy=1,Object.defineProperty(Do,"__esModule",{value:!0}),Do.HitCanvas=Do.SceneCanvas=Do.Canvas=void 0;const e=Lr(),n=yw(),t=Dt();let r;function a(){if(r)return r;const m=e.Util.createCanvasElement(),f=m.getContext("2d");return r=function(){const v=t.Konva._global.devicePixelRatio||1,y=f.webkitBackingStorePixelRatio||f.mozBackingStorePixelRatio||f.msBackingStorePixelRatio||f.oBackingStorePixelRatio||f.backingStorePixelRatio||1;return v/y}(),e.Util.releaseCanvas(m),r}let o=class{constructor(f){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const y=(f||{}).pixelRatio||t.Konva.pixelRatio||a();this.pixelRatio=y,this._canvas=e.Util.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(f){const v=this.pixelRatio;this.pixelRatio=f,this.setSize(this.getWidth()/v,this.getHeight()/v)}setWidth(f){this.width=this._canvas.width=f*this.pixelRatio,this._canvas.style.width=f+"px";const v=this.pixelRatio;this.getContext()._context.scale(v,v)}setHeight(f){this.height=this._canvas.height=f*this.pixelRatio,this._canvas.style.height=f+"px";const v=this.pixelRatio;this.getContext()._context.scale(v,v)}getWidth(){return this.width}getHeight(){return this.height}setSize(f,v){this.setWidth(f||0),this.setHeight(v||0)}toDataURL(f,v){try{return this._canvas.toDataURL(f,v)}catch{try{return this._canvas.toDataURL()}catch(E){return e.Util.error("Unable to get data URL. "+E.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}};Do.Canvas=o;class s extends o{constructor(f={width:0,height:0,willReadFrequently:!1}){super(f),this.context=new n.SceneContext(this,{willReadFrequently:f.willReadFrequently}),this.setSize(f.width,f.height)}}Do.SceneCanvas=s;class c extends o{constructor(f={width:0,height:0}){super(f),this.hitCanvas=!0,this.context=new n.HitContext(this),this.setSize(f.width,f.height)}}return Do.HitCanvas=c,Do}var Vg={},fy;function Av(){return fy||(fy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const n=Dt(),t=Lr();e.DD={get isDragging(){let r=!1;return e.DD._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(r=!0)}),r},justDragged:!1,get node(){let r;return e.DD._dragElements.forEach(a=>{r=a.node}),r},_dragElements:new Map,_drag(r){const a=[];e.DD._dragElements.forEach((o,s)=>{const{node:c}=o,m=c.getStage();m.setPointersPositions(r),o.pointerId===void 0&&(o.pointerId=t.Util._getFirstPointerId(r));const f=m._changedPointerPositions.find(v=>v.id===o.pointerId);if(f){if(o.dragStatus!=="dragging"){const v=c.dragDistance();if(Math.max(Math.abs(f.x-o.startPointerPos.x),Math.abs(f.y-o.startPointerPos.y))<v||(c.startDrag({evt:r}),!c.isDragging()))return}c._setDragPosition(r,o),a.push(c)}}),a.forEach(o=>{o.fire("dragmove",{type:"dragmove",target:o,evt:r},!0)})},_endDragBefore(r){const a=[];e.DD._dragElements.forEach(o=>{const{node:s}=o,c=s.getStage();if(r&&c.setPointersPositions(r),!c._changedPointerPositions.find(v=>v.id===o.pointerId))return;(o.dragStatus==="dragging"||o.dragStatus==="stopped")&&(e.DD.justDragged=!0,n.Konva._mouseListenClick=!1,n.Konva._touchListenClick=!1,n.Konva._pointerListenClick=!1,o.dragStatus="stopped");const f=o.node.getLayer()||o.node instanceof n.Konva.Stage&&o.node;f&&a.indexOf(f)===-1&&a.push(f)}),a.forEach(o=>{o.draw()})},_endDragAfter(r){e.DD._dragElements.forEach((a,o)=>{a.dragStatus==="stopped"&&a.node.fire("dragend",{type:"dragend",target:a.node,evt:r},!0),a.dragStatus!=="dragging"&&e.DD._dragElements.delete(o)})}},n.Konva.isBrowser&&(window.addEventListener("mouseup",e.DD._endDragBefore,!0),window.addEventListener("touchend",e.DD._endDragBefore,!0),window.addEventListener("touchcancel",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),window.addEventListener("touchcancel",e.DD._endDragAfter,!1))}(Vg)),Vg}var dy;function Hr(){if(dy)return wf;dy=1,Object.defineProperty(wf,"__esModule",{value:!0}),wf.Node=void 0;const e=Lr(),n=qt(),t=Fp(),r=Dt(),a=Av(),o=Vt(),s="absoluteOpacity",c="allEventListeners",m="absoluteTransform",f="absoluteScale",v="canvas",y="Change",E="children",w="konva",S="listening",x="mouseenter",_="mouseleave",b="set",g="Shape",h=" ",d="stage",P="transform",M="Stage",T="visible",I=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(h);let F=1;class k{constructor(A){this._id=F++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(A),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(A){(A===P||A===m)&&this._cache.get(A)?this._cache.get(A).dirty=!0:A?this._cache.delete(A):this._cache.clear()}_getCache(A,R){let L=this._cache.get(A);return(L===void 0||(A===P||A===m)&&L.dirty===!0)&&(L=R.call(this),this._cache.set(A,L)),L}_calculate(A,R,L){if(!this._attachedDepsListeners.get(A)){const V=R.map(G=>G+"Change.konva").join(h);this.on(V,()=>{this._clearCache(A)}),this._attachedDepsListeners.set(A,!0)}return this._getCache(A,L)}_getCanvasCache(){return this._cache.get(v)}_clearSelfAndDescendantCache(A){this._clearCache(A),A===m&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(v)){const{scene:A,filter:R,hit:L}=this._cache.get(v);e.Util.releaseCanvas(A,R,L),this._cache.delete(v)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(A){const R=A||{};let L={};(R.x===void 0||R.y===void 0||R.width===void 0||R.height===void 0)&&(L=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let V=Math.ceil(R.width||L.width),G=Math.ceil(R.height||L.height),W=R.pixelRatio,X=R.x===void 0?Math.floor(L.x):R.x,q=R.y===void 0?Math.floor(L.y):R.y,z=R.offset||0,Y=R.drawBorder||!1,U=R.hitCanvasPixelRatio||1;if(!V||!G){e.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const ee=Math.abs(Math.round(L.x)-X)>.5?1:0,te=Math.abs(Math.round(L.y)-q)>.5?1:0;V+=z*2+ee,G+=z*2+te,X-=z,q-=z;const Q=new t.SceneCanvas({pixelRatio:W,width:V,height:G}),Z=new t.SceneCanvas({pixelRatio:W,width:0,height:0,willReadFrequently:!0}),re=new t.HitCanvas({pixelRatio:U,width:V,height:G}),ne=Q.getContext(),ae=re.getContext();return re.isCache=!0,Q.isCache=!0,this._cache.delete(v),this._filterUpToDate=!1,R.imageSmoothingEnabled===!1&&(Q.getContext()._context.imageSmoothingEnabled=!1,Z.getContext()._context.imageSmoothingEnabled=!1),ne.save(),ae.save(),ne.translate(-X,-q),ae.translate(-X,-q),this._isUnderCache=!0,this._clearSelfAndDescendantCache(s),this._clearSelfAndDescendantCache(f),this.drawScene(Q,this),this.drawHit(re,this),this._isUnderCache=!1,ne.restore(),ae.restore(),Y&&(ne.save(),ne.beginPath(),ne.rect(0,0,V,G),ne.closePath(),ne.setAttr("strokeStyle","red"),ne.setAttr("lineWidth",5),ne.stroke(),ne.restore()),this._cache.set(v,{scene:Q,filter:Z,hit:re,x:X,y:q}),this._requestDraw(),this}isCached(){return this._cache.has(v)}getClientRect(A){throw new Error('abstract "getClientRect" method call')}_transformedRect(A,R){const L=[{x:A.x,y:A.y},{x:A.x+A.width,y:A.y},{x:A.x+A.width,y:A.y+A.height},{x:A.x,y:A.y+A.height}];let V=1/0,G=1/0,W=-1/0,X=-1/0;const q=this.getAbsoluteTransform(R);return L.forEach(function(z){const Y=q.point(z);V===void 0&&(V=W=Y.x,G=X=Y.y),V=Math.min(V,Y.x),G=Math.min(G,Y.y),W=Math.max(W,Y.x),X=Math.max(X,Y.y)}),{x:V,y:G,width:W-V,height:X-G}}_drawCachedSceneCanvas(A){A.save(),A._applyOpacity(this),A._applyGlobalCompositeOperation(this);const R=this._getCanvasCache();A.translate(R.x,R.y);const L=this._getCachedSceneCanvas(),V=L.pixelRatio;A.drawImage(L._canvas,0,0,L.width/V,L.height/V),A.restore()}_drawCachedHitCanvas(A){const R=this._getCanvasCache(),L=R.hit;A.save(),A.translate(R.x,R.y),A.drawImage(L._canvas,0,0,L.width/L.pixelRatio,L.height/L.pixelRatio),A.restore()}_getCachedSceneCanvas(){let A=this.filters(),R=this._getCanvasCache(),L=R.scene,V=R.filter,G=V.getContext(),W,X,q,z;if(A){if(!this._filterUpToDate){const Y=L.pixelRatio;V.setSize(L.width/L.pixelRatio,L.height/L.pixelRatio);try{for(W=A.length,G.clear(),G.drawImage(L._canvas,0,0,L.getWidth()/Y,L.getHeight()/Y),X=G.getImageData(0,0,V.getWidth(),V.getHeight()),q=0;q<W;q++){if(z=A[q],typeof z!="function"){e.Util.error("Filter should be type of function, but got "+typeof z+" instead. Please check correct filters");continue}z.call(this,X),G.putImageData(X,0,0)}}catch(U){e.Util.error("Unable to apply filter. "+U.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return V}return L}on(A,R){if(this._cache&&this._cache.delete(c),arguments.length===3)return this._delegate.apply(this,arguments);let L=A.split(h),V=L.length,G,W,X,q,z;for(G=0;G<V;G++)W=L[G],X=W.split("."),q=X[0],z=X[1]||"",this.eventListeners[q]||(this.eventListeners[q]=[]),this.eventListeners[q].push({name:z,handler:R});return this}off(A,R){let L=(A||"").split(h),V=L.length,G,W,X,q,z,Y;if(this._cache&&this._cache.delete(c),!A)for(W in this.eventListeners)this._off(W);for(G=0;G<V;G++)if(X=L[G],q=X.split("."),z=q[0],Y=q[1],z)this.eventListeners[z]&&this._off(z,Y,R);else for(W in this.eventListeners)this._off(W,Y,R);return this}dispatchEvent(A){const R={target:this,type:A.type,evt:A};return this.fire(A.type,R),this}addEventListener(A,R){return this.on(A,function(L){R.call(this,L.evt)}),this}removeEventListener(A){return this.off(A),this}_delegate(A,R,L){const V=this;this.on(A,function(G){const W=G.target.findAncestors(R,!0,V);for(let X=0;X<W.length;X++)G=e.Util.cloneObject(G),G.currentTarget=W[X],L.call(W[X],G)})}remove(){return this.isDragging()&&this.stopDrag(),a.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(m),this._clearSelfAndDescendantCache(s),this._clearSelfAndDescendantCache(f),this._clearSelfAndDescendantCache(d),this._clearSelfAndDescendantCache(T),this._clearSelfAndDescendantCache(S)}_remove(){this._clearCaches();const A=this.getParent();A&&A.children&&(A.children.splice(this.index,1),A._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(A){const R="get"+e.Util._capitalize(A);return e.Util._isFunction(this[R])?this[R]():this.attrs[A]}getAncestors(){let A=this.getParent(),R=[];for(;A;)R.push(A),A=A.getParent();return R}getAttrs(){return this.attrs||{}}setAttrs(A){return this._batchTransformChanges(()=>{let R,L;if(!A)return this;for(R in A)R!==E&&(L=b+e.Util._capitalize(R),e.Util._isFunction(this[L])?this[L](A[R]):this._setAttr(R,A[R]))}),this}isListening(){return this._getCache(S,this._isListening)}_isListening(A){if(!this.listening())return!1;const L=this.getParent();return L&&L!==A&&this!==A?L._isListening(A):!0}isVisible(){return this._getCache(T,this._isVisible)}_isVisible(A){if(!this.visible())return!1;const L=this.getParent();return L&&L!==A&&this!==A?L._isVisible(A):!0}shouldDrawHit(A,R=!1){if(A)return this._isVisible(A)&&this._isListening(A);const L=this.getLayer();let V=!1;a.DD._dragElements.forEach(W=>{W.dragStatus==="dragging"&&(W.node.nodeType==="Stage"||W.node.getLayer()===L)&&(V=!0)});const G=!R&&!r.Konva.hitOnDragEnabled&&(V||r.Konva.isTransforming());return this.isListening()&&this.isVisible()&&!G}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let A=this.getDepth(),R=this,L=0,V,G,W,X;function q(Y){for(V=[],G=Y.length,W=0;W<G;W++)X=Y[W],L++,X.nodeType!==g&&(V=V.concat(X.getChildren().slice())),X._id===R._id&&(W=G);V.length>0&&V[0].getDepth()<=A&&q(V)}const z=this.getStage();return R.nodeType!==M&&z&&q(z.getChildren()),L}getDepth(){let A=0,R=this.parent;for(;R;)A++,R=R.parent;return A}_batchTransformChanges(A){this._batchingTransformChange=!0,A(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(P),this._clearSelfAndDescendantCache(m)),this._needClearTransformCache=!1}setPosition(A){return this._batchTransformChanges(()=>{this.x(A.x),this.y(A.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const A=this.getStage();if(!A)return null;const R=A.getPointerPosition();if(!R)return null;const L=this.getAbsoluteTransform().copy();return L.invert(),L.point(R)}getAbsolutePosition(A){let R=!1,L=this.parent;for(;L;){if(L.isCached()){R=!0;break}L=L.parent}R&&!A&&(A=!0);const V=this.getAbsoluteTransform(A).getMatrix(),G=new e.Transform,W=this.offset();return G.m=V.slice(),G.translate(W.x,W.y),G.getTranslation()}setAbsolutePosition(A){const{x:R,y:L,...V}=this._clearTransform();this.attrs.x=R,this.attrs.y=L,this._clearCache(P);const G=this._getAbsoluteTransform().copy();return G.invert(),G.translate(A.x,A.y),A={x:this.attrs.x+G.getTranslation().x,y:this.attrs.y+G.getTranslation().y},this._setTransform(V),this.setPosition({x:A.x,y:A.y}),this._clearCache(P),this._clearSelfAndDescendantCache(m),this}_setTransform(A){let R;for(R in A)this.attrs[R]=A[R]}_clearTransform(){const A={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,A}move(A){let R=A.x,L=A.y,V=this.x(),G=this.y();return R!==void 0&&(V+=R),L!==void 0&&(G+=L),this.setPosition({x:V,y:G}),this}_eachAncestorReverse(A,R){let L=[],V=this.getParent(),G,W;if(!(R&&R._id===this._id)){for(L.unshift(this);V&&(!R||V._id!==R._id);)L.unshift(V),V=V.parent;for(G=L.length,W=0;W<G;W++)A(L[W])}}rotate(A){return this.rotation(this.rotation()+A),this}moveToTop(){if(!this.parent)return e.Util.warn("Node has no parent. moveToTop function is ignored."),!1;const A=this.index,R=this.parent.getChildren().length;return A<R-1?(this.parent.children.splice(A,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return e.Util.warn("Node has no parent. moveUp function is ignored."),!1;const A=this.index,R=this.parent.getChildren().length;return A<R-1?(this.parent.children.splice(A,1),this.parent.children.splice(A+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return e.Util.warn("Node has no parent. moveDown function is ignored."),!1;const A=this.index;return A>0?(this.parent.children.splice(A,1),this.parent.children.splice(A-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return e.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;const A=this.index;return A>0?(this.parent.children.splice(A,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(A){if(!this.parent)return e.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(A<0||A>=this.parent.children.length)&&e.Util.warn("Unexpected value "+A+" 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)+".");const R=this.index;return this.parent.children.splice(R,1),this.parent.children.splice(A,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(s,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let A=this.opacity();const R=this.getParent();return R&&!R._isUnderCache&&(A*=R.getAbsoluteOpacity()),A}moveTo(A){return this.getParent()!==A&&(this._remove(),A.add(this)),this}toObject(){let A=this.getAttrs(),R,L,V,G,W;const X={attrs:{},className:this.getClassName()};for(R in A)L=A[R],W=e.Util.isObject(L)&&!e.Util._isPlainObject(L)&&!e.Util._isArray(L),!W&&(V=typeof this[R]=="function"&&this[R],delete A[R],G=V?V.call(this):null,A[R]=L,G!==L&&(X.attrs[R]=L));return e.Util._prepareToStringify(X)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(A,R,L){const V=[];R&&this._isMatch(A)&&V.push(this);let G=this.parent;for(;G;){if(G===L)return V;G._isMatch(A)&&V.push(G),G=G.parent}return V}isAncestorOf(A){return!1}findAncestor(A,R,L){return this.findAncestors(A,R,L)[0]}_isMatch(A){if(!A)return!1;if(typeof A=="function")return A(this);let R=A.replace(/ /g,"").split(","),L=R.length,V,G;for(V=0;V<L;V++)if(G=R[V],e.Util.isValidSelector(G)||(e.Util.warn('Selector "'+G+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),e.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),e.Util.warn("Konva is awesome, right?")),G.charAt(0)==="#"){if(this.id()===G.slice(1))return!0}else if(G.charAt(0)==="."){if(this.hasName(G.slice(1)))return!0}else if(this.className===G||this.nodeType===G)return!0;return!1}getLayer(){const A=this.getParent();return A?A.getLayer():null}getStage(){return this._getCache(d,this._getStage)}_getStage(){const A=this.getParent();return A?A.getStage():null}fire(A,R={},L){return R.target=R.target||this,L?this._fireAndBubble(A,R):this._fire(A,R),this}getAbsoluteTransform(A){return A?this._getAbsoluteTransform(A):this._getCache(m,this._getAbsoluteTransform)}_getAbsoluteTransform(A){let R;if(A)return R=new e.Transform,this._eachAncestorReverse(function(L){const V=L.transformsEnabled();V==="all"?R.multiply(L.getTransform()):V==="position"&&R.translate(L.x()-L.offsetX(),L.y()-L.offsetY())},A),R;{R=this._cache.get(m)||new e.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(R):R.reset();const L=this.transformsEnabled();if(L==="all")R.multiply(this.getTransform());else if(L==="position"){const V=this.attrs.x||0,G=this.attrs.y||0,W=this.attrs.offsetX||0,X=this.attrs.offsetY||0;R.translate(V-W,G-X)}return R.dirty=!1,R}}getAbsoluteScale(A){let R=this;for(;R;)R._isUnderCache&&(A=R),R=R.getParent();const V=this.getAbsoluteTransform(A).decompose();return{x:V.scaleX,y:V.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(P,this._getTransform)}_getTransform(){var A,R;const L=this._cache.get(P)||new e.Transform;L.reset();const V=this.x(),G=this.y(),W=r.Konva.getAngle(this.rotation()),X=(A=this.attrs.scaleX)!==null&&A!==void 0?A:1,q=(R=this.attrs.scaleY)!==null&&R!==void 0?R:1,z=this.attrs.skewX||0,Y=this.attrs.skewY||0,U=this.attrs.offsetX||0,ee=this.attrs.offsetY||0;return(V!==0||G!==0)&&L.translate(V,G),W!==0&&L.rotate(W),(z!==0||Y!==0)&&L.skew(z,Y),(X!==1||q!==1)&&L.scale(X,q),(U!==0||ee!==0)&&L.translate(-1*U,-1*ee),L.dirty=!1,L}clone(A){let R=e.Util.cloneObject(this.attrs),L,V,G,W,X;for(L in A)R[L]=A[L];const q=new this.constructor(R);for(L in this.eventListeners)for(V=this.eventListeners[L],G=V.length,W=0;W<G;W++)X=V[W],X.name.indexOf(w)<0&&(q.eventListeners[L]||(q.eventListeners[L]=[]),q.eventListeners[L].push(X));return q}_toKonvaCanvas(A){A=A||{};const R=this.getClientRect(),L=this.getStage(),V=A.x!==void 0?A.x:Math.floor(R.x),G=A.y!==void 0?A.y:Math.floor(R.y),W=A.pixelRatio||1,X=new t.SceneCanvas({width:A.width||Math.ceil(R.width)||(L?L.width():0),height:A.height||Math.ceil(R.height)||(L?L.height():0),pixelRatio:W}),q=X.getContext(),z=new t.SceneCanvas({width:X.width/X.pixelRatio+Math.abs(V),height:X.height/X.pixelRatio+Math.abs(G),pixelRatio:X.pixelRatio});return A.imageSmoothingEnabled===!1&&(q._context.imageSmoothingEnabled=!1),q.save(),(V||G)&&q.translate(-1*V,-1*G),this.drawScene(X,void 0,z),q.restore(),X}toCanvas(A){return this._toKonvaCanvas(A)._canvas}toDataURL(A){A=A||{};const R=A.mimeType||null,L=A.quality||null,V=this._toKonvaCanvas(A).toDataURL(R,L);return A.callback&&A.callback(V),V}toImage(A){return new Promise((R,L)=>{try{const V=A==null?void 0:A.callback;V&&delete A.callback,e.Util._urlToImage(this.toDataURL(A),function(G){R(G),V==null||V(G)})}catch(V){L(V)}})}toBlob(A){return new Promise((R,L)=>{try{const V=A==null?void 0:A.callback;V&&delete A.callback,this.toCanvas(A).toBlob(G=>{R(G),V==null||V(G)},A==null?void 0:A.mimeType,A==null?void 0:A.quality)}catch(V){L(V)}})}setSize(A){return this.width(A.width),this.height(A.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():r.Konva.dragDistance}_off(A,R,L){let V=this.eventListeners[A],G,W,X;for(G=0;G<V.length;G++)if(W=V[G].name,X=V[G].handler,(W!=="konva"||R==="konva")&&(!R||W===R)&&(!L||L===X)){if(V.splice(G,1),V.length===0){delete this.eventListeners[A];break}G--}}_fireChangeEvent(A,R,L){this._fire(A+y,{oldVal:R,newVal:L})}addName(A){if(!this.hasName(A)){const R=this.name(),L=R?R+" "+A:A;this.name(L)}return this}hasName(A){if(!A)return!1;const R=this.name();return R?(R||"").split(/\s/g).indexOf(A)!==-1:!1}removeName(A){const R=(this.name()||"").split(/\s/g),L=R.indexOf(A);return L!==-1&&(R.splice(L,1),this.name(R.join(" "))),this}setAttr(A,R){const L=this[b+e.Util._capitalize(A)];return e.Util._isFunction(L)?L.call(this,R):this._setAttr(A,R),this}_requestDraw(){if(r.Konva.autoDrawEnabled){const A=this.getLayer()||this.getStage();A==null||A.batchDraw()}}_setAttr(A,R){const L=this.attrs[A];L===R&&!e.Util.isObject(R)||(R==null?delete this.attrs[A]:this.attrs[A]=R,this._shouldFireChangeEvents&&this._fireChangeEvent(A,L,R),this._requestDraw())}_setComponentAttr(A,R,L){let V;L!==void 0&&(V=this.attrs[A],V||(this.attrs[A]=this.getAttr(A)),this.attrs[A][R]=L,this._fireChangeEvent(A,V,L))}_fireAndBubble(A,R,L){if(R&&this.nodeType===g&&(R.target=this),!((A===x||A===_)&&(L&&(this===L||this.isAncestorOf&&this.isAncestorOf(L))||this.nodeType==="Stage"&&!L))){this._fire(A,R);const G=(A===x||A===_)&&L&&L.isAncestorOf&&L.isAncestorOf(this)&&!L.isAncestorOf(this.parent);(R&&!R.cancelBubble||!R)&&this.parent&&this.parent.isListening()&&!G&&(L&&L.parent?this._fireAndBubble.call(this.parent,A,R,L):this._fireAndBubble.call(this.parent,A,R))}}_getProtoListeners(A){var R,L,V;const G=(R=this._cache.get(c))!==null&&R!==void 0?R:{};let W=G==null?void 0:G[A];if(W===void 0){W=[];let X=Object.getPrototypeOf(this);for(;X;){const q=(V=(L=X.eventListeners)===null||L===void 0?void 0:L[A])!==null&&V!==void 0?V:[];W.push(...q),X=Object.getPrototypeOf(X)}G[A]=W,this._cache.set(c,G)}return W}_fire(A,R){R=R||{},R.currentTarget=this,R.type=A;const L=this._getProtoListeners(A);if(L)for(var V=0;V<L.length;V++)L[V].handler.call(this,R);const G=this.eventListeners[A];if(G)for(var V=0;V<G.length;V++)G[V].handler.call(this,R)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(A){const R=A?A.pointerId:void 0,L=this.getStage(),V=this.getAbsolutePosition();if(!L)return;const G=L._getPointerById(R)||L._changedPointerPositions[0]||V;a.DD._dragElements.set(this._id,{node:this,startPointerPos:G,offset:{x:G.x-V.x,y:G.y-V.y},dragStatus:"ready",pointerId:R})}startDrag(A,R=!0){a.DD._dragElements.has(this._id)||this._createDragElement(A);const L=a.DD._dragElements.get(this._id);L.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:A&&A.evt},R)}_setDragPosition(A,R){const L=this.getStage()._getPointerById(R.pointerId);if(!L)return;let V={x:L.x-R.offset.x,y:L.y-R.offset.y};const G=this.dragBoundFunc();if(G!==void 0){const W=G.call(this,V,A);W?V=W:e.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==V.x||this._lastPos.y!==V.y)&&(this.setAbsolutePosition(V),this._requestDraw()),this._lastPos=V}stopDrag(A){const R=a.DD._dragElements.get(this._id);R&&(R.dragStatus="stopped"),a.DD._endDragBefore(A),a.DD._endDragAfter(A)}setDraggable(A){this._setAttr("draggable",A),this._dragChange()}isDragging(){const A=a.DD._dragElements.get(this._id);return A?A.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(A){if(!(!(A.evt.button!==void 0)||r.Konva.dragButtons.indexOf(A.evt.button)>=0)||this.isDragging())return;let V=!1;a.DD._dragElements.forEach(G=>{this.isAncestorOf(G.node)&&(V=!0)}),V||this._createDragElement(A)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const R=a.DD._dragElements.get(this._id),L=R&&R.dragStatus==="dragging",V=R&&R.dragStatus==="ready";L?this.stopDrag():V&&a.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(A={x:0,y:0}){const R=this.getStage();if(!R)return!1;const L={x:-A.x,y:-A.y,width:R.width()+2*A.x,height:R.height()+2*A.y};return e.Util.haveIntersection(L,this.getClientRect())}static create(A,R){return e.Util._isString(A)&&(A=JSON.parse(A)),this._createNode(A,R)}static _createNode(A,R){let L=k.prototype.getClassName.call(A),V=A.children,G,W,X;R&&(A.attrs.container=R),r.Konva[L]||(e.Util.warn('Can not find a node with class name "'+L+'". Fallback to "Shape".'),L="Shape");const q=r.Konva[L];if(G=new q(A.attrs),V)for(W=V.length,X=0;X<W;X++)G.add(k._createNode(V[X]));return G}}wf.Node=k,k.prototype.nodeType="Node",k.prototype._attrsAffectingSize=[],k.prototype.eventListeners={},k.prototype.on.call(k.prototype,I,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(P),this._clearSelfAndDescendantCache(m)}),k.prototype.on.call(k.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(T)}),k.prototype.on.call(k.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(S)}),k.prototype.on.call(k.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(s)});const O=n.Factory.addGetterSetter;return O(k,"zIndex"),O(k,"absolutePosition"),O(k,"position"),O(k,"x",0,(0,o.getNumberValidator)()),O(k,"y",0,(0,o.getNumberValidator)()),O(k,"globalCompositeOperation","source-over",(0,o.getStringValidator)()),O(k,"opacity",1,(0,o.getNumberValidator)()),O(k,"name","",(0,o.getStringValidator)()),O(k,"id","",(0,o.getStringValidator)()),O(k,"rotation",0,(0,o.getNumberValidator)()),n.Factory.addComponentsGetterSetter(k,"scale",["x","y"]),O(k,"scaleX",1,(0,o.getNumberValidator)()),O(k,"scaleY",1,(0,o.getNumberValidator)()),n.Factory.addComponentsGetterSetter(k,"skew",["x","y"]),O(k,"skewX",0,(0,o.getNumberValidator)()),O(k,"skewY",0,(0,o.getNumberValidator)()),n.Factory.addComponentsGetterSetter(k,"offset",["x","y"]),O(k,"offsetX",0,(0,o.getNumberValidator)()),O(k,"offsetY",0,(0,o.getNumberValidator)()),O(k,"dragDistance",void 0,(0,o.getNumberValidator)()),O(k,"width",0,(0,o.getNumberValidator)()),O(k,"height",0,(0,o.getNumberValidator)()),O(k,"listening",!0,(0,o.getBooleanValidator)()),O(k,"preventDefault",!0,(0,o.getBooleanValidator)()),O(k,"filters",void 0,function(N){return this._filterUpToDate=!1,N}),O(k,"visible",!0,(0,o.getBooleanValidator)()),O(k,"transformsEnabled","all",(0,o.getStringValidator)()),O(k,"size"),O(k,"dragBoundFunc"),O(k,"draggable",!1,(0,o.getBooleanValidator)()),n.Factory.backCompat(k,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"}),wf}var _f={},hy;function zp(){if(hy)return _f;hy=1,Object.defineProperty(_f,"__esModule",{value:!0}),_f.Container=void 0;const e=qt(),n=Hr(),t=Vt();let r=class extends n.Node{constructor(){super(...arguments),this.children=[]}getChildren(o){if(!o)return this.children||[];const s=this.children||[],c=[];return s.forEach(function(m){o(m)&&c.push(m)}),c}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(o=>{o.parent=null,o.index=0,o.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(o=>{o.parent=null,o.index=0,o.destroy()}),this.children=[],this._requestDraw(),this}add(...o){if(o.length===0)return this;if(o.length>1){for(let c=0;c<o.length;c++)this.add(o[c]);return this}const s=o[0];return s.getParent()?(s.moveTo(this),this):(this._validateAdd(s),s.index=this.getChildren().length,s.parent=this,s._clearCaches(),this.getChildren().push(s),this._fire("add",{child:s}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(o){return this._generalFind(o,!1)}findOne(o){const s=this._generalFind(o,!0);return s.length>0?s[0]:void 0}_generalFind(o,s){const c=[];return this._descendants(m=>{const f=m._isMatch(o);return f&&c.push(m),!!(f&&s)}),c}_descendants(o){let s=!1;const c=this.getChildren();for(const m of c){if(s=o(m),s)return!0;if(m.hasChildren()&&(s=m._descendants(o),s))return!0}return!1}toObject(){const o=n.Node.prototype.toObject.call(this);return o.children=[],this.getChildren().forEach(s=>{o.children.push(s.toObject())}),o}isAncestorOf(o){let s=o.getParent();for(;s;){if(s._id===this._id)return!0;s=s.getParent()}return!1}clone(o){const s=n.Node.prototype.clone.call(this,o);return this.getChildren().forEach(function(c){s.add(c.clone())}),s}getAllIntersections(o){const s=[];return this.find("Shape").forEach(c=>{c.isVisible()&&c.intersects(o)&&s.push(c)}),s}_clearSelfAndDescendantCache(o){var s;super._clearSelfAndDescendantCache(o),!this.isCached()&&((s=this.children)===null||s===void 0||s.forEach(function(c){c._clearSelfAndDescendantCache(o)}))}_setChildrenIndices(){var o;(o=this.children)===null||o===void 0||o.forEach(function(s,c){s.index=c}),this._requestDraw()}drawScene(o,s,c){const m=this.getLayer(),f=o||m&&m.getCanvas(),v=f&&f.getContext(),y=this._getCanvasCache(),E=y&&y.scene,w=f&&f.isCache;if(!this.isVisible()&&!w)return this;if(E){v.save();const S=this.getAbsoluteTransform(s).getMatrix();v.transform(S[0],S[1],S[2],S[3],S[4],S[5]),this._drawCachedSceneCanvas(v),v.restore()}else this._drawChildren("drawScene",f,s,c);return this}drawHit(o,s){if(!this.shouldDrawHit(s))return this;const c=this.getLayer(),m=o||c&&c.hitCanvas,f=m&&m.getContext(),v=this._getCanvasCache();if(v&&v.hit){f.save();const E=this.getAbsoluteTransform(s).getMatrix();f.transform(E[0],E[1],E[2],E[3],E[4],E[5]),this._drawCachedHitCanvas(f),f.restore()}else this._drawChildren("drawHit",m,s);return this}_drawChildren(o,s,c,m){var f;const v=s&&s.getContext(),y=this.clipWidth(),E=this.clipHeight(),w=this.clipFunc(),S=typeof y=="number"&&typeof E=="number"||w,x=c===this;if(S){v.save();const b=this.getAbsoluteTransform(c);let g=b.getMatrix();v.transform(g[0],g[1],g[2],g[3],g[4],g[5]),v.beginPath();let h;if(w)h=w.call(this,v,this);else{const d=this.clipX(),P=this.clipY();v.rect(d||0,P||0,y,E)}v.clip.apply(v,h),g=b.copy().invert().getMatrix(),v.transform(g[0],g[1],g[2],g[3],g[4],g[5])}const _=!x&&this.globalCompositeOperation()!=="source-over"&&o==="drawScene";_&&(v.save(),v._applyGlobalCompositeOperation(this)),(f=this.children)===null||f===void 0||f.forEach(function(b){b[o](s,c,m)}),_&&v.restore(),S&&v.restore()}getClientRect(o={}){var s;const c=o.skipTransform,m=o.relativeTo;let f,v,y,E,w={x:1/0,y:1/0,width:0,height:0};const S=this;(s=this.children)===null||s===void 0||s.forEach(function(b){if(!b.visible())return;const g=b.getClientRect({relativeTo:S,skipShadow:o.skipShadow,skipStroke:o.skipStroke});g.width===0&&g.height===0||(f===void 0?(f=g.x,v=g.y,y=g.x+g.width,E=g.y+g.height):(f=Math.min(f,g.x),v=Math.min(v,g.y),y=Math.max(y,g.x+g.width),E=Math.max(E,g.y+g.height)))});const x=this.find("Shape");let _=!1;for(let b=0;b<x.length;b++)if(x[b]._isVisible(this)){_=!0;break}return _&&f!==void 0?w={x:f,y:v,width:y-f,height:E-v}:w={x:0,y:0,width:0,height:0},c?w:this._transformedRect(w,m)}};return _f.Container=r,e.Factory.addComponentsGetterSetter(r,"clip",["x","y","width","height"]),e.Factory.addGetterSetter(r,"clipX",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(r,"clipY",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(r,"clipWidth",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(r,"clipHeight",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(r,"clipFunc"),_f}var $g={},Bl={},py;function bw(){if(py)return Bl;py=1,Object.defineProperty(Bl,"__esModule",{value:!0}),Bl.getCapturedShape=r,Bl.createEvent=a,Bl.hasPointerCapture=o,Bl.setPointerCapture=s,Bl.releaseCapture=c;const e=Dt(),n=new Map,t=e.Konva._global.PointerEvent!==void 0;function r(m){return n.get(m)}function a(m){return{evt:m,pointerId:m.pointerId}}function o(m,f){return n.get(m)===f}function s(m,f){c(m),f.getStage()&&(n.set(m,f),t&&f._fire("gotpointercapture",a(new PointerEvent("gotpointercapture"))))}function c(m,f){const v=n.get(m);if(!v)return;const y=v.getStage();y&&y.content,n.delete(m),t&&v._fire("lostpointercapture",a(new PointerEvent("lostpointercapture")))}return Bl}var gy;function f9(){return gy||(gy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const n=Lr(),t=qt(),r=zp(),a=Dt(),o=Fp(),s=Av(),c=Dt(),m=bw(),f="Stage",v="string",y="px",E="mouseout",w="mouseleave",S="mouseover",x="mouseenter",_="mousemove",b="mousedown",g="mouseup",h="pointermove",d="pointerdown",P="pointerup",M="pointercancel",T="lostpointercapture",I="pointerout",F="pointerleave",k="pointerover",O="pointerenter",N="contextmenu",A="touchstart",R="touchend",L="touchmove",V="touchcancel",G="wheel",W=5,X=[[x,"_pointerenter"],[b,"_pointerdown"],[_,"_pointermove"],[g,"_pointerup"],[w,"_pointerleave"],[A,"_pointerdown"],[L,"_pointermove"],[R,"_pointerup"],[V,"_pointercancel"],[S,"_pointerover"],[G,"_wheel"],[N,"_contextmenu"],[d,"_pointerdown"],[h,"_pointermove"],[P,"_pointerup"],[M,"_pointercancel"],[T,"_lostpointercapture"]],q={mouse:{[I]:E,[F]:w,[k]:S,[O]:x,[h]:_,[d]:b,[P]:g,[M]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[I]:"touchout",[F]:"touchleave",[k]:"touchover",[O]:"touchenter",[h]:L,[d]:A,[P]:R,[M]:V,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[I]:I,[F]:F,[k]:k,[O]:O,[h]:h,[d]:d,[P]:P,[M]:M,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},z=Q=>Q.indexOf("pointer")>=0?"pointer":Q.indexOf("touch")>=0?"touch":"mouse",Y=Q=>{const Z=z(Q);if(Z==="pointer")return a.Konva.pointerEventsEnabled&&q.pointer;if(Z==="touch")return q.touch;if(Z==="mouse")return q.mouse};function U(Q={}){return(Q.clipFunc||Q.clipWidth||Q.clipHeight)&&n.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),Q}const ee="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);";e.stages=[];class te extends r.Container{constructor(Z){super(U(Z)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),e.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{U(this.attrs)}),this._checkVisibility()}_validateAdd(Z){const re=Z.getType()==="Layer",ne=Z.getType()==="FastLayer";re||ne||n.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const Z=this.visible()?"":"none";this.content.style.display=Z}setContainer(Z){if(typeof Z===v){if(Z.charAt(0)==="."){const ne=Z.slice(1);Z=document.getElementsByClassName(ne)[0]}else{var re;Z.charAt(0)!=="#"?re=Z:re=Z.slice(1),Z=document.getElementById(re)}if(!Z)throw"Can not find container in document with id "+re}return this._setAttr("container",Z),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),Z.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const Z=this.children,re=Z.length;for(let ne=0;ne<re;ne++)Z[ne].clear();return this}clone(Z){return Z||(Z={}),Z.container=typeof document<"u"&&document.createElement("div"),r.Container.prototype.clone.call(this,Z)}destroy(){super.destroy();const Z=this.content;Z&&n.Util._isInDocument(Z)&&this.container().removeChild(Z);const re=e.stages.indexOf(this);return re>-1&&e.stages.splice(re,1),n.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const Z=this._pointerPositions[0]||this._changedPointerPositions[0];return Z?{x:Z.x,y:Z.y}:(n.Util.warn(ee),null)}_getPointerById(Z){return this._pointerPositions.find(re=>re.id===Z)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(Z){Z=Z||{},Z.x=Z.x||0,Z.y=Z.y||0,Z.width=Z.width||this.width(),Z.height=Z.height||this.height();const re=new o.SceneCanvas({width:Z.width,height:Z.height,pixelRatio:Z.pixelRatio||1}),ne=re.getContext()._context,ae=this.children;return(Z.x||Z.y)&&ne.translate(-1*Z.x,-1*Z.y),ae.forEach(function(ue){if(!ue.isVisible())return;const fe=ue._toKonvaCanvas(Z);ne.drawImage(fe._canvas,Z.x,Z.y,fe.getWidth()/fe.getPixelRatio(),fe.getHeight()/fe.getPixelRatio())}),re}getIntersection(Z){if(!Z)return null;const re=this.children,ne=re.length,ae=ne-1;for(let ue=ae;ue>=0;ue--){const fe=re[ue].getIntersection(Z);if(fe)return fe}return null}_resizeDOM(){const Z=this.width(),re=this.height();this.content&&(this.content.style.width=Z+y,this.content.style.height=re+y),this.bufferCanvas.setSize(Z,re),this.bufferHitCanvas.setSize(Z,re),this.children.forEach(ne=>{ne.setSize({width:Z,height:re}),ne.draw()})}add(Z,...re){if(arguments.length>1){for(let ae=0;ae<arguments.length;ae++)this.add(arguments[ae]);return this}super.add(Z);const ne=this.children.length;return ne>W&&n.Util.warn("The stage has "+ne+" 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."),Z.setSize({width:this.width(),height:this.height()}),Z.draw(),a.Konva.isBrowser&&this.content.appendChild(Z.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(Z){return m.hasPointerCapture(Z,this)}setPointerCapture(Z){m.setPointerCapture(Z,this)}releaseCapture(Z){m.releaseCapture(Z,this)}getLayers(){return this.children}_bindContentEvents(){a.Konva.isBrowser&&X.forEach(([Z,re])=>{this.content.addEventListener(Z,ne=>{this[re](ne)},{passive:!1})})}_pointerenter(Z){this.setPointersPositions(Z);const re=Y(Z.type);re&&this._fire(re.pointerenter,{evt:Z,target:this,currentTarget:this})}_pointerover(Z){this.setPointersPositions(Z);const re=Y(Z.type);re&&this._fire(re.pointerover,{evt:Z,target:this,currentTarget:this})}_getTargetShape(Z){let re=this[Z+"targetShape"];return re&&!re.getStage()&&(re=null),re}_pointerleave(Z){const re=Y(Z.type),ne=z(Z.type);if(!re)return;this.setPointersPositions(Z);const ae=this._getTargetShape(ne),ue=!(a.Konva.isDragging()||a.Konva.isTransforming())||a.Konva.hitOnDragEnabled;ae&&ue?(ae._fireAndBubble(re.pointerout,{evt:Z}),ae._fireAndBubble(re.pointerleave,{evt:Z}),this._fire(re.pointerleave,{evt:Z,target:this,currentTarget:this}),this[ne+"targetShape"]=null):ue&&(this._fire(re.pointerleave,{evt:Z,target:this,currentTarget:this}),this._fire(re.pointerout,{evt:Z,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(Z){const re=Y(Z.type),ne=z(Z.type);if(!re)return;this.setPointersPositions(Z);let ae=!1;this._changedPointerPositions.forEach(ue=>{const fe=this.getIntersection(ue);if(s.DD.justDragged=!1,a.Konva["_"+ne+"ListenClick"]=!0,!fe||!fe.isListening()){this[ne+"ClickStartShape"]=void 0;return}a.Konva.capturePointerEventsEnabled&&fe.setPointerCapture(ue.id),this[ne+"ClickStartShape"]=fe,fe._fireAndBubble(re.pointerdown,{evt:Z,pointerId:ue.id}),ae=!0;const pe=Z.type.indexOf("touch")>=0;fe.preventDefault()&&Z.cancelable&&pe&&Z.preventDefault()}),ae||this._fire(re.pointerdown,{evt:Z,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(Z){const re=Y(Z.type),ne=z(Z.type);if(!re||(a.Konva.isDragging()&&s.DD.node.preventDefault()&&Z.cancelable&&Z.preventDefault(),this.setPointersPositions(Z),!(!(a.Konva.isDragging()||a.Konva.isTransforming())||a.Konva.hitOnDragEnabled)))return;const ue={};let fe=!1;const pe=this._getTargetShape(ne);this._changedPointerPositions.forEach(ye=>{const we=m.getCapturedShape(ye.id)||this.getIntersection(ye),je=ye.id,Te={evt:Z,pointerId:je},se=pe!==we;if(se&&pe&&(pe._fireAndBubble(re.pointerout,{...Te},we),pe._fireAndBubble(re.pointerleave,{...Te},we)),we){if(ue[we._id])return;ue[we._id]=!0}we&&we.isListening()?(fe=!0,se&&(we._fireAndBubble(re.pointerover,{...Te},pe),we._fireAndBubble(re.pointerenter,{...Te},pe),this[ne+"targetShape"]=we),we._fireAndBubble(re.pointermove,{...Te})):pe&&(this._fire(re.pointerover,{evt:Z,target:this,currentTarget:this,pointerId:je}),this[ne+"targetShape"]=null)}),fe||this._fire(re.pointermove,{evt:Z,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(Z){const re=Y(Z.type),ne=z(Z.type);if(!re)return;this.setPointersPositions(Z);const ae=this[ne+"ClickStartShape"],ue=this[ne+"ClickEndShape"],fe={};let pe=!1;this._changedPointerPositions.forEach(ye=>{const we=m.getCapturedShape(ye.id)||this.getIntersection(ye);if(we){if(we.releaseCapture(ye.id),fe[we._id])return;fe[we._id]=!0}const je=ye.id,Te={evt:Z,pointerId:je};let se=!1;a.Konva["_"+ne+"InDblClickWindow"]?(se=!0,clearTimeout(this[ne+"DblTimeout"])):s.DD.justDragged||(a.Konva["_"+ne+"InDblClickWindow"]=!0,clearTimeout(this[ne+"DblTimeout"])),this[ne+"DblTimeout"]=setTimeout(function(){a.Konva["_"+ne+"InDblClickWindow"]=!1},a.Konva.dblClickWindow),we&&we.isListening()?(pe=!0,this[ne+"ClickEndShape"]=we,we._fireAndBubble(re.pointerup,{...Te}),a.Konva["_"+ne+"ListenClick"]&&ae&&ae===we&&(we._fireAndBubble(re.pointerclick,{...Te}),se&&ue&&ue===we&&we._fireAndBubble(re.pointerdblclick,{...Te}))):(this[ne+"ClickEndShape"]=null,a.Konva["_"+ne+"ListenClick"]&&this._fire(re.pointerclick,{evt:Z,target:this,currentTarget:this,pointerId:je}),se&&this._fire(re.pointerdblclick,{evt:Z,target:this,currentTarget:this,pointerId:je}))}),pe||this._fire(re.pointerup,{evt:Z,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),a.Konva["_"+ne+"ListenClick"]=!1,Z.cancelable&&ne!=="touch"&&ne!=="pointer"&&Z.preventDefault()}_contextmenu(Z){this.setPointersPositions(Z);const re=this.getIntersection(this.getPointerPosition());re&&re.isListening()?re._fireAndBubble(N,{evt:Z}):this._fire(N,{evt:Z,target:this,currentTarget:this})}_wheel(Z){this.setPointersPositions(Z);const re=this.getIntersection(this.getPointerPosition());re&&re.isListening()?re._fireAndBubble(G,{evt:Z}):this._fire(G,{evt:Z,target:this,currentTarget:this})}_pointercancel(Z){this.setPointersPositions(Z);const re=m.getCapturedShape(Z.pointerId)||this.getIntersection(this.getPointerPosition());re&&re._fireAndBubble(P,m.createEvent(Z)),m.releaseCapture(Z.pointerId)}_lostpointercapture(Z){m.releaseCapture(Z.pointerId)}setPointersPositions(Z){const re=this._getContentPosition();let ne=null,ae=null;Z=Z||window.event,Z.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(Z.touches,ue=>{this._pointerPositions.push({id:ue.identifier,x:(ue.clientX-re.left)/re.scaleX,y:(ue.clientY-re.top)/re.scaleY})}),Array.prototype.forEach.call(Z.changedTouches||Z.touches,ue=>{this._changedPointerPositions.push({id:ue.identifier,x:(ue.clientX-re.left)/re.scaleX,y:(ue.clientY-re.top)/re.scaleY})})):(ne=(Z.clientX-re.left)/re.scaleX,ae=(Z.clientY-re.top)/re.scaleY,this.pointerPos={x:ne,y:ae},this._pointerPositions=[{x:ne,y:ae,id:n.Util._getFirstPointerId(Z)}],this._changedPointerPositions=[{x:ne,y:ae,id:n.Util._getFirstPointerId(Z)}])}_setPointerPosition(Z){n.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(Z)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const Z=this.content.getBoundingClientRect();return{top:Z.top,left:Z.left,scaleX:Z.width/this.content.clientWidth||1,scaleY:Z.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new o.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new o.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!a.Konva.isBrowser)return;const Z=this.container();if(!Z)throw"Stage has no container. A container is required.";Z.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),Z.appendChild(this.content),this._resizeDOM()}cache(){return n.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(Z){Z.batchDraw()}),this}}e.Stage=te,te.prototype.nodeType=f,(0,c._registerNode)(te),t.Factory.addGetterSetter(te,"container"),a.Konva.isBrowser&&document.addEventListener("visibilitychange",()=>{e.stages.forEach(Q=>{Q.batchDraw()})})}($g)),$g}var Sf={},Wg={},vy;function bn(){return vy||(vy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const n=Dt(),t=Lr(),r=qt(),a=Hr(),o=Vt(),s=Dt(),c=bw(),m="hasShadow",f="shadowRGBA",v="patternImage",y="linearGradient",E="radialGradient";let w;function S(){return w||(w=t.Util.createCanvasElement().getContext("2d"),w)}e.shapes={};function x(F){const k=this.attrs.fillRule;k?F.fill(k):F.fill()}function _(F){F.stroke()}function b(F){const k=this.attrs.fillRule;k?F.fill(k):F.fill()}function g(F){F.stroke()}function h(){this._clearCache(m)}function d(){this._clearCache(f)}function P(){this._clearCache(v)}function M(){this._clearCache(y)}function T(){this._clearCache(E)}class I extends a.Node{constructor(k){super(k);let O;for(;O=t.Util.getRandomColor(),!(O&&!(O in e.shapes)););this.colorKey=O,e.shapes[O]=this}getContext(){return t.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return t.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(m,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(v,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const O=S().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(O&&O.setTransform){const N=new t.Transform;N.translate(this.fillPatternX(),this.fillPatternY()),N.rotate(n.Konva.getAngle(this.fillPatternRotation())),N.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),N.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const A=N.getMatrix(),R=typeof DOMMatrix>"u"?{a:A[0],b:A[1],c:A[2],d:A[3],e:A[4],f:A[5]}:new DOMMatrix(A);O.setTransform(R)}return O}}_getLinearGradient(){return this._getCache(y,this.__getLinearGradient)}__getLinearGradient(){const k=this.fillLinearGradientColorStops();if(k){const O=S(),N=this.fillLinearGradientStartPoint(),A=this.fillLinearGradientEndPoint(),R=O.createLinearGradient(N.x,N.y,A.x,A.y);for(let L=0;L<k.length;L+=2)R.addColorStop(k[L],k[L+1]);return R}}_getRadialGradient(){return this._getCache(E,this.__getRadialGradient)}__getRadialGradient(){const k=this.fillRadialGradientColorStops();if(k){const O=S(),N=this.fillRadialGradientStartPoint(),A=this.fillRadialGradientEndPoint(),R=O.createRadialGradient(N.x,N.y,this.fillRadialGradientStartRadius(),A.x,A.y,this.fillRadialGradientEndRadius());for(let L=0;L<k.length;L+=2)R.addColorStop(k[L],k[L+1]);return R}}getShadowRGBA(){return this._getCache(f,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const k=t.Util.colorToRGBA(this.shadowColor());if(k)return"rgba("+k.r+","+k.g+","+k.b+","+k.a*(this.shadowOpacity()||1)+")"}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const k=this.hitStrokeWidth();return k==="auto"?this.hasStroke():this.strokeEnabled()&&!!k}intersects(k){const O=this.getStage();if(!O)return!1;const N=O.bufferHitCanvas;return N.getContext().clear(),this.drawHit(N,void 0,!0),N.context.getImageData(Math.round(k.x),Math.round(k.y),1,1).data[3]>0}destroy(){return a.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(k){var O;if(!((O=this.attrs.perfectDrawEnabled)!==null&&O!==void 0?O:!0))return!1;const A=k||this.hasFill(),R=this.hasStroke(),L=this.getAbsoluteOpacity()!==1;if(A&&R&&L)return!0;const V=this.hasShadow(),G=this.shadowForStrokeEnabled();return!!(A&&R&&V&&G)}setStrokeHitEnabled(k){t.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),k?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const k=this.size();return{x:this._centroid?-k.width/2:0,y:this._centroid?-k.height/2:0,width:k.width,height:k.height}}getClientRect(k={}){let O=!1,N=this.getParent();for(;N;){if(N.isCached()){O=!0;break}N=N.getParent()}const A=k.skipTransform,R=k.relativeTo||O&&this.getStage()||void 0,L=this.getSelfRect(),G=!k.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,W=L.width+G,X=L.height+G,q=!k.skipShadow&&this.hasShadow(),z=q?this.shadowOffsetX():0,Y=q?this.shadowOffsetY():0,U=W+Math.abs(z),ee=X+Math.abs(Y),te=q&&this.shadowBlur()||0,Q=U+te*2,Z=ee+te*2,re={width:Q,height:Z,x:-(G/2+te)+Math.min(z,0)+L.x,y:-(G/2+te)+Math.min(Y,0)+L.y};return A?re:this._transformedRect(re,R)}drawScene(k,O,N){const A=this.getLayer();let R=k||A.getCanvas(),L=R.getContext(),V=this._getCanvasCache(),G=this.getSceneFunc(),W=this.hasShadow(),X,q;const z=R.isCache,Y=O===this;if(!this.isVisible()&&!Y)return this;if(V){L.save();const ee=this.getAbsoluteTransform(O).getMatrix();return L.transform(ee[0],ee[1],ee[2],ee[3],ee[4],ee[5]),this._drawCachedSceneCanvas(L),L.restore(),this}if(!G)return this;if(L.save(),this._useBufferCanvas()&&!z){X=this.getStage();const ee=N||X.bufferCanvas;q=ee.getContext(),q.clear(),q.save(),q._applyLineJoin(this);var U=this.getAbsoluteTransform(O).getMatrix();q.transform(U[0],U[1],U[2],U[3],U[4],U[5]),G.call(this,q,this),q.restore();const te=ee.pixelRatio;W&&L._applyShadow(this),L._applyOpacity(this),L._applyGlobalCompositeOperation(this),L.drawImage(ee._canvas,0,0,ee.width/te,ee.height/te)}else{if(L._applyLineJoin(this),!Y){var U=this.getAbsoluteTransform(O).getMatrix();L.transform(U[0],U[1],U[2],U[3],U[4],U[5]),L._applyOpacity(this),L._applyGlobalCompositeOperation(this)}W&&L._applyShadow(this),G.call(this,L,this)}return L.restore(),this}drawHit(k,O,N=!1){if(!this.shouldDrawHit(O,N))return this;const A=this.getLayer(),R=k||A.hitCanvas,L=R&&R.getContext(),V=this.hitFunc()||this.sceneFunc(),G=this._getCanvasCache(),W=G&&G.hit;if(this.colorKey||t.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),W){L.save();const q=this.getAbsoluteTransform(O).getMatrix();return L.transform(q[0],q[1],q[2],q[3],q[4],q[5]),this._drawCachedHitCanvas(L),L.restore(),this}if(!V)return this;if(L.save(),L._applyLineJoin(this),!(this===O)){const q=this.getAbsoluteTransform(O).getMatrix();L.transform(q[0],q[1],q[2],q[3],q[4],q[5])}return V.call(this,L,this),L.restore(),this}drawHitFromCache(k=0){const O=this._getCanvasCache(),N=this._getCachedSceneCanvas(),A=O.hit,R=A.getContext(),L=A.getWidth(),V=A.getHeight();R.clear(),R.drawImage(N._canvas,0,0,L,V);try{const G=R.getImageData(0,0,L,V),W=G.data,X=W.length,q=t.Util._hexToRgb(this.colorKey);for(let z=0;z<X;z+=4)W[z+3]>k?(W[z]=q.r,W[z+1]=q.g,W[z+2]=q.b,W[z+3]=255):W[z+3]=0;R.putImageData(G,0,0)}catch(G){t.Util.error("Unable to draw hit graph from cached scene canvas. "+G.message)}return this}hasPointerCapture(k){return c.hasPointerCapture(k,this)}setPointerCapture(k){c.setPointerCapture(k,this)}releaseCapture(k){c.releaseCapture(k,this)}}e.Shape=I,I.prototype._fillFunc=x,I.prototype._strokeFunc=_,I.prototype._fillFuncHit=b,I.prototype._strokeFuncHit=g,I.prototype._centroid=!1,I.prototype.nodeType="Shape",(0,s._registerNode)(I),I.prototype.eventListeners={},I.prototype.on.call(I.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",h),I.prototype.on.call(I.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",d),I.prototype.on.call(I.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",P),I.prototype.on.call(I.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",M),I.prototype.on.call(I.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",T),r.Factory.addGetterSetter(I,"stroke",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(I,"strokeWidth",2,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillAfterStrokeEnabled",!1),r.Factory.addGetterSetter(I,"hitStrokeWidth","auto",(0,o.getNumberOrAutoValidator)()),r.Factory.addGetterSetter(I,"strokeHitEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(I,"perfectDrawEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(I,"shadowForStrokeEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(I,"lineJoin"),r.Factory.addGetterSetter(I,"lineCap"),r.Factory.addGetterSetter(I,"sceneFunc"),r.Factory.addGetterSetter(I,"hitFunc"),r.Factory.addGetterSetter(I,"dash"),r.Factory.addGetterSetter(I,"dashOffset",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"shadowColor",void 0,(0,o.getStringValidator)()),r.Factory.addGetterSetter(I,"shadowBlur",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"shadowOpacity",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(I,"shadowOffset",["x","y"]),r.Factory.addGetterSetter(I,"shadowOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"shadowOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillPatternImage"),r.Factory.addGetterSetter(I,"fill",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(I,"fillPatternX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillPatternY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillLinearGradientColorStops"),r.Factory.addGetterSetter(I,"strokeLinearGradientColorStops"),r.Factory.addGetterSetter(I,"fillRadialGradientStartRadius",0),r.Factory.addGetterSetter(I,"fillRadialGradientEndRadius",0),r.Factory.addGetterSetter(I,"fillRadialGradientColorStops"),r.Factory.addGetterSetter(I,"fillPatternRepeat","repeat"),r.Factory.addGetterSetter(I,"fillEnabled",!0),r.Factory.addGetterSetter(I,"strokeEnabled",!0),r.Factory.addGetterSetter(I,"shadowEnabled",!0),r.Factory.addGetterSetter(I,"dashEnabled",!0),r.Factory.addGetterSetter(I,"strokeScaleEnabled",!0),r.Factory.addGetterSetter(I,"fillPriority","color"),r.Factory.addComponentsGetterSetter(I,"fillPatternOffset",["x","y"]),r.Factory.addGetterSetter(I,"fillPatternOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillPatternOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(I,"fillPatternScale",["x","y"]),r.Factory.addGetterSetter(I,"fillPatternScaleX",1,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillPatternScaleY",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(I,"fillLinearGradientStartPoint",["x","y"]),r.Factory.addComponentsGetterSetter(I,"strokeLinearGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(I,"fillLinearGradientStartPointX",0),r.Factory.addGetterSetter(I,"strokeLinearGradientStartPointX",0),r.Factory.addGetterSetter(I,"fillLinearGradientStartPointY",0),r.Factory.addGetterSetter(I,"strokeLinearGradientStartPointY",0),r.Factory.addComponentsGetterSetter(I,"fillLinearGradientEndPoint",["x","y"]),r.Factory.addComponentsGetterSetter(I,"strokeLinearGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(I,"fillLinearGradientEndPointX",0),r.Factory.addGetterSetter(I,"strokeLinearGradientEndPointX",0),r.Factory.addGetterSetter(I,"fillLinearGradientEndPointY",0),r.Factory.addGetterSetter(I,"strokeLinearGradientEndPointY",0),r.Factory.addComponentsGetterSetter(I,"fillRadialGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(I,"fillRadialGradientStartPointX",0),r.Factory.addGetterSetter(I,"fillRadialGradientStartPointY",0),r.Factory.addComponentsGetterSetter(I,"fillRadialGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(I,"fillRadialGradientEndPointX",0),r.Factory.addGetterSetter(I,"fillRadialGradientEndPointY",0),r.Factory.addGetterSetter(I,"fillPatternRotation",0),r.Factory.addGetterSetter(I,"fillRule",void 0,(0,o.getStringValidator)()),r.Factory.backCompat(I,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})}(Wg)),Wg}var my;function ww(){if(my)return Sf;my=1,Object.defineProperty(Sf,"__esModule",{value:!0}),Sf.Layer=void 0;const e=Lr(),n=zp(),t=Hr(),r=qt(),a=Fp(),o=Vt(),s=bn(),c=Dt(),m="#",f="beforeDraw",v="draw",y=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],E=y.length;class w extends n.Container{constructor(x){super(x),this.canvas=new a.SceneCanvas,this.hitCanvas=new a.HitCanvas({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(x){return this.getContext().clear(x),this.getHitCanvas().getContext().clear(x),this}setZIndex(x){super.setZIndex(x);const _=this.getStage();return _&&_.content&&(_.content.removeChild(this.getNativeCanvasElement()),x<_.children.length-1?_.content.insertBefore(this.getNativeCanvasElement(),_.children[x+1].getCanvas()._canvas):_.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){t.Node.prototype.moveToTop.call(this);const x=this.getStage();return x&&x.content&&(x.content.removeChild(this.getNativeCanvasElement()),x.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!t.Node.prototype.moveUp.call(this))return!1;const _=this.getStage();return!_||!_.content?!1:(_.content.removeChild(this.getNativeCanvasElement()),this.index<_.children.length-1?_.content.insertBefore(this.getNativeCanvasElement(),_.children[this.index+1].getCanvas()._canvas):_.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(t.Node.prototype.moveDown.call(this)){const x=this.getStage();if(x){const _=x.children;x.content&&(x.content.removeChild(this.getNativeCanvasElement()),x.content.insertBefore(this.getNativeCanvasElement(),_[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(t.Node.prototype.moveToBottom.call(this)){const x=this.getStage();if(x){const _=x.children;x.content&&(x.content.removeChild(this.getNativeCanvasElement()),x.content.insertBefore(this.getNativeCanvasElement(),_[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const x=this.getNativeCanvasElement();return t.Node.prototype.remove.call(this),x&&x.parentNode&&e.Util._isInDocument(x)&&x.parentNode.removeChild(x),this}getStage(){return this.parent}setSize({width:x,height:_}){return this.canvas.setSize(x,_),this.hitCanvas.setSize(x,_),this._setSmoothEnabled(),this}_validateAdd(x){const _=x.getType();_!=="Group"&&_!=="Shape"&&e.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(x){return x=x||{},x.width=x.width||this.getWidth(),x.height=x.height||this.getHeight(),x.x=x.x!==void 0?x.x:this.x(),x.y=x.y!==void 0?x.y:this.y(),t.Node.prototype._toKonvaCanvas.call(this,x)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){e.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){e.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,e.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(x){if(!this.isListening()||!this.isVisible())return null;let _=1,b=!1;for(;;){for(let g=0;g<E;g++){const h=y[g],d=this._getIntersection({x:x.x+h.x*_,y:x.y+h.y*_}),P=d.shape;if(P)return P;if(b=!!d.antialiased,!d.antialiased)break}if(b)_+=1;else return null}}_getIntersection(x){const _=this.hitCanvas.pixelRatio,b=this.hitCanvas.context.getImageData(Math.round(x.x*_),Math.round(x.y*_),1,1).data,g=b[3];if(g===255){const h=e.Util._rgbToHex(b[0],b[1],b[2]),d=s.shapes[m+h];return d?{shape:d}:{antialiased:!0}}else if(g>0)return{antialiased:!0};return{}}drawScene(x,_){const b=this.getLayer(),g=x||b&&b.getCanvas();return this._fire(f,{node:this}),this.clearBeforeDraw()&&g.getContext().clear(),n.Container.prototype.drawScene.call(this,g,_),this._fire(v,{node:this}),this}drawHit(x,_){const b=this.getLayer(),g=x||b&&b.hitCanvas;return b&&b.clearBeforeDraw()&&b.getHitCanvas().getContext().clear(),n.Container.prototype.drawHit.call(this,g,_),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(x){e.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(x)}getHitGraphEnabled(x){return e.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const x=this.parent;!!this.hitCanvas._canvas.parentNode?x.content.removeChild(this.hitCanvas._canvas):x.content.appendChild(this.hitCanvas._canvas)}destroy(){return e.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}return Sf.Layer=w,w.prototype.nodeType="Layer",(0,c._registerNode)(w),r.Factory.addGetterSetter(w,"imageSmoothingEnabled",!0),r.Factory.addGetterSetter(w,"clearBeforeDraw",!0),r.Factory.addGetterSetter(w,"hitGraphEnabled",!0,(0,o.getBooleanValidator)()),Sf}var Ef={},yy;function d9(){if(yy)return Ef;yy=1,Object.defineProperty(Ef,"__esModule",{value:!0}),Ef.FastLayer=void 0;const e=Lr(),n=ww(),t=Dt();class r extends n.Layer{constructor(o){super(o),this.listening(!1),e.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}return Ef.FastLayer=r,r.prototype.nodeType="FastLayer",(0,t._registerNode)(r),Ef}var xf={},by;function Tv(){if(by)return xf;by=1,Object.defineProperty(xf,"__esModule",{value:!0}),xf.Group=void 0;const e=Lr(),n=zp(),t=Dt();class r extends n.Container{_validateAdd(o){const s=o.getType();s!=="Group"&&s!=="Shape"&&e.Util.throw("You may only add groups and shapes to groups.")}}return xf.Group=r,r.prototype.nodeType="Group",(0,t._registerNode)(r),xf}var Of={},wy;function Rv(){if(wy)return Of;wy=1,Object.defineProperty(Of,"__esModule",{value:!0}),Of.Animation=void 0;const e=Dt(),n=Lr(),t=function(){return e.glob.performance&&e.glob.performance.now?function(){return e.glob.performance.now()}:function(){return new Date().getTime()}}();let r=class tc{constructor(o,s){this.id=tc.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:t(),frameRate:0},this.func=o,this.setLayers(s)}setLayers(o){let s=[];return o&&(s=Array.isArray(o)?o:[o]),this.layers=s,this}getLayers(){return this.layers}addLayer(o){const s=this.layers,c=s.length;for(let m=0;m<c;m++)if(s[m]._id===o._id)return!1;return this.layers.push(o),!0}isRunning(){const s=tc.animations,c=s.length;for(let m=0;m<c;m++)if(s[m].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=t(),tc._addAnimation(this),this}stop(){return tc._removeAnimation(this),this}_updateFrameObject(o){this.frame.timeDiff=o-this.frame.lastTime,this.frame.lastTime=o,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(o){this.animations.push(o),this._handleAnimation()}static _removeAnimation(o){const s=o.id,c=this.animations,m=c.length;for(let f=0;f<m;f++)if(c[f].id===s){this.animations.splice(f,1);break}}static _runFrames(){const o={},s=this.animations;for(let c=0;c<s.length;c++){const m=s[c],f=m.layers,v=m.func;m._updateFrameObject(t());const y=f.length;let E;if(v?E=v.call(m,m.frame)!==!1:E=!0,!!E)for(let w=0;w<y;w++){const S=f[w];S._id!==void 0&&(o[S._id]=S)}}for(const c in o)o.hasOwnProperty(c)&&o[c].batchDraw()}static _animationLoop(){const o=tc;o.animations.length?(o._runFrames(),n.Util.requestAnimFrame(o._animationLoop)):o.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,n.Util.requestAnimFrame(this._animationLoop))}};return Of.Animation=r,r.animations=[],r.animIdCounter=0,r.animRunning=!1,Of}var Yg={},_y;function h9(){return _y||(_y=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const n=Lr(),t=Rv(),r=Hr(),a=Dt(),o={node:1,duration:1,easing:1,onFinish:1,yoyo:1},s=1,c=2,m=3,f=["fill","stroke","shadowColor"];let v=0;class y{constructor(S,x,_,b,g,h,d){this.prop=S,this.propFunc=x,this.begin=b,this._pos=b,this.duration=h,this._change=0,this.prevPos=0,this.yoyo=d,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=_,this._change=g-this.begin,this.pause()}fire(S){const x=this[S];x&&x()}setTime(S){S>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():S<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=S,this.update())}getTime(){return this._time}setPosition(S){this.prevPos=this._pos,this.propFunc(S),this._pos=S}getPosition(S){return S===void 0&&(S=this._time),this.func(S,this.begin,this._change,this.duration)}play(){this.state=c,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=m,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(S){this.pause(),this._time=S,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 S=this.getTimer()-this._startTime;this.state===c?this.setTime(S):this.state===m&&this.setTime(this.duration-S)}pause(){this.state=s,this.fire("onPause")}getTimer(){return new Date().getTime()}}class E{constructor(S){const x=this,_=S.node,b=_._id,g=S.easing||e.Easings.Linear,h=!!S.yoyo;let d,P;typeof S.duration>"u"?d=.3:S.duration===0?d=.001:d=S.duration,this.node=_,this._id=v++;const M=_.getLayer()||(_ instanceof a.Konva.Stage?_.getLayers():null);M||n.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new t.Animation(function(){x.tween.onEnterFrame()},M),this.tween=new y(P,function(T){x._tweenFunc(T)},g,0,1,d*1e3,h),this._addListeners(),E.attrs[b]||(E.attrs[b]={}),E.attrs[b][this._id]||(E.attrs[b][this._id]={}),E.tweens[b]||(E.tweens[b]={});for(P in S)o[P]===void 0&&this._addAttr(P,S[P]);this.reset(),this.onFinish=S.onFinish,this.onReset=S.onReset,this.onUpdate=S.onUpdate}_addAttr(S,x){const _=this.node,b=_._id;let g,h,d,P,M;const T=E.tweens[b][S];T&&delete E.attrs[b][T][S];let I=_.getAttr(S);if(n.Util._isArray(x))if(g=[],h=Math.max(x.length,I.length),S==="points"&&x.length!==I.length&&(x.length>I.length?(P=I,I=n.Util._prepareArrayForTween(I,x,_.closed())):(d=x,x=n.Util._prepareArrayForTween(x,I,_.closed()))),S.indexOf("fill")===0)for(let F=0;F<h;F++)if(F%2===0)g.push(x[F]-I[F]);else{const k=n.Util.colorToRGBA(I[F]);M=n.Util.colorToRGBA(x[F]),I[F]=k,g.push({r:M.r-k.r,g:M.g-k.g,b:M.b-k.b,a:M.a-k.a})}else for(let F=0;F<h;F++)g.push(x[F]-I[F]);else f.indexOf(S)!==-1?(I=n.Util.colorToRGBA(I),M=n.Util.colorToRGBA(x),g={r:M.r-I.r,g:M.g-I.g,b:M.b-I.b,a:M.a-I.a}):g=x-I;E.attrs[b][this._id][S]={start:I,diff:g,end:x,trueEnd:d,trueStart:P},E.tweens[b][S]=this._id}_tweenFunc(S){const x=this.node,_=E.attrs[x._id][this._id];let b,g,h,d,P,M,T,I;for(b in _){if(g=_[b],h=g.start,d=g.diff,I=g.end,n.Util._isArray(h))if(P=[],T=Math.max(h.length,I.length),b.indexOf("fill")===0)for(M=0;M<T;M++)M%2===0?P.push((h[M]||0)+d[M]*S):P.push("rgba("+Math.round(h[M].r+d[M].r*S)+","+Math.round(h[M].g+d[M].g*S)+","+Math.round(h[M].b+d[M].b*S)+","+(h[M].a+d[M].a*S)+")");else for(M=0;M<T;M++)P.push((h[M]||0)+d[M]*S);else f.indexOf(b)!==-1?P="rgba("+Math.round(h.r+d.r*S)+","+Math.round(h.g+d.g*S)+","+Math.round(h.b+d.b*S)+","+(h.a+d.a*S)+")":P=h+d*S;x.setAttr(b,P)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const S=this.node,x=E.attrs[S._id][this._id];x.points&&x.points.trueEnd&&S.setAttr("points",x.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const S=this.node,x=E.attrs[S._id][this._id];x.points&&x.points.trueStart&&S.points(x.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(S){return this.tween.seek(S*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const S=this.node._id,x=this._id,_=E.tweens[S];this.pause();for(const b in _)delete E.tweens[S][b];delete E.attrs[S][x]}}e.Tween=E,E.attrs={},E.tweens={},r.Node.prototype.to=function(w){const S=w.onFinish;w.node=this,w.onFinish=function(){this.destroy(),S&&S()},new E(w).play()},e.Easings={BackEaseIn(w,S,x,_){return x*(w/=_)*w*((1.70158+1)*w-1.70158)+S},BackEaseOut(w,S,x,_){return x*((w=w/_-1)*w*((1.70158+1)*w+1.70158)+1)+S},BackEaseInOut(w,S,x,_){let b=1.70158;return(w/=_/2)<1?x/2*(w*w*(((b*=1.525)+1)*w-b))+S:x/2*((w-=2)*w*(((b*=1.525)+1)*w+b)+2)+S},ElasticEaseIn(w,S,x,_,b,g){let h=0;return w===0?S:(w/=_)===1?S+x:(g||(g=_*.3),!b||b<Math.abs(x)?(b=x,h=g/4):h=g/(2*Math.PI)*Math.asin(x/b),-(b*Math.pow(2,10*(w-=1))*Math.sin((w*_-h)*(2*Math.PI)/g))+S)},ElasticEaseOut(w,S,x,_,b,g){let h=0;return w===0?S:(w/=_)===1?S+x:(g||(g=_*.3),!b||b<Math.abs(x)?(b=x,h=g/4):h=g/(2*Math.PI)*Math.asin(x/b),b*Math.pow(2,-10*w)*Math.sin((w*_-h)*(2*Math.PI)/g)+x+S)},ElasticEaseInOut(w,S,x,_,b,g){let h=0;return w===0?S:(w/=_/2)===2?S+x:(g||(g=_*(.3*1.5)),!b||b<Math.abs(x)?(b=x,h=g/4):h=g/(2*Math.PI)*Math.asin(x/b),w<1?-.5*(b*Math.pow(2,10*(w-=1))*Math.sin((w*_-h)*(2*Math.PI)/g))+S:b*Math.pow(2,-10*(w-=1))*Math.sin((w*_-h)*(2*Math.PI)/g)*.5+x+S)},BounceEaseOut(w,S,x,_){return(w/=_)<1/2.75?x*(7.5625*w*w)+S:w<2/2.75?x*(7.5625*(w-=1.5/2.75)*w+.75)+S:w<2.5/2.75?x*(7.5625*(w-=2.25/2.75)*w+.9375)+S:x*(7.5625*(w-=2.625/2.75)*w+.984375)+S},BounceEaseIn(w,S,x,_){return x-e.Easings.BounceEaseOut(_-w,0,x,_)+S},BounceEaseInOut(w,S,x,_){return w<_/2?e.Easings.BounceEaseIn(w*2,0,x,_)*.5+S:e.Easings.BounceEaseOut(w*2-_,0,x,_)*.5+x*.5+S},EaseIn(w,S,x,_){return x*(w/=_)*w+S},EaseOut(w,S,x,_){return-x*(w/=_)*(w-2)+S},EaseInOut(w,S,x,_){return(w/=_/2)<1?x/2*w*w+S:-x/2*(--w*(w-2)-1)+S},StrongEaseIn(w,S,x,_){return x*(w/=_)*w*w*w*w+S},StrongEaseOut(w,S,x,_){return x*((w=w/_-1)*w*w*w*w+1)+S},StrongEaseInOut(w,S,x,_){return(w/=_/2)<1?x/2*w*w*w*w*w+S:x/2*((w-=2)*w*w*w*w+2)+S},Linear(w,S,x,_){return x*w/_+S}}}(Yg)),Yg}var Sy;function nv(){return Sy||(Sy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const n=Dt(),t=Lr(),r=Hr(),a=zp(),o=f9(),s=ww(),c=d9(),m=Tv(),f=Av(),v=bn(),y=Rv(),E=h9(),w=yw(),S=Fp();e.Konva=t.Util._assign(n.Konva,{Util:t.Util,Transform:t.Transform,Node:r.Node,Container:a.Container,Stage:o.Stage,stages:o.stages,Layer:s.Layer,FastLayer:c.FastLayer,Group:m.Group,DD:f.DD,Shape:v.Shape,shapes:v.shapes,Animation:y.Animation,Tween:E.Tween,Easings:E.Easings,Context:w.Context,Canvas:S.Canvas}),e.default=e.Konva}(Ug)),Ug}var Pf={},Ey;function p9(){if(Ey)return Pf;Ey=1,Object.defineProperty(Pf,"__esModule",{value:!0}),Pf.Arc=void 0;const e=qt(),n=bn(),t=Dt(),r=Vt(),a=Dt();class o extends n.Shape{_sceneFunc(c){const m=t.Konva.getAngle(this.angle()),f=this.clockwise();c.beginPath(),c.arc(0,0,this.outerRadius(),0,m,f),c.arc(0,0,this.innerRadius(),m,0,!f),c.closePath(),c.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(c){this.outerRadius(c/2)}setHeight(c){this.outerRadius(c/2)}getSelfRect(){const c=this.innerRadius(),m=this.outerRadius(),f=this.clockwise(),v=t.Konva.getAngle(f?360-this.angle():this.angle()),y=Math.cos(Math.min(v,Math.PI)),E=1,w=Math.sin(Math.min(Math.max(Math.PI,v),3*Math.PI/2)),S=Math.sin(Math.min(v,Math.PI/2)),x=y*(y>0?c:m),_=E*m,b=w*(w>0?c:m),g=S*(S>0?m:c);return{x,y:f?-1*g:b,width:_-x,height:g-b}}}return Pf.Arc=o,o.prototype._centroid=!0,o.prototype.className="Arc",o.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"],(0,a._registerNode)(o),e.Factory.addGetterSetter(o,"innerRadius",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(o,"outerRadius",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(o,"angle",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(o,"clockwise",!1,(0,r.getBooleanValidator)()),Pf}var Cf={},kf={},xy;function _w(){if(xy)return kf;xy=1,Object.defineProperty(kf,"__esModule",{value:!0}),kf.Line=void 0;const e=qt(),n=Dt(),t=bn(),r=Vt();function a(c,m,f,v,y,E,w){const S=Math.sqrt(Math.pow(f-c,2)+Math.pow(v-m,2)),x=Math.sqrt(Math.pow(y-f,2)+Math.pow(E-v,2)),_=w*S/(S+x),b=w*x/(S+x),g=f-_*(y-c),h=v-_*(E-m),d=f+b*(y-c),P=v+b*(E-m);return[g,h,d,P]}function o(c,m){const f=c.length,v=[];for(let y=2;y<f-2;y+=2){const E=a(c[y-2],c[y-1],c[y],c[y+1],c[y+2],c[y+3],m);isNaN(E[0])||(v.push(E[0]),v.push(E[1]),v.push(c[y]),v.push(c[y+1]),v.push(E[2]),v.push(E[3]))}return v}class s extends t.Shape{constructor(m){super(m),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(m){let f=this.points(),v=f.length,y=this.tension(),E=this.closed(),w=this.bezier(),S,x,_;if(v){if(m.beginPath(),m.moveTo(f[0],f[1]),y!==0&&v>4){for(S=this.getTensionPoints(),x=S.length,_=E?0:4,E||m.quadraticCurveTo(S[0],S[1],S[2],S[3]);_<x-2;)m.bezierCurveTo(S[_++],S[_++],S[_++],S[_++],S[_++],S[_++]);E||m.quadraticCurveTo(S[x-2],S[x-1],f[v-2],f[v-1])}else if(w)for(_=2;_<v;)m.bezierCurveTo(f[_++],f[_++],f[_++],f[_++],f[_++],f[_++]);else for(_=2;_<v;_+=2)m.lineTo(f[_],f[_+1]);E?(m.closePath(),m.fillStrokeShape(this)):m.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():o(this.points(),this.tension())}_getTensionPointsClosed(){const m=this.points(),f=m.length,v=this.tension(),y=a(m[f-2],m[f-1],m[0],m[1],m[2],m[3],v),E=a(m[f-4],m[f-3],m[f-2],m[f-1],m[0],m[1],v),w=o(m,v);return[y[2],y[3]].concat(w).concat([E[0],E[1],m[f-2],m[f-1],E[2],E[3],y[0],y[1],m[0],m[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let m=this.points();if(m.length<4)return{x:m[0]||0,y:m[1]||0,width:0,height:0};this.tension()!==0?m=[m[0],m[1],...this._getTensionPoints(),m[m.length-2],m[m.length-1]]:m=this.points();let f=m[0],v=m[0],y=m[1],E=m[1],w,S;for(let x=0;x<m.length/2;x++)w=m[x*2],S=m[x*2+1],f=Math.min(f,w),v=Math.max(v,w),y=Math.min(y,S),E=Math.max(E,S);return{x:f,y,width:v-f,height:E-y}}}return kf.Line=s,s.prototype.className="Line",s.prototype._attrsAffectingSize=["points","bezier","tension"],(0,n._registerNode)(s),e.Factory.addGetterSetter(s,"closed",!1),e.Factory.addGetterSetter(s,"bezier",!1),e.Factory.addGetterSetter(s,"tension",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(s,"points",[],(0,r.getNumberArrayValidator)()),kf}var Af={},Kg={},Oy;function g9(){return Oy||(Oy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t2length=e.getQuadraticArcLength=e.getCubicArcLength=e.binomialCoefficients=e.cValues=e.tValues=void 0,e.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],e.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],e.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const n=(s,c,m)=>{let f,v;const E=m/2;f=0;for(let w=0;w<20;w++)v=E*e.tValues[20][w]+E,f+=e.cValues[20][w]*r(s,c,v);return E*f};e.getCubicArcLength=n;const t=(s,c,m)=>{m===void 0&&(m=1);const f=s[0]-2*s[1]+s[2],v=c[0]-2*c[1]+c[2],y=2*s[1]-2*s[0],E=2*c[1]-2*c[0],w=4*(f*f+v*v),S=4*(f*y+v*E),x=y*y+E*E;if(w===0)return m*Math.sqrt(Math.pow(s[2]-s[0],2)+Math.pow(c[2]-c[0],2));const _=S/(2*w),b=x/w,g=m+_,h=b-_*_,d=g*g+h>0?Math.sqrt(g*g+h):0,P=_*_+h>0?Math.sqrt(_*_+h):0,M=_+Math.sqrt(_*_+h)!==0?h*Math.log(Math.abs((g+d)/(_+P))):0;return Math.sqrt(w)/2*(g*d-_*P+M)};e.getQuadraticArcLength=t;function r(s,c,m){const f=a(1,m,s),v=a(1,m,c),y=f*f+v*v;return Math.sqrt(y)}const a=(s,c,m)=>{const f=m.length-1;let v,y;if(f===0)return 0;if(s===0){y=0;for(let E=0;E<=f;E++)y+=e.binomialCoefficients[f][E]*Math.pow(1-c,f-E)*Math.pow(c,E)*m[E];return y}else{v=new Array(f);for(let E=0;E<f;E++)v[E]=f*(m[E+1]-m[E]);return a(s-1,c,v)}},o=(s,c,m)=>{let f=1,v=s/c,y=(s-m(v))/c,E=0;for(;f>.001;){const w=m(v+y),S=Math.abs(s-w)/c;if(S<f)f=S,v+=y;else{const x=m(v-y),_=Math.abs(s-x)/c;_<f?(f=_,v-=y):y/=2}if(E++,E>500)break}return v};e.t2length=o}(Kg)),Kg}var Py;function Mv(){if(Py)return Af;Py=1,Object.defineProperty(Af,"__esModule",{value:!0}),Af.Path=void 0;const e=qt(),n=bn(),t=Dt(),r=g9();class a extends n.Shape{constructor(s){super(s),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=a.parsePathData(this.data()),this.pathLength=a.getPathLength(this.dataArray)}_sceneFunc(s){const c=this.dataArray;s.beginPath();let m=!1;for(let d=0;d<c.length;d++){const P=c[d].command,M=c[d].points;switch(P){case"L":s.lineTo(M[0],M[1]);break;case"M":s.moveTo(M[0],M[1]);break;case"C":s.bezierCurveTo(M[0],M[1],M[2],M[3],M[4],M[5]);break;case"Q":s.quadraticCurveTo(M[0],M[1],M[2],M[3]);break;case"A":var f=M[0],v=M[1],y=M[2],E=M[3],w=M[4],S=M[5],x=M[6],_=M[7],b=y>E?y:E,g=y>E?1:y/E,h=y>E?E/y:1;s.translate(f,v),s.rotate(x),s.scale(g,h),s.arc(0,0,b,w,w+S,1-_),s.scale(1/g,1/h),s.rotate(-x),s.translate(-f,-v);break;case"z":m=!0,s.closePath();break}}!m&&!this.hasFill()?s.strokeShape(this):s.fillStrokeShape(this)}getSelfRect(){let s=[];this.dataArray.forEach(function(w){if(w.command==="A"){const S=w.points[4],x=w.points[5],_=w.points[4]+x;let b=Math.PI/180;if(Math.abs(S-_)<b&&(b=Math.abs(S-_)),x<0)for(let g=S-b;g>_;g-=b){const h=a.getPointOnEllipticalArc(w.points[0],w.points[1],w.points[2],w.points[3],g,0);s.push(h.x,h.y)}else for(let g=S+b;g<_;g+=b){const h=a.getPointOnEllipticalArc(w.points[0],w.points[1],w.points[2],w.points[3],g,0);s.push(h.x,h.y)}}else if(w.command==="C")for(let S=0;S<=1;S+=.01){const x=a.getPointOnCubicBezier(S,w.start.x,w.start.y,w.points[0],w.points[1],w.points[2],w.points[3],w.points[4],w.points[5]);s.push(x.x,x.y)}else s=s.concat(w.points)});let c=s[0],m=s[0],f=s[1],v=s[1],y,E;for(let w=0;w<s.length/2;w++)y=s[w*2],E=s[w*2+1],isNaN(y)||(c=Math.min(c,y),m=Math.max(m,y)),isNaN(E)||(f=Math.min(f,E),v=Math.max(v,E));return{x:c,y:f,width:m-c,height:v-f}}getLength(){return this.pathLength}getPointAtLength(s){return a.getPointAtLengthOfDataArray(s,this.dataArray)}static getLineLength(s,c,m,f){return Math.sqrt((m-s)*(m-s)+(f-c)*(f-c))}static getPathLength(s){let c=0;for(let m=0;m<s.length;++m)c+=s[m].pathLength;return c}static getPointAtLengthOfDataArray(s,c){let m,f=0,v=c.length;if(!v)return null;for(;f<v&&s>c[f].pathLength;)s-=c[f].pathLength,++f;if(f===v)return m=c[f-1].points.slice(-2),{x:m[0],y:m[1]};if(s<.01)return m=c[f].points.slice(0,2),{x:m[0],y:m[1]};const y=c[f],E=y.points;switch(y.command){case"L":return a.getPointOnLine(s,y.start.x,y.start.y,E[0],E[1]);case"C":return a.getPointOnCubicBezier((0,r.t2length)(s,a.getPathLength(c),d=>(0,r.getCubicArcLength)([y.start.x,E[0],E[2],E[4]],[y.start.y,E[1],E[3],E[5]],d)),y.start.x,y.start.y,E[0],E[1],E[2],E[3],E[4],E[5]);case"Q":return a.getPointOnQuadraticBezier((0,r.t2length)(s,a.getPathLength(c),d=>(0,r.getQuadraticArcLength)([y.start.x,E[0],E[2]],[y.start.y,E[1],E[3]],d)),y.start.x,y.start.y,E[0],E[1],E[2],E[3]);case"A":var w=E[0],S=E[1],x=E[2],_=E[3],b=E[4],g=E[5],h=E[6];return b+=g*s/y.pathLength,a.getPointOnEllipticalArc(w,S,x,_,b,h)}return null}static getPointOnLine(s,c,m,f,v,y,E){y=y??c,E=E??m;const w=this.getLineLength(c,m,f,v);if(w<1e-10)return{x:c,y:m};if(f===c)return{x:y,y:E+(v>m?s:-s)};const S=(v-m)/(f-c),x=Math.sqrt(s*s/(1+S*S))*(f<c?-1:1),_=S*x;if(Math.abs(E-m-S*(y-c))<1e-10)return{x:y+x,y:E+_};const b=((y-c)*(f-c)+(E-m)*(v-m))/(w*w),g=c+b*(f-c),h=m+b*(v-m),d=this.getLineLength(y,E,g,h),P=Math.sqrt(s*s-d*d),M=Math.sqrt(P*P/(1+S*S))*(f<c?-1:1),T=S*M;return{x:g+M,y:h+T}}static getPointOnCubicBezier(s,c,m,f,v,y,E,w,S){function x(P){return P*P*P}function _(P){return 3*P*P*(1-P)}function b(P){return 3*P*(1-P)*(1-P)}function g(P){return(1-P)*(1-P)*(1-P)}const h=w*x(s)+y*_(s)+f*b(s)+c*g(s),d=S*x(s)+E*_(s)+v*b(s)+m*g(s);return{x:h,y:d}}static getPointOnQuadraticBezier(s,c,m,f,v,y,E){function w(g){return g*g}function S(g){return 2*g*(1-g)}function x(g){return(1-g)*(1-g)}const _=y*w(s)+f*S(s)+c*x(s),b=E*w(s)+v*S(s)+m*x(s);return{x:_,y:b}}static getPointOnEllipticalArc(s,c,m,f,v,y){const E=Math.cos(y),w=Math.sin(y),S={x:m*Math.cos(v),y:f*Math.sin(v)};return{x:s+(S.x*E-S.y*w),y:c+(S.x*w+S.y*E)}}static parsePathData(s){if(!s)return[];let c=s;const m=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];c=c.replace(new RegExp(" ","g"),",");for(var f=0;f<m.length;f++)c=c.replace(new RegExp(m[f],"g"),"|"+m[f]);const v=c.split("|"),y=[],E=[];let w=0,S=0;const x=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let _;for(f=1;f<v.length;f++){let A=v[f],R=A.charAt(0);for(A=A.slice(1),E.length=0;_=x.exec(A);)E.push(_[0]);const L=[];for(let V=0,G=E.length;V<G;V++){if(E[V]==="00"){L.push(0,0);continue}const W=parseFloat(E[V]);isNaN(W)?L.push(0):L.push(W)}for(;L.length>0&&!isNaN(L[0]);){let V="",G=[];const W=w,X=S;var b,g,h,d,P,M,T,I,F,k;switch(R){case"l":w+=L.shift(),S+=L.shift(),V="L",G.push(w,S);break;case"L":w=L.shift(),S=L.shift(),G.push(w,S);break;case"m":var O=L.shift(),N=L.shift();if(w+=O,S+=N,V="M",y.length>2&&y[y.length-1].command==="z"){for(let q=y.length-2;q>=0;q--)if(y[q].command==="M"){w=y[q].points[0]+O,S=y[q].points[1]+N;break}}G.push(w,S),R="l";break;case"M":w=L.shift(),S=L.shift(),V="M",G.push(w,S),R="L";break;case"h":w+=L.shift(),V="L",G.push(w,S);break;case"H":w=L.shift(),V="L",G.push(w,S);break;case"v":S+=L.shift(),V="L",G.push(w,S);break;case"V":S=L.shift(),V="L",G.push(w,S);break;case"C":G.push(L.shift(),L.shift(),L.shift(),L.shift()),w=L.shift(),S=L.shift(),G.push(w,S);break;case"c":G.push(w+L.shift(),S+L.shift(),w+L.shift(),S+L.shift()),w+=L.shift(),S+=L.shift(),V="C",G.push(w,S);break;case"S":g=w,h=S,b=y[y.length-1],b.command==="C"&&(g=w+(w-b.points[2]),h=S+(S-b.points[3])),G.push(g,h,L.shift(),L.shift()),w=L.shift(),S=L.shift(),V="C",G.push(w,S);break;case"s":g=w,h=S,b=y[y.length-1],b.command==="C"&&(g=w+(w-b.points[2]),h=S+(S-b.points[3])),G.push(g,h,w+L.shift(),S+L.shift()),w+=L.shift(),S+=L.shift(),V="C",G.push(w,S);break;case"Q":G.push(L.shift(),L.shift()),w=L.shift(),S=L.shift(),G.push(w,S);break;case"q":G.push(w+L.shift(),S+L.shift()),w+=L.shift(),S+=L.shift(),V="Q",G.push(w,S);break;case"T":g=w,h=S,b=y[y.length-1],b.command==="Q"&&(g=w+(w-b.points[0]),h=S+(S-b.points[1])),w=L.shift(),S=L.shift(),V="Q",G.push(g,h,w,S);break;case"t":g=w,h=S,b=y[y.length-1],b.command==="Q"&&(g=w+(w-b.points[0]),h=S+(S-b.points[1])),w+=L.shift(),S+=L.shift(),V="Q",G.push(g,h,w,S);break;case"A":d=L.shift(),P=L.shift(),M=L.shift(),T=L.shift(),I=L.shift(),F=w,k=S,w=L.shift(),S=L.shift(),V="A",G=this.convertEndpointToCenterParameterization(F,k,w,S,T,I,d,P,M);break;case"a":d=L.shift(),P=L.shift(),M=L.shift(),T=L.shift(),I=L.shift(),F=w,k=S,w+=L.shift(),S+=L.shift(),V="A",G=this.convertEndpointToCenterParameterization(F,k,w,S,T,I,d,P,M);break}y.push({command:V||R,points:G,start:{x:W,y:X},pathLength:this.calcLength(W,X,V||R,G)})}(R==="z"||R==="Z")&&y.push({command:"z",points:[],start:void 0,pathLength:0})}return y}static calcLength(s,c,m,f){let v,y,E,w;const S=a;switch(m){case"L":return S.getLineLength(s,c,f[0],f[1]);case"C":return(0,r.getCubicArcLength)([s,f[0],f[2],f[4]],[c,f[1],f[3],f[5]],1);case"Q":return(0,r.getQuadraticArcLength)([s,f[0],f[2]],[c,f[1],f[3]],1);case"A":v=0;var x=f[4],_=f[5],b=f[4]+_,g=Math.PI/180;if(Math.abs(x-b)<g&&(g=Math.abs(x-b)),y=S.getPointOnEllipticalArc(f[0],f[1],f[2],f[3],x,0),_<0)for(w=x-g;w>b;w-=g)E=S.getPointOnEllipticalArc(f[0],f[1],f[2],f[3],w,0),v+=S.getLineLength(y.x,y.y,E.x,E.y),y=E;else for(w=x+g;w<b;w+=g)E=S.getPointOnEllipticalArc(f[0],f[1],f[2],f[3],w,0),v+=S.getLineLength(y.x,y.y,E.x,E.y),y=E;return E=S.getPointOnEllipticalArc(f[0],f[1],f[2],f[3],b,0),v+=S.getLineLength(y.x,y.y,E.x,E.y),v}return 0}static convertEndpointToCenterParameterization(s,c,m,f,v,y,E,w,S){const x=S*(Math.PI/180),_=Math.cos(x)*(s-m)/2+Math.sin(x)*(c-f)/2,b=-1*Math.sin(x)*(s-m)/2+Math.cos(x)*(c-f)/2,g=_*_/(E*E)+b*b/(w*w);g>1&&(E*=Math.sqrt(g),w*=Math.sqrt(g));let h=Math.sqrt((E*E*(w*w)-E*E*(b*b)-w*w*(_*_))/(E*E*(b*b)+w*w*(_*_)));v===y&&(h*=-1),isNaN(h)&&(h=0);const d=h*E*b/w,P=h*-w*_/E,M=(s+m)/2+Math.cos(x)*d-Math.sin(x)*P,T=(c+f)/2+Math.sin(x)*d+Math.cos(x)*P,I=function(L){return Math.sqrt(L[0]*L[0]+L[1]*L[1])},F=function(L,V){return(L[0]*V[0]+L[1]*V[1])/(I(L)*I(V))},k=function(L,V){return(L[0]*V[1]<L[1]*V[0]?-1:1)*Math.acos(F(L,V))},O=k([1,0],[(_-d)/E,(b-P)/w]),N=[(_-d)/E,(b-P)/w],A=[(-1*_-d)/E,(-1*b-P)/w];let R=k(N,A);return F(N,A)<=-1&&(R=Math.PI),F(N,A)>=1&&(R=0),y===0&&R>0&&(R=R-2*Math.PI),y===1&&R<0&&(R=R+2*Math.PI),[M,T,E,w,O,R,x,y]}}return Af.Path=a,a.prototype.className="Path",a.prototype._attrsAffectingSize=["data"],(0,t._registerNode)(a),e.Factory.addGetterSetter(a,"data"),Af}var Cy;function v9(){if(Cy)return Cf;Cy=1,Object.defineProperty(Cf,"__esModule",{value:!0}),Cf.Arrow=void 0;const e=qt(),n=_w(),t=Vt(),r=Dt(),a=Mv();class o extends n.Line{_sceneFunc(c){super._sceneFunc(c);const m=Math.PI*2,f=this.points();let v=f;const y=this.tension()!==0&&f.length>4;y&&(v=this.getTensionPoints());const E=this.pointerLength(),w=f.length;let S,x;if(y){const g=[v[v.length-4],v[v.length-3],v[v.length-2],v[v.length-1],f[w-2],f[w-1]],h=a.Path.calcLength(v[v.length-4],v[v.length-3],"C",g),d=a.Path.getPointOnQuadraticBezier(Math.min(1,1-E/h),g[0],g[1],g[2],g[3],g[4],g[5]);S=f[w-2]-d.x,x=f[w-1]-d.y}else S=f[w-2]-f[w-4],x=f[w-1]-f[w-3];const _=(Math.atan2(x,S)+m)%m,b=this.pointerWidth();this.pointerAtEnding()&&(c.save(),c.beginPath(),c.translate(f[w-2],f[w-1]),c.rotate(_),c.moveTo(0,0),c.lineTo(-E,b/2),c.lineTo(-E,-b/2),c.closePath(),c.restore(),this.__fillStroke(c)),this.pointerAtBeginning()&&(c.save(),c.beginPath(),c.translate(f[0],f[1]),y?(S=(v[0]+v[2])/2-f[0],x=(v[1]+v[3])/2-f[1]):(S=f[2]-f[0],x=f[3]-f[1]),c.rotate((Math.atan2(-x,-S)+m)%m),c.moveTo(0,0),c.lineTo(-E,b/2),c.lineTo(-E,-b/2),c.closePath(),c.restore(),this.__fillStroke(c))}__fillStroke(c){const m=this.dashEnabled();m&&(this.attrs.dashEnabled=!1,c.setLineDash([])),c.fillStrokeShape(this),m&&(this.attrs.dashEnabled=!0)}getSelfRect(){const c=super.getSelfRect(),m=this.pointerWidth()/2;return{x:c.x,y:c.y-m,width:c.width,height:c.height+m*2}}}return Cf.Arrow=o,o.prototype.className="Arrow",(0,r._registerNode)(o),e.Factory.addGetterSetter(o,"pointerLength",10,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(o,"pointerWidth",10,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(o,"pointerAtBeginning",!1),e.Factory.addGetterSetter(o,"pointerAtEnding",!0),Cf}var Tf={},ky;function m9(){if(ky)return Tf;ky=1,Object.defineProperty(Tf,"__esModule",{value:!0}),Tf.Circle=void 0;const e=qt(),n=bn(),t=Vt(),r=Dt();class a extends n.Shape{_sceneFunc(s){s.beginPath(),s.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),s.closePath(),s.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(s){this.radius()!==s/2&&this.radius(s/2)}setHeight(s){this.radius()!==s/2&&this.radius(s/2)}}return Tf.Circle=a,a.prototype._centroid=!0,a.prototype.className="Circle",a.prototype._attrsAffectingSize=["radius"],(0,r._registerNode)(a),e.Factory.addGetterSetter(a,"radius",0,(0,t.getNumberValidator)()),Tf}var Rf={},Ay;function y9(){if(Ay)return Rf;Ay=1,Object.defineProperty(Rf,"__esModule",{value:!0}),Rf.Ellipse=void 0;const e=qt(),n=bn(),t=Vt(),r=Dt();class a extends n.Shape{_sceneFunc(s){const c=this.radiusX(),m=this.radiusY();s.beginPath(),s.save(),c!==m&&s.scale(1,m/c),s.arc(0,0,c,0,Math.PI*2,!1),s.restore(),s.closePath(),s.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(s){this.radiusX(s/2)}setHeight(s){this.radiusY(s/2)}}return Rf.Ellipse=a,a.prototype.className="Ellipse",a.prototype._centroid=!0,a.prototype._attrsAffectingSize=["radiusX","radiusY"],(0,r._registerNode)(a),e.Factory.addComponentsGetterSetter(a,"radius",["x","y"]),e.Factory.addGetterSetter(a,"radiusX",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(a,"radiusY",0,(0,t.getNumberValidator)()),Rf}var Mf={},Ty;function b9(){if(Ty)return Mf;Ty=1,Object.defineProperty(Mf,"__esModule",{value:!0}),Mf.Image=void 0;const e=Lr(),n=qt(),t=bn(),r=Dt(),a=Vt();class o extends t.Shape{constructor(c){super(c),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",m=>{this._removeImageLoad(m.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const c=this.image();c&&c.complete||c&&c.readyState===4||c&&c.addEventListener&&c.addEventListener("load",this._loadListener)}_removeImageLoad(c){c&&c.removeEventListener&&c.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const c=!!this.cornerRadius(),m=this.hasShadow();return c&&m?!0:super._useBufferCanvas(!0)}_sceneFunc(c){const m=this.getWidth(),f=this.getHeight(),v=this.cornerRadius(),y=this.attrs.image;let E;if(y){const w=this.attrs.cropWidth,S=this.attrs.cropHeight;w&&S?E=[y,this.cropX(),this.cropY(),w,S,0,0,m,f]:E=[y,0,0,m,f]}(this.hasFill()||this.hasStroke()||v)&&(c.beginPath(),v?e.Util.drawRoundedRectPath(c,m,f,v):c.rect(0,0,m,f),c.closePath(),c.fillStrokeShape(this)),y&&(v&&c.clip(),c.drawImage.apply(c,E))}_hitFunc(c){const m=this.width(),f=this.height(),v=this.cornerRadius();c.beginPath(),v?e.Util.drawRoundedRectPath(c,m,f,v):c.rect(0,0,m,f),c.closePath(),c.fillStrokeShape(this)}getWidth(){var c,m;return(c=this.attrs.width)!==null&&c!==void 0?c:(m=this.image())===null||m===void 0?void 0:m.width}getHeight(){var c,m;return(c=this.attrs.height)!==null&&c!==void 0?c:(m=this.image())===null||m===void 0?void 0:m.height}static fromURL(c,m,f=null){const v=e.Util.createImageElement();v.onload=function(){const y=new o({image:v});m(y)},v.onerror=f,v.crossOrigin="Anonymous",v.src=c}}return Mf.Image=o,o.prototype.className="Image",(0,r._registerNode)(o),n.Factory.addGetterSetter(o,"cornerRadius",0,(0,a.getNumberOrArrayOfNumbersValidator)(4)),n.Factory.addGetterSetter(o,"image"),n.Factory.addComponentsGetterSetter(o,"crop",["x","y","width","height"]),n.Factory.addGetterSetter(o,"cropX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(o,"cropY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(o,"cropWidth",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(o,"cropHeight",0,(0,a.getNumberValidator)()),Mf}var Is={},Ry;function w9(){if(Ry)return Is;Ry=1,Object.defineProperty(Is,"__esModule",{value:!0}),Is.Tag=Is.Label=void 0;const e=qt(),n=bn(),t=Tv(),r=Vt(),a=Dt(),o=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],s="Change.konva",c="none",m="up",f="right",v="down",y="left",E=o.length;class w extends t.Group{constructor(_){super(_),this.on("add.konva",function(b){this._addListeners(b.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(_){let b=this,g;const h=function(){b._sync()};for(g=0;g<E;g++)_.on(o[g]+s,h)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let _=this.getText(),b=this.getTag(),g,h,d,P,M,T,I;if(_&&b){switch(g=_.width(),h=_.height(),d=b.pointerDirection(),P=b.pointerWidth(),I=b.pointerHeight(),M=0,T=0,d){case m:M=g/2,T=-1*I;break;case f:M=g+P,T=h/2;break;case v:M=g/2,T=h+I;break;case y:M=-1*P,T=h/2;break}b.setAttrs({x:-1*M,y:-1*T,width:g,height:h}),_.setAttrs({x:-1*M,y:-1*T})}}}Is.Label=w,w.prototype.className="Label",(0,a._registerNode)(w);class S extends n.Shape{_sceneFunc(_){const b=this.width(),g=this.height(),h=this.pointerDirection(),d=this.pointerWidth(),P=this.pointerHeight(),M=this.cornerRadius();let T=0,I=0,F=0,k=0;typeof M=="number"?T=I=F=k=Math.min(M,b/2,g/2):(T=Math.min(M[0]||0,b/2,g/2),I=Math.min(M[1]||0,b/2,g/2),k=Math.min(M[2]||0,b/2,g/2),F=Math.min(M[3]||0,b/2,g/2)),_.beginPath(),_.moveTo(T,0),h===m&&(_.lineTo((b-d)/2,0),_.lineTo(b/2,-1*P),_.lineTo((b+d)/2,0)),_.lineTo(b-I,0),_.arc(b-I,I,I,Math.PI*3/2,0,!1),h===f&&(_.lineTo(b,(g-P)/2),_.lineTo(b+d,g/2),_.lineTo(b,(g+P)/2)),_.lineTo(b,g-k),_.arc(b-k,g-k,k,0,Math.PI/2,!1),h===v&&(_.lineTo((b+d)/2,g),_.lineTo(b/2,g+P),_.lineTo((b-d)/2,g)),_.lineTo(F,g),_.arc(F,g-F,F,Math.PI/2,Math.PI,!1),h===y&&(_.lineTo(0,(g+P)/2),_.lineTo(-1*d,g/2),_.lineTo(0,(g-P)/2)),_.lineTo(0,T),_.arc(T,T,T,Math.PI,Math.PI*3/2,!1),_.closePath(),_.fillStrokeShape(this)}getSelfRect(){let _=0,b=0,g=this.pointerWidth(),h=this.pointerHeight(),d=this.pointerDirection(),P=this.width(),M=this.height();return d===m?(b-=h,M+=h):d===v?M+=h:d===y?(_-=g*1.5,P+=g):d===f&&(P+=g*1.5),{x:_,y:b,width:P,height:M}}}return Is.Tag=S,S.prototype.className="Tag",(0,a._registerNode)(S),e.Factory.addGetterSetter(S,"pointerDirection",c),e.Factory.addGetterSetter(S,"pointerWidth",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(S,"pointerHeight",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(S,"cornerRadius",0,(0,r.getNumberOrArrayOfNumbersValidator)(4)),Is}var Lf={},My;function Sw(){if(My)return Lf;My=1,Object.defineProperty(Lf,"__esModule",{value:!0}),Lf.Rect=void 0;const e=qt(),n=bn(),t=Dt(),r=Lr(),a=Vt();class o extends n.Shape{_sceneFunc(c){const m=this.cornerRadius(),f=this.width(),v=this.height();c.beginPath(),m?r.Util.drawRoundedRectPath(c,f,v,m):c.rect(0,0,f,v),c.closePath(),c.fillStrokeShape(this)}}return Lf.Rect=o,o.prototype.className="Rect",(0,t._registerNode)(o),e.Factory.addGetterSetter(o,"cornerRadius",0,(0,a.getNumberOrArrayOfNumbersValidator)(4)),Lf}var Nf={},Ly;function _9(){if(Ly)return Nf;Ly=1,Object.defineProperty(Nf,"__esModule",{value:!0}),Nf.RegularPolygon=void 0;const e=qt(),n=bn(),t=Vt(),r=Dt();class a extends n.Shape{_sceneFunc(s){const c=this._getPoints();s.beginPath(),s.moveTo(c[0].x,c[0].y);for(let m=1;m<c.length;m++)s.lineTo(c[m].x,c[m].y);s.closePath(),s.fillStrokeShape(this)}_getPoints(){const s=this.attrs.sides,c=this.attrs.radius||0,m=[];for(let f=0;f<s;f++)m.push({x:c*Math.sin(f*2*Math.PI/s),y:-1*c*Math.cos(f*2*Math.PI/s)});return m}getSelfRect(){const s=this._getPoints();let c=s[0].x,m=s[0].y,f=s[0].x,v=s[0].y;return s.forEach(y=>{c=Math.min(c,y.x),m=Math.max(m,y.x),f=Math.min(f,y.y),v=Math.max(v,y.y)}),{x:c,y:f,width:m-c,height:v-f}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(s){this.radius(s/2)}setHeight(s){this.radius(s/2)}}return Nf.RegularPolygon=a,a.prototype.className="RegularPolygon",a.prototype._centroid=!0,a.prototype._attrsAffectingSize=["radius"],(0,r._registerNode)(a),e.Factory.addGetterSetter(a,"radius",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(a,"sides",0,(0,t.getNumberValidator)()),Nf}var If={},Ny;function S9(){if(Ny)return If;Ny=1,Object.defineProperty(If,"__esModule",{value:!0}),If.Ring=void 0;const e=qt(),n=bn(),t=Vt(),r=Dt(),a=Math.PI*2;class o extends n.Shape{_sceneFunc(c){c.beginPath(),c.arc(0,0,this.innerRadius(),0,a,!1),c.moveTo(this.outerRadius(),0),c.arc(0,0,this.outerRadius(),a,0,!0),c.closePath(),c.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(c){this.outerRadius(c/2)}setHeight(c){this.outerRadius(c/2)}}return If.Ring=o,o.prototype.className="Ring",o.prototype._centroid=!0,o.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,r._registerNode)(o),e.Factory.addGetterSetter(o,"innerRadius",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(o,"outerRadius",0,(0,t.getNumberValidator)()),If}var jf={},Iy;function E9(){if(Iy)return jf;Iy=1,Object.defineProperty(jf,"__esModule",{value:!0}),jf.Sprite=void 0;const e=qt(),n=bn(),t=Rv(),r=Vt(),a=Dt();class o extends n.Shape{constructor(c){super(c),this._updated=!0,this.anim=new t.Animation(()=>{const m=this._updated;return this._updated=!1,m}),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(c){const m=this.animation(),f=this.frameIndex(),v=f*4,y=this.animations()[m],E=this.frameOffsets(),w=y[v+0],S=y[v+1],x=y[v+2],_=y[v+3],b=this.image();if((this.hasFill()||this.hasStroke())&&(c.beginPath(),c.rect(0,0,x,_),c.closePath(),c.fillStrokeShape(this)),b)if(E){const g=E[m],h=f*2;c.drawImage(b,w,S,x,_,g[h+0],g[h+1],x,_)}else c.drawImage(b,w,S,x,_,0,0,x,_)}_hitFunc(c){const m=this.animation(),f=this.frameIndex(),v=f*4,y=this.animations()[m],E=this.frameOffsets(),w=y[v+2],S=y[v+3];if(c.beginPath(),E){const x=E[m],_=f*2;c.rect(x[_+0],x[_+1],w,S)}else c.rect(0,0,w,S);c.closePath(),c.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const c=this;this.interval=setInterval(function(){c._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const c=this.getLayer();this.anim.setLayers(c),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const c=this.frameIndex(),m=this.animation(),f=this.animations(),v=f[m],y=v.length/4;c<y-1?this.frameIndex(c+1):this.frameIndex(0)}}return jf.Sprite=o,o.prototype.className="Sprite",(0,a._registerNode)(o),e.Factory.addGetterSetter(o,"animation"),e.Factory.addGetterSetter(o,"animations"),e.Factory.addGetterSetter(o,"frameOffsets"),e.Factory.addGetterSetter(o,"image"),e.Factory.addGetterSetter(o,"frameIndex",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(o,"frameRate",17,(0,r.getNumberValidator)()),e.Factory.backCompat(o,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"}),jf}var Df={},jy;function x9(){if(jy)return Df;jy=1,Object.defineProperty(Df,"__esModule",{value:!0}),Df.Star=void 0;const e=qt(),n=bn(),t=Vt(),r=Dt();class a extends n.Shape{_sceneFunc(s){const c=this.innerRadius(),m=this.outerRadius(),f=this.numPoints();s.beginPath(),s.moveTo(0,0-m);for(let v=1;v<f*2;v++){const y=v%2===0?m:c,E=y*Math.sin(v*Math.PI/f),w=-1*y*Math.cos(v*Math.PI/f);s.lineTo(E,w)}s.closePath(),s.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(s){this.outerRadius(s/2)}setHeight(s){this.outerRadius(s/2)}}return Df.Star=a,a.prototype.className="Star",a.prototype._centroid=!0,a.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,r._registerNode)(a),e.Factory.addGetterSetter(a,"numPoints",5,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(a,"innerRadius",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(a,"outerRadius",0,(0,t.getNumberValidator)()),Df}var Qu={},Dy;function Ew(){if(Dy)return Qu;Dy=1,Object.defineProperty(Qu,"__esModule",{value:!0}),Qu.Text=void 0,Qu.stringToArray=s;const e=Lr(),n=qt(),t=bn(),r=Dt(),a=Vt(),o=Dt();function s(Y){return[...Y].reduce((U,ee,te,Q)=>{if(new RegExp("\\p{Emoji}","u").test(ee)){const Z=Q[te+1];Z&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(Z)?(U.push(ee+Z),Q[te+1]=""):U.push(ee)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(ee+(Q[te+1]||""))?U.push(ee+Q[te+1]):te>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(ee)?U[U.length-1]+=ee:ee&&U.push(ee);return U},[])}const c="auto",m="center",f="inherit",v="justify",y="Change.konva",E="2d",w="-",S="left",x="text",_="Text",b="top",g="bottom",h="middle",d="normal",P="px ",M=" ",T="right",I="rtl",F="word",k="char",O="none",N="…",A=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],R=A.length;function L(Y){return Y.split(",").map(U=>{U=U.trim();const ee=U.indexOf(" ")>=0,te=U.indexOf('"')>=0||U.indexOf("'")>=0;return ee&&!te&&(U=`"${U}"`),U}).join(", ")}let V;function G(){return V||(V=e.Util.createCanvasElement().getContext(E),V)}function W(Y){Y.fillText(this._partialText,this._partialTextX,this._partialTextY)}function X(Y){Y.setAttr("miterLimit",2),Y.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function q(Y){return Y=Y||{},!Y.fillLinearGradientColorStops&&!Y.fillRadialGradientColorStops&&!Y.fillPatternImage&&(Y.fill=Y.fill||"black"),Y}class z extends t.Shape{constructor(U){super(q(U)),this._partialTextX=0,this._partialTextY=0;for(let ee=0;ee<R;ee++)this.on(A[ee]+y,this._setTextData);this._setTextData()}_sceneFunc(U){const ee=this.textArr,te=ee.length;if(!this.text())return;let Q=this.padding(),Z=this.fontSize(),re=this.lineHeight()*Z,ne=this.verticalAlign(),ae=this.direction(),ue=0,fe=this.align(),pe=this.getWidth(),ye=this.letterSpacing(),we=this.fill(),je=this.textDecoration(),Te=je.indexOf("underline")!==-1,se=je.indexOf("line-through")!==-1,_e;ae=ae===f?U.direction:ae;let he=re/2,xe=h;if(r.Konva._fixTextRendering){const Ue=this.measureSize("M");xe="alphabetic",he=(Ue.fontBoundingBoxAscent-Ue.fontBoundingBoxDescent)/2+re/2}var oe=0,ve=0;for(ae===I&&U.setAttr("direction",ae),U.setAttr("font",this._getContextFont()),U.setAttr("textBaseline",xe),U.setAttr("textAlign",S),ne===h?ue=(this.getHeight()-te*re-Q*2)/2:ne===g&&(ue=this.getHeight()-te*re-Q*2),U.translate(Q,ue+Q),_e=0;_e<te;_e++){var oe=0,ve=0,de=ee[_e],ke=de.text,Be=de.width,Qe=de.lastInParagraph,Ke,St;if(U.save(),fe===T?oe+=pe-Be-Q*2:fe===m&&(oe+=(pe-Be-Q*2)/2),Te){U.save(),U.beginPath();const gt=r.Konva._fixTextRendering?Math.round(Z/4):Math.round(Z/2),mt=oe,kt=he+ve+gt;U.moveTo(mt,kt),Ke=ke.split(" ").length-1,St=fe===v&&!Qe?pe-Q*2:Be,U.lineTo(mt+Math.round(St),kt),U.lineWidth=Z/15;const jt=this._getLinearGradient();U.strokeStyle=jt||we,U.stroke(),U.restore()}if(se){U.save(),U.beginPath();const gt=r.Konva._fixTextRendering?-Math.round(Z/4):0;U.moveTo(oe,he+ve+gt),Ke=ke.split(" ").length-1,St=fe===v&&!Qe?pe-Q*2:Be,U.lineTo(oe+Math.round(St),he+ve+gt),U.lineWidth=Z/15;const mt=this._getLinearGradient();U.strokeStyle=mt||we,U.stroke(),U.restore()}if(ae!==I&&(ye!==0||fe===v)){Ke=ke.split(" ").length-1;const gt=s(ke);for(let mt=0;mt<gt.length;mt++){const kt=gt[mt];kt===" "&&!Qe&&fe===v&&(oe+=(pe-Q*2-Be)/Ke),this._partialTextX=oe,this._partialTextY=he+ve,this._partialText=kt,U.fillStrokeShape(this),oe+=this.measureSize(kt).width+ye}}else ye!==0&&U.setAttr("letterSpacing",`${ye}px`),this._partialTextX=oe,this._partialTextY=he+ve,this._partialText=ke,U.fillStrokeShape(this);U.restore(),te>1&&(he+=re)}}_hitFunc(U){const ee=this.getWidth(),te=this.getHeight();U.beginPath(),U.rect(0,0,ee,te),U.closePath(),U.fillStrokeShape(this)}setText(U){const ee=e.Util._isString(U)?U:U==null?"":U+"";return this._setAttr(x,ee),this}getWidth(){return this.attrs.width===c||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===c||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return e.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(U){var ee,te,Q,Z,re,ne,ae,ue,fe,pe,ye;let we=G(),je=this.fontSize(),Te;we.save(),we.font=this._getContextFont(),Te=we.measureText(U),we.restore();const se=je/100;return{actualBoundingBoxAscent:(ee=Te.actualBoundingBoxAscent)!==null&&ee!==void 0?ee:71.58203125*se,actualBoundingBoxDescent:(te=Te.actualBoundingBoxDescent)!==null&&te!==void 0?te:0,actualBoundingBoxLeft:(Q=Te.actualBoundingBoxLeft)!==null&&Q!==void 0?Q:-7.421875*se,actualBoundingBoxRight:(Z=Te.actualBoundingBoxRight)!==null&&Z!==void 0?Z:75.732421875*se,alphabeticBaseline:(re=Te.alphabeticBaseline)!==null&&re!==void 0?re:0,emHeightAscent:(ne=Te.emHeightAscent)!==null&&ne!==void 0?ne:100*se,emHeightDescent:(ae=Te.emHeightDescent)!==null&&ae!==void 0?ae:-20*se,fontBoundingBoxAscent:(ue=Te.fontBoundingBoxAscent)!==null&&ue!==void 0?ue:91*se,fontBoundingBoxDescent:(fe=Te.fontBoundingBoxDescent)!==null&&fe!==void 0?fe:21*se,hangingBaseline:(pe=Te.hangingBaseline)!==null&&pe!==void 0?pe:72.80000305175781*se,ideographicBaseline:(ye=Te.ideographicBaseline)!==null&&ye!==void 0?ye:-21*se,width:Te.width,height:je}}_getContextFont(){return this.fontStyle()+M+this.fontVariant()+M+(this.fontSize()+P)+L(this.fontFamily())}_addTextLine(U){this.align()===v&&(U=U.trim());const te=this._getTextWidth(U);return this.textArr.push({text:U,width:te,lastInParagraph:!1})}_getTextWidth(U){const ee=this.letterSpacing(),te=U.length;return G().measureText(U).width+ee*te}_setTextData(){let U=this.text().split(`
|
|
43
|
+
`),ee=+this.fontSize(),te=0,Q=this.lineHeight()*ee,Z=this.attrs.width,re=this.attrs.height,ne=Z!==c&&Z!==void 0,ae=re!==c&&re!==void 0,ue=this.padding(),fe=Z-ue*2,pe=re-ue*2,ye=0,we=this.wrap(),je=we!==O,Te=we!==k&&je,se=this.ellipsis();this.textArr=[],G().font=this._getContextFont();const _e=se?this._getTextWidth(N):0;for(let he=0,xe=U.length;he<xe;++he){let oe=U[he],ve=this._getTextWidth(oe);if(ne&&ve>fe)for(;oe.length>0;){let de=0,ke=s(oe).length,Be="",Qe=0;for(;de<ke;){const Ke=de+ke>>>1,St=s(oe),Ue=St.slice(0,Ke+1).join(""),rt=this._getTextWidth(Ue)+_e;rt<=fe?(de=Ke+1,Be=Ue,Qe=rt):ke=Ke}if(Be){if(Te){const Ue=s(oe),rt=s(Be),gt=Ue[rt.length],mt=gt===M||gt===w;let kt;if(mt&&Qe<=fe)kt=rt.length;else{const jt=rt.lastIndexOf(M),Oe=rt.lastIndexOf(w);kt=Math.max(jt,Oe)+1}kt>0&&(de=kt,Be=Ue.slice(0,de).join(""),Qe=this._getTextWidth(Be))}if(Be=Be.trimRight(),this._addTextLine(Be),te=Math.max(te,Qe),ye+=Q,this._shouldHandleEllipsis(ye)){this._tryToAddEllipsisToLastLine();break}if(oe=s(oe).slice(de).join("").trimLeft(),oe.length>0&&(ve=this._getTextWidth(oe),ve<=fe)){this._addTextLine(oe),ye+=Q,te=Math.max(te,ve);break}}else break}else this._addTextLine(oe),ye+=Q,te=Math.max(te,ve),this._shouldHandleEllipsis(ye)&&he<xe-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),ae&&ye+Q>pe)break}this.textHeight=ee,this.textWidth=te}_shouldHandleEllipsis(U){const ee=+this.fontSize(),te=this.lineHeight()*ee,Q=this.attrs.height,Z=Q!==c&&Q!==void 0,re=this.padding(),ne=Q-re*2;return!(this.wrap()!==O)||Z&&U+te>ne}_tryToAddEllipsisToLastLine(){const U=this.attrs.width,ee=U!==c&&U!==void 0,te=this.padding(),Q=U-te*2,Z=this.ellipsis(),re=this.textArr[this.textArr.length-1];!re||!Z||(ee&&(this._getTextWidth(re.text+N)<Q||(re.text=re.text.slice(0,re.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(re.text+N))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const U=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,ee=this.hasShadow();return U&&ee?!0:super._useBufferCanvas()}}return Qu.Text=z,z.prototype._fillFunc=W,z.prototype._strokeFunc=X,z.prototype.className=_,z.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"],(0,o._registerNode)(z),n.Factory.overWriteSetter(z,"width",(0,a.getNumberOrAutoValidator)()),n.Factory.overWriteSetter(z,"height",(0,a.getNumberOrAutoValidator)()),n.Factory.addGetterSetter(z,"direction",f),n.Factory.addGetterSetter(z,"fontFamily","Arial"),n.Factory.addGetterSetter(z,"fontSize",12,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(z,"fontStyle",d),n.Factory.addGetterSetter(z,"fontVariant",d),n.Factory.addGetterSetter(z,"padding",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(z,"align",S),n.Factory.addGetterSetter(z,"verticalAlign",b),n.Factory.addGetterSetter(z,"lineHeight",1,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(z,"wrap",F),n.Factory.addGetterSetter(z,"ellipsis",!1,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(z,"letterSpacing",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(z,"text","",(0,a.getStringValidator)()),n.Factory.addGetterSetter(z,"textDecoration",""),Qu}var Ff={},Fy;function O9(){if(Fy)return Ff;Fy=1,Object.defineProperty(Ff,"__esModule",{value:!0}),Ff.TextPath=void 0;const e=Lr(),n=qt(),t=bn(),r=Mv(),a=Ew(),o=Vt(),s=Dt(),c="",m="normal";function f(E){E.fillText(this.partialText,0,0)}function v(E){E.strokeText(this.partialText,0,0)}class y extends t.Shape{constructor(w){super(w),this.dummyCanvas=e.Util.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return r.Path.getPathLength(this.dataArray)}_getPointAtLength(w){if(!this.attrs.data)return null;const S=this.pathLength;return w-1>S?null:r.Path.getPointAtLengthOfDataArray(w,this.dataArray)}_readDataAttribute(){this.dataArray=r.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(w){w.setAttr("font",this._getContextFont()),w.setAttr("textBaseline",this.textBaseline()),w.setAttr("textAlign","left"),w.save();const S=this.textDecoration(),x=this.fill(),_=this.fontSize(),b=this.glyphInfo;S==="underline"&&w.beginPath();for(let g=0;g<b.length;g++){w.save();const h=b[g].p0;w.translate(h.x,h.y),w.rotate(b[g].rotation),this.partialText=b[g].text,w.fillStrokeShape(this),S==="underline"&&(g===0&&w.moveTo(0,_/2+1),w.lineTo(_,_/2+1)),w.restore()}S==="underline"&&(w.strokeStyle=x,w.lineWidth=_/20,w.stroke()),w.restore()}_hitFunc(w){w.beginPath();const S=this.glyphInfo;if(S.length>=1){const x=S[0].p0;w.moveTo(x.x,x.y)}for(let x=0;x<S.length;x++){const _=S[x].p1;w.lineTo(_.x,_.y)}w.setAttr("lineWidth",this.fontSize()),w.setAttr("strokeStyle",this.colorKey),w.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return e.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(w){return a.Text.prototype.setText.call(this,w)}_getContextFont(){return a.Text.prototype._getContextFont.call(this)}_getTextSize(w){const x=this.dummyCanvas.getContext("2d");x.save(),x.font=this._getContextFont();const _=x.measureText(w);return x.restore(),{width:_.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:w,height:S}=this._getTextSize(this.attrs.text);if(this.textWidth=w,this.textHeight=S,this.glyphInfo=[],!this.attrs.data)return null;const x=this.letterSpacing(),_=this.align(),b=this.kerningFunc(),g=Math.max(this.textWidth+((this.attrs.text||"").length-1)*x,0);let h=0;_==="center"&&(h=Math.max(0,this.pathLength/2-g/2)),_==="right"&&(h=Math.max(0,this.pathLength-g));const d=(0,a.stringToArray)(this.text());let P=h;for(let M=0;M<d.length;M++){const T=this._getPointAtLength(P);if(!T)return;let I=this._getTextSize(d[M]).width+x;if(d[M]===" "&&_==="justify"){const R=this.text().split(" ").length-1;I+=(this.pathLength-g)/R}const F=this._getPointAtLength(P+I);if(!F)return;const k=r.Path.getLineLength(T.x,T.y,F.x,F.y);let O=0;if(b)try{O=b(d[M-1],d[M])*this.fontSize()}catch{O=0}T.x+=O,F.x+=O,this.textWidth+=O;const N=r.Path.getPointOnLine(O+k/2,T.x,T.y,F.x,F.y),A=Math.atan2(F.y-T.y,F.x-T.x);this.glyphInfo.push({transposeX:N.x,transposeY:N.y,text:d[M],rotation:A,p0:T,p1:F}),P+=I}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const w=[];this.glyphInfo.forEach(function(P){w.push(P.p0.x),w.push(P.p0.y),w.push(P.p1.x),w.push(P.p1.y)});let S=w[0]||0,x=w[0]||0,_=w[1]||0,b=w[1]||0,g,h;for(let P=0;P<w.length/2;P++)g=w[P*2],h=w[P*2+1],S=Math.min(S,g),x=Math.max(x,g),_=Math.min(_,h),b=Math.max(b,h);const d=this.fontSize();return{x:S-d/2,y:_-d/2,width:x-S+d,height:b-_+d}}destroy(){return e.Util.releaseCanvas(this.dummyCanvas),super.destroy()}}return Ff.TextPath=y,y.prototype._fillFunc=f,y.prototype._strokeFunc=v,y.prototype._fillFuncHit=f,y.prototype._strokeFuncHit=v,y.prototype.className="TextPath",y.prototype._attrsAffectingSize=["text","fontSize","data"],(0,s._registerNode)(y),n.Factory.addGetterSetter(y,"data"),n.Factory.addGetterSetter(y,"fontFamily","Arial"),n.Factory.addGetterSetter(y,"fontSize",12,(0,o.getNumberValidator)()),n.Factory.addGetterSetter(y,"fontStyle",m),n.Factory.addGetterSetter(y,"align","left"),n.Factory.addGetterSetter(y,"letterSpacing",0,(0,o.getNumberValidator)()),n.Factory.addGetterSetter(y,"textBaseline","middle"),n.Factory.addGetterSetter(y,"fontVariant",m),n.Factory.addGetterSetter(y,"text",c),n.Factory.addGetterSetter(y,"textDecoration",""),n.Factory.addGetterSetter(y,"kerningFunc",void 0),Ff}var zf={},zy;function P9(){if(zy)return zf;zy=1,Object.defineProperty(zf,"__esModule",{value:!0}),zf.Transformer=void 0;const e=Lr(),n=qt(),t=Hr(),r=bn(),a=Sw(),o=Tv(),s=Dt(),c=Vt(),m=Dt(),f="tr-konva",v=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(I=>I+`.${f}`).join(" "),y="nodesRect",E=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],w={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},S="ontouchstart"in s.Konva._global;function x(I,F,k){if(I==="rotater")return k;F+=e.Util.degToRad(w[I]||0);const O=(e.Util.radToDeg(F)%360+360)%360;return e.Util._inRange(O,315+22.5,360)||e.Util._inRange(O,0,22.5)?"ns-resize":e.Util._inRange(O,45-22.5,45+22.5)?"nesw-resize":e.Util._inRange(O,90-22.5,90+22.5)?"ew-resize":e.Util._inRange(O,135-22.5,135+22.5)?"nwse-resize":e.Util._inRange(O,180-22.5,180+22.5)?"ns-resize":e.Util._inRange(O,225-22.5,225+22.5)?"nesw-resize":e.Util._inRange(O,270-22.5,270+22.5)?"ew-resize":e.Util._inRange(O,315-22.5,315+22.5)?"nwse-resize":(e.Util.error("Transformer has unknown angle for cursor detection: "+O),"pointer")}const _=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function b(I){return{x:I.x+I.width/2*Math.cos(I.rotation)+I.height/2*Math.sin(-I.rotation),y:I.y+I.height/2*Math.cos(I.rotation)+I.width/2*Math.sin(I.rotation)}}function g(I,F,k){const O=k.x+(I.x-k.x)*Math.cos(F)-(I.y-k.y)*Math.sin(F),N=k.y+(I.x-k.x)*Math.sin(F)+(I.y-k.y)*Math.cos(F);return{...I,rotation:I.rotation+F,x:O,y:N}}function h(I,F){const k=b(I);return g(I,F,k)}function d(I,F,k){let O=F;for(let N=0;N<I.length;N++){const A=s.Konva.getAngle(I[N]),R=Math.abs(A-F)%(Math.PI*2);Math.min(R,Math.PI*2-R)<k&&(O=A)}return O}let P=0;class M extends o.Group{constructor(F){super(F),this._movingAnchorName=null,this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(v,this.update),this.getNode()&&this.update()}attachTo(F){return this.setNode(F),this}setNode(F){return e.Util.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([F])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return f+this._id}setNodes(F=[]){this._nodes&&this._nodes.length&&this.detach();const k=F.filter(N=>N.isAncestorOf(this)?(e.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=F=k,F.length===1&&this.useSingleNodeRotation()?this.rotation(F[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(N=>{const A=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(N._attrsAffectingSize.length){const R=N._attrsAffectingSize.map(L=>L+"Change."+this._getEventNamespace()).join(" ");N.on(R,A)}N.on(E.map(R=>R+`.${this._getEventNamespace()}`).join(" "),A),N.on(`absoluteTransformChange.${this._getEventNamespace()}`,A),this._proxyDrag(N)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(F){let k;F.on(`dragstart.${this._getEventNamespace()}`,O=>{k=F.getAbsolutePosition(),!this.isDragging()&&F!==this.findOne(".back")&&this.startDrag(O,!1)}),F.on(`dragmove.${this._getEventNamespace()}`,O=>{if(!k)return;const N=F.getAbsolutePosition(),A=N.x-k.x,R=N.y-k.y;this.nodes().forEach(L=>{if(L===F||L.isDragging())return;const V=L.getAbsolutePosition();L.setAbsolutePosition({x:V.x+A,y:V.y+R}),L.startDrag(O)}),k=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(F=>{F.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(y),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(y,this.__getNodeRect)}__getNodeShape(F,k=this.rotation(),O){const N=F.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),A=F.getAbsoluteScale(O),R=F.getAbsolutePosition(O),L=N.x*A.x-F.offsetX()*A.x,V=N.y*A.y-F.offsetY()*A.y,G=(s.Konva.getAngle(F.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),W={x:R.x+L*Math.cos(G)+V*Math.sin(-G),y:R.y+V*Math.cos(G)+L*Math.sin(G),width:N.width*A.x,height:N.height*A.y,rotation:G};return g(W,-s.Konva.getAngle(k),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const k=[];this.nodes().map(G=>{const W=G.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),X=[{x:W.x,y:W.y},{x:W.x+W.width,y:W.y},{x:W.x+W.width,y:W.y+W.height},{x:W.x,y:W.y+W.height}],q=G.getAbsoluteTransform();X.forEach(function(z){const Y=q.point(z);k.push(Y)})});const O=new e.Transform;O.rotate(-s.Konva.getAngle(this.rotation()));let N=1/0,A=1/0,R=-1/0,L=-1/0;k.forEach(function(G){const W=O.point(G);N===void 0&&(N=R=W.x,A=L=W.y),N=Math.min(N,W.x),A=Math.min(A,W.y),R=Math.max(R,W.x),L=Math.max(L,W.y)}),O.invert();const V=O.point({x:N,y:A});return{x:V.x,y:V.y,width:R-N,height:L-A,rotation:s.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(),_.forEach(F=>{this._createAnchor(F)}),this._createAnchor("rotater")}_createAnchor(F){const k=new a.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:F+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:S?10:"auto"}),O=this;k.on("mousedown touchstart",function(N){O._handleMouseDown(N)}),k.on("dragstart",N=>{k.stopDrag(),N.cancelBubble=!0}),k.on("dragend",N=>{N.cancelBubble=!0}),k.on("mouseenter",()=>{const N=s.Konva.getAngle(this.rotation()),A=this.rotateAnchorCursor(),R=x(F,N,A);k.getStage().content&&(k.getStage().content.style.cursor=R),this._cursorChange=!0}),k.on("mouseout",()=>{k.getStage().content&&(k.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(k)}_createBack(){const F=new r.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(k,O){const N=O.getParent(),A=N.padding();k.beginPath(),k.rect(-A,-A,O.width()+A*2,O.height()+A*2),k.moveTo(O.width()/2,-A),N.rotateEnabled()&&N.rotateLineVisible()&&k.lineTo(O.width()/2,-N.rotateAnchorOffset()*e.Util._sign(O.height())-A),k.fillStrokeShape(O)},hitFunc:(k,O)=>{if(!this.shouldOverdrawWholeArea())return;const N=this.padding();k.beginPath(),k.rect(-N,-N,O.width()+N*2,O.height()+N*2),k.fillStrokeShape(O)}});this.add(F),this._proxyDrag(F),F.on("dragstart",k=>{k.cancelBubble=!0}),F.on("dragmove",k=>{k.cancelBubble=!0}),F.on("dragend",k=>{k.cancelBubble=!0}),this.on("dragmove",k=>{this.update()})}_handleMouseDown(F){if(this._transforming)return;this._movingAnchorName=F.target.name().split(" ")[0];const k=this._getNodeRect(),O=k.width,N=k.height,A=Math.sqrt(Math.pow(O,2)+Math.pow(N,2));this.sin=Math.abs(N/A),this.cos=Math.abs(O/A),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 R=F.target.getAbsolutePosition(),L=F.target.getStage().getPointerPosition();this._anchorDragOffset={x:L.x-R.x,y:L.y-R.y},P++,this._fire("transformstart",{evt:F.evt,target:this.getNode()}),this._nodes.forEach(V=>{V._fire("transformstart",{evt:F.evt,target:V})})}_handleMouseMove(F){let k,O,N;const A=this.findOne("."+this._movingAnchorName),R=A.getStage();R.setPointersPositions(F);const L=R.getPointerPosition();let V={x:L.x-this._anchorDragOffset.x,y:L.y-this._anchorDragOffset.y};const G=A.getAbsolutePosition();this.anchorDragBoundFunc()&&(V=this.anchorDragBoundFunc()(G,V,F)),A.setAbsolutePosition(V);const W=A.getAbsolutePosition();if(G.x===W.x&&G.y===W.y)return;if(this._movingAnchorName==="rotater"){const ne=this._getNodeRect();k=A.x()-ne.width/2,O=-A.y()+ne.height/2;let ae=Math.atan2(-O,k)+Math.PI/2;ne.height<0&&(ae-=Math.PI);const fe=s.Konva.getAngle(this.rotation())+ae,pe=s.Konva.getAngle(this.rotationSnapTolerance()),we=d(this.rotationSnaps(),fe,pe)-ne.rotation,je=h(ne,we);this._fitNodesInto(je,F);return}const X=this.shiftBehavior();let q;X==="inverted"?q=this.keepRatio()&&!F.shiftKey:X==="none"?q=this.keepRatio():q=this.keepRatio()||F.shiftKey;var te=this.centeredScaling()||F.altKey;if(this._movingAnchorName==="top-left"){if(q){var z=te?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};N=Math.sqrt(Math.pow(z.x-A.x(),2)+Math.pow(z.y-A.y(),2));var Y=this.findOne(".top-left").x()>z.x?-1:1,U=this.findOne(".top-left").y()>z.y?-1:1;k=N*this.cos*Y,O=N*this.sin*U,this.findOne(".top-left").x(z.x-k),this.findOne(".top-left").y(z.y-O)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(A.y());else if(this._movingAnchorName==="top-right"){if(q){var z=te?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};N=Math.sqrt(Math.pow(A.x()-z.x,2)+Math.pow(z.y-A.y(),2));var Y=this.findOne(".top-right").x()<z.x?-1:1,U=this.findOne(".top-right").y()>z.y?-1:1;k=N*this.cos*Y,O=N*this.sin*U,this.findOne(".top-right").x(z.x+k),this.findOne(".top-right").y(z.y-O)}var ee=A.position();this.findOne(".top-left").y(ee.y),this.findOne(".bottom-right").x(ee.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(A.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(A.x());else if(this._movingAnchorName==="bottom-left"){if(q){var z=te?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};N=Math.sqrt(Math.pow(z.x-A.x(),2)+Math.pow(A.y()-z.y,2));var Y=z.x<A.x()?-1:1,U=A.y()<z.y?-1:1;k=N*this.cos*Y,O=N*this.sin*U,A.x(z.x-k),A.y(z.y+O)}ee=A.position(),this.findOne(".top-left").x(ee.x),this.findOne(".bottom-right").y(ee.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(A.y());else if(this._movingAnchorName==="bottom-right"){if(q){var z=te?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};N=Math.sqrt(Math.pow(A.x()-z.x,2)+Math.pow(A.y()-z.y,2));var Y=this.findOne(".bottom-right").x()<z.x?-1:1,U=this.findOne(".bottom-right").y()<z.y?-1:1;k=N*this.cos*Y,O=N*this.sin*U,this.findOne(".bottom-right").x(z.x+k),this.findOne(".bottom-right").y(z.y+O)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var te=this.centeredScaling()||F.altKey;if(te){const ne=this.findOne(".top-left"),ae=this.findOne(".bottom-right"),ue=ne.x(),fe=ne.y(),pe=this.getWidth()-ae.x(),ye=this.getHeight()-ae.y();ae.move({x:-ue,y:-fe}),ne.move({x:pe,y:ye})}const Q=this.findOne(".top-left").getAbsolutePosition();k=Q.x,O=Q.y;const Z=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),re=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:k,y:O,width:Z,height:re,rotation:s.Konva.getAngle(this.rotation())},F)}_handleMouseUp(F){this._removeEvents(F)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(F){var k;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));const O=this.getNode();P--,this._fire("transformend",{evt:F,target:O}),(k=this.getLayer())===null||k===void 0||k.batchDraw(),O&&this._nodes.forEach(N=>{var A;N._fire("transformend",{evt:F,target:N}),(A=N.getLayer())===null||A===void 0||A.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(F,k){const O=this._getNodeRect(),N=1;if(e.Util._inRange(F.width,-this.padding()*2-N,N)){this.update();return}if(e.Util._inRange(F.height,-this.padding()*2-N,N)){this.update();return}const A=new e.Transform;if(A.rotate(s.Konva.getAngle(this.rotation())),this._movingAnchorName&&F.width<0&&this._movingAnchorName.indexOf("left")>=0){const q=A.point({x:-this.padding()*2,y:0});F.x+=q.x,F.y+=q.y,F.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=q.x,this._anchorDragOffset.y-=q.y}else if(this._movingAnchorName&&F.width<0&&this._movingAnchorName.indexOf("right")>=0){const q=A.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=q.x,this._anchorDragOffset.y-=q.y,F.width+=this.padding()*2}if(this._movingAnchorName&&F.height<0&&this._movingAnchorName.indexOf("top")>=0){const q=A.point({x:0,y:-this.padding()*2});F.x+=q.x,F.y+=q.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=q.x,this._anchorDragOffset.y-=q.y,F.height+=this.padding()*2}else if(this._movingAnchorName&&F.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const q=A.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=q.x,this._anchorDragOffset.y-=q.y,F.height+=this.padding()*2}if(this.boundBoxFunc()){const q=this.boundBoxFunc()(O,F);q?F=q:e.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const R=1e7,L=new e.Transform;L.translate(O.x,O.y),L.rotate(O.rotation),L.scale(O.width/R,O.height/R);const V=new e.Transform,G=F.width/R,W=F.height/R;this.flipEnabled()===!1?(V.translate(F.x,F.y),V.rotate(F.rotation),V.translate(F.width<0?F.width:0,F.height<0?F.height:0),V.scale(Math.abs(G),Math.abs(W))):(V.translate(F.x,F.y),V.rotate(F.rotation),V.scale(G,W));const X=V.multiply(L.invert());this._nodes.forEach(q=>{var z;const Y=q.getParent().getAbsoluteTransform(),U=q.getTransform().copy();U.translate(q.offsetX(),q.offsetY());const ee=new e.Transform;ee.multiply(Y.copy().invert()).multiply(X).multiply(Y).multiply(U);const te=ee.decompose();q.setAttrs(te),(z=q.getLayer())===null||z===void 0||z.batchDraw()}),this.rotation(e.Util._getRotation(F.rotation)),this._nodes.forEach(q=>{this._fire("transform",{evt:k,target:q}),q._fire("transform",{evt:k,target:q})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(F,k){this.findOne(F).setAttrs(k)}update(){var F;const k=this._getNodeRect();this.rotation(e.Util._getRotation(k.rotation));const O=k.width,N=k.height,A=this.enabledAnchors(),R=this.resizeEnabled(),L=this.padding(),V=this.anchorSize(),G=this.find("._anchor");G.forEach(X=>{X.setAttrs({width:V,height:V,offsetX:V/2,offsetY:V/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:V/2+L,offsetY:V/2+L,visible:R&&A.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:O/2,y:0,offsetY:V/2+L,visible:R&&A.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:O,y:0,offsetX:V/2-L,offsetY:V/2+L,visible:R&&A.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:N/2,offsetX:V/2+L,visible:R&&A.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:O,y:N/2,offsetX:V/2-L,visible:R&&A.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:N,offsetX:V/2+L,offsetY:V/2-L,visible:R&&A.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:O/2,y:N,offsetY:V/2-L,visible:R&&A.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:O,y:N,offsetX:V/2-L,offsetY:V/2-L,visible:R&&A.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:O/2,y:-this.rotateAnchorOffset()*e.Util._sign(N)-L,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:O,height:N,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const W=this.anchorStyleFunc();W&&G.forEach(X=>{W(X)}),(F=this.getLayer())===null||F===void 0||F.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const F=this.findOne("."+this._movingAnchorName);F&&F.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),o.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return t.Node.prototype.toObject.call(this)}clone(F){return t.Node.prototype.clone.call(this,F)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}zf.Transformer=M,M.isTransforming=()=>P>0;function T(I){return I instanceof Array||e.Util.warn("enabledAnchors value should be an array"),I instanceof Array&&I.forEach(function(F){_.indexOf(F)===-1&&e.Util.warn("Unknown anchor name: "+F+". Available names are: "+_.join(", "))}),I||[]}return M.prototype.className="Transformer",(0,m._registerNode)(M),n.Factory.addGetterSetter(M,"enabledAnchors",_,T),n.Factory.addGetterSetter(M,"flipEnabled",!0,(0,c.getBooleanValidator)()),n.Factory.addGetterSetter(M,"resizeEnabled",!0),n.Factory.addGetterSetter(M,"anchorSize",10,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(M,"rotateEnabled",!0),n.Factory.addGetterSetter(M,"rotateLineVisible",!0),n.Factory.addGetterSetter(M,"rotationSnaps",[]),n.Factory.addGetterSetter(M,"rotateAnchorOffset",50,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(M,"rotateAnchorCursor","crosshair"),n.Factory.addGetterSetter(M,"rotationSnapTolerance",5,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(M,"borderEnabled",!0),n.Factory.addGetterSetter(M,"anchorStroke","rgb(0, 161, 255)"),n.Factory.addGetterSetter(M,"anchorStrokeWidth",1,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(M,"anchorFill","white"),n.Factory.addGetterSetter(M,"anchorCornerRadius",0,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(M,"borderStroke","rgb(0, 161, 255)"),n.Factory.addGetterSetter(M,"borderStrokeWidth",1,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(M,"borderDash"),n.Factory.addGetterSetter(M,"keepRatio",!0),n.Factory.addGetterSetter(M,"shiftBehavior","default"),n.Factory.addGetterSetter(M,"centeredScaling",!1),n.Factory.addGetterSetter(M,"ignoreStroke",!1),n.Factory.addGetterSetter(M,"padding",0,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(M,"nodes"),n.Factory.addGetterSetter(M,"node"),n.Factory.addGetterSetter(M,"boundBoxFunc"),n.Factory.addGetterSetter(M,"anchorDragBoundFunc"),n.Factory.addGetterSetter(M,"anchorStyleFunc"),n.Factory.addGetterSetter(M,"shouldOverdrawWholeArea",!1),n.Factory.addGetterSetter(M,"useSingleNodeRotation",!0),n.Factory.backCompat(M,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"}),zf}var Bf={},By;function C9(){if(By)return Bf;By=1,Object.defineProperty(Bf,"__esModule",{value:!0}),Bf.Wedge=void 0;const e=qt(),n=bn(),t=Dt(),r=Vt(),a=Dt();class o extends n.Shape{_sceneFunc(c){c.beginPath(),c.arc(0,0,this.radius(),0,t.Konva.getAngle(this.angle()),this.clockwise()),c.lineTo(0,0),c.closePath(),c.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(c){this.radius(c/2)}setHeight(c){this.radius(c/2)}}return Bf.Wedge=o,o.prototype.className="Wedge",o.prototype._centroid=!0,o.prototype._attrsAffectingSize=["radius"],(0,a._registerNode)(o),e.Factory.addGetterSetter(o,"radius",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(o,"angle",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(o,"clockwise",!1),e.Factory.backCompat(o,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"}),Bf}var Uf={},Uy;function k9(){if(Uy)return Uf;Uy=1,Object.defineProperty(Uf,"__esModule",{value:!0}),Uf.Blur=void 0;const e=qt(),n=Hr(),t=Vt();function r(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const a=[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],o=[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 s(m,f){const v=m.data,y=m.width,E=m.height;let w,S,x,_,b,g,h,d,P,M,T,I,F,k,O,N,A,R,L,V,G,W,X,q;const z=f+f+1,Y=y-1,U=E-1,ee=f+1,te=ee*(ee+1)/2,Q=new r,Z=a[f],re=o[f];let ne=null,ae=Q,ue=null,fe=null;for(x=1;x<z;x++)ae=ae.next=new r,x===ee&&(ne=ae);for(ae.next=Q,h=g=0,S=0;S<E;S++){for(N=A=R=L=d=P=M=T=0,I=ee*(V=v[g]),F=ee*(G=v[g+1]),k=ee*(W=v[g+2]),O=ee*(X=v[g+3]),d+=te*V,P+=te*G,M+=te*W,T+=te*X,ae=Q,x=0;x<ee;x++)ae.r=V,ae.g=G,ae.b=W,ae.a=X,ae=ae.next;for(x=1;x<ee;x++)_=g+((Y<x?Y:x)<<2),d+=(ae.r=V=v[_])*(q=ee-x),P+=(ae.g=G=v[_+1])*q,M+=(ae.b=W=v[_+2])*q,T+=(ae.a=X=v[_+3])*q,N+=V,A+=G,R+=W,L+=X,ae=ae.next;for(ue=Q,fe=ne,w=0;w<y;w++)v[g+3]=X=T*Z>>re,X!==0?(X=255/X,v[g]=(d*Z>>re)*X,v[g+1]=(P*Z>>re)*X,v[g+2]=(M*Z>>re)*X):v[g]=v[g+1]=v[g+2]=0,d-=I,P-=F,M-=k,T-=O,I-=ue.r,F-=ue.g,k-=ue.b,O-=ue.a,_=h+((_=w+f+1)<Y?_:Y)<<2,N+=ue.r=v[_],A+=ue.g=v[_+1],R+=ue.b=v[_+2],L+=ue.a=v[_+3],d+=N,P+=A,M+=R,T+=L,ue=ue.next,I+=V=fe.r,F+=G=fe.g,k+=W=fe.b,O+=X=fe.a,N-=V,A-=G,R-=W,L-=X,fe=fe.next,g+=4;h+=y}for(w=0;w<y;w++){for(A=R=L=N=P=M=T=d=0,g=w<<2,I=ee*(V=v[g]),F=ee*(G=v[g+1]),k=ee*(W=v[g+2]),O=ee*(X=v[g+3]),d+=te*V,P+=te*G,M+=te*W,T+=te*X,ae=Q,x=0;x<ee;x++)ae.r=V,ae.g=G,ae.b=W,ae.a=X,ae=ae.next;for(b=y,x=1;x<=f;x++)g=b+w<<2,d+=(ae.r=V=v[g])*(q=ee-x),P+=(ae.g=G=v[g+1])*q,M+=(ae.b=W=v[g+2])*q,T+=(ae.a=X=v[g+3])*q,N+=V,A+=G,R+=W,L+=X,ae=ae.next,x<U&&(b+=y);for(g=w,ue=Q,fe=ne,S=0;S<E;S++)_=g<<2,v[_+3]=X=T*Z>>re,X>0?(X=255/X,v[_]=(d*Z>>re)*X,v[_+1]=(P*Z>>re)*X,v[_+2]=(M*Z>>re)*X):v[_]=v[_+1]=v[_+2]=0,d-=I,P-=F,M-=k,T-=O,I-=ue.r,F-=ue.g,k-=ue.b,O-=ue.a,_=w+((_=S+ee)<U?_:U)*y<<2,d+=N+=ue.r=v[_],P+=A+=ue.g=v[_+1],M+=R+=ue.b=v[_+2],T+=L+=ue.a=v[_+3],ue=ue.next,I+=V=fe.r,F+=G=fe.g,k+=W=fe.b,O+=X=fe.a,N-=V,A-=G,R-=W,L-=X,fe=fe.next,g+=y}}const c=function(f){const v=Math.round(this.blurRadius());v>0&&s(f,v)};return Uf.Blur=c,e.Factory.addGetterSetter(n.Node,"blurRadius",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Uf}var qf={},qy;function A9(){if(qy)return qf;qy=1,Object.defineProperty(qf,"__esModule",{value:!0}),qf.Brighten=void 0;const e=qt(),n=Hr(),t=Vt(),r=function(a){const o=this.brightness()*255,s=a.data,c=s.length;for(let m=0;m<c;m+=4)s[m]+=o,s[m+1]+=o,s[m+2]+=o};return qf.Brighten=r,e.Factory.addGetterSetter(n.Node,"brightness",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),qf}var Hf={},Hy;function T9(){if(Hy)return Hf;Hy=1,Object.defineProperty(Hf,"__esModule",{value:!0}),Hf.Contrast=void 0;const e=qt(),n=Hr(),t=Vt(),r=function(a){const o=Math.pow((this.contrast()+100)/100,2),s=a.data,c=s.length;let m=150,f=150,v=150;for(let y=0;y<c;y+=4)m=s[y],f=s[y+1],v=s[y+2],m/=255,m-=.5,m*=o,m+=.5,m*=255,f/=255,f-=.5,f*=o,f+=.5,f*=255,v/=255,v-=.5,v*=o,v+=.5,v*=255,m=m<0?0:m>255?255:m,f=f<0?0:f>255?255:f,v=v<0?0:v>255?255:v,s[y]=m,s[y+1]=f,s[y+2]=v};return Hf.Contrast=r,e.Factory.addGetterSetter(n.Node,"contrast",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Hf}var Gf={},Gy;function R9(){if(Gy)return Gf;Gy=1,Object.defineProperty(Gf,"__esModule",{value:!0}),Gf.Emboss=void 0;const e=qt(),n=Hr(),t=Lr(),r=Vt(),a=function(o){const s=this.embossStrength()*10,c=this.embossWhiteLevel()*255,m=this.embossDirection(),f=this.embossBlend(),v=o.data,y=o.width,E=o.height,w=y*4;let S=0,x=0,_=E;switch(m){case"top-left":S=-1,x=-1;break;case"top":S=-1,x=0;break;case"top-right":S=-1,x=1;break;case"right":S=0,x=1;break;case"bottom-right":S=1,x=1;break;case"bottom":S=1,x=0;break;case"bottom-left":S=1,x=-1;break;case"left":S=0,x=-1;break;default:t.Util.error("Unknown emboss direction: "+m)}do{const b=(_-1)*w;let g=S;_+g<1&&(g=0),_+g>E&&(g=0);const h=(_-1+g)*y*4;let d=y;do{const P=b+(d-1)*4;let M=x;d+M<1&&(M=0),d+M>y&&(M=0);const T=h+(d-1+M)*4,I=v[P]-v[T],F=v[P+1]-v[T+1],k=v[P+2]-v[T+2];let O=I;const N=O>0?O:-O,A=F>0?F:-F,R=k>0?k:-k;if(A>N&&(O=F),R>N&&(O=k),O*=s,f){const L=v[P]+O,V=v[P+1]+O,G=v[P+2]+O;v[P]=L>255?255:L<0?0:L,v[P+1]=V>255?255:V<0?0:V,v[P+2]=G>255?255:G<0?0:G}else{let L=c-O;L<0?L=0:L>255&&(L=255),v[P]=v[P+1]=v[P+2]=L}}while(--d)}while(--_)};return Gf.Emboss=a,e.Factory.addGetterSetter(n.Node,"embossStrength",.5,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"embossWhiteLevel",.5,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"embossDirection","top-left",void 0,e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"embossBlend",!1,void 0,e.Factory.afterSetFilter),Gf}var Vf={},Vy;function M9(){if(Vy)return Vf;Vy=1,Object.defineProperty(Vf,"__esModule",{value:!0}),Vf.Enhance=void 0;const e=qt(),n=Hr(),t=Vt();function r(o,s,c,m,f){const v=c-s,y=f-m;if(v===0)return m+y/2;if(y===0)return m;let E=(o-s)/v;return E=y*E+m,E}const a=function(o){const s=o.data,c=s.length;let m=s[0],f=m,v,y=s[1],E=y,w,S=s[2],x=S,_;const b=this.enhance();if(b===0)return;for(let O=0;O<c;O+=4)v=s[O+0],v<m?m=v:v>f&&(f=v),w=s[O+1],w<y?y=w:w>E&&(E=w),_=s[O+2],_<S?S=_:_>x&&(x=_);f===m&&(f=255,m=0),E===y&&(E=255,y=0),x===S&&(x=255,S=0);let g,h,d,P,M,T,I,F,k;b>0?(h=f+b*(255-f),d=m-b*(m-0),M=E+b*(255-E),T=y-b*(y-0),F=x+b*(255-x),k=S-b*(S-0)):(g=(f+m)*.5,h=f+b*(f-g),d=m+b*(m-g),P=(E+y)*.5,M=E+b*(E-P),T=y+b*(y-P),I=(x+S)*.5,F=x+b*(x-I),k=S+b*(S-I));for(let O=0;O<c;O+=4)s[O+0]=r(s[O+0],m,f,d,h),s[O+1]=r(s[O+1],y,E,T,M),s[O+2]=r(s[O+2],S,x,k,F)};return Vf.Enhance=a,e.Factory.addGetterSetter(n.Node,"enhance",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Vf}var $f={},$y;function L9(){if($y)return $f;$y=1,Object.defineProperty($f,"__esModule",{value:!0}),$f.Grayscale=void 0;const e=function(n){const t=n.data,r=t.length;for(let a=0;a<r;a+=4){const o=.34*t[a]+.5*t[a+1]+.16*t[a+2];t[a]=o,t[a+1]=o,t[a+2]=o}};return $f.Grayscale=e,$f}var Wf={},Wy;function N9(){if(Wy)return Wf;Wy=1,Object.defineProperty(Wf,"__esModule",{value:!0}),Wf.HSL=void 0;const e=qt(),n=Hr(),t=Vt();e.Factory.addGetterSetter(n.Node,"hue",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"saturation",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"luminance",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter);const r=function(a){const o=a.data,s=o.length,c=1,m=Math.pow(2,this.saturation()),f=Math.abs(this.hue()+360)%360,v=this.luminance()*127,y=c*m*Math.cos(f*Math.PI/180),E=c*m*Math.sin(f*Math.PI/180),w=.299*c+.701*y+.167*E,S=.587*c-.587*y+.33*E,x=.114*c-.114*y-.497*E,_=.299*c-.299*y-.328*E,b=.587*c+.413*y+.035*E,g=.114*c-.114*y+.293*E,h=.299*c-.3*y+1.25*E,d=.587*c-.586*y-1.05*E,P=.114*c+.886*y-.2*E;let M,T,I,F;for(let k=0;k<s;k+=4)M=o[k+0],T=o[k+1],I=o[k+2],F=o[k+3],o[k+0]=w*M+S*T+x*I+v,o[k+1]=_*M+b*T+g*I+v,o[k+2]=h*M+d*T+P*I+v,o[k+3]=F};return Wf.HSL=r,Wf}var Yf={},Yy;function I9(){if(Yy)return Yf;Yy=1,Object.defineProperty(Yf,"__esModule",{value:!0}),Yf.HSV=void 0;const e=qt(),n=Hr(),t=Vt(),r=function(a){const o=a.data,s=o.length,c=Math.pow(2,this.value()),m=Math.pow(2,this.saturation()),f=Math.abs(this.hue()+360)%360,v=c*m*Math.cos(f*Math.PI/180),y=c*m*Math.sin(f*Math.PI/180),E=.299*c+.701*v+.167*y,w=.587*c-.587*v+.33*y,S=.114*c-.114*v-.497*y,x=.299*c-.299*v-.328*y,_=.587*c+.413*v+.035*y,b=.114*c-.114*v+.293*y,g=.299*c-.3*v+1.25*y,h=.587*c-.586*v-1.05*y,d=.114*c+.886*v-.2*y;let P,M,T,I;for(let F=0;F<s;F+=4)P=o[F+0],M=o[F+1],T=o[F+2],I=o[F+3],o[F+0]=E*P+w*M+S*T,o[F+1]=x*P+_*M+b*T,o[F+2]=g*P+h*M+d*T,o[F+3]=I};return Yf.HSV=r,e.Factory.addGetterSetter(n.Node,"hue",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"saturation",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"value",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Yf}var Kf={},Ky;function j9(){if(Ky)return Kf;Ky=1,Object.defineProperty(Kf,"__esModule",{value:!0}),Kf.Invert=void 0;const e=function(n){const t=n.data,r=t.length;for(let a=0;a<r;a+=4)t[a]=255-t[a],t[a+1]=255-t[a+1],t[a+2]=255-t[a+2]};return Kf.Invert=e,Kf}var Xf={},Xy;function D9(){if(Xy)return Xf;Xy=1,Object.defineProperty(Xf,"__esModule",{value:!0}),Xf.Kaleidoscope=void 0;const e=qt(),n=Hr(),t=Lr(),r=Vt(),a=function(c,m,f){const v=c.data,y=m.data,E=c.width,w=c.height,S=f.polarCenterX||E/2,x=f.polarCenterY||w/2;let _=Math.sqrt(S*S+x*x),b=E-S,g=w-x;const h=Math.sqrt(b*b+g*g);_=h>_?h:_;const d=w,P=E,M=360/P*Math.PI/180;for(let T=0;T<P;T+=1){const I=Math.sin(T*M),F=Math.cos(T*M);for(let k=0;k<d;k+=1){b=Math.floor(S+_*k/d*F),g=Math.floor(x+_*k/d*I);let O=(g*E+b)*4;const N=v[O+0],A=v[O+1],R=v[O+2],L=v[O+3];O=(T+k*E)*4,y[O+0]=N,y[O+1]=A,y[O+2]=R,y[O+3]=L}}},o=function(c,m,f){const v=c.data,y=m.data,E=c.width,w=c.height,S=f.polarCenterX||E/2,x=f.polarCenterY||w/2;let _=Math.sqrt(S*S+x*x),b=E-S,g=w-x;const h=Math.sqrt(b*b+g*g);_=h>_?h:_;const d=w,P=E,M=0;let T,I;for(b=0;b<E;b+=1)for(g=0;g<w;g+=1){const F=b-S,k=g-x,O=Math.sqrt(F*F+k*k)*d/_;let N=(Math.atan2(k,F)*180/Math.PI+360+M)%360;N=N*P/360,T=Math.floor(N),I=Math.floor(O);let A=(I*E+T)*4;const R=v[A+0],L=v[A+1],V=v[A+2],G=v[A+3];A=(g*E+b)*4,y[A+0]=R,y[A+1]=L,y[A+2]=V,y[A+3]=G}},s=function(c){const m=c.width,f=c.height;let v,y,E,w,S,x,_,b,g,h,d=Math.round(this.kaleidoscopePower());const P=Math.round(this.kaleidoscopeAngle()),M=Math.floor(m*(P%360)/360);if(d<1)return;const T=t.Util.createCanvasElement();T.width=m,T.height=f;const I=T.getContext("2d").getImageData(0,0,m,f);t.Util.releaseCanvas(T),a(c,I,{polarCenterX:m/2,polarCenterY:f/2});let F=m/Math.pow(2,d);for(;F<=8;)F=F*2,d-=1;F=Math.ceil(F);let k=F,O=0,N=k,A=1;for(M+F>m&&(O=k,N=0,A=-1),y=0;y<f;y+=1)for(v=O;v!==N;v+=A)E=Math.round(v+M)%m,g=(m*y+E)*4,S=I.data[g+0],x=I.data[g+1],_=I.data[g+2],b=I.data[g+3],h=(m*y+v)*4,I.data[h+0]=S,I.data[h+1]=x,I.data[h+2]=_,I.data[h+3]=b;for(y=0;y<f;y+=1)for(k=Math.floor(F),w=0;w<d;w+=1){for(v=0;v<k+1;v+=1)g=(m*y+v)*4,S=I.data[g+0],x=I.data[g+1],_=I.data[g+2],b=I.data[g+3],h=(m*y+k*2-v-1)*4,I.data[h+0]=S,I.data[h+1]=x,I.data[h+2]=_,I.data[h+3]=b;k*=2}o(I,c,{})};return Xf.Kaleidoscope=s,e.Factory.addGetterSetter(n.Node,"kaleidoscopePower",2,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"kaleidoscopeAngle",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),Xf}var Zf={},Zy;function F9(){if(Zy)return Zf;Zy=1,Object.defineProperty(Zf,"__esModule",{value:!0}),Zf.Mask=void 0;const e=qt(),n=Hr(),t=Vt();function r(E,w,S){let x=(S*E.width+w)*4;const _=[];return _.push(E.data[x++],E.data[x++],E.data[x++],E.data[x++]),_}function a(E,w){return Math.sqrt(Math.pow(E[0]-w[0],2)+Math.pow(E[1]-w[1],2)+Math.pow(E[2]-w[2],2))}function o(E){const w=[0,0,0];for(let S=0;S<E.length;S++)w[0]+=E[S][0],w[1]+=E[S][1],w[2]+=E[S][2];return w[0]/=E.length,w[1]/=E.length,w[2]/=E.length,w}function s(E,w){const S=r(E,0,0),x=r(E,E.width-1,0),_=r(E,0,E.height-1),b=r(E,E.width-1,E.height-1),g=w||10;if(a(S,x)<g&&a(x,b)<g&&a(b,_)<g&&a(_,S)<g){const h=o([x,S,b,_]),d=[];for(let P=0;P<E.width*E.height;P++){const M=a(h,[E.data[P*4],E.data[P*4+1],E.data[P*4+2]]);d[P]=M<g?0:255}return d}}function c(E,w){for(let S=0;S<E.width*E.height;S++)E.data[4*S+3]=w[S]}function m(E,w,S){const x=[1,1,1,1,0,1,1,1,1],_=Math.round(Math.sqrt(x.length)),b=Math.floor(_/2),g=[];for(let h=0;h<S;h++)for(let d=0;d<w;d++){const P=h*w+d;let M=0;for(let T=0;T<_;T++)for(let I=0;I<_;I++){const F=h+T-b,k=d+I-b;if(F>=0&&F<S&&k>=0&&k<w){const O=F*w+k,N=x[T*_+I];M+=E[O]*N}}g[P]=M===255*8?255:0}return g}function f(E,w,S){const x=[1,1,1,1,1,1,1,1,1],_=Math.round(Math.sqrt(x.length)),b=Math.floor(_/2),g=[];for(let h=0;h<S;h++)for(let d=0;d<w;d++){const P=h*w+d;let M=0;for(let T=0;T<_;T++)for(let I=0;I<_;I++){const F=h+T-b,k=d+I-b;if(F>=0&&F<S&&k>=0&&k<w){const O=F*w+k,N=x[T*_+I];M+=E[O]*N}}g[P]=M>=255*4?255:0}return g}function v(E,w,S){const x=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],_=Math.round(Math.sqrt(x.length)),b=Math.floor(_/2),g=[];for(let h=0;h<S;h++)for(let d=0;d<w;d++){const P=h*w+d;let M=0;for(let T=0;T<_;T++)for(let I=0;I<_;I++){const F=h+T-b,k=d+I-b;if(F>=0&&F<S&&k>=0&&k<w){const O=F*w+k,N=x[T*_+I];M+=E[O]*N}}g[P]=M}return g}const y=function(E){const w=this.threshold();let S=s(E,w);return S&&(S=m(S,E.width,E.height),S=f(S,E.width,E.height),S=v(S,E.width,E.height),c(E,S)),E};return Zf.Mask=y,e.Factory.addGetterSetter(n.Node,"threshold",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Zf}var Qf={},Qy;function z9(){if(Qy)return Qf;Qy=1,Object.defineProperty(Qf,"__esModule",{value:!0}),Qf.Noise=void 0;const e=qt(),n=Hr(),t=Vt(),r=function(a){const o=this.noise()*255,s=a.data,c=s.length,m=o/2;for(let f=0;f<c;f+=4)s[f+0]+=m-2*m*Math.random(),s[f+1]+=m-2*m*Math.random(),s[f+2]+=m-2*m*Math.random()};return Qf.Noise=r,e.Factory.addGetterSetter(n.Node,"noise",.2,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Qf}var Jf={},Jy;function B9(){if(Jy)return Jf;Jy=1,Object.defineProperty(Jf,"__esModule",{value:!0}),Jf.Pixelate=void 0;const e=qt(),n=Lr(),t=Hr(),r=Vt(),a=function(o){let s=Math.ceil(this.pixelSize()),c=o.width,m=o.height,f,v,y,E,w,S,x,_=Math.ceil(c/s),b=Math.ceil(m/s),g,h,d,P,M,T,I,F=o.data;if(s<=0){n.Util.error("pixelSize value can not be <= 0");return}for(M=0;M<_;M+=1)for(T=0;T<b;T+=1){for(E=0,w=0,S=0,x=0,g=M*s,h=g+s,d=T*s,P=d+s,I=0,f=g;f<h;f+=1)if(!(f>=c))for(v=d;v<P;v+=1)v>=m||(y=(c*v+f)*4,E+=F[y+0],w+=F[y+1],S+=F[y+2],x+=F[y+3],I+=1);for(E=E/I,w=w/I,S=S/I,x=x/I,f=g;f<h;f+=1)if(!(f>=c))for(v=d;v<P;v+=1)v>=m||(y=(c*v+f)*4,F[y+0]=E,F[y+1]=w,F[y+2]=S,F[y+3]=x)}};return Jf.Pixelate=a,e.Factory.addGetterSetter(t.Node,"pixelSize",8,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),Jf}var ed={},e2;function U9(){if(e2)return ed;e2=1,Object.defineProperty(ed,"__esModule",{value:!0}),ed.Posterize=void 0;const e=qt(),n=Hr(),t=Vt(),r=function(a){const o=Math.round(this.levels()*254)+1,s=a.data,c=s.length,m=255/o;for(let f=0;f<c;f+=1)s[f]=Math.floor(s[f]/m)*m};return ed.Posterize=r,e.Factory.addGetterSetter(n.Node,"levels",.5,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),ed}var td={},t2;function q9(){if(t2)return td;t2=1,Object.defineProperty(td,"__esModule",{value:!0}),td.RGB=void 0;const e=qt(),n=Hr(),t=Vt(),r=function(a){const o=a.data,s=o.length,c=this.red(),m=this.green(),f=this.blue();for(let v=0;v<s;v+=4){const y=(.34*o[v]+.5*o[v+1]+.16*o[v+2])/255;o[v]=y*c,o[v+1]=y*m,o[v+2]=y*f,o[v+3]=o[v+3]}};return td.RGB=r,e.Factory.addGetterSetter(n.Node,"red",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(n.Node,"green",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(n.Node,"blue",0,t.RGBComponent,e.Factory.afterSetFilter),td}var rd={},r2;function H9(){if(r2)return rd;r2=1,Object.defineProperty(rd,"__esModule",{value:!0}),rd.RGBA=void 0;const e=qt(),n=Hr(),t=Vt(),r=function(a){const o=a.data,s=o.length,c=this.red(),m=this.green(),f=this.blue(),v=this.alpha();for(let y=0;y<s;y+=4){const E=1-v;o[y]=c*v+o[y]*E,o[y+1]=m*v+o[y+1]*E,o[y+2]=f*v+o[y+2]*E}};return rd.RGBA=r,e.Factory.addGetterSetter(n.Node,"red",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(n.Node,"green",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(n.Node,"blue",0,t.RGBComponent,e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"alpha",1,function(a){return this._filterUpToDate=!1,a>1?1:a<0?0:a}),rd}var nd={},n2;function G9(){if(n2)return nd;n2=1,Object.defineProperty(nd,"__esModule",{value:!0}),nd.Sepia=void 0;const e=function(n){const t=n.data,r=t.length;for(let a=0;a<r;a+=4){const o=t[a+0],s=t[a+1],c=t[a+2];t[a+0]=Math.min(255,o*.393+s*.769+c*.189),t[a+1]=Math.min(255,o*.349+s*.686+c*.168),t[a+2]=Math.min(255,o*.272+s*.534+c*.131)}};return nd.Sepia=e,nd}var id={},i2;function V9(){if(i2)return id;i2=1,Object.defineProperty(id,"__esModule",{value:!0}),id.Solarize=void 0;const e=function(n){const t=n.data,r=n.width,a=n.height,o=r*4;let s=a;do{const c=(s-1)*o;let m=r;do{const f=c+(m-1)*4;let v=t[f],y=t[f+1],E=t[f+2];v>127&&(v=255-v),y>127&&(y=255-y),E>127&&(E=255-E),t[f]=v,t[f+1]=y,t[f+2]=E}while(--m)}while(--s)};return id.Solarize=e,id}var ad={},a2;function $9(){if(a2)return ad;a2=1,Object.defineProperty(ad,"__esModule",{value:!0}),ad.Threshold=void 0;const e=qt(),n=Hr(),t=Vt(),r=function(a){const o=this.threshold()*255,s=a.data,c=s.length;for(let m=0;m<c;m+=1)s[m]=s[m]<o?0:255};return ad.Threshold=r,e.Factory.addGetterSetter(n.Node,"threshold",.5,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),ad}var o2;function W9(){if(o2)return bf;o2=1,Object.defineProperty(bf,"__esModule",{value:!0}),bf.Konva=void 0;const e=nv(),n=p9(),t=v9(),r=m9(),a=y9(),o=b9(),s=w9(),c=_w(),m=Mv(),f=Sw(),v=_9(),y=S9(),E=E9(),w=x9(),S=Ew(),x=O9(),_=P9(),b=C9(),g=k9(),h=A9(),d=T9(),P=R9(),M=M9(),T=L9(),I=N9(),F=I9(),k=j9(),O=D9(),N=F9(),A=z9(),R=B9(),L=U9(),V=q9(),G=H9(),W=G9(),X=V9(),q=$9();return bf.Konva=e.Konva.Util._assign(e.Konva,{Arc:n.Arc,Arrow:t.Arrow,Circle:r.Circle,Ellipse:a.Ellipse,Image:o.Image,Label:s.Label,Tag:s.Tag,Line:c.Line,Path:m.Path,Rect:f.Rect,RegularPolygon:v.RegularPolygon,Ring:y.Ring,Sprite:E.Sprite,Star:w.Star,Text:S.Text,TextPath:x.TextPath,Transformer:_.Transformer,Wedge:b.Wedge,Filters:{Blur:g.Blur,Brighten:h.Brighten,Contrast:d.Contrast,Emboss:P.Emboss,Enhance:M.Enhance,Grayscale:T.Grayscale,HSL:I.HSL,HSV:F.HSV,Invert:k.Invert,Kaleidoscope:O.Kaleidoscope,Mask:N.Mask,Noise:A.Noise,Pixelate:R.Pixelate,Posterize:L.Posterize,RGB:V.RGB,RGBA:G.RGBA,Sepia:W.Sepia,Solarize:X.Solarize,Threshold:q.Threshold}}),bf}var Y9=sp.exports,l2;function Mi(){if(l2)return sp.exports;l2=1,Object.defineProperty(Y9,"__esModule",{value:!0});const e=W9();return sp.exports=e.Konva,sp.exports}Mi();var rp={exports:{}},s2;function K9(){return s2||(s2=1,function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.Konva=void 0;var t=nv();Object.defineProperty(n,"Konva",{enumerable:!0,get:function(){return t.Konva}});const r=nv();e.exports=r.Konva}(rp,rp.exports)),rp.exports}var X9=K9();const Rd=jd(X9);var Xg={exports:{}};/**
|
|
44
44
|
* @license React
|
|
45
45
|
* react-reconciler.production.min.js
|
|
46
46
|
*
|
|
@@ -66,21 +66,21 @@ No matching component was found for:
|
|
|
66
66
|
*
|
|
67
67
|
* This source code is licensed under the MIT license found in the
|
|
68
68
|
* LICENSE file in the root directory of this source tree.
|
|
69
|
-
*/var f2;function t7(){return f2||(f2=1,Ul.ConcurrentRoot=1,Ul.ContinuousEventPriority=4,Ul.DefaultEventPriority=16,Ul.DiscreteEventPriority=1,Ul.IdleEventPriority=536870912,Ul.LegacyRoot=0),Ul}var d2;function r7(){return d2||(d2=1,Qg.exports=t7()),Qg.exports}var
|
|
69
|
+
*/var f2;function t7(){return f2||(f2=1,Ul.ConcurrentRoot=1,Ul.ContinuousEventPriority=4,Ul.DefaultEventPriority=16,Ul.DiscreteEventPriority=1,Ul.IdleEventPriority=536870912,Ul.LegacyRoot=0),Ul}var d2;function r7(){return d2||(d2=1,Qg.exports=t7()),Qg.exports}var xw=r7(),n7=Dt();const h2={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let p2=!1,g2=!1;const Lv=".react-konva-event";let Ow=!1;function i7(e){Ow=e}const a7=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
|
|
70
70
|
Position of a node will be changed during drag&drop, so you should update state of the react app as well.
|
|
71
71
|
Consider to add onDragMove or onDragEnd events.
|
|
72
72
|
For more info see: https://github.com/konvajs/react-konva/issues/256
|
|
73
73
|
`,o7=`ReactKonva: You are using "zIndex" attribute for a Konva node.
|
|
74
74
|
react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
|
|
75
75
|
For more info see: https://github.com/konvajs/react-konva/issues/194
|
|
76
|
-
`,l7={};function Bp(e,n,t=l7){if(!p2&&"zIndex"in n&&(console.warn(o7),p2=!0),!g2&&n.draggable){var r=n.x!==void 0||n.y!==void 0,a=n.onDragEnd||n.onDragMove;r&&!a&&(console.warn(a7),g2=!0)}for(var o in t)if(!h2[o]){var s=o.slice(0,2)==="on",c=t[o]!==n[o];if(s&&c){var m=o.substr(2).toLowerCase();m.substr(0,7)==="content"&&(m="content"+m.substr(7,1).toUpperCase()+m.substr(8)),e.off(m,t[o])}var f=!n.hasOwnProperty(o);f&&e.setAttr(o,void 0)}var v=O5||n._useStrictMode,y={},E=!1;const w={};for(var o in n)if(!h2[o]){var s=o.slice(0,2)==="on",S=t[o]!==n[o];if(s&&S){var m=o.substr(2).toLowerCase();m.substr(0,7)==="content"&&(m="content"+m.substr(7,1).toUpperCase()+m.substr(8)),n[o]&&(w[m]=n[o])}!s&&(n[o]!==t[o]||v&&n[o]!==e.getAttr(o))&&(E=!0,y[o]=n[o])}E&&(e.setAttrs(y),Ql(e));for(var m in w)e.on(m+Lv,w[m])}function Ql(e){if(!n7.Konva.autoDrawEnabled){var n=e.getLayer()||e.getStage();n&&n.batchDraw()}}var Jg=lv();const P5={},s7={};Rd.Node.prototype._applyProps=Bp;function u7(e,n){if(typeof n=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${n}`);return}e.add(n),Ql(e)}function c7(e,n,t){let r=Rd[e];r||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" 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`),r=Rd.Group);const a={},o={};for(var s in n){var c=s.slice(0,2)==="on";c?o[s]=n[s]:a[s]=n[s]}const m=new r(a);return Bp(m,o),m}function f7(e,n,t){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function d7(e,n,t){return!1}function h7(e){return e}function p7(){return null}function g7(){return null}function v7(e,n,t,r){return s7}function m7(){}function y7(e){}function b7(e,n){return!1}function w7(){return P5}function _7(){return P5}const S7=setTimeout,E7=clearTimeout,x7=-1;function O7(e,n){return!1}const P7=!1,C7=!0,k7=!0;function A7(e,n){n.parent===e?n.moveToTop():e.add(n),Ql(e)}function T7(e,n){n.parent===e?n.moveToTop():e.add(n),Ql(e)}function C5(e,n,t){n._remove(),e.add(n),n.setZIndex(t.getZIndex()),Ql(e)}function R7(e,n,t){C5(e,n,t)}function M7(e,n){n.destroy(),n.off(Lv),Ql(e)}function L7(e,n){n.destroy(),n.off(Lv),Ql(e)}function N7(e,n,t){console.error(`Text components are not yet supported in ReactKonva. You text is: "${t}"`)}function I7(e,n,t){}function j7(e,n,t,r,a){Bp(e,a,r)}function D7(e){e.hide(),Ql(e)}function F7(e){}function z7(e,n){(n.visible==null||n.visible)&&e.show()}function B7(e,n){}function U7(e){}function q7(){}const H7=()=>x5.DefaultEventPriority,G7=Object.freeze(Object.defineProperty({__proto__:null,appendChild:A7,appendChildToContainer:T7,appendInitialChild:u7,cancelTimeout:E7,clearContainer:U7,commitMount:I7,commitTextUpdate:N7,commitUpdate:j7,createInstance:c7,createTextInstance:f7,detachDeletedInstance:q7,finalizeInitialChildren:d7,getChildHostContext:_7,getCurrentEventPriority:H7,getPublicInstance:h7,getRootHostContext:w7,hideInstance:D7,hideTextInstance:F7,idlePriority:Jg.unstable_IdlePriority,insertBefore:C5,insertInContainerBefore:R7,isPrimaryRenderer:P7,noTimeout:x7,now:Jg.unstable_now,prepareForCommit:p7,preparePortalMount:g7,prepareUpdate:v7,removeChild:M7,removeChildFromContainer:L7,resetAfterCommit:m7,resetTextContent:y7,run:Jg.unstable_runWithPriority,scheduleTimeout:S7,shouldDeprioritizeSubtree:b7,shouldSetTextContent:O7,supportsMutation:k7,unhideInstance:z7,unhideTextInstance:B7,warnsIfNotActing:C7},Symbol.toStringTag,{value:"Module"}));var V7=Object.defineProperty,$7=Object.defineProperties,W7=Object.getOwnPropertyDescriptors,v2=Object.getOwnPropertySymbols,Y7=Object.prototype.hasOwnProperty,K7=Object.prototype.propertyIsEnumerable,m2=(e,n,t)=>n in e?V7(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,y2=(e,n)=>{for(var t in n||(n={}))Y7.call(n,t)&&m2(e,t,n[t]);if(v2)for(var t of v2(n))K7.call(n,t)&&m2(e,t,n[t]);return e},X7=(e,n)=>$7(e,W7(n)),b2,w2;typeof window<"u"&&((b2=window.document)!=null&&b2.createElement||((w2=window.navigator)==null?void 0:w2.product)==="ReactNative")?Sr.useLayoutEffect:Sr.useEffect;function k5(e,n,t){if(!e)return;if(t(e)===!0)return e;let r=e.child;for(;r;){const a=k5(r,n,t);if(a)return a;r=r.sibling}}function A5(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const _2=console.error;console.error=function(){const e=[...arguments].join("");if(e!=null&&e.startsWith("Warning:")&&e.includes("useContext")){console.error=_2;return}return _2.apply(this,arguments)};const Nv=A5(Sr.createContext(null));class T5 extends Sr.Component{render(){return Sr.createElement(Nv.Provider,{value:this._reactInternals},this.props.children)}}function Z7(){const e=Sr.useContext(Nv);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const n=Sr.useId();return Sr.useMemo(()=>{for(const r of[e,e==null?void 0:e.alternate]){if(!r)continue;const a=k5(r,!1,o=>{let s=o.memoizedState;for(;s;){if(s.memoizedState===n)return!0;s=s.next}});if(a)return a}},[e,n])}function Q7(){const e=Z7(),[n]=Sr.useState(()=>new Map);n.clear();let t=e;for(;t;){if(t.type&&typeof t.type=="object"){const a=t.type._context===void 0&&t.type.Provider===t.type?t.type:t.type._context;a&&a!==Nv&&!n.has(a)&&n.set(a,Sr.useContext(A5(a)))}t=t.return}return n}function R5(){const e=Q7();return Sr.useMemo(()=>Array.from(e.keys()).reduce((n,t)=>r=>Sr.createElement(n,null,Sr.createElement(t.Provider,X7(y2({},r),{value:e.get(t)}))),n=>Sr.createElement(T5,y2({},n))),[e])}function J7(e){const n=Gt.useRef({});return Gt.useLayoutEffect(()=>{n.current=e}),Gt.useLayoutEffect(()=>()=>{n.current={}},[]),n.current}const eS=e=>{const n=Gt.useRef(),t=Gt.useRef(),r=Gt.useRef(),a=J7(e),o=R5(),s=c=>{const{forwardedRef:m}=e;m&&(typeof m=="function"?m(c):m.current=c)};return Gt.useLayoutEffect(()=>(t.current=new Rd.Stage({width:e.width,height:e.height,container:n.current}),s(t.current),r.current=ic.createContainer(t.current,x5.LegacyRoot,!1,null),ic.updateContainer(Gt.createElement(o,{},e.children),r.current),()=>{Rd.isBrowser&&(s(null),ic.updateContainer(null,r.current,null),t.current.destroy())}),[]),Gt.useLayoutEffect(()=>{s(t.current),Bp(t.current,e,a),ic.updateContainer(Gt.createElement(o,{},e.children),r.current,null)}),Gt.createElement("div",{ref:n,id:e.id,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},tS="Layer",rS="FastLayer",_p="Group",nS="Label",iS="Rect",aS="Circle",oS="Ellipse",lS="Wedge",sS="Line",uS="Sprite",cS="Image",fS="Text",dS="TextPath",hS="Star",pS="Ring",gS="Arc",vS="Tag",mS="Path",yS="RegularPolygon",bS="Arrow",wS="Shape",_S="Transformer",ic=e7(G7);ic.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:Gt.version,rendererPackageName:"react-konva"});const SS=Gt.forwardRef((e,n)=>Gt.createElement(T5,{},Gt.createElement(eS,{...e,forwardedRef:n}))),ES=i7,xS=Object.freeze(Object.defineProperty({__proto__:null,Arc:gS,Arrow:bS,Circle:aS,Ellipse:oS,FastLayer:rS,Group:_p,Image:cS,KonvaRenderer:ic,Label:nS,Layer:tS,Line:sS,Path:mS,Rect:iS,RegularPolygon:yS,Ring:pS,Shape:wS,Sprite:uS,Stage:SS,Star:hS,Tag:vS,Text:fS,TextPath:dS,Transformer:_S,Wedge:lS,useStrictMode:ES},Symbol.toStringTag,{value:"Module"})),oo=Yl(xS);var e0,S2;function Up(){if(S2)return e0;S2=1;var e=Or();return e0=function(t,r,a){const o=e.useRef("loading"),s=e.useRef(),[c,m]=e.useState(0),f=e.useRef(),v=e.useRef(),y=e.useRef();return(f.current!==t||v.current!==r||y.current!==a)&&(o.current="loading",s.current=void 0,f.current=t,v.current=r,y.current=a),e.useLayoutEffect(function(){if(!t)return;var E=document.createElement("img");function w(){o.current="loaded",s.current=E,m(Math.random())}function S(){o.current="failed",s.current=void 0,m(Math.random())}return E.addEventListener("load",w),E.addEventListener("error",S),r&&(E.crossOrigin=r),a&&(E.referrerPolicy=a),E.src=t,function(){E.removeEventListener("load",w),E.removeEventListener("error",S)}},[t,r,a]),[s.current,o.current]},e0}var od={},ld={},OS=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)n.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(t[r[a]]=e[r[a]]);return t};const PS=e=>{const n=window.getComputedStyle(e).position;return!(n==="absolute"||n==="relative")};function M5(e=()=>{}){const n=Gt.useRef(e);return n.current=e,Gt.useCallback((...t)=>n.current.apply(null,t),[])}const CS=({children:e,groupProps:n,divProps:t,transform:r,transformFunc:a,parentNodeFunc:o})=>{const s=R5(),c=Gt.useRef(null),[m]=Gt.useState(()=>document.createElement("div")),f=Gt.useMemo(()=>cw.createRoot(m),[m]),v=r??!0,y=M5(()=>{if(v&&c.current){let _=c.current.getAbsoluteTransform().decompose();a&&(_=a(_)),m.style.position="absolute",m.style.zIndex="10",m.style.top="0px",m.style.left="0px",m.style.transform=`translate(${_.x}px, ${_.y}px) rotate(${_.rotation}deg) scaleX(${_.scaleX}) scaleY(${_.scaleY})`,m.style.transformOrigin="top left"}else m.style.position="",m.style.zIndex="",m.style.top="",m.style.left="",m.style.transform="",m.style.transformOrigin="";const E=t||{},{style:w}=E,S=OS(E,["style"]);Object.assign(m.style,w),Object.assign(m,S)});return Gt.useLayoutEffect(()=>{var E;const w=c.current;if(!w)return;const S=o?o({stage:w.getStage()}):(E=w.getStage())===null||E===void 0?void 0:E.container();if(S)return S.appendChild(m),v&&PS(S)&&(S.style.position="relative"),w.on("absoluteTransformChange",y),y(),()=>{var x;w.off("absoluteTransformChange",y),(x=m.parentNode)===null||x===void 0||x.removeChild(m)}},[v,o]),Gt.useLayoutEffect(()=>{y()},[t,a]),Gt.useLayoutEffect(()=>{f.render(Gt.createElement(s,null,e))}),Gt.useLayoutEffect(()=>()=>{setTimeout(()=>{f.unmount()})},[]),Gt.createElement(_p,Object.assign({ref:c},n))},kS=({selector:e,enabled:n,children:t})=>{const r=Gt.useRef(null),a=Gt.useRef(null),o=Gt.useRef(null),s=n??!0;return Gt.useLayoutEffect(()=>{if(!r.current||!a.current)return;o.current=a.current;const m=r.current.getStage().findOne(e);s&&m?a.current.moveTo(m):a.current.moveTo(r.current);const f=r.current.getLayer();if(f&&(f.batchDraw(),m)){const v=m.getLayer();if(!v)return;v.batchDraw()}},[e,s]),Gt.useEffect(()=>()=>{var c;(c=o.current)===null||c===void 0||c.destroy()},[]),Gt.createElement(_p,{name:"_outer_portal",ref:r},Gt.createElement(_p,{name:"_inner_portal",ref:a},t))};var AS=Up();const TS=jd(AS),RS=Object.freeze(Object.defineProperty({__proto__:null,Html:CS,Portal:kS,useEvent:M5,useImage:TS},Symbol.toStringTag,{value:"Module"})),wc=Yl(RS);function MS(e,n){return Object.keys(e.values).forEach(t=>e.values[t]=e.values[t]&&parseFloat(e.values[t].toFixed(n))),e}function L5(e,n,t){const r=n-1,a=t[I5(r,t.length)];return a.marker!=="Z"?a:L5(e,r,t)}function N5(e,n,t){const r=n+1,a=t[I5(r,t.length)];return a.marker==="Z"?N5(e,r,t):a}function LS(e,n,t){let r=t[n-1]||{values:{x:0,y:0}};if(e.marker===e.marker.toLowerCase())switch(e.marker=e.marker.toUpperCase(),e.marker){case"M":e.values.x+=r.values.x,e.values.y+=r.values.y;break;case"L":case"A":e.values.x+=r.values.x,e.values.y+=r.values.y;break;case"H":e.marker="L",e.values.x+=r.values.x,e.values.y=r.values.y;break;case"V":e.marker="L",e.values.x=r.values.x,e.values.y+=r.values.y;break;case"C":e.values.x+=r.values.x,e.values.y+=r.values.y,e.values.x1+=r.values.x,e.values.y1+=r.values.y,e.values.x2+=r.values.x,e.values.y2+=r.values.y;break;case"S":e.values.x+=r.values.x,e.values.y+=r.values.y,e.values.x2+=r.values.x,e.values.y2+=r.values.y;break;case"Q":e.values.x+=r.values.x,e.values.y+=r.values.y,e.values.x1+=r.values.x,e.values.y1+=r.values.y;break;case"T":e.values.x+=r.values.x,e.values.y+=r.values.y;break}else if(e.marker===e.marker.toUpperCase())switch(e.marker){case"H":e.marker="L",e.values.y=r.values.y;break;case"V":e.marker="L",e.values.x=r.values.x;break}if(e.marker==="Z"){let o=function(c,m){return c[m].marker==="M"?c[m]:o(c,m-1)};var a=o;let s=o(t,n);e.values.x=s.values.x,e.values.y=s.values.y}return e}function NS(e,n){const t=[];switch(e.toUpperCase()){case"M":for(let r=0;r<n.length;r+=2){let a;e===e.toUpperCase()?a=r===0?"M":"L":a=r===0?"m":"l",t.push({marker:a,values:{x:n[r],y:n[r+1]}})}break;case"L":for(let r=0;r<n.length;r+=2)t.push({marker:e,values:{x:n[r],y:n[r+1]}});break;case"H":for(let r=0;r<n.length;r++)t.push({marker:e,values:{x:n[r],y:0}});break;case"V":for(let r=0;r<n.length;r++)t.push({marker:e,values:{x:0,y:n[r]}});break;case"C":for(let r=0;r<n.length;r+=6)t.push({marker:e,values:{x1:n[r],y1:n[r+1],x2:n[r+2],y2:n[r+3],x:n[r+4],y:n[r+5]}});break;case"S":for(let r=0;r<n.length;r+=4)t.push({marker:e,values:{x2:n[r],y2:n[r+1],x:n[r+2],y:n[r+3]}});break;case"Q":for(let r=0;r<n.length;r+=4)t.push({marker:e,values:{x1:n[r],y1:n[r+1],x:n[r+2],y:n[r+3]}});break;case"T":for(let r=0;r<n.length;r+=2)t.push({marker:e,values:{x:n[r],y:n[r+1]}});break;case"A":for(let r=0;r<n.length;r+=7)t.push({marker:e,values:{radiusX:n[r],radiusY:n[r+1],rotation:n[r+2],largeArc:n[r+3],sweep:n[r+4],x:n[r+5],y:n[r+6]}});break;case"Z":t.push({marker:e,values:{x:0,y:0}});break}return t}function I5(e,n){return(e%n+n)%n}function IS(e,n,t){if(n!==0&&e.marker==="L"){let r=t[n-1];["x","y"].every(o=>Math.round(Math.abs(r.values[o]-e.values[o]))===0)&&(e.overlap=!0)}return e}function iv(e,n){const t=["x","y"].every(r=>Math.round(Math.abs(e[n].values[r]-e[0].values[r]))===0);e[n].marker==="L"&&t&&(e[n].overlap=!0,iv(e,n-1)),e[n].marker==="Z"&&iv(e,n-1)}function jS(e,n,t){const r=x2(e.values,t.values),a=x2(n.values,e.values);return Math.min(a,r)}function E2(e,n){return Math.atan2(n.x-e.x,n.y-e.y)}function x2(e,n){const t=e.x-n.x,r=e.y-n.y;return Math.sqrt(Math.pow(t,2)+Math.pow(r,2))}function O2(e,n){return Math.sin(e)*n}function P2(e,n){return Math.cos(e)*n}function C2(e,n){const t=n/Math.tan(e);return t===1/0||t===-1/0||isNaN(t)?n:t}function DS(e,n){return n*Math.tan(e)}function FS(e,n){let t,r=0,a=e*(180/Math.PI);return a<0&&a>=-180||a>180&&a<360?t=C2(e/2,-n):(t=C2(e/2,n),r=1,t===1/0&&(t=n)),{offset:t,sweepFlag:r}}function zS(e){const n=["radiusX","radiusY","rotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return e.map(t=>{let r="";if(t.marker!=="Z"){const a=Object.keys(t.values);r=n.filter(o=>a.indexOf(o)!==-1).map(o=>t.values[o]).join()}return`${t.marker}${r}`}).join("").trim()}function j5(e){const n=/[MmLlSsQqLlHhVvCcSsQqTtAaZz]/g,t=/-?[0-9]*\.?\d+/g;return[...e.matchAll(n)].map(r=>({marker:r[0],index:r.index})).reduceRight((r,a)=>{const o=e.substring(a.index,r.length?r[r.length-1].index:e.length);return r.concat([{marker:a.marker,index:a.index,chunk:o.length>0?o.substr(1,o.length-1):o}])},[]).reverse().flatMap(r=>{const a=r.chunk.match(t),o=a?a.map(parseFloat):[];return NS(r.marker,o)}).map(LS)}function D5(e,n,t){let r=[],a=[];return t&&e.forEach(o=>MS(o,t)),e.forEach(o=>{o.marker==="M"&&r.push([]),r[r.length-1].push(o)}),r.forEach(o=>{o.map(IS),iv(o,o.length-1);const s=o[o.length-1].marker=="Z";o.filter(c=>!c.overlap).map((c,m,f)=>{const y=L5(c,m,f),E=N5(c,m,f),w=E2(c.values,y.values),S=E2(c.values,E.values),x=S-w,_=x*(180/Math.PI),b=jS(c,y,E),g=Math.abs(DS(x/2,b/2)),h=Math.min(n,g),d=FS(x,h),P=d.offset,M=d.sweepFlag,T=(m==0||m==f.length-1)&&!s;switch(c.marker){case"M":case"L":const I=[c.values.x+O2(w,P),c.values.y+P2(w,P)],F=[c.values.x+O2(S,P),c.values.y+P2(S,P)];T?a.push({marker:c.marker,values:c.values}):a.push({marker:c.marker,values:{x:parseFloat(I[0].toFixed(3)),y:parseFloat(I[1].toFixed(3))}}),!T&&(E.marker==="L"||E.marker==="M")&&a.push({marker:"A",radius:h,values:{radiusX:parseFloat(h.toFixed(3)),radiusY:parseFloat(h.toFixed(3)),rotation:_,largeArc:0,sweep:M,x:parseFloat(F[0].toFixed(3)),y:parseFloat(F[1].toFixed(3))}});break;case"C":case"S":case"Q":case"T":case"A":case"Z":a.push({marker:c.marker,values:c.values});break}})}),{path:zS(a),commands:a}}function BS(e,n,t){return D5([...j5(e)],n,t)}const US=Object.freeze(Object.defineProperty({__proto__:null,parsePath:j5,roundCommands:D5,roundCorners:BS},Symbol.toStringTag,{value:"Module"})),qS=Yl(US);var pa={},sd={},np={},k2;function HS(){if(k2)return np;k2=1;var e=e||{};e.stringify=function(){var n={"visit_linear-gradient":function(t){return n.visit_gradient(t)},"visit_repeating-linear-gradient":function(t){return n.visit_gradient(t)},"visit_radial-gradient":function(t){return n.visit_gradient(t)},"visit_repeating-radial-gradient":function(t){return n.visit_gradient(t)},visit_gradient:function(t){var r=n.visit(t.orientation);return r&&(r+=", "),t.type+"("+r+n.visit(t.colorStops)+")"},visit_shape:function(t){var r=t.value,a=n.visit(t.at),o=n.visit(t.style);return o&&(r+=" "+o),a&&(r+=" at "+a),r},"visit_default-radial":function(t){var r="",a=n.visit(t.at);return a&&(r+=a),r},"visit_extent-keyword":function(t){var r=t.value,a=n.visit(t.at);return a&&(r+=" at "+a),r},"visit_position-keyword":function(t){return t.value},visit_position:function(t){return n.visit(t.value.x)+" "+n.visit(t.value.y)},"visit_%":function(t){return t.value+"%"},visit_em:function(t){return t.value+"em"},visit_px:function(t){return t.value+"px"},visit_literal:function(t){return n.visit_color(t.value,t)},visit_hex:function(t){return n.visit_color("#"+t.value,t)},visit_rgb:function(t){return n.visit_color("rgb("+t.value.join(", ")+")",t)},visit_rgba:function(t){return n.visit_color("rgba("+t.value.join(", ")+")",t)},visit_color:function(t,r){var a=t,o=n.visit(r.length);return o&&(a+=" "+o),a},visit_angular:function(t){return t.value+"deg"},visit_directional:function(t){return"to "+t.value},visit_array:function(t){var r="",a=t.length;return t.forEach(function(o,s){r+=n.visit(o),s<a-1&&(r+=", ")}),r},visit:function(t){if(!t)return"";var r="";if(t instanceof Array)return n.visit_array(t,r);if(t.type){var a=n["visit_"+t.type];if(a)return a(t);throw Error("Missing visitor visit_"+t.type)}else throw Error("Invalid node.")}};return function(t){return n.visit(t)}}();var e=e||{};return e.parse=function(){var n={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},t="";function r(W){var X=new Error(t+": "+W);throw X.source=t,X}function a(){var W=o();return t.length>0&&r("Invalid input not EOF"),W}function o(){return d(s)}function s(){return c("linear-gradient",n.linearGradient,f)||c("repeating-linear-gradient",n.repeatingLinearGradient,f)||c("radial-gradient",n.radialGradient,E)||c("repeating-radial-gradient",n.repeatingRadialGradient,E)}function c(W,X,q){return m(X,function(z){var Y=q();return Y&&(V(n.comma)||r("Missing comma before color stops")),{type:W,orientation:Y,colorStops:d(P)}})}function m(W,X){var q=V(W);if(q){V(n.startCall)||r("Missing (");var z=X(q);return V(n.endCall)||r("Missing )"),z}}function f(){return v()||y()}function v(){return L("directional",n.sideOrCorner,1)}function y(){return L("angular",n.angleValue,1)}function E(){var W,X=w(),q;return X&&(W=[],W.push(X),q=t,V(n.comma)&&(X=w(),X?W.push(X):t=q)),W}function w(){var W=S()||x();if(W)W.at=b();else{var X=_();if(X){W=X;var q=b();q&&(W.at=q)}else{var z=g();z&&(W={type:"default-radial",at:z})}}return W}function S(){var W=L("shape",/^(circle)/i,0);return W&&(W.style=R()||_()),W}function x(){var W=L("shape",/^(ellipse)/i,0);return W&&(W.style=N()||_()),W}function _(){return L("extent-keyword",n.extentKeywords,1)}function b(){if(L("position",/^at/,0)){var W=g();return W||r("Missing positioning value"),W}}function g(){var W=h();if(W.x||W.y)return{type:"position",value:W}}function h(){return{x:N(),y:N()}}function d(W){var X=W(),q=[];if(X)for(q.push(X);V(n.comma);)X=W(),X?q.push(X):r("One extra comma");return q}function P(){var W=M();return W||r("Expected color definition"),W.length=N(),W}function M(){return I()||k()||F()||T()}function T(){return L("literal",n.literalColor,0)}function I(){return L("hex",n.hexColor,1)}function F(){return m(n.rgbColor,function(){return{type:"rgb",value:d(O)}})}function k(){return m(n.rgbaColor,function(){return{type:"rgba",value:d(O)}})}function O(){return V(n.number)[1]}function N(){return L("%",n.percentageValue,1)||A()||R()}function A(){return L("position-keyword",n.positionKeywords,1)}function R(){return L("px",n.pixelValue,1)||L("em",n.emValue,1)}function L(W,X,q){var z=V(X);if(z)return{type:W,value:z[q]}}function V(W){var X,q;return q=/^[\n\r\t\s]+/.exec(t),q&&G(q[0].length),X=W.exec(t),X&&G(X[0].length),X}function G(W){t=t.substr(W)}return function(W){return t=W.toString(),a()}}(),np.parse=e.parse,np.stringify=e.stringify,np}var A2;function Iv(){return A2||(A2=1,function(e){var n=sd&&sd.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.isGradient=void 0;const t=n(HS());e.isGradient=a=>a.indexOf("linear-gradient")>=0;const r=a=>a.type==="hex"?"#"+a.value:a.type==="literal"?a.value:`${a.type}(${a.value.join(",")})`;e.parseColor=a=>{if(!(0,e.isGradient)(a))return{rotation:0,stops:[{offset:0,color:a},{offset:1,color:a}]};const o=t.default.parse(a)[0];return{rotation:parseFloat(o.orientation.value),stops:o.colorStops.map((s,c)=>({color:r(s),offset:s.length?parseFloat(s.length.value)/100:c/(o.colorStops.length-1)}))}}}(sd)),sd}var T2;function Gd(){return T2||(T2=1,function(e){var n,t=pa&&pa.__createBinding||(Object.create?function(f,v,y,E){E===void 0&&(E=y);var w=Object.getOwnPropertyDescriptor(v,y);w&&!("get"in w?!v.__esModule:w.writable||w.configurable)||(w={enumerable:!0,get:function(){return v[y]}}),Object.defineProperty(f,E,w)}:function(f,v,y,E){E===void 0&&(E=y),f[E]=v[y]}),r=pa&&pa.__setModuleDefault||(Object.create?function(f,v){Object.defineProperty(f,"default",{enumerable:!0,value:v})}:function(f,v){f.default=v}),a=pa&&pa.__importStar||(n=function(f){return n=Object.getOwnPropertyNames||function(v){var y=[];for(var E in v)Object.prototype.hasOwnProperty.call(v,E)&&(y[y.length]=E);return y},n(f)},function(f){if(f&&f.__esModule)return f;var v={};if(f!=null)for(var y=n(f),E=0;E<y.length;E++)y[E]!=="default"&&t(v,f,y[E]);return r(v,f),v}),o=pa&&pa.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.useColor=void 0;const s=o(Or()),c=a(Iv()),m=o(Mi());e.useColor=(f,v=f.fill,y="fill")=>s.default.useMemo(()=>{if(!c.isGradient(v))return{[y]:v};const{stops:E,rotation:w}=c.parseColor(v),S={x:f.a.width/2,y:f.a.height/2},x=Math.sqrt(Math.pow(S.x,2)+Math.pow(S.y,2)),_=m.default.Util.degToRad(w)-Math.PI/2,b=[];return E.forEach(({offset:g,color:h})=>{b.push(g,h)}),y==="fill"?{fillLinearGradientStartPointX:S.x-x*Math.cos(_),fillLinearGradientStartPointY:S.y-x*Math.sin(_),fillLinearGradientColorStops:b,fillLinearGradientEndPointX:S.x+x*Math.cos(_),fillLinearGradientEndPointY:S.y+x*Math.sin(_),fill:E[1].color,fillPriority:"linear-gradient"}:{strokeLinearGradientStartPointX:S.x-x*Math.cos(_),strokeLinearGradientStartPointY:S.y-x*Math.sin(_),strokeLinearGradientColorStops:b,strokeLinearGradientEndPointX:S.x+x*Math.cos(_),strokeLinearGradientEndPointY:S.y+x*Math.sin(_)}},[v,f.width,f.height])}(pa)),pa}var t0={},ud={},R2;function Ys(){return R2||(R2=1,function(e){var n=ud&&ud.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0}),e.isAnimationUsed=e.toggleFadeInAnimation=void 0,e.useFadeIn=function(o,s){const c=t.default.useRef();t.default.useLayoutEffect(()=>{c.current&&c.current.destroy()},[s]),t.default.useLayoutEffect(()=>{if(!a)return;const m=o.current.opacity();return m?(o.current.opacity(0),c.current=new r.default.Tween({node:o.current,opacity:m,onFinish:()=>{var f;(f=c.current)===null||f===void 0||f.destroy()}}),c.current.play(),()=>{var f;(f=c.current)===null||f===void 0||f.destroy()}):void 0},[])};const t=n(Or()),r=n(Mi());let a=!1;e.toggleFadeInAnimation=(o=!a)=>{a=o},e.isAnimationUsed=()=>a}(ud)),ud}var M2;function Ks(){return M2||(M2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getFontLoadTimeout=e.setFontLoadTimeout=e.getAssetLoadTimeout=e.setAssetLoadTimeout=void 0,e.incrementLoader=function(f){t+=1;let v=!1;const y=setTimeout(()=>{v||(m(`Timeout loading asset ${f}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",f),v=!0,s())},a);return()=>{v||(clearTimeout(y),s())}},e.decrementLoader=s,e.whenLoaded=function(){return new Promise(f=>{return v=()=>{(0,n.isAnimationUsed)()?setTimeout(f,300):f(!0)},void(t===0?v():r.push(v));var v})},e.onLoadError=function(f){c.push(f)},e.triggerLoadError=m;const n=Ys();let t=0,r=[],a=3e4;e.setAssetLoadTimeout=f=>{a=f},e.getAssetLoadTimeout=()=>a;let o=6e3;function s(){t-=1,t===0&&(r.forEach(f=>f()),r=[])}e.setFontLoadTimeout=f=>{o=f},e.getFontLoadTimeout=()=>o;let c=[];function m(f){c.forEach(v=>v(f))}}(t0)),t0}var zo={},L2;function Vd(){return L2||(L2=1,function(e){var n,t=zo&&zo.__createBinding||(Object.create?function(_,b,g,h){h===void 0&&(h=g);var d=Object.getOwnPropertyDescriptor(b,g);d&&!("get"in d?!b.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return b[g]}}),Object.defineProperty(_,h,d)}:function(_,b,g,h){h===void 0&&(h=g),_[h]=b[g]}),r=zo&&zo.__setModuleDefault||(Object.create?function(_,b){Object.defineProperty(_,"default",{enumerable:!0,value:b})}:function(_,b){_.default=b}),a=zo&&zo.__importStar||(n=function(_){return n=Object.getOwnPropertyNames||function(b){var g=[];for(var h in b)Object.prototype.hasOwnProperty.call(b,h)&&(g[g.length]=h);return g},n(_)},function(_){if(_&&_.__esModule)return _;var b={};if(_!=null)for(var g=n(_),h=0;h<g.length;h++)g[h]!=="default"&&t(b,_,g[h]);return r(b,_),b});Object.defineProperty(e,"__esModule",{value:!0}),e.isFontLoaded=e.globalFonts=void 0,e.isGoogleFontChanged=function(){return m.value},e.setGoogleFonts=function(_){_!=="default"?(m.value=!0,c.splice(0,c.length),c.push(..._)):m.value=!1},e.getFontsList=function(){return c},e.addGlobalFont=function(_){e.globalFonts.push(_)},e.removeGlobalFont=function(_){const b=e.globalFonts.findIndex(g=>g.fontFamily===_);b!==-1&&e.globalFonts.splice(b,1)},e.replaceGlobalFonts=function(_){e.globalFonts.replace(_)},e.loadFont=async function(_,b,g){var h;if(E[_])return;const d=!!(!((h=document.fonts)===null||h===void 0)&&h.load),P=y("Arial","Arial",b,g);if(d)try{if(await document.fonts.load(`16px '${_}', ${b} ${g}`),P!==y(_,"Arial",b,g))return void(E[_]=!0)}catch{}const M=y("Times","Times",b,g),T=y(_,"Arial",b,g),I=Math.min(6e3,(0,s.getFontLoadTimeout)())/60;for(let F=0;F<I;F++){const k=y(_,"Arial",b,g),O=y(_,"Times",b,g);if(k!==T||k!==P||O!==M)return void(E[_]=!0);await new Promise(N=>setTimeout(N,60))}console.warn(`Timeout for loading font "${_}". Looks like polotno can't load it. Is it a correct font family?`),(0,s.triggerLoadError)(`Timeout for loading font "${_}"`)},e.setGoogleFontsVariants=function(_){S=_},e.getGoogleFontsVariants=function(){return S},e.injectGoogleFont=function(_){if(w[_])return;const b=`https://fonts.googleapis.com/css?family=${_.replace(/ /g,"+")}:${S}`,g=document.createElement("link");g.type="text/css",g.href=b,g.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(g),w[_]=!0},e.injectCustomFont=function(_){const b=_.fontFamily;if(x[b]||!_.url&&!_.styles)return;const g=document.createElement("style");g.type="text/css";const h=_.styles||(_.url?[{src:`url("${_.url}")`}]:[]);let d="";h.forEach(P=>{d+=`
|
|
76
|
+
`,l7={};function Bp(e,n,t=l7){if(!p2&&"zIndex"in n&&(console.warn(o7),p2=!0),!g2&&n.draggable){var r=n.x!==void 0||n.y!==void 0,a=n.onDragEnd||n.onDragMove;r&&!a&&(console.warn(a7),g2=!0)}for(var o in t)if(!h2[o]){var s=o.slice(0,2)==="on",c=t[o]!==n[o];if(s&&c){var m=o.substr(2).toLowerCase();m.substr(0,7)==="content"&&(m="content"+m.substr(7,1).toUpperCase()+m.substr(8)),e.off(m,t[o])}var f=!n.hasOwnProperty(o);f&&e.setAttr(o,void 0)}var v=Ow||n._useStrictMode,y={},E=!1;const w={};for(var o in n)if(!h2[o]){var s=o.slice(0,2)==="on",S=t[o]!==n[o];if(s&&S){var m=o.substr(2).toLowerCase();m.substr(0,7)==="content"&&(m="content"+m.substr(7,1).toUpperCase()+m.substr(8)),n[o]&&(w[m]=n[o])}!s&&(n[o]!==t[o]||v&&n[o]!==e.getAttr(o))&&(E=!0,y[o]=n[o])}E&&(e.setAttrs(y),Ql(e));for(var m in w)e.on(m+Lv,w[m])}function Ql(e){if(!n7.Konva.autoDrawEnabled){var n=e.getLayer()||e.getStage();n&&n.batchDraw()}}var Jg=lv();const Pw={},s7={};Rd.Node.prototype._applyProps=Bp;function u7(e,n){if(typeof n=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${n}`);return}e.add(n),Ql(e)}function c7(e,n,t){let r=Rd[e];r||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" 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`),r=Rd.Group);const a={},o={};for(var s in n){var c=s.slice(0,2)==="on";c?o[s]=n[s]:a[s]=n[s]}const m=new r(a);return Bp(m,o),m}function f7(e,n,t){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function d7(e,n,t){return!1}function h7(e){return e}function p7(){return null}function g7(){return null}function v7(e,n,t,r){return s7}function m7(){}function y7(e){}function b7(e,n){return!1}function w7(){return Pw}function _7(){return Pw}const S7=setTimeout,E7=clearTimeout,x7=-1;function O7(e,n){return!1}const P7=!1,C7=!0,k7=!0;function A7(e,n){n.parent===e?n.moveToTop():e.add(n),Ql(e)}function T7(e,n){n.parent===e?n.moveToTop():e.add(n),Ql(e)}function Cw(e,n,t){n._remove(),e.add(n),n.setZIndex(t.getZIndex()),Ql(e)}function R7(e,n,t){Cw(e,n,t)}function M7(e,n){n.destroy(),n.off(Lv),Ql(e)}function L7(e,n){n.destroy(),n.off(Lv),Ql(e)}function N7(e,n,t){console.error(`Text components are not yet supported in ReactKonva. You text is: "${t}"`)}function I7(e,n,t){}function j7(e,n,t,r,a){Bp(e,a,r)}function D7(e){e.hide(),Ql(e)}function F7(e){}function z7(e,n){(n.visible==null||n.visible)&&e.show()}function B7(e,n){}function U7(e){}function q7(){}const H7=()=>xw.DefaultEventPriority,G7=Object.freeze(Object.defineProperty({__proto__:null,appendChild:A7,appendChildToContainer:T7,appendInitialChild:u7,cancelTimeout:E7,clearContainer:U7,commitMount:I7,commitTextUpdate:N7,commitUpdate:j7,createInstance:c7,createTextInstance:f7,detachDeletedInstance:q7,finalizeInitialChildren:d7,getChildHostContext:_7,getCurrentEventPriority:H7,getPublicInstance:h7,getRootHostContext:w7,hideInstance:D7,hideTextInstance:F7,idlePriority:Jg.unstable_IdlePriority,insertBefore:Cw,insertInContainerBefore:R7,isPrimaryRenderer:P7,noTimeout:x7,now:Jg.unstable_now,prepareForCommit:p7,preparePortalMount:g7,prepareUpdate:v7,removeChild:M7,removeChildFromContainer:L7,resetAfterCommit:m7,resetTextContent:y7,run:Jg.unstable_runWithPriority,scheduleTimeout:S7,shouldDeprioritizeSubtree:b7,shouldSetTextContent:O7,supportsMutation:k7,unhideInstance:z7,unhideTextInstance:B7,warnsIfNotActing:C7},Symbol.toStringTag,{value:"Module"}));var V7=Object.defineProperty,$7=Object.defineProperties,W7=Object.getOwnPropertyDescriptors,v2=Object.getOwnPropertySymbols,Y7=Object.prototype.hasOwnProperty,K7=Object.prototype.propertyIsEnumerable,m2=(e,n,t)=>n in e?V7(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,y2=(e,n)=>{for(var t in n||(n={}))Y7.call(n,t)&&m2(e,t,n[t]);if(v2)for(var t of v2(n))K7.call(n,t)&&m2(e,t,n[t]);return e},X7=(e,n)=>$7(e,W7(n)),b2,w2;typeof window<"u"&&((b2=window.document)!=null&&b2.createElement||((w2=window.navigator)==null?void 0:w2.product)==="ReactNative")?Sr.useLayoutEffect:Sr.useEffect;function kw(e,n,t){if(!e)return;if(t(e)===!0)return e;let r=e.child;for(;r;){const a=kw(r,n,t);if(a)return a;r=r.sibling}}function Aw(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const _2=console.error;console.error=function(){const e=[...arguments].join("");if(e!=null&&e.startsWith("Warning:")&&e.includes("useContext")){console.error=_2;return}return _2.apply(this,arguments)};const Nv=Aw(Sr.createContext(null));class Tw extends Sr.Component{render(){return Sr.createElement(Nv.Provider,{value:this._reactInternals},this.props.children)}}function Z7(){const e=Sr.useContext(Nv);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const n=Sr.useId();return Sr.useMemo(()=>{for(const r of[e,e==null?void 0:e.alternate]){if(!r)continue;const a=kw(r,!1,o=>{let s=o.memoizedState;for(;s;){if(s.memoizedState===n)return!0;s=s.next}});if(a)return a}},[e,n])}function Q7(){const e=Z7(),[n]=Sr.useState(()=>new Map);n.clear();let t=e;for(;t;){if(t.type&&typeof t.type=="object"){const a=t.type._context===void 0&&t.type.Provider===t.type?t.type:t.type._context;a&&a!==Nv&&!n.has(a)&&n.set(a,Sr.useContext(Aw(a)))}t=t.return}return n}function Rw(){const e=Q7();return Sr.useMemo(()=>Array.from(e.keys()).reduce((n,t)=>r=>Sr.createElement(n,null,Sr.createElement(t.Provider,X7(y2({},r),{value:e.get(t)}))),n=>Sr.createElement(Tw,y2({},n))),[e])}function J7(e){const n=Gt.useRef({});return Gt.useLayoutEffect(()=>{n.current=e}),Gt.useLayoutEffect(()=>()=>{n.current={}},[]),n.current}const eS=e=>{const n=Gt.useRef(),t=Gt.useRef(),r=Gt.useRef(),a=J7(e),o=Rw(),s=c=>{const{forwardedRef:m}=e;m&&(typeof m=="function"?m(c):m.current=c)};return Gt.useLayoutEffect(()=>(t.current=new Rd.Stage({width:e.width,height:e.height,container:n.current}),s(t.current),r.current=ic.createContainer(t.current,xw.LegacyRoot,!1,null),ic.updateContainer(Gt.createElement(o,{},e.children),r.current),()=>{Rd.isBrowser&&(s(null),ic.updateContainer(null,r.current,null),t.current.destroy())}),[]),Gt.useLayoutEffect(()=>{s(t.current),Bp(t.current,e,a),ic.updateContainer(Gt.createElement(o,{},e.children),r.current,null)}),Gt.createElement("div",{ref:n,id:e.id,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},tS="Layer",rS="FastLayer",_p="Group",nS="Label",iS="Rect",aS="Circle",oS="Ellipse",lS="Wedge",sS="Line",uS="Sprite",cS="Image",fS="Text",dS="TextPath",hS="Star",pS="Ring",gS="Arc",vS="Tag",mS="Path",yS="RegularPolygon",bS="Arrow",wS="Shape",_S="Transformer",ic=e7(G7);ic.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:Gt.version,rendererPackageName:"react-konva"});const SS=Gt.forwardRef((e,n)=>Gt.createElement(Tw,{},Gt.createElement(eS,{...e,forwardedRef:n}))),ES=i7,xS=Object.freeze(Object.defineProperty({__proto__:null,Arc:gS,Arrow:bS,Circle:aS,Ellipse:oS,FastLayer:rS,Group:_p,Image:cS,KonvaRenderer:ic,Label:nS,Layer:tS,Line:sS,Path:mS,Rect:iS,RegularPolygon:yS,Ring:pS,Shape:wS,Sprite:uS,Stage:SS,Star:hS,Tag:vS,Text:fS,TextPath:dS,Transformer:_S,Wedge:lS,useStrictMode:ES},Symbol.toStringTag,{value:"Module"})),oo=Yl(xS);var e0,S2;function Up(){if(S2)return e0;S2=1;var e=Or();return e0=function(t,r,a){const o=e.useRef("loading"),s=e.useRef(),[c,m]=e.useState(0),f=e.useRef(),v=e.useRef(),y=e.useRef();return(f.current!==t||v.current!==r||y.current!==a)&&(o.current="loading",s.current=void 0,f.current=t,v.current=r,y.current=a),e.useLayoutEffect(function(){if(!t)return;var E=document.createElement("img");function w(){o.current="loaded",s.current=E,m(Math.random())}function S(){o.current="failed",s.current=void 0,m(Math.random())}return E.addEventListener("load",w),E.addEventListener("error",S),r&&(E.crossOrigin=r),a&&(E.referrerPolicy=a),E.src=t,function(){E.removeEventListener("load",w),E.removeEventListener("error",S)}},[t,r,a]),[s.current,o.current]},e0}var od={},ld={},OS=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)n.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(t[r[a]]=e[r[a]]);return t};const PS=e=>{const n=window.getComputedStyle(e).position;return!(n==="absolute"||n==="relative")};function Mw(e=()=>{}){const n=Gt.useRef(e);return n.current=e,Gt.useCallback((...t)=>n.current.apply(null,t),[])}const CS=({children:e,groupProps:n,divProps:t,transform:r,transformFunc:a,parentNodeFunc:o})=>{const s=Rw(),c=Gt.useRef(null),[m]=Gt.useState(()=>document.createElement("div")),f=Gt.useMemo(()=>c5.createRoot(m),[m]),v=r??!0,y=Mw(()=>{if(v&&c.current){let _=c.current.getAbsoluteTransform().decompose();a&&(_=a(_)),m.style.position="absolute",m.style.zIndex="10",m.style.top="0px",m.style.left="0px",m.style.transform=`translate(${_.x}px, ${_.y}px) rotate(${_.rotation}deg) scaleX(${_.scaleX}) scaleY(${_.scaleY})`,m.style.transformOrigin="top left"}else m.style.position="",m.style.zIndex="",m.style.top="",m.style.left="",m.style.transform="",m.style.transformOrigin="";const E=t||{},{style:w}=E,S=OS(E,["style"]);Object.assign(m.style,w),Object.assign(m,S)});return Gt.useLayoutEffect(()=>{var E;const w=c.current;if(!w)return;const S=o?o({stage:w.getStage()}):(E=w.getStage())===null||E===void 0?void 0:E.container();if(S)return S.appendChild(m),v&&PS(S)&&(S.style.position="relative"),w.on("absoluteTransformChange",y),y(),()=>{var x;w.off("absoluteTransformChange",y),(x=m.parentNode)===null||x===void 0||x.removeChild(m)}},[v,o]),Gt.useLayoutEffect(()=>{y()},[t,a]),Gt.useLayoutEffect(()=>{f.render(Gt.createElement(s,null,e))}),Gt.useLayoutEffect(()=>()=>{setTimeout(()=>{f.unmount()})},[]),Gt.createElement(_p,Object.assign({ref:c},n))},kS=({selector:e,enabled:n,children:t})=>{const r=Gt.useRef(null),a=Gt.useRef(null),o=Gt.useRef(null),s=n??!0;return Gt.useLayoutEffect(()=>{if(!r.current||!a.current)return;o.current=a.current;const m=r.current.getStage().findOne(e);s&&m?a.current.moveTo(m):a.current.moveTo(r.current);const f=r.current.getLayer();if(f&&(f.batchDraw(),m)){const v=m.getLayer();if(!v)return;v.batchDraw()}},[e,s]),Gt.useEffect(()=>()=>{var c;(c=o.current)===null||c===void 0||c.destroy()},[]),Gt.createElement(_p,{name:"_outer_portal",ref:r},Gt.createElement(_p,{name:"_inner_portal",ref:a},t))};var AS=Up();const TS=jd(AS),RS=Object.freeze(Object.defineProperty({__proto__:null,Html:CS,Portal:kS,useEvent:Mw,useImage:TS},Symbol.toStringTag,{value:"Module"})),wc=Yl(RS);function MS(e,n){return Object.keys(e.values).forEach(t=>e.values[t]=e.values[t]&&parseFloat(e.values[t].toFixed(n))),e}function Lw(e,n,t){const r=n-1,a=t[Iw(r,t.length)];return a.marker!=="Z"?a:Lw(e,r,t)}function Nw(e,n,t){const r=n+1,a=t[Iw(r,t.length)];return a.marker==="Z"?Nw(e,r,t):a}function LS(e,n,t){let r=t[n-1]||{values:{x:0,y:0}};if(e.marker===e.marker.toLowerCase())switch(e.marker=e.marker.toUpperCase(),e.marker){case"M":e.values.x+=r.values.x,e.values.y+=r.values.y;break;case"L":case"A":e.values.x+=r.values.x,e.values.y+=r.values.y;break;case"H":e.marker="L",e.values.x+=r.values.x,e.values.y=r.values.y;break;case"V":e.marker="L",e.values.x=r.values.x,e.values.y+=r.values.y;break;case"C":e.values.x+=r.values.x,e.values.y+=r.values.y,e.values.x1+=r.values.x,e.values.y1+=r.values.y,e.values.x2+=r.values.x,e.values.y2+=r.values.y;break;case"S":e.values.x+=r.values.x,e.values.y+=r.values.y,e.values.x2+=r.values.x,e.values.y2+=r.values.y;break;case"Q":e.values.x+=r.values.x,e.values.y+=r.values.y,e.values.x1+=r.values.x,e.values.y1+=r.values.y;break;case"T":e.values.x+=r.values.x,e.values.y+=r.values.y;break}else if(e.marker===e.marker.toUpperCase())switch(e.marker){case"H":e.marker="L",e.values.y=r.values.y;break;case"V":e.marker="L",e.values.x=r.values.x;break}if(e.marker==="Z"){let o=function(c,m){return c[m].marker==="M"?c[m]:o(c,m-1)};var a=o;let s=o(t,n);e.values.x=s.values.x,e.values.y=s.values.y}return e}function NS(e,n){const t=[];switch(e.toUpperCase()){case"M":for(let r=0;r<n.length;r+=2){let a;e===e.toUpperCase()?a=r===0?"M":"L":a=r===0?"m":"l",t.push({marker:a,values:{x:n[r],y:n[r+1]}})}break;case"L":for(let r=0;r<n.length;r+=2)t.push({marker:e,values:{x:n[r],y:n[r+1]}});break;case"H":for(let r=0;r<n.length;r++)t.push({marker:e,values:{x:n[r],y:0}});break;case"V":for(let r=0;r<n.length;r++)t.push({marker:e,values:{x:0,y:n[r]}});break;case"C":for(let r=0;r<n.length;r+=6)t.push({marker:e,values:{x1:n[r],y1:n[r+1],x2:n[r+2],y2:n[r+3],x:n[r+4],y:n[r+5]}});break;case"S":for(let r=0;r<n.length;r+=4)t.push({marker:e,values:{x2:n[r],y2:n[r+1],x:n[r+2],y:n[r+3]}});break;case"Q":for(let r=0;r<n.length;r+=4)t.push({marker:e,values:{x1:n[r],y1:n[r+1],x:n[r+2],y:n[r+3]}});break;case"T":for(let r=0;r<n.length;r+=2)t.push({marker:e,values:{x:n[r],y:n[r+1]}});break;case"A":for(let r=0;r<n.length;r+=7)t.push({marker:e,values:{radiusX:n[r],radiusY:n[r+1],rotation:n[r+2],largeArc:n[r+3],sweep:n[r+4],x:n[r+5],y:n[r+6]}});break;case"Z":t.push({marker:e,values:{x:0,y:0}});break}return t}function Iw(e,n){return(e%n+n)%n}function IS(e,n,t){if(n!==0&&e.marker==="L"){let r=t[n-1];["x","y"].every(o=>Math.round(Math.abs(r.values[o]-e.values[o]))===0)&&(e.overlap=!0)}return e}function iv(e,n){const t=["x","y"].every(r=>Math.round(Math.abs(e[n].values[r]-e[0].values[r]))===0);e[n].marker==="L"&&t&&(e[n].overlap=!0,iv(e,n-1)),e[n].marker==="Z"&&iv(e,n-1)}function jS(e,n,t){const r=x2(e.values,t.values),a=x2(n.values,e.values);return Math.min(a,r)}function E2(e,n){return Math.atan2(n.x-e.x,n.y-e.y)}function x2(e,n){const t=e.x-n.x,r=e.y-n.y;return Math.sqrt(Math.pow(t,2)+Math.pow(r,2))}function O2(e,n){return Math.sin(e)*n}function P2(e,n){return Math.cos(e)*n}function C2(e,n){const t=n/Math.tan(e);return t===1/0||t===-1/0||isNaN(t)?n:t}function DS(e,n){return n*Math.tan(e)}function FS(e,n){let t,r=0,a=e*(180/Math.PI);return a<0&&a>=-180||a>180&&a<360?t=C2(e/2,-n):(t=C2(e/2,n),r=1,t===1/0&&(t=n)),{offset:t,sweepFlag:r}}function zS(e){const n=["radiusX","radiusY","rotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return e.map(t=>{let r="";if(t.marker!=="Z"){const a=Object.keys(t.values);r=n.filter(o=>a.indexOf(o)!==-1).map(o=>t.values[o]).join()}return`${t.marker}${r}`}).join("").trim()}function jw(e){const n=/[MmLlSsQqLlHhVvCcSsQqTtAaZz]/g,t=/-?[0-9]*\.?\d+/g;return[...e.matchAll(n)].map(r=>({marker:r[0],index:r.index})).reduceRight((r,a)=>{const o=e.substring(a.index,r.length?r[r.length-1].index:e.length);return r.concat([{marker:a.marker,index:a.index,chunk:o.length>0?o.substr(1,o.length-1):o}])},[]).reverse().flatMap(r=>{const a=r.chunk.match(t),o=a?a.map(parseFloat):[];return NS(r.marker,o)}).map(LS)}function Dw(e,n,t){let r=[],a=[];return t&&e.forEach(o=>MS(o,t)),e.forEach(o=>{o.marker==="M"&&r.push([]),r[r.length-1].push(o)}),r.forEach(o=>{o.map(IS),iv(o,o.length-1);const s=o[o.length-1].marker=="Z";o.filter(c=>!c.overlap).map((c,m,f)=>{const y=Lw(c,m,f),E=Nw(c,m,f),w=E2(c.values,y.values),S=E2(c.values,E.values),x=S-w,_=x*(180/Math.PI),b=jS(c,y,E),g=Math.abs(DS(x/2,b/2)),h=Math.min(n,g),d=FS(x,h),P=d.offset,M=d.sweepFlag,T=(m==0||m==f.length-1)&&!s;switch(c.marker){case"M":case"L":const I=[c.values.x+O2(w,P),c.values.y+P2(w,P)],F=[c.values.x+O2(S,P),c.values.y+P2(S,P)];T?a.push({marker:c.marker,values:c.values}):a.push({marker:c.marker,values:{x:parseFloat(I[0].toFixed(3)),y:parseFloat(I[1].toFixed(3))}}),!T&&(E.marker==="L"||E.marker==="M")&&a.push({marker:"A",radius:h,values:{radiusX:parseFloat(h.toFixed(3)),radiusY:parseFloat(h.toFixed(3)),rotation:_,largeArc:0,sweep:M,x:parseFloat(F[0].toFixed(3)),y:parseFloat(F[1].toFixed(3))}});break;case"C":case"S":case"Q":case"T":case"A":case"Z":a.push({marker:c.marker,values:c.values});break}})}),{path:zS(a),commands:a}}function BS(e,n,t){return Dw([...jw(e)],n,t)}const US=Object.freeze(Object.defineProperty({__proto__:null,parsePath:jw,roundCommands:Dw,roundCorners:BS},Symbol.toStringTag,{value:"Module"})),qS=Yl(US);var pa={},sd={},np={},k2;function HS(){if(k2)return np;k2=1;var e=e||{};e.stringify=function(){var n={"visit_linear-gradient":function(t){return n.visit_gradient(t)},"visit_repeating-linear-gradient":function(t){return n.visit_gradient(t)},"visit_radial-gradient":function(t){return n.visit_gradient(t)},"visit_repeating-radial-gradient":function(t){return n.visit_gradient(t)},visit_gradient:function(t){var r=n.visit(t.orientation);return r&&(r+=", "),t.type+"("+r+n.visit(t.colorStops)+")"},visit_shape:function(t){var r=t.value,a=n.visit(t.at),o=n.visit(t.style);return o&&(r+=" "+o),a&&(r+=" at "+a),r},"visit_default-radial":function(t){var r="",a=n.visit(t.at);return a&&(r+=a),r},"visit_extent-keyword":function(t){var r=t.value,a=n.visit(t.at);return a&&(r+=" at "+a),r},"visit_position-keyword":function(t){return t.value},visit_position:function(t){return n.visit(t.value.x)+" "+n.visit(t.value.y)},"visit_%":function(t){return t.value+"%"},visit_em:function(t){return t.value+"em"},visit_px:function(t){return t.value+"px"},visit_literal:function(t){return n.visit_color(t.value,t)},visit_hex:function(t){return n.visit_color("#"+t.value,t)},visit_rgb:function(t){return n.visit_color("rgb("+t.value.join(", ")+")",t)},visit_rgba:function(t){return n.visit_color("rgba("+t.value.join(", ")+")",t)},visit_color:function(t,r){var a=t,o=n.visit(r.length);return o&&(a+=" "+o),a},visit_angular:function(t){return t.value+"deg"},visit_directional:function(t){return"to "+t.value},visit_array:function(t){var r="",a=t.length;return t.forEach(function(o,s){r+=n.visit(o),s<a-1&&(r+=", ")}),r},visit:function(t){if(!t)return"";var r="";if(t instanceof Array)return n.visit_array(t,r);if(t.type){var a=n["visit_"+t.type];if(a)return a(t);throw Error("Missing visitor visit_"+t.type)}else throw Error("Invalid node.")}};return function(t){return n.visit(t)}}();var e=e||{};return e.parse=function(){var n={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},t="";function r(W){var X=new Error(t+": "+W);throw X.source=t,X}function a(){var W=o();return t.length>0&&r("Invalid input not EOF"),W}function o(){return d(s)}function s(){return c("linear-gradient",n.linearGradient,f)||c("repeating-linear-gradient",n.repeatingLinearGradient,f)||c("radial-gradient",n.radialGradient,E)||c("repeating-radial-gradient",n.repeatingRadialGradient,E)}function c(W,X,q){return m(X,function(z){var Y=q();return Y&&(V(n.comma)||r("Missing comma before color stops")),{type:W,orientation:Y,colorStops:d(P)}})}function m(W,X){var q=V(W);if(q){V(n.startCall)||r("Missing (");var z=X(q);return V(n.endCall)||r("Missing )"),z}}function f(){return v()||y()}function v(){return L("directional",n.sideOrCorner,1)}function y(){return L("angular",n.angleValue,1)}function E(){var W,X=w(),q;return X&&(W=[],W.push(X),q=t,V(n.comma)&&(X=w(),X?W.push(X):t=q)),W}function w(){var W=S()||x();if(W)W.at=b();else{var X=_();if(X){W=X;var q=b();q&&(W.at=q)}else{var z=g();z&&(W={type:"default-radial",at:z})}}return W}function S(){var W=L("shape",/^(circle)/i,0);return W&&(W.style=R()||_()),W}function x(){var W=L("shape",/^(ellipse)/i,0);return W&&(W.style=N()||_()),W}function _(){return L("extent-keyword",n.extentKeywords,1)}function b(){if(L("position",/^at/,0)){var W=g();return W||r("Missing positioning value"),W}}function g(){var W=h();if(W.x||W.y)return{type:"position",value:W}}function h(){return{x:N(),y:N()}}function d(W){var X=W(),q=[];if(X)for(q.push(X);V(n.comma);)X=W(),X?q.push(X):r("One extra comma");return q}function P(){var W=M();return W||r("Expected color definition"),W.length=N(),W}function M(){return I()||k()||F()||T()}function T(){return L("literal",n.literalColor,0)}function I(){return L("hex",n.hexColor,1)}function F(){return m(n.rgbColor,function(){return{type:"rgb",value:d(O)}})}function k(){return m(n.rgbaColor,function(){return{type:"rgba",value:d(O)}})}function O(){return V(n.number)[1]}function N(){return L("%",n.percentageValue,1)||A()||R()}function A(){return L("position-keyword",n.positionKeywords,1)}function R(){return L("px",n.pixelValue,1)||L("em",n.emValue,1)}function L(W,X,q){var z=V(X);if(z)return{type:W,value:z[q]}}function V(W){var X,q;return q=/^[\n\r\t\s]+/.exec(t),q&&G(q[0].length),X=W.exec(t),X&&G(X[0].length),X}function G(W){t=t.substr(W)}return function(W){return t=W.toString(),a()}}(),np.parse=e.parse,np.stringify=e.stringify,np}var A2;function Iv(){return A2||(A2=1,function(e){var n=sd&&sd.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.isGradient=void 0;const t=n(HS());e.isGradient=a=>a.indexOf("linear-gradient")>=0;const r=a=>a.type==="hex"?"#"+a.value:a.type==="literal"?a.value:`${a.type}(${a.value.join(",")})`;e.parseColor=a=>{if(!(0,e.isGradient)(a))return{rotation:0,stops:[{offset:0,color:a},{offset:1,color:a}]};const o=t.default.parse(a)[0];return{rotation:parseFloat(o.orientation.value),stops:o.colorStops.map((s,c)=>({color:r(s),offset:s.length?parseFloat(s.length.value)/100:c/(o.colorStops.length-1)}))}}}(sd)),sd}var T2;function Gd(){return T2||(T2=1,function(e){var n,t=pa&&pa.__createBinding||(Object.create?function(f,v,y,E){E===void 0&&(E=y);var w=Object.getOwnPropertyDescriptor(v,y);w&&!("get"in w?!v.__esModule:w.writable||w.configurable)||(w={enumerable:!0,get:function(){return v[y]}}),Object.defineProperty(f,E,w)}:function(f,v,y,E){E===void 0&&(E=y),f[E]=v[y]}),r=pa&&pa.__setModuleDefault||(Object.create?function(f,v){Object.defineProperty(f,"default",{enumerable:!0,value:v})}:function(f,v){f.default=v}),a=pa&&pa.__importStar||(n=function(f){return n=Object.getOwnPropertyNames||function(v){var y=[];for(var E in v)Object.prototype.hasOwnProperty.call(v,E)&&(y[y.length]=E);return y},n(f)},function(f){if(f&&f.__esModule)return f;var v={};if(f!=null)for(var y=n(f),E=0;E<y.length;E++)y[E]!=="default"&&t(v,f,y[E]);return r(v,f),v}),o=pa&&pa.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.useColor=void 0;const s=o(Or()),c=a(Iv()),m=o(Mi());e.useColor=(f,v=f.fill,y="fill")=>s.default.useMemo(()=>{if(!c.isGradient(v))return{[y]:v};const{stops:E,rotation:w}=c.parseColor(v),S={x:f.a.width/2,y:f.a.height/2},x=Math.sqrt(Math.pow(S.x,2)+Math.pow(S.y,2)),_=m.default.Util.degToRad(w)-Math.PI/2,b=[];return E.forEach(({offset:g,color:h})=>{b.push(g,h)}),y==="fill"?{fillLinearGradientStartPointX:S.x-x*Math.cos(_),fillLinearGradientStartPointY:S.y-x*Math.sin(_),fillLinearGradientColorStops:b,fillLinearGradientEndPointX:S.x+x*Math.cos(_),fillLinearGradientEndPointY:S.y+x*Math.sin(_),fill:E[1].color,fillPriority:"linear-gradient"}:{strokeLinearGradientStartPointX:S.x-x*Math.cos(_),strokeLinearGradientStartPointY:S.y-x*Math.sin(_),strokeLinearGradientColorStops:b,strokeLinearGradientEndPointX:S.x+x*Math.cos(_),strokeLinearGradientEndPointY:S.y+x*Math.sin(_)}},[v,f.width,f.height])}(pa)),pa}var t0={},ud={},R2;function Ys(){return R2||(R2=1,function(e){var n=ud&&ud.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0}),e.isAnimationUsed=e.toggleFadeInAnimation=void 0,e.useFadeIn=function(o,s){const c=t.default.useRef();t.default.useLayoutEffect(()=>{c.current&&c.current.destroy()},[s]),t.default.useLayoutEffect(()=>{if(!a)return;const m=o.current.opacity();return m?(o.current.opacity(0),c.current=new r.default.Tween({node:o.current,opacity:m,onFinish:()=>{var f;(f=c.current)===null||f===void 0||f.destroy()}}),c.current.play(),()=>{var f;(f=c.current)===null||f===void 0||f.destroy()}):void 0},[])};const t=n(Or()),r=n(Mi());let a=!1;e.toggleFadeInAnimation=(o=!a)=>{a=o},e.isAnimationUsed=()=>a}(ud)),ud}var M2;function Ks(){return M2||(M2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getFontLoadTimeout=e.setFontLoadTimeout=e.getAssetLoadTimeout=e.setAssetLoadTimeout=void 0,e.incrementLoader=function(f){t+=1;let v=!1;const y=setTimeout(()=>{v||(m(`Timeout loading asset ${f}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",f),v=!0,s())},a);return()=>{v||(clearTimeout(y),s())}},e.decrementLoader=s,e.whenLoaded=function(){return new Promise(f=>{return v=()=>{(0,n.isAnimationUsed)()?setTimeout(f,300):f(!0)},void(t===0?v():r.push(v));var v})},e.onLoadError=function(f){c.push(f)},e.triggerLoadError=m;const n=Ys();let t=0,r=[],a=3e4;e.setAssetLoadTimeout=f=>{a=f},e.getAssetLoadTimeout=()=>a;let o=6e3;function s(){t-=1,t===0&&(r.forEach(f=>f()),r=[])}e.setFontLoadTimeout=f=>{o=f},e.getFontLoadTimeout=()=>o;let c=[];function m(f){c.forEach(v=>v(f))}}(t0)),t0}var zo={},L2;function Vd(){return L2||(L2=1,function(e){var n,t=zo&&zo.__createBinding||(Object.create?function(_,b,g,h){h===void 0&&(h=g);var d=Object.getOwnPropertyDescriptor(b,g);d&&!("get"in d?!b.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return b[g]}}),Object.defineProperty(_,h,d)}:function(_,b,g,h){h===void 0&&(h=g),_[h]=b[g]}),r=zo&&zo.__setModuleDefault||(Object.create?function(_,b){Object.defineProperty(_,"default",{enumerable:!0,value:b})}:function(_,b){_.default=b}),a=zo&&zo.__importStar||(n=function(_){return n=Object.getOwnPropertyNames||function(b){var g=[];for(var h in b)Object.prototype.hasOwnProperty.call(b,h)&&(g[g.length]=h);return g},n(_)},function(_){if(_&&_.__esModule)return _;var b={};if(_!=null)for(var g=n(_),h=0;h<g.length;h++)g[h]!=="default"&&t(b,_,g[h]);return r(b,_),b});Object.defineProperty(e,"__esModule",{value:!0}),e.isFontLoaded=e.globalFonts=void 0,e.isGoogleFontChanged=function(){return m.value},e.setGoogleFonts=function(_){_!=="default"?(m.value=!0,c.splice(0,c.length),c.push(..._)):m.value=!1},e.getFontsList=function(){return c},e.addGlobalFont=function(_){e.globalFonts.push(_)},e.removeGlobalFont=function(_){const b=e.globalFonts.findIndex(g=>g.fontFamily===_);b!==-1&&e.globalFonts.splice(b,1)},e.replaceGlobalFonts=function(_){e.globalFonts.replace(_)},e.loadFont=async function(_,b,g){var h;if(E[_])return;const d=!!(!((h=document.fonts)===null||h===void 0)&&h.load),P=y("Arial","Arial",b,g);if(d)try{if(await document.fonts.load(`16px '${_}', ${b} ${g}`),P!==y(_,"Arial",b,g))return void(E[_]=!0)}catch{}const M=y("Times","Times",b,g),T=y(_,"Arial",b,g),I=Math.min(6e3,(0,s.getFontLoadTimeout)())/60;for(let F=0;F<I;F++){const k=y(_,"Arial",b,g),O=y(_,"Times",b,g);if(k!==T||k!==P||O!==M)return void(E[_]=!0);await new Promise(N=>setTimeout(N,60))}console.warn(`Timeout for loading font "${_}". Looks like polotno can't load it. Is it a correct font family?`),(0,s.triggerLoadError)(`Timeout for loading font "${_}"`)},e.setGoogleFontsVariants=function(_){S=_},e.getGoogleFontsVariants=function(){return S},e.injectGoogleFont=function(_){if(w[_])return;const b=`https://fonts.googleapis.com/css?family=${_.replace(/ /g,"+")}:${S}`,g=document.createElement("link");g.type="text/css",g.href=b,g.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(g),w[_]=!0},e.injectCustomFont=function(_){const b=_.fontFamily;if(x[b]||!_.url&&!_.styles)return;const g=document.createElement("style");g.type="text/css";const h=_.styles||(_.url?[{src:`url("${_.url}")`}]:[]);let d="";h.forEach(P=>{d+=`
|
|
77
77
|
@font-face {
|
|
78
78
|
font-family: '${b}';
|
|
79
79
|
src: ${P.src};
|
|
80
80
|
font-style: ${P.fontStyle||"normal"};
|
|
81
81
|
font-weight: ${P.fontWeight||"normal"};
|
|
82
82
|
}
|
|
83
|
-
`}),g.innerHTML=d,document.getElementsByTagName("head")[0].appendChild(g),x[_.fontFamily]=!0};const o=a(Xi),s=Ks();let c=o.observable(["Roboto","Amatic SC","Press Start 2P","Marck Script","Rubik Mono One"]),m=o.observable({value:!1});e.globalFonts=o.observable([]);var f="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1",v=document.createElement("canvas");function y(_,b="Arial",g="normal",h="normal"){var d=v.getContext("2d");return d.font=`${g} ${h} 40px '${_}', ${b}`,d.measureText(f).width}const E={Arial:!0};e.isFontLoaded=_=>!!E[_];const w={};let S="400,400italic,700,700italic";const x={}}(zo)),zo}var Bo={},N2;function Jl(){return N2||(N2=1,function(e){var n,t=Bo&&Bo.__createBinding||(Object.create?function(s,c,m,f){f===void 0&&(f=m);var v=Object.getOwnPropertyDescriptor(c,m);v&&!("get"in v?!c.__esModule:v.writable||v.configurable)||(v={enumerable:!0,get:function(){return c[m]}}),Object.defineProperty(s,f,v)}:function(s,c,m,f){f===void 0&&(f=m),s[f]=c[m]}),r=Bo&&Bo.__setModuleDefault||(Object.create?function(s,c){Object.defineProperty(s,"default",{enumerable:!0,value:c})}:function(s,c){s.default=c}),a=Bo&&Bo.__importStar||(n=function(s){return n=Object.getOwnPropertyNames||function(c){var m=[];for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(m[m.length]=f);return m},n(s)},function(s){if(s&&s.__esModule)return s;var c={};if(s!=null)for(var m=n(s),f=0;f<m.length;f++)m[f]!=="default"&&t(c,s,m[f]);return r(c,s),c});Object.defineProperty(e,"__esModule",{value:!0}),e.setAnimationsEnabled=e.setTextSplitAllowed=e.setTextOverflow=e.setForceTextFit=e.useDownScaling=e.setDownScalingEnabled=e.useHtmlTextRender=e.useRemoveBackground=e.setTextVerticalResizeEnabled=e.flags=void 0;const o=a(Xi);e.flags=o.observable({imageDownScalingEnabled:!0,removeBackgroundEnabled:!0,htmlRenderEnabled:!1,forceTextFitEnabled:!1,textVerticalResizeEnabled:!1,textOverflow:"resize",textSplitAllowed:!1,animationsEnabled:!1}),e.setTextVerticalResizeEnabled=o.action(s=>{e.flags.textVerticalResizeEnabled=s}),e.useRemoveBackground=o.action(s=>{e.flags.removeBackgroundEnabled=s}),e.useHtmlTextRender=o.action(s=>{e.flags.htmlRenderEnabled=s}),e.setDownScalingEnabled=o.action(s=>{e.flags.imageDownScalingEnabled=s}),e.useDownScaling=o.action(s=>{console.warn("useDownScaling is deprecated. Use setDownScalingEnabled instead."),(0,e.setDownScalingEnabled)(s)}),e.setForceTextFit=o.action(s=>{console.warn("setForceTextFit is deprecated. Use setTextOverflow instead."),e.flags.textOverflow="change-font-size"}),e.setTextOverflow=o.action(s=>{e.flags.textOverflow=s}),e.setTextSplitAllowed=o.action(s=>{e.flags.textSplitAllowed=s}),e.setAnimationsEnabled=o.action(s=>{e.flags.animationsEnabled=s})}(Bo)),Bo}var r0={},I2;function
|
|
83
|
+
`}),g.innerHTML=d,document.getElementsByTagName("head")[0].appendChild(g),x[_.fontFamily]=!0};const o=a(Xi),s=Ks();let c=o.observable(["Roboto","Amatic SC","Press Start 2P","Marck Script","Rubik Mono One"]),m=o.observable({value:!1});e.globalFonts=o.observable([]);var f="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1",v=document.createElement("canvas");function y(_,b="Arial",g="normal",h="normal"){var d=v.getContext("2d");return d.font=`${g} ${h} 40px '${_}', ${b}`,d.measureText(f).width}const E={Arial:!0};e.isFontLoaded=_=>!!E[_];const w={};let S="400,400italic,700,700italic";const x={}}(zo)),zo}var Bo={},N2;function Jl(){return N2||(N2=1,function(e){var n,t=Bo&&Bo.__createBinding||(Object.create?function(s,c,m,f){f===void 0&&(f=m);var v=Object.getOwnPropertyDescriptor(c,m);v&&!("get"in v?!c.__esModule:v.writable||v.configurable)||(v={enumerable:!0,get:function(){return c[m]}}),Object.defineProperty(s,f,v)}:function(s,c,m,f){f===void 0&&(f=m),s[f]=c[m]}),r=Bo&&Bo.__setModuleDefault||(Object.create?function(s,c){Object.defineProperty(s,"default",{enumerable:!0,value:c})}:function(s,c){s.default=c}),a=Bo&&Bo.__importStar||(n=function(s){return n=Object.getOwnPropertyNames||function(c){var m=[];for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(m[m.length]=f);return m},n(s)},function(s){if(s&&s.__esModule)return s;var c={};if(s!=null)for(var m=n(s),f=0;f<m.length;f++)m[f]!=="default"&&t(c,s,m[f]);return r(c,s),c});Object.defineProperty(e,"__esModule",{value:!0}),e.setAnimationsEnabled=e.setTextSplitAllowed=e.setTextOverflow=e.setForceTextFit=e.useDownScaling=e.setDownScalingEnabled=e.useHtmlTextRender=e.useRemoveBackground=e.setTextVerticalResizeEnabled=e.flags=void 0;const o=a(Xi);e.flags=o.observable({imageDownScalingEnabled:!0,removeBackgroundEnabled:!0,htmlRenderEnabled:!1,forceTextFitEnabled:!1,textVerticalResizeEnabled:!1,textOverflow:"resize",textSplitAllowed:!1,animationsEnabled:!1}),e.setTextVerticalResizeEnabled=o.action(s=>{e.flags.textVerticalResizeEnabled=s}),e.useRemoveBackground=o.action(s=>{e.flags.removeBackgroundEnabled=s}),e.useHtmlTextRender=o.action(s=>{e.flags.htmlRenderEnabled=s}),e.setDownScalingEnabled=o.action(s=>{e.flags.imageDownScalingEnabled=s}),e.useDownScaling=o.action(s=>{console.warn("useDownScaling is deprecated. Use setDownScalingEnabled instead."),(0,e.setDownScalingEnabled)(s)}),e.setForceTextFit=o.action(s=>{console.warn("setForceTextFit is deprecated. Use setTextOverflow instead."),e.flags.textOverflow="change-font-size"}),e.setTextOverflow=o.action(s=>{e.flags.textOverflow=s}),e.setTextSplitAllowed=o.action(s=>{e.flags.textSplitAllowed=s}),e.setAnimationsEnabled=o.action(s=>{e.flags.animationsEnabled=s})}(Bo)),Bo}var r0={},I2;function Fw(){return I2||(I2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.removeTags=function(n=""){return(n.match(/<\/p>/gi)||[]).length>1&&(n=n.replace(/<\/p>/gi,(t,r,a)=>(a.slice(r+t.length).match(/<\/p>/gi)||[]).length>0?`
|
|
84
84
|
`:t)),n.replace(/(<([^>]+)>)/gi,"")},e.sanitizeHtml=function(n){return n?/<[a-z][a-z0-9]*(\s[^>]*)?>[^<]*<\/[a-z][a-z0-9]*>/i.test(n)?(n=n.replace(/<(?![a-z/!])/gi,"<")).replace(/([^a-z0-9"'\s/])>/gi,"$1>"):n.replace(/</g,"<").replace(/>/g,">"):""}}(r0)),r0}var cd={},j2;function $d(){return j2||(j2=1,function(e){var n=cd&&cd.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0}),e.applyFilter=function(a,o){var s;const c={filters:[]},m={};o.brightnessEnabled&&(c.filters.push(t.default.Filters.Brighten),c.brightness=o.brightness),o.blurEnabled&&(c.filters.push(t.default.Filters.Blur),c.blurRadius=o.blurRadius,o.type==="text"&&o.lineHeight<1&&(m.offset=o.fontSize)),o.sepiaEnabled&&c.filters.push(t.default.Filters.Sepia),o.grayscaleEnabled&&c.filters.push(t.default.Filters.Grayscale),o.filters.forEach((f,v)=>{const y=r[v];y&&c.filters.push(y(f.intensity))}),a.setAttrs(c),c.filters.length?a.cache(Object.assign(Object.assign({},m),{pixelRatio:o.store._elementsPixelRatio})):a.clearCache(),(s=a.getLayer())===null||s===void 0||s.batchDraw()};const t=n(Mi()),r={warm:a=>o=>{const s=o.data;for(let c=0;c<s.length;c+=4)s[c]=Math.min(s[c]+30*a,255),s[c+1]=Math.min(s[c+1]+15*a,255);return o},cold:a=>o=>{const s=o.data;for(let c=0;c<s.length;c+=4)s[c]=Math.min(s[c]-15*a,255),s[c+1]=Math.min(s[c+1]-10*a,255),s[c+2]=Math.min(s[c+2]+15*a,255);return o},natural:a=>o=>{const s=o.data;a=Math.max(0,Math.min(a,1));for(let c=0;c<s.length;c+=4){s[c]=Math.min(s[c]*(1+.1*a),255),s[c+1]=Math.min(s[c+1]*(1+.1*a),255),s[c+2]=Math.min(s[c+2]*(1+.1*a),255);const m=(s[c]+s[c+1]+s[c+2])/3;s[c]=Math.min((s[c]-m)*(1+.2*a)+m,255),s[c+1]=Math.min((s[c+1]-m)*(1+.2*a)+m,255),s[c+2]=Math.min((s[c+2]-m)*(1+.2*a)+m,255)}return o}}}(cd)),cd}var fd={},D2;function Xs(){return D2||(D2=1,function(e){var n=fd&&fd.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0}),e.Highlighter=e.setHighlighterStyle=void 0;const t=n(Or()),r=Ri,a=oo,o={stroke:"rgb(0, 161, 255)",strokeWidth:2};e.setHighlighterStyle=s=>{Object.assign(o,s)},e.Highlighter=(0,r.observer)(({element:s})=>t.default.createElement(a.Rect,Object.assign({name:"highlighter",x:s.a.x,y:s.a.y,rotation:s.a.rotation,width:s.a.width,height:s.a.height,listening:!1,strokeScaleEnabled:!1},o)))}(fd)),fd}var dd={},F2;function es(){return F2||(F2=1,function(e){var n=dd&&dd.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(e,"__esModule",{value:!0}),e.useMobile=e.isTouchDevice=e.mobileStyle=e.isMobile=e.MOBILE_BREAKPOINT=void 0;const t=n(Or());e.MOBILE_BREAKPOINT=800,e.isMobile=()=>window.innerWidth<=e.MOBILE_BREAKPOINT,e.mobileStyle=r=>`
|
|
85
85
|
@media (max-width: ${e.MOBILE_BREAKPOINT}px) {
|
|
86
86
|
${r}
|
|
@@ -89,10 +89,10 @@ For more info see: https://github.com/konvajs/react-konva/issues/194
|
|
|
89
89
|
.polotno-mobile & {
|
|
90
90
|
${r}
|
|
91
91
|
}
|
|
92
|
-
`,e.isTouchDevice=()=>"ontouchstart"in window||navigator.maxTouchPoints>0,e.useMobile=()=>{const[r,a]=t.default.useState((0,e.isMobile)());return t.default.useEffect(()=>{const o=()=>{a((0,e.isMobile)())};return window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)}},[]),r}}(dd)),dd}var z2={},z5="warn";function B5(e){z5=e}function U5(){return z5}function GS(e){B5(e)}var on;(function(e){e.afterCreate="afterCreate",e.afterAttach="afterAttach",e.afterCreationFinalization="afterCreationFinalization",e.beforeDetach="beforeDetach",e.beforeDestroy="beforeDestroy"})(on||(on={}));var av=function(e,n){return av=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])},av(e,n)};function wr(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");av(e,n);function t(){this.constructor=e}e.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}var ln=function(){return ln=Object.assign||function(n){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}return n},ln.apply(this,arguments)};function VS(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)n.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(t[r[a]]=e[r[a]]);return t}function q5(e,n){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,a,o,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(f){return function(v){return m([f,v])}}function m(f){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,f[0]&&(t=0)),t;)try{if(r=1,a&&(o=f[0]&2?a.return:f[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,f[1])).done)return o;switch(a=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return t.label++,{value:f[1],done:!1};case 5:t.label++,a=f[1],f=[0];continue;case 7:f=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){t=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){t.label=f[1];break}if(f[0]===6&&t.label<o[1]){t.label=o[1],o=f;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(f);break}o[2]&&t.ops.pop(),t.trys.pop();continue}f=n.call(e,t)}catch(v){f=[6,v],a=0}finally{r=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function Cd(e){var n=typeof Symbol=="function"&&Symbol.iterator,t=n&&e[n],r=0;if(t)return t.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function io(e,n){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var r=t.call(e),a,o=[],s;try{for(;(n===void 0||n-- >0)&&!(a=r.next()).done;)o.push(a.value)}catch(c){s={error:c}}finally{try{a&&!a.done&&(t=r.return)&&t.call(r)}finally{if(s)throw s.error}}return o}function ao(e,n,t){if(arguments.length===2)for(var r=0,a=n.length,o;r<a;r++)(o||!(r in n))&&(o||(o=Array.prototype.slice.call(n,0,r)),o[r]=n[r]);return e.concat(o||Array.prototype.slice.call(n))}function Wd(e){return dt(e).type}function $S(e,n){return dt(e).getChildType(n)}function H5(e,n){return dt(e).onPatch(n)}function WS(e,n){return dt(e).onSnapshot(n)}function dc(e,n){dt(e).applyPatches(Hv(n))}function YS(e,n){var t={patches:[],inversePatches:[]},r={},a,o={get recording(){return!!a},get patches(){return r.patches||(r.patches=t.patches.slice()),r.patches},get reversedInversePatches(){return r.reversedInversePatches||(r.reversedInversePatches=t.inversePatches.slice().reverse()),r.reversedInversePatches},get inversePatches(){return r.inversePatches||(r.inversePatches=t.inversePatches.slice()),r.inversePatches},stop:function(){a&&(a(),a=void 0)},resume:function(){a||(a=H5(e,function(s,c){n&&!n(s,c,zv())||(t.patches.push(s),t.inversePatches.push(c),r.patches=void 0,r.inversePatches=void 0,r.reversedInversePatches=void 0)}))},replay:function(s){dc(s||e,t.patches)},undo:function(s){dc(s||e,t.inversePatches.slice().reverse())}};return o.resume(),o}function KS(e){var n=dt(e);if(!n.isRoot)throw new lt("`protect` can only be invoked on root nodes");n.isProtectionEnabled=!0}function XS(e){var n=dt(e);if(!n.isRoot)throw new lt("`unprotect` can only be invoked on root nodes");n.isProtectionEnabled=!1}function ZS(e){return dt(e).isProtected}function G5(e,n){return dt(e).applySnapshot(n)}function jv(e,n){n===void 0&&(n=!0);var t=dt(e);return n?t.snapshot:t.type.getSnapshot(t,!1)}function QS(e,n){n===void 0&&(n=1);for(var t=dt(e).parent;t;){if(--n===0)return!0;t=t.parent}return!1}function JS(e,n){n===void 0&&(n=1);for(var t=n,r=dt(e).parent;r;){if(--t===0)return r.storedValue;r=r.parent}throw new lt("Failed to find the parent of ".concat(dt(e)," at depth ").concat(n))}function eE(e,n){for(var t=dt(e).parent;t;){if(n.is(t.storedValue))return!0;t=t.parent}return!1}function tE(e,n){for(var t=dt(e).parent;t;){if(n.is(t.storedValue))return t.storedValue;t=t.parent}throw new lt("Failed to find the parent of ".concat(dt(e)," of a given type"))}function V5(e){return dt(e).root.storedValue}function $5(e){return dt(e).path}function rE(e){return mc(dt(e).path)}function nE(e){return dt(e).isRoot}function iE(e,n){var t=c4(dt(e),n);return t?t.value:void 0}function aE(e,n,t){var r=dt(n).root.identifierCache.resolve(e,_c(t));return r==null?void 0:r.value}function W5(e){return dt(e).identifier}function oE(e,n){n===void 0&&(n=!0);try{var t=e();if(t==null)return;if(ir(t))return n?Dv(t)?t:void 0:t;throw new lt("The reference to be checked is not one of node, null or undefined")}catch(r){if(r instanceof Gv)return;throw r}}function lE(e,n){n===void 0&&(n=!0);try{var t=e();if(t==null)return!1;if(ir(t))return n?Dv(t):!0;throw new lt("The reference to be checked is not one of node, null or undefined")}catch(r){if(r instanceof Gv)return!1;throw r}}function Y5(e,n){var t=c4(dt(e),n,!1);if(t!==void 0)try{return t.value}catch{return}}function sE(e,n){return u4(dt(e),dt(n))}function uE(e,n){n===void 0&&(n=!0);var t=dt(e);return t.type.create(t.snapshot,n===!0?t.root.environment:n===!1?void 0:n)}function cE(e){return dt(e).detach(),e}function fE(e){var n=dt(e);n.isRoot?n.die():n.parent.removeChild(n.subpath)}function Dv(e){return dt(e).observableIsAlive}function dE(e,n){var t=dt(e);return t.addDisposer(n),n}function hE(e){var n=dt(e),t=n.root.environment;if(!t)throw new lt("Failed to find the environment of ".concat(n," ").concat(n.path));return t}function pE(e){var n=dt(e),t=n.root.environment;return!!t}function K5(e,n){var t=dt(e);t.getChildren().forEach(function(r){ir(r.storedValue)&&K5(r.storedValue,n)}),n(t.storedValue)}function X5(e){var n;return ir(e)?n=Wd(e):n=e,{name:n.name,properties:ln({},n.properties)}}function gE(e){var n=dt(e).type,t=ln(ln({},X5(n)),{actions:[],volatile:[],views:[],flowActions:[]}),r=Object.getOwnPropertyNames(e);return r.forEach(function(a){if(!(a in t.properties)){var o=Object.getOwnPropertyDescriptor(e,a);if(o.get){e5(e,a)?t.views.push(a):t.volatile.push(a);return}o.value._isFlowAction===!0&&t.flowActions.push(a),o.value._isMSTAction===!0?t.actions.push(a):r5(e,a)?t.volatile.push(a):t.views.push(a)}}),t}function vE(e){return e}function mE(e){return e}function yE(e){return e}function bE(e){return dt(e).nodeId}var Z5=function(){function e(n,t,r,a){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"_escapedSubpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storedValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"aliveAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_state",{enumerable:!0,configurable:!0,writable:!0,value:Tn.INITIALIZING}),Object.defineProperty(this,"_hookSubscribers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.environment=a,this.baseSetParent(t,r)}return Object.defineProperty(e.prototype,"subpath",{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},set:function(n){var t=this.isAlive;this._state=n;var r=this.isAlive;this.aliveAtom&&t!==r&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this._hookSubscribers&&this._hookSubscribers.emit(n,this,n)}}),Object.defineProperty(e.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){return this._hookSubscribers||(this._hookSubscribers=new g4),this._hookSubscribers.register(n,t)}}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getReconciliationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(e.prototype,"baseSetParent",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){this._parent=n,this._subpath=t,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(e.prototype,"path",{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getEscapedPath",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n&&(this.pathAtom||(this.pathAtom=Ad("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?Vl(this._subpath):""),this.parent.getEscapedPath(n)+"/"+this._escapedSubpath):""}}),Object.defineProperty(e.prototype,"isRoot",{get:function(){return this.parent===null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAlive",{get:function(){return this.state!==Tn.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDetaching",{get:function(){return this.state===Tn.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=Ad("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(this.state===Tn.CREATED){if(this.parent){if(this.parent.state!==Tn.FINALIZED)return;this.fireHook(on.afterAttach)}this.state=Tn.FINALIZED,n&&n()}}}),Object.defineProperty(e.prototype,"baseFinalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._hookSubscribers&&this._hookSubscribers.clearAll(),this._subpathUponDeath=this._subpath,this._pathUponDeath=this.getEscapedPath(!1),this.baseSetParent(null,""),this.state=Tn.DEAD}}),Object.defineProperty(e.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(on.beforeDestroy)}}),e}(),Md=function(e){wr(n,e);function n(t,r,a,o,s){var c=e.call(this,t,r,a,o)||this;try{c.storedValue=t.createNewInstance(s)}catch(m){throw c.state=Tn.DEAD,m}return c.state=Tn.CREATED,c.finalizeCreation(),c}return Object.defineProperty(n.prototype,"root",{get:function(){if(!this.parent)throw new lt("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this.parent!==t,o=this.subpath!==r;!a&&!o||(this.environment=void 0,this.baseSetParent(this.parent,r))}}),Object.defineProperty(n.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(n.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=(this.isAlive?this.path:this.pathUponDeath)||"<root>";return"".concat(this.type.name,"@").concat(t).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(n.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Tn.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(n.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(n.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(n.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(n.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.fireInternalHook(t)}}),n}(Z5);Md.prototype.die=Xr(Md.prototype.die);var wE=1,wa;(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.CREATING=1]="CREATING",e[e.CREATED=2]="CREATED"})(wa||(wa={}));var Pi;(function(e){e.Dispose="dispose",e.Patch="patch",e.Snapshot="snapshot"})(Pi||(Pi={}));var _E={onError:function(e){throw e}},pi=function(e){wr(n,e);function n(t,r,a,o,s){var c=e.call(this,t,r,a,o)||this;if(Object.defineProperty(c,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++wE}),Object.defineProperty(c,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"unnormalizedIdentifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"identifierCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"isProtectionEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(c,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"hasSnapshotPostProcessor",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(c,"_applyPatches",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_applySnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_autoUnbox",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(c,"_isRunningAction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(c,"_hasSnapshotReaction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(c,"_observableInstanceState",{enumerable:!0,configurable:!0,writable:!0,value:wa.UNINITIALIZED}),Object.defineProperty(c,"_childNodes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_initialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_cachedInitialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_cachedInitialSnapshotCreated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(c,"_snapshotComputed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_snapshotUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_internalEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),c._snapshotComputed=Vs(function(){return c.getSnapshot()}),c.unbox=c.unbox.bind(c),c._initialSnapshot=s,c.identifierAttribute=t.identifierAttribute,r||(c.identifierCache=new UE),c._childNodes=t.initializeChildNodes(c,c._initialSnapshot),c.identifier=null,c.unnormalizedIdentifier=null,c.identifierAttribute&&c._initialSnapshot){var m=c._initialSnapshot[c.identifierAttribute];if(m===void 0){var f=c._childNodes[c.identifierAttribute];f&&(m=f.value)}if(typeof m!="string"&&typeof m!="number")throw new lt("Instance identifier '".concat(c.identifierAttribute,"' for type '").concat(c.type.name,"' must be a string or a number"));c.identifier=_c(m),c.unnormalizedIdentifier=m}return r?r.root.identifierCache.addNodeToCache(c):c.identifierCache.addNodeToCache(c),c}return Object.defineProperty(n.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.createObservableInstanceIfNeeded(),this._applyPatches(t)}}),Object.defineProperty(n.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.createObservableInstanceIfNeeded(),this._applySnapshot(t)}}),Object.defineProperty(n.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(t){t===void 0&&(t=!0),this._observableInstanceState===wa.UNINITIALIZED&&this.createObservableInstance(t)}}),Object.defineProperty(n.prototype,"createObservableInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r,a,o,s;t===void 0&&(t=!0),this._observableInstanceState=wa.CREATING;for(var c=[],m=this.parent;m&&m._observableInstanceState===wa.UNINITIALIZED;)c.unshift(m),m=m.parent;try{for(var f=Cd(c),v=f.next();!v.done;v=f.next()){var y=v.value;y.createObservableInstanceIfNeeded(!1)}}catch(x){r={error:x}}finally{try{v&&!v.done&&(a=f.return)&&a.call(f)}finally{if(r)throw r.error}}var E=this.type;try{this.storedValue=E.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,E.finalizeNewInstance(this,this.storedValue)}catch(x){throw this.state=Tn.DEAD,x}finally{this._isRunningAction=!1}if(this._observableInstanceState=wa.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=gc,this.state=Tn.CREATED,t){this.fireHook(on.afterCreate),this.finalizeCreation();try{for(var w=Cd(c.reverse()),S=w.next();!S.done;S=w.next()){var y=S.value;y.fireHook(on.afterCreate),y.finalizeCreation()}}catch(x){o={error:x}}finally{try{S&&!S.done&&(s=w.return)&&s.call(w)}finally{if(o)throw o.error}}}}}),Object.defineProperty(n.prototype,"root",{get:function(){var t=this.parent;return t?t.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(on.beforeDetach);var t=this.state;this.state=Tn.DETACHING;var r=this.root,a=r.environment,o=r.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=a,this.identifierCache=o}finally{this.state=t}}}}),Object.defineProperty(n.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=t!==this.parent,o=r!==this.subpath;!a&&!o||(a?(this.environment=void 0,t.root.identifierCache.mergeCache(this),this.baseSetParent(t,r),this.fireHook(on.afterAttach)):o&&this.baseSetParent(this.parent,r))}}),Object.defineProperty(n.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this;this.fireInternalHook(t);var a=this.storedValue&&typeof this.storedValue=="object"&&this.storedValue[t];typeof a=="function"&&(uc?uc(function(){a.apply(r.storedValue)}):a.apply(this.storedValue))}}),Object.defineProperty(n.prototype,"snapshot",{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===wa.CREATED?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(n.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(n.prototype,"_getCachedInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var t=this.type,r=this._childNodes,a=this._initialSnapshot;this._cachedInitialSnapshot=t.processInitialSnapshot(r,a),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(n.prototype,"isRunningAction",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(n.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=U5();if(!this.isAlive&&r!=="ignore"){var a=this._getAssertAliveError(t);switch(r){case"error":throw new lt(a);case"warn":ex(a)}}}}),Object.defineProperty(n.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.getEscapedPath(!1)||this.pathUponDeath||"",a=t.subpath&&Vl(t.subpath)||"",o=t.actionContext||Fv();o&&o.type!=="action"&&o.parentActionEvent&&(o=o.parentActionEvent);var s="";if(o&&o.name!=null){var c=o&&o.context&&$5(o.context)||r;s="".concat(c,".").concat(o.name,"()")}return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '".concat(this.type.name,"', Path upon death: '").concat(r,"', Subpath: '").concat(a,"', Action: '").concat(s,"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.")}}),Object.defineProperty(n.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.assertAlive({subpath:t}),this._autoUnbox=!1;try{return this._observableInstanceState===wa.CREATED?this.type.getChildNode(this,t):this._childNodes[t]}finally{this._autoUnbox=!0}}}),Object.defineProperty(n.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(gc),this._autoUnbox=!1;try{return this._observableInstanceState===wa.CREATED?this.type.getChildren(this):d4(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(n.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.type.getChildType(t)}}),Object.defineProperty(n.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.assertAlive(t),!this.isRunningAction()&&this.isProtected)throw new lt("Cannot modify '".concat(this,"', the object is protected and can only be modified by using an action."))}}),Object.defineProperty(n.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.type.removeChild(this,t)}}),Object.defineProperty(n.prototype,"unbox",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t&&(this.assertAlive({subpath:t.subpath||t.subpathUponDeath}),this._autoUnbox?t.value:t)}}),Object.defineProperty(n.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=(this.isAlive?this.path:this.pathUponDeath)||"<root>",r=this.identifier?"(id: ".concat(this.identifier,")"):"";return"".concat(this.type.name,"@").concat(t).concat(r).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(n.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;this.baseFinalizeCreation(function(){var r,a;try{for(var o=Cd(t.getChildren()),s=o.next();!s.done;s=o.next()){var c=s.value;c.finalizeCreation()}}catch(m){r={error:m}}finally{try{s&&!s.done&&(a=o.return)&&a.call(o)}finally{if(r)throw r.error}}t.fireInternalHook(on.afterCreationFinalization)})}}),Object.defineProperty(n.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw new lt("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(n.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;this._applyPatches=Ld(this.storedValue,"@APPLY_PATCHES",function(r){r.forEach(function(a){if(!a.path){t.type.applySnapshot(t,a.value);return}var o=mc(a.path),s=f4(t,o.slice(0,-1));s.applyPatchLocally(o[o.length-1],a)})}),this._applySnapshot=Ld(this.storedValue,"@APPLY_SNAPSHOT",function(r){if(r!==t.snapshot)return t.type.applySnapshot(t,r)}),Fs(this.storedValue,"$treenode",this),Fs(this.storedValue,"toJSON",HE)}}),Object.defineProperty(n.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Tn.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(n.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==wa.UNINITIALIZED&&(this.getChildren().forEach(function(t){t.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit(Pi.Dispose),this._internalEventsClear(Pi.Dispose))}}),Object.defineProperty(n.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(r){r.finalizeDeath()}),this.root.identifierCache.notifyDied(this);var t=this.snapshot;this._snapshotUponDeath=t,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(n.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._addSnapshotReaction(),this._internalEventsRegister(Pi.Snapshot,t)}}),Object.defineProperty(n.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._internalEventsEmit(Pi.Snapshot,t)}}),Object.defineProperty(n.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._internalEventsRegister(Pi.Patch,t)}}),Object.defineProperty(n.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(this._internalEventsHasSubscribers(Pi.Patch)){var a=r.path.substr(this.path.length)+(t.path?"/"+t.path:""),o=ZE({},t,{path:a}),s=io(ox(o),2),c=s[0],m=s[1];this._internalEventsEmit(Pi.Patch,c,m)}this.parent&&this.parent.emitPatch(t,r)}}),Object.defineProperty(n.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._internalEventsHas(Pi.Dispose,t)}}),Object.defineProperty(n.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!this.hasDisposer(t)){this._internalEventsRegister(Pi.Dispose,t,!0);return}throw new lt("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(n.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!this._internalEventsHas(Pi.Dispose,t))throw new lt("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister(Pi.Dispose,t)}}),Object.defineProperty(n.prototype,"removeMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.middlewares){var r=this.middlewares.indexOf(t);r>=0&&this.middlewares.splice(r,1)}}}),Object.defineProperty(n.prototype,"addMiddleWare",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this;r===void 0&&(r=!0);var o={handler:t,includeHooks:r};return this.middlewares?this.middlewares.push(o):this.middlewares=[o],function(){a.removeMiddleware(o)}}}),Object.defineProperty(n.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){this.assertWritable({subpath:t}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,t,r)}}),Object.defineProperty(n.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;if(!this._hasSnapshotReaction){var r=$w(function(){return t.snapshot},function(a){return t.emitSnapshot(a)},_E);this.addDisposer(r),this._hasSnapshotReaction=!0}}}),Object.defineProperty(n.prototype,"_internalEventsHasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return!!this._internalEvents&&this._internalEvents.hasSubscribers(t)}}),Object.defineProperty(n.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a){return a===void 0&&(a=!1),this._internalEvents||(this._internalEvents=new g4),this._internalEvents.register(t,r,a)}}),Object.defineProperty(n.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return!!this._internalEvents&&this._internalEvents.has(t,r)}}),Object.defineProperty(n.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){this._internalEvents&&this._internalEvents.unregister(t,r)}}),Object.defineProperty(n.prototype,"_internalEventsEmit",{enumerable:!1,configurable:!0,writable:!0,value:function(t){for(var r,a=[],o=1;o<arguments.length;o++)a[o-1]=arguments[o];this._internalEvents&&(r=this._internalEvents).emit.apply(r,ao([t],io(a),!1))}}),Object.defineProperty(n.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._internalEvents&&this._internalEvents.clear(t)}}),Object.defineProperty(n.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),n}(Z5);pi.prototype.createObservableInstance=Xr(pi.prototype.createObservableInstance);pi.prototype.detach=Xr(pi.prototype.detach);pi.prototype.die=Xr(pi.prototype.die);var Q5,Nt;(function(e){e[e.String=1]="String",e[e.Number=2]="Number",e[e.Boolean=4]="Boolean",e[e.Date=8]="Date",e[e.Literal=16]="Literal",e[e.Array=32]="Array",e[e.Map=64]="Map",e[e.Object=128]="Object",e[e.Frozen=256]="Frozen",e[e.Optional=512]="Optional",e[e.Reference=1024]="Reference",e[e.Identifier=2048]="Identifier",e[e.Late=4096]="Late",e[e.Refinement=8192]="Refinement",e[e.Union=16384]="Union",e[e.Null=32768]="Null",e[e.Undefined=65536]="Undefined",e[e.Integer=131072]="Integer",e[e.Custom=262144]="Custom",e[e.SnapshotProcessor=524288]="SnapshotProcessor",e[e.Lazy=1048576]="Lazy",e[e.Finite=2097152]="Finite",e[e.Float=4194304]="Float"})(Nt||(Nt={}));var J5="cannotDetermine",SE=Symbol("$type"),Xo=function(){function e(n){Object.defineProperty(this,Q5,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"C",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"S",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"T",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"N",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isType",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=n}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){return Yo(this,n),this.instantiate(null,"",t,n).value}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){throw new lt("unimplemented method")}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n===this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){var r=s4(n);if(r){var a=Wd(n);return this.isAssignableFrom(a)?gi():vi(t,n)}return this.isValidSnapshot(n,t)}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this.validate(n,[{path:"",type:this}]).length===0}}),Object.defineProperty(e.prototype,"Type",{get:function(){throw new lt("Factory.Type should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.Type`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"TypeWithoutSTN",{get:function(){throw new lt("Factory.TypeWithoutSTN should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.TypeWithoutSTN`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SnapshotType",{get:function(){throw new lt("Factory.SnapshotType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.SnapshotType`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CreationType",{get:function(){throw new lt("Factory.CreationType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.CreationType`")},enumerable:!1,configurable:!0}),e}();Q5=SE;Xo.prototype.create=Xr(Xo.prototype.create);var hc=function(e){wr(n,e);function n(t){var r=e.call(this,t)||this;return Object.defineProperty(r,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),r}return Object.defineProperty(n.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return t===void 0&&(t=this.getDefaultSnapshot()),e.prototype.create.call(this,t,r)}}),Object.defineProperty(n.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.createObservableInstanceIfNeeded(),t.storedValue}}),Object.defineProperty(n.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return!t.identifierAttribute||t.identifier===_c(r[t.identifierAttribute])}}),Object.defineProperty(n.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return t.isDetaching?!1:t.snapshot===r||ir(r)&&dt(r)===t?!0:t.type===this&&h4(r)&&!ir(r)&&this.isMatchingSnapshotId(t,r)?(t.applySnapshot(r),!0):!1}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=this.tryToReconcileNode(t,r);if(s)return t.setParent(a,o),t;if(t.die(),ir(r)&&this.isAssignableFrom(Wd(r))){var c=dt(r);return c.setParent(a,o),c}return this.instantiate(a,o,void 0,r)}}),Object.defineProperty(n.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),n}(Xo);hc.prototype.create=Xr(hc.prototype.create);var Zs=function(e){wr(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}return Object.defineProperty(n.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t}}),Object.defineProperty(n.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){if(!t.isDetaching&&t.type===this&&t.storedValue===r)return t;var s=this.instantiate(a,o,void 0,r);return t.die(),s}}),Object.defineProperty(n.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),n}(Xo);function sn(e){return typeof e=="object"&&e&&e.isType===!0}var Qa=new Map;function EE(e){return function(t,r,a){switch(t.type){case"action":if(!e.filter||e.filter(t)===!0){var o=e.onStart(t);e.onResume(t,o),Qa.set(t.id,{call:t,context:o,async:!1});try{var s=r(t);return e.onSuspend(t,o),Qa.get(t.id).async===!1&&(Qa.delete(t.id),e.onSuccess(t,o,s)),s}catch(m){throw Qa.delete(t.id),e.onFail(t,o,m),m}}else return r(t);case"flow_spawn":{var c=Qa.get(t.rootId);return c.async=!0,r(t)}case"flow_resume":case"flow_resume_error":{var c=Qa.get(t.rootId);e.onResume(t,c.context);try{return r(t)}finally{e.onSuspend(t,c.context)}}case"flow_throw":{var c=Qa.get(t.rootId);return Qa.delete(t.rootId),e.onFail(t,c.context,t.args[0]),r(t)}case"flow_return":{var c=Qa.get(t.rootId);return Qa.delete(t.rootId),e.onSuccess(t,c.context,t.args[0]),r(t)}}}}var xE=function(){function e(n,t){Object.defineProperty(this,"hooks",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"call",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"flowsPending",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"running",{enumerable:!0,configurable:!0,writable:!0,value:!0}),n&&n.onStart(t)}return Object.defineProperty(e.prototype,"finish",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.running&&(this.running=!1,this.hooks&&this.hooks.onFinish(this.call,n))}}),Object.defineProperty(e.prototype,"incFlowsPending",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending++}}),Object.defineProperty(e.prototype,"decFlowsPending",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending--}}),Object.defineProperty(e.prototype,"hasFlowsPending",{get:function(){return this.flowsPending>0},enumerable:!1,configurable:!0}),e}();function OE(e){var n=new Map;return function(r,a){var o=r.parentActionEvent?n.get(r.parentActionEvent.id):void 0;if(r.type==="action"){var s=ln(ln({},r),{env:o&&o.call.env,parentCall:o&&o.call}),c=!e.filter||e.filter(s),m=c?e:void 0,f=new xE(m,s);n.set(r.id,f);var v=void 0;try{v=a(r)}catch(E){throw n.delete(r.id),f.finish(E),E}return f.hasFlowsPending||(n.delete(r.id),f.finish()),v}else{if(!o)return a(r);switch(r.type){case"flow_spawn":return o.incFlowsPending(),a(r);case"flow_resume":case"flow_resume_error":return a(r);case"flow_throw":{var y=r.args[0];try{return a(r)}finally{o.decFlowsPending(),o.hasFlowsPending||(n.delete(r.parentActionEvent.id),o.finish(y))}}case"flow_return":try{return a(r)}finally{o.decFlowsPending(),o.hasFlowsPending||(n.delete(r.parentActionEvent.id),o.finish())}}}}}function PE(e,n,t,r){if(r instanceof Date)return{$MST_DATE:r.getTime()};if(vc(r))return r;if(ir(r))return ip("[MSTNode: ".concat(Wd(r).name,"]"));if(typeof r=="function")return ip("[function]");if(typeof r=="object"&&!Ds(r)&&!qv(r))return ip("[object ".concat(r&&r.constructor&&r.constructor.name||"Complex Object","]"));try{return JSON.stringify(r),r}catch(a){return ip(""+a)}}function CE(e,n){return n&&typeof n=="object"&&"$MST_DATE"in n?new Date(n.$MST_DATE):n}function ip(e){return{$MST_UNSERIALIZABLE:!0,type:e}}function e4(e,n){uc(function(){Hv(n).forEach(function(t){return kE(e,t)})})}function kE(e,n){var t=Y5(e,n.path||"");if(!t)throw new lt("Invalid action path: ".concat(n.path||""));var r=dt(t);if(n.name==="@APPLY_PATCHES")return dc.call(null,t,n.args[0]);if(n.name==="@APPLY_SNAPSHOT")return G5.call(null,t,n.args[0]);if(typeof t[n.name]!="function")throw new lt("Action '".concat(n.name,"' does not exist in '").concat(r.path,"'"));return t[n.name].apply(t,n.args?n.args.map(function(a){return CE(r,a)}):[])}function AE(e,n){var t=[],r=function(s){var c=n?n(s,zv()):!0;c&&t.push(s)},a,o={actions:t,get recording(){return!!a},stop:function(){a&&(a(),a=void 0)},resume:function(){a||(a=t4(e,r))},replay:function(s){e4(s,t)}};return o.resume(),o}function t4(e,n,t){return t===void 0&&(t=!1),i4(e,function(a,o){if(a.type==="action"&&a.id===a.rootId){var s=dt(a.context),c={name:a.name,path:u4(dt(e),s),args:a.args.map(function(f,v){return PE(s,a.name,v,f)})};if(t){var m=o(a);return n(c),m}else return n(c),o(a)}else return o(a)})}var TE=1,kd;function Fv(){return kd}function r4(){return TE++}function ov(e,n){var t=dt(e.context);e.type==="action"&&t.assertAlive({actionContext:e});var r=t._isRunningAction;t._isRunningAction=!0;var a=kd;kd=e;try{return LE(t,e,n)}finally{kd=a,t._isRunningAction=r}}function n4(e){if(e)return e.type==="action"?e:e.parentActionEvent}function Ld(e,n,t){var r=function(){var a=r4(),o=kd,s=n4(o);return ov({type:"action",name:n,id:a,args:v4(arguments),context:e,tree:V5(e),rootId:o?o.rootId:a,parentId:o?o.id:0,allParentIds:o?ao(ao([],io(o.allParentIds),!1),[o.id],!1):[],parentEvent:o,parentActionEvent:s},t)};return r._isMSTAction=!0,r._isFlowAction=t._isFlowAction,r}function i4(e,n,t){t===void 0&&(t=!0);var r=dt(e);return r.addMiddleWare(n,t)}function RE(e,n,t){t===void 0&&(t=!0);var r={handler:e,includeHooks:t};return n.$mst_middleware=n.$mst_middleware||[],n.$mst_middleware.push(r),n}var ME=function(){function e(n,t){Object.defineProperty(this,"arrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"inArrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:[]}),t.$mst_middleware&&this.middlewares.push(t.$mst_middleware);for(var r=n;r;)r.middlewares&&this.middlewares.push(r.middlewares),r=r.parent}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getNextMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=this.middlewares[this.arrayIndex];if(n){var t=n[this.inArrayIndex++];return t||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}}),e}();function LE(e,n,t){var r=new ME(e,t);if(r.isEmpty)return Xr(t).apply(null,n.args);var a=null;function o(s){var c=r.getNextMiddleware(),m=c&&c.handler;if(!m)return Xr(t).apply(null,s.args);if(!c.includeHooks&&on[s.name])return o(s);function f(y,E){a=o(y),E&&(a=E(a))}function v(y){a=y}return m(s,f,v),a}return o(n)}function zv(){for(var e=Fv();e&&e.type!=="action";)e=e.parentActionEvent;return e}function a4(e,n,t){for(var r=typeof n=="number"?n:n.id,a=t?e:e.parentActionEvent;a;){if(a.id===r)return!0;a=a.parentActionEvent}return!1}function NE(e,n){return a4(e,n,!1)}function IE(e,n){return a4(e,n,!0)}function jE(e){try{return JSON.stringify(e)}catch(n){return"<Unserializable: ".concat(n,">")}}function o4(e){return typeof e=="function"?"<function".concat(e.name?" "+e.name:"",">"):ir(e)?"<".concat(e,">"):"`".concat(jE(e),"`")}function DE(e){return e.length<280?e:"".concat(e.substring(0,272),"......").concat(e.substring(e.length-8))}function FE(e){var n=e.value,t=e.context[e.context.length-1].type,r=e.context.map(function(c){var m=c.path;return m}).filter(function(c){return c.length>0}).join("/"),a=r.length>0?'at path "/'.concat(r,'" '):"",o=ir(n)?"value of type ".concat(dt(n).type.name,":"):vc(n)?"value":"snapshot",s=t&&ir(n)&&t.is(dt(n).snapshot);return"".concat(a).concat(o," ").concat(o4(n)," is not assignable ").concat(t?"to type: `".concat(t.name,"`"):"")+(e.message?" (".concat(e.message,")"):"")+(t?k4(t)||vc(n)?".":", expected an instance of `".concat(t.name,"` or a snapshot like `").concat(t.describe(),"` instead.")+(s?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function Bv(e,n,t){return e.concat([{path:n,type:t}])}function gi(){return pc}function vi(e,n,t){return[{context:e,value:n,message:t}]}function qp(e){return e.reduce(function(n,t){return n.concat(t)},[])}function Yo(e,n){tx()&&l4(e,n)}function l4(e,n){var t=e.validate(n,[{path:"",type:e}]);if(t.length>0)throw new lt(zE(e,n,t))}function zE(e,n,t){if(t.length!==0)return"Error while converting ".concat(DE(o4(n))," to `").concat(e.name,`\`:
|
|
92
|
+
`,e.isTouchDevice=()=>"ontouchstart"in window||navigator.maxTouchPoints>0,e.useMobile=()=>{const[r,a]=t.default.useState((0,e.isMobile)());return t.default.useEffect(()=>{const o=()=>{a((0,e.isMobile)())};return window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)}},[]),r}}(dd)),dd}var z2={},zw="warn";function Bw(e){zw=e}function Uw(){return zw}function GS(e){Bw(e)}var on;(function(e){e.afterCreate="afterCreate",e.afterAttach="afterAttach",e.afterCreationFinalization="afterCreationFinalization",e.beforeDetach="beforeDetach",e.beforeDestroy="beforeDestroy"})(on||(on={}));var av=function(e,n){return av=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])},av(e,n)};function wr(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");av(e,n);function t(){this.constructor=e}e.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}var ln=function(){return ln=Object.assign||function(n){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}return n},ln.apply(this,arguments)};function VS(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)n.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(t[r[a]]=e[r[a]]);return t}function qw(e,n){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,a,o,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(f){return function(v){return m([f,v])}}function m(f){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,f[0]&&(t=0)),t;)try{if(r=1,a&&(o=f[0]&2?a.return:f[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,f[1])).done)return o;switch(a=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return t.label++,{value:f[1],done:!1};case 5:t.label++,a=f[1],f=[0];continue;case 7:f=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){t=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){t.label=f[1];break}if(f[0]===6&&t.label<o[1]){t.label=o[1],o=f;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(f);break}o[2]&&t.ops.pop(),t.trys.pop();continue}f=n.call(e,t)}catch(v){f=[6,v],a=0}finally{r=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function Cd(e){var n=typeof Symbol=="function"&&Symbol.iterator,t=n&&e[n],r=0;if(t)return t.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function io(e,n){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var r=t.call(e),a,o=[],s;try{for(;(n===void 0||n-- >0)&&!(a=r.next()).done;)o.push(a.value)}catch(c){s={error:c}}finally{try{a&&!a.done&&(t=r.return)&&t.call(r)}finally{if(s)throw s.error}}return o}function ao(e,n,t){if(arguments.length===2)for(var r=0,a=n.length,o;r<a;r++)(o||!(r in n))&&(o||(o=Array.prototype.slice.call(n,0,r)),o[r]=n[r]);return e.concat(o||Array.prototype.slice.call(n))}function Wd(e){return dt(e).type}function $S(e,n){return dt(e).getChildType(n)}function Hw(e,n){return dt(e).onPatch(n)}function WS(e,n){return dt(e).onSnapshot(n)}function dc(e,n){dt(e).applyPatches(Hv(n))}function YS(e,n){var t={patches:[],inversePatches:[]},r={},a,o={get recording(){return!!a},get patches(){return r.patches||(r.patches=t.patches.slice()),r.patches},get reversedInversePatches(){return r.reversedInversePatches||(r.reversedInversePatches=t.inversePatches.slice().reverse()),r.reversedInversePatches},get inversePatches(){return r.inversePatches||(r.inversePatches=t.inversePatches.slice()),r.inversePatches},stop:function(){a&&(a(),a=void 0)},resume:function(){a||(a=Hw(e,function(s,c){n&&!n(s,c,zv())||(t.patches.push(s),t.inversePatches.push(c),r.patches=void 0,r.inversePatches=void 0,r.reversedInversePatches=void 0)}))},replay:function(s){dc(s||e,t.patches)},undo:function(s){dc(s||e,t.inversePatches.slice().reverse())}};return o.resume(),o}function KS(e){var n=dt(e);if(!n.isRoot)throw new lt("`protect` can only be invoked on root nodes");n.isProtectionEnabled=!0}function XS(e){var n=dt(e);if(!n.isRoot)throw new lt("`unprotect` can only be invoked on root nodes");n.isProtectionEnabled=!1}function ZS(e){return dt(e).isProtected}function Gw(e,n){return dt(e).applySnapshot(n)}function jv(e,n){n===void 0&&(n=!0);var t=dt(e);return n?t.snapshot:t.type.getSnapshot(t,!1)}function QS(e,n){n===void 0&&(n=1);for(var t=dt(e).parent;t;){if(--n===0)return!0;t=t.parent}return!1}function JS(e,n){n===void 0&&(n=1);for(var t=n,r=dt(e).parent;r;){if(--t===0)return r.storedValue;r=r.parent}throw new lt("Failed to find the parent of ".concat(dt(e)," at depth ").concat(n))}function eE(e,n){for(var t=dt(e).parent;t;){if(n.is(t.storedValue))return!0;t=t.parent}return!1}function tE(e,n){for(var t=dt(e).parent;t;){if(n.is(t.storedValue))return t.storedValue;t=t.parent}throw new lt("Failed to find the parent of ".concat(dt(e)," of a given type"))}function Vw(e){return dt(e).root.storedValue}function $w(e){return dt(e).path}function rE(e){return mc(dt(e).path)}function nE(e){return dt(e).isRoot}function iE(e,n){var t=c4(dt(e),n);return t?t.value:void 0}function aE(e,n,t){var r=dt(n).root.identifierCache.resolve(e,_c(t));return r==null?void 0:r.value}function Ww(e){return dt(e).identifier}function oE(e,n){n===void 0&&(n=!0);try{var t=e();if(t==null)return;if(ir(t))return n?Dv(t)?t:void 0:t;throw new lt("The reference to be checked is not one of node, null or undefined")}catch(r){if(r instanceof Gv)return;throw r}}function lE(e,n){n===void 0&&(n=!0);try{var t=e();if(t==null)return!1;if(ir(t))return n?Dv(t):!0;throw new lt("The reference to be checked is not one of node, null or undefined")}catch(r){if(r instanceof Gv)return!1;throw r}}function Yw(e,n){var t=c4(dt(e),n,!1);if(t!==void 0)try{return t.value}catch{return}}function sE(e,n){return u4(dt(e),dt(n))}function uE(e,n){n===void 0&&(n=!0);var t=dt(e);return t.type.create(t.snapshot,n===!0?t.root.environment:n===!1?void 0:n)}function cE(e){return dt(e).detach(),e}function fE(e){var n=dt(e);n.isRoot?n.die():n.parent.removeChild(n.subpath)}function Dv(e){return dt(e).observableIsAlive}function dE(e,n){var t=dt(e);return t.addDisposer(n),n}function hE(e){var n=dt(e),t=n.root.environment;if(!t)throw new lt("Failed to find the environment of ".concat(n," ").concat(n.path));return t}function pE(e){var n=dt(e),t=n.root.environment;return!!t}function Kw(e,n){var t=dt(e);t.getChildren().forEach(function(r){ir(r.storedValue)&&Kw(r.storedValue,n)}),n(t.storedValue)}function Xw(e){var n;return ir(e)?n=Wd(e):n=e,{name:n.name,properties:ln({},n.properties)}}function gE(e){var n=dt(e).type,t=ln(ln({},Xw(n)),{actions:[],volatile:[],views:[],flowActions:[]}),r=Object.getOwnPropertyNames(e);return r.forEach(function(a){if(!(a in t.properties)){var o=Object.getOwnPropertyDescriptor(e,a);if(o.get){ew(e,a)?t.views.push(a):t.volatile.push(a);return}o.value._isFlowAction===!0&&t.flowActions.push(a),o.value._isMSTAction===!0?t.actions.push(a):rw(e,a)?t.volatile.push(a):t.views.push(a)}}),t}function vE(e){return e}function mE(e){return e}function yE(e){return e}function bE(e){return dt(e).nodeId}var Zw=function(){function e(n,t,r,a){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"_escapedSubpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storedValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"aliveAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_state",{enumerable:!0,configurable:!0,writable:!0,value:Tn.INITIALIZING}),Object.defineProperty(this,"_hookSubscribers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.environment=a,this.baseSetParent(t,r)}return Object.defineProperty(e.prototype,"subpath",{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},set:function(n){var t=this.isAlive;this._state=n;var r=this.isAlive;this.aliveAtom&&t!==r&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this._hookSubscribers&&this._hookSubscribers.emit(n,this,n)}}),Object.defineProperty(e.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){return this._hookSubscribers||(this._hookSubscribers=new g4),this._hookSubscribers.register(n,t)}}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getReconciliationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(e.prototype,"baseSetParent",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){this._parent=n,this._subpath=t,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(e.prototype,"path",{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getEscapedPath",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n&&(this.pathAtom||(this.pathAtom=Ad("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?Vl(this._subpath):""),this.parent.getEscapedPath(n)+"/"+this._escapedSubpath):""}}),Object.defineProperty(e.prototype,"isRoot",{get:function(){return this.parent===null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAlive",{get:function(){return this.state!==Tn.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDetaching",{get:function(){return this.state===Tn.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=Ad("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(this.state===Tn.CREATED){if(this.parent){if(this.parent.state!==Tn.FINALIZED)return;this.fireHook(on.afterAttach)}this.state=Tn.FINALIZED,n&&n()}}}),Object.defineProperty(e.prototype,"baseFinalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._hookSubscribers&&this._hookSubscribers.clearAll(),this._subpathUponDeath=this._subpath,this._pathUponDeath=this.getEscapedPath(!1),this.baseSetParent(null,""),this.state=Tn.DEAD}}),Object.defineProperty(e.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(on.beforeDestroy)}}),e}(),Md=function(e){wr(n,e);function n(t,r,a,o,s){var c=e.call(this,t,r,a,o)||this;try{c.storedValue=t.createNewInstance(s)}catch(m){throw c.state=Tn.DEAD,m}return c.state=Tn.CREATED,c.finalizeCreation(),c}return Object.defineProperty(n.prototype,"root",{get:function(){if(!this.parent)throw new lt("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this.parent!==t,o=this.subpath!==r;!a&&!o||(this.environment=void 0,this.baseSetParent(this.parent,r))}}),Object.defineProperty(n.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(n.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=(this.isAlive?this.path:this.pathUponDeath)||"<root>";return"".concat(this.type.name,"@").concat(t).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(n.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Tn.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(n.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(n.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(n.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(n.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.fireInternalHook(t)}}),n}(Zw);Md.prototype.die=Xr(Md.prototype.die);var wE=1,wa;(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.CREATING=1]="CREATING",e[e.CREATED=2]="CREATED"})(wa||(wa={}));var Pi;(function(e){e.Dispose="dispose",e.Patch="patch",e.Snapshot="snapshot"})(Pi||(Pi={}));var _E={onError:function(e){throw e}},pi=function(e){wr(n,e);function n(t,r,a,o,s){var c=e.call(this,t,r,a,o)||this;if(Object.defineProperty(c,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++wE}),Object.defineProperty(c,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"unnormalizedIdentifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"identifierCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"isProtectionEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(c,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"hasSnapshotPostProcessor",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(c,"_applyPatches",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_applySnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_autoUnbox",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(c,"_isRunningAction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(c,"_hasSnapshotReaction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(c,"_observableInstanceState",{enumerable:!0,configurable:!0,writable:!0,value:wa.UNINITIALIZED}),Object.defineProperty(c,"_childNodes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_initialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_cachedInitialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_cachedInitialSnapshotCreated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(c,"_snapshotComputed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_snapshotUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_internalEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),c._snapshotComputed=Vs(function(){return c.getSnapshot()}),c.unbox=c.unbox.bind(c),c._initialSnapshot=s,c.identifierAttribute=t.identifierAttribute,r||(c.identifierCache=new UE),c._childNodes=t.initializeChildNodes(c,c._initialSnapshot),c.identifier=null,c.unnormalizedIdentifier=null,c.identifierAttribute&&c._initialSnapshot){var m=c._initialSnapshot[c.identifierAttribute];if(m===void 0){var f=c._childNodes[c.identifierAttribute];f&&(m=f.value)}if(typeof m!="string"&&typeof m!="number")throw new lt("Instance identifier '".concat(c.identifierAttribute,"' for type '").concat(c.type.name,"' must be a string or a number"));c.identifier=_c(m),c.unnormalizedIdentifier=m}return r?r.root.identifierCache.addNodeToCache(c):c.identifierCache.addNodeToCache(c),c}return Object.defineProperty(n.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.createObservableInstanceIfNeeded(),this._applyPatches(t)}}),Object.defineProperty(n.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.createObservableInstanceIfNeeded(),this._applySnapshot(t)}}),Object.defineProperty(n.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(t){t===void 0&&(t=!0),this._observableInstanceState===wa.UNINITIALIZED&&this.createObservableInstance(t)}}),Object.defineProperty(n.prototype,"createObservableInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r,a,o,s;t===void 0&&(t=!0),this._observableInstanceState=wa.CREATING;for(var c=[],m=this.parent;m&&m._observableInstanceState===wa.UNINITIALIZED;)c.unshift(m),m=m.parent;try{for(var f=Cd(c),v=f.next();!v.done;v=f.next()){var y=v.value;y.createObservableInstanceIfNeeded(!1)}}catch(x){r={error:x}}finally{try{v&&!v.done&&(a=f.return)&&a.call(f)}finally{if(r)throw r.error}}var E=this.type;try{this.storedValue=E.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,E.finalizeNewInstance(this,this.storedValue)}catch(x){throw this.state=Tn.DEAD,x}finally{this._isRunningAction=!1}if(this._observableInstanceState=wa.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=gc,this.state=Tn.CREATED,t){this.fireHook(on.afterCreate),this.finalizeCreation();try{for(var w=Cd(c.reverse()),S=w.next();!S.done;S=w.next()){var y=S.value;y.fireHook(on.afterCreate),y.finalizeCreation()}}catch(x){o={error:x}}finally{try{S&&!S.done&&(s=w.return)&&s.call(w)}finally{if(o)throw o.error}}}}}),Object.defineProperty(n.prototype,"root",{get:function(){var t=this.parent;return t?t.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(on.beforeDetach);var t=this.state;this.state=Tn.DETACHING;var r=this.root,a=r.environment,o=r.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=a,this.identifierCache=o}finally{this.state=t}}}}),Object.defineProperty(n.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=t!==this.parent,o=r!==this.subpath;!a&&!o||(a?(this.environment=void 0,t.root.identifierCache.mergeCache(this),this.baseSetParent(t,r),this.fireHook(on.afterAttach)):o&&this.baseSetParent(this.parent,r))}}),Object.defineProperty(n.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this;this.fireInternalHook(t);var a=this.storedValue&&typeof this.storedValue=="object"&&this.storedValue[t];typeof a=="function"&&(uc?uc(function(){a.apply(r.storedValue)}):a.apply(this.storedValue))}}),Object.defineProperty(n.prototype,"snapshot",{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===wa.CREATED?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(n.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(n.prototype,"_getCachedInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var t=this.type,r=this._childNodes,a=this._initialSnapshot;this._cachedInitialSnapshot=t.processInitialSnapshot(r,a),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(n.prototype,"isRunningAction",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(n.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=Uw();if(!this.isAlive&&r!=="ignore"){var a=this._getAssertAliveError(t);switch(r){case"error":throw new lt(a);case"warn":ex(a)}}}}),Object.defineProperty(n.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.getEscapedPath(!1)||this.pathUponDeath||"",a=t.subpath&&Vl(t.subpath)||"",o=t.actionContext||Fv();o&&o.type!=="action"&&o.parentActionEvent&&(o=o.parentActionEvent);var s="";if(o&&o.name!=null){var c=o&&o.context&&$w(o.context)||r;s="".concat(c,".").concat(o.name,"()")}return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '".concat(this.type.name,"', Path upon death: '").concat(r,"', Subpath: '").concat(a,"', Action: '").concat(s,"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.")}}),Object.defineProperty(n.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.assertAlive({subpath:t}),this._autoUnbox=!1;try{return this._observableInstanceState===wa.CREATED?this.type.getChildNode(this,t):this._childNodes[t]}finally{this._autoUnbox=!0}}}),Object.defineProperty(n.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(gc),this._autoUnbox=!1;try{return this._observableInstanceState===wa.CREATED?this.type.getChildren(this):d4(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(n.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.type.getChildType(t)}}),Object.defineProperty(n.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.assertAlive(t),!this.isRunningAction()&&this.isProtected)throw new lt("Cannot modify '".concat(this,"', the object is protected and can only be modified by using an action."))}}),Object.defineProperty(n.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.type.removeChild(this,t)}}),Object.defineProperty(n.prototype,"unbox",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t&&(this.assertAlive({subpath:t.subpath||t.subpathUponDeath}),this._autoUnbox?t.value:t)}}),Object.defineProperty(n.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=(this.isAlive?this.path:this.pathUponDeath)||"<root>",r=this.identifier?"(id: ".concat(this.identifier,")"):"";return"".concat(this.type.name,"@").concat(t).concat(r).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(n.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;this.baseFinalizeCreation(function(){var r,a;try{for(var o=Cd(t.getChildren()),s=o.next();!s.done;s=o.next()){var c=s.value;c.finalizeCreation()}}catch(m){r={error:m}}finally{try{s&&!s.done&&(a=o.return)&&a.call(o)}finally{if(r)throw r.error}}t.fireInternalHook(on.afterCreationFinalization)})}}),Object.defineProperty(n.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw new lt("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(n.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;this._applyPatches=Ld(this.storedValue,"@APPLY_PATCHES",function(r){r.forEach(function(a){if(!a.path){t.type.applySnapshot(t,a.value);return}var o=mc(a.path),s=f4(t,o.slice(0,-1));s.applyPatchLocally(o[o.length-1],a)})}),this._applySnapshot=Ld(this.storedValue,"@APPLY_SNAPSHOT",function(r){if(r!==t.snapshot)return t.type.applySnapshot(t,r)}),Fs(this.storedValue,"$treenode",this),Fs(this.storedValue,"toJSON",HE)}}),Object.defineProperty(n.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Tn.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(n.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==wa.UNINITIALIZED&&(this.getChildren().forEach(function(t){t.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit(Pi.Dispose),this._internalEventsClear(Pi.Dispose))}}),Object.defineProperty(n.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(r){r.finalizeDeath()}),this.root.identifierCache.notifyDied(this);var t=this.snapshot;this._snapshotUponDeath=t,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(n.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._addSnapshotReaction(),this._internalEventsRegister(Pi.Snapshot,t)}}),Object.defineProperty(n.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._internalEventsEmit(Pi.Snapshot,t)}}),Object.defineProperty(n.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._internalEventsRegister(Pi.Patch,t)}}),Object.defineProperty(n.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(this._internalEventsHasSubscribers(Pi.Patch)){var a=r.path.substr(this.path.length)+(t.path?"/"+t.path:""),o=ZE({},t,{path:a}),s=io(ox(o),2),c=s[0],m=s[1];this._internalEventsEmit(Pi.Patch,c,m)}this.parent&&this.parent.emitPatch(t,r)}}),Object.defineProperty(n.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._internalEventsHas(Pi.Dispose,t)}}),Object.defineProperty(n.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!this.hasDisposer(t)){this._internalEventsRegister(Pi.Dispose,t,!0);return}throw new lt("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(n.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!this._internalEventsHas(Pi.Dispose,t))throw new lt("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister(Pi.Dispose,t)}}),Object.defineProperty(n.prototype,"removeMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.middlewares){var r=this.middlewares.indexOf(t);r>=0&&this.middlewares.splice(r,1)}}}),Object.defineProperty(n.prototype,"addMiddleWare",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this;r===void 0&&(r=!0);var o={handler:t,includeHooks:r};return this.middlewares?this.middlewares.push(o):this.middlewares=[o],function(){a.removeMiddleware(o)}}}),Object.defineProperty(n.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){this.assertWritable({subpath:t}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,t,r)}}),Object.defineProperty(n.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;if(!this._hasSnapshotReaction){var r=$5(function(){return t.snapshot},function(a){return t.emitSnapshot(a)},_E);this.addDisposer(r),this._hasSnapshotReaction=!0}}}),Object.defineProperty(n.prototype,"_internalEventsHasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return!!this._internalEvents&&this._internalEvents.hasSubscribers(t)}}),Object.defineProperty(n.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a){return a===void 0&&(a=!1),this._internalEvents||(this._internalEvents=new g4),this._internalEvents.register(t,r,a)}}),Object.defineProperty(n.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return!!this._internalEvents&&this._internalEvents.has(t,r)}}),Object.defineProperty(n.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){this._internalEvents&&this._internalEvents.unregister(t,r)}}),Object.defineProperty(n.prototype,"_internalEventsEmit",{enumerable:!1,configurable:!0,writable:!0,value:function(t){for(var r,a=[],o=1;o<arguments.length;o++)a[o-1]=arguments[o];this._internalEvents&&(r=this._internalEvents).emit.apply(r,ao([t],io(a),!1))}}),Object.defineProperty(n.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._internalEvents&&this._internalEvents.clear(t)}}),Object.defineProperty(n.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),n}(Zw);pi.prototype.createObservableInstance=Xr(pi.prototype.createObservableInstance);pi.prototype.detach=Xr(pi.prototype.detach);pi.prototype.die=Xr(pi.prototype.die);var Qw,Nt;(function(e){e[e.String=1]="String",e[e.Number=2]="Number",e[e.Boolean=4]="Boolean",e[e.Date=8]="Date",e[e.Literal=16]="Literal",e[e.Array=32]="Array",e[e.Map=64]="Map",e[e.Object=128]="Object",e[e.Frozen=256]="Frozen",e[e.Optional=512]="Optional",e[e.Reference=1024]="Reference",e[e.Identifier=2048]="Identifier",e[e.Late=4096]="Late",e[e.Refinement=8192]="Refinement",e[e.Union=16384]="Union",e[e.Null=32768]="Null",e[e.Undefined=65536]="Undefined",e[e.Integer=131072]="Integer",e[e.Custom=262144]="Custom",e[e.SnapshotProcessor=524288]="SnapshotProcessor",e[e.Lazy=1048576]="Lazy",e[e.Finite=2097152]="Finite",e[e.Float=4194304]="Float"})(Nt||(Nt={}));var Jw="cannotDetermine",SE=Symbol("$type"),Xo=function(){function e(n){Object.defineProperty(this,Qw,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"C",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"S",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"T",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"N",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isType",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=n}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){return Yo(this,n),this.instantiate(null,"",t,n).value}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){throw new lt("unimplemented method")}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n===this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){var r=s4(n);if(r){var a=Wd(n);return this.isAssignableFrom(a)?gi():vi(t,n)}return this.isValidSnapshot(n,t)}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this.validate(n,[{path:"",type:this}]).length===0}}),Object.defineProperty(e.prototype,"Type",{get:function(){throw new lt("Factory.Type should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.Type`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"TypeWithoutSTN",{get:function(){throw new lt("Factory.TypeWithoutSTN should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.TypeWithoutSTN`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SnapshotType",{get:function(){throw new lt("Factory.SnapshotType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.SnapshotType`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CreationType",{get:function(){throw new lt("Factory.CreationType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.CreationType`")},enumerable:!1,configurable:!0}),e}();Qw=SE;Xo.prototype.create=Xr(Xo.prototype.create);var hc=function(e){wr(n,e);function n(t){var r=e.call(this,t)||this;return Object.defineProperty(r,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),r}return Object.defineProperty(n.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return t===void 0&&(t=this.getDefaultSnapshot()),e.prototype.create.call(this,t,r)}}),Object.defineProperty(n.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.createObservableInstanceIfNeeded(),t.storedValue}}),Object.defineProperty(n.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return!t.identifierAttribute||t.identifier===_c(r[t.identifierAttribute])}}),Object.defineProperty(n.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return t.isDetaching?!1:t.snapshot===r||ir(r)&&dt(r)===t?!0:t.type===this&&h4(r)&&!ir(r)&&this.isMatchingSnapshotId(t,r)?(t.applySnapshot(r),!0):!1}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=this.tryToReconcileNode(t,r);if(s)return t.setParent(a,o),t;if(t.die(),ir(r)&&this.isAssignableFrom(Wd(r))){var c=dt(r);return c.setParent(a,o),c}return this.instantiate(a,o,void 0,r)}}),Object.defineProperty(n.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),n}(Xo);hc.prototype.create=Xr(hc.prototype.create);var Zs=function(e){wr(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}return Object.defineProperty(n.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t}}),Object.defineProperty(n.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){if(!t.isDetaching&&t.type===this&&t.storedValue===r)return t;var s=this.instantiate(a,o,void 0,r);return t.die(),s}}),Object.defineProperty(n.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),n}(Xo);function sn(e){return typeof e=="object"&&e&&e.isType===!0}var Qa=new Map;function EE(e){return function(t,r,a){switch(t.type){case"action":if(!e.filter||e.filter(t)===!0){var o=e.onStart(t);e.onResume(t,o),Qa.set(t.id,{call:t,context:o,async:!1});try{var s=r(t);return e.onSuspend(t,o),Qa.get(t.id).async===!1&&(Qa.delete(t.id),e.onSuccess(t,o,s)),s}catch(m){throw Qa.delete(t.id),e.onFail(t,o,m),m}}else return r(t);case"flow_spawn":{var c=Qa.get(t.rootId);return c.async=!0,r(t)}case"flow_resume":case"flow_resume_error":{var c=Qa.get(t.rootId);e.onResume(t,c.context);try{return r(t)}finally{e.onSuspend(t,c.context)}}case"flow_throw":{var c=Qa.get(t.rootId);return Qa.delete(t.rootId),e.onFail(t,c.context,t.args[0]),r(t)}case"flow_return":{var c=Qa.get(t.rootId);return Qa.delete(t.rootId),e.onSuccess(t,c.context,t.args[0]),r(t)}}}}var xE=function(){function e(n,t){Object.defineProperty(this,"hooks",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"call",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"flowsPending",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"running",{enumerable:!0,configurable:!0,writable:!0,value:!0}),n&&n.onStart(t)}return Object.defineProperty(e.prototype,"finish",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.running&&(this.running=!1,this.hooks&&this.hooks.onFinish(this.call,n))}}),Object.defineProperty(e.prototype,"incFlowsPending",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending++}}),Object.defineProperty(e.prototype,"decFlowsPending",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending--}}),Object.defineProperty(e.prototype,"hasFlowsPending",{get:function(){return this.flowsPending>0},enumerable:!1,configurable:!0}),e}();function OE(e){var n=new Map;return function(r,a){var o=r.parentActionEvent?n.get(r.parentActionEvent.id):void 0;if(r.type==="action"){var s=ln(ln({},r),{env:o&&o.call.env,parentCall:o&&o.call}),c=!e.filter||e.filter(s),m=c?e:void 0,f=new xE(m,s);n.set(r.id,f);var v=void 0;try{v=a(r)}catch(E){throw n.delete(r.id),f.finish(E),E}return f.hasFlowsPending||(n.delete(r.id),f.finish()),v}else{if(!o)return a(r);switch(r.type){case"flow_spawn":return o.incFlowsPending(),a(r);case"flow_resume":case"flow_resume_error":return a(r);case"flow_throw":{var y=r.args[0];try{return a(r)}finally{o.decFlowsPending(),o.hasFlowsPending||(n.delete(r.parentActionEvent.id),o.finish(y))}}case"flow_return":try{return a(r)}finally{o.decFlowsPending(),o.hasFlowsPending||(n.delete(r.parentActionEvent.id),o.finish())}}}}}function PE(e,n,t,r){if(r instanceof Date)return{$MST_DATE:r.getTime()};if(vc(r))return r;if(ir(r))return ip("[MSTNode: ".concat(Wd(r).name,"]"));if(typeof r=="function")return ip("[function]");if(typeof r=="object"&&!Ds(r)&&!qv(r))return ip("[object ".concat(r&&r.constructor&&r.constructor.name||"Complex Object","]"));try{return JSON.stringify(r),r}catch(a){return ip(""+a)}}function CE(e,n){return n&&typeof n=="object"&&"$MST_DATE"in n?new Date(n.$MST_DATE):n}function ip(e){return{$MST_UNSERIALIZABLE:!0,type:e}}function e4(e,n){uc(function(){Hv(n).forEach(function(t){return kE(e,t)})})}function kE(e,n){var t=Yw(e,n.path||"");if(!t)throw new lt("Invalid action path: ".concat(n.path||""));var r=dt(t);if(n.name==="@APPLY_PATCHES")return dc.call(null,t,n.args[0]);if(n.name==="@APPLY_SNAPSHOT")return Gw.call(null,t,n.args[0]);if(typeof t[n.name]!="function")throw new lt("Action '".concat(n.name,"' does not exist in '").concat(r.path,"'"));return t[n.name].apply(t,n.args?n.args.map(function(a){return CE(r,a)}):[])}function AE(e,n){var t=[],r=function(s){var c=n?n(s,zv()):!0;c&&t.push(s)},a,o={actions:t,get recording(){return!!a},stop:function(){a&&(a(),a=void 0)},resume:function(){a||(a=t4(e,r))},replay:function(s){e4(s,t)}};return o.resume(),o}function t4(e,n,t){return t===void 0&&(t=!1),i4(e,function(a,o){if(a.type==="action"&&a.id===a.rootId){var s=dt(a.context),c={name:a.name,path:u4(dt(e),s),args:a.args.map(function(f,v){return PE(s,a.name,v,f)})};if(t){var m=o(a);return n(c),m}else return n(c),o(a)}else return o(a)})}var TE=1,kd;function Fv(){return kd}function r4(){return TE++}function ov(e,n){var t=dt(e.context);e.type==="action"&&t.assertAlive({actionContext:e});var r=t._isRunningAction;t._isRunningAction=!0;var a=kd;kd=e;try{return LE(t,e,n)}finally{kd=a,t._isRunningAction=r}}function n4(e){if(e)return e.type==="action"?e:e.parentActionEvent}function Ld(e,n,t){var r=function(){var a=r4(),o=kd,s=n4(o);return ov({type:"action",name:n,id:a,args:v4(arguments),context:e,tree:Vw(e),rootId:o?o.rootId:a,parentId:o?o.id:0,allParentIds:o?ao(ao([],io(o.allParentIds),!1),[o.id],!1):[],parentEvent:o,parentActionEvent:s},t)};return r._isMSTAction=!0,r._isFlowAction=t._isFlowAction,r}function i4(e,n,t){t===void 0&&(t=!0);var r=dt(e);return r.addMiddleWare(n,t)}function RE(e,n,t){t===void 0&&(t=!0);var r={handler:e,includeHooks:t};return n.$mst_middleware=n.$mst_middleware||[],n.$mst_middleware.push(r),n}var ME=function(){function e(n,t){Object.defineProperty(this,"arrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"inArrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:[]}),t.$mst_middleware&&this.middlewares.push(t.$mst_middleware);for(var r=n;r;)r.middlewares&&this.middlewares.push(r.middlewares),r=r.parent}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getNextMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=this.middlewares[this.arrayIndex];if(n){var t=n[this.inArrayIndex++];return t||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}}),e}();function LE(e,n,t){var r=new ME(e,t);if(r.isEmpty)return Xr(t).apply(null,n.args);var a=null;function o(s){var c=r.getNextMiddleware(),m=c&&c.handler;if(!m)return Xr(t).apply(null,s.args);if(!c.includeHooks&&on[s.name])return o(s);function f(y,E){a=o(y),E&&(a=E(a))}function v(y){a=y}return m(s,f,v),a}return o(n)}function zv(){for(var e=Fv();e&&e.type!=="action";)e=e.parentActionEvent;return e}function a4(e,n,t){for(var r=typeof n=="number"?n:n.id,a=t?e:e.parentActionEvent;a;){if(a.id===r)return!0;a=a.parentActionEvent}return!1}function NE(e,n){return a4(e,n,!1)}function IE(e,n){return a4(e,n,!0)}function jE(e){try{return JSON.stringify(e)}catch(n){return"<Unserializable: ".concat(n,">")}}function o4(e){return typeof e=="function"?"<function".concat(e.name?" "+e.name:"",">"):ir(e)?"<".concat(e,">"):"`".concat(jE(e),"`")}function DE(e){return e.length<280?e:"".concat(e.substring(0,272),"......").concat(e.substring(e.length-8))}function FE(e){var n=e.value,t=e.context[e.context.length-1].type,r=e.context.map(function(c){var m=c.path;return m}).filter(function(c){return c.length>0}).join("/"),a=r.length>0?'at path "/'.concat(r,'" '):"",o=ir(n)?"value of type ".concat(dt(n).type.name,":"):vc(n)?"value":"snapshot",s=t&&ir(n)&&t.is(dt(n).snapshot);return"".concat(a).concat(o," ").concat(o4(n)," is not assignable ").concat(t?"to type: `".concat(t.name,"`"):"")+(e.message?" (".concat(e.message,")"):"")+(t?k4(t)||vc(n)?".":", expected an instance of `".concat(t.name,"` or a snapshot like `").concat(t.describe(),"` instead.")+(s?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function Bv(e,n,t){return e.concat([{path:n,type:t}])}function gi(){return pc}function vi(e,n,t){return[{context:e,value:n,message:t}]}function qp(e){return e.reduce(function(n,t){return n.concat(t)},[])}function Yo(e,n){tx()&&l4(e,n)}function l4(e,n){var t=e.validate(n,[{path:"",type:e}]);if(t.length>0)throw new lt(zE(e,n,t))}function zE(e,n,t){if(t.length!==0)return"Error while converting ".concat(DE(o4(n))," to `").concat(e.name,`\`:
|
|
93
93
|
|
|
94
94
|
`)+t.map(FE).join(`
|
|
95
|
-
`)}var BE=0,UE=function(){function e(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:BE++}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:ur.map()}),Object.defineProperty(this,"lastCacheModificationPerId",{enumerable:!0,configurable:!0,writable:!0,value:ur.map()})}return Object.defineProperty(e.prototype,"updateLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var t=this.lastCacheModificationPerId.get(n);this.lastCacheModificationPerId.set(n,t===void 0?1:t+1)}}),Object.defineProperty(e.prototype,"getLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var t=this.lastCacheModificationPerId.get(n)||0;return"".concat(this.cacheId,"-").concat(t)}}),Object.defineProperty(e.prototype,"addNodeToCache",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){if(t===void 0&&(t=!0),n.identifierAttribute){var r=n.identifier;this.cache.has(r)||this.cache.set(r,ur.array([],Hp));var a=this.cache.get(r);if(a.indexOf(n)!==-1)throw new lt("Already registered");a.push(n),t&&this.updateLastCacheModificationPerId(r)}}}),Object.defineProperty(e.prototype,"mergeCache",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var t=this;yv(n.identifierCache.cache).forEach(function(r){return r.forEach(function(a){t.addNodeToCache(a)})})}}),Object.defineProperty(e.prototype,"notifyDied",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(n.identifierAttribute){var t=n.identifier,r=this.cache.get(t);r&&(r.remove(n),r.length||this.cache.delete(t),this.updateLastCacheModificationPerId(n.identifier))}}}),Object.defineProperty(e.prototype,"splitCache",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var t=this,r=new e,a=n.path+"/";return n5(this.cache).forEach(function(o){for(var s=io(o,2),c=s[0],m=s[1],f=!1,v=m.length-1;v>=0;v--){var y=m[v];(y===n||y.path.indexOf(a)===0)&&(r.addNodeToCache(y,!1),m.splice(v,1),m.length||t.cache.delete(c),f=!0)}f&&t.updateLastCacheModificationPerId(c)}),r}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){var r=this.cache.get(t);return r?r.some(function(a){return n.isAssignableFrom(a.type)}):!1}}),Object.defineProperty(e.prototype,"resolve",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){var r=this.cache.get(t);if(!r)return null;var a=r.filter(function(o){return n.isAssignableFrom(o.type)});switch(a.length){case 0:return null;case 1:return a[0];default:throw new lt("Cannot resolve a reference to type '".concat(n.name,"' with id: '").concat(t,"' unambigously, there are multiple candidates: ").concat(a.map(function(o){return o.path}).join(", ")))}}}),e}();function Uv(e,n,t,r,a){var o=s4(a);if(o){if(o.parent)throw new lt("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(n?n.path:"","/").concat(t,"', but it lives already at '").concat(o.path,"'"));return n&&o.setParent(n,t),o}return new pi(e,n,t,r,a)}function ts(e,n,t,r,a){return new Md(e,n,t,r,a)}function qE(e){return e instanceof Md||e instanceof pi}var Tn;(function(e){e[e.INITIALIZING=0]="INITIALIZING",e[e.CREATED=1]="CREATED",e[e.FINALIZED=2]="FINALIZED",e[e.DETACHING=3]="DETACHING",e[e.DEAD=4]="DEAD"})(Tn||(Tn={}));function ir(e){return!!(e&&e.$treenode)}function dt(e){if(!ir(e))throw new lt("Value ".concat(e," is no MST Node"));return e.$treenode}function s4(e){return e&&e.$treenode||null}function HE(){return dt(this).snapshot}var GE=function(e){return".."};function u4(e,n){if(e.root!==n.root)throw new lt("Cannot calculate relative path: objects '".concat(e,"' and '").concat(n,"' are not part of the same object tree"));for(var t=mc(e.path),r=mc(n.path),a=0;a<t.length&&t[a]===r[a];a++);return t.slice(a).map(GE).join("/")+Sp(r.slice(a))}function c4(e,n,t){return t===void 0&&(t=!0),f4(e,mc(n),t)}function f4(e,n,t){t===void 0&&(t=!0);var r=e;try{for(var a=0;a<n.length;a++){var o=n[a];if(o===".."){if(r=r.parent,r)continue}else{if(o===".")continue;if(r){if(r instanceof Md){var s=r.value;ir(s)&&(r=dt(s))}if(r instanceof pi){var c=r.getChildType(o);if(c&&(r=r.getChildNode(o),r))continue}}}throw new lt("Could not resolve '".concat(o,"' in path '").concat(Sp(n.slice(0,a))||"/","' while resolving '").concat(Sp(n),"'"))}}catch(m){if(!t)return;throw m}return r}function d4(e){if(!e)return pc;var n=Object.keys(e);if(!n.length)return pc;var t=new Array(n.length);return n.forEach(function(r,a){t[a]=e[r]}),t}function VE(e){return m4(e)}var $E=Object.toString(),pc=Object.freeze([]),gc=Object.freeze({}),Hp=Nw().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(Hp);var lt=function(e){wr(n,e);function n(t){return t===void 0&&(t="Illegal state"),e.call(this,"[mobx-state-tree] ".concat(t))||this}return n}(Error);function WE(e){return e}var YE=Number.isInteger;function KE(e){return Number(e)===e&&e%1!==0}function XE(e){return Number.isFinite(e)}function qv(e){return Array.isArray(e)||Qn(e)}function Hv(e){return e?qv(e)?e:[e]:pc}function ZE(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];for(var r=0;r<n.length;r++){var a=n[r];for(var o in a)e[o]=a[o]}return e}function Ds(e){var n;if(e===null||typeof e!="object")return!1;var t=Object.getPrototypeOf(e);return t==null?!0:((n=t.constructor)===null||n===void 0?void 0:n.toString())===$E}function h4(e){return e!==null&&typeof e=="object"&&!(e instanceof Date)&&!(e instanceof RegExp)}function vc(e,n){return n===void 0&&(n=!0),e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||n&&e instanceof Date}function p4(e){return typeof e!="function"}function QE(e,n,t){yn(e)?wv(e,n,t):Object.defineProperty(e,n,t)}function Fs(e,n,t){QE(e,n,{enumerable:!1,writable:!1,configurable:!0,value:t})}var JE=function(){function e(){Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,"hasSubscribers",{get:function(){return this.handlers.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){var r=this;return t===void 0&&(t=!1),t?this.handlers.unshift(n):this.handlers.push(n),function(){r.unregister(n)}}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this.handlers.indexOf(n)>=0}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var t=this.handlers.indexOf(n);t>=0&&this.handlers.splice(t,1)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.handlers.length=0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var r=this.handlers.slice();r.forEach(function(a){return a.apply(void 0,ao([],io(n),!1))})}}),e}(),g4=function(){function e(){Object.defineProperty(this,"eventHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"hasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var t=this.eventHandlers&&this.eventHandlers[n];return!!t&&t.hasSubscribers}}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t,r){r===void 0&&(r=!1),this.eventHandlers||(this.eventHandlers={});var a=this.eventHandlers[n];return a||(a=this.eventHandlers[n]=new JE),a.register(t,r)}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){var r=this.eventHandlers&&this.eventHandlers[n];return!!r&&r.has(t)}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){var r=this.eventHandlers&&this.eventHandlers[n];r&&r.unregister(t)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.eventHandlers&&delete this.eventHandlers[n]}}),Object.defineProperty(e.prototype,"clearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.eventHandlers=void 0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(n){for(var t,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];var o=this.eventHandlers&&this.eventHandlers[n];o&&(t=o).emit.apply(t,ao([],io(r),!1))}}),e}();function v4(e){for(var n=new Array(e.length),t=0;t<e.length;t++)n[t]=e[t];return n}function n0(e,n){return e.indexOf(n)===0}function ex(e){console.warn(new Error("[mobx-state-tree] ".concat(e)))}function tx(){return typeof process<"u"&&z2&&z2.ENABLE_TYPE_CHECK==="true"}function i0(e){typeof queueMicrotask=="function"?queueMicrotask(e):typeof setImmediate=="function"?setImmediate(e):setTimeout(e,1)}function m4(e){return ax(e.name,e)}function rx(e){return e}function nx(e){return function(){var n,t=[];for(n=0;n<arguments.length;n++)t[n]=arguments[n];return q5(this,function(r){switch(r.label){case 0:return[4,e.apply(void 0,ao([],io(t),!1))];case 1:return[2,r.sent()]}})}}function ix(e){return q5(this,function(n){switch(n.label){case 0:return[4,e];case 1:return[2,n.sent()]}})}function ax(e,n){var t=function(){var a=r4(),o=Fv();if(!o)throw new lt("a mst flow must always have a parent context");var s=n4(o);if(!s)throw new lt("a mst flow must always have a parent action context");var c={name:e,id:a,tree:o.tree,context:o.context,parentId:o.id,allParentIds:ao(ao([],io(o.allParentIds),!1),[o.id],!1),rootId:o.rootId,parentEvent:o,parentActionEvent:s},m=arguments;function f(v,y,E){return v.$mst_middleware=t.$mst_middleware,ov(ln(ln({},c),{type:y,args:[E]}),v)}return new Promise(function(v,y){var E,w=function(){E=n.apply(null,arguments),S(void 0)};w.$mst_middleware=t.$mst_middleware,ov(ln(ln({},c),{type:"flow_spawn",args:v4(m)}),w);function S(b){var g;try{var h=f(function(d){g=E.next(d)},"flow_resume",b);h instanceof Error&&(g=E.throw(h))}catch(d){i0(function(){f(function(P){y(d)},"flow_throw",d)});return}_(g)}function x(b){var g;try{f(function(h){g=E.throw(h)},"flow_resume_error",b)}catch(h){i0(function(){f(function(d){y(h)},"flow_throw",h)});return}_(g)}function _(b){if(b.done){i0(function(){f(function(g){v(g)},"flow_return",b.value)});return}if(!b.value||typeof b.value.then!="function")throw new lt("Only promises can be yielded to `async`, got: "+b);return b.value.then(S,x)}})};return t._isFlowAction=!0,t}function ox(e){if(!("oldValue"in e))throw new lt("Patches without `oldValue` field cannot be inversed");return[lx(e),sx(e)]}function lx(e){switch(e.op){case"add":return{op:"add",path:e.path,value:e.value};case"remove":return{op:"remove",path:e.path};case"replace":return{op:"replace",path:e.path,value:e.value}}}function sx(e){switch(e.op){case"add":return{op:"remove",path:e.path};case"remove":return{op:"add",path:e.path,value:e.oldValue};case"replace":return{op:"replace",path:e.path,value:e.oldValue}}}function ux(e){return typeof e=="number"}function Vl(e){return ux(e)===!0?""+e:e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function y4(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Sp(e){if(e.length===0)return"";var n=function(t){return t.map(Vl).join("/")};return e[0]==="."||e[0]===".."?n(e):"/"+n(e)}function mc(e){var n=e.split("/").map(y4),t=e===""||e==="."||e===".."||n0(e,"/")||n0(e,"./")||n0(e,"../");if(!t)throw new lt("a json path must be either rooted, empty or relative, but got '".concat(e,"'"));return n[0]===""&&n.shift(),n}var a0=Symbol("$preProcessorFailed"),cx=function(e){wr(n,e);function n(t,r,a){var o=e.call(this,a||t.name)||this;return Object.defineProperty(o,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"_processors",{enumerable:!0,configurable:!0,writable:!0,value:r}),o}return Object.defineProperty(n.prototype,"flags",{get:function(){return this._subtype.flags|Nt.SnapshotProcessor},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"snapshotProcessor(".concat(this._subtype.describe(),")")}}),Object.defineProperty(n.prototype,"preProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._processors.preProcessor?this._processors.preProcessor.call(null,t):t}}),Object.defineProperty(n.prototype,"preProcessSnapshotSafe",{enumerable:!1,configurable:!0,writable:!0,value:function(t){try{return this.preProcessSnapshot(t)}catch{return a0}}}),Object.defineProperty(n.prototype,"postProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this._processors.postProcessor?this._processors.postProcessor.call(null,t,r.storedValue):t}}),Object.defineProperty(n.prototype,"_fixNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this;fx(t.type,this,"create"),t instanceof pi&&(t.hasSnapshotPostProcessor=!!this._processors.postProcessor);var a=t.getSnapshot;t.getSnapshot=function(){return r.postProcessSnapshot(a.call(t),t)},T4(this._subtype)||(t.getReconciliationType=function(){return r})}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=ir(o)?o:this.preProcessSnapshot(o),c=this._subtype.instantiate(t,r,a,s);return this._fixNode(c),c}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=this._subtype.reconcile(t,ir(r)?r:this.preProcessSnapshot(r),a,o);return s!==t&&this._fixNode(s),s}}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){r===void 0&&(r=!0);var a=this._subtype.getSnapshot(t);return r?this.postProcessSnapshot(a,t):a}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this.preProcessSnapshotSafe(t);return a===a0?vi(r,t,"Failed to preprocess value"):this._subtype.validate(a,r)}}),Object.defineProperty(n.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),Object.defineProperty(n.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=sn(t)?this._subtype:ir(t)?jv(t,!1):this.preProcessSnapshotSafe(t);return r===a0?!1:this._subtype.validate(r,[{path:"",type:this._subtype}]).length===0}}),Object.defineProperty(n.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._subtype.isAssignableFrom(t)}}),Object.defineProperty(n.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(!(this._subtype instanceof hc))return!1;var a=this.preProcessSnapshot(r);return this._subtype.isMatchingSnapshotId(t,a)}}),n}(Xo);function fx(e,n){for(var t,r,a=[],o=2;o<arguments.length;o++)a[o-2]=arguments[o];try{for(var s=Cd(a),c=s.next();!c.done;c=s.next()){var m=c.value;e[m]=n[m].bind(n)}}catch(f){t={error:f}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}}function dx(e,n,t){return new cx(e,n,t)}var B2="Map.put can only be used to store complex values that have an identifier type attribute";function b4(e,n){var t,r,a=e.getSubTypes();if(a===J5)return!1;if(a){var o=Hv(a);try{for(var s=Cd(o),c=s.next();!c.done;c=s.next()){var m=c.value;if(!b4(m,n))return!1}}catch(f){t={error:f}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}}return e instanceof Nd&&n.push(e),!0}var ql;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.YES=1]="YES",e[e.NO=2]="NO"})(ql||(ql={}));var hx=function(e){wr(n,e);function n(t,r){return e.call(this,t,ur.ref.enhancer,r)||this}return Object.defineProperty(n.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.get.call(this,""+t)}}),Object.defineProperty(n.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.has.call(this,""+t)}}),Object.defineProperty(n.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.delete.call(this,""+t)}}),Object.defineProperty(n.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return e.prototype.set.call(this,""+t,r)}}),Object.defineProperty(n.prototype,"put",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!t)throw new lt("Map.put cannot be used to set empty values");if(ir(t)){var r=dt(t);if(r.identifier===null)throw new lt(B2);return this.set(r.identifier,t),t}else if(h4(t)){var a=dt(this),o=a.type;if(o.identifierMode!==ql.YES)throw new lt(B2);var s=o.mapIdentifierAttribute,c=t[s];if(!Vv(c)){var m=this.put(o.getChildType().create(t,a.environment));return this.put(jv(m))}var f=_c(c);return this.set(f,t),this.get(f)}else throw new lt("Map.put can only be used to store complex values")}}),n}(Dp),Ep=function(e){wr(n,e);function n(t,r,a){a===void 0&&(a=[]);var o=e.call(this,t)||this;return Object.defineProperty(o,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"identifierMode",{enumerable:!0,configurable:!0,writable:!0,value:ql.UNKNOWN}),Object.defineProperty(o,"mapIdentifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Map}),Object.defineProperty(o,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),o._determineIdentifierMode(),o.hookInitializers=a,o}return Object.defineProperty(n.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.hookInitializers.length>0?this.hookInitializers.concat(t):[t];return new n(this.name,this._subType,r)}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return this._determineIdentifierMode(),Uv(this,t,r,a,o)}}),Object.defineProperty(n.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===ql.UNKNOWN){var t=[];if(b4(this._subType,t)){var r=t.reduce(function(a,o){if(!o.identifierAttribute)return a;if(a&&a!==o.identifierAttribute)throw new lt("The objects in a map should all have the same identifier attribute, expected '".concat(a,"', but child of type '").concat(o.name,"' declared attribute '").concat(o.identifierAttribute,"' as identifier"));return o.identifierAttribute},void 0);r?(this.identifierMode=ql.YES,this.mapIdentifierAttribute=r):this.identifierMode=ql.NO}}}}),Object.defineProperty(n.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){r===void 0&&(r={});var a=t.type._subType,o={};return Object.keys(r).forEach(function(s){o[s]=a.instantiate(t,s,void 0,r[s])}),o}}),Object.defineProperty(n.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new hx(t,this.name)}}),Object.defineProperty(n.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){mv(r,t.unbox);var a=t.type;a.hookInitializers.forEach(function(o){var s=o(r);Object.keys(s).forEach(function(c){var m=s[c],f=Ld(r,c,m);Fs(r,c,f)})}),Np(r,this.willChange),jp(r,this.didChange)}}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(n.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return yv(t.storedValue)}}),Object.defineProperty(n.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=t.storedValue.get(""+r);if(!a)throw new lt("Not a child "+r);return a}}),Object.defineProperty(n.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=dt(t.object),a=t.name;r.assertWritable({subpath:a});var o=r.type,s=o._subType;switch(t.type){case"update":{var c=t.newValue,m=t.object.get(a);if(c===m)return null;Yo(s,c),t.newValue=s.reconcile(r.getChildNode(a),t.newValue,r,a),o.processIdentifier(a,t.newValue)}break;case"add":Yo(s,t.newValue),t.newValue=s.instantiate(r,a,void 0,t.newValue),o.processIdentifier(a,t.newValue);break}return t}}),Object.defineProperty(n.prototype,"processIdentifier",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(this.identifierMode===ql.YES&&r instanceof pi){var a=r.identifier;if(a!==t)throw new lt("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '".concat(a,"', but expected: '").concat(t,"'"))}}}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r={};return t.getChildren().forEach(function(a){r[a.subpath]=a.snapshot}),r}}),Object.defineProperty(n.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r={};return Object.keys(t).forEach(function(a){r[a]=t[a].getSnapshot()}),r}}),Object.defineProperty(n.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=dt(t.object);switch(t.type){case"update":return void r.emitPatch({op:"replace",path:Vl(t.name),value:t.newValue.snapshot,oldValue:t.oldValue?t.oldValue.snapshot:void 0},r);case"add":return void r.emitPatch({op:"add",path:Vl(t.name),value:t.newValue.snapshot,oldValue:void 0},r);case"delete":var a=t.oldValue.snapshot;return t.oldValue.die(),void r.emitPatch({op:"remove",path:Vl(t.name),oldValue:a},r)}}}),Object.defineProperty(n.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a){var o=t.storedValue;switch(a.op){case"add":case"replace":o.set(r,a.value);break;case"remove":o.delete(r);break}}}),Object.defineProperty(n.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){Yo(this,r);var a=t.storedValue,o={};if(Array.from(a.keys()).forEach(function(c){o[c]=!1}),r)for(var s in r)a.set(s,r[s]),o[""+s]=!0;Object.keys(o).forEach(function(c){o[c]===!1&&a.delete(c)})}}),Object.defineProperty(n.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this;return Ds(t)?qp(Object.keys(t).map(function(o){return a._subType.validate(t[o],Bv(r,o,a._subType))})):vi(r,t,"Value is not a plain object")}}),Object.defineProperty(n.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return gc}}),Object.defineProperty(n.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){t.storedValue.delete(r)}}),n}(hc);Ep.prototype.applySnapshot=Xr(Ep.prototype.applySnapshot);function px(e){return new Ep("Map<string, ".concat(e.name,">"),e)}function gx(e){return sn(e)&&(e.flags&Nt.Map)>0}var xp=function(e){wr(n,e);function n(t,r,a){a===void 0&&(a=[]);var o=e.call(this,t)||this;return Object.defineProperty(o,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Array}),Object.defineProperty(o,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),o.hookInitializers=a,o}return Object.defineProperty(n.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.hookInitializers.length>0?this.hookInitializers.concat(t):[t];return new n(this.name,this._subType,r)}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return Uv(this,t,r,a,o)}}),Object.defineProperty(n.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){r===void 0&&(r=[]);var a=t.type._subType,o={};return r.forEach(function(s,c){var m=""+c;o[m]=a.instantiate(t,m,void 0,s)}),o}}),Object.defineProperty(n.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=ln(ln({},Hp),{name:this.name});return ur.array(d4(t),r)}}),Object.defineProperty(n.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){Pa(r).dehancer=t.unbox;var a=t.type;a.hookInitializers.forEach(function(o){var s=o(r);Object.keys(s).forEach(function(c){var m=s[c],f=Ld(r,c,m);Fs(r,c,f)})}),Np(r,this.willChange),jp(r,this.didChange)}}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(n.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue.slice()}}),Object.defineProperty(n.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=Number(r);if(a<t.storedValue.length)return t.storedValue[a];throw new lt("Not a child: "+r)}}),Object.defineProperty(n.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=dt(t.object);r.assertWritable({subpath:""+t.index});var a=r.type._subType,o=r.getChildren();switch(t.type){case"update":{if(t.newValue===t.object[t.index])return null;var s=U2(r,a,[o[t.index]],[t.newValue],[t.index]);if(!s)return null;t.newValue=s[0]}break;case"splice":{var c=t.index,m=t.removedCount,f=t.added,v=U2(r,a,o.slice(c,c+m),f,f.map(function(E,w){return c+w}));if(!v)return null;t.added=v;for(var y=c+m;y<o.length;y++)o[y].setParent(r,""+(y+f.length-m))}break}return t}}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.getChildren().map(function(r){return r.snapshot})}}),Object.defineProperty(n.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=[];return Object.keys(t).forEach(function(a){r.push(t[a].getSnapshot())}),r}}),Object.defineProperty(n.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=dt(t.object);switch(t.type){case"update":return void r.emitPatch({op:"replace",path:""+t.index,value:t.newValue.snapshot,oldValue:t.oldValue?t.oldValue.snapshot:void 0},r);case"splice":if(t.removedCount&&t.addedCount===t.object.length)return void r.emitPatch({op:"replace",path:"",value:r.snapshot,oldValue:t.removed.map(function(o){return o.snapshot})},r);for(var a=t.removedCount-1;a>=0;a--)r.emitPatch({op:"remove",path:""+(t.index+a),oldValue:t.removed[a].snapshot},r);for(var a=0;a<t.addedCount;a++)r.emitPatch({op:"add",path:""+(t.index+a),value:t.added[a].snapshot,oldValue:void 0},r);return}}}),Object.defineProperty(n.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a){var o=t.storedValue,s=r==="-"?o.length:Number(r);switch(a.op){case"replace":o[s]=a.value;break;case"add":o.splice(s,0,a.value);break;case"remove":o.splice(s,1);break}}}),Object.defineProperty(n.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){Yo(this,r);var a=t.storedValue;a.replace(r)}}),Object.defineProperty(n.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this;return qv(t)?qp(t.map(function(o,s){return a._subType.validate(o,Bv(r,""+s,a._subType))})):vi(r,t,"Value is not an array")}}),Object.defineProperty(n.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return pc}}),Object.defineProperty(n.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){t.storedValue.splice(Number(r),1)}}),n}(hc);xp.prototype.applySnapshot=Xr(xp.prototype.applySnapshot);function vx(e){return new xp("".concat(e.name,"[]"),e)}function U2(e,n,t,r,a){for(var o=!0,s=0;;s++){var c=s<=r.length-1,m=t[s],f=c?r[s]:void 0,v=""+a[s];if(qE(f)&&(f=f.storedValue),!m&&!c)break;if(!c)o=!1,t.splice(s,1),m instanceof pi&&m.createObservableInstanceIfNeeded(),m.die(),s--;else if(m)if(q2(m,f))t[s]=o0(n,e,v,f,m);else{for(var E=void 0,w=s;w<t.length;w++)if(q2(t[w],f)){E=t.splice(w,1)[0];break}o=!1;var y=o0(n,e,v,f,E);t.splice(s,0,y)}else{if(ir(f)&&dt(f).parent===e)throw new lt("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(e.path,"/").concat(v,"', but it lives already at '").concat(dt(f).path,"'"));o=!1;var y=o0(n,e,v,f);t.splice(s,0,y)}}return o?null:t}function o0(e,n,t,r,a){Yo(e,r);function o(){if(ir(r)){var c=dt(r);if(c.assertAlive(gc),c.parent!==null&&c.parent===n)return c.setParent(n,t),c}return a?e.reconcile(a,r,n,t):e.instantiate(n,t,void 0,r)}var s=o();return a&&a!==s&&(a instanceof pi&&a.createObservableInstanceIfNeeded(),a.die()),s}function q2(e,n){if(!e.isAlive)return!1;if(ir(n)){var t=dt(n);return t.isAlive&&t===e}if(e.snapshot===n)return!0;if(!(e instanceof pi))return!1;var r=e.getReconciliationType();return e.identifier!==null&&e.identifierAttribute&&Ds(n)&&r.is(n)&&r.isMatchingSnapshotId(e,n)}function mx(e){return sn(e)&&(e.flags&Nt.Array)>0}var H2="preProcessSnapshot",G2="postProcessSnapshot";function yx(){return dt(this).toString()}var V2={name:"AnonymousModel",properties:{},initializers:pc};function bx(e){var n=Object.keys(e),t=new Set;return n.forEach(function(r){if(t.has(r))throw new lt("".concat(r," is declared twice in the model. Model should not contain the same keys"));t.add(r)}),n.reduce(function(r,a){if(a in on)throw new lt("Hook '".concat(a,"' was defined as property. Hooks should be defined as part of the actions"));var o=Object.getOwnPropertyDescriptor(e,a);if("get"in o)throw new lt("Getters are not supported as properties. Please use views instead");var s=o.value;if(s==null)throw new lt("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(vc(s))r[a]=zs(Ox(s),s);else if(s instanceof Ep)r[a]=zs(s,{});else if(s instanceof xp)r[a]=zs(s,[]);else if(!sn(s))throw new lt("Invalid type definition for property '".concat(a,"', cannot infer a type from a value like '").concat(s,"' (").concat(typeof s,")"));return r},ln({},e))}var Nd=function(e){wr(n,e);function n(t){var r=e.call(this,t.name||V2.name)||this;return Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Object}),Object.defineProperty(r,"initializers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"properties",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"preProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"postProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"propertyNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"named",{enumerable:!0,configurable:!0,writable:!0,value:function(a){return r.cloneAndEnhance({name:a})}}),Object.defineProperty(r,"props",{enumerable:!0,configurable:!0,writable:!0,value:function(a){return r.cloneAndEnhance({properties:a})}}),Object.defineProperty(r,"preProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(a){var o=r.preProcessor;return o?r.cloneAndEnhance({preProcessor:function(s){return o(a(s))}}):r.cloneAndEnhance({preProcessor:a})}}),Object.defineProperty(r,"postProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(a){var o=r.postProcessor;return o?r.cloneAndEnhance({postProcessor:function(s){return a(o(s))}}):r.cloneAndEnhance({postProcessor:a})}}),Object.assign(r,V2,t),r.properties=bx(r.properties),r.properties,r.propertyNames=Object.keys(r.properties),r.identifierAttribute=r._getIdentifierAttribute(),r}return Object.defineProperty(n.prototype,"_getIdentifierAttribute",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=void 0;return this.forAllProps(function(r,a){if(a.flags&Nt.Identifier){if(t)throw new lt("Cannot define property '".concat(r,"' as object identifier, property '").concat(t,"' is already defined as identifier property"));t=r}}),t}}),Object.defineProperty(n.prototype,"cloneAndEnhance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new n({name:t.name||this.name,properties:Object.assign({},this.properties,t.properties),initializers:this.initializers.concat(t.initializers||[]),preProcessor:t.preProcessor||this.preProcessor,postProcessor:t.postProcessor||this.postProcessor})}}),Object.defineProperty(n.prototype,"actions",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this,a=function(o){return r.instantiateActions(o,t(o)),o};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(n.prototype,"instantiateActions",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(!Ds(r))throw new lt("actions initializer should return a plain object containing actions");Object.keys(r).forEach(function(a){if(a===H2)throw new lt("Cannot define action '".concat(H2,"', it should be defined using 'type.preProcessSnapshot(fn)' instead"));if(a===G2)throw new lt("Cannot define action '".concat(G2,"', it should be defined using 'type.postProcessSnapshot(fn)' instead"));var o=r[a],s=t[a];if(a in on&&s){var c=o;o=function(){s.apply(null,arguments),c.apply(null,arguments)}}var m=o.$mst_middleware,f=o.bind(r);f._isFlowAction=o._isFlowAction||!1,f.$mst_middleware=m;var v=Ld(t,a,f);r[a]=v,Fs(t,a,v)})}}),Object.defineProperty(n.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this;if(typeof t!="function")throw new lt("You passed an ".concat(typeof t," to volatile state as an argument, when function is expected"));var a=function(o){return r.instantiateVolatileState(o,t(o)),o};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(n.prototype,"instantiateVolatileState",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(!Ds(r))throw new lt("volatile state initializer should return a plain object containing state");bv(t,r)}}),Object.defineProperty(n.prototype,"extend",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this,a=function(o){var s=t(o),c=s.actions,m=s.views,f=s.state,v=VS(s,["actions","views","state"]);for(var y in v)throw new lt("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '".concat(y,"'"));return f&&r.instantiateVolatileState(o,f),m&&r.instantiateViews(o,m),c&&r.instantiateActions(o,c),o};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(n.prototype,"views",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this,a=function(o){return r.instantiateViews(o,t(o)),o};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(n.prototype,"instantiateViews",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(!Ds(r))throw new lt("views initializer should return a plain object containing views");Object.getOwnPropertyNames(r).forEach(function(a){var o,s=Object.getOwnPropertyDescriptor(r,a);if("get"in s)wv(t,a,s),_v(t,(o={},o[a]=Vs,o));else if(typeof s.value=="function")Fs(t,a,s.value);else throw new lt("A view member should either be a function or getter based property")})}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=ir(o)?o:this.applySnapshotPreProcessor(o);return Uv(this,t,r,a,s)}}),Object.defineProperty(n.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){r===void 0&&(r={});var a=t.type,o={};return a.forAllProps(function(s,c){o[s]=c.instantiate(t,s,void 0,r[s])}),o}}),Object.defineProperty(n.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=ln(ln({},Hp),{name:this.name});return ur.object(t,gc,r)}}),Object.defineProperty(n.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){Fs(r,"toString",yx),this.forAllProps(function(a){mv(r,a,t.unbox)}),this.initializers.reduce(function(a,o){return o(a)},r),Np(r,this.willChange),jp(r,this.didChange)}}),Object.defineProperty(n.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=t,a=dt(r.object),o=r.name;a.assertWritable({subpath:o});var s=a.type.properties[o];return s&&(Yo(s,r.newValue),r.newValue=s.reconcile(a.getChildNode(o),r.newValue,a,o)),r}}),Object.defineProperty(n.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=t,a=dt(r.object),o=a.type.properties[r.name];if(o){var s=r.oldValue?r.oldValue.snapshot:void 0;a.emitPatch({op:"replace",path:Vl(r.name),value:r.newValue.snapshot,oldValue:s},a)}}}),Object.defineProperty(n.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this,a=[];return this.forAllProps(function(o){a.push(r.getChildNode(t,o))}),a}}),Object.defineProperty(n.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a;if(!(r in this.properties))throw new lt("Not a value property: "+r);var o=Pa(t.storedValue,r),s=(a=o.raw)===null||a===void 0?void 0:a.call(o);if(!s)throw new lt("Node not available for property "+r);return s}}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this;r===void 0&&(r=!0);var o={};return this.forAllProps(function(s,c){try{var m=no(t.storedValue,s);m.reportObserved()}catch{throw new lt("".concat(s," property is declared twice"))}o[s]=a.getChildNode(t,s).snapshot}),r?this.applySnapshotPostProcessor(o):o}}),Object.defineProperty(n.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r={};return Object.keys(t).forEach(function(a){r[a]=t[a].getSnapshot()}),this.applySnapshotPostProcessor(r)}}),Object.defineProperty(n.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a){if(!(a.op==="replace"||a.op==="add"))throw new lt("object does not support operation ".concat(a.op));t.storedValue[r]=a.value}}),Object.defineProperty(n.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){Yo(this,r);var a=this.applySnapshotPreProcessor(r);this.forAllProps(function(o){t.storedValue[o]=a[o]})}}),Object.defineProperty(n.prototype,"applySnapshotPreProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.preProcessor;return r?r.call(null,t):t}}),Object.defineProperty(n.prototype,"applySnapshotPostProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.postProcessor;return r?r.call(null,t):t}}),Object.defineProperty(n.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.properties[t]}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this,o=this.applySnapshotPreProcessor(t);return Ds(o)?qp(this.propertyNames.map(function(s){return a.properties[s].validate(o[s],Bv(r,s,a.properties[s]))})):vi(r,o,"Value is not a plain object")}}),Object.defineProperty(n.prototype,"forAllProps",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this;this.propertyNames.forEach(function(a){return t(a,r.properties[a])})}}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;return"{ "+this.propertyNames.map(function(r){return r+": "+t.properties[r].describe()}).join("; ")+" }"}}),Object.defineProperty(n.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return gc}}),Object.defineProperty(n.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){t.storedValue[r]=void 0}}),n}(hc);Nd.prototype.applySnapshot=Xr(Nd.prototype.applySnapshot);function wx(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=typeof e[0]=="string"?e.shift():"AnonymousModel",r=e.shift()||{};return new Nd({name:t,properties:r})}function _x(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=typeof e[0]=="string",r=t?e[0]:"AnonymousModel";return t&&e.shift(),e.reduce(function(a,o){return a.cloneAndEnhance({name:a.name+"_"+o.name,properties:o.properties,initializers:o.initializers,preProcessor:function(s){return o.applySnapshotPreProcessor(a.applySnapshotPreProcessor(s))},postProcessor:function(s){return o.applySnapshotPostProcessor(a.applySnapshotPostProcessor(s))}})}).named(r)}function w4(e){return sn(e)&&(e.flags&Nt.Object)>0}var Zo=function(e){wr(n,e);function n(t,r,a,o){o===void 0&&(o=WE);var s=e.call(this,t)||this;return Object.defineProperty(s,"flags",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(s,"checker",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(s,"initializer",{enumerable:!0,configurable:!0,writable:!0,value:o}),s.flags=r,s}return Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return ts(this,t,r,a,o)}}),Object.defineProperty(n.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.initializer(t)}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(vc(t)&&this.checker(t))return gi();var a=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return vi(r,t,"Value is not a ".concat(a))}}),n}(Zs),_4=new Zo("string",Nt.String,function(e){return typeof e=="string"}),S4=new Zo("number",Nt.Number,function(e){return typeof e=="number"}),Sx=new Zo("integer",Nt.Integer,function(e){return YE(e)}),Ex=new Zo("float",Nt.Float,function(e){return KE(e)}),xx=new Zo("finite",Nt.Finite,function(e){return XE(e)}),E4=new Zo("boolean",Nt.Boolean,function(e){return typeof e=="boolean"}),x4=new Zo("null",Nt.Null,function(e){return e===null}),O4=new Zo("undefined",Nt.Undefined,function(e){return e===void 0}),P4=new Zo("Date",Nt.Date,function(e){return typeof e=="number"||e instanceof Date},function(e){return e instanceof Date?e:new Date(e)});P4.getSnapshot=function(e){return e.storedValue.getTime()};var C4=P4;function Ox(e){switch(typeof e){case"string":return _4;case"number":return S4;case"boolean":return E4;case"object":if(e instanceof Date)return C4}throw new lt("Cannot determine primitive type from value "+e)}function k4(e){return sn(e)&&(e.flags&(Nt.String|Nt.Number|Nt.Integer|Nt.Boolean|Nt.Date))>0}var Px=function(e){wr(n,e);function n(t){var r=e.call(this,JSON.stringify(t))||this;return Object.defineProperty(r,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Literal}),r.value=t,r}return Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return ts(this,t,r,a,o)}}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify(this.value)}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return vc(t)&&t===this.value?gi():vi(r,t,"Value is not a literal ".concat(JSON.stringify(this.value)))}}),n}(Zs);function A4(e){return new Px(e)}function Cx(e){return sn(e)&&(e.flags&Nt.Literal)>0}var kx=function(e){wr(n,e);function n(t,r,a,o){var s=e.call(this,t)||this;return Object.defineProperty(s,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(s,"_predicate",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(s,"_message",{enumerable:!0,configurable:!0,writable:!0,value:o}),s}return Object.defineProperty(n.prototype,"flags",{get:function(){return this._subtype.flags|Nt.Refinement},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return this._subtype.instantiate(t,r,a,o)}}),Object.defineProperty(n.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._subtype.isAssignableFrom(t)}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this._subtype.validate(t,r);if(a.length>0)return a;var o=ir(t)?dt(t).snapshot:t;return this._predicate(o)?gi():vi(r,t,this._message(t))}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return this._subtype.reconcile(t,r,a,o)}}),Object.defineProperty(n.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),n}(Xo);function Ax(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=typeof e[0]=="string"?e.shift():sn(e[0])?e[0].name:null,r=e[0],a=e[1],o=e[2]?e[2]:function(s){return"Value does not respect the refinement predicate"};return new kx(t,r,a,o)}function Tx(e){return sn(e)&&(e.flags&Nt.Refinement)>0}function Rx(e,n){var t=typeof e=="string"?n:e,r=Gp.apply(void 0,ao([],io(t.map(function(a){return A4(""+a)})),!1));return typeof e=="string"&&(r.name=e),r}var Mx=function(e){wr(n,e);function n(t,r,a){var o=e.call(this,t)||this;return Object.defineProperty(o,"_types",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"_dispatcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_eager",{enumerable:!0,configurable:!0,writable:!0,value:!0}),a=ln({eager:!0,dispatcher:void 0},a),o._dispatcher=a.dispatcher,a.eager||(o._eager=!1),o}return Object.defineProperty(n.prototype,"flags",{get:function(){var t=Nt.Union;return this._types.forEach(function(r){t|=r.flags}),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._types.some(function(r){return r.isAssignableFrom(t)})}}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"("+this._types.map(function(t){return t.describe()}).join(" | ")+")"}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=this.determineType(o,void 0);if(!s)throw new lt("No matching type for union "+this.describe());return s.instantiate(t,r,a,o)}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=this.determineType(r,t.getReconciliationType());if(!s)throw new lt("No matching type for union "+this.describe());return s.reconcile(t,r,a,o)}}),Object.defineProperty(n.prototype,"determineType",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this._dispatcher?this._dispatcher(t):r?r.is(t)?r:this._types.filter(function(a){return a!==r}).find(function(a){return a.is(t)}):this._types.find(function(a){return a.is(t)})}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(this._dispatcher)return this._dispatcher(t).validate(t,r);for(var a=[],o=0,s=0;s<this._types.length;s++){var c=this._types[s],m=c.validate(t,r);if(m.length===0){if(this._eager)return gi();o++}else a.push(m)}return o===1?gi():vi(r,t,"No type is applicable for the union").concat(qp(a))}}),Object.defineProperty(n.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),n}(Xo);function Gp(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];var r=sn(e)?void 0:e,a=sn(e)?ao([e],io(n),!1):n,o="("+a.map(function(s){return s.name}).join(" | ")+")";return new Mx(o,a,r)}function T4(e){return sn(e)&&(e.flags&Nt.Union)>0}var Lx=function(e){wr(n,e);function n(t,r,a){var o=e.call(this,t.name)||this;return Object.defineProperty(o,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"_defaultValue",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"optionalValues",{enumerable:!0,configurable:!0,writable:!0,value:a}),o}return Object.defineProperty(n.prototype,"flags",{get:function(){return this._subtype.flags|Nt.Optional},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype.describe()+"?"}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){if(this.optionalValues.indexOf(o)>=0){var s=this.getDefaultInstanceOrSnapshot();return this._subtype.instantiate(t,r,a,s)}return this._subtype.instantiate(t,r,a,o)}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return this._subtype.reconcile(t,this.optionalValues.indexOf(r)<0&&this._subtype.is(r)?r:this.getDefaultInstanceOrSnapshot(),a,o)}}),Object.defineProperty(n.prototype,"getDefaultInstanceOrSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=typeof this._defaultValue=="function"?this._defaultValue():this._defaultValue;return typeof this._defaultValue=="function"&&Yo(this,t),t}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this.optionalValues.indexOf(t)>=0?gi():this._subtype.validate(t,r)}}),Object.defineProperty(n.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._subtype.isAssignableFrom(t)}}),Object.defineProperty(n.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),n}(Xo);function Nx(e,n){if(typeof n!="function"&&ir(n))throw new lt("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function zs(e,n,t){return Nx(e,n),new Lx(e,n,t||Ix)}var Ix=[void 0];function jx(e){return sn(e)&&(e.flags&Nt.Optional)>0}var Dx=zs(O4,void 0),Fx=zs(x4,null);function R4(e){return Gp(e,Dx)}function zx(e){return Gp(e,Fx)}var Bx=function(e){wr(n,e);function n(t,r){var a=e.call(this,t)||this;return Object.defineProperty(a,"_definition",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),a}return Object.defineProperty(n.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|Nt.Late},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"getSubType",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!this._subType){var r=void 0;try{r=this._definition()}catch(a){if(a instanceof ReferenceError)r=void 0;else throw a}if(t&&r===void 0)throw new lt("Late type seems to be used too early, the definition (still) returns undefined");r&&(this._subType=r)}return this._subType}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return this.getSubType(!0).instantiate(t,r,a,o)}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return this.getSubType(!0).reconcile(t,r,a,o)}}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.getSubType(!1);return t?t.name:"<uknown late type>"}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this.getSubType(!1);return a?a.validate(t,r):gi()}}),Object.defineProperty(n.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.getSubType(!1);return r?r.isAssignableFrom(t):!1}}),Object.defineProperty(n.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.getSubType(!1);return t||J5}}),n}(Xo);function Ux(e,n){var t=typeof e=="string"?e:"late(".concat(e.toString(),")"),r=typeof e=="string"?n:e;return new Bx(t,r)}function qx(e){return sn(e)&&(e.flags&Nt.Late)>0}function Hx(e,n){return new Gx(e,n)}var Gx=function(e){wr(n,e);function n(t,r){var a=e.call(this,t)||this;return Object.defineProperty(a,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Lazy}),Object.defineProperty(a,"loadedType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(a,"pendingNodeList",{enumerable:!0,configurable:!0,writable:!0,value:ur.array()}),tv(function(){return a.pendingNodeList.length>0&&a.pendingNodeList.some(function(o){return o.isAlive&&a.options.shouldLoadPredicate(o.parent?o.parent.value:null)})},function(){a.options.loadType().then(Xr(function(o){a.loadedType=o,a.pendingNodeList.forEach(function(s){s.parent&&a.loadedType&&s.parent.applyPatches([{op:"replace",path:"/".concat(s.subpath),value:s.snapshot}])})}))}),a}return Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<lazy ".concat(this.name,">")}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=this;if(this.loadedType)return this.loadedType.instantiate(t,r,a,o);var c=ts(this,t,r,a,o);return this.pendingNodeList.push(c),tv(function(){return!c.isAlive},function(){return s.pendingNodeList.splice(s.pendingNodeList.indexOf(c),1)}),c}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this.loadedType?this.loadedType.validate(t,r):p4(t)?gi():vi(r,t,"Value is not serializable and cannot be lazy")}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return this.loadedType?(t.die(),this.loadedType.instantiate(a,o,a.environment,r)):e.prototype.reconcile.call(this,t,r,a,o)}}),n}(Zs),M4=function(e){wr(n,e);function n(t){var r=e.call(this,t?"frozen(".concat(t.name,")"):"frozen")||this;return Object.defineProperty(r,"subType",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Frozen}),r}return Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<any immutable value>"}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return ts(this,t,r,a,o)}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return p4(t)?this.subType?this.subType.validate(t,r):gi():vi(r,t,"Value is not serializable and cannot be frozen")}}),n}(Zs),$2=new M4;function Vx(e){return arguments.length===0?$2:sn(e)?new M4(e):zs($2,e)}function $x(e){return sn(e)&&(e.flags&Nt.Frozen)>0}function Wx(e){switch(e){case on.beforeDestroy:return"destroy";case on.beforeDetach:return"detach";default:return}}var Yx=function(){function e(n,t){if(Object.defineProperty(this,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"node",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolvedReference",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Vv(n))this.identifier=n;else if(ir(n)){var r=dt(n);if(!r.identifierAttribute)throw new lt("Can only store references with a defined identifier attribute.");var a=r.unnormalizedIdentifier;if(a==null)throw new lt("Can only store references to tree nodes with a defined identifier.");this.identifier=a}else throw new lt("Can only store references to tree nodes or identifiers, got: '".concat(n,"'"))}return Object.defineProperty(e.prototype,"updateResolvedReference",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var t=_c(this.identifier),r=n.root,a=r.identifierCache.getLastCacheModificationPerId(t);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==a){var o=this.targetType,s=r.identifierCache.resolve(o,t);if(!s)throw new Gv("[mobx-state-tree] Failed to resolve reference '".concat(this.identifier,"' to type '").concat(this.targetType.name,"' (from node: ").concat(n.path,")"));this.resolvedReference={node:s,lastCacheModification:a}}}}),Object.defineProperty(e.prototype,"resolvedValue",{get:function(){return this.updateResolvedReference(this.node),this.resolvedReference.node.value},enumerable:!1,configurable:!0}),e}(),Gv=function(e){wr(n,e);function n(t){var r=e.call(this,t)||this;return Object.setPrototypeOf(r,n.prototype),r}return n}(Error),L4=function(e){wr(n,e);function n(t,r){var a=e.call(this,"reference(".concat(t.name,")"))||this;return Object.defineProperty(a,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(a,"onInvalidated",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Reference}),a}return Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(n.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.targetType.isAssignableFrom(t)}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return Vv(t)?gi():vi(r,t,"Value is not a valid identifier, which is a string or a number")}}),Object.defineProperty(n.prototype,"fireInvalidated",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=r.parent;if(!(!s||!s.isAlive)){var c=s.storedValue;c&&this.onInvalidated({cause:t,parent:c,invalidTarget:o?o.storedValue:void 0,invalidId:a,replaceRef:function(m){dc(r.root.storedValue,{op:"replace",value:m,path:r.path})},removeRef:function(){w4(s.type)?this.replaceRef(void 0):dc(r.root.storedValue,{op:"remove",path:r.path})}})}}}),Object.defineProperty(n.prototype,"addTargetNodeWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this,o=this.getValue(t);if(o){var s=dt(o),c=function(v,y){var E=Wx(y);E&&a.fireInvalidated(E,t,r,s)},m=s.registerHook(on.beforeDetach,c),f=s.registerHook(on.beforeDestroy,c);return function(){m(),f()}}}}),Object.defineProperty(n.prototype,"watchTargetNodeForInvalidations",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a){var o=this;if(this.onInvalidated){var s;t.registerHook(on.beforeDestroy,function(){s&&s()});var c=function(m){s&&s();var f=t.parent,v=f&&f.storedValue;if(f&&f.isAlive&&v){var y=void 0;a?y=!!a.get(r,v):y=t.root.identifierCache.has(o.targetType,_c(r)),y?s=o.addTargetNodeWatcher(t,r):m||o.fireInvalidated("invalidSnapshotReference",t,r,null)}};t.state===Tn.FINALIZED?c(!0):(t.isRoot||t.root.registerHook(on.afterCreationFinalization,function(){t.parent&&t.parent.createObservableInstanceIfNeeded()}),t.registerHook(on.afterAttach,function(){c(!1)}))}}}),n}(Zs),Kx=function(e){wr(n,e);function n(t,r){return e.call(this,t,r)||this}return Object.defineProperty(n.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(t.isAlive){var r=t.storedValue;return r.resolvedValue}}}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=t.storedValue;return r.identifier}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=ir(o)?W5(o):o,c=new Yx(o,this.targetType),m=ts(this,t,r,a,c);return c.node=m,this.watchTargetNodeForInvalidations(m,s,void 0),m}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){if(!t.isDetaching&&t.type===this){var s=ir(r),c=t.storedValue;if(!s&&c.identifier===r||s&&c.resolvedValue===r)return t.setParent(a,o),t}var m=this.instantiate(a,o,void 0,r);return t.die(),m}}),n}(L4),Xx=function(e){wr(n,e);function n(t,r,a){var o=e.call(this,t,a)||this;return Object.defineProperty(o,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),o}return Object.defineProperty(n.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(t.isAlive){var r=this.options.get(t.storedValue,t.parent?t.parent.storedValue:null);return r}}}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=ir(o)?this.options.set(o,t?t.storedValue:null):o,c=ts(this,t,r,a,s);return this.watchTargetNodeForInvalidations(c,s,this.options),c}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=ir(r)?this.options.set(r,t?t.storedValue:null):r;if(!t.isDetaching&&t.type===this&&t.storedValue===s)return t.setParent(a,o),t;var c=this.instantiate(a,o,void 0,s);return t.die(),c}}),n}(L4);function N4(e,n){var t=n||void 0,r=n?n.onInvalidated:void 0;return t&&(t.get||t.set)?new Xx(e,{get:t.get,set:t.set},r):new Kx(e,r)}function Zx(e){return sn(e)&&(e.flags&Nt.Reference)>0}function Qx(e,n){var t=N4(e,ln(ln({},n),{onInvalidated:function(r){n&&n.onInvalidated&&n.onInvalidated(r),r.removeRef()}}));return n&&n.acceptsUndefined===!1?t:R4(t)}var I4=function(e){wr(n,e);function n(t,r){var a=e.call(this,t)||this;return Object.defineProperty(a,"validType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Identifier}),a}return Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){if(!t||!(t.type instanceof Nd))throw new lt("Identifier types can only be instantiated as direct child of a model type");return ts(this,t,r,a,o)}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){if(t.storedValue!==r)throw new lt("Tried to change identifier from '".concat(t.storedValue,"' to '").concat(r,"'. Changing identifiers is not allowed."));return t.setParent(a,o),t}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return typeof t!==this.validType?vi(r,t,"Value is not a valid ".concat(this.describe(),", expected a ").concat(this.validType)):gi()}}),n}(Zs),Jx=function(e){wr(n,e);function n(){var t=e.call(this,"identifier","string")||this;return Object.defineProperty(t,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Identifier}),t}return Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),n}(I4),eO=function(e){wr(n,e);function n(){return e.call(this,"identifierNumber","number")||this}return Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifierNumber"}}),n}(I4),tO=new Jx,rO=new eO;function nO(e){return sn(e)&&(e.flags&Nt.Identifier)>0}function _c(e){return""+e}function Vv(e){return typeof e=="string"||typeof e=="number"}function iO(e){return new aO(e)}var aO=function(e){wr(n,e);function n(t){var r=e.call(this,t.name)||this;return Object.defineProperty(r,"options",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Custom}),r}return Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(this.options.isTargetType(t))return gi();var a=this.options.getValidationMessage(t);return a?vi(r,t,"Invalid value for type '".concat(this.name,"': ").concat(a)):gi()}}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.options.toSnapshot(t.storedValue)}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=this.options.isTargetType(o)?o:this.options.fromSnapshot(o,t&&t.root.environment);return ts(this,t,r,a,s)}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=!this.options.isTargetType(r);if(!t.isDetaching){var c=t.type===this&&(s?r===t.snapshot:r===t.storedValue);if(c)return t.setParent(a,o),t}var m=s?this.options.fromSnapshot(r,a.root.environment):r,f=this.instantiate(a,o,void 0,m);return t.die(),f}}),n}(Zs),W2={enumeration:Rx,model:wx,compose:_x,custom:iO,reference:N4,safeReference:Qx,union:Gp,optional:zs,literal:A4,maybe:R4,maybeNull:zx,refinement:Ax,string:_4,boolean:E4,number:S4,integer:Sx,float:Ex,finite:xx,Date:C4,map:px,array:vx,frozen:Vx,identifier:tO,identifierNumber:rO,late:Ux,lazy:Hx,undefined:O4,null:x4,snapshotProcessor:dx};const oO=Object.freeze(Object.defineProperty({__proto__:null,addDisposer:dE,addMiddleware:i4,applyAction:e4,applyPatch:dc,applySnapshot:G5,cast:vE,castFlowReturn:rx,castToReferenceSnapshot:yE,castToSnapshot:mE,clone:uE,createActionTrackingMiddleware:EE,createActionTrackingMiddleware2:OE,decorate:RE,destroy:fE,detach:cE,escapeJsonPath:Vl,flow:m4,getChildType:$S,getEnv:hE,getIdentifier:W5,getLivelinessChecking:U5,getMembers:gE,getNodeId:bE,getParent:JS,getParentOfType:tE,getPath:$5,getPathParts:rE,getPropertyMembers:X5,getRelativePath:sE,getRoot:V5,getRunningActionContext:zv,getSnapshot:jv,getType:Wd,hasEnv:pE,hasParent:QS,hasParentOfType:eE,isActionContextChildOf:NE,isActionContextThisOrChildOf:IE,isAlive:Dv,isArrayType:mx,isFrozenType:$x,isIdentifierType:nO,isLateType:qx,isLiteralType:Cx,isMapType:gx,isModelType:w4,isOptionalType:jx,isPrimitiveType:k4,isProtected:ZS,isReferenceType:Zx,isRefinementType:Tx,isRoot:nE,isStateTreeNode:ir,isType:sn,isUnionType:T4,isValidReference:lE,joinJsonPath:Sp,onAction:t4,onPatch:H5,onSnapshot:WS,process:VE,protect:KS,recordActions:AE,recordPatches:YS,resolveIdentifier:aE,resolvePath:iE,setLivelinessChecking:B5,setLivelynessChecking:GS,splitJsonPath:mc,t:W2,toGenerator:ix,toGeneratorFunction:nx,tryReference:oE,tryResolve:Y5,typecheck:l4,types:W2,unescapeJsonPath:y4,unprotect:XS,walk:K5},Symbol.toStringTag,{value:"Module"})),Zi=Yl(oO);var l0={},Y2;function j4(){return Y2||(Y2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getLimitedFontSize=function({oldText:n,newText:t,element:r}){if(!(t.length/Math.max(20,n.length)>=4))return r.fontSize;const a=r.width*r.page.computedHeight/t.length,o=1.5*Math.sqrt(a),s=r.fontSize;return Math.min(s,Math.max(5,Math.round(o)))}}(l0)),l0}var K2;function D4(){return K2||(K2=1,function(e){var n=ld&&ld.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=e.getLineHeight=e.useFontLoader=void 0,e.isRTLText=M,e.getDir=T,e.usePrevious=k;const t=n(Or()),r=Ri,a=oo,o=wc,s=Xi,c=n(Mi()),m=qS,f=Gd(),v=Ks(),y=Vd(),E=Jl(),w=F5(),S=$d(),x=Ys(),_=Xs(),b=es(),g=Zi,h=j4();c.default._fixTextRendering=!0;const d=document.createElement("style");d.type="text/css",document.head.appendChild(d);const P={border:"none",padding:"0px",overflow:"hidden",background:"none",outline:"none",resize:"none",overflowWrap:"break-word",whiteSpace:"pre-wrap",userSelect:"text",wordBreak:"normal"};function M(O){O=O.replace(/\s/g,"");let N=0;for(var A=0;A<O.length;A++)R=O[A],L="֑-߿יִ-﷽ﹰ-ﻼ",new RegExp("^[^"+L+"]*?["+L+"]").test(R)&&(N+=1);var R,L;return N>O.length/2}function T(O){return M(O)?"rtl":"ltr"}const I=(0,r.observer)(({textNodeRef:O,element:N,onBlur:A,selectAll:R,cursorPosition:L})=>{const[V,G]=t.default.useState(P),W=O.current;t.default.useLayoutEffect(()=>{const U={};U.width=W.width()-2*W.padding()+"px",U.height=W.height()-2*W.padding()+W.fontSize()*W.lineHeight()+"px",U.fontSize=W.fontSize()+"px",U.lineHeight=W.lineHeight()+.01,U.fontFamily=W.fontFamily(),U.textAlign=W.align(),U.color=W.fill(),U.fontWeight=N.fontWeight,U.fontStyle=N.fontStyle,U.letterSpacing=N.letterSpacing+"em";const ee=`
|
|
95
|
+
`)}var BE=0,UE=function(){function e(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:BE++}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:ur.map()}),Object.defineProperty(this,"lastCacheModificationPerId",{enumerable:!0,configurable:!0,writable:!0,value:ur.map()})}return Object.defineProperty(e.prototype,"updateLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var t=this.lastCacheModificationPerId.get(n);this.lastCacheModificationPerId.set(n,t===void 0?1:t+1)}}),Object.defineProperty(e.prototype,"getLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var t=this.lastCacheModificationPerId.get(n)||0;return"".concat(this.cacheId,"-").concat(t)}}),Object.defineProperty(e.prototype,"addNodeToCache",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){if(t===void 0&&(t=!0),n.identifierAttribute){var r=n.identifier;this.cache.has(r)||this.cache.set(r,ur.array([],Hp));var a=this.cache.get(r);if(a.indexOf(n)!==-1)throw new lt("Already registered");a.push(n),t&&this.updateLastCacheModificationPerId(r)}}}),Object.defineProperty(e.prototype,"mergeCache",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var t=this;yv(n.identifierCache.cache).forEach(function(r){return r.forEach(function(a){t.addNodeToCache(a)})})}}),Object.defineProperty(e.prototype,"notifyDied",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(n.identifierAttribute){var t=n.identifier,r=this.cache.get(t);r&&(r.remove(n),r.length||this.cache.delete(t),this.updateLastCacheModificationPerId(n.identifier))}}}),Object.defineProperty(e.prototype,"splitCache",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var t=this,r=new e,a=n.path+"/";return nw(this.cache).forEach(function(o){for(var s=io(o,2),c=s[0],m=s[1],f=!1,v=m.length-1;v>=0;v--){var y=m[v];(y===n||y.path.indexOf(a)===0)&&(r.addNodeToCache(y,!1),m.splice(v,1),m.length||t.cache.delete(c),f=!0)}f&&t.updateLastCacheModificationPerId(c)}),r}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){var r=this.cache.get(t);return r?r.some(function(a){return n.isAssignableFrom(a.type)}):!1}}),Object.defineProperty(e.prototype,"resolve",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){var r=this.cache.get(t);if(!r)return null;var a=r.filter(function(o){return n.isAssignableFrom(o.type)});switch(a.length){case 0:return null;case 1:return a[0];default:throw new lt("Cannot resolve a reference to type '".concat(n.name,"' with id: '").concat(t,"' unambigously, there are multiple candidates: ").concat(a.map(function(o){return o.path}).join(", ")))}}}),e}();function Uv(e,n,t,r,a){var o=s4(a);if(o){if(o.parent)throw new lt("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(n?n.path:"","/").concat(t,"', but it lives already at '").concat(o.path,"'"));return n&&o.setParent(n,t),o}return new pi(e,n,t,r,a)}function ts(e,n,t,r,a){return new Md(e,n,t,r,a)}function qE(e){return e instanceof Md||e instanceof pi}var Tn;(function(e){e[e.INITIALIZING=0]="INITIALIZING",e[e.CREATED=1]="CREATED",e[e.FINALIZED=2]="FINALIZED",e[e.DETACHING=3]="DETACHING",e[e.DEAD=4]="DEAD"})(Tn||(Tn={}));function ir(e){return!!(e&&e.$treenode)}function dt(e){if(!ir(e))throw new lt("Value ".concat(e," is no MST Node"));return e.$treenode}function s4(e){return e&&e.$treenode||null}function HE(){return dt(this).snapshot}var GE=function(e){return".."};function u4(e,n){if(e.root!==n.root)throw new lt("Cannot calculate relative path: objects '".concat(e,"' and '").concat(n,"' are not part of the same object tree"));for(var t=mc(e.path),r=mc(n.path),a=0;a<t.length&&t[a]===r[a];a++);return t.slice(a).map(GE).join("/")+Sp(r.slice(a))}function c4(e,n,t){return t===void 0&&(t=!0),f4(e,mc(n),t)}function f4(e,n,t){t===void 0&&(t=!0);var r=e;try{for(var a=0;a<n.length;a++){var o=n[a];if(o===".."){if(r=r.parent,r)continue}else{if(o===".")continue;if(r){if(r instanceof Md){var s=r.value;ir(s)&&(r=dt(s))}if(r instanceof pi){var c=r.getChildType(o);if(c&&(r=r.getChildNode(o),r))continue}}}throw new lt("Could not resolve '".concat(o,"' in path '").concat(Sp(n.slice(0,a))||"/","' while resolving '").concat(Sp(n),"'"))}}catch(m){if(!t)return;throw m}return r}function d4(e){if(!e)return pc;var n=Object.keys(e);if(!n.length)return pc;var t=new Array(n.length);return n.forEach(function(r,a){t[a]=e[r]}),t}function VE(e){return m4(e)}var $E=Object.toString(),pc=Object.freeze([]),gc=Object.freeze({}),Hp=N5().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(Hp);var lt=function(e){wr(n,e);function n(t){return t===void 0&&(t="Illegal state"),e.call(this,"[mobx-state-tree] ".concat(t))||this}return n}(Error);function WE(e){return e}var YE=Number.isInteger;function KE(e){return Number(e)===e&&e%1!==0}function XE(e){return Number.isFinite(e)}function qv(e){return Array.isArray(e)||Qn(e)}function Hv(e){return e?qv(e)?e:[e]:pc}function ZE(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];for(var r=0;r<n.length;r++){var a=n[r];for(var o in a)e[o]=a[o]}return e}function Ds(e){var n;if(e===null||typeof e!="object")return!1;var t=Object.getPrototypeOf(e);return t==null?!0:((n=t.constructor)===null||n===void 0?void 0:n.toString())===$E}function h4(e){return e!==null&&typeof e=="object"&&!(e instanceof Date)&&!(e instanceof RegExp)}function vc(e,n){return n===void 0&&(n=!0),e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||n&&e instanceof Date}function p4(e){return typeof e!="function"}function QE(e,n,t){yn(e)?wv(e,n,t):Object.defineProperty(e,n,t)}function Fs(e,n,t){QE(e,n,{enumerable:!1,writable:!1,configurable:!0,value:t})}var JE=function(){function e(){Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,"hasSubscribers",{get:function(){return this.handlers.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){var r=this;return t===void 0&&(t=!1),t?this.handlers.unshift(n):this.handlers.push(n),function(){r.unregister(n)}}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this.handlers.indexOf(n)>=0}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var t=this.handlers.indexOf(n);t>=0&&this.handlers.splice(t,1)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.handlers.length=0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var r=this.handlers.slice();r.forEach(function(a){return a.apply(void 0,ao([],io(n),!1))})}}),e}(),g4=function(){function e(){Object.defineProperty(this,"eventHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"hasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var t=this.eventHandlers&&this.eventHandlers[n];return!!t&&t.hasSubscribers}}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t,r){r===void 0&&(r=!1),this.eventHandlers||(this.eventHandlers={});var a=this.eventHandlers[n];return a||(a=this.eventHandlers[n]=new JE),a.register(t,r)}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){var r=this.eventHandlers&&this.eventHandlers[n];return!!r&&r.has(t)}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){var r=this.eventHandlers&&this.eventHandlers[n];r&&r.unregister(t)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.eventHandlers&&delete this.eventHandlers[n]}}),Object.defineProperty(e.prototype,"clearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.eventHandlers=void 0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(n){for(var t,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];var o=this.eventHandlers&&this.eventHandlers[n];o&&(t=o).emit.apply(t,ao([],io(r),!1))}}),e}();function v4(e){for(var n=new Array(e.length),t=0;t<e.length;t++)n[t]=e[t];return n}function n0(e,n){return e.indexOf(n)===0}function ex(e){console.warn(new Error("[mobx-state-tree] ".concat(e)))}function tx(){return typeof process<"u"&&z2&&z2.ENABLE_TYPE_CHECK==="true"}function i0(e){typeof queueMicrotask=="function"?queueMicrotask(e):typeof setImmediate=="function"?setImmediate(e):setTimeout(e,1)}function m4(e){return ax(e.name,e)}function rx(e){return e}function nx(e){return function(){var n,t=[];for(n=0;n<arguments.length;n++)t[n]=arguments[n];return qw(this,function(r){switch(r.label){case 0:return[4,e.apply(void 0,ao([],io(t),!1))];case 1:return[2,r.sent()]}})}}function ix(e){return qw(this,function(n){switch(n.label){case 0:return[4,e];case 1:return[2,n.sent()]}})}function ax(e,n){var t=function(){var a=r4(),o=Fv();if(!o)throw new lt("a mst flow must always have a parent context");var s=n4(o);if(!s)throw new lt("a mst flow must always have a parent action context");var c={name:e,id:a,tree:o.tree,context:o.context,parentId:o.id,allParentIds:ao(ao([],io(o.allParentIds),!1),[o.id],!1),rootId:o.rootId,parentEvent:o,parentActionEvent:s},m=arguments;function f(v,y,E){return v.$mst_middleware=t.$mst_middleware,ov(ln(ln({},c),{type:y,args:[E]}),v)}return new Promise(function(v,y){var E,w=function(){E=n.apply(null,arguments),S(void 0)};w.$mst_middleware=t.$mst_middleware,ov(ln(ln({},c),{type:"flow_spawn",args:v4(m)}),w);function S(b){var g;try{var h=f(function(d){g=E.next(d)},"flow_resume",b);h instanceof Error&&(g=E.throw(h))}catch(d){i0(function(){f(function(P){y(d)},"flow_throw",d)});return}_(g)}function x(b){var g;try{f(function(h){g=E.throw(h)},"flow_resume_error",b)}catch(h){i0(function(){f(function(d){y(h)},"flow_throw",h)});return}_(g)}function _(b){if(b.done){i0(function(){f(function(g){v(g)},"flow_return",b.value)});return}if(!b.value||typeof b.value.then!="function")throw new lt("Only promises can be yielded to `async`, got: "+b);return b.value.then(S,x)}})};return t._isFlowAction=!0,t}function ox(e){if(!("oldValue"in e))throw new lt("Patches without `oldValue` field cannot be inversed");return[lx(e),sx(e)]}function lx(e){switch(e.op){case"add":return{op:"add",path:e.path,value:e.value};case"remove":return{op:"remove",path:e.path};case"replace":return{op:"replace",path:e.path,value:e.value}}}function sx(e){switch(e.op){case"add":return{op:"remove",path:e.path};case"remove":return{op:"add",path:e.path,value:e.oldValue};case"replace":return{op:"replace",path:e.path,value:e.oldValue}}}function ux(e){return typeof e=="number"}function Vl(e){return ux(e)===!0?""+e:e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function y4(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Sp(e){if(e.length===0)return"";var n=function(t){return t.map(Vl).join("/")};return e[0]==="."||e[0]===".."?n(e):"/"+n(e)}function mc(e){var n=e.split("/").map(y4),t=e===""||e==="."||e===".."||n0(e,"/")||n0(e,"./")||n0(e,"../");if(!t)throw new lt("a json path must be either rooted, empty or relative, but got '".concat(e,"'"));return n[0]===""&&n.shift(),n}var a0=Symbol("$preProcessorFailed"),cx=function(e){wr(n,e);function n(t,r,a){var o=e.call(this,a||t.name)||this;return Object.defineProperty(o,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"_processors",{enumerable:!0,configurable:!0,writable:!0,value:r}),o}return Object.defineProperty(n.prototype,"flags",{get:function(){return this._subtype.flags|Nt.SnapshotProcessor},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"snapshotProcessor(".concat(this._subtype.describe(),")")}}),Object.defineProperty(n.prototype,"preProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._processors.preProcessor?this._processors.preProcessor.call(null,t):t}}),Object.defineProperty(n.prototype,"preProcessSnapshotSafe",{enumerable:!1,configurable:!0,writable:!0,value:function(t){try{return this.preProcessSnapshot(t)}catch{return a0}}}),Object.defineProperty(n.prototype,"postProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this._processors.postProcessor?this._processors.postProcessor.call(null,t,r.storedValue):t}}),Object.defineProperty(n.prototype,"_fixNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this;fx(t.type,this,"create"),t instanceof pi&&(t.hasSnapshotPostProcessor=!!this._processors.postProcessor);var a=t.getSnapshot;t.getSnapshot=function(){return r.postProcessSnapshot(a.call(t),t)},T4(this._subtype)||(t.getReconciliationType=function(){return r})}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=ir(o)?o:this.preProcessSnapshot(o),c=this._subtype.instantiate(t,r,a,s);return this._fixNode(c),c}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=this._subtype.reconcile(t,ir(r)?r:this.preProcessSnapshot(r),a,o);return s!==t&&this._fixNode(s),s}}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){r===void 0&&(r=!0);var a=this._subtype.getSnapshot(t);return r?this.postProcessSnapshot(a,t):a}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this.preProcessSnapshotSafe(t);return a===a0?vi(r,t,"Failed to preprocess value"):this._subtype.validate(a,r)}}),Object.defineProperty(n.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),Object.defineProperty(n.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=sn(t)?this._subtype:ir(t)?jv(t,!1):this.preProcessSnapshotSafe(t);return r===a0?!1:this._subtype.validate(r,[{path:"",type:this._subtype}]).length===0}}),Object.defineProperty(n.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._subtype.isAssignableFrom(t)}}),Object.defineProperty(n.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(!(this._subtype instanceof hc))return!1;var a=this.preProcessSnapshot(r);return this._subtype.isMatchingSnapshotId(t,a)}}),n}(Xo);function fx(e,n){for(var t,r,a=[],o=2;o<arguments.length;o++)a[o-2]=arguments[o];try{for(var s=Cd(a),c=s.next();!c.done;c=s.next()){var m=c.value;e[m]=n[m].bind(n)}}catch(f){t={error:f}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}}function dx(e,n,t){return new cx(e,n,t)}var B2="Map.put can only be used to store complex values that have an identifier type attribute";function b4(e,n){var t,r,a=e.getSubTypes();if(a===Jw)return!1;if(a){var o=Hv(a);try{for(var s=Cd(o),c=s.next();!c.done;c=s.next()){var m=c.value;if(!b4(m,n))return!1}}catch(f){t={error:f}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}}return e instanceof Nd&&n.push(e),!0}var ql;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.YES=1]="YES",e[e.NO=2]="NO"})(ql||(ql={}));var hx=function(e){wr(n,e);function n(t,r){return e.call(this,t,ur.ref.enhancer,r)||this}return Object.defineProperty(n.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.get.call(this,""+t)}}),Object.defineProperty(n.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.has.call(this,""+t)}}),Object.defineProperty(n.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.delete.call(this,""+t)}}),Object.defineProperty(n.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return e.prototype.set.call(this,""+t,r)}}),Object.defineProperty(n.prototype,"put",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!t)throw new lt("Map.put cannot be used to set empty values");if(ir(t)){var r=dt(t);if(r.identifier===null)throw new lt(B2);return this.set(r.identifier,t),t}else if(h4(t)){var a=dt(this),o=a.type;if(o.identifierMode!==ql.YES)throw new lt(B2);var s=o.mapIdentifierAttribute,c=t[s];if(!Vv(c)){var m=this.put(o.getChildType().create(t,a.environment));return this.put(jv(m))}var f=_c(c);return this.set(f,t),this.get(f)}else throw new lt("Map.put can only be used to store complex values")}}),n}(Dp),Ep=function(e){wr(n,e);function n(t,r,a){a===void 0&&(a=[]);var o=e.call(this,t)||this;return Object.defineProperty(o,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"identifierMode",{enumerable:!0,configurable:!0,writable:!0,value:ql.UNKNOWN}),Object.defineProperty(o,"mapIdentifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Map}),Object.defineProperty(o,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),o._determineIdentifierMode(),o.hookInitializers=a,o}return Object.defineProperty(n.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.hookInitializers.length>0?this.hookInitializers.concat(t):[t];return new n(this.name,this._subType,r)}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return this._determineIdentifierMode(),Uv(this,t,r,a,o)}}),Object.defineProperty(n.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===ql.UNKNOWN){var t=[];if(b4(this._subType,t)){var r=t.reduce(function(a,o){if(!o.identifierAttribute)return a;if(a&&a!==o.identifierAttribute)throw new lt("The objects in a map should all have the same identifier attribute, expected '".concat(a,"', but child of type '").concat(o.name,"' declared attribute '").concat(o.identifierAttribute,"' as identifier"));return o.identifierAttribute},void 0);r?(this.identifierMode=ql.YES,this.mapIdentifierAttribute=r):this.identifierMode=ql.NO}}}}),Object.defineProperty(n.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){r===void 0&&(r={});var a=t.type._subType,o={};return Object.keys(r).forEach(function(s){o[s]=a.instantiate(t,s,void 0,r[s])}),o}}),Object.defineProperty(n.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new hx(t,this.name)}}),Object.defineProperty(n.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){mv(r,t.unbox);var a=t.type;a.hookInitializers.forEach(function(o){var s=o(r);Object.keys(s).forEach(function(c){var m=s[c],f=Ld(r,c,m);Fs(r,c,f)})}),Np(r,this.willChange),jp(r,this.didChange)}}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(n.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return yv(t.storedValue)}}),Object.defineProperty(n.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=t.storedValue.get(""+r);if(!a)throw new lt("Not a child "+r);return a}}),Object.defineProperty(n.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=dt(t.object),a=t.name;r.assertWritable({subpath:a});var o=r.type,s=o._subType;switch(t.type){case"update":{var c=t.newValue,m=t.object.get(a);if(c===m)return null;Yo(s,c),t.newValue=s.reconcile(r.getChildNode(a),t.newValue,r,a),o.processIdentifier(a,t.newValue)}break;case"add":Yo(s,t.newValue),t.newValue=s.instantiate(r,a,void 0,t.newValue),o.processIdentifier(a,t.newValue);break}return t}}),Object.defineProperty(n.prototype,"processIdentifier",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(this.identifierMode===ql.YES&&r instanceof pi){var a=r.identifier;if(a!==t)throw new lt("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '".concat(a,"', but expected: '").concat(t,"'"))}}}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r={};return t.getChildren().forEach(function(a){r[a.subpath]=a.snapshot}),r}}),Object.defineProperty(n.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r={};return Object.keys(t).forEach(function(a){r[a]=t[a].getSnapshot()}),r}}),Object.defineProperty(n.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=dt(t.object);switch(t.type){case"update":return void r.emitPatch({op:"replace",path:Vl(t.name),value:t.newValue.snapshot,oldValue:t.oldValue?t.oldValue.snapshot:void 0},r);case"add":return void r.emitPatch({op:"add",path:Vl(t.name),value:t.newValue.snapshot,oldValue:void 0},r);case"delete":var a=t.oldValue.snapshot;return t.oldValue.die(),void r.emitPatch({op:"remove",path:Vl(t.name),oldValue:a},r)}}}),Object.defineProperty(n.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a){var o=t.storedValue;switch(a.op){case"add":case"replace":o.set(r,a.value);break;case"remove":o.delete(r);break}}}),Object.defineProperty(n.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){Yo(this,r);var a=t.storedValue,o={};if(Array.from(a.keys()).forEach(function(c){o[c]=!1}),r)for(var s in r)a.set(s,r[s]),o[""+s]=!0;Object.keys(o).forEach(function(c){o[c]===!1&&a.delete(c)})}}),Object.defineProperty(n.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this;return Ds(t)?qp(Object.keys(t).map(function(o){return a._subType.validate(t[o],Bv(r,o,a._subType))})):vi(r,t,"Value is not a plain object")}}),Object.defineProperty(n.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return gc}}),Object.defineProperty(n.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){t.storedValue.delete(r)}}),n}(hc);Ep.prototype.applySnapshot=Xr(Ep.prototype.applySnapshot);function px(e){return new Ep("Map<string, ".concat(e.name,">"),e)}function gx(e){return sn(e)&&(e.flags&Nt.Map)>0}var xp=function(e){wr(n,e);function n(t,r,a){a===void 0&&(a=[]);var o=e.call(this,t)||this;return Object.defineProperty(o,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Array}),Object.defineProperty(o,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),o.hookInitializers=a,o}return Object.defineProperty(n.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.hookInitializers.length>0?this.hookInitializers.concat(t):[t];return new n(this.name,this._subType,r)}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return Uv(this,t,r,a,o)}}),Object.defineProperty(n.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){r===void 0&&(r=[]);var a=t.type._subType,o={};return r.forEach(function(s,c){var m=""+c;o[m]=a.instantiate(t,m,void 0,s)}),o}}),Object.defineProperty(n.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=ln(ln({},Hp),{name:this.name});return ur.array(d4(t),r)}}),Object.defineProperty(n.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){Pa(r).dehancer=t.unbox;var a=t.type;a.hookInitializers.forEach(function(o){var s=o(r);Object.keys(s).forEach(function(c){var m=s[c],f=Ld(r,c,m);Fs(r,c,f)})}),Np(r,this.willChange),jp(r,this.didChange)}}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(n.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue.slice()}}),Object.defineProperty(n.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=Number(r);if(a<t.storedValue.length)return t.storedValue[a];throw new lt("Not a child: "+r)}}),Object.defineProperty(n.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=dt(t.object);r.assertWritable({subpath:""+t.index});var a=r.type._subType,o=r.getChildren();switch(t.type){case"update":{if(t.newValue===t.object[t.index])return null;var s=U2(r,a,[o[t.index]],[t.newValue],[t.index]);if(!s)return null;t.newValue=s[0]}break;case"splice":{var c=t.index,m=t.removedCount,f=t.added,v=U2(r,a,o.slice(c,c+m),f,f.map(function(E,w){return c+w}));if(!v)return null;t.added=v;for(var y=c+m;y<o.length;y++)o[y].setParent(r,""+(y+f.length-m))}break}return t}}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.getChildren().map(function(r){return r.snapshot})}}),Object.defineProperty(n.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=[];return Object.keys(t).forEach(function(a){r.push(t[a].getSnapshot())}),r}}),Object.defineProperty(n.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=dt(t.object);switch(t.type){case"update":return void r.emitPatch({op:"replace",path:""+t.index,value:t.newValue.snapshot,oldValue:t.oldValue?t.oldValue.snapshot:void 0},r);case"splice":if(t.removedCount&&t.addedCount===t.object.length)return void r.emitPatch({op:"replace",path:"",value:r.snapshot,oldValue:t.removed.map(function(o){return o.snapshot})},r);for(var a=t.removedCount-1;a>=0;a--)r.emitPatch({op:"remove",path:""+(t.index+a),oldValue:t.removed[a].snapshot},r);for(var a=0;a<t.addedCount;a++)r.emitPatch({op:"add",path:""+(t.index+a),value:t.added[a].snapshot,oldValue:void 0},r);return}}}),Object.defineProperty(n.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a){var o=t.storedValue,s=r==="-"?o.length:Number(r);switch(a.op){case"replace":o[s]=a.value;break;case"add":o.splice(s,0,a.value);break;case"remove":o.splice(s,1);break}}}),Object.defineProperty(n.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){Yo(this,r);var a=t.storedValue;a.replace(r)}}),Object.defineProperty(n.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this;return qv(t)?qp(t.map(function(o,s){return a._subType.validate(o,Bv(r,""+s,a._subType))})):vi(r,t,"Value is not an array")}}),Object.defineProperty(n.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return pc}}),Object.defineProperty(n.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){t.storedValue.splice(Number(r),1)}}),n}(hc);xp.prototype.applySnapshot=Xr(xp.prototype.applySnapshot);function vx(e){return new xp("".concat(e.name,"[]"),e)}function U2(e,n,t,r,a){for(var o=!0,s=0;;s++){var c=s<=r.length-1,m=t[s],f=c?r[s]:void 0,v=""+a[s];if(qE(f)&&(f=f.storedValue),!m&&!c)break;if(!c)o=!1,t.splice(s,1),m instanceof pi&&m.createObservableInstanceIfNeeded(),m.die(),s--;else if(m)if(q2(m,f))t[s]=o0(n,e,v,f,m);else{for(var E=void 0,w=s;w<t.length;w++)if(q2(t[w],f)){E=t.splice(w,1)[0];break}o=!1;var y=o0(n,e,v,f,E);t.splice(s,0,y)}else{if(ir(f)&&dt(f).parent===e)throw new lt("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(e.path,"/").concat(v,"', but it lives already at '").concat(dt(f).path,"'"));o=!1;var y=o0(n,e,v,f);t.splice(s,0,y)}}return o?null:t}function o0(e,n,t,r,a){Yo(e,r);function o(){if(ir(r)){var c=dt(r);if(c.assertAlive(gc),c.parent!==null&&c.parent===n)return c.setParent(n,t),c}return a?e.reconcile(a,r,n,t):e.instantiate(n,t,void 0,r)}var s=o();return a&&a!==s&&(a instanceof pi&&a.createObservableInstanceIfNeeded(),a.die()),s}function q2(e,n){if(!e.isAlive)return!1;if(ir(n)){var t=dt(n);return t.isAlive&&t===e}if(e.snapshot===n)return!0;if(!(e instanceof pi))return!1;var r=e.getReconciliationType();return e.identifier!==null&&e.identifierAttribute&&Ds(n)&&r.is(n)&&r.isMatchingSnapshotId(e,n)}function mx(e){return sn(e)&&(e.flags&Nt.Array)>0}var H2="preProcessSnapshot",G2="postProcessSnapshot";function yx(){return dt(this).toString()}var V2={name:"AnonymousModel",properties:{},initializers:pc};function bx(e){var n=Object.keys(e),t=new Set;return n.forEach(function(r){if(t.has(r))throw new lt("".concat(r," is declared twice in the model. Model should not contain the same keys"));t.add(r)}),n.reduce(function(r,a){if(a in on)throw new lt("Hook '".concat(a,"' was defined as property. Hooks should be defined as part of the actions"));var o=Object.getOwnPropertyDescriptor(e,a);if("get"in o)throw new lt("Getters are not supported as properties. Please use views instead");var s=o.value;if(s==null)throw new lt("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(vc(s))r[a]=zs(Ox(s),s);else if(s instanceof Ep)r[a]=zs(s,{});else if(s instanceof xp)r[a]=zs(s,[]);else if(!sn(s))throw new lt("Invalid type definition for property '".concat(a,"', cannot infer a type from a value like '").concat(s,"' (").concat(typeof s,")"));return r},ln({},e))}var Nd=function(e){wr(n,e);function n(t){var r=e.call(this,t.name||V2.name)||this;return Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Object}),Object.defineProperty(r,"initializers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"properties",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"preProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"postProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"propertyNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"named",{enumerable:!0,configurable:!0,writable:!0,value:function(a){return r.cloneAndEnhance({name:a})}}),Object.defineProperty(r,"props",{enumerable:!0,configurable:!0,writable:!0,value:function(a){return r.cloneAndEnhance({properties:a})}}),Object.defineProperty(r,"preProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(a){var o=r.preProcessor;return o?r.cloneAndEnhance({preProcessor:function(s){return o(a(s))}}):r.cloneAndEnhance({preProcessor:a})}}),Object.defineProperty(r,"postProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(a){var o=r.postProcessor;return o?r.cloneAndEnhance({postProcessor:function(s){return a(o(s))}}):r.cloneAndEnhance({postProcessor:a})}}),Object.assign(r,V2,t),r.properties=bx(r.properties),r.properties,r.propertyNames=Object.keys(r.properties),r.identifierAttribute=r._getIdentifierAttribute(),r}return Object.defineProperty(n.prototype,"_getIdentifierAttribute",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=void 0;return this.forAllProps(function(r,a){if(a.flags&Nt.Identifier){if(t)throw new lt("Cannot define property '".concat(r,"' as object identifier, property '").concat(t,"' is already defined as identifier property"));t=r}}),t}}),Object.defineProperty(n.prototype,"cloneAndEnhance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new n({name:t.name||this.name,properties:Object.assign({},this.properties,t.properties),initializers:this.initializers.concat(t.initializers||[]),preProcessor:t.preProcessor||this.preProcessor,postProcessor:t.postProcessor||this.postProcessor})}}),Object.defineProperty(n.prototype,"actions",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this,a=function(o){return r.instantiateActions(o,t(o)),o};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(n.prototype,"instantiateActions",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(!Ds(r))throw new lt("actions initializer should return a plain object containing actions");Object.keys(r).forEach(function(a){if(a===H2)throw new lt("Cannot define action '".concat(H2,"', it should be defined using 'type.preProcessSnapshot(fn)' instead"));if(a===G2)throw new lt("Cannot define action '".concat(G2,"', it should be defined using 'type.postProcessSnapshot(fn)' instead"));var o=r[a],s=t[a];if(a in on&&s){var c=o;o=function(){s.apply(null,arguments),c.apply(null,arguments)}}var m=o.$mst_middleware,f=o.bind(r);f._isFlowAction=o._isFlowAction||!1,f.$mst_middleware=m;var v=Ld(t,a,f);r[a]=v,Fs(t,a,v)})}}),Object.defineProperty(n.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this;if(typeof t!="function")throw new lt("You passed an ".concat(typeof t," to volatile state as an argument, when function is expected"));var a=function(o){return r.instantiateVolatileState(o,t(o)),o};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(n.prototype,"instantiateVolatileState",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(!Ds(r))throw new lt("volatile state initializer should return a plain object containing state");bv(t,r)}}),Object.defineProperty(n.prototype,"extend",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this,a=function(o){var s=t(o),c=s.actions,m=s.views,f=s.state,v=VS(s,["actions","views","state"]);for(var y in v)throw new lt("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '".concat(y,"'"));return f&&r.instantiateVolatileState(o,f),m&&r.instantiateViews(o,m),c&&r.instantiateActions(o,c),o};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(n.prototype,"views",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this,a=function(o){return r.instantiateViews(o,t(o)),o};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(n.prototype,"instantiateViews",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(!Ds(r))throw new lt("views initializer should return a plain object containing views");Object.getOwnPropertyNames(r).forEach(function(a){var o,s=Object.getOwnPropertyDescriptor(r,a);if("get"in s)wv(t,a,s),_v(t,(o={},o[a]=Vs,o));else if(typeof s.value=="function")Fs(t,a,s.value);else throw new lt("A view member should either be a function or getter based property")})}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=ir(o)?o:this.applySnapshotPreProcessor(o);return Uv(this,t,r,a,s)}}),Object.defineProperty(n.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){r===void 0&&(r={});var a=t.type,o={};return a.forAllProps(function(s,c){o[s]=c.instantiate(t,s,void 0,r[s])}),o}}),Object.defineProperty(n.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=ln(ln({},Hp),{name:this.name});return ur.object(t,gc,r)}}),Object.defineProperty(n.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){Fs(r,"toString",yx),this.forAllProps(function(a){mv(r,a,t.unbox)}),this.initializers.reduce(function(a,o){return o(a)},r),Np(r,this.willChange),jp(r,this.didChange)}}),Object.defineProperty(n.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=t,a=dt(r.object),o=r.name;a.assertWritable({subpath:o});var s=a.type.properties[o];return s&&(Yo(s,r.newValue),r.newValue=s.reconcile(a.getChildNode(o),r.newValue,a,o)),r}}),Object.defineProperty(n.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=t,a=dt(r.object),o=a.type.properties[r.name];if(o){var s=r.oldValue?r.oldValue.snapshot:void 0;a.emitPatch({op:"replace",path:Vl(r.name),value:r.newValue.snapshot,oldValue:s},a)}}}),Object.defineProperty(n.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this,a=[];return this.forAllProps(function(o){a.push(r.getChildNode(t,o))}),a}}),Object.defineProperty(n.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a;if(!(r in this.properties))throw new lt("Not a value property: "+r);var o=Pa(t.storedValue,r),s=(a=o.raw)===null||a===void 0?void 0:a.call(o);if(!s)throw new lt("Node not available for property "+r);return s}}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this;r===void 0&&(r=!0);var o={};return this.forAllProps(function(s,c){try{var m=no(t.storedValue,s);m.reportObserved()}catch{throw new lt("".concat(s," property is declared twice"))}o[s]=a.getChildNode(t,s).snapshot}),r?this.applySnapshotPostProcessor(o):o}}),Object.defineProperty(n.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r={};return Object.keys(t).forEach(function(a){r[a]=t[a].getSnapshot()}),this.applySnapshotPostProcessor(r)}}),Object.defineProperty(n.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a){if(!(a.op==="replace"||a.op==="add"))throw new lt("object does not support operation ".concat(a.op));t.storedValue[r]=a.value}}),Object.defineProperty(n.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){Yo(this,r);var a=this.applySnapshotPreProcessor(r);this.forAllProps(function(o){t.storedValue[o]=a[o]})}}),Object.defineProperty(n.prototype,"applySnapshotPreProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.preProcessor;return r?r.call(null,t):t}}),Object.defineProperty(n.prototype,"applySnapshotPostProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.postProcessor;return r?r.call(null,t):t}}),Object.defineProperty(n.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.properties[t]}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this,o=this.applySnapshotPreProcessor(t);return Ds(o)?qp(this.propertyNames.map(function(s){return a.properties[s].validate(o[s],Bv(r,s,a.properties[s]))})):vi(r,o,"Value is not a plain object")}}),Object.defineProperty(n.prototype,"forAllProps",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this;this.propertyNames.forEach(function(a){return t(a,r.properties[a])})}}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;return"{ "+this.propertyNames.map(function(r){return r+": "+t.properties[r].describe()}).join("; ")+" }"}}),Object.defineProperty(n.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return gc}}),Object.defineProperty(n.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){t.storedValue[r]=void 0}}),n}(hc);Nd.prototype.applySnapshot=Xr(Nd.prototype.applySnapshot);function wx(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=typeof e[0]=="string"?e.shift():"AnonymousModel",r=e.shift()||{};return new Nd({name:t,properties:r})}function _x(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=typeof e[0]=="string",r=t?e[0]:"AnonymousModel";return t&&e.shift(),e.reduce(function(a,o){return a.cloneAndEnhance({name:a.name+"_"+o.name,properties:o.properties,initializers:o.initializers,preProcessor:function(s){return o.applySnapshotPreProcessor(a.applySnapshotPreProcessor(s))},postProcessor:function(s){return o.applySnapshotPostProcessor(a.applySnapshotPostProcessor(s))}})}).named(r)}function w4(e){return sn(e)&&(e.flags&Nt.Object)>0}var Zo=function(e){wr(n,e);function n(t,r,a,o){o===void 0&&(o=WE);var s=e.call(this,t)||this;return Object.defineProperty(s,"flags",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(s,"checker",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(s,"initializer",{enumerable:!0,configurable:!0,writable:!0,value:o}),s.flags=r,s}return Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return ts(this,t,r,a,o)}}),Object.defineProperty(n.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.initializer(t)}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(vc(t)&&this.checker(t))return gi();var a=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return vi(r,t,"Value is not a ".concat(a))}}),n}(Zs),_4=new Zo("string",Nt.String,function(e){return typeof e=="string"}),S4=new Zo("number",Nt.Number,function(e){return typeof e=="number"}),Sx=new Zo("integer",Nt.Integer,function(e){return YE(e)}),Ex=new Zo("float",Nt.Float,function(e){return KE(e)}),xx=new Zo("finite",Nt.Finite,function(e){return XE(e)}),E4=new Zo("boolean",Nt.Boolean,function(e){return typeof e=="boolean"}),x4=new Zo("null",Nt.Null,function(e){return e===null}),O4=new Zo("undefined",Nt.Undefined,function(e){return e===void 0}),P4=new Zo("Date",Nt.Date,function(e){return typeof e=="number"||e instanceof Date},function(e){return e instanceof Date?e:new Date(e)});P4.getSnapshot=function(e){return e.storedValue.getTime()};var C4=P4;function Ox(e){switch(typeof e){case"string":return _4;case"number":return S4;case"boolean":return E4;case"object":if(e instanceof Date)return C4}throw new lt("Cannot determine primitive type from value "+e)}function k4(e){return sn(e)&&(e.flags&(Nt.String|Nt.Number|Nt.Integer|Nt.Boolean|Nt.Date))>0}var Px=function(e){wr(n,e);function n(t){var r=e.call(this,JSON.stringify(t))||this;return Object.defineProperty(r,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Literal}),r.value=t,r}return Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return ts(this,t,r,a,o)}}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify(this.value)}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return vc(t)&&t===this.value?gi():vi(r,t,"Value is not a literal ".concat(JSON.stringify(this.value)))}}),n}(Zs);function A4(e){return new Px(e)}function Cx(e){return sn(e)&&(e.flags&Nt.Literal)>0}var kx=function(e){wr(n,e);function n(t,r,a,o){var s=e.call(this,t)||this;return Object.defineProperty(s,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(s,"_predicate",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(s,"_message",{enumerable:!0,configurable:!0,writable:!0,value:o}),s}return Object.defineProperty(n.prototype,"flags",{get:function(){return this._subtype.flags|Nt.Refinement},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return this._subtype.instantiate(t,r,a,o)}}),Object.defineProperty(n.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._subtype.isAssignableFrom(t)}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this._subtype.validate(t,r);if(a.length>0)return a;var o=ir(t)?dt(t).snapshot:t;return this._predicate(o)?gi():vi(r,t,this._message(t))}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return this._subtype.reconcile(t,r,a,o)}}),Object.defineProperty(n.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),n}(Xo);function Ax(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=typeof e[0]=="string"?e.shift():sn(e[0])?e[0].name:null,r=e[0],a=e[1],o=e[2]?e[2]:function(s){return"Value does not respect the refinement predicate"};return new kx(t,r,a,o)}function Tx(e){return sn(e)&&(e.flags&Nt.Refinement)>0}function Rx(e,n){var t=typeof e=="string"?n:e,r=Gp.apply(void 0,ao([],io(t.map(function(a){return A4(""+a)})),!1));return typeof e=="string"&&(r.name=e),r}var Mx=function(e){wr(n,e);function n(t,r,a){var o=e.call(this,t)||this;return Object.defineProperty(o,"_types",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"_dispatcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_eager",{enumerable:!0,configurable:!0,writable:!0,value:!0}),a=ln({eager:!0,dispatcher:void 0},a),o._dispatcher=a.dispatcher,a.eager||(o._eager=!1),o}return Object.defineProperty(n.prototype,"flags",{get:function(){var t=Nt.Union;return this._types.forEach(function(r){t|=r.flags}),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._types.some(function(r){return r.isAssignableFrom(t)})}}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"("+this._types.map(function(t){return t.describe()}).join(" | ")+")"}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=this.determineType(o,void 0);if(!s)throw new lt("No matching type for union "+this.describe());return s.instantiate(t,r,a,o)}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=this.determineType(r,t.getReconciliationType());if(!s)throw new lt("No matching type for union "+this.describe());return s.reconcile(t,r,a,o)}}),Object.defineProperty(n.prototype,"determineType",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this._dispatcher?this._dispatcher(t):r?r.is(t)?r:this._types.filter(function(a){return a!==r}).find(function(a){return a.is(t)}):this._types.find(function(a){return a.is(t)})}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(this._dispatcher)return this._dispatcher(t).validate(t,r);for(var a=[],o=0,s=0;s<this._types.length;s++){var c=this._types[s],m=c.validate(t,r);if(m.length===0){if(this._eager)return gi();o++}else a.push(m)}return o===1?gi():vi(r,t,"No type is applicable for the union").concat(qp(a))}}),Object.defineProperty(n.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),n}(Xo);function Gp(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];var r=sn(e)?void 0:e,a=sn(e)?ao([e],io(n),!1):n,o="("+a.map(function(s){return s.name}).join(" | ")+")";return new Mx(o,a,r)}function T4(e){return sn(e)&&(e.flags&Nt.Union)>0}var Lx=function(e){wr(n,e);function n(t,r,a){var o=e.call(this,t.name)||this;return Object.defineProperty(o,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"_defaultValue",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"optionalValues",{enumerable:!0,configurable:!0,writable:!0,value:a}),o}return Object.defineProperty(n.prototype,"flags",{get:function(){return this._subtype.flags|Nt.Optional},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype.describe()+"?"}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){if(this.optionalValues.indexOf(o)>=0){var s=this.getDefaultInstanceOrSnapshot();return this._subtype.instantiate(t,r,a,s)}return this._subtype.instantiate(t,r,a,o)}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return this._subtype.reconcile(t,this.optionalValues.indexOf(r)<0&&this._subtype.is(r)?r:this.getDefaultInstanceOrSnapshot(),a,o)}}),Object.defineProperty(n.prototype,"getDefaultInstanceOrSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=typeof this._defaultValue=="function"?this._defaultValue():this._defaultValue;return typeof this._defaultValue=="function"&&Yo(this,t),t}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this.optionalValues.indexOf(t)>=0?gi():this._subtype.validate(t,r)}}),Object.defineProperty(n.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._subtype.isAssignableFrom(t)}}),Object.defineProperty(n.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),n}(Xo);function Nx(e,n){if(typeof n!="function"&&ir(n))throw new lt("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function zs(e,n,t){return Nx(e,n),new Lx(e,n,t||Ix)}var Ix=[void 0];function jx(e){return sn(e)&&(e.flags&Nt.Optional)>0}var Dx=zs(O4,void 0),Fx=zs(x4,null);function R4(e){return Gp(e,Dx)}function zx(e){return Gp(e,Fx)}var Bx=function(e){wr(n,e);function n(t,r){var a=e.call(this,t)||this;return Object.defineProperty(a,"_definition",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),a}return Object.defineProperty(n.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|Nt.Late},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"getSubType",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!this._subType){var r=void 0;try{r=this._definition()}catch(a){if(a instanceof ReferenceError)r=void 0;else throw a}if(t&&r===void 0)throw new lt("Late type seems to be used too early, the definition (still) returns undefined");r&&(this._subType=r)}return this._subType}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return this.getSubType(!0).instantiate(t,r,a,o)}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return this.getSubType(!0).reconcile(t,r,a,o)}}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.getSubType(!1);return t?t.name:"<uknown late type>"}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this.getSubType(!1);return a?a.validate(t,r):gi()}}),Object.defineProperty(n.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.getSubType(!1);return r?r.isAssignableFrom(t):!1}}),Object.defineProperty(n.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.getSubType(!1);return t||Jw}}),n}(Xo);function Ux(e,n){var t=typeof e=="string"?e:"late(".concat(e.toString(),")"),r=typeof e=="string"?n:e;return new Bx(t,r)}function qx(e){return sn(e)&&(e.flags&Nt.Late)>0}function Hx(e,n){return new Gx(e,n)}var Gx=function(e){wr(n,e);function n(t,r){var a=e.call(this,t)||this;return Object.defineProperty(a,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Lazy}),Object.defineProperty(a,"loadedType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(a,"pendingNodeList",{enumerable:!0,configurable:!0,writable:!0,value:ur.array()}),tv(function(){return a.pendingNodeList.length>0&&a.pendingNodeList.some(function(o){return o.isAlive&&a.options.shouldLoadPredicate(o.parent?o.parent.value:null)})},function(){a.options.loadType().then(Xr(function(o){a.loadedType=o,a.pendingNodeList.forEach(function(s){s.parent&&a.loadedType&&s.parent.applyPatches([{op:"replace",path:"/".concat(s.subpath),value:s.snapshot}])})}))}),a}return Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<lazy ".concat(this.name,">")}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=this;if(this.loadedType)return this.loadedType.instantiate(t,r,a,o);var c=ts(this,t,r,a,o);return this.pendingNodeList.push(c),tv(function(){return!c.isAlive},function(){return s.pendingNodeList.splice(s.pendingNodeList.indexOf(c),1)}),c}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this.loadedType?this.loadedType.validate(t,r):p4(t)?gi():vi(r,t,"Value is not serializable and cannot be lazy")}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return this.loadedType?(t.die(),this.loadedType.instantiate(a,o,a.environment,r)):e.prototype.reconcile.call(this,t,r,a,o)}}),n}(Zs),M4=function(e){wr(n,e);function n(t){var r=e.call(this,t?"frozen(".concat(t.name,")"):"frozen")||this;return Object.defineProperty(r,"subType",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Frozen}),r}return Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<any immutable value>"}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return ts(this,t,r,a,o)}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return p4(t)?this.subType?this.subType.validate(t,r):gi():vi(r,t,"Value is not serializable and cannot be frozen")}}),n}(Zs),$2=new M4;function Vx(e){return arguments.length===0?$2:sn(e)?new M4(e):zs($2,e)}function $x(e){return sn(e)&&(e.flags&Nt.Frozen)>0}function Wx(e){switch(e){case on.beforeDestroy:return"destroy";case on.beforeDetach:return"detach";default:return}}var Yx=function(){function e(n,t){if(Object.defineProperty(this,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"node",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolvedReference",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Vv(n))this.identifier=n;else if(ir(n)){var r=dt(n);if(!r.identifierAttribute)throw new lt("Can only store references with a defined identifier attribute.");var a=r.unnormalizedIdentifier;if(a==null)throw new lt("Can only store references to tree nodes with a defined identifier.");this.identifier=a}else throw new lt("Can only store references to tree nodes or identifiers, got: '".concat(n,"'"))}return Object.defineProperty(e.prototype,"updateResolvedReference",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var t=_c(this.identifier),r=n.root,a=r.identifierCache.getLastCacheModificationPerId(t);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==a){var o=this.targetType,s=r.identifierCache.resolve(o,t);if(!s)throw new Gv("[mobx-state-tree] Failed to resolve reference '".concat(this.identifier,"' to type '").concat(this.targetType.name,"' (from node: ").concat(n.path,")"));this.resolvedReference={node:s,lastCacheModification:a}}}}),Object.defineProperty(e.prototype,"resolvedValue",{get:function(){return this.updateResolvedReference(this.node),this.resolvedReference.node.value},enumerable:!1,configurable:!0}),e}(),Gv=function(e){wr(n,e);function n(t){var r=e.call(this,t)||this;return Object.setPrototypeOf(r,n.prototype),r}return n}(Error),L4=function(e){wr(n,e);function n(t,r){var a=e.call(this,"reference(".concat(t.name,")"))||this;return Object.defineProperty(a,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(a,"onInvalidated",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Reference}),a}return Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(n.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.targetType.isAssignableFrom(t)}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return Vv(t)?gi():vi(r,t,"Value is not a valid identifier, which is a string or a number")}}),Object.defineProperty(n.prototype,"fireInvalidated",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=r.parent;if(!(!s||!s.isAlive)){var c=s.storedValue;c&&this.onInvalidated({cause:t,parent:c,invalidTarget:o?o.storedValue:void 0,invalidId:a,replaceRef:function(m){dc(r.root.storedValue,{op:"replace",value:m,path:r.path})},removeRef:function(){w4(s.type)?this.replaceRef(void 0):dc(r.root.storedValue,{op:"remove",path:r.path})}})}}}),Object.defineProperty(n.prototype,"addTargetNodeWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this,o=this.getValue(t);if(o){var s=dt(o),c=function(v,y){var E=Wx(y);E&&a.fireInvalidated(E,t,r,s)},m=s.registerHook(on.beforeDetach,c),f=s.registerHook(on.beforeDestroy,c);return function(){m(),f()}}}}),Object.defineProperty(n.prototype,"watchTargetNodeForInvalidations",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a){var o=this;if(this.onInvalidated){var s;t.registerHook(on.beforeDestroy,function(){s&&s()});var c=function(m){s&&s();var f=t.parent,v=f&&f.storedValue;if(f&&f.isAlive&&v){var y=void 0;a?y=!!a.get(r,v):y=t.root.identifierCache.has(o.targetType,_c(r)),y?s=o.addTargetNodeWatcher(t,r):m||o.fireInvalidated("invalidSnapshotReference",t,r,null)}};t.state===Tn.FINALIZED?c(!0):(t.isRoot||t.root.registerHook(on.afterCreationFinalization,function(){t.parent&&t.parent.createObservableInstanceIfNeeded()}),t.registerHook(on.afterAttach,function(){c(!1)}))}}}),n}(Zs),Kx=function(e){wr(n,e);function n(t,r){return e.call(this,t,r)||this}return Object.defineProperty(n.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(t.isAlive){var r=t.storedValue;return r.resolvedValue}}}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=t.storedValue;return r.identifier}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=ir(o)?Ww(o):o,c=new Yx(o,this.targetType),m=ts(this,t,r,a,c);return c.node=m,this.watchTargetNodeForInvalidations(m,s,void 0),m}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){if(!t.isDetaching&&t.type===this){var s=ir(r),c=t.storedValue;if(!s&&c.identifier===r||s&&c.resolvedValue===r)return t.setParent(a,o),t}var m=this.instantiate(a,o,void 0,r);return t.die(),m}}),n}(L4),Xx=function(e){wr(n,e);function n(t,r,a){var o=e.call(this,t,a)||this;return Object.defineProperty(o,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),o}return Object.defineProperty(n.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(t.isAlive){var r=this.options.get(t.storedValue,t.parent?t.parent.storedValue:null);return r}}}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=ir(o)?this.options.set(o,t?t.storedValue:null):o,c=ts(this,t,r,a,s);return this.watchTargetNodeForInvalidations(c,s,this.options),c}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=ir(r)?this.options.set(r,t?t.storedValue:null):r;if(!t.isDetaching&&t.type===this&&t.storedValue===s)return t.setParent(a,o),t;var c=this.instantiate(a,o,void 0,s);return t.die(),c}}),n}(L4);function N4(e,n){var t=n||void 0,r=n?n.onInvalidated:void 0;return t&&(t.get||t.set)?new Xx(e,{get:t.get,set:t.set},r):new Kx(e,r)}function Zx(e){return sn(e)&&(e.flags&Nt.Reference)>0}function Qx(e,n){var t=N4(e,ln(ln({},n),{onInvalidated:function(r){n&&n.onInvalidated&&n.onInvalidated(r),r.removeRef()}}));return n&&n.acceptsUndefined===!1?t:R4(t)}var I4=function(e){wr(n,e);function n(t,r){var a=e.call(this,t)||this;return Object.defineProperty(a,"validType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Identifier}),a}return Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){if(!t||!(t.type instanceof Nd))throw new lt("Identifier types can only be instantiated as direct child of a model type");return ts(this,t,r,a,o)}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){if(t.storedValue!==r)throw new lt("Tried to change identifier from '".concat(t.storedValue,"' to '").concat(r,"'. Changing identifiers is not allowed."));return t.setParent(a,o),t}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return typeof t!==this.validType?vi(r,t,"Value is not a valid ".concat(this.describe(),", expected a ").concat(this.validType)):gi()}}),n}(Zs),Jx=function(e){wr(n,e);function n(){var t=e.call(this,"identifier","string")||this;return Object.defineProperty(t,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Identifier}),t}return Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),n}(I4),eO=function(e){wr(n,e);function n(){return e.call(this,"identifierNumber","number")||this}return Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifierNumber"}}),n}(I4),tO=new Jx,rO=new eO;function nO(e){return sn(e)&&(e.flags&Nt.Identifier)>0}function _c(e){return""+e}function Vv(e){return typeof e=="string"||typeof e=="number"}function iO(e){return new aO(e)}var aO=function(e){wr(n,e);function n(t){var r=e.call(this,t.name)||this;return Object.defineProperty(r,"options",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Custom}),r}return Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(this.options.isTargetType(t))return gi();var a=this.options.getValidationMessage(t);return a?vi(r,t,"Invalid value for type '".concat(this.name,"': ").concat(a)):gi()}}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.options.toSnapshot(t.storedValue)}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=this.options.isTargetType(o)?o:this.options.fromSnapshot(o,t&&t.root.environment);return ts(this,t,r,a,s)}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=!this.options.isTargetType(r);if(!t.isDetaching){var c=t.type===this&&(s?r===t.snapshot:r===t.storedValue);if(c)return t.setParent(a,o),t}var m=s?this.options.fromSnapshot(r,a.root.environment):r,f=this.instantiate(a,o,void 0,m);return t.die(),f}}),n}(Zs),W2={enumeration:Rx,model:wx,compose:_x,custom:iO,reference:N4,safeReference:Qx,union:Gp,optional:zs,literal:A4,maybe:R4,maybeNull:zx,refinement:Ax,string:_4,boolean:E4,number:S4,integer:Sx,float:Ex,finite:xx,Date:C4,map:px,array:vx,frozen:Vx,identifier:tO,identifierNumber:rO,late:Ux,lazy:Hx,undefined:O4,null:x4,snapshotProcessor:dx};const oO=Object.freeze(Object.defineProperty({__proto__:null,addDisposer:dE,addMiddleware:i4,applyAction:e4,applyPatch:dc,applySnapshot:Gw,cast:vE,castFlowReturn:rx,castToReferenceSnapshot:yE,castToSnapshot:mE,clone:uE,createActionTrackingMiddleware:EE,createActionTrackingMiddleware2:OE,decorate:RE,destroy:fE,detach:cE,escapeJsonPath:Vl,flow:m4,getChildType:$S,getEnv:hE,getIdentifier:Ww,getLivelinessChecking:Uw,getMembers:gE,getNodeId:bE,getParent:JS,getParentOfType:tE,getPath:$w,getPathParts:rE,getPropertyMembers:Xw,getRelativePath:sE,getRoot:Vw,getRunningActionContext:zv,getSnapshot:jv,getType:Wd,hasEnv:pE,hasParent:QS,hasParentOfType:eE,isActionContextChildOf:NE,isActionContextThisOrChildOf:IE,isAlive:Dv,isArrayType:mx,isFrozenType:$x,isIdentifierType:nO,isLateType:qx,isLiteralType:Cx,isMapType:gx,isModelType:w4,isOptionalType:jx,isPrimitiveType:k4,isProtected:ZS,isReferenceType:Zx,isRefinementType:Tx,isRoot:nE,isStateTreeNode:ir,isType:sn,isUnionType:T4,isValidReference:lE,joinJsonPath:Sp,onAction:t4,onPatch:Hw,onSnapshot:WS,process:VE,protect:KS,recordActions:AE,recordPatches:YS,resolveIdentifier:aE,resolvePath:iE,setLivelinessChecking:Bw,setLivelynessChecking:GS,splitJsonPath:mc,t:W2,toGenerator:ix,toGeneratorFunction:nx,tryReference:oE,tryResolve:Yw,typecheck:l4,types:W2,unescapeJsonPath:y4,unprotect:XS,walk:Kw},Symbol.toStringTag,{value:"Module"})),Zi=Yl(oO);var l0={},Y2;function j4(){return Y2||(Y2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getLimitedFontSize=function({oldText:n,newText:t,element:r}){if(!(t.length/Math.max(20,n.length)>=4))return r.fontSize;const a=r.width*r.page.computedHeight/t.length,o=1.5*Math.sqrt(a),s=r.fontSize;return Math.min(s,Math.max(5,Math.round(o)))}}(l0)),l0}var K2;function D4(){return K2||(K2=1,function(e){var n=ld&&ld.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=e.getLineHeight=e.useFontLoader=void 0,e.isRTLText=M,e.getDir=T,e.usePrevious=k;const t=n(Or()),r=Ri,a=oo,o=wc,s=Xi,c=n(Mi()),m=qS,f=Gd(),v=Ks(),y=Vd(),E=Jl(),w=Fw(),S=$d(),x=Ys(),_=Xs(),b=es(),g=Zi,h=j4();c.default._fixTextRendering=!0;const d=document.createElement("style");d.type="text/css",document.head.appendChild(d);const P={border:"none",padding:"0px",overflow:"hidden",background:"none",outline:"none",resize:"none",overflowWrap:"break-word",whiteSpace:"pre-wrap",userSelect:"text",wordBreak:"normal"};function M(O){O=O.replace(/\s/g,"");let N=0;for(var A=0;A<O.length;A++)R=O[A],L="֑-߿יִ-﷽ﹰ-ﻼ",new RegExp("^[^"+L+"]*?["+L+"]").test(R)&&(N+=1);var R,L;return N>O.length/2}function T(O){return M(O)?"rtl":"ltr"}const I=(0,r.observer)(({textNodeRef:O,element:N,onBlur:A,selectAll:R,cursorPosition:L})=>{const[V,G]=t.default.useState(P),W=O.current;t.default.useLayoutEffect(()=>{const U={};U.width=W.width()-2*W.padding()+"px",U.height=W.height()-2*W.padding()+W.fontSize()*W.lineHeight()+"px",U.fontSize=W.fontSize()+"px",U.lineHeight=W.lineHeight()+.01,U.fontFamily=W.fontFamily(),U.textAlign=W.align(),U.color=W.fill(),U.fontWeight=N.fontWeight,U.fontStyle=N.fontStyle,U.letterSpacing=N.letterSpacing+"em";const ee=`
|
|
96
96
|
.polotno-input::placeholder {
|
|
97
97
|
color: ${V.color};
|
|
98
98
|
opacity: 0.6;
|
|
@@ -209,7 +209,7 @@ For more info see: https://github.com/konvajs/react-konva/issues/194
|
|
|
209
209
|
}
|
|
210
210
|
${e.resetStyleContent}
|
|
211
211
|
</style>
|
|
212
|
-
`;let f;const v=()=>(f||(f=document.createElement("div"),f.id="polotno-hidden-do-not-touch",f.style.overflow="hidden",f.style.position="relative",document.body.appendChild(f),f.innerHTML=`<style>#polotno-hidden-do-not-touch {${e.resetStyleContent}}</style>`),f),y=new Map,E=navigator.userAgent.includes("Firefox");e.prerenderFont=async _=>{if(y.has(_))return y.get(_);const b=(async()=>{const g=`<div style="font-family: ${_}; font-size: 100px;">${_}<strong>${_}</strong></div>`,h=document.createElement("div");h.innerHTML=g,h.style.visibility="hidden",h.style.position="absolute";const d=v();d.appendChild(h);const P=E?180:50;await new Promise(M=>setTimeout(M,P)),d.removeChild(h)})();return y.set(_,b),b};const w={},S={},x=_=>{if(S[_])return S[_];const b=function(h){const d=[];for(const P of document.styleSheets)try{for(const M of P.cssRules)M instanceof CSSFontFaceRule&&M.style.fontFamily.replace(/['"]/g,"")===h&&d.push(M)}catch(M){console.warn(`Could not access stylesheet: ${P.href}`,M)}return d}(_),g=b.filter(h=>h.style.fontFamily.replace(/['"]/g,"")===_).map(h=>({src:h.style.src,fontStyle:h.style.fontStyle||"normal",fontWeight:h.style.fontWeight||"normal"}));return S[_]=g,g}}(Uo)),Uo}var Ju={},p1={},c3;function Z4(){return c3||(c3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.keyframes=e.glob=e.extractCss=void 0,e.css=v,e.setup=function(_,b,g,h){o.p=b,y=_,E=g,w=h},e.styled=function(_,b){let g=this||{};return function(){let h=arguments;function d(P,M){let T=Object.assign({},P),I=T.className||d.className;g.p=Object.assign({theme:E&&E()},T),g.o=/ *go\d+/.test(I),T.className=v.apply(g,h)+(I?" "+I:""),b&&(T.ref=M);let F=_;return _[0]&&(F=T.as||_,delete T.as),w&&F[0]&&w(T),y(F,T)}return b?b(d):d}};let n={data:""},t=_=>typeof window=="object"?((_?_.querySelector("#_goober"):window._goober)||Object.assign((_||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:_||n,r=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/|\s\s+|\n/g,o=(_,b)=>{let g="",h="",d="";for(let P in _){let M=_[P];P[0]=="@"?P[1]=="i"?g=P+" "+M+";":h+=P[1]=="f"?o(M,P):P+"{"+o(M,P[1]=="k"?"":b)+"}":typeof M=="object"?h+=o(M,b?b.replace(/([^,])+/g,T=>P.replace(/(^:.*)|([^,])+/g,I=>/&/.test(I)?I.replace(/&/g,T):T?T+" "+I:I)):P):M!=null&&(P=P.replace(/[A-Z]/g,"-$&").toLowerCase(),d+=o.p?o.p(P,M):P+":"+M+";")}return g+(b&&d?b+"{"+d+"}":d)+h},s={},c=_=>{if(typeof _=="object"){let b="";for(let g in _)b+=g+c(_[g]);return b}return _},m=(_,b,g,h,d)=>{let P=c(_),M=s[P]||(s[P]=(T=>{let I=0,F=11;for(;I<T.length;)F=101*F+T.charCodeAt(I++)>>>0;return"go"+F})(P));if(!s[M]){let T=P!==_?_:(I=>{let F,k=[{}];for(;F=r.exec(I.replace(a,""));)F[4]?k.shift():F[3]?k.unshift(k[0][F[3]]=k[0][F[3]]||{}):k[0][F[1]]=F[2];return k[0]})(_);s[M]=o(d?{["@keyframes "+M]:T}:T,g?"":"."+M)}return((T,I,F)=>{I.data.indexOf(T)==-1&&(I.data=F?T+I.data:I.data+T)})(s[M],b,h),M},f=(_,b,g)=>_.reduce((h,d,P)=>{let M=b[P];if(M&&M.call){let T=M(g),I=T&&T.props&&T.props.className||/^go/.test(T)&&T;M=I?"."+I:T&&typeof T=="object"?T.props?"":o(T,""):T===!1?"":T}return h+d+(M??"")},"");function v(_){let b=this||{},g=_.call?_(b.p):_;return m(g.unshift?g.raw?f(g,[].slice.call(arguments,1),b.p):g.reduce((h,d)=>Object.assign(h,d&&d.call?d(b.p):d),{}):g,t(b.target),b.g,b.o,b.k)}e.extractCss=_=>{let b=t(_),g=b.data;return b.data="",g};let y,E,w,S=v.bind({g:1}),x=v.bind({k:1});e.glob=S,e.keyframes=x}(p1)),p1}var f3;function iP(){if(f3)return Ju;f3=1;var e=Ju&&Ju.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ju,"__esModule",{value:!0});const n=e(Or()),t=Z4();return(0,t.setup)(n.default.createElement),Ju.default=t.styled,Ju}var d3;function aP(){return d3||(d3=1,function(e){var n,t=va&&va.__createBinding||(Object.create?function(L,V,G,W){W===void 0&&(W=G);var X=Object.getOwnPropertyDescriptor(V,G);X&&!("get"in X?!V.__esModule:X.writable||X.configurable)||(X={enumerable:!0,get:function(){return V[G]}}),Object.defineProperty(L,W,X)}:function(L,V,G,W){W===void 0&&(W=G),L[W]=V[G]}),r=va&&va.__setModuleDefault||(Object.create?function(L,V){Object.defineProperty(L,"default",{enumerable:!0,value:V})}:function(L,V){L.default=V}),a=va&&va.__importStar||(n=function(L){return n=Object.getOwnPropertyNames||function(V){var G=[];for(var W in V)Object.prototype.hasOwnProperty.call(V,W)&&(G[G.length]=W);return G},n(L)},function(L){if(L&&L.__esModule)return L;var V={};if(L!=null)for(var G=n(L),W=0;W<G.length;W++)G[W]!=="default"&&t(V,L,G[W]);return r(V,L),V}),o=va&&va.__importDefault||function(L){return L&&L.__esModule?L:{default:L}};Object.defineProperty(e,"__esModule",{value:!0}),e.HTMLElement=e.setQuillContent=e.createQuill=e.setQuillFormats=e.quillRef=void 0;const s=o(Or()),c=Ri,m=oo,f=o(fO()),v=o(Mi()),y=a(Xi),E=Jl(),w=$d(),S=D4(),x=Gd(),_=X4(),b=Ys(),g=Xs(),h=wc,d=o(iP()),P=Ks(),M=
|
|
212
|
+
`;let f;const v=()=>(f||(f=document.createElement("div"),f.id="polotno-hidden-do-not-touch",f.style.overflow="hidden",f.style.position="relative",document.body.appendChild(f),f.innerHTML=`<style>#polotno-hidden-do-not-touch {${e.resetStyleContent}}</style>`),f),y=new Map,E=navigator.userAgent.includes("Firefox");e.prerenderFont=async _=>{if(y.has(_))return y.get(_);const b=(async()=>{const g=`<div style="font-family: ${_}; font-size: 100px;">${_}<strong>${_}</strong></div>`,h=document.createElement("div");h.innerHTML=g,h.style.visibility="hidden",h.style.position="absolute";const d=v();d.appendChild(h);const P=E?180:50;await new Promise(M=>setTimeout(M,P)),d.removeChild(h)})();return y.set(_,b),b};const w={},S={},x=_=>{if(S[_])return S[_];const b=function(h){const d=[];for(const P of document.styleSheets)try{for(const M of P.cssRules)M instanceof CSSFontFaceRule&&M.style.fontFamily.replace(/['"]/g,"")===h&&d.push(M)}catch(M){console.warn(`Could not access stylesheet: ${P.href}`,M)}return d}(_),g=b.filter(h=>h.style.fontFamily.replace(/['"]/g,"")===_).map(h=>({src:h.style.src,fontStyle:h.style.fontStyle||"normal",fontWeight:h.style.fontWeight||"normal"}));return S[_]=g,g}}(Uo)),Uo}var Ju={},p1={},c3;function Z4(){return c3||(c3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.keyframes=e.glob=e.extractCss=void 0,e.css=v,e.setup=function(_,b,g,h){o.p=b,y=_,E=g,w=h},e.styled=function(_,b){let g=this||{};return function(){let h=arguments;function d(P,M){let T=Object.assign({},P),I=T.className||d.className;g.p=Object.assign({theme:E&&E()},T),g.o=/ *go\d+/.test(I),T.className=v.apply(g,h)+(I?" "+I:""),b&&(T.ref=M);let F=_;return _[0]&&(F=T.as||_,delete T.as),w&&F[0]&&w(T),y(F,T)}return b?b(d):d}};let n={data:""},t=_=>typeof window=="object"?((_?_.querySelector("#_goober"):window._goober)||Object.assign((_||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:_||n,r=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/|\s\s+|\n/g,o=(_,b)=>{let g="",h="",d="";for(let P in _){let M=_[P];P[0]=="@"?P[1]=="i"?g=P+" "+M+";":h+=P[1]=="f"?o(M,P):P+"{"+o(M,P[1]=="k"?"":b)+"}":typeof M=="object"?h+=o(M,b?b.replace(/([^,])+/g,T=>P.replace(/(^:.*)|([^,])+/g,I=>/&/.test(I)?I.replace(/&/g,T):T?T+" "+I:I)):P):M!=null&&(P=P.replace(/[A-Z]/g,"-$&").toLowerCase(),d+=o.p?o.p(P,M):P+":"+M+";")}return g+(b&&d?b+"{"+d+"}":d)+h},s={},c=_=>{if(typeof _=="object"){let b="";for(let g in _)b+=g+c(_[g]);return b}return _},m=(_,b,g,h,d)=>{let P=c(_),M=s[P]||(s[P]=(T=>{let I=0,F=11;for(;I<T.length;)F=101*F+T.charCodeAt(I++)>>>0;return"go"+F})(P));if(!s[M]){let T=P!==_?_:(I=>{let F,k=[{}];for(;F=r.exec(I.replace(a,""));)F[4]?k.shift():F[3]?k.unshift(k[0][F[3]]=k[0][F[3]]||{}):k[0][F[1]]=F[2];return k[0]})(_);s[M]=o(d?{["@keyframes "+M]:T}:T,g?"":"."+M)}return((T,I,F)=>{I.data.indexOf(T)==-1&&(I.data=F?T+I.data:I.data+T)})(s[M],b,h),M},f=(_,b,g)=>_.reduce((h,d,P)=>{let M=b[P];if(M&&M.call){let T=M(g),I=T&&T.props&&T.props.className||/^go/.test(T)&&T;M=I?"."+I:T&&typeof T=="object"?T.props?"":o(T,""):T===!1?"":T}return h+d+(M??"")},"");function v(_){let b=this||{},g=_.call?_(b.p):_;return m(g.unshift?g.raw?f(g,[].slice.call(arguments,1),b.p):g.reduce((h,d)=>Object.assign(h,d&&d.call?d(b.p):d),{}):g,t(b.target),b.g,b.o,b.k)}e.extractCss=_=>{let b=t(_),g=b.data;return b.data="",g};let y,E,w,S=v.bind({g:1}),x=v.bind({k:1});e.glob=S,e.keyframes=x}(p1)),p1}var f3;function iP(){if(f3)return Ju;f3=1;var e=Ju&&Ju.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ju,"__esModule",{value:!0});const n=e(Or()),t=Z4();return(0,t.setup)(n.default.createElement),Ju.default=t.styled,Ju}var d3;function aP(){return d3||(d3=1,function(e){var n,t=va&&va.__createBinding||(Object.create?function(L,V,G,W){W===void 0&&(W=G);var X=Object.getOwnPropertyDescriptor(V,G);X&&!("get"in X?!V.__esModule:X.writable||X.configurable)||(X={enumerable:!0,get:function(){return V[G]}}),Object.defineProperty(L,W,X)}:function(L,V,G,W){W===void 0&&(W=G),L[W]=V[G]}),r=va&&va.__setModuleDefault||(Object.create?function(L,V){Object.defineProperty(L,"default",{enumerable:!0,value:V})}:function(L,V){L.default=V}),a=va&&va.__importStar||(n=function(L){return n=Object.getOwnPropertyNames||function(V){var G=[];for(var W in V)Object.prototype.hasOwnProperty.call(V,W)&&(G[G.length]=W);return G},n(L)},function(L){if(L&&L.__esModule)return L;var V={};if(L!=null)for(var G=n(L),W=0;W<G.length;W++)G[W]!=="default"&&t(V,L,G[W]);return r(V,L),V}),o=va&&va.__importDefault||function(L){return L&&L.__esModule?L:{default:L}};Object.defineProperty(e,"__esModule",{value:!0}),e.HTMLElement=e.setQuillContent=e.createQuill=e.setQuillFormats=e.quillRef=void 0;const s=o(Or()),c=Ri,m=oo,f=o(fO()),v=o(Mi()),y=a(Xi),E=Jl(),w=$d(),S=D4(),x=Gd(),_=X4(),b=Ys(),g=Xs(),h=wc,d=o(iP()),P=Ks(),M=Fw(),T=a(Vd()),I=es(),F=j4();e.quillRef=y.observable({enabled:!1,currentFormat:{},editor:y.observable.object({instance:null},{},{deep:!1})});const k=(0,d.default)("div",s.default.forwardRef)`
|
|
213
213
|
.ql-editor {
|
|
214
214
|
outline: none;
|
|
215
215
|
}
|
|
@@ -261,7 +261,7 @@ For more info see: https://github.com/konvajs/react-konva/issues/194
|
|
|
261
261
|
`}(f,y):(console.error(`Polotno error: Can not convert ${f.subType} figure to svg.`),(0,e.rectData)(f))},e.rectData=({width:f,height:v,cornerRadius:y})=>{if(y>0){const E=Math.min(y,f/2,v/2);return`M 0 ${E} A ${E} ${E} 0 0 1 ${E} 0 L ${f-E} 0 A ${E} ${E} 0 0 1 ${f} ${E} L ${f} ${v-E} A ${E} ${E} 0 0 1 ${f-E} ${v} L ${E} ${v} A ${E} ${E} 0 0 1 0 ${v-E} Z`}return`M 0 0 L ${f} 0 L ${f} ${v} L 0 ${v} Z`},e.triangleData=({width:f,height:v})=>`M ${f/2} 0 L ${f} ${v} L 0 ${v} Z`,e.rightTriangleData=({width:f,height:v})=>`M 0 0 L ${f} 0 L 0 ${v} Z`,e.circleData=({width:f,height:v})=>`M ${f/2} ${v/2} m -${f/2}, 0 a ${f/2},${v/2} 0 1,0 ${f},0 a ${f/2},${v/2} 0 1,0 -${f},0`,e.TYPES={rect:e.rectData,circle:e.circleData,star:n,triangle:e.triangleData,rightTriangle:e.rightTriangleData,diamond:t,pentagon:r,hexagon:a,speechBubble:s,cross:c,arc:({width:f,height:v})=>o({path:"M234 117C234 85.97 221.673 56.21 199.731 34.269C177.79 12.327 148.03 0 117 0C85.97 0 56.2103 12.327 34.2685 34.268C12.3268 56.21 0 85.97 0 117H117H234Z",aspectRatio:{width:234,height:117},width:f,height:v}),cloud:({width:f,height:v})=>o({path:"M216.41 57.006C216.961 54.084 217.249 51.069 217.249 47.986C217.249 21.4841 195.972 0 169.725 0C153.666 0 139.467 8.043 130.865 20.3575C122.606 13.3566 111.954 9.1402 100.327 9.1402C74.3322 9.1402 53.2123 30.2136 52.8094 56.364H52.8035C23.6407 56.364 0 80.235 0 109.682C0 139.129 23.6407 163 52.8035 163H208.197C237.359 163 261 139.129 261 109.682C261 83.056 241.672 60.99 216.41 57.006Z",aspectRatio:{width:261,height:163},width:f,height:v}),rightArrow:({width:f,height:v})=>{const y=.6*f;return`M 0 ${v/4} L ${y} ${v/4} L ${y} 0 L ${f} ${v/2} L ${y} ${v} L ${y} ${.75*v} L 0 ${.75*v} Z`},leftArrow:({width:f,height:v})=>{const y=.4*f;return`M ${f} ${v/4} L ${y} ${v/4} L ${y} 0 L 0 ${v/2} L ${y} ${v} L ${y} ${.75*v} L ${f} ${.75*v} Z`},downArrow:({width:f,height:v})=>{const y=.6*v;return`M ${f/4} 0 L ${f/4} ${y} L 0 ${y} L ${f/2} ${v} L ${f} ${y} L ${.75*f} ${y} L ${.75*f} 0 Z`},upArrow:({width:f,height:v})=>{const y=.4*v;return`M ${f/4} ${v} L ${f/4} ${y} L 0 ${y} L ${f/2} 0 L ${f} ${y} L ${.75*f} ${y} L ${.75*f} ${v} Z`},asterisk1:({width:f,height:v})=>o({path:"M45.5265 218.498C51.5466 222.87 58.5359 224.98 65.4742 224.98C75.916 224.98 86.221 220.2 92.853 211.217C92.872 211.198 92.89 211.178 92.907 211.157C92.923 211.136 92.939 211.115 92.954 211.094L92.977 211.061C92.993 211.039 93.008 211.017 93.023 210.996L116.491 178.725L139.959 210.996C139.982 211.031 140.006 211.058 140.029 211.088C140.04 211.102 140.05 211.116 140.061 211.132C151.115 226.188 172.355 229.505 187.473 218.515C202.608 207.526 205.992 186.278 195.074 171.104L195.05 171.066C195.03 171.034 195.014 171.01 194.989 170.985L171.572 138.696L209.512 126.346C227.334 120.545 237.129 101.305 231.33 83.476C225.532 65.648 206.315 55.8493 188.476 61.6334L150.537 73.933L150.52 34.0064C150.502 15.2594 135.248 0 116.508 0C97.768 0 82.514 15.2594 82.497 34.0234L82.463 73.916L44.5233 61.6163C44.5083 61.6163 44.49 61.613 44.4716 61.6078C44.4477 61.6014 44.4232 61.5918 44.4041 61.5823C26.5992 55.8664 7.45076 65.665 1.66886 83.46C-4.11314 101.254 5.61427 120.426 23.3511 126.278C23.3675 126.283 23.3822 126.289 23.3963 126.295L23.4588 126.319L23.4873 126.329L61.4098 138.679L37.9929 170.968C37.9844 170.985 37.9718 171.002 37.9591 171.019C37.9462 171.036 37.9336 171.053 37.9251 171.07C26.9903 186.244 30.3915 207.509 45.5265 218.498Z",aspectRatio:{width:233,height:225},width:f,height:v}),asterisk2:({width:f,height:v})=>o({path:"M46.0556 112L0 85.388L33.9456 26.6121L80.028 53.1781L80.054 0H147.946L147.972 53.1781L194.054 26.6121L228 85.388L181.944 112L228 138.612L194.054 197.388L147.972 170.822L147.946 224H80.054L80.028 170.822L33.9456 197.388L0 138.612L46.0556 112Z",aspectRatio:{width:228,height:224},width:f,height:v}),bookmark:({width:f,height:v})=>o({path:"M0 0H199V238L99.5 142.8L0 238V0Z",aspectRatio:{width:199,height:238},width:f,height:v}),butterfly:({width:f,height:v})=>o({path:"M94.5 100.713C91.935 150.916 50.703 190.909 0 191.493V0C50.703 0.5845 91.935 40.5767 94.5 90.78C97.031 41.2385 137.217 1.6407 187 0.0438004V191.45C137.217 189.853 97.031 150.255 94.5 100.713Z",aspectRatio:{width:187,height:192},width:f,height:v}),cylinder:({width:f,height:v})=>o({path:"M169 36.8497V218.15C169 238.502 131.168 255 84.5 255C37.832 255 0 238.502 0 218.15V36.8497C0 16.4982 37.832 0 84.5 0C131.168 0 169 16.4982 169 36.8497Z",aspectRatio:{width:169,height:255},width:f,height:v}),diamond2:({width:f,height:v})=>o({path:"M0 55.5L124 185L248 55.5L189.307 0H58.6933L0 55.5Z",aspectRatio:{width:248,height:185},width:f,height:v}),door:({width:f,height:v})=>o({path:"M140 69.697C140 31.2044 108.66 0 70 0C31.34 0 0 31.2044 0 69.697V207H140V69.697Z",aspectRatio:{width:140,height:207},width:f,height:v}),drop1:({width:f,height:v})=>o({path:"M167 150.687C167 196.328 129.407 234 83.139 234C37.593 234 0 196.328 0 150.687C0 100.7 51.329 36.9474 83.139 0C114.948 39.1207 167 98.526 167 150.687Z",aspectRatio:{width:167,height:234},width:f,height:v}),drop2:({width:f,height:v})=>o({path:"M73 239C53.64 239 35.071 231.315 21.3812 217.634C7.691 203.954 0 185.4 0 166.054C0 136.091 13.8696 113.633 30.768 86.27C43.912 64.9877 58.888 40.7377 70.597 7.6816C71.281 5.7496 72.989 0 72.989 0C72.989 0 72.993 0.0124998 73 0.0363998C73.007 0.0124998 73.011 0 73.011 0C73.011 0 74.719 5.7496 75.403 7.6816C87.112 40.7377 102.088 64.9877 115.232 86.27C132.13 113.633 146 136.091 146 166.054C146 185.4 138.309 203.954 124.619 217.634C111.025 231.218 92.225 239 73 239Z",aspectRatio:{width:146,height:239},width:f,height:v}),explosion:({width:f,height:v})=>o({path:"M165.802 184.465L118.997 260L125.343 182.079L34.9058 219.45L99.164 159.817L0 163.792L78.538 134.373L0 74.7401L86.471 89.052V0L118.997 89.052L165.802 10.3364L149.143 97.798L217.368 29.419L165.802 112.905L245.927 81.101L165.802 143.914H261L165.802 184.465Z",aspectRatio:{width:261,height:260},width:f,height:v}),flag:({width:f,height:v})=>o({path:"M0 142.161C0 142.161 51.9956 118.626 103 137.469C159.992 158.525 206 141.31 206 141.31V11.1373C206 11.1373 160 28.3218 103.016 7.28273C52 -11.553 0 12.0974 0 12.0974V142.161Z",aspectRatio:{width:206,height:148},width:f,height:v}),flower:({width:f,height:v})=>o({path:"M135.351 66.1893C196.683 -5.00591 256.536 100.304 164.908 117.361C256.536 135.16 195.944 239.728 135.351 168.532C166.386 257.526 45.9394 256.785 76.975 168.532C15.643 239.728 -44.2109 135.16 47.4173 117.361C-44.9498 100.304 15.643 -4.26431 76.975 66.1893C45.2005 -22.0631 166.386 -22.0631 135.351 66.1893ZM105.793 104.012C113.183 104.012 119.833 109.945 119.833 117.361C119.833 124.777 113.183 131.452 105.793 131.452C98.404 131.452 92.492 124.777 92.492 117.361C92.492 109.945 98.404 104.012 105.793 104.012Z",aspectRatio:{width:212,height:235},width:f,height:v}),frame:({width:f,height:v})=>o({path:"M0 0H240L200 88L240 176H0L40 88L0 0Z",aspectRatio:{width:240,height:176},width:f,height:v}),heart1:({width:f,height:v})=>o({path:"M215.886 56.157C215.886 24.729 191.112 0 160.584 0C135.933 0 115.08 16.983 107.937 39.93C100.788 16.986 79.935 0.591 55.284 0.591C24.75 0.591 0 24.615 0 56.055C0 71.919 6.321 83.127 16.494 95.121L107.988 189.447L199.377 95.121C209.559 83.127 215.886 72.009 215.886 56.157Z",aspectRatio:{width:216,height:190},width:f,height:v}),home:({width:f,height:v})=>o({path:"M0 62.143L95.5 0L191 62.143V195H0V62.143Z",aspectRatio:{width:191,height:195},width:f,height:v}),home2:({width:f,height:v})=>o({path:"M206 94.076L103 0L0 94.076H31.2377V189H175.607V94.076H206Z",aspectRatio:{width:206,height:189},width:f,height:v}),hourglass:({width:f,height:v})=>o({path:"M0.392782 0H187.607C193.014 43.3688 140.804 53.797 140.804 97.5C140.804 141.203 193.014 151.631 187.607 195H0.392782C-5.01452 151.631 47.196 141.203 47.196 97.5C47.196 53.797 -5.01452 43.3688 0.392782 0Z",aspectRatio:{width:188,height:195},width:f,height:v}),house:({width:f,height:v})=>o({path:"M0 92.367L95 0L190 92.367V223H0V92.367Z",aspectRatio:{width:190,height:223},width:f,height:v}),keyhole:({width:f,height:v})=>o({path:"M115 57.0494C115 25.5387 89.416 0 57.863 0C26.311 0 0.726898 25.5414 0.726898 57.0494C0.726898 78.652 12.759 97.451 30.505 107.136L0 219H114.845L84.448 107.524C102.608 97.962 115 78.959 115 57.0494Z",aspectRatio:{width:115,height:219},width:f,height:v}),kiss:({width:f,height:v})=>o({path:"M124.5 17.1468C80.036 -36.5162 0 52.9218 0 52.9218C0 52.9218 44.4643 120 124.5 120C204.536 120 249 52.9218 249 52.9218C249 52.9218 168.964 -36.5162 124.5 17.1468Z",aspectRatio:{width:249,height:120},width:f,height:v}),leaf:({width:f,height:v})=>o({path:"M204.414 0.0151567C204.414 0.0151567 206.837 93.9509 150.394 150.394C93.9507 206.837 0.0151569 204.413 0.0151569 204.413C0.0151569 204.413 -2.40835 110.478 54.0347 54.0349C110.478 -2.40834 204.414 0.0151567 204.414 0.0151567Z",aspectRatio:{width:205,height:205},width:f,height:v}),lightning1:({width:f,height:v})=>o({path:"M111.5 0L0 142H51.433L31.5 253L143 111H91.567L111.5 0Z",aspectRatio:{width:143,height:253},width:f,height:v}),lightning2:({width:f,height:v})=>o({path:"M126 0H43L0 120.531H36L6 227L110 80.354H73L126 0Z",aspectRatio:{width:126,height:227},width:f,height:v}),magnet:({width:f,height:v})=>o({path:"M88.402 0H0V67.669H88.402C105.271 67.669 118.957 81.308 118.957 98C118.957 114.689 105.271 128.331 88.402 128.331H0V196H88.402C142.747 196 187 152.072 187 98C187 43.9279 142.747 0 88.402 0Z",aspectRatio:{width:187,height:196},width:f,height:v}),mithosis:({width:f,height:v})=>o({path:"M150.996 136.45C137.141 128.926 117.559 128.7 103.532 135.896C93.843 140.867 82.875 143.67 71.2577 143.67C31.9033 143.67 0 111.508 0 71.835C0 32.161 31.9033 0 71.2577 0C83.467 0 94.959 3.0955 105.004 8.5504C118.859 16.0745 138.441 16.3 152.467 9.1038C162.157 4.1328 173.125 1.3303 184.742 1.3303C224.097 1.3303 256 33.492 256 73.165C256 112.839 224.097 145 184.742 145C172.533 145 161.041 141.905 150.996 136.45Z",aspectRatio:{width:256,height:145},width:f,height:v}),orangeRicky:({width:f,height:v})=>o({path:"M69 0H0V69V138V207H69H138V138H69V69V0Z",aspectRatio:{width:138,height:207},width:f,height:v}),party:({width:f,height:v})=>o({path:"M134.622 0L144.682 68.2539L174.415 5.9977L163.91 74.1846L210.671 23.4578L180.535 85.519L240.169 50.8289L193.079 101.25L260.29 85.679L200.43 119.98L269.245 124.911L201.934 140.044L266.237 165.04L197.456 159.661L251.535 202.5L187.396 177.086L226.445 233.962L172.646 190.771L193.197 256.631L154.518 199.501L154.743 268.492L134.622 202.5L114.501 268.492L114.727 199.501L76.0482 256.631L96.5985 190.771L42.7992 233.962L81.8489 177.086L17.7091 202.5L71.7885 159.661L3.0072 165.04L67.3112 140.044L0 124.911L68.8149 119.98L8.9545 85.679L76.1658 101.25L29.0753 50.8289L88.7105 85.519L58.5743 23.4578L105.335 74.1846L94.8305 5.9977L124.562 68.2539L134.622 0Z",aspectRatio:{width:270,height:269},width:f,height:v}),pillow:({width:f,height:v})=>o({path:"M176 0.00169945C157.812 16.9062 125.203 28.174 88.001 28.174C50.798 28.174 18.1881 16.9054 0 0V258.421C18.1882 241.516 50.798 230.248 88 230.248C125.202 230.248 157.812 241.516 176 258.421V0.00169945Z",aspectRatio:{width:176,height:259},width:f,height:v}),polygon:({width:f,height:v})=>o({path:"M110 0L219.119 63V189L110 252L0.880798 189V63L110 0Z",aspectRatio:{width:220,height:252},width:f,height:v}),rainbow:({width:f,height:v})=>o({path:"M186.907 141H282C282 63.128 218.872 0 141 0C63.1278 0 0 63.128 0 141H95.093C95.093 115.646 115.646 95.093 141 95.093C166.354 95.093 186.907 115.646 186.907 141Z",aspectRatio:{width:282,height:141},width:f,height:v}),rhodeIsland:({width:f,height:v})=>o({path:"M69 0H0V69V138H69V207H138V138V69H69V0Z",aspectRatio:{width:138,height:207},width:f,height:v}),shell:({width:f,height:v})=>o({path:"M109 0C169.199 0 218 48.743 218 108.87C185.392 108.87 158.958 135.273 158.958 167.842C158.958 179.736 158.958 191 158.958 191H59.042C59.042 191 59.042 179.736 59.042 167.842C59.042 135.273 32.6077 108.87 0 108.87C0 48.743 48.8007 0 109 0Z",aspectRatio:{width:218,height:191},width:f,height:v}),shield1:({width:f,height:v})=>o({path:"M203.184 30.7277C142.457 30.7277 102.853 0 102.853 0C102.853 0 63.249 30.7277 3.05098 30.7277C3.05098 30.7277 -3.81372 128.209 3.05098 162.115C9.38758 193.902 102.853 249 102.853 249C102.853 249 196.319 193.902 203.184 162.115C209.52 128.738 203.184 30.7277 203.184 30.7277Z",aspectRatio:{width:206,height:249},width:f,height:v}),shield2:({width:f,height:v})=>o({path:"M0 12.9585C64.624 -4.3195 136.376 -4.3195 201 12.9585C201 51.0564 201 89.154 201 127.252C201 184.396 100.498 240 100.498 240C100.498 240 0 184.406 0 127.252C0 89.154 0 51.0564 0 12.9585Z",aspectRatio:{width:201,height:240},width:f,height:v}),skewedRectangle:({width:f,height:v})=>o({path:"M85.9799 0H290L204.02 141H0L85.9799 0Z",aspectRatio:{width:290,height:141},width:f,height:v}),softFlower:({width:f,height:v})=>o({path:"M109 0C80.073 0 56.6234 23.4498 56.6234 52.3766C56.6234 54.722 54.722 56.6234 52.3766 56.6234C23.4498 56.6234 0 80.073 0 109C0 137.927 23.4498 161.377 52.3766 161.377C54.722 161.377 56.6234 163.278 56.6234 165.623C56.6234 194.55 80.073 218 109 218C137.927 218 161.377 194.55 161.377 165.623C161.377 163.278 163.278 161.377 165.623 161.377C194.55 161.377 218 137.927 218 109C218 80.073 194.55 56.6234 165.623 56.6234C163.278 56.6234 161.377 54.722 161.377 52.3766C161.377 23.4498 137.927 0 109 0Z",aspectRatio:{width:218,height:218},width:f,height:v}),softStar:({width:f,height:v})=>o({path:"M130.424 3.17662C130.927 -1.05888 137.073 -1.05888 137.576 3.17662L141.792 38.7086C147.236 84.59 183.41 120.764 229.291 126.208L264.823 130.424C269.059 130.927 269.059 137.073 264.823 137.576L229.291 141.792C183.41 147.236 147.236 183.41 141.792 229.291L137.576 264.823C137.073 269.059 130.927 269.059 130.424 264.823L126.208 229.291C120.764 183.41 84.59 147.236 38.7086 141.792L3.17662 137.576C-1.05888 137.073 -1.05888 130.927 3.17662 130.424L38.7086 126.208C84.59 120.764 120.764 84.59 126.208 38.7086L130.424 3.17662Z",aspectRatio:{width:268,height:268},width:f,height:v}),stairs1:({width:f,height:v})=>o({path:"M0 0H67.667V67.667H135.333V135.333H203V203H0V0Z",aspectRatio:{width:203,height:203},width:f,height:v}),stairs2:({width:f,height:v})=>o({path:"M50 0H0V200H200V150H150V100H100V50H50V0Z",aspectRatio:{width:200,height:200},width:f,height:v}),teewee:({width:f,height:v})=>o({path:"M69 0H138V69H207V138H138H69H0V69H69V0Z",aspectRatio:{width:207,height:138},width:f,height:v}),blob1:({width:f,height:v})=>o({path:"M172.979 19.611C191.285 33.0858 204.505 54.442 210.861 78.5949C217.471 103.002 217.471 130.46 205.776 151.816C194.335 173.427 171.454 189.444 147.047 196.054C122.639 202.919 96.7069 200.631 75.3506 190.715C54.2486 180.546 37.7229 163.003 23.4855 142.155C9.5022 121.307 -2.19289 97.4087 0.349524 74.7813C3.14617 52.1538 19.9261 30.7976 40.2654 17.8313C60.6046 4.61077 84.5033 -0.474048 108.148 0.0344341C131.538 0.542916 154.928 6.13621 172.979 19.611Z",aspectRatio:{width:216,height:200},width:f,height:v}),blob10:({width:f,height:v})=>o({path:"M188.684 8.95173C205.601 24.3309 200.988 63.0866 191.453 99.3816C182.225 135.677 168.076 169.511 146.238 175.355C124.399 181.507 94.871 159.668 66.5733 143.059C37.9679 126.449 10.5929 115.068 2.59569 95.0754C-5.4015 75.0824 5.97912 46.1694 24.4342 30.4826C42.8893 14.7958 68.4188 12.0276 100.715 6.79864C132.704 1.5697 171.767 -6.42749 188.684 8.95173Z",aspectRatio:{width:200,height:177},width:f,height:v}),blob11:({width:f,height:v})=>o({path:"M137.368 29.4923C148.97 46.7605 146.542 72.1231 148.161 99.1046C149.779 126.086 155.715 154.956 144.113 174.383C132.781 193.81 103.911 203.793 80.4369 198.666C56.963 193.27 38.6156 173.034 28.3626 153.607C17.8398 134.181 15.4115 115.833 9.47555 91.5498C3.53961 67.2664 -5.63411 37.3169 4.61887 20.0488C15.1417 2.51078 45.0911 -1.80626 72.8821 0.622074C100.673 2.78059 126.036 12.2241 137.368 29.4923Z",aspectRatio:{width:152,height:200},width:f,height:v}),blob12:({width:f,height:v})=>o({path:"M158.391 17.923C172.491 28.5703 180.261 48.1384 187.743 70.5842C194.937 93.3177 202.419 118.641 194.649 138.785C187.167 158.928 164.146 173.317 138.535 184.54C112.923 196.05 84.4347 204.108 58.8235 197.777C33.2123 191.446 10.191 170.439 2.99688 146.267C-4.48504 121.807 3.57241 94.181 10.4788 68.282C17.0974 42.0953 22.565 17.6352 37.8166 7.27563C53.0682 -3.37171 78.1038 0.081487 100.837 2.67138C123.859 5.26127 144.29 7.27563 158.391 17.923Z",aspectRatio:{width:198,height:200},width:f,height:v}),blob13:({width:f,height:v})=>o({path:"M149.668 1.37595C170.663 5.22017 193.728 17.3442 198.755 34.7911C204.078 52.2379 191.363 75.3032 178.943 93.9329C166.819 112.563 154.99 126.757 140.501 145.386C126.011 164.312 108.86 187.673 92.5957 186.194C76.3317 185.011 60.9549 159.285 45.8737 140.655C30.4968 122.321 15.7114 110.788 7.43151 95.1157C-0.848339 79.4432 -2.32688 59.0392 3.5873 41.5924C9.50148 23.8498 23.1041 8.76868 38.7767 3.44592C54.745 -1.87685 73.3746 2.55879 91.7086 2.26308C110.338 2.26308 128.968 -2.17256 149.668 1.37595Z",aspectRatio:{width:200,height:187},width:f,height:v}),blob14:({width:f,height:v})=>o({path:"M137.838 28.6426C150.711 40.5617 165.014 46.5213 178.363 58.2021C191.474 69.8828 203.87 87.0464 198.864 99.6807C193.858 112.315 171.689 120.42 157.862 135.676C144.275 151.171 139.269 173.579 126.873 182.161C114.477 190.505 94.9294 185.022 76.8123 178.109C58.4568 171.196 41.5316 163.091 28.1822 150.456C14.5943 137.822 4.58225 120.42 1.24488 101.826C-2.09248 83.2322 1.00651 62.9697 13.8792 52.4809C26.7519 41.992 49.1598 41.0385 65.6083 30.788C82.0567 20.5376 92.0688 0.990158 103.034 0.0366268C113.762 -0.916905 125.204 16.9618 137.838 28.6426Z",aspectRatio:{width:200,height:187},width:f,height:v}),blob15:({width:f,height:v})=>o({path:"M185.203 1.52939C197.679 7.62217 200 32.2835 200 51.7223C200 71.1612 197.389 85.3777 197.679 100.175C198.259 114.681 201.741 129.768 198.259 143.114C194.778 156.46 184.623 168.356 171.567 173.868C158.801 179.671 143.134 179.091 130.368 174.739C117.312 170.387 106.867 162.263 86.8482 160.812C66.539 159.362 36.9454 164.294 18.9572 155.3C0.968966 146.306 -5.41395 123.095 5.03083 105.977C15.4756 88.5692 42.4579 77.5442 55.5139 59.5559C68.2798 41.8578 67.1192 17.4867 76.9837 9.6531C86.5581 2.10965 107.158 11.3939 128.627 9.6531C150.097 8.20244 172.728 -4.27327 185.203 1.52939Z",aspectRatio:{width:200,height:179},width:f,height:v}),blob16:({width:f,height:v})=>o({path:"M158.441 55.3221C167.253 80.2399 160.264 105.462 147.501 134.938C134.738 164.717 116.81 199.055 97.0576 199.967C77.3057 201.182 55.7305 168.668 34.4592 133.722C13.1879 99.0802 -7.77953 62.3112 2.85612 36.4818C13.4918 10.6523 56.0344 -3.93369 90.0685 0.928322C123.799 6.09421 149.324 30.7081 158.441 55.3221Z",aspectRatio:{width:163,height:200},width:f,height:v}),blob17:({width:f,height:v})=>o({path:"M168.917 36.7587C178.871 53.2457 175.138 76.5764 172.961 106.129C170.472 135.37 169.85 170.832 150.563 187.63C131.276 204.739 93.3252 203.495 65.0173 187.63C36.7095 172.077 18.0449 142.213 7.77943 107.373C-2.79714 72.2213 -4.35252 32.7147 14.312 14.0502C32.9765 -4.3033 72.1721 -1.50361 103.591 4.7179C135.32 10.6283 158.962 20.2717 168.917 36.7587Z",aspectRatio:{width:176,height:200},width:f,height:v}),blob18:({width:f,height:v})=>o({path:"M178.188 21.1464C193.012 36.3069 196.381 62.9219 198.739 88.1893C200.76 113.12 201.771 136.366 190.316 149.168C178.862 162.307 155.279 164.665 135.065 167.697C115.188 170.73 99.0168 174.098 72.4018 177.131C46.1237 180.163 9.40176 182.521 1.65309 168.371C-6.09559 154.221 15.4659 123.564 23.5515 92.9059C31.6371 62.2481 26.2467 31.2534 38.3751 15.4192C50.1665 -0.0781831 79.8136 -1.08888 107.776 0.595609C136.076 1.9432 163.028 5.64909 178.188 21.1464Z",aspectRatio:{width:200,height:180},width:f,height:v}),blob19:({width:f,height:v})=>o({path:"M148.621 13.3857C171.945 24.3818 194.937 41.3756 192.938 60.702C190.605 80.3615 163.282 101.687 149.953 123.346C136.958 145.005 137.958 166.664 128.295 174.661C118.631 182.325 98.3054 175.994 73.6476 181.991C48.9899 187.989 20.0004 205.983 11.0036 197.986C1.67366 189.989 12.6697 156.001 12.3365 131.343C12.0033 106.685 0.340809 91.0243 0.00759636 75.0301C-0.325616 59.0359 10.3372 42.3753 25.3318 28.7135C39.9931 15.0518 58.9863 4.05578 80.3119 1.05687C101.638 -2.27526 124.962 2.38972 148.621 13.3857Z",aspectRatio:{width:194,height:200},width:f,height:v}),blob2:({width:f,height:v})=>o({path:"M140.464 18.6393C156.081 28.3718 169.887 39.9149 178.714 54.853C187.541 69.5649 191.389 87.6717 189.578 104.421C187.768 121.396 180.525 137.239 172.377 153.535C164.455 169.832 155.854 186.58 142.048 194.276C128.241 201.971 109.456 200.613 92.4804 197.671C75.2789 194.502 60.1144 189.749 45.1762 182.733C30.4644 175.716 16.2052 166.21 8.28346 153.083C0.361703 139.729 -1.44898 122.527 1.04072 106.91C3.30408 91.2931 9.64147 76.8076 15.9789 60.5114C22.0899 44.2153 28.201 26.1084 40.6495 14.7916C53.0979 3.24849 71.8838 -1.27823 89.7643 0.306124C107.871 1.66414 124.846 9.13322 140.464 18.6393Z",aspectRatio:{width:191,height:200},width:f,height:v}),blob20:({width:f,height:v})=>o({path:"M150.035 13.2464C157.376 24.9386 153.026 48.323 157.92 65.7254C163.087 83.1277 177.498 94.2761 182.392 108.415C187.287 122.555 182.392 139.957 173.147 156.272C163.63 172.587 149.763 187.814 132.089 195.155C114.414 202.225 93.2053 201.137 73.6276 194.611C54.3219 188.357 36.9196 176.937 25.7712 161.438C14.8947 145.667 10.5441 126.09 5.92163 105.696C1.57105 85.0311 -3.05145 63.5501 2.65869 45.0601C8.64075 26.5701 24.6835 11.0711 43.1735 4.54524C61.6635 -1.98064 82.6007 0.194657 102.722 1.01039C122.844 1.82613 142.421 1.55421 150.035 13.2464Z",aspectRatio:{width:185,height:200},width:f,height:v}),blob21:({width:f,height:v})=>o({path:"M152.611 0.184799C172.596 -0.723643 197.73 1.39606 199.85 13.8114C201.969 26.2268 181.075 48.9379 174.716 68.0151C168.357 87.0924 176.533 102.536 174.11 114.649C171.991 127.064 159.575 136.148 146.252 139.782C132.928 143.719 118.696 141.902 105.977 139.176C93.562 136.451 82.6606 132.212 63.2805 131.909C43.9004 131.606 16.0416 135.24 5.44306 125.853C-5.15543 116.465 1.50648 94.0572 10.2881 76.4939C18.7669 59.2335 29.6682 46.8182 38.7526 35.3112C48.1398 23.5015 56.3158 12.903 66.9143 8.36078C77.5128 4.12138 91.1394 6.24108 104.766 5.63546C118.696 4.72701 132.928 1.09324 152.611 0.184799Z",aspectRatio:{width:200,height:143},width:f,height:v}),blob22:({width:f,height:v})=>o({path:"M195.507 15.5715C206.818 33.1668 193.622 69.3001 190.166 101.663C186.71 134.34 193.308 163.561 181.996 178.014C170.685 192.153 141.464 191.525 114.443 189.326C87.1072 187.44 62.2852 183.67 40.6052 169.531C19.2395 155.077 1.6441 130.255 0.0730908 103.862C-1.18372 77.4694 13.898 49.5054 35.2638 31.91C56.6296 14.0004 84.5936 6.45958 116.328 2.37494C148.063 -1.70969 184.196 -2.3381 195.507 15.5715Z",aspectRatio:{width:200,height:191},width:f,height:v}),blob23:({width:f,height:v})=>o({path:"M135.742 9.14189C157.815 19.2326 179.258 38.4681 176.105 56.7576C172.951 74.7317 145.202 92.0751 127.858 109.734C110.83 127.077 104.523 145.052 87.4953 164.918C70.4672 184.468 42.7177 206.227 27.5816 198.343C12.4455 190.46 9.60747 153.566 6.45411 126.762C2.98542 100.274 -0.798607 84.1917 0.147399 67.1636C0.77807 50.4508 6.76944 32.4767 19.0675 20.8093C31.0503 9.14189 49.6551 3.78119 70.4672 1.2585C90.964 -1.26418 113.668 -0.633508 135.742 9.14189Z",aspectRatio:{width:177,height:200},width:f,height:v}),blob24:({width:f,height:v})=>o({path:"M165.663 24.3715C171.555 44.4059 158.003 76.2254 151.816 96.2598C145.923 116.294 147.691 124.544 148.28 135.445C148.575 146.346 147.396 159.309 140.62 170.8C133.549 181.996 120.88 191.424 104.381 196.432C87.8821 201.441 67.553 202.03 54.8841 192.602C41.9207 183.469 36.6174 164.023 25.1271 143.105C13.3421 122.187 -4.33535 99.7953 0.967891 85.0641C6.27113 70.6275 34.2604 63.8511 56.0626 48.5307C77.5702 33.5048 92.8907 9.93489 113.22 2.56928C133.843 -4.79633 159.77 4.04241 165.663 24.3715Z",aspectRatio:{width:168,height:200},width:f,height:v}),blob25:({width:f,height:v})=>o({path:"M180.115 1.256C192.651 2.1962 189.83 34.163 190.771 58.2947C191.711 82.4265 196.098 98.4099 198.606 117.214C201.113 136.018 201.426 157.642 189.204 165.791C177.294 173.626 153.163 167.671 135.299 163.91C117.749 159.836 106.466 157.956 85.7818 162.97C65.0974 168.298 35.3244 180.521 18.7143 174.253C1.79068 167.985 -1.97012 142.913 0.850478 120.975C3.67107 99.0367 13.0731 79.6059 18.4009 54.8473C23.7287 30.0888 24.9823 -0.310996 40.0254 0.00240332C54.7552 0.00240332 82.9612 31.029 111.167 31.029C139.373 31.029 167.579 0.315802 180.115 1.256Z",aspectRatio:{width:200,height:176},width:f,height:v}),blob26:({width:f,height:v})=>o({path:"M142.571 0.586925C159.976 3.39414 176.258 15.1844 184.96 30.9048C193.662 46.6253 194.224 66.8372 189.171 83.6805C183.837 100.805 172.327 114.56 163.064 129.157C153.8 143.755 146.501 158.914 134.43 173.231C122.359 187.828 105.516 201.303 89.5146 199.899C73.2327 198.776 58.0738 182.775 42.9148 169.862C28.0366 157.23 13.7198 147.685 6.42103 134.491C-0.877729 121.297 -1.15845 103.892 1.64876 88.4528C4.45598 72.7324 10.0704 58.6963 18.4921 47.4674C27.1944 36.2386 38.4233 27.8169 50.4943 22.2025C62.846 16.3073 75.7592 13.5001 91.1989 8.72785C106.919 4.23631 125.166 -1.93957 142.571 0.586925Z",aspectRatio:{width:193,height:200},width:f,height:v}),blob27:({width:f,height:v})=>o({path:"M112.602 54.9337C129.225 71.8646 155.391 78.9448 158.777 89.719C162.471 100.493 143.693 114.654 127.07 135.586C110.447 156.519 96.2866 184.224 71.0442 194.998C46.1096 205.465 10.4008 199.308 2.0893 178.375C-6.22223 157.443 12.5557 121.734 18.4045 92.1817C24.5612 62.6296 17.7889 38.9263 26.4082 21.9954C34.7197 5.06454 58.423 -5.40183 73.5069 2.9097C88.8986 10.9134 95.9788 38.0028 112.602 54.9337Z",aspectRatio:{width:160,height:200},width:f,height:v}),blob28:({width:f,height:v})=>o({path:"M125.281 68.5835C142.15 82.9923 165.344 90.021 181.862 108.998C198.028 127.624 207.516 158.902 192.405 166.634C177.293 174.716 137.581 159.605 112.629 156.442C87.326 152.928 77.1344 161.713 59.9142 165.579C43.0453 169.445 19.1478 168.391 11.7677 157.496C4.73907 146.25 14.2278 124.813 11.4163 94.2382C8.2534 63.6634 -6.85825 23.9514 3.68476 8.48836C14.2278 -7.32615 50.4254 1.10826 73.9715 16.2199C97.5175 31.683 108.412 54.1747 125.281 68.5835Z",aspectRatio:{width:200,height:169},width:f,height:v}),blob29:({width:f,height:v})=>o({path:"M162.987 10.2348C169.16 25.1809 154.864 58.6471 147.066 79.4417C139.268 100.236 138.293 108.359 134.719 114.532C131.47 120.706 125.297 124.93 119.448 143.45C113.6 161.97 107.426 194.461 98.004 199.335C88.5814 204.209 75.5849 181.14 55.7651 167.494C35.6203 153.522 8.65241 148.648 1.8292 135.327C-4.994 122.33 8.65241 100.561 20.0244 82.041C31.3964 63.5208 40.1691 48.2498 53.4906 35.5782C66.8122 22.9065 84.0326 13.159 106.452 6.33584C128.871 -0.812285 156.489 -4.71127 162.987 10.2348Z",aspectRatio:{width:165,height:200},width:f,height:v}),blob3:({width:f,height:v})=>o({path:"M158.095 64.2637C176.543 95.19 192.277 129.1 181.697 155.686C171.117 182.001 133.951 201.533 99.4982 199.905C64.7739 198.549 33.0338 176.032 15.4004 145.377C-2.23296 114.994 -5.75963 76.2002 10.2461 46.6303C26.2518 17.0605 61.5185 -3.557 89.732 0.512241C118.217 4.58149 139.377 33.0662 158.095 64.2637Z",aspectRatio:{width:186,height:200},width:f,height:v}),blob30:({width:f,height:v})=>o({path:"M146.076 34.4585C157.052 54.582 155.833 80.1936 164.675 100.622C173.212 121.355 191.201 136.905 189.372 149.711C187.542 162.212 165.285 171.969 146.99 175.018C129.001 178.372 114.671 174.713 103.39 175.018C92.1083 175.018 83.876 178.982 66.8015 186.299C49.7271 193.617 23.8105 204.288 14.3586 198.19C4.90665 191.787 11.6145 168.615 10.3949 147.882C8.87037 127.148 -0.581561 108.549 0.0282404 89.3407C0.638042 70.1319 11.6145 50.6182 28.384 32.934C44.8487 15.5546 67.4113 0.309578 89.974 0.00467694C112.537 -0.300224 135.099 14.335 146.076 34.4585Z",aspectRatio:{width:190,height:200},width:f,height:v}),blob31:({width:f,height:v})=>o({path:"M134.218 44.0392C153.568 36.4264 184.97 26.9105 195.755 33.2544C206.222 39.9156 195.755 62.1194 181.481 76.3933C166.89 90.35 148.175 96.0596 145.638 116.36C143.1 136.661 156.74 171.235 151.664 183.923C146.589 196.928 123.434 187.413 105.036 178.531C86.6388 169.967 73.3165 161.72 52.0643 158.548C30.812 155.058 1.62986 156.644 0.0438693 145.225C-1.22492 133.806 25.4197 109.382 29.2261 86.8609C32.7152 64.3398 13.6834 44.0392 11.7802 26.9105C9.877 9.46461 24.7853 -4.80928 42.5484 1.53467C59.9942 7.87863 79.9777 34.5232 93.6172 45.308C107.257 56.4099 114.869 51.3347 134.218 44.0392Z",aspectRatio:{width:200,height:191},width:f,height:v}),blob32:({width:f,height:v})=>o({path:"M200 100.339C200 149.831 145.763 197.966 95.5932 197.966C45.7627 197.966 0 149.831 0 100.339C0 50.8475 45.7627 0 95.5932 0C145.763 0 200 50.8475 200 100.339Z",aspectRatio:{width:200,height:198},width:f,height:v}),blob4:({width:f,height:v})=>o({path:"M183.427 38.712C198.21 63.2519 196.141 95.1833 189.341 126.523C182.836 157.863 171.305 188.908 150.609 197.482C130.208 205.76 100.642 192.16 69.8936 177.968C39.4405 164.072 7.80478 150.176 1.30024 128.593C-5.2043 107.01 13.718 77.7393 35.3012 51.7211C56.5888 25.9986 81.1287 3.23272 108.921 0.276112C137.009 -2.38484 168.349 14.4678 183.427 38.712Z",aspectRatio:{width:195,height:200},width:f,height:v}),blob5:({width:f,height:v})=>o({path:"M166.251 30.6913C183.816 48.5185 195.875 71.8512 199.021 98.8542C202.429 125.595 197.186 155.744 179.359 169.115C161.794 182.223 131.645 178.815 103.331 176.979C75.0171 175.144 48.8006 174.882 29.6625 161.512C10.7866 148.141 -0.748681 121.925 0.0378149 96.2326C0.824311 70.8025 14.1947 46.159 33.0706 28.3318C52.2087 10.5045 76.8522 -0.5064 100.971 0.0179307C125.091 0.804426 148.423 12.864 166.251 30.6913Z",aspectRatio:{width:200,height:179},width:f,height:v}),blob6:({width:f,height:v})=>o({path:"M149.146 50.5452C161.911 68.0278 171.901 81.9028 176.619 97.9979C181.336 114.37 180.781 133.241 173.011 149.891C165.519 166.541 151.366 180.693 133.051 189.851C114.736 199.008 92.2586 202.893 71.446 197.621C50.6334 192.348 30.9308 177.918 18.1658 158.216C5.12323 138.791 -0.981801 113.815 0.128204 87.7304C1.51571 61.6453 10.6733 34.1726 29.2658 17.5226C48.1359 1.14999 76.996 -4.40004 98.9186 3.6475C120.841 11.695 136.381 32.7851 149.146 50.5452Z",aspectRatio:{width:180,height:200},width:f,height:v}),blob7:({width:f,height:v})=>o({path:"M158.662 41.8295C178.593 57.8305 204.138 64.5677 213.402 79.7266C222.666 94.6047 215.367 118.466 203.015 135.028C190.383 151.871 172.698 161.977 156.416 168.434C140.134 174.89 124.975 177.697 104.483 185.277C83.9903 192.856 58.1642 205.208 44.9704 197.629C31.4959 190.33 31.2152 163.1 21.9514 138.116C12.9684 112.851 -4.71688 90.1132 1.17822 75.5158C7.35404 61.1991 36.8295 55.5847 58.7256 40.1452C80.9024 24.7056 95.4998 -0.278374 109.816 0.00234533C124.414 0.283064 138.45 25.8285 158.662 41.8295Z",aspectRatio:{width:218,height:200},width:f,height:v}),blob8:({width:f,height:v})=>o({path:"M153.53 11.0108C168.179 18.1858 181.931 29.5461 192.993 44.4939C203.755 59.4417 212.425 78.2759 210.631 96.5122C209.136 114.748 197.477 132.088 182.529 142.252C167.581 152.716 148.747 156.004 128.717 168.262C108.687 180.22 87.1622 201.147 69.8228 199.951C52.7823 198.456 39.6283 174.54 32.4533 153.015C25.2784 131.49 24.0826 112.357 16.6087 91.131C9.13477 70.2041 -4.31825 46.8855 1.36191 31.9377C7.04207 16.691 31.8554 9.51607 52.7823 5.33069C73.4103 0.846349 90.4507 -0.648433 106.594 0.248435C123.037 1.1453 138.882 4.13486 153.53 11.0108Z",aspectRatio:{width:211,height:200},width:f,height:v}),blob9:({width:f,height:v})=>o({path:"M140.289 20.2182C156.96 27.7956 176.661 32.0895 189.29 43.9608C201.667 55.5796 206.718 75.0283 202.424 91.6987C198.131 108.622 184.491 122.766 175.651 140.952C166.81 158.885 162.769 180.607 150.393 191.216C138.016 201.824 117.052 201.572 98.866 197.025C80.6802 192.479 65.2727 183.891 48.3497 175.808C31.4268 167.726 13.2409 160.148 5.1583 146.761C-2.67172 133.122 -0.398493 113.673 4.14797 96.7504C8.69444 80.08 15.5141 65.6828 23.3442 52.296C31.4268 38.6566 40.5197 25.775 52.6436 15.6717C65.0201 5.82101 80.6802 -1.50385 95.3299 0.264221C109.98 1.77971 123.619 12.6407 140.289 20.2182Z",aspectRatio:{width:204,height:200},width:f,height:v})}}(v1)),v1}var y3;function lP(){return y3||(y3=1,function(e){var n=vd&&vd.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const t=n(Or()),r=Ri,a=oo,o=Qv(),s=Xs(),c=es(),m=Gd(),f={};e.FigureElement=(0,r.observer)(({element:v,store:y})=>{const E=v.selectable||y.role==="admin",w=(0,c.isTouchDevice)(),[S,x]=t.default.useState(!1),_=y.selectedShapes.indexOf(v)>=0,b=Math.min(v.strokeWidth,v.width/2,v.height/2),g=Math.max(0,Math.min(v.width/2,v.height/2,v.cornerRadius)),h=(0,m.useColor)(v,v.a.fill,"fill"),d=Object.assign(Object.assign({width:v.a.width,height:v.a.height},h),{cornerRadius:g,opacity:v.animated("opacity"),shadowEnabled:v.shadowEnabled,shadowBlur:v.shadowBlur,shadowOffsetX:v.shadowOffsetX,shadowOffsetY:v.shadowOffsetY,shadowColor:v.shadowColor,shadowOpacity:v.shadowOpacity,preventDefault:!w||_,hideInExport:!v.showInExport}),P=(0,m.useColor)(v,v.stroke,"stroke"),M=Object.assign(Object.assign({visible:b>0,x:b/2,y:b/2,width:v.a.width-b,height:v.a.height-b},P),{strokeWidth:b,cornerRadius:Math.max(0,g-b),dash:v.dash.map(k=>k*b),opacity:v.animated("opacity"),hideInExport:!v.showInExport,listening:!1}),T=(I=v.subType,f[I]||(f[I]=(F=(0,o.subTypeToPathDataFunc)(I),(0,r.observer)(({element:k,fillProps:O,strokeProps:N})=>{let A=F({width:k.a.width,height:k.a.height,cornerRadius:k.cornerRadius}),R=1,L=1;typeof A!="string"&&(R=A.scaleX,L=A.scaleY,A=A.path);const V=t.default.useRef(null);return t.default.createElement(t.default.Fragment,null,t.default.createElement(a.Rect,{width:k.width,height:k.height,fill:"transparent"}),t.default.createElement(a.Path,Object.assign({},O,{ref:V,data:A,scaleX:R,scaleY:L})),t.default.createElement(a.Group,{clipFunc:G=>{const W=V.current;if(W){var X=W.dataArray;G.beginPath();for(var q=0;q<X.length;q++){var z=X[q].command,Y=X[q].points;switch(z){case"L":G.lineTo(Y[0],Y[1]);break;case"M":G.moveTo(Y[0],Y[1]);break;case"C":G.bezierCurveTo(Y[0],Y[1],Y[2],Y[3],Y[4],Y[5]);break;case"Q":G.quadraticCurveTo(Y[0],Y[1],Y[2],Y[3]);break;case"A":var U=Y[0],ee=Y[1],te=Y[2],Q=Y[3],Z=Y[4],re=Y[5],ne=Y[6],ae=Y[7],ue=te>Q?te:Q,fe=te>Q?1:te/Q,pe=te>Q?Q/te:1;G.translate(U,ee),G.rotate(ne),G.scale(fe,pe),G.arc(0,0,ue,Z,Z+re,1-ae),G.scale(1/fe,1/pe),G.rotate(-ne),G.translate(-U,-ee);break;case"z":G.closePath()}}}},scaleX:R,scaleY:L},t.default.createElement(a.Path,Object.assign({},N,{x:0,y:0,data:A,strokeWidth:2*N.strokeWidth,dash:N.dash.map(G=>G)}))))}))),f[I]||a.Group);var I,F;return t.default.createElement(t.default.Fragment,null,t.default.createElement(a.Group,{id:v.id,x:v.a.x,y:v.a.y,rotation:v.a.rotation,opacity:v.a.opacity,listening:E,draggable:w?v.draggable&&_:v.draggable,name:"element",onMouseEnter:()=>{x(!0)},onMouseLeave:()=>{x(!1)},onDragMove:k=>{v.set({x:k.target.x(),y:k.target.y()})},onDragEnd:k=>{v.set({x:k.target.x(),y:k.target.y()})},onTransform:k=>{const O=k.target.scale();k.target.scaleX(1),k.target.scaleY(1),v.set({width:v.width*O.x,height:v.height*O.y,x:k.target.x(),y:k.target.y(),rotation:k.target.rotation()})}},t.default.createElement(T,{element:v,fillProps:d,strokeProps:M})),(S||_)&&t.default.createElement(s.Highlighter,{element:v}))})}(vd)),vd}var md={},qo={},m1={},Ho={},b3;function e_(){if(b3)return Ho;b3=1,Object.defineProperty(Ho,"__esModule",{value:!0}),Ho.loop=Ho.conditional=Ho.parse=void 0;var e=function r(a,o){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:s;if(Array.isArray(o))o.forEach(function(f){return r(a,f,s,c)});else if(typeof o=="function")o(a,s,c,r);else{var m=Object.keys(o)[0];Array.isArray(o[m])?(c[m]={},r(a,o[m],s,c[m])):c[m]=o[m](a,s,c,r)}return s};Ho.parse=e;var n=function(a,o){return function(s,c,m,f){o(s,c,m)&&f(s,a,c,m)}};Ho.conditional=n;var t=function(a,o){return function(s,c,m,f){for(var v=[],y=s.pos;o(s,c,m);){var E={};if(f(s,a,c,E),s.pos===y)break;y=s.pos,v.push(E)}return v}};return Ho.loop=t,Ho}var qr={},w3;function t_(){if(w3)return qr;w3=1,Object.defineProperty(qr,"__esModule",{value:!0}),qr.readBits=qr.readArray=qr.readUnsigned=qr.readString=qr.peekBytes=qr.readBytes=qr.peekByte=qr.readByte=qr.buildStream=void 0;var e=function(y){return{data:y,pos:0}};qr.buildStream=e;var n=function(){return function(y){return y.data[y.pos++]}};qr.readByte=n;var t=function(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(E){return E.data[E.pos+y]}};qr.peekByte=t;var r=function(y){return function(E){return E.data.subarray(E.pos,E.pos+=y)}};qr.readBytes=r;var a=function(y){return function(E){return E.data.subarray(E.pos,E.pos+y)}};qr.peekBytes=a;var o=function(y){return function(E){return Array.from(r(y)(E)).map(function(w){return String.fromCharCode(w)}).join("")}};qr.readString=o;var s=function(y){return function(E){var w=r(2)(E);return y?(w[1]<<8)+w[0]:(w[0]<<8)+w[1]}};qr.readUnsigned=s;var c=function(y,E){return function(w,S,x){for(var _=typeof E=="function"?E(w,S,x):E,b=r(y),g=new Array(_),h=0;h<_;h++)g[h]=b(w);return g}};qr.readArray=c;var m=function(y,E,w){for(var S=0,x=0;x<w;x++)S+=y[E+x]&&Math.pow(2,w-x-1);return S},f=function(y){return function(E){for(var w=n()(E),S=new Array(8),x=0;x<8;x++)S[7-x]=!!(w&1<<x);return Object.keys(y).reduce(function(_,b){var g=y[b];return g.length?_[b]=m(S,g.index,g.length):_[b]=S[g.index],_},{})}};return qr.readBits=f,qr}var _3;function sP(){return _3||(_3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=e_(),t=t_(),r={blocks:function(E){for(var w=0,S=[],x=E.data.length,_=0,b=(0,t.readByte)()(E);b!==w&&b;b=(0,t.readByte)()(E)){if(E.pos+b>=x){var g=x-E.pos;S.push((0,t.readBytes)(g)(E)),_+=g;break}S.push((0,t.readBytes)(b)(E)),_+=b}for(var h=new Uint8Array(_),d=0,P=0;P<S.length;P++)h.set(S[P],d),d+=S[P].length;return h}},a=(0,n.conditional)({gce:[{codes:(0,t.readBytes)(2)},{byteSize:(0,t.readByte)()},{extras:(0,t.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,t.readUnsigned)(!0)},{transparentColorIndex:(0,t.readByte)()},{terminator:(0,t.readByte)()}]},function(y){var E=(0,t.peekBytes)(2)(y);return E[0]===33&&E[1]===249}),o=(0,n.conditional)({image:[{code:(0,t.readByte)()},{descriptor:[{left:(0,t.readUnsigned)(!0)},{top:(0,t.readUnsigned)(!0)},{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{lct:(0,t.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,n.conditional)({lct:(0,t.readArray)(3,function(y,E,w){return Math.pow(2,w.descriptor.lct.size+1)})},function(y,E,w){return w.descriptor.lct.exists}),{data:[{minCodeSize:(0,t.readByte)()},r]}]},function(y){return(0,t.peekByte)()(y)===44}),s=(0,n.conditional)({text:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{preData:function(E,w,S){return(0,t.readBytes)(S.text.blockSize)(E)}},r]},function(y){var E=(0,t.peekBytes)(2)(y);return E[0]===33&&E[1]===1}),c=(0,n.conditional)({application:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{id:function(E,w,S){return(0,t.readString)(S.blockSize)(E)}},r]},function(y){var E=(0,t.peekBytes)(2)(y);return E[0]===33&&E[1]===255}),m=(0,n.conditional)({comment:[{codes:(0,t.readBytes)(2)},r]},function(y){var E=(0,t.peekBytes)(2)(y);return E[0]===33&&E[1]===254}),f=[{header:[{signature:(0,t.readString)(3)},{version:(0,t.readString)(3)}]},{lsd:[{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{gct:(0,t.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,t.readByte)()},{pixelAspectRatio:(0,t.readByte)()}]},(0,n.conditional)({gct:(0,t.readArray)(3,function(y,E){return Math.pow(2,E.lsd.gct.size+1)})},function(y,E){return E.lsd.gct.exists}),{frames:(0,n.loop)([a,c,m,o,s],function(y){var E=(0,t.peekByte)()(y);return E===33||E===44})}],v=f;e.default=v}(m1)),m1}var yd={},S3;function uP(){if(S3)return yd;S3=1,Object.defineProperty(yd,"__esModule",{value:!0}),yd.deinterlace=void 0;var e=function(t,r){for(var a=new Array(t.length),o=t.length/r,s=function(w,S){var x=t.slice(S*r,(S+1)*r);a.splice.apply(a,[w*r,r].concat(x))},c=[0,4,2,1],m=[8,8,4,2],f=0,v=0;v<4;v++)for(var y=c[v];y<o;y+=m[v])s(y,f),f++;return a};return yd.deinterlace=e,yd}var bd={},E3;function cP(){if(E3)return bd;E3=1,Object.defineProperty(bd,"__esModule",{value:!0}),bd.lzw=void 0;var e=function(t,r,a){var o=4096,s=-1,c=a,m,f,v,y,E,w,S,T,x,_,M,b,I,F,O,k,g=new Array(a),h=new Array(o),d=new Array(o),P=new Array(o+1);for(b=t,f=1<<b,E=f+1,m=f+2,S=s,y=b+1,v=(1<<y)-1,x=0;x<f;x++)h[x]=0,d[x]=x;var M,T,I,F,k,O;for(M=T=I=F=k=O=0,_=0;_<c;){if(F===0){if(T<y){M+=r[O]<<T,T+=8,O++;continue}if(x=M&v,M>>=y,T-=y,x>m||x==E)break;if(x==f){y=b+1,v=(1<<y)-1,m=f+2,S=s;continue}if(S==s){P[F++]=d[x],S=x,I=x;continue}for(w=x,x==m&&(P[F++]=I,x=S);x>f;)P[F++]=d[x],x=h[x];I=d[x]&255,P[F++]=I,m<o&&(h[m]=S,d[m]=I,m++,(m&v)===0&&m<o&&(y++,v+=m)),S=w}F--,g[k++]=P[F],_++}for(_=k;_<c;_++)g[_]=0;return g};return bd.lzw=e,bd}var x3;function fP(){if(x3)return qo;x3=1,Object.defineProperty(qo,"__esModule",{value:!0}),qo.decompressFrames=qo.decompressFrame=qo.parseGIF=void 0;var e=o(sP()),n=e_(),t=t_(),r=uP(),a=cP();function o(v){return v&&v.__esModule?v:{default:v}}var s=function(y){var E=new Uint8Array(y);return(0,n.parse)((0,t.buildStream)(E),e.default)};qo.parseGIF=s;var c=function(y){for(var E=y.pixels.length,w=new Uint8ClampedArray(E*4),S=0;S<E;S++){var x=S*4,_=y.pixels[S],b=y.colorTable[_]||[0,0,0];w[x]=b[0],w[x+1]=b[1],w[x+2]=b[2],w[x+3]=_!==y.transparentIndex?255:0}return w},m=function(y,E,w){if(!y.image){console.warn("gif frame does not have associated image.");return}var S=y.image,x=S.descriptor.width*S.descriptor.height,_=(0,a.lzw)(S.data.minCodeSize,S.data.blocks,x);S.descriptor.lct.interlaced&&(_=(0,r.deinterlace)(_,S.descriptor.width));var b={pixels:_,dims:{top:y.image.descriptor.top,left:y.image.descriptor.left,width:y.image.descriptor.width,height:y.image.descriptor.height}};return S.descriptor.lct&&S.descriptor.lct.exists?b.colorTable=S.lct:b.colorTable=E,y.gce&&(b.delay=(y.gce.delay||10)*10,b.disposalType=y.gce.extras.disposal,y.gce.extras.transparentColorGiven&&(b.transparentIndex=y.gce.transparentColorIndex)),w&&(b.patch=c(b)),b};qo.decompressFrame=m;var f=function(y,E){return y.frames.filter(function(w){return w.image}).map(function(w){return m(w,y.gct,E)})};return qo.decompressFrames=f,qo}var O3;function dP(){return O3||(O3=1,function(e){var n=md&&md.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(e,"__esModule",{value:!0}),e.GifElement=void 0;const t=n(Or()),r=Ri,a=Xi,o=oo,s=n(Mi()),c=fP(),m=Xs(),f=J4(),v=Wv(),y=$d(),E=Ys(),w=es();function S(b,g,h){const d=g.getContext("2d"),P=h.getContext("2d");if(!d||!P)return;b.disposalType===2&&d.clearRect(0,0,g.width,g.height),h.width=b.width,h.height=b.height;const M=P.createImageData(b.width,b.height);M.data.set(b.patch),P.putImageData(M,0,0),d.drawImage(h,b.left,b.top)}const x=(0,r.observer)(({element:b})=>{const g=Math.min(30,b.width/4,b.height/4),h=t.default.useRef(null);return t.default.useEffect(()=>{const d=h.current;if(!d)return;const P=new s.default.Animation(M=>{d.rotate(((M==null?void 0:M.timeDiff)||0)/2)},d.getLayer());return P.start(),()=>{P.stop()}},[]),t.default.createElement(o.Group,{x:b.a.x,y:b.a.y,rotation:b.a.rotation,listening:!1,opacity:b.a.opacity,hideInExport:!b.showInExport},t.default.createElement(o.Rect,{width:b.width,height:b.height,fill:"rgba(124, 173, 212, 0.8)"}),t.default.createElement(o.Arc,{ref:h,x:b.width/2,y:b.height/2,fill:"white",outerRadius:Math.abs(g),innerRadius:Math.max(1,g-5),angle:270}))}),_=(0,r.observer)(({element:b})=>{const g=Math.max(10,Math.min(30,b.width/22));return t.default.createElement(o.Group,{x:b.a.x,y:b.a.y,rotation:b.a.rotation,listening:!1,opacity:b.a.opacity,hideInExport:!b.showInExport},t.default.createElement(o.Rect,{width:b.width,height:b.height,fill:"rgba(223, 102, 102, 0.8)"}),t.default.createElement(o.Text,{text:"Cannot load the GIF...",fontSize:g,width:b.width,height:b.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});e.GifElement=(0,r.observer)(({element:b,store:g})=>{var h;const[d,P]=t.default.useState(!1),[M,T]=t.default.useState(!1),I=g.selectedShapes.indexOf(b)>=0,F=t.default.useRef(null),k=t.default.useRef(),[O,N,A,R]=function(re){const[ne,ae]=t.default.useState([]),[ue,fe]=t.default.useState(0),[pe,ye]=t.default.useState("loading"),[we,je]=t.default.useState({width:0,height:0});return t.default.useEffect(()=>{(async()=>{try{const Te=await fetch(re),se=await Te.arrayBuffer(),_e=(0,c.parseGIF)(se),he=(0,c.decompressFrames)(_e,!0),xe=_e.lsd.width,oe=_e.lsd.height;je({width:xe,height:oe});const ve=he.map(ke=>({patch:new Uint8ClampedArray(ke.patch),delay:ke.delay,width:ke.dims.width,height:ke.dims.height,left:ke.dims.left,top:ke.dims.top,disposalType:ke.disposalType})),de=ve.reduce((ke,Be)=>ke+Be.delay,0);ae(ve),fe(de),ye("loaded")}catch(Te){console.error("Failed to load GIF:",Te),ye("failed")}})()},[re]),[ne,ue,we,pe]}(b.src);(0,v.useImageLoader)(R,b.src,b.id),t.default.useEffect(()=>(k.current=document.createElement("canvas"),()=>{k.current&&s.default.Util.releaseCanvas(k.current)}),[]),t.default.useEffect(()=>{if(R==="loaded"&&k.current&&(k.current.width=A.width,k.current.height=A.height,O.length>0)){const re=k.current.getContext("2d");if(re){re.clearRect(0,0,A.width,A.height);const ne=document.createElement("canvas");S(O[0],k.current,ne)}}},[A,R,O]),t.default.useEffect(()=>{if(!O.length||!k.current)return;const re=k.current;re.width=A.width,re.height=A.height;const ne=document.createElement("canvas"),ae=re.getContext("2d");ae&&ae.clearRect(0,0,re.width,re.height);let ue=-1;S(O[0],re,ne),Y(),ue=0;const fe=pe=>{const ye=(we=>{const je=we%N;let Te=0;for(let se=0;se<O.length;se++)if(Te+=O[se].delay,Te>je)return se;return 0})(pe);ye!==ue&&(S(O[ye],re,ne),Y(),F.current.getLayer().draw(),ue=ye)};if(g.isPlaying||b.page._exportingOrRendering)return(0,a.autorun)(()=>{fe(g.currentTime-b.page.startTime)});{const pe=window.setInterval(()=>{fe(g.currentTime||performance.now())},16);return()=>{clearInterval(pe)}}},[g.isPlaying,O,N,b.page._exportingOrRendering]),t.default.useEffect(()=>{N&&g.history.ignore(()=>{b.set({duration:N})})},[N]);let{cropX:L,cropY:V,cropWidth:G,cropHeight:W}=b;R!=="loaded"&&(L=V=0,G=W=1);const X={x:A.width*L,y:A.height*V,width:A.width*G,height:A.height*W},q=(h=b.cornerRadius)!==null&&h!==void 0?h:0,[z,Y]=(0,f.useCornerRadiusAndCrop)(b,k.current,X,g._elementsPixelRatio,q,d||b._cropModeEnabled);t.default.useLayoutEffect(()=>{if(!d&&!b._cropModeEnabled&&F.current)return(0,y.applyFilter)(F.current,b),(0,a.autorun)(()=>{(0,y.applyFilter)(F.current,b)},{delay:100})},[k.current,d,G,W,b._cropModeEnabled,A.width,A.height]);const U=R==="loading",ee=R==="failed",te=U||ee?0:b.a.opacity;(0,E.useFadeIn)(F,te);const Q=b.selectable||g.role==="admin",Z=(0,w.isTouchDevice)();return t.default.createElement(t.default.Fragment,null,U&&t.default.createElement(x,{element:b}),ee&&t.default.createElement(_,{element:b}),t.default.createElement(o.Image,{ref:F,name:"element",id:b.id,image:z,x:b.a.x,y:b.a.y,width:b.a.width||1,height:b.a.height||1,rotation:b.a.rotation,opacity:te,shadowEnabled:b.shadowEnabled,shadowBlur:b.shadowBlur,shadowOffsetX:b.shadowOffsetX,shadowOffsetY:b.shadowOffsetY,shadowColor:b.shadowColor,shadowOpacity:b.shadowOpacity,customCrop:X,listening:Q,draggable:Z?b.draggable&&I:b.draggable,preventDefault:!Z||I,hideInExport:!b.showInExport,onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),onDragMove:re=>{b.set({x:re.target.x(),y:re.target.y()})},onDragEnd:re=>{b.set({x:re.target.x(),y:re.target.y()})},onTransformStart:()=>P(!0),onTransform:re=>{const ne=re.currentTarget,ae=Math.abs(ne.scaleX()-1)<1e-7?1:ne.scaleX(),ue=Math.abs(ne.scaleY()-1)<1e-7?1:ne.scaleY();ne.scaleX(1),ne.scaleY(1),b.set({x:ne.x(),y:ne.y(),width:ne.width()*ae,height:ne.height()*ue,rotation:ne.rotation()})},onTransformEnd:()=>P(!1)}),t.default.createElement(o.Rect,{x:b.a.x,y:b.a.y,width:Math.max(b.a.width-b.borderSize,0),height:Math.max(b.a.height-b.borderSize,0),opacity:te,offsetX:-b.borderSize/2,offsetY:-b.borderSize/2,stroke:b.borderColor,strokeWidth:b.borderSize,listening:!1,visible:!!b.borderSize,rotation:b.rotation,cornerRadius:Math.max(0,q-b.borderSize),hideInExport:!b.showInExport}),(M||I)&&t.default.createElement(m.Highlighter,{element:b}))})}(md)),md}var P3;function hP(){return P3||(P3=1,function(e){var n=od&&od.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeComponent=function(_,b){S[_]=b};const t=n(Or()),r=Ri,a=D4(),o=Wv(),s=aP(),c=oP(),m=J4(),f=lP(),v=dP(),y=oo,E=Jl(),w=(0,r.observer)(_=>{const{element:b,store:g}=_,{children:h}=b,d=b.selectable||g.role==="admin";return t.default.createElement(y.Group,{opacity:b.opacity,listening:d,hideInExport:!b.showInExport},h.map(P=>t.default.createElement(x,Object.assign({},_,{key:P.id,store:g,element:P}))))}),S={text:a.TextElement,image:o.ImageElement,svg:o.ImageElement,line:c.LineElement,video:m.VideoElement,figure:f.FigureElement,group:w,gif:v.GifElement},x=(0,r.observer)(_=>{let b=S[_.element.type];return _.element.type==="text"&&E.flags.htmlRenderEnabled&&(b=s.HTMLElement),_.element.visible?b?t.default.createElement(b,Object.assign({},_)):(console.error("Can not find component for "+_.element.type),null):null});e.default=x}(od)),od}var y1={},C3;function pP(){return C3||(C3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getCrop=function(n,t,r="scale"){const a=t.width/t.height;let o,s;a>=n.width/n.height?(o=n.width,s=n.width/a):(o=n.height*a,s=n.height);let c=0,m=0;return r==="left-top"?(c=0,m=0):r==="left-middle"?(c=0,m=(n.height-s)/2):r==="left-bottom"?(c=0,m=n.height-s):r==="center-top"?(c=(n.width-o)/2,m=0):r==="center-middle"?(c=(n.width-o)/2,m=(n.height-s)/2):r==="center-bottom"?(c=(n.width-o)/2,m=n.height-s):r==="right-top"?(c=n.width-o,m=0):r==="right-middle"?(c=n.width-o,m=(n.height-s)/2):r==="right-bottom"?(c=n.width-o,m=n.height-s):r==="scale"?(c=0,m=0,o=n.width,s=n.height):console.error(new Error("Unknown clip position property - "+r)),{cropX:c,cropY:m,cropWidth:o,cropHeight:s}}}(y1)),y1}var Go={},b1={},k3;function gP(){return k3||(k3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.setAPI=e.iconscoutDownload=e.iconscoutList=e.svgapiDownload=e.svgapiList=e.unsplashDownload=e.unsplashList=e.textTemplateList=e.templateList=e.removeBackground=e.polotnoShapesList=e.getGoogleFontImage=e.getGoogleFontsListAPI=e.URLS=e.getAPI=e.API=e.URL=void 0;const n=Jv();e.URL="https://api.polotno.com",e.API=`${e.URL}/api`,e.getAPI=()=>e.URL+"/api";const t={},r=(o,s)=>{t[o]||(t[o]=!0,console.error(s))},a=`API for iconscout is provided as a demonstration.
|
|
262
262
|
For production usage you have to use your own API endpoint.
|
|
263
263
|
https://iconscout.com/developers, https://iconscout.com/legal/api-license-development-agreement
|
|
264
|
-
https://polotno.com/docs/server-api`;e.URLS={unsplashList:({query:o,page:s=1})=>`${(0,e.getAPI)()}/get-unsplash?query=${o}&per_page=20&page=${s}&KEY=${(0,n.getKey)()}`,unsplashDownload:o=>`${(0,e.getAPI)()}/download-unsplash?id=${o}&KEY=${(0,n.getKey)()}`,svgapiList:({query:o,page:s=0})=>`${(0,e.getAPI)()}/get-svgapi?query=${o}&page=${s}&per_page=20&KEY=${(0,n.getKey)()}`,svgapiDownload:o=>`${(0,e.getAPI)()}/download-svgapi?path=${o}&KEY=${(0,n.getKey)()}`,iconscoutList:({query:o,page:s=1})=>(r("iconscout",a),`${(0,e.getAPI)()}/get-iconscout?query=${o}&page=${s}&KEY=${(0,n.getKey)()}`),iconscoutDownload:o=>(r("iconscout",a),`${(0,e.getAPI)()}/download-iconscout?uuid=${o}&KEY=${(0,n.getKey)()}`),nounProjectList:({query:o,page:s=1})=>`${(0,e.getAPI)()}/get-nounproject?query=${o}&page=${s}&KEY=${(0,n.getKey)()}`,nounProjectDownload:o=>`${(0,e.getAPI)()}/download-nounproject?id=${o}&KEY=${(0,n.getKey)()}`,templateList:({query:o,page:s=1,sizeQuery:c})=>`${(0,e.getAPI)()}/get-templates?${c}&query=${o}&per_page=30&page=${s}&KEY=${(0,n.getKey)()}`,googleFontsList:()=>`${(0,e.getAPI)()}/get-google-fonts?KEY=${(0,n.getKey)()}`,googleFontImage:o=>{return`${e.URL}/google-fonts-previews/black/${s=o,s.replace(new RegExp(" ","g"),"-")}.png`;var s},textTemplateList:()=>`${(0,e.getAPI)()}/get-text-templates?KEY=${(0,n.getKey)()}`,removeBackground:()=>`${(0,e.getAPI)()}/remove-image-background?KEY=${(0,n.getKey)()}`,aiText:()=>`${(0,e.getAPI)()}/ai/text?KEY=${(0,n.getKey)()}`},e.getGoogleFontsListAPI=()=>e.URLS.googleFontsList(),e.getGoogleFontImage=o=>e.URLS.googleFontImage(o),e.polotnoShapesList=()=>`${(0,e.getAPI)()}/get-basic-shapes?KEY=${(0,n.getKey)()}`,e.removeBackground=()=>e.URLS.removeBackground(),e.templateList=o=>e.URLS.templateList(o),e.textTemplateList=()=>e.URLS.textTemplateList(),e.unsplashList=o=>e.URLS.unsplashList(o),e.unsplashDownload=o=>e.URLS.unsplashDownload(o),e.svgapiList=o=>e.URLS.svgapiList(o),e.svgapiDownload=o=>e.URLS.svgapiDownload(o),e.iconscoutList=o=>e.URLS.iconscoutList(o),e.iconscoutDownload=o=>e.URLS.iconscoutDownload(o),e.setAPI=(o,s)=>{e.URLS[o]=s}}(b1)),b1}var A3;function Jv(){return A3||(A3=1,function(e){var n,t=Go&&Go.__createBinding||(Object.create?function(I,F,k,O){O===void 0&&(O=k);var N=Object.getOwnPropertyDescriptor(F,k);N&&!("get"in N?!F.__esModule:N.writable||N.configurable)||(N={enumerable:!0,get:function(){return F[k]}}),Object.defineProperty(I,O,N)}:function(I,F,k,O){O===void 0&&(O=k),I[O]=F[k]}),r=Go&&Go.__setModuleDefault||(Object.create?function(I,F){Object.defineProperty(I,"default",{enumerable:!0,value:F})}:function(I,F){I.default=F}),a=Go&&Go.__importStar||(n=function(I){return n=Object.getOwnPropertyNames||function(F){var k=[];for(var O in F)Object.prototype.hasOwnProperty.call(F,O)&&(k[k.length]=O);return k},n(I)},function(I){if(I&&I.__esModule)return I;var F={};if(I!=null)for(var k=n(I),O=0;O<k.length;O++)k[O]!=="default"&&t(F,I,k[O]);return r(F,I),F});Object.defineProperty(e,"__esModule",{value:!0}),e.__=e.getKey=e.isCreditVisible=e.___=void 0,e.isKeyPaid=T,e.validateKey=async function(I,F){y=I,await T(I)&&!F||v()};const o=a(Xi),s=gP(),c=Jl(),m=o.observable({value:!1}),f=o.observable({value:"v1"});e.___=()=>f.value,e.isCreditVisible=()=>m.value;const v=o.action(()=>{m.value=!0});let y="";e.getKey=()=>y||"";const E=5,w=3e3,S="Polotno API is initialized without API key. It may lead to unexpected behavior and stop working. Please create API key here: https://polotno.com/cabinet",x="Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet",_="Can not validate Polotno API key. Please report to anton@polotno.com immediately.",b="%cPolotno Free Version. Development or non-commercial usage only. https://polotno.com/";let g=window.location.origin;const h=navigator.userAgent.indexOf("Headless")>-1,d=navigator.userAgent.indexOf("Electron")>-1;g==="file://"&&h&&(g="headless"),g==="file://"&&d&&(g="electron");const P=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${g}" here: https://polotno.com/cabinet`;let M=fetch;async function T(I){for(let F=0;F<E;F++)try{const k=await M((0,s.getAPI)()+"/validate-key",{method:"POST",body:JSON.stringify({key:I,site:location.host,skdVersion:"2.21.4"})});if(f.value=k.headers.get("x-api-version"),!I)return console.warn(S),!1;if(k.status!==200){await new Promise(N=>setTimeout(N,w));continue}const O=await k.json();return O.is_valid||console.warn(x),O.is_paid||console.log(b,"background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),O.is_domain_valid||console.log(P,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),(0,c.useRemoveBackground)(O.remove_background_enabled),O.is_paid||!1}catch{await new Promise(O=>setTimeout(O,w))}return console.error(_),!0}e.__=I=>{M=I}}(Go)),Go}var w1={},T3;function em(){return T3||(T3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pxToUnitString=e.unitToPx=e.pxToUnitRounded=e.pxToUnit=void 0,e.pxToUnit=({px:n,unit:t="px",dpi:r})=>{switch(t){case"pt":default:return n;case"mm":return n/(r/25.4);case"cm":return n/(r/2.54);case"in":return n/r}},e.pxToUnitRounded=({px:n,precious:t=2,dpi:r=72,unit:a="px"})=>parseFloat((0,e.pxToUnit)({px:n,dpi:r,unit:a}).toFixed(t)),e.unitToPx=({unitVal:n,dpi:t,unit:r})=>n/(0,e.pxToUnit)({px:1,unit:r,dpi:t}),e.pxToUnitString=n=>{const t=parseFloat((0,e.pxToUnit)(n).toFixed(1));switch(n.unit){case"pt":return`${Math.round(t)}pt`;case"mm":return`${t}mm`;case"cm":return`${t}cm`;case"in":return`${t}in`;default:return`${Math.round(t)}px`}}}(w1)),w1}var R3;function vP(){return R3||(R3=1,function(e){var n=Ns&&Ns.__rest||function(U,ee){var te={};for(var Q in U)Object.prototype.hasOwnProperty.call(U,Q)&&ee.indexOf(Q)<0&&(te[Q]=U[Q]);if(U!=null&&typeof Object.getOwnPropertySymbols=="function"){var Z=0;for(Q=Object.getOwnPropertySymbols(U);Z<Q.length;Z++)ee.indexOf(Q[Z])<0&&Object.prototype.propertyIsEnumerable.call(U,Q[Z])&&(te[Q[Z]]=U[Q[Z]])}return te},t=Ns&&Ns.__importDefault||function(U){return U&&U.__esModule?U:{default:U}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerNextDomDrop=e.useContextMenu=e.setTransformerStyle=void 0,e.registerTransformerAttrs=function(U,ee){k[U]=k[U]||ee,Object.assign(k[U],ee)};const r=t(Or()),a=Ri,o=Xi,s=oo,c=t(Up()),m=t(Mi()),f=t(hP()),v=Q4(),y=Wv(),E=pP(),w=Jv(),S=Ec(),x=em(),_=Jl(),b=es(),g=Gd(),h=Iv(),d=wc,P=m.default.DD._drag;window.removeEventListener("mousemove",P),m.default.DD._drag=function(U){(0,o.runInAction)(()=>{P.call(this,U)})},window.addEventListener("mousemove",m.default.DD._drag);const M=new m.default.Group,T=20;M.add(new m.default.Rect({width:T,height:T,fill:"white"})),M.add(new m.default.Path({scaleX:T/24,scaleY:T/24,data:"M4.98313549,11.0001422 C5.49589839,10.9914935 5.92501998,11.3703506 5.99116425,11.8666444 L5.99985778,11.9831355 L6.00348884,12.2068855 C6.11245031,15.4321748 8.76323537,17.9999971 11.9999971,17.9999971 C12.1869612,17.9999971 12.3726725,17.9914753 12.5567465,17.9745765 L12.2928932,17.7071068 C11.9023689,17.3165825 11.9023689,16.6834175 12.2928932,16.2928932 C12.6834175,15.9023689 13.3165825,15.9023689 13.7071068,16.2928932 L15.7071068,18.2928932 C16.0976311,18.6834175 16.0976311,19.3165825 15.7071068,19.7071068 L13.7071068,21.7071068 C13.3165825,22.0976311 12.6834175,22.0976311 12.2928932,21.7071068 C11.9023689,21.3165825 11.9023689,20.6834175 12.2928932,20.2928932 L12.6111505,19.9769552 C12.4086045,19.9922816 12.2047796,19.9999971 11.9999971,19.9999971 C7.7687005,19.9999971 4.28886152,16.7094374 4.01666425,12.5105203 L4.00420123,12.2575143 L4.00014222,12.0168645 C3.9908282,11.4646583 4.43092928,11.0094562 4.98313549,11.0001422 Z M11.7071068,2.29289322 C12.0675907,2.65337718 12.0953203,3.22060824 11.7902954,3.61289944 L11.7071068,3.70710678 L11.3891629,4.0230186 C11.5916051,4.00770767 11.7953244,4 12,4 C16.418278,4 20,7.581722 20,12 C20,12.5522847 19.5522847,13 19,13 C18.4477153,13 18,12.5522847 18,12 C18,8.6862915 15.3137085,6 12,6 C11.8129339,6 11.6271216,6.00853145 11.4429483,6.02544919 L11.7071068,6.29289322 C12.0976311,6.68341751 12.0976311,7.31658249 11.7071068,7.70710678 C11.3466228,8.06759074 10.7793918,8.09532028 10.3871006,7.79029539 L10.2928932,7.70710678 L8.29289322,5.70710678 C7.93240926,5.34662282 7.90467972,4.77939176 8.20970461,4.38710056 L8.29289322,4.29289322 L10.2928932,2.29289322 C10.6834175,1.90236893 11.3165825,1.90236893 11.7071068,2.29289322 Z",fill:"black"}));const I=M.toCanvas({pixelRatio:2,width:T,height:T}),F={enabledAnchors:["top-left","top-center","top-right","middle-left","bottom-left","bottom-right","bottom-center","middle-right"],borderEnabled:!0,rotateEnabled:!0,rotationSnaps:[0,45,90,135,180,225,270,315],ignoreStroke:!0,flipEnabled:!1,anchorStrokeWidth:2,borderStrokeWidth:2,rotateAnchorOffset:30,anchorStyleFunc:U=>{U.hasName("rotater")&&U.setAttrs({width:20,height:20,cornerRadius:20/2,offsetX:20/2,offsetY:20/2,fillPatternImage:I,fillPatternScaleX:20/T/2,fillPatternScaleY:20/T/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}};e.setTransformerStyle=U=>{Object.assign(F,U)};const k={text:{enabledAnchors:["top-left","top-right","middle-left","bottom-left","bottom-right","middle-right"]},svg:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},gif:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},line:{enabledAnchors:[],borderEnabled:!1,rotateEnabled:!1},image:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},many:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},group:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]}},O=U=>r.default.createElement(s.Rect,Object.assign({},U,{preventDefault:!1})),N=U=>{var{url:ee}=U,te=n(U,["url"]);const[Q,Z]=(0,c.default)(ee,"anonymous"),re=Q?(0,E.getCrop)(Q,{width:te.width,height:te.height},"center-middle"):{};return(0,y.useImageLoader)(Z,ee,"page background"),r.default.createElement(s.Image,Object.assign({image:Q},te,re))},A=U=>{const ee=(0,g.useColor)({fill:U.fill,a:{width:U.width,height:U.height}});return r.default.createElement(s.Rect,Object.assign({},U,ee))},R=U=>{const{background:ee,scale:te,borderColor:Q}=U,Z=n(U,["background","scale","borderColor"]),re=r.default.useMemo(()=>!!m.default.Util.colorToRGBA(ee)||(0,h.isGradient)(ee),[ee]),ne=r.default.useMemo(()=>{const ae=document.createElement("canvas"),ue=30;ae.width=60,ae.height=60;const fe=ae.getContext("2d");return fe&&(fe.fillStyle="black",fe.fillRect(ue,0,ue,ue),fe.fillRect(0,ue,ue,ue)),ae},[]);return r.default.createElement(r.default.Fragment,null,r.default.createElement(s.Rect,Object.assign({fillPatternImage:ne},Z,{opacity:.1,hideInExport:!0})),re?r.default.createElement(A,Object.assign({fill:ee},Z)):r.default.createElement(N,Object.assign({url:ee},Z)))},L=(0,a.observer)(({selection:U})=>U.visible?r.default.createElement(s.Rect,{name:"selection",x:Math.min(U.x1,U.x2),y:Math.min(U.y1,U.y2),width:Math.abs(U.x1-U.x2),height:Math.abs(U.y1-U.y2),fill:"rgba(0, 161, 255, 0.3)"}):null),V=(0,a.observer)(({x:U,y:ee,width:te,height:Q,rotation:Z,anchor:re,store:ne})=>{const ae=(0,S.getClientRect)({x:U,y:ee,width:te,height:Q,rotation:m.default.Util.radToDeg(Z)});if(re===void 0)return null;const ue=(Q/2+70)*Math.cos(Z-Math.PI/2),fe=(Q/2+70)*Math.sin(Z-Math.PI/2),pe=(0,x.pxToUnitRounded)({unit:ne.unit,dpi:ne.dpi,px:te/ne.scale,precious:ne.unit==="px"?0:1})+" x "+(0,x.pxToUnitRounded)({unit:ne.unit,dpi:ne.dpi,px:Q/ne.scale,precious:ne.unit==="px"?0:1})+(ne.unit==="px"?"":" "+ne.unit);return r.default.createElement(r.default.Fragment,null,r.default.createElement(s.Label,{x:(ae.minX+ae.maxX)/2+ue,y:(ae.minY+ae.maxY)/2+fe,offsetX:14,offsetY:14,visible:re==="rotater"},r.default.createElement(s.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)"}),r.default.createElement(s.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:Math.round(m.default.Util.radToDeg(Z)).toString()+"°"})),r.default.createElement(s.Label,{x:(ae.minX+ae.maxX)/2,y:ae.maxY+20,visible:re!=="rotater"},r.default.createElement(s.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"up",pointerHeight:0,pointerWidth:0}),r.default.createElement(s.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:pe})))}),G=(0,a.observer)(({elements:U,store:ee})=>{const te=U.filter(Z=>Z.alwaysOnTop),Q=U.filter(Z=>!Z.alwaysOnTop).concat(te);return r.default.createElement(r.default.Fragment,null,Q.map(Z=>r.default.createElement(f.default,{key:Z.id,store:ee,element:Z,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))});e.useContextMenu=({store:U})=>{const[ee,te]=r.default.useState(!1),[Q,Z]=r.default.useState({x:0,y:0});return{open:r.default.useCallback(ne=>{te(!0),Z(ne)},[]),close:r.default.useCallback(()=>{te(!1)},[]),props:{isOpen:ee,offset:Q,setIsOpen:te}}};let W=null;e.registerNextDomDrop=U=>{W=U};const X=atob("UG9sb3RubyBmcmVlIGxpY2Vuc2UgbGltaXRhdGlvbiBleGNlZWRlZCAtIFBsZWFzZSB1cGdyYWRlIHlvdXIgYWNjb3VudC4="),q=atob("cmVk"),z=atob("djAuOS4y"),Y=U=>r.default.createElement(r.default.Fragment,null,r.default.createElement(s.Label,{fill:q,height:200},r.default.createElement(s.Tag,{fill:q}),r.default.createElement(s.Text,Object.assign({},U,{fill:"white",text:X,height:void 0,padding:10,fontSize:20}))));e.default=(0,a.observer)(({store:U,page:ee,width:te,height:Q,pageControlsEnabled:Z,backColor:re,pageBorderColor:ne,activePageBorderColor:ae,components:ue,bleedColor:fe,altCloneEnabled:pe,viewportSize:ye})=>{const we=U.bleedVisible?ee.bleed:0,je=ee.computedWidth+2*we,Te=ee.computedHeight+2*we,se=(te-je*U.scale)/2,_e=(Q-Te*U.scale)/2,he=r.default.useRef(null),xe=r.default.useRef(null),oe=r.default.useRef(null),ve=Z==null||Z,[de,ke]=r.default.useState(null),[Be,Qe]=r.default.useState({}),Ke=(0,e.useContextMenu)({store:U}),St=U.selectedElements.find(ze=>ze._cropModeEnabled),Ue=U.selectedShapes.filter(ze=>!ze.resizable).length>0,rt=U.selectedShapes.filter(ze=>!ze.draggable).length>0,gt=U.selectedElements.filter(ze=>!ze.visible).length>0;r.default.useLayoutEffect(()=>{var ze,at,Pe;if(!he.current)return;const me=he.current.getStage(),He=U.selectedShapes.map(Ye=>Ye._cropModeEnabled?null:me.findOne("#"+Ye.id)).filter(Ye=>Ye),Me=U.selectedElements.length===1&&((ze=U.selectedElements[0])===null||ze===void 0?void 0:ze.type)||"many";k[Me]?(he.current.setAttrs(Object.assign(Object.assign({},F),k[Me])),Me!=="svg"&&Me!=="image"&&Me!=="gif"||U.selectedElements[0].keepRatio||he.current.setAttrs({enabledAnchors:F.enabledAnchors}),Me==="text"&&_.flags.textVerticalResizeEnabled&&he.current.setAttrs({enabledAnchors:(at=k.text.enabledAnchors)===null||at===void 0?void 0:at.concat(["bottom-center"])})):he.current.setAttrs(F),Ue&&he.current.enabledAnchors([]),rt&&he.current.rotateEnabled(!1),He.find(Ye=>Ye==null?void 0:Ye.isDragging())&&He.forEach(Ye=>{Ye.isDragging()||Ye==null||Ye.startDrag()}),he.current.nodes(He),(Pe=he.current.getLayer())===null||Pe===void 0||Pe.batchDraw()},[U.selectedShapes,St,Ue,gt,rt]);const mt=(0,a.useLocalObservable)(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),kt=r.default.useRef(!1),jt=(0,b.isTouchDevice)(),Oe=(0,o.action)(ze=>{var at,Pe,me,He;if(jt)return;kt.current=!1;const Me=ze.target.findAncestor(".elements-container"),Ye=ze.target.findAncestor("Transformer"),et=ze.target.findAncestor(".page-abs-container");if(Me||Ye||et)return;const ut=(at=ze.target.getStage())===null||at===void 0?void 0:at.getPointerPosition();ut.x-=(Pe=ze.target.getStage())===null||Pe===void 0?void 0:Pe.x(),ut.y-=(me=ze.target.getStage())===null||me===void 0?void 0:me.y(),ut&&(mt.visible=!0,mt.x1=ut.x,mt.y1=ut.y,mt.x2=ut.x,mt.y2=ut.y,((He=ze.target.getStage())===null||He===void 0?void 0:He.getPointersPositions().length)>=2&&(mt.visible=!1))});(({stageRef:ze,containerRef:at,viewportSize:Pe})=>{r.default.useEffect(()=>{var me;const He=(me=at.current)===null||me===void 0?void 0:me.closest(".polotno-workspace-inner");function Me(){var Ye;if(!ze.current)return;const et=(Ye=at.current)===null||Ye===void 0?void 0:Ye.getBoundingClientRect(),ut=He==null?void 0:He.getBoundingClientRect(),wt=Math.max(0,ut.left-et.left-100),Ct=Math.max(0,ut.top-et.top-100);ze.current.position({x:-wt,y:-Ct}),ze.current.container().style.transform=`translate(${wt}px, ${Ct}px)`}return Me(),He.addEventListener("scroll",Me),()=>{He.removeEventListener("scroll",Me)}},[Pe.width,Pe.height])})({stageRef:xe,containerRef:oe,viewportSize:ye}),r.default.useEffect(()=>{const ze=(0,o.action)(Pe=>{var me,He,Me,Ye;if(!mt.visible)return;(me=xe.current)===null||me===void 0||me.setPointersPositions(Pe);let et=(He=xe.current)===null||He===void 0?void 0:He.getPointerPosition();et?(et.x-=(Me=xe.current)===null||Me===void 0?void 0:Me.x(),et.y-=(Ye=xe.current)===null||Ye===void 0?void 0:Ye.y()):et={x:mt.x2,y:mt.y2},mt.x2=et.x,mt.y2=et.y}),at=(0,o.action)(()=>{if(!mt.visible||!xe.current)return;const Pe=xe.current.findOne(".selection"),me=Pe?Pe.getClientRect():{width:0,height:0,x:0,y:0};if(me.width&&me.height){const He=[];xe.current.find(".element").forEach(Ye=>{const et=Ye.getClientRect(),ut=U.getElementById(Ye.id()),wt=ut==null?void 0:ut.draggable,Ct=ut==null?void 0:ut.selectable;m.default.Util.haveIntersection(me,et)&&wt&&Ct&&He.push(ut.top.id)});const Me=[...new Set(He)];U.selectElements(Me)}mt.visible=!1,kt.current=!0});return window.addEventListener("mousemove",ze),window.addEventListener("touchmove",ze),window.addEventListener("mouseup",at),window.addEventListener("touchend",at),()=>{window.removeEventListener("mousemove",ze),window.removeEventListener("touchmove",ze),window.removeEventListener("mouseup",at),window.removeEventListener("touchend",at)}},[]);const Se=r.default.useRef(!1);r.default.useEffect(()=>{var ze;let at;const Pe=(ze=oe.current)===null||ze===void 0?void 0:ze.closest(".polotno-workspace-inner"),me=()=>{Se.current=!0,clearTimeout(at),at=setTimeout(()=>{Se.current=!1},300)};return Pe.addEventListener("scroll",me),()=>{clearTimeout(at),Pe.removeEventListener("scroll",me)}},[]);const yt=ze=>{if(U.activePage!==ee&&ee.select(),Se.current||kt.current)return;const at=ze.evt.ctrlKey||ze.evt.metaKey||ze.evt.shiftKey,Pe=ze.target.findAncestor(".elements-container"),me=ze.target.findAncestor(".page-abs-container"),He=ze.target.findAncestor("Transformer");if(!(at||Pe||He||me))return void U.selectElements([]);const Me=ze.target.findAncestor(".element",!0),Ye=U.getElementById(Me==null?void 0:Me.id()),et=Ye==null?void 0:Ye.top,ut=et==null?void 0:et.id,wt=U.selectedElementsIds.indexOf(ut)>=0;ut&&at&&!wt?U.selectElements(U.selectedElementsIds.concat([ut])):ut&&at&&wt?U.selectElements(U.selectedElementsIds.filter(Ct=>Ct!==ut)):!ut||at||wt||U.selectElements([ut])};(0,v.useSnap)(he,U);const Fe=U.activePage===ee,qe=ue==null?void 0:ue.PageControls,$e=ue==null?void 0:ue.Tooltip,Et=ue==null?void 0:ue.ContextMenu,Pt=1/U.scale,ht=0/U.scale;return r.default.createElement("div",{ref:oe,onDragOver:ze=>ze.preventDefault(),onDrop:ze=>{if(ze.preventDefault(),!xe.current)return;xe.current.setPointersPositions(ze);const at=xe.current.findOne(".elements-container").getRelativePointerPosition(),Pe=xe.current.getPointerPosition(),me=xe.current.getAllIntersections(Pe).map(Ye=>Ye.findAncestor(".element",!0)).filter(Boolean),He=[...new Set(me.reverse())].map(Ye=>U.getElementById(Ye.id())),Me=He[0];W&&(W(at,Me,{elements:He,page:ee}),W=null)},style:{position:"relative",width:te+"px",height:Q+"px",overflow:"hidden"},className:"polotno-page-container"+(Fe?" active-page":"")},r.default.createElement(s.Stage,{ref:xe,width:Math.min(te,ye.width+200),height:Math.min(ye.height+200,Q),onClick:yt,onTap:yt,onContextMenu:ze=>{ze.evt.preventDefault();const at=ze.target.findAncestor(".element",!0),Pe=U.getElementById(at==null?void 0:at.id()),me=Pe==null?void 0:Pe.top,He=me==null?void 0:me.id;He?U.selectedElementsIds.indexOf(He)>=0||U.selectElements([He]):U.selectElements([]),Ke.open({x:ze.evt.clientX,y:ze.evt.clientY})},onMouseDown:Oe,onMouseMove:ze=>{if(!ze.evt.altKey&&de)return void ke(null);if(!ze.evt.altKey)return;const at=ze.target.findAncestor(".element",!0),Pe=at==null?void 0:at.id();if(!U.selectedElements[0]||U.selectedElementsIds.includes(Pe))return;const me=(0,S.getTotalClientRect)(U.selectedShapes),He=Pe?U.getElementById(Pe):{x:0,y:0,width:ee.computedWidth,height:ee.computedHeight,rotation:0},Me=(0,S.getClientRect)(He),Ye=[];me.minX>Me.maxX&&Ye.push({distance:me.minX-Me.maxX,box1:me,box2:Me,points:[{x:me.minX,y:me.minY+me.height/2},{x:Me.maxX,y:me.minY+me.height/2},{x:Me.maxX,y:Me.minY+Me.height/2}]}),me.maxX<Me.minX&&Ye.push({distance:Me.minX-me.maxX,box1:me,box2:Me,points:[{x:me.maxX,y:me.minY+me.height/2},{x:Me.minX,y:me.minY+me.height/2},{x:Me.minX,y:Me.minY+Me.height/2}]}),me.minY>Me.maxY&&Ye.push({box1:me,box2:Me,distance:me.minY-Me.maxY,points:[{x:me.minX+me.width/2,y:me.minY},{x:me.minX+me.width/2,y:Me.maxY},{x:Me.minX+Me.width/2,y:Me.maxY}]}),me.maxY<Me.minY&&Ye.push({box1:me,box2:Me,distance:Me.minY-me.maxY,points:[{x:me.minX+me.width/2,y:me.maxY},{x:me.minX+me.width/2,y:Me.minY},{x:Me.minX+Me.width/2,y:Me.minY}]}),me.minX>=Me.minX&&me.maxX<=Me.maxX&&me.minY>=Me.minY&&me.maxY<=Me.maxY&&(Ye.push({distance:me.minX-Me.minX,box1:me,box2:Me,points:[{x:me.minX,y:me.minY+me.height/2},{x:Me.minX,y:me.minY+me.height/2},{x:Me.minX,y:Me.minY+Me.height/2}]}),Ye.push({distance:Me.maxX-me.maxX,box1:me,box2:Me,points:[{x:me.maxX,y:me.minY+me.height/2},{x:Me.maxX,y:me.minY+me.height/2},{x:Me.maxX,y:Me.minY+Me.height/2}]}),Ye.push({box1:me,box2:Me,distance:me.minY-Me.minY,points:[{x:me.minX+me.width/2,y:me.minY},{x:me.minX+me.width/2,y:Me.minY},{x:Me.minX+Me.width/2,y:Me.minY}]}),Ye.push({box1:me,box2:Me,distance:Me.maxY-me.maxY,points:[{x:me.minX+me.width/2,y:me.maxY},{x:me.minX+me.width/2,y:Me.maxY},{x:Me.minX+Me.width/2,y:Me.maxY}]})),JSON.stringify(de)!==JSON.stringify(Ye)&&ke(Ye)},onDragStart:ze=>{var at;const Pe=ze.target.findAncestor(".element",!0);if(Pe){const me=U.getElementById(Pe==null?void 0:Pe.id()),He=me==null?void 0:me.top,Me=He==null?void 0:He.id;!(U.selectedElementsIds.indexOf(Me)>=0)&&Me&&(U.selectElements([Me]),ze.target.stopDrag(),ze.target.startDrag(ze),(at=he.current)===null||at===void 0||at.startDrag(ze))}de&&ke(null)},pageId:ee.id,style:{position:"absolute",overflow:"hidden",top:0,left:0}},r.default.createElement(s.Layer,null,r.default.createElement(O,{width:te,height:Q,fill:re}),r.default.createElement(s.Group,{x:se,y:_e,scaleX:U.scale,scaleY:U.scale,name:"page-container"},r.default.createElement(s.Group,{name:"page-container-2"},r.default.createElement(s.Group,{name:"page-background-group",x:we,y:we},r.default.createElement(R,{x:-ee.bleed,y:-ee.bleed,width:ee.computedWidth+2*ee.bleed,height:ee.computedHeight+2*ee.bleed,background:ee.background,name:"page-background",preventDefault:!1,scale:U.scale})),r.default.createElement(s.Group,{x:we,y:we,name:"elements-container",listening:!U.isPlaying},r.default.createElement(s.Rect,{name:"elements-area",width:ee.computedWidth,height:ee.computedHeight,listening:!1}),r.default.createElement(G,{elements:ee.children,store:U})),r.default.createElement(s.Rect,{stroke:fe,name:"bleed",strokeWidth:ee.bleed,x:ee.bleed/2,y:ee.bleed/2,width:ee.computedWidth+ee.bleed,height:ee.computedHeight+ee.bleed,listening:!1,visible:ee.bleed>0&&U.bleedVisible,hideInExport:!0}),(0,w.___)()===z&&r.default.createElement(Y,{name:"hit-detection",x:-Pt/2-ht,y:-Pt/2-ht,width:je+Pt+2*ht,height:Te+Pt+2*ht}))),r.default.createElement(s.Line,{name:"workspace-background",points:[0,0,te,0,te,Q,0,Q,0,0,se,_e,se,Q-_e,te-se,Q-_e,te-se,_e,se,_e],listening:!1,closed:!0,fill:re}),r.default.createElement(s.Group,{x:se,y:_e,scaleX:U.scale,scaleY:U.scale},r.default.createElement(s.Rect,{name:"page-highlight",hideInExport:!0,x:-Pt/2-ht,y:-Pt/2-ht,width:je+Pt+2*ht,height:Te+Pt+2*ht,stroke:Fe&&U.pages.length>1?ae:ne,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),r.default.createElement(s.Group,{x:se+we*U.scale,y:_e+we*U.scale,scaleX:U.scale,scaleY:U.scale,name:"page-abs-container"},r.default.createElement(s.Transformer,{ref:he,onDragStart:ze=>{var at;!((at=ze.evt)===null||at===void 0)&&at.altKey&&pe&&U.selectedElements.forEach(Pe=>{const me=Pe.clone({},{skipSelect:!0}),He=ee.children.indexOf(Pe);ee.setElementZIndex(me.id,He)}),U.history.startTransaction()},onDragEnd:()=>{U.history.endTransaction()},onTransformStart:()=>{U.history.startTransaction()},boundBoxFunc:(ze,at)=>{const Pe=Math.abs(at.width)<1||Math.abs(at.height)<1,me=Math.abs(ze.width)<1||Math.abs(ze.height)<1;return Pe&&!me?ze:at},onTransform:ze=>{var at,Pe;const me=he.current.nodes(),He=me[me.length-1];if(ze.target!==He)return;const Me=(at=he.current)===null||at===void 0?void 0:at.__getNodeRect(),Ye=(Pe=he.current)===null||Pe===void 0?void 0:Pe.getActiveAnchor();Qe({anchor:Ye,x:Me.x,y:Me.y,rotation:Me.rotation,width:Me.width,height:Me.height})},onTransformEnd:ze=>{Qe({}),U.history.endTransaction()},visible:!U.isPlaying}),de&&de.map(({points:ze,distance:at,box1:Pe,box2:me},He)=>r.default.createElement(s.Group,{name:"distances-container",hideInExport:!0,key:He,listening:!1},r.default.createElement(s.Rect,Object.assign({},Pe,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),r.default.createElement(s.Rect,Object.assign({},me,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),r.default.createElement(s.Line,{points:[ze[0].x,ze[0].y,ze[1].x,ze[1].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),r.default.createElement(s.Line,{points:[ze[1].x,ze[1].y,ze[2].x,ze[2].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),r.default.createElement(s.Label,{x:(ze[0].x+ze[1].x)/2,y:(ze[0].y+ze[1].y)/2,offsetY:-10,scaleX:1/U.scale,scaleY:1/U.scale},r.default.createElement(s.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"down"}),r.default.createElement(s.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:5,text:(0,x.pxToUnitString)({unit:U.unit,dpi:U.dpi,px:at})})))),ee._rendering&&r.default.createElement(s.Group,null,r.default.createElement(s.Rect,{width:je,height:Te,fill:"rgba(255,255,255,0.9)"}),r.default.createElement(s.Text,{text:"Rendering...",fontSize:60,width:je,height:Te,align:"center",verticalAlign:"middle"})),$e&&r.default.createElement($e,{components:ue,store:U,page:ee,stageRef:xe}),Et&&r.default.createElement(d.Html,null,r.default.createElement(Et,Object.assign({components:ue,store:U},Ke.props)))),r.default.createElement(V,Object.assign({},Be,{store:U})),r.default.createElement(L,{selection:mt}),(0,w.isCreditVisible)()&&r.default.createElement(s.Text,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:te-170,y:Q-18,onMouseEnter:ze=>{ze.target.getStage().container().style.cursor="pointer"},onMouseLeave:ze=>{ze.target.getStage().container().style.cursor=""},onTouchStart:ze=>{ze.cancelBubble=!0},onMouseDown:ze=>{ze.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),r.default.createElement(s.Group,{name:"line-guides"}))),ve&&qe&&r.default.createElement(qe,{store:U,page:ee,xPadding:se,yPadding:_e}))})}(Ns)),Ns}var wd={},M3;function mP(){return M3||(M3=1,function(e){var n=wd&&wd.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(e,"__esModule",{value:!0}),e.TopRules=void 0,e.LeftRules=function(){return t.default.createElement("div",null,t.default.createElement("h1",null,"Top rules"))};const t=n(Or()),r=Ec(),a=em(),o=Ri,s=Z4(),c=(0,s.styled)("div",t.default.forwardRef)`
|
|
264
|
+
https://polotno.com/docs/server-api`;e.URLS={unsplashList:({query:o,page:s=1})=>`${(0,e.getAPI)()}/get-unsplash?query=${o}&per_page=20&page=${s}&KEY=${(0,n.getKey)()}`,unsplashDownload:o=>`${(0,e.getAPI)()}/download-unsplash?id=${o}&KEY=${(0,n.getKey)()}`,svgapiList:({query:o,page:s=0})=>`${(0,e.getAPI)()}/get-svgapi?query=${o}&page=${s}&per_page=20&KEY=${(0,n.getKey)()}`,svgapiDownload:o=>`${(0,e.getAPI)()}/download-svgapi?path=${o}&KEY=${(0,n.getKey)()}`,iconscoutList:({query:o,page:s=1})=>(r("iconscout",a),`${(0,e.getAPI)()}/get-iconscout?query=${o}&page=${s}&KEY=${(0,n.getKey)()}`),iconscoutDownload:o=>(r("iconscout",a),`${(0,e.getAPI)()}/download-iconscout?uuid=${o}&KEY=${(0,n.getKey)()}`),nounProjectList:({query:o,page:s=1})=>`${(0,e.getAPI)()}/get-nounproject?query=${o}&page=${s}&KEY=${(0,n.getKey)()}`,nounProjectDownload:o=>`${(0,e.getAPI)()}/download-nounproject?id=${o}&KEY=${(0,n.getKey)()}`,templateList:({query:o,page:s=1,sizeQuery:c})=>`${(0,e.getAPI)()}/get-templates?${c}&query=${o}&per_page=30&page=${s}&KEY=${(0,n.getKey)()}`,googleFontsList:()=>`${(0,e.getAPI)()}/get-google-fonts?KEY=${(0,n.getKey)()}`,googleFontImage:o=>{return`${e.URL}/google-fonts-previews/black/${s=o,s.replace(new RegExp(" ","g"),"-")}.png`;var s},textTemplateList:()=>`${(0,e.getAPI)()}/get-text-templates?KEY=${(0,n.getKey)()}`,removeBackground:()=>`${(0,e.getAPI)()}/remove-image-background?KEY=${(0,n.getKey)()}`,aiText:()=>`${(0,e.getAPI)()}/ai/text?KEY=${(0,n.getKey)()}`},e.getGoogleFontsListAPI=()=>e.URLS.googleFontsList(),e.getGoogleFontImage=o=>e.URLS.googleFontImage(o),e.polotnoShapesList=()=>`${(0,e.getAPI)()}/get-basic-shapes?KEY=${(0,n.getKey)()}`,e.removeBackground=()=>e.URLS.removeBackground(),e.templateList=o=>e.URLS.templateList(o),e.textTemplateList=()=>e.URLS.textTemplateList(),e.unsplashList=o=>e.URLS.unsplashList(o),e.unsplashDownload=o=>e.URLS.unsplashDownload(o),e.svgapiList=o=>e.URLS.svgapiList(o),e.svgapiDownload=o=>e.URLS.svgapiDownload(o),e.iconscoutList=o=>e.URLS.iconscoutList(o),e.iconscoutDownload=o=>e.URLS.iconscoutDownload(o),e.setAPI=(o,s)=>{e.URLS[o]=s}}(b1)),b1}var A3;function Jv(){return A3||(A3=1,function(e){var n,t=Go&&Go.__createBinding||(Object.create?function(I,F,k,O){O===void 0&&(O=k);var N=Object.getOwnPropertyDescriptor(F,k);N&&!("get"in N?!F.__esModule:N.writable||N.configurable)||(N={enumerable:!0,get:function(){return F[k]}}),Object.defineProperty(I,O,N)}:function(I,F,k,O){O===void 0&&(O=k),I[O]=F[k]}),r=Go&&Go.__setModuleDefault||(Object.create?function(I,F){Object.defineProperty(I,"default",{enumerable:!0,value:F})}:function(I,F){I.default=F}),a=Go&&Go.__importStar||(n=function(I){return n=Object.getOwnPropertyNames||function(F){var k=[];for(var O in F)Object.prototype.hasOwnProperty.call(F,O)&&(k[k.length]=O);return k},n(I)},function(I){if(I&&I.__esModule)return I;var F={};if(I!=null)for(var k=n(I),O=0;O<k.length;O++)k[O]!=="default"&&t(F,I,k[O]);return r(F,I),F});Object.defineProperty(e,"__esModule",{value:!0}),e.__=e.getKey=e.isCreditVisible=e.___=void 0,e.isKeyPaid=T,e.validateKey=async function(I,F){y=I,await T(I)&&!F||v()};const o=a(Xi),s=gP(),c=Jl(),m=o.observable({value:!1}),f=o.observable({value:"v1"});e.___=()=>f.value,e.isCreditVisible=()=>m.value;const v=o.action(()=>{m.value=!0});let y="";e.getKey=()=>y||"";const E=5,w=3e3,S="Polotno API is initialized without API key. It may lead to unexpected behavior and stop working. Please create API key here: https://polotno.com/cabinet",x="Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet",_="Can not validate Polotno API key. Please report to anton@polotno.com immediately.",b="%cPolotno Free Version. Development or non-commercial usage only. https://polotno.com/";let g=window.location.origin;const h=navigator.userAgent.indexOf("Headless")>-1,d=navigator.userAgent.indexOf("Electron")>-1;g==="file://"&&h&&(g="headless"),g==="file://"&&d&&(g="electron");const P=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${g}" here: https://polotno.com/cabinet`;let M=fetch;async function T(I){for(let F=0;F<E;F++)try{const k=await M((0,s.getAPI)()+"/validate-key",{method:"POST",body:JSON.stringify({key:I,site:location.host,skdVersion:"2.21.5"})});if(f.value=k.headers.get("x-api-version"),!I)return console.warn(S),!1;if(k.status!==200){await new Promise(N=>setTimeout(N,w));continue}const O=await k.json();return O.is_valid||console.warn(x),O.is_paid||console.log(b,"background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),O.is_domain_valid||console.log(P,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),(0,c.useRemoveBackground)(O.remove_background_enabled),O.is_paid||!1}catch{await new Promise(O=>setTimeout(O,w))}return console.error(_),!0}e.__=I=>{M=I}}(Go)),Go}var w1={},T3;function em(){return T3||(T3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pxToUnitString=e.unitToPx=e.pxToUnitRounded=e.pxToUnit=void 0,e.pxToUnit=({px:n,unit:t="px",dpi:r})=>{switch(t){case"pt":default:return n;case"mm":return n/(r/25.4);case"cm":return n/(r/2.54);case"in":return n/r}},e.pxToUnitRounded=({px:n,precious:t=2,dpi:r=72,unit:a="px"})=>parseFloat((0,e.pxToUnit)({px:n,dpi:r,unit:a}).toFixed(t)),e.unitToPx=({unitVal:n,dpi:t,unit:r})=>n/(0,e.pxToUnit)({px:1,unit:r,dpi:t}),e.pxToUnitString=n=>{const t=parseFloat((0,e.pxToUnit)(n).toFixed(1));switch(n.unit){case"pt":return`${Math.round(t)}pt`;case"mm":return`${t}mm`;case"cm":return`${t}cm`;case"in":return`${t}in`;default:return`${Math.round(t)}px`}}}(w1)),w1}var R3;function vP(){return R3||(R3=1,function(e){var n=Ns&&Ns.__rest||function(U,ee){var te={};for(var Q in U)Object.prototype.hasOwnProperty.call(U,Q)&&ee.indexOf(Q)<0&&(te[Q]=U[Q]);if(U!=null&&typeof Object.getOwnPropertySymbols=="function"){var Z=0;for(Q=Object.getOwnPropertySymbols(U);Z<Q.length;Z++)ee.indexOf(Q[Z])<0&&Object.prototype.propertyIsEnumerable.call(U,Q[Z])&&(te[Q[Z]]=U[Q[Z]])}return te},t=Ns&&Ns.__importDefault||function(U){return U&&U.__esModule?U:{default:U}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerNextDomDrop=e.useContextMenu=e.setTransformerStyle=void 0,e.registerTransformerAttrs=function(U,ee){k[U]=k[U]||ee,Object.assign(k[U],ee)};const r=t(Or()),a=Ri,o=Xi,s=oo,c=t(Up()),m=t(Mi()),f=t(hP()),v=Q4(),y=Wv(),E=pP(),w=Jv(),S=Ec(),x=em(),_=Jl(),b=es(),g=Gd(),h=Iv(),d=wc,P=m.default.DD._drag;window.removeEventListener("mousemove",P),m.default.DD._drag=function(U){(0,o.runInAction)(()=>{P.call(this,U)})},window.addEventListener("mousemove",m.default.DD._drag);const M=new m.default.Group,T=20;M.add(new m.default.Rect({width:T,height:T,fill:"white"})),M.add(new m.default.Path({scaleX:T/24,scaleY:T/24,data:"M4.98313549,11.0001422 C5.49589839,10.9914935 5.92501998,11.3703506 5.99116425,11.8666444 L5.99985778,11.9831355 L6.00348884,12.2068855 C6.11245031,15.4321748 8.76323537,17.9999971 11.9999971,17.9999971 C12.1869612,17.9999971 12.3726725,17.9914753 12.5567465,17.9745765 L12.2928932,17.7071068 C11.9023689,17.3165825 11.9023689,16.6834175 12.2928932,16.2928932 C12.6834175,15.9023689 13.3165825,15.9023689 13.7071068,16.2928932 L15.7071068,18.2928932 C16.0976311,18.6834175 16.0976311,19.3165825 15.7071068,19.7071068 L13.7071068,21.7071068 C13.3165825,22.0976311 12.6834175,22.0976311 12.2928932,21.7071068 C11.9023689,21.3165825 11.9023689,20.6834175 12.2928932,20.2928932 L12.6111505,19.9769552 C12.4086045,19.9922816 12.2047796,19.9999971 11.9999971,19.9999971 C7.7687005,19.9999971 4.28886152,16.7094374 4.01666425,12.5105203 L4.00420123,12.2575143 L4.00014222,12.0168645 C3.9908282,11.4646583 4.43092928,11.0094562 4.98313549,11.0001422 Z M11.7071068,2.29289322 C12.0675907,2.65337718 12.0953203,3.22060824 11.7902954,3.61289944 L11.7071068,3.70710678 L11.3891629,4.0230186 C11.5916051,4.00770767 11.7953244,4 12,4 C16.418278,4 20,7.581722 20,12 C20,12.5522847 19.5522847,13 19,13 C18.4477153,13 18,12.5522847 18,12 C18,8.6862915 15.3137085,6 12,6 C11.8129339,6 11.6271216,6.00853145 11.4429483,6.02544919 L11.7071068,6.29289322 C12.0976311,6.68341751 12.0976311,7.31658249 11.7071068,7.70710678 C11.3466228,8.06759074 10.7793918,8.09532028 10.3871006,7.79029539 L10.2928932,7.70710678 L8.29289322,5.70710678 C7.93240926,5.34662282 7.90467972,4.77939176 8.20970461,4.38710056 L8.29289322,4.29289322 L10.2928932,2.29289322 C10.6834175,1.90236893 11.3165825,1.90236893 11.7071068,2.29289322 Z",fill:"black"}));const I=M.toCanvas({pixelRatio:2,width:T,height:T}),F={enabledAnchors:["top-left","top-center","top-right","middle-left","bottom-left","bottom-right","bottom-center","middle-right"],borderEnabled:!0,rotateEnabled:!0,rotationSnaps:[0,45,90,135,180,225,270,315],ignoreStroke:!0,flipEnabled:!1,anchorStrokeWidth:2,borderStrokeWidth:2,rotateAnchorOffset:30,anchorStyleFunc:U=>{U.hasName("rotater")&&U.setAttrs({width:20,height:20,cornerRadius:20/2,offsetX:20/2,offsetY:20/2,fillPatternImage:I,fillPatternScaleX:20/T/2,fillPatternScaleY:20/T/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}};e.setTransformerStyle=U=>{Object.assign(F,U)};const k={text:{enabledAnchors:["top-left","top-right","middle-left","bottom-left","bottom-right","middle-right"]},svg:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},gif:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},line:{enabledAnchors:[],borderEnabled:!1,rotateEnabled:!1},image:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},many:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},group:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]}},O=U=>r.default.createElement(s.Rect,Object.assign({},U,{preventDefault:!1})),N=U=>{var{url:ee}=U,te=n(U,["url"]);const[Q,Z]=(0,c.default)(ee,"anonymous"),re=Q?(0,E.getCrop)(Q,{width:te.width,height:te.height},"center-middle"):{};return(0,y.useImageLoader)(Z,ee,"page background"),r.default.createElement(s.Image,Object.assign({image:Q},te,re))},A=U=>{const ee=(0,g.useColor)({fill:U.fill,a:{width:U.width,height:U.height}});return r.default.createElement(s.Rect,Object.assign({},U,ee))},R=U=>{const{background:ee,scale:te,borderColor:Q}=U,Z=n(U,["background","scale","borderColor"]),re=r.default.useMemo(()=>!!m.default.Util.colorToRGBA(ee)||(0,h.isGradient)(ee),[ee]),ne=r.default.useMemo(()=>{const ae=document.createElement("canvas"),ue=30;ae.width=60,ae.height=60;const fe=ae.getContext("2d");return fe&&(fe.fillStyle="black",fe.fillRect(ue,0,ue,ue),fe.fillRect(0,ue,ue,ue)),ae},[]);return r.default.createElement(r.default.Fragment,null,r.default.createElement(s.Rect,Object.assign({fillPatternImage:ne},Z,{opacity:.1,hideInExport:!0})),re?r.default.createElement(A,Object.assign({fill:ee},Z)):r.default.createElement(N,Object.assign({url:ee},Z)))},L=(0,a.observer)(({selection:U})=>U.visible?r.default.createElement(s.Rect,{name:"selection",x:Math.min(U.x1,U.x2),y:Math.min(U.y1,U.y2),width:Math.abs(U.x1-U.x2),height:Math.abs(U.y1-U.y2),fill:"rgba(0, 161, 255, 0.3)"}):null),V=(0,a.observer)(({x:U,y:ee,width:te,height:Q,rotation:Z,anchor:re,store:ne})=>{const ae=(0,S.getClientRect)({x:U,y:ee,width:te,height:Q,rotation:m.default.Util.radToDeg(Z)});if(re===void 0)return null;const ue=(Q/2+70)*Math.cos(Z-Math.PI/2),fe=(Q/2+70)*Math.sin(Z-Math.PI/2),pe=(0,x.pxToUnitRounded)({unit:ne.unit,dpi:ne.dpi,px:te/ne.scale,precious:ne.unit==="px"?0:1})+" x "+(0,x.pxToUnitRounded)({unit:ne.unit,dpi:ne.dpi,px:Q/ne.scale,precious:ne.unit==="px"?0:1})+(ne.unit==="px"?"":" "+ne.unit);return r.default.createElement(r.default.Fragment,null,r.default.createElement(s.Label,{x:(ae.minX+ae.maxX)/2+ue,y:(ae.minY+ae.maxY)/2+fe,offsetX:14,offsetY:14,visible:re==="rotater"},r.default.createElement(s.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)"}),r.default.createElement(s.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:Math.round(m.default.Util.radToDeg(Z)).toString()+"°"})),r.default.createElement(s.Label,{x:(ae.minX+ae.maxX)/2,y:ae.maxY+20,visible:re!=="rotater"},r.default.createElement(s.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"up",pointerHeight:0,pointerWidth:0}),r.default.createElement(s.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:pe})))}),G=(0,a.observer)(({elements:U,store:ee})=>{const te=U.filter(Z=>Z.alwaysOnTop),Q=U.filter(Z=>!Z.alwaysOnTop).concat(te);return r.default.createElement(r.default.Fragment,null,Q.map(Z=>r.default.createElement(f.default,{key:Z.id,store:ee,element:Z,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))});e.useContextMenu=({store:U})=>{const[ee,te]=r.default.useState(!1),[Q,Z]=r.default.useState({x:0,y:0});return{open:r.default.useCallback(ne=>{te(!0),Z(ne)},[]),close:r.default.useCallback(()=>{te(!1)},[]),props:{isOpen:ee,offset:Q,setIsOpen:te}}};let W=null;e.registerNextDomDrop=U=>{W=U};const X=atob("UG9sb3RubyBmcmVlIGxpY2Vuc2UgbGltaXRhdGlvbiBleGNlZWRlZCAtIFBsZWFzZSB1cGdyYWRlIHlvdXIgYWNjb3VudC4="),q=atob("cmVk"),z=atob("djAuOS4y"),Y=U=>r.default.createElement(r.default.Fragment,null,r.default.createElement(s.Label,{fill:q,height:200},r.default.createElement(s.Tag,{fill:q}),r.default.createElement(s.Text,Object.assign({},U,{fill:"white",text:X,height:void 0,padding:10,fontSize:20}))));e.default=(0,a.observer)(({store:U,page:ee,width:te,height:Q,pageControlsEnabled:Z,backColor:re,pageBorderColor:ne,activePageBorderColor:ae,components:ue,bleedColor:fe,altCloneEnabled:pe,viewportSize:ye})=>{const we=U.bleedVisible?ee.bleed:0,je=ee.computedWidth+2*we,Te=ee.computedHeight+2*we,se=(te-je*U.scale)/2,_e=(Q-Te*U.scale)/2,he=r.default.useRef(null),xe=r.default.useRef(null),oe=r.default.useRef(null),ve=Z==null||Z,[de,ke]=r.default.useState(null),[Be,Qe]=r.default.useState({}),Ke=(0,e.useContextMenu)({store:U}),St=U.selectedElements.find(ze=>ze._cropModeEnabled),Ue=U.selectedShapes.filter(ze=>!ze.resizable).length>0,rt=U.selectedShapes.filter(ze=>!ze.draggable).length>0,gt=U.selectedElements.filter(ze=>!ze.visible).length>0;r.default.useLayoutEffect(()=>{var ze,at,Pe;if(!he.current)return;const me=he.current.getStage(),He=U.selectedShapes.map(Ye=>Ye._cropModeEnabled?null:me.findOne("#"+Ye.id)).filter(Ye=>Ye),Me=U.selectedElements.length===1&&((ze=U.selectedElements[0])===null||ze===void 0?void 0:ze.type)||"many";k[Me]?(he.current.setAttrs(Object.assign(Object.assign({},F),k[Me])),Me!=="svg"&&Me!=="image"&&Me!=="gif"||U.selectedElements[0].keepRatio||he.current.setAttrs({enabledAnchors:F.enabledAnchors}),Me==="text"&&_.flags.textVerticalResizeEnabled&&he.current.setAttrs({enabledAnchors:(at=k.text.enabledAnchors)===null||at===void 0?void 0:at.concat(["bottom-center"])})):he.current.setAttrs(F),Ue&&he.current.enabledAnchors([]),rt&&he.current.rotateEnabled(!1),He.find(Ye=>Ye==null?void 0:Ye.isDragging())&&He.forEach(Ye=>{Ye.isDragging()||Ye==null||Ye.startDrag()}),he.current.nodes(He),(Pe=he.current.getLayer())===null||Pe===void 0||Pe.batchDraw()},[U.selectedShapes,St,Ue,gt,rt]);const mt=(0,a.useLocalObservable)(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),kt=r.default.useRef(!1),jt=(0,b.isTouchDevice)(),Oe=(0,o.action)(ze=>{var at,Pe,me,He;if(jt)return;kt.current=!1;const Me=ze.target.findAncestor(".elements-container"),Ye=ze.target.findAncestor("Transformer"),et=ze.target.findAncestor(".page-abs-container");if(Me||Ye||et)return;const ut=(at=ze.target.getStage())===null||at===void 0?void 0:at.getPointerPosition();ut.x-=(Pe=ze.target.getStage())===null||Pe===void 0?void 0:Pe.x(),ut.y-=(me=ze.target.getStage())===null||me===void 0?void 0:me.y(),ut&&(mt.visible=!0,mt.x1=ut.x,mt.y1=ut.y,mt.x2=ut.x,mt.y2=ut.y,((He=ze.target.getStage())===null||He===void 0?void 0:He.getPointersPositions().length)>=2&&(mt.visible=!1))});(({stageRef:ze,containerRef:at,viewportSize:Pe})=>{r.default.useEffect(()=>{var me;const He=(me=at.current)===null||me===void 0?void 0:me.closest(".polotno-workspace-inner");function Me(){var Ye;if(!ze.current)return;const et=(Ye=at.current)===null||Ye===void 0?void 0:Ye.getBoundingClientRect(),ut=He==null?void 0:He.getBoundingClientRect(),wt=Math.max(0,ut.left-et.left-100),Ct=Math.max(0,ut.top-et.top-100);ze.current.position({x:-wt,y:-Ct}),ze.current.container().style.transform=`translate(${wt}px, ${Ct}px)`}return Me(),He.addEventListener("scroll",Me),()=>{He.removeEventListener("scroll",Me)}},[Pe.width,Pe.height])})({stageRef:xe,containerRef:oe,viewportSize:ye}),r.default.useEffect(()=>{const ze=(0,o.action)(Pe=>{var me,He,Me,Ye;if(!mt.visible)return;(me=xe.current)===null||me===void 0||me.setPointersPositions(Pe);let et=(He=xe.current)===null||He===void 0?void 0:He.getPointerPosition();et?(et.x-=(Me=xe.current)===null||Me===void 0?void 0:Me.x(),et.y-=(Ye=xe.current)===null||Ye===void 0?void 0:Ye.y()):et={x:mt.x2,y:mt.y2},mt.x2=et.x,mt.y2=et.y}),at=(0,o.action)(()=>{if(!mt.visible||!xe.current)return;const Pe=xe.current.findOne(".selection"),me=Pe?Pe.getClientRect():{width:0,height:0,x:0,y:0};if(me.width&&me.height){const He=[];xe.current.find(".element").forEach(Ye=>{const et=Ye.getClientRect(),ut=U.getElementById(Ye.id()),wt=ut==null?void 0:ut.draggable,Ct=ut==null?void 0:ut.selectable;m.default.Util.haveIntersection(me,et)&&wt&&Ct&&He.push(ut.top.id)});const Me=[...new Set(He)];U.selectElements(Me)}mt.visible=!1,kt.current=!0});return window.addEventListener("mousemove",ze),window.addEventListener("touchmove",ze),window.addEventListener("mouseup",at),window.addEventListener("touchend",at),()=>{window.removeEventListener("mousemove",ze),window.removeEventListener("touchmove",ze),window.removeEventListener("mouseup",at),window.removeEventListener("touchend",at)}},[]);const Se=r.default.useRef(!1);r.default.useEffect(()=>{var ze;let at;const Pe=(ze=oe.current)===null||ze===void 0?void 0:ze.closest(".polotno-workspace-inner"),me=()=>{Se.current=!0,clearTimeout(at),at=setTimeout(()=>{Se.current=!1},300)};return Pe.addEventListener("scroll",me),()=>{clearTimeout(at),Pe.removeEventListener("scroll",me)}},[]);const yt=ze=>{if(U.activePage!==ee&&ee.select(),Se.current||kt.current)return;const at=ze.evt.ctrlKey||ze.evt.metaKey||ze.evt.shiftKey,Pe=ze.target.findAncestor(".elements-container"),me=ze.target.findAncestor(".page-abs-container"),He=ze.target.findAncestor("Transformer");if(!(at||Pe||He||me))return void U.selectElements([]);const Me=ze.target.findAncestor(".element",!0),Ye=U.getElementById(Me==null?void 0:Me.id()),et=Ye==null?void 0:Ye.top,ut=et==null?void 0:et.id,wt=U.selectedElementsIds.indexOf(ut)>=0;ut&&at&&!wt?U.selectElements(U.selectedElementsIds.concat([ut])):ut&&at&&wt?U.selectElements(U.selectedElementsIds.filter(Ct=>Ct!==ut)):!ut||at||wt||U.selectElements([ut])};(0,v.useSnap)(he,U);const Fe=U.activePage===ee,qe=ue==null?void 0:ue.PageControls,$e=ue==null?void 0:ue.Tooltip,Et=ue==null?void 0:ue.ContextMenu,Pt=1/U.scale,ht=0/U.scale;return r.default.createElement("div",{ref:oe,onDragOver:ze=>ze.preventDefault(),onDrop:ze=>{if(ze.preventDefault(),!xe.current)return;xe.current.setPointersPositions(ze);const at=xe.current.findOne(".elements-container").getRelativePointerPosition(),Pe=xe.current.getPointerPosition(),me=xe.current.getAllIntersections(Pe).map(Ye=>Ye.findAncestor(".element",!0)).filter(Boolean),He=[...new Set(me.reverse())].map(Ye=>U.getElementById(Ye.id())),Me=He[0];W&&(W(at,Me,{elements:He,page:ee}),W=null)},style:{position:"relative",width:te+"px",height:Q+"px",overflow:"hidden"},className:"polotno-page-container"+(Fe?" active-page":"")},r.default.createElement(s.Stage,{ref:xe,width:Math.min(te,ye.width+200),height:Math.min(ye.height+200,Q),onClick:yt,onTap:yt,onContextMenu:ze=>{ze.evt.preventDefault();const at=ze.target.findAncestor(".element",!0),Pe=U.getElementById(at==null?void 0:at.id()),me=Pe==null?void 0:Pe.top,He=me==null?void 0:me.id;He?U.selectedElementsIds.indexOf(He)>=0||U.selectElements([He]):U.selectElements([]),Ke.open({x:ze.evt.clientX,y:ze.evt.clientY})},onMouseDown:Oe,onMouseMove:ze=>{if(!ze.evt.altKey&&de)return void ke(null);if(!ze.evt.altKey)return;const at=ze.target.findAncestor(".element",!0),Pe=at==null?void 0:at.id();if(!U.selectedElements[0]||U.selectedElementsIds.includes(Pe))return;const me=(0,S.getTotalClientRect)(U.selectedShapes),He=Pe?U.getElementById(Pe):{x:0,y:0,width:ee.computedWidth,height:ee.computedHeight,rotation:0},Me=(0,S.getClientRect)(He),Ye=[];me.minX>Me.maxX&&Ye.push({distance:me.minX-Me.maxX,box1:me,box2:Me,points:[{x:me.minX,y:me.minY+me.height/2},{x:Me.maxX,y:me.minY+me.height/2},{x:Me.maxX,y:Me.minY+Me.height/2}]}),me.maxX<Me.minX&&Ye.push({distance:Me.minX-me.maxX,box1:me,box2:Me,points:[{x:me.maxX,y:me.minY+me.height/2},{x:Me.minX,y:me.minY+me.height/2},{x:Me.minX,y:Me.minY+Me.height/2}]}),me.minY>Me.maxY&&Ye.push({box1:me,box2:Me,distance:me.minY-Me.maxY,points:[{x:me.minX+me.width/2,y:me.minY},{x:me.minX+me.width/2,y:Me.maxY},{x:Me.minX+Me.width/2,y:Me.maxY}]}),me.maxY<Me.minY&&Ye.push({box1:me,box2:Me,distance:Me.minY-me.maxY,points:[{x:me.minX+me.width/2,y:me.maxY},{x:me.minX+me.width/2,y:Me.minY},{x:Me.minX+Me.width/2,y:Me.minY}]}),me.minX>=Me.minX&&me.maxX<=Me.maxX&&me.minY>=Me.minY&&me.maxY<=Me.maxY&&(Ye.push({distance:me.minX-Me.minX,box1:me,box2:Me,points:[{x:me.minX,y:me.minY+me.height/2},{x:Me.minX,y:me.minY+me.height/2},{x:Me.minX,y:Me.minY+Me.height/2}]}),Ye.push({distance:Me.maxX-me.maxX,box1:me,box2:Me,points:[{x:me.maxX,y:me.minY+me.height/2},{x:Me.maxX,y:me.minY+me.height/2},{x:Me.maxX,y:Me.minY+Me.height/2}]}),Ye.push({box1:me,box2:Me,distance:me.minY-Me.minY,points:[{x:me.minX+me.width/2,y:me.minY},{x:me.minX+me.width/2,y:Me.minY},{x:Me.minX+Me.width/2,y:Me.minY}]}),Ye.push({box1:me,box2:Me,distance:Me.maxY-me.maxY,points:[{x:me.minX+me.width/2,y:me.maxY},{x:me.minX+me.width/2,y:Me.maxY},{x:Me.minX+Me.width/2,y:Me.maxY}]})),JSON.stringify(de)!==JSON.stringify(Ye)&&ke(Ye)},onDragStart:ze=>{var at;const Pe=ze.target.findAncestor(".element",!0);if(Pe){const me=U.getElementById(Pe==null?void 0:Pe.id()),He=me==null?void 0:me.top,Me=He==null?void 0:He.id;!(U.selectedElementsIds.indexOf(Me)>=0)&&Me&&(U.selectElements([Me]),ze.target.stopDrag(),ze.target.startDrag(ze),(at=he.current)===null||at===void 0||at.startDrag(ze))}de&&ke(null)},pageId:ee.id,style:{position:"absolute",overflow:"hidden",top:0,left:0}},r.default.createElement(s.Layer,null,r.default.createElement(O,{width:te,height:Q,fill:re}),r.default.createElement(s.Group,{x:se,y:_e,scaleX:U.scale,scaleY:U.scale,name:"page-container"},r.default.createElement(s.Group,{name:"page-container-2"},r.default.createElement(s.Group,{name:"page-background-group",x:we,y:we},r.default.createElement(R,{x:-ee.bleed,y:-ee.bleed,width:ee.computedWidth+2*ee.bleed,height:ee.computedHeight+2*ee.bleed,background:ee.background,name:"page-background",preventDefault:!1,scale:U.scale})),r.default.createElement(s.Group,{x:we,y:we,name:"elements-container",listening:!U.isPlaying},r.default.createElement(s.Rect,{name:"elements-area",width:ee.computedWidth,height:ee.computedHeight,listening:!1}),r.default.createElement(G,{elements:ee.children,store:U})),r.default.createElement(s.Rect,{stroke:fe,name:"bleed",strokeWidth:ee.bleed,x:ee.bleed/2,y:ee.bleed/2,width:ee.computedWidth+ee.bleed,height:ee.computedHeight+ee.bleed,listening:!1,visible:ee.bleed>0&&U.bleedVisible,hideInExport:!0}),(0,w.___)()===z&&r.default.createElement(Y,{name:"hit-detection",x:-Pt/2-ht,y:-Pt/2-ht,width:je+Pt+2*ht,height:Te+Pt+2*ht}))),r.default.createElement(s.Line,{name:"workspace-background",points:[0,0,te,0,te,Q,0,Q,0,0,se,_e,se,Q-_e,te-se,Q-_e,te-se,_e,se,_e],listening:!1,closed:!0,fill:re}),r.default.createElement(s.Group,{x:se,y:_e,scaleX:U.scale,scaleY:U.scale},r.default.createElement(s.Rect,{name:"page-highlight",hideInExport:!0,x:-Pt/2-ht,y:-Pt/2-ht,width:je+Pt+2*ht,height:Te+Pt+2*ht,stroke:Fe&&U.pages.length>1?ae:ne,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),r.default.createElement(s.Group,{x:se+we*U.scale,y:_e+we*U.scale,scaleX:U.scale,scaleY:U.scale,name:"page-abs-container"},r.default.createElement(s.Transformer,{ref:he,onDragStart:ze=>{var at;!((at=ze.evt)===null||at===void 0)&&at.altKey&&pe&&U.selectedElements.forEach(Pe=>{const me=Pe.clone({},{skipSelect:!0}),He=ee.children.indexOf(Pe);ee.setElementZIndex(me.id,He)}),U.history.startTransaction()},onDragEnd:()=>{U.history.endTransaction()},onTransformStart:()=>{U.history.startTransaction()},boundBoxFunc:(ze,at)=>{const Pe=Math.abs(at.width)<1||Math.abs(at.height)<1,me=Math.abs(ze.width)<1||Math.abs(ze.height)<1;return Pe&&!me?ze:at},onTransform:ze=>{var at,Pe;const me=he.current.nodes(),He=me[me.length-1];if(ze.target!==He)return;const Me=(at=he.current)===null||at===void 0?void 0:at.__getNodeRect(),Ye=(Pe=he.current)===null||Pe===void 0?void 0:Pe.getActiveAnchor();Qe({anchor:Ye,x:Me.x,y:Me.y,rotation:Me.rotation,width:Me.width,height:Me.height})},onTransformEnd:ze=>{Qe({}),U.history.endTransaction()},visible:!U.isPlaying}),de&&de.map(({points:ze,distance:at,box1:Pe,box2:me},He)=>r.default.createElement(s.Group,{name:"distances-container",hideInExport:!0,key:He,listening:!1},r.default.createElement(s.Rect,Object.assign({},Pe,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),r.default.createElement(s.Rect,Object.assign({},me,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),r.default.createElement(s.Line,{points:[ze[0].x,ze[0].y,ze[1].x,ze[1].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),r.default.createElement(s.Line,{points:[ze[1].x,ze[1].y,ze[2].x,ze[2].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),r.default.createElement(s.Label,{x:(ze[0].x+ze[1].x)/2,y:(ze[0].y+ze[1].y)/2,offsetY:-10,scaleX:1/U.scale,scaleY:1/U.scale},r.default.createElement(s.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"down"}),r.default.createElement(s.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:5,text:(0,x.pxToUnitString)({unit:U.unit,dpi:U.dpi,px:at})})))),ee._rendering&&r.default.createElement(s.Group,null,r.default.createElement(s.Rect,{width:je,height:Te,fill:"rgba(255,255,255,0.9)"}),r.default.createElement(s.Text,{text:"Rendering...",fontSize:60,width:je,height:Te,align:"center",verticalAlign:"middle"})),$e&&r.default.createElement($e,{components:ue,store:U,page:ee,stageRef:xe}),Et&&r.default.createElement(d.Html,null,r.default.createElement(Et,Object.assign({components:ue,store:U},Ke.props)))),r.default.createElement(V,Object.assign({},Be,{store:U})),r.default.createElement(L,{selection:mt}),(0,w.isCreditVisible)()&&r.default.createElement(s.Text,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:te-170,y:Q-18,onMouseEnter:ze=>{ze.target.getStage().container().style.cursor="pointer"},onMouseLeave:ze=>{ze.target.getStage().container().style.cursor=""},onTouchStart:ze=>{ze.cancelBubble=!0},onMouseDown:ze=>{ze.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),r.default.createElement(s.Group,{name:"line-guides"}))),ve&&qe&&r.default.createElement(qe,{store:U,page:ee,xPadding:se,yPadding:_e}))})}(Ns)),Ns}var wd={},M3;function mP(){return M3||(M3=1,function(e){var n=wd&&wd.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(e,"__esModule",{value:!0}),e.TopRules=void 0,e.LeftRules=function(){return t.default.createElement("div",null,t.default.createElement("h1",null,"Top rules"))};const t=n(Or()),r=Ec(),a=em(),o=Ri,s=Z4(),c=(0,s.styled)("div",t.default.forwardRef)`
|
|
265
265
|
position: absolute;
|
|
266
266
|
top: 0;
|
|
267
267
|
left: 0;
|
|
@@ -299,7 +299,7 @@ https://polotno.com/docs/server-api`;e.URLS={unsplashList:({query:o,page:s=1})=>
|
|
|
299
299
|
transform: rotate(90deg);
|
|
300
300
|
transform-origin: left top;
|
|
301
301
|
overflow: hidden;
|
|
302
|
-
`,E=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4];e.TopRules=(0,o.observer)(({store:w,width:S,height:x})=>{const _=t.default.useRef(null);if(!w.activePage)return null;const b=w.activePage,g=(w.bleedVisible&&b.bleed,b.computedWidth*w.scale),h=b.computedHeight*w.scale,d=(S-g)/2,P=(M=O=>(0,a.unitToPx)({unitVal:O,dpi:w.dpi,unit:w.unit})*w.scale,E.find(O=>M(O)>30)||1e4);var M;const T=(0,a.unitToPx)({unitVal:P,dpi:w.dpi,unit:w.unit})*w.scale,I=Math.round(g/T)+1,F=Math.round(h/T)+1,k=(0,r.getTotalClientRect)(w.selectedShapes);return t.default.createElement(c,{ref:_,className:"polotno-rulers"},t.default.createElement(m,{style:{width:S+"px"},className:"polotno-x-ruler"},[...Array(I)].map((O,N)=>t.default.createElement(v,{key:N,style:{left:d+N*T+"px",width:T+"px"}},w.unit==="px"||P>=1?Math.round(P*N):(P*N).toFixed(1))),!!w.selectedShapes.length&&t.default.createElement("div",{style:{position:"absolute",left:d+k.x*w.scale+"px",height:"14px",width:k.width*w.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),w.pages.map((O,N)=>{var A;const R=O.computedHeight*w.scale,L=(x-R)/2;return t.default.createElement(f,{key:O.id,style:{height:x+"px"},className:"polotno-y-ruler"},[...Array(F)].map((V,G)=>t.default.createElement(y,{key:G,style:{top:L+G*T-14+"px",width:T+"px"}},w.unit==="px"||P>=1?Math.round(P*G):(P*G).toFixed(1))),((A=w.selectedShapes[0])===null||A===void 0?void 0:A.page)===O&&t.default.createElement("div",{style:{position:"absolute",top:L+k.y*w.scale-14+"px",width:"14px",height:k.height*w.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))})}(wd)),wd}var _d={},L3;function yP(){return L3||(L3=1,function(e){var n=_d&&_d.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0}),e.AudioElement=void 0;const t=n(Or()),r=Ri,a=Xi;e.AudioElement=(0,r.observer)(({audio:o,store:s})=>{const[c,m]=function(f){const[v,y]=t.default.useState(null),[E,w]=t.default.useState("loading");return t.default.useEffect(()=>{const S=new Audio(f),x=()=>{w("loaded"),y(S)},_=()=>{w("failed"),y(null)};return S.addEventListener("canplay",x),S.addEventListener("error",_),()=>{S.removeEventListener("canplay",x),S.removeEventListener("error",_)}},[f]),[v,E]}(o.src);return t.default.useEffect(()=>{c&&s.history.ignore(()=>{o.set({duration:1e3*c.duration})})},[c,o,s.history]),t.default.useEffect(()=>{if(!c)return;const f=()=>{c.currentTime=o.startTime*o.duration/1e3},v=()=>{const E=o.endTime*o.duration/1e3;c.currentTime>=E&&(c.pause(),c.currentTime=o.startTime*o.duration/1e3)};c.addEventListener("ended",f),c.addEventListener("timeupdate",v);const y=(0,a.autorun)(()=>{const E=s.animatedElementsIds;if(E.length&&!E.includes(o.id))return;const w=s.currentTime-o.delay,S=o.duration*(o.endTime-o.startTime),x=w>=0&&w<S;if(!s.isPlaying||s.animatedElementsIds.length!==0||!x)return void c.pause();c.volume=o.volume,c.paused&&c.play();const _=w%S/1e3+o.startTime*o.duration/1e3,b=c.currentTime;Math.abs(b-_)>.5&&_!==b&&(c.currentTime=_)});return()=>{c.pause(),c.removeEventListener("ended",f),c.removeEventListener("timeupdate",v),y()}},[s.isPlaying,o.startTime,o.endTime,o.volume,c]),null})}(_d)),_d}var _1={},S1={},Sd={};let bP="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",r_=e=>crypto.getRandomValues(new Uint8Array(e)),n_=(e,n,t)=>{let r=(2<<Math.log(e.length-1)/Math.LN2)-1,a=-~(1.6*r*n/e.length);return(o=n)=>{let s="";for(;;){let c=t(a),m=a;for(;m--;)if(s+=e[c[m]&r]||"",s.length===o)return s}}},wP=(e,n=21)=>n_(e,n,r_),_P=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((n,t)=>(t&=63,t<36?n+=t.toString(36):t<62?n+=(t-26).toString(36).toUpperCase():t>62?n+="-":n+="_",n),"");const SP=Object.freeze(Object.defineProperty({__proto__:null,customAlphabet:wP,customRandom:n_,nanoid:_P,random:r_,urlAlphabet:bP},Symbol.toStringTag,{value:"Module"})),Yp=Yl(SP);var E1={},Oi={},x1={},O1={},N3;function i_(){return N3||(N3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.deepEqual=void 0,e.deepEqual=function(n,t){if(n===t)return!0;if(typeof n=="object"&&n!=null&&typeof t=="object"&&t!=null){if(Object.keys(n).length!=Object.keys(t).length)return!1;for(var r in n)if(!t.hasOwnProperty(r)||!(0,e.deepEqual)(n[r],t[r]))return!1;return!0}return!1}}(O1)),O1}var I3;function EP(){return I3||(I3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UndoManager=void 0;const n=Zi,t=i_();Object.assign(n.types),e.UndoManager=n.types.model("UndoManager",{history:n.types.array(n.types.frozen()),undoIdx:-1,targetPath:""}).views(r=>({get canUndo(){return r.undoIdx>0},get canRedo(){return r.undoIdx<r.history.length-1}})).actions(r=>{let a,o,s=!1,c=null,m=0,f=0;const v=()=>f>0;function y(){const w=(0,n.getSnapshot)(a);return{pages:w.pages,width:w.width,height:w.height,custom:w.custom}}function E(w){const S=a.pages.map(g=>g.id),x=w.pages.map(g=>g.id),_=!(0,t.deepEqual)(S,x),b=!(0,t.deepEqual)(a.custom,w.custom);_?(0,n.applySnapshot)(a.pages,w.pages):a.pages.forEach((g,h)=>{(0,n.applySnapshot)(g,w.pages[h])}),b&&a.set({custom:w.custom}),a.setSize(w.width,w.height)}return{startTransaction(){f++},endTransaction(w){f--,w||this.requestAddState(y())},async ignore(w,S=!1,x=!1){x&&await new Promise(d=>setTimeout(d,10)),m&&r.addUndoState();let _=v();r.startTransaction();let b=f;try{await w()}catch(d){setTimeout(()=>{throw d})}const g=b!==f,h=!g;r.endTransaction(h),S||_||r.replaceState(),g||(clearTimeout(m),m=0)},async transaction(w){await r.ignore(w,!0),this.addUndoState()},requestAddState(w){c=w,m||v()||(s?s=!1:m=setTimeout(()=>{m=0,clearTimeout(m),v()||this.addUndoState()},100))},addUndoState(){if(s)return void(s=!1);const w=r.history[r.undoIdx];!(0,t.deepEqual)(c,w)&&(clearTimeout(m),m=0,r.history.splice(r.undoIdx+1),r.history.push(c),r.undoIdx=r.history.length-1)},afterCreate(){if(a=(0,n.resolvePath)(r,".."),!a)throw new Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment");o=(0,n.onSnapshot)(a,()=>{this.requestAddState(y())}),r.history.length===0&&this.requestAddState(y())},clear(){clearTimeout(m),m=0,r.history.splice(0,r.history.length),r.undoIdx=-1,r.addUndoState(y())},beforeDestroy(){o()},undo(){m&&this.addUndoState(),r.canUndo?(r.undoIdx--,s=!0,E(r.history[r.undoIdx])):console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.")},redo(){m&&this.addUndoState(),r.canRedo?(r.undoIdx++,s=!0,E(r.history[r.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){r.history[r.undoIdx]=y()}}}),e.default=e.UndoManager}(x1)),x1}var P1={},j3;function xP(){return j3||(j3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.downloadFile=async function(n,t){const r=await(await fetch(n)).blob(),a=document.createElement("a"),o=URL.createObjectURL(r);a.href=o,a.download=t,document.body.appendChild(a),a.click(),setTimeout(function(){document.body.removeChild(a),window.URL.revokeObjectURL(o)},0)}}(P1)),P1}var C1={},D3;function OP(){return D3||(D3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsPDF=function(){return t?Promise.resolve(t):new Promise(r=>{var a=document.createElement("script");a.onload=function(){t=window.jspdf.jsPDF,r(t)},a.src=n,document.head.appendChild(a)})};const n="https://
|
|
302
|
+
`,E=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4];e.TopRules=(0,o.observer)(({store:w,width:S,height:x})=>{const _=t.default.useRef(null);if(!w.activePage)return null;const b=w.activePage,g=(w.bleedVisible&&b.bleed,b.computedWidth*w.scale),h=b.computedHeight*w.scale,d=(S-g)/2,P=(M=O=>(0,a.unitToPx)({unitVal:O,dpi:w.dpi,unit:w.unit})*w.scale,E.find(O=>M(O)>30)||1e4);var M;const T=(0,a.unitToPx)({unitVal:P,dpi:w.dpi,unit:w.unit})*w.scale,I=Math.round(g/T)+1,F=Math.round(h/T)+1,k=(0,r.getTotalClientRect)(w.selectedShapes);return t.default.createElement(c,{ref:_,className:"polotno-rulers"},t.default.createElement(m,{style:{width:S+"px"},className:"polotno-x-ruler"},[...Array(I)].map((O,N)=>t.default.createElement(v,{key:N,style:{left:d+N*T+"px",width:T+"px"}},w.unit==="px"||P>=1?Math.round(P*N):(P*N).toFixed(1))),!!w.selectedShapes.length&&t.default.createElement("div",{style:{position:"absolute",left:d+k.x*w.scale+"px",height:"14px",width:k.width*w.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),w.pages.map((O,N)=>{var A;const R=O.computedHeight*w.scale,L=(x-R)/2;return t.default.createElement(f,{key:O.id,style:{height:x+"px"},className:"polotno-y-ruler"},[...Array(F)].map((V,G)=>t.default.createElement(y,{key:G,style:{top:L+G*T-14+"px",width:T+"px"}},w.unit==="px"||P>=1?Math.round(P*G):(P*G).toFixed(1))),((A=w.selectedShapes[0])===null||A===void 0?void 0:A.page)===O&&t.default.createElement("div",{style:{position:"absolute",top:L+k.y*w.scale-14+"px",width:"14px",height:k.height*w.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))})}(wd)),wd}var _d={},L3;function yP(){return L3||(L3=1,function(e){var n=_d&&_d.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0}),e.AudioElement=void 0;const t=n(Or()),r=Ri,a=Xi;e.AudioElement=(0,r.observer)(({audio:o,store:s})=>{const[c,m]=function(f){const[v,y]=t.default.useState(null),[E,w]=t.default.useState("loading");return t.default.useEffect(()=>{const S=new Audio(f),x=()=>{w("loaded"),y(S)},_=()=>{w("failed"),y(null)};return S.addEventListener("canplay",x),S.addEventListener("error",_),()=>{S.removeEventListener("canplay",x),S.removeEventListener("error",_)}},[f]),[v,E]}(o.src);return t.default.useEffect(()=>{c&&s.history.ignore(()=>{o.set({duration:1e3*c.duration})})},[c,o,s.history]),t.default.useEffect(()=>{if(!c)return;const f=()=>{c.currentTime=o.startTime*o.duration/1e3},v=()=>{const E=o.endTime*o.duration/1e3;c.currentTime>=E&&(c.pause(),c.currentTime=o.startTime*o.duration/1e3)};c.addEventListener("ended",f),c.addEventListener("timeupdate",v);const y=(0,a.autorun)(()=>{const E=s.animatedElementsIds;if(E.length&&!E.includes(o.id))return;const w=s.currentTime-o.delay,S=o.duration*(o.endTime-o.startTime),x=w>=0&&w<S;if(!s.isPlaying||s.animatedElementsIds.length!==0||!x)return void c.pause();c.volume=o.volume,c.paused&&c.play();const _=w%S/1e3+o.startTime*o.duration/1e3,b=c.currentTime;Math.abs(b-_)>.5&&_!==b&&(c.currentTime=_)});return()=>{c.pause(),c.removeEventListener("ended",f),c.removeEventListener("timeupdate",v),y()}},[s.isPlaying,o.startTime,o.endTime,o.volume,c]),null})}(_d)),_d}var _1={},S1={},Sd={};let bP="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",r_=e=>crypto.getRandomValues(new Uint8Array(e)),n_=(e,n,t)=>{let r=(2<<Math.log(e.length-1)/Math.LN2)-1,a=-~(1.6*r*n/e.length);return(o=n)=>{let s="";for(;;){let c=t(a),m=a;for(;m--;)if(s+=e[c[m]&r]||"",s.length===o)return s}}},wP=(e,n=21)=>n_(e,n,r_),_P=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((n,t)=>(t&=63,t<36?n+=t.toString(36):t<62?n+=(t-26).toString(36).toUpperCase():t>62?n+="-":n+="_",n),"");const SP=Object.freeze(Object.defineProperty({__proto__:null,customAlphabet:wP,customRandom:n_,nanoid:_P,random:r_,urlAlphabet:bP},Symbol.toStringTag,{value:"Module"})),Yp=Yl(SP);var E1={},Oi={},x1={},O1={},N3;function i_(){return N3||(N3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.deepEqual=void 0,e.deepEqual=function(n,t){if(n===t)return!0;if(typeof n=="object"&&n!=null&&typeof t=="object"&&t!=null){if(Object.keys(n).length!=Object.keys(t).length)return!1;for(var r in n)if(!t.hasOwnProperty(r)||!(0,e.deepEqual)(n[r],t[r]))return!1;return!0}return!1}}(O1)),O1}var I3;function EP(){return I3||(I3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UndoManager=void 0;const n=Zi,t=i_();Object.assign(n.types),e.UndoManager=n.types.model("UndoManager",{history:n.types.array(n.types.frozen()),undoIdx:-1,targetPath:""}).views(r=>({get canUndo(){return r.undoIdx>0},get canRedo(){return r.undoIdx<r.history.length-1}})).actions(r=>{let a,o,s=!1,c=null,m=0,f=0;const v=()=>f>0;function y(){const w=(0,n.getSnapshot)(a);return{pages:w.pages,width:w.width,height:w.height,custom:w.custom}}function E(w){const S=a.pages.map(g=>g.id),x=w.pages.map(g=>g.id),_=!(0,t.deepEqual)(S,x),b=!(0,t.deepEqual)(a.custom,w.custom);_?(0,n.applySnapshot)(a.pages,w.pages):a.pages.forEach((g,h)=>{(0,n.applySnapshot)(g,w.pages[h])}),b&&a.set({custom:w.custom}),a.setSize(w.width,w.height)}return{startTransaction(){f++},endTransaction(w){f--,w||this.requestAddState(y())},async ignore(w,S=!1,x=!1){x&&await new Promise(d=>setTimeout(d,10)),m&&r.addUndoState();let _=v();r.startTransaction();let b=f;try{await w()}catch(d){setTimeout(()=>{throw d})}const g=b!==f,h=!g;r.endTransaction(h),S||_||r.replaceState(),g||(clearTimeout(m),m=0)},async transaction(w){await r.ignore(w,!0),this.addUndoState()},requestAddState(w){c=w,m||v()||(s?s=!1:m=setTimeout(()=>{m=0,clearTimeout(m),v()||this.addUndoState()},100))},addUndoState(){if(s)return void(s=!1);const w=r.history[r.undoIdx];!(0,t.deepEqual)(c,w)&&(clearTimeout(m),m=0,r.history.splice(r.undoIdx+1),r.history.push(c),r.undoIdx=r.history.length-1)},afterCreate(){if(a=(0,n.resolvePath)(r,".."),!a)throw new Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment");o=(0,n.onSnapshot)(a,()=>{this.requestAddState(y())}),r.history.length===0&&this.requestAddState(y())},clear(){clearTimeout(m),m=0,r.history.splice(0,r.history.length),r.undoIdx=-1,r.addUndoState(y())},beforeDestroy(){o()},undo(){m&&this.addUndoState(),r.canUndo?(r.undoIdx--,s=!0,E(r.history[r.undoIdx])):console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.")},redo(){m&&this.addUndoState(),r.canRedo?(r.undoIdx++,s=!0,E(r.history[r.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){r.history[r.undoIdx]=y()}}}),e.default=e.UndoManager}(x1)),x1}var P1={},j3;function xP(){return j3||(j3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.downloadFile=async function(n,t){const r=await(await fetch(n)).blob(),a=document.createElement("a"),o=URL.createObjectURL(r);a.href=o,a.download=t,document.body.appendChild(a),a.click(),setTimeout(function(){document.body.removeChild(a),window.URL.revokeObjectURL(o)},0)}}(P1)),P1}var C1={},D3;function OP(){return D3||(D3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsPDF=function(){return t?Promise.resolve(t):new Promise(r=>{var a=document.createElement("script");a.onload=function(){t=window.jspdf.jsPDF,r(t)},a.src=n,document.head.appendChild(a)})};const n="https://cdnjs.cloudflare.com/ajax/libs/jspdf/3.0.1/jspdf.umd.min.js";let t}(C1)),C1}var k1={},F3;function PP(){return F3||(F3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getGIF=t,e.createGIF=async function({width:r,height:a}){return new(await t())({workers:4,width:r,height:a,workerScript:URL.createObjectURL(new Blob([`// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js
|
|
303
303
|
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){var NeuQuant=require("./TypedNeuQuant.js");var LZWEncoder=require("./LZWEncoder.js");function ByteArray(){this.page=-1;this.pages=[];this.newPage()}ByteArray.pageSize=4096;ByteArray.charMap={};for(var i=0;i<256;i++)ByteArray.charMap[i]=String.fromCharCode(i);ByteArray.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(ByteArray.pageSize);this.cursor=0};ByteArray.prototype.getData=function(){var rv="";for(var p=0;p<this.pages.length;p++){for(var i=0;i<ByteArray.pageSize;i++){rv+=ByteArray.charMap[this.pages[p][i]]}}return rv};ByteArray.prototype.writeByte=function(val){if(this.cursor>=ByteArray.pageSize)this.newPage();this.pages[this.page][this.cursor++]=val};ByteArray.prototype.writeUTFBytes=function(string){for(var l=string.length,i=0;i<l;i++)this.writeByte(string.charCodeAt(i))};ByteArray.prototype.writeBytes=function(array,offset,length){for(var l=length||array.length,i=offset||0;i<l;i++)this.writeByte(array[i])};function GIFEncoder(width,height){this.width=~~width;this.height=~~height;this.transparent=null;this.transIndex=0;this.repeat=-1;this.delay=0;this.image=null;this.pixels=null;this.indexedPixels=null;this.colorDepth=null;this.colorTab=null;this.neuQuant=null;this.usedEntry=new Array;this.palSize=7;this.dispose=-1;this.firstFrame=true;this.sample=10;this.dither=false;this.globalPalette=false;this.out=new ByteArray}GIFEncoder.prototype.setDelay=function(milliseconds){this.delay=Math.round(milliseconds/10)};GIFEncoder.prototype.setFrameRate=function(fps){this.delay=Math.round(100/fps)};GIFEncoder.prototype.setDispose=function(disposalCode){if(disposalCode>=0)this.dispose=disposalCode};GIFEncoder.prototype.setRepeat=function(repeat){this.repeat=repeat};GIFEncoder.prototype.setTransparent=function(color){this.transparent=color};GIFEncoder.prototype.addFrame=function(imageData){this.image=imageData;this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null;this.getImagePixels();this.analyzePixels();if(this.globalPalette===true)this.globalPalette=this.colorTab;if(this.firstFrame){this.writeLSD();this.writePalette();if(this.repeat>=0){this.writeNetscapeExt()}}this.writeGraphicCtrlExt();this.writeImageDesc();if(!this.firstFrame&&!this.globalPalette)this.writePalette();this.writePixels();this.firstFrame=false};GIFEncoder.prototype.finish=function(){this.out.writeByte(59)};GIFEncoder.prototype.setQuality=function(quality){if(quality<1)quality=1;this.sample=quality};GIFEncoder.prototype.setDither=function(dither){if(dither===true)dither="FloydSteinberg";this.dither=dither};GIFEncoder.prototype.setGlobalPalette=function(palette){this.globalPalette=palette};GIFEncoder.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};GIFEncoder.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")};GIFEncoder.prototype.analyzePixels=function(){if(!this.colorTab){this.neuQuant=new NeuQuant(this.pixels,this.sample);this.neuQuant.buildColormap();this.colorTab=this.neuQuant.getColormap()}if(this.dither){this.ditherPixels(this.dither.replace("-serpentine",""),this.dither.match(/-serpentine/)!==null)}else{this.indexPixels()}this.pixels=null;this.colorDepth=8;this.palSize=7;if(this.transparent!==null){this.transIndex=this.findClosest(this.transparent,true)}};GIFEncoder.prototype.indexPixels=function(imgq){var nPix=this.pixels.length/3;this.indexedPixels=new Uint8Array(nPix);var k=0;for(var j=0;j<nPix;j++){var index=this.findClosestRGB(this.pixels[k++]&255,this.pixels[k++]&255,this.pixels[k++]&255);this.usedEntry[index]=true;this.indexedPixels[j]=index}};GIFEncoder.prototype.ditherPixels=function(kernel,serpentine){var kernels={FalseFloydSteinberg:[[3/8,1,0],[3/8,0,1],[2/8,1,1]],FloydSteinberg:[[7/16,1,0],[3/16,-1,1],[5/16,0,1],[1/16,1,1]],Stucki:[[8/42,1,0],[4/42,2,0],[2/42,-2,1],[4/42,-1,1],[8/42,0,1],[4/42,1,1],[2/42,2,1],[1/42,-2,2],[2/42,-1,2],[4/42,0,2],[2/42,1,2],[1/42,2,2]],Atkinson:[[1/8,1,0],[1/8,2,0],[1/8,-1,1],[1/8,0,1],[1/8,1,1],[1/8,0,2]]};if(!kernel||!kernels[kernel]){throw"Unknown dithering kernel: "+kernel}var ds=kernels[kernel];var index=0,height=this.height,width=this.width,data=this.pixels;var direction=serpentine?-1:1;this.indexedPixels=new Uint8Array(this.pixels.length/3);for(var y=0;y<height;y++){if(serpentine)direction=direction*-1;for(var x=direction==1?0:width-1,xend=direction==1?width:0;x!==xend;x+=direction){index=y*width+x;var idx=index*3;var r1=data[idx];var g1=data[idx+1];var b1=data[idx+2];idx=this.findClosestRGB(r1,g1,b1);this.usedEntry[idx]=true;this.indexedPixels[index]=idx;idx*=3;var r2=this.colorTab[idx];var g2=this.colorTab[idx+1];var b2=this.colorTab[idx+2];var er=r1-r2;var eg=g1-g2;var eb=b1-b2;for(var i=direction==1?0:ds.length-1,end=direction==1?ds.length:0;i!==end;i+=direction){var x1=ds[i][1];var y1=ds[i][2];if(x1+x>=0&&x1+x<width&&y1+y>=0&&y1+y<height){var d=ds[i][0];idx=index+x1+y1*width;idx*=3;data[idx]=Math.max(0,Math.min(255,data[idx]+er*d));data[idx+1]=Math.max(0,Math.min(255,data[idx+1]+eg*d));data[idx+2]=Math.max(0,Math.min(255,data[idx+2]+eb*d))}}}}};GIFEncoder.prototype.findClosest=function(c,used){return this.findClosestRGB((c&16711680)>>16,(c&65280)>>8,c&255,used)};GIFEncoder.prototype.findClosestRGB=function(r,g,b,used){if(this.colorTab===null)return-1;if(this.neuQuant&&!used){return this.neuQuant.lookupRGB(r,g,b)}var c=b|g<<8|r<<16;var minpos=0;var dmin=256*256*256;var len=this.colorTab.length;for(var i=0,index=0;i<len;index++){var dr=r-(this.colorTab[i++]&255);var dg=g-(this.colorTab[i++]&255);var db=b-(this.colorTab[i++]&255);var d=dr*dr+dg*dg+db*db;if((!used||this.usedEntry[index])&&d<dmin){dmin=d;minpos=index}}return minpos};GIFEncoder.prototype.getImagePixels=function(){var w=this.width;var h=this.height;this.pixels=new Uint8Array(w*h*3);var data=this.image;var srcPos=0;var count=0;for(var i=0;i<h;i++){for(var j=0;j<w;j++){this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];srcPos++}}};GIFEncoder.prototype.writeGraphicCtrlExt=function(){this.out.writeByte(33);this.out.writeByte(249);this.out.writeByte(4);var transp,disp;if(this.transparent===null){transp=0;disp=0}else{transp=1;disp=2}if(this.dispose>=0){disp=dispose&7}disp<<=2;this.out.writeByte(0|disp|0|transp);this.writeShort(this.delay);this.out.writeByte(this.transIndex);this.out.writeByte(0)};GIFEncoder.prototype.writeImageDesc=function(){this.out.writeByte(44);this.writeShort(0);this.writeShort(0);this.writeShort(this.width);this.writeShort(this.height);if(this.firstFrame||this.globalPalette){this.out.writeByte(0)}else{this.out.writeByte(128|0|0|0|this.palSize)}};GIFEncoder.prototype.writeLSD=function(){this.writeShort(this.width);this.writeShort(this.height);this.out.writeByte(128|112|0|this.palSize);this.out.writeByte(0);this.out.writeByte(0)};GIFEncoder.prototype.writeNetscapeExt=function(){this.out.writeByte(33);this.out.writeByte(255);this.out.writeByte(11);this.out.writeUTFBytes("NETSCAPE2.0");this.out.writeByte(3);this.out.writeByte(1);this.writeShort(this.repeat);this.out.writeByte(0)};GIFEncoder.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var n=3*256-this.colorTab.length;for(var i=0;i<n;i++)this.out.writeByte(0)};GIFEncoder.prototype.writeShort=function(pValue){this.out.writeByte(pValue&255);this.out.writeByte(pValue>>8&255)};GIFEncoder.prototype.writePixels=function(){var enc=new LZWEncoder(this.width,this.height,this.indexedPixels,this.colorDepth);enc.encode(this.out)};GIFEncoder.prototype.stream=function(){return this.out};module.exports=GIFEncoder},{"./LZWEncoder.js":2,"./TypedNeuQuant.js":3}],2:[function(require,module,exports){var EOF=-1;var BITS=12;var HSIZE=5003;var masks=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function LZWEncoder(width,height,pixels,colorDepth){var initCodeSize=Math.max(2,colorDepth);var accum=new Uint8Array(256);var htab=new Int32Array(HSIZE);var codetab=new Int32Array(HSIZE);var cur_accum,cur_bits=0;var a_count;var free_ent=0;var maxcode;var clear_flg=false;var g_init_bits,ClearCode,EOFCode;function char_out(c,outs){accum[a_count++]=c;if(a_count>=254)flush_char(outs)}function cl_block(outs){cl_hash(HSIZE);free_ent=ClearCode+2;clear_flg=true;output(ClearCode,outs)}function cl_hash(hsize){for(var i=0;i<hsize;++i)htab[i]=-1}function compress(init_bits,outs){var fcode,c,i,ent,disp,hsize_reg,hshift;g_init_bits=init_bits;clear_flg=false;n_bits=g_init_bits;maxcode=MAXCODE(n_bits);ClearCode=1<<init_bits-1;EOFCode=ClearCode+1;free_ent=ClearCode+2;a_count=0;ent=nextPixel();hshift=0;for(fcode=HSIZE;fcode<65536;fcode*=2)++hshift;hshift=8-hshift;hsize_reg=HSIZE;cl_hash(hsize_reg);output(ClearCode,outs);outer_loop:while((c=nextPixel())!=EOF){fcode=(c<<BITS)+ent;i=c<<hshift^ent;if(htab[i]===fcode){ent=codetab[i];continue}else if(htab[i]>=0){disp=hsize_reg-i;if(i===0)disp=1;do{if((i-=disp)<0)i+=hsize_reg;if(htab[i]===fcode){ent=codetab[i];continue outer_loop}}while(htab[i]>=0)}output(ent,outs);ent=c;if(free_ent<1<<BITS){codetab[i]=free_ent++;htab[i]=fcode}else{cl_block(outs)}}output(ent,outs);output(EOFCode,outs)}function encode(outs){outs.writeByte(initCodeSize);remaining=width*height;curPixel=0;compress(initCodeSize+1,outs);outs.writeByte(0)}function flush_char(outs){if(a_count>0){outs.writeByte(a_count);outs.writeBytes(accum,0,a_count);a_count=0}}function MAXCODE(n_bits){return(1<<n_bits)-1}function nextPixel(){if(remaining===0)return EOF;--remaining;var pix=pixels[curPixel++];return pix&255}function output(code,outs){cur_accum&=masks[cur_bits];if(cur_bits>0)cur_accum|=code<<cur_bits;else cur_accum=code;cur_bits+=n_bits;while(cur_bits>=8){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}if(free_ent>maxcode||clear_flg){if(clear_flg){maxcode=MAXCODE(n_bits=g_init_bits);clear_flg=false}else{++n_bits;if(n_bits==BITS)maxcode=1<<BITS;else maxcode=MAXCODE(n_bits)}}if(code==EOFCode){while(cur_bits>0){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}flush_char(outs)}}this.encode=encode}module.exports=LZWEncoder},{}],3:[function(require,module,exports){var ncycles=100;var netsize=256;var maxnetpos=netsize-1;var netbiasshift=4;var intbiasshift=16;var intbias=1<<intbiasshift;var gammashift=10;var gamma=1<<gammashift;var betashift=10;var beta=intbias>>betashift;var betagamma=intbias<<gammashift-betashift;var initrad=netsize>>3;var radiusbiasshift=6;var radiusbias=1<<radiusbiasshift;var initradius=initrad*radiusbias;var radiusdec=30;var alphabiasshift=10;var initalpha=1<<alphabiasshift;var alphadec;var radbiasshift=8;var radbias=1<<radbiasshift;var alpharadbshift=alphabiasshift+radbiasshift;var alpharadbias=1<<alpharadbshift;var prime1=499;var prime2=491;var prime3=487;var prime4=503;var minpicturebytes=3*prime4;function NeuQuant(pixels,samplefac){var network;var netindex;var bias;var freq;var radpower;function init(){network=[];netindex=new Int32Array(256);bias=new Int32Array(netsize);freq=new Int32Array(netsize);radpower=new Int32Array(netsize>>3);var i,v;for(i=0;i<netsize;i++){v=(i<<netbiasshift+8)/netsize;network[i]=new Float64Array([v,v,v,0]);freq[i]=intbias/netsize;bias[i]=0}}function unbiasnet(){for(var i=0;i<netsize;i++){network[i][0]>>=netbiasshift;network[i][1]>>=netbiasshift;network[i][2]>>=netbiasshift;network[i][3]=i}}function altersingle(alpha,i,b,g,r){network[i][0]-=alpha*(network[i][0]-b)/initalpha;network[i][1]-=alpha*(network[i][1]-g)/initalpha;network[i][2]-=alpha*(network[i][2]-r)/initalpha}function alterneigh(radius,i,b,g,r){var lo=Math.abs(i-radius);var hi=Math.min(i+radius,netsize);var j=i+1;var k=i-1;var m=1;var p,a;while(j<hi||k>lo){a=radpower[m++];if(j<hi){p=network[j++];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}if(k>lo){p=network[k--];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}}}function contest(b,g,r){var bestd=~(1<<31);var bestbiasd=bestd;var bestpos=-1;var bestbiaspos=bestpos;var i,n,dist,biasdist,betafreq;for(i=0;i<netsize;i++){n=network[i];dist=Math.abs(n[0]-b)+Math.abs(n[1]-g)+Math.abs(n[2]-r);if(dist<bestd){bestd=dist;bestpos=i}biasdist=dist-(bias[i]>>intbiasshift-netbiasshift);if(biasdist<bestbiasd){bestbiasd=biasdist;bestbiaspos=i}betafreq=freq[i]>>betashift;freq[i]-=betafreq;bias[i]+=betafreq<<gammashift}freq[bestpos]+=beta;bias[bestpos]-=betagamma;return bestbiaspos}function inxbuild(){var i,j,p,q,smallpos,smallval,previouscol=0,startpos=0;for(i=0;i<netsize;i++){p=network[i];smallpos=i;smallval=p[1];for(j=i+1;j<netsize;j++){q=network[j];if(q[1]<smallval){smallpos=j;smallval=q[1]}}q=network[smallpos];if(i!=smallpos){j=q[0];q[0]=p[0];p[0]=j;j=q[1];q[1]=p[1];p[1]=j;j=q[2];q[2]=p[2];p[2]=j;j=q[3];q[3]=p[3];p[3]=j}if(smallval!=previouscol){netindex[previouscol]=startpos+i>>1;for(j=previouscol+1;j<smallval;j++)netindex[j]=i;previouscol=smallval;startpos=i}}netindex[previouscol]=startpos+maxnetpos>>1;for(j=previouscol+1;j<256;j++)netindex[j]=maxnetpos}function inxsearch(b,g,r){var a,p,dist;var bestd=1e3;var best=-1;var i=netindex[g];var j=i-1;while(i<netsize||j>=0){if(i<netsize){p=network[i];dist=p[1]-g;if(dist>=bestd)i=netsize;else{i++;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}if(j>=0){p=network[j];dist=g-p[1];if(dist>=bestd)j=-1;else{j--;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}}return best}function learn(){var i;var lengthcount=pixels.length;var alphadec=30+(samplefac-1)/3;var samplepixels=lengthcount/(3*samplefac);var delta=~~(samplepixels/ncycles);var alpha=initalpha;var radius=initradius;var rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(i=0;i<rad;i++)radpower[i]=alpha*((rad*rad-i*i)*radbias/(rad*rad));var step;if(lengthcount<minpicturebytes){samplefac=1;step=3}else if(lengthcount%prime1!==0){step=3*prime1}else if(lengthcount%prime2!==0){step=3*prime2}else if(lengthcount%prime3!==0){step=3*prime3}else{step=3*prime4}var b,g,r,j;var pix=0;i=0;while(i<samplepixels){b=(pixels[pix]&255)<<netbiasshift;g=(pixels[pix+1]&255)<<netbiasshift;r=(pixels[pix+2]&255)<<netbiasshift;j=contest(b,g,r);altersingle(alpha,j,b,g,r);if(rad!==0)alterneigh(rad,j,b,g,r);pix+=step;if(pix>=lengthcount)pix-=lengthcount;i++;if(delta===0)delta=1;if(i%delta===0){alpha-=alpha/alphadec;radius-=radius/radiusdec;rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(j=0;j<rad;j++)radpower[j]=alpha*((rad*rad-j*j)*radbias/(rad*rad))}}}function buildColormap(){init();learn();unbiasnet();inxbuild()}this.buildColormap=buildColormap;function getColormap(){var map=[];var index=[];for(var i=0;i<netsize;i++)index[network[i][3]]=i;var k=0;for(var l=0;l<netsize;l++){var j=index[l];map[k++]=network[j][0];map[k++]=network[j][1];map[k++]=network[j][2]}return map}this.getColormap=getColormap;this.lookupRGB=inxsearch}module.exports=NeuQuant},{}],4:[function(require,module,exports){var GIFEncoder,renderFrame;GIFEncoder=require("./GIFEncoder.js");renderFrame=function(frame){var encoder,page,stream,transfer;encoder=new GIFEncoder(frame.width,frame.height);if(frame.index===0){encoder.writeHeader()}else{encoder.firstFrame=false}encoder.setTransparent(frame.transparent);encoder.setRepeat(frame.repeat);encoder.setDelay(frame.delay);encoder.setQuality(frame.quality);encoder.setDither(frame.dither);encoder.setGlobalPalette(frame.globalPalette);encoder.addFrame(frame.data);if(frame.last){encoder.finish()}if(frame.globalPalette===true){frame.globalPalette=encoder.getGlobalPalette()}stream=encoder.stream();frame.data=stream.pages;frame.cursor=stream.cursor;frame.pageSize=stream.constructor.pageSize;if(frame.canTransfer){transfer=function(){var i,len,ref,results;ref=frame.data;results=[];for(i=0,len=ref.length;i<len;i++){page=ref[i];results.push(page.buffer)}return results}();return self.postMessage(frame,transfer)}else{return self.postMessage(frame)}};self.onmessage=function(event){return renderFrame(event.data)}},{"./GIFEncoder.js":1}]},{},[4]);
|
|
304
304
|
`],{type:"application/javascript"}))})};const n="https://cdnjs.cloudflare.com/ajax/libs/gif.js/0.2.0/gif.js";function t(){return window.GIF?Promise.resolve(window.GIF):new Promise(r=>{var a=document.createElement("script");a.onload=function(){r(window.GIF)},a.src=n,document.head.appendChild(a)})}}(k1)),k1}var A1={},z3;function CP(){return z3||(z3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.waitTillAvailable=async function(n){for(let t=0;t<30;t++){const r=await n();if(r)return r;await new Promise(a=>setTimeout(a,50))}}}(A1)),A1}var ya={},T1={},B3;function Op(){return B3||(B3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getImageSize=function(r){return new Promise(a=>{const o=document.createElement("img");o.onload=async()=>{o.width===0||o.height===0?a(await(0,n.getSvgSize)(r)):a({width:o.width,height:o.height})},o.crossOrigin="anonymous",o.src=r})},e.loadImage=t,e.cropImage=async function(r,a){const o=await t(r),s=document.createElement("canvas");s.width=2*o.width,s.height=2*o.height,s.getContext("2d").drawImage(o,0,0,s.width,s.height);const c=document.createElement("canvas");c.width=a.width,c.height=a.height;const m=c.getContext("2d");let{cropX:f,cropY:v}=a;const y=s.width*a.cropWidth,E=s.height*a.cropHeight,w=a.width/a.height;let S,x;const _=y/E;return a.type==="svg"?(S=y,x=E):w>=_?(S=y,x=y/w):(S=E*w,x=E),m.drawImage(s,f*s.width,v*s.height,S,x,0,0,c.width,c.height),c.toDataURL("image/png")},e.getCrop=function(r,a){const{width:o,height:s}=r,c=o/s;let m,f;c>=a.width/a.height?(m=a.width,f=a.width/c):(m=a.height*c,f=a.height);const v=(a.width-m)/2,y=(a.height-f)/2;return{cropX:v/a.width,cropY:y/a.height,cropWidth:m/a.width,cropHeight:f/a.height}};const n=Yd();function t(r){return new Promise((a,o)=>{const s=document.createElement("img");s.onload=()=>{a(s)},s.onerror=c=>{o(c)},s.crossOrigin="anonymous",s.src=r})}}(T1)),T1}var R1={},U3;function a_(){return U3||(U3=1,function(e){var n;Object.defineProperty(e,"__esModule",{value:!0}),e.Effects=void 0,e.shapeFilterToCSS=function(t){let r={filter:"",html:void 0};switch(t){case n.warm:return r.filter="sepia(0.5) saturate(1.5) brightness(1.1) contrast(1.1)",r;case n.cold:return r.filter="url(#blue-boost)",r.html=`
|
|
305
305
|
<svg style="display: none">
|
|
@@ -323,7 +323,7 @@ https://polotno.com/docs/server-api`;e.URLS={unsplashList:({query:o,page:s=1})=>
|
|
|
323
323
|
}`}));return y("style",{},W.join(`
|
|
324
324
|
`))}catch(L){return console.error("Error embedding Google Font:",L),y("defs",{},y("style",{type:"text/css",innerHTML:`@import url('${R}');`.replace(/&/g,"&")}))}}}))}(M,h.fonts);return y("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:`0 0 ${h.width} ${h.height}`,width:h.width,height:h.height},...T,...P)}const g=({dom:h,nestLevel:d=0})=>{if(typeof h=="string")return h;if(!h)return"";const P=h.props,{innerHTML:M}=P,T=o(P,["innerHTML"]),I=" ".repeat(d);return`${I}<${h.type} ${Object.keys(T).map(F=>((k,O)=>typeof O=="object"?`${k}="${Object.keys(O).map(N=>`${N}:${O[N]};`).join(" ")}"`:O==null||O===""?"":`${k}="${O}"`)(F,T[F])).join(" ")}>${M||`
|
|
325
325
|
`+h.children.map(F=>g({dom:F,nestLevel:d+1})).join("")}${I}</${h.type}>
|
|
326
|
-
`}}(ba)),ba}var L1={},V3;function o_(){return V3||(V3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Page=void 0;const n=Zi,t=Yp,r=Id(),a=tm(),o=Id(),s=Ec();e.Page=n.types.model("Page",{id:n.types.identifier,children:n.types.array(n.types.late(()=>r.ElementTypes)),width:n.types.optional(n.types.union(n.types.number,n.types.literal("auto")),"auto"),height:n.types.optional(n.types.union(n.types.number,n.types.literal("auto")),"auto"),background:"white",bleed:0,custom:n.types.frozen(),duration:5e3,_exporting:!1,_rendering:!1,_forceMount:!1}).postProcessSnapshot(c=>{const m=Object.assign({},c),f={};for(var v in m)v[0]!=="_"&&(f[v]=c[v]);return f}).views(c=>({get store(){return(0,n.getParentOfType)(c,a.Store)}})).views(c=>({get startTime(){let m=0;for(const f of c.store.pages){if(f.id===c.id)return m;m+=f.duration}return m},get _exportingOrRendering(){return c._exporting||c._rendering}})).views(c=>({get computedWidth(){return c.width==="auto"?c.store.width:c.width},get computedHeight(){return c.height==="auto"?c.store.height:c.height}})).actions(c=>({toJSON:()=>JSON.parse(JSON.stringify((0,n.getSnapshot)(c))),_forEachElementUp(m,f){const v=m.map(y=>({id:y,index:c.children.findIndex(E=>E.id===y)}));v.sort((y,E)=>E.index-y.index);for(const{index:y}of v){if(y==-1)continue;const E=y<c.children.length-1&&c.children[y+1],w=m.indexOf(E==null?void 0:E.id)>=0;y===c.children.length-1||w||f(y)}},_forEachElementDown(m,f){const v=m.map(y=>({id:y,index:c.children.findIndex(E=>E.id===y)}));v.sort((y,E)=>y.index-E.index);for(const{index:y}of v){if(y==-1)continue;const E=y>0&&c.children[y-1],w=m.indexOf(E==null?void 0:E.id)>=0;y===0||w||f(y)}return!1}})).actions(c=>({clone(m={}){const f=c.toJSON();f.children.forEach(w=>{w.id=(0,t.nanoid)(10),(0,o.forEveryChild)(w,S=>{S.id=(0,t.nanoid)(10)})});const v=Object.assign(Object.assign(Object.assign({},f),{id:(0,t.nanoid)(10)}),m),y=c.store.addPage(v),E=c.store.pages.indexOf(c);y.setZIndex(E+1),y.select()},setZIndex(m){c.store.setPageZIndex(c.id,m)},set(m){Object.assign(c,m)},select(){c.store.selectPage(c.id)},addElement(m,{skipSelect:f=!1}={}){const v=o.TYPES_MAP[m.type];if(!v)return void console.error("Can not find model with type "+m.type);"children"in m&&Array.isArray(m.children)&&m.children.forEach(E=>{E.id=(0,t.nanoid)(10)});const y=v.create(Object.assign({id:(0,t.nanoid)(10)},m));return c.children.push(y),y.selectable&&!f&&c.store.selectElements([y.id]),y},canMoveElementsUp(m){let f=!1;return c._forEachElementUp(m,()=>{f=f||!0}),f},moveElementsUp(m){c._forEachElementUp(m,f=>{const v=c.children[f];(0,n.detach)(v),c.children.splice(f+1,0,v)})},canMoveElementsTop(m){return this.canMoveElementsUp(m)},moveElementsTop(m){const f=[],v=[];c.children.forEach(y=>{m.indexOf(y.id)>=0?f.push(y):v.push(y)}),c.children.replace(v.concat(f))},canMoveElementsDown(m){let f=!1;return c._forEachElementDown(m,()=>{f=f||!0}),f},moveElementsDown(m){c._forEachElementDown(m,f=>{const v=c.children[f];(0,n.detach)(v),c.children.splice(f-1,0,v)})},canMoveElementsBottom(m){return this.canMoveElementsDown(m)},moveElementsBottom(m){const f=[],v=[];c.children.forEach(y=>{m.indexOf(y.id)>=0?f.push(y):v.push(y)}),c.children.replace(f.concat(v))},setElementZIndex(m,f){const v=c.children.find(y=>y.id===m);v&&((0,n.detach)(v),c.children.remove(v),c.children.splice(f,0,v))},setSize({width:m,height:f,useMagic:v,softChange:y}){if(v){const E=[],w=A=>A.type==="image"&&A.x<1&&A.y<1&&A.width>=c.computedWidth-2&&A.height>=c.computedHeight-2;(0,o.forEveryChild)(c,A=>{A.type!=="group"&&(w(A)||E.push(A))});const S=E.length?(0,s.getTotalClientRect)(E):{x:0,y:0,width:c.computedWidth,height:c.computedHeight},x=1/4,_=Math.max(0,Math.min(S.x,c.computedWidth-S.x-S.width)),b=c.computedWidth*x,g=Math.max(0,_-b),h=Math.max(0,Math.min(S.y,c.computedHeight-S.y-S.height)),d=c.computedHeight*x,P=Math.max(0,h-d),M=c.computedWidth-2*g,T=c.computedHeight-2*P,I=m/M,F=f/T,k=Math.min(I,F),O=(m-M*k)/2-g*k,N=(f-T*k)/2-P*k;(0,o.forEveryChild)(c,A=>{A.type!=="group"&&(w(A)?A.set({x:A.x*k,y:A.y*k,width:A.width*I,height:A.height*F,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(A.set({x:O+A.x*k,y:N+A.y*k,width:A.width*k,height:A.height*k}),A.type==="text"?A.set({fontSize:A.fontSize*k}):A.type==="figure"&&A.set({strokeWidth:A.strokeWidth*k})))})}y||(c.width=m),y||(c.height=f)}})).actions(c=>({moveElementUp(m){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),c.moveElementsUp([m])},moveElementDown(m){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),c.moveElementsDown([m])},moveElementTop(m){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),c.moveElementsTop([m])},moveElementBottom(m){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),c.moveElementsBottom([m])},play(){c.store.play({startTime:c.startTime,endTime:c.startTime+c.duration})}}))}(L1)),L1}var N1={},$3;function RP(){return $3||($3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Audio=void 0;const n=Zi;e.Audio=n.types.model("Audio",{id:n.types.identifier,src:"",duration:0,startTime:0,endTime:1,volume:1,delay:0}).actions(t=>({toJSON:()=>Object.assign({},(0,n.getSnapshot)(t))})).actions(t=>({set(r){Object.assign(t,r)}}))}(N1)),N1}var W3;function tm(){return W3||(W3=1,function(e){var n,t=Oi&&Oi.__createBinding||(Object.create?function(k,O,N,A){A===void 0&&(A=N);var R=Object.getOwnPropertyDescriptor(O,N);R&&!("get"in R?!O.__esModule:R.writable||R.configurable)||(R={enumerable:!0,get:function(){return O[N]}}),Object.defineProperty(k,A,R)}:function(k,O,N,A){A===void 0&&(A=N),k[A]=O[N]}),r=Oi&&Oi.__setModuleDefault||(Object.create?function(k,O){Object.defineProperty(k,"default",{enumerable:!0,value:O})}:function(k,O){k.default=O}),a=Oi&&Oi.__importStar||(n=function(k){return n=Object.getOwnPropertyNames||function(O){var N=[];for(var A in O)Object.prototype.hasOwnProperty.call(O,A)&&(N[N.length]=A);return N},n(k)},function(k){if(k&&k.__esModule)return k;var O={};if(k!=null)for(var N=n(k),A=0;A<N.length;A++)N[A]!=="default"&&t(O,k,N[A]);return r(O,k),O}),o=Oi&&Oi.__rest||function(k,O){var N={};for(var A in k)Object.prototype.hasOwnProperty.call(k,A)&&O.indexOf(A)<0&&(N[A]=k[A]);if(k!=null&&typeof Object.getOwnPropertySymbols=="function"){var R=0;for(A=Object.getOwnPropertySymbols(k);R<A.length;R++)O.indexOf(A[R])<0&&Object.prototype.propertyIsEnumerable.call(k,A[R])&&(N[A[R]]=k[A[R]])}return N},s=Oi&&Oi.__importDefault||function(k){return k&&k.__esModule?k:{default:k}};Object.defineProperty(e,"__esModule",{value:!0}),e.Store=e.Font=void 0,e.createStore=F;const c=Zi,m=EP(),f=Yp,v=s(Mi()),y=xP(),E=OP(),w=PP(),S=Jv(),x=a(Vd()),_=Ks(),b=em(),g=i_(),h=CP(),d=AP(),P=TP(),M=o_(),T=Id(),I=RP();function F({key:k,showCredit:O}={key:"",showCredit:!1}){return e.Store.create({_forceShowCredit:O,_key:k})}(0,c.setLivelinessChecking)("ignore"),e.Font=c.types.model("Font",{fontFamily:c.types.string,url:c.types.optional(c.types.string,""),styles:c.types.frozen()}).preProcessSnapshot(k=>Object.assign(Object.assign({},k),{fontFamily:k.fontFamily||k.name})),e.Store=c.types.model("Store",{role:"",pages:c.types.array(M.Page),fonts:c.types.array(e.Font),audios:c.types.array(I.Audio),width:1080,height:1080,currentTime:0,isPlaying:!1,scale:1,scaleToFit:1,unit:"px",dpi:72,bleedVisible:!1,rulesVisible:!1,openedSidePanel:"",previousOpenedSidePanel:"",custom:c.types.frozen(),selectedElementsIds:c.types.array(c.types.string),animatedElementsIds:c.types.array(c.types.string),history:c.types.optional(m.UndoManager,{targetPath:"../pages"}),_elementsPixelRatio:Math.min(2,window.devicePixelRatio||1),_activePageId:"",_forceShowCredit:!1,_key:"",_validated:!1}).views(k=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),k.bleedVisible},get selectedElements(){return k.selectedElementsIds.map(O=>{for(const N of k.pages)for(const A of N.children)if(A.id===O)return A}).filter(O=>!!O)},get children(){return k.pages},get selectedShapes(){const O=[];return(0,T.forEveryChild)({children:k.selectedElements},N=>{N.type!=="group"&&O.push(N)}),O},get activePage(){return k.pages.slice().find(O=>O.id===k._activePageId)||(k.pages.length?k.pages[0]:null)},get duration(){let O=0;return k.pages.forEach(N=>{O+=N.duration}),O},get _hasCroppedImages(){return k.find(O=>O.type==="image"&&O._cropModeEnabled)},find(O){let N;return(0,T.forEveryChild)({children:k.pages},A=>{if(!N&&O(A))return N=A,!0}),N},getElementById:O=>k.find(N=>N.id===O)})).actions(k=>{let O=0,N=null,A=!1;return{afterCreate(){k.history.canUndo},setCurrentTime(R){k.currentTime=R},_togglePlaying(R=!k.isPlaying){k.isPlaying=R},play({animatedElementsIds:R=[],startTime:L=0,currentTime:V=0,endTime:G=k.duration,repeat:W=!1}={}){V&&(console.warn("currentTime property of store.play() is deprecated. Please use startTime instead."),L=V),k.animatedElementsIds=(0,c.cast)(R),k.currentTime=L,k.isPlaying=!0,O=Date.now(),N=G,A=W,requestAnimationFrame(k.seek)},checkActivePage(){let R=0;for(const L of k.pages){if(k.currentTime>=L.startTime&&k.currentTime<L.startTime+L.duration){k.selectPage(L.id);break}R+=L.duration}},seek(){if(!k.isPlaying)return;const R=Date.now(),L=R-O;O=R,k.currentTime+=L,k.checkActivePage();const V=N||k.duration;k.isPlaying&&k.currentTime<V?requestAnimationFrame(k.seek):k.isPlaying&&A?(k.currentTime=0,requestAnimationFrame(k.seek)):k.stop()},stop(){k.isPlaying=!1,k.currentTime=0,k.animatedElementsIds=(0,c.cast)([]),k.checkActivePage()}}}).actions(k=>({__(){k._validated||((0,S.validateKey)(k._key,k._forceShowCredit),k._validated=!0)},set(O){Object.assign(k,O)},setUnit({unit:O,dpi:N}){k.unit=O||k.unit,k.dpi=N||k.dpi},setRole(O){k.role=O},addPage(O){const N=M.Page.create(Object.assign({id:(0,f.nanoid)(10)},O));return k.pages.push(N),k._activePageId=N.id,N},selectPage(O){k._activePageId=O},selectElements(O){const N=O.map(A=>k.getElementById(A)).sort((A,R)=>A.page.children.indexOf(A)-A.page.children.indexOf(R)).filter(A=>!!A).map(A=>A.id);k.selectedElementsIds=(0,c.cast)(N)},toggleBleed(O){k.bleedVisible=O??!k.bleedVisible},toggleRulers(O){k.rulesVisible=O??!k.rulesVisible},openSidePanel(O){k.openedSidePanel!==O&&(k.previousOpenedSidePanel=k.openedSidePanel,k.openedSidePanel=O)},setScale(O){k.scale=O},_setScaleToFit(O){k.scaleToFit=O},setElementsPixelRatio(O){k._elementsPixelRatio=O},setSize(O,N,A){k.pages.forEach(R=>{R.setSize({width:O,height:N,useMagic:A,softChange:!0})}),k.width=O,k.height=N},setPageZIndex(O,N){const A=k.pages.find(R=>R.id===O);A&&((0,c.detach)(A),k.pages.remove(A),k.pages.splice(N,0,A))},deletePages(O){const N=k.pages.indexOf(k.activePage);O.forEach(L=>{const V=k.pages.find(G=>G.id===L);(0,c.destroy)(V)});const A=Math.min(k.pages.length-1,N),R=k.pages[A];R&&(k._activePageId=R.id),k.selectedElementsIds=(0,c.cast)(k.selectedElementsIds.filter(L=>k.getElementById(L)))},groupElements(O){const N=O.map(L=>k.getElementById(L));N.forEach(L=>{L&&(0,c.detach)(L)});const A=k.activePage,R={id:(0,f.nanoid)(10),children:N,type:"group"};return A.children.push(R),k.selectedElementsIds=(0,c.cast)([R.id]),A.children.find(L=>L.id===R.id)},ungroupElements(O){const N=O.map(R=>k.getElementById(R)),A=[];N.forEach(R=>{if(R&&R.type==="group"){const L=R.page,V=L.children.indexOf(R);R.children.forEach(G=>{A.push(G.id)}),R.children.forEach(G=>{(0,c.detach)(G),L.children.push(G)}),L.children.splice(V,1)}}),k.selectedElementsIds=(0,c.cast)(A)},deleteElements(O){const N=[];k.find(A=>(O.includes(A.id)&&N.push(A),!1)),N.forEach(A=>{(0,c.destroy)(A)}),k.selectedElementsIds=(0,c.cast)(k.selectedElementsIds.filter(A=>k.getElementById(A)))},on(O,N){if(O==="change"){let A=k.toJSON();return(0,c.onSnapshot)(k,R=>{const L=k.toJSON();!(0,g.deepEqual)(A,L)&&(A=L,N(L))})}},async _toCanvas({pixelRatio:O,ignoreBackground:N,pageId:A,mimeType:R,includeBleed:L,_skipTimeout:V,quickMode:G=!1}={}){var W;const X=O||1;A=A||((W=k.pages[0])===null||W===void 0?void 0:W.id);const q=k.pages.find(se=>se.id===A);if(!q)throw new Error(`No page for export with id ${A}`);G?q==null||q.set({_forceMount:!0}):q==null||q.set({_exporting:!0});const z=await(0,h.waitTillAvailable)(()=>v.default.stages.find(se=>se.getAttr("pageId")===A));if(!z)throw q==null||q.set({_forceMount:!1,_exporting:!1}),new Error(`Export is failed. Can not find stage for page ${A}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);const Y=!!z.findOne(".page-container"),U=k._elementsPixelRatio;X>k._elementsPixelRatio&&k.setElementsPixelRatio(X),await k.waitLoading({_skipTimeout:V});const ee=z.findOne(".page-container");if(!ee)throw k.setElementsPixelRatio(U),q==null||q.set({_forceMount:!1,_exporting:!1}),new Error(`Export is failed. Can't find page container. ${Y}`);const te=z.position();z.position({x:0,y:0}),z.find("Transformer").forEach(se=>{se.setAttr("oldVisible",se.visible()),se.visible(!1)}),ee.find(".page-background").forEach(se=>se.shadowEnabled(!1)),ee.find(".page-background").forEach(se=>se.strokeEnabled(!1)),ee.find(".highlighter").forEach(se=>se.visible(!1));const Q=ee.findOne(".page-background-group"),Z=Q.clip();Q.clip({x:null,y:null,width:null,height:null});const re=ee.findOne(".elements-container"),ne=re.clip();re.clip({x:null,y:null,width:null,height:null});const ae=ee.find(se=>se.getAttr("hideInExport"));ae.forEach(se=>{se.setAttr("oldVisible",se.visible()),se.hide()});const ue=ee.find(se=>!se.visible()&&se.getAttr("editModeEnabled"));ue.forEach(se=>{se.setAttr("oldVisible",se.visible()),se.show()}),N&&ee.find(".page-background").forEach(se=>se.hide());const fe=L?q.bleed:0;let pe=fe;!k.bleedVisible&&L||(k.bleedVisible||L?k.bleedVisible&&L?pe=0:k.bleedVisible&&!L&&(pe=-q.bleed):pe=0);const ye=document.createElement("canvas");ye.width=Math.round((q.computedWidth+2*fe)*X),ye.height=Math.round((q.computedHeight+2*fe)*X);const we=ye.getContext("2d");R==="image/jpeg"&&(we.fillStyle="white",we.fillRect(0,0,ye.width,ye.height));const je=ee.scale();ee.scale({x:1,y:1});const Te=ee.toCanvas({x:ee.x()-pe,y:ee.y()-pe,width:q.computedWidth+2*fe,height:q.computedHeight+2*fe,pixelRatio:X});return ee.scale(je),we.drawImage(Te,0,0,ye.width,ye.height),v.default.Util.releaseCanvas(Te),N&&ee.find(".page-background").forEach(se=>se.show()),ae.forEach(se=>{se.visible(se.getAttr("oldVisible"))}),ue.forEach(se=>{se.visible(se.getAttr("oldVisible"))}),ee.find(".page-background").forEach(se=>se.shadowEnabled(!0)),ee.find(".page-background").forEach(se=>se.strokeEnabled(!0)),z.find("Transformer").forEach(se=>{se.visible(se.getAttr("oldVisible"))}),ee.find(".highlighter").forEach(se=>se.visible(!0)),Q.clip(Z),re.clip(ne),z.position(te),k.setElementsPixelRatio(U),q==null||q.set({_exporting:!1,_forceMount:!1}),ye},async toDataURL(O={}){var{mimeType:N,quality:A}=O,R=o(O,["mimeType","quality"]);const L=await k._toCanvas(Object.assign({mimeType:N},R)),V=L.toDataURL(N,A);return v.default.Util.releaseCanvas(L),V},async toBlob(O={}){var{mimeType:N,quality:A}=O,R=o(O,["mimeType","quality"]);const L=await k._toCanvas(Object.assign({mimeType:N},R)),V=await new Promise(G=>{L.toBlob(G,N,A)});return v.default.Util.releaseCanvas(L),V},async saveAsImage(O={}){var{fileName:N}=O,A=o(O,["fileName"]);const R=A.mimeType||"image/png",L=R.split("/")[1];(0,y.downloadFile)(await k.toDataURL(A),N||"polotno."+L,R)},async _toPDF(O){const N=O.dpi||k.dpi,A=O.parallel||1,R=O.unit||(k.unit==="px"?"mm":k.unit),L=O.pixelRatio||1,V=O.pageIds||k.pages.map(ne=>ne.id),G=k.pages.filter(ne=>V.includes(ne.id)),W=await(0,E.getJsPDF)(),X=ne=>(0,b.pxToUnit)({px:ne,unit:R,dpi:N}),q=O.cropMarkSize||0,z=X(q),Y=G[0]||{},U=O.includeBleed?Y.bleed:0,ee=X(Y.computedWidth+2*U+2*z),te=X(Y.computedHeight+2*U+2*z);var Q=new W({unit:R,orientation:ee>te?"landscape":"portrait",format:[ee,te],compress:!0,putOnlyUsedFonts:!0});Q.deletePage(1);const Z=((ne,ae)=>{for(var ue=[],fe=0;fe<ne.length;fe+=ae)ue.push(ne.slice(fe,fe+ae));return ue})(G,A);let re=0;for(const ne of Z){const ae=ne.map(async ue=>{const fe=O.includeBleed?ue.bleed:0,pe=ue.computedWidth+2*fe+2*q,ye=ue.computedHeight+2*fe+2*q,we=X(pe),je=X(ye);let Te=0,se=L;for(;Te<10;){Te+=1,Te===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const _e=await k.toDataURL(Object.assign(Object.assign({},O),{pageId:ue.id,pixelRatio:se}));if(_e.length>20)return O.onProgress&&O.onProgress(++re/V.length*.9),{url:_e,width:we,height:je,widthPx:pe,heightPx:ye};se*=.8}});(await Promise.all(ae)).forEach(({url:ue,width:fe,height:pe,widthPx:ye,heightPx:we})=>{Q.addPage([fe,pe],fe>pe?"landscape":"portrait");const je=Q.getCurrentPageInfo();var Te;switch(R){case"pt":Te=1;break;case"mm":Te=72/25.4;break;case"cm":Te=72/2.54;break;case"in":Te=72;break;case"px":Te=.75;break;case"pc":case"em":Te=12;break;case"ex":Te=6;break;default:throw"Invalid unit: "+R}if(je.pageContext.cropBox={bottomLeftX:0,bottomLeftY:0,topRightX:fe*Te,topRightY:pe*Te},je.pageContext.artBox={bottomLeftX:X(q+U)*Te,bottomLeftY:X(q+U)*Te,topRightX:X(ye-q-U)*Te,topRightY:X(we-q-U)*Te},je.pageContext.bleedBox={bottomLeftX:X(q+U)*Te,bottomLeftY:X(q+U)*Te,topRightX:X(ye-q-U)*Te,topRightY:X(we-q-U)*Te},z){Q.setLineWidth(X(1));const se=z+X(U);Q.line(se,0,se,z),Q.line(0,se,z,se),Q.line(fe-se,0,fe-se,z),Q.line(fe,se,fe-z,se),Q.line(0,pe-se,z,pe-se),Q.line(se,pe,se,pe-z),Q.line(fe,pe-se,fe-z,pe-se),Q.line(fe-se,pe,fe-se,pe-z)}Q.addImage(ue,z,z,fe-2*z,pe-2*z,void 0,"FAST")})}return Q},toPDFDataURL:async O=>(await k._toPDF(Object.assign({mimeType:"image/jpeg"},O))).output("datauristring"),async toGIFDataURL(O={}){const N=O.pixelRatio||1,A=await(0,w.createGIF)({width:k.width*N,height:k.height*N}),R=1e3/(O.fps||10),L=k.duration/R;for(let V=0;V<L-1;V++){const G=V*R||1;k.setCurrentTime(G);let W=0,X="";for(const z of k.pages)if(W+=z.duration,z.set({_rendering:W>G}),W>G){X=z.id;break}const q=await k._toCanvas({pixelRatio:N,pageId:X,_skipTimeout:!0});A.addFrame(q.getContext("2d"),{delay:R,copy:!0})}for(const V of k.pages)V.set({_rendering:!1});return k.stop(),A.render(),new Promise(V=>{A.on("finished",function(G){(function(W,X){var q=new FileReader;q.onload=function(z){X(z.target.result)},q.readAsDataURL(W)})(G,V)})})},async saveAsGIF(O={}){var{fileName:N}=O,A=o(O,["fileName"]);const R=await k.toGIFDataURL(A);(0,y.downloadFile)(R,N||"polotno.gif")},async toHTML({elementHook:O}={elementHook:void 0}){const N=k.toJSON();return(0,d.jsonToHTML)({json:N,elementHook:O})},async saveAsHTML({fileName:O}={}){const N=await k.toHTML(),A="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(N)));(0,y.downloadFile)(A,O||"polotno.html")},async toSVG({elementHook:O,pageId:N}={elementHook:void 0,pageId:void 0}){var A;const R=k.toJSON();N=N||((A=R.pages[0])===null||A===void 0?void 0:A.id);const L=R.pages.find(V=>V.id===N);return(0,P.jsonToSVG)({json:Object.assign(Object.assign({},R),{pages:L?[L]:[]}),elementHook:O})},async saveAsSVG({fileName:O,elementHook:N,pageId:A}={}){const R=await k.toSVG({elementHook:N,pageId:A}),L="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(R)));(0,y.downloadFile)(L,O||"polotno.svg")},async saveAsPDF(O={}){var{fileName:N}=O,A=o(O,["fileName"]);(await k._toPDF(Object.assign({mimeType:"image/jpeg"},A))).save(N||"polotno.pdf")},async waitLoading({_skipTimeout:O=!1}={}){O||await new Promise(N=>setTimeout(N,50)),await(0,_.whenLoaded)()},toJSON:()=>({width:k.width,height:k.height,fonts:(0,c.getSnapshot)(k.fonts),pages:(0,c.getSnapshot)(k.pages),audios:(0,c.getSnapshot)(k.audios),unit:k.unit,dpi:k.dpi,custom:k.custom}),loadJSON(O,N=!1){var A;const R=Object.assign({},O),L=k.pages.indexOf(k.activePage);let V=(A=R.pages[L]||R.pages[0])===null||A===void 0?void 0:A.id;R._activePageId=V;const G=Object.assign({},(0,c.getSnapshot)(k));Object.assign(G,R),G.history=N?k.history.toJSON():{history:[],undoIdx:-1},(0,c.applySnapshot)(k,G)},clear({keepHistory:O=!1}={}){const N=k.pages.map(A=>A.id);k.deletePages(N),k.custom=null,O||k.history.clear()},addFont(O){k.removeFont(O.fontFamily),k.fonts.push(O),k.loadFont(O.fontFamily)},removeFont(O){k.fonts.filter(N=>N.fontFamily===O).forEach(N=>(0,c.destroy)(N))},addAudio(O){const N=I.Audio.create(Object.assign({id:(0,f.nanoid)(10)},O));k.audios.push(N)},removeAudio(O){const N=k.audios.find(A=>A.id===O);N&&k.audios.remove(N)},async loadFont(O){const N=k.fonts.find(R=>R.fontFamily===O)||x.globalFonts.find(R=>R.fontFamily===O);let A=[{fontStyle:"normal",fontWeight:"normal"}];return N?(N.styles&&(A=N.styles.map(R=>({fontStyle:R.fontStyle||"normal",fontWeight:R.fontWeight||"normal"}))),x.injectCustomFont(N)):x.injectGoogleFont(O),Promise.all(A.map(R=>x.loadFont(O,R.fontStyle,R.fontWeight)))},validate:O=>e.Store.validate(O,[{path:"",type:e.Store}]).map(N=>({path:"store"+N.context.map(A=>A.path).join("."),message:N.message}))})),e.default=F}(Oi)),Oi}var Y3;function l_(){return Y3||(Y3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Node=void 0;const n=Zi,t=Yp,r=tm(),a=o_(),o=Id();e.Node=n.types.model("Node",{id:n.types.identifier,type:"none",name:"",opacity:1,custom:n.types.frozen(),visible:!0,selectable:!0,removable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(s=>{for(var c in s)s[c]===null&&(s[c]=void 0);return s}).postProcessSnapshot(s=>{const c=Object.assign({},s),m={};for(var f in c)f[0]!=="_"&&(m[f]=s[f]);return m}).views(s=>({get locked(){return!(s.draggable||s.contentEditable||s.styleEditable||s.resizable)},get page(){return(0,n.getParentOfType)(s,a.Page)},get store(){return(0,n.getParentOfType)(s,r.Store)},get top(){let c=s;for(;;){if(!(0,n.hasParentOfType)(c,o.GroupElement))return c;c=(0,n.getParentOfType)(c,o.GroupElement)}},get parent(){return(0,n.hasParentOfType)(s,o.GroupElement)?(0,n.getParentOfType)(s,o.GroupElement):(0,n.hasParentOfType)(s,a.Page)?(0,n.getParentOfType)(s,a.Page):(0,n.hasParentOfType)(s,r.Store)?(0,n.getParentOfType)(s,r.Store):null},get zIndex(){return s.parent.children.indexOf(s)}})).actions(s=>({toJSON:()=>Object.assign({},(0,n.getSnapshot)(s))})).actions(s=>({clone(c={},{skipSelect:m=!1}={}){const f=JSON.parse(JSON.stringify(s.toJSON()));return c.id=c.id||(0,t.nanoid)(10),(0,o.forEveryChild)(f,v=>{v.id=(0,t.nanoid)(10)}),Object.assign(f,c),s.page.addElement(f,{skipSelect:m})},set(c){Object.assign(s,c)},moveUp(){s.page.moveElementsUp([s.id])},moveTop(){s.page.moveElementsTop([s.id])},moveDown(){s.page.moveElementsDown([s.id])},moveBottom(){s.page.moveElementsBottom([s.id])},setZIndex(c){s.parent.setElementZIndex(s.id,c)},beforeDestroy(){}}))}(E1)),E1}var I1={},j1={},K3;function MP(){return K3||(K3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.registerAnimation=e.animate=e.animations=void 0;const n=Ec(),t={right:{from:{x:-200},to:{x:0}},left:{from:{x:200},to:{x:0}},up:{from:{y:200},to:{y:0}},down:{from:{y:-200},to:{y:0}},"bottom-right":{from:{x:-200,y:-200},to:{x:0,y:0}},"bottom-left":{from:{x:200,y:-200},to:{x:0,y:0}},"top-right":{from:{x:-200,y:200},to:{x:0,y:0}},"top-left":{from:{x:200,y:200},to:{x:0,y:0}}},r={right:{cropX:-1},left:{cropX:1},up:{cropY:1},down:{cropY:-1}};e.animations={fade:({dTime:a,element:o,animation:s})=>{const c=a/s.duration;return s.type==="enter"?{opacity:c*o.opacity}:{opacity:(1-c)*o.opacity}},rotate:({dTime:a,element:o,animation:s})=>{const c=a/s.duration*360;return(0,n.rotateAroundCenter)({x:o.x,y:o.y,width:o.width,height:o.height,rotation:o.rotation},c)},blink:({dTime:a,element:o,animation:s})=>{const c=s.duration,m=a%c/(c/2),f=m<=1?m:2-m;return{opacity:o.opacity*f}},bounce:({dTime:a,element:o,animation:s})=>{var c;const m=s.duration,f=m/2,v=(c=s.data.strength)!==null&&c!==void 0?c:1,y={},E={x:o.x+o.width/3*v,y:o.y+o.height/3*v,width:o.width/3*v,height:o.height/3*v,fontSize:o.fontSize/3*v},w={x:o.x,y:o.y,width:o.width,height:o.height,fontSize:o.fontSize},S=a%m/f,x=S<=1?S:2-S;for(let _ in E){const b=E[_],g=w[_]-b;y[_]=b+x*g}return y},move:({dTime:a,element:o,animation:s})=>{var c;const m=t[s.data.direction]||t.right,f=(c=s.data.strength)!==null&&c!==void 0?c:1,v={};for(var y in m.from){let E=m.from[y],w=m.to[y];s.type==="exit"&&(E=m.to[y],w=-m.from[y]),E*=f,w*=f;const S=o[y]+E,x=o[y]+w-S;v[y]=S+a/s.duration*x}return v},zoom:({dTime:a,element:o,animation:s})=>{var c;const m={},f=1+(((s.data.direction||"in")==="in"?.75:1.25)-1)*((c=s.data.strength)!==null&&c!==void 0?c:1),v=o.rotation*Math.PI/180,y=Math.cos(v),E=Math.sin(v),w=o.width*(1-f),S=o.height*(1-f),x=(w*y-S*E)/2,_=(w*E+S*y)/2,b={x:o.x+x,y:o.y+_,width:o.width*f,height:o.height*f,fontSize:o.fontSize*f},g={x:o.x,y:o.y,width:o.width,height:o.height,fontSize:o.fontSize};for(var h in b){let d=b[h],P=g[h];if(s.type==="exit"){const T=d;d=P,P=T}const M=P-d;m[h]=d+a/s.duration*M}return m},cameraZoom:({dTime:a,element:o,animation:s})=>{var c,m,f;const v={},y=s.data.direction||"right",E=r[y]||r.right,w=(c=s.data.movementStrength)!==null&&c!==void 0?c:.1,S=(m=s.data.shakeStrength)!==null&&m!==void 0?m:.015;f=s.data.zoomStrength;const x=a/s.duration,_=S*(1-x),b=Math.sin(12*x)*_*.7+Math.sin(8*x)*_*.3;s.type==="exit"&&Math.max(o.cropWidth||1,o.cropHeight||1),s.type;const g=1-Math.pow(1-x,2),h=o.cropX||0,d=o.cropY||0,P=o.cropWidth||1,M=o.cropHeight||1,T=P,I=M;let F,k,O=0,N=0;if(E.cropX){const A=E.cropX>0?1-(h+P):h;O=Math.min(A,Math.abs(w))*E.cropX}if(E.cropY){const A=E.cropY>0?1-(d+M):d;N=Math.min(A,Math.abs(w))*E.cropY}return s.type==="enter"?(F=E.cropX?h+O*(1-g):h,k=E.cropY?d+N*(1-g):d):(F=E.cropX?h+O*g:h,k=E.cropY?d+N*g:d),v.cropX=Math.max(0,Math.min(1-T,F+b*T)),v.cropY=Math.max(0,Math.min(1-I,k+b*I)),v.cropWidth=T,v.cropHeight=I,v}},e.animate=({element:a,dTime:o,animation:s})=>{const c=e.animations[s.name];return c?c({element:a,dTime:o,animation:s}):(console.error("Can not find animation type: "+s.name),{})},e.registerAnimation=(a,o)=>{e.animations[a]&&console.warn(`Animation "${a}" already exists and will be overridden`),e.animations[a]=o}}(j1)),j1}var X3;function xc(){return X3||(X3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.ShapeFilter=e.getDiff=e.Animation=void 0;const n=Zi,t=MP(),r=Xi,a=l_();e.Animation=n.types.model("Animation",{delay:0,duration:500,enabled:!0,type:n.types.enumeration("Type",["enter","exit","loop"]),name:"none",data:n.types.frozen({})}),e.getDiff=(o,s)=>{const c={};for(const m in s)if(typeof o[m]=="number"&&typeof s[m]=="number"){const f=s[m]-o[m];f!==0&&(c[m]=f)}return c},e.ShapeFilter=n.types.model("ShapeFilter",{intensity:1}),e.Shape=a.Node.named("Shape").props({x:0,y:0,width:100,height:100,rotation:0,opacity:1,animations:n.types.array(e.Animation),blurEnabled:!1,blurRadius:10,brightnessEnabled:!1,brightness:0,sepiaEnabled:!1,grayscaleEnabled:!1,filters:n.types.map(e.ShapeFilter),shadowEnabled:!1,shadowBlur:5,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black",shadowOpacity:1,visible:!0,draggable:!0,resizable:!0,selectable:!0,contentEditable:!0,styleEditable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(o=>{const s=Object.assign(Object.assign({},o),{x:o.x||0,y:o.y||0,filters:Array.isArray(o.filters)?{}:o.filters});return"width"in o&&(s.width=s.width||1),"height"in o&&(s.height=s.height||1),o.locked&&(s.draggable=!1,s.contentEditable=!1,s.styleEditable=!1,s.resizable=!1,s.removable=!1),s}).views(o=>{const s=(0,r.observable)({x:o.x,y:o.y,width:o.width,height:o.height,rotation:o.rotation,opacity:o.opacity,color:o.color,fontSize:o.fontSize}),c=(0,r.action)(f=>{Object.assign(s,f)}),m=(0,r.action)(f=>{for(const v in f)typeof s[v]=="number"&&(s[v]=s[v]+f[v])});return{get a(){const{currentTime:f}=o.store;if(c({x:o.x,y:o.y,width:o.width,height:o.height,rotation:o.rotation,opacity:o.opacity,color:o.color,fontSize:o.fontSize,cropX:o.cropX,cropY:o.cropY,cropWidth:o.cropWidth,cropHeight:o.cropHeight}),f===0)return s;const v=f-o.page.startTime;if(v>o.page.duration||v<0)return s;const y=o.store.animatedElementsIds;if(y.length&&!y.includes(o.id))return s;const E=o.animations.find(b=>b.type==="enter"),w=(E==null?void 0:E.enabled)&&v<E.delay;w&&c({opacity:0});const S=(E==null?void 0:E.enabled)&&v>=E.delay&&v<=E.delay+E.duration;if(S){const b=v-E.delay,g=(0,t.animate)({element:o,animation:E,dTime:b}),h=(0,e.getDiff)(o,g);m(h)}const x=o.animations.find(b=>b.type==="exit");if(!w&&!S&&(x!=null&&x.enabled)&&v>=o.page.duration-x.duration-x.delay&&v<=o.page.duration-x.delay){const b=v-(o.page.duration-x.duration-x.delay),g=(0,t.animate)({element:o,animation:x,dTime:b}),h=(0,e.getDiff)(o,g);m(h)}x!=null&&x.enabled&&v>=o.page.duration-x.delay&&c({opacity:0});const _=o.animations.find(b=>b.type==="loop");if(_!=null&&_.enabled){const b=v,g=(0,t.animate)({element:o,animation:_,dTime:b}),h=(0,e.getDiff)(o,g);m(h)}return s},animated:f=>o.a[f]}}).actions(o=>({setAnimation(s,c){const m=o.animations.find(f=>f.type===s);m?Object.assign(m,c):o.animations.push(Object.assign({type:s},c))},setFilter(s,c){o.filters.clear(),c!==0&&o.filters.set(s,{intensity:c})}}))}(I1)),I1}var D1={},Z3;function LP(){return Z3||(Z3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=void 0;const n=Zi,t=xc();e.TextElement=t.Shape.named("Text").props({type:"text",text:"",placeholder:"",fontSize:14,fontFamily:"Roboto",fontStyle:"normal",fontWeight:"normal",textDecoration:"",fill:"black",align:"center",width:100,height:0,verticalAlign:"top",strokeWidth:0,stroke:"black",lineHeight:n.types.optional(n.types.union(n.types.number,n.types.string),1.2),letterSpacing:0,_editModeEnabled:!1,backgroundEnabled:!1,backgroundColor:"#7ED321",backgroundOpacity:1,backgroundCornerRadius:.5,backgroundPadding:.5}).preProcessSnapshot(r=>Object.assign({},r)).actions(r=>({toggleEditMode(a){r._editModeEnabled=a??!r._editModeEnabled,r._editModeEnabled?r.store.history.startTransaction():r.store.history.endTransaction()}}))}(D1)),D1}var F1={},Q3;function rm(){return Q3||(Q3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=void 0;const n=xc();e.ImageElement=n.Shape.named("Image").props({type:"image",width:100,height:100,src:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,cornerRadius:0,flipX:!1,flipY:!1,clipSrc:"",borderColor:"black",borderSize:0,keepRatio:!1,_cropModeEnabled:!1}).actions(t=>({toggleCropMode(r){t._cropModeEnabled=r??!t._cropModeEnabled,t._cropModeEnabled?t.store.history.startTransaction():t.store.history.endTransaction()},beforeDestroy(){t._cropModeEnabled&&t.store.history.endTransaction()}}))}(F1)),F1}var z1={},J3;function NP(){return J3||(J3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=void 0;const n=rm();e.VideoElement=n.ImageElement.named("Video").props({type:"video",duration:0,startTime:0,endTime:1,volume:1})}(z1)),z1}var B1={},ew;function IP(){return ew||(ew=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0;const n=Zi,t=xc();e.LineElement=t.Shape.named("Line").props({type:"line",width:400,height:10,color:"black",dash:n.types.array(n.types.number),startHead:"",endHead:""}).actions(r=>({}))}(B1)),B1}var U1={},tw;function jP(){return tw||(tw=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SVGElement=void 0;const n=Zi,t=xc();e.SVGElement=t.Shape.named("SVG").props({type:"svg",src:"",maskSrc:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,keepRatio:!0,flipX:!1,flipY:!1,width:100,height:100,borderColor:"black",borderSize:0,cornerRadius:0,colorsReplace:n.types.map(n.types.string)}).preProcessSnapshot(r=>Object.assign(Object.assign({},r),{src:r.src||r.svgSource,colorsReplace:Array.isArray(r.colorsReplace)?{}:r.colorsReplace})).actions(r=>({replaceColor(a,o){r.colorsReplace.set(a,o)}}))}(U1)),U1}var q1={},rw;function DP(){return rw||(rw=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const n=Zi,t=xc();e.FigureElement=t.Shape.named("Figure").props({type:"figure",subType:"rect",fill:"rgb(0, 161, 255)",dash:n.types.array(n.types.number),strokeWidth:0,stroke:"rgba(98, 197, 255, 1)",cornerRadius:0})}(q1)),q1}var H1={},nw;function FP(){return nw||(nw=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GifElement=void 0;const n=rm();e.GifElement=n.ImageElement.named("Gif").props({type:"gif",duration:0,keepRatio:!0})}(H1)),H1}var iw;function Id(){return iw||(iw=1,function(e){var n=Sd&&Sd.__rest||function(x,_){var b={};for(var g in x)Object.prototype.hasOwnProperty.call(x,g)&&_.indexOf(g)<0&&(b[g]=x[g]);if(x!=null&&typeof Object.getOwnPropertySymbols=="function"){var h=0;for(g=Object.getOwnPropertySymbols(x);h<g.length;h++)_.indexOf(g[h])<0&&Object.prototype.propertyIsEnumerable.call(x,g[h])&&(b[g[h]]=x[g[h]])}return b};Object.defineProperty(e,"__esModule",{value:!0}),e.TYPES_MAP=e.GroupElement=e.ElementTypes=e.forEveryChild=void 0,e.registerShapeModel=function(x,_){const b=x.type;if(!b)throw new Error('You must pass "type" attribute to custom model.');let g=o.Shape.named(b).props(x);_&&(g=_(g)),e.TYPES_MAP[b]=g,S.push(g)};const t=Zi,r=Yp,a=l_(),o=xc(),s=LP(),c=rm(),m=NP(),f=IP(),v=jP(),y=DP(),E=FP();e.forEveryChild=(x,_)=>{if(x.children)for(const b of x.children){if(_(b)===!0)break;(0,e.forEveryChild)(b,_)}};const w=[...new Array(20)].map((x,_)=>t.types.late(()=>S[_]));e.ElementTypes=t.types.union({dispatcher:x=>{const _=e.TYPES_MAP[x.type];if(!_)throw new Error(`Unknown element type: "${x.type}"`);return _}},v.SVGElement,s.TextElement,c.ImageElement,f.LineElement,m.VideoElement,y.FigureElement,E.GifElement,t.types.late(()=>e.GroupElement),...w),e.GroupElement=a.Node.named("Group").props({type:"group",children:t.types.array(e.ElementTypes)}).views(x=>({get draggable(){let _=!0;return(0,e.forEveryChild)(x,b=>{b.draggable||(_=!1)}),_},get resizable(){let _=!0;return(0,e.forEveryChild)(x,b=>{b.resizable||(_=!1)}),_},get contentEditable(){let _=!0;return(0,e.forEveryChild)(x,b=>{b.contentEditable||(_=!1)}),_},get styleEditable(){let _=!0;return(0,e.forEveryChild)(x,b=>{b.styleEditable||(_=!1)}),_},get locked(){let _=!0;return(0,e.forEveryChild)(x,b=>{b.locked||(_=!1)}),_}})).actions(x=>({set(_){var{draggable:b,contentEditable:g,styleEditable:h,resizable:d}=_,P=n(_,["draggable","contentEditable","styleEditable","resizable"]);b!==void 0&&(0,e.forEveryChild)(x,M=>{M.set({draggable:b})}),g!==void 0&&(0,e.forEveryChild)(x,M=>{M.set({contentEditable:g})}),h!==void 0&&(0,e.forEveryChild)(x,M=>{M.set({styleEditable:h})}),d!==void 0&&(0,e.forEveryChild)(x,M=>{M.set({resizable:d})}),Object.assign(x,P)},addElement(_,{skipSelect:b=!1}={}){const g=e.TYPES_MAP[_.type];if(!g)return void console.error("Can not find model with type "+_.type);_.children&&_.children.forEach(d=>{d.id=(0,r.nanoid)(10)});const h=g.create(Object.assign({id:(0,r.nanoid)(10)},_));return x.children.push(h),h.selectable&&!b&&x.store.selectElements([h.id]),h},setElementZIndex(_,b){const g=x.children.find(h=>h.id===_);g&&((0,t.detach)(g),x.children.remove(g),x.children.splice(b,0,g))}}));const S=[];e.TYPES_MAP={svg:v.SVGElement,text:s.TextElement,image:c.ImageElement,group:e.GroupElement,line:f.LineElement,video:m.VideoElement,figure:y.FigureElement,gif:E.GifElement}}(Sd)),Sd}var aw;function zP(){return aw||(aw=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isClipboardEmpty=e.paste=e.cut=e.copy=void 0;const n=Id(),t=Ec();let r={data:[],pageId:""};const a="polotno_clipboard",o=(c,m)=>{r={data:JSON.parse(JSON.stringify(c)),pageId:m};try{localStorage.setItem(a,JSON.stringify(c)),localStorage.setItem(a+"_page",m)}catch{}},s=()=>{try{const c=localStorage.getItem(a),m=localStorage.getItem(a+"_page");if(c)return{data:JSON.parse(c),pageId:m}}catch{}return r};e.copy=c=>{var m;c.selectedElements.length!==0&&o(c.selectedElements.map(f=>f.toJSON()),(m=c.activePage)===null||m===void 0?void 0:m.id)},e.cut=c=>{var m;o(c.selectedElements.map(v=>v.toJSON()),(m=c.activePage)===null||m===void 0?void 0:m.id);let f=c.selectedElements.filter(v=>v.removable).map(v=>v.id);c.deleteElements(f)},e.paste=c=>{c.history.transaction(()=>{var m,f;let v=0,y=0;const{data:E,pageId:w}=s();if(w===((m=c.activePage)===null||m===void 0?void 0:m.id))v=c.width/20,y=c.height/20;else{const x=[];(0,n.forEveryChild)({children:E},b=>{b.type!=="group"&&x.push(b)});const _=(0,t.getTotalClientRect)(x);_.maxX>c.width&&(v=-_.minX),_.maxY>c.height&&(y=-_.minY)}const S=[];(0,n.forEveryChild)({children:E},x=>{delete x.id,x.type!=="group"&&(x.x+=v,x.y+=y)}),E.forEach(x=>{var _;const b=(_=c.activePage)===null||_===void 0?void 0:_.addElement(x);b&&S.push(b.id)}),o(E,(f=c.activePage)===null||f===void 0?void 0:f.id),c.selectElements(S)})},e.isClipboardEmpty=()=>s().data.length===0}(S1)),S1}var ow;function BP(){return ow||(ow=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.handleHotkey=function(t,r){var a,o,s,c;if(((a=document.activeElement)===null||a===void 0?void 0:a.tagName)==="INPUT"||((o=document.activeElement)===null||o===void 0?void 0:o.tagName)==="TEXTAREA"||((s=document.activeElement)===null||s===void 0?void 0:s.contentEditable)==="true")return;const m=r.selectedElements.filter(y=>y.removable).map(y=>y.id);t.keyCode!==46&&t.keyCode!==8||r.deleteElements(m);const f=t.ctrlKey||t.metaKey,v=t.shiftKey;if(!f||v||t.key.toLowerCase()!=="z"&&t.key.toLowerCase()!=="y"||(t.preventDefault(),r.history.undo()),f&&v&&(t.key.toLowerCase()==="z"||t.key.toLowerCase()==="y")&&(t.preventDefault(),r.history.redo()),f&&t.code==="KeyA"){t.preventDefault();const y=(c=r.activePage)===null||c===void 0?void 0:c.children.filter(w=>w.selectable),E=(y==null?void 0:y.map(w=>w.id))||[];r.selectElements(E)}f&&t.code==="KeyC"&&(t.preventDefault(),(0,n.copy)(r)),f&&t.code==="KeyX"&&(t.preventDefault(),(0,n.cut)(r)),f&&t.code==="KeyV"&&(t.preventDefault(),(0,n.paste)(r)),t.code==="ArrowDown"&&(t.preventDefault(),r.selectedElements.forEach(y=>{y.draggable&&y.set({y:y.y+1})})),t.code==="ArrowUp"&&(t.preventDefault(),r.selectedElements.forEach(y=>{y.draggable&&y.set({y:y.y-1})})),t.code==="ArrowLeft"&&(t.preventDefault(),r.selectedElements.forEach(y=>{y.draggable&&y.set({x:y.x-1})})),t.code==="ArrowRight"&&(t.preventDefault(),r.selectedElements.forEach(y=>{y.draggable&&y.set({x:y.x+1})}))};const n=zP()}(_1)),_1}var G1={},lw;function UP(){return lw||(lw=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t=e.getTranslations=e.setTranslations=void 0;const n=Xi,t=(0,n.observable)({toolbar:{duration:"Duration",opacity:"Opacity",effects:"Effects",blur:"Blur",textBackground:"Background",backgroundCornerRadius:"Corner radius",backgroundOpacity:"Opacity",backgroundPadding:"Padding",brightness:"Brightness",filters:"Filters",sepia:"Sepia",grayscale:"Grayscale",textStroke:"Text Stroke",shadow:"Shadow",border:"Border",cornerRadius:"Corner Radius",copyStyle:"Copy style",position:"Position",layering:"Layering",toForward:"To forward",up:"Up",down:"Down",toBottom:"To bottom",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom",flip:"Flip",flipHorizontally:"Flip horizontally",flipVertically:"Flip vertically",fitToBackground:"Fit to page",removeBackground:"Remove background",removeBackgroundTitle:"Remove background from image",cancelRemoveBackground:"Cancel",confirmRemoveBackground:"Confirm",crop:"Crop",cropDone:"Done",cropCancel:"Cancel",clip:"Apply mask",removeClip:"Remove mask",removeMask:"Remove mask",transparency:"Transparency",lockedDescription:"Object is locked. Unlock it to allow changes from canvas.",unlockedDescription:"Object is unlocked. Lock it to prevent changes from canvas.",removeElements:"Remove elements",duplicateElements:"Duplicate elements",download:"Download",saveAsImage:"Save as image",saveAsPDF:"Save as PDF",lineHeight:"Line height",letterSpacing:"Letter spacing",offsetX:"Offset X",offsetY:"Offset Y",color:"Color",selectable:"Selectable",draggable:"Draggable",removable:"Removable",resizable:"Resizable",contentEditable:"Can change content",styleEditable:"Can change style",alwaysOnTop:"Always on top",showInExport:"Show in export",ungroupElements:"Ungroup",groupElements:"Group",lineSize:"Line size",fade:"Fade",move:"Move",zoom:"Zoom",animate:"Animate",rotate:"Rotate",none:"None",bounce:"Bounce",blink:"Blink",strength:"Strength",spaceEvenly:"Space evenly",horizontalDistribution:"Horizontally",verticalDistribution:"Vertically",strokeWidth:"Stroke Width",colorPicker:{solid:"Solid",linear:"Linear"},aiText:{aiWrite:"AI write",rewrite:"Rewrite",shorten:"Shorten",continue:"Continue writing",proofread:"Proofread",tones:"Tones",friendly:"Friendly",professional:"Professional",humorous:"Humorous",formal:"Formal",customPrompt:"Custom prompt",generatedResult:"Generated result",cancel:"Cancel",generate:"Generate",back:"Back",tryAgain:"Try Again",insert:"Insert",promptPlaceholder:"Describe what you want to generate"}},workspace:{noPages:"There are no pages yet...",addPage:"Add page",removePage:"Remove page",duplicatePage:"Duplicate page",moveUp:"Move up",moveDown:"Move down"},scale:{reset:"Reset"},error:{removeBackground:"Ops! Something went wrong. Background can not be removed."},sidePanel:{templates:"Templates",searchTemplatesWithSameSize:"Show templates with the same size",searchPlaceholder:"Search...",otherFormats:"Other formats",noResults:"No results",error:"Loading is failed...",text:"Text",uploadFont:"Upload font",myFonts:"My fonts",photos:"Photos",videos:"Videos",animations:"Animations",effects:"Effects",elements:"Elements",shapes:"Shapes",lines:"Lines",upload:"Upload",uploadImage:"Add file",uploadTip:"Upload your assets",background:"Background",resize:"Resize",layers:"Layers",animate:"Animate",layerTypes:{image:"Image",text:"Text",svg:"SVG",line:"Line",figure:"Figure",group:"Group"},layersTip:"Elements on your active page:",noLayers:"No elements on the page...",namePlaceholder:"Type element name...",useMagicResize:"Use magic resize",clipImage:"Mask image",width:"Width",height:"Height",magicResizeDescription:"Magic resize will automatically resize and move all elements on the canvas",headerText:"Header",createHeader:"Create header",subHeaderText:"Sub Header",createSubHeader:"Create sub header",bodyText:"Body text",createBody:"Create body text"},pagesTimeline:{pages:"Pages",removePage:"Remove page",addPage:"Add page",duplicatePage:"Duplicate page",removeAudio:"Remove audio"},contextMenu:{duplicate:"Duplicate",remove:"Remove",lock:"Lock",unlock:"Unlock",copy:"Copy",paste:"Paste",copyStyle:"Copy style",moveUp:"Move up",moveDown:"Move down",moveBack:"Move back",moveForward:"Move forward"}}),r=c=>c&&typeof c=="object";function a(c,m){Object.keys(m).forEach(f=>{const v=c[f],y=m[f];r(y)&&r(v)?a(v,y):c[f]=y})}function o(c,m,f=""){Object.keys(m).forEach(v=>{const y=m[v],E=f?`${f}.${v}`:v;r(y)?r(c[v])?o(c[v],y,E):console.warn(`Missing nested translation object at '${E}'`):c[v]===void 0&&console.warn(`Missing translation '${E}'`)})}e.setTranslations=(0,n.action)((c,{validate:m=!1}={})=>{m&&o(c,t),a(t,c)}),e.getTranslations=()=>(0,n.toJS)(t);const s={};e.t=c=>{const m=function(y,E){var w,S=E.split("."),x=y;for(w=0;w<S.length;++w){if(x[S[w]]==null)return;x=x[S[w]]}return x}(t,c);if(m!==void 0)return m;s[c]||(s[c]=!0,console.warn(`Missing translation '${c}'`));const f=c.split("."),v=f[f.length-1]||" ";return v.charAt(0).toUpperCase()+v.slice(1)}}(G1)),G1}var sw;function qP(){return sw||(sw=1,function(e){var n=yf&&yf.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceCanvas=void 0;const t=n(Or()),r=Ri,a=n(vP()),o=mP(),s=yP(),c=BP(),m=UP(),f=({store:y})=>t.default.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},t.default.createElement("p",null,(0,m.t)("workspace.noPages")),t.default.createElement("button",{onClick:()=>{y.addPage()}},(0,m.t)("workspace.addPage"))),v=({width:y,height:E,xPadding:w,yPadding:S,backgroundColor:x})=>t.default.createElement("div",{style:{width:y+"px",height:E+"px",backgroundColor:x,paddingLeft:w+"px",paddingRight:w+"px",paddingTop:S+"px",paddingBottom:S+"px"}},t.default.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}}));e.WorkspaceCanvas=(0,r.observer)(({store:y,pageControlsEnabled:E,backgroundColor:w,pageBorderColor:S,activePageBorderColor:x,bleedColor:_,components:b,onKeyDown:g,paddingX:h,paddingY:d,altCloneEnabled:P=!0,visiblePagesOffset:M,renderOnlyActivePage:T})=>{var I;const F=h??20,k=d??55,[O,N]=t.default.useState({width:100,height:100}),A=t.default.useRef(O),R=t.default.useRef(null),L=t.default.useRef(null),V=y.bleedVisible?Math.max(0,...y.pages.map(ye=>ye.bleed)):0,G=Math.max(...y.pages.map(ye=>ye.computedWidth)),W=Math.max(...y.pages.map(ye=>ye.computedHeight)),X=((I=y.activePage)===null||I===void 0?void 0:I.computedHeight)||0,q=G+2*V,z=(T?X:W)+2*V,Y=async({skipTimeout:ye}={skipTimeout:!1})=>{if(ye||await new Promise(oe=>setTimeout(oe,50)),R.current===null)return;const we=R.current.getBoundingClientRect();we.width!==0&&we.height!==0||(console.warn(`Polotno warning: <Workspace /> component can not automatically detect its size.
|
|
326
|
+
`}}(ba)),ba}var L1={},V3;function o_(){return V3||(V3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Page=void 0;const n=Zi,t=Yp,r=Id(),a=tm(),o=Id(),s=Ec();e.Page=n.types.model("Page",{id:n.types.identifier,children:n.types.array(n.types.late(()=>r.ElementTypes)),width:n.types.optional(n.types.union(n.types.number,n.types.literal("auto")),"auto"),height:n.types.optional(n.types.union(n.types.number,n.types.literal("auto")),"auto"),background:"white",bleed:0,custom:n.types.frozen(),duration:5e3,_exporting:!1,_rendering:!1,_forceMount:!1}).postProcessSnapshot(c=>{const m=Object.assign({},c),f={};for(var v in m)v[0]!=="_"&&(f[v]=c[v]);return f}).views(c=>({get store(){return(0,n.getParentOfType)(c,a.Store)}})).views(c=>({get startTime(){let m=0;for(const f of c.store.pages){if(f.id===c.id)return m;m+=f.duration}return m},get _exportingOrRendering(){return c._exporting||c._rendering}})).views(c=>({get computedWidth(){return c.width==="auto"?c.store.width:c.width},get computedHeight(){return c.height==="auto"?c.store.height:c.height}})).actions(c=>({toJSON:()=>JSON.parse(JSON.stringify((0,n.getSnapshot)(c))),_forEachElementUp(m,f){const v=m.map(y=>({id:y,index:c.children.findIndex(E=>E.id===y)}));v.sort((y,E)=>E.index-y.index);for(const{index:y}of v){if(y==-1)continue;const E=y<c.children.length-1&&c.children[y+1],w=m.indexOf(E==null?void 0:E.id)>=0;y===c.children.length-1||w||f(y)}},_forEachElementDown(m,f){const v=m.map(y=>({id:y,index:c.children.findIndex(E=>E.id===y)}));v.sort((y,E)=>y.index-E.index);for(const{index:y}of v){if(y==-1)continue;const E=y>0&&c.children[y-1],w=m.indexOf(E==null?void 0:E.id)>=0;y===0||w||f(y)}return!1}})).actions(c=>({clone(m={}){const f=c.toJSON();f.children.forEach(w=>{w.id=(0,t.nanoid)(10),(0,o.forEveryChild)(w,S=>{S.id=(0,t.nanoid)(10)})});const v=Object.assign(Object.assign(Object.assign({},f),{id:(0,t.nanoid)(10)}),m),y=c.store.addPage(v),E=c.store.pages.indexOf(c);y.setZIndex(E+1),y.select()},setZIndex(m){c.store.setPageZIndex(c.id,m)},set(m){Object.assign(c,m)},select(){c.store.selectPage(c.id)},addElement(m,{skipSelect:f=!1}={}){const v=o.TYPES_MAP[m.type];if(!v)return void console.error("Can not find model with type "+m.type);"children"in m&&Array.isArray(m.children)&&m.children.forEach(E=>{E.id=(0,t.nanoid)(10)});const y=v.create(Object.assign({id:(0,t.nanoid)(10)},m));return c.children.push(y),y.selectable&&!f&&c.store.selectElements([y.id]),y},canMoveElementsUp(m){let f=!1;return c._forEachElementUp(m,()=>{f=f||!0}),f},moveElementsUp(m){c._forEachElementUp(m,f=>{const v=c.children[f];(0,n.detach)(v),c.children.splice(f+1,0,v)})},canMoveElementsTop(m){return this.canMoveElementsUp(m)},moveElementsTop(m){const f=[],v=[];c.children.forEach(y=>{m.indexOf(y.id)>=0?f.push(y):v.push(y)}),c.children.replace(v.concat(f))},canMoveElementsDown(m){let f=!1;return c._forEachElementDown(m,()=>{f=f||!0}),f},moveElementsDown(m){c._forEachElementDown(m,f=>{const v=c.children[f];(0,n.detach)(v),c.children.splice(f-1,0,v)})},canMoveElementsBottom(m){return this.canMoveElementsDown(m)},moveElementsBottom(m){const f=[],v=[];c.children.forEach(y=>{m.indexOf(y.id)>=0?f.push(y):v.push(y)}),c.children.replace(f.concat(v))},setElementZIndex(m,f){const v=c.children.find(y=>y.id===m);v&&((0,n.detach)(v),c.children.remove(v),c.children.splice(f,0,v))},setSize({width:m,height:f,useMagic:v,softChange:y}){if(v){const E=[],w=A=>A.type==="image"&&A.x<1&&A.y<1&&A.width>=c.computedWidth-2&&A.height>=c.computedHeight-2;(0,o.forEveryChild)(c,A=>{A.type!=="group"&&(w(A)||E.push(A))});const S=E.length?(0,s.getTotalClientRect)(E):{x:0,y:0,width:c.computedWidth,height:c.computedHeight},x=1/4,_=Math.max(0,Math.min(S.x,c.computedWidth-S.x-S.width)),b=c.computedWidth*x,g=Math.max(0,_-b),h=Math.max(0,Math.min(S.y,c.computedHeight-S.y-S.height)),d=c.computedHeight*x,P=Math.max(0,h-d),M=c.computedWidth-2*g,T=c.computedHeight-2*P,I=m/M,F=f/T,k=Math.min(I,F),O=(m-M*k)/2-g*k,N=(f-T*k)/2-P*k;(0,o.forEveryChild)(c,A=>{A.type!=="group"&&(w(A)?A.set({x:A.x*k,y:A.y*k,width:A.width*I,height:A.height*F,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(A.set({x:O+A.x*k,y:N+A.y*k,width:A.width*k,height:A.height*k}),A.type==="text"?A.set({fontSize:A.fontSize*k}):A.type==="figure"&&A.set({strokeWidth:A.strokeWidth*k})))})}y||(c.width=m),y||(c.height=f)}})).actions(c=>({moveElementUp(m){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),c.moveElementsUp([m])},moveElementDown(m){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),c.moveElementsDown([m])},moveElementTop(m){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),c.moveElementsTop([m])},moveElementBottom(m){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),c.moveElementsBottom([m])},play(){c.store.play({startTime:c.startTime,endTime:c.startTime+c.duration})}}))}(L1)),L1}var N1={},$3;function RP(){return $3||($3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Audio=void 0;const n=Zi;e.Audio=n.types.model("Audio",{id:n.types.identifier,src:"",duration:0,startTime:0,endTime:1,volume:1,delay:0}).actions(t=>({toJSON:()=>Object.assign({},(0,n.getSnapshot)(t))})).actions(t=>({set(r){Object.assign(t,r)}}))}(N1)),N1}var W3;function tm(){return W3||(W3=1,function(e){var n,t=Oi&&Oi.__createBinding||(Object.create?function(k,O,N,A){A===void 0&&(A=N);var R=Object.getOwnPropertyDescriptor(O,N);R&&!("get"in R?!O.__esModule:R.writable||R.configurable)||(R={enumerable:!0,get:function(){return O[N]}}),Object.defineProperty(k,A,R)}:function(k,O,N,A){A===void 0&&(A=N),k[A]=O[N]}),r=Oi&&Oi.__setModuleDefault||(Object.create?function(k,O){Object.defineProperty(k,"default",{enumerable:!0,value:O})}:function(k,O){k.default=O}),a=Oi&&Oi.__importStar||(n=function(k){return n=Object.getOwnPropertyNames||function(O){var N=[];for(var A in O)Object.prototype.hasOwnProperty.call(O,A)&&(N[N.length]=A);return N},n(k)},function(k){if(k&&k.__esModule)return k;var O={};if(k!=null)for(var N=n(k),A=0;A<N.length;A++)N[A]!=="default"&&t(O,k,N[A]);return r(O,k),O}),o=Oi&&Oi.__rest||function(k,O){var N={};for(var A in k)Object.prototype.hasOwnProperty.call(k,A)&&O.indexOf(A)<0&&(N[A]=k[A]);if(k!=null&&typeof Object.getOwnPropertySymbols=="function"){var R=0;for(A=Object.getOwnPropertySymbols(k);R<A.length;R++)O.indexOf(A[R])<0&&Object.prototype.propertyIsEnumerable.call(k,A[R])&&(N[A[R]]=k[A[R]])}return N},s=Oi&&Oi.__importDefault||function(k){return k&&k.__esModule?k:{default:k}};Object.defineProperty(e,"__esModule",{value:!0}),e.Store=e.Font=void 0,e.createStore=F;const c=Zi,m=EP(),f=Yp,v=s(Mi()),y=xP(),E=OP(),w=PP(),S=Jv(),x=a(Vd()),_=Ks(),b=em(),g=i_(),h=CP(),d=AP(),P=TP(),M=o_(),T=Id(),I=RP();function F({key:k,showCredit:O}={key:"",showCredit:!1}){return e.Store.create({_forceShowCredit:O,_key:k})}(0,c.setLivelinessChecking)("ignore"),e.Font=c.types.model("Font",{fontFamily:c.types.string,url:c.types.optional(c.types.string,""),styles:c.types.frozen()}).preProcessSnapshot(k=>Object.assign(Object.assign({},k),{fontFamily:k.fontFamily||k.name})),e.Store=c.types.model("Store",{role:"",pages:c.types.array(M.Page),fonts:c.types.array(e.Font),audios:c.types.array(I.Audio),width:1080,height:1080,currentTime:0,isPlaying:!1,scale:1,scaleToFit:1,unit:"px",dpi:72,bleedVisible:!1,rulesVisible:!1,openedSidePanel:"",previousOpenedSidePanel:"",custom:c.types.frozen(),selectedElementsIds:c.types.array(c.types.string),animatedElementsIds:c.types.array(c.types.string),history:c.types.optional(m.UndoManager,{targetPath:"../pages"}),_elementsPixelRatio:Math.min(2,window.devicePixelRatio||1),_activePageId:"",_forceShowCredit:!1,_key:"",_validated:!1}).views(k=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),k.bleedVisible},get selectedElements(){return k.selectedElementsIds.map(O=>{for(const N of k.pages)for(const A of N.children)if(A.id===O)return A}).filter(O=>!!O)},get children(){return k.pages},get selectedShapes(){const O=[];return(0,T.forEveryChild)({children:k.selectedElements},N=>{N.type!=="group"&&O.push(N)}),O},get activePage(){return k.pages.slice().find(O=>O.id===k._activePageId)||(k.pages.length?k.pages[0]:null)},get duration(){let O=0;return k.pages.forEach(N=>{O+=N.duration}),O},get _hasCroppedImages(){return k.find(O=>O.type==="image"&&O._cropModeEnabled)},find(O){let N;return(0,T.forEveryChild)({children:k.pages},A=>{if(!N&&O(A))return N=A,!0}),N},getElementById:O=>k.find(N=>N.id===O)})).actions(k=>{let O=0,N=null,A=!1;return{afterCreate(){k.history.canUndo},setCurrentTime(R){k.currentTime=R},_togglePlaying(R=!k.isPlaying){k.isPlaying=R},play({animatedElementsIds:R=[],startTime:L=0,currentTime:V=0,endTime:G=k.duration,repeat:W=!1}={}){V&&(console.warn("currentTime property of store.play() is deprecated. Please use startTime instead."),L=V),k.animatedElementsIds=(0,c.cast)(R),k.currentTime=L,k.isPlaying=!0,O=Date.now(),N=G,A=W,requestAnimationFrame(k.seek)},checkActivePage(){let R=0;for(const L of k.pages){if(k.currentTime>=L.startTime&&k.currentTime<L.startTime+L.duration){k.selectPage(L.id);break}R+=L.duration}},seek(){if(!k.isPlaying)return;const R=Date.now(),L=R-O;O=R,k.currentTime+=L,k.checkActivePage();const V=N||k.duration;k.isPlaying&&k.currentTime<V?requestAnimationFrame(k.seek):k.isPlaying&&A?(k.currentTime=0,requestAnimationFrame(k.seek)):k.stop()},stop(){k.isPlaying=!1,k.currentTime=0,k.animatedElementsIds=(0,c.cast)([]),k.checkActivePage()}}}).actions(k=>({__(){k._validated||((0,S.validateKey)(k._key,k._forceShowCredit),k._validated=!0)},set(O){Object.assign(k,O)},setUnit({unit:O,dpi:N}){k.unit=O||k.unit,k.dpi=N||k.dpi},setRole(O){k.role=O},addPage(O){const N=M.Page.create(Object.assign({id:(0,f.nanoid)(10)},O));return k.pages.push(N),k._activePageId=N.id,N},selectPage(O){k._activePageId=O},selectElements(O){const N=O.map(A=>k.getElementById(A)).sort((A,R)=>A.page.children.indexOf(A)-A.page.children.indexOf(R)).filter(A=>!!A).map(A=>A.id);k.selectedElementsIds=(0,c.cast)(N)},toggleBleed(O){k.bleedVisible=O??!k.bleedVisible},toggleRulers(O){k.rulesVisible=O??!k.rulesVisible},openSidePanel(O){k.openedSidePanel!==O&&(k.previousOpenedSidePanel=k.openedSidePanel,k.openedSidePanel=O)},setScale(O){k.scale=O},_setScaleToFit(O){k.scaleToFit=O},setElementsPixelRatio(O){k._elementsPixelRatio=O},setSize(O,N,A){k.pages.forEach(R=>{R.setSize({width:O,height:N,useMagic:A,softChange:!0})}),k.width=O,k.height=N},setPageZIndex(O,N){const A=k.pages.find(R=>R.id===O);A&&((0,c.detach)(A),k.pages.remove(A),k.pages.splice(N,0,A))},deletePages(O){const N=k.pages.indexOf(k.activePage);O.forEach(L=>{const V=k.pages.find(G=>G.id===L);(0,c.destroy)(V)});const A=Math.min(k.pages.length-1,N),R=k.pages[A];R&&(k._activePageId=R.id),k.selectedElementsIds=(0,c.cast)(k.selectedElementsIds.filter(L=>k.getElementById(L)))},groupElements(O){const N=O.map(L=>k.getElementById(L));N.forEach(L=>{L&&(0,c.detach)(L)});const A=k.activePage,R={id:(0,f.nanoid)(10),children:N,type:"group"};return A.children.push(R),k.selectedElementsIds=(0,c.cast)([R.id]),A.children.find(L=>L.id===R.id)},ungroupElements(O){const N=O.map(R=>k.getElementById(R)),A=[];N.forEach(R=>{if(R&&R.type==="group"){const L=R.page,V=L.children.indexOf(R);R.children.forEach(G=>{A.push(G.id)}),R.children.forEach(G=>{(0,c.detach)(G),L.children.push(G)}),L.children.splice(V,1)}}),k.selectedElementsIds=(0,c.cast)(A)},deleteElements(O){const N=[];k.find(A=>(O.includes(A.id)&&N.push(A),!1)),N.forEach(A=>{(0,c.destroy)(A)}),k.selectedElementsIds=(0,c.cast)(k.selectedElementsIds.filter(A=>k.getElementById(A)))},on(O,N){if(O==="change"){let A=k.toJSON();return(0,c.onSnapshot)(k,R=>{const L=k.toJSON();!(0,g.deepEqual)(A,L)&&(A=L,N(L))})}},async _toCanvas({pixelRatio:O,ignoreBackground:N,pageId:A,mimeType:R,includeBleed:L,_skipTimeout:V,quickMode:G=!1}={}){var W;const X=O||1;A=A||((W=k.pages[0])===null||W===void 0?void 0:W.id);const q=k.pages.find(se=>se.id===A);if(!q)throw new Error(`No page for export with id ${A}`);G?q==null||q.set({_forceMount:!0}):q==null||q.set({_exporting:!0});const z=await(0,h.waitTillAvailable)(()=>v.default.stages.find(se=>se.getAttr("pageId")===A));if(!z)throw q==null||q.set({_forceMount:!1,_exporting:!1}),new Error(`Export is failed. Can not find stage for page ${A}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);const Y=!!z.findOne(".page-container"),U=k._elementsPixelRatio;X>k._elementsPixelRatio&&k.setElementsPixelRatio(X),await k.waitLoading({_skipTimeout:V});const ee=z.findOne(".page-container");if(!ee)throw k.setElementsPixelRatio(U),q==null||q.set({_forceMount:!1,_exporting:!1}),new Error(`Export is failed. Can't find page container. ${Y}`);const te=z.position();z.position({x:0,y:0}),z.find("Transformer").forEach(se=>{se.setAttr("oldVisible",se.visible()),se.visible(!1)}),ee.find(".page-background").forEach(se=>se.shadowEnabled(!1)),ee.find(".page-background").forEach(se=>se.strokeEnabled(!1)),ee.find(".highlighter").forEach(se=>se.visible(!1));const Q=ee.findOne(".page-background-group"),Z=Q.clip();Q.clip({x:null,y:null,width:null,height:null});const re=ee.findOne(".elements-container"),ne=re.clip();re.clip({x:null,y:null,width:null,height:null});const ae=ee.find(se=>se.getAttr("hideInExport"));ae.forEach(se=>{se.setAttr("oldVisible",se.visible()),se.hide()});const ue=ee.find(se=>!se.visible()&&se.getAttr("editModeEnabled"));ue.forEach(se=>{se.setAttr("oldVisible",se.visible()),se.show()}),N&&ee.find(".page-background").forEach(se=>se.hide());const fe=L?q.bleed:0;let pe=fe;!k.bleedVisible&&L||(k.bleedVisible||L?k.bleedVisible&&L?pe=0:k.bleedVisible&&!L&&(pe=-q.bleed):pe=0);const ye=document.createElement("canvas");ye.width=Math.round((q.computedWidth+2*fe)*X),ye.height=Math.round((q.computedHeight+2*fe)*X);const we=ye.getContext("2d");R==="image/jpeg"&&(we.fillStyle="white",we.fillRect(0,0,ye.width,ye.height));const je=ee.scale();ee.scale({x:1,y:1});const Te=ee.toCanvas({x:ee.x()-pe,y:ee.y()-pe,width:q.computedWidth+2*fe,height:q.computedHeight+2*fe,pixelRatio:X});return ee.scale(je),we.drawImage(Te,0,0,ye.width,ye.height),v.default.Util.releaseCanvas(Te),N&&ee.find(".page-background").forEach(se=>se.show()),ae.forEach(se=>{se.visible(se.getAttr("oldVisible"))}),ue.forEach(se=>{se.visible(se.getAttr("oldVisible"))}),ee.find(".page-background").forEach(se=>se.shadowEnabled(!0)),ee.find(".page-background").forEach(se=>se.strokeEnabled(!0)),z.find("Transformer").forEach(se=>{se.visible(se.getAttr("oldVisible"))}),ee.find(".highlighter").forEach(se=>se.visible(!0)),Q.clip(Z),re.clip(ne),z.position(te),k.setElementsPixelRatio(U),q==null||q.set({_exporting:!1,_forceMount:!1}),ye},async toDataURL(O={}){var{mimeType:N,quality:A}=O,R=o(O,["mimeType","quality"]);const L=await k._toCanvas(Object.assign({mimeType:N},R)),V=L.toDataURL(N,A);return v.default.Util.releaseCanvas(L),V},async toBlob(O={}){var{mimeType:N,quality:A}=O,R=o(O,["mimeType","quality"]);const L=await k._toCanvas(Object.assign({mimeType:N},R)),V=await new Promise(G=>{L.toBlob(G,N,A)});return v.default.Util.releaseCanvas(L),V},async saveAsImage(O={}){var{fileName:N}=O,A=o(O,["fileName"]);const R=A.mimeType||"image/png",L=R.split("/")[1];(0,y.downloadFile)(await k.toDataURL(A),N||"polotno."+L,R)},async _toPDF(O){const N=O.dpi||k.dpi,A=O.parallel||1,R=O.unit||(k.unit==="px"?"mm":k.unit),L=O.pixelRatio||1,V=O.pageIds||k.pages.map(ne=>ne.id),G=k.pages.filter(ne=>V.includes(ne.id)),W=await(0,E.getJsPDF)(),X=ne=>(0,b.pxToUnit)({px:ne,unit:R,dpi:N}),q=O.cropMarkSize||0,z=X(q),Y=G[0]||{},U=O.includeBleed?Y.bleed:0,ee=X(Y.computedWidth+2*U+2*z),te=X(Y.computedHeight+2*U+2*z);var Q=new W({unit:R,orientation:ee>te?"landscape":"portrait",format:[ee,te],compress:!0,putOnlyUsedFonts:!0});Q.deletePage(1);const Z=((ne,ae)=>{for(var ue=[],fe=0;fe<ne.length;fe+=ae)ue.push(ne.slice(fe,fe+ae));return ue})(G,A);let re=0;for(const ne of Z){const ae=ne.map(async ue=>{const fe=O.includeBleed?ue.bleed:0,pe=ue.computedWidth+2*fe+2*q,ye=ue.computedHeight+2*fe+2*q,we=X(pe),je=X(ye);let Te=0,se=L;for(;Te<10;){Te+=1,Te===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const _e=await k.toDataURL(Object.assign(Object.assign({},O),{pageId:ue.id,pixelRatio:se}));if(_e.length>20)return O.onProgress&&O.onProgress(++re/V.length*.9),{url:_e,width:we,height:je,widthPx:pe,heightPx:ye};se*=.8}});(await Promise.all(ae)).forEach(({url:ue,width:fe,height:pe,widthPx:ye,heightPx:we})=>{Q.addPage([fe,pe],fe>pe?"landscape":"portrait");const je=Q.getCurrentPageInfo();var Te;switch(R){case"pt":Te=1;break;case"mm":Te=72/25.4;break;case"cm":Te=72/2.54;break;case"in":Te=72;break;case"px":Te=.75;break;case"pc":case"em":Te=12;break;case"ex":Te=6;break;default:throw"Invalid unit: "+R}if(je.pageContext.cropBox={bottomLeftX:0,bottomLeftY:0,topRightX:fe*Te,topRightY:pe*Te},je.pageContext.artBox={bottomLeftX:X(q+U)*Te,bottomLeftY:X(q+U)*Te,topRightX:X(ye-q-U)*Te,topRightY:X(we-q-U)*Te},je.pageContext.bleedBox={bottomLeftX:X(q+U)*Te,bottomLeftY:X(q+U)*Te,topRightX:X(ye-q-U)*Te,topRightY:X(we-q-U)*Te},z){Q.setLineWidth(X(1));const se=z+X(U);Q.line(se,0,se,z),Q.line(0,se,z,se),Q.line(fe-se,0,fe-se,z),Q.line(fe,se,fe-z,se),Q.line(0,pe-se,z,pe-se),Q.line(se,pe,se,pe-z),Q.line(fe,pe-se,fe-z,pe-se),Q.line(fe-se,pe,fe-se,pe-z)}Q.addImage(ue,z,z,fe-2*z,pe-2*z,void 0,"FAST")})}return Q},toPDFDataURL:async O=>(await k._toPDF(Object.assign({mimeType:"image/jpeg"},O))).output("datauristring"),async toGIFDataURL(O={}){const N=O.pixelRatio||1,A=await(0,w.createGIF)({width:k.width*N,height:k.height*N}),R=1e3/(O.fps||10),L=k.duration/R;for(let V=0;V<L-1;V++){const G=V*R||1;k.setCurrentTime(G);let W=0,X="";for(const z of k.pages)if(W+=z.duration,z.set({_rendering:W>G}),W>G){X=z.id;break}const q=await k._toCanvas({pixelRatio:N,pageId:X,_skipTimeout:!0});A.addFrame(q.getContext("2d"),{delay:R,copy:!0})}for(const V of k.pages)V.set({_rendering:!1});return k.stop(),A.render(),new Promise(V=>{A.on("finished",function(G){(function(W,X){var q=new FileReader;q.onload=function(z){X(z.target.result)},q.readAsDataURL(W)})(G,V)})})},async saveAsGIF(O={}){var{fileName:N}=O,A=o(O,["fileName"]);const R=await k.toGIFDataURL(A);(0,y.downloadFile)(R,N||"polotno.gif")},async toHTML({elementHook:O}={elementHook:void 0}){const N=k.toJSON();return(0,d.jsonToHTML)({json:N,elementHook:O})},async saveAsHTML({fileName:O}={}){const N=await k.toHTML(),A="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(N)));(0,y.downloadFile)(A,O||"polotno.html")},async toSVG({elementHook:O,pageId:N}={elementHook:void 0,pageId:void 0}){var A;const R=k.toJSON();N=N||((A=R.pages[0])===null||A===void 0?void 0:A.id);const L=R.pages.find(V=>V.id===N);return(0,P.jsonToSVG)({json:Object.assign(Object.assign({},R),{pages:L?[L]:[]}),elementHook:O})},async saveAsSVG({fileName:O,elementHook:N,pageId:A}={}){const R=await k.toSVG({elementHook:N,pageId:A}),L="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(R)));(0,y.downloadFile)(L,O||"polotno.svg")},async saveAsPDF(O={}){var{fileName:N}=O,A=o(O,["fileName"]);(await k._toPDF(Object.assign({mimeType:"image/jpeg"},A))).save(N||"polotno.pdf")},async waitLoading({_skipTimeout:O=!1}={}){O||await new Promise(N=>setTimeout(N,50)),await(0,_.whenLoaded)()},toJSON:()=>({width:k.width,height:k.height,fonts:(0,c.getSnapshot)(k.fonts),pages:(0,c.getSnapshot)(k.pages),audios:(0,c.getSnapshot)(k.audios),unit:k.unit,dpi:k.dpi,custom:k.custom}),loadJSON(O,N=!1){var A;const R=Object.assign({},O),L=k.pages.indexOf(k.activePage);let V=(A=R.pages[L]||R.pages[0])===null||A===void 0?void 0:A.id;R._activePageId=V;const G=Object.assign({},(0,c.getSnapshot)(k));Object.assign(G,R),G.history=N?k.history.toJSON():{history:[],undoIdx:-1},(0,c.applySnapshot)(k,G)},clear({keepHistory:O=!1}={}){const N=k.pages.map(A=>A.id);k.deletePages(N),k.custom=null,O||k.history.clear()},addFont(O){k.removeFont(O.fontFamily),k.fonts.push(O),k.loadFont(O.fontFamily)},removeFont(O){k.fonts.filter(N=>N.fontFamily===O).forEach(N=>(0,c.destroy)(N))},addAudio(O){const N=I.Audio.create(Object.assign({id:(0,f.nanoid)(10)},O));k.audios.push(N)},removeAudio(O){const N=k.audios.find(A=>A.id===O);N&&k.audios.remove(N)},async loadFont(O){const N=k.fonts.find(R=>R.fontFamily===O)||x.globalFonts.find(R=>R.fontFamily===O);let A=[{fontStyle:"normal",fontWeight:"normal"}];return N?(N.styles&&(A=N.styles.map(R=>({fontStyle:R.fontStyle||"normal",fontWeight:R.fontWeight||"normal"}))),x.injectCustomFont(N)):x.injectGoogleFont(O),Promise.all(A.map(R=>x.loadFont(O,R.fontStyle,R.fontWeight)))},validate:O=>e.Store.validate(O,[{path:"",type:e.Store}]).map(N=>({path:"store"+N.context.map(A=>A.path).join("."),message:N.message}))})),e.default=F}(Oi)),Oi}var Y3;function l_(){return Y3||(Y3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Node=void 0;const n=Zi,t=Yp,r=tm(),a=o_(),o=Id();e.Node=n.types.model("Node",{id:n.types.identifier,type:"none",name:"",opacity:1,custom:n.types.frozen(),visible:!0,selectable:!0,removable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(s=>{for(var c in s)s[c]===null&&(s[c]=void 0);return s}).postProcessSnapshot(s=>{const c=Object.assign({},s),m={};for(var f in c)f[0]!=="_"&&(m[f]=s[f]);return m}).views(s=>({get locked(){return!(s.draggable||s.contentEditable||s.styleEditable||s.resizable)},get page(){return(0,n.getParentOfType)(s,a.Page)},get store(){return(0,n.getParentOfType)(s,r.Store)},get top(){let c=s;for(;;){if(!(0,n.hasParentOfType)(c,o.GroupElement))return c;c=(0,n.getParentOfType)(c,o.GroupElement)}},get parent(){return(0,n.hasParentOfType)(s,o.GroupElement)?(0,n.getParentOfType)(s,o.GroupElement):(0,n.hasParentOfType)(s,a.Page)?(0,n.getParentOfType)(s,a.Page):(0,n.hasParentOfType)(s,r.Store)?(0,n.getParentOfType)(s,r.Store):null},get zIndex(){return s.parent.children.indexOf(s)}})).actions(s=>({toJSON:()=>Object.assign({},(0,n.getSnapshot)(s))})).actions(s=>({clone(c={},{skipSelect:m=!1}={}){const f=JSON.parse(JSON.stringify(s.toJSON()));return c.id=c.id||(0,t.nanoid)(10),(0,o.forEveryChild)(f,v=>{v.id=(0,t.nanoid)(10)}),Object.assign(f,c),s.page.addElement(f,{skipSelect:m})},set(c){Object.assign(s,c)},moveUp(){s.page.moveElementsUp([s.id])},moveTop(){s.page.moveElementsTop([s.id])},moveDown(){s.page.moveElementsDown([s.id])},moveBottom(){s.page.moveElementsBottom([s.id])},setZIndex(c){s.parent.setElementZIndex(s.id,c)},beforeDestroy(){}}))}(E1)),E1}var I1={},j1={},K3;function MP(){return K3||(K3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.registerAnimation=e.animate=e.animations=void 0;const n=Ec(),t={right:{from:{x:-200},to:{x:0}},left:{from:{x:200},to:{x:0}},up:{from:{y:200},to:{y:0}},down:{from:{y:-200},to:{y:0}},"bottom-right":{from:{x:-200,y:-200},to:{x:0,y:0}},"bottom-left":{from:{x:200,y:-200},to:{x:0,y:0}},"top-right":{from:{x:-200,y:200},to:{x:0,y:0}},"top-left":{from:{x:200,y:200},to:{x:0,y:0}}},r={right:{cropX:-1},left:{cropX:1},up:{cropY:1},down:{cropY:-1}};e.animations={fade:({dTime:a,element:o,animation:s})=>{const c=a/s.duration;return s.type==="enter"?{opacity:c*o.opacity}:{opacity:(1-c)*o.opacity}},rotate:({dTime:a,element:o,animation:s})=>{const c=a/s.duration*360;return(0,n.rotateAroundCenter)({x:o.x,y:o.y,width:o.width,height:o.height,rotation:o.rotation},c)},blink:({dTime:a,element:o,animation:s})=>{const c=s.duration,m=a%c/(c/2),f=m<=1?m:2-m;return{opacity:o.opacity*f}},bounce:({dTime:a,element:o,animation:s})=>{var c;const m=s.duration,f=m/2,v=(c=s.data.strength)!==null&&c!==void 0?c:1,y={},E={x:o.x+o.width/3*v,y:o.y+o.height/3*v,width:o.width/3*v,height:o.height/3*v,fontSize:o.fontSize/3*v},w={x:o.x,y:o.y,width:o.width,height:o.height,fontSize:o.fontSize},S=a%m/f,x=S<=1?S:2-S;for(let _ in E){const b=E[_],g=w[_]-b;y[_]=b+x*g}return y},move:({dTime:a,element:o,animation:s})=>{var c;const m=t[s.data.direction]||t.right,f=(c=s.data.strength)!==null&&c!==void 0?c:1,v={};for(var y in m.from){let E=m.from[y],w=m.to[y];s.type==="exit"&&(E=m.to[y],w=-m.from[y]),E*=f,w*=f;const S=o[y]+E,x=o[y]+w-S;v[y]=S+a/s.duration*x}return v},zoom:({dTime:a,element:o,animation:s})=>{var c;const m={},f=1+(((s.data.direction||"in")==="in"?.75:1.25)-1)*((c=s.data.strength)!==null&&c!==void 0?c:1),v=o.rotation*Math.PI/180,y=Math.cos(v),E=Math.sin(v),w=o.width*(1-f),S=o.height*(1-f),x=(w*y-S*E)/2,_=(w*E+S*y)/2,b={x:o.x+x,y:o.y+_,width:o.width*f,height:o.height*f,fontSize:o.fontSize*f},g={x:o.x,y:o.y,width:o.width,height:o.height,fontSize:o.fontSize};for(var h in b){let d=b[h],P=g[h];if(s.type==="exit"){const T=d;d=P,P=T}const M=P-d;m[h]=d+a/s.duration*M}return m},cameraZoom:({dTime:a,element:o,animation:s})=>{var c,m,f;const v={},y=s.data.direction||"right",E=r[y]||r.right,w=(c=s.data.movementStrength)!==null&&c!==void 0?c:.1,S=(m=s.data.shakeStrength)!==null&&m!==void 0?m:.015;f=s.data.zoomStrength;const x=a/s.duration,_=S*(1-x),b=Math.sin(12*x)*_*.7+Math.sin(8*x)*_*.3;s.type==="exit"&&Math.max(o.cropWidth||1,o.cropHeight||1),s.type;const g=1-Math.pow(1-x,2),h=o.cropX||0,d=o.cropY||0,P=o.cropWidth||1,M=o.cropHeight||1,T=P,I=M;let F,k,O=0,N=0;if(E.cropX){const A=E.cropX>0?1-(h+P):h;O=Math.min(A,Math.abs(w))*E.cropX}if(E.cropY){const A=E.cropY>0?1-(d+M):d;N=Math.min(A,Math.abs(w))*E.cropY}return s.type==="enter"?(F=E.cropX?h+O*(1-g):h,k=E.cropY?d+N*(1-g):d):(F=E.cropX?h+O*g:h,k=E.cropY?d+N*g:d),v.cropX=Math.max(0,Math.min(1-T,F+b*T)),v.cropY=Math.max(0,Math.min(1-I,k+b*I)),v.cropWidth=T,v.cropHeight=I,v}},e.animate=({element:a,dTime:o,animation:s})=>{const c=e.animations[s.name];return c?c({element:a,dTime:o,animation:s}):(console.error("Can not find animation type: "+s.name),{})},e.registerAnimation=(a,o)=>{e.animations[a]&&console.warn(`Animation "${a}" already exists and will be overridden`),e.animations[a]=o}}(j1)),j1}var X3;function xc(){return X3||(X3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.ShapeFilter=e.getDiff=e.Animation=void 0;const n=Zi,t=MP(),r=Xi,a=l_();e.Animation=n.types.model("Animation",{delay:0,duration:500,enabled:!0,type:n.types.enumeration("Type",["enter","exit","loop"]),name:"none",data:n.types.frozen({})}),e.getDiff=(o,s)=>{const c={};for(const m in s)if(typeof o[m]=="number"&&typeof s[m]=="number"){const f=s[m]-o[m];f!==0&&(c[m]=f)}return c},e.ShapeFilter=n.types.model("ShapeFilter",{intensity:1}),e.Shape=a.Node.named("Shape").props({x:0,y:0,width:100,height:100,rotation:0,opacity:1,animations:n.types.array(e.Animation),blurEnabled:!1,blurRadius:10,brightnessEnabled:!1,brightness:0,sepiaEnabled:!1,grayscaleEnabled:!1,filters:n.types.map(e.ShapeFilter),shadowEnabled:!1,shadowBlur:5,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black",shadowOpacity:1,visible:!0,draggable:!0,resizable:!0,selectable:!0,contentEditable:!0,styleEditable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(o=>{const s=Object.assign(Object.assign({},o),{x:o.x||0,y:o.y||0,filters:Array.isArray(o.filters)?{}:o.filters});return"width"in o&&(s.width=s.width||1),"height"in o&&(s.height=s.height||1),o.locked&&(s.draggable=!1,s.contentEditable=!1,s.styleEditable=!1,s.resizable=!1,s.removable=!1),s}).views(o=>{const s=(0,r.observable)({x:o.x,y:o.y,width:o.width,height:o.height,rotation:o.rotation,opacity:o.opacity,color:o.color,fontSize:o.fontSize}),c=(0,r.action)(f=>{Object.assign(s,f)}),m=(0,r.action)(f=>{for(const v in f)typeof s[v]=="number"&&(s[v]=s[v]+f[v])});return{get a(){const{currentTime:f}=o.store;if(c({x:o.x,y:o.y,width:o.width,height:o.height,rotation:o.rotation,opacity:o.opacity,color:o.color,fontSize:o.fontSize,cropX:o.cropX,cropY:o.cropY,cropWidth:o.cropWidth,cropHeight:o.cropHeight}),f===0)return s;const v=f-o.page.startTime;if(v>o.page.duration||v<0)return s;const y=o.store.animatedElementsIds;if(y.length&&!y.includes(o.id))return s;const E=o.animations.find(b=>b.type==="enter"),w=(E==null?void 0:E.enabled)&&v<E.delay;w&&c({opacity:0});const S=(E==null?void 0:E.enabled)&&v>=E.delay&&v<=E.delay+E.duration;if(S){const b=v-E.delay,g=(0,t.animate)({element:o,animation:E,dTime:b}),h=(0,e.getDiff)(o,g);m(h)}const x=o.animations.find(b=>b.type==="exit");if(!w&&!S&&(x!=null&&x.enabled)&&v>=o.page.duration-x.duration-x.delay&&v<=o.page.duration-x.delay){const b=v-(o.page.duration-x.duration-x.delay),g=(0,t.animate)({element:o,animation:x,dTime:b}),h=(0,e.getDiff)(o,g);m(h)}x!=null&&x.enabled&&v>=o.page.duration-x.delay&&c({opacity:0});const _=o.animations.find(b=>b.type==="loop");if(_!=null&&_.enabled){const b=v,g=(0,t.animate)({element:o,animation:_,dTime:b}),h=(0,e.getDiff)(o,g);m(h)}return s},animated:f=>o.a[f]}}).actions(o=>({setAnimation(s,c){const m=o.animations.find(f=>f.type===s);m?Object.assign(m,c):o.animations.push(Object.assign({type:s},c))},setFilter(s,c){o.filters.clear(),c!==0&&o.filters.set(s,{intensity:c})}}))}(I1)),I1}var D1={},Z3;function LP(){return Z3||(Z3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=void 0;const n=Zi,t=xc();e.TextElement=t.Shape.named("Text").props({type:"text",text:"",placeholder:"",fontSize:14,fontFamily:"Roboto",fontStyle:"normal",fontWeight:"normal",textDecoration:"",fill:"black",align:"center",width:100,height:0,verticalAlign:"top",strokeWidth:0,stroke:"black",lineHeight:n.types.optional(n.types.union(n.types.number,n.types.string),1.2),letterSpacing:0,_editModeEnabled:!1,backgroundEnabled:!1,backgroundColor:"#7ED321",backgroundOpacity:1,backgroundCornerRadius:.5,backgroundPadding:.5}).preProcessSnapshot(r=>Object.assign({},r)).actions(r=>({toggleEditMode(a){r._editModeEnabled=a??!r._editModeEnabled,r._editModeEnabled?r.store.history.startTransaction():r.store.history.endTransaction()}}))}(D1)),D1}var F1={},Q3;function rm(){return Q3||(Q3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=void 0;const n=xc();e.ImageElement=n.Shape.named("Image").props({type:"image",width:100,height:100,src:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,cornerRadius:0,flipX:!1,flipY:!1,clipSrc:"",borderColor:"black",borderSize:0,keepRatio:!1,_cropModeEnabled:!1}).actions(t=>({toggleCropMode(r){t._cropModeEnabled=r??!t._cropModeEnabled,t._cropModeEnabled?t.store.history.startTransaction():t.store.history.endTransaction()},beforeDestroy(){t._cropModeEnabled&&t.store.history.endTransaction()}}))}(F1)),F1}var z1={},J3;function NP(){return J3||(J3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=void 0;const n=rm();e.VideoElement=n.ImageElement.named("Video").props({type:"video",duration:0,startTime:0,endTime:1,volume:1})}(z1)),z1}var B1={},e5;function IP(){return e5||(e5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0;const n=Zi,t=xc();e.LineElement=t.Shape.named("Line").props({type:"line",width:400,height:10,color:"black",dash:n.types.array(n.types.number),startHead:"",endHead:""}).actions(r=>({}))}(B1)),B1}var U1={},t5;function jP(){return t5||(t5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SVGElement=void 0;const n=Zi,t=xc();e.SVGElement=t.Shape.named("SVG").props({type:"svg",src:"",maskSrc:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,keepRatio:!0,flipX:!1,flipY:!1,width:100,height:100,borderColor:"black",borderSize:0,cornerRadius:0,colorsReplace:n.types.map(n.types.string)}).preProcessSnapshot(r=>Object.assign(Object.assign({},r),{src:r.src||r.svgSource,colorsReplace:Array.isArray(r.colorsReplace)?{}:r.colorsReplace})).actions(r=>({replaceColor(a,o){r.colorsReplace.set(a,o)}}))}(U1)),U1}var q1={},r5;function DP(){return r5||(r5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const n=Zi,t=xc();e.FigureElement=t.Shape.named("Figure").props({type:"figure",subType:"rect",fill:"rgb(0, 161, 255)",dash:n.types.array(n.types.number),strokeWidth:0,stroke:"rgba(98, 197, 255, 1)",cornerRadius:0})}(q1)),q1}var H1={},n5;function FP(){return n5||(n5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GifElement=void 0;const n=rm();e.GifElement=n.ImageElement.named("Gif").props({type:"gif",duration:0,keepRatio:!0})}(H1)),H1}var i5;function Id(){return i5||(i5=1,function(e){var n=Sd&&Sd.__rest||function(x,_){var b={};for(var g in x)Object.prototype.hasOwnProperty.call(x,g)&&_.indexOf(g)<0&&(b[g]=x[g]);if(x!=null&&typeof Object.getOwnPropertySymbols=="function"){var h=0;for(g=Object.getOwnPropertySymbols(x);h<g.length;h++)_.indexOf(g[h])<0&&Object.prototype.propertyIsEnumerable.call(x,g[h])&&(b[g[h]]=x[g[h]])}return b};Object.defineProperty(e,"__esModule",{value:!0}),e.TYPES_MAP=e.GroupElement=e.ElementTypes=e.forEveryChild=void 0,e.registerShapeModel=function(x,_){const b=x.type;if(!b)throw new Error('You must pass "type" attribute to custom model.');let g=o.Shape.named(b).props(x);_&&(g=_(g)),e.TYPES_MAP[b]=g,S.push(g)};const t=Zi,r=Yp,a=l_(),o=xc(),s=LP(),c=rm(),m=NP(),f=IP(),v=jP(),y=DP(),E=FP();e.forEveryChild=(x,_)=>{if(x.children)for(const b of x.children){if(_(b)===!0)break;(0,e.forEveryChild)(b,_)}};const w=[...new Array(20)].map((x,_)=>t.types.late(()=>S[_]));e.ElementTypes=t.types.union({dispatcher:x=>{const _=e.TYPES_MAP[x.type];if(!_)throw new Error(`Unknown element type: "${x.type}"`);return _}},v.SVGElement,s.TextElement,c.ImageElement,f.LineElement,m.VideoElement,y.FigureElement,E.GifElement,t.types.late(()=>e.GroupElement),...w),e.GroupElement=a.Node.named("Group").props({type:"group",children:t.types.array(e.ElementTypes)}).views(x=>({get draggable(){let _=!0;return(0,e.forEveryChild)(x,b=>{b.draggable||(_=!1)}),_},get resizable(){let _=!0;return(0,e.forEveryChild)(x,b=>{b.resizable||(_=!1)}),_},get contentEditable(){let _=!0;return(0,e.forEveryChild)(x,b=>{b.contentEditable||(_=!1)}),_},get styleEditable(){let _=!0;return(0,e.forEveryChild)(x,b=>{b.styleEditable||(_=!1)}),_},get locked(){let _=!0;return(0,e.forEveryChild)(x,b=>{b.locked||(_=!1)}),_}})).actions(x=>({set(_){var{draggable:b,contentEditable:g,styleEditable:h,resizable:d}=_,P=n(_,["draggable","contentEditable","styleEditable","resizable"]);b!==void 0&&(0,e.forEveryChild)(x,M=>{M.set({draggable:b})}),g!==void 0&&(0,e.forEveryChild)(x,M=>{M.set({contentEditable:g})}),h!==void 0&&(0,e.forEveryChild)(x,M=>{M.set({styleEditable:h})}),d!==void 0&&(0,e.forEveryChild)(x,M=>{M.set({resizable:d})}),Object.assign(x,P)},addElement(_,{skipSelect:b=!1}={}){const g=e.TYPES_MAP[_.type];if(!g)return void console.error("Can not find model with type "+_.type);_.children&&_.children.forEach(d=>{d.id=(0,r.nanoid)(10)});const h=g.create(Object.assign({id:(0,r.nanoid)(10)},_));return x.children.push(h),h.selectable&&!b&&x.store.selectElements([h.id]),h},setElementZIndex(_,b){const g=x.children.find(h=>h.id===_);g&&((0,t.detach)(g),x.children.remove(g),x.children.splice(b,0,g))}}));const S=[];e.TYPES_MAP={svg:v.SVGElement,text:s.TextElement,image:c.ImageElement,group:e.GroupElement,line:f.LineElement,video:m.VideoElement,figure:y.FigureElement,gif:E.GifElement}}(Sd)),Sd}var a5;function zP(){return a5||(a5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isClipboardEmpty=e.paste=e.cut=e.copy=void 0;const n=Id(),t=Ec();let r={data:[],pageId:""};const a="polotno_clipboard",o=(c,m)=>{r={data:JSON.parse(JSON.stringify(c)),pageId:m};try{localStorage.setItem(a,JSON.stringify(c)),localStorage.setItem(a+"_page",m)}catch{}},s=()=>{try{const c=localStorage.getItem(a),m=localStorage.getItem(a+"_page");if(c)return{data:JSON.parse(c),pageId:m}}catch{}return r};e.copy=c=>{var m;c.selectedElements.length!==0&&o(c.selectedElements.map(f=>f.toJSON()),(m=c.activePage)===null||m===void 0?void 0:m.id)},e.cut=c=>{var m;o(c.selectedElements.map(v=>v.toJSON()),(m=c.activePage)===null||m===void 0?void 0:m.id);let f=c.selectedElements.filter(v=>v.removable).map(v=>v.id);c.deleteElements(f)},e.paste=c=>{c.history.transaction(()=>{var m,f;let v=0,y=0;const{data:E,pageId:w}=s();if(w===((m=c.activePage)===null||m===void 0?void 0:m.id))v=c.width/20,y=c.height/20;else{const x=[];(0,n.forEveryChild)({children:E},b=>{b.type!=="group"&&x.push(b)});const _=(0,t.getTotalClientRect)(x);_.maxX>c.width&&(v=-_.minX),_.maxY>c.height&&(y=-_.minY)}const S=[];(0,n.forEveryChild)({children:E},x=>{delete x.id,x.type!=="group"&&(x.x+=v,x.y+=y)}),E.forEach(x=>{var _;const b=(_=c.activePage)===null||_===void 0?void 0:_.addElement(x);b&&S.push(b.id)}),o(E,(f=c.activePage)===null||f===void 0?void 0:f.id),c.selectElements(S)})},e.isClipboardEmpty=()=>s().data.length===0}(S1)),S1}var o5;function BP(){return o5||(o5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.handleHotkey=function(t,r){var a,o,s,c;if(((a=document.activeElement)===null||a===void 0?void 0:a.tagName)==="INPUT"||((o=document.activeElement)===null||o===void 0?void 0:o.tagName)==="TEXTAREA"||((s=document.activeElement)===null||s===void 0?void 0:s.contentEditable)==="true")return;const m=r.selectedElements.filter(y=>y.removable).map(y=>y.id);t.keyCode!==46&&t.keyCode!==8||r.deleteElements(m);const f=t.ctrlKey||t.metaKey,v=t.shiftKey;if(!f||v||t.key.toLowerCase()!=="z"&&t.key.toLowerCase()!=="y"||(t.preventDefault(),r.history.undo()),f&&v&&(t.key.toLowerCase()==="z"||t.key.toLowerCase()==="y")&&(t.preventDefault(),r.history.redo()),f&&t.code==="KeyA"){t.preventDefault();const y=(c=r.activePage)===null||c===void 0?void 0:c.children.filter(w=>w.selectable),E=(y==null?void 0:y.map(w=>w.id))||[];r.selectElements(E)}f&&t.code==="KeyC"&&(t.preventDefault(),(0,n.copy)(r)),f&&t.code==="KeyX"&&(t.preventDefault(),(0,n.cut)(r)),f&&t.code==="KeyV"&&(t.preventDefault(),(0,n.paste)(r)),t.code==="ArrowDown"&&(t.preventDefault(),r.selectedElements.forEach(y=>{y.draggable&&y.set({y:y.y+1})})),t.code==="ArrowUp"&&(t.preventDefault(),r.selectedElements.forEach(y=>{y.draggable&&y.set({y:y.y-1})})),t.code==="ArrowLeft"&&(t.preventDefault(),r.selectedElements.forEach(y=>{y.draggable&&y.set({x:y.x-1})})),t.code==="ArrowRight"&&(t.preventDefault(),r.selectedElements.forEach(y=>{y.draggable&&y.set({x:y.x+1})}))};const n=zP()}(_1)),_1}var G1={},l5;function UP(){return l5||(l5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t=e.getTranslations=e.setTranslations=void 0;const n=Xi,t=(0,n.observable)({toolbar:{duration:"Duration",opacity:"Opacity",effects:"Effects",blur:"Blur",textBackground:"Background",backgroundCornerRadius:"Corner radius",backgroundOpacity:"Opacity",backgroundPadding:"Padding",brightness:"Brightness",filters:"Filters",sepia:"Sepia",grayscale:"Grayscale",textStroke:"Text Stroke",shadow:"Shadow",border:"Border",cornerRadius:"Corner Radius",copyStyle:"Copy style",position:"Position",layering:"Layering",toForward:"To forward",up:"Up",down:"Down",toBottom:"To bottom",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom",flip:"Flip",flipHorizontally:"Flip horizontally",flipVertically:"Flip vertically",fitToBackground:"Fit to page",removeBackground:"Remove background",removeBackgroundTitle:"Remove background from image",cancelRemoveBackground:"Cancel",confirmRemoveBackground:"Confirm",crop:"Crop",cropDone:"Done",cropCancel:"Cancel",clip:"Apply mask",removeClip:"Remove mask",removeMask:"Remove mask",transparency:"Transparency",lockedDescription:"Object is locked. Unlock it to allow changes from canvas.",unlockedDescription:"Object is unlocked. Lock it to prevent changes from canvas.",removeElements:"Remove elements",duplicateElements:"Duplicate elements",download:"Download",saveAsImage:"Save as image",saveAsPDF:"Save as PDF",lineHeight:"Line height",letterSpacing:"Letter spacing",offsetX:"Offset X",offsetY:"Offset Y",color:"Color",selectable:"Selectable",draggable:"Draggable",removable:"Removable",resizable:"Resizable",contentEditable:"Can change content",styleEditable:"Can change style",alwaysOnTop:"Always on top",showInExport:"Show in export",ungroupElements:"Ungroup",groupElements:"Group",lineSize:"Line size",fade:"Fade",move:"Move",zoom:"Zoom",animate:"Animate",rotate:"Rotate",none:"None",bounce:"Bounce",blink:"Blink",strength:"Strength",spaceEvenly:"Space evenly",horizontalDistribution:"Horizontally",verticalDistribution:"Vertically",strokeWidth:"Stroke Width",colorPicker:{solid:"Solid",linear:"Linear"},aiText:{aiWrite:"AI write",rewrite:"Rewrite",shorten:"Shorten",continue:"Continue writing",proofread:"Proofread",tones:"Tones",friendly:"Friendly",professional:"Professional",humorous:"Humorous",formal:"Formal",customPrompt:"Custom prompt",generatedResult:"Generated result",cancel:"Cancel",generate:"Generate",back:"Back",tryAgain:"Try Again",insert:"Insert",promptPlaceholder:"Describe what you want to generate"}},workspace:{noPages:"There are no pages yet...",addPage:"Add page",removePage:"Remove page",duplicatePage:"Duplicate page",moveUp:"Move up",moveDown:"Move down"},scale:{reset:"Reset"},error:{removeBackground:"Ops! Something went wrong. Background can not be removed."},sidePanel:{templates:"Templates",searchTemplatesWithSameSize:"Show templates with the same size",searchPlaceholder:"Search...",otherFormats:"Other formats",noResults:"No results",error:"Loading is failed...",text:"Text",uploadFont:"Upload font",myFonts:"My fonts",photos:"Photos",videos:"Videos",animations:"Animations",effects:"Effects",elements:"Elements",shapes:"Shapes",lines:"Lines",upload:"Upload",uploadImage:"Add file",uploadTip:"Upload your assets",background:"Background",resize:"Resize",layers:"Layers",animate:"Animate",layerTypes:{image:"Image",text:"Text",svg:"SVG",line:"Line",figure:"Figure",group:"Group"},layersTip:"Elements on your active page:",noLayers:"No elements on the page...",namePlaceholder:"Type element name...",useMagicResize:"Use magic resize",clipImage:"Mask image",width:"Width",height:"Height",magicResizeDescription:"Magic resize will automatically resize and move all elements on the canvas",headerText:"Header",createHeader:"Create header",subHeaderText:"Sub Header",createSubHeader:"Create sub header",bodyText:"Body text",createBody:"Create body text"},pagesTimeline:{pages:"Pages",removePage:"Remove page",addPage:"Add page",duplicatePage:"Duplicate page",removeAudio:"Remove audio"},contextMenu:{duplicate:"Duplicate",remove:"Remove",lock:"Lock",unlock:"Unlock",copy:"Copy",paste:"Paste",copyStyle:"Copy style",moveUp:"Move up",moveDown:"Move down",moveBack:"Move back",moveForward:"Move forward"}}),r=c=>c&&typeof c=="object";function a(c,m){Object.keys(m).forEach(f=>{const v=c[f],y=m[f];r(y)&&r(v)?a(v,y):c[f]=y})}function o(c,m,f=""){Object.keys(m).forEach(v=>{const y=m[v],E=f?`${f}.${v}`:v;r(y)?r(c[v])?o(c[v],y,E):console.warn(`Missing nested translation object at '${E}'`):c[v]===void 0&&console.warn(`Missing translation '${E}'`)})}e.setTranslations=(0,n.action)((c,{validate:m=!1}={})=>{m&&o(c,t),a(t,c)}),e.getTranslations=()=>(0,n.toJS)(t);const s={};e.t=c=>{const m=function(y,E){var w,S=E.split("."),x=y;for(w=0;w<S.length;++w){if(x[S[w]]==null)return;x=x[S[w]]}return x}(t,c);if(m!==void 0)return m;s[c]||(s[c]=!0,console.warn(`Missing translation '${c}'`));const f=c.split("."),v=f[f.length-1]||" ";return v.charAt(0).toUpperCase()+v.slice(1)}}(G1)),G1}var s5;function qP(){return s5||(s5=1,function(e){var n=yf&&yf.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceCanvas=void 0;const t=n(Or()),r=Ri,a=n(vP()),o=mP(),s=yP(),c=BP(),m=UP(),f=({store:y})=>t.default.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},t.default.createElement("p",null,(0,m.t)("workspace.noPages")),t.default.createElement("button",{onClick:()=>{y.addPage()}},(0,m.t)("workspace.addPage"))),v=({width:y,height:E,xPadding:w,yPadding:S,backgroundColor:x})=>t.default.createElement("div",{style:{width:y+"px",height:E+"px",backgroundColor:x,paddingLeft:w+"px",paddingRight:w+"px",paddingTop:S+"px",paddingBottom:S+"px"}},t.default.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}}));e.WorkspaceCanvas=(0,r.observer)(({store:y,pageControlsEnabled:E,backgroundColor:w,pageBorderColor:S,activePageBorderColor:x,bleedColor:_,components:b,onKeyDown:g,paddingX:h,paddingY:d,altCloneEnabled:P=!0,visiblePagesOffset:M,renderOnlyActivePage:T})=>{var I;const F=h??20,k=d??55,[O,N]=t.default.useState({width:100,height:100}),A=t.default.useRef(O),R=t.default.useRef(null),L=t.default.useRef(null),V=y.bleedVisible?Math.max(0,...y.pages.map(ye=>ye.bleed)):0,G=Math.max(...y.pages.map(ye=>ye.computedWidth)),W=Math.max(...y.pages.map(ye=>ye.computedHeight)),X=((I=y.activePage)===null||I===void 0?void 0:I.computedHeight)||0,q=G+2*V,z=(T?X:W)+2*V,Y=async({skipTimeout:ye}={skipTimeout:!1})=>{if(ye||await new Promise(oe=>setTimeout(oe,50)),R.current===null)return;const we=R.current.getBoundingClientRect();we.width!==0&&we.height!==0||(console.warn(`Polotno warning: <Workspace /> component can not automatically detect its size.
|
|
327
327
|
Width or height of parent elements is equal 0.
|
|
328
328
|
Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
|
|
329
|
-
For simpler debugging here is the log of the parent element:`),console.log(R.current));const je=L.current.clientWidth||we.width,Te={width:je,height:we.height};(A.current.width!==Te.width||A.current.height!==Te.height)&&(N(Te),A.current=Te);const se=(je-2*F)/q,_e=y.pages.length>1?3.1:2,he=(we.height-k*_e)/z,xe=Math.max(Math.min(se,he),.01);y.scaleToFit!==xe&&(y.setScale(xe),y._setScaleToFit(xe))};t.default.useLayoutEffect(()=>{Y({skipTimeout:!0})},[]),t.default.useEffect(()=>{Y()},[q,z]),t.default.useEffect(()=>{y.__()},[]),t.default.useEffect(()=>{const ye=R.current;if(window.ResizeObserver){const we=new ResizeObserver(()=>{Y({skipTimeout:!0})});return we.observe(ye),()=>we.unobserve(ye)}{const we=setInterval(()=>{Y({skipTimeout:!0})},100);return()=>clearInterval(we)}},[q,z]);const U=Math.max(F,(O.width-q*y.scale)/2),ee=T?1:y.pages.length,te=z*y.scale*ee,Q=Math.max(k,(O.height-te)/ee/2);t.default.useEffect(()=>{const ye=we=>{(g||c.handleHotkey)(we,y)};return window.addEventListener("keydown",ye),()=>window.removeEventListener("keydown",ye)},[]),t.default.useEffect(()=>{var ye;const we=je=>{if(je.ctrlKey||je.metaKey){je.preventDefault();const he=Math.max(3,y.scaleToFit),xe=Math.min(.1,y.scaleToFit),oe=(Te=je.deltaY<0?1.02*y.scale:y.scale/1.02,se=xe,_e=he,Math.max(se,Math.min(_e,Te)));y.setScale(oe)}else var Te,se,_e};return(ye=L.current)===null||ye===void 0||ye.addEventListener("wheel",we),()=>{var je;return(je=L.current)===null||je===void 0?void 0:je.removeEventListener("wheel",we)}},[]);const Z=t.default.useRef(!1);((ye,we,je,Te,se,_e)=>{const he=t.default.useRef({width:we,height:je}),xe=t.default.useRef({top:0,left:0}),oe=t.default.useRef(!1),ve=t.default.useRef(se.pages.length);oe.current=ve.current!==se.pages.length,ve.current=se.pages.length,t.default.useEffect(()=>{const de=ye.current,ke=Be=>{xe.current={top:de.scrollTop,left:de.scrollLeft}};return de.addEventListener("scroll",ke),()=>{de.removeEventListener("scroll",ke)}},[]),t.default.useLayoutEffect(()=>{if(!ye.current||oe.current)return;const de=ye.current,ke=(xe.current.left+de.offsetWidth/2)/he.current.width,Be=(xe.current.top+de.offsetHeight/2)/he.current.height;_e.current=!0,de.scrollLeft=ke*we-de.offsetWidth/2,de.scrollTop=Be*je-de.offsetHeight/2,he.current={width:we,height:je}},[Te,we,je])})(L,q*y.scale+2*U,z*y.scale+2*Q,y.scale,y,Z);const{handleScroll:re}=((ye,we,je,Te,se,_e)=>{const he=t.default.useRef(!1),xe=t.default.useRef(null),oe=t.default.useRef(!1);t.default.useEffect(()=>{const de=ye.current,ke=()=>{se.current};return de.addEventListener("scroll",ke),()=>{de.removeEventListener("scroll",ke)}},[]);const ve=je.pages.indexOf(je.activePage);return t.default.useLayoutEffect(()=>{if(!je.activePage||!ye.current||he.current)return;const de=ye.current,ke=je.pages.indexOf(je.activePage)*we;let Be=()=>{};return(Math.abs(ke-de.scrollTop)>.5*we||oe.current)&&(oe.current=!0,Be=(({element:Qe,scrollTop:Ke=0,duration:St=300,onFinish:Ue=()=>{}})=>{const rt=Qe.scrollTop,gt=Ke-rt;let mt=0,kt=!1;if(St===0)return Qe.scrollTop=Ke,()=>{};const jt=()=>{if(kt)return;mt+=20;const Se=Oe(mt,rt,gt,St);Qe.scrollTop=Se,mt<St?setTimeout(jt,20):Ue()},Oe=(Se,yt,Fe,qe)=>(Se/=qe/2)<1?Fe/2*Se*Se+yt:-Fe/2*(--Se*(Se-2)-1)+yt;return jt(),()=>{kt=!0}})({element:de,scrollTop:ke,onFinish:()=>{oe.current=!1},duration:je.isPlaying?0:300})),Be},[je.activePage,ve,je.isPlaying]),{handleScroll:de=>{if(_e||oe.current)return;he.current=!0,clearTimeout(xe.current),xe.current=setTimeout(()=>{he.current=!1},300);const ke=de.currentTarget.childNodes[0].offsetHeight,Be=de.currentTarget.scrollTop,Qe=Math.floor((Be+Te.height/3)/ke),Ke=je.pages[Qe];Ke&&je.activePage!==Ke&&Ke.select()}}})(L,z*y.scale+2*Q,y,O,Z,T),ne=O.width>=q*y.scale+2*U,ae=w||"rgba(232, 232, 232, 0.9)",ue=y.pages.indexOf(y.activePage),fe=(b==null?void 0:b.NoPages)||f,pe=M??Math.min(3,Math.max(1,Math.ceil(O.height/2/(z*y.scale))));return t.default.createElement("div",{ref:R,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:ae,overflow:"hidden"},tabIndex:0,className:"polotno-workspace-container"},t.default.createElement("div",{ref:L,onScroll:re,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:ne?"hidden":"auto"},className:"polotno-workspace-inner"},y.pages.map((ye,we)=>{const je=ye===y.activePage;if(T&&!je&&!ye._exportingOrRendering&&!ye._forceMount)return null;if(!(Math.abs(we-ue)<=pe||ye._exportingOrRendering||ye._forceMount))return t.default.createElement(v,{key:ye.id,width:q*y.scale+2*U,height:z*y.scale+2*Q,backgroundColor:ae,xPadding:U,yPadding:Q});const Te=t.default.createElement(a.default,{key:ye.id,page:ye,xPadding:U,yPadding:Q,width:q*y.scale+2*U,height:z*y.scale+2*Q,store:y,pageControlsEnabled:E,backColor:ae,pageBorderColor:S||"lightgrey",activePageBorderColor:x||"rgb(0, 161, 255)",altCloneEnabled:P,bleedColor:_||"rgba(255, 0, 0, 0.1)",components:b,viewportSize:O});return(ye._exportingOrRendering||ye._forceMount)&&!je&&T?t.default.createElement("div",{style:{display:"none"},key:ye.id},Te):Te}),y.rulesVisible&&t.default.createElement(o.TopRules,{store:y,xPadding:U,yPadding:Q,width:q*y.scale+2*U,height:z*y.scale+2*Q}),y.pages.length===0&&t.default.createElement(fe,{store:y}),y.audios.map(ye=>t.default.createElement(s.AudioElement,{key:ye.id,audio:ye,store:y}))))}),e.default=e.WorkspaceCanvas}(yf)),yf}var HP=qP(),GP=tm(),VP=Ys(),xd=Jl(),V1=Ks(),$P=Vd();VP.toggleFadeInAnimation(!1);xd.setTextOverflow("change-font-size");const WP=new URLSearchParams(location.search).get("key"),s_=GP.createStore({key:WP});window.store=s_;window.config={addGlobalFont:$P.addGlobalFont,unstable_useHtmlTextRender:xd.useHtmlTextRender,unstable_setTextVerticalResizeEnabled:xd.setTextVerticalResizeEnabled,unstable_setTextOverflow:xd.setTextOverflow,onLoadError:V1.onLoadError,setAssetLoadTimeout:V1.setAssetLoadTimeout,setFontLoadTimeout:V1.setFontLoadTimeout,unstable_setTextSplitAllowed:xd.setTextSplitAllowed};const YP=
|
|
329
|
+
For simpler debugging here is the log of the parent element:`),console.log(R.current));const je=L.current.clientWidth||we.width,Te={width:je,height:we.height};(A.current.width!==Te.width||A.current.height!==Te.height)&&(N(Te),A.current=Te);const se=(je-2*F)/q,_e=y.pages.length>1?3.1:2,he=(we.height-k*_e)/z,xe=Math.max(Math.min(se,he),.01);y.scaleToFit!==xe&&(y.setScale(xe),y._setScaleToFit(xe))};t.default.useLayoutEffect(()=>{Y({skipTimeout:!0})},[]),t.default.useEffect(()=>{Y()},[q,z]),t.default.useEffect(()=>{y.__()},[]),t.default.useEffect(()=>{const ye=R.current;if(window.ResizeObserver){const we=new ResizeObserver(()=>{Y({skipTimeout:!0})});return we.observe(ye),()=>we.unobserve(ye)}{const we=setInterval(()=>{Y({skipTimeout:!0})},100);return()=>clearInterval(we)}},[q,z]);const U=Math.max(F,(O.width-q*y.scale)/2),ee=T?1:y.pages.length,te=z*y.scale*ee,Q=Math.max(k,(O.height-te)/ee/2);t.default.useEffect(()=>{const ye=we=>{(g||c.handleHotkey)(we,y)};return window.addEventListener("keydown",ye),()=>window.removeEventListener("keydown",ye)},[]),t.default.useEffect(()=>{var ye;const we=je=>{if(je.ctrlKey||je.metaKey){je.preventDefault();const he=Math.max(3,y.scaleToFit),xe=Math.min(.1,y.scaleToFit),oe=(Te=je.deltaY<0?1.02*y.scale:y.scale/1.02,se=xe,_e=he,Math.max(se,Math.min(_e,Te)));y.setScale(oe)}else var Te,se,_e};return(ye=L.current)===null||ye===void 0||ye.addEventListener("wheel",we),()=>{var je;return(je=L.current)===null||je===void 0?void 0:je.removeEventListener("wheel",we)}},[]);const Z=t.default.useRef(!1);((ye,we,je,Te,se,_e)=>{const he=t.default.useRef({width:we,height:je}),xe=t.default.useRef({top:0,left:0}),oe=t.default.useRef(!1),ve=t.default.useRef(se.pages.length);oe.current=ve.current!==se.pages.length,ve.current=se.pages.length,t.default.useEffect(()=>{const de=ye.current,ke=Be=>{xe.current={top:de.scrollTop,left:de.scrollLeft}};return de.addEventListener("scroll",ke),()=>{de.removeEventListener("scroll",ke)}},[]),t.default.useLayoutEffect(()=>{if(!ye.current||oe.current)return;const de=ye.current,ke=(xe.current.left+de.offsetWidth/2)/he.current.width,Be=(xe.current.top+de.offsetHeight/2)/he.current.height;_e.current=!0,de.scrollLeft=ke*we-de.offsetWidth/2,de.scrollTop=Be*je-de.offsetHeight/2,he.current={width:we,height:je}},[Te,we,je])})(L,q*y.scale+2*U,z*y.scale+2*Q,y.scale,y,Z);const{handleScroll:re}=((ye,we,je,Te,se,_e)=>{const he=t.default.useRef(!1),xe=t.default.useRef(null),oe=t.default.useRef(!1);t.default.useEffect(()=>{const de=ye.current,ke=()=>{se.current};return de.addEventListener("scroll",ke),()=>{de.removeEventListener("scroll",ke)}},[]);const ve=je.pages.indexOf(je.activePage);return t.default.useLayoutEffect(()=>{if(!je.activePage||!ye.current||he.current)return;const de=ye.current,ke=je.pages.indexOf(je.activePage)*we;let Be=()=>{};return(Math.abs(ke-de.scrollTop)>.5*we||oe.current)&&(oe.current=!0,Be=(({element:Qe,scrollTop:Ke=0,duration:St=300,onFinish:Ue=()=>{}})=>{const rt=Qe.scrollTop,gt=Ke-rt;let mt=0,kt=!1;if(St===0)return Qe.scrollTop=Ke,()=>{};const jt=()=>{if(kt)return;mt+=20;const Se=Oe(mt,rt,gt,St);Qe.scrollTop=Se,mt<St?setTimeout(jt,20):Ue()},Oe=(Se,yt,Fe,qe)=>(Se/=qe/2)<1?Fe/2*Se*Se+yt:-Fe/2*(--Se*(Se-2)-1)+yt;return jt(),()=>{kt=!0}})({element:de,scrollTop:ke,onFinish:()=>{oe.current=!1},duration:je.isPlaying?0:300})),Be},[je.activePage,ve,je.isPlaying]),{handleScroll:de=>{if(_e||oe.current)return;he.current=!0,clearTimeout(xe.current),xe.current=setTimeout(()=>{he.current=!1},300);const ke=de.currentTarget.childNodes[0].offsetHeight,Be=de.currentTarget.scrollTop,Qe=Math.floor((Be+Te.height/3)/ke),Ke=je.pages[Qe];Ke&&je.activePage!==Ke&&Ke.select()}}})(L,z*y.scale+2*Q,y,O,Z,T),ne=O.width>=q*y.scale+2*U,ae=w||"rgba(232, 232, 232, 0.9)",ue=y.pages.indexOf(y.activePage),fe=(b==null?void 0:b.NoPages)||f,pe=M??Math.min(3,Math.max(1,Math.ceil(O.height/2/(z*y.scale))));return t.default.createElement("div",{ref:R,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:ae,overflow:"hidden"},tabIndex:0,className:"polotno-workspace-container"},t.default.createElement("div",{ref:L,onScroll:re,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:ne?"hidden":"auto"},className:"polotno-workspace-inner"},y.pages.map((ye,we)=>{const je=ye===y.activePage;if(T&&!je&&!ye._exportingOrRendering&&!ye._forceMount)return null;if(!(Math.abs(we-ue)<=pe||ye._exportingOrRendering||ye._forceMount))return t.default.createElement(v,{key:ye.id,width:q*y.scale+2*U,height:z*y.scale+2*Q,backgroundColor:ae,xPadding:U,yPadding:Q});const Te=t.default.createElement(a.default,{key:ye.id,page:ye,xPadding:U,yPadding:Q,width:q*y.scale+2*U,height:z*y.scale+2*Q,store:y,pageControlsEnabled:E,backColor:ae,pageBorderColor:S||"lightgrey",activePageBorderColor:x||"rgb(0, 161, 255)",altCloneEnabled:P,bleedColor:_||"rgba(255, 0, 0, 0.1)",components:b,viewportSize:O});return(ye._exportingOrRendering||ye._forceMount)&&!je&&T?t.default.createElement("div",{style:{display:"none"},key:ye.id},Te):Te}),y.rulesVisible&&t.default.createElement(o.TopRules,{store:y,xPadding:U,yPadding:Q,width:q*y.scale+2*U,height:z*y.scale+2*Q}),y.pages.length===0&&t.default.createElement(fe,{store:y}),y.audios.map(ye=>t.default.createElement(s.AudioElement,{key:ye.id,audio:ye,store:y}))))}),e.default=e.WorkspaceCanvas}(yf)),yf}var HP=qP(),GP=tm(),VP=Ys(),xd=Jl(),V1=Ks(),$P=Vd();VP.toggleFadeInAnimation(!1);xd.setTextOverflow("change-font-size");const WP=new URLSearchParams(location.search).get("key"),s_=GP.createStore({key:WP});window.store=s_;window.config={addGlobalFont:$P.addGlobalFont,unstable_useHtmlTextRender:xd.useHtmlTextRender,unstable_setTextVerticalResizeEnabled:xd.setTextVerticalResizeEnabled,unstable_setTextOverflow:xd.setTextOverflow,onLoadError:V1.onLoadError,setAssetLoadTimeout:V1.setAssetLoadTimeout,setFontLoadTimeout:V1.setFontLoadTimeout,unstable_setTextSplitAllowed:xd.setTextSplitAllowed};const YP=c5.createRoot(document.getElementById("root"));YP.render(Gt.createElement(HP.WorkspaceCanvas,{visiblePagesOffset:0,store:s_,components:{PageControls:()=>null,Tooltip:()=>null}}));
|