polotno-node 2.10.8 → 2.10.9
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.
|
@@ -39,7 +39,7 @@ 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 Is=Qe;function ik(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ok=typeof Object.is=="function"?Object.is:ik,ak=Is.useState,lk=Is.useEffect,sk=Is.useLayoutEffect,uk=Is.useDebugValue;function ck(t,e){var n=e(),r=ak({inst:{value:n,getSnapshot:e}}),i=r[0].inst,o=r[1];return sk(function(){i.value=n,i.getSnapshot=e,B1(i)&&o({inst:i})},[t,n,e]),lk(function(){return B1(i)&&o({inst:i}),t(function(){B1(i)&&o({inst:i})})},[t]),uk(n),n}function B1(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!ok(t,n)}catch{return!0}}function fk(t,e){return e()}var dk=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?fk:ck;Q8.useSyncExternalStore=Is.useSyncExternalStore!==void 0?Is.useSyncExternalStore:dk;Z8.exports=Q8;var hk=Z8.exports;function k5(t){t.reaction=new Oi("observer".concat(t.name),function(){var e;t.stateVersion=Symbol(),(e=t.onStoreChange)===null||e===void 0||e.call(t)})}function Ly(t,e){if(e===void 0&&(e="observed"),My())return t();var n=dt.useRef(null);if(!n.current){var r={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:e,subscribe:function(l){return yh.unregister(r),r.onStoreChange=l,r.reaction||(k5(r),r.stateVersion=Symbol()),function(){var s;r.onStoreChange=null,(s=r.reaction)===null||s===void 0||s.dispose(),r.reaction=null}},getSnapshot:function(){return r.stateVersion}};n.current=r}var i=n.current;i.reaction||(k5(i),yh.register(n,i,i)),dt.useDebugValue(i.reaction,JC),hk.useSyncExternalStore(i.subscribe,i.getSnapshot,i.getSnapshot);var o,a;if(i.reaction.track(function(){try{o=t()}catch(l){a=l}}),a)throw a;return o}var U1,H1,J8=typeof Symbol=="function"&&Symbol.for,pk=(H1=(U1=Object.getOwnPropertyDescriptor(function(){},"name"))===null||U1===void 0?void 0:U1.configurable)!==null&&H1!==void 0?H1:!1,T5=J8?Symbol.for("react.forward_ref"):typeof Qe.forwardRef=="function"&&Qe.forwardRef(function(t){return null}).$$typeof,A5=J8?Symbol.for("react.memo"):typeof Qe.memo=="function"&&Qe.memo(function(t){return null}).$$typeof;function gk(t,e){var n;if(A5&&t.$$typeof===A5)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(My())return t;var r=(n=e==null?void 0:e.forwardRef)!==null&&n!==void 0?n:!1,i=t,o=t.displayName||t.name;if(T5&&t.$$typeof===T5&&(r=!0,i=t.render,typeof i!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var a=function(l,s){return Ly(function(){return i(l,s)},o)};return a.displayName=t.displayName,pk&&Object.defineProperty(a,"name",{value:t.name,writable:!0,configurable:!0}),t.contextTypes&&(a.contextTypes=t.contextTypes),r&&(a=Qe.forwardRef(a)),a=Qe.memo(a),mk(t,a),a}var vk={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function mk(t,e){Object.keys(t).forEach(function(n){vk[n]||Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}function e9(t){var e=t.children,n=t.render,r=e||n;return typeof r!="function"?null:Ly(r)}e9.displayName="Observer";function yk(t,e){return Qe.useState(function(){return Rt(t(),e,{autoBind:!0})})[0]}function t9(t){var e=Qe.useState(function(){return Rt(t,{},{deep:!1})})[0];return Ls(function(){Object.assign(e,t)}),e}function bk(t,e){var n=e&&t9(e);return Qe.useState(function(){return Rt(t(n),void 0,{autoBind:!0})})[0]}var $1;Y8(Vw.unstable_batchedUpdates);var _k=($1=yh.finalizeAllImmediately)!==null&&$1!==void 0?$1:function(){};function wk(t,e){return e===void 0&&(e="observed"),Ly(t,e)}function Sk(t){X8(t)}const Ek=Object.freeze(Object.defineProperty({__proto__:null,Observer:e9,_observerFinalizationRegistry:yh,clearTimers:_k,enableStaticRendering:X8,isObserverBatched:QC,isUsingStaticRendering:My,observer:gk,observerBatching:Y8,useAsObservableSource:t9,useLocalObservable:yk,useLocalStore:bk,useObserver:wk,useStaticRendering:Sk},Symbol.toStringTag,{value:"Module"})),ti=_a(Ek);var n9={};const Qi=_a(XC);var Ny={exports:{}},tp={},bh={},st={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t._registerNode=t.Konva=t.glob=void 0;const e=Math.PI/180;function n(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}t.glob=typeof _e<"u"?_e:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},t.Konva={_global:t.glob,version:"9.3.16",isBrowser:n(),isUnminified:/param/.test((function(i){}).toString()),dblClickWindow:400,getAngle(i){return t.Konva.angleDeg?i*e:i},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 t.Konva.DD.isDragging},isTransforming(){var i;return(i=t.Konva.Transformer)===null||i===void 0?void 0:i.isTransforming()},isDragReady(){return!!t.Konva.DD.node},releaseCanvasOnDestroy:!0,document:t.glob.document,_injectGlobal(i){t.glob.Konva=i}};const r=i=>{t.Konva[i.prototype.getClassName()]=i};t._registerNode=r,t.Konva._injectGlobal(t.Konva)})(st);var en={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Util=t.Transform=void 0;const e=st;class n{constructor(m=[1,0,0,1,0,0]){this.dirty=!1,this.m=m&&m.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 n(this.m)}copyInto(m){m.m[0]=this.m[0],m.m[1]=this.m[1],m.m[2]=this.m[2],m.m[3]=this.m[3],m.m[4]=this.m[4],m.m[5]=this.m[5]}point(m){const _=this.m;return{x:_[0]*m.x+_[2]*m.y+_[4],y:_[1]*m.x+_[3]*m.y+_[5]}}translate(m,_){return this.m[4]+=this.m[0]*m+this.m[2]*_,this.m[5]+=this.m[1]*m+this.m[3]*_,this}scale(m,_){return this.m[0]*=m,this.m[1]*=m,this.m[2]*=_,this.m[3]*=_,this}rotate(m){const _=Math.cos(m),A=Math.sin(m),C=this.m[0]*_+this.m[2]*A,R=this.m[1]*_+this.m[3]*A,S=this.m[0]*-A+this.m[2]*_,E=this.m[1]*-A+this.m[3]*_;return this.m[0]=C,this.m[1]=R,this.m[2]=S,this.m[3]=E,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(m,_){const A=this.m[0]+this.m[2]*_,C=this.m[1]+this.m[3]*_,R=this.m[2]+this.m[0]*m,S=this.m[3]+this.m[1]*m;return this.m[0]=A,this.m[1]=C,this.m[2]=R,this.m[3]=S,this}multiply(m){const _=this.m[0]*m.m[0]+this.m[2]*m.m[1],A=this.m[1]*m.m[0]+this.m[3]*m.m[1],C=this.m[0]*m.m[2]+this.m[2]*m.m[3],R=this.m[1]*m.m[2]+this.m[3]*m.m[3],S=this.m[0]*m.m[4]+this.m[2]*m.m[5]+this.m[4],E=this.m[1]*m.m[4]+this.m[3]*m.m[5]+this.m[5];return this.m[0]=_,this.m[1]=A,this.m[2]=C,this.m[3]=R,this.m[4]=S,this.m[5]=E,this}invert(){const m=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),_=this.m[3]*m,A=-this.m[1]*m,C=-this.m[2]*m,R=this.m[0]*m,S=m*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),E=m*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=_,this.m[1]=A,this.m[2]=C,this.m[3]=R,this.m[4]=S,this.m[5]=E,this}getMatrix(){return this.m}decompose(){const m=this.m[0],_=this.m[1],A=this.m[2],C=this.m[3],R=this.m[4],S=this.m[5],E=m*C-_*A,P={x:R,y:S,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(m!=0||_!=0){const T=Math.sqrt(m*m+_*_);P.rotation=_>0?Math.acos(m/T):-Math.acos(m/T),P.scaleX=T,P.scaleY=E/T,P.skewX=(m*A+_*C)/E,P.skewY=0}else if(A!=0||C!=0){const T=Math.sqrt(A*A+C*C);P.rotation=Math.PI/2-(C>0?Math.acos(-A/T):-Math.acos(A/T)),P.scaleX=E/T,P.scaleY=T,P.skewX=0,P.skewY=(m*A+_*C)/E}return P.rotation=t.Util._getRotation(P.rotation),P}}t.Transform=n;let r="[object Array]",i="[object Number]",o="[object String]",a="[object Boolean]",l=Math.PI/180,s=180/Math.PI,f="#",h="",x="0",w="Konva warning: ",v="Konva error: ",O="rgb(",g={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]},b=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,p=[];const y=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(d){setTimeout(d,60)};t.Util={_isElement(d){return!!(d&&d.nodeType==1)},_isFunction(d){return!!(d&&d.constructor&&d.call&&d.apply)},_isPlainObject(d){return!!d&&d.constructor===Object},_isArray(d){return Object.prototype.toString.call(d)===r},_isNumber(d){return Object.prototype.toString.call(d)===i&&!isNaN(d)&&isFinite(d)},_isString(d){return Object.prototype.toString.call(d)===o},_isBoolean(d){return Object.prototype.toString.call(d)===a},isObject(d){return d instanceof Object},isValidSelector(d){if(typeof d!="string")return!1;const m=d[0];return m==="#"||m==="."||m===m.toUpperCase()},_sign(d){return d===0||d>0?1:-1},requestAnimFrame(d){p.push(d),p.length===1&&y(function(){const m=p;p=[],m.forEach(function(_){_()})})},createCanvasElement(){const d=document.createElement("canvas");try{d.style=d.style||{}}catch{}return d},createImageElement(){return document.createElement("img")},_isInDocument(d){for(;d=d.parentNode;)if(d==document)return!0;return!1},_urlToImage(d,m){const _=t.Util.createImageElement();_.onload=function(){m(_)},_.src=d},_rgbToHex(d,m,_){return((1<<24)+(d<<16)+(m<<8)+_).toString(16).slice(1)},_hexToRgb(d){d=d.replace(f,h);const m=parseInt(d,16);return{r:m>>16&255,g:m>>8&255,b:m&255}},getRandomColor(){let d=(Math.random()*16777215<<0).toString(16);for(;d.length<6;)d=x+d;return f+d},getRGB(d){let m;return d in g?(m=g[d],{r:m[0],g:m[1],b:m[2]}):d[0]===f?this._hexToRgb(d.substring(1)):d.substr(0,4)===O?(m=b.exec(d.replace(/ /g,"")),{r:parseInt(m[1],10),g:parseInt(m[2],10),b:parseInt(m[3],10)}):{r:0,g:0,b:0}},colorToRGBA(d){return d=d||"black",t.Util._namedColorToRBA(d)||t.Util._hex3ColorToRGBA(d)||t.Util._hex4ColorToRGBA(d)||t.Util._hex6ColorToRGBA(d)||t.Util._hex8ColorToRGBA(d)||t.Util._rgbColorToRGBA(d)||t.Util._rgbaColorToRGBA(d)||t.Util._hslColorToRGBA(d)},_namedColorToRBA(d){const m=g[d.toLowerCase()];return m?{r:m[0],g:m[1],b:m[2],a:1}:null},_rgbColorToRGBA(d){if(d.indexOf("rgb(")===0){d=d.match(/rgb\(([^)]+)\)/)[1];const m=d.split(/ *, */).map(Number);return{r:m[0],g:m[1],b:m[2],a:1}}},_rgbaColorToRGBA(d){if(d.indexOf("rgba(")===0){d=d.match(/rgba\(([^)]+)\)/)[1];const m=d.split(/ *, */).map((_,A)=>_.slice(-1)==="%"?A===3?parseInt(_)/100:parseInt(_)/100*255:Number(_));return{r:m[0],g:m[1],b:m[2],a:m[3]}}},_hex8ColorToRGBA(d){if(d[0]==="#"&&d.length===9)return{r:parseInt(d.slice(1,3),16),g:parseInt(d.slice(3,5),16),b:parseInt(d.slice(5,7),16),a:parseInt(d.slice(7,9),16)/255}},_hex6ColorToRGBA(d){if(d[0]==="#"&&d.length===7)return{r:parseInt(d.slice(1,3),16),g:parseInt(d.slice(3,5),16),b:parseInt(d.slice(5,7),16),a:1}},_hex4ColorToRGBA(d){if(d[0]==="#"&&d.length===5)return{r:parseInt(d[1]+d[1],16),g:parseInt(d[2]+d[2],16),b:parseInt(d[3]+d[3],16),a:parseInt(d[4]+d[4],16)/255}},_hex3ColorToRGBA(d){if(d[0]==="#"&&d.length===4)return{r:parseInt(d[1]+d[1],16),g:parseInt(d[2]+d[2],16),b:parseInt(d[3]+d[3],16),a:1}},_hslColorToRGBA(d){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(d)){const[m,..._]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(d),A=Number(_[0])/360,C=Number(_[1])/100,R=Number(_[2])/100;let S,E,P;if(C===0)return P=R*255,{r:Math.round(P),g:Math.round(P),b:Math.round(P),a:1};R<.5?S=R*(1+C):S=R+C-R*C;const T=2*R-S,N=[0,0,0];for(let U=0;U<3;U++)E=A+1/3*-(U-1),E<0&&E++,E>1&&E--,6*E<1?P=T+(S-T)*6*E:2*E<1?P=S:3*E<2?P=T+(S-T)*(2/3-E)*6:P=T,N[U]=P*255;return{r:Math.round(N[0]),g:Math.round(N[1]),b:Math.round(N[2]),a:1}}},haveIntersection(d,m){return!(m.x>d.x+d.width||m.x+m.width<d.x||m.y>d.y+d.height||m.y+m.height<d.y)},cloneObject(d){const m={};for(const _ in d)this._isPlainObject(d[_])?m[_]=this.cloneObject(d[_]):this._isArray(d[_])?m[_]=this.cloneArray(d[_]):m[_]=d[_];return m},cloneArray(d){return d.slice(0)},degToRad(d){return d*l},radToDeg(d){return d*s},_degToRad(d){return t.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),t.Util.degToRad(d)},_radToDeg(d){return t.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),t.Util.radToDeg(d)},_getRotation(d){return e.Konva.angleDeg?t.Util.radToDeg(d):d},_capitalize(d){return d.charAt(0).toUpperCase()+d.slice(1)},throw(d){throw new Error(v+d)},error(d){console.error(v+d)},warn(d){e.Konva.showWarnings&&console.warn(w+d)},each(d,m){for(const _ in d)m(_,d[_])},_inRange(d,m,_){return m<=d&&d<_},_getProjectionToSegment(d,m,_,A,C,R){let S,E,P;const T=(d-_)*(d-_)+(m-A)*(m-A);if(T==0)S=d,E=m,P=(C-_)*(C-_)+(R-A)*(R-A);else{const N=((C-d)*(_-d)+(R-m)*(A-m))/T;N<0?(S=d,E=m,P=(d-C)*(d-C)+(m-R)*(m-R)):N>1?(S=_,E=A,P=(_-C)*(_-C)+(A-R)*(A-R)):(S=d+N*(_-d),E=m+N*(A-m),P=(S-C)*(S-C)+(E-R)*(E-R))}return[S,E,P]},_getProjectionToLine(d,m,_){const A=t.Util.cloneObject(d);let C=Number.MAX_VALUE;return m.forEach(function(R,S){if(!_&&S===m.length-1)return;const E=m[(S+1)%m.length],P=t.Util._getProjectionToSegment(R.x,R.y,E.x,E.y,d.x,d.y),T=P[0],N=P[1],U=P[2];U<C&&(A.x=T,A.y=N,C=U)}),A},_prepareArrayForTween(d,m,_){let A,C=[],R=[];if(d.length>m.length){const E=m;m=d,d=E}for(A=0;A<d.length;A+=2)C.push({x:d[A],y:d[A+1]});for(A=0;A<m.length;A+=2)R.push({x:m[A],y:m[A+1]});const S=[];return R.forEach(function(E){const P=t.Util._getProjectionToLine(E,C,_);S.push(P.x),S.push(P.y)}),S},_prepareToStringify(d){let m;d.visitedByCircularReferenceRemoval=!0;for(const _ in d)if(d.hasOwnProperty(_)&&d[_]&&typeof d[_]=="object"){if(m=Object.getOwnPropertyDescriptor(d,_),d[_].visitedByCircularReferenceRemoval||t.Util._isElement(d[_]))if(m.configurable)delete d[_];else return null;else if(t.Util._prepareToStringify(d[_])===null)if(m.configurable)delete d[_];else return null}return delete d.visitedByCircularReferenceRemoval,d},_assign(d,m){for(const _ in m)d[_]=m[_];return d},_getFirstPointerId(d){return d.touches?d.changedTouches[0].identifier:d.pointerId||999},releaseCanvas(...d){e.Konva.releaseCanvasOnDestroy&&d.forEach(m=>{m.width=0,m.height=0})},drawRoundedRectPath(d,m,_,A){let C=0,R=0,S=0,E=0;typeof A=="number"?C=R=S=E=Math.min(A,m/2,_/2):(C=Math.min(A[0]||0,m/2,_/2),R=Math.min(A[1]||0,m/2,_/2),E=Math.min(A[2]||0,m/2,_/2),S=Math.min(A[3]||0,m/2,_/2)),d.moveTo(C,0),d.lineTo(m-R,0),d.arc(m-R,R,R,Math.PI*3/2,0,!1),d.lineTo(m,_-E),d.arc(m-E,_-E,E,0,Math.PI/2,!1),d.lineTo(S,_),d.arc(S,_-S,S,Math.PI/2,Math.PI,!1),d.lineTo(0,C),d.arc(C,C,C,Math.PI,Math.PI*3/2,!1)}}})(en);var qt={},ut={},Ze={};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.RGBComponent=Ok;Ze.alphaComponent=xk;Ze.getNumberValidator=Pk;Ze.getNumberOrArrayOfNumbersValidator=Ck;Ze.getNumberOrAutoValidator=kk;Ze.getStringValidator=Tk;Ze.getStringOrGradientValidator=Ak;Ze.getFunctionValidator=Rk;Ze.getNumberArrayValidator=Mk;Ze.getBooleanValidator=Lk;Ze.getComponentValidator=Nk;const Ro=st,rn=en;function Mo(t){return rn.Util._isString(t)?'"'+t+'"':Object.prototype.toString.call(t)==="[object Number]"||rn.Util._isBoolean(t)?t:Object.prototype.toString.call(t)}function Ok(t){return t>255?255:t<0?0:Math.round(t)}function xk(t){return t>1?1:t<1e-4?1e-4:t}function Pk(){if(Ro.Konva.isUnminified)return function(t,e){return rn.Util._isNumber(t)||rn.Util.warn(Mo(t)+' is a not valid value for "'+e+'" attribute. The value should be a number.'),t}}function Ck(t){if(Ro.Konva.isUnminified)return function(e,n){const r=rn.Util._isNumber(e),i=rn.Util._isArray(e)&&e.length==t;return!r&&!i&&rn.Util.warn(Mo(e)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+t+")"),e}}function kk(){if(Ro.Konva.isUnminified)return function(t,e){return rn.Util._isNumber(t)||t==="auto"||rn.Util.warn(Mo(t)+' is a not valid value for "'+e+'" attribute. The value should be a number or "auto".'),t}}function Tk(){if(Ro.Konva.isUnminified)return function(t,e){return rn.Util._isString(t)||rn.Util.warn(Mo(t)+' is a not valid value for "'+e+'" attribute. The value should be a string.'),t}}function Ak(){if(Ro.Konva.isUnminified)return function(t,e){const n=rn.Util._isString(t),r=Object.prototype.toString.call(t)==="[object CanvasGradient]"||t&&t.addColorStop;return n||r||rn.Util.warn(Mo(t)+' is a not valid value for "'+e+'" attribute. The value should be a string or a native gradient.'),t}}function Rk(){if(Ro.Konva.isUnminified)return function(t,e){return rn.Util._isFunction(t)||rn.Util.warn(Mo(t)+' is a not valid value for "'+e+'" attribute. The value should be a function.'),t}}function Mk(){if(Ro.Konva.isUnminified)return function(t,e){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&t instanceof n||(rn.Util._isArray(t)?t.forEach(function(r){rn.Util._isNumber(r)||rn.Util.warn('"'+e+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):rn.Util.warn(Mo(t)+' is a not valid value for "'+e+'" attribute. The value should be a array of numbers.')),t}}function Lk(){if(Ro.Konva.isUnminified)return function(t,e){return t===!0||t===!1||rn.Util.warn(Mo(t)+' is a not valid value for "'+e+'" attribute. The value should be a boolean.'),t}}function Nk(t){if(Ro.Konva.isUnminified)return function(e,n){return e==null||rn.Util.isObject(e)||rn.Util.warn(Mo(e)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+t),e}}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Factory=void 0;const e=en,n=Ze,r="get",i="set";t.Factory={addGetterSetter(o,a,l,s,f){t.Factory.addGetter(o,a,l),t.Factory.addSetter(o,a,s,f),t.Factory.addOverloadedGetterSetter(o,a)},addGetter(o,a,l){const s=r+e.Util._capitalize(a);o.prototype[s]=o.prototype[s]||function(){const f=this.attrs[a];return f===void 0?l:f}},addSetter(o,a,l,s){const f=i+e.Util._capitalize(a);o.prototype[f]||t.Factory.overWriteSetter(o,a,l,s)},overWriteSetter(o,a,l,s){const f=i+e.Util._capitalize(a);o.prototype[f]=function(h){return l&&h!==void 0&&h!==null&&(h=l.call(this,h,a)),this._setAttr(a,h),s&&s.call(this),this}},addComponentsGetterSetter(o,a,l,s,f){let h=l.length,x=e.Util._capitalize,w=r+x(a),v=i+x(a),O,g;o.prototype[w]=function(){const p={};for(O=0;O<h;O++)g=l[O],p[g]=this.getAttr(a+x(g));return p};const b=(0,n.getComponentValidator)(l);o.prototype[v]=function(p){let y=this.attrs[a],d;s&&(p=s.call(this,p)),b&&b.call(this,p,a);for(d in p)p.hasOwnProperty(d)&&this._setAttr(a+x(d),p[d]);return p||l.forEach(m=>{this._setAttr(a+x(m),void 0)}),this._fireChangeEvent(a,y,p),f&&f.call(this),this},t.Factory.addOverloadedGetterSetter(o,a)},addOverloadedGetterSetter(o,a){const l=e.Util._capitalize(a),s=i+l,f=r+l;o.prototype[a]=function(){return arguments.length?(this[s](arguments[0]),this):this[f]()}},addDeprecatedGetterSetter(o,a,l,s){e.Util.error("Adding deprecated "+a);const f=r+e.Util._capitalize(a),h=a+" property is deprecated and will be removed soon. Look at Konva change log for more information.";o.prototype[f]=function(){e.Util.error(h);const x=this.attrs[a];return x===void 0?l:x},t.Factory.addSetter(o,a,s,function(){e.Util.error(h)}),t.Factory.addOverloadedGetterSetter(o,a)},backCompat(o,a){e.Util.each(a,function(l,s){const f=o.prototype[s],h=r+e.Util._capitalize(l),x=i+e.Util._capitalize(l);function w(){f.apply(this,arguments),e.Util.error('"'+l+'" method is deprecated and will be removed soon. Use ""'+s+'" instead.')}o.prototype[l]=w,o.prototype[h]=w,o.prototype[x]=w})},afterSetFilter(){this._filterUpToDate=!1}}})(ut);var wi={},So={};Object.defineProperty(So,"__esModule",{value:!0});So.HitContext=So.SceneContext=So.Context=void 0;const r9=en,Ik=st;function Dk(t){let e=[],n=t.length,r=r9.Util,i,o;for(i=0;i<n;i++)o=t[i],r._isNumber(o)?o=Math.round(o*1e3)/1e3:r._isString(o)||(o=o+""),e.push(o);return e}const R5=",",jk="(",Fk=")",zk="([",Bk="])",Uk=";",Hk="()",$k="=",M5=["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"],Gk=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"],Vk=100;class np{constructor(e){this.canvas=e,Ik.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(e){e.fillEnabled()&&this._fill(e)}_fill(e){}strokeShape(e){e.hasStroke()&&this._stroke(e)}_stroke(e){}fillStrokeShape(e){e.attrs.fillAfterStrokeEnabled?(this.strokeShape(e),this.fillShape(e)):(this.fillShape(e),this.strokeShape(e))}getTrace(e,n){let r=this.traceArr,i=r.length,o="",a,l,s,f;for(a=0;a<i;a++)l=r[a],s=l.method,s?(f=l.args,o+=s,e?o+=Hk:r9.Util._isArray(f[0])?o+=zk+f.join(R5)+Bk:(n&&(f=f.map(h=>typeof h=="number"?Math.floor(h):h)),o+=jk+f.join(R5)+Fk)):(o+=l.property,e||(o+=$k+l.val)),o+=Uk;return o}clearTrace(){this.traceArr=[]}_trace(e){let n=this.traceArr,r;n.push(e),r=n.length,r>=Vk&&n.shift()}reset(){const e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){const n=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(e){const n=e.attrs.lineCap;n&&this.setAttr("lineCap",n)}_applyOpacity(e){const n=e.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(e){const n=e.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(e,n){this._context[e]=n}arc(e,n,r,i,o,a){this._context.arc(e,n,r,i,o,a)}arcTo(e,n,r,i,o){this._context.arcTo(e,n,r,i,o)}beginPath(){this._context.beginPath()}bezierCurveTo(e,n,r,i,o,a){this._context.bezierCurveTo(e,n,r,i,o,a)}clearRect(e,n,r,i){this._context.clearRect(e,n,r,i)}clip(...e){this._context.clip.apply(this._context,e)}closePath(){this._context.closePath()}createImageData(e,n){const r=arguments;if(r.length===2)return this._context.createImageData(e,n);if(r.length===1)return this._context.createImageData(e)}createLinearGradient(e,n,r,i){return this._context.createLinearGradient(e,n,r,i)}createPattern(e,n){return this._context.createPattern(e,n)}createRadialGradient(e,n,r,i,o,a){return this._context.createRadialGradient(e,n,r,i,o,a)}drawImage(e,n,r,i,o,a,l,s,f){const h=arguments,x=this._context;h.length===3?x.drawImage(e,n,r):h.length===5?x.drawImage(e,n,r,i,o):h.length===9&&x.drawImage(e,n,r,i,o,a,l,s,f)}ellipse(e,n,r,i,o,a,l,s){this._context.ellipse(e,n,r,i,o,a,l,s)}isPointInPath(e,n,r,i){return r?this._context.isPointInPath(r,e,n,i):this._context.isPointInPath(e,n,i)}fill(...e){this._context.fill.apply(this._context,e)}fillRect(e,n,r,i){this._context.fillRect(e,n,r,i)}strokeRect(e,n,r,i){this._context.strokeRect(e,n,r,i)}fillText(e,n,r,i){i?this._context.fillText(e,n,r,i):this._context.fillText(e,n,r)}measureText(e){return this._context.measureText(e)}getImageData(e,n,r,i){return this._context.getImageData(e,n,r,i)}lineTo(e,n){this._context.lineTo(e,n)}moveTo(e,n){this._context.moveTo(e,n)}rect(e,n,r,i){this._context.rect(e,n,r,i)}roundRect(e,n,r,i,o){this._context.roundRect(e,n,r,i,o)}putImageData(e,n,r){this._context.putImageData(e,n,r)}quadraticCurveTo(e,n,r,i){this._context.quadraticCurveTo(e,n,r,i)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,n){this._context.scale(e,n)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,n,r,i,o,a){this._context.setTransform(e,n,r,i,o,a)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,n,r,i){this._context.strokeText(e,n,r,i)}transform(e,n,r,i,o,a){this._context.transform(e,n,r,i,o,a)}translate(e,n){this._context.translate(e,n)}_enableTrace(){let e=this,n=M5.length,r=this.setAttr,i,o;const a=function(l){let s=e[l],f;e[l]=function(){return o=Dk(Array.prototype.slice.call(arguments,0)),f=s.apply(e,arguments),e._trace({method:l,args:o}),f}};for(i=0;i<n;i++)a(M5[i]);e.setAttr=function(){r.apply(e,arguments);const l=arguments[0];let s=arguments[1];(l==="shadowOffsetX"||l==="shadowOffsetY"||l==="shadowBlur")&&(s=s/this.canvas.getPixelRatio()),e._trace({property:l,val:s})}}_applyGlobalCompositeOperation(e){const n=e.attrs.globalCompositeOperation;!n||n==="source-over"||this.setAttr("globalCompositeOperation",n)}}So.Context=np;Gk.forEach(function(t){Object.defineProperty(np.prototype,t,{get(){return this._context[t]},set(e){this._context[t]=e}})});class qk extends np{constructor(e,{willReadFrequently:n=!1}={}){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:n})}_fillColor(e){const n=e.fill();this.setAttr("fillStyle",n),e._fillFunc(this)}_fillPattern(e){this.setAttr("fillStyle",e._getFillPattern()),e._fillFunc(this)}_fillLinearGradient(e){const n=e._getLinearGradient();n&&(this.setAttr("fillStyle",n),e._fillFunc(this))}_fillRadialGradient(e){const n=e._getRadialGradient();n&&(this.setAttr("fillStyle",n),e._fillFunc(this))}_fill(e){const n=e.fill(),r=e.getFillPriority();if(n&&r==="color"){this._fillColor(e);return}const i=e.getFillPatternImage();if(i&&r==="pattern"){this._fillPattern(e);return}const o=e.getFillLinearGradientColorStops();if(o&&r==="linear-gradient"){this._fillLinearGradient(e);return}const a=e.getFillRadialGradientColorStops();if(a&&r==="radial-gradient"){this._fillRadialGradient(e);return}n?this._fillColor(e):i?this._fillPattern(e):o?this._fillLinearGradient(e):a&&this._fillRadialGradient(e)}_strokeLinearGradient(e){const n=e.getStrokeLinearGradientStartPoint(),r=e.getStrokeLinearGradientEndPoint(),i=e.getStrokeLinearGradientColorStops(),o=this.createLinearGradient(n.x,n.y,r.x,r.y);if(i){for(let a=0;a<i.length;a+=2)o.addColorStop(i[a],i[a+1]);this.setAttr("strokeStyle",o)}}_stroke(e){const n=e.dash(),r=e.getStrokeScaleEnabled();if(e.hasStroke()){if(!r){this.save();const o=this.getCanvas().getPixelRatio();this.setTransform(o,0,0,o,0,0)}this._applyLineCap(e),n&&e.dashEnabled()&&(this.setLineDash(n),this.setAttr("lineDashOffset",e.dashOffset())),this.setAttr("lineWidth",e.strokeWidth()),e.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),e.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(e):this.setAttr("strokeStyle",e.stroke()),e._strokeFunc(this),r||this.restore()}}_applyShadow(e){var n,r,i;const o=(n=e.getShadowRGBA())!==null&&n!==void 0?n:"black",a=(r=e.getShadowBlur())!==null&&r!==void 0?r:5,l=(i=e.getShadowOffset())!==null&&i!==void 0?i:{x:0,y:0},s=e.getAbsoluteScale(),f=this.canvas.getPixelRatio(),h=s.x*f,x=s.y*f;this.setAttr("shadowColor",o),this.setAttr("shadowBlur",a*Math.min(Math.abs(h),Math.abs(x))),this.setAttr("shadowOffsetX",l.x*h),this.setAttr("shadowOffsetY",l.y*x)}}So.SceneContext=qk;class Wk extends np{constructor(e){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:!0})}_fill(e){this.save(),this.setAttr("fillStyle",e.colorKey),e._fillFuncHit(this),this.restore()}strokeShape(e){e.hasHitStroke()&&this._stroke(e)}_stroke(e){if(e.hasHitStroke()){const n=e.getStrokeScaleEnabled();if(!n){this.save();const o=this.getCanvas().getPixelRatio();this.setTransform(o,0,0,o,0,0)}this._applyLineCap(e);const r=e.hitStrokeWidth(),i=r==="auto"?e.strokeWidth():r;this.setAttr("lineWidth",i),this.setAttr("strokeStyle",e.colorKey),e._strokeFuncHit(this),n||this.restore()}}}So.HitContext=Wk;Object.defineProperty(wi,"__esModule",{value:!0});wi.HitCanvas=wi.SceneCanvas=wi.Canvas=void 0;const _h=en,i9=So,o9=st,Yk=ut,Kk=Ze;let vd;function Xk(){if(vd)return vd;const t=_h.Util.createCanvasElement(),e=t.getContext("2d");return vd=function(){const n=o9.Konva._global.devicePixelRatio||1,r=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return n/r}(),_h.Util.releaseCanvas(t),vd}class rp{constructor(e){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const r=(e||{}).pixelRatio||o9.Konva.pixelRatio||Xk();this.pixelRatio=r,this._canvas=_h.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(e){const n=this.pixelRatio;this.pixelRatio=e,this.setSize(this.getWidth()/n,this.getHeight()/n)}setWidth(e){this.width=this._canvas.width=e*this.pixelRatio,this._canvas.style.width=e+"px";const n=this.pixelRatio;this.getContext()._context.scale(n,n)}setHeight(e){this.height=this._canvas.height=e*this.pixelRatio,this._canvas.style.height=e+"px";const n=this.pixelRatio;this.getContext()._context.scale(n,n)}getWidth(){return this.width}getHeight(){return this.height}setSize(e,n){this.setWidth(e||0),this.setHeight(n||0)}toDataURL(e,n){try{return this._canvas.toDataURL(e,n)}catch{try{return this._canvas.toDataURL()}catch(i){return _h.Util.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}wi.Canvas=rp;Yk.Factory.addGetterSetter(rp,"pixelRatio",void 0,(0,Kk.getNumberValidator)());class Zk extends rp{constructor(e={width:0,height:0,willReadFrequently:!1}){super(e),this.context=new i9.SceneContext(this,{willReadFrequently:e.willReadFrequently}),this.setSize(e.width,e.height)}}wi.SceneCanvas=Zk;class Qk extends rp{constructor(e={width:0,height:0}){super(e),this.hitCanvas=!0,this.context=new i9.HitContext(this),this.setSize(e.width,e.height)}}wi.HitCanvas=Qk;var ip={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DD=void 0;const e=st,n=en;t.DD={get isDragging(){let r=!1;return t.DD._dragElements.forEach(i=>{i.dragStatus==="dragging"&&(r=!0)}),r},justDragged:!1,get node(){let r;return t.DD._dragElements.forEach(i=>{r=i.node}),r},_dragElements:new Map,_drag(r){const i=[];t.DD._dragElements.forEach((o,a)=>{const{node:l}=o,s=l.getStage();s.setPointersPositions(r),o.pointerId===void 0&&(o.pointerId=n.Util._getFirstPointerId(r));const f=s._changedPointerPositions.find(h=>h.id===o.pointerId);if(f){if(o.dragStatus!=="dragging"){const h=l.dragDistance();if(Math.max(Math.abs(f.x-o.startPointerPos.x),Math.abs(f.y-o.startPointerPos.y))<h||(l.startDrag({evt:r}),!l.isDragging()))return}l._setDragPosition(r,o),i.push(l)}}),i.forEach(o=>{o.fire("dragmove",{type:"dragmove",target:o,evt:r},!0)})},_endDragBefore(r){const i=[];t.DD._dragElements.forEach(o=>{const{node:a}=o,l=a.getStage();if(r&&l.setPointersPositions(r),!l._changedPointerPositions.find(h=>h.id===o.pointerId))return;(o.dragStatus==="dragging"||o.dragStatus==="stopped")&&(t.DD.justDragged=!0,e.Konva._mouseListenClick=!1,e.Konva._touchListenClick=!1,e.Konva._pointerListenClick=!1,o.dragStatus="stopped");const f=o.node.getLayer()||o.node instanceof e.Konva.Stage&&o.node;f&&i.indexOf(f)===-1&&i.push(f)}),i.forEach(o=>{o.draw()})},_endDragAfter(r){t.DD._dragElements.forEach((i,o)=>{i.dragStatus==="stopped"&&i.node.fire("dragend",{type:"dragend",target:i.node,evt:r},!0),i.dragStatus!=="dragging"&&t.DD._dragElements.delete(o)})}},e.Konva.isBrowser&&(window.addEventListener("mouseup",t.DD._endDragBefore,!0),window.addEventListener("touchend",t.DD._endDragBefore,!0),window.addEventListener("touchcancel",t.DD._endDragBefore,!0),window.addEventListener("mousemove",t.DD._drag),window.addEventListener("touchmove",t.DD._drag),window.addEventListener("mouseup",t.DD._endDragAfter,!1),window.addEventListener("touchend",t.DD._endDragAfter,!1),window.addEventListener("touchcancel",t.DD._endDragAfter,!1))})(ip);Object.defineProperty(qt,"__esModule",{value:!0});qt.Node=void 0;const pt=en,qc=ut,ju=wi,Ko=st,Vr=ip,sn=Ze,jd="absoluteOpacity",md="allEventListeners",ho="absoluteTransform",L5="absoluteScale",Wa="canvas",Jk="Change",eT="children",tT="konva",om="listening",N5="mouseenter",I5="mouseleave",D5="set",j5="Shape",Fd=" ",F5="stage",Xo="transform",nT="Stage",am="visible",rT=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(Fd);let iT=1,ot=class lm{constructor(e){this._id=iT++,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(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){(e===Xo||e===ho)&&this._cache.get(e)?this._cache.get(e).dirty=!0:e?this._cache.delete(e):this._cache.clear()}_getCache(e,n){let r=this._cache.get(e);return(r===void 0||(e===Xo||e===ho)&&r.dirty===!0)&&(r=n.call(this),this._cache.set(e,r)),r}_calculate(e,n,r){if(!this._attachedDepsListeners.get(e)){const i=n.map(o=>o+"Change.konva").join(Fd);this.on(i,()=>{this._clearCache(e)}),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,r)}_getCanvasCache(){return this._cache.get(Wa)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===ho&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(Wa)){const{scene:e,filter:n,hit:r}=this._cache.get(Wa);pt.Util.releaseCanvas(e,n,r),this._cache.delete(Wa)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){const n=e||{};let r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let i=Math.ceil(n.width||r.width),o=Math.ceil(n.height||r.height),a=n.pixelRatio,l=n.x===void 0?Math.floor(r.x):n.x,s=n.y===void 0?Math.floor(r.y):n.y,f=n.offset||0,h=n.drawBorder||!1,x=n.hitCanvasPixelRatio||1;if(!i||!o){pt.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const w=Math.abs(Math.round(r.x)-l)>.5?1:0,v=Math.abs(Math.round(r.y)-s)>.5?1:0;i+=f*2+w,o+=f*2+v,l-=f,s-=f;const O=new ju.SceneCanvas({pixelRatio:a,width:i,height:o}),g=new ju.SceneCanvas({pixelRatio:a,width:0,height:0,willReadFrequently:!0}),b=new ju.HitCanvas({pixelRatio:x,width:i,height:o}),p=O.getContext(),y=b.getContext();return b.isCache=!0,O.isCache=!0,this._cache.delete(Wa),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(O.getContext()._context.imageSmoothingEnabled=!1,g.getContext()._context.imageSmoothingEnabled=!1),p.save(),y.save(),p.translate(-l,-s),y.translate(-l,-s),this._isUnderCache=!0,this._clearSelfAndDescendantCache(jd),this._clearSelfAndDescendantCache(L5),this.drawScene(O,this),this.drawHit(b,this),this._isUnderCache=!1,p.restore(),y.restore(),h&&(p.save(),p.beginPath(),p.rect(0,0,i,o),p.closePath(),p.setAttr("strokeStyle","red"),p.setAttr("lineWidth",5),p.stroke(),p.restore()),this._cache.set(Wa,{scene:O,filter:g,hit:b,x:l,y:s}),this._requestDraw(),this}isCached(){return this._cache.has(Wa)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,n){const r=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}];let i=1/0,o=1/0,a=-1/0,l=-1/0;const s=this.getAbsoluteTransform(n);return r.forEach(function(f){const h=s.point(f);i===void 0&&(i=a=h.x,o=l=h.y),i=Math.min(i,h.x),o=Math.min(o,h.y),a=Math.max(a,h.x),l=Math.max(l,h.y)}),{x:i,y:o,width:a-i,height:l-o}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();e.translate(n.x,n.y);const r=this._getCachedSceneCanvas(),i=r.pixelRatio;e.drawImage(r._canvas,0,0,r.width/i,r.height/i),e.restore()}_drawCachedHitCanvas(e){const n=this._getCanvasCache(),r=n.hit;e.save(),e.translate(n.x,n.y),e.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),e.restore()}_getCachedSceneCanvas(){let e=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,o=i.getContext(),a,l,s,f;if(e){if(!this._filterUpToDate){const h=r.pixelRatio;i.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(a=e.length,o.clear(),o.drawImage(r._canvas,0,0,r.getWidth()/h,r.getHeight()/h),l=o.getImageData(0,0,i.getWidth(),i.getHeight()),s=0;s<a;s++){if(f=e[s],typeof f!="function"){pt.Util.error("Filter should be type of function, but got "+typeof f+" instead. Please check correct filters");continue}f.call(this,l),o.putImageData(l,0,0)}}catch(x){pt.Util.error("Unable to apply filter. "+x.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return i}return r}on(e,n){if(this._cache&&this._cache.delete(md),arguments.length===3)return this._delegate.apply(this,arguments);let r=e.split(Fd),i=r.length,o,a,l,s,f;for(o=0;o<i;o++)a=r[o],l=a.split("."),s=l[0],f=l[1]||"",this.eventListeners[s]||(this.eventListeners[s]=[]),this.eventListeners[s].push({name:f,handler:n});return this}off(e,n){let r=(e||"").split(Fd),i=r.length,o,a,l,s,f,h;if(this._cache&&this._cache.delete(md),!e)for(a in this.eventListeners)this._off(a);for(o=0;o<i;o++)if(l=r[o],s=l.split("."),f=s[0],h=s[1],f)this.eventListeners[f]&&this._off(f,h,n);else for(a in this.eventListeners)this._off(a,h,n);return this}dispatchEvent(e){const n={target:this,type:e.type,evt:e};return this.fire(e.type,n),this}addEventListener(e,n){return this.on(e,function(r){n.call(this,r.evt)}),this}removeEventListener(e){return this.off(e),this}_delegate(e,n,r){const i=this;this.on(e,function(o){const a=o.target.findAncestors(n,!0,i);for(let l=0;l<a.length;l++)o=pt.Util.cloneObject(o),o.currentTarget=a[l],r.call(a[l],o)})}remove(){return this.isDragging()&&this.stopDrag(),Vr.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(ho),this._clearSelfAndDescendantCache(jd),this._clearSelfAndDescendantCache(L5),this._clearSelfAndDescendantCache(F5),this._clearSelfAndDescendantCache(am),this._clearSelfAndDescendantCache(om)}_remove(){this._clearCaches();const e=this.getParent();e&&e.children&&(e.children.splice(this.index,1),e._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(e){const n="get"+pt.Util._capitalize(e);return pt.Util._isFunction(this[n])?this[n]():this.attrs[e]}getAncestors(){let e=this.getParent(),n=[];for(;e;)n.push(e),e=e.getParent();return n}getAttrs(){return this.attrs||{}}setAttrs(e){return this._batchTransformChanges(()=>{let n,r;if(!e)return this;for(n in e)n!==eT&&(r=D5+pt.Util._capitalize(n),pt.Util._isFunction(this[r])?this[r](e[n]):this._setAttr(n,e[n]))}),this}isListening(){return this._getCache(om,this._isListening)}_isListening(e){if(!this.listening())return!1;const r=this.getParent();return r&&r!==e&&this!==e?r._isListening(e):!0}isVisible(){return this._getCache(am,this._isVisible)}_isVisible(e){if(!this.visible())return!1;const r=this.getParent();return r&&r!==e&&this!==e?r._isVisible(e):!0}shouldDrawHit(e,n=!1){if(e)return this._isVisible(e)&&this._isListening(e);const r=this.getLayer();let i=!1;Vr.DD._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(a.node.nodeType==="Stage"||a.node.getLayer()===r)&&(i=!0)});const o=!n&&!Ko.Konva.hitOnDragEnabled&&(i||Ko.Konva.isTransforming());return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let e=this.getDepth(),n=this,r=0,i,o,a,l;function s(h){for(i=[],o=h.length,a=0;a<o;a++)l=h[a],r++,l.nodeType!==j5&&(i=i.concat(l.getChildren().slice())),l._id===n._id&&(a=o);i.length>0&&i[0].getDepth()<=e&&s(i)}const f=this.getStage();return n.nodeType!==nT&&f&&s(f.getChildren()),r}getDepth(){let e=0,n=this.parent;for(;n;)e++,n=n.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(Xo),this._clearSelfAndDescendantCache(ho)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges(()=>{this.x(e.x),this.y(e.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const e=this.getStage();if(!e)return null;const n=e.getPointerPosition();if(!n)return null;const r=this.getAbsoluteTransform().copy();return r.invert(),r.point(n)}getAbsolutePosition(e){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!e&&(e=!0);const i=this.getAbsoluteTransform(e).getMatrix(),o=new pt.Transform,a=this.offset();return o.m=i.slice(),o.translate(a.x,a.y),o.getTranslation()}setAbsolutePosition(e){const{x:n,y:r,...i}=this._clearTransform();this.attrs.x=n,this.attrs.y=r,this._clearCache(Xo);const o=this._getAbsoluteTransform().copy();return o.invert(),o.translate(e.x,e.y),e={x:this.attrs.x+o.getTranslation().x,y:this.attrs.y+o.getTranslation().y},this._setTransform(i),this.setPosition({x:e.x,y:e.y}),this._clearCache(Xo),this._clearSelfAndDescendantCache(ho),this}_setTransform(e){let n;for(n in e)this.attrs[n]=e[n]}_clearTransform(){const e={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,e}move(e){let n=e.x,r=e.y,i=this.x(),o=this.y();return n!==void 0&&(i+=n),r!==void 0&&(o+=r),this.setPosition({x:i,y:o}),this}_eachAncestorReverse(e,n){let r=[],i=this.getParent(),o,a;if(!(n&&n._id===this._id)){for(r.unshift(this);i&&(!n||i._id!==n._id);)r.unshift(i),i=i.parent;for(o=r.length,a=0;a<o;a++)e(r[a])}}rotate(e){return this.rotation(this.rotation()+e),this}moveToTop(){if(!this.parent)return pt.Util.warn("Node has no parent. moveToTop function is ignored."),!1;const e=this.index,n=this.parent.getChildren().length;return e<n-1?(this.parent.children.splice(e,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return pt.Util.warn("Node has no parent. moveUp function is ignored."),!1;const e=this.index,n=this.parent.getChildren().length;return e<n-1?(this.parent.children.splice(e,1),this.parent.children.splice(e+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return pt.Util.warn("Node has no parent. moveDown function is ignored."),!1;const e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return pt.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;const e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(e){if(!this.parent)return pt.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&pt.Util.warn("Unexpected value "+e+" 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 n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(jd,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let e=this.opacity();const n=this.getParent();return n&&!n._isUnderCache&&(e*=n.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){let e=this.getAttrs(),n,r,i,o,a;const l={attrs:{},className:this.getClassName()};for(n in e)r=e[n],a=pt.Util.isObject(r)&&!pt.Util._isPlainObject(r)&&!pt.Util._isArray(r),!a&&(i=typeof this[n]=="function"&&this[n],delete e[n],o=i?i.call(this):null,e[n]=r,o!==r&&(l.attrs[n]=r));return pt.Util._prepareToStringify(l)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,n,r){const i=[];n&&this._isMatch(e)&&i.push(this);let o=this.parent;for(;o;){if(o===r)return i;o._isMatch(e)&&i.push(o),o=o.parent}return i}isAncestorOf(e){return!1}findAncestor(e,n,r){return this.findAncestors(e,n,r)[0]}_isMatch(e){if(!e)return!1;if(typeof e=="function")return e(this);let n=e.replace(/ /g,"").split(","),r=n.length,i,o;for(i=0;i<r;i++)if(o=n[i],pt.Util.isValidSelector(o)||(pt.Util.warn('Selector "'+o+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),pt.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),pt.Util.warn("Konva is awesome, right?")),o.charAt(0)==="#"){if(this.id()===o.slice(1))return!0}else if(o.charAt(0)==="."){if(this.hasName(o.slice(1)))return!0}else if(this.className===o||this.nodeType===o)return!0;return!1}getLayer(){const e=this.getParent();return e?e.getLayer():null}getStage(){return this._getCache(F5,this._getStage)}_getStage(){const e=this.getParent();return e?e.getStage():null}fire(e,n={},r){return n.target=n.target||this,r?this._fireAndBubble(e,n):this._fire(e,n),this}getAbsoluteTransform(e){return e?this._getAbsoluteTransform(e):this._getCache(ho,this._getAbsoluteTransform)}_getAbsoluteTransform(e){let n;if(e)return n=new pt.Transform,this._eachAncestorReverse(function(r){const i=r.transformsEnabled();i==="all"?n.multiply(r.getTransform()):i==="position"&&n.translate(r.x()-r.offsetX(),r.y()-r.offsetY())},e),n;{n=this._cache.get(ho)||new pt.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(n):n.reset();const r=this.transformsEnabled();if(r==="all")n.multiply(this.getTransform());else if(r==="position"){const i=this.attrs.x||0,o=this.attrs.y||0,a=this.attrs.offsetX||0,l=this.attrs.offsetY||0;n.translate(i-a,o-l)}return n.dirty=!1,n}}getAbsoluteScale(e){let n=this;for(;n;)n._isUnderCache&&(e=n),n=n.getParent();const i=this.getAbsoluteTransform(e).decompose();return{x:i.scaleX,y:i.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(Xo,this._getTransform)}_getTransform(){var e,n;const r=this._cache.get(Xo)||new pt.Transform;r.reset();const i=this.x(),o=this.y(),a=Ko.Konva.getAngle(this.rotation()),l=(e=this.attrs.scaleX)!==null&&e!==void 0?e:1,s=(n=this.attrs.scaleY)!==null&&n!==void 0?n:1,f=this.attrs.skewX||0,h=this.attrs.skewY||0,x=this.attrs.offsetX||0,w=this.attrs.offsetY||0;return(i!==0||o!==0)&&r.translate(i,o),a!==0&&r.rotate(a),(f!==0||h!==0)&&r.skew(f,h),(l!==1||s!==1)&&r.scale(l,s),(x!==0||w!==0)&&r.translate(-1*x,-1*w),r.dirty=!1,r}clone(e){let n=pt.Util.cloneObject(this.attrs),r,i,o,a,l;for(r in e)n[r]=e[r];const s=new this.constructor(n);for(r in this.eventListeners)for(i=this.eventListeners[r],o=i.length,a=0;a<o;a++)l=i[a],l.name.indexOf(tT)<0&&(s.eventListeners[r]||(s.eventListeners[r]=[]),s.eventListeners[r].push(l));return s}_toKonvaCanvas(e){e=e||{};const n=this.getClientRect(),r=this.getStage(),i=e.x!==void 0?e.x:Math.floor(n.x),o=e.y!==void 0?e.y:Math.floor(n.y),a=e.pixelRatio||1,l=new ju.SceneCanvas({width:e.width||Math.ceil(n.width)||(r?r.width():0),height:e.height||Math.ceil(n.height)||(r?r.height():0),pixelRatio:a}),s=l.getContext(),f=new ju.SceneCanvas({width:l.width/l.pixelRatio+Math.abs(i),height:l.height/l.pixelRatio+Math.abs(o),pixelRatio:l.pixelRatio});return e.imageSmoothingEnabled===!1&&(s._context.imageSmoothingEnabled=!1),s.save(),(i||o)&&s.translate(-1*i,-1*o),this.drawScene(l,void 0,f),s.restore(),l}toCanvas(e){return this._toKonvaCanvas(e)._canvas}toDataURL(e){e=e||{};const n=e.mimeType||null,r=e.quality||null,i=this._toKonvaCanvas(e).toDataURL(n,r);return e.callback&&e.callback(i),i}toImage(e){return new Promise((n,r)=>{try{const i=e==null?void 0:e.callback;i&&delete e.callback,pt.Util._urlToImage(this.toDataURL(e),function(o){n(o),i==null||i(o)})}catch(i){r(i)}})}toBlob(e){return new Promise((n,r)=>{try{const i=e==null?void 0:e.callback;i&&delete e.callback,this.toCanvas(e).toBlob(o=>{n(o),i==null||i(o)},e==null?void 0:e.mimeType,e==null?void 0:e.quality)}catch(i){r(i)}})}setSize(e){return this.width(e.width),this.height(e.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():Ko.Konva.dragDistance}_off(e,n,r){let i=this.eventListeners[e],o,a,l;for(o=0;o<i.length;o++)if(a=i[o].name,l=i[o].handler,(a!=="konva"||n==="konva")&&(!n||a===n)&&(!r||r===l)){if(i.splice(o,1),i.length===0){delete this.eventListeners[e];break}o--}}_fireChangeEvent(e,n,r){this._fire(e+Jk,{oldVal:n,newVal:r})}addName(e){if(!this.hasName(e)){const n=this.name(),r=n?n+" "+e:e;this.name(r)}return this}hasName(e){if(!e)return!1;const n=this.name();return n?(n||"").split(/\s/g).indexOf(e)!==-1:!1}removeName(e){const n=(this.name()||"").split(/\s/g),r=n.indexOf(e);return r!==-1&&(n.splice(r,1),this.name(n.join(" "))),this}setAttr(e,n){const r=this[D5+pt.Util._capitalize(e)];return pt.Util._isFunction(r)?r.call(this,n):this._setAttr(e,n),this}_requestDraw(){if(Ko.Konva.autoDrawEnabled){const e=this.getLayer()||this.getStage();e==null||e.batchDraw()}}_setAttr(e,n){const r=this.attrs[e];r===n&&!pt.Util.isObject(n)||(n==null?delete this.attrs[e]:this.attrs[e]=n,this._shouldFireChangeEvents&&this._fireChangeEvent(e,r,n),this._requestDraw())}_setComponentAttr(e,n,r){let i;r!==void 0&&(i=this.attrs[e],i||(this.attrs[e]=this.getAttr(e)),this.attrs[e][n]=r,this._fireChangeEvent(e,i,r))}_fireAndBubble(e,n,r){if(n&&this.nodeType===j5&&(n.target=this),!((e===N5||e===I5)&&(r&&(this===r||this.isAncestorOf&&this.isAncestorOf(r))||this.nodeType==="Stage"&&!r))){this._fire(e,n);const o=(e===N5||e===I5)&&r&&r.isAncestorOf&&r.isAncestorOf(this)&&!r.isAncestorOf(this.parent);(n&&!n.cancelBubble||!n)&&this.parent&&this.parent.isListening()&&!o&&(r&&r.parent?this._fireAndBubble.call(this.parent,e,n,r):this._fireAndBubble.call(this.parent,e,n))}}_getProtoListeners(e){var n,r,i;const o=(n=this._cache.get(md))!==null&&n!==void 0?n:{};let a=o==null?void 0:o[e];if(a===void 0){a=[];let l=Object.getPrototypeOf(this);for(;l;){const s=(i=(r=l.eventListeners)===null||r===void 0?void 0:r[e])!==null&&i!==void 0?i:[];a.push(...s),l=Object.getPrototypeOf(l)}o[e]=a,this._cache.set(md,o)}return a}_fire(e,n){n=n||{},n.currentTarget=this,n.type=e;const r=this._getProtoListeners(e);if(r)for(var i=0;i<r.length;i++)r[i].handler.call(this,n);const o=this.eventListeners[e];if(o)for(var i=0;i<o.length;i++)o[i].handler.call(this,n)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(e){const n=e?e.pointerId:void 0,r=this.getStage(),i=this.getAbsolutePosition();if(!r)return;const o=r._getPointerById(n)||r._changedPointerPositions[0]||i;Vr.DD._dragElements.set(this._id,{node:this,startPointerPos:o,offset:{x:o.x-i.x,y:o.y-i.y},dragStatus:"ready",pointerId:n})}startDrag(e,n=!0){Vr.DD._dragElements.has(this._id)||this._createDragElement(e);const r=Vr.DD._dragElements.get(this._id);r.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:e&&e.evt},n)}_setDragPosition(e,n){const r=this.getStage()._getPointerById(n.pointerId);if(!r)return;let i={x:r.x-n.offset.x,y:r.y-n.offset.y};const o=this.dragBoundFunc();if(o!==void 0){const a=o.call(this,i,e);a?i=a:pt.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!==i.x||this._lastPos.y!==i.y)&&(this.setAbsolutePosition(i),this._requestDraw()),this._lastPos=i}stopDrag(e){const n=Vr.DD._dragElements.get(this._id);n&&(n.dragStatus="stopped"),Vr.DD._endDragBefore(e),Vr.DD._endDragAfter(e)}setDraggable(e){this._setAttr("draggable",e),this._dragChange()}isDragging(){const e=Vr.DD._dragElements.get(this._id);return e?e.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(e){if(!(!(e.evt.button!==void 0)||Ko.Konva.dragButtons.indexOf(e.evt.button)>=0)||this.isDragging())return;let i=!1;Vr.DD._dragElements.forEach(o=>{this.isAncestorOf(o.node)&&(i=!0)}),i||this._createDragElement(e)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const n=Vr.DD._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&Vr.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-e.x,y:-e.y,width:n.width()+2*e.x,height:n.height()+2*e.y};return pt.Util.haveIntersection(r,this.getClientRect())}static create(e,n){return pt.Util._isString(e)&&(e=JSON.parse(e)),this._createNode(e,n)}static _createNode(e,n){let r=lm.prototype.getClassName.call(e),i=e.children,o,a,l;n&&(e.attrs.container=n),Ko.Konva[r]||(pt.Util.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const s=Ko.Konva[r];if(o=new s(e.attrs),i)for(a=i.length,l=0;l<a;l++)o.add(lm._createNode(i[l]));return o}};qt.Node=ot;ot.prototype.nodeType="Node";ot.prototype._attrsAffectingSize=[];ot.prototype.eventListeners={};ot.prototype.on.call(ot.prototype,rT,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(Xo),this._clearSelfAndDescendantCache(ho)});ot.prototype.on.call(ot.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(am)});ot.prototype.on.call(ot.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(om)});ot.prototype.on.call(ot.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(jd)});const Lt=qc.Factory.addGetterSetter;Lt(ot,"zIndex");Lt(ot,"absolutePosition");Lt(ot,"position");Lt(ot,"x",0,(0,sn.getNumberValidator)());Lt(ot,"y",0,(0,sn.getNumberValidator)());Lt(ot,"globalCompositeOperation","source-over",(0,sn.getStringValidator)());Lt(ot,"opacity",1,(0,sn.getNumberValidator)());Lt(ot,"name","",(0,sn.getStringValidator)());Lt(ot,"id","",(0,sn.getStringValidator)());Lt(ot,"rotation",0,(0,sn.getNumberValidator)());qc.Factory.addComponentsGetterSetter(ot,"scale",["x","y"]);Lt(ot,"scaleX",1,(0,sn.getNumberValidator)());Lt(ot,"scaleY",1,(0,sn.getNumberValidator)());qc.Factory.addComponentsGetterSetter(ot,"skew",["x","y"]);Lt(ot,"skewX",0,(0,sn.getNumberValidator)());Lt(ot,"skewY",0,(0,sn.getNumberValidator)());qc.Factory.addComponentsGetterSetter(ot,"offset",["x","y"]);Lt(ot,"offsetX",0,(0,sn.getNumberValidator)());Lt(ot,"offsetY",0,(0,sn.getNumberValidator)());Lt(ot,"dragDistance",null,(0,sn.getNumberValidator)());Lt(ot,"width",0,(0,sn.getNumberValidator)());Lt(ot,"height",0,(0,sn.getNumberValidator)());Lt(ot,"listening",!0,(0,sn.getBooleanValidator)());Lt(ot,"preventDefault",!0,(0,sn.getBooleanValidator)());Lt(ot,"filters",null,function(t){return this._filterUpToDate=!1,t});Lt(ot,"visible",!0,(0,sn.getBooleanValidator)());Lt(ot,"transformsEnabled","all",(0,sn.getStringValidator)());Lt(ot,"size");Lt(ot,"dragBoundFunc");Lt(ot,"draggable",!1,(0,sn.getBooleanValidator)());qc.Factory.backCompat(ot,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var wl={};Object.defineProperty(wl,"__esModule",{value:!0});wl.Container=void 0;const Zs=ut,G1=qt,op=Ze;class Sl extends G1.Node{constructor(){super(...arguments),this.children=[]}getChildren(e){if(!e)return this.children||[];const n=this.children||[],r=[];return n.forEach(function(i){e(i)&&r.push(i)}),r}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.destroy()}),this.children=[],this._requestDraw(),this}add(...e){if(e.length===0)return this;if(e.length>1){for(let r=0;r<e.length;r++)this.add(e[r]);return this}const n=e[0];return n.getParent()?(n.moveTo(this),this):(this._validateAdd(n),n.index=this.getChildren().length,n.parent=this,n._clearCaches(),this.getChildren().push(n),this._fire("add",{child:n}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(e){return this._generalFind(e,!1)}findOne(e){const n=this._generalFind(e,!0);return n.length>0?n[0]:void 0}_generalFind(e,n){const r=[];return this._descendants(i=>{const o=i._isMatch(e);return o&&r.push(i),!!(o&&n)}),r}_descendants(e){let n=!1;const r=this.getChildren();for(const i of r){if(n=e(i),n)return!0;if(i.hasChildren()&&(n=i._descendants(e),n))return!0}return!1}toObject(){const e=G1.Node.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach(n=>{e.children.push(n.toObject())}),e}isAncestorOf(e){let n=e.getParent();for(;n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(e){const n=G1.Node.prototype.clone.call(this,e);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(e){const n=[];return this.find("Shape").forEach(r=>{r.isVisible()&&r.intersects(e)&&n.push(r)}),n}_clearSelfAndDescendantCache(e){var n;super._clearSelfAndDescendantCache(e),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;(e=this.children)===null||e===void 0||e.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(e,n,r){const i=this.getLayer(),o=e||i&&i.getCanvas(),a=o&&o.getContext(),l=this._getCanvasCache(),s=l&&l.scene,f=o&&o.isCache;if(!this.isVisible()&&!f)return this;if(s){a.save();const h=this.getAbsoluteTransform(n).getMatrix();a.transform(h[0],h[1],h[2],h[3],h[4],h[5]),this._drawCachedSceneCanvas(a),a.restore()}else this._drawChildren("drawScene",o,n,r);return this}drawHit(e,n){if(!this.shouldDrawHit(n))return this;const r=this.getLayer(),i=e||r&&r.hitCanvas,o=i&&i.getContext(),a=this._getCanvasCache();if(a&&a.hit){o.save();const s=this.getAbsoluteTransform(n).getMatrix();o.transform(s[0],s[1],s[2],s[3],s[4],s[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(e,n,r,i){var o;const a=n&&n.getContext(),l=this.clipWidth(),s=this.clipHeight(),f=this.clipFunc(),h=typeof l=="number"&&typeof s=="number"||f,x=r===this;if(h){a.save();const v=this.getAbsoluteTransform(r);let O=v.getMatrix();a.transform(O[0],O[1],O[2],O[3],O[4],O[5]),a.beginPath();let g;if(f)g=f.call(this,a,this);else{const b=this.clipX(),p=this.clipY();a.rect(b||0,p||0,l,s)}a.clip.apply(a,g),O=v.copy().invert().getMatrix(),a.transform(O[0],O[1],O[2],O[3],O[4],O[5])}const w=!x&&this.globalCompositeOperation()!=="source-over"&&e==="drawScene";w&&(a.save(),a._applyGlobalCompositeOperation(this)),(o=this.children)===null||o===void 0||o.forEach(function(v){v[e](n,r,i)}),w&&a.restore(),h&&a.restore()}getClientRect(e={}){var n;const r=e.skipTransform,i=e.relativeTo;let o,a,l,s,f={x:1/0,y:1/0,width:0,height:0};const h=this;(n=this.children)===null||n===void 0||n.forEach(function(v){if(!v.visible())return;const O=v.getClientRect({relativeTo:h,skipShadow:e.skipShadow,skipStroke:e.skipStroke});O.width===0&&O.height===0||(o===void 0?(o=O.x,a=O.y,l=O.x+O.width,s=O.y+O.height):(o=Math.min(o,O.x),a=Math.min(a,O.y),l=Math.max(l,O.x+O.width),s=Math.max(s,O.y+O.height)))});const x=this.find("Shape");let w=!1;for(let v=0;v<x.length;v++)if(x[v]._isVisible(this)){w=!0;break}return w&&o!==void 0?f={x:o,y:a,width:l-o,height:s-a}:f={x:0,y:0,width:0,height:0},r?f:this._transformedRect(f,i)}}wl.Container=Sl;Zs.Factory.addComponentsGetterSetter(Sl,"clip",["x","y","width","height"]);Zs.Factory.addGetterSetter(Sl,"clipX",void 0,(0,op.getNumberValidator)());Zs.Factory.addGetterSetter(Sl,"clipY",void 0,(0,op.getNumberValidator)());Zs.Factory.addGetterSetter(Sl,"clipWidth",void 0,(0,op.getNumberValidator)());Zs.Factory.addGetterSetter(Sl,"clipHeight",void 0,(0,op.getNumberValidator)());Zs.Factory.addGetterSetter(Sl,"clipFunc");var a9={},Ca={};Object.defineProperty(Ca,"__esModule",{value:!0});Ca.getCapturedShape=aT;Ca.createEvent=Iy;Ca.hasPointerCapture=lT;Ca.setPointerCapture=sT;Ca.releaseCapture=s9;const oT=st,Pc=new Map,l9=oT.Konva._global.PointerEvent!==void 0;function aT(t){return Pc.get(t)}function Iy(t){return{evt:t,pointerId:t.pointerId}}function lT(t,e){return Pc.get(t)===e}function sT(t,e){s9(t),e.getStage()&&(Pc.set(t,e),l9&&e._fire("gotpointercapture",Iy(new PointerEvent("gotpointercapture"))))}function s9(t,e){const n=Pc.get(t);if(!n)return;const r=n.getStage();r&&r.content,Pc.delete(t),l9&&n._fire("lostpointercapture",Iy(new PointerEvent("lostpointercapture")))}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Stage=t.stages=void 0;const e=en,n=ut,r=wl,i=st,o=wi,a=ip,l=st,s=Ca,f="Stage",h="string",x="px",w="mouseout",v="mouseleave",O="mouseover",g="mouseenter",b="mousemove",p="mousedown",y="mouseup",d="pointermove",m="pointerdown",_="pointerup",A="pointercancel",C="lostpointercapture",R="pointerout",S="pointerleave",E="pointerover",P="pointerenter",T="contextmenu",N="touchstart",U="touchend",G="touchmove",Z="touchcancel",W="wheel",H=5,L=[[g,"_pointerenter"],[p,"_pointerdown"],[b,"_pointermove"],[y,"_pointerup"],[v,"_pointerleave"],[N,"_pointerdown"],[G,"_pointermove"],[U,"_pointerup"],[Z,"_pointercancel"],[O,"_pointerover"],[W,"_wheel"],[T,"_contextmenu"],[m,"_pointerdown"],[d,"_pointermove"],[_,"_pointerup"],[A,"_pointercancel"],[C,"_lostpointercapture"]],M={mouse:{[R]:w,[S]:v,[E]:O,[P]:g,[d]:b,[m]:p,[_]:y,[A]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[R]:"touchout",[S]:"touchleave",[E]:"touchover",[P]:"touchenter",[d]:G,[m]:N,[_]:U,[A]:Z,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[R]:R,[S]:S,[E]:E,[P]:P,[d]:d,[m]:m,[_]:_,[A]:A,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},D=$=>$.indexOf("pointer")>=0?"pointer":$.indexOf("touch")>=0?"touch":"mouse",B=$=>{const z=D($);if(z==="pointer")return i.Konva.pointerEventsEnabled&&M.pointer;if(z==="touch")return M.touch;if(z==="mouse")return M.mouse};function V($={}){return($.clipFunc||$.clipWidth||$.clipHeight)&&e.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),$}const Y="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);";t.stages=[];class F extends r.Container{constructor(z){super(V(z)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),t.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",()=>{V(this.attrs)}),this._checkVisibility()}_validateAdd(z){const K=z.getType()==="Layer",X=z.getType()==="FastLayer";K||X||e.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===h){if(z.charAt(0)==="."){const X=z.slice(1);z=document.getElementsByClassName(X)[0]}else{var K;z.charAt(0)!=="#"?K=z:K=z.slice(1),z=document.getElementById(K)}if(!z)throw"Can not find container in document with id "+K}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(){let z=this.children,K=z.length,X;for(X=0;X<K;X++)z[X].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&&e.Util._isInDocument(z)&&this.container().removeChild(z);const K=t.stages.indexOf(this);return K>-1&&t.stages.splice(K,1),e.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}:(e.Util.warn(Y),null)}_getPointerById(z){return this._pointerPositions.find(K=>K.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 K=new o.SceneCanvas({width:z.width,height:z.height,pixelRatio:z.pixelRatio||1}),X=K.getContext()._context,Q=this.children;return(z.x||z.y)&&X.translate(-1*z.x,-1*z.y),Q.forEach(function(J){if(!J.isVisible())return;const ne=J._toKonvaCanvas(z);X.drawImage(ne._canvas,z.x,z.y,ne.getWidth()/ne.getPixelRatio(),ne.getHeight()/ne.getPixelRatio())}),K}getIntersection(z){if(!z)return null;let K=this.children,X=K.length,Q=X-1,J;for(J=Q;J>=0;J--){const ne=K[J].getIntersection(z);if(ne)return ne}return null}_resizeDOM(){const z=this.width(),K=this.height();this.content&&(this.content.style.width=z+x,this.content.style.height=K+x),this.bufferCanvas.setSize(z,K),this.bufferHitCanvas.setSize(z,K),this.children.forEach(X=>{X.setSize({width:z,height:K}),X.draw()})}add(z,...K){if(arguments.length>1){for(let Q=0;Q<arguments.length;Q++)this.add(arguments[Q]);return this}super.add(z);const X=this.children.length;return X>H&&e.Util.warn("The stage has "+X+" 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(),i.Konva.isBrowser&&this.content.appendChild(z.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(z){return s.hasPointerCapture(z,this)}setPointerCapture(z){s.setPointerCapture(z,this)}releaseCapture(z){s.releaseCapture(z,this)}getLayers(){return this.children}_bindContentEvents(){i.Konva.isBrowser&&L.forEach(([z,K])=>{this.content.addEventListener(z,X=>{this[K](X)},{passive:!1})})}_pointerenter(z){this.setPointersPositions(z);const K=B(z.type);K&&this._fire(K.pointerenter,{evt:z,target:this,currentTarget:this})}_pointerover(z){this.setPointersPositions(z);const K=B(z.type);K&&this._fire(K.pointerover,{evt:z,target:this,currentTarget:this})}_getTargetShape(z){let K=this[z+"targetShape"];return K&&!K.getStage()&&(K=null),K}_pointerleave(z){const K=B(z.type),X=D(z.type);if(!K)return;this.setPointersPositions(z);const Q=this._getTargetShape(X),J=!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled;Q&&J?(Q._fireAndBubble(K.pointerout,{evt:z}),Q._fireAndBubble(K.pointerleave,{evt:z}),this._fire(K.pointerleave,{evt:z,target:this,currentTarget:this}),this[X+"targetShape"]=null):J&&(this._fire(K.pointerleave,{evt:z,target:this,currentTarget:this}),this._fire(K.pointerout,{evt:z,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(z){const K=B(z.type),X=D(z.type);if(!K)return;this.setPointersPositions(z);let Q=!1;this._changedPointerPositions.forEach(J=>{const ne=this.getIntersection(J);if(a.DD.justDragged=!1,i.Konva["_"+X+"ListenClick"]=!0,!ne||!ne.isListening()){this[X+"ClickStartShape"]=void 0;return}i.Konva.capturePointerEventsEnabled&&ne.setPointerCapture(J.id),this[X+"ClickStartShape"]=ne,ne._fireAndBubble(K.pointerdown,{evt:z,pointerId:J.id}),Q=!0;const ie=z.type.indexOf("touch")>=0;ne.preventDefault()&&z.cancelable&&ie&&z.preventDefault()}),Q||this._fire(K.pointerdown,{evt:z,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(z){const K=B(z.type),X=D(z.type);if(!K||(i.Konva.isDragging()&&a.DD.node.preventDefault()&&z.cancelable&&z.preventDefault(),this.setPointersPositions(z),!(!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled)))return;const J={};let ne=!1;const ie=this._getTargetShape(X);this._changedPointerPositions.forEach(oe=>{const he=s.getCapturedShape(oe.id)||this.getIntersection(oe),me=oe.id,Pe={evt:z,pointerId:me},re=ie!==he;if(re&&ie&&(ie._fireAndBubble(K.pointerout,{...Pe},he),ie._fireAndBubble(K.pointerleave,{...Pe},he)),he){if(J[he._id])return;J[he._id]=!0}he&&he.isListening()?(ne=!0,re&&(he._fireAndBubble(K.pointerover,{...Pe},ie),he._fireAndBubble(K.pointerenter,{...Pe},ie),this[X+"targetShape"]=he),he._fireAndBubble(K.pointermove,{...Pe})):ie&&(this._fire(K.pointerover,{evt:z,target:this,currentTarget:this,pointerId:me}),this[X+"targetShape"]=null)}),ne||this._fire(K.pointermove,{evt:z,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(z){const K=B(z.type),X=D(z.type);if(!K)return;this.setPointersPositions(z);const Q=this[X+"ClickStartShape"],J=this[X+"ClickEndShape"],ne={};let ie=!1;this._changedPointerPositions.forEach(oe=>{const he=s.getCapturedShape(oe.id)||this.getIntersection(oe);if(he){if(he.releaseCapture(oe.id),ne[he._id])return;ne[he._id]=!0}const me=oe.id,Pe={evt:z,pointerId:me};let re=!1;i.Konva["_"+X+"InDblClickWindow"]?(re=!0,clearTimeout(this[X+"DblTimeout"])):a.DD.justDragged||(i.Konva["_"+X+"InDblClickWindow"]=!0,clearTimeout(this[X+"DblTimeout"])),this[X+"DblTimeout"]=setTimeout(function(){i.Konva["_"+X+"InDblClickWindow"]=!1},i.Konva.dblClickWindow),he&&he.isListening()?(ie=!0,this[X+"ClickEndShape"]=he,he._fireAndBubble(K.pointerup,{...Pe}),i.Konva["_"+X+"ListenClick"]&&Q&&Q===he&&(he._fireAndBubble(K.pointerclick,{...Pe}),re&&J&&J===he&&he._fireAndBubble(K.pointerdblclick,{...Pe}))):(this[X+"ClickEndShape"]=null,i.Konva["_"+X+"ListenClick"]&&this._fire(K.pointerclick,{evt:z,target:this,currentTarget:this,pointerId:me}),re&&this._fire(K.pointerdblclick,{evt:z,target:this,currentTarget:this,pointerId:me}))}),ie||this._fire(K.pointerup,{evt:z,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),i.Konva["_"+X+"ListenClick"]=!1,z.cancelable&&X!=="touch"&&z.preventDefault()}_contextmenu(z){this.setPointersPositions(z);const K=this.getIntersection(this.getPointerPosition());K&&K.isListening()?K._fireAndBubble(T,{evt:z}):this._fire(T,{evt:z,target:this,currentTarget:this})}_wheel(z){this.setPointersPositions(z);const K=this.getIntersection(this.getPointerPosition());K&&K.isListening()?K._fireAndBubble(W,{evt:z}):this._fire(W,{evt:z,target:this,currentTarget:this})}_pointercancel(z){this.setPointersPositions(z);const K=s.getCapturedShape(z.pointerId)||this.getIntersection(this.getPointerPosition());K&&K._fireAndBubble(_,s.createEvent(z)),s.releaseCapture(z.pointerId)}_lostpointercapture(z){s.releaseCapture(z.pointerId)}setPointersPositions(z){let K=this._getContentPosition(),X=null,Q=null;z=z||window.event,z.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(z.touches,J=>{this._pointerPositions.push({id:J.identifier,x:(J.clientX-K.left)/K.scaleX,y:(J.clientY-K.top)/K.scaleY})}),Array.prototype.forEach.call(z.changedTouches||z.touches,J=>{this._changedPointerPositions.push({id:J.identifier,x:(J.clientX-K.left)/K.scaleX,y:(J.clientY-K.top)/K.scaleY})})):(X=(z.clientX-K.left)/K.scaleX,Q=(z.clientY-K.top)/K.scaleY,this.pointerPos={x:X,y:Q},this._pointerPositions=[{x:X,y:Q,id:e.Util._getFirstPointerId(z)}],this._changedPointerPositions=[{x:X,y:Q,id:e.Util._getFirstPointerId(z)}])}_setPointerPosition(z){e.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()}),!i.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 e.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}}t.Stage=F,F.prototype.nodeType=f,(0,l._registerNode)(F),n.Factory.addGetterSetter(F,"container"),i.Konva.isBrowser&&document.addEventListener("visibilitychange",()=>{t.stages.forEach($=>{$.batchDraw()})})})(a9);var Wc={},En={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Shape=t.shapes=void 0;const e=st,n=en,r=ut,i=qt,o=Ze,a=st,l=Ca,s="hasShadow",f="shadowRGBA",h="patternImage",x="linearGradient",w="radialGradient";let v;function O(){return v||(v=n.Util.createCanvasElement().getContext("2d"),v)}t.shapes={};function g(S){const E=this.attrs.fillRule;E?S.fill(E):S.fill()}function b(S){S.stroke()}function p(S){const E=this.attrs.fillRule;E?S.fill(E):S.fill()}function y(S){S.stroke()}function d(){this._clearCache(s)}function m(){this._clearCache(f)}function _(){this._clearCache(h)}function A(){this._clearCache(x)}function C(){this._clearCache(w)}class R extends i.Node{constructor(E){super(E);let P;for(;P=n.Util.getRandomColor(),!(P&&!(P in t.shapes)););this.colorKey=P,t.shapes[P]=this}getContext(){return n.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return n.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(s,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(h,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const P=O().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(P&&P.setTransform){const T=new n.Transform;T.translate(this.fillPatternX(),this.fillPatternY()),T.rotate(e.Konva.getAngle(this.fillPatternRotation())),T.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),T.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const N=T.getMatrix(),U=typeof DOMMatrix>"u"?{a:N[0],b:N[1],c:N[2],d:N[3],e:N[4],f:N[5]}:new DOMMatrix(N);P.setTransform(U)}return P}}_getLinearGradient(){return this._getCache(x,this.__getLinearGradient)}__getLinearGradient(){const E=this.fillLinearGradientColorStops();if(E){const P=O(),T=this.fillLinearGradientStartPoint(),N=this.fillLinearGradientEndPoint(),U=P.createLinearGradient(T.x,T.y,N.x,N.y);for(let G=0;G<E.length;G+=2)U.addColorStop(E[G],E[G+1]);return U}}_getRadialGradient(){return this._getCache(w,this.__getRadialGradient)}__getRadialGradient(){const E=this.fillRadialGradientColorStops();if(E){const P=O(),T=this.fillRadialGradientStartPoint(),N=this.fillRadialGradientEndPoint(),U=P.createRadialGradient(T.x,T.y,this.fillRadialGradientStartRadius(),N.x,N.y,this.fillRadialGradientEndRadius());for(let G=0;G<E.length;G+=2)U.addColorStop(E[G],E[G+1]);return U}}getShadowRGBA(){return this._getCache(f,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const E=n.Util.colorToRGBA(this.shadowColor());if(E)return"rgba("+E.r+","+E.g+","+E.b+","+E.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 E=this.hitStrokeWidth();return E==="auto"?this.hasStroke():this.strokeEnabled()&&!!E}intersects(E){const P=this.getStage();if(!P)return!1;const T=P.bufferHitCanvas;return T.getContext().clear(),this.drawHit(T,void 0,!0),T.context.getImageData(Math.round(E.x),Math.round(E.y),1,1).data[3]>0}destroy(){return i.Node.prototype.destroy.call(this),delete t.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(E){var P;if(!((P=this.attrs.perfectDrawEnabled)!==null&&P!==void 0?P:!0))return!1;const N=E||this.hasFill(),U=this.hasStroke(),G=this.getAbsoluteOpacity()!==1;if(N&&U&&G)return!0;const Z=this.hasShadow(),W=this.shadowForStrokeEnabled();return!!(N&&U&&Z&&W)}setStrokeHitEnabled(E){n.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),E?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const E=this.size();return{x:this._centroid?-E.width/2:0,y:this._centroid?-E.height/2:0,width:E.width,height:E.height}}getClientRect(E={}){let P=!1,T=this.getParent();for(;T;){if(T.isCached()){P=!0;break}T=T.getParent()}const N=E.skipTransform,U=E.relativeTo||P&&this.getStage()||void 0,G=this.getSelfRect(),W=!E.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,H=G.width+W,L=G.height+W,M=!E.skipShadow&&this.hasShadow(),D=M?this.shadowOffsetX():0,B=M?this.shadowOffsetY():0,V=H+Math.abs(D),Y=L+Math.abs(B),F=M&&this.shadowBlur()||0,$=V+F*2,z=Y+F*2,K={width:$,height:z,x:-(W/2+F)+Math.min(D,0)+G.x,y:-(W/2+F)+Math.min(B,0)+G.y};return N?K:this._transformedRect(K,U)}drawScene(E,P,T){const N=this.getLayer();let U=E||N.getCanvas(),G=U.getContext(),Z=this._getCanvasCache(),W=this.getSceneFunc(),H=this.hasShadow(),L,M;const D=U.isCache,B=P===this;if(!this.isVisible()&&!B)return this;if(Z){G.save();const Y=this.getAbsoluteTransform(P).getMatrix();return G.transform(Y[0],Y[1],Y[2],Y[3],Y[4],Y[5]),this._drawCachedSceneCanvas(G),G.restore(),this}if(!W)return this;if(G.save(),this._useBufferCanvas()&&!D){L=this.getStage();const Y=T||L.bufferCanvas;M=Y.getContext(),M.clear(),M.save(),M._applyLineJoin(this);var V=this.getAbsoluteTransform(P).getMatrix();M.transform(V[0],V[1],V[2],V[3],V[4],V[5]),W.call(this,M,this),M.restore();const F=Y.pixelRatio;H&&G._applyShadow(this),G._applyOpacity(this),G._applyGlobalCompositeOperation(this),G.drawImage(Y._canvas,0,0,Y.width/F,Y.height/F)}else{if(G._applyLineJoin(this),!B){var V=this.getAbsoluteTransform(P).getMatrix();G.transform(V[0],V[1],V[2],V[3],V[4],V[5]),G._applyOpacity(this),G._applyGlobalCompositeOperation(this)}H&&G._applyShadow(this),W.call(this,G,this)}return G.restore(),this}drawHit(E,P,T=!1){if(!this.shouldDrawHit(P,T))return this;const N=this.getLayer(),U=E||N.hitCanvas,G=U&&U.getContext(),Z=this.hitFunc()||this.sceneFunc(),W=this._getCanvasCache(),H=W&&W.hit;if(this.colorKey||n.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()"),H){G.save();const M=this.getAbsoluteTransform(P).getMatrix();return G.transform(M[0],M[1],M[2],M[3],M[4],M[5]),this._drawCachedHitCanvas(G),G.restore(),this}if(!Z)return this;if(G.save(),G._applyLineJoin(this),!(this===P)){const M=this.getAbsoluteTransform(P).getMatrix();G.transform(M[0],M[1],M[2],M[3],M[4],M[5])}return Z.call(this,G,this),G.restore(),this}drawHitFromCache(E=0){let P=this._getCanvasCache(),T=this._getCachedSceneCanvas(),N=P.hit,U=N.getContext(),G=N.getWidth(),Z=N.getHeight(),W,H,L,M,D,B;U.clear(),U.drawImage(T._canvas,0,0,G,Z);try{for(W=U.getImageData(0,0,G,Z),H=W.data,L=H.length,M=n.Util._hexToRgb(this.colorKey),D=0;D<L;D+=4)B=H[D+3],B>E?(H[D]=M.r,H[D+1]=M.g,H[D+2]=M.b,H[D+3]=255):H[D+3]=0;U.putImageData(W,0,0)}catch(V){n.Util.error("Unable to draw hit graph from cached scene canvas. "+V.message)}return this}hasPointerCapture(E){return l.hasPointerCapture(E,this)}setPointerCapture(E){l.setPointerCapture(E,this)}releaseCapture(E){l.releaseCapture(E,this)}}t.Shape=R,R.prototype._fillFunc=g,R.prototype._strokeFunc=b,R.prototype._fillFuncHit=p,R.prototype._strokeFuncHit=y,R.prototype._centroid=!1,R.prototype.nodeType="Shape",(0,a._registerNode)(R),R.prototype.eventListeners={},R.prototype.on.call(R.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",d),R.prototype.on.call(R.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",m),R.prototype.on.call(R.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",_),R.prototype.on.call(R.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",A),R.prototype.on.call(R.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",C),r.Factory.addGetterSetter(R,"stroke",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(R,"strokeWidth",2,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(R,"fillAfterStrokeEnabled",!1),r.Factory.addGetterSetter(R,"hitStrokeWidth","auto",(0,o.getNumberOrAutoValidator)()),r.Factory.addGetterSetter(R,"strokeHitEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(R,"perfectDrawEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(R,"shadowForStrokeEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(R,"lineJoin"),r.Factory.addGetterSetter(R,"lineCap"),r.Factory.addGetterSetter(R,"sceneFunc"),r.Factory.addGetterSetter(R,"hitFunc"),r.Factory.addGetterSetter(R,"dash"),r.Factory.addGetterSetter(R,"dashOffset",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(R,"shadowColor",void 0,(0,o.getStringValidator)()),r.Factory.addGetterSetter(R,"shadowBlur",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(R,"shadowOpacity",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(R,"shadowOffset",["x","y"]),r.Factory.addGetterSetter(R,"shadowOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(R,"shadowOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(R,"fillPatternImage"),r.Factory.addGetterSetter(R,"fill",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(R,"fillPatternX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(R,"fillPatternY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(R,"fillLinearGradientColorStops"),r.Factory.addGetterSetter(R,"strokeLinearGradientColorStops"),r.Factory.addGetterSetter(R,"fillRadialGradientStartRadius",0),r.Factory.addGetterSetter(R,"fillRadialGradientEndRadius",0),r.Factory.addGetterSetter(R,"fillRadialGradientColorStops"),r.Factory.addGetterSetter(R,"fillPatternRepeat","repeat"),r.Factory.addGetterSetter(R,"fillEnabled",!0),r.Factory.addGetterSetter(R,"strokeEnabled",!0),r.Factory.addGetterSetter(R,"shadowEnabled",!0),r.Factory.addGetterSetter(R,"dashEnabled",!0),r.Factory.addGetterSetter(R,"strokeScaleEnabled",!0),r.Factory.addGetterSetter(R,"fillPriority","color"),r.Factory.addComponentsGetterSetter(R,"fillPatternOffset",["x","y"]),r.Factory.addGetterSetter(R,"fillPatternOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(R,"fillPatternOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(R,"fillPatternScale",["x","y"]),r.Factory.addGetterSetter(R,"fillPatternScaleX",1,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(R,"fillPatternScaleY",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(R,"fillLinearGradientStartPoint",["x","y"]),r.Factory.addComponentsGetterSetter(R,"strokeLinearGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(R,"fillLinearGradientStartPointX",0),r.Factory.addGetterSetter(R,"strokeLinearGradientStartPointX",0),r.Factory.addGetterSetter(R,"fillLinearGradientStartPointY",0),r.Factory.addGetterSetter(R,"strokeLinearGradientStartPointY",0),r.Factory.addComponentsGetterSetter(R,"fillLinearGradientEndPoint",["x","y"]),r.Factory.addComponentsGetterSetter(R,"strokeLinearGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(R,"fillLinearGradientEndPointX",0),r.Factory.addGetterSetter(R,"strokeLinearGradientEndPointX",0),r.Factory.addGetterSetter(R,"fillLinearGradientEndPointY",0),r.Factory.addGetterSetter(R,"strokeLinearGradientEndPointY",0),r.Factory.addComponentsGetterSetter(R,"fillRadialGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(R,"fillRadialGradientStartPointX",0),r.Factory.addGetterSetter(R,"fillRadialGradientStartPointY",0),r.Factory.addComponentsGetterSetter(R,"fillRadialGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(R,"fillRadialGradientEndPointX",0),r.Factory.addGetterSetter(R,"fillRadialGradientEndPointY",0),r.Factory.addGetterSetter(R,"fillPatternRotation",0),r.Factory.addGetterSetter(R,"fillRule",void 0,(0,o.getStringValidator)()),r.Factory.backCompat(R,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(En);Object.defineProperty(Wc,"__esModule",{value:!0});Wc.Layer=void 0;const fo=en,V1=wl,Ql=qt,Dy=ut,z5=wi,uT=Ze,cT=En,fT=st,dT="#",hT="beforeDraw",pT="draw",u9=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],gT=u9.length;let Qs=class extends V1.Container{constructor(e){super(e),this.canvas=new z5.SceneCanvas,this.hitCanvas=new z5.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(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);const n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),e<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[e+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){Ql.Node.prototype.moveToTop.call(this);const e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!Ql.Node.prototype.moveUp.call(this))return!1;const n=this.getStage();return!n||!n.content?!1:(n.content.removeChild(this.getNativeCanvasElement()),this.index<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[this.index+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(Ql.Node.prototype.moveDown.call(this)){const e=this.getStage();if(e){const n=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),n[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(Ql.Node.prototype.moveToBottom.call(this)){const e=this.getStage();if(e){const n=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),n[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const e=this.getNativeCanvasElement();return Ql.Node.prototype.remove.call(this),e&&e.parentNode&&fo.Util._isInDocument(e)&&e.parentNode.removeChild(e),this}getStage(){return this.parent}setSize({width:e,height:n}){return this.canvas.setSize(e,n),this.hitCanvas.setSize(e,n),this._setSmoothEnabled(),this}_validateAdd(e){const n=e.getType();n!=="Group"&&n!=="Shape"&&fo.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(e){return e=e||{},e.width=e.width||this.getWidth(),e.height=e.height||this.getHeight(),e.x=e.x!==void 0?e.x:this.x(),e.y=e.y!==void 0?e.y:this.y(),Ql.Node.prototype._toKonvaCanvas.call(this,e)}_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(){fo.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){fo.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,fo.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;let n=1,r=!1;for(;;){for(let i=0;i<gT;i++){const o=u9[i],a=this._getIntersection({x:e.x+o.x*n,y:e.y+o.y*n}),l=a.shape;if(l)return l;if(r=!!a.antialiased,!a.antialiased)break}if(r)n+=1;else return null}}_getIntersection(e){const n=this.hitCanvas.pixelRatio,r=this.hitCanvas.context.getImageData(Math.round(e.x*n),Math.round(e.y*n),1,1).data,i=r[3];if(i===255){const o=fo.Util._rgbToHex(r[0],r[1],r[2]),a=cT.shapes[dT+o];return a?{shape:a}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(e,n){const r=this.getLayer(),i=e||r&&r.getCanvas();return this._fire(hT,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),V1.Container.prototype.drawScene.call(this,i,n),this._fire(pT,{node:this}),this}drawHit(e,n){const r=this.getLayer(),i=e||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),V1.Container.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){fo.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return fo.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const e=this.parent;!!this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}destroy(){return fo.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};Wc.Layer=Qs;Qs.prototype.nodeType="Layer";(0,fT._registerNode)(Qs);Dy.Factory.addGetterSetter(Qs,"imageSmoothingEnabled",!0);Dy.Factory.addGetterSetter(Qs,"clearBeforeDraw",!0);Dy.Factory.addGetterSetter(Qs,"hitGraphEnabled",!0,(0,uT.getBooleanValidator)());var ap={};Object.defineProperty(ap,"__esModule",{value:!0});ap.FastLayer=void 0;const vT=en,mT=Wc,yT=st;let jy=class extends mT.Layer{constructor(e){super(e),this.listening(!1),vT.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}};ap.FastLayer=jy;jy.prototype.nodeType="FastLayer";(0,yT._registerNode)(jy);var Js={};Object.defineProperty(Js,"__esModule",{value:!0});Js.Group=void 0;const bT=en,_T=wl,wT=st;let Fy=class extends _T.Container{_validateAdd(e){const n=e.getType();n!=="Group"&&n!=="Shape"&&bT.Util.throw("You may only add groups and shapes to groups.")}};Js.Group=Fy;Fy.prototype.nodeType="Group";(0,wT._registerNode)(Fy);var eu={};Object.defineProperty(eu,"__esModule",{value:!0});eu.Animation=void 0;const q1=st,B5=en,W1=function(){return q1.glob.performance&&q1.glob.performance.now?function(){return q1.glob.performance.now()}:function(){return new Date().getTime()}}();class Hi{constructor(e,n){this.id=Hi.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:W1(),frameRate:0},this.func=e,this.setLayers(n)}setLayers(e){let n=[];return e&&(n=Array.isArray(e)?e:[e]),this.layers=n,this}getLayers(){return this.layers}addLayer(e){const n=this.layers,r=n.length;for(let i=0;i<r;i++)if(n[i]._id===e._id)return!1;return this.layers.push(e),!0}isRunning(){const n=Hi.animations,r=n.length;for(let i=0;i<r;i++)if(n[i].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=W1(),Hi._addAnimation(this),this}stop(){return Hi._removeAnimation(this),this}_updateFrameObject(e){this.frame.timeDiff=e-this.frame.lastTime,this.frame.lastTime=e,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(e){this.animations.push(e),this._handleAnimation()}static _removeAnimation(e){const n=e.id,r=this.animations,i=r.length;for(let o=0;o<i;o++)if(r[o].id===n){this.animations.splice(o,1);break}}static _runFrames(){const e={},n=this.animations;for(let r=0;r<n.length;r++){const i=n[r],o=i.layers,a=i.func;i._updateFrameObject(W1());const l=o.length;let s;if(a?s=a.call(i,i.frame)!==!1:s=!0,!!s)for(let f=0;f<l;f++){const h=o[f];h._id!==void 0&&(e[h._id]=h)}}for(const r in e)e.hasOwnProperty(r)&&e[r].batchDraw()}static _animationLoop(){const e=Hi;e.animations.length?(e._runFrames(),B5.Util.requestAnimFrame(e._animationLoop)):e.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,B5.Util.requestAnimFrame(this._animationLoop))}}eu.Animation=Hi;Hi.animations=[];Hi.animIdCounter=0;Hi.animRunning=!1;var c9={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Easings=t.Tween=void 0;const e=en,n=eu,r=qt,i=st;let o={node:1,duration:1,easing:1,onFinish:1,yoyo:1},a=1,l=2,s=3,f=0,h=["fill","stroke","shadowColor"];class x{constructor(O,g,b,p,y,d,m){this.prop=O,this.propFunc=g,this.begin=p,this._pos=p,this.duration=d,this._change=0,this.prevPos=0,this.yoyo=m,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=b,this._change=y-this.begin,this.pause()}fire(O){const g=this[O];g&&g()}setTime(O){O>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():O<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=O,this.update())}getTime(){return this._time}setPosition(O){this.prevPos=this._pos,this.propFunc(O),this._pos=O}getPosition(O){return O===void 0&&(O=this._time),this.func(O,this.begin,this._change,this.duration)}play(){this.state=l,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=s,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(O){this.pause(),this._time=O,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 O=this.getTimer()-this._startTime;this.state===l?this.setTime(O):this.state===s&&this.setTime(this.duration-O)}pause(){this.state=a,this.fire("onPause")}getTimer(){return new Date().getTime()}}class w{constructor(O){let g=this,b=O.node,p=b._id,y,d=O.easing||t.Easings.Linear,m=!!O.yoyo,_;typeof O.duration>"u"?y=.3:O.duration===0?y=.001:y=O.duration,this.node=b,this._id=f++;const A=b.getLayer()||(b instanceof i.Konva.Stage?b.getLayers():null);A||e.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new n.Animation(function(){g.tween.onEnterFrame()},A),this.tween=new x(_,function(C){g._tweenFunc(C)},d,0,1,y*1e3,m),this._addListeners(),w.attrs[p]||(w.attrs[p]={}),w.attrs[p][this._id]||(w.attrs[p][this._id]={}),w.tweens[p]||(w.tweens[p]={});for(_ in O)o[_]===void 0&&this._addAttr(_,O[_]);this.reset(),this.onFinish=O.onFinish,this.onReset=O.onReset,this.onUpdate=O.onUpdate}_addAttr(O,g){let b=this.node,p=b._id,y,d,m,_,A,C,R,S;if(m=w.tweens[p][O],m&&delete w.attrs[p][m][O],y=b.getAttr(O),e.Util._isArray(g))if(d=[],A=Math.max(g.length,y.length),O==="points"&&g.length!==y.length&&(g.length>y.length?(R=y,y=e.Util._prepareArrayForTween(y,g,b.closed())):(C=g,g=e.Util._prepareArrayForTween(g,y,b.closed()))),O.indexOf("fill")===0)for(_=0;_<A;_++)if(_%2===0)d.push(g[_]-y[_]);else{const E=e.Util.colorToRGBA(y[_]);S=e.Util.colorToRGBA(g[_]),y[_]=E,d.push({r:S.r-E.r,g:S.g-E.g,b:S.b-E.b,a:S.a-E.a})}else for(_=0;_<A;_++)d.push(g[_]-y[_]);else h.indexOf(O)!==-1?(y=e.Util.colorToRGBA(y),S=e.Util.colorToRGBA(g),d={r:S.r-y.r,g:S.g-y.g,b:S.b-y.b,a:S.a-y.a}):d=g-y;w.attrs[p][this._id][O]={start:y,diff:d,end:g,trueEnd:C,trueStart:R},w.tweens[p][O]=this._id}_tweenFunc(O){let g=this.node,b=w.attrs[g._id][this._id],p,y,d,m,_,A,C,R;for(p in b){if(y=b[p],d=y.start,m=y.diff,R=y.end,e.Util._isArray(d))if(_=[],C=Math.max(d.length,R.length),p.indexOf("fill")===0)for(A=0;A<C;A++)A%2===0?_.push((d[A]||0)+m[A]*O):_.push("rgba("+Math.round(d[A].r+m[A].r*O)+","+Math.round(d[A].g+m[A].g*O)+","+Math.round(d[A].b+m[A].b*O)+","+(d[A].a+m[A].a*O)+")");else for(A=0;A<C;A++)_.push((d[A]||0)+m[A]*O);else h.indexOf(p)!==-1?_="rgba("+Math.round(d.r+m.r*O)+","+Math.round(d.g+m.g*O)+","+Math.round(d.b+m.b*O)+","+(d.a+m.a*O)+")":_=d+m*O;g.setAttr(p,_)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const O=this.node,g=w.attrs[O._id][this._id];g.points&&g.points.trueEnd&&O.setAttr("points",g.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const O=this.node,g=w.attrs[O._id][this._id];g.points&&g.points.trueStart&&O.points(g.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(O){return this.tween.seek(O*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){let O=this.node._id,g=this._id,b=w.tweens[O],p;this.pause();for(p in b)delete w.tweens[O][p];delete w.attrs[O][g]}}t.Tween=w,w.attrs={},w.tweens={},r.Node.prototype.to=function(v){const O=v.onFinish;v.node=this,v.onFinish=function(){this.destroy(),O&&O()},new w(v).play()},t.Easings={BackEaseIn(v,O,g,b){return g*(v/=b)*v*((1.70158+1)*v-1.70158)+O},BackEaseOut(v,O,g,b){return g*((v=v/b-1)*v*((1.70158+1)*v+1.70158)+1)+O},BackEaseInOut(v,O,g,b){let p=1.70158;return(v/=b/2)<1?g/2*(v*v*(((p*=1.525)+1)*v-p))+O:g/2*((v-=2)*v*(((p*=1.525)+1)*v+p)+2)+O},ElasticEaseIn(v,O,g,b,p,y){let d=0;return v===0?O:(v/=b)===1?O+g:(y||(y=b*.3),!p||p<Math.abs(g)?(p=g,d=y/4):d=y/(2*Math.PI)*Math.asin(g/p),-(p*Math.pow(2,10*(v-=1))*Math.sin((v*b-d)*(2*Math.PI)/y))+O)},ElasticEaseOut(v,O,g,b,p,y){let d=0;return v===0?O:(v/=b)===1?O+g:(y||(y=b*.3),!p||p<Math.abs(g)?(p=g,d=y/4):d=y/(2*Math.PI)*Math.asin(g/p),p*Math.pow(2,-10*v)*Math.sin((v*b-d)*(2*Math.PI)/y)+g+O)},ElasticEaseInOut(v,O,g,b,p,y){let d=0;return v===0?O:(v/=b/2)===2?O+g:(y||(y=b*(.3*1.5)),!p||p<Math.abs(g)?(p=g,d=y/4):d=y/(2*Math.PI)*Math.asin(g/p),v<1?-.5*(p*Math.pow(2,10*(v-=1))*Math.sin((v*b-d)*(2*Math.PI)/y))+O:p*Math.pow(2,-10*(v-=1))*Math.sin((v*b-d)*(2*Math.PI)/y)*.5+g+O)},BounceEaseOut(v,O,g,b){return(v/=b)<1/2.75?g*(7.5625*v*v)+O:v<2/2.75?g*(7.5625*(v-=1.5/2.75)*v+.75)+O:v<2.5/2.75?g*(7.5625*(v-=2.25/2.75)*v+.9375)+O:g*(7.5625*(v-=2.625/2.75)*v+.984375)+O},BounceEaseIn(v,O,g,b){return g-t.Easings.BounceEaseOut(b-v,0,g,b)+O},BounceEaseInOut(v,O,g,b){return v<b/2?t.Easings.BounceEaseIn(v*2,0,g,b)*.5+O:t.Easings.BounceEaseOut(v*2-b,0,g,b)*.5+g*.5+O},EaseIn(v,O,g,b){return g*(v/=b)*v+O},EaseOut(v,O,g,b){return-g*(v/=b)*(v-2)+O},EaseInOut(v,O,g,b){return(v/=b/2)<1?g/2*v*v+O:-g/2*(--v*(v-2)-1)+O},StrongEaseIn(v,O,g,b){return g*(v/=b)*v*v*v*v+O},StrongEaseOut(v,O,g,b){return g*((v=v/b-1)*v*v*v*v+1)+O},StrongEaseInOut(v,O,g,b){return(v/=b/2)<1?g/2*v*v*v*v*v+O:g/2*((v-=2)*v*v*v*v+2)+O},Linear(v,O,g,b){return g*v/b+O}}})(c9);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;const e=st,n=en,r=qt,i=wl,o=a9,a=Wc,l=ap,s=Js,f=ip,h=En,x=eu,w=c9,v=So,O=wi;t.Konva=n.Util._assign(e.Konva,{Util:n.Util,Transform:n.Transform,Node:r.Node,Container:i.Container,Stage:o.Stage,stages:o.stages,Layer:a.Layer,FastLayer:l.FastLayer,Group:s.Group,DD:f.DD,Shape:h.Shape,shapes:h.shapes,Animation:x.Animation,Tween:w.Tween,Easings:w.Easings,Context:v.Context,Canvas:O.Canvas}),t.default=t.Konva})(bh);var lp={};Object.defineProperty(lp,"__esModule",{value:!0});lp.Arc=void 0;const sp=ut,ST=En,U5=st,up=Ze,ET=st;let Lo=class extends ST.Shape{_sceneFunc(e){const n=U5.Konva.getAngle(this.angle()),r=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,n,r),e.arc(0,0,this.innerRadius(),n,0,!r),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){const e=this.innerRadius(),n=this.outerRadius(),r=this.clockwise(),i=U5.Konva.getAngle(r?360-this.angle():this.angle()),o=Math.cos(Math.min(i,Math.PI)),a=1,l=Math.sin(Math.min(Math.max(Math.PI,i),3*Math.PI/2)),s=Math.sin(Math.min(i,Math.PI/2)),f=o*(o>0?e:n),h=a*n,x=l*(l>0?e:n),w=s*(s>0?n:e);return{x:f,y:r?-1*w:x,width:h-f,height:w-x}}};lp.Arc=Lo;Lo.prototype._centroid=!0;Lo.prototype.className="Arc";Lo.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,ET._registerNode)(Lo);sp.Factory.addGetterSetter(Lo,"innerRadius",0,(0,up.getNumberValidator)());sp.Factory.addGetterSetter(Lo,"outerRadius",0,(0,up.getNumberValidator)());sp.Factory.addGetterSetter(Lo,"angle",0,(0,up.getNumberValidator)());sp.Factory.addGetterSetter(Lo,"clockwise",!1,(0,up.getBooleanValidator)());var cp={},Yc={};Object.defineProperty(Yc,"__esModule",{value:!0});Yc.Line=void 0;const fp=ut,OT=st,xT=En,f9=Ze;function sm(t,e,n,r,i,o,a){const l=Math.sqrt(Math.pow(n-t,2)+Math.pow(r-e,2)),s=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2)),f=a*l/(l+s),h=a*s/(l+s),x=n-f*(i-t),w=r-f*(o-e),v=n+h*(i-t),O=r+h*(o-e);return[x,w,v,O]}function H5(t,e){const n=t.length,r=[];for(let i=2;i<n-2;i+=2){const o=sm(t[i-2],t[i-1],t[i],t[i+1],t[i+2],t[i+3],e);isNaN(o[0])||(r.push(o[0]),r.push(o[1]),r.push(t[i]),r.push(t[i+1]),r.push(o[2]),r.push(o[3]))}return r}let ka=class extends xT.Shape{constructor(e){super(e),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(e){let n=this.points(),r=n.length,i=this.tension(),o=this.closed(),a=this.bezier(),l,s,f;if(r){if(e.beginPath(),e.moveTo(n[0],n[1]),i!==0&&r>4){for(l=this.getTensionPoints(),s=l.length,f=o?0:4,o||e.quadraticCurveTo(l[0],l[1],l[2],l[3]);f<s-2;)e.bezierCurveTo(l[f++],l[f++],l[f++],l[f++],l[f++],l[f++]);o||e.quadraticCurveTo(l[s-2],l[s-1],n[r-2],n[r-1])}else if(a)for(f=2;f<r;)e.bezierCurveTo(n[f++],n[f++],n[f++],n[f++],n[f++],n[f++]);else for(f=2;f<r;f+=2)e.lineTo(n[f],n[f+1]);o?(e.closePath(),e.fillStrokeShape(this)):e.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():H5(this.points(),this.tension())}_getTensionPointsClosed(){const e=this.points(),n=e.length,r=this.tension(),i=sm(e[n-2],e[n-1],e[0],e[1],e[2],e[3],r),o=sm(e[n-4],e[n-3],e[n-2],e[n-1],e[0],e[1],r),a=H5(e,r);return[i[2],i[3]].concat(a).concat([o[0],o[1],e[n-2],e[n-1],o[2],o[3],i[0],i[1],e[0],e[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let e=this.points();if(e.length<4)return{x:e[0]||0,y:e[1]||0,width:0,height:0};this.tension()!==0?e=[e[0],e[1],...this._getTensionPoints(),e[e.length-2],e[e.length-1]]:e=this.points();let n=e[0],r=e[0],i=e[1],o=e[1],a,l;for(let s=0;s<e.length/2;s++)a=e[s*2],l=e[s*2+1],n=Math.min(n,a),r=Math.max(r,a),i=Math.min(i,l),o=Math.max(o,l);return{x:n,y:i,width:r-n,height:o-i}}};Yc.Line=ka;ka.prototype.className="Line";ka.prototype._attrsAffectingSize=["points","bezier","tension"];(0,OT._registerNode)(ka);fp.Factory.addGetterSetter(ka,"closed",!1);fp.Factory.addGetterSetter(ka,"bezier",!1);fp.Factory.addGetterSetter(ka,"tension",0,(0,f9.getNumberValidator)());fp.Factory.addGetterSetter(ka,"points",[],(0,f9.getNumberArrayValidator)());var tu={},d9={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.t2length=t.getQuadraticArcLength=t.getCubicArcLength=t.binomialCoefficients=t.cValues=t.tValues=void 0,t.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]],t.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]],t.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const e=(a,l,s)=>{let f,h;const w=s/2;f=0;for(let v=0;v<20;v++)h=w*t.tValues[20][v]+w,f+=t.cValues[20][v]*r(a,l,h);return w*f};t.getCubicArcLength=e;const n=(a,l,s)=>{s===void 0&&(s=1);const f=a[0]-2*a[1]+a[2],h=l[0]-2*l[1]+l[2],x=2*a[1]-2*a[0],w=2*l[1]-2*l[0],v=4*(f*f+h*h),O=4*(f*x+h*w),g=x*x+w*w;if(v===0)return s*Math.sqrt(Math.pow(a[2]-a[0],2)+Math.pow(l[2]-l[0],2));const b=O/(2*v),p=g/v,y=s+b,d=p-b*b,m=y*y+d>0?Math.sqrt(y*y+d):0,_=b*b+d>0?Math.sqrt(b*b+d):0,A=b+Math.sqrt(b*b+d)!==0?d*Math.log(Math.abs((y+m)/(b+_))):0;return Math.sqrt(v)/2*(y*m-b*_+A)};t.getQuadraticArcLength=n;function r(a,l,s){const f=i(1,s,a),h=i(1,s,l),x=f*f+h*h;return Math.sqrt(x)}const i=(a,l,s)=>{const f=s.length-1;let h,x;if(f===0)return 0;if(a===0){x=0;for(let w=0;w<=f;w++)x+=t.binomialCoefficients[f][w]*Math.pow(1-l,f-w)*Math.pow(l,w)*s[w];return x}else{h=new Array(f);for(let w=0;w<f;w++)h[w]=f*(s[w+1]-s[w]);return i(a-1,l,h)}},o=(a,l,s)=>{let f=1,h=a/l,x=(a-s(h))/l,w=0;for(;f>.001;){const v=s(h+x),O=Math.abs(a-v)/l;if(O<f)f=O,h+=x;else{const g=s(h-x),b=Math.abs(a-g)/l;b<f?(f=b,h-=x):x/=2}if(w++,w>500)break}return h};t.t2length=o})(d9);Object.defineProperty(tu,"__esModule",{value:!0});tu.Path=void 0;const PT=ut,CT=En,kT=st,Jl=d9;let Kc=class cr extends CT.Shape{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=cr.parsePathData(this.data()),this.pathLength=cr.getPathLength(this.dataArray)}_sceneFunc(e){const n=this.dataArray;e.beginPath();let r=!1;for(let g=0;g<n.length;g++){const b=n[g].command,p=n[g].points;switch(b){case"L":e.lineTo(p[0],p[1]);break;case"M":e.moveTo(p[0],p[1]);break;case"C":e.bezierCurveTo(p[0],p[1],p[2],p[3],p[4],p[5]);break;case"Q":e.quadraticCurveTo(p[0],p[1],p[2],p[3]);break;case"A":var i=p[0],o=p[1],a=p[2],l=p[3],s=p[4],f=p[5],h=p[6],x=p[7],w=a>l?a:l,v=a>l?1:a/l,O=a>l?l/a:1;e.translate(i,o),e.rotate(h),e.scale(v,O),e.arc(0,0,w,s,s+f,1-x),e.scale(1/v,1/O),e.rotate(-h),e.translate(-i,-o);break;case"z":r=!0,e.closePath();break}}!r&&!this.hasFill()?e.strokeShape(this):e.fillStrokeShape(this)}getSelfRect(){let e=[];this.dataArray.forEach(function(s){if(s.command==="A"){const f=s.points[4],h=s.points[5],x=s.points[4]+h;let w=Math.PI/180;if(Math.abs(f-x)<w&&(w=Math.abs(f-x)),h<0)for(let v=f-w;v>x;v-=w){const O=cr.getPointOnEllipticalArc(s.points[0],s.points[1],s.points[2],s.points[3],v,0);e.push(O.x,O.y)}else for(let v=f+w;v<x;v+=w){const O=cr.getPointOnEllipticalArc(s.points[0],s.points[1],s.points[2],s.points[3],v,0);e.push(O.x,O.y)}}else if(s.command==="C")for(let f=0;f<=1;f+=.01){const h=cr.getPointOnCubicBezier(f,s.start.x,s.start.y,s.points[0],s.points[1],s.points[2],s.points[3],s.points[4],s.points[5]);e.push(h.x,h.y)}else e=e.concat(s.points)});let n=e[0],r=e[0],i=e[1],o=e[1],a,l;for(let s=0;s<e.length/2;s++)a=e[s*2],l=e[s*2+1],isNaN(a)||(n=Math.min(n,a),r=Math.max(r,a)),isNaN(l)||(i=Math.min(i,l),o=Math.max(o,l));return{x:n,y:i,width:r-n,height:o-i}}getLength(){return this.pathLength}getPointAtLength(e){return cr.getPointAtLengthOfDataArray(e,this.dataArray)}static getLineLength(e,n,r,i){return Math.sqrt((r-e)*(r-e)+(i-n)*(i-n))}static getPathLength(e){let n=0;for(let r=0;r<e.length;++r)n+=e[r].pathLength;return n}static getPointAtLengthOfDataArray(e,n){let r,i=0,o=n.length;if(!o)return null;for(;i<o&&e>n[i].pathLength;)e-=n[i].pathLength,++i;if(i===o)return r=n[i-1].points.slice(-2),{x:r[0],y:r[1]};if(e<.01)return r=n[i].points.slice(0,2),{x:r[0],y:r[1]};const a=n[i],l=a.points;switch(a.command){case"L":return cr.getPointOnLine(e,a.start.x,a.start.y,l[0],l[1]);case"C":return cr.getPointOnCubicBezier((0,Jl.t2length)(e,cr.getPathLength(n),g=>(0,Jl.getCubicArcLength)([a.start.x,l[0],l[2],l[4]],[a.start.y,l[1],l[3],l[5]],g)),a.start.x,a.start.y,l[0],l[1],l[2],l[3],l[4],l[5]);case"Q":return cr.getPointOnQuadraticBezier((0,Jl.t2length)(e,cr.getPathLength(n),g=>(0,Jl.getQuadraticArcLength)([a.start.x,l[0],l[2]],[a.start.y,l[1],l[3]],g)),a.start.x,a.start.y,l[0],l[1],l[2],l[3]);case"A":var s=l[0],f=l[1],h=l[2],x=l[3],w=l[4],v=l[5],O=l[6];return w+=v*e/a.pathLength,cr.getPointOnEllipticalArc(s,f,h,x,w,O)}return null}static getPointOnLine(e,n,r,i,o,a,l){a=a??n,l=l??r;const s=this.getLineLength(n,r,i,o);if(s<1e-10)return{x:n,y:r};if(i===n)return{x:a,y:l+(o>r?e:-e)};const f=(o-r)/(i-n),h=Math.sqrt(e*e/(1+f*f))*(i<n?-1:1),x=f*h;if(Math.abs(l-r-f*(a-n))<1e-10)return{x:a+h,y:l+x};const w=((a-n)*(i-n)+(l-r)*(o-r))/(s*s),v=n+w*(i-n),O=r+w*(o-r),g=this.getLineLength(a,l,v,O),b=Math.sqrt(e*e-g*g),p=Math.sqrt(b*b/(1+f*f))*(i<n?-1:1),y=f*p;return{x:v+p,y:O+y}}static getPointOnCubicBezier(e,n,r,i,o,a,l,s,f){function h(b){return b*b*b}function x(b){return 3*b*b*(1-b)}function w(b){return 3*b*(1-b)*(1-b)}function v(b){return(1-b)*(1-b)*(1-b)}const O=s*h(e)+a*x(e)+i*w(e)+n*v(e),g=f*h(e)+l*x(e)+o*w(e)+r*v(e);return{x:O,y:g}}static getPointOnQuadraticBezier(e,n,r,i,o,a,l){function s(v){return v*v}function f(v){return 2*v*(1-v)}function h(v){return(1-v)*(1-v)}const x=a*s(e)+i*f(e)+n*h(e),w=l*s(e)+o*f(e)+r*h(e);return{x,y:w}}static getPointOnEllipticalArc(e,n,r,i,o,a){const l=Math.cos(a),s=Math.sin(a),f={x:r*Math.cos(o),y:i*Math.sin(o)};return{x:e+(f.x*l-f.y*s),y:n+(f.x*s+f.y*l)}}static parsePathData(e){if(!e)return[];let n=e;const r=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];n=n.replace(new RegExp(" ","g"),",");for(var i=0;i<r.length;i++)n=n.replace(new RegExp(r[i],"g"),"|"+r[i]);const o=n.split("|"),a=[],l=[];let s=0,f=0;const h=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let x;for(i=1;i<o.length;i++){let R=o[i],S=R.charAt(0);for(R=R.slice(1),l.length=0;x=h.exec(R);)l.push(x[0]);const E=[];for(let P=0,T=l.length;P<T;P++){if(l[P]==="00"){E.push(0,0);continue}const N=parseFloat(l[P]);isNaN(N)?E.push(0):E.push(N)}for(;E.length>0&&!isNaN(E[0]);){let P="",T=[];const N=s,U=f;var w,v,O,g,b,p,y,d,m,_;switch(S){case"l":s+=E.shift(),f+=E.shift(),P="L",T.push(s,f);break;case"L":s=E.shift(),f=E.shift(),T.push(s,f);break;case"m":var A=E.shift(),C=E.shift();if(s+=A,f+=C,P="M",a.length>2&&a[a.length-1].command==="z"){for(let G=a.length-2;G>=0;G--)if(a[G].command==="M"){s=a[G].points[0]+A,f=a[G].points[1]+C;break}}T.push(s,f),S="l";break;case"M":s=E.shift(),f=E.shift(),P="M",T.push(s,f),S="L";break;case"h":s+=E.shift(),P="L",T.push(s,f);break;case"H":s=E.shift(),P="L",T.push(s,f);break;case"v":f+=E.shift(),P="L",T.push(s,f);break;case"V":f=E.shift(),P="L",T.push(s,f);break;case"C":T.push(E.shift(),E.shift(),E.shift(),E.shift()),s=E.shift(),f=E.shift(),T.push(s,f);break;case"c":T.push(s+E.shift(),f+E.shift(),s+E.shift(),f+E.shift()),s+=E.shift(),f+=E.shift(),P="C",T.push(s,f);break;case"S":v=s,O=f,w=a[a.length-1],w.command==="C"&&(v=s+(s-w.points[2]),O=f+(f-w.points[3])),T.push(v,O,E.shift(),E.shift()),s=E.shift(),f=E.shift(),P="C",T.push(s,f);break;case"s":v=s,O=f,w=a[a.length-1],w.command==="C"&&(v=s+(s-w.points[2]),O=f+(f-w.points[3])),T.push(v,O,s+E.shift(),f+E.shift()),s+=E.shift(),f+=E.shift(),P="C",T.push(s,f);break;case"Q":T.push(E.shift(),E.shift()),s=E.shift(),f=E.shift(),T.push(s,f);break;case"q":T.push(s+E.shift(),f+E.shift()),s+=E.shift(),f+=E.shift(),P="Q",T.push(s,f);break;case"T":v=s,O=f,w=a[a.length-1],w.command==="Q"&&(v=s+(s-w.points[0]),O=f+(f-w.points[1])),s=E.shift(),f=E.shift(),P="Q",T.push(v,O,s,f);break;case"t":v=s,O=f,w=a[a.length-1],w.command==="Q"&&(v=s+(s-w.points[0]),O=f+(f-w.points[1])),s+=E.shift(),f+=E.shift(),P="Q",T.push(v,O,s,f);break;case"A":g=E.shift(),b=E.shift(),p=E.shift(),y=E.shift(),d=E.shift(),m=s,_=f,s=E.shift(),f=E.shift(),P="A",T=this.convertEndpointToCenterParameterization(m,_,s,f,y,d,g,b,p);break;case"a":g=E.shift(),b=E.shift(),p=E.shift(),y=E.shift(),d=E.shift(),m=s,_=f,s+=E.shift(),f+=E.shift(),P="A",T=this.convertEndpointToCenterParameterization(m,_,s,f,y,d,g,b,p);break}a.push({command:P||S,points:T,start:{x:N,y:U},pathLength:this.calcLength(N,U,P||S,T)})}(S==="z"||S==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(e,n,r,i){let o,a,l,s;const f=cr;switch(r){case"L":return f.getLineLength(e,n,i[0],i[1]);case"C":return(0,Jl.getCubicArcLength)([e,i[0],i[2],i[4]],[n,i[1],i[3],i[5]],1);case"Q":return(0,Jl.getQuadraticArcLength)([e,i[0],i[2]],[n,i[1],i[3]],1);case"A":o=0;var h=i[4],x=i[5],w=i[4]+x,v=Math.PI/180;if(Math.abs(h-w)<v&&(v=Math.abs(h-w)),a=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],h,0),x<0)for(s=h-v;s>w;s-=v)l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],s,0),o+=f.getLineLength(a.x,a.y,l.x,l.y),a=l;else for(s=h+v;s<w;s+=v)l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],s,0),o+=f.getLineLength(a.x,a.y,l.x,l.y),a=l;return l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],w,0),o+=f.getLineLength(a.x,a.y,l.x,l.y),o}return 0}static convertEndpointToCenterParameterization(e,n,r,i,o,a,l,s,f){const h=f*(Math.PI/180),x=Math.cos(h)*(e-r)/2+Math.sin(h)*(n-i)/2,w=-1*Math.sin(h)*(e-r)/2+Math.cos(h)*(n-i)/2,v=x*x/(l*l)+w*w/(s*s);v>1&&(l*=Math.sqrt(v),s*=Math.sqrt(v));let O=Math.sqrt((l*l*(s*s)-l*l*(w*w)-s*s*(x*x))/(l*l*(w*w)+s*s*(x*x)));o===a&&(O*=-1),isNaN(O)&&(O=0);const g=O*l*w/s,b=O*-s*x/l,p=(e+r)/2+Math.cos(h)*g-Math.sin(h)*b,y=(n+i)/2+Math.sin(h)*g+Math.cos(h)*b,d=function(E){return Math.sqrt(E[0]*E[0]+E[1]*E[1])},m=function(E,P){return(E[0]*P[0]+E[1]*P[1])/(d(E)*d(P))},_=function(E,P){return(E[0]*P[1]<E[1]*P[0]?-1:1)*Math.acos(m(E,P))},A=_([1,0],[(x-g)/l,(w-b)/s]),C=[(x-g)/l,(w-b)/s],R=[(-1*x-g)/l,(-1*w-b)/s];let S=_(C,R);return m(C,R)<=-1&&(S=Math.PI),m(C,R)>=1&&(S=0),a===0&&S>0&&(S=S-2*Math.PI),a===1&&S<0&&(S=S+2*Math.PI),[p,y,l,s,A,S,h,a]}};tu.Path=Kc;Kc.prototype.className="Path";Kc.prototype._attrsAffectingSize=["data"];(0,kT._registerNode)(Kc);PT.Factory.addGetterSetter(Kc,"data");Object.defineProperty(cp,"__esModule",{value:!0});cp.Arrow=void 0;const dp=ut,TT=Yc,h9=Ze,AT=st,$5=tu;let El=class extends TT.Line{_sceneFunc(e){super._sceneFunc(e);const n=Math.PI*2,r=this.points();let i=r;const o=this.tension()!==0&&r.length>4;o&&(i=this.getTensionPoints());const a=this.pointerLength(),l=r.length;let s,f;if(o){const w=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[l-2],r[l-1]],v=$5.Path.calcLength(i[i.length-4],i[i.length-3],"C",w),O=$5.Path.getPointOnQuadraticBezier(Math.min(1,1-a/v),w[0],w[1],w[2],w[3],w[4],w[5]);s=r[l-2]-O.x,f=r[l-1]-O.y}else s=r[l-2]-r[l-4],f=r[l-1]-r[l-3];const h=(Math.atan2(f,s)+n)%n,x=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(r[l-2],r[l-1]),e.rotate(h),e.moveTo(0,0),e.lineTo(-a,x/2),e.lineTo(-a,-x/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(r[0],r[1]),o?(s=(i[0]+i[2])/2-r[0],f=(i[1]+i[3])/2-r[1]):(s=r[2]-r[0],f=r[3]-r[1]),e.rotate((Math.atan2(-f,-s)+n)%n),e.moveTo(0,0),e.lineTo(-a,x/2),e.lineTo(-a,-x/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){const n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),n=this.pointerWidth()/2;return{x:e.x-n,y:e.y-n,width:e.width+n*2,height:e.height+n*2}}};cp.Arrow=El;El.prototype.className="Arrow";(0,AT._registerNode)(El);dp.Factory.addGetterSetter(El,"pointerLength",10,(0,h9.getNumberValidator)());dp.Factory.addGetterSetter(El,"pointerWidth",10,(0,h9.getNumberValidator)());dp.Factory.addGetterSetter(El,"pointerAtBeginning",!1);dp.Factory.addGetterSetter(El,"pointerAtEnding",!0);var hp={};Object.defineProperty(hp,"__esModule",{value:!0});hp.Circle=void 0;const RT=ut,MT=En,LT=Ze,NT=st;let nu=class extends MT.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}};hp.Circle=nu;nu.prototype._centroid=!0;nu.prototype.className="Circle";nu.prototype._attrsAffectingSize=["radius"];(0,NT._registerNode)(nu);RT.Factory.addGetterSetter(nu,"radius",0,(0,LT.getNumberValidator)());var pp={};Object.defineProperty(pp,"__esModule",{value:!0});pp.Ellipse=void 0;const zy=ut,IT=En,p9=Ze,DT=st;let Ta=class extends IT.Shape{_sceneFunc(e){const n=this.radiusX(),r=this.radiusY();e.beginPath(),e.save(),n!==r&&e.scale(1,r/n),e.arc(0,0,n,0,Math.PI*2,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}};pp.Ellipse=Ta;Ta.prototype.className="Ellipse";Ta.prototype._centroid=!0;Ta.prototype._attrsAffectingSize=["radiusX","radiusY"];(0,DT._registerNode)(Ta);zy.Factory.addComponentsGetterSetter(Ta,"radius",["x","y"]);zy.Factory.addGetterSetter(Ta,"radiusX",0,(0,p9.getNumberValidator)());zy.Factory.addGetterSetter(Ta,"radiusY",0,(0,p9.getNumberValidator)());var gp={};Object.defineProperty(gp,"__esModule",{value:!0});gp.Image=void 0;const Y1=en,Ol=ut,jT=En,FT=st,Xc=Ze;let Ji=class g9 extends jT.Shape{constructor(e){super(e),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&e.readyState===4||e&&e.addEventListener&&e.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){const e=!!this.cornerRadius(),n=this.hasShadow();return e&&n?!0:super._useBufferCanvas(!0)}_sceneFunc(e){const n=this.getWidth(),r=this.getHeight(),i=this.cornerRadius(),o=this.attrs.image;let a;if(o){const l=this.attrs.cropWidth,s=this.attrs.cropHeight;l&&s?a=[o,this.cropX(),this.cropY(),l,s,0,0,n,r]:a=[o,0,0,n,r]}(this.hasFill()||this.hasStroke()||i)&&(e.beginPath(),i?Y1.Util.drawRoundedRectPath(e,n,r,i):e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)),o&&(i&&e.clip(),e.drawImage.apply(e,a))}_hitFunc(e){const n=this.width(),r=this.height(),i=this.cornerRadius();e.beginPath(),i?Y1.Util.drawRoundedRectPath(e,n,r,i):e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,n;return(e=this.attrs.width)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.width}getHeight(){var e,n;return(e=this.attrs.height)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.height}static fromURL(e,n,r=null){const i=Y1.Util.createImageElement();i.onload=function(){const o=new g9({image:i});n(o)},i.onerror=r,i.crossOrigin="Anonymous",i.src=e}};gp.Image=Ji;Ji.prototype.className="Image";(0,FT._registerNode)(Ji);Ol.Factory.addGetterSetter(Ji,"cornerRadius",0,(0,Xc.getNumberOrArrayOfNumbersValidator)(4));Ol.Factory.addGetterSetter(Ji,"image");Ol.Factory.addComponentsGetterSetter(Ji,"crop",["x","y","width","height"]);Ol.Factory.addGetterSetter(Ji,"cropX",0,(0,Xc.getNumberValidator)());Ol.Factory.addGetterSetter(Ji,"cropY",0,(0,Xc.getNumberValidator)());Ol.Factory.addGetterSetter(Ji,"cropWidth",0,(0,Xc.getNumberValidator)());Ol.Factory.addGetterSetter(Ji,"cropHeight",0,(0,Xc.getNumberValidator)());var Ds={};Object.defineProperty(Ds,"__esModule",{value:!0});Ds.Tag=Ds.Label=void 0;const vp=ut,zT=En,BT=Js,By=Ze,v9=st,m9=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],UT="Change.konva",HT="none",um="up",cm="right",fm="down",dm="left",$T=m9.length;let Uy=class extends BT.Group{constructor(e){super(e),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){let n=this,r;const i=function(){n._sync()};for(r=0;r<$T;r++)e.on(m9[r]+UT,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let e=this.getText(),n=this.getTag(),r,i,o,a,l,s,f;if(e&&n){switch(r=e.width(),i=e.height(),o=n.pointerDirection(),a=n.pointerWidth(),f=n.pointerHeight(),l=0,s=0,o){case um:l=r/2,s=-1*f;break;case cm:l=r+a,s=i/2;break;case fm:l=r/2,s=i+f;break;case dm:l=-1*a,s=i/2;break}n.setAttrs({x:-1*l,y:-1*s,width:r,height:i}),e.setAttrs({x:-1*l,y:-1*s})}}};Ds.Label=Uy;Uy.prototype.className="Label";(0,v9._registerNode)(Uy);let xl=class extends zT.Shape{_sceneFunc(e){const n=this.width(),r=this.height(),i=this.pointerDirection(),o=this.pointerWidth(),a=this.pointerHeight(),l=this.cornerRadius();let s=0,f=0,h=0,x=0;typeof l=="number"?s=f=h=x=Math.min(l,n/2,r/2):(s=Math.min(l[0]||0,n/2,r/2),f=Math.min(l[1]||0,n/2,r/2),x=Math.min(l[2]||0,n/2,r/2),h=Math.min(l[3]||0,n/2,r/2)),e.beginPath(),e.moveTo(s,0),i===um&&(e.lineTo((n-o)/2,0),e.lineTo(n/2,-1*a),e.lineTo((n+o)/2,0)),e.lineTo(n-f,0),e.arc(n-f,f,f,Math.PI*3/2,0,!1),i===cm&&(e.lineTo(n,(r-a)/2),e.lineTo(n+o,r/2),e.lineTo(n,(r+a)/2)),e.lineTo(n,r-x),e.arc(n-x,r-x,x,0,Math.PI/2,!1),i===fm&&(e.lineTo((n+o)/2,r),e.lineTo(n/2,r+a),e.lineTo((n-o)/2,r)),e.lineTo(h,r),e.arc(h,r-h,h,Math.PI/2,Math.PI,!1),i===dm&&(e.lineTo(0,(r+a)/2),e.lineTo(-1*o,r/2),e.lineTo(0,(r-a)/2)),e.lineTo(0,s),e.arc(s,s,s,Math.PI,Math.PI*3/2,!1),e.closePath(),e.fillStrokeShape(this)}getSelfRect(){let e=0,n=0,r=this.pointerWidth(),i=this.pointerHeight(),o=this.pointerDirection(),a=this.width(),l=this.height();return o===um?(n-=i,l+=i):o===fm?l+=i:o===dm?(e-=r*1.5,a+=r):o===cm&&(a+=r*1.5),{x:e,y:n,width:a,height:l}}};Ds.Tag=xl;xl.prototype.className="Tag";(0,v9._registerNode)(xl);vp.Factory.addGetterSetter(xl,"pointerDirection",HT);vp.Factory.addGetterSetter(xl,"pointerWidth",0,(0,By.getNumberValidator)());vp.Factory.addGetterSetter(xl,"pointerHeight",0,(0,By.getNumberValidator)());vp.Factory.addGetterSetter(xl,"cornerRadius",0,(0,By.getNumberOrArrayOfNumbersValidator)(4));var Zc={};Object.defineProperty(Zc,"__esModule",{value:!0});Zc.Rect=void 0;const GT=ut,VT=En,qT=st,WT=en,YT=Ze;let mp=class extends VT.Shape{_sceneFunc(e){const n=this.cornerRadius(),r=this.width(),i=this.height();e.beginPath(),n?WT.Util.drawRoundedRectPath(e,r,i,n):e.rect(0,0,r,i),e.closePath(),e.fillStrokeShape(this)}};Zc.Rect=mp;mp.prototype.className="Rect";(0,qT._registerNode)(mp);GT.Factory.addGetterSetter(mp,"cornerRadius",0,(0,YT.getNumberOrArrayOfNumbersValidator)(4));var yp={};Object.defineProperty(yp,"__esModule",{value:!0});yp.RegularPolygon=void 0;const y9=ut,KT=En,b9=Ze,XT=st;let Pl=class extends KT.Shape{_sceneFunc(e){const n=this._getPoints();e.beginPath(),e.moveTo(n[0].x,n[0].y);for(let r=1;r<n.length;r++)e.lineTo(n[r].x,n[r].y);e.closePath(),e.fillStrokeShape(this)}_getPoints(){const e=this.attrs.sides,n=this.attrs.radius||0,r=[];for(let i=0;i<e;i++)r.push({x:n*Math.sin(i*2*Math.PI/e),y:-1*n*Math.cos(i*2*Math.PI/e)});return r}getSelfRect(){const e=this._getPoints();let n=e[0].x,r=e[0].y,i=e[0].x,o=e[0].y;return e.forEach(a=>{n=Math.min(n,a.x),r=Math.max(r,a.x),i=Math.min(i,a.y),o=Math.max(o,a.y)}),{x:n,y:i,width:r-n,height:o-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}};yp.RegularPolygon=Pl;Pl.prototype.className="RegularPolygon";Pl.prototype._centroid=!0;Pl.prototype._attrsAffectingSize=["radius"];(0,XT._registerNode)(Pl);y9.Factory.addGetterSetter(Pl,"radius",0,(0,b9.getNumberValidator)());y9.Factory.addGetterSetter(Pl,"sides",0,(0,b9.getNumberValidator)());var bp={};Object.defineProperty(bp,"__esModule",{value:!0});bp.Ring=void 0;const _9=ut,ZT=En,w9=Ze,QT=st,G5=Math.PI*2;let Cl=class extends ZT.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,G5,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),G5,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}};bp.Ring=Cl;Cl.prototype.className="Ring";Cl.prototype._centroid=!0;Cl.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,QT._registerNode)(Cl);_9.Factory.addGetterSetter(Cl,"innerRadius",0,(0,w9.getNumberValidator)());_9.Factory.addGetterSetter(Cl,"outerRadius",0,(0,w9.getNumberValidator)());var _p={};Object.defineProperty(_p,"__esModule",{value:!0});_p.Sprite=void 0;const kl=ut,JT=En,eA=eu,S9=Ze,tA=st;let eo=class extends JT.Shape{constructor(e){super(e),this._updated=!0,this.anim=new eA.Animation(()=>{const n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(e){const n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),l=o[i+0],s=o[i+1],f=o[i+2],h=o[i+3],x=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,f,h),e.closePath(),e.fillStrokeShape(this)),x)if(a){const w=a[n],v=r*2;e.drawImage(x,l,s,f,h,w[v+0],w[v+1],f,h)}else e.drawImage(x,l,s,f,h,0,0,f,h)}_hitFunc(e){const n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),l=o[i+2],s=o[i+3];if(e.beginPath(),a){const f=a[n],h=r*2;e.rect(f[h+0],f[h+1],l,s)}else e.rect(0,0,l,s);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const e=this;this.interval=setInterval(function(){e._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const e=this.frameIndex(),n=this.animation(),r=this.animations(),i=r[n],o=i.length/4;e<o-1?this.frameIndex(e+1):this.frameIndex(0)}};_p.Sprite=eo;eo.prototype.className="Sprite";(0,tA._registerNode)(eo);kl.Factory.addGetterSetter(eo,"animation");kl.Factory.addGetterSetter(eo,"animations");kl.Factory.addGetterSetter(eo,"frameOffsets");kl.Factory.addGetterSetter(eo,"image");kl.Factory.addGetterSetter(eo,"frameIndex",0,(0,S9.getNumberValidator)());kl.Factory.addGetterSetter(eo,"frameRate",17,(0,S9.getNumberValidator)());kl.Factory.backCompat(eo,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var wp={};Object.defineProperty(wp,"__esModule",{value:!0});wp.Star=void 0;const Hy=ut,nA=En,$y=Ze,rA=st;let Aa=class extends nA.Shape{_sceneFunc(e){const n=this.innerRadius(),r=this.outerRadius(),i=this.numPoints();e.beginPath(),e.moveTo(0,0-r);for(let o=1;o<i*2;o++){const a=o%2===0?r:n,l=a*Math.sin(o*Math.PI/i),s=-1*a*Math.cos(o*Math.PI/i);e.lineTo(l,s)}e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}};wp.Star=Aa;Aa.prototype.className="Star";Aa.prototype._centroid=!0;Aa.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,rA._registerNode)(Aa);Hy.Factory.addGetterSetter(Aa,"numPoints",5,(0,$y.getNumberValidator)());Hy.Factory.addGetterSetter(Aa,"innerRadius",0,(0,$y.getNumberValidator)());Hy.Factory.addGetterSetter(Aa,"outerRadius",0,(0,$y.getNumberValidator)());var ru={};Object.defineProperty(ru,"__esModule",{value:!0});ru.Text=void 0;ru.stringToArray=E9;const hm=en,Xn=ut,iA=En,K1=st,Ra=Ze,oA=st;function E9(t){return[...t].reduce((e,n,r,i)=>(new RegExp("\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?(?:\\u200D\\p{Emoji_Presentation})+","u").test(n)?e.push(n):new RegExp("\\p{Regional_Indicator}{2}","u").test(n+(i[r+1]||""))?e.push(n+i[r+1]):r>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(n)?e[e.length-1]+=n:e.push(n),e),[])}const es="auto",aA="center",O9="inherit",Fu="justify",lA="Change.konva",sA="2d",V5="-",x9="left",uA="text",cA="Text",fA="top",dA="bottom",q5="middle",P9="normal",hA="px ",yd=" ",pA="right",W5="rtl",gA="word",vA="char",Y5="none",X1="…",C9=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],mA=C9.length;function yA(t){return t.split(",").map(e=>{e=e.trim();const n=e.indexOf(" ")>=0,r=e.indexOf('"')>=0||e.indexOf("'")>=0;return n&&!r&&(e=`"${e}"`),e}).join(", ")}let bd;function Z1(){return bd||(bd=hm.Util.createCanvasElement().getContext(sA),bd)}function bA(t){t.fillText(this._partialText,this._partialTextX,this._partialTextY)}function _A(t){t.setAttr("miterLimit",2),t.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function wA(t){return t=t||{},!t.fillLinearGradientColorStops&&!t.fillRadialGradientColorStops&&!t.fillPatternImage&&(t.fill=t.fill||"black"),t}let on=class extends iA.Shape{constructor(e){super(wA(e)),this._partialTextX=0,this._partialTextY=0;for(let n=0;n<mA;n++)this.on(C9[n]+lA,this._setTextData);this._setTextData()}_sceneFunc(e){const n=this.textArr,r=n.length;if(!this.text())return;let i=this.padding(),o=this.fontSize(),a=this.lineHeight()*o,l=this.verticalAlign(),s=this.direction(),f=0,h=this.align(),x=this.getWidth(),w=this.letterSpacing(),v=this.fill(),O=this.textDecoration(),g=O.indexOf("underline")!==-1,b=O.indexOf("line-through")!==-1,p;s=s===O9?e.direction:s;let y=a/2,d=q5;if(K1.Konva._fixTextRendering){const N=this.measureSize("M");d="alphabetic",y=(N.fontBoundingBoxAscent-N.fontBoundingBoxDescent)/2+a/2}var m=0,_=0;for(s===W5&&e.setAttr("direction",s),e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",d),e.setAttr("textAlign",x9),l===q5?f=(this.getHeight()-r*a-i*2)/2:l===dA&&(f=this.getHeight()-r*a-i*2),e.translate(i,f+i),p=0;p<r;p++){var m=0,_=0,A=n[p],C=A.text,R=A.width,S=A.lastInParagraph,E,P,T;if(e.save(),h===pA?m+=x-R-i*2:h===aA&&(m+=(x-R-i*2)/2),g){e.save(),e.beginPath();const G=K1.Konva._fixTextRendering?Math.round(o/4):Math.round(o/2),Z=m,W=y+_+G;e.moveTo(Z,W),E=C.split(" ").length-1,P=E===0,T=h===Fu&&!S?x-i*2:R,e.lineTo(Z+Math.round(T),W),e.lineWidth=o/15;const H=this._getLinearGradient();e.strokeStyle=H||v,e.stroke(),e.restore()}if(b){e.save(),e.beginPath();const G=K1.Konva._fixTextRendering?-Math.round(o/4):0;e.moveTo(m,y+_+G),E=C.split(" ").length-1,P=E===0,T=h===Fu&&S&&!P?x-i*2:R,e.lineTo(m+Math.round(T),y+_+G),e.lineWidth=o/15;const Z=this._getLinearGradient();e.strokeStyle=Z||v,e.stroke(),e.restore()}if(s!==W5&&(w!==0||h===Fu)){E=C.split(" ").length-1;const G=E9(C);for(let Z=0;Z<G.length;Z++){const W=G[Z];W===" "&&!S&&h===Fu&&(m+=(x-i*2-R)/E),this._partialTextX=m,this._partialTextY=y+_,this._partialText=W,e.fillStrokeShape(this),m+=this.measureSize(W).width+w}}else w!==0&&e.setAttr("letterSpacing",`${w}px`),this._partialTextX=m,this._partialTextY=y+_,this._partialText=C,e.fillStrokeShape(this);e.restore(),r>1&&(y+=a)}}_hitFunc(e){const n=this.getWidth(),r=this.getHeight();e.beginPath(),e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)}setText(e){const n=hm.Util._isString(e)?e:e==null?"":e+"";return this._setAttr(uA,n),this}getWidth(){return this.attrs.width===es||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===es||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return hm.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var n,r,i,o,a,l,s,f,h,x,w;let v=Z1(),O=this.fontSize(),g;v.save(),v.font=this._getContextFont(),g=v.measureText(e),v.restore();const b=O/100;return{actualBoundingBoxAscent:(n=g.actualBoundingBoxAscent)!==null&&n!==void 0?n:71.58203125*b,actualBoundingBoxDescent:(r=g.actualBoundingBoxDescent)!==null&&r!==void 0?r:0,actualBoundingBoxLeft:(i=g.actualBoundingBoxLeft)!==null&&i!==void 0?i:-7.421875*b,actualBoundingBoxRight:(o=g.actualBoundingBoxRight)!==null&&o!==void 0?o:75.732421875*b,alphabeticBaseline:(a=g.alphabeticBaseline)!==null&&a!==void 0?a:0,emHeightAscent:(l=g.emHeightAscent)!==null&&l!==void 0?l:100*b,emHeightDescent:(s=g.emHeightDescent)!==null&&s!==void 0?s:-20*b,fontBoundingBoxAscent:(f=g.fontBoundingBoxAscent)!==null&&f!==void 0?f:91*b,fontBoundingBoxDescent:(h=g.fontBoundingBoxDescent)!==null&&h!==void 0?h:21*b,hangingBaseline:(x=g.hangingBaseline)!==null&&x!==void 0?x:72.80000305175781*b,ideographicBaseline:(w=g.ideographicBaseline)!==null&&w!==void 0?w:-21*b,width:g.width,height:O}}_getContextFont(){return this.fontStyle()+yd+this.fontVariant()+yd+(this.fontSize()+hA)+yA(this.fontFamily())}_addTextLine(e){this.align()===Fu&&(e=e.trim());const r=this._getTextWidth(e);return this.textArr.push({text:e,width:r,lastInParagraph:!1})}_getTextWidth(e){const n=this.letterSpacing(),r=e.length;return Z1().measureText(e).width+(r?n*(r-1):0)}_setTextData(){let e=this.text().split(`
|
|
42
|
+
*/var Is=Qe;function ik(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ok=typeof Object.is=="function"?Object.is:ik,ak=Is.useState,lk=Is.useEffect,sk=Is.useLayoutEffect,uk=Is.useDebugValue;function ck(t,e){var n=e(),r=ak({inst:{value:n,getSnapshot:e}}),i=r[0].inst,o=r[1];return sk(function(){i.value=n,i.getSnapshot=e,B1(i)&&o({inst:i})},[t,n,e]),lk(function(){return B1(i)&&o({inst:i}),t(function(){B1(i)&&o({inst:i})})},[t]),uk(n),n}function B1(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!ok(t,n)}catch{return!0}}function fk(t,e){return e()}var dk=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?fk:ck;Q8.useSyncExternalStore=Is.useSyncExternalStore!==void 0?Is.useSyncExternalStore:dk;Z8.exports=Q8;var hk=Z8.exports;function k5(t){t.reaction=new Oi("observer".concat(t.name),function(){var e;t.stateVersion=Symbol(),(e=t.onStoreChange)===null||e===void 0||e.call(t)})}function Ly(t,e){if(e===void 0&&(e="observed"),My())return t();var n=dt.useRef(null);if(!n.current){var r={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:e,subscribe:function(l){return yh.unregister(r),r.onStoreChange=l,r.reaction||(k5(r),r.stateVersion=Symbol()),function(){var s;r.onStoreChange=null,(s=r.reaction)===null||s===void 0||s.dispose(),r.reaction=null}},getSnapshot:function(){return r.stateVersion}};n.current=r}var i=n.current;i.reaction||(k5(i),yh.register(n,i,i)),dt.useDebugValue(i.reaction,JC),hk.useSyncExternalStore(i.subscribe,i.getSnapshot,i.getSnapshot);var o,a;if(i.reaction.track(function(){try{o=t()}catch(l){a=l}}),a)throw a;return o}var U1,H1,J8=typeof Symbol=="function"&&Symbol.for,pk=(H1=(U1=Object.getOwnPropertyDescriptor(function(){},"name"))===null||U1===void 0?void 0:U1.configurable)!==null&&H1!==void 0?H1:!1,T5=J8?Symbol.for("react.forward_ref"):typeof Qe.forwardRef=="function"&&Qe.forwardRef(function(t){return null}).$$typeof,A5=J8?Symbol.for("react.memo"):typeof Qe.memo=="function"&&Qe.memo(function(t){return null}).$$typeof;function gk(t,e){var n;if(A5&&t.$$typeof===A5)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(My())return t;var r=(n=e==null?void 0:e.forwardRef)!==null&&n!==void 0?n:!1,i=t,o=t.displayName||t.name;if(T5&&t.$$typeof===T5&&(r=!0,i=t.render,typeof i!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var a=function(l,s){return Ly(function(){return i(l,s)},o)};return a.displayName=t.displayName,pk&&Object.defineProperty(a,"name",{value:t.name,writable:!0,configurable:!0}),t.contextTypes&&(a.contextTypes=t.contextTypes),r&&(a=Qe.forwardRef(a)),a=Qe.memo(a),mk(t,a),a}var vk={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function mk(t,e){Object.keys(t).forEach(function(n){vk[n]||Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}function e9(t){var e=t.children,n=t.render,r=e||n;return typeof r!="function"?null:Ly(r)}e9.displayName="Observer";function yk(t,e){return Qe.useState(function(){return Rt(t(),e,{autoBind:!0})})[0]}function t9(t){var e=Qe.useState(function(){return Rt(t,{},{deep:!1})})[0];return Ls(function(){Object.assign(e,t)}),e}function bk(t,e){var n=e&&t9(e);return Qe.useState(function(){return Rt(t(n),void 0,{autoBind:!0})})[0]}var $1;Y8(Vw.unstable_batchedUpdates);var _k=($1=yh.finalizeAllImmediately)!==null&&$1!==void 0?$1:function(){};function wk(t,e){return e===void 0&&(e="observed"),Ly(t,e)}function Sk(t){X8(t)}const Ek=Object.freeze(Object.defineProperty({__proto__:null,Observer:e9,_observerFinalizationRegistry:yh,clearTimers:_k,enableStaticRendering:X8,isObserverBatched:QC,isUsingStaticRendering:My,observer:gk,observerBatching:Y8,useAsObservableSource:t9,useLocalObservable:yk,useLocalStore:bk,useObserver:wk,useStaticRendering:Sk},Symbol.toStringTag,{value:"Module"})),ti=_a(Ek);var n9={};const Qi=_a(XC);var Ny={exports:{}},tp={},bh={},st={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t._registerNode=t.Konva=t.glob=void 0;const e=Math.PI/180;function n(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}t.glob=typeof _e<"u"?_e:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},t.Konva={_global:t.glob,version:"9.3.16",isBrowser:n(),isUnminified:/param/.test((function(i){}).toString()),dblClickWindow:400,getAngle(i){return t.Konva.angleDeg?i*e:i},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 t.Konva.DD.isDragging},isTransforming(){var i;return(i=t.Konva.Transformer)===null||i===void 0?void 0:i.isTransforming()},isDragReady(){return!!t.Konva.DD.node},releaseCanvasOnDestroy:!0,document:t.glob.document,_injectGlobal(i){t.glob.Konva=i}};const r=i=>{t.Konva[i.prototype.getClassName()]=i};t._registerNode=r,t.Konva._injectGlobal(t.Konva)})(st);var en={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Util=t.Transform=void 0;const e=st;class n{constructor(m=[1,0,0,1,0,0]){this.dirty=!1,this.m=m&&m.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 n(this.m)}copyInto(m){m.m[0]=this.m[0],m.m[1]=this.m[1],m.m[2]=this.m[2],m.m[3]=this.m[3],m.m[4]=this.m[4],m.m[5]=this.m[5]}point(m){const _=this.m;return{x:_[0]*m.x+_[2]*m.y+_[4],y:_[1]*m.x+_[3]*m.y+_[5]}}translate(m,_){return this.m[4]+=this.m[0]*m+this.m[2]*_,this.m[5]+=this.m[1]*m+this.m[3]*_,this}scale(m,_){return this.m[0]*=m,this.m[1]*=m,this.m[2]*=_,this.m[3]*=_,this}rotate(m){const _=Math.cos(m),A=Math.sin(m),C=this.m[0]*_+this.m[2]*A,R=this.m[1]*_+this.m[3]*A,S=this.m[0]*-A+this.m[2]*_,E=this.m[1]*-A+this.m[3]*_;return this.m[0]=C,this.m[1]=R,this.m[2]=S,this.m[3]=E,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(m,_){const A=this.m[0]+this.m[2]*_,C=this.m[1]+this.m[3]*_,R=this.m[2]+this.m[0]*m,S=this.m[3]+this.m[1]*m;return this.m[0]=A,this.m[1]=C,this.m[2]=R,this.m[3]=S,this}multiply(m){const _=this.m[0]*m.m[0]+this.m[2]*m.m[1],A=this.m[1]*m.m[0]+this.m[3]*m.m[1],C=this.m[0]*m.m[2]+this.m[2]*m.m[3],R=this.m[1]*m.m[2]+this.m[3]*m.m[3],S=this.m[0]*m.m[4]+this.m[2]*m.m[5]+this.m[4],E=this.m[1]*m.m[4]+this.m[3]*m.m[5]+this.m[5];return this.m[0]=_,this.m[1]=A,this.m[2]=C,this.m[3]=R,this.m[4]=S,this.m[5]=E,this}invert(){const m=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),_=this.m[3]*m,A=-this.m[1]*m,C=-this.m[2]*m,R=this.m[0]*m,S=m*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),E=m*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=_,this.m[1]=A,this.m[2]=C,this.m[3]=R,this.m[4]=S,this.m[5]=E,this}getMatrix(){return this.m}decompose(){const m=this.m[0],_=this.m[1],A=this.m[2],C=this.m[3],R=this.m[4],S=this.m[5],E=m*C-_*A,P={x:R,y:S,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(m!=0||_!=0){const T=Math.sqrt(m*m+_*_);P.rotation=_>0?Math.acos(m/T):-Math.acos(m/T),P.scaleX=T,P.scaleY=E/T,P.skewX=(m*A+_*C)/E,P.skewY=0}else if(A!=0||C!=0){const T=Math.sqrt(A*A+C*C);P.rotation=Math.PI/2-(C>0?Math.acos(-A/T):-Math.acos(A/T)),P.scaleX=E/T,P.scaleY=T,P.skewX=0,P.skewY=(m*A+_*C)/E}return P.rotation=t.Util._getRotation(P.rotation),P}}t.Transform=n;let r="[object Array]",i="[object Number]",o="[object String]",a="[object Boolean]",l=Math.PI/180,s=180/Math.PI,f="#",h="",x="0",w="Konva warning: ",v="Konva error: ",O="rgb(",g={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]},b=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,p=[];const y=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(d){setTimeout(d,60)};t.Util={_isElement(d){return!!(d&&d.nodeType==1)},_isFunction(d){return!!(d&&d.constructor&&d.call&&d.apply)},_isPlainObject(d){return!!d&&d.constructor===Object},_isArray(d){return Object.prototype.toString.call(d)===r},_isNumber(d){return Object.prototype.toString.call(d)===i&&!isNaN(d)&&isFinite(d)},_isString(d){return Object.prototype.toString.call(d)===o},_isBoolean(d){return Object.prototype.toString.call(d)===a},isObject(d){return d instanceof Object},isValidSelector(d){if(typeof d!="string")return!1;const m=d[0];return m==="#"||m==="."||m===m.toUpperCase()},_sign(d){return d===0||d>0?1:-1},requestAnimFrame(d){p.push(d),p.length===1&&y(function(){const m=p;p=[],m.forEach(function(_){_()})})},createCanvasElement(){const d=document.createElement("canvas");try{d.style=d.style||{}}catch{}return d},createImageElement(){return document.createElement("img")},_isInDocument(d){for(;d=d.parentNode;)if(d==document)return!0;return!1},_urlToImage(d,m){const _=t.Util.createImageElement();_.onload=function(){m(_)},_.src=d},_rgbToHex(d,m,_){return((1<<24)+(d<<16)+(m<<8)+_).toString(16).slice(1)},_hexToRgb(d){d=d.replace(f,h);const m=parseInt(d,16);return{r:m>>16&255,g:m>>8&255,b:m&255}},getRandomColor(){let d=(Math.random()*16777215<<0).toString(16);for(;d.length<6;)d=x+d;return f+d},getRGB(d){let m;return d in g?(m=g[d],{r:m[0],g:m[1],b:m[2]}):d[0]===f?this._hexToRgb(d.substring(1)):d.substr(0,4)===O?(m=b.exec(d.replace(/ /g,"")),{r:parseInt(m[1],10),g:parseInt(m[2],10),b:parseInt(m[3],10)}):{r:0,g:0,b:0}},colorToRGBA(d){return d=d||"black",t.Util._namedColorToRBA(d)||t.Util._hex3ColorToRGBA(d)||t.Util._hex4ColorToRGBA(d)||t.Util._hex6ColorToRGBA(d)||t.Util._hex8ColorToRGBA(d)||t.Util._rgbColorToRGBA(d)||t.Util._rgbaColorToRGBA(d)||t.Util._hslColorToRGBA(d)},_namedColorToRBA(d){const m=g[d.toLowerCase()];return m?{r:m[0],g:m[1],b:m[2],a:1}:null},_rgbColorToRGBA(d){if(d.indexOf("rgb(")===0){d=d.match(/rgb\(([^)]+)\)/)[1];const m=d.split(/ *, */).map(Number);return{r:m[0],g:m[1],b:m[2],a:1}}},_rgbaColorToRGBA(d){if(d.indexOf("rgba(")===0){d=d.match(/rgba\(([^)]+)\)/)[1];const m=d.split(/ *, */).map((_,A)=>_.slice(-1)==="%"?A===3?parseInt(_)/100:parseInt(_)/100*255:Number(_));return{r:m[0],g:m[1],b:m[2],a:m[3]}}},_hex8ColorToRGBA(d){if(d[0]==="#"&&d.length===9)return{r:parseInt(d.slice(1,3),16),g:parseInt(d.slice(3,5),16),b:parseInt(d.slice(5,7),16),a:parseInt(d.slice(7,9),16)/255}},_hex6ColorToRGBA(d){if(d[0]==="#"&&d.length===7)return{r:parseInt(d.slice(1,3),16),g:parseInt(d.slice(3,5),16),b:parseInt(d.slice(5,7),16),a:1}},_hex4ColorToRGBA(d){if(d[0]==="#"&&d.length===5)return{r:parseInt(d[1]+d[1],16),g:parseInt(d[2]+d[2],16),b:parseInt(d[3]+d[3],16),a:parseInt(d[4]+d[4],16)/255}},_hex3ColorToRGBA(d){if(d[0]==="#"&&d.length===4)return{r:parseInt(d[1]+d[1],16),g:parseInt(d[2]+d[2],16),b:parseInt(d[3]+d[3],16),a:1}},_hslColorToRGBA(d){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(d)){const[m,..._]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(d),A=Number(_[0])/360,C=Number(_[1])/100,R=Number(_[2])/100;let S,E,P;if(C===0)return P=R*255,{r:Math.round(P),g:Math.round(P),b:Math.round(P),a:1};R<.5?S=R*(1+C):S=R+C-R*C;const T=2*R-S,N=[0,0,0];for(let U=0;U<3;U++)E=A+1/3*-(U-1),E<0&&E++,E>1&&E--,6*E<1?P=T+(S-T)*6*E:2*E<1?P=S:3*E<2?P=T+(S-T)*(2/3-E)*6:P=T,N[U]=P*255;return{r:Math.round(N[0]),g:Math.round(N[1]),b:Math.round(N[2]),a:1}}},haveIntersection(d,m){return!(m.x>d.x+d.width||m.x+m.width<d.x||m.y>d.y+d.height||m.y+m.height<d.y)},cloneObject(d){const m={};for(const _ in d)this._isPlainObject(d[_])?m[_]=this.cloneObject(d[_]):this._isArray(d[_])?m[_]=this.cloneArray(d[_]):m[_]=d[_];return m},cloneArray(d){return d.slice(0)},degToRad(d){return d*l},radToDeg(d){return d*s},_degToRad(d){return t.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),t.Util.degToRad(d)},_radToDeg(d){return t.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),t.Util.radToDeg(d)},_getRotation(d){return e.Konva.angleDeg?t.Util.radToDeg(d):d},_capitalize(d){return d.charAt(0).toUpperCase()+d.slice(1)},throw(d){throw new Error(v+d)},error(d){console.error(v+d)},warn(d){e.Konva.showWarnings&&console.warn(w+d)},each(d,m){for(const _ in d)m(_,d[_])},_inRange(d,m,_){return m<=d&&d<_},_getProjectionToSegment(d,m,_,A,C,R){let S,E,P;const T=(d-_)*(d-_)+(m-A)*(m-A);if(T==0)S=d,E=m,P=(C-_)*(C-_)+(R-A)*(R-A);else{const N=((C-d)*(_-d)+(R-m)*(A-m))/T;N<0?(S=d,E=m,P=(d-C)*(d-C)+(m-R)*(m-R)):N>1?(S=_,E=A,P=(_-C)*(_-C)+(A-R)*(A-R)):(S=d+N*(_-d),E=m+N*(A-m),P=(S-C)*(S-C)+(E-R)*(E-R))}return[S,E,P]},_getProjectionToLine(d,m,_){const A=t.Util.cloneObject(d);let C=Number.MAX_VALUE;return m.forEach(function(R,S){if(!_&&S===m.length-1)return;const E=m[(S+1)%m.length],P=t.Util._getProjectionToSegment(R.x,R.y,E.x,E.y,d.x,d.y),T=P[0],N=P[1],U=P[2];U<C&&(A.x=T,A.y=N,C=U)}),A},_prepareArrayForTween(d,m,_){let A,C=[],R=[];if(d.length>m.length){const E=m;m=d,d=E}for(A=0;A<d.length;A+=2)C.push({x:d[A],y:d[A+1]});for(A=0;A<m.length;A+=2)R.push({x:m[A],y:m[A+1]});const S=[];return R.forEach(function(E){const P=t.Util._getProjectionToLine(E,C,_);S.push(P.x),S.push(P.y)}),S},_prepareToStringify(d){let m;d.visitedByCircularReferenceRemoval=!0;for(const _ in d)if(d.hasOwnProperty(_)&&d[_]&&typeof d[_]=="object"){if(m=Object.getOwnPropertyDescriptor(d,_),d[_].visitedByCircularReferenceRemoval||t.Util._isElement(d[_]))if(m.configurable)delete d[_];else return null;else if(t.Util._prepareToStringify(d[_])===null)if(m.configurable)delete d[_];else return null}return delete d.visitedByCircularReferenceRemoval,d},_assign(d,m){for(const _ in m)d[_]=m[_];return d},_getFirstPointerId(d){return d.touches?d.changedTouches[0].identifier:d.pointerId||999},releaseCanvas(...d){e.Konva.releaseCanvasOnDestroy&&d.forEach(m=>{m.width=0,m.height=0})},drawRoundedRectPath(d,m,_,A){let C=0,R=0,S=0,E=0;typeof A=="number"?C=R=S=E=Math.min(A,m/2,_/2):(C=Math.min(A[0]||0,m/2,_/2),R=Math.min(A[1]||0,m/2,_/2),E=Math.min(A[2]||0,m/2,_/2),S=Math.min(A[3]||0,m/2,_/2)),d.moveTo(C,0),d.lineTo(m-R,0),d.arc(m-R,R,R,Math.PI*3/2,0,!1),d.lineTo(m,_-E),d.arc(m-E,_-E,E,0,Math.PI/2,!1),d.lineTo(S,_),d.arc(S,_-S,S,Math.PI/2,Math.PI,!1),d.lineTo(0,C),d.arc(C,C,C,Math.PI,Math.PI*3/2,!1)}}})(en);var qt={},ut={},Ze={};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.RGBComponent=Ok;Ze.alphaComponent=xk;Ze.getNumberValidator=Pk;Ze.getNumberOrArrayOfNumbersValidator=Ck;Ze.getNumberOrAutoValidator=kk;Ze.getStringValidator=Tk;Ze.getStringOrGradientValidator=Ak;Ze.getFunctionValidator=Rk;Ze.getNumberArrayValidator=Mk;Ze.getBooleanValidator=Lk;Ze.getComponentValidator=Nk;const Ro=st,rn=en;function Mo(t){return rn.Util._isString(t)?'"'+t+'"':Object.prototype.toString.call(t)==="[object Number]"||rn.Util._isBoolean(t)?t:Object.prototype.toString.call(t)}function Ok(t){return t>255?255:t<0?0:Math.round(t)}function xk(t){return t>1?1:t<1e-4?1e-4:t}function Pk(){if(Ro.Konva.isUnminified)return function(t,e){return rn.Util._isNumber(t)||rn.Util.warn(Mo(t)+' is a not valid value for "'+e+'" attribute. The value should be a number.'),t}}function Ck(t){if(Ro.Konva.isUnminified)return function(e,n){const r=rn.Util._isNumber(e),i=rn.Util._isArray(e)&&e.length==t;return!r&&!i&&rn.Util.warn(Mo(e)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+t+")"),e}}function kk(){if(Ro.Konva.isUnminified)return function(t,e){return rn.Util._isNumber(t)||t==="auto"||rn.Util.warn(Mo(t)+' is a not valid value for "'+e+'" attribute. The value should be a number or "auto".'),t}}function Tk(){if(Ro.Konva.isUnminified)return function(t,e){return rn.Util._isString(t)||rn.Util.warn(Mo(t)+' is a not valid value for "'+e+'" attribute. The value should be a string.'),t}}function Ak(){if(Ro.Konva.isUnminified)return function(t,e){const n=rn.Util._isString(t),r=Object.prototype.toString.call(t)==="[object CanvasGradient]"||t&&t.addColorStop;return n||r||rn.Util.warn(Mo(t)+' is a not valid value for "'+e+'" attribute. The value should be a string or a native gradient.'),t}}function Rk(){if(Ro.Konva.isUnminified)return function(t,e){return rn.Util._isFunction(t)||rn.Util.warn(Mo(t)+' is a not valid value for "'+e+'" attribute. The value should be a function.'),t}}function Mk(){if(Ro.Konva.isUnminified)return function(t,e){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&t instanceof n||(rn.Util._isArray(t)?t.forEach(function(r){rn.Util._isNumber(r)||rn.Util.warn('"'+e+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):rn.Util.warn(Mo(t)+' is a not valid value for "'+e+'" attribute. The value should be a array of numbers.')),t}}function Lk(){if(Ro.Konva.isUnminified)return function(t,e){return t===!0||t===!1||rn.Util.warn(Mo(t)+' is a not valid value for "'+e+'" attribute. The value should be a boolean.'),t}}function Nk(t){if(Ro.Konva.isUnminified)return function(e,n){return e==null||rn.Util.isObject(e)||rn.Util.warn(Mo(e)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+t),e}}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Factory=void 0;const e=en,n=Ze,r="get",i="set";t.Factory={addGetterSetter(o,a,l,s,f){t.Factory.addGetter(o,a,l),t.Factory.addSetter(o,a,s,f),t.Factory.addOverloadedGetterSetter(o,a)},addGetter(o,a,l){const s=r+e.Util._capitalize(a);o.prototype[s]=o.prototype[s]||function(){const f=this.attrs[a];return f===void 0?l:f}},addSetter(o,a,l,s){const f=i+e.Util._capitalize(a);o.prototype[f]||t.Factory.overWriteSetter(o,a,l,s)},overWriteSetter(o,a,l,s){const f=i+e.Util._capitalize(a);o.prototype[f]=function(h){return l&&h!==void 0&&h!==null&&(h=l.call(this,h,a)),this._setAttr(a,h),s&&s.call(this),this}},addComponentsGetterSetter(o,a,l,s,f){let h=l.length,x=e.Util._capitalize,w=r+x(a),v=i+x(a),O,g;o.prototype[w]=function(){const p={};for(O=0;O<h;O++)g=l[O],p[g]=this.getAttr(a+x(g));return p};const b=(0,n.getComponentValidator)(l);o.prototype[v]=function(p){let y=this.attrs[a],d;s&&(p=s.call(this,p)),b&&b.call(this,p,a);for(d in p)p.hasOwnProperty(d)&&this._setAttr(a+x(d),p[d]);return p||l.forEach(m=>{this._setAttr(a+x(m),void 0)}),this._fireChangeEvent(a,y,p),f&&f.call(this),this},t.Factory.addOverloadedGetterSetter(o,a)},addOverloadedGetterSetter(o,a){const l=e.Util._capitalize(a),s=i+l,f=r+l;o.prototype[a]=function(){return arguments.length?(this[s](arguments[0]),this):this[f]()}},addDeprecatedGetterSetter(o,a,l,s){e.Util.error("Adding deprecated "+a);const f=r+e.Util._capitalize(a),h=a+" property is deprecated and will be removed soon. Look at Konva change log for more information.";o.prototype[f]=function(){e.Util.error(h);const x=this.attrs[a];return x===void 0?l:x},t.Factory.addSetter(o,a,s,function(){e.Util.error(h)}),t.Factory.addOverloadedGetterSetter(o,a)},backCompat(o,a){e.Util.each(a,function(l,s){const f=o.prototype[s],h=r+e.Util._capitalize(l),x=i+e.Util._capitalize(l);function w(){f.apply(this,arguments),e.Util.error('"'+l+'" method is deprecated and will be removed soon. Use ""'+s+'" instead.')}o.prototype[l]=w,o.prototype[h]=w,o.prototype[x]=w})},afterSetFilter(){this._filterUpToDate=!1}}})(ut);var wi={},So={};Object.defineProperty(So,"__esModule",{value:!0});So.HitContext=So.SceneContext=So.Context=void 0;const r9=en,Ik=st;function Dk(t){let e=[],n=t.length,r=r9.Util,i,o;for(i=0;i<n;i++)o=t[i],r._isNumber(o)?o=Math.round(o*1e3)/1e3:r._isString(o)||(o=o+""),e.push(o);return e}const R5=",",jk="(",Fk=")",zk="([",Bk="])",Uk=";",Hk="()",$k="=",M5=["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"],Gk=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"],Vk=100;class np{constructor(e){this.canvas=e,Ik.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(e){e.fillEnabled()&&this._fill(e)}_fill(e){}strokeShape(e){e.hasStroke()&&this._stroke(e)}_stroke(e){}fillStrokeShape(e){e.attrs.fillAfterStrokeEnabled?(this.strokeShape(e),this.fillShape(e)):(this.fillShape(e),this.strokeShape(e))}getTrace(e,n){let r=this.traceArr,i=r.length,o="",a,l,s,f;for(a=0;a<i;a++)l=r[a],s=l.method,s?(f=l.args,o+=s,e?o+=Hk:r9.Util._isArray(f[0])?o+=zk+f.join(R5)+Bk:(n&&(f=f.map(h=>typeof h=="number"?Math.floor(h):h)),o+=jk+f.join(R5)+Fk)):(o+=l.property,e||(o+=$k+l.val)),o+=Uk;return o}clearTrace(){this.traceArr=[]}_trace(e){let n=this.traceArr,r;n.push(e),r=n.length,r>=Vk&&n.shift()}reset(){const e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){const n=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(e){const n=e.attrs.lineCap;n&&this.setAttr("lineCap",n)}_applyOpacity(e){const n=e.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(e){const n=e.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(e,n){this._context[e]=n}arc(e,n,r,i,o,a){this._context.arc(e,n,r,i,o,a)}arcTo(e,n,r,i,o){this._context.arcTo(e,n,r,i,o)}beginPath(){this._context.beginPath()}bezierCurveTo(e,n,r,i,o,a){this._context.bezierCurveTo(e,n,r,i,o,a)}clearRect(e,n,r,i){this._context.clearRect(e,n,r,i)}clip(...e){this._context.clip.apply(this._context,e)}closePath(){this._context.closePath()}createImageData(e,n){const r=arguments;if(r.length===2)return this._context.createImageData(e,n);if(r.length===1)return this._context.createImageData(e)}createLinearGradient(e,n,r,i){return this._context.createLinearGradient(e,n,r,i)}createPattern(e,n){return this._context.createPattern(e,n)}createRadialGradient(e,n,r,i,o,a){return this._context.createRadialGradient(e,n,r,i,o,a)}drawImage(e,n,r,i,o,a,l,s,f){const h=arguments,x=this._context;h.length===3?x.drawImage(e,n,r):h.length===5?x.drawImage(e,n,r,i,o):h.length===9&&x.drawImage(e,n,r,i,o,a,l,s,f)}ellipse(e,n,r,i,o,a,l,s){this._context.ellipse(e,n,r,i,o,a,l,s)}isPointInPath(e,n,r,i){return r?this._context.isPointInPath(r,e,n,i):this._context.isPointInPath(e,n,i)}fill(...e){this._context.fill.apply(this._context,e)}fillRect(e,n,r,i){this._context.fillRect(e,n,r,i)}strokeRect(e,n,r,i){this._context.strokeRect(e,n,r,i)}fillText(e,n,r,i){i?this._context.fillText(e,n,r,i):this._context.fillText(e,n,r)}measureText(e){return this._context.measureText(e)}getImageData(e,n,r,i){return this._context.getImageData(e,n,r,i)}lineTo(e,n){this._context.lineTo(e,n)}moveTo(e,n){this._context.moveTo(e,n)}rect(e,n,r,i){this._context.rect(e,n,r,i)}roundRect(e,n,r,i,o){this._context.roundRect(e,n,r,i,o)}putImageData(e,n,r){this._context.putImageData(e,n,r)}quadraticCurveTo(e,n,r,i){this._context.quadraticCurveTo(e,n,r,i)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,n){this._context.scale(e,n)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,n,r,i,o,a){this._context.setTransform(e,n,r,i,o,a)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,n,r,i){this._context.strokeText(e,n,r,i)}transform(e,n,r,i,o,a){this._context.transform(e,n,r,i,o,a)}translate(e,n){this._context.translate(e,n)}_enableTrace(){let e=this,n=M5.length,r=this.setAttr,i,o;const a=function(l){let s=e[l],f;e[l]=function(){return o=Dk(Array.prototype.slice.call(arguments,0)),f=s.apply(e,arguments),e._trace({method:l,args:o}),f}};for(i=0;i<n;i++)a(M5[i]);e.setAttr=function(){r.apply(e,arguments);const l=arguments[0];let s=arguments[1];(l==="shadowOffsetX"||l==="shadowOffsetY"||l==="shadowBlur")&&(s=s/this.canvas.getPixelRatio()),e._trace({property:l,val:s})}}_applyGlobalCompositeOperation(e){const n=e.attrs.globalCompositeOperation;!n||n==="source-over"||this.setAttr("globalCompositeOperation",n)}}So.Context=np;Gk.forEach(function(t){Object.defineProperty(np.prototype,t,{get(){return this._context[t]},set(e){this._context[t]=e}})});class qk extends np{constructor(e,{willReadFrequently:n=!1}={}){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:n})}_fillColor(e){const n=e.fill();this.setAttr("fillStyle",n),e._fillFunc(this)}_fillPattern(e){this.setAttr("fillStyle",e._getFillPattern()),e._fillFunc(this)}_fillLinearGradient(e){const n=e._getLinearGradient();n&&(this.setAttr("fillStyle",n),e._fillFunc(this))}_fillRadialGradient(e){const n=e._getRadialGradient();n&&(this.setAttr("fillStyle",n),e._fillFunc(this))}_fill(e){const n=e.fill(),r=e.getFillPriority();if(n&&r==="color"){this._fillColor(e);return}const i=e.getFillPatternImage();if(i&&r==="pattern"){this._fillPattern(e);return}const o=e.getFillLinearGradientColorStops();if(o&&r==="linear-gradient"){this._fillLinearGradient(e);return}const a=e.getFillRadialGradientColorStops();if(a&&r==="radial-gradient"){this._fillRadialGradient(e);return}n?this._fillColor(e):i?this._fillPattern(e):o?this._fillLinearGradient(e):a&&this._fillRadialGradient(e)}_strokeLinearGradient(e){const n=e.getStrokeLinearGradientStartPoint(),r=e.getStrokeLinearGradientEndPoint(),i=e.getStrokeLinearGradientColorStops(),o=this.createLinearGradient(n.x,n.y,r.x,r.y);if(i){for(let a=0;a<i.length;a+=2)o.addColorStop(i[a],i[a+1]);this.setAttr("strokeStyle",o)}}_stroke(e){const n=e.dash(),r=e.getStrokeScaleEnabled();if(e.hasStroke()){if(!r){this.save();const o=this.getCanvas().getPixelRatio();this.setTransform(o,0,0,o,0,0)}this._applyLineCap(e),n&&e.dashEnabled()&&(this.setLineDash(n),this.setAttr("lineDashOffset",e.dashOffset())),this.setAttr("lineWidth",e.strokeWidth()),e.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),e.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(e):this.setAttr("strokeStyle",e.stroke()),e._strokeFunc(this),r||this.restore()}}_applyShadow(e){var n,r,i;const o=(n=e.getShadowRGBA())!==null&&n!==void 0?n:"black",a=(r=e.getShadowBlur())!==null&&r!==void 0?r:5,l=(i=e.getShadowOffset())!==null&&i!==void 0?i:{x:0,y:0},s=e.getAbsoluteScale(),f=this.canvas.getPixelRatio(),h=s.x*f,x=s.y*f;this.setAttr("shadowColor",o),this.setAttr("shadowBlur",a*Math.min(Math.abs(h),Math.abs(x))),this.setAttr("shadowOffsetX",l.x*h),this.setAttr("shadowOffsetY",l.y*x)}}So.SceneContext=qk;class Wk extends np{constructor(e){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:!0})}_fill(e){this.save(),this.setAttr("fillStyle",e.colorKey),e._fillFuncHit(this),this.restore()}strokeShape(e){e.hasHitStroke()&&this._stroke(e)}_stroke(e){if(e.hasHitStroke()){const n=e.getStrokeScaleEnabled();if(!n){this.save();const o=this.getCanvas().getPixelRatio();this.setTransform(o,0,0,o,0,0)}this._applyLineCap(e);const r=e.hitStrokeWidth(),i=r==="auto"?e.strokeWidth():r;this.setAttr("lineWidth",i),this.setAttr("strokeStyle",e.colorKey),e._strokeFuncHit(this),n||this.restore()}}}So.HitContext=Wk;Object.defineProperty(wi,"__esModule",{value:!0});wi.HitCanvas=wi.SceneCanvas=wi.Canvas=void 0;const _h=en,i9=So,o9=st,Yk=ut,Kk=Ze;let vd;function Xk(){if(vd)return vd;const t=_h.Util.createCanvasElement(),e=t.getContext("2d");return vd=function(){const n=o9.Konva._global.devicePixelRatio||1,r=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return n/r}(),_h.Util.releaseCanvas(t),vd}class rp{constructor(e){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const r=(e||{}).pixelRatio||o9.Konva.pixelRatio||Xk();this.pixelRatio=r,this._canvas=_h.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(e){const n=this.pixelRatio;this.pixelRatio=e,this.setSize(this.getWidth()/n,this.getHeight()/n)}setWidth(e){this.width=this._canvas.width=e*this.pixelRatio,this._canvas.style.width=e+"px";const n=this.pixelRatio;this.getContext()._context.scale(n,n)}setHeight(e){this.height=this._canvas.height=e*this.pixelRatio,this._canvas.style.height=e+"px";const n=this.pixelRatio;this.getContext()._context.scale(n,n)}getWidth(){return this.width}getHeight(){return this.height}setSize(e,n){this.setWidth(e||0),this.setHeight(n||0)}toDataURL(e,n){try{return this._canvas.toDataURL(e,n)}catch{try{return this._canvas.toDataURL()}catch(i){return _h.Util.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}wi.Canvas=rp;Yk.Factory.addGetterSetter(rp,"pixelRatio",void 0,(0,Kk.getNumberValidator)());class Zk extends rp{constructor(e={width:0,height:0,willReadFrequently:!1}){super(e),this.context=new i9.SceneContext(this,{willReadFrequently:e.willReadFrequently}),this.setSize(e.width,e.height)}}wi.SceneCanvas=Zk;class Qk extends rp{constructor(e={width:0,height:0}){super(e),this.hitCanvas=!0,this.context=new i9.HitContext(this),this.setSize(e.width,e.height)}}wi.HitCanvas=Qk;var ip={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DD=void 0;const e=st,n=en;t.DD={get isDragging(){let r=!1;return t.DD._dragElements.forEach(i=>{i.dragStatus==="dragging"&&(r=!0)}),r},justDragged:!1,get node(){let r;return t.DD._dragElements.forEach(i=>{r=i.node}),r},_dragElements:new Map,_drag(r){const i=[];t.DD._dragElements.forEach((o,a)=>{const{node:l}=o,s=l.getStage();s.setPointersPositions(r),o.pointerId===void 0&&(o.pointerId=n.Util._getFirstPointerId(r));const f=s._changedPointerPositions.find(h=>h.id===o.pointerId);if(f){if(o.dragStatus!=="dragging"){const h=l.dragDistance();if(Math.max(Math.abs(f.x-o.startPointerPos.x),Math.abs(f.y-o.startPointerPos.y))<h||(l.startDrag({evt:r}),!l.isDragging()))return}l._setDragPosition(r,o),i.push(l)}}),i.forEach(o=>{o.fire("dragmove",{type:"dragmove",target:o,evt:r},!0)})},_endDragBefore(r){const i=[];t.DD._dragElements.forEach(o=>{const{node:a}=o,l=a.getStage();if(r&&l.setPointersPositions(r),!l._changedPointerPositions.find(h=>h.id===o.pointerId))return;(o.dragStatus==="dragging"||o.dragStatus==="stopped")&&(t.DD.justDragged=!0,e.Konva._mouseListenClick=!1,e.Konva._touchListenClick=!1,e.Konva._pointerListenClick=!1,o.dragStatus="stopped");const f=o.node.getLayer()||o.node instanceof e.Konva.Stage&&o.node;f&&i.indexOf(f)===-1&&i.push(f)}),i.forEach(o=>{o.draw()})},_endDragAfter(r){t.DD._dragElements.forEach((i,o)=>{i.dragStatus==="stopped"&&i.node.fire("dragend",{type:"dragend",target:i.node,evt:r},!0),i.dragStatus!=="dragging"&&t.DD._dragElements.delete(o)})}},e.Konva.isBrowser&&(window.addEventListener("mouseup",t.DD._endDragBefore,!0),window.addEventListener("touchend",t.DD._endDragBefore,!0),window.addEventListener("touchcancel",t.DD._endDragBefore,!0),window.addEventListener("mousemove",t.DD._drag),window.addEventListener("touchmove",t.DD._drag),window.addEventListener("mouseup",t.DD._endDragAfter,!1),window.addEventListener("touchend",t.DD._endDragAfter,!1),window.addEventListener("touchcancel",t.DD._endDragAfter,!1))})(ip);Object.defineProperty(qt,"__esModule",{value:!0});qt.Node=void 0;const pt=en,qc=ut,ju=wi,Ko=st,Vr=ip,sn=Ze,jd="absoluteOpacity",md="allEventListeners",ho="absoluteTransform",L5="absoluteScale",Wa="canvas",Jk="Change",eT="children",tT="konva",om="listening",N5="mouseenter",I5="mouseleave",D5="set",j5="Shape",Fd=" ",F5="stage",Xo="transform",nT="Stage",am="visible",rT=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(Fd);let iT=1,ot=class lm{constructor(e){this._id=iT++,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(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){(e===Xo||e===ho)&&this._cache.get(e)?this._cache.get(e).dirty=!0:e?this._cache.delete(e):this._cache.clear()}_getCache(e,n){let r=this._cache.get(e);return(r===void 0||(e===Xo||e===ho)&&r.dirty===!0)&&(r=n.call(this),this._cache.set(e,r)),r}_calculate(e,n,r){if(!this._attachedDepsListeners.get(e)){const i=n.map(o=>o+"Change.konva").join(Fd);this.on(i,()=>{this._clearCache(e)}),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,r)}_getCanvasCache(){return this._cache.get(Wa)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===ho&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(Wa)){const{scene:e,filter:n,hit:r}=this._cache.get(Wa);pt.Util.releaseCanvas(e,n,r),this._cache.delete(Wa)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){const n=e||{};let r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let i=Math.ceil(n.width||r.width),o=Math.ceil(n.height||r.height),a=n.pixelRatio,l=n.x===void 0?Math.floor(r.x):n.x,s=n.y===void 0?Math.floor(r.y):n.y,f=n.offset||0,h=n.drawBorder||!1,x=n.hitCanvasPixelRatio||1;if(!i||!o){pt.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const w=Math.abs(Math.round(r.x)-l)>.5?1:0,v=Math.abs(Math.round(r.y)-s)>.5?1:0;i+=f*2+w,o+=f*2+v,l-=f,s-=f;const O=new ju.SceneCanvas({pixelRatio:a,width:i,height:o}),g=new ju.SceneCanvas({pixelRatio:a,width:0,height:0,willReadFrequently:!0}),b=new ju.HitCanvas({pixelRatio:x,width:i,height:o}),p=O.getContext(),y=b.getContext();return b.isCache=!0,O.isCache=!0,this._cache.delete(Wa),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(O.getContext()._context.imageSmoothingEnabled=!1,g.getContext()._context.imageSmoothingEnabled=!1),p.save(),y.save(),p.translate(-l,-s),y.translate(-l,-s),this._isUnderCache=!0,this._clearSelfAndDescendantCache(jd),this._clearSelfAndDescendantCache(L5),this.drawScene(O,this),this.drawHit(b,this),this._isUnderCache=!1,p.restore(),y.restore(),h&&(p.save(),p.beginPath(),p.rect(0,0,i,o),p.closePath(),p.setAttr("strokeStyle","red"),p.setAttr("lineWidth",5),p.stroke(),p.restore()),this._cache.set(Wa,{scene:O,filter:g,hit:b,x:l,y:s}),this._requestDraw(),this}isCached(){return this._cache.has(Wa)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,n){const r=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}];let i=1/0,o=1/0,a=-1/0,l=-1/0;const s=this.getAbsoluteTransform(n);return r.forEach(function(f){const h=s.point(f);i===void 0&&(i=a=h.x,o=l=h.y),i=Math.min(i,h.x),o=Math.min(o,h.y),a=Math.max(a,h.x),l=Math.max(l,h.y)}),{x:i,y:o,width:a-i,height:l-o}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();e.translate(n.x,n.y);const r=this._getCachedSceneCanvas(),i=r.pixelRatio;e.drawImage(r._canvas,0,0,r.width/i,r.height/i),e.restore()}_drawCachedHitCanvas(e){const n=this._getCanvasCache(),r=n.hit;e.save(),e.translate(n.x,n.y),e.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),e.restore()}_getCachedSceneCanvas(){let e=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,o=i.getContext(),a,l,s,f;if(e){if(!this._filterUpToDate){const h=r.pixelRatio;i.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(a=e.length,o.clear(),o.drawImage(r._canvas,0,0,r.getWidth()/h,r.getHeight()/h),l=o.getImageData(0,0,i.getWidth(),i.getHeight()),s=0;s<a;s++){if(f=e[s],typeof f!="function"){pt.Util.error("Filter should be type of function, but got "+typeof f+" instead. Please check correct filters");continue}f.call(this,l),o.putImageData(l,0,0)}}catch(x){pt.Util.error("Unable to apply filter. "+x.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return i}return r}on(e,n){if(this._cache&&this._cache.delete(md),arguments.length===3)return this._delegate.apply(this,arguments);let r=e.split(Fd),i=r.length,o,a,l,s,f;for(o=0;o<i;o++)a=r[o],l=a.split("."),s=l[0],f=l[1]||"",this.eventListeners[s]||(this.eventListeners[s]=[]),this.eventListeners[s].push({name:f,handler:n});return this}off(e,n){let r=(e||"").split(Fd),i=r.length,o,a,l,s,f,h;if(this._cache&&this._cache.delete(md),!e)for(a in this.eventListeners)this._off(a);for(o=0;o<i;o++)if(l=r[o],s=l.split("."),f=s[0],h=s[1],f)this.eventListeners[f]&&this._off(f,h,n);else for(a in this.eventListeners)this._off(a,h,n);return this}dispatchEvent(e){const n={target:this,type:e.type,evt:e};return this.fire(e.type,n),this}addEventListener(e,n){return this.on(e,function(r){n.call(this,r.evt)}),this}removeEventListener(e){return this.off(e),this}_delegate(e,n,r){const i=this;this.on(e,function(o){const a=o.target.findAncestors(n,!0,i);for(let l=0;l<a.length;l++)o=pt.Util.cloneObject(o),o.currentTarget=a[l],r.call(a[l],o)})}remove(){return this.isDragging()&&this.stopDrag(),Vr.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(ho),this._clearSelfAndDescendantCache(jd),this._clearSelfAndDescendantCache(L5),this._clearSelfAndDescendantCache(F5),this._clearSelfAndDescendantCache(am),this._clearSelfAndDescendantCache(om)}_remove(){this._clearCaches();const e=this.getParent();e&&e.children&&(e.children.splice(this.index,1),e._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(e){const n="get"+pt.Util._capitalize(e);return pt.Util._isFunction(this[n])?this[n]():this.attrs[e]}getAncestors(){let e=this.getParent(),n=[];for(;e;)n.push(e),e=e.getParent();return n}getAttrs(){return this.attrs||{}}setAttrs(e){return this._batchTransformChanges(()=>{let n,r;if(!e)return this;for(n in e)n!==eT&&(r=D5+pt.Util._capitalize(n),pt.Util._isFunction(this[r])?this[r](e[n]):this._setAttr(n,e[n]))}),this}isListening(){return this._getCache(om,this._isListening)}_isListening(e){if(!this.listening())return!1;const r=this.getParent();return r&&r!==e&&this!==e?r._isListening(e):!0}isVisible(){return this._getCache(am,this._isVisible)}_isVisible(e){if(!this.visible())return!1;const r=this.getParent();return r&&r!==e&&this!==e?r._isVisible(e):!0}shouldDrawHit(e,n=!1){if(e)return this._isVisible(e)&&this._isListening(e);const r=this.getLayer();let i=!1;Vr.DD._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(a.node.nodeType==="Stage"||a.node.getLayer()===r)&&(i=!0)});const o=!n&&!Ko.Konva.hitOnDragEnabled&&(i||Ko.Konva.isTransforming());return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let e=this.getDepth(),n=this,r=0,i,o,a,l;function s(h){for(i=[],o=h.length,a=0;a<o;a++)l=h[a],r++,l.nodeType!==j5&&(i=i.concat(l.getChildren().slice())),l._id===n._id&&(a=o);i.length>0&&i[0].getDepth()<=e&&s(i)}const f=this.getStage();return n.nodeType!==nT&&f&&s(f.getChildren()),r}getDepth(){let e=0,n=this.parent;for(;n;)e++,n=n.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(Xo),this._clearSelfAndDescendantCache(ho)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges(()=>{this.x(e.x),this.y(e.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const e=this.getStage();if(!e)return null;const n=e.getPointerPosition();if(!n)return null;const r=this.getAbsoluteTransform().copy();return r.invert(),r.point(n)}getAbsolutePosition(e){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!e&&(e=!0);const i=this.getAbsoluteTransform(e).getMatrix(),o=new pt.Transform,a=this.offset();return o.m=i.slice(),o.translate(a.x,a.y),o.getTranslation()}setAbsolutePosition(e){const{x:n,y:r,...i}=this._clearTransform();this.attrs.x=n,this.attrs.y=r,this._clearCache(Xo);const o=this._getAbsoluteTransform().copy();return o.invert(),o.translate(e.x,e.y),e={x:this.attrs.x+o.getTranslation().x,y:this.attrs.y+o.getTranslation().y},this._setTransform(i),this.setPosition({x:e.x,y:e.y}),this._clearCache(Xo),this._clearSelfAndDescendantCache(ho),this}_setTransform(e){let n;for(n in e)this.attrs[n]=e[n]}_clearTransform(){const e={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,e}move(e){let n=e.x,r=e.y,i=this.x(),o=this.y();return n!==void 0&&(i+=n),r!==void 0&&(o+=r),this.setPosition({x:i,y:o}),this}_eachAncestorReverse(e,n){let r=[],i=this.getParent(),o,a;if(!(n&&n._id===this._id)){for(r.unshift(this);i&&(!n||i._id!==n._id);)r.unshift(i),i=i.parent;for(o=r.length,a=0;a<o;a++)e(r[a])}}rotate(e){return this.rotation(this.rotation()+e),this}moveToTop(){if(!this.parent)return pt.Util.warn("Node has no parent. moveToTop function is ignored."),!1;const e=this.index,n=this.parent.getChildren().length;return e<n-1?(this.parent.children.splice(e,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return pt.Util.warn("Node has no parent. moveUp function is ignored."),!1;const e=this.index,n=this.parent.getChildren().length;return e<n-1?(this.parent.children.splice(e,1),this.parent.children.splice(e+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return pt.Util.warn("Node has no parent. moveDown function is ignored."),!1;const e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return pt.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;const e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(e){if(!this.parent)return pt.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&pt.Util.warn("Unexpected value "+e+" 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 n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(jd,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let e=this.opacity();const n=this.getParent();return n&&!n._isUnderCache&&(e*=n.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){let e=this.getAttrs(),n,r,i,o,a;const l={attrs:{},className:this.getClassName()};for(n in e)r=e[n],a=pt.Util.isObject(r)&&!pt.Util._isPlainObject(r)&&!pt.Util._isArray(r),!a&&(i=typeof this[n]=="function"&&this[n],delete e[n],o=i?i.call(this):null,e[n]=r,o!==r&&(l.attrs[n]=r));return pt.Util._prepareToStringify(l)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,n,r){const i=[];n&&this._isMatch(e)&&i.push(this);let o=this.parent;for(;o;){if(o===r)return i;o._isMatch(e)&&i.push(o),o=o.parent}return i}isAncestorOf(e){return!1}findAncestor(e,n,r){return this.findAncestors(e,n,r)[0]}_isMatch(e){if(!e)return!1;if(typeof e=="function")return e(this);let n=e.replace(/ /g,"").split(","),r=n.length,i,o;for(i=0;i<r;i++)if(o=n[i],pt.Util.isValidSelector(o)||(pt.Util.warn('Selector "'+o+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),pt.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),pt.Util.warn("Konva is awesome, right?")),o.charAt(0)==="#"){if(this.id()===o.slice(1))return!0}else if(o.charAt(0)==="."){if(this.hasName(o.slice(1)))return!0}else if(this.className===o||this.nodeType===o)return!0;return!1}getLayer(){const e=this.getParent();return e?e.getLayer():null}getStage(){return this._getCache(F5,this._getStage)}_getStage(){const e=this.getParent();return e?e.getStage():null}fire(e,n={},r){return n.target=n.target||this,r?this._fireAndBubble(e,n):this._fire(e,n),this}getAbsoluteTransform(e){return e?this._getAbsoluteTransform(e):this._getCache(ho,this._getAbsoluteTransform)}_getAbsoluteTransform(e){let n;if(e)return n=new pt.Transform,this._eachAncestorReverse(function(r){const i=r.transformsEnabled();i==="all"?n.multiply(r.getTransform()):i==="position"&&n.translate(r.x()-r.offsetX(),r.y()-r.offsetY())},e),n;{n=this._cache.get(ho)||new pt.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(n):n.reset();const r=this.transformsEnabled();if(r==="all")n.multiply(this.getTransform());else if(r==="position"){const i=this.attrs.x||0,o=this.attrs.y||0,a=this.attrs.offsetX||0,l=this.attrs.offsetY||0;n.translate(i-a,o-l)}return n.dirty=!1,n}}getAbsoluteScale(e){let n=this;for(;n;)n._isUnderCache&&(e=n),n=n.getParent();const i=this.getAbsoluteTransform(e).decompose();return{x:i.scaleX,y:i.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(Xo,this._getTransform)}_getTransform(){var e,n;const r=this._cache.get(Xo)||new pt.Transform;r.reset();const i=this.x(),o=this.y(),a=Ko.Konva.getAngle(this.rotation()),l=(e=this.attrs.scaleX)!==null&&e!==void 0?e:1,s=(n=this.attrs.scaleY)!==null&&n!==void 0?n:1,f=this.attrs.skewX||0,h=this.attrs.skewY||0,x=this.attrs.offsetX||0,w=this.attrs.offsetY||0;return(i!==0||o!==0)&&r.translate(i,o),a!==0&&r.rotate(a),(f!==0||h!==0)&&r.skew(f,h),(l!==1||s!==1)&&r.scale(l,s),(x!==0||w!==0)&&r.translate(-1*x,-1*w),r.dirty=!1,r}clone(e){let n=pt.Util.cloneObject(this.attrs),r,i,o,a,l;for(r in e)n[r]=e[r];const s=new this.constructor(n);for(r in this.eventListeners)for(i=this.eventListeners[r],o=i.length,a=0;a<o;a++)l=i[a],l.name.indexOf(tT)<0&&(s.eventListeners[r]||(s.eventListeners[r]=[]),s.eventListeners[r].push(l));return s}_toKonvaCanvas(e){e=e||{};const n=this.getClientRect(),r=this.getStage(),i=e.x!==void 0?e.x:Math.floor(n.x),o=e.y!==void 0?e.y:Math.floor(n.y),a=e.pixelRatio||1,l=new ju.SceneCanvas({width:e.width||Math.ceil(n.width)||(r?r.width():0),height:e.height||Math.ceil(n.height)||(r?r.height():0),pixelRatio:a}),s=l.getContext(),f=new ju.SceneCanvas({width:l.width/l.pixelRatio+Math.abs(i),height:l.height/l.pixelRatio+Math.abs(o),pixelRatio:l.pixelRatio});return e.imageSmoothingEnabled===!1&&(s._context.imageSmoothingEnabled=!1),s.save(),(i||o)&&s.translate(-1*i,-1*o),this.drawScene(l,void 0,f),s.restore(),l}toCanvas(e){return this._toKonvaCanvas(e)._canvas}toDataURL(e){e=e||{};const n=e.mimeType||null,r=e.quality||null,i=this._toKonvaCanvas(e).toDataURL(n,r);return e.callback&&e.callback(i),i}toImage(e){return new Promise((n,r)=>{try{const i=e==null?void 0:e.callback;i&&delete e.callback,pt.Util._urlToImage(this.toDataURL(e),function(o){n(o),i==null||i(o)})}catch(i){r(i)}})}toBlob(e){return new Promise((n,r)=>{try{const i=e==null?void 0:e.callback;i&&delete e.callback,this.toCanvas(e).toBlob(o=>{n(o),i==null||i(o)},e==null?void 0:e.mimeType,e==null?void 0:e.quality)}catch(i){r(i)}})}setSize(e){return this.width(e.width),this.height(e.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():Ko.Konva.dragDistance}_off(e,n,r){let i=this.eventListeners[e],o,a,l;for(o=0;o<i.length;o++)if(a=i[o].name,l=i[o].handler,(a!=="konva"||n==="konva")&&(!n||a===n)&&(!r||r===l)){if(i.splice(o,1),i.length===0){delete this.eventListeners[e];break}o--}}_fireChangeEvent(e,n,r){this._fire(e+Jk,{oldVal:n,newVal:r})}addName(e){if(!this.hasName(e)){const n=this.name(),r=n?n+" "+e:e;this.name(r)}return this}hasName(e){if(!e)return!1;const n=this.name();return n?(n||"").split(/\s/g).indexOf(e)!==-1:!1}removeName(e){const n=(this.name()||"").split(/\s/g),r=n.indexOf(e);return r!==-1&&(n.splice(r,1),this.name(n.join(" "))),this}setAttr(e,n){const r=this[D5+pt.Util._capitalize(e)];return pt.Util._isFunction(r)?r.call(this,n):this._setAttr(e,n),this}_requestDraw(){if(Ko.Konva.autoDrawEnabled){const e=this.getLayer()||this.getStage();e==null||e.batchDraw()}}_setAttr(e,n){const r=this.attrs[e];r===n&&!pt.Util.isObject(n)||(n==null?delete this.attrs[e]:this.attrs[e]=n,this._shouldFireChangeEvents&&this._fireChangeEvent(e,r,n),this._requestDraw())}_setComponentAttr(e,n,r){let i;r!==void 0&&(i=this.attrs[e],i||(this.attrs[e]=this.getAttr(e)),this.attrs[e][n]=r,this._fireChangeEvent(e,i,r))}_fireAndBubble(e,n,r){if(n&&this.nodeType===j5&&(n.target=this),!((e===N5||e===I5)&&(r&&(this===r||this.isAncestorOf&&this.isAncestorOf(r))||this.nodeType==="Stage"&&!r))){this._fire(e,n);const o=(e===N5||e===I5)&&r&&r.isAncestorOf&&r.isAncestorOf(this)&&!r.isAncestorOf(this.parent);(n&&!n.cancelBubble||!n)&&this.parent&&this.parent.isListening()&&!o&&(r&&r.parent?this._fireAndBubble.call(this.parent,e,n,r):this._fireAndBubble.call(this.parent,e,n))}}_getProtoListeners(e){var n,r,i;const o=(n=this._cache.get(md))!==null&&n!==void 0?n:{};let a=o==null?void 0:o[e];if(a===void 0){a=[];let l=Object.getPrototypeOf(this);for(;l;){const s=(i=(r=l.eventListeners)===null||r===void 0?void 0:r[e])!==null&&i!==void 0?i:[];a.push(...s),l=Object.getPrototypeOf(l)}o[e]=a,this._cache.set(md,o)}return a}_fire(e,n){n=n||{},n.currentTarget=this,n.type=e;const r=this._getProtoListeners(e);if(r)for(var i=0;i<r.length;i++)r[i].handler.call(this,n);const o=this.eventListeners[e];if(o)for(var i=0;i<o.length;i++)o[i].handler.call(this,n)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(e){const n=e?e.pointerId:void 0,r=this.getStage(),i=this.getAbsolutePosition();if(!r)return;const o=r._getPointerById(n)||r._changedPointerPositions[0]||i;Vr.DD._dragElements.set(this._id,{node:this,startPointerPos:o,offset:{x:o.x-i.x,y:o.y-i.y},dragStatus:"ready",pointerId:n})}startDrag(e,n=!0){Vr.DD._dragElements.has(this._id)||this._createDragElement(e);const r=Vr.DD._dragElements.get(this._id);r.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:e&&e.evt},n)}_setDragPosition(e,n){const r=this.getStage()._getPointerById(n.pointerId);if(!r)return;let i={x:r.x-n.offset.x,y:r.y-n.offset.y};const o=this.dragBoundFunc();if(o!==void 0){const a=o.call(this,i,e);a?i=a:pt.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!==i.x||this._lastPos.y!==i.y)&&(this.setAbsolutePosition(i),this._requestDraw()),this._lastPos=i}stopDrag(e){const n=Vr.DD._dragElements.get(this._id);n&&(n.dragStatus="stopped"),Vr.DD._endDragBefore(e),Vr.DD._endDragAfter(e)}setDraggable(e){this._setAttr("draggable",e),this._dragChange()}isDragging(){const e=Vr.DD._dragElements.get(this._id);return e?e.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(e){if(!(!(e.evt.button!==void 0)||Ko.Konva.dragButtons.indexOf(e.evt.button)>=0)||this.isDragging())return;let i=!1;Vr.DD._dragElements.forEach(o=>{this.isAncestorOf(o.node)&&(i=!0)}),i||this._createDragElement(e)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const n=Vr.DD._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&Vr.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-e.x,y:-e.y,width:n.width()+2*e.x,height:n.height()+2*e.y};return pt.Util.haveIntersection(r,this.getClientRect())}static create(e,n){return pt.Util._isString(e)&&(e=JSON.parse(e)),this._createNode(e,n)}static _createNode(e,n){let r=lm.prototype.getClassName.call(e),i=e.children,o,a,l;n&&(e.attrs.container=n),Ko.Konva[r]||(pt.Util.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const s=Ko.Konva[r];if(o=new s(e.attrs),i)for(a=i.length,l=0;l<a;l++)o.add(lm._createNode(i[l]));return o}};qt.Node=ot;ot.prototype.nodeType="Node";ot.prototype._attrsAffectingSize=[];ot.prototype.eventListeners={};ot.prototype.on.call(ot.prototype,rT,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(Xo),this._clearSelfAndDescendantCache(ho)});ot.prototype.on.call(ot.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(am)});ot.prototype.on.call(ot.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(om)});ot.prototype.on.call(ot.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(jd)});const Lt=qc.Factory.addGetterSetter;Lt(ot,"zIndex");Lt(ot,"absolutePosition");Lt(ot,"position");Lt(ot,"x",0,(0,sn.getNumberValidator)());Lt(ot,"y",0,(0,sn.getNumberValidator)());Lt(ot,"globalCompositeOperation","source-over",(0,sn.getStringValidator)());Lt(ot,"opacity",1,(0,sn.getNumberValidator)());Lt(ot,"name","",(0,sn.getStringValidator)());Lt(ot,"id","",(0,sn.getStringValidator)());Lt(ot,"rotation",0,(0,sn.getNumberValidator)());qc.Factory.addComponentsGetterSetter(ot,"scale",["x","y"]);Lt(ot,"scaleX",1,(0,sn.getNumberValidator)());Lt(ot,"scaleY",1,(0,sn.getNumberValidator)());qc.Factory.addComponentsGetterSetter(ot,"skew",["x","y"]);Lt(ot,"skewX",0,(0,sn.getNumberValidator)());Lt(ot,"skewY",0,(0,sn.getNumberValidator)());qc.Factory.addComponentsGetterSetter(ot,"offset",["x","y"]);Lt(ot,"offsetX",0,(0,sn.getNumberValidator)());Lt(ot,"offsetY",0,(0,sn.getNumberValidator)());Lt(ot,"dragDistance",null,(0,sn.getNumberValidator)());Lt(ot,"width",0,(0,sn.getNumberValidator)());Lt(ot,"height",0,(0,sn.getNumberValidator)());Lt(ot,"listening",!0,(0,sn.getBooleanValidator)());Lt(ot,"preventDefault",!0,(0,sn.getBooleanValidator)());Lt(ot,"filters",null,function(t){return this._filterUpToDate=!1,t});Lt(ot,"visible",!0,(0,sn.getBooleanValidator)());Lt(ot,"transformsEnabled","all",(0,sn.getStringValidator)());Lt(ot,"size");Lt(ot,"dragBoundFunc");Lt(ot,"draggable",!1,(0,sn.getBooleanValidator)());qc.Factory.backCompat(ot,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var wl={};Object.defineProperty(wl,"__esModule",{value:!0});wl.Container=void 0;const Zs=ut,G1=qt,op=Ze;class Sl extends G1.Node{constructor(){super(...arguments),this.children=[]}getChildren(e){if(!e)return this.children||[];const n=this.children||[],r=[];return n.forEach(function(i){e(i)&&r.push(i)}),r}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.destroy()}),this.children=[],this._requestDraw(),this}add(...e){if(e.length===0)return this;if(e.length>1){for(let r=0;r<e.length;r++)this.add(e[r]);return this}const n=e[0];return n.getParent()?(n.moveTo(this),this):(this._validateAdd(n),n.index=this.getChildren().length,n.parent=this,n._clearCaches(),this.getChildren().push(n),this._fire("add",{child:n}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(e){return this._generalFind(e,!1)}findOne(e){const n=this._generalFind(e,!0);return n.length>0?n[0]:void 0}_generalFind(e,n){const r=[];return this._descendants(i=>{const o=i._isMatch(e);return o&&r.push(i),!!(o&&n)}),r}_descendants(e){let n=!1;const r=this.getChildren();for(const i of r){if(n=e(i),n)return!0;if(i.hasChildren()&&(n=i._descendants(e),n))return!0}return!1}toObject(){const e=G1.Node.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach(n=>{e.children.push(n.toObject())}),e}isAncestorOf(e){let n=e.getParent();for(;n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(e){const n=G1.Node.prototype.clone.call(this,e);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(e){const n=[];return this.find("Shape").forEach(r=>{r.isVisible()&&r.intersects(e)&&n.push(r)}),n}_clearSelfAndDescendantCache(e){var n;super._clearSelfAndDescendantCache(e),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;(e=this.children)===null||e===void 0||e.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(e,n,r){const i=this.getLayer(),o=e||i&&i.getCanvas(),a=o&&o.getContext(),l=this._getCanvasCache(),s=l&&l.scene,f=o&&o.isCache;if(!this.isVisible()&&!f)return this;if(s){a.save();const h=this.getAbsoluteTransform(n).getMatrix();a.transform(h[0],h[1],h[2],h[3],h[4],h[5]),this._drawCachedSceneCanvas(a),a.restore()}else this._drawChildren("drawScene",o,n,r);return this}drawHit(e,n){if(!this.shouldDrawHit(n))return this;const r=this.getLayer(),i=e||r&&r.hitCanvas,o=i&&i.getContext(),a=this._getCanvasCache();if(a&&a.hit){o.save();const s=this.getAbsoluteTransform(n).getMatrix();o.transform(s[0],s[1],s[2],s[3],s[4],s[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(e,n,r,i){var o;const a=n&&n.getContext(),l=this.clipWidth(),s=this.clipHeight(),f=this.clipFunc(),h=typeof l=="number"&&typeof s=="number"||f,x=r===this;if(h){a.save();const v=this.getAbsoluteTransform(r);let O=v.getMatrix();a.transform(O[0],O[1],O[2],O[3],O[4],O[5]),a.beginPath();let g;if(f)g=f.call(this,a,this);else{const b=this.clipX(),p=this.clipY();a.rect(b||0,p||0,l,s)}a.clip.apply(a,g),O=v.copy().invert().getMatrix(),a.transform(O[0],O[1],O[2],O[3],O[4],O[5])}const w=!x&&this.globalCompositeOperation()!=="source-over"&&e==="drawScene";w&&(a.save(),a._applyGlobalCompositeOperation(this)),(o=this.children)===null||o===void 0||o.forEach(function(v){v[e](n,r,i)}),w&&a.restore(),h&&a.restore()}getClientRect(e={}){var n;const r=e.skipTransform,i=e.relativeTo;let o,a,l,s,f={x:1/0,y:1/0,width:0,height:0};const h=this;(n=this.children)===null||n===void 0||n.forEach(function(v){if(!v.visible())return;const O=v.getClientRect({relativeTo:h,skipShadow:e.skipShadow,skipStroke:e.skipStroke});O.width===0&&O.height===0||(o===void 0?(o=O.x,a=O.y,l=O.x+O.width,s=O.y+O.height):(o=Math.min(o,O.x),a=Math.min(a,O.y),l=Math.max(l,O.x+O.width),s=Math.max(s,O.y+O.height)))});const x=this.find("Shape");let w=!1;for(let v=0;v<x.length;v++)if(x[v]._isVisible(this)){w=!0;break}return w&&o!==void 0?f={x:o,y:a,width:l-o,height:s-a}:f={x:0,y:0,width:0,height:0},r?f:this._transformedRect(f,i)}}wl.Container=Sl;Zs.Factory.addComponentsGetterSetter(Sl,"clip",["x","y","width","height"]);Zs.Factory.addGetterSetter(Sl,"clipX",void 0,(0,op.getNumberValidator)());Zs.Factory.addGetterSetter(Sl,"clipY",void 0,(0,op.getNumberValidator)());Zs.Factory.addGetterSetter(Sl,"clipWidth",void 0,(0,op.getNumberValidator)());Zs.Factory.addGetterSetter(Sl,"clipHeight",void 0,(0,op.getNumberValidator)());Zs.Factory.addGetterSetter(Sl,"clipFunc");var a9={},Ca={};Object.defineProperty(Ca,"__esModule",{value:!0});Ca.getCapturedShape=aT;Ca.createEvent=Iy;Ca.hasPointerCapture=lT;Ca.setPointerCapture=sT;Ca.releaseCapture=s9;const oT=st,Pc=new Map,l9=oT.Konva._global.PointerEvent!==void 0;function aT(t){return Pc.get(t)}function Iy(t){return{evt:t,pointerId:t.pointerId}}function lT(t,e){return Pc.get(t)===e}function sT(t,e){s9(t),e.getStage()&&(Pc.set(t,e),l9&&e._fire("gotpointercapture",Iy(new PointerEvent("gotpointercapture"))))}function s9(t,e){const n=Pc.get(t);if(!n)return;const r=n.getStage();r&&r.content,Pc.delete(t),l9&&n._fire("lostpointercapture",Iy(new PointerEvent("lostpointercapture")))}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Stage=t.stages=void 0;const e=en,n=ut,r=wl,i=st,o=wi,a=ip,l=st,s=Ca,f="Stage",h="string",x="px",w="mouseout",v="mouseleave",O="mouseover",g="mouseenter",b="mousemove",p="mousedown",y="mouseup",d="pointermove",m="pointerdown",_="pointerup",A="pointercancel",C="lostpointercapture",R="pointerout",S="pointerleave",E="pointerover",P="pointerenter",T="contextmenu",N="touchstart",U="touchend",G="touchmove",Z="touchcancel",W="wheel",H=5,L=[[g,"_pointerenter"],[p,"_pointerdown"],[b,"_pointermove"],[y,"_pointerup"],[v,"_pointerleave"],[N,"_pointerdown"],[G,"_pointermove"],[U,"_pointerup"],[Z,"_pointercancel"],[O,"_pointerover"],[W,"_wheel"],[T,"_contextmenu"],[m,"_pointerdown"],[d,"_pointermove"],[_,"_pointerup"],[A,"_pointercancel"],[C,"_lostpointercapture"]],M={mouse:{[R]:w,[S]:v,[E]:O,[P]:g,[d]:b,[m]:p,[_]:y,[A]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[R]:"touchout",[S]:"touchleave",[E]:"touchover",[P]:"touchenter",[d]:G,[m]:N,[_]:U,[A]:Z,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[R]:R,[S]:S,[E]:E,[P]:P,[d]:d,[m]:m,[_]:_,[A]:A,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},D=$=>$.indexOf("pointer")>=0?"pointer":$.indexOf("touch")>=0?"touch":"mouse",B=$=>{const z=D($);if(z==="pointer")return i.Konva.pointerEventsEnabled&&M.pointer;if(z==="touch")return M.touch;if(z==="mouse")return M.mouse};function V($={}){return($.clipFunc||$.clipWidth||$.clipHeight)&&e.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),$}const Y="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);";t.stages=[];class F extends r.Container{constructor(z){super(V(z)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),t.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",()=>{V(this.attrs)}),this._checkVisibility()}_validateAdd(z){const K=z.getType()==="Layer",X=z.getType()==="FastLayer";K||X||e.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===h){if(z.charAt(0)==="."){const X=z.slice(1);z=document.getElementsByClassName(X)[0]}else{var K;z.charAt(0)!=="#"?K=z:K=z.slice(1),z=document.getElementById(K)}if(!z)throw"Can not find container in document with id "+K}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(){let z=this.children,K=z.length,X;for(X=0;X<K;X++)z[X].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&&e.Util._isInDocument(z)&&this.container().removeChild(z);const K=t.stages.indexOf(this);return K>-1&&t.stages.splice(K,1),e.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}:(e.Util.warn(Y),null)}_getPointerById(z){return this._pointerPositions.find(K=>K.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 K=new o.SceneCanvas({width:z.width,height:z.height,pixelRatio:z.pixelRatio||1}),X=K.getContext()._context,Q=this.children;return(z.x||z.y)&&X.translate(-1*z.x,-1*z.y),Q.forEach(function(J){if(!J.isVisible())return;const ne=J._toKonvaCanvas(z);X.drawImage(ne._canvas,z.x,z.y,ne.getWidth()/ne.getPixelRatio(),ne.getHeight()/ne.getPixelRatio())}),K}getIntersection(z){if(!z)return null;let K=this.children,X=K.length,Q=X-1,J;for(J=Q;J>=0;J--){const ne=K[J].getIntersection(z);if(ne)return ne}return null}_resizeDOM(){const z=this.width(),K=this.height();this.content&&(this.content.style.width=z+x,this.content.style.height=K+x),this.bufferCanvas.setSize(z,K),this.bufferHitCanvas.setSize(z,K),this.children.forEach(X=>{X.setSize({width:z,height:K}),X.draw()})}add(z,...K){if(arguments.length>1){for(let Q=0;Q<arguments.length;Q++)this.add(arguments[Q]);return this}super.add(z);const X=this.children.length;return X>H&&e.Util.warn("The stage has "+X+" 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(),i.Konva.isBrowser&&this.content.appendChild(z.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(z){return s.hasPointerCapture(z,this)}setPointerCapture(z){s.setPointerCapture(z,this)}releaseCapture(z){s.releaseCapture(z,this)}getLayers(){return this.children}_bindContentEvents(){i.Konva.isBrowser&&L.forEach(([z,K])=>{this.content.addEventListener(z,X=>{this[K](X)},{passive:!1})})}_pointerenter(z){this.setPointersPositions(z);const K=B(z.type);K&&this._fire(K.pointerenter,{evt:z,target:this,currentTarget:this})}_pointerover(z){this.setPointersPositions(z);const K=B(z.type);K&&this._fire(K.pointerover,{evt:z,target:this,currentTarget:this})}_getTargetShape(z){let K=this[z+"targetShape"];return K&&!K.getStage()&&(K=null),K}_pointerleave(z){const K=B(z.type),X=D(z.type);if(!K)return;this.setPointersPositions(z);const Q=this._getTargetShape(X),J=!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled;Q&&J?(Q._fireAndBubble(K.pointerout,{evt:z}),Q._fireAndBubble(K.pointerleave,{evt:z}),this._fire(K.pointerleave,{evt:z,target:this,currentTarget:this}),this[X+"targetShape"]=null):J&&(this._fire(K.pointerleave,{evt:z,target:this,currentTarget:this}),this._fire(K.pointerout,{evt:z,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(z){const K=B(z.type),X=D(z.type);if(!K)return;this.setPointersPositions(z);let Q=!1;this._changedPointerPositions.forEach(J=>{const ne=this.getIntersection(J);if(a.DD.justDragged=!1,i.Konva["_"+X+"ListenClick"]=!0,!ne||!ne.isListening()){this[X+"ClickStartShape"]=void 0;return}i.Konva.capturePointerEventsEnabled&&ne.setPointerCapture(J.id),this[X+"ClickStartShape"]=ne,ne._fireAndBubble(K.pointerdown,{evt:z,pointerId:J.id}),Q=!0;const ie=z.type.indexOf("touch")>=0;ne.preventDefault()&&z.cancelable&&ie&&z.preventDefault()}),Q||this._fire(K.pointerdown,{evt:z,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(z){const K=B(z.type),X=D(z.type);if(!K||(i.Konva.isDragging()&&a.DD.node.preventDefault()&&z.cancelable&&z.preventDefault(),this.setPointersPositions(z),!(!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled)))return;const J={};let ne=!1;const ie=this._getTargetShape(X);this._changedPointerPositions.forEach(oe=>{const de=s.getCapturedShape(oe.id)||this.getIntersection(oe),me=oe.id,Pe={evt:z,pointerId:me},re=ie!==de;if(re&&ie&&(ie._fireAndBubble(K.pointerout,{...Pe},de),ie._fireAndBubble(K.pointerleave,{...Pe},de)),de){if(J[de._id])return;J[de._id]=!0}de&&de.isListening()?(ne=!0,re&&(de._fireAndBubble(K.pointerover,{...Pe},ie),de._fireAndBubble(K.pointerenter,{...Pe},ie),this[X+"targetShape"]=de),de._fireAndBubble(K.pointermove,{...Pe})):ie&&(this._fire(K.pointerover,{evt:z,target:this,currentTarget:this,pointerId:me}),this[X+"targetShape"]=null)}),ne||this._fire(K.pointermove,{evt:z,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(z){const K=B(z.type),X=D(z.type);if(!K)return;this.setPointersPositions(z);const Q=this[X+"ClickStartShape"],J=this[X+"ClickEndShape"],ne={};let ie=!1;this._changedPointerPositions.forEach(oe=>{const de=s.getCapturedShape(oe.id)||this.getIntersection(oe);if(de){if(de.releaseCapture(oe.id),ne[de._id])return;ne[de._id]=!0}const me=oe.id,Pe={evt:z,pointerId:me};let re=!1;i.Konva["_"+X+"InDblClickWindow"]?(re=!0,clearTimeout(this[X+"DblTimeout"])):a.DD.justDragged||(i.Konva["_"+X+"InDblClickWindow"]=!0,clearTimeout(this[X+"DblTimeout"])),this[X+"DblTimeout"]=setTimeout(function(){i.Konva["_"+X+"InDblClickWindow"]=!1},i.Konva.dblClickWindow),de&&de.isListening()?(ie=!0,this[X+"ClickEndShape"]=de,de._fireAndBubble(K.pointerup,{...Pe}),i.Konva["_"+X+"ListenClick"]&&Q&&Q===de&&(de._fireAndBubble(K.pointerclick,{...Pe}),re&&J&&J===de&&de._fireAndBubble(K.pointerdblclick,{...Pe}))):(this[X+"ClickEndShape"]=null,i.Konva["_"+X+"ListenClick"]&&this._fire(K.pointerclick,{evt:z,target:this,currentTarget:this,pointerId:me}),re&&this._fire(K.pointerdblclick,{evt:z,target:this,currentTarget:this,pointerId:me}))}),ie||this._fire(K.pointerup,{evt:z,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),i.Konva["_"+X+"ListenClick"]=!1,z.cancelable&&X!=="touch"&&z.preventDefault()}_contextmenu(z){this.setPointersPositions(z);const K=this.getIntersection(this.getPointerPosition());K&&K.isListening()?K._fireAndBubble(T,{evt:z}):this._fire(T,{evt:z,target:this,currentTarget:this})}_wheel(z){this.setPointersPositions(z);const K=this.getIntersection(this.getPointerPosition());K&&K.isListening()?K._fireAndBubble(W,{evt:z}):this._fire(W,{evt:z,target:this,currentTarget:this})}_pointercancel(z){this.setPointersPositions(z);const K=s.getCapturedShape(z.pointerId)||this.getIntersection(this.getPointerPosition());K&&K._fireAndBubble(_,s.createEvent(z)),s.releaseCapture(z.pointerId)}_lostpointercapture(z){s.releaseCapture(z.pointerId)}setPointersPositions(z){let K=this._getContentPosition(),X=null,Q=null;z=z||window.event,z.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(z.touches,J=>{this._pointerPositions.push({id:J.identifier,x:(J.clientX-K.left)/K.scaleX,y:(J.clientY-K.top)/K.scaleY})}),Array.prototype.forEach.call(z.changedTouches||z.touches,J=>{this._changedPointerPositions.push({id:J.identifier,x:(J.clientX-K.left)/K.scaleX,y:(J.clientY-K.top)/K.scaleY})})):(X=(z.clientX-K.left)/K.scaleX,Q=(z.clientY-K.top)/K.scaleY,this.pointerPos={x:X,y:Q},this._pointerPositions=[{x:X,y:Q,id:e.Util._getFirstPointerId(z)}],this._changedPointerPositions=[{x:X,y:Q,id:e.Util._getFirstPointerId(z)}])}_setPointerPosition(z){e.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()}),!i.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 e.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}}t.Stage=F,F.prototype.nodeType=f,(0,l._registerNode)(F),n.Factory.addGetterSetter(F,"container"),i.Konva.isBrowser&&document.addEventListener("visibilitychange",()=>{t.stages.forEach($=>{$.batchDraw()})})})(a9);var Wc={},En={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Shape=t.shapes=void 0;const e=st,n=en,r=ut,i=qt,o=Ze,a=st,l=Ca,s="hasShadow",f="shadowRGBA",h="patternImage",x="linearGradient",w="radialGradient";let v;function O(){return v||(v=n.Util.createCanvasElement().getContext("2d"),v)}t.shapes={};function g(S){const E=this.attrs.fillRule;E?S.fill(E):S.fill()}function b(S){S.stroke()}function p(S){const E=this.attrs.fillRule;E?S.fill(E):S.fill()}function y(S){S.stroke()}function d(){this._clearCache(s)}function m(){this._clearCache(f)}function _(){this._clearCache(h)}function A(){this._clearCache(x)}function C(){this._clearCache(w)}class R extends i.Node{constructor(E){super(E);let P;for(;P=n.Util.getRandomColor(),!(P&&!(P in t.shapes)););this.colorKey=P,t.shapes[P]=this}getContext(){return n.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return n.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(s,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(h,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const P=O().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(P&&P.setTransform){const T=new n.Transform;T.translate(this.fillPatternX(),this.fillPatternY()),T.rotate(e.Konva.getAngle(this.fillPatternRotation())),T.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),T.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const N=T.getMatrix(),U=typeof DOMMatrix>"u"?{a:N[0],b:N[1],c:N[2],d:N[3],e:N[4],f:N[5]}:new DOMMatrix(N);P.setTransform(U)}return P}}_getLinearGradient(){return this._getCache(x,this.__getLinearGradient)}__getLinearGradient(){const E=this.fillLinearGradientColorStops();if(E){const P=O(),T=this.fillLinearGradientStartPoint(),N=this.fillLinearGradientEndPoint(),U=P.createLinearGradient(T.x,T.y,N.x,N.y);for(let G=0;G<E.length;G+=2)U.addColorStop(E[G],E[G+1]);return U}}_getRadialGradient(){return this._getCache(w,this.__getRadialGradient)}__getRadialGradient(){const E=this.fillRadialGradientColorStops();if(E){const P=O(),T=this.fillRadialGradientStartPoint(),N=this.fillRadialGradientEndPoint(),U=P.createRadialGradient(T.x,T.y,this.fillRadialGradientStartRadius(),N.x,N.y,this.fillRadialGradientEndRadius());for(let G=0;G<E.length;G+=2)U.addColorStop(E[G],E[G+1]);return U}}getShadowRGBA(){return this._getCache(f,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const E=n.Util.colorToRGBA(this.shadowColor());if(E)return"rgba("+E.r+","+E.g+","+E.b+","+E.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 E=this.hitStrokeWidth();return E==="auto"?this.hasStroke():this.strokeEnabled()&&!!E}intersects(E){const P=this.getStage();if(!P)return!1;const T=P.bufferHitCanvas;return T.getContext().clear(),this.drawHit(T,void 0,!0),T.context.getImageData(Math.round(E.x),Math.round(E.y),1,1).data[3]>0}destroy(){return i.Node.prototype.destroy.call(this),delete t.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(E){var P;if(!((P=this.attrs.perfectDrawEnabled)!==null&&P!==void 0?P:!0))return!1;const N=E||this.hasFill(),U=this.hasStroke(),G=this.getAbsoluteOpacity()!==1;if(N&&U&&G)return!0;const Z=this.hasShadow(),W=this.shadowForStrokeEnabled();return!!(N&&U&&Z&&W)}setStrokeHitEnabled(E){n.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),E?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const E=this.size();return{x:this._centroid?-E.width/2:0,y:this._centroid?-E.height/2:0,width:E.width,height:E.height}}getClientRect(E={}){let P=!1,T=this.getParent();for(;T;){if(T.isCached()){P=!0;break}T=T.getParent()}const N=E.skipTransform,U=E.relativeTo||P&&this.getStage()||void 0,G=this.getSelfRect(),W=!E.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,H=G.width+W,L=G.height+W,M=!E.skipShadow&&this.hasShadow(),D=M?this.shadowOffsetX():0,B=M?this.shadowOffsetY():0,V=H+Math.abs(D),Y=L+Math.abs(B),F=M&&this.shadowBlur()||0,$=V+F*2,z=Y+F*2,K={width:$,height:z,x:-(W/2+F)+Math.min(D,0)+G.x,y:-(W/2+F)+Math.min(B,0)+G.y};return N?K:this._transformedRect(K,U)}drawScene(E,P,T){const N=this.getLayer();let U=E||N.getCanvas(),G=U.getContext(),Z=this._getCanvasCache(),W=this.getSceneFunc(),H=this.hasShadow(),L,M;const D=U.isCache,B=P===this;if(!this.isVisible()&&!B)return this;if(Z){G.save();const Y=this.getAbsoluteTransform(P).getMatrix();return G.transform(Y[0],Y[1],Y[2],Y[3],Y[4],Y[5]),this._drawCachedSceneCanvas(G),G.restore(),this}if(!W)return this;if(G.save(),this._useBufferCanvas()&&!D){L=this.getStage();const Y=T||L.bufferCanvas;M=Y.getContext(),M.clear(),M.save(),M._applyLineJoin(this);var V=this.getAbsoluteTransform(P).getMatrix();M.transform(V[0],V[1],V[2],V[3],V[4],V[5]),W.call(this,M,this),M.restore();const F=Y.pixelRatio;H&&G._applyShadow(this),G._applyOpacity(this),G._applyGlobalCompositeOperation(this),G.drawImage(Y._canvas,0,0,Y.width/F,Y.height/F)}else{if(G._applyLineJoin(this),!B){var V=this.getAbsoluteTransform(P).getMatrix();G.transform(V[0],V[1],V[2],V[3],V[4],V[5]),G._applyOpacity(this),G._applyGlobalCompositeOperation(this)}H&&G._applyShadow(this),W.call(this,G,this)}return G.restore(),this}drawHit(E,P,T=!1){if(!this.shouldDrawHit(P,T))return this;const N=this.getLayer(),U=E||N.hitCanvas,G=U&&U.getContext(),Z=this.hitFunc()||this.sceneFunc(),W=this._getCanvasCache(),H=W&&W.hit;if(this.colorKey||n.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()"),H){G.save();const M=this.getAbsoluteTransform(P).getMatrix();return G.transform(M[0],M[1],M[2],M[3],M[4],M[5]),this._drawCachedHitCanvas(G),G.restore(),this}if(!Z)return this;if(G.save(),G._applyLineJoin(this),!(this===P)){const M=this.getAbsoluteTransform(P).getMatrix();G.transform(M[0],M[1],M[2],M[3],M[4],M[5])}return Z.call(this,G,this),G.restore(),this}drawHitFromCache(E=0){let P=this._getCanvasCache(),T=this._getCachedSceneCanvas(),N=P.hit,U=N.getContext(),G=N.getWidth(),Z=N.getHeight(),W,H,L,M,D,B;U.clear(),U.drawImage(T._canvas,0,0,G,Z);try{for(W=U.getImageData(0,0,G,Z),H=W.data,L=H.length,M=n.Util._hexToRgb(this.colorKey),D=0;D<L;D+=4)B=H[D+3],B>E?(H[D]=M.r,H[D+1]=M.g,H[D+2]=M.b,H[D+3]=255):H[D+3]=0;U.putImageData(W,0,0)}catch(V){n.Util.error("Unable to draw hit graph from cached scene canvas. "+V.message)}return this}hasPointerCapture(E){return l.hasPointerCapture(E,this)}setPointerCapture(E){l.setPointerCapture(E,this)}releaseCapture(E){l.releaseCapture(E,this)}}t.Shape=R,R.prototype._fillFunc=g,R.prototype._strokeFunc=b,R.prototype._fillFuncHit=p,R.prototype._strokeFuncHit=y,R.prototype._centroid=!1,R.prototype.nodeType="Shape",(0,a._registerNode)(R),R.prototype.eventListeners={},R.prototype.on.call(R.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",d),R.prototype.on.call(R.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",m),R.prototype.on.call(R.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",_),R.prototype.on.call(R.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",A),R.prototype.on.call(R.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",C),r.Factory.addGetterSetter(R,"stroke",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(R,"strokeWidth",2,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(R,"fillAfterStrokeEnabled",!1),r.Factory.addGetterSetter(R,"hitStrokeWidth","auto",(0,o.getNumberOrAutoValidator)()),r.Factory.addGetterSetter(R,"strokeHitEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(R,"perfectDrawEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(R,"shadowForStrokeEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(R,"lineJoin"),r.Factory.addGetterSetter(R,"lineCap"),r.Factory.addGetterSetter(R,"sceneFunc"),r.Factory.addGetterSetter(R,"hitFunc"),r.Factory.addGetterSetter(R,"dash"),r.Factory.addGetterSetter(R,"dashOffset",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(R,"shadowColor",void 0,(0,o.getStringValidator)()),r.Factory.addGetterSetter(R,"shadowBlur",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(R,"shadowOpacity",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(R,"shadowOffset",["x","y"]),r.Factory.addGetterSetter(R,"shadowOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(R,"shadowOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(R,"fillPatternImage"),r.Factory.addGetterSetter(R,"fill",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(R,"fillPatternX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(R,"fillPatternY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(R,"fillLinearGradientColorStops"),r.Factory.addGetterSetter(R,"strokeLinearGradientColorStops"),r.Factory.addGetterSetter(R,"fillRadialGradientStartRadius",0),r.Factory.addGetterSetter(R,"fillRadialGradientEndRadius",0),r.Factory.addGetterSetter(R,"fillRadialGradientColorStops"),r.Factory.addGetterSetter(R,"fillPatternRepeat","repeat"),r.Factory.addGetterSetter(R,"fillEnabled",!0),r.Factory.addGetterSetter(R,"strokeEnabled",!0),r.Factory.addGetterSetter(R,"shadowEnabled",!0),r.Factory.addGetterSetter(R,"dashEnabled",!0),r.Factory.addGetterSetter(R,"strokeScaleEnabled",!0),r.Factory.addGetterSetter(R,"fillPriority","color"),r.Factory.addComponentsGetterSetter(R,"fillPatternOffset",["x","y"]),r.Factory.addGetterSetter(R,"fillPatternOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(R,"fillPatternOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(R,"fillPatternScale",["x","y"]),r.Factory.addGetterSetter(R,"fillPatternScaleX",1,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(R,"fillPatternScaleY",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(R,"fillLinearGradientStartPoint",["x","y"]),r.Factory.addComponentsGetterSetter(R,"strokeLinearGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(R,"fillLinearGradientStartPointX",0),r.Factory.addGetterSetter(R,"strokeLinearGradientStartPointX",0),r.Factory.addGetterSetter(R,"fillLinearGradientStartPointY",0),r.Factory.addGetterSetter(R,"strokeLinearGradientStartPointY",0),r.Factory.addComponentsGetterSetter(R,"fillLinearGradientEndPoint",["x","y"]),r.Factory.addComponentsGetterSetter(R,"strokeLinearGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(R,"fillLinearGradientEndPointX",0),r.Factory.addGetterSetter(R,"strokeLinearGradientEndPointX",0),r.Factory.addGetterSetter(R,"fillLinearGradientEndPointY",0),r.Factory.addGetterSetter(R,"strokeLinearGradientEndPointY",0),r.Factory.addComponentsGetterSetter(R,"fillRadialGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(R,"fillRadialGradientStartPointX",0),r.Factory.addGetterSetter(R,"fillRadialGradientStartPointY",0),r.Factory.addComponentsGetterSetter(R,"fillRadialGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(R,"fillRadialGradientEndPointX",0),r.Factory.addGetterSetter(R,"fillRadialGradientEndPointY",0),r.Factory.addGetterSetter(R,"fillPatternRotation",0),r.Factory.addGetterSetter(R,"fillRule",void 0,(0,o.getStringValidator)()),r.Factory.backCompat(R,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(En);Object.defineProperty(Wc,"__esModule",{value:!0});Wc.Layer=void 0;const fo=en,V1=wl,Ql=qt,Dy=ut,z5=wi,uT=Ze,cT=En,fT=st,dT="#",hT="beforeDraw",pT="draw",u9=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],gT=u9.length;let Qs=class extends V1.Container{constructor(e){super(e),this.canvas=new z5.SceneCanvas,this.hitCanvas=new z5.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(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);const n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),e<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[e+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){Ql.Node.prototype.moveToTop.call(this);const e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!Ql.Node.prototype.moveUp.call(this))return!1;const n=this.getStage();return!n||!n.content?!1:(n.content.removeChild(this.getNativeCanvasElement()),this.index<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[this.index+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(Ql.Node.prototype.moveDown.call(this)){const e=this.getStage();if(e){const n=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),n[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(Ql.Node.prototype.moveToBottom.call(this)){const e=this.getStage();if(e){const n=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),n[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const e=this.getNativeCanvasElement();return Ql.Node.prototype.remove.call(this),e&&e.parentNode&&fo.Util._isInDocument(e)&&e.parentNode.removeChild(e),this}getStage(){return this.parent}setSize({width:e,height:n}){return this.canvas.setSize(e,n),this.hitCanvas.setSize(e,n),this._setSmoothEnabled(),this}_validateAdd(e){const n=e.getType();n!=="Group"&&n!=="Shape"&&fo.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(e){return e=e||{},e.width=e.width||this.getWidth(),e.height=e.height||this.getHeight(),e.x=e.x!==void 0?e.x:this.x(),e.y=e.y!==void 0?e.y:this.y(),Ql.Node.prototype._toKonvaCanvas.call(this,e)}_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(){fo.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){fo.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,fo.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;let n=1,r=!1;for(;;){for(let i=0;i<gT;i++){const o=u9[i],a=this._getIntersection({x:e.x+o.x*n,y:e.y+o.y*n}),l=a.shape;if(l)return l;if(r=!!a.antialiased,!a.antialiased)break}if(r)n+=1;else return null}}_getIntersection(e){const n=this.hitCanvas.pixelRatio,r=this.hitCanvas.context.getImageData(Math.round(e.x*n),Math.round(e.y*n),1,1).data,i=r[3];if(i===255){const o=fo.Util._rgbToHex(r[0],r[1],r[2]),a=cT.shapes[dT+o];return a?{shape:a}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(e,n){const r=this.getLayer(),i=e||r&&r.getCanvas();return this._fire(hT,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),V1.Container.prototype.drawScene.call(this,i,n),this._fire(pT,{node:this}),this}drawHit(e,n){const r=this.getLayer(),i=e||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),V1.Container.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){fo.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return fo.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const e=this.parent;!!this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}destroy(){return fo.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};Wc.Layer=Qs;Qs.prototype.nodeType="Layer";(0,fT._registerNode)(Qs);Dy.Factory.addGetterSetter(Qs,"imageSmoothingEnabled",!0);Dy.Factory.addGetterSetter(Qs,"clearBeforeDraw",!0);Dy.Factory.addGetterSetter(Qs,"hitGraphEnabled",!0,(0,uT.getBooleanValidator)());var ap={};Object.defineProperty(ap,"__esModule",{value:!0});ap.FastLayer=void 0;const vT=en,mT=Wc,yT=st;let jy=class extends mT.Layer{constructor(e){super(e),this.listening(!1),vT.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}};ap.FastLayer=jy;jy.prototype.nodeType="FastLayer";(0,yT._registerNode)(jy);var Js={};Object.defineProperty(Js,"__esModule",{value:!0});Js.Group=void 0;const bT=en,_T=wl,wT=st;let Fy=class extends _T.Container{_validateAdd(e){const n=e.getType();n!=="Group"&&n!=="Shape"&&bT.Util.throw("You may only add groups and shapes to groups.")}};Js.Group=Fy;Fy.prototype.nodeType="Group";(0,wT._registerNode)(Fy);var eu={};Object.defineProperty(eu,"__esModule",{value:!0});eu.Animation=void 0;const q1=st,B5=en,W1=function(){return q1.glob.performance&&q1.glob.performance.now?function(){return q1.glob.performance.now()}:function(){return new Date().getTime()}}();class Hi{constructor(e,n){this.id=Hi.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:W1(),frameRate:0},this.func=e,this.setLayers(n)}setLayers(e){let n=[];return e&&(n=Array.isArray(e)?e:[e]),this.layers=n,this}getLayers(){return this.layers}addLayer(e){const n=this.layers,r=n.length;for(let i=0;i<r;i++)if(n[i]._id===e._id)return!1;return this.layers.push(e),!0}isRunning(){const n=Hi.animations,r=n.length;for(let i=0;i<r;i++)if(n[i].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=W1(),Hi._addAnimation(this),this}stop(){return Hi._removeAnimation(this),this}_updateFrameObject(e){this.frame.timeDiff=e-this.frame.lastTime,this.frame.lastTime=e,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(e){this.animations.push(e),this._handleAnimation()}static _removeAnimation(e){const n=e.id,r=this.animations,i=r.length;for(let o=0;o<i;o++)if(r[o].id===n){this.animations.splice(o,1);break}}static _runFrames(){const e={},n=this.animations;for(let r=0;r<n.length;r++){const i=n[r],o=i.layers,a=i.func;i._updateFrameObject(W1());const l=o.length;let s;if(a?s=a.call(i,i.frame)!==!1:s=!0,!!s)for(let f=0;f<l;f++){const h=o[f];h._id!==void 0&&(e[h._id]=h)}}for(const r in e)e.hasOwnProperty(r)&&e[r].batchDraw()}static _animationLoop(){const e=Hi;e.animations.length?(e._runFrames(),B5.Util.requestAnimFrame(e._animationLoop)):e.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,B5.Util.requestAnimFrame(this._animationLoop))}}eu.Animation=Hi;Hi.animations=[];Hi.animIdCounter=0;Hi.animRunning=!1;var c9={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Easings=t.Tween=void 0;const e=en,n=eu,r=qt,i=st;let o={node:1,duration:1,easing:1,onFinish:1,yoyo:1},a=1,l=2,s=3,f=0,h=["fill","stroke","shadowColor"];class x{constructor(O,g,b,p,y,d,m){this.prop=O,this.propFunc=g,this.begin=p,this._pos=p,this.duration=d,this._change=0,this.prevPos=0,this.yoyo=m,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=b,this._change=y-this.begin,this.pause()}fire(O){const g=this[O];g&&g()}setTime(O){O>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():O<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=O,this.update())}getTime(){return this._time}setPosition(O){this.prevPos=this._pos,this.propFunc(O),this._pos=O}getPosition(O){return O===void 0&&(O=this._time),this.func(O,this.begin,this._change,this.duration)}play(){this.state=l,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=s,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(O){this.pause(),this._time=O,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 O=this.getTimer()-this._startTime;this.state===l?this.setTime(O):this.state===s&&this.setTime(this.duration-O)}pause(){this.state=a,this.fire("onPause")}getTimer(){return new Date().getTime()}}class w{constructor(O){let g=this,b=O.node,p=b._id,y,d=O.easing||t.Easings.Linear,m=!!O.yoyo,_;typeof O.duration>"u"?y=.3:O.duration===0?y=.001:y=O.duration,this.node=b,this._id=f++;const A=b.getLayer()||(b instanceof i.Konva.Stage?b.getLayers():null);A||e.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new n.Animation(function(){g.tween.onEnterFrame()},A),this.tween=new x(_,function(C){g._tweenFunc(C)},d,0,1,y*1e3,m),this._addListeners(),w.attrs[p]||(w.attrs[p]={}),w.attrs[p][this._id]||(w.attrs[p][this._id]={}),w.tweens[p]||(w.tweens[p]={});for(_ in O)o[_]===void 0&&this._addAttr(_,O[_]);this.reset(),this.onFinish=O.onFinish,this.onReset=O.onReset,this.onUpdate=O.onUpdate}_addAttr(O,g){let b=this.node,p=b._id,y,d,m,_,A,C,R,S;if(m=w.tweens[p][O],m&&delete w.attrs[p][m][O],y=b.getAttr(O),e.Util._isArray(g))if(d=[],A=Math.max(g.length,y.length),O==="points"&&g.length!==y.length&&(g.length>y.length?(R=y,y=e.Util._prepareArrayForTween(y,g,b.closed())):(C=g,g=e.Util._prepareArrayForTween(g,y,b.closed()))),O.indexOf("fill")===0)for(_=0;_<A;_++)if(_%2===0)d.push(g[_]-y[_]);else{const E=e.Util.colorToRGBA(y[_]);S=e.Util.colorToRGBA(g[_]),y[_]=E,d.push({r:S.r-E.r,g:S.g-E.g,b:S.b-E.b,a:S.a-E.a})}else for(_=0;_<A;_++)d.push(g[_]-y[_]);else h.indexOf(O)!==-1?(y=e.Util.colorToRGBA(y),S=e.Util.colorToRGBA(g),d={r:S.r-y.r,g:S.g-y.g,b:S.b-y.b,a:S.a-y.a}):d=g-y;w.attrs[p][this._id][O]={start:y,diff:d,end:g,trueEnd:C,trueStart:R},w.tweens[p][O]=this._id}_tweenFunc(O){let g=this.node,b=w.attrs[g._id][this._id],p,y,d,m,_,A,C,R;for(p in b){if(y=b[p],d=y.start,m=y.diff,R=y.end,e.Util._isArray(d))if(_=[],C=Math.max(d.length,R.length),p.indexOf("fill")===0)for(A=0;A<C;A++)A%2===0?_.push((d[A]||0)+m[A]*O):_.push("rgba("+Math.round(d[A].r+m[A].r*O)+","+Math.round(d[A].g+m[A].g*O)+","+Math.round(d[A].b+m[A].b*O)+","+(d[A].a+m[A].a*O)+")");else for(A=0;A<C;A++)_.push((d[A]||0)+m[A]*O);else h.indexOf(p)!==-1?_="rgba("+Math.round(d.r+m.r*O)+","+Math.round(d.g+m.g*O)+","+Math.round(d.b+m.b*O)+","+(d.a+m.a*O)+")":_=d+m*O;g.setAttr(p,_)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const O=this.node,g=w.attrs[O._id][this._id];g.points&&g.points.trueEnd&&O.setAttr("points",g.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const O=this.node,g=w.attrs[O._id][this._id];g.points&&g.points.trueStart&&O.points(g.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(O){return this.tween.seek(O*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){let O=this.node._id,g=this._id,b=w.tweens[O],p;this.pause();for(p in b)delete w.tweens[O][p];delete w.attrs[O][g]}}t.Tween=w,w.attrs={},w.tweens={},r.Node.prototype.to=function(v){const O=v.onFinish;v.node=this,v.onFinish=function(){this.destroy(),O&&O()},new w(v).play()},t.Easings={BackEaseIn(v,O,g,b){return g*(v/=b)*v*((1.70158+1)*v-1.70158)+O},BackEaseOut(v,O,g,b){return g*((v=v/b-1)*v*((1.70158+1)*v+1.70158)+1)+O},BackEaseInOut(v,O,g,b){let p=1.70158;return(v/=b/2)<1?g/2*(v*v*(((p*=1.525)+1)*v-p))+O:g/2*((v-=2)*v*(((p*=1.525)+1)*v+p)+2)+O},ElasticEaseIn(v,O,g,b,p,y){let d=0;return v===0?O:(v/=b)===1?O+g:(y||(y=b*.3),!p||p<Math.abs(g)?(p=g,d=y/4):d=y/(2*Math.PI)*Math.asin(g/p),-(p*Math.pow(2,10*(v-=1))*Math.sin((v*b-d)*(2*Math.PI)/y))+O)},ElasticEaseOut(v,O,g,b,p,y){let d=0;return v===0?O:(v/=b)===1?O+g:(y||(y=b*.3),!p||p<Math.abs(g)?(p=g,d=y/4):d=y/(2*Math.PI)*Math.asin(g/p),p*Math.pow(2,-10*v)*Math.sin((v*b-d)*(2*Math.PI)/y)+g+O)},ElasticEaseInOut(v,O,g,b,p,y){let d=0;return v===0?O:(v/=b/2)===2?O+g:(y||(y=b*(.3*1.5)),!p||p<Math.abs(g)?(p=g,d=y/4):d=y/(2*Math.PI)*Math.asin(g/p),v<1?-.5*(p*Math.pow(2,10*(v-=1))*Math.sin((v*b-d)*(2*Math.PI)/y))+O:p*Math.pow(2,-10*(v-=1))*Math.sin((v*b-d)*(2*Math.PI)/y)*.5+g+O)},BounceEaseOut(v,O,g,b){return(v/=b)<1/2.75?g*(7.5625*v*v)+O:v<2/2.75?g*(7.5625*(v-=1.5/2.75)*v+.75)+O:v<2.5/2.75?g*(7.5625*(v-=2.25/2.75)*v+.9375)+O:g*(7.5625*(v-=2.625/2.75)*v+.984375)+O},BounceEaseIn(v,O,g,b){return g-t.Easings.BounceEaseOut(b-v,0,g,b)+O},BounceEaseInOut(v,O,g,b){return v<b/2?t.Easings.BounceEaseIn(v*2,0,g,b)*.5+O:t.Easings.BounceEaseOut(v*2-b,0,g,b)*.5+g*.5+O},EaseIn(v,O,g,b){return g*(v/=b)*v+O},EaseOut(v,O,g,b){return-g*(v/=b)*(v-2)+O},EaseInOut(v,O,g,b){return(v/=b/2)<1?g/2*v*v+O:-g/2*(--v*(v-2)-1)+O},StrongEaseIn(v,O,g,b){return g*(v/=b)*v*v*v*v+O},StrongEaseOut(v,O,g,b){return g*((v=v/b-1)*v*v*v*v+1)+O},StrongEaseInOut(v,O,g,b){return(v/=b/2)<1?g/2*v*v*v*v*v+O:g/2*((v-=2)*v*v*v*v+2)+O},Linear(v,O,g,b){return g*v/b+O}}})(c9);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;const e=st,n=en,r=qt,i=wl,o=a9,a=Wc,l=ap,s=Js,f=ip,h=En,x=eu,w=c9,v=So,O=wi;t.Konva=n.Util._assign(e.Konva,{Util:n.Util,Transform:n.Transform,Node:r.Node,Container:i.Container,Stage:o.Stage,stages:o.stages,Layer:a.Layer,FastLayer:l.FastLayer,Group:s.Group,DD:f.DD,Shape:h.Shape,shapes:h.shapes,Animation:x.Animation,Tween:w.Tween,Easings:w.Easings,Context:v.Context,Canvas:O.Canvas}),t.default=t.Konva})(bh);var lp={};Object.defineProperty(lp,"__esModule",{value:!0});lp.Arc=void 0;const sp=ut,ST=En,U5=st,up=Ze,ET=st;let Lo=class extends ST.Shape{_sceneFunc(e){const n=U5.Konva.getAngle(this.angle()),r=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,n,r),e.arc(0,0,this.innerRadius(),n,0,!r),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){const e=this.innerRadius(),n=this.outerRadius(),r=this.clockwise(),i=U5.Konva.getAngle(r?360-this.angle():this.angle()),o=Math.cos(Math.min(i,Math.PI)),a=1,l=Math.sin(Math.min(Math.max(Math.PI,i),3*Math.PI/2)),s=Math.sin(Math.min(i,Math.PI/2)),f=o*(o>0?e:n),h=a*n,x=l*(l>0?e:n),w=s*(s>0?n:e);return{x:f,y:r?-1*w:x,width:h-f,height:w-x}}};lp.Arc=Lo;Lo.prototype._centroid=!0;Lo.prototype.className="Arc";Lo.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,ET._registerNode)(Lo);sp.Factory.addGetterSetter(Lo,"innerRadius",0,(0,up.getNumberValidator)());sp.Factory.addGetterSetter(Lo,"outerRadius",0,(0,up.getNumberValidator)());sp.Factory.addGetterSetter(Lo,"angle",0,(0,up.getNumberValidator)());sp.Factory.addGetterSetter(Lo,"clockwise",!1,(0,up.getBooleanValidator)());var cp={},Yc={};Object.defineProperty(Yc,"__esModule",{value:!0});Yc.Line=void 0;const fp=ut,OT=st,xT=En,f9=Ze;function sm(t,e,n,r,i,o,a){const l=Math.sqrt(Math.pow(n-t,2)+Math.pow(r-e,2)),s=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2)),f=a*l/(l+s),h=a*s/(l+s),x=n-f*(i-t),w=r-f*(o-e),v=n+h*(i-t),O=r+h*(o-e);return[x,w,v,O]}function H5(t,e){const n=t.length,r=[];for(let i=2;i<n-2;i+=2){const o=sm(t[i-2],t[i-1],t[i],t[i+1],t[i+2],t[i+3],e);isNaN(o[0])||(r.push(o[0]),r.push(o[1]),r.push(t[i]),r.push(t[i+1]),r.push(o[2]),r.push(o[3]))}return r}let ka=class extends xT.Shape{constructor(e){super(e),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(e){let n=this.points(),r=n.length,i=this.tension(),o=this.closed(),a=this.bezier(),l,s,f;if(r){if(e.beginPath(),e.moveTo(n[0],n[1]),i!==0&&r>4){for(l=this.getTensionPoints(),s=l.length,f=o?0:4,o||e.quadraticCurveTo(l[0],l[1],l[2],l[3]);f<s-2;)e.bezierCurveTo(l[f++],l[f++],l[f++],l[f++],l[f++],l[f++]);o||e.quadraticCurveTo(l[s-2],l[s-1],n[r-2],n[r-1])}else if(a)for(f=2;f<r;)e.bezierCurveTo(n[f++],n[f++],n[f++],n[f++],n[f++],n[f++]);else for(f=2;f<r;f+=2)e.lineTo(n[f],n[f+1]);o?(e.closePath(),e.fillStrokeShape(this)):e.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():H5(this.points(),this.tension())}_getTensionPointsClosed(){const e=this.points(),n=e.length,r=this.tension(),i=sm(e[n-2],e[n-1],e[0],e[1],e[2],e[3],r),o=sm(e[n-4],e[n-3],e[n-2],e[n-1],e[0],e[1],r),a=H5(e,r);return[i[2],i[3]].concat(a).concat([o[0],o[1],e[n-2],e[n-1],o[2],o[3],i[0],i[1],e[0],e[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let e=this.points();if(e.length<4)return{x:e[0]||0,y:e[1]||0,width:0,height:0};this.tension()!==0?e=[e[0],e[1],...this._getTensionPoints(),e[e.length-2],e[e.length-1]]:e=this.points();let n=e[0],r=e[0],i=e[1],o=e[1],a,l;for(let s=0;s<e.length/2;s++)a=e[s*2],l=e[s*2+1],n=Math.min(n,a),r=Math.max(r,a),i=Math.min(i,l),o=Math.max(o,l);return{x:n,y:i,width:r-n,height:o-i}}};Yc.Line=ka;ka.prototype.className="Line";ka.prototype._attrsAffectingSize=["points","bezier","tension"];(0,OT._registerNode)(ka);fp.Factory.addGetterSetter(ka,"closed",!1);fp.Factory.addGetterSetter(ka,"bezier",!1);fp.Factory.addGetterSetter(ka,"tension",0,(0,f9.getNumberValidator)());fp.Factory.addGetterSetter(ka,"points",[],(0,f9.getNumberArrayValidator)());var tu={},d9={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.t2length=t.getQuadraticArcLength=t.getCubicArcLength=t.binomialCoefficients=t.cValues=t.tValues=void 0,t.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]],t.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]],t.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const e=(a,l,s)=>{let f,h;const w=s/2;f=0;for(let v=0;v<20;v++)h=w*t.tValues[20][v]+w,f+=t.cValues[20][v]*r(a,l,h);return w*f};t.getCubicArcLength=e;const n=(a,l,s)=>{s===void 0&&(s=1);const f=a[0]-2*a[1]+a[2],h=l[0]-2*l[1]+l[2],x=2*a[1]-2*a[0],w=2*l[1]-2*l[0],v=4*(f*f+h*h),O=4*(f*x+h*w),g=x*x+w*w;if(v===0)return s*Math.sqrt(Math.pow(a[2]-a[0],2)+Math.pow(l[2]-l[0],2));const b=O/(2*v),p=g/v,y=s+b,d=p-b*b,m=y*y+d>0?Math.sqrt(y*y+d):0,_=b*b+d>0?Math.sqrt(b*b+d):0,A=b+Math.sqrt(b*b+d)!==0?d*Math.log(Math.abs((y+m)/(b+_))):0;return Math.sqrt(v)/2*(y*m-b*_+A)};t.getQuadraticArcLength=n;function r(a,l,s){const f=i(1,s,a),h=i(1,s,l),x=f*f+h*h;return Math.sqrt(x)}const i=(a,l,s)=>{const f=s.length-1;let h,x;if(f===0)return 0;if(a===0){x=0;for(let w=0;w<=f;w++)x+=t.binomialCoefficients[f][w]*Math.pow(1-l,f-w)*Math.pow(l,w)*s[w];return x}else{h=new Array(f);for(let w=0;w<f;w++)h[w]=f*(s[w+1]-s[w]);return i(a-1,l,h)}},o=(a,l,s)=>{let f=1,h=a/l,x=(a-s(h))/l,w=0;for(;f>.001;){const v=s(h+x),O=Math.abs(a-v)/l;if(O<f)f=O,h+=x;else{const g=s(h-x),b=Math.abs(a-g)/l;b<f?(f=b,h-=x):x/=2}if(w++,w>500)break}return h};t.t2length=o})(d9);Object.defineProperty(tu,"__esModule",{value:!0});tu.Path=void 0;const PT=ut,CT=En,kT=st,Jl=d9;let Kc=class cr extends CT.Shape{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=cr.parsePathData(this.data()),this.pathLength=cr.getPathLength(this.dataArray)}_sceneFunc(e){const n=this.dataArray;e.beginPath();let r=!1;for(let g=0;g<n.length;g++){const b=n[g].command,p=n[g].points;switch(b){case"L":e.lineTo(p[0],p[1]);break;case"M":e.moveTo(p[0],p[1]);break;case"C":e.bezierCurveTo(p[0],p[1],p[2],p[3],p[4],p[5]);break;case"Q":e.quadraticCurveTo(p[0],p[1],p[2],p[3]);break;case"A":var i=p[0],o=p[1],a=p[2],l=p[3],s=p[4],f=p[5],h=p[6],x=p[7],w=a>l?a:l,v=a>l?1:a/l,O=a>l?l/a:1;e.translate(i,o),e.rotate(h),e.scale(v,O),e.arc(0,0,w,s,s+f,1-x),e.scale(1/v,1/O),e.rotate(-h),e.translate(-i,-o);break;case"z":r=!0,e.closePath();break}}!r&&!this.hasFill()?e.strokeShape(this):e.fillStrokeShape(this)}getSelfRect(){let e=[];this.dataArray.forEach(function(s){if(s.command==="A"){const f=s.points[4],h=s.points[5],x=s.points[4]+h;let w=Math.PI/180;if(Math.abs(f-x)<w&&(w=Math.abs(f-x)),h<0)for(let v=f-w;v>x;v-=w){const O=cr.getPointOnEllipticalArc(s.points[0],s.points[1],s.points[2],s.points[3],v,0);e.push(O.x,O.y)}else for(let v=f+w;v<x;v+=w){const O=cr.getPointOnEllipticalArc(s.points[0],s.points[1],s.points[2],s.points[3],v,0);e.push(O.x,O.y)}}else if(s.command==="C")for(let f=0;f<=1;f+=.01){const h=cr.getPointOnCubicBezier(f,s.start.x,s.start.y,s.points[0],s.points[1],s.points[2],s.points[3],s.points[4],s.points[5]);e.push(h.x,h.y)}else e=e.concat(s.points)});let n=e[0],r=e[0],i=e[1],o=e[1],a,l;for(let s=0;s<e.length/2;s++)a=e[s*2],l=e[s*2+1],isNaN(a)||(n=Math.min(n,a),r=Math.max(r,a)),isNaN(l)||(i=Math.min(i,l),o=Math.max(o,l));return{x:n,y:i,width:r-n,height:o-i}}getLength(){return this.pathLength}getPointAtLength(e){return cr.getPointAtLengthOfDataArray(e,this.dataArray)}static getLineLength(e,n,r,i){return Math.sqrt((r-e)*(r-e)+(i-n)*(i-n))}static getPathLength(e){let n=0;for(let r=0;r<e.length;++r)n+=e[r].pathLength;return n}static getPointAtLengthOfDataArray(e,n){let r,i=0,o=n.length;if(!o)return null;for(;i<o&&e>n[i].pathLength;)e-=n[i].pathLength,++i;if(i===o)return r=n[i-1].points.slice(-2),{x:r[0],y:r[1]};if(e<.01)return r=n[i].points.slice(0,2),{x:r[0],y:r[1]};const a=n[i],l=a.points;switch(a.command){case"L":return cr.getPointOnLine(e,a.start.x,a.start.y,l[0],l[1]);case"C":return cr.getPointOnCubicBezier((0,Jl.t2length)(e,cr.getPathLength(n),g=>(0,Jl.getCubicArcLength)([a.start.x,l[0],l[2],l[4]],[a.start.y,l[1],l[3],l[5]],g)),a.start.x,a.start.y,l[0],l[1],l[2],l[3],l[4],l[5]);case"Q":return cr.getPointOnQuadraticBezier((0,Jl.t2length)(e,cr.getPathLength(n),g=>(0,Jl.getQuadraticArcLength)([a.start.x,l[0],l[2]],[a.start.y,l[1],l[3]],g)),a.start.x,a.start.y,l[0],l[1],l[2],l[3]);case"A":var s=l[0],f=l[1],h=l[2],x=l[3],w=l[4],v=l[5],O=l[6];return w+=v*e/a.pathLength,cr.getPointOnEllipticalArc(s,f,h,x,w,O)}return null}static getPointOnLine(e,n,r,i,o,a,l){a=a??n,l=l??r;const s=this.getLineLength(n,r,i,o);if(s<1e-10)return{x:n,y:r};if(i===n)return{x:a,y:l+(o>r?e:-e)};const f=(o-r)/(i-n),h=Math.sqrt(e*e/(1+f*f))*(i<n?-1:1),x=f*h;if(Math.abs(l-r-f*(a-n))<1e-10)return{x:a+h,y:l+x};const w=((a-n)*(i-n)+(l-r)*(o-r))/(s*s),v=n+w*(i-n),O=r+w*(o-r),g=this.getLineLength(a,l,v,O),b=Math.sqrt(e*e-g*g),p=Math.sqrt(b*b/(1+f*f))*(i<n?-1:1),y=f*p;return{x:v+p,y:O+y}}static getPointOnCubicBezier(e,n,r,i,o,a,l,s,f){function h(b){return b*b*b}function x(b){return 3*b*b*(1-b)}function w(b){return 3*b*(1-b)*(1-b)}function v(b){return(1-b)*(1-b)*(1-b)}const O=s*h(e)+a*x(e)+i*w(e)+n*v(e),g=f*h(e)+l*x(e)+o*w(e)+r*v(e);return{x:O,y:g}}static getPointOnQuadraticBezier(e,n,r,i,o,a,l){function s(v){return v*v}function f(v){return 2*v*(1-v)}function h(v){return(1-v)*(1-v)}const x=a*s(e)+i*f(e)+n*h(e),w=l*s(e)+o*f(e)+r*h(e);return{x,y:w}}static getPointOnEllipticalArc(e,n,r,i,o,a){const l=Math.cos(a),s=Math.sin(a),f={x:r*Math.cos(o),y:i*Math.sin(o)};return{x:e+(f.x*l-f.y*s),y:n+(f.x*s+f.y*l)}}static parsePathData(e){if(!e)return[];let n=e;const r=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];n=n.replace(new RegExp(" ","g"),",");for(var i=0;i<r.length;i++)n=n.replace(new RegExp(r[i],"g"),"|"+r[i]);const o=n.split("|"),a=[],l=[];let s=0,f=0;const h=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let x;for(i=1;i<o.length;i++){let R=o[i],S=R.charAt(0);for(R=R.slice(1),l.length=0;x=h.exec(R);)l.push(x[0]);const E=[];for(let P=0,T=l.length;P<T;P++){if(l[P]==="00"){E.push(0,0);continue}const N=parseFloat(l[P]);isNaN(N)?E.push(0):E.push(N)}for(;E.length>0&&!isNaN(E[0]);){let P="",T=[];const N=s,U=f;var w,v,O,g,b,p,y,d,m,_;switch(S){case"l":s+=E.shift(),f+=E.shift(),P="L",T.push(s,f);break;case"L":s=E.shift(),f=E.shift(),T.push(s,f);break;case"m":var A=E.shift(),C=E.shift();if(s+=A,f+=C,P="M",a.length>2&&a[a.length-1].command==="z"){for(let G=a.length-2;G>=0;G--)if(a[G].command==="M"){s=a[G].points[0]+A,f=a[G].points[1]+C;break}}T.push(s,f),S="l";break;case"M":s=E.shift(),f=E.shift(),P="M",T.push(s,f),S="L";break;case"h":s+=E.shift(),P="L",T.push(s,f);break;case"H":s=E.shift(),P="L",T.push(s,f);break;case"v":f+=E.shift(),P="L",T.push(s,f);break;case"V":f=E.shift(),P="L",T.push(s,f);break;case"C":T.push(E.shift(),E.shift(),E.shift(),E.shift()),s=E.shift(),f=E.shift(),T.push(s,f);break;case"c":T.push(s+E.shift(),f+E.shift(),s+E.shift(),f+E.shift()),s+=E.shift(),f+=E.shift(),P="C",T.push(s,f);break;case"S":v=s,O=f,w=a[a.length-1],w.command==="C"&&(v=s+(s-w.points[2]),O=f+(f-w.points[3])),T.push(v,O,E.shift(),E.shift()),s=E.shift(),f=E.shift(),P="C",T.push(s,f);break;case"s":v=s,O=f,w=a[a.length-1],w.command==="C"&&(v=s+(s-w.points[2]),O=f+(f-w.points[3])),T.push(v,O,s+E.shift(),f+E.shift()),s+=E.shift(),f+=E.shift(),P="C",T.push(s,f);break;case"Q":T.push(E.shift(),E.shift()),s=E.shift(),f=E.shift(),T.push(s,f);break;case"q":T.push(s+E.shift(),f+E.shift()),s+=E.shift(),f+=E.shift(),P="Q",T.push(s,f);break;case"T":v=s,O=f,w=a[a.length-1],w.command==="Q"&&(v=s+(s-w.points[0]),O=f+(f-w.points[1])),s=E.shift(),f=E.shift(),P="Q",T.push(v,O,s,f);break;case"t":v=s,O=f,w=a[a.length-1],w.command==="Q"&&(v=s+(s-w.points[0]),O=f+(f-w.points[1])),s+=E.shift(),f+=E.shift(),P="Q",T.push(v,O,s,f);break;case"A":g=E.shift(),b=E.shift(),p=E.shift(),y=E.shift(),d=E.shift(),m=s,_=f,s=E.shift(),f=E.shift(),P="A",T=this.convertEndpointToCenterParameterization(m,_,s,f,y,d,g,b,p);break;case"a":g=E.shift(),b=E.shift(),p=E.shift(),y=E.shift(),d=E.shift(),m=s,_=f,s+=E.shift(),f+=E.shift(),P="A",T=this.convertEndpointToCenterParameterization(m,_,s,f,y,d,g,b,p);break}a.push({command:P||S,points:T,start:{x:N,y:U},pathLength:this.calcLength(N,U,P||S,T)})}(S==="z"||S==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(e,n,r,i){let o,a,l,s;const f=cr;switch(r){case"L":return f.getLineLength(e,n,i[0],i[1]);case"C":return(0,Jl.getCubicArcLength)([e,i[0],i[2],i[4]],[n,i[1],i[3],i[5]],1);case"Q":return(0,Jl.getQuadraticArcLength)([e,i[0],i[2]],[n,i[1],i[3]],1);case"A":o=0;var h=i[4],x=i[5],w=i[4]+x,v=Math.PI/180;if(Math.abs(h-w)<v&&(v=Math.abs(h-w)),a=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],h,0),x<0)for(s=h-v;s>w;s-=v)l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],s,0),o+=f.getLineLength(a.x,a.y,l.x,l.y),a=l;else for(s=h+v;s<w;s+=v)l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],s,0),o+=f.getLineLength(a.x,a.y,l.x,l.y),a=l;return l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],w,0),o+=f.getLineLength(a.x,a.y,l.x,l.y),o}return 0}static convertEndpointToCenterParameterization(e,n,r,i,o,a,l,s,f){const h=f*(Math.PI/180),x=Math.cos(h)*(e-r)/2+Math.sin(h)*(n-i)/2,w=-1*Math.sin(h)*(e-r)/2+Math.cos(h)*(n-i)/2,v=x*x/(l*l)+w*w/(s*s);v>1&&(l*=Math.sqrt(v),s*=Math.sqrt(v));let O=Math.sqrt((l*l*(s*s)-l*l*(w*w)-s*s*(x*x))/(l*l*(w*w)+s*s*(x*x)));o===a&&(O*=-1),isNaN(O)&&(O=0);const g=O*l*w/s,b=O*-s*x/l,p=(e+r)/2+Math.cos(h)*g-Math.sin(h)*b,y=(n+i)/2+Math.sin(h)*g+Math.cos(h)*b,d=function(E){return Math.sqrt(E[0]*E[0]+E[1]*E[1])},m=function(E,P){return(E[0]*P[0]+E[1]*P[1])/(d(E)*d(P))},_=function(E,P){return(E[0]*P[1]<E[1]*P[0]?-1:1)*Math.acos(m(E,P))},A=_([1,0],[(x-g)/l,(w-b)/s]),C=[(x-g)/l,(w-b)/s],R=[(-1*x-g)/l,(-1*w-b)/s];let S=_(C,R);return m(C,R)<=-1&&(S=Math.PI),m(C,R)>=1&&(S=0),a===0&&S>0&&(S=S-2*Math.PI),a===1&&S<0&&(S=S+2*Math.PI),[p,y,l,s,A,S,h,a]}};tu.Path=Kc;Kc.prototype.className="Path";Kc.prototype._attrsAffectingSize=["data"];(0,kT._registerNode)(Kc);PT.Factory.addGetterSetter(Kc,"data");Object.defineProperty(cp,"__esModule",{value:!0});cp.Arrow=void 0;const dp=ut,TT=Yc,h9=Ze,AT=st,$5=tu;let El=class extends TT.Line{_sceneFunc(e){super._sceneFunc(e);const n=Math.PI*2,r=this.points();let i=r;const o=this.tension()!==0&&r.length>4;o&&(i=this.getTensionPoints());const a=this.pointerLength(),l=r.length;let s,f;if(o){const w=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[l-2],r[l-1]],v=$5.Path.calcLength(i[i.length-4],i[i.length-3],"C",w),O=$5.Path.getPointOnQuadraticBezier(Math.min(1,1-a/v),w[0],w[1],w[2],w[3],w[4],w[5]);s=r[l-2]-O.x,f=r[l-1]-O.y}else s=r[l-2]-r[l-4],f=r[l-1]-r[l-3];const h=(Math.atan2(f,s)+n)%n,x=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(r[l-2],r[l-1]),e.rotate(h),e.moveTo(0,0),e.lineTo(-a,x/2),e.lineTo(-a,-x/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(r[0],r[1]),o?(s=(i[0]+i[2])/2-r[0],f=(i[1]+i[3])/2-r[1]):(s=r[2]-r[0],f=r[3]-r[1]),e.rotate((Math.atan2(-f,-s)+n)%n),e.moveTo(0,0),e.lineTo(-a,x/2),e.lineTo(-a,-x/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){const n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),n=this.pointerWidth()/2;return{x:e.x-n,y:e.y-n,width:e.width+n*2,height:e.height+n*2}}};cp.Arrow=El;El.prototype.className="Arrow";(0,AT._registerNode)(El);dp.Factory.addGetterSetter(El,"pointerLength",10,(0,h9.getNumberValidator)());dp.Factory.addGetterSetter(El,"pointerWidth",10,(0,h9.getNumberValidator)());dp.Factory.addGetterSetter(El,"pointerAtBeginning",!1);dp.Factory.addGetterSetter(El,"pointerAtEnding",!0);var hp={};Object.defineProperty(hp,"__esModule",{value:!0});hp.Circle=void 0;const RT=ut,MT=En,LT=Ze,NT=st;let nu=class extends MT.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}};hp.Circle=nu;nu.prototype._centroid=!0;nu.prototype.className="Circle";nu.prototype._attrsAffectingSize=["radius"];(0,NT._registerNode)(nu);RT.Factory.addGetterSetter(nu,"radius",0,(0,LT.getNumberValidator)());var pp={};Object.defineProperty(pp,"__esModule",{value:!0});pp.Ellipse=void 0;const zy=ut,IT=En,p9=Ze,DT=st;let Ta=class extends IT.Shape{_sceneFunc(e){const n=this.radiusX(),r=this.radiusY();e.beginPath(),e.save(),n!==r&&e.scale(1,r/n),e.arc(0,0,n,0,Math.PI*2,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}};pp.Ellipse=Ta;Ta.prototype.className="Ellipse";Ta.prototype._centroid=!0;Ta.prototype._attrsAffectingSize=["radiusX","radiusY"];(0,DT._registerNode)(Ta);zy.Factory.addComponentsGetterSetter(Ta,"radius",["x","y"]);zy.Factory.addGetterSetter(Ta,"radiusX",0,(0,p9.getNumberValidator)());zy.Factory.addGetterSetter(Ta,"radiusY",0,(0,p9.getNumberValidator)());var gp={};Object.defineProperty(gp,"__esModule",{value:!0});gp.Image=void 0;const Y1=en,Ol=ut,jT=En,FT=st,Xc=Ze;let Ji=class g9 extends jT.Shape{constructor(e){super(e),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&e.readyState===4||e&&e.addEventListener&&e.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){const e=!!this.cornerRadius(),n=this.hasShadow();return e&&n?!0:super._useBufferCanvas(!0)}_sceneFunc(e){const n=this.getWidth(),r=this.getHeight(),i=this.cornerRadius(),o=this.attrs.image;let a;if(o){const l=this.attrs.cropWidth,s=this.attrs.cropHeight;l&&s?a=[o,this.cropX(),this.cropY(),l,s,0,0,n,r]:a=[o,0,0,n,r]}(this.hasFill()||this.hasStroke()||i)&&(e.beginPath(),i?Y1.Util.drawRoundedRectPath(e,n,r,i):e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)),o&&(i&&e.clip(),e.drawImage.apply(e,a))}_hitFunc(e){const n=this.width(),r=this.height(),i=this.cornerRadius();e.beginPath(),i?Y1.Util.drawRoundedRectPath(e,n,r,i):e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,n;return(e=this.attrs.width)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.width}getHeight(){var e,n;return(e=this.attrs.height)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.height}static fromURL(e,n,r=null){const i=Y1.Util.createImageElement();i.onload=function(){const o=new g9({image:i});n(o)},i.onerror=r,i.crossOrigin="Anonymous",i.src=e}};gp.Image=Ji;Ji.prototype.className="Image";(0,FT._registerNode)(Ji);Ol.Factory.addGetterSetter(Ji,"cornerRadius",0,(0,Xc.getNumberOrArrayOfNumbersValidator)(4));Ol.Factory.addGetterSetter(Ji,"image");Ol.Factory.addComponentsGetterSetter(Ji,"crop",["x","y","width","height"]);Ol.Factory.addGetterSetter(Ji,"cropX",0,(0,Xc.getNumberValidator)());Ol.Factory.addGetterSetter(Ji,"cropY",0,(0,Xc.getNumberValidator)());Ol.Factory.addGetterSetter(Ji,"cropWidth",0,(0,Xc.getNumberValidator)());Ol.Factory.addGetterSetter(Ji,"cropHeight",0,(0,Xc.getNumberValidator)());var Ds={};Object.defineProperty(Ds,"__esModule",{value:!0});Ds.Tag=Ds.Label=void 0;const vp=ut,zT=En,BT=Js,By=Ze,v9=st,m9=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],UT="Change.konva",HT="none",um="up",cm="right",fm="down",dm="left",$T=m9.length;let Uy=class extends BT.Group{constructor(e){super(e),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){let n=this,r;const i=function(){n._sync()};for(r=0;r<$T;r++)e.on(m9[r]+UT,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let e=this.getText(),n=this.getTag(),r,i,o,a,l,s,f;if(e&&n){switch(r=e.width(),i=e.height(),o=n.pointerDirection(),a=n.pointerWidth(),f=n.pointerHeight(),l=0,s=0,o){case um:l=r/2,s=-1*f;break;case cm:l=r+a,s=i/2;break;case fm:l=r/2,s=i+f;break;case dm:l=-1*a,s=i/2;break}n.setAttrs({x:-1*l,y:-1*s,width:r,height:i}),e.setAttrs({x:-1*l,y:-1*s})}}};Ds.Label=Uy;Uy.prototype.className="Label";(0,v9._registerNode)(Uy);let xl=class extends zT.Shape{_sceneFunc(e){const n=this.width(),r=this.height(),i=this.pointerDirection(),o=this.pointerWidth(),a=this.pointerHeight(),l=this.cornerRadius();let s=0,f=0,h=0,x=0;typeof l=="number"?s=f=h=x=Math.min(l,n/2,r/2):(s=Math.min(l[0]||0,n/2,r/2),f=Math.min(l[1]||0,n/2,r/2),x=Math.min(l[2]||0,n/2,r/2),h=Math.min(l[3]||0,n/2,r/2)),e.beginPath(),e.moveTo(s,0),i===um&&(e.lineTo((n-o)/2,0),e.lineTo(n/2,-1*a),e.lineTo((n+o)/2,0)),e.lineTo(n-f,0),e.arc(n-f,f,f,Math.PI*3/2,0,!1),i===cm&&(e.lineTo(n,(r-a)/2),e.lineTo(n+o,r/2),e.lineTo(n,(r+a)/2)),e.lineTo(n,r-x),e.arc(n-x,r-x,x,0,Math.PI/2,!1),i===fm&&(e.lineTo((n+o)/2,r),e.lineTo(n/2,r+a),e.lineTo((n-o)/2,r)),e.lineTo(h,r),e.arc(h,r-h,h,Math.PI/2,Math.PI,!1),i===dm&&(e.lineTo(0,(r+a)/2),e.lineTo(-1*o,r/2),e.lineTo(0,(r-a)/2)),e.lineTo(0,s),e.arc(s,s,s,Math.PI,Math.PI*3/2,!1),e.closePath(),e.fillStrokeShape(this)}getSelfRect(){let e=0,n=0,r=this.pointerWidth(),i=this.pointerHeight(),o=this.pointerDirection(),a=this.width(),l=this.height();return o===um?(n-=i,l+=i):o===fm?l+=i:o===dm?(e-=r*1.5,a+=r):o===cm&&(a+=r*1.5),{x:e,y:n,width:a,height:l}}};Ds.Tag=xl;xl.prototype.className="Tag";(0,v9._registerNode)(xl);vp.Factory.addGetterSetter(xl,"pointerDirection",HT);vp.Factory.addGetterSetter(xl,"pointerWidth",0,(0,By.getNumberValidator)());vp.Factory.addGetterSetter(xl,"pointerHeight",0,(0,By.getNumberValidator)());vp.Factory.addGetterSetter(xl,"cornerRadius",0,(0,By.getNumberOrArrayOfNumbersValidator)(4));var Zc={};Object.defineProperty(Zc,"__esModule",{value:!0});Zc.Rect=void 0;const GT=ut,VT=En,qT=st,WT=en,YT=Ze;let mp=class extends VT.Shape{_sceneFunc(e){const n=this.cornerRadius(),r=this.width(),i=this.height();e.beginPath(),n?WT.Util.drawRoundedRectPath(e,r,i,n):e.rect(0,0,r,i),e.closePath(),e.fillStrokeShape(this)}};Zc.Rect=mp;mp.prototype.className="Rect";(0,qT._registerNode)(mp);GT.Factory.addGetterSetter(mp,"cornerRadius",0,(0,YT.getNumberOrArrayOfNumbersValidator)(4));var yp={};Object.defineProperty(yp,"__esModule",{value:!0});yp.RegularPolygon=void 0;const y9=ut,KT=En,b9=Ze,XT=st;let Pl=class extends KT.Shape{_sceneFunc(e){const n=this._getPoints();e.beginPath(),e.moveTo(n[0].x,n[0].y);for(let r=1;r<n.length;r++)e.lineTo(n[r].x,n[r].y);e.closePath(),e.fillStrokeShape(this)}_getPoints(){const e=this.attrs.sides,n=this.attrs.radius||0,r=[];for(let i=0;i<e;i++)r.push({x:n*Math.sin(i*2*Math.PI/e),y:-1*n*Math.cos(i*2*Math.PI/e)});return r}getSelfRect(){const e=this._getPoints();let n=e[0].x,r=e[0].y,i=e[0].x,o=e[0].y;return e.forEach(a=>{n=Math.min(n,a.x),r=Math.max(r,a.x),i=Math.min(i,a.y),o=Math.max(o,a.y)}),{x:n,y:i,width:r-n,height:o-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}};yp.RegularPolygon=Pl;Pl.prototype.className="RegularPolygon";Pl.prototype._centroid=!0;Pl.prototype._attrsAffectingSize=["radius"];(0,XT._registerNode)(Pl);y9.Factory.addGetterSetter(Pl,"radius",0,(0,b9.getNumberValidator)());y9.Factory.addGetterSetter(Pl,"sides",0,(0,b9.getNumberValidator)());var bp={};Object.defineProperty(bp,"__esModule",{value:!0});bp.Ring=void 0;const _9=ut,ZT=En,w9=Ze,QT=st,G5=Math.PI*2;let Cl=class extends ZT.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,G5,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),G5,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}};bp.Ring=Cl;Cl.prototype.className="Ring";Cl.prototype._centroid=!0;Cl.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,QT._registerNode)(Cl);_9.Factory.addGetterSetter(Cl,"innerRadius",0,(0,w9.getNumberValidator)());_9.Factory.addGetterSetter(Cl,"outerRadius",0,(0,w9.getNumberValidator)());var _p={};Object.defineProperty(_p,"__esModule",{value:!0});_p.Sprite=void 0;const kl=ut,JT=En,eA=eu,S9=Ze,tA=st;let eo=class extends JT.Shape{constructor(e){super(e),this._updated=!0,this.anim=new eA.Animation(()=>{const n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(e){const n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),l=o[i+0],s=o[i+1],f=o[i+2],h=o[i+3],x=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,f,h),e.closePath(),e.fillStrokeShape(this)),x)if(a){const w=a[n],v=r*2;e.drawImage(x,l,s,f,h,w[v+0],w[v+1],f,h)}else e.drawImage(x,l,s,f,h,0,0,f,h)}_hitFunc(e){const n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),l=o[i+2],s=o[i+3];if(e.beginPath(),a){const f=a[n],h=r*2;e.rect(f[h+0],f[h+1],l,s)}else e.rect(0,0,l,s);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const e=this;this.interval=setInterval(function(){e._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const e=this.frameIndex(),n=this.animation(),r=this.animations(),i=r[n],o=i.length/4;e<o-1?this.frameIndex(e+1):this.frameIndex(0)}};_p.Sprite=eo;eo.prototype.className="Sprite";(0,tA._registerNode)(eo);kl.Factory.addGetterSetter(eo,"animation");kl.Factory.addGetterSetter(eo,"animations");kl.Factory.addGetterSetter(eo,"frameOffsets");kl.Factory.addGetterSetter(eo,"image");kl.Factory.addGetterSetter(eo,"frameIndex",0,(0,S9.getNumberValidator)());kl.Factory.addGetterSetter(eo,"frameRate",17,(0,S9.getNumberValidator)());kl.Factory.backCompat(eo,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var wp={};Object.defineProperty(wp,"__esModule",{value:!0});wp.Star=void 0;const Hy=ut,nA=En,$y=Ze,rA=st;let Aa=class extends nA.Shape{_sceneFunc(e){const n=this.innerRadius(),r=this.outerRadius(),i=this.numPoints();e.beginPath(),e.moveTo(0,0-r);for(let o=1;o<i*2;o++){const a=o%2===0?r:n,l=a*Math.sin(o*Math.PI/i),s=-1*a*Math.cos(o*Math.PI/i);e.lineTo(l,s)}e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}};wp.Star=Aa;Aa.prototype.className="Star";Aa.prototype._centroid=!0;Aa.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,rA._registerNode)(Aa);Hy.Factory.addGetterSetter(Aa,"numPoints",5,(0,$y.getNumberValidator)());Hy.Factory.addGetterSetter(Aa,"innerRadius",0,(0,$y.getNumberValidator)());Hy.Factory.addGetterSetter(Aa,"outerRadius",0,(0,$y.getNumberValidator)());var ru={};Object.defineProperty(ru,"__esModule",{value:!0});ru.Text=void 0;ru.stringToArray=E9;const hm=en,Xn=ut,iA=En,K1=st,Ra=Ze,oA=st;function E9(t){return[...t].reduce((e,n,r,i)=>(new RegExp("\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?(?:\\u200D\\p{Emoji_Presentation})+","u").test(n)?e.push(n):new RegExp("\\p{Regional_Indicator}{2}","u").test(n+(i[r+1]||""))?e.push(n+i[r+1]):r>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(n)?e[e.length-1]+=n:e.push(n),e),[])}const es="auto",aA="center",O9="inherit",Fu="justify",lA="Change.konva",sA="2d",V5="-",x9="left",uA="text",cA="Text",fA="top",dA="bottom",q5="middle",P9="normal",hA="px ",yd=" ",pA="right",W5="rtl",gA="word",vA="char",Y5="none",X1="…",C9=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],mA=C9.length;function yA(t){return t.split(",").map(e=>{e=e.trim();const n=e.indexOf(" ")>=0,r=e.indexOf('"')>=0||e.indexOf("'")>=0;return n&&!r&&(e=`"${e}"`),e}).join(", ")}let bd;function Z1(){return bd||(bd=hm.Util.createCanvasElement().getContext(sA),bd)}function bA(t){t.fillText(this._partialText,this._partialTextX,this._partialTextY)}function _A(t){t.setAttr("miterLimit",2),t.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function wA(t){return t=t||{},!t.fillLinearGradientColorStops&&!t.fillRadialGradientColorStops&&!t.fillPatternImage&&(t.fill=t.fill||"black"),t}let on=class extends iA.Shape{constructor(e){super(wA(e)),this._partialTextX=0,this._partialTextY=0;for(let n=0;n<mA;n++)this.on(C9[n]+lA,this._setTextData);this._setTextData()}_sceneFunc(e){const n=this.textArr,r=n.length;if(!this.text())return;let i=this.padding(),o=this.fontSize(),a=this.lineHeight()*o,l=this.verticalAlign(),s=this.direction(),f=0,h=this.align(),x=this.getWidth(),w=this.letterSpacing(),v=this.fill(),O=this.textDecoration(),g=O.indexOf("underline")!==-1,b=O.indexOf("line-through")!==-1,p;s=s===O9?e.direction:s;let y=a/2,d=q5;if(K1.Konva._fixTextRendering){const N=this.measureSize("M");d="alphabetic",y=(N.fontBoundingBoxAscent-N.fontBoundingBoxDescent)/2+a/2}var m=0,_=0;for(s===W5&&e.setAttr("direction",s),e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",d),e.setAttr("textAlign",x9),l===q5?f=(this.getHeight()-r*a-i*2)/2:l===dA&&(f=this.getHeight()-r*a-i*2),e.translate(i,f+i),p=0;p<r;p++){var m=0,_=0,A=n[p],C=A.text,R=A.width,S=A.lastInParagraph,E,P,T;if(e.save(),h===pA?m+=x-R-i*2:h===aA&&(m+=(x-R-i*2)/2),g){e.save(),e.beginPath();const G=K1.Konva._fixTextRendering?Math.round(o/4):Math.round(o/2),Z=m,W=y+_+G;e.moveTo(Z,W),E=C.split(" ").length-1,P=E===0,T=h===Fu&&!S?x-i*2:R,e.lineTo(Z+Math.round(T),W),e.lineWidth=o/15;const H=this._getLinearGradient();e.strokeStyle=H||v,e.stroke(),e.restore()}if(b){e.save(),e.beginPath();const G=K1.Konva._fixTextRendering?-Math.round(o/4):0;e.moveTo(m,y+_+G),E=C.split(" ").length-1,P=E===0,T=h===Fu&&S&&!P?x-i*2:R,e.lineTo(m+Math.round(T),y+_+G),e.lineWidth=o/15;const Z=this._getLinearGradient();e.strokeStyle=Z||v,e.stroke(),e.restore()}if(s!==W5&&(w!==0||h===Fu)){E=C.split(" ").length-1;const G=E9(C);for(let Z=0;Z<G.length;Z++){const W=G[Z];W===" "&&!S&&h===Fu&&(m+=(x-i*2-R)/E),this._partialTextX=m,this._partialTextY=y+_,this._partialText=W,e.fillStrokeShape(this),m+=this.measureSize(W).width+w}}else w!==0&&e.setAttr("letterSpacing",`${w}px`),this._partialTextX=m,this._partialTextY=y+_,this._partialText=C,e.fillStrokeShape(this);e.restore(),r>1&&(y+=a)}}_hitFunc(e){const n=this.getWidth(),r=this.getHeight();e.beginPath(),e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)}setText(e){const n=hm.Util._isString(e)?e:e==null?"":e+"";return this._setAttr(uA,n),this}getWidth(){return this.attrs.width===es||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===es||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return hm.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var n,r,i,o,a,l,s,f,h,x,w;let v=Z1(),O=this.fontSize(),g;v.save(),v.font=this._getContextFont(),g=v.measureText(e),v.restore();const b=O/100;return{actualBoundingBoxAscent:(n=g.actualBoundingBoxAscent)!==null&&n!==void 0?n:71.58203125*b,actualBoundingBoxDescent:(r=g.actualBoundingBoxDescent)!==null&&r!==void 0?r:0,actualBoundingBoxLeft:(i=g.actualBoundingBoxLeft)!==null&&i!==void 0?i:-7.421875*b,actualBoundingBoxRight:(o=g.actualBoundingBoxRight)!==null&&o!==void 0?o:75.732421875*b,alphabeticBaseline:(a=g.alphabeticBaseline)!==null&&a!==void 0?a:0,emHeightAscent:(l=g.emHeightAscent)!==null&&l!==void 0?l:100*b,emHeightDescent:(s=g.emHeightDescent)!==null&&s!==void 0?s:-20*b,fontBoundingBoxAscent:(f=g.fontBoundingBoxAscent)!==null&&f!==void 0?f:91*b,fontBoundingBoxDescent:(h=g.fontBoundingBoxDescent)!==null&&h!==void 0?h:21*b,hangingBaseline:(x=g.hangingBaseline)!==null&&x!==void 0?x:72.80000305175781*b,ideographicBaseline:(w=g.ideographicBaseline)!==null&&w!==void 0?w:-21*b,width:g.width,height:O}}_getContextFont(){return this.fontStyle()+yd+this.fontVariant()+yd+(this.fontSize()+hA)+yA(this.fontFamily())}_addTextLine(e){this.align()===Fu&&(e=e.trim());const r=this._getTextWidth(e);return this.textArr.push({text:e,width:r,lastInParagraph:!1})}_getTextWidth(e){const n=this.letterSpacing(),r=e.length;return Z1().measureText(e).width+(r?n*(r-1):0)}_setTextData(){let e=this.text().split(`
|
|
43
43
|
`),n=+this.fontSize(),r=0,i=this.lineHeight()*n,o=this.attrs.width,a=this.attrs.height,l=o!==es&&o!==void 0,s=a!==es&&a!==void 0,f=this.padding(),h=o-f*2,x=a-f*2,w=0,v=this.wrap(),O=v!==Y5,g=v!==vA&&O,b=this.ellipsis();this.textArr=[],Z1().font=this._getContextFont();const p=b?this._getTextWidth(X1):0;for(let d=0,m=e.length;d<m;++d){let _=e[d],A=this._getTextWidth(_);if(l&&A>h)for(;_.length>0;){let C=0,R=_.length,S="",E=0;for(;C<R;){const P=C+R>>>1,T=_.slice(0,P+1),N=this._getTextWidth(T)+p;N<=h?(C=P+1,S=T,E=N):R=P}if(S){if(g){var y;const T=_[S.length];(T===yd||T===V5)&&E<=h?y=S.length:y=Math.max(S.lastIndexOf(yd),S.lastIndexOf(V5))+1,y>0&&(C=y,S=S.slice(0,C),E=this._getTextWidth(S))}if(S=S.trimRight(),this._addTextLine(S),r=Math.max(r,E),w+=i,this._shouldHandleEllipsis(w)){this._tryToAddEllipsisToLastLine();break}if(_=_.slice(C),_=_.trimLeft(),_.length>0&&(A=this._getTextWidth(_),A<=h)){this._addTextLine(_),w+=i,r=Math.max(r,A);break}}else break}else this._addTextLine(_),w+=i,r=Math.max(r,A),this._shouldHandleEllipsis(w)&&d<m-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),s&&w+i>x)break}this.textHeight=n,this.textWidth=r}_shouldHandleEllipsis(e){const n=+this.fontSize(),r=this.lineHeight()*n,i=this.attrs.height,o=i!==es&&i!==void 0,a=this.padding(),l=i-a*2;return!(this.wrap()!==Y5)||o&&e+r>l}_tryToAddEllipsisToLastLine(){const e=this.attrs.width,n=e!==es&&e!==void 0,r=this.padding(),i=e-r*2,o=this.ellipsis(),a=this.textArr[this.textArr.length-1];!a||!o||(n&&(this._getTextWidth(a.text+X1)<i||(a.text=a.text.slice(0,a.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(a.text+X1))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const e=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,n=this.hasShadow();return e&&n?!0:super._useBufferCanvas()}};ru.Text=on;on.prototype._fillFunc=bA;on.prototype._strokeFunc=_A;on.prototype.className=cA;on.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];(0,oA._registerNode)(on);Xn.Factory.overWriteSetter(on,"width",(0,Ra.getNumberOrAutoValidator)());Xn.Factory.overWriteSetter(on,"height",(0,Ra.getNumberOrAutoValidator)());Xn.Factory.addGetterSetter(on,"direction",O9);Xn.Factory.addGetterSetter(on,"fontFamily","Arial");Xn.Factory.addGetterSetter(on,"fontSize",12,(0,Ra.getNumberValidator)());Xn.Factory.addGetterSetter(on,"fontStyle",P9);Xn.Factory.addGetterSetter(on,"fontVariant",P9);Xn.Factory.addGetterSetter(on,"padding",0,(0,Ra.getNumberValidator)());Xn.Factory.addGetterSetter(on,"align",x9);Xn.Factory.addGetterSetter(on,"verticalAlign",fA);Xn.Factory.addGetterSetter(on,"lineHeight",1,(0,Ra.getNumberValidator)());Xn.Factory.addGetterSetter(on,"wrap",gA);Xn.Factory.addGetterSetter(on,"ellipsis",!1,(0,Ra.getBooleanValidator)());Xn.Factory.addGetterSetter(on,"letterSpacing",0,(0,Ra.getNumberValidator)());Xn.Factory.addGetterSetter(on,"text","",(0,Ra.getStringValidator)());Xn.Factory.addGetterSetter(on,"textDecoration","");var Sp={};Object.defineProperty(Sp,"__esModule",{value:!0});Sp.TextPath=void 0;const Q1=en,Ci=ut,SA=En,zu=tu,J1=ru,k9=Ze,EA=st,OA="",T9="normal";function A9(t){t.fillText(this.partialText,0,0)}function R9(t){t.strokeText(this.partialText,0,0)}let On=class extends SA.Shape{constructor(e){super(e),this.dummyCanvas=Q1.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 zu.Path.getPathLength(this.dataArray)}_getPointAtLength(e){if(!this.attrs.data)return null;const n=this.pathLength;return e-1>n?null:zu.Path.getPointAtLengthOfDataArray(e,this.dataArray)}_readDataAttribute(){this.dataArray=zu.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(e){e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",this.textBaseline()),e.setAttr("textAlign","left"),e.save();const n=this.textDecoration(),r=this.fill(),i=this.fontSize(),o=this.glyphInfo;n==="underline"&&e.beginPath();for(let a=0;a<o.length;a++){e.save();const l=o[a].p0;e.translate(l.x,l.y),e.rotate(o[a].rotation),this.partialText=o[a].text,e.fillStrokeShape(this),n==="underline"&&(a===0&&e.moveTo(0,i/2+1),e.lineTo(i,i/2+1)),e.restore()}n==="underline"&&(e.strokeStyle=r,e.lineWidth=i/20,e.stroke()),e.restore()}_hitFunc(e){e.beginPath();const n=this.glyphInfo;if(n.length>=1){const r=n[0].p0;e.moveTo(r.x,r.y)}for(let r=0;r<n.length;r++){const i=n[r].p1;e.lineTo(i.x,i.y)}e.setAttr("lineWidth",this.fontSize()),e.setAttr("strokeStyle",this.colorKey),e.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return Q1.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(e){return J1.Text.prototype.setText.call(this,e)}_getContextFont(){return J1.Text.prototype._getContextFont.call(this)}_getTextSize(e){const r=this.dummyCanvas.getContext("2d");r.save(),r.font=this._getContextFont();const i=r.measureText(e);return r.restore(),{width:i.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:e,height:n}=this._getTextSize(this.attrs.text);if(this.textWidth=e,this.textHeight=n,this.glyphInfo=[],!this.attrs.data)return null;const r=this.letterSpacing(),i=this.align(),o=this.kerningFunc(),a=Math.max(this.textWidth+((this.attrs.text||"").length-1)*r,0);let l=0;i==="center"&&(l=Math.max(0,this.pathLength/2-a/2)),i==="right"&&(l=Math.max(0,this.pathLength-a));const s=(0,J1.stringToArray)(this.text());let f=l;for(let h=0;h<s.length;h++){const x=this._getPointAtLength(f);if(!x)return;let w=this._getTextSize(s[h]).width+r;if(s[h]===" "&&i==="justify"){const y=this.text().split(" ").length-1;w+=(this.pathLength-a)/y}const v=this._getPointAtLength(f+w);if(!v)return;const O=zu.Path.getLineLength(x.x,x.y,v.x,v.y);let g=0;if(o)try{g=o(s[h-1],s[h])*this.fontSize()}catch{g=0}x.x+=g,v.x+=g,this.textWidth+=g;const b=zu.Path.getPointOnLine(g+O/2,x.x,x.y,v.x,v.y),p=Math.atan2(v.y-x.y,v.x-x.x);this.glyphInfo.push({transposeX:b.x,transposeY:b.y,text:s[h],rotation:p,p0:x,p1:v}),f+=w}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const e=[];this.glyphInfo.forEach(function(f){e.push(f.p0.x),e.push(f.p0.y),e.push(f.p1.x),e.push(f.p1.y)});let n=e[0]||0,r=e[0]||0,i=e[1]||0,o=e[1]||0,a,l;for(let f=0;f<e.length/2;f++)a=e[f*2],l=e[f*2+1],n=Math.min(n,a),r=Math.max(r,a),i=Math.min(i,l),o=Math.max(o,l);const s=this.fontSize();return{x:n-s/2,y:i-s/2,width:r-n+s,height:o-i+s}}destroy(){return Q1.Util.releaseCanvas(this.dummyCanvas),super.destroy()}};Sp.TextPath=On;On.prototype._fillFunc=A9;On.prototype._strokeFunc=R9;On.prototype._fillFuncHit=A9;On.prototype._strokeFuncHit=R9;On.prototype.className="TextPath";On.prototype._attrsAffectingSize=["text","fontSize","data"];(0,EA._registerNode)(On);Ci.Factory.addGetterSetter(On,"data");Ci.Factory.addGetterSetter(On,"fontFamily","Arial");Ci.Factory.addGetterSetter(On,"fontSize",12,(0,k9.getNumberValidator)());Ci.Factory.addGetterSetter(On,"fontStyle",T9);Ci.Factory.addGetterSetter(On,"align","left");Ci.Factory.addGetterSetter(On,"letterSpacing",0,(0,k9.getNumberValidator)());Ci.Factory.addGetterSetter(On,"textBaseline","middle");Ci.Factory.addGetterSetter(On,"fontVariant",T9);Ci.Factory.addGetterSetter(On,"text",OA);Ci.Factory.addGetterSetter(On,"textDecoration",null);Ci.Factory.addGetterSetter(On,"kerningFunc",null);var Ep={};Object.defineProperty(Ep,"__esModule",{value:!0});Ep.Transformer=void 0;const At=en,Et=ut,K5=qt,xA=En,PA=Zc,X5=Js,fi=st,Ma=Ze,CA=st,M9="tr-konva",kA=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(t=>t+`.${M9}`).join(" "),Z5="nodesRect",TA=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],AA={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},RA="ontouchstart"in fi.Konva._global;function MA(t,e,n){if(t==="rotater")return n;e+=At.Util.degToRad(AA[t]||0);const r=(At.Util.radToDeg(e)%360+360)%360;return At.Util._inRange(r,315+22.5,360)||At.Util._inRange(r,0,22.5)?"ns-resize":At.Util._inRange(r,45-22.5,45+22.5)?"nesw-resize":At.Util._inRange(r,90-22.5,90+22.5)?"ew-resize":At.Util._inRange(r,135-22.5,135+22.5)?"nwse-resize":At.Util._inRange(r,180-22.5,180+22.5)?"ns-resize":At.Util._inRange(r,225-22.5,225+22.5)?"nesw-resize":At.Util._inRange(r,270-22.5,270+22.5)?"ew-resize":At.Util._inRange(r,315-22.5,315+22.5)?"nwse-resize":(At.Util.error("Transformer has unknown angle for cursor detection: "+r),"pointer")}const wh=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],Q5=1e8;function LA(t){return{x:t.x+t.width/2*Math.cos(t.rotation)+t.height/2*Math.sin(-t.rotation),y:t.y+t.height/2*Math.cos(t.rotation)+t.width/2*Math.sin(t.rotation)}}function L9(t,e,n){const r=n.x+(t.x-n.x)*Math.cos(e)-(t.y-n.y)*Math.sin(e),i=n.y+(t.x-n.x)*Math.sin(e)+(t.y-n.y)*Math.cos(e);return{...t,rotation:t.rotation+e,x:r,y:i}}function NA(t,e){const n=LA(t);return L9(t,e,n)}function IA(t,e,n){let r=e;for(let i=0;i<t.length;i++){const o=fi.Konva.getAngle(t[i]),a=Math.abs(o-e)%(Math.PI*2);Math.min(a,Math.PI*2-a)<n&&(r=o)}return r}let pm=0,gt=class extends X5.Group{constructor(e){super(e),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(kA,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return At.Util.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return M9+this._id}setNodes(e=[]){this._nodes&&this._nodes.length&&this.detach();const n=e.filter(i=>i.isAncestorOf(this)?(At.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=e=n,e.length===1&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(i=>{const o=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},a=i._attrsAffectingSize.map(l=>l+"Change."+this._getEventNamespace()).join(" ");i.on(a,o),i.on(TA.map(l=>l+`.${this._getEventNamespace()}`).join(" "),o),i.on(`absoluteTransformChange.${this._getEventNamespace()}`,o),this._proxyDrag(i)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(e){let n;e.on(`dragstart.${this._getEventNamespace()}`,r=>{n=e.getAbsolutePosition(),!this.isDragging()&&e!==this.findOne(".back")&&this.startDrag(r,!1)}),e.on(`dragmove.${this._getEventNamespace()}`,r=>{if(!n)return;const i=e.getAbsolutePosition(),o=i.x-n.x,a=i.y-n.y;this.nodes().forEach(l=>{if(l===e||l.isDragging())return;const s=l.getAbsolutePosition();l.setAbsolutePosition({x:s.x+o,y:s.y+a}),l.startDrag(r)}),n=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(e=>{e.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(Z5),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(Z5,this.__getNodeRect)}__getNodeShape(e,n=this.rotation(),r){const i=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=e.getAbsoluteScale(r),a=e.getAbsolutePosition(r),l=i.x*o.x-e.offsetX()*o.x,s=i.y*o.y-e.offsetY()*o.y,f=(fi.Konva.getAngle(e.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),h={x:a.x+l*Math.cos(f)+s*Math.sin(-f),y:a.y+s*Math.cos(f)+l*Math.sin(f),width:i.width*o.x,height:i.height*o.y,rotation:f};return L9(h,-fi.Konva.getAngle(n),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-Q5,y:-Q5,width:0,height:0,rotation:0};const n=[];this.nodes().map(f=>{const h=f.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),x=[{x:h.x,y:h.y},{x:h.x+h.width,y:h.y},{x:h.x+h.width,y:h.y+h.height},{x:h.x,y:h.y+h.height}],w=f.getAbsoluteTransform();x.forEach(function(v){const O=w.point(v);n.push(O)})});const r=new At.Transform;r.rotate(-fi.Konva.getAngle(this.rotation()));let i=1/0,o=1/0,a=-1/0,l=-1/0;n.forEach(function(f){const h=r.point(f);i===void 0&&(i=a=h.x,o=l=h.y),i=Math.min(i,h.x),o=Math.min(o,h.y),a=Math.max(a,h.x),l=Math.max(l,h.y)}),r.invert();const s=r.point({x:i,y:o});return{x:s.x,y:s.y,width:a-i,height:l-o,rotation:fi.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(),wh.forEach(e=>{this._createAnchor(e)}),this._createAnchor("rotater")}_createAnchor(e){const n=new PA.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:RA?10:"auto"}),r=this;n.on("mousedown touchstart",function(i){r._handleMouseDown(i)}),n.on("dragstart",i=>{n.stopDrag(),i.cancelBubble=!0}),n.on("dragend",i=>{i.cancelBubble=!0}),n.on("mouseenter",()=>{const i=fi.Konva.getAngle(this.rotation()),o=this.rotateAnchorCursor(),a=MA(e,i,o);n.getStage().content&&(n.getStage().content.style.cursor=a),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){const e=new xA.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(n,r){const i=r.getParent(),o=i.padding();n.beginPath(),n.rect(-o,-o,r.width()+o*2,r.height()+o*2),n.moveTo(r.width()/2,-o),i.rotateEnabled()&&i.rotateLineVisible()&&n.lineTo(r.width()/2,-i.rotateAnchorOffset()*At.Util._sign(r.height())-o),n.fillStrokeShape(r)},hitFunc:(n,r)=>{if(!this.shouldOverdrawWholeArea())return;const i=this.padding();n.beginPath(),n.rect(-i,-i,r.width()+i*2,r.height()+i*2),n.fillStrokeShape(r)}});this.add(e),this._proxyDrag(e),e.on("dragstart",n=>{n.cancelBubble=!0}),e.on("dragmove",n=>{n.cancelBubble=!0}),e.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(e){if(this._transforming)return;this._movingAnchorName=e.target.name().split(" ")[0];const n=this._getNodeRect(),r=n.width,i=n.height,o=Math.sqrt(Math.pow(r,2)+Math.pow(i,2));this.sin=Math.abs(i/o),this.cos=Math.abs(r/o),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 a=e.target.getAbsolutePosition(),l=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:l.x-a.x,y:l.y-a.y},pm++,this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach(s=>{s._fire("transformstart",{evt:e.evt,target:s})})}_handleMouseMove(e){let n,r,i;const o=this.findOne("."+this._movingAnchorName),a=o.getStage();a.setPointersPositions(e);const l=a.getPointerPosition();let s={x:l.x-this._anchorDragOffset.x,y:l.y-this._anchorDragOffset.y};const f=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(s=this.anchorDragBoundFunc()(f,s,e)),o.setAbsolutePosition(s);const h=o.getAbsolutePosition();if(f.x===h.x&&f.y===h.y)return;if(this._movingAnchorName==="rotater"){const _=this._getNodeRect();n=o.x()-_.width/2,r=-o.y()+_.height/2;let A=Math.atan2(-r,n)+Math.PI/2;_.height<0&&(A-=Math.PI);const R=fi.Konva.getAngle(this.rotation())+A,S=fi.Konva.getAngle(this.rotationSnapTolerance()),P=IA(this.rotationSnaps(),R,S)-_.rotation,T=NA(_,P);this._fitNodesInto(T,e);return}const x=this.shiftBehavior();let w;x==="inverted"?w=this.keepRatio()&&!e.shiftKey:x==="none"?w=this.keepRatio():w=this.keepRatio()||e.shiftKey;var p=this.centeredScaling()||e.altKey;if(this._movingAnchorName==="top-left"){if(w){var v=p?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(v.x-o.x(),2)+Math.pow(v.y-o.y(),2));var O=this.findOne(".top-left").x()>v.x?-1:1,g=this.findOne(".top-left").y()>v.y?-1:1;n=i*this.cos*O,r=i*this.sin*g,this.findOne(".top-left").x(v.x-n),this.findOne(".top-left").y(v.y-r)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(o.y());else if(this._movingAnchorName==="top-right"){if(w){var v=p?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(o.x()-v.x,2)+Math.pow(v.y-o.y(),2));var O=this.findOne(".top-right").x()<v.x?-1:1,g=this.findOne(".top-right").y()>v.y?-1:1;n=i*this.cos*O,r=i*this.sin*g,this.findOne(".top-right").x(v.x+n),this.findOne(".top-right").y(v.y-r)}var b=o.position();this.findOne(".top-left").y(b.y),this.findOne(".bottom-right").x(b.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(o.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(o.x());else if(this._movingAnchorName==="bottom-left"){if(w){var v=p?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(v.x-o.x(),2)+Math.pow(o.y()-v.y,2));var O=v.x<o.x()?-1:1,g=o.y()<v.y?-1:1;n=i*this.cos*O,r=i*this.sin*g,o.x(v.x-n),o.y(v.y+r)}b=o.position(),this.findOne(".top-left").x(b.x),this.findOne(".bottom-right").y(b.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(o.y());else if(this._movingAnchorName==="bottom-right"){if(w){var v=p?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};i=Math.sqrt(Math.pow(o.x()-v.x,2)+Math.pow(o.y()-v.y,2));var O=this.findOne(".bottom-right").x()<v.x?-1:1,g=this.findOne(".bottom-right").y()<v.y?-1:1;n=i*this.cos*O,r=i*this.sin*g,this.findOne(".bottom-right").x(v.x+n),this.findOne(".bottom-right").y(v.y+r)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var p=this.centeredScaling()||e.altKey;if(p){const _=this.findOne(".top-left"),A=this.findOne(".bottom-right"),C=_.x(),R=_.y(),S=this.getWidth()-A.x(),E=this.getHeight()-A.y();A.move({x:-C,y:-R}),_.move({x:S,y:E})}const y=this.findOne(".top-left").getAbsolutePosition();n=y.x,r=y.y;const d=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),m=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:n,y:r,width:d,height:m,rotation:fi.Konva.getAngle(this.rotation())},e)}_handleMouseUp(e){this._removeEvents(e)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(e){var n;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 r=this.getNode();pm--,this._fire("transformend",{evt:e,target:r}),(n=this.getLayer())===null||n===void 0||n.batchDraw(),r&&this._nodes.forEach(i=>{var o;i._fire("transformend",{evt:e,target:i}),(o=i.getLayer())===null||o===void 0||o.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(e,n){const r=this._getNodeRect(),i=1;if(At.Util._inRange(e.width,-this.padding()*2-i,i)){this.update();return}if(At.Util._inRange(e.height,-this.padding()*2-i,i)){this.update();return}const o=new At.Transform;if(o.rotate(fi.Konva.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){const w=o.point({x:-this.padding()*2,y:0});e.x+=w.x,e.y+=w.y,e.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=w.x,this._anchorDragOffset.y-=w.y}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){const w=o.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=w.x,this._anchorDragOffset.y-=w.y,e.width+=this.padding()*2}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){const w=o.point({x:0,y:-this.padding()*2});e.x+=w.x,e.y+=w.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=w.x,this._anchorDragOffset.y-=w.y,e.height+=this.padding()*2}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const w=o.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=w.x,this._anchorDragOffset.y-=w.y,e.height+=this.padding()*2}if(this.boundBoxFunc()){const w=this.boundBoxFunc()(r,e);w?e=w:At.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const a=1e7,l=new At.Transform;l.translate(r.x,r.y),l.rotate(r.rotation),l.scale(r.width/a,r.height/a);const s=new At.Transform,f=e.width/a,h=e.height/a;this.flipEnabled()===!1?(s.translate(e.x,e.y),s.rotate(e.rotation),s.translate(e.width<0?e.width:0,e.height<0?e.height:0),s.scale(Math.abs(f),Math.abs(h))):(s.translate(e.x,e.y),s.rotate(e.rotation),s.scale(f,h));const x=s.multiply(l.invert());this._nodes.forEach(w=>{var v;const O=w.getParent().getAbsoluteTransform(),g=w.getTransform().copy();g.translate(w.offsetX(),w.offsetY());const b=new At.Transform;b.multiply(O.copy().invert()).multiply(x).multiply(O).multiply(g);const p=b.decompose();w.setAttrs(p),(v=w.getLayer())===null||v===void 0||v.batchDraw()}),this.rotation(At.Util._getRotation(e.rotation)),this._nodes.forEach(w=>{this._fire("transform",{evt:n,target:w}),w._fire("transform",{evt:n,target:w})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,n){this.findOne(e).setAttrs(n)}update(){var e;const n=this._getNodeRect();this.rotation(At.Util._getRotation(n.rotation));const r=n.width,i=n.height,o=this.enabledAnchors(),a=this.resizeEnabled(),l=this.padding(),s=this.anchorSize(),f=this.find("._anchor");f.forEach(x=>{x.setAttrs({width:s,height:s,offsetX:s/2,offsetY:s/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:s/2+l,offsetY:s/2+l,visible:a&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:r/2,y:0,offsetY:s/2+l,visible:a&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:r,y:0,offsetX:s/2-l,offsetY:s/2+l,visible:a&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:s/2+l,visible:a&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:r,y:i/2,offsetX:s/2-l,visible:a&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:s/2+l,offsetY:s/2-l,visible:a&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:r/2,y:i,offsetY:s/2-l,visible:a&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:r,y:i,offsetX:s/2-l,offsetY:s/2-l,visible:a&&o.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:r/2,y:-this.rotateAnchorOffset()*At.Util._sign(i)-l,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:r,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const h=this.anchorStyleFunc();h&&f.forEach(x=>{h(x)}),(e=this.getLayer())===null||e===void 0||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const e=this.findOne("."+this._movingAnchorName);e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),X5.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return K5.Node.prototype.toObject.call(this)}clone(e){return K5.Node.prototype.clone.call(this,e)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};Ep.Transformer=gt;gt.isTransforming=()=>pm>0;function DA(t){return t instanceof Array||At.Util.warn("enabledAnchors value should be an array"),t instanceof Array&&t.forEach(function(e){wh.indexOf(e)===-1&&At.Util.warn("Unknown anchor name: "+e+". Available names are: "+wh.join(", "))}),t||[]}gt.prototype.className="Transformer";(0,CA._registerNode)(gt);Et.Factory.addGetterSetter(gt,"enabledAnchors",wh,DA);Et.Factory.addGetterSetter(gt,"flipEnabled",!0,(0,Ma.getBooleanValidator)());Et.Factory.addGetterSetter(gt,"resizeEnabled",!0);Et.Factory.addGetterSetter(gt,"anchorSize",10,(0,Ma.getNumberValidator)());Et.Factory.addGetterSetter(gt,"rotateEnabled",!0);Et.Factory.addGetterSetter(gt,"rotateLineVisible",!0);Et.Factory.addGetterSetter(gt,"rotationSnaps",[]);Et.Factory.addGetterSetter(gt,"rotateAnchorOffset",50,(0,Ma.getNumberValidator)());Et.Factory.addGetterSetter(gt,"rotateAnchorCursor","crosshair");Et.Factory.addGetterSetter(gt,"rotationSnapTolerance",5,(0,Ma.getNumberValidator)());Et.Factory.addGetterSetter(gt,"borderEnabled",!0);Et.Factory.addGetterSetter(gt,"anchorStroke","rgb(0, 161, 255)");Et.Factory.addGetterSetter(gt,"anchorStrokeWidth",1,(0,Ma.getNumberValidator)());Et.Factory.addGetterSetter(gt,"anchorFill","white");Et.Factory.addGetterSetter(gt,"anchorCornerRadius",0,(0,Ma.getNumberValidator)());Et.Factory.addGetterSetter(gt,"borderStroke","rgb(0, 161, 255)");Et.Factory.addGetterSetter(gt,"borderStrokeWidth",1,(0,Ma.getNumberValidator)());Et.Factory.addGetterSetter(gt,"borderDash");Et.Factory.addGetterSetter(gt,"keepRatio",!0);Et.Factory.addGetterSetter(gt,"shiftBehavior","default");Et.Factory.addGetterSetter(gt,"centeredScaling",!1);Et.Factory.addGetterSetter(gt,"ignoreStroke",!1);Et.Factory.addGetterSetter(gt,"padding",0,(0,Ma.getNumberValidator)());Et.Factory.addGetterSetter(gt,"node");Et.Factory.addGetterSetter(gt,"nodes");Et.Factory.addGetterSetter(gt,"boundBoxFunc");Et.Factory.addGetterSetter(gt,"anchorDragBoundFunc");Et.Factory.addGetterSetter(gt,"anchorStyleFunc");Et.Factory.addGetterSetter(gt,"shouldOverdrawWholeArea",!1);Et.Factory.addGetterSetter(gt,"useSingleNodeRotation",!0);Et.Factory.backCompat(gt,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var Op={};Object.defineProperty(Op,"__esModule",{value:!0});Op.Wedge=void 0;const xp=ut,jA=En,FA=st,N9=Ze,zA=st;let No=class extends jA.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,FA.Konva.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}};Op.Wedge=No;No.prototype.className="Wedge";No.prototype._centroid=!0;No.prototype._attrsAffectingSize=["radius"];(0,zA._registerNode)(No);xp.Factory.addGetterSetter(No,"radius",0,(0,N9.getNumberValidator)());xp.Factory.addGetterSetter(No,"angle",0,(0,N9.getNumberValidator)());xp.Factory.addGetterSetter(No,"clockwise",!1);xp.Factory.backCompat(No,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var Pp={};Object.defineProperty(Pp,"__esModule",{value:!0});Pp.Blur=void 0;const J5=ut,BA=qt,UA=Ze;function e4(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const HA=[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],$A=[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 GA(t,e){const n=t.data,r=t.width,i=t.height;let o,a,l,s,f,h,x,w,v,O,g,b,p,y,d,m,_,A,C,R,S,E,P,T,N=e+e+1,U=r-1,G=i-1,Z=e+1,W=Z*(Z+1)/2,H=new e4,L=null,M=H,D=null,B=null,V=HA[e],Y=$A[e];for(l=1;l<N;l++)M=M.next=new e4,l===Z&&(L=M);for(M.next=H,x=h=0,a=0;a<i;a++){for(m=_=A=C=w=v=O=g=0,b=Z*(R=n[h]),p=Z*(S=n[h+1]),y=Z*(E=n[h+2]),d=Z*(P=n[h+3]),w+=W*R,v+=W*S,O+=W*E,g+=W*P,M=H,l=0;l<Z;l++)M.r=R,M.g=S,M.b=E,M.a=P,M=M.next;for(l=1;l<Z;l++)s=h+((U<l?U:l)<<2),w+=(M.r=R=n[s])*(T=Z-l),v+=(M.g=S=n[s+1])*T,O+=(M.b=E=n[s+2])*T,g+=(M.a=P=n[s+3])*T,m+=R,_+=S,A+=E,C+=P,M=M.next;for(D=H,B=L,o=0;o<r;o++)n[h+3]=P=g*V>>Y,P!==0?(P=255/P,n[h]=(w*V>>Y)*P,n[h+1]=(v*V>>Y)*P,n[h+2]=(O*V>>Y)*P):n[h]=n[h+1]=n[h+2]=0,w-=b,v-=p,O-=y,g-=d,b-=D.r,p-=D.g,y-=D.b,d-=D.a,s=x+((s=o+e+1)<U?s:U)<<2,m+=D.r=n[s],_+=D.g=n[s+1],A+=D.b=n[s+2],C+=D.a=n[s+3],w+=m,v+=_,O+=A,g+=C,D=D.next,b+=R=B.r,p+=S=B.g,y+=E=B.b,d+=P=B.a,m-=R,_-=S,A-=E,C-=P,B=B.next,h+=4;x+=r}for(o=0;o<r;o++){for(_=A=C=m=v=O=g=w=0,h=o<<2,b=Z*(R=n[h]),p=Z*(S=n[h+1]),y=Z*(E=n[h+2]),d=Z*(P=n[h+3]),w+=W*R,v+=W*S,O+=W*E,g+=W*P,M=H,l=0;l<Z;l++)M.r=R,M.g=S,M.b=E,M.a=P,M=M.next;for(f=r,l=1;l<=e;l++)h=f+o<<2,w+=(M.r=R=n[h])*(T=Z-l),v+=(M.g=S=n[h+1])*T,O+=(M.b=E=n[h+2])*T,g+=(M.a=P=n[h+3])*T,m+=R,_+=S,A+=E,C+=P,M=M.next,l<G&&(f+=r);for(h=o,D=H,B=L,a=0;a<i;a++)s=h<<2,n[s+3]=P=g*V>>Y,P>0?(P=255/P,n[s]=(w*V>>Y)*P,n[s+1]=(v*V>>Y)*P,n[s+2]=(O*V>>Y)*P):n[s]=n[s+1]=n[s+2]=0,w-=b,v-=p,O-=y,g-=d,b-=D.r,p-=D.g,y-=D.b,d-=D.a,s=o+((s=a+Z)<G?s:G)*r<<2,w+=m+=D.r=n[s],v+=_+=D.g=n[s+1],O+=A+=D.b=n[s+2],g+=C+=D.a=n[s+3],D=D.next,b+=R=B.r,p+=S=B.g,y+=E=B.b,d+=P=B.a,m-=R,_-=S,A-=E,C-=P,B=B.next,h+=r}}const VA=function(e){const n=Math.round(this.blurRadius());n>0&&GA(e,n)};Pp.Blur=VA;J5.Factory.addGetterSetter(BA.Node,"blurRadius",0,(0,UA.getNumberValidator)(),J5.Factory.afterSetFilter);var Cp={};Object.defineProperty(Cp,"__esModule",{value:!0});Cp.Brighten=void 0;const t4=ut,qA=qt,WA=Ze,YA=function(t){let e=this.brightness()*255,n=t.data,r=n.length,i;for(i=0;i<r;i+=4)n[i]+=e,n[i+1]+=e,n[i+2]+=e};Cp.Brighten=YA;t4.Factory.addGetterSetter(qA.Node,"brightness",0,(0,WA.getNumberValidator)(),t4.Factory.afterSetFilter);var kp={};Object.defineProperty(kp,"__esModule",{value:!0});kp.Contrast=void 0;const n4=ut,KA=qt,XA=Ze,ZA=function(t){const e=Math.pow((this.contrast()+100)/100,2);let n=t.data,r=n.length,i=150,o=150,a=150,l;for(l=0;l<r;l+=4)i=n[l],o=n[l+1],a=n[l+2],i/=255,i-=.5,i*=e,i+=.5,i*=255,o/=255,o-=.5,o*=e,o+=.5,o*=255,a/=255,a-=.5,a*=e,a+=.5,a*=255,i=i<0?0:i>255?255:i,o=o<0?0:o>255?255:o,a=a<0?0:a>255?255:a,n[l]=i,n[l+1]=o,n[l+2]=a};kp.Contrast=ZA;n4.Factory.addGetterSetter(KA.Node,"contrast",0,(0,XA.getNumberValidator)(),n4.Factory.afterSetFilter);var Tp={};Object.defineProperty(Tp,"__esModule",{value:!0});Tp.Emboss=void 0;const ba=ut,Ap=qt,QA=en,I9=Ze,JA=function(t){let e=this.embossStrength()*10,n=this.embossWhiteLevel()*255,r=this.embossDirection(),i=this.embossBlend(),o=0,a=0,l=t.data,s=t.width,f=t.height,h=s*4,x=f;switch(r){case"top-left":o=-1,a=-1;break;case"top":o=-1,a=0;break;case"top-right":o=-1,a=1;break;case"right":o=0,a=1;break;case"bottom-right":o=1,a=1;break;case"bottom":o=1,a=0;break;case"bottom-left":o=1,a=-1;break;case"left":o=0,a=-1;break;default:QA.Util.error("Unknown emboss direction: "+r)}do{const w=(x-1)*h;let v=o;x+v<1&&(v=0),x+v>f&&(v=0);const O=(x-1+v)*s*4;let g=s;do{const b=w+(g-1)*4;let p=a;g+p<1&&(p=0),g+p>s&&(p=0);const y=O+(g-1+p)*4,d=l[b]-l[y],m=l[b+1]-l[y+1],_=l[b+2]-l[y+2];let A=d;const C=A>0?A:-A,R=m>0?m:-m,S=_>0?_:-_;if(R>C&&(A=m),S>C&&(A=_),A*=e,i){const E=l[b]+A,P=l[b+1]+A,T=l[b+2]+A;l[b]=E>255?255:E<0?0:E,l[b+1]=P>255?255:P<0?0:P,l[b+2]=T>255?255:T<0?0:T}else{let E=n-A;E<0?E=0:E>255&&(E=255),l[b]=l[b+1]=l[b+2]=E}}while(--g)}while(--x)};Tp.Emboss=JA;ba.Factory.addGetterSetter(Ap.Node,"embossStrength",.5,(0,I9.getNumberValidator)(),ba.Factory.afterSetFilter);ba.Factory.addGetterSetter(Ap.Node,"embossWhiteLevel",.5,(0,I9.getNumberValidator)(),ba.Factory.afterSetFilter);ba.Factory.addGetterSetter(Ap.Node,"embossDirection","top-left",null,ba.Factory.afterSetFilter);ba.Factory.addGetterSetter(Ap.Node,"embossBlend",!1,null,ba.Factory.afterSetFilter);var Rp={};Object.defineProperty(Rp,"__esModule",{value:!0});Rp.Enhance=void 0;const r4=ut,eR=qt,tR=Ze;function eg(t,e,n,r,i){let o=n-e,a=i-r,l;return o===0?r+a/2:a===0?r:(l=(t-e)/o,l=a*l+r,l)}const nR=function(t){let e=t.data,n=e.length,r=e[0],i=r,o,a=e[1],l=a,s,f=e[2],h=f,x,w;const v=this.enhance();if(v===0)return;for(w=0;w<n;w+=4)o=e[w+0],o<r?r=o:o>i&&(i=o),s=e[w+1],s<a?a=s:s>l&&(l=s),x=e[w+2],x<f?f=x:x>h&&(h=x);i===r&&(i=255,r=0),l===a&&(l=255,a=0),h===f&&(h=255,f=0);let O,g,b,p,y,d,m,_,A;for(v>0?(g=i+v*(255-i),b=r-v*(r-0),y=l+v*(255-l),d=a-v*(a-0),_=h+v*(255-h),A=f-v*(f-0)):(O=(i+r)*.5,g=i+v*(i-O),b=r+v*(r-O),p=(l+a)*.5,y=l+v*(l-p),d=a+v*(a-p),m=(h+f)*.5,_=h+v*(h-m),A=f+v*(f-m)),w=0;w<n;w+=4)e[w+0]=eg(e[w+0],r,i,b,g),e[w+1]=eg(e[w+1],a,l,d,y),e[w+2]=eg(e[w+2],f,h,A,_)};Rp.Enhance=nR;r4.Factory.addGetterSetter(eR.Node,"enhance",0,(0,tR.getNumberValidator)(),r4.Factory.afterSetFilter);var Mp={};Object.defineProperty(Mp,"__esModule",{value:!0});Mp.Grayscale=void 0;const rR=function(t){let e=t.data,n=e.length,r,i;for(r=0;r<n;r+=4)i=.34*e[r]+.5*e[r+1]+.16*e[r+2],e[r]=i,e[r+1]=i,e[r+2]=i};Mp.Grayscale=rR;var Lp={};Object.defineProperty(Lp,"__esModule",{value:!0});Lp.HSL=void 0;const js=ut,Gy=qt,Vy=Ze;js.Factory.addGetterSetter(Gy.Node,"hue",0,(0,Vy.getNumberValidator)(),js.Factory.afterSetFilter);js.Factory.addGetterSetter(Gy.Node,"saturation",0,(0,Vy.getNumberValidator)(),js.Factory.afterSetFilter);js.Factory.addGetterSetter(Gy.Node,"luminance",0,(0,Vy.getNumberValidator)(),js.Factory.afterSetFilter);const iR=function(t){let e=t.data,n=e.length,r=1,i=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,a=this.luminance()*127,l;const s=r*i*Math.cos(o*Math.PI/180),f=r*i*Math.sin(o*Math.PI/180),h=.299*r+.701*s+.167*f,x=.587*r-.587*s+.33*f,w=.114*r-.114*s-.497*f,v=.299*r-.299*s-.328*f,O=.587*r+.413*s+.035*f,g=.114*r-.114*s+.293*f,b=.299*r-.3*s+1.25*f,p=.587*r-.586*s-1.05*f,y=.114*r+.886*s-.2*f;let d,m,_,A;for(l=0;l<n;l+=4)d=e[l+0],m=e[l+1],_=e[l+2],A=e[l+3],e[l+0]=h*d+x*m+w*_+a,e[l+1]=v*d+O*m+g*_+a,e[l+2]=b*d+p*m+y*_+a,e[l+3]=A};Lp.HSL=iR;var Np={};Object.defineProperty(Np,"__esModule",{value:!0});Np.HSV=void 0;const Fs=ut,qy=qt,Wy=Ze,oR=function(t){const e=t.data,n=e.length,r=Math.pow(2,this.value()),i=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,a=r*i*Math.cos(o*Math.PI/180),l=r*i*Math.sin(o*Math.PI/180),s=.299*r+.701*a+.167*l,f=.587*r-.587*a+.33*l,h=.114*r-.114*a-.497*l,x=.299*r-.299*a-.328*l,w=.587*r+.413*a+.035*l,v=.114*r-.114*a+.293*l,O=.299*r-.3*a+1.25*l,g=.587*r-.586*a-1.05*l,b=.114*r+.886*a-.2*l;let p,y,d,m;for(let _=0;_<n;_+=4)p=e[_+0],y=e[_+1],d=e[_+2],m=e[_+3],e[_+0]=s*p+f*y+h*d,e[_+1]=x*p+w*y+v*d,e[_+2]=O*p+g*y+b*d,e[_+3]=m};Np.HSV=oR;Fs.Factory.addGetterSetter(qy.Node,"hue",0,(0,Wy.getNumberValidator)(),Fs.Factory.afterSetFilter);Fs.Factory.addGetterSetter(qy.Node,"saturation",0,(0,Wy.getNumberValidator)(),Fs.Factory.afterSetFilter);Fs.Factory.addGetterSetter(qy.Node,"value",0,(0,Wy.getNumberValidator)(),Fs.Factory.afterSetFilter);var Ip={};Object.defineProperty(Ip,"__esModule",{value:!0});Ip.Invert=void 0;const aR=function(t){let e=t.data,n=e.length,r;for(r=0;r<n;r+=4)e[r]=255-e[r],e[r+1]=255-e[r+1],e[r+2]=255-e[r+2]};Ip.Invert=aR;var Dp={};Object.defineProperty(Dp,"__esModule",{value:!0});Dp.Kaleidoscope=void 0;const Sh=ut,D9=qt,i4=en,j9=Ze,lR=function(t,e,n){let r=t.data,i=e.data,o=t.width,a=t.height,l=n.polarCenterX||o/2,s=n.polarCenterY||a/2,f,h,x,w=0,v=0,O=0,g=0,b,p=Math.sqrt(l*l+s*s);h=o-l,x=a-s,b=Math.sqrt(h*h+x*x),p=b>p?b:p;let y=a,d=o,m,_,A=360/d*Math.PI/180,C,R;for(_=0;_<d;_+=1)for(C=Math.sin(_*A),R=Math.cos(_*A),m=0;m<y;m+=1)h=Math.floor(l+p*m/y*R),x=Math.floor(s+p*m/y*C),f=(x*o+h)*4,w=r[f+0],v=r[f+1],O=r[f+2],g=r[f+3],f=(_+m*o)*4,i[f+0]=w,i[f+1]=v,i[f+2]=O,i[f+3]=g},sR=function(t,e,n){let r=t.data,i=e.data,o=t.width,a=t.height,l=n.polarCenterX||o/2,s=n.polarCenterY||a/2,f,h,x,w,v,O=0,g=0,b=0,p=0,y,d=Math.sqrt(l*l+s*s);h=o-l,x=a-s,y=Math.sqrt(h*h+x*x),d=y>d?y:d;let m=a,_=o,A,C,R=0,S,E;for(h=0;h<o;h+=1)for(x=0;x<a;x+=1)w=h-l,v=x-s,A=Math.sqrt(w*w+v*v)*m/d,C=(Math.atan2(v,w)*180/Math.PI+360+R)%360,C=C*_/360,S=Math.floor(C),E=Math.floor(A),f=(E*o+S)*4,O=r[f+0],g=r[f+1],b=r[f+2],p=r[f+3],f=(x*o+h)*4,i[f+0]=O,i[f+1]=g,i[f+2]=b,i[f+3]=p},uR=function(t){const e=t.width,n=t.height;let r,i,o,a,l,s,f,h,x,w,v=Math.round(this.kaleidoscopePower());const O=Math.round(this.kaleidoscopeAngle()),g=Math.floor(e*(O%360)/360);if(v<1)return;const b=i4.Util.createCanvasElement();b.width=e,b.height=n;const p=b.getContext("2d").getImageData(0,0,e,n);i4.Util.releaseCanvas(b),lR(t,p,{polarCenterX:e/2,polarCenterY:n/2});let y=e/Math.pow(2,v);for(;y<=8;)y=y*2,v-=1;y=Math.ceil(y);let d=y,m=0,_=d,A=1;for(g+y>e&&(m=d,_=0,A=-1),i=0;i<n;i+=1)for(r=m;r!==_;r+=A)o=Math.round(r+g)%e,x=(e*i+o)*4,l=p.data[x+0],s=p.data[x+1],f=p.data[x+2],h=p.data[x+3],w=(e*i+r)*4,p.data[w+0]=l,p.data[w+1]=s,p.data[w+2]=f,p.data[w+3]=h;for(i=0;i<n;i+=1)for(d=Math.floor(y),a=0;a<v;a+=1){for(r=0;r<d+1;r+=1)x=(e*i+r)*4,l=p.data[x+0],s=p.data[x+1],f=p.data[x+2],h=p.data[x+3],w=(e*i+d*2-r-1)*4,p.data[w+0]=l,p.data[w+1]=s,p.data[w+2]=f,p.data[w+3]=h;d*=2}sR(p,t,{polarRotation:0})};Dp.Kaleidoscope=uR;Sh.Factory.addGetterSetter(D9.Node,"kaleidoscopePower",2,(0,j9.getNumberValidator)(),Sh.Factory.afterSetFilter);Sh.Factory.addGetterSetter(D9.Node,"kaleidoscopeAngle",0,(0,j9.getNumberValidator)(),Sh.Factory.afterSetFilter);var jp={};Object.defineProperty(jp,"__esModule",{value:!0});jp.Mask=void 0;const o4=ut,cR=qt,fR=Ze;function _d(t,e,n){let r=(n*t.width+e)*4;const i=[];return i.push(t.data[r++],t.data[r++],t.data[r++],t.data[r++]),i}function Bu(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2))}function dR(t){const e=[0,0,0];for(let n=0;n<t.length;n++)e[0]+=t[n][0],e[1]+=t[n][1],e[2]+=t[n][2];return e[0]/=t.length,e[1]/=t.length,e[2]/=t.length,e}function hR(t,e){const n=_d(t,0,0),r=_d(t,t.width-1,0),i=_d(t,0,t.height-1),o=_d(t,t.width-1,t.height-1),a=e||10;if(Bu(n,r)<a&&Bu(r,o)<a&&Bu(o,i)<a&&Bu(i,n)<a){const l=dR([r,n,o,i]),s=[];for(let f=0;f<t.width*t.height;f++){const h=Bu(l,[t.data[f*4],t.data[f*4+1],t.data[f*4+2]]);s[f]=h<a?0:255}return s}}function pR(t,e){for(let n=0;n<t.width*t.height;n++)t.data[4*n+3]=e[n]}function gR(t,e,n){const r=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),a=[];for(let l=0;l<n;l++)for(let s=0;s<e;s++){const f=l*e+s;let h=0;for(let x=0;x<i;x++)for(let w=0;w<i;w++){const v=l+x-o,O=s+w-o;if(v>=0&&v<n&&O>=0&&O<e){const g=v*e+O,b=r[x*i+w];h+=t[g]*b}}a[f]=h===255*8?255:0}return a}function vR(t,e,n){const r=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),a=[];for(let l=0;l<n;l++)for(let s=0;s<e;s++){const f=l*e+s;let h=0;for(let x=0;x<i;x++)for(let w=0;w<i;w++){const v=l+x-o,O=s+w-o;if(v>=0&&v<n&&O>=0&&O<e){const g=v*e+O,b=r[x*i+w];h+=t[g]*b}}a[f]=h>=255*4?255:0}return a}function mR(t,e,n){const r=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),a=[];for(let l=0;l<n;l++)for(let s=0;s<e;s++){const f=l*e+s;let h=0;for(let x=0;x<i;x++)for(let w=0;w<i;w++){const v=l+x-o,O=s+w-o;if(v>=0&&v<n&&O>=0&&O<e){const g=v*e+O,b=r[x*i+w];h+=t[g]*b}}a[f]=h}return a}const yR=function(t){let e=this.threshold(),n=hR(t,e);return n&&(n=gR(n,t.width,t.height),n=vR(n,t.width,t.height),n=mR(n,t.width,t.height),pR(t,n)),t};jp.Mask=yR;o4.Factory.addGetterSetter(cR.Node,"threshold",0,(0,fR.getNumberValidator)(),o4.Factory.afterSetFilter);var Fp={};Object.defineProperty(Fp,"__esModule",{value:!0});Fp.Noise=void 0;const a4=ut,bR=qt,_R=Ze,wR=function(t){const e=this.noise()*255,n=t.data,r=n.length,i=e/2;for(let o=0;o<r;o+=4)n[o+0]+=i-2*i*Math.random(),n[o+1]+=i-2*i*Math.random(),n[o+2]+=i-2*i*Math.random()};Fp.Noise=wR;a4.Factory.addGetterSetter(bR.Node,"noise",.2,(0,_R.getNumberValidator)(),a4.Factory.afterSetFilter);var zp={};Object.defineProperty(zp,"__esModule",{value:!0});zp.Pixelate=void 0;const l4=ut,SR=en,ER=qt,OR=Ze,xR=function(t){let e=Math.ceil(this.pixelSize()),n=t.width,r=t.height,i,o,a,l,s,f,h,x=Math.ceil(n/e),w=Math.ceil(r/e),v,O,g,b,p,y,d,m=t.data;if(e<=0){SR.Util.error("pixelSize value can not be <= 0");return}for(p=0;p<x;p+=1)for(y=0;y<w;y+=1){for(l=0,s=0,f=0,h=0,v=p*e,O=v+e,g=y*e,b=g+e,d=0,i=v;i<O;i+=1)if(!(i>=n))for(o=g;o<b;o+=1)o>=r||(a=(n*o+i)*4,l+=m[a+0],s+=m[a+1],f+=m[a+2],h+=m[a+3],d+=1);for(l=l/d,s=s/d,f=f/d,h=h/d,i=v;i<O;i+=1)if(!(i>=n))for(o=g;o<b;o+=1)o>=r||(a=(n*o+i)*4,m[a+0]=l,m[a+1]=s,m[a+2]=f,m[a+3]=h)}};zp.Pixelate=xR;l4.Factory.addGetterSetter(ER.Node,"pixelSize",8,(0,OR.getNumberValidator)(),l4.Factory.afterSetFilter);var Bp={};Object.defineProperty(Bp,"__esModule",{value:!0});Bp.Posterize=void 0;const s4=ut,PR=qt,CR=Ze,kR=function(t){let e=Math.round(this.levels()*254)+1,n=t.data,r=n.length,i=255/e,o;for(o=0;o<r;o+=1)n[o]=Math.floor(n[o]/i)*i};Bp.Posterize=kR;s4.Factory.addGetterSetter(PR.Node,"levels",.5,(0,CR.getNumberValidator)(),s4.Factory.afterSetFilter);var Up={};Object.defineProperty(Up,"__esModule",{value:!0});Up.RGB=void 0;const Eh=ut,Yy=qt,TR=Ze,AR=function(t){let e=t.data,n=e.length,r=this.red(),i=this.green(),o=this.blue(),a,l;for(a=0;a<n;a+=4)l=(.34*e[a]+.5*e[a+1]+.16*e[a+2])/255,e[a]=l*r,e[a+1]=l*i,e[a+2]=l*o,e[a+3]=e[a+3]};Up.RGB=AR;Eh.Factory.addGetterSetter(Yy.Node,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});Eh.Factory.addGetterSetter(Yy.Node,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});Eh.Factory.addGetterSetter(Yy.Node,"blue",0,TR.RGBComponent,Eh.Factory.afterSetFilter);var Hp={};Object.defineProperty(Hp,"__esModule",{value:!0});Hp.RGBA=void 0;const Cc=ut,$p=qt,RR=Ze,MR=function(t){const e=t.data,n=e.length,r=this.red(),i=this.green(),o=this.blue(),a=this.alpha();for(let l=0;l<n;l+=4){const s=1-a;e[l]=r*a+e[l]*s,e[l+1]=i*a+e[l+1]*s,e[l+2]=o*a+e[l+2]*s}};Hp.RGBA=MR;Cc.Factory.addGetterSetter($p.Node,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});Cc.Factory.addGetterSetter($p.Node,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});Cc.Factory.addGetterSetter($p.Node,"blue",0,RR.RGBComponent,Cc.Factory.afterSetFilter);Cc.Factory.addGetterSetter($p.Node,"alpha",1,function(t){return this._filterUpToDate=!1,t>1?1:t<0?0:t});var Gp={};Object.defineProperty(Gp,"__esModule",{value:!0});Gp.Sepia=void 0;const LR=function(t){let e=t.data,n=e.length,r,i,o,a;for(r=0;r<n;r+=4)i=e[r+0],o=e[r+1],a=e[r+2],e[r+0]=Math.min(255,i*.393+o*.769+a*.189),e[r+1]=Math.min(255,i*.349+o*.686+a*.168),e[r+2]=Math.min(255,i*.272+o*.534+a*.131)};Gp.Sepia=LR;var Vp={};Object.defineProperty(Vp,"__esModule",{value:!0});Vp.Solarize=void 0;const NR=function(t){const e=t.data,n=t.width,r=t.height,i=n*4;let o=r;do{const a=(o-1)*i;let l=n;do{const s=a+(l-1)*4;let f=e[s],h=e[s+1],x=e[s+2];f>127&&(f=255-f),h>127&&(h=255-h),x>127&&(x=255-x),e[s]=f,e[s+1]=h,e[s+2]=x}while(--l)}while(--o)};Vp.Solarize=NR;var qp={};Object.defineProperty(qp,"__esModule",{value:!0});qp.Threshold=void 0;const u4=ut,IR=qt,DR=Ze,jR=function(t){const e=this.threshold()*255,n=t.data,r=n.length;for(let i=0;i<r;i+=1)n[i]=n[i]<e?0:255};qp.Threshold=jR;u4.Factory.addGetterSetter(IR.Node,"threshold",.5,(0,DR.getNumberValidator)(),u4.Factory.afterSetFilter);Object.defineProperty(tp,"__esModule",{value:!0});tp.Konva=void 0;const c4=bh,FR=lp,zR=cp,BR=hp,UR=pp,HR=gp,f4=Ds,$R=Yc,GR=tu,VR=Zc,qR=yp,WR=bp,YR=_p,KR=wp,XR=ru,ZR=Sp,QR=Ep,JR=Op,eM=Pp,tM=Cp,nM=kp,rM=Tp,iM=Rp,oM=Mp,aM=Lp,lM=Np,sM=Ip,uM=Dp,cM=jp,fM=Fp,dM=zp,hM=Bp,pM=Up,gM=Hp,vM=Gp,mM=Vp,yM=qp;tp.Konva=c4.Konva.Util._assign(c4.Konva,{Arc:FR.Arc,Arrow:zR.Arrow,Circle:BR.Circle,Ellipse:UR.Ellipse,Image:HR.Image,Label:f4.Label,Tag:f4.Tag,Line:$R.Line,Path:GR.Path,Rect:VR.Rect,RegularPolygon:qR.RegularPolygon,Ring:WR.Ring,Sprite:YR.Sprite,Star:KR.Star,Text:XR.Text,TextPath:ZR.TextPath,Transformer:QR.Transformer,Wedge:JR.Wedge,Filters:{Blur:eM.Blur,Brighten:tM.Brighten,Contrast:nM.Contrast,Emboss:rM.Emboss,Enhance:iM.Enhance,Grayscale:oM.Grayscale,HSL:aM.HSL,HSV:lM.HSV,Invert:sM.Invert,Kaleidoscope:uM.Kaleidoscope,Mask:cM.Mask,Noise:fM.Noise,Pixelate:dM.Pixelate,Posterize:hM.Posterize,RGB:pM.RGB,RGBA:gM.RGBA,Sepia:vM.Sepia,Solarize:mM.Solarize,Threshold:yM.Threshold}});var bM=Ny.exports;Object.defineProperty(bM,"__esModule",{value:!0});const _M=tp;Ny.exports=_M.Konva;var ki=Ny.exports,gm={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;var n=bh;Object.defineProperty(e,"Konva",{enumerable:!0,get:function(){return n.Konva}});const r=bh;t.exports=r.Konva})(gm,gm.exports);var wM=gm.exports;const kc=kh(wM);var F9={exports:{}};/**
|
|
44
44
|
* @license React
|
|
45
45
|
* react-reconciler.production.min.js
|
|
@@ -48,13 +48,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
48
48
|
*
|
|
49
49
|
* This source code is licensed under the MIT license found in the
|
|
50
50
|
* LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/var SM=function(e){var n={},r=Qe,i=qu,o=Object.assign;function a(u){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+u,k=1;k<arguments.length;k++)c+="&args[]="+encodeURIComponent(arguments[k]);return"Minified React error #"+u+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,s=Symbol.for("react.element"),f=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),v=Symbol.for("react.provider"),O=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),_=Symbol.iterator;function A(u){return u===null||typeof u!="object"?null:(u=_&&u[_]||u["@@iterator"],typeof u=="function"?u:null)}function C(u){if(u==null)return null;if(typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case h:return"Fragment";case f:return"Portal";case w:return"Profiler";case x:return"StrictMode";case b:return"Suspense";case p:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case O:return(u.displayName||"Context")+".Consumer";case v:return(u._context.displayName||"Context")+".Provider";case g:var c=u.render;return u=u.displayName,u||(u=c.displayName||c.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case y:return c=u.displayName||null,c!==null?c:C(u.type)||"Memo";case d:c=u._payload,u=u._init;try{return C(u(c))}catch{}}return null}function R(u){var c=u.type;switch(u.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return u=c.render,u=u.displayName||u.name||"",c.displayName||(u!==""?"ForwardRef("+u+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return C(c);case 8:return c===x?"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 c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function S(u){var c=u,k=u;if(u.alternate)for(;c.return;)c=c.return;else{u=c;do c=u,c.flags&4098&&(k=c.return),u=c.return;while(u)}return c.tag===3?k:null}function E(u){if(S(u)!==u)throw Error(a(188))}function P(u){var c=u.alternate;if(!c){if(c=S(u),c===null)throw Error(a(188));return c!==u?null:u}for(var k=u,I=c;;){var j=k.return;if(j===null)break;var q=j.alternate;if(q===null){if(I=j.return,I!==null){k=I;continue}break}if(j.child===q.child){for(q=j.child;q;){if(q===k)return E(j),u;if(q===I)return E(j),c;q=q.sibling}throw Error(a(188))}if(k.return!==I.return)k=j,I=q;else{for(var ee=!1,le=j.child;le;){if(le===k){ee=!0,k=j,I=q;break}if(le===I){ee=!0,I=j,k=q;break}le=le.sibling}if(!ee){for(le=q.child;le;){if(le===k){ee=!0,k=q,I=j;break}if(le===I){ee=!0,I=q,k=j;break}le=le.sibling}if(!ee)throw Error(a(189))}}if(k.alternate!==I)throw Error(a(190))}if(k.tag!==3)throw Error(a(188));return k.stateNode.current===k?u:c}function T(u){return u=P(u),u!==null?N(u):null}function N(u){if(u.tag===5||u.tag===6)return u;for(u=u.child;u!==null;){var c=N(u);if(c!==null)return c;u=u.sibling}return null}function U(u){if(u.tag===5||u.tag===6)return u;for(u=u.child;u!==null;){if(u.tag!==4){var c=U(u);if(c!==null)return c}u=u.sibling}return null}var G=Array.isArray,Z=e.getPublicInstance,W=e.getRootHostContext,H=e.getChildHostContext,L=e.prepareForCommit,M=e.resetAfterCommit,D=e.createInstance,B=e.appendInitialChild,V=e.finalizeInitialChildren,Y=e.prepareUpdate,F=e.shouldSetTextContent,$=e.createTextInstance,z=e.scheduleTimeout,K=e.cancelTimeout,X=e.noTimeout,Q=e.isPrimaryRenderer,J=e.supportsMutation,ne=e.supportsPersistence,ie=e.supportsHydration,oe=e.getInstanceFromNode,
|
|
51
|
+
*/var SM=function(e){var n={},r=Qe,i=qu,o=Object.assign;function a(u){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+u,k=1;k<arguments.length;k++)c+="&args[]="+encodeURIComponent(arguments[k]);return"Minified React error #"+u+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,s=Symbol.for("react.element"),f=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),v=Symbol.for("react.provider"),O=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),_=Symbol.iterator;function A(u){return u===null||typeof u!="object"?null:(u=_&&u[_]||u["@@iterator"],typeof u=="function"?u:null)}function C(u){if(u==null)return null;if(typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case h:return"Fragment";case f:return"Portal";case w:return"Profiler";case x:return"StrictMode";case b:return"Suspense";case p:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case O:return(u.displayName||"Context")+".Consumer";case v:return(u._context.displayName||"Context")+".Provider";case g:var c=u.render;return u=u.displayName,u||(u=c.displayName||c.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case y:return c=u.displayName||null,c!==null?c:C(u.type)||"Memo";case d:c=u._payload,u=u._init;try{return C(u(c))}catch{}}return null}function R(u){var c=u.type;switch(u.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return u=c.render,u=u.displayName||u.name||"",c.displayName||(u!==""?"ForwardRef("+u+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return C(c);case 8:return c===x?"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 c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function S(u){var c=u,k=u;if(u.alternate)for(;c.return;)c=c.return;else{u=c;do c=u,c.flags&4098&&(k=c.return),u=c.return;while(u)}return c.tag===3?k:null}function E(u){if(S(u)!==u)throw Error(a(188))}function P(u){var c=u.alternate;if(!c){if(c=S(u),c===null)throw Error(a(188));return c!==u?null:u}for(var k=u,I=c;;){var j=k.return;if(j===null)break;var q=j.alternate;if(q===null){if(I=j.return,I!==null){k=I;continue}break}if(j.child===q.child){for(q=j.child;q;){if(q===k)return E(j),u;if(q===I)return E(j),c;q=q.sibling}throw Error(a(188))}if(k.return!==I.return)k=j,I=q;else{for(var ee=!1,le=j.child;le;){if(le===k){ee=!0,k=j,I=q;break}if(le===I){ee=!0,I=j,k=q;break}le=le.sibling}if(!ee){for(le=q.child;le;){if(le===k){ee=!0,k=q,I=j;break}if(le===I){ee=!0,I=q,k=j;break}le=le.sibling}if(!ee)throw Error(a(189))}}if(k.alternate!==I)throw Error(a(190))}if(k.tag!==3)throw Error(a(188));return k.stateNode.current===k?u:c}function T(u){return u=P(u),u!==null?N(u):null}function N(u){if(u.tag===5||u.tag===6)return u;for(u=u.child;u!==null;){var c=N(u);if(c!==null)return c;u=u.sibling}return null}function U(u){if(u.tag===5||u.tag===6)return u;for(u=u.child;u!==null;){if(u.tag!==4){var c=U(u);if(c!==null)return c}u=u.sibling}return null}var G=Array.isArray,Z=e.getPublicInstance,W=e.getRootHostContext,H=e.getChildHostContext,L=e.prepareForCommit,M=e.resetAfterCommit,D=e.createInstance,B=e.appendInitialChild,V=e.finalizeInitialChildren,Y=e.prepareUpdate,F=e.shouldSetTextContent,$=e.createTextInstance,z=e.scheduleTimeout,K=e.cancelTimeout,X=e.noTimeout,Q=e.isPrimaryRenderer,J=e.supportsMutation,ne=e.supportsPersistence,ie=e.supportsHydration,oe=e.getInstanceFromNode,de=e.preparePortalMount,me=e.getCurrentEventPriority,Pe=e.detachDeletedInstance,re=e.supportsMicrotasks,ae=e.scheduleMicrotask,we=e.supportsTestSelectors,be=e.findFiberRoot,te=e.getBoundingRect,fe=e.getTextContent,he=e.isHiddenSubtree,Ee=e.matchAccessibilityRole,Ve=e.setFocusIfFocusable,Je=e.setupIntersectionObserver,Ae=e.appendChild,Ce=e.appendChildToContainer,Me=e.commitTextUpdate,ze=e.commitMount,We=e.commitUpdate,St=e.insertBefore,mt=e.insertInContainerBefore,ue=e.removeChild,ce=e.removeChildFromContainer,Se=e.resetTextContent,Le=e.hideInstance,Ne=e.hideTextInstance,ge=e.unhideInstance,Xe=e.unhideTextInstance,Oe=e.clearContainer,$e=e.cloneInstance,Wt=e.createContainerChildSet,Tt=e.appendChildToContainerChildSet,Yt=e.finalizeContainerChildren,ke=e.replaceContainerChildren,Ye=e.cloneHiddenInstance,at=e.cloneHiddenTextInstance,Ot=e.canHydrateInstance,xt=e.canHydrateTextInstance,un=e.canHydrateSuspenseInstance,hn=e.isSuspenseInstancePending,pn=e.isSuspenseInstanceFallback,rr=e.getSuspenseInstanceFallbackErrorDetails,to=e.registerSuspenseInstanceRetry,wr=e.getNextHydratableSibling,Ie=e.getFirstHydratableChild,et=e.getFirstHydratableChildWithinContainer,ft=e.getFirstHydratableChildWithinSuspenseInstance,Ft=e.hydrateInstance,Pt=e.hydrateTextInstance,Bn=e.hydrateSuspenseInstance,xn=e.getNextHydratableInstanceAfterSuspenseInstance,tn=e.commitHydratedContainer,ri=e.commitHydratedSuspenseInstance,Sr=e.clearSuspenseBoundary,no=e.clearSuspenseBoundaryFromContainer,jo=e.shouldDeleteUnhydratedTailInstances,cu=e.didNotMatchHydratedContainerTextInstance,Da=e.didNotMatchHydratedTextInstance,ro;function Dr(u){if(ro===void 0)try{throw Error()}catch(k){var c=k.stack.trim().match(/\n( *(at )?)/);ro=c&&c[1]||""}return`
|
|
52
52
|
`+ro+u}var Nl=!1;function Il(u,c){if(!u||Nl)return"";Nl=!0;var k=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(Te){var I=Te}Reflect.construct(u,[],c)}else{try{c.call()}catch(Te){I=Te}u.call(c.prototype)}else{try{throw Error()}catch(Te){I=Te}u()}}catch(Te){if(Te&&I&&typeof Te.stack=="string"){for(var j=Te.stack.split(`
|
|
53
53
|
`),q=I.stack.split(`
|
|
54
54
|
`),ee=j.length-1,le=q.length-1;1<=ee&&0<=le&&j[ee]!==q[le];)le--;for(;1<=ee&&0<=le;ee--,le--)if(j[ee]!==q[le]){if(ee!==1||le!==1)do if(ee--,le--,0>le||j[ee]!==q[le]){var ve=`
|
|
55
55
|
`+j[ee].replace(" at new "," at ");return u.displayName&&ve.includes("<anonymous>")&&(ve=ve.replace("<anonymous>",u.displayName)),ve}while(1<=ee&&0<=le);break}}}finally{Nl=!1,Error.prepareStackTrace=k}return(u=u?u.displayName||u.name:"")?Dr(u):""}var NS=Object.prototype.hasOwnProperty,n0=[],Dl=-1;function Fo(u){return{current:u}}function zt(u){0>Dl||(u.current=n0[Dl],n0[Dl]=null,Dl--)}function Nt(u,c){Dl++,n0[Dl]=u.current,u.current=c}var zo={},Un=Fo(zo),ir=Fo(!1),ja=zo;function jl(u,c){var k=u.type.contextTypes;if(!k)return zo;var I=u.stateNode;if(I&&I.__reactInternalMemoizedUnmaskedChildContext===c)return I.__reactInternalMemoizedMaskedChildContext;var j={},q;for(q in k)j[q]=c[q];return I&&(u=u.stateNode,u.__reactInternalMemoizedUnmaskedChildContext=c,u.__reactInternalMemoizedMaskedChildContext=j),j}function or(u){return u=u.childContextTypes,u!=null}function rf(){zt(ir),zt(Un)}function P2(u,c,k){if(Un.current!==zo)throw Error(a(168));Nt(Un,c),Nt(ir,k)}function C2(u,c,k){var I=u.stateNode;if(c=c.childContextTypes,typeof I.getChildContext!="function")return k;I=I.getChildContext();for(var j in I)if(!(j in c))throw Error(a(108,R(u)||"Unknown",j));return o({},k,I)}function of(u){return u=(u=u.stateNode)&&u.__reactInternalMemoizedMergedChildContext||zo,ja=Un.current,Nt(Un,u),Nt(ir,ir.current),!0}function k2(u,c,k){var I=u.stateNode;if(!I)throw Error(a(169));k?(u=C2(u,c,ja),I.__reactInternalMemoizedMergedChildContext=u,zt(ir),zt(Un),Nt(Un,u)):zt(ir),Nt(ir,k)}var ii=Math.clz32?Math.clz32:jS,IS=Math.log,DS=Math.LN2;function jS(u){return u>>>=0,u===0?32:31-(IS(u)/DS|0)|0}var af=64,lf=4194304;function fu(u){switch(u&-u){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 u&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return u&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return u}}function sf(u,c){var k=u.pendingLanes;if(k===0)return 0;var I=0,j=u.suspendedLanes,q=u.pingedLanes,ee=k&268435455;if(ee!==0){var le=ee&~j;le!==0?I=fu(le):(q&=ee,q!==0&&(I=fu(q)))}else ee=k&~j,ee!==0?I=fu(ee):q!==0&&(I=fu(q));if(I===0)return 0;if(c!==0&&c!==I&&!(c&j)&&(j=I&-I,q=c&-c,j>=q||j===16&&(q&4194240)!==0))return c;if(I&4&&(I|=k&16),c=u.entangledLanes,c!==0)for(u=u.entanglements,c&=I;0<c;)k=31-ii(c),j=1<<k,I|=u[k],c&=~j;return I}function FS(u,c){switch(u){case 1:case 2:case 4:return c+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 c+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 zS(u,c){for(var k=u.suspendedLanes,I=u.pingedLanes,j=u.expirationTimes,q=u.pendingLanes;0<q;){var ee=31-ii(q),le=1<<ee,ve=j[ee];ve===-1?(!(le&k)||le&I)&&(j[ee]=FS(le,c)):ve<=c&&(u.expiredLanes|=le),q&=~le}}function r0(u){return u=u.pendingLanes&-1073741825,u!==0?u:u&1073741824?1073741824:0}function T2(){var u=af;return af<<=1,!(af&4194240)&&(af=64),u}function i0(u){for(var c=[],k=0;31>k;k++)c.push(u);return c}function du(u,c,k){u.pendingLanes|=c,c!==536870912&&(u.suspendedLanes=0,u.pingedLanes=0),u=u.eventTimes,c=31-ii(c),u[c]=k}function BS(u,c){var k=u.pendingLanes&~c;u.pendingLanes=c,u.suspendedLanes=0,u.pingedLanes=0,u.expiredLanes&=c,u.mutableReadLanes&=c,u.entangledLanes&=c,c=u.entanglements;var I=u.eventTimes;for(u=u.expirationTimes;0<k;){var j=31-ii(k),q=1<<j;c[j]=0,I[j]=-1,u[j]=-1,k&=~q}}function o0(u,c){var k=u.entangledLanes|=c;for(u=u.entanglements;k;){var I=31-ii(k),j=1<<I;j&c|u[I]&c&&(u[I]|=c),k&=~j}}var yt=0;function A2(u){return u&=-u,1<u?4<u?u&268435455?16:536870912:4:1}var a0=i.unstable_scheduleCallback,R2=i.unstable_cancelCallback,US=i.unstable_shouldYield,HS=i.unstable_requestPaint,Pn=i.unstable_now,l0=i.unstable_ImmediatePriority,$S=i.unstable_UserBlockingPriority,s0=i.unstable_NormalPriority,GS=i.unstable_IdlePriority,uf=null,Ti=null;function VS(u){if(Ti&&typeof Ti.onCommitFiberRoot=="function")try{Ti.onCommitFiberRoot(uf,u,void 0,(u.current.flags&128)===128)}catch{}}function qS(u,c){return u===c&&(u!==0||1/u===1/c)||u!==u&&c!==c}var oi=typeof Object.is=="function"?Object.is:qS,io=null,cf=!1,u0=!1;function M2(u){io===null?io=[u]:io.push(u)}function WS(u){cf=!0,M2(u)}function Ai(){if(!u0&&io!==null){u0=!0;var u=0,c=yt;try{var k=io;for(yt=1;u<k.length;u++){var I=k[u];do I=I(!0);while(I!==null)}io=null,cf=!1}catch(j){throw io!==null&&(io=io.slice(u+1)),a0(l0,Ai),j}finally{yt=c,u0=!1}}return null}var Fl=[],zl=0,ff=null,df=0,jr=[],Fr=0,Fa=null,oo=1,ao="";function za(u,c){Fl[zl++]=df,Fl[zl++]=ff,ff=u,df=c}function L2(u,c,k){jr[Fr++]=oo,jr[Fr++]=ao,jr[Fr++]=Fa,Fa=u;var I=oo;u=ao;var j=32-ii(I)-1;I&=~(1<<j),k+=1;var q=32-ii(c)+j;if(30<q){var ee=j-j%5;q=(I&(1<<ee)-1).toString(32),I>>=ee,j-=ee,oo=1<<32-ii(c)+j|k<<j|I,ao=q+u}else oo=1<<q|k<<j|I,ao=u}function c0(u){u.return!==null&&(za(u,1),L2(u,1,0))}function f0(u){for(;u===ff;)ff=Fl[--zl],Fl[zl]=null,df=Fl[--zl],Fl[zl]=null;for(;u===Fa;)Fa=jr[--Fr],jr[Fr]=null,ao=jr[--Fr],jr[Fr]=null,oo=jr[--Fr],jr[Fr]=null}var Er=null,zr=null,$t=!1,hu=!1,ai=null;function N2(u,c){var k=Gr(5,null,null,0);k.elementType="DELETED",k.stateNode=c,k.return=u,c=u.deletions,c===null?(u.deletions=[k],u.flags|=16):c.push(k)}function I2(u,c){switch(u.tag){case 5:return c=Ot(c,u.type,u.pendingProps),c!==null?(u.stateNode=c,Er=u,zr=Ie(c),!0):!1;case 6:return c=xt(c,u.pendingProps),c!==null?(u.stateNode=c,Er=u,zr=null,!0):!1;case 13:if(c=un(c),c!==null){var k=Fa!==null?{id:oo,overflow:ao}:null;return u.memoizedState={dehydrated:c,treeContext:k,retryLane:1073741824},k=Gr(18,null,null,0),k.stateNode=c,k.return=u,u.child=k,Er=u,zr=null,!0}return!1;default:return!1}}function d0(u){return(u.mode&1)!==0&&(u.flags&128)===0}function h0(u){if($t){var c=zr;if(c){var k=c;if(!I2(u,c)){if(d0(u))throw Error(a(418));c=wr(k);var I=Er;c&&I2(u,c)?N2(I,k):(u.flags=u.flags&-4097|2,$t=!1,Er=u)}}else{if(d0(u))throw Error(a(418));u.flags=u.flags&-4097|2,$t=!1,Er=u}}}function D2(u){for(u=u.return;u!==null&&u.tag!==5&&u.tag!==3&&u.tag!==13;)u=u.return;Er=u}function hf(u){if(!ie||u!==Er)return!1;if(!$t)return D2(u),$t=!0,!1;if(u.tag!==3&&(u.tag!==5||jo(u.type)&&!F(u.type,u.memoizedProps))){var c=zr;if(c){if(d0(u))throw j2(),Error(a(418));for(;c;)N2(u,c),c=wr(c)}}if(D2(u),u.tag===13){if(!ie)throw Error(a(316));if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(a(317));zr=xn(u)}else zr=Er?wr(u.stateNode):null;return!0}function j2(){for(var u=zr;u;)u=wr(u)}function Bl(){ie&&(zr=Er=null,hu=$t=!1)}function p0(u){ai===null?ai=[u]:ai.push(u)}var YS=l.ReactCurrentBatchConfig;function pf(u,c){if(oi(u,c))return!0;if(typeof u!="object"||u===null||typeof c!="object"||c===null)return!1;var k=Object.keys(u),I=Object.keys(c);if(k.length!==I.length)return!1;for(I=0;I<k.length;I++){var j=k[I];if(!NS.call(c,j)||!oi(u[j],c[j]))return!1}return!0}function KS(u){switch(u.tag){case 5:return Dr(u.type);case 16:return Dr("Lazy");case 13:return Dr("Suspense");case 19:return Dr("SuspenseList");case 0:case 2:case 15:return u=Il(u.type,!1),u;case 11:return u=Il(u.type.render,!1),u;case 1:return u=Il(u.type,!0),u;default:return""}}function pu(u,c,k){if(u=k.ref,u!==null&&typeof u!="function"&&typeof u!="object"){if(k._owner){if(k=k._owner,k){if(k.tag!==1)throw Error(a(309));var I=k.stateNode}if(!I)throw Error(a(147,u));var j=I,q=""+u;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===q?c.ref:(c=function(ee){var le=j.refs;ee===null?delete le[q]:le[q]=ee},c._stringRef=q,c)}if(typeof u!="string")throw Error(a(284));if(!k._owner)throw Error(a(290,u))}return u}function gf(u,c){throw u=Object.prototype.toString.call(c),Error(a(31,u==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":u))}function F2(u){var c=u._init;return c(u._payload)}function z2(u){function c(pe,se){if(u){var ye=pe.deletions;ye===null?(pe.deletions=[se],pe.flags|=16):ye.push(se)}}function k(pe,se){if(!u)return null;for(;se!==null;)c(pe,se),se=se.sibling;return null}function I(pe,se){for(pe=new Map;se!==null;)se.key!==null?pe.set(se.key,se):pe.set(se.index,se),se=se.sibling;return pe}function j(pe,se){return pe=qo(pe,se),pe.index=0,pe.sibling=null,pe}function q(pe,se,ye){return pe.index=ye,u?(ye=pe.alternate,ye!==null?(ye=ye.index,ye<se?(pe.flags|=2,se):ye):(pe.flags|=2,se)):(pe.flags|=1048576,se)}function ee(pe){return u&&pe.alternate===null&&(pe.flags|=2),pe}function le(pe,se,ye,je){return se===null||se.tag!==6?(se=u1(ye,pe.mode,je),se.return=pe,se):(se=j(se,ye),se.return=pe,se)}function ve(pe,se,ye,je){var Ke=ye.type;return Ke===h?He(pe,se,ye.props.children,je,ye.key):se!==null&&(se.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===d&&F2(Ke)===se.type)?(je=j(se,ye.props),je.ref=pu(pe,se,ye),je.return=pe,je):(je=qf(ye.type,ye.key,ye.props,null,pe.mode,je),je.ref=pu(pe,se,ye),je.return=pe,je)}function Te(pe,se,ye,je){return se===null||se.tag!==4||se.stateNode.containerInfo!==ye.containerInfo||se.stateNode.implementation!==ye.implementation?(se=c1(ye,pe.mode,je),se.return=pe,se):(se=j(se,ye.children||[]),se.return=pe,se)}function He(pe,se,ye,je,Ke){return se===null||se.tag!==7?(se=qa(ye,pe.mode,je,Ke),se.return=pe,se):(se=j(se,ye),se.return=pe,se)}function nt(pe,se,ye){if(typeof se=="string"&&se!==""||typeof se=="number")return se=u1(""+se,pe.mode,ye),se.return=pe,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case s:return ye=qf(se.type,se.key,se.props,null,pe.mode,ye),ye.ref=pu(pe,null,se),ye.return=pe,ye;case f:return se=c1(se,pe.mode,ye),se.return=pe,se;case d:var je=se._init;return nt(pe,je(se._payload),ye)}if(G(se)||A(se))return se=qa(se,pe.mode,ye,null),se.return=pe,se;gf(pe,se)}return null}function De(pe,se,ye,je){var Ke=se!==null?se.key:null;if(typeof ye=="string"&&ye!==""||typeof ye=="number")return Ke!==null?null:le(pe,se,""+ye,je);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case s:return ye.key===Ke?ve(pe,se,ye,je):null;case f:return ye.key===Ke?Te(pe,se,ye,je):null;case d:return Ke=ye._init,De(pe,se,Ke(ye._payload),je)}if(G(ye)||A(ye))return Ke!==null?null:He(pe,se,ye,je,null);gf(pe,ye)}return null}function Bt(pe,se,ye,je,Ke){if(typeof je=="string"&&je!==""||typeof je=="number")return pe=pe.get(ye)||null,le(se,pe,""+je,Ke);if(typeof je=="object"&&je!==null){switch(je.$$typeof){case s:return pe=pe.get(je.key===null?ye:je.key)||null,ve(se,pe,je,Ke);case f:return pe=pe.get(je.key===null?ye:je.key)||null,Te(se,pe,je,Ke);case d:var lt=je._init;return Bt(pe,se,ye,lt(je._payload),Ke)}if(G(je)||A(je))return pe=pe.get(ye)||null,He(se,pe,je,Ke,null);gf(se,je)}return null}function Mt(pe,se,ye,je){for(var Ke=null,lt=null,rt=se,bt=se=0,Tn=null;rt!==null&&bt<ye.length;bt++){rt.index>bt?(Tn=rt,rt=null):Tn=rt.sibling;var _t=De(pe,rt,ye[bt],je);if(_t===null){rt===null&&(rt=Tn);break}u&&rt&&_t.alternate===null&&c(pe,rt),se=q(_t,se,bt),lt===null?Ke=_t:lt.sibling=_t,lt=_t,rt=Tn}if(bt===ye.length)return k(pe,rt),$t&&za(pe,bt),Ke;if(rt===null){for(;bt<ye.length;bt++)rt=nt(pe,ye[bt],je),rt!==null&&(se=q(rt,se,bt),lt===null?Ke=rt:lt.sibling=rt,lt=rt);return $t&&za(pe,bt),Ke}for(rt=I(pe,rt);bt<ye.length;bt++)Tn=Bt(rt,pe,bt,ye[bt],je),Tn!==null&&(u&&Tn.alternate!==null&&rt.delete(Tn.key===null?bt:Tn.key),se=q(Tn,se,bt),lt===null?Ke=Tn:lt.sibling=Tn,lt=Tn);return u&&rt.forEach(function(Wo){return c(pe,Wo)}),$t&&za(pe,bt),Ke}function ur(pe,se,ye,je){var Ke=A(ye);if(typeof Ke!="function")throw Error(a(150));if(ye=Ke.call(ye),ye==null)throw Error(a(151));for(var lt=Ke=null,rt=se,bt=se=0,Tn=null,_t=ye.next();rt!==null&&!_t.done;bt++,_t=ye.next()){rt.index>bt?(Tn=rt,rt=null):Tn=rt.sibling;var Wo=De(pe,rt,_t.value,je);if(Wo===null){rt===null&&(rt=Tn);break}u&&rt&&Wo.alternate===null&&c(pe,rt),se=q(Wo,se,bt),lt===null?Ke=Wo:lt.sibling=Wo,lt=Wo,rt=Tn}if(_t.done)return k(pe,rt),$t&&za(pe,bt),Ke;if(rt===null){for(;!_t.done;bt++,_t=ye.next())_t=nt(pe,_t.value,je),_t!==null&&(se=q(_t,se,bt),lt===null?Ke=_t:lt.sibling=_t,lt=_t);return $t&&za(pe,bt),Ke}for(rt=I(pe,rt);!_t.done;bt++,_t=ye.next())_t=Bt(rt,pe,bt,_t.value,je),_t!==null&&(u&&_t.alternate!==null&&rt.delete(_t.key===null?bt:_t.key),se=q(_t,se,bt),lt===null?Ke=_t:lt.sibling=_t,lt=_t);return u&&rt.forEach(function(xE){return c(pe,xE)}),$t&&za(pe,bt),Ke}function co(pe,se,ye,je){if(typeof ye=="object"&&ye!==null&&ye.type===h&&ye.key===null&&(ye=ye.props.children),typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case s:e:{for(var Ke=ye.key,lt=se;lt!==null;){if(lt.key===Ke){if(Ke=ye.type,Ke===h){if(lt.tag===7){k(pe,lt.sibling),se=j(lt,ye.props.children),se.return=pe,pe=se;break e}}else if(lt.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===d&&F2(Ke)===lt.type){k(pe,lt.sibling),se=j(lt,ye.props),se.ref=pu(pe,lt,ye),se.return=pe,pe=se;break e}k(pe,lt);break}else c(pe,lt);lt=lt.sibling}ye.type===h?(se=qa(ye.props.children,pe.mode,je,ye.key),se.return=pe,pe=se):(je=qf(ye.type,ye.key,ye.props,null,pe.mode,je),je.ref=pu(pe,se,ye),je.return=pe,pe=je)}return ee(pe);case f:e:{for(lt=ye.key;se!==null;){if(se.key===lt)if(se.tag===4&&se.stateNode.containerInfo===ye.containerInfo&&se.stateNode.implementation===ye.implementation){k(pe,se.sibling),se=j(se,ye.children||[]),se.return=pe,pe=se;break e}else{k(pe,se);break}else c(pe,se);se=se.sibling}se=c1(ye,pe.mode,je),se.return=pe,pe=se}return ee(pe);case d:return lt=ye._init,co(pe,se,lt(ye._payload),je)}if(G(ye))return Mt(pe,se,ye,je);if(A(ye))return ur(pe,se,ye,je);gf(pe,ye)}return typeof ye=="string"&&ye!==""||typeof ye=="number"?(ye=""+ye,se!==null&&se.tag===6?(k(pe,se.sibling),se=j(se,ye),se.return=pe,pe=se):(k(pe,se),se=u1(ye,pe.mode,je),se.return=pe,pe=se),ee(pe)):k(pe,se)}return co}var Ul=z2(!0),B2=z2(!1),vf=Fo(null),mf=null,Hl=null,g0=null;function v0(){g0=Hl=mf=null}function U2(u,c,k){Q?(Nt(vf,c._currentValue),c._currentValue=k):(Nt(vf,c._currentValue2),c._currentValue2=k)}function m0(u){var c=vf.current;zt(vf),Q?u._currentValue=c:u._currentValue2=c}function y0(u,c,k){for(;u!==null;){var I=u.alternate;if((u.childLanes&c)!==c?(u.childLanes|=c,I!==null&&(I.childLanes|=c)):I!==null&&(I.childLanes&c)!==c&&(I.childLanes|=c),u===k)break;u=u.return}}function $l(u,c){mf=u,g0=Hl=null,u=u.dependencies,u!==null&&u.firstContext!==null&&(u.lanes&c&&(ar=!0),u.firstContext=null)}function Br(u){var c=Q?u._currentValue:u._currentValue2;if(g0!==u)if(u={context:u,memoizedValue:c,next:null},Hl===null){if(mf===null)throw Error(a(308));Hl=u,mf.dependencies={lanes:0,firstContext:u}}else Hl=Hl.next=u;return c}var Ba=null;function b0(u){Ba===null?Ba=[u]:Ba.push(u)}function H2(u,c,k,I){var j=c.interleaved;return j===null?(k.next=k,b0(c)):(k.next=j.next,j.next=k),c.interleaved=k,Ri(u,I)}function Ri(u,c){u.lanes|=c;var k=u.alternate;for(k!==null&&(k.lanes|=c),k=u,u=u.return;u!==null;)u.childLanes|=c,k=u.alternate,k!==null&&(k.childLanes|=c),k=u,u=u.return;return k.tag===3?k.stateNode:null}var Bo=!1;function _0(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $2(u,c){u=u.updateQueue,c.updateQueue===u&&(c.updateQueue={baseState:u.baseState,firstBaseUpdate:u.firstBaseUpdate,lastBaseUpdate:u.lastBaseUpdate,shared:u.shared,effects:u.effects})}function lo(u,c){return{eventTime:u,lane:c,tag:0,payload:null,callback:null,next:null}}function Uo(u,c,k){var I=u.updateQueue;if(I===null)return null;if(I=I.shared,ct&2){var j=I.pending;return j===null?c.next=c:(c.next=j.next,j.next=c),I.pending=c,Ri(u,k)}return j=I.interleaved,j===null?(c.next=c,b0(I)):(c.next=j.next,j.next=c),I.interleaved=c,Ri(u,k)}function yf(u,c,k){if(c=c.updateQueue,c!==null&&(c=c.shared,(k&4194240)!==0)){var I=c.lanes;I&=u.pendingLanes,k|=I,c.lanes=k,o0(u,k)}}function G2(u,c){var k=u.updateQueue,I=u.alternate;if(I!==null&&(I=I.updateQueue,k===I)){var j=null,q=null;if(k=k.firstBaseUpdate,k!==null){do{var ee={eventTime:k.eventTime,lane:k.lane,tag:k.tag,payload:k.payload,callback:k.callback,next:null};q===null?j=q=ee:q=q.next=ee,k=k.next}while(k!==null);q===null?j=q=c:q=q.next=c}else j=q=c;k={baseState:I.baseState,firstBaseUpdate:j,lastBaseUpdate:q,shared:I.shared,effects:I.effects},u.updateQueue=k;return}u=k.lastBaseUpdate,u===null?k.firstBaseUpdate=c:u.next=c,k.lastBaseUpdate=c}function bf(u,c,k,I){var j=u.updateQueue;Bo=!1;var q=j.firstBaseUpdate,ee=j.lastBaseUpdate,le=j.shared.pending;if(le!==null){j.shared.pending=null;var ve=le,Te=ve.next;ve.next=null,ee===null?q=Te:ee.next=Te,ee=ve;var He=u.alternate;He!==null&&(He=He.updateQueue,le=He.lastBaseUpdate,le!==ee&&(le===null?He.firstBaseUpdate=Te:le.next=Te,He.lastBaseUpdate=ve))}if(q!==null){var nt=j.baseState;ee=0,He=Te=ve=null,le=q;do{var De=le.lane,Bt=le.eventTime;if((I&De)===De){He!==null&&(He=He.next={eventTime:Bt,lane:0,tag:le.tag,payload:le.payload,callback:le.callback,next:null});e:{var Mt=u,ur=le;switch(De=c,Bt=k,ur.tag){case 1:if(Mt=ur.payload,typeof Mt=="function"){nt=Mt.call(Bt,nt,De);break e}nt=Mt;break e;case 3:Mt.flags=Mt.flags&-65537|128;case 0:if(Mt=ur.payload,De=typeof Mt=="function"?Mt.call(Bt,nt,De):Mt,De==null)break e;nt=o({},nt,De);break e;case 2:Bo=!0}}le.callback!==null&&le.lane!==0&&(u.flags|=64,De=j.effects,De===null?j.effects=[le]:De.push(le))}else Bt={eventTime:Bt,lane:De,tag:le.tag,payload:le.payload,callback:le.callback,next:null},He===null?(Te=He=Bt,ve=nt):He=He.next=Bt,ee|=De;if(le=le.next,le===null){if(le=j.shared.pending,le===null)break;De=le,le=De.next,De.next=null,j.lastBaseUpdate=De,j.shared.pending=null}}while(!0);if(He===null&&(ve=nt),j.baseState=ve,j.firstBaseUpdate=Te,j.lastBaseUpdate=He,c=j.shared.interleaved,c!==null){j=c;do ee|=j.lane,j=j.next;while(j!==c)}else q===null&&(j.shared.lanes=0);Ha|=ee,u.lanes=ee,u.memoizedState=nt}}function V2(u,c,k){if(u=c.effects,c.effects=null,u!==null)for(c=0;c<u.length;c++){var I=u[c],j=I.callback;if(j!==null){if(I.callback=null,I=k,typeof j!="function")throw Error(a(191,j));j.call(I)}}}var gu={},Ur=Fo(gu),vu=Fo(gu),Gl=Fo(gu);function Mi(u){if(u===gu)throw Error(a(174));return u}function w0(u,c){Nt(Gl,c),Nt(vu,u),Nt(Ur,gu),u=W(c),zt(Ur),Nt(Ur,u)}function Vl(){zt(Ur),zt(vu),zt(Gl)}function q2(u){var c=Mi(Gl.current),k=Mi(Ur.current);c=H(k,u.type,c),k!==c&&(Nt(vu,u),Nt(Ur,c))}function S0(u){vu.current===u&&(zt(Ur),zt(vu))}var Kt=Fo(0);function _f(u){for(var c=u;c!==null;){if(c.tag===13){var k=c.memoizedState;if(k!==null&&(k=k.dehydrated,k===null||hn(k)||pn(k)))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if(c.flags&128)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===u)break;for(;c.sibling===null;){if(c.return===null||c.return===u)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var E0=[];function O0(){for(var u=0;u<E0.length;u++){var c=E0[u];Q?c._workInProgressVersionPrimary=null:c._workInProgressVersionSecondary=null}E0.length=0}var wf=l.ReactCurrentDispatcher,x0=l.ReactCurrentBatchConfig,Ua=0,Xt=null,gn=null,Cn=null,Sf=!1,mu=!1,yu=0,XS=0;function Hn(){throw Error(a(321))}function P0(u,c){if(c===null)return!1;for(var k=0;k<c.length&&k<u.length;k++)if(!oi(u[k],c[k]))return!1;return!0}function C0(u,c,k,I,j,q){if(Ua=q,Xt=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,wf.current=u===null||u.memoizedState===null?eE:tE,u=k(I,j),mu){q=0;do{if(mu=!1,yu=0,25<=q)throw Error(a(301));q+=1,Cn=gn=null,c.updateQueue=null,wf.current=nE,u=k(I,j)}while(mu)}if(wf.current=xf,c=gn!==null&&gn.next!==null,Ua=0,Cn=gn=Xt=null,Sf=!1,c)throw Error(a(300));return u}function k0(){var u=yu!==0;return yu=0,u}function Li(){var u={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Cn===null?Xt.memoizedState=Cn=u:Cn=Cn.next=u,Cn}function Hr(){if(gn===null){var u=Xt.alternate;u=u!==null?u.memoizedState:null}else u=gn.next;var c=Cn===null?Xt.memoizedState:Cn.next;if(c!==null)Cn=c,gn=u;else{if(u===null)throw Error(a(310));gn=u,u={memoizedState:gn.memoizedState,baseState:gn.baseState,baseQueue:gn.baseQueue,queue:gn.queue,next:null},Cn===null?Xt.memoizedState=Cn=u:Cn=Cn.next=u}return Cn}function bu(u,c){return typeof c=="function"?c(u):c}function T0(u){var c=Hr(),k=c.queue;if(k===null)throw Error(a(311));k.lastRenderedReducer=u;var I=gn,j=I.baseQueue,q=k.pending;if(q!==null){if(j!==null){var ee=j.next;j.next=q.next,q.next=ee}I.baseQueue=j=q,k.pending=null}if(j!==null){q=j.next,I=I.baseState;var le=ee=null,ve=null,Te=q;do{var He=Te.lane;if((Ua&He)===He)ve!==null&&(ve=ve.next={lane:0,action:Te.action,hasEagerState:Te.hasEagerState,eagerState:Te.eagerState,next:null}),I=Te.hasEagerState?Te.eagerState:u(I,Te.action);else{var nt={lane:He,action:Te.action,hasEagerState:Te.hasEagerState,eagerState:Te.eagerState,next:null};ve===null?(le=ve=nt,ee=I):ve=ve.next=nt,Xt.lanes|=He,Ha|=He}Te=Te.next}while(Te!==null&&Te!==q);ve===null?ee=I:ve.next=le,oi(I,c.memoizedState)||(ar=!0),c.memoizedState=I,c.baseState=ee,c.baseQueue=ve,k.lastRenderedState=I}if(u=k.interleaved,u!==null){j=u;do q=j.lane,Xt.lanes|=q,Ha|=q,j=j.next;while(j!==u)}else j===null&&(k.lanes=0);return[c.memoizedState,k.dispatch]}function A0(u){var c=Hr(),k=c.queue;if(k===null)throw Error(a(311));k.lastRenderedReducer=u;var I=k.dispatch,j=k.pending,q=c.memoizedState;if(j!==null){k.pending=null;var ee=j=j.next;do q=u(q,ee.action),ee=ee.next;while(ee!==j);oi(q,c.memoizedState)||(ar=!0),c.memoizedState=q,c.baseQueue===null&&(c.baseState=q),k.lastRenderedState=q}return[q,I]}function W2(){}function Y2(u,c){var k=Xt,I=Hr(),j=c(),q=!oi(I.memoizedState,j);if(q&&(I.memoizedState=j,ar=!0),I=I.queue,R0(Z2.bind(null,k,I,u),[u]),I.getSnapshot!==c||q||Cn!==null&&Cn.memoizedState.tag&1){if(k.flags|=2048,_u(9,X2.bind(null,k,I,j,c),void 0,null),kn===null)throw Error(a(349));Ua&30||K2(k,c,j)}return j}function K2(u,c,k){u.flags|=16384,u={getSnapshot:c,value:k},c=Xt.updateQueue,c===null?(c={lastEffect:null,stores:null},Xt.updateQueue=c,c.stores=[u]):(k=c.stores,k===null?c.stores=[u]:k.push(u))}function X2(u,c,k,I){c.value=k,c.getSnapshot=I,Q2(c)&&J2(u)}function Z2(u,c,k){return k(function(){Q2(c)&&J2(u)})}function Q2(u){var c=u.getSnapshot;u=u.value;try{var k=c();return!oi(u,k)}catch{return!0}}function J2(u){var c=Ri(u,1);c!==null&&$r(c,u,1,-1)}function eb(u){var c=Li();return typeof u=="function"&&(u=u()),c.memoizedState=c.baseState=u,u={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:bu,lastRenderedState:u},c.queue=u,u=u.dispatch=JS.bind(null,Xt,u),[c.memoizedState,u]}function _u(u,c,k,I){return u={tag:u,create:c,destroy:k,deps:I,next:null},c=Xt.updateQueue,c===null?(c={lastEffect:null,stores:null},Xt.updateQueue=c,c.lastEffect=u.next=u):(k=c.lastEffect,k===null?c.lastEffect=u.next=u:(I=k.next,k.next=u,u.next=I,c.lastEffect=u)),u}function tb(){return Hr().memoizedState}function Ef(u,c,k,I){var j=Li();Xt.flags|=u,j.memoizedState=_u(1|c,k,void 0,I===void 0?null:I)}function Of(u,c,k,I){var j=Hr();I=I===void 0?null:I;var q=void 0;if(gn!==null){var ee=gn.memoizedState;if(q=ee.destroy,I!==null&&P0(I,ee.deps)){j.memoizedState=_u(c,k,q,I);return}}Xt.flags|=u,j.memoizedState=_u(1|c,k,q,I)}function nb(u,c){return Ef(8390656,8,u,c)}function R0(u,c){return Of(2048,8,u,c)}function rb(u,c){return Of(4,2,u,c)}function ib(u,c){return Of(4,4,u,c)}function ob(u,c){if(typeof c=="function")return u=u(),c(u),function(){c(null)};if(c!=null)return u=u(),c.current=u,function(){c.current=null}}function ab(u,c,k){return k=k!=null?k.concat([u]):null,Of(4,4,ob.bind(null,c,u),k)}function M0(){}function lb(u,c){var k=Hr();c=c===void 0?null:c;var I=k.memoizedState;return I!==null&&c!==null&&P0(c,I[1])?I[0]:(k.memoizedState=[u,c],u)}function sb(u,c){var k=Hr();c=c===void 0?null:c;var I=k.memoizedState;return I!==null&&c!==null&&P0(c,I[1])?I[0]:(u=u(),k.memoizedState=[u,c],u)}function ub(u,c,k){return Ua&21?(oi(k,c)||(k=T2(),Xt.lanes|=k,Ha|=k,u.baseState=!0),c):(u.baseState&&(u.baseState=!1,ar=!0),u.memoizedState=k)}function ZS(u,c){var k=yt;yt=k!==0&&4>k?k:4,u(!0);var I=x0.transition;x0.transition={};try{u(!1),c()}finally{yt=k,x0.transition=I}}function cb(){return Hr().memoizedState}function QS(u,c,k){var I=Go(u);if(k={lane:I,action:k,hasEagerState:!1,eagerState:null,next:null},fb(u))db(c,k);else if(k=H2(u,c,k,I),k!==null){var j=Vn();$r(k,u,I,j),hb(k,c,I)}}function JS(u,c,k){var I=Go(u),j={lane:I,action:k,hasEagerState:!1,eagerState:null,next:null};if(fb(u))db(c,j);else{var q=u.alternate;if(u.lanes===0&&(q===null||q.lanes===0)&&(q=c.lastRenderedReducer,q!==null))try{var ee=c.lastRenderedState,le=q(ee,k);if(j.hasEagerState=!0,j.eagerState=le,oi(le,ee)){var ve=c.interleaved;ve===null?(j.next=j,b0(c)):(j.next=ve.next,ve.next=j),c.interleaved=j;return}}catch{}finally{}k=H2(u,c,j,I),k!==null&&(j=Vn(),$r(k,u,I,j),hb(k,c,I))}}function fb(u){var c=u.alternate;return u===Xt||c!==null&&c===Xt}function db(u,c){mu=Sf=!0;var k=u.pending;k===null?c.next=c:(c.next=k.next,k.next=c),u.pending=c}function hb(u,c,k){if(k&4194240){var I=c.lanes;I&=u.pendingLanes,k|=I,c.lanes=k,o0(u,k)}}var xf={readContext:Br,useCallback:Hn,useContext:Hn,useEffect:Hn,useImperativeHandle:Hn,useInsertionEffect:Hn,useLayoutEffect:Hn,useMemo:Hn,useReducer:Hn,useRef:Hn,useState:Hn,useDebugValue:Hn,useDeferredValue:Hn,useTransition:Hn,useMutableSource:Hn,useSyncExternalStore:Hn,useId:Hn,unstable_isNewReconciler:!1},eE={readContext:Br,useCallback:function(u,c){return Li().memoizedState=[u,c===void 0?null:c],u},useContext:Br,useEffect:nb,useImperativeHandle:function(u,c,k){return k=k!=null?k.concat([u]):null,Ef(4194308,4,ob.bind(null,c,u),k)},useLayoutEffect:function(u,c){return Ef(4194308,4,u,c)},useInsertionEffect:function(u,c){return Ef(4,2,u,c)},useMemo:function(u,c){var k=Li();return c=c===void 0?null:c,u=u(),k.memoizedState=[u,c],u},useReducer:function(u,c,k){var I=Li();return c=k!==void 0?k(c):c,I.memoizedState=I.baseState=c,u={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:c},I.queue=u,u=u.dispatch=QS.bind(null,Xt,u),[I.memoizedState,u]},useRef:function(u){var c=Li();return u={current:u},c.memoizedState=u},useState:eb,useDebugValue:M0,useDeferredValue:function(u){return Li().memoizedState=u},useTransition:function(){var u=eb(!1),c=u[0];return u=ZS.bind(null,u[1]),Li().memoizedState=u,[c,u]},useMutableSource:function(){},useSyncExternalStore:function(u,c,k){var I=Xt,j=Li();if($t){if(k===void 0)throw Error(a(407));k=k()}else{if(k=c(),kn===null)throw Error(a(349));Ua&30||K2(I,c,k)}j.memoizedState=k;var q={value:k,getSnapshot:c};return j.queue=q,nb(Z2.bind(null,I,q,u),[u]),I.flags|=2048,_u(9,X2.bind(null,I,q,k,c),void 0,null),k},useId:function(){var u=Li(),c=kn.identifierPrefix;if($t){var k=ao,I=oo;k=(I&~(1<<32-ii(I)-1)).toString(32)+k,c=":"+c+"R"+k,k=yu++,0<k&&(c+="H"+k.toString(32)),c+=":"}else k=XS++,c=":"+c+"r"+k.toString(32)+":";return u.memoizedState=c},unstable_isNewReconciler:!1},tE={readContext:Br,useCallback:lb,useContext:Br,useEffect:R0,useImperativeHandle:ab,useInsertionEffect:rb,useLayoutEffect:ib,useMemo:sb,useReducer:T0,useRef:tb,useState:function(){return T0(bu)},useDebugValue:M0,useDeferredValue:function(u){var c=Hr();return ub(c,gn.memoizedState,u)},useTransition:function(){var u=T0(bu)[0],c=Hr().memoizedState;return[u,c]},useMutableSource:W2,useSyncExternalStore:Y2,useId:cb,unstable_isNewReconciler:!1},nE={readContext:Br,useCallback:lb,useContext:Br,useEffect:R0,useImperativeHandle:ab,useInsertionEffect:rb,useLayoutEffect:ib,useMemo:sb,useReducer:A0,useRef:tb,useState:function(){return A0(bu)},useDebugValue:M0,useDeferredValue:function(u){var c=Hr();return gn===null?c.memoizedState=u:ub(c,gn.memoizedState,u)},useTransition:function(){var u=A0(bu)[0],c=Hr().memoizedState;return[u,c]},useMutableSource:W2,useSyncExternalStore:Y2,useId:cb,unstable_isNewReconciler:!1};function li(u,c){if(u&&u.defaultProps){c=o({},c),u=u.defaultProps;for(var k in u)c[k]===void 0&&(c[k]=u[k]);return c}return c}function L0(u,c,k,I){c=u.memoizedState,k=k(I,c),k=k==null?c:o({},c,k),u.memoizedState=k,u.lanes===0&&(u.updateQueue.baseState=k)}var Pf={isMounted:function(u){return(u=u._reactInternals)?S(u)===u:!1},enqueueSetState:function(u,c,k){u=u._reactInternals;var I=Vn(),j=Go(u),q=lo(I,j);q.payload=c,k!=null&&(q.callback=k),c=Uo(u,q,j),c!==null&&($r(c,u,j,I),yf(c,u,j))},enqueueReplaceState:function(u,c,k){u=u._reactInternals;var I=Vn(),j=Go(u),q=lo(I,j);q.tag=1,q.payload=c,k!=null&&(q.callback=k),c=Uo(u,q,j),c!==null&&($r(c,u,j,I),yf(c,u,j))},enqueueForceUpdate:function(u,c){u=u._reactInternals;var k=Vn(),I=Go(u),j=lo(k,I);j.tag=2,c!=null&&(j.callback=c),c=Uo(u,j,I),c!==null&&($r(c,u,I,k),yf(c,u,I))}};function pb(u,c,k,I,j,q,ee){return u=u.stateNode,typeof u.shouldComponentUpdate=="function"?u.shouldComponentUpdate(I,q,ee):c.prototype&&c.prototype.isPureReactComponent?!pf(k,I)||!pf(j,q):!0}function gb(u,c,k){var I=!1,j=zo,q=c.contextType;return typeof q=="object"&&q!==null?q=Br(q):(j=or(c)?ja:Un.current,I=c.contextTypes,q=(I=I!=null)?jl(u,j):zo),c=new c(k,q),u.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Pf,u.stateNode=c,c._reactInternals=u,I&&(u=u.stateNode,u.__reactInternalMemoizedUnmaskedChildContext=j,u.__reactInternalMemoizedMaskedChildContext=q),c}function vb(u,c,k,I){u=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(k,I),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(k,I),c.state!==u&&Pf.enqueueReplaceState(c,c.state,null)}function N0(u,c,k,I){var j=u.stateNode;j.props=k,j.state=u.memoizedState,j.refs={},_0(u);var q=c.contextType;typeof q=="object"&&q!==null?j.context=Br(q):(q=or(c)?ja:Un.current,j.context=jl(u,q)),j.state=u.memoizedState,q=c.getDerivedStateFromProps,typeof q=="function"&&(L0(u,c,q,k),j.state=u.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof j.getSnapshotBeforeUpdate=="function"||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(c=j.state,typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount(),c!==j.state&&Pf.enqueueReplaceState(j,j.state,null),bf(u,k,j,I),j.state=u.memoizedState),typeof j.componentDidMount=="function"&&(u.flags|=4194308)}function ql(u,c){try{var k="",I=c;do k+=KS(I),I=I.return;while(I);var j=k}catch(q){j=`
|
|
56
56
|
Error generating stack: `+q.message+`
|
|
57
|
-
`+q.stack}return{value:u,source:c,stack:j,digest:null}}function I0(u,c,k){return{value:u,source:null,stack:k??null,digest:c??null}}function D0(u,c){try{console.error(c.value)}catch(k){setTimeout(function(){throw k})}}var rE=typeof WeakMap=="function"?WeakMap:Map;function mb(u,c,k){k=lo(-1,k),k.tag=3,k.payload={element:null};var I=c.value;return k.callback=function(){Bf||(Bf=!0,n1=I),D0(u,c)},k}function yb(u,c,k){k=lo(-1,k),k.tag=3;var I=u.type.getDerivedStateFromError;if(typeof I=="function"){var j=c.value;k.payload=function(){return I(j)},k.callback=function(){D0(u,c)}}var q=u.stateNode;return q!==null&&typeof q.componentDidCatch=="function"&&(k.callback=function(){D0(u,c),typeof I!="function"&&(Ho===null?Ho=new Set([this]):Ho.add(this));var ee=c.stack;this.componentDidCatch(c.value,{componentStack:ee!==null?ee:""})}),k}function bb(u,c,k){var I=u.pingCache;if(I===null){I=u.pingCache=new rE;var j=new Set;I.set(c,j)}else j=I.get(c),j===void 0&&(j=new Set,I.set(c,j));j.has(k)||(j.add(k),u=mE.bind(null,u,c,k),c.then(u,u))}function _b(u){do{var c;if((c=u.tag===13)&&(c=u.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return u;u=u.return}while(u!==null);return null}function wb(u,c,k,I,j){return u.mode&1?(u.flags|=65536,u.lanes=j,u):(u===c?u.flags|=65536:(u.flags|=128,k.flags|=131072,k.flags&=-52805,k.tag===1&&(k.alternate===null?k.tag=17:(c=lo(-1,1),c.tag=2,Uo(k,c,1))),k.lanes|=1),u)}var iE=l.ReactCurrentOwner,ar=!1;function Zn(u,c,k,I){c.child=u===null?B2(c,null,k,I):Ul(c,u.child,k,I)}function Sb(u,c,k,I,j){k=k.render;var q=c.ref;return $l(c,j),I=C0(u,c,k,I,q,j),k=k0(),u!==null&&!ar?(c.updateQueue=u.updateQueue,c.flags&=-2053,u.lanes&=~j,so(u,c,j)):($t&&k&&c0(c),c.flags|=1,Zn(u,c,I,j),c.child)}function Eb(u,c,k,I,j){if(u===null){var q=k.type;return typeof q=="function"&&!s1(q)&&q.defaultProps===void 0&&k.compare===null&&k.defaultProps===void 0?(c.tag=15,c.type=q,Ob(u,c,q,I,j)):(u=qf(k.type,null,I,c,c.mode,j),u.ref=c.ref,u.return=c,c.child=u)}if(q=u.child,!(u.lanes&j)){var ee=q.memoizedProps;if(k=k.compare,k=k!==null?k:pf,k(ee,I)&&u.ref===c.ref)return so(u,c,j)}return c.flags|=1,u=qo(q,I),u.ref=c.ref,u.return=c,c.child=u}function Ob(u,c,k,I,j){if(u!==null){var q=u.memoizedProps;if(pf(q,I)&&u.ref===c.ref)if(ar=!1,c.pendingProps=I=q,(u.lanes&j)!==0)u.flags&131072&&(ar=!0);else return c.lanes=u.lanes,so(u,c,j)}return j0(u,c,k,I,j)}function xb(u,c,k){var I=c.pendingProps,j=I.children,q=u!==null?u.memoizedState:null;if(I.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Nt(Yl,Or),Or|=k;else{if(!(k&1073741824))return u=q!==null?q.baseLanes|k:k,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:u,cachePool:null,transitions:null},c.updateQueue=null,Nt(Yl,Or),Or|=u,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},I=q!==null?q.baseLanes:k,Nt(Yl,Or),Or|=I}else q!==null?(I=q.baseLanes|k,c.memoizedState=null):I=k,Nt(Yl,Or),Or|=I;return Zn(u,c,j,k),c.child}function Pb(u,c){var k=c.ref;(u===null&&k!==null||u!==null&&u.ref!==k)&&(c.flags|=512,c.flags|=2097152)}function j0(u,c,k,I,j){var q=or(k)?ja:Un.current;return q=jl(c,q),$l(c,j),k=C0(u,c,k,I,q,j),I=k0(),u!==null&&!ar?(c.updateQueue=u.updateQueue,c.flags&=-2053,u.lanes&=~j,so(u,c,j)):($t&&I&&c0(c),c.flags|=1,Zn(u,c,k,j),c.child)}function Cb(u,c,k,I,j){if(or(k)){var q=!0;of(c)}else q=!1;if($l(c,j),c.stateNode===null)kf(u,c),gb(c,k,I),N0(c,k,I,j),I=!0;else if(u===null){var ee=c.stateNode,le=c.memoizedProps;ee.props=le;var ve=ee.context,Te=k.contextType;typeof Te=="object"&&Te!==null?Te=Br(Te):(Te=or(k)?ja:Un.current,Te=jl(c,Te));var He=k.getDerivedStateFromProps,nt=typeof He=="function"||typeof ee.getSnapshotBeforeUpdate=="function";nt||typeof ee.UNSAFE_componentWillReceiveProps!="function"&&typeof ee.componentWillReceiveProps!="function"||(le!==I||ve!==Te)&&vb(c,ee,I,Te),Bo=!1;var De=c.memoizedState;ee.state=De,bf(c,I,ee,j),ve=c.memoizedState,le!==I||De!==ve||ir.current||Bo?(typeof He=="function"&&(L0(c,k,He,I),ve=c.memoizedState),(le=Bo||pb(c,k,le,I,De,ve,Te))?(nt||typeof ee.UNSAFE_componentWillMount!="function"&&typeof ee.componentWillMount!="function"||(typeof ee.componentWillMount=="function"&&ee.componentWillMount(),typeof ee.UNSAFE_componentWillMount=="function"&&ee.UNSAFE_componentWillMount()),typeof ee.componentDidMount=="function"&&(c.flags|=4194308)):(typeof ee.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=I,c.memoizedState=ve),ee.props=I,ee.state=ve,ee.context=Te,I=le):(typeof ee.componentDidMount=="function"&&(c.flags|=4194308),I=!1)}else{ee=c.stateNode,$2(u,c),le=c.memoizedProps,Te=c.type===c.elementType?le:li(c.type,le),ee.props=Te,nt=c.pendingProps,De=ee.context,ve=k.contextType,typeof ve=="object"&&ve!==null?ve=Br(ve):(ve=or(k)?ja:Un.current,ve=jl(c,ve));var Bt=k.getDerivedStateFromProps;(He=typeof Bt=="function"||typeof ee.getSnapshotBeforeUpdate=="function")||typeof ee.UNSAFE_componentWillReceiveProps!="function"&&typeof ee.componentWillReceiveProps!="function"||(le!==nt||De!==ve)&&vb(c,ee,I,ve),Bo=!1,De=c.memoizedState,ee.state=De,bf(c,I,ee,j);var Mt=c.memoizedState;le!==nt||De!==Mt||ir.current||Bo?(typeof Bt=="function"&&(L0(c,k,Bt,I),Mt=c.memoizedState),(Te=Bo||pb(c,k,Te,I,De,Mt,ve)||!1)?(He||typeof ee.UNSAFE_componentWillUpdate!="function"&&typeof ee.componentWillUpdate!="function"||(typeof ee.componentWillUpdate=="function"&&ee.componentWillUpdate(I,Mt,ve),typeof ee.UNSAFE_componentWillUpdate=="function"&&ee.UNSAFE_componentWillUpdate(I,Mt,ve)),typeof ee.componentDidUpdate=="function"&&(c.flags|=4),typeof ee.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof ee.componentDidUpdate!="function"||le===u.memoizedProps&&De===u.memoizedState||(c.flags|=4),typeof ee.getSnapshotBeforeUpdate!="function"||le===u.memoizedProps&&De===u.memoizedState||(c.flags|=1024),c.memoizedProps=I,c.memoizedState=Mt),ee.props=I,ee.state=Mt,ee.context=ve,I=Te):(typeof ee.componentDidUpdate!="function"||le===u.memoizedProps&&De===u.memoizedState||(c.flags|=4),typeof ee.getSnapshotBeforeUpdate!="function"||le===u.memoizedProps&&De===u.memoizedState||(c.flags|=1024),I=!1)}return F0(u,c,k,I,q,j)}function F0(u,c,k,I,j,q){Pb(u,c);var ee=(c.flags&128)!==0;if(!I&&!ee)return j&&k2(c,k,!1),so(u,c,q);I=c.stateNode,iE.current=c;var le=ee&&typeof k.getDerivedStateFromError!="function"?null:I.render();return c.flags|=1,u!==null&&ee?(c.child=Ul(c,u.child,null,q),c.child=Ul(c,null,le,q)):Zn(u,c,le,q),c.memoizedState=I.state,j&&k2(c,k,!0),c.child}function kb(u){var c=u.stateNode;c.pendingContext?P2(u,c.pendingContext,c.pendingContext!==c.context):c.context&&P2(u,c.context,!1),w0(u,c.containerInfo)}function Tb(u,c,k,I,j){return Bl(),p0(j),c.flags|=256,Zn(u,c,k,I),c.child}var z0={dehydrated:null,treeContext:null,retryLane:0};function B0(u){return{baseLanes:u,cachePool:null,transitions:null}}function Ab(u,c,k){var I=c.pendingProps,j=Kt.current,q=!1,ee=(c.flags&128)!==0,le;if((le=ee)||(le=u!==null&&u.memoizedState===null?!1:(j&2)!==0),le?(q=!0,c.flags&=-129):(u===null||u.memoizedState!==null)&&(j|=1),Nt(Kt,j&1),u===null)return h0(c),u=c.memoizedState,u!==null&&(u=u.dehydrated,u!==null)?(c.mode&1?pn(u)?c.lanes=8:c.lanes=1073741824:c.lanes=1,null):(ee=I.children,u=I.fallback,q?(I=c.mode,q=c.child,ee={mode:"hidden",children:ee},!(I&1)&&q!==null?(q.childLanes=0,q.pendingProps=ee):q=Wf(ee,I,0,null),u=qa(u,I,k,null),q.return=c,u.return=c,q.sibling=u,c.child=q,c.child.memoizedState=B0(k),c.memoizedState=z0,u):U0(c,ee));if(j=u.memoizedState,j!==null&&(le=j.dehydrated,le!==null))return oE(u,c,ee,I,le,j,k);if(q){q=I.fallback,ee=c.mode,j=u.child,le=j.sibling;var ve={mode:"hidden",children:I.children};return!(ee&1)&&c.child!==j?(I=c.child,I.childLanes=0,I.pendingProps=ve,c.deletions=null):(I=qo(j,ve),I.subtreeFlags=j.subtreeFlags&14680064),le!==null?q=qo(le,q):(q=qa(q,ee,k,null),q.flags|=2),q.return=c,I.return=c,I.sibling=q,c.child=I,I=q,q=c.child,ee=u.child.memoizedState,ee=ee===null?B0(k):{baseLanes:ee.baseLanes|k,cachePool:null,transitions:ee.transitions},q.memoizedState=ee,q.childLanes=u.childLanes&~k,c.memoizedState=z0,I}return q=u.child,u=q.sibling,I=qo(q,{mode:"visible",children:I.children}),!(c.mode&1)&&(I.lanes=k),I.return=c,I.sibling=null,u!==null&&(k=c.deletions,k===null?(c.deletions=[u],c.flags|=16):k.push(u)),c.child=I,c.memoizedState=null,I}function U0(u,c){return c=Wf({mode:"visible",children:c},u.mode,0,null),c.return=u,u.child=c}function Cf(u,c,k,I){return I!==null&&p0(I),Ul(c,u.child,null,k),u=U0(c,c.pendingProps.children),u.flags|=2,c.memoizedState=null,u}function oE(u,c,k,I,j,q,ee){if(k)return c.flags&256?(c.flags&=-257,I=I0(Error(a(422))),Cf(u,c,ee,I)):c.memoizedState!==null?(c.child=u.child,c.flags|=128,null):(q=I.fallback,j=c.mode,I=Wf({mode:"visible",children:I.children},j,0,null),q=qa(q,j,ee,null),q.flags|=2,I.return=c,q.return=c,I.sibling=q,c.child=I,c.mode&1&&Ul(c,u.child,null,ee),c.child.memoizedState=B0(ee),c.memoizedState=z0,q);if(!(c.mode&1))return Cf(u,c,ee,null);if(pn(j))return I=rr(j).digest,q=Error(a(419)),I=I0(q,I,void 0),Cf(u,c,ee,I);if(k=(ee&u.childLanes)!==0,ar||k){if(I=kn,I!==null){switch(ee&-ee){case 4:j=2;break;case 16:j=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:j=32;break;case 536870912:j=268435456;break;default:j=0}j=j&(I.suspendedLanes|ee)?0:j,j!==0&&j!==q.retryLane&&(q.retryLane=j,Ri(u,j),$r(I,u,j,-1))}return l1(),I=I0(Error(a(421))),Cf(u,c,ee,I)}return hn(j)?(c.flags|=128,c.child=u.child,c=yE.bind(null,u),to(j,c),null):(u=q.treeContext,ie&&(zr=ft(j),Er=c,$t=!0,ai=null,hu=!1,u!==null&&(jr[Fr++]=oo,jr[Fr++]=ao,jr[Fr++]=Fa,oo=u.id,ao=u.overflow,Fa=c)),c=U0(c,I.children),c.flags|=4096,c)}function Rb(u,c,k){u.lanes|=c;var I=u.alternate;I!==null&&(I.lanes|=c),y0(u.return,c,k)}function H0(u,c,k,I,j){var q=u.memoizedState;q===null?u.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:I,tail:k,tailMode:j}:(q.isBackwards=c,q.rendering=null,q.renderingStartTime=0,q.last=I,q.tail=k,q.tailMode=j)}function Mb(u,c,k){var I=c.pendingProps,j=I.revealOrder,q=I.tail;if(Zn(u,c,I.children,k),I=Kt.current,I&2)I=I&1|2,c.flags|=128;else{if(u!==null&&u.flags&128)e:for(u=c.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&Rb(u,k,c);else if(u.tag===19)Rb(u,k,c);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===c)break e;for(;u.sibling===null;){if(u.return===null||u.return===c)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}I&=1}if(Nt(Kt,I),!(c.mode&1))c.memoizedState=null;else switch(j){case"forwards":for(k=c.child,j=null;k!==null;)u=k.alternate,u!==null&&_f(u)===null&&(j=k),k=k.sibling;k=j,k===null?(j=c.child,c.child=null):(j=k.sibling,k.sibling=null),H0(c,!1,j,k,q);break;case"backwards":for(k=null,j=c.child,c.child=null;j!==null;){if(u=j.alternate,u!==null&&_f(u)===null){c.child=j;break}u=j.sibling,j.sibling=k,k=j,j=u}H0(c,!0,k,null,q);break;case"together":H0(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function kf(u,c){!(c.mode&1)&&u!==null&&(u.alternate=null,c.alternate=null,c.flags|=2)}function so(u,c,k){if(u!==null&&(c.dependencies=u.dependencies),Ha|=c.lanes,!(k&c.childLanes))return null;if(u!==null&&c.child!==u.child)throw Error(a(153));if(c.child!==null){for(u=c.child,k=qo(u,u.pendingProps),c.child=k,k.return=c;u.sibling!==null;)u=u.sibling,k=k.sibling=qo(u,u.pendingProps),k.return=c;k.sibling=null}return c.child}function aE(u,c,k){switch(c.tag){case 3:kb(c),Bl();break;case 5:q2(c);break;case 1:or(c.type)&&of(c);break;case 4:w0(c,c.stateNode.containerInfo);break;case 10:U2(c,c.type._context,c.memoizedProps.value);break;case 13:var I=c.memoizedState;if(I!==null)return I.dehydrated!==null?(Nt(Kt,Kt.current&1),c.flags|=128,null):k&c.child.childLanes?Ab(u,c,k):(Nt(Kt,Kt.current&1),u=so(u,c,k),u!==null?u.sibling:null);Nt(Kt,Kt.current&1);break;case 19:if(I=(k&c.childLanes)!==0,u.flags&128){if(I)return Mb(u,c,k);c.flags|=128}var j=c.memoizedState;if(j!==null&&(j.rendering=null,j.tail=null,j.lastEffect=null),Nt(Kt,Kt.current),I)break;return null;case 22:case 23:return c.lanes=0,xb(u,c,k)}return so(u,c,k)}function Ni(u){u.flags|=4}function Lb(u,c){if(u!==null&&u.child===c.child)return!0;if(c.flags&16)return!1;for(u=c.child;u!==null;){if(u.flags&12854||u.subtreeFlags&12854)return!1;u=u.sibling}return!0}var wu,Su,Tf,Af;if(J)wu=function(u,c){for(var k=c.child;k!==null;){if(k.tag===5||k.tag===6)B(u,k.stateNode);else if(k.tag!==4&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===c)break;for(;k.sibling===null;){if(k.return===null||k.return===c)return;k=k.return}k.sibling.return=k.return,k=k.sibling}},Su=function(){},Tf=function(u,c,k,I,j){if(u=u.memoizedProps,u!==I){var q=c.stateNode,ee=Mi(Ur.current);k=Y(q,k,u,I,j,ee),(c.updateQueue=k)&&Ni(c)}},Af=function(u,c,k,I){k!==I&&Ni(c)};else if(ne){wu=function(u,c,k,I){for(var j=c.child;j!==null;){if(j.tag===5){var q=j.stateNode;k&&I&&(q=Ye(q,j.type,j.memoizedProps,j)),B(u,q)}else if(j.tag===6)q=j.stateNode,k&&I&&(q=at(q,j.memoizedProps,j)),B(u,q);else if(j.tag!==4){if(j.tag===22&&j.memoizedState!==null)q=j.child,q!==null&&(q.return=j),wu(u,j,!0,!0);else if(j.child!==null){j.child.return=j,j=j.child;continue}}if(j===c)break;for(;j.sibling===null;){if(j.return===null||j.return===c)return;j=j.return}j.sibling.return=j.return,j=j.sibling}};var Nb=function(u,c,k,I){for(var j=c.child;j!==null;){if(j.tag===5){var q=j.stateNode;k&&I&&(q=Ye(q,j.type,j.memoizedProps,j)),Tt(u,q)}else if(j.tag===6)q=j.stateNode,k&&I&&(q=at(q,j.memoizedProps,j)),Tt(u,q);else if(j.tag!==4){if(j.tag===22&&j.memoizedState!==null)q=j.child,q!==null&&(q.return=j),Nb(u,j,!0,!0);else if(j.child!==null){j.child.return=j,j=j.child;continue}}if(j===c)break;for(;j.sibling===null;){if(j.return===null||j.return===c)return;j=j.return}j.sibling.return=j.return,j=j.sibling}};Su=function(u,c){var k=c.stateNode;if(!Lb(u,c)){u=k.containerInfo;var I=Wt(u);Nb(I,c,!1,!1),k.pendingChildren=I,Ni(c),Yt(u,I)}},Tf=function(u,c,k,I,j){var q=u.stateNode,ee=u.memoizedProps;if((u=Lb(u,c))&&ee===I)c.stateNode=q;else{var le=c.stateNode,ve=Mi(Ur.current),Te=null;ee!==I&&(Te=Y(le,k,ee,I,j,ve)),u&&Te===null?c.stateNode=q:(q=$e(q,Te,k,ee,I,c,u,le),V(q,k,I,j,ve)&&Ni(c),c.stateNode=q,u?Ni(c):wu(q,c,!1,!1))}},Af=function(u,c,k,I){k!==I?(u=Mi(Gl.current),k=Mi(Ur.current),c.stateNode=$(I,u,k,c),Ni(c)):c.stateNode=u.stateNode}}else Su=function(){},Tf=function(){},Af=function(){};function Eu(u,c){if(!$t)switch(u.tailMode){case"hidden":c=u.tail;for(var k=null;c!==null;)c.alternate!==null&&(k=c),c=c.sibling;k===null?u.tail=null:k.sibling=null;break;case"collapsed":k=u.tail;for(var I=null;k!==null;)k.alternate!==null&&(I=k),k=k.sibling;I===null?c||u.tail===null?u.tail=null:u.tail.sibling=null:I.sibling=null}}function $n(u){var c=u.alternate!==null&&u.alternate.child===u.child,k=0,I=0;if(c)for(var j=u.child;j!==null;)k|=j.lanes|j.childLanes,I|=j.subtreeFlags&14680064,I|=j.flags&14680064,j.return=u,j=j.sibling;else for(j=u.child;j!==null;)k|=j.lanes|j.childLanes,I|=j.subtreeFlags,I|=j.flags,j.return=u,j=j.sibling;return u.subtreeFlags|=I,u.childLanes=k,c}function lE(u,c,k){var I=c.pendingProps;switch(f0(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $n(c),null;case 1:return or(c.type)&&rf(),$n(c),null;case 3:return k=c.stateNode,Vl(),zt(ir),zt(Un),O0(),k.pendingContext&&(k.context=k.pendingContext,k.pendingContext=null),(u===null||u.child===null)&&(hf(c)?Ni(c):u===null||u.memoizedState.isDehydrated&&!(c.flags&256)||(c.flags|=1024,ai!==null&&(o1(ai),ai=null))),Su(u,c),$n(c),null;case 5:S0(c),k=Mi(Gl.current);var j=c.type;if(u!==null&&c.stateNode!=null)Tf(u,c,j,I,k),u.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!I){if(c.stateNode===null)throw Error(a(166));return $n(c),null}if(u=Mi(Ur.current),hf(c)){if(!ie)throw Error(a(175));u=Ft(c.stateNode,c.type,c.memoizedProps,k,u,c,!hu),c.updateQueue=u,u!==null&&Ni(c)}else{var q=D(j,I,k,u,c);wu(q,c,!1,!1),c.stateNode=q,V(q,j,I,k,u)&&Ni(c)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return $n(c),null;case 6:if(u&&c.stateNode!=null)Af(u,c,u.memoizedProps,I);else{if(typeof I!="string"&&c.stateNode===null)throw Error(a(166));if(u=Mi(Gl.current),k=Mi(Ur.current),hf(c)){if(!ie)throw Error(a(176));if(u=c.stateNode,k=c.memoizedProps,(I=Pt(u,k,c,!hu))&&(j=Er,j!==null))switch(j.tag){case 3:cu(j.stateNode.containerInfo,u,k,(j.mode&1)!==0);break;case 5:Da(j.type,j.memoizedProps,j.stateNode,u,k,(j.mode&1)!==0)}I&&Ni(c)}else c.stateNode=$(I,u,k,c)}return $n(c),null;case 13:if(zt(Kt),I=c.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if($t&&zr!==null&&c.mode&1&&!(c.flags&128))j2(),Bl(),c.flags|=98560,j=!1;else if(j=hf(c),I!==null&&I.dehydrated!==null){if(u===null){if(!j)throw Error(a(318));if(!ie)throw Error(a(344));if(j=c.memoizedState,j=j!==null?j.dehydrated:null,!j)throw Error(a(317));Bn(j,c)}else Bl(),!(c.flags&128)&&(c.memoizedState=null),c.flags|=4;$n(c),j=!1}else ai!==null&&(o1(ai),ai=null),j=!0;if(!j)return c.flags&65536?c:null}return c.flags&128?(c.lanes=k,c):(k=I!==null,k!==(u!==null&&u.memoizedState!==null)&&k&&(c.child.flags|=8192,c.mode&1&&(u===null||Kt.current&1?vn===0&&(vn=3):l1())),c.updateQueue!==null&&(c.flags|=4),$n(c),null);case 4:return Vl(),Su(u,c),u===null&&he(c.stateNode.containerInfo),$n(c),null;case 10:return m0(c.type._context),$n(c),null;case 17:return or(c.type)&&rf(),$n(c),null;case 19:if(zt(Kt),j=c.memoizedState,j===null)return $n(c),null;if(I=(c.flags&128)!==0,q=j.rendering,q===null)if(I)Eu(j,!1);else{if(vn!==0||u!==null&&u.flags&128)for(u=c.child;u!==null;){if(q=_f(u),q!==null){for(c.flags|=128,Eu(j,!1),u=q.updateQueue,u!==null&&(c.updateQueue=u,c.flags|=4),c.subtreeFlags=0,u=k,k=c.child;k!==null;)I=k,j=u,I.flags&=14680066,q=I.alternate,q===null?(I.childLanes=0,I.lanes=j,I.child=null,I.subtreeFlags=0,I.memoizedProps=null,I.memoizedState=null,I.updateQueue=null,I.dependencies=null,I.stateNode=null):(I.childLanes=q.childLanes,I.lanes=q.lanes,I.child=q.child,I.subtreeFlags=0,I.deletions=null,I.memoizedProps=q.memoizedProps,I.memoizedState=q.memoizedState,I.updateQueue=q.updateQueue,I.type=q.type,j=q.dependencies,I.dependencies=j===null?null:{lanes:j.lanes,firstContext:j.firstContext}),k=k.sibling;return Nt(Kt,Kt.current&1|2),c.child}u=u.sibling}j.tail!==null&&Pn()>t1&&(c.flags|=128,I=!0,Eu(j,!1),c.lanes=4194304)}else{if(!I)if(u=_f(q),u!==null){if(c.flags|=128,I=!0,u=u.updateQueue,u!==null&&(c.updateQueue=u,c.flags|=4),Eu(j,!0),j.tail===null&&j.tailMode==="hidden"&&!q.alternate&&!$t)return $n(c),null}else 2*Pn()-j.renderingStartTime>t1&&k!==1073741824&&(c.flags|=128,I=!0,Eu(j,!1),c.lanes=4194304);j.isBackwards?(q.sibling=c.child,c.child=q):(u=j.last,u!==null?u.sibling=q:c.child=q,j.last=q)}return j.tail!==null?(c=j.tail,j.rendering=c,j.tail=c.sibling,j.renderingStartTime=Pn(),c.sibling=null,u=Kt.current,Nt(Kt,I?u&1|2:u&1),c):($n(c),null);case 22:case 23:return a1(),k=c.memoizedState!==null,u!==null&&u.memoizedState!==null!==k&&(c.flags|=8192),k&&c.mode&1?Or&1073741824&&($n(c),J&&c.subtreeFlags&6&&(c.flags|=8192)):$n(c),null;case 24:return null;case 25:return null}throw Error(a(156,c.tag))}function sE(u,c){switch(f0(c),c.tag){case 1:return or(c.type)&&rf(),u=c.flags,u&65536?(c.flags=u&-65537|128,c):null;case 3:return Vl(),zt(ir),zt(Un),O0(),u=c.flags,u&65536&&!(u&128)?(c.flags=u&-65537|128,c):null;case 5:return S0(c),null;case 13:if(zt(Kt),u=c.memoizedState,u!==null&&u.dehydrated!==null){if(c.alternate===null)throw Error(a(340));Bl()}return u=c.flags,u&65536?(c.flags=u&-65537|128,c):null;case 19:return zt(Kt),null;case 4:return Vl(),null;case 10:return m0(c.type._context),null;case 22:case 23:return a1(),null;case 24:return null;default:return null}}var Rf=!1,Gn=!1,uE=typeof WeakSet=="function"?WeakSet:Set,Be=null;function Wl(u,c){var k=u.ref;if(k!==null)if(typeof k=="function")try{k(null)}catch(I){Gt(u,c,I)}else k.current=null}function $0(u,c,k){try{k()}catch(I){Gt(u,c,I)}}var Ib=!1;function cE(u,c){for(L(u.containerInfo),Be=c;Be!==null;)if(u=Be,c=u.child,(u.subtreeFlags&1028)!==0&&c!==null)c.return=u,Be=c;else for(;Be!==null;){u=Be;try{var k=u.alternate;if(u.flags&1024)switch(u.tag){case 0:case 11:case 15:break;case 1:if(k!==null){var I=k.memoizedProps,j=k.memoizedState,q=u.stateNode,ee=q.getSnapshotBeforeUpdate(u.elementType===u.type?I:li(u.type,I),j);q.__reactInternalSnapshotBeforeUpdate=ee}break;case 3:J&&Oe(u.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(le){Gt(u,u.return,le)}if(c=u.sibling,c!==null){c.return=u.return,Be=c;break}Be=u.return}return k=Ib,Ib=!1,k}function Ou(u,c,k){var I=c.updateQueue;if(I=I!==null?I.lastEffect:null,I!==null){var j=I=I.next;do{if((j.tag&u)===u){var q=j.destroy;j.destroy=void 0,q!==void 0&&$0(c,k,q)}j=j.next}while(j!==I)}}function Mf(u,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var k=c=c.next;do{if((k.tag&u)===u){var I=k.create;k.destroy=I()}k=k.next}while(k!==c)}}function G0(u){var c=u.ref;if(c!==null){var k=u.stateNode;switch(u.tag){case 5:u=Z(k);break;default:u=k}typeof c=="function"?c(u):c.current=u}}function Db(u){var c=u.alternate;c!==null&&(u.alternate=null,Db(c)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(c=u.stateNode,c!==null&&Pe(c)),u.stateNode=null,u.return=null,u.dependencies=null,u.memoizedProps=null,u.memoizedState=null,u.pendingProps=null,u.stateNode=null,u.updateQueue=null}function jb(u){return u.tag===5||u.tag===3||u.tag===4}function Fb(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||jb(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&u.tag!==18;){if(u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function V0(u,c,k){var I=u.tag;if(I===5||I===6)u=u.stateNode,c?mt(k,u,c):Ce(k,u);else if(I!==4&&(u=u.child,u!==null))for(V0(u,c,k),u=u.sibling;u!==null;)V0(u,c,k),u=u.sibling}function q0(u,c,k){var I=u.tag;if(I===5||I===6)u=u.stateNode,c?St(k,u,c):Ae(k,u);else if(I!==4&&(u=u.child,u!==null))for(q0(u,c,k),u=u.sibling;u!==null;)q0(u,c,k),u=u.sibling}var Ln=null,si=!1;function Ii(u,c,k){for(k=k.child;k!==null;)W0(u,c,k),k=k.sibling}function W0(u,c,k){if(Ti&&typeof Ti.onCommitFiberUnmount=="function")try{Ti.onCommitFiberUnmount(uf,k)}catch{}switch(k.tag){case 5:Gn||Wl(k,c);case 6:if(J){var I=Ln,j=si;Ln=null,Ii(u,c,k),Ln=I,si=j,Ln!==null&&(si?ce(Ln,k.stateNode):ue(Ln,k.stateNode))}else Ii(u,c,k);break;case 18:J&&Ln!==null&&(si?no(Ln,k.stateNode):Sr(Ln,k.stateNode));break;case 4:J?(I=Ln,j=si,Ln=k.stateNode.containerInfo,si=!0,Ii(u,c,k),Ln=I,si=j):(ne&&(I=k.stateNode.containerInfo,j=Wt(I),ke(I,j)),Ii(u,c,k));break;case 0:case 11:case 14:case 15:if(!Gn&&(I=k.updateQueue,I!==null&&(I=I.lastEffect,I!==null))){j=I=I.next;do{var q=j,ee=q.destroy;q=q.tag,ee!==void 0&&(q&2||q&4)&&$0(k,c,ee),j=j.next}while(j!==I)}Ii(u,c,k);break;case 1:if(!Gn&&(Wl(k,c),I=k.stateNode,typeof I.componentWillUnmount=="function"))try{I.props=k.memoizedProps,I.state=k.memoizedState,I.componentWillUnmount()}catch(le){Gt(k,c,le)}Ii(u,c,k);break;case 21:Ii(u,c,k);break;case 22:k.mode&1?(Gn=(I=Gn)||k.memoizedState!==null,Ii(u,c,k),Gn=I):Ii(u,c,k);break;default:Ii(u,c,k)}}function zb(u){var c=u.updateQueue;if(c!==null){u.updateQueue=null;var k=u.stateNode;k===null&&(k=u.stateNode=new uE),c.forEach(function(I){var j=bE.bind(null,u,I);k.has(I)||(k.add(I),I.then(j,j))})}}function ui(u,c){var k=c.deletions;if(k!==null)for(var I=0;I<k.length;I++){var j=k[I];try{var q=u,ee=c;if(J){var le=ee;e:for(;le!==null;){switch(le.tag){case 5:Ln=le.stateNode,si=!1;break e;case 3:Ln=le.stateNode.containerInfo,si=!0;break e;case 4:Ln=le.stateNode.containerInfo,si=!0;break e}le=le.return}if(Ln===null)throw Error(a(160));W0(q,ee,j),Ln=null,si=!1}else W0(q,ee,j);var ve=j.alternate;ve!==null&&(ve.return=null),j.return=null}catch(Te){Gt(j,c,Te)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)Bb(c,u),c=c.sibling}function Bb(u,c){var k=u.alternate,I=u.flags;switch(u.tag){case 0:case 11:case 14:case 15:if(ui(c,u),Di(u),I&4){try{Ou(3,u,u.return),Mf(3,u)}catch(De){Gt(u,u.return,De)}try{Ou(5,u,u.return)}catch(De){Gt(u,u.return,De)}}break;case 1:ui(c,u),Di(u),I&512&&k!==null&&Wl(k,k.return);break;case 5:if(ui(c,u),Di(u),I&512&&k!==null&&Wl(k,k.return),J){if(u.flags&32){var j=u.stateNode;try{Se(j)}catch(De){Gt(u,u.return,De)}}if(I&4&&(j=u.stateNode,j!=null)){var q=u.memoizedProps;if(k=k!==null?k.memoizedProps:q,I=u.type,c=u.updateQueue,u.updateQueue=null,c!==null)try{We(j,c,I,k,q,u)}catch(De){Gt(u,u.return,De)}}}break;case 6:if(ui(c,u),Di(u),I&4&&J){if(u.stateNode===null)throw Error(a(162));j=u.stateNode,q=u.memoizedProps,k=k!==null?k.memoizedProps:q;try{Me(j,k,q)}catch(De){Gt(u,u.return,De)}}break;case 3:if(ui(c,u),Di(u),I&4){if(J&&ie&&k!==null&&k.memoizedState.isDehydrated)try{tn(c.containerInfo)}catch(De){Gt(u,u.return,De)}if(ne){j=c.containerInfo,q=c.pendingChildren;try{ke(j,q)}catch(De){Gt(u,u.return,De)}}}break;case 4:if(ui(c,u),Di(u),I&4&&ne){q=u.stateNode,j=q.containerInfo,q=q.pendingChildren;try{ke(j,q)}catch(De){Gt(u,u.return,De)}}break;case 13:ui(c,u),Di(u),j=u.child,j.flags&8192&&(q=j.memoizedState!==null,j.stateNode.isHidden=q,!q||j.alternate!==null&&j.alternate.memoizedState!==null||(e1=Pn())),I&4&&zb(u);break;case 22:var ee=k!==null&&k.memoizedState!==null;if(u.mode&1?(Gn=(k=Gn)||ee,ui(c,u),Gn=k):ui(c,u),Di(u),I&8192){if(k=u.memoizedState!==null,(u.stateNode.isHidden=k)&&!ee&&u.mode&1)for(Be=u,I=u.child;I!==null;){for(c=Be=I;Be!==null;){ee=Be;var le=ee.child;switch(ee.tag){case 0:case 11:case 14:case 15:Ou(4,ee,ee.return);break;case 1:Wl(ee,ee.return);var ve=ee.stateNode;if(typeof ve.componentWillUnmount=="function"){var Te=ee,He=ee.return;try{var nt=Te;ve.props=nt.memoizedProps,ve.state=nt.memoizedState,ve.componentWillUnmount()}catch(De){Gt(Te,He,De)}}break;case 5:Wl(ee,ee.return);break;case 22:if(ee.memoizedState!==null){$b(c);continue}}le!==null?(le.return=ee,Be=le):$b(c)}I=I.sibling}if(J){e:if(I=null,J)for(c=u;;){if(c.tag===5){if(I===null){I=c;try{j=c.stateNode,k?Le(j):ge(c.stateNode,c.memoizedProps)}catch(De){Gt(u,u.return,De)}}}else if(c.tag===6){if(I===null)try{q=c.stateNode,k?Ne(q):Xe(q,c.memoizedProps)}catch(De){Gt(u,u.return,De)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===u)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===u)break e;for(;c.sibling===null;){if(c.return===null||c.return===u)break e;I===c&&(I=null),c=c.return}I===c&&(I=null),c.sibling.return=c.return,c=c.sibling}}}break;case 19:ui(c,u),Di(u),I&4&&zb(u);break;case 21:break;default:ui(c,u),Di(u)}}function Di(u){var c=u.flags;if(c&2){try{if(J){e:{for(var k=u.return;k!==null;){if(jb(k)){var I=k;break e}k=k.return}throw Error(a(160))}switch(I.tag){case 5:var j=I.stateNode;I.flags&32&&(Se(j),I.flags&=-33);var q=Fb(u);q0(u,q,j);break;case 3:case 4:var ee=I.stateNode.containerInfo,le=Fb(u);V0(u,le,ee);break;default:throw Error(a(161))}}}catch(ve){Gt(u,u.return,ve)}u.flags&=-3}c&4096&&(u.flags&=-4097)}function fE(u,c,k){Be=u,Ub(u)}function Ub(u,c,k){for(var I=(u.mode&1)!==0;Be!==null;){var j=Be,q=j.child;if(j.tag===22&&I){var ee=j.memoizedState!==null||Rf;if(!ee){var le=j.alternate,ve=le!==null&&le.memoizedState!==null||Gn;le=Rf;var Te=Gn;if(Rf=ee,(Gn=ve)&&!Te)for(Be=j;Be!==null;)ee=Be,ve=ee.child,ee.tag===22&&ee.memoizedState!==null?Gb(j):ve!==null?(ve.return=ee,Be=ve):Gb(j);for(;q!==null;)Be=q,Ub(q),q=q.sibling;Be=j,Rf=le,Gn=Te}Hb(u)}else j.subtreeFlags&8772&&q!==null?(q.return=j,Be=q):Hb(u)}}function Hb(u){for(;Be!==null;){var c=Be;if(c.flags&8772){var k=c.alternate;try{if(c.flags&8772)switch(c.tag){case 0:case 11:case 15:Gn||Mf(5,c);break;case 1:var I=c.stateNode;if(c.flags&4&&!Gn)if(k===null)I.componentDidMount();else{var j=c.elementType===c.type?k.memoizedProps:li(c.type,k.memoizedProps);I.componentDidUpdate(j,k.memoizedState,I.__reactInternalSnapshotBeforeUpdate)}var q=c.updateQueue;q!==null&&V2(c,q,I);break;case 3:var ee=c.updateQueue;if(ee!==null){if(k=null,c.child!==null)switch(c.child.tag){case 5:k=Z(c.child.stateNode);break;case 1:k=c.child.stateNode}V2(c,ee,k)}break;case 5:var le=c.stateNode;k===null&&c.flags&4&&ze(le,c.type,c.memoizedProps,c);break;case 6:break;case 4:break;case 12:break;case 13:if(ie&&c.memoizedState===null){var ve=c.alternate;if(ve!==null){var Te=ve.memoizedState;if(Te!==null){var He=Te.dehydrated;He!==null&&ri(He)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(a(163))}Gn||c.flags&512&&G0(c)}catch(nt){Gt(c,c.return,nt)}}if(c===u){Be=null;break}if(k=c.sibling,k!==null){k.return=c.return,Be=k;break}Be=c.return}}function $b(u){for(;Be!==null;){var c=Be;if(c===u){Be=null;break}var k=c.sibling;if(k!==null){k.return=c.return,Be=k;break}Be=c.return}}function Gb(u){for(;Be!==null;){var c=Be;try{switch(c.tag){case 0:case 11:case 15:var k=c.return;try{Mf(4,c)}catch(ve){Gt(c,k,ve)}break;case 1:var I=c.stateNode;if(typeof I.componentDidMount=="function"){var j=c.return;try{I.componentDidMount()}catch(ve){Gt(c,j,ve)}}var q=c.return;try{G0(c)}catch(ve){Gt(c,q,ve)}break;case 5:var ee=c.return;try{G0(c)}catch(ve){Gt(c,ee,ve)}}}catch(ve){Gt(c,c.return,ve)}if(c===u){Be=null;break}var le=c.sibling;if(le!==null){le.return=c.return,Be=le;break}Be=c.return}}var Lf=0,Nf=1,If=2,Df=3,jf=4;if(typeof Symbol=="function"&&Symbol.for){var xu=Symbol.for;Lf=xu("selector.component"),Nf=xu("selector.has_pseudo_class"),If=xu("selector.role"),Df=xu("selector.test_id"),jf=xu("selector.text")}function Y0(u){var c=oe(u);if(c!=null){if(typeof c.memoizedProps["data-testname"]!="string")throw Error(a(364));return c}if(u=be(u),u===null)throw Error(a(362));return u.stateNode.current}function K0(u,c){switch(c.$$typeof){case Lf:if(u.type===c.value)return!0;break;case Nf:e:{c=c.value,u=[u,0];for(var k=0;k<u.length;){var I=u[k++],j=u[k++],q=c[j];if(I.tag!==5||!de(I)){for(;q!=null&&K0(I,q);)j++,q=c[j];if(j===c.length){c=!0;break e}else for(I=I.child;I!==null;)u.push(I,j),I=I.sibling}}c=!1}return c;case If:if(u.tag===5&&Ee(u.stateNode,c.value))return!0;break;case jf:if((u.tag===5||u.tag===6)&&(u=fe(u),u!==null&&0<=u.indexOf(c.value)))return!0;break;case Df:if(u.tag===5&&(u=u.memoizedProps["data-testname"],typeof u=="string"&&u.toLowerCase()===c.value.toLowerCase()))return!0;break;default:throw Error(a(365))}return!1}function X0(u){switch(u.$$typeof){case Lf:return"<"+(C(u.value)||"Unknown")+">";case Nf:return":has("+(X0(u)||"")+")";case If:return'[role="'+u.value+'"]';case jf:return'"'+u.value+'"';case Df:return'[data-testname="'+u.value+'"]';default:throw Error(a(365))}}function Vb(u,c){var k=[];u=[u,0];for(var I=0;I<u.length;){var j=u[I++],q=u[I++],ee=c[q];if(j.tag!==5||!de(j)){for(;ee!=null&&K0(j,ee);)q++,ee=c[q];if(q===c.length)k.push(j);else for(j=j.child;j!==null;)u.push(j,q),j=j.sibling}}return k}function Z0(u,c){if(!we)throw Error(a(363));u=Y0(u),u=Vb(u,c),c=[],u=Array.from(u);for(var k=0;k<u.length;){var I=u[k++];if(I.tag===5)de(I)||c.push(I.stateNode);else for(I=I.child;I!==null;)u.push(I),I=I.sibling}return c}var dE=Math.ceil,Ff=l.ReactCurrentDispatcher,Q0=l.ReactCurrentOwner,an=l.ReactCurrentBatchConfig,ct=0,kn=null,cn=null,Nn=0,Or=0,Yl=Fo(0),vn=0,Pu=null,Ha=0,zf=0,J0=0,Cu=null,lr=null,e1=0,t1=1/0,uo=null;function Kl(){t1=Pn()+500}var Bf=!1,n1=null,Ho=null,Uf=!1,$o=null,Hf=0,ku=0,r1=null,$f=-1,Gf=0;function Vn(){return ct&6?Pn():$f!==-1?$f:$f=Pn()}function Go(u){return u.mode&1?ct&2&&Nn!==0?Nn&-Nn:YS.transition!==null?(Gf===0&&(Gf=T2()),Gf):(u=yt,u!==0?u:me()):1}function $r(u,c,k,I){if(50<ku)throw ku=0,r1=null,Error(a(185));du(u,k,I),(!(ct&2)||u!==kn)&&(u===kn&&(!(ct&2)&&(zf|=k),vn===4&&Vo(u,Nn)),sr(u,I),k===1&&ct===0&&!(c.mode&1)&&(Kl(),cf&&Ai()))}function sr(u,c){var k=u.callbackNode;zS(u,c);var I=sf(u,u===kn?Nn:0);if(I===0)k!==null&&R2(k),u.callbackNode=null,u.callbackPriority=0;else if(c=I&-I,u.callbackPriority!==c){if(k!=null&&R2(k),c===1)u.tag===0?WS(Wb.bind(null,u)):M2(Wb.bind(null,u)),re?ae(function(){!(ct&6)&&Ai()}):a0(l0,Ai),k=null;else{switch(A2(I)){case 1:k=l0;break;case 4:k=$S;break;case 16:k=s0;break;case 536870912:k=GS;break;default:k=s0}k=n3(k,qb.bind(null,u))}u.callbackPriority=c,u.callbackNode=k}}function qb(u,c){if($f=-1,Gf=0,ct&6)throw Error(a(327));var k=u.callbackNode;if(Va()&&u.callbackNode!==k)return null;var I=sf(u,u===kn?Nn:0);if(I===0)return null;if(I&30||I&u.expiredLanes||c)c=Vf(u,I);else{c=I;var j=ct;ct|=2;var q=Xb();(kn!==u||Nn!==c)&&(uo=null,Kl(),$a(u,c));do try{gE();break}catch(le){Kb(u,le)}while(!0);v0(),Ff.current=q,ct=j,cn!==null?c=0:(kn=null,Nn=0,c=vn)}if(c!==0){if(c===2&&(j=r0(u),j!==0&&(I=j,c=i1(u,j))),c===1)throw k=Pu,$a(u,0),Vo(u,I),sr(u,Pn()),k;if(c===6)Vo(u,I);else{if(j=u.current.alternate,!(I&30)&&!hE(j)&&(c=Vf(u,I),c===2&&(q=r0(u),q!==0&&(I=q,c=i1(u,q))),c===1))throw k=Pu,$a(u,0),Vo(u,I),sr(u,Pn()),k;switch(u.finishedWork=j,u.finishedLanes=I,c){case 0:case 1:throw Error(a(345));case 2:Ga(u,lr,uo);break;case 3:if(Vo(u,I),(I&130023424)===I&&(c=e1+500-Pn(),10<c)){if(sf(u,0)!==0)break;if(j=u.suspendedLanes,(j&I)!==I){Vn(),u.pingedLanes|=u.suspendedLanes&j;break}u.timeoutHandle=z(Ga.bind(null,u,lr,uo),c);break}Ga(u,lr,uo);break;case 4:if(Vo(u,I),(I&4194240)===I)break;for(c=u.eventTimes,j=-1;0<I;){var ee=31-ii(I);q=1<<ee,ee=c[ee],ee>j&&(j=ee),I&=~q}if(I=j,I=Pn()-I,I=(120>I?120:480>I?480:1080>I?1080:1920>I?1920:3e3>I?3e3:4320>I?4320:1960*dE(I/1960))-I,10<I){u.timeoutHandle=z(Ga.bind(null,u,lr,uo),I);break}Ga(u,lr,uo);break;case 5:Ga(u,lr,uo);break;default:throw Error(a(329))}}}return sr(u,Pn()),u.callbackNode===k?qb.bind(null,u):null}function i1(u,c){var k=Cu;return u.current.memoizedState.isDehydrated&&($a(u,c).flags|=256),u=Vf(u,c),u!==2&&(c=lr,lr=k,c!==null&&o1(c)),u}function o1(u){lr===null?lr=u:lr.push.apply(lr,u)}function hE(u){for(var c=u;;){if(c.flags&16384){var k=c.updateQueue;if(k!==null&&(k=k.stores,k!==null))for(var I=0;I<k.length;I++){var j=k[I],q=j.getSnapshot;j=j.value;try{if(!oi(q(),j))return!1}catch{return!1}}}if(k=c.child,c.subtreeFlags&16384&&k!==null)k.return=c,c=k;else{if(c===u)break;for(;c.sibling===null;){if(c.return===null||c.return===u)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Vo(u,c){for(c&=~J0,c&=~zf,u.suspendedLanes|=c,u.pingedLanes&=~c,u=u.expirationTimes;0<c;){var k=31-ii(c),I=1<<k;u[k]=-1,c&=~I}}function Wb(u){if(ct&6)throw Error(a(327));Va();var c=sf(u,0);if(!(c&1))return sr(u,Pn()),null;var k=Vf(u,c);if(u.tag!==0&&k===2){var I=r0(u);I!==0&&(c=I,k=i1(u,I))}if(k===1)throw k=Pu,$a(u,0),Vo(u,c),sr(u,Pn()),k;if(k===6)throw Error(a(345));return u.finishedWork=u.current.alternate,u.finishedLanes=c,Ga(u,lr,uo),sr(u,Pn()),null}function Yb(u){$o!==null&&$o.tag===0&&!(ct&6)&&Va();var c=ct;ct|=1;var k=an.transition,I=yt;try{if(an.transition=null,yt=1,u)return u()}finally{yt=I,an.transition=k,ct=c,!(ct&6)&&Ai()}}function a1(){Or=Yl.current,zt(Yl)}function $a(u,c){u.finishedWork=null,u.finishedLanes=0;var k=u.timeoutHandle;if(k!==X&&(u.timeoutHandle=X,K(k)),cn!==null)for(k=cn.return;k!==null;){var I=k;switch(f0(I),I.tag){case 1:I=I.type.childContextTypes,I!=null&&rf();break;case 3:Vl(),zt(ir),zt(Un),O0();break;case 5:S0(I);break;case 4:Vl();break;case 13:zt(Kt);break;case 19:zt(Kt);break;case 10:m0(I.type._context);break;case 22:case 23:a1()}k=k.return}if(kn=u,cn=u=qo(u.current,null),Nn=Or=c,vn=0,Pu=null,J0=zf=Ha=0,lr=Cu=null,Ba!==null){for(c=0;c<Ba.length;c++)if(k=Ba[c],I=k.interleaved,I!==null){k.interleaved=null;var j=I.next,q=k.pending;if(q!==null){var ee=q.next;q.next=j,I.next=ee}k.pending=I}Ba=null}return u}function Kb(u,c){do{var k=cn;try{if(v0(),wf.current=xf,Sf){for(var I=Xt.memoizedState;I!==null;){var j=I.queue;j!==null&&(j.pending=null),I=I.next}Sf=!1}if(Ua=0,Cn=gn=Xt=null,mu=!1,yu=0,Q0.current=null,k===null||k.return===null){vn=1,Pu=c,cn=null;break}e:{var q=u,ee=k.return,le=k,ve=c;if(c=Nn,le.flags|=32768,ve!==null&&typeof ve=="object"&&typeof ve.then=="function"){var Te=ve,He=le,nt=He.tag;if(!(He.mode&1)&&(nt===0||nt===11||nt===15)){var De=He.alternate;De?(He.updateQueue=De.updateQueue,He.memoizedState=De.memoizedState,He.lanes=De.lanes):(He.updateQueue=null,He.memoizedState=null)}var Bt=_b(ee);if(Bt!==null){Bt.flags&=-257,wb(Bt,ee,le,q,c),Bt.mode&1&&bb(q,Te,c),c=Bt,ve=Te;var Mt=c.updateQueue;if(Mt===null){var ur=new Set;ur.add(ve),c.updateQueue=ur}else Mt.add(ve);break e}else{if(!(c&1)){bb(q,Te,c),l1();break e}ve=Error(a(426))}}else if($t&&le.mode&1){var co=_b(ee);if(co!==null){!(co.flags&65536)&&(co.flags|=256),wb(co,ee,le,q,c),p0(ql(ve,le));break e}}q=ve=ql(ve,le),vn!==4&&(vn=2),Cu===null?Cu=[q]:Cu.push(q),q=ee;do{switch(q.tag){case 3:q.flags|=65536,c&=-c,q.lanes|=c;var pe=mb(q,ve,c);G2(q,pe);break e;case 1:le=ve;var se=q.type,ye=q.stateNode;if(!(q.flags&128)&&(typeof se.getDerivedStateFromError=="function"||ye!==null&&typeof ye.componentDidCatch=="function"&&(Ho===null||!Ho.has(ye)))){q.flags|=65536,c&=-c,q.lanes|=c;var je=yb(q,le,c);G2(q,je);break e}}q=q.return}while(q!==null)}Qb(k)}catch(Ke){c=Ke,cn===k&&k!==null&&(cn=k=k.return);continue}break}while(!0)}function Xb(){var u=Ff.current;return Ff.current=xf,u===null?xf:u}function l1(){(vn===0||vn===3||vn===2)&&(vn=4),kn===null||!(Ha&268435455)&&!(zf&268435455)||Vo(kn,Nn)}function Vf(u,c){var k=ct;ct|=2;var I=Xb();(kn!==u||Nn!==c)&&(uo=null,$a(u,c));do try{pE();break}catch(j){Kb(u,j)}while(!0);if(v0(),ct=k,Ff.current=I,cn!==null)throw Error(a(261));return kn=null,Nn=0,vn}function pE(){for(;cn!==null;)Zb(cn)}function gE(){for(;cn!==null&&!US();)Zb(cn)}function Zb(u){var c=t3(u.alternate,u,Or);u.memoizedProps=u.pendingProps,c===null?Qb(u):cn=c,Q0.current=null}function Qb(u){var c=u;do{var k=c.alternate;if(u=c.return,c.flags&32768){if(k=sE(k,c),k!==null){k.flags&=32767,cn=k;return}if(u!==null)u.flags|=32768,u.subtreeFlags=0,u.deletions=null;else{vn=6,cn=null;return}}else if(k=lE(k,c,Or),k!==null){cn=k;return}if(c=c.sibling,c!==null){cn=c;return}cn=c=u}while(c!==null);vn===0&&(vn=5)}function Ga(u,c,k){var I=yt,j=an.transition;try{an.transition=null,yt=1,vE(u,c,k,I)}finally{an.transition=j,yt=I}return null}function vE(u,c,k,I){do Va();while($o!==null);if(ct&6)throw Error(a(327));k=u.finishedWork;var j=u.finishedLanes;if(k===null)return null;if(u.finishedWork=null,u.finishedLanes=0,k===u.current)throw Error(a(177));u.callbackNode=null,u.callbackPriority=0;var q=k.lanes|k.childLanes;if(BS(u,q),u===kn&&(cn=kn=null,Nn=0),!(k.subtreeFlags&2064)&&!(k.flags&2064)||Uf||(Uf=!0,n3(s0,function(){return Va(),null})),q=(k.flags&15990)!==0,k.subtreeFlags&15990||q){q=an.transition,an.transition=null;var ee=yt;yt=1;var le=ct;ct|=4,Q0.current=null,cE(u,k),Bb(k,u),M(u.containerInfo),u.current=k,fE(k),HS(),ct=le,yt=ee,an.transition=q}else u.current=k;if(Uf&&(Uf=!1,$o=u,Hf=j),q=u.pendingLanes,q===0&&(Ho=null),VS(k.stateNode),sr(u,Pn()),c!==null)for(I=u.onRecoverableError,k=0;k<c.length;k++)j=c[k],I(j.value,{componentStack:j.stack,digest:j.digest});if(Bf)throw Bf=!1,u=n1,n1=null,u;return Hf&1&&u.tag!==0&&Va(),q=u.pendingLanes,q&1?u===r1?ku++:(ku=0,r1=u):ku=0,Ai(),null}function Va(){if($o!==null){var u=A2(Hf),c=an.transition,k=yt;try{if(an.transition=null,yt=16>u?16:u,$o===null)var I=!1;else{if(u=$o,$o=null,Hf=0,ct&6)throw Error(a(331));var j=ct;for(ct|=4,Be=u.current;Be!==null;){var q=Be,ee=q.child;if(Be.flags&16){var le=q.deletions;if(le!==null){for(var ve=0;ve<le.length;ve++){var Te=le[ve];for(Be=Te;Be!==null;){var He=Be;switch(He.tag){case 0:case 11:case 15:Ou(8,He,q)}var nt=He.child;if(nt!==null)nt.return=He,Be=nt;else for(;Be!==null;){He=Be;var De=He.sibling,Bt=He.return;if(Db(He),He===Te){Be=null;break}if(De!==null){De.return=Bt,Be=De;break}Be=Bt}}}var Mt=q.alternate;if(Mt!==null){var ur=Mt.child;if(ur!==null){Mt.child=null;do{var co=ur.sibling;ur.sibling=null,ur=co}while(ur!==null)}}Be=q}}if(q.subtreeFlags&2064&&ee!==null)ee.return=q,Be=ee;else e:for(;Be!==null;){if(q=Be,q.flags&2048)switch(q.tag){case 0:case 11:case 15:Ou(9,q,q.return)}var pe=q.sibling;if(pe!==null){pe.return=q.return,Be=pe;break e}Be=q.return}}var se=u.current;for(Be=se;Be!==null;){ee=Be;var ye=ee.child;if(ee.subtreeFlags&2064&&ye!==null)ye.return=ee,Be=ye;else e:for(ee=se;Be!==null;){if(le=Be,le.flags&2048)try{switch(le.tag){case 0:case 11:case 15:Mf(9,le)}}catch(Ke){Gt(le,le.return,Ke)}if(le===ee){Be=null;break e}var je=le.sibling;if(je!==null){je.return=le.return,Be=je;break e}Be=le.return}}if(ct=j,Ai(),Ti&&typeof Ti.onPostCommitFiberRoot=="function")try{Ti.onPostCommitFiberRoot(uf,u)}catch{}I=!0}return I}finally{yt=k,an.transition=c}}return!1}function Jb(u,c,k){c=ql(k,c),c=mb(u,c,1),u=Uo(u,c,1),c=Vn(),u!==null&&(du(u,1,c),sr(u,c))}function Gt(u,c,k){if(u.tag===3)Jb(u,u,k);else for(;c!==null;){if(c.tag===3){Jb(c,u,k);break}else if(c.tag===1){var I=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof I.componentDidCatch=="function"&&(Ho===null||!Ho.has(I))){u=ql(k,u),u=yb(c,u,1),c=Uo(c,u,1),u=Vn(),c!==null&&(du(c,1,u),sr(c,u));break}}c=c.return}}function mE(u,c,k){var I=u.pingCache;I!==null&&I.delete(c),c=Vn(),u.pingedLanes|=u.suspendedLanes&k,kn===u&&(Nn&k)===k&&(vn===4||vn===3&&(Nn&130023424)===Nn&&500>Pn()-e1?$a(u,0):J0|=k),sr(u,c)}function e3(u,c){c===0&&(u.mode&1?(c=lf,lf<<=1,!(lf&130023424)&&(lf=4194304)):c=1);var k=Vn();u=Ri(u,c),u!==null&&(du(u,c,k),sr(u,k))}function yE(u){var c=u.memoizedState,k=0;c!==null&&(k=c.retryLane),e3(u,k)}function bE(u,c){var k=0;switch(u.tag){case 13:var I=u.stateNode,j=u.memoizedState;j!==null&&(k=j.retryLane);break;case 19:I=u.stateNode;break;default:throw Error(a(314))}I!==null&&I.delete(c),e3(u,k)}var t3;t3=function(u,c,k){if(u!==null)if(u.memoizedProps!==c.pendingProps||ir.current)ar=!0;else{if(!(u.lanes&k)&&!(c.flags&128))return ar=!1,aE(u,c,k);ar=!!(u.flags&131072)}else ar=!1,$t&&c.flags&1048576&&L2(c,df,c.index);switch(c.lanes=0,c.tag){case 2:var I=c.type;kf(u,c),u=c.pendingProps;var j=jl(c,Un.current);$l(c,k),j=C0(null,c,I,u,j,k);var q=k0();return c.flags|=1,typeof j=="object"&&j!==null&&typeof j.render=="function"&&j.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,or(I)?(q=!0,of(c)):q=!1,c.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,_0(c),j.updater=Pf,c.stateNode=j,j._reactInternals=c,N0(c,I,u,k),c=F0(null,c,I,!0,q,k)):(c.tag=0,$t&&q&&c0(c),Zn(null,c,j,k),c=c.child),c;case 16:I=c.elementType;e:{switch(kf(u,c),u=c.pendingProps,j=I._init,I=j(I._payload),c.type=I,j=c.tag=wE(I),u=li(I,u),j){case 0:c=j0(null,c,I,u,k);break e;case 1:c=Cb(null,c,I,u,k);break e;case 11:c=Sb(null,c,I,u,k);break e;case 14:c=Eb(null,c,I,li(I.type,u),k);break e}throw Error(a(306,I,""))}return c;case 0:return I=c.type,j=c.pendingProps,j=c.elementType===I?j:li(I,j),j0(u,c,I,j,k);case 1:return I=c.type,j=c.pendingProps,j=c.elementType===I?j:li(I,j),Cb(u,c,I,j,k);case 3:e:{if(kb(c),u===null)throw Error(a(387));I=c.pendingProps,q=c.memoizedState,j=q.element,$2(u,c),bf(c,I,null,k);var ee=c.memoizedState;if(I=ee.element,ie&&q.isDehydrated)if(q={element:I,isDehydrated:!1,cache:ee.cache,pendingSuspenseBoundaries:ee.pendingSuspenseBoundaries,transitions:ee.transitions},c.updateQueue.baseState=q,c.memoizedState=q,c.flags&256){j=ql(Error(a(423)),c),c=Tb(u,c,I,k,j);break e}else if(I!==j){j=ql(Error(a(424)),c),c=Tb(u,c,I,k,j);break e}else for(ie&&(zr=et(c.stateNode.containerInfo),Er=c,$t=!0,ai=null,hu=!1),k=B2(c,null,I,k),c.child=k;k;)k.flags=k.flags&-3|4096,k=k.sibling;else{if(Bl(),I===j){c=so(u,c,k);break e}Zn(u,c,I,k)}c=c.child}return c;case 5:return q2(c),u===null&&h0(c),I=c.type,j=c.pendingProps,q=u!==null?u.memoizedProps:null,ee=j.children,F(I,j)?ee=null:q!==null&&F(I,q)&&(c.flags|=32),Pb(u,c),Zn(u,c,ee,k),c.child;case 6:return u===null&&h0(c),null;case 13:return Ab(u,c,k);case 4:return w0(c,c.stateNode.containerInfo),I=c.pendingProps,u===null?c.child=Ul(c,null,I,k):Zn(u,c,I,k),c.child;case 11:return I=c.type,j=c.pendingProps,j=c.elementType===I?j:li(I,j),Sb(u,c,I,j,k);case 7:return Zn(u,c,c.pendingProps,k),c.child;case 8:return Zn(u,c,c.pendingProps.children,k),c.child;case 12:return Zn(u,c,c.pendingProps.children,k),c.child;case 10:e:{if(I=c.type._context,j=c.pendingProps,q=c.memoizedProps,ee=j.value,U2(c,I,ee),q!==null)if(oi(q.value,ee)){if(q.children===j.children&&!ir.current){c=so(u,c,k);break e}}else for(q=c.child,q!==null&&(q.return=c);q!==null;){var le=q.dependencies;if(le!==null){ee=q.child;for(var ve=le.firstContext;ve!==null;){if(ve.context===I){if(q.tag===1){ve=lo(-1,k&-k),ve.tag=2;var Te=q.updateQueue;if(Te!==null){Te=Te.shared;var He=Te.pending;He===null?ve.next=ve:(ve.next=He.next,He.next=ve),Te.pending=ve}}q.lanes|=k,ve=q.alternate,ve!==null&&(ve.lanes|=k),y0(q.return,k,c),le.lanes|=k;break}ve=ve.next}}else if(q.tag===10)ee=q.type===c.type?null:q.child;else if(q.tag===18){if(ee=q.return,ee===null)throw Error(a(341));ee.lanes|=k,le=ee.alternate,le!==null&&(le.lanes|=k),y0(ee,k,c),ee=q.sibling}else ee=q.child;if(ee!==null)ee.return=q;else for(ee=q;ee!==null;){if(ee===c){ee=null;break}if(q=ee.sibling,q!==null){q.return=ee.return,ee=q;break}ee=ee.return}q=ee}Zn(u,c,j.children,k),c=c.child}return c;case 9:return j=c.type,I=c.pendingProps.children,$l(c,k),j=Br(j),I=I(j),c.flags|=1,Zn(u,c,I,k),c.child;case 14:return I=c.type,j=li(I,c.pendingProps),j=li(I.type,j),Eb(u,c,I,j,k);case 15:return Ob(u,c,c.type,c.pendingProps,k);case 17:return I=c.type,j=c.pendingProps,j=c.elementType===I?j:li(I,j),kf(u,c),c.tag=1,or(I)?(u=!0,of(c)):u=!1,$l(c,k),gb(c,I,j),N0(c,I,j,k),F0(null,c,I,!0,u,k);case 19:return Mb(u,c,k);case 22:return xb(u,c,k)}throw Error(a(156,c.tag))};function n3(u,c){return a0(u,c)}function _E(u,c,k,I){this.tag=u,this.key=k,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=I,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gr(u,c,k,I){return new _E(u,c,k,I)}function s1(u){return u=u.prototype,!(!u||!u.isReactComponent)}function wE(u){if(typeof u=="function")return s1(u)?1:0;if(u!=null){if(u=u.$$typeof,u===g)return 11;if(u===y)return 14}return 2}function qo(u,c){var k=u.alternate;return k===null?(k=Gr(u.tag,c,u.key,u.mode),k.elementType=u.elementType,k.type=u.type,k.stateNode=u.stateNode,k.alternate=u,u.alternate=k):(k.pendingProps=c,k.type=u.type,k.flags=0,k.subtreeFlags=0,k.deletions=null),k.flags=u.flags&14680064,k.childLanes=u.childLanes,k.lanes=u.lanes,k.child=u.child,k.memoizedProps=u.memoizedProps,k.memoizedState=u.memoizedState,k.updateQueue=u.updateQueue,c=u.dependencies,k.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},k.sibling=u.sibling,k.index=u.index,k.ref=u.ref,k}function qf(u,c,k,I,j,q){var ee=2;if(I=u,typeof u=="function")s1(u)&&(ee=1);else if(typeof u=="string")ee=5;else e:switch(u){case h:return qa(k.children,j,q,c);case x:ee=8,j|=8;break;case w:return u=Gr(12,k,c,j|2),u.elementType=w,u.lanes=q,u;case b:return u=Gr(13,k,c,j),u.elementType=b,u.lanes=q,u;case p:return u=Gr(19,k,c,j),u.elementType=p,u.lanes=q,u;case m:return Wf(k,j,q,c);default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case v:ee=10;break e;case O:ee=9;break e;case g:ee=11;break e;case y:ee=14;break e;case d:ee=16,I=null;break e}throw Error(a(130,u==null?u:typeof u,""))}return c=Gr(ee,k,c,j),c.elementType=u,c.type=I,c.lanes=q,c}function qa(u,c,k,I){return u=Gr(7,u,I,c),u.lanes=k,u}function Wf(u,c,k,I){return u=Gr(22,u,I,c),u.elementType=m,u.lanes=k,u.stateNode={isHidden:!1},u}function u1(u,c,k){return u=Gr(6,u,null,c),u.lanes=k,u}function c1(u,c,k){return c=Gr(4,u.children!==null?u.children:[],u.key,c),c.lanes=k,c.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},c}function SE(u,c,k,I,j){this.tag=c,this.containerInfo=u,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=X,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=i0(0),this.expirationTimes=i0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=i0(0),this.identifierPrefix=I,this.onRecoverableError=j,ie&&(this.mutableSourceEagerHydrationData=null)}function r3(u,c,k,I,j,q,ee,le,ve){return u=new SE(u,c,k,le,ve),c===1?(c=1,q===!0&&(c|=8)):c=0,q=Gr(3,null,null,c),u.current=q,q.stateNode=u,q.memoizedState={element:I,isDehydrated:k,cache:null,transitions:null,pendingSuspenseBoundaries:null},_0(q),u}function i3(u){if(!u)return zo;u=u._reactInternals;e:{if(S(u)!==u||u.tag!==1)throw Error(a(170));var c=u;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(or(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(a(171))}if(u.tag===1){var k=u.type;if(or(k))return C2(u,k,c)}return c}function o3(u){var c=u._reactInternals;if(c===void 0)throw typeof u.render=="function"?Error(a(188)):(u=Object.keys(u).join(","),Error(a(268,u)));return u=T(c),u===null?null:u.stateNode}function a3(u,c){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var k=u.retryLane;u.retryLane=k!==0&&k<c?k:c}}function Yf(u,c){a3(u,c),(u=u.alternate)&&a3(u,c)}function EE(u){return u=T(u),u===null?null:u.stateNode}function OE(){return null}return n.attemptContinuousHydration=function(u){if(u.tag===13){var c=Ri(u,134217728);if(c!==null){var k=Vn();$r(c,u,134217728,k)}Yf(u,134217728)}},n.attemptDiscreteHydration=function(u){if(u.tag===13){var c=Ri(u,1);if(c!==null){var k=Vn();$r(c,u,1,k)}Yf(u,1)}},n.attemptHydrationAtCurrentPriority=function(u){if(u.tag===13){var c=Go(u),k=Ri(u,c);if(k!==null){var I=Vn();$r(k,u,c,I)}Yf(u,c)}},n.attemptSynchronousHydration=function(u){switch(u.tag){case 3:var c=u.stateNode;if(c.current.memoizedState.isDehydrated){var k=fu(c.pendingLanes);k!==0&&(o0(c,k|1),sr(c,Pn()),!(ct&6)&&(Kl(),Ai()))}break;case 13:Yb(function(){var I=Ri(u,1);if(I!==null){var j=Vn();$r(I,u,1,j)}}),Yf(u,1)}},n.batchedUpdates=function(u,c){var k=ct;ct|=1;try{return u(c)}finally{ct=k,ct===0&&(Kl(),cf&&Ai())}},n.createComponentSelector=function(u){return{$$typeof:Lf,value:u}},n.createContainer=function(u,c,k,I,j,q,ee){return r3(u,c,!1,null,k,I,j,q,ee)},n.createHasPseudoClassSelector=function(u){return{$$typeof:Nf,value:u}},n.createHydrationContainer=function(u,c,k,I,j,q,ee,le,ve){return u=r3(k,I,!0,u,j,q,ee,le,ve),u.context=i3(null),k=u.current,I=Vn(),j=Go(k),q=lo(I,j),q.callback=c??null,Uo(k,q,j),u.current.lanes=j,du(u,j,I),sr(u,I),u},n.createPortal=function(u,c,k){var I=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:I==null?null:""+I,children:u,containerInfo:c,implementation:k}},n.createRoleSelector=function(u){return{$$typeof:If,value:u}},n.createTestNameSelector=function(u){return{$$typeof:Df,value:u}},n.createTextSelector=function(u){return{$$typeof:jf,value:u}},n.deferredUpdates=function(u){var c=yt,k=an.transition;try{return an.transition=null,yt=16,u()}finally{yt=c,an.transition=k}},n.discreteUpdates=function(u,c,k,I,j){var q=yt,ee=an.transition;try{return an.transition=null,yt=1,u(c,k,I,j)}finally{yt=q,an.transition=ee,ct===0&&Kl()}},n.findAllNodes=Z0,n.findBoundingRects=function(u,c){if(!we)throw Error(a(363));c=Z0(u,c),u=[];for(var k=0;k<c.length;k++)u.push(te(c[k]));for(c=u.length-1;0<c;c--){k=u[c];for(var I=k.x,j=I+k.width,q=k.y,ee=q+k.height,le=c-1;0<=le;le--)if(c!==le){var ve=u[le],Te=ve.x,He=Te+ve.width,nt=ve.y,De=nt+ve.height;if(I>=Te&&q>=nt&&j<=He&&ee<=De){u.splice(c,1);break}else if(I!==Te||k.width!==ve.width||De<q||nt>ee){if(!(q!==nt||k.height!==ve.height||He<I||Te>j)){Te>I&&(ve.width+=Te-I,ve.x=I),He<j&&(ve.width=j-Te),u.splice(c,1);break}}else{nt>q&&(ve.height+=nt-q,ve.y=q),De<ee&&(ve.height=ee-nt),u.splice(c,1);break}}}return u},n.findHostInstance=o3,n.findHostInstanceWithNoPortals=function(u){return u=P(u),u=u!==null?U(u):null,u===null?null:u.stateNode},n.findHostInstanceWithWarning=function(u){return o3(u)},n.flushControlled=function(u){var c=ct;ct|=1;var k=an.transition,I=yt;try{an.transition=null,yt=1,u()}finally{yt=I,an.transition=k,ct=c,ct===0&&(Kl(),Ai())}},n.flushPassiveEffects=Va,n.flushSync=Yb,n.focusWithin=function(u,c){if(!we)throw Error(a(363));for(u=Y0(u),c=Vb(u,c),c=Array.from(c),u=0;u<c.length;){var k=c[u++];if(!de(k)){if(k.tag===5&&Ve(k.stateNode))return!0;for(k=k.child;k!==null;)c.push(k),k=k.sibling}}return!1},n.getCurrentUpdatePriority=function(){return yt},n.getFindAllNodesFailureDescription=function(u,c){if(!we)throw Error(a(363));var k=0,I=[];u=[Y0(u),0];for(var j=0;j<u.length;){var q=u[j++],ee=u[j++],le=c[ee];if((q.tag!==5||!de(q))&&(K0(q,le)&&(I.push(X0(le)),ee++,ee>k&&(k=ee)),ee<c.length))for(q=q.child;q!==null;)u.push(q,ee),q=q.sibling}if(k<c.length){for(u=[];k<c.length;k++)u.push(X0(c[k]));return`findAllNodes was able to match part of the selector:
|
|
57
|
+
`+q.stack}return{value:u,source:c,stack:j,digest:null}}function I0(u,c,k){return{value:u,source:null,stack:k??null,digest:c??null}}function D0(u,c){try{console.error(c.value)}catch(k){setTimeout(function(){throw k})}}var rE=typeof WeakMap=="function"?WeakMap:Map;function mb(u,c,k){k=lo(-1,k),k.tag=3,k.payload={element:null};var I=c.value;return k.callback=function(){Bf||(Bf=!0,n1=I),D0(u,c)},k}function yb(u,c,k){k=lo(-1,k),k.tag=3;var I=u.type.getDerivedStateFromError;if(typeof I=="function"){var j=c.value;k.payload=function(){return I(j)},k.callback=function(){D0(u,c)}}var q=u.stateNode;return q!==null&&typeof q.componentDidCatch=="function"&&(k.callback=function(){D0(u,c),typeof I!="function"&&(Ho===null?Ho=new Set([this]):Ho.add(this));var ee=c.stack;this.componentDidCatch(c.value,{componentStack:ee!==null?ee:""})}),k}function bb(u,c,k){var I=u.pingCache;if(I===null){I=u.pingCache=new rE;var j=new Set;I.set(c,j)}else j=I.get(c),j===void 0&&(j=new Set,I.set(c,j));j.has(k)||(j.add(k),u=mE.bind(null,u,c,k),c.then(u,u))}function _b(u){do{var c;if((c=u.tag===13)&&(c=u.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return u;u=u.return}while(u!==null);return null}function wb(u,c,k,I,j){return u.mode&1?(u.flags|=65536,u.lanes=j,u):(u===c?u.flags|=65536:(u.flags|=128,k.flags|=131072,k.flags&=-52805,k.tag===1&&(k.alternate===null?k.tag=17:(c=lo(-1,1),c.tag=2,Uo(k,c,1))),k.lanes|=1),u)}var iE=l.ReactCurrentOwner,ar=!1;function Zn(u,c,k,I){c.child=u===null?B2(c,null,k,I):Ul(c,u.child,k,I)}function Sb(u,c,k,I,j){k=k.render;var q=c.ref;return $l(c,j),I=C0(u,c,k,I,q,j),k=k0(),u!==null&&!ar?(c.updateQueue=u.updateQueue,c.flags&=-2053,u.lanes&=~j,so(u,c,j)):($t&&k&&c0(c),c.flags|=1,Zn(u,c,I,j),c.child)}function Eb(u,c,k,I,j){if(u===null){var q=k.type;return typeof q=="function"&&!s1(q)&&q.defaultProps===void 0&&k.compare===null&&k.defaultProps===void 0?(c.tag=15,c.type=q,Ob(u,c,q,I,j)):(u=qf(k.type,null,I,c,c.mode,j),u.ref=c.ref,u.return=c,c.child=u)}if(q=u.child,!(u.lanes&j)){var ee=q.memoizedProps;if(k=k.compare,k=k!==null?k:pf,k(ee,I)&&u.ref===c.ref)return so(u,c,j)}return c.flags|=1,u=qo(q,I),u.ref=c.ref,u.return=c,c.child=u}function Ob(u,c,k,I,j){if(u!==null){var q=u.memoizedProps;if(pf(q,I)&&u.ref===c.ref)if(ar=!1,c.pendingProps=I=q,(u.lanes&j)!==0)u.flags&131072&&(ar=!0);else return c.lanes=u.lanes,so(u,c,j)}return j0(u,c,k,I,j)}function xb(u,c,k){var I=c.pendingProps,j=I.children,q=u!==null?u.memoizedState:null;if(I.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Nt(Yl,Or),Or|=k;else{if(!(k&1073741824))return u=q!==null?q.baseLanes|k:k,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:u,cachePool:null,transitions:null},c.updateQueue=null,Nt(Yl,Or),Or|=u,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},I=q!==null?q.baseLanes:k,Nt(Yl,Or),Or|=I}else q!==null?(I=q.baseLanes|k,c.memoizedState=null):I=k,Nt(Yl,Or),Or|=I;return Zn(u,c,j,k),c.child}function Pb(u,c){var k=c.ref;(u===null&&k!==null||u!==null&&u.ref!==k)&&(c.flags|=512,c.flags|=2097152)}function j0(u,c,k,I,j){var q=or(k)?ja:Un.current;return q=jl(c,q),$l(c,j),k=C0(u,c,k,I,q,j),I=k0(),u!==null&&!ar?(c.updateQueue=u.updateQueue,c.flags&=-2053,u.lanes&=~j,so(u,c,j)):($t&&I&&c0(c),c.flags|=1,Zn(u,c,k,j),c.child)}function Cb(u,c,k,I,j){if(or(k)){var q=!0;of(c)}else q=!1;if($l(c,j),c.stateNode===null)kf(u,c),gb(c,k,I),N0(c,k,I,j),I=!0;else if(u===null){var ee=c.stateNode,le=c.memoizedProps;ee.props=le;var ve=ee.context,Te=k.contextType;typeof Te=="object"&&Te!==null?Te=Br(Te):(Te=or(k)?ja:Un.current,Te=jl(c,Te));var He=k.getDerivedStateFromProps,nt=typeof He=="function"||typeof ee.getSnapshotBeforeUpdate=="function";nt||typeof ee.UNSAFE_componentWillReceiveProps!="function"&&typeof ee.componentWillReceiveProps!="function"||(le!==I||ve!==Te)&&vb(c,ee,I,Te),Bo=!1;var De=c.memoizedState;ee.state=De,bf(c,I,ee,j),ve=c.memoizedState,le!==I||De!==ve||ir.current||Bo?(typeof He=="function"&&(L0(c,k,He,I),ve=c.memoizedState),(le=Bo||pb(c,k,le,I,De,ve,Te))?(nt||typeof ee.UNSAFE_componentWillMount!="function"&&typeof ee.componentWillMount!="function"||(typeof ee.componentWillMount=="function"&&ee.componentWillMount(),typeof ee.UNSAFE_componentWillMount=="function"&&ee.UNSAFE_componentWillMount()),typeof ee.componentDidMount=="function"&&(c.flags|=4194308)):(typeof ee.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=I,c.memoizedState=ve),ee.props=I,ee.state=ve,ee.context=Te,I=le):(typeof ee.componentDidMount=="function"&&(c.flags|=4194308),I=!1)}else{ee=c.stateNode,$2(u,c),le=c.memoizedProps,Te=c.type===c.elementType?le:li(c.type,le),ee.props=Te,nt=c.pendingProps,De=ee.context,ve=k.contextType,typeof ve=="object"&&ve!==null?ve=Br(ve):(ve=or(k)?ja:Un.current,ve=jl(c,ve));var Bt=k.getDerivedStateFromProps;(He=typeof Bt=="function"||typeof ee.getSnapshotBeforeUpdate=="function")||typeof ee.UNSAFE_componentWillReceiveProps!="function"&&typeof ee.componentWillReceiveProps!="function"||(le!==nt||De!==ve)&&vb(c,ee,I,ve),Bo=!1,De=c.memoizedState,ee.state=De,bf(c,I,ee,j);var Mt=c.memoizedState;le!==nt||De!==Mt||ir.current||Bo?(typeof Bt=="function"&&(L0(c,k,Bt,I),Mt=c.memoizedState),(Te=Bo||pb(c,k,Te,I,De,Mt,ve)||!1)?(He||typeof ee.UNSAFE_componentWillUpdate!="function"&&typeof ee.componentWillUpdate!="function"||(typeof ee.componentWillUpdate=="function"&&ee.componentWillUpdate(I,Mt,ve),typeof ee.UNSAFE_componentWillUpdate=="function"&&ee.UNSAFE_componentWillUpdate(I,Mt,ve)),typeof ee.componentDidUpdate=="function"&&(c.flags|=4),typeof ee.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof ee.componentDidUpdate!="function"||le===u.memoizedProps&&De===u.memoizedState||(c.flags|=4),typeof ee.getSnapshotBeforeUpdate!="function"||le===u.memoizedProps&&De===u.memoizedState||(c.flags|=1024),c.memoizedProps=I,c.memoizedState=Mt),ee.props=I,ee.state=Mt,ee.context=ve,I=Te):(typeof ee.componentDidUpdate!="function"||le===u.memoizedProps&&De===u.memoizedState||(c.flags|=4),typeof ee.getSnapshotBeforeUpdate!="function"||le===u.memoizedProps&&De===u.memoizedState||(c.flags|=1024),I=!1)}return F0(u,c,k,I,q,j)}function F0(u,c,k,I,j,q){Pb(u,c);var ee=(c.flags&128)!==0;if(!I&&!ee)return j&&k2(c,k,!1),so(u,c,q);I=c.stateNode,iE.current=c;var le=ee&&typeof k.getDerivedStateFromError!="function"?null:I.render();return c.flags|=1,u!==null&&ee?(c.child=Ul(c,u.child,null,q),c.child=Ul(c,null,le,q)):Zn(u,c,le,q),c.memoizedState=I.state,j&&k2(c,k,!0),c.child}function kb(u){var c=u.stateNode;c.pendingContext?P2(u,c.pendingContext,c.pendingContext!==c.context):c.context&&P2(u,c.context,!1),w0(u,c.containerInfo)}function Tb(u,c,k,I,j){return Bl(),p0(j),c.flags|=256,Zn(u,c,k,I),c.child}var z0={dehydrated:null,treeContext:null,retryLane:0};function B0(u){return{baseLanes:u,cachePool:null,transitions:null}}function Ab(u,c,k){var I=c.pendingProps,j=Kt.current,q=!1,ee=(c.flags&128)!==0,le;if((le=ee)||(le=u!==null&&u.memoizedState===null?!1:(j&2)!==0),le?(q=!0,c.flags&=-129):(u===null||u.memoizedState!==null)&&(j|=1),Nt(Kt,j&1),u===null)return h0(c),u=c.memoizedState,u!==null&&(u=u.dehydrated,u!==null)?(c.mode&1?pn(u)?c.lanes=8:c.lanes=1073741824:c.lanes=1,null):(ee=I.children,u=I.fallback,q?(I=c.mode,q=c.child,ee={mode:"hidden",children:ee},!(I&1)&&q!==null?(q.childLanes=0,q.pendingProps=ee):q=Wf(ee,I,0,null),u=qa(u,I,k,null),q.return=c,u.return=c,q.sibling=u,c.child=q,c.child.memoizedState=B0(k),c.memoizedState=z0,u):U0(c,ee));if(j=u.memoizedState,j!==null&&(le=j.dehydrated,le!==null))return oE(u,c,ee,I,le,j,k);if(q){q=I.fallback,ee=c.mode,j=u.child,le=j.sibling;var ve={mode:"hidden",children:I.children};return!(ee&1)&&c.child!==j?(I=c.child,I.childLanes=0,I.pendingProps=ve,c.deletions=null):(I=qo(j,ve),I.subtreeFlags=j.subtreeFlags&14680064),le!==null?q=qo(le,q):(q=qa(q,ee,k,null),q.flags|=2),q.return=c,I.return=c,I.sibling=q,c.child=I,I=q,q=c.child,ee=u.child.memoizedState,ee=ee===null?B0(k):{baseLanes:ee.baseLanes|k,cachePool:null,transitions:ee.transitions},q.memoizedState=ee,q.childLanes=u.childLanes&~k,c.memoizedState=z0,I}return q=u.child,u=q.sibling,I=qo(q,{mode:"visible",children:I.children}),!(c.mode&1)&&(I.lanes=k),I.return=c,I.sibling=null,u!==null&&(k=c.deletions,k===null?(c.deletions=[u],c.flags|=16):k.push(u)),c.child=I,c.memoizedState=null,I}function U0(u,c){return c=Wf({mode:"visible",children:c},u.mode,0,null),c.return=u,u.child=c}function Cf(u,c,k,I){return I!==null&&p0(I),Ul(c,u.child,null,k),u=U0(c,c.pendingProps.children),u.flags|=2,c.memoizedState=null,u}function oE(u,c,k,I,j,q,ee){if(k)return c.flags&256?(c.flags&=-257,I=I0(Error(a(422))),Cf(u,c,ee,I)):c.memoizedState!==null?(c.child=u.child,c.flags|=128,null):(q=I.fallback,j=c.mode,I=Wf({mode:"visible",children:I.children},j,0,null),q=qa(q,j,ee,null),q.flags|=2,I.return=c,q.return=c,I.sibling=q,c.child=I,c.mode&1&&Ul(c,u.child,null,ee),c.child.memoizedState=B0(ee),c.memoizedState=z0,q);if(!(c.mode&1))return Cf(u,c,ee,null);if(pn(j))return I=rr(j).digest,q=Error(a(419)),I=I0(q,I,void 0),Cf(u,c,ee,I);if(k=(ee&u.childLanes)!==0,ar||k){if(I=kn,I!==null){switch(ee&-ee){case 4:j=2;break;case 16:j=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:j=32;break;case 536870912:j=268435456;break;default:j=0}j=j&(I.suspendedLanes|ee)?0:j,j!==0&&j!==q.retryLane&&(q.retryLane=j,Ri(u,j),$r(I,u,j,-1))}return l1(),I=I0(Error(a(421))),Cf(u,c,ee,I)}return hn(j)?(c.flags|=128,c.child=u.child,c=yE.bind(null,u),to(j,c),null):(u=q.treeContext,ie&&(zr=ft(j),Er=c,$t=!0,ai=null,hu=!1,u!==null&&(jr[Fr++]=oo,jr[Fr++]=ao,jr[Fr++]=Fa,oo=u.id,ao=u.overflow,Fa=c)),c=U0(c,I.children),c.flags|=4096,c)}function Rb(u,c,k){u.lanes|=c;var I=u.alternate;I!==null&&(I.lanes|=c),y0(u.return,c,k)}function H0(u,c,k,I,j){var q=u.memoizedState;q===null?u.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:I,tail:k,tailMode:j}:(q.isBackwards=c,q.rendering=null,q.renderingStartTime=0,q.last=I,q.tail=k,q.tailMode=j)}function Mb(u,c,k){var I=c.pendingProps,j=I.revealOrder,q=I.tail;if(Zn(u,c,I.children,k),I=Kt.current,I&2)I=I&1|2,c.flags|=128;else{if(u!==null&&u.flags&128)e:for(u=c.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&Rb(u,k,c);else if(u.tag===19)Rb(u,k,c);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===c)break e;for(;u.sibling===null;){if(u.return===null||u.return===c)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}I&=1}if(Nt(Kt,I),!(c.mode&1))c.memoizedState=null;else switch(j){case"forwards":for(k=c.child,j=null;k!==null;)u=k.alternate,u!==null&&_f(u)===null&&(j=k),k=k.sibling;k=j,k===null?(j=c.child,c.child=null):(j=k.sibling,k.sibling=null),H0(c,!1,j,k,q);break;case"backwards":for(k=null,j=c.child,c.child=null;j!==null;){if(u=j.alternate,u!==null&&_f(u)===null){c.child=j;break}u=j.sibling,j.sibling=k,k=j,j=u}H0(c,!0,k,null,q);break;case"together":H0(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function kf(u,c){!(c.mode&1)&&u!==null&&(u.alternate=null,c.alternate=null,c.flags|=2)}function so(u,c,k){if(u!==null&&(c.dependencies=u.dependencies),Ha|=c.lanes,!(k&c.childLanes))return null;if(u!==null&&c.child!==u.child)throw Error(a(153));if(c.child!==null){for(u=c.child,k=qo(u,u.pendingProps),c.child=k,k.return=c;u.sibling!==null;)u=u.sibling,k=k.sibling=qo(u,u.pendingProps),k.return=c;k.sibling=null}return c.child}function aE(u,c,k){switch(c.tag){case 3:kb(c),Bl();break;case 5:q2(c);break;case 1:or(c.type)&&of(c);break;case 4:w0(c,c.stateNode.containerInfo);break;case 10:U2(c,c.type._context,c.memoizedProps.value);break;case 13:var I=c.memoizedState;if(I!==null)return I.dehydrated!==null?(Nt(Kt,Kt.current&1),c.flags|=128,null):k&c.child.childLanes?Ab(u,c,k):(Nt(Kt,Kt.current&1),u=so(u,c,k),u!==null?u.sibling:null);Nt(Kt,Kt.current&1);break;case 19:if(I=(k&c.childLanes)!==0,u.flags&128){if(I)return Mb(u,c,k);c.flags|=128}var j=c.memoizedState;if(j!==null&&(j.rendering=null,j.tail=null,j.lastEffect=null),Nt(Kt,Kt.current),I)break;return null;case 22:case 23:return c.lanes=0,xb(u,c,k)}return so(u,c,k)}function Ni(u){u.flags|=4}function Lb(u,c){if(u!==null&&u.child===c.child)return!0;if(c.flags&16)return!1;for(u=c.child;u!==null;){if(u.flags&12854||u.subtreeFlags&12854)return!1;u=u.sibling}return!0}var wu,Su,Tf,Af;if(J)wu=function(u,c){for(var k=c.child;k!==null;){if(k.tag===5||k.tag===6)B(u,k.stateNode);else if(k.tag!==4&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===c)break;for(;k.sibling===null;){if(k.return===null||k.return===c)return;k=k.return}k.sibling.return=k.return,k=k.sibling}},Su=function(){},Tf=function(u,c,k,I,j){if(u=u.memoizedProps,u!==I){var q=c.stateNode,ee=Mi(Ur.current);k=Y(q,k,u,I,j,ee),(c.updateQueue=k)&&Ni(c)}},Af=function(u,c,k,I){k!==I&&Ni(c)};else if(ne){wu=function(u,c,k,I){for(var j=c.child;j!==null;){if(j.tag===5){var q=j.stateNode;k&&I&&(q=Ye(q,j.type,j.memoizedProps,j)),B(u,q)}else if(j.tag===6)q=j.stateNode,k&&I&&(q=at(q,j.memoizedProps,j)),B(u,q);else if(j.tag!==4){if(j.tag===22&&j.memoizedState!==null)q=j.child,q!==null&&(q.return=j),wu(u,j,!0,!0);else if(j.child!==null){j.child.return=j,j=j.child;continue}}if(j===c)break;for(;j.sibling===null;){if(j.return===null||j.return===c)return;j=j.return}j.sibling.return=j.return,j=j.sibling}};var Nb=function(u,c,k,I){for(var j=c.child;j!==null;){if(j.tag===5){var q=j.stateNode;k&&I&&(q=Ye(q,j.type,j.memoizedProps,j)),Tt(u,q)}else if(j.tag===6)q=j.stateNode,k&&I&&(q=at(q,j.memoizedProps,j)),Tt(u,q);else if(j.tag!==4){if(j.tag===22&&j.memoizedState!==null)q=j.child,q!==null&&(q.return=j),Nb(u,j,!0,!0);else if(j.child!==null){j.child.return=j,j=j.child;continue}}if(j===c)break;for(;j.sibling===null;){if(j.return===null||j.return===c)return;j=j.return}j.sibling.return=j.return,j=j.sibling}};Su=function(u,c){var k=c.stateNode;if(!Lb(u,c)){u=k.containerInfo;var I=Wt(u);Nb(I,c,!1,!1),k.pendingChildren=I,Ni(c),Yt(u,I)}},Tf=function(u,c,k,I,j){var q=u.stateNode,ee=u.memoizedProps;if((u=Lb(u,c))&&ee===I)c.stateNode=q;else{var le=c.stateNode,ve=Mi(Ur.current),Te=null;ee!==I&&(Te=Y(le,k,ee,I,j,ve)),u&&Te===null?c.stateNode=q:(q=$e(q,Te,k,ee,I,c,u,le),V(q,k,I,j,ve)&&Ni(c),c.stateNode=q,u?Ni(c):wu(q,c,!1,!1))}},Af=function(u,c,k,I){k!==I?(u=Mi(Gl.current),k=Mi(Ur.current),c.stateNode=$(I,u,k,c),Ni(c)):c.stateNode=u.stateNode}}else Su=function(){},Tf=function(){},Af=function(){};function Eu(u,c){if(!$t)switch(u.tailMode){case"hidden":c=u.tail;for(var k=null;c!==null;)c.alternate!==null&&(k=c),c=c.sibling;k===null?u.tail=null:k.sibling=null;break;case"collapsed":k=u.tail;for(var I=null;k!==null;)k.alternate!==null&&(I=k),k=k.sibling;I===null?c||u.tail===null?u.tail=null:u.tail.sibling=null:I.sibling=null}}function $n(u){var c=u.alternate!==null&&u.alternate.child===u.child,k=0,I=0;if(c)for(var j=u.child;j!==null;)k|=j.lanes|j.childLanes,I|=j.subtreeFlags&14680064,I|=j.flags&14680064,j.return=u,j=j.sibling;else for(j=u.child;j!==null;)k|=j.lanes|j.childLanes,I|=j.subtreeFlags,I|=j.flags,j.return=u,j=j.sibling;return u.subtreeFlags|=I,u.childLanes=k,c}function lE(u,c,k){var I=c.pendingProps;switch(f0(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $n(c),null;case 1:return or(c.type)&&rf(),$n(c),null;case 3:return k=c.stateNode,Vl(),zt(ir),zt(Un),O0(),k.pendingContext&&(k.context=k.pendingContext,k.pendingContext=null),(u===null||u.child===null)&&(hf(c)?Ni(c):u===null||u.memoizedState.isDehydrated&&!(c.flags&256)||(c.flags|=1024,ai!==null&&(o1(ai),ai=null))),Su(u,c),$n(c),null;case 5:S0(c),k=Mi(Gl.current);var j=c.type;if(u!==null&&c.stateNode!=null)Tf(u,c,j,I,k),u.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!I){if(c.stateNode===null)throw Error(a(166));return $n(c),null}if(u=Mi(Ur.current),hf(c)){if(!ie)throw Error(a(175));u=Ft(c.stateNode,c.type,c.memoizedProps,k,u,c,!hu),c.updateQueue=u,u!==null&&Ni(c)}else{var q=D(j,I,k,u,c);wu(q,c,!1,!1),c.stateNode=q,V(q,j,I,k,u)&&Ni(c)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return $n(c),null;case 6:if(u&&c.stateNode!=null)Af(u,c,u.memoizedProps,I);else{if(typeof I!="string"&&c.stateNode===null)throw Error(a(166));if(u=Mi(Gl.current),k=Mi(Ur.current),hf(c)){if(!ie)throw Error(a(176));if(u=c.stateNode,k=c.memoizedProps,(I=Pt(u,k,c,!hu))&&(j=Er,j!==null))switch(j.tag){case 3:cu(j.stateNode.containerInfo,u,k,(j.mode&1)!==0);break;case 5:Da(j.type,j.memoizedProps,j.stateNode,u,k,(j.mode&1)!==0)}I&&Ni(c)}else c.stateNode=$(I,u,k,c)}return $n(c),null;case 13:if(zt(Kt),I=c.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if($t&&zr!==null&&c.mode&1&&!(c.flags&128))j2(),Bl(),c.flags|=98560,j=!1;else if(j=hf(c),I!==null&&I.dehydrated!==null){if(u===null){if(!j)throw Error(a(318));if(!ie)throw Error(a(344));if(j=c.memoizedState,j=j!==null?j.dehydrated:null,!j)throw Error(a(317));Bn(j,c)}else Bl(),!(c.flags&128)&&(c.memoizedState=null),c.flags|=4;$n(c),j=!1}else ai!==null&&(o1(ai),ai=null),j=!0;if(!j)return c.flags&65536?c:null}return c.flags&128?(c.lanes=k,c):(k=I!==null,k!==(u!==null&&u.memoizedState!==null)&&k&&(c.child.flags|=8192,c.mode&1&&(u===null||Kt.current&1?vn===0&&(vn=3):l1())),c.updateQueue!==null&&(c.flags|=4),$n(c),null);case 4:return Vl(),Su(u,c),u===null&&de(c.stateNode.containerInfo),$n(c),null;case 10:return m0(c.type._context),$n(c),null;case 17:return or(c.type)&&rf(),$n(c),null;case 19:if(zt(Kt),j=c.memoizedState,j===null)return $n(c),null;if(I=(c.flags&128)!==0,q=j.rendering,q===null)if(I)Eu(j,!1);else{if(vn!==0||u!==null&&u.flags&128)for(u=c.child;u!==null;){if(q=_f(u),q!==null){for(c.flags|=128,Eu(j,!1),u=q.updateQueue,u!==null&&(c.updateQueue=u,c.flags|=4),c.subtreeFlags=0,u=k,k=c.child;k!==null;)I=k,j=u,I.flags&=14680066,q=I.alternate,q===null?(I.childLanes=0,I.lanes=j,I.child=null,I.subtreeFlags=0,I.memoizedProps=null,I.memoizedState=null,I.updateQueue=null,I.dependencies=null,I.stateNode=null):(I.childLanes=q.childLanes,I.lanes=q.lanes,I.child=q.child,I.subtreeFlags=0,I.deletions=null,I.memoizedProps=q.memoizedProps,I.memoizedState=q.memoizedState,I.updateQueue=q.updateQueue,I.type=q.type,j=q.dependencies,I.dependencies=j===null?null:{lanes:j.lanes,firstContext:j.firstContext}),k=k.sibling;return Nt(Kt,Kt.current&1|2),c.child}u=u.sibling}j.tail!==null&&Pn()>t1&&(c.flags|=128,I=!0,Eu(j,!1),c.lanes=4194304)}else{if(!I)if(u=_f(q),u!==null){if(c.flags|=128,I=!0,u=u.updateQueue,u!==null&&(c.updateQueue=u,c.flags|=4),Eu(j,!0),j.tail===null&&j.tailMode==="hidden"&&!q.alternate&&!$t)return $n(c),null}else 2*Pn()-j.renderingStartTime>t1&&k!==1073741824&&(c.flags|=128,I=!0,Eu(j,!1),c.lanes=4194304);j.isBackwards?(q.sibling=c.child,c.child=q):(u=j.last,u!==null?u.sibling=q:c.child=q,j.last=q)}return j.tail!==null?(c=j.tail,j.rendering=c,j.tail=c.sibling,j.renderingStartTime=Pn(),c.sibling=null,u=Kt.current,Nt(Kt,I?u&1|2:u&1),c):($n(c),null);case 22:case 23:return a1(),k=c.memoizedState!==null,u!==null&&u.memoizedState!==null!==k&&(c.flags|=8192),k&&c.mode&1?Or&1073741824&&($n(c),J&&c.subtreeFlags&6&&(c.flags|=8192)):$n(c),null;case 24:return null;case 25:return null}throw Error(a(156,c.tag))}function sE(u,c){switch(f0(c),c.tag){case 1:return or(c.type)&&rf(),u=c.flags,u&65536?(c.flags=u&-65537|128,c):null;case 3:return Vl(),zt(ir),zt(Un),O0(),u=c.flags,u&65536&&!(u&128)?(c.flags=u&-65537|128,c):null;case 5:return S0(c),null;case 13:if(zt(Kt),u=c.memoizedState,u!==null&&u.dehydrated!==null){if(c.alternate===null)throw Error(a(340));Bl()}return u=c.flags,u&65536?(c.flags=u&-65537|128,c):null;case 19:return zt(Kt),null;case 4:return Vl(),null;case 10:return m0(c.type._context),null;case 22:case 23:return a1(),null;case 24:return null;default:return null}}var Rf=!1,Gn=!1,uE=typeof WeakSet=="function"?WeakSet:Set,Be=null;function Wl(u,c){var k=u.ref;if(k!==null)if(typeof k=="function")try{k(null)}catch(I){Gt(u,c,I)}else k.current=null}function $0(u,c,k){try{k()}catch(I){Gt(u,c,I)}}var Ib=!1;function cE(u,c){for(L(u.containerInfo),Be=c;Be!==null;)if(u=Be,c=u.child,(u.subtreeFlags&1028)!==0&&c!==null)c.return=u,Be=c;else for(;Be!==null;){u=Be;try{var k=u.alternate;if(u.flags&1024)switch(u.tag){case 0:case 11:case 15:break;case 1:if(k!==null){var I=k.memoizedProps,j=k.memoizedState,q=u.stateNode,ee=q.getSnapshotBeforeUpdate(u.elementType===u.type?I:li(u.type,I),j);q.__reactInternalSnapshotBeforeUpdate=ee}break;case 3:J&&Oe(u.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(le){Gt(u,u.return,le)}if(c=u.sibling,c!==null){c.return=u.return,Be=c;break}Be=u.return}return k=Ib,Ib=!1,k}function Ou(u,c,k){var I=c.updateQueue;if(I=I!==null?I.lastEffect:null,I!==null){var j=I=I.next;do{if((j.tag&u)===u){var q=j.destroy;j.destroy=void 0,q!==void 0&&$0(c,k,q)}j=j.next}while(j!==I)}}function Mf(u,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var k=c=c.next;do{if((k.tag&u)===u){var I=k.create;k.destroy=I()}k=k.next}while(k!==c)}}function G0(u){var c=u.ref;if(c!==null){var k=u.stateNode;switch(u.tag){case 5:u=Z(k);break;default:u=k}typeof c=="function"?c(u):c.current=u}}function Db(u){var c=u.alternate;c!==null&&(u.alternate=null,Db(c)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(c=u.stateNode,c!==null&&Pe(c)),u.stateNode=null,u.return=null,u.dependencies=null,u.memoizedProps=null,u.memoizedState=null,u.pendingProps=null,u.stateNode=null,u.updateQueue=null}function jb(u){return u.tag===5||u.tag===3||u.tag===4}function Fb(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||jb(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&u.tag!==18;){if(u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function V0(u,c,k){var I=u.tag;if(I===5||I===6)u=u.stateNode,c?mt(k,u,c):Ce(k,u);else if(I!==4&&(u=u.child,u!==null))for(V0(u,c,k),u=u.sibling;u!==null;)V0(u,c,k),u=u.sibling}function q0(u,c,k){var I=u.tag;if(I===5||I===6)u=u.stateNode,c?St(k,u,c):Ae(k,u);else if(I!==4&&(u=u.child,u!==null))for(q0(u,c,k),u=u.sibling;u!==null;)q0(u,c,k),u=u.sibling}var Ln=null,si=!1;function Ii(u,c,k){for(k=k.child;k!==null;)W0(u,c,k),k=k.sibling}function W0(u,c,k){if(Ti&&typeof Ti.onCommitFiberUnmount=="function")try{Ti.onCommitFiberUnmount(uf,k)}catch{}switch(k.tag){case 5:Gn||Wl(k,c);case 6:if(J){var I=Ln,j=si;Ln=null,Ii(u,c,k),Ln=I,si=j,Ln!==null&&(si?ce(Ln,k.stateNode):ue(Ln,k.stateNode))}else Ii(u,c,k);break;case 18:J&&Ln!==null&&(si?no(Ln,k.stateNode):Sr(Ln,k.stateNode));break;case 4:J?(I=Ln,j=si,Ln=k.stateNode.containerInfo,si=!0,Ii(u,c,k),Ln=I,si=j):(ne&&(I=k.stateNode.containerInfo,j=Wt(I),ke(I,j)),Ii(u,c,k));break;case 0:case 11:case 14:case 15:if(!Gn&&(I=k.updateQueue,I!==null&&(I=I.lastEffect,I!==null))){j=I=I.next;do{var q=j,ee=q.destroy;q=q.tag,ee!==void 0&&(q&2||q&4)&&$0(k,c,ee),j=j.next}while(j!==I)}Ii(u,c,k);break;case 1:if(!Gn&&(Wl(k,c),I=k.stateNode,typeof I.componentWillUnmount=="function"))try{I.props=k.memoizedProps,I.state=k.memoizedState,I.componentWillUnmount()}catch(le){Gt(k,c,le)}Ii(u,c,k);break;case 21:Ii(u,c,k);break;case 22:k.mode&1?(Gn=(I=Gn)||k.memoizedState!==null,Ii(u,c,k),Gn=I):Ii(u,c,k);break;default:Ii(u,c,k)}}function zb(u){var c=u.updateQueue;if(c!==null){u.updateQueue=null;var k=u.stateNode;k===null&&(k=u.stateNode=new uE),c.forEach(function(I){var j=bE.bind(null,u,I);k.has(I)||(k.add(I),I.then(j,j))})}}function ui(u,c){var k=c.deletions;if(k!==null)for(var I=0;I<k.length;I++){var j=k[I];try{var q=u,ee=c;if(J){var le=ee;e:for(;le!==null;){switch(le.tag){case 5:Ln=le.stateNode,si=!1;break e;case 3:Ln=le.stateNode.containerInfo,si=!0;break e;case 4:Ln=le.stateNode.containerInfo,si=!0;break e}le=le.return}if(Ln===null)throw Error(a(160));W0(q,ee,j),Ln=null,si=!1}else W0(q,ee,j);var ve=j.alternate;ve!==null&&(ve.return=null),j.return=null}catch(Te){Gt(j,c,Te)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)Bb(c,u),c=c.sibling}function Bb(u,c){var k=u.alternate,I=u.flags;switch(u.tag){case 0:case 11:case 14:case 15:if(ui(c,u),Di(u),I&4){try{Ou(3,u,u.return),Mf(3,u)}catch(De){Gt(u,u.return,De)}try{Ou(5,u,u.return)}catch(De){Gt(u,u.return,De)}}break;case 1:ui(c,u),Di(u),I&512&&k!==null&&Wl(k,k.return);break;case 5:if(ui(c,u),Di(u),I&512&&k!==null&&Wl(k,k.return),J){if(u.flags&32){var j=u.stateNode;try{Se(j)}catch(De){Gt(u,u.return,De)}}if(I&4&&(j=u.stateNode,j!=null)){var q=u.memoizedProps;if(k=k!==null?k.memoizedProps:q,I=u.type,c=u.updateQueue,u.updateQueue=null,c!==null)try{We(j,c,I,k,q,u)}catch(De){Gt(u,u.return,De)}}}break;case 6:if(ui(c,u),Di(u),I&4&&J){if(u.stateNode===null)throw Error(a(162));j=u.stateNode,q=u.memoizedProps,k=k!==null?k.memoizedProps:q;try{Me(j,k,q)}catch(De){Gt(u,u.return,De)}}break;case 3:if(ui(c,u),Di(u),I&4){if(J&&ie&&k!==null&&k.memoizedState.isDehydrated)try{tn(c.containerInfo)}catch(De){Gt(u,u.return,De)}if(ne){j=c.containerInfo,q=c.pendingChildren;try{ke(j,q)}catch(De){Gt(u,u.return,De)}}}break;case 4:if(ui(c,u),Di(u),I&4&&ne){q=u.stateNode,j=q.containerInfo,q=q.pendingChildren;try{ke(j,q)}catch(De){Gt(u,u.return,De)}}break;case 13:ui(c,u),Di(u),j=u.child,j.flags&8192&&(q=j.memoizedState!==null,j.stateNode.isHidden=q,!q||j.alternate!==null&&j.alternate.memoizedState!==null||(e1=Pn())),I&4&&zb(u);break;case 22:var ee=k!==null&&k.memoizedState!==null;if(u.mode&1?(Gn=(k=Gn)||ee,ui(c,u),Gn=k):ui(c,u),Di(u),I&8192){if(k=u.memoizedState!==null,(u.stateNode.isHidden=k)&&!ee&&u.mode&1)for(Be=u,I=u.child;I!==null;){for(c=Be=I;Be!==null;){ee=Be;var le=ee.child;switch(ee.tag){case 0:case 11:case 14:case 15:Ou(4,ee,ee.return);break;case 1:Wl(ee,ee.return);var ve=ee.stateNode;if(typeof ve.componentWillUnmount=="function"){var Te=ee,He=ee.return;try{var nt=Te;ve.props=nt.memoizedProps,ve.state=nt.memoizedState,ve.componentWillUnmount()}catch(De){Gt(Te,He,De)}}break;case 5:Wl(ee,ee.return);break;case 22:if(ee.memoizedState!==null){$b(c);continue}}le!==null?(le.return=ee,Be=le):$b(c)}I=I.sibling}if(J){e:if(I=null,J)for(c=u;;){if(c.tag===5){if(I===null){I=c;try{j=c.stateNode,k?Le(j):ge(c.stateNode,c.memoizedProps)}catch(De){Gt(u,u.return,De)}}}else if(c.tag===6){if(I===null)try{q=c.stateNode,k?Ne(q):Xe(q,c.memoizedProps)}catch(De){Gt(u,u.return,De)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===u)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===u)break e;for(;c.sibling===null;){if(c.return===null||c.return===u)break e;I===c&&(I=null),c=c.return}I===c&&(I=null),c.sibling.return=c.return,c=c.sibling}}}break;case 19:ui(c,u),Di(u),I&4&&zb(u);break;case 21:break;default:ui(c,u),Di(u)}}function Di(u){var c=u.flags;if(c&2){try{if(J){e:{for(var k=u.return;k!==null;){if(jb(k)){var I=k;break e}k=k.return}throw Error(a(160))}switch(I.tag){case 5:var j=I.stateNode;I.flags&32&&(Se(j),I.flags&=-33);var q=Fb(u);q0(u,q,j);break;case 3:case 4:var ee=I.stateNode.containerInfo,le=Fb(u);V0(u,le,ee);break;default:throw Error(a(161))}}}catch(ve){Gt(u,u.return,ve)}u.flags&=-3}c&4096&&(u.flags&=-4097)}function fE(u,c,k){Be=u,Ub(u)}function Ub(u,c,k){for(var I=(u.mode&1)!==0;Be!==null;){var j=Be,q=j.child;if(j.tag===22&&I){var ee=j.memoizedState!==null||Rf;if(!ee){var le=j.alternate,ve=le!==null&&le.memoizedState!==null||Gn;le=Rf;var Te=Gn;if(Rf=ee,(Gn=ve)&&!Te)for(Be=j;Be!==null;)ee=Be,ve=ee.child,ee.tag===22&&ee.memoizedState!==null?Gb(j):ve!==null?(ve.return=ee,Be=ve):Gb(j);for(;q!==null;)Be=q,Ub(q),q=q.sibling;Be=j,Rf=le,Gn=Te}Hb(u)}else j.subtreeFlags&8772&&q!==null?(q.return=j,Be=q):Hb(u)}}function Hb(u){for(;Be!==null;){var c=Be;if(c.flags&8772){var k=c.alternate;try{if(c.flags&8772)switch(c.tag){case 0:case 11:case 15:Gn||Mf(5,c);break;case 1:var I=c.stateNode;if(c.flags&4&&!Gn)if(k===null)I.componentDidMount();else{var j=c.elementType===c.type?k.memoizedProps:li(c.type,k.memoizedProps);I.componentDidUpdate(j,k.memoizedState,I.__reactInternalSnapshotBeforeUpdate)}var q=c.updateQueue;q!==null&&V2(c,q,I);break;case 3:var ee=c.updateQueue;if(ee!==null){if(k=null,c.child!==null)switch(c.child.tag){case 5:k=Z(c.child.stateNode);break;case 1:k=c.child.stateNode}V2(c,ee,k)}break;case 5:var le=c.stateNode;k===null&&c.flags&4&&ze(le,c.type,c.memoizedProps,c);break;case 6:break;case 4:break;case 12:break;case 13:if(ie&&c.memoizedState===null){var ve=c.alternate;if(ve!==null){var Te=ve.memoizedState;if(Te!==null){var He=Te.dehydrated;He!==null&&ri(He)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(a(163))}Gn||c.flags&512&&G0(c)}catch(nt){Gt(c,c.return,nt)}}if(c===u){Be=null;break}if(k=c.sibling,k!==null){k.return=c.return,Be=k;break}Be=c.return}}function $b(u){for(;Be!==null;){var c=Be;if(c===u){Be=null;break}var k=c.sibling;if(k!==null){k.return=c.return,Be=k;break}Be=c.return}}function Gb(u){for(;Be!==null;){var c=Be;try{switch(c.tag){case 0:case 11:case 15:var k=c.return;try{Mf(4,c)}catch(ve){Gt(c,k,ve)}break;case 1:var I=c.stateNode;if(typeof I.componentDidMount=="function"){var j=c.return;try{I.componentDidMount()}catch(ve){Gt(c,j,ve)}}var q=c.return;try{G0(c)}catch(ve){Gt(c,q,ve)}break;case 5:var ee=c.return;try{G0(c)}catch(ve){Gt(c,ee,ve)}}}catch(ve){Gt(c,c.return,ve)}if(c===u){Be=null;break}var le=c.sibling;if(le!==null){le.return=c.return,Be=le;break}Be=c.return}}var Lf=0,Nf=1,If=2,Df=3,jf=4;if(typeof Symbol=="function"&&Symbol.for){var xu=Symbol.for;Lf=xu("selector.component"),Nf=xu("selector.has_pseudo_class"),If=xu("selector.role"),Df=xu("selector.test_id"),jf=xu("selector.text")}function Y0(u){var c=oe(u);if(c!=null){if(typeof c.memoizedProps["data-testname"]!="string")throw Error(a(364));return c}if(u=be(u),u===null)throw Error(a(362));return u.stateNode.current}function K0(u,c){switch(c.$$typeof){case Lf:if(u.type===c.value)return!0;break;case Nf:e:{c=c.value,u=[u,0];for(var k=0;k<u.length;){var I=u[k++],j=u[k++],q=c[j];if(I.tag!==5||!he(I)){for(;q!=null&&K0(I,q);)j++,q=c[j];if(j===c.length){c=!0;break e}else for(I=I.child;I!==null;)u.push(I,j),I=I.sibling}}c=!1}return c;case If:if(u.tag===5&&Ee(u.stateNode,c.value))return!0;break;case jf:if((u.tag===5||u.tag===6)&&(u=fe(u),u!==null&&0<=u.indexOf(c.value)))return!0;break;case Df:if(u.tag===5&&(u=u.memoizedProps["data-testname"],typeof u=="string"&&u.toLowerCase()===c.value.toLowerCase()))return!0;break;default:throw Error(a(365))}return!1}function X0(u){switch(u.$$typeof){case Lf:return"<"+(C(u.value)||"Unknown")+">";case Nf:return":has("+(X0(u)||"")+")";case If:return'[role="'+u.value+'"]';case jf:return'"'+u.value+'"';case Df:return'[data-testname="'+u.value+'"]';default:throw Error(a(365))}}function Vb(u,c){var k=[];u=[u,0];for(var I=0;I<u.length;){var j=u[I++],q=u[I++],ee=c[q];if(j.tag!==5||!he(j)){for(;ee!=null&&K0(j,ee);)q++,ee=c[q];if(q===c.length)k.push(j);else for(j=j.child;j!==null;)u.push(j,q),j=j.sibling}}return k}function Z0(u,c){if(!we)throw Error(a(363));u=Y0(u),u=Vb(u,c),c=[],u=Array.from(u);for(var k=0;k<u.length;){var I=u[k++];if(I.tag===5)he(I)||c.push(I.stateNode);else for(I=I.child;I!==null;)u.push(I),I=I.sibling}return c}var dE=Math.ceil,Ff=l.ReactCurrentDispatcher,Q0=l.ReactCurrentOwner,an=l.ReactCurrentBatchConfig,ct=0,kn=null,cn=null,Nn=0,Or=0,Yl=Fo(0),vn=0,Pu=null,Ha=0,zf=0,J0=0,Cu=null,lr=null,e1=0,t1=1/0,uo=null;function Kl(){t1=Pn()+500}var Bf=!1,n1=null,Ho=null,Uf=!1,$o=null,Hf=0,ku=0,r1=null,$f=-1,Gf=0;function Vn(){return ct&6?Pn():$f!==-1?$f:$f=Pn()}function Go(u){return u.mode&1?ct&2&&Nn!==0?Nn&-Nn:YS.transition!==null?(Gf===0&&(Gf=T2()),Gf):(u=yt,u!==0?u:me()):1}function $r(u,c,k,I){if(50<ku)throw ku=0,r1=null,Error(a(185));du(u,k,I),(!(ct&2)||u!==kn)&&(u===kn&&(!(ct&2)&&(zf|=k),vn===4&&Vo(u,Nn)),sr(u,I),k===1&&ct===0&&!(c.mode&1)&&(Kl(),cf&&Ai()))}function sr(u,c){var k=u.callbackNode;zS(u,c);var I=sf(u,u===kn?Nn:0);if(I===0)k!==null&&R2(k),u.callbackNode=null,u.callbackPriority=0;else if(c=I&-I,u.callbackPriority!==c){if(k!=null&&R2(k),c===1)u.tag===0?WS(Wb.bind(null,u)):M2(Wb.bind(null,u)),re?ae(function(){!(ct&6)&&Ai()}):a0(l0,Ai),k=null;else{switch(A2(I)){case 1:k=l0;break;case 4:k=$S;break;case 16:k=s0;break;case 536870912:k=GS;break;default:k=s0}k=n3(k,qb.bind(null,u))}u.callbackPriority=c,u.callbackNode=k}}function qb(u,c){if($f=-1,Gf=0,ct&6)throw Error(a(327));var k=u.callbackNode;if(Va()&&u.callbackNode!==k)return null;var I=sf(u,u===kn?Nn:0);if(I===0)return null;if(I&30||I&u.expiredLanes||c)c=Vf(u,I);else{c=I;var j=ct;ct|=2;var q=Xb();(kn!==u||Nn!==c)&&(uo=null,Kl(),$a(u,c));do try{gE();break}catch(le){Kb(u,le)}while(!0);v0(),Ff.current=q,ct=j,cn!==null?c=0:(kn=null,Nn=0,c=vn)}if(c!==0){if(c===2&&(j=r0(u),j!==0&&(I=j,c=i1(u,j))),c===1)throw k=Pu,$a(u,0),Vo(u,I),sr(u,Pn()),k;if(c===6)Vo(u,I);else{if(j=u.current.alternate,!(I&30)&&!hE(j)&&(c=Vf(u,I),c===2&&(q=r0(u),q!==0&&(I=q,c=i1(u,q))),c===1))throw k=Pu,$a(u,0),Vo(u,I),sr(u,Pn()),k;switch(u.finishedWork=j,u.finishedLanes=I,c){case 0:case 1:throw Error(a(345));case 2:Ga(u,lr,uo);break;case 3:if(Vo(u,I),(I&130023424)===I&&(c=e1+500-Pn(),10<c)){if(sf(u,0)!==0)break;if(j=u.suspendedLanes,(j&I)!==I){Vn(),u.pingedLanes|=u.suspendedLanes&j;break}u.timeoutHandle=z(Ga.bind(null,u,lr,uo),c);break}Ga(u,lr,uo);break;case 4:if(Vo(u,I),(I&4194240)===I)break;for(c=u.eventTimes,j=-1;0<I;){var ee=31-ii(I);q=1<<ee,ee=c[ee],ee>j&&(j=ee),I&=~q}if(I=j,I=Pn()-I,I=(120>I?120:480>I?480:1080>I?1080:1920>I?1920:3e3>I?3e3:4320>I?4320:1960*dE(I/1960))-I,10<I){u.timeoutHandle=z(Ga.bind(null,u,lr,uo),I);break}Ga(u,lr,uo);break;case 5:Ga(u,lr,uo);break;default:throw Error(a(329))}}}return sr(u,Pn()),u.callbackNode===k?qb.bind(null,u):null}function i1(u,c){var k=Cu;return u.current.memoizedState.isDehydrated&&($a(u,c).flags|=256),u=Vf(u,c),u!==2&&(c=lr,lr=k,c!==null&&o1(c)),u}function o1(u){lr===null?lr=u:lr.push.apply(lr,u)}function hE(u){for(var c=u;;){if(c.flags&16384){var k=c.updateQueue;if(k!==null&&(k=k.stores,k!==null))for(var I=0;I<k.length;I++){var j=k[I],q=j.getSnapshot;j=j.value;try{if(!oi(q(),j))return!1}catch{return!1}}}if(k=c.child,c.subtreeFlags&16384&&k!==null)k.return=c,c=k;else{if(c===u)break;for(;c.sibling===null;){if(c.return===null||c.return===u)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Vo(u,c){for(c&=~J0,c&=~zf,u.suspendedLanes|=c,u.pingedLanes&=~c,u=u.expirationTimes;0<c;){var k=31-ii(c),I=1<<k;u[k]=-1,c&=~I}}function Wb(u){if(ct&6)throw Error(a(327));Va();var c=sf(u,0);if(!(c&1))return sr(u,Pn()),null;var k=Vf(u,c);if(u.tag!==0&&k===2){var I=r0(u);I!==0&&(c=I,k=i1(u,I))}if(k===1)throw k=Pu,$a(u,0),Vo(u,c),sr(u,Pn()),k;if(k===6)throw Error(a(345));return u.finishedWork=u.current.alternate,u.finishedLanes=c,Ga(u,lr,uo),sr(u,Pn()),null}function Yb(u){$o!==null&&$o.tag===0&&!(ct&6)&&Va();var c=ct;ct|=1;var k=an.transition,I=yt;try{if(an.transition=null,yt=1,u)return u()}finally{yt=I,an.transition=k,ct=c,!(ct&6)&&Ai()}}function a1(){Or=Yl.current,zt(Yl)}function $a(u,c){u.finishedWork=null,u.finishedLanes=0;var k=u.timeoutHandle;if(k!==X&&(u.timeoutHandle=X,K(k)),cn!==null)for(k=cn.return;k!==null;){var I=k;switch(f0(I),I.tag){case 1:I=I.type.childContextTypes,I!=null&&rf();break;case 3:Vl(),zt(ir),zt(Un),O0();break;case 5:S0(I);break;case 4:Vl();break;case 13:zt(Kt);break;case 19:zt(Kt);break;case 10:m0(I.type._context);break;case 22:case 23:a1()}k=k.return}if(kn=u,cn=u=qo(u.current,null),Nn=Or=c,vn=0,Pu=null,J0=zf=Ha=0,lr=Cu=null,Ba!==null){for(c=0;c<Ba.length;c++)if(k=Ba[c],I=k.interleaved,I!==null){k.interleaved=null;var j=I.next,q=k.pending;if(q!==null){var ee=q.next;q.next=j,I.next=ee}k.pending=I}Ba=null}return u}function Kb(u,c){do{var k=cn;try{if(v0(),wf.current=xf,Sf){for(var I=Xt.memoizedState;I!==null;){var j=I.queue;j!==null&&(j.pending=null),I=I.next}Sf=!1}if(Ua=0,Cn=gn=Xt=null,mu=!1,yu=0,Q0.current=null,k===null||k.return===null){vn=1,Pu=c,cn=null;break}e:{var q=u,ee=k.return,le=k,ve=c;if(c=Nn,le.flags|=32768,ve!==null&&typeof ve=="object"&&typeof ve.then=="function"){var Te=ve,He=le,nt=He.tag;if(!(He.mode&1)&&(nt===0||nt===11||nt===15)){var De=He.alternate;De?(He.updateQueue=De.updateQueue,He.memoizedState=De.memoizedState,He.lanes=De.lanes):(He.updateQueue=null,He.memoizedState=null)}var Bt=_b(ee);if(Bt!==null){Bt.flags&=-257,wb(Bt,ee,le,q,c),Bt.mode&1&&bb(q,Te,c),c=Bt,ve=Te;var Mt=c.updateQueue;if(Mt===null){var ur=new Set;ur.add(ve),c.updateQueue=ur}else Mt.add(ve);break e}else{if(!(c&1)){bb(q,Te,c),l1();break e}ve=Error(a(426))}}else if($t&&le.mode&1){var co=_b(ee);if(co!==null){!(co.flags&65536)&&(co.flags|=256),wb(co,ee,le,q,c),p0(ql(ve,le));break e}}q=ve=ql(ve,le),vn!==4&&(vn=2),Cu===null?Cu=[q]:Cu.push(q),q=ee;do{switch(q.tag){case 3:q.flags|=65536,c&=-c,q.lanes|=c;var pe=mb(q,ve,c);G2(q,pe);break e;case 1:le=ve;var se=q.type,ye=q.stateNode;if(!(q.flags&128)&&(typeof se.getDerivedStateFromError=="function"||ye!==null&&typeof ye.componentDidCatch=="function"&&(Ho===null||!Ho.has(ye)))){q.flags|=65536,c&=-c,q.lanes|=c;var je=yb(q,le,c);G2(q,je);break e}}q=q.return}while(q!==null)}Qb(k)}catch(Ke){c=Ke,cn===k&&k!==null&&(cn=k=k.return);continue}break}while(!0)}function Xb(){var u=Ff.current;return Ff.current=xf,u===null?xf:u}function l1(){(vn===0||vn===3||vn===2)&&(vn=4),kn===null||!(Ha&268435455)&&!(zf&268435455)||Vo(kn,Nn)}function Vf(u,c){var k=ct;ct|=2;var I=Xb();(kn!==u||Nn!==c)&&(uo=null,$a(u,c));do try{pE();break}catch(j){Kb(u,j)}while(!0);if(v0(),ct=k,Ff.current=I,cn!==null)throw Error(a(261));return kn=null,Nn=0,vn}function pE(){for(;cn!==null;)Zb(cn)}function gE(){for(;cn!==null&&!US();)Zb(cn)}function Zb(u){var c=t3(u.alternate,u,Or);u.memoizedProps=u.pendingProps,c===null?Qb(u):cn=c,Q0.current=null}function Qb(u){var c=u;do{var k=c.alternate;if(u=c.return,c.flags&32768){if(k=sE(k,c),k!==null){k.flags&=32767,cn=k;return}if(u!==null)u.flags|=32768,u.subtreeFlags=0,u.deletions=null;else{vn=6,cn=null;return}}else if(k=lE(k,c,Or),k!==null){cn=k;return}if(c=c.sibling,c!==null){cn=c;return}cn=c=u}while(c!==null);vn===0&&(vn=5)}function Ga(u,c,k){var I=yt,j=an.transition;try{an.transition=null,yt=1,vE(u,c,k,I)}finally{an.transition=j,yt=I}return null}function vE(u,c,k,I){do Va();while($o!==null);if(ct&6)throw Error(a(327));k=u.finishedWork;var j=u.finishedLanes;if(k===null)return null;if(u.finishedWork=null,u.finishedLanes=0,k===u.current)throw Error(a(177));u.callbackNode=null,u.callbackPriority=0;var q=k.lanes|k.childLanes;if(BS(u,q),u===kn&&(cn=kn=null,Nn=0),!(k.subtreeFlags&2064)&&!(k.flags&2064)||Uf||(Uf=!0,n3(s0,function(){return Va(),null})),q=(k.flags&15990)!==0,k.subtreeFlags&15990||q){q=an.transition,an.transition=null;var ee=yt;yt=1;var le=ct;ct|=4,Q0.current=null,cE(u,k),Bb(k,u),M(u.containerInfo),u.current=k,fE(k),HS(),ct=le,yt=ee,an.transition=q}else u.current=k;if(Uf&&(Uf=!1,$o=u,Hf=j),q=u.pendingLanes,q===0&&(Ho=null),VS(k.stateNode),sr(u,Pn()),c!==null)for(I=u.onRecoverableError,k=0;k<c.length;k++)j=c[k],I(j.value,{componentStack:j.stack,digest:j.digest});if(Bf)throw Bf=!1,u=n1,n1=null,u;return Hf&1&&u.tag!==0&&Va(),q=u.pendingLanes,q&1?u===r1?ku++:(ku=0,r1=u):ku=0,Ai(),null}function Va(){if($o!==null){var u=A2(Hf),c=an.transition,k=yt;try{if(an.transition=null,yt=16>u?16:u,$o===null)var I=!1;else{if(u=$o,$o=null,Hf=0,ct&6)throw Error(a(331));var j=ct;for(ct|=4,Be=u.current;Be!==null;){var q=Be,ee=q.child;if(Be.flags&16){var le=q.deletions;if(le!==null){for(var ve=0;ve<le.length;ve++){var Te=le[ve];for(Be=Te;Be!==null;){var He=Be;switch(He.tag){case 0:case 11:case 15:Ou(8,He,q)}var nt=He.child;if(nt!==null)nt.return=He,Be=nt;else for(;Be!==null;){He=Be;var De=He.sibling,Bt=He.return;if(Db(He),He===Te){Be=null;break}if(De!==null){De.return=Bt,Be=De;break}Be=Bt}}}var Mt=q.alternate;if(Mt!==null){var ur=Mt.child;if(ur!==null){Mt.child=null;do{var co=ur.sibling;ur.sibling=null,ur=co}while(ur!==null)}}Be=q}}if(q.subtreeFlags&2064&&ee!==null)ee.return=q,Be=ee;else e:for(;Be!==null;){if(q=Be,q.flags&2048)switch(q.tag){case 0:case 11:case 15:Ou(9,q,q.return)}var pe=q.sibling;if(pe!==null){pe.return=q.return,Be=pe;break e}Be=q.return}}var se=u.current;for(Be=se;Be!==null;){ee=Be;var ye=ee.child;if(ee.subtreeFlags&2064&&ye!==null)ye.return=ee,Be=ye;else e:for(ee=se;Be!==null;){if(le=Be,le.flags&2048)try{switch(le.tag){case 0:case 11:case 15:Mf(9,le)}}catch(Ke){Gt(le,le.return,Ke)}if(le===ee){Be=null;break e}var je=le.sibling;if(je!==null){je.return=le.return,Be=je;break e}Be=le.return}}if(ct=j,Ai(),Ti&&typeof Ti.onPostCommitFiberRoot=="function")try{Ti.onPostCommitFiberRoot(uf,u)}catch{}I=!0}return I}finally{yt=k,an.transition=c}}return!1}function Jb(u,c,k){c=ql(k,c),c=mb(u,c,1),u=Uo(u,c,1),c=Vn(),u!==null&&(du(u,1,c),sr(u,c))}function Gt(u,c,k){if(u.tag===3)Jb(u,u,k);else for(;c!==null;){if(c.tag===3){Jb(c,u,k);break}else if(c.tag===1){var I=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof I.componentDidCatch=="function"&&(Ho===null||!Ho.has(I))){u=ql(k,u),u=yb(c,u,1),c=Uo(c,u,1),u=Vn(),c!==null&&(du(c,1,u),sr(c,u));break}}c=c.return}}function mE(u,c,k){var I=u.pingCache;I!==null&&I.delete(c),c=Vn(),u.pingedLanes|=u.suspendedLanes&k,kn===u&&(Nn&k)===k&&(vn===4||vn===3&&(Nn&130023424)===Nn&&500>Pn()-e1?$a(u,0):J0|=k),sr(u,c)}function e3(u,c){c===0&&(u.mode&1?(c=lf,lf<<=1,!(lf&130023424)&&(lf=4194304)):c=1);var k=Vn();u=Ri(u,c),u!==null&&(du(u,c,k),sr(u,k))}function yE(u){var c=u.memoizedState,k=0;c!==null&&(k=c.retryLane),e3(u,k)}function bE(u,c){var k=0;switch(u.tag){case 13:var I=u.stateNode,j=u.memoizedState;j!==null&&(k=j.retryLane);break;case 19:I=u.stateNode;break;default:throw Error(a(314))}I!==null&&I.delete(c),e3(u,k)}var t3;t3=function(u,c,k){if(u!==null)if(u.memoizedProps!==c.pendingProps||ir.current)ar=!0;else{if(!(u.lanes&k)&&!(c.flags&128))return ar=!1,aE(u,c,k);ar=!!(u.flags&131072)}else ar=!1,$t&&c.flags&1048576&&L2(c,df,c.index);switch(c.lanes=0,c.tag){case 2:var I=c.type;kf(u,c),u=c.pendingProps;var j=jl(c,Un.current);$l(c,k),j=C0(null,c,I,u,j,k);var q=k0();return c.flags|=1,typeof j=="object"&&j!==null&&typeof j.render=="function"&&j.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,or(I)?(q=!0,of(c)):q=!1,c.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,_0(c),j.updater=Pf,c.stateNode=j,j._reactInternals=c,N0(c,I,u,k),c=F0(null,c,I,!0,q,k)):(c.tag=0,$t&&q&&c0(c),Zn(null,c,j,k),c=c.child),c;case 16:I=c.elementType;e:{switch(kf(u,c),u=c.pendingProps,j=I._init,I=j(I._payload),c.type=I,j=c.tag=wE(I),u=li(I,u),j){case 0:c=j0(null,c,I,u,k);break e;case 1:c=Cb(null,c,I,u,k);break e;case 11:c=Sb(null,c,I,u,k);break e;case 14:c=Eb(null,c,I,li(I.type,u),k);break e}throw Error(a(306,I,""))}return c;case 0:return I=c.type,j=c.pendingProps,j=c.elementType===I?j:li(I,j),j0(u,c,I,j,k);case 1:return I=c.type,j=c.pendingProps,j=c.elementType===I?j:li(I,j),Cb(u,c,I,j,k);case 3:e:{if(kb(c),u===null)throw Error(a(387));I=c.pendingProps,q=c.memoizedState,j=q.element,$2(u,c),bf(c,I,null,k);var ee=c.memoizedState;if(I=ee.element,ie&&q.isDehydrated)if(q={element:I,isDehydrated:!1,cache:ee.cache,pendingSuspenseBoundaries:ee.pendingSuspenseBoundaries,transitions:ee.transitions},c.updateQueue.baseState=q,c.memoizedState=q,c.flags&256){j=ql(Error(a(423)),c),c=Tb(u,c,I,k,j);break e}else if(I!==j){j=ql(Error(a(424)),c),c=Tb(u,c,I,k,j);break e}else for(ie&&(zr=et(c.stateNode.containerInfo),Er=c,$t=!0,ai=null,hu=!1),k=B2(c,null,I,k),c.child=k;k;)k.flags=k.flags&-3|4096,k=k.sibling;else{if(Bl(),I===j){c=so(u,c,k);break e}Zn(u,c,I,k)}c=c.child}return c;case 5:return q2(c),u===null&&h0(c),I=c.type,j=c.pendingProps,q=u!==null?u.memoizedProps:null,ee=j.children,F(I,j)?ee=null:q!==null&&F(I,q)&&(c.flags|=32),Pb(u,c),Zn(u,c,ee,k),c.child;case 6:return u===null&&h0(c),null;case 13:return Ab(u,c,k);case 4:return w0(c,c.stateNode.containerInfo),I=c.pendingProps,u===null?c.child=Ul(c,null,I,k):Zn(u,c,I,k),c.child;case 11:return I=c.type,j=c.pendingProps,j=c.elementType===I?j:li(I,j),Sb(u,c,I,j,k);case 7:return Zn(u,c,c.pendingProps,k),c.child;case 8:return Zn(u,c,c.pendingProps.children,k),c.child;case 12:return Zn(u,c,c.pendingProps.children,k),c.child;case 10:e:{if(I=c.type._context,j=c.pendingProps,q=c.memoizedProps,ee=j.value,U2(c,I,ee),q!==null)if(oi(q.value,ee)){if(q.children===j.children&&!ir.current){c=so(u,c,k);break e}}else for(q=c.child,q!==null&&(q.return=c);q!==null;){var le=q.dependencies;if(le!==null){ee=q.child;for(var ve=le.firstContext;ve!==null;){if(ve.context===I){if(q.tag===1){ve=lo(-1,k&-k),ve.tag=2;var Te=q.updateQueue;if(Te!==null){Te=Te.shared;var He=Te.pending;He===null?ve.next=ve:(ve.next=He.next,He.next=ve),Te.pending=ve}}q.lanes|=k,ve=q.alternate,ve!==null&&(ve.lanes|=k),y0(q.return,k,c),le.lanes|=k;break}ve=ve.next}}else if(q.tag===10)ee=q.type===c.type?null:q.child;else if(q.tag===18){if(ee=q.return,ee===null)throw Error(a(341));ee.lanes|=k,le=ee.alternate,le!==null&&(le.lanes|=k),y0(ee,k,c),ee=q.sibling}else ee=q.child;if(ee!==null)ee.return=q;else for(ee=q;ee!==null;){if(ee===c){ee=null;break}if(q=ee.sibling,q!==null){q.return=ee.return,ee=q;break}ee=ee.return}q=ee}Zn(u,c,j.children,k),c=c.child}return c;case 9:return j=c.type,I=c.pendingProps.children,$l(c,k),j=Br(j),I=I(j),c.flags|=1,Zn(u,c,I,k),c.child;case 14:return I=c.type,j=li(I,c.pendingProps),j=li(I.type,j),Eb(u,c,I,j,k);case 15:return Ob(u,c,c.type,c.pendingProps,k);case 17:return I=c.type,j=c.pendingProps,j=c.elementType===I?j:li(I,j),kf(u,c),c.tag=1,or(I)?(u=!0,of(c)):u=!1,$l(c,k),gb(c,I,j),N0(c,I,j,k),F0(null,c,I,!0,u,k);case 19:return Mb(u,c,k);case 22:return xb(u,c,k)}throw Error(a(156,c.tag))};function n3(u,c){return a0(u,c)}function _E(u,c,k,I){this.tag=u,this.key=k,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=I,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gr(u,c,k,I){return new _E(u,c,k,I)}function s1(u){return u=u.prototype,!(!u||!u.isReactComponent)}function wE(u){if(typeof u=="function")return s1(u)?1:0;if(u!=null){if(u=u.$$typeof,u===g)return 11;if(u===y)return 14}return 2}function qo(u,c){var k=u.alternate;return k===null?(k=Gr(u.tag,c,u.key,u.mode),k.elementType=u.elementType,k.type=u.type,k.stateNode=u.stateNode,k.alternate=u,u.alternate=k):(k.pendingProps=c,k.type=u.type,k.flags=0,k.subtreeFlags=0,k.deletions=null),k.flags=u.flags&14680064,k.childLanes=u.childLanes,k.lanes=u.lanes,k.child=u.child,k.memoizedProps=u.memoizedProps,k.memoizedState=u.memoizedState,k.updateQueue=u.updateQueue,c=u.dependencies,k.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},k.sibling=u.sibling,k.index=u.index,k.ref=u.ref,k}function qf(u,c,k,I,j,q){var ee=2;if(I=u,typeof u=="function")s1(u)&&(ee=1);else if(typeof u=="string")ee=5;else e:switch(u){case h:return qa(k.children,j,q,c);case x:ee=8,j|=8;break;case w:return u=Gr(12,k,c,j|2),u.elementType=w,u.lanes=q,u;case b:return u=Gr(13,k,c,j),u.elementType=b,u.lanes=q,u;case p:return u=Gr(19,k,c,j),u.elementType=p,u.lanes=q,u;case m:return Wf(k,j,q,c);default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case v:ee=10;break e;case O:ee=9;break e;case g:ee=11;break e;case y:ee=14;break e;case d:ee=16,I=null;break e}throw Error(a(130,u==null?u:typeof u,""))}return c=Gr(ee,k,c,j),c.elementType=u,c.type=I,c.lanes=q,c}function qa(u,c,k,I){return u=Gr(7,u,I,c),u.lanes=k,u}function Wf(u,c,k,I){return u=Gr(22,u,I,c),u.elementType=m,u.lanes=k,u.stateNode={isHidden:!1},u}function u1(u,c,k){return u=Gr(6,u,null,c),u.lanes=k,u}function c1(u,c,k){return c=Gr(4,u.children!==null?u.children:[],u.key,c),c.lanes=k,c.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},c}function SE(u,c,k,I,j){this.tag=c,this.containerInfo=u,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=X,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=i0(0),this.expirationTimes=i0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=i0(0),this.identifierPrefix=I,this.onRecoverableError=j,ie&&(this.mutableSourceEagerHydrationData=null)}function r3(u,c,k,I,j,q,ee,le,ve){return u=new SE(u,c,k,le,ve),c===1?(c=1,q===!0&&(c|=8)):c=0,q=Gr(3,null,null,c),u.current=q,q.stateNode=u,q.memoizedState={element:I,isDehydrated:k,cache:null,transitions:null,pendingSuspenseBoundaries:null},_0(q),u}function i3(u){if(!u)return zo;u=u._reactInternals;e:{if(S(u)!==u||u.tag!==1)throw Error(a(170));var c=u;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(or(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(a(171))}if(u.tag===1){var k=u.type;if(or(k))return C2(u,k,c)}return c}function o3(u){var c=u._reactInternals;if(c===void 0)throw typeof u.render=="function"?Error(a(188)):(u=Object.keys(u).join(","),Error(a(268,u)));return u=T(c),u===null?null:u.stateNode}function a3(u,c){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var k=u.retryLane;u.retryLane=k!==0&&k<c?k:c}}function Yf(u,c){a3(u,c),(u=u.alternate)&&a3(u,c)}function EE(u){return u=T(u),u===null?null:u.stateNode}function OE(){return null}return n.attemptContinuousHydration=function(u){if(u.tag===13){var c=Ri(u,134217728);if(c!==null){var k=Vn();$r(c,u,134217728,k)}Yf(u,134217728)}},n.attemptDiscreteHydration=function(u){if(u.tag===13){var c=Ri(u,1);if(c!==null){var k=Vn();$r(c,u,1,k)}Yf(u,1)}},n.attemptHydrationAtCurrentPriority=function(u){if(u.tag===13){var c=Go(u),k=Ri(u,c);if(k!==null){var I=Vn();$r(k,u,c,I)}Yf(u,c)}},n.attemptSynchronousHydration=function(u){switch(u.tag){case 3:var c=u.stateNode;if(c.current.memoizedState.isDehydrated){var k=fu(c.pendingLanes);k!==0&&(o0(c,k|1),sr(c,Pn()),!(ct&6)&&(Kl(),Ai()))}break;case 13:Yb(function(){var I=Ri(u,1);if(I!==null){var j=Vn();$r(I,u,1,j)}}),Yf(u,1)}},n.batchedUpdates=function(u,c){var k=ct;ct|=1;try{return u(c)}finally{ct=k,ct===0&&(Kl(),cf&&Ai())}},n.createComponentSelector=function(u){return{$$typeof:Lf,value:u}},n.createContainer=function(u,c,k,I,j,q,ee){return r3(u,c,!1,null,k,I,j,q,ee)},n.createHasPseudoClassSelector=function(u){return{$$typeof:Nf,value:u}},n.createHydrationContainer=function(u,c,k,I,j,q,ee,le,ve){return u=r3(k,I,!0,u,j,q,ee,le,ve),u.context=i3(null),k=u.current,I=Vn(),j=Go(k),q=lo(I,j),q.callback=c??null,Uo(k,q,j),u.current.lanes=j,du(u,j,I),sr(u,I),u},n.createPortal=function(u,c,k){var I=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:I==null?null:""+I,children:u,containerInfo:c,implementation:k}},n.createRoleSelector=function(u){return{$$typeof:If,value:u}},n.createTestNameSelector=function(u){return{$$typeof:Df,value:u}},n.createTextSelector=function(u){return{$$typeof:jf,value:u}},n.deferredUpdates=function(u){var c=yt,k=an.transition;try{return an.transition=null,yt=16,u()}finally{yt=c,an.transition=k}},n.discreteUpdates=function(u,c,k,I,j){var q=yt,ee=an.transition;try{return an.transition=null,yt=1,u(c,k,I,j)}finally{yt=q,an.transition=ee,ct===0&&Kl()}},n.findAllNodes=Z0,n.findBoundingRects=function(u,c){if(!we)throw Error(a(363));c=Z0(u,c),u=[];for(var k=0;k<c.length;k++)u.push(te(c[k]));for(c=u.length-1;0<c;c--){k=u[c];for(var I=k.x,j=I+k.width,q=k.y,ee=q+k.height,le=c-1;0<=le;le--)if(c!==le){var ve=u[le],Te=ve.x,He=Te+ve.width,nt=ve.y,De=nt+ve.height;if(I>=Te&&q>=nt&&j<=He&&ee<=De){u.splice(c,1);break}else if(I!==Te||k.width!==ve.width||De<q||nt>ee){if(!(q!==nt||k.height!==ve.height||He<I||Te>j)){Te>I&&(ve.width+=Te-I,ve.x=I),He<j&&(ve.width=j-Te),u.splice(c,1);break}}else{nt>q&&(ve.height+=nt-q,ve.y=q),De<ee&&(ve.height=ee-nt),u.splice(c,1);break}}}return u},n.findHostInstance=o3,n.findHostInstanceWithNoPortals=function(u){return u=P(u),u=u!==null?U(u):null,u===null?null:u.stateNode},n.findHostInstanceWithWarning=function(u){return o3(u)},n.flushControlled=function(u){var c=ct;ct|=1;var k=an.transition,I=yt;try{an.transition=null,yt=1,u()}finally{yt=I,an.transition=k,ct=c,ct===0&&(Kl(),Ai())}},n.flushPassiveEffects=Va,n.flushSync=Yb,n.focusWithin=function(u,c){if(!we)throw Error(a(363));for(u=Y0(u),c=Vb(u,c),c=Array.from(c),u=0;u<c.length;){var k=c[u++];if(!he(k)){if(k.tag===5&&Ve(k.stateNode))return!0;for(k=k.child;k!==null;)c.push(k),k=k.sibling}}return!1},n.getCurrentUpdatePriority=function(){return yt},n.getFindAllNodesFailureDescription=function(u,c){if(!we)throw Error(a(363));var k=0,I=[];u=[Y0(u),0];for(var j=0;j<u.length;){var q=u[j++],ee=u[j++],le=c[ee];if((q.tag!==5||!he(q))&&(K0(q,le)&&(I.push(X0(le)),ee++,ee>k&&(k=ee)),ee<c.length))for(q=q.child;q!==null;)u.push(q,ee),q=q.sibling}if(k<c.length){for(u=[];k<c.length;k++)u.push(X0(c[k]));return`findAllNodes was able to match part of the selector:
|
|
58
58
|
`+(I.join(" > ")+`
|
|
59
59
|
|
|
60
60
|
No matching component was found for:
|
|
@@ -98,14 +98,14 @@ For more info see: https://github.com/konvajs/react-konva/issues/194
|
|
|
98
98
|
opacity: 0.6;
|
|
99
99
|
}
|
|
100
100
|
`;m.innerHTML="",m.appendChild(document.createTextNode(ie)),JSON.stringify(ne)!==JSON.stringify(F)&&$(ne)});const K=n.default.useRef(null);n.default.useLayoutEffect(()=>{var ne;const ie=K.current;if(!ie)return;(ne=K.current)===null||ne===void 0||ne.focus();const oe=Y||ie.value.length;ie.selectionStart=ie.selectionEnd=oe,V&&(ie==null||ie.select(),document.execCommand("selectAll",!1,null))},[]),n.default.useEffect(()=>{window.addEventListener("blur",B);const ne=ie=>{var oe;!((oe=K.current)===null||oe===void 0)&&oe.contains(ie.target)||B()};return window.addEventListener("touchstart",ne),()=>{window.removeEventListener("blur",B),window.removeEventListener("touchstart",ne)}},[]);let X=0;const Q=z.textArr.length*z.lineHeight()*z.fontSize();D.verticalAlign==="middle"&&(X=(D.a.height-Q)/2),D.verticalAlign==="bottom"&&(X=D.a.height-Q);const J=(0,v.removeTags)(D.text);return n.default.createElement("textarea",{className:"polotno-input",ref:K,dir:R(J),style:Object.assign(Object.assign(Object.assign({},_),F),{paddingTop:X+"px"}),value:J,onChange:ne=>{const ie=(0,d.getLimitedFontSize)({oldText:D.text,newText:ne.target.value,element:D});D.set({text:ne.target.value,fontSize:ie})},placeholder:D.placeholder,onBlur:B})}),E=M=>n.default.createElement(o.Html,null,n.default.createElement(S,Object.assign({},M))),P=M=>{const[D,B]=n.default.useState(!1),V=n.default.useRef(!1);return n.default.useEffect(()=>{var Y=!0;return setTimeout(()=>{Y&&(M._editModeEnabled&&(V.current=!0),B(!0),setTimeout(()=>{V.current=!1},50))},50),()=>{Y=!1}},[]),{editorEnabled:D&&M._editModeEnabled,selectAll:V.current}},T=(M,D)=>{const[B,V]=n.default.useReducer(F=>F+1,0),Y=n.default.useRef((0,x.isFontLoaded)(D));return n.default.useLayoutEffect(()=>{if(Y.current=(0,x.isFontLoaded)(D),Y.current)return;let F=!0;return(async()=>{Y.current=!1,V();const $=(0,h.incrementLoader)(`text ${D}`);await M.loadFont(D),setTimeout($,100),F&&(Y.current=!0,V())})(),()=>{F=!1}},[D]),[Y.current]};t.useFontLoader=T;const N=({fontLoaded:M,fontFamily:D,fontSize:B,lineHeight:V})=>n.default.useMemo(()=>{if(typeof V=="number")return V;const Y=document.createElement("div");Y.style.fontFamily=D,Y.style.fontSize=B+"px",Y.style.lineHeight=V,Y.innerText="Test text",document.body.appendChild(Y);const F=Y.offsetHeight;return document.body.removeChild(Y),F/B},[M,D,B,V]);function U(M){var D=M.getAbsoluteTransform().copy();D.invert();var B=M.getStage().getPointerPosition();return D.point(B)}function G(M){var D;const B=M.target,V=U(B),Y=B.textArr,F=Math.floor(V.y/(B.fontSize()*B.lineHeight())),$=Y.slice(0,F).reduce((X,Q)=>X+Q.text.length,F),z=(D=Y[F])!==null&&D!==void 0?D:Y[0];let K=0;return B.align()==="right"?K=B.width()-z.width:B.align()==="center"&&(K=B.width()/2-z.width/2),$+Math.round((V.x-K)/z.width*z.text.length)}function Z(M){const D=n.default.useRef(M),B=n.default.useRef(M);return n.default.useMemo(()=>{B.current=D.current,D.current=M},[M]),B.current}function W(M){return/[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF\uAC00-\uD7AF]/.test(M)}function H(M,D,B=!1){const V=M.fontSize(),Y=M.height(),F=(0,v.removeTags)(D.text);let $=D.a.fontSize;M.height(void 0);const z=Math.round(2*D.a.fontSize)-1;for(let K=1;K<z;K++){const X=D.a.height&&M.height()>D.a.height;let Q=F.split(`
|
|
101
|
-
`).join(" ").split(/[\s-]+/).reduce((ie,oe)=>W(oe)?ie.concat(oe.split("")):ie.concat(oe),[]),J=M.textArr.map(ie=>ie.text).join(";");const ne=Q.find(ie=>!J.includes(ie)||(J=J.replace(ie,""),!1));if(!(X||ne&&!B))break;$-=.5,M.fontSize($)}return M.fontSize(V),M.height(Y),$}function L({lines:M,lineHeight:D,width:B,align:V="left",padding:Y=0,cornerRadius:F=0}){var $;M.forEach((Q,J)=>{Q.cx=B/2,V==="right"?Q.cx=B-Q.width/2:V==="left"&&(Q.cx=Q.width/2),V!=="justify"||Q.lastInParagraph||(Q.width=B),V==="justify"&&(Q.cx=Q.width/2)});let z=`M ${($=M[0])===null||$===void 0?void 0:$.cx} ${-Y}`;M.forEach((Q,J)=>{const{cx:ne}=Q,ie=M[J-1];ie&&ie.width>Q.width?z+=` L ${ne+Q.width/2+Y} ${J*D+Y}`:z+=` L ${ne+Q.width/2+Y} ${J*D-Y}`;const oe=M[J+1];oe&&oe.width>Q.width?z+=` L ${ne+Q.width/2+Y} ${(J+1)*D-Y}`:z+=` L ${ne+Q.width/2+Y} ${(J+1)*D+Y}`});for(var K=M.length-1;K>=0;K--){const Q=M[K],{cx:J}=Q,ne=M[K+1];ne&&ne.width>Q.width?z+=` L ${J-Q.width/2-Y} ${(K+1)*D-Y}`:z+=` L ${J-Q.width/2-Y} ${(K+1)*D+Y}`;const ie=M[K-1];ie&&ie.width>Q.width?z+=` L ${J-Q.width/2-Y} ${K*D+Y}`:z+=` L ${J-Q.width/2-Y} ${K*D-Y}`}z+=" Z";const X=(0,s.parsePath)(z);return(0,s.roundCommands)(X,F).path}t.getLineHeight=N,t.TextElement=(0,r.observer)(({element:M,store:D})=>{const B=n.default.useRef(null),V=n.default.useRef(null),{editorEnabled:Y,selectAll:F}=P(M),[$,z]=n.default.useState(!1),[K,X]=n.default.useState(!1),Q=n.default.useRef(M.a.height),J=D.selectedShapes.indexOf(M)>=0,{textVerticalResizeEnabled:ne}=w.flags,ie=Z(M.fontFamily),[oe,
|
|
101
|
+
`).join(" ").split(/[\s-]+/).reduce((ie,oe)=>W(oe)?ie.concat(oe.split("")):ie.concat(oe),[]),J=M.textArr.map(ie=>ie.text).join(";");const ne=Q.find(ie=>!J.includes(ie)||(J=J.replace(ie,""),!1));if(!(X||ne&&!B))break;$-=.5,M.fontSize($)}return M.fontSize(V),M.height(Y),$}function L({lines:M,lineHeight:D,width:B,align:V="left",padding:Y=0,cornerRadius:F=0}){var $;M.forEach((Q,J)=>{Q.cx=B/2,V==="right"?Q.cx=B-Q.width/2:V==="left"&&(Q.cx=Q.width/2),V!=="justify"||Q.lastInParagraph||(Q.width=B),V==="justify"&&(Q.cx=Q.width/2)});let z=`M ${($=M[0])===null||$===void 0?void 0:$.cx} ${-Y}`;M.forEach((Q,J)=>{const{cx:ne}=Q,ie=M[J-1];ie&&ie.width>Q.width?z+=` L ${ne+Q.width/2+Y} ${J*D+Y}`:z+=` L ${ne+Q.width/2+Y} ${J*D-Y}`;const oe=M[J+1];oe&&oe.width>Q.width?z+=` L ${ne+Q.width/2+Y} ${(J+1)*D-Y}`:z+=` L ${ne+Q.width/2+Y} ${(J+1)*D+Y}`});for(var K=M.length-1;K>=0;K--){const Q=M[K],{cx:J}=Q,ne=M[K+1];ne&&ne.width>Q.width?z+=` L ${J-Q.width/2-Y} ${(K+1)*D-Y}`:z+=` L ${J-Q.width/2-Y} ${(K+1)*D+Y}`;const ie=M[K-1];ie&&ie.width>Q.width?z+=` L ${J-Q.width/2-Y} ${K*D+Y}`:z+=` L ${J-Q.width/2-Y} ${K*D-Y}`}z+=" Z";const X=(0,s.parsePath)(z);return(0,s.roundCommands)(X,F).path}t.getLineHeight=N,t.TextElement=(0,r.observer)(({element:M,store:D})=>{const B=n.default.useRef(null),V=n.default.useRef(null),{editorEnabled:Y,selectAll:F}=P(M),[$,z]=n.default.useState(!1),[K,X]=n.default.useState(!1),Q=n.default.useRef(M.a.height),J=D.selectedShapes.indexOf(M)>=0,{textVerticalResizeEnabled:ne}=w.flags,ie=Z(M.fontFamily),[oe,de]=n.default.useState([]);n.default.useEffect(()=>{var Ce,Me;const ze=(Me=(Ce=B.current)===null||Ce===void 0?void 0:Ce.textArr)!==null&&Me!==void 0?Me:[];JSON.stringify(ze)!==JSON.stringify(oe)&&de(ze)}),n.default.useEffect(()=>{if(M.a.width)return;const Ce=B.current;Ce.width(600),M.set({width:1.4*Ce.getTextWidth()})},[]),n.default.useLayoutEffect(()=>(0,a.autorun)(()=>{const Ce=B.current;(0,O.applyFilter)(Ce,M)}));const[me]=(0,t.useFontLoader)(D,M.fontFamily),Pe=(0,v.removeTags)(M.text),re=()=>{const Ce=B.current.clone({height:void 0}),Me=Math.ceil(Ce.fontSize()*Ce.lineHeight()*Ce.textArr.length+1);return Ce.destroy(),Me};n.default.useLayoutEffect(()=>{if(!me)return;const{textOverflow:Ce,textSplitAllowed:Me}=w.flags;if(M.a.height){if(!D.isPlaying)if(Ce!=="change-font-size"||K){if(Ce==="resize"){const ze=re();ne&&M.a.height<ze&&D.history.ignore(()=>{var We;(0,y.isAlive)(M)&&M.set({height:ze}),(We=B.current)===null||We===void 0||We.height(ze)},!1,!0),ne||M.a.height===ze||D.history.ignore(()=>{var We;(0,y.isAlive)(M)&&M.set({height:ze}),(We=B.current)===null||We===void 0||We.height(ze)},!1,!0)}}else{const ze=H(B.current,M,Me);if(ze!==M.a.fontSize)return void D.history.ignore(()=>{M.set({fontSize:ze})},!1,!0);const We=re();M.a.height===We||ne||D.history.ignore(()=>{M.set({height:We})},!1,!0)}}else{const ze=re();D.history.ignore(()=>{M.set({height:ze})},!1,!0)}}),n.default.useLayoutEffect(()=>{const Ce=B.current;Ce&&(Ce.width(Ce.width()+1e-8),Ce._setTextData(),(0,O.applyFilter)(Ce,M))},[me]);const ae=n.default.useRef(null),we=n.default.useRef(0),be=Ce=>{Ce.evt.preventDefault(),D.selectedShapes.find(ze=>ze===M)&&M.contentEditable&&(we.current=G(Ce),M.toggleEditMode())},te=!Pe&&M.placeholder?.6:M.a.opacity;(0,g.useFadeIn)(B,te);const fe=(0,t.getLineHeight)({fontLoaded:me,fontFamily:M.fontFamily,fontSize:M.a.fontSize,lineHeight:M.lineHeight}),he=M.selectable||D.role==="admin",Ee=(0,f.useColor)(M),Ve=n.default.useMemo(()=>M.backgroundEnabled?L({lines:JSON.parse(JSON.stringify(oe)),cornerRadius:M.backgroundCornerRadius*(M.a.fontSize*fe*.5),lineHeight:fe*M.a.fontSize,padding:M.backgroundPadding*(M.a.fontSize*fe*.5),width:M.a.width,align:M.align}):"",[M.backgroundEnabled,M.backgroundCornerRadius,M.a.fontSize,fe,M.backgroundPadding,M.a.width,M.align,oe]),Je=(0,p.isTouchDevice)();let Ae=0;return M.verticalAlign==="middle"?Ae=(M.a.height-oe.length*fe*M.a.fontSize)/2:M.verticalAlign==="bottom"&&(Ae=M.a.height-oe.length*fe*M.a.fontSize),n.default.createElement(n.default.Fragment,null,n.default.createElement(i.Path,{ref:V,x:M.a.x,y:M.a.y,rotation:M.a.rotation,hideInExport:!M.showInExport,listening:!1,visible:M.backgroundEnabled,opacity:M.backgroundOpacity*te,data:Ve,fill:M.backgroundColor,offsetY:-Ae}),n.default.createElement(i.Text,Object.assign({ref:B,id:M.id,name:"element",hideInExport:!M.showInExport,editModeEnabled:M._editModeEnabled,x:M.a.x,y:M.a.y,rotation:M.a.rotation,width:M.a.width,height:M.a.height,text:Pe||M.placeholder,direction:R(Pe)},Ee,{stroke:M.stroke,lineJoin:"round",strokeWidth:M.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:M.a.fontSize,fontFamily:`"${M.fontFamily}", "${ie}"`,fontStyle:M.fontStyle+" "+M.fontWeight,textDecoration:M.textDecoration,align:M.align,verticalAlign:M.verticalAlign,draggable:Je?M.draggable&&J:M.draggable,preventDefault:!Je||J,opacity:te,visible:!M._editModeEnabled,ellipsis:w.flags.textOverflow==="ellipsis",shadowEnabled:M.shadowEnabled,shadowBlur:M.shadowBlur,shadowOffsetX:M.shadowOffsetX,shadowOffsetY:M.shadowOffsetY,shadowColor:M.shadowColor,shadowOpacity:M.shadowOpacity,lineHeight:fe,letterSpacing:M.letterSpacing*M.a.fontSize,listening:he,onDragMove:Ce=>{M.set({x:Ce.target.x(),y:Ce.target.y()})},onDragEnd:Ce=>{M.set({x:Ce.target.x(),y:Ce.target.y()})},onMouseEnter:()=>{z(!0)},onMouseLeave:()=>{z(!1)},onClick:be,onTap:be,onTransformStart:()=>{X(!0),Q.current=B.current.height()},onTransform:Ce=>{var Me,ze;const We=Ce.target;(Me=V.current)===null||Me===void 0||Me.setAttrs({x:We.x(),y:We.y(),rotation:We.rotation(),scale:We.scale()});const St=((ze=We.getStage())===null||ze===void 0?void 0:ze.findOne("Transformer")).getActiveAnchor();if(St==="middle-left"||St==="middle-right"){const mt=We.scaleX(),ue=We.width()*mt,ce=M.a.fontSize;let Se=ue;ue<ce&&(Se=ce,ae.current&&We.position(ae.current)),We.width(Se),We.scaleX(1),We.scaleY(1);const Le=re();if(w.flags.textOverflow!=="ellipsis"){const Ne=Math.max(Le,Q.current);We.height(Ne),M.set({height:We.height()})}M.set({x:We.x(),y:We.y(),width:We.width(),rotation:We.rotation()}),(0,O.applyFilter)(We,M)}if(St==="top-center"||St==="bottom-center"){let mt=w.flags.textOverflow==="resize"?re():fe*M.a.fontSize;Ce.target.height(Math.max(mt,Ce.target.height()*Ce.target.scaleY())),Ce.target.scaleY(1)}ae.current=Ce.target.position()},onTransformEnd:Ce=>{var Me;const ze=Ce.target.scaleX();Ce.target.scaleX(1),Ce.target.scaleY(1),M.set({fontSize:Math.round(M.a.fontSize*ze),width:Math.ceil(Ce.target.width()*ze),x:Ce.target.x(),y:Ce.target.y(),rotation:Ce.target.rotation(),height:Ce.target.height()*ze,shadowBlur:M.shadowBlur*ze,shadowOffsetX:M.shadowOffsetX*ze,shadowOffsetY:M.shadowOffsetY*ze,strokeWidth:M.strokeWidth*ze}),(Me=V.current)===null||Me===void 0||Me.setAttrs({scaleX:1,scaleY:1}),X(!1)}})),Y&&n.default.createElement(i.Group,{x:M.a.x,y:M.a.y,rotation:M.a.rotation},n.default.createElement(E,{textNodeRef:B,element:M,selectAll:F,cursorPosition:we.current,onBlur:()=>{M.toggleEditMode(!1)}})),!K&&($||J)&&n.default.createElement(b.Highlighter,{element:M}))})})(Zy);var d2={},au={},J7={exports:{}},eS={exports:{}};(function(t,e){t.exports=n;function n(i){return r.bind(null,i)}function r(i){var o=[].slice.call(arguments,1);o.unshift("["+i+"]"),process.stderr.write(o.join(" ")+`
|
|
102
102
|
`)}})(eS);var h2=eS.exports;(function(t,e){h2("lex"),t.exports=n;function n(r){var i="",o,a=0,l=-1,s=0,f=1,h="before-selector",x=[h],w={},v=[],O=["media","keyframes",{name:"-webkit-keyframes",type:"keyframes",prefix:"-webkit-"},{name:"-moz-keyframes",type:"keyframes",prefix:"-moz-"},{name:"-ms-keyframes",type:"keyframes",prefix:"-ms-"},{name:"-o-keyframes",type:"keyframes",prefix:"-o-"},"font-face",{name:"import",state:"before-at-value"},{name:"charset",state:"before-at-value"},"supports","viewport",{name:"namespace",state:"before-at-value"},"document",{name:"-moz-document",type:"document",prefix:"-moz-"},"page"];function g(){return R(),r[l]}function b(W){return W?x[x.length-1-W]:h}function p(W){var H=l+1;return W===r.slice(H,H+W.length)}function y(W){var H=r.slice(l).indexOf(W);return H>0?H:!1}function d(W){return W===m(1)}function m(W){return r[l+(W||1)]}function _(){var W=x.pop();return h=x[x.length-1],W}function A(W){return h=W,x.push(h),x.length}function C(W){var H=h;return x[x.length-1]=h=W,H}function R(W){if((W||1)==1)r[l]==`
|
|
103
103
|
`?(f++,a=1):a++,l++;else{var H=r.slice(l,l+W).split(`
|
|
104
104
|
`);H.length>1&&(f+=H.length-1,a=1),a+=H[H.length-1].length,l=l+W}}function S(){w.end={line:f,col:a},v.push(w),i="",w={}}function E(W){w={type:W,start:{line:f,col:a}}}for(;o=g();)switch(o){case" ":switch(b()){case"selector":case"value":case"value-paren":case"at-group":case"at-value":case"comment":case"double-string":case"single-string":i+=o;break}break;case`
|
|
105
105
|
`:case" ":case"\r":case"\f":switch(b()){case"value":case"value-paren":case"at-group":case"comment":case"single-string":case"double-string":case"selector":i+=o;break;case"at-value":o===`
|
|
106
106
|
`&&(w.value=i.trim(),S(),_());break}break;case":":switch(b()){case"name":w.name=i.trim(),i="",C("before-value");break;case"before-selector":i+=o,E("selector"),A("selector");break;case"before-value":C("value"),i+=o;break;default:i+=o;break}break;case";":switch(b()){case"name":case"before-value":case"value":i.trim().length>0&&(w.value=i.trim(),S()),C("before-name");break;case"value-paren":i+=o;break;case"at-value":w.value=i.trim(),S(),_();break;case"before-name":break;default:i+=o;break}break;case"{":switch(b()){case"selector":if(m(-1)==="\\"){i+=o;break}w.text=i.trim(),S(),C("before-name"),s=s+1;break;case"at-group":switch(w.name=i.trim(),w.type){case"font-face":case"viewport":case"page":A("before-name");break;default:A("before-selector")}S(),s=s+1;break;case"name":case"at-rule":w.name=i.trim(),S(),A("before-name"),s=s+1;break;case"comment":case"double-string":case"single-string":i+=o;break;case"before-value":C("value"),i+=o;break}break;case"}":switch(b()){case"before-name":case"name":case"before-value":case"value":i&&(w.value=i.trim()),w.name&&w.value&&S(),E("end"),S(),_(),b()==="at-group"&&(E("at-group-end"),S(),_()),s>0&&(s=s-1);break;case"at-group":case"before-selector":case"selector":if(m(-1)==="\\"){i+=o;break}s>0&&b(1)==="at-group"&&(E("at-group-end"),S()),s>1&&_(),s>0&&(s=s-1);break;case"double-string":case"single-string":case"comment":i+=o;break}break;case'"':case"'":switch(b()){case"double-string":o==='"'&&m(-1)!=="\\"&&_();break;case"single-string":o==="'"&&m(-1)!=="\\"&&_();break;case"before-at-value":C("at-value"),A(o==='"'?"double-string":"single-string");break;case"before-value":C("value"),A(o==='"'?"double-string":"single-string");break;case"comment":break;default:m(-1)!=="\\"&&A(o==='"'?"double-string":"single-string")}i+=o;break;case"/":switch(b()){case"comment":case"double-string":case"single-string":i+=o;break;case"before-value":case"selector":case"name":case"value":if(d("*")){var P=y("*/");P&&R(P+1)}else b()=="before-value"&&C("value"),i+=o;break;default:d("*")?(E("comment"),A("comment"),R()):i+=o;break}break;case"*":switch(b()){case"comment":d("/")?(w.text=i,R(),S(),_()):i+=o;break;case"before-selector":i+=o,E("selector"),A("selector");break;case"before-value":C("value"),i+=o;break;default:i+=o}break;case"@":switch(b()){case"comment":case"double-string":case"single-string":i+=o;break;case"before-value":C("value"),i+=o;break;default:for(var T=!1,N,U,G=0,Z=O.length;!T&&G<Z;++G)U=O[G],N=U.name||U,p(N)&&(T=!0,E(N),A(U.state||"at-group"),R(N.length),U.prefix&&(w.prefix=U.prefix),U.type&&(w.type=U.type));T||(i+=o);break}break;case"(":switch(b()){case"value":A("value-paren");break;case"before-value":C("value");break}i+=o;break;case")":switch(b()){case"value-paren":_();break;case"before-value":C("value");break}i+=o;break;default:switch(b()){case"before-selector":E("selector"),A("selector");break;case"before-name":E("property"),C("name");break;case"before-value":C("value");break;case"before-at-value":C("at-value");break}i+=o;break}return v}})(J7);var tS=J7.exports,nS={exports:{}};(function(t,e){h2("parse");var n=tS;t.exports=l;var r,i,o,a;function l(_,A){A||(A={}),r=!!A.comments,o=!!A.position,i=0,a=Array.isArray(_)?_.slice():n(_);for(var C,R=[],S;S=f();)C=p(S),C&&R.push(C);return{type:"stylesheet",stylesheet:{rules:R}}}function s(_,A){A||(A={});for(var C,R=["type","name","value"],S={},E=0;E<R.length;++E)C=R[E],_[C]&&(S[C]=A[C]||_[C]);for(R=Object.keys(A),E=0;E<R.length;++E)C=R[E],S[C]||(S[C]=A[C]);return o&&(S.position={start:_.start,end:_.end}),S}function f(){var _=a.shift();return _}function h(_){i=i+1;var A={};switch(_.type){case"font-face":case"viewport":A.declarations=d();break;case"page":A.prefix=_.prefix,A.declarations=d();break;default:A.prefix=_.prefix,A.rules=m()}return s(_,A)}function x(_){return s(_)}function w(_){return s(_)}function v(_){return s(_,{text:_.text})}function O(_){return s(_)}function g(_){return s(_)}function b(_){function A(C){return C.trim()}return s(_,{type:"rule",selectors:_.text.split(",").map(A),declarations:d()})}function p(_){switch(_.type){case"property":return g(_);case"selector":return b(_);case"at-group-end":i=i-1;return;case"media":case"keyframes":return h(_);case"comment":if(r)return v(_);break;case"charset":return w(_);case"import":return x(_);case"namespace":return O(_);case"font-face":case"supports":case"viewport":case"document":case"page":return h(_)}}function y(_){for(var A,C=[],R;(R=f())&&_&&_(R);)A=p(R),A&&C.push(A);return R&&R.type!=="end"&&a.unshift(R),C}function d(){return y(function(_){return _.type==="property"||_.type==="comment"})}function m(){return y(function(){return i})}})(nS);var PD=nS.exports,rS={exports:{}};(function(t,e){h2("stringify");var n,r,i,o,a,l;t.exports=s;function s(m,_){_||(_={}),i=_.indentation||"",r=!!_.compress,n=!!_.comments,o=1,r?a=l="":(a=`
|
|
107
107
|
`,l=" ");var A=O(m.stylesheet.rules,y).join(`
|
|
108
|
-
`).trim();return A}function f(m){if(m){o+=m;return}return r?"":Array(o).join(i||"")}function h(m){return"@"+m.type+" "+m.value+";"+a}function x(m){var _="",A=m.prefix||"";m.name&&(_=" "+m.name);var C=m.type!=="page";return"@"+A+m.type+_+l+g(m,C)+a}function w(m){return n?"/*"+(m.text||"")+"*/"+a:""}function v(m){var _;return m.selectors?_=m.selectors.join(","+a):(_="@"+m.type,_+=m.name?" "+m.name:""),f()+_+l+g(m)+a}function O(m,_){return m.reduce(function(A,C){var R=C.type==="comment"?w(C):_(C);return R&&A.push(R),A},[])}function g(m,_){var A=m.declarations,C=p;return m.rules&&(A=m.rules,C=v),A=b(A,C),A&&(A=a+A+(_?"":a)),"{"+A+f()+"}"}function b(m,_){if(!m)return"";f(1);var A=O(m,_);return f(-1),A.length?A.join(a):""}function p(m){if(m.type==="property")return d(m)}function y(m){switch(m.type){case"rule":return v(m);case"media":case"keyframes":return x(m);case"comment":return w(m);case"import":case"charset":case"namespace":return h(m);case"font-face":case"supports":case"viewport":case"document":case"page":return x(m)}}function d(m){var _=m.name?m.name+":"+l:"";return f()+_+m.value+";"}})(rS);var CD=rS.exports,kD={lex:tS,parse:PD,stringify:CD};(function(t){var e=_e&&_e.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(t,"__esModule",{value:!0}),t.useSvgColors=t.sameColors=void 0,t.urlToBase64=x,t.urlToString=w,t.getColors=v,t.svgToURL=O,t.getSvgSize=g,t.fixSize=b,t.replaceColors=d;const n=e(ki),r=e(Qe),i=Qy,o=e(kD);function a(_){for(;_.parentNode;){if(_.nodeName==="defs")return!0;_=_.parentNode}return!1}function l(_){const A={};return _.querySelectorAll("style").forEach(C=>{const R=o.default.parse(C.textContent).stylesheet.rules;for(let S of R)S.selectors&&S.selectors.forEach(E=>{const P=A[E]||{};S.declarations.forEach(T=>{P[T.name]=T.value}),A[E]=P})}),A}function s(_,A){var C;const R={fill:"",stroke:""},S=((C=_.getAttribute("class"))===null||C===void 0?void 0:C.split(" "))||[],E=_.getAttribute("id");let P={};if(E&&A[`#${E}`]?P=A[`#${E}`]:S.forEach(T=>{A[`.${T}`]&&(P=Object.assign(Object.assign({},P),A[`.${T}`]))}),A[_.nodeName]&&(P=Object.assign(Object.assign({},P),A[_.nodeName])),_.getAttribute("fill")&&_.getAttribute("fill")!=="none"?R.fill=_.getAttribute("fill"):P.fill&&P.fill!=="none"&&(R.fill=P.fill),_.getAttribute("stroke")&&_.getAttribute("stroke")!=="none"?R.stroke=_.getAttribute("stroke"):P.stroke&&P.stroke!=="none"&&(R.stroke=P.stroke),!R.fill&&_.style.fill&&_.style.fill!=="none"&&(R.fill=_.style.fill),!R.stroke&&_.style.stroke&&_.style.stroke!=="none"&&(R.stroke=_.style.stroke),!R.stroke&&!R.fill){const T=_.ownerSVGElement,N=T&&T!==_&&s(T,A);(N==null?void 0:N.fill)==="currentColor"||(N==null?void 0:N.stroke)==="currentColor"||(R.fill="black")}return R}const f=["path","rect","circle","line","polygon","polyline","ellipse","text"];function h(_){for(var A=[],C=_.getElementsByTagName("*"),R=0,S=C.length;R<S;R++){const E=C[R];a(E)||(E.getAttribute("fill")!==null&&A.push(E),(E.getAttribute("stroke")!==null||E.style&&E.style.fill||f.indexOf(E.nodeName)>=0)&&A.push(E))}return A}async function x(_){const A=await fetch(_);return O(await A.text())}async function w(_){return await(await fetch(_,{mode:"cors"})).text()}function v(_){var A=new DOMParser().parseFromString(_,"image/svg+xml");const C=l(A),R=h(A),S=[];return R.forEach(E=>{const{fill:P,stroke:T}=s(E,C);[P,T].forEach(N=>{N&&(N==="currentColor"&&(N="black"),n.default.Util.colorToRGBA(N)&&S.indexOf(N)===-1&&S.push(N))})}),S}function O(_){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(_)))}async function g(_){const A=await w(_),C=new DOMParser().parseFromString(A,"image/svg+xml").documentElement.getAttribute("viewBox"),[R,S,E,P]=(C==null?void 0:C.split(" "))||[];return{width:parseFloat(E),height:parseFloat(P)}}function b(_){var A=new DOMParser().parseFromString(_,"image/svg+xml");const C=A.documentElement.getAttribute("viewBox"),[R,S,E,P]=(C==null?void 0:C.split(" "))||[],T=A.documentElement.getAttribute("width");!T&&A.documentElement.setAttribute("width",E+"px");const N=A.documentElement.getAttribute("height");if((!N||N.indexOf("%")>=0)&&A.documentElement.setAttribute("height",P+"px"),T&&T.indexOf("%")>=0&&N&&N.indexOf("%")===-1){const U=parseFloat(N)/parseFloat(P);A.documentElement.setAttribute("width",U*parseFloat(E)+"px")}if(N&&N.indexOf("%")>=0&&T&&T.indexOf("%")===-1){const U=parseFloat(T)/parseFloat(E);A.documentElement.setAttribute("height",U*parseFloat(P)+"px")}return T==="100%"&&N==="100%"&&(A.documentElement.setAttribute("width",E+"px"),A.documentElement.setAttribute("height",P+"px")),new XMLSerializer().serializeToString(A)}const p=(_,A)=>{if(!_||!A)return!1;if(A==="currentColor"&&_==="black")return!0;const C=n.default.Util.colorToRGBA(_),R=n.default.Util.colorToRGBA(A);return C&&R?C.r===R.r&&C.g===R.g&&C.b===R.b&&C.a===R.a:void 0};function y(_,A,C,R){var S=_.namespaceURI,E=document.createElementNS(S,"linearGradient");const P=n.default.Util.degToRad(C+90),T=(Math.cos(P)+1)/2,N=(Math.sin(P)+1)/2,U=(Math.cos(P+Math.PI)+1)/2,G=(Math.sin(P+Math.PI)+1)/2;E.setAttribute("x1",100*T+"%"),E.setAttribute("y1",100*N+"%"),E.setAttribute("x2",100*U+"%"),E.setAttribute("y2",100*G+"%"),E.setAttribute("gradientUnits","userSpaceOnUse"),E.setAttribute("id",A);for(var Z=0;Z<R.length;Z++){var W=R[Z],H=document.createElementNS(S,"stop");for(var L in W)W.hasOwnProperty(L)&&H.setAttribute(L,W[L]);E.appendChild(H)}return(_.querySelector("defs")||_.insertBefore(document.createElementNS(S,"defs"),_.firstChild)).appendChild(E)}function d(_,A){var C=new DOMParser().parseFromString(_,"image/svg+xml");const R=h(C),S=Array.from(A.keys()),E=l(C);return R.forEach(P=>{const{fill:T,stroke:N}=s(P,E);[{prop:"fill",color:T},{prop:"stroke",color:N}].forEach(({prop:U,color:G})=>{const Z=S.find(W=>(0,t.sameColors)(W,G));if(Z){const W=A.get(Z);if((0,i.isGradient)(W)){const{rotation:H,stops:L}=(0,i.parseColor)(W),M=L.map(B=>({offset:100*B.offset+"%","stop-color":B.color})),D="color"+Math.round(1e8*Math.random());y(C.children[0],D,H,M),P.style[U]=null,P.setAttribute(U,`url('#${D}')`)}else P.style[U]=A.get(Z)}})}),O(new XMLSerializer().serializeToString(C))}t.sameColors=p;const m=_=>{const[A,C]=r.default.useState([]);return r.default.useEffect(()=>{let R=!1;return(async()=>{C([]);const S=v(await w(_));R||C(S)})(),()=>{R=!0}},[_]),A};t.useSvgColors=m})(au);var p2={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.trySetCanvasSize=void 0;const e=(n,r,i)=>{let o=r,a=i,l=1;for(;o>0&&a>0;){n.width=o,n.height=a;const s=n.getContext("2d");if(!s)return;if(s.fillStyle="rgba(0,0,0,0.1)",s.fillRect(0,0,1,1),s.getImageData(0,0,1,1).data[3]!==0)return void s.clearRect(0,0,n.width,n.height);if(l*=.9,o=Math.floor(r*l),a=Math.floor(i*l),o=Math.max(o,1),a=Math.max(a,1),o<=1&&a<=1)return n.width=1,void(n.height=1)}};t.trySetCanvasSize=e})(p2);(function(t){var e=_e&&_e.__createBinding||(Object.create?function(F,$,z,K){K===void 0&&(K=z);var X=Object.getOwnPropertyDescriptor($,z);X&&!("get"in X?!$.__esModule:X.writable||X.configurable)||(X={enumerable:!0,get:function(){return $[z]}}),Object.defineProperty(F,K,X)}:function(F,$,z,K){K===void 0&&(K=z),F[K]=$[z]}),n=_e&&_e.__setModuleDefault||(Object.create?function(F,$){Object.defineProperty(F,"default",{enumerable:!0,value:$})}:function(F,$){F.default=$}),r=_e&&_e.__importStar||function(F){if(F&&F.__esModule)return F;var $={};if(F!=null)for(var z in F)z!=="default"&&Object.prototype.hasOwnProperty.call(F,z)&&e($,F,z);return n($,F),$},i=_e&&_e.__importDefault||function(F){return F&&F.__esModule?F:{default:F}};Object.defineProperty(t,"__esModule",{value:!0}),t.ImageElement=t.useImageLoader=t.setImageLoaderHook=void 0;const o=i(Qe),a=ti,l=Qi,s=Io,f=i(Yp),h=i(ki),x=Qc,w=Ml,v=Yi,O=r(au),g=Qr,b=p2,p=ef,y=Rl,d=Na;function m(){return document.createElement("canvas")}async function _(F){if(!(F.indexOf("data:image/svg+xml")>=0||F.indexOf(".svg")>=0))return F;const $=await O.urlToString(F),z=O.fixSize($);return O.svgToURL(z)}const A=F=>{const[$,z]=o.default.useState(F);return o.default.useEffect(()=>{(async()=>{const K=await _(F);K!==$&&z(K)})()},[F]),$};function C(F,$){return Math.sqrt(Math.pow($.x-F.x,2)+Math.pow($.y-F.y,2))}function R(F,$){return{x:(F.x+$.x)/2,y:(F.y+$.y)/2}}const S=(F,$,z)=>{const K=o.default.useMemo(()=>{var X,Q;const{flipX:J,flipY:ne}=F,ie=F.type==="svg"||F.src.indexOf("data:image/svg+xml")>=0||F.src.indexOf(".svg")>=0,oe=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,he=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||oe)&&ie||F.maskSrc;if(!J&&!ne&&!he)return $;if(!$||!$.width||!$.height)return null;const me=m();let Pe=1;F.type==="svg"&&(Pe=Math.max(F.a.width/$.width*z,F.a.height/$.height*z)),(0,b.trySetCanvasSize)(me,Math.max($.width*Pe,1),Math.max($.height*Pe,1));let re=J?-me.width:0,ae=ne?-me.height:0;return(X=me.getContext("2d"))===null||X===void 0||X.scale(J?-1:1,ne?-1:1),(Q=me.getContext("2d"))===null||Q===void 0||Q.drawImage($,re,ae,me.width,me.height),me},[F.maskSrc,F.flipX,F.flipY,$,F.a.width,F.a.height,z]);return o.default.useEffect(()=>()=>{K&&K.nodeName==="CANVAS"&&h.default.Util.releaseCanvas(K)},[K]),K};function E(F,$){const z=$.width/$.height;let K,X;return z>=F.width/F.height?(K=F.width,X=F.width/z):(K=F.height*z,X=F.height),{x:(F.width-K)/2,y:(F.height-X)/2,width:K,height:X}}function P(F,$,z,K,X,Q,J){for(var ne=new ImageData($,z),ie=new Int32Array(F.data.buffer),oe=F.width,he=new Int32Array(ne.data.buffer),me=ne.width,Pe=$/Q,re=z/J,ae=Math.round(1/Pe),we=Math.round(1/re),be=ae*we,te=0;te<ne.height;te++)for(var fe=0;fe<me;fe++){for(var de=K+Math.round(fe/Pe)+(X+Math.round(te/re))*oe,Ee=0,Ve=0,Je=0,Ae=0,Ce=0;Ce<we;Ce++)for(var Me=0;Me<ae;Me++){var ze=ie[de+Me+Ce*oe];Ee+=ze<<24>>>24,Ve+=ze<<16>>>24,Je+=ze<<8>>>24,Ae+=ze>>>24}Ee=Math.round(Ee/be),Ve=Math.round(Ve/be),Je=Math.round(Je/be),Ae=Math.round(Ae/be),he[fe+te*me]=Ae<<24|Je<<16|Ve<<8|Ee}return ne}function T(F,$){var z,K;const X=m();X.width=F.width,X.height=F.height;const Q=Math.max(1,Math.floor(X.width*$)),J=Math.max(1,Math.floor(X.height*$));(z=X.getContext("2d"))===null||z===void 0||z.drawImage(F,0,0,X.width,X.height);const ne=P(X.getContext("2d").getImageData(0,0,X.width,X.height),Q,J,0,0,X.width,X.height);return X.width=Q,X.height=J,(K=X.getContext("2d"))===null||K===void 0||K.putImageData(ne,0,0),X}const N=(F,$)=>{const[z,K]=M(F.maskSrc,"anonymous"),X=F.maskSrc?K:"loaded";return(0,t.useImageLoader)(X,F.maskSrc||"",F.id),o.default.useMemo(()=>{if(!z||!$||!$.width||!$.height)return $;const Q=m();Q.width=Math.max($.width,1),Q.height=Math.max($.height,1);const J=Q.getContext("2d");if(!J)return $;J.drawImage($,0,0),J.globalCompositeOperation="source-in";const ne=E(z,F);return J.drawImage(z,ne.x,ne.y,ne.width,ne.height,0,0,$.width,$.height),Q},[$,z,F.a.width,F.a.height])},U=(F,$,z)=>Math.max($,Math.min(z,F)),G=(F,$,z,K,X=0,Q=!1,J=!0)=>{const ne=Math.floor(U(F.a.width*K,1,1e4)),ie=Math.floor(U(F.a.height*K,1,1e4)),oe=Math.min(X*K,ne/2,ie/2),he=Math.max(F.a.width/z.width,F.a.height/z.height)*K,me=F.page._exportingOrRendering&&g.flags.imageDownScalingEnabled&&he<1&&!Q,Pe=z.x===0&&z.y===0&&z.width===($==null?void 0:$.width)&&z.height===($==null?void 0:$.height),re=o.default.useMemo(()=>{if(!(!$||!$.width||!$.height))return Pe&&oe===0&&!me?void 0:m()},[$,oe,me,Pe]);return o.default.useLayoutEffect(()=>{if(!re||!$)return;(0,b.trySetCanvasSize)(re,ne,ie);const ae=re.getContext("2d");if(!ae)return;oe&&(ae.beginPath(),ae.moveTo(oe,0),ae.lineTo(ne-oe,0),ae.arc(ne-oe,oe,oe,3*Math.PI/2,0,!1),ae.lineTo(ne,ie-oe),ae.arc(ne-oe,ie-oe,oe,0,Math.PI/2,!1),ae.lineTo(oe,ie),ae.arc(oe,ie-oe,oe,Math.PI/2,Math.PI,!1),ae.lineTo(0,oe),ae.arc(oe,oe,oe,Math.PI,3*Math.PI/2,!1),ae.clip());const we=me?T($,he):$,be=me?{x:Math.floor(z.x*he),y:Math.floor(z.y*he),width:Math.floor(z.width*he),height:Math.floor(z.height*he)}:z;ae.drawImage(we,be.x,be.y,be.width,be.height,0,0,re.width,re.height)},[re,F.a.width,F.a.height,z.x,z.y,z.width,z.height,X,K,Q,F.page._exportingOrRendering,me]),o.default.useEffect(()=>()=>{re&&re.nodeName==="CANVAS"&&h.default.Util.releaseCanvas(re)},[re]),re||$},Z=(F,$,z,K)=>{const X=A(F.clipSrc||""),[Q,J]=M(X,"anonymous"),ne=F.clipSrc?J:"loaded";(0,t.useImageLoader)(ne,F.clipSrc,F.id);const ie=o.default.useMemo(()=>{if($&&Q)return m()},[$,Q]);return o.default.useLayoutEffect(()=>{var oe;if(!Q||!$||!$.width||!$.height||!Q||!Q.width||!Q.height||!ie)return;const he=m(),me=Math.max(F.a.width/Q.width*z,F.a.height/Q.height*z);he.width=Q.width*me,he.height=Q.height*me,(oe=he.getContext("2d"))===null||oe===void 0||oe.drawImage(Q,0,0,he.width,he.height),ie.width=Math.max($.width,1),ie.height=Math.max($.height,1);const Pe=ie.getContext("2d");Pe&&(Pe.save(),Pe.drawImage(he,0,0,$.width,$.height),h.default.Util.releaseCanvas(he),Pe.globalCompositeOperation="source-in",Pe.drawImage($,0,0,ie.width,ie.height),Pe.restore())},[ie,$,Q,F.a.width,F.a.height,z,...K]),F.clipSrc&&Q?ie:$},W=m(),H=(0,a.observer)(({element:F})=>{const $=Math.min(30,F.a.width/4,F.a.height/4),z=o.default.useRef(null);return o.default.useEffect(()=>{const K=z.current;if(!K)return;const X=new h.default.Animation(Q=>{K.rotate(((Q==null?void 0:Q.timeDiff)||0)/2)},K.getLayer());return X.start(),()=>{X.stop()}}),o.default.createElement(s.Group,{x:F.x,y:F.y,rotation:F.rotation,listening:!1,opacity:F.a.opacity,hideInExport:!F.showInExport},o.default.createElement(s.Rect,{width:F.a.width,height:F.a.height,fill:"rgba(124, 173, 212, 0.8)"}),o.default.createElement(s.Arc,{ref:z,x:F.a.width/2,y:F.a.height/2,fill:"white",outerRadius:Math.abs($),innerRadius:Math.max(1,$-5),angle:270}))}),L=(0,a.observer)(({element:F})=>{const $="Can not load the image...",z=Math.max(10,Math.min(30,F.a.width/25));return o.default.createElement(s.Group,{x:F.x,y:F.y,rotation:F.rotation,listening:!1,opacity:F.a.opacity,hideInExport:!F.showInExport},o.default.createElement(s.Rect,{width:F.a.width,height:F.a.height,fill:"rgba(223, 102, 102, 0.8)"}),o.default.createElement(s.Text,{text:$,fontSize:z,width:F.a.width,height:F.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let M=f.default;const D=F=>{M=F};t.setImageLoaderHook=D;const B=(F,$="",z="")=>{const K=o.default.useRef(),X=()=>{var Q;(Q=K.current)===null||Q===void 0||Q.call(K),K.current=void 0};o.default.useEffect(()=>X,[]),o.default.useLayoutEffect(()=>{const Q=$.slice(0,200),J=`image with id ${z} url: ${Q}`;F!=="loading"||K.current||(K.current=(0,v.incrementLoader)(J)),F!=="loading"&&X(),F==="failed"&&(0,v.triggerLoadError)(J)},[F])};t.useImageLoader=B;const V=({image:F,status:$,type:z})=>{const K=o.default.useRef();return o.default.useEffect(()=>{K.current=F||K.current},[F]),$!=="failed"||$!=="failed"&&z==="svg"?K.current:void 0},Y=F=>{const[$,z]=o.default.useReducer(J=>J+1,0),K=o.default.useRef("loading"),X=o.default.useRef(F.src),Q=o.default.useRef(F.src);return Q.current!==F.src&&(Q.current=F.src,K.current="loading"),o.default.useEffect(()=>{if(F.type!=="svg"||!F.src)return;let J=!1;return(async()=>{K.current="loading",z();const ne=await O.urlToString(F.src),ie=O.fixSize(ne),oe=O.replaceColors(ie,F.colorsReplace);J||(X.current=oe,K.current="loaded",z())})(),()=>{J=!0}},[F.src,JSON.stringify(F.colorsReplace)]),F.type!=="svg"?[F.src,"loaded"]:[X.current,K.current]};t.ImageElement=(0,a.observer)(({element:F,store:$})=>{var z;const[K,X]=o.default.useState(!1),Q=o.default.useRef(null),J=o.default.useRef(null),[ne,ie]=o.default.useState(!1),oe=$.selectedShapes.indexOf(F)>=0,[he,me]=Y(F),[Pe,re]=M(he,"anonymous"),ae=F.type!=="svg"||me==="loaded"?re:"loading";(0,t.useImageLoader)(ae,F.src,F.id);const we=F.page._exportingOrRendering?1:Math.max(1,$.scale),be=$._elementsPixelRatio*we,te=V({image:Pe,status:re,type:F.type}),fe=S(F,Pe||te,be),de=N(F,fe)||W;let{cropX:Ee,cropY:Ve,cropWidth:Je,cropHeight:Ae}=F;re!=="loaded"&&(Ee=Ve=0,Je=Ae=1);const Ce=de.width*Je,Me=de.height*Ae,ze=F.a.width/F.a.height;let We,St;const mt=Ce/Me,ue=F.type==="svg";ue?(We=Ce,St=Me):ze>=mt?(We=Ce,St=Ce/ze):(We=Me*ze,St=Me);const ce={x:de.width*Ee,y:de.height*Ve,width:We,height:St},Se=(z=F.cornerRadius)!==null&&z!==void 0?z:0,Le=F.page._exportingOrRendering?1:Math.min(2,$.scale),Ne=$._elementsPixelRatio*Le;let ge=Z(F,G(F,de,ce,Ne,Se,K||F._cropModeEnabled||F.type==="svg",!0),Ne,[ce,Se,Ne]);const Xe=Math.max(F.a.width/We,F.a.height/St);o.default.useEffect(()=>{var Ie;if(!F._cropModeEnabled)return;const et=(Ie=Q.current)===null||Ie===void 0?void 0:Ie.getStage();function ft(Pt){F._cropModeEnabled&&Pt.target!==J.current&&F.toggleCropMode(!1)}function Ft(Pt){F._cropModeEnabled&&Pt.target.parentNode!==et.content&&F.toggleCropMode(!1)}return document.body.addEventListener("click",Ft),et==null||et.on("click",ft),et==null||et.on("tap",ft),()=>{document.body.removeEventListener("click",Ft),document.body.removeEventListener("touchstart",Ft),et==null||et.off("click",ft),et==null||et.off("click",ft)}},[F._cropModeEnabled]),o.default.useLayoutEffect(()=>{if(!(K||F._cropModeEnabled))return(0,p.applyFilter)(Q.current,F),(0,l.autorun)(()=>{(0,p.applyFilter)(Q.current,F)},{delay:100})},[ge,F.page._exportingOrRendering,K,Je,Ae,F._cropModeEnabled]),o.default.useLayoutEffect(()=>{var Ie;K||F._cropModeEnabled?(Ie=Q.current)===null||Ie===void 0||Ie.clearCache():(0,p.applyFilter)(Q.current,F)},[K,F.a.width,F.a.height,F._cropModeEnabled]),o.default.useEffect(()=>{(0,p.applyFilter)(Q.current,F)},[F.shadowEnabled,F.shadowBlur,F.cornerRadius,F.shadowColor,F.shadowOffsetX,F.shadowOffsetY,F.shadowOpacity]);const Oe=o.default.useRef(null),$e=o.default.useRef(null),Wt=o.default.useRef(null);o.default.useLayoutEffect(()=>{F._cropModeEnabled&&($e.current.nodes([Oe.current]),Wt.current.nodes([J.current]))},[F._cropModeEnabled]);var Tt=o.default.useRef(null),Yt=o.default.useRef(0),ke=o.default.useRef(!1);const Ye=Ie=>{var et;((et=Ie.evt.touches)===null||et===void 0?void 0:et.length)>2&&Ie.target.stopDrag(),Math.round(Ie.target.x())>0&&(Ie.target.x(0),Ie.target.scaleX(1)),Math.round(Ie.target.y())>0&&(Ie.target.y(0),Ie.target.scaleY(1));const ft=Ie.target.width()*Ie.target.scaleX(),Ft=Ie.target.height()*Ie.target.scaleY(),Pt=Math.min(1,We/ft),Bn=Math.min(1,St/Ft),xn=1-Pt,tn=Math.min(xn,Math.max(0,Math.round(-Ie.target.x())/ft)),ri=1-Bn,Sr=Math.min(ri,Math.max(0,Math.round(-Ie.target.y())/Ft));Ie.target.setAttrs({x:-tn*de.width,y:-Sr*de.height,scaleX:1,scaleY:1}),F.set({cropX:tn,cropY:Sr,cropWidth:Pt,cropHeight:Bn})},at=()=>{F.type!=="svg"&&F.contentEditable&&setTimeout(()=>{F.toggleCropMode(!0)})},Ot=F.type==="svg"&&te,xt=re==="loading"&&!Ot,un=re==="failed",hn=!xt&&!un,pn=o.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),rr=hn?F.a.opacity:0;(0,y.useFadeIn)(Q,rr);const to=F.selectable||$.role==="admin",wr=(0,d.isTouchDevice)();return o.default.createElement(o.default.Fragment,null,xt&&o.default.createElement(H,{element:F}),un&&o.default.createElement(L,{element:F}),o.default.createElement(s.Image,{ref:Q,name:"element",id:F.id,image:ge,x:F.a.x,y:F.a.y,width:F.a.width||1,height:F.a.height||1,rotation:F.a.rotation,opacity:rr,shadowEnabled:F.shadowEnabled,shadowBlur:F.shadowBlur,shadowOffsetX:F.shadowOffsetX,shadowOffsetY:F.shadowOffsetY,shadowColor:F.shadowColor,shadowOpacity:F.shadowOpacity,customCrop:ce,listening:to,draggable:wr?F.draggable&&oe:F.draggable,preventDefault:!wr||oe,hideInExport:!F.showInExport,onMouseEnter:()=>{ie(!0)},onMouseLeave:()=>{ie(!1)},onDragMove:Ie=>{F.set({x:Ie.target.x(),y:Ie.target.y()})},onDragEnd:Ie=>{F.set({x:Ie.target.x(),y:Ie.target.y()})},onDblClick:at,onDblTap:at,onTransformStart:()=>{X(!0),pn.current={cropX:F.cropX,cropY:F.cropY,cropWidth:F.cropWidth,cropHeight:F.cropHeight}},onTransform:Ie=>{var et;const ft=Ie.currentTarget,Ft=Math.abs(ft.scaleX()-1)<1e-7?1:ft.scaleX(),Pt=Math.abs(ft.scaleY()-1)<1e-7?1:ft.scaleY();ft.scaleX(1),ft.scaleY(1);const Bn=(et=Ie.target.getStage())===null||et===void 0?void 0:et.findOne("Transformer"),xn=1-We/de.width,tn=Math.min(xn,Math.max(0,F.cropX)),ri=1-St/de.height,Sr=Math.min(ri,Math.max(0,F.cropY)),no=Bn.getActiveAnchor(),jo=!(no.indexOf("middle")>=0||no.indexOf("center")>=0),cu=!jo&&Ft<1&&pn.current.cropHeight>St/de.height;let Da=jo?F.cropWidth:F.cropWidth*Ft;cu&&(Da=F.cropWidth);const ro=!jo&&Pt<1&&pn.current.cropWidth>We/de.width;let Dr=jo?F.cropHeight:F.cropHeight*Pt;ro&&(Dr=F.cropHeight),ue&&(Da=F.cropWidth,Dr=F.cropHeight),F.set({cropX:tn,cropY:Sr,x:ft.x(),y:ft.y(),width:ft.width()*Ft,height:ft.height()*Pt,rotation:Ie.target.rotation(),cropWidth:Math.min(Da,1-tn),cropHeight:Math.min(Dr,1-Sr)})},onTransformEnd:Ie=>{const et=Ie.currentTarget;F.set({width:et.width(),height:et.height(),x:et.x(),y:et.y(),rotation:Ie.target.rotation(),cropWidth:We/de.width,cropHeight:St/de.height}),X(!1)}}),o.default.createElement(s.Rect,{x:F.x,y:F.y,width:Math.max(F.a.width-F.borderSize,0),height:Math.max(F.a.height-F.borderSize,0),opacity:rr,offsetX:-F.borderSize/2,offsetY:-F.borderSize/2,stroke:F.borderColor,strokeWidth:F.borderSize,listening:!1,visible:!!F.borderSize,rotation:F.rotation,cornerRadius:Math.max(0,Se-F.borderSize),hideInExport:!F.showInExport}),F._cropModeEnabled&&o.default.createElement(x.Portal,{selector:".page-abs-container",enabled:!0},o.default.createElement(s.Rect,{x:-window.innerWidth/$.scale,y:-window.innerWidth/$.scale,width:window.innerWidth/$.scale*3,height:window.innerWidth/$.scale*3,fill:"rgba(0,0,0,0.3)"}),o.default.createElement(s.Image,{listening:!1,image:ge,x:F.x,y:F.y,width:F.a.width,height:F.a.height,rotation:F.rotation,shadowEnabled:F.shadowEnabled,shadowBlur:F.shadowBlur}),o.default.createElement(s.Group,{x:F.x,y:F.y,rotation:F.rotation,scaleX:Xe,scaleY:Xe},o.default.createElement(s.Image,{image:de,ref:J,opacity:.4,draggable:!0,x:-F.cropX*de.width,y:-F.cropY*de.height,onDragMove:Ye,onTransform:Ye,onTouchMove:Ie=>{Ie.evt.preventDefault();const et=Ie.target.getStage().getPointersPositions();var ft=et[0],Ft=et[1];const Pt=Ie.target;if(ft&&!Ft&&!Pt.isDragging()&&ke.current&&(Pt.startDrag(),ke.current=!1),ft&&Ft){h.default.hitOnDragEnabled=!0,Pt.isDragging()&&(ke.current=!0,Pt.stopDrag());const ro=Ie.target.getAbsoluteTransform().copy();ro.invert();var Bn={x:ft.x,y:ft.y},xn={x:Ft.x,y:Ft.y};if(!Tt.current)return void(Tt.current=R(Bn,xn));var tn=R(Bn,xn),ri=C(Bn,xn);Yt.current||(Yt.current=ri);const Dr=Pt.position();var Sr={x:tn.x-Dr.x,y:tn.y-Dr.y},no=ri/Yt.current;Pt.scaleX(no),Pt.scaleY(no);const Nl=ro.point(tn),Il=ro.point(Tt.current);var jo=Nl.x-Il.x,cu=Nl.y-Il.y,Da={x:Math.min(0,tn.x-Sr.x*no+jo),y:Math.min(0,tn.y-Sr.y*no+cu)};Pt.position(Da),Yt.current=ri,Tt.current=tn,Ye(Ie)}},onTouchEnd:Ie=>{Yt.current=0,Tt.current=null,h.default.hitOnDragEnabled=!1}}),o.default.createElement(s.Transformer,{ref:Wt,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ie,et)=>et.width<5||et.height<5?Ie:et,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),o.default.createElement(s.Rect,{width:We,height:St,ref:Oe,listening:!1,onTransform:Ie=>{Ie.target.x()<-F.cropX*de.width-1e-9&&(Ie.target.x(-F.cropX*de.width),Ie.target.scaleX(1)),Ie.target.y()<-F.cropY*de.height-1e-9&&(Ie.target.y(-F.cropY*de.height),Ie.target.scaleY(1));const et=Math.min(1,Math.max(0,F.cropX+Ie.target.x()/de.width)),ft=Math.min(1,Math.max(0,Ie.target.y()/de.height+F.cropY)),Ft=Ie.target.width()*Ie.target.scaleX(),Pt=Ie.target.height()*Ie.target.scaleY(),Bn=Math.min(1-et,Ft/de.width),xn=Math.min(1-ft,Pt/de.height),tn=Ie.target.getAbsolutePosition(Ie.target.getParent().getParent());Ie.target.scale({x:1,y:1}),Ie.target.position({x:0,y:0}),F.set({x:tn.x,y:tn.y,cropX:et,cropY:ft,cropWidth:Bn,cropHeight:xn,width:Math.min(Ft*Xe,de.width*(1-et)*Xe),height:Math.min(Pt*Xe,de.height*(1-ft)*Xe)})}}),o.default.createElement(s.Transformer,{ref:$e,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ie,et)=>et.width<5||et.height<5?Ie:et,visible:F.resizable,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),(ne||oe)&&o.default.createElement(w.Highlighter,{element:F}))})})(d2);var iS={},oS={exports:{}};/*!
|
|
108
|
+
`).trim();return A}function f(m){if(m){o+=m;return}return r?"":Array(o).join(i||"")}function h(m){return"@"+m.type+" "+m.value+";"+a}function x(m){var _="",A=m.prefix||"";m.name&&(_=" "+m.name);var C=m.type!=="page";return"@"+A+m.type+_+l+g(m,C)+a}function w(m){return n?"/*"+(m.text||"")+"*/"+a:""}function v(m){var _;return m.selectors?_=m.selectors.join(","+a):(_="@"+m.type,_+=m.name?" "+m.name:""),f()+_+l+g(m)+a}function O(m,_){return m.reduce(function(A,C){var R=C.type==="comment"?w(C):_(C);return R&&A.push(R),A},[])}function g(m,_){var A=m.declarations,C=p;return m.rules&&(A=m.rules,C=v),A=b(A,C),A&&(A=a+A+(_?"":a)),"{"+A+f()+"}"}function b(m,_){if(!m)return"";f(1);var A=O(m,_);return f(-1),A.length?A.join(a):""}function p(m){if(m.type==="property")return d(m)}function y(m){switch(m.type){case"rule":return v(m);case"media":case"keyframes":return x(m);case"comment":return w(m);case"import":case"charset":case"namespace":return h(m);case"font-face":case"supports":case"viewport":case"document":case"page":return x(m)}}function d(m){var _=m.name?m.name+":"+l:"";return f()+_+m.value+";"}})(rS);var CD=rS.exports,kD={lex:tS,parse:PD,stringify:CD};(function(t){var e=_e&&_e.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(t,"__esModule",{value:!0}),t.useSvgColors=t.sameColors=void 0,t.urlToBase64=x,t.urlToString=w,t.getColors=v,t.svgToURL=O,t.getSvgSize=g,t.fixSize=b,t.replaceColors=d;const n=e(ki),r=e(Qe),i=Qy,o=e(kD);function a(_){for(;_.parentNode;){if(_.nodeName==="defs")return!0;_=_.parentNode}return!1}function l(_){const A={};return _.querySelectorAll("style").forEach(C=>{const R=o.default.parse(C.textContent).stylesheet.rules;for(let S of R)S.selectors&&S.selectors.forEach(E=>{const P=A[E]||{};S.declarations.forEach(T=>{P[T.name]=T.value}),A[E]=P})}),A}function s(_,A){var C;const R={fill:"",stroke:""},S=((C=_.getAttribute("class"))===null||C===void 0?void 0:C.split(" "))||[],E=_.getAttribute("id");let P={};if(E&&A[`#${E}`]?P=A[`#${E}`]:S.forEach(T=>{A[`.${T}`]&&(P=Object.assign(Object.assign({},P),A[`.${T}`]))}),A[_.nodeName]&&(P=Object.assign(Object.assign({},P),A[_.nodeName])),_.getAttribute("fill")&&_.getAttribute("fill")!=="none"?R.fill=_.getAttribute("fill"):P.fill&&P.fill!=="none"&&(R.fill=P.fill),_.getAttribute("stroke")&&_.getAttribute("stroke")!=="none"?R.stroke=_.getAttribute("stroke"):P.stroke&&P.stroke!=="none"&&(R.stroke=P.stroke),!R.fill&&_.style.fill&&_.style.fill!=="none"&&(R.fill=_.style.fill),!R.stroke&&_.style.stroke&&_.style.stroke!=="none"&&(R.stroke=_.style.stroke),!R.stroke&&!R.fill){const T=_.ownerSVGElement,N=T&&T!==_&&s(T,A);(N==null?void 0:N.fill)==="currentColor"||(N==null?void 0:N.stroke)==="currentColor"||(R.fill="black")}return R}const f=["path","rect","circle","line","polygon","polyline","ellipse","text"];function h(_){for(var A=[],C=_.getElementsByTagName("*"),R=0,S=C.length;R<S;R++){const E=C[R];a(E)||(E.getAttribute("fill")!==null&&A.push(E),(E.getAttribute("stroke")!==null||E.style&&E.style.fill||f.indexOf(E.nodeName)>=0)&&A.push(E))}return A}async function x(_){const A=await fetch(_);return O(await A.text())}async function w(_){return await(await fetch(_,{mode:"cors"})).text()}function v(_){var A=new DOMParser().parseFromString(_,"image/svg+xml");const C=l(A),R=h(A),S=[];return R.forEach(E=>{const{fill:P,stroke:T}=s(E,C);[P,T].forEach(N=>{N&&(N==="currentColor"&&(N="black"),n.default.Util.colorToRGBA(N)&&S.indexOf(N)===-1&&S.push(N))})}),S}function O(_){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(_)))}async function g(_){const A=await w(_),C=new DOMParser().parseFromString(A,"image/svg+xml").documentElement.getAttribute("viewBox"),[R,S,E,P]=(C==null?void 0:C.split(" "))||[];return{width:parseFloat(E),height:parseFloat(P)}}function b(_){var A=new DOMParser().parseFromString(_,"image/svg+xml");const C=A.documentElement.getAttribute("viewBox"),[R,S,E,P]=(C==null?void 0:C.split(" "))||[],T=A.documentElement.getAttribute("width");!T&&A.documentElement.setAttribute("width",E+"px");const N=A.documentElement.getAttribute("height");if((!N||N.indexOf("%")>=0)&&A.documentElement.setAttribute("height",P+"px"),T&&T.indexOf("%")>=0&&N&&N.indexOf("%")===-1){const U=parseFloat(N)/parseFloat(P);A.documentElement.setAttribute("width",U*parseFloat(E)+"px")}if(N&&N.indexOf("%")>=0&&T&&T.indexOf("%")===-1){const U=parseFloat(T)/parseFloat(E);A.documentElement.setAttribute("height",U*parseFloat(P)+"px")}return T==="100%"&&N==="100%"&&(A.documentElement.setAttribute("width",E+"px"),A.documentElement.setAttribute("height",P+"px")),new XMLSerializer().serializeToString(A)}const p=(_,A)=>{if(!_||!A)return!1;if(A==="currentColor"&&_==="black")return!0;const C=n.default.Util.colorToRGBA(_),R=n.default.Util.colorToRGBA(A);return C&&R?C.r===R.r&&C.g===R.g&&C.b===R.b&&C.a===R.a:void 0};function y(_,A,C,R){var S=_.namespaceURI,E=document.createElementNS(S,"linearGradient");const P=n.default.Util.degToRad(C+90),T=(Math.cos(P)+1)/2,N=(Math.sin(P)+1)/2,U=(Math.cos(P+Math.PI)+1)/2,G=(Math.sin(P+Math.PI)+1)/2;E.setAttribute("x1",100*T+"%"),E.setAttribute("y1",100*N+"%"),E.setAttribute("x2",100*U+"%"),E.setAttribute("y2",100*G+"%"),E.setAttribute("gradientUnits","userSpaceOnUse"),E.setAttribute("id",A);for(var Z=0;Z<R.length;Z++){var W=R[Z],H=document.createElementNS(S,"stop");for(var L in W)W.hasOwnProperty(L)&&H.setAttribute(L,W[L]);E.appendChild(H)}return(_.querySelector("defs")||_.insertBefore(document.createElementNS(S,"defs"),_.firstChild)).appendChild(E)}function d(_,A){var C=new DOMParser().parseFromString(_,"image/svg+xml");const R=h(C),S=Array.from(A.keys()),E=l(C);return R.forEach(P=>{const{fill:T,stroke:N}=s(P,E);[{prop:"fill",color:T},{prop:"stroke",color:N}].forEach(({prop:U,color:G})=>{const Z=S.find(W=>(0,t.sameColors)(W,G));if(Z){const W=A.get(Z);if((0,i.isGradient)(W)){const{rotation:H,stops:L}=(0,i.parseColor)(W),M=L.map(B=>({offset:100*B.offset+"%","stop-color":B.color})),D="color"+Math.round(1e8*Math.random());y(C.children[0],D,H,M),P.style[U]=null,P.setAttribute(U,`url('#${D}')`)}else P.style[U]=A.get(Z)}})}),O(new XMLSerializer().serializeToString(C))}t.sameColors=p;const m=_=>{const[A,C]=r.default.useState([]);return r.default.useEffect(()=>{let R=!1;return(async()=>{C([]);const S=v(await w(_));R||C(S)})(),()=>{R=!0}},[_]),A};t.useSvgColors=m})(au);var p2={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.trySetCanvasSize=void 0;const e=(n,r,i)=>{let o=r,a=i,l=1;for(;o>0&&a>0;){n.width=o,n.height=a;const s=n.getContext("2d");if(!s)return;if(s.fillStyle="rgba(0,0,0,0.1)",s.fillRect(0,0,1,1),s.getImageData(0,0,1,1).data[3]!==0)return void s.clearRect(0,0,n.width,n.height);if(l*=.9,o=Math.floor(r*l),a=Math.floor(i*l),o=Math.max(o,1),a=Math.max(a,1),o<=1&&a<=1)return n.width=1,void(n.height=1)}};t.trySetCanvasSize=e})(p2);(function(t){var e=_e&&_e.__createBinding||(Object.create?function(F,$,z,K){K===void 0&&(K=z);var X=Object.getOwnPropertyDescriptor($,z);X&&!("get"in X?!$.__esModule:X.writable||X.configurable)||(X={enumerable:!0,get:function(){return $[z]}}),Object.defineProperty(F,K,X)}:function(F,$,z,K){K===void 0&&(K=z),F[K]=$[z]}),n=_e&&_e.__setModuleDefault||(Object.create?function(F,$){Object.defineProperty(F,"default",{enumerable:!0,value:$})}:function(F,$){F.default=$}),r=_e&&_e.__importStar||function(F){if(F&&F.__esModule)return F;var $={};if(F!=null)for(var z in F)z!=="default"&&Object.prototype.hasOwnProperty.call(F,z)&&e($,F,z);return n($,F),$},i=_e&&_e.__importDefault||function(F){return F&&F.__esModule?F:{default:F}};Object.defineProperty(t,"__esModule",{value:!0}),t.ImageElement=t.useImageLoader=t.setImageLoaderHook=void 0;const o=i(Qe),a=ti,l=Qi,s=Io,f=i(Yp),h=i(ki),x=Qc,w=Ml,v=Yi,O=r(au),g=Qr,b=p2,p=ef,y=Rl,d=Na;function m(){return document.createElement("canvas")}async function _(F){if(!(F.indexOf("data:image/svg+xml")>=0||F.indexOf(".svg")>=0))return F;const $=await O.urlToString(F),z=O.fixSize($);return O.svgToURL(z)}const A=F=>{const[$,z]=o.default.useState(F);return o.default.useEffect(()=>{(async()=>{const K=await _(F);K!==$&&z(K)})()},[F]),$};function C(F,$){return Math.sqrt(Math.pow($.x-F.x,2)+Math.pow($.y-F.y,2))}function R(F,$){return{x:(F.x+$.x)/2,y:(F.y+$.y)/2}}const S=(F,$,z)=>{const K=o.default.useMemo(()=>{var X,Q;const{flipX:J,flipY:ne}=F,ie=F.type==="svg"||F.src.indexOf("data:image/svg+xml")>=0||F.src.indexOf(".svg")>=0,oe=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,de=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||oe)&&ie||F.maskSrc;if(!J&&!ne&&!de)return $;if(!$||!$.width||!$.height)return null;const me=m();let Pe=1;F.type==="svg"&&(Pe=Math.max(F.a.width/$.width*z,F.a.height/$.height*z)),(0,b.trySetCanvasSize)(me,Math.max($.width*Pe,1),Math.max($.height*Pe,1));let re=J?-me.width:0,ae=ne?-me.height:0;return(X=me.getContext("2d"))===null||X===void 0||X.scale(J?-1:1,ne?-1:1),(Q=me.getContext("2d"))===null||Q===void 0||Q.drawImage($,re,ae,me.width,me.height),me},[F.maskSrc,F.flipX,F.flipY,$,F.a.width,F.a.height,z]);return o.default.useEffect(()=>()=>{K&&K.nodeName==="CANVAS"&&h.default.Util.releaseCanvas(K)},[K]),K};function E(F,$){const z=$.width/$.height;let K,X;return z>=F.width/F.height?(K=F.width,X=F.width/z):(K=F.height*z,X=F.height),{x:(F.width-K)/2,y:(F.height-X)/2,width:K,height:X}}function P(F,$,z,K,X,Q,J){for(var ne=new ImageData($,z),ie=new Int32Array(F.data.buffer),oe=F.width,de=new Int32Array(ne.data.buffer),me=ne.width,Pe=$/Q,re=z/J,ae=Math.round(1/Pe),we=Math.round(1/re),be=ae*we,te=0;te<ne.height;te++)for(var fe=0;fe<me;fe++){for(var he=K+Math.round(fe/Pe)+(X+Math.round(te/re))*oe,Ee=0,Ve=0,Je=0,Ae=0,Ce=0;Ce<we;Ce++)for(var Me=0;Me<ae;Me++){var ze=ie[he+Me+Ce*oe];Ee+=ze<<24>>>24,Ve+=ze<<16>>>24,Je+=ze<<8>>>24,Ae+=ze>>>24}Ee=Math.round(Ee/be),Ve=Math.round(Ve/be),Je=Math.round(Je/be),Ae=Math.round(Ae/be),de[fe+te*me]=Ae<<24|Je<<16|Ve<<8|Ee}return ne}function T(F,$){var z,K;const X=m();X.width=F.width,X.height=F.height;const Q=Math.max(1,Math.floor(X.width*$)),J=Math.max(1,Math.floor(X.height*$));(z=X.getContext("2d"))===null||z===void 0||z.drawImage(F,0,0,X.width,X.height);const ne=P(X.getContext("2d").getImageData(0,0,X.width,X.height),Q,J,0,0,X.width,X.height);return X.width=Q,X.height=J,(K=X.getContext("2d"))===null||K===void 0||K.putImageData(ne,0,0),X}const N=(F,$)=>{const[z,K]=M(F.maskSrc,"anonymous"),X=F.maskSrc?K:"loaded";return(0,t.useImageLoader)(X,F.maskSrc||"",F.id),o.default.useMemo(()=>{if(!z||!$||!$.width||!$.height)return $;const Q=m();Q.width=Math.max($.width,1),Q.height=Math.max($.height,1);const J=Q.getContext("2d");if(!J)return $;J.drawImage($,0,0),J.globalCompositeOperation="source-in";const ne=E(z,F);return J.drawImage(z,ne.x,ne.y,ne.width,ne.height,0,0,$.width,$.height),Q},[$,z,F.a.width,F.a.height])},U=(F,$,z)=>Math.max($,Math.min(z,F)),G=(F,$,z,K,X=0,Q=!1,J=!0)=>{const ne=Math.floor(U(F.a.width*K,1,1e4)),ie=Math.floor(U(F.a.height*K,1,1e4)),oe=Math.min(X*K,ne/2,ie/2),de=Math.max(F.a.width/z.width,F.a.height/z.height)*K,me=F.page._exportingOrRendering&&g.flags.imageDownScalingEnabled&&de<1&&!Q,Pe=z.x===0&&z.y===0&&z.width===($==null?void 0:$.width)&&z.height===($==null?void 0:$.height),re=o.default.useMemo(()=>{if(!(!$||!$.width||!$.height))return Pe&&oe===0&&!me?void 0:m()},[$,oe,me,Pe]);return o.default.useLayoutEffect(()=>{if(!re||!$)return;(0,b.trySetCanvasSize)(re,ne,ie);const ae=re.getContext("2d");if(!ae)return;oe&&(ae.beginPath(),ae.moveTo(oe,0),ae.lineTo(ne-oe,0),ae.arc(ne-oe,oe,oe,3*Math.PI/2,0,!1),ae.lineTo(ne,ie-oe),ae.arc(ne-oe,ie-oe,oe,0,Math.PI/2,!1),ae.lineTo(oe,ie),ae.arc(oe,ie-oe,oe,Math.PI/2,Math.PI,!1),ae.lineTo(0,oe),ae.arc(oe,oe,oe,Math.PI,3*Math.PI/2,!1),ae.clip());const we=me?T($,de):$,be=me?{x:Math.floor(z.x*de),y:Math.floor(z.y*de),width:Math.floor(z.width*de),height:Math.floor(z.height*de)}:z;ae.drawImage(we,be.x,be.y,be.width,be.height,0,0,re.width,re.height)},[re,F.a.width,F.a.height,z.x,z.y,z.width,z.height,X,K,Q,F.page._exportingOrRendering,me]),o.default.useEffect(()=>()=>{re&&re.nodeName==="CANVAS"&&h.default.Util.releaseCanvas(re)},[re]),re||$},Z=(F,$,z,K)=>{const X=A(F.clipSrc||""),[Q,J]=M(X,"anonymous"),ne=F.clipSrc?J:"loaded";(0,t.useImageLoader)(ne,F.clipSrc,F.id);const ie=o.default.useMemo(()=>{if($&&Q)return m()},[$,Q]);return o.default.useLayoutEffect(()=>{var oe;if(!Q||!$||!$.width||!$.height||!Q||!Q.width||!Q.height||!ie)return;const de=m(),me=Math.max(F.a.width/Q.width*z,F.a.height/Q.height*z);de.width=Q.width*me,de.height=Q.height*me,(oe=de.getContext("2d"))===null||oe===void 0||oe.drawImage(Q,0,0,de.width,de.height),ie.width=Math.max($.width,1),ie.height=Math.max($.height,1);const Pe=ie.getContext("2d");Pe&&(Pe.save(),Pe.drawImage(de,0,0,$.width,$.height),h.default.Util.releaseCanvas(de),Pe.globalCompositeOperation="source-in",Pe.drawImage($,0,0,ie.width,ie.height),Pe.restore())},[ie,$,Q,F.a.width,F.a.height,z,...K]),F.clipSrc&&Q?ie:$},W=m(),H=(0,a.observer)(({element:F})=>{const $=Math.min(30,F.a.width/4,F.a.height/4),z=o.default.useRef(null);return o.default.useEffect(()=>{const K=z.current;if(!K)return;const X=new h.default.Animation(Q=>{K.rotate(((Q==null?void 0:Q.timeDiff)||0)/2)},K.getLayer());return X.start(),()=>{X.stop()}}),o.default.createElement(s.Group,{x:F.x,y:F.y,rotation:F.rotation,listening:!1,opacity:F.a.opacity,hideInExport:!F.showInExport},o.default.createElement(s.Rect,{width:F.a.width,height:F.a.height,fill:"rgba(124, 173, 212, 0.8)"}),o.default.createElement(s.Arc,{ref:z,x:F.a.width/2,y:F.a.height/2,fill:"white",outerRadius:Math.abs($),innerRadius:Math.max(1,$-5),angle:270}))}),L=(0,a.observer)(({element:F})=>{const $="Can not load the image...",z=Math.max(10,Math.min(30,F.a.width/25));return o.default.createElement(s.Group,{x:F.x,y:F.y,rotation:F.rotation,listening:!1,opacity:F.a.opacity,hideInExport:!F.showInExport},o.default.createElement(s.Rect,{width:F.a.width,height:F.a.height,fill:"rgba(223, 102, 102, 0.8)"}),o.default.createElement(s.Text,{text:$,fontSize:z,width:F.a.width,height:F.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let M=f.default;const D=F=>{M=F};t.setImageLoaderHook=D;const B=(F,$="",z="")=>{const K=o.default.useRef(),X=()=>{var Q;(Q=K.current)===null||Q===void 0||Q.call(K),K.current=void 0};o.default.useEffect(()=>X,[]),o.default.useLayoutEffect(()=>{const Q=$.slice(0,200),J=`image with id ${z} url: ${Q}`;F!=="loading"||K.current||(K.current=(0,v.incrementLoader)(J)),F!=="loading"&&X(),F==="failed"&&(0,v.triggerLoadError)(J)},[F])};t.useImageLoader=B;const V=({image:F,status:$,type:z})=>{const K=o.default.useRef();return o.default.useEffect(()=>{K.current=F||K.current},[F]),$!=="failed"||$!=="failed"&&z==="svg"?K.current:void 0},Y=F=>{const[$,z]=o.default.useReducer(J=>J+1,0),K=o.default.useRef("loading"),X=o.default.useRef(F.src),Q=o.default.useRef(F.src);return Q.current!==F.src&&(Q.current=F.src,K.current="loading"),o.default.useEffect(()=>{if(F.type!=="svg"||!F.src)return;let J=!1;return(async()=>{K.current="loading",z();const ne=await O.urlToString(F.src),ie=O.fixSize(ne),oe=O.replaceColors(ie,F.colorsReplace);J||(X.current=oe,K.current="loaded",z())})(),()=>{J=!0}},[F.src,JSON.stringify(F.colorsReplace)]),F.type!=="svg"?[F.src,"loaded"]:[X.current,K.current]};t.ImageElement=(0,a.observer)(({element:F,store:$})=>{var z;const[K,X]=o.default.useState(!1),Q=o.default.useRef(null),J=o.default.useRef(null),[ne,ie]=o.default.useState(!1),oe=$.selectedShapes.indexOf(F)>=0,[de,me]=Y(F),[Pe,re]=M(de,"anonymous"),ae=F.type!=="svg"||me==="loaded"?re:"loading";(0,t.useImageLoader)(ae,F.src,F.id);const we=F.page._exportingOrRendering?1:Math.max(1,$.scale),be=$._elementsPixelRatio*we,te=V({image:Pe,status:re,type:F.type}),fe=S(F,Pe||te,be),he=N(F,fe)||W;let{cropX:Ee,cropY:Ve,cropWidth:Je,cropHeight:Ae}=F;re!=="loaded"&&(Ee=Ve=0,Je=Ae=1);const Ce=he.width*Je,Me=he.height*Ae,ze=F.a.width/F.a.height;let We,St;const mt=Ce/Me,ue=F.type==="svg";ue?(We=Ce,St=Me):ze>=mt?(We=Ce,St=Ce/ze):(We=Me*ze,St=Me);const ce={x:he.width*Ee,y:he.height*Ve,width:We,height:St},Se=(z=F.cornerRadius)!==null&&z!==void 0?z:0,Le=F.page._exportingOrRendering?1:Math.min(2,$.scale),Ne=$._elementsPixelRatio*Le;let ge=Z(F,G(F,he,ce,Ne,Se,K||F._cropModeEnabled||F.type==="svg",!0),Ne,[ce,Se,Ne]);const Xe=Math.max(F.a.width/We,F.a.height/St);o.default.useEffect(()=>{var Ie;if(!F._cropModeEnabled)return;const et=(Ie=Q.current)===null||Ie===void 0?void 0:Ie.getStage();function ft(Pt){F._cropModeEnabled&&Pt.target!==J.current&&F.toggleCropMode(!1)}function Ft(Pt){F._cropModeEnabled&&Pt.target.parentNode!==et.content&&F.toggleCropMode(!1)}return document.body.addEventListener("click",Ft),et==null||et.on("click",ft),et==null||et.on("tap",ft),()=>{document.body.removeEventListener("click",Ft),document.body.removeEventListener("touchstart",Ft),et==null||et.off("click",ft),et==null||et.off("click",ft)}},[F._cropModeEnabled]),o.default.useLayoutEffect(()=>{if(!(K||F._cropModeEnabled))return(0,p.applyFilter)(Q.current,F),(0,l.autorun)(()=>{(0,p.applyFilter)(Q.current,F)},{delay:100})},[ge,F.page._exportingOrRendering,K,Je,Ae,F._cropModeEnabled]),o.default.useLayoutEffect(()=>{var Ie;K||F._cropModeEnabled?(Ie=Q.current)===null||Ie===void 0||Ie.clearCache():(0,p.applyFilter)(Q.current,F)},[K,F.a.width,F.a.height,F._cropModeEnabled]),o.default.useEffect(()=>{(0,p.applyFilter)(Q.current,F)},[F.shadowEnabled,F.shadowBlur,F.cornerRadius,F.shadowColor,F.shadowOffsetX,F.shadowOffsetY,F.shadowOpacity]);const Oe=o.default.useRef(null),$e=o.default.useRef(null),Wt=o.default.useRef(null);o.default.useLayoutEffect(()=>{F._cropModeEnabled&&($e.current.nodes([Oe.current]),Wt.current.nodes([J.current]))},[F._cropModeEnabled]);var Tt=o.default.useRef(null),Yt=o.default.useRef(0),ke=o.default.useRef(!1);const Ye=Ie=>{var et;((et=Ie.evt.touches)===null||et===void 0?void 0:et.length)>2&&Ie.target.stopDrag(),Math.round(Ie.target.x())>0&&(Ie.target.x(0),Ie.target.scaleX(1)),Math.round(Ie.target.y())>0&&(Ie.target.y(0),Ie.target.scaleY(1));const ft=Ie.target.width()*Ie.target.scaleX(),Ft=Ie.target.height()*Ie.target.scaleY(),Pt=Math.min(1,We/ft),Bn=Math.min(1,St/Ft),xn=1-Pt,tn=Math.min(xn,Math.max(0,Math.round(-Ie.target.x())/ft)),ri=1-Bn,Sr=Math.min(ri,Math.max(0,Math.round(-Ie.target.y())/Ft));Ie.target.setAttrs({x:-tn*he.width,y:-Sr*he.height,scaleX:1,scaleY:1}),F.set({cropX:tn,cropY:Sr,cropWidth:Pt,cropHeight:Bn})},at=()=>{F.type!=="svg"&&F.contentEditable&&setTimeout(()=>{F.toggleCropMode(!0)})},Ot=F.type==="svg"&&te,xt=re==="loading"&&!Ot,un=re==="failed",hn=!xt&&!un,pn=o.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),rr=hn?F.a.opacity:0;(0,y.useFadeIn)(Q,rr);const to=F.selectable||$.role==="admin",wr=(0,d.isTouchDevice)();return o.default.createElement(o.default.Fragment,null,xt&&o.default.createElement(H,{element:F}),un&&o.default.createElement(L,{element:F}),o.default.createElement(s.Image,{ref:Q,name:"element",id:F.id,image:ge,x:F.a.x,y:F.a.y,width:F.a.width||1,height:F.a.height||1,rotation:F.a.rotation,opacity:rr,shadowEnabled:F.shadowEnabled,shadowBlur:F.shadowBlur,shadowOffsetX:F.shadowOffsetX,shadowOffsetY:F.shadowOffsetY,shadowColor:F.shadowColor,shadowOpacity:F.shadowOpacity,customCrop:ce,listening:to,draggable:wr?F.draggable&&oe:F.draggable,preventDefault:!wr||oe,hideInExport:!F.showInExport,onMouseEnter:()=>{ie(!0)},onMouseLeave:()=>{ie(!1)},onDragMove:Ie=>{F.set({x:Ie.target.x(),y:Ie.target.y()})},onDragEnd:Ie=>{F.set({x:Ie.target.x(),y:Ie.target.y()})},onDblClick:at,onDblTap:at,onTransformStart:()=>{X(!0),pn.current={cropX:F.cropX,cropY:F.cropY,cropWidth:F.cropWidth,cropHeight:F.cropHeight}},onTransform:Ie=>{var et;const ft=Ie.currentTarget,Ft=Math.abs(ft.scaleX()-1)<1e-7?1:ft.scaleX(),Pt=Math.abs(ft.scaleY()-1)<1e-7?1:ft.scaleY();ft.scaleX(1),ft.scaleY(1);const Bn=(et=Ie.target.getStage())===null||et===void 0?void 0:et.findOne("Transformer"),xn=1-We/he.width,tn=Math.min(xn,Math.max(0,F.cropX)),ri=1-St/he.height,Sr=Math.min(ri,Math.max(0,F.cropY)),no=Bn.getActiveAnchor(),jo=!(no.indexOf("middle")>=0||no.indexOf("center")>=0),cu=!jo&&Ft<1&&pn.current.cropHeight>St/he.height;let Da=jo?F.cropWidth:F.cropWidth*Ft;cu&&(Da=F.cropWidth);const ro=!jo&&Pt<1&&pn.current.cropWidth>We/he.width;let Dr=jo?F.cropHeight:F.cropHeight*Pt;ro&&(Dr=F.cropHeight),ue&&(Da=F.cropWidth,Dr=F.cropHeight),F.set({cropX:tn,cropY:Sr,x:ft.x(),y:ft.y(),width:ft.width()*Ft,height:ft.height()*Pt,rotation:Ie.target.rotation(),cropWidth:Math.min(Da,1-tn),cropHeight:Math.min(Dr,1-Sr)})},onTransformEnd:Ie=>{const et=Ie.currentTarget;F.set({width:et.width(),height:et.height(),x:et.x(),y:et.y(),rotation:Ie.target.rotation(),cropWidth:We/he.width,cropHeight:St/he.height}),X(!1)}}),o.default.createElement(s.Rect,{x:F.x,y:F.y,width:Math.max(F.a.width-F.borderSize,0),height:Math.max(F.a.height-F.borderSize,0),opacity:rr,offsetX:-F.borderSize/2,offsetY:-F.borderSize/2,stroke:F.borderColor,strokeWidth:F.borderSize,listening:!1,visible:!!F.borderSize,rotation:F.rotation,cornerRadius:Math.max(0,Se-F.borderSize),hideInExport:!F.showInExport}),F._cropModeEnabled&&o.default.createElement(x.Portal,{selector:".page-abs-container",enabled:!0},o.default.createElement(s.Rect,{x:-window.innerWidth/$.scale,y:-window.innerWidth/$.scale,width:window.innerWidth/$.scale*3,height:window.innerWidth/$.scale*3,fill:"rgba(0,0,0,0.3)"}),o.default.createElement(s.Image,{listening:!1,image:ge,x:F.x,y:F.y,width:F.a.width,height:F.a.height,rotation:F.rotation,shadowEnabled:F.shadowEnabled,shadowBlur:F.shadowBlur}),o.default.createElement(s.Group,{x:F.x,y:F.y,rotation:F.rotation,scaleX:Xe,scaleY:Xe},o.default.createElement(s.Image,{image:he,ref:J,opacity:.4,draggable:!0,x:-F.cropX*he.width,y:-F.cropY*he.height,onDragMove:Ye,onTransform:Ye,onTouchMove:Ie=>{Ie.evt.preventDefault();const et=Ie.target.getStage().getPointersPositions();var ft=et[0],Ft=et[1];const Pt=Ie.target;if(ft&&!Ft&&!Pt.isDragging()&&ke.current&&(Pt.startDrag(),ke.current=!1),ft&&Ft){h.default.hitOnDragEnabled=!0,Pt.isDragging()&&(ke.current=!0,Pt.stopDrag());const ro=Ie.target.getAbsoluteTransform().copy();ro.invert();var Bn={x:ft.x,y:ft.y},xn={x:Ft.x,y:Ft.y};if(!Tt.current)return void(Tt.current=R(Bn,xn));var tn=R(Bn,xn),ri=C(Bn,xn);Yt.current||(Yt.current=ri);const Dr=Pt.position();var Sr={x:tn.x-Dr.x,y:tn.y-Dr.y},no=ri/Yt.current;Pt.scaleX(no),Pt.scaleY(no);const Nl=ro.point(tn),Il=ro.point(Tt.current);var jo=Nl.x-Il.x,cu=Nl.y-Il.y,Da={x:Math.min(0,tn.x-Sr.x*no+jo),y:Math.min(0,tn.y-Sr.y*no+cu)};Pt.position(Da),Yt.current=ri,Tt.current=tn,Ye(Ie)}},onTouchEnd:Ie=>{Yt.current=0,Tt.current=null,h.default.hitOnDragEnabled=!1}}),o.default.createElement(s.Transformer,{ref:Wt,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ie,et)=>et.width<5||et.height<5?Ie:et,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),o.default.createElement(s.Rect,{width:We,height:St,ref:Oe,listening:!1,onTransform:Ie=>{Ie.target.x()<-F.cropX*he.width-1e-9&&(Ie.target.x(-F.cropX*he.width),Ie.target.scaleX(1)),Ie.target.y()<-F.cropY*he.height-1e-9&&(Ie.target.y(-F.cropY*he.height),Ie.target.scaleY(1));const et=Math.min(1,Math.max(0,F.cropX+Ie.target.x()/he.width)),ft=Math.min(1,Math.max(0,Ie.target.y()/he.height+F.cropY)),Ft=Ie.target.width()*Ie.target.scaleX(),Pt=Ie.target.height()*Ie.target.scaleY(),Bn=Math.min(1-et,Ft/he.width),xn=Math.min(1-ft,Pt/he.height),tn=Ie.target.getAbsolutePosition(Ie.target.getParent().getParent());Ie.target.scale({x:1,y:1}),Ie.target.position({x:0,y:0}),F.set({x:tn.x,y:tn.y,cropX:et,cropY:ft,cropWidth:Bn,cropHeight:xn,width:Math.min(Ft*Xe,he.width*(1-et)*Xe),height:Math.min(Pt*Xe,he.height*(1-ft)*Xe)})}}),o.default.createElement(s.Transformer,{ref:$e,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ie,et)=>et.width<5||et.height<5?Ie:et,visible:F.resizable,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),(ne||oe)&&o.default.createElement(w.Highlighter,{element:F}))})})(d2);var iS={},oS={exports:{}};/*!
|
|
109
109
|
* Quill Editor v1.3.7
|
|
110
110
|
* https://quilljs.com/
|
|
111
111
|
* Copyright (c) 2014, Jason Chen
|
|
@@ -125,34 +125,34 @@ For more info see: https://github.com/konvajs/react-konva/issues/194
|
|
|
125
125
|
`)||this.appendChild(x.default.create("text",`
|
|
126
126
|
`)),l(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"optimize",this).call(this,P);var T=this.next;T!=null&&T.prev===this&&T.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===T.statics.formats(T.domNode)&&(T.optimize(P),T.moveChildren(this),T.remove())}},{key:"replace",value:function(P){l(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"replace",this).call(this,P),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(T){var N=x.default.find(T);N==null?T.parentNode.removeChild(T):N instanceof x.default.Embed?N.remove():N.unwrap()})}}],[{key:"create",value:function(P){var T=l(S.__proto__||Object.getPrototypeOf(S),"create",this).call(this,P);return T.setAttribute("spellcheck",!1),T}},{key:"formats",value:function(){return!0}}]),S}(v.default);C.blotName="code-block",C.tagName="PRE",C.TAB=" ",r.Code=A,r.default=C},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(L){return typeof L}:function(L){return L&&typeof Symbol=="function"&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L},a=function(){function L(M,D){var B=[],V=!0,Y=!1,F=void 0;try{for(var $=M[Symbol.iterator](),z;!(V=(z=$.next()).done)&&(B.push(z.value),!(D&&B.length===D));V=!0);}catch(K){Y=!0,F=K}finally{try{!V&&$.return&&$.return()}finally{if(Y)throw F}}return B}return function(M,D){if(Array.isArray(M))return M;if(Symbol.iterator in Object(M))return L(M,D);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function L(M,D){for(var B=0;B<D.length;B++){var V=D[B];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),Object.defineProperty(M,V.key,V)}}return function(M,D,B){return D&&L(M.prototype,D),B&&L(M,B),M}}(),s=i(2),f=T(s),h=i(20),x=T(h),w=i(0),v=T(w),O=i(13),g=T(O),b=i(24),p=T(b),y=i(4),d=T(y),m=i(16),_=T(m),A=i(21),C=T(A),R=i(11),S=T(R),E=i(3),P=T(E);function T(L){return L&&L.__esModule?L:{default:L}}function N(L,M,D){return M in L?Object.defineProperty(L,M,{value:D,enumerable:!0,configurable:!0,writable:!0}):L[M]=D,L}function U(L,M){if(!(L instanceof M))throw new TypeError("Cannot call a class as a function")}var G=/^[ -~]*$/,Z=function(){function L(M){U(this,L),this.scroll=M,this.delta=this.getDelta()}return l(L,[{key:"applyDelta",value:function(D){var B=this,V=!1;this.scroll.update();var Y=this.scroll.length();return this.scroll.batchStart(),D=H(D),D.reduce(function(F,$){var z=$.retain||$.delete||$.insert.length||1,K=$.attributes||{};if($.insert!=null){if(typeof $.insert=="string"){var X=$.insert;X.endsWith(`
|
|
127
127
|
`)&&V&&(V=!1,X=X.slice(0,-1)),F>=Y&&!X.endsWith(`
|
|
128
|
-
`)&&(V=!0),B.scroll.insertAt(F,X);var Q=B.scroll.line(F),J=a(Q,2),ne=J[0],ie=J[1],oe=(0,P.default)({},(0,y.bubbleFormats)(ne));if(ne instanceof d.default){var
|
|
128
|
+
`)&&(V=!0),B.scroll.insertAt(F,X);var Q=B.scroll.line(F),J=a(Q,2),ne=J[0],ie=J[1],oe=(0,P.default)({},(0,y.bubbleFormats)(ne));if(ne instanceof d.default){var de=ne.descendant(v.default.Leaf,ie),me=a(de,1),Pe=me[0];oe=(0,P.default)(oe,(0,y.bubbleFormats)(Pe))}K=x.default.attributes.diff(oe,K)||{}}else if(o($.insert)==="object"){var re=Object.keys($.insert)[0];if(re==null)return F;B.scroll.insertAt(F,re,$.insert[re])}Y+=z}return Object.keys(K).forEach(function(ae){B.scroll.formatAt(F,z,ae,K[ae])}),F+z},0),D.reduce(function(F,$){return typeof $.delete=="number"?(B.scroll.deleteAt(F,$.delete),F):F+($.retain||$.insert.length||1)},0),this.scroll.batchEnd(),this.update(D)}},{key:"deleteText",value:function(D,B){return this.scroll.deleteAt(D,B),this.update(new f.default().retain(D).delete(B))}},{key:"formatLine",value:function(D,B){var V=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(Y).forEach(function(F){if(!(V.scroll.whitelist!=null&&!V.scroll.whitelist[F])){var $=V.scroll.lines(D,Math.max(B,1)),z=B;$.forEach(function(K){var X=K.length();if(!(K instanceof g.default))K.format(F,Y[F]);else{var Q=D-K.offset(V.scroll),J=K.newlineIndex(Q+z)-Q+1;K.formatAt(Q,J,F,Y[F])}z-=X})}}),this.scroll.optimize(),this.update(new f.default().retain(D).retain(B,(0,C.default)(Y)))}},{key:"formatText",value:function(D,B){var V=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(Y).forEach(function(F){V.scroll.formatAt(D,B,F,Y[F])}),this.update(new f.default().retain(D).retain(B,(0,C.default)(Y)))}},{key:"getContents",value:function(D,B){return this.delta.slice(D,D+B)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(D,B){return D.concat(B.delta())},new f.default)}},{key:"getFormat",value:function(D){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,V=[],Y=[];B===0?this.scroll.path(D).forEach(function($){var z=a($,1),K=z[0];K instanceof d.default?V.push(K):K instanceof v.default.Leaf&&Y.push(K)}):(V=this.scroll.lines(D,B),Y=this.scroll.descendants(v.default.Leaf,D,B));var F=[V,Y].map(function($){if($.length===0)return{};for(var z=(0,y.bubbleFormats)($.shift());Object.keys(z).length>0;){var K=$.shift();if(K==null)return z;z=W((0,y.bubbleFormats)(K),z)}return z});return P.default.apply(P.default,F)}},{key:"getText",value:function(D,B){return this.getContents(D,B).filter(function(V){return typeof V.insert=="string"}).map(function(V){return V.insert}).join("")}},{key:"insertEmbed",value:function(D,B,V){return this.scroll.insertAt(D,B,V),this.update(new f.default().retain(D).insert(N({},B,V)))}},{key:"insertText",value:function(D,B){var V=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return B=B.replace(/\r\n/g,`
|
|
129
129
|
`).replace(/\r/g,`
|
|
130
130
|
`),this.scroll.insertAt(D,B),Object.keys(Y).forEach(function(F){V.scroll.formatAt(D,B.length,F,Y[F])}),this.update(new f.default().retain(D).insert(B,(0,C.default)(Y)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var D=this.scroll.children.head;return D.statics.blotName!==d.default.blotName||D.children.length>1?!1:D.children.head instanceof _.default}},{key:"removeFormat",value:function(D,B){var V=this.getText(D,B),Y=this.scroll.line(D+B),F=a(Y,2),$=F[0],z=F[1],K=0,X=new f.default;$!=null&&($ instanceof g.default?K=$.newlineIndex(z)-z+1:K=$.length()-z,X=$.delta().slice(z,z+K-1).insert(`
|
|
131
131
|
`));var Q=this.getContents(D,B+K),J=Q.diff(new f.default().insert(V).concat(X)),ne=new f.default().retain(D).concat(J);return this.applyDelta(ne)}},{key:"update",value:function(D){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],V=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,Y=this.delta;if(B.length===1&&B[0].type==="characterData"&&B[0].target.data.match(G)&&v.default.find(B[0].target)){var F=v.default.find(B[0].target),$=(0,y.bubbleFormats)(F),z=F.offset(this.scroll),K=B[0].oldValue.replace(p.default.CONTENTS,""),X=new f.default().insert(K),Q=new f.default().insert(F.value()),J=new f.default().retain(z).concat(X.diff(Q,V));D=J.reduce(function(ne,ie){return ie.insert?ne.insert(ie.insert,$):ne.push(ie)},new f.default),this.delta=Y.compose(D)}else this.delta=this.getDelta(),(!D||!(0,S.default)(Y.compose(D),this.delta))&&(D=Y.diff(this.delta,V));return D}}]),L}();function W(L,M){return Object.keys(M).reduce(function(D,B){return L[B]==null||(M[B]===L[B]?D[B]=M[B]:Array.isArray(M[B])?M[B].indexOf(L[B])<0&&(D[B]=M[B].concat([L[B]])):D[B]=[M[B],L[B]]),D},{})}function H(L){return L.reduce(function(M,D){if(D.insert===1){var B=(0,C.default)(D.attributes);return delete B.image,M.insert({image:D.attributes.image},B)}if(D.attributes!=null&&(D.attributes.list===!0||D.attributes.bullet===!0)&&(D=(0,C.default)(D),D.attributes.list?D.attributes.list="ordered":(D.attributes.list="bullet",delete D.attributes.bullet)),typeof D.insert=="string"){var V=D.insert.replace(/\r\n/g,`
|
|
132
132
|
`).replace(/\r/g,`
|
|
133
133
|
`);return M.insert(V,D.attributes)}return M.push(D)},new f.default)}r.default=Z},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.Range=void 0;var o=function(){function R(S,E){var P=[],T=!0,N=!1,U=void 0;try{for(var G=S[Symbol.iterator](),Z;!(T=(Z=G.next()).done)&&(P.push(Z.value),!(E&&P.length===E));T=!0);}catch(W){N=!0,U=W}finally{try{!T&&G.return&&G.return()}finally{if(N)throw U}}return P}return function(S,E){if(Array.isArray(S))return S;if(Symbol.iterator in Object(S))return R(S,E);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function R(S,E){for(var P=0;P<E.length;P++){var T=E[P];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(S,T.key,T)}}return function(S,E,P){return E&&R(S.prototype,E),P&&R(S,P),S}}(),l=i(0),s=p(l),f=i(21),h=p(f),x=i(11),w=p(x),v=i(8),O=p(v),g=i(10),b=p(g);function p(R){return R&&R.__esModule?R:{default:R}}function y(R){if(Array.isArray(R)){for(var S=0,E=Array(R.length);S<R.length;S++)E[S]=R[S];return E}else return Array.from(R)}function d(R,S){if(!(R instanceof S))throw new TypeError("Cannot call a class as a function")}var m=(0,b.default)("quill:selection"),_=function R(S){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;d(this,R),this.index=S,this.length=E},A=function(){function R(S,E){var P=this;d(this,R),this.emitter=E,this.scroll=S,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=s.default.create("cursor",this),this.lastRange=this.savedRange=new _(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){P.mouseDown||setTimeout(P.update.bind(P,O.default.sources.USER),1)}),this.emitter.on(O.default.events.EDITOR_CHANGE,function(T,N){T===O.default.events.TEXT_CHANGE&&N.length()>0&&P.update(O.default.sources.SILENT)}),this.emitter.on(O.default.events.SCROLL_BEFORE_UPDATE,function(){if(P.hasFocus()){var T=P.getNativeRange();T!=null&&T.start.node!==P.cursor.textNode&&P.emitter.once(O.default.events.SCROLL_UPDATE,function(){try{P.setNativeRange(T.start.node,T.start.offset,T.end.node,T.end.offset)}catch{}})}}),this.emitter.on(O.default.events.SCROLL_OPTIMIZE,function(T,N){if(N.range){var U=N.range,G=U.startNode,Z=U.startOffset,W=U.endNode,H=U.endOffset;P.setNativeRange(G,Z,W,H)}}),this.update(O.default.sources.SILENT)}return a(R,[{key:"handleComposition",value:function(){var E=this;this.root.addEventListener("compositionstart",function(){E.composing=!0}),this.root.addEventListener("compositionend",function(){if(E.composing=!1,E.cursor.parent){var P=E.cursor.restore();if(!P)return;setTimeout(function(){E.setNativeRange(P.startNode,P.startOffset,P.endNode,P.endOffset)},1)}})}},{key:"handleDragging",value:function(){var E=this;this.emitter.listenDOM("mousedown",document.body,function(){E.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){E.mouseDown=!1,E.update(O.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(E,P){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[E])){this.scroll.update();var T=this.getNativeRange();if(!(T==null||!T.native.collapsed||s.default.query(E,s.default.Scope.BLOCK))){if(T.start.node!==this.cursor.textNode){var N=s.default.find(T.start.node,!1);if(N==null)return;if(N instanceof s.default.Leaf){var U=N.split(T.start.offset);N.parent.insertBefore(this.cursor,U)}else N.insertBefore(this.cursor,T.start.node);this.cursor.attach()}this.cursor.format(E,P),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(E){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,T=this.scroll.length();E=Math.min(E,T-1),P=Math.min(E+P,T-1)-E;var N=void 0,U=this.scroll.leaf(E),G=o(U,2),Z=G[0],W=G[1];if(Z==null)return null;var H=Z.position(W,!0),L=o(H,2);N=L[0],W=L[1];var M=document.createRange();if(P>0){M.setStart(N,W);var D=this.scroll.leaf(E+P),B=o(D,2);if(Z=B[0],W=B[1],Z==null)return null;var V=Z.position(W,!0),Y=o(V,2);return N=Y[0],W=Y[1],M.setEnd(N,W),M.getBoundingClientRect()}else{var F="left",$=void 0;return N instanceof Text?(W<N.data.length?(M.setStart(N,W),M.setEnd(N,W+1)):(M.setStart(N,W-1),M.setEnd(N,W),F="right"),$=M.getBoundingClientRect()):($=Z.domNode.getBoundingClientRect(),W>0&&(F="right")),{bottom:$.top+$.height,height:$.height,left:$[F],right:$[F],top:$.top,width:0}}}},{key:"getNativeRange",value:function(){var E=document.getSelection();if(E==null||E.rangeCount<=0)return null;var P=E.getRangeAt(0);if(P==null)return null;var T=this.normalizeNative(P);return m.info("getNativeRange",T),T}},{key:"getRange",value:function(){var E=this.getNativeRange();if(E==null)return[null,null];var P=this.normalizedToRange(E);return[P,E]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(E){var P=this,T=[[E.start.node,E.start.offset]];E.native.collapsed||T.push([E.end.node,E.end.offset]);var N=T.map(function(Z){var W=o(Z,2),H=W[0],L=W[1],M=s.default.find(H,!0),D=M.offset(P.scroll);return L===0?D:M instanceof s.default.Container?D+M.length():D+M.index(H,L)}),U=Math.min(Math.max.apply(Math,y(N)),this.scroll.length()-1),G=Math.min.apply(Math,[U].concat(y(N)));return new _(G,U-G)}},{key:"normalizeNative",value:function(E){if(!C(this.root,E.startContainer)||!E.collapsed&&!C(this.root,E.endContainer))return null;var P={start:{node:E.startContainer,offset:E.startOffset},end:{node:E.endContainer,offset:E.endOffset},native:E};return[P.start,P.end].forEach(function(T){for(var N=T.node,U=T.offset;!(N instanceof Text)&&N.childNodes.length>0;)if(N.childNodes.length>U)N=N.childNodes[U],U=0;else if(N.childNodes.length===U)N=N.lastChild,U=N instanceof Text?N.data.length:N.childNodes.length+1;else break;T.node=N,T.offset=U}),P}},{key:"rangeToNative",value:function(E){var P=this,T=E.collapsed?[E.index]:[E.index,E.index+E.length],N=[],U=this.scroll.length();return T.forEach(function(G,Z){G=Math.min(U-1,G);var W=void 0,H=P.scroll.leaf(G),L=o(H,2),M=L[0],D=L[1],B=M.position(D,Z!==0),V=o(B,2);W=V[0],D=V[1],N.push(W,D)}),N.length<2&&(N=N.concat(N)),N}},{key:"scrollIntoView",value:function(E){var P=this.lastRange;if(P!=null){var T=this.getBounds(P.index,P.length);if(T!=null){var N=this.scroll.length()-1,U=this.scroll.line(Math.min(P.index,N)),G=o(U,1),Z=G[0],W=Z;if(P.length>0){var H=this.scroll.line(Math.min(P.index+P.length,N)),L=o(H,1);W=L[0]}if(!(Z==null||W==null)){var M=E.getBoundingClientRect();T.top<M.top?E.scrollTop-=M.top-T.top:T.bottom>M.bottom&&(E.scrollTop+=T.bottom-M.bottom)}}}}},{key:"setNativeRange",value:function(E,P){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:E,N=arguments.length>3&&arguments[3]!==void 0?arguments[3]:P,U=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(m.info("setNativeRange",E,P,T,N),!(E!=null&&(this.root.parentNode==null||E.parentNode==null||T.parentNode==null))){var G=document.getSelection();if(G!=null)if(E!=null){this.hasFocus()||this.root.focus();var Z=(this.getNativeRange()||{}).native;if(Z==null||U||E!==Z.startContainer||P!==Z.startOffset||T!==Z.endContainer||N!==Z.endOffset){E.tagName=="BR"&&(P=[].indexOf.call(E.parentNode.childNodes,E),E=E.parentNode),T.tagName=="BR"&&(N=[].indexOf.call(T.parentNode.childNodes,T),T=T.parentNode);var W=document.createRange();W.setStart(E,P),W.setEnd(T,N),G.removeAllRanges(),G.addRange(W)}}else G.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(E){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:O.default.sources.API;if(typeof P=="string"&&(T=P,P=!1),m.info("setRange",E),E!=null){var N=this.rangeToNative(E);this.setNativeRange.apply(this,y(N).concat([P]))}else this.setNativeRange(null);this.update(T)}},{key:"update",value:function(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:O.default.sources.USER,P=this.lastRange,T=this.getRange(),N=o(T,2),U=N[0],G=N[1];if(this.lastRange=U,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,w.default)(P,this.lastRange)){var Z;!this.composing&&G!=null&&G.native.collapsed&&G.start.node!==this.cursor.textNode&&this.cursor.restore();var W=[O.default.events.SELECTION_CHANGE,(0,h.default)(this.lastRange),(0,h.default)(P),E];if((Z=this.emitter).emit.apply(Z,[O.default.events.EDITOR_CHANGE].concat(W)),E!==O.default.sources.SILENT){var H;(H=this.emitter).emit.apply(H,W)}}}}]),R}();function C(R,S){try{S.parentNode}catch{return!1}return S instanceof Text&&(S=S.parentNode),R.contains(S)}r.Range=_,r.default=A},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function O(g,b){for(var p=0;p<b.length;p++){var y=b[p];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(g,y.key,y)}}return function(g,b,p){return b&&O(g.prototype,b),p&&O(g,p),g}}(),a=function O(g,b,p){g===null&&(g=Function.prototype);var y=Object.getOwnPropertyDescriptor(g,b);if(y===void 0){var d=Object.getPrototypeOf(g);return d===null?void 0:O(d,b,p)}else{if("value"in y)return y.value;var m=y.get;return m===void 0?void 0:m.call(p)}},l=i(0),s=f(l);function f(O){return O&&O.__esModule?O:{default:O}}function h(O,g){if(!(O instanceof g))throw new TypeError("Cannot call a class as a function")}function x(O,g){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:O}function w(O,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);O.prototype=Object.create(g&&g.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(O,g):O.__proto__=g)}var v=function(O){w(g,O);function g(){return h(this,g),x(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return o(g,[{key:"insertInto",value:function(p,y){p.children.length===0?a(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"insertInto",this).call(this,p,y):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),g}(s.default.Embed);v.blotName="break",v.tagName="BR",r.default=v},function(n,r,i){var o=this&&this.__extends||function(){var x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,v){w.__proto__=v}||function(w,v){for(var O in v)v.hasOwnProperty(O)&&(w[O]=v[O])};return function(w,v){x(w,v);function O(){this.constructor=w}w.prototype=v===null?Object.create(v):(O.prototype=v.prototype,new O)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=i(44),l=i(30),s=i(1),f=function(x){o(w,x);function w(v){var O=x.call(this,v)||this;return O.build(),O}return w.prototype.appendChild=function(v){this.insertBefore(v)},w.prototype.attach=function(){x.prototype.attach.call(this),this.children.forEach(function(v){v.attach()})},w.prototype.build=function(){var v=this;this.children=new a.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(O){try{var g=h(O);v.insertBefore(g,v.children.head||void 0)}catch(b){if(b instanceof s.ParchmentError)return;throw b}})},w.prototype.deleteAt=function(v,O){if(v===0&&O===this.length())return this.remove();this.children.forEachAt(v,O,function(g,b,p){g.deleteAt(b,p)})},w.prototype.descendant=function(v,O){var g=this.children.find(O),b=g[0],p=g[1];return v.blotName==null&&v(b)||v.blotName!=null&&b instanceof v?[b,p]:b instanceof w?b.descendant(v,p):[null,-1]},w.prototype.descendants=function(v,O,g){O===void 0&&(O=0),g===void 0&&(g=Number.MAX_VALUE);var b=[],p=g;return this.children.forEachAt(O,g,function(y,d,m){(v.blotName==null&&v(y)||v.blotName!=null&&y instanceof v)&&b.push(y),y instanceof w&&(b=b.concat(y.descendants(v,d,p))),p-=m}),b},w.prototype.detach=function(){this.children.forEach(function(v){v.detach()}),x.prototype.detach.call(this)},w.prototype.formatAt=function(v,O,g,b){this.children.forEachAt(v,O,function(p,y,d){p.formatAt(y,d,g,b)})},w.prototype.insertAt=function(v,O,g){var b=this.children.find(v),p=b[0],y=b[1];if(p)p.insertAt(y,O,g);else{var d=g==null?s.create("text",O):s.create(O,g);this.appendChild(d)}},w.prototype.insertBefore=function(v,O){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(g){return v instanceof g}))throw new s.ParchmentError("Cannot insert "+v.statics.blotName+" into "+this.statics.blotName);v.insertInto(this,O)},w.prototype.length=function(){return this.children.reduce(function(v,O){return v+O.length()},0)},w.prototype.moveChildren=function(v,O){this.children.forEach(function(g){v.insertBefore(g,O)})},w.prototype.optimize=function(v){if(x.prototype.optimize.call(this,v),this.children.length===0)if(this.statics.defaultChild!=null){var O=s.create(this.statics.defaultChild);this.appendChild(O),O.optimize(v)}else this.remove()},w.prototype.path=function(v,O){O===void 0&&(O=!1);var g=this.children.find(v,O),b=g[0],p=g[1],y=[[this,v]];return b instanceof w?y.concat(b.path(p,O)):(b!=null&&y.push([b,p]),y)},w.prototype.removeChild=function(v){this.children.remove(v)},w.prototype.replace=function(v){v instanceof w&&v.moveChildren(this),x.prototype.replace.call(this,v)},w.prototype.split=function(v,O){if(O===void 0&&(O=!1),!O){if(v===0)return this;if(v===this.length())return this.next}var g=this.clone();return this.parent.insertBefore(g,this.next),this.children.forEachAt(v,this.length(),function(b,p,y){b=b.split(p,O),g.appendChild(b)}),g},w.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},w.prototype.update=function(v,O){var g=this,b=[],p=[];v.forEach(function(y){y.target===g.domNode&&y.type==="childList"&&(b.push.apply(b,y.addedNodes),p.push.apply(p,y.removedNodes))}),p.forEach(function(y){if(!(y.parentNode!=null&&y.tagName!=="IFRAME"&&document.body.compareDocumentPosition(y)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var d=s.find(y);d!=null&&(d.domNode.parentNode==null||d.domNode.parentNode===g.domNode)&&d.detach()}}),b.filter(function(y){return y.parentNode==g.domNode}).sort(function(y,d){return y===d?0:y.compareDocumentPosition(d)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(y){var d=null;y.nextSibling!=null&&(d=s.find(y.nextSibling));var m=h(y);(m.next!=d||m.next==null)&&(m.parent!=null&&m.parent.removeChild(g),g.insertBefore(m,d||void 0))})},w}(l.default);function h(x){var w=s.find(x);if(w==null)try{w=s.create(x)}catch{w=s.create(s.Scope.INLINE),[].slice.call(x.childNodes).forEach(function(O){w.domNode.appendChild(O)}),x.parentNode&&x.parentNode.replaceChild(w.domNode,x),w.attach()}return w}r.default=f},function(n,r,i){var o=this&&this.__extends||function(){var x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,v){w.__proto__=v}||function(w,v){for(var O in v)v.hasOwnProperty(O)&&(w[O]=v[O])};return function(w,v){x(w,v);function O(){this.constructor=w}w.prototype=v===null?Object.create(v):(O.prototype=v.prototype,new O)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=i(12),l=i(31),s=i(17),f=i(1),h=function(x){o(w,x);function w(v){var O=x.call(this,v)||this;return O.attributes=new l.default(O.domNode),O}return w.formats=function(v){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return v.tagName.toLowerCase()},w.prototype.format=function(v,O){var g=f.query(v);g instanceof a.default?this.attributes.attribute(g,O):O&&g!=null&&(v!==this.statics.blotName||this.formats()[v]!==O)&&this.replaceWith(v,O)},w.prototype.formats=function(){var v=this.attributes.values(),O=this.statics.formats(this.domNode);return O!=null&&(v[this.statics.blotName]=O),v},w.prototype.replaceWith=function(v,O){var g=x.prototype.replaceWith.call(this,v,O);return this.attributes.copy(g),g},w.prototype.update=function(v,O){var g=this;x.prototype.update.call(this,v,O),v.some(function(b){return b.target===g.domNode&&b.type==="attributes"})&&this.attributes.build()},w.prototype.wrap=function(v,O){var g=x.prototype.wrap.call(this,v,O);return g instanceof w&&g.statics.scope===this.statics.scope&&this.attributes.move(g),g},w}(s.default);r.default=h},function(n,r,i){var o=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,x){h.__proto__=x}||function(h,x){for(var w in x)x.hasOwnProperty(w)&&(h[w]=x[w])};return function(h,x){f(h,x);function w(){this.constructor=h}h.prototype=x===null?Object.create(x):(w.prototype=x.prototype,new w)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=i(30),l=i(1),s=function(f){o(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.value=function(x){return!0},h.prototype.index=function(x,w){return this.domNode===x||this.domNode.compareDocumentPosition(x)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(w,1):-1},h.prototype.position=function(x,w){var v=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return x>0&&(v+=1),[this.parent.domNode,v]},h.prototype.value=function(){var x;return x={},x[this.statics.blotName]=this.statics.value(this.domNode)||!0,x},h.scope=l.Scope.INLINE_BLOT,h}(a.default);r.default=s},function(n,r,i){var o=i(11),a=i(3),l={attributes:{compose:function(f,h,x){typeof f!="object"&&(f={}),typeof h!="object"&&(h={});var w=a(!0,{},h);x||(w=Object.keys(w).reduce(function(O,g){return w[g]!=null&&(O[g]=w[g]),O},{}));for(var v in f)f[v]!==void 0&&h[v]===void 0&&(w[v]=f[v]);return Object.keys(w).length>0?w:void 0},diff:function(f,h){typeof f!="object"&&(f={}),typeof h!="object"&&(h={});var x=Object.keys(f).concat(Object.keys(h)).reduce(function(w,v){return o(f[v],h[v])||(w[v]=h[v]===void 0?null:h[v]),w},{});return Object.keys(x).length>0?x:void 0},transform:function(f,h,x){if(typeof f!="object")return h;if(typeof h=="object"){if(!x)return h;var w=Object.keys(h).reduce(function(v,O){return f[O]===void 0&&(v[O]=h[O]),v},{});return Object.keys(w).length>0?w:void 0}}},iterator:function(f){return new s(f)},length:function(f){return typeof f.delete=="number"?f.delete:typeof f.retain=="number"?f.retain:typeof f.insert=="string"?f.insert.length:1}};function s(f){this.ops=f,this.index=0,this.offset=0}s.prototype.hasNext=function(){return this.peekLength()<1/0},s.prototype.next=function(f){f||(f=1/0);var h=this.ops[this.index];if(h){var x=this.offset,w=l.length(h);if(f>=w-x?(f=w-x,this.index+=1,this.offset=0):this.offset+=f,typeof h.delete=="number")return{delete:f};var v={};return h.attributes&&(v.attributes=h.attributes),typeof h.retain=="number"?v.retain=f:typeof h.insert=="string"?v.insert=h.insert.substr(x,f):v.insert=h.insert,v}else return{retain:1/0}},s.prototype.peek=function(){return this.ops[this.index]},s.prototype.peekLength=function(){return this.ops[this.index]?l.length(this.ops[this.index])-this.offset:1/0},s.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},s.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var f=this.offset,h=this.index,x=this.next(),w=this.ops.slice(this.index);return this.offset=f,this.index=h,[x].concat(w)}else return[]},n.exports=l},function(n,r){var i=function(){function o(g,b){return b!=null&&g instanceof b}var a;try{a=Map}catch{a=function(){}}var l;try{l=Set}catch{l=function(){}}var s;try{s=Promise}catch{s=function(){}}function f(g,b,p,y,d){typeof b=="object"&&(p=b.depth,y=b.prototype,d=b.includeNonEnumerable,b=b.circular);var m=[],_=[],A=typeof Buffer<"u";typeof b>"u"&&(b=!0),typeof p>"u"&&(p=1/0);function C(R,S){if(R===null)return null;if(S===0)return R;var E,P;if(typeof R!="object")return R;if(o(R,a))E=new a;else if(o(R,l))E=new l;else if(o(R,s))E=new s(function(M,D){R.then(function(B){M(C(B,S-1))},function(B){D(C(B,S-1))})});else if(f.__isArray(R))E=[];else if(f.__isRegExp(R))E=new RegExp(R.source,O(R)),R.lastIndex&&(E.lastIndex=R.lastIndex);else if(f.__isDate(R))E=new Date(R.getTime());else{if(A&&Buffer.isBuffer(R))return Buffer.allocUnsafe?E=Buffer.allocUnsafe(R.length):E=new Buffer(R.length),R.copy(E),E;o(R,Error)?E=Object.create(R):typeof y>"u"?(P=Object.getPrototypeOf(R),E=Object.create(P)):(E=Object.create(y),P=y)}if(b){var T=m.indexOf(R);if(T!=-1)return _[T];m.push(R),_.push(E)}o(R,a)&&R.forEach(function(M,D){var B=C(D,S-1),V=C(M,S-1);E.set(B,V)}),o(R,l)&&R.forEach(function(M){var D=C(M,S-1);E.add(D)});for(var N in R){var U;P&&(U=Object.getOwnPropertyDescriptor(P,N)),!(U&&U.set==null)&&(E[N]=C(R[N],S-1))}if(Object.getOwnPropertySymbols)for(var G=Object.getOwnPropertySymbols(R),N=0;N<G.length;N++){var Z=G[N],W=Object.getOwnPropertyDescriptor(R,Z);W&&!W.enumerable&&!d||(E[Z]=C(R[Z],S-1),W.enumerable||Object.defineProperty(E,Z,{enumerable:!1}))}if(d)for(var H=Object.getOwnPropertyNames(R),N=0;N<H.length;N++){var L=H[N],W=Object.getOwnPropertyDescriptor(R,L);W&&W.enumerable||(E[L]=C(R[L],S-1),Object.defineProperty(E,L,{enumerable:!1}))}return E}return C(g,p)}f.clonePrototype=function(b){if(b===null)return null;var p=function(){};return p.prototype=b,new p};function h(g){return Object.prototype.toString.call(g)}f.__objToStr=h;function x(g){return typeof g=="object"&&h(g)==="[object Date]"}f.__isDate=x;function w(g){return typeof g=="object"&&h(g)==="[object Array]"}f.__isArray=w;function v(g){return typeof g=="object"&&h(g)==="[object RegExp]"}f.__isRegExp=v;function O(g){var b="";return g.global&&(b+="g"),g.ignoreCase&&(b+="i"),g.multiline&&(b+="m"),b}return f.__getRegExpFlags=O,f}();typeof n=="object"&&n.exports&&(n.exports=i)},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function E(P,T){var N=[],U=!0,G=!1,Z=void 0;try{for(var W=P[Symbol.iterator](),H;!(U=(H=W.next()).done)&&(N.push(H.value),!(T&&N.length===T));U=!0);}catch(L){G=!0,Z=L}finally{try{!U&&W.return&&W.return()}finally{if(G)throw Z}}return N}return function(P,T){if(Array.isArray(P))return P;if(Symbol.iterator in Object(P))return E(P,T);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function E(P,T){for(var N=0;N<T.length;N++){var U=T[N];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(P,U.key,U)}}return function(P,T,N){return T&&E(P.prototype,T),N&&E(P,N),P}}(),l=function E(P,T,N){P===null&&(P=Function.prototype);var U=Object.getOwnPropertyDescriptor(P,T);if(U===void 0){var G=Object.getPrototypeOf(P);return G===null?void 0:E(G,T,N)}else{if("value"in U)return U.value;var Z=U.get;return Z===void 0?void 0:Z.call(N)}},s=i(0),f=m(s),h=i(8),x=m(h),w=i(4),v=m(w),O=i(16),g=m(O),b=i(13),p=m(b),y=i(25),d=m(y);function m(E){return E&&E.__esModule?E:{default:E}}function _(E,P){if(!(E instanceof P))throw new TypeError("Cannot call a class as a function")}function A(E,P){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:E}function C(E,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);E.prototype=Object.create(P&&P.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(E,P):E.__proto__=P)}function R(E){return E instanceof v.default||E instanceof w.BlockEmbed}var S=function(E){C(P,E);function P(T,N){_(this,P);var U=A(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,T));return U.emitter=N.emitter,Array.isArray(N.whitelist)&&(U.whitelist=N.whitelist.reduce(function(G,Z){return G[Z]=!0,G},{})),U.domNode.addEventListener("DOMNodeInserted",function(){}),U.optimize(),U.enable(),U}return a(P,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(N,U){var G=this.line(N),Z=o(G,2),W=Z[0],H=Z[1],L=this.line(N+U),M=o(L,1),D=M[0];if(l(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"deleteAt",this).call(this,N,U),D!=null&&W!==D&&H>0){if(W instanceof w.BlockEmbed||D instanceof w.BlockEmbed){this.optimize();return}if(W instanceof p.default){var B=W.newlineIndex(W.length(),!0);if(B>-1&&(W=W.split(B+1),W===D)){this.optimize();return}}else if(D instanceof p.default){var V=D.newlineIndex(0);V>-1&&D.split(V+1)}var Y=D.children.head instanceof g.default?null:D.children.head;W.moveChildren(D,Y),W.remove()}this.optimize()}},{key:"enable",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",N)}},{key:"formatAt",value:function(N,U,G,Z){this.whitelist!=null&&!this.whitelist[G]||(l(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"formatAt",this).call(this,N,U,G,Z),this.optimize())}},{key:"insertAt",value:function(N,U,G){if(!(G!=null&&this.whitelist!=null&&!this.whitelist[U])){if(N>=this.length())if(G==null||f.default.query(U,f.default.Scope.BLOCK)==null){var Z=f.default.create(this.statics.defaultChild);this.appendChild(Z),G==null&&U.endsWith(`
|
|
134
|
-
`)&&(U=U.slice(0,-1)),Z.insertAt(0,U,G)}else{var W=f.default.create(U,G);this.appendChild(W)}else l(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"insertAt",this).call(this,N,U,G);this.optimize()}}},{key:"insertBefore",value:function(N,U){if(N.statics.scope===f.default.Scope.INLINE_BLOT){var G=f.default.create(this.statics.defaultChild);G.appendChild(N),N=G}l(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"insertBefore",this).call(this,N,U)}},{key:"leaf",value:function(N){return this.path(N).pop()||[null,-1]}},{key:"line",value:function(N){return N===this.length()?this.line(N-1):this.descendant(R,N)}},{key:"lines",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,G=function Z(W,H,L){var M=[],D=L;return W.children.forEachAt(H,L,function(B,V,Y){R(B)?M.push(B):B instanceof f.default.Container&&(M=M.concat(Z(B,V,D))),D-=Y}),M};return G(this,N,U)}},{key:"optimize",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(l(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"optimize",this).call(this,N,U),N.length>0&&this.emitter.emit(x.default.events.SCROLL_OPTIMIZE,N,U))}},{key:"path",value:function(N){return l(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"path",this).call(this,N).slice(1)}},{key:"update",value:function(N){if(this.batch!==!0){var U=x.default.sources.USER;typeof N=="string"&&(U=N),Array.isArray(N)||(N=this.observer.takeRecords()),N.length>0&&this.emitter.emit(x.default.events.SCROLL_BEFORE_UPDATE,U,N),l(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"update",this).call(this,N.concat([])),N.length>0&&this.emitter.emit(x.default.events.SCROLL_UPDATE,U,N)}}}]),P}(f.default.Scroll);S.blotName="scroll",S.className="ql-editor",S.tagName="DIV",S.defaultChild="block",S.allowedChildren=[v.default,w.BlockEmbed,d.default],r.default=S},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.SHORTKEY=r.default=void 0;var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},a=function(){function $(z,K){var X=[],Q=!0,J=!1,ne=void 0;try{for(var ie=z[Symbol.iterator](),oe;!(Q=(oe=ie.next()).done)&&(X.push(oe.value),!(K&&X.length===K));Q=!0);}catch(
|
|
134
|
+
`)&&(U=U.slice(0,-1)),Z.insertAt(0,U,G)}else{var W=f.default.create(U,G);this.appendChild(W)}else l(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"insertAt",this).call(this,N,U,G);this.optimize()}}},{key:"insertBefore",value:function(N,U){if(N.statics.scope===f.default.Scope.INLINE_BLOT){var G=f.default.create(this.statics.defaultChild);G.appendChild(N),N=G}l(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"insertBefore",this).call(this,N,U)}},{key:"leaf",value:function(N){return this.path(N).pop()||[null,-1]}},{key:"line",value:function(N){return N===this.length()?this.line(N-1):this.descendant(R,N)}},{key:"lines",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,G=function Z(W,H,L){var M=[],D=L;return W.children.forEachAt(H,L,function(B,V,Y){R(B)?M.push(B):B instanceof f.default.Container&&(M=M.concat(Z(B,V,D))),D-=Y}),M};return G(this,N,U)}},{key:"optimize",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(l(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"optimize",this).call(this,N,U),N.length>0&&this.emitter.emit(x.default.events.SCROLL_OPTIMIZE,N,U))}},{key:"path",value:function(N){return l(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"path",this).call(this,N).slice(1)}},{key:"update",value:function(N){if(this.batch!==!0){var U=x.default.sources.USER;typeof N=="string"&&(U=N),Array.isArray(N)||(N=this.observer.takeRecords()),N.length>0&&this.emitter.emit(x.default.events.SCROLL_BEFORE_UPDATE,U,N),l(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"update",this).call(this,N.concat([])),N.length>0&&this.emitter.emit(x.default.events.SCROLL_UPDATE,U,N)}}}]),P}(f.default.Scroll);S.blotName="scroll",S.className="ql-editor",S.tagName="DIV",S.defaultChild="block",S.allowedChildren=[v.default,w.BlockEmbed,d.default],r.default=S},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.SHORTKEY=r.default=void 0;var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},a=function(){function $(z,K){var X=[],Q=!0,J=!1,ne=void 0;try{for(var ie=z[Symbol.iterator](),oe;!(Q=(oe=ie.next()).done)&&(X.push(oe.value),!(K&&X.length===K));Q=!0);}catch(de){J=!0,ne=de}finally{try{!Q&&ie.return&&ie.return()}finally{if(J)throw ne}}return X}return function(z,K){if(Array.isArray(z))return z;if(Symbol.iterator in Object(z))return $(z,K);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function $(z,K){for(var X=0;X<K.length;X++){var Q=K[X];Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q&&(Q.writable=!0),Object.defineProperty(z,Q.key,Q)}}return function(z,K,X){return K&&$(z.prototype,K),X&&$(z,X),z}}(),s=i(21),f=E(s),h=i(11),x=E(h),w=i(3),v=E(w),O=i(2),g=E(O),b=i(20),p=E(b),y=i(0),d=E(y),m=i(5),_=E(m),A=i(10),C=E(A),R=i(9),S=E(R);function E($){return $&&$.__esModule?$:{default:$}}function P($,z,K){return z in $?Object.defineProperty($,z,{value:K,enumerable:!0,configurable:!0,writable:!0}):$[z]=K,$}function T($,z){if(!($ instanceof z))throw new TypeError("Cannot call a class as a function")}function N($,z){if(!$)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return z&&(typeof z=="object"||typeof z=="function")?z:$}function U($,z){if(typeof z!="function"&&z!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof z);$.prototype=Object.create(z&&z.prototype,{constructor:{value:$,enumerable:!1,writable:!0,configurable:!0}}),z&&(Object.setPrototypeOf?Object.setPrototypeOf($,z):$.__proto__=z)}var G=(0,C.default)("quill:keyboard"),Z=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",W=function($){U(z,$),l(z,null,[{key:"match",value:function(X,Q){return Q=F(Q),["altKey","ctrlKey","metaKey","shiftKey"].some(function(J){return!!Q[J]!==X[J]&&Q[J]!==null})?!1:Q.key===(X.which||X.keyCode)}}]);function z(K,X){T(this,z);var Q=N(this,(z.__proto__||Object.getPrototypeOf(z)).call(this,K,X));return Q.bindings={},Object.keys(Q.options.bindings).forEach(function(J){J==="list autofill"&&K.scroll.whitelist!=null&&!K.scroll.whitelist.list||Q.options.bindings[J]&&Q.addBinding(Q.options.bindings[J])}),Q.addBinding({key:z.keys.ENTER,shiftKey:null},B),Q.addBinding({key:z.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(Q.addBinding({key:z.keys.BACKSPACE},{collapsed:!0},L),Q.addBinding({key:z.keys.DELETE},{collapsed:!0},M)):(Q.addBinding({key:z.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},L),Q.addBinding({key:z.keys.DELETE},{collapsed:!0,suffix:/^.?$/},M)),Q.addBinding({key:z.keys.BACKSPACE},{collapsed:!1},D),Q.addBinding({key:z.keys.DELETE},{collapsed:!1},D),Q.addBinding({key:z.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},L),Q.listen(),Q}return l(z,[{key:"addBinding",value:function(X){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ne=F(X);if(ne==null||ne.key==null)return G.warn("Attempted to add invalid keyboard binding",ne);typeof Q=="function"&&(Q={handler:Q}),typeof J=="function"&&(J={handler:J}),ne=(0,v.default)(ne,Q,J),this.bindings[ne.key]=this.bindings[ne.key]||[],this.bindings[ne.key].push(ne)}},{key:"listen",value:function(){var X=this;this.quill.root.addEventListener("keydown",function(Q){if(!Q.defaultPrevented){var J=Q.which||Q.keyCode,ne=(X.bindings[J]||[]).filter(function(Me){return z.match(Q,Me)});if(ne.length!==0){var ie=X.quill.getSelection();if(!(ie==null||!X.quill.hasFocus())){var oe=X.quill.getLine(ie.index),de=a(oe,2),me=de[0],Pe=de[1],re=X.quill.getLeaf(ie.index),ae=a(re,2),we=ae[0],be=ae[1],te=ie.length===0?[we,be]:X.quill.getLeaf(ie.index+ie.length),fe=a(te,2),he=fe[0],Ee=fe[1],Ve=we instanceof d.default.Text?we.value().slice(0,be):"",Je=he instanceof d.default.Text?he.value().slice(Ee):"",Ae={collapsed:ie.length===0,empty:ie.length===0&&me.length()<=1,format:X.quill.getFormat(ie),offset:Pe,prefix:Ve,suffix:Je},Ce=ne.some(function(Me){if(Me.collapsed!=null&&Me.collapsed!==Ae.collapsed||Me.empty!=null&&Me.empty!==Ae.empty||Me.offset!=null&&Me.offset!==Ae.offset)return!1;if(Array.isArray(Me.format)){if(Me.format.every(function(ze){return Ae.format[ze]==null}))return!1}else if(o(Me.format)==="object"&&!Object.keys(Me.format).every(function(ze){return Me.format[ze]===!0?Ae.format[ze]!=null:Me.format[ze]===!1?Ae.format[ze]==null:(0,x.default)(Me.format[ze],Ae.format[ze])}))return!1;return Me.prefix!=null&&!Me.prefix.test(Ae.prefix)||Me.suffix!=null&&!Me.suffix.test(Ae.suffix)?!1:Me.handler.call(X,ie,Ae)!==!0});Ce&&Q.preventDefault()}}}})}}]),z}(S.default);W.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},W.DEFAULTS={bindings:{bold:Y("bold"),italic:Y("italic"),underline:Y("underline"),indent:{key:W.keys.TAB,format:["blockquote","indent","list"],handler:function(z,K){if(K.collapsed&&K.offset!==0)return!0;this.quill.format("indent","+1",_.default.sources.USER)}},outdent:{key:W.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(z,K){if(K.collapsed&&K.offset!==0)return!0;this.quill.format("indent","-1",_.default.sources.USER)}},"outdent backspace":{key:W.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(z,K){K.format.indent!=null?this.quill.format("indent","-1",_.default.sources.USER):K.format.list!=null&&this.quill.format("list",!1,_.default.sources.USER)}},"indent code-block":V(!0),"outdent code-block":V(!1),"remove tab":{key:W.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(z){this.quill.deleteText(z.index-1,1,_.default.sources.USER)}},tab:{key:W.keys.TAB,handler:function(z){this.quill.history.cutoff();var K=new g.default().retain(z.index).delete(z.length).insert(" ");this.quill.updateContents(K,_.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(z.index+1,_.default.sources.SILENT)}},"list empty enter":{key:W.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(z,K){this.quill.format("list",!1,_.default.sources.USER),K.format.indent&&this.quill.format("indent",!1,_.default.sources.USER)}},"checklist enter":{key:W.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(z){var K=this.quill.getLine(z.index),X=a(K,2),Q=X[0],J=X[1],ne=(0,v.default)({},Q.formats(),{list:"checked"}),ie=new g.default().retain(z.index).insert(`
|
|
135
135
|
`,ne).retain(Q.length()-J-1).retain(1,{list:"unchecked"});this.quill.updateContents(ie,_.default.sources.USER),this.quill.setSelection(z.index+1,_.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:W.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(z,K){var X=this.quill.getLine(z.index),Q=a(X,2),J=Q[0],ne=Q[1],ie=new g.default().retain(z.index).insert(`
|
|
136
|
-
`,K.format).retain(J.length()-ne-1).retain(1,{header:null});this.quill.updateContents(ie,_.default.sources.USER),this.quill.setSelection(z.index+1,_.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(z,K){var X=K.prefix.length,Q=this.quill.getLine(z.index),J=a(Q,2),ne=J[0],ie=J[1];if(ie>X)return!0;var oe=void 0;switch(K.prefix.trim()){case"[]":case"[ ]":oe="unchecked";break;case"[x]":oe="checked";break;case"-":case"*":oe="bullet";break;default:oe="ordered"}this.quill.insertText(z.index," ",_.default.sources.USER),this.quill.history.cutoff();var
|
|
137
|
-
`,X,_.default.sources.USER),this.quill.setSelection($.index+1,_.default.sources.SILENT),this.quill.focus(),Object.keys(z.format).forEach(function(Q){X[Q]==null&&(Array.isArray(z.format[Q])||Q!=="link"&&K.quill.format(Q,z.format[Q],_.default.sources.USER))})}function V($){return{key:W.keys.TAB,shiftKey:!$,format:{"code-block":!0},handler:function(K){var X=d.default.query("code-block"),Q=K.index,J=K.length,ne=this.quill.scroll.descendant(X,Q),ie=a(ne,2),oe=ie[0],
|
|
138
|
-
`);he=0,ae.forEach(function(we,be){$?(oe.insertAt(Pe+he,X.TAB),he+=X.TAB.length,be===0?Q+=X.TAB.length:J+=X.TAB.length):we.startsWith(X.TAB)&&(oe.deleteAt(Pe+he,X.TAB.length),he-=X.TAB.length,be===0?Q-=X.TAB.length:J-=X.TAB.length),he+=we.length+1}),this.quill.update(_.default.sources.USER),this.quill.setSelection(Q,J,_.default.sources.SILENT)}}}}function Y($){return{key:$[0].toUpperCase(),shortKey:!0,handler:function(K,X){this.quill.format($,!X.format[$],_.default.sources.USER)}}}function F($){if(typeof $=="string"||typeof $=="number")return F({key:$});if((typeof $>"u"?"undefined":o($))==="object"&&($=(0,f.default)($,!1)),typeof $.key=="string")if(W.keys[$.key.toUpperCase()]!=null)$.key=W.keys[$.key.toUpperCase()];else if($.key.length===1)$.key=$.key.toUpperCase().charCodeAt(0);else return null;return $.shortKey&&($[Z]=$.shortKey,delete $.shortKey),$}r.default=W,r.SHORTKEY=Z},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function p(y,d){var m=[],_=!0,A=!1,C=void 0;try{for(var R=y[Symbol.iterator](),S;!(_=(S=R.next()).done)&&(m.push(S.value),!(d&&m.length===d));_=!0);}catch(E){A=!0,C=E}finally{try{!_&&R.return&&R.return()}finally{if(A)throw C}}return m}return function(y,d){if(Array.isArray(y))return y;if(Symbol.iterator in Object(y))return p(y,d);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function p(y,d,m){y===null&&(y=Function.prototype);var _=Object.getOwnPropertyDescriptor(y,d);if(_===void 0){var A=Object.getPrototypeOf(y);return A===null?void 0:p(A,d,m)}else{if("value"in _)return _.value;var C=_.get;return C===void 0?void 0:C.call(m)}},l=function(){function p(y,d){for(var m=0;m<d.length;m++){var _=d[m];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(y,_.key,_)}}return function(y,d,m){return d&&p(y.prototype,d),m&&p(y,m),y}}(),s=i(0),f=w(s),h=i(7),x=w(h);function w(p){return p&&p.__esModule?p:{default:p}}function v(p,y){if(!(p instanceof y))throw new TypeError("Cannot call a class as a function")}function O(p,y){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:p}function g(p,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);p.prototype=Object.create(y&&y.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(p,y):p.__proto__=y)}var b=function(p){g(y,p),l(y,null,[{key:"value",value:function(){}}]);function y(d,m){v(this,y);var _=O(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,d));return _.selection=m,_.textNode=document.createTextNode(y.CONTENTS),_.domNode.appendChild(_.textNode),_._length=0,_}return l(y,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(m,_){if(this._length!==0)return a(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"format",this).call(this,m,_);for(var A=this,C=0;A!=null&&A.statics.scope!==f.default.Scope.BLOCK_BLOT;)C+=A.offset(A.parent),A=A.parent;A!=null&&(this._length=y.CONTENTS.length,A.optimize(),A.formatAt(C,y.CONTENTS.length,m,_),this._length=0)}},{key:"index",value:function(m,_){return m===this.textNode?0:a(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"index",this).call(this,m,_)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){a(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var m=this.textNode,_=this.selection.getNativeRange(),A=void 0,C=void 0,R=void 0;if(_!=null&&_.start.node===m&&_.end.node===m){var S=[m,_.start.offset,_.end.offset];A=S[0],C=S[1],R=S[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==y.CONTENTS){var E=this.textNode.data.split(y.CONTENTS).join("");this.next instanceof x.default?(A=this.next.domNode,this.next.insertAt(0,E),this.textNode.data=y.CONTENTS):(this.textNode.data=E,this.parent.insertBefore(f.default.create(this.textNode),this),this.textNode=document.createTextNode(y.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),C!=null){var P=[C,R].map(function(N){return Math.max(0,Math.min(A.data.length,N-1))}),T=o(P,2);return C=T[0],R=T[1],{startNode:A,startOffset:C,endNode:A,endOffset:R}}}}},{key:"update",value:function(m,_){var A=this;if(m.some(function(R){return R.type==="characterData"&&R.target===A.textNode})){var C=this.restore();C&&(_.range=C)}}},{key:"value",value:function(){return""}}]),y}(f.default.Embed);b.blotName="cursor",b.className="ql-cursor",b.tagName="span",b.CONTENTS="\uFEFF",r.default=b},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(0),a=f(o),l=i(4),s=f(l);function f(O){return O&&O.__esModule?O:{default:O}}function h(O,g){if(!(O instanceof g))throw new TypeError("Cannot call a class as a function")}function x(O,g){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:O}function w(O,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);O.prototype=Object.create(g&&g.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(O,g):O.__proto__=g)}var v=function(O){w(g,O);function g(){return h(this,g),x(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return g}(a.default.Container);v.allowedChildren=[s.default,l.BlockEmbed,v],r.default=v},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.ColorStyle=r.ColorClass=r.ColorAttributor=void 0;var o=function(){function b(p,y){for(var d=0;d<y.length;d++){var m=y[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(p,m.key,m)}}return function(p,y,d){return y&&b(p.prototype,y),d&&b(p,d),p}}(),a=function b(p,y,d){p===null&&(p=Function.prototype);var m=Object.getOwnPropertyDescriptor(p,y);if(m===void 0){var _=Object.getPrototypeOf(p);return _===null?void 0:b(_,y,d)}else{if("value"in m)return m.value;var A=m.get;return A===void 0?void 0:A.call(d)}},l=i(0),s=f(l);function f(b){return b&&b.__esModule?b:{default:b}}function h(b,p){if(!(b instanceof p))throw new TypeError("Cannot call a class as a function")}function x(b,p){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:b}function w(b,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);b.prototype=Object.create(p&&p.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(b,p):b.__proto__=p)}var v=function(b){w(p,b);function p(){return h(this,p),x(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return o(p,[{key:"value",value:function(d){var m=a(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"value",this).call(this,d);return m.startsWith("rgb(")?(m=m.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+m.split(",").map(function(_){return("00"+parseInt(_).toString(16)).slice(-2)}).join("")):m}}]),p}(s.default.Attributor.Style),O=new s.default.Attributor.Class("color","ql-color",{scope:s.default.Scope.INLINE}),g=new v("color","color",{scope:s.default.Scope.INLINE});r.ColorAttributor=v,r.ColorClass=O,r.ColorStyle=g},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.sanitize=r.default=void 0;var o=function(){function g(b,p){for(var y=0;y<p.length;y++){var d=p[y];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(b,d.key,d)}}return function(b,p,y){return p&&g(b.prototype,p),y&&g(b,y),b}}(),a=function g(b,p,y){b===null&&(b=Function.prototype);var d=Object.getOwnPropertyDescriptor(b,p);if(d===void 0){var m=Object.getPrototypeOf(b);return m===null?void 0:g(m,p,y)}else{if("value"in d)return d.value;var _=d.get;return _===void 0?void 0:_.call(y)}},l=i(6),s=f(l);function f(g){return g&&g.__esModule?g:{default:g}}function h(g,b){if(!(g instanceof b))throw new TypeError("Cannot call a class as a function")}function x(g,b){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:g}function w(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(g,b):g.__proto__=b)}var v=function(g){w(b,g);function b(){return h(this,b),x(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return o(b,[{key:"format",value:function(y,d){if(y!==this.statics.blotName||!d)return a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,y,d);d=this.constructor.sanitize(d),this.domNode.setAttribute("href",d)}}],[{key:"create",value:function(y){var d=a(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,y);return y=this.sanitize(y),d.setAttribute("href",y),d.setAttribute("rel","noopener noreferrer"),d.setAttribute("target","_blank"),d}},{key:"formats",value:function(y){return y.getAttribute("href")}},{key:"sanitize",value:function(y){return O(y,this.PROTOCOL_WHITELIST)?y:this.SANITIZED_URL}}]),b}(s.default);v.blotName="link",v.tagName="A",v.SANITIZED_URL="about:blank",v.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function O(g,b){var p=document.createElement("a");p.href=g;var y=p.href.slice(0,p.href.indexOf(":"));return b.indexOf(y)>-1}r.default=v,r.sanitize=O},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},a=function(){function b(p,y){for(var d=0;d<y.length;d++){var m=y[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(p,m.key,m)}}return function(p,y,d){return y&&b(p.prototype,y),d&&b(p,d),p}}(),l=i(23),s=x(l),f=i(107),h=x(f);function x(b){return b&&b.__esModule?b:{default:b}}function w(b,p){if(!(b instanceof p))throw new TypeError("Cannot call a class as a function")}var v=0;function O(b,p){b.setAttribute(p,b.getAttribute(p)!=="true")}var g=function(){function b(p){var y=this;w(this,b),this.select=p,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){y.togglePicker()}),this.label.addEventListener("keydown",function(d){switch(d.keyCode){case s.default.keys.ENTER:y.togglePicker();break;case s.default.keys.ESCAPE:y.escape(),d.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return a(b,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),O(this.label,"aria-expanded"),O(this.options,"aria-hidden")}},{key:"buildItem",value:function(y){var d=this,m=document.createElement("span");return m.tabIndex="0",m.setAttribute("role","button"),m.classList.add("ql-picker-item"),y.hasAttribute("value")&&m.setAttribute("data-value",y.getAttribute("value")),y.textContent&&m.setAttribute("data-label",y.textContent),m.addEventListener("click",function(){d.selectItem(m,!0)}),m.addEventListener("keydown",function(_){switch(_.keyCode){case s.default.keys.ENTER:d.selectItem(m,!0),_.preventDefault();break;case s.default.keys.ESCAPE:d.escape(),_.preventDefault();break}}),m}},{key:"buildLabel",value:function(){var y=document.createElement("span");return y.classList.add("ql-picker-label"),y.innerHTML=h.default,y.tabIndex="0",y.setAttribute("role","button"),y.setAttribute("aria-expanded","false"),this.container.appendChild(y),y}},{key:"buildOptions",value:function(){var y=this,d=document.createElement("span");d.classList.add("ql-picker-options"),d.setAttribute("aria-hidden","true"),d.tabIndex="-1",d.id="ql-picker-options-"+v,v+=1,this.label.setAttribute("aria-controls",d.id),this.options=d,[].slice.call(this.select.options).forEach(function(m){var _=y.buildItem(m);d.appendChild(_),m.selected===!0&&y.selectItem(_)}),this.container.appendChild(d)}},{key:"buildPicker",value:function(){var y=this;[].slice.call(this.select.attributes).forEach(function(d){y.container.setAttribute(d.name,d.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var y=this;this.close(),setTimeout(function(){return y.label.focus()},1)}},{key:"close",value:function(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function(y){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m=this.container.querySelector(".ql-selected");if(y!==m&&(m!=null&&m.classList.remove("ql-selected"),y!=null&&(y.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(y.parentNode.children,y),y.hasAttribute("data-value")?this.label.setAttribute("data-value",y.getAttribute("data-value")):this.label.removeAttribute("data-value"),y.hasAttribute("data-label")?this.label.setAttribute("data-label",y.getAttribute("data-label")):this.label.removeAttribute("data-label"),d))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":o(Event))==="object"){var _=document.createEvent("Event");_.initEvent("change",!0,!0),this.select.dispatchEvent(_)}this.close()}}},{key:"update",value:function(){var y=void 0;if(this.select.selectedIndex>-1){var d=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];y=this.select.options[this.select.selectedIndex],this.selectItem(d)}else this.selectItem(null);var m=y!=null&&y!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",m)}}]),b}();r.default=g},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(0),a=G(o),l=i(5),s=G(l),f=i(4),h=G(f),x=i(16),w=G(x),v=i(25),O=G(v),g=i(24),b=G(g),p=i(35),y=G(p),d=i(6),m=G(d),_=i(22),A=G(_),C=i(7),R=G(C),S=i(55),E=G(S),P=i(42),T=G(P),N=i(23),U=G(N);function G(Z){return Z&&Z.__esModule?Z:{default:Z}}s.default.register({"blots/block":h.default,"blots/block/embed":f.BlockEmbed,"blots/break":w.default,"blots/container":O.default,"blots/cursor":b.default,"blots/embed":y.default,"blots/inline":m.default,"blots/scroll":A.default,"blots/text":R.default,"modules/clipboard":E.default,"modules/history":T.default,"modules/keyboard":U.default}),a.default.register(h.default,w.default,b.default,m.default,A.default,R.default),r.default=s.default},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(1),a=function(){function l(s){this.domNode=s,this.domNode[o.DATA_KEY]={blot:this}}return Object.defineProperty(l.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),l.create=function(s){if(this.tagName==null)throw new o.ParchmentError("Blot definition missing tagName");var f;return Array.isArray(this.tagName)?(typeof s=="string"&&(s=s.toUpperCase(),parseInt(s).toString()===s&&(s=parseInt(s))),typeof s=="number"?f=document.createElement(this.tagName[s-1]):this.tagName.indexOf(s)>-1?f=document.createElement(s):f=document.createElement(this.tagName[0])):f=document.createElement(this.tagName),this.className&&f.classList.add(this.className),f},l.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},l.prototype.clone=function(){var s=this.domNode.cloneNode(!1);return o.create(s)},l.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[o.DATA_KEY]},l.prototype.deleteAt=function(s,f){var h=this.isolate(s,f);h.remove()},l.prototype.formatAt=function(s,f,h,x){var w=this.isolate(s,f);if(o.query(h,o.Scope.BLOT)!=null&&x)w.wrap(h,x);else if(o.query(h,o.Scope.ATTRIBUTE)!=null){var v=o.create(this.statics.scope);w.wrap(v),v.format(h,x)}},l.prototype.insertAt=function(s,f,h){var x=h==null?o.create("text",f):o.create(f,h),w=this.split(s);this.parent.insertBefore(x,w)},l.prototype.insertInto=function(s,f){f===void 0&&(f=null),this.parent!=null&&this.parent.children.remove(this);var h=null;s.children.insertBefore(this,f),f!=null&&(h=f.domNode),(this.domNode.parentNode!=s.domNode||this.domNode.nextSibling!=h)&&s.domNode.insertBefore(this.domNode,h),this.parent=s,this.attach()},l.prototype.isolate=function(s,f){var h=this.split(s);return h.split(f),h},l.prototype.length=function(){return 1},l.prototype.offset=function(s){return s===void 0&&(s=this.parent),this.parent==null||this==s?0:this.parent.children.offset(this)+this.parent.offset(s)},l.prototype.optimize=function(s){this.domNode[o.DATA_KEY]!=null&&delete this.domNode[o.DATA_KEY].mutations},l.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},l.prototype.replace=function(s){s.parent!=null&&(s.parent.insertBefore(this,s.next),s.remove())},l.prototype.replaceWith=function(s,f){var h=typeof s=="string"?o.create(s,f):s;return h.replace(this),h},l.prototype.split=function(s,f){return s===0?this:this.next},l.prototype.update=function(s,f){},l.prototype.wrap=function(s,f){var h=typeof s=="string"?o.create(s,f):s;return this.parent!=null&&this.parent.insertBefore(h,this.next),h.appendChild(this),h},l.blotName="abstract",l}();r.default=a},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(12),a=i(32),l=i(33),s=i(1),f=function(){function h(x){this.attributes={},this.domNode=x,this.build()}return h.prototype.attribute=function(x,w){w?x.add(this.domNode,w)&&(x.value(this.domNode)!=null?this.attributes[x.attrName]=x:delete this.attributes[x.attrName]):(x.remove(this.domNode),delete this.attributes[x.attrName])},h.prototype.build=function(){var x=this;this.attributes={};var w=o.default.keys(this.domNode),v=a.default.keys(this.domNode),O=l.default.keys(this.domNode);w.concat(v).concat(O).forEach(function(g){var b=s.query(g,s.Scope.ATTRIBUTE);b instanceof o.default&&(x.attributes[b.attrName]=b)})},h.prototype.copy=function(x){var w=this;Object.keys(this.attributes).forEach(function(v){var O=w.attributes[v].value(w.domNode);x.format(v,O)})},h.prototype.move=function(x){var w=this;this.copy(x),Object.keys(this.attributes).forEach(function(v){w.attributes[v].remove(w.domNode)}),this.attributes={}},h.prototype.values=function(){var x=this;return Object.keys(this.attributes).reduce(function(w,v){return w[v]=x.attributes[v].value(x.domNode),w},{})},h}();r.default=f},function(n,r,i){var o=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,x){h.__proto__=x}||function(h,x){for(var w in x)x.hasOwnProperty(w)&&(h[w]=x[w])};return function(h,x){f(h,x);function w(){this.constructor=h}h.prototype=x===null?Object.create(x):(w.prototype=x.prototype,new w)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=i(12);function l(f,h){var x=f.getAttribute("class")||"";return x.split(/\s+/).filter(function(w){return w.indexOf(h+"-")===0})}var s=function(f){o(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.keys=function(x){return(x.getAttribute("class")||"").split(/\s+/).map(function(w){return w.split("-").slice(0,-1).join("-")})},h.prototype.add=function(x,w){return this.canAdd(x,w)?(this.remove(x),x.classList.add(this.keyName+"-"+w),!0):!1},h.prototype.remove=function(x){var w=l(x,this.keyName);w.forEach(function(v){x.classList.remove(v)}),x.classList.length===0&&x.removeAttribute("class")},h.prototype.value=function(x){var w=l(x,this.keyName)[0]||"",v=w.slice(this.keyName.length+1);return this.canAdd(x,v)?v:""},h}(a.default);r.default=s},function(n,r,i){var o=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,x){h.__proto__=x}||function(h,x){for(var w in x)x.hasOwnProperty(w)&&(h[w]=x[w])};return function(h,x){f(h,x);function w(){this.constructor=h}h.prototype=x===null?Object.create(x):(w.prototype=x.prototype,new w)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=i(12);function l(f){var h=f.split("-"),x=h.slice(1).map(function(w){return w[0].toUpperCase()+w.slice(1)}).join("");return h[0]+x}var s=function(f){o(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.keys=function(x){return(x.getAttribute("style")||"").split(";").map(function(w){var v=w.split(":");return v[0].trim()})},h.prototype.add=function(x,w){return this.canAdd(x,w)?(x.style[l(this.keyName)]=w,!0):!1},h.prototype.remove=function(x){x.style[l(this.keyName)]="",x.getAttribute("style")||x.removeAttribute("style")},h.prototype.value=function(x){var w=x.style[l(this.keyName)];return this.canAdd(x,w)?w:""},h}(a.default);r.default=s},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function s(f,h){for(var x=0;x<h.length;x++){var w=h[x];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(f,w.key,w)}}return function(f,h,x){return h&&s(f.prototype,h),x&&s(f,x),f}}();function a(s,f){if(!(s instanceof f))throw new TypeError("Cannot call a class as a function")}var l=function(){function s(f,h){a(this,s),this.quill=f,this.options=h,this.modules={}}return o(s,[{key:"init",value:function(){var h=this;Object.keys(this.options.modules).forEach(function(x){h.modules[x]==null&&h.addModule(x)})}},{key:"addModule",value:function(h){var x=this.quill.constructor.import("modules/"+h);return this.modules[h]=new x(this.quill,this.options.modules[h]||{}),this.modules[h]}}]),s}();l.DEFAULTS={modules:{}},l.themes={default:l},r.default=l},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function p(y,d){for(var m=0;m<d.length;m++){var _=d[m];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(y,_.key,_)}}return function(y,d,m){return d&&p(y.prototype,d),m&&p(y,m),y}}(),a=function p(y,d,m){y===null&&(y=Function.prototype);var _=Object.getOwnPropertyDescriptor(y,d);if(_===void 0){var A=Object.getPrototypeOf(y);return A===null?void 0:p(A,d,m)}else{if("value"in _)return _.value;var C=_.get;return C===void 0?void 0:C.call(m)}},l=i(0),s=x(l),f=i(7),h=x(f);function x(p){return p&&p.__esModule?p:{default:p}}function w(p,y){if(!(p instanceof y))throw new TypeError("Cannot call a class as a function")}function v(p,y){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:p}function O(p,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);p.prototype=Object.create(y&&y.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(p,y):p.__proto__=y)}var g="\uFEFF",b=function(p){O(y,p);function y(d){w(this,y);var m=v(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,d));return m.contentNode=document.createElement("span"),m.contentNode.setAttribute("contenteditable",!1),[].slice.call(m.domNode.childNodes).forEach(function(_){m.contentNode.appendChild(_)}),m.leftGuard=document.createTextNode(g),m.rightGuard=document.createTextNode(g),m.domNode.appendChild(m.leftGuard),m.domNode.appendChild(m.contentNode),m.domNode.appendChild(m.rightGuard),m}return o(y,[{key:"index",value:function(m,_){return m===this.leftGuard?0:m===this.rightGuard?1:a(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"index",this).call(this,m,_)}},{key:"restore",value:function(m){var _=void 0,A=void 0,C=m.data.split(g).join("");if(m===this.leftGuard)if(this.prev instanceof h.default){var R=this.prev.length();this.prev.insertAt(R,C),_={startNode:this.prev.domNode,startOffset:R+C.length}}else A=document.createTextNode(C),this.parent.insertBefore(s.default.create(A),this),_={startNode:A,startOffset:C.length};else m===this.rightGuard&&(this.next instanceof h.default?(this.next.insertAt(0,C),_={startNode:this.next.domNode,startOffset:C.length}):(A=document.createTextNode(C),this.parent.insertBefore(s.default.create(A),this.next),_={startNode:A,startOffset:C.length}));return m.data=g,_}},{key:"update",value:function(m,_){var A=this;m.forEach(function(C){if(C.type==="characterData"&&(C.target===A.leftGuard||C.target===A.rightGuard)){var R=A.restore(C.target);R&&(_.range=R)}})}}]),y}(s.default.Embed);r.default=b},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.AlignStyle=r.AlignClass=r.AlignAttribute=void 0;var o=i(0),a=l(o);function l(w){return w&&w.__esModule?w:{default:w}}var s={scope:a.default.Scope.BLOCK,whitelist:["right","center","justify"]},f=new a.default.Attributor.Attribute("align","align",s),h=new a.default.Attributor.Class("align","ql-align",s),x=new a.default.Attributor.Style("align","text-align",s);r.AlignAttribute=f,r.AlignClass=h,r.AlignStyle=x},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.BackgroundStyle=r.BackgroundClass=void 0;var o=i(0),a=s(o),l=i(26);function s(x){return x&&x.__esModule?x:{default:x}}var f=new a.default.Attributor.Class("background","ql-bg",{scope:a.default.Scope.INLINE}),h=new l.ColorAttributor("background","background-color",{scope:a.default.Scope.INLINE});r.BackgroundClass=f,r.BackgroundStyle=h},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.DirectionStyle=r.DirectionClass=r.DirectionAttribute=void 0;var o=i(0),a=l(o);function l(w){return w&&w.__esModule?w:{default:w}}var s={scope:a.default.Scope.BLOCK,whitelist:["rtl"]},f=new a.default.Attributor.Attribute("direction","dir",s),h=new a.default.Attributor.Class("direction","ql-direction",s),x=new a.default.Attributor.Style("direction","direction",s);r.DirectionAttribute=f,r.DirectionClass=h,r.DirectionStyle=x},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.FontClass=r.FontStyle=void 0;var o=function(){function p(y,d){for(var m=0;m<d.length;m++){var _=d[m];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(y,_.key,_)}}return function(y,d,m){return d&&p(y.prototype,d),m&&p(y,m),y}}(),a=function p(y,d,m){y===null&&(y=Function.prototype);var _=Object.getOwnPropertyDescriptor(y,d);if(_===void 0){var A=Object.getPrototypeOf(y);return A===null?void 0:p(A,d,m)}else{if("value"in _)return _.value;var C=_.get;return C===void 0?void 0:C.call(m)}},l=i(0),s=f(l);function f(p){return p&&p.__esModule?p:{default:p}}function h(p,y){if(!(p instanceof y))throw new TypeError("Cannot call a class as a function")}function x(p,y){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:p}function w(p,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);p.prototype=Object.create(y&&y.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(p,y):p.__proto__=y)}var v={scope:s.default.Scope.INLINE,whitelist:["serif","monospace"]},O=new s.default.Attributor.Class("font","ql-font",v),g=function(p){w(y,p);function y(){return h(this,y),x(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return o(y,[{key:"value",value:function(m){return a(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"value",this).call(this,m).replace(/["']/g,"")}}]),y}(s.default.Attributor.Style),b=new g("font","font-family",v);r.FontStyle=b,r.FontClass=O},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.SizeStyle=r.SizeClass=void 0;var o=i(0),a=l(o);function l(h){return h&&h.__esModule?h:{default:h}}var s=new a.default.Attributor.Class("size","ql-size",{scope:a.default.Scope.INLINE,whitelist:["small","large","huge"]}),f=new a.default.Attributor.Style("size","font-size",{scope:a.default.Scope.INLINE,whitelist:["10px","18px","32px"]});r.SizeClass=s,r.SizeStyle=f},function(n,r,i){n.exports={align:{"":i(76),center:i(77),right:i(78),justify:i(79)},background:i(80),blockquote:i(81),bold:i(82),clean:i(83),code:i(58),"code-block":i(58),color:i(84),direction:{"":i(85),rtl:i(86)},float:{center:i(87),full:i(88),left:i(89),right:i(90)},formula:i(91),header:{1:i(92),2:i(93)},italic:i(94),image:i(95),indent:{"+1":i(96),"-1":i(97)},link:i(98),list:{ordered:i(99),bullet:i(100),check:i(101)},script:{sub:i(102),super:i(103)},strike:i(104),underline:i(105),video:i(106)}},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.getLastChangeIndex=r.default=void 0;var o=function(){function d(m,_){for(var A=0;A<_.length;A++){var C=_[A];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(m,C.key,C)}}return function(m,_,A){return _&&d(m.prototype,_),A&&d(m,A),m}}(),a=i(0),l=w(a),s=i(5),f=w(s),h=i(9),x=w(h);function w(d){return d&&d.__esModule?d:{default:d}}function v(d,m){if(!(d instanceof m))throw new TypeError("Cannot call a class as a function")}function O(d,m){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:d}function g(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(d,m):d.__proto__=m)}var b=function(d){g(m,d);function m(_,A){v(this,m);var C=O(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,_,A));return C.lastRecorded=0,C.ignoreChange=!1,C.clear(),C.quill.on(f.default.events.EDITOR_CHANGE,function(R,S,E,P){R!==f.default.events.TEXT_CHANGE||C.ignoreChange||(!C.options.userOnly||P===f.default.sources.USER?C.record(S,E):C.transform(S))}),C.quill.keyboard.addBinding({key:"Z",shortKey:!0},C.undo.bind(C)),C.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},C.redo.bind(C)),/Win/i.test(navigator.platform)&&C.quill.keyboard.addBinding({key:"Y",shortKey:!0},C.redo.bind(C)),C}return o(m,[{key:"change",value:function(A,C){if(this.stack[A].length!==0){var R=this.stack[A].pop();this.stack[C].push(R),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(R[A],f.default.sources.USER),this.ignoreChange=!1;var S=y(R[A]);this.quill.setSelection(S)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(A,C){if(A.ops.length!==0){this.stack.redo=[];var R=this.quill.getContents().diff(C),S=Date.now();if(this.lastRecorded+this.options.delay>S&&this.stack.undo.length>0){var E=this.stack.undo.pop();R=R.compose(E.undo),A=E.redo.compose(A)}else this.lastRecorded=S;this.stack.undo.push({redo:A,undo:R}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(A){this.stack.undo.forEach(function(C){C.undo=A.transform(C.undo,!0),C.redo=A.transform(C.redo,!0)}),this.stack.redo.forEach(function(C){C.undo=A.transform(C.undo,!0),C.redo=A.transform(C.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),m}(x.default);b.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function p(d){var m=d.ops[d.ops.length-1];return m==null?!1:m.insert!=null?typeof m.insert=="string"&&m.insert.endsWith(`
|
|
139
|
-
`):m.attributes!=null?Object.keys(m.attributes).some(function(_){return l.default.query(_,l.default.Scope.BLOCK)!=null}):!1}function y(d){var m=d.reduce(function(A,C){return A+=C.delete||0,A},0),_=d.length()-m;return p(d)&&(_-=1),_}r.default=b,r.getLastChangeIndex=y},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.BaseTooltip=void 0;var o=function(){function B(V,Y){for(var F=0;F<Y.length;F++){var $=Y[F];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(V,$.key,$)}}return function(V,Y,F){return Y&&B(V.prototype,Y),F&&B(V,F),V}}(),a=function B(V,Y,F){V===null&&(V=Function.prototype);var $=Object.getOwnPropertyDescriptor(V,Y);if($===void 0){var z=Object.getPrototypeOf(V);return z===null?void 0:B(z,Y,F)}else{if("value"in $)return $.value;var K=$.get;return K===void 0?void 0:K.call(F)}},l=i(3),s=S(l),f=i(2),h=S(f),x=i(8),w=S(x),v=i(23),O=S(v),g=i(34),b=S(g),p=i(59),y=S(p),d=i(60),m=S(d),_=i(28),A=S(_),C=i(61),R=S(C);function S(B){return B&&B.__esModule?B:{default:B}}function E(B,V){if(!(B instanceof V))throw new TypeError("Cannot call a class as a function")}function P(B,V){if(!B)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return V&&(typeof V=="object"||typeof V=="function")?V:B}function T(B,V){if(typeof V!="function"&&V!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof V);B.prototype=Object.create(V&&V.prototype,{constructor:{value:B,enumerable:!1,writable:!0,configurable:!0}}),V&&(Object.setPrototypeOf?Object.setPrototypeOf(B,V):B.__proto__=V)}var N=[!1,"center","right","justify"],U=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],G=[!1,"serif","monospace"],Z=["1","2","3",!1],W=["small",!1,"large","huge"],H=function(B){T(V,B);function V(Y,F){E(this,V);var $=P(this,(V.__proto__||Object.getPrototypeOf(V)).call(this,Y,F)),z=function K(X){if(!document.body.contains(Y.root))return document.body.removeEventListener("click",K);$.tooltip!=null&&!$.tooltip.root.contains(X.target)&&document.activeElement!==$.tooltip.textbox&&!$.quill.hasFocus()&&$.tooltip.hide(),$.pickers!=null&&$.pickers.forEach(function(Q){Q.container.contains(X.target)||Q.close()})};return Y.emitter.listenDOM("click",document.body,z),$}return o(V,[{key:"addModule",value:function(F){var $=a(V.prototype.__proto__||Object.getPrototypeOf(V.prototype),"addModule",this).call(this,F);return F==="toolbar"&&this.extendToolbar($),$}},{key:"buildButtons",value:function(F,$){F.forEach(function(z){var K=z.getAttribute("class")||"";K.split(/\s+/).forEach(function(X){if(X.startsWith("ql-")&&(X=X.slice(3),$[X]!=null))if(X==="direction")z.innerHTML=$[X][""]+$[X].rtl;else if(typeof $[X]=="string")z.innerHTML=$[X];else{var Q=z.value||"";Q!=null&&$[X][Q]&&(z.innerHTML=$[X][Q])}})})}},{key:"buildPickers",value:function(F,$){var z=this;this.pickers=F.map(function(X){if(X.classList.contains("ql-align"))return X.querySelector("option")==null&&D(X,N),new m.default(X,$.align);if(X.classList.contains("ql-background")||X.classList.contains("ql-color")){var Q=X.classList.contains("ql-background")?"background":"color";return X.querySelector("option")==null&&D(X,U,Q==="background"?"#ffffff":"#000000"),new y.default(X,$[Q])}else return X.querySelector("option")==null&&(X.classList.contains("ql-font")?D(X,G):X.classList.contains("ql-header")?D(X,Z):X.classList.contains("ql-size")&&D(X,W)),new A.default(X)});var K=function(){z.pickers.forEach(function(Q){Q.update()})};this.quill.on(w.default.events.EDITOR_CHANGE,K)}}]),V}(b.default);H.DEFAULTS=(0,s.default)(!0,{},b.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var V=this,Y=this.container.querySelector("input.ql-image[type=file]");Y==null&&(Y=document.createElement("input"),Y.setAttribute("type","file"),Y.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),Y.classList.add("ql-image"),Y.addEventListener("change",function(){if(Y.files!=null&&Y.files[0]!=null){var F=new FileReader;F.onload=function($){var z=V.quill.getSelection(!0);V.quill.updateContents(new h.default().retain(z.index).delete(z.length).insert({image:$.target.result}),w.default.sources.USER),V.quill.setSelection(z.index+1,w.default.sources.SILENT),Y.value=""},F.readAsDataURL(Y.files[0])}}),this.container.appendChild(Y)),Y.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var L=function(B){T(V,B);function V(Y,F){E(this,V);var $=P(this,(V.__proto__||Object.getPrototypeOf(V)).call(this,Y,F));return $.textbox=$.root.querySelector('input[type="text"]'),$.listen(),$}return o(V,[{key:"listen",value:function(){var F=this;this.textbox.addEventListener("keydown",function($){O.default.match($,"enter")?(F.save(),$.preventDefault()):O.default.match($,"escape")&&(F.cancel(),$.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",$=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),$!=null?this.textbox.value=$:F!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+F)||""),this.root.setAttribute("data-mode",F)}},{key:"restoreFocus",value:function(){var F=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=F}},{key:"save",value:function(){var F=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var $=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",F,w.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",F,w.default.sources.USER)),this.quill.root.scrollTop=$;break}case"video":F=M(F);case"formula":{if(!F)break;var z=this.quill.getSelection(!0);if(z!=null){var K=z.index+z.length;this.quill.insertEmbed(K,this.root.getAttribute("data-mode"),F,w.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(K+1," ",w.default.sources.USER),this.quill.setSelection(K+2,w.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),V}(R.default);function M(B){var V=B.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||B.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return V?(V[1]||"https")+"://www.youtube.com/embed/"+V[2]+"?showinfo=0":(V=B.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(V[1]||"https")+"://player.vimeo.com/video/"+V[2]+"/":B}function D(B,V){var Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;V.forEach(function(F){var $=document.createElement("option");F===Y?$.setAttribute("selected","selected"):$.setAttribute("value",F),B.appendChild($)})}r.BaseTooltip=L,r.default=H},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function a(){this.head=this.tail=null,this.length=0}return a.prototype.append=function(){for(var l=[],s=0;s<arguments.length;s++)l[s]=arguments[s];this.insertBefore(l[0],null),l.length>1&&this.append.apply(this,l.slice(1))},a.prototype.contains=function(l){for(var s,f=this.iterator();s=f();)if(s===l)return!0;return!1},a.prototype.insertBefore=function(l,s){l&&(l.next=s,s!=null?(l.prev=s.prev,s.prev!=null&&(s.prev.next=l),s.prev=l,s===this.head&&(this.head=l)):this.tail!=null?(this.tail.next=l,l.prev=this.tail,this.tail=l):(l.prev=null,this.head=this.tail=l),this.length+=1)},a.prototype.offset=function(l){for(var s=0,f=this.head;f!=null;){if(f===l)return s;s+=f.length(),f=f.next}return-1},a.prototype.remove=function(l){this.contains(l)&&(l.prev!=null&&(l.prev.next=l.next),l.next!=null&&(l.next.prev=l.prev),l===this.head&&(this.head=l.next),l===this.tail&&(this.tail=l.prev),this.length-=1)},a.prototype.iterator=function(l){return l===void 0&&(l=this.head),function(){var s=l;return l!=null&&(l=l.next),s}},a.prototype.find=function(l,s){s===void 0&&(s=!1);for(var f,h=this.iterator();f=h();){var x=f.length();if(l<x||s&&l===x&&(f.next==null||f.next.length()!==0))return[f,l];l-=x}return[null,0]},a.prototype.forEach=function(l){for(var s,f=this.iterator();s=f();)l(s)},a.prototype.forEachAt=function(l,s,f){if(!(s<=0))for(var h=this.find(l),x=h[0],w=h[1],v,O=l-w,g=this.iterator(x);(v=g())&&O<l+s;){var b=v.length();l>O?f(v,l-O,Math.min(s,O+b-l)):f(v,0,Math.min(b,l+s-O)),O+=b}},a.prototype.map=function(l){return this.reduce(function(s,f){return s.push(l(f)),s},[])},a.prototype.reduce=function(l,s){for(var f,h=this.iterator();f=h();)s=l(s,f);return s},a}();r.default=o},function(n,r,i){var o=this&&this.__extends||function(){var x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,v){w.__proto__=v}||function(w,v){for(var O in v)v.hasOwnProperty(O)&&(w[O]=v[O])};return function(w,v){x(w,v);function O(){this.constructor=w}w.prototype=v===null?Object.create(v):(O.prototype=v.prototype,new O)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=i(17),l=i(1),s={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},f=100,h=function(x){o(w,x);function w(v){var O=x.call(this,v)||this;return O.scroll=O,O.observer=new MutationObserver(function(g){O.update(g)}),O.observer.observe(O.domNode,s),O.attach(),O}return w.prototype.detach=function(){x.prototype.detach.call(this),this.observer.disconnect()},w.prototype.deleteAt=function(v,O){this.update(),v===0&&O===this.length()?this.children.forEach(function(g){g.remove()}):x.prototype.deleteAt.call(this,v,O)},w.prototype.formatAt=function(v,O,g,b){this.update(),x.prototype.formatAt.call(this,v,O,g,b)},w.prototype.insertAt=function(v,O,g){this.update(),x.prototype.insertAt.call(this,v,O,g)},w.prototype.optimize=function(v,O){var g=this;v===void 0&&(v=[]),O===void 0&&(O={}),x.prototype.optimize.call(this,O);for(var b=[].slice.call(this.observer.takeRecords());b.length>0;)v.push(b.pop());for(var p=function(_,A){A===void 0&&(A=!0),!(_==null||_===g)&&_.domNode.parentNode!=null&&(_.domNode[l.DATA_KEY].mutations==null&&(_.domNode[l.DATA_KEY].mutations=[]),A&&p(_.parent))},y=function(_){_.domNode[l.DATA_KEY]==null||_.domNode[l.DATA_KEY].mutations==null||(_ instanceof a.default&&_.children.forEach(y),_.optimize(O))},d=v,m=0;d.length>0;m+=1){if(m>=f)throw new Error("[Parchment] Maximum optimize iterations reached");for(d.forEach(function(_){var A=l.find(_.target,!0);A!=null&&(A.domNode===_.target&&(_.type==="childList"?(p(l.find(_.previousSibling,!1)),[].forEach.call(_.addedNodes,function(C){var R=l.find(C,!1);p(R,!1),R instanceof a.default&&R.children.forEach(function(S){p(S,!1)})})):_.type==="attributes"&&p(A.prev)),p(A))}),this.children.forEach(y),d=[].slice.call(this.observer.takeRecords()),b=d.slice();b.length>0;)v.push(b.pop())}},w.prototype.update=function(v,O){var g=this;O===void 0&&(O={}),v=v||this.observer.takeRecords(),v.map(function(b){var p=l.find(b.target,!0);return p==null?null:p.domNode[l.DATA_KEY].mutations==null?(p.domNode[l.DATA_KEY].mutations=[b],p):(p.domNode[l.DATA_KEY].mutations.push(b),null)}).forEach(function(b){b==null||b===g||b.domNode[l.DATA_KEY]==null||b.update(b.domNode[l.DATA_KEY].mutations||[],O)}),this.domNode[l.DATA_KEY].mutations!=null&&x.prototype.update.call(this,this.domNode[l.DATA_KEY].mutations,O),this.optimize(v,O)},w.blotName="scroll",w.defaultChild="block",w.scope=l.Scope.BLOCK_BLOT,w.tagName="DIV",w}(a.default);r.default=h},function(n,r,i){var o=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,w){x.__proto__=w}||function(x,w){for(var v in w)w.hasOwnProperty(v)&&(x[v]=w[v])};return function(x,w){h(x,w);function v(){this.constructor=x}x.prototype=w===null?Object.create(w):(v.prototype=w.prototype,new v)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=i(18),l=i(1);function s(h,x){if(Object.keys(h).length!==Object.keys(x).length)return!1;for(var w in h)if(h[w]!==x[w])return!1;return!0}var f=function(h){o(x,h);function x(){return h!==null&&h.apply(this,arguments)||this}return x.formats=function(w){if(w.tagName!==x.tagName)return h.formats.call(this,w)},x.prototype.format=function(w,v){var O=this;w===this.statics.blotName&&!v?(this.children.forEach(function(g){g instanceof a.default||(g=g.wrap(x.blotName,!0)),O.attributes.copy(g)}),this.unwrap()):h.prototype.format.call(this,w,v)},x.prototype.formatAt=function(w,v,O,g){if(this.formats()[O]!=null||l.query(O,l.Scope.ATTRIBUTE)){var b=this.isolate(w,v);b.format(O,g)}else h.prototype.formatAt.call(this,w,v,O,g)},x.prototype.optimize=function(w){h.prototype.optimize.call(this,w);var v=this.formats();if(Object.keys(v).length===0)return this.unwrap();var O=this.next;O instanceof x&&O.prev===this&&s(v,O.formats())&&(O.moveChildren(this),O.remove())},x.blotName="inline",x.scope=l.Scope.INLINE_BLOT,x.tagName="SPAN",x}(a.default);r.default=f},function(n,r,i){var o=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,x){h.__proto__=x}||function(h,x){for(var w in x)x.hasOwnProperty(w)&&(h[w]=x[w])};return function(h,x){f(h,x);function w(){this.constructor=h}h.prototype=x===null?Object.create(x):(w.prototype=x.prototype,new w)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=i(18),l=i(1),s=function(f){o(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.formats=function(x){var w=l.query(h.blotName).tagName;if(x.tagName!==w)return f.formats.call(this,x)},h.prototype.format=function(x,w){l.query(x,l.Scope.BLOCK)!=null&&(x===this.statics.blotName&&!w?this.replaceWith(h.blotName):f.prototype.format.call(this,x,w))},h.prototype.formatAt=function(x,w,v,O){l.query(v,l.Scope.BLOCK)!=null?this.format(v,O):f.prototype.formatAt.call(this,x,w,v,O)},h.prototype.insertAt=function(x,w,v){if(v==null||l.query(w,l.Scope.INLINE)!=null)f.prototype.insertAt.call(this,x,w,v);else{var O=this.split(x),g=l.create(w,v);O.parent.insertBefore(g,O)}},h.prototype.update=function(x,w){navigator.userAgent.match(/Trident/)?this.build():f.prototype.update.call(this,x,w)},h.blotName="block",h.scope=l.Scope.BLOCK_BLOT,h.tagName="P",h}(a.default);r.default=s},function(n,r,i){var o=this&&this.__extends||function(){var s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,h){f.__proto__=h}||function(f,h){for(var x in h)h.hasOwnProperty(x)&&(f[x]=h[x])};return function(f,h){s(f,h);function x(){this.constructor=f}f.prototype=h===null?Object.create(h):(x.prototype=h.prototype,new x)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=i(19),l=function(s){o(f,s);function f(){return s!==null&&s.apply(this,arguments)||this}return f.formats=function(h){},f.prototype.format=function(h,x){s.prototype.formatAt.call(this,0,this.length(),h,x)},f.prototype.formatAt=function(h,x,w,v){h===0&&x===this.length()?this.format(w,v):s.prototype.formatAt.call(this,h,x,w,v)},f.prototype.formats=function(){return this.statics.formats(this.domNode)},f}(a.default);r.default=l},function(n,r,i){var o=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,x){h.__proto__=x}||function(h,x){for(var w in x)x.hasOwnProperty(w)&&(h[w]=x[w])};return function(h,x){f(h,x);function w(){this.constructor=h}h.prototype=x===null?Object.create(x):(w.prototype=x.prototype,new w)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=i(19),l=i(1),s=function(f){o(h,f);function h(x){var w=f.call(this,x)||this;return w.text=w.statics.value(w.domNode),w}return h.create=function(x){return document.createTextNode(x)},h.value=function(x){var w=x.data;return w.normalize&&(w=w.normalize()),w},h.prototype.deleteAt=function(x,w){this.domNode.data=this.text=this.text.slice(0,x)+this.text.slice(x+w)},h.prototype.index=function(x,w){return this.domNode===x?w:-1},h.prototype.insertAt=function(x,w,v){v==null?(this.text=this.text.slice(0,x)+w+this.text.slice(x),this.domNode.data=this.text):f.prototype.insertAt.call(this,x,w,v)},h.prototype.length=function(){return this.text.length},h.prototype.optimize=function(x){f.prototype.optimize.call(this,x),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof h&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},h.prototype.position=function(x,w){return[this.domNode,x]},h.prototype.split=function(x,w){if(w===void 0&&(w=!1),!w){if(x===0)return this;if(x===this.length())return this.next}var v=l.create(this.domNode.splitText(x));return this.parent.insertBefore(v,this.next),this.text=this.statics.value(this.domNode),v},h.prototype.update=function(x,w){var v=this;x.some(function(O){return O.type==="characterData"&&O.target===v.domNode})&&(this.text=this.statics.value(this.domNode))},h.prototype.value=function(){return this.text},h.blotName="text",h.scope=l.Scope.INLINE_BLOT,h}(a.default);r.default=s},function(n,r,i){var o=document.createElement("div");if(o.classList.toggle("test-class",!1),o.classList.contains("test-class")){var a=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(l,s){return arguments.length>1&&!this.contains(l)==!s?s:a.call(this,l)}}String.prototype.startsWith||(String.prototype.startsWith=function(l,s){return s=s||0,this.substr(s,l.length)===l}),String.prototype.endsWith||(String.prototype.endsWith=function(l,s){var f=this.toString();(typeof s!="number"||!isFinite(s)||Math.floor(s)!==s||s>f.length)&&(s=f.length),s-=l.length;var h=f.indexOf(l,s);return h!==-1&&h===s}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(s){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof s!="function")throw new TypeError("predicate must be a function");for(var f=Object(this),h=f.length>>>0,x=arguments[1],w,v=0;v<h;v++)if(w=f[v],s.call(x,w,v,f))return w}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(n,r){var i=-1,o=1,a=0;function l(m,_,A){if(m==_)return m?[[a,m]]:[];(A<0||m.length<A)&&(A=null);var C=x(m,_),R=m.substring(0,C);m=m.substring(C),_=_.substring(C),C=w(m,_);var S=m.substring(m.length-C);m=m.substring(0,m.length-C),_=_.substring(0,_.length-C);var E=s(m,_);return R&&E.unshift([a,R]),S&&E.push([a,S]),O(E),A!=null&&(E=p(E,A)),E=y(E),E}function s(m,_){var A;if(!m)return[[o,_]];if(!_)return[[i,m]];var C=m.length>_.length?m:_,R=m.length>_.length?_:m,S=C.indexOf(R);if(S!=-1)return A=[[o,C.substring(0,S)],[a,R],[o,C.substring(S+R.length)]],m.length>_.length&&(A[0][0]=A[2][0]=i),A;if(R.length==1)return[[i,m],[o,_]];var E=v(m,_);if(E){var P=E[0],T=E[1],N=E[2],U=E[3],G=E[4],Z=l(P,N),W=l(T,U);return Z.concat([[a,G]],W)}return f(m,_)}function f(m,_){for(var A=m.length,C=_.length,R=Math.ceil((A+C)/2),S=R,E=2*R,P=new Array(E),T=new Array(E),N=0;N<E;N++)P[N]=-1,T[N]=-1;P[S+1]=0,T[S+1]=0;for(var U=A-C,G=U%2!=0,Z=0,W=0,H=0,L=0,M=0;M<R;M++){for(var D=-M+Z;D<=M-W;D+=2){var B=S+D,V;D==-M||D!=M&&P[B-1]<P[B+1]?V=P[B+1]:V=P[B-1]+1;for(var Y=V-D;V<A&&Y<C&&m.charAt(V)==_.charAt(Y);)V++,Y++;if(P[B]=V,V>A)W+=2;else if(Y>C)Z+=2;else if(G){var F=S+U-D;if(F>=0&&F<E&&T[F]!=-1){var $=A-T[F];if(V>=$)return h(m,_,V,Y)}}}for(var z=-M+H;z<=M-L;z+=2){var F=S+z,$;z==-M||z!=M&&T[F-1]<T[F+1]?$=T[F+1]:$=T[F-1]+1;for(var K=$-z;$<A&&K<C&&m.charAt(A-$-1)==_.charAt(C-K-1);)$++,K++;if(T[F]=$,$>A)L+=2;else if(K>C)H+=2;else if(!G){var B=S+U-z;if(B>=0&&B<E&&P[B]!=-1){var V=P[B],Y=S+V-B;if($=A-$,V>=$)return h(m,_,V,Y)}}}}return[[i,m],[o,_]]}function h(m,_,A,C){var R=m.substring(0,A),S=_.substring(0,C),E=m.substring(A),P=_.substring(C),T=l(R,S),N=l(E,P);return T.concat(N)}function x(m,_){if(!m||!_||m.charAt(0)!=_.charAt(0))return 0;for(var A=0,C=Math.min(m.length,_.length),R=C,S=0;A<R;)m.substring(S,R)==_.substring(S,R)?(A=R,S=A):C=R,R=Math.floor((C-A)/2+A);return R}function w(m,_){if(!m||!_||m.charAt(m.length-1)!=_.charAt(_.length-1))return 0;for(var A=0,C=Math.min(m.length,_.length),R=C,S=0;A<R;)m.substring(m.length-R,m.length-S)==_.substring(_.length-R,_.length-S)?(A=R,S=A):C=R,R=Math.floor((C-A)/2+A);return R}function v(m,_){var A=m.length>_.length?m:_,C=m.length>_.length?_:m;if(A.length<4||C.length*2<A.length)return null;function R(W,H,L){for(var M=W.substring(L,L+Math.floor(W.length/4)),D=-1,B="",V,Y,F,$;(D=H.indexOf(M,D+1))!=-1;){var z=x(W.substring(L),H.substring(D)),K=w(W.substring(0,L),H.substring(0,D));B.length<K+z&&(B=H.substring(D-K,D)+H.substring(D,D+z),V=W.substring(0,L-K),Y=W.substring(L+z),F=H.substring(0,D-K),$=H.substring(D+z))}return B.length*2>=W.length?[V,Y,F,$,B]:null}var S=R(A,C,Math.ceil(A.length/4)),E=R(A,C,Math.ceil(A.length/2)),P;if(!S&&!E)return null;E?S?P=S[4].length>E[4].length?S:E:P=E:P=S;var T,N,U,G;m.length>_.length?(T=P[0],N=P[1],U=P[2],G=P[3]):(U=P[0],G=P[1],T=P[2],N=P[3]);var Z=P[4];return[T,N,U,G,Z]}function O(m){m.push([a,""]);for(var _=0,A=0,C=0,R="",S="",E;_<m.length;)switch(m[_][0]){case o:C++,S+=m[_][1],_++;break;case i:A++,R+=m[_][1],_++;break;case a:A+C>1?(A!==0&&C!==0&&(E=x(S,R),E!==0&&(_-A-C>0&&m[_-A-C-1][0]==a?m[_-A-C-1][1]+=S.substring(0,E):(m.splice(0,0,[a,S.substring(0,E)]),_++),S=S.substring(E),R=R.substring(E)),E=w(S,R),E!==0&&(m[_][1]=S.substring(S.length-E)+m[_][1],S=S.substring(0,S.length-E),R=R.substring(0,R.length-E))),A===0?m.splice(_-C,A+C,[o,S]):C===0?m.splice(_-A,A+C,[i,R]):m.splice(_-A-C,A+C,[i,R],[o,S]),_=_-A-C+(A?1:0)+(C?1:0)+1):_!==0&&m[_-1][0]==a?(m[_-1][1]+=m[_][1],m.splice(_,1)):_++,C=0,A=0,R="",S="";break}m[m.length-1][1]===""&&m.pop();var P=!1;for(_=1;_<m.length-1;)m[_-1][0]==a&&m[_+1][0]==a&&(m[_][1].substring(m[_][1].length-m[_-1][1].length)==m[_-1][1]?(m[_][1]=m[_-1][1]+m[_][1].substring(0,m[_][1].length-m[_-1][1].length),m[_+1][1]=m[_-1][1]+m[_+1][1],m.splice(_-1,1),P=!0):m[_][1].substring(0,m[_+1][1].length)==m[_+1][1]&&(m[_-1][1]+=m[_+1][1],m[_][1]=m[_][1].substring(m[_+1][1].length)+m[_+1][1],m.splice(_+1,1),P=!0)),_++;P&&O(m)}var g=l;g.INSERT=o,g.DELETE=i,g.EQUAL=a,n.exports=g;function b(m,_){if(_===0)return[a,m];for(var A=0,C=0;C<m.length;C++){var R=m[C];if(R[0]===i||R[0]===a){var S=A+R[1].length;if(_===S)return[C+1,m];if(_<S){m=m.slice();var E=_-A,P=[R[0],R[1].slice(0,E)],T=[R[0],R[1].slice(E)];return m.splice(C,1,P,T),[C+1,m]}else A=S}}throw new Error("cursor_pos is out of bounds!")}function p(m,_){var A=b(m,_),C=A[1],R=A[0],S=C[R],E=C[R+1];if(S==null)return m;if(S[0]!==a)return m;if(E!=null&&S[1]+E[1]===E[1]+S[1])return C.splice(R,2,E,S),d(C,R,2);if(E!=null&&E[1].indexOf(S[1])===0){C.splice(R,2,[E[0],S[1]],[0,S[1]]);var P=E[1].slice(S[1].length);return P.length>0&&C.splice(R+2,0,[E[0],P]),d(C,R,3)}else return m}function y(m){for(var _=!1,A=function(E){return E.charCodeAt(0)>=56320&&E.charCodeAt(0)<=57343},C=function(E){return E.charCodeAt(E.length-1)>=55296&&E.charCodeAt(E.length-1)<=56319},R=2;R<m.length;R+=1)m[R-2][0]===a&&C(m[R-2][1])&&m[R-1][0]===i&&A(m[R-1][1])&&m[R][0]===o&&A(m[R][1])&&(_=!0,m[R-1][1]=m[R-2][1].slice(-1)+m[R-1][1],m[R][1]=m[R-2][1].slice(-1)+m[R][1],m[R-2][1]=m[R-2][1].slice(0,-1));if(!_)return m;for(var S=[],R=0;R<m.length;R+=1)m[R][1].length>0&&S.push(m[R]);return S}function d(m,_,A){for(var C=_+A-1;C>=0&&C>=_-1;C--)if(C+1<m.length){var R=m[C],S=m[C+1];R[0]===S[1]&&m.splice(C,2,[R[0],R[1]+S[1]])}return m}},function(n,r){r=n.exports=typeof Object.keys=="function"?Object.keys:i,r.shim=i;function i(o){var a=[];for(var l in o)a.push(l);return a}},function(n,r){var i=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";r=n.exports=i?o:a,r.supported=o;function o(l){return Object.prototype.toString.call(l)=="[object Arguments]"}r.unsupported=a;function a(l){return l&&typeof l=="object"&&typeof l.length=="number"&&Object.prototype.hasOwnProperty.call(l,"callee")&&!Object.prototype.propertyIsEnumerable.call(l,"callee")||!1}},function(n,r){var i=Object.prototype.hasOwnProperty,o="~";function a(){}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(o=!1));function l(f,h,x){this.fn=f,this.context=h,this.once=x||!1}function s(){this._events=new a,this._eventsCount=0}s.prototype.eventNames=function(){var h=[],x,w;if(this._eventsCount===0)return h;for(w in x=this._events)i.call(x,w)&&h.push(o?w.slice(1):w);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(x)):h},s.prototype.listeners=function(h,x){var w=o?o+h:h,v=this._events[w];if(x)return!!v;if(!v)return[];if(v.fn)return[v.fn];for(var O=0,g=v.length,b=new Array(g);O<g;O++)b[O]=v[O].fn;return b},s.prototype.emit=function(h,x,w,v,O,g){var b=o?o+h:h;if(!this._events[b])return!1;var p=this._events[b],y=arguments.length,d,m;if(p.fn){switch(p.once&&this.removeListener(h,p.fn,void 0,!0),y){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,x),!0;case 3:return p.fn.call(p.context,x,w),!0;case 4:return p.fn.call(p.context,x,w,v),!0;case 5:return p.fn.call(p.context,x,w,v,O),!0;case 6:return p.fn.call(p.context,x,w,v,O,g),!0}for(m=1,d=new Array(y-1);m<y;m++)d[m-1]=arguments[m];p.fn.apply(p.context,d)}else{var _=p.length,A;for(m=0;m<_;m++)switch(p[m].once&&this.removeListener(h,p[m].fn,void 0,!0),y){case 1:p[m].fn.call(p[m].context);break;case 2:p[m].fn.call(p[m].context,x);break;case 3:p[m].fn.call(p[m].context,x,w);break;case 4:p[m].fn.call(p[m].context,x,w,v);break;default:if(!d)for(A=1,d=new Array(y-1);A<y;A++)d[A-1]=arguments[A];p[m].fn.apply(p[m].context,d)}}return!0},s.prototype.on=function(h,x,w){var v=new l(x,w||this),O=o?o+h:h;return this._events[O]?this._events[O].fn?this._events[O]=[this._events[O],v]:this._events[O].push(v):(this._events[O]=v,this._eventsCount++),this},s.prototype.once=function(h,x,w){var v=new l(x,w||this,!0),O=o?o+h:h;return this._events[O]?this._events[O].fn?this._events[O]=[this._events[O],v]:this._events[O].push(v):(this._events[O]=v,this._eventsCount++),this},s.prototype.removeListener=function(h,x,w,v){var O=o?o+h:h;if(!this._events[O])return this;if(!x)return--this._eventsCount===0?this._events=new a:delete this._events[O],this;var g=this._events[O];if(g.fn)g.fn===x&&(!v||g.once)&&(!w||g.context===w)&&(--this._eventsCount===0?this._events=new a:delete this._events[O]);else{for(var b=0,p=[],y=g.length;b<y;b++)(g[b].fn!==x||v&&!g[b].once||w&&g[b].context!==w)&&p.push(g[b]);p.length?this._events[O]=p.length===1?p[0]:p:--this._eventsCount===0?this._events=new a:delete this._events[O]}return this},s.prototype.removeAllListeners=function(h){var x;return h?(x=o?o+h:h,this._events[x]&&(--this._eventsCount===0?this._events=new a:delete this._events[x])):(this._events=new a,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.prefixed=o,s.EventEmitter=s,typeof n<"u"&&(n.exports=s)},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.matchText=r.matchSpacing=r.matchNewline=r.matchBlot=r.matchAttributor=r.default=void 0;var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(re){return typeof re}:function(re){return re&&typeof Symbol=="function"&&re.constructor===Symbol&&re!==Symbol.prototype?"symbol":typeof re},a=function(){function re(ae,we){var be=[],te=!0,fe=!1,de=void 0;try{for(var Ee=ae[Symbol.iterator](),Ve;!(te=(Ve=Ee.next()).done)&&(be.push(Ve.value),!(we&&be.length===we));te=!0);}catch(Je){fe=!0,de=Je}finally{try{!te&&Ee.return&&Ee.return()}finally{if(fe)throw de}}return be}return function(ae,we){if(Array.isArray(ae))return ae;if(Symbol.iterator in Object(ae))return re(ae,we);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function re(ae,we){for(var be=0;be<we.length;be++){var te=we[be];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(ae,te.key,te)}}return function(ae,we,be){return we&&re(ae.prototype,we),be&&re(ae,be),ae}}(),s=i(3),f=T(s),h=i(2),x=T(h),w=i(0),v=T(w),O=i(5),g=T(O),b=i(10),p=T(b),y=i(9),d=T(y),m=i(36),_=i(37),A=i(13),C=T(A),R=i(26),S=i(38),E=i(39),P=i(40);function T(re){return re&&re.__esModule?re:{default:re}}function N(re,ae,we){return ae in re?Object.defineProperty(re,ae,{value:we,enumerable:!0,configurable:!0,writable:!0}):re[ae]=we,re}function U(re,ae){if(!(re instanceof ae))throw new TypeError("Cannot call a class as a function")}function G(re,ae){if(!re)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ae&&(typeof ae=="object"||typeof ae=="function")?ae:re}function Z(re,ae){if(typeof ae!="function"&&ae!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof ae);re.prototype=Object.create(ae&&ae.prototype,{constructor:{value:re,enumerable:!1,writable:!0,configurable:!0}}),ae&&(Object.setPrototypeOf?Object.setPrototypeOf(re,ae):re.__proto__=ae)}var W=(0,p.default)("quill:clipboard"),H="__ql-matcher",L=[[Node.TEXT_NODE,Pe],[Node.TEXT_NODE,oe],["br",J],[Node.ELEMENT_NODE,oe],[Node.ELEMENT_NODE,Q],[Node.ELEMENT_NODE,he],[Node.ELEMENT_NODE,X],[Node.ELEMENT_NODE,me],["li",ie],["b",K.bind(K,"bold")],["i",K.bind(K,"italic")],["style",ne]],M=[m.AlignAttribute,S.DirectionAttribute].reduce(function(re,ae){return re[ae.keyName]=ae,re},{}),D=[m.AlignStyle,_.BackgroundStyle,R.ColorStyle,S.DirectionStyle,E.FontStyle,P.SizeStyle].reduce(function(re,ae){return re[ae.keyName]=ae,re},{}),B=function(re){Z(ae,re);function ae(we,be){U(this,ae);var te=G(this,(ae.__proto__||Object.getPrototypeOf(ae)).call(this,we,be));return te.quill.root.addEventListener("paste",te.onPaste.bind(te)),te.container=te.quill.addContainer("ql-clipboard"),te.container.setAttribute("contenteditable",!0),te.container.setAttribute("tabindex",-1),te.matchers=[],L.concat(te.options.matchers).forEach(function(fe){var de=a(fe,2),Ee=de[0],Ve=de[1];!be.matchVisual&&Ve===he||te.addMatcher(Ee,Ve)}),te}return l(ae,[{key:"addMatcher",value:function(be,te){this.matchers.push([be,te])}},{key:"convert",value:function(be){if(typeof be=="string")return this.container.innerHTML=be.replace(/\>\r?\n +\</g,"><"),this.convert();var te=this.quill.getFormat(this.quill.selection.savedRange.index);if(te[C.default.blotName]){var fe=this.container.innerText;return this.container.innerHTML="",new x.default().insert(fe,N({},C.default.blotName,te[C.default.blotName]))}var de=this.prepareMatching(),Ee=a(de,2),Ve=Ee[0],Je=Ee[1],Ae=z(this.container,Ve,Je);return F(Ae,`
|
|
140
|
-
`)&&Ae.ops[Ae.ops.length-1].attributes==null&&(Ae=Ae.compose(new x.default().retain(Ae.length()-1).delete(1))),W.log("convert",this.container.innerHTML,Ae),this.container.innerHTML="",Ae}},{key:"dangerouslyPasteHTML",value:function(be,te){var fe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:g.default.sources.API;if(typeof be=="string")this.quill.setContents(this.convert(be),te),this.quill.setSelection(0,g.default.sources.SILENT);else{var
|
|
136
|
+
`,K.format).retain(J.length()-ne-1).retain(1,{header:null});this.quill.updateContents(ie,_.default.sources.USER),this.quill.setSelection(z.index+1,_.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(z,K){var X=K.prefix.length,Q=this.quill.getLine(z.index),J=a(Q,2),ne=J[0],ie=J[1];if(ie>X)return!0;var oe=void 0;switch(K.prefix.trim()){case"[]":case"[ ]":oe="unchecked";break;case"[x]":oe="checked";break;case"-":case"*":oe="bullet";break;default:oe="ordered"}this.quill.insertText(z.index," ",_.default.sources.USER),this.quill.history.cutoff();var de=new g.default().retain(z.index-ie).delete(X+1).retain(ne.length()-2-ie).retain(1,{list:oe});this.quill.updateContents(de,_.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(z.index-X,_.default.sources.SILENT)}},"code exit":{key:W.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(z){var K=this.quill.getLine(z.index),X=a(K,2),Q=X[0],J=X[1],ne=new g.default().retain(z.index+Q.length()-J-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(ne,_.default.sources.USER)}},"embed left":H(W.keys.LEFT,!1),"embed left shift":H(W.keys.LEFT,!0),"embed right":H(W.keys.RIGHT,!1),"embed right shift":H(W.keys.RIGHT,!0)}};function H($,z){var K,X=$===W.keys.LEFT?"prefix":"suffix";return K={key:$,shiftKey:z,altKey:null},P(K,X,/^$/),P(K,"handler",function(J){var ne=J.index;$===W.keys.RIGHT&&(ne+=J.length+1);var ie=this.quill.getLeaf(ne),oe=a(ie,1),de=oe[0];return de instanceof d.default.Embed?($===W.keys.LEFT?z?this.quill.setSelection(J.index-1,J.length+1,_.default.sources.USER):this.quill.setSelection(J.index-1,_.default.sources.USER):z?this.quill.setSelection(J.index,J.length+1,_.default.sources.USER):this.quill.setSelection(J.index+J.length+1,_.default.sources.USER),!1):!0}),K}function L($,z){if(!($.index===0||this.quill.getLength()<=1)){var K=this.quill.getLine($.index),X=a(K,1),Q=X[0],J={};if(z.offset===0){var ne=this.quill.getLine($.index-1),ie=a(ne,1),oe=ie[0];if(oe!=null&&oe.length()>1){var de=Q.formats(),me=this.quill.getFormat($.index-1,1);J=p.default.attributes.diff(de,me)||{}}}var Pe=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(z.prefix)?2:1;this.quill.deleteText($.index-Pe,Pe,_.default.sources.USER),Object.keys(J).length>0&&this.quill.formatLine($.index-Pe,Pe,J,_.default.sources.USER),this.quill.focus()}}function M($,z){var K=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(z.suffix)?2:1;if(!($.index>=this.quill.getLength()-K)){var X={},Q=0,J=this.quill.getLine($.index),ne=a(J,1),ie=ne[0];if(z.offset>=ie.length()-1){var oe=this.quill.getLine($.index+1),de=a(oe,1),me=de[0];if(me){var Pe=ie.formats(),re=this.quill.getFormat($.index,1);X=p.default.attributes.diff(Pe,re)||{},Q=me.length()}}this.quill.deleteText($.index,K,_.default.sources.USER),Object.keys(X).length>0&&this.quill.formatLine($.index+Q-1,K,X,_.default.sources.USER)}}function D($){var z=this.quill.getLines($),K={};if(z.length>1){var X=z[0].formats(),Q=z[z.length-1].formats();K=p.default.attributes.diff(Q,X)||{}}this.quill.deleteText($,_.default.sources.USER),Object.keys(K).length>0&&this.quill.formatLine($.index,1,K,_.default.sources.USER),this.quill.setSelection($.index,_.default.sources.SILENT),this.quill.focus()}function B($,z){var K=this;$.length>0&&this.quill.scroll.deleteAt($.index,$.length);var X=Object.keys(z.format).reduce(function(Q,J){return d.default.query(J,d.default.Scope.BLOCK)&&!Array.isArray(z.format[J])&&(Q[J]=z.format[J]),Q},{});this.quill.insertText($.index,`
|
|
137
|
+
`,X,_.default.sources.USER),this.quill.setSelection($.index+1,_.default.sources.SILENT),this.quill.focus(),Object.keys(z.format).forEach(function(Q){X[Q]==null&&(Array.isArray(z.format[Q])||Q!=="link"&&K.quill.format(Q,z.format[Q],_.default.sources.USER))})}function V($){return{key:W.keys.TAB,shiftKey:!$,format:{"code-block":!0},handler:function(K){var X=d.default.query("code-block"),Q=K.index,J=K.length,ne=this.quill.scroll.descendant(X,Q),ie=a(ne,2),oe=ie[0],de=ie[1];if(oe!=null){var me=this.quill.getIndex(oe),Pe=oe.newlineIndex(de,!0)+1,re=oe.newlineIndex(me+de+J),ae=oe.domNode.textContent.slice(Pe,re).split(`
|
|
138
|
+
`);de=0,ae.forEach(function(we,be){$?(oe.insertAt(Pe+de,X.TAB),de+=X.TAB.length,be===0?Q+=X.TAB.length:J+=X.TAB.length):we.startsWith(X.TAB)&&(oe.deleteAt(Pe+de,X.TAB.length),de-=X.TAB.length,be===0?Q-=X.TAB.length:J-=X.TAB.length),de+=we.length+1}),this.quill.update(_.default.sources.USER),this.quill.setSelection(Q,J,_.default.sources.SILENT)}}}}function Y($){return{key:$[0].toUpperCase(),shortKey:!0,handler:function(K,X){this.quill.format($,!X.format[$],_.default.sources.USER)}}}function F($){if(typeof $=="string"||typeof $=="number")return F({key:$});if((typeof $>"u"?"undefined":o($))==="object"&&($=(0,f.default)($,!1)),typeof $.key=="string")if(W.keys[$.key.toUpperCase()]!=null)$.key=W.keys[$.key.toUpperCase()];else if($.key.length===1)$.key=$.key.toUpperCase().charCodeAt(0);else return null;return $.shortKey&&($[Z]=$.shortKey,delete $.shortKey),$}r.default=W,r.SHORTKEY=Z},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function p(y,d){var m=[],_=!0,A=!1,C=void 0;try{for(var R=y[Symbol.iterator](),S;!(_=(S=R.next()).done)&&(m.push(S.value),!(d&&m.length===d));_=!0);}catch(E){A=!0,C=E}finally{try{!_&&R.return&&R.return()}finally{if(A)throw C}}return m}return function(y,d){if(Array.isArray(y))return y;if(Symbol.iterator in Object(y))return p(y,d);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function p(y,d,m){y===null&&(y=Function.prototype);var _=Object.getOwnPropertyDescriptor(y,d);if(_===void 0){var A=Object.getPrototypeOf(y);return A===null?void 0:p(A,d,m)}else{if("value"in _)return _.value;var C=_.get;return C===void 0?void 0:C.call(m)}},l=function(){function p(y,d){for(var m=0;m<d.length;m++){var _=d[m];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(y,_.key,_)}}return function(y,d,m){return d&&p(y.prototype,d),m&&p(y,m),y}}(),s=i(0),f=w(s),h=i(7),x=w(h);function w(p){return p&&p.__esModule?p:{default:p}}function v(p,y){if(!(p instanceof y))throw new TypeError("Cannot call a class as a function")}function O(p,y){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:p}function g(p,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);p.prototype=Object.create(y&&y.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(p,y):p.__proto__=y)}var b=function(p){g(y,p),l(y,null,[{key:"value",value:function(){}}]);function y(d,m){v(this,y);var _=O(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,d));return _.selection=m,_.textNode=document.createTextNode(y.CONTENTS),_.domNode.appendChild(_.textNode),_._length=0,_}return l(y,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(m,_){if(this._length!==0)return a(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"format",this).call(this,m,_);for(var A=this,C=0;A!=null&&A.statics.scope!==f.default.Scope.BLOCK_BLOT;)C+=A.offset(A.parent),A=A.parent;A!=null&&(this._length=y.CONTENTS.length,A.optimize(),A.formatAt(C,y.CONTENTS.length,m,_),this._length=0)}},{key:"index",value:function(m,_){return m===this.textNode?0:a(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"index",this).call(this,m,_)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){a(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var m=this.textNode,_=this.selection.getNativeRange(),A=void 0,C=void 0,R=void 0;if(_!=null&&_.start.node===m&&_.end.node===m){var S=[m,_.start.offset,_.end.offset];A=S[0],C=S[1],R=S[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==y.CONTENTS){var E=this.textNode.data.split(y.CONTENTS).join("");this.next instanceof x.default?(A=this.next.domNode,this.next.insertAt(0,E),this.textNode.data=y.CONTENTS):(this.textNode.data=E,this.parent.insertBefore(f.default.create(this.textNode),this),this.textNode=document.createTextNode(y.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),C!=null){var P=[C,R].map(function(N){return Math.max(0,Math.min(A.data.length,N-1))}),T=o(P,2);return C=T[0],R=T[1],{startNode:A,startOffset:C,endNode:A,endOffset:R}}}}},{key:"update",value:function(m,_){var A=this;if(m.some(function(R){return R.type==="characterData"&&R.target===A.textNode})){var C=this.restore();C&&(_.range=C)}}},{key:"value",value:function(){return""}}]),y}(f.default.Embed);b.blotName="cursor",b.className="ql-cursor",b.tagName="span",b.CONTENTS="\uFEFF",r.default=b},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(0),a=f(o),l=i(4),s=f(l);function f(O){return O&&O.__esModule?O:{default:O}}function h(O,g){if(!(O instanceof g))throw new TypeError("Cannot call a class as a function")}function x(O,g){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:O}function w(O,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);O.prototype=Object.create(g&&g.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(O,g):O.__proto__=g)}var v=function(O){w(g,O);function g(){return h(this,g),x(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return g}(a.default.Container);v.allowedChildren=[s.default,l.BlockEmbed,v],r.default=v},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.ColorStyle=r.ColorClass=r.ColorAttributor=void 0;var o=function(){function b(p,y){for(var d=0;d<y.length;d++){var m=y[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(p,m.key,m)}}return function(p,y,d){return y&&b(p.prototype,y),d&&b(p,d),p}}(),a=function b(p,y,d){p===null&&(p=Function.prototype);var m=Object.getOwnPropertyDescriptor(p,y);if(m===void 0){var _=Object.getPrototypeOf(p);return _===null?void 0:b(_,y,d)}else{if("value"in m)return m.value;var A=m.get;return A===void 0?void 0:A.call(d)}},l=i(0),s=f(l);function f(b){return b&&b.__esModule?b:{default:b}}function h(b,p){if(!(b instanceof p))throw new TypeError("Cannot call a class as a function")}function x(b,p){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:b}function w(b,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);b.prototype=Object.create(p&&p.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(b,p):b.__proto__=p)}var v=function(b){w(p,b);function p(){return h(this,p),x(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return o(p,[{key:"value",value:function(d){var m=a(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"value",this).call(this,d);return m.startsWith("rgb(")?(m=m.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+m.split(",").map(function(_){return("00"+parseInt(_).toString(16)).slice(-2)}).join("")):m}}]),p}(s.default.Attributor.Style),O=new s.default.Attributor.Class("color","ql-color",{scope:s.default.Scope.INLINE}),g=new v("color","color",{scope:s.default.Scope.INLINE});r.ColorAttributor=v,r.ColorClass=O,r.ColorStyle=g},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.sanitize=r.default=void 0;var o=function(){function g(b,p){for(var y=0;y<p.length;y++){var d=p[y];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(b,d.key,d)}}return function(b,p,y){return p&&g(b.prototype,p),y&&g(b,y),b}}(),a=function g(b,p,y){b===null&&(b=Function.prototype);var d=Object.getOwnPropertyDescriptor(b,p);if(d===void 0){var m=Object.getPrototypeOf(b);return m===null?void 0:g(m,p,y)}else{if("value"in d)return d.value;var _=d.get;return _===void 0?void 0:_.call(y)}},l=i(6),s=f(l);function f(g){return g&&g.__esModule?g:{default:g}}function h(g,b){if(!(g instanceof b))throw new TypeError("Cannot call a class as a function")}function x(g,b){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:g}function w(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(g,b):g.__proto__=b)}var v=function(g){w(b,g);function b(){return h(this,b),x(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return o(b,[{key:"format",value:function(y,d){if(y!==this.statics.blotName||!d)return a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,y,d);d=this.constructor.sanitize(d),this.domNode.setAttribute("href",d)}}],[{key:"create",value:function(y){var d=a(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,y);return y=this.sanitize(y),d.setAttribute("href",y),d.setAttribute("rel","noopener noreferrer"),d.setAttribute("target","_blank"),d}},{key:"formats",value:function(y){return y.getAttribute("href")}},{key:"sanitize",value:function(y){return O(y,this.PROTOCOL_WHITELIST)?y:this.SANITIZED_URL}}]),b}(s.default);v.blotName="link",v.tagName="A",v.SANITIZED_URL="about:blank",v.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function O(g,b){var p=document.createElement("a");p.href=g;var y=p.href.slice(0,p.href.indexOf(":"));return b.indexOf(y)>-1}r.default=v,r.sanitize=O},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},a=function(){function b(p,y){for(var d=0;d<y.length;d++){var m=y[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(p,m.key,m)}}return function(p,y,d){return y&&b(p.prototype,y),d&&b(p,d),p}}(),l=i(23),s=x(l),f=i(107),h=x(f);function x(b){return b&&b.__esModule?b:{default:b}}function w(b,p){if(!(b instanceof p))throw new TypeError("Cannot call a class as a function")}var v=0;function O(b,p){b.setAttribute(p,b.getAttribute(p)!=="true")}var g=function(){function b(p){var y=this;w(this,b),this.select=p,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){y.togglePicker()}),this.label.addEventListener("keydown",function(d){switch(d.keyCode){case s.default.keys.ENTER:y.togglePicker();break;case s.default.keys.ESCAPE:y.escape(),d.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return a(b,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),O(this.label,"aria-expanded"),O(this.options,"aria-hidden")}},{key:"buildItem",value:function(y){var d=this,m=document.createElement("span");return m.tabIndex="0",m.setAttribute("role","button"),m.classList.add("ql-picker-item"),y.hasAttribute("value")&&m.setAttribute("data-value",y.getAttribute("value")),y.textContent&&m.setAttribute("data-label",y.textContent),m.addEventListener("click",function(){d.selectItem(m,!0)}),m.addEventListener("keydown",function(_){switch(_.keyCode){case s.default.keys.ENTER:d.selectItem(m,!0),_.preventDefault();break;case s.default.keys.ESCAPE:d.escape(),_.preventDefault();break}}),m}},{key:"buildLabel",value:function(){var y=document.createElement("span");return y.classList.add("ql-picker-label"),y.innerHTML=h.default,y.tabIndex="0",y.setAttribute("role","button"),y.setAttribute("aria-expanded","false"),this.container.appendChild(y),y}},{key:"buildOptions",value:function(){var y=this,d=document.createElement("span");d.classList.add("ql-picker-options"),d.setAttribute("aria-hidden","true"),d.tabIndex="-1",d.id="ql-picker-options-"+v,v+=1,this.label.setAttribute("aria-controls",d.id),this.options=d,[].slice.call(this.select.options).forEach(function(m){var _=y.buildItem(m);d.appendChild(_),m.selected===!0&&y.selectItem(_)}),this.container.appendChild(d)}},{key:"buildPicker",value:function(){var y=this;[].slice.call(this.select.attributes).forEach(function(d){y.container.setAttribute(d.name,d.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var y=this;this.close(),setTimeout(function(){return y.label.focus()},1)}},{key:"close",value:function(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function(y){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m=this.container.querySelector(".ql-selected");if(y!==m&&(m!=null&&m.classList.remove("ql-selected"),y!=null&&(y.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(y.parentNode.children,y),y.hasAttribute("data-value")?this.label.setAttribute("data-value",y.getAttribute("data-value")):this.label.removeAttribute("data-value"),y.hasAttribute("data-label")?this.label.setAttribute("data-label",y.getAttribute("data-label")):this.label.removeAttribute("data-label"),d))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":o(Event))==="object"){var _=document.createEvent("Event");_.initEvent("change",!0,!0),this.select.dispatchEvent(_)}this.close()}}},{key:"update",value:function(){var y=void 0;if(this.select.selectedIndex>-1){var d=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];y=this.select.options[this.select.selectedIndex],this.selectItem(d)}else this.selectItem(null);var m=y!=null&&y!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",m)}}]),b}();r.default=g},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(0),a=G(o),l=i(5),s=G(l),f=i(4),h=G(f),x=i(16),w=G(x),v=i(25),O=G(v),g=i(24),b=G(g),p=i(35),y=G(p),d=i(6),m=G(d),_=i(22),A=G(_),C=i(7),R=G(C),S=i(55),E=G(S),P=i(42),T=G(P),N=i(23),U=G(N);function G(Z){return Z&&Z.__esModule?Z:{default:Z}}s.default.register({"blots/block":h.default,"blots/block/embed":f.BlockEmbed,"blots/break":w.default,"blots/container":O.default,"blots/cursor":b.default,"blots/embed":y.default,"blots/inline":m.default,"blots/scroll":A.default,"blots/text":R.default,"modules/clipboard":E.default,"modules/history":T.default,"modules/keyboard":U.default}),a.default.register(h.default,w.default,b.default,m.default,A.default,R.default),r.default=s.default},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(1),a=function(){function l(s){this.domNode=s,this.domNode[o.DATA_KEY]={blot:this}}return Object.defineProperty(l.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),l.create=function(s){if(this.tagName==null)throw new o.ParchmentError("Blot definition missing tagName");var f;return Array.isArray(this.tagName)?(typeof s=="string"&&(s=s.toUpperCase(),parseInt(s).toString()===s&&(s=parseInt(s))),typeof s=="number"?f=document.createElement(this.tagName[s-1]):this.tagName.indexOf(s)>-1?f=document.createElement(s):f=document.createElement(this.tagName[0])):f=document.createElement(this.tagName),this.className&&f.classList.add(this.className),f},l.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},l.prototype.clone=function(){var s=this.domNode.cloneNode(!1);return o.create(s)},l.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[o.DATA_KEY]},l.prototype.deleteAt=function(s,f){var h=this.isolate(s,f);h.remove()},l.prototype.formatAt=function(s,f,h,x){var w=this.isolate(s,f);if(o.query(h,o.Scope.BLOT)!=null&&x)w.wrap(h,x);else if(o.query(h,o.Scope.ATTRIBUTE)!=null){var v=o.create(this.statics.scope);w.wrap(v),v.format(h,x)}},l.prototype.insertAt=function(s,f,h){var x=h==null?o.create("text",f):o.create(f,h),w=this.split(s);this.parent.insertBefore(x,w)},l.prototype.insertInto=function(s,f){f===void 0&&(f=null),this.parent!=null&&this.parent.children.remove(this);var h=null;s.children.insertBefore(this,f),f!=null&&(h=f.domNode),(this.domNode.parentNode!=s.domNode||this.domNode.nextSibling!=h)&&s.domNode.insertBefore(this.domNode,h),this.parent=s,this.attach()},l.prototype.isolate=function(s,f){var h=this.split(s);return h.split(f),h},l.prototype.length=function(){return 1},l.prototype.offset=function(s){return s===void 0&&(s=this.parent),this.parent==null||this==s?0:this.parent.children.offset(this)+this.parent.offset(s)},l.prototype.optimize=function(s){this.domNode[o.DATA_KEY]!=null&&delete this.domNode[o.DATA_KEY].mutations},l.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},l.prototype.replace=function(s){s.parent!=null&&(s.parent.insertBefore(this,s.next),s.remove())},l.prototype.replaceWith=function(s,f){var h=typeof s=="string"?o.create(s,f):s;return h.replace(this),h},l.prototype.split=function(s,f){return s===0?this:this.next},l.prototype.update=function(s,f){},l.prototype.wrap=function(s,f){var h=typeof s=="string"?o.create(s,f):s;return this.parent!=null&&this.parent.insertBefore(h,this.next),h.appendChild(this),h},l.blotName="abstract",l}();r.default=a},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(12),a=i(32),l=i(33),s=i(1),f=function(){function h(x){this.attributes={},this.domNode=x,this.build()}return h.prototype.attribute=function(x,w){w?x.add(this.domNode,w)&&(x.value(this.domNode)!=null?this.attributes[x.attrName]=x:delete this.attributes[x.attrName]):(x.remove(this.domNode),delete this.attributes[x.attrName])},h.prototype.build=function(){var x=this;this.attributes={};var w=o.default.keys(this.domNode),v=a.default.keys(this.domNode),O=l.default.keys(this.domNode);w.concat(v).concat(O).forEach(function(g){var b=s.query(g,s.Scope.ATTRIBUTE);b instanceof o.default&&(x.attributes[b.attrName]=b)})},h.prototype.copy=function(x){var w=this;Object.keys(this.attributes).forEach(function(v){var O=w.attributes[v].value(w.domNode);x.format(v,O)})},h.prototype.move=function(x){var w=this;this.copy(x),Object.keys(this.attributes).forEach(function(v){w.attributes[v].remove(w.domNode)}),this.attributes={}},h.prototype.values=function(){var x=this;return Object.keys(this.attributes).reduce(function(w,v){return w[v]=x.attributes[v].value(x.domNode),w},{})},h}();r.default=f},function(n,r,i){var o=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,x){h.__proto__=x}||function(h,x){for(var w in x)x.hasOwnProperty(w)&&(h[w]=x[w])};return function(h,x){f(h,x);function w(){this.constructor=h}h.prototype=x===null?Object.create(x):(w.prototype=x.prototype,new w)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=i(12);function l(f,h){var x=f.getAttribute("class")||"";return x.split(/\s+/).filter(function(w){return w.indexOf(h+"-")===0})}var s=function(f){o(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.keys=function(x){return(x.getAttribute("class")||"").split(/\s+/).map(function(w){return w.split("-").slice(0,-1).join("-")})},h.prototype.add=function(x,w){return this.canAdd(x,w)?(this.remove(x),x.classList.add(this.keyName+"-"+w),!0):!1},h.prototype.remove=function(x){var w=l(x,this.keyName);w.forEach(function(v){x.classList.remove(v)}),x.classList.length===0&&x.removeAttribute("class")},h.prototype.value=function(x){var w=l(x,this.keyName)[0]||"",v=w.slice(this.keyName.length+1);return this.canAdd(x,v)?v:""},h}(a.default);r.default=s},function(n,r,i){var o=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,x){h.__proto__=x}||function(h,x){for(var w in x)x.hasOwnProperty(w)&&(h[w]=x[w])};return function(h,x){f(h,x);function w(){this.constructor=h}h.prototype=x===null?Object.create(x):(w.prototype=x.prototype,new w)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=i(12);function l(f){var h=f.split("-"),x=h.slice(1).map(function(w){return w[0].toUpperCase()+w.slice(1)}).join("");return h[0]+x}var s=function(f){o(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.keys=function(x){return(x.getAttribute("style")||"").split(";").map(function(w){var v=w.split(":");return v[0].trim()})},h.prototype.add=function(x,w){return this.canAdd(x,w)?(x.style[l(this.keyName)]=w,!0):!1},h.prototype.remove=function(x){x.style[l(this.keyName)]="",x.getAttribute("style")||x.removeAttribute("style")},h.prototype.value=function(x){var w=x.style[l(this.keyName)];return this.canAdd(x,w)?w:""},h}(a.default);r.default=s},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function s(f,h){for(var x=0;x<h.length;x++){var w=h[x];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(f,w.key,w)}}return function(f,h,x){return h&&s(f.prototype,h),x&&s(f,x),f}}();function a(s,f){if(!(s instanceof f))throw new TypeError("Cannot call a class as a function")}var l=function(){function s(f,h){a(this,s),this.quill=f,this.options=h,this.modules={}}return o(s,[{key:"init",value:function(){var h=this;Object.keys(this.options.modules).forEach(function(x){h.modules[x]==null&&h.addModule(x)})}},{key:"addModule",value:function(h){var x=this.quill.constructor.import("modules/"+h);return this.modules[h]=new x(this.quill,this.options.modules[h]||{}),this.modules[h]}}]),s}();l.DEFAULTS={modules:{}},l.themes={default:l},r.default=l},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function p(y,d){for(var m=0;m<d.length;m++){var _=d[m];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(y,_.key,_)}}return function(y,d,m){return d&&p(y.prototype,d),m&&p(y,m),y}}(),a=function p(y,d,m){y===null&&(y=Function.prototype);var _=Object.getOwnPropertyDescriptor(y,d);if(_===void 0){var A=Object.getPrototypeOf(y);return A===null?void 0:p(A,d,m)}else{if("value"in _)return _.value;var C=_.get;return C===void 0?void 0:C.call(m)}},l=i(0),s=x(l),f=i(7),h=x(f);function x(p){return p&&p.__esModule?p:{default:p}}function w(p,y){if(!(p instanceof y))throw new TypeError("Cannot call a class as a function")}function v(p,y){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:p}function O(p,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);p.prototype=Object.create(y&&y.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(p,y):p.__proto__=y)}var g="\uFEFF",b=function(p){O(y,p);function y(d){w(this,y);var m=v(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,d));return m.contentNode=document.createElement("span"),m.contentNode.setAttribute("contenteditable",!1),[].slice.call(m.domNode.childNodes).forEach(function(_){m.contentNode.appendChild(_)}),m.leftGuard=document.createTextNode(g),m.rightGuard=document.createTextNode(g),m.domNode.appendChild(m.leftGuard),m.domNode.appendChild(m.contentNode),m.domNode.appendChild(m.rightGuard),m}return o(y,[{key:"index",value:function(m,_){return m===this.leftGuard?0:m===this.rightGuard?1:a(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"index",this).call(this,m,_)}},{key:"restore",value:function(m){var _=void 0,A=void 0,C=m.data.split(g).join("");if(m===this.leftGuard)if(this.prev instanceof h.default){var R=this.prev.length();this.prev.insertAt(R,C),_={startNode:this.prev.domNode,startOffset:R+C.length}}else A=document.createTextNode(C),this.parent.insertBefore(s.default.create(A),this),_={startNode:A,startOffset:C.length};else m===this.rightGuard&&(this.next instanceof h.default?(this.next.insertAt(0,C),_={startNode:this.next.domNode,startOffset:C.length}):(A=document.createTextNode(C),this.parent.insertBefore(s.default.create(A),this.next),_={startNode:A,startOffset:C.length}));return m.data=g,_}},{key:"update",value:function(m,_){var A=this;m.forEach(function(C){if(C.type==="characterData"&&(C.target===A.leftGuard||C.target===A.rightGuard)){var R=A.restore(C.target);R&&(_.range=R)}})}}]),y}(s.default.Embed);r.default=b},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.AlignStyle=r.AlignClass=r.AlignAttribute=void 0;var o=i(0),a=l(o);function l(w){return w&&w.__esModule?w:{default:w}}var s={scope:a.default.Scope.BLOCK,whitelist:["right","center","justify"]},f=new a.default.Attributor.Attribute("align","align",s),h=new a.default.Attributor.Class("align","ql-align",s),x=new a.default.Attributor.Style("align","text-align",s);r.AlignAttribute=f,r.AlignClass=h,r.AlignStyle=x},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.BackgroundStyle=r.BackgroundClass=void 0;var o=i(0),a=s(o),l=i(26);function s(x){return x&&x.__esModule?x:{default:x}}var f=new a.default.Attributor.Class("background","ql-bg",{scope:a.default.Scope.INLINE}),h=new l.ColorAttributor("background","background-color",{scope:a.default.Scope.INLINE});r.BackgroundClass=f,r.BackgroundStyle=h},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.DirectionStyle=r.DirectionClass=r.DirectionAttribute=void 0;var o=i(0),a=l(o);function l(w){return w&&w.__esModule?w:{default:w}}var s={scope:a.default.Scope.BLOCK,whitelist:["rtl"]},f=new a.default.Attributor.Attribute("direction","dir",s),h=new a.default.Attributor.Class("direction","ql-direction",s),x=new a.default.Attributor.Style("direction","direction",s);r.DirectionAttribute=f,r.DirectionClass=h,r.DirectionStyle=x},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.FontClass=r.FontStyle=void 0;var o=function(){function p(y,d){for(var m=0;m<d.length;m++){var _=d[m];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(y,_.key,_)}}return function(y,d,m){return d&&p(y.prototype,d),m&&p(y,m),y}}(),a=function p(y,d,m){y===null&&(y=Function.prototype);var _=Object.getOwnPropertyDescriptor(y,d);if(_===void 0){var A=Object.getPrototypeOf(y);return A===null?void 0:p(A,d,m)}else{if("value"in _)return _.value;var C=_.get;return C===void 0?void 0:C.call(m)}},l=i(0),s=f(l);function f(p){return p&&p.__esModule?p:{default:p}}function h(p,y){if(!(p instanceof y))throw new TypeError("Cannot call a class as a function")}function x(p,y){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:p}function w(p,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);p.prototype=Object.create(y&&y.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(p,y):p.__proto__=y)}var v={scope:s.default.Scope.INLINE,whitelist:["serif","monospace"]},O=new s.default.Attributor.Class("font","ql-font",v),g=function(p){w(y,p);function y(){return h(this,y),x(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return o(y,[{key:"value",value:function(m){return a(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"value",this).call(this,m).replace(/["']/g,"")}}]),y}(s.default.Attributor.Style),b=new g("font","font-family",v);r.FontStyle=b,r.FontClass=O},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.SizeStyle=r.SizeClass=void 0;var o=i(0),a=l(o);function l(h){return h&&h.__esModule?h:{default:h}}var s=new a.default.Attributor.Class("size","ql-size",{scope:a.default.Scope.INLINE,whitelist:["small","large","huge"]}),f=new a.default.Attributor.Style("size","font-size",{scope:a.default.Scope.INLINE,whitelist:["10px","18px","32px"]});r.SizeClass=s,r.SizeStyle=f},function(n,r,i){n.exports={align:{"":i(76),center:i(77),right:i(78),justify:i(79)},background:i(80),blockquote:i(81),bold:i(82),clean:i(83),code:i(58),"code-block":i(58),color:i(84),direction:{"":i(85),rtl:i(86)},float:{center:i(87),full:i(88),left:i(89),right:i(90)},formula:i(91),header:{1:i(92),2:i(93)},italic:i(94),image:i(95),indent:{"+1":i(96),"-1":i(97)},link:i(98),list:{ordered:i(99),bullet:i(100),check:i(101)},script:{sub:i(102),super:i(103)},strike:i(104),underline:i(105),video:i(106)}},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.getLastChangeIndex=r.default=void 0;var o=function(){function d(m,_){for(var A=0;A<_.length;A++){var C=_[A];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(m,C.key,C)}}return function(m,_,A){return _&&d(m.prototype,_),A&&d(m,A),m}}(),a=i(0),l=w(a),s=i(5),f=w(s),h=i(9),x=w(h);function w(d){return d&&d.__esModule?d:{default:d}}function v(d,m){if(!(d instanceof m))throw new TypeError("Cannot call a class as a function")}function O(d,m){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:d}function g(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(d,m):d.__proto__=m)}var b=function(d){g(m,d);function m(_,A){v(this,m);var C=O(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,_,A));return C.lastRecorded=0,C.ignoreChange=!1,C.clear(),C.quill.on(f.default.events.EDITOR_CHANGE,function(R,S,E,P){R!==f.default.events.TEXT_CHANGE||C.ignoreChange||(!C.options.userOnly||P===f.default.sources.USER?C.record(S,E):C.transform(S))}),C.quill.keyboard.addBinding({key:"Z",shortKey:!0},C.undo.bind(C)),C.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},C.redo.bind(C)),/Win/i.test(navigator.platform)&&C.quill.keyboard.addBinding({key:"Y",shortKey:!0},C.redo.bind(C)),C}return o(m,[{key:"change",value:function(A,C){if(this.stack[A].length!==0){var R=this.stack[A].pop();this.stack[C].push(R),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(R[A],f.default.sources.USER),this.ignoreChange=!1;var S=y(R[A]);this.quill.setSelection(S)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(A,C){if(A.ops.length!==0){this.stack.redo=[];var R=this.quill.getContents().diff(C),S=Date.now();if(this.lastRecorded+this.options.delay>S&&this.stack.undo.length>0){var E=this.stack.undo.pop();R=R.compose(E.undo),A=E.redo.compose(A)}else this.lastRecorded=S;this.stack.undo.push({redo:A,undo:R}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(A){this.stack.undo.forEach(function(C){C.undo=A.transform(C.undo,!0),C.redo=A.transform(C.redo,!0)}),this.stack.redo.forEach(function(C){C.undo=A.transform(C.undo,!0),C.redo=A.transform(C.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),m}(x.default);b.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function p(d){var m=d.ops[d.ops.length-1];return m==null?!1:m.insert!=null?typeof m.insert=="string"&&m.insert.endsWith(`
|
|
139
|
+
`):m.attributes!=null?Object.keys(m.attributes).some(function(_){return l.default.query(_,l.default.Scope.BLOCK)!=null}):!1}function y(d){var m=d.reduce(function(A,C){return A+=C.delete||0,A},0),_=d.length()-m;return p(d)&&(_-=1),_}r.default=b,r.getLastChangeIndex=y},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.BaseTooltip=void 0;var o=function(){function B(V,Y){for(var F=0;F<Y.length;F++){var $=Y[F];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(V,$.key,$)}}return function(V,Y,F){return Y&&B(V.prototype,Y),F&&B(V,F),V}}(),a=function B(V,Y,F){V===null&&(V=Function.prototype);var $=Object.getOwnPropertyDescriptor(V,Y);if($===void 0){var z=Object.getPrototypeOf(V);return z===null?void 0:B(z,Y,F)}else{if("value"in $)return $.value;var K=$.get;return K===void 0?void 0:K.call(F)}},l=i(3),s=S(l),f=i(2),h=S(f),x=i(8),w=S(x),v=i(23),O=S(v),g=i(34),b=S(g),p=i(59),y=S(p),d=i(60),m=S(d),_=i(28),A=S(_),C=i(61),R=S(C);function S(B){return B&&B.__esModule?B:{default:B}}function E(B,V){if(!(B instanceof V))throw new TypeError("Cannot call a class as a function")}function P(B,V){if(!B)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return V&&(typeof V=="object"||typeof V=="function")?V:B}function T(B,V){if(typeof V!="function"&&V!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof V);B.prototype=Object.create(V&&V.prototype,{constructor:{value:B,enumerable:!1,writable:!0,configurable:!0}}),V&&(Object.setPrototypeOf?Object.setPrototypeOf(B,V):B.__proto__=V)}var N=[!1,"center","right","justify"],U=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],G=[!1,"serif","monospace"],Z=["1","2","3",!1],W=["small",!1,"large","huge"],H=function(B){T(V,B);function V(Y,F){E(this,V);var $=P(this,(V.__proto__||Object.getPrototypeOf(V)).call(this,Y,F)),z=function K(X){if(!document.body.contains(Y.root))return document.body.removeEventListener("click",K);$.tooltip!=null&&!$.tooltip.root.contains(X.target)&&document.activeElement!==$.tooltip.textbox&&!$.quill.hasFocus()&&$.tooltip.hide(),$.pickers!=null&&$.pickers.forEach(function(Q){Q.container.contains(X.target)||Q.close()})};return Y.emitter.listenDOM("click",document.body,z),$}return o(V,[{key:"addModule",value:function(F){var $=a(V.prototype.__proto__||Object.getPrototypeOf(V.prototype),"addModule",this).call(this,F);return F==="toolbar"&&this.extendToolbar($),$}},{key:"buildButtons",value:function(F,$){F.forEach(function(z){var K=z.getAttribute("class")||"";K.split(/\s+/).forEach(function(X){if(X.startsWith("ql-")&&(X=X.slice(3),$[X]!=null))if(X==="direction")z.innerHTML=$[X][""]+$[X].rtl;else if(typeof $[X]=="string")z.innerHTML=$[X];else{var Q=z.value||"";Q!=null&&$[X][Q]&&(z.innerHTML=$[X][Q])}})})}},{key:"buildPickers",value:function(F,$){var z=this;this.pickers=F.map(function(X){if(X.classList.contains("ql-align"))return X.querySelector("option")==null&&D(X,N),new m.default(X,$.align);if(X.classList.contains("ql-background")||X.classList.contains("ql-color")){var Q=X.classList.contains("ql-background")?"background":"color";return X.querySelector("option")==null&&D(X,U,Q==="background"?"#ffffff":"#000000"),new y.default(X,$[Q])}else return X.querySelector("option")==null&&(X.classList.contains("ql-font")?D(X,G):X.classList.contains("ql-header")?D(X,Z):X.classList.contains("ql-size")&&D(X,W)),new A.default(X)});var K=function(){z.pickers.forEach(function(Q){Q.update()})};this.quill.on(w.default.events.EDITOR_CHANGE,K)}}]),V}(b.default);H.DEFAULTS=(0,s.default)(!0,{},b.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var V=this,Y=this.container.querySelector("input.ql-image[type=file]");Y==null&&(Y=document.createElement("input"),Y.setAttribute("type","file"),Y.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),Y.classList.add("ql-image"),Y.addEventListener("change",function(){if(Y.files!=null&&Y.files[0]!=null){var F=new FileReader;F.onload=function($){var z=V.quill.getSelection(!0);V.quill.updateContents(new h.default().retain(z.index).delete(z.length).insert({image:$.target.result}),w.default.sources.USER),V.quill.setSelection(z.index+1,w.default.sources.SILENT),Y.value=""},F.readAsDataURL(Y.files[0])}}),this.container.appendChild(Y)),Y.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var L=function(B){T(V,B);function V(Y,F){E(this,V);var $=P(this,(V.__proto__||Object.getPrototypeOf(V)).call(this,Y,F));return $.textbox=$.root.querySelector('input[type="text"]'),$.listen(),$}return o(V,[{key:"listen",value:function(){var F=this;this.textbox.addEventListener("keydown",function($){O.default.match($,"enter")?(F.save(),$.preventDefault()):O.default.match($,"escape")&&(F.cancel(),$.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",$=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),$!=null?this.textbox.value=$:F!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+F)||""),this.root.setAttribute("data-mode",F)}},{key:"restoreFocus",value:function(){var F=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=F}},{key:"save",value:function(){var F=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var $=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",F,w.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",F,w.default.sources.USER)),this.quill.root.scrollTop=$;break}case"video":F=M(F);case"formula":{if(!F)break;var z=this.quill.getSelection(!0);if(z!=null){var K=z.index+z.length;this.quill.insertEmbed(K,this.root.getAttribute("data-mode"),F,w.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(K+1," ",w.default.sources.USER),this.quill.setSelection(K+2,w.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),V}(R.default);function M(B){var V=B.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||B.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return V?(V[1]||"https")+"://www.youtube.com/embed/"+V[2]+"?showinfo=0":(V=B.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(V[1]||"https")+"://player.vimeo.com/video/"+V[2]+"/":B}function D(B,V){var Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;V.forEach(function(F){var $=document.createElement("option");F===Y?$.setAttribute("selected","selected"):$.setAttribute("value",F),B.appendChild($)})}r.BaseTooltip=L,r.default=H},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function a(){this.head=this.tail=null,this.length=0}return a.prototype.append=function(){for(var l=[],s=0;s<arguments.length;s++)l[s]=arguments[s];this.insertBefore(l[0],null),l.length>1&&this.append.apply(this,l.slice(1))},a.prototype.contains=function(l){for(var s,f=this.iterator();s=f();)if(s===l)return!0;return!1},a.prototype.insertBefore=function(l,s){l&&(l.next=s,s!=null?(l.prev=s.prev,s.prev!=null&&(s.prev.next=l),s.prev=l,s===this.head&&(this.head=l)):this.tail!=null?(this.tail.next=l,l.prev=this.tail,this.tail=l):(l.prev=null,this.head=this.tail=l),this.length+=1)},a.prototype.offset=function(l){for(var s=0,f=this.head;f!=null;){if(f===l)return s;s+=f.length(),f=f.next}return-1},a.prototype.remove=function(l){this.contains(l)&&(l.prev!=null&&(l.prev.next=l.next),l.next!=null&&(l.next.prev=l.prev),l===this.head&&(this.head=l.next),l===this.tail&&(this.tail=l.prev),this.length-=1)},a.prototype.iterator=function(l){return l===void 0&&(l=this.head),function(){var s=l;return l!=null&&(l=l.next),s}},a.prototype.find=function(l,s){s===void 0&&(s=!1);for(var f,h=this.iterator();f=h();){var x=f.length();if(l<x||s&&l===x&&(f.next==null||f.next.length()!==0))return[f,l];l-=x}return[null,0]},a.prototype.forEach=function(l){for(var s,f=this.iterator();s=f();)l(s)},a.prototype.forEachAt=function(l,s,f){if(!(s<=0))for(var h=this.find(l),x=h[0],w=h[1],v,O=l-w,g=this.iterator(x);(v=g())&&O<l+s;){var b=v.length();l>O?f(v,l-O,Math.min(s,O+b-l)):f(v,0,Math.min(b,l+s-O)),O+=b}},a.prototype.map=function(l){return this.reduce(function(s,f){return s.push(l(f)),s},[])},a.prototype.reduce=function(l,s){for(var f,h=this.iterator();f=h();)s=l(s,f);return s},a}();r.default=o},function(n,r,i){var o=this&&this.__extends||function(){var x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,v){w.__proto__=v}||function(w,v){for(var O in v)v.hasOwnProperty(O)&&(w[O]=v[O])};return function(w,v){x(w,v);function O(){this.constructor=w}w.prototype=v===null?Object.create(v):(O.prototype=v.prototype,new O)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=i(17),l=i(1),s={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},f=100,h=function(x){o(w,x);function w(v){var O=x.call(this,v)||this;return O.scroll=O,O.observer=new MutationObserver(function(g){O.update(g)}),O.observer.observe(O.domNode,s),O.attach(),O}return w.prototype.detach=function(){x.prototype.detach.call(this),this.observer.disconnect()},w.prototype.deleteAt=function(v,O){this.update(),v===0&&O===this.length()?this.children.forEach(function(g){g.remove()}):x.prototype.deleteAt.call(this,v,O)},w.prototype.formatAt=function(v,O,g,b){this.update(),x.prototype.formatAt.call(this,v,O,g,b)},w.prototype.insertAt=function(v,O,g){this.update(),x.prototype.insertAt.call(this,v,O,g)},w.prototype.optimize=function(v,O){var g=this;v===void 0&&(v=[]),O===void 0&&(O={}),x.prototype.optimize.call(this,O);for(var b=[].slice.call(this.observer.takeRecords());b.length>0;)v.push(b.pop());for(var p=function(_,A){A===void 0&&(A=!0),!(_==null||_===g)&&_.domNode.parentNode!=null&&(_.domNode[l.DATA_KEY].mutations==null&&(_.domNode[l.DATA_KEY].mutations=[]),A&&p(_.parent))},y=function(_){_.domNode[l.DATA_KEY]==null||_.domNode[l.DATA_KEY].mutations==null||(_ instanceof a.default&&_.children.forEach(y),_.optimize(O))},d=v,m=0;d.length>0;m+=1){if(m>=f)throw new Error("[Parchment] Maximum optimize iterations reached");for(d.forEach(function(_){var A=l.find(_.target,!0);A!=null&&(A.domNode===_.target&&(_.type==="childList"?(p(l.find(_.previousSibling,!1)),[].forEach.call(_.addedNodes,function(C){var R=l.find(C,!1);p(R,!1),R instanceof a.default&&R.children.forEach(function(S){p(S,!1)})})):_.type==="attributes"&&p(A.prev)),p(A))}),this.children.forEach(y),d=[].slice.call(this.observer.takeRecords()),b=d.slice();b.length>0;)v.push(b.pop())}},w.prototype.update=function(v,O){var g=this;O===void 0&&(O={}),v=v||this.observer.takeRecords(),v.map(function(b){var p=l.find(b.target,!0);return p==null?null:p.domNode[l.DATA_KEY].mutations==null?(p.domNode[l.DATA_KEY].mutations=[b],p):(p.domNode[l.DATA_KEY].mutations.push(b),null)}).forEach(function(b){b==null||b===g||b.domNode[l.DATA_KEY]==null||b.update(b.domNode[l.DATA_KEY].mutations||[],O)}),this.domNode[l.DATA_KEY].mutations!=null&&x.prototype.update.call(this,this.domNode[l.DATA_KEY].mutations,O),this.optimize(v,O)},w.blotName="scroll",w.defaultChild="block",w.scope=l.Scope.BLOCK_BLOT,w.tagName="DIV",w}(a.default);r.default=h},function(n,r,i){var o=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,w){x.__proto__=w}||function(x,w){for(var v in w)w.hasOwnProperty(v)&&(x[v]=w[v])};return function(x,w){h(x,w);function v(){this.constructor=x}x.prototype=w===null?Object.create(w):(v.prototype=w.prototype,new v)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=i(18),l=i(1);function s(h,x){if(Object.keys(h).length!==Object.keys(x).length)return!1;for(var w in h)if(h[w]!==x[w])return!1;return!0}var f=function(h){o(x,h);function x(){return h!==null&&h.apply(this,arguments)||this}return x.formats=function(w){if(w.tagName!==x.tagName)return h.formats.call(this,w)},x.prototype.format=function(w,v){var O=this;w===this.statics.blotName&&!v?(this.children.forEach(function(g){g instanceof a.default||(g=g.wrap(x.blotName,!0)),O.attributes.copy(g)}),this.unwrap()):h.prototype.format.call(this,w,v)},x.prototype.formatAt=function(w,v,O,g){if(this.formats()[O]!=null||l.query(O,l.Scope.ATTRIBUTE)){var b=this.isolate(w,v);b.format(O,g)}else h.prototype.formatAt.call(this,w,v,O,g)},x.prototype.optimize=function(w){h.prototype.optimize.call(this,w);var v=this.formats();if(Object.keys(v).length===0)return this.unwrap();var O=this.next;O instanceof x&&O.prev===this&&s(v,O.formats())&&(O.moveChildren(this),O.remove())},x.blotName="inline",x.scope=l.Scope.INLINE_BLOT,x.tagName="SPAN",x}(a.default);r.default=f},function(n,r,i){var o=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,x){h.__proto__=x}||function(h,x){for(var w in x)x.hasOwnProperty(w)&&(h[w]=x[w])};return function(h,x){f(h,x);function w(){this.constructor=h}h.prototype=x===null?Object.create(x):(w.prototype=x.prototype,new w)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=i(18),l=i(1),s=function(f){o(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.formats=function(x){var w=l.query(h.blotName).tagName;if(x.tagName!==w)return f.formats.call(this,x)},h.prototype.format=function(x,w){l.query(x,l.Scope.BLOCK)!=null&&(x===this.statics.blotName&&!w?this.replaceWith(h.blotName):f.prototype.format.call(this,x,w))},h.prototype.formatAt=function(x,w,v,O){l.query(v,l.Scope.BLOCK)!=null?this.format(v,O):f.prototype.formatAt.call(this,x,w,v,O)},h.prototype.insertAt=function(x,w,v){if(v==null||l.query(w,l.Scope.INLINE)!=null)f.prototype.insertAt.call(this,x,w,v);else{var O=this.split(x),g=l.create(w,v);O.parent.insertBefore(g,O)}},h.prototype.update=function(x,w){navigator.userAgent.match(/Trident/)?this.build():f.prototype.update.call(this,x,w)},h.blotName="block",h.scope=l.Scope.BLOCK_BLOT,h.tagName="P",h}(a.default);r.default=s},function(n,r,i){var o=this&&this.__extends||function(){var s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,h){f.__proto__=h}||function(f,h){for(var x in h)h.hasOwnProperty(x)&&(f[x]=h[x])};return function(f,h){s(f,h);function x(){this.constructor=f}f.prototype=h===null?Object.create(h):(x.prototype=h.prototype,new x)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=i(19),l=function(s){o(f,s);function f(){return s!==null&&s.apply(this,arguments)||this}return f.formats=function(h){},f.prototype.format=function(h,x){s.prototype.formatAt.call(this,0,this.length(),h,x)},f.prototype.formatAt=function(h,x,w,v){h===0&&x===this.length()?this.format(w,v):s.prototype.formatAt.call(this,h,x,w,v)},f.prototype.formats=function(){return this.statics.formats(this.domNode)},f}(a.default);r.default=l},function(n,r,i){var o=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,x){h.__proto__=x}||function(h,x){for(var w in x)x.hasOwnProperty(w)&&(h[w]=x[w])};return function(h,x){f(h,x);function w(){this.constructor=h}h.prototype=x===null?Object.create(x):(w.prototype=x.prototype,new w)}}();Object.defineProperty(r,"__esModule",{value:!0});var a=i(19),l=i(1),s=function(f){o(h,f);function h(x){var w=f.call(this,x)||this;return w.text=w.statics.value(w.domNode),w}return h.create=function(x){return document.createTextNode(x)},h.value=function(x){var w=x.data;return w.normalize&&(w=w.normalize()),w},h.prototype.deleteAt=function(x,w){this.domNode.data=this.text=this.text.slice(0,x)+this.text.slice(x+w)},h.prototype.index=function(x,w){return this.domNode===x?w:-1},h.prototype.insertAt=function(x,w,v){v==null?(this.text=this.text.slice(0,x)+w+this.text.slice(x),this.domNode.data=this.text):f.prototype.insertAt.call(this,x,w,v)},h.prototype.length=function(){return this.text.length},h.prototype.optimize=function(x){f.prototype.optimize.call(this,x),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof h&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},h.prototype.position=function(x,w){return[this.domNode,x]},h.prototype.split=function(x,w){if(w===void 0&&(w=!1),!w){if(x===0)return this;if(x===this.length())return this.next}var v=l.create(this.domNode.splitText(x));return this.parent.insertBefore(v,this.next),this.text=this.statics.value(this.domNode),v},h.prototype.update=function(x,w){var v=this;x.some(function(O){return O.type==="characterData"&&O.target===v.domNode})&&(this.text=this.statics.value(this.domNode))},h.prototype.value=function(){return this.text},h.blotName="text",h.scope=l.Scope.INLINE_BLOT,h}(a.default);r.default=s},function(n,r,i){var o=document.createElement("div");if(o.classList.toggle("test-class",!1),o.classList.contains("test-class")){var a=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(l,s){return arguments.length>1&&!this.contains(l)==!s?s:a.call(this,l)}}String.prototype.startsWith||(String.prototype.startsWith=function(l,s){return s=s||0,this.substr(s,l.length)===l}),String.prototype.endsWith||(String.prototype.endsWith=function(l,s){var f=this.toString();(typeof s!="number"||!isFinite(s)||Math.floor(s)!==s||s>f.length)&&(s=f.length),s-=l.length;var h=f.indexOf(l,s);return h!==-1&&h===s}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(s){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof s!="function")throw new TypeError("predicate must be a function");for(var f=Object(this),h=f.length>>>0,x=arguments[1],w,v=0;v<h;v++)if(w=f[v],s.call(x,w,v,f))return w}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(n,r){var i=-1,o=1,a=0;function l(m,_,A){if(m==_)return m?[[a,m]]:[];(A<0||m.length<A)&&(A=null);var C=x(m,_),R=m.substring(0,C);m=m.substring(C),_=_.substring(C),C=w(m,_);var S=m.substring(m.length-C);m=m.substring(0,m.length-C),_=_.substring(0,_.length-C);var E=s(m,_);return R&&E.unshift([a,R]),S&&E.push([a,S]),O(E),A!=null&&(E=p(E,A)),E=y(E),E}function s(m,_){var A;if(!m)return[[o,_]];if(!_)return[[i,m]];var C=m.length>_.length?m:_,R=m.length>_.length?_:m,S=C.indexOf(R);if(S!=-1)return A=[[o,C.substring(0,S)],[a,R],[o,C.substring(S+R.length)]],m.length>_.length&&(A[0][0]=A[2][0]=i),A;if(R.length==1)return[[i,m],[o,_]];var E=v(m,_);if(E){var P=E[0],T=E[1],N=E[2],U=E[3],G=E[4],Z=l(P,N),W=l(T,U);return Z.concat([[a,G]],W)}return f(m,_)}function f(m,_){for(var A=m.length,C=_.length,R=Math.ceil((A+C)/2),S=R,E=2*R,P=new Array(E),T=new Array(E),N=0;N<E;N++)P[N]=-1,T[N]=-1;P[S+1]=0,T[S+1]=0;for(var U=A-C,G=U%2!=0,Z=0,W=0,H=0,L=0,M=0;M<R;M++){for(var D=-M+Z;D<=M-W;D+=2){var B=S+D,V;D==-M||D!=M&&P[B-1]<P[B+1]?V=P[B+1]:V=P[B-1]+1;for(var Y=V-D;V<A&&Y<C&&m.charAt(V)==_.charAt(Y);)V++,Y++;if(P[B]=V,V>A)W+=2;else if(Y>C)Z+=2;else if(G){var F=S+U-D;if(F>=0&&F<E&&T[F]!=-1){var $=A-T[F];if(V>=$)return h(m,_,V,Y)}}}for(var z=-M+H;z<=M-L;z+=2){var F=S+z,$;z==-M||z!=M&&T[F-1]<T[F+1]?$=T[F+1]:$=T[F-1]+1;for(var K=$-z;$<A&&K<C&&m.charAt(A-$-1)==_.charAt(C-K-1);)$++,K++;if(T[F]=$,$>A)L+=2;else if(K>C)H+=2;else if(!G){var B=S+U-z;if(B>=0&&B<E&&P[B]!=-1){var V=P[B],Y=S+V-B;if($=A-$,V>=$)return h(m,_,V,Y)}}}}return[[i,m],[o,_]]}function h(m,_,A,C){var R=m.substring(0,A),S=_.substring(0,C),E=m.substring(A),P=_.substring(C),T=l(R,S),N=l(E,P);return T.concat(N)}function x(m,_){if(!m||!_||m.charAt(0)!=_.charAt(0))return 0;for(var A=0,C=Math.min(m.length,_.length),R=C,S=0;A<R;)m.substring(S,R)==_.substring(S,R)?(A=R,S=A):C=R,R=Math.floor((C-A)/2+A);return R}function w(m,_){if(!m||!_||m.charAt(m.length-1)!=_.charAt(_.length-1))return 0;for(var A=0,C=Math.min(m.length,_.length),R=C,S=0;A<R;)m.substring(m.length-R,m.length-S)==_.substring(_.length-R,_.length-S)?(A=R,S=A):C=R,R=Math.floor((C-A)/2+A);return R}function v(m,_){var A=m.length>_.length?m:_,C=m.length>_.length?_:m;if(A.length<4||C.length*2<A.length)return null;function R(W,H,L){for(var M=W.substring(L,L+Math.floor(W.length/4)),D=-1,B="",V,Y,F,$;(D=H.indexOf(M,D+1))!=-1;){var z=x(W.substring(L),H.substring(D)),K=w(W.substring(0,L),H.substring(0,D));B.length<K+z&&(B=H.substring(D-K,D)+H.substring(D,D+z),V=W.substring(0,L-K),Y=W.substring(L+z),F=H.substring(0,D-K),$=H.substring(D+z))}return B.length*2>=W.length?[V,Y,F,$,B]:null}var S=R(A,C,Math.ceil(A.length/4)),E=R(A,C,Math.ceil(A.length/2)),P;if(!S&&!E)return null;E?S?P=S[4].length>E[4].length?S:E:P=E:P=S;var T,N,U,G;m.length>_.length?(T=P[0],N=P[1],U=P[2],G=P[3]):(U=P[0],G=P[1],T=P[2],N=P[3]);var Z=P[4];return[T,N,U,G,Z]}function O(m){m.push([a,""]);for(var _=0,A=0,C=0,R="",S="",E;_<m.length;)switch(m[_][0]){case o:C++,S+=m[_][1],_++;break;case i:A++,R+=m[_][1],_++;break;case a:A+C>1?(A!==0&&C!==0&&(E=x(S,R),E!==0&&(_-A-C>0&&m[_-A-C-1][0]==a?m[_-A-C-1][1]+=S.substring(0,E):(m.splice(0,0,[a,S.substring(0,E)]),_++),S=S.substring(E),R=R.substring(E)),E=w(S,R),E!==0&&(m[_][1]=S.substring(S.length-E)+m[_][1],S=S.substring(0,S.length-E),R=R.substring(0,R.length-E))),A===0?m.splice(_-C,A+C,[o,S]):C===0?m.splice(_-A,A+C,[i,R]):m.splice(_-A-C,A+C,[i,R],[o,S]),_=_-A-C+(A?1:0)+(C?1:0)+1):_!==0&&m[_-1][0]==a?(m[_-1][1]+=m[_][1],m.splice(_,1)):_++,C=0,A=0,R="",S="";break}m[m.length-1][1]===""&&m.pop();var P=!1;for(_=1;_<m.length-1;)m[_-1][0]==a&&m[_+1][0]==a&&(m[_][1].substring(m[_][1].length-m[_-1][1].length)==m[_-1][1]?(m[_][1]=m[_-1][1]+m[_][1].substring(0,m[_][1].length-m[_-1][1].length),m[_+1][1]=m[_-1][1]+m[_+1][1],m.splice(_-1,1),P=!0):m[_][1].substring(0,m[_+1][1].length)==m[_+1][1]&&(m[_-1][1]+=m[_+1][1],m[_][1]=m[_][1].substring(m[_+1][1].length)+m[_+1][1],m.splice(_+1,1),P=!0)),_++;P&&O(m)}var g=l;g.INSERT=o,g.DELETE=i,g.EQUAL=a,n.exports=g;function b(m,_){if(_===0)return[a,m];for(var A=0,C=0;C<m.length;C++){var R=m[C];if(R[0]===i||R[0]===a){var S=A+R[1].length;if(_===S)return[C+1,m];if(_<S){m=m.slice();var E=_-A,P=[R[0],R[1].slice(0,E)],T=[R[0],R[1].slice(E)];return m.splice(C,1,P,T),[C+1,m]}else A=S}}throw new Error("cursor_pos is out of bounds!")}function p(m,_){var A=b(m,_),C=A[1],R=A[0],S=C[R],E=C[R+1];if(S==null)return m;if(S[0]!==a)return m;if(E!=null&&S[1]+E[1]===E[1]+S[1])return C.splice(R,2,E,S),d(C,R,2);if(E!=null&&E[1].indexOf(S[1])===0){C.splice(R,2,[E[0],S[1]],[0,S[1]]);var P=E[1].slice(S[1].length);return P.length>0&&C.splice(R+2,0,[E[0],P]),d(C,R,3)}else return m}function y(m){for(var _=!1,A=function(E){return E.charCodeAt(0)>=56320&&E.charCodeAt(0)<=57343},C=function(E){return E.charCodeAt(E.length-1)>=55296&&E.charCodeAt(E.length-1)<=56319},R=2;R<m.length;R+=1)m[R-2][0]===a&&C(m[R-2][1])&&m[R-1][0]===i&&A(m[R-1][1])&&m[R][0]===o&&A(m[R][1])&&(_=!0,m[R-1][1]=m[R-2][1].slice(-1)+m[R-1][1],m[R][1]=m[R-2][1].slice(-1)+m[R][1],m[R-2][1]=m[R-2][1].slice(0,-1));if(!_)return m;for(var S=[],R=0;R<m.length;R+=1)m[R][1].length>0&&S.push(m[R]);return S}function d(m,_,A){for(var C=_+A-1;C>=0&&C>=_-1;C--)if(C+1<m.length){var R=m[C],S=m[C+1];R[0]===S[1]&&m.splice(C,2,[R[0],R[1]+S[1]])}return m}},function(n,r){r=n.exports=typeof Object.keys=="function"?Object.keys:i,r.shim=i;function i(o){var a=[];for(var l in o)a.push(l);return a}},function(n,r){var i=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";r=n.exports=i?o:a,r.supported=o;function o(l){return Object.prototype.toString.call(l)=="[object Arguments]"}r.unsupported=a;function a(l){return l&&typeof l=="object"&&typeof l.length=="number"&&Object.prototype.hasOwnProperty.call(l,"callee")&&!Object.prototype.propertyIsEnumerable.call(l,"callee")||!1}},function(n,r){var i=Object.prototype.hasOwnProperty,o="~";function a(){}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(o=!1));function l(f,h,x){this.fn=f,this.context=h,this.once=x||!1}function s(){this._events=new a,this._eventsCount=0}s.prototype.eventNames=function(){var h=[],x,w;if(this._eventsCount===0)return h;for(w in x=this._events)i.call(x,w)&&h.push(o?w.slice(1):w);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(x)):h},s.prototype.listeners=function(h,x){var w=o?o+h:h,v=this._events[w];if(x)return!!v;if(!v)return[];if(v.fn)return[v.fn];for(var O=0,g=v.length,b=new Array(g);O<g;O++)b[O]=v[O].fn;return b},s.prototype.emit=function(h,x,w,v,O,g){var b=o?o+h:h;if(!this._events[b])return!1;var p=this._events[b],y=arguments.length,d,m;if(p.fn){switch(p.once&&this.removeListener(h,p.fn,void 0,!0),y){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,x),!0;case 3:return p.fn.call(p.context,x,w),!0;case 4:return p.fn.call(p.context,x,w,v),!0;case 5:return p.fn.call(p.context,x,w,v,O),!0;case 6:return p.fn.call(p.context,x,w,v,O,g),!0}for(m=1,d=new Array(y-1);m<y;m++)d[m-1]=arguments[m];p.fn.apply(p.context,d)}else{var _=p.length,A;for(m=0;m<_;m++)switch(p[m].once&&this.removeListener(h,p[m].fn,void 0,!0),y){case 1:p[m].fn.call(p[m].context);break;case 2:p[m].fn.call(p[m].context,x);break;case 3:p[m].fn.call(p[m].context,x,w);break;case 4:p[m].fn.call(p[m].context,x,w,v);break;default:if(!d)for(A=1,d=new Array(y-1);A<y;A++)d[A-1]=arguments[A];p[m].fn.apply(p[m].context,d)}}return!0},s.prototype.on=function(h,x,w){var v=new l(x,w||this),O=o?o+h:h;return this._events[O]?this._events[O].fn?this._events[O]=[this._events[O],v]:this._events[O].push(v):(this._events[O]=v,this._eventsCount++),this},s.prototype.once=function(h,x,w){var v=new l(x,w||this,!0),O=o?o+h:h;return this._events[O]?this._events[O].fn?this._events[O]=[this._events[O],v]:this._events[O].push(v):(this._events[O]=v,this._eventsCount++),this},s.prototype.removeListener=function(h,x,w,v){var O=o?o+h:h;if(!this._events[O])return this;if(!x)return--this._eventsCount===0?this._events=new a:delete this._events[O],this;var g=this._events[O];if(g.fn)g.fn===x&&(!v||g.once)&&(!w||g.context===w)&&(--this._eventsCount===0?this._events=new a:delete this._events[O]);else{for(var b=0,p=[],y=g.length;b<y;b++)(g[b].fn!==x||v&&!g[b].once||w&&g[b].context!==w)&&p.push(g[b]);p.length?this._events[O]=p.length===1?p[0]:p:--this._eventsCount===0?this._events=new a:delete this._events[O]}return this},s.prototype.removeAllListeners=function(h){var x;return h?(x=o?o+h:h,this._events[x]&&(--this._eventsCount===0?this._events=new a:delete this._events[x])):(this._events=new a,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.prefixed=o,s.EventEmitter=s,typeof n<"u"&&(n.exports=s)},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.matchText=r.matchSpacing=r.matchNewline=r.matchBlot=r.matchAttributor=r.default=void 0;var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(re){return typeof re}:function(re){return re&&typeof Symbol=="function"&&re.constructor===Symbol&&re!==Symbol.prototype?"symbol":typeof re},a=function(){function re(ae,we){var be=[],te=!0,fe=!1,he=void 0;try{for(var Ee=ae[Symbol.iterator](),Ve;!(te=(Ve=Ee.next()).done)&&(be.push(Ve.value),!(we&&be.length===we));te=!0);}catch(Je){fe=!0,he=Je}finally{try{!te&&Ee.return&&Ee.return()}finally{if(fe)throw he}}return be}return function(ae,we){if(Array.isArray(ae))return ae;if(Symbol.iterator in Object(ae))return re(ae,we);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function re(ae,we){for(var be=0;be<we.length;be++){var te=we[be];te.enumerable=te.enumerable||!1,te.configurable=!0,"value"in te&&(te.writable=!0),Object.defineProperty(ae,te.key,te)}}return function(ae,we,be){return we&&re(ae.prototype,we),be&&re(ae,be),ae}}(),s=i(3),f=T(s),h=i(2),x=T(h),w=i(0),v=T(w),O=i(5),g=T(O),b=i(10),p=T(b),y=i(9),d=T(y),m=i(36),_=i(37),A=i(13),C=T(A),R=i(26),S=i(38),E=i(39),P=i(40);function T(re){return re&&re.__esModule?re:{default:re}}function N(re,ae,we){return ae in re?Object.defineProperty(re,ae,{value:we,enumerable:!0,configurable:!0,writable:!0}):re[ae]=we,re}function U(re,ae){if(!(re instanceof ae))throw new TypeError("Cannot call a class as a function")}function G(re,ae){if(!re)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ae&&(typeof ae=="object"||typeof ae=="function")?ae:re}function Z(re,ae){if(typeof ae!="function"&&ae!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof ae);re.prototype=Object.create(ae&&ae.prototype,{constructor:{value:re,enumerable:!1,writable:!0,configurable:!0}}),ae&&(Object.setPrototypeOf?Object.setPrototypeOf(re,ae):re.__proto__=ae)}var W=(0,p.default)("quill:clipboard"),H="__ql-matcher",L=[[Node.TEXT_NODE,Pe],[Node.TEXT_NODE,oe],["br",J],[Node.ELEMENT_NODE,oe],[Node.ELEMENT_NODE,Q],[Node.ELEMENT_NODE,de],[Node.ELEMENT_NODE,X],[Node.ELEMENT_NODE,me],["li",ie],["b",K.bind(K,"bold")],["i",K.bind(K,"italic")],["style",ne]],M=[m.AlignAttribute,S.DirectionAttribute].reduce(function(re,ae){return re[ae.keyName]=ae,re},{}),D=[m.AlignStyle,_.BackgroundStyle,R.ColorStyle,S.DirectionStyle,E.FontStyle,P.SizeStyle].reduce(function(re,ae){return re[ae.keyName]=ae,re},{}),B=function(re){Z(ae,re);function ae(we,be){U(this,ae);var te=G(this,(ae.__proto__||Object.getPrototypeOf(ae)).call(this,we,be));return te.quill.root.addEventListener("paste",te.onPaste.bind(te)),te.container=te.quill.addContainer("ql-clipboard"),te.container.setAttribute("contenteditable",!0),te.container.setAttribute("tabindex",-1),te.matchers=[],L.concat(te.options.matchers).forEach(function(fe){var he=a(fe,2),Ee=he[0],Ve=he[1];!be.matchVisual&&Ve===de||te.addMatcher(Ee,Ve)}),te}return l(ae,[{key:"addMatcher",value:function(be,te){this.matchers.push([be,te])}},{key:"convert",value:function(be){if(typeof be=="string")return this.container.innerHTML=be.replace(/\>\r?\n +\</g,"><"),this.convert();var te=this.quill.getFormat(this.quill.selection.savedRange.index);if(te[C.default.blotName]){var fe=this.container.innerText;return this.container.innerHTML="",new x.default().insert(fe,N({},C.default.blotName,te[C.default.blotName]))}var he=this.prepareMatching(),Ee=a(he,2),Ve=Ee[0],Je=Ee[1],Ae=z(this.container,Ve,Je);return F(Ae,`
|
|
140
|
+
`)&&Ae.ops[Ae.ops.length-1].attributes==null&&(Ae=Ae.compose(new x.default().retain(Ae.length()-1).delete(1))),W.log("convert",this.container.innerHTML,Ae),this.container.innerHTML="",Ae}},{key:"dangerouslyPasteHTML",value:function(be,te){var fe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:g.default.sources.API;if(typeof be=="string")this.quill.setContents(this.convert(be),te),this.quill.setSelection(0,g.default.sources.SILENT);else{var he=this.convert(te);this.quill.updateContents(new x.default().retain(be).concat(he),fe),this.quill.setSelection(be+he.length(),g.default.sources.SILENT)}}},{key:"onPaste",value:function(be){var te=this;if(!(be.defaultPrevented||!this.quill.isEnabled())){var fe=this.quill.getSelection(),he=new x.default().retain(fe.index),Ee=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(g.default.sources.SILENT),setTimeout(function(){he=he.concat(te.convert()).delete(fe.length),te.quill.updateContents(he,g.default.sources.USER),te.quill.setSelection(he.length()-fe.length,g.default.sources.SILENT),te.quill.scrollingContainer.scrollTop=Ee,te.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var be=this,te=[],fe=[];return this.matchers.forEach(function(he){var Ee=a(he,2),Ve=Ee[0],Je=Ee[1];switch(Ve){case Node.TEXT_NODE:fe.push(Je);break;case Node.ELEMENT_NODE:te.push(Je);break;default:[].forEach.call(be.container.querySelectorAll(Ve),function(Ae){Ae[H]=Ae[H]||[],Ae[H].push(Je)});break}}),[te,fe]}}]),ae}(d.default);B.DEFAULTS={matchers:[],matchVisual:!0};function V(re,ae,we){return(typeof ae>"u"?"undefined":o(ae))==="object"?Object.keys(ae).reduce(function(be,te){return V(be,te,ae[te])},re):re.reduce(function(be,te){return te.attributes&&te.attributes[ae]?be.push(te):be.insert(te.insert,(0,f.default)({},N({},ae,we),te.attributes))},new x.default)}function Y(re){if(re.nodeType!==Node.ELEMENT_NODE)return{};var ae="__ql-computed-style";return re[ae]||(re[ae]=window.getComputedStyle(re))}function F(re,ae){for(var we="",be=re.ops.length-1;be>=0&&we.length<ae.length;--be){var te=re.ops[be];if(typeof te.insert!="string")break;we=te.insert+we}return we.slice(-1*ae.length)===ae}function $(re){if(re.childNodes.length===0)return!1;var ae=Y(re);return["block","list-item"].indexOf(ae.display)>-1}function z(re,ae,we){return re.nodeType===re.TEXT_NODE?we.reduce(function(be,te){return te(re,be)},new x.default):re.nodeType===re.ELEMENT_NODE?[].reduce.call(re.childNodes||[],function(be,te){var fe=z(te,ae,we);return te.nodeType===re.ELEMENT_NODE&&(fe=ae.reduce(function(he,Ee){return Ee(te,he)},fe),fe=(te[H]||[]).reduce(function(he,Ee){return Ee(te,he)},fe)),be.concat(fe)},new x.default):new x.default}function K(re,ae,we){return V(we,re,!0)}function X(re,ae){var we=v.default.Attributor.Attribute.keys(re),be=v.default.Attributor.Class.keys(re),te=v.default.Attributor.Style.keys(re),fe={};return we.concat(be).concat(te).forEach(function(he){var Ee=v.default.query(he,v.default.Scope.ATTRIBUTE);Ee!=null&&(fe[Ee.attrName]=Ee.value(re),fe[Ee.attrName])||(Ee=M[he],Ee!=null&&(Ee.attrName===he||Ee.keyName===he)&&(fe[Ee.attrName]=Ee.value(re)||void 0),Ee=D[he],Ee!=null&&(Ee.attrName===he||Ee.keyName===he)&&(Ee=D[he],fe[Ee.attrName]=Ee.value(re)||void 0))}),Object.keys(fe).length>0&&(ae=V(ae,fe)),ae}function Q(re,ae){var we=v.default.query(re);if(we==null)return ae;if(we.prototype instanceof v.default.Embed){var be={},te=we.value(re);te!=null&&(be[we.blotName]=te,ae=new x.default().insert(be,we.formats(re)))}else typeof we.formats=="function"&&(ae=V(ae,we.blotName,we.formats(re)));return ae}function J(re,ae){return F(ae,`
|
|
141
141
|
`)||ae.insert(`
|
|
142
142
|
`),ae}function ne(){return new x.default}function ie(re,ae){var we=v.default.query(re);if(we==null||we.blotName!=="list-item"||!F(ae,`
|
|
143
143
|
`))return ae;for(var be=-1,te=re.parentNode;!te.classList.contains("ql-clipboard");)(v.default.query(te)||{}).blotName==="list"&&(be+=1),te=te.parentNode;return be<=0?ae:ae.compose(new x.default().retain(ae.length()-1).retain(1,{indent:be}))}function oe(re,ae){return F(ae,`
|
|
144
144
|
`)||($(re)||ae.length()>0&&re.nextSibling&&$(re.nextSibling))&&ae.insert(`
|
|
145
|
-
`),ae}function
|
|
145
|
+
`),ae}function de(re,ae){if($(re)&&re.nextElementSibling!=null&&!F(ae,`
|
|
146
146
|
|
|
147
147
|
`)){var we=re.offsetHeight+parseFloat(Y(re).marginTop)+parseFloat(Y(re).marginBottom);re.nextElementSibling.offsetTop>re.offsetTop+we*1.5&&ae.insert(`
|
|
148
|
-
`)}return ae}function me(re,ae){var we={},be=re.style||{};return be.fontStyle&&Y(re).fontStyle==="italic"&&(we.italic=!0),be.fontWeight&&(Y(re).fontWeight.startsWith("bold")||parseInt(Y(re).fontWeight)>=700)&&(we.bold=!0),Object.keys(we).length>0&&(ae=V(ae,we)),parseFloat(be.textIndent||0)>0&&(ae=new x.default().insert(" ").concat(ae)),ae}function Pe(re,ae){var we=re.data;if(re.parentNode.tagName==="O:P")return ae.insert(we.trim());if(we.trim().length===0&&re.parentNode.classList.contains("ql-clipboard"))return ae;if(!Y(re.parentNode).whiteSpace.startsWith("pre")){var be=function(fe,de){return de=de.replace(/[^\u00a0]/g,""),de.length<1&&fe?" ":de};we=we.replace(/\r\n/g," ").replace(/\n/g," "),we=we.replace(/\s\s+/g,be.bind(be,!0)),(re.previousSibling==null&&$(re.parentNode)||re.previousSibling!=null&&$(re.previousSibling))&&(we=we.replace(/^\s+/,be.bind(be,!1))),(re.nextSibling==null&&$(re.parentNode)||re.nextSibling!=null&&$(re.nextSibling))&&(we=we.replace(/\s+$/,be.bind(be,!1)))}return ae.insert(we)}r.default=B,r.matchAttributor=X,r.matchBlot=Q,r.matchNewline=oe,r.matchSpacing=he,r.matchText=Pe},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function O(g,b){for(var p=0;p<b.length;p++){var y=b[p];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(g,y.key,y)}}return function(g,b,p){return b&&O(g.prototype,b),p&&O(g,p),g}}(),a=function O(g,b,p){g===null&&(g=Function.prototype);var y=Object.getOwnPropertyDescriptor(g,b);if(y===void 0){var d=Object.getPrototypeOf(g);return d===null?void 0:O(d,b,p)}else{if("value"in y)return y.value;var m=y.get;return m===void 0?void 0:m.call(p)}},l=i(6),s=f(l);function f(O){return O&&O.__esModule?O:{default:O}}function h(O,g){if(!(O instanceof g))throw new TypeError("Cannot call a class as a function")}function x(O,g){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:O}function w(O,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);O.prototype=Object.create(g&&g.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(O,g):O.__proto__=g)}var v=function(O){w(g,O);function g(){return h(this,g),x(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return o(g,[{key:"optimize",value:function(p){a(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"optimize",this).call(this,p),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return a(g.__proto__||Object.getPrototypeOf(g),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),g}(s.default);v.blotName="bold",v.tagName=["STRONG","B"],r.default=v},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.addControls=r.default=void 0;var o=function(){function P(T,N){var U=[],G=!0,Z=!1,W=void 0;try{for(var H=T[Symbol.iterator](),L;!(G=(L=H.next()).done)&&(U.push(L.value),!(N&&U.length===N));G=!0);}catch(M){Z=!0,W=M}finally{try{!G&&H.return&&H.return()}finally{if(Z)throw W}}return U}return function(T,N){if(Array.isArray(T))return T;if(Symbol.iterator in Object(T))return P(T,N);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function P(T,N){for(var U=0;U<N.length;U++){var G=N[U];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(T,G.key,G)}}return function(T,N,U){return N&&P(T.prototype,N),U&&P(T,U),T}}(),l=i(2),s=p(l),f=i(0),h=p(f),x=i(5),w=p(x),v=i(10),O=p(v),g=i(9),b=p(g);function p(P){return P&&P.__esModule?P:{default:P}}function y(P,T,N){return T in P?Object.defineProperty(P,T,{value:N,enumerable:!0,configurable:!0,writable:!0}):P[T]=N,P}function d(P,T){if(!(P instanceof T))throw new TypeError("Cannot call a class as a function")}function m(P,T){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:P}function _(P,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);P.prototype=Object.create(T&&T.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(P,T):P.__proto__=T)}var A=(0,O.default)("quill:toolbar"),C=function(P){_(T,P);function T(N,U){d(this,T);var G=m(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,N,U));if(Array.isArray(G.options.container)){var Z=document.createElement("div");S(Z,G.options.container),N.container.parentNode.insertBefore(Z,N.container),G.container=Z}else typeof G.options.container=="string"?G.container=document.querySelector(G.options.container):G.container=G.options.container;if(!(G.container instanceof HTMLElement)){var W;return W=A.error("Container required for toolbar",G.options),m(G,W)}return G.container.classList.add("ql-toolbar"),G.controls=[],G.handlers={},Object.keys(G.options.handlers).forEach(function(H){G.addHandler(H,G.options.handlers[H])}),[].forEach.call(G.container.querySelectorAll("button, select"),function(H){G.attach(H)}),G.quill.on(w.default.events.EDITOR_CHANGE,function(H,L){H===w.default.events.SELECTION_CHANGE&&G.update(L)}),G.quill.on(w.default.events.SCROLL_OPTIMIZE,function(){var H=G.quill.selection.getRange(),L=o(H,1),M=L[0];G.update(M)}),G}return a(T,[{key:"addHandler",value:function(U,G){this.handlers[U]=G}},{key:"attach",value:function(U){var G=this,Z=[].find.call(U.classList,function(H){return H.indexOf("ql-")===0});if(Z){if(Z=Z.slice(3),U.tagName==="BUTTON"&&U.setAttribute("type","button"),this.handlers[Z]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[Z]==null){A.warn("ignoring attaching to disabled format",Z,U);return}if(h.default.query(Z)==null){A.warn("ignoring attaching to nonexistent format",Z,U);return}}var W=U.tagName==="SELECT"?"change":"click";U.addEventListener(W,function(H){var L=void 0;if(U.tagName==="SELECT"){if(U.selectedIndex<0)return;var M=U.options[U.selectedIndex];M.hasAttribute("selected")?L=!1:L=M.value||!1}else U.classList.contains("ql-active")?L=!1:L=U.value||!U.hasAttribute("value"),H.preventDefault();G.quill.focus();var D=G.quill.selection.getRange(),B=o(D,1),V=B[0];if(G.handlers[Z]!=null)G.handlers[Z].call(G,L);else if(h.default.query(Z).prototype instanceof h.default.Embed){if(L=prompt("Enter "+Z),!L)return;G.quill.updateContents(new s.default().retain(V.index).delete(V.length).insert(y({},Z,L)),w.default.sources.USER)}else G.quill.format(Z,L,w.default.sources.USER);G.update(V)}),this.controls.push([Z,U])}}},{key:"update",value:function(U){var G=U==null?{}:this.quill.getFormat(U);this.controls.forEach(function(Z){var W=o(Z,2),H=W[0],L=W[1];if(L.tagName==="SELECT"){var M=void 0;if(U==null)M=null;else if(G[H]==null)M=L.querySelector("option[selected]");else if(!Array.isArray(G[H])){var D=G[H];typeof D=="string"&&(D=D.replace(/\"/g,'\\"')),M=L.querySelector('option[value="'+D+'"]')}M==null?(L.value="",L.selectedIndex=-1):M.selected=!0}else if(U==null)L.classList.remove("ql-active");else if(L.hasAttribute("value")){var B=G[H]===L.getAttribute("value")||G[H]!=null&&G[H].toString()===L.getAttribute("value")||G[H]==null&&!L.getAttribute("value");L.classList.toggle("ql-active",B)}else L.classList.toggle("ql-active",G[H]!=null)})}}]),T}(b.default);C.DEFAULTS={};function R(P,T,N){var U=document.createElement("button");U.setAttribute("type","button"),U.classList.add("ql-"+T),N!=null&&(U.value=N),P.appendChild(U)}function S(P,T){Array.isArray(T[0])||(T=[T]),T.forEach(function(N){var U=document.createElement("span");U.classList.add("ql-formats"),N.forEach(function(G){if(typeof G=="string")R(U,G);else{var Z=Object.keys(G)[0],W=G[Z];Array.isArray(W)?E(U,Z,W):R(U,Z,W)}}),P.appendChild(U)})}function E(P,T,N){var U=document.createElement("select");U.classList.add("ql-"+T),N.forEach(function(G){var Z=document.createElement("option");G!==!1?Z.setAttribute("value",G):Z.setAttribute("selected","selected"),U.appendChild(Z)}),P.appendChild(U)}C.DEFAULTS={container:null,handlers:{clean:function(){var T=this,N=this.quill.getSelection();if(N!=null)if(N.length==0){var U=this.quill.getFormat();Object.keys(U).forEach(function(G){h.default.query(G,h.default.Scope.INLINE)!=null&&T.quill.format(G,!1)})}else this.quill.removeFormat(N,w.default.sources.USER)},direction:function(T){var N=this.quill.getFormat().align;T==="rtl"&&N==null?this.quill.format("align","right",w.default.sources.USER):!T&&N==="right"&&this.quill.format("align",!1,w.default.sources.USER),this.quill.format("direction",T,w.default.sources.USER)},indent:function(T){var N=this.quill.getSelection(),U=this.quill.getFormat(N),G=parseInt(U.indent||0);if(T==="+1"||T==="-1"){var Z=T==="+1"?1:-1;U.direction==="rtl"&&(Z*=-1),this.quill.format("indent",G+Z,w.default.sources.USER)}},link:function(T){T===!0&&(T=prompt("Enter link URL:")),this.quill.format("link",T,w.default.sources.USER)},list:function(T){var N=this.quill.getSelection(),U=this.quill.getFormat(N);T==="check"?U.list==="checked"||U.list==="unchecked"?this.quill.format("list",!1,w.default.sources.USER):this.quill.format("list","unchecked",w.default.sources.USER):this.quill.format("list",T,w.default.sources.USER)}}},r.default=C,r.addControls=S},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function O(g,b){for(var p=0;p<b.length;p++){var y=b[p];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(g,y.key,y)}}return function(g,b,p){return b&&O(g.prototype,b),p&&O(g,p),g}}(),a=function O(g,b,p){g===null&&(g=Function.prototype);var y=Object.getOwnPropertyDescriptor(g,b);if(y===void 0){var d=Object.getPrototypeOf(g);return d===null?void 0:O(d,b,p)}else{if("value"in y)return y.value;var m=y.get;return m===void 0?void 0:m.call(p)}},l=i(28),s=f(l);function f(O){return O&&O.__esModule?O:{default:O}}function h(O,g){if(!(O instanceof g))throw new TypeError("Cannot call a class as a function")}function x(O,g){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:O}function w(O,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);O.prototype=Object.create(g&&g.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(O,g):O.__proto__=g)}var v=function(O){w(g,O);function g(b,p){h(this,g);var y=x(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,b));return y.label.innerHTML=p,y.container.classList.add("ql-color-picker"),[].slice.call(y.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(d){d.classList.add("ql-primary")}),y}return o(g,[{key:"buildItem",value:function(p){var y=a(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"buildItem",this).call(this,p);return y.style.backgroundColor=p.getAttribute("value")||"",y}},{key:"selectItem",value:function(p,y){a(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"selectItem",this).call(this,p,y);var d=this.label.querySelector(".ql-color-label"),m=p&&p.getAttribute("data-value")||"";d&&(d.tagName==="line"?d.style.stroke=m:d.style.fill=m)}}]),g}(s.default);r.default=v},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function O(g,b){for(var p=0;p<b.length;p++){var y=b[p];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(g,y.key,y)}}return function(g,b,p){return b&&O(g.prototype,b),p&&O(g,p),g}}(),a=function O(g,b,p){g===null&&(g=Function.prototype);var y=Object.getOwnPropertyDescriptor(g,b);if(y===void 0){var d=Object.getPrototypeOf(g);return d===null?void 0:O(d,b,p)}else{if("value"in y)return y.value;var m=y.get;return m===void 0?void 0:m.call(p)}},l=i(28),s=f(l);function f(O){return O&&O.__esModule?O:{default:O}}function h(O,g){if(!(O instanceof g))throw new TypeError("Cannot call a class as a function")}function x(O,g){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:O}function w(O,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);O.prototype=Object.create(g&&g.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(O,g):O.__proto__=g)}var v=function(O){w(g,O);function g(b,p){h(this,g);var y=x(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,b));return y.container.classList.add("ql-icon-picker"),[].forEach.call(y.container.querySelectorAll(".ql-picker-item"),function(d){d.innerHTML=p[d.getAttribute("data-value")||""]}),y.defaultItem=y.container.querySelector(".ql-selected"),y.selectItem(y.defaultItem),y}return o(g,[{key:"selectItem",value:function(p,y){a(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"selectItem",this).call(this,p,y),p=p||this.defaultItem,this.label.innerHTML=p.innerHTML}}]),g}(s.default);r.default=v},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function s(f,h){for(var x=0;x<h.length;x++){var w=h[x];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(f,w.key,w)}}return function(f,h,x){return h&&s(f.prototype,h),x&&s(f,x),f}}();function a(s,f){if(!(s instanceof f))throw new TypeError("Cannot call a class as a function")}var l=function(){function s(f,h){var x=this;a(this,s),this.quill=f,this.boundsContainer=h||document.body,this.root=f.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){x.root.style.marginTop=-1*x.quill.root.scrollTop+"px"}),this.hide()}return o(s,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(h){var x=h.left+h.width/2-this.root.offsetWidth/2,w=h.bottom+this.quill.root.scrollTop;this.root.style.left=x+"px",this.root.style.top=w+"px",this.root.classList.remove("ql-flip");var v=this.boundsContainer.getBoundingClientRect(),O=this.root.getBoundingClientRect(),g=0;if(O.right>v.right&&(g=v.right-O.right,this.root.style.left=x+g+"px"),O.left<v.left&&(g=v.left-O.left,this.root.style.left=x+g+"px"),O.bottom>v.bottom){var b=O.bottom-O.top,p=h.bottom-h.top+b;this.root.style.top=w-p+"px",this.root.classList.add("ql-flip")}return g}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),s}();r.default=l},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function E(P,T){var N=[],U=!0,G=!1,Z=void 0;try{for(var W=P[Symbol.iterator](),H;!(U=(H=W.next()).done)&&(N.push(H.value),!(T&&N.length===T));U=!0);}catch(L){G=!0,Z=L}finally{try{!U&&W.return&&W.return()}finally{if(G)throw Z}}return N}return function(P,T){if(Array.isArray(P))return P;if(Symbol.iterator in Object(P))return E(P,T);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function E(P,T,N){P===null&&(P=Function.prototype);var U=Object.getOwnPropertyDescriptor(P,T);if(U===void 0){var G=Object.getPrototypeOf(P);return G===null?void 0:E(G,T,N)}else{if("value"in U)return U.value;var Z=U.get;return Z===void 0?void 0:Z.call(N)}},l=function(){function E(P,T){for(var N=0;N<T.length;N++){var U=T[N];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(P,U.key,U)}}return function(P,T,N){return T&&E(P.prototype,T),N&&E(P,N),P}}(),s=i(3),f=d(s),h=i(8),x=d(h),w=i(43),v=d(w),O=i(27),g=d(O),b=i(15),p=i(41),y=d(p);function d(E){return E&&E.__esModule?E:{default:E}}function m(E,P){if(!(E instanceof P))throw new TypeError("Cannot call a class as a function")}function _(E,P){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:E}function A(E,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);E.prototype=Object.create(P&&P.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(E,P):E.__proto__=P)}var C=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],R=function(E){A(P,E);function P(T,N){m(this,P),N.modules.toolbar!=null&&N.modules.toolbar.container==null&&(N.modules.toolbar.container=C);var U=_(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,T,N));return U.quill.container.classList.add("ql-snow"),U}return l(P,[{key:"extendToolbar",value:function(N){N.container.classList.add("ql-snow"),this.buildButtons([].slice.call(N.container.querySelectorAll("button")),y.default),this.buildPickers([].slice.call(N.container.querySelectorAll("select")),y.default),this.tooltip=new S(this.quill,this.options.bounds),N.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(U,G){N.handlers.link.call(N,!G.format.link)})}}]),P}(v.default);R.DEFAULTS=(0,f.default)(!0,{},v.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(P){if(P){var T=this.quill.getSelection();if(T==null||T.length==0)return;var N=this.quill.getText(T);/^\S+@\S+\.\S+$/.test(N)&&N.indexOf("mailto:")!==0&&(N="mailto:"+N);var U=this.quill.theme.tooltip;U.edit("link",N)}else this.quill.format("link",!1)}}}}});var S=function(E){A(P,E);function P(T,N){m(this,P);var U=_(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,T,N));return U.preview=U.root.querySelector("a.ql-preview"),U}return l(P,[{key:"listen",value:function(){var N=this;a(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(U){N.root.classList.contains("ql-editing")?N.save():N.edit("link",N.preview.textContent),U.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(U){if(N.linkRange!=null){var G=N.linkRange;N.restoreFocus(),N.quill.formatText(G,"link",!1,x.default.sources.USER),delete N.linkRange}U.preventDefault(),N.hide()}),this.quill.on(x.default.events.SELECTION_CHANGE,function(U,G,Z){if(U!=null){if(U.length===0&&Z===x.default.sources.USER){var W=N.quill.scroll.descendant(g.default,U.index),H=o(W,2),L=H[0],M=H[1];if(L!=null){N.linkRange=new b.Range(U.index-M,L.length());var D=g.default.formats(L.domNode);N.preview.textContent=D,N.preview.setAttribute("href",D),N.show(),N.position(N.quill.getBounds(N.linkRange));return}}else delete N.linkRange;N.hide()}})}},{key:"show",value:function(){a(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),P}(w.BaseTooltip);S.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),r.default=R},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(29),a=te(o),l=i(36),s=i(38),f=i(64),h=i(65),x=te(h),w=i(66),v=te(w),O=i(67),g=te(O),b=i(37),p=i(26),y=i(39),d=i(40),m=i(56),_=te(m),A=i(68),C=te(A),R=i(27),S=te(R),E=i(69),P=te(E),T=i(70),N=te(T),U=i(71),G=te(U),Z=i(72),W=te(Z),H=i(73),L=te(H),M=i(13),D=te(M),B=i(74),V=te(B),Y=i(75),F=te(Y),$=i(57),z=te($),K=i(41),X=te(K),Q=i(28),J=te(Q),ne=i(59),ie=te(ne),oe=i(60),he=te(oe),me=i(61),Pe=te(me),re=i(108),ae=te(re),we=i(62),be=te(we);function te(fe){return fe&&fe.__esModule?fe:{default:fe}}a.default.register({"attributors/attribute/direction":s.DirectionAttribute,"attributors/class/align":l.AlignClass,"attributors/class/background":b.BackgroundClass,"attributors/class/color":p.ColorClass,"attributors/class/direction":s.DirectionClass,"attributors/class/font":y.FontClass,"attributors/class/size":d.SizeClass,"attributors/style/align":l.AlignStyle,"attributors/style/background":b.BackgroundStyle,"attributors/style/color":p.ColorStyle,"attributors/style/direction":s.DirectionStyle,"attributors/style/font":y.FontStyle,"attributors/style/size":d.SizeStyle},!0),a.default.register({"formats/align":l.AlignClass,"formats/direction":s.DirectionClass,"formats/indent":f.IndentClass,"formats/background":b.BackgroundStyle,"formats/color":p.ColorStyle,"formats/font":y.FontClass,"formats/size":d.SizeClass,"formats/blockquote":x.default,"formats/code-block":D.default,"formats/header":v.default,"formats/list":g.default,"formats/bold":_.default,"formats/code":M.Code,"formats/italic":C.default,"formats/link":S.default,"formats/script":P.default,"formats/strike":N.default,"formats/underline":G.default,"formats/image":W.default,"formats/video":L.default,"formats/list/item":O.ListItem,"modules/formula":V.default,"modules/syntax":F.default,"modules/toolbar":z.default,"themes/bubble":ae.default,"themes/snow":be.default,"ui/icons":X.default,"ui/picker":J.default,"ui/icon-picker":he.default,"ui/color-picker":ie.default,"ui/tooltip":Pe.default},!0),r.default=a.default},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.IndentClass=void 0;var o=function(){function g(b,p){for(var y=0;y<p.length;y++){var d=p[y];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(b,d.key,d)}}return function(b,p,y){return p&&g(b.prototype,p),y&&g(b,y),b}}(),a=function g(b,p,y){b===null&&(b=Function.prototype);var d=Object.getOwnPropertyDescriptor(b,p);if(d===void 0){var m=Object.getPrototypeOf(b);return m===null?void 0:g(m,p,y)}else{if("value"in d)return d.value;var _=d.get;return _===void 0?void 0:_.call(y)}},l=i(0),s=f(l);function f(g){return g&&g.__esModule?g:{default:g}}function h(g,b){if(!(g instanceof b))throw new TypeError("Cannot call a class as a function")}function x(g,b){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:g}function w(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(g,b):g.__proto__=b)}var v=function(g){w(b,g);function b(){return h(this,b),x(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return o(b,[{key:"add",value:function(y,d){if(d==="+1"||d==="-1"){var m=this.value(y)||0;d=d==="+1"?m+1:m-1}return d===0?(this.remove(y),!0):a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"add",this).call(this,y,d)}},{key:"canAdd",value:function(y,d){return a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"canAdd",this).call(this,y,d)||a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"canAdd",this).call(this,y,parseInt(d))}},{key:"value",value:function(y){return parseInt(a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"value",this).call(this,y))||void 0}}]),b}(s.default.Attributor.Class),O=new v("indent","ql-indent",{scope:s.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});r.IndentClass=O},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(4),a=l(o);function l(w){return w&&w.__esModule?w:{default:w}}function s(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function f(w,v){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:w}function h(w,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);w.prototype=Object.create(v&&v.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(w,v):w.__proto__=v)}var x=function(w){h(v,w);function v(){return s(this,v),f(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return v}(a.default);x.blotName="blockquote",x.tagName="blockquote",r.default=x},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function v(O,g){for(var b=0;b<g.length;b++){var p=g[b];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(O,p.key,p)}}return function(O,g,b){return g&&v(O.prototype,g),b&&v(O,b),O}}(),a=i(4),l=s(a);function s(v){return v&&v.__esModule?v:{default:v}}function f(v,O){if(!(v instanceof O))throw new TypeError("Cannot call a class as a function")}function h(v,O){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:v}function x(v,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);v.prototype=Object.create(O&&O.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(v,O):v.__proto__=O)}var w=function(v){x(O,v);function O(){return f(this,O),h(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return o(O,null,[{key:"formats",value:function(b){return this.tagName.indexOf(b.tagName)+1}}]),O}(l.default);w.blotName="header",w.tagName=["H1","H2","H3","H4","H5","H6"],r.default=w},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.ListItem=void 0;var o=function(){function m(_,A){for(var C=0;C<A.length;C++){var R=A[C];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(_,R.key,R)}}return function(_,A,C){return A&&m(_.prototype,A),C&&m(_,C),_}}(),a=function m(_,A,C){_===null&&(_=Function.prototype);var R=Object.getOwnPropertyDescriptor(_,A);if(R===void 0){var S=Object.getPrototypeOf(_);return S===null?void 0:m(S,A,C)}else{if("value"in R)return R.value;var E=R.get;return E===void 0?void 0:E.call(C)}},l=i(0),s=v(l),f=i(4),h=v(f),x=i(25),w=v(x);function v(m){return m&&m.__esModule?m:{default:m}}function O(m,_,A){return _ in m?Object.defineProperty(m,_,{value:A,enumerable:!0,configurable:!0,writable:!0}):m[_]=A,m}function g(m,_){if(!(m instanceof _))throw new TypeError("Cannot call a class as a function")}function b(m,_){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:m}function p(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(m,_):m.__proto__=_)}var y=function(m){p(_,m);function _(){return g(this,_),b(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return o(_,[{key:"format",value:function(C,R){C===d.blotName&&!R?this.replaceWith(s.default.create(this.statics.scope)):a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"format",this).call(this,C,R)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(C,R){return this.parent.isolate(this.offset(this.parent),this.length()),C===this.parent.statics.blotName?(this.parent.replaceWith(C,R),this):(this.parent.unwrap(),a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"replaceWith",this).call(this,C,R))}}],[{key:"formats",value:function(C){return C.tagName===this.tagName?void 0:a(_.__proto__||Object.getPrototypeOf(_),"formats",this).call(this,C)}}]),_}(h.default);y.blotName="list-item",y.tagName="LI";var d=function(m){p(_,m),o(_,null,[{key:"create",value:function(C){var R=C==="ordered"?"OL":"UL",S=a(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this,R);return(C==="checked"||C==="unchecked")&&S.setAttribute("data-checked",C==="checked"),S}},{key:"formats",value:function(C){if(C.tagName==="OL")return"ordered";if(C.tagName==="UL")return C.hasAttribute("data-checked")?C.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function _(A){g(this,_);var C=b(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,A)),R=function(E){if(E.target.parentNode===A){var P=C.statics.formats(A),T=s.default.find(E.target);P==="checked"?T.format("list","unchecked"):P==="unchecked"&&T.format("list","checked")}};return A.addEventListener("touchstart",R),A.addEventListener("mousedown",R),C}return o(_,[{key:"format",value:function(C,R){this.children.length>0&&this.children.tail.format(C,R)}},{key:"formats",value:function(){return O({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(C,R){if(C instanceof y)a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"insertBefore",this).call(this,C,R);else{var S=R==null?this.length():R.offset(this),E=this.split(S);E.parent.insertBefore(C,E)}}},{key:"optimize",value:function(C){a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"optimize",this).call(this,C);var R=this.next;R!=null&&R.prev===this&&R.statics.blotName===this.statics.blotName&&R.domNode.tagName===this.domNode.tagName&&R.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(R.moveChildren(this),R.remove())}},{key:"replace",value:function(C){if(C.statics.blotName!==this.statics.blotName){var R=s.default.create(this.statics.defaultChild);C.moveChildren(R),this.appendChild(R)}a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"replace",this).call(this,C)}}]),_}(w.default);d.blotName="list",d.scope=s.default.Scope.BLOCK_BLOT,d.tagName=["OL","UL"],d.defaultChild="list-item",d.allowedChildren=[y],r.ListItem=y,r.default=d},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(56),a=l(o);function l(w){return w&&w.__esModule?w:{default:w}}function s(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function f(w,v){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:w}function h(w,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);w.prototype=Object.create(v&&v.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(w,v):w.__proto__=v)}var x=function(w){h(v,w);function v(){return s(this,v),f(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return v}(a.default);x.blotName="italic",x.tagName=["EM","I"],r.default=x},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function O(g,b){for(var p=0;p<b.length;p++){var y=b[p];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(g,y.key,y)}}return function(g,b,p){return b&&O(g.prototype,b),p&&O(g,p),g}}(),a=function O(g,b,p){g===null&&(g=Function.prototype);var y=Object.getOwnPropertyDescriptor(g,b);if(y===void 0){var d=Object.getPrototypeOf(g);return d===null?void 0:O(d,b,p)}else{if("value"in y)return y.value;var m=y.get;return m===void 0?void 0:m.call(p)}},l=i(6),s=f(l);function f(O){return O&&O.__esModule?O:{default:O}}function h(O,g){if(!(O instanceof g))throw new TypeError("Cannot call a class as a function")}function x(O,g){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:O}function w(O,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);O.prototype=Object.create(g&&g.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(O,g):O.__proto__=g)}var v=function(O){w(g,O);function g(){return h(this,g),x(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return o(g,null,[{key:"create",value:function(p){return p==="super"?document.createElement("sup"):p==="sub"?document.createElement("sub"):a(g.__proto__||Object.getPrototypeOf(g),"create",this).call(this,p)}},{key:"formats",value:function(p){if(p.tagName==="SUB")return"sub";if(p.tagName==="SUP")return"super"}}]),g}(s.default);v.blotName="script",v.tagName=["SUB","SUP"],r.default=v},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(6),a=l(o);function l(w){return w&&w.__esModule?w:{default:w}}function s(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function f(w,v){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:w}function h(w,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);w.prototype=Object.create(v&&v.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(w,v):w.__proto__=v)}var x=function(w){h(v,w);function v(){return s(this,v),f(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return v}(a.default);x.blotName="strike",x.tagName="S",r.default=x},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(6),a=l(o);function l(w){return w&&w.__esModule?w:{default:w}}function s(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function f(w,v){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:w}function h(w,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);w.prototype=Object.create(v&&v.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(w,v):w.__proto__=v)}var x=function(w){h(v,w);function v(){return s(this,v),f(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return v}(a.default);x.blotName="underline",x.tagName="U",r.default=x},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function b(p,y){for(var d=0;d<y.length;d++){var m=y[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(p,m.key,m)}}return function(p,y,d){return y&&b(p.prototype,y),d&&b(p,d),p}}(),a=function b(p,y,d){p===null&&(p=Function.prototype);var m=Object.getOwnPropertyDescriptor(p,y);if(m===void 0){var _=Object.getPrototypeOf(p);return _===null?void 0:b(_,y,d)}else{if("value"in m)return m.value;var A=m.get;return A===void 0?void 0:A.call(d)}},l=i(0),s=h(l),f=i(27);function h(b){return b&&b.__esModule?b:{default:b}}function x(b,p){if(!(b instanceof p))throw new TypeError("Cannot call a class as a function")}function w(b,p){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:b}function v(b,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);b.prototype=Object.create(p&&p.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(b,p):b.__proto__=p)}var O=["alt","height","width"],g=function(b){v(p,b);function p(){return x(this,p),w(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return o(p,[{key:"format",value:function(d,m){O.indexOf(d)>-1?m?this.domNode.setAttribute(d,m):this.domNode.removeAttribute(d):a(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"format",this).call(this,d,m)}}],[{key:"create",value:function(d){var m=a(p.__proto__||Object.getPrototypeOf(p),"create",this).call(this,d);return typeof d=="string"&&m.setAttribute("src",this.sanitize(d)),m}},{key:"formats",value:function(d){return O.reduce(function(m,_){return d.hasAttribute(_)&&(m[_]=d.getAttribute(_)),m},{})}},{key:"match",value:function(d){return/\.(jpe?g|gif|png)$/.test(d)||/^data:image\/.+;base64/.test(d)}},{key:"sanitize",value:function(d){return(0,f.sanitize)(d,["http","https","data"])?d:"//:0"}},{key:"value",value:function(d){return d.getAttribute("src")}}]),p}(s.default.Embed);g.blotName="image",g.tagName="IMG",r.default=g},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function b(p,y){for(var d=0;d<y.length;d++){var m=y[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(p,m.key,m)}}return function(p,y,d){return y&&b(p.prototype,y),d&&b(p,d),p}}(),a=function b(p,y,d){p===null&&(p=Function.prototype);var m=Object.getOwnPropertyDescriptor(p,y);if(m===void 0){var _=Object.getPrototypeOf(p);return _===null?void 0:b(_,y,d)}else{if("value"in m)return m.value;var A=m.get;return A===void 0?void 0:A.call(d)}},l=i(4),s=i(27),f=h(s);function h(b){return b&&b.__esModule?b:{default:b}}function x(b,p){if(!(b instanceof p))throw new TypeError("Cannot call a class as a function")}function w(b,p){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:b}function v(b,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);b.prototype=Object.create(p&&p.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(b,p):b.__proto__=p)}var O=["height","width"],g=function(b){v(p,b);function p(){return x(this,p),w(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return o(p,[{key:"format",value:function(d,m){O.indexOf(d)>-1?m?this.domNode.setAttribute(d,m):this.domNode.removeAttribute(d):a(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"format",this).call(this,d,m)}}],[{key:"create",value:function(d){var m=a(p.__proto__||Object.getPrototypeOf(p),"create",this).call(this,d);return m.setAttribute("frameborder","0"),m.setAttribute("allowfullscreen",!0),m.setAttribute("src",this.sanitize(d)),m}},{key:"formats",value:function(d){return O.reduce(function(m,_){return d.hasAttribute(_)&&(m[_]=d.getAttribute(_)),m},{})}},{key:"sanitize",value:function(d){return f.default.sanitize(d)}},{key:"value",value:function(d){return d.getAttribute("src")}}]),p}(l.BlockEmbed);g.blotName="video",g.className="ql-video",g.tagName="IFRAME",r.default=g},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.FormulaBlot=void 0;var o=function(){function d(m,_){for(var A=0;A<_.length;A++){var C=_[A];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(m,C.key,C)}}return function(m,_,A){return _&&d(m.prototype,_),A&&d(m,A),m}}(),a=function d(m,_,A){m===null&&(m=Function.prototype);var C=Object.getOwnPropertyDescriptor(m,_);if(C===void 0){var R=Object.getPrototypeOf(m);return R===null?void 0:d(R,_,A)}else{if("value"in C)return C.value;var S=C.get;return S===void 0?void 0:S.call(A)}},l=i(35),s=v(l),f=i(5),h=v(f),x=i(9),w=v(x);function v(d){return d&&d.__esModule?d:{default:d}}function O(d,m){if(!(d instanceof m))throw new TypeError("Cannot call a class as a function")}function g(d,m){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:d}function b(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(d,m):d.__proto__=m)}var p=function(d){b(m,d);function m(){return O(this,m),g(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return o(m,null,[{key:"create",value:function(A){var C=a(m.__proto__||Object.getPrototypeOf(m),"create",this).call(this,A);return typeof A=="string"&&(window.katex.render(A,C,{throwOnError:!1,errorColor:"#f00"}),C.setAttribute("data-value",A)),C}},{key:"value",value:function(A){return A.getAttribute("data-value")}}]),m}(s.default);p.blotName="formula",p.className="ql-formula",p.tagName="SPAN";var y=function(d){b(m,d),o(m,null,[{key:"register",value:function(){h.default.register(p,!0)}}]);function m(){O(this,m);var _=g(this,(m.__proto__||Object.getPrototypeOf(m)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return _}return m}(w.default);r.FormulaBlot=p,r.default=y},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.CodeToken=r.CodeBlock=void 0;var o=function(){function A(C,R){for(var S=0;S<R.length;S++){var E=R[S];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(C,E.key,E)}}return function(C,R,S){return R&&A(C.prototype,R),S&&A(C,S),C}}(),a=function A(C,R,S){C===null&&(C=Function.prototype);var E=Object.getOwnPropertyDescriptor(C,R);if(E===void 0){var P=Object.getPrototypeOf(C);return P===null?void 0:A(P,R,S)}else{if("value"in E)return E.value;var T=E.get;return T===void 0?void 0:T.call(S)}},l=i(0),s=g(l),f=i(5),h=g(f),x=i(9),w=g(x),v=i(13),O=g(v);function g(A){return A&&A.__esModule?A:{default:A}}function b(A,C){if(!(A instanceof C))throw new TypeError("Cannot call a class as a function")}function p(A,C){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:A}function y(A,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);A.prototype=Object.create(C&&C.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(A,C):A.__proto__=C)}var d=function(A){y(C,A);function C(){return b(this,C),p(this,(C.__proto__||Object.getPrototypeOf(C)).apply(this,arguments))}return o(C,[{key:"replaceWith",value:function(S){this.domNode.textContent=this.domNode.textContent,this.attach(),a(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"replaceWith",this).call(this,S)}},{key:"highlight",value:function(S){var E=this.domNode.textContent;this.cachedText!==E&&((E.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=S(E),this.domNode.normalize(),this.attach()),this.cachedText=E)}}]),C}(O.default);d.className="ql-syntax";var m=new s.default.Attributor.Class("token","hljs",{scope:s.default.Scope.INLINE}),_=function(A){y(C,A),o(C,null,[{key:"register",value:function(){h.default.register(m,!0),h.default.register(d,!0)}}]);function C(R,S){b(this,C);var E=p(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,R,S));if(typeof E.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var P=null;return E.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(P),P=setTimeout(function(){E.highlight(),P=null},E.options.interval)}),E.highlight(),E}return o(C,[{key:"highlight",value:function(){var S=this;if(!this.quill.selection.composing){this.quill.update(h.default.sources.USER);var E=this.quill.getSelection();this.quill.scroll.descendants(d).forEach(function(P){P.highlight(S.options.highlight)}),this.quill.update(h.default.sources.SILENT),E!=null&&this.quill.setSelection(E,h.default.sources.SILENT)}}}]),C}(w.default);_.DEFAULTS={highlight:function(){return window.hljs==null?null:function(A){var C=window.hljs.highlightAuto(A);return C.value}}(),interval:1e3},r.CodeBlock=d,r.CodeToken=m,r.default=_},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'},function(n,r){n.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'},function(n,r){n.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'},function(n,r){n.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'},function(n,r){n.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.BubbleTooltip=void 0;var o=function C(R,S,E){R===null&&(R=Function.prototype);var P=Object.getOwnPropertyDescriptor(R,S);if(P===void 0){var T=Object.getPrototypeOf(R);return T===null?void 0:C(T,S,E)}else{if("value"in P)return P.value;var N=P.get;return N===void 0?void 0:N.call(E)}},a=function(){function C(R,S){for(var E=0;E<S.length;E++){var P=S[E];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(R,P.key,P)}}return function(R,S,E){return S&&C(R.prototype,S),E&&C(R,E),R}}(),l=i(3),s=b(l),f=i(8),h=b(f),x=i(43),w=b(x),v=i(15),O=i(41),g=b(O);function b(C){return C&&C.__esModule?C:{default:C}}function p(C,R){if(!(C instanceof R))throw new TypeError("Cannot call a class as a function")}function y(C,R){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:C}function d(C,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);C.prototype=Object.create(R&&R.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(C,R):C.__proto__=R)}var m=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],_=function(C){d(R,C);function R(S,E){p(this,R),E.modules.toolbar!=null&&E.modules.toolbar.container==null&&(E.modules.toolbar.container=m);var P=y(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,S,E));return P.quill.container.classList.add("ql-bubble"),P}return a(R,[{key:"extendToolbar",value:function(E){this.tooltip=new A(this.quill,this.options.bounds),this.tooltip.root.appendChild(E.container),this.buildButtons([].slice.call(E.container.querySelectorAll("button")),g.default),this.buildPickers([].slice.call(E.container.querySelectorAll("select")),g.default)}}]),R}(w.default);_.DEFAULTS=(0,s.default)(!0,{},w.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(R){R?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var A=function(C){d(R,C);function R(S,E){p(this,R);var P=y(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,S,E));return P.quill.on(h.default.events.EDITOR_CHANGE,function(T,N,U,G){if(T===h.default.events.SELECTION_CHANGE)if(N!=null&&N.length>0&&G===h.default.sources.USER){P.show(),P.root.style.left="0px",P.root.style.width="",P.root.style.width=P.root.offsetWidth+"px";var Z=P.quill.getLines(N.index,N.length);if(Z.length===1)P.position(P.quill.getBounds(N));else{var W=Z[Z.length-1],H=P.quill.getIndex(W),L=Math.min(W.length()-1,N.index+N.length-H),M=P.quill.getBounds(new v.Range(H,L));P.position(M)}}else document.activeElement!==P.textbox&&P.quill.hasFocus()&&P.hide()}),P}return a(R,[{key:"listen",value:function(){var E=this;o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){E.root.classList.remove("ql-editing")}),this.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!E.root.classList.contains("ql-hidden")){var P=E.quill.getSelection();P!=null&&E.position(E.quill.getBounds(P))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(E){var P=o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"position",this).call(this,E),T=this.root.querySelector(".ql-tooltip-arrow");if(T.style.marginLeft="",P===0)return P;T.style.marginLeft=-1*P-T.offsetWidth/2+"px"}}]),R}(x.BaseTooltip);A.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),r.BubbleTooltip=A,r.default=_},function(n,r,i){n.exports=i(63)}]).default})})(oS);var TD=oS.exports,g2={},aS={exports:{}},Ka={},Vu={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */Vu.exports;var I4;function AD(){return I4||(I4=1,function(t,e){(function(n){var r=e&&!e.nodeType&&e,i=t&&!t.nodeType&&t,o=typeof _e=="object"&&_e;(o.global===o||o.window===o||o.self===o)&&(n=o);var a,l=2147483647,s=36,f=1,h=26,x=38,w=700,v=72,O=128,g="-",b=/^xn--/,p=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=s-f,_=Math.floor,A=String.fromCharCode,C;function R(M){throw new RangeError(d[M])}function S(M,D){for(var B=M.length,V=[];B--;)V[B]=D(M[B]);return V}function E(M,D){var B=M.split("@"),V="";B.length>1&&(V=B[0]+"@",M=B[1]),M=M.replace(y,".");var Y=M.split("."),F=S(Y,D).join(".");return V+F}function P(M){for(var D=[],B=0,V=M.length,Y,F;B<V;)Y=M.charCodeAt(B++),Y>=55296&&Y<=56319&&B<V?(F=M.charCodeAt(B++),(F&64512)==56320?D.push(((Y&1023)<<10)+(F&1023)+65536):(D.push(Y),B--)):D.push(Y);return D}function T(M){return S(M,function(D){var B="";return D>65535&&(D-=65536,B+=A(D>>>10&1023|55296),D=56320|D&1023),B+=A(D),B}).join("")}function N(M){return M-48<10?M-22:M-65<26?M-65:M-97<26?M-97:s}function U(M,D){return M+22+75*(M<26)-((D!=0)<<5)}function G(M,D,B){var V=0;for(M=B?_(M/w):M>>1,M+=_(M/D);M>m*h>>1;V+=s)M=_(M/m);return _(V+(m+1)*M/(M+x))}function Z(M){var D=[],B=M.length,V,Y=0,F=O,$=v,z,K,X,Q,J,ne,ie,oe,he;for(z=M.lastIndexOf(g),z<0&&(z=0),K=0;K<z;++K)M.charCodeAt(K)>=128&&R("not-basic"),D.push(M.charCodeAt(K));for(X=z>0?z+1:0;X<B;){for(Q=Y,J=1,ne=s;X>=B&&R("invalid-input"),ie=N(M.charCodeAt(X++)),(ie>=s||ie>_((l-Y)/J))&&R("overflow"),Y+=ie*J,oe=ne<=$?f:ne>=$+h?h:ne-$,!(ie<oe);ne+=s)he=s-oe,J>_(l/he)&&R("overflow"),J*=he;V=D.length+1,$=G(Y-Q,V,Q==0),_(Y/V)>l-F&&R("overflow"),F+=_(Y/V),Y%=V,D.splice(Y++,0,F)}return T(D)}function W(M){var D,B,V,Y,F,$,z,K,X,Q,J,ne=[],ie,oe,he,me;for(M=P(M),ie=M.length,D=O,B=0,F=v,$=0;$<ie;++$)J=M[$],J<128&&ne.push(A(J));for(V=Y=ne.length,Y&&ne.push(g);V<ie;){for(z=l,$=0;$<ie;++$)J=M[$],J>=D&&J<z&&(z=J);for(oe=V+1,z-D>_((l-B)/oe)&&R("overflow"),B+=(z-D)*oe,D=z,$=0;$<ie;++$)if(J=M[$],J<D&&++B>l&&R("overflow"),J==D){for(K=B,X=s;Q=X<=F?f:X>=F+h?h:X-F,!(K<Q);X+=s)me=K-Q,he=s-Q,ne.push(A(U(Q+me%he,0))),K=_(me/he);ne.push(A(U(K,0))),F=G(B,oe,V==Y),B=0,++V}++B,++D}return ne.join("")}function H(M){return E(M,function(D){return b.test(D)?Z(D.slice(4).toLowerCase()):D})}function L(M){return E(M,function(D){return p.test(D)?"xn--"+W(D):D})}if(a={version:"1.4.1",ucs2:{decode:P,encode:T},decode:Z,encode:W,toASCII:L,toUnicode:H},r&&i)if(t.exports==r)i.exports=a;else for(C in a)a.hasOwnProperty(C)&&(r[C]=a[C]);else n.punycode=a})(_e)}(Vu,Vu.exports)),Vu.exports}var og,D4;function RD(){return D4||(D4=1,og=Error),og}var ag,j4;function MD(){return j4||(j4=1,ag=EvalError),ag}var lg,F4;function LD(){return F4||(F4=1,lg=RangeError),lg}var sg,z4;function ND(){return z4||(z4=1,sg=ReferenceError),sg}var ug,B4;function lS(){return B4||(B4=1,ug=SyntaxError),ug}var cg,U4;function nf(){return U4||(U4=1,cg=TypeError),cg}var fg,H4;function ID(){return H4||(H4=1,fg=URIError),fg}var dg,$4;function DD(){return $4||($4=1,dg=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;e[n]=i;for(n in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==n||!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(e,n);if(a.value!==i||a.enumerable!==!0)return!1}return!0}),dg}var hg,G4;function jD(){if(G4)return hg;G4=1;var t=typeof Symbol<"u"&&Symbol,e=DD();return hg=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},hg}var pg,V4;function FD(){if(V4)return pg;V4=1;var t={__proto__:null,foo:{}},e=Object;return pg=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof e)},pg}var gg,q4;function zD(){if(q4)return gg;q4=1;var t="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,n=Math.max,r="[object Function]",i=function(s,f){for(var h=[],x=0;x<s.length;x+=1)h[x]=s[x];for(var w=0;w<f.length;w+=1)h[w+s.length]=f[w];return h},o=function(s,f){for(var h=[],x=f,w=0;x<s.length;x+=1,w+=1)h[w]=s[x];return h},a=function(l,s){for(var f="",h=0;h<l.length;h+=1)f+=l[h],h+1<l.length&&(f+=s);return f};return gg=function(s){var f=this;if(typeof f!="function"||e.apply(f)!==r)throw new TypeError(t+f);for(var h=o(arguments,1),x,w=function(){if(this instanceof x){var p=f.apply(this,i(h,arguments));return Object(p)===p?p:this}return f.apply(s,i(h,arguments))},v=n(0,f.length-h.length),O=[],g=0;g<v;g++)O[g]="$"+g;if(x=Function("binder","return function ("+a(O,",")+"){ return binder.apply(this,arguments); }")(w),f.prototype){var b=function(){};b.prototype=f.prototype,x.prototype=new b,b.prototype=null}return x},gg}var vg,W4;function v2(){if(W4)return vg;W4=1;var t=zD();return vg=Function.prototype.bind||t,vg}var mg,Y4;function BD(){if(Y4)return mg;Y4=1;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,n=v2();return mg=n.call(t,e),mg}var yg,K4;function lu(){if(K4)return yg;K4=1;var t,e=RD(),n=MD(),r=LD(),i=ND(),o=lS(),a=nf(),l=ID(),s=Function,f=function(W){try{return s('"use strict"; return ('+W+").constructor;")()}catch{}},h=Object.getOwnPropertyDescriptor;if(h)try{h({},"")}catch{h=null}var x=function(){throw new a},w=h?function(){try{return arguments.callee,x}catch{try{return h(arguments,"callee").get}catch{return x}}}():x,v=jD()(),O=FD()(),g=Object.getPrototypeOf||(O?function(W){return W.__proto__}:null),b={},p=typeof Uint8Array>"u"||!g?t:g(Uint8Array),y={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":v&&g?g([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":b,"%AsyncGenerator%":b,"%AsyncGeneratorFunction%":b,"%AsyncIteratorPrototype%":b,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":n,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":s,"%GeneratorFunction%":b,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":v&&g?g(g([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!v||!g?t:g(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":r,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!v||!g?t:g(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":v&&g?g(""[Symbol.iterator]()):t,"%Symbol%":v?Symbol:t,"%SyntaxError%":o,"%ThrowTypeError%":w,"%TypedArray%":p,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet};if(g)try{null.error}catch(W){var d=g(g(W));y["%Error.prototype%"]=d}var m=function W(H){var L;if(H==="%AsyncFunction%")L=f("async function () {}");else if(H==="%GeneratorFunction%")L=f("function* () {}");else if(H==="%AsyncGeneratorFunction%")L=f("async function* () {}");else if(H==="%AsyncGenerator%"){var M=W("%AsyncGeneratorFunction%");M&&(L=M.prototype)}else if(H==="%AsyncIteratorPrototype%"){var D=W("%AsyncGenerator%");D&&g&&(L=g(D.prototype))}return y[H]=L,L},_={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},A=v2(),C=BD(),R=A.call(Function.call,Array.prototype.concat),S=A.call(Function.apply,Array.prototype.splice),E=A.call(Function.call,String.prototype.replace),P=A.call(Function.call,String.prototype.slice),T=A.call(Function.call,RegExp.prototype.exec),N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,U=/\\(\\)?/g,G=function(H){var L=P(H,0,1),M=P(H,-1);if(L==="%"&&M!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(M==="%"&&L!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var D=[];return E(H,N,function(B,V,Y,F){D[D.length]=Y?E(F,U,"$1"):V||B}),D},Z=function(H,L){var M=H,D;if(C(_,M)&&(D=_[M],M="%"+D[0]+"%"),C(y,M)){var B=y[M];if(B===b&&(B=m(M)),typeof B>"u"&&!L)throw new a("intrinsic "+H+" exists, but is not available. Please file an issue!");return{alias:D,name:M,value:B}}throw new o("intrinsic "+H+" does not exist!")};return yg=function(H,L){if(typeof H!="string"||H.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof L!="boolean")throw new a('"allowMissing" argument must be a boolean');if(T(/^%?[^%]*%?$/,H)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var M=G(H),D=M.length>0?M[0]:"",B=Z("%"+D+"%",L),V=B.name,Y=B.value,F=!1,$=B.alias;$&&(D=$[0],S(M,R([0,1],$)));for(var z=1,K=!0;z<M.length;z+=1){var X=M[z],Q=P(X,0,1),J=P(X,-1);if((Q==='"'||Q==="'"||Q==="`"||J==='"'||J==="'"||J==="`")&&Q!==J)throw new o("property names with quotes must have matching quotes");if((X==="constructor"||!K)&&(F=!0),D+="."+X,V="%"+D+"%",C(y,V))Y=y[V];else if(Y!=null){if(!(X in Y)){if(!L)throw new a("base intrinsic for "+H+" exists, but the property is not available.");return}if(h&&z+1>=M.length){var ne=h(Y,X);K=!!ne,K&&"get"in ne&&!("originalValue"in ne.get)?Y=ne.get:Y=Y[X]}else K=C(Y,X),Y=Y[X];K&&!F&&(y[V]=Y)}}return Y},yg}var bg={exports:{}},_g,X4;function m2(){if(X4)return _g;X4=1;var t=lu(),e=t("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return _g=e,_g}var wg,Z4;function sS(){if(Z4)return wg;Z4=1;var t=lu(),e=t("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return wg=e,wg}var Sg,Q4;function UD(){if(Q4)return Sg;Q4=1;var t=m2(),e=lS(),n=nf(),r=sS();return Sg=function(o,a,l){if(!o||typeof o!="object"&&typeof o!="function")throw new n("`obj` must be an object or a function`");if(typeof a!="string"&&typeof a!="symbol")throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new n("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,h=arguments.length>5?arguments[5]:null,x=arguments.length>6?arguments[6]:!1,w=!!r&&r(o,a);if(t)t(o,a,{configurable:h===null&&w?w.configurable:!h,enumerable:s===null&&w?w.enumerable:!s,value:l,writable:f===null&&w?w.writable:!f});else if(x||!s&&!f&&!h)o[a]=l;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Sg}var Eg,J4;function HD(){if(J4)return Eg;J4=1;var t=m2(),e=function(){return!!t};return e.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},Eg=e,Eg}var Og,e_;function $D(){if(e_)return Og;e_=1;var t=lu(),e=UD(),n=HD()(),r=sS(),i=nf(),o=t("%Math.floor%");return Og=function(l,s){if(typeof l!="function")throw new i("`fn` is not a function");if(typeof s!="number"||s<0||s>4294967295||o(s)!==s)throw new i("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],h=!0,x=!0;if("length"in l&&r){var w=r(l,"length");w&&!w.configurable&&(h=!1),w&&!w.writable&&(x=!1)}return(h||x||!f)&&(n?e(l,"length",s,!0,!0):e(l,"length",s)),l},Og}var t_;function GD(){return t_||(t_=1,function(t){var e=v2(),n=lu(),r=$D(),i=nf(),o=n("%Function.prototype.apply%"),a=n("%Function.prototype.call%"),l=n("%Reflect.apply%",!0)||e.call(a,o),s=m2(),f=n("%Math.max%");t.exports=function(w){if(typeof w!="function")throw new i("a function is required");var v=l(e,a,arguments);return r(v,1+f(0,w.length-(arguments.length-1)),!0)};var h=function(){return l(e,o,arguments)};s?s(t.exports,"apply",{value:h}):t.exports.apply=h}(bg)),bg.exports}var xg,n_;function VD(){if(n_)return xg;n_=1;var t=lu(),e=GD(),n=e(t("String.prototype.indexOf"));return xg=function(i,o){var a=t(i,!!o);return typeof a=="function"&&n(i,".prototype.")>-1?e(a):a},xg}const qD={},WD=Object.freeze(Object.defineProperty({__proto__:null,default:qD},Symbol.toStringTag,{value:"Module"})),YD=_a(WD);var Pg,r_;function KD(){if(r_)return Pg;r_=1;var t=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&t?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,n=t&&e&&typeof e.get=="function"?e.get:null,r=t&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,o=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,a=i&&o&&typeof o.get=="function"?o.get:null,l=i&&Set.prototype.forEach,s=typeof WeakMap=="function"&&WeakMap.prototype,f=s?WeakMap.prototype.has:null,h=typeof WeakSet=="function"&&WeakSet.prototype,x=h?WeakSet.prototype.has:null,w=typeof WeakRef=="function"&&WeakRef.prototype,v=w?WeakRef.prototype.deref:null,O=Boolean.prototype.valueOf,g=Object.prototype.toString,b=Function.prototype.toString,p=String.prototype.match,y=String.prototype.slice,d=String.prototype.replace,m=String.prototype.toUpperCase,_=String.prototype.toLowerCase,A=RegExp.prototype.test,C=Array.prototype.concat,R=Array.prototype.join,S=Array.prototype.slice,E=Math.floor,P=typeof BigInt=="function"?BigInt.prototype.valueOf:null,T=Object.getOwnPropertySymbols,N=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,U=typeof Symbol=="function"&&typeof Symbol.iterator=="object",G=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===U||!0)?Symbol.toStringTag:null,Z=Object.prototype.propertyIsEnumerable,W=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(ue){return ue.__proto__}:null);function H(ue,ce){if(ue===1/0||ue===-1/0||ue!==ue||ue&&ue>-1e3&&ue<1e3||A.call(/e/,ce))return ce;var Se=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof ue=="number"){var Le=ue<0?-E(-ue):E(ue);if(Le!==ue){var Ne=String(Le),ge=y.call(ce,Ne.length+1);return d.call(Ne,Se,"$&_")+"."+d.call(d.call(ge,/([0-9]{3})/g,"$&_"),/_$/,"")}}return d.call(ce,Se,"$&_")}var L=YD,M=L.custom,D=ie(M)?M:null,B={__proto__:null,double:'"',single:"'"},V={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Pg=function ue(ce,Se,Le,Ne){var ge=Se||{};if(me(ge,"quoteStyle")&&!me(B,ge.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(me(ge,"maxStringLength")&&(typeof ge.maxStringLength=="number"?ge.maxStringLength<0&&ge.maxStringLength!==1/0:ge.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Xe=me(ge,"customInspect")?ge.customInspect:!0;if(typeof Xe!="boolean"&&Xe!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(me(ge,"indent")&&ge.indent!==null&&ge.indent!==" "&&!(parseInt(ge.indent,10)===ge.indent&&ge.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(me(ge,"numericSeparator")&&typeof ge.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Oe=ge.numericSeparator;if(typeof ce>"u")return"undefined";if(ce===null)return"null";if(typeof ce=="boolean")return ce?"true":"false";if(typeof ce=="string")return Ve(ce,ge);if(typeof ce=="number"){if(ce===0)return 1/0/ce>0?"0":"-0";var $e=String(ce);return Oe?H(ce,$e):$e}if(typeof ce=="bigint"){var Wt=String(ce)+"n";return Oe?H(ce,Wt):Wt}var Tt=typeof ge.depth>"u"?5:ge.depth;if(typeof Le>"u"&&(Le=0),Le>=Tt&&Tt>0&&typeof ce=="object")return $(ce)?"[Array]":"[Object]";var Yt=We(ge,Le);if(typeof Ne>"u")Ne=[];else if(ae(Ne,ce)>=0)return"[Circular]";function ke(xn,tn,ri){if(tn&&(Ne=S.call(Ne),Ne.push(tn)),ri){var Sr={depth:ge.depth};return me(ge,"quoteStyle")&&(Sr.quoteStyle=ge.quoteStyle),ue(xn,Sr,Le+1,Ne)}return ue(xn,ge,Le+1,Ne)}if(typeof ce=="function"&&!K(ce)){var Ye=re(ce),at=mt(ce,ke);return"[Function"+(Ye?": "+Ye:" (anonymous)")+"]"+(at.length>0?" { "+R.call(at,", ")+" }":"")}if(ie(ce)){var Ot=U?d.call(String(ce),/^(Symbol\(.*\))_[^)]*$/,"$1"):N.call(ce);return typeof ce=="object"&&!U?Ae(Ot):Ot}if(Ee(ce)){for(var xt="<"+_.call(String(ce.nodeName)),un=ce.attributes||[],hn=0;hn<un.length;hn++)xt+=" "+un[hn].name+"="+Y(F(un[hn].value),"double",ge);return xt+=">",ce.childNodes&&ce.childNodes.length&&(xt+="..."),xt+="</"+_.call(String(ce.nodeName))+">",xt}if($(ce)){if(ce.length===0)return"[]";var pn=mt(ce,ke);return Yt&&!ze(pn)?"["+St(pn,Yt)+"]":"[ "+R.call(pn,", ")+" ]"}if(X(ce)){var rr=mt(ce,ke);return!("cause"in Error.prototype)&&"cause"in ce&&!Z.call(ce,"cause")?"{ ["+String(ce)+"] "+R.call(C.call("[cause]: "+ke(ce.cause),rr),", ")+" }":rr.length===0?"["+String(ce)+"]":"{ ["+String(ce)+"] "+R.call(rr,", ")+" }"}if(typeof ce=="object"&&Xe){if(D&&typeof ce[D]=="function"&&L)return L(ce,{depth:Tt-Le});if(Xe!=="symbol"&&typeof ce.inspect=="function")return ce.inspect()}if(we(ce)){var to=[];return r&&r.call(ce,function(xn,tn){to.push(ke(tn,ce,!0)+" => "+ke(xn,ce))}),Me("Map",n.call(ce),to,Yt)}if(fe(ce)){var wr=[];return l&&l.call(ce,function(xn){wr.push(ke(xn,ce))}),Me("Set",a.call(ce),wr,Yt)}if(be(ce))return Ce("WeakMap");if(de(ce))return Ce("WeakSet");if(te(ce))return Ce("WeakRef");if(J(ce))return Ae(ke(Number(ce)));if(oe(ce))return Ae(ke(P.call(ce)));if(ne(ce))return Ae(O.call(ce));if(Q(ce))return Ae(ke(String(ce)));if(typeof window<"u"&&ce===window)return"{ [object Window] }";if(typeof globalThis<"u"&&ce===globalThis||typeof _e<"u"&&ce===_e)return"{ [object globalThis] }";if(!z(ce)&&!K(ce)){var Ie=mt(ce,ke),et=W?W(ce)===Object.prototype:ce instanceof Object||ce.constructor===Object,ft=ce instanceof Object?"":"null prototype",Ft=!et&&G&&Object(ce)===ce&&G in ce?y.call(Pe(ce),8,-1):ft?"Object":"",Pt=et||typeof ce.constructor!="function"?"":ce.constructor.name?ce.constructor.name+" ":"",Bn=Pt+(Ft||ft?"["+R.call(C.call([],Ft||[],ft||[]),": ")+"] ":"");return Ie.length===0?Bn+"{}":Yt?Bn+"{"+St(Ie,Yt)+"}":Bn+"{ "+R.call(Ie,", ")+" }"}return String(ce)};function Y(ue,ce,Se){var Le=Se.quoteStyle||ce,Ne=B[Le];return Ne+ue+Ne}function F(ue){return d.call(String(ue),/"/g,""")}function $(ue){return Pe(ue)==="[object Array]"&&(!G||!(typeof ue=="object"&&G in ue))}function z(ue){return Pe(ue)==="[object Date]"&&(!G||!(typeof ue=="object"&&G in ue))}function K(ue){return Pe(ue)==="[object RegExp]"&&(!G||!(typeof ue=="object"&&G in ue))}function X(ue){return Pe(ue)==="[object Error]"&&(!G||!(typeof ue=="object"&&G in ue))}function Q(ue){return Pe(ue)==="[object String]"&&(!G||!(typeof ue=="object"&&G in ue))}function J(ue){return Pe(ue)==="[object Number]"&&(!G||!(typeof ue=="object"&&G in ue))}function ne(ue){return Pe(ue)==="[object Boolean]"&&(!G||!(typeof ue=="object"&&G in ue))}function ie(ue){if(U)return ue&&typeof ue=="object"&&ue instanceof Symbol;if(typeof ue=="symbol")return!0;if(!ue||typeof ue!="object"||!N)return!1;try{return N.call(ue),!0}catch{}return!1}function oe(ue){if(!ue||typeof ue!="object"||!P)return!1;try{return P.call(ue),!0}catch{}return!1}var he=Object.prototype.hasOwnProperty||function(ue){return ue in this};function me(ue,ce){return he.call(ue,ce)}function Pe(ue){return g.call(ue)}function re(ue){if(ue.name)return ue.name;var ce=p.call(b.call(ue),/^function\s*([\w$]+)/);return ce?ce[1]:null}function ae(ue,ce){if(ue.indexOf)return ue.indexOf(ce);for(var Se=0,Le=ue.length;Se<Le;Se++)if(ue[Se]===ce)return Se;return-1}function we(ue){if(!n||!ue||typeof ue!="object")return!1;try{n.call(ue);try{a.call(ue)}catch{return!0}return ue instanceof Map}catch{}return!1}function be(ue){if(!f||!ue||typeof ue!="object")return!1;try{f.call(ue,f);try{x.call(ue,x)}catch{return!0}return ue instanceof WeakMap}catch{}return!1}function te(ue){if(!v||!ue||typeof ue!="object")return!1;try{return v.call(ue),!0}catch{}return!1}function fe(ue){if(!a||!ue||typeof ue!="object")return!1;try{a.call(ue);try{n.call(ue)}catch{return!0}return ue instanceof Set}catch{}return!1}function de(ue){if(!x||!ue||typeof ue!="object")return!1;try{x.call(ue,x);try{f.call(ue,f)}catch{return!0}return ue instanceof WeakSet}catch{}return!1}function Ee(ue){return!ue||typeof ue!="object"?!1:typeof HTMLElement<"u"&&ue instanceof HTMLElement?!0:typeof ue.nodeName=="string"&&typeof ue.getAttribute=="function"}function Ve(ue,ce){if(ue.length>ce.maxStringLength){var Se=ue.length-ce.maxStringLength,Le="... "+Se+" more character"+(Se>1?"s":"");return Ve(y.call(ue,0,ce.maxStringLength),ce)+Le}var Ne=V[ce.quoteStyle||"single"];Ne.lastIndex=0;var ge=d.call(d.call(ue,Ne,"\\$1"),/[\x00-\x1f]/g,Je);return Y(ge,"single",ce)}function Je(ue){var ce=ue.charCodeAt(0),Se={8:"b",9:"t",10:"n",12:"f",13:"r"}[ce];return Se?"\\"+Se:"\\x"+(ce<16?"0":"")+m.call(ce.toString(16))}function Ae(ue){return"Object("+ue+")"}function Ce(ue){return ue+" { ? }"}function Me(ue,ce,Se,Le){var Ne=Le?St(Se,Le):R.call(Se,", ");return ue+" ("+ce+") {"+Ne+"}"}function ze(ue){for(var ce=0;ce<ue.length;ce++)if(ae(ue[ce],`
|
|
148
|
+
`)}return ae}function me(re,ae){var we={},be=re.style||{};return be.fontStyle&&Y(re).fontStyle==="italic"&&(we.italic=!0),be.fontWeight&&(Y(re).fontWeight.startsWith("bold")||parseInt(Y(re).fontWeight)>=700)&&(we.bold=!0),Object.keys(we).length>0&&(ae=V(ae,we)),parseFloat(be.textIndent||0)>0&&(ae=new x.default().insert(" ").concat(ae)),ae}function Pe(re,ae){var we=re.data;if(re.parentNode.tagName==="O:P")return ae.insert(we.trim());if(we.trim().length===0&&re.parentNode.classList.contains("ql-clipboard"))return ae;if(!Y(re.parentNode).whiteSpace.startsWith("pre")){var be=function(fe,he){return he=he.replace(/[^\u00a0]/g,""),he.length<1&&fe?" ":he};we=we.replace(/\r\n/g," ").replace(/\n/g," "),we=we.replace(/\s\s+/g,be.bind(be,!0)),(re.previousSibling==null&&$(re.parentNode)||re.previousSibling!=null&&$(re.previousSibling))&&(we=we.replace(/^\s+/,be.bind(be,!1))),(re.nextSibling==null&&$(re.parentNode)||re.nextSibling!=null&&$(re.nextSibling))&&(we=we.replace(/\s+$/,be.bind(be,!1)))}return ae.insert(we)}r.default=B,r.matchAttributor=X,r.matchBlot=Q,r.matchNewline=oe,r.matchSpacing=de,r.matchText=Pe},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function O(g,b){for(var p=0;p<b.length;p++){var y=b[p];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(g,y.key,y)}}return function(g,b,p){return b&&O(g.prototype,b),p&&O(g,p),g}}(),a=function O(g,b,p){g===null&&(g=Function.prototype);var y=Object.getOwnPropertyDescriptor(g,b);if(y===void 0){var d=Object.getPrototypeOf(g);return d===null?void 0:O(d,b,p)}else{if("value"in y)return y.value;var m=y.get;return m===void 0?void 0:m.call(p)}},l=i(6),s=f(l);function f(O){return O&&O.__esModule?O:{default:O}}function h(O,g){if(!(O instanceof g))throw new TypeError("Cannot call a class as a function")}function x(O,g){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:O}function w(O,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);O.prototype=Object.create(g&&g.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(O,g):O.__proto__=g)}var v=function(O){w(g,O);function g(){return h(this,g),x(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return o(g,[{key:"optimize",value:function(p){a(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"optimize",this).call(this,p),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return a(g.__proto__||Object.getPrototypeOf(g),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),g}(s.default);v.blotName="bold",v.tagName=["STRONG","B"],r.default=v},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.addControls=r.default=void 0;var o=function(){function P(T,N){var U=[],G=!0,Z=!1,W=void 0;try{for(var H=T[Symbol.iterator](),L;!(G=(L=H.next()).done)&&(U.push(L.value),!(N&&U.length===N));G=!0);}catch(M){Z=!0,W=M}finally{try{!G&&H.return&&H.return()}finally{if(Z)throw W}}return U}return function(T,N){if(Array.isArray(T))return T;if(Symbol.iterator in Object(T))return P(T,N);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function P(T,N){for(var U=0;U<N.length;U++){var G=N[U];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(T,G.key,G)}}return function(T,N,U){return N&&P(T.prototype,N),U&&P(T,U),T}}(),l=i(2),s=p(l),f=i(0),h=p(f),x=i(5),w=p(x),v=i(10),O=p(v),g=i(9),b=p(g);function p(P){return P&&P.__esModule?P:{default:P}}function y(P,T,N){return T in P?Object.defineProperty(P,T,{value:N,enumerable:!0,configurable:!0,writable:!0}):P[T]=N,P}function d(P,T){if(!(P instanceof T))throw new TypeError("Cannot call a class as a function")}function m(P,T){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:P}function _(P,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);P.prototype=Object.create(T&&T.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(P,T):P.__proto__=T)}var A=(0,O.default)("quill:toolbar"),C=function(P){_(T,P);function T(N,U){d(this,T);var G=m(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,N,U));if(Array.isArray(G.options.container)){var Z=document.createElement("div");S(Z,G.options.container),N.container.parentNode.insertBefore(Z,N.container),G.container=Z}else typeof G.options.container=="string"?G.container=document.querySelector(G.options.container):G.container=G.options.container;if(!(G.container instanceof HTMLElement)){var W;return W=A.error("Container required for toolbar",G.options),m(G,W)}return G.container.classList.add("ql-toolbar"),G.controls=[],G.handlers={},Object.keys(G.options.handlers).forEach(function(H){G.addHandler(H,G.options.handlers[H])}),[].forEach.call(G.container.querySelectorAll("button, select"),function(H){G.attach(H)}),G.quill.on(w.default.events.EDITOR_CHANGE,function(H,L){H===w.default.events.SELECTION_CHANGE&&G.update(L)}),G.quill.on(w.default.events.SCROLL_OPTIMIZE,function(){var H=G.quill.selection.getRange(),L=o(H,1),M=L[0];G.update(M)}),G}return a(T,[{key:"addHandler",value:function(U,G){this.handlers[U]=G}},{key:"attach",value:function(U){var G=this,Z=[].find.call(U.classList,function(H){return H.indexOf("ql-")===0});if(Z){if(Z=Z.slice(3),U.tagName==="BUTTON"&&U.setAttribute("type","button"),this.handlers[Z]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[Z]==null){A.warn("ignoring attaching to disabled format",Z,U);return}if(h.default.query(Z)==null){A.warn("ignoring attaching to nonexistent format",Z,U);return}}var W=U.tagName==="SELECT"?"change":"click";U.addEventListener(W,function(H){var L=void 0;if(U.tagName==="SELECT"){if(U.selectedIndex<0)return;var M=U.options[U.selectedIndex];M.hasAttribute("selected")?L=!1:L=M.value||!1}else U.classList.contains("ql-active")?L=!1:L=U.value||!U.hasAttribute("value"),H.preventDefault();G.quill.focus();var D=G.quill.selection.getRange(),B=o(D,1),V=B[0];if(G.handlers[Z]!=null)G.handlers[Z].call(G,L);else if(h.default.query(Z).prototype instanceof h.default.Embed){if(L=prompt("Enter "+Z),!L)return;G.quill.updateContents(new s.default().retain(V.index).delete(V.length).insert(y({},Z,L)),w.default.sources.USER)}else G.quill.format(Z,L,w.default.sources.USER);G.update(V)}),this.controls.push([Z,U])}}},{key:"update",value:function(U){var G=U==null?{}:this.quill.getFormat(U);this.controls.forEach(function(Z){var W=o(Z,2),H=W[0],L=W[1];if(L.tagName==="SELECT"){var M=void 0;if(U==null)M=null;else if(G[H]==null)M=L.querySelector("option[selected]");else if(!Array.isArray(G[H])){var D=G[H];typeof D=="string"&&(D=D.replace(/\"/g,'\\"')),M=L.querySelector('option[value="'+D+'"]')}M==null?(L.value="",L.selectedIndex=-1):M.selected=!0}else if(U==null)L.classList.remove("ql-active");else if(L.hasAttribute("value")){var B=G[H]===L.getAttribute("value")||G[H]!=null&&G[H].toString()===L.getAttribute("value")||G[H]==null&&!L.getAttribute("value");L.classList.toggle("ql-active",B)}else L.classList.toggle("ql-active",G[H]!=null)})}}]),T}(b.default);C.DEFAULTS={};function R(P,T,N){var U=document.createElement("button");U.setAttribute("type","button"),U.classList.add("ql-"+T),N!=null&&(U.value=N),P.appendChild(U)}function S(P,T){Array.isArray(T[0])||(T=[T]),T.forEach(function(N){var U=document.createElement("span");U.classList.add("ql-formats"),N.forEach(function(G){if(typeof G=="string")R(U,G);else{var Z=Object.keys(G)[0],W=G[Z];Array.isArray(W)?E(U,Z,W):R(U,Z,W)}}),P.appendChild(U)})}function E(P,T,N){var U=document.createElement("select");U.classList.add("ql-"+T),N.forEach(function(G){var Z=document.createElement("option");G!==!1?Z.setAttribute("value",G):Z.setAttribute("selected","selected"),U.appendChild(Z)}),P.appendChild(U)}C.DEFAULTS={container:null,handlers:{clean:function(){var T=this,N=this.quill.getSelection();if(N!=null)if(N.length==0){var U=this.quill.getFormat();Object.keys(U).forEach(function(G){h.default.query(G,h.default.Scope.INLINE)!=null&&T.quill.format(G,!1)})}else this.quill.removeFormat(N,w.default.sources.USER)},direction:function(T){var N=this.quill.getFormat().align;T==="rtl"&&N==null?this.quill.format("align","right",w.default.sources.USER):!T&&N==="right"&&this.quill.format("align",!1,w.default.sources.USER),this.quill.format("direction",T,w.default.sources.USER)},indent:function(T){var N=this.quill.getSelection(),U=this.quill.getFormat(N),G=parseInt(U.indent||0);if(T==="+1"||T==="-1"){var Z=T==="+1"?1:-1;U.direction==="rtl"&&(Z*=-1),this.quill.format("indent",G+Z,w.default.sources.USER)}},link:function(T){T===!0&&(T=prompt("Enter link URL:")),this.quill.format("link",T,w.default.sources.USER)},list:function(T){var N=this.quill.getSelection(),U=this.quill.getFormat(N);T==="check"?U.list==="checked"||U.list==="unchecked"?this.quill.format("list",!1,w.default.sources.USER):this.quill.format("list","unchecked",w.default.sources.USER):this.quill.format("list",T,w.default.sources.USER)}}},r.default=C,r.addControls=S},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function O(g,b){for(var p=0;p<b.length;p++){var y=b[p];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(g,y.key,y)}}return function(g,b,p){return b&&O(g.prototype,b),p&&O(g,p),g}}(),a=function O(g,b,p){g===null&&(g=Function.prototype);var y=Object.getOwnPropertyDescriptor(g,b);if(y===void 0){var d=Object.getPrototypeOf(g);return d===null?void 0:O(d,b,p)}else{if("value"in y)return y.value;var m=y.get;return m===void 0?void 0:m.call(p)}},l=i(28),s=f(l);function f(O){return O&&O.__esModule?O:{default:O}}function h(O,g){if(!(O instanceof g))throw new TypeError("Cannot call a class as a function")}function x(O,g){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:O}function w(O,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);O.prototype=Object.create(g&&g.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(O,g):O.__proto__=g)}var v=function(O){w(g,O);function g(b,p){h(this,g);var y=x(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,b));return y.label.innerHTML=p,y.container.classList.add("ql-color-picker"),[].slice.call(y.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(d){d.classList.add("ql-primary")}),y}return o(g,[{key:"buildItem",value:function(p){var y=a(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"buildItem",this).call(this,p);return y.style.backgroundColor=p.getAttribute("value")||"",y}},{key:"selectItem",value:function(p,y){a(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"selectItem",this).call(this,p,y);var d=this.label.querySelector(".ql-color-label"),m=p&&p.getAttribute("data-value")||"";d&&(d.tagName==="line"?d.style.stroke=m:d.style.fill=m)}}]),g}(s.default);r.default=v},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function O(g,b){for(var p=0;p<b.length;p++){var y=b[p];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(g,y.key,y)}}return function(g,b,p){return b&&O(g.prototype,b),p&&O(g,p),g}}(),a=function O(g,b,p){g===null&&(g=Function.prototype);var y=Object.getOwnPropertyDescriptor(g,b);if(y===void 0){var d=Object.getPrototypeOf(g);return d===null?void 0:O(d,b,p)}else{if("value"in y)return y.value;var m=y.get;return m===void 0?void 0:m.call(p)}},l=i(28),s=f(l);function f(O){return O&&O.__esModule?O:{default:O}}function h(O,g){if(!(O instanceof g))throw new TypeError("Cannot call a class as a function")}function x(O,g){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:O}function w(O,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);O.prototype=Object.create(g&&g.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(O,g):O.__proto__=g)}var v=function(O){w(g,O);function g(b,p){h(this,g);var y=x(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,b));return y.container.classList.add("ql-icon-picker"),[].forEach.call(y.container.querySelectorAll(".ql-picker-item"),function(d){d.innerHTML=p[d.getAttribute("data-value")||""]}),y.defaultItem=y.container.querySelector(".ql-selected"),y.selectItem(y.defaultItem),y}return o(g,[{key:"selectItem",value:function(p,y){a(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"selectItem",this).call(this,p,y),p=p||this.defaultItem,this.label.innerHTML=p.innerHTML}}]),g}(s.default);r.default=v},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function s(f,h){for(var x=0;x<h.length;x++){var w=h[x];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(f,w.key,w)}}return function(f,h,x){return h&&s(f.prototype,h),x&&s(f,x),f}}();function a(s,f){if(!(s instanceof f))throw new TypeError("Cannot call a class as a function")}var l=function(){function s(f,h){var x=this;a(this,s),this.quill=f,this.boundsContainer=h||document.body,this.root=f.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){x.root.style.marginTop=-1*x.quill.root.scrollTop+"px"}),this.hide()}return o(s,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(h){var x=h.left+h.width/2-this.root.offsetWidth/2,w=h.bottom+this.quill.root.scrollTop;this.root.style.left=x+"px",this.root.style.top=w+"px",this.root.classList.remove("ql-flip");var v=this.boundsContainer.getBoundingClientRect(),O=this.root.getBoundingClientRect(),g=0;if(O.right>v.right&&(g=v.right-O.right,this.root.style.left=x+g+"px"),O.left<v.left&&(g=v.left-O.left,this.root.style.left=x+g+"px"),O.bottom>v.bottom){var b=O.bottom-O.top,p=h.bottom-h.top+b;this.root.style.top=w-p+"px",this.root.classList.add("ql-flip")}return g}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),s}();r.default=l},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function E(P,T){var N=[],U=!0,G=!1,Z=void 0;try{for(var W=P[Symbol.iterator](),H;!(U=(H=W.next()).done)&&(N.push(H.value),!(T&&N.length===T));U=!0);}catch(L){G=!0,Z=L}finally{try{!U&&W.return&&W.return()}finally{if(G)throw Z}}return N}return function(P,T){if(Array.isArray(P))return P;if(Symbol.iterator in Object(P))return E(P,T);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function E(P,T,N){P===null&&(P=Function.prototype);var U=Object.getOwnPropertyDescriptor(P,T);if(U===void 0){var G=Object.getPrototypeOf(P);return G===null?void 0:E(G,T,N)}else{if("value"in U)return U.value;var Z=U.get;return Z===void 0?void 0:Z.call(N)}},l=function(){function E(P,T){for(var N=0;N<T.length;N++){var U=T[N];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(P,U.key,U)}}return function(P,T,N){return T&&E(P.prototype,T),N&&E(P,N),P}}(),s=i(3),f=d(s),h=i(8),x=d(h),w=i(43),v=d(w),O=i(27),g=d(O),b=i(15),p=i(41),y=d(p);function d(E){return E&&E.__esModule?E:{default:E}}function m(E,P){if(!(E instanceof P))throw new TypeError("Cannot call a class as a function")}function _(E,P){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:E}function A(E,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);E.prototype=Object.create(P&&P.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(E,P):E.__proto__=P)}var C=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],R=function(E){A(P,E);function P(T,N){m(this,P),N.modules.toolbar!=null&&N.modules.toolbar.container==null&&(N.modules.toolbar.container=C);var U=_(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,T,N));return U.quill.container.classList.add("ql-snow"),U}return l(P,[{key:"extendToolbar",value:function(N){N.container.classList.add("ql-snow"),this.buildButtons([].slice.call(N.container.querySelectorAll("button")),y.default),this.buildPickers([].slice.call(N.container.querySelectorAll("select")),y.default),this.tooltip=new S(this.quill,this.options.bounds),N.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(U,G){N.handlers.link.call(N,!G.format.link)})}}]),P}(v.default);R.DEFAULTS=(0,f.default)(!0,{},v.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(P){if(P){var T=this.quill.getSelection();if(T==null||T.length==0)return;var N=this.quill.getText(T);/^\S+@\S+\.\S+$/.test(N)&&N.indexOf("mailto:")!==0&&(N="mailto:"+N);var U=this.quill.theme.tooltip;U.edit("link",N)}else this.quill.format("link",!1)}}}}});var S=function(E){A(P,E);function P(T,N){m(this,P);var U=_(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,T,N));return U.preview=U.root.querySelector("a.ql-preview"),U}return l(P,[{key:"listen",value:function(){var N=this;a(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(U){N.root.classList.contains("ql-editing")?N.save():N.edit("link",N.preview.textContent),U.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(U){if(N.linkRange!=null){var G=N.linkRange;N.restoreFocus(),N.quill.formatText(G,"link",!1,x.default.sources.USER),delete N.linkRange}U.preventDefault(),N.hide()}),this.quill.on(x.default.events.SELECTION_CHANGE,function(U,G,Z){if(U!=null){if(U.length===0&&Z===x.default.sources.USER){var W=N.quill.scroll.descendant(g.default,U.index),H=o(W,2),L=H[0],M=H[1];if(L!=null){N.linkRange=new b.Range(U.index-M,L.length());var D=g.default.formats(L.domNode);N.preview.textContent=D,N.preview.setAttribute("href",D),N.show(),N.position(N.quill.getBounds(N.linkRange));return}}else delete N.linkRange;N.hide()}})}},{key:"show",value:function(){a(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),P}(w.BaseTooltip);S.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),r.default=R},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(29),a=te(o),l=i(36),s=i(38),f=i(64),h=i(65),x=te(h),w=i(66),v=te(w),O=i(67),g=te(O),b=i(37),p=i(26),y=i(39),d=i(40),m=i(56),_=te(m),A=i(68),C=te(A),R=i(27),S=te(R),E=i(69),P=te(E),T=i(70),N=te(T),U=i(71),G=te(U),Z=i(72),W=te(Z),H=i(73),L=te(H),M=i(13),D=te(M),B=i(74),V=te(B),Y=i(75),F=te(Y),$=i(57),z=te($),K=i(41),X=te(K),Q=i(28),J=te(Q),ne=i(59),ie=te(ne),oe=i(60),de=te(oe),me=i(61),Pe=te(me),re=i(108),ae=te(re),we=i(62),be=te(we);function te(fe){return fe&&fe.__esModule?fe:{default:fe}}a.default.register({"attributors/attribute/direction":s.DirectionAttribute,"attributors/class/align":l.AlignClass,"attributors/class/background":b.BackgroundClass,"attributors/class/color":p.ColorClass,"attributors/class/direction":s.DirectionClass,"attributors/class/font":y.FontClass,"attributors/class/size":d.SizeClass,"attributors/style/align":l.AlignStyle,"attributors/style/background":b.BackgroundStyle,"attributors/style/color":p.ColorStyle,"attributors/style/direction":s.DirectionStyle,"attributors/style/font":y.FontStyle,"attributors/style/size":d.SizeStyle},!0),a.default.register({"formats/align":l.AlignClass,"formats/direction":s.DirectionClass,"formats/indent":f.IndentClass,"formats/background":b.BackgroundStyle,"formats/color":p.ColorStyle,"formats/font":y.FontClass,"formats/size":d.SizeClass,"formats/blockquote":x.default,"formats/code-block":D.default,"formats/header":v.default,"formats/list":g.default,"formats/bold":_.default,"formats/code":M.Code,"formats/italic":C.default,"formats/link":S.default,"formats/script":P.default,"formats/strike":N.default,"formats/underline":G.default,"formats/image":W.default,"formats/video":L.default,"formats/list/item":O.ListItem,"modules/formula":V.default,"modules/syntax":F.default,"modules/toolbar":z.default,"themes/bubble":ae.default,"themes/snow":be.default,"ui/icons":X.default,"ui/picker":J.default,"ui/icon-picker":de.default,"ui/color-picker":ie.default,"ui/tooltip":Pe.default},!0),r.default=a.default},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.IndentClass=void 0;var o=function(){function g(b,p){for(var y=0;y<p.length;y++){var d=p[y];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(b,d.key,d)}}return function(b,p,y){return p&&g(b.prototype,p),y&&g(b,y),b}}(),a=function g(b,p,y){b===null&&(b=Function.prototype);var d=Object.getOwnPropertyDescriptor(b,p);if(d===void 0){var m=Object.getPrototypeOf(b);return m===null?void 0:g(m,p,y)}else{if("value"in d)return d.value;var _=d.get;return _===void 0?void 0:_.call(y)}},l=i(0),s=f(l);function f(g){return g&&g.__esModule?g:{default:g}}function h(g,b){if(!(g instanceof b))throw new TypeError("Cannot call a class as a function")}function x(g,b){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:g}function w(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(g,b):g.__proto__=b)}var v=function(g){w(b,g);function b(){return h(this,b),x(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return o(b,[{key:"add",value:function(y,d){if(d==="+1"||d==="-1"){var m=this.value(y)||0;d=d==="+1"?m+1:m-1}return d===0?(this.remove(y),!0):a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"add",this).call(this,y,d)}},{key:"canAdd",value:function(y,d){return a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"canAdd",this).call(this,y,d)||a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"canAdd",this).call(this,y,parseInt(d))}},{key:"value",value:function(y){return parseInt(a(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"value",this).call(this,y))||void 0}}]),b}(s.default.Attributor.Class),O=new v("indent","ql-indent",{scope:s.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});r.IndentClass=O},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(4),a=l(o);function l(w){return w&&w.__esModule?w:{default:w}}function s(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function f(w,v){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:w}function h(w,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);w.prototype=Object.create(v&&v.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(w,v):w.__proto__=v)}var x=function(w){h(v,w);function v(){return s(this,v),f(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return v}(a.default);x.blotName="blockquote",x.tagName="blockquote",r.default=x},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function v(O,g){for(var b=0;b<g.length;b++){var p=g[b];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(O,p.key,p)}}return function(O,g,b){return g&&v(O.prototype,g),b&&v(O,b),O}}(),a=i(4),l=s(a);function s(v){return v&&v.__esModule?v:{default:v}}function f(v,O){if(!(v instanceof O))throw new TypeError("Cannot call a class as a function")}function h(v,O){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:v}function x(v,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);v.prototype=Object.create(O&&O.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(v,O):v.__proto__=O)}var w=function(v){x(O,v);function O(){return f(this,O),h(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return o(O,null,[{key:"formats",value:function(b){return this.tagName.indexOf(b.tagName)+1}}]),O}(l.default);w.blotName="header",w.tagName=["H1","H2","H3","H4","H5","H6"],r.default=w},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.ListItem=void 0;var o=function(){function m(_,A){for(var C=0;C<A.length;C++){var R=A[C];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(_,R.key,R)}}return function(_,A,C){return A&&m(_.prototype,A),C&&m(_,C),_}}(),a=function m(_,A,C){_===null&&(_=Function.prototype);var R=Object.getOwnPropertyDescriptor(_,A);if(R===void 0){var S=Object.getPrototypeOf(_);return S===null?void 0:m(S,A,C)}else{if("value"in R)return R.value;var E=R.get;return E===void 0?void 0:E.call(C)}},l=i(0),s=v(l),f=i(4),h=v(f),x=i(25),w=v(x);function v(m){return m&&m.__esModule?m:{default:m}}function O(m,_,A){return _ in m?Object.defineProperty(m,_,{value:A,enumerable:!0,configurable:!0,writable:!0}):m[_]=A,m}function g(m,_){if(!(m instanceof _))throw new TypeError("Cannot call a class as a function")}function b(m,_){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:m}function p(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(m,_):m.__proto__=_)}var y=function(m){p(_,m);function _(){return g(this,_),b(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return o(_,[{key:"format",value:function(C,R){C===d.blotName&&!R?this.replaceWith(s.default.create(this.statics.scope)):a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"format",this).call(this,C,R)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(C,R){return this.parent.isolate(this.offset(this.parent),this.length()),C===this.parent.statics.blotName?(this.parent.replaceWith(C,R),this):(this.parent.unwrap(),a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"replaceWith",this).call(this,C,R))}}],[{key:"formats",value:function(C){return C.tagName===this.tagName?void 0:a(_.__proto__||Object.getPrototypeOf(_),"formats",this).call(this,C)}}]),_}(h.default);y.blotName="list-item",y.tagName="LI";var d=function(m){p(_,m),o(_,null,[{key:"create",value:function(C){var R=C==="ordered"?"OL":"UL",S=a(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this,R);return(C==="checked"||C==="unchecked")&&S.setAttribute("data-checked",C==="checked"),S}},{key:"formats",value:function(C){if(C.tagName==="OL")return"ordered";if(C.tagName==="UL")return C.hasAttribute("data-checked")?C.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function _(A){g(this,_);var C=b(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,A)),R=function(E){if(E.target.parentNode===A){var P=C.statics.formats(A),T=s.default.find(E.target);P==="checked"?T.format("list","unchecked"):P==="unchecked"&&T.format("list","checked")}};return A.addEventListener("touchstart",R),A.addEventListener("mousedown",R),C}return o(_,[{key:"format",value:function(C,R){this.children.length>0&&this.children.tail.format(C,R)}},{key:"formats",value:function(){return O({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(C,R){if(C instanceof y)a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"insertBefore",this).call(this,C,R);else{var S=R==null?this.length():R.offset(this),E=this.split(S);E.parent.insertBefore(C,E)}}},{key:"optimize",value:function(C){a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"optimize",this).call(this,C);var R=this.next;R!=null&&R.prev===this&&R.statics.blotName===this.statics.blotName&&R.domNode.tagName===this.domNode.tagName&&R.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(R.moveChildren(this),R.remove())}},{key:"replace",value:function(C){if(C.statics.blotName!==this.statics.blotName){var R=s.default.create(this.statics.defaultChild);C.moveChildren(R),this.appendChild(R)}a(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"replace",this).call(this,C)}}]),_}(w.default);d.blotName="list",d.scope=s.default.Scope.BLOCK_BLOT,d.tagName=["OL","UL"],d.defaultChild="list-item",d.allowedChildren=[y],r.ListItem=y,r.default=d},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(56),a=l(o);function l(w){return w&&w.__esModule?w:{default:w}}function s(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function f(w,v){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:w}function h(w,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);w.prototype=Object.create(v&&v.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(w,v):w.__proto__=v)}var x=function(w){h(v,w);function v(){return s(this,v),f(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return v}(a.default);x.blotName="italic",x.tagName=["EM","I"],r.default=x},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function O(g,b){for(var p=0;p<b.length;p++){var y=b[p];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(g,y.key,y)}}return function(g,b,p){return b&&O(g.prototype,b),p&&O(g,p),g}}(),a=function O(g,b,p){g===null&&(g=Function.prototype);var y=Object.getOwnPropertyDescriptor(g,b);if(y===void 0){var d=Object.getPrototypeOf(g);return d===null?void 0:O(d,b,p)}else{if("value"in y)return y.value;var m=y.get;return m===void 0?void 0:m.call(p)}},l=i(6),s=f(l);function f(O){return O&&O.__esModule?O:{default:O}}function h(O,g){if(!(O instanceof g))throw new TypeError("Cannot call a class as a function")}function x(O,g){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:O}function w(O,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);O.prototype=Object.create(g&&g.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(O,g):O.__proto__=g)}var v=function(O){w(g,O);function g(){return h(this,g),x(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return o(g,null,[{key:"create",value:function(p){return p==="super"?document.createElement("sup"):p==="sub"?document.createElement("sub"):a(g.__proto__||Object.getPrototypeOf(g),"create",this).call(this,p)}},{key:"formats",value:function(p){if(p.tagName==="SUB")return"sub";if(p.tagName==="SUP")return"super"}}]),g}(s.default);v.blotName="script",v.tagName=["SUB","SUP"],r.default=v},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(6),a=l(o);function l(w){return w&&w.__esModule?w:{default:w}}function s(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function f(w,v){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:w}function h(w,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);w.prototype=Object.create(v&&v.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(w,v):w.__proto__=v)}var x=function(w){h(v,w);function v(){return s(this,v),f(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return v}(a.default);x.blotName="strike",x.tagName="S",r.default=x},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=i(6),a=l(o);function l(w){return w&&w.__esModule?w:{default:w}}function s(w,v){if(!(w instanceof v))throw new TypeError("Cannot call a class as a function")}function f(w,v){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:w}function h(w,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);w.prototype=Object.create(v&&v.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(w,v):w.__proto__=v)}var x=function(w){h(v,w);function v(){return s(this,v),f(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return v}(a.default);x.blotName="underline",x.tagName="U",r.default=x},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function b(p,y){for(var d=0;d<y.length;d++){var m=y[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(p,m.key,m)}}return function(p,y,d){return y&&b(p.prototype,y),d&&b(p,d),p}}(),a=function b(p,y,d){p===null&&(p=Function.prototype);var m=Object.getOwnPropertyDescriptor(p,y);if(m===void 0){var _=Object.getPrototypeOf(p);return _===null?void 0:b(_,y,d)}else{if("value"in m)return m.value;var A=m.get;return A===void 0?void 0:A.call(d)}},l=i(0),s=h(l),f=i(27);function h(b){return b&&b.__esModule?b:{default:b}}function x(b,p){if(!(b instanceof p))throw new TypeError("Cannot call a class as a function")}function w(b,p){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:b}function v(b,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);b.prototype=Object.create(p&&p.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(b,p):b.__proto__=p)}var O=["alt","height","width"],g=function(b){v(p,b);function p(){return x(this,p),w(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return o(p,[{key:"format",value:function(d,m){O.indexOf(d)>-1?m?this.domNode.setAttribute(d,m):this.domNode.removeAttribute(d):a(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"format",this).call(this,d,m)}}],[{key:"create",value:function(d){var m=a(p.__proto__||Object.getPrototypeOf(p),"create",this).call(this,d);return typeof d=="string"&&m.setAttribute("src",this.sanitize(d)),m}},{key:"formats",value:function(d){return O.reduce(function(m,_){return d.hasAttribute(_)&&(m[_]=d.getAttribute(_)),m},{})}},{key:"match",value:function(d){return/\.(jpe?g|gif|png)$/.test(d)||/^data:image\/.+;base64/.test(d)}},{key:"sanitize",value:function(d){return(0,f.sanitize)(d,["http","https","data"])?d:"//:0"}},{key:"value",value:function(d){return d.getAttribute("src")}}]),p}(s.default.Embed);g.blotName="image",g.tagName="IMG",r.default=g},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function b(p,y){for(var d=0;d<y.length;d++){var m=y[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(p,m.key,m)}}return function(p,y,d){return y&&b(p.prototype,y),d&&b(p,d),p}}(),a=function b(p,y,d){p===null&&(p=Function.prototype);var m=Object.getOwnPropertyDescriptor(p,y);if(m===void 0){var _=Object.getPrototypeOf(p);return _===null?void 0:b(_,y,d)}else{if("value"in m)return m.value;var A=m.get;return A===void 0?void 0:A.call(d)}},l=i(4),s=i(27),f=h(s);function h(b){return b&&b.__esModule?b:{default:b}}function x(b,p){if(!(b instanceof p))throw new TypeError("Cannot call a class as a function")}function w(b,p){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:b}function v(b,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);b.prototype=Object.create(p&&p.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(b,p):b.__proto__=p)}var O=["height","width"],g=function(b){v(p,b);function p(){return x(this,p),w(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return o(p,[{key:"format",value:function(d,m){O.indexOf(d)>-1?m?this.domNode.setAttribute(d,m):this.domNode.removeAttribute(d):a(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"format",this).call(this,d,m)}}],[{key:"create",value:function(d){var m=a(p.__proto__||Object.getPrototypeOf(p),"create",this).call(this,d);return m.setAttribute("frameborder","0"),m.setAttribute("allowfullscreen",!0),m.setAttribute("src",this.sanitize(d)),m}},{key:"formats",value:function(d){return O.reduce(function(m,_){return d.hasAttribute(_)&&(m[_]=d.getAttribute(_)),m},{})}},{key:"sanitize",value:function(d){return f.default.sanitize(d)}},{key:"value",value:function(d){return d.getAttribute("src")}}]),p}(l.BlockEmbed);g.blotName="video",g.className="ql-video",g.tagName="IFRAME",r.default=g},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.FormulaBlot=void 0;var o=function(){function d(m,_){for(var A=0;A<_.length;A++){var C=_[A];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(m,C.key,C)}}return function(m,_,A){return _&&d(m.prototype,_),A&&d(m,A),m}}(),a=function d(m,_,A){m===null&&(m=Function.prototype);var C=Object.getOwnPropertyDescriptor(m,_);if(C===void 0){var R=Object.getPrototypeOf(m);return R===null?void 0:d(R,_,A)}else{if("value"in C)return C.value;var S=C.get;return S===void 0?void 0:S.call(A)}},l=i(35),s=v(l),f=i(5),h=v(f),x=i(9),w=v(x);function v(d){return d&&d.__esModule?d:{default:d}}function O(d,m){if(!(d instanceof m))throw new TypeError("Cannot call a class as a function")}function g(d,m){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:d}function b(d,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);d.prototype=Object.create(m&&m.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(d,m):d.__proto__=m)}var p=function(d){b(m,d);function m(){return O(this,m),g(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return o(m,null,[{key:"create",value:function(A){var C=a(m.__proto__||Object.getPrototypeOf(m),"create",this).call(this,A);return typeof A=="string"&&(window.katex.render(A,C,{throwOnError:!1,errorColor:"#f00"}),C.setAttribute("data-value",A)),C}},{key:"value",value:function(A){return A.getAttribute("data-value")}}]),m}(s.default);p.blotName="formula",p.className="ql-formula",p.tagName="SPAN";var y=function(d){b(m,d),o(m,null,[{key:"register",value:function(){h.default.register(p,!0)}}]);function m(){O(this,m);var _=g(this,(m.__proto__||Object.getPrototypeOf(m)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return _}return m}(w.default);r.FormulaBlot=p,r.default=y},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.CodeToken=r.CodeBlock=void 0;var o=function(){function A(C,R){for(var S=0;S<R.length;S++){var E=R[S];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(C,E.key,E)}}return function(C,R,S){return R&&A(C.prototype,R),S&&A(C,S),C}}(),a=function A(C,R,S){C===null&&(C=Function.prototype);var E=Object.getOwnPropertyDescriptor(C,R);if(E===void 0){var P=Object.getPrototypeOf(C);return P===null?void 0:A(P,R,S)}else{if("value"in E)return E.value;var T=E.get;return T===void 0?void 0:T.call(S)}},l=i(0),s=g(l),f=i(5),h=g(f),x=i(9),w=g(x),v=i(13),O=g(v);function g(A){return A&&A.__esModule?A:{default:A}}function b(A,C){if(!(A instanceof C))throw new TypeError("Cannot call a class as a function")}function p(A,C){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:A}function y(A,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);A.prototype=Object.create(C&&C.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(A,C):A.__proto__=C)}var d=function(A){y(C,A);function C(){return b(this,C),p(this,(C.__proto__||Object.getPrototypeOf(C)).apply(this,arguments))}return o(C,[{key:"replaceWith",value:function(S){this.domNode.textContent=this.domNode.textContent,this.attach(),a(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"replaceWith",this).call(this,S)}},{key:"highlight",value:function(S){var E=this.domNode.textContent;this.cachedText!==E&&((E.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=S(E),this.domNode.normalize(),this.attach()),this.cachedText=E)}}]),C}(O.default);d.className="ql-syntax";var m=new s.default.Attributor.Class("token","hljs",{scope:s.default.Scope.INLINE}),_=function(A){y(C,A),o(C,null,[{key:"register",value:function(){h.default.register(m,!0),h.default.register(d,!0)}}]);function C(R,S){b(this,C);var E=p(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,R,S));if(typeof E.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var P=null;return E.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(P),P=setTimeout(function(){E.highlight(),P=null},E.options.interval)}),E.highlight(),E}return o(C,[{key:"highlight",value:function(){var S=this;if(!this.quill.selection.composing){this.quill.update(h.default.sources.USER);var E=this.quill.getSelection();this.quill.scroll.descendants(d).forEach(function(P){P.highlight(S.options.highlight)}),this.quill.update(h.default.sources.SILENT),E!=null&&this.quill.setSelection(E,h.default.sources.SILENT)}}}]),C}(w.default);_.DEFAULTS={highlight:function(){return window.hljs==null?null:function(A){var C=window.hljs.highlightAuto(A);return C.value}}(),interval:1e3},r.CodeBlock=d,r.CodeToken=m,r.default=_},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'},function(n,r){n.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'},function(n,r){n.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'},function(n,r){n.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'},function(n,r){n.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'},function(n,r){n.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'},function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.BubbleTooltip=void 0;var o=function C(R,S,E){R===null&&(R=Function.prototype);var P=Object.getOwnPropertyDescriptor(R,S);if(P===void 0){var T=Object.getPrototypeOf(R);return T===null?void 0:C(T,S,E)}else{if("value"in P)return P.value;var N=P.get;return N===void 0?void 0:N.call(E)}},a=function(){function C(R,S){for(var E=0;E<S.length;E++){var P=S[E];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(R,P.key,P)}}return function(R,S,E){return S&&C(R.prototype,S),E&&C(R,E),R}}(),l=i(3),s=b(l),f=i(8),h=b(f),x=i(43),w=b(x),v=i(15),O=i(41),g=b(O);function b(C){return C&&C.__esModule?C:{default:C}}function p(C,R){if(!(C instanceof R))throw new TypeError("Cannot call a class as a function")}function y(C,R){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:C}function d(C,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);C.prototype=Object.create(R&&R.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(C,R):C.__proto__=R)}var m=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],_=function(C){d(R,C);function R(S,E){p(this,R),E.modules.toolbar!=null&&E.modules.toolbar.container==null&&(E.modules.toolbar.container=m);var P=y(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,S,E));return P.quill.container.classList.add("ql-bubble"),P}return a(R,[{key:"extendToolbar",value:function(E){this.tooltip=new A(this.quill,this.options.bounds),this.tooltip.root.appendChild(E.container),this.buildButtons([].slice.call(E.container.querySelectorAll("button")),g.default),this.buildPickers([].slice.call(E.container.querySelectorAll("select")),g.default)}}]),R}(w.default);_.DEFAULTS=(0,s.default)(!0,{},w.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(R){R?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var A=function(C){d(R,C);function R(S,E){p(this,R);var P=y(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,S,E));return P.quill.on(h.default.events.EDITOR_CHANGE,function(T,N,U,G){if(T===h.default.events.SELECTION_CHANGE)if(N!=null&&N.length>0&&G===h.default.sources.USER){P.show(),P.root.style.left="0px",P.root.style.width="",P.root.style.width=P.root.offsetWidth+"px";var Z=P.quill.getLines(N.index,N.length);if(Z.length===1)P.position(P.quill.getBounds(N));else{var W=Z[Z.length-1],H=P.quill.getIndex(W),L=Math.min(W.length()-1,N.index+N.length-H),M=P.quill.getBounds(new v.Range(H,L));P.position(M)}}else document.activeElement!==P.textbox&&P.quill.hasFocus()&&P.hide()}),P}return a(R,[{key:"listen",value:function(){var E=this;o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){E.root.classList.remove("ql-editing")}),this.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!E.root.classList.contains("ql-hidden")){var P=E.quill.getSelection();P!=null&&E.position(E.quill.getBounds(P))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(E){var P=o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"position",this).call(this,E),T=this.root.querySelector(".ql-tooltip-arrow");if(T.style.marginLeft="",P===0)return P;T.style.marginLeft=-1*P-T.offsetWidth/2+"px"}}]),R}(x.BaseTooltip);A.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),r.BubbleTooltip=A,r.default=_},function(n,r,i){n.exports=i(63)}]).default})})(oS);var TD=oS.exports,g2={},aS={exports:{}},Ka={},Vu={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */Vu.exports;var I4;function AD(){return I4||(I4=1,function(t,e){(function(n){var r=e&&!e.nodeType&&e,i=t&&!t.nodeType&&t,o=typeof _e=="object"&&_e;(o.global===o||o.window===o||o.self===o)&&(n=o);var a,l=2147483647,s=36,f=1,h=26,x=38,w=700,v=72,O=128,g="-",b=/^xn--/,p=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=s-f,_=Math.floor,A=String.fromCharCode,C;function R(M){throw new RangeError(d[M])}function S(M,D){for(var B=M.length,V=[];B--;)V[B]=D(M[B]);return V}function E(M,D){var B=M.split("@"),V="";B.length>1&&(V=B[0]+"@",M=B[1]),M=M.replace(y,".");var Y=M.split("."),F=S(Y,D).join(".");return V+F}function P(M){for(var D=[],B=0,V=M.length,Y,F;B<V;)Y=M.charCodeAt(B++),Y>=55296&&Y<=56319&&B<V?(F=M.charCodeAt(B++),(F&64512)==56320?D.push(((Y&1023)<<10)+(F&1023)+65536):(D.push(Y),B--)):D.push(Y);return D}function T(M){return S(M,function(D){var B="";return D>65535&&(D-=65536,B+=A(D>>>10&1023|55296),D=56320|D&1023),B+=A(D),B}).join("")}function N(M){return M-48<10?M-22:M-65<26?M-65:M-97<26?M-97:s}function U(M,D){return M+22+75*(M<26)-((D!=0)<<5)}function G(M,D,B){var V=0;for(M=B?_(M/w):M>>1,M+=_(M/D);M>m*h>>1;V+=s)M=_(M/m);return _(V+(m+1)*M/(M+x))}function Z(M){var D=[],B=M.length,V,Y=0,F=O,$=v,z,K,X,Q,J,ne,ie,oe,de;for(z=M.lastIndexOf(g),z<0&&(z=0),K=0;K<z;++K)M.charCodeAt(K)>=128&&R("not-basic"),D.push(M.charCodeAt(K));for(X=z>0?z+1:0;X<B;){for(Q=Y,J=1,ne=s;X>=B&&R("invalid-input"),ie=N(M.charCodeAt(X++)),(ie>=s||ie>_((l-Y)/J))&&R("overflow"),Y+=ie*J,oe=ne<=$?f:ne>=$+h?h:ne-$,!(ie<oe);ne+=s)de=s-oe,J>_(l/de)&&R("overflow"),J*=de;V=D.length+1,$=G(Y-Q,V,Q==0),_(Y/V)>l-F&&R("overflow"),F+=_(Y/V),Y%=V,D.splice(Y++,0,F)}return T(D)}function W(M){var D,B,V,Y,F,$,z,K,X,Q,J,ne=[],ie,oe,de,me;for(M=P(M),ie=M.length,D=O,B=0,F=v,$=0;$<ie;++$)J=M[$],J<128&&ne.push(A(J));for(V=Y=ne.length,Y&&ne.push(g);V<ie;){for(z=l,$=0;$<ie;++$)J=M[$],J>=D&&J<z&&(z=J);for(oe=V+1,z-D>_((l-B)/oe)&&R("overflow"),B+=(z-D)*oe,D=z,$=0;$<ie;++$)if(J=M[$],J<D&&++B>l&&R("overflow"),J==D){for(K=B,X=s;Q=X<=F?f:X>=F+h?h:X-F,!(K<Q);X+=s)me=K-Q,de=s-Q,ne.push(A(U(Q+me%de,0))),K=_(me/de);ne.push(A(U(K,0))),F=G(B,oe,V==Y),B=0,++V}++B,++D}return ne.join("")}function H(M){return E(M,function(D){return b.test(D)?Z(D.slice(4).toLowerCase()):D})}function L(M){return E(M,function(D){return p.test(D)?"xn--"+W(D):D})}if(a={version:"1.4.1",ucs2:{decode:P,encode:T},decode:Z,encode:W,toASCII:L,toUnicode:H},r&&i)if(t.exports==r)i.exports=a;else for(C in a)a.hasOwnProperty(C)&&(r[C]=a[C]);else n.punycode=a})(_e)}(Vu,Vu.exports)),Vu.exports}var og,D4;function RD(){return D4||(D4=1,og=Error),og}var ag,j4;function MD(){return j4||(j4=1,ag=EvalError),ag}var lg,F4;function LD(){return F4||(F4=1,lg=RangeError),lg}var sg,z4;function ND(){return z4||(z4=1,sg=ReferenceError),sg}var ug,B4;function lS(){return B4||(B4=1,ug=SyntaxError),ug}var cg,U4;function nf(){return U4||(U4=1,cg=TypeError),cg}var fg,H4;function ID(){return H4||(H4=1,fg=URIError),fg}var dg,$4;function DD(){return $4||($4=1,dg=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;e[n]=i;for(n in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==n||!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(e,n);if(a.value!==i||a.enumerable!==!0)return!1}return!0}),dg}var hg,G4;function jD(){if(G4)return hg;G4=1;var t=typeof Symbol<"u"&&Symbol,e=DD();return hg=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},hg}var pg,V4;function FD(){if(V4)return pg;V4=1;var t={__proto__:null,foo:{}},e=Object;return pg=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof e)},pg}var gg,q4;function zD(){if(q4)return gg;q4=1;var t="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,n=Math.max,r="[object Function]",i=function(s,f){for(var h=[],x=0;x<s.length;x+=1)h[x]=s[x];for(var w=0;w<f.length;w+=1)h[w+s.length]=f[w];return h},o=function(s,f){for(var h=[],x=f,w=0;x<s.length;x+=1,w+=1)h[w]=s[x];return h},a=function(l,s){for(var f="",h=0;h<l.length;h+=1)f+=l[h],h+1<l.length&&(f+=s);return f};return gg=function(s){var f=this;if(typeof f!="function"||e.apply(f)!==r)throw new TypeError(t+f);for(var h=o(arguments,1),x,w=function(){if(this instanceof x){var p=f.apply(this,i(h,arguments));return Object(p)===p?p:this}return f.apply(s,i(h,arguments))},v=n(0,f.length-h.length),O=[],g=0;g<v;g++)O[g]="$"+g;if(x=Function("binder","return function ("+a(O,",")+"){ return binder.apply(this,arguments); }")(w),f.prototype){var b=function(){};b.prototype=f.prototype,x.prototype=new b,b.prototype=null}return x},gg}var vg,W4;function v2(){if(W4)return vg;W4=1;var t=zD();return vg=Function.prototype.bind||t,vg}var mg,Y4;function BD(){if(Y4)return mg;Y4=1;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,n=v2();return mg=n.call(t,e),mg}var yg,K4;function lu(){if(K4)return yg;K4=1;var t,e=RD(),n=MD(),r=LD(),i=ND(),o=lS(),a=nf(),l=ID(),s=Function,f=function(W){try{return s('"use strict"; return ('+W+").constructor;")()}catch{}},h=Object.getOwnPropertyDescriptor;if(h)try{h({},"")}catch{h=null}var x=function(){throw new a},w=h?function(){try{return arguments.callee,x}catch{try{return h(arguments,"callee").get}catch{return x}}}():x,v=jD()(),O=FD()(),g=Object.getPrototypeOf||(O?function(W){return W.__proto__}:null),b={},p=typeof Uint8Array>"u"||!g?t:g(Uint8Array),y={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":v&&g?g([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":b,"%AsyncGenerator%":b,"%AsyncGeneratorFunction%":b,"%AsyncIteratorPrototype%":b,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":n,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":s,"%GeneratorFunction%":b,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":v&&g?g(g([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!v||!g?t:g(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":r,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!v||!g?t:g(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":v&&g?g(""[Symbol.iterator]()):t,"%Symbol%":v?Symbol:t,"%SyntaxError%":o,"%ThrowTypeError%":w,"%TypedArray%":p,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet};if(g)try{null.error}catch(W){var d=g(g(W));y["%Error.prototype%"]=d}var m=function W(H){var L;if(H==="%AsyncFunction%")L=f("async function () {}");else if(H==="%GeneratorFunction%")L=f("function* () {}");else if(H==="%AsyncGeneratorFunction%")L=f("async function* () {}");else if(H==="%AsyncGenerator%"){var M=W("%AsyncGeneratorFunction%");M&&(L=M.prototype)}else if(H==="%AsyncIteratorPrototype%"){var D=W("%AsyncGenerator%");D&&g&&(L=g(D.prototype))}return y[H]=L,L},_={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},A=v2(),C=BD(),R=A.call(Function.call,Array.prototype.concat),S=A.call(Function.apply,Array.prototype.splice),E=A.call(Function.call,String.prototype.replace),P=A.call(Function.call,String.prototype.slice),T=A.call(Function.call,RegExp.prototype.exec),N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,U=/\\(\\)?/g,G=function(H){var L=P(H,0,1),M=P(H,-1);if(L==="%"&&M!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(M==="%"&&L!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var D=[];return E(H,N,function(B,V,Y,F){D[D.length]=Y?E(F,U,"$1"):V||B}),D},Z=function(H,L){var M=H,D;if(C(_,M)&&(D=_[M],M="%"+D[0]+"%"),C(y,M)){var B=y[M];if(B===b&&(B=m(M)),typeof B>"u"&&!L)throw new a("intrinsic "+H+" exists, but is not available. Please file an issue!");return{alias:D,name:M,value:B}}throw new o("intrinsic "+H+" does not exist!")};return yg=function(H,L){if(typeof H!="string"||H.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof L!="boolean")throw new a('"allowMissing" argument must be a boolean');if(T(/^%?[^%]*%?$/,H)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var M=G(H),D=M.length>0?M[0]:"",B=Z("%"+D+"%",L),V=B.name,Y=B.value,F=!1,$=B.alias;$&&(D=$[0],S(M,R([0,1],$)));for(var z=1,K=!0;z<M.length;z+=1){var X=M[z],Q=P(X,0,1),J=P(X,-1);if((Q==='"'||Q==="'"||Q==="`"||J==='"'||J==="'"||J==="`")&&Q!==J)throw new o("property names with quotes must have matching quotes");if((X==="constructor"||!K)&&(F=!0),D+="."+X,V="%"+D+"%",C(y,V))Y=y[V];else if(Y!=null){if(!(X in Y)){if(!L)throw new a("base intrinsic for "+H+" exists, but the property is not available.");return}if(h&&z+1>=M.length){var ne=h(Y,X);K=!!ne,K&&"get"in ne&&!("originalValue"in ne.get)?Y=ne.get:Y=Y[X]}else K=C(Y,X),Y=Y[X];K&&!F&&(y[V]=Y)}}return Y},yg}var bg={exports:{}},_g,X4;function m2(){if(X4)return _g;X4=1;var t=lu(),e=t("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return _g=e,_g}var wg,Z4;function sS(){if(Z4)return wg;Z4=1;var t=lu(),e=t("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return wg=e,wg}var Sg,Q4;function UD(){if(Q4)return Sg;Q4=1;var t=m2(),e=lS(),n=nf(),r=sS();return Sg=function(o,a,l){if(!o||typeof o!="object"&&typeof o!="function")throw new n("`obj` must be an object or a function`");if(typeof a!="string"&&typeof a!="symbol")throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new n("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,h=arguments.length>5?arguments[5]:null,x=arguments.length>6?arguments[6]:!1,w=!!r&&r(o,a);if(t)t(o,a,{configurable:h===null&&w?w.configurable:!h,enumerable:s===null&&w?w.enumerable:!s,value:l,writable:f===null&&w?w.writable:!f});else if(x||!s&&!f&&!h)o[a]=l;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Sg}var Eg,J4;function HD(){if(J4)return Eg;J4=1;var t=m2(),e=function(){return!!t};return e.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},Eg=e,Eg}var Og,e_;function $D(){if(e_)return Og;e_=1;var t=lu(),e=UD(),n=HD()(),r=sS(),i=nf(),o=t("%Math.floor%");return Og=function(l,s){if(typeof l!="function")throw new i("`fn` is not a function");if(typeof s!="number"||s<0||s>4294967295||o(s)!==s)throw new i("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],h=!0,x=!0;if("length"in l&&r){var w=r(l,"length");w&&!w.configurable&&(h=!1),w&&!w.writable&&(x=!1)}return(h||x||!f)&&(n?e(l,"length",s,!0,!0):e(l,"length",s)),l},Og}var t_;function GD(){return t_||(t_=1,function(t){var e=v2(),n=lu(),r=$D(),i=nf(),o=n("%Function.prototype.apply%"),a=n("%Function.prototype.call%"),l=n("%Reflect.apply%",!0)||e.call(a,o),s=m2(),f=n("%Math.max%");t.exports=function(w){if(typeof w!="function")throw new i("a function is required");var v=l(e,a,arguments);return r(v,1+f(0,w.length-(arguments.length-1)),!0)};var h=function(){return l(e,o,arguments)};s?s(t.exports,"apply",{value:h}):t.exports.apply=h}(bg)),bg.exports}var xg,n_;function VD(){if(n_)return xg;n_=1;var t=lu(),e=GD(),n=e(t("String.prototype.indexOf"));return xg=function(i,o){var a=t(i,!!o);return typeof a=="function"&&n(i,".prototype.")>-1?e(a):a},xg}const qD={},WD=Object.freeze(Object.defineProperty({__proto__:null,default:qD},Symbol.toStringTag,{value:"Module"})),YD=_a(WD);var Pg,r_;function KD(){if(r_)return Pg;r_=1;var t=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&t?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,n=t&&e&&typeof e.get=="function"?e.get:null,r=t&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,o=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,a=i&&o&&typeof o.get=="function"?o.get:null,l=i&&Set.prototype.forEach,s=typeof WeakMap=="function"&&WeakMap.prototype,f=s?WeakMap.prototype.has:null,h=typeof WeakSet=="function"&&WeakSet.prototype,x=h?WeakSet.prototype.has:null,w=typeof WeakRef=="function"&&WeakRef.prototype,v=w?WeakRef.prototype.deref:null,O=Boolean.prototype.valueOf,g=Object.prototype.toString,b=Function.prototype.toString,p=String.prototype.match,y=String.prototype.slice,d=String.prototype.replace,m=String.prototype.toUpperCase,_=String.prototype.toLowerCase,A=RegExp.prototype.test,C=Array.prototype.concat,R=Array.prototype.join,S=Array.prototype.slice,E=Math.floor,P=typeof BigInt=="function"?BigInt.prototype.valueOf:null,T=Object.getOwnPropertySymbols,N=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,U=typeof Symbol=="function"&&typeof Symbol.iterator=="object",G=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===U||!0)?Symbol.toStringTag:null,Z=Object.prototype.propertyIsEnumerable,W=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(ue){return ue.__proto__}:null);function H(ue,ce){if(ue===1/0||ue===-1/0||ue!==ue||ue&&ue>-1e3&&ue<1e3||A.call(/e/,ce))return ce;var Se=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof ue=="number"){var Le=ue<0?-E(-ue):E(ue);if(Le!==ue){var Ne=String(Le),ge=y.call(ce,Ne.length+1);return d.call(Ne,Se,"$&_")+"."+d.call(d.call(ge,/([0-9]{3})/g,"$&_"),/_$/,"")}}return d.call(ce,Se,"$&_")}var L=YD,M=L.custom,D=ie(M)?M:null,B={__proto__:null,double:'"',single:"'"},V={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Pg=function ue(ce,Se,Le,Ne){var ge=Se||{};if(me(ge,"quoteStyle")&&!me(B,ge.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(me(ge,"maxStringLength")&&(typeof ge.maxStringLength=="number"?ge.maxStringLength<0&&ge.maxStringLength!==1/0:ge.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Xe=me(ge,"customInspect")?ge.customInspect:!0;if(typeof Xe!="boolean"&&Xe!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(me(ge,"indent")&&ge.indent!==null&&ge.indent!==" "&&!(parseInt(ge.indent,10)===ge.indent&&ge.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(me(ge,"numericSeparator")&&typeof ge.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Oe=ge.numericSeparator;if(typeof ce>"u")return"undefined";if(ce===null)return"null";if(typeof ce=="boolean")return ce?"true":"false";if(typeof ce=="string")return Ve(ce,ge);if(typeof ce=="number"){if(ce===0)return 1/0/ce>0?"0":"-0";var $e=String(ce);return Oe?H(ce,$e):$e}if(typeof ce=="bigint"){var Wt=String(ce)+"n";return Oe?H(ce,Wt):Wt}var Tt=typeof ge.depth>"u"?5:ge.depth;if(typeof Le>"u"&&(Le=0),Le>=Tt&&Tt>0&&typeof ce=="object")return $(ce)?"[Array]":"[Object]";var Yt=We(ge,Le);if(typeof Ne>"u")Ne=[];else if(ae(Ne,ce)>=0)return"[Circular]";function ke(xn,tn,ri){if(tn&&(Ne=S.call(Ne),Ne.push(tn)),ri){var Sr={depth:ge.depth};return me(ge,"quoteStyle")&&(Sr.quoteStyle=ge.quoteStyle),ue(xn,Sr,Le+1,Ne)}return ue(xn,ge,Le+1,Ne)}if(typeof ce=="function"&&!K(ce)){var Ye=re(ce),at=mt(ce,ke);return"[Function"+(Ye?": "+Ye:" (anonymous)")+"]"+(at.length>0?" { "+R.call(at,", ")+" }":"")}if(ie(ce)){var Ot=U?d.call(String(ce),/^(Symbol\(.*\))_[^)]*$/,"$1"):N.call(ce);return typeof ce=="object"&&!U?Ae(Ot):Ot}if(Ee(ce)){for(var xt="<"+_.call(String(ce.nodeName)),un=ce.attributes||[],hn=0;hn<un.length;hn++)xt+=" "+un[hn].name+"="+Y(F(un[hn].value),"double",ge);return xt+=">",ce.childNodes&&ce.childNodes.length&&(xt+="..."),xt+="</"+_.call(String(ce.nodeName))+">",xt}if($(ce)){if(ce.length===0)return"[]";var pn=mt(ce,ke);return Yt&&!ze(pn)?"["+St(pn,Yt)+"]":"[ "+R.call(pn,", ")+" ]"}if(X(ce)){var rr=mt(ce,ke);return!("cause"in Error.prototype)&&"cause"in ce&&!Z.call(ce,"cause")?"{ ["+String(ce)+"] "+R.call(C.call("[cause]: "+ke(ce.cause),rr),", ")+" }":rr.length===0?"["+String(ce)+"]":"{ ["+String(ce)+"] "+R.call(rr,", ")+" }"}if(typeof ce=="object"&&Xe){if(D&&typeof ce[D]=="function"&&L)return L(ce,{depth:Tt-Le});if(Xe!=="symbol"&&typeof ce.inspect=="function")return ce.inspect()}if(we(ce)){var to=[];return r&&r.call(ce,function(xn,tn){to.push(ke(tn,ce,!0)+" => "+ke(xn,ce))}),Me("Map",n.call(ce),to,Yt)}if(fe(ce)){var wr=[];return l&&l.call(ce,function(xn){wr.push(ke(xn,ce))}),Me("Set",a.call(ce),wr,Yt)}if(be(ce))return Ce("WeakMap");if(he(ce))return Ce("WeakSet");if(te(ce))return Ce("WeakRef");if(J(ce))return Ae(ke(Number(ce)));if(oe(ce))return Ae(ke(P.call(ce)));if(ne(ce))return Ae(O.call(ce));if(Q(ce))return Ae(ke(String(ce)));if(typeof window<"u"&&ce===window)return"{ [object Window] }";if(typeof globalThis<"u"&&ce===globalThis||typeof _e<"u"&&ce===_e)return"{ [object globalThis] }";if(!z(ce)&&!K(ce)){var Ie=mt(ce,ke),et=W?W(ce)===Object.prototype:ce instanceof Object||ce.constructor===Object,ft=ce instanceof Object?"":"null prototype",Ft=!et&&G&&Object(ce)===ce&&G in ce?y.call(Pe(ce),8,-1):ft?"Object":"",Pt=et||typeof ce.constructor!="function"?"":ce.constructor.name?ce.constructor.name+" ":"",Bn=Pt+(Ft||ft?"["+R.call(C.call([],Ft||[],ft||[]),": ")+"] ":"");return Ie.length===0?Bn+"{}":Yt?Bn+"{"+St(Ie,Yt)+"}":Bn+"{ "+R.call(Ie,", ")+" }"}return String(ce)};function Y(ue,ce,Se){var Le=Se.quoteStyle||ce,Ne=B[Le];return Ne+ue+Ne}function F(ue){return d.call(String(ue),/"/g,""")}function $(ue){return Pe(ue)==="[object Array]"&&(!G||!(typeof ue=="object"&&G in ue))}function z(ue){return Pe(ue)==="[object Date]"&&(!G||!(typeof ue=="object"&&G in ue))}function K(ue){return Pe(ue)==="[object RegExp]"&&(!G||!(typeof ue=="object"&&G in ue))}function X(ue){return Pe(ue)==="[object Error]"&&(!G||!(typeof ue=="object"&&G in ue))}function Q(ue){return Pe(ue)==="[object String]"&&(!G||!(typeof ue=="object"&&G in ue))}function J(ue){return Pe(ue)==="[object Number]"&&(!G||!(typeof ue=="object"&&G in ue))}function ne(ue){return Pe(ue)==="[object Boolean]"&&(!G||!(typeof ue=="object"&&G in ue))}function ie(ue){if(U)return ue&&typeof ue=="object"&&ue instanceof Symbol;if(typeof ue=="symbol")return!0;if(!ue||typeof ue!="object"||!N)return!1;try{return N.call(ue),!0}catch{}return!1}function oe(ue){if(!ue||typeof ue!="object"||!P)return!1;try{return P.call(ue),!0}catch{}return!1}var de=Object.prototype.hasOwnProperty||function(ue){return ue in this};function me(ue,ce){return de.call(ue,ce)}function Pe(ue){return g.call(ue)}function re(ue){if(ue.name)return ue.name;var ce=p.call(b.call(ue),/^function\s*([\w$]+)/);return ce?ce[1]:null}function ae(ue,ce){if(ue.indexOf)return ue.indexOf(ce);for(var Se=0,Le=ue.length;Se<Le;Se++)if(ue[Se]===ce)return Se;return-1}function we(ue){if(!n||!ue||typeof ue!="object")return!1;try{n.call(ue);try{a.call(ue)}catch{return!0}return ue instanceof Map}catch{}return!1}function be(ue){if(!f||!ue||typeof ue!="object")return!1;try{f.call(ue,f);try{x.call(ue,x)}catch{return!0}return ue instanceof WeakMap}catch{}return!1}function te(ue){if(!v||!ue||typeof ue!="object")return!1;try{return v.call(ue),!0}catch{}return!1}function fe(ue){if(!a||!ue||typeof ue!="object")return!1;try{a.call(ue);try{n.call(ue)}catch{return!0}return ue instanceof Set}catch{}return!1}function he(ue){if(!x||!ue||typeof ue!="object")return!1;try{x.call(ue,x);try{f.call(ue,f)}catch{return!0}return ue instanceof WeakSet}catch{}return!1}function Ee(ue){return!ue||typeof ue!="object"?!1:typeof HTMLElement<"u"&&ue instanceof HTMLElement?!0:typeof ue.nodeName=="string"&&typeof ue.getAttribute=="function"}function Ve(ue,ce){if(ue.length>ce.maxStringLength){var Se=ue.length-ce.maxStringLength,Le="... "+Se+" more character"+(Se>1?"s":"");return Ve(y.call(ue,0,ce.maxStringLength),ce)+Le}var Ne=V[ce.quoteStyle||"single"];Ne.lastIndex=0;var ge=d.call(d.call(ue,Ne,"\\$1"),/[\x00-\x1f]/g,Je);return Y(ge,"single",ce)}function Je(ue){var ce=ue.charCodeAt(0),Se={8:"b",9:"t",10:"n",12:"f",13:"r"}[ce];return Se?"\\"+Se:"\\x"+(ce<16?"0":"")+m.call(ce.toString(16))}function Ae(ue){return"Object("+ue+")"}function Ce(ue){return ue+" { ? }"}function Me(ue,ce,Se,Le){var Ne=Le?St(Se,Le):R.call(Se,", ");return ue+" ("+ce+") {"+Ne+"}"}function ze(ue){for(var ce=0;ce<ue.length;ce++)if(ae(ue[ce],`
|
|
149
149
|
`)>=0)return!1;return!0}function We(ue,ce){var Se;if(ue.indent===" ")Se=" ";else if(typeof ue.indent=="number"&&ue.indent>0)Se=R.call(Array(ue.indent+1)," ");else return null;return{base:Se,prev:R.call(Array(ce+1),Se)}}function St(ue,ce){if(ue.length===0)return"";var Se=`
|
|
150
150
|
`+ce.prev+ce.base;return Se+R.call(ue,","+Se)+`
|
|
151
|
-
`+ce.prev}function mt(ue,ce){var Se=$(ue),Le=[];if(Se){Le.length=ue.length;for(var Ne=0;Ne<ue.length;Ne++)Le[Ne]=me(ue,Ne)?ce(ue[Ne],ue):""}var ge=typeof T=="function"?T(ue):[],Xe;if(U){Xe={};for(var Oe=0;Oe<ge.length;Oe++)Xe["$"+ge[Oe]]=ge[Oe]}for(var $e in ue)me(ue,$e)&&(Se&&String(Number($e))===$e&&$e<ue.length||U&&Xe["$"+$e]instanceof Symbol||(A.call(/[^\w$]/,$e)?Le.push(ce($e,ue)+": "+ce(ue[$e],ue)):Le.push($e+": "+ce(ue[$e],ue))));if(typeof T=="function")for(var Wt=0;Wt<ge.length;Wt++)Z.call(ue,ge[Wt])&&Le.push("["+ce(ge[Wt])+"]: "+ce(ue[ge[Wt]],ue));return Le}return Pg}var Cg,i_;function XD(){if(i_)return Cg;i_=1;var t=lu(),e=VD(),n=KD(),r=nf(),i=t("%WeakMap%",!0),o=t("%Map%",!0),a=e("WeakMap.prototype.get",!0),l=e("WeakMap.prototype.set",!0),s=e("WeakMap.prototype.has",!0),f=e("Map.prototype.get",!0),h=e("Map.prototype.set",!0),x=e("Map.prototype.has",!0),w=function(b,p){for(var y=b,d;(d=y.next)!==null;y=d)if(d.key===p)return y.next=d.next,d.next=b.next,b.next=d,d},v=function(b,p){var y=w(b,p);return y&&y.value},O=function(b,p,y){var d=w(b,p);d?d.value=y:b.next={key:p,next:b.next,value:y}},g=function(b,p){return!!w(b,p)};return Cg=function(){var p,y,d,m={assert:function(_){if(!m.has(_))throw new r("Side channel does not contain "+n(_))},get:function(_){if(i&&_&&(typeof _=="object"||typeof _=="function")){if(p)return a(p,_)}else if(o){if(y)return f(y,_)}else if(d)return v(d,_)},has:function(_){if(i&&_&&(typeof _=="object"||typeof _=="function")){if(p)return s(p,_)}else if(o){if(y)return x(y,_)}else if(d)return g(d,_);return!1},set:function(_,A){i&&_&&(typeof _=="object"||typeof _=="function")?(p||(p=new i),l(p,_,A)):o?(y||(y=new o),h(y,_,A)):(d||(d={key:{},next:null}),O(d,_,A))}};return m},Cg}var kg,o_;function y2(){if(o_)return kg;o_=1;var t=String.prototype.replace,e=/%20/g,n={RFC1738:"RFC1738",RFC3986:"RFC3986"};return kg={default:n.RFC3986,formatters:{RFC1738:function(r){return t.call(r,e,"+")},RFC3986:function(r){return String(r)}},RFC1738:n.RFC1738,RFC3986:n.RFC3986},kg}var Tg,a_;function uS(){if(a_)return Tg;a_=1;var t=y2(),e=Object.prototype.hasOwnProperty,n=Array.isArray,r=function(){for(var b=[],p=0;p<256;++p)b.push("%"+((p<16?"0":"")+p.toString(16)).toUpperCase());return b}(),i=function(p){for(;p.length>1;){var y=p.pop(),d=y.obj[y.prop];if(n(d)){for(var m=[],_=0;_<d.length;++_)typeof d[_]<"u"&&m.push(d[_]);y.obj[y.prop]=m}}},o=function(p,y){for(var d=y&&y.plainObjects?Object.create(null):{},m=0;m<p.length;++m)typeof p[m]<"u"&&(d[m]=p[m]);return d},a=function b(p,y,d){if(!y)return p;if(typeof y!="object"){if(n(p))p.push(y);else if(p&&typeof p=="object")(d&&(d.plainObjects||d.allowPrototypes)||!e.call(Object.prototype,y))&&(p[y]=!0);else return[p,y];return p}if(!p||typeof p!="object")return[p].concat(y);var m=p;return n(p)&&!n(y)&&(m=o(p,d)),n(p)&&n(y)?(y.forEach(function(_,A){if(e.call(p,A)){var C=p[A];C&&typeof C=="object"&&_&&typeof _=="object"?p[A]=b(C,_,d):p.push(_)}else p[A]=_}),p):Object.keys(y).reduce(function(_,A){var C=y[A];return e.call(_,A)?_[A]=b(_[A],C,d):_[A]=C,_},m)},l=function(p,y){return Object.keys(y).reduce(function(d,m){return d[m]=y[m],d},p)},s=function(b,p,y){var d=b.replace(/\+/g," ");if(y==="iso-8859-1")return d.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(d)}catch{return d}},f=1024,h=function(p,y,d,m,_){if(p.length===0)return p;var A=p;if(typeof p=="symbol"?A=Symbol.prototype.toString.call(p):typeof p!="string"&&(A=String(p)),d==="iso-8859-1")return escape(A).replace(/%u[0-9a-f]{4}/gi,function(N){return"%26%23"+parseInt(N.slice(2),16)+"%3B"});for(var C="",R=0;R<A.length;R+=f){for(var S=A.length>=f?A.slice(R,R+f):A,E=[],P=0;P<S.length;++P){var T=S.charCodeAt(P);if(T===45||T===46||T===95||T===126||T>=48&&T<=57||T>=65&&T<=90||T>=97&&T<=122||_===t.RFC1738&&(T===40||T===41)){E[E.length]=S.charAt(P);continue}if(T<128){E[E.length]=r[T];continue}if(T<2048){E[E.length]=r[192|T>>6]+r[128|T&63];continue}if(T<55296||T>=57344){E[E.length]=r[224|T>>12]+r[128|T>>6&63]+r[128|T&63];continue}P+=1,T=65536+((T&1023)<<10|S.charCodeAt(P)&1023),E[E.length]=r[240|T>>18]+r[128|T>>12&63]+r[128|T>>6&63]+r[128|T&63]}C+=E.join("")}return C},x=function(p){for(var y=[{obj:{o:p},prop:"o"}],d=[],m=0;m<y.length;++m)for(var _=y[m],A=_.obj[_.prop],C=Object.keys(A),R=0;R<C.length;++R){var S=C[R],E=A[S];typeof E=="object"&&E!==null&&d.indexOf(E)===-1&&(y.push({obj:A,prop:S}),d.push(E))}return i(y),p},w=function(p){return Object.prototype.toString.call(p)==="[object RegExp]"},v=function(p){return!p||typeof p!="object"?!1:!!(p.constructor&&p.constructor.isBuffer&&p.constructor.isBuffer(p))},O=function(p,y){return[].concat(p,y)},g=function(p,y){if(n(p)){for(var d=[],m=0;m<p.length;m+=1)d.push(y(p[m]));return d}return y(p)};return Tg={arrayToObject:o,assign:l,combine:O,compact:x,decode:s,encode:h,isBuffer:v,isRegExp:w,maybeMap:g,merge:a},Tg}var Ag,l_;function ZD(){if(l_)return Ag;l_=1;var t=XD(),e=uS(),n=y2(),r=Object.prototype.hasOwnProperty,i={brackets:function(b){return b+"[]"},comma:"comma",indices:function(b,p){return b+"["+p+"]"},repeat:function(b){return b}},o=Array.isArray,a=Array.prototype.push,l=function(g,b){a.apply(g,o(b)?b:[b])},s=Date.prototype.toISOString,f=n.default,h={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:e.encode,encodeValuesOnly:!1,format:f,formatter:n.formatters[f],indices:!1,serializeDate:function(b){return s.call(b)},skipNulls:!1,strictNullHandling:!1},x=function(b){return typeof b=="string"||typeof b=="number"||typeof b=="boolean"||typeof b=="symbol"||typeof b=="bigint"},w={},v=function g(b,p,y,d,m,_,A,C,R,S,E,P,T,N,U,G,Z,W){for(var H=b,L=W,M=0,D=!1;(L=L.get(w))!==void 0&&!D;){var B=L.get(b);if(M+=1,typeof B<"u"){if(B===M)throw new RangeError("Cyclic object value");D=!0}typeof L.get(w)>"u"&&(M=0)}if(typeof S=="function"?H=S(p,H):H instanceof Date?H=T(H):y==="comma"&&o(H)&&(H=e.maybeMap(H,function(he){return he instanceof Date?T(he):he})),H===null){if(_)return R&&!G?R(p,h.encoder,Z,"key",N):p;H=""}if(x(H)||e.isBuffer(H)){if(R){var V=G?p:R(p,h.encoder,Z,"key",N);return[U(V)+"="+U(R(H,h.encoder,Z,"value",N))]}return[U(p)+"="+U(String(H))]}var Y=[];if(typeof H>"u")return Y;var F;if(y==="comma"&&o(H))G&&R&&(H=e.maybeMap(H,R)),F=[{value:H.length>0?H.join(",")||null:void 0}];else if(o(S))F=S;else{var $=Object.keys(H);F=E?$.sort(E):$}var z=C?p.replace(/\./g,"%2E"):p,K=d&&o(H)&&H.length===1?z+"[]":z;if(m&&o(H)&&H.length===0)return K+"[]";for(var X=0;X<F.length;++X){var Q=F[X],J=typeof Q=="object"&&typeof Q.value<"u"?Q.value:H[Q];if(!(A&&J===null)){var ne=P&&C?Q.replace(/\./g,"%2E"):Q,ie=o(H)?typeof y=="function"?y(K,ne):K:K+(P?"."+ne:"["+ne+"]");W.set(b,M);var oe=t();oe.set(w,W),l(Y,g(J,ie,y,d,m,_,A,C,y==="comma"&&G&&o(H)?null:R,S,E,P,T,N,U,G,Z,oe))}}return Y},O=function(b){if(!b)return h;if(typeof b.allowEmptyArrays<"u"&&typeof b.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof b.encodeDotInKeys<"u"&&typeof b.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(b.encoder!==null&&typeof b.encoder<"u"&&typeof b.encoder!="function")throw new TypeError("Encoder has to be a function.");var p=b.charset||h.charset;if(typeof b.charset<"u"&&b.charset!=="utf-8"&&b.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var y=n.default;if(typeof b.format<"u"){if(!r.call(n.formatters,b.format))throw new TypeError("Unknown format option provided.");y=b.format}var d=n.formatters[y],m=h.filter;(typeof b.filter=="function"||o(b.filter))&&(m=b.filter);var _;if(b.arrayFormat in i?_=b.arrayFormat:"indices"in b?_=b.indices?"indices":"repeat":_=h.arrayFormat,"commaRoundTrip"in b&&typeof b.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var A=typeof b.allowDots>"u"?b.encodeDotInKeys===!0?!0:h.allowDots:!!b.allowDots;return{addQueryPrefix:typeof b.addQueryPrefix=="boolean"?b.addQueryPrefix:h.addQueryPrefix,allowDots:A,allowEmptyArrays:typeof b.allowEmptyArrays=="boolean"?!!b.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:_,charset:p,charsetSentinel:typeof b.charsetSentinel=="boolean"?b.charsetSentinel:h.charsetSentinel,commaRoundTrip:b.commaRoundTrip,delimiter:typeof b.delimiter>"u"?h.delimiter:b.delimiter,encode:typeof b.encode=="boolean"?b.encode:h.encode,encodeDotInKeys:typeof b.encodeDotInKeys=="boolean"?b.encodeDotInKeys:h.encodeDotInKeys,encoder:typeof b.encoder=="function"?b.encoder:h.encoder,encodeValuesOnly:typeof b.encodeValuesOnly=="boolean"?b.encodeValuesOnly:h.encodeValuesOnly,filter:m,format:y,formatter:d,serializeDate:typeof b.serializeDate=="function"?b.serializeDate:h.serializeDate,skipNulls:typeof b.skipNulls=="boolean"?b.skipNulls:h.skipNulls,sort:typeof b.sort=="function"?b.sort:null,strictNullHandling:typeof b.strictNullHandling=="boolean"?b.strictNullHandling:h.strictNullHandling}};return Ag=function(g,b){var p=g,y=O(b),d,m;typeof y.filter=="function"?(m=y.filter,p=m("",p)):o(y.filter)&&(m=y.filter,d=m);var _=[];if(typeof p!="object"||p===null)return"";var A=i[y.arrayFormat],C=A==="comma"&&y.commaRoundTrip;d||(d=Object.keys(p)),y.sort&&d.sort(y.sort);for(var R=t(),S=0;S<d.length;++S){var E=d[S];y.skipNulls&&p[E]===null||l(_,v(p[E],E,A,C,y.allowEmptyArrays,y.strictNullHandling,y.skipNulls,y.encodeDotInKeys,y.encode?y.encoder:null,y.filter,y.sort,y.allowDots,y.serializeDate,y.format,y.formatter,y.encodeValuesOnly,y.charset,R))}var P=_.join(y.delimiter),T=y.addQueryPrefix===!0?"?":"";return y.charsetSentinel&&(y.charset==="iso-8859-1"?T+="utf8=%26%2310003%3B&":T+="utf8=%E2%9C%93&"),P.length>0?T+P:""},Ag}var Rg,s_;function QD(){if(s_)return Rg;s_=1;var t=uS(),e=Object.prototype.hasOwnProperty,n=Array.isArray,r={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:t.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},i=function(w){return w.replace(/&#(\d+);/g,function(v,O){return String.fromCharCode(parseInt(O,10))})},o=function(w,v){return w&&typeof w=="string"&&v.comma&&w.indexOf(",")>-1?w.split(","):w},a="utf8=%26%2310003%3B",l="utf8=%E2%9C%93",s=function(v,O){var g={__proto__:null},b=O.ignoreQueryPrefix?v.replace(/^\?/,""):v;b=b.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var p=O.parameterLimit===1/0?void 0:O.parameterLimit,y=b.split(O.delimiter,p),d=-1,m,_=O.charset;if(O.charsetSentinel)for(m=0;m<y.length;++m)y[m].indexOf("utf8=")===0&&(y[m]===l?_="utf-8":y[m]===a&&(_="iso-8859-1"),d=m,m=y.length);for(m=0;m<y.length;++m)if(m!==d){var A=y[m],C=A.indexOf("]="),R=C===-1?A.indexOf("="):C+1,S,E;R===-1?(S=O.decoder(A,r.decoder,_,"key"),E=O.strictNullHandling?null:""):(S=O.decoder(A.slice(0,R),r.decoder,_,"key"),E=t.maybeMap(o(A.slice(R+1),O),function(T){return O.decoder(T,r.decoder,_,"value")})),E&&O.interpretNumericEntities&&_==="iso-8859-1"&&(E=i(E)),A.indexOf("[]=")>-1&&(E=n(E)?[E]:E);var P=e.call(g,S);P&&O.duplicates==="combine"?g[S]=t.combine(g[S],E):(!P||O.duplicates==="last")&&(g[S]=E)}return g},f=function(w,v,O,g){for(var b=g?v:o(v,O),p=w.length-1;p>=0;--p){var y,d=w[p];if(d==="[]"&&O.parseArrays)y=O.allowEmptyArrays&&(b===""||O.strictNullHandling&&b===null)?[]:[].concat(b);else{y=O.plainObjects?Object.create(null):{};var m=d.charAt(0)==="["&&d.charAt(d.length-1)==="]"?d.slice(1,-1):d,_=O.decodeDotInKeys?m.replace(/%2E/g,"."):m,A=parseInt(_,10);!O.parseArrays&&_===""?y={0:b}:!isNaN(A)&&d!==_&&String(A)===_&&A>=0&&O.parseArrays&&A<=O.arrayLimit?(y=[],y[A]=b):_!=="__proto__"&&(y[_]=b)}b=y}return b},h=function(v,O,g,b){if(v){var p=g.allowDots?v.replace(/\.([^.[]+)/g,"[$1]"):v,y=/(\[[^[\]]*])/,d=/(\[[^[\]]*])/g,m=g.depth>0&&y.exec(p),_=m?p.slice(0,m.index):p,A=[];if(_){if(!g.plainObjects&&e.call(Object.prototype,_)&&!g.allowPrototypes)return;A.push(_)}for(var C=0;g.depth>0&&(m=d.exec(p))!==null&&C<g.depth;){if(C+=1,!g.plainObjects&&e.call(Object.prototype,m[1].slice(1,-1))&&!g.allowPrototypes)return;A.push(m[1])}if(m){if(g.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+g.depth+" and strictDepth is true");A.push("["+p.slice(m.index)+"]")}return f(A,O,g,b)}},x=function(v){if(!v)return r;if(typeof v.allowEmptyArrays<"u"&&typeof v.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof v.decodeDotInKeys<"u"&&typeof v.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(v.decoder!==null&&typeof v.decoder<"u"&&typeof v.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof v.charset<"u"&&v.charset!=="utf-8"&&v.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var O=typeof v.charset>"u"?r.charset:v.charset,g=typeof v.duplicates>"u"?r.duplicates:v.duplicates;if(g!=="combine"&&g!=="first"&&g!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var b=typeof v.allowDots>"u"?v.decodeDotInKeys===!0?!0:r.allowDots:!!v.allowDots;return{allowDots:b,allowEmptyArrays:typeof v.allowEmptyArrays=="boolean"?!!v.allowEmptyArrays:r.allowEmptyArrays,allowPrototypes:typeof v.allowPrototypes=="boolean"?v.allowPrototypes:r.allowPrototypes,allowSparse:typeof v.allowSparse=="boolean"?v.allowSparse:r.allowSparse,arrayLimit:typeof v.arrayLimit=="number"?v.arrayLimit:r.arrayLimit,charset:O,charsetSentinel:typeof v.charsetSentinel=="boolean"?v.charsetSentinel:r.charsetSentinel,comma:typeof v.comma=="boolean"?v.comma:r.comma,decodeDotInKeys:typeof v.decodeDotInKeys=="boolean"?v.decodeDotInKeys:r.decodeDotInKeys,decoder:typeof v.decoder=="function"?v.decoder:r.decoder,delimiter:typeof v.delimiter=="string"||t.isRegExp(v.delimiter)?v.delimiter:r.delimiter,depth:typeof v.depth=="number"||v.depth===!1?+v.depth:r.depth,duplicates:g,ignoreQueryPrefix:v.ignoreQueryPrefix===!0,interpretNumericEntities:typeof v.interpretNumericEntities=="boolean"?v.interpretNumericEntities:r.interpretNumericEntities,parameterLimit:typeof v.parameterLimit=="number"?v.parameterLimit:r.parameterLimit,parseArrays:v.parseArrays!==!1,plainObjects:typeof v.plainObjects=="boolean"?v.plainObjects:r.plainObjects,strictDepth:typeof v.strictDepth=="boolean"?!!v.strictDepth:r.strictDepth,strictNullHandling:typeof v.strictNullHandling=="boolean"?v.strictNullHandling:r.strictNullHandling}};return Rg=function(w,v){var O=x(v);if(w===""||w===null||typeof w>"u")return O.plainObjects?Object.create(null):{};for(var g=typeof w=="string"?s(w,O):w,b=O.plainObjects?Object.create(null):{},p=Object.keys(g),y=0;y<p.length;++y){var d=p[y],m=h(d,g[d],O,typeof w=="string");b=t.merge(b,m,O)}return O.allowSparse===!0?b:t.compact(b)},Rg}var Mg,u_;function JD(){if(u_)return Mg;u_=1;var t=ZD(),e=QD(),n=y2();return Mg={formats:n,parse:e,stringify:t},Mg}var c_;function cS(){if(c_)return Ka;c_=1;var t=AD();function e(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var n=/^([a-z0-9.+-]+:)/i,r=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,o=["<",">",'"',"`"," ","\r",`
|
|
152
|
-
`," "],a=["{","}","|","\\","^","`"].concat(o),l=["'"].concat(a),s=["%","/","?",";","#"].concat(l),f=["/","?","#"],h=255,x=/^[+a-z0-9A-Z_-]{0,63}$/,w=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},O={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=JD();function p(_,A,C){if(_&&typeof _=="object"&&_ instanceof e)return _;var R=new e;return R.parse(_,A,C),R}e.prototype.parse=function(_,A,C){if(typeof _!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof _);var R=_.indexOf("?"),S=R!==-1&&R<_.indexOf("#")?"?":"#",E=_.split(S),P=/\\/g;E[0]=E[0].replace(P,"/"),_=E.join(S);var T=_;if(T=T.trim(),!C&&_.split("#").length===1){var N=i.exec(T);if(N)return this.path=T,this.href=T,this.pathname=N[1],N[2]?(this.search=N[2],A?this.query=b.parse(this.search.substr(1)):this.query=this.search.substr(1)):A&&(this.search="",this.query={}),this}var U=n.exec(T);if(U){U=U[0];var G=U.toLowerCase();this.protocol=G,T=T.substr(U.length)}if(C||U||T.match(/^\/\/[^@/]+@[^@/]+/)){var Z=T.substr(0,2)==="//";Z&&!(U&&O[U])&&(T=T.substr(2),this.slashes=!0)}if(!O[U]&&(Z||U&&!g[U])){for(var W=-1,H=0;H<f.length;H++){var L=T.indexOf(f[H]);L!==-1&&(W===-1||L<W)&&(W=L)}var M,D;W===-1?D=T.lastIndexOf("@"):D=T.lastIndexOf("@",W),D!==-1&&(M=T.slice(0,D),T=T.slice(D+1),this.auth=decodeURIComponent(M)),W=-1;for(var H=0;H<s.length;H++){var L=T.indexOf(s[H]);L!==-1&&(W===-1||L<W)&&(W=L)}W===-1&&(W=T.length),this.host=T.slice(0,W),T=T.slice(W),this.parseHost(),this.hostname=this.hostname||"";var B=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!B)for(var V=this.hostname.split(/\./),H=0,Y=V.length;H<Y;H++){var F=V[H];if(F&&!F.match(x)){for(var $="",z=0,K=F.length;z<K;z++)F.charCodeAt(z)>127?$+="x":$+=F[z];if(!$.match(x)){var X=V.slice(0,H),Q=V.slice(H+1),J=F.match(w);J&&(X.push(J[1]),Q.unshift(J[2])),Q.length&&(T="/"+Q.join(".")+T),this.hostname=X.join(".");break}}}this.hostname.length>h?this.hostname="":this.hostname=this.hostname.toLowerCase(),B||(this.hostname=t.toASCII(this.hostname));var ne=this.port?":"+this.port:"",ie=this.hostname||"";this.host=ie+ne,this.href+=this.host,B&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),T[0]!=="/"&&(T="/"+T))}if(!v[G])for(var H=0,Y=l.length;H<Y;H++){var oe=l[H];if(T.indexOf(oe)!==-1){var
|
|
151
|
+
`+ce.prev}function mt(ue,ce){var Se=$(ue),Le=[];if(Se){Le.length=ue.length;for(var Ne=0;Ne<ue.length;Ne++)Le[Ne]=me(ue,Ne)?ce(ue[Ne],ue):""}var ge=typeof T=="function"?T(ue):[],Xe;if(U){Xe={};for(var Oe=0;Oe<ge.length;Oe++)Xe["$"+ge[Oe]]=ge[Oe]}for(var $e in ue)me(ue,$e)&&(Se&&String(Number($e))===$e&&$e<ue.length||U&&Xe["$"+$e]instanceof Symbol||(A.call(/[^\w$]/,$e)?Le.push(ce($e,ue)+": "+ce(ue[$e],ue)):Le.push($e+": "+ce(ue[$e],ue))));if(typeof T=="function")for(var Wt=0;Wt<ge.length;Wt++)Z.call(ue,ge[Wt])&&Le.push("["+ce(ge[Wt])+"]: "+ce(ue[ge[Wt]],ue));return Le}return Pg}var Cg,i_;function XD(){if(i_)return Cg;i_=1;var t=lu(),e=VD(),n=KD(),r=nf(),i=t("%WeakMap%",!0),o=t("%Map%",!0),a=e("WeakMap.prototype.get",!0),l=e("WeakMap.prototype.set",!0),s=e("WeakMap.prototype.has",!0),f=e("Map.prototype.get",!0),h=e("Map.prototype.set",!0),x=e("Map.prototype.has",!0),w=function(b,p){for(var y=b,d;(d=y.next)!==null;y=d)if(d.key===p)return y.next=d.next,d.next=b.next,b.next=d,d},v=function(b,p){var y=w(b,p);return y&&y.value},O=function(b,p,y){var d=w(b,p);d?d.value=y:b.next={key:p,next:b.next,value:y}},g=function(b,p){return!!w(b,p)};return Cg=function(){var p,y,d,m={assert:function(_){if(!m.has(_))throw new r("Side channel does not contain "+n(_))},get:function(_){if(i&&_&&(typeof _=="object"||typeof _=="function")){if(p)return a(p,_)}else if(o){if(y)return f(y,_)}else if(d)return v(d,_)},has:function(_){if(i&&_&&(typeof _=="object"||typeof _=="function")){if(p)return s(p,_)}else if(o){if(y)return x(y,_)}else if(d)return g(d,_);return!1},set:function(_,A){i&&_&&(typeof _=="object"||typeof _=="function")?(p||(p=new i),l(p,_,A)):o?(y||(y=new o),h(y,_,A)):(d||(d={key:{},next:null}),O(d,_,A))}};return m},Cg}var kg,o_;function y2(){if(o_)return kg;o_=1;var t=String.prototype.replace,e=/%20/g,n={RFC1738:"RFC1738",RFC3986:"RFC3986"};return kg={default:n.RFC3986,formatters:{RFC1738:function(r){return t.call(r,e,"+")},RFC3986:function(r){return String(r)}},RFC1738:n.RFC1738,RFC3986:n.RFC3986},kg}var Tg,a_;function uS(){if(a_)return Tg;a_=1;var t=y2(),e=Object.prototype.hasOwnProperty,n=Array.isArray,r=function(){for(var b=[],p=0;p<256;++p)b.push("%"+((p<16?"0":"")+p.toString(16)).toUpperCase());return b}(),i=function(p){for(;p.length>1;){var y=p.pop(),d=y.obj[y.prop];if(n(d)){for(var m=[],_=0;_<d.length;++_)typeof d[_]<"u"&&m.push(d[_]);y.obj[y.prop]=m}}},o=function(p,y){for(var d=y&&y.plainObjects?Object.create(null):{},m=0;m<p.length;++m)typeof p[m]<"u"&&(d[m]=p[m]);return d},a=function b(p,y,d){if(!y)return p;if(typeof y!="object"){if(n(p))p.push(y);else if(p&&typeof p=="object")(d&&(d.plainObjects||d.allowPrototypes)||!e.call(Object.prototype,y))&&(p[y]=!0);else return[p,y];return p}if(!p||typeof p!="object")return[p].concat(y);var m=p;return n(p)&&!n(y)&&(m=o(p,d)),n(p)&&n(y)?(y.forEach(function(_,A){if(e.call(p,A)){var C=p[A];C&&typeof C=="object"&&_&&typeof _=="object"?p[A]=b(C,_,d):p.push(_)}else p[A]=_}),p):Object.keys(y).reduce(function(_,A){var C=y[A];return e.call(_,A)?_[A]=b(_[A],C,d):_[A]=C,_},m)},l=function(p,y){return Object.keys(y).reduce(function(d,m){return d[m]=y[m],d},p)},s=function(b,p,y){var d=b.replace(/\+/g," ");if(y==="iso-8859-1")return d.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(d)}catch{return d}},f=1024,h=function(p,y,d,m,_){if(p.length===0)return p;var A=p;if(typeof p=="symbol"?A=Symbol.prototype.toString.call(p):typeof p!="string"&&(A=String(p)),d==="iso-8859-1")return escape(A).replace(/%u[0-9a-f]{4}/gi,function(N){return"%26%23"+parseInt(N.slice(2),16)+"%3B"});for(var C="",R=0;R<A.length;R+=f){for(var S=A.length>=f?A.slice(R,R+f):A,E=[],P=0;P<S.length;++P){var T=S.charCodeAt(P);if(T===45||T===46||T===95||T===126||T>=48&&T<=57||T>=65&&T<=90||T>=97&&T<=122||_===t.RFC1738&&(T===40||T===41)){E[E.length]=S.charAt(P);continue}if(T<128){E[E.length]=r[T];continue}if(T<2048){E[E.length]=r[192|T>>6]+r[128|T&63];continue}if(T<55296||T>=57344){E[E.length]=r[224|T>>12]+r[128|T>>6&63]+r[128|T&63];continue}P+=1,T=65536+((T&1023)<<10|S.charCodeAt(P)&1023),E[E.length]=r[240|T>>18]+r[128|T>>12&63]+r[128|T>>6&63]+r[128|T&63]}C+=E.join("")}return C},x=function(p){for(var y=[{obj:{o:p},prop:"o"}],d=[],m=0;m<y.length;++m)for(var _=y[m],A=_.obj[_.prop],C=Object.keys(A),R=0;R<C.length;++R){var S=C[R],E=A[S];typeof E=="object"&&E!==null&&d.indexOf(E)===-1&&(y.push({obj:A,prop:S}),d.push(E))}return i(y),p},w=function(p){return Object.prototype.toString.call(p)==="[object RegExp]"},v=function(p){return!p||typeof p!="object"?!1:!!(p.constructor&&p.constructor.isBuffer&&p.constructor.isBuffer(p))},O=function(p,y){return[].concat(p,y)},g=function(p,y){if(n(p)){for(var d=[],m=0;m<p.length;m+=1)d.push(y(p[m]));return d}return y(p)};return Tg={arrayToObject:o,assign:l,combine:O,compact:x,decode:s,encode:h,isBuffer:v,isRegExp:w,maybeMap:g,merge:a},Tg}var Ag,l_;function ZD(){if(l_)return Ag;l_=1;var t=XD(),e=uS(),n=y2(),r=Object.prototype.hasOwnProperty,i={brackets:function(b){return b+"[]"},comma:"comma",indices:function(b,p){return b+"["+p+"]"},repeat:function(b){return b}},o=Array.isArray,a=Array.prototype.push,l=function(g,b){a.apply(g,o(b)?b:[b])},s=Date.prototype.toISOString,f=n.default,h={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:e.encode,encodeValuesOnly:!1,format:f,formatter:n.formatters[f],indices:!1,serializeDate:function(b){return s.call(b)},skipNulls:!1,strictNullHandling:!1},x=function(b){return typeof b=="string"||typeof b=="number"||typeof b=="boolean"||typeof b=="symbol"||typeof b=="bigint"},w={},v=function g(b,p,y,d,m,_,A,C,R,S,E,P,T,N,U,G,Z,W){for(var H=b,L=W,M=0,D=!1;(L=L.get(w))!==void 0&&!D;){var B=L.get(b);if(M+=1,typeof B<"u"){if(B===M)throw new RangeError("Cyclic object value");D=!0}typeof L.get(w)>"u"&&(M=0)}if(typeof S=="function"?H=S(p,H):H instanceof Date?H=T(H):y==="comma"&&o(H)&&(H=e.maybeMap(H,function(de){return de instanceof Date?T(de):de})),H===null){if(_)return R&&!G?R(p,h.encoder,Z,"key",N):p;H=""}if(x(H)||e.isBuffer(H)){if(R){var V=G?p:R(p,h.encoder,Z,"key",N);return[U(V)+"="+U(R(H,h.encoder,Z,"value",N))]}return[U(p)+"="+U(String(H))]}var Y=[];if(typeof H>"u")return Y;var F;if(y==="comma"&&o(H))G&&R&&(H=e.maybeMap(H,R)),F=[{value:H.length>0?H.join(",")||null:void 0}];else if(o(S))F=S;else{var $=Object.keys(H);F=E?$.sort(E):$}var z=C?p.replace(/\./g,"%2E"):p,K=d&&o(H)&&H.length===1?z+"[]":z;if(m&&o(H)&&H.length===0)return K+"[]";for(var X=0;X<F.length;++X){var Q=F[X],J=typeof Q=="object"&&typeof Q.value<"u"?Q.value:H[Q];if(!(A&&J===null)){var ne=P&&C?Q.replace(/\./g,"%2E"):Q,ie=o(H)?typeof y=="function"?y(K,ne):K:K+(P?"."+ne:"["+ne+"]");W.set(b,M);var oe=t();oe.set(w,W),l(Y,g(J,ie,y,d,m,_,A,C,y==="comma"&&G&&o(H)?null:R,S,E,P,T,N,U,G,Z,oe))}}return Y},O=function(b){if(!b)return h;if(typeof b.allowEmptyArrays<"u"&&typeof b.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof b.encodeDotInKeys<"u"&&typeof b.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(b.encoder!==null&&typeof b.encoder<"u"&&typeof b.encoder!="function")throw new TypeError("Encoder has to be a function.");var p=b.charset||h.charset;if(typeof b.charset<"u"&&b.charset!=="utf-8"&&b.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var y=n.default;if(typeof b.format<"u"){if(!r.call(n.formatters,b.format))throw new TypeError("Unknown format option provided.");y=b.format}var d=n.formatters[y],m=h.filter;(typeof b.filter=="function"||o(b.filter))&&(m=b.filter);var _;if(b.arrayFormat in i?_=b.arrayFormat:"indices"in b?_=b.indices?"indices":"repeat":_=h.arrayFormat,"commaRoundTrip"in b&&typeof b.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var A=typeof b.allowDots>"u"?b.encodeDotInKeys===!0?!0:h.allowDots:!!b.allowDots;return{addQueryPrefix:typeof b.addQueryPrefix=="boolean"?b.addQueryPrefix:h.addQueryPrefix,allowDots:A,allowEmptyArrays:typeof b.allowEmptyArrays=="boolean"?!!b.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:_,charset:p,charsetSentinel:typeof b.charsetSentinel=="boolean"?b.charsetSentinel:h.charsetSentinel,commaRoundTrip:b.commaRoundTrip,delimiter:typeof b.delimiter>"u"?h.delimiter:b.delimiter,encode:typeof b.encode=="boolean"?b.encode:h.encode,encodeDotInKeys:typeof b.encodeDotInKeys=="boolean"?b.encodeDotInKeys:h.encodeDotInKeys,encoder:typeof b.encoder=="function"?b.encoder:h.encoder,encodeValuesOnly:typeof b.encodeValuesOnly=="boolean"?b.encodeValuesOnly:h.encodeValuesOnly,filter:m,format:y,formatter:d,serializeDate:typeof b.serializeDate=="function"?b.serializeDate:h.serializeDate,skipNulls:typeof b.skipNulls=="boolean"?b.skipNulls:h.skipNulls,sort:typeof b.sort=="function"?b.sort:null,strictNullHandling:typeof b.strictNullHandling=="boolean"?b.strictNullHandling:h.strictNullHandling}};return Ag=function(g,b){var p=g,y=O(b),d,m;typeof y.filter=="function"?(m=y.filter,p=m("",p)):o(y.filter)&&(m=y.filter,d=m);var _=[];if(typeof p!="object"||p===null)return"";var A=i[y.arrayFormat],C=A==="comma"&&y.commaRoundTrip;d||(d=Object.keys(p)),y.sort&&d.sort(y.sort);for(var R=t(),S=0;S<d.length;++S){var E=d[S];y.skipNulls&&p[E]===null||l(_,v(p[E],E,A,C,y.allowEmptyArrays,y.strictNullHandling,y.skipNulls,y.encodeDotInKeys,y.encode?y.encoder:null,y.filter,y.sort,y.allowDots,y.serializeDate,y.format,y.formatter,y.encodeValuesOnly,y.charset,R))}var P=_.join(y.delimiter),T=y.addQueryPrefix===!0?"?":"";return y.charsetSentinel&&(y.charset==="iso-8859-1"?T+="utf8=%26%2310003%3B&":T+="utf8=%E2%9C%93&"),P.length>0?T+P:""},Ag}var Rg,s_;function QD(){if(s_)return Rg;s_=1;var t=uS(),e=Object.prototype.hasOwnProperty,n=Array.isArray,r={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:t.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},i=function(w){return w.replace(/&#(\d+);/g,function(v,O){return String.fromCharCode(parseInt(O,10))})},o=function(w,v){return w&&typeof w=="string"&&v.comma&&w.indexOf(",")>-1?w.split(","):w},a="utf8=%26%2310003%3B",l="utf8=%E2%9C%93",s=function(v,O){var g={__proto__:null},b=O.ignoreQueryPrefix?v.replace(/^\?/,""):v;b=b.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var p=O.parameterLimit===1/0?void 0:O.parameterLimit,y=b.split(O.delimiter,p),d=-1,m,_=O.charset;if(O.charsetSentinel)for(m=0;m<y.length;++m)y[m].indexOf("utf8=")===0&&(y[m]===l?_="utf-8":y[m]===a&&(_="iso-8859-1"),d=m,m=y.length);for(m=0;m<y.length;++m)if(m!==d){var A=y[m],C=A.indexOf("]="),R=C===-1?A.indexOf("="):C+1,S,E;R===-1?(S=O.decoder(A,r.decoder,_,"key"),E=O.strictNullHandling?null:""):(S=O.decoder(A.slice(0,R),r.decoder,_,"key"),E=t.maybeMap(o(A.slice(R+1),O),function(T){return O.decoder(T,r.decoder,_,"value")})),E&&O.interpretNumericEntities&&_==="iso-8859-1"&&(E=i(E)),A.indexOf("[]=")>-1&&(E=n(E)?[E]:E);var P=e.call(g,S);P&&O.duplicates==="combine"?g[S]=t.combine(g[S],E):(!P||O.duplicates==="last")&&(g[S]=E)}return g},f=function(w,v,O,g){for(var b=g?v:o(v,O),p=w.length-1;p>=0;--p){var y,d=w[p];if(d==="[]"&&O.parseArrays)y=O.allowEmptyArrays&&(b===""||O.strictNullHandling&&b===null)?[]:[].concat(b);else{y=O.plainObjects?Object.create(null):{};var m=d.charAt(0)==="["&&d.charAt(d.length-1)==="]"?d.slice(1,-1):d,_=O.decodeDotInKeys?m.replace(/%2E/g,"."):m,A=parseInt(_,10);!O.parseArrays&&_===""?y={0:b}:!isNaN(A)&&d!==_&&String(A)===_&&A>=0&&O.parseArrays&&A<=O.arrayLimit?(y=[],y[A]=b):_!=="__proto__"&&(y[_]=b)}b=y}return b},h=function(v,O,g,b){if(v){var p=g.allowDots?v.replace(/\.([^.[]+)/g,"[$1]"):v,y=/(\[[^[\]]*])/,d=/(\[[^[\]]*])/g,m=g.depth>0&&y.exec(p),_=m?p.slice(0,m.index):p,A=[];if(_){if(!g.plainObjects&&e.call(Object.prototype,_)&&!g.allowPrototypes)return;A.push(_)}for(var C=0;g.depth>0&&(m=d.exec(p))!==null&&C<g.depth;){if(C+=1,!g.plainObjects&&e.call(Object.prototype,m[1].slice(1,-1))&&!g.allowPrototypes)return;A.push(m[1])}if(m){if(g.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+g.depth+" and strictDepth is true");A.push("["+p.slice(m.index)+"]")}return f(A,O,g,b)}},x=function(v){if(!v)return r;if(typeof v.allowEmptyArrays<"u"&&typeof v.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof v.decodeDotInKeys<"u"&&typeof v.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(v.decoder!==null&&typeof v.decoder<"u"&&typeof v.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof v.charset<"u"&&v.charset!=="utf-8"&&v.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var O=typeof v.charset>"u"?r.charset:v.charset,g=typeof v.duplicates>"u"?r.duplicates:v.duplicates;if(g!=="combine"&&g!=="first"&&g!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var b=typeof v.allowDots>"u"?v.decodeDotInKeys===!0?!0:r.allowDots:!!v.allowDots;return{allowDots:b,allowEmptyArrays:typeof v.allowEmptyArrays=="boolean"?!!v.allowEmptyArrays:r.allowEmptyArrays,allowPrototypes:typeof v.allowPrototypes=="boolean"?v.allowPrototypes:r.allowPrototypes,allowSparse:typeof v.allowSparse=="boolean"?v.allowSparse:r.allowSparse,arrayLimit:typeof v.arrayLimit=="number"?v.arrayLimit:r.arrayLimit,charset:O,charsetSentinel:typeof v.charsetSentinel=="boolean"?v.charsetSentinel:r.charsetSentinel,comma:typeof v.comma=="boolean"?v.comma:r.comma,decodeDotInKeys:typeof v.decodeDotInKeys=="boolean"?v.decodeDotInKeys:r.decodeDotInKeys,decoder:typeof v.decoder=="function"?v.decoder:r.decoder,delimiter:typeof v.delimiter=="string"||t.isRegExp(v.delimiter)?v.delimiter:r.delimiter,depth:typeof v.depth=="number"||v.depth===!1?+v.depth:r.depth,duplicates:g,ignoreQueryPrefix:v.ignoreQueryPrefix===!0,interpretNumericEntities:typeof v.interpretNumericEntities=="boolean"?v.interpretNumericEntities:r.interpretNumericEntities,parameterLimit:typeof v.parameterLimit=="number"?v.parameterLimit:r.parameterLimit,parseArrays:v.parseArrays!==!1,plainObjects:typeof v.plainObjects=="boolean"?v.plainObjects:r.plainObjects,strictDepth:typeof v.strictDepth=="boolean"?!!v.strictDepth:r.strictDepth,strictNullHandling:typeof v.strictNullHandling=="boolean"?v.strictNullHandling:r.strictNullHandling}};return Rg=function(w,v){var O=x(v);if(w===""||w===null||typeof w>"u")return O.plainObjects?Object.create(null):{};for(var g=typeof w=="string"?s(w,O):w,b=O.plainObjects?Object.create(null):{},p=Object.keys(g),y=0;y<p.length;++y){var d=p[y],m=h(d,g[d],O,typeof w=="string");b=t.merge(b,m,O)}return O.allowSparse===!0?b:t.compact(b)},Rg}var Mg,u_;function JD(){if(u_)return Mg;u_=1;var t=ZD(),e=QD(),n=y2();return Mg={formats:n,parse:e,stringify:t},Mg}var c_;function cS(){if(c_)return Ka;c_=1;var t=AD();function e(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var n=/^([a-z0-9.+-]+:)/i,r=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,o=["<",">",'"',"`"," ","\r",`
|
|
152
|
+
`," "],a=["{","}","|","\\","^","`"].concat(o),l=["'"].concat(a),s=["%","/","?",";","#"].concat(l),f=["/","?","#"],h=255,x=/^[+a-z0-9A-Z_-]{0,63}$/,w=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},O={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=JD();function p(_,A,C){if(_&&typeof _=="object"&&_ instanceof e)return _;var R=new e;return R.parse(_,A,C),R}e.prototype.parse=function(_,A,C){if(typeof _!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof _);var R=_.indexOf("?"),S=R!==-1&&R<_.indexOf("#")?"?":"#",E=_.split(S),P=/\\/g;E[0]=E[0].replace(P,"/"),_=E.join(S);var T=_;if(T=T.trim(),!C&&_.split("#").length===1){var N=i.exec(T);if(N)return this.path=T,this.href=T,this.pathname=N[1],N[2]?(this.search=N[2],A?this.query=b.parse(this.search.substr(1)):this.query=this.search.substr(1)):A&&(this.search="",this.query={}),this}var U=n.exec(T);if(U){U=U[0];var G=U.toLowerCase();this.protocol=G,T=T.substr(U.length)}if(C||U||T.match(/^\/\/[^@/]+@[^@/]+/)){var Z=T.substr(0,2)==="//";Z&&!(U&&O[U])&&(T=T.substr(2),this.slashes=!0)}if(!O[U]&&(Z||U&&!g[U])){for(var W=-1,H=0;H<f.length;H++){var L=T.indexOf(f[H]);L!==-1&&(W===-1||L<W)&&(W=L)}var M,D;W===-1?D=T.lastIndexOf("@"):D=T.lastIndexOf("@",W),D!==-1&&(M=T.slice(0,D),T=T.slice(D+1),this.auth=decodeURIComponent(M)),W=-1;for(var H=0;H<s.length;H++){var L=T.indexOf(s[H]);L!==-1&&(W===-1||L<W)&&(W=L)}W===-1&&(W=T.length),this.host=T.slice(0,W),T=T.slice(W),this.parseHost(),this.hostname=this.hostname||"";var B=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!B)for(var V=this.hostname.split(/\./),H=0,Y=V.length;H<Y;H++){var F=V[H];if(F&&!F.match(x)){for(var $="",z=0,K=F.length;z<K;z++)F.charCodeAt(z)>127?$+="x":$+=F[z];if(!$.match(x)){var X=V.slice(0,H),Q=V.slice(H+1),J=F.match(w);J&&(X.push(J[1]),Q.unshift(J[2])),Q.length&&(T="/"+Q.join(".")+T),this.hostname=X.join(".");break}}}this.hostname.length>h?this.hostname="":this.hostname=this.hostname.toLowerCase(),B||(this.hostname=t.toASCII(this.hostname));var ne=this.port?":"+this.port:"",ie=this.hostname||"";this.host=ie+ne,this.href+=this.host,B&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),T[0]!=="/"&&(T="/"+T))}if(!v[G])for(var H=0,Y=l.length;H<Y;H++){var oe=l[H];if(T.indexOf(oe)!==-1){var de=encodeURIComponent(oe);de===oe&&(de=escape(oe)),T=T.split(oe).join(de)}}var me=T.indexOf("#");me!==-1&&(this.hash=T.substr(me),T=T.slice(0,me));var Pe=T.indexOf("?");if(Pe!==-1?(this.search=T.substr(Pe),this.query=T.substr(Pe+1),A&&(this.query=b.parse(this.query)),T=T.slice(0,Pe)):A&&(this.search="",this.query={}),T&&(this.pathname=T),g[G]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var ne=this.pathname||"",re=this.search||"";this.path=ne+re}return this.href=this.format(),this};function y(_){return typeof _=="string"&&(_=p(_)),_ instanceof e?_.format():e.prototype.format.call(_)}e.prototype.format=function(){var _=this.auth||"";_&&(_=encodeURIComponent(_),_=_.replace(/%3A/i,":"),_+="@");var A=this.protocol||"",C=this.pathname||"",R=this.hash||"",S=!1,E="";this.host?S=_+this.host:this.hostname&&(S=_+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(S+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(E=b.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var P=this.search||E&&"?"+E||"";return A&&A.substr(-1)!==":"&&(A+=":"),this.slashes||(!A||g[A])&&S!==!1?(S="//"+(S||""),C&&C.charAt(0)!=="/"&&(C="/"+C)):S||(S=""),R&&R.charAt(0)!=="#"&&(R="#"+R),P&&P.charAt(0)!=="?"&&(P="?"+P),C=C.replace(/[?#]/g,function(T){return encodeURIComponent(T)}),P=P.replace("#","%23"),A+S+C+P+R};function d(_,A){return p(_,!1,!0).resolve(A)}e.prototype.resolve=function(_){return this.resolveObject(p(_,!1,!0)).format()};function m(_,A){return _?p(_,!1,!0).resolveObject(A):A}return e.prototype.resolveObject=function(_){if(typeof _=="string"){var A=new e;A.parse(_,!1,!0),_=A}for(var C=new e,R=Object.keys(this),S=0;S<R.length;S++){var E=R[S];C[E]=this[E]}if(C.hash=_.hash,_.href==="")return C.href=C.format(),C;if(_.slashes&&!_.protocol){for(var P=Object.keys(_),T=0;T<P.length;T++){var N=P[T];N!=="protocol"&&(C[N]=_[N])}return g[C.protocol]&&C.hostname&&!C.pathname&&(C.pathname="/",C.path=C.pathname),C.href=C.format(),C}if(_.protocol&&_.protocol!==C.protocol){if(!g[_.protocol]){for(var U=Object.keys(_),G=0;G<U.length;G++){var Z=U[G];C[Z]=_[Z]}return C.href=C.format(),C}if(C.protocol=_.protocol,!_.host&&!O[_.protocol]){for(var Y=(_.pathname||"").split("/");Y.length&&!(_.host=Y.shift()););_.host||(_.host=""),_.hostname||(_.hostname=""),Y[0]!==""&&Y.unshift(""),Y.length<2&&Y.unshift(""),C.pathname=Y.join("/")}else C.pathname=_.pathname;if(C.search=_.search,C.query=_.query,C.host=_.host||"",C.auth=_.auth,C.hostname=_.hostname||_.host,C.port=_.port,C.pathname||C.search){var W=C.pathname||"",H=C.search||"";C.path=W+H}return C.slashes=C.slashes||_.slashes,C.href=C.format(),C}var L=C.pathname&&C.pathname.charAt(0)==="/",M=_.host||_.pathname&&_.pathname.charAt(0)==="/",D=M||L||C.host&&_.pathname,B=D,V=C.pathname&&C.pathname.split("/")||[],Y=_.pathname&&_.pathname.split("/")||[],F=C.protocol&&!g[C.protocol];if(F&&(C.hostname="",C.port=null,C.host&&(V[0]===""?V[0]=C.host:V.unshift(C.host)),C.host="",_.protocol&&(_.hostname=null,_.port=null,_.host&&(Y[0]===""?Y[0]=_.host:Y.unshift(_.host)),_.host=null),D=D&&(Y[0]===""||V[0]==="")),M)C.host=_.host||_.host===""?_.host:C.host,C.hostname=_.hostname||_.hostname===""?_.hostname:C.hostname,C.search=_.search,C.query=_.query,V=Y;else if(Y.length)V||(V=[]),V.pop(),V=V.concat(Y),C.search=_.search,C.query=_.query;else if(_.search!=null){if(F){C.host=V.shift(),C.hostname=C.host;var $=C.host&&C.host.indexOf("@")>0?C.host.split("@"):!1;$&&(C.auth=$.shift(),C.hostname=$.shift(),C.host=C.hostname)}return C.search=_.search,C.query=_.query,(C.pathname!==null||C.search!==null)&&(C.path=(C.pathname?C.pathname:"")+(C.search?C.search:"")),C.href=C.format(),C}if(!V.length)return C.pathname=null,C.search?C.path="/"+C.search:C.path=null,C.href=C.format(),C;for(var z=V.slice(-1)[0],K=(C.host||_.host||V.length>1)&&(z==="."||z==="..")||z==="",X=0,Q=V.length;Q>=0;Q--)z=V[Q],z==="."?V.splice(Q,1):z===".."?(V.splice(Q,1),X++):X&&(V.splice(Q,1),X--);if(!D&&!B)for(;X--;X)V.unshift("..");D&&V[0]!==""&&(!V[0]||V[0].charAt(0)!=="/")&&V.unshift(""),K&&V.join("/").substr(-1)!=="/"&&V.push("");var J=V[0]===""||V[0]&&V[0].charAt(0)==="/";if(F){C.hostname=J?"":V.length?V.shift():"",C.host=C.hostname;var $=C.host&&C.host.indexOf("@")>0?C.host.split("@"):!1;$&&(C.auth=$.shift(),C.hostname=$.shift(),C.host=C.hostname)}return D=D||C.host&&V.length,D&&!J&&V.unshift(""),V.length>0?C.pathname=V.join("/"):(C.pathname=null,C.path=null),(C.pathname!==null||C.search!==null)&&(C.path=(C.pathname?C.pathname:"")+(C.search?C.search:"")),C.auth=_.auth||C.auth,C.slashes=C.slashes||_.slashes,C.href=C.format(),C},e.prototype.parseHost=function(){var _=this.host,A=r.exec(_);A&&(A=A[0],A!==":"&&(this.port=A.substr(1)),_=_.substr(0,_.length-A.length)),_&&(this.hostname=_)},Ka.parse=p,Ka.resolve=d,Ka.resolveObject=m,Ka.format=y,Ka.Url=e,Ka}var Lg={exports:{}},f_;function ej(){return f_||(f_=1,function(t){(function(e,n){t.exports?t.exports=n():e.xmlserializer=n()})(_e,function(){var e=function(v){return v.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")},n=function(v){return v.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},r=function(v){return v.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},i=function(v){var O=v.value;return" "+v.name+'="'+n(O)+'"'},o=function(v){var O=v.tagName;return v.namespaceURI==="http://www.w3.org/1999/xhtml"&&(O=O.toLowerCase()),O},a=function(v,O){var g=Array.prototype.map.call(v.attributes||v.attrs,function(b){return b.name}).indexOf("xmlns")>=0;return!g&&(O||v.namespaceURI!==v.parentNode.namespaceURI)?' xmlns="'+v.namespaceURI+'"':""},l=function(v){return Array.prototype.map.call(v.childNodes,function(O){return w(O)}).join("")},s=function(v,O){var g="<"+o(v);return g+=a(v,O),Array.prototype.forEach.call(v.attributes||v.attrs,function(b){g+=i(b)}),v.childNodes.length>0?(g+=">",g+=l(v),g+="</"+o(v)+">"):g+="/>",g},f=function(v){var O=v.nodeValue||v.value||"";return r(O)},h=function(v){return"<!--"+v.data.replace(/-/g,"-")+"-->"},x=function(v){return"<![CDATA["+v.nodeValue+"]]>"},w=function(v,O){var g=O&&O.rootNode;if(v.nodeName==="#document"||v.nodeName==="#document-fragment")return l(v);if(v.tagName)return s(v,g);if(v.nodeName==="#text")return f(v);if(v.nodeName==="#comment")return h(v);if(v.nodeName==="#cdata-section")return x(v)};return{serializeToString:function(v){return e(w(v,{rootNode:!0}))}}})}(Lg)),Lg.exports}var Ng={},d_;function tj(){if(d_)return Ng;d_=1;var t=function(o){var a=new XMLSerializer;return Array.prototype.map.call(o.childNodes,function(l){return a.serializeToString(l)}).join("")},e=function(o){if(o.documentElement.tagName==="parsererror"&&o.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml")return o.documentElement;if((o.documentElement.tagName==="xml"||o.documentElement.tagName==="html")&&o.documentElement.childNodes&&o.documentElement.childNodes.length>0&&o.documentElement.childNodes[0].nodeName==="parsererror")return o.documentElement.childNodes[0];if(o.documentElement.tagName==="html"&&o.documentElement.childNodes&&o.documentElement.childNodes.length>0&&o.documentElement.childNodes[0].nodeName==="body"&&o.documentElement.childNodes[0].childNodes&&o.documentElement.childNodes[0].childNodes.length&&o.documentElement.childNodes[0].childNodes[0].nodeName==="parsererror")return o.documentElement.childNodes[0].childNodes[0]},n=[new RegExp(`^<h3[^>]*>This page contains the following errors:</h3><div[^>]*>(.+?)
|
|
153
153
|
?</div>`),new RegExp(`^(.+)
|
|
154
154
|
`)],r=function(o){var a=t(o),l,s;for(l=0;l<n.length;l++)if(s=n[l].exec(a),s)return s[1]},i=function(o){var a;if(o===null)throw new Error("Parse error");var l=e(o);if(l!==void 0)throw a=r(l)||"Parse error",new Error(a)};return Ng.failOnParseError=function(o){return i(o),o},Ng}var Ig={},Dg={},h_;function Qp(){return h_||(h_=1,function(t){var e=cS();t.getDocumentBaseUrl=function(l){return l.baseURI!=="about:blank"?l.baseURI:null},t.clone=function(l){var s={},f;for(f in l)l.hasOwnProperty(f)&&(s[f]=l[f]);return s},t.cloneArray=function(l){return Array.prototype.slice.apply(l,[0])},t.joinUrl=function(l,s){return l?e.resolve(l,s):s},t.isDataUri=function(l){return/^data:/.test(l)},t.collectAndReportErrors=function(l){var s=[];return Promise.all(l.map(function(f){return f.catch(function(h){s.push(h)})})).then(function(){return s})};var n=null,r=function(l,s){return s===!1||s==="none"||s==="repeated"?((n===null||s!=="repeated")&&(n=Date.now()),l+"?_="+n):l};t.ajax=function(l,s){return new Promise(function(f,h){var x=new window.XMLHttpRequest,w=t.joinUrl(s.baseUrl,l),v,O=function(){h({msg:"Unable to load url",url:w})};v=r(w,s.cache),x.addEventListener("load",function(){x.status===200||x.status===0?f(x.response):O()},!1),x.addEventListener("error",O,!1);try{x.open("GET",v,!0),x.overrideMimeType(s.mimeType),x.send(null)}catch{O()}})},t.binaryAjax=function(l,s){var f=t.clone(s);return f.mimeType="text/plain; charset=x-user-defined",t.ajax(l,f).then(function(h){for(var x="",w=0;w<h.length;w++)x+=String.fromCharCode(h.charCodeAt(w)&255);return x})};var i=function(l){var s=function(f,h){return f.substring(0,h.length)===h};return s(l,"<?xml")||s(l,"<svg")?"image/svg+xml":"image/png"};t.getDataURIForImageURL=function(l,s){return t.binaryAjax(l,s).then(function(f){var h=btoa(f),x=i(f);return"data:"+x+";base64,"+h})};var o=[],a=function(l){return o.indexOf(l)<0&&o.push(l),o.indexOf(l)};t.memoize=function(l,s,f){if(typeof f!="object")throw new Error("cacheBucket is not an object");return function(){var h=Array.prototype.slice.call(arguments),x=s(h),w=a(l),v;return f[w]&&f[w][x]?f[w][x]:(v=l.apply(null,h),f[w]=f[w]||{},f[w][x]=v,v)}}}(Dg)),Dg}var jg={},p_;function nj(){if(p_)return jg;p_=1;var t=Qp(),e=function(o,a){var l=null;o.hasAttribute("src")?l=o.getAttribute("src"):o.hasAttributeNS("http://www.w3.org/1999/xlink","href")?l=o.getAttributeNS("http://www.w3.org/1999/xlink","href"):o.hasAttribute("href")&&(l=o.getAttribute("href"));var s=t.getDocumentBaseUrl(o.ownerDocument),f=t.clone(a);return!f.baseUrl&&s&&(f.baseUrl=s),t.getDataURIForImageURL(l,f).then(function(h){return h},function(h){throw{resourceType:"image",url:h.url,msg:"Unable to load image "+h.url}})},n=function(o){return o.filter(function(a){var l=null;return a.hasAttribute("src")?l=a.getAttribute("src"):a.hasAttributeNS("http://www.w3.org/1999/xlink","href")?l=a.getAttributeNS("http://www.w3.org/1999/xlink","href"):a.hasAttribute("href")&&(l=a.getAttribute("href")),l!==null&&!t.isDataUri(l)})},r=function(o){return Array.prototype.filter.call(o,function(a){return a.type==="image"})},i=function(o){return Array.prototype.slice.call(o)};return jg.inline=function(o,a){var l=i(o.getElementsByTagName("img")),s=i(o.getElementsByTagName("image")),f=r(o.getElementsByTagName("input"));l=l.concat(s),l=l.concat(f);var h=n(l);return t.collectAndReportErrors(h.map(function(x){return e(x,a).then(function(w){x.attributes.src?x.attributes.src.value=w:x.attributes["xlink:href"]?x.attributes["xlink:href"].value=w:x.attributes.href&&(x.attributes.href.value=w)})}))},jg}var Fg={},g_;function rj(){if(g_)return Fg;g_=1;var t=Qp(),e=function(o,a){var l=o.attributes.src.value,s=t.getDocumentBaseUrl(o.ownerDocument),f=t.clone(a);return!f.baseUrl&&s&&(f.baseUrl=s),t.ajax(l,f).catch(function(h){throw{resourceType:"script",url:h.url,msg:"Unable to load script "+h.url}})},n=function(o){return o.replace(/<\//g,"<\\/")},r=function(o,a){o.attributes.removeNamedItem("src"),o.textContent=n(a)},i=function(o){var a=o.getElementsByTagName("script");return Array.prototype.filter.call(a,function(l){return!!l.attributes.src})};return Fg.inline=function(o,a){var l=i(o);return t.collectAndReportErrors(l.map(function(s){return e(s,a).then(function(f){r(s,f)})}))},Fg}var zg={},Bg={},v_;function b2(){return v_||(v_=1,function(t){t.unquoteString=function(e){var n=/^"(.*)"$/,r=/^'(.*)'$/;return n.test(e)?e.replace(n,"$1"):r.test(e)?e.replace(r,"$1"):e},t.rulesForCssText=function(e){var n=document.implementation.createHTMLDocument(""),r=document.createElement("style"),i;return r.textContent=e,n.body.appendChild(r),i=r.sheet.cssRules,Array.prototype.slice.call(i)},t.cssRulesToText=function(e){return e.reduce(function(n,r){return n+r.cssText},"")},t.exchangeRule=function(e,n,r){var i=e.indexOf(n);e[i]=t.rulesForCssText(r)[0]},t.changeFontFaceRuleSrc=function(e,n,r){var i="@font-face { font-family: "+n.style.getPropertyValue("font-family")+"; ";n.style.getPropertyValue("font-style")&&(i+="font-style: "+n.style.getPropertyValue("font-style")+"; "),n.style.getPropertyValue("font-weight")&&(i+="font-weight: "+n.style.getPropertyValue("font-weight")+"; "),n.style.getPropertyValue("unicode-range")&&(i+="unicode-range: "+n.style.getPropertyValue("unicode-range")+"; "),i+="src: "+r+"}",t.exchangeRule(e,n,i)}}(Bg)),Bg}var Ug={},m_;function ij(){return m_||(m_=1,function(t){var e=b2(),n=function(o){var a=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return o.replace(a,"$1")};t.extractCssUrl=function(o){var a=/^url\(("[^"]+"|'[^']+'|[^\)]+)\)/,l;if(!a.test(o))throw new Error("Invalid url");return l=a.exec(o)[1],e.unquoteString(n(l))};var r=function(o){var a=`\\s*(?:"[^"]*"|'[^']*'|[^\\(]+)\\s*`,l="(url\\("+a+"\\)|[^,\\s]+)",s="(?:\\s*"+l+")+",f="^\\s*("+s+")(?:\\s*,\\s*("+s+"))*\\s*$",h=new RegExp(s,"g"),x,w=[],v=function(O){var g=new RegExp(l,"g"),b=[],p;for(p=g.exec(O);p;)b.push(p[1]),p=g.exec(O);return b};if(o.match(new RegExp(f))){for(x=h.exec(o);x;)w.push(v(x[0])),x=h.exec(o);return w}return[]},i=function(o){var a,l;for(a=0;a<o.length;a++)try{return l=t.extractCssUrl(o[a]),{url:l,idx:a}}catch{}};t.parse=function(o){var a=r(o);return a.map(function(l){var s=i(l);return s?{preUrl:l.slice(0,s.idx),url:s.url,postUrl:l.slice(s.idx+1)}:{preUrl:l}})},t.serialize=function(o){var a=o.map(function(l){var s=[].concat(l.preUrl);return l.url&&s.push('url("'+l.url+'")'),l.postUrl&&(s=s.concat(l.postUrl)),s.join(" ")});return a.join(", ")}}(Ug)),Ug}function Sd(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Hg={exports:{}},y_;function oj(){return y_||(y_=1,function(t,e){(function(n){t.exports=n()})(function(){return function n(r,i,o){function a(f,h){if(!i[f]){if(!r[f]){var x=typeof Sd=="function"&&Sd;if(!h&&x)return x(f,!0);if(l)return l(f,!0);var w=new Error("Cannot find module '"+f+"'");throw w.code="MODULE_NOT_FOUND",w}var v=i[f]={exports:{}};r[f][0].call(v.exports,function(O){var g=r[f][1][O];return a(g||O)},v,v.exports,n,r,i,o)}return i[f].exports}for(var l=typeof Sd=="function"&&Sd,s=0;s<o.length;s++)a(o[s]);return a}({1:[function(n,r,i){function o(s,f){function h(){this.constructor=s}h.prototype=f.prototype,s.prototype=new h}function a(s,f,h,x){this.message=s,this.expected=f,this.found=h,this.location=x,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,a)}o(a,Error),a.buildMessage=function(s,f){var h={literal:function(p){return'"'+w(p.text)+'"'},class:function(p){var y="",d;for(d=0;d<p.parts.length;d++)y+=p.parts[d]instanceof Array?v(p.parts[d][0])+"-"+v(p.parts[d][1]):v(p.parts[d]);return"["+(p.inverted?"^":"")+y+"]"},any:function(p){return"any character"},end:function(p){return"end of input"},other:function(p){return p.description}};function x(p){return p.charCodeAt(0).toString(16).toUpperCase()}function w(p){return p.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(y){return"\\x0"+x(y)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(y){return"\\x"+x(y)})}function v(p){return p.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(y){return"\\x0"+x(y)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(y){return"\\x"+x(y)})}function O(p){return h[p.type](p)}function g(p){var y=new Array(p.length),d,m;for(d=0;d<p.length;d++)y[d]=O(p[d]);if(y.sort(),y.length>0){for(d=1,m=1;d<y.length;d++)y[d-1]!==y[d]&&(y[m]=y[d],m++);y.length=m}switch(y.length){case 1:return y[0];case 2:return y[0]+" or "+y[1];default:return y.slice(0,-1).join(", ")+", or "+y[y.length-1]}}function b(p){return p?'"'+w(p)+'"':"end of input"}return"Expected "+g(s)+" but "+b(f)+" found."};function l(s,f){f=f!==void 0?f:{};var h={},x={start:ne},w=ne,v="",O=function(){return[]},g=",",b=F(",",!1),p=function(te,fe){return[te].concat(fe)},y=function(te){return[te]},d=function(te,fe){return{url:te,format:fe}},m=function(te){return{url:te}},_="url(",A=F("url(",!1),C=")",R=F(")",!1),S=function(te){return te},E="format(",P=F("format(",!1),T="local(",N=F("local(",!1),U=function(te){return{local:te}},G=/^[^)]/,Z=$([")"],!0,!1),W=function(te){return be.extractValue(te.join(""))},H=/^[ \t\r\n\f]/,L=$([" "," ","\r",`
|
|
155
|
-
`,"\f"],!1,!1),M=0,D=[{line:1,column:1}],B=0,V=[],Y;if("startRule"in f){if(!(f.startRule in x))throw new Error(`Can't start parsing from rule "`+f.startRule+'".');w=x[f.startRule]}function F(te,fe){return{type:"literal",text:te,ignoreCase:fe}}function $(te,fe,de){return{type:"class",parts:te,inverted:fe,ignoreCase:de}}function z(){return{type:"end"}}function K(te){var fe=D[te],de;if(fe)return fe;for(de=te-1;!D[de];)de--;for(fe=D[de],fe={line:fe.line,column:fe.column};de<te;)s.charCodeAt(de)===10?(fe.line++,fe.column=1):fe.column++,de++;return D[te]=fe,fe}function X(te,fe){var de=K(te),Ee=K(fe);return{start:{offset:te,line:de.line,column:de.column},end:{offset:fe,line:Ee.line,column:Ee.column}}}function Q(te){M<B||(M>B&&(B=M,V=[]),V.push(te))}function J(te,fe,de){return new a(a.buildMessage(te,fe),te,fe,de)}function ne(){var te,fe;return te=ie(),te===h&&(te=M,fe=v,fe!==h&&(fe=O()),te=fe),te}function ie(){var te,fe,de,Ee,Ve,Je;if(te=M,fe=oe(),fe!==h){for(de=[],Ee=we();Ee!==h;)de.push(Ee),Ee=we();if(de!==h)if(s.charCodeAt(M)===44?(Ee=g,M++):(Ee=h,Q(b)),Ee!==h){for(Ve=[],Je=we();Je!==h;)Ve.push(Je),Je=we();Ve!==h?(Je=ie(),Je!==h?(fe=p(fe,Je),te=fe):(M=te,te=h)):(M=te,te=h)}else M=te,te=h;else M=te,te=h}else M=te,te=h;return te===h&&(te=M,fe=oe(),fe!==h&&(fe=y(fe)),te=fe),te}function oe(){var te;return te=he(),te===h&&(te=re()),te}function he(){var te,fe,de,Ee;if(te=M,fe=me(),fe!==h){if(de=[],Ee=we(),Ee!==h)for(;Ee!==h;)de.push(Ee),Ee=we();else de=h;de!==h?(Ee=Pe(),Ee!==h?(fe=d(fe,Ee),te=fe):(M=te,te=h)):(M=te,te=h)}else M=te,te=h;return te===h&&(te=M,fe=me(),fe!==h&&(fe=m(fe)),te=fe),te}function me(){var te,fe,de,Ee;return te=M,s.substr(M,4)===_?(fe=_,M+=4):(fe=h,Q(A)),fe!==h?(de=ae(),de!==h?(s.charCodeAt(M)===41?(Ee=C,M++):(Ee=h,Q(R)),Ee!==h?(fe=S(de),te=fe):(M=te,te=h)):(M=te,te=h)):(M=te,te=h),te}function Pe(){var te,fe,de,Ee;return te=M,s.substr(M,7)===E?(fe=E,M+=7):(fe=h,Q(P)),fe!==h?(de=ae(),de!==h?(s.charCodeAt(M)===41?(Ee=C,M++):(Ee=h,Q(R)),Ee!==h?(fe=S(de),te=fe):(M=te,te=h)):(M=te,te=h)):(M=te,te=h),te}function re(){var te,fe,de,Ee;return te=M,s.substr(M,6)===T?(fe=T,M+=6):(fe=h,Q(N)),fe!==h?(de=ae(),de!==h?(s.charCodeAt(M)===41?(Ee=C,M++):(Ee=h,Q(R)),Ee!==h?(fe=U(de),te=fe):(M=te,te=h)):(M=te,te=h)):(M=te,te=h),te}function ae(){var te,fe,de;if(te=M,fe=[],G.test(s.charAt(M))?(de=s.charAt(M),M++):(de=h,Q(Z)),de!==h)for(;de!==h;)fe.push(de),G.test(s.charAt(M))?(de=s.charAt(M),M++):(de=h,Q(Z));else fe=h;return fe!==h&&(fe=W(fe)),te=fe,te}function we(){var te;return H.test(s.charAt(M))?(te=s.charAt(M),M++):(te=h,Q(L)),te}var be=n("../util");if(Y=w(),Y!==h&&M===s.length)return Y;throw Y!==h&&M<s.length&&Q(z()),J(V,B<s.length?s.charAt(B):null,B<s.length?X(B,B+1):X(B,B))}r.exports={SyntaxError:a,parse:l}},{"../util":3}],2:[function(n,r,i){var o=n("./grammar");i.SyntaxError=function(a,l){this.message=a,this.offset=l},i.parse=function(a){try{return o.parse(a)}catch(l){throw new i.SyntaxError(l.message,l.offset)}},i.serialize=function(a){return a.map(function(l){var s;return l.url?(s='url("'+l.url+'")',l.format&&(s+=' format("'+l.format+'")')):s='local("'+l.local+'")',s}).join(", ")}},{"./grammar":1}],3:[function(n,r,i){var o=function(l){var s=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return l.replace(s,"$1")},a=function(l){var s=/^"(.*)"$/,f=/^'(.*)'$/;return s.test(l)?l.replace(s,"$1"):f.test(l)?l.replace(f,"$1"):l};i.extractValue=function(l){return a(o(l))}},{}]},{},[2])(2)})}(Hg)),Hg.exports}var b_;function aj(){return b_||(b_=1,function(t){var e=Qp(),n=b2(),r=ij(),i=oj(),o=function(y,d,m){y.style.setProperty(d,m,y.style.getPropertyPriority(d))},a=function(y){return y.filter(function(d){return d.type===window.CSSRule.STYLE_RULE&&(d.style.getPropertyValue("background-image")||d.style.getPropertyValue("background"))})},l=function(y){var d=[];return y.forEach(function(m){m.style.getPropertyValue("background-image")?d.push({property:"background-image",value:m.style.getPropertyValue("background-image"),rule:m}):m.style.getPropertyValue("background")&&d.push({property:"background",value:m.style.getPropertyValue("background"),rule:m})}),d},s=function(y){return y.filter(function(d){return d.type===window.CSSRule.FONT_FACE_RULE&&d.style.getPropertyValue("src")})},f=function(y){return y.filter(function(d){return d.type===window.CSSRule.IMPORT_RULE&&d.href})},h=function(y){var d=[];return y.forEach(function(m,_){m.url&&!e.isDataUri(m.url)&&d.push(_)}),d},x=function(y){var d=[];return y.forEach(function(m,_){m.url&&!e.isDataUri(m.url)&&d.push(_)}),d};t.adjustPathsOfCssResources=function(y,d){var m=a(d),_=l(m),A=!1;return _.forEach(function(C){var R=r.parse(C.value),S=h(R),E;S.length>0&&(S.forEach(function(P){var T=R[P].url,N=e.joinUrl(y,T);R[P].url=N}),E=r.serialize(R),o(C.rule,C.property,E),A=!0)}),s(d).forEach(function(C){var R=C.style.getPropertyValue("src"),S,E;try{S=i.parse(R)}catch{return}E=x(S),E.length>0&&(E.forEach(function(P){var T=S[P].url,N=e.joinUrl(y,T);S[P].url=N}),n.changeFontFaceRuleSrc(d,C,i.serialize(S)),A=!0)}),f(d).forEach(function(C){var R=C.href,S=e.joinUrl(y,R);n.exchangeRule(d,C,"@import url("+S+");"),A=!0}),A};var w=function(y,d,m){var _=y.indexOf(d);y.splice(_,1),m.forEach(function(A,C){y.splice(_+C,0,A)})},v=function(y,d,m,_){var A=d.href,C;return A=n.unquoteString(A),C=e.joinUrl(_.baseUrl,A),m.indexOf(C)>=0?(w(y,d,[]),Promise.resolve([])):(m.push(C),e.ajax(A,_).then(function(R){var S=n.rulesForCssText(R);return t.loadCSSImportsForRules(S,m,_).then(function(E){return t.adjustPathsOfCssResources(A,S),w(y,d,S),E.errors})},function(R){throw{resourceType:"stylesheet",url:R.url,msg:"Unable to load stylesheet "+R.url}}))};t.loadCSSImportsForRules=function(y,d,m){var _=f(y),A=[],C=!1;return Promise.all(_.map(function(R){return v(y,R,d,m).then(function(S){A=A.concat(S),C=!0},function(S){A.push(S)})})).then(function(){return{hasChanges:C,errors:A}})};var O=function(y,d){var m=r.parse(y),_=h(m),A=!1;return e.collectAndReportErrors(_.map(function(C){var R=m[C].url;return e.getDataURIForImageURL(R,d).then(function(S){m[C].url=S,A=!0},function(S){throw{resourceType:"backgroundImage",url:S.url,msg:"Unable to load background-image "+S.url}})})).then(function(C){return{backgroundValue:r.serialize(m),hasChanges:A,errors:C}})},g=function(y,d){var m=a(y),_=l(m),A=[],C=!1;return Promise.all(_.map(function(R){return O(R.value,d).then(function(S){S.hasChanges&&(o(R.rule,R.property,S.backgroundValue),C=!0),A=A.concat(S.errors)})})).then(function(){return{hasChanges:C,errors:A}})},b=function(y,d){var m=!1,_,A;try{_=i.parse(y)}catch{_=[]}return A=x(_),e.collectAndReportErrors(A.map(function(C){var R=_[C],S=R.format||"woff";return e.binaryAjax(R.url,d).then(function(E){var P=btoa(E);R.url="data:font/"+S+";base64,"+P,m=!0},function(E){throw{resourceType:"fontFace",url:E.url,msg:"Unable to load font-face "+E.url}})})).then(function(C){return{srcDeclarationValue:i.serialize(_),hasChanges:m,errors:C}})},p=function(y,d){var m=s(y),_=[],A=!1;return Promise.all(m.map(function(C){var R=C.style.getPropertyValue("src");return b(R,d).then(function(S){S.hasChanges&&(n.changeFontFaceRuleSrc(y,C,S.srcDeclarationValue),A=!0),_=_.concat(S.errors)})})).then(function(){return{hasChanges:A,errors:_}})};t.loadAndInlineCSSResourcesForRules=function(y,d){var m=!1,_=[];return Promise.all([g,p].map(function(A){return A(y,d).then(function(C){m=m||C.hasChanges,_=_.concat(C.errors)})})).then(function(){return{hasChanges:m,errors:_}})}}(zg)),zg}var __;function lj(){return __||(__=1,function(t){var e=Qp(),n=nj(),r=rj(),i=aj(),o=b2(),a=function(b){return e.joinUrl(b,".")},l=function(b){var p=b.map(function(y,d){return d===b.length-1&&(y={baseUrl:a(y.baseUrl)}),JSON.stringify(y)});return p},s=function(b,p){return p.cache!==!1&&p.cache!=="none"&&p.cacheBucket?e.memoize(b,l,p.cacheBucket):b},f=function(b,p,y){var d=o.rulesForCssText(b);return i.loadCSSImportsForRules(d,p,y).then(function(m){return i.loadAndInlineCSSResourcesForRules(d,y).then(function(_){var A=m.errors.concat(_.errors),C=m.hasChanges||_.hasChanges;return C&&(b=o.cssRulesToText(d)),{hasChanges:C,content:b,errors:A}})})},h=function(b,p,y){var d=b.textContent,m=s(f,p);return m(d,y,p).then(function(_){return _.hasChanges&&(b.childNodes[0].nodeValue=_.content),e.cloneArray(_.errors)})},x=function(b){var p=b.getElementsByTagName("style");return Array.prototype.filter.call(p,function(y){return!y.attributes.type||y.attributes.type.value==="text/css"})};t.loadAndInlineStyles=function(b,p){var y=x(b),d=[],m=[],_;return _=e.clone(p),_.baseUrl=_.baseUrl||e.getDocumentBaseUrl(b),Promise.all(y.map(function(A){return h(A,_,m).then(function(C){d=d.concat(C)})})).then(function(){return d})};var w=function(b,p){var y=b.parentNode,d;p=p.trim(),p&&(d=b.ownerDocument.createElement("style"),d.type="text/css",d.appendChild(b.ownerDocument.createTextNode(p)),y.insertBefore(d,b)),y.removeChild(b)},v=function(b,p){return e.ajax(b,p).then(function(y){var d=o.rulesForCssText(y);return{content:y,cssRules:d}}).then(function(y){var d=i.adjustPathsOfCssResources(b,y.cssRules);return{content:y.content,cssRules:y.cssRules,hasChanges:d}}).then(function(y){return i.loadCSSImportsForRules(y.cssRules,[],p).then(function(d){return{content:y.content,cssRules:y.cssRules,hasChanges:y.hasChanges||d.hasChanges,errors:d.errors}})}).then(function(y){return i.loadAndInlineCSSResourcesForRules(y.cssRules,p).then(function(d){return{content:y.content,cssRules:y.cssRules,hasChanges:y.hasChanges||d.hasChanges,errors:y.errors.concat(d.errors)}})}).then(function(y){var d=y.content;return y.hasChanges&&(d=o.cssRulesToText(y.cssRules)),{content:d,errors:y.errors}})},O=function(b,p){var y=b.attributes.href.value,d=e.getDocumentBaseUrl(b.ownerDocument),m=e.clone(p);!m.baseUrl&&d&&(m.baseUrl=d);var _=s(v,p);return _(y,m).then(function(A){return{content:A.content,errors:e.cloneArray(A.errors)}})},g=function(b){var p=b.getElementsByTagName("link");return Array.prototype.filter.call(p,function(y){return y.attributes.rel&&y.attributes.rel.value==="stylesheet"&&(!y.attributes.type||y.attributes.type.value==="text/css")})};t.loadAndInlineCssLinks=function(b,p){var y=g(b),d=[];return Promise.all(y.map(function(m){return O(m,p).then(function(_){w(m,_.content+`
|
|
155
|
+
`,"\f"],!1,!1),M=0,D=[{line:1,column:1}],B=0,V=[],Y;if("startRule"in f){if(!(f.startRule in x))throw new Error(`Can't start parsing from rule "`+f.startRule+'".');w=x[f.startRule]}function F(te,fe){return{type:"literal",text:te,ignoreCase:fe}}function $(te,fe,he){return{type:"class",parts:te,inverted:fe,ignoreCase:he}}function z(){return{type:"end"}}function K(te){var fe=D[te],he;if(fe)return fe;for(he=te-1;!D[he];)he--;for(fe=D[he],fe={line:fe.line,column:fe.column};he<te;)s.charCodeAt(he)===10?(fe.line++,fe.column=1):fe.column++,he++;return D[te]=fe,fe}function X(te,fe){var he=K(te),Ee=K(fe);return{start:{offset:te,line:he.line,column:he.column},end:{offset:fe,line:Ee.line,column:Ee.column}}}function Q(te){M<B||(M>B&&(B=M,V=[]),V.push(te))}function J(te,fe,he){return new a(a.buildMessage(te,fe),te,fe,he)}function ne(){var te,fe;return te=ie(),te===h&&(te=M,fe=v,fe!==h&&(fe=O()),te=fe),te}function ie(){var te,fe,he,Ee,Ve,Je;if(te=M,fe=oe(),fe!==h){for(he=[],Ee=we();Ee!==h;)he.push(Ee),Ee=we();if(he!==h)if(s.charCodeAt(M)===44?(Ee=g,M++):(Ee=h,Q(b)),Ee!==h){for(Ve=[],Je=we();Je!==h;)Ve.push(Je),Je=we();Ve!==h?(Je=ie(),Je!==h?(fe=p(fe,Je),te=fe):(M=te,te=h)):(M=te,te=h)}else M=te,te=h;else M=te,te=h}else M=te,te=h;return te===h&&(te=M,fe=oe(),fe!==h&&(fe=y(fe)),te=fe),te}function oe(){var te;return te=de(),te===h&&(te=re()),te}function de(){var te,fe,he,Ee;if(te=M,fe=me(),fe!==h){if(he=[],Ee=we(),Ee!==h)for(;Ee!==h;)he.push(Ee),Ee=we();else he=h;he!==h?(Ee=Pe(),Ee!==h?(fe=d(fe,Ee),te=fe):(M=te,te=h)):(M=te,te=h)}else M=te,te=h;return te===h&&(te=M,fe=me(),fe!==h&&(fe=m(fe)),te=fe),te}function me(){var te,fe,he,Ee;return te=M,s.substr(M,4)===_?(fe=_,M+=4):(fe=h,Q(A)),fe!==h?(he=ae(),he!==h?(s.charCodeAt(M)===41?(Ee=C,M++):(Ee=h,Q(R)),Ee!==h?(fe=S(he),te=fe):(M=te,te=h)):(M=te,te=h)):(M=te,te=h),te}function Pe(){var te,fe,he,Ee;return te=M,s.substr(M,7)===E?(fe=E,M+=7):(fe=h,Q(P)),fe!==h?(he=ae(),he!==h?(s.charCodeAt(M)===41?(Ee=C,M++):(Ee=h,Q(R)),Ee!==h?(fe=S(he),te=fe):(M=te,te=h)):(M=te,te=h)):(M=te,te=h),te}function re(){var te,fe,he,Ee;return te=M,s.substr(M,6)===T?(fe=T,M+=6):(fe=h,Q(N)),fe!==h?(he=ae(),he!==h?(s.charCodeAt(M)===41?(Ee=C,M++):(Ee=h,Q(R)),Ee!==h?(fe=U(he),te=fe):(M=te,te=h)):(M=te,te=h)):(M=te,te=h),te}function ae(){var te,fe,he;if(te=M,fe=[],G.test(s.charAt(M))?(he=s.charAt(M),M++):(he=h,Q(Z)),he!==h)for(;he!==h;)fe.push(he),G.test(s.charAt(M))?(he=s.charAt(M),M++):(he=h,Q(Z));else fe=h;return fe!==h&&(fe=W(fe)),te=fe,te}function we(){var te;return H.test(s.charAt(M))?(te=s.charAt(M),M++):(te=h,Q(L)),te}var be=n("../util");if(Y=w(),Y!==h&&M===s.length)return Y;throw Y!==h&&M<s.length&&Q(z()),J(V,B<s.length?s.charAt(B):null,B<s.length?X(B,B+1):X(B,B))}r.exports={SyntaxError:a,parse:l}},{"../util":3}],2:[function(n,r,i){var o=n("./grammar");i.SyntaxError=function(a,l){this.message=a,this.offset=l},i.parse=function(a){try{return o.parse(a)}catch(l){throw new i.SyntaxError(l.message,l.offset)}},i.serialize=function(a){return a.map(function(l){var s;return l.url?(s='url("'+l.url+'")',l.format&&(s+=' format("'+l.format+'")')):s='local("'+l.local+'")',s}).join(", ")}},{"./grammar":1}],3:[function(n,r,i){var o=function(l){var s=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return l.replace(s,"$1")},a=function(l){var s=/^"(.*)"$/,f=/^'(.*)'$/;return s.test(l)?l.replace(s,"$1"):f.test(l)?l.replace(f,"$1"):l};i.extractValue=function(l){return a(o(l))}},{}]},{},[2])(2)})}(Hg)),Hg.exports}var b_;function aj(){return b_||(b_=1,function(t){var e=Qp(),n=b2(),r=ij(),i=oj(),o=function(y,d,m){y.style.setProperty(d,m,y.style.getPropertyPriority(d))},a=function(y){return y.filter(function(d){return d.type===window.CSSRule.STYLE_RULE&&(d.style.getPropertyValue("background-image")||d.style.getPropertyValue("background"))})},l=function(y){var d=[];return y.forEach(function(m){m.style.getPropertyValue("background-image")?d.push({property:"background-image",value:m.style.getPropertyValue("background-image"),rule:m}):m.style.getPropertyValue("background")&&d.push({property:"background",value:m.style.getPropertyValue("background"),rule:m})}),d},s=function(y){return y.filter(function(d){return d.type===window.CSSRule.FONT_FACE_RULE&&d.style.getPropertyValue("src")})},f=function(y){return y.filter(function(d){return d.type===window.CSSRule.IMPORT_RULE&&d.href})},h=function(y){var d=[];return y.forEach(function(m,_){m.url&&!e.isDataUri(m.url)&&d.push(_)}),d},x=function(y){var d=[];return y.forEach(function(m,_){m.url&&!e.isDataUri(m.url)&&d.push(_)}),d};t.adjustPathsOfCssResources=function(y,d){var m=a(d),_=l(m),A=!1;return _.forEach(function(C){var R=r.parse(C.value),S=h(R),E;S.length>0&&(S.forEach(function(P){var T=R[P].url,N=e.joinUrl(y,T);R[P].url=N}),E=r.serialize(R),o(C.rule,C.property,E),A=!0)}),s(d).forEach(function(C){var R=C.style.getPropertyValue("src"),S,E;try{S=i.parse(R)}catch{return}E=x(S),E.length>0&&(E.forEach(function(P){var T=S[P].url,N=e.joinUrl(y,T);S[P].url=N}),n.changeFontFaceRuleSrc(d,C,i.serialize(S)),A=!0)}),f(d).forEach(function(C){var R=C.href,S=e.joinUrl(y,R);n.exchangeRule(d,C,"@import url("+S+");"),A=!0}),A};var w=function(y,d,m){var _=y.indexOf(d);y.splice(_,1),m.forEach(function(A,C){y.splice(_+C,0,A)})},v=function(y,d,m,_){var A=d.href,C;return A=n.unquoteString(A),C=e.joinUrl(_.baseUrl,A),m.indexOf(C)>=0?(w(y,d,[]),Promise.resolve([])):(m.push(C),e.ajax(A,_).then(function(R){var S=n.rulesForCssText(R);return t.loadCSSImportsForRules(S,m,_).then(function(E){return t.adjustPathsOfCssResources(A,S),w(y,d,S),E.errors})},function(R){throw{resourceType:"stylesheet",url:R.url,msg:"Unable to load stylesheet "+R.url}}))};t.loadCSSImportsForRules=function(y,d,m){var _=f(y),A=[],C=!1;return Promise.all(_.map(function(R){return v(y,R,d,m).then(function(S){A=A.concat(S),C=!0},function(S){A.push(S)})})).then(function(){return{hasChanges:C,errors:A}})};var O=function(y,d){var m=r.parse(y),_=h(m),A=!1;return e.collectAndReportErrors(_.map(function(C){var R=m[C].url;return e.getDataURIForImageURL(R,d).then(function(S){m[C].url=S,A=!0},function(S){throw{resourceType:"backgroundImage",url:S.url,msg:"Unable to load background-image "+S.url}})})).then(function(C){return{backgroundValue:r.serialize(m),hasChanges:A,errors:C}})},g=function(y,d){var m=a(y),_=l(m),A=[],C=!1;return Promise.all(_.map(function(R){return O(R.value,d).then(function(S){S.hasChanges&&(o(R.rule,R.property,S.backgroundValue),C=!0),A=A.concat(S.errors)})})).then(function(){return{hasChanges:C,errors:A}})},b=function(y,d){var m=!1,_,A;try{_=i.parse(y)}catch{_=[]}return A=x(_),e.collectAndReportErrors(A.map(function(C){var R=_[C],S=R.format||"woff";return e.binaryAjax(R.url,d).then(function(E){var P=btoa(E);R.url="data:font/"+S+";base64,"+P,m=!0},function(E){throw{resourceType:"fontFace",url:E.url,msg:"Unable to load font-face "+E.url}})})).then(function(C){return{srcDeclarationValue:i.serialize(_),hasChanges:m,errors:C}})},p=function(y,d){var m=s(y),_=[],A=!1;return Promise.all(m.map(function(C){var R=C.style.getPropertyValue("src");return b(R,d).then(function(S){S.hasChanges&&(n.changeFontFaceRuleSrc(y,C,S.srcDeclarationValue),A=!0),_=_.concat(S.errors)})})).then(function(){return{hasChanges:A,errors:_}})};t.loadAndInlineCSSResourcesForRules=function(y,d){var m=!1,_=[];return Promise.all([g,p].map(function(A){return A(y,d).then(function(C){m=m||C.hasChanges,_=_.concat(C.errors)})})).then(function(){return{hasChanges:m,errors:_}})}}(zg)),zg}var __;function lj(){return __||(__=1,function(t){var e=Qp(),n=nj(),r=rj(),i=aj(),o=b2(),a=function(b){return e.joinUrl(b,".")},l=function(b){var p=b.map(function(y,d){return d===b.length-1&&(y={baseUrl:a(y.baseUrl)}),JSON.stringify(y)});return p},s=function(b,p){return p.cache!==!1&&p.cache!=="none"&&p.cacheBucket?e.memoize(b,l,p.cacheBucket):b},f=function(b,p,y){var d=o.rulesForCssText(b);return i.loadCSSImportsForRules(d,p,y).then(function(m){return i.loadAndInlineCSSResourcesForRules(d,y).then(function(_){var A=m.errors.concat(_.errors),C=m.hasChanges||_.hasChanges;return C&&(b=o.cssRulesToText(d)),{hasChanges:C,content:b,errors:A}})})},h=function(b,p,y){var d=b.textContent,m=s(f,p);return m(d,y,p).then(function(_){return _.hasChanges&&(b.childNodes[0].nodeValue=_.content),e.cloneArray(_.errors)})},x=function(b){var p=b.getElementsByTagName("style");return Array.prototype.filter.call(p,function(y){return!y.attributes.type||y.attributes.type.value==="text/css"})};t.loadAndInlineStyles=function(b,p){var y=x(b),d=[],m=[],_;return _=e.clone(p),_.baseUrl=_.baseUrl||e.getDocumentBaseUrl(b),Promise.all(y.map(function(A){return h(A,_,m).then(function(C){d=d.concat(C)})})).then(function(){return d})};var w=function(b,p){var y=b.parentNode,d;p=p.trim(),p&&(d=b.ownerDocument.createElement("style"),d.type="text/css",d.appendChild(b.ownerDocument.createTextNode(p)),y.insertBefore(d,b)),y.removeChild(b)},v=function(b,p){return e.ajax(b,p).then(function(y){var d=o.rulesForCssText(y);return{content:y,cssRules:d}}).then(function(y){var d=i.adjustPathsOfCssResources(b,y.cssRules);return{content:y.content,cssRules:y.cssRules,hasChanges:d}}).then(function(y){return i.loadCSSImportsForRules(y.cssRules,[],p).then(function(d){return{content:y.content,cssRules:y.cssRules,hasChanges:y.hasChanges||d.hasChanges,errors:d.errors}})}).then(function(y){return i.loadAndInlineCSSResourcesForRules(y.cssRules,p).then(function(d){return{content:y.content,cssRules:y.cssRules,hasChanges:y.hasChanges||d.hasChanges,errors:y.errors.concat(d.errors)}})}).then(function(y){var d=y.content;return y.hasChanges&&(d=o.cssRulesToText(y.cssRules)),{content:d,errors:y.errors}})},O=function(b,p){var y=b.attributes.href.value,d=e.getDocumentBaseUrl(b.ownerDocument),m=e.clone(p);!m.baseUrl&&d&&(m.baseUrl=d);var _=s(v,p);return _(y,m).then(function(A){return{content:A.content,errors:e.cloneArray(A.errors)}})},g=function(b){var p=b.getElementsByTagName("link");return Array.prototype.filter.call(p,function(y){return y.attributes.rel&&y.attributes.rel.value==="stylesheet"&&(!y.attributes.type||y.attributes.type.value==="text/css")})};t.loadAndInlineCssLinks=function(b,p){var y=g(b),d=[];return Promise.all(y.map(function(m){return O(m,p).then(function(_){w(m,_.content+`
|
|
156
156
|
`),d=d.concat(_.errors)},function(_){d.push({resourceType:"stylesheet",url:_.url,msg:"Unable to load stylesheet "+_.url})})})).then(function(){return d})},t.loadAndInlineImages=n.inline,t.loadAndInlineScript=r.inline,t.inlineReferences=function(b,p){var y=[],d=[t.loadAndInlineImages,t.loadAndInlineStyles,t.loadAndInlineCssLinks];return p.inlineScripts!==!1&&d.push(t.loadAndInlineScript),Promise.all(d.map(function(m){return m(b,p).then(function(_){y=y.concat(_)})})).then(function(){return y})}}(Ig)),Ig}/*! rasterizeHTML.js - v1.3.1 - 2022-01-16
|
|
157
157
|
* http://www.github.com/cburgmer/rasterizeHTML.js
|
|
158
158
|
* Copyright (c) 2022 Christoph Burgmer; Licensed MIT */(function(t){(function(e,n){e===void 0&&window!==void 0&&(e=window),t.exports?t.exports=n(cS(),ej(),tj(),lj()):e.rasterizeHTML=n(e.url,e.xmlserializer,e.sanedomparsererror,e.inlineresources)})(_e,function(e,n,r,i){var o=function(O){var g={},b=[];g.joinUrl=function(d,m){return d?O.resolve(d,m):m},g.getConstantUniqueIdFor=function(d){return b.indexOf(d)<0&&b.push(d),b.indexOf(d)},g.clone=function(d){var m={},_;for(_ in d)d.hasOwnProperty(_)&&(m[_]=d[_]);return m};var p=function(d){return typeof d=="object"&&d!==null},y=function(d){return p(d)&&Object.prototype.toString.apply(d).match(/\[object (Canvas|HTMLCanvasElement)\]/i)};return g.parseOptionalParameters=function(d){var m={canvas:null,options:{}};return d[0]==null||y(d[0])?(m.canvas=d[0]||null,m.options=g.clone(d[1])):m.options=g.clone(d[0]),m},g}(e),a=function(O){var g={},b=function(p,y,d){var m=p[y];return p[y]=function(){var _=Array.prototype.slice.call(arguments);return d.apply(this,[_,m])},m};return g.baseUrlRespectingXhr=function(p,y){var d=function(){var m=new p;return b(m,"open",function(_,A){var C=_.shift(),R=_.shift(),S=O.joinUrl(y,R);return A.apply(this,[C,S].concat(_))}),m};return d},g.finishNotifyingXhr=function(p){var y=0,d=0,m=!1,_,A=new Promise(function(R){_=function(){var S=y-d;S<=0&&m&&R({totalCount:y})}}),C=function(){var R=new p;return b(R,"send",function(S,E){return y+=1,E.apply(this,arguments)}),R.addEventListener("load",function(){d+=1,_()}),R};return C.waitForRequestsToFinish=function(){return m=!0,_(),A},C},g}(o),l=function(){var O={},g=function(C){return Array.prototype.slice.call(C)};O.addClassName=function(C,R){C.className+=" "+R},O.addClassNameRecursively=function(C,R){O.addClassName(C,R),C.parentNode!==C.ownerDocument&&O.addClassNameRecursively(C.parentNode,R)};var b=function(C,R){var S=C.parentStyleSheet,E=g(S.cssRules).indexOf(C);S.insertRule(R,E+1),S.deleteRule(E)},p=function(C,R){var S=C.cssText.replace(/^[^\{]+/,""),E=R+" "+S;b(C,E)},y=function(C){return g(C).reduce(function(R,S){return R+S.cssText},"")},d=function(C){C.textContent=y(C.sheet.cssRules)},m=function(C){var R=document.implementation.createHTMLDocument(""),S=document.createElement("style");S.textContent=C.textContent,R.body.appendChild(S),C.sheet=S.sheet},_=function(C){return"((?:^|[^.#:\\w])|(?=\\W))("+C.join("|")+")(?=\\W|$)"},A=function(C,R,S){var E=_(R);g(C.querySelectorAll("style")).forEach(function(P){typeof P.sheet>"u"&&m(P);var T=g(P.sheet.cssRules).filter(function(N){return N.selectorText&&new RegExp(E,"i").test(N.selectorText)});T.length&&(T.forEach(function(N){var U=N.selectorText.replace(new RegExp(E,"gi"),function(G,Z,W){return Z+S(W)});U!==N.selectorText&&p(N,U)}),d(P))})};return O.rewriteCssSelectorWith=function(C,R,S){A(C,[R],function(){return S})},O.lowercaseCssTypeSelectors=function(C,R){A(C,R,function(S){return S.toLowerCase()})},O.findHtmlOnlyNodeNames=function(C){var R=C.ownerDocument.createTreeWalker(C,NodeFilter.SHOW_ELEMENT),S={},E={},P;do P=R.currentNode.tagName.toLowerCase(),R.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?S[P]=!0:E[P]=!0;while(R.nextNode());return Object.keys(S).filter(function(T){return!E[T]})},O}(),s=function(O){var g={},b=function(y){return Array.prototype.slice.call(y)},p={active:!0,hover:!0,focus:!1,target:!1};return g.fakeUserAction=function(y,d,m){var _=y.querySelector(d),A=":"+m,C="rasterizehtml"+m;_&&(p[m]?O.addClassNameRecursively(_,C):O.addClassName(_,C),O.rewriteCssSelectorWith(y,A,"."+C))},g.persistInputValues=function(y){var d=y.querySelectorAll("input"),m=y.querySelectorAll("textarea"),_=function(A){return A.type==="checkbox"||A.type==="radio"};b(d).filter(_).forEach(function(A){A.checked?A.setAttribute("checked",""):A.removeAttribute("checked")}),b(d).filter(function(A){return!_(A)}).forEach(function(A){A.setAttribute("value",A.value)}),b(m).forEach(function(A){A.textContent=A.value})},g.rewriteTagNameSelectorsToLowerCase=function(y){O.lowercaseCssTypeSelectors(y,O.findHtmlOnlyNodeNames(y))},g}(l),f=function(O,g,b,p){var y={},d=function(W,H,L,M){var D=W.createElement(H);return D.style.visibility="hidden",D.style.width=L+"px",D.style.height=M+"px",D.style.position="absolute",D.style.top=-1e4-M+"px",D.style.left=-1e4-L+"px",W.getElementsByTagName("body")[0].appendChild(D),D},m=function(W){return W>0?new Promise(function(H){setTimeout(H,W)}):Promise.resolve()};y.executeJavascript=function(W,H){return new Promise(function(L){var M=d(p.document,"iframe",H.width,H.height),D=W.outerHTML,B=[],V=H.executeJsTimeout||0,Y=function(){p.document.getElementsByTagName("body")[0].removeChild(M)},F=function(){var X=M.contentDocument;L({document:X,errors:B,cleanUp:Y})},$=M.contentWindow.XMLHttpRequest,z=g.finishNotifyingXhr($),K=g.baseUrlRespectingXhr(z,H.baseUrl);M.onload=function(){m(V).then(z.waitForRequestsToFinish).then(F)},M.contentDocument.open(),M.contentWindow.XMLHttpRequest=K,M.contentWindow.onerror=function(X){B.push({resourceType:"scriptExecution",msg:X})},M.contentDocument.write("<!DOCTYPE html>"),M.contentDocument.write(D),M.contentDocument.close()})};var _=function(W,H,L){var M=W.createElement("iframe");return M.style.width=H+"px",M.style.height=L+"px",M.style.visibility="hidden",M.style.position="absolute",M.style.top=-1e4-L+"px",M.style.left=-1e4-H+"px",M.style.borderWidth=0,M.sandbox="allow-same-origin",M.scrolling="no",M},A=function(W,H,L){var M=Math.floor(W/L),D=Math.floor(H/L);return _(p.document,M,D)},C=function(W,H,L,M){return{width:Math.max(W.width*M,H),height:Math.max(W.height*M,L)}},R=function(W,H){var L=W.querySelector(H);if(L)return L;if(W.ownerDocument.querySelector(H)===W)return W;throw{message:"Clipping selector not found"}},S=function(W,H,L,M,D){var B=Math.max(W.scrollWidth,W.clientWidth),V=Math.max(W.scrollHeight,W.clientHeight),Y,F,$,z,K,X,Q,J;return H?(X=R(W,H),Q=X.getBoundingClientRect(),Y=Q.top,F=Q.left,$=Q.width,z=Q.height):(Y=0,F=0,$=B,z=V),J=C({width:$,height:z},L,M,D),K=p.getComputedStyle(W.ownerDocument.documentElement).fontSize,{left:F,top:Y,width:J.width,height:J.height,viewportWidth:B,viewportHeight:V,rootFontSize:K}},E=function(W,H){var L=W.tagName;return H.querySelector(L)},P=function(W){var H=W.tagName.toLowerCase();return H==="html"||H==="body"?W.outerHTML:'<body style="margin: 0;">'+W.outerHTML+"</body>"};y.calculateDocumentContentSize=function(W,H){return new Promise(function(L,M){var D=H.zoom||1,B;B=A(H.width,H.height,D),p.document.getElementsByTagName("body")[0].appendChild(B),B.onload=function(){var V=B.contentDocument,Y;try{Y=S(E(W,V),H.clip,H.width,H.height,D),L(Y)}catch(F){M(F)}finally{p.document.getElementsByTagName("body")[0].removeChild(B)}},B.contentDocument.open(),B.contentDocument.write("<!DOCTYPE html>"),B.contentDocument.write(P(W)),B.contentDocument.close()})},y.parseHtmlFragment=function(W){var H=p.document.implementation.createHTMLDocument("");H.documentElement.innerHTML=W;var L=H.querySelector("body").firstChild;if(!L)throw"Invalid source";return L};var T=function(W,H){var L=/<html((?:\s+[^>]*)?)>/im.exec(H),M=p.document.implementation.createHTMLDocument(""),D,B,V,Y;if(L)for(D="<div"+L[1]+"></div>",M.documentElement.innerHTML=D,V=M.querySelector("div"),B=0;B<V.attributes.length;B++)Y=V.attributes[B],W.documentElement.setAttribute(Y.name,Y.value)};y.parseHTML=function(W){var H=p.document.implementation.createHTMLDocument("");return H.documentElement.innerHTML=W,T(H,W),H};var N=function(W){try{return b.failOnParseError(W)}catch(H){throw{message:"Invalid source",originalError:H}}};y.validateXHTML=function(W){var H=new DOMParser,L=H.parseFromString(W,"application/xml");N(L)};var U=null,G=function(W,H){return H==="none"||H==="repeated"?((U===null||H!=="repeated")&&(U=Date.now()),W+"?_="+U):W},Z=function(W,H){return new Promise(function(L,M){var D=new window.XMLHttpRequest,B=O.joinUrl(H.baseUrl,W),V=G(B,H.cache),Y=function(F){M({message:"Unable to load page",originalError:F})};D.addEventListener("load",function(){D.status===200||D.status===0?L(D.responseXML):Y(D.statusText)},!1),D.addEventListener("error",function(F){Y(F)},!1);try{D.open("GET",V,!0),D.responseType="document",D.send(null)}catch(F){Y(F)}})};return y.loadDocument=function(W,H){return Z(W,H).then(function(L){return N(L)})},y}(o,a,r,window),h=function(O){var g={},b=function(E,P){return P?URL.createObjectURL(new Blob([E],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(E)},p=function(E){E instanceof Blob&&URL.revokeObjectURL(E)},y='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',d=function(E){return new Promise(function(P,T){var N=document.createElement("canvas"),U=new Image;U.onload=function(){var G=N.getContext("2d");try{G.drawImage(U,0,0),N.toDataURL("image/png"),P(!0)}catch{P(!1)}},U.onerror=T,U.src=E})},m=function(){var E=b(y,!0);return d(E).then(function(P){return p(E),P?!1:d(b(y,!1)).then(function(T){return T})},function(){return!1})},_=function(){if(O.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch{}return!1},A=function(){return new Promise(function(E,P){_()&&O.URL?m().then(function(T){E(!T)},function(){P()}):E(!1)})},C,R=function(){return C===void 0&&(C=A()),C},S=function(E){return R().then(function(P){return b(E,P)})};return g.renderSvg=function(E){return new Promise(function(P,T){var N,U,G=function(){U.onload=null,U.onerror=null},Z=function(){N&&p(N)};U=new Image,U.onload=function(){G(),Z(),P(U)},U.onerror=function(){Z(),T()},S(E).then(function(W){N=W,U.src=N},T)})},g}(window),x=function(O,g,b,p){var y={},d=function(E,P){var T=P||1,N={width:E.width,height:E.height,"font-size":E.rootFontSize};return T!==1&&(N.style="transform:scale("+T+"); transform-origin: 0 0;"),N},m=function(E){var P,T,N,U;P=Math.round(E.viewportWidth),T=Math.round(E.viewportHeight),N=-E.left,U=-E.top;var G={x:N,y:U,width:P,height:T};return G},_=function(E){var P=E.style||"";E.style=P+"float: left;"},A=function(E){E.externalResourcesRequired=!0},C=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},R=function(E){var P=Object.keys(E);return P.length?" "+P.map(function(T){return T+'="'+E[T]+'"'}).join(" "):""},S=function(E,P,T){var N=p.serializeToString(E);g.validateXHTML(N);var U=m(P);return _(U),A(U),'<svg xmlns="http://www.w3.org/2000/svg"'+R(d(P,T))+">"+C()+"<foreignObject"+R(U)+">"+N+"</foreignObject></svg>"};return y.getSvgForDocument=function(E,P,T){return b.rewriteTagNameSelectorsToLowerCase(E),S(E,P,T)},y.drawDocumentAsSvg=function(E,P){return["hover","active","focus","target"].forEach(function(T){P[T]&&b.fakeUserAction(E,P[T],T)}),g.calculateDocumentContentSize(E,P).then(function(T){return y.getSvgForDocument(E,T,P.zoom)})},y}(o,f,s,n),w=function(O,g,b,p,y,d){var m={},_=function(E){return{message:"Error rendering page",originalError:E}},A=function(E){return y.renderSvg(E).then(function(P){return{image:P,svg:E}},function(P){throw _(P)})},C=function(E,P){try{P.getContext("2d").drawImage(E,0,0)}catch(T){throw _(T)}},R=function(E,P,T){return p.drawDocumentAsSvg(E,T).then(A).then(function(N){return P&&C(N.image,P),N})},S=function(E,P){return g.executeJavascript(E,P).then(function(T){var N=T.document;return b.persistInputValues(N),{document:N,errors:T.errors,cleanUp:T.cleanUp}})};return m.rasterize=function(E,P,T){var N;return N=O.clone(T),N.inlineScripts=T.executeJs===!0,d.inlineReferences(E,N).then(function(U){return T.executeJs?S(E,T).then(function(G){return{element:G.document.documentElement,errors:U.concat(G.errors),cleanUp:G.cleanUp}}):{element:E,errors:U,cleanUp:function(){}}}).then(function(U){return R(U.element,P,T).then(function(G){return U.cleanUp(),{image:G.image,svg:G.svg,errors:U.errors}})})},m}(o,f,s,x,h,i),v=function(O,g,b){var p={},y=function(C,R){var S=300,E=200,P=C?C.width:S,T=C?C.height:E,N=R.width!==void 0?R.width:P,U=R.height!==void 0?R.height:T;return{width:N,height:U}},d=function(C){var R=y(C.canvas,C.options),S;return S=O.clone(C.options),S.width=R.width,S.height=R.height,S};p.drawDocument=function(){var C=arguments[0],R=Array.prototype.slice.call(arguments,1),S=O.parseOptionalParameters(R),E=C.documentElement?C.documentElement:C;return b.rasterize(E,S.canvas,d(S))};var m=function(C,R,S){var E=g.parseHTML(C);return p.drawDocument(E,R,S)};p.drawHTML=function(){var C=arguments[0],R=Array.prototype.slice.call(arguments,1),S=O.parseOptionalParameters(R);return m(C,S.canvas,S.options)};var _=function(C,R,S){var E=document.implementation.createHTMLDocument("");E.replaceChild(C.documentElement,E.documentElement);var P=S?O.clone(S):{};return S.baseUrl||(P.baseUrl=R),{document:E,options:P}},A=function(C,R,S){return g.loadDocument(C,S).then(function(E){var P=_(E,C,S);return p.drawDocument(P.document,R,P.options)})};return p.drawURL=function(){var C=arguments[0],R=Array.prototype.slice.call(arguments,1),S=O.parseOptionalParameters(R);return A(C,S.canvas,S.options)},p}(o,f,w);return v})})(aS);var sj=aS.exports;(function(t){var e=_e&&_e.__createBinding||(Object.create?function(m,_,A,C){C===void 0&&(C=A);var R=Object.getOwnPropertyDescriptor(_,A);R&&!("get"in R?!_.__esModule:R.writable||R.configurable)||(R={enumerable:!0,get:function(){return _[A]}}),Object.defineProperty(m,C,R)}:function(m,_,A,C){C===void 0&&(C=A),m[C]=_[A]}),n=_e&&_e.__setModuleDefault||(Object.create?function(m,_){Object.defineProperty(m,"default",{enumerable:!0,value:_})}:function(m,_){m.default=_}),r=_e&&_e.__importStar||function(m){if(m&&m.__esModule)return m;var _={};if(m!=null)for(var A in m)A!=="default"&&Object.prototype.hasOwnProperty.call(m,A)&&e(_,m,A);return n(_,m),_};Object.defineProperty(t,"__esModule",{value:!0}),t.prerenderFont=t.resetStyleContent=void 0,t.isContentWrapping=v,t.detectSize=O,t.htmlToCanvas=d;const i=r(sj),o=iu,a=p2;t.resetStyleContent=`
|
|
@@ -224,7 +224,7 @@ For more info see: https://github.com/konvajs/react-konva/issues/194
|
|
|
224
224
|
-webkit-text-fill-color: transparent;
|
|
225
225
|
-moz-text-fill-color: transparent;
|
|
226
226
|
`),`<div style="${["white-space: pre-wrap",`width: ${Math.round(L.width||100)}px`,B,`font-size: ${L.fontSize}px`,`font-family: '${M}'`,`text-align: ${L.align}`,L.textDecoration?`text-decoration: ${L.textDecoration}`:"",L.lineHeight?`line-height: ${L.lineHeight}`:"",L.letterSpacing?`letter-spacing: ${L.letterSpacing}rem`:"",L.fontStyle?`font-style: ${L.fontStyle}`:"",L.fontWeight?`font-weight: ${L.fontWeight}`:"",L.strokeWidth?`-webkit-text-stroke: ${L.strokeWidth}px ${L.stroke}`:"",L.strokeWidth?"paint-order: stroke fill":""].filter(Boolean).join("; ")}" contentEditable dir="${(0,v.getDir)((0,_.removeTags)(L.text))}">${L.text.replaceAll(`
|
|
227
|
-
`,"</br>")}</div>`}const W=L=>{let M=L.fontSize;for(let D=1;D<50;D++){const B=Z(Object.assign(Object.assign({},L.toJSON()),{fontSize:M}),{fontFamily:L.fontFamily}),{height:V}=(0,g.detectSize)(B),Y=L.height&&V>L.height,F=(0,g.isContentWrapping)({html:B});if(!(Y||F))break;M-=.5}return M},H=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);t.HTMLElement=(0,a.observer)(({element:L,store:M})=>{const D=o.default.useRef(null),[B,V]=o.default.useState(),[Y,F]=o.default.useState(!1),[$,z]=o.default.useState(!0),[K,X]=o.default.useState(!1),Q=o.default.useRef(L.height),J=M.selectedShapes.indexOf(L)>=0,ne=L.fontSize/3,{textVerticalResizeEnabled:ie}=x.flags,oe=(0,v.usePrevious)(L.fontFamily),[he]=(0,v.useFontLoader)(M,L.fontFamily),me=L._editModeEnabled;(0,b.useFadeIn)(D);const Pe=he?L.fontFamily:oe!==L.fontFamily?oe:"Arial",re=(0,O.useColor)(L).fill,ae=Z(L,{fontFamily:Pe,color:re}),{width:we,height:be}=N(ae,L,he);o.default.useEffect(()=>{if(!he)return;if(!L.height)return void L.set({height:be});const{textOverflow:Ae}=x.flags;if(Ae!=="change-font-size"||Y)Ae==="resize"&&(ie&&L.height<be&&M.history.ignore(()=>{L.set({height:be})}),ie||L.height===be||M.history.ignore(()=>{L.set({height:be})}));else{const Ce=W(L);Ce!==L.fontSize?M.history.ignore(()=>{L.set({fontSize:Ce})}):L.height!==be&&(ie&&L.height<be?M.history.ignore(()=>{L.set({height:be})}):ie||M.history.ignore(()=>{L.set({height:be})}))}});const te=o.default.useRef(0),fe=o.default.useMemo(()=>{const Ae={lastArgs:null,lastResult:null};return async function(Ce){return Ae.lastArgs&&Ae.lastResult&&(Me=Ae.lastArgs,ze=Ce,JSON.stringify(Me)===JSON.stringify(ze))||(Ae.lastResult=await(0,g.htmlToCanvas)(Ce),Ae.lastArgs=Object.assign({},Ce)),Ae.lastResult;var Me,ze}},[]);o.default.useEffect(()=>{Y||me||(async()=>{te.current++;const Ae=te.current,Ce=(0,m.incrementLoader)(`text ${L.id}`);z(!0);let Me=null;const ze=H?5:1;for(let We=0;We<ze;We++){if(Me=await(We>0?fe:g.htmlToCanvas)({skipCache:We>0,html:ae,width:L.width||1,height:L.height||be||1,fontFamily:Pe,padding:ne,pixelRatio:M._elementsPixelRatio,font:M.fonts.find(mt=>mt.fontFamily===Pe)||A.globalFonts.find(mt=>mt.fontFamily===Pe)}),Ae!==te.current)return void Ce();G(Me)&&H&&await new Promise(mt=>setTimeout(mt,50*(We+1)))}Me?(V(Me),z(!1),f.default.Util.requestAnimFrame(Ce)):Ce()})()},[ae,Y,be,me,Pe,L.height,M._elementsPixelRatio]);const de=Y||$;o.default.useEffect(()=>h.autorun(()=>{const Ae=D.current;(0,w.applyFilter)(Ae,L)}),[B,de,L.shadowColor,L.shadowOffsetX,L.shadowOffsetY,L.shadowOpacity]);let Ee=0;L.verticalAlign==="middle"&&(Ee=(L.height-be)/2),L.verticalAlign==="bottom"&&(Ee=L.height-be);const Ve=(0,v.getLineHeight)({fontLoaded:he,fontFamily:L.fontFamily,fontSize:L.fontSize,lineHeight:L.lineHeight}),Je=(0,C.isTouchDevice)();return o.default.createElement(o.default.Fragment,null,o.default.createElement(l.Rect,{x:L.a.x,y:L.a.y,offsetX:L.backgroundPadding*(L.fontSize*Ve*.5),offsetY:L.backgroundPadding*(L.fontSize*Ve*.5),rotation:L.a.rotation,hideInExport:!L.showInExport,listening:!1,visible:L.backgroundEnabled,opacity:L.backgroundOpacity*L.a.opacity,fill:L.backgroundColor,width:L.a.width+L.backgroundPadding*(L.fontSize*Ve),height:L.a.height+L.backgroundPadding*(L.fontSize*Ve),cornerRadius:L.backgroundCornerRadius*(L.fontSize*Ve*.5)}),o.default.createElement(l.Rect,{ref:D,name:"element",x:L.a.x,y:L.a.y,listening:L.selectable,rotation:L.a.rotation,width:L.a.width,height:L.a.height,visible:!de,draggable:Je?L.draggable&&J:L.draggable,preventDefault:!Je||J,opacity:me?0:L.a.opacity,hideInExport:!L.showInExport,onMouseEnter:()=>{X(!0)},onMouseLeave:()=>{X(!1)},onDragMove:Ae=>{L.set({x:Ae.target.x(),y:Ae.target.y()})},onDragEnd:Ae=>{L.set({x:Ae.target.x(),y:Ae.target.y()})},id:L.id,onDblClick:()=>{L.contentEditable&&L.toggleEditMode(!0)},onDblTap:()=>{L.contentEditable&&L.toggleEditMode(!0)},onTransformStart:Ae=>{F(!0),Q.current=L.height},onTransform:Ae=>{var Ce;const Me=Ae.target,ze=((Ce=Me.getStage())===null||Ce===void 0?void 0:Ce.findOne("Transformer")).getActiveAnchor(),We=ze==="middle-left"||ze==="middle-right",St=ze==="top-center"||ze==="bottom-center",mt=Me.scaleX();if(We){const ue=Me.scaleX(),ce=Math.max(Me.width()*ue,L.fontSize);if(Me.width(ce),Me.scaleX(1),x.flags.textVerticalResizeEnabled){const Se=Math.max(be,Q.current);L.set({height:Se})}L.set({width:ce,x:Me.x(),y:Me.y()})}else if(St){let ue=x.flags.textOverflow==="resize"?be:L.lineHeight*L.fontSize;const ce=Math.max(ue,Ae.target.height()*Ae.target.scaleY());Me.scaleY(1),L.set({x:Me.x(),y:Me.y(),height:ce,rotation:Me.rotation()})}else Me.scaleX(1),Me.scaleY(1),L.set({fontSize:L.fontSize*mt,width:Me.width()*mt,x:Me.x(),y:Me.y(),rotation:Me.rotation(),height:Me.height()*mt})},onTransformEnd:Ae=>{F(!1),z(!0);const Ce=Ae.target.scaleX();Ae.target.scaleX(1),Ae.target.scaleY(1),L.set({fontSize:L.fontSize*Ce,width:Ae.target.width()*Ce,x:Ae.target.x(),y:Ae.target.y(),rotation:Ae.target.rotation(),shadowBlur:L.shadowBlur*Ce,shadowOffsetX:L.shadowOffsetX*Ce,shadowOffsetY:L.shadowOffsetY*Ce,strokeWidth:L.strokeWidth*Ce})}}),o.default.createElement(l.Image,{ref:D,image:B,x:L.a.x,y:L.a.y,offsetX:ne,offsetY:ne-Ee,listening:!1,rotation:L.rotation,width:L.a.width+2*ne,height:L.a.height+2*ne,visible:!de,opacity:me?0:L.a.opacity,shadowEnabled:L.shadowEnabled,shadowBlur:L.shadowBlur,shadowOffsetX:L.shadowOffsetX,shadowOffsetY:L.shadowOffsetY,shadowColor:L.shadowColor,shadowOpacity:L.shadowOpacity,hideInExport:!L.showInExport}),de&&o.default.createElement(l.Group,{x:L.a.x,y:L.a.y,rotation:L.rotation,offsetY:-Ee},o.default.createElement(y.Html,{divProps:{style:{pointerEvents:"none"}}},o.default.createElement(S,{dangerouslySetInnerHTML:{__html:ae},style:{pointerEvents:"none",display:"inline-block"}}))),me&&o.default.createElement(l.Group,{x:L.a.x,y:L.a.y,rotation:L.rotation,offsetY:-Ee},o.default.createElement(y.Html,null,o.default.createElement(T,{html:ae,element:L,onChange:Ae=>{const Ce=(0,R.getLimitedFontSize)({oldText:(0,_.removeTags)(L.text),newText:(0,_.removeTags)(Ae),element:L});L.set({text:Ae,fontSize:Ce})},onBlur:Ae=>{L.toggleEditMode(!1)}}))),(J||K)&&o.default.createElement(p.Highlighter,{element:L}))})})(iS);var fS={},S2={},su={};(function(t){function e(s){return s/180*Math.PI}function n(s,f,h,x,w){const v=Math.sqrt(h*h+x*x);return w+=Math.atan2(x,h),{x:s+v*Math.cos(w),y:f+v*Math.sin(w)}}function r(s){const{x:f,y:h,width:x,height:w}=s,v=e(s.rotation),O=n(f,h,0,0,v),g=n(f,h,x,0,v),b=n(f,h,x,w,v),p=n(f,h,0,w,v),y=Math.min(O.x,g.x,b.x,p.x),d=Math.min(O.y,g.y,b.y,p.y),m=Math.max(O.x,g.x,b.x,p.x),_=Math.max(O.y,g.y,b.y,p.y);return{x:y,y:d,width:m-y,height:_-d,minX:y,minY:d,maxX:m,maxY:_}}function i(s){const f=s.map(O=>r(O)),h=Math.min(...f.map(O=>O.minX)),x=Math.min(...f.map(O=>O.minY)),w=Math.max(...f.map(O=>O.maxX)),v=Math.max(...f.map(O=>O.maxY));return{x:h,y:x,width:w-h,height:v-x,minX:h,minY:x,maxX:w,maxY:v}}function o(s){const f=e(s.rotation||0);return{x:s.x+s.width/2*Math.cos(f)+s.height/2*Math.sin(-f),y:s.y+s.height/2*Math.cos(f)+s.width/2*Math.sin(f)}}function a(s,f,h){const x=e(f),w=h.x+(s.x-h.x)*Math.cos(x)-(s.y-h.y)*Math.sin(x),v=h.y+(s.x-h.x)*Math.sin(x)+(s.y-h.y)*Math.cos(x);return Object.assign(Object.assign({},s),{rotation:s.rotation+f,x:w,y:v})}function l(s,f){return a(s,f,o(s))}Object.defineProperty(t,"__esModule",{value:!0}),t.degToRad=e,t.getClientRect=r,t.getTotalClientRect=i,t.getCenter=o,t.rotateAroundPoint=a,t.rotateAroundCenter=l})(su);(function(t){var e=_e&&_e.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(t,"__esModule",{value:!0}),t.setSnapFilterFunc=void 0,t.useSnap=h,t.useAnchorSnap=w;const n=e(Qe),r=e(ki),i=su;var o=5;let a=({targetKonvaNodes:v,guideKonvaNode:O,distance:g,snapDirection:b})=>g<o;const l=v=>{a=v};function s(v){const O=v.__getNodeRect(),g=(0,i.getClientRect)(Object.assign(Object.assign({},O),{rotation:r.default.Util.radToDeg(O.rotation)})),b=v.getAbsolutePosition();return{vertical:[{guide:g.x,offset:b.x-g.x,snap:"start",nodes:v.nodes()},{guide:g.x+g.width/2,offset:b.x-g.x-g.width/2,snap:"center",nodes:v.nodes()},{guide:g.x+g.width,offset:b.x-g.x-g.width,snap:"end",nodes:v.nodes()}],horizontal:[{guide:g.y,offset:b.y-g.y,snap:"start",nodes:v.nodes()},{guide:g.y+g.height/2,offset:b.y-g.y-g.height/2,snap:"center",nodes:v.nodes()},{guide:g.y+g.height,offset:b.y-g.y-g.height,snap:"end",nodes:v.nodes()}]}}function f(v,O){var g=[],b=[];v.vertical.forEach(A=>{O.vertical.forEach(C=>{var R=Math.abs(A.offset-C.guide);a({targetKonvaNodes:C.nodes,guideKonvaNode:A.node,distance:R,snapDirection:A.snap})&&g.push({lineGuide:A.offset,diff:R,snap:C.snap,offset:C.offset})})}),v.horizontal.forEach(A=>{O.horizontal.forEach(C=>{var R=Math.abs(A.offset-C.guide);a({targetKonvaNodes:C.nodes,guideKonvaNode:A.node,distance:R,snapDirection:A.snap})&&b.push({lineGuide:A.offset,diff:R,snap:C.snap,offset:C.offset})})});var p=[];const y=g.sort((A,C)=>A.diff-C.diff),d=b.sort((A,C)=>A.diff-C.diff);var m=y[0],_=d[0];return m&&y.filter(A=>Math.abs(A.diff-m.diff)<.1).forEach(A=>{p.push(Object.assign({orientation:"V"},A))}),_&&d.filter(A=>Math.abs(A.diff-_.diff)<.1).forEach(A=>{p.push(Object.assign({orientation:"H"},A))}),p}function h(v,O){const g=n.default.useRef(),b=A=>A.hasName("element")||A.hasName("page-background")||!g.current&&A.hasName("elements-area");function p(A){var C;const R=(C=v.current)===null||C===void 0?void 0:C.getStage(),S=[],E=[];return R.find(b).forEach(P=>{if(!(A.indexOf(P)>=0)){var T=P.getClientRect({skipShadow:!0,skipStroke:!0});S.push({offset:T.x,node:P,snap:"start"},{offset:T.x+T.width,node:P,snap:"end"},{offset:T.x+T.width/2,node:P,snap:"center"}),E.push({offset:T.y,node:P,snap:"start"},{offset:T.y+T.height,node:P,snap:"end"},{offset:T.y+T.height/2,node:P,snap:"center"})}}),{vertical:S,horizontal:E}}function y(A){var C;const R=(C=v.current)===null||C===void 0?void 0:C.getLayer(),S=R==null?void 0:R.children.find(E=>E.name()==="line-guides");A.forEach(E=>{if(E.orientation==="H"){var P=new r.default.Line({points:[-6e3,E.lineGuide,6e3,E.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});S==null||S.add(P),R.batchDraw()}else E.orientation==="V"&&(P=new r.default.Line({points:[E.lineGuide,-6e3,E.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),S==null||S.add(P))})}const d=A=>{const C=A.target.getLayer().children.find(N=>N.name()==="line-guides");C==null||C.destroyChildren();var R=f(p(A.target.nodes()),s(A.target));if(!R.length)return;y(R);const S=A.target.getAbsolutePosition(),E=(A.target.nodes().map(N=>N.getAbsolutePosition()),Object.assign({},S));R.forEach(N=>{switch(N.snap){case"start":case"center":case"end":switch(N.orientation){case"V":E.x=N.lineGuide+N.offset;break;case"H":E.y=N.lineGuide+N.offset}}});const P=E.x-S.x,T=E.y-S.y;A.evt.ctrlKey||A.evt.metaKey||A.target.nodes().forEach(N=>{const U=N.getAbsolutePosition();N.setAbsolutePosition({x:U.x+P,y:U.y+T})})},m=(A,C,R)=>{const S=v.current,E=S.getLayer(),P=E.children.find(W=>W.name()==="line-guides");if(P==null||P.destroyChildren(),S.getActiveAnchor()==="rotater"||Math.sqrt(Math.pow(C.x-A.x,2)+Math.pow(C.y-A.y,2))>50||!E)return C;var T=f(p(S.nodes()),{vertical:[{guide:C.x,offset:0,snap:"start",nodes:S.nodes()}],horizontal:[{guide:C.y,offset:0,snap:"start",nodes:S.nodes()}]});if(!T.length||(y(T),R.ctrlKey||R.metaKey))return C;let N=C.x,U=C.x;T.forEach(W=>{switch(W.orientation){case"V":N=W.lineGuide;break;case"H":U=W.lineGuide}});const G=Math.abs(C.x-N)<10,Z=Math.abs(C.y-U)<10;return G&&!Z?{x:N,y:A.y}:Z&&!G?{x:A.x,y:U}:G&&Z?{x:N,y:U}:C},_=A=>{if(!A.target)return;const C=A.target.getLayer(),R=C.children.find(S=>S.name()==="line-guides");R==null||R.destroyChildren(),C.batchDraw()};n.default.useEffect(()=>{v.current&&(v.current.anchorDragBoundFunc(m),v.current.on("dragstart",A=>{setTimeout(()=>{if(r.default.DD._dragElements.size===0)return;const C=[...r.default.DD._dragElements.entries()],R=C.find(([S,E])=>E.node instanceof r.default.Transformer);R&&(C.splice(C.indexOf(R),1),C.unshift(R),r.default.DD._dragElements.clear(),C.forEach(([S,E])=>{r.default.DD._dragElements.set(S,E)}))})}),v.current.on("dragmove",d),v.current.on("dragend",_),v.current.on("transformend",_),v.current.on("transform",A=>{var C,R;A.evt.ctrlKey||A.evt.metaKey?(C=v.current)===null||C===void 0||C.rotationSnapTolerance(0):(R=v.current)===null||R===void 0||R.rotationSnapTolerance(5)}))},[])}function x(v){return{vertical:[{guide:v.absolutePosition().x,offset:0,snap:"center",nodes:[v]}],horizontal:[{guide:v.absolutePosition().y,offset:0,snap:"center",nodes:[v]}]}}function w(v,O,g){const b=d=>d.hasName("element")||d.hasName("line-anchor")||d.hasName("page-background")||d.hasName("elements-area"),p=d=>{const m=d.target.getLayer().children.find(E=>E.name()==="line-guides");m==null||m.destroyChildren();var _=f(function(E){var P;const T=(P=v.current)===null||P===void 0?void 0:P.getStage();var N=[],U=[];return T.find(b).forEach(G=>{if(!(E.indexOf(G)>=0)){var Z=G.getClientRect({skipShadow:!0,skipStroke:!0});G.hasName("line-anchor")&&(Z={x:G.absolutePosition().x,y:G.absolutePosition().y,width:0,height:0}),N.push({offset:Z.x,node:G,snap:"start"},{offset:Z.x+Z.width,node:G,snap:"end"},{offset:Z.x+Z.width/2,node:G,snap:"center"}),U.push({offset:Z.y,node:G,snap:"start"},{offset:Z.y+Z.height,node:G,snap:"end"},{offset:Z.y+Z.height/2,node:G,snap:"center"})}}),{vertical:N,horizontal:U}}([d.target,...O.map(E=>E.current)]),x(d.target));if(!_.length)return;(function(E){var P;const T=(P=v.current)===null||P===void 0?void 0:P.getLayer(),N=T==null?void 0:T.children.find(U=>U.name()==="line-guides");E.forEach(U=>{if(U.orientation==="H"){var G=new r.default.Line({points:[-6e3,U.lineGuide,6e3,U.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});N==null||N.add(G),T.batchDraw()}else U.orientation==="V"&&(G=new r.default.Line({points:[U.lineGuide,-6e3,U.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),N==null||N.add(G))})})(_);const A=d.target.getAbsolutePosition(),C=Object.assign({},A);_.forEach(E=>{switch(E.snap){case"start":case"center":case"end":switch(E.orientation){case"V":C.x=E.lineGuide+E.offset;break;case"H":C.y=E.lineGuide+E.offset}}});const R=C.x-A.x,S=C.y-A.y;if(!(d.evt.ctrlKey||d.evt.metaKey)){const E=d.target.getAbsolutePosition();d.target.absolutePosition({x:E.x+R,y:E.y+S})}},y=d=>{if(!d.target)return;const m=d.target.getLayer(),_=m.children.find(A=>A.name()==="line-guides");_==null||_.destroyChildren(),m.batchDraw()};n.default.useEffect(()=>{v.current&&(v.current.on("dragmove",p),v.current.on("dragend",y))},g)}t.setSnapFilterFunc=l})(S2);(function(t){var e=_e&&_e.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(t,"__esModule",{value:!0}),t.LineElement=void 0,t.getMiddlePoints=h,t.getLinePositionFromMiddlePoints=x;const n=e(Qe),r=ti,i=Io,o=Jc,a=Qc,l=Ml,s=S2,f=Na;function h(O){const{x:g,y:b,width:p,height:y,rotation:d}=O.a,m=d*Math.PI/180,_={x:g+y/2*Math.cos(m+Math.PI/2),y:b+y/2*Math.sin(m+Math.PI/2)};return{middleLeft:_,middleRight:{x:_.x+p*Math.cos(m),y:_.y+p*Math.sin(m)}}}function x(O,g,b){const p=Math.sqrt(Math.pow(g.x-O.x,2)+Math.pow(g.y-O.y,2)),y=Math.atan2(g.y-O.y,g.x-O.x),d=180*y/Math.PI;return{x:O.x+Math.cos(y-Math.PI/2)*b/2,y:O.y+Math.sin(y-Math.PI/2)*b/2,width:p,height:b,rotation:d}}const w=(O,g)=>({offsetX:5/O,offsetY:5/O,width:10/O,height:10/O,fill:"white",stroke:"rgb(0, 161, 255)",strokeWidth:2,strokeScaleEnabled:!1,draggable:!0,dragDistance:0,onMouseEnter:b=>{b.target.getStage().container().style.cursor="crosshair"},onMouseLeave:b=>{b.target.getStage().container().style.cursor=""},onDragStart:b=>{g.history.startTransaction()},onDragEnd:b=>{g.history.endTransaction()}}),v=(0,r.observer)(({element:O,type:g})=>{const b=(0,o.useColor)(O,O.a.color,"fill"),p=(0,o.useColor)(O,O.a.color,"stroke"),y=Object.assign(Object.assign(Object.assign({strokeWidth:O.height,lineCap:"round",lineJoin:"round"},p),b),{opacity:O.a.opacity,hideInExport:!O.showInExport});return n.default.createElement(n.default.Fragment,null,g==="arrow"&&n.default.createElement(i.Line,Object.assign({points:[3*O.height,2*-O.height,0,0,3*O.height,2*O.height]},y)),g==="triangle"&&n.default.createElement(i.Line,Object.assign({points:[3*O.height,2*-O.height,0,0,3*O.height,2*O.height],closed:!0},y)),g==="bar"&&n.default.createElement(i.Line,Object.assign({points:[0,2*-O.height,0,2*O.height],closed:!0},y)),g==="square"&&n.default.createElement(i.Line,Object.assign({points:[0,2*-O.height,4*O.height,2*-O.height,4*O.height,2*O.height,0,2*O.height],closed:!0},y)),g==="circle"&&n.default.createElement(i.Circle,Object.assign({x:2*O.height,y:0,radius:2*O.height},y)))});t.LineElement=(0,r.observer)(({element:O,store:g})=>{const b=n.default.useRef(null),p=n.default.useRef(null),y=n.default.useRef(null),d=O.selectable||g.role==="admin",m=(0,f.isTouchDevice)(),[_,A]=n.default.useState(!1),C=g.selectedElements.indexOf(O)>=0&&g.selectedElements.length===1,R=g.selectedShapes.indexOf(O)>=0,{middleLeft:S,middleRight:E}=h(O);(0,s.useAnchorSnap)(p,[b],[C]),(0,s.useAnchorSnap)(y,[b],[C]);const P=(0,o.useColor)(O,O.a.color,"stroke");return n.default.createElement(n.default.Fragment,null,n.default.createElement(i.Line,Object.assign({ref:b,name:"element",id:O.id,x:O.a.x,y:O.a.y,points:[0,0,O.a.width,0],offsetY:-O.a.height/2,strokeWidth:O.a.height,hitStrokeWidth:Math.max(O.a.height,20),dash:O.dash.map(T=>T*O.a.height)},P,{rotation:O.a.rotation,opacity:O.animated("opacity"),shadowEnabled:O.shadowEnabled,shadowBlur:O.shadowBlur,shadowOffsetX:O.shadowOffsetX,shadowOffsetY:O.shadowOffsetY,shadowColor:O.shadowColor,shadowOpacity:O.shadowOpacity,listening:d,draggable:m?O.draggable&&R:O.draggable,preventDefault:!m||R,hideInExport:!O.showInExport,onMouseEnter:()=>{A(!0)},onMouseLeave:()=>{A(!1)},onDragMove:T=>{O.set({x:T.target.x(),y:T.target.y()})},onDragEnd:T=>{O.set({x:T.target.x(),y:T.target.y()})},onTransform:T=>{const N=T.target.scaleX();T.target.scaleX(1),T.target.scaleY(1),O.set({height:O.height*N,width:O.width*N,x:T.target.x(),y:T.target.y(),rotation:T.target.rotation()})}})),n.default.createElement(i.Group,{x:S.x,y:S.y,rotation:O.rotation,hideInExport:!O.showInExport},n.default.createElement(v,{element:O,type:O.startHead})),n.default.createElement(i.Group,{x:E.x,y:E.y,rotation:O.rotation+180},n.default.createElement(v,{element:O,type:O.endHead})),(_||R&&!C)&&n.default.createElement(l.Highlighter,{element:O}),C&&O.resizable&&n.default.createElement(a.Portal,{selector:".page-abs-container",enabled:!0},n.default.createElement(i.Group,{visible:C},n.default.createElement(i.Rect,Object.assign({x:S.x,y:S.y,ref:p,name:"line-anchor"},w(g.scale,g),{onDragMove:T=>{const N=x(T.target.position(),E,O.height);O.set({x:N.x,y:N.y,width:N.width,rotation:N.rotation})}})),n.default.createElement(i.Rect,Object.assign({x:E.x,y:E.y,ref:y,name:"line-anchor"},w(g.scale,g),{onDragMove:T=>{const N=x(S,T.target.position(),O.height);O.set({x:N.x,y:N.y,width:N.width,rotation:N.rotation})}})))))})})(fS);var dS={};(function(t){var e=_e&&_e.__createBinding||(Object.create?function(L,M,D,B){B===void 0&&(B=D);var V=Object.getOwnPropertyDescriptor(M,D);V&&!("get"in V?!M.__esModule:V.writable||V.configurable)||(V={enumerable:!0,get:function(){return M[D]}}),Object.defineProperty(L,B,V)}:function(L,M,D,B){B===void 0&&(B=D),L[B]=M[D]}),n=_e&&_e.__setModuleDefault||(Object.create?function(L,M){Object.defineProperty(L,"default",{enumerable:!0,value:M})}:function(L,M){L.default=M}),r=_e&&_e.__importStar||function(L){if(L&&L.__esModule)return L;var M={};if(L!=null)for(var D in L)D!=="default"&&Object.prototype.hasOwnProperty.call(L,D)&&e(M,L,D);return n(M,L),M},i=_e&&_e.__importDefault||function(L){return L&&L.__esModule?L:{default:L}};Object.defineProperty(t,"__esModule",{value:!0}),t.VideoElement=t.useImageLoader=t.setImageLoaderHook=void 0;const o=i(Qe),a=ti,l=Qi,s=Io,f=i(Yp),h=i(ki),x=Qc,w=Ml,v=Yi,O=r(au),g=Qr,b=ef,p=Rl,y=Na;function d(){return document.createElement("canvas")}async function m(L){if(!(L.indexOf("data:image/svg+xml")>=0||L.indexOf(".svg")>=0))return L;const M=await O.urlToString(L),D=O.fixSize(M);return O.svgToURL(D)}const _=L=>{const[M,D]=o.default.useState(L);return o.default.useEffect(()=>{(async()=>{const B=await m(L);B!==M&&D(B)})()},[L]),M},A=new window.Image;A.src=O.svgToURL(`
|
|
227
|
+
`,"</br>")}</div>`}const W=L=>{let M=L.fontSize;for(let D=1;D<50;D++){const B=Z(Object.assign(Object.assign({},L.toJSON()),{fontSize:M}),{fontFamily:L.fontFamily}),{height:V}=(0,g.detectSize)(B),Y=L.height&&V>L.height,F=(0,g.isContentWrapping)({html:B});if(!(Y||F))break;M-=.5}return M},H=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);t.HTMLElement=(0,a.observer)(({element:L,store:M})=>{const D=o.default.useRef(null),[B,V]=o.default.useState(),[Y,F]=o.default.useState(!1),[$,z]=o.default.useState(!0),[K,X]=o.default.useState(!1),Q=o.default.useRef(L.height),J=M.selectedShapes.indexOf(L)>=0,ne=L.fontSize/3,{textVerticalResizeEnabled:ie}=x.flags,oe=(0,v.usePrevious)(L.fontFamily),[de]=(0,v.useFontLoader)(M,L.fontFamily),me=L._editModeEnabled;(0,b.useFadeIn)(D);const Pe=de?L.fontFamily:oe!==L.fontFamily?oe:"Arial",re=(0,O.useColor)(L).fill,ae=Z(L,{fontFamily:Pe,color:re}),{width:we,height:be}=N(ae,L,de);o.default.useEffect(()=>{if(!de)return;if(!L.height)return void L.set({height:be});const{textOverflow:Ae}=x.flags;if(Ae!=="change-font-size"||Y)Ae==="resize"&&(ie&&L.height<be&&M.history.ignore(()=>{L.set({height:be})}),ie||L.height===be||M.history.ignore(()=>{L.set({height:be})}));else{const Ce=W(L);Ce!==L.fontSize?M.history.ignore(()=>{L.set({fontSize:Ce})}):L.height!==be&&(ie&&L.height<be?M.history.ignore(()=>{L.set({height:be})}):ie||M.history.ignore(()=>{L.set({height:be})}))}});const te=o.default.useRef(0),fe=o.default.useMemo(()=>{const Ae={lastArgs:null,lastResult:null};return async function(Ce){return Ae.lastArgs&&Ae.lastResult&&(Me=Ae.lastArgs,ze=Ce,JSON.stringify(Me)===JSON.stringify(ze))||(Ae.lastResult=await(0,g.htmlToCanvas)(Ce),Ae.lastArgs=Object.assign({},Ce)),Ae.lastResult;var Me,ze}},[]);o.default.useEffect(()=>{Y||me||(async()=>{te.current++;const Ae=te.current,Ce=(0,m.incrementLoader)(`text ${L.id}`);z(!0);let Me=null;const ze=H?5:1;for(let We=0;We<ze;We++){if(Me=await(We>0?fe:g.htmlToCanvas)({skipCache:We>0,html:ae,width:L.width||1,height:L.height||be||1,fontFamily:Pe,padding:ne,pixelRatio:M._elementsPixelRatio,font:M.fonts.find(mt=>mt.fontFamily===Pe)||A.globalFonts.find(mt=>mt.fontFamily===Pe)}),Ae!==te.current)return void Ce();G(Me)&&H&&await new Promise(mt=>setTimeout(mt,50*(We+1)))}Me?(V(Me),z(!1),f.default.Util.requestAnimFrame(Ce)):Ce()})()},[ae,Y,be,me,Pe,L.height,M._elementsPixelRatio,de]);const he=Y||$;o.default.useEffect(()=>h.autorun(()=>{const Ae=D.current;(0,w.applyFilter)(Ae,L)}),[B,he,L.shadowColor,L.shadowOffsetX,L.shadowOffsetY,L.shadowOpacity]);let Ee=0;L.verticalAlign==="middle"&&(Ee=(L.height-be)/2),L.verticalAlign==="bottom"&&(Ee=L.height-be);const Ve=(0,v.getLineHeight)({fontLoaded:de,fontFamily:L.fontFamily,fontSize:L.fontSize,lineHeight:L.lineHeight}),Je=(0,C.isTouchDevice)();return o.default.createElement(o.default.Fragment,null,o.default.createElement(l.Rect,{x:L.a.x,y:L.a.y,offsetX:L.backgroundPadding*(L.fontSize*Ve*.5),offsetY:L.backgroundPadding*(L.fontSize*Ve*.5),rotation:L.a.rotation,hideInExport:!L.showInExport,listening:!1,visible:L.backgroundEnabled,opacity:L.backgroundOpacity*L.a.opacity,fill:L.backgroundColor,width:L.a.width+L.backgroundPadding*(L.fontSize*Ve),height:L.a.height+L.backgroundPadding*(L.fontSize*Ve),cornerRadius:L.backgroundCornerRadius*(L.fontSize*Ve*.5)}),o.default.createElement(l.Rect,{ref:D,name:"element",x:L.a.x,y:L.a.y,listening:L.selectable,rotation:L.a.rotation,width:L.a.width,height:L.a.height,visible:!he,draggable:Je?L.draggable&&J:L.draggable,preventDefault:!Je||J,opacity:me?0:L.a.opacity,hideInExport:!L.showInExport,onMouseEnter:()=>{X(!0)},onMouseLeave:()=>{X(!1)},onDragMove:Ae=>{L.set({x:Ae.target.x(),y:Ae.target.y()})},onDragEnd:Ae=>{L.set({x:Ae.target.x(),y:Ae.target.y()})},id:L.id,onDblClick:()=>{L.contentEditable&&L.toggleEditMode(!0)},onDblTap:()=>{L.contentEditable&&L.toggleEditMode(!0)},onTransformStart:Ae=>{F(!0),Q.current=L.height},onTransform:Ae=>{var Ce;const Me=Ae.target,ze=((Ce=Me.getStage())===null||Ce===void 0?void 0:Ce.findOne("Transformer")).getActiveAnchor(),We=ze==="middle-left"||ze==="middle-right",St=ze==="top-center"||ze==="bottom-center",mt=Me.scaleX();if(We){const ue=Me.scaleX(),ce=Math.max(Me.width()*ue,L.fontSize);if(Me.width(ce),Me.scaleX(1),x.flags.textVerticalResizeEnabled){const Se=Math.max(be,Q.current);L.set({height:Se})}L.set({width:ce,x:Me.x(),y:Me.y()})}else if(St){let ue=x.flags.textOverflow==="resize"?be:L.lineHeight*L.fontSize;const ce=Math.max(ue,Ae.target.height()*Ae.target.scaleY());Me.scaleY(1),L.set({x:Me.x(),y:Me.y(),height:ce,rotation:Me.rotation()})}else Me.scaleX(1),Me.scaleY(1),L.set({fontSize:L.fontSize*mt,width:Me.width()*mt,x:Me.x(),y:Me.y(),rotation:Me.rotation(),height:Me.height()*mt})},onTransformEnd:Ae=>{F(!1),z(!0);const Ce=Ae.target.scaleX();Ae.target.scaleX(1),Ae.target.scaleY(1),L.set({fontSize:L.fontSize*Ce,width:Ae.target.width()*Ce,x:Ae.target.x(),y:Ae.target.y(),rotation:Ae.target.rotation(),shadowBlur:L.shadowBlur*Ce,shadowOffsetX:L.shadowOffsetX*Ce,shadowOffsetY:L.shadowOffsetY*Ce,strokeWidth:L.strokeWidth*Ce})}}),o.default.createElement(l.Image,{ref:D,image:B,x:L.a.x,y:L.a.y,offsetX:ne,offsetY:ne-Ee,listening:!1,rotation:L.rotation,width:L.a.width+2*ne,height:L.a.height+2*ne,visible:!he,opacity:me?0:L.a.opacity,shadowEnabled:L.shadowEnabled,shadowBlur:L.shadowBlur,shadowOffsetX:L.shadowOffsetX,shadowOffsetY:L.shadowOffsetY,shadowColor:L.shadowColor,shadowOpacity:L.shadowOpacity,hideInExport:!L.showInExport}),he&&o.default.createElement(l.Group,{x:L.a.x,y:L.a.y,rotation:L.rotation,offsetY:-Ee},o.default.createElement(y.Html,{divProps:{style:{pointerEvents:"none"}}},o.default.createElement(S,{dangerouslySetInnerHTML:{__html:ae},style:{pointerEvents:"none",display:"inline-block"}}))),me&&o.default.createElement(l.Group,{x:L.a.x,y:L.a.y,rotation:L.rotation,offsetY:-Ee},o.default.createElement(y.Html,null,o.default.createElement(T,{html:ae,element:L,onChange:Ae=>{const Ce=(0,R.getLimitedFontSize)({oldText:(0,_.removeTags)(L.text),newText:(0,_.removeTags)(Ae),element:L});L.set({text:Ae,fontSize:Ce})},onBlur:Ae=>{L.toggleEditMode(!1)}}))),(J||K)&&o.default.createElement(p.Highlighter,{element:L}))})})(iS);var fS={},S2={},su={};(function(t){function e(s){return s/180*Math.PI}function n(s,f,h,x,w){const v=Math.sqrt(h*h+x*x);return w+=Math.atan2(x,h),{x:s+v*Math.cos(w),y:f+v*Math.sin(w)}}function r(s){const{x:f,y:h,width:x,height:w}=s,v=e(s.rotation),O=n(f,h,0,0,v),g=n(f,h,x,0,v),b=n(f,h,x,w,v),p=n(f,h,0,w,v),y=Math.min(O.x,g.x,b.x,p.x),d=Math.min(O.y,g.y,b.y,p.y),m=Math.max(O.x,g.x,b.x,p.x),_=Math.max(O.y,g.y,b.y,p.y);return{x:y,y:d,width:m-y,height:_-d,minX:y,minY:d,maxX:m,maxY:_}}function i(s){const f=s.map(O=>r(O)),h=Math.min(...f.map(O=>O.minX)),x=Math.min(...f.map(O=>O.minY)),w=Math.max(...f.map(O=>O.maxX)),v=Math.max(...f.map(O=>O.maxY));return{x:h,y:x,width:w-h,height:v-x,minX:h,minY:x,maxX:w,maxY:v}}function o(s){const f=e(s.rotation||0);return{x:s.x+s.width/2*Math.cos(f)+s.height/2*Math.sin(-f),y:s.y+s.height/2*Math.cos(f)+s.width/2*Math.sin(f)}}function a(s,f,h){const x=e(f),w=h.x+(s.x-h.x)*Math.cos(x)-(s.y-h.y)*Math.sin(x),v=h.y+(s.x-h.x)*Math.sin(x)+(s.y-h.y)*Math.cos(x);return Object.assign(Object.assign({},s),{rotation:s.rotation+f,x:w,y:v})}function l(s,f){return a(s,f,o(s))}Object.defineProperty(t,"__esModule",{value:!0}),t.degToRad=e,t.getClientRect=r,t.getTotalClientRect=i,t.getCenter=o,t.rotateAroundPoint=a,t.rotateAroundCenter=l})(su);(function(t){var e=_e&&_e.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(t,"__esModule",{value:!0}),t.setSnapFilterFunc=void 0,t.useSnap=h,t.useAnchorSnap=w;const n=e(Qe),r=e(ki),i=su;var o=5;let a=({targetKonvaNodes:v,guideKonvaNode:O,distance:g,snapDirection:b})=>g<o;const l=v=>{a=v};function s(v){const O=v.__getNodeRect(),g=(0,i.getClientRect)(Object.assign(Object.assign({},O),{rotation:r.default.Util.radToDeg(O.rotation)})),b=v.getAbsolutePosition();return{vertical:[{guide:g.x,offset:b.x-g.x,snap:"start",nodes:v.nodes()},{guide:g.x+g.width/2,offset:b.x-g.x-g.width/2,snap:"center",nodes:v.nodes()},{guide:g.x+g.width,offset:b.x-g.x-g.width,snap:"end",nodes:v.nodes()}],horizontal:[{guide:g.y,offset:b.y-g.y,snap:"start",nodes:v.nodes()},{guide:g.y+g.height/2,offset:b.y-g.y-g.height/2,snap:"center",nodes:v.nodes()},{guide:g.y+g.height,offset:b.y-g.y-g.height,snap:"end",nodes:v.nodes()}]}}function f(v,O){var g=[],b=[];v.vertical.forEach(A=>{O.vertical.forEach(C=>{var R=Math.abs(A.offset-C.guide);a({targetKonvaNodes:C.nodes,guideKonvaNode:A.node,distance:R,snapDirection:A.snap})&&g.push({lineGuide:A.offset,diff:R,snap:C.snap,offset:C.offset})})}),v.horizontal.forEach(A=>{O.horizontal.forEach(C=>{var R=Math.abs(A.offset-C.guide);a({targetKonvaNodes:C.nodes,guideKonvaNode:A.node,distance:R,snapDirection:A.snap})&&b.push({lineGuide:A.offset,diff:R,snap:C.snap,offset:C.offset})})});var p=[];const y=g.sort((A,C)=>A.diff-C.diff),d=b.sort((A,C)=>A.diff-C.diff);var m=y[0],_=d[0];return m&&y.filter(A=>Math.abs(A.diff-m.diff)<.1).forEach(A=>{p.push(Object.assign({orientation:"V"},A))}),_&&d.filter(A=>Math.abs(A.diff-_.diff)<.1).forEach(A=>{p.push(Object.assign({orientation:"H"},A))}),p}function h(v,O){const g=n.default.useRef(),b=A=>A.hasName("element")||A.hasName("page-background")||!g.current&&A.hasName("elements-area");function p(A){var C;const R=(C=v.current)===null||C===void 0?void 0:C.getStage(),S=[],E=[];return R.find(b).forEach(P=>{if(!(A.indexOf(P)>=0)){var T=P.getClientRect({skipShadow:!0,skipStroke:!0});S.push({offset:T.x,node:P,snap:"start"},{offset:T.x+T.width,node:P,snap:"end"},{offset:T.x+T.width/2,node:P,snap:"center"}),E.push({offset:T.y,node:P,snap:"start"},{offset:T.y+T.height,node:P,snap:"end"},{offset:T.y+T.height/2,node:P,snap:"center"})}}),{vertical:S,horizontal:E}}function y(A){var C;const R=(C=v.current)===null||C===void 0?void 0:C.getLayer(),S=R==null?void 0:R.children.find(E=>E.name()==="line-guides");A.forEach(E=>{if(E.orientation==="H"){var P=new r.default.Line({points:[-6e3,E.lineGuide,6e3,E.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});S==null||S.add(P),R.batchDraw()}else E.orientation==="V"&&(P=new r.default.Line({points:[E.lineGuide,-6e3,E.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),S==null||S.add(P))})}const d=A=>{const C=A.target.getLayer().children.find(N=>N.name()==="line-guides");C==null||C.destroyChildren();var R=f(p(A.target.nodes()),s(A.target));if(!R.length)return;y(R);const S=A.target.getAbsolutePosition(),E=(A.target.nodes().map(N=>N.getAbsolutePosition()),Object.assign({},S));R.forEach(N=>{switch(N.snap){case"start":case"center":case"end":switch(N.orientation){case"V":E.x=N.lineGuide+N.offset;break;case"H":E.y=N.lineGuide+N.offset}}});const P=E.x-S.x,T=E.y-S.y;A.evt.ctrlKey||A.evt.metaKey||A.target.nodes().forEach(N=>{const U=N.getAbsolutePosition();N.setAbsolutePosition({x:U.x+P,y:U.y+T})})},m=(A,C,R)=>{const S=v.current,E=S.getLayer(),P=E.children.find(W=>W.name()==="line-guides");if(P==null||P.destroyChildren(),S.getActiveAnchor()==="rotater"||Math.sqrt(Math.pow(C.x-A.x,2)+Math.pow(C.y-A.y,2))>50||!E)return C;var T=f(p(S.nodes()),{vertical:[{guide:C.x,offset:0,snap:"start",nodes:S.nodes()}],horizontal:[{guide:C.y,offset:0,snap:"start",nodes:S.nodes()}]});if(!T.length||(y(T),R.ctrlKey||R.metaKey))return C;let N=C.x,U=C.x;T.forEach(W=>{switch(W.orientation){case"V":N=W.lineGuide;break;case"H":U=W.lineGuide}});const G=Math.abs(C.x-N)<10,Z=Math.abs(C.y-U)<10;return G&&!Z?{x:N,y:A.y}:Z&&!G?{x:A.x,y:U}:G&&Z?{x:N,y:U}:C},_=A=>{if(!A.target)return;const C=A.target.getLayer(),R=C.children.find(S=>S.name()==="line-guides");R==null||R.destroyChildren(),C.batchDraw()};n.default.useEffect(()=>{v.current&&(v.current.anchorDragBoundFunc(m),v.current.on("dragstart",A=>{setTimeout(()=>{if(r.default.DD._dragElements.size===0)return;const C=[...r.default.DD._dragElements.entries()],R=C.find(([S,E])=>E.node instanceof r.default.Transformer);R&&(C.splice(C.indexOf(R),1),C.unshift(R),r.default.DD._dragElements.clear(),C.forEach(([S,E])=>{r.default.DD._dragElements.set(S,E)}))})}),v.current.on("dragmove",d),v.current.on("dragend",_),v.current.on("transformend",_),v.current.on("transform",A=>{var C,R;A.evt.ctrlKey||A.evt.metaKey?(C=v.current)===null||C===void 0||C.rotationSnapTolerance(0):(R=v.current)===null||R===void 0||R.rotationSnapTolerance(5)}))},[])}function x(v){return{vertical:[{guide:v.absolutePosition().x,offset:0,snap:"center",nodes:[v]}],horizontal:[{guide:v.absolutePosition().y,offset:0,snap:"center",nodes:[v]}]}}function w(v,O,g){const b=d=>d.hasName("element")||d.hasName("line-anchor")||d.hasName("page-background")||d.hasName("elements-area"),p=d=>{const m=d.target.getLayer().children.find(E=>E.name()==="line-guides");m==null||m.destroyChildren();var _=f(function(E){var P;const T=(P=v.current)===null||P===void 0?void 0:P.getStage();var N=[],U=[];return T.find(b).forEach(G=>{if(!(E.indexOf(G)>=0)){var Z=G.getClientRect({skipShadow:!0,skipStroke:!0});G.hasName("line-anchor")&&(Z={x:G.absolutePosition().x,y:G.absolutePosition().y,width:0,height:0}),N.push({offset:Z.x,node:G,snap:"start"},{offset:Z.x+Z.width,node:G,snap:"end"},{offset:Z.x+Z.width/2,node:G,snap:"center"}),U.push({offset:Z.y,node:G,snap:"start"},{offset:Z.y+Z.height,node:G,snap:"end"},{offset:Z.y+Z.height/2,node:G,snap:"center"})}}),{vertical:N,horizontal:U}}([d.target,...O.map(E=>E.current)]),x(d.target));if(!_.length)return;(function(E){var P;const T=(P=v.current)===null||P===void 0?void 0:P.getLayer(),N=T==null?void 0:T.children.find(U=>U.name()==="line-guides");E.forEach(U=>{if(U.orientation==="H"){var G=new r.default.Line({points:[-6e3,U.lineGuide,6e3,U.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});N==null||N.add(G),T.batchDraw()}else U.orientation==="V"&&(G=new r.default.Line({points:[U.lineGuide,-6e3,U.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),N==null||N.add(G))})})(_);const A=d.target.getAbsolutePosition(),C=Object.assign({},A);_.forEach(E=>{switch(E.snap){case"start":case"center":case"end":switch(E.orientation){case"V":C.x=E.lineGuide+E.offset;break;case"H":C.y=E.lineGuide+E.offset}}});const R=C.x-A.x,S=C.y-A.y;if(!(d.evt.ctrlKey||d.evt.metaKey)){const E=d.target.getAbsolutePosition();d.target.absolutePosition({x:E.x+R,y:E.y+S})}},y=d=>{if(!d.target)return;const m=d.target.getLayer(),_=m.children.find(A=>A.name()==="line-guides");_==null||_.destroyChildren(),m.batchDraw()};n.default.useEffect(()=>{v.current&&(v.current.on("dragmove",p),v.current.on("dragend",y))},g)}t.setSnapFilterFunc=l})(S2);(function(t){var e=_e&&_e.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(t,"__esModule",{value:!0}),t.LineElement=void 0,t.getMiddlePoints=h,t.getLinePositionFromMiddlePoints=x;const n=e(Qe),r=ti,i=Io,o=Jc,a=Qc,l=Ml,s=S2,f=Na;function h(O){const{x:g,y:b,width:p,height:y,rotation:d}=O.a,m=d*Math.PI/180,_={x:g+y/2*Math.cos(m+Math.PI/2),y:b+y/2*Math.sin(m+Math.PI/2)};return{middleLeft:_,middleRight:{x:_.x+p*Math.cos(m),y:_.y+p*Math.sin(m)}}}function x(O,g,b){const p=Math.sqrt(Math.pow(g.x-O.x,2)+Math.pow(g.y-O.y,2)),y=Math.atan2(g.y-O.y,g.x-O.x),d=180*y/Math.PI;return{x:O.x+Math.cos(y-Math.PI/2)*b/2,y:O.y+Math.sin(y-Math.PI/2)*b/2,width:p,height:b,rotation:d}}const w=(O,g)=>({offsetX:5/O,offsetY:5/O,width:10/O,height:10/O,fill:"white",stroke:"rgb(0, 161, 255)",strokeWidth:2,strokeScaleEnabled:!1,draggable:!0,dragDistance:0,onMouseEnter:b=>{b.target.getStage().container().style.cursor="crosshair"},onMouseLeave:b=>{b.target.getStage().container().style.cursor=""},onDragStart:b=>{g.history.startTransaction()},onDragEnd:b=>{g.history.endTransaction()}}),v=(0,r.observer)(({element:O,type:g})=>{const b=(0,o.useColor)(O,O.a.color,"fill"),p=(0,o.useColor)(O,O.a.color,"stroke"),y=Object.assign(Object.assign(Object.assign({strokeWidth:O.height,lineCap:"round",lineJoin:"round"},p),b),{opacity:O.a.opacity,hideInExport:!O.showInExport});return n.default.createElement(n.default.Fragment,null,g==="arrow"&&n.default.createElement(i.Line,Object.assign({points:[3*O.height,2*-O.height,0,0,3*O.height,2*O.height]},y)),g==="triangle"&&n.default.createElement(i.Line,Object.assign({points:[3*O.height,2*-O.height,0,0,3*O.height,2*O.height],closed:!0},y)),g==="bar"&&n.default.createElement(i.Line,Object.assign({points:[0,2*-O.height,0,2*O.height],closed:!0},y)),g==="square"&&n.default.createElement(i.Line,Object.assign({points:[0,2*-O.height,4*O.height,2*-O.height,4*O.height,2*O.height,0,2*O.height],closed:!0},y)),g==="circle"&&n.default.createElement(i.Circle,Object.assign({x:2*O.height,y:0,radius:2*O.height},y)))});t.LineElement=(0,r.observer)(({element:O,store:g})=>{const b=n.default.useRef(null),p=n.default.useRef(null),y=n.default.useRef(null),d=O.selectable||g.role==="admin",m=(0,f.isTouchDevice)(),[_,A]=n.default.useState(!1),C=g.selectedElements.indexOf(O)>=0&&g.selectedElements.length===1,R=g.selectedShapes.indexOf(O)>=0,{middleLeft:S,middleRight:E}=h(O);(0,s.useAnchorSnap)(p,[b],[C]),(0,s.useAnchorSnap)(y,[b],[C]);const P=(0,o.useColor)(O,O.a.color,"stroke");return n.default.createElement(n.default.Fragment,null,n.default.createElement(i.Line,Object.assign({ref:b,name:"element",id:O.id,x:O.a.x,y:O.a.y,points:[0,0,O.a.width,0],offsetY:-O.a.height/2,strokeWidth:O.a.height,hitStrokeWidth:Math.max(O.a.height,20),dash:O.dash.map(T=>T*O.a.height)},P,{rotation:O.a.rotation,opacity:O.animated("opacity"),shadowEnabled:O.shadowEnabled,shadowBlur:O.shadowBlur,shadowOffsetX:O.shadowOffsetX,shadowOffsetY:O.shadowOffsetY,shadowColor:O.shadowColor,shadowOpacity:O.shadowOpacity,listening:d,draggable:m?O.draggable&&R:O.draggable,preventDefault:!m||R,hideInExport:!O.showInExport,onMouseEnter:()=>{A(!0)},onMouseLeave:()=>{A(!1)},onDragMove:T=>{O.set({x:T.target.x(),y:T.target.y()})},onDragEnd:T=>{O.set({x:T.target.x(),y:T.target.y()})},onTransform:T=>{const N=T.target.scaleX();T.target.scaleX(1),T.target.scaleY(1),O.set({height:O.height*N,width:O.width*N,x:T.target.x(),y:T.target.y(),rotation:T.target.rotation()})}})),n.default.createElement(i.Group,{x:S.x,y:S.y,rotation:O.rotation,hideInExport:!O.showInExport},n.default.createElement(v,{element:O,type:O.startHead})),n.default.createElement(i.Group,{x:E.x,y:E.y,rotation:O.rotation+180},n.default.createElement(v,{element:O,type:O.endHead})),(_||R&&!C)&&n.default.createElement(l.Highlighter,{element:O}),C&&O.resizable&&n.default.createElement(a.Portal,{selector:".page-abs-container",enabled:!0},n.default.createElement(i.Group,{visible:C},n.default.createElement(i.Rect,Object.assign({x:S.x,y:S.y,ref:p,name:"line-anchor"},w(g.scale,g),{onDragMove:T=>{const N=x(T.target.position(),E,O.height);O.set({x:N.x,y:N.y,width:N.width,rotation:N.rotation})}})),n.default.createElement(i.Rect,Object.assign({x:E.x,y:E.y,ref:y,name:"line-anchor"},w(g.scale,g),{onDragMove:T=>{const N=x(S,T.target.position(),O.height);O.set({x:N.x,y:N.y,width:N.width,rotation:N.rotation})}})))))})})(fS);var dS={};(function(t){var e=_e&&_e.__createBinding||(Object.create?function(L,M,D,B){B===void 0&&(B=D);var V=Object.getOwnPropertyDescriptor(M,D);V&&!("get"in V?!M.__esModule:V.writable||V.configurable)||(V={enumerable:!0,get:function(){return M[D]}}),Object.defineProperty(L,B,V)}:function(L,M,D,B){B===void 0&&(B=D),L[B]=M[D]}),n=_e&&_e.__setModuleDefault||(Object.create?function(L,M){Object.defineProperty(L,"default",{enumerable:!0,value:M})}:function(L,M){L.default=M}),r=_e&&_e.__importStar||function(L){if(L&&L.__esModule)return L;var M={};if(L!=null)for(var D in L)D!=="default"&&Object.prototype.hasOwnProperty.call(L,D)&&e(M,L,D);return n(M,L),M},i=_e&&_e.__importDefault||function(L){return L&&L.__esModule?L:{default:L}};Object.defineProperty(t,"__esModule",{value:!0}),t.VideoElement=t.useImageLoader=t.setImageLoaderHook=void 0;const o=i(Qe),a=ti,l=Qi,s=Io,f=i(Yp),h=i(ki),x=Qc,w=Ml,v=Yi,O=r(au),g=Qr,b=ef,p=Rl,y=Na;function d(){return document.createElement("canvas")}async function m(L){if(!(L.indexOf("data:image/svg+xml")>=0||L.indexOf(".svg")>=0))return L;const M=await O.urlToString(L),D=O.fixSize(M);return O.svgToURL(D)}const _=L=>{const[M,D]=o.default.useState(L);return o.default.useEffect(()=>{(async()=>{const B=await m(L);B!==M&&D(B)})()},[L]),M},A=new window.Image;A.src=O.svgToURL(`
|
|
228
228
|
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
229
229
|
<path opacity="0.6" d="M4 5.49683V18.5032C4 20.05 5.68077 21.0113 7.01404 20.227L18.0694 13.7239C19.384 12.9506 19.384 11.0494 18.0694 10.2761L7.01404 3.77296C5.68077 2.98869 4 3.95 4 5.49683Z" fill="white"/>
|
|
230
230
|
<path d="M4 5.49683V18.5032C4 20.05 5.68077 21.0113 7.01404 20.227L18.0694 13.7239C19.384 12.9506 19.384 11.0494 18.0694 10.2761L7.01404 3.77296C5.68077 2.98869 4 3.95 4 5.49683Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
@@ -236,7 +236,7 @@ For more info see: https://github.com/konvajs/react-konva/issues/194
|
|
|
236
236
|
<path d="M14 19L14 5C14 3.89543 14.8954 3 16 3L17 3C18.1046 3 19 3.89543 19 5L19 19C19 20.1046 18.1046 21 17 21L16 21C14.8954 21 14 20.1046 14 19Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
237
237
|
<path d="M10 19L10 5C10 3.89543 9.10457 3 8 3L7 3C5.89543 3 5 3.89543 5 5L5 19C5 20.1046 5.89543 21 7 21L8 21C9.10457 21 10 20.1046 10 19Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
238
238
|
</svg>
|
|
239
|
-
`);function R(L,M,D,B,V,Y,F){for(var $=new ImageData(M,D),z=new Int32Array(L.data.buffer),K=L.width,X=new Int32Array($.data.buffer),Q=$.width,J=M/Y,ne=D/F,ie=Math.round(1/J),oe=Math.round(1/ne),he=ie*oe,me=0;me<$.height;me++)for(var Pe=0;Pe<Q;Pe++){for(var re=B+Math.round(Pe/J)+(V+Math.round(me/ne))*K,ae=0,we=0,be=0,te=0,fe=0;fe<oe;fe++)for(var de=0;de<ie;de++){var Ee=z[re+de+fe*K];ae+=Ee<<24>>>24,we+=Ee<<16>>>24,be+=Ee<<8>>>24,te+=Ee>>>24}ae=Math.round(ae/he),we=Math.round(we/he),be=Math.round(be/he),te=Math.round(te/he),X[Pe+me*Q]=te<<24|be<<16|we<<8|ae}return $}function S(L,M){var D,B;const V=d();V.width=L.width,V.height=L.height,(D=V.getContext("2d"))===null||D===void 0||D.drawImage(L,0,0,V.width,V.height);const Y=R(V.getContext("2d").getImageData(0,0,V.width,V.height),Math.floor(V.width*M),Math.floor(V.height*M),0,0,V.width,V.height);return V.width=Math.floor(V.width*M),V.height=Math.floor(V.height*M),(B=V.getContext("2d"))===null||B===void 0||B.putImageData(Y,0,0),V}const E=(L,M,D,B,V=0,Y=!1)=>{const F=Math.floor(Math.max(L.width*B,1)),$=Math.floor(Math.max(L.height*B,1)),z=Math.min(V*B,F/2,$/2),K=Math.max(L.width/D.width,L.height/D.height)*B,X=L.page._exportingOrRendering&&g.flags.imageDownScalingEnabled&&K<1&&!Y,Q=D.x===0&&D.y===0&&D.width===(M==null?void 0:M.width)&&D.height===(M==null?void 0:M.height),J=o.default.useMemo(()=>{if(!(!M||!M.width||!M.height))return Q&&z===0&&!X?void 0:d()},[M,z,X,Q]),ne=()=>{if(!J||!M)return;J.width=F,J.height=$;const ie=J.getContext("2d");if(!ie)return;z&&(ie.beginPath(),ie.moveTo(z,0),ie.lineTo(F-z,0),ie.arc(F-z,z,z,3*Math.PI/2,0,!1),ie.lineTo(F,$-z),ie.arc(F-z,$-z,z,0,Math.PI/2,!1),ie.lineTo(z,$),ie.arc(z,$-z,z,Math.PI/2,Math.PI,!1),ie.lineTo(0,z),ie.arc(z,z,z,Math.PI,3*Math.PI/2,!1),ie.clip());const oe=X?S(M,K):M,he=X?{x:Math.floor(D.x*K),y:Math.floor(D.y*K),width:Math.floor(D.width*K),height:Math.floor(D.height*K)}:D;ie.drawImage(oe,he.x,he.y,he.width,he.height,0,0,J.width,J.height)};return o.default.useLayoutEffect(()=>{ne()},[J,L.width,L.height,D.x,D.y,D.width,D.height,V,B,Y,L.page._exportingOrRendering,X]),o.default.useEffect(()=>()=>{J&&J.nodeName==="CANVAS"&&h.default.Util.releaseCanvas(J)},[J]),[J||M,ne]},P=(L,M,D,B)=>{const V=_(L.clipSrc||""),[Y,F]=G(V,"anonymous"),$=L.clipSrc?F:"loaded";(0,t.useImageLoader)($,L.clipSrc,L.id);const z=o.default.useMemo(()=>{if(M&&Y)return d()},[M,Y]);function K(){var X;if(!Y||!M||!M.width||!M.height||!Y||!Y.width||!Y.height||!z)return;const Q=d(),J=Math.max(L.width/Y.width*D,L.height/Y.height*D);Q.width=Y.width*J,Q.height=Y.height*J,(X=Q.getContext("2d"))===null||X===void 0||X.drawImage(Y,0,0,Q.width,Q.height),z.width=Math.max(M.width,1),z.height=Math.max(M.height,1);const ne=z.getContext("2d");ne&&(ne.save(),ne.drawImage(Q,0,0,M.width,M.height),h.default.Util.releaseCanvas(Q),ne.globalCompositeOperation="source-in",ne.drawImage(M,0,0,z.width,z.height),ne.restore())}return o.default.useLayoutEffect(()=>{K()},[z,M,Y,L.width,L.height,D,...B]),[L.clipSrc&&Y?z:M,K]},T=d(),N=(0,a.observer)(({element:L})=>{const M=Math.min(30,L.width/4,L.height/4),D=o.default.useRef(null);return o.default.useEffect(()=>{const B=D.current;if(!B)return;const V=new h.default.Animation(Y=>{B.rotate(((Y==null?void 0:Y.timeDiff)||0)/2)},B.getLayer());return V.start(),()=>{V.stop()}}),o.default.createElement(s.Group,{x:L.a.x,y:L.a.y,rotation:L.a.rotation,listening:!1,opacity:L.a.opacity,hideInExport:!L.showInExport},o.default.createElement(s.Rect,{width:L.width,height:L.height,fill:"rgba(124, 173, 212, 0.8)"}),o.default.createElement(s.Arc,{ref:D,x:L.width/2,y:L.height/2,fill:"white",outerRadius:Math.abs(M),innerRadius:Math.max(1,M-5),angle:270}))}),U=(0,a.observer)(({element:L})=>{const M="Can not load the video...",D=Math.max(10,Math.min(30,L.width/25));return o.default.createElement(s.Group,{x:L.a.x,y:L.a.y,rotation:L.a.rotation,listening:!1,opacity:L.a.opacity,hideInExport:!L.showInExport},o.default.createElement(s.Rect,{width:L.width,height:L.height,fill:"rgba(223, 102, 102, 0.8)"}),o.default.createElement(s.Text,{text:M,fontSize:D,width:L.width,height:L.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let G=f.default;const Z=L=>{G=L};t.setImageLoaderHook=Z;const W=(L,M,D)=>{const B=o.default.useRef(),V=()=>{var Y;(Y=B.current)===null||Y===void 0||Y.call(B),B.current=void 0};o.default.useEffect(()=>V,[]),o.default.useLayoutEffect(()=>{const Y=M.slice(0,200),F=`video with id ${D} url: ${Y}`;L!=="loading"||B.current||(B.current=(0,v.incrementLoader)(F)),L!=="loading"&&V(),L==="failed"&&(0,v.triggerLoadError)(F)},[L])};t.useImageLoader=W;function H(L,M,D){const B=o.default.useRef("loading"),V=o.default.useRef(null),[Y,F]=o.default.useState(0),$=o.default.useRef(),z=o.default.useRef(),K=o.default.useRef();return $.current===L&&z.current===M&&K.current===D||(B.current="loading",V.current=void 0,$.current=L,z.current=M,K.current=D),o.default.useLayoutEffect(function(){if(L){var X=document.createElement("video");return X.addEventListener("canplay",Q),X.addEventListener("error",J),X.crossOrigin=M,X.src=L,X.load(),function(){X.removeEventListener("canplay",Q),X.removeEventListener("error",J)}}function Q(){B.current="loaded",V.current=X,V.current.currentTime=0,F(Math.random()),V.current.removeEventListener("canplay",Q)}function J(ne){B.current="failed",V.current=void 0,F(Math.random())}},[L,M,D]),[V.current,B.current]}t.VideoElement=(0,a.observer)(({element:L,store:M})=>{var D;const[B,V]=o.default.useState(!1),Y=o.default.useRef(null),F=o.default.useRef(null),[$,z]=o.default.useState(!1),K=M.selectedShapes.indexOf(L)>=0,[X,Q]=o.default.useState(!1),[J,ne]=H(L.src,"anonymous"),ie=M.activePage===L.page;(0,t.useImageLoader)(ne,L.src,L.id),J&&(J.width=J.videoWidth,J.height=J.videoHeight,J.playsInline=!0);const oe=J||T;o.default.useEffect(()=>{J&&M.history.ignore(()=>{L.set({duration:1e3*J.duration})})},[J]),o.default.useEffect(()=>{var ke;if(!J)return;const Ye=M.animatedElementsIds,at=(!Ye.length||Ye.includes(L.id))&&M.isPlaying,Ot=ie&&(at||X);if(!Ot)return void J.pause();Ot&&(J.currentTime=L.startTime*J.duration,J.play());const xt=new h.default.Animation(()=>{St()},(ke=Y.current)===null||ke===void 0?void 0:ke.getLayer());xt.start();const un=()=>{Q(!1),J.currentTime=L.startTime*J.duration},hn=()=>{J.currentTime>=L.endTime*J.duration&&(J.pause(),J.currentTime=L.startTime*J.duration,Q(!1))};return J.addEventListener("ended",un),J.addEventListener("timeupdate",hn),()=>{J.pause(),xt.stop(),J.removeEventListener("ended",un),J.removeEventListener("timeupdate",hn)}},[J,X,M.isPlaying,ie]),o.default.useEffect(()=>{J&&(J.volume=L.volume)},[J,L.volume]);const he=o.default.useRef();o.default.useEffect(()=>{const ke=(0,l.autorun)(()=>{var Ye,at;if(J){const Ot=M.animatedElementsIds;if(Ot.length&&!Ot.includes(L.id))return;const xt=(M.currentTime-L.page.startTime)%L.duration;if(Math.abs(1e3*J.currentTime-xt)>500||!M.isPlaying){const un=xt/1e3;un!==J.currentTime&&(J.currentTime=un),J.readyState!==4&&!M.isPlaying&&!he.current&&(he.current=(0,v.incrementLoader)(`video ${L.id}`))}St(),(at=(Ye=Y.current)===null||Ye===void 0?void 0:Ye.getLayer())===null||at===void 0||at.batchDraw()}});return()=>{ke(),he.current&&(he.current(),he.current=null)}},[M,J]),o.default.useEffect(()=>{if(!J)return;const ke=()=>{var at,Ot;J.readyState!==4&&L.page._exportingOrRendering||he.current&&(St(),(Ot=(at=Y.current)===null||at===void 0?void 0:at.getLayer())===null||Ot===void 0||Ot.batchDraw(),he.current(),he.current=null)};let Ye;return L.page._exportingOrRendering&&(Ye=setInterval(ke,50)),J.addEventListener("timeupdate",ke),J.addEventListener("canplay",ke),()=>{clearInterval(Ye),J.removeEventListener("timeupdate",ke),J.removeEventListener("canplay",ke)}},[L.page._exportingOrRendering,J,L.id,v.incrementLoader]);let{cropX:me,cropY:Pe,cropWidth:re,cropHeight:ae}=L;ne!=="loaded"&&(me=Pe=0,re=ae=1);const we=oe.width*re,be=oe.height*ae,te=L.width/L.height;let fe,de;const Ee=we/be,Ve=L.type==="svg";Ve?(fe=we,de=be):te>=Ee?(fe=we,de=we/te):(fe=be*te,de=be);const Je={x:oe.width*me,y:oe.height*Pe,width:fe,height:de},Ae=(D=L.cornerRadius)!==null&&D!==void 0?D:0,[Ce,Me]=E(L,oe,Je,M._elementsPixelRatio,Ae,B||L._cropModeEnabled||L.type==="svg");let[ze,We]=P(L,Ce,M._elementsPixelRatio,[Je,Ae,M._elementsPixelRatio]);function St(){Me(),We()}const mt=Math.max(L.width/fe,L.height/de);o.default.useEffect(()=>{var ke;if(!L._cropModeEnabled)return;const Ye=(ke=Y.current)===null||ke===void 0?void 0:ke.getStage();function at(xt){L._cropModeEnabled&&xt.target!==F.current&&L.toggleCropMode(!1)}function Ot(xt){L._cropModeEnabled&&xt.target.parentNode!==Ye.content&&L.toggleCropMode(!1)}return document.body.addEventListener("click",Ot),Ye==null||Ye.on("click",at),Ye==null||Ye.on("tap",at),()=>{document.body.removeEventListener("click",Ot),document.body.removeEventListener("touchstart",Ot),Ye==null||Ye.off("click",at),Ye==null||Ye.off("click",at)}},[L._cropModeEnabled]),o.default.useLayoutEffect(()=>{if(!(B||L._cropModeEnabled))return(0,b.applyFilter)(Y.current,L),(0,l.autorun)(()=>{(0,b.applyFilter)(Y.current,L)},{delay:100})},[oe,B,re,ae,L._cropModeEnabled]),o.default.useLayoutEffect(()=>{var ke;B||L._cropModeEnabled?(ke=Y.current)===null||ke===void 0||ke.clearCache():(0,b.applyFilter)(Y.current,L)},[B,L.width,L.height,L._cropModeEnabled]),o.default.useEffect(()=>{(0,b.applyFilter)(Y.current,L)},[L.shadowEnabled,L.shadowBlur,L.cornerRadius,L.shadowColor,L.shadowOffsetX,L.shadowOffsetY,L.shadowOpacity]);const ue=o.default.useRef(null),ce=o.default.useRef(null),Se=o.default.useRef(null);o.default.useLayoutEffect(()=>{L._cropModeEnabled&&(ce.current.nodes([ue.current]),Se.current.nodes([F.current]))},[L._cropModeEnabled]);const Le=ke=>{Math.round(ke.target.x())>0&&(ke.target.x(0),ke.target.scaleX(1)),Math.round(ke.target.y())>0&&(ke.target.y(0),ke.target.scaleY(1));const Ye=ke.target.width()*ke.target.scaleX(),at=ke.target.height()*ke.target.scaleY(),Ot=Math.min(1,fe/Ye),xt=Math.min(1,de/at),un=1-Ot,hn=Math.min(un,Math.max(0,Math.round(-ke.target.x())/Ye)),pn=1-xt,rr=Math.min(pn,Math.max(0,Math.round(-ke.target.y())/at));ke.target.setAttrs({x:-hn*oe.width,y:-rr*oe.height,scaleX:1,scaleY:1}),L.set({cropX:hn,cropY:rr,cropWidth:Ot,cropHeight:xt})},Ne=()=>{L.type!=="svg"&&L.contentEditable&&setTimeout(()=>{L.toggleCropMode(!0)})},ge=ne==="loading",Xe=ne==="failed",Oe=!ge&&!Xe,$e=o.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Wt=Oe?L.a.opacity:0;(0,p.useFadeIn)(Y,Wt);const Tt=L.selectable||M.role==="admin",Yt=(0,y.isTouchDevice)();return o.default.createElement(o.default.Fragment,null,ge&&o.default.createElement(N,{element:L}),Xe&&o.default.createElement(U,{element:L}),o.default.createElement(s.Image,{ref:Y,name:"element",id:L.id,image:ze,x:L.a.x,y:L.a.y,width:L.a.width||1,height:L.a.height||1,rotation:L.a.rotation,opacity:Wt,shadowEnabled:L.shadowEnabled,shadowBlur:L.shadowBlur,shadowOffsetX:L.shadowOffsetX,shadowOffsetY:L.shadowOffsetY,shadowColor:L.shadowColor,shadowOpacity:L.shadowOpacity,customCrop:Je,listening:Tt,draggable:Yt?L.draggable&&K:L.draggable,preventDefault:!Yt||K,hideInExport:!L.showInExport,onMouseEnter:()=>{z(!0)},onMouseLeave:()=>{z(!1)},onDragMove:ke=>{L.set({x:ke.target.x(),y:ke.target.y()})},onDragEnd:ke=>{L.set({x:ke.target.x(),y:ke.target.y()})},onDblClick:Ne,onDblTap:Ne,onTransformStart:()=>{V(!0),$e.current={cropX:L.cropX,cropY:L.cropY,cropWidth:L.cropWidth,cropHeight:L.cropHeight}},onTransform:ke=>{var Ye;const at=ke.currentTarget,Ot=Math.abs(at.scaleX()-1)<1e-7?1:at.scaleX(),xt=Math.abs(at.scaleY()-1)<1e-7?1:at.scaleY();at.scaleX(1),at.scaleY(1);const un=(Ye=ke.target.getStage())===null||Ye===void 0?void 0:Ye.findOne("Transformer"),hn=1-fe/oe.width,pn=Math.min(hn,Math.max(0,L.cropX)),rr=1-de/oe.height,to=Math.min(rr,Math.max(0,L.cropY)),wr=un.getActiveAnchor(),Ie=!(wr.indexOf("middle")>=0||wr.indexOf("center")>=0),et=!Ie&&Ot<1&&$e.current.cropHeight>de/oe.height;let ft=Ie?L.cropWidth:L.cropWidth*Ot;et&&(ft=L.cropWidth);const Ft=!Ie&&xt<1&&$e.current.cropWidth>fe/oe.width;let Pt=Ie?L.cropHeight:L.cropHeight*xt;Ft&&(Pt=L.cropHeight),Ve&&(ft=L.cropWidth,Pt=L.cropHeight),L.set({cropX:pn,cropY:to,x:at.x(),y:at.y(),width:at.width()*Ot,height:at.height()*xt,rotation:ke.target.rotation(),cropWidth:Math.min(ft,1-pn),cropHeight:Math.min(Pt,1-to)})},onTransformEnd:ke=>{const Ye=ke.currentTarget;L.set({width:Ye.width(),height:Ye.height(),x:Ye.x(),y:Ye.y(),rotation:ke.target.rotation(),cropWidth:fe/oe.width,cropHeight:de/oe.height}),V(!1)}}),o.default.createElement(s.Rect,{x:L.a.x,y:L.a.y,width:Math.max(L.a.width-L.borderSize,0),height:Math.max(L.a.height-L.borderSize,0),opacity:Wt,offsetX:-L.borderSize/2,offsetY:-L.borderSize/2,stroke:L.borderColor,strokeWidth:L.borderSize,listening:!1,visible:!!L.borderSize,rotation:L.rotation,cornerRadius:Math.max(0,Ae-L.borderSize),hideInExport:!L.showInExport}),!X&&!M.isPlaying&&o.default.createElement(s.Image,{image:A,x:L.a.x+L.a.width/2-15/M.scale,y:L.a.y+L.a.height/2-15/M.scale,width:30/M.scale,height:30/M.scale,hideInExport:!0,onClick:()=>{Q(!0)},onTap:()=>{Q(!0)}}),X&&!M.isPlaying&&o.default.createElement(s.Image,{image:C,x:L.a.x+L.a.width/2-15/M.scale,y:L.a.y+L.a.height/2-15/M.scale,width:30/M.scale,height:30/M.scale,hideInExport:!0,onClick:()=>{Q(!1)},onTap:()=>{Q(!1)}}),L._cropModeEnabled&&o.default.createElement(x.Portal,{selector:".page-abs-container",enabled:!0},o.default.createElement(s.Rect,{x:-window.innerWidth/M.scale,y:-window.innerWidth/M.scale,width:window.innerWidth/M.scale*3,height:window.innerWidth/M.scale*3,fill:"rgba(0,0,0,0.3)"}),o.default.createElement(s.Image,{listening:!1,image:ze,x:L.a.x,y:L.a.y,width:L.a.width,height:L.a.height,rotation:L.a.rotation,shadowEnabled:L.shadowEnabled,shadowBlur:L.shadowBlur}),o.default.createElement(s.Group,{x:L.a.x,y:L.a.y,rotation:L.a.rotation,scaleX:mt,scaleY:mt},o.default.createElement(s.Image,{image:oe,ref:F,opacity:.4,draggable:!0,x:-L.cropX*oe.width,y:-L.cropY*oe.height,onDragMove:Le,onTransform:Le}),o.default.createElement(s.Transformer,{ref:Se,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(ke,Ye)=>Ye.width<5||Ye.height<5?ke:Ye,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),o.default.createElement(s.Rect,{width:fe,height:de,ref:ue,listening:!1,onTransform:ke=>{ke.target.x()<-L.cropX*oe.width-1e-9&&(ke.target.x(-L.cropX*oe.width),ke.target.scaleX(1)),ke.target.y()<-L.cropY*oe.height-1e-9&&(ke.target.y(-L.cropY*oe.height),ke.target.scaleY(1));const Ye=Math.min(1,Math.max(0,L.cropX+ke.target.x()/oe.width)),at=Math.min(1,Math.max(0,ke.target.y()/oe.height+L.cropY)),Ot=ke.target.width()*ke.target.scaleX(),xt=ke.target.height()*ke.target.scaleY(),un=Math.min(1-Ye,Ot/oe.width),hn=Math.min(1-at,xt/oe.height),pn=ke.target.getAbsolutePosition(ke.target.getParent().getParent());ke.target.scale({x:1,y:1}),ke.target.position({x:0,y:0}),L.set({x:pn.x,y:pn.y,cropX:Ye,cropY:at,cropWidth:un,cropHeight:hn,width:Math.min(Ot*mt,oe.width*(1-Ye)*mt),height:Math.min(xt*mt,oe.height*(1-at)*mt)})}}),o.default.createElement(s.Transformer,{ref:ce,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(ke,Ye)=>Ye.width<5||Ye.height<5?ke:Ye,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),($||K)&&o.default.createElement(w.Highlighter,{element:L}))})})(dS);var hS={},Jp={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TYPES=t.circleData=t.rightTriangleData=t.triangleData=t.rectData=void 0,t.starPath=o,t.diamondPath=a,t.pentagonPath=l,t.hexagonPath=s,t.speechBubblePath=h,t.crossPath=x,t.subTypeToPathDataFunc=w,t.figureToSvg=O;const e=({width:g,height:b,cornerRadius:p})=>{if(p>0){const y=Math.min(p,g/2,b/2);return`M 0 ${y} A ${y} ${y} 0 0 1 ${y} 0 L ${g-y} 0 A ${y} ${y} 0 0 1 ${g} ${y} L ${g} ${b-y} A ${y} ${y} 0 0 1 ${g-y} ${b} L ${y} ${b} A ${y} ${y} 0 0 1 0 ${b-y} Z`}return`M 0 0 L ${g} 0 L ${g} ${b} L 0 ${b} Z`};t.rectData=e;const n=({width:g,height:b})=>`M ${g/2} 0 L ${g} ${b} L 0 ${b} Z`;t.triangleData=n;const r=({width:g,height:b})=>`M 0 0 L ${g} 0 L 0 ${b} Z`;t.rightTriangleData=r;const i=({width:g,height:b})=>`M ${g/2} ${b/2} m -${g/2}, 0 a ${g/2},${b/2} 0 1,0 ${g},0 a ${g/2},${b/2} 0 1,0 -${g},0`;function o({width:g,height:b}){const p=g/2,y=b/2,d=g/2,m=b/2,_=d/2,A=m/2;let C="",R=Math.PI/5;for(let S=0;S<10;S++){const E=S%2==0?m:A,P=p+(S%2==0?d:_)*Math.sin(S*R),T=y-E*Math.cos(S*R);S===0?C=`M ${P} ${T}`:C+=` L ${P} ${T}`}return C+" Z"}function a({width:g,height:b}){const p=g/2,y=b/2;return`M ${p} 0 L ${g} ${y} L ${p} ${b} L 0 ${y} Z`}function l({width:g,height:b}){const p=g/2,y=b/2,d=g/2,m=b/2;let _="",A=2*Math.PI/5;for(let C=0;C<5;C++){const R=m,S=p+d*Math.sin(C*A),E=y-R*Math.cos(C*A);C===0?_=`M ${S} ${E}`:_+=` L ${S} ${E}`}return _+" Z"}function s({width:g,height:b}){const p=g/2,y=b/2,d=g/2,m=b/2;let _="",A=2*Math.PI/6;for(let C=0;C<6;C++){const R=m,S=p+d*Math.sin(C*A),E=y-R*Math.cos(C*A);C===0?_=`M ${S} ${E}`:_+=` L ${S} ${E}`}return _+" Z"}function f({path:g,aspectRatio:b,width:p,height:y}){return{path:g,scaleX:p/b.width,scaleY:y/b.height}}function h({width:g,height:b}){const p=.1*Math.min(g,b),y=.2*g,d=.2*b,m=.5*g;let _=`M ${p},0`;return _+=" H "+(g-p),_+=` A ${p},${p} 0 0 1 ${g},${p}`,_+=" V "+(b-p-d),_+=` A ${p},${p} 0 0 1 ${g-p},${b-d}`,_+=` H ${m+y/2}`,_+=` L ${m},${b}`,_+=` L ${m-y/2},${b-d}`,_+=` H ${p}`,_+=` A ${p},${p} 0 0 1 0,${b-p-d}`,_+=` V ${p}`,_+=` A ${p},${p} 0 0 1 ${p},0`,_+=" Z",_}function x({width:g,height:b}){const p=.3*g,y=.3*b,d=g/2,m=b/2,_=d-p/2,A=d+p/2,C=m-y/2,R=m+y/2;let S=`M ${_},0 `;return S+=`H ${A} `,S+=`V ${C} `,S+=`H ${g} `,S+=`V ${R} `,S+=`H ${A} `,S+=`V ${b} `,S+=`H ${_} `,S+=`V ${R} `,S+="H 0 ",S+=`V ${C} `,S+=`H ${_} `,S+="V 0 ",S+="Z",S}function w(g){return t.TYPES[g]||t.rectData}function v(g,b){const{width:p,height:y,fill:d,stroke:m,strokeWidth:_,dash:A}=g,C=(A||[]).map(T=>T*_);let R=b(g),S=1,E=1;typeof R!="string"&&(S=R.scaleX,E=R.scaleY,R=R.path);const P=`clip-${g.id||Math.random()}`;return`
|
|
239
|
+
`);function R(L,M,D,B,V,Y,F){for(var $=new ImageData(M,D),z=new Int32Array(L.data.buffer),K=L.width,X=new Int32Array($.data.buffer),Q=$.width,J=M/Y,ne=D/F,ie=Math.round(1/J),oe=Math.round(1/ne),de=ie*oe,me=0;me<$.height;me++)for(var Pe=0;Pe<Q;Pe++){for(var re=B+Math.round(Pe/J)+(V+Math.round(me/ne))*K,ae=0,we=0,be=0,te=0,fe=0;fe<oe;fe++)for(var he=0;he<ie;he++){var Ee=z[re+he+fe*K];ae+=Ee<<24>>>24,we+=Ee<<16>>>24,be+=Ee<<8>>>24,te+=Ee>>>24}ae=Math.round(ae/de),we=Math.round(we/de),be=Math.round(be/de),te=Math.round(te/de),X[Pe+me*Q]=te<<24|be<<16|we<<8|ae}return $}function S(L,M){var D,B;const V=d();V.width=L.width,V.height=L.height,(D=V.getContext("2d"))===null||D===void 0||D.drawImage(L,0,0,V.width,V.height);const Y=R(V.getContext("2d").getImageData(0,0,V.width,V.height),Math.floor(V.width*M),Math.floor(V.height*M),0,0,V.width,V.height);return V.width=Math.floor(V.width*M),V.height=Math.floor(V.height*M),(B=V.getContext("2d"))===null||B===void 0||B.putImageData(Y,0,0),V}const E=(L,M,D,B,V=0,Y=!1)=>{const F=Math.floor(Math.max(L.width*B,1)),$=Math.floor(Math.max(L.height*B,1)),z=Math.min(V*B,F/2,$/2),K=Math.max(L.width/D.width,L.height/D.height)*B,X=L.page._exportingOrRendering&&g.flags.imageDownScalingEnabled&&K<1&&!Y,Q=D.x===0&&D.y===0&&D.width===(M==null?void 0:M.width)&&D.height===(M==null?void 0:M.height),J=o.default.useMemo(()=>{if(!(!M||!M.width||!M.height))return Q&&z===0&&!X?void 0:d()},[M,z,X,Q]),ne=()=>{if(!J||!M)return;J.width=F,J.height=$;const ie=J.getContext("2d");if(!ie)return;z&&(ie.beginPath(),ie.moveTo(z,0),ie.lineTo(F-z,0),ie.arc(F-z,z,z,3*Math.PI/2,0,!1),ie.lineTo(F,$-z),ie.arc(F-z,$-z,z,0,Math.PI/2,!1),ie.lineTo(z,$),ie.arc(z,$-z,z,Math.PI/2,Math.PI,!1),ie.lineTo(0,z),ie.arc(z,z,z,Math.PI,3*Math.PI/2,!1),ie.clip());const oe=X?S(M,K):M,de=X?{x:Math.floor(D.x*K),y:Math.floor(D.y*K),width:Math.floor(D.width*K),height:Math.floor(D.height*K)}:D;ie.drawImage(oe,de.x,de.y,de.width,de.height,0,0,J.width,J.height)};return o.default.useLayoutEffect(()=>{ne()},[J,L.width,L.height,D.x,D.y,D.width,D.height,V,B,Y,L.page._exportingOrRendering,X]),o.default.useEffect(()=>()=>{J&&J.nodeName==="CANVAS"&&h.default.Util.releaseCanvas(J)},[J]),[J||M,ne]},P=(L,M,D,B)=>{const V=_(L.clipSrc||""),[Y,F]=G(V,"anonymous"),$=L.clipSrc?F:"loaded";(0,t.useImageLoader)($,L.clipSrc,L.id);const z=o.default.useMemo(()=>{if(M&&Y)return d()},[M,Y]);function K(){var X;if(!Y||!M||!M.width||!M.height||!Y||!Y.width||!Y.height||!z)return;const Q=d(),J=Math.max(L.width/Y.width*D,L.height/Y.height*D);Q.width=Y.width*J,Q.height=Y.height*J,(X=Q.getContext("2d"))===null||X===void 0||X.drawImage(Y,0,0,Q.width,Q.height),z.width=Math.max(M.width,1),z.height=Math.max(M.height,1);const ne=z.getContext("2d");ne&&(ne.save(),ne.drawImage(Q,0,0,M.width,M.height),h.default.Util.releaseCanvas(Q),ne.globalCompositeOperation="source-in",ne.drawImage(M,0,0,z.width,z.height),ne.restore())}return o.default.useLayoutEffect(()=>{K()},[z,M,Y,L.width,L.height,D,...B]),[L.clipSrc&&Y?z:M,K]},T=d(),N=(0,a.observer)(({element:L})=>{const M=Math.min(30,L.width/4,L.height/4),D=o.default.useRef(null);return o.default.useEffect(()=>{const B=D.current;if(!B)return;const V=new h.default.Animation(Y=>{B.rotate(((Y==null?void 0:Y.timeDiff)||0)/2)},B.getLayer());return V.start(),()=>{V.stop()}}),o.default.createElement(s.Group,{x:L.a.x,y:L.a.y,rotation:L.a.rotation,listening:!1,opacity:L.a.opacity,hideInExport:!L.showInExport},o.default.createElement(s.Rect,{width:L.width,height:L.height,fill:"rgba(124, 173, 212, 0.8)"}),o.default.createElement(s.Arc,{ref:D,x:L.width/2,y:L.height/2,fill:"white",outerRadius:Math.abs(M),innerRadius:Math.max(1,M-5),angle:270}))}),U=(0,a.observer)(({element:L})=>{const M="Can not load the video...",D=Math.max(10,Math.min(30,L.width/25));return o.default.createElement(s.Group,{x:L.a.x,y:L.a.y,rotation:L.a.rotation,listening:!1,opacity:L.a.opacity,hideInExport:!L.showInExport},o.default.createElement(s.Rect,{width:L.width,height:L.height,fill:"rgba(223, 102, 102, 0.8)"}),o.default.createElement(s.Text,{text:M,fontSize:D,width:L.width,height:L.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let G=f.default;const Z=L=>{G=L};t.setImageLoaderHook=Z;const W=(L,M,D)=>{const B=o.default.useRef(),V=()=>{var Y;(Y=B.current)===null||Y===void 0||Y.call(B),B.current=void 0};o.default.useEffect(()=>V,[]),o.default.useLayoutEffect(()=>{const Y=M.slice(0,200),F=`video with id ${D} url: ${Y}`;L!=="loading"||B.current||(B.current=(0,v.incrementLoader)(F)),L!=="loading"&&V(),L==="failed"&&(0,v.triggerLoadError)(F)},[L])};t.useImageLoader=W;function H(L,M,D){const B=o.default.useRef("loading"),V=o.default.useRef(null),[Y,F]=o.default.useState(0),$=o.default.useRef(),z=o.default.useRef(),K=o.default.useRef();return $.current===L&&z.current===M&&K.current===D||(B.current="loading",V.current=void 0,$.current=L,z.current=M,K.current=D),o.default.useLayoutEffect(function(){if(L){var X=document.createElement("video");return X.addEventListener("canplay",Q),X.addEventListener("error",J),X.crossOrigin=M,X.src=L,X.load(),function(){X.removeEventListener("canplay",Q),X.removeEventListener("error",J)}}function Q(){B.current="loaded",V.current=X,V.current.currentTime=0,F(Math.random()),V.current.removeEventListener("canplay",Q)}function J(ne){B.current="failed",V.current=void 0,F(Math.random())}},[L,M,D]),[V.current,B.current]}t.VideoElement=(0,a.observer)(({element:L,store:M})=>{var D;const[B,V]=o.default.useState(!1),Y=o.default.useRef(null),F=o.default.useRef(null),[$,z]=o.default.useState(!1),K=M.selectedShapes.indexOf(L)>=0,[X,Q]=o.default.useState(!1),[J,ne]=H(L.src,"anonymous"),ie=M.activePage===L.page;(0,t.useImageLoader)(ne,L.src,L.id),J&&(J.width=J.videoWidth,J.height=J.videoHeight,J.playsInline=!0);const oe=J||T;o.default.useEffect(()=>{J&&M.history.ignore(()=>{L.set({duration:1e3*J.duration})})},[J]),o.default.useEffect(()=>{var ke;if(!J)return;const Ye=M.animatedElementsIds,at=(!Ye.length||Ye.includes(L.id))&&M.isPlaying,Ot=ie&&(at||X);if(!Ot)return void J.pause();Ot&&(J.currentTime=L.startTime*J.duration,J.play());const xt=new h.default.Animation(()=>{St()},(ke=Y.current)===null||ke===void 0?void 0:ke.getLayer());xt.start();const un=()=>{Q(!1),J.currentTime=L.startTime*J.duration},hn=()=>{J.currentTime>=L.endTime*J.duration&&(J.pause(),J.currentTime=L.startTime*J.duration,Q(!1))};return J.addEventListener("ended",un),J.addEventListener("timeupdate",hn),()=>{J.pause(),xt.stop(),J.removeEventListener("ended",un),J.removeEventListener("timeupdate",hn)}},[J,X,M.isPlaying,ie]),o.default.useEffect(()=>{J&&(J.volume=L.volume)},[J,L.volume]);const de=o.default.useRef();o.default.useEffect(()=>{const ke=(0,l.autorun)(()=>{var Ye,at;if(J){const Ot=M.animatedElementsIds;if(Ot.length&&!Ot.includes(L.id))return;const xt=(M.currentTime-L.page.startTime)%L.duration;if(Math.abs(1e3*J.currentTime-xt)>500||!M.isPlaying){const un=xt/1e3;un!==J.currentTime&&(J.currentTime=un),J.readyState!==4&&!M.isPlaying&&!de.current&&(de.current=(0,v.incrementLoader)(`video ${L.id}`))}St(),(at=(Ye=Y.current)===null||Ye===void 0?void 0:Ye.getLayer())===null||at===void 0||at.batchDraw()}});return()=>{ke(),de.current&&(de.current(),de.current=null)}},[M,J]),o.default.useEffect(()=>{if(!J)return;const ke=()=>{var at,Ot;J.readyState!==4&&L.page._exportingOrRendering||de.current&&(St(),(Ot=(at=Y.current)===null||at===void 0?void 0:at.getLayer())===null||Ot===void 0||Ot.batchDraw(),de.current(),de.current=null)};let Ye;return L.page._exportingOrRendering&&(Ye=setInterval(ke,50)),J.addEventListener("timeupdate",ke),J.addEventListener("canplay",ke),()=>{clearInterval(Ye),J.removeEventListener("timeupdate",ke),J.removeEventListener("canplay",ke)}},[L.page._exportingOrRendering,J,L.id,v.incrementLoader]);let{cropX:me,cropY:Pe,cropWidth:re,cropHeight:ae}=L;ne!=="loaded"&&(me=Pe=0,re=ae=1);const we=oe.width*re,be=oe.height*ae,te=L.width/L.height;let fe,he;const Ee=we/be,Ve=L.type==="svg";Ve?(fe=we,he=be):te>=Ee?(fe=we,he=we/te):(fe=be*te,he=be);const Je={x:oe.width*me,y:oe.height*Pe,width:fe,height:he},Ae=(D=L.cornerRadius)!==null&&D!==void 0?D:0,[Ce,Me]=E(L,oe,Je,M._elementsPixelRatio,Ae,B||L._cropModeEnabled||L.type==="svg");let[ze,We]=P(L,Ce,M._elementsPixelRatio,[Je,Ae,M._elementsPixelRatio]);function St(){Me(),We()}const mt=Math.max(L.width/fe,L.height/he);o.default.useEffect(()=>{var ke;if(!L._cropModeEnabled)return;const Ye=(ke=Y.current)===null||ke===void 0?void 0:ke.getStage();function at(xt){L._cropModeEnabled&&xt.target!==F.current&&L.toggleCropMode(!1)}function Ot(xt){L._cropModeEnabled&&xt.target.parentNode!==Ye.content&&L.toggleCropMode(!1)}return document.body.addEventListener("click",Ot),Ye==null||Ye.on("click",at),Ye==null||Ye.on("tap",at),()=>{document.body.removeEventListener("click",Ot),document.body.removeEventListener("touchstart",Ot),Ye==null||Ye.off("click",at),Ye==null||Ye.off("click",at)}},[L._cropModeEnabled]),o.default.useLayoutEffect(()=>{if(!(B||L._cropModeEnabled))return(0,b.applyFilter)(Y.current,L),(0,l.autorun)(()=>{(0,b.applyFilter)(Y.current,L)},{delay:100})},[oe,B,re,ae,L._cropModeEnabled]),o.default.useLayoutEffect(()=>{var ke;B||L._cropModeEnabled?(ke=Y.current)===null||ke===void 0||ke.clearCache():(0,b.applyFilter)(Y.current,L)},[B,L.width,L.height,L._cropModeEnabled]),o.default.useEffect(()=>{(0,b.applyFilter)(Y.current,L)},[L.shadowEnabled,L.shadowBlur,L.cornerRadius,L.shadowColor,L.shadowOffsetX,L.shadowOffsetY,L.shadowOpacity]);const ue=o.default.useRef(null),ce=o.default.useRef(null),Se=o.default.useRef(null);o.default.useLayoutEffect(()=>{L._cropModeEnabled&&(ce.current.nodes([ue.current]),Se.current.nodes([F.current]))},[L._cropModeEnabled]);const Le=ke=>{Math.round(ke.target.x())>0&&(ke.target.x(0),ke.target.scaleX(1)),Math.round(ke.target.y())>0&&(ke.target.y(0),ke.target.scaleY(1));const Ye=ke.target.width()*ke.target.scaleX(),at=ke.target.height()*ke.target.scaleY(),Ot=Math.min(1,fe/Ye),xt=Math.min(1,he/at),un=1-Ot,hn=Math.min(un,Math.max(0,Math.round(-ke.target.x())/Ye)),pn=1-xt,rr=Math.min(pn,Math.max(0,Math.round(-ke.target.y())/at));ke.target.setAttrs({x:-hn*oe.width,y:-rr*oe.height,scaleX:1,scaleY:1}),L.set({cropX:hn,cropY:rr,cropWidth:Ot,cropHeight:xt})},Ne=()=>{L.type!=="svg"&&L.contentEditable&&setTimeout(()=>{L.toggleCropMode(!0)})},ge=ne==="loading",Xe=ne==="failed",Oe=!ge&&!Xe,$e=o.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Wt=Oe?L.a.opacity:0;(0,p.useFadeIn)(Y,Wt);const Tt=L.selectable||M.role==="admin",Yt=(0,y.isTouchDevice)();return o.default.createElement(o.default.Fragment,null,ge&&o.default.createElement(N,{element:L}),Xe&&o.default.createElement(U,{element:L}),o.default.createElement(s.Image,{ref:Y,name:"element",id:L.id,image:ze,x:L.a.x,y:L.a.y,width:L.a.width||1,height:L.a.height||1,rotation:L.a.rotation,opacity:Wt,shadowEnabled:L.shadowEnabled,shadowBlur:L.shadowBlur,shadowOffsetX:L.shadowOffsetX,shadowOffsetY:L.shadowOffsetY,shadowColor:L.shadowColor,shadowOpacity:L.shadowOpacity,customCrop:Je,listening:Tt,draggable:Yt?L.draggable&&K:L.draggable,preventDefault:!Yt||K,hideInExport:!L.showInExport,onMouseEnter:()=>{z(!0)},onMouseLeave:()=>{z(!1)},onDragMove:ke=>{L.set({x:ke.target.x(),y:ke.target.y()})},onDragEnd:ke=>{L.set({x:ke.target.x(),y:ke.target.y()})},onDblClick:Ne,onDblTap:Ne,onTransformStart:()=>{V(!0),$e.current={cropX:L.cropX,cropY:L.cropY,cropWidth:L.cropWidth,cropHeight:L.cropHeight}},onTransform:ke=>{var Ye;const at=ke.currentTarget,Ot=Math.abs(at.scaleX()-1)<1e-7?1:at.scaleX(),xt=Math.abs(at.scaleY()-1)<1e-7?1:at.scaleY();at.scaleX(1),at.scaleY(1);const un=(Ye=ke.target.getStage())===null||Ye===void 0?void 0:Ye.findOne("Transformer"),hn=1-fe/oe.width,pn=Math.min(hn,Math.max(0,L.cropX)),rr=1-he/oe.height,to=Math.min(rr,Math.max(0,L.cropY)),wr=un.getActiveAnchor(),Ie=!(wr.indexOf("middle")>=0||wr.indexOf("center")>=0),et=!Ie&&Ot<1&&$e.current.cropHeight>he/oe.height;let ft=Ie?L.cropWidth:L.cropWidth*Ot;et&&(ft=L.cropWidth);const Ft=!Ie&&xt<1&&$e.current.cropWidth>fe/oe.width;let Pt=Ie?L.cropHeight:L.cropHeight*xt;Ft&&(Pt=L.cropHeight),Ve&&(ft=L.cropWidth,Pt=L.cropHeight),L.set({cropX:pn,cropY:to,x:at.x(),y:at.y(),width:at.width()*Ot,height:at.height()*xt,rotation:ke.target.rotation(),cropWidth:Math.min(ft,1-pn),cropHeight:Math.min(Pt,1-to)})},onTransformEnd:ke=>{const Ye=ke.currentTarget;L.set({width:Ye.width(),height:Ye.height(),x:Ye.x(),y:Ye.y(),rotation:ke.target.rotation(),cropWidth:fe/oe.width,cropHeight:he/oe.height}),V(!1)}}),o.default.createElement(s.Rect,{x:L.a.x,y:L.a.y,width:Math.max(L.a.width-L.borderSize,0),height:Math.max(L.a.height-L.borderSize,0),opacity:Wt,offsetX:-L.borderSize/2,offsetY:-L.borderSize/2,stroke:L.borderColor,strokeWidth:L.borderSize,listening:!1,visible:!!L.borderSize,rotation:L.rotation,cornerRadius:Math.max(0,Ae-L.borderSize),hideInExport:!L.showInExport}),!X&&!M.isPlaying&&o.default.createElement(s.Image,{image:A,x:L.a.x+L.a.width/2-15/M.scale,y:L.a.y+L.a.height/2-15/M.scale,width:30/M.scale,height:30/M.scale,hideInExport:!0,onClick:()=>{Q(!0)},onTap:()=>{Q(!0)}}),X&&!M.isPlaying&&o.default.createElement(s.Image,{image:C,x:L.a.x+L.a.width/2-15/M.scale,y:L.a.y+L.a.height/2-15/M.scale,width:30/M.scale,height:30/M.scale,hideInExport:!0,onClick:()=>{Q(!1)},onTap:()=>{Q(!1)}}),L._cropModeEnabled&&o.default.createElement(x.Portal,{selector:".page-abs-container",enabled:!0},o.default.createElement(s.Rect,{x:-window.innerWidth/M.scale,y:-window.innerWidth/M.scale,width:window.innerWidth/M.scale*3,height:window.innerWidth/M.scale*3,fill:"rgba(0,0,0,0.3)"}),o.default.createElement(s.Image,{listening:!1,image:ze,x:L.a.x,y:L.a.y,width:L.a.width,height:L.a.height,rotation:L.a.rotation,shadowEnabled:L.shadowEnabled,shadowBlur:L.shadowBlur}),o.default.createElement(s.Group,{x:L.a.x,y:L.a.y,rotation:L.a.rotation,scaleX:mt,scaleY:mt},o.default.createElement(s.Image,{image:oe,ref:F,opacity:.4,draggable:!0,x:-L.cropX*oe.width,y:-L.cropY*oe.height,onDragMove:Le,onTransform:Le}),o.default.createElement(s.Transformer,{ref:Se,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(ke,Ye)=>Ye.width<5||Ye.height<5?ke:Ye,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),o.default.createElement(s.Rect,{width:fe,height:he,ref:ue,listening:!1,onTransform:ke=>{ke.target.x()<-L.cropX*oe.width-1e-9&&(ke.target.x(-L.cropX*oe.width),ke.target.scaleX(1)),ke.target.y()<-L.cropY*oe.height-1e-9&&(ke.target.y(-L.cropY*oe.height),ke.target.scaleY(1));const Ye=Math.min(1,Math.max(0,L.cropX+ke.target.x()/oe.width)),at=Math.min(1,Math.max(0,ke.target.y()/oe.height+L.cropY)),Ot=ke.target.width()*ke.target.scaleX(),xt=ke.target.height()*ke.target.scaleY(),un=Math.min(1-Ye,Ot/oe.width),hn=Math.min(1-at,xt/oe.height),pn=ke.target.getAbsolutePosition(ke.target.getParent().getParent());ke.target.scale({x:1,y:1}),ke.target.position({x:0,y:0}),L.set({x:pn.x,y:pn.y,cropX:Ye,cropY:at,cropWidth:un,cropHeight:hn,width:Math.min(Ot*mt,oe.width*(1-Ye)*mt),height:Math.min(xt*mt,oe.height*(1-at)*mt)})}}),o.default.createElement(s.Transformer,{ref:ce,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(ke,Ye)=>Ye.width<5||Ye.height<5?ke:Ye,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),($||K)&&o.default.createElement(w.Highlighter,{element:L}))})})(dS);var hS={},Jp={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TYPES=t.circleData=t.rightTriangleData=t.triangleData=t.rectData=void 0,t.starPath=o,t.diamondPath=a,t.pentagonPath=l,t.hexagonPath=s,t.speechBubblePath=h,t.crossPath=x,t.subTypeToPathDataFunc=w,t.figureToSvg=O;const e=({width:g,height:b,cornerRadius:p})=>{if(p>0){const y=Math.min(p,g/2,b/2);return`M 0 ${y} A ${y} ${y} 0 0 1 ${y} 0 L ${g-y} 0 A ${y} ${y} 0 0 1 ${g} ${y} L ${g} ${b-y} A ${y} ${y} 0 0 1 ${g-y} ${b} L ${y} ${b} A ${y} ${y} 0 0 1 0 ${b-y} Z`}return`M 0 0 L ${g} 0 L ${g} ${b} L 0 ${b} Z`};t.rectData=e;const n=({width:g,height:b})=>`M ${g/2} 0 L ${g} ${b} L 0 ${b} Z`;t.triangleData=n;const r=({width:g,height:b})=>`M 0 0 L ${g} 0 L 0 ${b} Z`;t.rightTriangleData=r;const i=({width:g,height:b})=>`M ${g/2} ${b/2} m -${g/2}, 0 a ${g/2},${b/2} 0 1,0 ${g},0 a ${g/2},${b/2} 0 1,0 -${g},0`;function o({width:g,height:b}){const p=g/2,y=b/2,d=g/2,m=b/2,_=d/2,A=m/2;let C="",R=Math.PI/5;for(let S=0;S<10;S++){const E=S%2==0?m:A,P=p+(S%2==0?d:_)*Math.sin(S*R),T=y-E*Math.cos(S*R);S===0?C=`M ${P} ${T}`:C+=` L ${P} ${T}`}return C+" Z"}function a({width:g,height:b}){const p=g/2,y=b/2;return`M ${p} 0 L ${g} ${y} L ${p} ${b} L 0 ${y} Z`}function l({width:g,height:b}){const p=g/2,y=b/2,d=g/2,m=b/2;let _="",A=2*Math.PI/5;for(let C=0;C<5;C++){const R=m,S=p+d*Math.sin(C*A),E=y-R*Math.cos(C*A);C===0?_=`M ${S} ${E}`:_+=` L ${S} ${E}`}return _+" Z"}function s({width:g,height:b}){const p=g/2,y=b/2,d=g/2,m=b/2;let _="",A=2*Math.PI/6;for(let C=0;C<6;C++){const R=m,S=p+d*Math.sin(C*A),E=y-R*Math.cos(C*A);C===0?_=`M ${S} ${E}`:_+=` L ${S} ${E}`}return _+" Z"}function f({path:g,aspectRatio:b,width:p,height:y}){return{path:g,scaleX:p/b.width,scaleY:y/b.height}}function h({width:g,height:b}){const p=.1*Math.min(g,b),y=.2*g,d=.2*b,m=.5*g;let _=`M ${p},0`;return _+=" H "+(g-p),_+=` A ${p},${p} 0 0 1 ${g},${p}`,_+=" V "+(b-p-d),_+=` A ${p},${p} 0 0 1 ${g-p},${b-d}`,_+=` H ${m+y/2}`,_+=` L ${m},${b}`,_+=` L ${m-y/2},${b-d}`,_+=` H ${p}`,_+=` A ${p},${p} 0 0 1 0,${b-p-d}`,_+=` V ${p}`,_+=` A ${p},${p} 0 0 1 ${p},0`,_+=" Z",_}function x({width:g,height:b}){const p=.3*g,y=.3*b,d=g/2,m=b/2,_=d-p/2,A=d+p/2,C=m-y/2,R=m+y/2;let S=`M ${_},0 `;return S+=`H ${A} `,S+=`V ${C} `,S+=`H ${g} `,S+=`V ${R} `,S+=`H ${A} `,S+=`V ${b} `,S+=`H ${_} `,S+=`V ${R} `,S+="H 0 ",S+=`V ${C} `,S+=`H ${_} `,S+="V 0 ",S+="Z",S}function w(g){return t.TYPES[g]||t.rectData}function v(g,b){const{width:p,height:y,fill:d,stroke:m,strokeWidth:_,dash:A}=g,C=(A||[]).map(T=>T*_);let R=b(g),S=1,E=1;typeof R!="string"&&(S=R.scaleX,E=R.scaleY,R=R.path);const P=`clip-${g.id||Math.random()}`;return`
|
|
240
240
|
<svg xmlns="http://www.w3.org/2000/svg" width="${p}" height="${y}">
|
|
241
241
|
<defs>
|
|
242
242
|
<clipPath id="${P}">
|
|
@@ -253,7 +253,7 @@ For more info see: https://github.com/konvajs/react-konva/issues/194
|
|
|
253
253
|
`}function O(g){const{subType:b}=g,p=w(b);return p?v(g,p):(console.error(`Polotno error: Can not convert ${g.subType} figure to svg.`),(0,t.rectData)(g))}t.circleData=i,t.TYPES={rect:t.rectData,circle:t.circleData,star:o,triangle:t.triangleData,rightTriangle:t.rightTriangleData,diamond:a,pentagon:l,hexagon:s,speechBubble:h,cross:x,arc:({width:g,height:b})=>f({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:g,height:b}),cloud:({width:g,height:b})=>f({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:g,height:b}),rightArrow:({width:g,height:b})=>{const p=.6*g;return`M 0 ${b/4} L ${p} ${b/4} L ${p} 0 L ${g} ${b/2} L ${p} ${b} L ${p} ${.75*b} L 0 ${.75*b} Z`},leftArrow:({width:g,height:b})=>{const p=.4*g;return`M ${g} ${b/4} L ${p} ${b/4} L ${p} 0 L 0 ${b/2} L ${p} ${b} L ${p} ${.75*b} L ${g} ${.75*b} Z`},downArrow:({width:g,height:b})=>{const p=.6*b;return`M ${g/4} 0 L ${g/4} ${p} L 0 ${p} L ${g/2} ${b} L ${g} ${p} L ${.75*g} ${p} L ${.75*g} 0 Z`},upArrow:({width:g,height:b})=>{const p=.4*b;return`M ${g/4} ${b} L ${g/4} ${p} L 0 ${p} L ${g/2} 0 L ${g} ${p} L ${.75*g} ${p} L ${.75*g} ${b} Z`},asterisk1:({width:g,height:b})=>f({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:g,height:b}),asterisk2:({width:g,height:b})=>f({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:g,height:b}),bookmark:({width:g,height:b})=>f({path:"M0 0H199V238L99.5 142.8L0 238V0Z",aspectRatio:{width:199,height:238},width:g,height:b}),butterfly:({width:g,height:b})=>f({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:g,height:b}),cylinder:({width:g,height:b})=>f({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:g,height:b}),diamond2:({width:g,height:b})=>f({path:"M0 55.5L124 185L248 55.5L189.307 0H58.6933L0 55.5Z",aspectRatio:{width:248,height:185},width:g,height:b}),door:({width:g,height:b})=>f({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:g,height:b}),drop1:({width:g,height:b})=>f({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:g,height:b}),drop2:({width:g,height:b})=>f({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:g,height:b}),explosion:({width:g,height:b})=>f({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:g,height:b}),flag:({width:g,height:b})=>f({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:g,height:b}),flower:({width:g,height:b})=>f({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:g,height:b}),frame:({width:g,height:b})=>f({path:"M0 0H240L200 88L240 176H0L40 88L0 0Z",aspectRatio:{width:240,height:176},width:g,height:b}),heart1:({width:g,height:b})=>f({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:g,height:b}),home:({width:g,height:b})=>f({path:"M0 62.143L95.5 0L191 62.143V195H0V62.143Z",aspectRatio:{width:191,height:195},width:g,height:b}),home2:({width:g,height:b})=>f({path:"M206 94.076L103 0L0 94.076H31.2377V189H175.607V94.076H206Z",aspectRatio:{width:206,height:189},width:g,height:b}),hourglass:({width:g,height:b})=>f({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:g,height:b}),house:({width:g,height:b})=>f({path:"M0 92.367L95 0L190 92.367V223H0V92.367Z",aspectRatio:{width:190,height:223},width:g,height:b}),keyhole:({width:g,height:b})=>f({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:g,height:b}),kiss:({width:g,height:b})=>f({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:g,height:b}),leaf:({width:g,height:b})=>f({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:g,height:b}),lightning1:({width:g,height:b})=>f({path:"M111.5 0L0 142H51.433L31.5 253L143 111H91.567L111.5 0Z",aspectRatio:{width:143,height:253},width:g,height:b}),lightning2:({width:g,height:b})=>f({path:"M126 0H43L0 120.531H36L6 227L110 80.354H73L126 0Z",aspectRatio:{width:126,height:227},width:g,height:b}),magnet:({width:g,height:b})=>f({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:g,height:b}),mithosis:({width:g,height:b})=>f({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:g,height:b}),orangeRicky:({width:g,height:b})=>f({path:"M69 0H0V69V138V207H69H138V138H69V69V0Z",aspectRatio:{width:138,height:207},width:g,height:b}),party:({width:g,height:b})=>f({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:g,height:b}),pillow:({width:g,height:b})=>f({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:g,height:b}),polygon:({width:g,height:b})=>f({path:"M110 0L219.119 63V189L110 252L0.880798 189V63L110 0Z",aspectRatio:{width:220,height:252},width:g,height:b}),rainbow:({width:g,height:b})=>f({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:g,height:b}),rhodeIsland:({width:g,height:b})=>f({path:"M69 0H0V69V138H69V207H138V138V69H69V0Z",aspectRatio:{width:138,height:207},width:g,height:b}),shell:({width:g,height:b})=>f({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:g,height:b}),shield1:({width:g,height:b})=>f({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:g,height:b}),shield2:({width:g,height:b})=>f({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:g,height:b}),skewedRectangle:({width:g,height:b})=>f({path:"M85.9799 0H290L204.02 141H0L85.9799 0Z",aspectRatio:{width:290,height:141},width:g,height:b}),softFlower:({width:g,height:b})=>f({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:g,height:b}),softStar:({width:g,height:b})=>f({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:g,height:b}),stairs1:({width:g,height:b})=>f({path:"M0 0H67.667V67.667H135.333V135.333H203V203H0V0Z",aspectRatio:{width:203,height:203},width:g,height:b}),stairs2:({width:g,height:b})=>f({path:"M50 0H0V200H200V150H150V100H100V50H50V0Z",aspectRatio:{width:200,height:200},width:g,height:b}),teewee:({width:g,height:b})=>f({path:"M69 0H138V69H207V138H138H69H0V69H69V0Z",aspectRatio:{width:207,height:138},width:g,height:b}),blob1:({width:g,height:b})=>f({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:g,height:b}),blob10:({width:g,height:b})=>f({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:g,height:b}),blob11:({width:g,height:b})=>f({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:g,height:b}),blob12:({width:g,height:b})=>f({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:g,height:b}),blob13:({width:g,height:b})=>f({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:g,height:b}),blob14:({width:g,height:b})=>f({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:g,height:b}),blob15:({width:g,height:b})=>f({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:g,height:b}),blob16:({width:g,height:b})=>f({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:g,height:b}),blob17:({width:g,height:b})=>f({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:g,height:b}),blob18:({width:g,height:b})=>f({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:g,height:b}),blob19:({width:g,height:b})=>f({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:g,height:b}),blob2:({width:g,height:b})=>f({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:g,height:b}),blob20:({width:g,height:b})=>f({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:g,height:b}),blob21:({width:g,height:b})=>f({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:g,height:b}),blob22:({width:g,height:b})=>f({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:g,height:b}),blob23:({width:g,height:b})=>f({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:g,height:b}),blob24:({width:g,height:b})=>f({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:g,height:b}),blob25:({width:g,height:b})=>f({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:g,height:b}),blob26:({width:g,height:b})=>f({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:g,height:b}),blob27:({width:g,height:b})=>f({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:g,height:b}),blob28:({width:g,height:b})=>f({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:g,height:b}),blob29:({width:g,height:b})=>f({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:g,height:b}),blob3:({width:g,height:b})=>f({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:g,height:b}),blob30:({width:g,height:b})=>f({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:g,height:b}),blob31:({width:g,height:b})=>f({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:g,height:b}),blob32:({width:g,height:b})=>f({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:g,height:b}),blob4:({width:g,height:b})=>f({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:g,height:b}),blob5:({width:g,height:b})=>f({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:g,height:b}),blob6:({width:g,height:b})=>f({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:g,height:b}),blob7:({width:g,height:b})=>f({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:g,height:b}),blob8:({width:g,height:b})=>f({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:g,height:b}),blob9:({width:g,height:b})=>f({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:g,height:b})}})(Jp);(function(t){var e=_e&&_e.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(t,"__esModule",{value:!0}),t.FigureElement=void 0;const n=e(Qe),r=ti,i=Io,o=Jp,a=Ml,l=Na,s=Jc,f={};t.FigureElement=(0,r.observer)(({element:h,store:x})=>{const w=h.selectable||x.role==="admin",v=(0,l.isTouchDevice)(),[O,g]=n.default.useState(!1),b=x.selectedShapes.indexOf(h)>=0,p=Math.min(h.strokeWidth,h.width/2,h.height/2),y=Math.max(0,Math.min(h.width/2,h.height/2,h.cornerRadius)),d=(0,s.useColor)(h,h.a.fill,"fill"),m=Object.assign(Object.assign({width:h.a.width,height:h.a.height},d),{cornerRadius:y,opacity:h.animated("opacity"),shadowEnabled:h.shadowEnabled,shadowBlur:h.shadowBlur,shadowOffsetX:h.shadowOffsetX,shadowOffsetY:h.shadowOffsetY,shadowColor:h.shadowColor,shadowOpacity:h.shadowOpacity,preventDefault:!v||b,hideInExport:!h.showInExport}),_=(0,s.useColor)(h,h.stroke,"stroke"),A=Object.assign(Object.assign({visible:p>0,x:p/2,y:p/2,width:h.a.width-p,height:h.a.height-p},_),{strokeWidth:p,cornerRadius:Math.max(0,y-p),dash:h.dash.map(E=>E*p),opacity:h.animated("opacity"),hideInExport:!h.showInExport,listening:!1}),C=(R=h.subType,f[R]||(f[R]=(S=(0,o.subTypeToPathDataFunc)(R),(0,r.observer)(({element:E,fillProps:P,strokeProps:T})=>{let N=S({width:E.a.width,height:E.a.height,cornerRadius:E.cornerRadius}),U=1,G=1;typeof N!="string"&&(U=N.scaleX,G=N.scaleY,N=N.path);const Z=n.default.useRef(null);return n.default.createElement(n.default.Fragment,null,n.default.createElement(i.Rect,{width:E.width,height:E.height,fill:"transparent"}),n.default.createElement(i.Path,Object.assign({},P,{ref:Z,data:N,scaleX:U,scaleY:G})),n.default.createElement(i.Group,{clipFunc:W=>{const H=Z.current;if(H){var L=H.dataArray;W.beginPath();for(var M=0;M<L.length;M++){var D=L[M].command,B=L[M].points;switch(D){case"L":W.lineTo(B[0],B[1]);break;case"M":W.moveTo(B[0],B[1]);break;case"C":W.bezierCurveTo(B[0],B[1],B[2],B[3],B[4],B[5]);break;case"Q":W.quadraticCurveTo(B[0],B[1],B[2],B[3]);break;case"A":var V=B[0],Y=B[1],F=B[2],$=B[3],z=B[4],K=B[5],X=B[6],Q=B[7],J=F>$?F:$,ne=F>$?1:F/$,ie=F>$?$/F:1;W.translate(V,Y),W.rotate(X),W.scale(ne,ie),W.arc(0,0,J,z,z+K,1-Q),W.scale(1/ne,1/ie),W.rotate(-X),W.translate(-V,-Y);break;case"z":W.closePath()}}}},scaleX:U,scaleY:G},n.default.createElement(i.Path,Object.assign({},T,{x:0,y:0,data:N,strokeWidth:2*T.strokeWidth,dash:T.dash.map(W=>W)}))))}))),f[R]||i.Group);var R,S;return n.default.createElement(n.default.Fragment,null,n.default.createElement(i.Group,{id:h.id,x:h.a.x,y:h.a.y,rotation:h.a.rotation,opacity:h.a.opacity,listening:w,draggable:v?h.draggable&&b:h.draggable,name:"element",onMouseEnter:()=>{g(!0)},onMouseLeave:()=>{g(!1)},onDragMove:E=>{h.set({x:E.target.x(),y:E.target.y()})},onDragEnd:E=>{h.set({x:E.target.x(),y:E.target.y()})},onTransform:E=>{const P=E.target.scale();E.target.scaleX(1),E.target.scaleY(1),h.set({width:h.width*P.x,height:h.height*P.y,x:E.target.x(),y:E.target.y(),rotation:E.target.rotation()})}},n.default.createElement(C,{element:h,fillProps:m,strokeProps:A})),(O||b)&&n.default.createElement(a.Highlighter,{element:h}))})})(hS);(function(t){var e=_e&&_e.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(t,"__esModule",{value:!0}),t.registerShapeComponent=O;const n=e(Qe),r=ti,i=Zy,o=d2,a=iS,l=fS,s=dS,f=hS,h=Io,x=Qr,w=(0,r.observer)(b=>{const{element:p,store:y}=b,{children:d}=p,m=p.selectable||y.role==="admin";return n.default.createElement(h.Group,{opacity:p.opacity,listening:m,hideInExport:!p.showInExport},d.map(_=>n.default.createElement(g,Object.assign({},b,{key:_.id,store:y,element:_}))))}),v={text:i.TextElement,image:o.ImageElement,svg:o.ImageElement,line:l.LineElement,video:s.VideoElement,figure:f.FigureElement,group:w};function O(b,p){v[b]=p}const g=(0,r.observer)(b=>{let p=v[b.element.type];return b.element.type==="text"&&x.flags.htmlRenderEnabled&&(p=a.HTMLElement),b.element.visible?p?n.default.createElement(p,Object.assign({},b)):(console.error("Can not find component for "+b.element.type),null):null});t.default=g})(Y9);var pS={};(function(t){function e(n,r,i="scale"){const o=r.width/r.height;let a,l;o>=n.width/n.height?(a=n.width,l=n.width/o):(a=n.height*o,l=n.height);let s=0,f=0;return i==="left-top"?(s=0,f=0):i==="left-middle"?(s=0,f=(n.height-l)/2):i==="left-bottom"?(s=0,f=n.height-l):i==="center-top"?(s=(n.width-a)/2,f=0):i==="center-middle"?(s=(n.width-a)/2,f=(n.height-l)/2):i==="center-bottom"?(s=(n.width-a)/2,f=n.height-l):i==="right-top"?(s=n.width-a,f=0):i==="right-middle"?(s=n.width-a,f=(n.height-l)/2):i==="right-bottom"?(s=n.width-a,f=n.height-l):i==="scale"?(s=0,f=0,a=n.width,l=n.height):console.error(new Error("Unknown clip position property - "+i)),{cropX:s,cropY:f,cropWidth:a,cropHeight:l}}Object.defineProperty(t,"__esModule",{value:!0}),t.getCrop=e})(pS);var $g={},Gg={},S_;function fj(){return S_||(S_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.setAPI=t.iconscoutDownload=t.iconscoutList=t.svgapiDownload=t.svgapiList=t.unsplashDownload=t.unsplashList=t.textTemplateList=t.templateList=t.removeBackground=t.polotnoShapesList=t.getGoogleFontImage=t.getGoogleFontsListAPI=t.URLS=t.getAPI=t.API=t.URL=void 0;const e=E2();t.URL="https://api.polotno.com",t.API="https://api.polotno.com/api";const n=()=>t.URL+"/api";t.getAPI=n;const r={},i=(d,m)=>{r[d]||(r[d]=!0,console.error(m))},o=`API for iconscout is provided as a demonstration.
|
|
254
254
|
For production usage you have to use your own API endpoint.
|
|
255
255
|
https://iconscout.com/developers, https://iconscout.com/legal/api-license-development-agreement
|
|
256
|
-
https://polotno.com/docs/server-api`;t.URLS={unsplashList:({query:d,page:m=1})=>`${(0,t.getAPI)()}/get-unsplash?query=${d}&per_page=20&page=${m}&KEY=${(0,e.getKey)()}`,unsplashDownload:d=>`${(0,t.getAPI)()}/download-unsplash?id=${d}&KEY=${(0,e.getKey)()}`,svgapiList:({query:d,page:m=0})=>`${(0,t.getAPI)()}/get-svgapi?query=${d}&page=${m}&per_page=20&KEY=${(0,e.getKey)()}`,svgapiDownload:d=>`${(0,t.getAPI)()}/download-svgapi?path=${d}&KEY=${(0,e.getKey)()}`,iconscoutList:({query:d,page:m=1})=>(i("iconscout",o),`${(0,t.getAPI)()}/get-iconscout?query=${d}&page=${m}&KEY=${(0,e.getKey)()}`),iconscoutDownload:d=>(i("iconscout",o),`${(0,t.getAPI)()}/download-iconscout?uuid=${d}&KEY=${(0,e.getKey)()}`),nounProjectList:({query:d,page:m=1})=>`${(0,t.getAPI)()}/get-nounproject?query=${d}&page=${m}&KEY=${(0,e.getKey)()}`,nounProjectDownload:d=>`${(0,t.getAPI)()}/download-nounproject?id=${d}&KEY=${(0,e.getKey)()}`,templateList:({query:d,page:m=1,sizeQuery:_})=>`${(0,t.getAPI)()}/get-templates?${_}&query=${d}&per_page=30&page=${m}&KEY=${(0,e.getKey)()}`};const a=()=>`${(0,t.getAPI)()}/get-google-fonts?KEY=${(0,e.getKey)()}`;t.getGoogleFontsListAPI=a;const l=d=>{return`${t.URL}/google-fonts-previews/black/${m=d,_=" ",A="-",m.replace(new RegExp(_,"g"),A)}.png`;var m,_,A};t.getGoogleFontImage=l;const s=()=>`${(0,t.getAPI)()}/get-basic-shapes?KEY=${(0,e.getKey)()}`;t.polotnoShapesList=s;const f=()=>`${(0,t.getAPI)()}/remove-image-background?KEY=${(0,e.getKey)()}`;t.removeBackground=f;const h=d=>t.URLS.templateList(d);t.templateList=h;const x=()=>`${(0,t.getAPI)()}/get-text-templates?KEY=${(0,e.getKey)()}`;t.textTemplateList=x;const w=d=>t.URLS.unsplashList(d);t.unsplashList=w;const v=d=>t.URLS.unsplashDownload(d);t.unsplashDownload=v;const O=d=>t.URLS.svgapiList(d);t.svgapiList=O;const g=d=>t.URLS.svgapiDownload(d);t.svgapiDownload=g;const b=d=>t.URLS.iconscoutList(d);t.iconscoutList=b;const p=d=>t.URLS.iconscoutDownload(d);t.iconscoutDownload=p;const y=(d,m)=>{t.URLS[d]=m};t.setAPI=y}(Gg)),Gg}var E_;function E2(){return E_||(E_=1,function(t){var e=_e&&_e.__createBinding||(Object.create?function(R,S,E,P){P===void 0&&(P=E);var T=Object.getOwnPropertyDescriptor(S,E);T&&!("get"in T?!S.__esModule:T.writable||T.configurable)||(T={enumerable:!0,get:function(){return S[E]}}),Object.defineProperty(R,P,T)}:function(R,S,E,P){P===void 0&&(P=E),R[P]=S[E]}),n=_e&&_e.__setModuleDefault||(Object.create?function(R,S){Object.defineProperty(R,"default",{enumerable:!0,value:S})}:function(R,S){R.default=S}),r=_e&&_e.__importStar||function(R){if(R&&R.__esModule)return R;var S={};if(R!=null)for(var E in R)E!=="default"&&Object.prototype.hasOwnProperty.call(R,E)&&e(S,R,E);return n(S,R),S};Object.defineProperty(t,"__esModule",{value:!0}),t.getKey=t.isCreditVisible=void 0,t.isKeyPaid=A,t.validateKey=C;const i=r(Qi),o=fj(),a=Qr,l=i.observable({value:!1}),s=()=>l.value;t.isCreditVisible=s;const f=i.action(()=>{l.value=!0});let h="";const x=()=>h||"";t.getKey=x;const w=5,v=3e3,O="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",g="Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet",b="Can not validate Polotno API key. Please report to anton@polotno.com immediately.",p="%cPolotno Free Version. Development or non-commercial usage only. https://polotno.com/";let y=window.location.origin;const d=navigator.userAgent.indexOf("Headless")>-1,m=navigator.userAgent.indexOf("Electron")>-1;y==="file://"&&d&&(y="headless"),y==="file://"&&m&&(y="electron");const _=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${y}" here: https://polotno.com/cabinet`;async function A(R){for(let S=0;S<w;S++)try{const E=await fetch((0,o.getAPI)()+"/validate-key",{method:"POST",body:JSON.stringify({key:R,site:location.host})});if(!R)return console.warn(O),!1;if(E.status!==200){await new Promise(T=>setTimeout(T,v));continue}const P=await E.json();return P.is_valid||console.warn(g),P.is_paid||console.log(p,"background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),P.is_domain_valid||console.log(_,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),(0,a.useRemoveBackground)(P.remove_background_enabled),P.is_paid||!1}catch{await new Promise(P=>setTimeout(P,v))}return console.error(b),!0}async function C(R,S){h=R,await A(R)&&!S||f()}}($g)),$g}var e0={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.pxToUnitString=t.unitToPx=t.pxToUnitRounded=t.pxToUnit=void 0;const e=({px:o,unit:a="px",dpi:l})=>{switch(a){case"pt":default:return o;case"mm":return o/(l/25.4);case"cm":return o/(l/2.54);case"in":return o/l}};t.pxToUnit=e;const n=({px:o,precious:a=2,dpi:l=72,unit:s="px"})=>parseFloat((0,t.pxToUnit)({px:o,dpi:l,unit:s}).toFixed(a));t.pxToUnitRounded=n;const r=({unitVal:o,dpi:a,unit:l})=>o/(0,t.pxToUnit)({px:1,unit:l,dpi:a});t.unitToPx=r;const i=o=>{const a=parseFloat((0,t.pxToUnit)(o).toFixed(1));switch(o.unit){case"pt":return`${Math.round(a)}pt`;case"mm":return`${a}mm`;case"cm":return`${a}cm`;case"in":return`${a}in`;default:return`${Math.round(a)}px`}};t.pxToUnitString=i})(e0);(function(t){var e=_e&&_e.__rest||function(H,L){var M={};for(var D in H)Object.prototype.hasOwnProperty.call(H,D)&&L.indexOf(D)<0&&(M[D]=H[D]);if(H!=null&&typeof Object.getOwnPropertySymbols=="function"){var B=0;for(D=Object.getOwnPropertySymbols(H);B<D.length;B++)L.indexOf(D[B])<0&&Object.prototype.propertyIsEnumerable.call(H,D[B])&&(M[D[B]]=H[D[B]])}return M},n=_e&&_e.__importDefault||function(H){return H&&H.__esModule?H:{default:H}};Object.defineProperty(t,"__esModule",{value:!0}),t.registerNextDomDrop=t.setTransformerStyle=void 0,t.registerTransformerAttrs=R;const r=n(Qe),i=ti,o=Qi,a=Io,l=n(Yp),s=n(ki),f=n(Y9),h=S2,x=d2,w=pS,v=E2(),O=su,g=e0,b=Qr,p=Na,y=s.default.DD._drag;window.removeEventListener("mousemove",y),s.default.DD._drag=function(H){(0,o.runInAction)(()=>{y.call(this,H)})},window.addEventListener("mousemove",s.default.DD._drag);const d=new s.default.Group;d.add(new s.default.Rect({width:20,height:20,fill:"white"})),d.add(new s.default.Path({scaleX:20/24,scaleY:20/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 m=d.toCanvas({pixelRatio:2,width:20,height:20}),_={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:H=>{H.hasName("rotater")&&H.setAttrs({width:20,height:20,cornerRadius:20/2,offsetX:20/2,offsetY:20/2,fillPatternImage:m,fillPatternScaleX:20/20/2,fillPatternScaleY:20/20/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}},A=H=>{Object.assign(_,H)};t.setTransformerStyle=A;const C={text:{enabledAnchors:["top-left","top-right","middle-left","bottom-left","bottom-right","middle-right"]},svg:{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"]}};function R(H,L){C[H]=C[H]||L,Object.assign(C[H],L)}const S=H=>r.default.createElement(a.Rect,Object.assign({},H,{preventDefault:!1})),E=H=>{var{url:L}=H,M=e(H,["url"]);const[D,B]=(0,l.default)(L,"anonymous"),V=D?(0,w.getCrop)(D,{width:M.width,height:M.height},"center-middle"):{};return(0,x.useImageLoader)(B,"background"),r.default.createElement(a.Image,Object.assign({image:D},M,V))},P=H=>r.default.createElement(a.Rect,Object.assign({},H)),T=H=>{const{background:L,scale:M,borderColor:D}=H,B=e(H,["background","scale","borderColor"]),V=r.default.useMemo(()=>!!s.default.Util.colorToRGBA(L),[L]),Y=r.default.useMemo(()=>{const F=document.createElement("canvas"),$=30;F.width=60,F.height=60;const z=F.getContext("2d");return z&&(z.fillStyle="black",z.fillRect($,0,$,$),z.fillRect(0,$,$,$)),F},[]);return r.default.createElement(r.default.Fragment,null,r.default.createElement(a.Rect,Object.assign({fillPatternImage:Y},B,{opacity:.1,hideInExport:!0})),V?r.default.createElement(P,Object.assign({fill:L},B)):r.default.createElement(E,Object.assign({url:L},B)))},N=(0,i.observer)(({selection:H})=>H.visible?r.default.createElement(a.Rect,{name:"selection",x:Math.min(H.x1,H.x2),y:Math.min(H.y1,H.y2),width:Math.abs(H.x1-H.x2),height:Math.abs(H.y1-H.y2),fill:"rgba(0, 161, 255, 0.3)"}):null),U=(0,i.observer)(({x:H,y:L,width:M,height:D,rotation:B,anchor:V,store:Y})=>{const F=(0,O.getClientRect)({x:H,y:L,width:M,height:D,rotation:s.default.Util.radToDeg(B)});if(V===void 0)return null;const $=(D/2+70)*Math.cos(B-Math.PI/2),z=(D/2+70)*Math.sin(B-Math.PI/2),K=(0,g.pxToUnitRounded)({unit:Y.unit,dpi:Y.dpi,px:M/Y.scale,precious:Y.unit==="px"?0:1})+" x "+(0,g.pxToUnitRounded)({unit:Y.unit,dpi:Y.dpi,px:D/Y.scale,precious:Y.unit==="px"?0:1})+(Y.unit==="px"?"":" "+Y.unit);return r.default.createElement(r.default.Fragment,null,r.default.createElement(a.Label,{x:(F.minX+F.maxX)/2+$,y:(F.minY+F.maxY)/2+z,offsetX:14,offsetY:14,visible:V==="rotater"},r.default.createElement(a.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)"}),r.default.createElement(a.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:Math.round(s.default.Util.radToDeg(B)).toString()+"°"})),r.default.createElement(a.Label,{x:(F.minX+F.maxX)/2,y:F.maxY+20,visible:V!=="rotater"},r.default.createElement(a.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"up",pointerHeight:0,pointerWidth:0}),r.default.createElement(a.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:K})))}),G=(0,i.observer)(({elements:H,store:L})=>{const M=H.filter(B=>B.alwaysOnTop),D=H.filter(B=>!B.alwaysOnTop).concat(M);return r.default.createElement(r.default.Fragment,null,D.map(B=>r.default.createElement(f.default,{key:B.id,store:L,element:B,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))});let Z=null;const W=H=>{Z=H};t.registerNextDomDrop=W,t.default=(0,i.observer)(({store:H,page:L,width:M,height:D,pageControlsEnabled:B,backColor:V,pageBorderColor:Y,activePageBorderColor:F,components:$,bleedColor:z,altCloneEnabled:K})=>{const X=H.bleedVisible?L.bleed:0,Q=L.computedWidth+2*X,J=L.computedHeight+2*X,ne=(M-Q*H.scale)/2,ie=(D-J*H.scale)/2,oe=r.default.useRef(null),he=r.default.useRef(null),me=r.default.useRef(null),Pe=B==null||B,[re,ae]=r.default.useState(null),[we,be]=r.default.useState({}),te=H.selectedElements.find(Se=>Se._cropModeEnabled),fe=H.selectedShapes.filter(Se=>!Se.resizable).length>0,de=H.selectedShapes.filter(Se=>!Se.draggable).length>0,Ee=H.selectedElements.filter(Se=>!Se.visible).length>0;r.default.useLayoutEffect(()=>{var Se,Le,Ne;if(!oe.current)return;const ge=oe.current.getStage(),Xe=H.selectedShapes.map($e=>$e._cropModeEnabled?null:ge.findOne("#"+$e.id)).filter($e=>$e),Oe=H.selectedElements.length===1&&((Se=H.selectedElements[0])===null||Se===void 0?void 0:Se.type)||"many";C[Oe]?(oe.current.setAttrs(Object.assign(Object.assign({},_),C[Oe])),Oe!=="svg"&&Oe!=="image"||H.selectedElements[0].keepRatio||oe.current.setAttrs({enabledAnchors:_.enabledAnchors}),Oe==="text"&&b.flags.textVerticalResizeEnabled&&oe.current.setAttrs({enabledAnchors:(Le=C.text.enabledAnchors)===null||Le===void 0?void 0:Le.concat(["bottom-center"])})):oe.current.setAttrs(_),fe&&oe.current.enabledAnchors([]),de&&oe.current.rotateEnabled(!1),Xe.find($e=>$e==null?void 0:$e.isDragging())&&Xe.forEach($e=>{$e.isDragging()||$e==null||$e.startDrag()}),oe.current.nodes(Xe),(Ne=oe.current.getLayer())===null||Ne===void 0||Ne.batchDraw()},[H.selectedElements,te,fe,Ee,de]);const Ve=(0,i.useLocalObservable)(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),Je=r.default.useRef(!1),Ae=(0,p.isTouchDevice)(),Ce=(0,o.action)(Se=>{var Le,Ne;if(Ae)return;Je.current=!1;const ge=Se.target.findAncestor(".elements-container"),Xe=Se.target.findAncestor("Transformer"),Oe=Se.target.findAncestor(".page-abs-container");if(ge||Xe||Oe)return;const $e=(Le=Se.target.getStage())===null||Le===void 0?void 0:Le.getPointerPosition();$e&&(Ve.visible=!0,Ve.x1=$e.x,Ve.y1=$e.y,Ve.x2=$e.x,Ve.y2=$e.y,((Ne=Se.target.getStage())===null||Ne===void 0?void 0:Ne.getPointersPositions().length)>=2&&(Ve.visible=!1))});r.default.useEffect(()=>{const Se=(0,o.action)(Ne=>{var ge,Xe;if(!Ve.visible)return;(ge=he.current)===null||ge===void 0||ge.setPointersPositions(Ne);let Oe=((Xe=he.current)===null||Xe===void 0?void 0:Xe.getPointerPosition())||{x:Ve.x2,y:Ve.y2};Ve.x2=Oe.x,Ve.y2=Oe.y}),Le=(0,o.action)(()=>{if(!Ve.visible||!he.current)return;const Ne=he.current.findOne(".selection"),ge=Ne?Ne.getClientRect():{width:0,height:0,x:0,y:0};if(ge.width&&ge.height){const Xe=[];he.current.find(".element").forEach($e=>{const Wt=$e.getClientRect(),Tt=H.getElementById($e.id()),Yt=Tt==null?void 0:Tt.draggable,ke=Tt==null?void 0:Tt.selectable;s.default.Util.haveIntersection(ge,Wt)&&Yt&&ke&&Xe.push(Tt.top.id)});const Oe=[...new Set(Xe)];H.selectElements(Oe)}Ve.visible=!1,Je.current=!0});return window.addEventListener("mousemove",Se),window.addEventListener("touchmove",Se),window.addEventListener("mouseup",Le),window.addEventListener("touchend",Le),()=>{window.removeEventListener("mousemove",Se),window.removeEventListener("touchmove",Se),window.removeEventListener("mouseup",Le),window.removeEventListener("touchend",Le)}},[]);const Me=r.default.useRef(!1);r.default.useEffect(()=>{var Se;let Le;const Ne=(Se=me.current)===null||Se===void 0?void 0:Se.closest(".polotno-workspace-inner"),ge=()=>{Me.current=!0,clearTimeout(Le),Le=setTimeout(()=>{Me.current=!1},300)};return Ne.addEventListener("scroll",ge),()=>{clearTimeout(Le),Ne.removeEventListener("scroll",ge)}},[]);const ze=Se=>{if(H.activePage!==L&&L.select(),Me.current||Je.current)return;const Le=Se.evt.ctrlKey||Se.evt.metaKey||Se.evt.shiftKey,Ne=Se.target.findAncestor(".elements-container"),ge=Se.target.findAncestor(".page-abs-container"),Xe=Se.target.findAncestor("Transformer");if(!(Le||Ne||Xe||ge))return void H.selectElements([]);const Oe=Se.target.findAncestor(".element",!0),$e=H.getElementById(Oe==null?void 0:Oe.id()),Wt=$e==null?void 0:$e.top,Tt=Wt==null?void 0:Wt.id,Yt=H.selectedElementsIds.indexOf(Tt)>=0;Tt&&Le&&!Yt?H.selectElements(H.selectedElementsIds.concat([Tt])):Tt&&Le&&Yt?H.selectElements(H.selectedElementsIds.filter(ke=>ke!==Tt)):!Tt||Le||Yt||H.selectElements([Tt])};(0,h.useSnap)(oe,H);const We=H.activePage===L,St=$==null?void 0:$.PageControls,mt=$==null?void 0:$.Tooltip,ue=1/H.scale,ce=0/H.scale;return r.default.createElement("div",{ref:me,onDragOver:Se=>Se.preventDefault(),onDrop:Se=>{if(Se.preventDefault(),!he.current)return;he.current.setPointersPositions(Se);const Le=he.current.findOne(".elements-container").getRelativePointerPosition(),Ne=he.current.getPointerPosition(),ge=he.current.getAllIntersections(Ne).map($e=>$e.findAncestor(".element",!0)).filter(Boolean),Xe=[...new Set(ge.reverse())].map($e=>H.getElementById($e.id())),Oe=Xe[0];Z&&(Z(Le,Oe,{elements:Xe,page:L}),Z=null)},style:{position:"relative",width:M+"px"},className:"polotno-page-container"+(We?" active-page":"")},r.default.createElement(a.Stage,{ref:he,width:Math.min(M,10*window.innerWidth),height:Math.min(D,10*window.innerHeight),onClick:ze,onTap:ze,onMouseDown:Ce,onMouseMove:Se=>{if(!Se.evt.altKey&&re)return void ae(null);if(!Se.evt.altKey)return;const Le=Se.target.findAncestor(".element",!0),Ne=Le==null?void 0:Le.id();if(!H.selectedElements[0]||H.selectedElementsIds.includes(Ne))return;const ge=(0,O.getTotalClientRect)(H.selectedShapes),Xe=Ne?H.getElementById(Ne):{x:0,y:0,width:L.computedWidth,height:L.computedHeight,rotation:0},Oe=(0,O.getClientRect)(Xe),$e=[];ge.minX>Oe.maxX&&$e.push({distance:ge.minX-Oe.maxX,box1:ge,box2:Oe,points:[{x:ge.minX,y:ge.minY+ge.height/2},{x:Oe.maxX,y:ge.minY+ge.height/2},{x:Oe.maxX,y:Oe.minY+Oe.height/2}]}),ge.maxX<Oe.minX&&$e.push({distance:Oe.minX-ge.maxX,box1:ge,box2:Oe,points:[{x:ge.maxX,y:ge.minY+ge.height/2},{x:Oe.minX,y:ge.minY+ge.height/2},{x:Oe.minX,y:Oe.minY+Oe.height/2}]}),ge.minY>Oe.maxY&&$e.push({box1:ge,box2:Oe,distance:ge.minY-Oe.maxY,points:[{x:ge.minX+ge.width/2,y:ge.minY},{x:ge.minX+ge.width/2,y:Oe.maxY},{x:Oe.minX+Oe.width/2,y:Oe.maxY}]}),ge.maxY<Oe.minY&&$e.push({box1:ge,box2:Oe,distance:Oe.minY-ge.maxY,points:[{x:ge.minX+ge.width/2,y:ge.maxY},{x:ge.minX+ge.width/2,y:Oe.minY},{x:Oe.minX+Oe.width/2,y:Oe.minY}]}),ge.minX>=Oe.minX&&ge.maxX<=Oe.maxX&&ge.minY>=Oe.minY&&ge.maxY<=Oe.maxY&&($e.push({distance:ge.minX-Oe.minX,box1:ge,box2:Oe,points:[{x:ge.minX,y:ge.minY+ge.height/2},{x:Oe.minX,y:ge.minY+ge.height/2},{x:Oe.minX,y:Oe.minY+Oe.height/2}]}),$e.push({distance:Oe.maxX-ge.maxX,box1:ge,box2:Oe,points:[{x:ge.maxX,y:ge.minY+ge.height/2},{x:Oe.maxX,y:ge.minY+ge.height/2},{x:Oe.maxX,y:Oe.minY+Oe.height/2}]}),$e.push({box1:ge,box2:Oe,distance:ge.minY-Oe.minY,points:[{x:ge.minX+ge.width/2,y:ge.minY},{x:ge.minX+ge.width/2,y:Oe.minY},{x:Oe.minX+Oe.width/2,y:Oe.minY}]}),$e.push({box1:ge,box2:Oe,distance:Oe.maxY-ge.maxY,points:[{x:ge.minX+ge.width/2,y:ge.maxY},{x:ge.minX+ge.width/2,y:Oe.maxY},{x:Oe.minX+Oe.width/2,y:Oe.maxY}]})),JSON.stringify(re)!==JSON.stringify($e)&&ae($e)},onDragStart:Se=>{var Le;const Ne=Se.target.findAncestor(".element",!0);if(Ne){const ge=H.getElementById(Ne==null?void 0:Ne.id()),Xe=ge==null?void 0:ge.top,Oe=Xe==null?void 0:Xe.id;!(H.selectedElementsIds.indexOf(Oe)>=0)&&Oe&&(H.selectElements([Oe]),Se.target.stopDrag(),Se.target.startDrag(Se),(Le=oe.current)===null||Le===void 0||Le.startDrag(Se))}re&&ae(null)},pageId:L.id,style:{position:"relative"}},r.default.createElement(a.Layer,null,r.default.createElement(S,{width:M,height:D,fill:V}),r.default.createElement(a.Group,{x:ne,y:ie,scaleX:H.scale,scaleY:H.scale,name:"page-container"},r.default.createElement(a.Group,{name:"page-container-2"},r.default.createElement(a.Group,{name:"page-background-group",x:X,y:X},r.default.createElement(T,{x:-L.bleed,y:-L.bleed,width:L.computedWidth+2*L.bleed,height:L.computedHeight+2*L.bleed,background:L.background,name:"page-background",preventDefault:!1,scale:H.scale})),r.default.createElement(a.Group,{x:X,y:X,name:"elements-container",listening:!H.isPlaying},r.default.createElement(a.Rect,{name:"elements-area",width:L.computedWidth,height:L.computedHeight,listening:!1}),r.default.createElement(G,{elements:L.children,store:H})),r.default.createElement(a.Rect,{stroke:z,name:"bleed",strokeWidth:L.bleed,x:L.bleed/2,y:L.bleed/2,width:L.computedWidth+L.bleed,height:L.computedHeight+L.bleed,listening:!1,visible:L.bleed>0&&H.bleedVisible,hideInExport:!0}))),r.default.createElement(a.Line,{name:"workspace-background",points:[0,0,M,0,M,D,0,D,0,0,ne,ie,ne,D-ie,M-ne,D-ie,M-ne,ie,ne,ie],listening:!1,closed:!0,fill:V}),r.default.createElement(a.Group,{x:ne,y:ie,scaleX:H.scale,scaleY:H.scale},r.default.createElement(a.Rect,{name:"page-highlight",hideInExport:!0,x:-ue/2-ce,y:-ue/2-ce,width:Q+ue+2*ce,height:J+ue+2*ce,stroke:We&&H.pages.length>1?F:Y,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),r.default.createElement(a.Group,{x:ne+X*H.scale,y:ie+X*H.scale,scaleX:H.scale,scaleY:H.scale,name:"page-abs-container"},r.default.createElement(a.Transformer,{ref:oe,onDragStart:Se=>{var Le;!((Le=Se.evt)===null||Le===void 0)&&Le.altKey&&K&&H.selectedElements.forEach(Ne=>{const ge=Ne.clone({},{skipSelect:!0}),Xe=L.children.indexOf(Ne);L.setElementZIndex(ge.id,Xe)}),H.history.startTransaction()},onDragEnd:()=>{H.history.endTransaction()},onTransformStart:()=>{H.history.startTransaction()},boundBoxFunc:(Se,Le)=>{const Ne=Math.abs(Le.width)<1||Math.abs(Le.height)<1,ge=Math.abs(Se.width)<1||Math.abs(Se.height)<1;return Ne&&!ge?Se:Le},onTransform:Se=>{var Le,Ne;const ge=oe.current.nodes(),Xe=ge[ge.length-1];if(Se.target!==Xe)return;const Oe=(Le=oe.current)===null||Le===void 0?void 0:Le.__getNodeRect(),$e=(Ne=oe.current)===null||Ne===void 0?void 0:Ne.getActiveAnchor();be({anchor:$e,x:Oe.x,y:Oe.y,rotation:Oe.rotation,width:Oe.width,height:Oe.height})},onTransformEnd:Se=>{be({}),H.history.endTransaction()},visible:!H.isPlaying}),re&&re.map(({points:Se,distance:Le,box1:Ne,box2:ge},Xe)=>r.default.createElement(a.Group,{name:"distances-container",hideInExport:!0,key:Xe,listening:!1},r.default.createElement(a.Rect,Object.assign({},Ne,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),r.default.createElement(a.Rect,Object.assign({},ge,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),r.default.createElement(a.Line,{points:[Se[0].x,Se[0].y,Se[1].x,Se[1].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),r.default.createElement(a.Line,{points:[Se[1].x,Se[1].y,Se[2].x,Se[2].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),r.default.createElement(a.Label,{x:(Se[0].x+Se[1].x)/2,y:(Se[0].y+Se[1].y)/2,offsetY:-10,scaleX:1/H.scale,scaleY:1/H.scale},r.default.createElement(a.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"down"}),r.default.createElement(a.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:5,text:(0,g.pxToUnitString)({unit:H.unit,dpi:H.dpi,px:Le})})))),L._rendering&&r.default.createElement(a.Group,null,r.default.createElement(a.Rect,{width:Q,height:J,fill:"rgba(255,255,255,0.9)"}),r.default.createElement(a.Text,{text:"Rendering...",fontSize:60,width:Q,height:J,align:"center",verticalAlign:"middle"})),mt&&r.default.createElement(mt,{components:$,store:H,page:L,stageRef:he})),r.default.createElement(U,Object.assign({},we,{store:H})),r.default.createElement(N,{selection:Ve}),(0,v.isCreditVisible)()&&r.default.createElement(a.Text,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:M-170,y:D-18,onMouseEnter:Se=>{Se.target.getStage().container().style.cursor="pointer"},onMouseLeave:Se=>{Se.target.getStage().container().style.cursor=""},onTouchStart:Se=>{Se.cancelBubble=!0},onMouseDown:Se=>{Se.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),r.default.createElement(a.Group,{name:"line-guides"}))),Pe&&St&&r.default.createElement(St,{store:H,page:L,xPadding:ne,yPadding:ie}))})})(n9);var gS={};(function(t){var e=_e&&_e.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(t,"__esModule",{value:!0}),t.TopRules=void 0,t.LeftRules=v;const n=e(Qe),r=su,i=e0,o=ti,a=w2,l=(0,a.styled)("div",n.default.forwardRef)`
|
|
256
|
+
https://polotno.com/docs/server-api`;t.URLS={unsplashList:({query:d,page:m=1})=>`${(0,t.getAPI)()}/get-unsplash?query=${d}&per_page=20&page=${m}&KEY=${(0,e.getKey)()}`,unsplashDownload:d=>`${(0,t.getAPI)()}/download-unsplash?id=${d}&KEY=${(0,e.getKey)()}`,svgapiList:({query:d,page:m=0})=>`${(0,t.getAPI)()}/get-svgapi?query=${d}&page=${m}&per_page=20&KEY=${(0,e.getKey)()}`,svgapiDownload:d=>`${(0,t.getAPI)()}/download-svgapi?path=${d}&KEY=${(0,e.getKey)()}`,iconscoutList:({query:d,page:m=1})=>(i("iconscout",o),`${(0,t.getAPI)()}/get-iconscout?query=${d}&page=${m}&KEY=${(0,e.getKey)()}`),iconscoutDownload:d=>(i("iconscout",o),`${(0,t.getAPI)()}/download-iconscout?uuid=${d}&KEY=${(0,e.getKey)()}`),nounProjectList:({query:d,page:m=1})=>`${(0,t.getAPI)()}/get-nounproject?query=${d}&page=${m}&KEY=${(0,e.getKey)()}`,nounProjectDownload:d=>`${(0,t.getAPI)()}/download-nounproject?id=${d}&KEY=${(0,e.getKey)()}`,templateList:({query:d,page:m=1,sizeQuery:_})=>`${(0,t.getAPI)()}/get-templates?${_}&query=${d}&per_page=30&page=${m}&KEY=${(0,e.getKey)()}`};const a=()=>`${(0,t.getAPI)()}/get-google-fonts?KEY=${(0,e.getKey)()}`;t.getGoogleFontsListAPI=a;const l=d=>{return`${t.URL}/google-fonts-previews/black/${m=d,_=" ",A="-",m.replace(new RegExp(_,"g"),A)}.png`;var m,_,A};t.getGoogleFontImage=l;const s=()=>`${(0,t.getAPI)()}/get-basic-shapes?KEY=${(0,e.getKey)()}`;t.polotnoShapesList=s;const f=()=>`${(0,t.getAPI)()}/remove-image-background?KEY=${(0,e.getKey)()}`;t.removeBackground=f;const h=d=>t.URLS.templateList(d);t.templateList=h;const x=()=>`${(0,t.getAPI)()}/get-text-templates?KEY=${(0,e.getKey)()}`;t.textTemplateList=x;const w=d=>t.URLS.unsplashList(d);t.unsplashList=w;const v=d=>t.URLS.unsplashDownload(d);t.unsplashDownload=v;const O=d=>t.URLS.svgapiList(d);t.svgapiList=O;const g=d=>t.URLS.svgapiDownload(d);t.svgapiDownload=g;const b=d=>t.URLS.iconscoutList(d);t.iconscoutList=b;const p=d=>t.URLS.iconscoutDownload(d);t.iconscoutDownload=p;const y=(d,m)=>{t.URLS[d]=m};t.setAPI=y}(Gg)),Gg}var E_;function E2(){return E_||(E_=1,function(t){var e=_e&&_e.__createBinding||(Object.create?function(R,S,E,P){P===void 0&&(P=E);var T=Object.getOwnPropertyDescriptor(S,E);T&&!("get"in T?!S.__esModule:T.writable||T.configurable)||(T={enumerable:!0,get:function(){return S[E]}}),Object.defineProperty(R,P,T)}:function(R,S,E,P){P===void 0&&(P=E),R[P]=S[E]}),n=_e&&_e.__setModuleDefault||(Object.create?function(R,S){Object.defineProperty(R,"default",{enumerable:!0,value:S})}:function(R,S){R.default=S}),r=_e&&_e.__importStar||function(R){if(R&&R.__esModule)return R;var S={};if(R!=null)for(var E in R)E!=="default"&&Object.prototype.hasOwnProperty.call(R,E)&&e(S,R,E);return n(S,R),S};Object.defineProperty(t,"__esModule",{value:!0}),t.getKey=t.isCreditVisible=void 0,t.isKeyPaid=A,t.validateKey=C;const i=r(Qi),o=fj(),a=Qr,l=i.observable({value:!1}),s=()=>l.value;t.isCreditVisible=s;const f=i.action(()=>{l.value=!0});let h="";const x=()=>h||"";t.getKey=x;const w=5,v=3e3,O="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",g="Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet",b="Can not validate Polotno API key. Please report to anton@polotno.com immediately.",p="%cPolotno Free Version. Development or non-commercial usage only. https://polotno.com/";let y=window.location.origin;const d=navigator.userAgent.indexOf("Headless")>-1,m=navigator.userAgent.indexOf("Electron")>-1;y==="file://"&&d&&(y="headless"),y==="file://"&&m&&(y="electron");const _=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${y}" here: https://polotno.com/cabinet`;async function A(R){for(let S=0;S<w;S++)try{const E=await fetch((0,o.getAPI)()+"/validate-key",{method:"POST",body:JSON.stringify({key:R,site:location.host})});if(!R)return console.warn(O),!1;if(E.status!==200){await new Promise(T=>setTimeout(T,v));continue}const P=await E.json();return P.is_valid||console.warn(g),P.is_paid||console.log(p,"background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),P.is_domain_valid||console.log(_,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),(0,a.useRemoveBackground)(P.remove_background_enabled),P.is_paid||!1}catch{await new Promise(P=>setTimeout(P,v))}return console.error(b),!0}async function C(R,S){h=R,await A(R)&&!S||f()}}($g)),$g}var e0={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.pxToUnitString=t.unitToPx=t.pxToUnitRounded=t.pxToUnit=void 0;const e=({px:o,unit:a="px",dpi:l})=>{switch(a){case"pt":default:return o;case"mm":return o/(l/25.4);case"cm":return o/(l/2.54);case"in":return o/l}};t.pxToUnit=e;const n=({px:o,precious:a=2,dpi:l=72,unit:s="px"})=>parseFloat((0,t.pxToUnit)({px:o,dpi:l,unit:s}).toFixed(a));t.pxToUnitRounded=n;const r=({unitVal:o,dpi:a,unit:l})=>o/(0,t.pxToUnit)({px:1,unit:l,dpi:a});t.unitToPx=r;const i=o=>{const a=parseFloat((0,t.pxToUnit)(o).toFixed(1));switch(o.unit){case"pt":return`${Math.round(a)}pt`;case"mm":return`${a}mm`;case"cm":return`${a}cm`;case"in":return`${a}in`;default:return`${Math.round(a)}px`}};t.pxToUnitString=i})(e0);(function(t){var e=_e&&_e.__rest||function(H,L){var M={};for(var D in H)Object.prototype.hasOwnProperty.call(H,D)&&L.indexOf(D)<0&&(M[D]=H[D]);if(H!=null&&typeof Object.getOwnPropertySymbols=="function"){var B=0;for(D=Object.getOwnPropertySymbols(H);B<D.length;B++)L.indexOf(D[B])<0&&Object.prototype.propertyIsEnumerable.call(H,D[B])&&(M[D[B]]=H[D[B]])}return M},n=_e&&_e.__importDefault||function(H){return H&&H.__esModule?H:{default:H}};Object.defineProperty(t,"__esModule",{value:!0}),t.registerNextDomDrop=t.setTransformerStyle=void 0,t.registerTransformerAttrs=R;const r=n(Qe),i=ti,o=Qi,a=Io,l=n(Yp),s=n(ki),f=n(Y9),h=S2,x=d2,w=pS,v=E2(),O=su,g=e0,b=Qr,p=Na,y=s.default.DD._drag;window.removeEventListener("mousemove",y),s.default.DD._drag=function(H){(0,o.runInAction)(()=>{y.call(this,H)})},window.addEventListener("mousemove",s.default.DD._drag);const d=new s.default.Group;d.add(new s.default.Rect({width:20,height:20,fill:"white"})),d.add(new s.default.Path({scaleX:20/24,scaleY:20/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 m=d.toCanvas({pixelRatio:2,width:20,height:20}),_={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:H=>{H.hasName("rotater")&&H.setAttrs({width:20,height:20,cornerRadius:20/2,offsetX:20/2,offsetY:20/2,fillPatternImage:m,fillPatternScaleX:20/20/2,fillPatternScaleY:20/20/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}},A=H=>{Object.assign(_,H)};t.setTransformerStyle=A;const C={text:{enabledAnchors:["top-left","top-right","middle-left","bottom-left","bottom-right","middle-right"]},svg:{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"]}};function R(H,L){C[H]=C[H]||L,Object.assign(C[H],L)}const S=H=>r.default.createElement(a.Rect,Object.assign({},H,{preventDefault:!1})),E=H=>{var{url:L}=H,M=e(H,["url"]);const[D,B]=(0,l.default)(L,"anonymous"),V=D?(0,w.getCrop)(D,{width:M.width,height:M.height},"center-middle"):{};return(0,x.useImageLoader)(B,"background"),r.default.createElement(a.Image,Object.assign({image:D},M,V))},P=H=>r.default.createElement(a.Rect,Object.assign({},H)),T=H=>{const{background:L,scale:M,borderColor:D}=H,B=e(H,["background","scale","borderColor"]),V=r.default.useMemo(()=>!!s.default.Util.colorToRGBA(L),[L]),Y=r.default.useMemo(()=>{const F=document.createElement("canvas"),$=30;F.width=60,F.height=60;const z=F.getContext("2d");return z&&(z.fillStyle="black",z.fillRect($,0,$,$),z.fillRect(0,$,$,$)),F},[]);return r.default.createElement(r.default.Fragment,null,r.default.createElement(a.Rect,Object.assign({fillPatternImage:Y},B,{opacity:.1,hideInExport:!0})),V?r.default.createElement(P,Object.assign({fill:L},B)):r.default.createElement(E,Object.assign({url:L},B)))},N=(0,i.observer)(({selection:H})=>H.visible?r.default.createElement(a.Rect,{name:"selection",x:Math.min(H.x1,H.x2),y:Math.min(H.y1,H.y2),width:Math.abs(H.x1-H.x2),height:Math.abs(H.y1-H.y2),fill:"rgba(0, 161, 255, 0.3)"}):null),U=(0,i.observer)(({x:H,y:L,width:M,height:D,rotation:B,anchor:V,store:Y})=>{const F=(0,O.getClientRect)({x:H,y:L,width:M,height:D,rotation:s.default.Util.radToDeg(B)});if(V===void 0)return null;const $=(D/2+70)*Math.cos(B-Math.PI/2),z=(D/2+70)*Math.sin(B-Math.PI/2),K=(0,g.pxToUnitRounded)({unit:Y.unit,dpi:Y.dpi,px:M/Y.scale,precious:Y.unit==="px"?0:1})+" x "+(0,g.pxToUnitRounded)({unit:Y.unit,dpi:Y.dpi,px:D/Y.scale,precious:Y.unit==="px"?0:1})+(Y.unit==="px"?"":" "+Y.unit);return r.default.createElement(r.default.Fragment,null,r.default.createElement(a.Label,{x:(F.minX+F.maxX)/2+$,y:(F.minY+F.maxY)/2+z,offsetX:14,offsetY:14,visible:V==="rotater"},r.default.createElement(a.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)"}),r.default.createElement(a.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:Math.round(s.default.Util.radToDeg(B)).toString()+"°"})),r.default.createElement(a.Label,{x:(F.minX+F.maxX)/2,y:F.maxY+20,visible:V!=="rotater"},r.default.createElement(a.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"up",pointerHeight:0,pointerWidth:0}),r.default.createElement(a.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:K})))}),G=(0,i.observer)(({elements:H,store:L})=>{const M=H.filter(B=>B.alwaysOnTop),D=H.filter(B=>!B.alwaysOnTop).concat(M);return r.default.createElement(r.default.Fragment,null,D.map(B=>r.default.createElement(f.default,{key:B.id,store:L,element:B,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))});let Z=null;const W=H=>{Z=H};t.registerNextDomDrop=W,t.default=(0,i.observer)(({store:H,page:L,width:M,height:D,pageControlsEnabled:B,backColor:V,pageBorderColor:Y,activePageBorderColor:F,components:$,bleedColor:z,altCloneEnabled:K})=>{const X=H.bleedVisible?L.bleed:0,Q=L.computedWidth+2*X,J=L.computedHeight+2*X,ne=(M-Q*H.scale)/2,ie=(D-J*H.scale)/2,oe=r.default.useRef(null),de=r.default.useRef(null),me=r.default.useRef(null),Pe=B==null||B,[re,ae]=r.default.useState(null),[we,be]=r.default.useState({}),te=H.selectedElements.find(Se=>Se._cropModeEnabled),fe=H.selectedShapes.filter(Se=>!Se.resizable).length>0,he=H.selectedShapes.filter(Se=>!Se.draggable).length>0,Ee=H.selectedElements.filter(Se=>!Se.visible).length>0;r.default.useLayoutEffect(()=>{var Se,Le,Ne;if(!oe.current)return;const ge=oe.current.getStage(),Xe=H.selectedShapes.map($e=>$e._cropModeEnabled?null:ge.findOne("#"+$e.id)).filter($e=>$e),Oe=H.selectedElements.length===1&&((Se=H.selectedElements[0])===null||Se===void 0?void 0:Se.type)||"many";C[Oe]?(oe.current.setAttrs(Object.assign(Object.assign({},_),C[Oe])),Oe!=="svg"&&Oe!=="image"||H.selectedElements[0].keepRatio||oe.current.setAttrs({enabledAnchors:_.enabledAnchors}),Oe==="text"&&b.flags.textVerticalResizeEnabled&&oe.current.setAttrs({enabledAnchors:(Le=C.text.enabledAnchors)===null||Le===void 0?void 0:Le.concat(["bottom-center"])})):oe.current.setAttrs(_),fe&&oe.current.enabledAnchors([]),he&&oe.current.rotateEnabled(!1),Xe.find($e=>$e==null?void 0:$e.isDragging())&&Xe.forEach($e=>{$e.isDragging()||$e==null||$e.startDrag()}),oe.current.nodes(Xe),(Ne=oe.current.getLayer())===null||Ne===void 0||Ne.batchDraw()},[H.selectedElements,te,fe,Ee,he]);const Ve=(0,i.useLocalObservable)(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),Je=r.default.useRef(!1),Ae=(0,p.isTouchDevice)(),Ce=(0,o.action)(Se=>{var Le,Ne;if(Ae)return;Je.current=!1;const ge=Se.target.findAncestor(".elements-container"),Xe=Se.target.findAncestor("Transformer"),Oe=Se.target.findAncestor(".page-abs-container");if(ge||Xe||Oe)return;const $e=(Le=Se.target.getStage())===null||Le===void 0?void 0:Le.getPointerPosition();$e&&(Ve.visible=!0,Ve.x1=$e.x,Ve.y1=$e.y,Ve.x2=$e.x,Ve.y2=$e.y,((Ne=Se.target.getStage())===null||Ne===void 0?void 0:Ne.getPointersPositions().length)>=2&&(Ve.visible=!1))});r.default.useEffect(()=>{const Se=(0,o.action)(Ne=>{var ge,Xe;if(!Ve.visible)return;(ge=de.current)===null||ge===void 0||ge.setPointersPositions(Ne);let Oe=((Xe=de.current)===null||Xe===void 0?void 0:Xe.getPointerPosition())||{x:Ve.x2,y:Ve.y2};Ve.x2=Oe.x,Ve.y2=Oe.y}),Le=(0,o.action)(()=>{if(!Ve.visible||!de.current)return;const Ne=de.current.findOne(".selection"),ge=Ne?Ne.getClientRect():{width:0,height:0,x:0,y:0};if(ge.width&&ge.height){const Xe=[];de.current.find(".element").forEach($e=>{const Wt=$e.getClientRect(),Tt=H.getElementById($e.id()),Yt=Tt==null?void 0:Tt.draggable,ke=Tt==null?void 0:Tt.selectable;s.default.Util.haveIntersection(ge,Wt)&&Yt&&ke&&Xe.push(Tt.top.id)});const Oe=[...new Set(Xe)];H.selectElements(Oe)}Ve.visible=!1,Je.current=!0});return window.addEventListener("mousemove",Se),window.addEventListener("touchmove",Se),window.addEventListener("mouseup",Le),window.addEventListener("touchend",Le),()=>{window.removeEventListener("mousemove",Se),window.removeEventListener("touchmove",Se),window.removeEventListener("mouseup",Le),window.removeEventListener("touchend",Le)}},[]);const Me=r.default.useRef(!1);r.default.useEffect(()=>{var Se;let Le;const Ne=(Se=me.current)===null||Se===void 0?void 0:Se.closest(".polotno-workspace-inner"),ge=()=>{Me.current=!0,clearTimeout(Le),Le=setTimeout(()=>{Me.current=!1},300)};return Ne.addEventListener("scroll",ge),()=>{clearTimeout(Le),Ne.removeEventListener("scroll",ge)}},[]);const ze=Se=>{if(H.activePage!==L&&L.select(),Me.current||Je.current)return;const Le=Se.evt.ctrlKey||Se.evt.metaKey||Se.evt.shiftKey,Ne=Se.target.findAncestor(".elements-container"),ge=Se.target.findAncestor(".page-abs-container"),Xe=Se.target.findAncestor("Transformer");if(!(Le||Ne||Xe||ge))return void H.selectElements([]);const Oe=Se.target.findAncestor(".element",!0),$e=H.getElementById(Oe==null?void 0:Oe.id()),Wt=$e==null?void 0:$e.top,Tt=Wt==null?void 0:Wt.id,Yt=H.selectedElementsIds.indexOf(Tt)>=0;Tt&&Le&&!Yt?H.selectElements(H.selectedElementsIds.concat([Tt])):Tt&&Le&&Yt?H.selectElements(H.selectedElementsIds.filter(ke=>ke!==Tt)):!Tt||Le||Yt||H.selectElements([Tt])};(0,h.useSnap)(oe,H);const We=H.activePage===L,St=$==null?void 0:$.PageControls,mt=$==null?void 0:$.Tooltip,ue=1/H.scale,ce=0/H.scale;return r.default.createElement("div",{ref:me,onDragOver:Se=>Se.preventDefault(),onDrop:Se=>{if(Se.preventDefault(),!de.current)return;de.current.setPointersPositions(Se);const Le=de.current.findOne(".elements-container").getRelativePointerPosition(),Ne=de.current.getPointerPosition(),ge=de.current.getAllIntersections(Ne).map($e=>$e.findAncestor(".element",!0)).filter(Boolean),Xe=[...new Set(ge.reverse())].map($e=>H.getElementById($e.id())),Oe=Xe[0];Z&&(Z(Le,Oe,{elements:Xe,page:L}),Z=null)},style:{position:"relative",width:M+"px"},className:"polotno-page-container"+(We?" active-page":"")},r.default.createElement(a.Stage,{ref:de,width:Math.min(M,10*window.innerWidth),height:Math.min(D,10*window.innerHeight),onClick:ze,onTap:ze,onMouseDown:Ce,onMouseMove:Se=>{if(!Se.evt.altKey&&re)return void ae(null);if(!Se.evt.altKey)return;const Le=Se.target.findAncestor(".element",!0),Ne=Le==null?void 0:Le.id();if(!H.selectedElements[0]||H.selectedElementsIds.includes(Ne))return;const ge=(0,O.getTotalClientRect)(H.selectedShapes),Xe=Ne?H.getElementById(Ne):{x:0,y:0,width:L.computedWidth,height:L.computedHeight,rotation:0},Oe=(0,O.getClientRect)(Xe),$e=[];ge.minX>Oe.maxX&&$e.push({distance:ge.minX-Oe.maxX,box1:ge,box2:Oe,points:[{x:ge.minX,y:ge.minY+ge.height/2},{x:Oe.maxX,y:ge.minY+ge.height/2},{x:Oe.maxX,y:Oe.minY+Oe.height/2}]}),ge.maxX<Oe.minX&&$e.push({distance:Oe.minX-ge.maxX,box1:ge,box2:Oe,points:[{x:ge.maxX,y:ge.minY+ge.height/2},{x:Oe.minX,y:ge.minY+ge.height/2},{x:Oe.minX,y:Oe.minY+Oe.height/2}]}),ge.minY>Oe.maxY&&$e.push({box1:ge,box2:Oe,distance:ge.minY-Oe.maxY,points:[{x:ge.minX+ge.width/2,y:ge.minY},{x:ge.minX+ge.width/2,y:Oe.maxY},{x:Oe.minX+Oe.width/2,y:Oe.maxY}]}),ge.maxY<Oe.minY&&$e.push({box1:ge,box2:Oe,distance:Oe.minY-ge.maxY,points:[{x:ge.minX+ge.width/2,y:ge.maxY},{x:ge.minX+ge.width/2,y:Oe.minY},{x:Oe.minX+Oe.width/2,y:Oe.minY}]}),ge.minX>=Oe.minX&&ge.maxX<=Oe.maxX&&ge.minY>=Oe.minY&&ge.maxY<=Oe.maxY&&($e.push({distance:ge.minX-Oe.minX,box1:ge,box2:Oe,points:[{x:ge.minX,y:ge.minY+ge.height/2},{x:Oe.minX,y:ge.minY+ge.height/2},{x:Oe.minX,y:Oe.minY+Oe.height/2}]}),$e.push({distance:Oe.maxX-ge.maxX,box1:ge,box2:Oe,points:[{x:ge.maxX,y:ge.minY+ge.height/2},{x:Oe.maxX,y:ge.minY+ge.height/2},{x:Oe.maxX,y:Oe.minY+Oe.height/2}]}),$e.push({box1:ge,box2:Oe,distance:ge.minY-Oe.minY,points:[{x:ge.minX+ge.width/2,y:ge.minY},{x:ge.minX+ge.width/2,y:Oe.minY},{x:Oe.minX+Oe.width/2,y:Oe.minY}]}),$e.push({box1:ge,box2:Oe,distance:Oe.maxY-ge.maxY,points:[{x:ge.minX+ge.width/2,y:ge.maxY},{x:ge.minX+ge.width/2,y:Oe.maxY},{x:Oe.minX+Oe.width/2,y:Oe.maxY}]})),JSON.stringify(re)!==JSON.stringify($e)&&ae($e)},onDragStart:Se=>{var Le;const Ne=Se.target.findAncestor(".element",!0);if(Ne){const ge=H.getElementById(Ne==null?void 0:Ne.id()),Xe=ge==null?void 0:ge.top,Oe=Xe==null?void 0:Xe.id;!(H.selectedElementsIds.indexOf(Oe)>=0)&&Oe&&(H.selectElements([Oe]),Se.target.stopDrag(),Se.target.startDrag(Se),(Le=oe.current)===null||Le===void 0||Le.startDrag(Se))}re&&ae(null)},pageId:L.id,style:{position:"relative"}},r.default.createElement(a.Layer,null,r.default.createElement(S,{width:M,height:D,fill:V}),r.default.createElement(a.Group,{x:ne,y:ie,scaleX:H.scale,scaleY:H.scale,name:"page-container"},r.default.createElement(a.Group,{name:"page-container-2"},r.default.createElement(a.Group,{name:"page-background-group",x:X,y:X},r.default.createElement(T,{x:-L.bleed,y:-L.bleed,width:L.computedWidth+2*L.bleed,height:L.computedHeight+2*L.bleed,background:L.background,name:"page-background",preventDefault:!1,scale:H.scale})),r.default.createElement(a.Group,{x:X,y:X,name:"elements-container",listening:!H.isPlaying},r.default.createElement(a.Rect,{name:"elements-area",width:L.computedWidth,height:L.computedHeight,listening:!1}),r.default.createElement(G,{elements:L.children,store:H})),r.default.createElement(a.Rect,{stroke:z,name:"bleed",strokeWidth:L.bleed,x:L.bleed/2,y:L.bleed/2,width:L.computedWidth+L.bleed,height:L.computedHeight+L.bleed,listening:!1,visible:L.bleed>0&&H.bleedVisible,hideInExport:!0}))),r.default.createElement(a.Line,{name:"workspace-background",points:[0,0,M,0,M,D,0,D,0,0,ne,ie,ne,D-ie,M-ne,D-ie,M-ne,ie,ne,ie],listening:!1,closed:!0,fill:V}),r.default.createElement(a.Group,{x:ne,y:ie,scaleX:H.scale,scaleY:H.scale},r.default.createElement(a.Rect,{name:"page-highlight",hideInExport:!0,x:-ue/2-ce,y:-ue/2-ce,width:Q+ue+2*ce,height:J+ue+2*ce,stroke:We&&H.pages.length>1?F:Y,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),r.default.createElement(a.Group,{x:ne+X*H.scale,y:ie+X*H.scale,scaleX:H.scale,scaleY:H.scale,name:"page-abs-container"},r.default.createElement(a.Transformer,{ref:oe,onDragStart:Se=>{var Le;!((Le=Se.evt)===null||Le===void 0)&&Le.altKey&&K&&H.selectedElements.forEach(Ne=>{const ge=Ne.clone({},{skipSelect:!0}),Xe=L.children.indexOf(Ne);L.setElementZIndex(ge.id,Xe)}),H.history.startTransaction()},onDragEnd:()=>{H.history.endTransaction()},onTransformStart:()=>{H.history.startTransaction()},boundBoxFunc:(Se,Le)=>{const Ne=Math.abs(Le.width)<1||Math.abs(Le.height)<1,ge=Math.abs(Se.width)<1||Math.abs(Se.height)<1;return Ne&&!ge?Se:Le},onTransform:Se=>{var Le,Ne;const ge=oe.current.nodes(),Xe=ge[ge.length-1];if(Se.target!==Xe)return;const Oe=(Le=oe.current)===null||Le===void 0?void 0:Le.__getNodeRect(),$e=(Ne=oe.current)===null||Ne===void 0?void 0:Ne.getActiveAnchor();be({anchor:$e,x:Oe.x,y:Oe.y,rotation:Oe.rotation,width:Oe.width,height:Oe.height})},onTransformEnd:Se=>{be({}),H.history.endTransaction()},visible:!H.isPlaying}),re&&re.map(({points:Se,distance:Le,box1:Ne,box2:ge},Xe)=>r.default.createElement(a.Group,{name:"distances-container",hideInExport:!0,key:Xe,listening:!1},r.default.createElement(a.Rect,Object.assign({},Ne,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),r.default.createElement(a.Rect,Object.assign({},ge,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),r.default.createElement(a.Line,{points:[Se[0].x,Se[0].y,Se[1].x,Se[1].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),r.default.createElement(a.Line,{points:[Se[1].x,Se[1].y,Se[2].x,Se[2].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),r.default.createElement(a.Label,{x:(Se[0].x+Se[1].x)/2,y:(Se[0].y+Se[1].y)/2,offsetY:-10,scaleX:1/H.scale,scaleY:1/H.scale},r.default.createElement(a.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"down"}),r.default.createElement(a.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:5,text:(0,g.pxToUnitString)({unit:H.unit,dpi:H.dpi,px:Le})})))),L._rendering&&r.default.createElement(a.Group,null,r.default.createElement(a.Rect,{width:Q,height:J,fill:"rgba(255,255,255,0.9)"}),r.default.createElement(a.Text,{text:"Rendering...",fontSize:60,width:Q,height:J,align:"center",verticalAlign:"middle"})),mt&&r.default.createElement(mt,{components:$,store:H,page:L,stageRef:de})),r.default.createElement(U,Object.assign({},we,{store:H})),r.default.createElement(N,{selection:Ve}),(0,v.isCreditVisible)()&&r.default.createElement(a.Text,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:M-170,y:D-18,onMouseEnter:Se=>{Se.target.getStage().container().style.cursor="pointer"},onMouseLeave:Se=>{Se.target.getStage().container().style.cursor=""},onTouchStart:Se=>{Se.cancelBubble=!0},onMouseDown:Se=>{Se.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),r.default.createElement(a.Group,{name:"line-guides"}))),Pe&&St&&r.default.createElement(St,{store:H,page:L,xPadding:ne,yPadding:ie}))})})(n9);var gS={};(function(t){var e=_e&&_e.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(t,"__esModule",{value:!0}),t.TopRules=void 0,t.LeftRules=v;const n=e(Qe),r=su,i=e0,o=ti,a=w2,l=(0,a.styled)("div",n.default.forwardRef)`
|
|
257
257
|
position: absolute;
|
|
258
258
|
top: 0;
|
|
259
259
|
left: 0;
|
|
@@ -297,7 +297,7 @@ https://polotno.com/docs/server-api`;t.URLS={unsplashList:({query:d,page:m=1})=>
|
|
|
297
297
|
`).join("<br />")}));return h("div",{style:{position:"relative",width:"100%",height:"100%"}},U,M)},O=({element:S,type:E})=>{const P={"stroke-width":S.height,stroke:S.color,"line-cap":"round","stroke-linejoin":"round",opacity:S.opacity};return E==="arrow"||E==="triangle"?h("polyline",Object.assign({points:`${3*S.height},${2*-S.height} 0,0 ${3*S.height},${2*S.height}`},P)):E==="bar"?h("polyline",Object.assign({points:`0,${2*-S.height} 0,${2*S.height}`},P)):E==="circle"?h("circle",Object.assign({r:S.height},P)):E==="square"?h("polyline",Object.assign({points:`${-S.height},${-S.height} ${-S.height},${S.height} ${S.height},${S.height} ${S.height},${-S.height}`},P)):null},g=async({element:S,page:E,store:P})=>h("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},h("rect",{x:0,y:0,width:S.width,height:S.height,fill:S.color}),h("g",{transform:`translate(0 ${S.height/2})`},O({element:S,type:S.startHead})),h("g",{transform:`translate(${S.width} ${S.height/2}) rotate(180)`},O({element:S,type:S.endHead}))),b=async({element:S,page:E,store:P,elementHook:T})=>{const N=await Promise.all(S.children.map(G=>d({element:G,page:E,store:P,elementHook:T}))),U=h("div",{style:{"transform-origin":"top left",opacity:S.opacity}},...N);return T&&T({dom:U,element:S})||U},p=async({element:S,page:E,store:P,elementHook:T})=>{const N=(0,s.figureToSvg)(S),U=h("div",{innerHTML:N});return T&&T({dom:U,element:S})||U},y={image:w,svg:w,text:v,line:g,figure:p,group:b};async function d({element:S,page:E,store:P,elementHook:T}){let N=await y[S.type];N||(N=()=>h("div",{}),console.error(`HTML export does not support ${S.type} type...`));const U=await N({element:S,page:E,store:P}),G=[];S.blurEnabled&&G.push(`blur(${S.blurRadius/2}px)`),S.brightnessEnabled&&G.push(`brightness(${100*S.brightness+100}%)`),S.sepiaEnabled&&G.push("sepia()"),S.grayscaleEnabled&&G.push("grayscale()"),S.shadowEnabled&&G.push(`drop-shadow(${S.shadowOffsetX}px ${S.shadowOffsetY}px ${S.shadowBlur}px ${S.shadowColor})`);const Z=h("div",{id:S.id,style:{position:"absolute",left:S.x+"px",top:S.y+"px",width:S.width+"px",height:S.height+"px",transform:`rotate(${S.rotation}deg)`,"transform-origin":"top left",opacity:S.opacity,display:S.visible&&S.showInExport?"block":"none",filter:G.join(" ")||"none"}},U);return T&&T({dom:Z,element:S})||Z}async function m({page:S,store:E,elementHook:P}){const T=await Promise.all(S.children.map(Z=>d({element:Z,page:S,store:E,elementHook:P}))),N=S.width==="auto"?E.width:S.width,U=S.height==="auto"?E.height:S.height;let G={};if(S.background.indexOf("url")>=0||S.background.indexOf("http")>=0||S.background.indexOf(".jpg")>=0||S.background.indexOf(".png")>=0||S.background.indexOf(".jpeg")>=0){const{width:Z,height:W}=await(0,l.loadImage)(S.background),H=await w({element:Object.assign({x:0,y:0,width:Z,height:W,src:S.background,cornerRadius:0},(0,o.getCrop)({width:Z,height:W},{width:Z,height:W})),page:S,store:E});T.unshift(H)}else G=Object.assign(Object.assign({},G),{"background-color":S.background});return h("div",{className:"page",id:S.id,style:Object.assign(Object.assign({},G),{width:N+"px",height:U+"px",border:"1px solid grey",overflow:"hidden",position:"relative"})},...T)}async function _({json:S,elementHook:E}){const P=await Promise.all(S.pages.map(U=>m({page:U,store:S,elementHook:E}))),T=[];S.pages.forEach(U=>{U.children.forEach(G=>{G.type==="text"&&T.indexOf(G.fontFamily)===-1&&T.push(G.fontFamily)})});const N=T.map(U=>S.fonts.find(G=>G.fontFamily===U)?h("style",{},""):h("link",{href:`https://fonts.googleapis.com/css?family=${U}`,rel:"stylesheet"}));return h("div",{className:"design"},...N,...P)}const A=(S,E)=>typeof E=="object"?`${S}="${Object.keys(E).map(P=>`${P}:${E[P]};`).join(" ")}"`:`${S}="${E}"`,C=({dom:S})=>{if(typeof S=="string")return S;if(!S)return"";const E=S.props,{innerHTML:P}=E,T=i(E,["innerHTML"]);return`<${S.type} ${Object.keys(T).map(N=>A(N,S.props[N])).join(" ")}>${P||S.children.map(N=>C({dom:N})).join("")}</${S.type}>`};async function R({json:S,elementHook:E}){const P=await _({json:S,elementHook:E});return C({dom:P})}})(xS);var PS={};(function(t){var e=_e&&_e.__createBinding||(Object.create?function(S,E,P,T){T===void 0&&(T=P);var N=Object.getOwnPropertyDescriptor(E,P);N&&!("get"in N?!E.__esModule:N.writable||N.configurable)||(N={enumerable:!0,get:function(){return E[P]}}),Object.defineProperty(S,T,N)}:function(S,E,P,T){T===void 0&&(T=P),S[T]=E[P]}),n=_e&&_e.__setModuleDefault||(Object.create?function(S,E){Object.defineProperty(S,"default",{enumerable:!0,value:E})}:function(S,E){S.default=E}),r=_e&&_e.__importStar||function(S){if(S&&S.__esModule)return S;var E={};if(S!=null)for(var P in S)P!=="default"&&Object.prototype.hasOwnProperty.call(S,P)&&e(E,S,P);return n(E,S),E},i=_e&&_e.__rest||function(S,E){var P={};for(var T in S)Object.prototype.hasOwnProperty.call(S,T)&&E.indexOf(T)<0&&(P[T]=S[T]);if(S!=null&&typeof Object.getOwnPropertySymbols=="function"){var N=0;for(T=Object.getOwnPropertySymbols(S);N<T.length;N++)E.indexOf(T[N])<0&&Object.prototype.propertyIsEnumerable.call(S,T[N])&&(P[T[N]]=S[T[N]])}return P};Object.defineProperty(t,"__esModule",{value:!0}),t.fixRatio=h,t.jsonToDOM=_,t.jsonToSVG=R;const o=Mc,a=r(au),l=Mc,s=Jp,f=(S,E,...P)=>({type:S,props:E,children:P||[]});function h(S){var E=new DOMParser().parseFromString(S,"image/svg+xml");return E.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(E)}const x=async({element:S,page:E,store:P})=>{let{src:T}=S;if(S.type==="svg"){const Q=await a.urlToString(T);T=a.replaceColors(Q,new Map(Object.entries(S.colorsReplace)))}let N="";S.flipX&&(N+="scaleX(-1)"),S.flipY&&(N+="scaleY(-1)"),S.clipSrc&&await a.urlToBase64(S.clipSrc);const U=await(0,l.loadImage)(T),G=U.width*S.cropWidth,Z=U.height*S.cropHeight,W=S.width/S.height;let H,L;const M=G/Z;S.type==="svg"?(H=G,L=Z):W>=M?(H=G,L=G/W):(H=Z*W,L=Z);const D=H/U.width,B=L/U.height,V=H/L>S.width/S.height?S.height/L:S.width/H,Y=H*V/D,F=L*V/B,$=S.cropX*U.width*V,z=S.cropY*U.height*V,K=`clip-${S.id}`,X=T.replace(/&/g,"&");return f("g",{style:{transform:N}},f("defs",{},f("clipPath",{id:K},f("rect",{x:0,y:0,width:S.width,height:S.height}))),f("image",{"xlink:href":X,x:-$,y:-z,width:Y,height:F,preserveAspectRatio:"none","clip-path":`url(#${K})`}))},w=async({element:S,page:E,store:P})=>{const T=(W,H,L,M,D)=>{const B=document.createElement("canvas").getContext("2d");return B.font=`${D} ${M} ${H}px ${L}`,B.measureText(W).width},N=((W,H,L,M,D,B)=>{const V=[];return W.split(`
|
|
298
298
|
`).forEach(Y=>{const F=Y.split(" ");let $="";for(let z=0;z<F.length;z++){const K=$+F[z]+" ";T(K,L,M,D,B)>H+.5&&z>0?(V.push($.trim()),$=F[z]+" "):$=K}V.push($.trim())}),V})(S.text,S.width,S.fontSize,S.fontFamily,S.fontWeight,S.fontStyle),U=S.fontSize*S.lineHeight,G=S.align==="center"?"middle":S.align==="right"?"end":"start",Z=N.map((W,H)=>f("tspan",{x:S.align==="center"?S.width/2:S.align==="right"?S.width:0,dy:H===0?0:U,innerHTML:W}));return f("g",{},f("text",{fill:S.fill,y:S.fontSize,"font-size":S.fontSize+"px","text-anchor":G,"font-family":S.fontFamily,"font-style":S.fontStyle,"font-weight":S.fontWeight,"text-decoration":S.textDecoration,"line-height":S.lineHeight,"letter-spacing":S.letterSpacing+"em","stroke-width":S.strokeWidth,stroke:S.stroke},...Z))},v=({element:S,type:E})=>{const P={"stroke-width":S.height,stroke:S.color,"line-cap":"round","stroke-linejoin":"round",opacity:S.opacity};return E==="arrow"||E==="triangle"?f("polyline",Object.assign({points:`${3*S.height},${2*-S.height} 0,0 ${3*S.height},${2*S.height}`},P)):E==="bar"?f("polyline",Object.assign({points:`0,${2*-S.height} 0,${2*S.height}`},P)):E==="circle"?f("circle",Object.assign({r:S.height},P)):E==="square"?f("polyline",Object.assign({points:`${-S.height},${-S.height} ${-S.height},${S.height} ${S.height},${S.height} ${S.height},${-S.height}`},P)):null},O=async({element:S,page:E,store:P})=>f("g",{},f("line",{x1:0,y1:S.height/2,x2:S.width,y2:S.height/2,stroke:S.color,"stroke-width":S.height}),f("g",{transform:`translate(0 ${S.height/2})`},v({element:S,type:S.startHead})),f("g",{transform:`translate(${S.width} ${S.height/2}) rotate(180)`},v({element:S,type:S.endHead}))),g=async({element:S,page:E,store:P,elementHook:T})=>{const N=await Promise.all(S.children.map(G=>d({element:G,page:E,store:P,elementHook:T}))),U=f("g",{opacity:S.opacity,transform:`translate(${S.x}, ${S.y}) rotate(${S.rotation})`,style:{"transform-origin":"top left"}},...N);return T&&T({dom:U,element:S})||U};function b(S){let E=S.replace(/<svg[^>]*>/,"");return E=E.replace(/<\/svg>/,""),E}const p=async({element:S,page:E,store:P,elementHook:T})=>{const N=b((0,s.figureToSvg)(S)),U=f("g",{innerHTML:N});return T&&T({dom:U,element:S})||U},y={image:x,svg:x,text:w,line:O,figure:p,group:g};async function d({element:S,page:E,store:P,elementHook:T}){let N=await y[S.type];N||(N=()=>f("g",{}),console.error(`SVG export does not support ${S.type} type...`));const U=await N({element:S,page:E,store:P}),G=[];S.blurEnabled&&G.push(`blur(${S.blurRadius/2}px)`),S.brightnessEnabled&&G.push(`brightness(${100*S.brightness+100}%)`),S.sepiaEnabled&&G.push("sepia()"),S.grayscaleEnabled&&G.push("grayscale()"),S.shadowEnabled&&G.push(`drop-shadow(${S.shadowOffsetX}px ${S.shadowOffsetY}px ${S.shadowBlur}px ${S.shadowColor})`);const Z=f("g",{className:"element",id:S.id,transform:`translate(${S.x}, ${S.y}) rotate(${S.rotation})`,display:S.visible?void 0:"none",style:{"transform-origin":"top left",filter:G.join(" ")}},U);return T&&T({dom:Z,element:S})||Z}async function m({page:S,store:E,elementHook:P}){const T=await Promise.all(S.children.map(G=>d({element:G,page:S,store:E,elementHook:P}))),N=S.background.indexOf("url")>=0||S.background.indexOf("http")>=0||S.background.indexOf(".jpg")>=0||S.background.indexOf(".png")>=0||S.background.indexOf(".jpeg")>=0;let U;if(N){const G=await(0,l.loadImage)(S.background);U=await(0,l.cropImage)(S.background,Object.assign({width:E.width,height:E.height,x:0,y:0},(0,o.getCrop)({width:E.width,height:E.height},{width:G.width,height:G.height})))}return f("g",{className:"page",style:{}},N?f("image",{"xlink:href":U,x:0,y:0,width:E.width,height:E.height,preserveAspectRatio:"none"}):f("rect",{x:0,y:0,width:E.width,height:E.height,fill:N?void 0:S.background}),...T)}async function _({json:S,elementHook:E}){const P=await Promise.all(S.pages.map(U=>m({page:U,store:S,elementHook:E}))),T=[];S.pages.forEach(U=>{U.children.forEach(G=>{G.type==="text"&&T.indexOf(G.fontFamily)===-1&&T.push(G.fontFamily)})});const N=T.map(U=>S.fonts.find(G=>G.fontFamily===U)?f("style",{},""):f("defs",{},f("style",{type:"text/css",innerHTML:`@import url('https://fonts.googleapis.com/css?family=${U}:bi,normal,i,b');`.replace(/&/g,"&")})));return f("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:`0 0 ${S.width} ${S.height}`,width:S.width,height:S.height},...N,...P)}const A=(S,E)=>typeof E=="object"?`${S}="${Object.keys(E).map(P=>`${P}:${E[P]};`).join(" ")}"`:E==null||E===""?"":`${S}="${E}"`,C=({dom:S,nestLevel:E=0})=>{if(typeof S=="string")return S;if(!S)return"";const P=S.props,{innerHTML:T}=P,N=i(P,["innerHTML"]),U=" ".repeat(E);return`${U}<${S.type} ${Object.keys(N).map(G=>A(G,N[G])).join(" ")}>${T||`
|
|
299
299
|
`+S.children.map(G=>C({dom:G,nestLevel:E+1})).join("")}${U}</${S.type}>
|
|
300
|
-
`};async function R({json:S,elementHook:E}){const P=await _({json:S,elementHook:E});return C({dom:P})}})(PS);var Yg={},O_;function CS(){return O_||(O_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Page=void 0;const e=ni,n=t0,r=Lc(),i=x2(),o=Lc(),a=su;t.Page=e.types.model("Page",{id:e.types.identifier,children:e.types.array(e.types.late(()=>r.ElementTypes)),width:e.types.optional(e.types.union(e.types.number,e.types.literal("auto")),"auto"),height:e.types.optional(e.types.union(e.types.number,e.types.literal("auto")),"auto"),background:"white",bleed:0,custom:e.types.frozen(),duration:5e3,_exporting:!1,_rendering:!1,_forceMount:!1}).postProcessSnapshot(l=>{const s=Object.assign({},l),f={};for(var h in s)h[0]!=="_"&&(f[h]=l[h]);return f}).views(l=>({get store(){return(0,e.getParentOfType)(l,i.Store)}})).views(l=>({get startTime(){let s=0;for(const f of l.store.pages){if(f.id===l.id)return s;s+=f.duration}return s},get _exportingOrRendering(){return l._exporting||l._rendering}})).views(l=>({get computedWidth(){return l.width==="auto"?l.store.width:l.width},get computedHeight(){return l.height==="auto"?l.store.height:l.height}})).actions(l=>({toJSON:()=>JSON.parse(JSON.stringify((0,e.getSnapshot)(l))),_forEachElementUp(s,f){const h=s.map(x=>({id:x,index:l.children.findIndex(w=>w.id===x)}));h.sort((x,w)=>w.index-x.index);for(const{index:x}of h){if(x==-1)continue;const w=x<l.children.length-1&&l.children[x+1],v=s.indexOf(w==null?void 0:w.id)>=0;x===l.children.length-1||v||f(x)}},_forEachElementDown(s,f){const h=s.map(x=>({id:x,index:l.children.findIndex(w=>w.id===x)}));h.sort((x,w)=>x.index-w.index);for(const{index:x}of h){if(x==-1)continue;const w=x>0&&l.children[x-1],v=s.indexOf(w==null?void 0:w.id)>=0;x===0||v||f(x)}return!1}})).actions(l=>({clone(s={}){const f=l.toJSON();f.children.forEach(v=>{v.id=(0,n.nanoid)(10),(0,o.forEveryChild)(v,O=>{O.id=(0,n.nanoid)(10)})});const h=Object.assign(Object.assign(Object.assign({},f),{id:(0,n.nanoid)(10)}),s),x=l.store.addPage(h),w=l.store.pages.indexOf(l);x.setZIndex(w+1),x.select()},setZIndex(s){l.store.setPageZIndex(l.id,s)},set(s){Object.assign(l,s)},select(){l.store.selectPage(l.id)},addElement(s,{skipSelect:f=!1}={}){const h=o.TYPES_MAP[s.type];if(!h)return void console.error("Can not find model with type "+s.type);"children"in s&&Array.isArray(s.children)&&s.children.forEach(w=>{w.id=(0,n.nanoid)(10)});const x=h.create(Object.assign({id:(0,n.nanoid)(10)},s));return l.children.push(x),x.selectable&&!f&&l.store.selectElements([x.id]),x},canMoveElementsUp(s){let f=!1;return l._forEachElementUp(s,()=>{f=f||!0}),f},moveElementsUp(s){l._forEachElementUp(s,f=>{const h=l.children[f];(0,e.detach)(h),l.children.splice(f+1,0,h)})},canMoveElementsTop(s){return this.canMoveElementsUp(s)},moveElementsTop(s){const f=[],h=[];l.children.forEach(x=>{s.indexOf(x.id)>=0?f.push(x):h.push(x)}),l.children.replace(h.concat(f))},canMoveElementsDown(s){let f=!1;return l._forEachElementDown(s,()=>{f=f||!0}),f},moveElementsDown(s){l._forEachElementDown(s,f=>{const h=l.children[f];(0,e.detach)(h),l.children.splice(f-1,0,h)})},canMoveElementsBottom(s){return this.canMoveElementsDown(s)},moveElementsBottom(s){const f=[],h=[];l.children.forEach(x=>{s.indexOf(x.id)>=0?f.push(x):h.push(x)}),l.children.replace(f.concat(h))},setElementZIndex(s,f){const h=l.children.find(x=>x.id===s);h&&((0,e.detach)(h),l.children.remove(h),l.children.splice(f,0,h))},setSize({width:s,height:f,useMagic:h,softChange:x}){if(h){const w=[],v=N=>N.type==="image"&&N.x<1&&N.y<1&&N.width>=l.computedWidth-2&&N.height>=l.computedHeight-2;(0,o.forEveryChild)(l,N=>{N.type!=="group"&&(v(N)||w.push(N))});const O=w.length?(0,a.getTotalClientRect)(w):{x:0,y:0,width:l.computedWidth,height:l.computedHeight},g=1/4,b=Math.max(0,Math.min(O.x,l.computedWidth-O.x-O.width)),p=l.computedWidth*g,y=Math.max(0,b-p),d=Math.max(0,Math.min(O.y,l.computedHeight-O.y-O.height)),m=l.computedHeight*g,_=Math.max(0,d-m),A=l.computedWidth-2*y,C=l.computedHeight-2*_,R=s/A,S=f/C,E=Math.min(R,S),P=(s-A*E)/2-y*E,T=(f-C*E)/2-_*E;(0,o.forEveryChild)(l,N=>{N.type!=="group"&&(v(N)?N.set({x:N.x*E,y:N.y*E,width:N.width*R,height:N.height*S,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(N.set({x:P+N.x*E,y:T+N.y*E,width:N.width*E,height:N.height*E}),N.type==="text"?N.set({fontSize:N.fontSize*E}):N.type==="figure"&&N.set({strokeWidth:N.strokeWidth*E})))})}x||(l.width=s),x||(l.height=f)}})).actions(l=>({moveElementUp(s){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),l.moveElementsUp([s])},moveElementDown(s){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),l.moveElementsDown([s])},moveElementTop(s){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),l.moveElementsTop([s])},moveElementBottom(s){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),l.moveElementsBottom([s])},play(){l.store.play({startTime:l.startTime,endTime:l.startTime+l.duration})}}))}(Yg)),Yg}var kS={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Audio=void 0;const e=ni;t.Audio=e.types.model("Audio",{id:e.types.identifier,src:"",duration:0,startTime:0,endTime:1,volume:1,delay:0}).actions(n=>({toJSON:()=>Object.assign({},(0,e.getSnapshot)(n))})).actions(n=>({set(r){Object.assign(n,r)}}))})(kS);var x_;function x2(){return x_||(x_=1,function(t){var e=_e&&_e.__createBinding||(Object.create?function(S,E,P,T){T===void 0&&(T=P);var N=Object.getOwnPropertyDescriptor(E,P);N&&!("get"in N?!E.__esModule:N.writable||N.configurable)||(N={enumerable:!0,get:function(){return E[P]}}),Object.defineProperty(S,T,N)}:function(S,E,P,T){T===void 0&&(T=P),S[T]=E[P]}),n=_e&&_e.__setModuleDefault||(Object.create?function(S,E){Object.defineProperty(S,"default",{enumerable:!0,value:E})}:function(S,E){S.default=E}),r=_e&&_e.__importStar||function(S){if(S&&S.__esModule)return S;var E={};if(S!=null)for(var P in S)P!=="default"&&Object.prototype.hasOwnProperty.call(S,P)&&e(E,S,P);return n(E,S),E},i=_e&&_e.__rest||function(S,E){var P={};for(var T in S)Object.prototype.hasOwnProperty.call(S,T)&&E.indexOf(T)<0&&(P[T]=S[T]);if(S!=null&&typeof Object.getOwnPropertySymbols=="function"){var N=0;for(T=Object.getOwnPropertySymbols(S);N<T.length;N++)E.indexOf(T[N])<0&&Object.prototype.propertyIsEnumerable.call(S,T[N])&&(P[T[N]]=S[T[N]])}return P},o=_e&&_e.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(t,"__esModule",{value:!0}),t.Store=t.Font=void 0,t.createStore=R;const a=ni,l=_S,s=t0,f=o(ki),h=wS,x=SS,w=ES,v=E2(),O=r(iu),g=Yi,b=e0,p=O2,y=OS,d=xS,m=PS,_=CS(),A=Lc(),C=kS;function R({key:S,showCredit:E}={key:"",showCredit:!1}){return t.Store.create({_forceShowCredit:E,_key:S})}(0,a.setLivelinessChecking)("ignore"),t.Font=a.types.model("Font",{fontFamily:a.types.string,url:a.types.optional(a.types.string,""),styles:a.types.frozen()}).preProcessSnapshot(S=>Object.assign(Object.assign({},S),{fontFamily:S.fontFamily||S.name})),t.Store=a.types.model("Store",{role:"",pages:a.types.array(_.Page),fonts:a.types.array(t.Font),audios:a.types.array(C.Audio),width:1080,height:1080,currentTime:0,isPlaying:!1,scale:1,scaleToFit:1,unit:"px",dpi:72,bleedVisible:!1,rulesVisible:!1,openedSidePanel:"",previousOpenedSidePanel:"",custom:a.types.frozen(),selectedElementsIds:a.types.array(a.types.string),animatedElementsIds:a.types.array(a.types.string),history:a.types.optional(l.UndoManager,{targetPath:"../pages"}),_elementsPixelRatio:Math.min(2,window.devicePixelRatio||1),_activePageId:"",_forceShowCredit:!1,_key:"",_validated:!1}).views(S=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),S.bleedVisible},get selectedElements(){return S.selectedElementsIds.map(E=>{for(const P of S.pages)for(const T of P.children)if(T.id===E)return T}).filter(E=>!!E)},get children(){return S.pages},get selectedShapes(){const E=[];return(0,A.forEveryChild)({children:S.selectedElements},P=>{P.type!=="group"&&E.push(P)}),E},get activePage(){return S.pages.slice().find(E=>E.id===S._activePageId)||(S.pages.length?S.pages[0]:null)},get duration(){let E=0;return S.pages.forEach(P=>{E+=P.duration}),E},get _hasCroppedImages(){return S.find(E=>E.type==="image"&&E._cropModeEnabled)},find(E){let P;return(0,A.forEveryChild)({children:S.pages},T=>{if(!P&&E(T))return P=T,!0}),P},getElementById:E=>S.find(P=>P.id===E)})).actions(S=>{let E=0,P=null,T=!1;return{afterCreate(){S.history.canUndo},setCurrentTime(N){S.currentTime=N},_togglePlaying(N=!S.isPlaying){S.isPlaying=N},play({animatedElementsIds:N=[],startTime:U=0,currentTime:G=0,endTime:Z=S.duration,repeat:W=!1}={}){G&&(console.warn("currentTime property of store.play() is deprecated. Please use startTime instead."),U=G),S.animatedElementsIds=(0,a.cast)(N),S.currentTime=U,S.isPlaying=!0,E=Date.now(),P=Z,T=W,requestAnimationFrame(S.seek)},checkActivePage(){let N=0;for(const U of S.pages){if(S.currentTime>=U.startTime&&S.currentTime<U.startTime+U.duration){S.selectPage(U.id);break}N+=U.duration}},seek(){if(!S.isPlaying)return;const N=Date.now(),U=N-E;E=N,S.currentTime+=U,S.checkActivePage();const G=P||S.duration;S.isPlaying&&S.currentTime<G?requestAnimationFrame(S.seek):S.isPlaying&&T?(S.currentTime=0,requestAnimationFrame(S.seek)):S.stop()},stop(){S.isPlaying=!1,S.currentTime=0,S.animatedElementsIds=(0,a.cast)([]),S.checkActivePage()}}}).actions(S=>({__(){S._validated||((0,v.validateKey)(S._key,S._forceShowCredit),S._validated=!0)},set(E){Object.assign(S,E)},setUnit({unit:E,dpi:P}){S.unit=E||S.unit,S.dpi=P||S.dpi},setRole(E){S.role=E},addPage(E){const P=_.Page.create(Object.assign({id:(0,s.nanoid)(10)},E));return S.pages.push(P),S._activePageId=P.id,P},selectPage(E){S._activePageId=E},selectElements(E){const P=E.map(T=>S.getElementById(T)).sort((T,N)=>T.page.children.indexOf(T)-T.page.children.indexOf(N)).filter(T=>!!T).map(T=>T.id);S.selectedElementsIds=(0,a.cast)(P)},toggleBleed(E){S.bleedVisible=E??!S.bleedVisible},toggleRulers(E){S.rulesVisible=E??!S.rulesVisible},openSidePanel(E){S.openedSidePanel!==E&&(S.previousOpenedSidePanel=S.openedSidePanel,S.openedSidePanel=E)},setScale(E){S.scale=E},_setScaleToFit(E){S.scaleToFit=E},setElementsPixelRatio(E){S._elementsPixelRatio=E},setSize(E,P,T){S.pages.forEach(N=>{N.setSize({width:E,height:P,useMagic:T,softChange:!0})}),S.width=E,S.height=P},setPageZIndex(E,P){const T=S.pages.find(N=>N.id===E);T&&((0,a.detach)(T),S.pages.remove(T),S.pages.splice(P,0,T))},deletePages(E){const P=S.pages.indexOf(S.activePage);E.forEach(U=>{const G=S.pages.find(Z=>Z.id===U);(0,a.destroy)(G)});const T=Math.min(S.pages.length-1,P),N=S.pages[T];N&&(S._activePageId=N.id),S.selectedElementsIds=(0,a.cast)(S.selectedElementsIds.filter(U=>S.getElementById(U)))},groupElements(E){const P=E.map(U=>S.getElementById(U));P.forEach(U=>{U&&(0,a.detach)(U)});const T=S.activePage,N={id:(0,s.nanoid)(10),children:P,type:"group"};return T.children.push(N),S.selectedElementsIds=(0,a.cast)([N.id]),T.children.find(U=>U.id===N.id)},ungroupElements(E){const P=E.map(N=>S.getElementById(N)),T=[];P.forEach(N=>{if(N&&N.type==="group"){const U=N.page,G=U.children.indexOf(N);N.children.forEach(Z=>{T.push(Z.id)}),N.children.forEach(Z=>{(0,a.detach)(Z),U.children.push(Z)}),U.children.splice(G,1)}}),S.selectedElementsIds=(0,a.cast)(T)},deleteElements(E){const P=[];S.find(T=>(E.includes(T.id)&&P.push(T),!1)),P.forEach(T=>{(0,a.destroy)(T)}),S.selectedElementsIds=(0,a.cast)(S.selectedElementsIds.filter(T=>S.getElementById(T)))},on(E,P){if(E==="change"){let T=S.toJSON();return(0,a.onSnapshot)(S,N=>{const U=S.toJSON();!(0,p.deepEqual)(T,U)&&(T=U,P(U))})}},async _toCanvas({pixelRatio:E,ignoreBackground:P,pageId:T,mimeType:N,includeBleed:U,_skipTimeout:G,quickMode:Z=!1}={}){var W;const H=E||1;T=T||((W=S.pages[0])===null||W===void 0?void 0:W.id);const L=S.pages.find(me=>me.id===T);if(!L)throw new Error(`No page for export with id ${T}`);Z?L==null||L.set({_forceMount:!0}):L==null||L.set({_exporting:!0});const M=await(0,y.waitTillAvailable)(()=>f.default.stages.find(me=>me.getAttr("pageId")===T));if(!M)throw L==null||L.set({_forceMount:!1,_exporting:!1}),new Error(`Export is failed. Can not find stage for page ${T}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);const D=!!M.findOne(".page-container"),B=S._elementsPixelRatio;H>S._elementsPixelRatio&&S.setElementsPixelRatio(H),await S.waitLoading({_skipTimeout:G});const V=M.findOne(".page-container");if(!V)throw S.setElementsPixelRatio(B),L==null||L.set({_forceMount:!1,_exporting:!1}),new Error(`Export is failed. Can't find page container. ${D}`);M.find("Transformer").forEach(me=>me.visible(!1)),V.find(".page-background").forEach(me=>me.shadowEnabled(!1)),V.find(".page-background").forEach(me=>me.strokeEnabled(!1)),V.find(".highlighter").forEach(me=>me.visible(!1));const Y=V.findOne(".page-background-group"),F=Y.clip();Y.clip({x:null,y:null,width:null,height:null});const $=V.findOne(".elements-container"),z=$.clip();$.clip({x:null,y:null,width:null,height:null});const K=V.find(me=>me.getAttr("hideInExport"));K.forEach(me=>{me.setAttr("oldVisible",me.visible()),me.hide()});const X=V.find(me=>!me.visible()&&me.getAttr("editModeEnabled"));X.forEach(me=>{me.setAttr("oldVisible",me.visible()),me.show()}),P&&V.find(".page-background").forEach(me=>me.hide());const Q=U?L.bleed:0;let J=Q;!S.bleedVisible&&U||(S.bleedVisible||U?S.bleedVisible&&U?J=0:S.bleedVisible&&!U&&(J=-L.bleed):J=0);const ne=document.createElement("canvas");ne.width=Math.round((L.computedWidth+2*Q)*H),ne.height=Math.round((L.computedHeight+2*Q)*H);const ie=ne.getContext("2d");N==="image/jpeg"&&(ie.fillStyle="white",ie.fillRect(0,0,ne.width,ne.height));const oe=V.scale();V.scale({x:1,y:1});const he=V.toCanvas({x:V.x()-J,y:V.y()-J,width:L.computedWidth+2*Q,height:L.computedHeight+2*Q,pixelRatio:H});return V.scale(oe),ie.drawImage(he,0,0,ne.width,ne.height),f.default.Util.releaseCanvas(he),P&&V.find(".page-background").forEach(me=>me.show()),K.forEach(me=>{me.visible(me.getAttr("oldVisible"))}),X.forEach(me=>{me.visible(me.getAttr("oldVisible"))}),V.find(".page-background").forEach(me=>me.shadowEnabled(!0)),V.find(".page-background").forEach(me=>me.strokeEnabled(!0)),M.find("Transformer").forEach(me=>me.visible(!0)),V.find(".highlighter").forEach(me=>me.visible(!0)),Y.clip(F),$.clip(z),S.setElementsPixelRatio(B),L==null||L.set({_exporting:!1,_forceMount:!1}),ne},async toDataURL(E={}){var{mimeType:P,quality:T}=E,N=i(E,["mimeType","quality"]);const U=await S._toCanvas(Object.assign({mimeType:P},N)),G=U.toDataURL(P,T);return f.default.Util.releaseCanvas(U),G},async toBlob(E={}){var{mimeType:P,quality:T}=E,N=i(E,["mimeType","quality"]);const U=await S._toCanvas(Object.assign({mimeType:P},N)),G=await new Promise(Z=>{U.toBlob(Z,P,T)});return f.default.Util.releaseCanvas(U),G},async saveAsImage(E={}){var{fileName:P}=E,T=i(E,["fileName"]);const N=T.mimeType||"image/png",U=N.split("/")[1];(0,h.downloadFile)(await S.toDataURL(T),P||"polotno."+U,N)},async _toPDF(E){const P=E.dpi||S.dpi,T=E.parallel||1,N=E.unit||(S.unit==="px"?"mm":S.unit),U=E.pixelRatio||1,G=E.pageIds||S.pages.map(K=>K.id),Z=S.pages.filter(K=>G.includes(K.id)),W=await(0,x.getJsPDF)(),H=K=>(0,b.pxToUnit)({px:K,unit:N,dpi:P}),L=E.cropMarkSize||0,M=H(L),D=Z[0]||{},B=E.includeBleed?D.bleed:0,V=H(D.computedWidth+2*B+2*M),Y=H(D.computedHeight+2*B+2*M);var F=new W({unit:N,orientation:V>Y?"landscape":"portrait",format:[V,Y],compress:!0,putOnlyUsedFonts:!0});F.deletePage(1);const $=((K,X)=>{for(var Q=[],J=0;J<K.length;J+=X)Q.push(K.slice(J,J+X));return Q})(Z,T);let z=0;for(const K of $){const X=K.map(async Q=>{const J=E.includeBleed?Q.bleed:0,ne=Q.computedWidth+2*J+2*L,ie=Q.computedHeight+2*J+2*L,oe=H(ne),he=H(ie);let me=0,Pe=U;for(;me<10;){me+=1,me===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const re=await S.toDataURL(Object.assign(Object.assign({},E),{pageId:Q.id,pixelRatio:Pe}));if(re.length>20)return E.onProgress&&E.onProgress(++z/G.length*.9),{url:re,width:oe,height:he,widthPx:ne,heightPx:ie};Pe*=.8}});(await Promise.all(X)).forEach(({url:Q,width:J,height:ne,widthPx:ie,heightPx:oe})=>{F.addPage([J,ne],J>ne?"landscape":"portrait");const he=F.getCurrentPageInfo();he.pageContext.cropBox={bottomLeftX:0,bottomLeftY:0,topRightX:ie,topRightY:oe},he.pageContext.bleedBox={bottomLeftX:L+B,bottomLeftY:L+B,topRightX:ie-L-B,topRightY:oe-L-B},M&&(F.setLineWidth(H(1)),F.line(2*M,0,2*M,M),F.line(0,2*M,M,2*M),F.line(J-2*M,0,J-2*M,M),F.line(J,2*M,J-M,2*M),F.line(0,ne-2*M,M,ne-2*M),F.line(2*M,ne,2*M,ne-M),F.line(J,ne-2*M,J-M,ne-2*M),F.line(J-2*M,ne,J-2*M,ne-M)),F.addImage(Q,M,M,J-2*M,ne-2*M,void 0,"FAST")})}return F},toPDFDataURL:async E=>(await S._toPDF(Object.assign({mimeType:"image/jpeg"},E))).output("datauristring"),async toGIFDataURL(E={}){const P=E.pixelRatio||1,T=await(0,w.createGIF)({width:S.width*P,height:S.height*P}),N=1e3/(E.fps||10),U=S.duration/N;for(let G=0;G<U-1;G++){const Z=G*N||1;S.setCurrentTime(Z);let W=0,H="";for(const M of S.pages)if(W+=M.duration,M.set({_rendering:W>Z}),W>Z){H=M.id;break}const L=await S._toCanvas({pixelRatio:P,pageId:H,_skipTimeout:!0});T.addFrame(L.getContext("2d"),{delay:N,copy:!0})}for(const G of S.pages)G.set({_rendering:!1});return S.stop(),T.render(),new Promise(G=>{T.on("finished",function(Z){(function(W,H){var L=new FileReader;L.onload=function(M){H(M.target.result)},L.readAsDataURL(W)})(Z,G)})})},async saveAsGIF(E={}){var{fileName:P}=E,T=i(E,["fileName"]);const N=await S.toGIFDataURL(T);(0,h.downloadFile)(N,P||"polotno.gif")},async toHTML({elementHook:E}={elementHook:void 0}){const P=S.toJSON();return(0,d.jsonToHTML)({json:P,elementHook:E})},async saveAsHTML({fileName:E}={}){const P=await S.toHTML(),T="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(P)));(0,h.downloadFile)(T,E||"polotno.html")},async toSVG({elementHook:E,pageId:P}={elementHook:void 0,pageId:void 0}){var T;const N=S.toJSON();P=P||((T=N.pages[0])===null||T===void 0?void 0:T.id);const U=N.pages.find(G=>G.id===P);return(0,m.jsonToSVG)({json:Object.assign(Object.assign({},N),{pages:U?[U]:[]}),elementHook:E})},async saveAsSVG({fileName:E,elementHook:P,pageId:T}={}){const N=await S.toSVG({elementHook:P,pageId:T}),U="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(N)));(0,h.downloadFile)(U,E||"polotno.svg")},async saveAsPDF(E={}){var{fileName:P}=E,T=i(E,["fileName"]);(await S._toPDF(Object.assign({mimeType:"image/jpeg"},T))).save(P||"polotno.pdf")},async waitLoading({_skipTimeout:E=!1}={}){E||await new Promise(P=>setTimeout(P,50)),await(0,g.whenLoaded)()},toJSON:()=>({width:S.width,height:S.height,fonts:(0,a.getSnapshot)(S.fonts),pages:(0,a.getSnapshot)(S.pages),audios:(0,a.getSnapshot)(S.audios),unit:S.unit,dpi:S.dpi,custom:S.custom}),loadJSON(E,P=!1){var T;const N=Object.assign({},E),U=S.pages.indexOf(S.activePage);let G=(T=N.pages[U]||N.pages[0])===null||T===void 0?void 0:T.id;N._activePageId=G;const Z=Object.assign({},(0,a.getSnapshot)(S));Object.assign(Z,N),Z.history=P?S.history.toJSON():{history:[],undoIdx:-1},(0,a.applySnapshot)(S,Z)},clear({keepHistory:E=!1}={}){const P=S.pages.map(T=>T.id);S.deletePages(P),E||S.history.clear()},addFont(E){S.removeFont(E.fontFamily),S.fonts.push(E),S.loadFont(E.fontFamily)},removeFont(E){S.fonts.filter(P=>P.fontFamily===E).forEach(P=>(0,a.destroy)(P))},addAudio(E){const P=C.Audio.create(Object.assign({id:(0,s.nanoid)(10)},E));S.audios.push(P)},removeAudio(E){const P=S.audios.find(T=>T.id===E);P&&S.audios.remove(P)},async loadFont(E){const P=S.fonts.find(N=>N.fontFamily===E)||O.globalFonts.find(N=>N.fontFamily===E);let T=[{fontStyle:"normal",fontWeight:"normal"}];return P?(P.styles&&(T=P.styles.map(N=>({fontStyle:N.fontStyle||"normal",fontWeight:N.fontWeight||"normal"}))),O.injectCustomFont(P)):O.injectGoogleFont(E),Promise.all(T.map(N=>O.loadFont(E,N.fontStyle,N.fontWeight)))},validate:E=>t.Store.validate(E,[{path:"",type:t.Store}]).map(P=>({path:"store"+P.context.map(T=>T.path).join("."),message:P.message}))})),t.default=R}(Wg)),Wg}var P_;function TS(){return P_||(P_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Node=void 0;const e=ni,n=t0,r=x2(),i=CS(),o=Lc();t.Node=e.types.model("Node",{id:e.types.identifier,type:"none",name:"",opacity:1,custom:e.types.frozen(),visible:!0,selectable:!0,removable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(a=>{for(var l in a)a[l]===null&&(a[l]=void 0);return a}).postProcessSnapshot(a=>{const l=Object.assign({},a),s={};for(var f in l)f[0]!=="_"&&(s[f]=a[f]);return s}).views(a=>({get locked(){return!(a.draggable||a.contentEditable||a.styleEditable||a.resizable)},get page(){return(0,e.getParentOfType)(a,i.Page)},get store(){return(0,e.getParentOfType)(a,r.Store)},get top(){let l=a;for(;;){if(!(0,e.hasParentOfType)(l,o.GroupElement))return l;l=(0,e.getParentOfType)(l,o.GroupElement)}},get parent(){return(0,e.hasParentOfType)(a,o.GroupElement)?(0,e.getParentOfType)(a,o.GroupElement):(0,e.hasParentOfType)(a,i.Page)?(0,e.getParentOfType)(a,i.Page):(0,e.hasParentOfType)(a,r.Store)?(0,e.getParentOfType)(a,r.Store):null},get zIndex(){return a.parent.children.indexOf(a)}})).actions(a=>({toJSON:()=>Object.assign({},(0,e.getSnapshot)(a))})).actions(a=>({clone(l={},{skipSelect:s=!1}={}){const f=JSON.parse(JSON.stringify(a.toJSON()));return l.id=l.id||(0,n.nanoid)(10),(0,o.forEveryChild)(f,h=>{h.id=(0,n.nanoid)(10)}),Object.assign(f,l),a.page.addElement(f,{skipSelect:s})},set(l){Object.assign(a,l)},moveUp(){a.page.moveElementsUp([a.id])},moveTop(){a.page.moveElementsTop([a.id])},moveDown(){a.page.moveElementsDown([a.id])},moveBottom(){a.page.moveElementsBottom([a.id])},setZIndex(l){a.parent.setElementZIndex(a.id,l)},beforeDestroy(){}}))}(qg)),qg}var Kg={},AS={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.registerAnimation=t.animate=t.animations=void 0;const e=su,n={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}}};t.animations={fade:({dTime:o,element:a,animation:l})=>{const s=o/l.duration;return l.type==="enter"?{opacity:s*a.opacity}:{opacity:(1-s)*a.opacity}},rotate:({dTime:o,element:a,animation:l})=>{const s=o/l.duration*360;return(0,e.rotateAroundCenter)({x:a.x,y:a.y,width:a.width,height:a.height,rotation:a.rotation},s)},blink:({dTime:o,element:a,animation:l})=>{const s=l.duration,f=o%s/(s/2),h=f<=1?f:2-f;return{opacity:a.opacity*h}},bounce:({dTime:o,element:a,animation:l})=>{const s=l.duration,f=s/2,h={},x={x:a.x+a.width/3,y:a.y+a.height/3,width:a.width/3,height:a.height/3,fontSize:a.fontSize/3},w={x:a.x,y:a.y,width:a.width,height:a.height,fontSize:a.fontSize},v=o%s/f,O=v<=1?v:2-v;for(let g in x){const b=x[g],p=w[g]-b;h[g]=b+O*p}return h},move:({dTime:o,element:a,animation:l})=>{const s=n[l.data.direction]||n.right,f={};for(var h in s.from){let x=s.from[h],w=s.to[h];l.type==="exit"&&(x=s.to[h],w=-s.from[h]);const v=a[h]+x,O=a[h]+w-v;f[h]=v+o/l.duration*O}return f},zoom:({dTime:o,element:a,animation:l})=>{const s={},f={x:a.x+a.width/3,y:a.y+a.height/3,width:a.width/3,height:a.height/3,fontSize:a.fontSize/3},h={x:a.x,y:a.y,width:a.width,height:a.height,fontSize:a.fontSize};for(var x in f){let w=f[x],v=h[x];if(l.type==="exit"){const g=w;w=v,v=g}const O=v-w;s[x]=w+o/l.duration*O}return s}};const r=({element:o,dTime:a,animation:l})=>{const s=t.animations[l.name];return s?s({element:o,dTime:a,animation:l}):(console.error("Can not find animation type: "+l.name),{})};t.animate=r;const i=(o,a)=>{};t.registerAnimation=i})(AS);var C_;function uu(){return C_||(C_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Shape=t.Animation=void 0;const e=ni,n=AS,r=Qi,i=TS();t.Animation=e.types.model("Animation",{delay:0,duration:500,enabled:!0,type:e.types.enumeration("Type",["enter","exit","loop"]),name:"none",data:e.types.frozen({})}),t.Shape=i.Node.named("Shape").props({x:0,y:0,width:100,height:100,rotation:0,opacity:1,animations:e.types.array(t.Animation),blurEnabled:!1,blurRadius:10,brightnessEnabled:!1,brightness:0,sepiaEnabled:!1,grayscaleEnabled:!1,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 a=Object.assign(Object.assign({},o),{x:o.x||0,y:o.y||0});return"width"in o&&(a.width=a.width||1),"height"in o&&(a.height=a.height||1),o.locked&&(a.draggable=!1,a.contentEditable=!1,a.styleEditable=!1,a.resizable=!1,a.removable=!1),a}).views(o=>{const a=(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}),l=(0,r.action)(s=>{Object.assign(a,s)});return{get a(){const{currentTime:s}=o.store;if(l({x:o.x,y:o.y,width:o.width,height:o.height,rotation:o.rotation,opacity:o.opacity,color:o.color,fontSize:o.fontSize}),s===0)return a;const f=s-o.page.startTime;if(f>o.page.duration||f<0)return a;const h=o.store.animatedElementsIds;if(h.length&&!h.includes(o.id))return a;const x=o.animations.find(O=>O.type==="enter");if(x!=null&&x.enabled&&f<x.delay&&l({opacity:0}),x!=null&&x.enabled&&f>=x.delay&&f<=x.delay+x.duration){const O=f-x.delay,g=(0,n.animate)({element:o,animation:x,dTime:O});l(g)}const w=o.animations.find(O=>O.type==="exit");if(w!=null&&w.enabled&&f>=o.page.duration-w.duration-w.delay&&f<=o.page.duration-w.delay){const O=f-(o.page.duration-w.duration-w.delay),g=(0,n.animate)({element:o,animation:w,dTime:O});l(g)}w!=null&&w.enabled&&f>=o.page.duration-w.delay&&l({opacity:0});const v=o.animations.find(O=>O.type==="loop");if(v!=null&&v.enabled){const O=f,g=(0,n.animate)({element:o,animation:v,dTime:O});l(g)}return a},animated:s=>o.a[s]}}).actions(o=>({setAnimation(a,l){const s=o.animations.find(f=>f.type===a);s?Object.assign(s,l):o.animations.push(Object.assign({type:a},l))}}))}(Kg)),Kg}var Xg={},k_;function vj(){return k_||(k_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TextElement=void 0;const e=ni,n=uu();t.TextElement=n.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:e.types.optional(e.types.union(e.types.number,e.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(i){r._editModeEnabled=i??!r._editModeEnabled,r._editModeEnabled?r.store.history.startTransaction():r.store.history.endTransaction()}}))}(Xg)),Xg}var Zg={},T_;function RS(){return T_||(T_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImageElement=void 0;const e=uu();t.ImageElement=e.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(n=>({toggleCropMode(r){n._cropModeEnabled=r??!n._cropModeEnabled,n._cropModeEnabled?n.store.history.startTransaction():n.store.history.endTransaction()},beforeDestroy(){n._cropModeEnabled&&n.store.history.endTransaction()}}))}(Zg)),Zg}var Qg={},A_;function mj(){return A_||(A_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.VideoElement=void 0;const e=RS();t.VideoElement=e.ImageElement.named("Video").props({type:"video",duration:0,startTime:0,endTime:1,volume:1})}(Qg)),Qg}var Jg={},R_;function yj(){return R_||(R_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LineElement=void 0;const e=ni,n=uu();t.LineElement=n.Shape.named("Line").props({type:"line",width:400,height:10,color:"black",dash:e.types.array(e.types.number),startHead:"",endHead:""}).actions(r=>({}))}(Jg)),Jg}var ev={},M_;function bj(){return M_||(M_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SVGElement=void 0;const e=ni,n=uu();t.SVGElement=n.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:e.types.map(e.types.string)}).preProcessSnapshot(r=>Object.assign(Object.assign({},r),{src:r.src||r.svgSource})).actions(r=>({replaceColor(i,o){r.colorsReplace.set(i,o)}}))}(ev)),ev}var tv={},L_;function _j(){return L_||(L_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FigureElement=void 0;const e=ni,n=uu();t.FigureElement=n.Shape.named("Figure").props({type:"figure",subType:"rect",fill:"rgb(0, 161, 255)",dash:e.types.array(e.types.number),strokeWidth:0,stroke:"rgba(98, 197, 255, 1)",cornerRadius:0})}(tv)),tv}var N_;function Lc(){return N_||(N_=1,function(t){var e=_e&&_e.__rest||function(b,p){var y={};for(var d in b)Object.prototype.hasOwnProperty.call(b,d)&&p.indexOf(d)<0&&(y[d]=b[d]);if(b!=null&&typeof Object.getOwnPropertySymbols=="function"){var m=0;for(d=Object.getOwnPropertySymbols(b);m<d.length;m++)p.indexOf(d[m])<0&&Object.prototype.propertyIsEnumerable.call(b,d[m])&&(y[d[m]]=b[d[m]])}return y};Object.defineProperty(t,"__esModule",{value:!0}),t.TYPES_MAP=t.GroupElement=t.ElementTypes=t.forEveryChild=void 0,t.registerShapeModel=g;const n=ni,r=t0,i=TS(),o=uu(),a=vj(),l=RS(),s=mj(),f=yj(),h=bj(),x=_j(),w=(b,p)=>{if(b.children)for(const y of b.children){if(p(y)===!0)break;(0,t.forEveryChild)(y,p)}};t.forEveryChild=w;const v=[...new Array(20)].map((b,p)=>n.types.late(()=>O[p]));t.ElementTypes=n.types.union({dispatcher:b=>{const p=t.TYPES_MAP[b.type];if(!p)throw new Error(`Unknown element type: "${b.type}"`);return p}},h.SVGElement,a.TextElement,l.ImageElement,f.LineElement,s.VideoElement,x.FigureElement,n.types.late(()=>t.GroupElement),...v),t.GroupElement=i.Node.named("Group").props({type:"group",children:n.types.array(t.ElementTypes)}).views(b=>({get draggable(){let p=!0;return(0,t.forEveryChild)(b,y=>{y.draggable||(p=!1)}),p},get resizable(){let p=!0;return(0,t.forEveryChild)(b,y=>{y.resizable||(p=!1)}),p},get contentEditable(){let p=!0;return(0,t.forEveryChild)(b,y=>{y.contentEditable||(p=!1)}),p},get styleEditable(){let p=!0;return(0,t.forEveryChild)(b,y=>{y.styleEditable||(p=!1)}),p},get locked(){let p=!0;return(0,t.forEveryChild)(b,y=>{y.locked||(p=!1)}),p}})).actions(b=>({set(p){var{draggable:y,contentEditable:d,styleEditable:m,resizable:_}=p,A=e(p,["draggable","contentEditable","styleEditable","resizable"]);y!==void 0&&(0,t.forEveryChild)(b,C=>{C.set({draggable:y})}),d!==void 0&&(0,t.forEveryChild)(b,C=>{C.set({contentEditable:d})}),m!==void 0&&(0,t.forEveryChild)(b,C=>{C.set({styleEditable:m})}),_!==void 0&&(0,t.forEveryChild)(b,C=>{C.set({resizable:_})}),Object.assign(b,A)},addElement(p,{skipSelect:y=!1}={}){const d=t.TYPES_MAP[p.type];if(!d)return void console.error("Can not find model with type "+p.type);p.children&&p.children.forEach(_=>{_.id=(0,r.nanoid)(10)});const m=d.create(Object.assign({id:(0,r.nanoid)(10)},p));return b.children.push(m),m.selectable&&!y&&b.store.selectElements([m.id]),m},setElementZIndex(p,y){const d=b.children.find(m=>m.id===p);d&&((0,n.detach)(d),b.children.remove(d),b.children.splice(y,0,d))}}));const O=[];function g(b,p){const y=b.type;if(!y)throw new Error('You must pass "type" attribute to custom model.');let d=o.Shape.named(y).props(b);p&&(d=p(d)),t.TYPES_MAP[y]=d,O.push(d)}t.TYPES_MAP={svg:h.SVGElement,text:a.TextElement,image:l.ImageElement,group:t.GroupElement,line:f.LineElement,video:s.VideoElement,figure:x.FigureElement}}(Vg)),Vg}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.handleHotkey=l;const e=Lc();let n=[],r="";const i="polotno_clipboard",o=s=>{n=JSON.parse(JSON.stringify(s));try{localStorage.setItem(i,JSON.stringify(s))}catch{}},a=()=>{try{const s=localStorage.getItem(i);if(s)return JSON.parse(s)}catch{}return n};function l(s,f){var h,x,w,v,O,g,b,p;if(((h=document.activeElement)===null||h===void 0?void 0:h.tagName)==="INPUT"||((x=document.activeElement)===null||x===void 0?void 0:x.tagName)==="TEXTAREA"||((w=document.activeElement)===null||w===void 0?void 0:w.contentEditable)==="true")return;const y=f.selectedElements.filter(A=>A.removable),d=y.map(A=>A.id);s.keyCode!==46&&s.keyCode!==8||f.deleteElements(d);const m=s.ctrlKey||s.metaKey,_=s.shiftKey;if(m&&!_&&s.code==="KeyZ"&&(s.preventDefault(),f.history.undo()),m&&_&&s.code==="KeyZ"&&(s.preventDefault(),f.history.redo()),m&&s.code==="KeyA"){s.preventDefault();const A=(v=f.activePage)===null||v===void 0?void 0:v.children.filter(R=>R.selectable),C=(A==null?void 0:A.map(R=>R.id))||[];f.selectElements(C)}if(m&&s.code==="KeyC"&&(s.preventDefault(),r=(O=f.activePage)===null||O===void 0?void 0:O.id,o(f.selectedElements.map(A=>A.toJSON()))),m&&s.code==="KeyX"&&(s.preventDefault(),r=(g=f.activePage)===null||g===void 0?void 0:g.id,o(f.selectedElements.map(A=>A.toJSON())),f.deleteElements(y)),m&&s.code==="KeyV"){s.preventDefault();let A=0;r===((b=f.activePage)===null||b===void 0?void 0:b.id)&&(A=f.width/20),r=(p=f.activePage)===null||p===void 0?void 0:p.id,f.history.transaction(()=>{const C=[],R=a();(0,e.forEveryChild)({children:R},S=>{delete S.id,S.type!=="group"&&(S.x+=A,S.y+=A)}),R.forEach(S=>{var E;const P=(E=f.activePage)===null||E===void 0?void 0:E.addElement(S);P&&C.push(P.id)}),o(R),f.selectElements(C)})}s.code==="ArrowDown"&&(s.preventDefault(),f.selectedElements.forEach(A=>{A.draggable&&A.set({y:A.y+1})})),s.code==="ArrowUp"&&(s.preventDefault(),f.selectedElements.forEach(A=>{A.draggable&&A.set({y:A.y-1})})),s.code==="ArrowLeft"&&(s.preventDefault(),f.selectedElements.forEach(A=>{A.draggable&&A.set({x:A.x-1})})),s.code==="ArrowRight"&&(s.preventDefault(),f.selectedElements.forEach(A=>{A.draggable&&A.set({x:A.x+1})}))}})(mS);var MS={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.t=t.getTranslations=t.setTranslations=void 0;const e=Qi,n=(0,e.observable)({toolbar:{duration:"Duration",opacity:"Opacity",effects:"Effects",blur:"Blur",textBackground:"Background",backgroundCornerRadius:"Corner radius",backgroundOpacity:"Opacity",backgroundPadding:"Padding",brightness:"Brightness",sepia:"Sepia",grayscale:"Grayscale",textStroke:"Text Stroke",shadow:"Shadow",border:"Border",cornerRadius:"Corner Radius",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",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"}},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:"Upload Image",uploadTip:"Do you want to upload your own images?",background:"Background",resize:"Resize",layers:"Layers",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"}});function r(h,x){var w,v=x.split("."),O=h;for(w=0;w<v.length;++w){if(O[v[w]]==null)return;O=O[v[w]]}return O}const i=h=>h&&typeof h=="object";function o(h,x){Object.keys(x).forEach(w=>{const v=h[w],O=x[w];i(O)&&i(v)?o(v,O):h[w]=O})}function a(h,x,w=""){Object.keys(x).forEach(v=>{const O=x[v],g=w?`${w}.${v}`:v;i(O)?i(h[v])?a(h[v],O,g):console.warn(`Missing nested translation object at '${g}'`):h[v]===void 0&&console.warn(`Missing translation '${g}'`)})}t.setTranslations=(0,e.action)((h,{validate:x=!1}={})=>{x&&a(h,n),o(n,h)});const l=()=>(0,e.toJS)(n);t.getTranslations=l;const s={},f=h=>{const x=r(n,h);if(x!==void 0)return x;s[h]||(s[h]=!0,console.warn(`Missing translation '${h}'`));const w=h.split("."),v=w[w.length-1]||" ";return v.charAt(0).toUpperCase()+v.slice(1)};t.t=f})(MS);(function(t){var e=_e&&_e.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceCanvas=void 0;const n=e(Qe),r=ti,i=e(n9),o=gS,a=vS,l=mS,s=MS,f=`Polotno warning: <Workspace /> component can not automatically detect its size.
|
|
300
|
+
`};async function R({json:S,elementHook:E}){const P=await _({json:S,elementHook:E});return C({dom:P})}})(PS);var Yg={},O_;function CS(){return O_||(O_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Page=void 0;const e=ni,n=t0,r=Lc(),i=x2(),o=Lc(),a=su;t.Page=e.types.model("Page",{id:e.types.identifier,children:e.types.array(e.types.late(()=>r.ElementTypes)),width:e.types.optional(e.types.union(e.types.number,e.types.literal("auto")),"auto"),height:e.types.optional(e.types.union(e.types.number,e.types.literal("auto")),"auto"),background:"white",bleed:0,custom:e.types.frozen(),duration:5e3,_exporting:!1,_rendering:!1,_forceMount:!1}).postProcessSnapshot(l=>{const s=Object.assign({},l),f={};for(var h in s)h[0]!=="_"&&(f[h]=l[h]);return f}).views(l=>({get store(){return(0,e.getParentOfType)(l,i.Store)}})).views(l=>({get startTime(){let s=0;for(const f of l.store.pages){if(f.id===l.id)return s;s+=f.duration}return s},get _exportingOrRendering(){return l._exporting||l._rendering}})).views(l=>({get computedWidth(){return l.width==="auto"?l.store.width:l.width},get computedHeight(){return l.height==="auto"?l.store.height:l.height}})).actions(l=>({toJSON:()=>JSON.parse(JSON.stringify((0,e.getSnapshot)(l))),_forEachElementUp(s,f){const h=s.map(x=>({id:x,index:l.children.findIndex(w=>w.id===x)}));h.sort((x,w)=>w.index-x.index);for(const{index:x}of h){if(x==-1)continue;const w=x<l.children.length-1&&l.children[x+1],v=s.indexOf(w==null?void 0:w.id)>=0;x===l.children.length-1||v||f(x)}},_forEachElementDown(s,f){const h=s.map(x=>({id:x,index:l.children.findIndex(w=>w.id===x)}));h.sort((x,w)=>x.index-w.index);for(const{index:x}of h){if(x==-1)continue;const w=x>0&&l.children[x-1],v=s.indexOf(w==null?void 0:w.id)>=0;x===0||v||f(x)}return!1}})).actions(l=>({clone(s={}){const f=l.toJSON();f.children.forEach(v=>{v.id=(0,n.nanoid)(10),(0,o.forEveryChild)(v,O=>{O.id=(0,n.nanoid)(10)})});const h=Object.assign(Object.assign(Object.assign({},f),{id:(0,n.nanoid)(10)}),s),x=l.store.addPage(h),w=l.store.pages.indexOf(l);x.setZIndex(w+1),x.select()},setZIndex(s){l.store.setPageZIndex(l.id,s)},set(s){Object.assign(l,s)},select(){l.store.selectPage(l.id)},addElement(s,{skipSelect:f=!1}={}){const h=o.TYPES_MAP[s.type];if(!h)return void console.error("Can not find model with type "+s.type);"children"in s&&Array.isArray(s.children)&&s.children.forEach(w=>{w.id=(0,n.nanoid)(10)});const x=h.create(Object.assign({id:(0,n.nanoid)(10)},s));return l.children.push(x),x.selectable&&!f&&l.store.selectElements([x.id]),x},canMoveElementsUp(s){let f=!1;return l._forEachElementUp(s,()=>{f=f||!0}),f},moveElementsUp(s){l._forEachElementUp(s,f=>{const h=l.children[f];(0,e.detach)(h),l.children.splice(f+1,0,h)})},canMoveElementsTop(s){return this.canMoveElementsUp(s)},moveElementsTop(s){const f=[],h=[];l.children.forEach(x=>{s.indexOf(x.id)>=0?f.push(x):h.push(x)}),l.children.replace(h.concat(f))},canMoveElementsDown(s){let f=!1;return l._forEachElementDown(s,()=>{f=f||!0}),f},moveElementsDown(s){l._forEachElementDown(s,f=>{const h=l.children[f];(0,e.detach)(h),l.children.splice(f-1,0,h)})},canMoveElementsBottom(s){return this.canMoveElementsDown(s)},moveElementsBottom(s){const f=[],h=[];l.children.forEach(x=>{s.indexOf(x.id)>=0?f.push(x):h.push(x)}),l.children.replace(f.concat(h))},setElementZIndex(s,f){const h=l.children.find(x=>x.id===s);h&&((0,e.detach)(h),l.children.remove(h),l.children.splice(f,0,h))},setSize({width:s,height:f,useMagic:h,softChange:x}){if(h){const w=[],v=N=>N.type==="image"&&N.x<1&&N.y<1&&N.width>=l.computedWidth-2&&N.height>=l.computedHeight-2;(0,o.forEveryChild)(l,N=>{N.type!=="group"&&(v(N)||w.push(N))});const O=w.length?(0,a.getTotalClientRect)(w):{x:0,y:0,width:l.computedWidth,height:l.computedHeight},g=1/4,b=Math.max(0,Math.min(O.x,l.computedWidth-O.x-O.width)),p=l.computedWidth*g,y=Math.max(0,b-p),d=Math.max(0,Math.min(O.y,l.computedHeight-O.y-O.height)),m=l.computedHeight*g,_=Math.max(0,d-m),A=l.computedWidth-2*y,C=l.computedHeight-2*_,R=s/A,S=f/C,E=Math.min(R,S),P=(s-A*E)/2-y*E,T=(f-C*E)/2-_*E;(0,o.forEveryChild)(l,N=>{N.type!=="group"&&(v(N)?N.set({x:N.x*E,y:N.y*E,width:N.width*R,height:N.height*S,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(N.set({x:P+N.x*E,y:T+N.y*E,width:N.width*E,height:N.height*E}),N.type==="text"?N.set({fontSize:N.fontSize*E}):N.type==="figure"&&N.set({strokeWidth:N.strokeWidth*E})))})}x||(l.width=s),x||(l.height=f)}})).actions(l=>({moveElementUp(s){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),l.moveElementsUp([s])},moveElementDown(s){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),l.moveElementsDown([s])},moveElementTop(s){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),l.moveElementsTop([s])},moveElementBottom(s){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),l.moveElementsBottom([s])},play(){l.store.play({startTime:l.startTime,endTime:l.startTime+l.duration})}}))}(Yg)),Yg}var kS={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Audio=void 0;const e=ni;t.Audio=e.types.model("Audio",{id:e.types.identifier,src:"",duration:0,startTime:0,endTime:1,volume:1,delay:0}).actions(n=>({toJSON:()=>Object.assign({},(0,e.getSnapshot)(n))})).actions(n=>({set(r){Object.assign(n,r)}}))})(kS);var x_;function x2(){return x_||(x_=1,function(t){var e=_e&&_e.__createBinding||(Object.create?function(S,E,P,T){T===void 0&&(T=P);var N=Object.getOwnPropertyDescriptor(E,P);N&&!("get"in N?!E.__esModule:N.writable||N.configurable)||(N={enumerable:!0,get:function(){return E[P]}}),Object.defineProperty(S,T,N)}:function(S,E,P,T){T===void 0&&(T=P),S[T]=E[P]}),n=_e&&_e.__setModuleDefault||(Object.create?function(S,E){Object.defineProperty(S,"default",{enumerable:!0,value:E})}:function(S,E){S.default=E}),r=_e&&_e.__importStar||function(S){if(S&&S.__esModule)return S;var E={};if(S!=null)for(var P in S)P!=="default"&&Object.prototype.hasOwnProperty.call(S,P)&&e(E,S,P);return n(E,S),E},i=_e&&_e.__rest||function(S,E){var P={};for(var T in S)Object.prototype.hasOwnProperty.call(S,T)&&E.indexOf(T)<0&&(P[T]=S[T]);if(S!=null&&typeof Object.getOwnPropertySymbols=="function"){var N=0;for(T=Object.getOwnPropertySymbols(S);N<T.length;N++)E.indexOf(T[N])<0&&Object.prototype.propertyIsEnumerable.call(S,T[N])&&(P[T[N]]=S[T[N]])}return P},o=_e&&_e.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(t,"__esModule",{value:!0}),t.Store=t.Font=void 0,t.createStore=R;const a=ni,l=_S,s=t0,f=o(ki),h=wS,x=SS,w=ES,v=E2(),O=r(iu),g=Yi,b=e0,p=O2,y=OS,d=xS,m=PS,_=CS(),A=Lc(),C=kS;function R({key:S,showCredit:E}={key:"",showCredit:!1}){return t.Store.create({_forceShowCredit:E,_key:S})}(0,a.setLivelinessChecking)("ignore"),t.Font=a.types.model("Font",{fontFamily:a.types.string,url:a.types.optional(a.types.string,""),styles:a.types.frozen()}).preProcessSnapshot(S=>Object.assign(Object.assign({},S),{fontFamily:S.fontFamily||S.name})),t.Store=a.types.model("Store",{role:"",pages:a.types.array(_.Page),fonts:a.types.array(t.Font),audios:a.types.array(C.Audio),width:1080,height:1080,currentTime:0,isPlaying:!1,scale:1,scaleToFit:1,unit:"px",dpi:72,bleedVisible:!1,rulesVisible:!1,openedSidePanel:"",previousOpenedSidePanel:"",custom:a.types.frozen(),selectedElementsIds:a.types.array(a.types.string),animatedElementsIds:a.types.array(a.types.string),history:a.types.optional(l.UndoManager,{targetPath:"../pages"}),_elementsPixelRatio:Math.min(2,window.devicePixelRatio||1),_activePageId:"",_forceShowCredit:!1,_key:"",_validated:!1}).views(S=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),S.bleedVisible},get selectedElements(){return S.selectedElementsIds.map(E=>{for(const P of S.pages)for(const T of P.children)if(T.id===E)return T}).filter(E=>!!E)},get children(){return S.pages},get selectedShapes(){const E=[];return(0,A.forEveryChild)({children:S.selectedElements},P=>{P.type!=="group"&&E.push(P)}),E},get activePage(){return S.pages.slice().find(E=>E.id===S._activePageId)||(S.pages.length?S.pages[0]:null)},get duration(){let E=0;return S.pages.forEach(P=>{E+=P.duration}),E},get _hasCroppedImages(){return S.find(E=>E.type==="image"&&E._cropModeEnabled)},find(E){let P;return(0,A.forEveryChild)({children:S.pages},T=>{if(!P&&E(T))return P=T,!0}),P},getElementById:E=>S.find(P=>P.id===E)})).actions(S=>{let E=0,P=null,T=!1;return{afterCreate(){S.history.canUndo},setCurrentTime(N){S.currentTime=N},_togglePlaying(N=!S.isPlaying){S.isPlaying=N},play({animatedElementsIds:N=[],startTime:U=0,currentTime:G=0,endTime:Z=S.duration,repeat:W=!1}={}){G&&(console.warn("currentTime property of store.play() is deprecated. Please use startTime instead."),U=G),S.animatedElementsIds=(0,a.cast)(N),S.currentTime=U,S.isPlaying=!0,E=Date.now(),P=Z,T=W,requestAnimationFrame(S.seek)},checkActivePage(){let N=0;for(const U of S.pages){if(S.currentTime>=U.startTime&&S.currentTime<U.startTime+U.duration){S.selectPage(U.id);break}N+=U.duration}},seek(){if(!S.isPlaying)return;const N=Date.now(),U=N-E;E=N,S.currentTime+=U,S.checkActivePage();const G=P||S.duration;S.isPlaying&&S.currentTime<G?requestAnimationFrame(S.seek):S.isPlaying&&T?(S.currentTime=0,requestAnimationFrame(S.seek)):S.stop()},stop(){S.isPlaying=!1,S.currentTime=0,S.animatedElementsIds=(0,a.cast)([]),S.checkActivePage()}}}).actions(S=>({__(){S._validated||((0,v.validateKey)(S._key,S._forceShowCredit),S._validated=!0)},set(E){Object.assign(S,E)},setUnit({unit:E,dpi:P}){S.unit=E||S.unit,S.dpi=P||S.dpi},setRole(E){S.role=E},addPage(E){const P=_.Page.create(Object.assign({id:(0,s.nanoid)(10)},E));return S.pages.push(P),S._activePageId=P.id,P},selectPage(E){S._activePageId=E},selectElements(E){const P=E.map(T=>S.getElementById(T)).sort((T,N)=>T.page.children.indexOf(T)-T.page.children.indexOf(N)).filter(T=>!!T).map(T=>T.id);S.selectedElementsIds=(0,a.cast)(P)},toggleBleed(E){S.bleedVisible=E??!S.bleedVisible},toggleRulers(E){S.rulesVisible=E??!S.rulesVisible},openSidePanel(E){S.openedSidePanel!==E&&(S.previousOpenedSidePanel=S.openedSidePanel,S.openedSidePanel=E)},setScale(E){S.scale=E},_setScaleToFit(E){S.scaleToFit=E},setElementsPixelRatio(E){S._elementsPixelRatio=E},setSize(E,P,T){S.pages.forEach(N=>{N.setSize({width:E,height:P,useMagic:T,softChange:!0})}),S.width=E,S.height=P},setPageZIndex(E,P){const T=S.pages.find(N=>N.id===E);T&&((0,a.detach)(T),S.pages.remove(T),S.pages.splice(P,0,T))},deletePages(E){const P=S.pages.indexOf(S.activePage);E.forEach(U=>{const G=S.pages.find(Z=>Z.id===U);(0,a.destroy)(G)});const T=Math.min(S.pages.length-1,P),N=S.pages[T];N&&(S._activePageId=N.id),S.selectedElementsIds=(0,a.cast)(S.selectedElementsIds.filter(U=>S.getElementById(U)))},groupElements(E){const P=E.map(U=>S.getElementById(U));P.forEach(U=>{U&&(0,a.detach)(U)});const T=S.activePage,N={id:(0,s.nanoid)(10),children:P,type:"group"};return T.children.push(N),S.selectedElementsIds=(0,a.cast)([N.id]),T.children.find(U=>U.id===N.id)},ungroupElements(E){const P=E.map(N=>S.getElementById(N)),T=[];P.forEach(N=>{if(N&&N.type==="group"){const U=N.page,G=U.children.indexOf(N);N.children.forEach(Z=>{T.push(Z.id)}),N.children.forEach(Z=>{(0,a.detach)(Z),U.children.push(Z)}),U.children.splice(G,1)}}),S.selectedElementsIds=(0,a.cast)(T)},deleteElements(E){const P=[];S.find(T=>(E.includes(T.id)&&P.push(T),!1)),P.forEach(T=>{(0,a.destroy)(T)}),S.selectedElementsIds=(0,a.cast)(S.selectedElementsIds.filter(T=>S.getElementById(T)))},on(E,P){if(E==="change"){let T=S.toJSON();return(0,a.onSnapshot)(S,N=>{const U=S.toJSON();!(0,p.deepEqual)(T,U)&&(T=U,P(U))})}},async _toCanvas({pixelRatio:E,ignoreBackground:P,pageId:T,mimeType:N,includeBleed:U,_skipTimeout:G,quickMode:Z=!1}={}){var W;const H=E||1;T=T||((W=S.pages[0])===null||W===void 0?void 0:W.id);const L=S.pages.find(me=>me.id===T);if(!L)throw new Error(`No page for export with id ${T}`);Z?L==null||L.set({_forceMount:!0}):L==null||L.set({_exporting:!0});const M=await(0,y.waitTillAvailable)(()=>f.default.stages.find(me=>me.getAttr("pageId")===T));if(!M)throw L==null||L.set({_forceMount:!1,_exporting:!1}),new Error(`Export is failed. Can not find stage for page ${T}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);const D=!!M.findOne(".page-container"),B=S._elementsPixelRatio;H>S._elementsPixelRatio&&S.setElementsPixelRatio(H),await S.waitLoading({_skipTimeout:G});const V=M.findOne(".page-container");if(!V)throw S.setElementsPixelRatio(B),L==null||L.set({_forceMount:!1,_exporting:!1}),new Error(`Export is failed. Can't find page container. ${D}`);M.find("Transformer").forEach(me=>me.visible(!1)),V.find(".page-background").forEach(me=>me.shadowEnabled(!1)),V.find(".page-background").forEach(me=>me.strokeEnabled(!1)),V.find(".highlighter").forEach(me=>me.visible(!1));const Y=V.findOne(".page-background-group"),F=Y.clip();Y.clip({x:null,y:null,width:null,height:null});const $=V.findOne(".elements-container"),z=$.clip();$.clip({x:null,y:null,width:null,height:null});const K=V.find(me=>me.getAttr("hideInExport"));K.forEach(me=>{me.setAttr("oldVisible",me.visible()),me.hide()});const X=V.find(me=>!me.visible()&&me.getAttr("editModeEnabled"));X.forEach(me=>{me.setAttr("oldVisible",me.visible()),me.show()}),P&&V.find(".page-background").forEach(me=>me.hide());const Q=U?L.bleed:0;let J=Q;!S.bleedVisible&&U||(S.bleedVisible||U?S.bleedVisible&&U?J=0:S.bleedVisible&&!U&&(J=-L.bleed):J=0);const ne=document.createElement("canvas");ne.width=Math.round((L.computedWidth+2*Q)*H),ne.height=Math.round((L.computedHeight+2*Q)*H);const ie=ne.getContext("2d");N==="image/jpeg"&&(ie.fillStyle="white",ie.fillRect(0,0,ne.width,ne.height));const oe=V.scale();V.scale({x:1,y:1});const de=V.toCanvas({x:V.x()-J,y:V.y()-J,width:L.computedWidth+2*Q,height:L.computedHeight+2*Q,pixelRatio:H});return V.scale(oe),ie.drawImage(de,0,0,ne.width,ne.height),f.default.Util.releaseCanvas(de),P&&V.find(".page-background").forEach(me=>me.show()),K.forEach(me=>{me.visible(me.getAttr("oldVisible"))}),X.forEach(me=>{me.visible(me.getAttr("oldVisible"))}),V.find(".page-background").forEach(me=>me.shadowEnabled(!0)),V.find(".page-background").forEach(me=>me.strokeEnabled(!0)),M.find("Transformer").forEach(me=>me.visible(!0)),V.find(".highlighter").forEach(me=>me.visible(!0)),Y.clip(F),$.clip(z),S.setElementsPixelRatio(B),L==null||L.set({_exporting:!1,_forceMount:!1}),ne},async toDataURL(E={}){var{mimeType:P,quality:T}=E,N=i(E,["mimeType","quality"]);const U=await S._toCanvas(Object.assign({mimeType:P},N)),G=U.toDataURL(P,T);return f.default.Util.releaseCanvas(U),G},async toBlob(E={}){var{mimeType:P,quality:T}=E,N=i(E,["mimeType","quality"]);const U=await S._toCanvas(Object.assign({mimeType:P},N)),G=await new Promise(Z=>{U.toBlob(Z,P,T)});return f.default.Util.releaseCanvas(U),G},async saveAsImage(E={}){var{fileName:P}=E,T=i(E,["fileName"]);const N=T.mimeType||"image/png",U=N.split("/")[1];(0,h.downloadFile)(await S.toDataURL(T),P||"polotno."+U,N)},async _toPDF(E){const P=E.dpi||S.dpi,T=E.parallel||1,N=E.unit||(S.unit==="px"?"mm":S.unit),U=E.pixelRatio||1,G=E.pageIds||S.pages.map(K=>K.id),Z=S.pages.filter(K=>G.includes(K.id)),W=await(0,x.getJsPDF)(),H=K=>(0,b.pxToUnit)({px:K,unit:N,dpi:P}),L=E.cropMarkSize||0,M=H(L),D=Z[0]||{},B=E.includeBleed?D.bleed:0,V=H(D.computedWidth+2*B+2*M),Y=H(D.computedHeight+2*B+2*M);var F=new W({unit:N,orientation:V>Y?"landscape":"portrait",format:[V,Y],compress:!0,putOnlyUsedFonts:!0});F.deletePage(1);const $=((K,X)=>{for(var Q=[],J=0;J<K.length;J+=X)Q.push(K.slice(J,J+X));return Q})(Z,T);let z=0;for(const K of $){const X=K.map(async Q=>{const J=E.includeBleed?Q.bleed:0,ne=Q.computedWidth+2*J+2*L,ie=Q.computedHeight+2*J+2*L,oe=H(ne),de=H(ie);let me=0,Pe=U;for(;me<10;){me+=1,me===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const re=await S.toDataURL(Object.assign(Object.assign({},E),{pageId:Q.id,pixelRatio:Pe}));if(re.length>20)return E.onProgress&&E.onProgress(++z/G.length*.9),{url:re,width:oe,height:de,widthPx:ne,heightPx:ie};Pe*=.8}});(await Promise.all(X)).forEach(({url:Q,width:J,height:ne,widthPx:ie,heightPx:oe})=>{F.addPage([J,ne],J>ne?"landscape":"portrait");const de=F.getCurrentPageInfo();de.pageContext.cropBox={bottomLeftX:0,bottomLeftY:0,topRightX:ie,topRightY:oe},de.pageContext.bleedBox={bottomLeftX:L+B,bottomLeftY:L+B,topRightX:ie-L-B,topRightY:oe-L-B},M&&(F.setLineWidth(H(1)),F.line(2*M,0,2*M,M),F.line(0,2*M,M,2*M),F.line(J-2*M,0,J-2*M,M),F.line(J,2*M,J-M,2*M),F.line(0,ne-2*M,M,ne-2*M),F.line(2*M,ne,2*M,ne-M),F.line(J,ne-2*M,J-M,ne-2*M),F.line(J-2*M,ne,J-2*M,ne-M)),F.addImage(Q,M,M,J-2*M,ne-2*M,void 0,"FAST")})}return F},toPDFDataURL:async E=>(await S._toPDF(Object.assign({mimeType:"image/jpeg"},E))).output("datauristring"),async toGIFDataURL(E={}){const P=E.pixelRatio||1,T=await(0,w.createGIF)({width:S.width*P,height:S.height*P}),N=1e3/(E.fps||10),U=S.duration/N;for(let G=0;G<U-1;G++){const Z=G*N||1;S.setCurrentTime(Z);let W=0,H="";for(const M of S.pages)if(W+=M.duration,M.set({_rendering:W>Z}),W>Z){H=M.id;break}const L=await S._toCanvas({pixelRatio:P,pageId:H,_skipTimeout:!0});T.addFrame(L.getContext("2d"),{delay:N,copy:!0})}for(const G of S.pages)G.set({_rendering:!1});return S.stop(),T.render(),new Promise(G=>{T.on("finished",function(Z){(function(W,H){var L=new FileReader;L.onload=function(M){H(M.target.result)},L.readAsDataURL(W)})(Z,G)})})},async saveAsGIF(E={}){var{fileName:P}=E,T=i(E,["fileName"]);const N=await S.toGIFDataURL(T);(0,h.downloadFile)(N,P||"polotno.gif")},async toHTML({elementHook:E}={elementHook:void 0}){const P=S.toJSON();return(0,d.jsonToHTML)({json:P,elementHook:E})},async saveAsHTML({fileName:E}={}){const P=await S.toHTML(),T="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(P)));(0,h.downloadFile)(T,E||"polotno.html")},async toSVG({elementHook:E,pageId:P}={elementHook:void 0,pageId:void 0}){var T;const N=S.toJSON();P=P||((T=N.pages[0])===null||T===void 0?void 0:T.id);const U=N.pages.find(G=>G.id===P);return(0,m.jsonToSVG)({json:Object.assign(Object.assign({},N),{pages:U?[U]:[]}),elementHook:E})},async saveAsSVG({fileName:E,elementHook:P,pageId:T}={}){const N=await S.toSVG({elementHook:P,pageId:T}),U="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(N)));(0,h.downloadFile)(U,E||"polotno.svg")},async saveAsPDF(E={}){var{fileName:P}=E,T=i(E,["fileName"]);(await S._toPDF(Object.assign({mimeType:"image/jpeg"},T))).save(P||"polotno.pdf")},async waitLoading({_skipTimeout:E=!1}={}){E||await new Promise(P=>setTimeout(P,50)),await(0,g.whenLoaded)()},toJSON:()=>({width:S.width,height:S.height,fonts:(0,a.getSnapshot)(S.fonts),pages:(0,a.getSnapshot)(S.pages),audios:(0,a.getSnapshot)(S.audios),unit:S.unit,dpi:S.dpi,custom:S.custom}),loadJSON(E,P=!1){var T;const N=Object.assign({},E),U=S.pages.indexOf(S.activePage);let G=(T=N.pages[U]||N.pages[0])===null||T===void 0?void 0:T.id;N._activePageId=G;const Z=Object.assign({},(0,a.getSnapshot)(S));Object.assign(Z,N),Z.history=P?S.history.toJSON():{history:[],undoIdx:-1},(0,a.applySnapshot)(S,Z)},clear({keepHistory:E=!1}={}){const P=S.pages.map(T=>T.id);S.deletePages(P),E||S.history.clear()},addFont(E){S.removeFont(E.fontFamily),S.fonts.push(E),S.loadFont(E.fontFamily)},removeFont(E){S.fonts.filter(P=>P.fontFamily===E).forEach(P=>(0,a.destroy)(P))},addAudio(E){const P=C.Audio.create(Object.assign({id:(0,s.nanoid)(10)},E));S.audios.push(P)},removeAudio(E){const P=S.audios.find(T=>T.id===E);P&&S.audios.remove(P)},async loadFont(E){const P=S.fonts.find(N=>N.fontFamily===E)||O.globalFonts.find(N=>N.fontFamily===E);let T=[{fontStyle:"normal",fontWeight:"normal"}];return P?(P.styles&&(T=P.styles.map(N=>({fontStyle:N.fontStyle||"normal",fontWeight:N.fontWeight||"normal"}))),O.injectCustomFont(P)):O.injectGoogleFont(E),Promise.all(T.map(N=>O.loadFont(E,N.fontStyle,N.fontWeight)))},validate:E=>t.Store.validate(E,[{path:"",type:t.Store}]).map(P=>({path:"store"+P.context.map(T=>T.path).join("."),message:P.message}))})),t.default=R}(Wg)),Wg}var P_;function TS(){return P_||(P_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Node=void 0;const e=ni,n=t0,r=x2(),i=CS(),o=Lc();t.Node=e.types.model("Node",{id:e.types.identifier,type:"none",name:"",opacity:1,custom:e.types.frozen(),visible:!0,selectable:!0,removable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(a=>{for(var l in a)a[l]===null&&(a[l]=void 0);return a}).postProcessSnapshot(a=>{const l=Object.assign({},a),s={};for(var f in l)f[0]!=="_"&&(s[f]=a[f]);return s}).views(a=>({get locked(){return!(a.draggable||a.contentEditable||a.styleEditable||a.resizable)},get page(){return(0,e.getParentOfType)(a,i.Page)},get store(){return(0,e.getParentOfType)(a,r.Store)},get top(){let l=a;for(;;){if(!(0,e.hasParentOfType)(l,o.GroupElement))return l;l=(0,e.getParentOfType)(l,o.GroupElement)}},get parent(){return(0,e.hasParentOfType)(a,o.GroupElement)?(0,e.getParentOfType)(a,o.GroupElement):(0,e.hasParentOfType)(a,i.Page)?(0,e.getParentOfType)(a,i.Page):(0,e.hasParentOfType)(a,r.Store)?(0,e.getParentOfType)(a,r.Store):null},get zIndex(){return a.parent.children.indexOf(a)}})).actions(a=>({toJSON:()=>Object.assign({},(0,e.getSnapshot)(a))})).actions(a=>({clone(l={},{skipSelect:s=!1}={}){const f=JSON.parse(JSON.stringify(a.toJSON()));return l.id=l.id||(0,n.nanoid)(10),(0,o.forEveryChild)(f,h=>{h.id=(0,n.nanoid)(10)}),Object.assign(f,l),a.page.addElement(f,{skipSelect:s})},set(l){Object.assign(a,l)},moveUp(){a.page.moveElementsUp([a.id])},moveTop(){a.page.moveElementsTop([a.id])},moveDown(){a.page.moveElementsDown([a.id])},moveBottom(){a.page.moveElementsBottom([a.id])},setZIndex(l){a.parent.setElementZIndex(a.id,l)},beforeDestroy(){}}))}(qg)),qg}var Kg={},AS={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.registerAnimation=t.animate=t.animations=void 0;const e=su,n={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}}};t.animations={fade:({dTime:o,element:a,animation:l})=>{const s=o/l.duration;return l.type==="enter"?{opacity:s*a.opacity}:{opacity:(1-s)*a.opacity}},rotate:({dTime:o,element:a,animation:l})=>{const s=o/l.duration*360;return(0,e.rotateAroundCenter)({x:a.x,y:a.y,width:a.width,height:a.height,rotation:a.rotation},s)},blink:({dTime:o,element:a,animation:l})=>{const s=l.duration,f=o%s/(s/2),h=f<=1?f:2-f;return{opacity:a.opacity*h}},bounce:({dTime:o,element:a,animation:l})=>{const s=l.duration,f=s/2,h={},x={x:a.x+a.width/3,y:a.y+a.height/3,width:a.width/3,height:a.height/3,fontSize:a.fontSize/3},w={x:a.x,y:a.y,width:a.width,height:a.height,fontSize:a.fontSize},v=o%s/f,O=v<=1?v:2-v;for(let g in x){const b=x[g],p=w[g]-b;h[g]=b+O*p}return h},move:({dTime:o,element:a,animation:l})=>{const s=n[l.data.direction]||n.right,f={};for(var h in s.from){let x=s.from[h],w=s.to[h];l.type==="exit"&&(x=s.to[h],w=-s.from[h]);const v=a[h]+x,O=a[h]+w-v;f[h]=v+o/l.duration*O}return f},zoom:({dTime:o,element:a,animation:l})=>{const s={},f={x:a.x+a.width/3,y:a.y+a.height/3,width:a.width/3,height:a.height/3,fontSize:a.fontSize/3},h={x:a.x,y:a.y,width:a.width,height:a.height,fontSize:a.fontSize};for(var x in f){let w=f[x],v=h[x];if(l.type==="exit"){const g=w;w=v,v=g}const O=v-w;s[x]=w+o/l.duration*O}return s}};const r=({element:o,dTime:a,animation:l})=>{const s=t.animations[l.name];return s?s({element:o,dTime:a,animation:l}):(console.error("Can not find animation type: "+l.name),{})};t.animate=r;const i=(o,a)=>{};t.registerAnimation=i})(AS);var C_;function uu(){return C_||(C_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Shape=t.Animation=void 0;const e=ni,n=AS,r=Qi,i=TS();t.Animation=e.types.model("Animation",{delay:0,duration:500,enabled:!0,type:e.types.enumeration("Type",["enter","exit","loop"]),name:"none",data:e.types.frozen({})}),t.Shape=i.Node.named("Shape").props({x:0,y:0,width:100,height:100,rotation:0,opacity:1,animations:e.types.array(t.Animation),blurEnabled:!1,blurRadius:10,brightnessEnabled:!1,brightness:0,sepiaEnabled:!1,grayscaleEnabled:!1,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 a=Object.assign(Object.assign({},o),{x:o.x||0,y:o.y||0});return"width"in o&&(a.width=a.width||1),"height"in o&&(a.height=a.height||1),o.locked&&(a.draggable=!1,a.contentEditable=!1,a.styleEditable=!1,a.resizable=!1,a.removable=!1),a}).views(o=>{const a=(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}),l=(0,r.action)(s=>{Object.assign(a,s)});return{get a(){const{currentTime:s}=o.store;if(l({x:o.x,y:o.y,width:o.width,height:o.height,rotation:o.rotation,opacity:o.opacity,color:o.color,fontSize:o.fontSize}),s===0)return a;const f=s-o.page.startTime;if(f>o.page.duration||f<0)return a;const h=o.store.animatedElementsIds;if(h.length&&!h.includes(o.id))return a;const x=o.animations.find(O=>O.type==="enter");if(x!=null&&x.enabled&&f<x.delay&&l({opacity:0}),x!=null&&x.enabled&&f>=x.delay&&f<=x.delay+x.duration){const O=f-x.delay,g=(0,n.animate)({element:o,animation:x,dTime:O});l(g)}const w=o.animations.find(O=>O.type==="exit");if(w!=null&&w.enabled&&f>=o.page.duration-w.duration-w.delay&&f<=o.page.duration-w.delay){const O=f-(o.page.duration-w.duration-w.delay),g=(0,n.animate)({element:o,animation:w,dTime:O});l(g)}w!=null&&w.enabled&&f>=o.page.duration-w.delay&&l({opacity:0});const v=o.animations.find(O=>O.type==="loop");if(v!=null&&v.enabled){const O=f,g=(0,n.animate)({element:o,animation:v,dTime:O});l(g)}return a},animated:s=>o.a[s]}}).actions(o=>({setAnimation(a,l){const s=o.animations.find(f=>f.type===a);s?Object.assign(s,l):o.animations.push(Object.assign({type:a},l))}}))}(Kg)),Kg}var Xg={},k_;function vj(){return k_||(k_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TextElement=void 0;const e=ni,n=uu();t.TextElement=n.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:e.types.optional(e.types.union(e.types.number,e.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(i){r._editModeEnabled=i??!r._editModeEnabled,r._editModeEnabled?r.store.history.startTransaction():r.store.history.endTransaction()}}))}(Xg)),Xg}var Zg={},T_;function RS(){return T_||(T_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImageElement=void 0;const e=uu();t.ImageElement=e.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(n=>({toggleCropMode(r){n._cropModeEnabled=r??!n._cropModeEnabled,n._cropModeEnabled?n.store.history.startTransaction():n.store.history.endTransaction()},beforeDestroy(){n._cropModeEnabled&&n.store.history.endTransaction()}}))}(Zg)),Zg}var Qg={},A_;function mj(){return A_||(A_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.VideoElement=void 0;const e=RS();t.VideoElement=e.ImageElement.named("Video").props({type:"video",duration:0,startTime:0,endTime:1,volume:1})}(Qg)),Qg}var Jg={},R_;function yj(){return R_||(R_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LineElement=void 0;const e=ni,n=uu();t.LineElement=n.Shape.named("Line").props({type:"line",width:400,height:10,color:"black",dash:e.types.array(e.types.number),startHead:"",endHead:""}).actions(r=>({}))}(Jg)),Jg}var ev={},M_;function bj(){return M_||(M_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SVGElement=void 0;const e=ni,n=uu();t.SVGElement=n.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:e.types.map(e.types.string)}).preProcessSnapshot(r=>Object.assign(Object.assign({},r),{src:r.src||r.svgSource})).actions(r=>({replaceColor(i,o){r.colorsReplace.set(i,o)}}))}(ev)),ev}var tv={},L_;function _j(){return L_||(L_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FigureElement=void 0;const e=ni,n=uu();t.FigureElement=n.Shape.named("Figure").props({type:"figure",subType:"rect",fill:"rgb(0, 161, 255)",dash:e.types.array(e.types.number),strokeWidth:0,stroke:"rgba(98, 197, 255, 1)",cornerRadius:0})}(tv)),tv}var N_;function Lc(){return N_||(N_=1,function(t){var e=_e&&_e.__rest||function(b,p){var y={};for(var d in b)Object.prototype.hasOwnProperty.call(b,d)&&p.indexOf(d)<0&&(y[d]=b[d]);if(b!=null&&typeof Object.getOwnPropertySymbols=="function"){var m=0;for(d=Object.getOwnPropertySymbols(b);m<d.length;m++)p.indexOf(d[m])<0&&Object.prototype.propertyIsEnumerable.call(b,d[m])&&(y[d[m]]=b[d[m]])}return y};Object.defineProperty(t,"__esModule",{value:!0}),t.TYPES_MAP=t.GroupElement=t.ElementTypes=t.forEveryChild=void 0,t.registerShapeModel=g;const n=ni,r=t0,i=TS(),o=uu(),a=vj(),l=RS(),s=mj(),f=yj(),h=bj(),x=_j(),w=(b,p)=>{if(b.children)for(const y of b.children){if(p(y)===!0)break;(0,t.forEveryChild)(y,p)}};t.forEveryChild=w;const v=[...new Array(20)].map((b,p)=>n.types.late(()=>O[p]));t.ElementTypes=n.types.union({dispatcher:b=>{const p=t.TYPES_MAP[b.type];if(!p)throw new Error(`Unknown element type: "${b.type}"`);return p}},h.SVGElement,a.TextElement,l.ImageElement,f.LineElement,s.VideoElement,x.FigureElement,n.types.late(()=>t.GroupElement),...v),t.GroupElement=i.Node.named("Group").props({type:"group",children:n.types.array(t.ElementTypes)}).views(b=>({get draggable(){let p=!0;return(0,t.forEveryChild)(b,y=>{y.draggable||(p=!1)}),p},get resizable(){let p=!0;return(0,t.forEveryChild)(b,y=>{y.resizable||(p=!1)}),p},get contentEditable(){let p=!0;return(0,t.forEveryChild)(b,y=>{y.contentEditable||(p=!1)}),p},get styleEditable(){let p=!0;return(0,t.forEveryChild)(b,y=>{y.styleEditable||(p=!1)}),p},get locked(){let p=!0;return(0,t.forEveryChild)(b,y=>{y.locked||(p=!1)}),p}})).actions(b=>({set(p){var{draggable:y,contentEditable:d,styleEditable:m,resizable:_}=p,A=e(p,["draggable","contentEditable","styleEditable","resizable"]);y!==void 0&&(0,t.forEveryChild)(b,C=>{C.set({draggable:y})}),d!==void 0&&(0,t.forEveryChild)(b,C=>{C.set({contentEditable:d})}),m!==void 0&&(0,t.forEveryChild)(b,C=>{C.set({styleEditable:m})}),_!==void 0&&(0,t.forEveryChild)(b,C=>{C.set({resizable:_})}),Object.assign(b,A)},addElement(p,{skipSelect:y=!1}={}){const d=t.TYPES_MAP[p.type];if(!d)return void console.error("Can not find model with type "+p.type);p.children&&p.children.forEach(_=>{_.id=(0,r.nanoid)(10)});const m=d.create(Object.assign({id:(0,r.nanoid)(10)},p));return b.children.push(m),m.selectable&&!y&&b.store.selectElements([m.id]),m},setElementZIndex(p,y){const d=b.children.find(m=>m.id===p);d&&((0,n.detach)(d),b.children.remove(d),b.children.splice(y,0,d))}}));const O=[];function g(b,p){const y=b.type;if(!y)throw new Error('You must pass "type" attribute to custom model.');let d=o.Shape.named(y).props(b);p&&(d=p(d)),t.TYPES_MAP[y]=d,O.push(d)}t.TYPES_MAP={svg:h.SVGElement,text:a.TextElement,image:l.ImageElement,group:t.GroupElement,line:f.LineElement,video:s.VideoElement,figure:x.FigureElement}}(Vg)),Vg}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.handleHotkey=l;const e=Lc();let n=[],r="";const i="polotno_clipboard",o=s=>{n=JSON.parse(JSON.stringify(s));try{localStorage.setItem(i,JSON.stringify(s))}catch{}},a=()=>{try{const s=localStorage.getItem(i);if(s)return JSON.parse(s)}catch{}return n};function l(s,f){var h,x,w,v,O,g,b,p;if(((h=document.activeElement)===null||h===void 0?void 0:h.tagName)==="INPUT"||((x=document.activeElement)===null||x===void 0?void 0:x.tagName)==="TEXTAREA"||((w=document.activeElement)===null||w===void 0?void 0:w.contentEditable)==="true")return;const y=f.selectedElements.filter(A=>A.removable),d=y.map(A=>A.id);s.keyCode!==46&&s.keyCode!==8||f.deleteElements(d);const m=s.ctrlKey||s.metaKey,_=s.shiftKey;if(m&&!_&&s.code==="KeyZ"&&(s.preventDefault(),f.history.undo()),m&&_&&s.code==="KeyZ"&&(s.preventDefault(),f.history.redo()),m&&s.code==="KeyA"){s.preventDefault();const A=(v=f.activePage)===null||v===void 0?void 0:v.children.filter(R=>R.selectable),C=(A==null?void 0:A.map(R=>R.id))||[];f.selectElements(C)}if(m&&s.code==="KeyC"&&(s.preventDefault(),r=(O=f.activePage)===null||O===void 0?void 0:O.id,o(f.selectedElements.map(A=>A.toJSON()))),m&&s.code==="KeyX"&&(s.preventDefault(),r=(g=f.activePage)===null||g===void 0?void 0:g.id,o(f.selectedElements.map(A=>A.toJSON())),f.deleteElements(y)),m&&s.code==="KeyV"){s.preventDefault();let A=0;r===((b=f.activePage)===null||b===void 0?void 0:b.id)&&(A=f.width/20),r=(p=f.activePage)===null||p===void 0?void 0:p.id,f.history.transaction(()=>{const C=[],R=a();(0,e.forEveryChild)({children:R},S=>{delete S.id,S.type!=="group"&&(S.x+=A,S.y+=A)}),R.forEach(S=>{var E;const P=(E=f.activePage)===null||E===void 0?void 0:E.addElement(S);P&&C.push(P.id)}),o(R),f.selectElements(C)})}s.code==="ArrowDown"&&(s.preventDefault(),f.selectedElements.forEach(A=>{A.draggable&&A.set({y:A.y+1})})),s.code==="ArrowUp"&&(s.preventDefault(),f.selectedElements.forEach(A=>{A.draggable&&A.set({y:A.y-1})})),s.code==="ArrowLeft"&&(s.preventDefault(),f.selectedElements.forEach(A=>{A.draggable&&A.set({x:A.x-1})})),s.code==="ArrowRight"&&(s.preventDefault(),f.selectedElements.forEach(A=>{A.draggable&&A.set({x:A.x+1})}))}})(mS);var MS={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.t=t.getTranslations=t.setTranslations=void 0;const e=Qi,n=(0,e.observable)({toolbar:{duration:"Duration",opacity:"Opacity",effects:"Effects",blur:"Blur",textBackground:"Background",backgroundCornerRadius:"Corner radius",backgroundOpacity:"Opacity",backgroundPadding:"Padding",brightness:"Brightness",sepia:"Sepia",grayscale:"Grayscale",textStroke:"Text Stroke",shadow:"Shadow",border:"Border",cornerRadius:"Corner Radius",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",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",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:"Upload Image",uploadTip:"Do you want to upload your own images?",background:"Background",resize:"Resize",layers:"Layers",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"}});function r(h,x){var w,v=x.split("."),O=h;for(w=0;w<v.length;++w){if(O[v[w]]==null)return;O=O[v[w]]}return O}const i=h=>h&&typeof h=="object";function o(h,x){Object.keys(x).forEach(w=>{const v=h[w],O=x[w];i(O)&&i(v)?o(v,O):h[w]=O})}function a(h,x,w=""){Object.keys(x).forEach(v=>{const O=x[v],g=w?`${w}.${v}`:v;i(O)?i(h[v])?a(h[v],O,g):console.warn(`Missing nested translation object at '${g}'`):h[v]===void 0&&console.warn(`Missing translation '${g}'`)})}t.setTranslations=(0,e.action)((h,{validate:x=!1}={})=>{x&&a(h,n),o(n,h)});const l=()=>(0,e.toJS)(n);t.getTranslations=l;const s={},f=h=>{const x=r(n,h);if(x!==void 0)return x;s[h]||(s[h]=!0,console.warn(`Missing translation '${h}'`));const w=h.split("."),v=w[w.length-1]||" ";return v.charAt(0).toUpperCase()+v.slice(1)};t.t=f})(MS);(function(t){var e=_e&&_e.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceCanvas=void 0;const n=e(Qe),r=ti,i=e(n9),o=gS,a=vS,l=mS,s=MS,f=`Polotno warning: <Workspace /> component can not automatically detect its size.
|
|
301
301
|
Width or height of parent elements is equal 0.
|
|
302
302
|
Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
|
|
303
|
-
For simpler debugging here is the log of the parent element:`,h=(g,b,p,y,d,m)=>{const _=n.default.useRef({width:b,height:p}),A=n.default.useRef({top:0,left:0}),C=n.default.useRef(!1),R=n.default.useRef(d.pages.length);C.current=R.current!==d.pages.length,R.current=d.pages.length,n.default.useEffect(()=>{const S=g.current,E=P=>{A.current={top:S.scrollTop,left:S.scrollLeft}};return S.addEventListener("scroll",E),()=>{S.removeEventListener("scroll",E)}},[]),n.default.useLayoutEffect(()=>{if(!g.current||C.current)return;const S=g.current,E=(A.current.left+S.offsetWidth/2)/_.current.width,P=(A.current.top+S.offsetHeight/2)/_.current.height;m.current=!0,S.scrollLeft=E*b-S.offsetWidth/2,S.scrollTop=P*p-S.offsetHeight/2,_.current={width:b,height:p}},[y,b,p])},x=({element:g,scrollTop:b=0,duration:p=300,onFinish:y=()=>{}})=>{const d=g.scrollTop,m=b-d;let _=0,A=!1;if(p===0)return g.scrollTop=b,()=>{};const C=()=>{if(A)return;_+=20;const S=R(_,d,m,p);g.scrollTop=S,_<p?setTimeout(C,20):y()},R=(S,E,P,T)=>(S/=T/2)<1?P/2*S*S+E:-P/2*(--S*(S-2)-1)+E;return C(),()=>{A=!0}},w=(g,b,p,y,d,m)=>{const _=n.default.useRef(!1),A=n.default.useRef(null),C=n.default.useRef(!1);n.default.useEffect(()=>{const S=g.current,E=()=>{d.current};return S.addEventListener("scroll",E),()=>{S.removeEventListener("scroll",E)}},[]);const R=p.pages.indexOf(p.activePage);return n.default.useLayoutEffect(()=>{if(!p.activePage||!g.current||_.current)return;const S=g.current,E=p.pages.indexOf(p.activePage)*b;let P=()=>{};return(Math.abs(E-S.scrollTop)>.5*b||C.current)&&(C.current=!0,P=x({element:S,scrollTop:E,onFinish:()=>{C.current=!1},duration:p.isPlaying?0:300})),P},[p.activePage,R,p.isPlaying]),{handleScroll:S=>{if(m||C.current)return;_.current=!0,clearTimeout(A.current),A.current=setTimeout(()=>{_.current=!1},300);const E=S.currentTarget.childNodes[0].offsetHeight,P=S.currentTarget.scrollTop,T=Math.floor((P+y.height/3)/E),N=p.pages[T];N&&p.activePage!==N&&N.select()}}},v=({store:g})=>n.default.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},n.default.createElement("p",null,(0,s.t)("workspace.noPages")),n.default.createElement("button",{onClick:()=>{g.addPage()}},(0,s.t)("workspace.addPage"))),O=({width:g,height:b,xPadding:p,yPadding:y,backgroundColor:d})=>n.default.createElement("div",{style:{width:g+"px",height:b+"px",backgroundColor:d,paddingLeft:p+"px",paddingRight:p+"px",paddingTop:y+"px",paddingBottom:y+"px"}},n.default.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}}));t.WorkspaceCanvas=(0,r.observer)(({store:g,pageControlsEnabled:b,backgroundColor:p,pageBorderColor:y,activePageBorderColor:d,bleedColor:m,components:_,onKeyDown:A,paddingX:C,paddingY:R,altCloneEnabled:S=!0,visiblePagesOffset:E,renderOnlyActivePage:P})=>{var T;const N=C??20,U=R??55,[G,Z]=n.default.useState({width:100,height:100}),W=n.default.useRef(G),H=n.default.useRef(null),L=n.default.useRef(null),M=g.bleedVisible?Math.max(0,...g.pages.map(re=>re.bleed)):0,D=Math.max(...g.pages.map(re=>re.computedWidth)),B=Math.max(...g.pages.map(re=>re.computedHeight)),V=((T=g.activePage)===null||T===void 0?void 0:T.computedHeight)||0,Y=D+2*M,F=(P?V:B)+2*M,$=async({skipTimeout:re}={skipTimeout:!1})=>{if(re||await new Promise(Ve=>setTimeout(Ve,50)),H.current===null)return;const ae=H.current.getBoundingClientRect();ae.width!==0&&ae.height!==0||(console.warn(f),console.log(H.current));const we=L.current.clientWidth||ae.width,be={width:we,height:ae.height};(W.current.width!==be.width||W.current.height!==be.height)&&(Z(be),W.current=be);const te=(we-2*N)/Y,fe=g.pages.length>1?3.1:2,
|
|
303
|
+
For simpler debugging here is the log of the parent element:`,h=(g,b,p,y,d,m)=>{const _=n.default.useRef({width:b,height:p}),A=n.default.useRef({top:0,left:0}),C=n.default.useRef(!1),R=n.default.useRef(d.pages.length);C.current=R.current!==d.pages.length,R.current=d.pages.length,n.default.useEffect(()=>{const S=g.current,E=P=>{A.current={top:S.scrollTop,left:S.scrollLeft}};return S.addEventListener("scroll",E),()=>{S.removeEventListener("scroll",E)}},[]),n.default.useLayoutEffect(()=>{if(!g.current||C.current)return;const S=g.current,E=(A.current.left+S.offsetWidth/2)/_.current.width,P=(A.current.top+S.offsetHeight/2)/_.current.height;m.current=!0,S.scrollLeft=E*b-S.offsetWidth/2,S.scrollTop=P*p-S.offsetHeight/2,_.current={width:b,height:p}},[y,b,p])},x=({element:g,scrollTop:b=0,duration:p=300,onFinish:y=()=>{}})=>{const d=g.scrollTop,m=b-d;let _=0,A=!1;if(p===0)return g.scrollTop=b,()=>{};const C=()=>{if(A)return;_+=20;const S=R(_,d,m,p);g.scrollTop=S,_<p?setTimeout(C,20):y()},R=(S,E,P,T)=>(S/=T/2)<1?P/2*S*S+E:-P/2*(--S*(S-2)-1)+E;return C(),()=>{A=!0}},w=(g,b,p,y,d,m)=>{const _=n.default.useRef(!1),A=n.default.useRef(null),C=n.default.useRef(!1);n.default.useEffect(()=>{const S=g.current,E=()=>{d.current};return S.addEventListener("scroll",E),()=>{S.removeEventListener("scroll",E)}},[]);const R=p.pages.indexOf(p.activePage);return n.default.useLayoutEffect(()=>{if(!p.activePage||!g.current||_.current)return;const S=g.current,E=p.pages.indexOf(p.activePage)*b;let P=()=>{};return(Math.abs(E-S.scrollTop)>.5*b||C.current)&&(C.current=!0,P=x({element:S,scrollTop:E,onFinish:()=>{C.current=!1},duration:p.isPlaying?0:300})),P},[p.activePage,R,p.isPlaying]),{handleScroll:S=>{if(m||C.current)return;_.current=!0,clearTimeout(A.current),A.current=setTimeout(()=>{_.current=!1},300);const E=S.currentTarget.childNodes[0].offsetHeight,P=S.currentTarget.scrollTop,T=Math.floor((P+y.height/3)/E),N=p.pages[T];N&&p.activePage!==N&&N.select()}}},v=({store:g})=>n.default.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},n.default.createElement("p",null,(0,s.t)("workspace.noPages")),n.default.createElement("button",{onClick:()=>{g.addPage()}},(0,s.t)("workspace.addPage"))),O=({width:g,height:b,xPadding:p,yPadding:y,backgroundColor:d})=>n.default.createElement("div",{style:{width:g+"px",height:b+"px",backgroundColor:d,paddingLeft:p+"px",paddingRight:p+"px",paddingTop:y+"px",paddingBottom:y+"px"}},n.default.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}}));t.WorkspaceCanvas=(0,r.observer)(({store:g,pageControlsEnabled:b,backgroundColor:p,pageBorderColor:y,activePageBorderColor:d,bleedColor:m,components:_,onKeyDown:A,paddingX:C,paddingY:R,altCloneEnabled:S=!0,visiblePagesOffset:E,renderOnlyActivePage:P})=>{var T;const N=C??20,U=R??55,[G,Z]=n.default.useState({width:100,height:100}),W=n.default.useRef(G),H=n.default.useRef(null),L=n.default.useRef(null),M=g.bleedVisible?Math.max(0,...g.pages.map(re=>re.bleed)):0,D=Math.max(...g.pages.map(re=>re.computedWidth)),B=Math.max(...g.pages.map(re=>re.computedHeight)),V=((T=g.activePage)===null||T===void 0?void 0:T.computedHeight)||0,Y=D+2*M,F=(P?V:B)+2*M,$=async({skipTimeout:re}={skipTimeout:!1})=>{if(re||await new Promise(Ve=>setTimeout(Ve,50)),H.current===null)return;const ae=H.current.getBoundingClientRect();ae.width!==0&&ae.height!==0||(console.warn(f),console.log(H.current));const we=L.current.clientWidth||ae.width,be={width:we,height:ae.height};(W.current.width!==be.width||W.current.height!==be.height)&&(Z(be),W.current=be);const te=(we-2*N)/Y,fe=g.pages.length>1?3.1:2,he=(ae.height-U*fe)/F,Ee=Math.max(Math.min(te,he),.01);g.scaleToFit!==Ee&&(g.setScale(Ee),g._setScaleToFit(Ee))};n.default.useLayoutEffect(()=>{$({skipTimeout:!0})},[]),n.default.useEffect(()=>{$()},[Y,F]),n.default.useEffect(()=>{g.__()},[]),n.default.useEffect(()=>{const re=H.current;if(window.ResizeObserver){const ae=new ResizeObserver(()=>{$({skipTimeout:!0})});return ae.observe(re),()=>ae.unobserve(re)}{const ae=setInterval(()=>{$({skipTimeout:!0})},100);return()=>clearInterval(ae)}},[Y,F]);const z=Math.max(N,(G.width-Y*g.scale)/2),K=P?1:g.pages.length,X=F*g.scale*K,Q=Math.max(U,(G.height-X)/K/2);n.default.useEffect(()=>{const re=ae=>{(A||l.handleHotkey)(ae,g)};return window.addEventListener("keydown",re),()=>window.removeEventListener("keydown",re)},[]),n.default.useEffect(()=>{var re;const ae=we=>{if(we.ctrlKey||we.metaKey){we.preventDefault();const he=Math.max(3,g.scaleToFit),Ee=Math.min(.1,g.scaleToFit),Ve=(be=we.deltaY<0?1.05*g.scale:g.scale/1.05,te=Ee,fe=he,Math.max(te,Math.min(fe,be)));g.setScale(Ve)}else var be,te,fe};return(re=L.current)===null||re===void 0||re.addEventListener("wheel",ae),()=>{var we;return(we=L.current)===null||we===void 0?void 0:we.removeEventListener("wheel",ae)}},[]);const J=n.default.useRef(!1);h(L,Y*g.scale+2*z,F*g.scale+2*Q,g.scale,g,J);const{handleScroll:ne}=w(L,F*g.scale+2*Q,g,G,J,P),ie=G.width>=Y*g.scale+2*z,oe=p||"rgba(232, 232, 232, 0.9)",de=g.pages.indexOf(g.activePage),me=(_==null?void 0:_.NoPages)||v,Pe=E??Math.min(3,Math.max(1,Math.ceil(G.height/2/(F*g.scale))));return n.default.createElement("div",{ref:H,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:oe},tabIndex:0,className:"polotno-workspace-container"},n.default.createElement("div",{ref:L,onScroll:ne,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:ie?"hidden":"auto"},className:"polotno-workspace-inner"},g.pages.map((re,ae)=>{const we=re===g.activePage;if(P&&!we&&!re._exportingOrRendering&&!re._forceMount)return null;if(!(Math.abs(ae-de)<=Pe||re._exportingOrRendering||re._forceMount))return n.default.createElement(O,{key:re.id,width:Y*g.scale+2*z,height:F*g.scale+2*Q,backgroundColor:oe,xPadding:z,yPadding:Q});const be=n.default.createElement(i.default,{key:re.id,page:re,xPadding:z,yPadding:Q,width:Y*g.scale+2*z,height:F*g.scale+2*Q,store:g,pageControlsEnabled:b,backColor:oe,pageBorderColor:y||"lightgrey",activePageBorderColor:d||"rgb(0, 161, 255)",altCloneEnabled:S,bleedColor:m||"rgba(255, 0, 0, 0.1)",components:_});return(re._exportingOrRendering||re._forceMount)&&!we&&P?n.default.createElement("div",{style:{display:"none"},key:re.id},be):be}),g.rulesVisible&&n.default.createElement(o.TopRules,{store:g,xPadding:z,yPadding:Q,width:Y*g.scale+2*z,height:F*g.scale+2*Q}),g.pages.length===0&&n.default.createElement(me,{store:g}),g.audios.map(re=>n.default.createElement(a.AudioElement,{key:re.id,audio:re,store:g}))))}),t.default=t.WorkspaceCanvas})(qw);var wj=x2();Rl.toggleFadeInAnimation(!1);Qr.setTextOverflow("change-font-size");const Sj=new URLSearchParams(location.search).get("key"),LS=wj.createStore({key:Sj});window.store=LS;window.config={addGlobalFont:iu.addGlobalFont,unstable_useHtmlTextRender:Qr.useHtmlTextRender,unstable_setTextVerticalResizeEnabled:Qr.setTextVerticalResizeEnabled,unstable_setTextOverflow:Qr.setTextOverflow,onLoadError:Yi.onLoadError,setAssetLoadTimeout:Yi.setAssetLoadTimeout,setFontLoadTimeout:Yi.setFontLoadTimeout};const Ej=zd.createRoot(document.getElementById("root"));Ej.render(dt.createElement(qw.WorkspaceCanvas,{visiblePagesOffset:0,store:LS,components:{PageControls:()=>null,Tooltip:()=>null}}));
|