polotno-node 2.9.33 → 2.9.35

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.
@@ -0,0 +1,298 @@
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var me=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function po(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var N_={exports:{}},pt={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Cc=Symbol.for("react.element"),EE=Symbol.for("react.portal"),OE=Symbol.for("react.fragment"),xE=Symbol.for("react.strict_mode"),PE=Symbol.for("react.profiler"),CE=Symbol.for("react.provider"),kE=Symbol.for("react.context"),TE=Symbol.for("react.forward_ref"),AE=Symbol.for("react.suspense"),RE=Symbol.for("react.memo"),ME=Symbol.for("react.lazy"),o3=Symbol.iterator;function LE(e){return e===null||typeof e!="object"?null:(e=o3&&e[o3]||e["@@iterator"],typeof e=="function"?e:null)}var I_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D_=Object.assign,j_={};function zs(e,t,r){this.props=e,this.context=t,this.refs=j_,this.updater=r||I_}zs.prototype.isReactComponent={};zs.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};zs.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function F_(){}F_.prototype=zs.prototype;function bm(e,t,r){this.props=e,this.context=t,this.refs=j_,this.updater=r||I_}var _m=bm.prototype=new F_;_m.constructor=bm;D_(_m,zs.prototype);_m.isPureReactComponent=!0;var l3=Array.isArray,z_=Object.prototype.hasOwnProperty,wm={current:null},B_={key:!0,ref:!0,__self:!0,__source:!0};function U_(e,t,r){var n,i={},a=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)z_.call(t,n)&&!B_.hasOwnProperty(n)&&(i[n]=t[n]);var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){for(var u=Array(l),f=0;f<l;f++)u[f]=arguments[f+2];i.children=u}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)i[n]===void 0&&(i[n]=l[n]);return{$$typeof:Cc,type:e,key:a,ref:o,props:i,_owner:wm.current}}function NE(e,t){return{$$typeof:Cc,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Sm(e){return typeof e=="object"&&e!==null&&e.$$typeof===Cc}function IE(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var s3=/\/+/g;function f1(e,t){return typeof e=="object"&&e!==null&&e.key!=null?IE(""+e.key):t.toString(36)}function _d(e,t,r,n,i){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Cc:case EE:o=!0}}if(o)return o=e,i=i(o),e=n===""?"."+f1(o,0):n,l3(i)?(r="",e!=null&&(r=e.replace(s3,"$&/")+"/"),_d(i,t,r,"",function(f){return f})):i!=null&&(Sm(i)&&(i=NE(i,r+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(s3,"$&/")+"/")+e)),t.push(i)),1;if(o=0,n=n===""?".":n+":",l3(e))for(var l=0;l<e.length;l++){a=e[l];var u=n+f1(a,l);o+=_d(a,t,r,u,i)}else if(u=LE(e),typeof u=="function")for(e=u.call(e),l=0;!(a=e.next()).done;)a=a.value,u=n+f1(a,l++),o+=_d(a,t,r,u,i);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Gf(e,t,r){if(e==null)return e;var n=[],i=0;return _d(e,n,"","",function(a){return t.call(r,a,i++)}),n}function DE(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Kr={current:null},wd={transition:null},jE={ReactCurrentDispatcher:Kr,ReactCurrentBatchConfig:wd,ReactCurrentOwner:wm};function H_(){throw Error("act(...) is not supported in production builds of React.")}pt.Children={map:Gf,forEach:function(e,t,r){Gf(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Gf(e,function(){t++}),t},toArray:function(e){return Gf(e,function(t){return t})||[]},only:function(e){if(!Sm(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};pt.Component=zs;pt.Fragment=OE;pt.Profiler=PE;pt.PureComponent=bm;pt.StrictMode=xE;pt.Suspense=AE;pt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=jE;pt.act=H_;pt.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=D_({},e.props),i=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=wm.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)z_.call(t,u)&&!B_.hasOwnProperty(u)&&(n[u]=t[u]===void 0&&l!==void 0?l[u]:t[u])}var u=arguments.length-2;if(u===1)n.children=r;else if(1<u){l=Array(u);for(var f=0;f<u;f++)l[f]=arguments[f+2];n.children=l}return{$$typeof:Cc,type:e.type,key:i,ref:a,props:n,_owner:o}};pt.createContext=function(e){return e={$$typeof:kE,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:CE,_context:e},e.Consumer=e};pt.createElement=U_;pt.createFactory=function(e){var t=U_.bind(null,e);return t.type=e,t};pt.createRef=function(){return{current:null}};pt.forwardRef=function(e){return{$$typeof:TE,render:e}};pt.isValidElement=Sm;pt.lazy=function(e){return{$$typeof:ME,_payload:{_status:-1,_result:e},_init:DE}};pt.memo=function(e,t){return{$$typeof:RE,type:e,compare:t===void 0?null:t}};pt.startTransition=function(e){var t=wd.transition;wd.transition={};try{e()}finally{wd.transition=t}};pt.unstable_act=H_;pt.useCallback=function(e,t){return Kr.current.useCallback(e,t)};pt.useContext=function(e){return Kr.current.useContext(e)};pt.useDebugValue=function(){};pt.useDeferredValue=function(e){return Kr.current.useDeferredValue(e)};pt.useEffect=function(e,t){return Kr.current.useEffect(e,t)};pt.useId=function(){return Kr.current.useId()};pt.useImperativeHandle=function(e,t,r){return Kr.current.useImperativeHandle(e,t,r)};pt.useInsertionEffect=function(e,t){return Kr.current.useInsertionEffect(e,t)};pt.useLayoutEffect=function(e,t){return Kr.current.useLayoutEffect(e,t)};pt.useMemo=function(e,t){return Kr.current.useMemo(e,t)};pt.useReducer=function(e,t,r){return Kr.current.useReducer(e,t,r)};pt.useRef=function(e){return Kr.current.useRef(e)};pt.useState=function(e){return Kr.current.useState(e)};pt.useSyncExternalStore=function(e,t,r){return Kr.current.useSyncExternalStore(e,t,r)};pt.useTransition=function(){return Kr.current.useTransition()};pt.version="18.3.1";N_.exports=pt;var Je=N_.exports;const ht=xh(Je);var Dd={},$_={exports:{}},kn={},G_={exports:{}},V_={};/**
10
+ * @license React
11
+ * scheduler.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */(function(e){function t(z,W){var R=z.length;z.push(W);e:for(;0<R;){var M=R-1>>>1,F=z[M];if(0<i(F,W))z[M]=W,z[R]=F,R=M;else break e}}function r(z){return z.length===0?null:z[0]}function n(z){if(z.length===0)return null;var W=z[0],R=z.pop();if(R!==W){z[0]=R;e:for(var M=0,F=z.length,D=F>>>1;M<D;){var H=2*(M+1)-1,K=z[H],G=H+1,B=z[G];if(0>i(K,R))G<F&&0>i(B,K)?(z[M]=B,z[G]=R,M=G):(z[M]=K,z[H]=R,M=H);else if(G<F&&0>i(B,R))z[M]=B,z[G]=R,M=G;else break e}}return W}function i(z,W){var R=z.sortIndex-W.sortIndex;return R!==0?R:z.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var u=[],f=[],h=1,E=null,w=3,p=!1,S=!1,b=!1,y=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(z){for(var W=r(f);W!==null;){if(W.callback===null)n(f);else if(W.startTime<=z)n(f),W.sortIndex=W.expirationTime,t(u,W);else break;W=r(f)}}function g(z){if(b=!1,d(z),!S)if(r(u)!==null)S=!0,Z(_);else{var W=r(f);W!==null&&q(g,W.startTime-z)}}function _(z,W){S=!1,b&&(b=!1,v(P),P=-1),p=!0;var R=w;try{for(d(W),E=r(u);E!==null&&(!(E.expirationTime>W)||z&&!A());){var M=E.callback;if(typeof M=="function"){E.callback=null,w=E.priorityLevel;var F=M(E.expirationTime<=W);W=e.unstable_now(),typeof F=="function"?E.callback=F:E===r(u)&&n(u),d(W)}else n(u);E=r(u)}if(E!==null)var D=!0;else{var H=r(f);H!==null&&q(g,H.startTime-W),D=!1}return D}finally{E=null,w=R,p=!1}}var k=!1,C=null,P=-1,O=5,x=-1;function A(){return!(e.unstable_now()-x<O)}function L(){if(C!==null){var z=e.unstable_now();x=z;var W=!0;try{W=C(!0,z)}finally{W?I():(k=!1,C=null)}}else k=!1}var I;if(typeof m=="function")I=function(){m(L)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,$=U.port2;U.port1.onmessage=L,I=function(){$.postMessage(null)}}else I=function(){y(L,0)};function Z(z){C=z,k||(k=!0,I())}function q(z,W){P=y(function(){z(e.unstable_now())},W)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(z){z.callback=null},e.unstable_continueExecution=function(){S||p||(S=!0,Z(_))},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return w},e.unstable_getFirstCallbackNode=function(){return r(u)},e.unstable_next=function(z){switch(w){case 1:case 2:case 3:var W=3;break;default:W=w}var R=w;w=W;try{return z()}finally{w=R}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(z,W){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var R=w;w=z;try{return W()}finally{w=R}},e.unstable_scheduleCallback=function(z,W,R){var M=e.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0<R?M+R:M):R=M,z){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=R+F,z={id:h++,callback:W,priorityLevel:z,startTime:R,expirationTime:F,sortIndex:-1},R>M?(z.sortIndex=R,t(f,z),r(u)===null&&z===r(f)&&(b?(v(P),P=-1):b=!0,q(g,R-M))):(z.sortIndex=F,t(u,z),S||p||(S=!0,Z(_))),z},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(z){var W=w;return function(){var R=w;w=W;try{return z.apply(this,arguments)}finally{w=R}}}})(V_);G_.exports=V_;var zu=G_.exports;/**
18
+ * @license React
19
+ * react-dom.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var FE=Je,Pn=zu;function Ce(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var q_=new Set,Ju={};function cl(e,t){ms(e,t),ms(e+"Capture",t)}function ms(e,t){for(Ju[e]=t,e=0;e<t.length;e++)q_.add(t[e])}var va=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rv=Object.prototype.hasOwnProperty,zE=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,u3={},c3={};function BE(e){return rv.call(c3,e)?!0:rv.call(u3,e)?!1:zE.test(e)?c3[e]=!0:(u3[e]=!0,!1)}function UE(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function HE(e,t,r,n){if(t===null||typeof t>"u"||UE(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Yr(e,t,r,n,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var Rr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Rr[e]=new Yr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Rr[t]=new Yr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Rr[e]=new Yr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Rr[e]=new Yr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Rr[e]=new Yr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Rr[e]=new Yr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Rr[e]=new Yr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Rr[e]=new Yr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Rr[e]=new Yr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Em=/[\-:]([a-z])/g;function Om(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Em,Om);Rr[t]=new Yr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Em,Om);Rr[t]=new Yr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Em,Om);Rr[t]=new Yr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Rr[e]=new Yr(e,1,!1,e.toLowerCase(),null,!1,!1)});Rr.xlinkHref=new Yr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Rr[e]=new Yr(e,1,!1,e.toLowerCase(),null,!0,!0)});function xm(e,t,r,n){var i=Rr.hasOwnProperty(t)?Rr[t]:null;(i!==null?i.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(HE(t,r,i,n)&&(r=null),n||i===null?BE(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):i.mustUseProperty?e[i.propertyName]=r===null?i.type===3?!1:"":r:(t=i.attributeName,n=i.attributeNamespace,r===null?e.removeAttribute(t):(i=i.type,r=i===3||i===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var Sa=FE.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Vf=Symbol.for("react.element"),Yl=Symbol.for("react.portal"),Xl=Symbol.for("react.fragment"),Pm=Symbol.for("react.strict_mode"),nv=Symbol.for("react.profiler"),W_=Symbol.for("react.provider"),K_=Symbol.for("react.context"),Cm=Symbol.for("react.forward_ref"),iv=Symbol.for("react.suspense"),av=Symbol.for("react.suspense_list"),km=Symbol.for("react.memo"),Ga=Symbol.for("react.lazy"),Y_=Symbol.for("react.offscreen"),f3=Symbol.iterator;function Su(e){return e===null||typeof e!="object"?null:(e=f3&&e[f3]||e["@@iterator"],typeof e=="function"?e:null)}var Xt=Object.assign,d1;function Nu(e){if(d1===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);d1=t&&t[1]||""}return`
26
+ `+d1+e}var h1=!1;function p1(e,t){if(!e||h1)return"";h1=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(f){var n=f}Reflect.construct(e,[],t)}else{try{t.call()}catch(f){n=f}e.call(t.prototype)}else{try{throw Error()}catch(f){n=f}e()}}catch(f){if(f&&n&&typeof f.stack=="string"){for(var i=f.stack.split(`
27
+ `),a=n.stack.split(`
28
+ `),o=i.length-1,l=a.length-1;1<=o&&0<=l&&i[o]!==a[l];)l--;for(;1<=o&&0<=l;o--,l--)if(i[o]!==a[l]){if(o!==1||l!==1)do if(o--,l--,0>l||i[o]!==a[l]){var u=`
29
+ `+i[o].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=o&&0<=l);break}}}finally{h1=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Nu(e):""}function $E(e){switch(e.tag){case 5:return Nu(e.type);case 16:return Nu("Lazy");case 13:return Nu("Suspense");case 19:return Nu("SuspenseList");case 0:case 2:case 15:return e=p1(e.type,!1),e;case 11:return e=p1(e.type.render,!1),e;case 1:return e=p1(e.type,!0),e;default:return""}}function ov(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Xl:return"Fragment";case Yl:return"Portal";case nv:return"Profiler";case Pm:return"StrictMode";case iv:return"Suspense";case av:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case K_:return(e.displayName||"Context")+".Consumer";case W_:return(e._context.displayName||"Context")+".Provider";case Cm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case km:return t=e.displayName||null,t!==null?t:ov(e.type)||"Memo";case Ga:t=e._payload,e=e._init;try{return ov(e(t))}catch{}}return null}function GE(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ov(t);case 8:return t===Pm?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function so(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function X_(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function VE(e){var t=X_(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function qf(e){e._valueTracker||(e._valueTracker=VE(e))}function Z_(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=X_(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function jd(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function lv(e,t){var r=t.checked;return Xt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function d3(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=so(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Q_(e,t){t=t.checked,t!=null&&xm(e,"checked",t,!1)}function sv(e,t){Q_(e,t);var r=so(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?uv(e,t.type,r):t.hasOwnProperty("defaultValue")&&uv(e,t.type,so(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function h3(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function uv(e,t,r){(t!=="number"||jd(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Iu=Array.isArray;function cs(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+so(r),t=null,i=0;i<e.length;i++){if(e[i].value===r){e[i].selected=!0,n&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function cv(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Ce(91));return Xt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function p3(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(Ce(92));if(Iu(r)){if(1<r.length)throw Error(Ce(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:so(r)}}function J_(e,t){var r=so(t.value),n=so(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function g3(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function e6(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function fv(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?e6(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Wf,t6=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,i){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Wf=Wf||document.createElement("div"),Wf.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Wf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ec(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Bu={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qE=["Webkit","ms","Moz","O"];Object.keys(Bu).forEach(function(e){qE.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Bu[t]=Bu[e]})});function r6(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Bu.hasOwnProperty(e)&&Bu[e]?(""+t).trim():t+"px"}function n6(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=r6(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var WE=Xt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function dv(e,t){if(t){if(WE[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Ce(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Ce(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Ce(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Ce(62))}}function hv(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var pv=null;function Tm(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var gv=null,fs=null,ds=null;function v3(e){if(e=Ac(e)){if(typeof gv!="function")throw Error(Ce(280));var t=e.stateNode;t&&(t=Ah(t),gv(e.stateNode,e.type,t))}}function i6(e){fs?ds?ds.push(e):ds=[e]:fs=e}function a6(){if(fs){var e=fs,t=ds;if(ds=fs=null,v3(e),t)for(e=0;e<t.length;e++)v3(t[e])}}function o6(e,t){return e(t)}function l6(){}var g1=!1;function s6(e,t,r){if(g1)return e(t,r);g1=!0;try{return o6(e,t,r)}finally{g1=!1,(fs!==null||ds!==null)&&(l6(),a6())}}function tc(e,t){var r=e.stateNode;if(r===null)return null;var n=Ah(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(Ce(231,t,typeof r));return r}var vv=!1;if(va)try{var Eu={};Object.defineProperty(Eu,"passive",{get:function(){vv=!0}}),window.addEventListener("test",Eu,Eu),window.removeEventListener("test",Eu,Eu)}catch{vv=!1}function KE(e,t,r,n,i,a,o,l,u){var f=Array.prototype.slice.call(arguments,3);try{t.apply(r,f)}catch(h){this.onError(h)}}var Uu=!1,Fd=null,zd=!1,mv=null,YE={onError:function(e){Uu=!0,Fd=e}};function XE(e,t,r,n,i,a,o,l,u){Uu=!1,Fd=null,KE.apply(YE,arguments)}function ZE(e,t,r,n,i,a,o,l,u){if(XE.apply(this,arguments),Uu){if(Uu){var f=Fd;Uu=!1,Fd=null}else throw Error(Ce(198));zd||(zd=!0,mv=f)}}function fl(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function u6(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m3(e){if(fl(e)!==e)throw Error(Ce(188))}function QE(e){var t=e.alternate;if(!t){if(t=fl(e),t===null)throw Error(Ce(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(i===null)break;var a=i.alternate;if(a===null){if(n=i.return,n!==null){r=n;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===r)return m3(i),e;if(a===n)return m3(i),t;a=a.sibling}throw Error(Ce(188))}if(r.return!==n.return)r=i,n=a;else{for(var o=!1,l=i.child;l;){if(l===r){o=!0,r=i,n=a;break}if(l===n){o=!0,n=i,r=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===r){o=!0,r=a,n=i;break}if(l===n){o=!0,n=a,r=i;break}l=l.sibling}if(!o)throw Error(Ce(189))}}if(r.alternate!==n)throw Error(Ce(190))}if(r.tag!==3)throw Error(Ce(188));return r.stateNode.current===r?e:t}function c6(e){return e=QE(e),e!==null?f6(e):null}function f6(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=f6(e);if(t!==null)return t;e=e.sibling}return null}var d6=Pn.unstable_scheduleCallback,y3=Pn.unstable_cancelCallback,JE=Pn.unstable_shouldYield,eO=Pn.unstable_requestPaint,rr=Pn.unstable_now,tO=Pn.unstable_getCurrentPriorityLevel,Am=Pn.unstable_ImmediatePriority,h6=Pn.unstable_UserBlockingPriority,Bd=Pn.unstable_NormalPriority,rO=Pn.unstable_LowPriority,p6=Pn.unstable_IdlePriority,Ph=null,zi=null;function nO(e){if(zi&&typeof zi.onCommitFiberRoot=="function")try{zi.onCommitFiberRoot(Ph,e,void 0,(e.current.flags&128)===128)}catch{}}var fi=Math.clz32?Math.clz32:oO,iO=Math.log,aO=Math.LN2;function oO(e){return e>>>=0,e===0?32:31-(iO(e)/aO|0)|0}var Kf=64,Yf=4194304;function Du(e){switch(e&-e){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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ud(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,o=r&268435455;if(o!==0){var l=o&~i;l!==0?n=Du(l):(a&=o,a!==0&&(n=Du(a)))}else o=r&~i,o!==0?n=Du(o):a!==0&&(n=Du(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-fi(t),i=1<<r,n|=e[r],t&=~i;return n}function lO(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 sO(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-fi(a),l=1<<o,u=i[o];u===-1?(!(l&r)||l&n)&&(i[o]=lO(l,t)):u<=t&&(e.expiredLanes|=l),a&=~l}}function yv(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function g6(){var e=Kf;return Kf<<=1,!(Kf&4194240)&&(Kf=64),e}function v1(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function kc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-fi(t),e[t]=r}function uO(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var i=31-fi(r),a=1<<i;t[i]=0,n[i]=-1,e[i]=-1,r&=~a}}function Rm(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-fi(r),i=1<<n;i&t|e[n]&t&&(e[n]|=t),r&=~i}}var Pt=0;function v6(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var m6,Mm,y6,b6,_6,bv=!1,Xf=[],Qa=null,Ja=null,eo=null,rc=new Map,nc=new Map,qa=[],cO="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function b3(e,t){switch(e){case"focusin":case"focusout":Qa=null;break;case"dragenter":case"dragleave":Ja=null;break;case"mouseover":case"mouseout":eo=null;break;case"pointerover":case"pointerout":rc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":nc.delete(t.pointerId)}}function Ou(e,t,r,n,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ac(t),t!==null&&Mm(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function fO(e,t,r,n,i){switch(t){case"focusin":return Qa=Ou(Qa,e,t,r,n,i),!0;case"dragenter":return Ja=Ou(Ja,e,t,r,n,i),!0;case"mouseover":return eo=Ou(eo,e,t,r,n,i),!0;case"pointerover":var a=i.pointerId;return rc.set(a,Ou(rc.get(a)||null,e,t,r,n,i)),!0;case"gotpointercapture":return a=i.pointerId,nc.set(a,Ou(nc.get(a)||null,e,t,r,n,i)),!0}return!1}function w6(e){var t=Vo(e.target);if(t!==null){var r=fl(t);if(r!==null){if(t=r.tag,t===13){if(t=u6(r),t!==null){e.blockedOn=t,_6(e.priority,function(){y6(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Sd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=_v(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);pv=n,r.target.dispatchEvent(n),pv=null}else return t=Ac(r),t!==null&&Mm(t),e.blockedOn=r,!1;t.shift()}return!0}function _3(e,t,r){Sd(e)&&r.delete(t)}function dO(){bv=!1,Qa!==null&&Sd(Qa)&&(Qa=null),Ja!==null&&Sd(Ja)&&(Ja=null),eo!==null&&Sd(eo)&&(eo=null),rc.forEach(_3),nc.forEach(_3)}function xu(e,t){e.blockedOn===t&&(e.blockedOn=null,bv||(bv=!0,Pn.unstable_scheduleCallback(Pn.unstable_NormalPriority,dO)))}function ic(e){function t(i){return xu(i,e)}if(0<Xf.length){xu(Xf[0],e);for(var r=1;r<Xf.length;r++){var n=Xf[r];n.blockedOn===e&&(n.blockedOn=null)}}for(Qa!==null&&xu(Qa,e),Ja!==null&&xu(Ja,e),eo!==null&&xu(eo,e),rc.forEach(t),nc.forEach(t),r=0;r<qa.length;r++)n=qa[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<qa.length&&(r=qa[0],r.blockedOn===null);)w6(r),r.blockedOn===null&&qa.shift()}var hs=Sa.ReactCurrentBatchConfig,Hd=!0;function hO(e,t,r,n){var i=Pt,a=hs.transition;hs.transition=null;try{Pt=1,Lm(e,t,r,n)}finally{Pt=i,hs.transition=a}}function pO(e,t,r,n){var i=Pt,a=hs.transition;hs.transition=null;try{Pt=4,Lm(e,t,r,n)}finally{Pt=i,hs.transition=a}}function Lm(e,t,r,n){if(Hd){var i=_v(e,t,r,n);if(i===null)P1(e,t,n,$d,r),b3(e,n);else if(fO(i,e,t,r,n))n.stopPropagation();else if(b3(e,n),t&4&&-1<cO.indexOf(e)){for(;i!==null;){var a=Ac(i);if(a!==null&&m6(a),a=_v(e,t,r,n),a===null&&P1(e,t,n,$d,r),a===i)break;i=a}i!==null&&n.stopPropagation()}else P1(e,t,n,null,r)}}var $d=null;function _v(e,t,r,n){if($d=null,e=Tm(n),e=Vo(e),e!==null)if(t=fl(e),t===null)e=null;else if(r=t.tag,r===13){if(e=u6(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return $d=e,null}function S6(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(tO()){case Am:return 1;case h6:return 4;case Bd:case rO:return 16;case p6:return 536870912;default:return 16}default:return 16}}var Ya=null,Nm=null,Ed=null;function E6(){if(Ed)return Ed;var e,t=Nm,r=t.length,n,i="value"in Ya?Ya.value:Ya.textContent,a=i.length;for(e=0;e<r&&t[e]===i[e];e++);var o=r-e;for(n=1;n<=o&&t[r-n]===i[a-n];n++);return Ed=i.slice(e,1<n?1-n:void 0)}function Od(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Zf(){return!0}function w3(){return!1}function Tn(e){function t(r,n,i,a,o){this._reactName=r,this._targetInst=i,this.type=n,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Zf:w3,this.isPropagationStopped=w3,this}return Xt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Zf)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Zf)},persist:function(){},isPersistent:Zf}),t}var Bs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Im=Tn(Bs),Tc=Xt({},Bs,{view:0,detail:0}),gO=Tn(Tc),m1,y1,Pu,Ch=Xt({},Tc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dm,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Pu&&(Pu&&e.type==="mousemove"?(m1=e.screenX-Pu.screenX,y1=e.screenY-Pu.screenY):y1=m1=0,Pu=e),m1)},movementY:function(e){return"movementY"in e?e.movementY:y1}}),S3=Tn(Ch),vO=Xt({},Ch,{dataTransfer:0}),mO=Tn(vO),yO=Xt({},Tc,{relatedTarget:0}),b1=Tn(yO),bO=Xt({},Bs,{animationName:0,elapsedTime:0,pseudoElement:0}),_O=Tn(bO),wO=Xt({},Bs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),SO=Tn(wO),EO=Xt({},Bs,{data:0}),E3=Tn(EO),OO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},xO={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},PO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function CO(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=PO[e])?!!t[e]:!1}function Dm(){return CO}var kO=Xt({},Tc,{key:function(e){if(e.key){var t=OO[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Od(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?xO[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dm,charCode:function(e){return e.type==="keypress"?Od(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Od(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),TO=Tn(kO),AO=Xt({},Ch,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),O3=Tn(AO),RO=Xt({},Tc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dm}),MO=Tn(RO),LO=Xt({},Bs,{propertyName:0,elapsedTime:0,pseudoElement:0}),NO=Tn(LO),IO=Xt({},Ch,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),DO=Tn(IO),jO=[9,13,27,32],jm=va&&"CompositionEvent"in window,Hu=null;va&&"documentMode"in document&&(Hu=document.documentMode);var FO=va&&"TextEvent"in window&&!Hu,O6=va&&(!jm||Hu&&8<Hu&&11>=Hu),x3=" ",P3=!1;function x6(e,t){switch(e){case"keyup":return jO.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function P6(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zl=!1;function zO(e,t){switch(e){case"compositionend":return P6(t);case"keypress":return t.which!==32?null:(P3=!0,x3);case"textInput":return e=t.data,e===x3&&P3?null:e;default:return null}}function BO(e,t){if(Zl)return e==="compositionend"||!jm&&x6(e,t)?(e=E6(),Ed=Nm=Ya=null,Zl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return O6&&t.locale!=="ko"?null:t.data;default:return null}}var UO={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function C3(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!UO[e.type]:t==="textarea"}function C6(e,t,r,n){i6(n),t=Gd(t,"onChange"),0<t.length&&(r=new Im("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var $u=null,ac=null;function HO(e){F6(e,0)}function kh(e){var t=es(e);if(Z_(t))return e}function $O(e,t){if(e==="change")return t}var k6=!1;if(va){var _1;if(va){var w1="oninput"in document;if(!w1){var k3=document.createElement("div");k3.setAttribute("oninput","return;"),w1=typeof k3.oninput=="function"}_1=w1}else _1=!1;k6=_1&&(!document.documentMode||9<document.documentMode)}function T3(){$u&&($u.detachEvent("onpropertychange",T6),ac=$u=null)}function T6(e){if(e.propertyName==="value"&&kh(ac)){var t=[];C6(t,ac,e,Tm(e)),s6(HO,t)}}function GO(e,t,r){e==="focusin"?(T3(),$u=t,ac=r,$u.attachEvent("onpropertychange",T6)):e==="focusout"&&T3()}function VO(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return kh(ac)}function qO(e,t){if(e==="click")return kh(t)}function WO(e,t){if(e==="input"||e==="change")return kh(t)}function KO(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var mi=typeof Object.is=="function"?Object.is:KO;function oc(e,t){if(mi(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!rv.call(t,i)||!mi(e[i],t[i]))return!1}return!0}function A3(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function R3(e,t){var r=A3(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=A3(r)}}function A6(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?A6(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function R6(){for(var e=window,t=jd();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=jd(e.document)}return t}function Fm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function YO(e){var t=R6(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&A6(r.ownerDocument.documentElement,r)){if(n!==null&&Fm(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=R3(r,a);var o=R3(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var XO=va&&"documentMode"in document&&11>=document.documentMode,Ql=null,wv=null,Gu=null,Sv=!1;function M3(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Sv||Ql==null||Ql!==jd(n)||(n=Ql,"selectionStart"in n&&Fm(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Gu&&oc(Gu,n)||(Gu=n,n=Gd(wv,"onSelect"),0<n.length&&(t=new Im("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=Ql)))}function Qf(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Jl={animationend:Qf("Animation","AnimationEnd"),animationiteration:Qf("Animation","AnimationIteration"),animationstart:Qf("Animation","AnimationStart"),transitionend:Qf("Transition","TransitionEnd")},S1={},M6={};va&&(M6=document.createElement("div").style,"AnimationEvent"in window||(delete Jl.animationend.animation,delete Jl.animationiteration.animation,delete Jl.animationstart.animation),"TransitionEvent"in window||delete Jl.transitionend.transition);function Th(e){if(S1[e])return S1[e];if(!Jl[e])return e;var t=Jl[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in M6)return S1[e]=t[r];return e}var L6=Th("animationend"),N6=Th("animationiteration"),I6=Th("animationstart"),D6=Th("transitionend"),j6=new Map,L3="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function go(e,t){j6.set(e,t),cl(t,[e])}for(var E1=0;E1<L3.length;E1++){var O1=L3[E1],ZO=O1.toLowerCase(),QO=O1[0].toUpperCase()+O1.slice(1);go(ZO,"on"+QO)}go(L6,"onAnimationEnd");go(N6,"onAnimationIteration");go(I6,"onAnimationStart");go("dblclick","onDoubleClick");go("focusin","onFocus");go("focusout","onBlur");go(D6,"onTransitionEnd");ms("onMouseEnter",["mouseout","mouseover"]);ms("onMouseLeave",["mouseout","mouseover"]);ms("onPointerEnter",["pointerout","pointerover"]);ms("onPointerLeave",["pointerout","pointerover"]);cl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));cl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));cl("onBeforeInput",["compositionend","keypress","textInput","paste"]);cl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));cl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));cl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ju="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),JO=new Set("cancel close invalid load scroll toggle".split(" ").concat(ju));function N3(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,ZE(n,t,void 0,e),e.currentTarget=null}function F6(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],i=n.event;n=n.listeners;e:{var a=void 0;if(t)for(var o=n.length-1;0<=o;o--){var l=n[o],u=l.instance,f=l.currentTarget;if(l=l.listener,u!==a&&i.isPropagationStopped())break e;N3(i,l,f),a=u}else for(o=0;o<n.length;o++){if(l=n[o],u=l.instance,f=l.currentTarget,l=l.listener,u!==a&&i.isPropagationStopped())break e;N3(i,l,f),a=u}}}if(zd)throw e=mv,zd=!1,mv=null,e}function zt(e,t){var r=t[Cv];r===void 0&&(r=t[Cv]=new Set);var n=e+"__bubble";r.has(n)||(z6(t,e,2,!1),r.add(n))}function x1(e,t,r){var n=0;t&&(n|=4),z6(r,e,n,t)}var Jf="_reactListening"+Math.random().toString(36).slice(2);function lc(e){if(!e[Jf]){e[Jf]=!0,q_.forEach(function(r){r!=="selectionchange"&&(JO.has(r)||x1(r,!1,e),x1(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Jf]||(t[Jf]=!0,x1("selectionchange",!1,t))}}function z6(e,t,r,n){switch(S6(t)){case 1:var i=hO;break;case 4:i=pO;break;default:i=Lm}r=i.bind(null,t,r,e),i=void 0,!vv||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),n?i!==void 0?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):i!==void 0?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function P1(e,t,r,n,i){var a=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var l=n.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(o===4)for(o=n.return;o!==null;){var u=o.tag;if((u===3||u===4)&&(u=o.stateNode.containerInfo,u===i||u.nodeType===8&&u.parentNode===i))return;o=o.return}for(;l!==null;){if(o=Vo(l),o===null)return;if(u=o.tag,u===5||u===6){n=a=o;continue e}l=l.parentNode}}n=n.return}s6(function(){var f=a,h=Tm(r),E=[];e:{var w=j6.get(e);if(w!==void 0){var p=Im,S=e;switch(e){case"keypress":if(Od(r)===0)break e;case"keydown":case"keyup":p=TO;break;case"focusin":S="focus",p=b1;break;case"focusout":S="blur",p=b1;break;case"beforeblur":case"afterblur":p=b1;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=S3;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=mO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=MO;break;case L6:case N6:case I6:p=_O;break;case D6:p=NO;break;case"scroll":p=gO;break;case"wheel":p=DO;break;case"copy":case"cut":case"paste":p=SO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=O3}var b=(t&4)!==0,y=!b&&e==="scroll",v=b?w!==null?w+"Capture":null:w;b=[];for(var m=f,d;m!==null;){d=m;var g=d.stateNode;if(d.tag===5&&g!==null&&(d=g,v!==null&&(g=tc(m,v),g!=null&&b.push(sc(m,g,d)))),y)break;m=m.return}0<b.length&&(w=new p(w,S,null,r,h),E.push({event:w,listeners:b}))}}if(!(t&7)){e:{if(w=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",w&&r!==pv&&(S=r.relatedTarget||r.fromElement)&&(Vo(S)||S[ma]))break e;if((p||w)&&(w=h.window===h?h:(w=h.ownerDocument)?w.defaultView||w.parentWindow:window,p?(S=r.relatedTarget||r.toElement,p=f,S=S?Vo(S):null,S!==null&&(y=fl(S),S!==y||S.tag!==5&&S.tag!==6)&&(S=null)):(p=null,S=f),p!==S)){if(b=S3,g="onMouseLeave",v="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(b=O3,g="onPointerLeave",v="onPointerEnter",m="pointer"),y=p==null?w:es(p),d=S==null?w:es(S),w=new b(g,m+"leave",p,r,h),w.target=y,w.relatedTarget=d,g=null,Vo(h)===f&&(b=new b(v,m+"enter",S,r,h),b.target=d,b.relatedTarget=y,g=b),y=g,p&&S)t:{for(b=p,v=S,m=0,d=b;d;d=$l(d))m++;for(d=0,g=v;g;g=$l(g))d++;for(;0<m-d;)b=$l(b),m--;for(;0<d-m;)v=$l(v),d--;for(;m--;){if(b===v||v!==null&&b===v.alternate)break t;b=$l(b),v=$l(v)}b=null}else b=null;p!==null&&I3(E,w,p,b,!1),S!==null&&y!==null&&I3(E,y,S,b,!0)}}e:{if(w=f?es(f):window,p=w.nodeName&&w.nodeName.toLowerCase(),p==="select"||p==="input"&&w.type==="file")var _=$O;else if(C3(w))if(k6)_=WO;else{_=VO;var k=GO}else(p=w.nodeName)&&p.toLowerCase()==="input"&&(w.type==="checkbox"||w.type==="radio")&&(_=qO);if(_&&(_=_(e,f))){C6(E,_,r,h);break e}k&&k(e,w,f),e==="focusout"&&(k=w._wrapperState)&&k.controlled&&w.type==="number"&&uv(w,"number",w.value)}switch(k=f?es(f):window,e){case"focusin":(C3(k)||k.contentEditable==="true")&&(Ql=k,wv=f,Gu=null);break;case"focusout":Gu=wv=Ql=null;break;case"mousedown":Sv=!0;break;case"contextmenu":case"mouseup":case"dragend":Sv=!1,M3(E,r,h);break;case"selectionchange":if(XO)break;case"keydown":case"keyup":M3(E,r,h)}var C;if(jm)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else Zl?x6(e,r)&&(P="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(P="onCompositionStart");P&&(O6&&r.locale!=="ko"&&(Zl||P!=="onCompositionStart"?P==="onCompositionEnd"&&Zl&&(C=E6()):(Ya=h,Nm="value"in Ya?Ya.value:Ya.textContent,Zl=!0)),k=Gd(f,P),0<k.length&&(P=new E3(P,e,null,r,h),E.push({event:P,listeners:k}),C?P.data=C:(C=P6(r),C!==null&&(P.data=C)))),(C=FO?zO(e,r):BO(e,r))&&(f=Gd(f,"onBeforeInput"),0<f.length&&(h=new E3("onBeforeInput","beforeinput",null,r,h),E.push({event:h,listeners:f}),h.data=C))}F6(E,t)})}function sc(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Gd(e,t){for(var r=t+"Capture",n=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=tc(e,r),a!=null&&n.unshift(sc(e,a,i)),a=tc(e,t),a!=null&&n.push(sc(e,a,i))),e=e.return}return n}function $l(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function I3(e,t,r,n,i){for(var a=t._reactName,o=[];r!==null&&r!==n;){var l=r,u=l.alternate,f=l.stateNode;if(u!==null&&u===n)break;l.tag===5&&f!==null&&(l=f,i?(u=tc(r,a),u!=null&&o.unshift(sc(r,u,l))):i||(u=tc(r,a),u!=null&&o.push(sc(r,u,l)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var ex=/\r\n?/g,tx=/\u0000|\uFFFD/g;function D3(e){return(typeof e=="string"?e:""+e).replace(ex,`
30
+ `).replace(tx,"")}function ed(e,t,r){if(t=D3(t),D3(e)!==t&&r)throw Error(Ce(425))}function Vd(){}var Ev=null,Ov=null;function xv(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Pv=typeof setTimeout=="function"?setTimeout:void 0,rx=typeof clearTimeout=="function"?clearTimeout:void 0,j3=typeof Promise=="function"?Promise:void 0,nx=typeof queueMicrotask=="function"?queueMicrotask:typeof j3<"u"?function(e){return j3.resolve(null).then(e).catch(ix)}:Pv;function ix(e){setTimeout(function(){throw e})}function C1(e,t){var r=t,n=0;do{var i=r.nextSibling;if(e.removeChild(r),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(n===0){e.removeChild(i),ic(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}while(r);ic(t)}function to(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function F3(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Us=Math.random().toString(36).slice(2),Ii="__reactFiber$"+Us,uc="__reactProps$"+Us,ma="__reactContainer$"+Us,Cv="__reactEvents$"+Us,ax="__reactListeners$"+Us,ox="__reactHandles$"+Us;function Vo(e){var t=e[Ii];if(t)return t;for(var r=e.parentNode;r;){if(t=r[ma]||r[Ii]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=F3(e);e!==null;){if(r=e[Ii])return r;e=F3(e)}return t}e=r,r=e.parentNode}return null}function Ac(e){return e=e[Ii]||e[ma],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function es(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Ce(33))}function Ah(e){return e[uc]||null}var kv=[],ts=-1;function vo(e){return{current:e}}function Bt(e){0>ts||(e.current=kv[ts],kv[ts]=null,ts--)}function Nt(e,t){ts++,kv[ts]=e.current,e.current=t}var uo={},Ur=vo(uo),hn=vo(!1),Jo=uo;function ys(e,t){var r=e.type.contextTypes;if(!r)return uo;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function pn(e){return e=e.childContextTypes,e!=null}function qd(){Bt(hn),Bt(Ur)}function z3(e,t,r){if(Ur.current!==uo)throw Error(Ce(168));Nt(Ur,t),Nt(hn,r)}function B6(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(Ce(108,GE(e)||"Unknown",i));return Xt({},r,n)}function Wd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||uo,Jo=Ur.current,Nt(Ur,e),Nt(hn,hn.current),!0}function B3(e,t,r){var n=e.stateNode;if(!n)throw Error(Ce(169));r?(e=B6(e,t,Jo),n.__reactInternalMemoizedMergedChildContext=e,Bt(hn),Bt(Ur),Nt(Ur,e)):Bt(hn),Nt(hn,r)}var la=null,Rh=!1,k1=!1;function U6(e){la===null?la=[e]:la.push(e)}function lx(e){Rh=!0,U6(e)}function mo(){if(!k1&&la!==null){k1=!0;var e=0,t=Pt;try{var r=la;for(Pt=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}la=null,Rh=!1}catch(i){throw la!==null&&(la=la.slice(e+1)),d6(Am,mo),i}finally{Pt=t,k1=!1}}return null}var rs=[],ns=0,Kd=null,Yd=0,$n=[],Gn=0,el=null,ua=1,ca="";function $o(e,t){rs[ns++]=Yd,rs[ns++]=Kd,Kd=e,Yd=t}function H6(e,t,r){$n[Gn++]=ua,$n[Gn++]=ca,$n[Gn++]=el,el=e;var n=ua;e=ca;var i=32-fi(n)-1;n&=~(1<<i),r+=1;var a=32-fi(t)+i;if(30<a){var o=i-i%5;a=(n&(1<<o)-1).toString(32),n>>=o,i-=o,ua=1<<32-fi(t)+i|r<<i|n,ca=a+e}else ua=1<<a|r<<i|n,ca=e}function zm(e){e.return!==null&&($o(e,1),H6(e,1,0))}function Bm(e){for(;e===Kd;)Kd=rs[--ns],rs[ns]=null,Yd=rs[--ns],rs[ns]=null;for(;e===el;)el=$n[--Gn],$n[Gn]=null,ca=$n[--Gn],$n[Gn]=null,ua=$n[--Gn],$n[Gn]=null}var xn=null,On=null,Gt=!1,ci=null;function $6(e,t){var r=Wn(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function U3(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,xn=e,On=to(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,xn=e,On=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=el!==null?{id:ua,overflow:ca}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Wn(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,xn=e,On=null,!0):!1;default:return!1}}function Tv(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Av(e){if(Gt){var t=On;if(t){var r=t;if(!U3(e,t)){if(Tv(e))throw Error(Ce(418));t=to(r.nextSibling);var n=xn;t&&U3(e,t)?$6(n,r):(e.flags=e.flags&-4097|2,Gt=!1,xn=e)}}else{if(Tv(e))throw Error(Ce(418));e.flags=e.flags&-4097|2,Gt=!1,xn=e}}}function H3(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;xn=e}function td(e){if(e!==xn)return!1;if(!Gt)return H3(e),Gt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!xv(e.type,e.memoizedProps)),t&&(t=On)){if(Tv(e))throw G6(),Error(Ce(418));for(;t;)$6(e,t),t=to(t.nextSibling)}if(H3(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Ce(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){On=to(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}On=null}}else On=xn?to(e.stateNode.nextSibling):null;return!0}function G6(){for(var e=On;e;)e=to(e.nextSibling)}function bs(){On=xn=null,Gt=!1}function Um(e){ci===null?ci=[e]:ci.push(e)}var sx=Sa.ReactCurrentBatchConfig;function Cu(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(Ce(309));var n=r.stateNode}if(!n)throw Error(Ce(147,e));var i=n,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(o){var l=i.refs;o===null?delete l[a]:l[a]=o},t._stringRef=a,t)}if(typeof e!="string")throw Error(Ce(284));if(!r._owner)throw Error(Ce(290,e))}return e}function rd(e,t){throw e=Object.prototype.toString.call(t),Error(Ce(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function $3(e){var t=e._init;return t(e._payload)}function V6(e){function t(v,m){if(e){var d=v.deletions;d===null?(v.deletions=[m],v.flags|=16):d.push(m)}}function r(v,m){if(!e)return null;for(;m!==null;)t(v,m),m=m.sibling;return null}function n(v,m){for(v=new Map;m!==null;)m.key!==null?v.set(m.key,m):v.set(m.index,m),m=m.sibling;return v}function i(v,m){return v=ao(v,m),v.index=0,v.sibling=null,v}function a(v,m,d){return v.index=d,e?(d=v.alternate,d!==null?(d=d.index,d<m?(v.flags|=2,m):d):(v.flags|=2,m)):(v.flags|=1048576,m)}function o(v){return e&&v.alternate===null&&(v.flags|=2),v}function l(v,m,d,g){return m===null||m.tag!==6?(m=I1(d,v.mode,g),m.return=v,m):(m=i(m,d),m.return=v,m)}function u(v,m,d,g){var _=d.type;return _===Xl?h(v,m,d.props.children,g,d.key):m!==null&&(m.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Ga&&$3(_)===m.type)?(g=i(m,d.props),g.ref=Cu(v,m,d),g.return=v,g):(g=Rd(d.type,d.key,d.props,null,v.mode,g),g.ref=Cu(v,m,d),g.return=v,g)}function f(v,m,d,g){return m===null||m.tag!==4||m.stateNode.containerInfo!==d.containerInfo||m.stateNode.implementation!==d.implementation?(m=D1(d,v.mode,g),m.return=v,m):(m=i(m,d.children||[]),m.return=v,m)}function h(v,m,d,g,_){return m===null||m.tag!==7?(m=Xo(d,v.mode,g,_),m.return=v,m):(m=i(m,d),m.return=v,m)}function E(v,m,d){if(typeof m=="string"&&m!==""||typeof m=="number")return m=I1(""+m,v.mode,d),m.return=v,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Vf:return d=Rd(m.type,m.key,m.props,null,v.mode,d),d.ref=Cu(v,null,m),d.return=v,d;case Yl:return m=D1(m,v.mode,d),m.return=v,m;case Ga:var g=m._init;return E(v,g(m._payload),d)}if(Iu(m)||Su(m))return m=Xo(m,v.mode,d,null),m.return=v,m;rd(v,m)}return null}function w(v,m,d,g){var _=m!==null?m.key:null;if(typeof d=="string"&&d!==""||typeof d=="number")return _!==null?null:l(v,m,""+d,g);if(typeof d=="object"&&d!==null){switch(d.$$typeof){case Vf:return d.key===_?u(v,m,d,g):null;case Yl:return d.key===_?f(v,m,d,g):null;case Ga:return _=d._init,w(v,m,_(d._payload),g)}if(Iu(d)||Su(d))return _!==null?null:h(v,m,d,g,null);rd(v,d)}return null}function p(v,m,d,g,_){if(typeof g=="string"&&g!==""||typeof g=="number")return v=v.get(d)||null,l(m,v,""+g,_);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Vf:return v=v.get(g.key===null?d:g.key)||null,u(m,v,g,_);case Yl:return v=v.get(g.key===null?d:g.key)||null,f(m,v,g,_);case Ga:var k=g._init;return p(v,m,d,k(g._payload),_)}if(Iu(g)||Su(g))return v=v.get(d)||null,h(m,v,g,_,null);rd(m,g)}return null}function S(v,m,d,g){for(var _=null,k=null,C=m,P=m=0,O=null;C!==null&&P<d.length;P++){C.index>P?(O=C,C=null):O=C.sibling;var x=w(v,C,d[P],g);if(x===null){C===null&&(C=O);break}e&&C&&x.alternate===null&&t(v,C),m=a(x,m,P),k===null?_=x:k.sibling=x,k=x,C=O}if(P===d.length)return r(v,C),Gt&&$o(v,P),_;if(C===null){for(;P<d.length;P++)C=E(v,d[P],g),C!==null&&(m=a(C,m,P),k===null?_=C:k.sibling=C,k=C);return Gt&&$o(v,P),_}for(C=n(v,C);P<d.length;P++)O=p(C,v,P,d[P],g),O!==null&&(e&&O.alternate!==null&&C.delete(O.key===null?P:O.key),m=a(O,m,P),k===null?_=O:k.sibling=O,k=O);return e&&C.forEach(function(A){return t(v,A)}),Gt&&$o(v,P),_}function b(v,m,d,g){var _=Su(d);if(typeof _!="function")throw Error(Ce(150));if(d=_.call(d),d==null)throw Error(Ce(151));for(var k=_=null,C=m,P=m=0,O=null,x=d.next();C!==null&&!x.done;P++,x=d.next()){C.index>P?(O=C,C=null):O=C.sibling;var A=w(v,C,x.value,g);if(A===null){C===null&&(C=O);break}e&&C&&A.alternate===null&&t(v,C),m=a(A,m,P),k===null?_=A:k.sibling=A,k=A,C=O}if(x.done)return r(v,C),Gt&&$o(v,P),_;if(C===null){for(;!x.done;P++,x=d.next())x=E(v,x.value,g),x!==null&&(m=a(x,m,P),k===null?_=x:k.sibling=x,k=x);return Gt&&$o(v,P),_}for(C=n(v,C);!x.done;P++,x=d.next())x=p(C,v,P,x.value,g),x!==null&&(e&&x.alternate!==null&&C.delete(x.key===null?P:x.key),m=a(x,m,P),k===null?_=x:k.sibling=x,k=x);return e&&C.forEach(function(L){return t(v,L)}),Gt&&$o(v,P),_}function y(v,m,d,g){if(typeof d=="object"&&d!==null&&d.type===Xl&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case Vf:e:{for(var _=d.key,k=m;k!==null;){if(k.key===_){if(_=d.type,_===Xl){if(k.tag===7){r(v,k.sibling),m=i(k,d.props.children),m.return=v,v=m;break e}}else if(k.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Ga&&$3(_)===k.type){r(v,k.sibling),m=i(k,d.props),m.ref=Cu(v,k,d),m.return=v,v=m;break e}r(v,k);break}else t(v,k);k=k.sibling}d.type===Xl?(m=Xo(d.props.children,v.mode,g,d.key),m.return=v,v=m):(g=Rd(d.type,d.key,d.props,null,v.mode,g),g.ref=Cu(v,m,d),g.return=v,v=g)}return o(v);case Yl:e:{for(k=d.key;m!==null;){if(m.key===k)if(m.tag===4&&m.stateNode.containerInfo===d.containerInfo&&m.stateNode.implementation===d.implementation){r(v,m.sibling),m=i(m,d.children||[]),m.return=v,v=m;break e}else{r(v,m);break}else t(v,m);m=m.sibling}m=D1(d,v.mode,g),m.return=v,v=m}return o(v);case Ga:return k=d._init,y(v,m,k(d._payload),g)}if(Iu(d))return S(v,m,d,g);if(Su(d))return b(v,m,d,g);rd(v,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,m!==null&&m.tag===6?(r(v,m.sibling),m=i(m,d),m.return=v,v=m):(r(v,m),m=I1(d,v.mode,g),m.return=v,v=m),o(v)):r(v,m)}return y}var _s=V6(!0),q6=V6(!1),Xd=vo(null),Zd=null,is=null,Hm=null;function $m(){Hm=is=Zd=null}function Gm(e){var t=Xd.current;Bt(Xd),e._currentValue=t}function Rv(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function ps(e,t){Zd=e,Hm=is=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(cn=!0),e.firstContext=null)}function Xn(e){var t=e._currentValue;if(Hm!==e)if(e={context:e,memoizedValue:t,next:null},is===null){if(Zd===null)throw Error(Ce(308));is=e,Zd.dependencies={lanes:0,firstContext:e}}else is=is.next=e;return t}var qo=null;function Vm(e){qo===null?qo=[e]:qo.push(e)}function W6(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,Vm(t)):(r.next=i.next,i.next=r),t.interleaved=r,ya(e,n)}function ya(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Va=!1;function qm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function K6(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function fa(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ro(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,mt&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,ya(e,r)}return i=n.interleaved,i===null?(t.next=t,Vm(n)):(t.next=i.next,i.next=t),n.interleaved=t,ya(e,r)}function xd(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Rm(e,r)}}function G3(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?i=a=o:a=a.next=o,r=r.next}while(r!==null);a===null?i=a=t:a=a.next=t}else i=a=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Qd(e,t,r,n){var i=e.updateQueue;Va=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var u=l,f=u.next;u.next=null,o===null?a=f:o.next=f,o=u;var h=e.alternate;h!==null&&(h=h.updateQueue,l=h.lastBaseUpdate,l!==o&&(l===null?h.firstBaseUpdate=f:l.next=f,h.lastBaseUpdate=u))}if(a!==null){var E=i.baseState;o=0,h=f=u=null,l=a;do{var w=l.lane,p=l.eventTime;if((n&w)===w){h!==null&&(h=h.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var S=e,b=l;switch(w=t,p=r,b.tag){case 1:if(S=b.payload,typeof S=="function"){E=S.call(p,E,w);break e}E=S;break e;case 3:S.flags=S.flags&-65537|128;case 0:if(S=b.payload,w=typeof S=="function"?S.call(p,E,w):S,w==null)break e;E=Xt({},E,w);break e;case 2:Va=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,w=i.effects,w===null?i.effects=[l]:w.push(l))}else p={eventTime:p,lane:w,tag:l.tag,payload:l.payload,callback:l.callback,next:null},h===null?(f=h=p,u=E):h=h.next=p,o|=w;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;w=l,l=w.next,w.next=null,i.lastBaseUpdate=w,i.shared.pending=null}}while(!0);if(h===null&&(u=E),i.baseState=u,i.firstBaseUpdate=f,i.lastBaseUpdate=h,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);rl|=o,e.lanes=o,e.memoizedState=E}}function V3(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],i=n.callback;if(i!==null){if(n.callback=null,n=r,typeof i!="function")throw Error(Ce(191,i));i.call(n)}}}var Rc={},Bi=vo(Rc),cc=vo(Rc),fc=vo(Rc);function Wo(e){if(e===Rc)throw Error(Ce(174));return e}function Wm(e,t){switch(Nt(fc,t),Nt(cc,e),Nt(Bi,Rc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:fv(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=fv(t,e)}Bt(Bi),Nt(Bi,t)}function ws(){Bt(Bi),Bt(cc),Bt(fc)}function Y6(e){Wo(fc.current);var t=Wo(Bi.current),r=fv(t,e.type);t!==r&&(Nt(cc,e),Nt(Bi,r))}function Km(e){cc.current===e&&(Bt(Bi),Bt(cc))}var Kt=vo(0);function Jd(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var T1=[];function Ym(){for(var e=0;e<T1.length;e++)T1[e]._workInProgressVersionPrimary=null;T1.length=0}var Pd=Sa.ReactCurrentDispatcher,A1=Sa.ReactCurrentBatchConfig,tl=0,Yt=null,cr=null,Sr=null,eh=!1,Vu=!1,dc=0,ux=0;function Fr(){throw Error(Ce(321))}function Xm(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!mi(e[r],t[r]))return!1;return!0}function Zm(e,t,r,n,i,a){if(tl=a,Yt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Pd.current=e===null||e.memoizedState===null?hx:px,e=r(n,i),Vu){a=0;do{if(Vu=!1,dc=0,25<=a)throw Error(Ce(301));a+=1,Sr=cr=null,t.updateQueue=null,Pd.current=gx,e=r(n,i)}while(Vu)}if(Pd.current=th,t=cr!==null&&cr.next!==null,tl=0,Sr=cr=Yt=null,eh=!1,t)throw Error(Ce(300));return e}function Qm(){var e=dc!==0;return dc=0,e}function Ni(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Sr===null?Yt.memoizedState=Sr=e:Sr=Sr.next=e,Sr}function Zn(){if(cr===null){var e=Yt.alternate;e=e!==null?e.memoizedState:null}else e=cr.next;var t=Sr===null?Yt.memoizedState:Sr.next;if(t!==null)Sr=t,cr=e;else{if(e===null)throw Error(Ce(310));cr=e,e={memoizedState:cr.memoizedState,baseState:cr.baseState,baseQueue:cr.baseQueue,queue:cr.queue,next:null},Sr===null?Yt.memoizedState=Sr=e:Sr=Sr.next=e}return Sr}function hc(e,t){return typeof t=="function"?t(e):t}function R1(e){var t=Zn(),r=t.queue;if(r===null)throw Error(Ce(311));r.lastRenderedReducer=e;var n=cr,i=n.baseQueue,a=r.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}n.baseQueue=i=a,r.pending=null}if(i!==null){a=i.next,n=n.baseState;var l=o=null,u=null,f=a;do{var h=f.lane;if((tl&h)===h)u!==null&&(u=u.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),n=f.hasEagerState?f.eagerState:e(n,f.action);else{var E={lane:h,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};u===null?(l=u=E,o=n):u=u.next=E,Yt.lanes|=h,rl|=h}f=f.next}while(f!==null&&f!==a);u===null?o=n:u.next=l,mi(n,t.memoizedState)||(cn=!0),t.memoizedState=n,t.baseState=o,t.baseQueue=u,r.lastRenderedState=n}if(e=r.interleaved,e!==null){i=e;do a=i.lane,Yt.lanes|=a,rl|=a,i=i.next;while(i!==e)}else i===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function M1(e){var t=Zn(),r=t.queue;if(r===null)throw Error(Ce(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,a=t.memoizedState;if(i!==null){r.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);mi(a,t.memoizedState)||(cn=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function X6(){}function Z6(e,t){var r=Yt,n=Zn(),i=t(),a=!mi(n.memoizedState,i);if(a&&(n.memoizedState=i,cn=!0),n=n.queue,Jm(ew.bind(null,r,n,e),[e]),n.getSnapshot!==t||a||Sr!==null&&Sr.memoizedState.tag&1){if(r.flags|=2048,pc(9,J6.bind(null,r,n,i,t),void 0,null),Er===null)throw Error(Ce(349));tl&30||Q6(r,t,i)}return i}function Q6(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Yt.updateQueue,t===null?(t={lastEffect:null,stores:null},Yt.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function J6(e,t,r,n){t.value=r,t.getSnapshot=n,tw(t)&&rw(e)}function ew(e,t,r){return r(function(){tw(t)&&rw(e)})}function tw(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!mi(e,r)}catch{return!0}}function rw(e){var t=ya(e,1);t!==null&&di(t,e,1,-1)}function q3(e){var t=Ni();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:hc,lastRenderedState:e},t.queue=e,e=e.dispatch=dx.bind(null,Yt,e),[t.memoizedState,e]}function pc(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=Yt.updateQueue,t===null?(t={lastEffect:null,stores:null},Yt.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function nw(){return Zn().memoizedState}function Cd(e,t,r,n){var i=Ni();Yt.flags|=e,i.memoizedState=pc(1|t,r,void 0,n===void 0?null:n)}function Mh(e,t,r,n){var i=Zn();n=n===void 0?null:n;var a=void 0;if(cr!==null){var o=cr.memoizedState;if(a=o.destroy,n!==null&&Xm(n,o.deps)){i.memoizedState=pc(t,r,a,n);return}}Yt.flags|=e,i.memoizedState=pc(1|t,r,a,n)}function W3(e,t){return Cd(8390656,8,e,t)}function Jm(e,t){return Mh(2048,8,e,t)}function iw(e,t){return Mh(4,2,e,t)}function aw(e,t){return Mh(4,4,e,t)}function ow(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function lw(e,t,r){return r=r!=null?r.concat([e]):null,Mh(4,4,ow.bind(null,t,e),r)}function ey(){}function sw(e,t){var r=Zn();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Xm(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function uw(e,t){var r=Zn();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Xm(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function cw(e,t,r){return tl&21?(mi(r,t)||(r=g6(),Yt.lanes|=r,rl|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,cn=!0),e.memoizedState=r)}function cx(e,t){var r=Pt;Pt=r!==0&&4>r?r:4,e(!0);var n=A1.transition;A1.transition={};try{e(!1),t()}finally{Pt=r,A1.transition=n}}function fw(){return Zn().memoizedState}function fx(e,t,r){var n=io(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},dw(e))hw(t,r);else if(r=W6(e,t,r,n),r!==null){var i=qr();di(r,e,n,i),pw(r,t,n)}}function dx(e,t,r){var n=io(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(dw(e))hw(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,l=a(o,r);if(i.hasEagerState=!0,i.eagerState=l,mi(l,o)){var u=t.interleaved;u===null?(i.next=i,Vm(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}r=W6(e,t,i,n),r!==null&&(i=qr(),di(r,e,n,i),pw(r,t,n))}}function dw(e){var t=e.alternate;return e===Yt||t!==null&&t===Yt}function hw(e,t){Vu=eh=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function pw(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Rm(e,r)}}var th={readContext:Xn,useCallback:Fr,useContext:Fr,useEffect:Fr,useImperativeHandle:Fr,useInsertionEffect:Fr,useLayoutEffect:Fr,useMemo:Fr,useReducer:Fr,useRef:Fr,useState:Fr,useDebugValue:Fr,useDeferredValue:Fr,useTransition:Fr,useMutableSource:Fr,useSyncExternalStore:Fr,useId:Fr,unstable_isNewReconciler:!1},hx={readContext:Xn,useCallback:function(e,t){return Ni().memoizedState=[e,t===void 0?null:t],e},useContext:Xn,useEffect:W3,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Cd(4194308,4,ow.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Cd(4194308,4,e,t)},useInsertionEffect:function(e,t){return Cd(4,2,e,t)},useMemo:function(e,t){var r=Ni();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Ni();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=fx.bind(null,Yt,e),[n.memoizedState,e]},useRef:function(e){var t=Ni();return e={current:e},t.memoizedState=e},useState:q3,useDebugValue:ey,useDeferredValue:function(e){return Ni().memoizedState=e},useTransition:function(){var e=q3(!1),t=e[0];return e=cx.bind(null,e[1]),Ni().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Yt,i=Ni();if(Gt){if(r===void 0)throw Error(Ce(407));r=r()}else{if(r=t(),Er===null)throw Error(Ce(349));tl&30||Q6(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,W3(ew.bind(null,n,a,e),[e]),n.flags|=2048,pc(9,J6.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=Ni(),t=Er.identifierPrefix;if(Gt){var r=ca,n=ua;r=(n&~(1<<32-fi(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=dc++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=ux++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},px={readContext:Xn,useCallback:sw,useContext:Xn,useEffect:Jm,useImperativeHandle:lw,useInsertionEffect:iw,useLayoutEffect:aw,useMemo:uw,useReducer:R1,useRef:nw,useState:function(){return R1(hc)},useDebugValue:ey,useDeferredValue:function(e){var t=Zn();return cw(t,cr.memoizedState,e)},useTransition:function(){var e=R1(hc)[0],t=Zn().memoizedState;return[e,t]},useMutableSource:X6,useSyncExternalStore:Z6,useId:fw,unstable_isNewReconciler:!1},gx={readContext:Xn,useCallback:sw,useContext:Xn,useEffect:Jm,useImperativeHandle:lw,useInsertionEffect:iw,useLayoutEffect:aw,useMemo:uw,useReducer:M1,useRef:nw,useState:function(){return M1(hc)},useDebugValue:ey,useDeferredValue:function(e){var t=Zn();return cr===null?t.memoizedState=e:cw(t,cr.memoizedState,e)},useTransition:function(){var e=M1(hc)[0],t=Zn().memoizedState;return[e,t]},useMutableSource:X6,useSyncExternalStore:Z6,useId:fw,unstable_isNewReconciler:!1};function si(e,t){if(e&&e.defaultProps){t=Xt({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Mv(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:Xt({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Lh={isMounted:function(e){return(e=e._reactInternals)?fl(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=qr(),i=io(e),a=fa(n,i);a.payload=t,r!=null&&(a.callback=r),t=ro(e,a,i),t!==null&&(di(t,e,i,n),xd(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=qr(),i=io(e),a=fa(n,i);a.tag=1,a.payload=t,r!=null&&(a.callback=r),t=ro(e,a,i),t!==null&&(di(t,e,i,n),xd(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=qr(),n=io(e),i=fa(r,n);i.tag=2,t!=null&&(i.callback=t),t=ro(e,i,n),t!==null&&(di(t,e,n,r),xd(t,e,n))}};function K3(e,t,r,n,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,a,o):t.prototype&&t.prototype.isPureReactComponent?!oc(r,n)||!oc(i,a):!0}function gw(e,t,r){var n=!1,i=uo,a=t.contextType;return typeof a=="object"&&a!==null?a=Xn(a):(i=pn(t)?Jo:Ur.current,n=t.contextTypes,a=(n=n!=null)?ys(e,i):uo),t=new t(r,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Lh,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Y3(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&Lh.enqueueReplaceState(t,t.state,null)}function Lv(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs={},qm(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=Xn(a):(a=pn(t)?Jo:Ur.current,i.context=ys(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(Mv(e,t,a,r),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Lh.enqueueReplaceState(i,i.state,null),Qd(e,r,i,n),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Ss(e,t){try{var r="",n=t;do r+=$E(n),n=n.return;while(n);var i=r}catch(a){i=`
31
+ Error generating stack: `+a.message+`
32
+ `+a.stack}return{value:e,source:t,stack:i,digest:null}}function L1(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Nv(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var vx=typeof WeakMap=="function"?WeakMap:Map;function vw(e,t,r){r=fa(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){nh||(nh=!0,Gv=n),Nv(e,t)},r}function mw(e,t,r){r=fa(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){Nv(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){Nv(e,t),typeof n!="function"&&(no===null?no=new Set([this]):no.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function X3(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new vx;var i=new Set;n.set(t,i)}else i=n.get(t),i===void 0&&(i=new Set,n.set(t,i));i.has(r)||(i.add(r),e=Ax.bind(null,e,t,r),t.then(e,e))}function Z3(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Q3(e,t,r,n,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=fa(-1,1),t.tag=2,ro(r,t,1))),r.lanes|=1),e)}var mx=Sa.ReactCurrentOwner,cn=!1;function Vr(e,t,r,n){t.child=e===null?q6(t,null,r,n):_s(t,e.child,r,n)}function J3(e,t,r,n,i){r=r.render;var a=t.ref;return ps(t,i),n=Zm(e,t,r,n,a,i),r=Qm(),e!==null&&!cn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ba(e,t,i)):(Gt&&r&&zm(t),t.flags|=1,Vr(e,t,n,i),t.child)}function e5(e,t,r,n,i){if(e===null){var a=r.type;return typeof a=="function"&&!sy(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,yw(e,t,a,n,i)):(e=Rd(r.type,null,n,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var o=a.memoizedProps;if(r=r.compare,r=r!==null?r:oc,r(o,n)&&e.ref===t.ref)return ba(e,t,i)}return t.flags|=1,e=ao(a,n),e.ref=t.ref,e.return=t,t.child=e}function yw(e,t,r,n,i){if(e!==null){var a=e.memoizedProps;if(oc(a,n)&&e.ref===t.ref)if(cn=!1,t.pendingProps=n=a,(e.lanes&i)!==0)e.flags&131072&&(cn=!0);else return t.lanes=e.lanes,ba(e,t,i)}return Iv(e,t,r,n,i)}function bw(e,t,r){var n=t.pendingProps,i=n.children,a=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Nt(os,Sn),Sn|=r;else{if(!(r&1073741824))return e=a!==null?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Nt(os,Sn),Sn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,Nt(os,Sn),Sn|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,Nt(os,Sn),Sn|=n;return Vr(e,t,i,r),t.child}function _w(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Iv(e,t,r,n,i){var a=pn(r)?Jo:Ur.current;return a=ys(t,a),ps(t,i),r=Zm(e,t,r,n,a,i),n=Qm(),e!==null&&!cn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ba(e,t,i)):(Gt&&n&&zm(t),t.flags|=1,Vr(e,t,r,i),t.child)}function t5(e,t,r,n,i){if(pn(r)){var a=!0;Wd(t)}else a=!1;if(ps(t,i),t.stateNode===null)kd(e,t),gw(t,r,n),Lv(t,r,n,i),n=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var u=o.context,f=r.contextType;typeof f=="object"&&f!==null?f=Xn(f):(f=pn(r)?Jo:Ur.current,f=ys(t,f));var h=r.getDerivedStateFromProps,E=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function";E||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||u!==f)&&Y3(t,o,n,f),Va=!1;var w=t.memoizedState;o.state=w,Qd(t,n,o,i),u=t.memoizedState,l!==n||w!==u||hn.current||Va?(typeof h=="function"&&(Mv(t,r,h,n),u=t.memoizedState),(l=Va||K3(t,r,l,n,w,u,f))?(E||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=u),o.props=n,o.state=u,o.context=f,n=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,K6(e,t),l=t.memoizedProps,f=t.type===t.elementType?l:si(t.type,l),o.props=f,E=t.pendingProps,w=o.context,u=r.contextType,typeof u=="object"&&u!==null?u=Xn(u):(u=pn(r)?Jo:Ur.current,u=ys(t,u));var p=r.getDerivedStateFromProps;(h=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==E||w!==u)&&Y3(t,o,n,u),Va=!1,w=t.memoizedState,o.state=w,Qd(t,n,o,i);var S=t.memoizedState;l!==E||w!==S||hn.current||Va?(typeof p=="function"&&(Mv(t,r,p,n),S=t.memoizedState),(f=Va||K3(t,r,f,n,w,S,u)||!1)?(h||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,S,u),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,S,u)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&w===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&w===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=S),o.props=n,o.state=S,o.context=u,n=f):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&w===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&w===e.memoizedState||(t.flags|=1024),n=!1)}return Dv(e,t,r,n,a,i)}function Dv(e,t,r,n,i,a){_w(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return i&&B3(t,r,!1),ba(e,t,a);n=t.stateNode,mx.current=t;var l=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=_s(t,e.child,null,a),t.child=_s(t,null,l,a)):Vr(e,t,l,a),t.memoizedState=n.state,i&&B3(t,r,!0),t.child}function ww(e){var t=e.stateNode;t.pendingContext?z3(e,t.pendingContext,t.pendingContext!==t.context):t.context&&z3(e,t.context,!1),Wm(e,t.containerInfo)}function r5(e,t,r,n,i){return bs(),Um(i),t.flags|=256,Vr(e,t,r,n),t.child}var jv={dehydrated:null,treeContext:null,retryLane:0};function Fv(e){return{baseLanes:e,cachePool:null,transitions:null}}function Sw(e,t,r){var n=t.pendingProps,i=Kt.current,a=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Nt(Kt,i&1),e===null)return Av(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=n.children,e=n.fallback,a?(n=t.mode,a=t.child,o={mode:"hidden",children:o},!(n&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=Dh(o,n,0,null),e=Xo(e,n,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Fv(r),t.memoizedState=jv,e):ty(t,o));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return yx(e,t,o,n,l,i,r);if(a){a=n.fallback,o=t.mode,i=e.child,l=i.sibling;var u={mode:"hidden",children:n.children};return!(o&1)&&t.child!==i?(n=t.child,n.childLanes=0,n.pendingProps=u,t.deletions=null):(n=ao(i,u),n.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=ao(l,a):(a=Xo(a,o,r,null),a.flags|=2),a.return=t,n.return=t,n.sibling=a,t.child=n,n=a,a=t.child,o=e.child.memoizedState,o=o===null?Fv(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~r,t.memoizedState=jv,n}return a=e.child,e=a.sibling,n=ao(a,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function ty(e,t){return t=Dh({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function nd(e,t,r,n){return n!==null&&Um(n),_s(t,e.child,null,r),e=ty(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function yx(e,t,r,n,i,a,o){if(r)return t.flags&256?(t.flags&=-257,n=L1(Error(Ce(422))),nd(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,i=t.mode,n=Dh({mode:"visible",children:n.children},i,0,null),a=Xo(a,i,o,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,t.mode&1&&_s(t,e.child,null,o),t.child.memoizedState=Fv(o),t.memoizedState=jv,a);if(!(t.mode&1))return nd(e,t,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var l=n.dgst;return n=l,a=Error(Ce(419)),n=L1(a,n,void 0),nd(e,t,o,n)}if(l=(o&e.childLanes)!==0,cn||l){if(n=Er,n!==null){switch(o&-o){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|o)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,ya(e,i),di(n,e,i,-1))}return ly(),n=L1(Error(Ce(421))),nd(e,t,o,n)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=Rx.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,On=to(i.nextSibling),xn=t,Gt=!0,ci=null,e!==null&&($n[Gn++]=ua,$n[Gn++]=ca,$n[Gn++]=el,ua=e.id,ca=e.overflow,el=t),t=ty(t,n.children),t.flags|=4096,t)}function n5(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Rv(e.return,t,r)}function N1(e,t,r,n,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=r,a.tailMode=i)}function Ew(e,t,r){var n=t.pendingProps,i=n.revealOrder,a=n.tail;if(Vr(e,t,n.children,r),n=Kt.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&n5(e,r,t);else if(e.tag===19)n5(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Nt(Kt,n),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;r!==null;)e=r.alternate,e!==null&&Jd(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),N1(t,!1,i,r,a);break;case"backwards":for(r=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Jd(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}N1(t,!0,r,null,a);break;case"together":N1(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function kd(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ba(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),rl|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Ce(153));if(t.child!==null){for(e=t.child,r=ao(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=ao(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function bx(e,t,r){switch(t.tag){case 3:ww(t),bs();break;case 5:Y6(t);break;case 1:pn(t.type)&&Wd(t);break;case 4:Wm(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;Nt(Xd,n._currentValue),n._currentValue=i;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Nt(Kt,Kt.current&1),t.flags|=128,null):r&t.child.childLanes?Sw(e,t,r):(Nt(Kt,Kt.current&1),e=ba(e,t,r),e!==null?e.sibling:null);Nt(Kt,Kt.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return Ew(e,t,r);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Nt(Kt,Kt.current),n)break;return null;case 22:case 23:return t.lanes=0,bw(e,t,r)}return ba(e,t,r)}var Ow,zv,xw,Pw;Ow=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};zv=function(){};xw=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,Wo(Bi.current);var a=null;switch(r){case"input":i=lv(e,i),n=lv(e,n),a=[];break;case"select":i=Xt({},i,{value:void 0}),n=Xt({},n,{value:void 0}),a=[];break;case"textarea":i=cv(e,i),n=cv(e,n),a=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Vd)}dv(r,n);var o;r=null;for(f in i)if(!n.hasOwnProperty(f)&&i.hasOwnProperty(f)&&i[f]!=null)if(f==="style"){var l=i[f];for(o in l)l.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else f!=="dangerouslySetInnerHTML"&&f!=="children"&&f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(Ju.hasOwnProperty(f)?a||(a=[]):(a=a||[]).push(f,null));for(f in n){var u=n[f];if(l=i!=null?i[f]:void 0,n.hasOwnProperty(f)&&u!==l&&(u!=null||l!=null))if(f==="style")if(l){for(o in l)!l.hasOwnProperty(o)||u&&u.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in u)u.hasOwnProperty(o)&&l[o]!==u[o]&&(r||(r={}),r[o]=u[o])}else r||(a||(a=[]),a.push(f,r)),r=u;else f==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,l=l?l.__html:void 0,u!=null&&l!==u&&(a=a||[]).push(f,u)):f==="children"?typeof u!="string"&&typeof u!="number"||(a=a||[]).push(f,""+u):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(Ju.hasOwnProperty(f)?(u!=null&&f==="onScroll"&&zt("scroll",e),a||l===u||(a=[])):(a=a||[]).push(f,u))}r&&(a=a||[]).push("style",r);var f=a;(t.updateQueue=f)&&(t.flags|=4)}};Pw=function(e,t,r,n){r!==n&&(t.flags|=4)};function ku(e,t){if(!Gt)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function zr(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function _x(e,t,r){var n=t.pendingProps;switch(Bm(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zr(t),null;case 1:return pn(t.type)&&qd(),zr(t),null;case 3:return n=t.stateNode,ws(),Bt(hn),Bt(Ur),Ym(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(td(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ci!==null&&(Wv(ci),ci=null))),zv(e,t),zr(t),null;case 5:Km(t);var i=Wo(fc.current);if(r=t.type,e!==null&&t.stateNode!=null)xw(e,t,r,n,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(Ce(166));return zr(t),null}if(e=Wo(Bi.current),td(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[Ii]=t,n[uc]=a,e=(t.mode&1)!==0,r){case"dialog":zt("cancel",n),zt("close",n);break;case"iframe":case"object":case"embed":zt("load",n);break;case"video":case"audio":for(i=0;i<ju.length;i++)zt(ju[i],n);break;case"source":zt("error",n);break;case"img":case"image":case"link":zt("error",n),zt("load",n);break;case"details":zt("toggle",n);break;case"input":d3(n,a),zt("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},zt("invalid",n);break;case"textarea":p3(n,a),zt("invalid",n)}dv(r,a),i=null;for(var o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="children"?typeof l=="string"?n.textContent!==l&&(a.suppressHydrationWarning!==!0&&ed(n.textContent,l,e),i=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&ed(n.textContent,l,e),i=["children",""+l]):Ju.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&zt("scroll",n)}switch(r){case"input":qf(n),h3(n,a,!0);break;case"textarea":qf(n),g3(n);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(n.onclick=Vd)}n=i,t.updateQueue=n,n!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=e6(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[Ii]=t,e[uc]=n,Ow(e,t,!1,!1),t.stateNode=e;e:{switch(o=hv(r,n),r){case"dialog":zt("cancel",e),zt("close",e),i=n;break;case"iframe":case"object":case"embed":zt("load",e),i=n;break;case"video":case"audio":for(i=0;i<ju.length;i++)zt(ju[i],e);i=n;break;case"source":zt("error",e),i=n;break;case"img":case"image":case"link":zt("error",e),zt("load",e),i=n;break;case"details":zt("toggle",e),i=n;break;case"input":d3(e,n),i=lv(e,n),zt("invalid",e);break;case"option":i=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},i=Xt({},n,{value:void 0}),zt("invalid",e);break;case"textarea":p3(e,n),i=cv(e,n),zt("invalid",e);break;default:i=n}dv(r,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var u=l[a];a==="style"?n6(e,u):a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&t6(e,u)):a==="children"?typeof u=="string"?(r!=="textarea"||u!=="")&&ec(e,u):typeof u=="number"&&ec(e,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Ju.hasOwnProperty(a)?u!=null&&a==="onScroll"&&zt("scroll",e):u!=null&&xm(e,a,u,o))}switch(r){case"input":qf(e),h3(e,n,!1);break;case"textarea":qf(e),g3(e);break;case"option":n.value!=null&&e.setAttribute("value",""+so(n.value));break;case"select":e.multiple=!!n.multiple,a=n.value,a!=null?cs(e,!!n.multiple,a,!1):n.defaultValue!=null&&cs(e,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Vd)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return zr(t),null;case 6:if(e&&t.stateNode!=null)Pw(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(Ce(166));if(r=Wo(fc.current),Wo(Bi.current),td(t)){if(n=t.stateNode,r=t.memoizedProps,n[Ii]=t,(a=n.nodeValue!==r)&&(e=xn,e!==null))switch(e.tag){case 3:ed(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ed(n.nodeValue,r,(e.mode&1)!==0)}a&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Ii]=t,t.stateNode=n}return zr(t),null;case 13:if(Bt(Kt),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Gt&&On!==null&&t.mode&1&&!(t.flags&128))G6(),bs(),t.flags|=98560,a=!1;else if(a=td(t),n!==null&&n.dehydrated!==null){if(e===null){if(!a)throw Error(Ce(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(Ce(317));a[Ii]=t}else bs(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;zr(t),a=!1}else ci!==null&&(Wv(ci),ci=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||Kt.current&1?dr===0&&(dr=3):ly())),t.updateQueue!==null&&(t.flags|=4),zr(t),null);case 4:return ws(),zv(e,t),e===null&&lc(t.stateNode.containerInfo),zr(t),null;case 10:return Gm(t.type._context),zr(t),null;case 17:return pn(t.type)&&qd(),zr(t),null;case 19:if(Bt(Kt),a=t.memoizedState,a===null)return zr(t),null;if(n=(t.flags&128)!==0,o=a.rendering,o===null)if(n)ku(a,!1);else{if(dr!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Jd(e),o!==null){for(t.flags|=128,ku(a,!1),n=o.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)a=r,e=n,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Nt(Kt,Kt.current&1|2),t.child}e=e.sibling}a.tail!==null&&rr()>Es&&(t.flags|=128,n=!0,ku(a,!1),t.lanes=4194304)}else{if(!n)if(e=Jd(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),ku(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Gt)return zr(t),null}else 2*rr()-a.renderingStartTime>Es&&r!==1073741824&&(t.flags|=128,n=!0,ku(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(r=a.last,r!==null?r.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=rr(),t.sibling=null,r=Kt.current,Nt(Kt,n?r&1|2:r&1),t):(zr(t),null);case 22:case 23:return oy(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Sn&1073741824&&(zr(t),t.subtreeFlags&6&&(t.flags|=8192)):zr(t),null;case 24:return null;case 25:return null}throw Error(Ce(156,t.tag))}function wx(e,t){switch(Bm(t),t.tag){case 1:return pn(t.type)&&qd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ws(),Bt(hn),Bt(Ur),Ym(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Km(t),null;case 13:if(Bt(Kt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Ce(340));bs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Bt(Kt),null;case 4:return ws(),null;case 10:return Gm(t.type._context),null;case 22:case 23:return oy(),null;case 24:return null;default:return null}}var id=!1,Br=!1,Sx=typeof WeakSet=="function"?WeakSet:Set,Ue=null;function as(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Qt(e,t,n)}else r.current=null}function Bv(e,t,r){try{r()}catch(n){Qt(e,t,n)}}var i5=!1;function Ex(e,t){if(Ev=Hd,e=R6(),Fm(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,l=-1,u=-1,f=0,h=0,E=e,w=null;t:for(;;){for(var p;E!==r||i!==0&&E.nodeType!==3||(l=o+i),E!==a||n!==0&&E.nodeType!==3||(u=o+n),E.nodeType===3&&(o+=E.nodeValue.length),(p=E.firstChild)!==null;)w=E,E=p;for(;;){if(E===e)break t;if(w===r&&++f===i&&(l=o),w===a&&++h===n&&(u=o),(p=E.nextSibling)!==null)break;E=w,w=E.parentNode}E=p}r=l===-1||u===-1?null:{start:l,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(Ov={focusedElem:e,selectionRange:r},Hd=!1,Ue=t;Ue!==null;)if(t=Ue,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ue=e;else for(;Ue!==null;){t=Ue;try{var S=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(S!==null){var b=S.memoizedProps,y=S.memoizedState,v=t.stateNode,m=v.getSnapshotBeforeUpdate(t.elementType===t.type?b:si(t.type,b),y);v.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ce(163))}}catch(g){Qt(t,t.return,g)}if(e=t.sibling,e!==null){e.return=t.return,Ue=e;break}Ue=t.return}return S=i5,i5=!1,S}function qu(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Bv(t,r,a)}i=i.next}while(i!==n)}}function Nh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Uv(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function Cw(e){var t=e.alternate;t!==null&&(e.alternate=null,Cw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ii],delete t[uc],delete t[Cv],delete t[ax],delete t[ox])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function kw(e){return e.tag===5||e.tag===3||e.tag===4}function a5(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||kw(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Hv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Vd));else if(n!==4&&(e=e.child,e!==null))for(Hv(e,t,r),e=e.sibling;e!==null;)Hv(e,t,r),e=e.sibling}function $v(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for($v(e,t,r),e=e.sibling;e!==null;)$v(e,t,r),e=e.sibling}var kr=null,ui=!1;function Ua(e,t,r){for(r=r.child;r!==null;)Tw(e,t,r),r=r.sibling}function Tw(e,t,r){if(zi&&typeof zi.onCommitFiberUnmount=="function")try{zi.onCommitFiberUnmount(Ph,r)}catch{}switch(r.tag){case 5:Br||as(r,t);case 6:var n=kr,i=ui;kr=null,Ua(e,t,r),kr=n,ui=i,kr!==null&&(ui?(e=kr,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):kr.removeChild(r.stateNode));break;case 18:kr!==null&&(ui?(e=kr,r=r.stateNode,e.nodeType===8?C1(e.parentNode,r):e.nodeType===1&&C1(e,r),ic(e)):C1(kr,r.stateNode));break;case 4:n=kr,i=ui,kr=r.stateNode.containerInfo,ui=!0,Ua(e,t,r),kr=n,ui=i;break;case 0:case 11:case 14:case 15:if(!Br&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Bv(r,t,o),i=i.next}while(i!==n)}Ua(e,t,r);break;case 1:if(!Br&&(as(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){Qt(r,t,l)}Ua(e,t,r);break;case 21:Ua(e,t,r);break;case 22:r.mode&1?(Br=(n=Br)||r.memoizedState!==null,Ua(e,t,r),Br=n):Ua(e,t,r);break;default:Ua(e,t,r)}}function o5(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Sx),t.forEach(function(n){var i=Mx.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function ai(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var i=r[n];try{var a=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:kr=l.stateNode,ui=!1;break e;case 3:kr=l.stateNode.containerInfo,ui=!0;break e;case 4:kr=l.stateNode.containerInfo,ui=!0;break e}l=l.return}if(kr===null)throw Error(Ce(160));Tw(a,o,i),kr=null,ui=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(f){Qt(i,t,f)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Aw(t,e),t=t.sibling}function Aw(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ai(t,e),Mi(e),n&4){try{qu(3,e,e.return),Nh(3,e)}catch(b){Qt(e,e.return,b)}try{qu(5,e,e.return)}catch(b){Qt(e,e.return,b)}}break;case 1:ai(t,e),Mi(e),n&512&&r!==null&&as(r,r.return);break;case 5:if(ai(t,e),Mi(e),n&512&&r!==null&&as(r,r.return),e.flags&32){var i=e.stateNode;try{ec(i,"")}catch(b){Qt(e,e.return,b)}}if(n&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,o=r!==null?r.memoizedProps:a,l=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&Q_(i,a),hv(l,o);var f=hv(l,a);for(o=0;o<u.length;o+=2){var h=u[o],E=u[o+1];h==="style"?n6(i,E):h==="dangerouslySetInnerHTML"?t6(i,E):h==="children"?ec(i,E):xm(i,h,E,f)}switch(l){case"input":sv(i,a);break;case"textarea":J_(i,a);break;case"select":var w=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var p=a.value;p!=null?cs(i,!!a.multiple,p,!1):w!==!!a.multiple&&(a.defaultValue!=null?cs(i,!!a.multiple,a.defaultValue,!0):cs(i,!!a.multiple,a.multiple?[]:"",!1))}i[uc]=a}catch(b){Qt(e,e.return,b)}}break;case 6:if(ai(t,e),Mi(e),n&4){if(e.stateNode===null)throw Error(Ce(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(b){Qt(e,e.return,b)}}break;case 3:if(ai(t,e),Mi(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{ic(t.containerInfo)}catch(b){Qt(e,e.return,b)}break;case 4:ai(t,e),Mi(e);break;case 13:ai(t,e),Mi(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(iy=rr())),n&4&&o5(e);break;case 22:if(h=r!==null&&r.memoizedState!==null,e.mode&1?(Br=(f=Br)||h,ai(t,e),Br=f):ai(t,e),Mi(e),n&8192){if(f=e.memoizedState!==null,(e.stateNode.isHidden=f)&&!h&&e.mode&1)for(Ue=e,h=e.child;h!==null;){for(E=Ue=h;Ue!==null;){switch(w=Ue,p=w.child,w.tag){case 0:case 11:case 14:case 15:qu(4,w,w.return);break;case 1:as(w,w.return);var S=w.stateNode;if(typeof S.componentWillUnmount=="function"){n=w,r=w.return;try{t=n,S.props=t.memoizedProps,S.state=t.memoizedState,S.componentWillUnmount()}catch(b){Qt(n,r,b)}}break;case 5:as(w,w.return);break;case 22:if(w.memoizedState!==null){s5(E);continue}}p!==null?(p.return=w,Ue=p):s5(E)}h=h.sibling}e:for(h=null,E=e;;){if(E.tag===5){if(h===null){h=E;try{i=E.stateNode,f?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=E.stateNode,u=E.memoizedProps.style,o=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=r6("display",o))}catch(b){Qt(e,e.return,b)}}}else if(E.tag===6){if(h===null)try{E.stateNode.nodeValue=f?"":E.memoizedProps}catch(b){Qt(e,e.return,b)}}else if((E.tag!==22&&E.tag!==23||E.memoizedState===null||E===e)&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===e)break e;for(;E.sibling===null;){if(E.return===null||E.return===e)break e;h===E&&(h=null),E=E.return}h===E&&(h=null),E.sibling.return=E.return,E=E.sibling}}break;case 19:ai(t,e),Mi(e),n&4&&o5(e);break;case 21:break;default:ai(t,e),Mi(e)}}function Mi(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(kw(r)){var n=r;break e}r=r.return}throw Error(Ce(160))}switch(n.tag){case 5:var i=n.stateNode;n.flags&32&&(ec(i,""),n.flags&=-33);var a=a5(e);$v(e,a,i);break;case 3:case 4:var o=n.stateNode.containerInfo,l=a5(e);Hv(e,l,o);break;default:throw Error(Ce(161))}}catch(u){Qt(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ox(e,t,r){Ue=e,Rw(e)}function Rw(e,t,r){for(var n=(e.mode&1)!==0;Ue!==null;){var i=Ue,a=i.child;if(i.tag===22&&n){var o=i.memoizedState!==null||id;if(!o){var l=i.alternate,u=l!==null&&l.memoizedState!==null||Br;l=id;var f=Br;if(id=o,(Br=u)&&!f)for(Ue=i;Ue!==null;)o=Ue,u=o.child,o.tag===22&&o.memoizedState!==null?u5(i):u!==null?(u.return=o,Ue=u):u5(i);for(;a!==null;)Ue=a,Rw(a),a=a.sibling;Ue=i,id=l,Br=f}l5(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,Ue=a):l5(e)}}function l5(e){for(;Ue!==null;){var t=Ue;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Br||Nh(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!Br)if(r===null)n.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:si(t.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&V3(t,a,n);break;case 3:var o=t.updateQueue;if(o!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}V3(t,o,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&r.focus();break;case"img":u.src&&(r.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var f=t.alternate;if(f!==null){var h=f.memoizedState;if(h!==null){var E=h.dehydrated;E!==null&&ic(E)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Ce(163))}Br||t.flags&512&&Uv(t)}catch(w){Qt(t,t.return,w)}}if(t===e){Ue=null;break}if(r=t.sibling,r!==null){r.return=t.return,Ue=r;break}Ue=t.return}}function s5(e){for(;Ue!==null;){var t=Ue;if(t===e){Ue=null;break}var r=t.sibling;if(r!==null){r.return=t.return,Ue=r;break}Ue=t.return}}function u5(e){for(;Ue!==null;){var t=Ue;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Nh(4,t)}catch(u){Qt(t,r,u)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var i=t.return;try{n.componentDidMount()}catch(u){Qt(t,i,u)}}var a=t.return;try{Uv(t)}catch(u){Qt(t,a,u)}break;case 5:var o=t.return;try{Uv(t)}catch(u){Qt(t,o,u)}}}catch(u){Qt(t,t.return,u)}if(t===e){Ue=null;break}var l=t.sibling;if(l!==null){l.return=t.return,Ue=l;break}Ue=t.return}}var xx=Math.ceil,rh=Sa.ReactCurrentDispatcher,ry=Sa.ReactCurrentOwner,Kn=Sa.ReactCurrentBatchConfig,mt=0,Er=null,ar=null,Ar=0,Sn=0,os=vo(0),dr=0,gc=null,rl=0,Ih=0,ny=0,Wu=null,un=null,iy=0,Es=1/0,oa=null,nh=!1,Gv=null,no=null,ad=!1,Xa=null,ih=0,Ku=0,Vv=null,Td=-1,Ad=0;function qr(){return mt&6?rr():Td!==-1?Td:Td=rr()}function io(e){return e.mode&1?mt&2&&Ar!==0?Ar&-Ar:sx.transition!==null?(Ad===0&&(Ad=g6()),Ad):(e=Pt,e!==0||(e=window.event,e=e===void 0?16:S6(e.type)),e):1}function di(e,t,r,n){if(50<Ku)throw Ku=0,Vv=null,Error(Ce(185));kc(e,r,n),(!(mt&2)||e!==Er)&&(e===Er&&(!(mt&2)&&(Ih|=r),dr===4&&Wa(e,Ar)),gn(e,n),r===1&&mt===0&&!(t.mode&1)&&(Es=rr()+500,Rh&&mo()))}function gn(e,t){var r=e.callbackNode;sO(e,t);var n=Ud(e,e===Er?Ar:0);if(n===0)r!==null&&y3(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&y3(r),t===1)e.tag===0?lx(c5.bind(null,e)):U6(c5.bind(null,e)),nx(function(){!(mt&6)&&mo()}),r=null;else{switch(v6(n)){case 1:r=Am;break;case 4:r=h6;break;case 16:r=Bd;break;case 536870912:r=p6;break;default:r=Bd}r=zw(r,Mw.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Mw(e,t){if(Td=-1,Ad=0,mt&6)throw Error(Ce(327));var r=e.callbackNode;if(gs()&&e.callbackNode!==r)return null;var n=Ud(e,e===Er?Ar:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=ah(e,n);else{t=n;var i=mt;mt|=2;var a=Nw();(Er!==e||Ar!==t)&&(oa=null,Es=rr()+500,Yo(e,t));do try{kx();break}catch(l){Lw(e,l)}while(!0);$m(),rh.current=a,mt=i,ar!==null?t=0:(Er=null,Ar=0,t=dr)}if(t!==0){if(t===2&&(i=yv(e),i!==0&&(n=i,t=qv(e,i))),t===1)throw r=gc,Yo(e,0),Wa(e,n),gn(e,rr()),r;if(t===6)Wa(e,n);else{if(i=e.current.alternate,!(n&30)&&!Px(i)&&(t=ah(e,n),t===2&&(a=yv(e),a!==0&&(n=a,t=qv(e,a))),t===1))throw r=gc,Yo(e,0),Wa(e,n),gn(e,rr()),r;switch(e.finishedWork=i,e.finishedLanes=n,t){case 0:case 1:throw Error(Ce(345));case 2:Go(e,un,oa);break;case 3:if(Wa(e,n),(n&130023424)===n&&(t=iy+500-rr(),10<t)){if(Ud(e,0)!==0)break;if(i=e.suspendedLanes,(i&n)!==n){qr(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Pv(Go.bind(null,e,un,oa),t);break}Go(e,un,oa);break;case 4:if(Wa(e,n),(n&4194240)===n)break;for(t=e.eventTimes,i=-1;0<n;){var o=31-fi(n);a=1<<o,o=t[o],o>i&&(i=o),n&=~a}if(n=i,n=rr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*xx(n/1960))-n,10<n){e.timeoutHandle=Pv(Go.bind(null,e,un,oa),n);break}Go(e,un,oa);break;case 5:Go(e,un,oa);break;default:throw Error(Ce(329))}}}return gn(e,rr()),e.callbackNode===r?Mw.bind(null,e):null}function qv(e,t){var r=Wu;return e.current.memoizedState.isDehydrated&&(Yo(e,t).flags|=256),e=ah(e,t),e!==2&&(t=un,un=r,t!==null&&Wv(t)),e}function Wv(e){un===null?un=e:un.push.apply(un,e)}function Px(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var i=r[n],a=i.getSnapshot;i=i.value;try{if(!mi(a(),i))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Wa(e,t){for(t&=~ny,t&=~Ih,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-fi(t),n=1<<r;e[r]=-1,t&=~n}}function c5(e){if(mt&6)throw Error(Ce(327));gs();var t=Ud(e,0);if(!(t&1))return gn(e,rr()),null;var r=ah(e,t);if(e.tag!==0&&r===2){var n=yv(e);n!==0&&(t=n,r=qv(e,n))}if(r===1)throw r=gc,Yo(e,0),Wa(e,t),gn(e,rr()),r;if(r===6)throw Error(Ce(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Go(e,un,oa),gn(e,rr()),null}function ay(e,t){var r=mt;mt|=1;try{return e(t)}finally{mt=r,mt===0&&(Es=rr()+500,Rh&&mo())}}function nl(e){Xa!==null&&Xa.tag===0&&!(mt&6)&&gs();var t=mt;mt|=1;var r=Kn.transition,n=Pt;try{if(Kn.transition=null,Pt=1,e)return e()}finally{Pt=n,Kn.transition=r,mt=t,!(mt&6)&&mo()}}function oy(){Sn=os.current,Bt(os)}function Yo(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,rx(r)),ar!==null)for(r=ar.return;r!==null;){var n=r;switch(Bm(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&qd();break;case 3:ws(),Bt(hn),Bt(Ur),Ym();break;case 5:Km(n);break;case 4:ws();break;case 13:Bt(Kt);break;case 19:Bt(Kt);break;case 10:Gm(n.type._context);break;case 22:case 23:oy()}r=r.return}if(Er=e,ar=e=ao(e.current,null),Ar=Sn=t,dr=0,gc=null,ny=Ih=rl=0,un=Wu=null,qo!==null){for(t=0;t<qo.length;t++)if(r=qo[t],n=r.interleaved,n!==null){r.interleaved=null;var i=n.next,a=r.pending;if(a!==null){var o=a.next;a.next=i,n.next=o}r.pending=n}qo=null}return e}function Lw(e,t){do{var r=ar;try{if($m(),Pd.current=th,eh){for(var n=Yt.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}eh=!1}if(tl=0,Sr=cr=Yt=null,Vu=!1,dc=0,ry.current=null,r===null||r.return===null){dr=1,gc=t,ar=null;break}e:{var a=e,o=r.return,l=r,u=t;if(t=Ar,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var f=u,h=l,E=h.tag;if(!(h.mode&1)&&(E===0||E===11||E===15)){var w=h.alternate;w?(h.updateQueue=w.updateQueue,h.memoizedState=w.memoizedState,h.lanes=w.lanes):(h.updateQueue=null,h.memoizedState=null)}var p=Z3(o);if(p!==null){p.flags&=-257,Q3(p,o,l,a,t),p.mode&1&&X3(a,f,t),t=p,u=f;var S=t.updateQueue;if(S===null){var b=new Set;b.add(u),t.updateQueue=b}else S.add(u);break e}else{if(!(t&1)){X3(a,f,t),ly();break e}u=Error(Ce(426))}}else if(Gt&&l.mode&1){var y=Z3(o);if(y!==null){!(y.flags&65536)&&(y.flags|=256),Q3(y,o,l,a,t),Um(Ss(u,l));break e}}a=u=Ss(u,l),dr!==4&&(dr=2),Wu===null?Wu=[a]:Wu.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var v=vw(a,u,t);G3(a,v);break e;case 1:l=u;var m=a.type,d=a.stateNode;if(!(a.flags&128)&&(typeof m.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(no===null||!no.has(d)))){a.flags|=65536,t&=-t,a.lanes|=t;var g=mw(a,l,t);G3(a,g);break e}}a=a.return}while(a!==null)}Dw(r)}catch(_){t=_,ar===r&&r!==null&&(ar=r=r.return);continue}break}while(!0)}function Nw(){var e=rh.current;return rh.current=th,e===null?th:e}function ly(){(dr===0||dr===3||dr===2)&&(dr=4),Er===null||!(rl&268435455)&&!(Ih&268435455)||Wa(Er,Ar)}function ah(e,t){var r=mt;mt|=2;var n=Nw();(Er!==e||Ar!==t)&&(oa=null,Yo(e,t));do try{Cx();break}catch(i){Lw(e,i)}while(!0);if($m(),mt=r,rh.current=n,ar!==null)throw Error(Ce(261));return Er=null,Ar=0,dr}function Cx(){for(;ar!==null;)Iw(ar)}function kx(){for(;ar!==null&&!JE();)Iw(ar)}function Iw(e){var t=Fw(e.alternate,e,Sn);e.memoizedProps=e.pendingProps,t===null?Dw(e):ar=t,ry.current=null}function Dw(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=wx(r,t),r!==null){r.flags&=32767,ar=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{dr=6,ar=null;return}}else if(r=_x(r,t,Sn),r!==null){ar=r;return}if(t=t.sibling,t!==null){ar=t;return}ar=t=e}while(t!==null);dr===0&&(dr=5)}function Go(e,t,r){var n=Pt,i=Kn.transition;try{Kn.transition=null,Pt=1,Tx(e,t,r,n)}finally{Kn.transition=i,Pt=n}return null}function Tx(e,t,r,n){do gs();while(Xa!==null);if(mt&6)throw Error(Ce(327));r=e.finishedWork;var i=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(Ce(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(uO(e,a),e===Er&&(ar=Er=null,Ar=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||ad||(ad=!0,zw(Bd,function(){return gs(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=Kn.transition,Kn.transition=null;var o=Pt;Pt=1;var l=mt;mt|=4,ry.current=null,Ex(e,r),Aw(r,e),YO(Ov),Hd=!!Ev,Ov=Ev=null,e.current=r,Ox(r),eO(),mt=l,Pt=o,Kn.transition=a}else e.current=r;if(ad&&(ad=!1,Xa=e,ih=i),a=e.pendingLanes,a===0&&(no=null),nO(r.stateNode),gn(e,rr()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)i=t[r],n(i.value,{componentStack:i.stack,digest:i.digest});if(nh)throw nh=!1,e=Gv,Gv=null,e;return ih&1&&e.tag!==0&&gs(),a=e.pendingLanes,a&1?e===Vv?Ku++:(Ku=0,Vv=e):Ku=0,mo(),null}function gs(){if(Xa!==null){var e=v6(ih),t=Kn.transition,r=Pt;try{if(Kn.transition=null,Pt=16>e?16:e,Xa===null)var n=!1;else{if(e=Xa,Xa=null,ih=0,mt&6)throw Error(Ce(331));var i=mt;for(mt|=4,Ue=e.current;Ue!==null;){var a=Ue,o=a.child;if(Ue.flags&16){var l=a.deletions;if(l!==null){for(var u=0;u<l.length;u++){var f=l[u];for(Ue=f;Ue!==null;){var h=Ue;switch(h.tag){case 0:case 11:case 15:qu(8,h,a)}var E=h.child;if(E!==null)E.return=h,Ue=E;else for(;Ue!==null;){h=Ue;var w=h.sibling,p=h.return;if(Cw(h),h===f){Ue=null;break}if(w!==null){w.return=p,Ue=w;break}Ue=p}}}var S=a.alternate;if(S!==null){var b=S.child;if(b!==null){S.child=null;do{var y=b.sibling;b.sibling=null,b=y}while(b!==null)}}Ue=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,Ue=o;else e:for(;Ue!==null;){if(a=Ue,a.flags&2048)switch(a.tag){case 0:case 11:case 15:qu(9,a,a.return)}var v=a.sibling;if(v!==null){v.return=a.return,Ue=v;break e}Ue=a.return}}var m=e.current;for(Ue=m;Ue!==null;){o=Ue;var d=o.child;if(o.subtreeFlags&2064&&d!==null)d.return=o,Ue=d;else e:for(o=m;Ue!==null;){if(l=Ue,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Nh(9,l)}}catch(_){Qt(l,l.return,_)}if(l===o){Ue=null;break e}var g=l.sibling;if(g!==null){g.return=l.return,Ue=g;break e}Ue=l.return}}if(mt=i,mo(),zi&&typeof zi.onPostCommitFiberRoot=="function")try{zi.onPostCommitFiberRoot(Ph,e)}catch{}n=!0}return n}finally{Pt=r,Kn.transition=t}}return!1}function f5(e,t,r){t=Ss(r,t),t=vw(e,t,1),e=ro(e,t,1),t=qr(),e!==null&&(kc(e,1,t),gn(e,t))}function Qt(e,t,r){if(e.tag===3)f5(e,e,r);else for(;t!==null;){if(t.tag===3){f5(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(no===null||!no.has(n))){e=Ss(r,e),e=mw(t,e,1),t=ro(t,e,1),e=qr(),t!==null&&(kc(t,1,e),gn(t,e));break}}t=t.return}}function Ax(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=qr(),e.pingedLanes|=e.suspendedLanes&r,Er===e&&(Ar&r)===r&&(dr===4||dr===3&&(Ar&130023424)===Ar&&500>rr()-iy?Yo(e,0):ny|=r),gn(e,t)}function jw(e,t){t===0&&(e.mode&1?(t=Yf,Yf<<=1,!(Yf&130023424)&&(Yf=4194304)):t=1);var r=qr();e=ya(e,t),e!==null&&(kc(e,t,r),gn(e,r))}function Rx(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),jw(e,r)}function Mx(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(Ce(314))}n!==null&&n.delete(t),jw(e,r)}var Fw;Fw=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||hn.current)cn=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return cn=!1,bx(e,t,r);cn=!!(e.flags&131072)}else cn=!1,Gt&&t.flags&1048576&&H6(t,Yd,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;kd(e,t),e=t.pendingProps;var i=ys(t,Ur.current);ps(t,r),i=Zm(null,t,n,e,i,r);var a=Qm();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,pn(n)?(a=!0,Wd(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,qm(t),i.updater=Lh,t.stateNode=i,i._reactInternals=t,Lv(t,n,e,r),t=Dv(null,t,n,!0,a,r)):(t.tag=0,Gt&&a&&zm(t),Vr(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(kd(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=Nx(n),e=si(n,e),i){case 0:t=Iv(null,t,n,e,r);break e;case 1:t=t5(null,t,n,e,r);break e;case 11:t=J3(null,t,n,e,r);break e;case 14:t=e5(null,t,n,si(n.type,e),r);break e}throw Error(Ce(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:si(n,i),Iv(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:si(n,i),t5(e,t,n,i,r);case 3:e:{if(ww(t),e===null)throw Error(Ce(387));n=t.pendingProps,a=t.memoizedState,i=a.element,K6(e,t),Qd(t,n,null,r);var o=t.memoizedState;if(n=o.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=Ss(Error(Ce(423)),t),t=r5(e,t,n,r,i);break e}else if(n!==i){i=Ss(Error(Ce(424)),t),t=r5(e,t,n,r,i);break e}else for(On=to(t.stateNode.containerInfo.firstChild),xn=t,Gt=!0,ci=null,r=q6(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(bs(),n===i){t=ba(e,t,r);break e}Vr(e,t,n,r)}t=t.child}return t;case 5:return Y6(t),e===null&&Av(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,xv(n,i)?o=null:a!==null&&xv(n,a)&&(t.flags|=32),_w(e,t),Vr(e,t,o,r),t.child;case 6:return e===null&&Av(t),null;case 13:return Sw(e,t,r);case 4:return Wm(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=_s(t,null,n,r):Vr(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:si(n,i),J3(e,t,n,i,r);case 7:return Vr(e,t,t.pendingProps,r),t.child;case 8:return Vr(e,t,t.pendingProps.children,r),t.child;case 12:return Vr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,Nt(Xd,n._currentValue),n._currentValue=o,a!==null)if(mi(a.value,o)){if(a.children===i.children&&!hn.current){t=ba(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var u=l.firstContext;u!==null;){if(u.context===n){if(a.tag===1){u=fa(-1,r&-r),u.tag=2;var f=a.updateQueue;if(f!==null){f=f.shared;var h=f.pending;h===null?u.next=u:(u.next=h.next,h.next=u),f.pending=u}}a.lanes|=r,u=a.alternate,u!==null&&(u.lanes|=r),Rv(a.return,r,t),l.lanes|=r;break}u=u.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(Ce(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),Rv(o,r,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Vr(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,ps(t,r),i=Xn(i),n=n(i),t.flags|=1,Vr(e,t,n,r),t.child;case 14:return n=t.type,i=si(n,t.pendingProps),i=si(n.type,i),e5(e,t,n,i,r);case 15:return yw(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:si(n,i),kd(e,t),t.tag=1,pn(n)?(e=!0,Wd(t)):e=!1,ps(t,r),gw(t,n,i),Lv(t,n,i,r),Dv(null,t,n,!0,e,r);case 19:return Ew(e,t,r);case 22:return bw(e,t,r)}throw Error(Ce(156,t.tag))};function zw(e,t){return d6(e,t)}function Lx(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wn(e,t,r,n){return new Lx(e,t,r,n)}function sy(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Nx(e){if(typeof e=="function")return sy(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Cm)return 11;if(e===km)return 14}return 2}function ao(e,t){var r=e.alternate;return r===null?(r=Wn(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Rd(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")sy(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Xl:return Xo(r.children,i,a,t);case Pm:o=8,i|=8;break;case nv:return e=Wn(12,r,t,i|2),e.elementType=nv,e.lanes=a,e;case iv:return e=Wn(13,r,t,i),e.elementType=iv,e.lanes=a,e;case av:return e=Wn(19,r,t,i),e.elementType=av,e.lanes=a,e;case Y_:return Dh(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case W_:o=10;break e;case K_:o=9;break e;case Cm:o=11;break e;case km:o=14;break e;case Ga:o=16,n=null;break e}throw Error(Ce(130,e==null?e:typeof e,""))}return t=Wn(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function Xo(e,t,r,n){return e=Wn(7,e,n,t),e.lanes=r,e}function Dh(e,t,r,n){return e=Wn(22,e,n,t),e.elementType=Y_,e.lanes=r,e.stateNode={isHidden:!1},e}function I1(e,t,r){return e=Wn(6,e,null,t),e.lanes=r,e}function D1(e,t,r){return t=Wn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ix(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=v1(0),this.expirationTimes=v1(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=v1(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function uy(e,t,r,n,i,a,o,l,u){return e=new Ix(e,t,r,l,u),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Wn(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},qm(a),e}function Dx(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Yl,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function Bw(e){if(!e)return uo;e=e._reactInternals;e:{if(fl(e)!==e||e.tag!==1)throw Error(Ce(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(pn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Ce(171))}if(e.tag===1){var r=e.type;if(pn(r))return B6(e,r,t)}return t}function Uw(e,t,r,n,i,a,o,l,u){return e=uy(r,n,!0,e,i,a,o,l,u),e.context=Bw(null),r=e.current,n=qr(),i=io(r),a=fa(n,i),a.callback=t??null,ro(r,a,i),e.current.lanes=i,kc(e,i,n),gn(e,n),e}function jh(e,t,r,n){var i=t.current,a=qr(),o=io(i);return r=Bw(r),t.context===null?t.context=r:t.pendingContext=r,t=fa(a,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=ro(i,t,o),e!==null&&(di(e,i,o,a),xd(e,i,o)),o}function oh(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function d5(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function cy(e,t){d5(e,t),(e=e.alternate)&&d5(e,t)}function jx(){return null}var Hw=typeof reportError=="function"?reportError:function(e){console.error(e)};function fy(e){this._internalRoot=e}Fh.prototype.render=fy.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Ce(409));jh(e,t,null,null)};Fh.prototype.unmount=fy.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;nl(function(){jh(null,e,null,null)}),t[ma]=null}};function Fh(e){this._internalRoot=e}Fh.prototype.unstable_scheduleHydration=function(e){if(e){var t=b6();e={blockedOn:null,target:e,priority:t};for(var r=0;r<qa.length&&t!==0&&t<qa[r].priority;r++);qa.splice(r,0,e),r===0&&w6(e)}};function dy(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function zh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function h5(){}function Fx(e,t,r,n,i){if(i){if(typeof n=="function"){var a=n;n=function(){var f=oh(o);a.call(f)}}var o=Uw(t,n,e,0,null,!1,!1,"",h5);return e._reactRootContainer=o,e[ma]=o.current,lc(e.nodeType===8?e.parentNode:e),nl(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof n=="function"){var l=n;n=function(){var f=oh(u);l.call(f)}}var u=uy(e,0,!1,null,null,!1,!1,"",h5);return e._reactRootContainer=u,e[ma]=u.current,lc(e.nodeType===8?e.parentNode:e),nl(function(){jh(t,u,r,n)}),u}function Bh(e,t,r,n,i){var a=r._reactRootContainer;if(a){var o=a;if(typeof i=="function"){var l=i;i=function(){var u=oh(o);l.call(u)}}jh(t,o,e,i)}else o=Fx(r,t,e,i,n);return oh(o)}m6=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Du(t.pendingLanes);r!==0&&(Rm(t,r|1),gn(t,rr()),!(mt&6)&&(Es=rr()+500,mo()))}break;case 13:nl(function(){var n=ya(e,1);if(n!==null){var i=qr();di(n,e,1,i)}}),cy(e,1)}};Mm=function(e){if(e.tag===13){var t=ya(e,134217728);if(t!==null){var r=qr();di(t,e,134217728,r)}cy(e,134217728)}};y6=function(e){if(e.tag===13){var t=io(e),r=ya(e,t);if(r!==null){var n=qr();di(r,e,t,n)}cy(e,t)}};b6=function(){return Pt};_6=function(e,t){var r=Pt;try{return Pt=e,t()}finally{Pt=r}};gv=function(e,t,r){switch(t){case"input":if(sv(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var i=Ah(n);if(!i)throw Error(Ce(90));Z_(n),sv(n,i)}}}break;case"textarea":J_(e,r);break;case"select":t=r.value,t!=null&&cs(e,!!r.multiple,t,!1)}};o6=ay;l6=nl;var zx={usingClientEntryPoint:!1,Events:[Ac,es,Ah,i6,a6,ay]},Tu={findFiberByHostInstance:Vo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Bx={bundleType:Tu.bundleType,version:Tu.version,rendererPackageName:Tu.rendererPackageName,rendererConfig:Tu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Sa.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=c6(e),e===null?null:e.stateNode},findFiberByHostInstance:Tu.findFiberByHostInstance||jx,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var od=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!od.isDisabled&&od.supportsFiber)try{Ph=od.inject(Bx),zi=od}catch{}}kn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=zx;kn.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!dy(t))throw Error(Ce(200));return Dx(e,t,null,r)};kn.createRoot=function(e,t){if(!dy(e))throw Error(Ce(299));var r=!1,n="",i=Hw;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=uy(e,1,!1,null,null,r,!1,n,i),e[ma]=t.current,lc(e.nodeType===8?e.parentNode:e),new fy(t)};kn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Ce(188)):(e=Object.keys(e).join(","),Error(Ce(268,e)));return e=c6(t),e=e===null?null:e.stateNode,e};kn.flushSync=function(e){return nl(e)};kn.hydrate=function(e,t,r){if(!zh(t))throw Error(Ce(200));return Bh(null,e,t,!0,r)};kn.hydrateRoot=function(e,t,r){if(!dy(e))throw Error(Ce(405));var n=r!=null&&r.hydratedSources||null,i=!1,a="",o=Hw;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=Uw(t,null,e,1,r??null,i,!1,a,o),e[ma]=t.current,lc(e),n)for(e=0;e<n.length;e++)r=n[e],i=r._getVersion,i=i(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,i]:t.mutableSourceEagerHydrationData.push(r,i);return new Fh(t)};kn.render=function(e,t,r){if(!zh(t))throw Error(Ce(200));return Bh(null,e,t,!1,r)};kn.unmountComponentAtNode=function(e){if(!zh(e))throw Error(Ce(40));return e._reactRootContainer?(nl(function(){Bh(null,null,e,!1,function(){e._reactRootContainer=null,e[ma]=null})}),!0):!1};kn.unstable_batchedUpdates=ay;kn.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!zh(r))throw Error(Ce(200));if(e==null||e._reactInternals===void 0)throw Error(Ce(38));return Bh(e,t,r,!1,n)};kn.version="18.3.1-next-f1338f8080-20240426";function $w(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE($w)}catch(e){console.error(e)}}$w(),$_.exports=kn;var Gw=$_.exports,p5=Gw;Dd.createRoot=p5.createRoot,Dd.hydrateRoot=p5.hydrateRoot;var Vw={};function nt(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];throw new Error(typeof e=="number"?"[MobX] minified error nr: "+e+(r.length?" "+r.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+e)}var Ux={};function hy(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:Ux}var qw=Object.assign,lh=Object.getOwnPropertyDescriptor,Ui=Object.defineProperty,Mc=Object.prototype,Kv=[];Object.freeze(Kv);var py={};Object.freeze(py);var Hx=typeof Proxy<"u",$x=Object.toString();function Ww(){Hx||nt("Proxy not available")}function Kw(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var ls=function(){};function Cn(e){return typeof e=="function"}function il(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function Uh(e){return e!==null&&typeof e=="object"}function _a(e){if(!Uh(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r.toString()===$x}function Yw(e){var t=e==null?void 0:e.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function Lc(e,t,r){Ui(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function Xw(e,t,r){Ui(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}function yo(e,t){var r="isMobX"+e;return t.prototype[r]=!0,function(n){return Uh(n)&&n[r]===!0}}function Hs(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function Gx(e){var t=Object.getPrototypeOf(e),r=Object.getPrototypeOf(t),n=Object.getPrototypeOf(r);return n===null}function sa(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var Zw=typeof Object.getOwnPropertySymbols<"u";function Vx(e){var t=Object.keys(e);if(!Zw)return t;var r=Object.getOwnPropertySymbols(e);return r.length?[].concat(t,r.filter(function(n){return Mc.propertyIsEnumerable.call(e,n)})):t}var Os=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Zw?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function Qw(e){return e===null?null:typeof e=="object"?""+e:e}function da(e,t){return Mc.hasOwnProperty.call(e,t)}var qx=Object.getOwnPropertyDescriptors||function(t){var r={};return Os(t).forEach(function(n){r[n]=lh(t,n)}),r};function g5(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Wx(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Yx(n.key),n)}}function Hh(e,t,r){return t&&Wx(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ss(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=Xx(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
33
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function co(){return co=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},co.apply(null,arguments)}function Jw(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Yv(e,t)}function Yv(e,t){return Yv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Yv(e,t)}function Kx(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Yx(e){var t=Kx(e,"string");return typeof t=="symbol"?t:t+""}function Xx(e,t){if(e){if(typeof e=="string")return g5(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g5(e,t):void 0}}var Fi=Symbol("mobx-stored-annotations");function hi(e){function t(r,n){if(Nc(n))return e.decorate_20223_(r,n);$s(r,n,e)}return Object.assign(t,e)}function $s(e,t,r){da(e,Fi)||Lc(e,Fi,co({},e[Fi])),aP(r)||(e[Fi][t]=r)}function Zx(e){return da(e,Fi)||Lc(e,Fi,co({},e[Fi])),e[Fi]}function Nc(e){return typeof e=="object"&&typeof e.kind=="string"}var Ke=Symbol("mobx administration"),Ic=function(){function e(r){r===void 0&&(r="Atom"),this.name_=void 0,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers_=new Set,this.diffValue_=0,this.lastAccessedBy_=0,this.lowestObserverState_=St.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=r}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},t.reportObserved=function(){return y8(this)},t.reportChanged=function(){fn(),b8(this),dn()},t.toString=function(){return this.name_},e}(),gy=yo("Atom",Ic);function vc(e,t,r){t===void 0&&(t=ls),r===void 0&&(r=ls);var n=new Ic(e);return t!==ls&&k8(n,t),r!==ls&&wy(n,r),n}function Qx(e,t){return e===t}function Jx(e,t){return Ry(e,t)}function eP(e,t){return Ry(e,t,1)}function tP(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var al={identity:Qx,structural:Jx,default:tP,shallow:eP};function ol(e,t,r){return Xh(e)?e:Array.isArray(e)?Tt.array(e,{name:r}):_a(e)?Tt.object(e,void 0,{name:r}):Hs(e)?Tt.map(e,{name:r}):sa(e)?Tt.set(e,{name:r}):typeof e=="function"&&!jc(e)&&!ks(e)?Yw(e)?sl(e):Ps(r,e):e}function rP(e,t,r){if(e==null||Or(e)||Xr(e)||Mr(e)||Wr(e))return e;if(Array.isArray(e))return Tt.array(e,{name:r,deep:!1});if(_a(e))return Tt.object(e,void 0,{name:r,deep:!1});if(Hs(e))return Tt.map(e,{name:r,deep:!1});if(sa(e))return Tt.set(e,{name:r,deep:!1})}function $h(e){return e}function nP(e,t){return Ry(e,t)?t:e}var e8="override",iP=hi({annotationType_:e8,make_:oP,extend_:lP,decorate_20223_:sP});function aP(e){return e.annotationType_===e8}function oP(e,t){return 0}function lP(e,t,r,n){nt("'"+this.annotationType_+"' can only be used with 'makeObservable'")}function sP(e,t){console.warn("'"+this.annotationType_+"' cannot be used with decorators - this is a no-op")}function Dc(e,t){return{annotationType_:e,options_:t,make_:uP,extend_:cP,decorate_20223_:fP}}function uP(e,t,r,n){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(e,t,r,!1)===null?0:1;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if(jc(r.value))return 1;var a=t8(e,this,t,r,!1);return Ui(n,t,a),2}function cP(e,t,r,n){var i=t8(e,this,t,r);return e.defineProperty_(t,i,n)}function fP(e,t){var r=t.kind,n=t.name,i=t.addInitializer,a=this,o=function(f){var h,E,w,p;return fo((h=(E=a.options_)==null?void 0:E.name)!=null?h:n.toString(),f,(w=(p=a.options_)==null?void 0:p.autoAction)!=null?w:!1)};if(r=="field"){i(function(){$s(this,n,a)});return}if(r=="method"){var l;return jc(e)||(e=o(e)),(l=this.options_)!=null&&l.bound&&i(function(){var u=this,f=u[n].bind(u);f.isMobxAction=!0,u[n]=f}),e}nt("Cannot apply '"+a.annotationType_+"' to '"+String(n)+"' (kind: "+r+"):"+(`
34
+ '`+a.annotationType_+"' can only be used on properties with a function value."))}function dP(e,t,r,n){t.annotationType_,n.value}function t8(e,t,r,n,i){var a,o,l,u,f,h,E;i===void 0&&(i=Ae.safeDescriptors),dP(e,t,r,n);var w=n.value;if((a=t.options_)!=null&&a.bound){var p;w=w.bind((p=e.proxy_)!=null?p:e.target_)}return{value:fo((o=(l=t.options_)==null?void 0:l.name)!=null?o:r.toString(),w,(u=(f=t.options_)==null?void 0:f.autoAction)!=null?u:!1,(h=t.options_)!=null&&h.bound?(E=e.proxy_)!=null?E:e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function r8(e,t){return{annotationType_:e,options_:t,make_:hP,extend_:pP,decorate_20223_:gP}}function hP(e,t,r,n){var i;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!da(e.target_,t)||!ks(e.target_[t]))&&this.extend_(e,t,r,!1)===null)return 0;if(ks(r.value))return 1;var a=n8(e,this,t,r,!1,!1);return Ui(n,t,a),2}function pP(e,t,r,n){var i,a=n8(e,this,t,r,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,a,n)}function gP(e,t){var r,n=t.name,i=t.addInitializer;return ks(e)||(e=sl(e)),(r=this.options_)!=null&&r.bound&&i(function(){var a=this,o=a[n].bind(a);o.isMobXFlow=!0,a[n]=o}),e}function vP(e,t,r,n){t.annotationType_,n.value}function n8(e,t,r,n,i,a){a===void 0&&(a=Ae.safeDescriptors),vP(e,t,r,n);var o=n.value;if(ks(o)||(o=sl(o)),i){var l;o=o.bind((l=e.proxy_)!=null?l:e.target_),o.isMobXFlow=!0}return{value:o,configurable:a?e.isPlainObject_:!0,enumerable:!1,writable:!a}}function vy(e,t){return{annotationType_:e,options_:t,make_:mP,extend_:yP,decorate_20223_:bP}}function mP(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function yP(e,t,r,n){return _P(e,this,t,r),e.defineComputedProperty_(t,co({},this.options_,{get:r.get,set:r.set}),n)}function bP(e,t){var r=this,n=t.name,i=t.addInitializer;return i(function(){var a=pl(this)[Ke],o=co({},r.options_,{get:e,context:this});o.name||(o.name="ObservableObject."+n.toString()),a.values_.set(n,new Gi(o))}),function(){return this[Ke].getObservablePropValue_(n)}}function _P(e,t,r,n){t.annotationType_,n.get}function Gh(e,t){return{annotationType_:e,options_:t,make_:wP,extend_:SP,decorate_20223_:EP}}function wP(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function SP(e,t,r,n){var i,a;return OP(e,this),e.defineObservableProperty_(t,r.value,(i=(a=this.options_)==null?void 0:a.enhancer)!=null?i:ol,n)}function EP(e,t){var r=this,n=t.kind,i=t.name,a=new WeakSet;function o(l,u){var f,h,E=pl(l)[Ke],w=new oo(u,(f=(h=r.options_)==null?void 0:h.enhancer)!=null?f:ol,"ObservableObject."+i.toString(),!1);E.values_.set(i,w),a.add(l)}if(n=="accessor")return{get:function(){return a.has(this)||o(this,e.get.call(this)),this[Ke].getObservablePropValue_(i)},set:function(u){return a.has(this)||o(this,u),this[Ke].setObservablePropValue_(i,u)},init:function(u){return a.has(this)||o(this,u),u}}}function OP(e,t,r,n){t.annotationType_}var xP="true",PP=i8();function i8(e){return{annotationType_:xP,options_:e,make_:CP,extend_:kP,decorate_20223_:TP}}function CP(e,t,r,n){var i,a;if(r.get)return dl.make_(e,t,r,n);if(r.set){var o=fo(t.toString(),r.set);return n===e.target_?e.defineProperty_(t,{configurable:Ae.safeDescriptors?e.isPlainObject_:!0,set:o})===null?0:2:(Ui(n,t,{configurable:!0,set:o}),2)}if(n!==e.target_&&typeof r.value=="function"){var l;if(Yw(r.value)){var u,f=(u=this.options_)!=null&&u.autoBind?sl.bound:sl;return f.make_(e,t,r,n)}var h=(l=this.options_)!=null&&l.autoBind?Ps.bound:Ps;return h.make_(e,t,r,n)}var E=((i=this.options_)==null?void 0:i.deep)===!1?Tt.ref:Tt;if(typeof r.value=="function"&&(a=this.options_)!=null&&a.autoBind){var w;r.value=r.value.bind((w=e.proxy_)!=null?w:e.target_)}return E.make_(e,t,r,n)}function kP(e,t,r,n){var i,a;if(r.get)return dl.extend_(e,t,r,n);if(r.set)return e.defineProperty_(t,{configurable:Ae.safeDescriptors?e.isPlainObject_:!0,set:fo(t.toString(),r.set)},n);if(typeof r.value=="function"&&(i=this.options_)!=null&&i.autoBind){var o;r.value=r.value.bind((o=e.proxy_)!=null?o:e.target_)}var l=((a=this.options_)==null?void 0:a.deep)===!1?Tt.ref:Tt;return l.extend_(e,t,r,n)}function TP(e,t){nt("'"+this.annotationType_+"' cannot be used as a decorator")}var AP="observable",RP="observable.ref",MP="observable.shallow",LP="observable.struct",a8={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(a8);function ld(e){return e||a8}var Xv=Gh(AP),NP=Gh(RP,{enhancer:$h}),IP=Gh(MP,{enhancer:rP}),DP=Gh(LP,{enhancer:nP}),o8=hi(Xv);function sd(e){return e.deep===!0?ol:e.deep===!1?$h:FP(e.defaultDecorator)}function jP(e){var t;return e?(t=e.defaultDecorator)!=null?t:i8(e):void 0}function FP(e){var t,r;return e&&(t=(r=e.options_)==null?void 0:r.enhancer)!=null?t:ol}function l8(e,t,r){if(Nc(t))return Xv.decorate_20223_(e,t);if(il(t)){$s(e,t,Xv);return}return Xh(e)?e:_a(e)?Tt.object(e,t,r):Array.isArray(e)?Tt.array(e,t):Hs(e)?Tt.map(e,t):sa(e)?Tt.set(e,t):typeof e=="object"&&e!==null?e:Tt.box(e,t)}qw(l8,o8);var zP={box:function(t,r){var n=ld(r);return new oo(t,sd(n),n.name,!0,n.equals)},array:function(t,r){var n=ld(r);return(Ae.useProxies===!1||n.proxy===!1?VC:IC)(t,sd(n),n.name)},map:function(t,r){var n=ld(r);return new Qh(t,sd(n),n.name)},set:function(t,r){var n=ld(r);return new Ty(t,sd(n),n.name)},object:function(t,r,n){return bo(function(){return Sy(Ae.useProxies===!1||(n==null?void 0:n.proxy)===!1?pl({},n):RC({},n),t,r)})},ref:hi(NP),shallow:hi(IP),deep:o8,struct:hi(DP)},Tt=qw(l8,zP),s8="computed",BP="computed.struct",Zv=vy(s8),UP=vy(BP,{equals:al.structural}),dl=function(t,r){if(Nc(r))return Zv.decorate_20223_(t,r);if(il(r))return $s(t,r,Zv);if(_a(t))return hi(vy(s8,t));var n=_a(r)?r:{};return n.get=t,n.name||(n.name=t.name||""),new Gi(n)};Object.assign(dl,Zv);dl.struct=hi(UP);var v5,m5,sh=0,HP=1,$P=(v5=(m5=lh(function(){},"name"))==null?void 0:m5.configurable)!=null?v5:!1,y5={value:"action",configurable:!0,writable:!1,enumerable:!1};function fo(e,t,r,n){r===void 0&&(r=!1);function i(){return u8(e,r,t,n||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},$P&&(y5.value=e,Ui(i,"name",y5)),i}function u8(e,t,r,n,i){var a=c8(e,t);try{return r.apply(n,i)}catch(o){throw a.error_=o,o}finally{f8(a)}}function c8(e,t,r,n){var i=!1,a=0,o=Ae.trackingDerivation,l=!t||!o;fn();var u=Ae.allowStateChanges;l&&(hl(),u=Vh(!0));var f=Wh(!0),h={runAsAction_:l,prevDerivation_:o,prevAllowStateChanges_:u,prevAllowStateReads_:f,notifySpy_:i,startTime_:a,actionId_:HP++,parentActionId_:sh};return sh=h.actionId_,h}function f8(e){sh!==e.actionId_&&nt(30),sh=e.parentActionId_,e.error_!==void 0&&(Ae.suppressReactionErrors=!0),qh(e.prevAllowStateChanges_),vs(e.prevAllowStateReads_),dn(),e.runAsAction_&&ha(e.prevDerivation_),Ae.suppressReactionErrors=!1}function my(e,t){var r=Vh(e);try{return t()}finally{qh(r)}}function Vh(e){var t=Ae.allowStateChanges;return Ae.allowStateChanges=e,t}function qh(e){Ae.allowStateChanges=e}var oo=function(e){function t(n,i,a,o,l){var u;return a===void 0&&(a="ObservableValue"),l===void 0&&(l=al.default),u=e.call(this,a)||this,u.enhancer=void 0,u.name_=void 0,u.equals=void 0,u.hasUnreportedChange_=!1,u.interceptors_=void 0,u.changeListeners_=void 0,u.value_=void 0,u.dehancer=void 0,u.enhancer=i,u.name_=a,u.equals=l,u.value_=i(n,void 0,a),u}Jw(t,e);var r=t.prototype;return r.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},r.set=function(i){this.value_,i=this.prepareNewValue_(i),i!==Ae.UNCHANGED&&this.setNewValue_(i)},r.prepareNewValue_=function(i){if(Vn(this)){var a=qn(this,{object:this,type:Hi,newValue:i});if(!a)return Ae.UNCHANGED;i=a.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?Ae.UNCHANGED:i},r.setNewValue_=function(i){var a=this.value_;this.value_=i,this.reportChanged(),pi(this)&&gi(this,{type:Hi,object:this,newValue:i,oldValue:a})},r.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},r.intercept_=function(i){return Fc(this,i)},r.observe_=function(i,a){return a&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:Hi,newValue:this.value_,oldValue:void 0}),zc(this,i)},r.raw=function(){return this.value_},r.toJSON=function(){return this.get()},r.toString=function(){return this.name_+"["+this.value_+"]"},r.valueOf=function(){return Qw(this.get())},r[Symbol.toPrimitive]=function(){return this.valueOf()},t}(Ic),yy=yo("ObservableValue",oo);function ud(e,t){return!!(e&t)}function cd(e,t,r){return r?e|=t:e&=~t,e}var Gi=function(){function e(r){this.dependenciesState_=St.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.diffValue_=0,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=St.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new ch(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=uh.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,r.get||nt(31),this.derivation=r.get,this.name_=r.name||"ComputedValue",r.set&&(this.setter_=fo("ComputedValue-setter",r.set)),this.equals_=r.equals||(r.compareStructural||r.struct?al.structural:al.default),this.scope_=r.context,this.requiresReaction_=r.requiresReaction,this.keepAlive_=!!r.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){JP(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},t.get=function(){if(this.isComputing&&nt(32,this.name_,this.derivation),Ae.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)Qv(this)&&(this.warnAboutUntrackedRead_(),fn(),this.value_=this.computeValue_(!1),dn());else if(y8(this),Qv(this)){var n=Ae.trackingContext;this.keepAlive_&&!n&&(Ae.trackingContext=this),this.trackAndCompute()&&QP(this),Ae.trackingContext=n}var i=this.value_;if(Md(i))throw i.cause;return i},t.set=function(n){if(this.setter_){this.isRunningSetter&&nt(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter=!1}}else nt(34,this.name_)},t.trackAndCompute=function(){var n=this.value_,i=this.dependenciesState_===St.NOT_TRACKING_,a=this.computeValue_(!0),o=i||Md(n)||Md(a)||!this.equals_(n,a);return o&&(this.value_=a),o},t.computeValue_=function(n){this.isComputing=!0;var i=Vh(!1),a;if(n)a=d8(this,this.derivation,this.scope_);else if(Ae.disableErrorBoundaries===!0)a=this.derivation.call(this.scope_);else try{a=this.derivation.call(this.scope_)}catch(o){a=new ch(o)}return qh(i),this.isComputing=!1,a},t.suspend_=function(){this.keepAlive_||(Jv(this),this.value_=void 0)},t.observe_=function(n,i){var a=this,o=!0,l=void 0;return _y(function(){var u=a.get();if(!o||i){var f=hl();n({observableKind:"computed",debugObjectName:a.name_,type:Hi,object:a,newValue:u,oldValue:l}),ha(f)}o=!1,l=u})},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return Qw(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},Hh(e,[{key:"isComputing",get:function(){return ud(this.flags_,e.isComputingMask_)},set:function(n){this.flags_=cd(this.flags_,e.isComputingMask_,n)}},{key:"isRunningSetter",get:function(){return ud(this.flags_,e.isRunningSetterMask_)},set:function(n){this.flags_=cd(this.flags_,e.isRunningSetterMask_,n)}},{key:"isBeingObserved",get:function(){return ud(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=cd(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return ud(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=cd(this.flags_,e.isPendingUnobservationMask_,n)}}])}();Gi.isComputingMask_=1;Gi.isRunningSetterMask_=2;Gi.isBeingObservedMask_=4;Gi.isPendingUnobservationMask_=8;var ll=yo("ComputedValue",Gi),St;(function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"})(St||(St={}));var uh;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(uh||(uh={}));var ch=function(t){this.cause=void 0,this.cause=t};function Md(e){return e instanceof ch}function Qv(e){switch(e.dependenciesState_){case St.UP_TO_DATE_:return!1;case St.NOT_TRACKING_:case St.STALE_:return!0;case St.POSSIBLY_STALE_:{for(var t=Wh(!0),r=hl(),n=e.observing_,i=n.length,a=0;a<i;a++){var o=n[a];if(ll(o)){if(Ae.disableErrorBoundaries)o.get();else try{o.get()}catch{return ha(r),vs(t),!0}if(e.dependenciesState_===St.STALE_)return ha(r),vs(t),!0}}return h8(e),ha(r),vs(t),!1}}}function GP(){return Ae.trackingDerivation!==null}function d8(e,t,r){var n=Wh(!0);h8(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++Ae.runId;var i=Ae.trackingDerivation;Ae.trackingDerivation=e,Ae.inBatch++;var a;if(Ae.disableErrorBoundaries===!0)a=t.call(r);else try{a=t.call(r)}catch(o){a=new ch(o)}return Ae.inBatch--,Ae.trackingDerivation=i,VP(e),vs(n),a}function VP(e){for(var t=e.observing_,r=e.observing_=e.newObserving_,n=St.UP_TO_DATE_,i=0,a=e.unboundDepsCount_,o=0;o<a;o++){var l=r[o];l.diffValue_===0&&(l.diffValue_=1,i!==o&&(r[i]=l),i++),l.dependenciesState_>n&&(n=l.dependenciesState_)}for(r.length=i,e.newObserving_=null,a=t.length;a--;){var u=t[a];u.diffValue_===0&&v8(u,e),u.diffValue_=0}for(;i--;){var f=r[i];f.diffValue_===1&&(f.diffValue_=0,ZP(f,e))}n!==St.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function Jv(e){var t=e.observing_;e.observing_=[];for(var r=t.length;r--;)v8(t[r],e);e.dependenciesState_=St.NOT_TRACKING_}function by(e){var t=hl();try{return e()}finally{ha(t)}}function hl(){var e=Ae.trackingDerivation;return Ae.trackingDerivation=null,e}function ha(e){Ae.trackingDerivation=e}function Wh(e){var t=Ae.allowStateReads;return Ae.allowStateReads=e,t}function vs(e){Ae.allowStateReads=e}function h8(e){if(e.dependenciesState_!==St.UP_TO_DATE_){e.dependenciesState_=St.UP_TO_DATE_;for(var t=e.observing_,r=t.length;r--;)t[r].lowestObserverState_=St.UP_TO_DATE_}}var qP=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED","useProxies"],Yu=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},Ld=!0,p8=!1,Ae=function(){var e=hy();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Ld=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new Yu().version&&(Ld=!1),Ld?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Yu):(setTimeout(function(){p8||nt(35)},1),new Yu)}();function WP(){if((Ae.pendingReactions.length||Ae.inBatch||Ae.isRunningReactions)&&nt(36),p8=!0,Ld){var e=hy();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),Ae=new Yu}}function g8(){return Ae}function KP(){var e=new Yu;for(var t in e)qP.indexOf(t)===-1&&(Ae[t]=e[t]);Ae.allowStateChanges=!Ae.enforceActions}function YP(e){return e.observers_&&e.observers_.size>0}function XP(e){return e.observers_}function ZP(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function v8(e,t){e.observers_.delete(t),e.observers_.size===0&&m8(e)}function m8(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,Ae.pendingUnobservations.push(e))}function fn(){Ae.inBatch++}function dn(){if(--Ae.inBatch===0){_8();for(var e=Ae.pendingUnobservations,t=0;t<e.length;t++){var r=e[t];r.isPendingUnobservation=!1,r.observers_.size===0&&(r.isBeingObserved&&(r.isBeingObserved=!1,r.onBUO()),r instanceof Gi&&r.suspend_())}Ae.pendingUnobservations=[]}}function y8(e){var t=Ae.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&Ae.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&Ae.inBatch>0&&m8(e),!1)}function b8(e){e.lowestObserverState_!==St.STALE_&&(e.lowestObserverState_=St.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===St.UP_TO_DATE_&&t.onBecomeStale_(),t.dependenciesState_=St.STALE_}))}function QP(e){e.lowestObserverState_!==St.STALE_&&(e.lowestObserverState_=St.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===St.POSSIBLY_STALE_?t.dependenciesState_=St.STALE_:t.dependenciesState_===St.UP_TO_DATE_&&(e.lowestObserverState_=St.UP_TO_DATE_)}))}function JP(e){e.lowestObserverState_===St.UP_TO_DATE_&&(e.lowestObserverState_=St.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===St.UP_TO_DATE_&&(t.dependenciesState_=St.POSSIBLY_STALE_,t.onBecomeStale_())}))}var xs=function(){function e(r,n,i,a){r===void 0&&(r="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=St.NOT_TRACKING_,this.diffValue_=0,this.runId_=0,this.unboundDepsCount_=0,this.isDisposed_=!1,this.isScheduled_=!1,this.isTrackPending_=!1,this.isRunning_=!1,this.isTracing_=uh.NONE,this.name_=r,this.onInvalidate_=n,this.errorHandler_=i,this.requiresObservable_=a}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled_||(this.isScheduled_=!0,Ae.pendingReactions.push(this),_8())},t.isScheduled=function(){return this.isScheduled_},t.runReaction_=function(){if(!this.isDisposed_){fn(),this.isScheduled_=!1;var n=Ae.trackingContext;if(Ae.trackingContext=this,Qv(this)){this.isTrackPending_=!0;try{this.onInvalidate_()}catch(i){this.reportExceptionInDerivation_(i)}}Ae.trackingContext=n,dn()}},t.track=function(n){if(!this.isDisposed_){fn(),this.isRunning_=!0;var i=Ae.trackingContext;Ae.trackingContext=this;var a=d8(this,n,void 0);Ae.trackingContext=i,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&Jv(this),Md(a)&&this.reportExceptionInDerivation_(a.cause),dn()}},t.reportExceptionInDerivation_=function(n){var i=this;if(this.errorHandler_){this.errorHandler_(n,this);return}if(Ae.disableErrorBoundaries)throw n;var a="[mobx] uncaught error in '"+this+"'";Ae.suppressReactionErrors||console.error(a,n),Ae.globalReactionErrorHandlers.forEach(function(o){return o(n,i)})},t.dispose=function(){this.isDisposed_||(this.isDisposed_=!0,this.isRunning_||(fn(),Jv(this),dn()))},t.getDisposer_=function(n){var i=this,a=function o(){i.dispose(),n==null||n.removeEventListener==null||n.removeEventListener("abort",o)};return n==null||n.addEventListener==null||n.addEventListener("abort",a),a[Ke]=this,a},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(n){},e}();function eC(e){return Ae.globalReactionErrorHandlers.push(e),function(){var t=Ae.globalReactionErrorHandlers.indexOf(e);t>=0&&Ae.globalReactionErrorHandlers.splice(t,1)}}var tC=100,em=function(t){return t()};function _8(){Ae.inBatch>0||Ae.isRunningReactions||em(rC)}function rC(){Ae.isRunningReactions=!0;for(var e=Ae.pendingReactions,t=0;e.length>0;){++t===tC&&(console.error("[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var r=e.splice(0),n=0,i=r.length;n<i;n++)r[n].runReaction_()}Ae.isRunningReactions=!1}var fh=yo("Reaction",xs);function nC(e){var t=em;em=function(n){return e(function(){return t(n)})}}function Xu(){return!1}function w8(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var S8="action",iC="action.bound",E8="autoAction",aC="autoAction.bound",O8="<unnamed action>",tm=Dc(S8),oC=Dc(iC,{bound:!0}),rm=Dc(E8,{autoAction:!0}),lC=Dc(aC,{autoAction:!0,bound:!0});function x8(e){var t=function(n,i){if(Cn(n))return fo(n.name||O8,n,e);if(Cn(i))return fo(n,i,e);if(Nc(i))return(e?rm:tm).decorate_20223_(n,i);if(il(i))return $s(n,i,e?rm:tm);if(il(n))return hi(Dc(e?E8:S8,{name:n,autoAction:e}))};return t}var or=x8(!1);Object.assign(or,tm);var Ps=x8(!0);Object.assign(Ps,rm);or.bound=hi(oC);Ps.bound=hi(lC);function Cs(e){return u8(e.name||O8,!1,e,this,void 0)}function jc(e){return Cn(e)&&e.isMobxAction===!0}function _y(e,t){var r,n,i,a;t===void 0&&(t=py);var o=(r=(n=t)==null?void 0:n.name)!=null?r:"Autorun",l=!t.scheduler&&!t.delay,u;if(l)u=new xs(o,function(){this.track(E)},t.onError,t.requiresObservable);else{var f=P8(t),h=!1;u=new xs(o,function(){h||(h=!0,f(function(){h=!1,u.isDisposed_||u.track(E)}))},t.onError,t.requiresObservable)}function E(){e(u)}return(i=t)!=null&&(i=i.signal)!=null&&i.aborted||u.schedule_(),u.getDisposer_((a=t)==null?void 0:a.signal)}var sC=function(t){return t()};function P8(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:sC}function C8(e,t,r){var n,i,a;r===void 0&&(r=py);var o=(n=r.name)!=null?n:"Reaction",l=or(o,r.onError?uC(r.onError,t):t),u=!r.scheduler&&!r.delay,f=P8(r),h=!0,E=!1,w,p=r.compareStructural?al.structural:r.equals||al.default,S=new xs(o,function(){h||u?b():E||(E=!0,f(b))},r.onError,r.requiresObservable);function b(){if(E=!1,!S.isDisposed_){var y=!1,v=w;S.track(function(){var m=my(!1,function(){return e(S)});y=h||!p(w,m),w=m}),(h&&r.fireImmediately||!h&&y)&&l(w,v,S),h=!1}}return(i=r)!=null&&(i=i.signal)!=null&&i.aborted||S.schedule_(),S.getDisposer_((a=r)==null?void 0:a.signal)}function uC(e,t){return function(){try{return t.apply(this,arguments)}catch(r){e.call(this,r)}}}var cC="onBO",fC="onBUO";function k8(e,t,r){return T8(cC,e,t,r)}function wy(e,t,r){return T8(fC,e,t,r)}function T8(e,t,r,n){var i=typeof n=="function"?Vi(t,r):Vi(t),a=Cn(n)?n:r,o=e+"L";return i[o]?i[o].add(a):i[o]=new Set([a]),function(){var l=i[o];l&&(l.delete(a),l.size===0&&delete i[o])}}var dC="never",fd="always",hC="observed";function A8(e){e.isolateGlobalState===!0&&WP();var t=e.useProxies,r=e.enforceActions;if(t!==void 0&&(Ae.useProxies=t===fd?!0:t===dC?!1:typeof Proxy<"u"),t==="ifavailable"&&(Ae.verifyProxies=!0),r!==void 0){var n=r===fd?fd:r===hC;Ae.enforceActions=n,Ae.allowStateChanges=!(n===!0||n===fd)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in e&&(Ae[i]=!!e[i])}),Ae.allowStateReads=!Ae.observableRequiresReaction,e.reactionScheduler&&nC(e.reactionScheduler)}function Sy(e,t,r,n){var i=qx(t);return bo(function(){var a=pl(e,n)[Ke];Os(i).forEach(function(o){a.extend_(o,i[o],r&&o in r?r[o]:!0)})}),e}function R8(e,t){return M8(Vi(e,t))}function M8(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=gC(e.observing_).map(M8)),t}function pC(e,t){return L8(Vi(e,t))}function L8(e){var t={name:e.name_};return YP(e)&&(t.observers=Array.from(XP(e)).map(L8)),t}function gC(e){return Array.from(new Set(e))}var vC=0;function Kh(){this.message="FLOW_CANCELLED"}Kh.prototype=Object.create(Error.prototype);function mC(e){return e instanceof Kh}var j1=r8("flow"),yC=r8("flow.bound",{bound:!0}),sl=Object.assign(function(t,r){if(Nc(r))return j1.decorate_20223_(t,r);if(il(r))return $s(t,r,j1);var n=t,i=n.name||"<unnamed flow>",a=function(){var l=this,u=arguments,f=++vC,h=or(i+" - runid: "+f+" - init",n).apply(l,u),E,w=void 0,p=new Promise(function(S,b){var y=0;E=b;function v(g){w=void 0;var _;try{_=or(i+" - runid: "+f+" - yield "+y++,h.next).call(h,g)}catch(k){return b(k)}d(_)}function m(g){w=void 0;var _;try{_=or(i+" - runid: "+f+" - yield "+y++,h.throw).call(h,g)}catch(k){return b(k)}d(_)}function d(g){if(Cn(g==null?void 0:g.then)){g.then(d,b);return}return g.done?S(g.value):(w=Promise.resolve(g.value),w.then(v,m))}v(void 0)});return p.cancel=or(i+" - runid: "+f+" - cancel",function(){try{w&&b5(w);var S=h.return(void 0),b=Promise.resolve(S.value);b.then(ls,ls),b5(b),E(new Kh)}catch(y){E(y)}}),p};return a.isMobXFlow=!0,a},j1);sl.bound=hi(yC);function b5(e){Cn(e.cancel)&&e.cancel()}function bC(e){return e}function ks(e){return(e==null?void 0:e.isMobXFlow)===!0}function Ey(e,t,r){var n;return Mr(e)||Xr(e)||yy(e)?n=yi(e):Or(e)&&(n=yi(e,t)),n.dehancer=typeof t=="function"?t:r,function(){n.dehancer=void 0}}function Yh(e,t,r){return Cn(r)?wC(e,t,r):_C(e,t)}function _C(e,t){return yi(e).intercept_(t)}function wC(e,t,r){return yi(e,t).intercept_(r)}function N8(e,t){if(t===void 0)return ll(e);if(Or(e)===!1||!e[Ke].values_.has(t))return!1;var r=Vi(e,t);return ll(r)}function SC(e){return N8(e)}function I8(e,t){return N8(e,t)}function D8(e,t){return e?t!==void 0?Or(e)?e[Ke].values_.has(t):!1:Or(e)||!!e[Ke]||gy(e)||fh(e)||ll(e):!1}function Xh(e){return D8(e)}function j8(e,t){return D8(e,t)}function mc(e){if(Or(e))return e[Ke].keys_();if(Mr(e)||Wr(e))return Array.from(e.keys());if(Xr(e))return e.map(function(t,r){return r});nt(5)}function Oy(e){if(Or(e))return mc(e).map(function(t){return e[t]});if(Mr(e))return mc(e).map(function(t){return e.get(t)});if(Wr(e))return Array.from(e.values());if(Xr(e))return e.slice();nt(6)}function F8(e){if(Or(e))return mc(e).map(function(t){return[t,e[t]]});if(Mr(e))return mc(e).map(function(t){return[t,e.get(t)]});if(Wr(e))return Array.from(e.entries());if(Xr(e))return e.map(function(t,r){return[r,t]});nt(7)}function xy(e,t,r){if(arguments.length===2&&!Wr(e)){fn();var n=t;try{for(var i in n)xy(e,i,n[i])}finally{dn()}return}Or(e)?e[Ke].set_(t,r):Mr(e)?e.set(t,r):Wr(e)?e.add(t):Xr(e)?(typeof t!="number"&&(t=parseInt(t,10)),t<0&&nt("Invalid index: '"+t+"'"),fn(),t>=e.length&&(e.length=t+1),e[t]=r,dn()):nt(8)}function EC(e,t){Or(e)?e[Ke].delete_(t):Mr(e)||Wr(e)?e.delete(t):Xr(e)?(typeof t!="number"&&(t=parseInt(t,10)),e.splice(t,1)):nt(9)}function z8(e,t){if(Or(e))return e[Ke].has_(t);if(Mr(e))return e.has(t);if(Wr(e))return e.has(t);if(Xr(e))return t>=0&&t<e.length;nt(10)}function OC(e,t){if(z8(e,t)){if(Or(e))return e[Ke].get_(t);if(Mr(e))return e.get(t);if(Xr(e))return e[t];nt(11)}}function Py(e,t,r){if(Or(e))return e[Ke].defineProperty_(t,r);nt(39)}function B8(e){if(Or(e))return e[Ke].ownKeys_();nt(38)}function Zh(e,t,r,n){return Cn(r)?PC(e,t,r,n):xC(e,t,r)}function xC(e,t,r){return yi(e).observe_(t,r)}function PC(e,t,r,n){return yi(e,t).observe_(r,n)}function dd(e,t,r){return e.set(t,r),r}function Kl(e,t){if(e==null||typeof e!="object"||e instanceof Date||!Xh(e))return e;if(yy(e)||ll(e))return Kl(e.get(),t);if(t.has(e))return t.get(e);if(Xr(e)){var r=dd(t,e,new Array(e.length));return e.forEach(function(o,l){r[l]=Kl(o,t)}),r}if(Wr(e)){var n=dd(t,e,new Set);return e.forEach(function(o){n.add(Kl(o,t))}),n}if(Mr(e)){var i=dd(t,e,new Map);return e.forEach(function(o,l){i.set(l,Kl(o,t))}),i}else{var a=dd(t,e,{});return B8(e).forEach(function(o){Mc.propertyIsEnumerable.call(e,o)&&(a[o]=Kl(e[o],t))}),a}}function CC(e,t){return Kl(e,new Map)}function kC(){}function Di(e,t){t===void 0&&(t=void 0),fn();try{return e.apply(t)}finally{dn()}}function nm(e,t,r){return arguments.length===1||t&&typeof t=="object"?TC(e,t):U8(e,t,r||{})}function U8(e,t,r){var n;if(typeof r.timeout=="number"){var i=new Error("WHEN_TIMEOUT");n=setTimeout(function(){if(!o[Ke].isDisposed_)if(o(),r.onError)r.onError(i);else throw i},r.timeout)}r.name="When";var a=fo("When-effect",t),o=_y(function(l){var u=my(!1,e);u&&(l.dispose(),n&&clearTimeout(n),a())},r);return o}function TC(e,t){var r;if(t!=null&&(r=t.signal)!=null&&r.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var n,i,a=new Promise(function(o,l){var u,f=U8(e,o,co({},t,{onError:l}));n=function(){f(),l(new Error("WHEN_CANCELLED"))},i=function(){f(),l(new Error("WHEN_ABORTED"))},t==null||(u=t.signal)==null||u.addEventListener==null||u.addEventListener("abort",i)}).finally(function(){var o;return t==null||(o=t.signal)==null||o.removeEventListener==null?void 0:o.removeEventListener("abort",i)});return a.cancel=n,a}function Gl(e){return e[Ke]}var AC={has:function(t,r){return Gl(t).has_(r)},get:function(t,r){return Gl(t).get_(r)},set:function(t,r,n){var i;return il(r)?(i=Gl(t).set_(r,n,!0))!=null?i:!0:!1},deleteProperty:function(t,r){var n;return il(r)?(n=Gl(t).delete_(r,!0))!=null?n:!0:!1},defineProperty:function(t,r,n){var i;return(i=Gl(t).defineProperty_(r,n))!=null?i:!0},ownKeys:function(t){return Gl(t).ownKeys_()},preventExtensions:function(t){nt(13)}};function RC(e,t){var r,n;return Ww(),e=pl(e,t),(n=(r=e[Ke]).proxy_)!=null?n:r.proxy_=new Proxy(e,AC)}function Vn(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function Fc(e,t){var r=e.interceptors_||(e.interceptors_=[]);return r.push(t),Kw(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function qn(e,t){var r=hl();try{for(var n=[].concat(e.interceptors_||[]),i=0,a=n.length;i<a&&(t=n[i](t),t&&!t.type&&nt(14),!!t);i++);return t}finally{ha(r)}}function pi(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function zc(e,t){var r=e.changeListeners_||(e.changeListeners_=[]);return r.push(t),Kw(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function gi(e,t){var r=hl(),n=e.changeListeners_;if(n){n=n.slice();for(var i=0,a=n.length;i<a;i++)n[i](t);ha(r)}}function Cy(e,t,r){return bo(function(){var n,i=pl(e,r)[Ke];(n=t)!=null||(t=Zx(e)),Os(t).forEach(function(a){return i.make_(a,t[a])})}),e}var F1=Symbol("mobx-keys");function MC(e,t,r){return _a(e)?Sy(e,e,t,r):(bo(function(){var n=pl(e,r)[Ke];if(!e[F1]){var i=Object.getPrototypeOf(e),a=new Set([].concat(Os(e),Os(i)));a.delete("constructor"),a.delete(Ke),Lc(i,F1,a)}e[F1].forEach(function(o){return n.make_(o,t&&o in t?t[o]:!0)})}),e)}var _5="splice",Hi="update",LC=1e4,NC={get:function(t,r){var n=t[Ke];return r===Ke?n:r==="length"?n.getArrayLength_():typeof r=="string"&&!isNaN(r)?n.get_(parseInt(r)):da(dh,r)?dh[r]:t[r]},set:function(t,r,n){var i=t[Ke];return r==="length"&&i.setArrayLength_(n),typeof r=="symbol"||isNaN(r)?t[r]=n:i.set_(parseInt(r),n),!0},preventExtensions:function(){nt(15)}},ky=function(){function e(r,n,i,a){r===void 0&&(r="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=i,this.legacyMode_=a,this.atom_=new Ic(r),this.enhancer_=function(o,l){return n(o,l,"ObservableArray[..]")}}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.dehanceValues_=function(n){return this.dehancer!==void 0&&n.length>0?n.map(this.dehancer):n},t.intercept_=function(n){return Fc(this,n)},t.observe_=function(n,i){return i===void 0&&(i=!1),i&&n({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),zc(this,n)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&nt("Out of range: "+n);var i=this.values_.length;if(n!==i)if(n>i){for(var a=new Array(n-i),o=0;o<n-i;o++)a[o]=void 0;this.spliceWithArray_(i,0,a)}else this.spliceWithArray_(n,i-n)},t.updateArrayLength_=function(n,i){n!==this.lastKnownLength_&&nt(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&q8(n+i+1)},t.spliceWithArray_=function(n,i,a){var o=this;this.atom_;var l=this.values_.length;if(n===void 0?n=0:n>l?n=l:n<0&&(n=Math.max(0,l+n)),arguments.length===1?i=l-n:i==null?i=0:i=Math.max(0,Math.min(i,l-n)),a===void 0&&(a=Kv),Vn(this)){var u=qn(this,{object:this.proxy_,type:_5,index:n,removedCount:i,added:a});if(!u)return Kv;i=u.removedCount,a=u.added}if(a=a.length===0?a:a.map(function(E){return o.enhancer_(E,void 0)}),this.legacyMode_){var f=a.length-i;this.updateArrayLength_(l,f)}var h=this.spliceItemsIntoValues_(n,i,a);return(i!==0||a.length!==0)&&this.notifyArraySplice_(n,a,h),this.dehanceValues_(h)},t.spliceItemsIntoValues_=function(n,i,a){if(a.length<LC){var o;return(o=this.values_).splice.apply(o,[n,i].concat(a))}else{var l=this.values_.slice(n,n+i),u=this.values_.slice(n+i);this.values_.length+=a.length-i;for(var f=0;f<a.length;f++)this.values_[n+f]=a[f];for(var h=0;h<u.length;h++)this.values_[n+a.length+h]=u[h];return l}},t.notifyArrayChildUpdate_=function(n,i,a){var o=!this.owned_&&Xu(),l=pi(this),u=l||o?{observableKind:"array",object:this.proxy_,type:Hi,debugObjectName:this.atom_.name_,index:n,newValue:i,oldValue:a}:null;this.atom_.reportChanged(),l&&gi(this,u)},t.notifyArraySplice_=function(n,i,a){var o=!this.owned_&&Xu(),l=pi(this),u=l||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:_5,index:n,removed:a,added:i,removedCount:a.length,addedCount:i.length}:null;this.atom_.reportChanged(),l&&gi(this,u)},t.get_=function(n){if(this.legacyMode_&&n>=this.values_.length){console.warn("[mobx] Out of bounds read: "+n);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[n])},t.set_=function(n,i){var a=this.values_;if(this.legacyMode_&&n>a.length&&nt(17,n,a.length),n<a.length){this.atom_;var o=a[n];if(Vn(this)){var l=qn(this,{type:Hi,object:this.proxy_,index:n,newValue:i});if(!l)return;i=l.newValue}i=this.enhancer_(i,o);var u=i!==o;u&&(a[n]=i,this.notifyArrayChildUpdate_(n,i,o))}else{for(var f=new Array(n+1-a.length),h=0;h<f.length-1;h++)f[h]=void 0;f[f.length-1]=i,this.spliceWithArray_(a.length,0,f)}},e}();function IC(e,t,r,n){return r===void 0&&(r="ObservableArray"),n===void 0&&(n=!1),Ww(),bo(function(){var i=new ky(r,t,n,!1);Xw(i.values_,Ke,i);var a=new Proxy(i.values_,NC);return i.proxy_=a,e&&e.length&&i.spliceWithArray_(0,0,e),a})}var dh={clear:function(){return this.splice(0)},replace:function(t){var r=this[Ke];return r.spliceWithArray_(0,r.values_.length,t)},toJSON:function(){return this.slice()},splice:function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a];var o=this[Ke];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(t);case 2:return o.spliceWithArray_(t,r)}return o.spliceWithArray_(t,r,i)},spliceWithArray:function(t,r,n){return this[Ke].spliceWithArray_(t,r,n)},push:function(){for(var t=this[Ke],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(t.values_.length,0,n),t.values_.length},pop:function(){return this.splice(Math.max(this[Ke].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[Ke],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(0,0,n),t.values_.length},reverse:function(){return Ae.trackingDerivation&&nt(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){Ae.trackingDerivation&&nt(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var r=this[Ke],n=r.dehanceValues_(r.values_).indexOf(t);return n>-1?(this.splice(n,1),!0):!1}};It("at",An);It("concat",An);It("flat",An);It("includes",An);It("indexOf",An);It("join",An);It("lastIndexOf",An);It("slice",An);It("toString",An);It("toLocaleString",An);It("toSorted",An);It("toSpliced",An);It("with",An);It("every",bi);It("filter",bi);It("find",bi);It("findIndex",bi);It("findLast",bi);It("findLastIndex",bi);It("flatMap",bi);It("forEach",bi);It("map",bi);It("some",bi);It("toReversed",bi);It("reduce",H8);It("reduceRight",H8);function It(e,t){typeof Array.prototype[e]=="function"&&(dh[e]=t(e))}function An(e){return function(){var t=this[Ke];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_);return r[e].apply(r,arguments)}}function bi(e){return function(t,r){var n=this,i=this[Ke];i.atom_.reportObserved();var a=i.dehanceValues_(i.values_);return a[e](function(o,l){return t.call(r,o,l,n)})}}function H8(e){return function(){var t=this,r=this[Ke];r.atom_.reportObserved();var n=r.dehanceValues_(r.values_),i=arguments[0];return arguments[0]=function(a,o,l){return i(a,o,l,t)},n[e].apply(n,arguments)}}var DC=yo("ObservableArrayAdministration",ky);function Xr(e){return Uh(e)&&DC(e[Ke])}var jC={},Za="add",hh="delete",Qh=function(){function e(r,n,i){var a=this;n===void 0&&(n=ol),i===void 0&&(i="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[Ke]=jC,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=n,this.name_=i,Cn(Map)||nt(18),bo(function(){a.keysAtom_=vc("ObservableMap.keys()"),a.data_=new Map,a.hasMap_=new Map,r&&a.merge(r)})}var t=e.prototype;return t.has_=function(n){return this.data_.has(n)},t.has=function(n){var i=this;if(!Ae.trackingDerivation)return this.has_(n);var a=this.hasMap_.get(n);if(!a){var o=a=new oo(this.has_(n),$h,"ObservableMap.key?",!1);this.hasMap_.set(n,o),wy(o,function(){return i.hasMap_.delete(n)})}return a.get()},t.set=function(n,i){var a=this.has_(n);if(Vn(this)){var o=qn(this,{type:a?Hi:Za,object:this,newValue:i,name:n});if(!o)return this;i=o.newValue}return a?this.updateValue_(n,i):this.addValue_(n,i),this},t.delete=function(n){var i=this;if(this.keysAtom_,Vn(this)){var a=qn(this,{type:hh,object:this,name:n});if(!a)return!1}if(this.has_(n)){var o=Xu(),l=pi(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:hh,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return Di(function(){var f;i.keysAtom_.reportChanged(),(f=i.hasMap_.get(n))==null||f.setNewValue_(!1);var h=i.data_.get(n);h.setNewValue_(void 0),i.data_.delete(n)}),l&&gi(this,u),!0}return!1},t.updateValue_=function(n,i){var a=this.data_.get(n);if(i=a.prepareNewValue_(i),i!==Ae.UNCHANGED){var o=Xu(),l=pi(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:Hi,object:this,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),l&&gi(this,u)}},t.addValue_=function(n,i){var a=this;this.keysAtom_,Di(function(){var f,h=new oo(i,a.enhancer_,"ObservableMap.key",!1);a.data_.set(n,h),i=h.value_,(f=a.hasMap_.get(n))==null||f.setNewValue_(!0),a.keysAtom_.reportChanged()});var o=Xu(),l=pi(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:Za,object:this,name:n,newValue:i}:null;l&&gi(this,u)},t.get=function(n){return this.has(n)?this.dehanceValue_(this.data_.get(n).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var n=this,i=this.keys();return yc({next:function(){var o=i.next(),l=o.done,u=o.value;return{done:l,value:l?void 0:n.get(u)}}})},t.entries=function(){var n=this,i=this.keys();return yc({next:function(){var o=i.next(),l=o.done,u=o.value;return{done:l,value:l?void 0:[u,n.get(u)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(n,i){for(var a=ss(this),o;!(o=a()).done;){var l=o.value,u=l[0],f=l[1];n.call(i,f,u,this)}},t.merge=function(n){var i=this;return Mr(n)&&(n=new Map(n)),Di(function(){_a(n)?Vx(n).forEach(function(a){return i.set(a,n[a])}):Array.isArray(n)?n.forEach(function(a){var o=a[0],l=a[1];return i.set(o,l)}):Hs(n)?(Gx(n)||nt(19,n),n.forEach(function(a,o){return i.set(o,a)})):n!=null&&nt(20,n)}),this},t.clear=function(){var n=this;Di(function(){by(function(){for(var i=ss(n.keys()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},t.replace=function(n){var i=this;return Di(function(){for(var a=FC(n),o=new Map,l=!1,u=ss(i.data_.keys()),f;!(f=u()).done;){var h=f.value;if(!a.has(h)){var E=i.delete(h);if(E)l=!0;else{var w=i.data_.get(h);o.set(h,w)}}}for(var p=ss(a.entries()),S;!(S=p()).done;){var b=S.value,y=b[0],v=b[1],m=i.data_.has(y);if(i.set(y,v),i.data_.has(y)){var d=i.data_.get(y);o.set(y,d),m||(l=!0)}}if(!l)if(i.data_.size!==o.size)i.keysAtom_.reportChanged();else for(var g=i.data_.keys(),_=o.keys(),k=g.next(),C=_.next();!k.done;){if(k.value!==C.value){i.keysAtom_.reportChanged();break}k=g.next(),C=_.next()}i.data_=o}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(n,i){return zc(this,n)},t.intercept_=function(n){return Fc(this,n)},Hh(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),Mr=yo("ObservableMap",Qh);function FC(e){if(Hs(e)||Mr(e))return e;if(Array.isArray(e))return new Map(e);if(_a(e)){var t=new Map;for(var r in e)t.set(r,e[r]);return t}else return nt(21,e)}var zC={},Ty=function(){function e(r,n,i){var a=this;n===void 0&&(n=ol),i===void 0&&(i="ObservableSet"),this.name_=void 0,this[Ke]=zC,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=i,Cn(Set)||nt(22),this.enhancer_=function(o,l){return n(o,l,i)},bo(function(){a.atom_=vc(a.name_),r&&a.replace(r)})}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.clear=function(){var n=this;Di(function(){by(function(){for(var i=ss(n.data_.values()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},t.forEach=function(n,i){for(var a=ss(this),o;!(o=a()).done;){var l=o.value;n.call(i,l,l,this)}},t.add=function(n){var i=this;if(this.atom_,Vn(this)){var a=qn(this,{type:Za,object:this,newValue:n});if(!a)return this}if(!this.has(n)){Di(function(){i.data_.add(i.enhancer_(n,void 0)),i.atom_.reportChanged()});var o=!1,l=pi(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:Za,object:this,newValue:n}:null;l&&gi(this,u)}return this},t.delete=function(n){var i=this;if(Vn(this)){var a=qn(this,{type:hh,object:this,oldValue:n});if(!a)return!1}if(this.has(n)){var o=!1,l=pi(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:hh,object:this,oldValue:n}:null;return Di(function(){i.atom_.reportChanged(),i.data_.delete(n)}),l&&gi(this,u),!0}return!1},t.has=function(n){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(n))},t.entries=function(){var n=0,i=Array.from(this.keys()),a=Array.from(this.values());return yc({next:function(){var l=n;return n+=1,l<a.length?{value:[i[l],a[l]],done:!1}:{done:!0}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var n=this,i=0,a=Array.from(this.data_.values());return yc({next:function(){return i<a.length?{value:n.dehanceValue_(a[i++]),done:!1}:{done:!0}}})},t.intersection=function(n){if(sa(n))return n.intersection(this);var i=new Set(this);return i.intersection(n)},t.union=function(n){if(sa(n))return n.union(this);var i=new Set(this);return i.union(n)},t.difference=function(n){return new Set(this).difference(n)},t.symmetricDifference=function(n){if(sa(n))return n.symmetricDifference(this);var i=new Set(this);return i.symmetricDifference(n)},t.isSubsetOf=function(n){return new Set(this).isSubsetOf(n)},t.isSupersetOf=function(n){return new Set(this).isSupersetOf(n)},t.isDisjointFrom=function(n){if(sa(n))return n.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(n)},t.replace=function(n){var i=this;return Wr(n)&&(n=new Set(n)),Di(function(){Array.isArray(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):sa(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):n!=null&&nt("Cannot initialize set from "+n)}),this},t.observe_=function(n,i){return zc(this,n)},t.intercept_=function(n){return Fc(this,n)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[Symbol.iterator]=function(){return this.values()},Hh(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),Wr=yo("ObservableSet",Ty),w5=Object.create(null),S5="remove",$8=function(){function e(r,n,i,a){n===void 0&&(n=new Map),a===void 0&&(a=PP),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=r,this.values_=n,this.name_=i,this.defaultAnnotation_=a,this.keysAtom_=new Ic("ObservableObject.keys"),this.isPlainObject_=_a(this.target_)}var t=e.prototype;return t.getObservablePropValue_=function(n){return this.values_.get(n).get()},t.setObservablePropValue_=function(n,i){var a=this.values_.get(n);if(a instanceof Gi)return a.set(i),!0;if(Vn(this)){var o=qn(this,{type:Hi,object:this.proxy_||this.target_,name:n,newValue:i});if(!o)return null;i=o.newValue}if(i=a.prepareNewValue_(i),i!==Ae.UNCHANGED){var l=pi(this),u=!1,f=l||u?{type:Hi,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),l&&gi(this,f)}return!0},t.get_=function(n){return Ae.trackingDerivation&&!da(this.target_,n)&&this.has_(n),this.target_[n]},t.set_=function(n,i,a){return a===void 0&&(a=!1),da(this.target_,n)?this.values_.has(n)?this.setObservablePropValue_(n,i):a?Reflect.set(this.target_,n,i):(this.target_[n]=i,!0):this.extend_(n,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,a)},t.has_=function(n){if(!Ae.trackingDerivation)return n in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(n);return i||(i=new oo(n in this.target_,$h,"ObservableObject.key?",!1),this.pendingKeys_.set(n,i)),i.get()},t.make_=function(n,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(!(n in this.target_)){var a;if((a=this.target_[Fi])!=null&&a[n])return;nt(1,i.annotationType_,this.name_+"."+n.toString())}for(var o=this.target_;o&&o!==Mc;){var l=lh(o,n);if(l){var u=i.make_(this,n,l,o);if(u===0)return;if(u===1)break}o=Object.getPrototypeOf(o)}O5(this,i,n)}},t.extend_=function(n,i,a,o){if(o===void 0&&(o=!1),a===!0&&(a=this.defaultAnnotation_),a===!1)return this.defineProperty_(n,i,o);var l=a.extend_(this,n,i,o);return l&&O5(this,a,n),l},t.defineProperty_=function(n,i,a){a===void 0&&(a=!1),this.keysAtom_;try{fn();var o=this.delete_(n);if(!o)return o;if(Vn(this)){var l=qn(this,{object:this.proxy_||this.target_,name:n,type:Za,newValue:i.value});if(!l)return null;var u=l.newValue;i.value!==u&&(i=co({},i,{value:u}))}if(a){if(!Reflect.defineProperty(this.target_,n,i))return!1}else Ui(this.target_,n,i);this.notifyPropertyAddition_(n,i.value)}finally{dn()}return!0},t.defineObservableProperty_=function(n,i,a,o){o===void 0&&(o=!1),this.keysAtom_;try{fn();var l=this.delete_(n);if(!l)return l;if(Vn(this)){var u=qn(this,{object:this.proxy_||this.target_,name:n,type:Za,newValue:i});if(!u)return null;i=u.newValue}var f=E5(n),h={configurable:Ae.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:f.get,set:f.set};if(o){if(!Reflect.defineProperty(this.target_,n,h))return!1}else Ui(this.target_,n,h);var E=new oo(i,a,"ObservableObject.key",!1);this.values_.set(n,E),this.notifyPropertyAddition_(n,E.value_)}finally{dn()}return!0},t.defineComputedProperty_=function(n,i,a){a===void 0&&(a=!1),this.keysAtom_;try{fn();var o=this.delete_(n);if(!o)return o;if(Vn(this)){var l=qn(this,{object:this.proxy_||this.target_,name:n,type:Za,newValue:void 0});if(!l)return null}i.name||(i.name="ObservableObject.key"),i.context=this.proxy_||this.target_;var u=E5(n),f={configurable:Ae.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:u.get,set:u.set};if(a){if(!Reflect.defineProperty(this.target_,n,f))return!1}else Ui(this.target_,n,f);this.values_.set(n,new Gi(i)),this.notifyPropertyAddition_(n,void 0)}finally{dn()}return!0},t.delete_=function(n,i){if(i===void 0&&(i=!1),this.keysAtom_,!da(this.target_,n))return!0;if(Vn(this)){var a=qn(this,{object:this.proxy_||this.target_,name:n,type:S5});if(!a)return null}try{var o;fn();var l=pi(this),u=!1,f=this.values_.get(n),h=void 0;if(!f&&(l||u)){var E;h=(E=lh(this.target_,n))==null?void 0:E.value}if(i){if(!Reflect.deleteProperty(this.target_,n))return!1}else delete this.target_[n];if(f&&(this.values_.delete(n),f instanceof oo&&(h=f.value_),b8(f)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(o=o.get(n))==null||o.set(n in this.target_),l||u){var w={type:S5,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:h,name:n};l&&gi(this,w)}}finally{dn()}return!0},t.observe_=function(n,i){return zc(this,n)},t.intercept_=function(n){return Fc(this,n)},t.notifyPropertyAddition_=function(n,i){var a,o=pi(this),l=!1;if(o||l){var u=o||l?{type:Za,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:i}:null;o&&gi(this,u)}(a=this.pendingKeys_)==null||(a=a.get(n))==null||a.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),Os(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function pl(e,t){var r;if(da(e,Ke))return e;var n=(r=t==null?void 0:t.name)!=null?r:"ObservableObject",i=new $8(e,new Map,String(n),jP(t));return Lc(e,Ke,i),e}var BC=yo("ObservableObjectAdministration",$8);function E5(e){return w5[e]||(w5[e]={get:function(){return this[Ke].getObservablePropValue_(e)},set:function(r){return this[Ke].setObservablePropValue_(e,r)}})}function Or(e){return Uh(e)?BC(e[Ke]):!1}function O5(e,t,r){var n;(n=e.target_[Fi])==null||delete n[r]}var UC=V8(0),HC=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),z1=0,G8=function(){};function $C(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}$C(G8,Array.prototype);var Ay=function(e){function t(n,i,a,o){var l;return a===void 0&&(a="ObservableArray"),o===void 0&&(o=!1),l=e.call(this)||this,bo(function(){var u=new ky(a,i,o,!0);u.proxy_=l,Xw(l,Ke,u),n&&n.length&&l.spliceWithArray(0,0,n),HC&&Object.defineProperty(l,"0",UC)}),l}Jw(t,e);var r=t.prototype;return r.concat=function(){this[Ke].atom_.reportObserved();for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return Array.prototype.concat.apply(this.slice(),a.map(function(l){return Xr(l)?l.slice():l}))},r[Symbol.iterator]=function(){var n=this,i=0;return yc({next:function(){return i<n.length?{value:n[i++],done:!1}:{done:!0,value:void 0}}})},Hh(t,[{key:"length",get:function(){return this[Ke].getArrayLength_()},set:function(i){this[Ke].setArrayLength_(i)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(G8);Object.entries(dh).forEach(function(e){var t=e[0],r=e[1];t!=="concat"&&Lc(Ay.prototype,t,r)});function V8(e){return{enumerable:!1,configurable:!0,get:function(){return this[Ke].get_(e)},set:function(r){this[Ke].set_(e,r)}}}function GC(e){Ui(Ay.prototype,""+e,V8(e))}function q8(e){if(e>z1){for(var t=z1;t<e+100;t++)GC(t);z1=e}}q8(1e3);function VC(e,t,r){return new Ay(e,t,r)}function Vi(e,t){if(typeof e=="object"&&e!==null){if(Xr(e))return t!==void 0&&nt(23),e[Ke].atom_;if(Wr(e))return e.atom_;if(Mr(e)){if(t===void 0)return e.keysAtom_;var r=e.data_.get(t)||e.hasMap_.get(t);return r||nt(25,t,ph(e)),r}if(Or(e)){if(!t)return nt(26);var n=e[Ke].values_.get(t);return n||nt(27,t,ph(e)),n}if(gy(e)||ll(e)||fh(e))return e}else if(Cn(e)&&fh(e[Ke]))return e[Ke];nt(28)}function yi(e,t){if(e||nt(29),t!==void 0)return yi(Vi(e,t));if(gy(e)||ll(e)||fh(e)||Mr(e)||Wr(e))return e;if(e[Ke])return e[Ke];nt(24,e)}function ph(e,t){var r;if(t!==void 0)r=Vi(e,t);else{if(jc(e))return e.name;Or(e)||Mr(e)||Wr(e)?r=yi(e):r=Vi(e)}return r.name_}function bo(e){var t=hl(),r=Vh(!0);fn();try{return e()}finally{dn(),qh(r),ha(t)}}var x5=Mc.toString;function Ry(e,t,r){return r===void 0&&(r=-1),im(e,t,r)}function im(e,t,r,n,i){if(e===t)return e!==0||1/e===1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var a=typeof e;if(a!=="function"&&a!=="object"&&typeof t!="object")return!1;var o=x5.call(e);if(o!==x5.call(t))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:+e==0?1/+e===1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":r>=0&&r++;break}e=P5(e),t=P5(t);var l=o==="[object Array]";if(!l){if(typeof e!="object"||typeof t!="object")return!1;var u=e.constructor,f=t.constructor;if(u!==f&&!(Cn(u)&&u instanceof u&&Cn(f)&&f instanceof f)&&"constructor"in e&&"constructor"in t)return!1}if(r===0)return!1;r<0&&(r=-1),n=n||[],i=i||[];for(var h=n.length;h--;)if(n[h]===e)return i[h]===t;if(n.push(e),i.push(t),l){if(h=e.length,h!==t.length)return!1;for(;h--;)if(!im(e[h],t[h],r-1,n,i))return!1}else{var E=Object.keys(e),w;if(h=E.length,Object.keys(t).length!==h)return!1;for(;h--;)if(w=E[h],!(da(t,w)&&im(e[w],t[w],r-1,n,i)))return!1}return n.pop(),i.pop(),!0}function P5(e){return Xr(e)?e.slice():Hs(e)||Mr(e)||sa(e)||Wr(e)?Array.from(e.entries()):e}function yc(e){return e[Symbol.iterator]=qC,e}function qC(){return this}["Symbol","Map","Set"].forEach(function(e){var t=hy();typeof t[e]>"u"&&nt("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:w8,extras:{getDebugName:ph},$mobx:Ke});const WC=Object.freeze(Object.defineProperty({__proto__:null,$mobx:Ke,FlowCancellationError:Kh,ObservableMap:Qh,ObservableSet:Ty,Reaction:xs,_allowStateChanges:my,_allowStateChangesInsideComputed:Cs,_allowStateReadsEnd:vs,_allowStateReadsStart:Wh,_autoAction:Ps,_endAction:f8,_getAdministration:yi,_getGlobalState:g8,_interceptReads:Ey,_isComputingDerivation:GP,_resetGlobalState:KP,_startAction:c8,action:or,autorun:_y,comparer:al,computed:dl,configure:A8,createAtom:vc,defineProperty:Py,entries:F8,extendObservable:Sy,flow:sl,flowResult:bC,get:OC,getAtom:Vi,getDebugName:ph,getDependencyTree:R8,getObserverTree:pC,has:z8,intercept:Yh,isAction:jc,isBoxedObservable:yy,isComputed:SC,isComputedProp:I8,isFlow:ks,isFlowCancellationError:mC,isObservable:Xh,isObservableArray:Xr,isObservableMap:Mr,isObservableObject:Or,isObservableProp:j8,isObservableSet:Wr,keys:mc,makeAutoObservable:MC,makeObservable:Cy,observable:Tt,observe:Zh,onBecomeObserved:k8,onBecomeUnobserved:wy,onReactionError:eC,override:iP,ownKeys:B8,reaction:C8,remove:EC,runInAction:Cs,set:xy,spy:w8,toJS:CC,trace:kC,transaction:Di,untracked:by,values:Oy,when:nm},Symbol.toStringTag,{value:"Module"}));if(!Je.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!Cy)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");function KC(e){e()}function W8(e){e||(e=KC),A8({reactionScheduler:e})}var YC=function(){return!0};function XC(e){return R8(e)}var K8=!1;function Y8(e){K8=e}function My(){return K8}var ZC=1e4,QC=1e4,JC=function(){function e(t){var r=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(n){n===void 0&&(n=ZC),clearTimeout(r.sweepTimeout),r.sweepTimeout=void 0;var i=Date.now();r.registrations.forEach(function(a,o){i-a.registeredAt>=n&&(r.finalize(a.value),r.registrations.delete(o))}),r.registrations.size>0&&r.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){r.sweep(0)}})}return Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){this.registrations.set(n,{value:r,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.registrations.delete(t)}}),Object.defineProperty(e.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,QC))}}),e}(),ek=typeof FinalizationRegistry<"u"?FinalizationRegistry:JC,gh=new ek(function(e){var t;(t=e.reaction)===null||t===void 0||t.dispose(),e.reaction=null}),X8={exports:{}},Z8={};/**
35
+ * @license React
36
+ * use-sync-external-store-shim.production.min.js
37
+ *
38
+ * Copyright (c) Facebook, Inc. and its affiliates.
39
+ *
40
+ * This source code is licensed under the MIT license found in the
41
+ * LICENSE file in the root directory of this source tree.
42
+ */var Ts=Je;function tk(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var rk=typeof Object.is=="function"?Object.is:tk,nk=Ts.useState,ik=Ts.useEffect,ak=Ts.useLayoutEffect,ok=Ts.useDebugValue;function lk(e,t){var r=t(),n=nk({inst:{value:r,getSnapshot:t}}),i=n[0].inst,a=n[1];return ak(function(){i.value=r,i.getSnapshot=t,B1(i)&&a({inst:i})},[e,r,t]),ik(function(){return B1(i)&&a({inst:i}),e(function(){B1(i)&&a({inst:i})})},[e]),ok(r),r}function B1(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!rk(e,r)}catch{return!0}}function sk(e,t){return t()}var uk=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?sk:lk;Z8.useSyncExternalStore=Ts.useSyncExternalStore!==void 0?Ts.useSyncExternalStore:uk;X8.exports=Z8;var ck=X8.exports;function C5(e){e.reaction=new xs("observer".concat(e.name),function(){var t;e.stateVersion=Symbol(),(t=e.onStoreChange)===null||t===void 0||t.call(e)})}function Ly(e,t){if(t===void 0&&(t="observed"),My())return e();var r=ht.useRef(null);if(!r.current){var n={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:t,subscribe:function(l){return gh.unregister(n),n.onStoreChange=l,n.reaction||(C5(n),n.stateVersion=Symbol()),function(){var u;n.onStoreChange=null,(u=n.reaction)===null||u===void 0||u.dispose(),n.reaction=null}},getSnapshot:function(){return n.stateVersion}};r.current=n}var i=r.current;i.reaction||(C5(i),gh.register(r,i,i)),ht.useDebugValue(i.reaction,XC),ck.useSyncExternalStore(i.subscribe,i.getSnapshot,i.getSnapshot);var a,o;if(i.reaction.track(function(){try{a=e()}catch(l){o=l}}),o)throw o;return a}var U1,H1,Q8=typeof Symbol=="function"&&Symbol.for,fk=(H1=(U1=Object.getOwnPropertyDescriptor(function(){},"name"))===null||U1===void 0?void 0:U1.configurable)!==null&&H1!==void 0?H1:!1,k5=Q8?Symbol.for("react.forward_ref"):typeof Je.forwardRef=="function"&&Je.forwardRef(function(e){return null}).$$typeof,T5=Q8?Symbol.for("react.memo"):typeof Je.memo=="function"&&Je.memo(function(e){return null}).$$typeof;function dk(e,t){var r;if(T5&&e.$$typeof===T5)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 e;var n=(r=t==null?void 0:t.forwardRef)!==null&&r!==void 0?r:!1,i=e,a=e.displayName||e.name;if(k5&&e.$$typeof===k5&&(n=!0,i=e.render,typeof i!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var o=function(l,u){return Ly(function(){return i(l,u)},a)};return o.displayName=e.displayName,fk&&Object.defineProperty(o,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(o.contextTypes=e.contextTypes),n&&(o=Je.forwardRef(o)),o=Je.memo(o),pk(e,o),o}var hk={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function pk(e,t){Object.keys(e).forEach(function(r){hk[r]||Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}function J8(e){var t=e.children,r=e.render,n=t||r;return typeof n!="function"?null:Ly(n)}J8.displayName="Observer";function gk(e,t){return Je.useState(function(){return Tt(e(),t,{autoBind:!0})})[0]}function e9(e){var t=Je.useState(function(){return Tt(e,{},{deep:!1})})[0];return Cs(function(){Object.assign(t,e)}),t}function vk(e,t){var r=t&&e9(t);return Je.useState(function(){return Tt(e(r),void 0,{autoBind:!0})})[0]}var $1;W8(Gw.unstable_batchedUpdates);var mk=($1=gh.finalizeAllImmediately)!==null&&$1!==void 0?$1:function(){};function yk(e,t){return t===void 0&&(t="observed"),Ly(e,t)}function bk(e){Y8(e)}const _k=Object.freeze(Object.defineProperty({__proto__:null,Observer:J8,_observerFinalizationRegistry:gh,clearTimers:mk,enableStaticRendering:Y8,isObserverBatched:YC,isUsingStaticRendering:My,observer:dk,observerBatching:W8,useAsObservableSource:e9,useLocalObservable:gk,useLocalStore:vk,useObserver:yk,useStaticRendering:bk},Symbol.toStringTag,{value:"Module"})),_i=po(_k);var t9={};const Ki=po(WC);var Ny={exports:{}},Jh={},vh={},ut={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._registerNode=e.Konva=e.glob=void 0;const t=Math.PI/180;function r(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}e.glob=typeof me<"u"?me:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},e.Konva={_global:e.glob,version:"9.3.13",isBrowser:r(),isUnminified:/param/.test((function(i){}).toString()),dblClickWindow:400,getAngle(i){return e.Konva.angleDeg?i*t: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 e.Konva.DD.isDragging},isTransforming(){var i;return(i=e.Konva.Transformer)===null||i===void 0?void 0:i.isTransforming()},isDragReady(){return!!e.Konva.DD.node},releaseCanvasOnDestroy:!0,document:e.glob.document,_injectGlobal(i){e.glob.Konva=i}};const n=i=>{e.Konva[i.prototype.getClassName()]=i};e._registerNode=n,e.Konva._injectGlobal(e.Konva)})(ut);var Zt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const t=ut;class r{constructor(g=[1,0,0,1,0,0]){this.dirty=!1,this.m=g&&g.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 r(this.m)}copyInto(g){g.m[0]=this.m[0],g.m[1]=this.m[1],g.m[2]=this.m[2],g.m[3]=this.m[3],g.m[4]=this.m[4],g.m[5]=this.m[5]}point(g){var _=this.m;return{x:_[0]*g.x+_[2]*g.y+_[4],y:_[1]*g.x+_[3]*g.y+_[5]}}translate(g,_){return this.m[4]+=this.m[0]*g+this.m[2]*_,this.m[5]+=this.m[1]*g+this.m[3]*_,this}scale(g,_){return this.m[0]*=g,this.m[1]*=g,this.m[2]*=_,this.m[3]*=_,this}rotate(g){var _=Math.cos(g),k=Math.sin(g),C=this.m[0]*_+this.m[2]*k,P=this.m[1]*_+this.m[3]*k,O=this.m[0]*-k+this.m[2]*_,x=this.m[1]*-k+this.m[3]*_;return this.m[0]=C,this.m[1]=P,this.m[2]=O,this.m[3]=x,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(g,_){var k=this.m[0]+this.m[2]*_,C=this.m[1]+this.m[3]*_,P=this.m[2]+this.m[0]*g,O=this.m[3]+this.m[1]*g;return this.m[0]=k,this.m[1]=C,this.m[2]=P,this.m[3]=O,this}multiply(g){var _=this.m[0]*g.m[0]+this.m[2]*g.m[1],k=this.m[1]*g.m[0]+this.m[3]*g.m[1],C=this.m[0]*g.m[2]+this.m[2]*g.m[3],P=this.m[1]*g.m[2]+this.m[3]*g.m[3],O=this.m[0]*g.m[4]+this.m[2]*g.m[5]+this.m[4],x=this.m[1]*g.m[4]+this.m[3]*g.m[5]+this.m[5];return this.m[0]=_,this.m[1]=k,this.m[2]=C,this.m[3]=P,this.m[4]=O,this.m[5]=x,this}invert(){var g=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),_=this.m[3]*g,k=-this.m[1]*g,C=-this.m[2]*g,P=this.m[0]*g,O=g*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),x=g*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=_,this.m[1]=k,this.m[2]=C,this.m[3]=P,this.m[4]=O,this.m[5]=x,this}getMatrix(){return this.m}decompose(){var g=this.m[0],_=this.m[1],k=this.m[2],C=this.m[3],P=this.m[4],O=this.m[5],x=g*C-_*k;let A={x:P,y:O,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(g!=0||_!=0){var L=Math.sqrt(g*g+_*_);A.rotation=_>0?Math.acos(g/L):-Math.acos(g/L),A.scaleX=L,A.scaleY=x/L,A.skewX=(g*k+_*C)/x,A.skewY=0}else if(k!=0||C!=0){var I=Math.sqrt(k*k+C*C);A.rotation=Math.PI/2-(C>0?Math.acos(-k/I):-Math.acos(k/I)),A.scaleX=x/I,A.scaleY=I,A.skewX=0,A.skewY=(g*k+_*C)/x}return A.rotation=e.Util._getRotation(A.rotation),A}}e.Transform=r;var n="[object Array]",i="[object Number]",a="[object String]",o="[object Boolean]",l=Math.PI/180,u=180/Math.PI,f="#",h="",E="0",w="Konva warning: ",p="Konva error: ",S="rgb(",b={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]},y=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,v=[];const m=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(d){setTimeout(d,60)};e.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)===n},_isNumber(d){return Object.prototype.toString.call(d)===i&&!isNaN(d)&&isFinite(d)},_isString(d){return Object.prototype.toString.call(d)===a},_isBoolean(d){return Object.prototype.toString.call(d)===o},isObject(d){return d instanceof Object},isValidSelector(d){if(typeof d!="string")return!1;var g=d[0];return g==="#"||g==="."||g===g.toUpperCase()},_sign(d){return d===0||d>0?1:-1},requestAnimFrame(d){v.push(d),v.length===1&&m(function(){const g=v;v=[],g.forEach(function(_){_()})})},createCanvasElement(){var 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,g){var _=e.Util.createImageElement();_.onload=function(){g(_)},_.src=d},_rgbToHex(d,g,_){return((1<<24)+(d<<16)+(g<<8)+_).toString(16).slice(1)},_hexToRgb(d){d=d.replace(f,h);var g=parseInt(d,16);return{r:g>>16&255,g:g>>8&255,b:g&255}},getRandomColor(){for(var d=(Math.random()*16777215<<0).toString(16);d.length<6;)d=E+d;return f+d},getRGB(d){var g;return d in b?(g=b[d],{r:g[0],g:g[1],b:g[2]}):d[0]===f?this._hexToRgb(d.substring(1)):d.substr(0,4)===S?(g=y.exec(d.replace(/ /g,"")),{r:parseInt(g[1],10),g:parseInt(g[2],10),b:parseInt(g[3],10)}):{r:0,g:0,b:0}},colorToRGBA(d){return d=d||"black",e.Util._namedColorToRBA(d)||e.Util._hex3ColorToRGBA(d)||e.Util._hex4ColorToRGBA(d)||e.Util._hex6ColorToRGBA(d)||e.Util._hex8ColorToRGBA(d)||e.Util._rgbColorToRGBA(d)||e.Util._rgbaColorToRGBA(d)||e.Util._hslColorToRGBA(d)},_namedColorToRBA(d){var g=b[d.toLowerCase()];return g?{r:g[0],g:g[1],b:g[2],a:1}:null},_rgbColorToRGBA(d){if(d.indexOf("rgb(")===0){d=d.match(/rgb\(([^)]+)\)/)[1];var g=d.split(/ *, */).map(Number);return{r:g[0],g:g[1],b:g[2],a:1}}},_rgbaColorToRGBA(d){if(d.indexOf("rgba(")===0){d=d.match(/rgba\(([^)]+)\)/)[1];var g=d.split(/ *, */).map((_,k)=>_.slice(-1)==="%"?k===3?parseInt(_)/100:parseInt(_)/100*255:Number(_));return{r:g[0],g:g[1],b:g[2],a:g[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[g,..._]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(d),k=Number(_[0])/360,C=Number(_[1])/100,P=Number(_[2])/100;let O,x,A;if(C===0)return A=P*255,{r:Math.round(A),g:Math.round(A),b:Math.round(A),a:1};P<.5?O=P*(1+C):O=P+C-P*C;const L=2*P-O,I=[0,0,0];for(let U=0;U<3;U++)x=k+1/3*-(U-1),x<0&&x++,x>1&&x--,6*x<1?A=L+(O-L)*6*x:2*x<1?A=O:3*x<2?A=L+(O-L)*(2/3-x)*6:A=L,I[U]=A*255;return{r:Math.round(I[0]),g:Math.round(I[1]),b:Math.round(I[2]),a:1}}},haveIntersection(d,g){return!(g.x>d.x+d.width||g.x+g.width<d.x||g.y>d.y+d.height||g.y+g.height<d.y)},cloneObject(d){var g={};for(var _ in d)this._isPlainObject(d[_])?g[_]=this.cloneObject(d[_]):this._isArray(d[_])?g[_]=this.cloneArray(d[_]):g[_]=d[_];return g},cloneArray(d){return d.slice(0)},degToRad(d){return d*l},radToDeg(d){return d*u},_degToRad(d){return e.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),e.Util.degToRad(d)},_radToDeg(d){return e.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),e.Util.radToDeg(d)},_getRotation(d){return t.Konva.angleDeg?e.Util.radToDeg(d):d},_capitalize(d){return d.charAt(0).toUpperCase()+d.slice(1)},throw(d){throw new Error(p+d)},error(d){console.error(p+d)},warn(d){t.Konva.showWarnings&&console.warn(w+d)},each(d,g){for(var _ in d)g(_,d[_])},_inRange(d,g,_){return g<=d&&d<_},_getProjectionToSegment(d,g,_,k,C,P){var O,x,A,L=(d-_)*(d-_)+(g-k)*(g-k);if(L==0)O=d,x=g,A=(C-_)*(C-_)+(P-k)*(P-k);else{var I=((C-d)*(_-d)+(P-g)*(k-g))/L;I<0?(O=d,x=g,A=(d-C)*(d-C)+(g-P)*(g-P)):I>1?(O=_,x=k,A=(_-C)*(_-C)+(k-P)*(k-P)):(O=d+I*(_-d),x=g+I*(k-g),A=(O-C)*(O-C)+(x-P)*(x-P))}return[O,x,A]},_getProjectionToLine(d,g,_){var k=e.Util.cloneObject(d),C=Number.MAX_VALUE;return g.forEach(function(P,O){if(!(!_&&O===g.length-1)){var x=g[(O+1)%g.length],A=e.Util._getProjectionToSegment(P.x,P.y,x.x,x.y,d.x,d.y),L=A[0],I=A[1],U=A[2];U<C&&(k.x=L,k.y=I,C=U)}}),k},_prepareArrayForTween(d,g,_){var k,C=[],P=[];if(d.length>g.length){var O=g;g=d,d=O}for(k=0;k<d.length;k+=2)C.push({x:d[k],y:d[k+1]});for(k=0;k<g.length;k+=2)P.push({x:g[k],y:g[k+1]});var x=[];return P.forEach(function(A){var L=e.Util._getProjectionToLine(A,C,_);x.push(L.x),x.push(L.y)}),x},_prepareToStringify(d){var g;d.visitedByCircularReferenceRemoval=!0;for(var _ in d)if(d.hasOwnProperty(_)&&d[_]&&typeof d[_]=="object"){if(g=Object.getOwnPropertyDescriptor(d,_),d[_].visitedByCircularReferenceRemoval||e.Util._isElement(d[_]))if(g.configurable)delete d[_];else return null;else if(e.Util._prepareToStringify(d[_])===null)if(g.configurable)delete d[_];else return null}return delete d.visitedByCircularReferenceRemoval,d},_assign(d,g){for(var _ in g)d[_]=g[_];return d},_getFirstPointerId(d){return d.touches?d.changedTouches[0].identifier:d.pointerId||999},releaseCanvas(...d){t.Konva.releaseCanvasOnDestroy&&d.forEach(g=>{g.width=0,g.height=0})},drawRoundedRectPath(d,g,_,k){let C=0,P=0,O=0,x=0;typeof k=="number"?C=P=O=x=Math.min(k,g/2,_/2):(C=Math.min(k[0]||0,g/2,_/2),P=Math.min(k[1]||0,g/2,_/2),x=Math.min(k[2]||0,g/2,_/2),O=Math.min(k[3]||0,g/2,_/2)),d.moveTo(C,0),d.lineTo(g-P,0),d.arc(g-P,P,P,Math.PI*3/2,0,!1),d.lineTo(g,_-x),d.arc(g-x,_-x,x,0,Math.PI/2,!1),d.lineTo(O,_),d.arc(O,_-O,O,Math.PI/2,Math.PI,!1),d.lineTo(0,C),d.arc(C,C,C,Math.PI,Math.PI*3/2,!1)}}})(Zt);var Vt={},ft={},qe={};Object.defineProperty(qe,"__esModule",{value:!0});qe.getComponentValidator=qe.getBooleanValidator=qe.getNumberArrayValidator=qe.getFunctionValidator=qe.getStringOrGradientValidator=qe.getStringValidator=qe.getNumberOrAutoValidator=qe.getNumberOrArrayOfNumbersValidator=qe.getNumberValidator=qe.alphaComponent=qe.RGBComponent=void 0;const Ea=ut,Jt=Zt;function Oa(e){return Jt.Util._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||Jt.Util._isBoolean(e)?e:Object.prototype.toString.call(e)}function wk(e){return e>255?255:e<0?0:Math.round(e)}qe.RGBComponent=wk;function Sk(e){return e>1?1:e<1e-4?1e-4:e}qe.alphaComponent=Sk;function Ek(){if(Ea.Konva.isUnminified)return function(e,t){return Jt.Util._isNumber(e)||Jt.Util.warn(Oa(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}qe.getNumberValidator=Ek;function Ok(e){if(Ea.Konva.isUnminified)return function(t,r){let n=Jt.Util._isNumber(t),i=Jt.Util._isArray(t)&&t.length==e;return!n&&!i&&Jt.Util.warn(Oa(t)+' is a not valid value for "'+r+'" attribute. The value should be a number or Array<number>('+e+")"),t}}qe.getNumberOrArrayOfNumbersValidator=Ok;function xk(){if(Ea.Konva.isUnminified)return function(e,t){var r=Jt.Util._isNumber(e),n=e==="auto";return r||n||Jt.Util.warn(Oa(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}qe.getNumberOrAutoValidator=xk;function Pk(){if(Ea.Konva.isUnminified)return function(e,t){return Jt.Util._isString(e)||Jt.Util.warn(Oa(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}qe.getStringValidator=Pk;function Ck(){if(Ea.Konva.isUnminified)return function(e,t){const r=Jt.Util._isString(e),n=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return r||n||Jt.Util.warn(Oa(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}qe.getStringOrGradientValidator=Ck;function kk(){if(Ea.Konva.isUnminified)return function(e,t){return Jt.Util._isFunction(e)||Jt.Util.warn(Oa(e)+' is a not valid value for "'+t+'" attribute. The value should be a function.'),e}}qe.getFunctionValidator=kk;function Tk(){if(Ea.Konva.isUnminified)return function(e,t){const r=Int8Array?Object.getPrototypeOf(Int8Array):null;return r&&e instanceof r||(Jt.Util._isArray(e)?e.forEach(function(n){Jt.Util._isNumber(n)||Jt.Util.warn('"'+t+'" attribute has non numeric element '+n+". Make sure that all elements are numbers.")}):Jt.Util.warn(Oa(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}qe.getNumberArrayValidator=Tk;function Ak(){if(Ea.Konva.isUnminified)return function(e,t){var r=e===!0||e===!1;return r||Jt.Util.warn(Oa(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}qe.getBooleanValidator=Ak;function Rk(e){if(Ea.Konva.isUnminified)return function(t,r){return t==null||Jt.Util.isObject(t)||Jt.Util.warn(Oa(t)+' is a not valid value for "'+r+'" attribute. The value should be an object with properties '+e),t}}qe.getComponentValidator=Rk;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const t=Zt,r=qe;var n="get",i="set";e.Factory={addGetterSetter(a,o,l,u,f){e.Factory.addGetter(a,o,l),e.Factory.addSetter(a,o,u,f),e.Factory.addOverloadedGetterSetter(a,o)},addGetter(a,o,l){var u=n+t.Util._capitalize(o);a.prototype[u]=a.prototype[u]||function(){var f=this.attrs[o];return f===void 0?l:f}},addSetter(a,o,l,u){var f=i+t.Util._capitalize(o);a.prototype[f]||e.Factory.overWriteSetter(a,o,l,u)},overWriteSetter(a,o,l,u){var f=i+t.Util._capitalize(o);a.prototype[f]=function(h){return l&&h!==void 0&&h!==null&&(h=l.call(this,h,o)),this._setAttr(o,h),u&&u.call(this),this}},addComponentsGetterSetter(a,o,l,u,f){var h=l.length,E=t.Util._capitalize,w=n+E(o),p=i+E(o),S,b;a.prototype[w]=function(){var v={};for(S=0;S<h;S++)b=l[S],v[b]=this.getAttr(o+E(b));return v};var y=(0,r.getComponentValidator)(l);a.prototype[p]=function(v){var m=this.attrs[o],d;u&&(v=u.call(this,v)),y&&y.call(this,v,o);for(d in v)v.hasOwnProperty(d)&&this._setAttr(o+E(d),v[d]);return v||l.forEach(g=>{this._setAttr(o+E(g),void 0)}),this._fireChangeEvent(o,m,v),f&&f.call(this),this},e.Factory.addOverloadedGetterSetter(a,o)},addOverloadedGetterSetter(a,o){var l=t.Util._capitalize(o),u=i+l,f=n+l;a.prototype[o]=function(){return arguments.length?(this[u](arguments[0]),this):this[f]()}},addDeprecatedGetterSetter(a,o,l,u){t.Util.error("Adding deprecated "+o);var f=n+t.Util._capitalize(o),h=o+" property is deprecated and will be removed soon. Look at Konva change log for more information.";a.prototype[f]=function(){t.Util.error(h);var E=this.attrs[o];return E===void 0?l:E},e.Factory.addSetter(a,o,u,function(){t.Util.error(h)}),e.Factory.addOverloadedGetterSetter(a,o)},backCompat(a,o){t.Util.each(o,function(l,u){var f=a.prototype[u],h=n+t.Util._capitalize(l),E=i+t.Util._capitalize(l);function w(){f.apply(this,arguments),t.Util.error('"'+l+'" method is deprecated and will be removed soon. Use ""'+u+'" instead.')}a.prototype[l]=w,a.prototype[h]=w,a.prototype[E]=w})},afterSetFilter(){this._filterUpToDate=!1}}})(ft);var vi={},pa={};Object.defineProperty(pa,"__esModule",{value:!0});pa.HitContext=pa.SceneContext=pa.Context=void 0;const r9=Zt,Mk=ut;function Lk(e){var t=[],r=e.length,n=r9.Util,i,a;for(i=0;i<r;i++)a=e[i],n._isNumber(a)?a=Math.round(a*1e3)/1e3:n._isString(a)||(a=a+""),t.push(a);return t}var A5=",",Nk="(",Ik=")",Dk="([",jk="])",Fk=";",zk="()",Bk="=",R5=["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"],Uk=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"];const Hk=100;class ep{constructor(t){this.canvas=t,Mk.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(t){t.fillEnabled()&&this._fill(t)}_fill(t){}strokeShape(t){t.hasStroke()&&this._stroke(t)}_stroke(t){}fillStrokeShape(t){t.attrs.fillAfterStrokeEnabled?(this.strokeShape(t),this.fillShape(t)):(this.fillShape(t),this.strokeShape(t))}getTrace(t,r){var n=this.traceArr,i=n.length,a="",o,l,u,f;for(o=0;o<i;o++)l=n[o],u=l.method,u?(f=l.args,a+=u,t?a+=zk:r9.Util._isArray(f[0])?a+=Dk+f.join(A5)+jk:(r&&(f=f.map(h=>typeof h=="number"?Math.floor(h):h)),a+=Nk+f.join(A5)+Ik)):(a+=l.property,t||(a+=Bk+l.val)),a+=Fk;return a}clearTrace(){this.traceArr=[]}_trace(t){var r=this.traceArr,n;r.push(t),n=r.length,n>=Hk&&r.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var r=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,r.getWidth()/r.pixelRatio,r.getHeight()/r.pixelRatio)}_applyLineCap(t){const r=t.attrs.lineCap;r&&this.setAttr("lineCap",r)}_applyOpacity(t){var r=t.getAbsoluteOpacity();r!==1&&this.setAttr("globalAlpha",r)}_applyLineJoin(t){const r=t.attrs.lineJoin;r&&this.setAttr("lineJoin",r)}setAttr(t,r){this._context[t]=r}arc(t,r,n,i,a,o){this._context.arc(t,r,n,i,a,o)}arcTo(t,r,n,i,a){this._context.arcTo(t,r,n,i,a)}beginPath(){this._context.beginPath()}bezierCurveTo(t,r,n,i,a,o){this._context.bezierCurveTo(t,r,n,i,a,o)}clearRect(t,r,n,i){this._context.clearRect(t,r,n,i)}clip(...t){this._context.clip.apply(this._context,t)}closePath(){this._context.closePath()}createImageData(t,r){var n=arguments;if(n.length===2)return this._context.createImageData(t,r);if(n.length===1)return this._context.createImageData(t)}createLinearGradient(t,r,n,i){return this._context.createLinearGradient(t,r,n,i)}createPattern(t,r){return this._context.createPattern(t,r)}createRadialGradient(t,r,n,i,a,o){return this._context.createRadialGradient(t,r,n,i,a,o)}drawImage(t,r,n,i,a,o,l,u,f){var h=arguments,E=this._context;h.length===3?E.drawImage(t,r,n):h.length===5?E.drawImage(t,r,n,i,a):h.length===9&&E.drawImage(t,r,n,i,a,o,l,u,f)}ellipse(t,r,n,i,a,o,l,u){this._context.ellipse(t,r,n,i,a,o,l,u)}isPointInPath(t,r,n,i){return n?this._context.isPointInPath(n,t,r,i):this._context.isPointInPath(t,r,i)}fill(...t){this._context.fill.apply(this._context,t)}fillRect(t,r,n,i){this._context.fillRect(t,r,n,i)}strokeRect(t,r,n,i){this._context.strokeRect(t,r,n,i)}fillText(t,r,n,i){i?this._context.fillText(t,r,n,i):this._context.fillText(t,r,n)}measureText(t){return this._context.measureText(t)}getImageData(t,r,n,i){return this._context.getImageData(t,r,n,i)}lineTo(t,r){this._context.lineTo(t,r)}moveTo(t,r){this._context.moveTo(t,r)}rect(t,r,n,i){this._context.rect(t,r,n,i)}roundRect(t,r,n,i,a){this._context.roundRect(t,r,n,i,a)}putImageData(t,r,n){this._context.putImageData(t,r,n)}quadraticCurveTo(t,r,n,i){this._context.quadraticCurveTo(t,r,n,i)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,r){this._context.scale(t,r)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,r,n,i,a,o){this._context.setTransform(t,r,n,i,a,o)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,r,n,i){this._context.strokeText(t,r,n,i)}transform(t,r,n,i,a,o){this._context.transform(t,r,n,i,a,o)}translate(t,r){this._context.translate(t,r)}_enableTrace(){var t=this,r=R5.length,n=this.setAttr,i,a,o=function(l){var u=t[l],f;t[l]=function(){return a=Lk(Array.prototype.slice.call(arguments,0)),f=u.apply(t,arguments),t._trace({method:l,args:a}),f}};for(i=0;i<r;i++)o(R5[i]);t.setAttr=function(){n.apply(t,arguments);var l=arguments[0],u=arguments[1];(l==="shadowOffsetX"||l==="shadowOffsetY"||l==="shadowBlur")&&(u=u/this.canvas.getPixelRatio()),t._trace({property:l,val:u})}}_applyGlobalCompositeOperation(t){const r=t.attrs.globalCompositeOperation;var n=!r||r==="source-over";n||this.setAttr("globalCompositeOperation",r)}}pa.Context=ep;Uk.forEach(function(e){Object.defineProperty(ep.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})});class $k extends ep{constructor(t,{willReadFrequently:r=!1}={}){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:r})}_fillColor(t){var r=t.fill();this.setAttr("fillStyle",r),t._fillFunc(this)}_fillPattern(t){this.setAttr("fillStyle",t._getFillPattern()),t._fillFunc(this)}_fillLinearGradient(t){var r=t._getLinearGradient();r&&(this.setAttr("fillStyle",r),t._fillFunc(this))}_fillRadialGradient(t){const r=t._getRadialGradient();r&&(this.setAttr("fillStyle",r),t._fillFunc(this))}_fill(t){const r=t.fill(),n=t.getFillPriority();if(r&&n==="color"){this._fillColor(t);return}const i=t.getFillPatternImage();if(i&&n==="pattern"){this._fillPattern(t);return}const a=t.getFillLinearGradientColorStops();if(a&&n==="linear-gradient"){this._fillLinearGradient(t);return}const o=t.getFillRadialGradientColorStops();if(o&&n==="radial-gradient"){this._fillRadialGradient(t);return}r?this._fillColor(t):i?this._fillPattern(t):a?this._fillLinearGradient(t):o&&this._fillRadialGradient(t)}_strokeLinearGradient(t){const r=t.getStrokeLinearGradientStartPoint(),n=t.getStrokeLinearGradientEndPoint(),i=t.getStrokeLinearGradientColorStops(),a=this.createLinearGradient(r.x,r.y,n.x,n.y);if(i){for(var o=0;o<i.length;o+=2)a.addColorStop(i[o],i[o+1]);this.setAttr("strokeStyle",a)}}_stroke(t){var r=t.dash(),n=t.getStrokeScaleEnabled();if(t.hasStroke()){if(!n){this.save();var i=this.getCanvas().getPixelRatio();this.setTransform(i,0,0,i,0,0)}this._applyLineCap(t),r&&t.dashEnabled()&&(this.setLineDash(r),this.setAttr("lineDashOffset",t.dashOffset())),this.setAttr("lineWidth",t.strokeWidth()),t.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)");var a=t.getStrokeLinearGradientColorStops();a?this._strokeLinearGradient(t):this.setAttr("strokeStyle",t.stroke()),t._strokeFunc(this),n||this.restore()}}_applyShadow(t){var r,n,i,a=(r=t.getShadowRGBA())!==null&&r!==void 0?r:"black",o=(n=t.getShadowBlur())!==null&&n!==void 0?n:5,l=(i=t.getShadowOffset())!==null&&i!==void 0?i:{x:0,y:0},u=t.getAbsoluteScale(),f=this.canvas.getPixelRatio(),h=u.x*f,E=u.y*f;this.setAttr("shadowColor",a),this.setAttr("shadowBlur",o*Math.min(Math.abs(h),Math.abs(E))),this.setAttr("shadowOffsetX",l.x*h),this.setAttr("shadowOffsetY",l.y*E)}}pa.SceneContext=$k;class Gk extends ep{constructor(t){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:!0})}_fill(t){this.save(),this.setAttr("fillStyle",t.colorKey),t._fillFuncHit(this),this.restore()}strokeShape(t){t.hasHitStroke()&&this._stroke(t)}_stroke(t){if(t.hasHitStroke()){const a=t.getStrokeScaleEnabled();if(!a){this.save();var r=this.getCanvas().getPixelRatio();this.setTransform(r,0,0,r,0,0)}this._applyLineCap(t);var n=t.hitStrokeWidth(),i=n==="auto"?t.strokeWidth():n;this.setAttr("lineWidth",i),this.setAttr("strokeStyle",t.colorKey),t._strokeFuncHit(this),a||this.restore()}}}pa.HitContext=Gk;Object.defineProperty(vi,"__esModule",{value:!0});vi.HitCanvas=vi.SceneCanvas=vi.Canvas=void 0;const mh=Zt,n9=pa,i9=ut,Vk=ft,qk=qe;var hd;function Wk(){if(hd)return hd;var e=mh.Util.createCanvasElement(),t=e.getContext("2d");return hd=function(){var r=i9.Konva._global.devicePixelRatio||1,n=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return r/n}(),mh.Util.releaseCanvas(e),hd}class tp{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var r=t||{},n=r.pixelRatio||i9.Konva.pixelRatio||Wk();this.pixelRatio=n,this._canvas=mh.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(t){var r=this.pixelRatio;this.pixelRatio=t,this.setSize(this.getWidth()/r,this.getHeight()/r)}setWidth(t){this.width=this._canvas.width=t*this.pixelRatio,this._canvas.style.width=t+"px";var r=this.pixelRatio,n=this.getContext()._context;n.scale(r,r)}setHeight(t){this.height=this._canvas.height=t*this.pixelRatio,this._canvas.style.height=t+"px";var r=this.pixelRatio,n=this.getContext()._context;n.scale(r,r)}getWidth(){return this.width}getHeight(){return this.height}setSize(t,r){this.setWidth(t||0),this.setHeight(r||0)}toDataURL(t,r){try{return this._canvas.toDataURL(t,r)}catch{try{return this._canvas.toDataURL()}catch(i){return mh.Util.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}vi.Canvas=tp;Vk.Factory.addGetterSetter(tp,"pixelRatio",void 0,(0,qk.getNumberValidator)());class Kk extends tp{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new n9.SceneContext(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}vi.SceneCanvas=Kk;class Yk extends tp{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new n9.HitContext(this),this.setSize(t.width,t.height)}}vi.HitCanvas=Yk;var rp={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const t=ut,r=Zt;e.DD={get isDragging(){var n=!1;return e.DD._dragElements.forEach(i=>{i.dragStatus==="dragging"&&(n=!0)}),n},justDragged:!1,get node(){var n;return e.DD._dragElements.forEach(i=>{n=i.node}),n},_dragElements:new Map,_drag(n){const i=[];e.DD._dragElements.forEach((a,o)=>{const{node:l}=a,u=l.getStage();u.setPointersPositions(n),a.pointerId===void 0&&(a.pointerId=r.Util._getFirstPointerId(n));const f=u._changedPointerPositions.find(w=>w.id===a.pointerId);if(f){if(a.dragStatus!=="dragging"){var h=l.dragDistance(),E=Math.max(Math.abs(f.x-a.startPointerPos.x),Math.abs(f.y-a.startPointerPos.y));if(E<h||(l.startDrag({evt:n}),!l.isDragging()))return}l._setDragPosition(n,a),i.push(l)}}),i.forEach(a=>{a.fire("dragmove",{type:"dragmove",target:a,evt:n},!0)})},_endDragBefore(n){const i=[];e.DD._dragElements.forEach(a=>{const{node:o}=a,l=o.getStage();if(n&&l.setPointersPositions(n),!l._changedPointerPositions.find(h=>h.id===a.pointerId))return;(a.dragStatus==="dragging"||a.dragStatus==="stopped")&&(e.DD.justDragged=!0,t.Konva._mouseListenClick=!1,t.Konva._touchListenClick=!1,t.Konva._pointerListenClick=!1,a.dragStatus="stopped");const f=a.node.getLayer()||a.node instanceof t.Konva.Stage&&a.node;f&&i.indexOf(f)===-1&&i.push(f)}),i.forEach(a=>{a.draw()})},_endDragAfter(n){e.DD._dragElements.forEach((i,a)=>{i.dragStatus==="stopped"&&i.node.fire("dragend",{type:"dragend",target:i.node,evt:n},!0),i.dragStatus!=="dragging"&&e.DD._dragElements.delete(a)})}},t.Konva.isBrowser&&(window.addEventListener("mouseup",e.DD._endDragBefore,!0),window.addEventListener("touchend",e.DD._endDragBefore,!0),window.addEventListener("mousemove",e.DD._drag),window.addEventListener("touchmove",e.DD._drag),window.addEventListener("mouseup",e.DD._endDragAfter,!1),window.addEventListener("touchend",e.DD._endDragAfter,!1))})(rp);Object.defineProperty(Vt,"__esModule",{value:!0});Vt.Node=void 0;const gt=Zt,Bc=ft,Au=vi,Ha=ut,Hn=rp,nr=qe;var Nd="absoluteOpacity",pd="allEventListeners",aa="absoluteTransform",M5="absoluteScale",Bo="canvas",Xk="Change",Zk="children",Qk="konva",am="listening",L5="mouseenter",N5="mouseleave",I5="set",D5="Shape",Id=" ",j5="stage",$a="transform",Jk="Stage",om="visible",eT=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(Id);let tT=1,lt=class lm{constructor(t){this._id=tT++,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(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===$a||t===aa)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,r){var n=this._cache.get(t),i=t===$a||t===aa,a=n===void 0||i&&n.dirty===!0;return a&&(n=r.call(this),this._cache.set(t,n)),n}_calculate(t,r,n){if(!this._attachedDepsListeners.get(t)){const i=r.map(a=>a+"Change.konva").join(Id);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,n)}_getCanvasCache(){return this._cache.get(Bo)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===aa&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(Bo)){const{scene:t,filter:r,hit:n}=this._cache.get(Bo);gt.Util.releaseCanvas(t,r,n),this._cache.delete(Bo)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var r=t||{},n={};(r.x===void 0||r.y===void 0||r.width===void 0||r.height===void 0)&&(n=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));var i=Math.ceil(r.width||n.width),a=Math.ceil(r.height||n.height),o=r.pixelRatio,l=r.x===void 0?Math.floor(n.x):r.x,u=r.y===void 0?Math.floor(n.y):r.y,f=r.offset||0,h=r.drawBorder||!1,E=r.hitCanvasPixelRatio||1;if(!i||!a){gt.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(n.x)-l)>.5?1:0,p=Math.abs(Math.round(n.y)-u)>.5?1:0;i+=f*2+w,a+=f*2+p,l-=f,u-=f;var S=new Au.SceneCanvas({pixelRatio:o,width:i,height:a}),b=new Au.SceneCanvas({pixelRatio:o,width:0,height:0,willReadFrequently:!0}),y=new Au.HitCanvas({pixelRatio:E,width:i,height:a}),v=S.getContext(),m=y.getContext();return y.isCache=!0,S.isCache=!0,this._cache.delete(Bo),this._filterUpToDate=!1,r.imageSmoothingEnabled===!1&&(S.getContext()._context.imageSmoothingEnabled=!1,b.getContext()._context.imageSmoothingEnabled=!1),v.save(),m.save(),v.translate(-l,-u),m.translate(-l,-u),this._isUnderCache=!0,this._clearSelfAndDescendantCache(Nd),this._clearSelfAndDescendantCache(M5),this.drawScene(S,this),this.drawHit(y,this),this._isUnderCache=!1,v.restore(),m.restore(),h&&(v.save(),v.beginPath(),v.rect(0,0,i,a),v.closePath(),v.setAttr("strokeStyle","red"),v.setAttr("lineWidth",5),v.stroke(),v.restore()),this._cache.set(Bo,{scene:S,filter:b,hit:y,x:l,y:u}),this._requestDraw(),this}isCached(){return this._cache.has(Bo)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,r){var n=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],i=1/0,a=1/0,o=-1/0,l=-1/0,u=this.getAbsoluteTransform(r);return n.forEach(function(f){var h=u.point(f);i===void 0&&(i=o=h.x,a=l=h.y),i=Math.min(i,h.x),a=Math.min(a,h.y),o=Math.max(o,h.x),l=Math.max(l,h.y)}),{x:i,y:a,width:o-i,height:l-a}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const r=this._getCanvasCache();t.translate(r.x,r.y);var n=this._getCachedSceneCanvas(),i=n.pixelRatio;t.drawImage(n._canvas,0,0,n.width/i,n.height/i),t.restore()}_drawCachedHitCanvas(t){var r=this._getCanvasCache(),n=r.hit;t.save(),t.translate(r.x,r.y),t.drawImage(n._canvas,0,0,n.width/n.pixelRatio,n.height/n.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),r=this._getCanvasCache(),n=r.scene,i=r.filter,a=i.getContext(),o,l,u,f;if(t){if(!this._filterUpToDate){var h=n.pixelRatio;i.setSize(n.width/n.pixelRatio,n.height/n.pixelRatio);try{for(o=t.length,a.clear(),a.drawImage(n._canvas,0,0,n.getWidth()/h,n.getHeight()/h),l=a.getImageData(0,0,i.getWidth(),i.getHeight()),u=0;u<o;u++){if(f=t[u],typeof f!="function"){gt.Util.error("Filter should be type of function, but got "+typeof f+" instead. Please check correct filters");continue}f.call(this,l),a.putImageData(l,0,0)}}catch(E){gt.Util.error("Unable to apply filter. "+E.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return i}return n}on(t,r){if(this._cache&&this._cache.delete(pd),arguments.length===3)return this._delegate.apply(this,arguments);var n=t.split(Id),i=n.length,a,o,l,u,f;for(a=0;a<i;a++)o=n[a],l=o.split("."),u=l[0],f=l[1]||"",this.eventListeners[u]||(this.eventListeners[u]=[]),this.eventListeners[u].push({name:f,handler:r});return this}off(t,r){var n=(t||"").split(Id),i=n.length,a,o,l,u,f,h;if(this._cache&&this._cache.delete(pd),!t)for(o in this.eventListeners)this._off(o);for(a=0;a<i;a++)if(l=n[a],u=l.split("."),f=u[0],h=u[1],f)this.eventListeners[f]&&this._off(f,h,r);else for(o in this.eventListeners)this._off(o,h,r);return this}dispatchEvent(t){var r={target:this,type:t.type,evt:t};return this.fire(t.type,r),this}addEventListener(t,r){return this.on(t,function(n){r.call(this,n.evt)}),this}removeEventListener(t){return this.off(t),this}_delegate(t,r,n){var i=this;this.on(t,function(a){for(var o=a.target.findAncestors(r,!0,i),l=0;l<o.length;l++)a=gt.Util.cloneObject(a),a.currentTarget=o[l],n.call(o[l],a)})}remove(){return this.isDragging()&&this.stopDrag(),Hn.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(aa),this._clearSelfAndDescendantCache(Nd),this._clearSelfAndDescendantCache(M5),this._clearSelfAndDescendantCache(j5),this._clearSelfAndDescendantCache(om),this._clearSelfAndDescendantCache(am)}_remove(){this._clearCaches();var t=this.getParent();t&&t.children&&(t.children.splice(this.index,1),t._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(t){var r="get"+gt.Util._capitalize(t);return gt.Util._isFunction(this[r])?this[r]():this.attrs[t]}getAncestors(){for(var t=this.getParent(),r=[];t;)r.push(t),t=t.getParent();return r}getAttrs(){return this.attrs||{}}setAttrs(t){return this._batchTransformChanges(()=>{var r,n;if(!t)return this;for(r in t)r!==Zk&&(n=I5+gt.Util._capitalize(r),gt.Util._isFunction(this[n])?this[n](t[r]):this._setAttr(r,t[r]))}),this}isListening(){return this._getCache(am,this._isListening)}_isListening(t){if(!this.listening())return!1;const n=this.getParent();return n&&n!==t&&this!==t?n._isListening(t):!0}isVisible(){return this._getCache(om,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const n=this.getParent();return n&&n!==t&&this!==t?n._isVisible(t):!0}shouldDrawHit(t,r=!1){if(t)return this._isVisible(t)&&this._isListening(t);var n=this.getLayer(),i=!1;Hn.DD._dragElements.forEach(o=>{o.dragStatus==="dragging"&&(o.node.nodeType==="Stage"||o.node.getLayer()===n)&&(i=!0)});var a=!r&&!Ha.Konva.hitOnDragEnabled&&(i||Ha.Konva.isTransforming());return this.isListening()&&this.isVisible()&&!a}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),r=this,n=0,i,a,o,l;function u(h){for(i=[],a=h.length,o=0;o<a;o++)l=h[o],n++,l.nodeType!==D5&&(i=i.concat(l.getChildren().slice())),l._id===r._id&&(o=a);i.length>0&&i[0].getDepth()<=t&&u(i)}const f=this.getStage();return r.nodeType!==Jk&&f&&u(f.getChildren()),n}getDepth(){for(var t=0,r=this.parent;r;)t++,r=r.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache($a),this._clearSelfAndDescendantCache(aa)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const t=this.getStage();if(!t)return null;var r=t.getPointerPosition();if(!r)return null;var n=this.getAbsoluteTransform().copy();return n.invert(),n.point(r)}getAbsolutePosition(t){let r=!1,n=this.parent;for(;n;){if(n.isCached()){r=!0;break}n=n.parent}r&&!t&&(t=!0);var i=this.getAbsoluteTransform(t).getMatrix(),a=new gt.Transform,o=this.offset();return a.m=i.slice(),a.translate(o.x,o.y),a.getTranslation()}setAbsolutePosition(t){const{x:r,y:n,...i}=this._clearTransform();this.attrs.x=r,this.attrs.y=n,this._clearCache($a);var a=this._getAbsoluteTransform().copy();return a.invert(),a.translate(t.x,t.y),t={x:this.attrs.x+a.getTranslation().x,y:this.attrs.y+a.getTranslation().y},this._setTransform(i),this.setPosition({x:t.x,y:t.y}),this._clearCache($a),this._clearSelfAndDescendantCache(aa),this}_setTransform(t){var r;for(r in t)this.attrs[r]=t[r]}_clearTransform(){var t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){var r=t.x,n=t.y,i=this.x(),a=this.y();return r!==void 0&&(i+=r),n!==void 0&&(a+=n),this.setPosition({x:i,y:a}),this}_eachAncestorReverse(t,r){var n=[],i=this.getParent(),a,o;if(!(r&&r._id===this._id)){for(n.unshift(this);i&&(!r||i._id!==r._id);)n.unshift(i),i=i.parent;for(a=n.length,o=0;o<a;o++)t(n[o])}}rotate(t){return this.rotation(this.rotation()+t),this}moveToTop(){if(!this.parent)return gt.Util.warn("Node has no parent. moveToTop function is ignored."),!1;var t=this.index,r=this.parent.getChildren().length;return t<r-1?(this.parent.children.splice(t,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return gt.Util.warn("Node has no parent. moveUp function is ignored."),!1;var t=this.index,r=this.parent.getChildren().length;return t<r-1?(this.parent.children.splice(t,1),this.parent.children.splice(t+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return gt.Util.warn("Node has no parent. moveDown function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return gt.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return gt.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&gt.Util.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var r=this.index;return this.parent.children.splice(r,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(Nd,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),r=this.getParent();return r&&!r._isUnderCache&&(t*=r.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t=this.getAttrs(),r,n,i,a,o;const l={attrs:{},className:this.getClassName()};for(r in t)n=t[r],o=gt.Util.isObject(n)&&!gt.Util._isPlainObject(n)&&!gt.Util._isArray(n),!o&&(i=typeof this[r]=="function"&&this[r],delete t[r],a=i?i.call(this):null,t[r]=n,a!==n&&(l.attrs[r]=n));return gt.Util._prepareToStringify(l)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,r,n){var i=[];r&&this._isMatch(t)&&i.push(this);for(var a=this.parent;a;){if(a===n)return i;a._isMatch(t)&&i.push(a),a=a.parent}return i}isAncestorOf(t){return!1}findAncestor(t,r,n){return this.findAncestors(t,r,n)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);var r=t.replace(/ /g,"").split(","),n=r.length,i,a;for(i=0;i<n;i++)if(a=r[i],gt.Util.isValidSelector(a)||(gt.Util.warn('Selector "'+a+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),gt.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),gt.Util.warn("Konva is awesome, right?")),a.charAt(0)==="#"){if(this.id()===a.slice(1))return!0}else if(a.charAt(0)==="."){if(this.hasName(a.slice(1)))return!0}else if(this.className===a||this.nodeType===a)return!0;return!1}getLayer(){var t=this.getParent();return t?t.getLayer():null}getStage(){return this._getCache(j5,this._getStage)}_getStage(){var t=this.getParent();return t?t.getStage():null}fire(t,r={},n){return r.target=r.target||this,n?this._fireAndBubble(t,r):this._fire(t,r),this}getAbsoluteTransform(t){return t?this._getAbsoluteTransform(t):this._getCache(aa,this._getAbsoluteTransform)}_getAbsoluteTransform(t){var r;if(t)return r=new gt.Transform,this._eachAncestorReverse(function(i){var a=i.transformsEnabled();a==="all"?r.multiply(i.getTransform()):a==="position"&&r.translate(i.x()-i.offsetX(),i.y()-i.offsetY())},t),r;r=this._cache.get(aa)||new gt.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(r):r.reset();var n=this.transformsEnabled();if(n==="all")r.multiply(this.getTransform());else if(n==="position"){const i=this.attrs.x||0,a=this.attrs.y||0,o=this.attrs.offsetX||0,l=this.attrs.offsetY||0;r.translate(i-o,a-l)}return r.dirty=!1,r}getAbsoluteScale(t){for(var r=this;r;)r._isUnderCache&&(t=r),r=r.getParent();const i=this.getAbsoluteTransform(t).decompose();return{x:i.scaleX,y:i.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache($a,this._getTransform)}_getTransform(){var t,r,n=this._cache.get($a)||new gt.Transform;n.reset();var i=this.x(),a=this.y(),o=Ha.Konva.getAngle(this.rotation()),l=(t=this.attrs.scaleX)!==null&&t!==void 0?t:1,u=(r=this.attrs.scaleY)!==null&&r!==void 0?r:1,f=this.attrs.skewX||0,h=this.attrs.skewY||0,E=this.attrs.offsetX||0,w=this.attrs.offsetY||0;return(i!==0||a!==0)&&n.translate(i,a),o!==0&&n.rotate(o),(f!==0||h!==0)&&n.skew(f,h),(l!==1||u!==1)&&n.scale(l,u),(E!==0||w!==0)&&n.translate(-1*E,-1*w),n.dirty=!1,n}clone(t){var r=gt.Util.cloneObject(this.attrs),n,i,a,o,l;for(n in t)r[n]=t[n];var u=new this.constructor(r);for(n in this.eventListeners)for(i=this.eventListeners[n],a=i.length,o=0;o<a;o++)l=i[o],l.name.indexOf(Qk)<0&&(u.eventListeners[n]||(u.eventListeners[n]=[]),u.eventListeners[n].push(l));return u}_toKonvaCanvas(t){t=t||{};var r=this.getClientRect(),n=this.getStage(),i=t.x!==void 0?t.x:Math.floor(r.x),a=t.y!==void 0?t.y:Math.floor(r.y),o=t.pixelRatio||1,l=new Au.SceneCanvas({width:t.width||Math.ceil(r.width)||(n?n.width():0),height:t.height||Math.ceil(r.height)||(n?n.height():0),pixelRatio:o}),u=l.getContext();const f=new Au.SceneCanvas({width:l.width/l.pixelRatio+Math.abs(i),height:l.height/l.pixelRatio+Math.abs(a),pixelRatio:l.pixelRatio});return t.imageSmoothingEnabled===!1&&(u._context.imageSmoothingEnabled=!1),u.save(),(i||a)&&u.translate(-1*i,-1*a),this.drawScene(l,void 0,f),u.restore(),l}toCanvas(t){return this._toKonvaCanvas(t)._canvas}toDataURL(t){t=t||{};var r=t.mimeType||null,n=t.quality||null,i=this._toKonvaCanvas(t).toDataURL(r,n);return t.callback&&t.callback(i),i}toImage(t){return new Promise((r,n)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,gt.Util._urlToImage(this.toDataURL(t),function(a){r(a),i==null||i(a)})}catch(i){n(i)}})}toBlob(t){return new Promise((r,n)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,this.toCanvas(t).toBlob(a=>{r(a),i==null||i(a)},t==null?void 0:t.mimeType,t==null?void 0:t.quality)}catch(i){n(i)}})}setSize(t){return this.width(t.width),this.height(t.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():Ha.Konva.dragDistance}_off(t,r,n){var i=this.eventListeners[t],a,o,l;for(a=0;a<i.length;a++)if(o=i[a].name,l=i[a].handler,(o!=="konva"||r==="konva")&&(!r||o===r)&&(!n||n===l)){if(i.splice(a,1),i.length===0){delete this.eventListeners[t];break}a--}}_fireChangeEvent(t,r,n){this._fire(t+Xk,{oldVal:r,newVal:n})}addName(t){if(!this.hasName(t)){var r=this.name(),n=r?r+" "+t:t;this.name(n)}return this}hasName(t){if(!t)return!1;const r=this.name();if(!r)return!1;var n=(r||"").split(/\s/g);return n.indexOf(t)!==-1}removeName(t){var r=(this.name()||"").split(/\s/g),n=r.indexOf(t);return n!==-1&&(r.splice(n,1),this.name(r.join(" "))),this}setAttr(t,r){var n=this[I5+gt.Util._capitalize(t)];return gt.Util._isFunction(n)?n.call(this,r):this._setAttr(t,r),this}_requestDraw(){if(Ha.Konva.autoDrawEnabled){const t=this.getLayer()||this.getStage();t==null||t.batchDraw()}}_setAttr(t,r){var n=this.attrs[t];n===r&&!gt.Util.isObject(r)||(r==null?delete this.attrs[t]:this.attrs[t]=r,this._shouldFireChangeEvents&&this._fireChangeEvent(t,n,r),this._requestDraw())}_setComponentAttr(t,r,n){var i;n!==void 0&&(i=this.attrs[t],i||(this.attrs[t]=this.getAttr(t)),this.attrs[t][r]=n,this._fireChangeEvent(t,i,n))}_fireAndBubble(t,r,n){r&&this.nodeType===D5&&(r.target=this);var i=(t===L5||t===N5)&&(n&&(this===n||this.isAncestorOf&&this.isAncestorOf(n))||this.nodeType==="Stage"&&!n);if(!i){this._fire(t,r);var a=(t===L5||t===N5)&&n&&n.isAncestorOf&&n.isAncestorOf(this)&&!n.isAncestorOf(this.parent);(r&&!r.cancelBubble||!r)&&this.parent&&this.parent.isListening()&&!a&&(n&&n.parent?this._fireAndBubble.call(this.parent,t,r,n):this._fireAndBubble.call(this.parent,t,r))}}_getProtoListeners(t){var r,n,i;const a=(r=this._cache.get(pd))!==null&&r!==void 0?r:{};let o=a==null?void 0:a[t];if(o===void 0){o=[];let l=Object.getPrototypeOf(this);for(;l;){const u=(i=(n=l.eventListeners)===null||n===void 0?void 0:n[t])!==null&&i!==void 0?i:[];o.push(...u),l=Object.getPrototypeOf(l)}a[t]=o,this._cache.set(pd,a)}return o}_fire(t,r){r=r||{},r.currentTarget=this,r.type=t;const n=this._getProtoListeners(t);if(n)for(var i=0;i<n.length;i++)n[i].handler.call(this,r);const a=this.eventListeners[t];if(a)for(var i=0;i<a.length;i++)a[i].handler.call(this,r)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(t){var r=t?t.pointerId:void 0,n=this.getStage(),i=this.getAbsolutePosition();if(n){var a=n._getPointerById(r)||n._changedPointerPositions[0]||i;Hn.DD._dragElements.set(this._id,{node:this,startPointerPos:a,offset:{x:a.x-i.x,y:a.y-i.y},dragStatus:"ready",pointerId:r})}}startDrag(t,r=!0){Hn.DD._dragElements.has(this._id)||this._createDragElement(t);const n=Hn.DD._dragElements.get(this._id);n.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:t&&t.evt},r)}_setDragPosition(t,r){const n=this.getStage()._getPointerById(r.pointerId);if(n){var i={x:n.x-r.offset.x,y:n.y-r.offset.y},a=this.dragBoundFunc();if(a!==void 0){const o=a.call(this,i,t);o?i=o:gt.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(t){const r=Hn.DD._dragElements.get(this._id);r&&(r.dragStatus="stopped"),Hn.DD._endDragBefore(t),Hn.DD._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=Hn.DD._dragElements.get(this._id);return t?t.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(t){var r=t.evt.button!==void 0,n=!r||Ha.Konva.dragButtons.indexOf(t.evt.button)>=0;if(n&&!this.isDragging()){var i=!1;Hn.DD._dragElements.forEach(a=>{this.isAncestorOf(a.node)&&(i=!0)}),i||this._createDragElement(t)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var t=this.getStage();if(!t)return;const r=Hn.DD._dragElements.get(this._id),n=r&&r.dragStatus==="dragging",i=r&&r.dragStatus==="ready";n?this.stopDrag():i&&Hn.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const r=this.getStage();if(!r)return!1;const n={x:-t.x,y:-t.y,width:r.width()+2*t.x,height:r.height()+2*t.y};return gt.Util.haveIntersection(n,this.getClientRect())}static create(t,r){return gt.Util._isString(t)&&(t=JSON.parse(t)),this._createNode(t,r)}static _createNode(t,r){var n=lm.prototype.getClassName.call(t),i=t.children,a,o,l;r&&(t.attrs.container=r),Ha.Konva[n]||(gt.Util.warn('Can not find a node with class name "'+n+'". Fallback to "Shape".'),n="Shape");const u=Ha.Konva[n];if(a=new u(t.attrs),i)for(o=i.length,l=0;l<o;l++)a.add(lm._createNode(i[l]));return a}};Vt.Node=lt;lt.prototype.nodeType="Node";lt.prototype._attrsAffectingSize=[];lt.prototype.eventListeners={};lt.prototype.on.call(lt.prototype,eT,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache($a),this._clearSelfAndDescendantCache(aa)});lt.prototype.on.call(lt.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(om)});lt.prototype.on.call(lt.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(am)});lt.prototype.on.call(lt.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(Nd)});const Rt=Bc.Factory.addGetterSetter;Rt(lt,"zIndex");Rt(lt,"absolutePosition");Rt(lt,"position");Rt(lt,"x",0,(0,nr.getNumberValidator)());Rt(lt,"y",0,(0,nr.getNumberValidator)());Rt(lt,"globalCompositeOperation","source-over",(0,nr.getStringValidator)());Rt(lt,"opacity",1,(0,nr.getNumberValidator)());Rt(lt,"name","",(0,nr.getStringValidator)());Rt(lt,"id","",(0,nr.getStringValidator)());Rt(lt,"rotation",0,(0,nr.getNumberValidator)());Bc.Factory.addComponentsGetterSetter(lt,"scale",["x","y"]);Rt(lt,"scaleX",1,(0,nr.getNumberValidator)());Rt(lt,"scaleY",1,(0,nr.getNumberValidator)());Bc.Factory.addComponentsGetterSetter(lt,"skew",["x","y"]);Rt(lt,"skewX",0,(0,nr.getNumberValidator)());Rt(lt,"skewY",0,(0,nr.getNumberValidator)());Bc.Factory.addComponentsGetterSetter(lt,"offset",["x","y"]);Rt(lt,"offsetX",0,(0,nr.getNumberValidator)());Rt(lt,"offsetY",0,(0,nr.getNumberValidator)());Rt(lt,"dragDistance",null,(0,nr.getNumberValidator)());Rt(lt,"width",0,(0,nr.getNumberValidator)());Rt(lt,"height",0,(0,nr.getNumberValidator)());Rt(lt,"listening",!0,(0,nr.getBooleanValidator)());Rt(lt,"preventDefault",!0,(0,nr.getBooleanValidator)());Rt(lt,"filters",null,function(e){return this._filterUpToDate=!1,e});Rt(lt,"visible",!0,(0,nr.getBooleanValidator)());Rt(lt,"transformsEnabled","all",(0,nr.getStringValidator)());Rt(lt,"size");Rt(lt,"dragBoundFunc");Rt(lt,"draggable",!1,(0,nr.getBooleanValidator)());Bc.Factory.backCompat(lt,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var gl={};Object.defineProperty(gl,"__esModule",{value:!0});gl.Container=void 0;const Gs=ft,G1=Vt,np=qe;class vl extends G1.Node{constructor(){super(...arguments),this.children=[]}getChildren(t){if(!t)return this.children||[];const r=this.children||[];var n=[];return r.forEach(function(i){t(i)&&n.push(i)}),n}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(t.length===0)return this;if(t.length>1){for(var r=0;r<t.length;r++)this.add(t[r]);return this}const n=t[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(t){return this._generalFind(t,!1)}findOne(t){var r=this._generalFind(t,!0);return r.length>0?r[0]:void 0}_generalFind(t,r){var n=[];return this._descendants(i=>{const a=i._isMatch(t);return a&&n.push(i),!!(a&&r)}),n}_descendants(t){let r=!1;const n=this.getChildren();for(const i of n){if(r=t(i),r)return!0;if(i.hasChildren()&&(r=i._descendants(t),r))return!0}return!1}toObject(){var t=G1.Node.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(r=>{t.children.push(r.toObject())}),t}isAncestorOf(t){for(var r=t.getParent();r;){if(r._id===this._id)return!0;r=r.getParent()}return!1}clone(t){var r=G1.Node.prototype.clone.call(this,t);return this.getChildren().forEach(function(n){r.add(n.clone())}),r}getAllIntersections(t){var r=[];return this.find("Shape").forEach(n=>{n.isVisible()&&n.intersects(t)&&r.push(n)}),r}_clearSelfAndDescendantCache(t){var r;super._clearSelfAndDescendantCache(t),!this.isCached()&&((r=this.children)===null||r===void 0||r.forEach(function(n){n._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(r,n){r.index=n}),this._requestDraw()}drawScene(t,r,n){var i=this.getLayer(),a=t||i&&i.getCanvas(),o=a&&a.getContext(),l=this._getCanvasCache(),u=l&&l.scene,f=a&&a.isCache;if(!this.isVisible()&&!f)return this;if(u){o.save();var h=this.getAbsoluteTransform(r).getMatrix();o.transform(h[0],h[1],h[2],h[3],h[4],h[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",a,r,n);return this}drawHit(t,r){if(!this.shouldDrawHit(r))return this;var n=this.getLayer(),i=t||n&&n.hitCanvas,a=i&&i.getContext(),o=this._getCanvasCache(),l=o&&o.hit;if(l){a.save();var u=this.getAbsoluteTransform(r).getMatrix();a.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedHitCanvas(a),a.restore()}else this._drawChildren("drawHit",i,r);return this}_drawChildren(t,r,n,i){var a,o=r&&r.getContext(),l=this.clipWidth(),u=this.clipHeight(),f=this.clipFunc(),h=typeof l=="number"&&typeof u=="number"||f;const E=n===this;if(h){o.save();var w=this.getAbsoluteTransform(n),p=w.getMatrix();o.transform(p[0],p[1],p[2],p[3],p[4],p[5]),o.beginPath();let v;if(f)v=f.call(this,o,this);else{var S=this.clipX(),b=this.clipY();o.rect(S||0,b||0,l,u)}o.clip.apply(o,v),p=w.copy().invert().getMatrix(),o.transform(p[0],p[1],p[2],p[3],p[4],p[5])}var y=!E&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";y&&(o.save(),o._applyGlobalCompositeOperation(this)),(a=this.children)===null||a===void 0||a.forEach(function(v){v[t](r,n,i)}),y&&o.restore(),h&&o.restore()}getClientRect(t={}){var r,n=t.skipTransform,i=t.relativeTo,a,o,l,u,f={x:1/0,y:1/0,width:0,height:0},h=this;(r=this.children)===null||r===void 0||r.forEach(function(b){if(b.visible()){var y=b.getClientRect({relativeTo:h,skipShadow:t.skipShadow,skipStroke:t.skipStroke});y.width===0&&y.height===0||(a===void 0?(a=y.x,o=y.y,l=y.x+y.width,u=y.y+y.height):(a=Math.min(a,y.x),o=Math.min(o,y.y),l=Math.max(l,y.x+y.width),u=Math.max(u,y.y+y.height)))}});for(var E=this.find("Shape"),w=!1,p=0;p<E.length;p++){var S=E[p];if(S._isVisible(this)){w=!0;break}}return w&&a!==void 0?f={x:a,y:o,width:l-a,height:u-o}:f={x:0,y:0,width:0,height:0},n?f:this._transformedRect(f,i)}}gl.Container=vl;Gs.Factory.addComponentsGetterSetter(vl,"clip",["x","y","width","height"]);Gs.Factory.addGetterSetter(vl,"clipX",void 0,(0,np.getNumberValidator)());Gs.Factory.addGetterSetter(vl,"clipY",void 0,(0,np.getNumberValidator)());Gs.Factory.addGetterSetter(vl,"clipWidth",void 0,(0,np.getNumberValidator)());Gs.Factory.addGetterSetter(vl,"clipHeight",void 0,(0,np.getNumberValidator)());Gs.Factory.addGetterSetter(vl,"clipFunc");var a9={},En={};Object.defineProperty(En,"__esModule",{value:!0});En.releaseCapture=En.setPointerCapture=En.hasPointerCapture=En.createEvent=En.getCapturedShape=void 0;const rT=ut,bc=new Map,o9=rT.Konva._global.PointerEvent!==void 0;function nT(e){return bc.get(e)}En.getCapturedShape=nT;function Iy(e){return{evt:e,pointerId:e.pointerId}}En.createEvent=Iy;function iT(e,t){return bc.get(e)===t}En.hasPointerCapture=iT;function aT(e,t){l9(e),t.getStage()&&(bc.set(e,t),o9&&t._fire("gotpointercapture",Iy(new PointerEvent("gotpointercapture"))))}En.setPointerCapture=aT;function l9(e,t){const r=bc.get(e);if(!r)return;const n=r.getStage();n&&n.content,bc.delete(e),o9&&r._fire("lostpointercapture",Iy(new PointerEvent("lostpointercapture")))}En.releaseCapture=l9;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const t=Zt,r=ft,n=gl,i=ut,a=vi,o=rp,l=ut,u=En;var f="Stage",h="string",E="px",w="mouseout",p="mouseleave",S="mouseover",b="mouseenter",y="mousemove",v="mousedown",m="mouseup",d="pointermove",g="pointerdown",_="pointerup",k="pointercancel",C="lostpointercapture",P="pointerout",O="pointerleave",x="pointerover",A="pointerenter",L="contextmenu",I="touchstart",U="touchend",$="touchmove",Z="touchcancel",q="wheel",z=5,W=[[b,"_pointerenter"],[v,"_pointerdown"],[y,"_pointermove"],[m,"_pointerup"],[p,"_pointerleave"],[I,"_pointerdown"],[$,"_pointermove"],[U,"_pointerup"],[Z,"_pointercancel"],[S,"_pointerover"],[q,"_wheel"],[L,"_contextmenu"],[g,"_pointerdown"],[d,"_pointermove"],[_,"_pointerup"],[k,"_pointercancel"],[C,"_lostpointercapture"]];const R={mouse:{[P]:w,[O]:p,[x]:S,[A]:b,[d]:y,[g]:v,[_]:m,[k]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[P]:"touchout",[O]:"touchleave",[x]:"touchover",[A]:"touchenter",[d]:$,[g]:I,[_]:U,[k]:Z,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[P]:P,[O]:O,[x]:x,[A]:A,[d]:d,[g]:g,[_]:_,[k]:k,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},M=G=>G.indexOf("pointer")>=0?"pointer":G.indexOf("touch")>=0?"touch":"mouse",F=G=>{const B=M(G);if(B==="pointer")return i.Konva.pointerEventsEnabled&&R.pointer;if(B==="touch")return R.touch;if(B==="mouse")return R.mouse};function D(G={}){return(G.clipFunc||G.clipWidth||G.clipHeight)&&t.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),G}const H="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);";e.stages=[];class K extends n.Container{constructor(B){super(D(B)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),e.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{D(this.attrs)}),this._checkVisibility()}_validateAdd(B){const Y=B.getType()==="Layer",X=B.getType()==="FastLayer";Y||X||t.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const B=this.visible()?"":"none";this.content.style.display=B}setContainer(B){if(typeof B===h){if(B.charAt(0)==="."){var Y=B.slice(1);B=document.getElementsByClassName(Y)[0]}else{var X;B.charAt(0)!=="#"?X=B:X=B.slice(1),B=document.getElementById(X)}if(!B)throw"Can not find container in document with id "+X}return this._setAttr("container",B),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),B.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var B=this.children,Y=B.length,X;for(X=0;X<Y;X++)B[X].clear();return this}clone(B){return B||(B={}),B.container=typeof document<"u"&&document.createElement("div"),n.Container.prototype.clone.call(this,B)}destroy(){super.destroy();var B=this.content;B&&t.Util._isInDocument(B)&&this.container().removeChild(B);var Y=e.stages.indexOf(this);return Y>-1&&e.stages.splice(Y,1),t.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const B=this._pointerPositions[0]||this._changedPointerPositions[0];return B?{x:B.x,y:B.y}:(t.Util.warn(H),null)}_getPointerById(B){return this._pointerPositions.find(Y=>Y.id===B)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(B){B=B||{},B.x=B.x||0,B.y=B.y||0,B.width=B.width||this.width(),B.height=B.height||this.height();var Y=new a.SceneCanvas({width:B.width,height:B.height,pixelRatio:B.pixelRatio||1}),X=Y.getContext()._context,Q=this.children;return(B.x||B.y)&&X.translate(-1*B.x,-1*B.y),Q.forEach(function(te){if(te.isVisible()){var ee=te._toKonvaCanvas(B);X.drawImage(ee._canvas,B.x,B.y,ee.getWidth()/ee.getPixelRatio(),ee.getHeight()/ee.getPixelRatio())}}),Y}getIntersection(B){if(!B)return null;var Y=this.children,X=Y.length,Q=X-1,te;for(te=Q;te>=0;te--){const ee=Y[te].getIntersection(B);if(ee)return ee}return null}_resizeDOM(){var B=this.width(),Y=this.height();this.content&&(this.content.style.width=B+E,this.content.style.height=Y+E),this.bufferCanvas.setSize(B,Y),this.bufferHitCanvas.setSize(B,Y),this.children.forEach(X=>{X.setSize({width:B,height:Y}),X.draw()})}add(B,...Y){if(arguments.length>1){for(var X=0;X<arguments.length;X++)this.add(arguments[X]);return this}super.add(B);var Q=this.children.length;return Q>z&&t.Util.warn("The stage has "+Q+" 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."),B.setSize({width:this.width(),height:this.height()}),B.draw(),i.Konva.isBrowser&&this.content.appendChild(B.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(B){return u.hasPointerCapture(B,this)}setPointerCapture(B){u.setPointerCapture(B,this)}releaseCapture(B){u.releaseCapture(B,this)}getLayers(){return this.children}_bindContentEvents(){i.Konva.isBrowser&&W.forEach(([B,Y])=>{this.content.addEventListener(B,X=>{this[Y](X)},{passive:!1})})}_pointerenter(B){this.setPointersPositions(B);const Y=F(B.type);Y&&this._fire(Y.pointerenter,{evt:B,target:this,currentTarget:this})}_pointerover(B){this.setPointersPositions(B);const Y=F(B.type);Y&&this._fire(Y.pointerover,{evt:B,target:this,currentTarget:this})}_getTargetShape(B){let Y=this[B+"targetShape"];return Y&&!Y.getStage()&&(Y=null),Y}_pointerleave(B){const Y=F(B.type),X=M(B.type);if(Y){this.setPointersPositions(B);var Q=this._getTargetShape(X),te=!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled;Q&&te?(Q._fireAndBubble(Y.pointerout,{evt:B}),Q._fireAndBubble(Y.pointerleave,{evt:B}),this._fire(Y.pointerleave,{evt:B,target:this,currentTarget:this}),this[X+"targetShape"]=null):te&&(this._fire(Y.pointerleave,{evt:B,target:this,currentTarget:this}),this._fire(Y.pointerout,{evt:B,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}}_pointerdown(B){const Y=F(B.type),X=M(B.type);if(Y){this.setPointersPositions(B);var Q=!1;this._changedPointerPositions.forEach(te=>{var ee=this.getIntersection(te);if(o.DD.justDragged=!1,i.Konva["_"+X+"ListenClick"]=!0,!ee||!ee.isListening()){this[X+"ClickStartShape"]=void 0;return}i.Konva.capturePointerEventsEnabled&&ee.setPointerCapture(te.id),this[X+"ClickStartShape"]=ee,ee._fireAndBubble(Y.pointerdown,{evt:B,pointerId:te.id}),Q=!0;const ie=B.type.indexOf("touch")>=0;ee.preventDefault()&&B.cancelable&&ie&&B.preventDefault()}),Q||this._fire(Y.pointerdown,{evt:B,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(B){const Y=F(B.type),X=M(B.type);if(!Y)return;i.Konva.isDragging()&&o.DD.node.preventDefault()&&B.cancelable&&B.preventDefault(),this.setPointersPositions(B);var Q=!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled;if(!Q)return;var te={};let ee=!1;var ie=this._getTargetShape(X);this._changedPointerPositions.forEach(ne=>{const le=u.getCapturedShape(ne.id)||this.getIntersection(ne),Te=ne.id,Ie={evt:B,pointerId:Te};var se=ie!==le;if(se&&ie&&(ie._fireAndBubble(Y.pointerout,{...Ie},le),ie._fireAndBubble(Y.pointerleave,{...Ie},le)),le){if(te[le._id])return;te[le._id]=!0}le&&le.isListening()?(ee=!0,se&&(le._fireAndBubble(Y.pointerover,{...Ie},ie),le._fireAndBubble(Y.pointerenter,{...Ie},ie),this[X+"targetShape"]=le),le._fireAndBubble(Y.pointermove,{...Ie})):ie&&(this._fire(Y.pointerover,{evt:B,target:this,currentTarget:this,pointerId:Te}),this[X+"targetShape"]=null)}),ee||this._fire(Y.pointermove,{evt:B,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(B){const Y=F(B.type),X=M(B.type);if(!Y)return;this.setPointersPositions(B);const Q=this[X+"ClickStartShape"],te=this[X+"ClickEndShape"];var ee={};let ie=!1;this._changedPointerPositions.forEach(ne=>{const le=u.getCapturedShape(ne.id)||this.getIntersection(ne);if(le){if(le.releaseCapture(ne.id),ee[le._id])return;ee[le._id]=!0}const Te=ne.id,Ie={evt:B,pointerId:Te};let se=!1;i.Konva["_"+X+"InDblClickWindow"]?(se=!0,clearTimeout(this[X+"DblTimeout"])):o.DD.justDragged||(i.Konva["_"+X+"InDblClickWindow"]=!0,clearTimeout(this[X+"DblTimeout"])),this[X+"DblTimeout"]=setTimeout(function(){i.Konva["_"+X+"InDblClickWindow"]=!1},i.Konva.dblClickWindow),le&&le.isListening()?(ie=!0,this[X+"ClickEndShape"]=le,le._fireAndBubble(Y.pointerup,{...Ie}),i.Konva["_"+X+"ListenClick"]&&Q&&Q===le&&(le._fireAndBubble(Y.pointerclick,{...Ie}),se&&te&&te===le&&le._fireAndBubble(Y.pointerdblclick,{...Ie}))):(this[X+"ClickEndShape"]=null,i.Konva["_"+X+"ListenClick"]&&this._fire(Y.pointerclick,{evt:B,target:this,currentTarget:this,pointerId:Te}),se&&this._fire(Y.pointerdblclick,{evt:B,target:this,currentTarget:this,pointerId:Te}))}),ie||this._fire(Y.pointerup,{evt:B,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),i.Konva["_"+X+"ListenClick"]=!1,B.cancelable&&X!=="touch"&&B.preventDefault()}_contextmenu(B){this.setPointersPositions(B);var Y=this.getIntersection(this.getPointerPosition());Y&&Y.isListening()?Y._fireAndBubble(L,{evt:B}):this._fire(L,{evt:B,target:this,currentTarget:this})}_wheel(B){this.setPointersPositions(B);var Y=this.getIntersection(this.getPointerPosition());Y&&Y.isListening()?Y._fireAndBubble(q,{evt:B}):this._fire(q,{evt:B,target:this,currentTarget:this})}_pointercancel(B){this.setPointersPositions(B);const Y=u.getCapturedShape(B.pointerId)||this.getIntersection(this.getPointerPosition());Y&&Y._fireAndBubble(_,u.createEvent(B)),u.releaseCapture(B.pointerId)}_lostpointercapture(B){u.releaseCapture(B.pointerId)}setPointersPositions(B){var Y=this._getContentPosition(),X=null,Q=null;B=B||window.event,B.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(B.touches,te=>{this._pointerPositions.push({id:te.identifier,x:(te.clientX-Y.left)/Y.scaleX,y:(te.clientY-Y.top)/Y.scaleY})}),Array.prototype.forEach.call(B.changedTouches||B.touches,te=>{this._changedPointerPositions.push({id:te.identifier,x:(te.clientX-Y.left)/Y.scaleX,y:(te.clientY-Y.top)/Y.scaleY})})):(X=(B.clientX-Y.left)/Y.scaleX,Q=(B.clientY-Y.top)/Y.scaleY,this.pointerPos={x:X,y:Q},this._pointerPositions=[{x:X,y:Q,id:t.Util._getFirstPointerId(B)}],this._changedPointerPositions=[{x:X,y:Q,id:t.Util._getFirstPointerId(B)}])}_setPointerPosition(B){t.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(B)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var B=this.content.getBoundingClientRect();return{top:B.top,left:B.left,scaleX:B.width/this.content.clientWidth||1,scaleY:B.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new a.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new a.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!!i.Konva.isBrowser){var B=this.container();if(!B)throw"Stage has no container. A container is required.";B.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"),B.appendChild(this.content),this._resizeDOM()}}cache(){return t.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(B){B.batchDraw()}),this}}e.Stage=K,K.prototype.nodeType=f,(0,l._registerNode)(K),r.Factory.addGetterSetter(K,"container"),i.Konva.isBrowser&&document.addEventListener("visibilitychange",()=>{e.stages.forEach(G=>{G.batchDraw()})})})(a9);var Uc={},gr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const t=ut,r=Zt,n=ft,i=Vt,a=qe,o=ut,l=En;var u="hasShadow",f="shadowRGBA",h="patternImage",E="linearGradient",w="radialGradient";let p;function S(){return p||(p=r.Util.createCanvasElement().getContext("2d"),p)}e.shapes={};function b(O){const x=this.attrs.fillRule;x?O.fill(x):O.fill()}function y(O){O.stroke()}function v(O){O.fill()}function m(O){O.stroke()}function d(){this._clearCache(u)}function g(){this._clearCache(f)}function _(){this._clearCache(h)}function k(){this._clearCache(E)}function C(){this._clearCache(w)}class P extends i.Node{constructor(x){super(x);let A;for(;A=r.Util.getRandomColor(),!(A&&!(A in e.shapes)););this.colorKey=A,e.shapes[A]=this}getContext(){return r.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return r.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(u,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()){var x=S();const A=x.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(A&&A.setTransform){const L=new r.Transform;L.translate(this.fillPatternX(),this.fillPatternY()),L.rotate(t.Konva.getAngle(this.fillPatternRotation())),L.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),L.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const I=L.getMatrix(),U=typeof DOMMatrix>"u"?{a:I[0],b:I[1],c:I[2],d:I[3],e:I[4],f:I[5]}:new DOMMatrix(I);A.setTransform(U)}return A}}_getLinearGradient(){return this._getCache(E,this.__getLinearGradient)}__getLinearGradient(){var x=this.fillLinearGradientColorStops();if(x){for(var A=S(),L=this.fillLinearGradientStartPoint(),I=this.fillLinearGradientEndPoint(),U=A.createLinearGradient(L.x,L.y,I.x,I.y),$=0;$<x.length;$+=2)U.addColorStop(x[$],x[$+1]);return U}}_getRadialGradient(){return this._getCache(w,this.__getRadialGradient)}__getRadialGradient(){var x=this.fillRadialGradientColorStops();if(x){for(var A=S(),L=this.fillRadialGradientStartPoint(),I=this.fillRadialGradientEndPoint(),U=A.createRadialGradient(L.x,L.y,this.fillRadialGradientStartRadius(),I.x,I.y,this.fillRadialGradientEndRadius()),$=0;$<x.length;$+=2)U.addColorStop(x[$],x[$+1]);return U}}getShadowRGBA(){return this._getCache(f,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var x=r.Util.colorToRGBA(this.shadowColor());if(x)return"rgba("+x.r+","+x.g+","+x.b+","+x.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 x=this.hitStrokeWidth();return x==="auto"?this.hasStroke():this.strokeEnabled()&&!!x}intersects(x){var A=this.getStage();if(!A)return!1;const L=A.bufferHitCanvas;return L.getContext().clear(),this.drawHit(L,void 0,!0),L.context.getImageData(Math.round(x.x),Math.round(x.y),1,1).data[3]>0}destroy(){return i.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(x){var A;if(!((A=this.attrs.perfectDrawEnabled)!==null&&A!==void 0?A:!0))return!1;const I=x||this.hasFill(),U=this.hasStroke(),$=this.getAbsoluteOpacity()!==1;if(I&&U&&$)return!0;const Z=this.hasShadow(),q=this.shadowForStrokeEnabled();return!!(I&&U&&Z&&q)}setStrokeHitEnabled(x){r.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),x?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var x=this.size();return{x:this._centroid?-x.width/2:0,y:this._centroid?-x.height/2:0,width:x.width,height:x.height}}getClientRect(x={}){let A=!1,L=this.getParent();for(;L;){if(L.isCached()){A=!0;break}L=L.getParent()}const I=x.skipTransform,U=x.relativeTo||A&&this.getStage()||void 0,$=this.getSelfRect(),q=!x.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,z=$.width+q,W=$.height+q,R=!x.skipShadow&&this.hasShadow(),M=R?this.shadowOffsetX():0,F=R?this.shadowOffsetY():0,D=z+Math.abs(M),H=W+Math.abs(F),K=R&&this.shadowBlur()||0,G=D+K*2,B=H+K*2,Y={width:G,height:B,x:-(q/2+K)+Math.min(M,0)+$.x,y:-(q/2+K)+Math.min(F,0)+$.y};return I?Y:this._transformedRect(Y,U)}drawScene(x,A,L){var I=this.getLayer(),U=x||I.getCanvas(),$=U.getContext(),Z=this._getCanvasCache(),q=this.getSceneFunc(),z=this.hasShadow(),W,R,M=U.isCache,F=A===this;if(!this.isVisible()&&!F)return this;if(Z){$.save();var D=this.getAbsoluteTransform(A).getMatrix();return $.transform(D[0],D[1],D[2],D[3],D[4],D[5]),this._drawCachedSceneCanvas($),$.restore(),this}if(!q)return this;if($.save(),this._useBufferCanvas()&&!M){W=this.getStage();const G=L||W.bufferCanvas;R=G.getContext(),R.clear(),R.save(),R._applyLineJoin(this);var H=this.getAbsoluteTransform(A).getMatrix();R.transform(H[0],H[1],H[2],H[3],H[4],H[5]),q.call(this,R,this),R.restore();var K=G.pixelRatio;z&&$._applyShadow(this),$._applyOpacity(this),$._applyGlobalCompositeOperation(this),$.drawImage(G._canvas,0,0,G.width/K,G.height/K)}else{if($._applyLineJoin(this),!F){var H=this.getAbsoluteTransform(A).getMatrix();$.transform(H[0],H[1],H[2],H[3],H[4],H[5]),$._applyOpacity(this),$._applyGlobalCompositeOperation(this)}z&&$._applyShadow(this),q.call(this,$,this)}return $.restore(),this}drawHit(x,A,L=!1){if(!this.shouldDrawHit(A,L))return this;var I=this.getLayer(),U=x||I.hitCanvas,$=U&&U.getContext(),Z=this.hitFunc()||this.sceneFunc(),q=this._getCanvasCache(),z=q&&q.hit;if(this.colorKey||r.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()"),z){$.save();var W=this.getAbsoluteTransform(A).getMatrix();return $.transform(W[0],W[1],W[2],W[3],W[4],W[5]),this._drawCachedHitCanvas($),$.restore(),this}if(!Z)return this;if($.save(),$._applyLineJoin(this),!(this===A)){var M=this.getAbsoluteTransform(A).getMatrix();$.transform(M[0],M[1],M[2],M[3],M[4],M[5])}return Z.call(this,$,this),$.restore(),this}drawHitFromCache(x=0){var A=this._getCanvasCache(),L=this._getCachedSceneCanvas(),I=A.hit,U=I.getContext(),$=I.getWidth(),Z=I.getHeight(),q,z,W,R,M,F;U.clear(),U.drawImage(L._canvas,0,0,$,Z);try{for(q=U.getImageData(0,0,$,Z),z=q.data,W=z.length,R=r.Util._hexToRgb(this.colorKey),M=0;M<W;M+=4)F=z[M+3],F>x?(z[M]=R.r,z[M+1]=R.g,z[M+2]=R.b,z[M+3]=255):z[M+3]=0;U.putImageData(q,0,0)}catch(D){r.Util.error("Unable to draw hit graph from cached scene canvas. "+D.message)}return this}hasPointerCapture(x){return l.hasPointerCapture(x,this)}setPointerCapture(x){l.setPointerCapture(x,this)}releaseCapture(x){l.releaseCapture(x,this)}}e.Shape=P,P.prototype._fillFunc=b,P.prototype._strokeFunc=y,P.prototype._fillFuncHit=v,P.prototype._strokeFuncHit=m,P.prototype._centroid=!1,P.prototype.nodeType="Shape",(0,o._registerNode)(P),P.prototype.eventListeners={},P.prototype.on.call(P.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",d),P.prototype.on.call(P.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",g),P.prototype.on.call(P.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",_),P.prototype.on.call(P.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",k),P.prototype.on.call(P.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",C),n.Factory.addGetterSetter(P,"stroke",void 0,(0,a.getStringOrGradientValidator)()),n.Factory.addGetterSetter(P,"strokeWidth",2,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(P,"fillAfterStrokeEnabled",!1),n.Factory.addGetterSetter(P,"hitStrokeWidth","auto",(0,a.getNumberOrAutoValidator)()),n.Factory.addGetterSetter(P,"strokeHitEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(P,"perfectDrawEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(P,"shadowForStrokeEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(P,"lineJoin"),n.Factory.addGetterSetter(P,"lineCap"),n.Factory.addGetterSetter(P,"sceneFunc"),n.Factory.addGetterSetter(P,"hitFunc"),n.Factory.addGetterSetter(P,"dash"),n.Factory.addGetterSetter(P,"dashOffset",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(P,"shadowColor",void 0,(0,a.getStringValidator)()),n.Factory.addGetterSetter(P,"shadowBlur",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(P,"shadowOpacity",1,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(P,"shadowOffset",["x","y"]),n.Factory.addGetterSetter(P,"shadowOffsetX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(P,"shadowOffsetY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(P,"fillPatternImage"),n.Factory.addGetterSetter(P,"fill",void 0,(0,a.getStringOrGradientValidator)()),n.Factory.addGetterSetter(P,"fillPatternX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(P,"fillPatternY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(P,"fillLinearGradientColorStops"),n.Factory.addGetterSetter(P,"strokeLinearGradientColorStops"),n.Factory.addGetterSetter(P,"fillRadialGradientStartRadius",0),n.Factory.addGetterSetter(P,"fillRadialGradientEndRadius",0),n.Factory.addGetterSetter(P,"fillRadialGradientColorStops"),n.Factory.addGetterSetter(P,"fillPatternRepeat","repeat"),n.Factory.addGetterSetter(P,"fillEnabled",!0),n.Factory.addGetterSetter(P,"strokeEnabled",!0),n.Factory.addGetterSetter(P,"shadowEnabled",!0),n.Factory.addGetterSetter(P,"dashEnabled",!0),n.Factory.addGetterSetter(P,"strokeScaleEnabled",!0),n.Factory.addGetterSetter(P,"fillPriority","color"),n.Factory.addComponentsGetterSetter(P,"fillPatternOffset",["x","y"]),n.Factory.addGetterSetter(P,"fillPatternOffsetX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(P,"fillPatternOffsetY",0,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(P,"fillPatternScale",["x","y"]),n.Factory.addGetterSetter(P,"fillPatternScaleX",1,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(P,"fillPatternScaleY",1,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(P,"fillLinearGradientStartPoint",["x","y"]),n.Factory.addComponentsGetterSetter(P,"strokeLinearGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(P,"fillLinearGradientStartPointX",0),n.Factory.addGetterSetter(P,"strokeLinearGradientStartPointX",0),n.Factory.addGetterSetter(P,"fillLinearGradientStartPointY",0),n.Factory.addGetterSetter(P,"strokeLinearGradientStartPointY",0),n.Factory.addComponentsGetterSetter(P,"fillLinearGradientEndPoint",["x","y"]),n.Factory.addComponentsGetterSetter(P,"strokeLinearGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(P,"fillLinearGradientEndPointX",0),n.Factory.addGetterSetter(P,"strokeLinearGradientEndPointX",0),n.Factory.addGetterSetter(P,"fillLinearGradientEndPointY",0),n.Factory.addGetterSetter(P,"strokeLinearGradientEndPointY",0),n.Factory.addComponentsGetterSetter(P,"fillRadialGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(P,"fillRadialGradientStartPointX",0),n.Factory.addGetterSetter(P,"fillRadialGradientStartPointY",0),n.Factory.addComponentsGetterSetter(P,"fillRadialGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(P,"fillRadialGradientEndPointX",0),n.Factory.addGetterSetter(P,"fillRadialGradientEndPointY",0),n.Factory.addGetterSetter(P,"fillPatternRotation",0),n.Factory.addGetterSetter(P,"fillRule",void 0,(0,a.getStringValidator)()),n.Factory.backCompat(P,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(gr);Object.defineProperty(Uc,"__esModule",{value:!0});Uc.Layer=void 0;const ia=Zt,V1=gl,Vl=Vt,Dy=ft,F5=vi,oT=qe,lT=gr,sT=ut;var uT="#",cT="beforeDraw",fT="draw",s9=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],dT=s9.length;let Vs=class extends V1.Container{constructor(t){super(t),this.canvas=new F5.SceneCanvas,this.hitCanvas=new F5.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(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);var r=this.getStage();return r&&r.content&&(r.content.removeChild(this.getNativeCanvasElement()),t<r.children.length-1?r.content.insertBefore(this.getNativeCanvasElement(),r.children[t+1].getCanvas()._canvas):r.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){Vl.Node.prototype.moveToTop.call(this);var t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){var t=Vl.Node.prototype.moveUp.call(this);if(!t)return!1;var r=this.getStage();return!r||!r.content?!1:(r.content.removeChild(this.getNativeCanvasElement()),this.index<r.children.length-1?r.content.insertBefore(this.getNativeCanvasElement(),r.children[this.index+1].getCanvas()._canvas):r.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(Vl.Node.prototype.moveDown.call(this)){var t=this.getStage();if(t){var r=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),r[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(Vl.Node.prototype.moveToBottom.call(this)){var t=this.getStage();if(t){var r=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),r[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){var t=this.getNativeCanvasElement();return Vl.Node.prototype.remove.call(this),t&&t.parentNode&&ia.Util._isInDocument(t)&&t.parentNode.removeChild(t),this}getStage(){return this.parent}setSize({width:t,height:r}){return this.canvas.setSize(t,r),this.hitCanvas.setSize(t,r),this._setSmoothEnabled(),this}_validateAdd(t){var r=t.getType();r!=="Group"&&r!=="Shape"&&ia.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(t){return t=t||{},t.width=t.width||this.getWidth(),t.height=t.height||this.getHeight(),t.x=t.x!==void 0?t.x:this.x(),t.y=t.y!==void 0?t.y:this.y(),Vl.Node.prototype._toKonvaCanvas.call(this,t)}_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(){ia.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){ia.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,ia.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var r=1,n=!1;;){for(let i=0;i<dT;i++){const a=s9[i],o=this._getIntersection({x:t.x+a.x*r,y:t.y+a.y*r}),l=o.shape;if(l)return l;if(n=!!o.antialiased,!o.antialiased)break}if(n)r+=1;else return null}}_getIntersection(t){const r=this.hitCanvas.pixelRatio,n=this.hitCanvas.context.getImageData(Math.round(t.x*r),Math.round(t.y*r),1,1).data,i=n[3];if(i===255){const a=ia.Util._rgbToHex(n[0],n[1],n[2]),o=lT.shapes[uT+a];return o?{shape:o}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(t,r){var n=this.getLayer(),i=t||n&&n.getCanvas();return this._fire(cT,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),V1.Container.prototype.drawScene.call(this,i,r),this._fire(fT,{node:this}),this}drawHit(t,r){var n=this.getLayer(),i=t||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),V1.Container.prototype.drawHit.call(this,i,r),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){ia.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return ia.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,r=!!this.hitCanvas._canvas.parentNode;r?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return ia.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};Uc.Layer=Vs;Vs.prototype.nodeType="Layer";(0,sT._registerNode)(Vs);Dy.Factory.addGetterSetter(Vs,"imageSmoothingEnabled",!0);Dy.Factory.addGetterSetter(Vs,"clearBeforeDraw",!0);Dy.Factory.addGetterSetter(Vs,"hitGraphEnabled",!0,(0,oT.getBooleanValidator)());var ip={};Object.defineProperty(ip,"__esModule",{value:!0});ip.FastLayer=void 0;const hT=Zt,pT=Uc,gT=ut;let jy=class extends pT.Layer{constructor(t){super(t),this.listening(!1),hT.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}};ip.FastLayer=jy;jy.prototype.nodeType="FastLayer";(0,gT._registerNode)(jy);var qs={};Object.defineProperty(qs,"__esModule",{value:!0});qs.Group=void 0;const vT=Zt,mT=gl,yT=ut;let Fy=class extends mT.Container{_validateAdd(t){var r=t.getType();r!=="Group"&&r!=="Shape"&&vT.Util.throw("You may only add groups and shapes to groups.")}};qs.Group=Fy;Fy.prototype.nodeType="Group";(0,yT._registerNode)(Fy);var Ws={};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.Animation=void 0;const q1=ut,z5=Zt,W1=function(){return q1.glob.performance&&q1.glob.performance.now?function(){return q1.glob.performance.now()}:function(){return new Date().getTime()}}();class ji{constructor(t,r){this.id=ji.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:W1(),frameRate:0},this.func=t,this.setLayers(r)}setLayers(t){let r=[];return t&&(r=Array.isArray(t)?t:[t]),this.layers=r,this}getLayers(){return this.layers}addLayer(t){const r=this.layers,n=r.length;for(let i=0;i<n;i++)if(r[i]._id===t._id)return!1;return this.layers.push(t),!0}isRunning(){const r=ji.animations,n=r.length;for(let i=0;i<n;i++)if(r[i].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=W1(),ji._addAnimation(this),this}stop(){return ji._removeAnimation(this),this}_updateFrameObject(t){this.frame.timeDiff=t-this.frame.lastTime,this.frame.lastTime=t,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(t){this.animations.push(t),this._handleAnimation()}static _removeAnimation(t){const r=t.id,n=this.animations,i=n.length;for(let a=0;a<i;a++)if(n[a].id===r){this.animations.splice(a,1);break}}static _runFrames(){const t={},r=this.animations;for(let n=0;n<r.length;n++){const i=r[n],a=i.layers,o=i.func;i._updateFrameObject(W1());const l=a.length;let u;if(o?u=o.call(i,i.frame)!==!1:u=!0,!!u)for(let f=0;f<l;f++){const h=a[f];h._id!==void 0&&(t[h._id]=h)}}for(let n in t)t.hasOwnProperty(n)&&t[n].batchDraw()}static _animationLoop(){const t=ji;t.animations.length?(t._runFrames(),z5.Util.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,z5.Util.requestAnimFrame(this._animationLoop))}}Ws.Animation=ji;ji.animations=[];ji.animIdCounter=0;ji.animRunning=!1;var u9={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const t=Zt,r=Ws,n=Vt,i=ut;var a={node:1,duration:1,easing:1,onFinish:1,yoyo:1},o=1,l=2,u=3,f=0,h=["fill","stroke","shadowColor"];class E{constructor(S,b,y,v,m,d,g){this.prop=S,this.propFunc=b,this.begin=v,this._pos=v,this.duration=d,this._change=0,this.prevPos=0,this.yoyo=g,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=y,this._change=m-this.begin,this.pause()}fire(S){var b=this[S];b&&b()}setTime(S){S>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():S<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=S,this.update())}getTime(){return this._time}setPosition(S){this.prevPos=this._pos,this.propFunc(S),this._pos=S}getPosition(S){return S===void 0&&(S=this._time),this.func(S,this.begin,this._change,this.duration)}play(){this.state=l,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=u,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(S){this.pause(),this._time=S,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var S=this.getTimer()-this._startTime;this.state===l?this.setTime(S):this.state===u&&this.setTime(this.duration-S)}pause(){this.state=o,this.fire("onPause")}getTimer(){return new Date().getTime()}}class w{constructor(S){var b=this,y=S.node,v=y._id,m,d=S.easing||e.Easings.Linear,g=!!S.yoyo,_;typeof S.duration>"u"?m=.3:S.duration===0?m=.001:m=S.duration,this.node=y,this._id=f++;var k=y.getLayer()||(y instanceof i.Konva.Stage?y.getLayers():null);k||t.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new r.Animation(function(){b.tween.onEnterFrame()},k),this.tween=new E(_,function(C){b._tweenFunc(C)},d,0,1,m*1e3,g),this._addListeners(),w.attrs[v]||(w.attrs[v]={}),w.attrs[v][this._id]||(w.attrs[v][this._id]={}),w.tweens[v]||(w.tweens[v]={});for(_ in S)a[_]===void 0&&this._addAttr(_,S[_]);this.reset(),this.onFinish=S.onFinish,this.onReset=S.onReset,this.onUpdate=S.onUpdate}_addAttr(S,b){var y=this.node,v=y._id,m,d,g,_,k,C,P,O;if(g=w.tweens[v][S],g&&delete w.attrs[v][g][S],m=y.getAttr(S),t.Util._isArray(b))if(d=[],k=Math.max(b.length,m.length),S==="points"&&b.length!==m.length&&(b.length>m.length?(P=m,m=t.Util._prepareArrayForTween(m,b,y.closed())):(C=b,b=t.Util._prepareArrayForTween(b,m,y.closed()))),S.indexOf("fill")===0)for(_=0;_<k;_++)if(_%2===0)d.push(b[_]-m[_]);else{var x=t.Util.colorToRGBA(m[_]);O=t.Util.colorToRGBA(b[_]),m[_]=x,d.push({r:O.r-x.r,g:O.g-x.g,b:O.b-x.b,a:O.a-x.a})}else for(_=0;_<k;_++)d.push(b[_]-m[_]);else h.indexOf(S)!==-1?(m=t.Util.colorToRGBA(m),O=t.Util.colorToRGBA(b),d={r:O.r-m.r,g:O.g-m.g,b:O.b-m.b,a:O.a-m.a}):d=b-m;w.attrs[v][this._id][S]={start:m,diff:d,end:b,trueEnd:C,trueStart:P},w.tweens[v][S]=this._id}_tweenFunc(S){var b=this.node,y=w.attrs[b._id][this._id],v,m,d,g,_,k,C,P;for(v in y){if(m=y[v],d=m.start,g=m.diff,P=m.end,t.Util._isArray(d))if(_=[],C=Math.max(d.length,P.length),v.indexOf("fill")===0)for(k=0;k<C;k++)k%2===0?_.push((d[k]||0)+g[k]*S):_.push("rgba("+Math.round(d[k].r+g[k].r*S)+","+Math.round(d[k].g+g[k].g*S)+","+Math.round(d[k].b+g[k].b*S)+","+(d[k].a+g[k].a*S)+")");else for(k=0;k<C;k++)_.push((d[k]||0)+g[k]*S);else h.indexOf(v)!==-1?_="rgba("+Math.round(d.r+g.r*S)+","+Math.round(d.g+g.g*S)+","+Math.round(d.b+g.b*S)+","+(d.a+g.a*S)+")":_=d+g*S;b.setAttr(v,_)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var S=this.node,b=w.attrs[S._id][this._id];b.points&&b.points.trueEnd&&S.setAttr("points",b.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var S=this.node,b=w.attrs[S._id][this._id];b.points&&b.points.trueStart&&S.points(b.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(S){return this.tween.seek(S*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var S=this.node._id,b=this._id,y=w.tweens[S],v;this.pause();for(v in y)delete w.tweens[S][v];delete w.attrs[S][b]}}e.Tween=w,w.attrs={},w.tweens={},n.Node.prototype.to=function(p){var S=p.onFinish;p.node=this,p.onFinish=function(){this.destroy(),S&&S()};var b=new w(p);b.play()},e.Easings={BackEaseIn(p,S,b,y){var v=1.70158;return b*(p/=y)*p*((v+1)*p-v)+S},BackEaseOut(p,S,b,y){var v=1.70158;return b*((p=p/y-1)*p*((v+1)*p+v)+1)+S},BackEaseInOut(p,S,b,y){var v=1.70158;return(p/=y/2)<1?b/2*(p*p*(((v*=1.525)+1)*p-v))+S:b/2*((p-=2)*p*(((v*=1.525)+1)*p+v)+2)+S},ElasticEaseIn(p,S,b,y,v,m){var d=0;return p===0?S:(p/=y)===1?S+b:(m||(m=y*.3),!v||v<Math.abs(b)?(v=b,d=m/4):d=m/(2*Math.PI)*Math.asin(b/v),-(v*Math.pow(2,10*(p-=1))*Math.sin((p*y-d)*(2*Math.PI)/m))+S)},ElasticEaseOut(p,S,b,y,v,m){var d=0;return p===0?S:(p/=y)===1?S+b:(m||(m=y*.3),!v||v<Math.abs(b)?(v=b,d=m/4):d=m/(2*Math.PI)*Math.asin(b/v),v*Math.pow(2,-10*p)*Math.sin((p*y-d)*(2*Math.PI)/m)+b+S)},ElasticEaseInOut(p,S,b,y,v,m){var d=0;return p===0?S:(p/=y/2)===2?S+b:(m||(m=y*(.3*1.5)),!v||v<Math.abs(b)?(v=b,d=m/4):d=m/(2*Math.PI)*Math.asin(b/v),p<1?-.5*(v*Math.pow(2,10*(p-=1))*Math.sin((p*y-d)*(2*Math.PI)/m))+S:v*Math.pow(2,-10*(p-=1))*Math.sin((p*y-d)*(2*Math.PI)/m)*.5+b+S)},BounceEaseOut(p,S,b,y){return(p/=y)<1/2.75?b*(7.5625*p*p)+S:p<2/2.75?b*(7.5625*(p-=1.5/2.75)*p+.75)+S:p<2.5/2.75?b*(7.5625*(p-=2.25/2.75)*p+.9375)+S:b*(7.5625*(p-=2.625/2.75)*p+.984375)+S},BounceEaseIn(p,S,b,y){return b-e.Easings.BounceEaseOut(y-p,0,b,y)+S},BounceEaseInOut(p,S,b,y){return p<y/2?e.Easings.BounceEaseIn(p*2,0,b,y)*.5+S:e.Easings.BounceEaseOut(p*2-y,0,b,y)*.5+b*.5+S},EaseIn(p,S,b,y){return b*(p/=y)*p+S},EaseOut(p,S,b,y){return-b*(p/=y)*(p-2)+S},EaseInOut(p,S,b,y){return(p/=y/2)<1?b/2*p*p+S:-b/2*(--p*(p-2)-1)+S},StrongEaseIn(p,S,b,y){return b*(p/=y)*p*p*p*p+S},StrongEaseOut(p,S,b,y){return b*((p=p/y-1)*p*p*p*p+1)+S},StrongEaseInOut(p,S,b,y){return(p/=y/2)<1?b/2*p*p*p*p*p+S:b/2*((p-=2)*p*p*p*p+2)+S},Linear(p,S,b,y){return b*p/y+S}}})(u9);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const t=ut,r=Zt,n=Vt,i=gl,a=a9,o=Uc,l=ip,u=qs,f=rp,h=gr,E=Ws,w=u9,p=pa,S=vi;e.Konva=r.Util._assign(t.Konva,{Util:r.Util,Transform:r.Transform,Node:n.Node,Container:i.Container,Stage:a.Stage,stages:a.stages,Layer:o.Layer,FastLayer:l.FastLayer,Group:u.Group,DD:f.DD,Shape:h.Shape,shapes:h.shapes,Animation:E.Animation,Tween:w.Tween,Easings:w.Easings,Context:p.Context,Canvas:S.Canvas}),e.default=e.Konva})(vh);var ap={};Object.defineProperty(ap,"__esModule",{value:!0});ap.Arc=void 0;const op=ft,bT=gr,B5=ut,lp=qe,_T=ut;let xa=class extends bT.Shape{_sceneFunc(t){var r=B5.Konva.getAngle(this.angle()),n=this.clockwise();t.beginPath(),t.arc(0,0,this.outerRadius(),0,r,n),t.arc(0,0,this.innerRadius(),r,0,!n),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}getSelfRect(){const t=this.innerRadius(),r=this.outerRadius(),n=this.clockwise(),i=B5.Konva.getAngle(n?360-this.angle():this.angle()),a=Math.cos(Math.min(i,Math.PI)),o=1,l=Math.sin(Math.min(Math.max(Math.PI,i),3*Math.PI/2)),u=Math.sin(Math.min(i,Math.PI/2)),f=a*(a>0?t:r),h=o*r,E=l*(l>0?t:r),w=u*(u>0?r:t);return{x:f,y:n?-1*w:E,width:h-f,height:w-E}}};ap.Arc=xa;xa.prototype._centroid=!0;xa.prototype.className="Arc";xa.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,_T._registerNode)(xa);op.Factory.addGetterSetter(xa,"innerRadius",0,(0,lp.getNumberValidator)());op.Factory.addGetterSetter(xa,"outerRadius",0,(0,lp.getNumberValidator)());op.Factory.addGetterSetter(xa,"angle",0,(0,lp.getNumberValidator)());op.Factory.addGetterSetter(xa,"clockwise",!1,(0,lp.getBooleanValidator)());var sp={},Hc={};Object.defineProperty(Hc,"__esModule",{value:!0});Hc.Line=void 0;const up=ft,wT=gr,c9=qe,ST=ut;function sm(e,t,r,n,i,a,o){var l=Math.sqrt(Math.pow(r-e,2)+Math.pow(n-t,2)),u=Math.sqrt(Math.pow(i-r,2)+Math.pow(a-n,2)),f=o*l/(l+u),h=o*u/(l+u),E=r-f*(i-e),w=n-f*(a-t),p=r+h*(i-e),S=n+h*(a-t);return[E,w,p,S]}function U5(e,t){var r=e.length,n=[],i,a;for(i=2;i<r-2;i+=2)a=sm(e[i-2],e[i-1],e[i],e[i+1],e[i+2],e[i+3],t),!isNaN(a[0])&&(n.push(a[0]),n.push(a[1]),n.push(e[i]),n.push(e[i+1]),n.push(a[2]),n.push(a[3]));return n}let _o=class extends wT.Shape{constructor(t){super(t),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(t){var r=this.points(),n=r.length,i=this.tension(),a=this.closed(),o=this.bezier(),l,u,f;if(n){if(t.beginPath(),t.moveTo(r[0],r[1]),i!==0&&n>4){for(l=this.getTensionPoints(),u=l.length,f=a?0:4,a||t.quadraticCurveTo(l[0],l[1],l[2],l[3]);f<u-2;)t.bezierCurveTo(l[f++],l[f++],l[f++],l[f++],l[f++],l[f++]);a||t.quadraticCurveTo(l[u-2],l[u-1],r[n-2],r[n-1])}else if(o)for(f=2;f<n;)t.bezierCurveTo(r[f++],r[f++],r[f++],r[f++],r[f++],r[f++]);else for(f=2;f<n;f+=2)t.lineTo(r[f],r[f+1]);a?(t.closePath(),t.fillStrokeShape(this)):t.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():U5(this.points(),this.tension())}_getTensionPointsClosed(){var t=this.points(),r=t.length,n=this.tension(),i=sm(t[r-2],t[r-1],t[0],t[1],t[2],t[3],n),a=sm(t[r-4],t[r-3],t[r-2],t[r-1],t[0],t[1],n),o=U5(t,n),l=[i[2],i[3]].concat(o).concat([a[0],a[1],t[r-2],t[r-1],a[2],a[3],i[0],i[1],t[0],t[1]]);return l}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){var t=this.points();if(t.length<4)return{x:t[0]||0,y:t[1]||0,width:0,height:0};this.tension()!==0?t=[t[0],t[1],...this._getTensionPoints(),t[t.length-2],t[t.length-1]]:t=this.points();for(var r=t[0],n=t[0],i=t[1],a=t[1],o,l,u=0;u<t.length/2;u++)o=t[u*2],l=t[u*2+1],r=Math.min(r,o),n=Math.max(n,o),i=Math.min(i,l),a=Math.max(a,l);return{x:r,y:i,width:n-r,height:a-i}}};Hc.Line=_o;_o.prototype.className="Line";_o.prototype._attrsAffectingSize=["points","bezier","tension"];(0,ST._registerNode)(_o);up.Factory.addGetterSetter(_o,"closed",!1);up.Factory.addGetterSetter(_o,"bezier",!1);up.Factory.addGetterSetter(_o,"tension",0,(0,c9.getNumberValidator)());up.Factory.addGetterSetter(_o,"points",[],(0,c9.getNumberArrayValidator)());var Ks={},f9={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t2length=e.getQuadraticArcLength=e.getCubicArcLength=e.binomialCoefficients=e.cValues=e.tValues=void 0,e.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],e.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],e.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const t=(o,l,u)=>{let f,h,E;f=u/2,h=0;for(let p=0;p<20;p++)E=f*e.tValues[20][p]+f,h+=e.cValues[20][p]*n(o,l,E);return f*h};e.getCubicArcLength=t;const r=(o,l,u)=>{u===void 0&&(u=1);const f=o[0]-2*o[1]+o[2],h=l[0]-2*l[1]+l[2],E=2*o[1]-2*o[0],w=2*l[1]-2*l[0],p=4*(f*f+h*h),S=4*(f*E+h*w),b=E*E+w*w;if(p===0)return u*Math.sqrt(Math.pow(o[2]-o[0],2)+Math.pow(l[2]-l[0],2));const y=S/(2*p),v=b/p,m=u+y,d=v-y*y,g=m*m+d>0?Math.sqrt(m*m+d):0,_=y*y+d>0?Math.sqrt(y*y+d):0,k=y+Math.sqrt(y*y+d)!==0?d*Math.log(Math.abs((m+g)/(y+_))):0;return Math.sqrt(p)/2*(m*g-y*_+k)};e.getQuadraticArcLength=r;function n(o,l,u){const f=i(1,u,o),h=i(1,u,l),E=f*f+h*h;return Math.sqrt(E)}const i=(o,l,u)=>{const f=u.length-1;let h,E;if(f===0)return 0;if(o===0){E=0;for(let w=0;w<=f;w++)E+=e.binomialCoefficients[f][w]*Math.pow(1-l,f-w)*Math.pow(l,w)*u[w];return E}else{h=new Array(f);for(let w=0;w<f;w++)h[w]=f*(u[w+1]-u[w]);return i(o-1,l,h)}},a=(o,l,u)=>{let f=1,h=o/l,E=(o-u(h))/l,w=0;for(;f>.001;){const p=u(h+E),S=Math.abs(o-p)/l;if(S<f)f=S,h+=E;else{const b=u(h-E),y=Math.abs(o-b)/l;y<f?(f=y,h-=E):E/=2}if(w++,w>500)break}return h};e.t2length=a})(f9);Object.defineProperty(Ks,"__esModule",{value:!0});Ks.Path=void 0;const ET=ft,OT=gr,xT=ut,ql=f9;let $c=class sn extends OT.Shape{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=sn.parsePathData(this.data()),this.pathLength=sn.getPathLength(this.dataArray)}_sceneFunc(t){var r=this.dataArray;t.beginPath();for(var n=!1,i=0;i<r.length;i++){var a=r[i].command,o=r[i].points;switch(a){case"L":t.lineTo(o[0],o[1]);break;case"M":t.moveTo(o[0],o[1]);break;case"C":t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"Q":t.quadraticCurveTo(o[0],o[1],o[2],o[3]);break;case"A":var l=o[0],u=o[1],f=o[2],h=o[3],E=o[4],w=o[5],p=o[6],S=o[7],b=f>h?f:h,y=f>h?1:f/h,v=f>h?h/f:1;t.translate(l,u),t.rotate(p),t.scale(y,v),t.arc(0,0,b,E,E+w,1-S),t.scale(1/y,1/v),t.rotate(-p),t.translate(-l,-u);break;case"z":n=!0,t.closePath();break}}!n&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(f){if(f.command==="A"){var h=f.points[4],E=f.points[5],w=f.points[4]+E,p=Math.PI/180;if(Math.abs(h-w)<p&&(p=Math.abs(h-w)),E<0)for(let S=h-p;S>w;S-=p){const b=sn.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],S,0);t.push(b.x,b.y)}else for(let S=h+p;S<w;S+=p){const b=sn.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],S,0);t.push(b.x,b.y)}}else if(f.command==="C")for(let S=0;S<=1;S+=.01){const b=sn.getPointOnCubicBezier(S,f.start.x,f.start.y,f.points[0],f.points[1],f.points[2],f.points[3],f.points[4],f.points[5]);t.push(b.x,b.y)}else t=t.concat(f.points)});for(var r=t[0],n=t[0],i=t[1],a=t[1],o,l,u=0;u<t.length/2;u++)o=t[u*2],l=t[u*2+1],isNaN(o)||(r=Math.min(r,o),n=Math.max(n,o)),isNaN(l)||(i=Math.min(i,l),a=Math.max(a,l));return{x:r,y:i,width:n-r,height:a-i}}getLength(){return this.pathLength}getPointAtLength(t){return sn.getPointAtLengthOfDataArray(t,this.dataArray)}static getLineLength(t,r,n,i){return Math.sqrt((n-t)*(n-t)+(i-r)*(i-r))}static getPathLength(t){let r=0;for(var n=0;n<t.length;++n)r+=t[n].pathLength;return r}static getPointAtLengthOfDataArray(t,r){var n,i=0,a=r.length;if(!a)return null;for(;i<a&&t>r[i].pathLength;)t-=r[i].pathLength,++i;if(i===a)return n=r[i-1].points.slice(-2),{x:n[0],y:n[1]};if(t<.01)return n=r[i].points.slice(0,2),{x:n[0],y:n[1]};var o=r[i],l=o.points;switch(o.command){case"L":return sn.getPointOnLine(t,o.start.x,o.start.y,l[0],l[1]);case"C":return sn.getPointOnCubicBezier((0,ql.t2length)(t,sn.getPathLength(r),b=>(0,ql.getCubicArcLength)([o.start.x,l[0],l[2],l[4]],[o.start.y,l[1],l[3],l[5]],b)),o.start.x,o.start.y,l[0],l[1],l[2],l[3],l[4],l[5]);case"Q":return sn.getPointOnQuadraticBezier((0,ql.t2length)(t,sn.getPathLength(r),b=>(0,ql.getQuadraticArcLength)([o.start.x,l[0],l[2]],[o.start.y,l[1],l[3]],b)),o.start.x,o.start.y,l[0],l[1],l[2],l[3]);case"A":var u=l[0],f=l[1],h=l[2],E=l[3],w=l[4],p=l[5],S=l[6];return w+=p*t/o.pathLength,sn.getPointOnEllipticalArc(u,f,h,E,w,S)}return null}static getPointOnLine(t,r,n,i,a,o,l){o=o??r,l=l??n;const u=this.getLineLength(r,n,i,a);if(u<1e-10)return{x:r,y:n};if(i===r)return{x:o,y:l+(a>n?t:-t)};const f=(a-n)/(i-r),h=Math.sqrt(t*t/(1+f*f))*(i<r?-1:1),E=f*h;if(Math.abs(l-n-f*(o-r))<1e-10)return{x:o+h,y:l+E};const w=((o-r)*(i-r)+(l-n)*(a-n))/(u*u),p=r+w*(i-r),S=n+w*(a-n),b=this.getLineLength(o,l,p,S),y=Math.sqrt(t*t-b*b),v=Math.sqrt(y*y/(1+f*f))*(i<r?-1:1),m=f*v;return{x:p+v,y:S+m}}static getPointOnCubicBezier(t,r,n,i,a,o,l,u,f){function h(y){return y*y*y}function E(y){return 3*y*y*(1-y)}function w(y){return 3*y*(1-y)*(1-y)}function p(y){return(1-y)*(1-y)*(1-y)}var S=u*h(t)+o*E(t)+i*w(t)+r*p(t),b=f*h(t)+l*E(t)+a*w(t)+n*p(t);return{x:S,y:b}}static getPointOnQuadraticBezier(t,r,n,i,a,o,l){function u(p){return p*p}function f(p){return 2*p*(1-p)}function h(p){return(1-p)*(1-p)}var E=o*u(t)+i*f(t)+r*h(t),w=l*u(t)+a*f(t)+n*h(t);return{x:E,y:w}}static getPointOnEllipticalArc(t,r,n,i,a,o){var l=Math.cos(o),u=Math.sin(o),f={x:n*Math.cos(a),y:i*Math.sin(a)};return{x:t+(f.x*l-f.y*u),y:r+(f.x*u+f.y*l)}}static parsePathData(t){if(!t)return[];var r=t,n=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];r=r.replace(new RegExp(" ","g"),",");for(var i=0;i<n.length;i++)r=r.replace(new RegExp(n[i],"g"),"|"+n[i]);var a=r.split("|"),o=[],l=[],u=0,f=0,h=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,E;for(i=1;i<a.length;i++){var w=a[i],p=w.charAt(0);for(w=w.slice(1),l.length=0;E=h.exec(w);)l.push(E[0]);for(var S=[],b=0,y=l.length;b<y;b++){if(l[b]==="00"){S.push(0,0);continue}var v=parseFloat(l[b]);isNaN(v)?S.push(0):S.push(v)}for(;S.length>0&&!isNaN(S[0]);){var m="",d=[],g=u,_=f,k,C,P,O,x,A,L,I,U,$;switch(p){case"l":u+=S.shift(),f+=S.shift(),m="L",d.push(u,f);break;case"L":u=S.shift(),f=S.shift(),d.push(u,f);break;case"m":var Z=S.shift(),q=S.shift();if(u+=Z,f+=q,m="M",o.length>2&&o[o.length-1].command==="z"){for(var z=o.length-2;z>=0;z--)if(o[z].command==="M"){u=o[z].points[0]+Z,f=o[z].points[1]+q;break}}d.push(u,f),p="l";break;case"M":u=S.shift(),f=S.shift(),m="M",d.push(u,f),p="L";break;case"h":u+=S.shift(),m="L",d.push(u,f);break;case"H":u=S.shift(),m="L",d.push(u,f);break;case"v":f+=S.shift(),m="L",d.push(u,f);break;case"V":f=S.shift(),m="L",d.push(u,f);break;case"C":d.push(S.shift(),S.shift(),S.shift(),S.shift()),u=S.shift(),f=S.shift(),d.push(u,f);break;case"c":d.push(u+S.shift(),f+S.shift(),u+S.shift(),f+S.shift()),u+=S.shift(),f+=S.shift(),m="C",d.push(u,f);break;case"S":C=u,P=f,k=o[o.length-1],k.command==="C"&&(C=u+(u-k.points[2]),P=f+(f-k.points[3])),d.push(C,P,S.shift(),S.shift()),u=S.shift(),f=S.shift(),m="C",d.push(u,f);break;case"s":C=u,P=f,k=o[o.length-1],k.command==="C"&&(C=u+(u-k.points[2]),P=f+(f-k.points[3])),d.push(C,P,u+S.shift(),f+S.shift()),u+=S.shift(),f+=S.shift(),m="C",d.push(u,f);break;case"Q":d.push(S.shift(),S.shift()),u=S.shift(),f=S.shift(),d.push(u,f);break;case"q":d.push(u+S.shift(),f+S.shift()),u+=S.shift(),f+=S.shift(),m="Q",d.push(u,f);break;case"T":C=u,P=f,k=o[o.length-1],k.command==="Q"&&(C=u+(u-k.points[0]),P=f+(f-k.points[1])),u=S.shift(),f=S.shift(),m="Q",d.push(C,P,u,f);break;case"t":C=u,P=f,k=o[o.length-1],k.command==="Q"&&(C=u+(u-k.points[0]),P=f+(f-k.points[1])),u+=S.shift(),f+=S.shift(),m="Q",d.push(C,P,u,f);break;case"A":O=S.shift(),x=S.shift(),A=S.shift(),L=S.shift(),I=S.shift(),U=u,$=f,u=S.shift(),f=S.shift(),m="A",d=this.convertEndpointToCenterParameterization(U,$,u,f,L,I,O,x,A);break;case"a":O=S.shift(),x=S.shift(),A=S.shift(),L=S.shift(),I=S.shift(),U=u,$=f,u+=S.shift(),f+=S.shift(),m="A",d=this.convertEndpointToCenterParameterization(U,$,u,f,L,I,O,x,A);break}o.push({command:m||p,points:d,start:{x:g,y:_},pathLength:this.calcLength(g,_,m||p,d)})}(p==="z"||p==="Z")&&o.push({command:"z",points:[],start:void 0,pathLength:0})}return o}static calcLength(t,r,n,i){var a,o,l,u,f=sn;switch(n){case"L":return f.getLineLength(t,r,i[0],i[1]);case"C":return(0,ql.getCubicArcLength)([t,i[0],i[2],i[4]],[r,i[1],i[3],i[5]],1);case"Q":return(0,ql.getQuadraticArcLength)([t,i[0],i[2]],[r,i[1],i[3]],1);case"A":a=0;var h=i[4],E=i[5],w=i[4]+E,p=Math.PI/180;if(Math.abs(h-w)<p&&(p=Math.abs(h-w)),o=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],h,0),E<0)for(u=h-p;u>w;u-=p)l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),a+=f.getLineLength(o.x,o.y,l.x,l.y),o=l;else for(u=h+p;u<w;u+=p)l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),a+=f.getLineLength(o.x,o.y,l.x,l.y),o=l;return l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],w,0),a+=f.getLineLength(o.x,o.y,l.x,l.y),a}return 0}static convertEndpointToCenterParameterization(t,r,n,i,a,o,l,u,f){var h=f*(Math.PI/180),E=Math.cos(h)*(t-n)/2+Math.sin(h)*(r-i)/2,w=-1*Math.sin(h)*(t-n)/2+Math.cos(h)*(r-i)/2,p=E*E/(l*l)+w*w/(u*u);p>1&&(l*=Math.sqrt(p),u*=Math.sqrt(p));var S=Math.sqrt((l*l*(u*u)-l*l*(w*w)-u*u*(E*E))/(l*l*(w*w)+u*u*(E*E)));a===o&&(S*=-1),isNaN(S)&&(S=0);var b=S*l*w/u,y=S*-u*E/l,v=(t+n)/2+Math.cos(h)*b-Math.sin(h)*y,m=(r+i)/2+Math.sin(h)*b+Math.cos(h)*y,d=function(x){return Math.sqrt(x[0]*x[0]+x[1]*x[1])},g=function(x,A){return(x[0]*A[0]+x[1]*A[1])/(d(x)*d(A))},_=function(x,A){return(x[0]*A[1]<x[1]*A[0]?-1:1)*Math.acos(g(x,A))},k=_([1,0],[(E-b)/l,(w-y)/u]),C=[(E-b)/l,(w-y)/u],P=[(-1*E-b)/l,(-1*w-y)/u],O=_(C,P);return g(C,P)<=-1&&(O=Math.PI),g(C,P)>=1&&(O=0),o===0&&O>0&&(O=O-2*Math.PI),o===1&&O<0&&(O=O+2*Math.PI),[v,m,l,u,k,O,h,o]}};Ks.Path=$c;$c.prototype.className="Path";$c.prototype._attrsAffectingSize=["data"];(0,xT._registerNode)($c);ET.Factory.addGetterSetter($c,"data");Object.defineProperty(sp,"__esModule",{value:!0});sp.Arrow=void 0;const cp=ft,PT=Hc,d9=qe,CT=ut,H5=Ks;let ml=class extends PT.Line{_sceneFunc(t){super._sceneFunc(t);var r=Math.PI*2,n=this.points(),i=n,a=this.tension()!==0&&n.length>4;a&&(i=this.getTensionPoints());var o=this.pointerLength(),l=n.length,u,f;if(a){const w=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],n[l-2],n[l-1]],p=H5.Path.calcLength(i[i.length-4],i[i.length-3],"C",w),S=H5.Path.getPointOnQuadraticBezier(Math.min(1,1-o/p),w[0],w[1],w[2],w[3],w[4],w[5]);u=n[l-2]-S.x,f=n[l-1]-S.y}else u=n[l-2]-n[l-4],f=n[l-1]-n[l-3];var h=(Math.atan2(f,u)+r)%r,E=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(n[l-2],n[l-1]),t.rotate(h),t.moveTo(0,0),t.lineTo(-o,E/2),t.lineTo(-o,-E/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(n[0],n[1]),a?(u=(i[0]+i[2])/2-n[0],f=(i[1]+i[3])/2-n[1]):(u=n[2]-n[0],f=n[3]-n[1]),t.rotate((Math.atan2(-f,-u)+r)%r),t.moveTo(0,0),t.lineTo(-o,E/2),t.lineTo(-o,-E/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){var r=this.dashEnabled();r&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),r&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),r=this.pointerWidth()/2;return{x:t.x-r,y:t.y-r,width:t.width+r*2,height:t.height+r*2}}};sp.Arrow=ml;ml.prototype.className="Arrow";(0,CT._registerNode)(ml);cp.Factory.addGetterSetter(ml,"pointerLength",10,(0,d9.getNumberValidator)());cp.Factory.addGetterSetter(ml,"pointerWidth",10,(0,d9.getNumberValidator)());cp.Factory.addGetterSetter(ml,"pointerAtBeginning",!1);cp.Factory.addGetterSetter(ml,"pointerAtEnding",!0);var fp={};Object.defineProperty(fp,"__esModule",{value:!0});fp.Circle=void 0;const kT=ft,TT=gr,AT=qe,RT=ut;let Ys=class extends TT.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}};fp.Circle=Ys;Ys.prototype._centroid=!0;Ys.prototype.className="Circle";Ys.prototype._attrsAffectingSize=["radius"];(0,RT._registerNode)(Ys);kT.Factory.addGetterSetter(Ys,"radius",0,(0,AT.getNumberValidator)());var dp={};Object.defineProperty(dp,"__esModule",{value:!0});dp.Ellipse=void 0;const zy=ft,MT=gr,h9=qe,LT=ut;let wo=class extends MT.Shape{_sceneFunc(t){var r=this.radiusX(),n=this.radiusY();t.beginPath(),t.save(),r!==n&&t.scale(1,n/r),t.arc(0,0,r,0,Math.PI*2,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}};dp.Ellipse=wo;wo.prototype.className="Ellipse";wo.prototype._centroid=!0;wo.prototype._attrsAffectingSize=["radiusX","radiusY"];(0,LT._registerNode)(wo);zy.Factory.addComponentsGetterSetter(wo,"radius",["x","y"]);zy.Factory.addGetterSetter(wo,"radiusX",0,(0,h9.getNumberValidator)());zy.Factory.addGetterSetter(wo,"radiusY",0,(0,h9.getNumberValidator)());var hp={};Object.defineProperty(hp,"__esModule",{value:!0});hp.Image=void 0;const K1=Zt,yl=ft,NT=gr,IT=ut,Gc=qe;let Yi=class p9 extends NT.Shape{constructor(t){super(t),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(t){const r=this.getWidth(),n=this.getHeight(),i=this.cornerRadius(),a=this.attrs.image;let o;if(a){const l=this.attrs.cropWidth,u=this.attrs.cropHeight;l&&u?o=[a,this.cropX(),this.cropY(),l,u,0,0,r,n]:o=[a,0,0,r,n]}(this.hasFill()||this.hasStroke()||i)&&(t.beginPath(),i?K1.Util.drawRoundedRectPath(t,r,n,i):t.rect(0,0,r,n),t.closePath(),t.fillStrokeShape(this)),a&&(i&&t.clip(),t.drawImage.apply(t,o))}_hitFunc(t){var r=this.width(),n=this.height(),i=this.cornerRadius();t.beginPath(),i?K1.Util.drawRoundedRectPath(t,r,n,i):t.rect(0,0,r,n),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,r;return(t=this.attrs.width)!==null&&t!==void 0?t:(r=this.image())===null||r===void 0?void 0:r.width}getHeight(){var t,r;return(t=this.attrs.height)!==null&&t!==void 0?t:(r=this.image())===null||r===void 0?void 0:r.height}static fromURL(t,r,n=null){var i=K1.Util.createImageElement();i.onload=function(){var a=new p9({image:i});r(a)},i.onerror=n,i.crossOrigin="Anonymous",i.src=t}};hp.Image=Yi;Yi.prototype.className="Image";(0,IT._registerNode)(Yi);yl.Factory.addGetterSetter(Yi,"cornerRadius",0,(0,Gc.getNumberOrArrayOfNumbersValidator)(4));yl.Factory.addGetterSetter(Yi,"image");yl.Factory.addComponentsGetterSetter(Yi,"crop",["x","y","width","height"]);yl.Factory.addGetterSetter(Yi,"cropX",0,(0,Gc.getNumberValidator)());yl.Factory.addGetterSetter(Yi,"cropY",0,(0,Gc.getNumberValidator)());yl.Factory.addGetterSetter(Yi,"cropWidth",0,(0,Gc.getNumberValidator)());yl.Factory.addGetterSetter(Yi,"cropHeight",0,(0,Gc.getNumberValidator)());var As={};Object.defineProperty(As,"__esModule",{value:!0});As.Tag=As.Label=void 0;const pp=ft,DT=gr,jT=qs,By=qe,g9=ut;var v9=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],FT="Change.konva",zT="none",um="up",cm="right",fm="down",dm="left",BT=v9.length;let Uy=class extends jT.Group{constructor(t){super(t),this.on("add.konva",function(r){this._addListeners(r.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){var r=this,n,i=function(){r._sync()};for(n=0;n<BT;n++)t.on(v9[n]+FT,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){var t=this.getText(),r=this.getTag(),n,i,a,o,l,u,f;if(t&&r){switch(n=t.width(),i=t.height(),a=r.pointerDirection(),o=r.pointerWidth(),f=r.pointerHeight(),l=0,u=0,a){case um:l=n/2,u=-1*f;break;case cm:l=n+o,u=i/2;break;case fm:l=n/2,u=i+f;break;case dm:l=-1*o,u=i/2;break}r.setAttrs({x:-1*l,y:-1*u,width:n,height:i}),t.setAttrs({x:-1*l,y:-1*u})}}};As.Label=Uy;Uy.prototype.className="Label";(0,g9._registerNode)(Uy);let bl=class extends DT.Shape{_sceneFunc(t){var r=this.width(),n=this.height(),i=this.pointerDirection(),a=this.pointerWidth(),o=this.pointerHeight(),l=this.cornerRadius();let u=0,f=0,h=0,E=0;typeof l=="number"?u=f=h=E=Math.min(l,r/2,n/2):(u=Math.min(l[0]||0,r/2,n/2),f=Math.min(l[1]||0,r/2,n/2),E=Math.min(l[2]||0,r/2,n/2),h=Math.min(l[3]||0,r/2,n/2)),t.beginPath(),t.moveTo(u,0),i===um&&(t.lineTo((r-a)/2,0),t.lineTo(r/2,-1*o),t.lineTo((r+a)/2,0)),t.lineTo(r-f,0),t.arc(r-f,f,f,Math.PI*3/2,0,!1),i===cm&&(t.lineTo(r,(n-o)/2),t.lineTo(r+a,n/2),t.lineTo(r,(n+o)/2)),t.lineTo(r,n-E),t.arc(r-E,n-E,E,0,Math.PI/2,!1),i===fm&&(t.lineTo((r+a)/2,n),t.lineTo(r/2,n+o),t.lineTo((r-a)/2,n)),t.lineTo(h,n),t.arc(h,n-h,h,Math.PI/2,Math.PI,!1),i===dm&&(t.lineTo(0,(n+o)/2),t.lineTo(-1*a,n/2),t.lineTo(0,(n-o)/2)),t.lineTo(0,u),t.arc(u,u,u,Math.PI,Math.PI*3/2,!1),t.closePath(),t.fillStrokeShape(this)}getSelfRect(){var t=0,r=0,n=this.pointerWidth(),i=this.pointerHeight(),a=this.pointerDirection(),o=this.width(),l=this.height();return a===um?(r-=i,l+=i):a===fm?l+=i:a===dm?(t-=n*1.5,o+=n):a===cm&&(o+=n*1.5),{x:t,y:r,width:o,height:l}}};As.Tag=bl;bl.prototype.className="Tag";(0,g9._registerNode)(bl);pp.Factory.addGetterSetter(bl,"pointerDirection",zT);pp.Factory.addGetterSetter(bl,"pointerWidth",0,(0,By.getNumberValidator)());pp.Factory.addGetterSetter(bl,"pointerHeight",0,(0,By.getNumberValidator)());pp.Factory.addGetterSetter(bl,"cornerRadius",0,(0,By.getNumberOrArrayOfNumbersValidator)(4));var Vc={};Object.defineProperty(Vc,"__esModule",{value:!0});Vc.Rect=void 0;const UT=ft,HT=gr,$T=ut,GT=Zt,VT=qe;let gp=class extends HT.Shape{_sceneFunc(t){var r=this.cornerRadius(),n=this.width(),i=this.height();t.beginPath(),r?GT.Util.drawRoundedRectPath(t,n,i,r):t.rect(0,0,n,i),t.closePath(),t.fillStrokeShape(this)}};Vc.Rect=gp;gp.prototype.className="Rect";(0,$T._registerNode)(gp);UT.Factory.addGetterSetter(gp,"cornerRadius",0,(0,VT.getNumberOrArrayOfNumbersValidator)(4));var vp={};Object.defineProperty(vp,"__esModule",{value:!0});vp.RegularPolygon=void 0;const m9=ft,qT=gr,y9=qe,WT=ut;let _l=class extends qT.Shape{_sceneFunc(t){const r=this._getPoints();t.beginPath(),t.moveTo(r[0].x,r[0].y);for(var n=1;n<r.length;n++)t.lineTo(r[n].x,r[n].y);t.closePath(),t.fillStrokeShape(this)}_getPoints(){const t=this.attrs.sides,r=this.attrs.radius||0,n=[];for(var i=0;i<t;i++)n.push({x:r*Math.sin(i*2*Math.PI/t),y:-1*r*Math.cos(i*2*Math.PI/t)});return n}getSelfRect(){const t=this._getPoints();var r=t[0].x,n=t[0].y,i=t[0].x,a=t[0].y;return t.forEach(o=>{r=Math.min(r,o.x),n=Math.max(n,o.x),i=Math.min(i,o.y),a=Math.max(a,o.y)}),{x:r,y:i,width:n-r,height:a-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}};vp.RegularPolygon=_l;_l.prototype.className="RegularPolygon";_l.prototype._centroid=!0;_l.prototype._attrsAffectingSize=["radius"];(0,WT._registerNode)(_l);m9.Factory.addGetterSetter(_l,"radius",0,(0,y9.getNumberValidator)());m9.Factory.addGetterSetter(_l,"sides",0,(0,y9.getNumberValidator)());var mp={};Object.defineProperty(mp,"__esModule",{value:!0});mp.Ring=void 0;const b9=ft,KT=gr,_9=qe,YT=ut;var $5=Math.PI*2;let wl=class extends KT.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,$5,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),$5,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}};mp.Ring=wl;wl.prototype.className="Ring";wl.prototype._centroid=!0;wl.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,YT._registerNode)(wl);b9.Factory.addGetterSetter(wl,"innerRadius",0,(0,_9.getNumberValidator)());b9.Factory.addGetterSetter(wl,"outerRadius",0,(0,_9.getNumberValidator)());var yp={};Object.defineProperty(yp,"__esModule",{value:!0});yp.Sprite=void 0;const Sl=ft,XT=gr,ZT=Ws,w9=qe,QT=ut;let Xi=class extends XT.Shape{constructor(t){super(t),this._updated=!0,this.anim=new ZT.Animation(()=>{var r=this._updated;return this._updated=!1,r}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){var r=this.animation(),n=this.frameIndex(),i=n*4,a=this.animations()[r],o=this.frameOffsets(),l=a[i+0],u=a[i+1],f=a[i+2],h=a[i+3],E=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,f,h),t.closePath(),t.fillStrokeShape(this)),E)if(o){var w=o[r],p=n*2;t.drawImage(E,l,u,f,h,w[p+0],w[p+1],f,h)}else t.drawImage(E,l,u,f,h,0,0,f,h)}_hitFunc(t){var r=this.animation(),n=this.frameIndex(),i=n*4,a=this.animations()[r],o=this.frameOffsets(),l=a[i+2],u=a[i+3];if(t.beginPath(),o){var f=o[r],h=n*2;t.rect(f[h+0],f[h+1],l,u)}else t.rect(0,0,l,u);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var t=this.frameIndex(),r=this.animation(),n=this.animations(),i=n[r],a=i.length/4;t<a-1?this.frameIndex(t+1):this.frameIndex(0)}};yp.Sprite=Xi;Xi.prototype.className="Sprite";(0,QT._registerNode)(Xi);Sl.Factory.addGetterSetter(Xi,"animation");Sl.Factory.addGetterSetter(Xi,"animations");Sl.Factory.addGetterSetter(Xi,"frameOffsets");Sl.Factory.addGetterSetter(Xi,"image");Sl.Factory.addGetterSetter(Xi,"frameIndex",0,(0,w9.getNumberValidator)());Sl.Factory.addGetterSetter(Xi,"frameRate",17,(0,w9.getNumberValidator)());Sl.Factory.backCompat(Xi,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var bp={};Object.defineProperty(bp,"__esModule",{value:!0});bp.Star=void 0;const Hy=ft,JT=gr,$y=qe,eA=ut;let So=class extends JT.Shape{_sceneFunc(t){var r=this.innerRadius(),n=this.outerRadius(),i=this.numPoints();t.beginPath(),t.moveTo(0,0-n);for(var a=1;a<i*2;a++){var o=a%2===0?n:r,l=o*Math.sin(a*Math.PI/i),u=-1*o*Math.cos(a*Math.PI/i);t.lineTo(l,u)}t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}};bp.Star=So;So.prototype.className="Star";So.prototype._centroid=!0;So.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,eA._registerNode)(So);Hy.Factory.addGetterSetter(So,"numPoints",5,(0,$y.getNumberValidator)());Hy.Factory.addGetterSetter(So,"innerRadius",0,(0,$y.getNumberValidator)());Hy.Factory.addGetterSetter(So,"outerRadius",0,(0,$y.getNumberValidator)());var ul={};Object.defineProperty(ul,"__esModule",{value:!0});ul.Text=ul.stringToArray=void 0;const hm=Zt,Hr=ft,tA=gr,Y1=ut,Eo=qe,rA=ut;function S9(e){return Array.from(e)}ul.stringToArray=S9;var Wl="auto",nA="center",E9="inherit",Ru="justify",iA="Change.konva",aA="2d",G5="-",O9="left",oA="text",lA="Text",sA="top",uA="bottom",V5="middle",x9="normal",cA="px ",gd=" ",fA="right",q5="rtl",dA="word",hA="char",W5="none",X1="…",P9=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],pA=P9.length;function gA(e){return e.split(",").map(t=>{t=t.trim();const r=t.indexOf(" ")>=0,n=t.indexOf('"')>=0||t.indexOf("'")>=0;return r&&!n&&(t=`"${t}"`),t}).join(", ")}var vd;function Z1(){return vd||(vd=hm.Util.createCanvasElement().getContext(aA),vd)}function vA(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function mA(e){e.setAttr("miterLimit",2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function yA(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}let er=class extends tA.Shape{constructor(t){super(yA(t)),this._partialTextX=0,this._partialTextY=0;for(var r=0;r<pA;r++)this.on(P9[r]+iA,this._setTextData);this._setTextData()}_sceneFunc(t){var r=this.textArr,n=r.length;if(this.text()){var i=this.padding(),a=this.fontSize(),o=this.lineHeight()*a,l=this.verticalAlign(),u=this.direction(),f=0,h=this.align(),E=this.getWidth(),w=this.letterSpacing(),p=this.fill(),S=this.textDecoration(),b=S.indexOf("underline")!==-1,y=S.indexOf("line-through")!==-1,v;u=u===E9?t.direction:u;var m=o/2,d=V5;if(Y1.Konva._fixTextRendering){var g=this.measureSize("M");d="alphabetic",m=(g.fontBoundingBoxAscent-g.fontBoundingBoxDescent)/2+o/2}var _=0,k=0;for(u===q5&&t.setAttr("direction",u),t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",d),t.setAttr("textAlign",O9),l===V5?f=(this.getHeight()-n*o-i*2)/2:l===uA&&(f=this.getHeight()-n*o-i*2),t.translate(i,f+i),v=0;v<n;v++){var _=0,k=0,C=r[v],P=C.text,O=C.width,x=C.lastInParagraph,A,L,I;if(t.save(),h===fA?_+=E-O-i*2:h===nA&&(_+=(E-O-i*2)/2),b){t.save(),t.beginPath();let W=Y1.Konva._fixTextRendering?Math.round(a/4):Math.round(a/2);const R=_,M=m+k+W;t.moveTo(R,M),A=P.split(" ").length-1,L=A===0,I=h===Ru&&!x?E-i*2:O,t.lineTo(R+Math.round(I),M),t.lineWidth=a/15;const F=this._getLinearGradient();t.strokeStyle=F||p,t.stroke(),t.restore()}if(y){t.save(),t.beginPath();let W=Y1.Konva._fixTextRendering?-Math.round(a/4):0;t.moveTo(_,m+k+W),A=P.split(" ").length-1,L=A===0,I=h===Ru&&x&&!L?E-i*2:O,t.lineTo(_+Math.round(I),m+k+W),t.lineWidth=a/15;const R=this._getLinearGradient();t.strokeStyle=R||p,t.stroke(),t.restore()}if(u!==q5&&(w!==0||h===Ru)){A=P.split(" ").length-1;for(var U=S9(P),$=0;$<U.length;$++){var Z=U[$];Z===" "&&!x&&h===Ru&&(_+=(E-i*2-O)/A),this._partialTextX=_,this._partialTextY=m+k,this._partialText=Z,t.fillStrokeShape(this),_+=this.measureSize(Z).width+w}}else w!==0&&t.setAttr("letterSpacing",`${w}px`),this._partialTextX=_,this._partialTextY=m+k,this._partialText=P,t.fillStrokeShape(this);t.restore(),n>1&&(m+=o)}}}_hitFunc(t){var r=this.getWidth(),n=this.getHeight();t.beginPath(),t.rect(0,0,r,n),t.closePath(),t.fillStrokeShape(this)}setText(t){var r=hm.Util._isString(t)?t:t==null?"":t+"";return this._setAttr(oA,r),this}getWidth(){var t=this.attrs.width===Wl||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===Wl||this.attrs.height===void 0;return t?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(t){var r,n,i,a,o,l,u,f,h,E,w,p=Z1(),S=this.fontSize(),b;p.save(),p.font=this._getContextFont(),b=p.measureText(t),p.restore();const y=S/100;return{actualBoundingBoxAscent:(r=b.actualBoundingBoxAscent)!==null&&r!==void 0?r:71.58203125*y,actualBoundingBoxDescent:(n=b.actualBoundingBoxDescent)!==null&&n!==void 0?n:0,actualBoundingBoxLeft:(i=b.actualBoundingBoxLeft)!==null&&i!==void 0?i:-7.421875*y,actualBoundingBoxRight:(a=b.actualBoundingBoxRight)!==null&&a!==void 0?a:75.732421875*y,alphabeticBaseline:(o=b.alphabeticBaseline)!==null&&o!==void 0?o:0,emHeightAscent:(l=b.emHeightAscent)!==null&&l!==void 0?l:100*y,emHeightDescent:(u=b.emHeightDescent)!==null&&u!==void 0?u:-20*y,fontBoundingBoxAscent:(f=b.fontBoundingBoxAscent)!==null&&f!==void 0?f:91*y,fontBoundingBoxDescent:(h=b.fontBoundingBoxDescent)!==null&&h!==void 0?h:21*y,hangingBaseline:(E=b.hangingBaseline)!==null&&E!==void 0?E:72.80000305175781*y,ideographicBaseline:(w=b.ideographicBaseline)!==null&&w!==void 0?w:-21*y,width:b.width,height:S}}_getContextFont(){return this.fontStyle()+gd+this.fontVariant()+gd+(this.fontSize()+cA)+gA(this.fontFamily())}_addTextLine(t){this.align()===Ru&&(t=t.trim());var n=this._getTextWidth(t);return this.textArr.push({text:t,width:n,lastInParagraph:!1})}_getTextWidth(t){var r=this.letterSpacing(),n=t.length;return Z1().measureText(t).width+(n?r*(n-1):0)}_setTextData(){var t=this.text().split(`
43
+ `),r=+this.fontSize(),n=0,i=this.lineHeight()*r,a=this.attrs.width,o=this.attrs.height,l=a!==Wl&&a!==void 0,u=o!==Wl&&o!==void 0,f=this.padding(),h=a-f*2,E=o-f*2,w=0,p=this.wrap(),S=p!==W5,b=p!==hA&&S,y=this.ellipsis();this.textArr=[],Z1().font=this._getContextFont();for(var v=y?this._getTextWidth(X1):0,m=0,d=t.length;m<d;++m){var g=t[m],_=this._getTextWidth(g);if(l&&_>h)for(;g.length>0;){for(var k=0,C=g.length,P="",O=0;k<C;){var x=k+C>>>1,A=g.slice(0,x+1),L=this._getTextWidth(A)+v;L<=h?(k=x+1,P=A,O=L):C=x}if(P){if(b){var I,U=g[P.length],$=U===gd||U===G5;$&&O<=h?I=P.length:I=Math.max(P.lastIndexOf(gd),P.lastIndexOf(G5))+1,I>0&&(k=I,P=P.slice(0,k),O=this._getTextWidth(P))}P=P.trimRight(),this._addTextLine(P),n=Math.max(n,O),w+=i;var Z=this._shouldHandleEllipsis(w);if(Z){this._tryToAddEllipsisToLastLine();break}if(g=g.slice(k),g=g.trimLeft(),g.length>0&&(_=this._getTextWidth(g),_<=h)){this._addTextLine(g),w+=i,n=Math.max(n,_);break}}else break}else this._addTextLine(g),w+=i,n=Math.max(n,_),this._shouldHandleEllipsis(w)&&m<d-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),u&&w+i>E)break}this.textHeight=r,this.textWidth=n}_shouldHandleEllipsis(t){var r=+this.fontSize(),n=this.lineHeight()*r,i=this.attrs.height,a=i!==Wl&&i!==void 0,o=this.padding(),l=i-o*2,u=this.wrap(),f=u!==W5;return!f||a&&t+n>l}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,r=t!==Wl&&t!==void 0,n=this.padding(),i=t-n*2,a=this.ellipsis(),o=this.textArr[this.textArr.length-1];if(!(!o||!a)){if(r){var l=this._getTextWidth(o.text+X1)<i;l||(o.text=o.text.slice(0,o.text.length-3))}this.textArr.splice(this.textArr.length-1,1),this._addTextLine(o.text+X1)}}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const t=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,r=this.hasShadow();return t&&r?!0:super._useBufferCanvas()}};ul.Text=er;er.prototype._fillFunc=vA;er.prototype._strokeFunc=mA;er.prototype.className=lA;er.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];(0,rA._registerNode)(er);Hr.Factory.overWriteSetter(er,"width",(0,Eo.getNumberOrAutoValidator)());Hr.Factory.overWriteSetter(er,"height",(0,Eo.getNumberOrAutoValidator)());Hr.Factory.addGetterSetter(er,"direction",E9);Hr.Factory.addGetterSetter(er,"fontFamily","Arial");Hr.Factory.addGetterSetter(er,"fontSize",12,(0,Eo.getNumberValidator)());Hr.Factory.addGetterSetter(er,"fontStyle",x9);Hr.Factory.addGetterSetter(er,"fontVariant",x9);Hr.Factory.addGetterSetter(er,"padding",0,(0,Eo.getNumberValidator)());Hr.Factory.addGetterSetter(er,"align",O9);Hr.Factory.addGetterSetter(er,"verticalAlign",sA);Hr.Factory.addGetterSetter(er,"lineHeight",1,(0,Eo.getNumberValidator)());Hr.Factory.addGetterSetter(er,"wrap",dA);Hr.Factory.addGetterSetter(er,"ellipsis",!1,(0,Eo.getBooleanValidator)());Hr.Factory.addGetterSetter(er,"letterSpacing",0,(0,Eo.getNumberValidator)());Hr.Factory.addGetterSetter(er,"text","",(0,Eo.getStringValidator)());Hr.Factory.addGetterSetter(er,"textDecoration","");var _p={};Object.defineProperty(_p,"__esModule",{value:!0});_p.TextPath=void 0;const Q1=Zt,wi=ft,bA=gr,Mu=Ks,J1=ul,C9=qe,_A=ut;var wA="",k9="normal";function T9(e){e.fillText(this.partialText,0,0)}function A9(e){e.strokeText(this.partialText,0,0)}let vr=class extends bA.Shape{constructor(t){super(t),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 Mu.Path.getPathLength(this.dataArray)}_getPointAtLength(t){if(!this.attrs.data)return null;const r=this.pathLength;return t-1>r?null:Mu.Path.getPointAtLengthOfDataArray(t,this.dataArray)}_readDataAttribute(){this.dataArray=Mu.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(t){t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",this.textBaseline()),t.setAttr("textAlign","left"),t.save();var r=this.textDecoration(),n=this.fill(),i=this.fontSize(),a=this.glyphInfo;r==="underline"&&t.beginPath();for(var o=0;o<a.length;o++){t.save();var l=a[o].p0;t.translate(l.x,l.y),t.rotate(a[o].rotation),this.partialText=a[o].text,t.fillStrokeShape(this),r==="underline"&&(o===0&&t.moveTo(0,i/2+1),t.lineTo(i,i/2+1)),t.restore()}r==="underline"&&(t.strokeStyle=n,t.lineWidth=i/20,t.stroke()),t.restore()}_hitFunc(t){t.beginPath();var r=this.glyphInfo;if(r.length>=1){var n=r[0].p0;t.moveTo(n.x,n.y)}for(var i=0;i<r.length;i++){var a=r[i].p1;t.lineTo(a.x,a.y)}t.setAttr("lineWidth",this.fontSize()),t.setAttr("strokeStyle",this.colorKey),t.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(t){return J1.Text.prototype.setText.call(this,t)}_getContextFont(){return J1.Text.prototype._getContextFont.call(this)}_getTextSize(t){var r=this.dummyCanvas,n=r.getContext("2d");n.save(),n.font=this._getContextFont();var i=n.measureText(t);return n.restore(),{width:i.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:t,height:r}=this._getTextSize(this.attrs.text);if(this.textWidth=t,this.textHeight=r,this.glyphInfo=[],!this.attrs.data)return null;const n=this.letterSpacing(),i=this.align(),a=this.kerningFunc(),o=Math.max(this.textWidth+((this.attrs.text||"").length-1)*n,0);let l=0;i==="center"&&(l=Math.max(0,this.pathLength/2-o/2)),i==="right"&&(l=Math.max(0,this.pathLength-o));const u=(0,J1.stringToArray)(this.text());let f=l;for(var h=0;h<u.length;h++){const E=this._getPointAtLength(f);if(!E)return;let w=this._getTextSize(u[h]).width+n;if(u[h]===" "&&i==="justify"){const m=this.text().split(" ").length-1;w+=(this.pathLength-o)/m}const p=this._getPointAtLength(f+w);if(!p)return;const S=Mu.Path.getLineLength(E.x,E.y,p.x,p.y);let b=0;if(a)try{b=a(u[h-1],u[h])*this.fontSize()}catch{b=0}E.x+=b,p.x+=b,this.textWidth+=b;const y=Mu.Path.getPointOnLine(b+S/2,E.x,E.y,p.x,p.y),v=Math.atan2(p.y-E.y,p.x-E.x);this.glyphInfo.push({transposeX:y.x,transposeY:y.y,text:u[h],rotation:v,p0:E,p1:p}),f+=w}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};var t=[];this.glyphInfo.forEach(function(h){t.push(h.p0.x),t.push(h.p0.y),t.push(h.p1.x),t.push(h.p1.y)});for(var r=t[0]||0,n=t[0]||0,i=t[1]||0,a=t[1]||0,o,l,u=0;u<t.length/2;u++)o=t[u*2],l=t[u*2+1],r=Math.min(r,o),n=Math.max(n,o),i=Math.min(i,l),a=Math.max(a,l);var f=this.fontSize();return{x:r-f/2,y:i-f/2,width:n-r+f,height:a-i+f}}destroy(){return Q1.Util.releaseCanvas(this.dummyCanvas),super.destroy()}};_p.TextPath=vr;vr.prototype._fillFunc=T9;vr.prototype._strokeFunc=A9;vr.prototype._fillFuncHit=T9;vr.prototype._strokeFuncHit=A9;vr.prototype.className="TextPath";vr.prototype._attrsAffectingSize=["text","fontSize","data"];(0,_A._registerNode)(vr);wi.Factory.addGetterSetter(vr,"data");wi.Factory.addGetterSetter(vr,"fontFamily","Arial");wi.Factory.addGetterSetter(vr,"fontSize",12,(0,C9.getNumberValidator)());wi.Factory.addGetterSetter(vr,"fontStyle",k9);wi.Factory.addGetterSetter(vr,"align","left");wi.Factory.addGetterSetter(vr,"letterSpacing",0,(0,C9.getNumberValidator)());wi.Factory.addGetterSetter(vr,"textBaseline","middle");wi.Factory.addGetterSetter(vr,"fontVariant",k9);wi.Factory.addGetterSetter(vr,"text",wA);wi.Factory.addGetterSetter(vr,"textDecoration",null);wi.Factory.addGetterSetter(vr,"kerningFunc",null);var wp={};Object.defineProperty(wp,"__esModule",{value:!0});wp.Transformer=void 0;const kt=Zt,Ot=ft,K5=Vt,SA=gr,EA=Vc,Y5=qs,oi=ut,Oo=qe,OA=ut;var R9="tr-konva",xA=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(e=>e+`.${R9}`).join(" "),X5="nodesRect",PA=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],CA={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const kA="ontouchstart"in oi.Konva._global;function TA(e,t,r){if(e==="rotater")return r;t+=kt.Util.degToRad(CA[e]||0);var n=(kt.Util.radToDeg(t)%360+360)%360;return kt.Util._inRange(n,315+22.5,360)||kt.Util._inRange(n,0,22.5)?"ns-resize":kt.Util._inRange(n,45-22.5,45+22.5)?"nesw-resize":kt.Util._inRange(n,90-22.5,90+22.5)?"ew-resize":kt.Util._inRange(n,135-22.5,135+22.5)?"nwse-resize":kt.Util._inRange(n,180-22.5,180+22.5)?"ns-resize":kt.Util._inRange(n,225-22.5,225+22.5)?"nesw-resize":kt.Util._inRange(n,270-22.5,270+22.5)?"ew-resize":kt.Util._inRange(n,315-22.5,315+22.5)?"nwse-resize":(kt.Util.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var yh=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],Z5=1e8;function AA(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function M9(e,t,r){const n=r.x+(e.x-r.x)*Math.cos(t)-(e.y-r.y)*Math.sin(t),i=r.y+(e.x-r.x)*Math.sin(t)+(e.y-r.y)*Math.cos(t);return{...e,rotation:e.rotation+t,x:n,y:i}}function RA(e,t){const r=AA(e);return M9(e,t,r)}function MA(e,t,r){let n=t;for(let i=0;i<e.length;i++){const a=oi.Konva.getAngle(e[i]),o=Math.abs(a-t)%(Math.PI*2);Math.min(o,Math.PI*2-o)<r&&(n=a)}return n}let pm=0,vt=class extends Y5.Group{constructor(t){super(t),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(xA,this.update),this.getNode()&&this.update()}attachTo(t){return this.setNode(t),this}setNode(t){return kt.Util.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([t])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return R9+this._id}setNodes(t=[]){this._nodes&&this._nodes.length&&this.detach();const r=t.filter(i=>i.isAncestorOf(this)?(kt.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);this._nodes=t=r,t.length===1&&this.useSingleNodeRotation()?this.rotation(t[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(i=>{const a=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},o=i._attrsAffectingSize.map(l=>l+"Change."+this._getEventNamespace()).join(" ");i.on(o,a),i.on(PA.map(l=>l+`.${this._getEventNamespace()}`).join(" "),a),i.on(`absoluteTransformChange.${this._getEventNamespace()}`,a),this._proxyDrag(i)}),this._resetTransformCache();var n=!!this.findOne(".top-left");return n&&this.update(),this}_proxyDrag(t){let r;t.on(`dragstart.${this._getEventNamespace()}`,n=>{r=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(n,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,n=>{if(!r)return;const i=t.getAbsolutePosition(),a=i.x-r.x,o=i.y-r.y;this.nodes().forEach(l=>{if(l===t||l.isDragging())return;const u=l.getAbsolutePosition();l.setAbsolutePosition({x:u.x+a,y:u.y+o}),l.startDrag(n)}),r=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(X5),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(X5,this.__getNodeRect)}__getNodeShape(t,r=this.rotation(),n){var i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),a=t.getAbsoluteScale(n),o=t.getAbsolutePosition(n),l=i.x*a.x-t.offsetX()*a.x,u=i.y*a.y-t.offsetY()*a.y;const f=(oi.Konva.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),h={x:o.x+l*Math.cos(f)+u*Math.sin(-f),y:o.y+u*Math.cos(f)+l*Math.sin(f),width:i.width*a.x,height:i.height*a.y,rotation:f};return M9(h,-oi.Konva.getAngle(r),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-Z5,y:-Z5,width:0,height:0,rotation:0};const r=[];this.nodes().map(f=>{const h=f.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var E=[{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();E.forEach(function(p){var S=w.point(p);r.push(S)})});const n=new kt.Transform;n.rotate(-oi.Konva.getAngle(this.rotation()));var i=1/0,a=1/0,o=-1/0,l=-1/0;r.forEach(function(f){var h=n.point(f);i===void 0&&(i=o=h.x,a=l=h.y),i=Math.min(i,h.x),a=Math.min(a,h.y),o=Math.max(o,h.x),l=Math.max(l,h.y)}),n.invert();const u=n.point({x:i,y:a});return{x:u.x,y:u.y,width:o-i,height:l-a,rotation:oi.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(),yh.forEach(t=>{this._createAnchor(t)}),this._createAnchor("rotater")}_createAnchor(t){var r=new EA.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:kA?10:"auto"}),n=this;r.on("mousedown touchstart",function(i){n._handleMouseDown(i)}),r.on("dragstart",i=>{r.stopDrag(),i.cancelBubble=!0}),r.on("dragend",i=>{i.cancelBubble=!0}),r.on("mouseenter",()=>{var i=oi.Konva.getAngle(this.rotation()),a=this.rotateAnchorCursor(),o=TA(t,i,a);r.getStage().content&&(r.getStage().content.style.cursor=o),this._cursorChange=!0}),r.on("mouseout",()=>{r.getStage().content&&(r.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(r)}_createBack(){var t=new SA.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(r,n){var i=n.getParent(),a=i.padding();r.beginPath(),r.rect(-a,-a,n.width()+a*2,n.height()+a*2),r.moveTo(n.width()/2,-a),i.rotateEnabled()&&i.rotateLineVisible()&&r.lineTo(n.width()/2,-i.rotateAnchorOffset()*kt.Util._sign(n.height())-a),r.fillStrokeShape(n)},hitFunc:(r,n)=>{if(this.shouldOverdrawWholeArea()){var i=this.padding();r.beginPath(),r.rect(-i,-i,n.width()+i*2,n.height()+i*2),r.fillStrokeShape(n)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",r=>{r.cancelBubble=!0}),t.on("dragmove",r=>{r.cancelBubble=!0}),t.on("dragend",r=>{r.cancelBubble=!0}),this.on("dragmove",r=>{this.update()})}_handleMouseDown(t){if(!this._transforming){this._movingAnchorName=t.target.name().split(" ")[0];var r=this._getNodeRect(),n=r.width,i=r.height,a=Math.sqrt(Math.pow(n,2)+Math.pow(i,2));this.sin=Math.abs(i/a),this.cos=Math.abs(n/a),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var o=t.target.getAbsolutePosition(),l=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:l.x-o.x,y:l.y-o.y},pm++,this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(u=>{u._fire("transformstart",{evt:t.evt,target:u})})}}_handleMouseMove(t){var r,n,i,a=this.findOne("."+this._movingAnchorName),o=a.getStage();o.setPointersPositions(t);const l=o.getPointerPosition();let u={x:l.x-this._anchorDragOffset.x,y:l.y-this._anchorDragOffset.y};const f=a.getAbsolutePosition();this.anchorDragBoundFunc()&&(u=this.anchorDragBoundFunc()(f,u,t)),a.setAbsolutePosition(u);const h=a.getAbsolutePosition();if(!(f.x===h.x&&f.y===h.y)){if(this._movingAnchorName==="rotater"){var E=this._getNodeRect();r=a.x()-E.width/2,n=-a.y()+E.height/2;let I=Math.atan2(-n,r)+Math.PI/2;E.height<0&&(I-=Math.PI);var w=oi.Konva.getAngle(this.rotation());const U=w+I,$=oi.Konva.getAngle(this.rotationSnapTolerance()),q=MA(this.rotationSnaps(),U,$)-E.rotation,z=RA(E,q);this._fitNodesInto(z,t);return}var p=this.shiftBehavior(),S;p==="inverted"?S=this.keepRatio()&&!t.shiftKey:p==="none"?S=this.keepRatio():S=this.keepRatio()||t.shiftKey;var d=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(S){var b=d?{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(b.x-a.x(),2)+Math.pow(b.y-a.y(),2));var y=this.findOne(".top-left").x()>b.x?-1:1,v=this.findOne(".top-left").y()>b.y?-1:1;r=i*this.cos*y,n=i*this.sin*v,this.findOne(".top-left").x(b.x-r),this.findOne(".top-left").y(b.y-n)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(a.y());else if(this._movingAnchorName==="top-right"){if(S){var b=d?{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(a.x()-b.x,2)+Math.pow(b.y-a.y(),2));var y=this.findOne(".top-right").x()<b.x?-1:1,v=this.findOne(".top-right").y()>b.y?-1:1;r=i*this.cos*y,n=i*this.sin*v,this.findOne(".top-right").x(b.x+r),this.findOne(".top-right").y(b.y-n)}var m=a.position();this.findOne(".top-left").y(m.y),this.findOne(".bottom-right").x(m.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(a.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(a.x());else if(this._movingAnchorName==="bottom-left"){if(S){var b=d?{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(b.x-a.x(),2)+Math.pow(a.y()-b.y,2));var y=b.x<a.x()?-1:1,v=a.y()<b.y?-1:1;r=i*this.cos*y,n=i*this.sin*v,a.x(b.x-r),a.y(b.y+n)}m=a.position(),this.findOne(".top-left").x(m.x),this.findOne(".bottom-right").y(m.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(a.y());else if(this._movingAnchorName==="bottom-right"){if(S){var b=d?{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(a.x()-b.x,2)+Math.pow(a.y()-b.y,2));var y=this.findOne(".bottom-right").x()<b.x?-1:1,v=this.findOne(".bottom-right").y()<b.y?-1:1;r=i*this.cos*y,n=i*this.sin*v,this.findOne(".bottom-right").x(b.x+r),this.findOne(".bottom-right").y(b.y+n)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var d=this.centeredScaling()||t.altKey;if(d){var g=this.findOne(".top-left"),_=this.findOne(".bottom-right"),k=g.x(),C=g.y(),P=this.getWidth()-_.x(),O=this.getHeight()-_.y();_.move({x:-k,y:-C}),g.move({x:P,y:O})}var x=this.findOne(".top-left").getAbsolutePosition();r=x.x,n=x.y;var A=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),L=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:r,y:n,width:A,height:L,rotation:oi.Konva.getAngle(this.rotation())},t)}}_handleMouseUp(t){this._removeEvents(t)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(t){var r;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));var n=this.getNode();pm--,this._fire("transformend",{evt:t,target:n}),(r=this.getLayer())===null||r===void 0||r.batchDraw(),n&&this._nodes.forEach(i=>{var a;i._fire("transformend",{evt:t,target:i}),(a=i.getLayer())===null||a===void 0||a.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(t,r){var n=this._getNodeRect();const i=1;if(kt.Util._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(kt.Util._inRange(t.height,-this.padding()*2-i,i)){this.update();return}var a=new kt.Transform;if(a.rotate(oi.Konva.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const w=a.point({x:-this.padding()*2,y:0});t.x+=w.x,t.y+=w.y,t.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&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const w=a.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=w.x,this._anchorDragOffset.y-=w.y,t.width+=this.padding()*2}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const w=a.point({x:0,y:-this.padding()*2});t.x+=w.x,t.y+=w.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=w.x,this._anchorDragOffset.y-=w.y,t.height+=this.padding()*2}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const w=a.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=w.x,this._anchorDragOffset.y-=w.y,t.height+=this.padding()*2}if(this.boundBoxFunc()){const w=this.boundBoxFunc()(n,t);w?t=w:kt.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const o=1e7,l=new kt.Transform;l.translate(n.x,n.y),l.rotate(n.rotation),l.scale(n.width/o,n.height/o);const u=new kt.Transform,f=t.width/o,h=t.height/o;this.flipEnabled()===!1?(u.translate(t.x,t.y),u.rotate(t.rotation),u.translate(t.width<0?t.width:0,t.height<0?t.height:0),u.scale(Math.abs(f),Math.abs(h))):(u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(f,h));const E=u.multiply(l.invert());this._nodes.forEach(w=>{var p;const S=w.getParent().getAbsoluteTransform(),b=w.getTransform().copy();b.translate(w.offsetX(),w.offsetY());const y=new kt.Transform;y.multiply(S.copy().invert()).multiply(E).multiply(S).multiply(b);const v=y.decompose();w.setAttrs(v),(p=w.getLayer())===null||p===void 0||p.batchDraw()}),this.rotation(kt.Util._getRotation(t.rotation)),this._nodes.forEach(w=>{this._fire("transform",{evt:r,target:w}),w._fire("transform",{evt:r,target:w})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,r){this.findOne(t).setAttrs(r)}update(){var t,r=this._getNodeRect();this.rotation(kt.Util._getRotation(r.rotation));var n=r.width,i=r.height,a=this.enabledAnchors(),o=this.resizeEnabled(),l=this.padding(),u=this.anchorSize();const f=this.find("._anchor");f.forEach(E=>{E.setAttrs({width:u,height:u,offsetX:u/2,offsetY:u/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:u/2+l,offsetY:u/2+l,visible:o&&a.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:n/2,y:0,offsetY:u/2+l,visible:o&&a.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:n,y:0,offsetX:u/2-l,offsetY:u/2+l,visible:o&&a.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:u/2+l,visible:o&&a.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:n,y:i/2,offsetX:u/2-l,visible:o&&a.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:u/2+l,offsetY:u/2-l,visible:o&&a.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:n/2,y:i,offsetY:u/2-l,visible:o&&a.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:n,y:i,offsetX:u/2-l,offsetY:u/2-l,visible:o&&a.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:n/2,y:-this.rotateAnchorOffset()*kt.Util._sign(i)-l,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:n,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(E=>{h(E)}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),Y5.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return K5.Node.prototype.toObject.call(this)}clone(t){var r=K5.Node.prototype.clone.call(this,t);return r}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};wp.Transformer=vt;vt.isTransforming=()=>pm>0;function LA(e){return e instanceof Array||kt.Util.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){yh.indexOf(t)===-1&&kt.Util.warn("Unknown anchor name: "+t+". Available names are: "+yh.join(", "))}),e||[]}vt.prototype.className="Transformer";(0,OA._registerNode)(vt);Ot.Factory.addGetterSetter(vt,"enabledAnchors",yh,LA);Ot.Factory.addGetterSetter(vt,"flipEnabled",!0,(0,Oo.getBooleanValidator)());Ot.Factory.addGetterSetter(vt,"resizeEnabled",!0);Ot.Factory.addGetterSetter(vt,"anchorSize",10,(0,Oo.getNumberValidator)());Ot.Factory.addGetterSetter(vt,"rotateEnabled",!0);Ot.Factory.addGetterSetter(vt,"rotateLineVisible",!0);Ot.Factory.addGetterSetter(vt,"rotationSnaps",[]);Ot.Factory.addGetterSetter(vt,"rotateAnchorOffset",50,(0,Oo.getNumberValidator)());Ot.Factory.addGetterSetter(vt,"rotateAnchorCursor","crosshair");Ot.Factory.addGetterSetter(vt,"rotationSnapTolerance",5,(0,Oo.getNumberValidator)());Ot.Factory.addGetterSetter(vt,"borderEnabled",!0);Ot.Factory.addGetterSetter(vt,"anchorStroke","rgb(0, 161, 255)");Ot.Factory.addGetterSetter(vt,"anchorStrokeWidth",1,(0,Oo.getNumberValidator)());Ot.Factory.addGetterSetter(vt,"anchorFill","white");Ot.Factory.addGetterSetter(vt,"anchorCornerRadius",0,(0,Oo.getNumberValidator)());Ot.Factory.addGetterSetter(vt,"borderStroke","rgb(0, 161, 255)");Ot.Factory.addGetterSetter(vt,"borderStrokeWidth",1,(0,Oo.getNumberValidator)());Ot.Factory.addGetterSetter(vt,"borderDash");Ot.Factory.addGetterSetter(vt,"keepRatio",!0);Ot.Factory.addGetterSetter(vt,"shiftBehavior","default");Ot.Factory.addGetterSetter(vt,"centeredScaling",!1);Ot.Factory.addGetterSetter(vt,"ignoreStroke",!1);Ot.Factory.addGetterSetter(vt,"padding",0,(0,Oo.getNumberValidator)());Ot.Factory.addGetterSetter(vt,"node");Ot.Factory.addGetterSetter(vt,"nodes");Ot.Factory.addGetterSetter(vt,"boundBoxFunc");Ot.Factory.addGetterSetter(vt,"anchorDragBoundFunc");Ot.Factory.addGetterSetter(vt,"anchorStyleFunc");Ot.Factory.addGetterSetter(vt,"shouldOverdrawWholeArea",!1);Ot.Factory.addGetterSetter(vt,"useSingleNodeRotation",!0);Ot.Factory.backCompat(vt,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var Sp={};Object.defineProperty(Sp,"__esModule",{value:!0});Sp.Wedge=void 0;const Ep=ft,NA=gr,IA=ut,L9=qe,DA=ut;let Pa=class extends NA.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,IA.Konva.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}};Sp.Wedge=Pa;Pa.prototype.className="Wedge";Pa.prototype._centroid=!0;Pa.prototype._attrsAffectingSize=["radius"];(0,DA._registerNode)(Pa);Ep.Factory.addGetterSetter(Pa,"radius",0,(0,L9.getNumberValidator)());Ep.Factory.addGetterSetter(Pa,"angle",0,(0,L9.getNumberValidator)());Ep.Factory.addGetterSetter(Pa,"clockwise",!1);Ep.Factory.backCompat(Pa,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var Op={};Object.defineProperty(Op,"__esModule",{value:!0});Op.Blur=void 0;const Q5=ft,jA=Vt,FA=qe;function J5(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var zA=[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],BA=[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 UA(e,t){var r=e.data,n=e.width,i=e.height,a,o,l,u,f,h,E,w,p,S,b,y,v,m,d,g,_,k,C,P,O,x,A,L,I=t+t+1,U=n-1,$=i-1,Z=t+1,q=Z*(Z+1)/2,z=new J5,W=null,R=z,M=null,F=null,D=zA[t],H=BA[t];for(l=1;l<I;l++)R=R.next=new J5,l===Z&&(W=R);for(R.next=z,E=h=0,o=0;o<i;o++){for(g=_=k=C=w=p=S=b=0,y=Z*(P=r[h]),v=Z*(O=r[h+1]),m=Z*(x=r[h+2]),d=Z*(A=r[h+3]),w+=q*P,p+=q*O,S+=q*x,b+=q*A,R=z,l=0;l<Z;l++)R.r=P,R.g=O,R.b=x,R.a=A,R=R.next;for(l=1;l<Z;l++)u=h+((U<l?U:l)<<2),w+=(R.r=P=r[u])*(L=Z-l),p+=(R.g=O=r[u+1])*L,S+=(R.b=x=r[u+2])*L,b+=(R.a=A=r[u+3])*L,g+=P,_+=O,k+=x,C+=A,R=R.next;for(M=z,F=W,a=0;a<n;a++)r[h+3]=A=b*D>>H,A!==0?(A=255/A,r[h]=(w*D>>H)*A,r[h+1]=(p*D>>H)*A,r[h+2]=(S*D>>H)*A):r[h]=r[h+1]=r[h+2]=0,w-=y,p-=v,S-=m,b-=d,y-=M.r,v-=M.g,m-=M.b,d-=M.a,u=E+((u=a+t+1)<U?u:U)<<2,g+=M.r=r[u],_+=M.g=r[u+1],k+=M.b=r[u+2],C+=M.a=r[u+3],w+=g,p+=_,S+=k,b+=C,M=M.next,y+=P=F.r,v+=O=F.g,m+=x=F.b,d+=A=F.a,g-=P,_-=O,k-=x,C-=A,F=F.next,h+=4;E+=n}for(a=0;a<n;a++){for(_=k=C=g=p=S=b=w=0,h=a<<2,y=Z*(P=r[h]),v=Z*(O=r[h+1]),m=Z*(x=r[h+2]),d=Z*(A=r[h+3]),w+=q*P,p+=q*O,S+=q*x,b+=q*A,R=z,l=0;l<Z;l++)R.r=P,R.g=O,R.b=x,R.a=A,R=R.next;for(f=n,l=1;l<=t;l++)h=f+a<<2,w+=(R.r=P=r[h])*(L=Z-l),p+=(R.g=O=r[h+1])*L,S+=(R.b=x=r[h+2])*L,b+=(R.a=A=r[h+3])*L,g+=P,_+=O,k+=x,C+=A,R=R.next,l<$&&(f+=n);for(h=a,M=z,F=W,o=0;o<i;o++)u=h<<2,r[u+3]=A=b*D>>H,A>0?(A=255/A,r[u]=(w*D>>H)*A,r[u+1]=(p*D>>H)*A,r[u+2]=(S*D>>H)*A):r[u]=r[u+1]=r[u+2]=0,w-=y,p-=v,S-=m,b-=d,y-=M.r,v-=M.g,m-=M.b,d-=M.a,u=a+((u=o+Z)<$?u:$)*n<<2,w+=g+=M.r=r[u],p+=_+=M.g=r[u+1],S+=k+=M.b=r[u+2],b+=C+=M.a=r[u+3],M=M.next,y+=P=F.r,v+=O=F.g,m+=x=F.b,d+=A=F.a,g-=P,_-=O,k-=x,C-=A,F=F.next,h+=n}}const HA=function(t){var r=Math.round(this.blurRadius());r>0&&UA(t,r)};Op.Blur=HA;Q5.Factory.addGetterSetter(jA.Node,"blurRadius",0,(0,FA.getNumberValidator)(),Q5.Factory.afterSetFilter);var xp={};Object.defineProperty(xp,"__esModule",{value:!0});xp.Brighten=void 0;const e4=ft,$A=Vt,GA=qe,VA=function(e){var t=this.brightness()*255,r=e.data,n=r.length,i;for(i=0;i<n;i+=4)r[i]+=t,r[i+1]+=t,r[i+2]+=t};xp.Brighten=VA;e4.Factory.addGetterSetter($A.Node,"brightness",0,(0,GA.getNumberValidator)(),e4.Factory.afterSetFilter);var Pp={};Object.defineProperty(Pp,"__esModule",{value:!0});Pp.Contrast=void 0;const t4=ft,qA=Vt,WA=qe,KA=function(e){var t=Math.pow((this.contrast()+100)/100,2),r=e.data,n=r.length,i=150,a=150,o=150,l;for(l=0;l<n;l+=4)i=r[l],a=r[l+1],o=r[l+2],i/=255,i-=.5,i*=t,i+=.5,i*=255,a/=255,a-=.5,a*=t,a+=.5,a*=255,o/=255,o-=.5,o*=t,o+=.5,o*=255,i=i<0?0:i>255?255:i,a=a<0?0:a>255?255:a,o=o<0?0:o>255?255:o,r[l]=i,r[l+1]=a,r[l+2]=o};Pp.Contrast=KA;t4.Factory.addGetterSetter(qA.Node,"contrast",0,(0,WA.getNumberValidator)(),t4.Factory.afterSetFilter);var Cp={};Object.defineProperty(Cp,"__esModule",{value:!0});Cp.Emboss=void 0;const ho=ft,kp=Vt,YA=Zt,N9=qe,XA=function(e){var t=this.embossStrength()*10,r=this.embossWhiteLevel()*255,n=this.embossDirection(),i=this.embossBlend(),a=0,o=0,l=e.data,u=e.width,f=e.height,h=u*4,E=f;switch(n){case"top-left":a=-1,o=-1;break;case"top":a=-1,o=0;break;case"top-right":a=-1,o=1;break;case"right":a=0,o=1;break;case"bottom-right":a=1,o=1;break;case"bottom":a=1,o=0;break;case"bottom-left":a=1,o=-1;break;case"left":a=0,o=-1;break;default:YA.Util.error("Unknown emboss direction: "+n)}do{var w=(E-1)*h,p=a;E+p<1&&(p=0),E+p>f&&(p=0);var S=(E-1+p)*u*4,b=u;do{var y=w+(b-1)*4,v=o;b+v<1&&(v=0),b+v>u&&(v=0);var m=S+(b-1+v)*4,d=l[y]-l[m],g=l[y+1]-l[m+1],_=l[y+2]-l[m+2],k=d,C=k>0?k:-k,P=g>0?g:-g,O=_>0?_:-_;if(P>C&&(k=g),O>C&&(k=_),k*=t,i){var x=l[y]+k,A=l[y+1]+k,L=l[y+2]+k;l[y]=x>255?255:x<0?0:x,l[y+1]=A>255?255:A<0?0:A,l[y+2]=L>255?255:L<0?0:L}else{var I=r-k;I<0?I=0:I>255&&(I=255),l[y]=l[y+1]=l[y+2]=I}}while(--b)}while(--E)};Cp.Emboss=XA;ho.Factory.addGetterSetter(kp.Node,"embossStrength",.5,(0,N9.getNumberValidator)(),ho.Factory.afterSetFilter);ho.Factory.addGetterSetter(kp.Node,"embossWhiteLevel",.5,(0,N9.getNumberValidator)(),ho.Factory.afterSetFilter);ho.Factory.addGetterSetter(kp.Node,"embossDirection","top-left",null,ho.Factory.afterSetFilter);ho.Factory.addGetterSetter(kp.Node,"embossBlend",!1,null,ho.Factory.afterSetFilter);var Tp={};Object.defineProperty(Tp,"__esModule",{value:!0});Tp.Enhance=void 0;const r4=ft,ZA=Vt,QA=qe;function eg(e,t,r,n,i){var a=r-t,o=i-n,l;return a===0?n+o/2:o===0?n:(l=(e-t)/a,l=o*l+n,l)}const JA=function(e){var t=e.data,r=t.length,n=t[0],i=n,a,o=t[1],l=o,u,f=t[2],h=f,E,w,p=this.enhance();if(p!==0){for(w=0;w<r;w+=4)a=t[w+0],a<n?n=a:a>i&&(i=a),u=t[w+1],u<o?o=u:u>l&&(l=u),E=t[w+2],E<f?f=E:E>h&&(h=E);i===n&&(i=255,n=0),l===o&&(l=255,o=0),h===f&&(h=255,f=0);var S,b,y,v,m,d,g,_,k;for(p>0?(b=i+p*(255-i),y=n-p*(n-0),m=l+p*(255-l),d=o-p*(o-0),_=h+p*(255-h),k=f-p*(f-0)):(S=(i+n)*.5,b=i+p*(i-S),y=n+p*(n-S),v=(l+o)*.5,m=l+p*(l-v),d=o+p*(o-v),g=(h+f)*.5,_=h+p*(h-g),k=f+p*(f-g)),w=0;w<r;w+=4)t[w+0]=eg(t[w+0],n,i,y,b),t[w+1]=eg(t[w+1],o,l,d,m),t[w+2]=eg(t[w+2],f,h,k,_)}};Tp.Enhance=JA;r4.Factory.addGetterSetter(ZA.Node,"enhance",0,(0,QA.getNumberValidator)(),r4.Factory.afterSetFilter);var Ap={};Object.defineProperty(Ap,"__esModule",{value:!0});Ap.Grayscale=void 0;const eR=function(e){var t=e.data,r=t.length,n,i;for(n=0;n<r;n+=4)i=.34*t[n]+.5*t[n+1]+.16*t[n+2],t[n]=i,t[n+1]=i,t[n+2]=i};Ap.Grayscale=eR;var Rp={};Object.defineProperty(Rp,"__esModule",{value:!0});Rp.HSL=void 0;const Rs=ft,Gy=Vt,Vy=qe;Rs.Factory.addGetterSetter(Gy.Node,"hue",0,(0,Vy.getNumberValidator)(),Rs.Factory.afterSetFilter);Rs.Factory.addGetterSetter(Gy.Node,"saturation",0,(0,Vy.getNumberValidator)(),Rs.Factory.afterSetFilter);Rs.Factory.addGetterSetter(Gy.Node,"luminance",0,(0,Vy.getNumberValidator)(),Rs.Factory.afterSetFilter);const tR=function(e){var t=e.data,r=t.length,n=1,i=Math.pow(2,this.saturation()),a=Math.abs(this.hue()+360)%360,o=this.luminance()*127,l,u=n*i*Math.cos(a*Math.PI/180),f=n*i*Math.sin(a*Math.PI/180),h=.299*n+.701*u+.167*f,E=.587*n-.587*u+.33*f,w=.114*n-.114*u-.497*f,p=.299*n-.299*u-.328*f,S=.587*n+.413*u+.035*f,b=.114*n-.114*u+.293*f,y=.299*n-.3*u+1.25*f,v=.587*n-.586*u-1.05*f,m=.114*n+.886*u-.2*f,d,g,_,k;for(l=0;l<r;l+=4)d=t[l+0],g=t[l+1],_=t[l+2],k=t[l+3],t[l+0]=h*d+E*g+w*_+o,t[l+1]=p*d+S*g+b*_+o,t[l+2]=y*d+v*g+m*_+o,t[l+3]=k};Rp.HSL=tR;var Mp={};Object.defineProperty(Mp,"__esModule",{value:!0});Mp.HSV=void 0;const Ms=ft,qy=Vt,Wy=qe,rR=function(e){var t=e.data,r=t.length,n=Math.pow(2,this.value()),i=Math.pow(2,this.saturation()),a=Math.abs(this.hue()+360)%360,o,l=n*i*Math.cos(a*Math.PI/180),u=n*i*Math.sin(a*Math.PI/180),f=.299*n+.701*l+.167*u,h=.587*n-.587*l+.33*u,E=.114*n-.114*l-.497*u,w=.299*n-.299*l-.328*u,p=.587*n+.413*l+.035*u,S=.114*n-.114*l+.293*u,b=.299*n-.3*l+1.25*u,y=.587*n-.586*l-1.05*u,v=.114*n+.886*l-.2*u,m,d,g,_;for(o=0;o<r;o+=4)m=t[o+0],d=t[o+1],g=t[o+2],_=t[o+3],t[o+0]=f*m+h*d+E*g,t[o+1]=w*m+p*d+S*g,t[o+2]=b*m+y*d+v*g,t[o+3]=_};Mp.HSV=rR;Ms.Factory.addGetterSetter(qy.Node,"hue",0,(0,Wy.getNumberValidator)(),Ms.Factory.afterSetFilter);Ms.Factory.addGetterSetter(qy.Node,"saturation",0,(0,Wy.getNumberValidator)(),Ms.Factory.afterSetFilter);Ms.Factory.addGetterSetter(qy.Node,"value",0,(0,Wy.getNumberValidator)(),Ms.Factory.afterSetFilter);var Lp={};Object.defineProperty(Lp,"__esModule",{value:!0});Lp.Invert=void 0;const nR=function(e){var t=e.data,r=t.length,n;for(n=0;n<r;n+=4)t[n]=255-t[n],t[n+1]=255-t[n+1],t[n+2]=255-t[n+2]};Lp.Invert=nR;var Np={};Object.defineProperty(Np,"__esModule",{value:!0});Np.Kaleidoscope=void 0;const bh=ft,I9=Vt,n4=Zt,D9=qe;var iR=function(e,t,r){var n=e.data,i=t.data,a=e.width,o=e.height,l=r.polarCenterX||a/2,u=r.polarCenterY||o/2,f,h,E,w=0,p=0,S=0,b=0,y,v=Math.sqrt(l*l+u*u);h=a-l,E=o-u,y=Math.sqrt(h*h+E*E),v=y>v?y:v;var m=o,d=a,g,_,k=360/d*Math.PI/180,C,P;for(_=0;_<d;_+=1)for(C=Math.sin(_*k),P=Math.cos(_*k),g=0;g<m;g+=1)h=Math.floor(l+v*g/m*P),E=Math.floor(u+v*g/m*C),f=(E*a+h)*4,w=n[f+0],p=n[f+1],S=n[f+2],b=n[f+3],f=(_+g*a)*4,i[f+0]=w,i[f+1]=p,i[f+2]=S,i[f+3]=b},aR=function(e,t,r){var n=e.data,i=t.data,a=e.width,o=e.height,l=r.polarCenterX||a/2,u=r.polarCenterY||o/2,f,h,E,w,p,S=0,b=0,y=0,v=0,m,d=Math.sqrt(l*l+u*u);h=a-l,E=o-u,m=Math.sqrt(h*h+E*E),d=m>d?m:d;var g=o,_=a,k,C,P=0,O,x;for(h=0;h<a;h+=1)for(E=0;E<o;E+=1)w=h-l,p=E-u,k=Math.sqrt(w*w+p*p)*g/d,C=(Math.atan2(p,w)*180/Math.PI+360+P)%360,C=C*_/360,O=Math.floor(C),x=Math.floor(k),f=(x*a+O)*4,S=n[f+0],b=n[f+1],y=n[f+2],v=n[f+3],f=(E*a+h)*4,i[f+0]=S,i[f+1]=b,i[f+2]=y,i[f+3]=v};const oR=function(e){var t=e.width,r=e.height,n,i,a,o,l,u,f,h,E,w,p=Math.round(this.kaleidoscopePower()),S=Math.round(this.kaleidoscopeAngle()),b=Math.floor(t*(S%360)/360);if(!(p<1)){var y=n4.Util.createCanvasElement();y.width=t,y.height=r;var v=y.getContext("2d").getImageData(0,0,t,r);n4.Util.releaseCanvas(y),iR(e,v,{polarCenterX:t/2,polarCenterY:r/2});for(var m=t/Math.pow(2,p);m<=8;)m=m*2,p-=1;m=Math.ceil(m);var d=m,g=0,_=d,k=1;for(b+m>t&&(g=d,_=0,k=-1),i=0;i<r;i+=1)for(n=g;n!==_;n+=k)a=Math.round(n+b)%t,E=(t*i+a)*4,l=v.data[E+0],u=v.data[E+1],f=v.data[E+2],h=v.data[E+3],w=(t*i+n)*4,v.data[w+0]=l,v.data[w+1]=u,v.data[w+2]=f,v.data[w+3]=h;for(i=0;i<r;i+=1)for(d=Math.floor(m),o=0;o<p;o+=1){for(n=0;n<d+1;n+=1)E=(t*i+n)*4,l=v.data[E+0],u=v.data[E+1],f=v.data[E+2],h=v.data[E+3],w=(t*i+d*2-n-1)*4,v.data[w+0]=l,v.data[w+1]=u,v.data[w+2]=f,v.data[w+3]=h;d*=2}aR(v,e,{polarRotation:0})}};Np.Kaleidoscope=oR;bh.Factory.addGetterSetter(I9.Node,"kaleidoscopePower",2,(0,D9.getNumberValidator)(),bh.Factory.afterSetFilter);bh.Factory.addGetterSetter(I9.Node,"kaleidoscopeAngle",0,(0,D9.getNumberValidator)(),bh.Factory.afterSetFilter);var Ip={};Object.defineProperty(Ip,"__esModule",{value:!0});Ip.Mask=void 0;const i4=ft,lR=Vt,sR=qe;function md(e,t,r){var n=(r*e.width+t)*4,i=[];return i.push(e.data[n++],e.data[n++],e.data[n++],e.data[n++]),i}function Lu(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2))}function uR(e){for(var t=[0,0,0],r=0;r<e.length;r++)t[0]+=e[r][0],t[1]+=e[r][1],t[2]+=e[r][2];return t[0]/=e.length,t[1]/=e.length,t[2]/=e.length,t}function cR(e,t){var r=md(e,0,0),n=md(e,e.width-1,0),i=md(e,0,e.height-1),a=md(e,e.width-1,e.height-1),o=t||10;if(Lu(r,n)<o&&Lu(n,a)<o&&Lu(a,i)<o&&Lu(i,r)<o){for(var l=uR([n,r,a,i]),u=[],f=0;f<e.width*e.height;f++){var h=Lu(l,[e.data[f*4],e.data[f*4+1],e.data[f*4+2]]);u[f]=h<o?0:255}return u}}function fR(e,t){for(var r=0;r<e.width*e.height;r++)e.data[4*r+3]=t[r]}function dR(e,t,r){for(var n=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),o=[],l=0;l<r;l++)for(var u=0;u<t;u++){for(var f=l*t+u,h=0,E=0;E<i;E++)for(var w=0;w<i;w++){var p=l+E-a,S=u+w-a;if(p>=0&&p<r&&S>=0&&S<t){var b=p*t+S,y=n[E*i+w];h+=e[b]*y}}o[f]=h===255*8?255:0}return o}function hR(e,t,r){for(var n=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),o=[],l=0;l<r;l++)for(var u=0;u<t;u++){for(var f=l*t+u,h=0,E=0;E<i;E++)for(var w=0;w<i;w++){var p=l+E-a,S=u+w-a;if(p>=0&&p<r&&S>=0&&S<t){var b=p*t+S,y=n[E*i+w];h+=e[b]*y}}o[f]=h>=255*4?255:0}return o}function pR(e,t,r){for(var n=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),o=[],l=0;l<r;l++)for(var u=0;u<t;u++){for(var f=l*t+u,h=0,E=0;E<i;E++)for(var w=0;w<i;w++){var p=l+E-a,S=u+w-a;if(p>=0&&p<r&&S>=0&&S<t){var b=p*t+S,y=n[E*i+w];h+=e[b]*y}}o[f]=h}return o}const gR=function(e){var t=this.threshold(),r=cR(e,t);return r&&(r=dR(r,e.width,e.height),r=hR(r,e.width,e.height),r=pR(r,e.width,e.height),fR(e,r)),e};Ip.Mask=gR;i4.Factory.addGetterSetter(lR.Node,"threshold",0,(0,sR.getNumberValidator)(),i4.Factory.afterSetFilter);var Dp={};Object.defineProperty(Dp,"__esModule",{value:!0});Dp.Noise=void 0;const a4=ft,vR=Vt,mR=qe,yR=function(e){var t=this.noise()*255,r=e.data,n=r.length,i=t/2,a;for(a=0;a<n;a+=4)r[a+0]+=i-2*i*Math.random(),r[a+1]+=i-2*i*Math.random(),r[a+2]+=i-2*i*Math.random()};Dp.Noise=yR;a4.Factory.addGetterSetter(vR.Node,"noise",.2,(0,mR.getNumberValidator)(),a4.Factory.afterSetFilter);var jp={};Object.defineProperty(jp,"__esModule",{value:!0});jp.Pixelate=void 0;const o4=ft,bR=Zt,_R=Vt,wR=qe,SR=function(e){var t=Math.ceil(this.pixelSize()),r=e.width,n=e.height,i,a,o,l,u,f,h,E=Math.ceil(r/t),w=Math.ceil(n/t),p,S,b,y,v,m,d,g=e.data;if(t<=0){bR.Util.error("pixelSize value can not be <= 0");return}for(v=0;v<E;v+=1)for(m=0;m<w;m+=1){for(l=0,u=0,f=0,h=0,p=v*t,S=p+t,b=m*t,y=b+t,d=0,i=p;i<S;i+=1)if(!(i>=r))for(a=b;a<y;a+=1)a>=n||(o=(r*a+i)*4,l+=g[o+0],u+=g[o+1],f+=g[o+2],h+=g[o+3],d+=1);for(l=l/d,u=u/d,f=f/d,h=h/d,i=p;i<S;i+=1)if(!(i>=r))for(a=b;a<y;a+=1)a>=n||(o=(r*a+i)*4,g[o+0]=l,g[o+1]=u,g[o+2]=f,g[o+3]=h)}};jp.Pixelate=SR;o4.Factory.addGetterSetter(_R.Node,"pixelSize",8,(0,wR.getNumberValidator)(),o4.Factory.afterSetFilter);var Fp={};Object.defineProperty(Fp,"__esModule",{value:!0});Fp.Posterize=void 0;const l4=ft,ER=Vt,OR=qe,xR=function(e){var t=Math.round(this.levels()*254)+1,r=e.data,n=r.length,i=255/t,a;for(a=0;a<n;a+=1)r[a]=Math.floor(r[a]/i)*i};Fp.Posterize=xR;l4.Factory.addGetterSetter(ER.Node,"levels",.5,(0,OR.getNumberValidator)(),l4.Factory.afterSetFilter);var zp={};Object.defineProperty(zp,"__esModule",{value:!0});zp.RGB=void 0;const _h=ft,Ky=Vt,PR=qe,CR=function(e){var t=e.data,r=t.length,n=this.red(),i=this.green(),a=this.blue(),o,l;for(o=0;o<r;o+=4)l=(.34*t[o]+.5*t[o+1]+.16*t[o+2])/255,t[o]=l*n,t[o+1]=l*i,t[o+2]=l*a,t[o+3]=t[o+3]};zp.RGB=CR;_h.Factory.addGetterSetter(Ky.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});_h.Factory.addGetterSetter(Ky.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});_h.Factory.addGetterSetter(Ky.Node,"blue",0,PR.RGBComponent,_h.Factory.afterSetFilter);var Bp={};Object.defineProperty(Bp,"__esModule",{value:!0});Bp.RGBA=void 0;const _c=ft,Up=Vt,kR=qe,TR=function(e){var t=e.data,r=t.length,n=this.red(),i=this.green(),a=this.blue(),o=this.alpha(),l,u;for(l=0;l<r;l+=4)u=1-o,t[l]=n*o+t[l]*u,t[l+1]=i*o+t[l+1]*u,t[l+2]=a*o+t[l+2]*u};Bp.RGBA=TR;_c.Factory.addGetterSetter(Up.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});_c.Factory.addGetterSetter(Up.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});_c.Factory.addGetterSetter(Up.Node,"blue",0,kR.RGBComponent,_c.Factory.afterSetFilter);_c.Factory.addGetterSetter(Up.Node,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});var Hp={};Object.defineProperty(Hp,"__esModule",{value:!0});Hp.Sepia=void 0;const AR=function(e){var t=e.data,r=t.length,n,i,a,o;for(n=0;n<r;n+=4)i=t[n+0],a=t[n+1],o=t[n+2],t[n+0]=Math.min(255,i*.393+a*.769+o*.189),t[n+1]=Math.min(255,i*.349+a*.686+o*.168),t[n+2]=Math.min(255,i*.272+a*.534+o*.131)};Hp.Sepia=AR;var $p={};Object.defineProperty($p,"__esModule",{value:!0});$p.Solarize=void 0;const RR=function(e){var t=e.data,r=e.width,n=e.height,i=r*4,a=n;do{var o=(a-1)*i,l=r;do{var u=o+(l-1)*4,f=t[u],h=t[u+1],E=t[u+2];f>127&&(f=255-f),h>127&&(h=255-h),E>127&&(E=255-E),t[u]=f,t[u+1]=h,t[u+2]=E}while(--l)}while(--a)};$p.Solarize=RR;var Gp={};Object.defineProperty(Gp,"__esModule",{value:!0});Gp.Threshold=void 0;const s4=ft,MR=Vt,LR=qe,NR=function(e){var t=this.threshold()*255,r=e.data,n=r.length,i;for(i=0;i<n;i+=1)r[i]=r[i]<t?0:255};Gp.Threshold=NR;s4.Factory.addGetterSetter(MR.Node,"threshold",.5,(0,LR.getNumberValidator)(),s4.Factory.afterSetFilter);Object.defineProperty(Jh,"__esModule",{value:!0});Jh.Konva=void 0;const u4=vh,IR=ap,DR=sp,jR=fp,FR=dp,zR=hp,c4=As,BR=Hc,UR=Ks,HR=Vc,$R=vp,GR=mp,VR=yp,qR=bp,WR=ul,KR=_p,YR=wp,XR=Sp,ZR=Op,QR=xp,JR=Pp,eM=Cp,tM=Tp,rM=Ap,nM=Rp,iM=Mp,aM=Lp,oM=Np,lM=Ip,sM=Dp,uM=jp,cM=Fp,fM=zp,dM=Bp,hM=Hp,pM=$p,gM=Gp;Jh.Konva=u4.Konva.Util._assign(u4.Konva,{Arc:IR.Arc,Arrow:DR.Arrow,Circle:jR.Circle,Ellipse:FR.Ellipse,Image:zR.Image,Label:c4.Label,Tag:c4.Tag,Line:BR.Line,Path:UR.Path,Rect:HR.Rect,RegularPolygon:$R.RegularPolygon,Ring:GR.Ring,Sprite:VR.Sprite,Star:qR.Star,Text:WR.Text,TextPath:KR.TextPath,Transformer:YR.Transformer,Wedge:XR.Wedge,Filters:{Blur:ZR.Blur,Brighten:QR.Brighten,Contrast:JR.Contrast,Emboss:eM.Emboss,Enhance:tM.Enhance,Grayscale:rM.Grayscale,HSL:nM.HSL,HSV:iM.HSV,Invert:aM.Invert,Kaleidoscope:oM.Kaleidoscope,Mask:lM.Mask,Noise:sM.Noise,Pixelate:uM.Pixelate,Posterize:cM.Posterize,RGB:fM.RGB,RGBA:dM.RGBA,Sepia:hM.Sepia,Solarize:pM.Solarize,Threshold:gM.Threshold}});var vM=Ny.exports;Object.defineProperty(vM,"__esModule",{value:!0});const mM=Jh;Ny.exports=mM.Konva;var Si=Ny.exports,gm={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var r=vh;Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return r.Konva}});const n=vh;e.exports=n.Konva})(gm,gm.exports);var yM=gm.exports;const wc=xh(yM);var j9={exports:{}};/**
44
+ * @license React
45
+ * react-reconciler.production.min.js
46
+ *
47
+ * Copyright (c) Facebook, Inc. and its affiliates.
48
+ *
49
+ * This source code is licensed under the MIT license found in the
50
+ * LICENSE file in the root directory of this source tree.
51
+ */var bM=function(t){var r={},n=Je,i=zu,a=Object.assign;function o(s){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+s,T=1;T<arguments.length;T++)c+="&args[]="+encodeURIComponent(arguments[T]);return"Minified React error #"+s+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,u=Symbol.for("react.element"),f=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),p=Symbol.for("react.provider"),S=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),_=Symbol.iterator;function k(s){return s===null||typeof s!="object"?null:(s=_&&s[_]||s["@@iterator"],typeof s=="function"?s:null)}function C(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case h:return"Fragment";case f:return"Portal";case w:return"Profiler";case E:return"StrictMode";case y:return"Suspense";case v:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case S:return(s.displayName||"Context")+".Consumer";case p:return(s._context.displayName||"Context")+".Provider";case b:var c=s.render;return s=s.displayName,s||(s=c.displayName||c.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case m:return c=s.displayName||null,c!==null?c:C(s.type)||"Memo";case d:c=s._payload,s=s._init;try{return C(s(c))}catch{}}return null}function P(s){var c=s.type;switch(s.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 s=c.render,s=s.displayName||s.name||"",c.displayName||(s!==""?"ForwardRef("+s+")":"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===E?"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 O(s){var c=s,T=s;if(s.alternate)for(;c.return;)c=c.return;else{s=c;do c=s,c.flags&4098&&(T=c.return),s=c.return;while(s)}return c.tag===3?T:null}function x(s){if(O(s)!==s)throw Error(o(188))}function A(s){var c=s.alternate;if(!c){if(c=O(s),c===null)throw Error(o(188));return c!==s?null:s}for(var T=s,N=c;;){var j=T.return;if(j===null)break;var V=j.alternate;if(V===null){if(N=j.return,N!==null){T=N;continue}break}if(j.child===V.child){for(V=j.child;V;){if(V===T)return x(j),s;if(V===N)return x(j),c;V=V.sibling}throw Error(o(188))}if(T.return!==N.return)T=j,N=V;else{for(var J=!1,ae=j.child;ae;){if(ae===T){J=!0,T=j,N=V;break}if(ae===N){J=!0,N=j,T=V;break}ae=ae.sibling}if(!J){for(ae=V.child;ae;){if(ae===T){J=!0,T=V,N=j;break}if(ae===N){J=!0,N=V,T=j;break}ae=ae.sibling}if(!J)throw Error(o(189))}}if(T.alternate!==N)throw Error(o(190))}if(T.tag!==3)throw Error(o(188));return T.stateNode.current===T?s:c}function L(s){return s=A(s),s!==null?I(s):null}function I(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var c=I(s);if(c!==null)return c;s=s.sibling}return null}function U(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){if(s.tag!==4){var c=U(s);if(c!==null)return c}s=s.sibling}return null}var $=Array.isArray,Z=t.getPublicInstance,q=t.getRootHostContext,z=t.getChildHostContext,W=t.prepareForCommit,R=t.resetAfterCommit,M=t.createInstance,F=t.appendInitialChild,D=t.finalizeInitialChildren,H=t.prepareUpdate,K=t.shouldSetTextContent,G=t.createTextInstance,B=t.scheduleTimeout,Y=t.cancelTimeout,X=t.noTimeout,Q=t.isPrimaryRenderer,te=t.supportsMutation,ee=t.supportsPersistence,ie=t.supportsHydration,ne=t.getInstanceFromNode,le=t.preparePortalMount,Te=t.getCurrentEventPriority,Ie=t.detachDeletedInstance,se=t.supportsMicrotasks,de=t.scheduleMicrotask,_e=t.supportsTestSelectors,ve=t.findFiberRoot,re=t.getBoundingRect,ce=t.getTextContent,be=t.isHiddenSubtree,Oe=t.matchAccessibilityRole,$e=t.setFocusIfFocusable,Qe=t.setupIntersectionObserver,Ye=t.appendChild,Le=t.appendChildToContainer,Ee=t.commitTextUpdate,Re=t.commitMount,Ve=t.commitUpdate,oe=t.insertBefore,fe=t.insertInContainerBefore,Ze=t.removeChild,ye=t.removeChildFromContainer,Me=t.resetTextContent,Pe=t.hideInstance,we=t.hideTextInstance,et=t.unhideInstance,Se=t.unhideTextInstance,We=t.clearContainer,lr=t.cloneInstance,xe=t.createContainerChildSet,ze=t.appendChildToContainerChildSet,rt=t.finalizeContainerChildren,yt=t.replaceContainerChildren,xt=t.cloneHiddenInstance,xr=t.cloneHiddenTextInstance,Zr=t.canHydrateInstance,mr=t.canHydrateTextInstance,Qr=t.canHydrateSuspenseInstance,Qn=t.isSuspenseInstancePending,Rn=t.isSuspenseInstanceFallback,Ne=t.getSuspenseInstanceFallbackErrorDetails,tt=t.registerSuspenseInstanceRetry,ct=t.getNextHydratableSibling,Mt=t.getFirstHydratableChild,Et=t.getFirstHydratableChildWithinContainer,Jr=t.getFirstHydratableChildWithinSuspenseInstance,$r=t.hydrateInstance,Ut=t.hydrateTextInstance,en=t.hydrateSuspenseInstance,Mn=t.getNextHydratableInstanceAfterSuspenseInstance,Ln=t.commitHydratedContainer,Ta=t.commitHydratedSuspenseInstance,ru=t.clearSuspenseBoundary,ko=t.clearSuspenseBoundaryFromContainer,To=t.shouldDeleteUnhydratedTailInstances,Aa=t.didNotMatchHydratedContainerTextInstance,Zc=t.didNotMatchHydratedTextInstance,kl;function nu(s){if(kl===void 0)try{throw Error()}catch(T){var c=T.stack.trim().match(/\n( *(at )?)/);kl=c&&c[1]||""}return`
52
+ `+kl+s}var e0=!1;function t0(s,c){if(!s||e0)return"";e0=!0;var T=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(ke){var N=ke}Reflect.construct(s,[],c)}else{try{c.call()}catch(ke){N=ke}s.call(c.prototype)}else{try{throw Error()}catch(ke){N=ke}s()}}catch(ke){if(ke&&N&&typeof ke.stack=="string"){for(var j=ke.stack.split(`
53
+ `),V=N.stack.split(`
54
+ `),J=j.length-1,ae=V.length-1;1<=J&&0<=ae&&j[J]!==V[ae];)ae--;for(;1<=J&&0<=ae;J--,ae--)if(j[J]!==V[ae]){if(J!==1||ae!==1)do if(J--,ae--,0>ae||j[J]!==V[ae]){var pe=`
55
+ `+j[J].replace(" at new "," at ");return s.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",s.displayName)),pe}while(1<=J&&0<=ae);break}}}finally{e0=!1,Error.prepareStackTrace=T}return(s=s?s.displayName||s.name:"")?nu(s):""}var RS=Object.prototype.hasOwnProperty,r0=[],Tl=-1;function Ra(s){return{current:s}}function jt(s){0>Tl||(s.current=r0[Tl],r0[Tl]=null,Tl--)}function Lt(s,c){Tl++,r0[Tl]=s.current,s.current=c}var Ma={},Lr=Ra(Ma),tn=Ra(!1),Ao=Ma;function Al(s,c){var T=s.type.contextTypes;if(!T)return Ma;var N=s.stateNode;if(N&&N.__reactInternalMemoizedUnmaskedChildContext===c)return N.__reactInternalMemoizedMaskedChildContext;var j={},V;for(V in T)j[V]=c[V];return N&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=c,s.__reactInternalMemoizedMaskedChildContext=j),j}function rn(s){return s=s.childContextTypes,s!=null}function Qc(){jt(tn),jt(Lr)}function x2(s,c,T){if(Lr.current!==Ma)throw Error(o(168));Lt(Lr,c),Lt(tn,T)}function P2(s,c,T){var N=s.stateNode;if(c=c.childContextTypes,typeof N.getChildContext!="function")return T;N=N.getChildContext();for(var j in N)if(!(j in c))throw Error(o(108,P(s)||"Unknown",j));return a({},T,N)}function Jc(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||Ma,Ao=Lr.current,Lt(Lr,s),Lt(tn,tn.current),!0}function C2(s,c,T){var N=s.stateNode;if(!N)throw Error(o(169));T?(s=P2(s,c,Ao),N.__reactInternalMemoizedMergedChildContext=s,jt(tn),jt(Lr),Lt(Lr,s)):jt(tn),Lt(tn,T)}var Jn=Math.clz32?Math.clz32:NS,MS=Math.log,LS=Math.LN2;function NS(s){return s>>>=0,s===0?32:31-(MS(s)/LS|0)|0}var ef=64,tf=4194304;function iu(s){switch(s&-s){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 s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function rf(s,c){var T=s.pendingLanes;if(T===0)return 0;var N=0,j=s.suspendedLanes,V=s.pingedLanes,J=T&268435455;if(J!==0){var ae=J&~j;ae!==0?N=iu(ae):(V&=J,V!==0&&(N=iu(V)))}else J=T&~j,J!==0?N=iu(J):V!==0&&(N=iu(V));if(N===0)return 0;if(c!==0&&c!==N&&!(c&j)&&(j=N&-N,V=c&-c,j>=V||j===16&&(V&4194240)!==0))return c;if(N&4&&(N|=T&16),c=s.entangledLanes,c!==0)for(s=s.entanglements,c&=N;0<c;)T=31-Jn(c),j=1<<T,N|=s[T],c&=~j;return N}function IS(s,c){switch(s){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 DS(s,c){for(var T=s.suspendedLanes,N=s.pingedLanes,j=s.expirationTimes,V=s.pendingLanes;0<V;){var J=31-Jn(V),ae=1<<J,pe=j[J];pe===-1?(!(ae&T)||ae&N)&&(j[J]=IS(ae,c)):pe<=c&&(s.expiredLanes|=ae),V&=~ae}}function n0(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function k2(){var s=ef;return ef<<=1,!(ef&4194240)&&(ef=64),s}function i0(s){for(var c=[],T=0;31>T;T++)c.push(s);return c}function au(s,c,T){s.pendingLanes|=c,c!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,c=31-Jn(c),s[c]=T}function jS(s,c){var T=s.pendingLanes&~c;s.pendingLanes=c,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=c,s.mutableReadLanes&=c,s.entangledLanes&=c,c=s.entanglements;var N=s.eventTimes;for(s=s.expirationTimes;0<T;){var j=31-Jn(T),V=1<<j;c[j]=0,N[j]=-1,s[j]=-1,T&=~V}}function a0(s,c){var T=s.entangledLanes|=c;for(s=s.entanglements;T;){var N=31-Jn(T),j=1<<N;j&c|s[N]&c&&(s[N]|=c),T&=~j}}var bt=0;function T2(s){return s&=-s,1<s?4<s?s&268435455?16:536870912:4:1}var o0=i.unstable_scheduleCallback,A2=i.unstable_cancelCallback,FS=i.unstable_shouldYield,zS=i.unstable_requestPaint,yr=i.unstable_now,l0=i.unstable_ImmediatePriority,BS=i.unstable_UserBlockingPriority,s0=i.unstable_NormalPriority,US=i.unstable_IdlePriority,nf=null,Oi=null;function HS(s){if(Oi&&typeof Oi.onCommitFiberRoot=="function")try{Oi.onCommitFiberRoot(nf,s,void 0,(s.current.flags&128)===128)}catch{}}function $S(s,c){return s===c&&(s!==0||1/s===1/c)||s!==s&&c!==c}var ei=typeof Object.is=="function"?Object.is:$S,Zi=null,af=!1,u0=!1;function R2(s){Zi===null?Zi=[s]:Zi.push(s)}function GS(s){af=!0,R2(s)}function xi(){if(!u0&&Zi!==null){u0=!0;var s=0,c=bt;try{var T=Zi;for(bt=1;s<T.length;s++){var N=T[s];do N=N(!0);while(N!==null)}Zi=null,af=!1}catch(j){throw Zi!==null&&(Zi=Zi.slice(s+1)),o0(l0,xi),j}finally{bt=c,u0=!1}}return null}var Rl=[],Ml=0,of=null,lf=0,Nn=[],In=0,Ro=null,Qi=1,Ji="";function Mo(s,c){Rl[Ml++]=lf,Rl[Ml++]=of,of=s,lf=c}function M2(s,c,T){Nn[In++]=Qi,Nn[In++]=Ji,Nn[In++]=Ro,Ro=s;var N=Qi;s=Ji;var j=32-Jn(N)-1;N&=~(1<<j),T+=1;var V=32-Jn(c)+j;if(30<V){var J=j-j%5;V=(N&(1<<J)-1).toString(32),N>>=J,j-=J,Qi=1<<32-Jn(c)+j|T<<j|N,Ji=V+s}else Qi=1<<V|T<<j|N,Ji=s}function c0(s){s.return!==null&&(Mo(s,1),M2(s,1,0))}function f0(s){for(;s===of;)of=Rl[--Ml],Rl[Ml]=null,lf=Rl[--Ml],Rl[Ml]=null;for(;s===Ro;)Ro=Nn[--In],Nn[In]=null,Ji=Nn[--In],Nn[In]=null,Qi=Nn[--In],Nn[In]=null}var bn=null,Dn=null,Ht=!1,ou=!1,ti=null;function L2(s,c){var T=Un(5,null,null,0);T.elementType="DELETED",T.stateNode=c,T.return=s,c=s.deletions,c===null?(s.deletions=[T],s.flags|=16):c.push(T)}function N2(s,c){switch(s.tag){case 5:return c=Zr(c,s.type,s.pendingProps),c!==null?(s.stateNode=c,bn=s,Dn=Mt(c),!0):!1;case 6:return c=mr(c,s.pendingProps),c!==null?(s.stateNode=c,bn=s,Dn=null,!0):!1;case 13:if(c=Qr(c),c!==null){var T=Ro!==null?{id:Qi,overflow:Ji}:null;return s.memoizedState={dehydrated:c,treeContext:T,retryLane:1073741824},T=Un(18,null,null,0),T.stateNode=c,T.return=s,s.child=T,bn=s,Dn=null,!0}return!1;default:return!1}}function d0(s){return(s.mode&1)!==0&&(s.flags&128)===0}function h0(s){if(Ht){var c=Dn;if(c){var T=c;if(!N2(s,c)){if(d0(s))throw Error(o(418));c=ct(T);var N=bn;c&&N2(s,c)?L2(N,T):(s.flags=s.flags&-4097|2,Ht=!1,bn=s)}}else{if(d0(s))throw Error(o(418));s.flags=s.flags&-4097|2,Ht=!1,bn=s}}}function I2(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;bn=s}function sf(s){if(!ie||s!==bn)return!1;if(!Ht)return I2(s),Ht=!0,!1;if(s.tag!==3&&(s.tag!==5||To(s.type)&&!K(s.type,s.memoizedProps))){var c=Dn;if(c){if(d0(s))throw D2(),Error(o(418));for(;c;)L2(s,c),c=ct(c)}}if(I2(s),s.tag===13){if(!ie)throw Error(o(316));if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(o(317));Dn=Mn(s)}else Dn=bn?ct(s.stateNode):null;return!0}function D2(){for(var s=Dn;s;)s=ct(s)}function Ll(){ie&&(Dn=bn=null,ou=Ht=!1)}function p0(s){ti===null?ti=[s]:ti.push(s)}var VS=l.ReactCurrentBatchConfig;function uf(s,c){if(ei(s,c))return!0;if(typeof s!="object"||s===null||typeof c!="object"||c===null)return!1;var T=Object.keys(s),N=Object.keys(c);if(T.length!==N.length)return!1;for(N=0;N<T.length;N++){var j=T[N];if(!RS.call(c,j)||!ei(s[j],c[j]))return!1}return!0}function qS(s){switch(s.tag){case 5:return nu(s.type);case 16:return nu("Lazy");case 13:return nu("Suspense");case 19:return nu("SuspenseList");case 0:case 2:case 15:return s=t0(s.type,!1),s;case 11:return s=t0(s.type.render,!1),s;case 1:return s=t0(s.type,!0),s;default:return""}}function lu(s,c,T){if(s=T.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(T._owner){if(T=T._owner,T){if(T.tag!==1)throw Error(o(309));var N=T.stateNode}if(!N)throw Error(o(147,s));var j=N,V=""+s;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===V?c.ref:(c=function(J){var ae=j.refs;J===null?delete ae[V]:ae[V]=J},c._stringRef=V,c)}if(typeof s!="string")throw Error(o(284));if(!T._owner)throw Error(o(290,s))}return s}function cf(s,c){throw s=Object.prototype.toString.call(c),Error(o(31,s==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":s))}function j2(s){var c=s._init;return c(s._payload)}function F2(s){function c(he,ue){if(s){var ge=he.deletions;ge===null?(he.deletions=[ue],he.flags|=16):ge.push(ue)}}function T(he,ue){if(!s)return null;for(;ue!==null;)c(he,ue),ue=ue.sibling;return null}function N(he,ue){for(he=new Map;ue!==null;)ue.key!==null?he.set(ue.key,ue):he.set(ue.index,ue),ue=ue.sibling;return he}function j(he,ue){return he=za(he,ue),he.index=0,he.sibling=null,he}function V(he,ue,ge){return he.index=ge,s?(ge=he.alternate,ge!==null?(ge=ge.index,ge<ue?(he.flags|=2,ue):ge):(he.flags|=2,ue)):(he.flags|=1048576,ue)}function J(he){return s&&he.alternate===null&&(he.flags|=2),he}function ae(he,ue,ge,je){return ue===null||ue.tag!==6?(ue=u1(ge,he.mode,je),ue.return=he,ue):(ue=j(ue,ge),ue.return=he,ue)}function pe(he,ue,ge,je){var Xe=ge.type;return Xe===h?He(he,ue,ge.props.children,je,ge.key):ue!==null&&(ue.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===d&&j2(Xe)===ue.type)?(je=j(ue,ge.props),je.ref=lu(he,ue,ge),je.return=he,je):(je=Uf(ge.type,ge.key,ge.props,null,he.mode,je),je.ref=lu(he,ue,ge),je.return=he,je)}function ke(he,ue,ge,je){return ue===null||ue.tag!==4||ue.stateNode.containerInfo!==ge.containerInfo||ue.stateNode.implementation!==ge.implementation?(ue=c1(ge,he.mode,je),ue.return=he,ue):(ue=j(ue,ge.children||[]),ue.return=he,ue)}function He(he,ue,ge,je,Xe){return ue===null||ue.tag!==7?(ue=zo(ge,he.mode,je,Xe),ue.return=he,ue):(ue=j(ue,ge),ue.return=he,ue)}function it(he,ue,ge){if(typeof ue=="string"&&ue!==""||typeof ue=="number")return ue=u1(""+ue,he.mode,ge),ue.return=he,ue;if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case u:return ge=Uf(ue.type,ue.key,ue.props,null,he.mode,ge),ge.ref=lu(he,null,ue),ge.return=he,ge;case f:return ue=c1(ue,he.mode,ge),ue.return=he,ue;case d:var je=ue._init;return it(he,je(ue._payload),ge)}if($(ue)||k(ue))return ue=zo(ue,he.mode,ge,null),ue.return=he,ue;cf(he,ue)}return null}function De(he,ue,ge,je){var Xe=ue!==null?ue.key:null;if(typeof ge=="string"&&ge!==""||typeof ge=="number")return Xe!==null?null:ae(he,ue,""+ge,je);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case u:return ge.key===Xe?pe(he,ue,ge,je):null;case f:return ge.key===Xe?ke(he,ue,ge,je):null;case d:return Xe=ge._init,De(he,ue,Xe(ge._payload),je)}if($(ge)||k(ge))return Xe!==null?null:He(he,ue,ge,je,null);cf(he,ge)}return null}function Ft(he,ue,ge,je,Xe){if(typeof je=="string"&&je!==""||typeof je=="number")return he=he.get(ge)||null,ae(ue,he,""+je,Xe);if(typeof je=="object"&&je!==null){switch(je.$$typeof){case u:return he=he.get(je.key===null?ge:je.key)||null,pe(ue,he,je,Xe);case f:return he=he.get(je.key===null?ge:je.key)||null,ke(ue,he,je,Xe);case d:var st=je._init;return Ft(he,ue,ge,st(je._payload),Xe)}if($(je)||k(je))return he=he.get(ge)||null,He(ue,he,je,Xe,null);cf(ue,je)}return null}function At(he,ue,ge,je){for(var Xe=null,st=null,at=ue,_t=ue=0,wr=null;at!==null&&_t<ge.length;_t++){at.index>_t?(wr=at,at=null):wr=at.sibling;var wt=De(he,at,ge[_t],je);if(wt===null){at===null&&(at=wr);break}s&&at&&wt.alternate===null&&c(he,at),ue=V(wt,ue,_t),st===null?Xe=wt:st.sibling=wt,st=wt,at=wr}if(_t===ge.length)return T(he,at),Ht&&Mo(he,_t),Xe;if(at===null){for(;_t<ge.length;_t++)at=it(he,ge[_t],je),at!==null&&(ue=V(at,ue,_t),st===null?Xe=at:st.sibling=at,st=at);return Ht&&Mo(he,_t),Xe}for(at=N(he,at);_t<ge.length;_t++)wr=Ft(at,he,_t,ge[_t],je),wr!==null&&(s&&wr.alternate!==null&&at.delete(wr.key===null?_t:wr.key),ue=V(wr,ue,_t),st===null?Xe=wr:st.sibling=wr,st=wr);return s&&at.forEach(function(Ba){return c(he,Ba)}),Ht&&Mo(he,_t),Xe}function ln(he,ue,ge,je){var Xe=k(ge);if(typeof Xe!="function")throw Error(o(150));if(ge=Xe.call(ge),ge==null)throw Error(o(151));for(var st=Xe=null,at=ue,_t=ue=0,wr=null,wt=ge.next();at!==null&&!wt.done;_t++,wt=ge.next()){at.index>_t?(wr=at,at=null):wr=at.sibling;var Ba=De(he,at,wt.value,je);if(Ba===null){at===null&&(at=wr);break}s&&at&&Ba.alternate===null&&c(he,at),ue=V(Ba,ue,_t),st===null?Xe=Ba:st.sibling=Ba,st=Ba,at=wr}if(wt.done)return T(he,at),Ht&&Mo(he,_t),Xe;if(at===null){for(;!wt.done;_t++,wt=ge.next())wt=it(he,wt.value,je),wt!==null&&(ue=V(wt,ue,_t),st===null?Xe=wt:st.sibling=wt,st=wt);return Ht&&Mo(he,_t),Xe}for(at=N(he,at);!wt.done;_t++,wt=ge.next())wt=Ft(at,he,_t,wt.value,je),wt!==null&&(s&&wt.alternate!==null&&at.delete(wt.key===null?_t:wt.key),ue=V(wt,ue,_t),st===null?Xe=wt:st.sibling=wt,st=wt);return s&&at.forEach(function(SE){return c(he,SE)}),Ht&&Mo(he,_t),Xe}function na(he,ue,ge,je){if(typeof ge=="object"&&ge!==null&&ge.type===h&&ge.key===null&&(ge=ge.props.children),typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case u:e:{for(var Xe=ge.key,st=ue;st!==null;){if(st.key===Xe){if(Xe=ge.type,Xe===h){if(st.tag===7){T(he,st.sibling),ue=j(st,ge.props.children),ue.return=he,he=ue;break e}}else if(st.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===d&&j2(Xe)===st.type){T(he,st.sibling),ue=j(st,ge.props),ue.ref=lu(he,st,ge),ue.return=he,he=ue;break e}T(he,st);break}else c(he,st);st=st.sibling}ge.type===h?(ue=zo(ge.props.children,he.mode,je,ge.key),ue.return=he,he=ue):(je=Uf(ge.type,ge.key,ge.props,null,he.mode,je),je.ref=lu(he,ue,ge),je.return=he,he=je)}return J(he);case f:e:{for(st=ge.key;ue!==null;){if(ue.key===st)if(ue.tag===4&&ue.stateNode.containerInfo===ge.containerInfo&&ue.stateNode.implementation===ge.implementation){T(he,ue.sibling),ue=j(ue,ge.children||[]),ue.return=he,he=ue;break e}else{T(he,ue);break}else c(he,ue);ue=ue.sibling}ue=c1(ge,he.mode,je),ue.return=he,he=ue}return J(he);case d:return st=ge._init,na(he,ue,st(ge._payload),je)}if($(ge))return At(he,ue,ge,je);if(k(ge))return ln(he,ue,ge,je);cf(he,ge)}return typeof ge=="string"&&ge!==""||typeof ge=="number"?(ge=""+ge,ue!==null&&ue.tag===6?(T(he,ue.sibling),ue=j(ue,ge),ue.return=he,he=ue):(T(he,ue),ue=u1(ge,he.mode,je),ue.return=he,he=ue),J(he)):T(he,ue)}return na}var Nl=F2(!0),z2=F2(!1),ff=Ra(null),df=null,Il=null,g0=null;function v0(){g0=Il=df=null}function B2(s,c,T){Q?(Lt(ff,c._currentValue),c._currentValue=T):(Lt(ff,c._currentValue2),c._currentValue2=T)}function m0(s){var c=ff.current;jt(ff),Q?s._currentValue=c:s._currentValue2=c}function y0(s,c,T){for(;s!==null;){var N=s.alternate;if((s.childLanes&c)!==c?(s.childLanes|=c,N!==null&&(N.childLanes|=c)):N!==null&&(N.childLanes&c)!==c&&(N.childLanes|=c),s===T)break;s=s.return}}function Dl(s,c){df=s,g0=Il=null,s=s.dependencies,s!==null&&s.firstContext!==null&&(s.lanes&c&&(nn=!0),s.firstContext=null)}function jn(s){var c=Q?s._currentValue:s._currentValue2;if(g0!==s)if(s={context:s,memoizedValue:c,next:null},Il===null){if(df===null)throw Error(o(308));Il=s,df.dependencies={lanes:0,firstContext:s}}else Il=Il.next=s;return c}var Lo=null;function b0(s){Lo===null?Lo=[s]:Lo.push(s)}function U2(s,c,T,N){var j=c.interleaved;return j===null?(T.next=T,b0(c)):(T.next=j.next,j.next=T),c.interleaved=T,Pi(s,N)}function Pi(s,c){s.lanes|=c;var T=s.alternate;for(T!==null&&(T.lanes|=c),T=s,s=s.return;s!==null;)s.childLanes|=c,T=s.alternate,T!==null&&(T.childLanes|=c),T=s,s=s.return;return T.tag===3?T.stateNode:null}var La=!1;function _0(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function H2(s,c){s=s.updateQueue,c.updateQueue===s&&(c.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function ea(s,c){return{eventTime:s,lane:c,tag:0,payload:null,callback:null,next:null}}function Na(s,c,T){var N=s.updateQueue;if(N===null)return null;if(N=N.shared,dt&2){var j=N.pending;return j===null?c.next=c:(c.next=j.next,j.next=c),N.pending=c,Pi(s,T)}return j=N.interleaved,j===null?(c.next=c,b0(N)):(c.next=j.next,j.next=c),N.interleaved=c,Pi(s,T)}function hf(s,c,T){if(c=c.updateQueue,c!==null&&(c=c.shared,(T&4194240)!==0)){var N=c.lanes;N&=s.pendingLanes,T|=N,c.lanes=T,a0(s,T)}}function $2(s,c){var T=s.updateQueue,N=s.alternate;if(N!==null&&(N=N.updateQueue,T===N)){var j=null,V=null;if(T=T.firstBaseUpdate,T!==null){do{var J={eventTime:T.eventTime,lane:T.lane,tag:T.tag,payload:T.payload,callback:T.callback,next:null};V===null?j=V=J:V=V.next=J,T=T.next}while(T!==null);V===null?j=V=c:V=V.next=c}else j=V=c;T={baseState:N.baseState,firstBaseUpdate:j,lastBaseUpdate:V,shared:N.shared,effects:N.effects},s.updateQueue=T;return}s=T.lastBaseUpdate,s===null?T.firstBaseUpdate=c:s.next=c,T.lastBaseUpdate=c}function pf(s,c,T,N){var j=s.updateQueue;La=!1;var V=j.firstBaseUpdate,J=j.lastBaseUpdate,ae=j.shared.pending;if(ae!==null){j.shared.pending=null;var pe=ae,ke=pe.next;pe.next=null,J===null?V=ke:J.next=ke,J=pe;var He=s.alternate;He!==null&&(He=He.updateQueue,ae=He.lastBaseUpdate,ae!==J&&(ae===null?He.firstBaseUpdate=ke:ae.next=ke,He.lastBaseUpdate=pe))}if(V!==null){var it=j.baseState;J=0,He=ke=pe=null,ae=V;do{var De=ae.lane,Ft=ae.eventTime;if((N&De)===De){He!==null&&(He=He.next={eventTime:Ft,lane:0,tag:ae.tag,payload:ae.payload,callback:ae.callback,next:null});e:{var At=s,ln=ae;switch(De=c,Ft=T,ln.tag){case 1:if(At=ln.payload,typeof At=="function"){it=At.call(Ft,it,De);break e}it=At;break e;case 3:At.flags=At.flags&-65537|128;case 0:if(At=ln.payload,De=typeof At=="function"?At.call(Ft,it,De):At,De==null)break e;it=a({},it,De);break e;case 2:La=!0}}ae.callback!==null&&ae.lane!==0&&(s.flags|=64,De=j.effects,De===null?j.effects=[ae]:De.push(ae))}else Ft={eventTime:Ft,lane:De,tag:ae.tag,payload:ae.payload,callback:ae.callback,next:null},He===null?(ke=He=Ft,pe=it):He=He.next=Ft,J|=De;if(ae=ae.next,ae===null){if(ae=j.shared.pending,ae===null)break;De=ae,ae=De.next,De.next=null,j.lastBaseUpdate=De,j.shared.pending=null}}while(!0);if(He===null&&(pe=it),j.baseState=pe,j.firstBaseUpdate=ke,j.lastBaseUpdate=He,c=j.shared.interleaved,c!==null){j=c;do J|=j.lane,j=j.next;while(j!==c)}else V===null&&(j.shared.lanes=0);Io|=J,s.lanes=J,s.memoizedState=it}}function G2(s,c,T){if(s=c.effects,c.effects=null,s!==null)for(c=0;c<s.length;c++){var N=s[c],j=N.callback;if(j!==null){if(N.callback=null,N=T,typeof j!="function")throw Error(o(191,j));j.call(N)}}}var su={},Fn=Ra(su),uu=Ra(su),jl=Ra(su);function Ci(s){if(s===su)throw Error(o(174));return s}function w0(s,c){Lt(jl,c),Lt(uu,s),Lt(Fn,su),s=q(c),jt(Fn),Lt(Fn,s)}function Fl(){jt(Fn),jt(uu),jt(jl)}function V2(s){var c=Ci(jl.current),T=Ci(Fn.current);c=z(T,s.type,c),T!==c&&(Lt(uu,s),Lt(Fn,c))}function S0(s){uu.current===s&&(jt(Fn),jt(uu))}var qt=Ra(0);function gf(s){for(var c=s;c!==null;){if(c.tag===13){var T=c.memoizedState;if(T!==null&&(T=T.dehydrated,T===null||Qn(T)||Rn(T)))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===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var E0=[];function O0(){for(var s=0;s<E0.length;s++){var c=E0[s];Q?c._workInProgressVersionPrimary=null:c._workInProgressVersionSecondary=null}E0.length=0}var vf=l.ReactCurrentDispatcher,x0=l.ReactCurrentBatchConfig,No=0,Wt=null,sr=null,br=null,mf=!1,cu=!1,fu=0,WS=0;function Nr(){throw Error(o(321))}function P0(s,c){if(c===null)return!1;for(var T=0;T<c.length&&T<s.length;T++)if(!ei(s[T],c[T]))return!1;return!0}function C0(s,c,T,N,j,V){if(No=V,Wt=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,vf.current=s===null||s.memoizedState===null?ZS:QS,s=T(N,j),cu){V=0;do{if(cu=!1,fu=0,25<=V)throw Error(o(301));V+=1,br=sr=null,c.updateQueue=null,vf.current=JS,s=T(N,j)}while(cu)}if(vf.current=_f,c=sr!==null&&sr.next!==null,No=0,br=sr=Wt=null,mf=!1,c)throw Error(o(300));return s}function k0(){var s=fu!==0;return fu=0,s}function ki(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return br===null?Wt.memoizedState=br=s:br=br.next=s,br}function zn(){if(sr===null){var s=Wt.alternate;s=s!==null?s.memoizedState:null}else s=sr.next;var c=br===null?Wt.memoizedState:br.next;if(c!==null)br=c,sr=s;else{if(s===null)throw Error(o(310));sr=s,s={memoizedState:sr.memoizedState,baseState:sr.baseState,baseQueue:sr.baseQueue,queue:sr.queue,next:null},br===null?Wt.memoizedState=br=s:br=br.next=s}return br}function du(s,c){return typeof c=="function"?c(s):c}function T0(s){var c=zn(),T=c.queue;if(T===null)throw Error(o(311));T.lastRenderedReducer=s;var N=sr,j=N.baseQueue,V=T.pending;if(V!==null){if(j!==null){var J=j.next;j.next=V.next,V.next=J}N.baseQueue=j=V,T.pending=null}if(j!==null){V=j.next,N=N.baseState;var ae=J=null,pe=null,ke=V;do{var He=ke.lane;if((No&He)===He)pe!==null&&(pe=pe.next={lane:0,action:ke.action,hasEagerState:ke.hasEagerState,eagerState:ke.eagerState,next:null}),N=ke.hasEagerState?ke.eagerState:s(N,ke.action);else{var it={lane:He,action:ke.action,hasEagerState:ke.hasEagerState,eagerState:ke.eagerState,next:null};pe===null?(ae=pe=it,J=N):pe=pe.next=it,Wt.lanes|=He,Io|=He}ke=ke.next}while(ke!==null&&ke!==V);pe===null?J=N:pe.next=ae,ei(N,c.memoizedState)||(nn=!0),c.memoizedState=N,c.baseState=J,c.baseQueue=pe,T.lastRenderedState=N}if(s=T.interleaved,s!==null){j=s;do V=j.lane,Wt.lanes|=V,Io|=V,j=j.next;while(j!==s)}else j===null&&(T.lanes=0);return[c.memoizedState,T.dispatch]}function A0(s){var c=zn(),T=c.queue;if(T===null)throw Error(o(311));T.lastRenderedReducer=s;var N=T.dispatch,j=T.pending,V=c.memoizedState;if(j!==null){T.pending=null;var J=j=j.next;do V=s(V,J.action),J=J.next;while(J!==j);ei(V,c.memoizedState)||(nn=!0),c.memoizedState=V,c.baseQueue===null&&(c.baseState=V),T.lastRenderedState=V}return[V,N]}function q2(){}function W2(s,c){var T=Wt,N=zn(),j=c(),V=!ei(N.memoizedState,j);if(V&&(N.memoizedState=j,nn=!0),N=N.queue,R0(X2.bind(null,T,N,s),[s]),N.getSnapshot!==c||V||br!==null&&br.memoizedState.tag&1){if(T.flags|=2048,hu(9,Y2.bind(null,T,N,j,c),void 0,null),_r===null)throw Error(o(349));No&30||K2(T,c,j)}return j}function K2(s,c,T){s.flags|=16384,s={getSnapshot:c,value:T},c=Wt.updateQueue,c===null?(c={lastEffect:null,stores:null},Wt.updateQueue=c,c.stores=[s]):(T=c.stores,T===null?c.stores=[s]:T.push(s))}function Y2(s,c,T,N){c.value=T,c.getSnapshot=N,Z2(c)&&Q2(s)}function X2(s,c,T){return T(function(){Z2(c)&&Q2(s)})}function Z2(s){var c=s.getSnapshot;s=s.value;try{var T=c();return!ei(s,T)}catch{return!0}}function Q2(s){var c=Pi(s,1);c!==null&&Bn(c,s,1,-1)}function J2(s){var c=ki();return typeof s=="function"&&(s=s()),c.memoizedState=c.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:du,lastRenderedState:s},c.queue=s,s=s.dispatch=XS.bind(null,Wt,s),[c.memoizedState,s]}function hu(s,c,T,N){return s={tag:s,create:c,destroy:T,deps:N,next:null},c=Wt.updateQueue,c===null?(c={lastEffect:null,stores:null},Wt.updateQueue=c,c.lastEffect=s.next=s):(T=c.lastEffect,T===null?c.lastEffect=s.next=s:(N=T.next,T.next=s,s.next=N,c.lastEffect=s)),s}function eb(){return zn().memoizedState}function yf(s,c,T,N){var j=ki();Wt.flags|=s,j.memoizedState=hu(1|c,T,void 0,N===void 0?null:N)}function bf(s,c,T,N){var j=zn();N=N===void 0?null:N;var V=void 0;if(sr!==null){var J=sr.memoizedState;if(V=J.destroy,N!==null&&P0(N,J.deps)){j.memoizedState=hu(c,T,V,N);return}}Wt.flags|=s,j.memoizedState=hu(1|c,T,V,N)}function tb(s,c){return yf(8390656,8,s,c)}function R0(s,c){return bf(2048,8,s,c)}function rb(s,c){return bf(4,2,s,c)}function nb(s,c){return bf(4,4,s,c)}function ib(s,c){if(typeof c=="function")return s=s(),c(s),function(){c(null)};if(c!=null)return s=s(),c.current=s,function(){c.current=null}}function ab(s,c,T){return T=T!=null?T.concat([s]):null,bf(4,4,ib.bind(null,c,s),T)}function M0(){}function ob(s,c){var T=zn();c=c===void 0?null:c;var N=T.memoizedState;return N!==null&&c!==null&&P0(c,N[1])?N[0]:(T.memoizedState=[s,c],s)}function lb(s,c){var T=zn();c=c===void 0?null:c;var N=T.memoizedState;return N!==null&&c!==null&&P0(c,N[1])?N[0]:(s=s(),T.memoizedState=[s,c],s)}function sb(s,c,T){return No&21?(ei(T,c)||(T=k2(),Wt.lanes|=T,Io|=T,s.baseState=!0),c):(s.baseState&&(s.baseState=!1,nn=!0),s.memoizedState=T)}function KS(s,c){var T=bt;bt=T!==0&&4>T?T:4,s(!0);var N=x0.transition;x0.transition={};try{s(!1),c()}finally{bt=T,x0.transition=N}}function ub(){return zn().memoizedState}function YS(s,c,T){var N=ja(s);if(T={lane:N,action:T,hasEagerState:!1,eagerState:null,next:null},cb(s))fb(c,T);else if(T=U2(s,c,T,N),T!==null){var j=jr();Bn(T,s,N,j),db(T,c,N)}}function XS(s,c,T){var N=ja(s),j={lane:N,action:T,hasEagerState:!1,eagerState:null,next:null};if(cb(s))fb(c,j);else{var V=s.alternate;if(s.lanes===0&&(V===null||V.lanes===0)&&(V=c.lastRenderedReducer,V!==null))try{var J=c.lastRenderedState,ae=V(J,T);if(j.hasEagerState=!0,j.eagerState=ae,ei(ae,J)){var pe=c.interleaved;pe===null?(j.next=j,b0(c)):(j.next=pe.next,pe.next=j),c.interleaved=j;return}}catch{}finally{}T=U2(s,c,j,N),T!==null&&(j=jr(),Bn(T,s,N,j),db(T,c,N))}}function cb(s){var c=s.alternate;return s===Wt||c!==null&&c===Wt}function fb(s,c){cu=mf=!0;var T=s.pending;T===null?c.next=c:(c.next=T.next,T.next=c),s.pending=c}function db(s,c,T){if(T&4194240){var N=c.lanes;N&=s.pendingLanes,T|=N,c.lanes=T,a0(s,T)}}var _f={readContext:jn,useCallback:Nr,useContext:Nr,useEffect:Nr,useImperativeHandle:Nr,useInsertionEffect:Nr,useLayoutEffect:Nr,useMemo:Nr,useReducer:Nr,useRef:Nr,useState:Nr,useDebugValue:Nr,useDeferredValue:Nr,useTransition:Nr,useMutableSource:Nr,useSyncExternalStore:Nr,useId:Nr,unstable_isNewReconciler:!1},ZS={readContext:jn,useCallback:function(s,c){return ki().memoizedState=[s,c===void 0?null:c],s},useContext:jn,useEffect:tb,useImperativeHandle:function(s,c,T){return T=T!=null?T.concat([s]):null,yf(4194308,4,ib.bind(null,c,s),T)},useLayoutEffect:function(s,c){return yf(4194308,4,s,c)},useInsertionEffect:function(s,c){return yf(4,2,s,c)},useMemo:function(s,c){var T=ki();return c=c===void 0?null:c,s=s(),T.memoizedState=[s,c],s},useReducer:function(s,c,T){var N=ki();return c=T!==void 0?T(c):c,N.memoizedState=N.baseState=c,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:c},N.queue=s,s=s.dispatch=YS.bind(null,Wt,s),[N.memoizedState,s]},useRef:function(s){var c=ki();return s={current:s},c.memoizedState=s},useState:J2,useDebugValue:M0,useDeferredValue:function(s){return ki().memoizedState=s},useTransition:function(){var s=J2(!1),c=s[0];return s=KS.bind(null,s[1]),ki().memoizedState=s,[c,s]},useMutableSource:function(){},useSyncExternalStore:function(s,c,T){var N=Wt,j=ki();if(Ht){if(T===void 0)throw Error(o(407));T=T()}else{if(T=c(),_r===null)throw Error(o(349));No&30||K2(N,c,T)}j.memoizedState=T;var V={value:T,getSnapshot:c};return j.queue=V,tb(X2.bind(null,N,V,s),[s]),N.flags|=2048,hu(9,Y2.bind(null,N,V,T,c),void 0,null),T},useId:function(){var s=ki(),c=_r.identifierPrefix;if(Ht){var T=Ji,N=Qi;T=(N&~(1<<32-Jn(N)-1)).toString(32)+T,c=":"+c+"R"+T,T=fu++,0<T&&(c+="H"+T.toString(32)),c+=":"}else T=WS++,c=":"+c+"r"+T.toString(32)+":";return s.memoizedState=c},unstable_isNewReconciler:!1},QS={readContext:jn,useCallback:ob,useContext:jn,useEffect:R0,useImperativeHandle:ab,useInsertionEffect:rb,useLayoutEffect:nb,useMemo:lb,useReducer:T0,useRef:eb,useState:function(){return T0(du)},useDebugValue:M0,useDeferredValue:function(s){var c=zn();return sb(c,sr.memoizedState,s)},useTransition:function(){var s=T0(du)[0],c=zn().memoizedState;return[s,c]},useMutableSource:q2,useSyncExternalStore:W2,useId:ub,unstable_isNewReconciler:!1},JS={readContext:jn,useCallback:ob,useContext:jn,useEffect:R0,useImperativeHandle:ab,useInsertionEffect:rb,useLayoutEffect:nb,useMemo:lb,useReducer:A0,useRef:eb,useState:function(){return A0(du)},useDebugValue:M0,useDeferredValue:function(s){var c=zn();return sr===null?c.memoizedState=s:sb(c,sr.memoizedState,s)},useTransition:function(){var s=A0(du)[0],c=zn().memoizedState;return[s,c]},useMutableSource:q2,useSyncExternalStore:W2,useId:ub,unstable_isNewReconciler:!1};function ri(s,c){if(s&&s.defaultProps){c=a({},c),s=s.defaultProps;for(var T in s)c[T]===void 0&&(c[T]=s[T]);return c}return c}function L0(s,c,T,N){c=s.memoizedState,T=T(N,c),T=T==null?c:a({},c,T),s.memoizedState=T,s.lanes===0&&(s.updateQueue.baseState=T)}var wf={isMounted:function(s){return(s=s._reactInternals)?O(s)===s:!1},enqueueSetState:function(s,c,T){s=s._reactInternals;var N=jr(),j=ja(s),V=ea(N,j);V.payload=c,T!=null&&(V.callback=T),c=Na(s,V,j),c!==null&&(Bn(c,s,j,N),hf(c,s,j))},enqueueReplaceState:function(s,c,T){s=s._reactInternals;var N=jr(),j=ja(s),V=ea(N,j);V.tag=1,V.payload=c,T!=null&&(V.callback=T),c=Na(s,V,j),c!==null&&(Bn(c,s,j,N),hf(c,s,j))},enqueueForceUpdate:function(s,c){s=s._reactInternals;var T=jr(),N=ja(s),j=ea(T,N);j.tag=2,c!=null&&(j.callback=c),c=Na(s,j,N),c!==null&&(Bn(c,s,N,T),hf(c,s,N))}};function hb(s,c,T,N,j,V,J){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(N,V,J):c.prototype&&c.prototype.isPureReactComponent?!uf(T,N)||!uf(j,V):!0}function pb(s,c,T){var N=!1,j=Ma,V=c.contextType;return typeof V=="object"&&V!==null?V=jn(V):(j=rn(c)?Ao:Lr.current,N=c.contextTypes,V=(N=N!=null)?Al(s,j):Ma),c=new c(T,V),s.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=wf,s.stateNode=c,c._reactInternals=s,N&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=j,s.__reactInternalMemoizedMaskedChildContext=V),c}function gb(s,c,T,N){s=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(T,N),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(T,N),c.state!==s&&wf.enqueueReplaceState(c,c.state,null)}function N0(s,c,T,N){var j=s.stateNode;j.props=T,j.state=s.memoizedState,j.refs={},_0(s);var V=c.contextType;typeof V=="object"&&V!==null?j.context=jn(V):(V=rn(c)?Ao:Lr.current,j.context=Al(s,V)),j.state=s.memoizedState,V=c.getDerivedStateFromProps,typeof V=="function"&&(L0(s,c,V,T),j.state=s.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&&wf.enqueueReplaceState(j,j.state,null),pf(s,T,j,N),j.state=s.memoizedState),typeof j.componentDidMount=="function"&&(s.flags|=4194308)}function zl(s,c){try{var T="",N=c;do T+=qS(N),N=N.return;while(N);var j=T}catch(V){j=`
56
+ Error generating stack: `+V.message+`
57
+ `+V.stack}return{value:s,source:c,stack:j,digest:null}}function I0(s,c,T){return{value:s,source:null,stack:T??null,digest:c??null}}function D0(s,c){try{console.error(c.value)}catch(T){setTimeout(function(){throw T})}}var eE=typeof WeakMap=="function"?WeakMap:Map;function vb(s,c,T){T=ea(-1,T),T.tag=3,T.payload={element:null};var N=c.value;return T.callback=function(){If||(If=!0,r1=N),D0(s,c)},T}function mb(s,c,T){T=ea(-1,T),T.tag=3;var N=s.type.getDerivedStateFromError;if(typeof N=="function"){var j=c.value;T.payload=function(){return N(j)},T.callback=function(){D0(s,c)}}var V=s.stateNode;return V!==null&&typeof V.componentDidCatch=="function"&&(T.callback=function(){D0(s,c),typeof N!="function"&&(Ia===null?Ia=new Set([this]):Ia.add(this));var J=c.stack;this.componentDidCatch(c.value,{componentStack:J!==null?J:""})}),T}function yb(s,c,T){var N=s.pingCache;if(N===null){N=s.pingCache=new eE;var j=new Set;N.set(c,j)}else j=N.get(c),j===void 0&&(j=new Set,N.set(c,j));j.has(T)||(j.add(T),s=pE.bind(null,s,c,T),c.then(s,s))}function bb(s){do{var c;if((c=s.tag===13)&&(c=s.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return s;s=s.return}while(s!==null);return null}function _b(s,c,T,N,j){return s.mode&1?(s.flags|=65536,s.lanes=j,s):(s===c?s.flags|=65536:(s.flags|=128,T.flags|=131072,T.flags&=-52805,T.tag===1&&(T.alternate===null?T.tag=17:(c=ea(-1,1),c.tag=2,Na(T,c,1))),T.lanes|=1),s)}var tE=l.ReactCurrentOwner,nn=!1;function Gr(s,c,T,N){c.child=s===null?z2(c,null,T,N):Nl(c,s.child,T,N)}function wb(s,c,T,N,j){T=T.render;var V=c.ref;return Dl(c,j),N=C0(s,c,T,N,V,j),T=k0(),s!==null&&!nn?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~j,ta(s,c,j)):(Ht&&T&&c0(c),c.flags|=1,Gr(s,c,N,j),c.child)}function Sb(s,c,T,N,j){if(s===null){var V=T.type;return typeof V=="function"&&!s1(V)&&V.defaultProps===void 0&&T.compare===null&&T.defaultProps===void 0?(c.tag=15,c.type=V,Eb(s,c,V,N,j)):(s=Uf(T.type,null,N,c,c.mode,j),s.ref=c.ref,s.return=c,c.child=s)}if(V=s.child,!(s.lanes&j)){var J=V.memoizedProps;if(T=T.compare,T=T!==null?T:uf,T(J,N)&&s.ref===c.ref)return ta(s,c,j)}return c.flags|=1,s=za(V,N),s.ref=c.ref,s.return=c,c.child=s}function Eb(s,c,T,N,j){if(s!==null){var V=s.memoizedProps;if(uf(V,N)&&s.ref===c.ref)if(nn=!1,c.pendingProps=N=V,(s.lanes&j)!==0)s.flags&131072&&(nn=!0);else return c.lanes=s.lanes,ta(s,c,j)}return j0(s,c,T,N,j)}function Ob(s,c,T){var N=c.pendingProps,j=N.children,V=s!==null?s.memoizedState:null;if(N.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Lt(Ul,_n),_n|=T;else{if(!(T&1073741824))return s=V!==null?V.baseLanes|T:T,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:s,cachePool:null,transitions:null},c.updateQueue=null,Lt(Ul,_n),_n|=s,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},N=V!==null?V.baseLanes:T,Lt(Ul,_n),_n|=N}else V!==null?(N=V.baseLanes|T,c.memoizedState=null):N=T,Lt(Ul,_n),_n|=N;return Gr(s,c,j,T),c.child}function xb(s,c){var T=c.ref;(s===null&&T!==null||s!==null&&s.ref!==T)&&(c.flags|=512,c.flags|=2097152)}function j0(s,c,T,N,j){var V=rn(T)?Ao:Lr.current;return V=Al(c,V),Dl(c,j),T=C0(s,c,T,N,V,j),N=k0(),s!==null&&!nn?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~j,ta(s,c,j)):(Ht&&N&&c0(c),c.flags|=1,Gr(s,c,T,j),c.child)}function Pb(s,c,T,N,j){if(rn(T)){var V=!0;Jc(c)}else V=!1;if(Dl(c,j),c.stateNode===null)Ef(s,c),pb(c,T,N),N0(c,T,N,j),N=!0;else if(s===null){var J=c.stateNode,ae=c.memoizedProps;J.props=ae;var pe=J.context,ke=T.contextType;typeof ke=="object"&&ke!==null?ke=jn(ke):(ke=rn(T)?Ao:Lr.current,ke=Al(c,ke));var He=T.getDerivedStateFromProps,it=typeof He=="function"||typeof J.getSnapshotBeforeUpdate=="function";it||typeof J.UNSAFE_componentWillReceiveProps!="function"&&typeof J.componentWillReceiveProps!="function"||(ae!==N||pe!==ke)&&gb(c,J,N,ke),La=!1;var De=c.memoizedState;J.state=De,pf(c,N,J,j),pe=c.memoizedState,ae!==N||De!==pe||tn.current||La?(typeof He=="function"&&(L0(c,T,He,N),pe=c.memoizedState),(ae=La||hb(c,T,ae,N,De,pe,ke))?(it||typeof J.UNSAFE_componentWillMount!="function"&&typeof J.componentWillMount!="function"||(typeof J.componentWillMount=="function"&&J.componentWillMount(),typeof J.UNSAFE_componentWillMount=="function"&&J.UNSAFE_componentWillMount()),typeof J.componentDidMount=="function"&&(c.flags|=4194308)):(typeof J.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=N,c.memoizedState=pe),J.props=N,J.state=pe,J.context=ke,N=ae):(typeof J.componentDidMount=="function"&&(c.flags|=4194308),N=!1)}else{J=c.stateNode,H2(s,c),ae=c.memoizedProps,ke=c.type===c.elementType?ae:ri(c.type,ae),J.props=ke,it=c.pendingProps,De=J.context,pe=T.contextType,typeof pe=="object"&&pe!==null?pe=jn(pe):(pe=rn(T)?Ao:Lr.current,pe=Al(c,pe));var Ft=T.getDerivedStateFromProps;(He=typeof Ft=="function"||typeof J.getSnapshotBeforeUpdate=="function")||typeof J.UNSAFE_componentWillReceiveProps!="function"&&typeof J.componentWillReceiveProps!="function"||(ae!==it||De!==pe)&&gb(c,J,N,pe),La=!1,De=c.memoizedState,J.state=De,pf(c,N,J,j);var At=c.memoizedState;ae!==it||De!==At||tn.current||La?(typeof Ft=="function"&&(L0(c,T,Ft,N),At=c.memoizedState),(ke=La||hb(c,T,ke,N,De,At,pe)||!1)?(He||typeof J.UNSAFE_componentWillUpdate!="function"&&typeof J.componentWillUpdate!="function"||(typeof J.componentWillUpdate=="function"&&J.componentWillUpdate(N,At,pe),typeof J.UNSAFE_componentWillUpdate=="function"&&J.UNSAFE_componentWillUpdate(N,At,pe)),typeof J.componentDidUpdate=="function"&&(c.flags|=4),typeof J.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof J.componentDidUpdate!="function"||ae===s.memoizedProps&&De===s.memoizedState||(c.flags|=4),typeof J.getSnapshotBeforeUpdate!="function"||ae===s.memoizedProps&&De===s.memoizedState||(c.flags|=1024),c.memoizedProps=N,c.memoizedState=At),J.props=N,J.state=At,J.context=pe,N=ke):(typeof J.componentDidUpdate!="function"||ae===s.memoizedProps&&De===s.memoizedState||(c.flags|=4),typeof J.getSnapshotBeforeUpdate!="function"||ae===s.memoizedProps&&De===s.memoizedState||(c.flags|=1024),N=!1)}return F0(s,c,T,N,V,j)}function F0(s,c,T,N,j,V){xb(s,c);var J=(c.flags&128)!==0;if(!N&&!J)return j&&C2(c,T,!1),ta(s,c,V);N=c.stateNode,tE.current=c;var ae=J&&typeof T.getDerivedStateFromError!="function"?null:N.render();return c.flags|=1,s!==null&&J?(c.child=Nl(c,s.child,null,V),c.child=Nl(c,null,ae,V)):Gr(s,c,ae,V),c.memoizedState=N.state,j&&C2(c,T,!0),c.child}function Cb(s){var c=s.stateNode;c.pendingContext?x2(s,c.pendingContext,c.pendingContext!==c.context):c.context&&x2(s,c.context,!1),w0(s,c.containerInfo)}function kb(s,c,T,N,j){return Ll(),p0(j),c.flags|=256,Gr(s,c,T,N),c.child}var z0={dehydrated:null,treeContext:null,retryLane:0};function B0(s){return{baseLanes:s,cachePool:null,transitions:null}}function Tb(s,c,T){var N=c.pendingProps,j=qt.current,V=!1,J=(c.flags&128)!==0,ae;if((ae=J)||(ae=s!==null&&s.memoizedState===null?!1:(j&2)!==0),ae?(V=!0,c.flags&=-129):(s===null||s.memoizedState!==null)&&(j|=1),Lt(qt,j&1),s===null)return h0(c),s=c.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?(c.mode&1?Rn(s)?c.lanes=8:c.lanes=1073741824:c.lanes=1,null):(J=N.children,s=N.fallback,V?(N=c.mode,V=c.child,J={mode:"hidden",children:J},!(N&1)&&V!==null?(V.childLanes=0,V.pendingProps=J):V=Hf(J,N,0,null),s=zo(s,N,T,null),V.return=c,s.return=c,V.sibling=s,c.child=V,c.child.memoizedState=B0(T),c.memoizedState=z0,s):U0(c,J));if(j=s.memoizedState,j!==null&&(ae=j.dehydrated,ae!==null))return rE(s,c,J,N,ae,j,T);if(V){V=N.fallback,J=c.mode,j=s.child,ae=j.sibling;var pe={mode:"hidden",children:N.children};return!(J&1)&&c.child!==j?(N=c.child,N.childLanes=0,N.pendingProps=pe,c.deletions=null):(N=za(j,pe),N.subtreeFlags=j.subtreeFlags&14680064),ae!==null?V=za(ae,V):(V=zo(V,J,T,null),V.flags|=2),V.return=c,N.return=c,N.sibling=V,c.child=N,N=V,V=c.child,J=s.child.memoizedState,J=J===null?B0(T):{baseLanes:J.baseLanes|T,cachePool:null,transitions:J.transitions},V.memoizedState=J,V.childLanes=s.childLanes&~T,c.memoizedState=z0,N}return V=s.child,s=V.sibling,N=za(V,{mode:"visible",children:N.children}),!(c.mode&1)&&(N.lanes=T),N.return=c,N.sibling=null,s!==null&&(T=c.deletions,T===null?(c.deletions=[s],c.flags|=16):T.push(s)),c.child=N,c.memoizedState=null,N}function U0(s,c){return c=Hf({mode:"visible",children:c},s.mode,0,null),c.return=s,s.child=c}function Sf(s,c,T,N){return N!==null&&p0(N),Nl(c,s.child,null,T),s=U0(c,c.pendingProps.children),s.flags|=2,c.memoizedState=null,s}function rE(s,c,T,N,j,V,J){if(T)return c.flags&256?(c.flags&=-257,N=I0(Error(o(422))),Sf(s,c,J,N)):c.memoizedState!==null?(c.child=s.child,c.flags|=128,null):(V=N.fallback,j=c.mode,N=Hf({mode:"visible",children:N.children},j,0,null),V=zo(V,j,J,null),V.flags|=2,N.return=c,V.return=c,N.sibling=V,c.child=N,c.mode&1&&Nl(c,s.child,null,J),c.child.memoizedState=B0(J),c.memoizedState=z0,V);if(!(c.mode&1))return Sf(s,c,J,null);if(Rn(j))return N=Ne(j).digest,V=Error(o(419)),N=I0(V,N,void 0),Sf(s,c,J,N);if(T=(J&s.childLanes)!==0,nn||T){if(N=_r,N!==null){switch(J&-J){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&(N.suspendedLanes|J)?0:j,j!==0&&j!==V.retryLane&&(V.retryLane=j,Pi(s,j),Bn(N,s,j,-1))}return l1(),N=I0(Error(o(421))),Sf(s,c,J,N)}return Qn(j)?(c.flags|=128,c.child=s.child,c=gE.bind(null,s),tt(j,c),null):(s=V.treeContext,ie&&(Dn=Jr(j),bn=c,Ht=!0,ti=null,ou=!1,s!==null&&(Nn[In++]=Qi,Nn[In++]=Ji,Nn[In++]=Ro,Qi=s.id,Ji=s.overflow,Ro=c)),c=U0(c,N.children),c.flags|=4096,c)}function Ab(s,c,T){s.lanes|=c;var N=s.alternate;N!==null&&(N.lanes|=c),y0(s.return,c,T)}function H0(s,c,T,N,j){var V=s.memoizedState;V===null?s.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:N,tail:T,tailMode:j}:(V.isBackwards=c,V.rendering=null,V.renderingStartTime=0,V.last=N,V.tail=T,V.tailMode=j)}function Rb(s,c,T){var N=c.pendingProps,j=N.revealOrder,V=N.tail;if(Gr(s,c,N.children,T),N=qt.current,N&2)N=N&1|2,c.flags|=128;else{if(s!==null&&s.flags&128)e:for(s=c.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&Ab(s,T,c);else if(s.tag===19)Ab(s,T,c);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===c)break e;for(;s.sibling===null;){if(s.return===null||s.return===c)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}N&=1}if(Lt(qt,N),!(c.mode&1))c.memoizedState=null;else switch(j){case"forwards":for(T=c.child,j=null;T!==null;)s=T.alternate,s!==null&&gf(s)===null&&(j=T),T=T.sibling;T=j,T===null?(j=c.child,c.child=null):(j=T.sibling,T.sibling=null),H0(c,!1,j,T,V);break;case"backwards":for(T=null,j=c.child,c.child=null;j!==null;){if(s=j.alternate,s!==null&&gf(s)===null){c.child=j;break}s=j.sibling,j.sibling=T,T=j,j=s}H0(c,!0,T,null,V);break;case"together":H0(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Ef(s,c){!(c.mode&1)&&s!==null&&(s.alternate=null,c.alternate=null,c.flags|=2)}function ta(s,c,T){if(s!==null&&(c.dependencies=s.dependencies),Io|=c.lanes,!(T&c.childLanes))return null;if(s!==null&&c.child!==s.child)throw Error(o(153));if(c.child!==null){for(s=c.child,T=za(s,s.pendingProps),c.child=T,T.return=c;s.sibling!==null;)s=s.sibling,T=T.sibling=za(s,s.pendingProps),T.return=c;T.sibling=null}return c.child}function nE(s,c,T){switch(c.tag){case 3:Cb(c),Ll();break;case 5:V2(c);break;case 1:rn(c.type)&&Jc(c);break;case 4:w0(c,c.stateNode.containerInfo);break;case 10:B2(c,c.type._context,c.memoizedProps.value);break;case 13:var N=c.memoizedState;if(N!==null)return N.dehydrated!==null?(Lt(qt,qt.current&1),c.flags|=128,null):T&c.child.childLanes?Tb(s,c,T):(Lt(qt,qt.current&1),s=ta(s,c,T),s!==null?s.sibling:null);Lt(qt,qt.current&1);break;case 19:if(N=(T&c.childLanes)!==0,s.flags&128){if(N)return Rb(s,c,T);c.flags|=128}var j=c.memoizedState;if(j!==null&&(j.rendering=null,j.tail=null,j.lastEffect=null),Lt(qt,qt.current),N)break;return null;case 22:case 23:return c.lanes=0,Ob(s,c,T)}return ta(s,c,T)}function Ti(s){s.flags|=4}function Mb(s,c){if(s!==null&&s.child===c.child)return!0;if(c.flags&16)return!1;for(s=c.child;s!==null;){if(s.flags&12854||s.subtreeFlags&12854)return!1;s=s.sibling}return!0}var pu,gu,Of,xf;if(te)pu=function(s,c){for(var T=c.child;T!==null;){if(T.tag===5||T.tag===6)F(s,T.stateNode);else if(T.tag!==4&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===c)break;for(;T.sibling===null;){if(T.return===null||T.return===c)return;T=T.return}T.sibling.return=T.return,T=T.sibling}},gu=function(){},Of=function(s,c,T,N,j){if(s=s.memoizedProps,s!==N){var V=c.stateNode,J=Ci(Fn.current);T=H(V,T,s,N,j,J),(c.updateQueue=T)&&Ti(c)}},xf=function(s,c,T,N){T!==N&&Ti(c)};else if(ee){pu=function(s,c,T,N){for(var j=c.child;j!==null;){if(j.tag===5){var V=j.stateNode;T&&N&&(V=xt(V,j.type,j.memoizedProps,j)),F(s,V)}else if(j.tag===6)V=j.stateNode,T&&N&&(V=xr(V,j.memoizedProps,j)),F(s,V);else if(j.tag!==4){if(j.tag===22&&j.memoizedState!==null)V=j.child,V!==null&&(V.return=j),pu(s,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 Lb=function(s,c,T,N){for(var j=c.child;j!==null;){if(j.tag===5){var V=j.stateNode;T&&N&&(V=xt(V,j.type,j.memoizedProps,j)),ze(s,V)}else if(j.tag===6)V=j.stateNode,T&&N&&(V=xr(V,j.memoizedProps,j)),ze(s,V);else if(j.tag!==4){if(j.tag===22&&j.memoizedState!==null)V=j.child,V!==null&&(V.return=j),Lb(s,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}};gu=function(s,c){var T=c.stateNode;if(!Mb(s,c)){s=T.containerInfo;var N=xe(s);Lb(N,c,!1,!1),T.pendingChildren=N,Ti(c),rt(s,N)}},Of=function(s,c,T,N,j){var V=s.stateNode,J=s.memoizedProps;if((s=Mb(s,c))&&J===N)c.stateNode=V;else{var ae=c.stateNode,pe=Ci(Fn.current),ke=null;J!==N&&(ke=H(ae,T,J,N,j,pe)),s&&ke===null?c.stateNode=V:(V=lr(V,ke,T,J,N,c,s,ae),D(V,T,N,j,pe)&&Ti(c),c.stateNode=V,s?Ti(c):pu(V,c,!1,!1))}},xf=function(s,c,T,N){T!==N?(s=Ci(jl.current),T=Ci(Fn.current),c.stateNode=G(N,s,T,c),Ti(c)):c.stateNode=s.stateNode}}else gu=function(){},Of=function(){},xf=function(){};function vu(s,c){if(!Ht)switch(s.tailMode){case"hidden":c=s.tail;for(var T=null;c!==null;)c.alternate!==null&&(T=c),c=c.sibling;T===null?s.tail=null:T.sibling=null;break;case"collapsed":T=s.tail;for(var N=null;T!==null;)T.alternate!==null&&(N=T),T=T.sibling;N===null?c||s.tail===null?s.tail=null:s.tail.sibling=null:N.sibling=null}}function Ir(s){var c=s.alternate!==null&&s.alternate.child===s.child,T=0,N=0;if(c)for(var j=s.child;j!==null;)T|=j.lanes|j.childLanes,N|=j.subtreeFlags&14680064,N|=j.flags&14680064,j.return=s,j=j.sibling;else for(j=s.child;j!==null;)T|=j.lanes|j.childLanes,N|=j.subtreeFlags,N|=j.flags,j.return=s,j=j.sibling;return s.subtreeFlags|=N,s.childLanes=T,c}function iE(s,c,T){var N=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 Ir(c),null;case 1:return rn(c.type)&&Qc(),Ir(c),null;case 3:return T=c.stateNode,Fl(),jt(tn),jt(Lr),O0(),T.pendingContext&&(T.context=T.pendingContext,T.pendingContext=null),(s===null||s.child===null)&&(sf(c)?Ti(c):s===null||s.memoizedState.isDehydrated&&!(c.flags&256)||(c.flags|=1024,ti!==null&&(a1(ti),ti=null))),gu(s,c),Ir(c),null;case 5:S0(c),T=Ci(jl.current);var j=c.type;if(s!==null&&c.stateNode!=null)Of(s,c,j,N,T),s.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!N){if(c.stateNode===null)throw Error(o(166));return Ir(c),null}if(s=Ci(Fn.current),sf(c)){if(!ie)throw Error(o(175));s=$r(c.stateNode,c.type,c.memoizedProps,T,s,c,!ou),c.updateQueue=s,s!==null&&Ti(c)}else{var V=M(j,N,T,s,c);pu(V,c,!1,!1),c.stateNode=V,D(V,j,N,T,s)&&Ti(c)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return Ir(c),null;case 6:if(s&&c.stateNode!=null)xf(s,c,s.memoizedProps,N);else{if(typeof N!="string"&&c.stateNode===null)throw Error(o(166));if(s=Ci(jl.current),T=Ci(Fn.current),sf(c)){if(!ie)throw Error(o(176));if(s=c.stateNode,T=c.memoizedProps,(N=Ut(s,T,c,!ou))&&(j=bn,j!==null))switch(j.tag){case 3:Aa(j.stateNode.containerInfo,s,T,(j.mode&1)!==0);break;case 5:Zc(j.type,j.memoizedProps,j.stateNode,s,T,(j.mode&1)!==0)}N&&Ti(c)}else c.stateNode=G(N,s,T,c)}return Ir(c),null;case 13:if(jt(qt),N=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(Ht&&Dn!==null&&c.mode&1&&!(c.flags&128))D2(),Ll(),c.flags|=98560,j=!1;else if(j=sf(c),N!==null&&N.dehydrated!==null){if(s===null){if(!j)throw Error(o(318));if(!ie)throw Error(o(344));if(j=c.memoizedState,j=j!==null?j.dehydrated:null,!j)throw Error(o(317));en(j,c)}else Ll(),!(c.flags&128)&&(c.memoizedState=null),c.flags|=4;Ir(c),j=!1}else ti!==null&&(a1(ti),ti=null),j=!0;if(!j)return c.flags&65536?c:null}return c.flags&128?(c.lanes=T,c):(T=N!==null,T!==(s!==null&&s.memoizedState!==null)&&T&&(c.child.flags|=8192,c.mode&1&&(s===null||qt.current&1?ur===0&&(ur=3):l1())),c.updateQueue!==null&&(c.flags|=4),Ir(c),null);case 4:return Fl(),gu(s,c),s===null&&le(c.stateNode.containerInfo),Ir(c),null;case 10:return m0(c.type._context),Ir(c),null;case 17:return rn(c.type)&&Qc(),Ir(c),null;case 19:if(jt(qt),j=c.memoizedState,j===null)return Ir(c),null;if(N=(c.flags&128)!==0,V=j.rendering,V===null)if(N)vu(j,!1);else{if(ur!==0||s!==null&&s.flags&128)for(s=c.child;s!==null;){if(V=gf(s),V!==null){for(c.flags|=128,vu(j,!1),s=V.updateQueue,s!==null&&(c.updateQueue=s,c.flags|=4),c.subtreeFlags=0,s=T,T=c.child;T!==null;)N=T,j=s,N.flags&=14680066,V=N.alternate,V===null?(N.childLanes=0,N.lanes=j,N.child=null,N.subtreeFlags=0,N.memoizedProps=null,N.memoizedState=null,N.updateQueue=null,N.dependencies=null,N.stateNode=null):(N.childLanes=V.childLanes,N.lanes=V.lanes,N.child=V.child,N.subtreeFlags=0,N.deletions=null,N.memoizedProps=V.memoizedProps,N.memoizedState=V.memoizedState,N.updateQueue=V.updateQueue,N.type=V.type,j=V.dependencies,N.dependencies=j===null?null:{lanes:j.lanes,firstContext:j.firstContext}),T=T.sibling;return Lt(qt,qt.current&1|2),c.child}s=s.sibling}j.tail!==null&&yr()>t1&&(c.flags|=128,N=!0,vu(j,!1),c.lanes=4194304)}else{if(!N)if(s=gf(V),s!==null){if(c.flags|=128,N=!0,s=s.updateQueue,s!==null&&(c.updateQueue=s,c.flags|=4),vu(j,!0),j.tail===null&&j.tailMode==="hidden"&&!V.alternate&&!Ht)return Ir(c),null}else 2*yr()-j.renderingStartTime>t1&&T!==1073741824&&(c.flags|=128,N=!0,vu(j,!1),c.lanes=4194304);j.isBackwards?(V.sibling=c.child,c.child=V):(s=j.last,s!==null?s.sibling=V:c.child=V,j.last=V)}return j.tail!==null?(c=j.tail,j.rendering=c,j.tail=c.sibling,j.renderingStartTime=yr(),c.sibling=null,s=qt.current,Lt(qt,N?s&1|2:s&1),c):(Ir(c),null);case 22:case 23:return o1(),T=c.memoizedState!==null,s!==null&&s.memoizedState!==null!==T&&(c.flags|=8192),T&&c.mode&1?_n&1073741824&&(Ir(c),te&&c.subtreeFlags&6&&(c.flags|=8192)):Ir(c),null;case 24:return null;case 25:return null}throw Error(o(156,c.tag))}function aE(s,c){switch(f0(c),c.tag){case 1:return rn(c.type)&&Qc(),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return Fl(),jt(tn),jt(Lr),O0(),s=c.flags,s&65536&&!(s&128)?(c.flags=s&-65537|128,c):null;case 5:return S0(c),null;case 13:if(jt(qt),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(o(340));Ll()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return jt(qt),null;case 4:return Fl(),null;case 10:return m0(c.type._context),null;case 22:case 23:return o1(),null;case 24:return null;default:return null}}var Pf=!1,Dr=!1,oE=typeof WeakSet=="function"?WeakSet:Set,Be=null;function Bl(s,c){var T=s.ref;if(T!==null)if(typeof T=="function")try{T(null)}catch(N){$t(s,c,N)}else T.current=null}function $0(s,c,T){try{T()}catch(N){$t(s,c,N)}}var Nb=!1;function lE(s,c){for(W(s.containerInfo),Be=c;Be!==null;)if(s=Be,c=s.child,(s.subtreeFlags&1028)!==0&&c!==null)c.return=s,Be=c;else for(;Be!==null;){s=Be;try{var T=s.alternate;if(s.flags&1024)switch(s.tag){case 0:case 11:case 15:break;case 1:if(T!==null){var N=T.memoizedProps,j=T.memoizedState,V=s.stateNode,J=V.getSnapshotBeforeUpdate(s.elementType===s.type?N:ri(s.type,N),j);V.__reactInternalSnapshotBeforeUpdate=J}break;case 3:te&&We(s.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(ae){$t(s,s.return,ae)}if(c=s.sibling,c!==null){c.return=s.return,Be=c;break}Be=s.return}return T=Nb,Nb=!1,T}function mu(s,c,T){var N=c.updateQueue;if(N=N!==null?N.lastEffect:null,N!==null){var j=N=N.next;do{if((j.tag&s)===s){var V=j.destroy;j.destroy=void 0,V!==void 0&&$0(c,T,V)}j=j.next}while(j!==N)}}function Cf(s,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var T=c=c.next;do{if((T.tag&s)===s){var N=T.create;T.destroy=N()}T=T.next}while(T!==c)}}function G0(s){var c=s.ref;if(c!==null){var T=s.stateNode;switch(s.tag){case 5:s=Z(T);break;default:s=T}typeof c=="function"?c(s):c.current=s}}function Ib(s){var c=s.alternate;c!==null&&(s.alternate=null,Ib(c)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(c=s.stateNode,c!==null&&Ie(c)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function Db(s){return s.tag===5||s.tag===3||s.tag===4}function jb(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||Db(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function V0(s,c,T){var N=s.tag;if(N===5||N===6)s=s.stateNode,c?fe(T,s,c):Le(T,s);else if(N!==4&&(s=s.child,s!==null))for(V0(s,c,T),s=s.sibling;s!==null;)V0(s,c,T),s=s.sibling}function q0(s,c,T){var N=s.tag;if(N===5||N===6)s=s.stateNode,c?oe(T,s,c):Ye(T,s);else if(N!==4&&(s=s.child,s!==null))for(q0(s,c,T),s=s.sibling;s!==null;)q0(s,c,T),s=s.sibling}var Pr=null,ni=!1;function Ai(s,c,T){for(T=T.child;T!==null;)W0(s,c,T),T=T.sibling}function W0(s,c,T){if(Oi&&typeof Oi.onCommitFiberUnmount=="function")try{Oi.onCommitFiberUnmount(nf,T)}catch{}switch(T.tag){case 5:Dr||Bl(T,c);case 6:if(te){var N=Pr,j=ni;Pr=null,Ai(s,c,T),Pr=N,ni=j,Pr!==null&&(ni?ye(Pr,T.stateNode):Ze(Pr,T.stateNode))}else Ai(s,c,T);break;case 18:te&&Pr!==null&&(ni?ko(Pr,T.stateNode):ru(Pr,T.stateNode));break;case 4:te?(N=Pr,j=ni,Pr=T.stateNode.containerInfo,ni=!0,Ai(s,c,T),Pr=N,ni=j):(ee&&(N=T.stateNode.containerInfo,j=xe(N),yt(N,j)),Ai(s,c,T));break;case 0:case 11:case 14:case 15:if(!Dr&&(N=T.updateQueue,N!==null&&(N=N.lastEffect,N!==null))){j=N=N.next;do{var V=j,J=V.destroy;V=V.tag,J!==void 0&&(V&2||V&4)&&$0(T,c,J),j=j.next}while(j!==N)}Ai(s,c,T);break;case 1:if(!Dr&&(Bl(T,c),N=T.stateNode,typeof N.componentWillUnmount=="function"))try{N.props=T.memoizedProps,N.state=T.memoizedState,N.componentWillUnmount()}catch(ae){$t(T,c,ae)}Ai(s,c,T);break;case 21:Ai(s,c,T);break;case 22:T.mode&1?(Dr=(N=Dr)||T.memoizedState!==null,Ai(s,c,T),Dr=N):Ai(s,c,T);break;default:Ai(s,c,T)}}function Fb(s){var c=s.updateQueue;if(c!==null){s.updateQueue=null;var T=s.stateNode;T===null&&(T=s.stateNode=new oE),c.forEach(function(N){var j=vE.bind(null,s,N);T.has(N)||(T.add(N),N.then(j,j))})}}function ii(s,c){var T=c.deletions;if(T!==null)for(var N=0;N<T.length;N++){var j=T[N];try{var V=s,J=c;if(te){var ae=J;e:for(;ae!==null;){switch(ae.tag){case 5:Pr=ae.stateNode,ni=!1;break e;case 3:Pr=ae.stateNode.containerInfo,ni=!0;break e;case 4:Pr=ae.stateNode.containerInfo,ni=!0;break e}ae=ae.return}if(Pr===null)throw Error(o(160));W0(V,J,j),Pr=null,ni=!1}else W0(V,J,j);var pe=j.alternate;pe!==null&&(pe.return=null),j.return=null}catch(ke){$t(j,c,ke)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)zb(c,s),c=c.sibling}function zb(s,c){var T=s.alternate,N=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(ii(c,s),Ri(s),N&4){try{mu(3,s,s.return),Cf(3,s)}catch(De){$t(s,s.return,De)}try{mu(5,s,s.return)}catch(De){$t(s,s.return,De)}}break;case 1:ii(c,s),Ri(s),N&512&&T!==null&&Bl(T,T.return);break;case 5:if(ii(c,s),Ri(s),N&512&&T!==null&&Bl(T,T.return),te){if(s.flags&32){var j=s.stateNode;try{Me(j)}catch(De){$t(s,s.return,De)}}if(N&4&&(j=s.stateNode,j!=null)){var V=s.memoizedProps;if(T=T!==null?T.memoizedProps:V,N=s.type,c=s.updateQueue,s.updateQueue=null,c!==null)try{Ve(j,c,N,T,V,s)}catch(De){$t(s,s.return,De)}}}break;case 6:if(ii(c,s),Ri(s),N&4&&te){if(s.stateNode===null)throw Error(o(162));j=s.stateNode,V=s.memoizedProps,T=T!==null?T.memoizedProps:V;try{Ee(j,T,V)}catch(De){$t(s,s.return,De)}}break;case 3:if(ii(c,s),Ri(s),N&4){if(te&&ie&&T!==null&&T.memoizedState.isDehydrated)try{Ln(c.containerInfo)}catch(De){$t(s,s.return,De)}if(ee){j=c.containerInfo,V=c.pendingChildren;try{yt(j,V)}catch(De){$t(s,s.return,De)}}}break;case 4:if(ii(c,s),Ri(s),N&4&&ee){V=s.stateNode,j=V.containerInfo,V=V.pendingChildren;try{yt(j,V)}catch(De){$t(s,s.return,De)}}break;case 13:ii(c,s),Ri(s),j=s.child,j.flags&8192&&(V=j.memoizedState!==null,j.stateNode.isHidden=V,!V||j.alternate!==null&&j.alternate.memoizedState!==null||(e1=yr())),N&4&&Fb(s);break;case 22:var J=T!==null&&T.memoizedState!==null;if(s.mode&1?(Dr=(T=Dr)||J,ii(c,s),Dr=T):ii(c,s),Ri(s),N&8192){if(T=s.memoizedState!==null,(s.stateNode.isHidden=T)&&!J&&s.mode&1)for(Be=s,N=s.child;N!==null;){for(c=Be=N;Be!==null;){J=Be;var ae=J.child;switch(J.tag){case 0:case 11:case 14:case 15:mu(4,J,J.return);break;case 1:Bl(J,J.return);var pe=J.stateNode;if(typeof pe.componentWillUnmount=="function"){var ke=J,He=J.return;try{var it=ke;pe.props=it.memoizedProps,pe.state=it.memoizedState,pe.componentWillUnmount()}catch(De){$t(ke,He,De)}}break;case 5:Bl(J,J.return);break;case 22:if(J.memoizedState!==null){Hb(c);continue}}ae!==null?(ae.return=J,Be=ae):Hb(c)}N=N.sibling}if(te){e:if(N=null,te)for(c=s;;){if(c.tag===5){if(N===null){N=c;try{j=c.stateNode,T?Pe(j):et(c.stateNode,c.memoizedProps)}catch(De){$t(s,s.return,De)}}}else if(c.tag===6){if(N===null)try{V=c.stateNode,T?we(V):Se(V,c.memoizedProps)}catch(De){$t(s,s.return,De)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===s)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break e;for(;c.sibling===null;){if(c.return===null||c.return===s)break e;N===c&&(N=null),c=c.return}N===c&&(N=null),c.sibling.return=c.return,c=c.sibling}}}break;case 19:ii(c,s),Ri(s),N&4&&Fb(s);break;case 21:break;default:ii(c,s),Ri(s)}}function Ri(s){var c=s.flags;if(c&2){try{if(te){e:{for(var T=s.return;T!==null;){if(Db(T)){var N=T;break e}T=T.return}throw Error(o(160))}switch(N.tag){case 5:var j=N.stateNode;N.flags&32&&(Me(j),N.flags&=-33);var V=jb(s);q0(s,V,j);break;case 3:case 4:var J=N.stateNode.containerInfo,ae=jb(s);V0(s,ae,J);break;default:throw Error(o(161))}}}catch(pe){$t(s,s.return,pe)}s.flags&=-3}c&4096&&(s.flags&=-4097)}function sE(s,c,T){Be=s,Bb(s)}function Bb(s,c,T){for(var N=(s.mode&1)!==0;Be!==null;){var j=Be,V=j.child;if(j.tag===22&&N){var J=j.memoizedState!==null||Pf;if(!J){var ae=j.alternate,pe=ae!==null&&ae.memoizedState!==null||Dr;ae=Pf;var ke=Dr;if(Pf=J,(Dr=pe)&&!ke)for(Be=j;Be!==null;)J=Be,pe=J.child,J.tag===22&&J.memoizedState!==null?$b(j):pe!==null?(pe.return=J,Be=pe):$b(j);for(;V!==null;)Be=V,Bb(V),V=V.sibling;Be=j,Pf=ae,Dr=ke}Ub(s)}else j.subtreeFlags&8772&&V!==null?(V.return=j,Be=V):Ub(s)}}function Ub(s){for(;Be!==null;){var c=Be;if(c.flags&8772){var T=c.alternate;try{if(c.flags&8772)switch(c.tag){case 0:case 11:case 15:Dr||Cf(5,c);break;case 1:var N=c.stateNode;if(c.flags&4&&!Dr)if(T===null)N.componentDidMount();else{var j=c.elementType===c.type?T.memoizedProps:ri(c.type,T.memoizedProps);N.componentDidUpdate(j,T.memoizedState,N.__reactInternalSnapshotBeforeUpdate)}var V=c.updateQueue;V!==null&&G2(c,V,N);break;case 3:var J=c.updateQueue;if(J!==null){if(T=null,c.child!==null)switch(c.child.tag){case 5:T=Z(c.child.stateNode);break;case 1:T=c.child.stateNode}G2(c,J,T)}break;case 5:var ae=c.stateNode;T===null&&c.flags&4&&Re(ae,c.type,c.memoizedProps,c);break;case 6:break;case 4:break;case 12:break;case 13:if(ie&&c.memoizedState===null){var pe=c.alternate;if(pe!==null){var ke=pe.memoizedState;if(ke!==null){var He=ke.dehydrated;He!==null&&Ta(He)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}Dr||c.flags&512&&G0(c)}catch(it){$t(c,c.return,it)}}if(c===s){Be=null;break}if(T=c.sibling,T!==null){T.return=c.return,Be=T;break}Be=c.return}}function Hb(s){for(;Be!==null;){var c=Be;if(c===s){Be=null;break}var T=c.sibling;if(T!==null){T.return=c.return,Be=T;break}Be=c.return}}function $b(s){for(;Be!==null;){var c=Be;try{switch(c.tag){case 0:case 11:case 15:var T=c.return;try{Cf(4,c)}catch(pe){$t(c,T,pe)}break;case 1:var N=c.stateNode;if(typeof N.componentDidMount=="function"){var j=c.return;try{N.componentDidMount()}catch(pe){$t(c,j,pe)}}var V=c.return;try{G0(c)}catch(pe){$t(c,V,pe)}break;case 5:var J=c.return;try{G0(c)}catch(pe){$t(c,J,pe)}}}catch(pe){$t(c,c.return,pe)}if(c===s){Be=null;break}var ae=c.sibling;if(ae!==null){ae.return=c.return,Be=ae;break}Be=c.return}}var kf=0,Tf=1,Af=2,Rf=3,Mf=4;if(typeof Symbol=="function"&&Symbol.for){var yu=Symbol.for;kf=yu("selector.component"),Tf=yu("selector.has_pseudo_class"),Af=yu("selector.role"),Rf=yu("selector.test_id"),Mf=yu("selector.text")}function K0(s){var c=ne(s);if(c!=null){if(typeof c.memoizedProps["data-testname"]!="string")throw Error(o(364));return c}if(s=ve(s),s===null)throw Error(o(362));return s.stateNode.current}function Y0(s,c){switch(c.$$typeof){case kf:if(s.type===c.value)return!0;break;case Tf:e:{c=c.value,s=[s,0];for(var T=0;T<s.length;){var N=s[T++],j=s[T++],V=c[j];if(N.tag!==5||!be(N)){for(;V!=null&&Y0(N,V);)j++,V=c[j];if(j===c.length){c=!0;break e}else for(N=N.child;N!==null;)s.push(N,j),N=N.sibling}}c=!1}return c;case Af:if(s.tag===5&&Oe(s.stateNode,c.value))return!0;break;case Mf:if((s.tag===5||s.tag===6)&&(s=ce(s),s!==null&&0<=s.indexOf(c.value)))return!0;break;case Rf:if(s.tag===5&&(s=s.memoizedProps["data-testname"],typeof s=="string"&&s.toLowerCase()===c.value.toLowerCase()))return!0;break;default:throw Error(o(365))}return!1}function X0(s){switch(s.$$typeof){case kf:return"<"+(C(s.value)||"Unknown")+">";case Tf:return":has("+(X0(s)||"")+")";case Af:return'[role="'+s.value+'"]';case Mf:return'"'+s.value+'"';case Rf:return'[data-testname="'+s.value+'"]';default:throw Error(o(365))}}function Gb(s,c){var T=[];s=[s,0];for(var N=0;N<s.length;){var j=s[N++],V=s[N++],J=c[V];if(j.tag!==5||!be(j)){for(;J!=null&&Y0(j,J);)V++,J=c[V];if(V===c.length)T.push(j);else for(j=j.child;j!==null;)s.push(j,V),j=j.sibling}}return T}function Z0(s,c){if(!_e)throw Error(o(363));s=K0(s),s=Gb(s,c),c=[],s=Array.from(s);for(var T=0;T<s.length;){var N=s[T++];if(N.tag===5)be(N)||c.push(N.stateNode);else for(N=N.child;N!==null;)s.push(N),N=N.sibling}return c}var uE=Math.ceil,Lf=l.ReactCurrentDispatcher,Q0=l.ReactCurrentOwner,tr=l.ReactCurrentBatchConfig,dt=0,_r=null,ir=null,Cr=0,_n=0,Ul=Ra(0),ur=0,bu=null,Io=0,Nf=0,J0=0,_u=null,an=null,e1=0,t1=1/0,ra=null;function Hl(){t1=yr()+500}var If=!1,r1=null,Ia=null,Df=!1,Da=null,jf=0,wu=0,n1=null,Ff=-1,zf=0;function jr(){return dt&6?yr():Ff!==-1?Ff:Ff=yr()}function ja(s){return s.mode&1?dt&2&&Cr!==0?Cr&-Cr:VS.transition!==null?(zf===0&&(zf=k2()),zf):(s=bt,s!==0?s:Te()):1}function Bn(s,c,T,N){if(50<wu)throw wu=0,n1=null,Error(o(185));au(s,T,N),(!(dt&2)||s!==_r)&&(s===_r&&(!(dt&2)&&(Nf|=T),ur===4&&Fa(s,Cr)),on(s,N),T===1&&dt===0&&!(c.mode&1)&&(Hl(),af&&xi()))}function on(s,c){var T=s.callbackNode;DS(s,c);var N=rf(s,s===_r?Cr:0);if(N===0)T!==null&&A2(T),s.callbackNode=null,s.callbackPriority=0;else if(c=N&-N,s.callbackPriority!==c){if(T!=null&&A2(T),c===1)s.tag===0?GS(qb.bind(null,s)):R2(qb.bind(null,s)),se?de(function(){!(dt&6)&&xi()}):o0(l0,xi),T=null;else{switch(T2(N)){case 1:T=l0;break;case 4:T=BS;break;case 16:T=s0;break;case 536870912:T=US;break;default:T=s0}T=t3(T,Vb.bind(null,s))}s.callbackPriority=c,s.callbackNode=T}}function Vb(s,c){if(Ff=-1,zf=0,dt&6)throw Error(o(327));var T=s.callbackNode;if(Fo()&&s.callbackNode!==T)return null;var N=rf(s,s===_r?Cr:0);if(N===0)return null;if(N&30||N&s.expiredLanes||c)c=Bf(s,N);else{c=N;var j=dt;dt|=2;var V=Yb();(_r!==s||Cr!==c)&&(ra=null,Hl(),Do(s,c));do try{dE();break}catch(ae){Kb(s,ae)}while(!0);v0(),Lf.current=V,dt=j,ir!==null?c=0:(_r=null,Cr=0,c=ur)}if(c!==0){if(c===2&&(j=n0(s),j!==0&&(N=j,c=i1(s,j))),c===1)throw T=bu,Do(s,0),Fa(s,N),on(s,yr()),T;if(c===6)Fa(s,N);else{if(j=s.current.alternate,!(N&30)&&!cE(j)&&(c=Bf(s,N),c===2&&(V=n0(s),V!==0&&(N=V,c=i1(s,V))),c===1))throw T=bu,Do(s,0),Fa(s,N),on(s,yr()),T;switch(s.finishedWork=j,s.finishedLanes=N,c){case 0:case 1:throw Error(o(345));case 2:jo(s,an,ra);break;case 3:if(Fa(s,N),(N&130023424)===N&&(c=e1+500-yr(),10<c)){if(rf(s,0)!==0)break;if(j=s.suspendedLanes,(j&N)!==N){jr(),s.pingedLanes|=s.suspendedLanes&j;break}s.timeoutHandle=B(jo.bind(null,s,an,ra),c);break}jo(s,an,ra);break;case 4:if(Fa(s,N),(N&4194240)===N)break;for(c=s.eventTimes,j=-1;0<N;){var J=31-Jn(N);V=1<<J,J=c[J],J>j&&(j=J),N&=~V}if(N=j,N=yr()-N,N=(120>N?120:480>N?480:1080>N?1080:1920>N?1920:3e3>N?3e3:4320>N?4320:1960*uE(N/1960))-N,10<N){s.timeoutHandle=B(jo.bind(null,s,an,ra),N);break}jo(s,an,ra);break;case 5:jo(s,an,ra);break;default:throw Error(o(329))}}}return on(s,yr()),s.callbackNode===T?Vb.bind(null,s):null}function i1(s,c){var T=_u;return s.current.memoizedState.isDehydrated&&(Do(s,c).flags|=256),s=Bf(s,c),s!==2&&(c=an,an=T,c!==null&&a1(c)),s}function a1(s){an===null?an=s:an.push.apply(an,s)}function cE(s){for(var c=s;;){if(c.flags&16384){var T=c.updateQueue;if(T!==null&&(T=T.stores,T!==null))for(var N=0;N<T.length;N++){var j=T[N],V=j.getSnapshot;j=j.value;try{if(!ei(V(),j))return!1}catch{return!1}}}if(T=c.child,c.subtreeFlags&16384&&T!==null)T.return=c,c=T;else{if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Fa(s,c){for(c&=~J0,c&=~Nf,s.suspendedLanes|=c,s.pingedLanes&=~c,s=s.expirationTimes;0<c;){var T=31-Jn(c),N=1<<T;s[T]=-1,c&=~N}}function qb(s){if(dt&6)throw Error(o(327));Fo();var c=rf(s,0);if(!(c&1))return on(s,yr()),null;var T=Bf(s,c);if(s.tag!==0&&T===2){var N=n0(s);N!==0&&(c=N,T=i1(s,N))}if(T===1)throw T=bu,Do(s,0),Fa(s,c),on(s,yr()),T;if(T===6)throw Error(o(345));return s.finishedWork=s.current.alternate,s.finishedLanes=c,jo(s,an,ra),on(s,yr()),null}function Wb(s){Da!==null&&Da.tag===0&&!(dt&6)&&Fo();var c=dt;dt|=1;var T=tr.transition,N=bt;try{if(tr.transition=null,bt=1,s)return s()}finally{bt=N,tr.transition=T,dt=c,!(dt&6)&&xi()}}function o1(){_n=Ul.current,jt(Ul)}function Do(s,c){s.finishedWork=null,s.finishedLanes=0;var T=s.timeoutHandle;if(T!==X&&(s.timeoutHandle=X,Y(T)),ir!==null)for(T=ir.return;T!==null;){var N=T;switch(f0(N),N.tag){case 1:N=N.type.childContextTypes,N!=null&&Qc();break;case 3:Fl(),jt(tn),jt(Lr),O0();break;case 5:S0(N);break;case 4:Fl();break;case 13:jt(qt);break;case 19:jt(qt);break;case 10:m0(N.type._context);break;case 22:case 23:o1()}T=T.return}if(_r=s,ir=s=za(s.current,null),Cr=_n=c,ur=0,bu=null,J0=Nf=Io=0,an=_u=null,Lo!==null){for(c=0;c<Lo.length;c++)if(T=Lo[c],N=T.interleaved,N!==null){T.interleaved=null;var j=N.next,V=T.pending;if(V!==null){var J=V.next;V.next=j,N.next=J}T.pending=N}Lo=null}return s}function Kb(s,c){do{var T=ir;try{if(v0(),vf.current=_f,mf){for(var N=Wt.memoizedState;N!==null;){var j=N.queue;j!==null&&(j.pending=null),N=N.next}mf=!1}if(No=0,br=sr=Wt=null,cu=!1,fu=0,Q0.current=null,T===null||T.return===null){ur=1,bu=c,ir=null;break}e:{var V=s,J=T.return,ae=T,pe=c;if(c=Cr,ae.flags|=32768,pe!==null&&typeof pe=="object"&&typeof pe.then=="function"){var ke=pe,He=ae,it=He.tag;if(!(He.mode&1)&&(it===0||it===11||it===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 Ft=bb(J);if(Ft!==null){Ft.flags&=-257,_b(Ft,J,ae,V,c),Ft.mode&1&&yb(V,ke,c),c=Ft,pe=ke;var At=c.updateQueue;if(At===null){var ln=new Set;ln.add(pe),c.updateQueue=ln}else At.add(pe);break e}else{if(!(c&1)){yb(V,ke,c),l1();break e}pe=Error(o(426))}}else if(Ht&&ae.mode&1){var na=bb(J);if(na!==null){!(na.flags&65536)&&(na.flags|=256),_b(na,J,ae,V,c),p0(zl(pe,ae));break e}}V=pe=zl(pe,ae),ur!==4&&(ur=2),_u===null?_u=[V]:_u.push(V),V=J;do{switch(V.tag){case 3:V.flags|=65536,c&=-c,V.lanes|=c;var he=vb(V,pe,c);$2(V,he);break e;case 1:ae=pe;var ue=V.type,ge=V.stateNode;if(!(V.flags&128)&&(typeof ue.getDerivedStateFromError=="function"||ge!==null&&typeof ge.componentDidCatch=="function"&&(Ia===null||!Ia.has(ge)))){V.flags|=65536,c&=-c,V.lanes|=c;var je=mb(V,ae,c);$2(V,je);break e}}V=V.return}while(V!==null)}Zb(T)}catch(Xe){c=Xe,ir===T&&T!==null&&(ir=T=T.return);continue}break}while(!0)}function Yb(){var s=Lf.current;return Lf.current=_f,s===null?_f:s}function l1(){(ur===0||ur===3||ur===2)&&(ur=4),_r===null||!(Io&268435455)&&!(Nf&268435455)||Fa(_r,Cr)}function Bf(s,c){var T=dt;dt|=2;var N=Yb();(_r!==s||Cr!==c)&&(ra=null,Do(s,c));do try{fE();break}catch(j){Kb(s,j)}while(!0);if(v0(),dt=T,Lf.current=N,ir!==null)throw Error(o(261));return _r=null,Cr=0,ur}function fE(){for(;ir!==null;)Xb(ir)}function dE(){for(;ir!==null&&!FS();)Xb(ir)}function Xb(s){var c=e3(s.alternate,s,_n);s.memoizedProps=s.pendingProps,c===null?Zb(s):ir=c,Q0.current=null}function Zb(s){var c=s;do{var T=c.alternate;if(s=c.return,c.flags&32768){if(T=aE(T,c),T!==null){T.flags&=32767,ir=T;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{ur=6,ir=null;return}}else if(T=iE(T,c,_n),T!==null){ir=T;return}if(c=c.sibling,c!==null){ir=c;return}ir=c=s}while(c!==null);ur===0&&(ur=5)}function jo(s,c,T){var N=bt,j=tr.transition;try{tr.transition=null,bt=1,hE(s,c,T,N)}finally{tr.transition=j,bt=N}return null}function hE(s,c,T,N){do Fo();while(Da!==null);if(dt&6)throw Error(o(327));T=s.finishedWork;var j=s.finishedLanes;if(T===null)return null;if(s.finishedWork=null,s.finishedLanes=0,T===s.current)throw Error(o(177));s.callbackNode=null,s.callbackPriority=0;var V=T.lanes|T.childLanes;if(jS(s,V),s===_r&&(ir=_r=null,Cr=0),!(T.subtreeFlags&2064)&&!(T.flags&2064)||Df||(Df=!0,t3(s0,function(){return Fo(),null})),V=(T.flags&15990)!==0,T.subtreeFlags&15990||V){V=tr.transition,tr.transition=null;var J=bt;bt=1;var ae=dt;dt|=4,Q0.current=null,lE(s,T),zb(T,s),R(s.containerInfo),s.current=T,sE(T),zS(),dt=ae,bt=J,tr.transition=V}else s.current=T;if(Df&&(Df=!1,Da=s,jf=j),V=s.pendingLanes,V===0&&(Ia=null),HS(T.stateNode),on(s,yr()),c!==null)for(N=s.onRecoverableError,T=0;T<c.length;T++)j=c[T],N(j.value,{componentStack:j.stack,digest:j.digest});if(If)throw If=!1,s=r1,r1=null,s;return jf&1&&s.tag!==0&&Fo(),V=s.pendingLanes,V&1?s===n1?wu++:(wu=0,n1=s):wu=0,xi(),null}function Fo(){if(Da!==null){var s=T2(jf),c=tr.transition,T=bt;try{if(tr.transition=null,bt=16>s?16:s,Da===null)var N=!1;else{if(s=Da,Da=null,jf=0,dt&6)throw Error(o(331));var j=dt;for(dt|=4,Be=s.current;Be!==null;){var V=Be,J=V.child;if(Be.flags&16){var ae=V.deletions;if(ae!==null){for(var pe=0;pe<ae.length;pe++){var ke=ae[pe];for(Be=ke;Be!==null;){var He=Be;switch(He.tag){case 0:case 11:case 15:mu(8,He,V)}var it=He.child;if(it!==null)it.return=He,Be=it;else for(;Be!==null;){He=Be;var De=He.sibling,Ft=He.return;if(Ib(He),He===ke){Be=null;break}if(De!==null){De.return=Ft,Be=De;break}Be=Ft}}}var At=V.alternate;if(At!==null){var ln=At.child;if(ln!==null){At.child=null;do{var na=ln.sibling;ln.sibling=null,ln=na}while(ln!==null)}}Be=V}}if(V.subtreeFlags&2064&&J!==null)J.return=V,Be=J;else e:for(;Be!==null;){if(V=Be,V.flags&2048)switch(V.tag){case 0:case 11:case 15:mu(9,V,V.return)}var he=V.sibling;if(he!==null){he.return=V.return,Be=he;break e}Be=V.return}}var ue=s.current;for(Be=ue;Be!==null;){J=Be;var ge=J.child;if(J.subtreeFlags&2064&&ge!==null)ge.return=J,Be=ge;else e:for(J=ue;Be!==null;){if(ae=Be,ae.flags&2048)try{switch(ae.tag){case 0:case 11:case 15:Cf(9,ae)}}catch(Xe){$t(ae,ae.return,Xe)}if(ae===J){Be=null;break e}var je=ae.sibling;if(je!==null){je.return=ae.return,Be=je;break e}Be=ae.return}}if(dt=j,xi(),Oi&&typeof Oi.onPostCommitFiberRoot=="function")try{Oi.onPostCommitFiberRoot(nf,s)}catch{}N=!0}return N}finally{bt=T,tr.transition=c}}return!1}function Qb(s,c,T){c=zl(T,c),c=vb(s,c,1),s=Na(s,c,1),c=jr(),s!==null&&(au(s,1,c),on(s,c))}function $t(s,c,T){if(s.tag===3)Qb(s,s,T);else for(;c!==null;){if(c.tag===3){Qb(c,s,T);break}else if(c.tag===1){var N=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof N.componentDidCatch=="function"&&(Ia===null||!Ia.has(N))){s=zl(T,s),s=mb(c,s,1),c=Na(c,s,1),s=jr(),c!==null&&(au(c,1,s),on(c,s));break}}c=c.return}}function pE(s,c,T){var N=s.pingCache;N!==null&&N.delete(c),c=jr(),s.pingedLanes|=s.suspendedLanes&T,_r===s&&(Cr&T)===T&&(ur===4||ur===3&&(Cr&130023424)===Cr&&500>yr()-e1?Do(s,0):J0|=T),on(s,c)}function Jb(s,c){c===0&&(s.mode&1?(c=tf,tf<<=1,!(tf&130023424)&&(tf=4194304)):c=1);var T=jr();s=Pi(s,c),s!==null&&(au(s,c,T),on(s,T))}function gE(s){var c=s.memoizedState,T=0;c!==null&&(T=c.retryLane),Jb(s,T)}function vE(s,c){var T=0;switch(s.tag){case 13:var N=s.stateNode,j=s.memoizedState;j!==null&&(T=j.retryLane);break;case 19:N=s.stateNode;break;default:throw Error(o(314))}N!==null&&N.delete(c),Jb(s,T)}var e3;e3=function(s,c,T){if(s!==null)if(s.memoizedProps!==c.pendingProps||tn.current)nn=!0;else{if(!(s.lanes&T)&&!(c.flags&128))return nn=!1,nE(s,c,T);nn=!!(s.flags&131072)}else nn=!1,Ht&&c.flags&1048576&&M2(c,lf,c.index);switch(c.lanes=0,c.tag){case 2:var N=c.type;Ef(s,c),s=c.pendingProps;var j=Al(c,Lr.current);Dl(c,T),j=C0(null,c,N,s,j,T);var V=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,rn(N)?(V=!0,Jc(c)):V=!1,c.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,_0(c),j.updater=wf,c.stateNode=j,j._reactInternals=c,N0(c,N,s,T),c=F0(null,c,N,!0,V,T)):(c.tag=0,Ht&&V&&c0(c),Gr(null,c,j,T),c=c.child),c;case 16:N=c.elementType;e:{switch(Ef(s,c),s=c.pendingProps,j=N._init,N=j(N._payload),c.type=N,j=c.tag=yE(N),s=ri(N,s),j){case 0:c=j0(null,c,N,s,T);break e;case 1:c=Pb(null,c,N,s,T);break e;case 11:c=wb(null,c,N,s,T);break e;case 14:c=Sb(null,c,N,ri(N.type,s),T);break e}throw Error(o(306,N,""))}return c;case 0:return N=c.type,j=c.pendingProps,j=c.elementType===N?j:ri(N,j),j0(s,c,N,j,T);case 1:return N=c.type,j=c.pendingProps,j=c.elementType===N?j:ri(N,j),Pb(s,c,N,j,T);case 3:e:{if(Cb(c),s===null)throw Error(o(387));N=c.pendingProps,V=c.memoizedState,j=V.element,H2(s,c),pf(c,N,null,T);var J=c.memoizedState;if(N=J.element,ie&&V.isDehydrated)if(V={element:N,isDehydrated:!1,cache:J.cache,pendingSuspenseBoundaries:J.pendingSuspenseBoundaries,transitions:J.transitions},c.updateQueue.baseState=V,c.memoizedState=V,c.flags&256){j=zl(Error(o(423)),c),c=kb(s,c,N,T,j);break e}else if(N!==j){j=zl(Error(o(424)),c),c=kb(s,c,N,T,j);break e}else for(ie&&(Dn=Et(c.stateNode.containerInfo),bn=c,Ht=!0,ti=null,ou=!1),T=z2(c,null,N,T),c.child=T;T;)T.flags=T.flags&-3|4096,T=T.sibling;else{if(Ll(),N===j){c=ta(s,c,T);break e}Gr(s,c,N,T)}c=c.child}return c;case 5:return V2(c),s===null&&h0(c),N=c.type,j=c.pendingProps,V=s!==null?s.memoizedProps:null,J=j.children,K(N,j)?J=null:V!==null&&K(N,V)&&(c.flags|=32),xb(s,c),Gr(s,c,J,T),c.child;case 6:return s===null&&h0(c),null;case 13:return Tb(s,c,T);case 4:return w0(c,c.stateNode.containerInfo),N=c.pendingProps,s===null?c.child=Nl(c,null,N,T):Gr(s,c,N,T),c.child;case 11:return N=c.type,j=c.pendingProps,j=c.elementType===N?j:ri(N,j),wb(s,c,N,j,T);case 7:return Gr(s,c,c.pendingProps,T),c.child;case 8:return Gr(s,c,c.pendingProps.children,T),c.child;case 12:return Gr(s,c,c.pendingProps.children,T),c.child;case 10:e:{if(N=c.type._context,j=c.pendingProps,V=c.memoizedProps,J=j.value,B2(c,N,J),V!==null)if(ei(V.value,J)){if(V.children===j.children&&!tn.current){c=ta(s,c,T);break e}}else for(V=c.child,V!==null&&(V.return=c);V!==null;){var ae=V.dependencies;if(ae!==null){J=V.child;for(var pe=ae.firstContext;pe!==null;){if(pe.context===N){if(V.tag===1){pe=ea(-1,T&-T),pe.tag=2;var ke=V.updateQueue;if(ke!==null){ke=ke.shared;var He=ke.pending;He===null?pe.next=pe:(pe.next=He.next,He.next=pe),ke.pending=pe}}V.lanes|=T,pe=V.alternate,pe!==null&&(pe.lanes|=T),y0(V.return,T,c),ae.lanes|=T;break}pe=pe.next}}else if(V.tag===10)J=V.type===c.type?null:V.child;else if(V.tag===18){if(J=V.return,J===null)throw Error(o(341));J.lanes|=T,ae=J.alternate,ae!==null&&(ae.lanes|=T),y0(J,T,c),J=V.sibling}else J=V.child;if(J!==null)J.return=V;else for(J=V;J!==null;){if(J===c){J=null;break}if(V=J.sibling,V!==null){V.return=J.return,J=V;break}J=J.return}V=J}Gr(s,c,j.children,T),c=c.child}return c;case 9:return j=c.type,N=c.pendingProps.children,Dl(c,T),j=jn(j),N=N(j),c.flags|=1,Gr(s,c,N,T),c.child;case 14:return N=c.type,j=ri(N,c.pendingProps),j=ri(N.type,j),Sb(s,c,N,j,T);case 15:return Eb(s,c,c.type,c.pendingProps,T);case 17:return N=c.type,j=c.pendingProps,j=c.elementType===N?j:ri(N,j),Ef(s,c),c.tag=1,rn(N)?(s=!0,Jc(c)):s=!1,Dl(c,T),pb(c,N,j),N0(c,N,j,T),F0(null,c,N,!0,s,T);case 19:return Rb(s,c,T);case 22:return Ob(s,c,T)}throw Error(o(156,c.tag))};function t3(s,c){return o0(s,c)}function mE(s,c,T,N){this.tag=s,this.key=T,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=N,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Un(s,c,T,N){return new mE(s,c,T,N)}function s1(s){return s=s.prototype,!(!s||!s.isReactComponent)}function yE(s){if(typeof s=="function")return s1(s)?1:0;if(s!=null){if(s=s.$$typeof,s===b)return 11;if(s===m)return 14}return 2}function za(s,c){var T=s.alternate;return T===null?(T=Un(s.tag,c,s.key,s.mode),T.elementType=s.elementType,T.type=s.type,T.stateNode=s.stateNode,T.alternate=s,s.alternate=T):(T.pendingProps=c,T.type=s.type,T.flags=0,T.subtreeFlags=0,T.deletions=null),T.flags=s.flags&14680064,T.childLanes=s.childLanes,T.lanes=s.lanes,T.child=s.child,T.memoizedProps=s.memoizedProps,T.memoizedState=s.memoizedState,T.updateQueue=s.updateQueue,c=s.dependencies,T.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},T.sibling=s.sibling,T.index=s.index,T.ref=s.ref,T}function Uf(s,c,T,N,j,V){var J=2;if(N=s,typeof s=="function")s1(s)&&(J=1);else if(typeof s=="string")J=5;else e:switch(s){case h:return zo(T.children,j,V,c);case E:J=8,j|=8;break;case w:return s=Un(12,T,c,j|2),s.elementType=w,s.lanes=V,s;case y:return s=Un(13,T,c,j),s.elementType=y,s.lanes=V,s;case v:return s=Un(19,T,c,j),s.elementType=v,s.lanes=V,s;case g:return Hf(T,j,V,c);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case p:J=10;break e;case S:J=9;break e;case b:J=11;break e;case m:J=14;break e;case d:J=16,N=null;break e}throw Error(o(130,s==null?s:typeof s,""))}return c=Un(J,T,c,j),c.elementType=s,c.type=N,c.lanes=V,c}function zo(s,c,T,N){return s=Un(7,s,N,c),s.lanes=T,s}function Hf(s,c,T,N){return s=Un(22,s,N,c),s.elementType=g,s.lanes=T,s.stateNode={isHidden:!1},s}function u1(s,c,T){return s=Un(6,s,null,c),s.lanes=T,s}function c1(s,c,T){return c=Un(4,s.children!==null?s.children:[],s.key,c),c.lanes=T,c.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},c}function bE(s,c,T,N,j){this.tag=c,this.containerInfo=s,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=N,this.onRecoverableError=j,ie&&(this.mutableSourceEagerHydrationData=null)}function r3(s,c,T,N,j,V,J,ae,pe){return s=new bE(s,c,T,ae,pe),c===1?(c=1,V===!0&&(c|=8)):c=0,V=Un(3,null,null,c),s.current=V,V.stateNode=s,V.memoizedState={element:N,isDehydrated:T,cache:null,transitions:null,pendingSuspenseBoundaries:null},_0(V),s}function n3(s){if(!s)return Ma;s=s._reactInternals;e:{if(O(s)!==s||s.tag!==1)throw Error(o(170));var c=s;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(rn(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(o(171))}if(s.tag===1){var T=s.type;if(rn(T))return P2(s,T,c)}return c}function i3(s){var c=s._reactInternals;if(c===void 0)throw typeof s.render=="function"?Error(o(188)):(s=Object.keys(s).join(","),Error(o(268,s)));return s=L(c),s===null?null:s.stateNode}function a3(s,c){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var T=s.retryLane;s.retryLane=T!==0&&T<c?T:c}}function $f(s,c){a3(s,c),(s=s.alternate)&&a3(s,c)}function _E(s){return s=L(s),s===null?null:s.stateNode}function wE(){return null}return r.attemptContinuousHydration=function(s){if(s.tag===13){var c=Pi(s,134217728);if(c!==null){var T=jr();Bn(c,s,134217728,T)}$f(s,134217728)}},r.attemptDiscreteHydration=function(s){if(s.tag===13){var c=Pi(s,1);if(c!==null){var T=jr();Bn(c,s,1,T)}$f(s,1)}},r.attemptHydrationAtCurrentPriority=function(s){if(s.tag===13){var c=ja(s),T=Pi(s,c);if(T!==null){var N=jr();Bn(T,s,c,N)}$f(s,c)}},r.attemptSynchronousHydration=function(s){switch(s.tag){case 3:var c=s.stateNode;if(c.current.memoizedState.isDehydrated){var T=iu(c.pendingLanes);T!==0&&(a0(c,T|1),on(c,yr()),!(dt&6)&&(Hl(),xi()))}break;case 13:Wb(function(){var N=Pi(s,1);if(N!==null){var j=jr();Bn(N,s,1,j)}}),$f(s,1)}},r.batchedUpdates=function(s,c){var T=dt;dt|=1;try{return s(c)}finally{dt=T,dt===0&&(Hl(),af&&xi())}},r.createComponentSelector=function(s){return{$$typeof:kf,value:s}},r.createContainer=function(s,c,T,N,j,V,J){return r3(s,c,!1,null,T,N,j,V,J)},r.createHasPseudoClassSelector=function(s){return{$$typeof:Tf,value:s}},r.createHydrationContainer=function(s,c,T,N,j,V,J,ae,pe){return s=r3(T,N,!0,s,j,V,J,ae,pe),s.context=n3(null),T=s.current,N=jr(),j=ja(T),V=ea(N,j),V.callback=c??null,Na(T,V,j),s.current.lanes=j,au(s,j,N),on(s,N),s},r.createPortal=function(s,c,T){var N=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:N==null?null:""+N,children:s,containerInfo:c,implementation:T}},r.createRoleSelector=function(s){return{$$typeof:Af,value:s}},r.createTestNameSelector=function(s){return{$$typeof:Rf,value:s}},r.createTextSelector=function(s){return{$$typeof:Mf,value:s}},r.deferredUpdates=function(s){var c=bt,T=tr.transition;try{return tr.transition=null,bt=16,s()}finally{bt=c,tr.transition=T}},r.discreteUpdates=function(s,c,T,N,j){var V=bt,J=tr.transition;try{return tr.transition=null,bt=1,s(c,T,N,j)}finally{bt=V,tr.transition=J,dt===0&&Hl()}},r.findAllNodes=Z0,r.findBoundingRects=function(s,c){if(!_e)throw Error(o(363));c=Z0(s,c),s=[];for(var T=0;T<c.length;T++)s.push(re(c[T]));for(c=s.length-1;0<c;c--){T=s[c];for(var N=T.x,j=N+T.width,V=T.y,J=V+T.height,ae=c-1;0<=ae;ae--)if(c!==ae){var pe=s[ae],ke=pe.x,He=ke+pe.width,it=pe.y,De=it+pe.height;if(N>=ke&&V>=it&&j<=He&&J<=De){s.splice(c,1);break}else if(N!==ke||T.width!==pe.width||De<V||it>J){if(!(V!==it||T.height!==pe.height||He<N||ke>j)){ke>N&&(pe.width+=ke-N,pe.x=N),He<j&&(pe.width=j-ke),s.splice(c,1);break}}else{it>V&&(pe.height+=it-V,pe.y=V),De<J&&(pe.height=J-it),s.splice(c,1);break}}}return s},r.findHostInstance=i3,r.findHostInstanceWithNoPortals=function(s){return s=A(s),s=s!==null?U(s):null,s===null?null:s.stateNode},r.findHostInstanceWithWarning=function(s){return i3(s)},r.flushControlled=function(s){var c=dt;dt|=1;var T=tr.transition,N=bt;try{tr.transition=null,bt=1,s()}finally{bt=N,tr.transition=T,dt=c,dt===0&&(Hl(),xi())}},r.flushPassiveEffects=Fo,r.flushSync=Wb,r.focusWithin=function(s,c){if(!_e)throw Error(o(363));for(s=K0(s),c=Gb(s,c),c=Array.from(c),s=0;s<c.length;){var T=c[s++];if(!be(T)){if(T.tag===5&&$e(T.stateNode))return!0;for(T=T.child;T!==null;)c.push(T),T=T.sibling}}return!1},r.getCurrentUpdatePriority=function(){return bt},r.getFindAllNodesFailureDescription=function(s,c){if(!_e)throw Error(o(363));var T=0,N=[];s=[K0(s),0];for(var j=0;j<s.length;){var V=s[j++],J=s[j++],ae=c[J];if((V.tag!==5||!be(V))&&(Y0(V,ae)&&(N.push(X0(ae)),J++,J>T&&(T=J)),J<c.length))for(V=V.child;V!==null;)s.push(V,J),V=V.sibling}if(T<c.length){for(s=[];T<c.length;T++)s.push(X0(c[T]));return`findAllNodes was able to match part of the selector:
58
+ `+(N.join(" > ")+`
59
+
60
+ No matching component was found for:
61
+ `)+s.join(" > ")}return null},r.getPublicRootInstance=function(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return Z(s.child.stateNode);default:return s.child.stateNode}},r.injectIntoDevTools=function(s){if(s={bundleType:s.bundleType,version:s.version,rendererPackageName:s.rendererPackageName,rendererConfig:s.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:l.ReactCurrentDispatcher,findHostInstanceByFiber:_E,findFiberByHostInstance:s.findFiberByHostInstance||wE,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")s=!1;else{var c=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(c.isDisabled||!c.supportsFiber)s=!0;else{try{nf=c.inject(s),Oi=c}catch{}s=!!c.checkDCE}}return s},r.isAlreadyRendering=function(){return!1},r.observeVisibleRects=function(s,c,T,N){if(!_e)throw Error(o(363));s=Z0(s,c);var j=Qe(s,T,N).disconnect;return{disconnect:function(){j()}}},r.registerMutableSourceForHydration=function(s,c){var T=c._getVersion;T=T(c._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[c,T]:s.mutableSourceEagerHydrationData.push(c,T)},r.runWithPriority=function(s,c){var T=bt;try{return bt=s,c()}finally{bt=T}},r.shouldError=function(){return null},r.shouldSuspend=function(){return!1},r.updateContainer=function(s,c,T,N){var j=c.current,V=jr(),J=ja(j);return T=n3(T),c.context===null?c.context=T:c.pendingContext=T,c=ea(V,J),c.payload={element:s},N=N===void 0?null:N,N!==null&&(c.callback=N),s=Na(j,c,J),s!==null&&(Bn(s,j,J,V),hf(s,j,J)),J},r};j9.exports=bM;var _M=j9.exports;const wM=xh(_M);var F9={exports:{}},El={};/**
62
+ * @license React
63
+ * react-reconciler-constants.production.min.js
64
+ *
65
+ * Copyright (c) Facebook, Inc. and its affiliates.
66
+ *
67
+ * This source code is licensed under the MIT license found in the
68
+ * LICENSE file in the root directory of this source tree.
69
+ */El.ConcurrentRoot=1;El.ContinuousEventPriority=4;El.DefaultEventPriority=16;El.DiscreteEventPriority=1;El.IdleEventPriority=536870912;El.LegacyRoot=0;F9.exports=El;var z9=F9.exports;const f4={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let d4=!1,h4=!1;const Yy=".react-konva-event";let B9=!1;function SM(e){B9=e}const EM=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
70
+ Position of a node will be changed during drag&drop, so you should update state of the react app as well.
71
+ Consider to add onDragMove or onDragEnd events.
72
+ For more info see: https://github.com/konvajs/react-konva/issues/256
73
+ `,OM=`ReactKonva: You are using "zIndex" attribute for a Konva node.
74
+ react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
75
+ For more info see: https://github.com/konvajs/react-konva/issues/194
76
+ `,xM={};function Vp(e,t,r=xM){if(!d4&&"zIndex"in t&&(console.warn(OM),d4=!0),!h4&&t.draggable){var n=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;n&&!i&&(console.warn(EM),h4=!0)}for(var a in r)if(!f4[a]){var o=a.slice(0,2)==="on",l=r[a]!==t[a];if(o&&l){var u=a.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),e.off(u,r[a])}var f=!t.hasOwnProperty(a);f&&e.setAttr(a,void 0)}var h=B9||t._useStrictMode,E={},w=!1;const p={};for(var a in t)if(!f4[a]){var o=a.slice(0,2)==="on",S=r[a]!==t[a];if(o&&S){var u=a.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),t[a]&&(p[u]=t[a])}!o&&(t[a]!==r[a]||h&&t[a]!==e.getAttr(a))&&(w=!0,E[a]=t[a])}w&&(e.setAttrs(E),xo(e));for(var u in p)e.on(u+Yy,p[u])}function xo(e){if(!ut.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const U9={},PM={};wc.Node.prototype._applyProps=Vp;function CM(e,t){if(typeof t=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`);return}e.add(t),xo(e)}function kM(e,t,r){let n=wc[e];n||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),n=wc.Group);const i={},a={};for(var o in t){var l=o.slice(0,2)==="on";l?a[o]=t[o]:i[o]=t[o]}const u=new n(i);return Vp(u,a),u}function TM(e,t,r){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function AM(e,t,r){return!1}function RM(e){return e}function MM(){return null}function LM(){return null}function NM(e,t,r,n){return PM}function IM(){}function DM(e){}function jM(e,t){return!1}function FM(){return U9}function zM(){return U9}const BM=setTimeout,UM=clearTimeout,HM=-1;function $M(e,t){return!1}const GM=!1,VM=!0,qM=!0;function WM(e,t){t.parent===e?t.moveToTop():e.add(t),xo(e)}function KM(e,t){t.parent===e?t.moveToTop():e.add(t),xo(e)}function H9(e,t,r){t._remove(),e.add(t),t.setZIndex(r.getZIndex()),xo(e)}function YM(e,t,r){H9(e,t,r)}function XM(e,t){t.destroy(),t.off(Yy),xo(e)}function ZM(e,t){t.destroy(),t.off(Yy),xo(e)}function QM(e,t,r){console.error(`Text components are not yet supported in ReactKonva. You text is: "${r}"`)}function JM(e,t,r){}function eL(e,t,r,n,i){Vp(e,i,n)}function tL(e){e.hide(),xo(e)}function rL(e){}function nL(e,t){(t.visible==null||t.visible)&&e.show()}function iL(e,t){}function aL(e){}function oL(){}const lL=()=>z9.DefaultEventPriority,sL=Object.freeze(Object.defineProperty({__proto__:null,appendChild:WM,appendChildToContainer:KM,appendInitialChild:CM,cancelTimeout:UM,clearContainer:aL,commitMount:JM,commitTextUpdate:QM,commitUpdate:eL,createInstance:kM,createTextInstance:TM,detachDeletedInstance:oL,finalizeInitialChildren:AM,getChildHostContext:zM,getCurrentEventPriority:lL,getPublicInstance:RM,getRootHostContext:FM,hideInstance:tL,hideTextInstance:rL,idlePriority:zu.unstable_IdlePriority,insertBefore:H9,insertInContainerBefore:YM,isPrimaryRenderer:GM,noTimeout:HM,now:zu.unstable_now,prepareForCommit:MM,preparePortalMount:LM,prepareUpdate:NM,removeChild:XM,removeChildFromContainer:ZM,resetAfterCommit:IM,resetTextContent:DM,run:zu.unstable_runWithPriority,scheduleTimeout:BM,shouldDeprioritizeSubtree:jM,shouldSetTextContent:$M,supportsMutation:qM,unhideInstance:nL,unhideTextInstance:iL,warnsIfNotActing:VM},Symbol.toStringTag,{value:"Module"}));var uL=Object.defineProperty,cL=Object.defineProperties,fL=Object.getOwnPropertyDescriptors,p4=Object.getOwnPropertySymbols,dL=Object.prototype.hasOwnProperty,hL=Object.prototype.propertyIsEnumerable,g4=(e,t,r)=>t in e?uL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,v4=(e,t)=>{for(var r in t||(t={}))dL.call(t,r)&&g4(e,r,t[r]);if(p4)for(var r of p4(t))hL.call(t,r)&&g4(e,r,t[r]);return e},pL=(e,t)=>cL(e,fL(t)),m4,y4;typeof window<"u"&&((m4=window.document)!=null&&m4.createElement||((y4=window.navigator)==null?void 0:y4.product)==="ReactNative")?Je.useLayoutEffect:Je.useEffect;function $9(e,t,r){if(!e)return;if(r(e)===!0)return e;let n=e.child;for(;n;){const i=$9(n,t,r);if(i)return i;n=n.sibling}}function G9(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const b4=console.error;console.error=function(){const e=[...arguments].join("");if(e!=null&&e.startsWith("Warning:")&&e.includes("useContext")){console.error=b4;return}return b4.apply(this,arguments)};const Xy=G9(Je.createContext(null));class V9 extends Je.Component{render(){return Je.createElement(Xy.Provider,{value:this._reactInternals},this.props.children)}}function gL(){const e=Je.useContext(Xy);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=Je.useId();return Je.useMemo(()=>{for(const n of[e,e==null?void 0:e.alternate]){if(!n)continue;const i=$9(n,!1,a=>{let o=a.memoizedState;for(;o;){if(o.memoizedState===t)return!0;o=o.next}});if(i)return i}},[e,t])}function vL(){const e=gL(),[t]=Je.useState(()=>new Map);t.clear();let r=e;for(;r;){if(r.type&&typeof r.type=="object"){const i=r.type._context===void 0&&r.type.Provider===r.type?r.type:r.type._context;i&&i!==Xy&&!t.has(i)&&t.set(i,Je.useContext(G9(i)))}r=r.return}return t}function q9(){const e=vL();return Je.useMemo(()=>Array.from(e.keys()).reduce((t,r)=>n=>Je.createElement(t,null,Je.createElement(r.Provider,pL(v4({},n),{value:e.get(r)}))),t=>Je.createElement(V9,v4({},t))),[e])}function mL(e){const t=ht.useRef({});return ht.useLayoutEffect(()=>{t.current=e}),ht.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const yL=e=>{const t=ht.useRef(),r=ht.useRef(),n=ht.useRef(),i=mL(e),a=q9(),o=l=>{const{forwardedRef:u}=e;u&&(typeof u=="function"?u(l):u.current=l)};return ht.useLayoutEffect(()=>(r.current=new wc.Stage({width:e.width,height:e.height,container:t.current}),o(r.current),n.current=us.createContainer(r.current,z9.LegacyRoot,!1,null),us.updateContainer(ht.createElement(a,{},e.children),n.current),()=>{wc.isBrowser&&(o(null),us.updateContainer(null,n.current,null),r.current.destroy())}),[]),ht.useLayoutEffect(()=>{o(r.current),Vp(r.current,e,i),us.updateContainer(ht.createElement(a,{},e.children),n.current,null)}),ht.createElement("div",{ref:t,id:e.id,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},bL="Layer",_L="FastLayer",wh="Group",wL="Label",SL="Rect",EL="Circle",OL="Ellipse",xL="Wedge",PL="Line",CL="Sprite",kL="Image",TL="Text",AL="TextPath",RL="Star",ML="Ring",LL="Arc",NL="Tag",IL="Path",DL="RegularPolygon",jL="Arrow",FL="Shape",zL="Transformer",us=wM(sL);us.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:ht.version,rendererPackageName:"react-konva"});const BL=ht.forwardRef((e,t)=>ht.createElement(V9,{},ht.createElement(yL,{...e,forwardedRef:t}))),UL=SM,HL=Object.freeze(Object.defineProperty({__proto__:null,Arc:LL,Arrow:jL,Circle:EL,Ellipse:OL,FastLayer:_L,Group:wh,Image:kL,KonvaRenderer:us,Label:wL,Layer:bL,Line:PL,Path:IL,Rect:SL,RegularPolygon:DL,Ring:ML,Shape:FL,Sprite:CL,Stage:BL,Star:RL,Tag:NL,Text:TL,TextPath:AL,Transformer:zL,Wedge:xL,useStrictMode:UL},Symbol.toStringTag,{value:"Module"})),Ca=po(HL);var Uo=Je,qp=function(t,r,n){const i=Uo.useRef("loading"),a=Uo.useRef(),[o,l]=Uo.useState(0),u=Uo.useRef(),f=Uo.useRef(),h=Uo.useRef();return(u.current!==t||f.current!==r||h.current!==n)&&(i.current="loading",a.current=void 0,u.current=t,f.current=r,h.current=n),Uo.useLayoutEffect(function(){if(!t)return;var E=document.createElement("img");function w(){i.current="loaded",a.current=E,l(Math.random())}function p(){i.current="failed",a.current=void 0,l(Math.random())}return E.addEventListener("load",w),E.addEventListener("error",p),r&&(E.crossOrigin=r),n&&(E.referrerPolicy=n),E.src=t,function(){E.removeEventListener("load",w),E.removeEventListener("error",p)}},[t,r,n]),[a.current,i.current]};const $L=xh(qp);var W9={},Zy={},GL=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};const VL=e=>{const t=window.getComputedStyle(e).position;return!(t==="absolute"||t==="relative")};function K9(e=()=>{}){const t=ht.useRef(e);return t.current=e,ht.useCallback((...r)=>t.current.apply(null,r),[])}const qL=({children:e,groupProps:t,divProps:r,transform:n,transformFunc:i})=>{const a=q9(),o=ht.useRef(null);ht.useRef();const[l]=ht.useState(()=>document.createElement("div")),u=ht.useMemo(()=>Dd.createRoot(l),[l]),f=n??!0,h=K9(()=>{if(f&&o.current){let b=o.current.getAbsoluteTransform().decompose();i&&(b=i(b)),l.style.position="absolute",l.style.zIndex="10",l.style.top="0px",l.style.left="0px",l.style.transform=`translate(${b.x}px, ${b.y}px) rotate(${b.rotation}deg) scaleX(${b.scaleX}) scaleY(${b.scaleY})`,l.style.transformOrigin="top left"}else l.style.position="",l.style.zIndex="",l.style.top="",l.style.left="",l.style.transform="",l.style.transformOrigin="";const E=r||{},{style:w}=E,p=GL(E,["style"]);Object.assign(l.style,w),Object.assign(l,p)});return ht.useLayoutEffect(()=>{var E;const w=o.current;if(!w)return;const p=(E=w.getStage())===null||E===void 0?void 0:E.container();if(p)return p.appendChild(l),f&&VL(p)&&(p.style.position="relative"),w.on("absoluteTransformChange",h),h(),()=>{var S;w.off("absoluteTransformChange",h),(S=l.parentNode)===null||S===void 0||S.removeChild(l)}},[f]),ht.useLayoutEffect(()=>{h()},[r,i]),ht.useLayoutEffect(()=>{u.render(ht.createElement(a,null,e))}),ht.useLayoutEffect(()=>()=>{setTimeout(()=>{u.unmount()})},[]),ht.createElement(wh,Object.assign({ref:o},t))},WL=({selector:e,enabled:t,children:r})=>{const n=ht.useRef(null),i=ht.useRef(null),a=ht.useRef(),o=t??!0;return ht.useLayoutEffect(()=>{if(!n.current||!i.current)return;a.current=i.current;const u=n.current.getStage().findOne(e);o&&u?i.current.moveTo(u):i.current.moveTo(n.current);const f=n.current.getLayer();if(f&&(f.batchDraw(),u)){const h=u.getLayer();if(!h)return;h.batchDraw()}},[e,o]),ht.useEffect(()=>()=>{var l;(l=a.current)===null||l===void 0||l.destroy()},[]),ht.createElement(wh,{name:"_outer_portal",ref:n},ht.createElement(wh,{name:"_inner_portal",ref:i},r))},KL=Object.freeze(Object.defineProperty({__proto__:null,Html:qL,Portal:WL,useEvent:K9,useImage:$L},Symbol.toStringTag,{value:"Module"})),qc=po(KL);function YL(e,t){return Object.keys(e.values).forEach(r=>e.values[r]=e.values[r]&&parseFloat(e.values[r].toFixed(t))),e}function Y9(e,t,r){const n=t-1,i=r[Z9(n,r.length)];return i.marker!=="Z"?i:Y9(e,n,r)}function X9(e,t,r){const n=t+1,i=r[Z9(n,r.length)];return i.marker==="Z"?X9(e,n,r):i}function XL(e,t,r){let n=r[t-1]||{values:{x:0,y:0}};if(e.marker===e.marker.toLowerCase())switch(e.marker=e.marker.toUpperCase(),e.marker){case"M":e.values.x+=n.values.x,e.values.y+=n.values.y;break;case"L":case"A":e.values.x+=n.values.x,e.values.y+=n.values.y;break;case"H":e.marker="L",e.values.x+=n.values.x,e.values.y=n.values.y;break;case"V":e.marker="L",e.values.x=n.values.x,e.values.y+=n.values.y;break;case"C":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x1+=n.values.x,e.values.y1+=n.values.y,e.values.x2+=n.values.x,e.values.y2+=n.values.y;break;case"S":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x2+=n.values.x,e.values.y2+=n.values.y;break;case"Q":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x1+=n.values.x,e.values.y1+=n.values.y;break;case"T":e.values.x+=n.values.x,e.values.y+=n.values.y;break}else if(e.marker===e.marker.toUpperCase())switch(e.marker){case"H":e.marker="L",e.values.y=n.values.y;break;case"V":e.marker="L",e.values.x=n.values.x;break}if(e.marker==="Z"){let a=function(l,u){return l[u].marker==="M"?l[u]:a(l,u-1)};var i=a;let o=a(r,t);e.values.x=o.values.x,e.values.y=o.values.y}return e}function ZL(e,t){const r=[];switch(e.toUpperCase()){case"M":for(let n=0;n<t.length;n+=2){let i;e===e.toUpperCase()?i=n===0?"M":"L":i=n===0?"m":"l",r.push({marker:i,values:{x:t[n],y:t[n+1]}})}break;case"L":for(let n=0;n<t.length;n+=2)r.push({marker:e,values:{x:t[n],y:t[n+1]}});break;case"H":for(let n=0;n<t.length;n++)r.push({marker:e,values:{x:t[n],y:0}});break;case"V":for(let n=0;n<t.length;n++)r.push({marker:e,values:{x:0,y:t[n]}});break;case"C":for(let n=0;n<t.length;n+=6)r.push({marker:e,values:{x1:t[n],y1:t[n+1],x2:t[n+2],y2:t[n+3],x:t[n+4],y:t[n+5]}});break;case"S":for(let n=0;n<t.length;n+=4)r.push({marker:e,values:{x2:t[n],y2:t[n+1],x:t[n+2],y:t[n+3]}});break;case"Q":for(let n=0;n<t.length;n+=4)r.push({marker:e,values:{x1:t[n],y1:t[n+1],x:t[n+2],y:t[n+3]}});break;case"T":for(let n=0;n<t.length;n+=2)r.push({marker:e,values:{x:t[n],y:t[n+1]}});break;case"A":for(let n=0;n<t.length;n+=7)r.push({marker:e,values:{radiusX:t[n],radiusY:t[n+1],rotation:t[n+2],largeArc:t[n+3],sweep:t[n+4],x:t[n+5],y:t[n+6]}});break;case"Z":r.push({marker:e,values:{x:0,y:0}});break}return r}function Z9(e,t){return(e%t+t)%t}function QL(e,t,r){if(t!==0&&e.marker==="L"){let n=r[t-1];["x","y"].every(a=>Math.round(Math.abs(n.values[a]-e.values[a]))===0)&&(e.overlap=!0)}return e}function vm(e,t){const r=["x","y"].every(n=>Math.round(Math.abs(e[t].values[n]-e[0].values[n]))===0);e[t].marker==="L"&&r&&(e[t].overlap=!0,vm(e,t-1)),e[t].marker==="Z"&&vm(e,t-1)}function JL(e,t,r){const n=w4(e.values,r.values),i=w4(t.values,e.values);return Math.min(i,n)}function _4(e,t){return Math.atan2(t.x-e.x,t.y-e.y)}function w4(e,t){const r=e.x-t.x,n=e.y-t.y;return Math.sqrt(Math.pow(r,2)+Math.pow(n,2))}function S4(e,t){return Math.sin(e)*t}function E4(e,t){return Math.cos(e)*t}function O4(e,t){const r=t/Math.tan(e);return r===1/0||r===-1/0||isNaN(r)?t:r}function eN(e,t){return t*Math.tan(e)}function tN(e,t){let r,n=0,i=e*(180/Math.PI);return i<0&&i>=-180||i>180&&i<360?r=O4(e/2,-t):(r=O4(e/2,t),n=1,r===1/0&&(r=t)),{offset:r,sweepFlag:n}}function rN(e){const t=["radiusX","radiusY","rotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return e.map(r=>{let n="";if(r.marker!=="Z"){const i=Object.keys(r.values);n=t.filter(a=>i.indexOf(a)!==-1).map(a=>r.values[a]).join()}return`${r.marker}${n}`}).join("").trim()}function Q9(e){const t=/[MmLlSsQqLlHhVvCcSsQqTtAaZz]/g,r=/-?[0-9]*\.?\d+/g;return[...e.matchAll(t)].map(n=>({marker:n[0],index:n.index})).reduceRight((n,i)=>{const a=e.substring(i.index,n.length?n[n.length-1].index:e.length);return n.concat([{marker:i.marker,index:i.index,chunk:a.length>0?a.substr(1,a.length-1):a}])},[]).reverse().flatMap(n=>{const i=n.chunk.match(r),a=i?i.map(parseFloat):[];return ZL(n.marker,a)}).map(XL)}function J9(e,t,r){let n=[],i=[];return r&&e.forEach(a=>YL(a,r)),e.forEach(a=>{a.marker==="M"&&n.push([]),n[n.length-1].push(a)}),n.forEach(a=>{a.map(QL),vm(a,a.length-1);const o=a[a.length-1].marker=="Z";a.filter(l=>!l.overlap).map((l,u,f)=>{const E=Y9(l,u,f),w=X9(l,u,f),p=_4(l.values,E.values),S=_4(l.values,w.values),b=S-p,y=b*(180/Math.PI),v=JL(l,E,w),m=Math.abs(eN(b/2,v/2)),d=Math.min(t,m),g=tN(b,d),_=g.offset,k=g.sweepFlag,C=(u==0||u==f.length-1)&&!o;switch(l.marker){case"M":case"L":const P=[l.values.x+S4(p,_),l.values.y+E4(p,_)],O=[l.values.x+S4(S,_),l.values.y+E4(S,_)];C?i.push({marker:l.marker,values:l.values}):i.push({marker:l.marker,values:{x:parseFloat(P[0].toFixed(3)),y:parseFloat(P[1].toFixed(3))}}),!C&&(w.marker==="L"||w.marker==="M")&&i.push({marker:"A",radius:d,values:{radiusX:parseFloat(d.toFixed(3)),radiusY:parseFloat(d.toFixed(3)),rotation:y,largeArc:0,sweep:k,x:parseFloat(O[0].toFixed(3)),y:parseFloat(O[1].toFixed(3))}});break;case"C":case"S":case"Q":case"T":case"A":case"Z":i.push({marker:l.marker,values:l.values});break}})}),{path:rN(i),commands:i}}function nN(e,t,r){return J9([...Q9(e)],t,r)}const iN=Object.freeze(Object.defineProperty({__proto__:null,parsePath:Q9,roundCommands:J9,roundCorners:nN},Symbol.toStringTag,{value:"Module"})),aN=po(iN);var Wc={},Qy={},Jy={},Ol=Ol||{};Ol.stringify=function(){var e={"visit_linear-gradient":function(t){return e.visit_gradient(t)},"visit_repeating-linear-gradient":function(t){return e.visit_gradient(t)},"visit_radial-gradient":function(t){return e.visit_gradient(t)},"visit_repeating-radial-gradient":function(t){return e.visit_gradient(t)},visit_gradient:function(t){var r=e.visit(t.orientation);return r&&(r+=", "),t.type+"("+r+e.visit(t.colorStops)+")"},visit_shape:function(t){var r=t.value,n=e.visit(t.at),i=e.visit(t.style);return i&&(r+=" "+i),n&&(r+=" at "+n),r},"visit_default-radial":function(t){var r="",n=e.visit(t.at);return n&&(r+=n),r},"visit_extent-keyword":function(t){var r=t.value,n=e.visit(t.at);return n&&(r+=" at "+n),r},"visit_position-keyword":function(t){return t.value},visit_position:function(t){return e.visit(t.value.x)+" "+e.visit(t.value.y)},"visit_%":function(t){return t.value+"%"},visit_em:function(t){return t.value+"em"},visit_px:function(t){return t.value+"px"},visit_literal:function(t){return e.visit_color(t.value,t)},visit_hex:function(t){return e.visit_color("#"+t.value,t)},visit_rgb:function(t){return e.visit_color("rgb("+t.value.join(", ")+")",t)},visit_rgba:function(t){return e.visit_color("rgba("+t.value.join(", ")+")",t)},visit_color:function(t,r){var n=t,i=e.visit(r.length);return i&&(n+=" "+i),n},visit_angular:function(t){return t.value+"deg"},visit_directional:function(t){return"to "+t.value},visit_array:function(t){var r="",n=t.length;return t.forEach(function(i,a){r+=e.visit(i),a<n-1&&(r+=", ")}),r},visit:function(t){if(!t)return"";var r="";if(t instanceof Array)return e.visit_array(t,r);if(t.type){var n=e["visit_"+t.type];if(n)return n(t);throw Error("Missing visitor visit_"+t.type)}else throw Error("Invalid node.")}};return function(t){return e.visit(t)}}();var Ol=Ol||{};Ol.parse=function(){var e={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},t="";function r(q){var z=new Error(t+": "+q);throw z.source=t,z}function n(){var q=i();return t.length>0&&r("Invalid input not EOF"),q}function i(){return d(a)}function a(){return o("linear-gradient",e.linearGradient,u)||o("repeating-linear-gradient",e.repeatingLinearGradient,u)||o("radial-gradient",e.radialGradient,E)||o("repeating-radial-gradient",e.repeatingRadialGradient,E)}function o(q,z,W){return l(z,function(R){var M=W();return M&&($(e.comma)||r("Missing comma before color stops")),{type:q,orientation:M,colorStops:d(g)}})}function l(q,z){var W=$(q);if(W){$(e.startCall)||r("Missing (");var R=z(W);return $(e.endCall)||r("Missing )"),R}}function u(){return f()||h()}function f(){return U("directional",e.sideOrCorner,1)}function h(){return U("angular",e.angleValue,1)}function E(){var q,z=w(),W;return z&&(q=[],q.push(z),W=t,$(e.comma)&&(z=w(),z?q.push(z):t=W)),q}function w(){var q=p()||S();if(q)q.at=y();else{var z=b();if(z){q=z;var W=y();W&&(q.at=W)}else{var R=v();R&&(q={type:"default-radial",at:R})}}return q}function p(){var q=U("shape",/^(circle)/i,0);return q&&(q.style=I()||b()),q}function S(){var q=U("shape",/^(ellipse)/i,0);return q&&(q.style=A()||b()),q}function b(){return U("extent-keyword",e.extentKeywords,1)}function y(){if(U("position",/^at/,0)){var q=v();return q||r("Missing positioning value"),q}}function v(){var q=m();if(q.x||q.y)return{type:"position",value:q}}function m(){return{x:A(),y:A()}}function d(q){var z=q(),W=[];if(z)for(W.push(z);$(e.comma);)z=q(),z?W.push(z):r("One extra comma");return W}function g(){var q=_();return q||r("Expected color definition"),q.length=A(),q}function _(){return C()||O()||P()||k()}function k(){return U("literal",e.literalColor,0)}function C(){return U("hex",e.hexColor,1)}function P(){return l(e.rgbColor,function(){return{type:"rgb",value:d(x)}})}function O(){return l(e.rgbaColor,function(){return{type:"rgba",value:d(x)}})}function x(){return $(e.number)[1]}function A(){return U("%",e.percentageValue,1)||L()||I()}function L(){return U("position-keyword",e.positionKeywords,1)}function I(){return U("px",e.pixelValue,1)||U("em",e.emValue,1)}function U(q,z,W){var R=$(z);if(R)return{type:q,value:R[W]}}function $(q){var z,W;return W=/^[\n\r\t\s]+/.exec(t),W&&Z(W[0].length),z=q.exec(t),z&&Z(z[0].length),z}function Z(q){t=t.substr(q)}return function(q){return t=q.toString(),n()}}();Jy.parse=Ol.parse;Jy.stringify=Ol.stringify;(function(e){var t=me&&me.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.isGradient=void 0;const r=t(Jy),n=o=>o.indexOf("linear-gradient")>=0;e.isGradient=n;const i=o=>o.type==="hex"?"#"+o.value:o.type==="literal"?o.value:`${o.type}(${o.value.join(",")})`,a=o=>{if(!(0,e.isGradient)(o))return{rotation:0,stops:[{offset:0,color:o},{offset:1,color:o}]};const l=r.default.parse(o)[0];return{rotation:parseFloat(l.orientation.value),stops:l.colorStops.map((u,f)=>({color:i(u),offset:u.length?parseFloat(u.length.value)/100:f/(l.colorStops.length-1)}))}};e.parseColor=a})(Qy);(function(e){var t=me&&me.__createBinding||(Object.create?function(f,h,E,w){w===void 0&&(w=E);var p=Object.getOwnPropertyDescriptor(h,E);p&&!("get"in p?!h.__esModule:p.writable||p.configurable)||(p={enumerable:!0,get:function(){return h[E]}}),Object.defineProperty(f,w,p)}:function(f,h,E,w){w===void 0&&(w=E),f[w]=h[E]}),r=me&&me.__setModuleDefault||(Object.create?function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}:function(f,h){f.default=h}),n=me&&me.__importStar||function(f){if(f&&f.__esModule)return f;var h={};if(f!=null)for(var E in f)E!=="default"&&Object.prototype.hasOwnProperty.call(f,E)&&t(h,f,E);return r(h,f),h},i=me&&me.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.useColor=void 0;const a=i(Je),o=n(Qy),l=i(Si),u=(f,h=f.fill,E="fill")=>a.default.useMemo(()=>{if(!o.isGradient(h))return{[E]:h};const{stops:w,rotation:p}=o.parseColor(h),S={x:f.a.width/2,y:f.a.height/2},b=Math.sqrt(Math.pow(S.x,2)+Math.pow(S.y,2)),y=l.default.Util.degToRad(p)-Math.PI/2,v=[];return w.forEach(({offset:m,color:d})=>{v.push(m,d)}),E==="fill"?{fillLinearGradientStartPointX:S.x-b*Math.cos(y),fillLinearGradientStartPointY:S.y-b*Math.sin(y),fillLinearGradientColorStops:v,fillLinearGradientEndPointX:S.x+b*Math.cos(y),fillLinearGradientEndPointY:S.y+b*Math.sin(y),fill:w[1].color,fillPriority:"linear-gradient"}:{strokeLinearGradientStartPointX:S.x-b*Math.cos(y),strokeLinearGradientStartPointY:S.y-b*Math.sin(y),strokeLinearGradientColorStops:v,strokeLinearGradientEndPointX:S.x+b*Math.cos(y),strokeLinearGradientEndPointY:S.y+b*Math.sin(y)}},[h,f.width,f.height]);e.useColor=u})(Wc);var $i={},xl={};(function(e){var t=me&&me.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.useFadeIn=e.isAnimationUsed=e.toggleFadeInAnimation=void 0;const r=t(Je),n=t(Si);let i=!1;const a=(u=!i)=>{i=u};e.toggleFadeInAnimation=a;const o=()=>i;function l(u,f){const h=r.default.useRef();r.default.useLayoutEffect(()=>{h.current&&h.current.destroy()},[f]),r.default.useLayoutEffect(()=>{if(!i)return;const E=u.current.opacity();return E?(u.current.opacity(0),h.current=new n.default.Tween({node:u.current,opacity:E,onFinish:()=>{var w;(w=h.current)===null||w===void 0||w.destroy()}}),h.current.play(),()=>{var w;(w=h.current)===null||w===void 0||w.destroy()}):void 0},[])}e.isAnimationUsed=o,e.useFadeIn=l})(xl);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.triggerLoadError=e.onLoadError=e.whenLoaded=e.decrementLoader=e.incrementLoader=e.getFontLoadTimeout=e.setFontLoadTimeout=e.getAssetLoadTimeout=e.setAssetLoadTimeout=void 0;const t=xl;let r=0,n=[],i=3e4;const a=v=>{i=v};e.setAssetLoadTimeout=a;const o=()=>i;e.getAssetLoadTimeout=o;let l=6e3;const u=v=>{l=v};e.setFontLoadTimeout=u;const f=()=>l;function h(v){r+=1;let m=!1;const d=setTimeout(()=>{m||(y(`Timeout loading asset ${v}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",v),m=!0,E())},i);return()=>{m||(clearTimeout(d),E())}}function E(){r-=1,r===0&&(n.forEach(v=>v()),n=[])}function w(v){r===0?v():n.push(v)}function p(){return new Promise(v=>w(()=>{(0,t.isAnimationUsed)()?setTimeout(v,300):v(!0)}))}e.getFontLoadTimeout=f,e.incrementLoader=h,e.decrementLoader=E,e.whenLoaded=p;let S=[];function b(v){S.push(v)}function y(v){S.forEach(m=>m(v))}e.onLoadError=b,e.triggerLoadError=y})($i);var Xs={};(function(e){var t=me&&me.__createBinding||(Object.create?function(I,U,$,Z){Z===void 0&&(Z=$);var q=Object.getOwnPropertyDescriptor(U,$);q&&!("get"in q?!U.__esModule:q.writable||q.configurable)||(q={enumerable:!0,get:function(){return U[$]}}),Object.defineProperty(I,Z,q)}:function(I,U,$,Z){Z===void 0&&(Z=$),I[Z]=U[$]}),r=me&&me.__setModuleDefault||(Object.create?function(I,U){Object.defineProperty(I,"default",{enumerable:!0,value:U})}:function(I,U){I.default=U}),n=me&&me.__importStar||function(I){if(I&&I.__esModule)return I;var U={};if(I!=null)for(var $ in I)$!=="default"&&Object.prototype.hasOwnProperty.call(I,$)&&t(U,I,$);return r(U,I),U};Object.defineProperty(e,"__esModule",{value:!0}),e.injectCustomFont=e.injectGoogleFont=e.getGoogleFontsVariants=e.setGoogleFontsVariants=e.loadFont=e.isFontLoaded=e.replaceGlobalFonts=e.removeGlobalFont=e.addGlobalFont=e.globalFonts=e.getFontsList=e.setGoogleFonts=e.isGoogleFontChanged=void 0;const i=n(Ki),a=$i;let o=i.observable(["Roboto","Amatic SC","Press Start 2P","Marck Script","Rubik Mono One"]),l=i.observable({value:!1});function u(){return l.value}function f(I){I!=="default"?(l.value=!0,o.splice(0,o.length),o.push(...I)):l.value=!1}function h(){return o}function E(I){e.globalFonts.push(I)}function w(I){const U=e.globalFonts.findIndex($=>$.fontFamily===I);U!==-1&&e.globalFonts.splice(U,1)}function p(I){e.globalFonts.replace(I)}e.isGoogleFontChanged=u,e.setGoogleFonts=f,e.getFontsList=h,e.globalFonts=i.observable([]),e.addGlobalFont=E,e.removeGlobalFont=w,e.replaceGlobalFonts=p;var S="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1",b=document.createElement("canvas");function y(){return m("Arial")}function v(){return m("Times","Times")}function m(I,U="Arial"){var $=b.getContext("2d");return $.font=`normal 40px '${I}', ${U}`,$.measureText(S).width}const d={Arial:!0},g=I=>!!d[I];async function _(I){var U;if(d[I])return;const $=!!(!((U=document.fonts)===null||U===void 0)&&U.load),Z=y();if($)try{await document.fonts.load(`16px '${I}'`);const R=m(I);if(Z!==R)return void(d[I]=!0)}catch{}const q=v(),z=m(I),W=Math.min(6e3,(0,a.getFontLoadTimeout)())/60;for(let R=0;R<W;R++){const M=m(I,"Arial"),F=m(I,"Times");if(M!==z||M!==Z||F!==q)return void(d[I]=!0);await new Promise(D=>setTimeout(D,60))}console.warn(`Timeout for loading font "${I}". Looks like polotno can't load it. Is it a correct font family?`),(0,a.triggerLoadError)(`Timeout for loading font "${I}"`)}e.isFontLoaded=g,e.loadFont=_;const k={};let C="400,400italic,700,700italic";function P(I){C=I}function O(){return C}function x(I){if(k[I])return;const U=`https://fonts.googleapis.com/css?family=${I.replace(/ /g,"+")}:${C}`,$=document.createElement("link");$.type="text/css",$.href=U,$.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild($),k[I]=!0}e.setGoogleFontsVariants=P,e.getGoogleFontsVariants=O,e.injectGoogleFont=x;const A={};function L(I){const U=I.fontFamily;if(A[U]||!I.url&&!I.styles)return;const $=document.createElement("style");$.type="text/css";const Z=I.styles||(I.url?[{src:`url("${I.url}")`}]:[]);let q="";Z.forEach(z=>{q+=`
77
+ @font-face {
78
+ font-family: '${U}';
79
+ src: ${z.src};
80
+ font-style: ${z.fontStyle||"normal"};
81
+ font-weight: ${z.fontWeight||"normal"};
82
+ }
83
+ `}),$.innerHTML=q,document.getElementsByTagName("head")[0].appendChild($),A[I.fontFamily]=!0}e.injectCustomFont=L})(Xs);var Yn={};(function(e){var t=me&&me.__createBinding||(Object.create?function(a,o,l,u){u===void 0&&(u=l);var f=Object.getOwnPropertyDescriptor(o,l);f&&!("get"in f?!o.__esModule:f.writable||f.configurable)||(f={enumerable:!0,get:function(){return o[l]}}),Object.defineProperty(a,u,f)}:function(a,o,l,u){u===void 0&&(u=l),a[u]=o[l]}),r=me&&me.__setModuleDefault||(Object.create?function(a,o){Object.defineProperty(a,"default",{enumerable:!0,value:o})}:function(a,o){a.default=o}),n=me&&me.__importStar||function(a){if(a&&a.__esModule)return a;var o={};if(a!=null)for(var l in a)l!=="default"&&Object.prototype.hasOwnProperty.call(a,l)&&t(o,a,l);return r(o,a),o};Object.defineProperty(e,"__esModule",{value:!0}),e.setAnimationsEnabled=e.setTextOverflow=e.setForceTextFit=e.useDownScaling=e.setDownScalingEnabled=e.useHtmlTextRender=e.useRemoveBackground=e.setTextVerticalResizeEnabled=e.flags=void 0;const i=n(Ki);e.flags=i.observable({imageDownScalingEnabled:!0,removeBackgroundEnabled:!0,htmlRenderEnabled:!1,forceTextFitEnabled:!1,textVerticalResizeEnabled:!1,textOverflow:"resize",animationsEnabled:!1}),e.setTextVerticalResizeEnabled=i.action(a=>{e.flags.textVerticalResizeEnabled=a}),e.useRemoveBackground=i.action(a=>{e.flags.removeBackgroundEnabled=a}),e.useHtmlTextRender=i.action(a=>{e.flags.htmlRenderEnabled=a}),e.setDownScalingEnabled=i.action(a=>{e.flags.imageDownScalingEnabled=a}),e.useDownScaling=i.action(a=>{console.warn("useDownScaling is deprecated. Use setDownScalingEnabled instead."),(0,e.setDownScalingEnabled)(a)}),e.setForceTextFit=i.action(a=>{console.warn("setForceTextFit is deprecated. Use setTextOverflow instead."),e.flags.textOverflow="change-font-size"}),e.setTextOverflow=i.action(a=>{e.flags.textOverflow=a}),e.setAnimationsEnabled=i.action(a=>{e.flags.animationsEnabled=a})})(Yn);var e2={};(function(e){function t(r=""){return(r.match(/<\/p>/gi)||[]).length>1&&(r=r.replace(/<\/p>/gi,(n,i,a)=>(a.slice(i+n.length).match(/<\/p>/gi)||[]).length>0?`
84
+ `:n)),r.replace(/(<([^>]+)>)/gi,"")}Object.defineProperty(e,"__esModule",{value:!0}),e.removeTags=void 0,e.removeTags=t})(e2);var Kc={};(function(e){var t=me&&me.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(e,"__esModule",{value:!0}),e.applyFilter=void 0;const r=t(Si);function n(i,a){var o;const l={filters:[]};a.brightnessEnabled&&(l.filters.push(r.default.Filters.Brighten),l.brightness=a.brightness),a.blurEnabled&&(l.filters.push(r.default.Filters.Blur),l.blurRadius=a.blurRadius),a.sepiaEnabled&&l.filters.push(r.default.Filters.Sepia),a.grayscaleEnabled&&l.filters.push(r.default.Filters.Grayscale),i.setAttrs(l),l.filters.length?i.cache({pixelRatio:a.store._elementsPixelRatio}):i.clearCache(),(o=i.getLayer())===null||o===void 0||o.batchDraw()}e.applyFilter=n})(Kc);var Pl={};(function(e){var t=me&&me.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(e,"__esModule",{value:!0}),e.Highlighter=e.setHighlighterStyle=void 0;const r=t(Je),n=_i,i=Ca,a={stroke:"rgb(0, 161, 255)",strokeWidth:2},o=l=>{Object.assign(a,l)};e.setHighlighterStyle=o,e.Highlighter=(0,n.observer)(({element:l})=>r.default.createElement(i.Rect,Object.assign({name:"highlighter",x:l.a.x,y:l.a.y,rotation:l.a.rotation,width:l.a.width,height:l.a.height,listening:!1,strokeScaleEnabled:!1},a)))})(Pl);var Po={};(function(e){var t=me&&me.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(e,"__esModule",{value:!0}),e.useMobile=e.isTouchDevice=e.mobileStyle=e.isMobile=e.MOBILE_BREAKPOINT=void 0;const r=t(Je);e.MOBILE_BREAKPOINT=800;const n=()=>window.innerWidth<=e.MOBILE_BREAKPOINT;e.isMobile=n;const i=l=>`
85
+ @media (max-width: ${e.MOBILE_BREAKPOINT}px) {
86
+ ${l}
87
+ }
88
+
89
+ .polotno-mobile & {
90
+ ${l}
91
+ }
92
+ `;e.mobileStyle=i;const a=()=>"ontouchstart"in window||navigator.maxTouchPoints>0;e.isTouchDevice=a;const o=()=>{const[l,u]=r.default.useState((0,e.isMobile)());return r.default.useEffect(()=>{const f=()=>{u((0,e.isMobile)())};return window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f)}},[]),l};e.useMobile=o})(Po);var x4={},e7="warn";function t7(e){e7=e}function r7(){return e7}function oN(e){t7(e)}var fr;(function(e){e.afterCreate="afterCreate",e.afterAttach="afterAttach",e.afterCreationFinalization="afterCreationFinalization",e.beforeDetach="beforeDetach",e.beforeDestroy="beforeDestroy"})(fr||(fr={}));var mm=function(e,t){return mm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},mm(e,t)};function Dt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");mm(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var hr=function(){return hr=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},hr.apply(this,arguments)};function lN(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function n7(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(f){return function(h){return u([f,h])}}function u(f){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,f[0]&&(r=0)),r;)try{if(n=1,i&&(a=f[0]&2?i.return:f[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,f[1])).done)return a;switch(i=0,a&&(f=[f[0]&2,a.value]),f[0]){case 0:case 1:a=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,i=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!a||f[1]>a[0]&&f[1]<a[3])){r.label=f[1];break}if(f[0]===6&&r.label<a[1]){r.label=a[1],a=f;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(f);break}a[2]&&r.ops.pop(),r.trys.pop();continue}f=t.call(e,r)}catch(h){f=[6,h],i=0}finally{n=a=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function Zu(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function qi(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a}function Wi(e,t,r){if(arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}function Yc(e){return Ge(e).type}function sN(e,t){return Ge(e).getChildType(t)}function i7(e,t){return Ge(e).onPatch(t)}function uN(e,t){return Ge(e).onSnapshot(t)}function Ls(e,t){Ge(e).applyPatches(s2(t))}function cN(e,t){var r={patches:[],inversePatches:[]},n={},i,a={get recording(){return!!i},get patches(){return n.patches||(n.patches=r.patches.slice()),n.patches},get reversedInversePatches(){return n.reversedInversePatches||(n.reversedInversePatches=r.inversePatches.slice().reverse()),n.reversedInversePatches},get inversePatches(){return n.inversePatches||(n.inversePatches=r.inversePatches.slice()),n.inversePatches},stop:function(){i&&(i(),i=void 0)},resume:function(){i||(i=i7(e,function(o,l){t&&!t(o,l,i2())||(r.patches.push(o),r.inversePatches.push(l),n.patches=void 0,n.inversePatches=void 0,n.reversedInversePatches=void 0)}))},replay:function(o){Ls(o||e,r.patches)},undo:function(o){Ls(o||e,r.inversePatches.slice().reverse())}};return a.resume(),a}function fN(e){var t=Ge(e);if(!t.isRoot)throw new Fe("`protect` can only be invoked on root nodes");t.isProtectionEnabled=!0}function dN(e){var t=Ge(e);if(!t.isRoot)throw new Fe("`unprotect` can only be invoked on root nodes");t.isProtectionEnabled=!1}function hN(e){return Ge(e).isProtected}function a7(e,t){return Ge(e).applySnapshot(t)}function t2(e,t){t===void 0&&(t=!0);var r=Ge(e);return t?r.snapshot:r.type.getSnapshot(r,!1)}function pN(e,t){t===void 0&&(t=1);for(var r=Ge(e).parent;r;){if(--t===0)return!0;r=r.parent}return!1}function gN(e,t){t===void 0&&(t=1);for(var r=t,n=Ge(e).parent;n;){if(--r===0)return n.storedValue;n=n.parent}throw new Fe("Failed to find the parent of ".concat(Ge(e)," at depth ").concat(t))}function vN(e,t){for(var r=Ge(e).parent;r;){if(t.is(r.storedValue))return!0;r=r.parent}return!1}function mN(e,t){for(var r=Ge(e).parent;r;){if(t.is(r.storedValue))return r.storedValue;r=r.parent}throw new Fe("Failed to find the parent of ".concat(Ge(e)," of a given type"))}function o7(e){return Ge(e).root.storedValue}function l7(e){return Ge(e).path}function yN(e){return Fs(Ge(e).path)}function bN(e){return Ge(e).isRoot}function _N(e,t){var r=x7(Ge(e),t);return r?r.value:void 0}function wN(e,t,r){var n=Ge(t).root.identifierCache.resolve(e,Zs(r));return n==null?void 0:n.value}function s7(e){return Ge(e).identifier}function SN(e,t){t===void 0&&(t=!0);try{var r=e();if(r==null)return;if(Ct(r))return t?r2(r)?r:void 0:r;throw new Fe("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof u2)return;throw n}}function EN(e,t){t===void 0&&(t=!0);try{var r=e();if(r==null)return!1;if(Ct(r))return t?r2(r):!0;throw new Fe("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof u2)return!1;throw n}}function u7(e,t){var r=x7(Ge(e),t,!1);if(r!==void 0)try{return r.value}catch{return}}function ON(e,t){return O7(Ge(e),Ge(t))}function xN(e,t){t===void 0&&(t=!0);var r=Ge(e);return r.type.create(r.snapshot,t===!0?r.root.environment:t===!1?void 0:t)}function PN(e){return Ge(e).detach(),e}function CN(e){var t=Ge(e);t.isRoot?t.die():t.parent.removeChild(t.subpath)}function r2(e){return Ge(e).observableIsAlive}function kN(e,t){var r=Ge(e);return r.addDisposer(t),t}function TN(e){var t=Ge(e),r=t.root.environment;if(!r)throw new Fe("Failed to find the environment of ".concat(t," ").concat(t.path));return r}function AN(e){var t=Ge(e),r=t.root.environment;return!!r}function c7(e,t){var r=Ge(e);r.getChildren().forEach(function(n){Ct(n.storedValue)&&c7(n.storedValue,t)}),t(r.storedValue)}function f7(e){var t;return Ct(e)?t=Yc(e):t=e,{name:t.name,properties:hr({},t.properties)}}function RN(e){var t=Ge(e).type,r=hr(hr({},f7(t)),{actions:[],volatile:[],views:[],flowActions:[]}),n=Object.getOwnPropertyNames(e);return n.forEach(function(i){if(!(i in r.properties)){var a=Object.getOwnPropertyDescriptor(e,i);if(a.get){I8(e,i)?r.views.push(i):r.volatile.push(i);return}a.value._isFlowAction===!0&&r.flowActions.push(i),a.value._isMSTAction===!0?r.actions.push(i):j8(e,i)?r.volatile.push(i):r.views.push(i)}}),r}function MN(e){return e}function LN(e){return e}function NN(e){return e}function IN(e){return Ge(e).nodeId}var d7=function(){function e(t,r,n,i){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_escapedSubpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storedValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"aliveAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_state",{enumerable:!0,configurable:!0,writable:!0,value:Tr.INITIALIZING}),Object.defineProperty(this,"_hookSubscribers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.environment=i,this.baseSetParent(r,n)}return Object.defineProperty(e.prototype,"subpath",{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},set:function(t){var r=this.isAlive;this._state=t;var n=this.isAlive;this.aliveAtom&&r!==n&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._hookSubscribers&&this._hookSubscribers.emit(t,this,t)}}),Object.defineProperty(e.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this._hookSubscribers||(this._hookSubscribers=new A7),this._hookSubscribers.register(t,r)}}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getReconciliationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(e.prototype,"baseSetParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){this._parent=t,this._subpath=r,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(e.prototype,"path",{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getEscapedPath",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t&&(this.pathAtom||(this.pathAtom=vc("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?lo(this._subpath):""),this.parent.getEscapedPath(t)+"/"+this._escapedSubpath):""}}),Object.defineProperty(e.prototype,"isRoot",{get:function(){return this.parent===null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAlive",{get:function(){return this.state!==Tr.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDetaching",{get:function(){return this.state===Tr.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=vc("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.state===Tr.CREATED){if(this.parent){if(this.parent.state!==Tr.FINALIZED)return;this.fireHook(fr.afterAttach)}this.state=Tr.FINALIZED,t&&t()}}}),Object.defineProperty(e.prototype,"baseFinalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._hookSubscribers&&this._hookSubscribers.clearAll(),this._subpathUponDeath=this._subpath,this._pathUponDeath=this.getEscapedPath(!1),this.baseSetParent(null,""),this.state=Tr.DEAD}}),Object.defineProperty(e.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(fr.beforeDestroy)}}),e}(),Sc=function(e){Dt(t,e);function t(r,n,i,a,o){var l=e.call(this,r,n,i,a)||this;try{l.storedValue=r.createNewInstance(o)}catch(u){throw l.state=Tr.DEAD,u}return l.state=Tr.CREATED,l.finalizeCreation(),l}return Object.defineProperty(t.prototype,"root",{get:function(){if(!this.parent)throw new Fe("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.parent!==r,a=this.subpath!==n;!i&&!a||(this.environment=void 0,this.baseSetParent(this.parent,n))}}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=(this.isAlive?this.path:this.pathUponDeath)||"<root>";return"".concat(this.type.name,"@").concat(r).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Tr.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(t.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.fireInternalHook(r)}}),t}(d7);Sc.prototype.die=or(Sc.prototype.die);var DN=1,li;(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.CREATING=1]="CREATING",e[e.CREATED=2]="CREATED"})(li||(li={}));var wn;(function(e){e.Dispose="dispose",e.Patch="patch",e.Snapshot="snapshot"})(wn||(wn={}));var jN={onError:function(e){throw e}},vn=function(e){Dt(t,e);function t(r,n,i,a,o){var l=e.call(this,r,n,i,a)||this;if(Object.defineProperty(l,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++DN}),Object.defineProperty(l,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"unnormalizedIdentifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"identifierCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"isProtectionEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(l,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"hasSnapshotPostProcessor",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_applyPatches",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_applySnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_autoUnbox",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(l,"_isRunningAction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_hasSnapshotReaction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_observableInstanceState",{enumerable:!0,configurable:!0,writable:!0,value:li.UNINITIALIZED}),Object.defineProperty(l,"_childNodes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_initialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_cachedInitialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_cachedInitialSnapshotCreated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_snapshotComputed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_snapshotUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_internalEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),l._snapshotComputed=dl(function(){return l.getSnapshot()}),l.unbox=l.unbox.bind(l),l._initialSnapshot=o,l.identifierAttribute=r.identifierAttribute,n||(l.identifierCache=new nI),l._childNodes=r.initializeChildNodes(l,l._initialSnapshot),l.identifier=null,l.unnormalizedIdentifier=null,l.identifierAttribute&&l._initialSnapshot){var u=l._initialSnapshot[l.identifierAttribute];if(u===void 0){var f=l._childNodes[l.identifierAttribute];f&&(u=f.value)}if(typeof u!="string"&&typeof u!="number")throw new Fe("Instance identifier '".concat(l.identifierAttribute,"' for type '").concat(l.type.name,"' must be a string or a number"));l.identifier=Zs(u),l.unnormalizedIdentifier=u}return n?n.root.identifierCache.addNodeToCache(l):l.identifierCache.addNodeToCache(l),l}return Object.defineProperty(t.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applyPatches(r)}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applySnapshot(r)}}),Object.defineProperty(t.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(r){r===void 0&&(r=!0),this._observableInstanceState===li.UNINITIALIZED&&this.createObservableInstance(r)}}),Object.defineProperty(t.prototype,"createObservableInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n,i,a,o;r===void 0&&(r=!0),this._observableInstanceState=li.CREATING;for(var l=[],u=this.parent;u&&u._observableInstanceState===li.UNINITIALIZED;)l.unshift(u),u=u.parent;try{for(var f=Zu(l),h=f.next();!h.done;h=f.next()){var E=h.value;E.createObservableInstanceIfNeeded(!1)}}catch(b){n={error:b}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}var w=this.type;try{this.storedValue=w.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,w.finalizeNewInstance(this,this.storedValue)}catch(b){throw this.state=Tr.DEAD,b}finally{this._isRunningAction=!1}if(this._observableInstanceState=li.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=Ds,this.state=Tr.CREATED,r){this.fireHook(fr.afterCreate),this.finalizeCreation();try{for(var p=Zu(l.reverse()),S=p.next();!S.done;S=p.next()){var E=S.value;E.fireHook(fr.afterCreate),E.finalizeCreation()}}catch(b){a={error:b}}finally{try{S&&!S.done&&(o=p.return)&&o.call(p)}finally{if(a)throw a.error}}}}}),Object.defineProperty(t.prototype,"root",{get:function(){var r=this.parent;return r?r.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(fr.beforeDetach);var r=this.state;this.state=Tr.DETACHING;var n=this.root,i=n.environment,a=n.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=i,this.identifierCache=a}finally{this.state=r}}}}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r!==this.parent,a=n!==this.subpath;!i&&!a||(i?(this.environment=void 0,r.root.identifierCache.mergeCache(this),this.baseSetParent(r,n),this.fireHook(fr.afterAttach)):a&&this.baseSetParent(this.parent,n))}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;this.fireInternalHook(r);var i=this.storedValue&&typeof this.storedValue=="object"&&this.storedValue[r];typeof i=="function"&&(Cs?Cs(function(){i.apply(n.storedValue)}):i.apply(this.storedValue))}}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===li.CREATED?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(t.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,"_getCachedInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var r=this.type,n=this._childNodes,i=this._initialSnapshot;this._cachedInitialSnapshot=r.processInitialSnapshot(n,i),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(t.prototype,"isRunningAction",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(t.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r7();if(!this.isAlive&&n!=="ignore"){var i=this._getAssertAliveError(r);switch(n){case"error":throw new Fe(i);case"warn":vI(i)}}}}),Object.defineProperty(t.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getEscapedPath(!1)||this.pathUponDeath||"",i=r.subpath&&lo(r.subpath)||"",a=r.actionContext||n2();a&&a.type!=="action"&&a.parentActionEvent&&(a=a.parentActionEvent);var o="";if(a&&a.name!=null){var l=a&&a.context&&l7(a.context)||n;o="".concat(l,".").concat(a.name,"()")}return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '".concat(this.type.name,"', Path upon death: '").concat(n,"', Subpath: '").concat(i,"', Action: '").concat(o,"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.")}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.assertAlive({subpath:r}),this._autoUnbox=!1;try{return this._observableInstanceState===li.CREATED?this.type.getChildNode(this,r):this._childNodes[r]}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(Ds),this._autoUnbox=!1;try{return this._observableInstanceState===li.CREATED?this.type.getChildren(this):C7(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.type.getChildType(r)}}),Object.defineProperty(t.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.assertAlive(r),!this.isRunningAction()&&this.isProtected)throw new Fe("Cannot modify '".concat(this,"', the object is protected and can only be modified by using an action."))}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.type.removeChild(this,r)}}),Object.defineProperty(t.prototype,"unbox",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r&&(this.assertAlive({subpath:r.subpath||r.subpathUponDeath}),this._autoUnbox?r.value:r)}}),Object.defineProperty(t.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=(this.isAlive?this.path:this.pathUponDeath)||"<root>",n=this.identifier?"(id: ".concat(this.identifier,")"):"";return"".concat(this.type.name,"@").concat(r).concat(n).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this.baseFinalizeCreation(function(){var n,i;try{for(var a=Zu(r.getChildren()),o=a.next();!o.done;o=a.next()){var l=o.value;l.finalizeCreation()}}catch(u){n={error:u}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}r.fireInternalHook(fr.afterCreationFinalization)})}}),Object.defineProperty(t.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw new Fe("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(t.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this._applyPatches=Ec(this.storedValue,"@APPLY_PATCHES",function(n){n.forEach(function(i){if(!i.path){r.type.applySnapshot(r,i.value);return}var a=Fs(i.path),o=P7(r,a.slice(0,-1));o.applyPatchLocally(a[a.length-1],i)})}),this._applySnapshot=Ec(this.storedValue,"@APPLY_SNAPSHOT",function(n){if(n!==r.snapshot)return r.type.applySnapshot(r,n)}),Zo(this.storedValue,"$treenode",this),Zo(this.storedValue,"toJSON",aI)}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Tr.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==li.UNINITIALIZED&&(this.getChildren().forEach(function(r){r.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit(wn.Dispose),this._internalEventsClear(wn.Dispose))}}),Object.defineProperty(t.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(n){n.finalizeDeath()}),this.root.identifierCache.notifyDied(this);var r=this.snapshot;this._snapshotUponDeath=r,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._addSnapshotReaction(),this._internalEventsRegister(wn.Snapshot,r)}}),Object.defineProperty(t.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEventsEmit(wn.Snapshot,r)}}),Object.defineProperty(t.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsRegister(wn.Patch,r)}}),Object.defineProperty(t.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._internalEventsHasSubscribers(wn.Patch)){var i=n.path.substr(this.path.length)+(r.path?"/"+r.path:""),a=hI({},r,{path:i}),o=qi(SI(a),2),l=o[0],u=o[1];this._internalEventsEmit(wn.Patch,l,u)}this.parent&&this.parent.emitPatch(r,n)}}),Object.defineProperty(t.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsHas(wn.Dispose,r)}}),Object.defineProperty(t.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this.hasDisposer(r)){this._internalEventsRegister(wn.Dispose,r,!0);return}throw new Fe("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(t.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this._internalEventsHas(wn.Dispose,r))throw new Fe("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister(wn.Dispose,r)}}),Object.defineProperty(t.prototype,"removeMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.middlewares){var n=this.middlewares.indexOf(r);n>=0&&this.middlewares.splice(n,1)}}}),Object.defineProperty(t.prototype,"addMiddleWare",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;n===void 0&&(n=!0);var a={handler:r,includeHooks:n};return this.middlewares?this.middlewares.push(a):this.middlewares=[a],function(){i.removeMiddleware(a)}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){this.assertWritable({subpath:r}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,r,n)}}),Object.defineProperty(t.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;if(!this._hasSnapshotReaction){var n=C8(function(){return r.snapshot},function(i){return r.emitSnapshot(i)},jN);this.addDisposer(n),this._hasSnapshotReaction=!0}}}),Object.defineProperty(t.prototype,"_internalEventsHasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return!!this._internalEvents&&this._internalEvents.hasSubscribers(r)}}),Object.defineProperty(t.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){return i===void 0&&(i=!1),this._internalEvents||(this._internalEvents=new A7),this._internalEvents.register(r,n,i)}}),Object.defineProperty(t.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!!this._internalEvents&&this._internalEvents.has(r,n)}}),Object.defineProperty(t.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){this._internalEvents&&this._internalEvents.unregister(r,n)}}),Object.defineProperty(t.prototype,"_internalEventsEmit",{enumerable:!1,configurable:!0,writable:!0,value:function(r){for(var n,i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];this._internalEvents&&(n=this._internalEvents).emit.apply(n,Wi([r],qi(i),!1))}}),Object.defineProperty(t.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEvents&&this._internalEvents.clear(r)}}),Object.defineProperty(t.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),t}(d7);vn.prototype.createObservableInstance=or(vn.prototype.createObservableInstance);vn.prototype.detach=or(vn.prototype.detach);vn.prototype.die=or(vn.prototype.die);var h7,ot;(function(e){e[e.String=1]="String",e[e.Number=2]="Number",e[e.Boolean=4]="Boolean",e[e.Date=8]="Date",e[e.Literal=16]="Literal",e[e.Array=32]="Array",e[e.Map=64]="Map",e[e.Object=128]="Object",e[e.Frozen=256]="Frozen",e[e.Optional=512]="Optional",e[e.Reference=1024]="Reference",e[e.Identifier=2048]="Identifier",e[e.Late=4096]="Late",e[e.Refinement=8192]="Refinement",e[e.Union=16384]="Union",e[e.Null=32768]="Null",e[e.Undefined=65536]="Undefined",e[e.Integer=131072]="Integer",e[e.Custom=262144]="Custom",e[e.SnapshotProcessor=524288]="SnapshotProcessor",e[e.Lazy=1048576]="Lazy",e[e.Finite=2097152]="Finite",e[e.Float=4194304]="Float"})(ot||(ot={}));var p7="cannotDetermine",FN=Symbol("$type"),wa=function(){function e(t){Object.defineProperty(this,h7,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"C",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"S",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"T",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"N",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isType",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=t}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return ga(this,t),this.instantiate(null,"",r,t).value}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){throw new Fe("unimplemented method")}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t===this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=E7(t);if(n){var i=Yc(t);return this.isAssignableFrom(i)?mn():yn(r,t)}return this.isValidSnapshot(t,r)}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.validate(t,[{path:"",type:this}]).length===0}}),Object.defineProperty(e.prototype,"Type",{get:function(){throw new Fe("Factory.Type should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.Type`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"TypeWithoutSTN",{get:function(){throw new Fe("Factory.TypeWithoutSTN should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.TypeWithoutSTN`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SnapshotType",{get:function(){throw new Fe("Factory.SnapshotType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.SnapshotType`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CreationType",{get:function(){throw new Fe("Factory.CreationType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.CreationType`")},enumerable:!1,configurable:!0}),e}();h7=FN;wa.prototype.create=or(wa.prototype.create);var Ns=function(e){Dt(t,e);function t(r){var n=e.call(this,r)||this;return Object.defineProperty(n,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),n}return Object.defineProperty(t.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r===void 0&&(r=this.getDefaultSnapshot()),e.prototype.create.call(this,r,n)}}),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.createObservableInstanceIfNeeded(),r.storedValue}}),Object.defineProperty(t.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!r.identifierAttribute||r.identifier===Zs(n[r.identifierAttribute])}}),Object.defineProperty(t.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r.isDetaching?!1:r.snapshot===n||Ct(n)&&Ge(n)===r?!0:r.type===this&&k7(n)&&!Ct(n)&&this.isMatchingSnapshotId(r,n)?(r.applySnapshot(n),!0):!1}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.tryToReconcileNode(r,n);if(o)return r.setParent(i,a),r;if(r.die(),Ct(n)&&this.isAssignableFrom(Yc(n))){var l=Ge(n);return l.setParent(i,a),l}return this.instantiate(i,a,void 0,n)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t}(wa);Ns.prototype.create=or(Ns.prototype.create);var Cl=function(e){Dt(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r}}),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r.isDetaching&&r.type===this&&r.storedValue===n)return r;var o=this.instantiate(i,a,void 0,n);return r.die(),o}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t}(wa);function pr(e){return typeof e=="object"&&e&&e.isType===!0}var Li=new Map;function zN(e){return function(r,n,i){switch(r.type){case"action":if(!e.filter||e.filter(r)===!0){var a=e.onStart(r);e.onResume(r,a),Li.set(r.id,{call:r,context:a,async:!1});try{var o=n(r);return e.onSuspend(r,a),Li.get(r.id).async===!1&&(Li.delete(r.id),e.onSuccess(r,a,o)),o}catch(u){throw Li.delete(r.id),e.onFail(r,a,u),u}}else return n(r);case"flow_spawn":{var l=Li.get(r.rootId);return l.async=!0,n(r)}case"flow_resume":case"flow_resume_error":{var l=Li.get(r.rootId);e.onResume(r,l.context);try{return n(r)}finally{e.onSuspend(r,l.context)}}case"flow_throw":{var l=Li.get(r.rootId);return Li.delete(r.rootId),e.onFail(r,l.context,r.args[0]),n(r)}case"flow_return":{var l=Li.get(r.rootId);return Li.delete(r.rootId),e.onSuccess(r,l.context,r.args[0]),n(r)}}}}var BN=function(){function e(t,r){Object.defineProperty(this,"hooks",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"call",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"flowsPending",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"running",{enumerable:!0,configurable:!0,writable:!0,value:!0}),t&&t.onStart(r)}return Object.defineProperty(e.prototype,"finish",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.running&&(this.running=!1,this.hooks&&this.hooks.onFinish(this.call,t))}}),Object.defineProperty(e.prototype,"incFlowsPending",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending++}}),Object.defineProperty(e.prototype,"decFlowsPending",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending--}}),Object.defineProperty(e.prototype,"hasFlowsPending",{get:function(){return this.flowsPending>0},enumerable:!1,configurable:!0}),e}();function UN(e){var t=new Map;return function(n,i){var a=n.parentActionEvent?t.get(n.parentActionEvent.id):void 0;if(n.type==="action"){var o=hr(hr({},n),{env:a&&a.call.env,parentCall:a&&a.call}),l=!e.filter||e.filter(o),u=l?e:void 0,f=new BN(u,o);t.set(n.id,f);var h=void 0;try{h=i(n)}catch(w){throw t.delete(n.id),f.finish(w),w}return f.hasFlowsPending||(t.delete(n.id),f.finish()),h}else{if(!a)return i(n);switch(n.type){case"flow_spawn":return a.incFlowsPending(),i(n);case"flow_resume":case"flow_resume_error":return i(n);case"flow_throw":{var E=n.args[0];try{return i(n)}finally{a.decFlowsPending(),a.hasFlowsPending||(t.delete(n.parentActionEvent.id),a.finish(E))}}case"flow_return":try{return i(n)}finally{a.decFlowsPending(),a.hasFlowsPending||(t.delete(n.parentActionEvent.id),a.finish())}}}}}function HN(e,t,r,n){if(n instanceof Date)return{$MST_DATE:n.getTime()};if(js(n))return n;if(Ct(n))return yd("[MSTNode: ".concat(Yc(n).name,"]"));if(typeof n=="function")return yd("[function]");if(typeof n=="object"&&!Ko(n)&&!l2(n))return yd("[object ".concat(n&&n.constructor&&n.constructor.name||"Complex Object","]"));try{return JSON.stringify(n),n}catch(i){return yd(""+i)}}function $N(e,t){return t&&typeof t=="object"&&"$MST_DATE"in t?new Date(t.$MST_DATE):t}function yd(e){return{$MST_UNSERIALIZABLE:!0,type:e}}function g7(e,t){Cs(function(){s2(t).forEach(function(r){return GN(e,r)})})}function GN(e,t){var r=u7(e,t.path||"");if(!r)throw new Fe("Invalid action path: ".concat(t.path||""));var n=Ge(r);if(t.name==="@APPLY_PATCHES")return Ls.call(null,r,t.args[0]);if(t.name==="@APPLY_SNAPSHOT")return a7.call(null,r,t.args[0]);if(typeof r[t.name]!="function")throw new Fe("Action '".concat(t.name,"' does not exist in '").concat(n.path,"'"));return r[t.name].apply(r,t.args?t.args.map(function(i){return $N(n,i)}):[])}function VN(e,t){var r=[],n=function(o){var l=t?t(o,i2()):!0;l&&r.push(o)},i,a={actions:r,get recording(){return!!i},stop:function(){i&&(i(),i=void 0)},resume:function(){i||(i=v7(e,n))},replay:function(o){g7(o,r)}};return a.resume(),a}function v7(e,t,r){return r===void 0&&(r=!1),b7(e,function(i,a){if(i.type==="action"&&i.id===i.rootId){var o=Ge(i.context),l={name:i.name,path:O7(Ge(e),o),args:i.args.map(function(f,h){return HN(o,i.name,h,f)})};if(r){var u=a(i);return t(l),u}else return t(l),a(i)}else return a(i)})}var qN=1,Qu;function n2(){return Qu}function m7(){return qN++}function ym(e,t){var r=Ge(e.context);e.type==="action"&&r.assertAlive({actionContext:e});var n=r._isRunningAction;r._isRunningAction=!0;var i=Qu;Qu=e;try{return YN(r,e,t)}finally{Qu=i,r._isRunningAction=n}}function y7(e){if(e)return e.type==="action"?e:e.parentActionEvent}function Ec(e,t,r){var n=function(){var i=m7(),a=Qu,o=y7(a);return ym({type:"action",name:t,id:i,args:R7(arguments),context:e,tree:o7(e),rootId:a?a.rootId:i,parentId:a?a.id:0,allParentIds:a?Wi(Wi([],qi(a.allParentIds),!1),[a.id],!1):[],parentEvent:a,parentActionEvent:o},r)};return n._isMSTAction=!0,n._isFlowAction=r._isFlowAction,n}function b7(e,t,r){r===void 0&&(r=!0);var n=Ge(e);return n.addMiddleWare(t,r)}function WN(e,t,r){r===void 0&&(r=!0);var n={handler:e,includeHooks:r};return t.$mst_middleware=t.$mst_middleware||[],t.$mst_middleware.push(n),t}var KN=function(){function e(t,r){Object.defineProperty(this,"arrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"inArrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:[]}),r.$mst_middleware&&this.middlewares.push(r.$mst_middleware);for(var n=t;n;)n.middlewares&&this.middlewares.push(n.middlewares),n=n.parent}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getNextMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.middlewares[this.arrayIndex];if(t){var r=t[this.inArrayIndex++];return r||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}}),e}();function YN(e,t,r){var n=new KN(e,r);if(n.isEmpty)return or(r).apply(null,t.args);var i=null;function a(o){var l=n.getNextMiddleware(),u=l&&l.handler;if(!u)return or(r).apply(null,o.args);if(!l.includeHooks&&fr[o.name])return a(o);function f(E,w){i=a(E),w&&(i=w(i))}function h(E){i=E}return u(o,f,h),i}return a(t)}function i2(){for(var e=n2();e&&e.type!=="action";)e=e.parentActionEvent;return e}function _7(e,t,r){for(var n=typeof t=="number"?t:t.id,i=r?e:e.parentActionEvent;i;){if(i.id===n)return!0;i=i.parentActionEvent}return!1}function XN(e,t){return _7(e,t,!1)}function ZN(e,t){return _7(e,t,!0)}function QN(e){try{return JSON.stringify(e)}catch(t){return"<Unserializable: ".concat(t,">")}}function w7(e){return typeof e=="function"?"<function".concat(e.name?" "+e.name:"",">"):Ct(e)?"<".concat(e,">"):"`".concat(QN(e),"`")}function JN(e){return e.length<280?e:"".concat(e.substring(0,272),"......").concat(e.substring(e.length-8))}function eI(e){var t=e.value,r=e.context[e.context.length-1].type,n=e.context.map(function(l){var u=l.path;return u}).filter(function(l){return l.length>0}).join("/"),i=n.length>0?'at path "/'.concat(n,'" '):"",a=Ct(t)?"value of type ".concat(Ge(t).type.name,":"):js(t)?"value":"snapshot",o=r&&Ct(t)&&r.is(Ge(t).snapshot);return"".concat(i).concat(a," ").concat(w7(t)," is not assignable ").concat(r?"to type: `".concat(r.name,"`"):"")+(e.message?" (".concat(e.message,")"):"")+(r?G7(r)||js(t)?".":", expected an instance of `".concat(r.name,"` or a snapshot like `").concat(r.describe(),"` instead.")+(o?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function a2(e,t,r){return e.concat([{path:t,type:r}])}function mn(){return Is}function yn(e,t,r){return[{context:e,value:t,message:r}]}function Wp(e){return e.reduce(function(t,r){return t.concat(r)},[])}function ga(e,t){mI()&&S7(e,t)}function S7(e,t){var r=e.validate(t,[{path:"",type:e}]);if(r.length>0)throw new Fe(tI(e,t,r))}function tI(e,t,r){if(r.length!==0)return"Error while converting ".concat(JN(w7(t))," to `").concat(e.name,`\`:
93
+
94
+ `)+r.map(eI).join(`
95
+ `)}var rI=0,nI=function(){function e(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:rI++}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:Tt.map()}),Object.defineProperty(this,"lastCacheModificationPerId",{enumerable:!0,configurable:!0,writable:!0,value:Tt.map()})}return Object.defineProperty(e.prototype,"updateLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.lastCacheModificationPerId.get(t);this.lastCacheModificationPerId.set(t,r===void 0?1:r+1)}}),Object.defineProperty(e.prototype,"getLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.lastCacheModificationPerId.get(t)||0;return"".concat(this.cacheId,"-").concat(r)}}),Object.defineProperty(e.prototype,"addNodeToCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(r===void 0&&(r=!0),t.identifierAttribute){var n=t.identifier;this.cache.has(n)||this.cache.set(n,Tt.array([],Kp));var i=this.cache.get(n);if(i.indexOf(t)!==-1)throw new Fe("Already registered");i.push(t),r&&this.updateLastCacheModificationPerId(n)}}}),Object.defineProperty(e.prototype,"mergeCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this;Oy(t.identifierCache.cache).forEach(function(n){return n.forEach(function(i){r.addNodeToCache(i)})})}}),Object.defineProperty(e.prototype,"notifyDied",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(t.identifierAttribute){var r=t.identifier,n=this.cache.get(r);n&&(n.remove(t),n.length||this.cache.delete(r),this.updateLastCacheModificationPerId(t.identifier))}}}),Object.defineProperty(e.prototype,"splitCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this,n=new e,i=t.path+"/";return F8(this.cache).forEach(function(a){for(var o=qi(a,2),l=o[0],u=o[1],f=!1,h=u.length-1;h>=0;h--){var E=u[h];(E===t||E.path.indexOf(i)===0)&&(n.addNodeToCache(E,!1),u.splice(h,1),u.length||r.cache.delete(l),f=!0)}f&&r.updateLastCacheModificationPerId(l)}),n}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.cache.get(r);return n?n.some(function(i){return t.isAssignableFrom(i.type)}):!1}}),Object.defineProperty(e.prototype,"resolve",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.cache.get(r);if(!n)return null;var i=n.filter(function(a){return t.isAssignableFrom(a.type)});switch(i.length){case 0:return null;case 1:return i[0];default:throw new Fe("Cannot resolve a reference to type '".concat(t.name,"' with id: '").concat(r,"' unambigously, there are multiple candidates: ").concat(i.map(function(a){return a.path}).join(", ")))}}}),e}();function o2(e,t,r,n,i){var a=E7(i);if(a){if(a.parent)throw new Fe("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(t?t.path:"","/").concat(r,"', but it lives already at '").concat(a.path,"'"));return t&&a.setParent(t,r),a}return new vn(e,t,r,n,i)}function Co(e,t,r,n,i){return new Sc(e,t,r,n,i)}function iI(e){return e instanceof Sc||e instanceof vn}var Tr;(function(e){e[e.INITIALIZING=0]="INITIALIZING",e[e.CREATED=1]="CREATED",e[e.FINALIZED=2]="FINALIZED",e[e.DETACHING=3]="DETACHING",e[e.DEAD=4]="DEAD"})(Tr||(Tr={}));function Ct(e){return!!(e&&e.$treenode)}function Ge(e){if(!Ct(e))throw new Fe("Value ".concat(e," is no MST Node"));return e.$treenode}function E7(e){return e&&e.$treenode||null}function aI(){return Ge(this).snapshot}var oI=function(e){return".."};function O7(e,t){if(e.root!==t.root)throw new Fe("Cannot calculate relative path: objects '".concat(e,"' and '").concat(t,"' are not part of the same object tree"));for(var r=Fs(e.path),n=Fs(t.path),i=0;i<r.length&&r[i]===n[i];i++);return r.slice(i).map(oI).join("/")+Sh(n.slice(i))}function x7(e,t,r){return r===void 0&&(r=!0),P7(e,Fs(t),r)}function P7(e,t,r){r===void 0&&(r=!0);var n=e;try{for(var i=0;i<t.length;i++){var a=t[i];if(a===".."){if(n=n.parent,n)continue}else{if(a===".")continue;if(n){if(n instanceof Sc){var o=n.value;Ct(o)&&(n=Ge(o))}if(n instanceof vn){var l=n.getChildType(a);if(l&&(n=n.getChildNode(a),n))continue}}}throw new Fe("Could not resolve '".concat(a,"' in path '").concat(Sh(t.slice(0,i))||"/","' while resolving '").concat(Sh(t),"'"))}}catch(u){if(!r)return;throw u}return n}function C7(e){if(!e)return Is;var t=Object.keys(e);if(!t.length)return Is;var r=new Array(t.length);return t.forEach(function(n,i){r[i]=e[n]}),r}function lI(e){return M7(),L7(e)}var sI=Object.toString(),Is=Object.freeze([]),Ds=Object.freeze({}),Kp=g8().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(Kp);var Fe=function(e){Dt(t,e);function t(r){return r===void 0&&(r="Illegal state"),e.call(this,"[mobx-state-tree] ".concat(r))||this}return t}(Error);function uI(e){return e}var cI=Number.isInteger;function fI(e){return Number(e)===e&&e%1!==0}function dI(e){return Number.isFinite(e)}function l2(e){return Array.isArray(e)||Xr(e)}function s2(e){return e?l2(e)?e:[e]:Is}function hI(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];for(var n=0;n<t.length;n++){var i=t[n];for(var a in i)e[a]=i[a]}return e}function Ko(e){var t;if(e===null||typeof e!="object")return!1;var r=Object.getPrototypeOf(e);return r==null?!0:((t=r.constructor)===null||t===void 0?void 0:t.toString())===sI}function k7(e){return e!==null&&typeof e=="object"&&!(e instanceof Date)&&!(e instanceof RegExp)}function js(e,t){return t===void 0&&(t=!0),e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||t&&e instanceof Date}function T7(e){return typeof e!="function"}function pI(e,t,r){Or(e)?Py(e,t,r):Object.defineProperty(e,t,r)}function Zo(e,t,r){pI(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}var gI=function(){function e(){Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,"hasSubscribers",{get:function(){return this.handlers.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this;return r===void 0&&(r=!1),r?this.handlers.unshift(t):this.handlers.push(t),function(){n.unregister(t)}}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.handlers.indexOf(t)>=0}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.handlers.indexOf(t);r>=0&&this.handlers.splice(r,1)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.handlers.length=0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this.handlers.slice();n.forEach(function(i){return i.apply(void 0,Wi([],qi(t),!1))})}}),e}(),A7=function(){function e(){Object.defineProperty(this,"eventHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"hasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.eventHandlers&&this.eventHandlers[t];return!!r&&r.hasSubscribers}}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){n===void 0&&(n=!1),this.eventHandlers||(this.eventHandlers={});var i=this.eventHandlers[t];return i||(i=this.eventHandlers[t]=new gI),i.register(r,n)}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.eventHandlers&&this.eventHandlers[t];return!!n&&n.has(r)}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.eventHandlers&&this.eventHandlers[t];n&&n.unregister(r)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.eventHandlers&&delete this.eventHandlers[t]}}),Object.defineProperty(e.prototype,"clearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.eventHandlers=void 0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(t){for(var r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var a=this.eventHandlers&&this.eventHandlers[t];a&&(r=a).emit.apply(r,Wi([],qi(n),!1))}}),e}();function R7(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=e[r];return t}function tg(e,t){return e.indexOf(t)===0}var M7=function(e,t){};M7.ids={};function vI(e){console.warn(new Error("[mobx-state-tree] ".concat(e)))}function mI(){return typeof process<"u"&&x4&&x4.ENABLE_TYPE_CHECK==="true"}function rg(e){typeof queueMicrotask=="function"?queueMicrotask(e):typeof setImmediate=="function"?setImmediate(e):setTimeout(e,1)}function L7(e){return wI(e.name,e)}function yI(e){return e}function bI(e){return function(){var t,r=[];for(t=0;t<arguments.length;t++)r[t]=arguments[t];return n7(this,function(n){switch(n.label){case 0:return[4,e.apply(void 0,Wi([],qi(r),!1))];case 1:return[2,n.sent()]}})}}function _I(e){return n7(this,function(t){switch(t.label){case 0:return[4,e];case 1:return[2,t.sent()]}})}function wI(e,t){var r=function(){var i=m7(),a=n2();if(!a)throw new Fe("a mst flow must always have a parent context");var o=y7(a);if(!o)throw new Fe("a mst flow must always have a parent action context");var l={name:e,id:i,tree:a.tree,context:a.context,parentId:a.id,allParentIds:Wi(Wi([],qi(a.allParentIds),!1),[a.id],!1),rootId:a.rootId,parentEvent:a,parentActionEvent:o},u=arguments;function f(h,E,w){return h.$mst_middleware=r.$mst_middleware,ym(hr(hr({},l),{type:E,args:[w]}),h)}return new Promise(function(h,E){var w,p=function(){w=t.apply(null,arguments),S(void 0)};p.$mst_middleware=r.$mst_middleware,ym(hr(hr({},l),{type:"flow_spawn",args:R7(u)}),p);function S(v){var m;try{var d=f(function(g){m=w.next(g)},"flow_resume",v);d instanceof Error&&(m=w.throw(d))}catch(g){rg(function(){f(function(_){E(g)},"flow_throw",g)});return}y(m)}function b(v){var m;try{f(function(d){m=w.throw(d)},"flow_resume_error",v)}catch(d){rg(function(){f(function(g){E(d)},"flow_throw",d)});return}y(m)}function y(v){if(v.done){rg(function(){f(function(m){h(m)},"flow_return",v.value)});return}if(!v.value||typeof v.value.then!="function")throw new Fe("Only promises can be yielded to `async`, got: "+v);return v.value.then(S,b)}})};return r._isFlowAction=!0,r}function SI(e){if(!("oldValue"in e))throw new Fe("Patches without `oldValue` field cannot be inversed");return[EI(e),OI(e)]}function EI(e){switch(e.op){case"add":return{op:"add",path:e.path,value:e.value};case"remove":return{op:"remove",path:e.path};case"replace":return{op:"replace",path:e.path,value:e.value}}}function OI(e){switch(e.op){case"add":return{op:"remove",path:e.path};case"remove":return{op:"add",path:e.path,value:e.oldValue};case"replace":return{op:"replace",path:e.path,value:e.oldValue}}}function xI(e){return typeof e=="number"}function lo(e){return xI(e)===!0?""+e:e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function N7(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Sh(e){if(e.length===0)return"";var t=function(r){return r.map(lo).join("/")};return e[0]==="."||e[0]===".."?t(e):"/"+t(e)}function Fs(e){var t=e.split("/").map(N7),r=e===""||e==="."||e===".."||tg(e,"/")||tg(e,"./")||tg(e,"../");if(!r)throw new Fe("a json path must be either rooted, empty or relative, but got '".concat(e,"'"));return t[0]===""&&t.shift(),t}var ng=Symbol("$preProcessorFailed"),PI=function(e){Dt(t,e);function t(r,n,i){var a=e.call(this,i||r.name)||this;return Object.defineProperty(a,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_processors",{enumerable:!0,configurable:!0,writable:!0,value:n}),a}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|ot.SnapshotProcessor},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"snapshotProcessor(".concat(this._subtype.describe(),")")}}),Object.defineProperty(t.prototype,"preProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._processors.preProcessor?this._processors.preProcessor.call(null,r):r}}),Object.defineProperty(t.prototype,"preProcessSnapshotSafe",{enumerable:!1,configurable:!0,writable:!0,value:function(r){try{return this.preProcessSnapshot(r)}catch{return ng}}}),Object.defineProperty(t.prototype,"postProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this._processors.postProcessor?this._processors.postProcessor.call(null,r,n.storedValue):r}}),Object.defineProperty(t.prototype,"_fixNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;CI(r.type,this,"create"),r instanceof vn&&(r.hasSnapshotPostProcessor=!!this._processors.postProcessor);var i=r.getSnapshot;r.getSnapshot=function(){return n.postProcessSnapshot(i.call(r),r)},q7(this._subtype)||(r.getReconciliationType=function(){return n})}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Ct(a)?a:this.preProcessSnapshot(a),l=this._subtype.instantiate(r,n,i,o);return this._fixNode(l),l}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this._subtype.reconcile(r,Ct(n)?n:this.preProcessSnapshot(n),i,a);return o!==r&&this._fixNode(o),o}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n=!0);var i=this._subtype.getSnapshot(r);return n?this.postProcessSnapshot(i,r):i}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.preProcessSnapshotSafe(r);return i===ng?yn(n,r,"Failed to preprocess value"):this._subtype.validate(i,n)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),Object.defineProperty(t.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=pr(r)?this._subtype:Ct(r)?t2(r,!1):this.preProcessSnapshotSafe(r);return n===ng?!1:this._subtype.validate(n,[{path:"",type:this._subtype}]).length===0}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!(this._subtype instanceof Ns))return!1;var i=this.preProcessSnapshot(n);return this._subtype.isMatchingSnapshotId(r,i)}}),t}(wa);function CI(e,t){for(var r,n,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];try{for(var o=Zu(i),l=o.next();!l.done;l=o.next()){var u=l.value;e[u]=t[u].bind(t)}}catch(f){r={error:f}}finally{try{l&&!l.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}function kI(e,t,r){return new PI(e,t,r)}var P4="Map.put can only be used to store complex values that have an identifier type attribute";function I7(e,t){var r,n,i=e.getSubTypes();if(i===p7)return!1;if(i){var a=s2(i);try{for(var o=Zu(a),l=o.next();!l.done;l=o.next()){var u=l.value;if(!I7(u,t))return!1}}catch(f){r={error:f}}finally{try{l&&!l.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}return e instanceof Oc&&t.push(e),!0}var Ka;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.YES=1]="YES",e[e.NO=2]="NO"})(Ka||(Ka={}));var TI=function(e){Dt(t,e);function t(r,n){return e.call(this,r,Tt.ref.enhancer,n)||this}return Object.defineProperty(t.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return e.prototype.get.call(this,""+r)}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return e.prototype.has.call(this,""+r)}}),Object.defineProperty(t.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return e.prototype.delete.call(this,""+r)}}),Object.defineProperty(t.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return e.prototype.set.call(this,""+r,n)}}),Object.defineProperty(t.prototype,"put",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!r)throw new Fe("Map.put cannot be used to set empty values");if(Ct(r)){var n=Ge(r);if(n.identifier===null)throw new Fe(P4);return this.set(n.identifier,r),r}else if(k7(r)){var i=Ge(this),a=i.type;if(a.identifierMode!==Ka.YES)throw new Fe(P4);var o=a.mapIdentifierAttribute,l=r[o];if(!c2(l)){var u=this.put(a.getChildType().create(r,i.environment));return this.put(t2(u))}var f=Zs(l);return this.set(f,r),this.get(f)}else throw new Fe("Map.put can only be used to store complex values")}}),t}(Qh),Eh=function(e){Dt(t,e);function t(r,n,i){i===void 0&&(i=[]);var a=e.call(this,r)||this;return Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"identifierMode",{enumerable:!0,configurable:!0,writable:!0,value:Ka.UNKNOWN}),Object.defineProperty(a,"mapIdentifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Map}),Object.defineProperty(a,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),a._determineIdentifierMode(),a.hookInitializers=i,a}return Object.defineProperty(t.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.hookInitializers.length>0?this.hookInitializers.concat(r):[r];return new t(this.name,this._subType,n)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._determineIdentifierMode(),o2(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===Ka.UNKNOWN){var r=[];if(I7(this._subType,r)){var n=r.reduce(function(i,a){if(!a.identifierAttribute)return i;if(i&&i!==a.identifierAttribute)throw new Fe("The objects in a map should all have the same identifier attribute, expected '".concat(i,"', but child of type '").concat(a.name,"' declared attribute '").concat(a.identifierAttribute,"' as identifier"));return a.identifierAttribute},void 0);n?(this.identifierMode=Ka.YES,this.mapIdentifierAttribute=n):this.identifierMode=Ka.NO}}}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n={});var i=r.type._subType,a={};return Object.keys(n).forEach(function(o){a[o]=i.instantiate(r,o,void 0,n[o])}),a}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return new TI(r,this.name)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Ey(n,r.unbox);var i=r.type;i.hookInitializers.forEach(function(a){var o=a(n);Object.keys(o).forEach(function(l){var u=o[l],f=Ec(n,l,u);Zo(n,l,f)})}),Yh(n,this.willChange),Zh(n,this.didChange)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return Oy(r.storedValue)}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r.storedValue.get(""+n);if(!i)throw new Fe("Not a child "+n);return i}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Ge(r.object),i=r.name;n.assertWritable({subpath:i});var a=n.type,o=a._subType;switch(r.type){case"update":{var l=r.newValue,u=r.object.get(i);if(l===u)return null;ga(o,l),r.newValue=o.reconcile(n.getChildNode(i),r.newValue,n,i),a.processIdentifier(i,r.newValue)}break;case"add":ga(o,r.newValue),r.newValue=o.instantiate(n,i,void 0,r.newValue),a.processIdentifier(i,r.newValue);break}return r}}),Object.defineProperty(t.prototype,"processIdentifier",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this.identifierMode===Ka.YES&&n instanceof vn){var i=n.identifier;if(i!==r)throw new Fe("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '".concat(i,"', but expected: '").concat(r,"'"))}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return r.getChildren().forEach(function(i){n[i.subpath]=i.snapshot}),n}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return Object.keys(r).forEach(function(i){n[i]=r[i].getSnapshot()}),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Ge(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:lo(r.name),value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"add":return void n.emitPatch({op:"add",path:lo(r.name),value:r.newValue.snapshot,oldValue:void 0},n);case"delete":var i=r.oldValue.snapshot;return r.oldValue.die(),void n.emitPatch({op:"remove",path:lo(r.name),oldValue:i},n)}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=r.storedValue;switch(i.op){case"add":case"replace":a.set(n,i.value);break;case"remove":a.delete(n);break}}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){ga(this,n);var i=r.storedValue,a={};if(Array.from(i.keys()).forEach(function(l){a[l]=!1}),n)for(var o in n)i.set(o,n[o]),a[""+o]=!0;Object.keys(a).forEach(function(l){a[l]===!1&&i.delete(l)})}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;return Ko(r)?Wp(Object.keys(r).map(function(a){return i._subType.validate(r[a],a2(n,a,i._subType))})):yn(n,r,"Value is not a plain object")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Ds}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.delete(n)}}),t}(Ns);Eh.prototype.applySnapshot=or(Eh.prototype.applySnapshot);function AI(e){return new Eh("Map<string, ".concat(e.name,">"),e)}function RI(e){return pr(e)&&(e.flags&ot.Map)>0}var Oh=function(e){Dt(t,e);function t(r,n,i){i===void 0&&(i=[]);var a=e.call(this,r)||this;return Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Array}),Object.defineProperty(a,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),a.hookInitializers=i,a}return Object.defineProperty(t.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.hookInitializers.length>0?this.hookInitializers.concat(r):[r];return new t(this.name,this._subType,n)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return o2(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n=[]);var i=r.type._subType,a={};return n.forEach(function(o,l){var u=""+l;a[u]=i.instantiate(r,u,void 0,o)}),a}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=hr(hr({},Kp),{name:this.name});return Tt.array(C7(r),n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){yi(n).dehancer=r.unbox;var i=r.type;i.hookInitializers.forEach(function(a){var o=a(n);Object.keys(o).forEach(function(l){var u=o[l],f=Ec(n,l,u);Zo(n,l,f)})}),Yh(n,this.willChange),Zh(n,this.didChange)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue.slice()}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=Number(n);if(i<r.storedValue.length)return r.storedValue[i];throw new Fe("Not a child: "+n)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Ge(r.object);n.assertWritable({subpath:""+r.index});var i=n.type._subType,a=n.getChildren();switch(r.type){case"update":{if(r.newValue===r.object[r.index])return null;var o=C4(n,i,[a[r.index]],[r.newValue],[r.index]);if(!o)return null;r.newValue=o[0]}break;case"splice":{var l=r.index,u=r.removedCount,f=r.added,h=C4(n,i,a.slice(l,l+u),f,f.map(function(w,p){return l+p}));if(!h)return null;r.added=h;for(var E=l+u;E<a.length;E++)a[E].setParent(n,""+(E+f.length-u))}break}return r}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.getChildren().map(function(n){return n.snapshot})}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=[];return Object.keys(r).forEach(function(i){n.push(r[i].getSnapshot())}),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Ge(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:""+r.index,value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"splice":if(r.removedCount&&r.addedCount===r.object.length)return void n.emitPatch({op:"replace",path:"",value:n.snapshot,oldValue:r.removed.map(function(a){return a.snapshot})},n);for(var i=r.removedCount-1;i>=0;i--)n.emitPatch({op:"remove",path:""+(r.index+i),oldValue:r.removed[i].snapshot},n);for(var i=0;i<r.addedCount;i++)n.emitPatch({op:"add",path:""+(r.index+i),value:r.added[i].snapshot,oldValue:void 0},n);return}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=r.storedValue,o=n==="-"?a.length:Number(n);switch(i.op){case"replace":a[o]=i.value;break;case"add":a.splice(o,0,i.value);break;case"remove":a.splice(o,1);break}}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){ga(this,n);var i=r.storedValue;i.replace(n)}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;return l2(r)?Wp(r.map(function(a,o){return i._subType.validate(a,a2(n,""+o,i._subType))})):yn(n,r,"Value is not an array")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Is}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.splice(Number(n),1)}}),t}(Ns);Oh.prototype.applySnapshot=or(Oh.prototype.applySnapshot);function MI(e){return new Oh("".concat(e.name,"[]"),e)}function C4(e,t,r,n,i){for(var a=!0,o=0;;o++){var l=o<=n.length-1,u=r[o],f=l?n[o]:void 0,h=""+i[o];if(iI(f)&&(f=f.storedValue),!u&&!l)break;if(!l)a=!1,r.splice(o,1),u instanceof vn&&u.createObservableInstanceIfNeeded(),u.die(),o--;else if(u)if(k4(u,f))r[o]=ig(t,e,h,f,u);else{for(var w=void 0,p=o;p<r.length;p++)if(k4(r[p],f)){w=r.splice(p,1)[0];break}a=!1;var E=ig(t,e,h,f,w);r.splice(o,0,E)}else{if(Ct(f)&&Ge(f).parent===e)throw new Fe("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(e.path,"/").concat(h,"', but it lives already at '").concat(Ge(f).path,"'"));a=!1;var E=ig(t,e,h,f);r.splice(o,0,E)}}return a?null:r}function ig(e,t,r,n,i){ga(e,n);function a(){if(Ct(n)){var l=Ge(n);if(l.assertAlive(Ds),l.parent!==null&&l.parent===t)return l.setParent(t,r),l}return i?e.reconcile(i,n,t,r):e.instantiate(t,r,void 0,n)}var o=a();return i&&i!==o&&(i instanceof vn&&i.createObservableInstanceIfNeeded(),i.die()),o}function k4(e,t){if(!e.isAlive)return!1;if(Ct(t)){var r=Ge(t);return r.isAlive&&r===e}if(e.snapshot===t)return!0;if(!(e instanceof vn))return!1;var n=e.getReconciliationType();return e.identifier!==null&&e.identifierAttribute&&Ko(t)&&n.is(t)&&n.isMatchingSnapshotId(e,t)}function LI(e){return pr(e)&&(e.flags&ot.Array)>0}var T4="preProcessSnapshot",A4="postProcessSnapshot";function NI(){return Ge(this).toString()}var R4={name:"AnonymousModel",properties:{},initializers:Is};function II(e){var t=Object.keys(e),r=new Set;return t.forEach(function(n){if(r.has(n))throw new Fe("".concat(n," is declared twice in the model. Model should not contain the same keys"));r.add(n)}),t.reduce(function(n,i){if(i in fr)throw new Fe("Hook '".concat(i,"' was defined as property. Hooks should be defined as part of the actions"));var a=Object.getOwnPropertyDescriptor(e,i);if("get"in a)throw new Fe("Getters are not supported as properties. Please use views instead");var o=a.value;if(o==null)throw new Fe("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(js(o))n[i]=Qo(UI(o),o);else if(o instanceof Eh)n[i]=Qo(o,{});else if(o instanceof Oh)n[i]=Qo(o,[]);else if(!pr(o))throw new Fe("Invalid type definition for property '".concat(i,"', cannot infer a type from a value like '").concat(o,"' (").concat(typeof o,")"));return n},hr({},e))}var Oc=function(e){Dt(t,e);function t(r){var n=e.call(this,r.name||R4.name)||this;return Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Object}),Object.defineProperty(n,"initializers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"properties",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"preProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"postProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"propertyNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"named",{enumerable:!0,configurable:!0,writable:!0,value:function(i){return n.cloneAndEnhance({name:i})}}),Object.defineProperty(n,"props",{enumerable:!0,configurable:!0,writable:!0,value:function(i){return n.cloneAndEnhance({properties:i})}}),Object.defineProperty(n,"preProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(i){var a=n.preProcessor;return a?n.cloneAndEnhance({preProcessor:function(o){return a(i(o))}}):n.cloneAndEnhance({preProcessor:i})}}),Object.defineProperty(n,"postProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(i){var a=n.postProcessor;return a?n.cloneAndEnhance({postProcessor:function(o){return i(a(o))}}):n.cloneAndEnhance({postProcessor:i})}}),Object.assign(n,R4,r),n.properties=II(n.properties),n.properties,n.propertyNames=Object.keys(n.properties),n.identifierAttribute=n._getIdentifierAttribute(),n}return Object.defineProperty(t.prototype,"_getIdentifierAttribute",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=void 0;return this.forAllProps(function(n,i){if(i.flags&ot.Identifier){if(r)throw new Fe("Cannot define property '".concat(n,"' as object identifier, property '").concat(r,"' is already defined as identifier property"));r=n}}),r}}),Object.defineProperty(t.prototype,"cloneAndEnhance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return new t({name:r.name||this.name,properties:Object.assign({},this.properties,r.properties),initializers:this.initializers.concat(r.initializers||[]),preProcessor:r.preProcessor||this.preProcessor,postProcessor:r.postProcessor||this.postProcessor})}}),Object.defineProperty(t.prototype,"actions",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){return n.instantiateActions(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateActions",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!Ko(n))throw new Fe("actions initializer should return a plain object containing actions");Object.keys(n).forEach(function(i){if(i===T4)throw new Fe("Cannot define action '".concat(T4,"', it should be defined using 'type.preProcessSnapshot(fn)' instead"));if(i===A4)throw new Fe("Cannot define action '".concat(A4,"', it should be defined using 'type.postProcessSnapshot(fn)' instead"));var a=n[i],o=r[i];if(i in fr&&o){var l=a;a=function(){o.apply(null,arguments),l.apply(null,arguments)}}var u=a.$mst_middleware,f=a.bind(n);f._isFlowAction=a._isFlowAction||!1,f.$mst_middleware=u;var h=Ec(r,i,f);n[i]=h,Zo(r,i,h)})}}),Object.defineProperty(t.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;if(typeof r!="function")throw new Fe("You passed an ".concat(typeof r," to volatile state as an argument, when function is expected"));var i=function(a){return n.instantiateVolatileState(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateVolatileState",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!Ko(n))throw new Fe("volatile state initializer should return a plain object containing state");xy(r,n)}}),Object.defineProperty(t.prototype,"extend",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){var o=r(a),l=o.actions,u=o.views,f=o.state,h=lN(o,["actions","views","state"]);for(var E in h)throw new Fe("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '".concat(E,"'"));return f&&n.instantiateVolatileState(a,f),u&&n.instantiateViews(a,u),l&&n.instantiateActions(a,l),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"views",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){return n.instantiateViews(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateViews",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!Ko(n))throw new Fe("views initializer should return a plain object containing views");Object.getOwnPropertyNames(n).forEach(function(i){var a,o=Object.getOwnPropertyDescriptor(n,i);if("get"in o)Py(r,i,o),Cy(r,(a={},a[i]=dl,a));else if(typeof o.value=="function")Zo(r,i,o.value);else throw new Fe("A view member should either be a function or getter based property")})}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Ct(a)?a:this.applySnapshotPreProcessor(a);return o2(this,r,n,i,o)}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n={});var i=r.type,a={};return i.forAllProps(function(o,l){a[o]=l.instantiate(r,o,void 0,n[o])}),a}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=hr(hr({},Kp),{name:this.name});return Tt.object(r,Ds,n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Zo(n,"toString",NI),this.forAllProps(function(i){Ey(n,i,r.unbox)}),this.initializers.reduce(function(i,a){return a(i)},n),Yh(n,this.willChange),Zh(n,this.didChange)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=Ge(n.object),a=n.name;i.assertWritable({subpath:a});var o=i.type.properties[a];return o&&(ga(o,n.newValue),n.newValue=o.reconcile(i.getChildNode(a),n.newValue,i,a)),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=Ge(n.object),a=i.type.properties[n.name];if(a){var o=n.oldValue?n.oldValue.snapshot:void 0;i.emitPatch({op:"replace",path:lo(n.name),value:n.newValue.snapshot,oldValue:o},i)}}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=[];return this.forAllProps(function(a){i.push(n.getChildNode(r,a))}),i}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i;if(!(n in this.properties))throw new Fe("Not a value property: "+n);var a=yi(r.storedValue,n),o=(i=a.raw)===null||i===void 0?void 0:i.call(a);if(!o)throw new Fe("Node not available for property "+n);return o}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;n===void 0&&(n=!0);var a={};return this.forAllProps(function(o,l){try{var u=Vi(r.storedValue,o);u.reportObserved()}catch{throw new Fe("".concat(o," property is declared twice"))}a[o]=i.getChildNode(r,o).snapshot}),n?this.applySnapshotPostProcessor(a):a}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return Object.keys(r).forEach(function(i){n[i]=r[i].getSnapshot()}),this.applySnapshotPostProcessor(n)}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){if(!(i.op==="replace"||i.op==="add"))throw new Fe("object does not support operation ".concat(i.op));r.storedValue[n]=i.value}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){ga(this,n);var i=this.applySnapshotPreProcessor(n);this.forAllProps(function(a){r.storedValue[a]=i[a]})}}),Object.defineProperty(t.prototype,"applySnapshotPreProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.preProcessor;return n?n.call(null,r):r}}),Object.defineProperty(t.prototype,"applySnapshotPostProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.postProcessor;return n?n.call(null,r):r}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.properties[r]}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this,a=this.applySnapshotPreProcessor(r);return Ko(a)?Wp(this.propertyNames.map(function(o){return i.properties[o].validate(a[o],a2(n,o,i.properties[o]))})):yn(n,a,"Value is not a plain object")}}),Object.defineProperty(t.prototype,"forAllProps",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;this.propertyNames.forEach(function(i){return r(i,n.properties[i])})}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;return"{ "+this.propertyNames.map(function(n){return n+": "+r.properties[n].describe()}).join("; ")+" }"}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Ds}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue[n]=void 0}}),t}(Ns);Oc.prototype.applySnapshot=or(Oc.prototype.applySnapshot);function DI(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string"?e.shift():"AnonymousModel",n=e.shift()||{};return new Oc({name:r,properties:n})}function jI(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string",n=r?e[0]:"AnonymousModel";return r&&e.shift(),e.reduce(function(i,a){return i.cloneAndEnhance({name:i.name+"_"+a.name,properties:a.properties,initializers:a.initializers,preProcessor:function(o){return a.applySnapshotPreProcessor(i.applySnapshotPreProcessor(o))},postProcessor:function(o){return a.applySnapshotPostProcessor(i.applySnapshotPostProcessor(o))}})}).named(n)}function D7(e){return pr(e)&&(e.flags&ot.Object)>0}var ka=function(e){Dt(t,e);function t(r,n,i,a){a===void 0&&(a=uI);var o=e.call(this,r)||this;return Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"checker",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"initializer",{enumerable:!0,configurable:!0,writable:!0,value:a}),o.flags=n,o}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return Co(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.initializer(r)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(js(r)&&this.checker(r))return mn();var i=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return yn(n,r,"Value is not a ".concat(i))}}),t}(Cl),j7=new ka("string",ot.String,function(e){return typeof e=="string"}),F7=new ka("number",ot.Number,function(e){return typeof e=="number"}),FI=new ka("integer",ot.Integer,function(e){return cI(e)}),zI=new ka("float",ot.Float,function(e){return fI(e)}),BI=new ka("finite",ot.Finite,function(e){return dI(e)}),z7=new ka("boolean",ot.Boolean,function(e){return typeof e=="boolean"}),B7=new ka("null",ot.Null,function(e){return e===null}),U7=new ka("undefined",ot.Undefined,function(e){return e===void 0}),H7=new ka("Date",ot.Date,function(e){return typeof e=="number"||e instanceof Date},function(e){return e instanceof Date?e:new Date(e)});H7.getSnapshot=function(e){return e.storedValue.getTime()};var $7=H7;function UI(e){switch(typeof e){case"string":return j7;case"number":return F7;case"boolean":return z7;case"object":if(e instanceof Date)return $7}throw new Fe("Cannot determine primitive type from value "+e)}function G7(e){return pr(e)&&(e.flags&(ot.String|ot.Number|ot.Integer|ot.Boolean|ot.Date))>0}var HI=function(e){Dt(t,e);function t(r){var n=e.call(this,JSON.stringify(r))||this;return Object.defineProperty(n,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Literal}),n.value=r,n}return Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return Co(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify(this.value)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return js(r)&&r===this.value?mn():yn(n,r,"Value is not a literal ".concat(JSON.stringify(this.value)))}}),t}(Cl);function V7(e){return new HI(e)}function $I(e){return pr(e)&&(e.flags&ot.Literal)>0}var GI=function(e){Dt(t,e);function t(r,n,i,a){var o=e.call(this,r)||this;return Object.defineProperty(o,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"_predicate",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"_message",{enumerable:!0,configurable:!0,writable:!0,value:a}),o}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|ot.Refinement},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this._subtype.validate(r,n);if(i.length>0)return i;var a=Ct(r)?Ge(r).snapshot:r;return this._predicate(a)?mn():yn(n,r,this._message(r))}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.reconcile(r,n,i,a)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),t}(wa);function VI(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string"?e.shift():pr(e[0])?e[0].name:null,n=e[0],i=e[1],a=e[2]?e[2]:function(o){return"Value does not respect the refinement predicate"};return new GI(r,n,i,a)}function qI(e){return pr(e)&&(e.flags&ot.Refinement)>0}function WI(e,t){var r=typeof e=="string"?t:e,n=Yp.apply(void 0,Wi([],qi(r.map(function(i){return V7(""+i)})),!1));return typeof e=="string"&&(n.name=e),n}var KI=function(e){Dt(t,e);function t(r,n,i){var a=e.call(this,r)||this;return Object.defineProperty(a,"_types",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"_dispatcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_eager",{enumerable:!0,configurable:!0,writable:!0,value:!0}),i=hr({eager:!0,dispatcher:void 0},i),a._dispatcher=i.dispatcher,i.eager||(a._eager=!1),a}return Object.defineProperty(t.prototype,"flags",{get:function(){var r=ot.Union;return this._types.forEach(function(n){r|=n.flags}),r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._types.some(function(n){return n.isAssignableFrom(r)})}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"("+this._types.map(function(r){return r.describe()}).join(" | ")+")"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.determineType(a,void 0);if(!o)throw new Fe("No matching type for union "+this.describe());return o.instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.determineType(n,r.getReconciliationType());if(!o)throw new Fe("No matching type for union "+this.describe());return o.reconcile(r,n,i,a)}}),Object.defineProperty(t.prototype,"determineType",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this._dispatcher?this._dispatcher(r):n?n.is(r)?n:this._types.filter(function(i){return i!==n}).find(function(i){return i.is(r)}):this._types.find(function(i){return i.is(r)})}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._dispatcher)return this._dispatcher(r).validate(r,n);for(var i=[],a=0,o=0;o<this._types.length;o++){var l=this._types[o],u=l.validate(r,n);if(u.length===0){if(this._eager)return mn();a++}else i.push(u)}return a===1?mn():yn(n,r,"No type is applicable for the union").concat(Wp(i))}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),t}(wa);function Yp(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=pr(e)?void 0:e,i=pr(e)?Wi([e],qi(t),!1):t,a="("+i.map(function(o){return o.name}).join(" | ")+")";return new KI(a,i,n)}function q7(e){return pr(e)&&(e.flags&ot.Union)>0}var YI=function(e){Dt(t,e);function t(r,n,i){var a=e.call(this,r.name)||this;return Object.defineProperty(a,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_defaultValue",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"optionalValues",{enumerable:!0,configurable:!0,writable:!0,value:i}),a}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|ot.Optional},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype.describe()+"?"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(this.optionalValues.indexOf(a)>=0){var o=this.getDefaultInstanceOrSnapshot();return this._subtype.instantiate(r,n,i,o)}return this._subtype.instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.reconcile(r,this.optionalValues.indexOf(n)<0&&this._subtype.is(n)?n:this.getDefaultInstanceOrSnapshot(),i,a)}}),Object.defineProperty(t.prototype,"getDefaultInstanceOrSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=typeof this._defaultValue=="function"?this._defaultValue():this._defaultValue;return typeof this._defaultValue=="function"&&ga(this,r),r}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.optionalValues.indexOf(r)>=0?mn():this._subtype.validate(r,n)}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),t}(wa);function XI(e,t){if(typeof t!="function"&&Ct(t))throw new Fe("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function Qo(e,t,r){return XI(e,t),new YI(e,t,r||ZI)}var ZI=[void 0];function QI(e){return pr(e)&&(e.flags&ot.Optional)>0}var JI=Qo(U7,void 0),eD=Qo(B7,null);function W7(e){return Yp(e,JI)}function tD(e){return Yp(e,eD)}var rD=function(e){Dt(t,e);function t(r,n){var i=e.call(this,r)||this;return Object.defineProperty(i,"_definition",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),i}return Object.defineProperty(t.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|ot.Late},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSubType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this._subType){var n=void 0;try{n=this._definition()}catch(i){if(i instanceof ReferenceError)n=void 0;else throw i}if(r&&n===void 0)throw new Fe("Late type seems to be used too early, the definition (still) returns undefined");n&&(this._subType=n)}return this._subType}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.getSubType(!0).instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.getSubType(!0).reconcile(r,n,i,a)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r?r.name:"<uknown late type>"}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.getSubType(!1);return i?i.validate(r,n):mn()}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getSubType(!1);return n?n.isAssignableFrom(r):!1}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r||p7}}),t}(wa);function nD(e,t){var r=typeof e=="string"?e:"late(".concat(e.toString(),")"),n=typeof e=="string"?t:e;return new rD(r,n)}function iD(e){return pr(e)&&(e.flags&ot.Late)>0}function aD(e,t){return new oD(e,t)}var oD=function(e){Dt(t,e);function t(r,n){var i=e.call(this,r)||this;return Object.defineProperty(i,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Lazy}),Object.defineProperty(i,"loadedType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"pendingNodeList",{enumerable:!0,configurable:!0,writable:!0,value:Tt.array()}),nm(function(){return i.pendingNodeList.length>0&&i.pendingNodeList.some(function(a){return a.isAlive&&i.options.shouldLoadPredicate(a.parent?a.parent.value:null)})},function(){i.options.loadType().then(or(function(a){i.loadedType=a,i.pendingNodeList.forEach(function(o){o.parent&&i.loadedType&&o.parent.applyPatches([{op:"replace",path:"/".concat(o.subpath),value:o.snapshot}])})}))}),i}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<lazy ".concat(this.name,">")}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this;if(this.loadedType)return this.loadedType.instantiate(r,n,i,a);var l=Co(this,r,n,i,a);return this.pendingNodeList.push(l),nm(function(){return!l.isAlive},function(){return o.pendingNodeList.splice(o.pendingNodeList.indexOf(l),1)}),l}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.loadedType?this.loadedType.validate(r,n):T7(r)?mn():yn(n,r,"Value is not serializable and cannot be lazy")}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.loadedType?(r.die(),this.loadedType.instantiate(i,a,i.environment,n)):e.prototype.reconcile.call(this,r,n,i,a)}}),t}(Cl),K7=function(e){Dt(t,e);function t(r){var n=e.call(this,r?"frozen(".concat(r.name,")"):"frozen")||this;return Object.defineProperty(n,"subType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Frozen}),n}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<any immutable value>"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return Co(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return T7(r)?this.subType?this.subType.validate(r,n):mn():yn(n,r,"Value is not serializable and cannot be frozen")}}),t}(Cl),M4=new K7;function lD(e){return arguments.length===0?M4:pr(e)?new K7(e):Qo(M4,e)}function sD(e){return pr(e)&&(e.flags&ot.Frozen)>0}function uD(e){switch(e){case fr.beforeDestroy:return"destroy";case fr.beforeDetach:return"detach";default:return}}var cD=function(){function e(t,r){if(Object.defineProperty(this,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"node",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolvedReference",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),c2(t))this.identifier=t;else if(Ct(t)){var n=Ge(t);if(!n.identifierAttribute)throw new Fe("Can only store references with a defined identifier attribute.");var i=n.unnormalizedIdentifier;if(i==null)throw new Fe("Can only store references to tree nodes with a defined identifier.");this.identifier=i}else throw new Fe("Can only store references to tree nodes or identifiers, got: '".concat(t,"'"))}return Object.defineProperty(e.prototype,"updateResolvedReference",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=Zs(this.identifier),n=t.root,i=n.identifierCache.getLastCacheModificationPerId(r);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==i){var a=this.targetType,o=n.identifierCache.resolve(a,r);if(!o)throw new u2("[mobx-state-tree] Failed to resolve reference '".concat(this.identifier,"' to type '").concat(this.targetType.name,"' (from node: ").concat(t.path,")"));this.resolvedReference={node:o,lastCacheModification:i}}}}),Object.defineProperty(e.prototype,"resolvedValue",{get:function(){return this.updateResolvedReference(this.node),this.resolvedReference.node.value},enumerable:!1,configurable:!0}),e}(),u2=function(e){Dt(t,e);function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return t}(Error),Y7=function(e){Dt(t,e);function t(r,n){var i=e.call(this,"reference(".concat(r.name,")"))||this;return Object.defineProperty(i,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"onInvalidated",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Reference}),i}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.targetType.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return c2(r)?mn():yn(n,r,"Value is not a valid identifier, which is a string or a number")}}),Object.defineProperty(t.prototype,"fireInvalidated",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=n.parent;if(!(!o||!o.isAlive)){var l=o.storedValue;l&&this.onInvalidated({cause:r,parent:l,invalidTarget:a?a.storedValue:void 0,invalidId:i,replaceRef:function(u){Ls(n.root.storedValue,{op:"replace",value:u,path:n.path})},removeRef:function(){D7(o.type)?this.replaceRef(void 0):Ls(n.root.storedValue,{op:"remove",path:n.path})}})}}}),Object.defineProperty(t.prototype,"addTargetNodeWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this,a=this.getValue(r);if(a){var o=Ge(a),l=function(h,E){var w=uD(E);w&&i.fireInvalidated(w,r,n,o)},u=o.registerHook(fr.beforeDetach,l),f=o.registerHook(fr.beforeDestroy,l);return function(){u(),f()}}}}),Object.defineProperty(t.prototype,"watchTargetNodeForInvalidations",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=this;if(this.onInvalidated){var o;r.registerHook(fr.beforeDestroy,function(){o&&o()});var l=function(u){o&&o();var f=r.parent,h=f&&f.storedValue;if(f&&f.isAlive&&h){var E=void 0;i?E=!!i.get(n,h):E=r.root.identifierCache.has(a.targetType,Zs(n)),E?o=a.addTargetNodeWatcher(r,n):u||a.fireInvalidated("invalidSnapshotReference",r,n,null)}};r.state===Tr.FINALIZED?l(!0):(r.isRoot||r.root.registerHook(fr.afterCreationFinalization,function(){r.parent&&r.parent.createObservableInstanceIfNeeded()}),r.registerHook(fr.afterAttach,function(){l(!1)}))}}}),t}(Cl),fD=function(e){Dt(t,e);function t(r,n){return e.call(this,r,n)||this}return Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.isAlive){var n=r.storedValue;return n.resolvedValue}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r.storedValue;return n.identifier}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Ct(a)?s7(a):a,l=new cD(a,this.targetType),u=Co(this,r,n,i,l);return l.node=u,this.watchTargetNodeForInvalidations(u,o,void 0),u}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r.isDetaching&&r.type===this){var o=Ct(n),l=r.storedValue;if(!o&&l.identifier===n||o&&l.resolvedValue===n)return r.setParent(i,a),r}var u=this.instantiate(i,a,void 0,n);return r.die(),u}}),t}(Y7),dD=function(e){Dt(t,e);function t(r,n,i){var a=e.call(this,r,i)||this;return Object.defineProperty(a,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),a}return Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.isAlive){var n=this.options.get(r.storedValue,r.parent?r.parent.storedValue:null);return n}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Ct(a)?this.options.set(a,r?r.storedValue:null):a,l=Co(this,r,n,i,o);return this.watchTargetNodeForInvalidations(l,o,this.options),l}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Ct(n)?this.options.set(n,r?r.storedValue:null):n;if(!r.isDetaching&&r.type===this&&r.storedValue===o)return r.setParent(i,a),r;var l=this.instantiate(i,a,void 0,o);return r.die(),l}}),t}(Y7);function X7(e,t){var r=t||void 0,n=t?t.onInvalidated:void 0;return r&&(r.get||r.set)?new dD(e,{get:r.get,set:r.set},n):new fD(e,n)}function hD(e){return pr(e)&&(e.flags&ot.Reference)>0}function pD(e,t){var r=X7(e,hr(hr({},t),{onInvalidated:function(n){t&&t.onInvalidated&&t.onInvalidated(n),n.removeRef()}}));return t&&t.acceptsUndefined===!1?r:W7(r)}var Z7=function(e){Dt(t,e);function t(r,n){var i=e.call(this,r)||this;return Object.defineProperty(i,"validType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Identifier}),i}return Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r||!(r.type instanceof Oc))throw new Fe("Identifier types can only be instantiated as direct child of a model type");return Co(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(r.storedValue!==n)throw new Fe("Tried to change identifier from '".concat(r.storedValue,"' to '").concat(n,"'. Changing identifiers is not allowed."));return r.setParent(i,a),r}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return typeof r!==this.validType?yn(n,r,"Value is not a valid ".concat(this.describe(),", expected a ").concat(this.validType)):mn()}}),t}(Cl),gD=function(e){Dt(t,e);function t(){var r=e.call(this,"identifier","string")||this;return Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Identifier}),r}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),t}(Z7),vD=function(e){Dt(t,e);function t(){return e.call(this,"identifierNumber","number")||this}return Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifierNumber"}}),t}(Z7),mD=new gD,yD=new vD;function bD(e){return pr(e)&&(e.flags&ot.Identifier)>0}function Zs(e){return""+e}function c2(e){return typeof e=="string"||typeof e=="number"}function _D(e){return new wD(e)}var wD=function(e){Dt(t,e);function t(r){var n=e.call(this,r.name)||this;return Object.defineProperty(n,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ot.Custom}),n}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this.options.isTargetType(r))return mn();var i=this.options.getValidationMessage(r);return i?yn(n,r,"Invalid value for type '".concat(this.name,"': ").concat(i)):mn()}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.options.toSnapshot(r.storedValue)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.options.isTargetType(a)?a:this.options.fromSnapshot(a,r&&r.root.environment);return Co(this,r,n,i,o)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=!this.options.isTargetType(n);if(!r.isDetaching){var l=r.type===this&&(o?n===r.snapshot:n===r.storedValue);if(l)return r.setParent(i,a),r}var u=o?this.options.fromSnapshot(n,i.root.environment):n,f=this.instantiate(i,a,void 0,u);return r.die(),f}}),t}(Cl),L4={enumeration:WI,model:DI,compose:jI,custom:_D,reference:X7,safeReference:pD,union:Yp,optional:Qo,literal:V7,maybe:W7,maybeNull:tD,refinement:VI,string:j7,boolean:z7,number:F7,integer:FI,float:zI,finite:BI,Date:$7,map:AI,array:MI,frozen:lD,identifier:mD,identifierNumber:yD,late:nD,lazy:aD,undefined:U7,null:B7,snapshotProcessor:kI};const SD=Object.freeze(Object.defineProperty({__proto__:null,addDisposer:kN,addMiddleware:b7,applyAction:g7,applyPatch:Ls,applySnapshot:a7,cast:MN,castFlowReturn:yI,castToReferenceSnapshot:NN,castToSnapshot:LN,clone:xN,createActionTrackingMiddleware:zN,createActionTrackingMiddleware2:UN,decorate:WN,destroy:CN,detach:PN,escapeJsonPath:lo,flow:L7,getChildType:sN,getEnv:TN,getIdentifier:s7,getLivelinessChecking:r7,getMembers:RN,getNodeId:IN,getParent:gN,getParentOfType:mN,getPath:l7,getPathParts:yN,getPropertyMembers:f7,getRelativePath:ON,getRoot:o7,getRunningActionContext:i2,getSnapshot:t2,getType:Yc,hasEnv:AN,hasParent:pN,hasParentOfType:vN,isActionContextChildOf:XN,isActionContextThisOrChildOf:ZN,isAlive:r2,isArrayType:LI,isFrozenType:sD,isIdentifierType:bD,isLateType:iD,isLiteralType:$I,isMapType:RI,isModelType:D7,isOptionalType:QI,isPrimitiveType:G7,isProtected:hN,isReferenceType:hD,isRefinementType:qI,isRoot:bN,isStateTreeNode:Ct,isType:pr,isUnionType:q7,isValidReference:EN,joinJsonPath:Sh,onAction:v7,onPatch:i7,onSnapshot:uN,process:lI,protect:fN,recordActions:VN,recordPatches:cN,resolveIdentifier:wN,resolvePath:_N,setLivelinessChecking:t7,setLivelynessChecking:oN,splitJsonPath:Fs,t:L4,toGenerator:_I,toGeneratorFunction:bI,tryReference:SN,tryResolve:u7,typecheck:S7,types:L4,unescapeJsonPath:N7,unprotect:dN,walk:c7},Symbol.toStringTag,{value:"Module"})),Ei=po(SD);var f2={};(function(e){function t({oldText:r,newText:n,element:i}){if(!(n.length/Math.max(20,r.length)>=4))return i.fontSize;const a=i.width*i.page.computedHeight/n.length,o=1.5*Math.sqrt(a),l=i.fontSize;return Math.min(l,Math.max(5,Math.round(o)))}Object.defineProperty(e,"__esModule",{value:!0}),e.getLimitedFontSize=void 0,e.getLimitedFontSize=t})(f2);(function(e){var t=me&&me.__importDefault||function(R){return R&&R.__esModule?R:{default:R}};Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=e.usePrevious=e.getLineHeight=e.useFontLoader=e.getDir=e.isRTLText=void 0;const r=t(Je),n=_i,i=Ca,a=qc,o=Ki,l=t(Si),u=aN,f=Wc,h=$i,E=Xs,w=Yn,p=e2,S=Kc,b=xl,y=Pl,v=Po,m=Ei,d=f2;l.default._fixTextRendering=!0;const g=document.createElement("style");g.type="text/css",document.head.appendChild(g);const _={border:"none",padding:"0px",overflow:"hidden",background:"none",outline:"none",resize:"none",overflowWrap:"break-word",whiteSpace:"pre-wrap",userSelect:"text",wordBreak:"normal"};function k(R){var M="֑-߿‏‫‮יִ-﷽ﹰ-ﻼ";return new RegExp("^[^"+M+"]*?["+M+"]").test(R)}function C(R){R=R.replace(/\s/g,"");let M=0;for(var F=0;F<R.length;F++)k(R[F])&&(M+=1);return M>R.length/2}function P(R){return C(R)?"rtl":"ltr"}e.isRTLText=C,e.getDir=P;const O=(0,n.observer)(({textNodeRef:R,element:M,onBlur:F,selectAll:D,cursorPosition:H})=>{const[K,G]=r.default.useState(_),B=R.current;r.default.useLayoutEffect(()=>{const ee={};ee.width=B.width()-2*B.padding()+"px",ee.height=B.height()-2*B.padding()+B.fontSize()*B.lineHeight()+"px",ee.fontSize=B.fontSize()+"px",ee.lineHeight=B.lineHeight()+.01,ee.fontFamily=B.fontFamily(),ee.textAlign=B.align(),ee.color=B.fill(),ee.fontWeight=M.fontWeight,ee.fontStyle=M.fontStyle,ee.letterSpacing=M.letterSpacing+"em";const ie=`
96
+ .polotno-input::placeholder {
97
+ color: ${K.color};
98
+ opacity: 0.6;
99
+ }
100
+ `;g.innerHTML="",g.appendChild(document.createTextNode(ie)),JSON.stringify(ee)!==JSON.stringify(K)&&G(ee)});const Y=r.default.useRef(null);r.default.useLayoutEffect(()=>{var ee;const ie=Y.current;if(!ie)return;(ee=Y.current)===null||ee===void 0||ee.focus();const ne=H||ie.value.length;ie.selectionStart=ie.selectionEnd=ne,D&&(ie==null||ie.select(),document.execCommand("selectAll",!1,null))},[]),r.default.useEffect(()=>{window.addEventListener("blur",F);const ee=ie=>{var ne;!((ne=Y.current)===null||ne===void 0)&&ne.contains(ie.target)||F()};return window.addEventListener("touchstart",ee),()=>{window.removeEventListener("blur",F),window.removeEventListener("touchstart",ee)}},[]);let X=0;const Q=B.textArr.length*B.lineHeight()*B.fontSize();M.verticalAlign==="middle"&&(X=(M.a.height-Q)/2),M.verticalAlign==="bottom"&&(X=M.a.height-Q);const te=(0,p.removeTags)(M.text);return r.default.createElement("textarea",{className:"polotno-input",ref:Y,dir:P(te),style:Object.assign(Object.assign(Object.assign({},_),K),{paddingTop:X+"px"}),value:te,onChange:ee=>{const ie=(0,d.getLimitedFontSize)({oldText:M.text,newText:ee.target.value,element:M});M.set({text:ee.target.value,fontSize:ie})},placeholder:M.placeholder,onBlur:F})}),x=R=>r.default.createElement(a.Html,null,r.default.createElement(O,Object.assign({},R))),A=R=>{const[M,F]=r.default.useState(!1),D=r.default.useRef(!1);return r.default.useEffect(()=>{var H=!0;return setTimeout(()=>{H&&(R._editModeEnabled&&(D.current=!0),F(!0),setTimeout(()=>{D.current=!1},50))},50),()=>{H=!1}},[]),{editorEnabled:M&&R._editModeEnabled,selectAll:D.current}},L=(R,M)=>{const[F,D]=r.default.useReducer(K=>K+1,0),H=r.default.useRef((0,E.isFontLoaded)(M));return r.default.useLayoutEffect(()=>{if(H.current=(0,E.isFontLoaded)(M),H.current)return;let K=!0;return(async()=>{H.current=!1,D();const G=(0,h.incrementLoader)(`text ${M}`);await R.loadFont(M),setTimeout(G,100),K&&(H.current=!0,D())})(),()=>{K=!1}},[M]),[H.current]};e.useFontLoader=L;const I=({fontLoaded:R,fontFamily:M,fontSize:F,lineHeight:D})=>r.default.useMemo(()=>{if(typeof D=="number")return D;const H=document.createElement("div");H.style.fontFamily=M,H.style.fontSize=F+"px",H.style.lineHeight=D,H.innerText="Test text",document.body.appendChild(H);const K=H.offsetHeight;return document.body.removeChild(H),K/F},[R,M,F,D]);function U(R){var M=R.getAbsoluteTransform().copy();M.invert();var F=R.getStage().getPointerPosition();return M.point(F)}function $(R){var M;const F=R.target,D=U(F),H=F.textArr,K=Math.floor(D.y/(F.fontSize()*F.lineHeight())),G=H.slice(0,K).reduce((X,Q)=>X+Q.text.length,K),B=(M=H[K])!==null&&M!==void 0?M:H[0];let Y=0;return F.align()==="right"?Y=F.width()-B.width:F.align()==="center"&&(Y=F.width()/2-B.width/2),G+Math.round((D.x-Y)/B.width*B.text.length)}function Z(R){const M=r.default.useRef(R),F=r.default.useRef(R);return r.default.useMemo(()=>{F.current=M.current,M.current=R},[R]),F.current}function q(R){return/[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF\uAC00-\uD7AF]/.test(R)}function z(R,M){const F=R.fontSize(),D=R.height(),H=(0,p.removeTags)(M.text);let K=M.a.fontSize;R.height(void 0);const G=Math.round(2*M.a.fontSize)-1;for(let B=1;B<G;B++){const Y=M.a.height&&R.height()>M.a.height;let X=H.split(`
101
+ `).join(" ").split(/[\s-]+/).reduce((ee,ie)=>q(ie)?ee.concat(ie.split("")):ee.concat(ie),[]),Q=R.textArr.map(ee=>ee.text).join(";");const te=X.find(ee=>!Q.includes(ee)||(Q=Q.replace(ee,""),!1));if(!(Y||te))break;K-=.5,R.fontSize(K)}return R.fontSize(F),R.height(D),K}function W({lines:R,lineHeight:M,width:F,align:D="left",padding:H=0,cornerRadius:K=0}){var G;R.forEach((Q,te)=>{Q.cx=F/2,D==="right"?Q.cx=F-Q.width/2:D==="left"&&(Q.cx=Q.width/2),D!=="justify"||Q.lastInParagraph||(Q.width=F),D==="justify"&&(Q.cx=Q.width/2)});let B=`M ${(G=R[0])===null||G===void 0?void 0:G.cx} ${-H}`;R.forEach((Q,te)=>{const{cx:ee}=Q,ie=R[te-1];ie&&ie.width>Q.width?B+=` L ${ee+Q.width/2+H} ${te*M+H}`:B+=` L ${ee+Q.width/2+H} ${te*M-H}`;const ne=R[te+1];ne&&ne.width>Q.width?B+=` L ${ee+Q.width/2+H} ${(te+1)*M-H}`:B+=` L ${ee+Q.width/2+H} ${(te+1)*M+H}`});for(var Y=R.length-1;Y>=0;Y--){const Q=R[Y],{cx:te}=Q,ee=R[Y+1];ee&&ee.width>Q.width?B+=` L ${te-Q.width/2-H} ${(Y+1)*M-H}`:B+=` L ${te-Q.width/2-H} ${(Y+1)*M+H}`;const ie=R[Y-1];ie&&ie.width>Q.width?B+=` L ${te-Q.width/2-H} ${Y*M+H}`:B+=` L ${te-Q.width/2-H} ${Y*M-H}`}B+=" Z";const X=(0,u.parsePath)(B);return(0,u.roundCommands)(X,K).path}e.getLineHeight=I,e.usePrevious=Z,e.TextElement=(0,n.observer)(({element:R,store:M})=>{const F=r.default.useRef(null),D=r.default.useRef(null),{editorEnabled:H,selectAll:K}=A(R),[G,B]=r.default.useState(!1),[Y,X]=r.default.useState(!1),Q=r.default.useRef(R.a.height),te=M.selectedShapes.indexOf(R)>=0,{textVerticalResizeEnabled:ee}=w.flags,ie=Z(R.fontFamily),[ne,le]=r.default.useState([]);r.default.useEffect(()=>{var Le,Ee;const Re=(Ee=(Le=F.current)===null||Le===void 0?void 0:Le.textArr)!==null&&Ee!==void 0?Ee:[];JSON.stringify(Re)!==JSON.stringify(ne)&&le(Re)}),r.default.useEffect(()=>{if(R.a.width)return;const Le=F.current;Le.width(600),R.set({width:1.4*Le.getTextWidth()})},[]),r.default.useLayoutEffect(()=>(0,o.autorun)(()=>{const Le=F.current;(0,S.applyFilter)(Le,R)}));const[Te]=(0,e.useFontLoader)(M,R.fontFamily),Ie=(0,p.removeTags)(R.text),se=()=>{const Le=F.current.clone({height:void 0}),Ee=Math.ceil(Le.fontSize()*Le.lineHeight()*Le.textArr.length+1);return Le.destroy(),Ee};r.default.useLayoutEffect(()=>{if(!Te)return;const{textOverflow:Le}=w.flags;if(R.a.height)if(Le!=="change-font-size"||Y||M.isPlaying){if(Le==="resize"){const Ee=se();ee&&R.a.height<Ee&&M.history.ignore(()=>{var Re;(0,m.isAlive)(R)&&R.set({height:Ee}),(Re=F.current)===null||Re===void 0||Re.height(Ee)},!1,!0),ee||R.a.height===Ee||M.history.ignore(()=>{var Re;(0,m.isAlive)(R)&&R.set({height:Ee}),(Re=F.current)===null||Re===void 0||Re.height(Ee)},!1,!0)}}else{const Ee=z(F.current,R);if(Ee!==R.a.fontSize)return void M.history.ignore(()=>{R.set({fontSize:Ee})},!1,!0);const Re=se();R.a.height===Re||ee||M.history.ignore(()=>{R.set({height:Re})},!1,!0)}else{const Ee=se();M.history.ignore(()=>{R.set({height:Ee})},!1,!0)}}),r.default.useLayoutEffect(()=>{const Le=F.current;Le&&(Le.width(Le.width()+1e-8),Le._setTextData(),(0,S.applyFilter)(Le,R))},[Te]);const de=r.default.useRef(null),_e=r.default.useRef(0),ve=Le=>{Le.evt.preventDefault(),M.selectedShapes.find(Re=>Re===R)&&R.contentEditable&&(_e.current=$(Le),R.toggleEditMode())},re=!Ie&&R.placeholder?.6:R.a.opacity;(0,b.useFadeIn)(F,re);const ce=(0,e.getLineHeight)({fontLoaded:Te,fontFamily:R.fontFamily,fontSize:R.a.fontSize,lineHeight:R.lineHeight}),be=R.selectable||M.role==="admin",Oe=(0,f.useColor)(R),$e=r.default.useMemo(()=>R.backgroundEnabled?W({lines:JSON.parse(JSON.stringify(ne)),cornerRadius:R.backgroundCornerRadius*(R.a.fontSize*ce*.5),lineHeight:ce*R.a.fontSize,padding:R.backgroundPadding*(R.a.fontSize*ce*.5),width:R.a.width,align:R.align}):"",[R.backgroundEnabled,R.backgroundCornerRadius,R.a.fontSize,ce,R.backgroundPadding,R.a.width,R.align,ne]),Qe=(0,v.isTouchDevice)();let Ye=0;return R.verticalAlign==="middle"?Ye=(R.a.height-ne.length*ce*R.a.fontSize)/2:R.verticalAlign==="bottom"&&(Ye=R.a.height-ne.length*ce*R.a.fontSize),r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Path,{ref:D,x:R.a.x,y:R.a.y,rotation:R.a.rotation,hideInExport:!R.showInExport,listening:!1,visible:R.backgroundEnabled,opacity:R.backgroundOpacity*re,data:$e,fill:R.backgroundColor,offsetY:-Ye}),r.default.createElement(i.Text,Object.assign({ref:F,id:R.id,name:"element",hideInExport:!R.showInExport,editModeEnabled:R._editModeEnabled,x:R.a.x,y:R.a.y,rotation:R.a.rotation,width:R.a.width,height:R.a.height,text:Ie||R.placeholder},Oe,{stroke:R.stroke,lineJoin:"round",strokeWidth:R.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:R.a.fontSize,fontFamily:`"${R.fontFamily}", "${ie}"`,fontStyle:R.fontStyle+" "+R.fontWeight,textDecoration:R.textDecoration,align:R.align,verticalAlign:R.verticalAlign,draggable:Qe?R.draggable&&te:R.draggable,preventDefault:!Qe||te,opacity:re,visible:!R._editModeEnabled,ellipsis:w.flags.textOverflow==="ellipsis",shadowEnabled:R.shadowEnabled,shadowBlur:R.shadowBlur,shadowOffsetX:R.shadowOffsetX,shadowOffsetY:R.shadowOffsetY,shadowColor:R.shadowColor,shadowOpacity:R.shadowOpacity,lineHeight:ce,letterSpacing:R.letterSpacing*R.a.fontSize,listening:be,onDragMove:Le=>{R.set({x:Le.target.x(),y:Le.target.y()})},onDragEnd:Le=>{R.set({x:Le.target.x(),y:Le.target.y()})},onMouseEnter:()=>{B(!0)},onMouseLeave:()=>{B(!1)},onClick:ve,onTap:ve,onTransformStart:()=>{X(!0),Q.current=F.current.height()},onTransform:Le=>{var Ee,Re;const Ve=Le.target;(Ee=D.current)===null||Ee===void 0||Ee.setAttrs({x:Ve.x(),y:Ve.y(),rotation:Ve.rotation(),scale:Ve.scale()});const oe=((Re=Ve.getStage())===null||Re===void 0?void 0:Re.findOne("Transformer")).getActiveAnchor();if(oe==="middle-left"||oe==="middle-right"){const fe=Ve.scaleX(),Ze=Ve.width()*fe,ye=R.a.fontSize;let Me=Ze;Ze<ye&&(Me=ye,de.current&&Ve.position(de.current)),Ve.width(Me),Ve.scaleX(1),Ve.scaleY(1);const Pe=se();if(w.flags.textOverflow!=="ellipsis"){const we=Math.max(Pe,Q.current);Ve.height(we),R.set({height:Ve.height()})}R.set({x:Ve.x(),y:Ve.y(),width:Ve.width(),rotation:Ve.rotation()}),(0,S.applyFilter)(Ve,R)}if(oe==="top-center"||oe==="bottom-center"){let fe=w.flags.textOverflow==="resize"?se():ce*R.a.fontSize;Le.target.height(Math.max(fe,Le.target.height()*Le.target.scaleY())),Le.target.scaleY(1)}de.current=Le.target.position()},onTransformEnd:Le=>{var Ee;const Re=Le.target.scaleX();Le.target.scaleX(1),Le.target.scaleY(1),R.set({fontSize:Math.round(R.a.fontSize*Re),width:Math.ceil(Le.target.width()*Re),x:Le.target.x(),y:Le.target.y(),rotation:Le.target.rotation(),height:Le.target.height()*Re,shadowBlur:R.shadowBlur*Re,shadowOffsetX:R.shadowOffsetX*Re,shadowOffsetY:R.shadowOffsetY*Re,strokeWidth:R.strokeWidth*Re}),(Ee=D.current)===null||Ee===void 0||Ee.setAttrs({scaleX:1,scaleY:1}),X(!1)}})),H&&r.default.createElement(i.Group,{x:R.a.x,y:R.a.y,rotation:R.a.rotation},r.default.createElement(x,{textNodeRef:F,element:R,selectAll:K,cursorPosition:_e.current,onBlur:()=>{R.toggleEditMode(!1)}})),!Y&&(G||te)&&r.default.createElement(y.Highlighter,{element:R}))})})(Zy);var d2={},Qs={},Q7={exports:{}},J7={exports:{}};(function(e,t){e.exports=r;function r(i){return n.bind(null,i)}function n(i){var a=[].slice.call(arguments,1);a.unshift("["+i+"]"),process.stderr.write(a.join(" ")+`
102
+ `)}})(J7);var h2=J7.exports;(function(e,t){h2("lex"),e.exports=r;function r(n){var i="",a,o=0,l=-1,u=0,f=1,h="before-selector",E=[h],w={},p=[],S=["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 b(){return P(),n[l]}function y(q){return q?E[E.length-1-q]:h}function v(q){var z=l+1;return q===n.slice(z,z+q.length)}function m(q){var z=n.slice(l).indexOf(q);return z>0?z:!1}function d(q){return q===g(1)}function g(q){return n[l+(q||1)]}function _(){var q=E.pop();return h=E[E.length-1],q}function k(q){return h=q,E.push(h),E.length}function C(q){var z=h;return E[E.length-1]=h=q,z}function P(q){if((q||1)==1)n[l]==`
103
+ `?(f++,o=1):o++,l++;else{var z=n.slice(l,l+q).split(`
104
+ `);z.length>1&&(f+=z.length-1,o=1),o+=z[z.length-1].length,l=l+q}}function O(){w.end={line:f,col:o},p.push(w),i="",w={}}function x(q){w={type:q,start:{line:f,col:o}}}for(;a=b();)switch(a){case" ":switch(y()){case"selector":case"value":case"value-paren":case"at-group":case"at-value":case"comment":case"double-string":case"single-string":i+=a;break}break;case`
105
+ `:case" ":case"\r":case"\f":switch(y()){case"value":case"value-paren":case"at-group":case"comment":case"single-string":case"double-string":case"selector":i+=a;break;case"at-value":a===`
106
+ `&&(w.value=i.trim(),O(),_());break}break;case":":switch(y()){case"name":w.name=i.trim(),i="",C("before-value");break;case"before-selector":i+=a,x("selector"),k("selector");break;case"before-value":C("value"),i+=a;break;default:i+=a;break}break;case";":switch(y()){case"name":case"before-value":case"value":i.trim().length>0&&(w.value=i.trim(),O()),C("before-name");break;case"value-paren":i+=a;break;case"at-value":w.value=i.trim(),O(),_();break;case"before-name":break;default:i+=a;break}break;case"{":switch(y()){case"selector":if(g(-1)==="\\"){i+=a;break}w.text=i.trim(),O(),C("before-name"),u=u+1;break;case"at-group":switch(w.name=i.trim(),w.type){case"font-face":case"viewport":case"page":k("before-name");break;default:k("before-selector")}O(),u=u+1;break;case"name":case"at-rule":w.name=i.trim(),O(),k("before-name"),u=u+1;break;case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":C("value"),i+=a;break}break;case"}":switch(y()){case"before-name":case"name":case"before-value":case"value":i&&(w.value=i.trim()),w.name&&w.value&&O(),x("end"),O(),_(),y()==="at-group"&&(x("at-group-end"),O(),_()),u>0&&(u=u-1);break;case"at-group":case"before-selector":case"selector":if(g(-1)==="\\"){i+=a;break}u>0&&y(1)==="at-group"&&(x("at-group-end"),O()),u>1&&_(),u>0&&(u=u-1);break;case"double-string":case"single-string":case"comment":i+=a;break}break;case'"':case"'":switch(y()){case"double-string":a==='"'&&g(-1)!=="\\"&&_();break;case"single-string":a==="'"&&g(-1)!=="\\"&&_();break;case"before-at-value":C("at-value"),k(a==='"'?"double-string":"single-string");break;case"before-value":C("value"),k(a==='"'?"double-string":"single-string");break;case"comment":break;default:g(-1)!=="\\"&&k(a==='"'?"double-string":"single-string")}i+=a;break;case"/":switch(y()){case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":case"selector":case"name":case"value":if(d("*")){var A=m("*/");A&&P(A+1)}else y()=="before-value"&&C("value"),i+=a;break;default:d("*")?(x("comment"),k("comment"),P()):i+=a;break}break;case"*":switch(y()){case"comment":d("/")?(w.text=i,P(),O(),_()):i+=a;break;case"before-selector":i+=a,x("selector"),k("selector");break;case"before-value":C("value"),i+=a;break;default:i+=a}break;case"@":switch(y()){case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":C("value"),i+=a;break;default:for(var L=!1,I,U,$=0,Z=S.length;!L&&$<Z;++$)U=S[$],I=U.name||U,v(I)&&(L=!0,x(I),k(U.state||"at-group"),P(I.length),U.prefix&&(w.prefix=U.prefix),U.type&&(w.type=U.type));L||(i+=a);break}break;case"(":switch(y()){case"value":k("value-paren");break;case"before-value":C("value");break}i+=a;break;case")":switch(y()){case"value-paren":_();break;case"before-value":C("value");break}i+=a;break;default:switch(y()){case"before-selector":x("selector"),k("selector");break;case"before-name":x("property"),C("name");break;case"before-value":C("value");break;case"before-at-value":C("at-value");break}i+=a;break}return p}})(Q7);var eS=Q7.exports,tS={exports:{}};(function(e,t){h2("parse");var r=eS;e.exports=l;var n,i,a,o;function l(_,k){k||(k={}),n=!!k.comments,a=!!k.position,i=0,o=Array.isArray(_)?_.slice():r(_);for(var C,P=[],O;O=f();)C=v(O),C&&P.push(C);return{type:"stylesheet",stylesheet:{rules:P}}}function u(_,k){k||(k={});for(var C,P=["type","name","value"],O={},x=0;x<P.length;++x)C=P[x],_[C]&&(O[C]=k[C]||_[C]);for(P=Object.keys(k),x=0;x<P.length;++x)C=P[x],O[C]||(O[C]=k[C]);return a&&(O.position={start:_.start,end:_.end}),O}function f(){var _=o.shift();return _}function h(_){i=i+1;var k={};switch(_.type){case"font-face":case"viewport":k.declarations=d();break;case"page":k.prefix=_.prefix,k.declarations=d();break;default:k.prefix=_.prefix,k.rules=g()}return u(_,k)}function E(_){return u(_)}function w(_){return u(_)}function p(_){return u(_,{text:_.text})}function S(_){return u(_)}function b(_){return u(_)}function y(_){function k(C){return C.trim()}return u(_,{type:"rule",selectors:_.text.split(",").map(k),declarations:d()})}function v(_){switch(_.type){case"property":return b(_);case"selector":return y(_);case"at-group-end":i=i-1;return;case"media":case"keyframes":return h(_);case"comment":if(n)return p(_);break;case"charset":return w(_);case"import":return E(_);case"namespace":return S(_);case"font-face":case"supports":case"viewport":case"document":case"page":return h(_)}}function m(_){for(var k,C=[],P;(P=f())&&_&&_(P);)k=v(P),k&&C.push(k);return P&&P.type!=="end"&&o.unshift(P),C}function d(){return m(function(_){return _.type==="property"||_.type==="comment"})}function g(){return m(function(){return i})}})(tS);var ED=tS.exports,rS={exports:{}};(function(e,t){h2("stringify");var r,n,i,a,o,l;e.exports=u;function u(g,_){_||(_={}),i=_.indentation||"",n=!!_.compress,r=!!_.comments,a=1,n?o=l="":(o=`
107
+ `,l=" ");var k=S(g.stylesheet.rules,m).join(`
108
+ `).trim();return k}function f(g){if(g){a+=g;return}return n?"":Array(a).join(i||"")}function h(g){return"@"+g.type+" "+g.value+";"+o}function E(g){var _="",k=g.prefix||"";g.name&&(_=" "+g.name);var C=g.type!=="page";return"@"+k+g.type+_+l+b(g,C)+o}function w(g){return r?"/*"+(g.text||"")+"*/"+o:""}function p(g){var _;return g.selectors?_=g.selectors.join(","+o):(_="@"+g.type,_+=g.name?" "+g.name:""),f()+_+l+b(g)+o}function S(g,_){return g.reduce(function(k,C){var P=C.type==="comment"?w(C):_(C);return P&&k.push(P),k},[])}function b(g,_){var k=g.declarations,C=v;return g.rules&&(k=g.rules,C=p),k=y(k,C),k&&(k=o+k+(_?"":o)),"{"+k+f()+"}"}function y(g,_){if(!g)return"";f(1);var k=S(g,_);return f(-1),k.length?k.join(o):""}function v(g){if(g.type==="property")return d(g)}function m(g){switch(g.type){case"rule":return p(g);case"media":case"keyframes":return E(g);case"comment":return w(g);case"import":case"charset":case"namespace":return h(g);case"font-face":case"supports":case"viewport":case"document":case"page":return E(g)}}function d(g){var _=g.name?g.name+":"+l:"";return f()+_+g.value+";"}})(rS);var OD=rS.exports,xD={lex:eS,parse:ED,stringify:OD};(function(e){var t=me&&me.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(e,"__esModule",{value:!0}),e.useSvgColors=e.replaceColors=e.sameColors=e.fixSize=e.getSvgSize=e.svgToURL=e.getColors=e.urlToString=e.urlToBase64=void 0;const r=t(Si),n=t(Je),i=Qy,a=t(xD);function o(_){for(;_.parentNode;){if(_.nodeName==="defs")return!0;_=_.parentNode}return!1}function l(_){const k={};return _.querySelectorAll("style").forEach(C=>{const P=a.default.parse(C.textContent).stylesheet.rules;for(let O of P)O.selectors&&O.selectors.forEach(x=>{const A=k[x]||{};O.declarations.forEach(L=>{A[L.name]=L.value}),k[x]=A})}),k}function u(_,k){var C;const P={fill:"",stroke:""},O=((C=_.getAttribute("class"))===null||C===void 0?void 0:C.split(" "))||[],x=_.getAttribute("id");let A={};if(x&&k[`#${x}`]?A=k[`#${x}`]:O.forEach(L=>{k[`.${L}`]&&(A=Object.assign(Object.assign({},A),k[`.${L}`]))}),k[_.nodeName]&&(A=Object.assign(Object.assign({},A),k[_.nodeName])),_.getAttribute("fill")&&_.getAttribute("fill")!=="none"?P.fill=_.getAttribute("fill"):A.fill&&A.fill!=="none"&&(P.fill=A.fill),_.getAttribute("stroke")&&_.getAttribute("stroke")!=="none"?P.stroke=_.getAttribute("stroke"):A.stroke&&A.stroke!=="none"&&(P.stroke=A.stroke),!P.fill&&_.style.fill&&_.style.fill!=="none"&&(P.fill=_.style.fill),!P.stroke&&_.style.stroke&&_.style.stroke!=="none"&&(P.stroke=_.style.stroke),!P.stroke&&!P.fill){const L=_.ownerSVGElement,I=L&&L!==_&&u(L,k);(I==null?void 0:I.fill)==="currentColor"||(I==null?void 0:I.stroke)==="currentColor"||(P.fill="black")}return P}const f=["path","rect","circle","line","polygon","polyline","ellipse","text"];function h(_){for(var k=[],C=_.getElementsByTagName("*"),P=0,O=C.length;P<O;P++){const x=C[P];o(x)||(x.getAttribute("fill")!==null&&k.push(x),(x.getAttribute("stroke")!==null||x.style&&x.style.fill||f.indexOf(x.nodeName)>=0)&&k.push(x))}return k}async function E(_){const k=await fetch(_);return S(await k.text())}async function w(_){return await(await fetch(_,{mode:"cors"})).text()}function p(_){var k=new DOMParser().parseFromString(_,"image/svg+xml");const C=l(k),P=h(k),O=[];return P.forEach(x=>{const{fill:A,stroke:L}=u(x,C);[A,L].forEach(I=>{I&&(I==="currentColor"&&(I="black"),r.default.Util.colorToRGBA(I)&&O.indexOf(I)===-1&&O.push(I))})}),O}function S(_){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(_)))}async function b(_){const k=await w(_),C=new DOMParser().parseFromString(k,"image/svg+xml").documentElement.getAttribute("viewBox"),[P,O,x,A]=(C==null?void 0:C.split(" "))||[];return{width:parseFloat(x),height:parseFloat(A)}}function y(_){var k=new DOMParser().parseFromString(_,"image/svg+xml");const C=k.documentElement.getAttribute("viewBox"),[P,O,x,A]=(C==null?void 0:C.split(" "))||[],L=k.documentElement.getAttribute("width");!L&&k.documentElement.setAttribute("width",x+"px");const I=k.documentElement.getAttribute("height");if((!I||I.indexOf("%")>=0)&&k.documentElement.setAttribute("height",A+"px"),L&&L.indexOf("%")>=0&&I&&I.indexOf("%")===-1){const U=parseFloat(I)/parseFloat(A);k.documentElement.setAttribute("width",U*parseFloat(x)+"px")}if(I&&I.indexOf("%")>=0&&L&&L.indexOf("%")===-1){const U=parseFloat(L)/parseFloat(x);k.documentElement.setAttribute("height",U*parseFloat(A)+"px")}return L==="100%"&&I==="100%"&&(k.documentElement.setAttribute("width",x+"px"),k.documentElement.setAttribute("height",A+"px")),new XMLSerializer().serializeToString(k)}e.urlToBase64=E,e.urlToString=w,e.getColors=p,e.svgToURL=S,e.getSvgSize=b,e.fixSize=y;const v=(_,k)=>{if(!_||!k)return!1;if(k==="currentColor"&&_==="black")return!0;const C=r.default.Util.colorToRGBA(_),P=r.default.Util.colorToRGBA(k);return C&&P?C.r===P.r&&C.g===P.g&&C.b===P.b&&C.a===P.a:void 0};function m(_,k,C,P){var O=_.namespaceURI,x=document.createElementNS(O,"linearGradient");const A=r.default.Util.degToRad(C+90),L=(Math.cos(A)+1)/2,I=(Math.sin(A)+1)/2,U=(Math.cos(A+Math.PI)+1)/2,$=(Math.sin(A+Math.PI)+1)/2;x.setAttribute("x1",100*L+"%"),x.setAttribute("y1",100*I+"%"),x.setAttribute("x2",100*U+"%"),x.setAttribute("y2",100*$+"%"),x.setAttribute("gradientUnits","userSpaceOnUse"),x.setAttribute("id",k);for(var Z=0;Z<P.length;Z++){var q=P[Z],z=document.createElementNS(O,"stop");for(var W in q)q.hasOwnProperty(W)&&z.setAttribute(W,q[W]);x.appendChild(z)}return(_.querySelector("defs")||_.insertBefore(document.createElementNS(O,"defs"),_.firstChild)).appendChild(x)}function d(_,k){var C=new DOMParser().parseFromString(_,"image/svg+xml");const P=h(C),O=Array.from(k.keys()),x=l(C);return P.forEach(A=>{const{fill:L,stroke:I}=u(A,x);[{prop:"fill",color:L},{prop:"stroke",color:I}].forEach(({prop:U,color:$})=>{const Z=O.find(q=>(0,e.sameColors)(q,$));if(Z){const q=k.get(Z);if((0,i.isGradient)(q)){const{rotation:z,stops:W}=(0,i.parseColor)(q),R=W.map(F=>({offset:100*F.offset+"%","stop-color":F.color})),M="color"+Math.round(1e8*Math.random());m(C.children[0],M,z,R),A.style[U]=null,A.setAttribute(U,`url('#${M}')`)}else A.style[U]=k.get(Z)}})}),S(new XMLSerializer().serializeToString(C))}e.sameColors=v,e.replaceColors=d;const g=_=>{const[k,C]=n.default.useState([]);return n.default.useEffect(()=>{let P=!1;return(async()=>{C([]);const O=p(await w(_));P||C(O)})(),()=>{P=!0}},[_]),k};e.useSvgColors=g})(Qs);(function(e){var t=me&&me.__createBinding||(Object.create?function(D,H,K,G){G===void 0&&(G=K);var B=Object.getOwnPropertyDescriptor(H,K);B&&!("get"in B?!H.__esModule:B.writable||B.configurable)||(B={enumerable:!0,get:function(){return H[K]}}),Object.defineProperty(D,G,B)}:function(D,H,K,G){G===void 0&&(G=K),D[G]=H[K]}),r=me&&me.__setModuleDefault||(Object.create?function(D,H){Object.defineProperty(D,"default",{enumerable:!0,value:H})}:function(D,H){D.default=H}),n=me&&me.__importStar||function(D){if(D&&D.__esModule)return D;var H={};if(D!=null)for(var K in D)K!=="default"&&Object.prototype.hasOwnProperty.call(D,K)&&t(H,D,K);return r(H,D),H},i=me&&me.__importDefault||function(D){return D&&D.__esModule?D:{default:D}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=e.useImageLoader=e.setImageLoaderHook=void 0;const a=i(Je),o=_i,l=Ki,u=Ca,f=i(qp),h=i(Si),E=qc,w=Pl,p=$i,S=n(Qs),b=Yn,y=Kc,v=xl,m=Po;function d(){return document.createElement("canvas")}async function g(D){if(!(D.indexOf("data:image/svg+xml")>=0||D.indexOf(".svg")>=0))return D;const H=await S.urlToString(D),K=S.fixSize(H);return S.svgToURL(K)}const _=D=>{const[H,K]=a.default.useState(D);return a.default.useEffect(()=>{(async()=>{const G=await g(D);G!==H&&K(G)})()},[D]),H};function k(D,H){return Math.sqrt(Math.pow(H.x-D.x,2)+Math.pow(H.y-D.y,2))}function C(D,H){return{x:(D.x+H.x)/2,y:(D.y+H.y)/2}}const P=(D,H,K)=>{const G=a.default.useMemo(()=>{var B,Y;const{flipX:X,flipY:Q}=D,te=D.type==="svg"||D.src.indexOf("data:image/svg+xml")>=0||D.src.indexOf(".svg")>=0,ee=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,ie=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||ee)&&te||D.maskSrc;if(!X&&!Q&&!ie)return H;if(!H||!H.width||!H.height)return null;const ne=d();let le=1;D.type==="svg"&&(le=Math.max(D.a.width/H.width*K,D.a.height/H.height*K)),ne.width=Math.max(H.width*le,1),ne.height=Math.max(H.height*le,1);let Te=X?-ne.width:0,Ie=Q?-ne.height:0;return(B=ne.getContext("2d"))===null||B===void 0||B.scale(X?-1:1,Q?-1:1),(Y=ne.getContext("2d"))===null||Y===void 0||Y.drawImage(H,Te,Ie,ne.width,ne.height),ne},[D.maskSrc,D.flipX,D.flipY,H,D.a.width,D.a.height,K]);return a.default.useEffect(()=>()=>{G&&G.nodeName==="CANVAS"&&h.default.Util.releaseCanvas(G)},[G]),G};function O(D,H){const K=H.width/H.height;let G,B;return K>=D.width/D.height?(G=D.width,B=D.width/K):(G=D.height*K,B=D.height),{x:(D.width-G)/2,y:(D.height-B)/2,width:G,height:B}}function x(D,H,K,G,B,Y,X){for(var Q=new ImageData(H,K),te=new Int32Array(D.data.buffer),ee=D.width,ie=new Int32Array(Q.data.buffer),ne=Q.width,le=H/Y,Te=K/X,Ie=Math.round(1/le),se=Math.round(1/Te),de=Ie*se,_e=0;_e<Q.height;_e++)for(var ve=0;ve<ne;ve++){for(var re=G+Math.round(ve/le)+(B+Math.round(_e/Te))*ee,ce=0,be=0,Oe=0,$e=0,Qe=0;Qe<se;Qe++)for(var Ye=0;Ye<Ie;Ye++){var Le=te[re+Ye+Qe*ee];ce+=Le<<24>>>24,be+=Le<<16>>>24,Oe+=Le<<8>>>24,$e+=Le>>>24}ce=Math.round(ce/de),be=Math.round(be/de),Oe=Math.round(Oe/de),$e=Math.round($e/de),ie[ve+_e*ne]=$e<<24|Oe<<16|be<<8|ce}return Q}function A(D,H){var K,G;const B=d();B.width=D.width,B.height=D.height;const Y=Math.max(1,Math.floor(B.width*H)),X=Math.max(1,Math.floor(B.height*H));(K=B.getContext("2d"))===null||K===void 0||K.drawImage(D,0,0,B.width,B.height);const Q=x(B.getContext("2d").getImageData(0,0,B.width,B.height),Y,X,0,0,B.width,B.height);return B.width=Y,B.height=X,(G=B.getContext("2d"))===null||G===void 0||G.putImageData(Q,0,0),B}const L=(D,H)=>{const[K,G]=z(D.maskSrc,"anonymous"),B=D.maskSrc?G:"loaded";return(0,e.useImageLoader)(B,D.id+"-mask"),a.default.useMemo(()=>{if(!K||!H||!H.width||!H.height)return H;const Y=d();Y.width=Math.max(H.width,1),Y.height=Math.max(H.height,1);const X=Y.getContext("2d");if(!X)return H;X.drawImage(H,0,0),X.globalCompositeOperation="source-in";const Q=O(K,D);return X.drawImage(K,Q.x,Q.y,Q.width,Q.height,0,0,H.width,H.height),Y},[H,K,D.a.width,D.a.height])},I=(D,H,K,G,B=0,Y=!1)=>{const X=Math.floor(Math.max(D.a.width*G,1)),Q=Math.floor(Math.max(D.a.height*G,1)),te=Math.min(B*G,X/2,Q/2),ee=Math.max(D.a.width/K.width,D.a.height/K.height)*G,ie=D.page._exportingOrRendering&&b.flags.imageDownScalingEnabled&&ee<1&&!Y,ne=K.x===0&&K.y===0&&K.width===(H==null?void 0:H.width)&&K.height===(H==null?void 0:H.height),le=a.default.useMemo(()=>{if(!(!H||!H.width||!H.height))return ne&&te===0&&!ie?void 0:d()},[H,te,ie,ne]);return a.default.useLayoutEffect(()=>{if(!le||!H)return;le.width=X,le.height=Q;const Te=le.getContext("2d");if(!Te)return;te&&(Te.beginPath(),Te.moveTo(te,0),Te.lineTo(X-te,0),Te.arc(X-te,te,te,3*Math.PI/2,0,!1),Te.lineTo(X,Q-te),Te.arc(X-te,Q-te,te,0,Math.PI/2,!1),Te.lineTo(te,Q),Te.arc(te,Q-te,te,Math.PI/2,Math.PI,!1),Te.lineTo(0,te),Te.arc(te,te,te,Math.PI,3*Math.PI/2,!1),Te.clip());const Ie=ie?A(H,ee):H,se=ie?{x:Math.floor(K.x*ee),y:Math.floor(K.y*ee),width:Math.floor(K.width*ee),height:Math.floor(K.height*ee)}:K;Te.drawImage(Ie,se.x,se.y,se.width,se.height,0,0,le.width,le.height)},[le,D.a.width,D.a.height,K.x,K.y,K.width,K.height,B,G,Y,D.page._exportingOrRendering,ie]),a.default.useEffect(()=>()=>{le&&le.nodeName==="CANVAS"&&h.default.Util.releaseCanvas(le)},[le]),le||H},U=(D,H,K,G)=>{const B=_(D.clipSrc||""),[Y,X]=z(B,"anonymous"),Q=D.clipSrc?X:"loaded";(0,e.useImageLoader)(Q,D.id+"-clip");const te=a.default.useMemo(()=>{if(H&&Y)return d()},[H,Y]);return a.default.useLayoutEffect(()=>{var ee;if(!Y||!H||!H.width||!H.height||!Y||!Y.width||!Y.height||!te)return;const ie=d(),ne=Math.max(D.a.width/Y.width*K,D.a.height/Y.height*K);ie.width=Y.width*ne,ie.height=Y.height*ne,(ee=ie.getContext("2d"))===null||ee===void 0||ee.drawImage(Y,0,0,ie.width,ie.height),te.width=Math.max(H.width,1),te.height=Math.max(H.height,1);const le=te.getContext("2d");le&&(le.save(),le.drawImage(ie,0,0,H.width,H.height),h.default.Util.releaseCanvas(ie),le.globalCompositeOperation="source-in",le.drawImage(H,0,0,te.width,te.height),le.restore())},[te,H,Y,D.a.width,D.a.height,K,...G]),D.clipSrc&&Y?te:H},$=d(),Z=(0,o.observer)(({element:D})=>{const H=Math.min(30,D.a.width/4,D.a.height/4),K=a.default.useRef(null);return a.default.useEffect(()=>{const G=K.current;if(!G)return;const B=new h.default.Animation(Y=>{G.rotate(((Y==null?void 0:Y.timeDiff)||0)/2)},G.getLayer());return B.start(),()=>{B.stop()}}),a.default.createElement(u.Group,{x:D.x,y:D.y,rotation:D.rotation,listening:!1,opacity:D.a.opacity,hideInExport:!D.showInExport},a.default.createElement(u.Rect,{width:D.a.width,height:D.a.height,fill:"rgba(124, 173, 212, 0.8)"}),a.default.createElement(u.Arc,{ref:K,x:D.a.width/2,y:D.a.height/2,fill:"white",outerRadius:Math.abs(H),innerRadius:Math.max(1,H-5),angle:270}))}),q=(0,o.observer)(({element:D})=>{const H="Can not load the image...",K=Math.max(10,Math.min(30,D.a.width/25));return a.default.createElement(u.Group,{x:D.x,y:D.y,rotation:D.rotation,listening:!1,opacity:D.a.opacity,hideInExport:!D.showInExport},a.default.createElement(u.Rect,{width:D.a.width,height:D.a.height,fill:"rgba(223, 102, 102, 0.8)"}),a.default.createElement(u.Text,{text:H,fontSize:K,width:D.a.width,height:D.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let z=f.default;const W=D=>{z=D};e.setImageLoaderHook=W;const R=(D,H)=>{const K=a.default.useRef(),G=()=>{var B;(B=K.current)===null||B===void 0||B.call(K),K.current=void 0};a.default.useEffect(()=>G,[]),a.default.useLayoutEffect(()=>{D!=="loading"||K.current||(K.current=(0,p.incrementLoader)(`image ${H}`)),D!=="loading"&&G(),D==="failed"&&(0,p.triggerLoadError)(`image ${H}`)},[D])};e.useImageLoader=R;const M=({image:D,status:H,type:K})=>{const G=a.default.useRef();return a.default.useEffect(()=>{G.current=D||G.current},[D]),H!=="failed"||H!=="failed"&&K==="svg"?G.current:void 0},F=D=>{const[H,K]=a.default.useReducer(X=>X+1,0),G=a.default.useRef("loading"),B=a.default.useRef(D.src),Y=a.default.useRef(D.src);return Y.current!==D.src&&(Y.current=D.src,G.current="loading"),a.default.useEffect(()=>{if(D.type!=="svg"||!D.src)return;let X=!1;return(async()=>{G.current="loading",K();const Q=await S.urlToString(D.src),te=S.fixSize(Q),ee=S.replaceColors(te,D.colorsReplace);X||(B.current=ee,G.current="loaded",K())})(),()=>{X=!0}},[D.src,JSON.stringify(D.colorsReplace)]),D.type!=="svg"?[D.src,"loaded"]:[B.current,G.current]};e.ImageElement=(0,o.observer)(({element:D,store:H})=>{var K;const[G,B]=a.default.useState(!1),Y=a.default.useRef(null),X=a.default.useRef(null),[Q,te]=a.default.useState(!1),ee=H.selectedShapes.indexOf(D)>=0,[ie,ne]=F(D),[le,Te]=z(ie,"anonymous"),Ie=D.type!=="svg"||ne==="loaded"?Te:"loading";(0,e.useImageLoader)(Ie,D.id);const se=D.page._exportingOrRendering?1:Math.max(1,H.scale),de=H._elementsPixelRatio*se,_e=M({image:le,status:Te,type:D.type}),ve=L(D,P(D,le||_e,de))||$;let{cropX:re,cropY:ce,cropWidth:be,cropHeight:Oe}=D;Te!=="loaded"&&(re=ce=0,be=Oe=1);const $e=ve.width*be,Qe=ve.height*Oe,Ye=D.a.width/D.a.height;let Le,Ee;const Re=$e/Qe,Ve=D.type==="svg";Ve?(Le=$e,Ee=Qe):Ye>=Re?(Le=$e,Ee=$e/Ye):(Le=Qe*Ye,Ee=Qe);const oe={x:ve.width*re,y:ve.height*ce,width:Le,height:Ee},fe=(K=D.cornerRadius)!==null&&K!==void 0?K:0,Ze=D.page._exportingOrRendering?1:Math.min(2,H.scale),ye=H._elementsPixelRatio*Ze;let Me=U(D,I(D,ve,oe,ye,fe,G||D._cropModeEnabled||D.type==="svg"),ye,[oe,fe,ye]);const Pe=Math.max(D.a.width/Le,D.a.height/Ee);a.default.useEffect(()=>{var Ne;if(!D._cropModeEnabled)return;const tt=(Ne=Y.current)===null||Ne===void 0?void 0:Ne.getStage();function ct(Et){D._cropModeEnabled&&Et.target!==X.current&&D.toggleCropMode(!1)}function Mt(Et){D._cropModeEnabled&&Et.target.parentNode!==tt.content&&D.toggleCropMode(!1)}return document.body.addEventListener("click",Mt),tt==null||tt.on("click",ct),tt==null||tt.on("tap",ct),()=>{document.body.removeEventListener("click",Mt),document.body.removeEventListener("touchstart",Mt),tt==null||tt.off("click",ct),tt==null||tt.off("click",ct)}},[D._cropModeEnabled]),a.default.useLayoutEffect(()=>{if(!(G||D._cropModeEnabled))return(0,y.applyFilter)(Y.current,D),(0,l.autorun)(()=>{(0,y.applyFilter)(Y.current,D)},{delay:100})},[Me,D.page._exportingOrRendering,G,be,Oe,D._cropModeEnabled]),a.default.useLayoutEffect(()=>{var Ne;G||D._cropModeEnabled?(Ne=Y.current)===null||Ne===void 0||Ne.clearCache():(0,y.applyFilter)(Y.current,D)},[G,D.a.width,D.a.height,D._cropModeEnabled]),a.default.useEffect(()=>{(0,y.applyFilter)(Y.current,D)},[D.shadowEnabled,D.shadowBlur,D.cornerRadius,D.shadowColor,D.shadowOffsetX,D.shadowOffsetY,D.shadowOpacity]);const we=a.default.useRef(null),et=a.default.useRef(null),Se=a.default.useRef(null);a.default.useLayoutEffect(()=>{D._cropModeEnabled&&(et.current.nodes([we.current]),Se.current.nodes([X.current]))},[D._cropModeEnabled]);var We=a.default.useRef(null),lr=a.default.useRef(0),xe=a.default.useRef(!1);const ze=Ne=>{var tt;((tt=Ne.evt.touches)===null||tt===void 0?void 0:tt.length)>2&&Ne.target.stopDrag(),Math.round(Ne.target.x())>0&&(Ne.target.x(0),Ne.target.scaleX(1)),Math.round(Ne.target.y())>0&&(Ne.target.y(0),Ne.target.scaleY(1));const ct=Ne.target.width()*Ne.target.scaleX(),Mt=Ne.target.height()*Ne.target.scaleY(),Et=Math.min(1,Le/ct),Jr=Math.min(1,Ee/Mt),$r=1-Et,Ut=Math.min($r,Math.max(0,Math.round(-Ne.target.x())/ct)),en=1-Jr,Mn=Math.min(en,Math.max(0,Math.round(-Ne.target.y())/Mt));Ne.target.setAttrs({x:-Ut*ve.width,y:-Mn*ve.height,scaleX:1,scaleY:1}),D.set({cropX:Ut,cropY:Mn,cropWidth:Et,cropHeight:Jr})},rt=()=>{D.type!=="svg"&&D.contentEditable&&setTimeout(()=>{D.toggleCropMode(!0)})},yt=D.type==="svg"&&_e,xt=Te==="loading"&&!yt,xr=Te==="failed",Zr=!xt&&!xr,mr=a.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Qr=Zr?D.a.opacity:0;(0,v.useFadeIn)(Y,Qr);const Qn=D.selectable||H.role==="admin",Rn=(0,m.isTouchDevice)();return a.default.createElement(a.default.Fragment,null,xt&&a.default.createElement(Z,{element:D}),xr&&a.default.createElement(q,{element:D}),a.default.createElement(u.Image,{ref:Y,name:"element",id:D.id,image:Me,x:D.a.x,y:D.a.y,width:D.a.width||1,height:D.a.height||1,rotation:D.a.rotation,opacity:Qr,shadowEnabled:D.shadowEnabled,shadowBlur:D.shadowBlur,shadowOffsetX:D.shadowOffsetX,shadowOffsetY:D.shadowOffsetY,shadowColor:D.shadowColor,shadowOpacity:D.shadowOpacity,customCrop:oe,listening:Qn,draggable:Rn?D.draggable&&ee:D.draggable,preventDefault:!Rn||ee,hideInExport:!D.showInExport,onMouseEnter:()=>{te(!0)},onMouseLeave:()=>{te(!1)},onDragMove:Ne=>{D.set({x:Ne.target.x(),y:Ne.target.y()})},onDragEnd:Ne=>{D.set({x:Ne.target.x(),y:Ne.target.y()})},onDblClick:rt,onDblTap:rt,onTransformStart:()=>{B(!0),mr.current={cropX:D.cropX,cropY:D.cropY,cropWidth:D.cropWidth,cropHeight:D.cropHeight}},onTransform:Ne=>{var tt;const ct=Ne.currentTarget,Mt=Math.abs(ct.scaleX()-1)<1e-7?1:ct.scaleX(),Et=Math.abs(ct.scaleY()-1)<1e-7?1:ct.scaleY();ct.scaleX(1),ct.scaleY(1);const Jr=(tt=Ne.target.getStage())===null||tt===void 0?void 0:tt.findOne("Transformer"),$r=1-Le/ve.width,Ut=Math.min($r,Math.max(0,D.cropX)),en=1-Ee/ve.height,Mn=Math.min(en,Math.max(0,D.cropY)),Ln=Jr.getActiveAnchor(),Ta=!(Ln.indexOf("middle")>=0||Ln.indexOf("center")>=0),ru=!Ta&&Mt<1&&mr.current.cropHeight>Ee/ve.height;let ko=Ta?D.cropWidth:D.cropWidth*Mt;ru&&(ko=D.cropWidth);const To=!Ta&&Et<1&&mr.current.cropWidth>Le/ve.width;let Aa=Ta?D.cropHeight:D.cropHeight*Et;To&&(Aa=D.cropHeight),Ve&&(ko=D.cropWidth,Aa=D.cropHeight),D.set({cropX:Ut,cropY:Mn,x:ct.x(),y:ct.y(),width:ct.width()*Mt,height:ct.height()*Et,rotation:Ne.target.rotation(),cropWidth:Math.min(ko,1-Ut),cropHeight:Math.min(Aa,1-Mn)})},onTransformEnd:Ne=>{const tt=Ne.currentTarget;D.set({width:tt.width(),height:tt.height(),x:tt.x(),y:tt.y(),rotation:Ne.target.rotation(),cropWidth:Le/ve.width,cropHeight:Ee/ve.height}),B(!1)}}),a.default.createElement(u.Rect,{x:D.x,y:D.y,width:Math.max(D.a.width-D.borderSize,0),height:Math.max(D.a.height-D.borderSize,0),opacity:Qr,offsetX:-D.borderSize/2,offsetY:-D.borderSize/2,stroke:D.borderColor,strokeWidth:D.borderSize,listening:!1,visible:!!D.borderSize,rotation:D.rotation,cornerRadius:Math.max(0,fe-D.borderSize),hideInExport:!D.showInExport}),D._cropModeEnabled&&a.default.createElement(E.Portal,{selector:".page-abs-container",enabled:!0},a.default.createElement(u.Rect,{x:-window.innerWidth/H.scale,y:-window.innerWidth/H.scale,width:window.innerWidth/H.scale*3,height:window.innerWidth/H.scale*3,fill:"rgba(0,0,0,0.3)"}),a.default.createElement(u.Image,{listening:!1,image:Me,x:D.x,y:D.y,width:D.a.width,height:D.a.height,rotation:D.rotation,shadowEnabled:D.shadowEnabled,shadowBlur:D.shadowBlur}),a.default.createElement(u.Group,{x:D.x,y:D.y,rotation:D.rotation,scaleX:Pe,scaleY:Pe},a.default.createElement(u.Image,{image:ve,ref:X,opacity:.4,draggable:!0,x:-D.cropX*ve.width,y:-D.cropY*ve.height,onDragMove:ze,onTransform:ze,onTouchMove:Ne=>{Ne.evt.preventDefault();const tt=Ne.target.getStage().getPointersPositions();var ct=tt[0],Mt=tt[1];const Et=Ne.target;if(ct&&!Mt&&!Et.isDragging()&&xe.current&&(Et.startDrag(),xe.current=!1),ct&&Mt){h.default.hitOnDragEnabled=!0,Et.isDragging()&&(xe.current=!0,Et.stopDrag());const To=Ne.target.getAbsoluteTransform().copy();To.invert();var Jr={x:ct.x,y:ct.y},$r={x:Mt.x,y:Mt.y};if(!We.current)return void(We.current=C(Jr,$r));var Ut=C(Jr,$r),en=k(Jr,$r);lr.current||(lr.current=en);const Aa=Et.position();var Mn={x:Ut.x-Aa.x,y:Ut.y-Aa.y},Ln=en/lr.current;Et.scaleX(Ln),Et.scaleY(Ln);const Zc=To.point(Ut),kl=To.point(We.current);var Ta=Zc.x-kl.x,ru=Zc.y-kl.y,ko={x:Math.min(0,Ut.x-Mn.x*Ln+Ta),y:Math.min(0,Ut.y-Mn.y*Ln+ru)};Et.position(ko),lr.current=en,We.current=Ut,ze(Ne)}},onTouchEnd:Ne=>{lr.current=0,We.current=null,h.default.hitOnDragEnabled=!1}}),a.default.createElement(u.Transformer,{ref:Se,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ne,tt)=>tt.width<5||tt.height<5?Ne:tt,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),a.default.createElement(u.Rect,{width:Le,height:Ee,ref:we,listening:!1,onTransform:Ne=>{Ne.target.x()<-D.cropX*ve.width-1e-9&&(Ne.target.x(-D.cropX*ve.width),Ne.target.scaleX(1)),Ne.target.y()<-D.cropY*ve.height-1e-9&&(Ne.target.y(-D.cropY*ve.height),Ne.target.scaleY(1));const tt=Math.min(1,Math.max(0,D.cropX+Ne.target.x()/ve.width)),ct=Math.min(1,Math.max(0,Ne.target.y()/ve.height+D.cropY)),Mt=Ne.target.width()*Ne.target.scaleX(),Et=Ne.target.height()*Ne.target.scaleY(),Jr=Math.min(1-tt,Mt/ve.width),$r=Math.min(1-ct,Et/ve.height),Ut=Ne.target.getAbsolutePosition(Ne.target.getParent().getParent());Ne.target.scale({x:1,y:1}),Ne.target.position({x:0,y:0}),D.set({x:Ut.x,y:Ut.y,cropX:tt,cropY:ct,cropWidth:Jr,cropHeight:$r,width:Math.min(Mt*Pe,ve.width*(1-tt)*Pe),height:Math.min(Et*Pe,ve.height*(1-ct)*Pe)})}}),a.default.createElement(u.Transformer,{ref:et,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ne,tt)=>tt.width<5||tt.height<5?Ne:tt,visible:D.resizable,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),(Q||ee)&&a.default.createElement(w.Highlighter,{element:D}))})})(d2);var nS={},iS={exports:{}};/*!
109
+ * Quill Editor v1.3.7
110
+ * https://quilljs.com/
111
+ * Copyright (c) 2014, Jason Chen
112
+ * Copyright (c) 2013, salesforce.com
113
+ */(function(e,t){(function(n,i){e.exports=i()})(typeof self<"u"?self:me,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var o=n[a]={i:a,l:!1,exports:{}};return r[a].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=r,i.c=n,i.d=function(a,o,l){i.o(a,o)||Object.defineProperty(a,o,{configurable:!1,enumerable:!0,get:l})},i.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(o,"a",o),o},i.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)},i.p="",i(i.s=109)}([function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(17),o=i(18),l=i(19),u=i(45),f=i(46),h=i(47),E=i(48),w=i(49),p=i(12),S=i(32),b=i(33),y=i(31),v=i(1),m={Scope:v.Scope,create:v.create,find:v.find,query:v.query,register:v.register,Container:a.default,Format:o.default,Leaf:l.default,Embed:E.default,Scroll:u.default,Block:h.default,Inline:f.default,Text:w.default,Attributor:{Attribute:p.default,Class:S.default,Style:b.default,Store:y.default}};n.default=m},function(r,n,i){var a=this&&this.__extends||function(){var y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,m){v.__proto__=m}||function(v,m){for(var d in m)m.hasOwnProperty(d)&&(v[d]=m[d])};return function(v,m){y(v,m);function d(){this.constructor=v}v.prototype=m===null?Object.create(m):(d.prototype=m.prototype,new d)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=function(y){a(v,y);function v(m){var d=this;return m="[Parchment] "+m,d=y.call(this,m)||this,d.message=m,d.name=d.constructor.name,d}return v}(Error);n.ParchmentError=o;var l={},u={},f={},h={};n.DATA_KEY="__blot";var E;(function(y){y[y.TYPE=3]="TYPE",y[y.LEVEL=12]="LEVEL",y[y.ATTRIBUTE=13]="ATTRIBUTE",y[y.BLOT=14]="BLOT",y[y.INLINE=7]="INLINE",y[y.BLOCK=11]="BLOCK",y[y.BLOCK_BLOT=10]="BLOCK_BLOT",y[y.INLINE_BLOT=6]="INLINE_BLOT",y[y.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",y[y.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",y[y.ANY=15]="ANY"})(E=n.Scope||(n.Scope={}));function w(y,v){var m=S(y);if(m==null)throw new o("Unable to create "+y+" blot");var d=m,g=y instanceof Node||y.nodeType===Node.TEXT_NODE?y:d.create(v);return new d(g,v)}n.create=w;function p(y,v){return v===void 0&&(v=!1),y==null?null:y[n.DATA_KEY]!=null?y[n.DATA_KEY].blot:v?p(y.parentNode,v):null}n.find=p;function S(y,v){v===void 0&&(v=E.ANY);var m;if(typeof y=="string")m=h[y]||l[y];else if(y instanceof Text||y.nodeType===Node.TEXT_NODE)m=h.text;else if(typeof y=="number")y&E.LEVEL&E.BLOCK?m=h.block:y&E.LEVEL&E.INLINE&&(m=h.inline);else if(y instanceof HTMLElement){var d=(y.getAttribute("class")||"").split(/\s+/);for(var g in d)if(m=u[d[g]],m)break;m=m||f[y.tagName]}return m==null?null:v&E.LEVEL&m.scope&&v&E.TYPE&m.scope?m:null}n.query=S;function b(){for(var y=[],v=0;v<arguments.length;v++)y[v]=arguments[v];if(y.length>1)return y.map(function(g){return b(g)});var m=y[0];if(typeof m.blotName!="string"&&typeof m.attrName!="string")throw new o("Invalid definition");if(m.blotName==="abstract")throw new o("Cannot register abstract class");if(h[m.blotName||m.attrName]=m,typeof m.keyName=="string")l[m.keyName]=m;else if(m.className!=null&&(u[m.className]=m),m.tagName!=null){Array.isArray(m.tagName)?m.tagName=m.tagName.map(function(g){return g.toUpperCase()}):m.tagName=m.tagName.toUpperCase();var d=Array.isArray(m.tagName)?m.tagName:[m.tagName];d.forEach(function(g){(f[g]==null||m.className==null)&&(f[g]=m)})}return m}n.register=b},function(r,n,i){var a=i(51),o=i(11),l=i(3),u=i(20),f="\0",h=function(E){Array.isArray(E)?this.ops=E:E!=null&&Array.isArray(E.ops)?this.ops=E.ops:this.ops=[]};h.prototype.insert=function(E,w){var p={};return E.length===0?this:(p.insert=E,w!=null&&typeof w=="object"&&Object.keys(w).length>0&&(p.attributes=w),this.push(p))},h.prototype.delete=function(E){return E<=0?this:this.push({delete:E})},h.prototype.retain=function(E,w){if(E<=0)return this;var p={retain:E};return w!=null&&typeof w=="object"&&Object.keys(w).length>0&&(p.attributes=w),this.push(p)},h.prototype.push=function(E){var w=this.ops.length,p=this.ops[w-1];if(E=l(!0,{},E),typeof p=="object"){if(typeof E.delete=="number"&&typeof p.delete=="number")return this.ops[w-1]={delete:p.delete+E.delete},this;if(typeof p.delete=="number"&&E.insert!=null&&(w-=1,p=this.ops[w-1],typeof p!="object"))return this.ops.unshift(E),this;if(o(E.attributes,p.attributes)){if(typeof E.insert=="string"&&typeof p.insert=="string")return this.ops[w-1]={insert:p.insert+E.insert},typeof E.attributes=="object"&&(this.ops[w-1].attributes=E.attributes),this;if(typeof E.retain=="number"&&typeof p.retain=="number")return this.ops[w-1]={retain:p.retain+E.retain},typeof E.attributes=="object"&&(this.ops[w-1].attributes=E.attributes),this}}return w===this.ops.length?this.ops.push(E):this.ops.splice(w,0,E),this},h.prototype.chop=function(){var E=this.ops[this.ops.length-1];return E&&E.retain&&!E.attributes&&this.ops.pop(),this},h.prototype.filter=function(E){return this.ops.filter(E)},h.prototype.forEach=function(E){this.ops.forEach(E)},h.prototype.map=function(E){return this.ops.map(E)},h.prototype.partition=function(E){var w=[],p=[];return this.forEach(function(S){var b=E(S)?w:p;b.push(S)}),[w,p]},h.prototype.reduce=function(E,w){return this.ops.reduce(E,w)},h.prototype.changeLength=function(){return this.reduce(function(E,w){return w.insert?E+u.length(w):w.delete?E-w.delete:E},0)},h.prototype.length=function(){return this.reduce(function(E,w){return E+u.length(w)},0)},h.prototype.slice=function(E,w){E=E||0,typeof w!="number"&&(w=1/0);for(var p=[],S=u.iterator(this.ops),b=0;b<w&&S.hasNext();){var y;b<E?y=S.next(E-b):(y=S.next(w-b),p.push(y)),b+=u.length(y)}return new h(p)},h.prototype.compose=function(E){var w=u.iterator(this.ops),p=u.iterator(E.ops),S=[],b=p.peek();if(b!=null&&typeof b.retain=="number"&&b.attributes==null){for(var y=b.retain;w.peekType()==="insert"&&w.peekLength()<=y;)y-=w.peekLength(),S.push(w.next());b.retain-y>0&&p.next(b.retain-y)}for(var v=new h(S);w.hasNext()||p.hasNext();)if(p.peekType()==="insert")v.push(p.next());else if(w.peekType()==="delete")v.push(w.next());else{var m=Math.min(w.peekLength(),p.peekLength()),d=w.next(m),g=p.next(m);if(typeof g.retain=="number"){var _={};typeof d.retain=="number"?_.retain=m:_.insert=d.insert;var k=u.attributes.compose(d.attributes,g.attributes,typeof d.retain=="number");if(k&&(_.attributes=k),v.push(_),!p.hasNext()&&o(v.ops[v.ops.length-1],_)){var C=new h(w.rest());return v.concat(C).chop()}}else typeof g.delete=="number"&&typeof d.retain=="number"&&v.push(g)}return v.chop()},h.prototype.concat=function(E){var w=new h(this.ops.slice());return E.ops.length>0&&(w.push(E.ops[0]),w.ops=w.ops.concat(E.ops.slice(1))),w},h.prototype.diff=function(E,w){if(this.ops===E.ops)return new h;var p=[this,E].map(function(m){return m.map(function(d){if(d.insert!=null)return typeof d.insert=="string"?d.insert:f;var g=m===E?"on":"with";throw new Error("diff() called "+g+" non-document")}).join("")}),S=new h,b=a(p[0],p[1],w),y=u.iterator(this.ops),v=u.iterator(E.ops);return b.forEach(function(m){for(var d=m[1].length;d>0;){var g=0;switch(m[0]){case a.INSERT:g=Math.min(v.peekLength(),d),S.push(v.next(g));break;case a.DELETE:g=Math.min(d,y.peekLength()),y.next(g),S.delete(g);break;case a.EQUAL:g=Math.min(y.peekLength(),v.peekLength(),d);var _=y.next(g),k=v.next(g);o(_.insert,k.insert)?S.retain(g,u.attributes.diff(_.attributes,k.attributes)):S.push(k).delete(g);break}d-=g}}),S.chop()},h.prototype.eachLine=function(E,w){w=w||`
114
+ `;for(var p=u.iterator(this.ops),S=new h,b=0;p.hasNext();){if(p.peekType()!=="insert")return;var y=p.peek(),v=u.length(y)-p.peekLength(),m=typeof y.insert=="string"?y.insert.indexOf(w,v)-v:-1;if(m<0)S.push(p.next());else if(m>0)S.push(p.next(m));else{if(E(S,p.next(1).attributes||{},b)===!1)return;b+=1,S=new h}}S.length()>0&&E(S,{},b)},h.prototype.transform=function(E,w){if(w=!!w,typeof E=="number")return this.transformPosition(E,w);for(var p=u.iterator(this.ops),S=u.iterator(E.ops),b=new h;p.hasNext()||S.hasNext();)if(p.peekType()==="insert"&&(w||S.peekType()!=="insert"))b.retain(u.length(p.next()));else if(S.peekType()==="insert")b.push(S.next());else{var y=Math.min(p.peekLength(),S.peekLength()),v=p.next(y),m=S.next(y);if(v.delete)continue;m.delete?b.push(m):b.retain(y,u.attributes.transform(v.attributes,m.attributes,w))}return b.chop()},h.prototype.transformPosition=function(E,w){w=!!w;for(var p=u.iterator(this.ops),S=0;p.hasNext()&&S<=E;){var b=p.peekLength(),y=p.peekType();if(p.next(),y==="delete"){E-=Math.min(b,E-S);continue}else y==="insert"&&(S<E||!w)&&(E+=b);S+=b}return E},r.exports=h},function(r,n){var i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,o=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=function(p){return typeof Array.isArray=="function"?Array.isArray(p):a.call(p)==="[object Array]"},f=function(p){if(!p||a.call(p)!=="[object Object]")return!1;var S=i.call(p,"constructor"),b=p.constructor&&p.constructor.prototype&&i.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!S&&!b)return!1;var y;for(y in p);return typeof y>"u"||i.call(p,y)},h=function(p,S){o&&S.name==="__proto__"?o(p,S.name,{enumerable:!0,configurable:!0,value:S.newValue,writable:!0}):p[S.name]=S.newValue},E=function(p,S){if(S==="__proto__")if(i.call(p,S)){if(l)return l(p,S).value}else return;return p[S]};r.exports=function w(){var p,S,b,y,v,m,d=arguments[0],g=1,_=arguments.length,k=!1;for(typeof d=="boolean"&&(k=d,d=arguments[1]||{},g=2),(d==null||typeof d!="object"&&typeof d!="function")&&(d={});g<_;++g)if(p=arguments[g],p!=null)for(S in p)b=E(d,S),y=E(p,S),d!==y&&(k&&y&&(f(y)||(v=u(y)))?(v?(v=!1,m=b&&u(b)?b:[]):m=b&&f(b)?b:{},h(d,{name:S,newValue:w(k,m,y)})):typeof y<"u"&&h(d,{name:S,newValue:y}));return d}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BlockEmbed=n.bubbleFormats=void 0;var a=function(){function A(L,I){for(var U=0;U<I.length;U++){var $=I[U];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(L,$.key,$)}}return function(L,I,U){return I&&A(L.prototype,I),U&&A(L,U),L}}(),o=function A(L,I,U){L===null&&(L=Function.prototype);var $=Object.getOwnPropertyDescriptor(L,I);if($===void 0){var Z=Object.getPrototypeOf(L);return Z===null?void 0:A(Z,I,U)}else{if("value"in $)return $.value;var q=$.get;return q===void 0?void 0:q.call(U)}},l=i(3),u=d(l),f=i(2),h=d(f),E=i(0),w=d(E),p=i(16),S=d(p),b=i(6),y=d(b),v=i(7),m=d(v);function d(A){return A&&A.__esModule?A:{default:A}}function g(A,L){if(!(A instanceof L))throw new TypeError("Cannot call a class as a function")}function _(A,L){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:A}function k(A,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);A.prototype=Object.create(L&&L.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(A,L):A.__proto__=L)}var C=1,P=function(A){k(L,A);function L(){return g(this,L),_(this,(L.__proto__||Object.getPrototypeOf(L)).apply(this,arguments))}return a(L,[{key:"attach",value:function(){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"attach",this).call(this),this.attributes=new w.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new h.default().insert(this.value(),(0,u.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(U,$){var Z=w.default.query(U,w.default.Scope.BLOCK_ATTRIBUTE);Z!=null&&this.attributes.attribute(Z,$)}},{key:"formatAt",value:function(U,$,Z,q){this.format(Z,q)}},{key:"insertAt",value:function(U,$,Z){if(typeof $=="string"&&$.endsWith(`
115
+ `)){var q=w.default.create(O.blotName);this.parent.insertBefore(q,U===0?this:this.next),q.insertAt(0,$.slice(0,-1))}else o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertAt",this).call(this,U,$,Z)}}]),L}(w.default.Embed);P.scope=w.default.Scope.BLOCK_BLOT;var O=function(A){k(L,A);function L(I){g(this,L);var U=_(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,I));return U.cache={},U}return a(L,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(w.default.Leaf).reduce(function(U,$){return $.length()===0?U:U.insert($.value(),x($))},new h.default).insert(`
116
+ `,x(this))),this.cache.delta}},{key:"deleteAt",value:function(U,$){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"deleteAt",this).call(this,U,$),this.cache={}}},{key:"formatAt",value:function(U,$,Z,q){$<=0||(w.default.query(Z,w.default.Scope.BLOCK)?U+$===this.length()&&this.format(Z,q):o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"formatAt",this).call(this,U,Math.min($,this.length()-U-1),Z,q),this.cache={})}},{key:"insertAt",value:function(U,$,Z){if(Z!=null)return o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertAt",this).call(this,U,$,Z);if($.length!==0){var q=$.split(`
117
+ `),z=q.shift();z.length>0&&(U<this.length()-1||this.children.tail==null?o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertAt",this).call(this,Math.min(U,this.length()-1),z):this.children.tail.insertAt(this.children.tail.length(),z),this.cache={});var W=this;q.reduce(function(R,M){return W=W.split(R,!0),W.insertAt(0,M),M.length},U+z.length)}}},{key:"insertBefore",value:function(U,$){var Z=this.children.head;o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertBefore",this).call(this,U,$),Z instanceof S.default&&Z.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"length",this).call(this)+C),this.cache.length}},{key:"moveChildren",value:function(U,$){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"moveChildren",this).call(this,U,$),this.cache={}}},{key:"optimize",value:function(U){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"optimize",this).call(this,U),this.cache={}}},{key:"path",value:function(U){return o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"path",this).call(this,U,!0)}},{key:"removeChild",value:function(U){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"removeChild",this).call(this,U),this.cache={}}},{key:"split",value:function(U){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if($&&(U===0||U>=this.length()-C)){var Z=this.clone();return U===0?(this.parent.insertBefore(Z,this),this):(this.parent.insertBefore(Z,this.next),Z)}else{var q=o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"split",this).call(this,U,$);return this.cache={},q}}}]),L}(w.default.Block);O.blotName="block",O.tagName="P",O.defaultChild="break",O.allowedChildren=[y.default,w.default.Embed,m.default];function x(A){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return A==null||(typeof A.formats=="function"&&(L=(0,u.default)(L,A.formats())),A.parent==null||A.parent.blotName=="scroll"||A.parent.statics.scope!==A.statics.scope)?L:x(A.parent,L)}n.bubbleFormats=x,n.BlockEmbed=P,n.default=O},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.overload=n.expandConfig=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(W){return typeof W}:function(W){return W&&typeof Symbol=="function"&&W.constructor===Symbol&&W!==Symbol.prototype?"symbol":typeof W},o=function(){function W(R,M){var F=[],D=!0,H=!1,K=void 0;try{for(var G=R[Symbol.iterator](),B;!(D=(B=G.next()).done)&&(F.push(B.value),!(M&&F.length===M));D=!0);}catch(Y){H=!0,K=Y}finally{try{!D&&G.return&&G.return()}finally{if(H)throw K}}return F}return function(R,M){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return W(R,M);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function W(R,M){for(var F=0;F<M.length;F++){var D=M[F];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(R,D.key,D)}}return function(R,M,F){return M&&W(R.prototype,M),F&&W(R,F),R}}();i(50);var u=i(2),f=x(u),h=i(14),E=x(h),w=i(8),p=x(w),S=i(9),b=x(S),y=i(0),v=x(y),m=i(15),d=x(m),g=i(3),_=x(g),k=i(10),C=x(k),P=i(34),O=x(P);function x(W){return W&&W.__esModule?W:{default:W}}function A(W,R,M){return R in W?Object.defineProperty(W,R,{value:M,enumerable:!0,configurable:!0,writable:!0}):W[R]=M,W}function L(W,R){if(!(W instanceof R))throw new TypeError("Cannot call a class as a function")}var I=(0,C.default)("quill"),U=function(){l(W,null,[{key:"debug",value:function(M){M===!0&&(M="log"),C.default.level(M)}},{key:"find",value:function(M){return M.__quill||v.default.find(M)}},{key:"import",value:function(M){return this.imports[M]==null&&I.error("Cannot import "+M+". Are you sure it was registered?"),this.imports[M]}},{key:"register",value:function(M,F){var D=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof M!="string"){var K=M.attrName||M.blotName;typeof K=="string"?this.register("formats/"+K,M,F):Object.keys(M).forEach(function(G){D.register(G,M[G],F)})}else this.imports[M]!=null&&!H&&I.warn("Overwriting "+M+" with",F),this.imports[M]=F,(M.startsWith("blots/")||M.startsWith("formats/"))&&F.blotName!=="abstract"?v.default.register(F):M.startsWith("modules")&&typeof F.register=="function"&&F.register()}}]);function W(R){var M=this,F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(L(this,W),this.options=$(R,F),this.container=this.options.container,this.container==null)return I.error("Invalid Quill container",R);this.options.debug&&W.debug(this.options.debug);var D=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new p.default,this.scroll=v.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new E.default(this.scroll),this.selection=new d.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(p.default.events.EDITOR_CHANGE,function(K){K===p.default.events.TEXT_CHANGE&&M.root.classList.toggle("ql-blank",M.editor.isBlank())}),this.emitter.on(p.default.events.SCROLL_UPDATE,function(K,G){var B=M.selection.lastRange,Y=B&&B.length===0?B.index:void 0;Z.call(M,function(){return M.editor.update(null,G,Y)},K)});var H=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+D+"<p><br></p></div>");this.setContents(H),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return l(W,[{key:"addContainer",value:function(M){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof M=="string"){var D=M;M=document.createElement("div"),M.classList.add(D)}return this.container.insertBefore(M,F),M}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(M,F,D){var H=this,K=q(M,F,D),G=o(K,4);return M=G[0],F=G[1],D=G[3],Z.call(this,function(){return H.editor.deleteText(M,F)},D,M,-1*F)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(M),this.container.classList.toggle("ql-disabled",!M)}},{key:"focus",value:function(){var M=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=M,this.scrollIntoView()}},{key:"format",value:function(M,F){var D=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:p.default.sources.API;return Z.call(this,function(){var K=D.getSelection(!0),G=new f.default;if(K==null)return G;if(v.default.query(M,v.default.Scope.BLOCK))G=D.editor.formatLine(K.index,K.length,A({},M,F));else{if(K.length===0)return D.selection.format(M,F),G;G=D.editor.formatText(K.index,K.length,A({},M,F))}return D.setSelection(K,p.default.sources.SILENT),G},H)}},{key:"formatLine",value:function(M,F,D,H,K){var G=this,B=void 0,Y=q(M,F,D,H,K),X=o(Y,4);return M=X[0],F=X[1],B=X[2],K=X[3],Z.call(this,function(){return G.editor.formatLine(M,F,B)},K,M,0)}},{key:"formatText",value:function(M,F,D,H,K){var G=this,B=void 0,Y=q(M,F,D,H,K),X=o(Y,4);return M=X[0],F=X[1],B=X[2],K=X[3],Z.call(this,function(){return G.editor.formatText(M,F,B)},K,M,0)}},{key:"getBounds",value:function(M){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,D=void 0;typeof M=="number"?D=this.selection.getBounds(M,F):D=this.selection.getBounds(M.index,M.length);var H=this.container.getBoundingClientRect();return{bottom:D.bottom-H.top,height:D.height,left:D.left-H.left,right:D.right-H.left,top:D.top-H.top,width:D.width}}},{key:"getContents",value:function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-M,D=q(M,F),H=o(D,2);return M=H[0],F=H[1],this.editor.getContents(M,F)}},{key:"getFormat",value:function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof M=="number"?this.editor.getFormat(M,F):this.editor.getFormat(M.index,M.length)}},{key:"getIndex",value:function(M){return M.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(M){return this.scroll.leaf(M)}},{key:"getLine",value:function(M){return this.scroll.line(M)}},{key:"getLines",value:function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof M!="number"?this.scroll.lines(M.index,M.length):this.scroll.lines(M,F)}},{key:"getModule",value:function(M){return this.theme.modules[M]}},{key:"getSelection",value:function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return M&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-M,D=q(M,F),H=o(D,2);return M=H[0],F=H[1],this.editor.getText(M,F)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(M,F,D){var H=this,K=arguments.length>3&&arguments[3]!==void 0?arguments[3]:W.sources.API;return Z.call(this,function(){return H.editor.insertEmbed(M,F,D)},K,M)}},{key:"insertText",value:function(M,F,D,H,K){var G=this,B=void 0,Y=q(M,0,D,H,K),X=o(Y,4);return M=X[0],B=X[2],K=X[3],Z.call(this,function(){return G.editor.insertText(M,F,B)},K,M,F.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(M,F,D){this.clipboard.dangerouslyPasteHTML(M,F,D)}},{key:"removeFormat",value:function(M,F,D){var H=this,K=q(M,F,D),G=o(K,4);return M=G[0],F=G[1],D=G[3],Z.call(this,function(){return H.editor.removeFormat(M,F)},D,M)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(M){var F=this,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API;return Z.call(this,function(){M=new f.default(M);var H=F.getLength(),K=F.editor.deleteText(0,H),G=F.editor.applyDelta(M),B=G.ops[G.ops.length-1];B!=null&&typeof B.insert=="string"&&B.insert[B.insert.length-1]===`
118
+ `&&(F.editor.deleteText(F.getLength()-1,1),G.delete(1));var Y=K.compose(G);return Y},D)}},{key:"setSelection",value:function(M,F,D){if(M==null)this.selection.setRange(null,F||W.sources.API);else{var H=q(M,F,D),K=o(H,4);M=K[0],F=K[1],D=K[3],this.selection.setRange(new m.Range(M,F),D),D!==p.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(M){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API,D=new f.default().insert(M);return this.setContents(D,F)}},{key:"update",value:function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p.default.sources.USER,F=this.scroll.update(M);return this.selection.update(M),F}},{key:"updateContents",value:function(M){var F=this,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API;return Z.call(this,function(){return M=new f.default(M),F.editor.applyDelta(M,D)},D,!0)}}]),W}();U.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},U.events=p.default.events,U.sources=p.default.sources,U.version="1.3.7",U.imports={delta:f.default,parchment:v.default,"core/module":b.default,"core/theme":O.default};function $(W,R){if(R=(0,_.default)(!0,{container:W,modules:{clipboard:!0,keyboard:!0,history:!0}},R),!R.theme||R.theme===U.DEFAULTS.theme)R.theme=O.default;else if(R.theme=U.import("themes/"+R.theme),R.theme==null)throw new Error("Invalid theme "+R.theme+". Did you register it?");var M=(0,_.default)(!0,{},R.theme.DEFAULTS);[M,R].forEach(function(H){H.modules=H.modules||{},Object.keys(H.modules).forEach(function(K){H.modules[K]===!0&&(H.modules[K]={})})});var F=Object.keys(M.modules).concat(Object.keys(R.modules)),D=F.reduce(function(H,K){var G=U.import("modules/"+K);return G==null?I.error("Cannot load "+K+" module. Are you sure you registered it?"):H[K]=G.DEFAULTS||{},H},{});return R.modules!=null&&R.modules.toolbar&&R.modules.toolbar.constructor!==Object&&(R.modules.toolbar={container:R.modules.toolbar}),R=(0,_.default)(!0,{},U.DEFAULTS,{modules:D},M,R),["bounds","container","scrollingContainer"].forEach(function(H){typeof R[H]=="string"&&(R[H]=document.querySelector(R[H]))}),R.modules=Object.keys(R.modules).reduce(function(H,K){return R.modules[K]&&(H[K]=R.modules[K]),H},{}),R}function Z(W,R,M,F){if(this.options.strict&&!this.isEnabled()&&R===p.default.sources.USER)return new f.default;var D=M==null?null:this.getSelection(),H=this.editor.delta,K=W();if(D!=null&&(M===!0&&(M=D.index),F==null?D=z(D,K,R):F!==0&&(D=z(D,M,F,R)),this.setSelection(D,p.default.sources.SILENT)),K.length()>0){var G,B=[p.default.events.TEXT_CHANGE,K,H,R];if((G=this.emitter).emit.apply(G,[p.default.events.EDITOR_CHANGE].concat(B)),R!==p.default.sources.SILENT){var Y;(Y=this.emitter).emit.apply(Y,B)}}return K}function q(W,R,M,F,D){var H={};return typeof W.index=="number"&&typeof W.length=="number"?typeof R!="number"?(D=F,F=M,M=R,R=W.length,W=W.index):(R=W.length,W=W.index):typeof R!="number"&&(D=F,F=M,M=R,R=0),(typeof M>"u"?"undefined":a(M))==="object"?(H=M,D=F):typeof M=="string"&&(F!=null?H[M]=F:D=M),D=D||p.default.sources.API,[W,R,H,D]}function z(W,R,M,F){if(W==null)return null;var D=void 0,H=void 0;if(R instanceof f.default){var K=[W.index,W.index+W.length].map(function(X){return R.transformPosition(X,F!==p.default.sources.USER)}),G=o(K,2);D=G[0],H=G[1]}else{var B=[W.index,W.index+W.length].map(function(X){return X<R||X===R&&F===p.default.sources.USER?X:M>=0?X+M:Math.max(R,X+M)}),Y=o(B,2);D=Y[0],H=Y[1]}return new m.Range(D,H-D)}n.expandConfig=$,n.overload=q,n.default=U},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function y(v,m){for(var d=0;d<m.length;d++){var g=m[d];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(v,g.key,g)}}return function(v,m,d){return m&&y(v.prototype,m),d&&y(v,d),v}}(),o=function y(v,m,d){v===null&&(v=Function.prototype);var g=Object.getOwnPropertyDescriptor(v,m);if(g===void 0){var _=Object.getPrototypeOf(v);return _===null?void 0:y(_,m,d)}else{if("value"in g)return g.value;var k=g.get;return k===void 0?void 0:k.call(d)}},l=i(7),u=E(l),f=i(0),h=E(f);function E(y){return y&&y.__esModule?y:{default:y}}function w(y,v){if(!(y instanceof v))throw new TypeError("Cannot call a class as a function")}function p(y,v){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:y}function S(y,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);y.prototype=Object.create(v&&v.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(y,v):y.__proto__=v)}var b=function(y){S(v,y);function v(){return w(this,v),p(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return a(v,[{key:"formatAt",value:function(d,g,_,k){if(v.compare(this.statics.blotName,_)<0&&h.default.query(_,h.default.Scope.BLOT)){var C=this.isolate(d,g);k&&C.wrap(_,k)}else o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"formatAt",this).call(this,d,g,_,k)}},{key:"optimize",value:function(d){if(o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"optimize",this).call(this,d),this.parent instanceof v&&v.compare(this.statics.blotName,this.parent.statics.blotName)>0){var g=this.parent.isolate(this.offset(),this.length());this.moveChildren(g),g.wrap(this)}}}],[{key:"compare",value:function(d,g){var _=v.order.indexOf(d),k=v.order.indexOf(g);return _>=0||k>=0?_-k:d===g?0:d<g?-1:1}}]),v}(h.default.Inline);b.allowedChildren=[b,h.default.Embed,u.default],b.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=l(a);function l(w){return w&&w.__esModule?w:{default:w}}function u(w,p){if(!(w instanceof p))throw new TypeError("Cannot call a class as a function")}function f(w,p){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:w}function h(w,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);w.prototype=Object.create(p&&p.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(w,p):w.__proto__=p)}var E=function(w){h(p,w);function p(){return u(this,p),f(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(o.default.Text);n.default=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function m(d,g){for(var _=0;_<g.length;_++){var k=g[_];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(d,k.key,k)}}return function(d,g,_){return g&&m(d.prototype,g),_&&m(d,_),d}}(),o=function m(d,g,_){d===null&&(d=Function.prototype);var k=Object.getOwnPropertyDescriptor(d,g);if(k===void 0){var C=Object.getPrototypeOf(d);return C===null?void 0:m(C,g,_)}else{if("value"in k)return k.value;var P=k.get;return P===void 0?void 0:P.call(_)}},l=i(54),u=E(l),f=i(10),h=E(f);function E(m){return m&&m.__esModule?m:{default:m}}function w(m,d){if(!(m instanceof d))throw new TypeError("Cannot call a class as a function")}function p(m,d){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:m}function S(m,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);m.prototype=Object.create(d&&d.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(m,d):m.__proto__=d)}var b=(0,h.default)("quill:events"),y=["selectionchange","mousedown","mouseup","click"];y.forEach(function(m){document.addEventListener(m,function(){for(var d=arguments.length,g=Array(d),_=0;_<d;_++)g[_]=arguments[_];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(k){if(k.__quill&&k.__quill.emitter){var C;(C=k.__quill.emitter).handleDOM.apply(C,g)}})})});var v=function(m){S(d,m);function d(){w(this,d);var g=p(this,(d.__proto__||Object.getPrototypeOf(d)).call(this));return g.listeners={},g.on("error",b.error),g}return a(d,[{key:"emit",value:function(){b.log.apply(b,arguments),o(d.prototype.__proto__||Object.getPrototypeOf(d.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(_){for(var k=arguments.length,C=Array(k>1?k-1:0),P=1;P<k;P++)C[P-1]=arguments[P];(this.listeners[_.type]||[]).forEach(function(O){var x=O.node,A=O.handler;(_.target===x||x.contains(_.target))&&A.apply(void 0,[_].concat(C))})}},{key:"listenDOM",value:function(_,k,C){this.listeners[_]||(this.listeners[_]=[]),this.listeners[_].push({node:k,handler:C})}}]),d}(u.default);v.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},v.sources={API:"api",SILENT:"silent",USER:"user"},n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});function a(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}var o=function l(u){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};a(this,l),this.quill=u,this.options=f};o.DEFAULTS={},n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=["error","warn","log","info"],o="warn";function l(f){if(a.indexOf(f)<=a.indexOf(o)){for(var h,E=arguments.length,w=Array(E>1?E-1:0),p=1;p<E;p++)w[p-1]=arguments[p];(h=console)[f].apply(h,w)}}function u(f){return a.reduce(function(h,E){return h[E]=l.bind(console,E,f),h},{})}l.level=u.level=function(f){o=f},n.default=u},function(r,n,i){var a=Array.prototype.slice,o=i(52),l=i(53),u=r.exports=function(w,p,S){return S||(S={}),w===p?!0:w instanceof Date&&p instanceof Date?w.getTime()===p.getTime():!w||!p||typeof w!="object"&&typeof p!="object"?S.strict?w===p:w==p:E(w,p,S)};function f(w){return w==null}function h(w){return!(!w||typeof w!="object"||typeof w.length!="number"||typeof w.copy!="function"||typeof w.slice!="function"||w.length>0&&typeof w[0]!="number")}function E(w,p,S){var b,y;if(f(w)||f(p)||w.prototype!==p.prototype)return!1;if(l(w))return l(p)?(w=a.call(w),p=a.call(p),u(w,p,S)):!1;if(h(w)){if(!h(p)||w.length!==p.length)return!1;for(b=0;b<w.length;b++)if(w[b]!==p[b])return!1;return!0}try{var v=o(w),m=o(p)}catch{return!1}if(v.length!=m.length)return!1;for(v.sort(),m.sort(),b=v.length-1;b>=0;b--)if(v[b]!=m[b])return!1;for(b=v.length-1;b>=0;b--)if(y=v[b],!u(w[y],p[y],S))return!1;return typeof w==typeof p}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(1),o=function(){function l(u,f,h){h===void 0&&(h={}),this.attrName=u,this.keyName=f;var E=a.Scope.TYPE&a.Scope.ATTRIBUTE;h.scope!=null?this.scope=h.scope&a.Scope.LEVEL|E:this.scope=a.Scope.ATTRIBUTE,h.whitelist!=null&&(this.whitelist=h.whitelist)}return l.keys=function(u){return[].map.call(u.attributes,function(f){return f.name})},l.prototype.add=function(u,f){return this.canAdd(u,f)?(u.setAttribute(this.keyName,f),!0):!1},l.prototype.canAdd=function(u,f){var h=a.query(u,a.Scope.BLOT&(this.scope|a.Scope.TYPE));return h==null?!1:this.whitelist==null?!0:typeof f=="string"?this.whitelist.indexOf(f.replace(/["']/g,""))>-1:this.whitelist.indexOf(f)>-1},l.prototype.remove=function(u){u.removeAttribute(this.keyName)},l.prototype.value=function(u){var f=u.getAttribute(this.keyName);return this.canAdd(u,f)&&f?f:""},l}();n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Code=void 0;var a=function(){function P(O,x){var A=[],L=!0,I=!1,U=void 0;try{for(var $=O[Symbol.iterator](),Z;!(L=(Z=$.next()).done)&&(A.push(Z.value),!(x&&A.length===x));L=!0);}catch(q){I=!0,U=q}finally{try{!L&&$.return&&$.return()}finally{if(I)throw U}}return A}return function(O,x){if(Array.isArray(O))return O;if(Symbol.iterator in Object(O))return P(O,x);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function P(O,x){for(var A=0;A<x.length;A++){var L=x[A];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(O,L.key,L)}}return function(O,x,A){return x&&P(O.prototype,x),A&&P(O,A),O}}(),l=function P(O,x,A){O===null&&(O=Function.prototype);var L=Object.getOwnPropertyDescriptor(O,x);if(L===void 0){var I=Object.getPrototypeOf(O);return I===null?void 0:P(I,x,A)}else{if("value"in L)return L.value;var U=L.get;return U===void 0?void 0:U.call(A)}},u=i(2),f=m(u),h=i(0),E=m(h),w=i(4),p=m(w),S=i(6),b=m(S),y=i(7),v=m(y);function m(P){return P&&P.__esModule?P:{default:P}}function d(P,O){if(!(P instanceof O))throw new TypeError("Cannot call a class as a function")}function g(P,O){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:P}function _(P,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);P.prototype=Object.create(O&&O.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(P,O):P.__proto__=O)}var k=function(P){_(O,P);function O(){return d(this,O),g(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return O}(b.default);k.blotName="code",k.tagName="CODE";var C=function(P){_(O,P);function O(){return d(this,O),g(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return o(O,[{key:"delta",value:function(){var A=this,L=this.domNode.textContent;return L.endsWith(`
119
+ `)&&(L=L.slice(0,-1)),L.split(`
120
+ `).reduce(function(I,U){return I.insert(U).insert(`
121
+ `,A.formats())},new f.default)}},{key:"format",value:function(A,L){if(!(A===this.statics.blotName&&L)){var I=this.descendant(v.default,this.length()-1),U=a(I,1),$=U[0];$!=null&&$.deleteAt($.length()-1,1),l(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"format",this).call(this,A,L)}}},{key:"formatAt",value:function(A,L,I,U){if(L!==0&&!(E.default.query(I,E.default.Scope.BLOCK)==null||I===this.statics.blotName&&U===this.statics.formats(this.domNode))){var $=this.newlineIndex(A);if(!($<0||$>=A+L)){var Z=this.newlineIndex(A,!0)+1,q=$-Z+1,z=this.isolate(Z,q),W=z.next;z.format(I,U),W instanceof O&&W.formatAt(0,A-Z+L-q,I,U)}}}},{key:"insertAt",value:function(A,L,I){if(I==null){var U=this.descendant(v.default,A),$=a(U,2),Z=$[0],q=$[1];Z.insertAt(q,L)}}},{key:"length",value:function(){var A=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
122
+ `)?A:A+1}},{key:"newlineIndex",value:function(A){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(L)return this.domNode.textContent.slice(0,A).lastIndexOf(`
123
+ `);var I=this.domNode.textContent.slice(A).indexOf(`
124
+ `);return I>-1?A+I:-1}},{key:"optimize",value:function(A){this.domNode.textContent.endsWith(`
125
+ `)||this.appendChild(E.default.create("text",`
126
+ `)),l(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"optimize",this).call(this,A);var L=this.next;L!=null&&L.prev===this&&L.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===L.statics.formats(L.domNode)&&(L.optimize(A),L.moveChildren(this),L.remove())}},{key:"replace",value:function(A){l(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"replace",this).call(this,A),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(L){var I=E.default.find(L);I==null?L.parentNode.removeChild(L):I instanceof E.default.Embed?I.remove():I.unwrap()})}}],[{key:"create",value:function(A){var L=l(O.__proto__||Object.getPrototypeOf(O),"create",this).call(this,A);return L.setAttribute("spellcheck",!1),L}},{key:"formats",value:function(){return!0}}]),O}(p.default);C.blotName="code-block",C.tagName="PRE",C.TAB=" ",n.Code=k,n.default=C},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(W){return typeof W}:function(W){return W&&typeof Symbol=="function"&&W.constructor===Symbol&&W!==Symbol.prototype?"symbol":typeof W},o=function(){function W(R,M){var F=[],D=!0,H=!1,K=void 0;try{for(var G=R[Symbol.iterator](),B;!(D=(B=G.next()).done)&&(F.push(B.value),!(M&&F.length===M));D=!0);}catch(Y){H=!0,K=Y}finally{try{!D&&G.return&&G.return()}finally{if(H)throw K}}return F}return function(R,M){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return W(R,M);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function W(R,M){for(var F=0;F<M.length;F++){var D=M[F];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(R,D.key,D)}}return function(R,M,F){return M&&W(R.prototype,M),F&&W(R,F),R}}(),u=i(2),f=L(u),h=i(20),E=L(h),w=i(0),p=L(w),S=i(13),b=L(S),y=i(24),v=L(y),m=i(4),d=L(m),g=i(16),_=L(g),k=i(21),C=L(k),P=i(11),O=L(P),x=i(3),A=L(x);function L(W){return W&&W.__esModule?W:{default:W}}function I(W,R,M){return R in W?Object.defineProperty(W,R,{value:M,enumerable:!0,configurable:!0,writable:!0}):W[R]=M,W}function U(W,R){if(!(W instanceof R))throw new TypeError("Cannot call a class as a function")}var $=/^[ -~]*$/,Z=function(){function W(R){U(this,W),this.scroll=R,this.delta=this.getDelta()}return l(W,[{key:"applyDelta",value:function(M){var F=this,D=!1;this.scroll.update();var H=this.scroll.length();return this.scroll.batchStart(),M=z(M),M.reduce(function(K,G){var B=G.retain||G.delete||G.insert.length||1,Y=G.attributes||{};if(G.insert!=null){if(typeof G.insert=="string"){var X=G.insert;X.endsWith(`
127
+ `)&&D&&(D=!1,X=X.slice(0,-1)),K>=H&&!X.endsWith(`
128
+ `)&&(D=!0),F.scroll.insertAt(K,X);var Q=F.scroll.line(K),te=o(Q,2),ee=te[0],ie=te[1],ne=(0,A.default)({},(0,m.bubbleFormats)(ee));if(ee instanceof d.default){var le=ee.descendant(p.default.Leaf,ie),Te=o(le,1),Ie=Te[0];ne=(0,A.default)(ne,(0,m.bubbleFormats)(Ie))}Y=E.default.attributes.diff(ne,Y)||{}}else if(a(G.insert)==="object"){var se=Object.keys(G.insert)[0];if(se==null)return K;F.scroll.insertAt(K,se,G.insert[se])}H+=B}return Object.keys(Y).forEach(function(de){F.scroll.formatAt(K,B,de,Y[de])}),K+B},0),M.reduce(function(K,G){return typeof G.delete=="number"?(F.scroll.deleteAt(K,G.delete),K):K+(G.retain||G.insert.length||1)},0),this.scroll.batchEnd(),this.update(M)}},{key:"deleteText",value:function(M,F){return this.scroll.deleteAt(M,F),this.update(new f.default().retain(M).delete(F))}},{key:"formatLine",value:function(M,F){var D=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(H).forEach(function(K){if(!(D.scroll.whitelist!=null&&!D.scroll.whitelist[K])){var G=D.scroll.lines(M,Math.max(F,1)),B=F;G.forEach(function(Y){var X=Y.length();if(!(Y instanceof b.default))Y.format(K,H[K]);else{var Q=M-Y.offset(D.scroll),te=Y.newlineIndex(Q+B)-Q+1;Y.formatAt(Q,te,K,H[K])}B-=X})}}),this.scroll.optimize(),this.update(new f.default().retain(M).retain(F,(0,C.default)(H)))}},{key:"formatText",value:function(M,F){var D=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(H).forEach(function(K){D.scroll.formatAt(M,F,K,H[K])}),this.update(new f.default().retain(M).retain(F,(0,C.default)(H)))}},{key:"getContents",value:function(M,F){return this.delta.slice(M,M+F)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(M,F){return M.concat(F.delta())},new f.default)}},{key:"getFormat",value:function(M){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,D=[],H=[];F===0?this.scroll.path(M).forEach(function(G){var B=o(G,1),Y=B[0];Y instanceof d.default?D.push(Y):Y instanceof p.default.Leaf&&H.push(Y)}):(D=this.scroll.lines(M,F),H=this.scroll.descendants(p.default.Leaf,M,F));var K=[D,H].map(function(G){if(G.length===0)return{};for(var B=(0,m.bubbleFormats)(G.shift());Object.keys(B).length>0;){var Y=G.shift();if(Y==null)return B;B=q((0,m.bubbleFormats)(Y),B)}return B});return A.default.apply(A.default,K)}},{key:"getText",value:function(M,F){return this.getContents(M,F).filter(function(D){return typeof D.insert=="string"}).map(function(D){return D.insert}).join("")}},{key:"insertEmbed",value:function(M,F,D){return this.scroll.insertAt(M,F,D),this.update(new f.default().retain(M).insert(I({},F,D)))}},{key:"insertText",value:function(M,F){var D=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return F=F.replace(/\r\n/g,`
129
+ `).replace(/\r/g,`
130
+ `),this.scroll.insertAt(M,F),Object.keys(H).forEach(function(K){D.scroll.formatAt(M,F.length,K,H[K])}),this.update(new f.default().retain(M).insert(F,(0,C.default)(H)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var M=this.scroll.children.head;return M.statics.blotName!==d.default.blotName||M.children.length>1?!1:M.children.head instanceof _.default}},{key:"removeFormat",value:function(M,F){var D=this.getText(M,F),H=this.scroll.line(M+F),K=o(H,2),G=K[0],B=K[1],Y=0,X=new f.default;G!=null&&(G instanceof b.default?Y=G.newlineIndex(B)-B+1:Y=G.length()-B,X=G.delta().slice(B,B+Y-1).insert(`
131
+ `));var Q=this.getContents(M,F+Y),te=Q.diff(new f.default().insert(D).concat(X)),ee=new f.default().retain(M).concat(te);return this.applyDelta(ee)}},{key:"update",value:function(M){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,H=this.delta;if(F.length===1&&F[0].type==="characterData"&&F[0].target.data.match($)&&p.default.find(F[0].target)){var K=p.default.find(F[0].target),G=(0,m.bubbleFormats)(K),B=K.offset(this.scroll),Y=F[0].oldValue.replace(v.default.CONTENTS,""),X=new f.default().insert(Y),Q=new f.default().insert(K.value()),te=new f.default().retain(B).concat(X.diff(Q,D));M=te.reduce(function(ee,ie){return ie.insert?ee.insert(ie.insert,G):ee.push(ie)},new f.default),this.delta=H.compose(M)}else this.delta=this.getDelta(),(!M||!(0,O.default)(H.compose(M),this.delta))&&(M=H.diff(this.delta,D));return M}}]),W}();function q(W,R){return Object.keys(R).reduce(function(M,F){return W[F]==null||(R[F]===W[F]?M[F]=R[F]:Array.isArray(R[F])?R[F].indexOf(W[F])<0&&(M[F]=R[F].concat([W[F]])):M[F]=[R[F],W[F]]),M},{})}function z(W){return W.reduce(function(R,M){if(M.insert===1){var F=(0,C.default)(M.attributes);return delete F.image,R.insert({image:M.attributes.image},F)}if(M.attributes!=null&&(M.attributes.list===!0||M.attributes.bullet===!0)&&(M=(0,C.default)(M),M.attributes.list?M.attributes.list="ordered":(M.attributes.list="bullet",delete M.attributes.bullet)),typeof M.insert=="string"){var D=M.insert.replace(/\r\n/g,`
132
+ `).replace(/\r/g,`
133
+ `);return R.insert(D,M.attributes)}return R.push(M)},new f.default)}n.default=Z},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var a=function(){function P(O,x){var A=[],L=!0,I=!1,U=void 0;try{for(var $=O[Symbol.iterator](),Z;!(L=(Z=$.next()).done)&&(A.push(Z.value),!(x&&A.length===x));L=!0);}catch(q){I=!0,U=q}finally{try{!L&&$.return&&$.return()}finally{if(I)throw U}}return A}return function(O,x){if(Array.isArray(O))return O;if(Symbol.iterator in Object(O))return P(O,x);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function P(O,x){for(var A=0;A<x.length;A++){var L=x[A];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(O,L.key,L)}}return function(O,x,A){return x&&P(O.prototype,x),A&&P(O,A),O}}(),l=i(0),u=v(l),f=i(21),h=v(f),E=i(11),w=v(E),p=i(8),S=v(p),b=i(10),y=v(b);function v(P){return P&&P.__esModule?P:{default:P}}function m(P){if(Array.isArray(P)){for(var O=0,x=Array(P.length);O<P.length;O++)x[O]=P[O];return x}else return Array.from(P)}function d(P,O){if(!(P instanceof O))throw new TypeError("Cannot call a class as a function")}var g=(0,y.default)("quill:selection"),_=function P(O){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;d(this,P),this.index=O,this.length=x},k=function(){function P(O,x){var A=this;d(this,P),this.emitter=x,this.scroll=O,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=u.default.create("cursor",this),this.lastRange=this.savedRange=new _(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){A.mouseDown||setTimeout(A.update.bind(A,S.default.sources.USER),1)}),this.emitter.on(S.default.events.EDITOR_CHANGE,function(L,I){L===S.default.events.TEXT_CHANGE&&I.length()>0&&A.update(S.default.sources.SILENT)}),this.emitter.on(S.default.events.SCROLL_BEFORE_UPDATE,function(){if(A.hasFocus()){var L=A.getNativeRange();L!=null&&L.start.node!==A.cursor.textNode&&A.emitter.once(S.default.events.SCROLL_UPDATE,function(){try{A.setNativeRange(L.start.node,L.start.offset,L.end.node,L.end.offset)}catch{}})}}),this.emitter.on(S.default.events.SCROLL_OPTIMIZE,function(L,I){if(I.range){var U=I.range,$=U.startNode,Z=U.startOffset,q=U.endNode,z=U.endOffset;A.setNativeRange($,Z,q,z)}}),this.update(S.default.sources.SILENT)}return o(P,[{key:"handleComposition",value:function(){var x=this;this.root.addEventListener("compositionstart",function(){x.composing=!0}),this.root.addEventListener("compositionend",function(){if(x.composing=!1,x.cursor.parent){var A=x.cursor.restore();if(!A)return;setTimeout(function(){x.setNativeRange(A.startNode,A.startOffset,A.endNode,A.endOffset)},1)}})}},{key:"handleDragging",value:function(){var x=this;this.emitter.listenDOM("mousedown",document.body,function(){x.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){x.mouseDown=!1,x.update(S.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(x,A){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[x])){this.scroll.update();var L=this.getNativeRange();if(!(L==null||!L.native.collapsed||u.default.query(x,u.default.Scope.BLOCK))){if(L.start.node!==this.cursor.textNode){var I=u.default.find(L.start.node,!1);if(I==null)return;if(I instanceof u.default.Leaf){var U=I.split(L.start.offset);I.parent.insertBefore(this.cursor,U)}else I.insertBefore(this.cursor,L.start.node);this.cursor.attach()}this.cursor.format(x,A),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(x){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,L=this.scroll.length();x=Math.min(x,L-1),A=Math.min(x+A,L-1)-x;var I=void 0,U=this.scroll.leaf(x),$=a(U,2),Z=$[0],q=$[1];if(Z==null)return null;var z=Z.position(q,!0),W=a(z,2);I=W[0],q=W[1];var R=document.createRange();if(A>0){R.setStart(I,q);var M=this.scroll.leaf(x+A),F=a(M,2);if(Z=F[0],q=F[1],Z==null)return null;var D=Z.position(q,!0),H=a(D,2);return I=H[0],q=H[1],R.setEnd(I,q),R.getBoundingClientRect()}else{var K="left",G=void 0;return I instanceof Text?(q<I.data.length?(R.setStart(I,q),R.setEnd(I,q+1)):(R.setStart(I,q-1),R.setEnd(I,q),K="right"),G=R.getBoundingClientRect()):(G=Z.domNode.getBoundingClientRect(),q>0&&(K="right")),{bottom:G.top+G.height,height:G.height,left:G[K],right:G[K],top:G.top,width:0}}}},{key:"getNativeRange",value:function(){var x=document.getSelection();if(x==null||x.rangeCount<=0)return null;var A=x.getRangeAt(0);if(A==null)return null;var L=this.normalizeNative(A);return g.info("getNativeRange",L),L}},{key:"getRange",value:function(){var x=this.getNativeRange();if(x==null)return[null,null];var A=this.normalizedToRange(x);return[A,x]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(x){var A=this,L=[[x.start.node,x.start.offset]];x.native.collapsed||L.push([x.end.node,x.end.offset]);var I=L.map(function(Z){var q=a(Z,2),z=q[0],W=q[1],R=u.default.find(z,!0),M=R.offset(A.scroll);return W===0?M:R instanceof u.default.Container?M+R.length():M+R.index(z,W)}),U=Math.min(Math.max.apply(Math,m(I)),this.scroll.length()-1),$=Math.min.apply(Math,[U].concat(m(I)));return new _($,U-$)}},{key:"normalizeNative",value:function(x){if(!C(this.root,x.startContainer)||!x.collapsed&&!C(this.root,x.endContainer))return null;var A={start:{node:x.startContainer,offset:x.startOffset},end:{node:x.endContainer,offset:x.endOffset},native:x};return[A.start,A.end].forEach(function(L){for(var I=L.node,U=L.offset;!(I instanceof Text)&&I.childNodes.length>0;)if(I.childNodes.length>U)I=I.childNodes[U],U=0;else if(I.childNodes.length===U)I=I.lastChild,U=I instanceof Text?I.data.length:I.childNodes.length+1;else break;L.node=I,L.offset=U}),A}},{key:"rangeToNative",value:function(x){var A=this,L=x.collapsed?[x.index]:[x.index,x.index+x.length],I=[],U=this.scroll.length();return L.forEach(function($,Z){$=Math.min(U-1,$);var q=void 0,z=A.scroll.leaf($),W=a(z,2),R=W[0],M=W[1],F=R.position(M,Z!==0),D=a(F,2);q=D[0],M=D[1],I.push(q,M)}),I.length<2&&(I=I.concat(I)),I}},{key:"scrollIntoView",value:function(x){var A=this.lastRange;if(A!=null){var L=this.getBounds(A.index,A.length);if(L!=null){var I=this.scroll.length()-1,U=this.scroll.line(Math.min(A.index,I)),$=a(U,1),Z=$[0],q=Z;if(A.length>0){var z=this.scroll.line(Math.min(A.index+A.length,I)),W=a(z,1);q=W[0]}if(!(Z==null||q==null)){var R=x.getBoundingClientRect();L.top<R.top?x.scrollTop-=R.top-L.top:L.bottom>R.bottom&&(x.scrollTop+=L.bottom-R.bottom)}}}}},{key:"setNativeRange",value:function(x,A){var L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:x,I=arguments.length>3&&arguments[3]!==void 0?arguments[3]:A,U=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(g.info("setNativeRange",x,A,L,I),!(x!=null&&(this.root.parentNode==null||x.parentNode==null||L.parentNode==null))){var $=document.getSelection();if($!=null)if(x!=null){this.hasFocus()||this.root.focus();var Z=(this.getNativeRange()||{}).native;if(Z==null||U||x!==Z.startContainer||A!==Z.startOffset||L!==Z.endContainer||I!==Z.endOffset){x.tagName=="BR"&&(A=[].indexOf.call(x.parentNode.childNodes,x),x=x.parentNode),L.tagName=="BR"&&(I=[].indexOf.call(L.parentNode.childNodes,L),L=L.parentNode);var q=document.createRange();q.setStart(x,A),q.setEnd(L,I),$.removeAllRanges(),$.addRange(q)}}else $.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(x){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:S.default.sources.API;if(typeof A=="string"&&(L=A,A=!1),g.info("setRange",x),x!=null){var I=this.rangeToNative(x);this.setNativeRange.apply(this,m(I).concat([A]))}else this.setNativeRange(null);this.update(L)}},{key:"update",value:function(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:S.default.sources.USER,A=this.lastRange,L=this.getRange(),I=a(L,2),U=I[0],$=I[1];if(this.lastRange=U,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,w.default)(A,this.lastRange)){var Z;!this.composing&&$!=null&&$.native.collapsed&&$.start.node!==this.cursor.textNode&&this.cursor.restore();var q=[S.default.events.SELECTION_CHANGE,(0,h.default)(this.lastRange),(0,h.default)(A),x];if((Z=this.emitter).emit.apply(Z,[S.default.events.EDITOR_CHANGE].concat(q)),x!==S.default.sources.SILENT){var z;(z=this.emitter).emit.apply(z,q)}}}}]),P}();function C(P,O){try{O.parentNode}catch{return!1}return O instanceof Text&&(O=O.parentNode),P.contains(O)}n.Range=_,n.default=k},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function S(b,y){for(var v=0;v<y.length;v++){var m=y[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(b,m.key,m)}}return function(b,y,v){return y&&S(b.prototype,y),v&&S(b,v),b}}(),o=function S(b,y,v){b===null&&(b=Function.prototype);var m=Object.getOwnPropertyDescriptor(b,y);if(m===void 0){var d=Object.getPrototypeOf(b);return d===null?void 0:S(d,y,v)}else{if("value"in m)return m.value;var g=m.get;return g===void 0?void 0:g.call(v)}},l=i(0),u=f(l);function f(S){return S&&S.__esModule?S:{default:S}}function h(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function E(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function w(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var p=function(S){w(b,S);function b(){return h(this,b),E(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"insertInto",value:function(v,m){v.children.length===0?o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"insertInto",this).call(this,v,m):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),b}(u.default.Embed);p.blotName="break",p.tagName="BR",n.default=p},function(r,n,i){var a=this&&this.__extends||function(){var E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,p){w.__proto__=p}||function(w,p){for(var S in p)p.hasOwnProperty(S)&&(w[S]=p[S])};return function(w,p){E(w,p);function S(){this.constructor=w}w.prototype=p===null?Object.create(p):(S.prototype=p.prototype,new S)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(44),l=i(30),u=i(1),f=function(E){a(w,E);function w(p){var S=E.call(this,p)||this;return S.build(),S}return w.prototype.appendChild=function(p){this.insertBefore(p)},w.prototype.attach=function(){E.prototype.attach.call(this),this.children.forEach(function(p){p.attach()})},w.prototype.build=function(){var p=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(S){try{var b=h(S);p.insertBefore(b,p.children.head||void 0)}catch(y){if(y instanceof u.ParchmentError)return;throw y}})},w.prototype.deleteAt=function(p,S){if(p===0&&S===this.length())return this.remove();this.children.forEachAt(p,S,function(b,y,v){b.deleteAt(y,v)})},w.prototype.descendant=function(p,S){var b=this.children.find(S),y=b[0],v=b[1];return p.blotName==null&&p(y)||p.blotName!=null&&y instanceof p?[y,v]:y instanceof w?y.descendant(p,v):[null,-1]},w.prototype.descendants=function(p,S,b){S===void 0&&(S=0),b===void 0&&(b=Number.MAX_VALUE);var y=[],v=b;return this.children.forEachAt(S,b,function(m,d,g){(p.blotName==null&&p(m)||p.blotName!=null&&m instanceof p)&&y.push(m),m instanceof w&&(y=y.concat(m.descendants(p,d,v))),v-=g}),y},w.prototype.detach=function(){this.children.forEach(function(p){p.detach()}),E.prototype.detach.call(this)},w.prototype.formatAt=function(p,S,b,y){this.children.forEachAt(p,S,function(v,m,d){v.formatAt(m,d,b,y)})},w.prototype.insertAt=function(p,S,b){var y=this.children.find(p),v=y[0],m=y[1];if(v)v.insertAt(m,S,b);else{var d=b==null?u.create("text",S):u.create(S,b);this.appendChild(d)}},w.prototype.insertBefore=function(p,S){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(b){return p instanceof b}))throw new u.ParchmentError("Cannot insert "+p.statics.blotName+" into "+this.statics.blotName);p.insertInto(this,S)},w.prototype.length=function(){return this.children.reduce(function(p,S){return p+S.length()},0)},w.prototype.moveChildren=function(p,S){this.children.forEach(function(b){p.insertBefore(b,S)})},w.prototype.optimize=function(p){if(E.prototype.optimize.call(this,p),this.children.length===0)if(this.statics.defaultChild!=null){var S=u.create(this.statics.defaultChild);this.appendChild(S),S.optimize(p)}else this.remove()},w.prototype.path=function(p,S){S===void 0&&(S=!1);var b=this.children.find(p,S),y=b[0],v=b[1],m=[[this,p]];return y instanceof w?m.concat(y.path(v,S)):(y!=null&&m.push([y,v]),m)},w.prototype.removeChild=function(p){this.children.remove(p)},w.prototype.replace=function(p){p instanceof w&&p.moveChildren(this),E.prototype.replace.call(this,p)},w.prototype.split=function(p,S){if(S===void 0&&(S=!1),!S){if(p===0)return this;if(p===this.length())return this.next}var b=this.clone();return this.parent.insertBefore(b,this.next),this.children.forEachAt(p,this.length(),function(y,v,m){y=y.split(v,S),b.appendChild(y)}),b},w.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},w.prototype.update=function(p,S){var b=this,y=[],v=[];p.forEach(function(m){m.target===b.domNode&&m.type==="childList"&&(y.push.apply(y,m.addedNodes),v.push.apply(v,m.removedNodes))}),v.forEach(function(m){if(!(m.parentNode!=null&&m.tagName!=="IFRAME"&&document.body.compareDocumentPosition(m)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var d=u.find(m);d!=null&&(d.domNode.parentNode==null||d.domNode.parentNode===b.domNode)&&d.detach()}}),y.filter(function(m){return m.parentNode==b.domNode}).sort(function(m,d){return m===d?0:m.compareDocumentPosition(d)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(m){var d=null;m.nextSibling!=null&&(d=u.find(m.nextSibling));var g=h(m);(g.next!=d||g.next==null)&&(g.parent!=null&&g.parent.removeChild(b),b.insertBefore(g,d||void 0))})},w}(l.default);function h(E){var w=u.find(E);if(w==null)try{w=u.create(E)}catch{w=u.create(u.Scope.INLINE),[].slice.call(E.childNodes).forEach(function(S){w.domNode.appendChild(S)}),E.parentNode&&E.parentNode.replaceChild(w.domNode,E),w.attach()}return w}n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,p){w.__proto__=p}||function(w,p){for(var S in p)p.hasOwnProperty(S)&&(w[S]=p[S])};return function(w,p){E(w,p);function S(){this.constructor=w}w.prototype=p===null?Object.create(p):(S.prototype=p.prototype,new S)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12),l=i(31),u=i(17),f=i(1),h=function(E){a(w,E);function w(p){var S=E.call(this,p)||this;return S.attributes=new l.default(S.domNode),S}return w.formats=function(p){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return p.tagName.toLowerCase()},w.prototype.format=function(p,S){var b=f.query(p);b instanceof o.default?this.attributes.attribute(b,S):S&&b!=null&&(p!==this.statics.blotName||this.formats()[p]!==S)&&this.replaceWith(p,S)},w.prototype.formats=function(){var p=this.attributes.values(),S=this.statics.formats(this.domNode);return S!=null&&(p[this.statics.blotName]=S),p},w.prototype.replaceWith=function(p,S){var b=E.prototype.replaceWith.call(this,p,S);return this.attributes.copy(b),b},w.prototype.update=function(p,S){var b=this;E.prototype.update.call(this,p,S),p.some(function(y){return y.target===b.domNode&&y.type==="attributes"})&&this.attributes.build()},w.prototype.wrap=function(p,S){var b=E.prototype.wrap.call(this,p,S);return b instanceof w&&b.statics.scope===this.statics.scope&&this.attributes.move(b),b},w}(u.default);n.default=h},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,E){h.__proto__=E}||function(h,E){for(var w in E)E.hasOwnProperty(w)&&(h[w]=E[w])};return function(h,E){f(h,E);function w(){this.constructor=h}h.prototype=E===null?Object.create(E):(w.prototype=E.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(30),l=i(1),u=function(f){a(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.value=function(E){return!0},h.prototype.index=function(E,w){return this.domNode===E||this.domNode.compareDocumentPosition(E)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(w,1):-1},h.prototype.position=function(E,w){var p=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return E>0&&(p+=1),[this.parent.domNode,p]},h.prototype.value=function(){var E;return E={},E[this.statics.blotName]=this.statics.value(this.domNode)||!0,E},h.scope=l.Scope.INLINE_BLOT,h}(o.default);n.default=u},function(r,n,i){var a=i(11),o=i(3),l={attributes:{compose:function(f,h,E){typeof f!="object"&&(f={}),typeof h!="object"&&(h={});var w=o(!0,{},h);E||(w=Object.keys(w).reduce(function(S,b){return w[b]!=null&&(S[b]=w[b]),S},{}));for(var p in f)f[p]!==void 0&&h[p]===void 0&&(w[p]=f[p]);return Object.keys(w).length>0?w:void 0},diff:function(f,h){typeof f!="object"&&(f={}),typeof h!="object"&&(h={});var E=Object.keys(f).concat(Object.keys(h)).reduce(function(w,p){return a(f[p],h[p])||(w[p]=h[p]===void 0?null:h[p]),w},{});return Object.keys(E).length>0?E:void 0},transform:function(f,h,E){if(typeof f!="object")return h;if(typeof h=="object"){if(!E)return h;var w=Object.keys(h).reduce(function(p,S){return f[S]===void 0&&(p[S]=h[S]),p},{});return Object.keys(w).length>0?w:void 0}}},iterator:function(f){return new u(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 u(f){this.ops=f,this.index=0,this.offset=0}u.prototype.hasNext=function(){return this.peekLength()<1/0},u.prototype.next=function(f){f||(f=1/0);var h=this.ops[this.index];if(h){var E=this.offset,w=l.length(h);if(f>=w-E?(f=w-E,this.index+=1,this.offset=0):this.offset+=f,typeof h.delete=="number")return{delete:f};var p={};return h.attributes&&(p.attributes=h.attributes),typeof h.retain=="number"?p.retain=f:typeof h.insert=="string"?p.insert=h.insert.substr(E,f):p.insert=h.insert,p}else return{retain:1/0}},u.prototype.peek=function(){return this.ops[this.index]},u.prototype.peekLength=function(){return this.ops[this.index]?l.length(this.ops[this.index])-this.offset:1/0},u.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"},u.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var f=this.offset,h=this.index,E=this.next(),w=this.ops.slice(this.index);return this.offset=f,this.index=h,[E].concat(w)}else return[]},r.exports=l},function(r,n){var i=function(){function a(b,y){return y!=null&&b instanceof y}var o;try{o=Map}catch{o=function(){}}var l;try{l=Set}catch{l=function(){}}var u;try{u=Promise}catch{u=function(){}}function f(b,y,v,m,d){typeof y=="object"&&(v=y.depth,m=y.prototype,d=y.includeNonEnumerable,y=y.circular);var g=[],_=[],k=typeof Buffer<"u";typeof y>"u"&&(y=!0),typeof v>"u"&&(v=1/0);function C(P,O){if(P===null)return null;if(O===0)return P;var x,A;if(typeof P!="object")return P;if(a(P,o))x=new o;else if(a(P,l))x=new l;else if(a(P,u))x=new u(function(R,M){P.then(function(F){R(C(F,O-1))},function(F){M(C(F,O-1))})});else if(f.__isArray(P))x=[];else if(f.__isRegExp(P))x=new RegExp(P.source,S(P)),P.lastIndex&&(x.lastIndex=P.lastIndex);else if(f.__isDate(P))x=new Date(P.getTime());else{if(k&&Buffer.isBuffer(P))return Buffer.allocUnsafe?x=Buffer.allocUnsafe(P.length):x=new Buffer(P.length),P.copy(x),x;a(P,Error)?x=Object.create(P):typeof m>"u"?(A=Object.getPrototypeOf(P),x=Object.create(A)):(x=Object.create(m),A=m)}if(y){var L=g.indexOf(P);if(L!=-1)return _[L];g.push(P),_.push(x)}a(P,o)&&P.forEach(function(R,M){var F=C(M,O-1),D=C(R,O-1);x.set(F,D)}),a(P,l)&&P.forEach(function(R){var M=C(R,O-1);x.add(M)});for(var I in P){var U;A&&(U=Object.getOwnPropertyDescriptor(A,I)),!(U&&U.set==null)&&(x[I]=C(P[I],O-1))}if(Object.getOwnPropertySymbols)for(var $=Object.getOwnPropertySymbols(P),I=0;I<$.length;I++){var Z=$[I],q=Object.getOwnPropertyDescriptor(P,Z);q&&!q.enumerable&&!d||(x[Z]=C(P[Z],O-1),q.enumerable||Object.defineProperty(x,Z,{enumerable:!1}))}if(d)for(var z=Object.getOwnPropertyNames(P),I=0;I<z.length;I++){var W=z[I],q=Object.getOwnPropertyDescriptor(P,W);q&&q.enumerable||(x[W]=C(P[W],O-1),Object.defineProperty(x,W,{enumerable:!1}))}return x}return C(b,v)}f.clonePrototype=function(y){if(y===null)return null;var v=function(){};return v.prototype=y,new v};function h(b){return Object.prototype.toString.call(b)}f.__objToStr=h;function E(b){return typeof b=="object"&&h(b)==="[object Date]"}f.__isDate=E;function w(b){return typeof b=="object"&&h(b)==="[object Array]"}f.__isArray=w;function p(b){return typeof b=="object"&&h(b)==="[object RegExp]"}f.__isRegExp=p;function S(b){var y="";return b.global&&(y+="g"),b.ignoreCase&&(y+="i"),b.multiline&&(y+="m"),y}return f.__getRegExpFlags=S,f}();typeof r=="object"&&r.exports&&(r.exports=i)},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function x(A,L){var I=[],U=!0,$=!1,Z=void 0;try{for(var q=A[Symbol.iterator](),z;!(U=(z=q.next()).done)&&(I.push(z.value),!(L&&I.length===L));U=!0);}catch(W){$=!0,Z=W}finally{try{!U&&q.return&&q.return()}finally{if($)throw Z}}return I}return function(A,L){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return x(A,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function x(A,L){for(var I=0;I<L.length;I++){var U=L[I];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(A,U.key,U)}}return function(A,L,I){return L&&x(A.prototype,L),I&&x(A,I),A}}(),l=function x(A,L,I){A===null&&(A=Function.prototype);var U=Object.getOwnPropertyDescriptor(A,L);if(U===void 0){var $=Object.getPrototypeOf(A);return $===null?void 0:x($,L,I)}else{if("value"in U)return U.value;var Z=U.get;return Z===void 0?void 0:Z.call(I)}},u=i(0),f=g(u),h=i(8),E=g(h),w=i(4),p=g(w),S=i(16),b=g(S),y=i(13),v=g(y),m=i(25),d=g(m);function g(x){return x&&x.__esModule?x:{default:x}}function _(x,A){if(!(x instanceof A))throw new TypeError("Cannot call a class as a function")}function k(x,A){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:x}function C(x,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);x.prototype=Object.create(A&&A.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(x,A):x.__proto__=A)}function P(x){return x instanceof p.default||x instanceof w.BlockEmbed}var O=function(x){C(A,x);function A(L,I){_(this,A);var U=k(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,L));return U.emitter=I.emitter,Array.isArray(I.whitelist)&&(U.whitelist=I.whitelist.reduce(function($,Z){return $[Z]=!0,$},{})),U.domNode.addEventListener("DOMNodeInserted",function(){}),U.optimize(),U.enable(),U}return o(A,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(I,U){var $=this.line(I),Z=a($,2),q=Z[0],z=Z[1],W=this.line(I+U),R=a(W,1),M=R[0];if(l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"deleteAt",this).call(this,I,U),M!=null&&q!==M&&z>0){if(q instanceof w.BlockEmbed||M instanceof w.BlockEmbed){this.optimize();return}if(q instanceof v.default){var F=q.newlineIndex(q.length(),!0);if(F>-1&&(q=q.split(F+1),q===M)){this.optimize();return}}else if(M instanceof v.default){var D=M.newlineIndex(0);D>-1&&M.split(D+1)}var H=M.children.head instanceof b.default?null:M.children.head;q.moveChildren(M,H),q.remove()}this.optimize()}},{key:"enable",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",I)}},{key:"formatAt",value:function(I,U,$,Z){this.whitelist!=null&&!this.whitelist[$]||(l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"formatAt",this).call(this,I,U,$,Z),this.optimize())}},{key:"insertAt",value:function(I,U,$){if(!($!=null&&this.whitelist!=null&&!this.whitelist[U])){if(I>=this.length())if($==null||f.default.query(U,f.default.Scope.BLOCK)==null){var Z=f.default.create(this.statics.defaultChild);this.appendChild(Z),$==null&&U.endsWith(`
134
+ `)&&(U=U.slice(0,-1)),Z.insertAt(0,U,$)}else{var q=f.default.create(U,$);this.appendChild(q)}else l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertAt",this).call(this,I,U,$);this.optimize()}}},{key:"insertBefore",value:function(I,U){if(I.statics.scope===f.default.Scope.INLINE_BLOT){var $=f.default.create(this.statics.defaultChild);$.appendChild(I),I=$}l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertBefore",this).call(this,I,U)}},{key:"leaf",value:function(I){return this.path(I).pop()||[null,-1]}},{key:"line",value:function(I){return I===this.length()?this.line(I-1):this.descendant(P,I)}},{key:"lines",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,$=function Z(q,z,W){var R=[],M=W;return q.children.forEachAt(z,W,function(F,D,H){P(F)?R.push(F):F instanceof f.default.Container&&(R=R.concat(Z(F,D,M))),M-=H}),R};return $(this,I,U)}},{key:"optimize",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"optimize",this).call(this,I,U),I.length>0&&this.emitter.emit(E.default.events.SCROLL_OPTIMIZE,I,U))}},{key:"path",value:function(I){return l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"path",this).call(this,I).slice(1)}},{key:"update",value:function(I){if(this.batch!==!0){var U=E.default.sources.USER;typeof I=="string"&&(U=I),Array.isArray(I)||(I=this.observer.takeRecords()),I.length>0&&this.emitter.emit(E.default.events.SCROLL_BEFORE_UPDATE,U,I),l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"update",this).call(this,I.concat([])),I.length>0&&this.emitter.emit(E.default.events.SCROLL_UPDATE,U,I)}}}]),A}(f.default.Scroll);O.blotName="scroll",O.className="ql-editor",O.tagName="DIV",O.defaultChild="block",O.allowedChildren=[p.default,w.BlockEmbed,d.default],n.default=O},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SHORTKEY=n.default=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(G){return typeof G}:function(G){return G&&typeof Symbol=="function"&&G.constructor===Symbol&&G!==Symbol.prototype?"symbol":typeof G},o=function(){function G(B,Y){var X=[],Q=!0,te=!1,ee=void 0;try{for(var ie=B[Symbol.iterator](),ne;!(Q=(ne=ie.next()).done)&&(X.push(ne.value),!(Y&&X.length===Y));Q=!0);}catch(le){te=!0,ee=le}finally{try{!Q&&ie.return&&ie.return()}finally{if(te)throw ee}}return X}return function(B,Y){if(Array.isArray(B))return B;if(Symbol.iterator in Object(B))return G(B,Y);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function G(B,Y){for(var X=0;X<Y.length;X++){var Q=Y[X];Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q&&(Q.writable=!0),Object.defineProperty(B,Q.key,Q)}}return function(B,Y,X){return Y&&G(B.prototype,Y),X&&G(B,X),B}}(),u=i(21),f=x(u),h=i(11),E=x(h),w=i(3),p=x(w),S=i(2),b=x(S),y=i(20),v=x(y),m=i(0),d=x(m),g=i(5),_=x(g),k=i(10),C=x(k),P=i(9),O=x(P);function x(G){return G&&G.__esModule?G:{default:G}}function A(G,B,Y){return B in G?Object.defineProperty(G,B,{value:Y,enumerable:!0,configurable:!0,writable:!0}):G[B]=Y,G}function L(G,B){if(!(G instanceof B))throw new TypeError("Cannot call a class as a function")}function I(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 U(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 $=(0,C.default)("quill:keyboard"),Z=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",q=function(G){U(B,G),l(B,null,[{key:"match",value:function(X,Q){return Q=K(Q),["altKey","ctrlKey","metaKey","shiftKey"].some(function(te){return!!Q[te]!==X[te]&&Q[te]!==null})?!1:Q.key===(X.which||X.keyCode)}}]);function B(Y,X){L(this,B);var Q=I(this,(B.__proto__||Object.getPrototypeOf(B)).call(this,Y,X));return Q.bindings={},Object.keys(Q.options.bindings).forEach(function(te){te==="list autofill"&&Y.scroll.whitelist!=null&&!Y.scroll.whitelist.list||Q.options.bindings[te]&&Q.addBinding(Q.options.bindings[te])}),Q.addBinding({key:B.keys.ENTER,shiftKey:null},F),Q.addBinding({key:B.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(Q.addBinding({key:B.keys.BACKSPACE},{collapsed:!0},W),Q.addBinding({key:B.keys.DELETE},{collapsed:!0},R)):(Q.addBinding({key:B.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},W),Q.addBinding({key:B.keys.DELETE},{collapsed:!0,suffix:/^.?$/},R)),Q.addBinding({key:B.keys.BACKSPACE},{collapsed:!1},M),Q.addBinding({key:B.keys.DELETE},{collapsed:!1},M),Q.addBinding({key:B.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},W),Q.listen(),Q}return l(B,[{key:"addBinding",value:function(X){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ee=K(X);if(ee==null||ee.key==null)return $.warn("Attempted to add invalid keyboard binding",ee);typeof Q=="function"&&(Q={handler:Q}),typeof te=="function"&&(te={handler:te}),ee=(0,p.default)(ee,Q,te),this.bindings[ee.key]=this.bindings[ee.key]||[],this.bindings[ee.key].push(ee)}},{key:"listen",value:function(){var X=this;this.quill.root.addEventListener("keydown",function(Q){if(!Q.defaultPrevented){var te=Q.which||Q.keyCode,ee=(X.bindings[te]||[]).filter(function(Ee){return B.match(Q,Ee)});if(ee.length!==0){var ie=X.quill.getSelection();if(!(ie==null||!X.quill.hasFocus())){var ne=X.quill.getLine(ie.index),le=o(ne,2),Te=le[0],Ie=le[1],se=X.quill.getLeaf(ie.index),de=o(se,2),_e=de[0],ve=de[1],re=ie.length===0?[_e,ve]:X.quill.getLeaf(ie.index+ie.length),ce=o(re,2),be=ce[0],Oe=ce[1],$e=_e instanceof d.default.Text?_e.value().slice(0,ve):"",Qe=be instanceof d.default.Text?be.value().slice(Oe):"",Ye={collapsed:ie.length===0,empty:ie.length===0&&Te.length()<=1,format:X.quill.getFormat(ie),offset:Ie,prefix:$e,suffix:Qe},Le=ee.some(function(Ee){if(Ee.collapsed!=null&&Ee.collapsed!==Ye.collapsed||Ee.empty!=null&&Ee.empty!==Ye.empty||Ee.offset!=null&&Ee.offset!==Ye.offset)return!1;if(Array.isArray(Ee.format)){if(Ee.format.every(function(Re){return Ye.format[Re]==null}))return!1}else if(a(Ee.format)==="object"&&!Object.keys(Ee.format).every(function(Re){return Ee.format[Re]===!0?Ye.format[Re]!=null:Ee.format[Re]===!1?Ye.format[Re]==null:(0,E.default)(Ee.format[Re],Ye.format[Re])}))return!1;return Ee.prefix!=null&&!Ee.prefix.test(Ye.prefix)||Ee.suffix!=null&&!Ee.suffix.test(Ye.suffix)?!1:Ee.handler.call(X,ie,Ye)!==!0});Le&&Q.preventDefault()}}}})}}]),B}(O.default);q.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},q.DEFAULTS={bindings:{bold:H("bold"),italic:H("italic"),underline:H("underline"),indent:{key:q.keys.TAB,format:["blockquote","indent","list"],handler:function(B,Y){if(Y.collapsed&&Y.offset!==0)return!0;this.quill.format("indent","+1",_.default.sources.USER)}},outdent:{key:q.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(B,Y){if(Y.collapsed&&Y.offset!==0)return!0;this.quill.format("indent","-1",_.default.sources.USER)}},"outdent backspace":{key:q.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(B,Y){Y.format.indent!=null?this.quill.format("indent","-1",_.default.sources.USER):Y.format.list!=null&&this.quill.format("list",!1,_.default.sources.USER)}},"indent code-block":D(!0),"outdent code-block":D(!1),"remove tab":{key:q.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(B){this.quill.deleteText(B.index-1,1,_.default.sources.USER)}},tab:{key:q.keys.TAB,handler:function(B){this.quill.history.cutoff();var Y=new b.default().retain(B.index).delete(B.length).insert(" ");this.quill.updateContents(Y,_.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(B.index+1,_.default.sources.SILENT)}},"list empty enter":{key:q.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(B,Y){this.quill.format("list",!1,_.default.sources.USER),Y.format.indent&&this.quill.format("indent",!1,_.default.sources.USER)}},"checklist enter":{key:q.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(B){var Y=this.quill.getLine(B.index),X=o(Y,2),Q=X[0],te=X[1],ee=(0,p.default)({},Q.formats(),{list:"checked"}),ie=new b.default().retain(B.index).insert(`
135
+ `,ee).retain(Q.length()-te-1).retain(1,{list:"unchecked"});this.quill.updateContents(ie,_.default.sources.USER),this.quill.setSelection(B.index+1,_.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:q.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(B,Y){var X=this.quill.getLine(B.index),Q=o(X,2),te=Q[0],ee=Q[1],ie=new b.default().retain(B.index).insert(`
136
+ `,Y.format).retain(te.length()-ee-1).retain(1,{header:null});this.quill.updateContents(ie,_.default.sources.USER),this.quill.setSelection(B.index+1,_.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(B,Y){var X=Y.prefix.length,Q=this.quill.getLine(B.index),te=o(Q,2),ee=te[0],ie=te[1];if(ie>X)return!0;var ne=void 0;switch(Y.prefix.trim()){case"[]":case"[ ]":ne="unchecked";break;case"[x]":ne="checked";break;case"-":case"*":ne="bullet";break;default:ne="ordered"}this.quill.insertText(B.index," ",_.default.sources.USER),this.quill.history.cutoff();var le=new b.default().retain(B.index-ie).delete(X+1).retain(ee.length()-2-ie).retain(1,{list:ne});this.quill.updateContents(le,_.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(B.index-X,_.default.sources.SILENT)}},"code exit":{key:q.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(B){var Y=this.quill.getLine(B.index),X=o(Y,2),Q=X[0],te=X[1],ee=new b.default().retain(B.index+Q.length()-te-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(ee,_.default.sources.USER)}},"embed left":z(q.keys.LEFT,!1),"embed left shift":z(q.keys.LEFT,!0),"embed right":z(q.keys.RIGHT,!1),"embed right shift":z(q.keys.RIGHT,!0)}};function z(G,B){var Y,X=G===q.keys.LEFT?"prefix":"suffix";return Y={key:G,shiftKey:B,altKey:null},A(Y,X,/^$/),A(Y,"handler",function(te){var ee=te.index;G===q.keys.RIGHT&&(ee+=te.length+1);var ie=this.quill.getLeaf(ee),ne=o(ie,1),le=ne[0];return le instanceof d.default.Embed?(G===q.keys.LEFT?B?this.quill.setSelection(te.index-1,te.length+1,_.default.sources.USER):this.quill.setSelection(te.index-1,_.default.sources.USER):B?this.quill.setSelection(te.index,te.length+1,_.default.sources.USER):this.quill.setSelection(te.index+te.length+1,_.default.sources.USER),!1):!0}),Y}function W(G,B){if(!(G.index===0||this.quill.getLength()<=1)){var Y=this.quill.getLine(G.index),X=o(Y,1),Q=X[0],te={};if(B.offset===0){var ee=this.quill.getLine(G.index-1),ie=o(ee,1),ne=ie[0];if(ne!=null&&ne.length()>1){var le=Q.formats(),Te=this.quill.getFormat(G.index-1,1);te=v.default.attributes.diff(le,Te)||{}}}var Ie=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(B.prefix)?2:1;this.quill.deleteText(G.index-Ie,Ie,_.default.sources.USER),Object.keys(te).length>0&&this.quill.formatLine(G.index-Ie,Ie,te,_.default.sources.USER),this.quill.focus()}}function R(G,B){var Y=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(B.suffix)?2:1;if(!(G.index>=this.quill.getLength()-Y)){var X={},Q=0,te=this.quill.getLine(G.index),ee=o(te,1),ie=ee[0];if(B.offset>=ie.length()-1){var ne=this.quill.getLine(G.index+1),le=o(ne,1),Te=le[0];if(Te){var Ie=ie.formats(),se=this.quill.getFormat(G.index,1);X=v.default.attributes.diff(Ie,se)||{},Q=Te.length()}}this.quill.deleteText(G.index,Y,_.default.sources.USER),Object.keys(X).length>0&&this.quill.formatLine(G.index+Q-1,Y,X,_.default.sources.USER)}}function M(G){var B=this.quill.getLines(G),Y={};if(B.length>1){var X=B[0].formats(),Q=B[B.length-1].formats();Y=v.default.attributes.diff(Q,X)||{}}this.quill.deleteText(G,_.default.sources.USER),Object.keys(Y).length>0&&this.quill.formatLine(G.index,1,Y,_.default.sources.USER),this.quill.setSelection(G.index,_.default.sources.SILENT),this.quill.focus()}function F(G,B){var Y=this;G.length>0&&this.quill.scroll.deleteAt(G.index,G.length);var X=Object.keys(B.format).reduce(function(Q,te){return d.default.query(te,d.default.Scope.BLOCK)&&!Array.isArray(B.format[te])&&(Q[te]=B.format[te]),Q},{});this.quill.insertText(G.index,`
137
+ `,X,_.default.sources.USER),this.quill.setSelection(G.index+1,_.default.sources.SILENT),this.quill.focus(),Object.keys(B.format).forEach(function(Q){X[Q]==null&&(Array.isArray(B.format[Q])||Q!=="link"&&Y.quill.format(Q,B.format[Q],_.default.sources.USER))})}function D(G){return{key:q.keys.TAB,shiftKey:!G,format:{"code-block":!0},handler:function(Y){var X=d.default.query("code-block"),Q=Y.index,te=Y.length,ee=this.quill.scroll.descendant(X,Q),ie=o(ee,2),ne=ie[0],le=ie[1];if(ne!=null){var Te=this.quill.getIndex(ne),Ie=ne.newlineIndex(le,!0)+1,se=ne.newlineIndex(Te+le+te),de=ne.domNode.textContent.slice(Ie,se).split(`
138
+ `);le=0,de.forEach(function(_e,ve){G?(ne.insertAt(Ie+le,X.TAB),le+=X.TAB.length,ve===0?Q+=X.TAB.length:te+=X.TAB.length):_e.startsWith(X.TAB)&&(ne.deleteAt(Ie+le,X.TAB.length),le-=X.TAB.length,ve===0?Q-=X.TAB.length:te-=X.TAB.length),le+=_e.length+1}),this.quill.update(_.default.sources.USER),this.quill.setSelection(Q,te,_.default.sources.SILENT)}}}}function H(G){return{key:G[0].toUpperCase(),shortKey:!0,handler:function(Y,X){this.quill.format(G,!X.format[G],_.default.sources.USER)}}}function K(G){if(typeof G=="string"||typeof G=="number")return K({key:G});if((typeof G>"u"?"undefined":a(G))==="object"&&(G=(0,f.default)(G,!1)),typeof G.key=="string")if(q.keys[G.key.toUpperCase()]!=null)G.key=q.keys[G.key.toUpperCase()];else if(G.key.length===1)G.key=G.key.toUpperCase().charCodeAt(0);else return null;return G.shortKey&&(G[Z]=G.shortKey,delete G.shortKey),G}n.default=q,n.SHORTKEY=Z},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function v(m,d){var g=[],_=!0,k=!1,C=void 0;try{for(var P=m[Symbol.iterator](),O;!(_=(O=P.next()).done)&&(g.push(O.value),!(d&&g.length===d));_=!0);}catch(x){k=!0,C=x}finally{try{!_&&P.return&&P.return()}finally{if(k)throw C}}return g}return function(m,d){if(Array.isArray(m))return m;if(Symbol.iterator in Object(m))return v(m,d);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function v(m,d,g){m===null&&(m=Function.prototype);var _=Object.getOwnPropertyDescriptor(m,d);if(_===void 0){var k=Object.getPrototypeOf(m);return k===null?void 0:v(k,d,g)}else{if("value"in _)return _.value;var C=_.get;return C===void 0?void 0:C.call(g)}},l=function(){function v(m,d){for(var g=0;g<d.length;g++){var _=d[g];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(m,_.key,_)}}return function(m,d,g){return d&&v(m.prototype,d),g&&v(m,g),m}}(),u=i(0),f=w(u),h=i(7),E=w(h);function w(v){return v&&v.__esModule?v:{default:v}}function p(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function S(v,m){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:v}function b(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(v,m):v.__proto__=m)}var y=function(v){b(m,v),l(m,null,[{key:"value",value:function(){}}]);function m(d,g){p(this,m);var _=S(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,d));return _.selection=g,_.textNode=document.createTextNode(m.CONTENTS),_.domNode.appendChild(_.textNode),_._length=0,_}return l(m,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(g,_){if(this._length!==0)return o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"format",this).call(this,g,_);for(var k=this,C=0;k!=null&&k.statics.scope!==f.default.Scope.BLOCK_BLOT;)C+=k.offset(k.parent),k=k.parent;k!=null&&(this._length=m.CONTENTS.length,k.optimize(),k.formatAt(C,m.CONTENTS.length,g,_),this._length=0)}},{key:"index",value:function(g,_){return g===this.textNode?0:o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"index",this).call(this,g,_)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var g=this.textNode,_=this.selection.getNativeRange(),k=void 0,C=void 0,P=void 0;if(_!=null&&_.start.node===g&&_.end.node===g){var O=[g,_.start.offset,_.end.offset];k=O[0],C=O[1],P=O[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==m.CONTENTS){var x=this.textNode.data.split(m.CONTENTS).join("");this.next instanceof E.default?(k=this.next.domNode,this.next.insertAt(0,x),this.textNode.data=m.CONTENTS):(this.textNode.data=x,this.parent.insertBefore(f.default.create(this.textNode),this),this.textNode=document.createTextNode(m.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),C!=null){var A=[C,P].map(function(I){return Math.max(0,Math.min(k.data.length,I-1))}),L=a(A,2);return C=L[0],P=L[1],{startNode:k,startOffset:C,endNode:k,endOffset:P}}}}},{key:"update",value:function(g,_){var k=this;if(g.some(function(P){return P.type==="characterData"&&P.target===k.textNode})){var C=this.restore();C&&(_.range=C)}}},{key:"value",value:function(){return""}}]),m}(f.default.Embed);y.blotName="cursor",y.className="ql-cursor",y.tagName="span",y.CONTENTS="\uFEFF",n.default=y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=f(a),l=i(4),u=f(l);function f(S){return S&&S.__esModule?S:{default:S}}function h(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function E(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function w(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var p=function(S){w(b,S);function b(){return h(this,b),E(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return b}(o.default.Container);p.allowedChildren=[u.default,l.BlockEmbed,p],n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var a=function(){function y(v,m){for(var d=0;d<m.length;d++){var g=m[d];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(v,g.key,g)}}return function(v,m,d){return m&&y(v.prototype,m),d&&y(v,d),v}}(),o=function y(v,m,d){v===null&&(v=Function.prototype);var g=Object.getOwnPropertyDescriptor(v,m);if(g===void 0){var _=Object.getPrototypeOf(v);return _===null?void 0:y(_,m,d)}else{if("value"in g)return g.value;var k=g.get;return k===void 0?void 0:k.call(d)}},l=i(0),u=f(l);function f(y){return y&&y.__esModule?y:{default:y}}function h(y,v){if(!(y instanceof v))throw new TypeError("Cannot call a class as a function")}function E(y,v){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:y}function w(y,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);y.prototype=Object.create(v&&v.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(y,v):y.__proto__=v)}var p=function(y){w(v,y);function v(){return h(this,v),E(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return a(v,[{key:"value",value:function(d){var g=o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"value",this).call(this,d);return g.startsWith("rgb(")?(g=g.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+g.split(",").map(function(_){return("00"+parseInt(_).toString(16)).slice(-2)}).join("")):g}}]),v}(u.default.Attributor.Style),S=new u.default.Attributor.Class("color","ql-color",{scope:u.default.Scope.INLINE}),b=new p("color","color",{scope:u.default.Scope.INLINE});n.ColorAttributor=p,n.ColorClass=S,n.ColorStyle=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var a=function(){function b(y,v){for(var m=0;m<v.length;m++){var d=v[m];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(y,d.key,d)}}return function(y,v,m){return v&&b(y.prototype,v),m&&b(y,m),y}}(),o=function b(y,v,m){y===null&&(y=Function.prototype);var d=Object.getOwnPropertyDescriptor(y,v);if(d===void 0){var g=Object.getPrototypeOf(y);return g===null?void 0:b(g,v,m)}else{if("value"in d)return d.value;var _=d.get;return _===void 0?void 0:_.call(m)}},l=i(6),u=f(l);function f(b){return b&&b.__esModule?b:{default:b}}function h(b,y){if(!(b instanceof y))throw new TypeError("Cannot call a class as a function")}function E(b,y){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:b}function w(b,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);b.prototype=Object.create(y&&y.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(b,y):b.__proto__=y)}var p=function(b){w(y,b);function y(){return h(this,y),E(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,[{key:"format",value:function(m,d){if(m!==this.statics.blotName||!d)return o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"format",this).call(this,m,d);d=this.constructor.sanitize(d),this.domNode.setAttribute("href",d)}}],[{key:"create",value:function(m){var d=o(y.__proto__||Object.getPrototypeOf(y),"create",this).call(this,m);return m=this.sanitize(m),d.setAttribute("href",m),d.setAttribute("rel","noopener noreferrer"),d.setAttribute("target","_blank"),d}},{key:"formats",value:function(m){return m.getAttribute("href")}},{key:"sanitize",value:function(m){return S(m,this.PROTOCOL_WHITELIST)?m:this.SANITIZED_URL}}]),y}(u.default);p.blotName="link",p.tagName="A",p.SANITIZED_URL="about:blank",p.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function S(b,y){var v=document.createElement("a");v.href=b;var m=v.href.slice(0,v.href.indexOf(":"));return y.indexOf(m)>-1}n.default=p,n.sanitize=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(y){return typeof y}:function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y},o=function(){function y(v,m){for(var d=0;d<m.length;d++){var g=m[d];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(v,g.key,g)}}return function(v,m,d){return m&&y(v.prototype,m),d&&y(v,d),v}}(),l=i(23),u=E(l),f=i(107),h=E(f);function E(y){return y&&y.__esModule?y:{default:y}}function w(y,v){if(!(y instanceof v))throw new TypeError("Cannot call a class as a function")}var p=0;function S(y,v){y.setAttribute(v,y.getAttribute(v)!=="true")}var b=function(){function y(v){var m=this;w(this,y),this.select=v,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(){m.togglePicker()}),this.label.addEventListener("keydown",function(d){switch(d.keyCode){case u.default.keys.ENTER:m.togglePicker();break;case u.default.keys.ESCAPE:m.escape(),d.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return o(y,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),S(this.label,"aria-expanded"),S(this.options,"aria-hidden")}},{key:"buildItem",value:function(m){var d=this,g=document.createElement("span");return g.tabIndex="0",g.setAttribute("role","button"),g.classList.add("ql-picker-item"),m.hasAttribute("value")&&g.setAttribute("data-value",m.getAttribute("value")),m.textContent&&g.setAttribute("data-label",m.textContent),g.addEventListener("click",function(){d.selectItem(g,!0)}),g.addEventListener("keydown",function(_){switch(_.keyCode){case u.default.keys.ENTER:d.selectItem(g,!0),_.preventDefault();break;case u.default.keys.ESCAPE:d.escape(),_.preventDefault();break}}),g}},{key:"buildLabel",value:function(){var m=document.createElement("span");return m.classList.add("ql-picker-label"),m.innerHTML=h.default,m.tabIndex="0",m.setAttribute("role","button"),m.setAttribute("aria-expanded","false"),this.container.appendChild(m),m}},{key:"buildOptions",value:function(){var m=this,d=document.createElement("span");d.classList.add("ql-picker-options"),d.setAttribute("aria-hidden","true"),d.tabIndex="-1",d.id="ql-picker-options-"+p,p+=1,this.label.setAttribute("aria-controls",d.id),this.options=d,[].slice.call(this.select.options).forEach(function(g){var _=m.buildItem(g);d.appendChild(_),g.selected===!0&&m.selectItem(_)}),this.container.appendChild(d)}},{key:"buildPicker",value:function(){var m=this;[].slice.call(this.select.attributes).forEach(function(d){m.container.setAttribute(d.name,d.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var m=this;this.close(),setTimeout(function(){return m.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(m){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g=this.container.querySelector(".ql-selected");if(m!==g&&(g!=null&&g.classList.remove("ql-selected"),m!=null&&(m.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(m.parentNode.children,m),m.hasAttribute("data-value")?this.label.setAttribute("data-value",m.getAttribute("data-value")):this.label.removeAttribute("data-value"),m.hasAttribute("data-label")?this.label.setAttribute("data-label",m.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":a(Event))==="object"){var _=document.createEvent("Event");_.initEvent("change",!0,!0),this.select.dispatchEvent(_)}this.close()}}},{key:"update",value:function(){var m=void 0;if(this.select.selectedIndex>-1){var d=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];m=this.select.options[this.select.selectedIndex],this.selectItem(d)}else this.selectItem(null);var g=m!=null&&m!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",g)}}]),y}();n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=$(a),l=i(5),u=$(l),f=i(4),h=$(f),E=i(16),w=$(E),p=i(25),S=$(p),b=i(24),y=$(b),v=i(35),m=$(v),d=i(6),g=$(d),_=i(22),k=$(_),C=i(7),P=$(C),O=i(55),x=$(O),A=i(42),L=$(A),I=i(23),U=$(I);function $(Z){return Z&&Z.__esModule?Z:{default:Z}}u.default.register({"blots/block":h.default,"blots/block/embed":f.BlockEmbed,"blots/break":w.default,"blots/container":S.default,"blots/cursor":y.default,"blots/embed":m.default,"blots/inline":g.default,"blots/scroll":k.default,"blots/text":P.default,"modules/clipboard":x.default,"modules/history":L.default,"modules/keyboard":U.default}),o.default.register(h.default,w.default,y.default,g.default,k.default,P.default),n.default=u.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(1),o=function(){function l(u){this.domNode=u,this.domNode[a.DATA_KEY]={blot:this}}return Object.defineProperty(l.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),l.create=function(u){if(this.tagName==null)throw new a.ParchmentError("Blot definition missing tagName");var f;return Array.isArray(this.tagName)?(typeof u=="string"&&(u=u.toUpperCase(),parseInt(u).toString()===u&&(u=parseInt(u))),typeof u=="number"?f=document.createElement(this.tagName[u-1]):this.tagName.indexOf(u)>-1?f=document.createElement(u):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 u=this.domNode.cloneNode(!1);return a.create(u)},l.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[a.DATA_KEY]},l.prototype.deleteAt=function(u,f){var h=this.isolate(u,f);h.remove()},l.prototype.formatAt=function(u,f,h,E){var w=this.isolate(u,f);if(a.query(h,a.Scope.BLOT)!=null&&E)w.wrap(h,E);else if(a.query(h,a.Scope.ATTRIBUTE)!=null){var p=a.create(this.statics.scope);w.wrap(p),p.format(h,E)}},l.prototype.insertAt=function(u,f,h){var E=h==null?a.create("text",f):a.create(f,h),w=this.split(u);this.parent.insertBefore(E,w)},l.prototype.insertInto=function(u,f){f===void 0&&(f=null),this.parent!=null&&this.parent.children.remove(this);var h=null;u.children.insertBefore(this,f),f!=null&&(h=f.domNode),(this.domNode.parentNode!=u.domNode||this.domNode.nextSibling!=h)&&u.domNode.insertBefore(this.domNode,h),this.parent=u,this.attach()},l.prototype.isolate=function(u,f){var h=this.split(u);return h.split(f),h},l.prototype.length=function(){return 1},l.prototype.offset=function(u){return u===void 0&&(u=this.parent),this.parent==null||this==u?0:this.parent.children.offset(this)+this.parent.offset(u)},l.prototype.optimize=function(u){this.domNode[a.DATA_KEY]!=null&&delete this.domNode[a.DATA_KEY].mutations},l.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},l.prototype.replace=function(u){u.parent!=null&&(u.parent.insertBefore(this,u.next),u.remove())},l.prototype.replaceWith=function(u,f){var h=typeof u=="string"?a.create(u,f):u;return h.replace(this),h},l.prototype.split=function(u,f){return u===0?this:this.next},l.prototype.update=function(u,f){},l.prototype.wrap=function(u,f){var h=typeof u=="string"?a.create(u,f):u;return this.parent!=null&&this.parent.insertBefore(h,this.next),h.appendChild(this),h},l.blotName="abstract",l}();n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(12),o=i(32),l=i(33),u=i(1),f=function(){function h(E){this.attributes={},this.domNode=E,this.build()}return h.prototype.attribute=function(E,w){w?E.add(this.domNode,w)&&(E.value(this.domNode)!=null?this.attributes[E.attrName]=E:delete this.attributes[E.attrName]):(E.remove(this.domNode),delete this.attributes[E.attrName])},h.prototype.build=function(){var E=this;this.attributes={};var w=a.default.keys(this.domNode),p=o.default.keys(this.domNode),S=l.default.keys(this.domNode);w.concat(p).concat(S).forEach(function(b){var y=u.query(b,u.Scope.ATTRIBUTE);y instanceof a.default&&(E.attributes[y.attrName]=y)})},h.prototype.copy=function(E){var w=this;Object.keys(this.attributes).forEach(function(p){var S=w.attributes[p].value(w.domNode);E.format(p,S)})},h.prototype.move=function(E){var w=this;this.copy(E),Object.keys(this.attributes).forEach(function(p){w.attributes[p].remove(w.domNode)}),this.attributes={}},h.prototype.values=function(){var E=this;return Object.keys(this.attributes).reduce(function(w,p){return w[p]=E.attributes[p].value(E.domNode),w},{})},h}();n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,E){h.__proto__=E}||function(h,E){for(var w in E)E.hasOwnProperty(w)&&(h[w]=E[w])};return function(h,E){f(h,E);function w(){this.constructor=h}h.prototype=E===null?Object.create(E):(w.prototype=E.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function l(f,h){var E=f.getAttribute("class")||"";return E.split(/\s+/).filter(function(w){return w.indexOf(h+"-")===0})}var u=function(f){a(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.keys=function(E){return(E.getAttribute("class")||"").split(/\s+/).map(function(w){return w.split("-").slice(0,-1).join("-")})},h.prototype.add=function(E,w){return this.canAdd(E,w)?(this.remove(E),E.classList.add(this.keyName+"-"+w),!0):!1},h.prototype.remove=function(E){var w=l(E,this.keyName);w.forEach(function(p){E.classList.remove(p)}),E.classList.length===0&&E.removeAttribute("class")},h.prototype.value=function(E){var w=l(E,this.keyName)[0]||"",p=w.slice(this.keyName.length+1);return this.canAdd(E,p)?p:""},h}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,E){h.__proto__=E}||function(h,E){for(var w in E)E.hasOwnProperty(w)&&(h[w]=E[w])};return function(h,E){f(h,E);function w(){this.constructor=h}h.prototype=E===null?Object.create(E):(w.prototype=E.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function l(f){var h=f.split("-"),E=h.slice(1).map(function(w){return w[0].toUpperCase()+w.slice(1)}).join("");return h[0]+E}var u=function(f){a(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.keys=function(E){return(E.getAttribute("style")||"").split(";").map(function(w){var p=w.split(":");return p[0].trim()})},h.prototype.add=function(E,w){return this.canAdd(E,w)?(E.style[l(this.keyName)]=w,!0):!1},h.prototype.remove=function(E){E.style[l(this.keyName)]="",E.getAttribute("style")||E.removeAttribute("style")},h.prototype.value=function(E){var w=E.style[l(this.keyName)];return this.canAdd(E,w)?w:""},h}(o.default);n.default=u},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(f,h){for(var E=0;E<h.length;E++){var w=h[E];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(f,w.key,w)}}return function(f,h,E){return h&&u(f.prototype,h),E&&u(f,E),f}}();function o(u,f){if(!(u instanceof f))throw new TypeError("Cannot call a class as a function")}var l=function(){function u(f,h){o(this,u),this.quill=f,this.options=h,this.modules={}}return a(u,[{key:"init",value:function(){var h=this;Object.keys(this.options.modules).forEach(function(E){h.modules[E]==null&&h.addModule(E)})}},{key:"addModule",value:function(h){var E=this.quill.constructor.import("modules/"+h);return this.modules[h]=new E(this.quill,this.options.modules[h]||{}),this.modules[h]}}]),u}();l.DEFAULTS={modules:{}},l.themes={default:l},n.default=l},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function v(m,d){for(var g=0;g<d.length;g++){var _=d[g];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(m,_.key,_)}}return function(m,d,g){return d&&v(m.prototype,d),g&&v(m,g),m}}(),o=function v(m,d,g){m===null&&(m=Function.prototype);var _=Object.getOwnPropertyDescriptor(m,d);if(_===void 0){var k=Object.getPrototypeOf(m);return k===null?void 0:v(k,d,g)}else{if("value"in _)return _.value;var C=_.get;return C===void 0?void 0:C.call(g)}},l=i(0),u=E(l),f=i(7),h=E(f);function E(v){return v&&v.__esModule?v:{default:v}}function w(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function p(v,m){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:v}function S(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(v,m):v.__proto__=m)}var b="\uFEFF",y=function(v){S(m,v);function m(d){w(this,m);var g=p(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,d));return g.contentNode=document.createElement("span"),g.contentNode.setAttribute("contenteditable",!1),[].slice.call(g.domNode.childNodes).forEach(function(_){g.contentNode.appendChild(_)}),g.leftGuard=document.createTextNode(b),g.rightGuard=document.createTextNode(b),g.domNode.appendChild(g.leftGuard),g.domNode.appendChild(g.contentNode),g.domNode.appendChild(g.rightGuard),g}return a(m,[{key:"index",value:function(g,_){return g===this.leftGuard?0:g===this.rightGuard?1:o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"index",this).call(this,g,_)}},{key:"restore",value:function(g){var _=void 0,k=void 0,C=g.data.split(b).join("");if(g===this.leftGuard)if(this.prev instanceof h.default){var P=this.prev.length();this.prev.insertAt(P,C),_={startNode:this.prev.domNode,startOffset:P+C.length}}else k=document.createTextNode(C),this.parent.insertBefore(u.default.create(k),this),_={startNode:k,startOffset:C.length};else g===this.rightGuard&&(this.next instanceof h.default?(this.next.insertAt(0,C),_={startNode:this.next.domNode,startOffset:C.length}):(k=document.createTextNode(C),this.parent.insertBefore(u.default.create(k),this.next),_={startNode:k,startOffset:C.length}));return g.data=b,_}},{key:"update",value:function(g,_){var k=this;g.forEach(function(C){if(C.type==="characterData"&&(C.target===k.leftGuard||C.target===k.rightGuard)){var P=k.restore(C.target);P&&(_.range=P)}})}}]),m}(u.default.Embed);n.default=y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.AlignStyle=n.AlignClass=n.AlignAttribute=void 0;var a=i(0),o=l(a);function l(w){return w&&w.__esModule?w:{default:w}}var u={scope:o.default.Scope.BLOCK,whitelist:["right","center","justify"]},f=new o.default.Attributor.Attribute("align","align",u),h=new o.default.Attributor.Class("align","ql-align",u),E=new o.default.Attributor.Style("align","text-align",u);n.AlignAttribute=f,n.AlignClass=h,n.AlignStyle=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.BackgroundStyle=n.BackgroundClass=void 0;var a=i(0),o=u(a),l=i(26);function u(E){return E&&E.__esModule?E:{default:E}}var f=new o.default.Attributor.Class("background","ql-bg",{scope:o.default.Scope.INLINE}),h=new l.ColorAttributor("background","background-color",{scope:o.default.Scope.INLINE});n.BackgroundClass=f,n.BackgroundStyle=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.DirectionStyle=n.DirectionClass=n.DirectionAttribute=void 0;var a=i(0),o=l(a);function l(w){return w&&w.__esModule?w:{default:w}}var u={scope:o.default.Scope.BLOCK,whitelist:["rtl"]},f=new o.default.Attributor.Attribute("direction","dir",u),h=new o.default.Attributor.Class("direction","ql-direction",u),E=new o.default.Attributor.Style("direction","direction",u);n.DirectionAttribute=f,n.DirectionClass=h,n.DirectionStyle=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var a=function(){function v(m,d){for(var g=0;g<d.length;g++){var _=d[g];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(m,_.key,_)}}return function(m,d,g){return d&&v(m.prototype,d),g&&v(m,g),m}}(),o=function v(m,d,g){m===null&&(m=Function.prototype);var _=Object.getOwnPropertyDescriptor(m,d);if(_===void 0){var k=Object.getPrototypeOf(m);return k===null?void 0:v(k,d,g)}else{if("value"in _)return _.value;var C=_.get;return C===void 0?void 0:C.call(g)}},l=i(0),u=f(l);function f(v){return v&&v.__esModule?v:{default:v}}function h(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function E(v,m){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:v}function w(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(v,m):v.__proto__=m)}var p={scope:u.default.Scope.INLINE,whitelist:["serif","monospace"]},S=new u.default.Attributor.Class("font","ql-font",p),b=function(v){w(m,v);function m(){return h(this,m),E(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return a(m,[{key:"value",value:function(g){return o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"value",this).call(this,g).replace(/["']/g,"")}}]),m}(u.default.Attributor.Style),y=new b("font","font-family",p);n.FontStyle=y,n.FontClass=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SizeStyle=n.SizeClass=void 0;var a=i(0),o=l(a);function l(h){return h&&h.__esModule?h:{default:h}}var u=new o.default.Attributor.Class("size","ql-size",{scope:o.default.Scope.INLINE,whitelist:["small","large","huge"]}),f=new o.default.Attributor.Style("size","font-size",{scope:o.default.Scope.INLINE,whitelist:["10px","18px","32px"]});n.SizeClass=u,n.SizeStyle=f},function(r,n,i){r.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(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.getLastChangeIndex=n.default=void 0;var a=function(){function d(g,_){for(var k=0;k<_.length;k++){var C=_[k];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(g,C.key,C)}}return function(g,_,k){return _&&d(g.prototype,_),k&&d(g,k),g}}(),o=i(0),l=w(o),u=i(5),f=w(u),h=i(9),E=w(h);function w(d){return d&&d.__esModule?d:{default:d}}function p(d,g){if(!(d instanceof g))throw new TypeError("Cannot call a class as a function")}function S(d,g){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:d}function b(d,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);d.prototype=Object.create(g&&g.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(d,g):d.__proto__=g)}var y=function(d){b(g,d);function g(_,k){p(this,g);var C=S(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,_,k));return C.lastRecorded=0,C.ignoreChange=!1,C.clear(),C.quill.on(f.default.events.EDITOR_CHANGE,function(P,O,x,A){P!==f.default.events.TEXT_CHANGE||C.ignoreChange||(!C.options.userOnly||A===f.default.sources.USER?C.record(O,x):C.transform(O))}),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 a(g,[{key:"change",value:function(k,C){if(this.stack[k].length!==0){var P=this.stack[k].pop();this.stack[C].push(P),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(P[k],f.default.sources.USER),this.ignoreChange=!1;var O=m(P[k]);this.quill.setSelection(O)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(k,C){if(k.ops.length!==0){this.stack.redo=[];var P=this.quill.getContents().diff(C),O=Date.now();if(this.lastRecorded+this.options.delay>O&&this.stack.undo.length>0){var x=this.stack.undo.pop();P=P.compose(x.undo),k=x.redo.compose(k)}else this.lastRecorded=O;this.stack.undo.push({redo:k,undo:P}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(k){this.stack.undo.forEach(function(C){C.undo=k.transform(C.undo,!0),C.redo=k.transform(C.redo,!0)}),this.stack.redo.forEach(function(C){C.undo=k.transform(C.undo,!0),C.redo=k.transform(C.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),g}(E.default);y.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function v(d){var g=d.ops[d.ops.length-1];return g==null?!1:g.insert!=null?typeof g.insert=="string"&&g.insert.endsWith(`
139
+ `):g.attributes!=null?Object.keys(g.attributes).some(function(_){return l.default.query(_,l.default.Scope.BLOCK)!=null}):!1}function m(d){var g=d.reduce(function(k,C){return k+=C.delete||0,k},0),_=d.length()-g;return v(d)&&(_-=1),_}n.default=y,n.getLastChangeIndex=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var a=function(){function F(D,H){for(var K=0;K<H.length;K++){var G=H[K];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(D,G.key,G)}}return function(D,H,K){return H&&F(D.prototype,H),K&&F(D,K),D}}(),o=function F(D,H,K){D===null&&(D=Function.prototype);var G=Object.getOwnPropertyDescriptor(D,H);if(G===void 0){var B=Object.getPrototypeOf(D);return B===null?void 0:F(B,H,K)}else{if("value"in G)return G.value;var Y=G.get;return Y===void 0?void 0:Y.call(K)}},l=i(3),u=O(l),f=i(2),h=O(f),E=i(8),w=O(E),p=i(23),S=O(p),b=i(34),y=O(b),v=i(59),m=O(v),d=i(60),g=O(d),_=i(28),k=O(_),C=i(61),P=O(C);function O(F){return F&&F.__esModule?F:{default:F}}function x(F,D){if(!(F instanceof D))throw new TypeError("Cannot call a class as a function")}function A(F,D){if(!F)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D&&(typeof D=="object"||typeof D=="function")?D:F}function L(F,D){if(typeof D!="function"&&D!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof D);F.prototype=Object.create(D&&D.prototype,{constructor:{value:F,enumerable:!1,writable:!0,configurable:!0}}),D&&(Object.setPrototypeOf?Object.setPrototypeOf(F,D):F.__proto__=D)}var I=[!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"],$=[!1,"serif","monospace"],Z=["1","2","3",!1],q=["small",!1,"large","huge"],z=function(F){L(D,F);function D(H,K){x(this,D);var G=A(this,(D.__proto__||Object.getPrototypeOf(D)).call(this,H,K)),B=function Y(X){if(!document.body.contains(H.root))return document.body.removeEventListener("click",Y);G.tooltip!=null&&!G.tooltip.root.contains(X.target)&&document.activeElement!==G.tooltip.textbox&&!G.quill.hasFocus()&&G.tooltip.hide(),G.pickers!=null&&G.pickers.forEach(function(Q){Q.container.contains(X.target)||Q.close()})};return H.emitter.listenDOM("click",document.body,B),G}return a(D,[{key:"addModule",value:function(K){var G=o(D.prototype.__proto__||Object.getPrototypeOf(D.prototype),"addModule",this).call(this,K);return K==="toolbar"&&this.extendToolbar(G),G}},{key:"buildButtons",value:function(K,G){K.forEach(function(B){var Y=B.getAttribute("class")||"";Y.split(/\s+/).forEach(function(X){if(X.startsWith("ql-")&&(X=X.slice(3),G[X]!=null))if(X==="direction")B.innerHTML=G[X][""]+G[X].rtl;else if(typeof G[X]=="string")B.innerHTML=G[X];else{var Q=B.value||"";Q!=null&&G[X][Q]&&(B.innerHTML=G[X][Q])}})})}},{key:"buildPickers",value:function(K,G){var B=this;this.pickers=K.map(function(X){if(X.classList.contains("ql-align"))return X.querySelector("option")==null&&M(X,I),new g.default(X,G.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&&M(X,U,Q==="background"?"#ffffff":"#000000"),new m.default(X,G[Q])}else return X.querySelector("option")==null&&(X.classList.contains("ql-font")?M(X,$):X.classList.contains("ql-header")?M(X,Z):X.classList.contains("ql-size")&&M(X,q)),new k.default(X)});var Y=function(){B.pickers.forEach(function(Q){Q.update()})};this.quill.on(w.default.events.EDITOR_CHANGE,Y)}}]),D}(y.default);z.DEFAULTS=(0,u.default)(!0,{},y.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var D=this,H=this.container.querySelector("input.ql-image[type=file]");H==null&&(H=document.createElement("input"),H.setAttribute("type","file"),H.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),H.classList.add("ql-image"),H.addEventListener("change",function(){if(H.files!=null&&H.files[0]!=null){var K=new FileReader;K.onload=function(G){var B=D.quill.getSelection(!0);D.quill.updateContents(new h.default().retain(B.index).delete(B.length).insert({image:G.target.result}),w.default.sources.USER),D.quill.setSelection(B.index+1,w.default.sources.SILENT),H.value=""},K.readAsDataURL(H.files[0])}}),this.container.appendChild(H)),H.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var W=function(F){L(D,F);function D(H,K){x(this,D);var G=A(this,(D.__proto__||Object.getPrototypeOf(D)).call(this,H,K));return G.textbox=G.root.querySelector('input[type="text"]'),G.listen(),G}return a(D,[{key:"listen",value:function(){var K=this;this.textbox.addEventListener("keydown",function(G){S.default.match(G,"enter")?(K.save(),G.preventDefault()):S.default.match(G,"escape")&&(K.cancel(),G.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),G!=null?this.textbox.value=G:K!==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-"+K)||""),this.root.setAttribute("data-mode",K)}},{key:"restoreFocus",value:function(){var K=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=K}},{key:"save",value:function(){var K=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var G=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",K,w.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",K,w.default.sources.USER)),this.quill.root.scrollTop=G;break}case"video":K=R(K);case"formula":{if(!K)break;var B=this.quill.getSelection(!0);if(B!=null){var Y=B.index+B.length;this.quill.insertEmbed(Y,this.root.getAttribute("data-mode"),K,w.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(Y+1," ",w.default.sources.USER),this.quill.setSelection(Y+2,w.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),D}(P.default);function R(F){var D=F.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||F.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return D?(D[1]||"https")+"://www.youtube.com/embed/"+D[2]+"?showinfo=0":(D=F.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(D[1]||"https")+"://player.vimeo.com/video/"+D[2]+"/":F}function M(F,D){var H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;D.forEach(function(K){var G=document.createElement("option");K===H?G.setAttribute("selected","selected"):G.setAttribute("value",K),F.appendChild(G)})}n.BaseTooltip=W,n.default=z},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function o(){this.head=this.tail=null,this.length=0}return o.prototype.append=function(){for(var l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];this.insertBefore(l[0],null),l.length>1&&this.append.apply(this,l.slice(1))},o.prototype.contains=function(l){for(var u,f=this.iterator();u=f();)if(u===l)return!0;return!1},o.prototype.insertBefore=function(l,u){l&&(l.next=u,u!=null?(l.prev=u.prev,u.prev!=null&&(u.prev.next=l),u.prev=l,u===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)},o.prototype.offset=function(l){for(var u=0,f=this.head;f!=null;){if(f===l)return u;u+=f.length(),f=f.next}return-1},o.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)},o.prototype.iterator=function(l){return l===void 0&&(l=this.head),function(){var u=l;return l!=null&&(l=l.next),u}},o.prototype.find=function(l,u){u===void 0&&(u=!1);for(var f,h=this.iterator();f=h();){var E=f.length();if(l<E||u&&l===E&&(f.next==null||f.next.length()!==0))return[f,l];l-=E}return[null,0]},o.prototype.forEach=function(l){for(var u,f=this.iterator();u=f();)l(u)},o.prototype.forEachAt=function(l,u,f){if(!(u<=0))for(var h=this.find(l),E=h[0],w=h[1],p,S=l-w,b=this.iterator(E);(p=b())&&S<l+u;){var y=p.length();l>S?f(p,l-S,Math.min(u,S+y-l)):f(p,0,Math.min(y,l+u-S)),S+=y}},o.prototype.map=function(l){return this.reduce(function(u,f){return u.push(l(f)),u},[])},o.prototype.reduce=function(l,u){for(var f,h=this.iterator();f=h();)u=l(u,f);return u},o}();n.default=a},function(r,n,i){var a=this&&this.__extends||function(){var E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,p){w.__proto__=p}||function(w,p){for(var S in p)p.hasOwnProperty(S)&&(w[S]=p[S])};return function(w,p){E(w,p);function S(){this.constructor=w}w.prototype=p===null?Object.create(p):(S.prototype=p.prototype,new S)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(17),l=i(1),u={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},f=100,h=function(E){a(w,E);function w(p){var S=E.call(this,p)||this;return S.scroll=S,S.observer=new MutationObserver(function(b){S.update(b)}),S.observer.observe(S.domNode,u),S.attach(),S}return w.prototype.detach=function(){E.prototype.detach.call(this),this.observer.disconnect()},w.prototype.deleteAt=function(p,S){this.update(),p===0&&S===this.length()?this.children.forEach(function(b){b.remove()}):E.prototype.deleteAt.call(this,p,S)},w.prototype.formatAt=function(p,S,b,y){this.update(),E.prototype.formatAt.call(this,p,S,b,y)},w.prototype.insertAt=function(p,S,b){this.update(),E.prototype.insertAt.call(this,p,S,b)},w.prototype.optimize=function(p,S){var b=this;p===void 0&&(p=[]),S===void 0&&(S={}),E.prototype.optimize.call(this,S);for(var y=[].slice.call(this.observer.takeRecords());y.length>0;)p.push(y.pop());for(var v=function(_,k){k===void 0&&(k=!0),!(_==null||_===b)&&_.domNode.parentNode!=null&&(_.domNode[l.DATA_KEY].mutations==null&&(_.domNode[l.DATA_KEY].mutations=[]),k&&v(_.parent))},m=function(_){_.domNode[l.DATA_KEY]==null||_.domNode[l.DATA_KEY].mutations==null||(_ instanceof o.default&&_.children.forEach(m),_.optimize(S))},d=p,g=0;d.length>0;g+=1){if(g>=f)throw new Error("[Parchment] Maximum optimize iterations reached");for(d.forEach(function(_){var k=l.find(_.target,!0);k!=null&&(k.domNode===_.target&&(_.type==="childList"?(v(l.find(_.previousSibling,!1)),[].forEach.call(_.addedNodes,function(C){var P=l.find(C,!1);v(P,!1),P instanceof o.default&&P.children.forEach(function(O){v(O,!1)})})):_.type==="attributes"&&v(k.prev)),v(k))}),this.children.forEach(m),d=[].slice.call(this.observer.takeRecords()),y=d.slice();y.length>0;)p.push(y.pop())}},w.prototype.update=function(p,S){var b=this;S===void 0&&(S={}),p=p||this.observer.takeRecords(),p.map(function(y){var v=l.find(y.target,!0);return v==null?null:v.domNode[l.DATA_KEY].mutations==null?(v.domNode[l.DATA_KEY].mutations=[y],v):(v.domNode[l.DATA_KEY].mutations.push(y),null)}).forEach(function(y){y==null||y===b||y.domNode[l.DATA_KEY]==null||y.update(y.domNode[l.DATA_KEY].mutations||[],S)}),this.domNode[l.DATA_KEY].mutations!=null&&E.prototype.update.call(this,this.domNode[l.DATA_KEY].mutations,S),this.optimize(p,S)},w.blotName="scroll",w.defaultChild="block",w.scope=l.Scope.BLOCK_BLOT,w.tagName="DIV",w}(o.default);n.default=h},function(r,n,i){var a=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,w){E.__proto__=w}||function(E,w){for(var p in w)w.hasOwnProperty(p)&&(E[p]=w[p])};return function(E,w){h(E,w);function p(){this.constructor=E}E.prototype=w===null?Object.create(w):(p.prototype=w.prototype,new p)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),l=i(1);function u(h,E){if(Object.keys(h).length!==Object.keys(E).length)return!1;for(var w in h)if(h[w]!==E[w])return!1;return!0}var f=function(h){a(E,h);function E(){return h!==null&&h.apply(this,arguments)||this}return E.formats=function(w){if(w.tagName!==E.tagName)return h.formats.call(this,w)},E.prototype.format=function(w,p){var S=this;w===this.statics.blotName&&!p?(this.children.forEach(function(b){b instanceof o.default||(b=b.wrap(E.blotName,!0)),S.attributes.copy(b)}),this.unwrap()):h.prototype.format.call(this,w,p)},E.prototype.formatAt=function(w,p,S,b){if(this.formats()[S]!=null||l.query(S,l.Scope.ATTRIBUTE)){var y=this.isolate(w,p);y.format(S,b)}else h.prototype.formatAt.call(this,w,p,S,b)},E.prototype.optimize=function(w){h.prototype.optimize.call(this,w);var p=this.formats();if(Object.keys(p).length===0)return this.unwrap();var S=this.next;S instanceof E&&S.prev===this&&u(p,S.formats())&&(S.moveChildren(this),S.remove())},E.blotName="inline",E.scope=l.Scope.INLINE_BLOT,E.tagName="SPAN",E}(o.default);n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,E){h.__proto__=E}||function(h,E){for(var w in E)E.hasOwnProperty(w)&&(h[w]=E[w])};return function(h,E){f(h,E);function w(){this.constructor=h}h.prototype=E===null?Object.create(E):(w.prototype=E.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),l=i(1),u=function(f){a(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.formats=function(E){var w=l.query(h.blotName).tagName;if(E.tagName!==w)return f.formats.call(this,E)},h.prototype.format=function(E,w){l.query(E,l.Scope.BLOCK)!=null&&(E===this.statics.blotName&&!w?this.replaceWith(h.blotName):f.prototype.format.call(this,E,w))},h.prototype.formatAt=function(E,w,p,S){l.query(p,l.Scope.BLOCK)!=null?this.format(p,S):f.prototype.formatAt.call(this,E,w,p,S)},h.prototype.insertAt=function(E,w,p){if(p==null||l.query(w,l.Scope.INLINE)!=null)f.prototype.insertAt.call(this,E,w,p);else{var S=this.split(E),b=l.create(w,p);S.parent.insertBefore(b,S)}},h.prototype.update=function(E,w){navigator.userAgent.match(/Trident/)?this.build():f.prototype.update.call(this,E,w)},h.blotName="block",h.scope=l.Scope.BLOCK_BLOT,h.tagName="P",h}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,h){f.__proto__=h}||function(f,h){for(var E in h)h.hasOwnProperty(E)&&(f[E]=h[E])};return function(f,h){u(f,h);function E(){this.constructor=f}f.prototype=h===null?Object.create(h):(E.prototype=h.prototype,new E)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(19),l=function(u){a(f,u);function f(){return u!==null&&u.apply(this,arguments)||this}return f.formats=function(h){},f.prototype.format=function(h,E){u.prototype.formatAt.call(this,0,this.length(),h,E)},f.prototype.formatAt=function(h,E,w,p){h===0&&E===this.length()?this.format(w,p):u.prototype.formatAt.call(this,h,E,w,p)},f.prototype.formats=function(){return this.statics.formats(this.domNode)},f}(o.default);n.default=l},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,E){h.__proto__=E}||function(h,E){for(var w in E)E.hasOwnProperty(w)&&(h[w]=E[w])};return function(h,E){f(h,E);function w(){this.constructor=h}h.prototype=E===null?Object.create(E):(w.prototype=E.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(19),l=i(1),u=function(f){a(h,f);function h(E){var w=f.call(this,E)||this;return w.text=w.statics.value(w.domNode),w}return h.create=function(E){return document.createTextNode(E)},h.value=function(E){var w=E.data;return w.normalize&&(w=w.normalize()),w},h.prototype.deleteAt=function(E,w){this.domNode.data=this.text=this.text.slice(0,E)+this.text.slice(E+w)},h.prototype.index=function(E,w){return this.domNode===E?w:-1},h.prototype.insertAt=function(E,w,p){p==null?(this.text=this.text.slice(0,E)+w+this.text.slice(E),this.domNode.data=this.text):f.prototype.insertAt.call(this,E,w,p)},h.prototype.length=function(){return this.text.length},h.prototype.optimize=function(E){f.prototype.optimize.call(this,E),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(E,w){return[this.domNode,E]},h.prototype.split=function(E,w){if(w===void 0&&(w=!1),!w){if(E===0)return this;if(E===this.length())return this.next}var p=l.create(this.domNode.splitText(E));return this.parent.insertBefore(p,this.next),this.text=this.statics.value(this.domNode),p},h.prototype.update=function(E,w){var p=this;E.some(function(S){return S.type==="characterData"&&S.target===p.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}(o.default);n.default=u},function(r,n,i){var a=document.createElement("div");if(a.classList.toggle("test-class",!1),a.classList.contains("test-class")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(l,u){return arguments.length>1&&!this.contains(l)==!u?u:o.call(this,l)}}String.prototype.startsWith||(String.prototype.startsWith=function(l,u){return u=u||0,this.substr(u,l.length)===l}),String.prototype.endsWith||(String.prototype.endsWith=function(l,u){var f=this.toString();(typeof u!="number"||!isFinite(u)||Math.floor(u)!==u||u>f.length)&&(u=f.length),u-=l.length;var h=f.indexOf(l,u);return h!==-1&&h===u}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(u){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof u!="function")throw new TypeError("predicate must be a function");for(var f=Object(this),h=f.length>>>0,E=arguments[1],w,p=0;p<h;p++)if(w=f[p],u.call(E,w,p,f))return w}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(r,n){var i=-1,a=1,o=0;function l(g,_,k){if(g==_)return g?[[o,g]]:[];(k<0||g.length<k)&&(k=null);var C=E(g,_),P=g.substring(0,C);g=g.substring(C),_=_.substring(C),C=w(g,_);var O=g.substring(g.length-C);g=g.substring(0,g.length-C),_=_.substring(0,_.length-C);var x=u(g,_);return P&&x.unshift([o,P]),O&&x.push([o,O]),S(x),k!=null&&(x=v(x,k)),x=m(x),x}function u(g,_){var k;if(!g)return[[a,_]];if(!_)return[[i,g]];var C=g.length>_.length?g:_,P=g.length>_.length?_:g,O=C.indexOf(P);if(O!=-1)return k=[[a,C.substring(0,O)],[o,P],[a,C.substring(O+P.length)]],g.length>_.length&&(k[0][0]=k[2][0]=i),k;if(P.length==1)return[[i,g],[a,_]];var x=p(g,_);if(x){var A=x[0],L=x[1],I=x[2],U=x[3],$=x[4],Z=l(A,I),q=l(L,U);return Z.concat([[o,$]],q)}return f(g,_)}function f(g,_){for(var k=g.length,C=_.length,P=Math.ceil((k+C)/2),O=P,x=2*P,A=new Array(x),L=new Array(x),I=0;I<x;I++)A[I]=-1,L[I]=-1;A[O+1]=0,L[O+1]=0;for(var U=k-C,$=U%2!=0,Z=0,q=0,z=0,W=0,R=0;R<P;R++){for(var M=-R+Z;M<=R-q;M+=2){var F=O+M,D;M==-R||M!=R&&A[F-1]<A[F+1]?D=A[F+1]:D=A[F-1]+1;for(var H=D-M;D<k&&H<C&&g.charAt(D)==_.charAt(H);)D++,H++;if(A[F]=D,D>k)q+=2;else if(H>C)Z+=2;else if($){var K=O+U-M;if(K>=0&&K<x&&L[K]!=-1){var G=k-L[K];if(D>=G)return h(g,_,D,H)}}}for(var B=-R+z;B<=R-W;B+=2){var K=O+B,G;B==-R||B!=R&&L[K-1]<L[K+1]?G=L[K+1]:G=L[K-1]+1;for(var Y=G-B;G<k&&Y<C&&g.charAt(k-G-1)==_.charAt(C-Y-1);)G++,Y++;if(L[K]=G,G>k)W+=2;else if(Y>C)z+=2;else if(!$){var F=O+U-B;if(F>=0&&F<x&&A[F]!=-1){var D=A[F],H=O+D-F;if(G=k-G,D>=G)return h(g,_,D,H)}}}}return[[i,g],[a,_]]}function h(g,_,k,C){var P=g.substring(0,k),O=_.substring(0,C),x=g.substring(k),A=_.substring(C),L=l(P,O),I=l(x,A);return L.concat(I)}function E(g,_){if(!g||!_||g.charAt(0)!=_.charAt(0))return 0;for(var k=0,C=Math.min(g.length,_.length),P=C,O=0;k<P;)g.substring(O,P)==_.substring(O,P)?(k=P,O=k):C=P,P=Math.floor((C-k)/2+k);return P}function w(g,_){if(!g||!_||g.charAt(g.length-1)!=_.charAt(_.length-1))return 0;for(var k=0,C=Math.min(g.length,_.length),P=C,O=0;k<P;)g.substring(g.length-P,g.length-O)==_.substring(_.length-P,_.length-O)?(k=P,O=k):C=P,P=Math.floor((C-k)/2+k);return P}function p(g,_){var k=g.length>_.length?g:_,C=g.length>_.length?_:g;if(k.length<4||C.length*2<k.length)return null;function P(q,z,W){for(var R=q.substring(W,W+Math.floor(q.length/4)),M=-1,F="",D,H,K,G;(M=z.indexOf(R,M+1))!=-1;){var B=E(q.substring(W),z.substring(M)),Y=w(q.substring(0,W),z.substring(0,M));F.length<Y+B&&(F=z.substring(M-Y,M)+z.substring(M,M+B),D=q.substring(0,W-Y),H=q.substring(W+B),K=z.substring(0,M-Y),G=z.substring(M+B))}return F.length*2>=q.length?[D,H,K,G,F]:null}var O=P(k,C,Math.ceil(k.length/4)),x=P(k,C,Math.ceil(k.length/2)),A;if(!O&&!x)return null;x?O?A=O[4].length>x[4].length?O:x:A=x:A=O;var L,I,U,$;g.length>_.length?(L=A[0],I=A[1],U=A[2],$=A[3]):(U=A[0],$=A[1],L=A[2],I=A[3]);var Z=A[4];return[L,I,U,$,Z]}function S(g){g.push([o,""]);for(var _=0,k=0,C=0,P="",O="",x;_<g.length;)switch(g[_][0]){case a:C++,O+=g[_][1],_++;break;case i:k++,P+=g[_][1],_++;break;case o:k+C>1?(k!==0&&C!==0&&(x=E(O,P),x!==0&&(_-k-C>0&&g[_-k-C-1][0]==o?g[_-k-C-1][1]+=O.substring(0,x):(g.splice(0,0,[o,O.substring(0,x)]),_++),O=O.substring(x),P=P.substring(x)),x=w(O,P),x!==0&&(g[_][1]=O.substring(O.length-x)+g[_][1],O=O.substring(0,O.length-x),P=P.substring(0,P.length-x))),k===0?g.splice(_-C,k+C,[a,O]):C===0?g.splice(_-k,k+C,[i,P]):g.splice(_-k-C,k+C,[i,P],[a,O]),_=_-k-C+(k?1:0)+(C?1:0)+1):_!==0&&g[_-1][0]==o?(g[_-1][1]+=g[_][1],g.splice(_,1)):_++,C=0,k=0,P="",O="";break}g[g.length-1][1]===""&&g.pop();var A=!1;for(_=1;_<g.length-1;)g[_-1][0]==o&&g[_+1][0]==o&&(g[_][1].substring(g[_][1].length-g[_-1][1].length)==g[_-1][1]?(g[_][1]=g[_-1][1]+g[_][1].substring(0,g[_][1].length-g[_-1][1].length),g[_+1][1]=g[_-1][1]+g[_+1][1],g.splice(_-1,1),A=!0):g[_][1].substring(0,g[_+1][1].length)==g[_+1][1]&&(g[_-1][1]+=g[_+1][1],g[_][1]=g[_][1].substring(g[_+1][1].length)+g[_+1][1],g.splice(_+1,1),A=!0)),_++;A&&S(g)}var b=l;b.INSERT=a,b.DELETE=i,b.EQUAL=o,r.exports=b;function y(g,_){if(_===0)return[o,g];for(var k=0,C=0;C<g.length;C++){var P=g[C];if(P[0]===i||P[0]===o){var O=k+P[1].length;if(_===O)return[C+1,g];if(_<O){g=g.slice();var x=_-k,A=[P[0],P[1].slice(0,x)],L=[P[0],P[1].slice(x)];return g.splice(C,1,A,L),[C+1,g]}else k=O}}throw new Error("cursor_pos is out of bounds!")}function v(g,_){var k=y(g,_),C=k[1],P=k[0],O=C[P],x=C[P+1];if(O==null)return g;if(O[0]!==o)return g;if(x!=null&&O[1]+x[1]===x[1]+O[1])return C.splice(P,2,x,O),d(C,P,2);if(x!=null&&x[1].indexOf(O[1])===0){C.splice(P,2,[x[0],O[1]],[0,O[1]]);var A=x[1].slice(O[1].length);return A.length>0&&C.splice(P+2,0,[x[0],A]),d(C,P,3)}else return g}function m(g){for(var _=!1,k=function(x){return x.charCodeAt(0)>=56320&&x.charCodeAt(0)<=57343},C=function(x){return x.charCodeAt(x.length-1)>=55296&&x.charCodeAt(x.length-1)<=56319},P=2;P<g.length;P+=1)g[P-2][0]===o&&C(g[P-2][1])&&g[P-1][0]===i&&k(g[P-1][1])&&g[P][0]===a&&k(g[P][1])&&(_=!0,g[P-1][1]=g[P-2][1].slice(-1)+g[P-1][1],g[P][1]=g[P-2][1].slice(-1)+g[P][1],g[P-2][1]=g[P-2][1].slice(0,-1));if(!_)return g;for(var O=[],P=0;P<g.length;P+=1)g[P][1].length>0&&O.push(g[P]);return O}function d(g,_,k){for(var C=_+k-1;C>=0&&C>=_-1;C--)if(C+1<g.length){var P=g[C],O=g[C+1];P[0]===O[1]&&g.splice(C,2,[P[0],P[1]+O[1]])}return g}},function(r,n){n=r.exports=typeof Object.keys=="function"?Object.keys:i,n.shim=i;function i(a){var o=[];for(var l in a)o.push(l);return o}},function(r,n){var i=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";n=r.exports=i?a:o,n.supported=a;function a(l){return Object.prototype.toString.call(l)=="[object Arguments]"}n.unsupported=o;function o(l){return l&&typeof l=="object"&&typeof l.length=="number"&&Object.prototype.hasOwnProperty.call(l,"callee")&&!Object.prototype.propertyIsEnumerable.call(l,"callee")||!1}},function(r,n){var i=Object.prototype.hasOwnProperty,a="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(a=!1));function l(f,h,E){this.fn=f,this.context=h,this.once=E||!1}function u(){this._events=new o,this._eventsCount=0}u.prototype.eventNames=function(){var h=[],E,w;if(this._eventsCount===0)return h;for(w in E=this._events)i.call(E,w)&&h.push(a?w.slice(1):w);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(E)):h},u.prototype.listeners=function(h,E){var w=a?a+h:h,p=this._events[w];if(E)return!!p;if(!p)return[];if(p.fn)return[p.fn];for(var S=0,b=p.length,y=new Array(b);S<b;S++)y[S]=p[S].fn;return y},u.prototype.emit=function(h,E,w,p,S,b){var y=a?a+h:h;if(!this._events[y])return!1;var v=this._events[y],m=arguments.length,d,g;if(v.fn){switch(v.once&&this.removeListener(h,v.fn,void 0,!0),m){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,E),!0;case 3:return v.fn.call(v.context,E,w),!0;case 4:return v.fn.call(v.context,E,w,p),!0;case 5:return v.fn.call(v.context,E,w,p,S),!0;case 6:return v.fn.call(v.context,E,w,p,S,b),!0}for(g=1,d=new Array(m-1);g<m;g++)d[g-1]=arguments[g];v.fn.apply(v.context,d)}else{var _=v.length,k;for(g=0;g<_;g++)switch(v[g].once&&this.removeListener(h,v[g].fn,void 0,!0),m){case 1:v[g].fn.call(v[g].context);break;case 2:v[g].fn.call(v[g].context,E);break;case 3:v[g].fn.call(v[g].context,E,w);break;case 4:v[g].fn.call(v[g].context,E,w,p);break;default:if(!d)for(k=1,d=new Array(m-1);k<m;k++)d[k-1]=arguments[k];v[g].fn.apply(v[g].context,d)}}return!0},u.prototype.on=function(h,E,w){var p=new l(E,w||this),S=a?a+h:h;return this._events[S]?this._events[S].fn?this._events[S]=[this._events[S],p]:this._events[S].push(p):(this._events[S]=p,this._eventsCount++),this},u.prototype.once=function(h,E,w){var p=new l(E,w||this,!0),S=a?a+h:h;return this._events[S]?this._events[S].fn?this._events[S]=[this._events[S],p]:this._events[S].push(p):(this._events[S]=p,this._eventsCount++),this},u.prototype.removeListener=function(h,E,w,p){var S=a?a+h:h;if(!this._events[S])return this;if(!E)return--this._eventsCount===0?this._events=new o:delete this._events[S],this;var b=this._events[S];if(b.fn)b.fn===E&&(!p||b.once)&&(!w||b.context===w)&&(--this._eventsCount===0?this._events=new o:delete this._events[S]);else{for(var y=0,v=[],m=b.length;y<m;y++)(b[y].fn!==E||p&&!b[y].once||w&&b[y].context!==w)&&v.push(b[y]);v.length?this._events[S]=v.length===1?v[0]:v:--this._eventsCount===0?this._events=new o:delete this._events[S]}return this},u.prototype.removeAllListeners=function(h){var E;return h?(E=a?a+h:h,this._events[E]&&(--this._eventsCount===0?this._events=new o:delete this._events[E])):(this._events=new o,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prototype.setMaxListeners=function(){return this},u.prefixed=a,u.EventEmitter=u,typeof r<"u"&&(r.exports=u)},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.matchText=n.matchSpacing=n.matchNewline=n.matchBlot=n.matchAttributor=n.default=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(se){return typeof se}:function(se){return se&&typeof Symbol=="function"&&se.constructor===Symbol&&se!==Symbol.prototype?"symbol":typeof se},o=function(){function se(de,_e){var ve=[],re=!0,ce=!1,be=void 0;try{for(var Oe=de[Symbol.iterator](),$e;!(re=($e=Oe.next()).done)&&(ve.push($e.value),!(_e&&ve.length===_e));re=!0);}catch(Qe){ce=!0,be=Qe}finally{try{!re&&Oe.return&&Oe.return()}finally{if(ce)throw be}}return ve}return function(de,_e){if(Array.isArray(de))return de;if(Symbol.iterator in Object(de))return se(de,_e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function se(de,_e){for(var ve=0;ve<_e.length;ve++){var re=_e[ve];re.enumerable=re.enumerable||!1,re.configurable=!0,"value"in re&&(re.writable=!0),Object.defineProperty(de,re.key,re)}}return function(de,_e,ve){return _e&&se(de.prototype,_e),ve&&se(de,ve),de}}(),u=i(3),f=L(u),h=i(2),E=L(h),w=i(0),p=L(w),S=i(5),b=L(S),y=i(10),v=L(y),m=i(9),d=L(m),g=i(36),_=i(37),k=i(13),C=L(k),P=i(26),O=i(38),x=i(39),A=i(40);function L(se){return se&&se.__esModule?se:{default:se}}function I(se,de,_e){return de in se?Object.defineProperty(se,de,{value:_e,enumerable:!0,configurable:!0,writable:!0}):se[de]=_e,se}function U(se,de){if(!(se instanceof de))throw new TypeError("Cannot call a class as a function")}function $(se,de){if(!se)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return de&&(typeof de=="object"||typeof de=="function")?de:se}function Z(se,de){if(typeof de!="function"&&de!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof de);se.prototype=Object.create(de&&de.prototype,{constructor:{value:se,enumerable:!1,writable:!0,configurable:!0}}),de&&(Object.setPrototypeOf?Object.setPrototypeOf(se,de):se.__proto__=de)}var q=(0,v.default)("quill:clipboard"),z="__ql-matcher",W=[[Node.TEXT_NODE,Ie],[Node.TEXT_NODE,ne],["br",te],[Node.ELEMENT_NODE,ne],[Node.ELEMENT_NODE,Q],[Node.ELEMENT_NODE,le],[Node.ELEMENT_NODE,X],[Node.ELEMENT_NODE,Te],["li",ie],["b",Y.bind(Y,"bold")],["i",Y.bind(Y,"italic")],["style",ee]],R=[g.AlignAttribute,O.DirectionAttribute].reduce(function(se,de){return se[de.keyName]=de,se},{}),M=[g.AlignStyle,_.BackgroundStyle,P.ColorStyle,O.DirectionStyle,x.FontStyle,A.SizeStyle].reduce(function(se,de){return se[de.keyName]=de,se},{}),F=function(se){Z(de,se);function de(_e,ve){U(this,de);var re=$(this,(de.__proto__||Object.getPrototypeOf(de)).call(this,_e,ve));return re.quill.root.addEventListener("paste",re.onPaste.bind(re)),re.container=re.quill.addContainer("ql-clipboard"),re.container.setAttribute("contenteditable",!0),re.container.setAttribute("tabindex",-1),re.matchers=[],W.concat(re.options.matchers).forEach(function(ce){var be=o(ce,2),Oe=be[0],$e=be[1];!ve.matchVisual&&$e===le||re.addMatcher(Oe,$e)}),re}return l(de,[{key:"addMatcher",value:function(ve,re){this.matchers.push([ve,re])}},{key:"convert",value:function(ve){if(typeof ve=="string")return this.container.innerHTML=ve.replace(/\>\r?\n +\</g,"><"),this.convert();var re=this.quill.getFormat(this.quill.selection.savedRange.index);if(re[C.default.blotName]){var ce=this.container.innerText;return this.container.innerHTML="",new E.default().insert(ce,I({},C.default.blotName,re[C.default.blotName]))}var be=this.prepareMatching(),Oe=o(be,2),$e=Oe[0],Qe=Oe[1],Ye=B(this.container,$e,Qe);return K(Ye,`
140
+ `)&&Ye.ops[Ye.ops.length-1].attributes==null&&(Ye=Ye.compose(new E.default().retain(Ye.length()-1).delete(1))),q.log("convert",this.container.innerHTML,Ye),this.container.innerHTML="",Ye}},{key:"dangerouslyPasteHTML",value:function(ve,re){var ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:b.default.sources.API;if(typeof ve=="string")this.quill.setContents(this.convert(ve),re),this.quill.setSelection(0,b.default.sources.SILENT);else{var be=this.convert(re);this.quill.updateContents(new E.default().retain(ve).concat(be),ce),this.quill.setSelection(ve+be.length(),b.default.sources.SILENT)}}},{key:"onPaste",value:function(ve){var re=this;if(!(ve.defaultPrevented||!this.quill.isEnabled())){var ce=this.quill.getSelection(),be=new E.default().retain(ce.index),Oe=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(b.default.sources.SILENT),setTimeout(function(){be=be.concat(re.convert()).delete(ce.length),re.quill.updateContents(be,b.default.sources.USER),re.quill.setSelection(be.length()-ce.length,b.default.sources.SILENT),re.quill.scrollingContainer.scrollTop=Oe,re.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var ve=this,re=[],ce=[];return this.matchers.forEach(function(be){var Oe=o(be,2),$e=Oe[0],Qe=Oe[1];switch($e){case Node.TEXT_NODE:ce.push(Qe);break;case Node.ELEMENT_NODE:re.push(Qe);break;default:[].forEach.call(ve.container.querySelectorAll($e),function(Ye){Ye[z]=Ye[z]||[],Ye[z].push(Qe)});break}}),[re,ce]}}]),de}(d.default);F.DEFAULTS={matchers:[],matchVisual:!0};function D(se,de,_e){return(typeof de>"u"?"undefined":a(de))==="object"?Object.keys(de).reduce(function(ve,re){return D(ve,re,de[re])},se):se.reduce(function(ve,re){return re.attributes&&re.attributes[de]?ve.push(re):ve.insert(re.insert,(0,f.default)({},I({},de,_e),re.attributes))},new E.default)}function H(se){if(se.nodeType!==Node.ELEMENT_NODE)return{};var de="__ql-computed-style";return se[de]||(se[de]=window.getComputedStyle(se))}function K(se,de){for(var _e="",ve=se.ops.length-1;ve>=0&&_e.length<de.length;--ve){var re=se.ops[ve];if(typeof re.insert!="string")break;_e=re.insert+_e}return _e.slice(-1*de.length)===de}function G(se){if(se.childNodes.length===0)return!1;var de=H(se);return["block","list-item"].indexOf(de.display)>-1}function B(se,de,_e){return se.nodeType===se.TEXT_NODE?_e.reduce(function(ve,re){return re(se,ve)},new E.default):se.nodeType===se.ELEMENT_NODE?[].reduce.call(se.childNodes||[],function(ve,re){var ce=B(re,de,_e);return re.nodeType===se.ELEMENT_NODE&&(ce=de.reduce(function(be,Oe){return Oe(re,be)},ce),ce=(re[z]||[]).reduce(function(be,Oe){return Oe(re,be)},ce)),ve.concat(ce)},new E.default):new E.default}function Y(se,de,_e){return D(_e,se,!0)}function X(se,de){var _e=p.default.Attributor.Attribute.keys(se),ve=p.default.Attributor.Class.keys(se),re=p.default.Attributor.Style.keys(se),ce={};return _e.concat(ve).concat(re).forEach(function(be){var Oe=p.default.query(be,p.default.Scope.ATTRIBUTE);Oe!=null&&(ce[Oe.attrName]=Oe.value(se),ce[Oe.attrName])||(Oe=R[be],Oe!=null&&(Oe.attrName===be||Oe.keyName===be)&&(ce[Oe.attrName]=Oe.value(se)||void 0),Oe=M[be],Oe!=null&&(Oe.attrName===be||Oe.keyName===be)&&(Oe=M[be],ce[Oe.attrName]=Oe.value(se)||void 0))}),Object.keys(ce).length>0&&(de=D(de,ce)),de}function Q(se,de){var _e=p.default.query(se);if(_e==null)return de;if(_e.prototype instanceof p.default.Embed){var ve={},re=_e.value(se);re!=null&&(ve[_e.blotName]=re,de=new E.default().insert(ve,_e.formats(se)))}else typeof _e.formats=="function"&&(de=D(de,_e.blotName,_e.formats(se)));return de}function te(se,de){return K(de,`
141
+ `)||de.insert(`
142
+ `),de}function ee(){return new E.default}function ie(se,de){var _e=p.default.query(se);if(_e==null||_e.blotName!=="list-item"||!K(de,`
143
+ `))return de;for(var ve=-1,re=se.parentNode;!re.classList.contains("ql-clipboard");)(p.default.query(re)||{}).blotName==="list"&&(ve+=1),re=re.parentNode;return ve<=0?de:de.compose(new E.default().retain(de.length()-1).retain(1,{indent:ve}))}function ne(se,de){return K(de,`
144
+ `)||(G(se)||de.length()>0&&se.nextSibling&&G(se.nextSibling))&&de.insert(`
145
+ `),de}function le(se,de){if(G(se)&&se.nextElementSibling!=null&&!K(de,`
146
+
147
+ `)){var _e=se.offsetHeight+parseFloat(H(se).marginTop)+parseFloat(H(se).marginBottom);se.nextElementSibling.offsetTop>se.offsetTop+_e*1.5&&de.insert(`
148
+ `)}return de}function Te(se,de){var _e={},ve=se.style||{};return ve.fontStyle&&H(se).fontStyle==="italic"&&(_e.italic=!0),ve.fontWeight&&(H(se).fontWeight.startsWith("bold")||parseInt(H(se).fontWeight)>=700)&&(_e.bold=!0),Object.keys(_e).length>0&&(de=D(de,_e)),parseFloat(ve.textIndent||0)>0&&(de=new E.default().insert(" ").concat(de)),de}function Ie(se,de){var _e=se.data;if(se.parentNode.tagName==="O:P")return de.insert(_e.trim());if(_e.trim().length===0&&se.parentNode.classList.contains("ql-clipboard"))return de;if(!H(se.parentNode).whiteSpace.startsWith("pre")){var ve=function(ce,be){return be=be.replace(/[^\u00a0]/g,""),be.length<1&&ce?" ":be};_e=_e.replace(/\r\n/g," ").replace(/\n/g," "),_e=_e.replace(/\s\s+/g,ve.bind(ve,!0)),(se.previousSibling==null&&G(se.parentNode)||se.previousSibling!=null&&G(se.previousSibling))&&(_e=_e.replace(/^\s+/,ve.bind(ve,!1))),(se.nextSibling==null&&G(se.parentNode)||se.nextSibling!=null&&G(se.nextSibling))&&(_e=_e.replace(/\s+$/,ve.bind(ve,!1)))}return de.insert(_e)}n.default=F,n.matchAttributor=X,n.matchBlot=Q,n.matchNewline=ne,n.matchSpacing=le,n.matchText=Ie},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function S(b,y){for(var v=0;v<y.length;v++){var m=y[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(b,m.key,m)}}return function(b,y,v){return y&&S(b.prototype,y),v&&S(b,v),b}}(),o=function S(b,y,v){b===null&&(b=Function.prototype);var m=Object.getOwnPropertyDescriptor(b,y);if(m===void 0){var d=Object.getPrototypeOf(b);return d===null?void 0:S(d,y,v)}else{if("value"in m)return m.value;var g=m.get;return g===void 0?void 0:g.call(v)}},l=i(6),u=f(l);function f(S){return S&&S.__esModule?S:{default:S}}function h(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function E(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function w(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var p=function(S){w(b,S);function b(){return h(this,b),E(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"optimize",value:function(v){o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"optimize",this).call(this,v),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return o(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),b}(u.default);p.blotName="bold",p.tagName=["STRONG","B"],n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var a=function(){function A(L,I){var U=[],$=!0,Z=!1,q=void 0;try{for(var z=L[Symbol.iterator](),W;!($=(W=z.next()).done)&&(U.push(W.value),!(I&&U.length===I));$=!0);}catch(R){Z=!0,q=R}finally{try{!$&&z.return&&z.return()}finally{if(Z)throw q}}return U}return function(L,I){if(Array.isArray(L))return L;if(Symbol.iterator in Object(L))return A(L,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function A(L,I){for(var U=0;U<I.length;U++){var $=I[U];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(L,$.key,$)}}return function(L,I,U){return I&&A(L.prototype,I),U&&A(L,U),L}}(),l=i(2),u=v(l),f=i(0),h=v(f),E=i(5),w=v(E),p=i(10),S=v(p),b=i(9),y=v(b);function v(A){return A&&A.__esModule?A:{default:A}}function m(A,L,I){return L in A?Object.defineProperty(A,L,{value:I,enumerable:!0,configurable:!0,writable:!0}):A[L]=I,A}function d(A,L){if(!(A instanceof L))throw new TypeError("Cannot call a class as a function")}function g(A,L){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:A}function _(A,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);A.prototype=Object.create(L&&L.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(A,L):A.__proto__=L)}var k=(0,S.default)("quill:toolbar"),C=function(A){_(L,A);function L(I,U){d(this,L);var $=g(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,I,U));if(Array.isArray($.options.container)){var Z=document.createElement("div");O(Z,$.options.container),I.container.parentNode.insertBefore(Z,I.container),$.container=Z}else typeof $.options.container=="string"?$.container=document.querySelector($.options.container):$.container=$.options.container;if(!($.container instanceof HTMLElement)){var q;return q=k.error("Container required for toolbar",$.options),g($,q)}return $.container.classList.add("ql-toolbar"),$.controls=[],$.handlers={},Object.keys($.options.handlers).forEach(function(z){$.addHandler(z,$.options.handlers[z])}),[].forEach.call($.container.querySelectorAll("button, select"),function(z){$.attach(z)}),$.quill.on(w.default.events.EDITOR_CHANGE,function(z,W){z===w.default.events.SELECTION_CHANGE&&$.update(W)}),$.quill.on(w.default.events.SCROLL_OPTIMIZE,function(){var z=$.quill.selection.getRange(),W=a(z,1),R=W[0];$.update(R)}),$}return o(L,[{key:"addHandler",value:function(U,$){this.handlers[U]=$}},{key:"attach",value:function(U){var $=this,Z=[].find.call(U.classList,function(z){return z.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){k.warn("ignoring attaching to disabled format",Z,U);return}if(h.default.query(Z)==null){k.warn("ignoring attaching to nonexistent format",Z,U);return}}var q=U.tagName==="SELECT"?"change":"click";U.addEventListener(q,function(z){var W=void 0;if(U.tagName==="SELECT"){if(U.selectedIndex<0)return;var R=U.options[U.selectedIndex];R.hasAttribute("selected")?W=!1:W=R.value||!1}else U.classList.contains("ql-active")?W=!1:W=U.value||!U.hasAttribute("value"),z.preventDefault();$.quill.focus();var M=$.quill.selection.getRange(),F=a(M,1),D=F[0];if($.handlers[Z]!=null)$.handlers[Z].call($,W);else if(h.default.query(Z).prototype instanceof h.default.Embed){if(W=prompt("Enter "+Z),!W)return;$.quill.updateContents(new u.default().retain(D.index).delete(D.length).insert(m({},Z,W)),w.default.sources.USER)}else $.quill.format(Z,W,w.default.sources.USER);$.update(D)}),this.controls.push([Z,U])}}},{key:"update",value:function(U){var $=U==null?{}:this.quill.getFormat(U);this.controls.forEach(function(Z){var q=a(Z,2),z=q[0],W=q[1];if(W.tagName==="SELECT"){var R=void 0;if(U==null)R=null;else if($[z]==null)R=W.querySelector("option[selected]");else if(!Array.isArray($[z])){var M=$[z];typeof M=="string"&&(M=M.replace(/\"/g,'\\"')),R=W.querySelector('option[value="'+M+'"]')}R==null?(W.value="",W.selectedIndex=-1):R.selected=!0}else if(U==null)W.classList.remove("ql-active");else if(W.hasAttribute("value")){var F=$[z]===W.getAttribute("value")||$[z]!=null&&$[z].toString()===W.getAttribute("value")||$[z]==null&&!W.getAttribute("value");W.classList.toggle("ql-active",F)}else W.classList.toggle("ql-active",$[z]!=null)})}}]),L}(y.default);C.DEFAULTS={};function P(A,L,I){var U=document.createElement("button");U.setAttribute("type","button"),U.classList.add("ql-"+L),I!=null&&(U.value=I),A.appendChild(U)}function O(A,L){Array.isArray(L[0])||(L=[L]),L.forEach(function(I){var U=document.createElement("span");U.classList.add("ql-formats"),I.forEach(function($){if(typeof $=="string")P(U,$);else{var Z=Object.keys($)[0],q=$[Z];Array.isArray(q)?x(U,Z,q):P(U,Z,q)}}),A.appendChild(U)})}function x(A,L,I){var U=document.createElement("select");U.classList.add("ql-"+L),I.forEach(function($){var Z=document.createElement("option");$!==!1?Z.setAttribute("value",$):Z.setAttribute("selected","selected"),U.appendChild(Z)}),A.appendChild(U)}C.DEFAULTS={container:null,handlers:{clean:function(){var L=this,I=this.quill.getSelection();if(I!=null)if(I.length==0){var U=this.quill.getFormat();Object.keys(U).forEach(function($){h.default.query($,h.default.Scope.INLINE)!=null&&L.quill.format($,!1)})}else this.quill.removeFormat(I,w.default.sources.USER)},direction:function(L){var I=this.quill.getFormat().align;L==="rtl"&&I==null?this.quill.format("align","right",w.default.sources.USER):!L&&I==="right"&&this.quill.format("align",!1,w.default.sources.USER),this.quill.format("direction",L,w.default.sources.USER)},indent:function(L){var I=this.quill.getSelection(),U=this.quill.getFormat(I),$=parseInt(U.indent||0);if(L==="+1"||L==="-1"){var Z=L==="+1"?1:-1;U.direction==="rtl"&&(Z*=-1),this.quill.format("indent",$+Z,w.default.sources.USER)}},link:function(L){L===!0&&(L=prompt("Enter link URL:")),this.quill.format("link",L,w.default.sources.USER)},list:function(L){var I=this.quill.getSelection(),U=this.quill.getFormat(I);L==="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",L,w.default.sources.USER)}}},n.default=C,n.addControls=O},function(r,n){r.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(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function S(b,y){for(var v=0;v<y.length;v++){var m=y[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(b,m.key,m)}}return function(b,y,v){return y&&S(b.prototype,y),v&&S(b,v),b}}(),o=function S(b,y,v){b===null&&(b=Function.prototype);var m=Object.getOwnPropertyDescriptor(b,y);if(m===void 0){var d=Object.getPrototypeOf(b);return d===null?void 0:S(d,y,v)}else{if("value"in m)return m.value;var g=m.get;return g===void 0?void 0:g.call(v)}},l=i(28),u=f(l);function f(S){return S&&S.__esModule?S:{default:S}}function h(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function E(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function w(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var p=function(S){w(b,S);function b(y,v){h(this,b);var m=E(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,y));return m.label.innerHTML=v,m.container.classList.add("ql-color-picker"),[].slice.call(m.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(d){d.classList.add("ql-primary")}),m}return a(b,[{key:"buildItem",value:function(v){var m=o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"buildItem",this).call(this,v);return m.style.backgroundColor=v.getAttribute("value")||"",m}},{key:"selectItem",value:function(v,m){o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"selectItem",this).call(this,v,m);var d=this.label.querySelector(".ql-color-label"),g=v&&v.getAttribute("data-value")||"";d&&(d.tagName==="line"?d.style.stroke=g:d.style.fill=g)}}]),b}(u.default);n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function S(b,y){for(var v=0;v<y.length;v++){var m=y[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(b,m.key,m)}}return function(b,y,v){return y&&S(b.prototype,y),v&&S(b,v),b}}(),o=function S(b,y,v){b===null&&(b=Function.prototype);var m=Object.getOwnPropertyDescriptor(b,y);if(m===void 0){var d=Object.getPrototypeOf(b);return d===null?void 0:S(d,y,v)}else{if("value"in m)return m.value;var g=m.get;return g===void 0?void 0:g.call(v)}},l=i(28),u=f(l);function f(S){return S&&S.__esModule?S:{default:S}}function h(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function E(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function w(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var p=function(S){w(b,S);function b(y,v){h(this,b);var m=E(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,y));return m.container.classList.add("ql-icon-picker"),[].forEach.call(m.container.querySelectorAll(".ql-picker-item"),function(d){d.innerHTML=v[d.getAttribute("data-value")||""]}),m.defaultItem=m.container.querySelector(".ql-selected"),m.selectItem(m.defaultItem),m}return a(b,[{key:"selectItem",value:function(v,m){o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"selectItem",this).call(this,v,m),v=v||this.defaultItem,this.label.innerHTML=v.innerHTML}}]),b}(u.default);n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(f,h){for(var E=0;E<h.length;E++){var w=h[E];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(f,w.key,w)}}return function(f,h,E){return h&&u(f.prototype,h),E&&u(f,E),f}}();function o(u,f){if(!(u instanceof f))throw new TypeError("Cannot call a class as a function")}var l=function(){function u(f,h){var E=this;o(this,u),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(){E.root.style.marginTop=-1*E.quill.root.scrollTop+"px"}),this.hide()}return a(u,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(h){var E=h.left+h.width/2-this.root.offsetWidth/2,w=h.bottom+this.quill.root.scrollTop;this.root.style.left=E+"px",this.root.style.top=w+"px",this.root.classList.remove("ql-flip");var p=this.boundsContainer.getBoundingClientRect(),S=this.root.getBoundingClientRect(),b=0;if(S.right>p.right&&(b=p.right-S.right,this.root.style.left=E+b+"px"),S.left<p.left&&(b=p.left-S.left,this.root.style.left=E+b+"px"),S.bottom>p.bottom){var y=S.bottom-S.top,v=h.bottom-h.top+y;this.root.style.top=w-v+"px",this.root.classList.add("ql-flip")}return b}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),u}();n.default=l},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function x(A,L){var I=[],U=!0,$=!1,Z=void 0;try{for(var q=A[Symbol.iterator](),z;!(U=(z=q.next()).done)&&(I.push(z.value),!(L&&I.length===L));U=!0);}catch(W){$=!0,Z=W}finally{try{!U&&q.return&&q.return()}finally{if($)throw Z}}return I}return function(A,L){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return x(A,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function x(A,L,I){A===null&&(A=Function.prototype);var U=Object.getOwnPropertyDescriptor(A,L);if(U===void 0){var $=Object.getPrototypeOf(A);return $===null?void 0:x($,L,I)}else{if("value"in U)return U.value;var Z=U.get;return Z===void 0?void 0:Z.call(I)}},l=function(){function x(A,L){for(var I=0;I<L.length;I++){var U=L[I];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(A,U.key,U)}}return function(A,L,I){return L&&x(A.prototype,L),I&&x(A,I),A}}(),u=i(3),f=d(u),h=i(8),E=d(h),w=i(43),p=d(w),S=i(27),b=d(S),y=i(15),v=i(41),m=d(v);function d(x){return x&&x.__esModule?x:{default:x}}function g(x,A){if(!(x instanceof A))throw new TypeError("Cannot call a class as a function")}function _(x,A){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:x}function k(x,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);x.prototype=Object.create(A&&A.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(x,A):x.__proto__=A)}var C=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],P=function(x){k(A,x);function A(L,I){g(this,A),I.modules.toolbar!=null&&I.modules.toolbar.container==null&&(I.modules.toolbar.container=C);var U=_(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,L,I));return U.quill.container.classList.add("ql-snow"),U}return l(A,[{key:"extendToolbar",value:function(I){I.container.classList.add("ql-snow"),this.buildButtons([].slice.call(I.container.querySelectorAll("button")),m.default),this.buildPickers([].slice.call(I.container.querySelectorAll("select")),m.default),this.tooltip=new O(this.quill,this.options.bounds),I.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(U,$){I.handlers.link.call(I,!$.format.link)})}}]),A}(p.default);P.DEFAULTS=(0,f.default)(!0,{},p.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(A){if(A){var L=this.quill.getSelection();if(L==null||L.length==0)return;var I=this.quill.getText(L);/^\S+@\S+\.\S+$/.test(I)&&I.indexOf("mailto:")!==0&&(I="mailto:"+I);var U=this.quill.theme.tooltip;U.edit("link",I)}else this.quill.format("link",!1)}}}}});var O=function(x){k(A,x);function A(L,I){g(this,A);var U=_(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,L,I));return U.preview=U.root.querySelector("a.ql-preview"),U}return l(A,[{key:"listen",value:function(){var I=this;o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(U){I.root.classList.contains("ql-editing")?I.save():I.edit("link",I.preview.textContent),U.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(U){if(I.linkRange!=null){var $=I.linkRange;I.restoreFocus(),I.quill.formatText($,"link",!1,E.default.sources.USER),delete I.linkRange}U.preventDefault(),I.hide()}),this.quill.on(E.default.events.SELECTION_CHANGE,function(U,$,Z){if(U!=null){if(U.length===0&&Z===E.default.sources.USER){var q=I.quill.scroll.descendant(b.default,U.index),z=a(q,2),W=z[0],R=z[1];if(W!=null){I.linkRange=new y.Range(U.index-R,W.length());var M=b.default.formats(W.domNode);I.preview.textContent=M,I.preview.setAttribute("href",M),I.show(),I.position(I.quill.getBounds(I.linkRange));return}}else delete I.linkRange;I.hide()}})}},{key:"show",value:function(){o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),A}(w.BaseTooltip);O.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(""),n.default=P},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(29),o=re(a),l=i(36),u=i(38),f=i(64),h=i(65),E=re(h),w=i(66),p=re(w),S=i(67),b=re(S),y=i(37),v=i(26),m=i(39),d=i(40),g=i(56),_=re(g),k=i(68),C=re(k),P=i(27),O=re(P),x=i(69),A=re(x),L=i(70),I=re(L),U=i(71),$=re(U),Z=i(72),q=re(Z),z=i(73),W=re(z),R=i(13),M=re(R),F=i(74),D=re(F),H=i(75),K=re(H),G=i(57),B=re(G),Y=i(41),X=re(Y),Q=i(28),te=re(Q),ee=i(59),ie=re(ee),ne=i(60),le=re(ne),Te=i(61),Ie=re(Te),se=i(108),de=re(se),_e=i(62),ve=re(_e);function re(ce){return ce&&ce.__esModule?ce:{default:ce}}o.default.register({"attributors/attribute/direction":u.DirectionAttribute,"attributors/class/align":l.AlignClass,"attributors/class/background":y.BackgroundClass,"attributors/class/color":v.ColorClass,"attributors/class/direction":u.DirectionClass,"attributors/class/font":m.FontClass,"attributors/class/size":d.SizeClass,"attributors/style/align":l.AlignStyle,"attributors/style/background":y.BackgroundStyle,"attributors/style/color":v.ColorStyle,"attributors/style/direction":u.DirectionStyle,"attributors/style/font":m.FontStyle,"attributors/style/size":d.SizeStyle},!0),o.default.register({"formats/align":l.AlignClass,"formats/direction":u.DirectionClass,"formats/indent":f.IndentClass,"formats/background":y.BackgroundStyle,"formats/color":v.ColorStyle,"formats/font":m.FontClass,"formats/size":d.SizeClass,"formats/blockquote":E.default,"formats/code-block":M.default,"formats/header":p.default,"formats/list":b.default,"formats/bold":_.default,"formats/code":R.Code,"formats/italic":C.default,"formats/link":O.default,"formats/script":A.default,"formats/strike":I.default,"formats/underline":$.default,"formats/image":q.default,"formats/video":W.default,"formats/list/item":S.ListItem,"modules/formula":D.default,"modules/syntax":K.default,"modules/toolbar":B.default,"themes/bubble":de.default,"themes/snow":ve.default,"ui/icons":X.default,"ui/picker":te.default,"ui/icon-picker":le.default,"ui/color-picker":ie.default,"ui/tooltip":Ie.default},!0),n.default=o.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.IndentClass=void 0;var a=function(){function b(y,v){for(var m=0;m<v.length;m++){var d=v[m];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(y,d.key,d)}}return function(y,v,m){return v&&b(y.prototype,v),m&&b(y,m),y}}(),o=function b(y,v,m){y===null&&(y=Function.prototype);var d=Object.getOwnPropertyDescriptor(y,v);if(d===void 0){var g=Object.getPrototypeOf(y);return g===null?void 0:b(g,v,m)}else{if("value"in d)return d.value;var _=d.get;return _===void 0?void 0:_.call(m)}},l=i(0),u=f(l);function f(b){return b&&b.__esModule?b:{default:b}}function h(b,y){if(!(b instanceof y))throw new TypeError("Cannot call a class as a function")}function E(b,y){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:b}function w(b,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);b.prototype=Object.create(y&&y.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(b,y):b.__proto__=y)}var p=function(b){w(y,b);function y(){return h(this,y),E(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,[{key:"add",value:function(m,d){if(d==="+1"||d==="-1"){var g=this.value(m)||0;d=d==="+1"?g+1:g-1}return d===0?(this.remove(m),!0):o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"add",this).call(this,m,d)}},{key:"canAdd",value:function(m,d){return o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"canAdd",this).call(this,m,d)||o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"canAdd",this).call(this,m,parseInt(d))}},{key:"value",value:function(m){return parseInt(o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"value",this).call(this,m))||void 0}}]),y}(u.default.Attributor.Class),S=new p("indent","ql-indent",{scope:u.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});n.IndentClass=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(4),o=l(a);function l(w){return w&&w.__esModule?w:{default:w}}function u(w,p){if(!(w instanceof p))throw new TypeError("Cannot call a class as a function")}function f(w,p){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:w}function h(w,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);w.prototype=Object.create(p&&p.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(w,p):w.__proto__=p)}var E=function(w){h(p,w);function p(){return u(this,p),f(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(o.default);E.blotName="blockquote",E.tagName="blockquote",n.default=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function p(S,b){for(var y=0;y<b.length;y++){var v=b[y];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(S,v.key,v)}}return function(S,b,y){return b&&p(S.prototype,b),y&&p(S,y),S}}(),o=i(4),l=u(o);function u(p){return p&&p.__esModule?p:{default:p}}function f(p,S){if(!(p instanceof S))throw new TypeError("Cannot call a class as a function")}function h(p,S){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:p}function E(p,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);p.prototype=Object.create(S&&S.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(p,S):p.__proto__=S)}var w=function(p){E(S,p);function S(){return f(this,S),h(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return a(S,null,[{key:"formats",value:function(y){return this.tagName.indexOf(y.tagName)+1}}]),S}(l.default);w.blotName="header",w.tagName=["H1","H2","H3","H4","H5","H6"],n.default=w},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var a=function(){function g(_,k){for(var C=0;C<k.length;C++){var P=k[C];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(_,P.key,P)}}return function(_,k,C){return k&&g(_.prototype,k),C&&g(_,C),_}}(),o=function g(_,k,C){_===null&&(_=Function.prototype);var P=Object.getOwnPropertyDescriptor(_,k);if(P===void 0){var O=Object.getPrototypeOf(_);return O===null?void 0:g(O,k,C)}else{if("value"in P)return P.value;var x=P.get;return x===void 0?void 0:x.call(C)}},l=i(0),u=p(l),f=i(4),h=p(f),E=i(25),w=p(E);function p(g){return g&&g.__esModule?g:{default:g}}function S(g,_,k){return _ in g?Object.defineProperty(g,_,{value:k,enumerable:!0,configurable:!0,writable:!0}):g[_]=k,g}function b(g,_){if(!(g instanceof _))throw new TypeError("Cannot call a class as a function")}function y(g,_){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:g}function v(g,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);g.prototype=Object.create(_&&_.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(g,_):g.__proto__=_)}var m=function(g){v(_,g);function _(){return b(this,_),y(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,[{key:"format",value:function(C,P){C===d.blotName&&!P?this.replaceWith(u.default.create(this.statics.scope)):o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"format",this).call(this,C,P)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(C,P){return this.parent.isolate(this.offset(this.parent),this.length()),C===this.parent.statics.blotName?(this.parent.replaceWith(C,P),this):(this.parent.unwrap(),o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"replaceWith",this).call(this,C,P))}}],[{key:"formats",value:function(C){return C.tagName===this.tagName?void 0:o(_.__proto__||Object.getPrototypeOf(_),"formats",this).call(this,C)}}]),_}(h.default);m.blotName="list-item",m.tagName="LI";var d=function(g){v(_,g),a(_,null,[{key:"create",value:function(C){var P=C==="ordered"?"OL":"UL",O=o(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this,P);return(C==="checked"||C==="unchecked")&&O.setAttribute("data-checked",C==="checked"),O}},{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 _(k){b(this,_);var C=y(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,k)),P=function(x){if(x.target.parentNode===k){var A=C.statics.formats(k),L=u.default.find(x.target);A==="checked"?L.format("list","unchecked"):A==="unchecked"&&L.format("list","checked")}};return k.addEventListener("touchstart",P),k.addEventListener("mousedown",P),C}return a(_,[{key:"format",value:function(C,P){this.children.length>0&&this.children.tail.format(C,P)}},{key:"formats",value:function(){return S({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(C,P){if(C instanceof m)o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"insertBefore",this).call(this,C,P);else{var O=P==null?this.length():P.offset(this),x=this.split(O);x.parent.insertBefore(C,x)}}},{key:"optimize",value:function(C){o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"optimize",this).call(this,C);var P=this.next;P!=null&&P.prev===this&&P.statics.blotName===this.statics.blotName&&P.domNode.tagName===this.domNode.tagName&&P.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(P.moveChildren(this),P.remove())}},{key:"replace",value:function(C){if(C.statics.blotName!==this.statics.blotName){var P=u.default.create(this.statics.defaultChild);C.moveChildren(P),this.appendChild(P)}o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"replace",this).call(this,C)}}]),_}(w.default);d.blotName="list",d.scope=u.default.Scope.BLOCK_BLOT,d.tagName=["OL","UL"],d.defaultChild="list-item",d.allowedChildren=[m],n.ListItem=m,n.default=d},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(56),o=l(a);function l(w){return w&&w.__esModule?w:{default:w}}function u(w,p){if(!(w instanceof p))throw new TypeError("Cannot call a class as a function")}function f(w,p){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:w}function h(w,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);w.prototype=Object.create(p&&p.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(w,p):w.__proto__=p)}var E=function(w){h(p,w);function p(){return u(this,p),f(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(o.default);E.blotName="italic",E.tagName=["EM","I"],n.default=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function S(b,y){for(var v=0;v<y.length;v++){var m=y[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(b,m.key,m)}}return function(b,y,v){return y&&S(b.prototype,y),v&&S(b,v),b}}(),o=function S(b,y,v){b===null&&(b=Function.prototype);var m=Object.getOwnPropertyDescriptor(b,y);if(m===void 0){var d=Object.getPrototypeOf(b);return d===null?void 0:S(d,y,v)}else{if("value"in m)return m.value;var g=m.get;return g===void 0?void 0:g.call(v)}},l=i(6),u=f(l);function f(S){return S&&S.__esModule?S:{default:S}}function h(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function E(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function w(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var p=function(S){w(b,S);function b(){return h(this,b),E(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,null,[{key:"create",value:function(v){return v==="super"?document.createElement("sup"):v==="sub"?document.createElement("sub"):o(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,v)}},{key:"formats",value:function(v){if(v.tagName==="SUB")return"sub";if(v.tagName==="SUP")return"super"}}]),b}(u.default);p.blotName="script",p.tagName=["SUB","SUP"],n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(6),o=l(a);function l(w){return w&&w.__esModule?w:{default:w}}function u(w,p){if(!(w instanceof p))throw new TypeError("Cannot call a class as a function")}function f(w,p){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:w}function h(w,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);w.prototype=Object.create(p&&p.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(w,p):w.__proto__=p)}var E=function(w){h(p,w);function p(){return u(this,p),f(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(o.default);E.blotName="strike",E.tagName="S",n.default=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(6),o=l(a);function l(w){return w&&w.__esModule?w:{default:w}}function u(w,p){if(!(w instanceof p))throw new TypeError("Cannot call a class as a function")}function f(w,p){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:w}function h(w,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);w.prototype=Object.create(p&&p.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(w,p):w.__proto__=p)}var E=function(w){h(p,w);function p(){return u(this,p),f(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(o.default);E.blotName="underline",E.tagName="U",n.default=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function y(v,m){for(var d=0;d<m.length;d++){var g=m[d];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(v,g.key,g)}}return function(v,m,d){return m&&y(v.prototype,m),d&&y(v,d),v}}(),o=function y(v,m,d){v===null&&(v=Function.prototype);var g=Object.getOwnPropertyDescriptor(v,m);if(g===void 0){var _=Object.getPrototypeOf(v);return _===null?void 0:y(_,m,d)}else{if("value"in g)return g.value;var k=g.get;return k===void 0?void 0:k.call(d)}},l=i(0),u=h(l),f=i(27);function h(y){return y&&y.__esModule?y:{default:y}}function E(y,v){if(!(y instanceof v))throw new TypeError("Cannot call a class as a function")}function w(y,v){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:y}function p(y,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);y.prototype=Object.create(v&&v.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(y,v):y.__proto__=v)}var S=["alt","height","width"],b=function(y){p(v,y);function v(){return E(this,v),w(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return a(v,[{key:"format",value:function(d,g){S.indexOf(d)>-1?g?this.domNode.setAttribute(d,g):this.domNode.removeAttribute(d):o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"format",this).call(this,d,g)}}],[{key:"create",value:function(d){var g=o(v.__proto__||Object.getPrototypeOf(v),"create",this).call(this,d);return typeof d=="string"&&g.setAttribute("src",this.sanitize(d)),g}},{key:"formats",value:function(d){return S.reduce(function(g,_){return d.hasAttribute(_)&&(g[_]=d.getAttribute(_)),g},{})}},{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")}}]),v}(u.default.Embed);b.blotName="image",b.tagName="IMG",n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function y(v,m){for(var d=0;d<m.length;d++){var g=m[d];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(v,g.key,g)}}return function(v,m,d){return m&&y(v.prototype,m),d&&y(v,d),v}}(),o=function y(v,m,d){v===null&&(v=Function.prototype);var g=Object.getOwnPropertyDescriptor(v,m);if(g===void 0){var _=Object.getPrototypeOf(v);return _===null?void 0:y(_,m,d)}else{if("value"in g)return g.value;var k=g.get;return k===void 0?void 0:k.call(d)}},l=i(4),u=i(27),f=h(u);function h(y){return y&&y.__esModule?y:{default:y}}function E(y,v){if(!(y instanceof v))throw new TypeError("Cannot call a class as a function")}function w(y,v){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:y}function p(y,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);y.prototype=Object.create(v&&v.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(y,v):y.__proto__=v)}var S=["height","width"],b=function(y){p(v,y);function v(){return E(this,v),w(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return a(v,[{key:"format",value:function(d,g){S.indexOf(d)>-1?g?this.domNode.setAttribute(d,g):this.domNode.removeAttribute(d):o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"format",this).call(this,d,g)}}],[{key:"create",value:function(d){var g=o(v.__proto__||Object.getPrototypeOf(v),"create",this).call(this,d);return g.setAttribute("frameborder","0"),g.setAttribute("allowfullscreen",!0),g.setAttribute("src",this.sanitize(d)),g}},{key:"formats",value:function(d){return S.reduce(function(g,_){return d.hasAttribute(_)&&(g[_]=d.getAttribute(_)),g},{})}},{key:"sanitize",value:function(d){return f.default.sanitize(d)}},{key:"value",value:function(d){return d.getAttribute("src")}}]),v}(l.BlockEmbed);b.blotName="video",b.className="ql-video",b.tagName="IFRAME",n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.FormulaBlot=void 0;var a=function(){function d(g,_){for(var k=0;k<_.length;k++){var C=_[k];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(g,C.key,C)}}return function(g,_,k){return _&&d(g.prototype,_),k&&d(g,k),g}}(),o=function d(g,_,k){g===null&&(g=Function.prototype);var C=Object.getOwnPropertyDescriptor(g,_);if(C===void 0){var P=Object.getPrototypeOf(g);return P===null?void 0:d(P,_,k)}else{if("value"in C)return C.value;var O=C.get;return O===void 0?void 0:O.call(k)}},l=i(35),u=p(l),f=i(5),h=p(f),E=i(9),w=p(E);function p(d){return d&&d.__esModule?d:{default:d}}function S(d,g){if(!(d instanceof g))throw new TypeError("Cannot call a class as a function")}function b(d,g){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:d}function y(d,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);d.prototype=Object.create(g&&g.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(d,g):d.__proto__=g)}var v=function(d){y(g,d);function g(){return S(this,g),b(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return a(g,null,[{key:"create",value:function(k){var C=o(g.__proto__||Object.getPrototypeOf(g),"create",this).call(this,k);return typeof k=="string"&&(window.katex.render(k,C,{throwOnError:!1,errorColor:"#f00"}),C.setAttribute("data-value",k)),C}},{key:"value",value:function(k){return k.getAttribute("data-value")}}]),g}(u.default);v.blotName="formula",v.className="ql-formula",v.tagName="SPAN";var m=function(d){y(g,d),a(g,null,[{key:"register",value:function(){h.default.register(v,!0)}}]);function g(){S(this,g);var _=b(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return _}return g}(w.default);n.FormulaBlot=v,n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var a=function(){function k(C,P){for(var O=0;O<P.length;O++){var x=P[O];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(C,x.key,x)}}return function(C,P,O){return P&&k(C.prototype,P),O&&k(C,O),C}}(),o=function k(C,P,O){C===null&&(C=Function.prototype);var x=Object.getOwnPropertyDescriptor(C,P);if(x===void 0){var A=Object.getPrototypeOf(C);return A===null?void 0:k(A,P,O)}else{if("value"in x)return x.value;var L=x.get;return L===void 0?void 0:L.call(O)}},l=i(0),u=b(l),f=i(5),h=b(f),E=i(9),w=b(E),p=i(13),S=b(p);function b(k){return k&&k.__esModule?k:{default:k}}function y(k,C){if(!(k instanceof C))throw new TypeError("Cannot call a class as a function")}function v(k,C){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:k}function m(k,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);k.prototype=Object.create(C&&C.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(k,C):k.__proto__=C)}var d=function(k){m(C,k);function C(){return y(this,C),v(this,(C.__proto__||Object.getPrototypeOf(C)).apply(this,arguments))}return a(C,[{key:"replaceWith",value:function(O){this.domNode.textContent=this.domNode.textContent,this.attach(),o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"replaceWith",this).call(this,O)}},{key:"highlight",value:function(O){var x=this.domNode.textContent;this.cachedText!==x&&((x.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=O(x),this.domNode.normalize(),this.attach()),this.cachedText=x)}}]),C}(S.default);d.className="ql-syntax";var g=new u.default.Attributor.Class("token","hljs",{scope:u.default.Scope.INLINE}),_=function(k){m(C,k),a(C,null,[{key:"register",value:function(){h.default.register(g,!0),h.default.register(d,!0)}}]);function C(P,O){y(this,C);var x=v(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,P,O));if(typeof x.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var A=null;return x.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(A),A=setTimeout(function(){x.highlight(),A=null},x.options.interval)}),x.highlight(),x}return a(C,[{key:"highlight",value:function(){var O=this;if(!this.quill.selection.composing){this.quill.update(h.default.sources.USER);var x=this.quill.getSelection();this.quill.scroll.descendants(d).forEach(function(A){A.highlight(O.options.highlight)}),this.quill.update(h.default.sources.SILENT),x!=null&&this.quill.setSelection(x,h.default.sources.SILENT)}}}]),C}(w.default);_.DEFAULTS={highlight:function(){return window.hljs==null?null:function(k){var C=window.hljs.highlightAuto(k);return C.value}}(),interval:1e3},n.CodeBlock=d,n.CodeToken=g,n.default=_},function(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n){r.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(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BubbleTooltip=void 0;var a=function C(P,O,x){P===null&&(P=Function.prototype);var A=Object.getOwnPropertyDescriptor(P,O);if(A===void 0){var L=Object.getPrototypeOf(P);return L===null?void 0:C(L,O,x)}else{if("value"in A)return A.value;var I=A.get;return I===void 0?void 0:I.call(x)}},o=function(){function C(P,O){for(var x=0;x<O.length;x++){var A=O[x];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(P,A.key,A)}}return function(P,O,x){return O&&C(P.prototype,O),x&&C(P,x),P}}(),l=i(3),u=y(l),f=i(8),h=y(f),E=i(43),w=y(E),p=i(15),S=i(41),b=y(S);function y(C){return C&&C.__esModule?C:{default:C}}function v(C,P){if(!(C instanceof P))throw new TypeError("Cannot call a class as a function")}function m(C,P){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:C}function d(C,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);C.prototype=Object.create(P&&P.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(C,P):C.__proto__=P)}var g=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],_=function(C){d(P,C);function P(O,x){v(this,P),x.modules.toolbar!=null&&x.modules.toolbar.container==null&&(x.modules.toolbar.container=g);var A=m(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,O,x));return A.quill.container.classList.add("ql-bubble"),A}return o(P,[{key:"extendToolbar",value:function(x){this.tooltip=new k(this.quill,this.options.bounds),this.tooltip.root.appendChild(x.container),this.buildButtons([].slice.call(x.container.querySelectorAll("button")),b.default),this.buildPickers([].slice.call(x.container.querySelectorAll("select")),b.default)}}]),P}(w.default);_.DEFAULTS=(0,u.default)(!0,{},w.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(P){P?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var k=function(C){d(P,C);function P(O,x){v(this,P);var A=m(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,O,x));return A.quill.on(h.default.events.EDITOR_CHANGE,function(L,I,U,$){if(L===h.default.events.SELECTION_CHANGE)if(I!=null&&I.length>0&&$===h.default.sources.USER){A.show(),A.root.style.left="0px",A.root.style.width="",A.root.style.width=A.root.offsetWidth+"px";var Z=A.quill.getLines(I.index,I.length);if(Z.length===1)A.position(A.quill.getBounds(I));else{var q=Z[Z.length-1],z=A.quill.getIndex(q),W=Math.min(q.length()-1,I.index+I.length-z),R=A.quill.getBounds(new p.Range(z,W));A.position(R)}}else document.activeElement!==A.textbox&&A.quill.hasFocus()&&A.hide()}),A}return o(P,[{key:"listen",value:function(){var x=this;a(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){x.root.classList.remove("ql-editing")}),this.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!x.root.classList.contains("ql-hidden")){var A=x.quill.getSelection();A!=null&&x.position(x.quill.getBounds(A))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(x){var A=a(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"position",this).call(this,x),L=this.root.querySelector(".ql-tooltip-arrow");if(L.style.marginLeft="",A===0)return A;L.style.marginLeft=-1*A-L.offsetWidth/2+"px"}}]),P}(E.BaseTooltip);k.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(""),n.BubbleTooltip=k,n.default=_},function(r,n,i){r.exports=i(63)}]).default})})(iS);var PD=iS.exports,p2={},aS={exports:{}},Ho={},Fu={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */Fu.exports;var N4;function CD(){return N4||(N4=1,function(e,t){(function(r){var n=t&&!t.nodeType&&t,i=e&&!e.nodeType&&e,a=typeof me=="object"&&me;(a.global===a||a.window===a||a.self===a)&&(r=a);var o,l=2147483647,u=36,f=1,h=26,E=38,w=700,p=72,S=128,b="-",y=/^xn--/,v=/[^\x20-\x7E]/,m=/[\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"},g=u-f,_=Math.floor,k=String.fromCharCode,C;function P(R){throw new RangeError(d[R])}function O(R,M){for(var F=R.length,D=[];F--;)D[F]=M(R[F]);return D}function x(R,M){var F=R.split("@"),D="";F.length>1&&(D=F[0]+"@",R=F[1]),R=R.replace(m,".");var H=R.split("."),K=O(H,M).join(".");return D+K}function A(R){for(var M=[],F=0,D=R.length,H,K;F<D;)H=R.charCodeAt(F++),H>=55296&&H<=56319&&F<D?(K=R.charCodeAt(F++),(K&64512)==56320?M.push(((H&1023)<<10)+(K&1023)+65536):(M.push(H),F--)):M.push(H);return M}function L(R){return O(R,function(M){var F="";return M>65535&&(M-=65536,F+=k(M>>>10&1023|55296),M=56320|M&1023),F+=k(M),F}).join("")}function I(R){return R-48<10?R-22:R-65<26?R-65:R-97<26?R-97:u}function U(R,M){return R+22+75*(R<26)-((M!=0)<<5)}function $(R,M,F){var D=0;for(R=F?_(R/w):R>>1,R+=_(R/M);R>g*h>>1;D+=u)R=_(R/g);return _(D+(g+1)*R/(R+E))}function Z(R){var M=[],F=R.length,D,H=0,K=S,G=p,B,Y,X,Q,te,ee,ie,ne,le;for(B=R.lastIndexOf(b),B<0&&(B=0),Y=0;Y<B;++Y)R.charCodeAt(Y)>=128&&P("not-basic"),M.push(R.charCodeAt(Y));for(X=B>0?B+1:0;X<F;){for(Q=H,te=1,ee=u;X>=F&&P("invalid-input"),ie=I(R.charCodeAt(X++)),(ie>=u||ie>_((l-H)/te))&&P("overflow"),H+=ie*te,ne=ee<=G?f:ee>=G+h?h:ee-G,!(ie<ne);ee+=u)le=u-ne,te>_(l/le)&&P("overflow"),te*=le;D=M.length+1,G=$(H-Q,D,Q==0),_(H/D)>l-K&&P("overflow"),K+=_(H/D),H%=D,M.splice(H++,0,K)}return L(M)}function q(R){var M,F,D,H,K,G,B,Y,X,Q,te,ee=[],ie,ne,le,Te;for(R=A(R),ie=R.length,M=S,F=0,K=p,G=0;G<ie;++G)te=R[G],te<128&&ee.push(k(te));for(D=H=ee.length,H&&ee.push(b);D<ie;){for(B=l,G=0;G<ie;++G)te=R[G],te>=M&&te<B&&(B=te);for(ne=D+1,B-M>_((l-F)/ne)&&P("overflow"),F+=(B-M)*ne,M=B,G=0;G<ie;++G)if(te=R[G],te<M&&++F>l&&P("overflow"),te==M){for(Y=F,X=u;Q=X<=K?f:X>=K+h?h:X-K,!(Y<Q);X+=u)Te=Y-Q,le=u-Q,ee.push(k(U(Q+Te%le,0))),Y=_(Te/le);ee.push(k(U(Y,0))),K=$(F,ne,D==H),F=0,++D}++F,++M}return ee.join("")}function z(R){return x(R,function(M){return y.test(M)?Z(M.slice(4).toLowerCase()):M})}function W(R){return x(R,function(M){return v.test(M)?"xn--"+q(M):M})}if(o={version:"1.4.1",ucs2:{decode:A,encode:L},decode:Z,encode:q,toASCII:W,toUnicode:z},n&&i)if(e.exports==n)i.exports=o;else for(C in o)o.hasOwnProperty(C)&&(n[C]=o[C]);else r.punycode=o})(me)}(Fu,Fu.exports)),Fu.exports}var ag,I4;function kD(){return I4||(I4=1,ag=Error),ag}var og,D4;function TD(){return D4||(D4=1,og=EvalError),og}var lg,j4;function AD(){return j4||(j4=1,lg=RangeError),lg}var sg,F4;function RD(){return F4||(F4=1,sg=ReferenceError),sg}var ug,z4;function oS(){return z4||(z4=1,ug=SyntaxError),ug}var cg,B4;function Xc(){return B4||(B4=1,cg=TypeError),cg}var fg,U4;function MD(){return U4||(U4=1,fg=URIError),fg}var dg,H4;function LD(){return H4||(H4=1,dg=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(r in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var a=Object.getOwnPropertySymbols(t);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(t,r);if(o.value!==i||o.enumerable!==!0)return!1}return!0}),dg}var hg,$4;function ND(){if($4)return hg;$4=1;var e=typeof Symbol<"u"&&Symbol,t=LD();return hg=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},hg}var pg,G4;function ID(){if(G4)return pg;G4=1;var e={__proto__:null,foo:{}},t=Object;return pg=function(){return{__proto__:e}.foo===e.foo&&!(e instanceof t)},pg}var gg,V4;function DD(){if(V4)return gg;V4=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(u,f){for(var h=[],E=0;E<u.length;E+=1)h[E]=u[E];for(var w=0;w<f.length;w+=1)h[w+u.length]=f[w];return h},a=function(u,f){for(var h=[],E=f,w=0;E<u.length;E+=1,w+=1)h[w]=u[E];return h},o=function(l,u){for(var f="",h=0;h<l.length;h+=1)f+=l[h],h+1<l.length&&(f+=u);return f};return gg=function(u){var f=this;if(typeof f!="function"||t.apply(f)!==n)throw new TypeError(e+f);for(var h=a(arguments,1),E,w=function(){if(this instanceof E){var v=f.apply(this,i(h,arguments));return Object(v)===v?v:this}return f.apply(u,i(h,arguments))},p=r(0,f.length-h.length),S=[],b=0;b<p;b++)S[b]="$"+b;if(E=Function("binder","return function ("+o(S,",")+"){ return binder.apply(this,arguments); }")(w),f.prototype){var y=function(){};y.prototype=f.prototype,E.prototype=new y,y.prototype=null}return E},gg}var vg,q4;function g2(){if(q4)return vg;q4=1;var e=DD();return vg=Function.prototype.bind||e,vg}var mg,W4;function jD(){if(W4)return mg;W4=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=g2();return mg=r.call(e,t),mg}var yg,K4;function Js(){if(K4)return yg;K4=1;var e,t=kD(),r=TD(),n=AD(),i=RD(),a=oS(),o=Xc(),l=MD(),u=Function,f=function(q){try{return u('"use strict"; return ('+q+").constructor;")()}catch{}},h=Object.getOwnPropertyDescriptor;if(h)try{h({},"")}catch{h=null}var E=function(){throw new o},w=h?function(){try{return arguments.callee,E}catch{try{return h(arguments,"callee").get}catch{return E}}}():E,p=ND()(),S=ID()(),b=Object.getPrototypeOf||(S?function(q){return q.__proto__}:null),y={},v=typeof Uint8Array>"u"||!b?e:b(Uint8Array),m={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":p&&b?b([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":y,"%AsyncGenerator%":y,"%AsyncGeneratorFunction%":y,"%AsyncIteratorPrototype%":y,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":r,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":u,"%GeneratorFunction%":y,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":p&&b?b(b([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!p||!b?e:b(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":n,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!p||!b?e:b(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":p&&b?b(""[Symbol.iterator]()):e,"%Symbol%":p?Symbol:e,"%SyntaxError%":a,"%ThrowTypeError%":w,"%TypedArray%":v,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet};if(b)try{null.error}catch(q){var d=b(b(q));m["%Error.prototype%"]=d}var g=function q(z){var W;if(z==="%AsyncFunction%")W=f("async function () {}");else if(z==="%GeneratorFunction%")W=f("function* () {}");else if(z==="%AsyncGeneratorFunction%")W=f("async function* () {}");else if(z==="%AsyncGenerator%"){var R=q("%AsyncGeneratorFunction%");R&&(W=R.prototype)}else if(z==="%AsyncIteratorPrototype%"){var M=q("%AsyncGenerator%");M&&b&&(W=b(M.prototype))}return m[z]=W,W},_={__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"]},k=g2(),C=jD(),P=k.call(Function.call,Array.prototype.concat),O=k.call(Function.apply,Array.prototype.splice),x=k.call(Function.call,String.prototype.replace),A=k.call(Function.call,String.prototype.slice),L=k.call(Function.call,RegExp.prototype.exec),I=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,U=/\\(\\)?/g,$=function(z){var W=A(z,0,1),R=A(z,-1);if(W==="%"&&R!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(R==="%"&&W!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var M=[];return x(z,I,function(F,D,H,K){M[M.length]=H?x(K,U,"$1"):D||F}),M},Z=function(z,W){var R=z,M;if(C(_,R)&&(M=_[R],R="%"+M[0]+"%"),C(m,R)){var F=m[R];if(F===y&&(F=g(R)),typeof F>"u"&&!W)throw new o("intrinsic "+z+" exists, but is not available. Please file an issue!");return{alias:M,name:R,value:F}}throw new a("intrinsic "+z+" does not exist!")};return yg=function(z,W){if(typeof z!="string"||z.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof W!="boolean")throw new o('"allowMissing" argument must be a boolean');if(L(/^%?[^%]*%?$/,z)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var R=$(z),M=R.length>0?R[0]:"",F=Z("%"+M+"%",W),D=F.name,H=F.value,K=!1,G=F.alias;G&&(M=G[0],O(R,P([0,1],G)));for(var B=1,Y=!0;B<R.length;B+=1){var X=R[B],Q=A(X,0,1),te=A(X,-1);if((Q==='"'||Q==="'"||Q==="`"||te==='"'||te==="'"||te==="`")&&Q!==te)throw new a("property names with quotes must have matching quotes");if((X==="constructor"||!Y)&&(K=!0),M+="."+X,D="%"+M+"%",C(m,D))H=m[D];else if(H!=null){if(!(X in H)){if(!W)throw new o("base intrinsic for "+z+" exists, but the property is not available.");return}if(h&&B+1>=R.length){var ee=h(H,X);Y=!!ee,Y&&"get"in ee&&!("originalValue"in ee.get)?H=ee.get:H=H[X]}else Y=C(H,X),H=H[X];Y&&!K&&(m[D]=H)}}return H},yg}var bg={exports:{}},_g,Y4;function v2(){if(Y4)return _g;Y4=1;var e=Js(),t=e("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return _g=t,_g}var wg,X4;function lS(){if(X4)return wg;X4=1;var e=Js(),t=e("%Object.getOwnPropertyDescriptor%",!0);if(t)try{t([],"length")}catch{t=null}return wg=t,wg}var Sg,Z4;function FD(){if(Z4)return Sg;Z4=1;var e=v2(),t=oS(),r=Xc(),n=lS();return Sg=function(a,o,l){if(!a||typeof a!="object"&&typeof a!="function")throw new r("`obj` must be an object or a function`");if(typeof o!="string"&&typeof o!="symbol")throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new r("`loose`, if provided, must be a boolean");var u=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,h=arguments.length>5?arguments[5]:null,E=arguments.length>6?arguments[6]:!1,w=!!n&&n(a,o);if(e)e(a,o,{configurable:h===null&&w?w.configurable:!h,enumerable:u===null&&w?w.enumerable:!u,value:l,writable:f===null&&w?w.writable:!f});else if(E||!u&&!f&&!h)a[o]=l;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Sg}var Eg,Q4;function zD(){if(Q4)return Eg;Q4=1;var e=v2(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},Eg=t,Eg}var Og,J4;function BD(){if(J4)return Og;J4=1;var e=Js(),t=FD(),r=zD()(),n=lS(),i=Xc(),a=e("%Math.floor%");return Og=function(l,u){if(typeof l!="function")throw new i("`fn` is not a function");if(typeof u!="number"||u<0||u>4294967295||a(u)!==u)throw new i("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],h=!0,E=!0;if("length"in l&&n){var w=n(l,"length");w&&!w.configurable&&(h=!1),w&&!w.writable&&(E=!1)}return(h||E||!f)&&(r?t(l,"length",u,!0,!0):t(l,"length",u)),l},Og}var e_;function UD(){return e_||(e_=1,function(e){var t=g2(),r=Js(),n=BD(),i=Xc(),a=r("%Function.prototype.apply%"),o=r("%Function.prototype.call%"),l=r("%Reflect.apply%",!0)||t.call(o,a),u=v2(),f=r("%Math.max%");e.exports=function(w){if(typeof w!="function")throw new i("a function is required");var p=l(t,o,arguments);return n(p,1+f(0,w.length-(arguments.length-1)),!0)};var h=function(){return l(t,a,arguments)};u?u(e.exports,"apply",{value:h}):e.exports.apply=h}(bg)),bg.exports}var xg,t_;function HD(){if(t_)return xg;t_=1;var e=Js(),t=UD(),r=t(e("String.prototype.indexOf"));return xg=function(i,a){var o=e(i,!!a);return typeof o=="function"&&r(i,".prototype.")>-1?t(o):o},xg}const $D={},GD=Object.freeze(Object.defineProperty({__proto__:null,default:$D},Symbol.toStringTag,{value:"Module"})),VD=po(GD);var Pg,r_;function qD(){if(r_)return Pg;r_=1;var e=typeof Map=="function"&&Map.prototype,t=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=e&&t&&typeof t.get=="function"?t.get:null,n=e&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,a=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,o=i&&a&&typeof a.get=="function"?a.get:null,l=i&&Set.prototype.forEach,u=typeof WeakMap=="function"&&WeakMap.prototype,f=u?WeakMap.prototype.has:null,h=typeof WeakSet=="function"&&WeakSet.prototype,E=h?WeakSet.prototype.has:null,w=typeof WeakRef=="function"&&WeakRef.prototype,p=w?WeakRef.prototype.deref:null,S=Boolean.prototype.valueOf,b=Object.prototype.toString,y=Function.prototype.toString,v=String.prototype.match,m=String.prototype.slice,d=String.prototype.replace,g=String.prototype.toUpperCase,_=String.prototype.toLowerCase,k=RegExp.prototype.test,C=Array.prototype.concat,P=Array.prototype.join,O=Array.prototype.slice,x=Math.floor,A=typeof BigInt=="function"?BigInt.prototype.valueOf:null,L=Object.getOwnPropertySymbols,I=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,U=typeof Symbol=="function"&&typeof Symbol.iterator=="object",$=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===U||!0)?Symbol.toStringTag:null,Z=Object.prototype.propertyIsEnumerable,q=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(oe){return oe.__proto__}:null);function z(oe,fe){if(oe===1/0||oe===-1/0||oe!==oe||oe&&oe>-1e3&&oe<1e3||k.call(/e/,fe))return fe;var Ze=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof oe=="number"){var ye=oe<0?-x(-oe):x(oe);if(ye!==oe){var Me=String(ye),Pe=m.call(fe,Me.length+1);return d.call(Me,Ze,"$&_")+"."+d.call(d.call(Pe,/([0-9]{3})/g,"$&_"),/_$/,"")}}return d.call(fe,Ze,"$&_")}var W=VD,R=W.custom,M=te(R)?R:null;Pg=function oe(fe,Ze,ye,Me){var Pe=Ze||{};if(ne(Pe,"quoteStyle")&&Pe.quoteStyle!=="single"&&Pe.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ne(Pe,"maxStringLength")&&(typeof Pe.maxStringLength=="number"?Pe.maxStringLength<0&&Pe.maxStringLength!==1/0:Pe.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var we=ne(Pe,"customInspect")?Pe.customInspect:!0;if(typeof we!="boolean"&&we!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ne(Pe,"indent")&&Pe.indent!==null&&Pe.indent!==" "&&!(parseInt(Pe.indent,10)===Pe.indent&&Pe.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ne(Pe,"numericSeparator")&&typeof Pe.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var et=Pe.numericSeparator;if(typeof fe>"u")return"undefined";if(fe===null)return"null";if(typeof fe=="boolean")return fe?"true":"false";if(typeof fe=="string")return be(fe,Pe);if(typeof fe=="number"){if(fe===0)return 1/0/fe>0?"0":"-0";var Se=String(fe);return et?z(fe,Se):Se}if(typeof fe=="bigint"){var We=String(fe)+"n";return et?z(fe,We):We}var lr=typeof Pe.depth>"u"?5:Pe.depth;if(typeof ye>"u"&&(ye=0),ye>=lr&&lr>0&&typeof fe=="object")return H(fe)?"[Array]":"[Object]";var xe=Ee(Pe,ye);if(typeof Me>"u")Me=[];else if(Ie(Me,fe)>=0)return"[Circular]";function ze(Ut,en,Mn){if(en&&(Me=O.call(Me),Me.push(en)),Mn){var Ln={depth:Pe.depth};return ne(Pe,"quoteStyle")&&(Ln.quoteStyle=Pe.quoteStyle),oe(Ut,Ln,ye+1,Me)}return oe(Ut,Pe,ye+1,Me)}if(typeof fe=="function"&&!G(fe)){var rt=Te(fe),yt=Ve(fe,ze);return"[Function"+(rt?": "+rt:" (anonymous)")+"]"+(yt.length>0?" { "+P.call(yt,", ")+" }":"")}if(te(fe)){var xt=U?d.call(String(fe),/^(Symbol\(.*\))_[^)]*$/,"$1"):I.call(fe);return typeof fe=="object"&&!U?$e(xt):xt}if(ce(fe)){for(var xr="<"+_.call(String(fe.nodeName)),Zr=fe.attributes||[],mr=0;mr<Zr.length;mr++)xr+=" "+Zr[mr].name+"="+F(D(Zr[mr].value),"double",Pe);return xr+=">",fe.childNodes&&fe.childNodes.length&&(xr+="..."),xr+="</"+_.call(String(fe.nodeName))+">",xr}if(H(fe)){if(fe.length===0)return"[]";var Qr=Ve(fe,ze);return xe&&!Le(Qr)?"["+Re(Qr,xe)+"]":"[ "+P.call(Qr,", ")+" ]"}if(B(fe)){var Qn=Ve(fe,ze);return!("cause"in Error.prototype)&&"cause"in fe&&!Z.call(fe,"cause")?"{ ["+String(fe)+"] "+P.call(C.call("[cause]: "+ze(fe.cause),Qn),", ")+" }":Qn.length===0?"["+String(fe)+"]":"{ ["+String(fe)+"] "+P.call(Qn,", ")+" }"}if(typeof fe=="object"&&we){if(M&&typeof fe[M]=="function"&&W)return W(fe,{depth:lr-ye});if(we!=="symbol"&&typeof fe.inspect=="function")return fe.inspect()}if(se(fe)){var Rn=[];return n&&n.call(fe,function(Ut,en){Rn.push(ze(en,fe,!0)+" => "+ze(Ut,fe))}),Ye("Map",r.call(fe),Rn,xe)}if(ve(fe)){var Ne=[];return l&&l.call(fe,function(Ut){Ne.push(ze(Ut,fe))}),Ye("Set",o.call(fe),Ne,xe)}if(de(fe))return Qe("WeakMap");if(re(fe))return Qe("WeakSet");if(_e(fe))return Qe("WeakRef");if(X(fe))return $e(ze(Number(fe)));if(ee(fe))return $e(ze(A.call(fe)));if(Q(fe))return $e(S.call(fe));if(Y(fe))return $e(ze(String(fe)));if(typeof window<"u"&&fe===window)return"{ [object Window] }";if(typeof globalThis<"u"&&fe===globalThis||typeof me<"u"&&fe===me)return"{ [object globalThis] }";if(!K(fe)&&!G(fe)){var tt=Ve(fe,ze),ct=q?q(fe)===Object.prototype:fe instanceof Object||fe.constructor===Object,Mt=fe instanceof Object?"":"null prototype",Et=!ct&&$&&Object(fe)===fe&&$ in fe?m.call(le(fe),8,-1):Mt?"Object":"",Jr=ct||typeof fe.constructor!="function"?"":fe.constructor.name?fe.constructor.name+" ":"",$r=Jr+(Et||Mt?"["+P.call(C.call([],Et||[],Mt||[]),": ")+"] ":"");return tt.length===0?$r+"{}":xe?$r+"{"+Re(tt,xe)+"}":$r+"{ "+P.call(tt,", ")+" }"}return String(fe)};function F(oe,fe,Ze){var ye=(Ze.quoteStyle||fe)==="double"?'"':"'";return ye+oe+ye}function D(oe){return d.call(String(oe),/"/g,"&quot;")}function H(oe){return le(oe)==="[object Array]"&&(!$||!(typeof oe=="object"&&$ in oe))}function K(oe){return le(oe)==="[object Date]"&&(!$||!(typeof oe=="object"&&$ in oe))}function G(oe){return le(oe)==="[object RegExp]"&&(!$||!(typeof oe=="object"&&$ in oe))}function B(oe){return le(oe)==="[object Error]"&&(!$||!(typeof oe=="object"&&$ in oe))}function Y(oe){return le(oe)==="[object String]"&&(!$||!(typeof oe=="object"&&$ in oe))}function X(oe){return le(oe)==="[object Number]"&&(!$||!(typeof oe=="object"&&$ in oe))}function Q(oe){return le(oe)==="[object Boolean]"&&(!$||!(typeof oe=="object"&&$ in oe))}function te(oe){if(U)return oe&&typeof oe=="object"&&oe instanceof Symbol;if(typeof oe=="symbol")return!0;if(!oe||typeof oe!="object"||!I)return!1;try{return I.call(oe),!0}catch{}return!1}function ee(oe){if(!oe||typeof oe!="object"||!A)return!1;try{return A.call(oe),!0}catch{}return!1}var ie=Object.prototype.hasOwnProperty||function(oe){return oe in this};function ne(oe,fe){return ie.call(oe,fe)}function le(oe){return b.call(oe)}function Te(oe){if(oe.name)return oe.name;var fe=v.call(y.call(oe),/^function\s*([\w$]+)/);return fe?fe[1]:null}function Ie(oe,fe){if(oe.indexOf)return oe.indexOf(fe);for(var Ze=0,ye=oe.length;Ze<ye;Ze++)if(oe[Ze]===fe)return Ze;return-1}function se(oe){if(!r||!oe||typeof oe!="object")return!1;try{r.call(oe);try{o.call(oe)}catch{return!0}return oe instanceof Map}catch{}return!1}function de(oe){if(!f||!oe||typeof oe!="object")return!1;try{f.call(oe,f);try{E.call(oe,E)}catch{return!0}return oe instanceof WeakMap}catch{}return!1}function _e(oe){if(!p||!oe||typeof oe!="object")return!1;try{return p.call(oe),!0}catch{}return!1}function ve(oe){if(!o||!oe||typeof oe!="object")return!1;try{o.call(oe);try{r.call(oe)}catch{return!0}return oe instanceof Set}catch{}return!1}function re(oe){if(!E||!oe||typeof oe!="object")return!1;try{E.call(oe,E);try{f.call(oe,f)}catch{return!0}return oe instanceof WeakSet}catch{}return!1}function ce(oe){return!oe||typeof oe!="object"?!1:typeof HTMLElement<"u"&&oe instanceof HTMLElement?!0:typeof oe.nodeName=="string"&&typeof oe.getAttribute=="function"}function be(oe,fe){if(oe.length>fe.maxStringLength){var Ze=oe.length-fe.maxStringLength,ye="... "+Ze+" more character"+(Ze>1?"s":"");return be(m.call(oe,0,fe.maxStringLength),fe)+ye}var Me=d.call(d.call(oe,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Oe);return F(Me,"single",fe)}function Oe(oe){var fe=oe.charCodeAt(0),Ze={8:"b",9:"t",10:"n",12:"f",13:"r"}[fe];return Ze?"\\"+Ze:"\\x"+(fe<16?"0":"")+g.call(fe.toString(16))}function $e(oe){return"Object("+oe+")"}function Qe(oe){return oe+" { ? }"}function Ye(oe,fe,Ze,ye){var Me=ye?Re(Ze,ye):P.call(Ze,", ");return oe+" ("+fe+") {"+Me+"}"}function Le(oe){for(var fe=0;fe<oe.length;fe++)if(Ie(oe[fe],`
149
+ `)>=0)return!1;return!0}function Ee(oe,fe){var Ze;if(oe.indent===" ")Ze=" ";else if(typeof oe.indent=="number"&&oe.indent>0)Ze=P.call(Array(oe.indent+1)," ");else return null;return{base:Ze,prev:P.call(Array(fe+1),Ze)}}function Re(oe,fe){if(oe.length===0)return"";var Ze=`
150
+ `+fe.prev+fe.base;return Ze+P.call(oe,","+Ze)+`
151
+ `+fe.prev}function Ve(oe,fe){var Ze=H(oe),ye=[];if(Ze){ye.length=oe.length;for(var Me=0;Me<oe.length;Me++)ye[Me]=ne(oe,Me)?fe(oe[Me],oe):""}var Pe=typeof L=="function"?L(oe):[],we;if(U){we={};for(var et=0;et<Pe.length;et++)we["$"+Pe[et]]=Pe[et]}for(var Se in oe)ne(oe,Se)&&(Ze&&String(Number(Se))===Se&&Se<oe.length||U&&we["$"+Se]instanceof Symbol||(k.call(/[^\w$]/,Se)?ye.push(fe(Se,oe)+": "+fe(oe[Se],oe)):ye.push(Se+": "+fe(oe[Se],oe))));if(typeof L=="function")for(var We=0;We<Pe.length;We++)Z.call(oe,Pe[We])&&ye.push("["+fe(Pe[We])+"]: "+fe(oe[Pe[We]],oe));return ye}return Pg}var Cg,n_;function WD(){if(n_)return Cg;n_=1;var e=Js(),t=HD(),r=qD(),n=Xc(),i=e("%WeakMap%",!0),a=e("%Map%",!0),o=t("WeakMap.prototype.get",!0),l=t("WeakMap.prototype.set",!0),u=t("WeakMap.prototype.has",!0),f=t("Map.prototype.get",!0),h=t("Map.prototype.set",!0),E=t("Map.prototype.has",!0),w=function(y,v){for(var m=y,d;(d=m.next)!==null;m=d)if(d.key===v)return m.next=d.next,d.next=y.next,y.next=d,d},p=function(y,v){var m=w(y,v);return m&&m.value},S=function(y,v,m){var d=w(y,v);d?d.value=m:y.next={key:v,next:y.next,value:m}},b=function(y,v){return!!w(y,v)};return Cg=function(){var v,m,d,g={assert:function(_){if(!g.has(_))throw new n("Side channel does not contain "+r(_))},get:function(_){if(i&&_&&(typeof _=="object"||typeof _=="function")){if(v)return o(v,_)}else if(a){if(m)return f(m,_)}else if(d)return p(d,_)},has:function(_){if(i&&_&&(typeof _=="object"||typeof _=="function")){if(v)return u(v,_)}else if(a){if(m)return E(m,_)}else if(d)return b(d,_);return!1},set:function(_,k){i&&_&&(typeof _=="object"||typeof _=="function")?(v||(v=new i),l(v,_,k)):a?(m||(m=new a),h(m,_,k)):(d||(d={key:{},next:null}),S(d,_,k))}};return g},Cg}var kg,i_;function m2(){if(i_)return kg;i_=1;var e=String.prototype.replace,t=/%20/g,r={RFC1738:"RFC1738",RFC3986:"RFC3986"};return kg={default:r.RFC3986,formatters:{RFC1738:function(n){return e.call(n,t,"+")},RFC3986:function(n){return String(n)}},RFC1738:r.RFC1738,RFC3986:r.RFC3986},kg}var Tg,a_;function sS(){if(a_)return Tg;a_=1;var e=m2(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n=function(){for(var y=[],v=0;v<256;++v)y.push("%"+((v<16?"0":"")+v.toString(16)).toUpperCase());return y}(),i=function(v){for(;v.length>1;){var m=v.pop(),d=m.obj[m.prop];if(r(d)){for(var g=[],_=0;_<d.length;++_)typeof d[_]<"u"&&g.push(d[_]);m.obj[m.prop]=g}}},a=function(v,m){for(var d=m&&m.plainObjects?Object.create(null):{},g=0;g<v.length;++g)typeof v[g]<"u"&&(d[g]=v[g]);return d},o=function y(v,m,d){if(!m)return v;if(typeof m!="object"){if(r(v))v.push(m);else if(v&&typeof v=="object")(d&&(d.plainObjects||d.allowPrototypes)||!t.call(Object.prototype,m))&&(v[m]=!0);else return[v,m];return v}if(!v||typeof v!="object")return[v].concat(m);var g=v;return r(v)&&!r(m)&&(g=a(v,d)),r(v)&&r(m)?(m.forEach(function(_,k){if(t.call(v,k)){var C=v[k];C&&typeof C=="object"&&_&&typeof _=="object"?v[k]=y(C,_,d):v.push(_)}else v[k]=_}),v):Object.keys(m).reduce(function(_,k){var C=m[k];return t.call(_,k)?_[k]=y(_[k],C,d):_[k]=C,_},g)},l=function(v,m){return Object.keys(m).reduce(function(d,g){return d[g]=m[g],d},v)},u=function(y,v,m){var d=y.replace(/\+/g," ");if(m==="iso-8859-1")return d.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(d)}catch{return d}},f=1024,h=function(v,m,d,g,_){if(v.length===0)return v;var k=v;if(typeof v=="symbol"?k=Symbol.prototype.toString.call(v):typeof v!="string"&&(k=String(v)),d==="iso-8859-1")return escape(k).replace(/%u[0-9a-f]{4}/gi,function(I){return"%26%23"+parseInt(I.slice(2),16)+"%3B"});for(var C="",P=0;P<k.length;P+=f){for(var O=k.length>=f?k.slice(P,P+f):k,x=[],A=0;A<O.length;++A){var L=O.charCodeAt(A);if(L===45||L===46||L===95||L===126||L>=48&&L<=57||L>=65&&L<=90||L>=97&&L<=122||_===e.RFC1738&&(L===40||L===41)){x[x.length]=O.charAt(A);continue}if(L<128){x[x.length]=n[L];continue}if(L<2048){x[x.length]=n[192|L>>6]+n[128|L&63];continue}if(L<55296||L>=57344){x[x.length]=n[224|L>>12]+n[128|L>>6&63]+n[128|L&63];continue}A+=1,L=65536+((L&1023)<<10|O.charCodeAt(A)&1023),x[x.length]=n[240|L>>18]+n[128|L>>12&63]+n[128|L>>6&63]+n[128|L&63]}C+=x.join("")}return C},E=function(v){for(var m=[{obj:{o:v},prop:"o"}],d=[],g=0;g<m.length;++g)for(var _=m[g],k=_.obj[_.prop],C=Object.keys(k),P=0;P<C.length;++P){var O=C[P],x=k[O];typeof x=="object"&&x!==null&&d.indexOf(x)===-1&&(m.push({obj:k,prop:O}),d.push(x))}return i(m),v},w=function(v){return Object.prototype.toString.call(v)==="[object RegExp]"},p=function(v){return!v||typeof v!="object"?!1:!!(v.constructor&&v.constructor.isBuffer&&v.constructor.isBuffer(v))},S=function(v,m){return[].concat(v,m)},b=function(v,m){if(r(v)){for(var d=[],g=0;g<v.length;g+=1)d.push(m(v[g]));return d}return m(v)};return Tg={arrayToObject:a,assign:l,combine:S,compact:E,decode:u,encode:h,isBuffer:p,isRegExp:w,maybeMap:b,merge:o},Tg}var Ag,o_;function KD(){if(o_)return Ag;o_=1;var e=WD(),t=sS(),r=m2(),n=Object.prototype.hasOwnProperty,i={brackets:function(y){return y+"[]"},comma:"comma",indices:function(y,v){return y+"["+v+"]"},repeat:function(y){return y}},a=Array.isArray,o=Array.prototype.push,l=function(b,y){o.apply(b,a(y)?y:[y])},u=Date.prototype.toISOString,f=r.default,h={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:t.encode,encodeValuesOnly:!1,format:f,formatter:r.formatters[f],indices:!1,serializeDate:function(y){return u.call(y)},skipNulls:!1,strictNullHandling:!1},E=function(y){return typeof y=="string"||typeof y=="number"||typeof y=="boolean"||typeof y=="symbol"||typeof y=="bigint"},w={},p=function b(y,v,m,d,g,_,k,C,P,O,x,A,L,I,U,$,Z,q){for(var z=y,W=q,R=0,M=!1;(W=W.get(w))!==void 0&&!M;){var F=W.get(y);if(R+=1,typeof F<"u"){if(F===R)throw new RangeError("Cyclic object value");M=!0}typeof W.get(w)>"u"&&(R=0)}if(typeof O=="function"?z=O(v,z):z instanceof Date?z=L(z):m==="comma"&&a(z)&&(z=t.maybeMap(z,function(le){return le instanceof Date?L(le):le})),z===null){if(_)return P&&!$?P(v,h.encoder,Z,"key",I):v;z=""}if(E(z)||t.isBuffer(z)){if(P){var D=$?v:P(v,h.encoder,Z,"key",I);return[U(D)+"="+U(P(z,h.encoder,Z,"value",I))]}return[U(v)+"="+U(String(z))]}var H=[];if(typeof z>"u")return H;var K;if(m==="comma"&&a(z))$&&P&&(z=t.maybeMap(z,P)),K=[{value:z.length>0?z.join(",")||null:void 0}];else if(a(O))K=O;else{var G=Object.keys(z);K=x?G.sort(x):G}var B=C?v.replace(/\./g,"%2E"):v,Y=d&&a(z)&&z.length===1?B+"[]":B;if(g&&a(z)&&z.length===0)return Y+"[]";for(var X=0;X<K.length;++X){var Q=K[X],te=typeof Q=="object"&&typeof Q.value<"u"?Q.value:z[Q];if(!(k&&te===null)){var ee=A&&C?Q.replace(/\./g,"%2E"):Q,ie=a(z)?typeof m=="function"?m(Y,ee):Y:Y+(A?"."+ee:"["+ee+"]");q.set(y,R);var ne=e();ne.set(w,q),l(H,b(te,ie,m,d,g,_,k,C,m==="comma"&&$&&a(z)?null:P,O,x,A,L,I,U,$,Z,ne))}}return H},S=function(y){if(!y)return h;if(typeof y.allowEmptyArrays<"u"&&typeof y.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof y.encodeDotInKeys<"u"&&typeof y.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(y.encoder!==null&&typeof y.encoder<"u"&&typeof y.encoder!="function")throw new TypeError("Encoder has to be a function.");var v=y.charset||h.charset;if(typeof y.charset<"u"&&y.charset!=="utf-8"&&y.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var m=r.default;if(typeof y.format<"u"){if(!n.call(r.formatters,y.format))throw new TypeError("Unknown format option provided.");m=y.format}var d=r.formatters[m],g=h.filter;(typeof y.filter=="function"||a(y.filter))&&(g=y.filter);var _;if(y.arrayFormat in i?_=y.arrayFormat:"indices"in y?_=y.indices?"indices":"repeat":_=h.arrayFormat,"commaRoundTrip"in y&&typeof y.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var k=typeof y.allowDots>"u"?y.encodeDotInKeys===!0?!0:h.allowDots:!!y.allowDots;return{addQueryPrefix:typeof y.addQueryPrefix=="boolean"?y.addQueryPrefix:h.addQueryPrefix,allowDots:k,allowEmptyArrays:typeof y.allowEmptyArrays=="boolean"?!!y.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:_,charset:v,charsetSentinel:typeof y.charsetSentinel=="boolean"?y.charsetSentinel:h.charsetSentinel,commaRoundTrip:y.commaRoundTrip,delimiter:typeof y.delimiter>"u"?h.delimiter:y.delimiter,encode:typeof y.encode=="boolean"?y.encode:h.encode,encodeDotInKeys:typeof y.encodeDotInKeys=="boolean"?y.encodeDotInKeys:h.encodeDotInKeys,encoder:typeof y.encoder=="function"?y.encoder:h.encoder,encodeValuesOnly:typeof y.encodeValuesOnly=="boolean"?y.encodeValuesOnly:h.encodeValuesOnly,filter:g,format:m,formatter:d,serializeDate:typeof y.serializeDate=="function"?y.serializeDate:h.serializeDate,skipNulls:typeof y.skipNulls=="boolean"?y.skipNulls:h.skipNulls,sort:typeof y.sort=="function"?y.sort:null,strictNullHandling:typeof y.strictNullHandling=="boolean"?y.strictNullHandling:h.strictNullHandling}};return Ag=function(b,y){var v=b,m=S(y),d,g;typeof m.filter=="function"?(g=m.filter,v=g("",v)):a(m.filter)&&(g=m.filter,d=g);var _=[];if(typeof v!="object"||v===null)return"";var k=i[m.arrayFormat],C=k==="comma"&&m.commaRoundTrip;d||(d=Object.keys(v)),m.sort&&d.sort(m.sort);for(var P=e(),O=0;O<d.length;++O){var x=d[O];m.skipNulls&&v[x]===null||l(_,p(v[x],x,k,C,m.allowEmptyArrays,m.strictNullHandling,m.skipNulls,m.encodeDotInKeys,m.encode?m.encoder:null,m.filter,m.sort,m.allowDots,m.serializeDate,m.format,m.formatter,m.encodeValuesOnly,m.charset,P))}var A=_.join(m.delimiter),L=m.addQueryPrefix===!0?"?":"";return m.charsetSentinel&&(m.charset==="iso-8859-1"?L+="utf8=%26%2310003%3B&":L+="utf8=%E2%9C%93&"),A.length>0?L+A:""},Ag}var Rg,l_;function YD(){if(l_)return Rg;l_=1;var e=sS(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:e.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},i=function(w){return w.replace(/&#(\d+);/g,function(p,S){return String.fromCharCode(parseInt(S,10))})},a=function(w,p){return w&&typeof w=="string"&&p.comma&&w.indexOf(",")>-1?w.split(","):w},o="utf8=%26%2310003%3B",l="utf8=%E2%9C%93",u=function(p,S){var b={__proto__:null},y=S.ignoreQueryPrefix?p.replace(/^\?/,""):p;y=y.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var v=S.parameterLimit===1/0?void 0:S.parameterLimit,m=y.split(S.delimiter,v),d=-1,g,_=S.charset;if(S.charsetSentinel)for(g=0;g<m.length;++g)m[g].indexOf("utf8=")===0&&(m[g]===l?_="utf-8":m[g]===o&&(_="iso-8859-1"),d=g,g=m.length);for(g=0;g<m.length;++g)if(g!==d){var k=m[g],C=k.indexOf("]="),P=C===-1?k.indexOf("="):C+1,O,x;P===-1?(O=S.decoder(k,n.decoder,_,"key"),x=S.strictNullHandling?null:""):(O=S.decoder(k.slice(0,P),n.decoder,_,"key"),x=e.maybeMap(a(k.slice(P+1),S),function(L){return S.decoder(L,n.decoder,_,"value")})),x&&S.interpretNumericEntities&&_==="iso-8859-1"&&(x=i(x)),k.indexOf("[]=")>-1&&(x=r(x)?[x]:x);var A=t.call(b,O);A&&S.duplicates==="combine"?b[O]=e.combine(b[O],x):(!A||S.duplicates==="last")&&(b[O]=x)}return b},f=function(w,p,S,b){for(var y=b?p:a(p,S),v=w.length-1;v>=0;--v){var m,d=w[v];if(d==="[]"&&S.parseArrays)m=S.allowEmptyArrays&&y===""?[]:[].concat(y);else{m=S.plainObjects?Object.create(null):{};var g=d.charAt(0)==="["&&d.charAt(d.length-1)==="]"?d.slice(1,-1):d,_=S.decodeDotInKeys?g.replace(/%2E/g,"."):g,k=parseInt(_,10);!S.parseArrays&&_===""?m={0:y}:!isNaN(k)&&d!==_&&String(k)===_&&k>=0&&S.parseArrays&&k<=S.arrayLimit?(m=[],m[k]=y):_!=="__proto__"&&(m[_]=y)}y=m}return y},h=function(p,S,b,y){if(p){var v=b.allowDots?p.replace(/\.([^.[]+)/g,"[$1]"):p,m=/(\[[^[\]]*])/,d=/(\[[^[\]]*])/g,g=b.depth>0&&m.exec(v),_=g?v.slice(0,g.index):v,k=[];if(_){if(!b.plainObjects&&t.call(Object.prototype,_)&&!b.allowPrototypes)return;k.push(_)}for(var C=0;b.depth>0&&(g=d.exec(v))!==null&&C<b.depth;){if(C+=1,!b.plainObjects&&t.call(Object.prototype,g[1].slice(1,-1))&&!b.allowPrototypes)return;k.push(g[1])}return g&&k.push("["+v.slice(g.index)+"]"),f(k,S,b,y)}},E=function(p){if(!p)return n;if(typeof p.allowEmptyArrays<"u"&&typeof p.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof p.decodeDotInKeys<"u"&&typeof p.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(p.decoder!==null&&typeof p.decoder<"u"&&typeof p.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof p.charset<"u"&&p.charset!=="utf-8"&&p.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var S=typeof p.charset>"u"?n.charset:p.charset,b=typeof p.duplicates>"u"?n.duplicates:p.duplicates;if(b!=="combine"&&b!=="first"&&b!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var y=typeof p.allowDots>"u"?p.decodeDotInKeys===!0?!0:n.allowDots:!!p.allowDots;return{allowDots:y,allowEmptyArrays:typeof p.allowEmptyArrays=="boolean"?!!p.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof p.allowPrototypes=="boolean"?p.allowPrototypes:n.allowPrototypes,allowSparse:typeof p.allowSparse=="boolean"?p.allowSparse:n.allowSparse,arrayLimit:typeof p.arrayLimit=="number"?p.arrayLimit:n.arrayLimit,charset:S,charsetSentinel:typeof p.charsetSentinel=="boolean"?p.charsetSentinel:n.charsetSentinel,comma:typeof p.comma=="boolean"?p.comma:n.comma,decodeDotInKeys:typeof p.decodeDotInKeys=="boolean"?p.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof p.decoder=="function"?p.decoder:n.decoder,delimiter:typeof p.delimiter=="string"||e.isRegExp(p.delimiter)?p.delimiter:n.delimiter,depth:typeof p.depth=="number"||p.depth===!1?+p.depth:n.depth,duplicates:b,ignoreQueryPrefix:p.ignoreQueryPrefix===!0,interpretNumericEntities:typeof p.interpretNumericEntities=="boolean"?p.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof p.parameterLimit=="number"?p.parameterLimit:n.parameterLimit,parseArrays:p.parseArrays!==!1,plainObjects:typeof p.plainObjects=="boolean"?p.plainObjects:n.plainObjects,strictNullHandling:typeof p.strictNullHandling=="boolean"?p.strictNullHandling:n.strictNullHandling}};return Rg=function(w,p){var S=E(p);if(w===""||w===null||typeof w>"u")return S.plainObjects?Object.create(null):{};for(var b=typeof w=="string"?u(w,S):w,y=S.plainObjects?Object.create(null):{},v=Object.keys(b),m=0;m<v.length;++m){var d=v[m],g=h(d,b[d],S,typeof w=="string");y=e.merge(y,g,S)}return S.allowSparse===!0?y:e.compact(y)},Rg}var Mg,s_;function XD(){if(s_)return Mg;s_=1;var e=KD(),t=YD(),r=m2();return Mg={formats:r,parse:t,stringify:e},Mg}var u_;function uS(){if(u_)return Ho;u_=1;var e=CD();function t(){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 r=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,a=["<",">",'"',"`"," ","\r",`
152
+ `," "],o=["{","}","|","\\","^","`"].concat(a),l=["'"].concat(o),u=["%","/","?",";","#"].concat(l),f=["/","?","#"],h=255,E=/^[+a-z0-9A-Z_-]{0,63}$/,w=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},S={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=XD();function v(_,k,C){if(_&&typeof _=="object"&&_ instanceof t)return _;var P=new t;return P.parse(_,k,C),P}t.prototype.parse=function(_,k,C){if(typeof _!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof _);var P=_.indexOf("?"),O=P!==-1&&P<_.indexOf("#")?"?":"#",x=_.split(O),A=/\\/g;x[0]=x[0].replace(A,"/"),_=x.join(O);var L=_;if(L=L.trim(),!C&&_.split("#").length===1){var I=i.exec(L);if(I)return this.path=L,this.href=L,this.pathname=I[1],I[2]?(this.search=I[2],k?this.query=y.parse(this.search.substr(1)):this.query=this.search.substr(1)):k&&(this.search="",this.query={}),this}var U=r.exec(L);if(U){U=U[0];var $=U.toLowerCase();this.protocol=$,L=L.substr(U.length)}if(C||U||L.match(/^\/\/[^@/]+@[^@/]+/)){var Z=L.substr(0,2)==="//";Z&&!(U&&S[U])&&(L=L.substr(2),this.slashes=!0)}if(!S[U]&&(Z||U&&!b[U])){for(var q=-1,z=0;z<f.length;z++){var W=L.indexOf(f[z]);W!==-1&&(q===-1||W<q)&&(q=W)}var R,M;q===-1?M=L.lastIndexOf("@"):M=L.lastIndexOf("@",q),M!==-1&&(R=L.slice(0,M),L=L.slice(M+1),this.auth=decodeURIComponent(R)),q=-1;for(var z=0;z<u.length;z++){var W=L.indexOf(u[z]);W!==-1&&(q===-1||W<q)&&(q=W)}q===-1&&(q=L.length),this.host=L.slice(0,q),L=L.slice(q),this.parseHost(),this.hostname=this.hostname||"";var F=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!F)for(var D=this.hostname.split(/\./),z=0,H=D.length;z<H;z++){var K=D[z];if(K&&!K.match(E)){for(var G="",B=0,Y=K.length;B<Y;B++)K.charCodeAt(B)>127?G+="x":G+=K[B];if(!G.match(E)){var X=D.slice(0,z),Q=D.slice(z+1),te=K.match(w);te&&(X.push(te[1]),Q.unshift(te[2])),Q.length&&(L="/"+Q.join(".")+L),this.hostname=X.join(".");break}}}this.hostname.length>h?this.hostname="":this.hostname=this.hostname.toLowerCase(),F||(this.hostname=e.toASCII(this.hostname));var ee=this.port?":"+this.port:"",ie=this.hostname||"";this.host=ie+ee,this.href+=this.host,F&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),L[0]!=="/"&&(L="/"+L))}if(!p[$])for(var z=0,H=l.length;z<H;z++){var ne=l[z];if(L.indexOf(ne)!==-1){var le=encodeURIComponent(ne);le===ne&&(le=escape(ne)),L=L.split(ne).join(le)}}var Te=L.indexOf("#");Te!==-1&&(this.hash=L.substr(Te),L=L.slice(0,Te));var Ie=L.indexOf("?");if(Ie!==-1?(this.search=L.substr(Ie),this.query=L.substr(Ie+1),k&&(this.query=y.parse(this.query)),L=L.slice(0,Ie)):k&&(this.search="",this.query={}),L&&(this.pathname=L),b[$]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var ee=this.pathname||"",se=this.search||"";this.path=ee+se}return this.href=this.format(),this};function m(_){return typeof _=="string"&&(_=v(_)),_ instanceof t?_.format():t.prototype.format.call(_)}t.prototype.format=function(){var _=this.auth||"";_&&(_=encodeURIComponent(_),_=_.replace(/%3A/i,":"),_+="@");var k=this.protocol||"",C=this.pathname||"",P=this.hash||"",O=!1,x="";this.host?O=_+this.host:this.hostname&&(O=_+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(O+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(x=y.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var A=this.search||x&&"?"+x||"";return k&&k.substr(-1)!==":"&&(k+=":"),this.slashes||(!k||b[k])&&O!==!1?(O="//"+(O||""),C&&C.charAt(0)!=="/"&&(C="/"+C)):O||(O=""),P&&P.charAt(0)!=="#"&&(P="#"+P),A&&A.charAt(0)!=="?"&&(A="?"+A),C=C.replace(/[?#]/g,function(L){return encodeURIComponent(L)}),A=A.replace("#","%23"),k+O+C+A+P};function d(_,k){return v(_,!1,!0).resolve(k)}t.prototype.resolve=function(_){return this.resolveObject(v(_,!1,!0)).format()};function g(_,k){return _?v(_,!1,!0).resolveObject(k):k}return t.prototype.resolveObject=function(_){if(typeof _=="string"){var k=new t;k.parse(_,!1,!0),_=k}for(var C=new t,P=Object.keys(this),O=0;O<P.length;O++){var x=P[O];C[x]=this[x]}if(C.hash=_.hash,_.href==="")return C.href=C.format(),C;if(_.slashes&&!_.protocol){for(var A=Object.keys(_),L=0;L<A.length;L++){var I=A[L];I!=="protocol"&&(C[I]=_[I])}return b[C.protocol]&&C.hostname&&!C.pathname&&(C.pathname="/",C.path=C.pathname),C.href=C.format(),C}if(_.protocol&&_.protocol!==C.protocol){if(!b[_.protocol]){for(var U=Object.keys(_),$=0;$<U.length;$++){var Z=U[$];C[Z]=_[Z]}return C.href=C.format(),C}if(C.protocol=_.protocol,!_.host&&!S[_.protocol]){for(var H=(_.pathname||"").split("/");H.length&&!(_.host=H.shift()););_.host||(_.host=""),_.hostname||(_.hostname=""),H[0]!==""&&H.unshift(""),H.length<2&&H.unshift(""),C.pathname=H.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 q=C.pathname||"",z=C.search||"";C.path=q+z}return C.slashes=C.slashes||_.slashes,C.href=C.format(),C}var W=C.pathname&&C.pathname.charAt(0)==="/",R=_.host||_.pathname&&_.pathname.charAt(0)==="/",M=R||W||C.host&&_.pathname,F=M,D=C.pathname&&C.pathname.split("/")||[],H=_.pathname&&_.pathname.split("/")||[],K=C.protocol&&!b[C.protocol];if(K&&(C.hostname="",C.port=null,C.host&&(D[0]===""?D[0]=C.host:D.unshift(C.host)),C.host="",_.protocol&&(_.hostname=null,_.port=null,_.host&&(H[0]===""?H[0]=_.host:H.unshift(_.host)),_.host=null),M=M&&(H[0]===""||D[0]==="")),R)C.host=_.host||_.host===""?_.host:C.host,C.hostname=_.hostname||_.hostname===""?_.hostname:C.hostname,C.search=_.search,C.query=_.query,D=H;else if(H.length)D||(D=[]),D.pop(),D=D.concat(H),C.search=_.search,C.query=_.query;else if(_.search!=null){if(K){C.host=D.shift(),C.hostname=C.host;var G=C.host&&C.host.indexOf("@")>0?C.host.split("@"):!1;G&&(C.auth=G.shift(),C.hostname=G.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(!D.length)return C.pathname=null,C.search?C.path="/"+C.search:C.path=null,C.href=C.format(),C;for(var B=D.slice(-1)[0],Y=(C.host||_.host||D.length>1)&&(B==="."||B==="..")||B==="",X=0,Q=D.length;Q>=0;Q--)B=D[Q],B==="."?D.splice(Q,1):B===".."?(D.splice(Q,1),X++):X&&(D.splice(Q,1),X--);if(!M&&!F)for(;X--;X)D.unshift("..");M&&D[0]!==""&&(!D[0]||D[0].charAt(0)!=="/")&&D.unshift(""),Y&&D.join("/").substr(-1)!=="/"&&D.push("");var te=D[0]===""||D[0]&&D[0].charAt(0)==="/";if(K){C.hostname=te?"":D.length?D.shift():"",C.host=C.hostname;var G=C.host&&C.host.indexOf("@")>0?C.host.split("@"):!1;G&&(C.auth=G.shift(),C.hostname=G.shift(),C.host=C.hostname)}return M=M||C.host&&D.length,M&&!te&&D.unshift(""),D.length>0?C.pathname=D.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},t.prototype.parseHost=function(){var _=this.host,k=n.exec(_);k&&(k=k[0],k!==":"&&(this.port=k.substr(1)),_=_.substr(0,_.length-k.length)),_&&(this.hostname=_)},Ho.parse=v,Ho.resolve=d,Ho.resolveObject=g,Ho.format=m,Ho.Url=t,Ho}var Lg={exports:{}},c_;function ZD(){return c_||(c_=1,function(e){(function(t,r){e.exports?e.exports=r():t.xmlserializer=r()})(me,function(){var t=function(p){return p.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")},r=function(p){return p.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")},n=function(p){return p.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},i=function(p){var S=p.value;return" "+p.name+'="'+r(S)+'"'},a=function(p){var S=p.tagName;return p.namespaceURI==="http://www.w3.org/1999/xhtml"&&(S=S.toLowerCase()),S},o=function(p,S){var b=Array.prototype.map.call(p.attributes||p.attrs,function(y){return y.name}).indexOf("xmlns")>=0;return!b&&(S||p.namespaceURI!==p.parentNode.namespaceURI)?' xmlns="'+p.namespaceURI+'"':""},l=function(p){return Array.prototype.map.call(p.childNodes,function(S){return w(S)}).join("")},u=function(p,S){var b="<"+a(p);return b+=o(p,S),Array.prototype.forEach.call(p.attributes||p.attrs,function(y){b+=i(y)}),p.childNodes.length>0?(b+=">",b+=l(p),b+="</"+a(p)+">"):b+="/>",b},f=function(p){var S=p.nodeValue||p.value||"";return n(S)},h=function(p){return"<!--"+p.data.replace(/-/g,"&#45;")+"-->"},E=function(p){return"<![CDATA["+p.nodeValue+"]]>"},w=function(p,S){var b=S&&S.rootNode;if(p.nodeName==="#document"||p.nodeName==="#document-fragment")return l(p);if(p.tagName)return u(p,b);if(p.nodeName==="#text")return f(p);if(p.nodeName==="#comment")return h(p);if(p.nodeName==="#cdata-section")return E(p)};return{serializeToString:function(p){return t(w(p,{rootNode:!0}))}}})}(Lg)),Lg.exports}var Ng={},f_;function QD(){if(f_)return Ng;f_=1;var e=function(a){var o=new XMLSerializer;return Array.prototype.map.call(a.childNodes,function(l){return o.serializeToString(l)}).join("")},t=function(a){if(a.documentElement.tagName==="parsererror"&&a.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml")return a.documentElement;if((a.documentElement.tagName==="xml"||a.documentElement.tagName==="html")&&a.documentElement.childNodes&&a.documentElement.childNodes.length>0&&a.documentElement.childNodes[0].nodeName==="parsererror")return a.documentElement.childNodes[0];if(a.documentElement.tagName==="html"&&a.documentElement.childNodes&&a.documentElement.childNodes.length>0&&a.documentElement.childNodes[0].nodeName==="body"&&a.documentElement.childNodes[0].childNodes&&a.documentElement.childNodes[0].childNodes.length&&a.documentElement.childNodes[0].childNodes[0].nodeName==="parsererror")return a.documentElement.childNodes[0].childNodes[0]},r=[new RegExp(`^<h3[^>]*>This page contains the following errors:</h3><div[^>]*>(.+?)
153
+ ?</div>`),new RegExp(`^(.+)
154
+ `)],n=function(a){var o=e(a),l,u;for(l=0;l<r.length;l++)if(u=r[l].exec(o),u)return u[1]},i=function(a){var o;if(a===null)throw new Error("Parse error");var l=t(a);if(l!==void 0)throw o=n(l)||"Parse error",new Error(o)};return Ng.failOnParseError=function(a){return i(a),a},Ng}var Ig={},Dg={},d_;function Xp(){return d_||(d_=1,function(e){var t=uS();e.getDocumentBaseUrl=function(l){return l.baseURI!=="about:blank"?l.baseURI:null},e.clone=function(l){var u={},f;for(f in l)l.hasOwnProperty(f)&&(u[f]=l[f]);return u},e.cloneArray=function(l){return Array.prototype.slice.apply(l,[0])},e.joinUrl=function(l,u){return l?t.resolve(l,u):u},e.isDataUri=function(l){return/^data:/.test(l)},e.collectAndReportErrors=function(l){var u=[];return Promise.all(l.map(function(f){return f.catch(function(h){u.push(h)})})).then(function(){return u})};var r=null,n=function(l,u){return u===!1||u==="none"||u==="repeated"?((r===null||u!=="repeated")&&(r=Date.now()),l+"?_="+r):l};e.ajax=function(l,u){return new Promise(function(f,h){var E=new window.XMLHttpRequest,w=e.joinUrl(u.baseUrl,l),p,S=function(){h({msg:"Unable to load url",url:w})};p=n(w,u.cache),E.addEventListener("load",function(){E.status===200||E.status===0?f(E.response):S()},!1),E.addEventListener("error",S,!1);try{E.open("GET",p,!0),E.overrideMimeType(u.mimeType),E.send(null)}catch{S()}})},e.binaryAjax=function(l,u){var f=e.clone(u);return f.mimeType="text/plain; charset=x-user-defined",e.ajax(l,f).then(function(h){for(var E="",w=0;w<h.length;w++)E+=String.fromCharCode(h.charCodeAt(w)&255);return E})};var i=function(l){var u=function(f,h){return f.substring(0,h.length)===h};return u(l,"<?xml")||u(l,"<svg")?"image/svg+xml":"image/png"};e.getDataURIForImageURL=function(l,u){return e.binaryAjax(l,u).then(function(f){var h=btoa(f),E=i(f);return"data:"+E+";base64,"+h})};var a=[],o=function(l){return a.indexOf(l)<0&&a.push(l),a.indexOf(l)};e.memoize=function(l,u,f){if(typeof f!="object")throw new Error("cacheBucket is not an object");return function(){var h=Array.prototype.slice.call(arguments),E=u(h),w=o(l),p;return f[w]&&f[w][E]?f[w][E]:(p=l.apply(null,h),f[w]=f[w]||{},f[w][E]=p,p)}}}(Dg)),Dg}var jg={},h_;function JD(){if(h_)return jg;h_=1;var e=Xp(),t=function(a,o){var l=null;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"));var u=e.getDocumentBaseUrl(a.ownerDocument),f=e.clone(o);return!f.baseUrl&&u&&(f.baseUrl=u),e.getDataURIForImageURL(l,f).then(function(h){return h},function(h){throw{resourceType:"image",url:h.url,msg:"Unable to load image "+h.url}})},r=function(a){return a.filter(function(o){var l=null;return 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")),l!==null&&!e.isDataUri(l)})},n=function(a){return Array.prototype.filter.call(a,function(o){return o.type==="image"})},i=function(a){return Array.prototype.slice.call(a)};return jg.inline=function(a,o){var l=i(a.getElementsByTagName("img")),u=i(a.getElementsByTagName("image")),f=n(a.getElementsByTagName("input"));l=l.concat(u),l=l.concat(f);var h=r(l);return e.collectAndReportErrors(h.map(function(E){return t(E,o).then(function(w){E.attributes.src?E.attributes.src.value=w:E.attributes["xlink:href"]?E.attributes["xlink:href"].value=w:E.attributes.href&&(E.attributes.href.value=w)})}))},jg}var Fg={},p_;function ej(){if(p_)return Fg;p_=1;var e=Xp(),t=function(a,o){var l=a.attributes.src.value,u=e.getDocumentBaseUrl(a.ownerDocument),f=e.clone(o);return!f.baseUrl&&u&&(f.baseUrl=u),e.ajax(l,f).catch(function(h){throw{resourceType:"script",url:h.url,msg:"Unable to load script "+h.url}})},r=function(a){return a.replace(/<\//g,"<\\/")},n=function(a,o){a.attributes.removeNamedItem("src"),a.textContent=r(o)},i=function(a){var o=a.getElementsByTagName("script");return Array.prototype.filter.call(o,function(l){return!!l.attributes.src})};return Fg.inline=function(a,o){var l=i(a);return e.collectAndReportErrors(l.map(function(u){return t(u,o).then(function(f){n(u,f)})}))},Fg}var zg={},Bg={},g_;function y2(){return g_||(g_=1,function(e){e.unquoteString=function(t){var r=/^"(.*)"$/,n=/^'(.*)'$/;return r.test(t)?t.replace(r,"$1"):n.test(t)?t.replace(n,"$1"):t},e.rulesForCssText=function(t){var r=document.implementation.createHTMLDocument(""),n=document.createElement("style"),i;return n.textContent=t,r.body.appendChild(n),i=n.sheet.cssRules,Array.prototype.slice.call(i)},e.cssRulesToText=function(t){return t.reduce(function(r,n){return r+n.cssText},"")},e.exchangeRule=function(t,r,n){var i=t.indexOf(r);t[i]=e.rulesForCssText(n)[0]},e.changeFontFaceRuleSrc=function(t,r,n){var i="@font-face { font-family: "+r.style.getPropertyValue("font-family")+"; ";r.style.getPropertyValue("font-style")&&(i+="font-style: "+r.style.getPropertyValue("font-style")+"; "),r.style.getPropertyValue("font-weight")&&(i+="font-weight: "+r.style.getPropertyValue("font-weight")+"; "),r.style.getPropertyValue("unicode-range")&&(i+="unicode-range: "+r.style.getPropertyValue("unicode-range")+"; "),i+="src: "+n+"}",e.exchangeRule(t,r,i)}}(Bg)),Bg}var Ug={},v_;function tj(){return v_||(v_=1,function(e){var t=y2(),r=function(a){var o=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return a.replace(o,"$1")};e.extractCssUrl=function(a){var o=/^url\(("[^"]+"|'[^']+'|[^\)]+)\)/,l;if(!o.test(a))throw new Error("Invalid url");return l=o.exec(a)[1],t.unquoteString(r(l))};var n=function(a){var o=`\\s*(?:"[^"]*"|'[^']*'|[^\\(]+)\\s*`,l="(url\\("+o+"\\)|[^,\\s]+)",u="(?:\\s*"+l+")+",f="^\\s*("+u+")(?:\\s*,\\s*("+u+"))*\\s*$",h=new RegExp(u,"g"),E,w=[],p=function(S){var b=new RegExp(l,"g"),y=[],v;for(v=b.exec(S);v;)y.push(v[1]),v=b.exec(S);return y};if(a.match(new RegExp(f))){for(E=h.exec(a);E;)w.push(p(E[0])),E=h.exec(a);return w}return[]},i=function(a){var o,l;for(o=0;o<a.length;o++)try{return l=e.extractCssUrl(a[o]),{url:l,idx:o}}catch{}};e.parse=function(a){var o=n(a);return o.map(function(l){var u=i(l);return u?{preUrl:l.slice(0,u.idx),url:u.url,postUrl:l.slice(u.idx+1)}:{preUrl:l}})},e.serialize=function(a){var o=a.map(function(l){var u=[].concat(l.preUrl);return l.url&&u.push('url("'+l.url+'")'),l.postUrl&&(u=u.concat(l.postUrl)),u.join(" ")});return o.join(", ")}}(Ug)),Ug}function bd(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Hg={exports:{}},m_;function rj(){return m_||(m_=1,function(e,t){(function(r){e.exports=r()})(function(){return function r(n,i,a){function o(f,h){if(!i[f]){if(!n[f]){var E=typeof bd=="function"&&bd;if(!h&&E)return E(f,!0);if(l)return l(f,!0);var w=new Error("Cannot find module '"+f+"'");throw w.code="MODULE_NOT_FOUND",w}var p=i[f]={exports:{}};n[f][0].call(p.exports,function(S){var b=n[f][1][S];return o(b||S)},p,p.exports,r,n,i,a)}return i[f].exports}for(var l=typeof bd=="function"&&bd,u=0;u<a.length;u++)o(a[u]);return o}({1:[function(r,n,i){function a(u,f){function h(){this.constructor=u}h.prototype=f.prototype,u.prototype=new h}function o(u,f,h,E){this.message=u,this.expected=f,this.found=h,this.location=E,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,o)}a(o,Error),o.buildMessage=function(u,f){var h={literal:function(v){return'"'+w(v.text)+'"'},class:function(v){var m="",d;for(d=0;d<v.parts.length;d++)m+=v.parts[d]instanceof Array?p(v.parts[d][0])+"-"+p(v.parts[d][1]):p(v.parts[d]);return"["+(v.inverted?"^":"")+m+"]"},any:function(v){return"any character"},end:function(v){return"end of input"},other:function(v){return v.description}};function E(v){return v.charCodeAt(0).toString(16).toUpperCase()}function w(v){return v.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(m){return"\\x0"+E(m)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(m){return"\\x"+E(m)})}function p(v){return v.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(m){return"\\x0"+E(m)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(m){return"\\x"+E(m)})}function S(v){return h[v.type](v)}function b(v){var m=new Array(v.length),d,g;for(d=0;d<v.length;d++)m[d]=S(v[d]);if(m.sort(),m.length>0){for(d=1,g=1;d<m.length;d++)m[d-1]!==m[d]&&(m[g]=m[d],g++);m.length=g}switch(m.length){case 1:return m[0];case 2:return m[0]+" or "+m[1];default:return m.slice(0,-1).join(", ")+", or "+m[m.length-1]}}function y(v){return v?'"'+w(v)+'"':"end of input"}return"Expected "+b(u)+" but "+y(f)+" found."};function l(u,f){f=f!==void 0?f:{};var h={},E={start:ee},w=ee,p="",S=function(){return[]},b=",",y=K(",",!1),v=function(re,ce){return[re].concat(ce)},m=function(re){return[re]},d=function(re,ce){return{url:re,format:ce}},g=function(re){return{url:re}},_="url(",k=K("url(",!1),C=")",P=K(")",!1),O=function(re){return re},x="format(",A=K("format(",!1),L="local(",I=K("local(",!1),U=function(re){return{local:re}},$=/^[^)]/,Z=G([")"],!0,!1),q=function(re){return ve.extractValue(re.join(""))},z=/^[ \t\r\n\f]/,W=G([" "," ","\r",`
155
+ `,"\f"],!1,!1),R=0,M=[{line:1,column:1}],F=0,D=[],H;if("startRule"in f){if(!(f.startRule in E))throw new Error(`Can't start parsing from rule "`+f.startRule+'".');w=E[f.startRule]}function K(re,ce){return{type:"literal",text:re,ignoreCase:ce}}function G(re,ce,be){return{type:"class",parts:re,inverted:ce,ignoreCase:be}}function B(){return{type:"end"}}function Y(re){var ce=M[re],be;if(ce)return ce;for(be=re-1;!M[be];)be--;for(ce=M[be],ce={line:ce.line,column:ce.column};be<re;)u.charCodeAt(be)===10?(ce.line++,ce.column=1):ce.column++,be++;return M[re]=ce,ce}function X(re,ce){var be=Y(re),Oe=Y(ce);return{start:{offset:re,line:be.line,column:be.column},end:{offset:ce,line:Oe.line,column:Oe.column}}}function Q(re){R<F||(R>F&&(F=R,D=[]),D.push(re))}function te(re,ce,be){return new o(o.buildMessage(re,ce),re,ce,be)}function ee(){var re,ce;return re=ie(),re===h&&(re=R,ce=p,ce!==h&&(ce=S()),re=ce),re}function ie(){var re,ce,be,Oe,$e,Qe;if(re=R,ce=ne(),ce!==h){for(be=[],Oe=_e();Oe!==h;)be.push(Oe),Oe=_e();if(be!==h)if(u.charCodeAt(R)===44?(Oe=b,R++):(Oe=h,Q(y)),Oe!==h){for($e=[],Qe=_e();Qe!==h;)$e.push(Qe),Qe=_e();$e!==h?(Qe=ie(),Qe!==h?(ce=v(ce,Qe),re=ce):(R=re,re=h)):(R=re,re=h)}else R=re,re=h;else R=re,re=h}else R=re,re=h;return re===h&&(re=R,ce=ne(),ce!==h&&(ce=m(ce)),re=ce),re}function ne(){var re;return re=le(),re===h&&(re=se()),re}function le(){var re,ce,be,Oe;if(re=R,ce=Te(),ce!==h){if(be=[],Oe=_e(),Oe!==h)for(;Oe!==h;)be.push(Oe),Oe=_e();else be=h;be!==h?(Oe=Ie(),Oe!==h?(ce=d(ce,Oe),re=ce):(R=re,re=h)):(R=re,re=h)}else R=re,re=h;return re===h&&(re=R,ce=Te(),ce!==h&&(ce=g(ce)),re=ce),re}function Te(){var re,ce,be,Oe;return re=R,u.substr(R,4)===_?(ce=_,R+=4):(ce=h,Q(k)),ce!==h?(be=de(),be!==h?(u.charCodeAt(R)===41?(Oe=C,R++):(Oe=h,Q(P)),Oe!==h?(ce=O(be),re=ce):(R=re,re=h)):(R=re,re=h)):(R=re,re=h),re}function Ie(){var re,ce,be,Oe;return re=R,u.substr(R,7)===x?(ce=x,R+=7):(ce=h,Q(A)),ce!==h?(be=de(),be!==h?(u.charCodeAt(R)===41?(Oe=C,R++):(Oe=h,Q(P)),Oe!==h?(ce=O(be),re=ce):(R=re,re=h)):(R=re,re=h)):(R=re,re=h),re}function se(){var re,ce,be,Oe;return re=R,u.substr(R,6)===L?(ce=L,R+=6):(ce=h,Q(I)),ce!==h?(be=de(),be!==h?(u.charCodeAt(R)===41?(Oe=C,R++):(Oe=h,Q(P)),Oe!==h?(ce=U(be),re=ce):(R=re,re=h)):(R=re,re=h)):(R=re,re=h),re}function de(){var re,ce,be;if(re=R,ce=[],$.test(u.charAt(R))?(be=u.charAt(R),R++):(be=h,Q(Z)),be!==h)for(;be!==h;)ce.push(be),$.test(u.charAt(R))?(be=u.charAt(R),R++):(be=h,Q(Z));else ce=h;return ce!==h&&(ce=q(ce)),re=ce,re}function _e(){var re;return z.test(u.charAt(R))?(re=u.charAt(R),R++):(re=h,Q(W)),re}var ve=r("../util");if(H=w(),H!==h&&R===u.length)return H;throw H!==h&&R<u.length&&Q(B()),te(D,F<u.length?u.charAt(F):null,F<u.length?X(F,F+1):X(F,F))}n.exports={SyntaxError:o,parse:l}},{"../util":3}],2:[function(r,n,i){var a=r("./grammar");i.SyntaxError=function(o,l){this.message=o,this.offset=l},i.parse=function(o){try{return a.parse(o)}catch(l){throw new i.SyntaxError(l.message,l.offset)}},i.serialize=function(o){return o.map(function(l){var u;return l.url?(u='url("'+l.url+'")',l.format&&(u+=' format("'+l.format+'")')):u='local("'+l.local+'")',u}).join(", ")}},{"./grammar":1}],3:[function(r,n,i){var a=function(l){var u=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return l.replace(u,"$1")},o=function(l){var u=/^"(.*)"$/,f=/^'(.*)'$/;return u.test(l)?l.replace(u,"$1"):f.test(l)?l.replace(f,"$1"):l};i.extractValue=function(l){return o(a(l))}},{}]},{},[2])(2)})}(Hg)),Hg.exports}var y_;function nj(){return y_||(y_=1,function(e){var t=Xp(),r=y2(),n=tj(),i=rj(),a=function(m,d,g){m.style.setProperty(d,g,m.style.getPropertyPriority(d))},o=function(m){return m.filter(function(d){return d.type===window.CSSRule.STYLE_RULE&&(d.style.getPropertyValue("background-image")||d.style.getPropertyValue("background"))})},l=function(m){var d=[];return m.forEach(function(g){g.style.getPropertyValue("background-image")?d.push({property:"background-image",value:g.style.getPropertyValue("background-image"),rule:g}):g.style.getPropertyValue("background")&&d.push({property:"background",value:g.style.getPropertyValue("background"),rule:g})}),d},u=function(m){return m.filter(function(d){return d.type===window.CSSRule.FONT_FACE_RULE&&d.style.getPropertyValue("src")})},f=function(m){return m.filter(function(d){return d.type===window.CSSRule.IMPORT_RULE&&d.href})},h=function(m){var d=[];return m.forEach(function(g,_){g.url&&!t.isDataUri(g.url)&&d.push(_)}),d},E=function(m){var d=[];return m.forEach(function(g,_){g.url&&!t.isDataUri(g.url)&&d.push(_)}),d};e.adjustPathsOfCssResources=function(m,d){var g=o(d),_=l(g),k=!1;return _.forEach(function(C){var P=n.parse(C.value),O=h(P),x;O.length>0&&(O.forEach(function(A){var L=P[A].url,I=t.joinUrl(m,L);P[A].url=I}),x=n.serialize(P),a(C.rule,C.property,x),k=!0)}),u(d).forEach(function(C){var P=C.style.getPropertyValue("src"),O,x;try{O=i.parse(P)}catch{return}x=E(O),x.length>0&&(x.forEach(function(A){var L=O[A].url,I=t.joinUrl(m,L);O[A].url=I}),r.changeFontFaceRuleSrc(d,C,i.serialize(O)),k=!0)}),f(d).forEach(function(C){var P=C.href,O=t.joinUrl(m,P);r.exchangeRule(d,C,"@import url("+O+");"),k=!0}),k};var w=function(m,d,g){var _=m.indexOf(d);m.splice(_,1),g.forEach(function(k,C){m.splice(_+C,0,k)})},p=function(m,d,g,_){var k=d.href,C;return k=r.unquoteString(k),C=t.joinUrl(_.baseUrl,k),g.indexOf(C)>=0?(w(m,d,[]),Promise.resolve([])):(g.push(C),t.ajax(k,_).then(function(P){var O=r.rulesForCssText(P);return e.loadCSSImportsForRules(O,g,_).then(function(x){return e.adjustPathsOfCssResources(k,O),w(m,d,O),x.errors})},function(P){throw{resourceType:"stylesheet",url:P.url,msg:"Unable to load stylesheet "+P.url}}))};e.loadCSSImportsForRules=function(m,d,g){var _=f(m),k=[],C=!1;return Promise.all(_.map(function(P){return p(m,P,d,g).then(function(O){k=k.concat(O),C=!0},function(O){k.push(O)})})).then(function(){return{hasChanges:C,errors:k}})};var S=function(m,d){var g=n.parse(m),_=h(g),k=!1;return t.collectAndReportErrors(_.map(function(C){var P=g[C].url;return t.getDataURIForImageURL(P,d).then(function(O){g[C].url=O,k=!0},function(O){throw{resourceType:"backgroundImage",url:O.url,msg:"Unable to load background-image "+O.url}})})).then(function(C){return{backgroundValue:n.serialize(g),hasChanges:k,errors:C}})},b=function(m,d){var g=o(m),_=l(g),k=[],C=!1;return Promise.all(_.map(function(P){return S(P.value,d).then(function(O){O.hasChanges&&(a(P.rule,P.property,O.backgroundValue),C=!0),k=k.concat(O.errors)})})).then(function(){return{hasChanges:C,errors:k}})},y=function(m,d){var g=!1,_,k;try{_=i.parse(m)}catch{_=[]}return k=E(_),t.collectAndReportErrors(k.map(function(C){var P=_[C],O=P.format||"woff";return t.binaryAjax(P.url,d).then(function(x){var A=btoa(x);P.url="data:font/"+O+";base64,"+A,g=!0},function(x){throw{resourceType:"fontFace",url:x.url,msg:"Unable to load font-face "+x.url}})})).then(function(C){return{srcDeclarationValue:i.serialize(_),hasChanges:g,errors:C}})},v=function(m,d){var g=u(m),_=[],k=!1;return Promise.all(g.map(function(C){var P=C.style.getPropertyValue("src");return y(P,d).then(function(O){O.hasChanges&&(r.changeFontFaceRuleSrc(m,C,O.srcDeclarationValue),k=!0),_=_.concat(O.errors)})})).then(function(){return{hasChanges:k,errors:_}})};e.loadAndInlineCSSResourcesForRules=function(m,d){var g=!1,_=[];return Promise.all([b,v].map(function(k){return k(m,d).then(function(C){g=g||C.hasChanges,_=_.concat(C.errors)})})).then(function(){return{hasChanges:g,errors:_}})}}(zg)),zg}var b_;function ij(){return b_||(b_=1,function(e){var t=Xp(),r=JD(),n=ej(),i=nj(),a=y2(),o=function(y){return t.joinUrl(y,".")},l=function(y){var v=y.map(function(m,d){return d===y.length-1&&(m={baseUrl:o(m.baseUrl)}),JSON.stringify(m)});return v},u=function(y,v){return v.cache!==!1&&v.cache!=="none"&&v.cacheBucket?t.memoize(y,l,v.cacheBucket):y},f=function(y,v,m){var d=a.rulesForCssText(y);return i.loadCSSImportsForRules(d,v,m).then(function(g){return i.loadAndInlineCSSResourcesForRules(d,m).then(function(_){var k=g.errors.concat(_.errors),C=g.hasChanges||_.hasChanges;return C&&(y=a.cssRulesToText(d)),{hasChanges:C,content:y,errors:k}})})},h=function(y,v,m){var d=y.textContent,g=u(f,v);return g(d,m,v).then(function(_){return _.hasChanges&&(y.childNodes[0].nodeValue=_.content),t.cloneArray(_.errors)})},E=function(y){var v=y.getElementsByTagName("style");return Array.prototype.filter.call(v,function(m){return!m.attributes.type||m.attributes.type.value==="text/css"})};e.loadAndInlineStyles=function(y,v){var m=E(y),d=[],g=[],_;return _=t.clone(v),_.baseUrl=_.baseUrl||t.getDocumentBaseUrl(y),Promise.all(m.map(function(k){return h(k,_,g).then(function(C){d=d.concat(C)})})).then(function(){return d})};var w=function(y,v){var m=y.parentNode,d;v=v.trim(),v&&(d=y.ownerDocument.createElement("style"),d.type="text/css",d.appendChild(y.ownerDocument.createTextNode(v)),m.insertBefore(d,y)),m.removeChild(y)},p=function(y,v){return t.ajax(y,v).then(function(m){var d=a.rulesForCssText(m);return{content:m,cssRules:d}}).then(function(m){var d=i.adjustPathsOfCssResources(y,m.cssRules);return{content:m.content,cssRules:m.cssRules,hasChanges:d}}).then(function(m){return i.loadCSSImportsForRules(m.cssRules,[],v).then(function(d){return{content:m.content,cssRules:m.cssRules,hasChanges:m.hasChanges||d.hasChanges,errors:d.errors}})}).then(function(m){return i.loadAndInlineCSSResourcesForRules(m.cssRules,v).then(function(d){return{content:m.content,cssRules:m.cssRules,hasChanges:m.hasChanges||d.hasChanges,errors:m.errors.concat(d.errors)}})}).then(function(m){var d=m.content;return m.hasChanges&&(d=a.cssRulesToText(m.cssRules)),{content:d,errors:m.errors}})},S=function(y,v){var m=y.attributes.href.value,d=t.getDocumentBaseUrl(y.ownerDocument),g=t.clone(v);!g.baseUrl&&d&&(g.baseUrl=d);var _=u(p,v);return _(m,g).then(function(k){return{content:k.content,errors:t.cloneArray(k.errors)}})},b=function(y){var v=y.getElementsByTagName("link");return Array.prototype.filter.call(v,function(m){return m.attributes.rel&&m.attributes.rel.value==="stylesheet"&&(!m.attributes.type||m.attributes.type.value==="text/css")})};e.loadAndInlineCssLinks=function(y,v){var m=b(y),d=[];return Promise.all(m.map(function(g){return S(g,v).then(function(_){w(g,_.content+`
156
+ `),d=d.concat(_.errors)},function(_){d.push({resourceType:"stylesheet",url:_.url,msg:"Unable to load stylesheet "+_.url})})})).then(function(){return d})},e.loadAndInlineImages=r.inline,e.loadAndInlineScript=n.inline,e.inlineReferences=function(y,v){var m=[],d=[e.loadAndInlineImages,e.loadAndInlineStyles,e.loadAndInlineCssLinks];return v.inlineScripts!==!1&&d.push(e.loadAndInlineScript),Promise.all(d.map(function(g){return g(y,v).then(function(_){m=m.concat(_)})})).then(function(){return m})}}(Ig)),Ig}/*! rasterizeHTML.js - v1.3.1 - 2022-01-16
157
+ * http://www.github.com/cburgmer/rasterizeHTML.js
158
+ * Copyright (c) 2022 Christoph Burgmer; Licensed MIT */(function(e){(function(t,r){t===void 0&&window!==void 0&&(t=window),e.exports?e.exports=r(uS(),ZD(),QD(),ij()):t.rasterizeHTML=r(t.url,t.xmlserializer,t.sanedomparsererror,t.inlineresources)})(me,function(t,r,n,i){var a=function(S){var b={},y=[];b.joinUrl=function(d,g){return d?S.resolve(d,g):g},b.getConstantUniqueIdFor=function(d){return y.indexOf(d)<0&&y.push(d),y.indexOf(d)},b.clone=function(d){var g={},_;for(_ in d)d.hasOwnProperty(_)&&(g[_]=d[_]);return g};var v=function(d){return typeof d=="object"&&d!==null},m=function(d){return v(d)&&Object.prototype.toString.apply(d).match(/\[object (Canvas|HTMLCanvasElement)\]/i)};return b.parseOptionalParameters=function(d){var g={canvas:null,options:{}};return d[0]==null||m(d[0])?(g.canvas=d[0]||null,g.options=b.clone(d[1])):g.options=b.clone(d[0]),g},b}(t),o=function(S){var b={},y=function(v,m,d){var g=v[m];return v[m]=function(){var _=Array.prototype.slice.call(arguments);return d.apply(this,[_,g])},g};return b.baseUrlRespectingXhr=function(v,m){var d=function(){var g=new v;return y(g,"open",function(_,k){var C=_.shift(),P=_.shift(),O=S.joinUrl(m,P);return k.apply(this,[C,O].concat(_))}),g};return d},b.finishNotifyingXhr=function(v){var m=0,d=0,g=!1,_,k=new Promise(function(P){_=function(){var O=m-d;O<=0&&g&&P({totalCount:m})}}),C=function(){var P=new v;return y(P,"send",function(O,x){return m+=1,x.apply(this,arguments)}),P.addEventListener("load",function(){d+=1,_()}),P};return C.waitForRequestsToFinish=function(){return g=!0,_(),k},C},b}(a),l=function(){var S={},b=function(C){return Array.prototype.slice.call(C)};S.addClassName=function(C,P){C.className+=" "+P},S.addClassNameRecursively=function(C,P){S.addClassName(C,P),C.parentNode!==C.ownerDocument&&S.addClassNameRecursively(C.parentNode,P)};var y=function(C,P){var O=C.parentStyleSheet,x=b(O.cssRules).indexOf(C);O.insertRule(P,x+1),O.deleteRule(x)},v=function(C,P){var O=C.cssText.replace(/^[^\{]+/,""),x=P+" "+O;y(C,x)},m=function(C){return b(C).reduce(function(P,O){return P+O.cssText},"")},d=function(C){C.textContent=m(C.sheet.cssRules)},g=function(C){var P=document.implementation.createHTMLDocument(""),O=document.createElement("style");O.textContent=C.textContent,P.body.appendChild(O),C.sheet=O.sheet},_=function(C){return"((?:^|[^.#:\\w])|(?=\\W))("+C.join("|")+")(?=\\W|$)"},k=function(C,P,O){var x=_(P);b(C.querySelectorAll("style")).forEach(function(A){typeof A.sheet>"u"&&g(A);var L=b(A.sheet.cssRules).filter(function(I){return I.selectorText&&new RegExp(x,"i").test(I.selectorText)});L.length&&(L.forEach(function(I){var U=I.selectorText.replace(new RegExp(x,"gi"),function($,Z,q){return Z+O(q)});U!==I.selectorText&&v(I,U)}),d(A))})};return S.rewriteCssSelectorWith=function(C,P,O){k(C,[P],function(){return O})},S.lowercaseCssTypeSelectors=function(C,P){k(C,P,function(O){return O.toLowerCase()})},S.findHtmlOnlyNodeNames=function(C){var P=C.ownerDocument.createTreeWalker(C,NodeFilter.SHOW_ELEMENT),O={},x={},A;do A=P.currentNode.tagName.toLowerCase(),P.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?O[A]=!0:x[A]=!0;while(P.nextNode());return Object.keys(O).filter(function(L){return!x[L]})},S}(),u=function(S){var b={},y=function(m){return Array.prototype.slice.call(m)},v={active:!0,hover:!0,focus:!1,target:!1};return b.fakeUserAction=function(m,d,g){var _=m.querySelector(d),k=":"+g,C="rasterizehtml"+g;_&&(v[g]?S.addClassNameRecursively(_,C):S.addClassName(_,C),S.rewriteCssSelectorWith(m,k,"."+C))},b.persistInputValues=function(m){var d=m.querySelectorAll("input"),g=m.querySelectorAll("textarea"),_=function(k){return k.type==="checkbox"||k.type==="radio"};y(d).filter(_).forEach(function(k){k.checked?k.setAttribute("checked",""):k.removeAttribute("checked")}),y(d).filter(function(k){return!_(k)}).forEach(function(k){k.setAttribute("value",k.value)}),y(g).forEach(function(k){k.textContent=k.value})},b.rewriteTagNameSelectorsToLowerCase=function(m){S.lowercaseCssTypeSelectors(m,S.findHtmlOnlyNodeNames(m))},b}(l),f=function(S,b,y,v){var m={},d=function(q,z,W,R){var M=q.createElement(z);return M.style.visibility="hidden",M.style.width=W+"px",M.style.height=R+"px",M.style.position="absolute",M.style.top=-1e4-R+"px",M.style.left=-1e4-W+"px",q.getElementsByTagName("body")[0].appendChild(M),M},g=function(q){return q>0?new Promise(function(z){setTimeout(z,q)}):Promise.resolve()};m.executeJavascript=function(q,z){return new Promise(function(W){var R=d(v.document,"iframe",z.width,z.height),M=q.outerHTML,F=[],D=z.executeJsTimeout||0,H=function(){v.document.getElementsByTagName("body")[0].removeChild(R)},K=function(){var X=R.contentDocument;W({document:X,errors:F,cleanUp:H})},G=R.contentWindow.XMLHttpRequest,B=b.finishNotifyingXhr(G),Y=b.baseUrlRespectingXhr(B,z.baseUrl);R.onload=function(){g(D).then(B.waitForRequestsToFinish).then(K)},R.contentDocument.open(),R.contentWindow.XMLHttpRequest=Y,R.contentWindow.onerror=function(X){F.push({resourceType:"scriptExecution",msg:X})},R.contentDocument.write("<!DOCTYPE html>"),R.contentDocument.write(M),R.contentDocument.close()})};var _=function(q,z,W){var R=q.createElement("iframe");return R.style.width=z+"px",R.style.height=W+"px",R.style.visibility="hidden",R.style.position="absolute",R.style.top=-1e4-W+"px",R.style.left=-1e4-z+"px",R.style.borderWidth=0,R.sandbox="allow-same-origin",R.scrolling="no",R},k=function(q,z,W){var R=Math.floor(q/W),M=Math.floor(z/W);return _(v.document,R,M)},C=function(q,z,W,R){return{width:Math.max(q.width*R,z),height:Math.max(q.height*R,W)}},P=function(q,z){var W=q.querySelector(z);if(W)return W;if(q.ownerDocument.querySelector(z)===q)return q;throw{message:"Clipping selector not found"}},O=function(q,z,W,R,M){var F=Math.max(q.scrollWidth,q.clientWidth),D=Math.max(q.scrollHeight,q.clientHeight),H,K,G,B,Y,X,Q,te;return z?(X=P(q,z),Q=X.getBoundingClientRect(),H=Q.top,K=Q.left,G=Q.width,B=Q.height):(H=0,K=0,G=F,B=D),te=C({width:G,height:B},W,R,M),Y=v.getComputedStyle(q.ownerDocument.documentElement).fontSize,{left:K,top:H,width:te.width,height:te.height,viewportWidth:F,viewportHeight:D,rootFontSize:Y}},x=function(q,z){var W=q.tagName;return z.querySelector(W)},A=function(q){var z=q.tagName.toLowerCase();return z==="html"||z==="body"?q.outerHTML:'<body style="margin: 0;">'+q.outerHTML+"</body>"};m.calculateDocumentContentSize=function(q,z){return new Promise(function(W,R){var M=z.zoom||1,F;F=k(z.width,z.height,M),v.document.getElementsByTagName("body")[0].appendChild(F),F.onload=function(){var D=F.contentDocument,H;try{H=O(x(q,D),z.clip,z.width,z.height,M),W(H)}catch(K){R(K)}finally{v.document.getElementsByTagName("body")[0].removeChild(F)}},F.contentDocument.open(),F.contentDocument.write("<!DOCTYPE html>"),F.contentDocument.write(A(q)),F.contentDocument.close()})},m.parseHtmlFragment=function(q){var z=v.document.implementation.createHTMLDocument("");z.documentElement.innerHTML=q;var W=z.querySelector("body").firstChild;if(!W)throw"Invalid source";return W};var L=function(q,z){var W=/<html((?:\s+[^>]*)?)>/im.exec(z),R=v.document.implementation.createHTMLDocument(""),M,F,D,H;if(W)for(M="<div"+W[1]+"></div>",R.documentElement.innerHTML=M,D=R.querySelector("div"),F=0;F<D.attributes.length;F++)H=D.attributes[F],q.documentElement.setAttribute(H.name,H.value)};m.parseHTML=function(q){var z=v.document.implementation.createHTMLDocument("");return z.documentElement.innerHTML=q,L(z,q),z};var I=function(q){try{return y.failOnParseError(q)}catch(z){throw{message:"Invalid source",originalError:z}}};m.validateXHTML=function(q){var z=new DOMParser,W=z.parseFromString(q,"application/xml");I(W)};var U=null,$=function(q,z){return z==="none"||z==="repeated"?((U===null||z!=="repeated")&&(U=Date.now()),q+"?_="+U):q},Z=function(q,z){return new Promise(function(W,R){var M=new window.XMLHttpRequest,F=S.joinUrl(z.baseUrl,q),D=$(F,z.cache),H=function(K){R({message:"Unable to load page",originalError:K})};M.addEventListener("load",function(){M.status===200||M.status===0?W(M.responseXML):H(M.statusText)},!1),M.addEventListener("error",function(K){H(K)},!1);try{M.open("GET",D,!0),M.responseType="document",M.send(null)}catch(K){H(K)}})};return m.loadDocument=function(q,z){return Z(q,z).then(function(W){return I(W)})},m}(a,o,n,window),h=function(S){var b={},y=function(x,A){return A?URL.createObjectURL(new Blob([x],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(x)},v=function(x){x instanceof Blob&&URL.revokeObjectURL(x)},m='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',d=function(x){return new Promise(function(A,L){var I=document.createElement("canvas"),U=new Image;U.onload=function(){var $=I.getContext("2d");try{$.drawImage(U,0,0),I.toDataURL("image/png"),A(!0)}catch{A(!1)}},U.onerror=L,U.src=x})},g=function(){var x=y(m,!0);return d(x).then(function(A){return v(x),A?!1:d(y(m,!1)).then(function(L){return L})},function(){return!1})},_=function(){if(S.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch{}return!1},k=function(){return new Promise(function(x,A){_()&&S.URL?g().then(function(L){x(!L)},function(){A()}):x(!1)})},C,P=function(){return C===void 0&&(C=k()),C},O=function(x){return P().then(function(A){return y(x,A)})};return b.renderSvg=function(x){return new Promise(function(A,L){var I,U,$=function(){U.onload=null,U.onerror=null},Z=function(){I&&v(I)};U=new Image,U.onload=function(){$(),Z(),A(U)},U.onerror=function(){Z(),L()},O(x).then(function(q){I=q,U.src=I},L)})},b}(window),E=function(S,b,y,v){var m={},d=function(x,A){var L=A||1,I={width:x.width,height:x.height,"font-size":x.rootFontSize};return L!==1&&(I.style="transform:scale("+L+"); transform-origin: 0 0;"),I},g=function(x){var A,L,I,U;A=Math.round(x.viewportWidth),L=Math.round(x.viewportHeight),I=-x.left,U=-x.top;var $={x:I,y:U,width:A,height:L};return $},_=function(x){var A=x.style||"";x.style=A+"float: left;"},k=function(x){x.externalResourcesRequired=!0},C=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},P=function(x){var A=Object.keys(x);return A.length?" "+A.map(function(L){return L+'="'+x[L]+'"'}).join(" "):""},O=function(x,A,L){var I=v.serializeToString(x);b.validateXHTML(I);var U=g(A);return _(U),k(U),'<svg xmlns="http://www.w3.org/2000/svg"'+P(d(A,L))+">"+C()+"<foreignObject"+P(U)+">"+I+"</foreignObject></svg>"};return m.getSvgForDocument=function(x,A,L){return y.rewriteTagNameSelectorsToLowerCase(x),O(x,A,L)},m.drawDocumentAsSvg=function(x,A){return["hover","active","focus","target"].forEach(function(L){A[L]&&y.fakeUserAction(x,A[L],L)}),b.calculateDocumentContentSize(x,A).then(function(L){return m.getSvgForDocument(x,L,A.zoom)})},m}(a,f,u,r),w=function(S,b,y,v,m,d){var g={},_=function(x){return{message:"Error rendering page",originalError:x}},k=function(x){return m.renderSvg(x).then(function(A){return{image:A,svg:x}},function(A){throw _(A)})},C=function(x,A){try{A.getContext("2d").drawImage(x,0,0)}catch(L){throw _(L)}},P=function(x,A,L){return v.drawDocumentAsSvg(x,L).then(k).then(function(I){return A&&C(I.image,A),I})},O=function(x,A){return b.executeJavascript(x,A).then(function(L){var I=L.document;return y.persistInputValues(I),{document:I,errors:L.errors,cleanUp:L.cleanUp}})};return g.rasterize=function(x,A,L){var I;return I=S.clone(L),I.inlineScripts=L.executeJs===!0,d.inlineReferences(x,I).then(function(U){return L.executeJs?O(x,L).then(function($){return{element:$.document.documentElement,errors:U.concat($.errors),cleanUp:$.cleanUp}}):{element:x,errors:U,cleanUp:function(){}}}).then(function(U){return P(U.element,A,L).then(function($){return U.cleanUp(),{image:$.image,svg:$.svg,errors:U.errors}})})},g}(a,f,u,E,h,i),p=function(S,b,y){var v={},m=function(C,P){var O=300,x=200,A=C?C.width:O,L=C?C.height:x,I=P.width!==void 0?P.width:A,U=P.height!==void 0?P.height:L;return{width:I,height:U}},d=function(C){var P=m(C.canvas,C.options),O;return O=S.clone(C.options),O.width=P.width,O.height=P.height,O};v.drawDocument=function(){var C=arguments[0],P=Array.prototype.slice.call(arguments,1),O=S.parseOptionalParameters(P),x=C.documentElement?C.documentElement:C;return y.rasterize(x,O.canvas,d(O))};var g=function(C,P,O){var x=b.parseHTML(C);return v.drawDocument(x,P,O)};v.drawHTML=function(){var C=arguments[0],P=Array.prototype.slice.call(arguments,1),O=S.parseOptionalParameters(P);return g(C,O.canvas,O.options)};var _=function(C,P,O){var x=document.implementation.createHTMLDocument("");x.replaceChild(C.documentElement,x.documentElement);var A=O?S.clone(O):{};return O.baseUrl||(A.baseUrl=P),{document:x,options:A}},k=function(C,P,O){return b.loadDocument(C,O).then(function(x){var A=_(x,C,O);return v.drawDocument(A.document,P,A.options)})};return v.drawURL=function(){var C=arguments[0],P=Array.prototype.slice.call(arguments,1),O=S.parseOptionalParameters(P);return k(C,O.canvas,O.options)},v}(a,f,w);return p})})(aS);var aj=aS.exports;(function(e){var t=me&&me.__createBinding||(Object.create?function(d,g,_,k){k===void 0&&(k=_);var C=Object.getOwnPropertyDescriptor(g,_);C&&!("get"in C?!g.__esModule:C.writable||C.configurable)||(C={enumerable:!0,get:function(){return g[_]}}),Object.defineProperty(d,k,C)}:function(d,g,_,k){k===void 0&&(k=_),d[k]=g[_]}),r=me&&me.__setModuleDefault||(Object.create?function(d,g){Object.defineProperty(d,"default",{enumerable:!0,value:g})}:function(d,g){d.default=g}),n=me&&me.__importStar||function(d){if(d&&d.__esModule)return d;var g={};if(d!=null)for(var _ in d)_!=="default"&&Object.prototype.hasOwnProperty.call(d,_)&&t(g,d,_);return r(g,d),g};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToCanvas=e.detectSize=e.isContentWrapping=e.prerenderFont=e.resetStyleContent=void 0;const i=n(aj),a=Xs;e.resetStyleContent=`
159
+ p {
160
+ margin: 0;
161
+ padding: 0;
162
+ word-wrap: break-word; /* Required for Firefox */
163
+ /* a text may have several spaces, we need to preserve them */
164
+ white-space: pre-wrap;
165
+ }
166
+ ul, ol {
167
+ list-style-position: outside;
168
+ margin: 0;
169
+ padding: 0;
170
+ display: inline-block;
171
+ text-align: left;
172
+ width: 100%;
173
+ }
174
+ li {
175
+ margin-left: 1.7em;
176
+ padding-left: 0.5em; /* This should match the margin-left value */
177
+ }
178
+ /* Add resets */
179
+ ul {
180
+ list-style-type: disc;
181
+ }
182
+ ol {
183
+ list-style-type: decimal;
184
+ }
185
+
186
+ `;const o=`
187
+ <style>
188
+ html, body {
189
+ padding: 0;
190
+ margin: 0;
191
+ }
192
+ ${e.resetStyleContent}
193
+ </style>
194
+ `;let l;const u=()=>(l||(l=document.createElement("div"),l.id="polotno-hidden-do-not-touch",l.style.overflow="hidden",l.style.position="relative",document.body.appendChild(l),l.innerHTML=`<style>#polotno-hidden-do-not-touch {${e.resetStyleContent}}</style>`),l),f=new Map,h=navigator.userAgent.includes("Firefox"),E=async d=>{if(f.has(d))return f.get(d);const g=(async()=>{const _=`<div style="font-family: ${d}; font-size: 100px;">${d}<strong>${d}</strong></div>`,k=document.createElement("div");k.innerHTML=_,k.style.visibility="hidden",k.style.position="absolute";const C=u();C.appendChild(k);const P=h?180:50;await new Promise(O=>setTimeout(O,P)),C.removeChild(k)})();return f.set(d,g),g};function w({html:d}){const g=document.createElement("div");g.innerHTML=d,g.style.display="inline-block",g.style.position="fixed",g.style.top="0px",g.style.left="0px",g.style.zIndex="1000",g.style.whiteSpace="nowrap",g.style.visibility="hidden";const _=u();_.appendChild(g);const k=g.textContent,C=g.childNodes[0],P=k.split(/\s+/);let O=!1;for(let x=0;x<P.length;x++){const A=P[x];if(C.textContent=A,O=C.scrollWidth>g.clientWidth,O)break}return _.removeChild(g),O}function p(d){const g=document.createElement("div");g.innerHTML=d,g.style.display="inline-block",g.style.position="fixed",g.style.top="0px",g.style.left="0px",g.style.zIndex="1000";const _=u();_.appendChild(g);const k=g.getBoundingClientRect();return _.removeChild(g),{width:k.width,height:k.height}}e.prerenderFont=E,e.isContentWrapping=w,e.detectSize=p;const S={};function b(d){const g=[];for(const _ of document.styleSheets)try{for(const k of _.cssRules)k instanceof CSSFontFaceRule&&k.style.fontFamily.replace(/['"]/g,"")===d&&g.push(k)}catch(k){console.warn(`Could not access stylesheet: ${_.href}`,k)}return g}const y={},v=d=>{if(y[d])return y[d];const g=b(d).filter(_=>_.style.fontFamily.replace(/['"]/g,"")===d).map(_=>({src:_.style.src,fontStyle:_.style.fontStyle||"normal",fontWeight:_.style.fontWeight||"normal"}));return y[d]=g,g};async function m({html:d,width:g,height:_,fontFamily:k,padding:C,font:P,pixelRatio:O}){const x=document.createElement("canvas");if(k!=="Arial"&&!P){const I=(0,a.getGoogleFontsVariants)();d+=`<link type="text/css" href="https://fonts.googleapis.com/css?family=${k}:${I}" rel="stylesheet">`}if(P){const I=P.styles||(P.url?[{src:`url("${P.url}")`}]:v(k));d+="<style>",I.forEach(U=>{d+=`
195
+ @font-face {
196
+ font-family: '${k}';
197
+ src: ${U.src};
198
+ font-style: ${U.fontStyle||"normal"};
199
+ font-weight: ${U.fontWeight||"normal"};
200
+ }
201
+ `}),d+="</style>"}d+=o;const A=await i.drawHTML(`<div style="padding: ${C}px;">${d}</div>`,x,{width:g+2*C,height:_+2*C,cacheBucket:S});x.width=(g+2*C)*O,x.height=(_+2*C)*O;const L=x.getContext("2d");return L==null||L.drawImage(A.image,0,0,A.image.width*O,A.image.height*O),x}e.htmlToCanvas=m})(p2);var b2={},_2={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.styled=e.setup=e.keyframes=e.glob=e.extractCss=e.css=void 0;let t={data:""},r=d=>typeof window=="object"?((d?d.querySelector("#_goober"):window._goober)||Object.assign((d||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:d||t,n=d=>{let g=r(d),_=g.data;return g.data="",_},i=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/|\s\s+|\n/g,o=(d,g)=>{let _="",k="",C="";for(let P in d){let O=d[P];P[0]=="@"?P[1]=="i"?_=P+" "+O+";":k+=P[1]=="f"?o(O,P):P+"{"+o(O,P[1]=="k"?"":g)+"}":typeof O=="object"?k+=o(O,g?g.replace(/([^,])+/g,x=>P.replace(/(^:.*)|([^,])+/g,A=>/&/.test(A)?A.replace(/&/g,x):x?x+" "+A:A)):P):O!=null&&(P=P.replace(/[A-Z]/g,"-$&").toLowerCase(),C+=o.p?o.p(P,O):P+":"+O+";")}return _+(g&&C?g+"{"+C+"}":C)+k},l={},u=d=>{if(typeof d=="object"){let g="";for(let _ in d)g+=_+u(d[_]);return g}return d},f=(d,g,_,k,C)=>{let P=u(d),O=l[P]||(l[P]=(x=>{let A=0,L=11;for(;A<x.length;)L=101*L+x.charCodeAt(A++)>>>0;return"go"+L})(P));if(!l[O]){let x=P!==d?d:(A=>{let L,I=[{}];for(;L=i.exec(A.replace(a,""));)L[4]?I.shift():L[3]?I.unshift(I[0][L[3]]=I[0][L[3]]||{}):I[0][L[1]]=L[2];return I[0]})(d);l[O]=o(C?{["@keyframes "+O]:x}:x,_?"":"."+O)}return((x,A,L)=>{A.data.indexOf(x)==-1&&(A.data=L?x+A.data:A.data+x)})(l[O],g,k),O},h=(d,g,_)=>d.reduce((k,C,P)=>{let O=g[P];if(O&&O.call){let x=O(_),A=x&&x.props&&x.props.className||/^go/.test(x)&&x;O=A?"."+A:x&&typeof x=="object"?x.props?"":o(x,""):x===!1?"":x}return k+C+(O??"")},"");function E(d){let g=this||{},_=d.call?d(g.p):d;return f(_.unshift?_.raw?h(_,[].slice.call(arguments,1),g.p):_.reduce((k,C)=>Object.assign(k,C&&C.call?C(g.p):C),{}):_,r(g.target),g.g,g.o,g.k)}e.extractCss=n,e.css=E;let w,p,S,b=E.bind({g:1}),y=E.bind({k:1});function v(d,g,_,k){o.p=g,w=d,p=_,S=k}function m(d,g){let _=this||{};return function(){let k=arguments;function C(P,O){let x=Object.assign({},P),A=x.className||C.className;_.p=Object.assign({theme:p&&p()},x),_.o=/ *go\d+/.test(A),x.className=E.apply(_,k)+(A?" "+A:""),g&&(x.ref=O);let L=d;return d[0]&&(L=x.as||d,delete x.as),S&&L[0]&&S(x),w(L,x)}return g?g(C):C}}e.glob=b,e.keyframes=y,e.setup=v,e.styled=m})(_2);var oj=me&&me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(b2,"__esModule",{value:!0});const lj=oj(Je),__=_2;(0,__.setup)(lj.default.createElement),b2.default=__.styled;(function(e){var t=me&&me.__createBinding||(Object.create?function(M,F,D,H){H===void 0&&(H=D);var K=Object.getOwnPropertyDescriptor(F,D);K&&!("get"in K?!F.__esModule:K.writable||K.configurable)||(K={enumerable:!0,get:function(){return F[D]}}),Object.defineProperty(M,H,K)}:function(M,F,D,H){H===void 0&&(H=D),M[H]=F[D]}),r=me&&me.__setModuleDefault||(Object.create?function(M,F){Object.defineProperty(M,"default",{enumerable:!0,value:F})}:function(M,F){M.default=F}),n=me&&me.__importStar||function(M){if(M&&M.__esModule)return M;var F={};if(M!=null)for(var D in M)D!=="default"&&Object.prototype.hasOwnProperty.call(M,D)&&t(F,M,D);return r(F,M),F},i=me&&me.__importDefault||function(M){return M&&M.__esModule?M:{default:M}};Object.defineProperty(e,"__esModule",{value:!0}),e.HTMLElement=e.setQuillContent=e.createQuill=e.quillRef=void 0;const a=i(Je),o=_i,l=Ca,u=i(PD),f=i(Si),h=n(Ki),E=Yn,w=Kc,p=Zy,S=Wc,b=p2,y=xl,v=Pl,m=qc,d=i(b2),g=$i,_=e2,k=n(Xs),C=Po,P=f2;e.quillRef=h.observable({enabled:!1,currentFormat:{},editor:h.observable.object({instance:null},{},{deep:!1})});const O=(0,d.default)("div",a.default.forwardRef)`
202
+ .ql-editor {
203
+ outline: none;
204
+ }
205
+ ${b.resetStyleContent}
206
+ strong {
207
+ font-weight: 700;
208
+ }
209
+ .ql-direction-rtl {
210
+ direction: rtl;
211
+ }
212
+ `,x=new Set,A=(M,F)=>{const D=M.fonts.find(Y=>Y.fontFamily===F)||k.globalFonts.find(Y=>Y.fontFamily===F),H=!!D,[K]=(0,p.useFontLoader)(M,F),[G,B]=a.default.useState(!H||x.has(F));return a.default.useEffect(()=>{let Y=!0;return H?K?((async()=>x.has(F)?B(!0):(await(0,b.prerenderFont)(D.fontFamily),x.add(F),Y&&B(!0)))(),()=>{Y=!1}):void B(!1):void B(!0)},[K,F,H,D]),[K&&(!H||G)]},L=M=>new u.default(M,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:["bold","color","font","italic","size","strike","underline","indent","list","direction"]});e.createQuill=L;const I=(M,F)=>{var D=M.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+F+"<p><br></p></div>");M.setContents(D),M.history.clear()};e.setQuillContent=I;const U=({html:M,onBlur:F,onChange:D,element:H})=>{const K=a.default.useRef(null);a.default.useEffect(()=>{if(!K.current)return;const B=(0,e.createQuill)(K.current);return h.runInAction(()=>{e.quillRef.editor.instance=B}),window.__polotnoQuill=B,B.on("text-change",()=>{B.getSelection()&&h.runInAction(()=>{e.quillRef.currentFormat=B.getFormat()}),setTimeout(()=>{var Y;const X=(Y=K.current)===null||Y===void 0?void 0:Y.childNodes[0];D(X.innerHTML)},10)}),B.setSelection(0,0,"api"),B.on("selection-change",Y=>{Y||F(),Y&&h.runInAction(()=>{e.quillRef.currentFormat=B.getFormat()})}),K.current.childNodes[0].addEventListener("blur",Y=>{var X;!((X=Y.relatedTarget)===null||X===void 0)&&X.classList.contains("ql-clipboard")||F()}),()=>{h.runInAction(()=>{e.quillRef.editor.instance=null,e.quillRef.currentFormat={}}),delete window.__polotnoQuill}},[]),a.default.useEffect(()=>{var B;const Y=e.quillRef.editor.instance;if(!Y)return;const X=Y.getSelection();((B=K.current)===null||B===void 0?void 0:B.childNodes[0].innerHTML)===H.text||((0,e.setQuillContent)(Y,M),X&&(Y.setSelection(X.index,X.length),h.runInAction(()=>{e.quillRef.currentFormat=Y.getFormat()})))},[H.text]);const G={color:H.fill};return H.fill.indexOf("gradient")>=0&&(G.backgroundColor=H.fill,G.backgroundImage=H.fill,G.backgroundSize="100% 100%",G.backgroundRepeat="repeat",G.webkitBackgroundClip="text",G.MozBackgroundClip="text",G.WebkitTextFillColor="transparent",G.MozTextFillColor="transparent"),a.default.createElement(O,{ref:K,style:Object.assign(Object.assign({},G),{fontSize:H.fontSize,width:H.a.width,fontFamily:H.fontFamily,lineHeight:H.lineHeight,letterSpacing:H.letterSpacing+"rem",textAlign:H.align}),dir:(0,p.getDir)((0,_.removeTags)(H.text))})};function $(M,F,D){return a.default.useMemo(()=>(0,b.detectSize)(M),[M,F.width,D])}function Z(M){const F=M.getContext("2d").getImageData(0,0,M.width,M.height).data;for(let D=0;D<F.length;D+=4)if(F[D+3]!==0)return!0;return!1}function q(M){return!Z(M)}function z(M,{fontFamily:F="",color:D="black"}={}){let H=`color: ${D||M.fill}`;return M.fill.indexOf("gradient")>=0&&(H=`
213
+ background-color: ${D};
214
+ background-image: ${M.fill};
215
+ background-size: 100% 100%;
216
+ background-repeat: repeat;
217
+ -webkit-background-clip: text;
218
+ -moz-background-clip: text;
219
+ -webkit-text-fill-color: transparent;
220
+ -moz-text-fill-color: transparent;
221
+ `),`<div style="${["white-space: pre-wrap",`width: ${Math.round(M.width||100)}px`,H,`font-size: ${M.fontSize}px`,`font-family: '${F}'`,`text-align: ${M.align}`,M.textDecoration?`text-decoration: ${M.textDecoration}`:"",M.lineHeight?`line-height: ${M.lineHeight}`:"",M.letterSpacing?`letter-spacing: ${M.letterSpacing}rem`:"",M.fontStyle?`font-style: ${M.fontStyle}`:"",M.fontWeight?`font-weight: ${M.fontWeight}`:"",M.strokeWidth?`-webkit-text-stroke: ${M.strokeWidth}px ${M.stroke}`:"",M.strokeWidth?"paint-order: stroke fill":""].filter(Boolean).join("; ")}" contentEditable dir="${(0,p.getDir)((0,_.removeTags)(M.text))}">${M.text.replaceAll(`
222
+ `,"</br>")}</div>`}const W=M=>{let F=M.fontSize;for(let D=1;D<50;D++){const H=z(Object.assign(Object.assign({},M.toJSON()),{fontSize:F}),{fontFamily:M.fontFamily}),{height:K}=(0,b.detectSize)(H),G=M.height&&K>M.height,B=(0,b.isContentWrapping)({html:H});if(!(G||B))break;F-=.5}return F},R=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);e.HTMLElement=(0,o.observer)(({element:M,store:F})=>{const D=a.default.useRef(null),[H,K]=a.default.useState(),[G,B]=a.default.useState(!1),[Y,X]=a.default.useState(!0),[Q,te]=a.default.useState(!1),ee=a.default.useRef(M.height),ie=F.selectedShapes.indexOf(M)>=0,ne=M.fontSize/3,{textVerticalResizeEnabled:le}=E.flags,Te=(0,p.usePrevious)(M.fontFamily),[Ie]=A(F,M.fontFamily),se=M._editModeEnabled;(0,y.useFadeIn)(D);const de=Ie?M.fontFamily:Te!==M.fontFamily?Te:"Arial",_e=(0,S.useColor)(M).fill,ve=z(M,{fontFamily:de,color:_e}),{width:re,height:ce}=$(ve,M,Ie);a.default.useEffect(()=>{if(!Ie)return;if(!M.height)return void M.set({height:ce});const{textOverflow:Ee}=E.flags;if(Ee!=="change-font-size"||G)Ee==="resize"&&(le&&M.height<ce&&F.history.ignore(()=>{M.set({height:ce})}),le||M.height===ce||F.history.ignore(()=>{M.set({height:ce})}));else{const Re=W(M);Re!==M.fontSize?F.history.ignore(()=>{M.set({fontSize:Re})}):M.height!==ce&&(le&&M.height<ce?F.history.ignore(()=>{M.set({height:ce})}):le||F.history.ignore(()=>{M.set({height:ce})}))}});const be=a.default.useRef(0),Oe=a.default.useMemo(()=>{const Ee={lastArgs:null,lastResult:null};return async function(Re){return Ee.lastArgs&&Ee.lastResult&&(Ve=Ee.lastArgs,oe=Re,JSON.stringify(Ve)===JSON.stringify(oe))||(Ee.lastResult=await(0,b.htmlToCanvas)(Re),Ee.lastArgs=Object.assign({},Re)),Ee.lastResult;var Ve,oe}},[]);a.default.useEffect(()=>{G||se||(async()=>{be.current++;const Ee=be.current,Re=(0,g.incrementLoader)(`text ${M.id}`);X(!0);let Ve=null;const oe=R?5:1;for(let fe=0;fe<oe;fe++){if(Ve=await(fe>0?Oe:b.htmlToCanvas)({skipCache:fe>0,html:ve,width:M.width||1,height:M.height||ce||1,fontFamily:de,padding:ne,pixelRatio:F._elementsPixelRatio,font:F.fonts.find(ye=>ye.fontFamily===de)||k.globalFonts.find(ye=>ye.fontFamily===de)}),Ee!==be.current)return void Re();q(Ve)&&R&&await new Promise(ye=>setTimeout(ye,50*(fe+1)))}Ve?(K(Ve),X(!1),f.default.Util.requestAnimFrame(Re)):Re()})()},[ve,G,ce,se,de,M.height,F._elementsPixelRatio]);const $e=G||Y;a.default.useEffect(()=>h.autorun(()=>{const Ee=D.current;(0,w.applyFilter)(Ee,M)}),[H,$e,M.shadowColor,M.shadowOffsetX,M.shadowOffsetY,M.shadowOpacity]);let Qe=0;M.verticalAlign==="middle"&&(Qe=(M.height-ce)/2),M.verticalAlign==="bottom"&&(Qe=M.height-ce);const Ye=(0,p.getLineHeight)({fontLoaded:Ie,fontFamily:M.fontFamily,fontSize:M.fontSize,lineHeight:M.lineHeight}),Le=(0,C.isTouchDevice)();return a.default.createElement(a.default.Fragment,null,a.default.createElement(l.Rect,{x:M.a.x,y:M.a.y,offsetX:M.backgroundPadding*(M.fontSize*Ye*.5),offsetY:M.backgroundPadding*(M.fontSize*Ye*.5),rotation:M.a.rotation,hideInExport:!M.showInExport,listening:!1,visible:M.backgroundEnabled,opacity:M.backgroundOpacity*M.a.opacity,fill:M.backgroundColor,width:M.a.width+M.backgroundPadding*(M.fontSize*Ye),height:M.a.height+M.backgroundPadding*(M.fontSize*Ye),cornerRadius:M.backgroundCornerRadius*(M.fontSize*Ye*.5)}),a.default.createElement(l.Rect,{ref:D,name:"element",x:M.a.x,y:M.a.y,listening:M.selectable,rotation:M.a.rotation,width:M.a.width,height:M.a.height,visible:!$e,draggable:Le?M.draggable&&ie:M.draggable,preventDefault:!Le||ie,opacity:se?0:M.a.opacity,hideInExport:!M.showInExport,onMouseEnter:()=>{te(!0)},onMouseLeave:()=>{te(!1)},onDragMove:Ee=>{M.set({x:Ee.target.x(),y:Ee.target.y()})},onDragEnd:Ee=>{M.set({x:Ee.target.x(),y:Ee.target.y()})},id:M.id,onDblClick:()=>{M.contentEditable&&M.toggleEditMode(!0)},onDblTap:()=>{M.contentEditable&&M.toggleEditMode(!0)},onTransformStart:Ee=>{B(!0),ee.current=M.height},onTransform:Ee=>{var Re;const Ve=Ee.target,oe=((Re=Ve.getStage())===null||Re===void 0?void 0:Re.findOne("Transformer")).getActiveAnchor(),fe=oe==="middle-left"||oe==="middle-right",Ze=oe==="top-center"||oe==="bottom-center",ye=Ve.scaleX();if(fe){const Me=Ve.scaleX(),Pe=Math.max(Ve.width()*Me,M.fontSize);if(Ve.width(Pe),Ve.scaleX(1),E.flags.textVerticalResizeEnabled){const we=Math.max(ce,ee.current);M.set({height:we})}M.set({width:Pe,x:Ve.x(),y:Ve.y()})}else if(Ze){let Me=E.flags.textOverflow==="resize"?ce:M.lineHeight*M.fontSize;const Pe=Math.max(Me,Ee.target.height()*Ee.target.scaleY());Ve.scaleY(1),M.set({x:Ve.x(),y:Ve.y(),height:Pe,rotation:Ve.rotation()})}else Ve.scaleX(1),Ve.scaleY(1),M.set({fontSize:M.fontSize*ye,width:Ve.width()*ye,x:Ve.x(),y:Ve.y(),rotation:Ve.rotation(),height:Ve.height()*ye})},onTransformEnd:Ee=>{B(!1),X(!0);const Re=Ee.target.scaleX();Ee.target.scaleX(1),Ee.target.scaleY(1),M.set({fontSize:M.fontSize*Re,width:Ee.target.width()*Re,x:Ee.target.x(),y:Ee.target.y(),rotation:Ee.target.rotation(),shadowBlur:M.shadowBlur*Re,shadowOffsetX:M.shadowOffsetX*Re,shadowOffsetY:M.shadowOffsetY*Re,strokeWidth:M.strokeWidth*Re})}}),a.default.createElement(l.Image,{ref:D,image:H,x:M.a.x,y:M.a.y,offsetX:ne,offsetY:ne-Qe,listening:!1,rotation:M.rotation,width:M.a.width+2*ne,height:M.a.height+2*ne,visible:!$e,opacity:se?0:M.a.opacity,shadowEnabled:M.shadowEnabled,shadowBlur:M.shadowBlur,shadowOffsetX:M.shadowOffsetX,shadowOffsetY:M.shadowOffsetY,shadowColor:M.shadowColor,shadowOpacity:M.shadowOpacity,hideInExport:!M.showInExport}),$e&&a.default.createElement(l.Group,{x:M.a.x,y:M.a.y,rotation:M.rotation,offsetY:-Qe},a.default.createElement(m.Html,{divProps:{style:{pointerEvents:"none"}}},a.default.createElement(O,{dangerouslySetInnerHTML:{__html:ve},style:{pointerEvents:"none",display:"inline-block"}}))),se&&a.default.createElement(l.Group,{x:M.a.x,y:M.a.y,rotation:M.rotation,offsetY:-Qe},a.default.createElement(m.Html,null,a.default.createElement(U,{html:ve,element:M,onChange:Ee=>{const Re=(0,P.getLimitedFontSize)({oldText:(0,_.removeTags)(M.text),newText:(0,_.removeTags)(Ee),element:M});M.set({text:Ee,fontSize:Re})},onBlur:Ee=>{M.toggleEditMode(!1)}}))),(ie||Q)&&a.default.createElement(v.Highlighter,{element:M}))})})(nS);var cS={},w2={},eu={};(function(e){function t(u){return u/180*Math.PI}function r(u,f,h,E,w){const p=Math.sqrt(h*h+E*E);return w+=Math.atan2(E,h),{x:u+p*Math.cos(w),y:f+p*Math.sin(w)}}function n(u){const{x:f,y:h,width:E,height:w}=u,p=t(u.rotation),S=r(f,h,0,0,p),b=r(f,h,E,0,p),y=r(f,h,E,w,p),v=r(f,h,0,w,p),m=Math.min(S.x,b.x,y.x,v.x),d=Math.min(S.y,b.y,y.y,v.y),g=Math.max(S.x,b.x,y.x,v.x),_=Math.max(S.y,b.y,y.y,v.y);return{x:m,y:d,width:g-m,height:_-d,minX:m,minY:d,maxX:g,maxY:_}}function i(u){const f=u.map(S=>n(S)),h=Math.min(...f.map(S=>S.minX)),E=Math.min(...f.map(S=>S.minY)),w=Math.max(...f.map(S=>S.maxX)),p=Math.max(...f.map(S=>S.maxY));return{x:h,y:E,width:w-h,height:p-E,minX:h,minY:E,maxX:w,maxY:p}}function a(u){const f=t(u.rotation||0);return{x:u.x+u.width/2*Math.cos(f)+u.height/2*Math.sin(-f),y:u.y+u.height/2*Math.cos(f)+u.width/2*Math.sin(f)}}function o(u,f,h){const E=t(f),w=h.x+(u.x-h.x)*Math.cos(E)-(u.y-h.y)*Math.sin(E),p=h.y+(u.x-h.x)*Math.sin(E)+(u.y-h.y)*Math.cos(E);return Object.assign(Object.assign({},u),{rotation:u.rotation+f,x:w,y:p})}function l(u,f){return o(u,f,a(u))}Object.defineProperty(e,"__esModule",{value:!0}),e.rotateAroundCenter=e.rotateAroundPoint=e.getCenter=e.getTotalClientRect=e.getClientRect=e.degToRad=void 0,e.degToRad=t,e.getClientRect=n,e.getTotalClientRect=i,e.getCenter=a,e.rotateAroundPoint=o,e.rotateAroundCenter=l})(eu);(function(e){var t=me&&me.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(e,"__esModule",{value:!0}),e.useAnchorSnap=e.useSnap=void 0;const r=t(Je),n=t(Si),i=eu;var a=5;function o(E){const w=E.__getNodeRect(),p=(0,i.getClientRect)(Object.assign(Object.assign({},w),{rotation:n.default.Util.radToDeg(w.rotation)})),S=E.getAbsolutePosition();return{vertical:[{guide:p.x,offset:S.x-p.x,snap:"start"},{guide:p.x+p.width/2,offset:S.x-p.x-p.width/2,snap:"center"},{guide:p.x+p.width,offset:S.x-p.x-p.width,snap:"end"}],horizontal:[{guide:p.y,offset:S.y-p.y,snap:"start"},{guide:p.y+p.height/2,offset:S.y-p.y-p.height/2,snap:"center"},{guide:p.y+p.height,offset:S.y-p.y-p.height,snap:"end"}]}}function l(E,w){var p=[],S=[];E.vertical.forEach(g=>{w.vertical.forEach(_=>{var k=Math.abs(g-_.guide);k<a&&p.push({lineGuide:g,diff:k,snap:_.snap,offset:_.offset})})}),E.horizontal.forEach(g=>{w.horizontal.forEach(_=>{var k=Math.abs(g-_.guide);k<a&&S.push({lineGuide:g,diff:k,snap:_.snap,offset:_.offset})})});var b=[];const y=p.sort((g,_)=>g.diff-_.diff),v=S.sort((g,_)=>g.diff-_.diff);var m=y[0],d=v[0];return m&&y.filter(g=>Math.abs(g.diff-m.diff)<.1).forEach(g=>{b.push(Object.assign({orientation:"V"},g))}),d&&v.filter(g=>Math.abs(g.diff-d.diff)<.1).forEach(g=>{b.push(Object.assign({orientation:"H"},g))}),b}function u(E,w){const p=r.default.useRef(),S=_=>_.hasName("element")||_.hasName("page-background")||!p.current&&_.hasName("elements-area");function b(_){var k;const C=(k=E.current)===null||k===void 0?void 0:k.getStage();var P=[],O=[];return C.find(S).forEach(x=>{if(!(_.indexOf(x)>=0)){var A=x.getClientRect({skipShadow:!0,skipStroke:!0});P.push(A.x,A.x+A.width,A.x+A.width/2),O.push(A.y,A.y+A.height,A.y+A.height/2)}}),{vertical:P,horizontal:O}}function y(_){var k;const C=(k=E.current)===null||k===void 0?void 0:k.getLayer(),P=C==null?void 0:C.children.find(O=>O.name()==="line-guides");_.forEach(O=>{if(O.orientation==="H"){var x=new n.default.Line({points:[-6e3,O.lineGuide,6e3,O.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});P==null||P.add(x),C.batchDraw()}else O.orientation==="V"&&(x=new n.default.Line({points:[O.lineGuide,-6e3,O.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),P==null||P.add(x))})}const v=_=>{_.target.getLayer().children.find(A=>A.name()==="line-guides").destroyChildren();var k=l(b(_.target.nodes()),o(_.target));if(!k.length)return;y(k);const C=_.target.getAbsolutePosition(),P=(_.target.nodes().map(A=>A.getAbsolutePosition()),Object.assign({},C));k.forEach(A=>{switch(A.snap){case"start":case"center":case"end":switch(A.orientation){case"V":P.x=A.lineGuide+A.offset;break;case"H":P.y=A.lineGuide+A.offset}}});const O=P.x-C.x,x=P.y-C.y;_.evt.ctrlKey||_.evt.metaKey||_.target.nodes().forEach(A=>{const L=A.getAbsolutePosition();A.setAbsolutePosition({x:L.x+O,y:L.y+x})})},m=(_,k,C)=>{const P=E.current,O=P.getLayer();if(O.children.find($=>$.name()==="line-guides").destroyChildren(),P.getActiveAnchor()==="rotater"||Math.sqrt(Math.pow(k.x-_.x,2)+Math.pow(k.y-_.y,2))>50||!O)return k;var x=l(b(P.nodes()),{vertical:[{guide:k.x,offset:0,snap:"start"}],horizontal:[{guide:k.y,offset:0,snap:"start"}]});if(!x.length||(y(x),C.ctrlKey||C.metaKey))return k;let A=k.x,L=k.x;x.forEach($=>{switch($.orientation){case"V":A=$.lineGuide;break;case"H":L=$.lineGuide}});const I=Math.abs(k.x-A)<10,U=Math.abs(k.y-L)<10;return I&&!U?{x:A,y:_.y}:U&&!I?{x:_.x,y:L}:I&&U?{x:A,y:L}:k},d=_=>{if(p.current=!1,!_.target)return;const k=_.target.getLayer();k.children.find(C=>C.name()==="line-guides").destroyChildren(),k.batchDraw()},g=()=>{const _=E.current.nodes().map(C=>C.id()),k=w.getElementById(_[0]);p.current=(k==null?void 0:k.type)==="image"};r.default.useEffect(()=>{E.current&&(E.current.anchorDragBoundFunc(m),E.current.on("dragstart",()=>{setTimeout(()=>{if(n.default.DD._dragElements.size===0)return;const _=[...n.default.DD._dragElements.entries()],k=_.find(([C,P])=>P.node instanceof n.default.Transformer);_.splice(_.indexOf(k),1),_.unshift(k),n.default.DD._dragElements.clear(),_.forEach(([C,P])=>{n.default.DD._dragElements.set(C,P)})}),g()}),E.current.on("dragmove",v),E.current.on("dragend",d),E.current.on("transformstart",()=>{g()}),E.current.on("transformend",d),E.current.on("transform",_=>{var k,C;_.evt.ctrlKey||_.evt.metaKey?(k=E.current)===null||k===void 0||k.rotationSnapTolerance(0):(C=E.current)===null||C===void 0||C.rotationSnapTolerance(5)}))},[])}function f(E){return{vertical:[{guide:E.absolutePosition().x,offset:0,snap:"center"}],horizontal:[{guide:E.absolutePosition().y,offset:0,snap:"center"}]}}function h(E,w,p){const S=v=>v.hasName("element")||v.hasName("line-anchor")||v.hasName("page-background")||v.hasName("elements-area"),b=v=>{v.target.getLayer().children.find(C=>C.name()==="line-guides").destroyChildren();var m=l(function(C){var P;const O=(P=E.current)===null||P===void 0?void 0:P.getStage();var x=[],A=[];return O.find(S).forEach(L=>{if(!(C.indexOf(L)>=0)){var I=L.getClientRect({skipShadow:!0,skipStroke:!0});L.hasName("line-anchor")&&(I={x:L.absolutePosition().x,y:L.absolutePosition().y,width:0,height:0}),x.push(I.x,I.x+I.width,I.x+I.width/2),A.push(I.y,I.y+I.height,I.y+I.height/2)}}),{vertical:x,horizontal:A}}([v.target,...w.map(C=>C.current)]),f(v.target));if(!m.length)return;(function(C){var P;const O=(P=E.current)===null||P===void 0?void 0:P.getLayer(),x=O==null?void 0:O.children.find(A=>A.name()==="line-guides");C.forEach(A=>{if(A.orientation==="H"){var L=new n.default.Line({points:[-6e3,A.lineGuide,6e3,A.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});x==null||x.add(L),O.batchDraw()}else A.orientation==="V"&&(L=new n.default.Line({points:[A.lineGuide,-6e3,A.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),x==null||x.add(L))})})(m);const d=v.target.getAbsolutePosition(),g=Object.assign({},d);m.forEach(C=>{switch(C.snap){case"start":case"center":case"end":switch(C.orientation){case"V":g.x=C.lineGuide+C.offset;break;case"H":g.y=C.lineGuide+C.offset}}});const _=g.x-d.x,k=g.y-d.y;if(!(v.evt.ctrlKey||v.evt.metaKey)){const C=v.target.getAbsolutePosition();v.target.absolutePosition({x:C.x+_,y:C.y+k})}},y=v=>{if(!v.target)return;const m=v.target.getLayer();m.children.find(d=>d.name()==="line-guides").destroyChildren(),m.batchDraw()};r.default.useEffect(()=>{E.current&&(E.current.on("dragmove",b),E.current.on("dragend",y))},p)}e.useSnap=u,e.useAnchorSnap=h})(w2);(function(e){var t=me&&me.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=e.getLinePositionFromMiddlePoints=e.getMiddlePoints=void 0;const r=t(Je),n=_i,i=Ca,a=Wc,o=qc,l=Pl,u=w2,f=Po;function h(S){const{x:b,y,width:v,height:m,rotation:d}=S.a,g=d*Math.PI/180,_={x:b+m/2*Math.cos(g+Math.PI/2),y:y+m/2*Math.sin(g+Math.PI/2)};return{middleLeft:_,middleRight:{x:_.x+v*Math.cos(g),y:_.y+v*Math.sin(g)}}}function E(S,b,y){const v=Math.sqrt(Math.pow(b.x-S.x,2)+Math.pow(b.y-S.y,2)),m=Math.atan2(b.y-S.y,b.x-S.x),d=180*m/Math.PI;return{x:S.x+Math.cos(m-Math.PI/2)*y/2,y:S.y+Math.sin(m-Math.PI/2)*y/2,width:v,height:y,rotation:d}}e.getMiddlePoints=h,e.getLinePositionFromMiddlePoints=E;const w=(S,b)=>({offsetX:5/S,offsetY:5/S,width:10/S,height:10/S,fill:"white",stroke:"rgb(0, 161, 255)",strokeWidth:2,strokeScaleEnabled:!1,draggable:!0,dragDistance:0,onMouseEnter:y=>{y.target.getStage().container().style.cursor="crosshair"},onMouseLeave:y=>{y.target.getStage().container().style.cursor=""},onDragStart:y=>{b.history.startTransaction()},onDragEnd:y=>{b.history.endTransaction()}}),p=(0,n.observer)(({element:S,type:b})=>{const y=(0,a.useColor)(S,S.a.color,"fill"),v=(0,a.useColor)(S,S.a.color,"stroke"),m=Object.assign(Object.assign(Object.assign({strokeWidth:S.height,lineCap:"round",lineJoin:"round"},v),y),{opacity:S.a.opacity,hideInExport:!S.showInExport});return r.default.createElement(r.default.Fragment,null,b==="arrow"&&r.default.createElement(i.Line,Object.assign({points:[3*S.height,2*-S.height,0,0,3*S.height,2*S.height]},m)),b==="triangle"&&r.default.createElement(i.Line,Object.assign({points:[3*S.height,2*-S.height,0,0,3*S.height,2*S.height],closed:!0},m)),b==="bar"&&r.default.createElement(i.Line,Object.assign({points:[0,2*-S.height,0,2*S.height],closed:!0},m)),b==="square"&&r.default.createElement(i.Line,Object.assign({points:[0,2*-S.height,4*S.height,2*-S.height,4*S.height,2*S.height,0,2*S.height],closed:!0},m)),b==="circle"&&r.default.createElement(i.Circle,Object.assign({x:2*S.height,y:0,radius:2*S.height},m)))});e.LineElement=(0,n.observer)(({element:S,store:b})=>{const y=r.default.useRef(null),v=r.default.useRef(null),m=r.default.useRef(null),d=S.selectable||b.role==="admin",g=(0,f.isTouchDevice)(),[_,k]=r.default.useState(!1),C=b.selectedElements.indexOf(S)>=0&&b.selectedElements.length===1,P=b.selectedShapes.indexOf(S)>=0,{middleLeft:O,middleRight:x}=h(S);(0,u.useAnchorSnap)(v,[y],[C]),(0,u.useAnchorSnap)(m,[y],[C]);const A=(0,a.useColor)(S,S.a.color,"stroke");return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Line,Object.assign({ref:y,name:"element",id:S.id,x:S.a.x,y:S.a.y,points:[0,0,S.a.width,0],offsetY:-S.a.height/2,strokeWidth:S.a.height,hitStrokeWidth:Math.max(S.a.height,20),dash:S.dash.map(L=>L*S.a.height)},A,{rotation:S.a.rotation,opacity:S.animated("opacity"),shadowEnabled:S.shadowEnabled,shadowBlur:S.shadowBlur,shadowOffsetX:S.shadowOffsetX,shadowOffsetY:S.shadowOffsetY,shadowColor:S.shadowColor,shadowOpacity:S.shadowOpacity,listening:d,draggable:g?S.draggable&&P:S.draggable,preventDefault:!g||P,hideInExport:!S.showInExport,onMouseEnter:()=>{k(!0)},onMouseLeave:()=>{k(!1)},onDragMove:L=>{S.set({x:L.target.x(),y:L.target.y()})},onDragEnd:L=>{S.set({x:L.target.x(),y:L.target.y()})},onTransform:L=>{const I=L.target.scaleX();L.target.scaleX(1),L.target.scaleY(1),S.set({height:S.height*I,width:S.width*I,x:L.target.x(),y:L.target.y(),rotation:L.target.rotation()})}})),r.default.createElement(i.Group,{x:O.x,y:O.y,rotation:S.rotation,hideInExport:!S.showInExport},r.default.createElement(p,{element:S,type:S.startHead})),r.default.createElement(i.Group,{x:x.x,y:x.y,rotation:S.rotation+180},r.default.createElement(p,{element:S,type:S.endHead})),_&&!P&&r.default.createElement(l.Highlighter,{element:S}),C&&S.resizable&&r.default.createElement(o.Portal,{selector:".page-abs-container",enabled:!0},r.default.createElement(i.Group,{visible:C},r.default.createElement(i.Rect,Object.assign({x:O.x,y:O.y,ref:v,name:"line-anchor"},w(b.scale,b),{onDragMove:L=>{const I=E(L.target.position(),x,S.height);S.set({x:I.x,y:I.y,width:I.width,rotation:I.rotation})}})),r.default.createElement(i.Rect,Object.assign({x:x.x,y:x.y,ref:m,name:"line-anchor"},w(b.scale,b),{onDragMove:L=>{const I=E(O,L.target.position(),S.height);S.set({x:I.x,y:I.y,width:I.width,rotation:I.rotation})}})))))})})(cS);var fS={};(function(e){var t=me&&me.__createBinding||(Object.create?function(R,M,F,D){D===void 0&&(D=F);var H=Object.getOwnPropertyDescriptor(M,F);H&&!("get"in H?!M.__esModule:H.writable||H.configurable)||(H={enumerable:!0,get:function(){return M[F]}}),Object.defineProperty(R,D,H)}:function(R,M,F,D){D===void 0&&(D=F),R[D]=M[F]}),r=me&&me.__setModuleDefault||(Object.create?function(R,M){Object.defineProperty(R,"default",{enumerable:!0,value:M})}:function(R,M){R.default=M}),n=me&&me.__importStar||function(R){if(R&&R.__esModule)return R;var M={};if(R!=null)for(var F in R)F!=="default"&&Object.prototype.hasOwnProperty.call(R,F)&&t(M,R,F);return r(M,R),M},i=me&&me.__importDefault||function(R){return R&&R.__esModule?R:{default:R}};Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=e.useImageLoader=e.setImageLoaderHook=void 0;const a=i(Je),o=_i,l=Ki,u=Ca,f=i(qp),h=i(Si),E=qc,w=Pl,p=$i,S=n(Qs),b=Yn,y=Kc,v=xl,m=Po;function d(){return document.createElement("canvas")}async function g(R){if(!(R.indexOf("data:image/svg+xml")>=0||R.indexOf(".svg")>=0))return R;const M=await S.urlToString(R),F=S.fixSize(M);return S.svgToURL(F)}const _=R=>{const[M,F]=a.default.useState(R);return a.default.useEffect(()=>{(async()=>{const D=await g(R);D!==M&&F(D)})()},[R]),M},k=new window.Image;k.src=S.svgToURL(`
223
+ <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
224
+ <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"/>
225
+ <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"/>
226
+ </svg>
227
+ `);const C=new window.Image;C.src=S.svgToURL(`
228
+ <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
229
+ <path opacity="0.6" 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" fill="white"/>
230
+ <path opacity="0.6" 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" fill="white"/>
231
+ <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"/>
232
+ <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"/>
233
+ </svg>
234
+ `);function P(R,M,F,D,H,K,G){for(var B=new ImageData(M,F),Y=new Int32Array(R.data.buffer),X=R.width,Q=new Int32Array(B.data.buffer),te=B.width,ee=M/K,ie=F/G,ne=Math.round(1/ee),le=Math.round(1/ie),Te=ne*le,Ie=0;Ie<B.height;Ie++)for(var se=0;se<te;se++){for(var de=D+Math.round(se/ee)+(H+Math.round(Ie/ie))*X,_e=0,ve=0,re=0,ce=0,be=0;be<le;be++)for(var Oe=0;Oe<ne;Oe++){var $e=Y[de+Oe+be*X];_e+=$e<<24>>>24,ve+=$e<<16>>>24,re+=$e<<8>>>24,ce+=$e>>>24}_e=Math.round(_e/Te),ve=Math.round(ve/Te),re=Math.round(re/Te),ce=Math.round(ce/Te),Q[se+Ie*te]=ce<<24|re<<16|ve<<8|_e}return B}function O(R,M){var F,D;const H=d();H.width=R.width,H.height=R.height,(F=H.getContext("2d"))===null||F===void 0||F.drawImage(R,0,0,H.width,H.height);const K=P(H.getContext("2d").getImageData(0,0,H.width,H.height),Math.floor(H.width*M),Math.floor(H.height*M),0,0,H.width,H.height);return H.width=Math.floor(H.width*M),H.height=Math.floor(H.height*M),(D=H.getContext("2d"))===null||D===void 0||D.putImageData(K,0,0),H}const x=(R,M,F,D,H=0,K=!1)=>{const G=Math.floor(Math.max(R.width*D,1)),B=Math.floor(Math.max(R.height*D,1)),Y=Math.min(H*D,G/2,B/2),X=Math.max(R.width/F.width,R.height/F.height)*D,Q=R.page._exportingOrRendering&&b.flags.imageDownScalingEnabled&&X<1&&!K,te=F.x===0&&F.y===0&&F.width===(M==null?void 0:M.width)&&F.height===(M==null?void 0:M.height),ee=a.default.useMemo(()=>{if(!(!M||!M.width||!M.height))return te&&Y===0&&!Q?void 0:d()},[M,Y,Q,te]);return a.default.useLayoutEffect(()=>{if(!ee||!M)return;ee.width=G,ee.height=B;const ie=ee.getContext("2d");if(!ie)return;Y&&(ie.beginPath(),ie.moveTo(Y,0),ie.lineTo(G-Y,0),ie.arc(G-Y,Y,Y,3*Math.PI/2,0,!1),ie.lineTo(G,B-Y),ie.arc(G-Y,B-Y,Y,0,Math.PI/2,!1),ie.lineTo(Y,B),ie.arc(Y,B-Y,Y,Math.PI/2,Math.PI,!1),ie.lineTo(0,Y),ie.arc(Y,Y,Y,Math.PI,3*Math.PI/2,!1),ie.clip());const ne=Q?O(M,X):M,le=Q?{x:Math.floor(F.x*X),y:Math.floor(F.y*X),width:Math.floor(F.width*X),height:Math.floor(F.height*X)}:F;ie.drawImage(ne,le.x,le.y,le.width,le.height,0,0,ee.width,ee.height)},[ee,R.width,R.height,F.x,F.y,F.width,F.height,H,D,K,R.page._exportingOrRendering,Q]),a.default.useEffect(()=>()=>{ee&&ee.nodeName==="CANVAS"&&h.default.Util.releaseCanvas(ee)},[ee]),ee||M},A=(R,M,F,D)=>{const H=_(R.clipSrc||""),[K,G]=$(H,"anonymous"),B=R.clipSrc?G:"loaded";(0,e.useImageLoader)(B,R.id+"-clip");const Y=a.default.useMemo(()=>{if(M&&K)return d()},[M,K]);return a.default.useLayoutEffect(()=>{var X;if(!K||!M||!M.width||!M.height||!K||!K.width||!K.height||!Y)return;const Q=d(),te=Math.max(R.width/K.width*F,R.height/K.height*F);Q.width=K.width*te,Q.height=K.height*te,(X=Q.getContext("2d"))===null||X===void 0||X.drawImage(K,0,0,Q.width,Q.height),Y.width=Math.max(M.width,1),Y.height=Math.max(M.height,1);const ee=Y.getContext("2d");ee&&(ee.save(),ee.drawImage(Q,0,0,M.width,M.height),h.default.Util.releaseCanvas(Q),ee.globalCompositeOperation="source-in",ee.drawImage(M,0,0,Y.width,Y.height),ee.restore())},[Y,M,K,R.width,R.height,F,...D]),R.clipSrc&&K?Y:M},L=d(),I=(0,o.observer)(({element:R})=>{const M=Math.min(30,R.width/4,R.height/4),F=a.default.useRef(null);return a.default.useEffect(()=>{const D=F.current;if(!D)return;const H=new h.default.Animation(K=>{D.rotate(((K==null?void 0:K.timeDiff)||0)/2)},D.getLayer());return H.start(),()=>{H.stop()}}),a.default.createElement(u.Group,{x:R.x,y:R.y,rotation:R.rotation,listening:!1,opacity:R.a.opacity,hideInExport:!R.showInExport},a.default.createElement(u.Rect,{width:R.width,height:R.height,fill:"rgba(124, 173, 212, 0.8)"}),a.default.createElement(u.Arc,{ref:F,x:R.width/2,y:R.height/2,fill:"white",outerRadius:Math.abs(M),innerRadius:Math.max(1,M-5),angle:270}))}),U=(0,o.observer)(({element:R})=>{const M="Can not load the video...",F=Math.max(10,Math.min(30,R.width/25));return a.default.createElement(u.Group,{x:R.x,y:R.y,rotation:R.rotation,listening:!1,opacity:R.a.opacity,hideInExport:!R.showInExport},a.default.createElement(u.Rect,{width:R.width,height:R.height,fill:"rgba(223, 102, 102, 0.8)"}),a.default.createElement(u.Text,{text:M,fontSize:F,width:R.width,height:R.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let $=f.default;const Z=R=>{$=R};e.setImageLoaderHook=Z;const q=(R,M)=>{const F=a.default.useRef(),D=()=>{var H;(H=F.current)===null||H===void 0||H.call(F),F.current=void 0};a.default.useEffect(()=>D,[]),a.default.useLayoutEffect(()=>{R!=="loading"||F.current||(F.current=(0,p.incrementLoader)(`video ${M}`)),R!=="loading"&&D(),R==="failed"&&(0,p.triggerLoadError)(`video ${M}`)},[R])};e.useImageLoader=q;function z(R,M){for(var F=R.buffered,D=0;D<F.length;D++)if(M>=F.start(D)&&M<=F.end(D))return!0;return!1}function W(R,M,F){const D=a.default.useRef("loading"),H=a.default.useRef(null),[K,G]=a.default.useState(0),B=a.default.useRef(),Y=a.default.useRef(),X=a.default.useRef();return B.current===R&&Y.current===M&&X.current===F||(D.current="loading",H.current=void 0,B.current=R,Y.current=M,X.current=F),a.default.useLayoutEffect(function(){if(R){var Q=document.createElement("video");return Q.addEventListener("canplay",te),Q.addEventListener("error",ee),Q.crossOrigin=M,Q.src=R,function(){Q.removeEventListener("canplay",te),Q.removeEventListener("error",ee)}}function te(){D.current="loaded",H.current=Q,H.current.currentTime=0,G(Math.random()),H.current.removeEventListener("canplay",te)}function ee(ie){D.current="failed",H.current=void 0,G(Math.random())}},[R,M,F]),[H.current,D.current]}e.VideoElement=(0,o.observer)(({element:R,store:M})=>{var F;const[D,H]=a.default.useState(!1),K=a.default.useRef(null),G=a.default.useRef(null),[B,Y]=a.default.useState(!1),X=M.selectedShapes.indexOf(R)>=0,[Q,te]=a.default.useState(!1),[ee,ie]=W(R.src,"anonymous"),ne=M.activePage===R.page;(0,e.useImageLoader)(ie,R.id+"-video"),ee&&(ee.width=ee.videoWidth,ee.height=ee.videoHeight);const le=ee||L;a.default.useEffect(()=>{ee&&M.history.ignore(()=>{R.set({duration:1e3*ee.duration})})},[ee]),a.default.useEffect(()=>{var xe;if(!ee)return;const ze=ne&&(M.isPlaying||Q);if(!ze)return void ee.pause();ze&&(ee.currentTime=R.startTime*ee.duration,ee.play());const rt=new h.default.Animation(()=>{},(xe=K.current)===null||xe===void 0?void 0:xe.getLayer());rt.start();const yt=()=>{te(!1),ee.currentTime=R.startTime*ee.duration},xt=()=>{ee.currentTime>=R.endTime*ee.duration&&(ee.pause(),ee.currentTime=R.startTime*ee.duration,te(!1))};return ee.addEventListener("ended",yt),ee.addEventListener("timeupdate",xt),()=>{rt.stop(),ee.removeEventListener("ended",yt),ee.removeEventListener("timeupdate",xt)}},[ee,Q,M.isPlaying,ne]),a.default.useEffect(()=>{ee&&(ee.volume=R.volume)},[ee,R.volume]);const Te=a.default.useRef();a.default.useEffect(()=>{const xe=(0,l.autorun)(()=>{var ze,rt;if(ee){const yt=(M.currentTime-R.page.startTime)%R.duration;(Math.abs(1e3*ee.currentTime-yt)>500||!M.isPlaying)&&(ee.currentTime=yt/1e3,M.isPlaying||ee.currentTime===0||(Te.current=(0,p.incrementLoader)(`video ${R.id}`))),(rt=(ze=K.current)===null||ze===void 0?void 0:ze.getLayer())===null||rt===void 0||rt.batchDraw()}});return()=>{xe(),Te.current&&(Te.current(),Te.current=null)}},[M,ee]),a.default.useEffect(()=>{if(!ee)return;let xe=null;const ze=()=>{var yt,xt;Te.current&&((xt=(yt=K.current)===null||yt===void 0?void 0:yt.getLayer())===null||xt===void 0||xt.batchDraw(),Te.current(),Te.current=null),z(ee,ee.currentTime)||(xe&&(console.error("finish already exists"),xe()),xe=(0,p.incrementLoader)(`video ${R.id}`))},rt=()=>{xe&&(xe(),xe=null)};return ee.addEventListener("timeupdate",ze),ee.addEventListener("canplay",rt),()=>{ee.removeEventListener("timeupdate",ze),ee.removeEventListener("canplay",rt)}},[ee,R.id,p.incrementLoader]);let{cropX:Ie,cropY:se,cropWidth:de,cropHeight:_e}=R;ie!=="loaded"&&(Ie=se=0,de=_e=1);const ve=le.width*de,re=le.height*_e,ce=R.width/R.height;let be,Oe;const $e=ve/re,Qe=R.type==="svg";Qe?(be=ve,Oe=re):ce>=$e?(be=ve,Oe=ve/ce):(be=re*ce,Oe=re);const Ye={x:le.width*Ie,y:le.height*se,width:be,height:Oe},Le=(F=R.cornerRadius)!==null&&F!==void 0?F:0;let Ee=A(R,x(R,le,Ye,M._elementsPixelRatio,Le,D||R._cropModeEnabled||R.type==="svg"),M._elementsPixelRatio,[Ye,Le,M._elementsPixelRatio]);const Re=Math.max(R.width/be,R.height/Oe);a.default.useEffect(()=>{var xe;if(!R._cropModeEnabled)return;const ze=(xe=K.current)===null||xe===void 0?void 0:xe.getStage();function rt(xt){R._cropModeEnabled&&xt.target!==G.current&&R.toggleCropMode(!1)}function yt(xt){R._cropModeEnabled&&xt.target.parentNode!==ze.content&&R.toggleCropMode(!1)}return document.body.addEventListener("click",yt),ze==null||ze.on("click",rt),ze==null||ze.on("tap",rt),()=>{document.body.removeEventListener("click",yt),document.body.removeEventListener("touchstart",yt),ze==null||ze.off("click",rt),ze==null||ze.off("click",rt)}},[R._cropModeEnabled]),a.default.useLayoutEffect(()=>{if(!(D||R._cropModeEnabled))return(0,y.applyFilter)(K.current,R),(0,l.autorun)(()=>{(0,y.applyFilter)(K.current,R)},{delay:100})},[le,D,de,_e,R._cropModeEnabled]),a.default.useLayoutEffect(()=>{var xe;D||R._cropModeEnabled?(xe=K.current)===null||xe===void 0||xe.clearCache():(0,y.applyFilter)(K.current,R)},[D,R.width,R.height,R._cropModeEnabled]),a.default.useEffect(()=>{(0,y.applyFilter)(K.current,R)},[R.shadowEnabled,R.shadowBlur,R.cornerRadius,R.shadowColor,R.shadowOffsetX,R.shadowOffsetY,R.shadowOpacity]);const Ve=a.default.useRef(null),oe=a.default.useRef(null),fe=a.default.useRef(null);a.default.useLayoutEffect(()=>{R._cropModeEnabled&&(oe.current.nodes([Ve.current]),fe.current.nodes([G.current]))},[R._cropModeEnabled]);const Ze=xe=>{Math.round(xe.target.x())>0&&(xe.target.x(0),xe.target.scaleX(1)),Math.round(xe.target.y())>0&&(xe.target.y(0),xe.target.scaleY(1));const ze=xe.target.width()*xe.target.scaleX(),rt=xe.target.height()*xe.target.scaleY(),yt=Math.min(1,be/ze),xt=Math.min(1,Oe/rt),xr=1-yt,Zr=Math.min(xr,Math.max(0,Math.round(-xe.target.x())/ze)),mr=1-xt,Qr=Math.min(mr,Math.max(0,Math.round(-xe.target.y())/rt));xe.target.setAttrs({x:-Zr*le.width,y:-Qr*le.height,scaleX:1,scaleY:1}),R.set({cropX:Zr,cropY:Qr,cropWidth:yt,cropHeight:xt})},ye=()=>{R.type!=="svg"&&R.contentEditable&&setTimeout(()=>{R.toggleCropMode(!0)})},Me=ie==="loading",Pe=ie==="failed",we=!Me&&!Pe,et=a.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Se=we?R.a.opacity:0;(0,v.useFadeIn)(K,Se);const We=R.selectable||M.role==="admin",lr=(0,m.isTouchDevice)();return a.default.createElement(a.default.Fragment,null,Me&&a.default.createElement(I,{element:R}),Pe&&a.default.createElement(U,{element:R}),a.default.createElement(u.Image,{ref:K,name:"element",id:R.id,image:le,x:R.x,y:R.y,width:R.width||1,height:R.height||1,rotation:R.rotation,opacity:Se,shadowEnabled:R.shadowEnabled,shadowBlur:R.shadowBlur,shadowOffsetX:R.shadowOffsetX,shadowOffsetY:R.shadowOffsetY,shadowColor:R.shadowColor,shadowOpacity:R.shadowOpacity,customCrop:Ye,listening:We,cropX:Ye.x,cropY:Ye.y,cropWidth:Ye.width,cropHeight:Ye.height,draggable:lr?R.draggable&&X:R.draggable,preventDefault:!lr||X,hideInExport:!R.showInExport,onMouseEnter:()=>{Y(!0)},onMouseLeave:()=>{Y(!1)},onDragMove:xe=>{R.set({x:xe.target.x(),y:xe.target.y()})},onDragEnd:xe=>{R.set({x:xe.target.x(),y:xe.target.y()})},onDblClick:ye,onDblTap:ye,onTransformStart:()=>{H(!0),et.current={cropX:R.cropX,cropY:R.cropY,cropWidth:R.cropWidth,cropHeight:R.cropHeight}},onTransform:xe=>{var ze;const rt=xe.currentTarget,yt=Math.abs(rt.scaleX()-1)<1e-7?1:rt.scaleX(),xt=Math.abs(rt.scaleY()-1)<1e-7?1:rt.scaleY();rt.scaleX(1),rt.scaleY(1);const xr=(ze=xe.target.getStage())===null||ze===void 0?void 0:ze.findOne("Transformer"),Zr=1-be/le.width,mr=Math.min(Zr,Math.max(0,R.cropX)),Qr=1-Oe/le.height,Qn=Math.min(Qr,Math.max(0,R.cropY)),Rn=xr.getActiveAnchor(),Ne=!(Rn.indexOf("middle")>=0||Rn.indexOf("center")>=0),tt=!Ne&&yt<1&&et.current.cropHeight>Oe/le.height;let ct=Ne?R.cropWidth:R.cropWidth*yt;tt&&(ct=R.cropWidth);const Mt=!Ne&&xt<1&&et.current.cropWidth>be/le.width;let Et=Ne?R.cropHeight:R.cropHeight*xt;Mt&&(Et=R.cropHeight),Qe&&(ct=R.cropWidth,Et=R.cropHeight),R.set({cropX:mr,cropY:Qn,x:rt.x(),y:rt.y(),width:rt.width()*yt,height:rt.height()*xt,rotation:xe.target.rotation(),cropWidth:Math.min(ct,1-mr),cropHeight:Math.min(Et,1-Qn)})},onTransformEnd:xe=>{const ze=xe.currentTarget;R.set({width:ze.width(),height:ze.height(),x:ze.x(),y:ze.y(),rotation:xe.target.rotation(),cropWidth:be/le.width,cropHeight:Oe/le.height}),H(!1)}}),a.default.createElement(u.Rect,{x:R.x,y:R.y,width:Math.max(R.width-R.borderSize,0),height:Math.max(R.height-R.borderSize,0),opacity:Se,offsetX:-R.borderSize/2,offsetY:-R.borderSize/2,stroke:R.borderColor,strokeWidth:R.borderSize,listening:!1,visible:!!R.borderSize,rotation:R.rotation,cornerRadius:Math.max(0,Le-R.borderSize),hideInExport:!R.showInExport}),!Q&&!M.isPlaying&&a.default.createElement(u.Image,{image:k,x:R.x+R.width/2-15/M.scale,y:R.y+R.height/2-15/M.scale,width:30/M.scale,height:30/M.scale,hideInExport:!0,onClick:()=>{te(!0)}}),Q&&!M.isPlaying&&a.default.createElement(u.Image,{image:C,x:R.x+R.width/2-15/M.scale,y:R.y+R.height/2-15/M.scale,width:30/M.scale,height:30/M.scale,hideInExport:!0,onClick:()=>{te(!1)}}),R._cropModeEnabled&&a.default.createElement(E.Portal,{selector:".page-abs-container",enabled:!0},a.default.createElement(u.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)"}),a.default.createElement(u.Image,{listening:!1,image:Ee,x:R.x,y:R.y,width:R.width,height:R.height,rotation:R.rotation,shadowEnabled:R.shadowEnabled,shadowBlur:R.shadowBlur}),a.default.createElement(u.Group,{x:R.x,y:R.y,rotation:R.rotation,scaleX:Re,scaleY:Re},a.default.createElement(u.Image,{image:le,ref:G,opacity:.4,draggable:!0,x:-R.cropX*le.width,y:-R.cropY*le.height,onDragMove:Ze,onTransform:Ze}),a.default.createElement(u.Transformer,{ref:fe,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(xe,ze)=>ze.width<5||ze.height<5?xe:ze,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),a.default.createElement(u.Rect,{width:be,height:Oe,ref:Ve,listening:!1,onTransform:xe=>{xe.target.x()<-R.cropX*le.width-1e-9&&(xe.target.x(-R.cropX*le.width),xe.target.scaleX(1)),xe.target.y()<-R.cropY*le.height-1e-9&&(xe.target.y(-R.cropY*le.height),xe.target.scaleY(1));const ze=Math.min(1,Math.max(0,R.cropX+xe.target.x()/le.width)),rt=Math.min(1,Math.max(0,xe.target.y()/le.height+R.cropY)),yt=xe.target.width()*xe.target.scaleX(),xt=xe.target.height()*xe.target.scaleY(),xr=Math.min(1-ze,yt/le.width),Zr=Math.min(1-rt,xt/le.height),mr=xe.target.getAbsolutePosition(xe.target.getParent().getParent());xe.target.scale({x:1,y:1}),xe.target.position({x:0,y:0}),R.set({x:mr.x,y:mr.y,cropX:ze,cropY:rt,cropWidth:xr,cropHeight:Zr,width:Math.min(yt*Re,le.width*(1-ze)*Re),height:Math.min(xt*Re,le.height*(1-rt)*Re)})}}),a.default.createElement(u.Transformer,{ref:oe,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(xe,ze)=>ze.width<5||ze.height<5?xe:ze,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),(B||X)&&a.default.createElement(w.Highlighter,{element:R}))})})(fS);var dS={},Zp={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.figureToSvg=e.subTypeToPathDataFunc=e.TYPES=e.crossPath=e.speechBubblePath=e.hexagonPath=e.pentagonPath=e.diamondPath=e.starPath=e.circleData=e.rightTriangleData=e.triangleData=e.rectData=void 0;const t=({width:b,height:y,cornerRadius:v})=>{if(v>0){const m=Math.min(v,b/2,y/2);return`M 0 ${m} A ${m} ${m} 0 0 1 ${m} 0 L ${b-m} 0 A ${m} ${m} 0 0 1 ${b} ${m} L ${b} ${y-m} A ${m} ${m} 0 0 1 ${b-m} ${y} L ${m} ${y} A ${m} ${m} 0 0 1 0 ${y-m} Z`}return`M 0 0 L ${b} 0 L ${b} ${y} L 0 ${y} Z`};e.rectData=t;const r=({width:b,height:y})=>`M ${b/2} 0 L ${b} ${y} L 0 ${y} Z`;e.triangleData=r;const n=({width:b,height:y})=>`M 0 0 L ${b} 0 L 0 ${y} Z`;e.rightTriangleData=n;const i=({width:b,height:y})=>`M ${b/2} ${y/2} m -${b/2}, 0 a ${b/2},${y/2} 0 1,0 ${b},0 a ${b/2},${y/2} 0 1,0 -${b},0`;function a({width:b,height:y}){const v=b/2,m=y/2,d=b/2,g=y/2,_=d/2,k=g/2;let C="",P=Math.PI/5;for(let O=0;O<10;O++){const x=O%2==0?g:k,A=v+(O%2==0?d:_)*Math.sin(O*P),L=m-x*Math.cos(O*P);O===0?C=`M ${A} ${L}`:C+=` L ${A} ${L}`}return C+" Z"}function o({width:b,height:y}){const v=b/2,m=y/2;return`M ${v} 0 L ${b} ${m} L ${v} ${y} L 0 ${m} Z`}function l({width:b,height:y}){const v=b/2,m=y/2,d=b/2,g=y/2;let _="",k=2*Math.PI/5;for(let C=0;C<5;C++){const P=g,O=v+d*Math.sin(C*k),x=m-P*Math.cos(C*k);C===0?_=`M ${O} ${x}`:_+=` L ${O} ${x}`}return _+" Z"}function u({width:b,height:y}){const v=b/2,m=y/2,d=b/2,g=y/2;let _="",k=2*Math.PI/6;for(let C=0;C<6;C++){const P=g,O=v+d*Math.sin(C*k),x=m-P*Math.cos(C*k);C===0?_=`M ${O} ${x}`:_+=` L ${O} ${x}`}return _+" Z"}function f({path:b,aspectRatio:y,width:v,height:m}){return{path:b,scaleX:v/y.width,scaleY:m/y.height}}function h({width:b,height:y}){const v=.1*Math.min(b,y),m=.2*b,d=.2*y,g=.5*b;let _=`M ${v},0`;return _+=" H "+(b-v),_+=` A ${v},${v} 0 0 1 ${b},${v}`,_+=" V "+(y-v-d),_+=` A ${v},${v} 0 0 1 ${b-v},${y-d}`,_+=` H ${g+m/2}`,_+=` L ${g},${y}`,_+=` L ${g-m/2},${y-d}`,_+=` H ${v}`,_+=` A ${v},${v} 0 0 1 0,${y-v-d}`,_+=` V ${v}`,_+=` A ${v},${v} 0 0 1 ${v},0`,_+=" Z",_}function E({width:b,height:y}){const v=.3*b,m=.3*y,d=b/2,g=y/2,_=d-v/2,k=d+v/2,C=g-m/2,P=g+m/2;let O=`M ${_},0 `;return O+=`H ${k} `,O+=`V ${C} `,O+=`H ${b} `,O+=`V ${P} `,O+=`H ${k} `,O+=`V ${y} `,O+=`H ${_} `,O+=`V ${P} `,O+="H 0 ",O+=`V ${C} `,O+=`H ${_} `,O+="V 0 ",O+="Z",O}function w(b){return e.TYPES[b]||e.rectData}function p(b,y){const{width:v,height:m,fill:d,stroke:g,strokeWidth:_,dash:k}=b,C=(k||[]).map(L=>L*_);let P=y(b),O=1,x=1;typeof P!="string"&&(O=P.scaleX,x=P.scaleY,P=P.path);const A=`clip-${b.id||Math.random()}`;return`
235
+ <svg xmlns="http://www.w3.org/2000/svg" width="${v}" height="${m}">
236
+ <defs>
237
+ <clipPath id="${A}">
238
+ <path d="${P}" />
239
+ </clipPath>
240
+ </defs>
241
+
242
+ <!-- Path for the fill -->
243
+ <path d="${P}" fill="${d}" transform="scale(${O}, ${x})"/>
244
+
245
+ <!-- Path for the stroke, clipped by the star path -->
246
+ <path d="${P}" fill="none" stroke="${g}" stroke-width="${2*_}" clip-path="url(#${A})" transform="scale(${O}, ${x})" stroke-dasharray="${C.join(" ")}"/>
247
+ </svg>
248
+ `}function S(b){const{subType:y}=b,v=w(y);return v?p(b,v):(console.error(`Polotno error: Can not convert ${b.subType} figure to svg.`),(0,e.rectData)(b))}e.circleData=i,e.starPath=a,e.diamondPath=o,e.pentagonPath=l,e.hexagonPath=u,e.speechBubblePath=h,e.crossPath=E,e.TYPES={rect:e.rectData,circle:e.circleData,star:a,triangle:e.triangleData,rightTriangle:e.rightTriangleData,diamond:o,pentagon:l,hexagon:u,speechBubble:h,cross:E,arc:({width:b,height:y})=>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:b,height:y}),cloud:({width:b,height:y})=>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:b,height:y}),rightArrow:({width:b,height:y})=>{const v=.6*b;return`M 0 ${y/4} L ${v} ${y/4} L ${v} 0 L ${b} ${y/2} L ${v} ${y} L ${v} ${.75*y} L 0 ${.75*y} Z`},leftArrow:({width:b,height:y})=>{const v=.4*b;return`M ${b} ${y/4} L ${v} ${y/4} L ${v} 0 L 0 ${y/2} L ${v} ${y} L ${v} ${.75*y} L ${b} ${.75*y} Z`},downArrow:({width:b,height:y})=>{const v=.6*y;return`M ${b/4} 0 L ${b/4} ${v} L 0 ${v} L ${b/2} ${y} L ${b} ${v} L ${.75*b} ${v} L ${.75*b} 0 Z`},upArrow:({width:b,height:y})=>{const v=.4*y;return`M ${b/4} ${y} L ${b/4} ${v} L 0 ${v} L ${b/2} 0 L ${b} ${v} L ${.75*b} ${v} L ${.75*b} ${y} Z`},asterisk1:({width:b,height:y})=>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:b,height:y}),asterisk2:({width:b,height:y})=>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:b,height:y}),bookmark:({width:b,height:y})=>f({path:"M0 0H199V238L99.5 142.8L0 238V0Z",aspectRatio:{width:199,height:238},width:b,height:y}),butterfly:({width:b,height:y})=>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:b,height:y}),cylinder:({width:b,height:y})=>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:b,height:y}),diamond2:({width:b,height:y})=>f({path:"M0 55.5L124 185L248 55.5L189.307 0H58.6933L0 55.5Z",aspectRatio:{width:248,height:185},width:b,height:y}),door:({width:b,height:y})=>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:b,height:y}),drop1:({width:b,height:y})=>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:b,height:y}),drop2:({width:b,height:y})=>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:b,height:y}),explosion:({width:b,height:y})=>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:b,height:y}),flag:({width:b,height:y})=>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:b,height:y}),flower:({width:b,height:y})=>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:b,height:y}),frame:({width:b,height:y})=>f({path:"M0 0H240L200 88L240 176H0L40 88L0 0Z",aspectRatio:{width:240,height:176},width:b,height:y}),heart1:({width:b,height:y})=>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:b,height:y}),home:({width:b,height:y})=>f({path:"M0 62.143L95.5 0L191 62.143V195H0V62.143Z",aspectRatio:{width:191,height:195},width:b,height:y}),home2:({width:b,height:y})=>f({path:"M206 94.076L103 0L0 94.076H31.2377V189H175.607V94.076H206Z",aspectRatio:{width:206,height:189},width:b,height:y}),hourglass:({width:b,height:y})=>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:b,height:y}),house:({width:b,height:y})=>f({path:"M0 92.367L95 0L190 92.367V223H0V92.367Z",aspectRatio:{width:190,height:223},width:b,height:y}),keyhole:({width:b,height:y})=>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:b,height:y}),kiss:({width:b,height:y})=>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:b,height:y}),leaf:({width:b,height:y})=>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:b,height:y}),lightning1:({width:b,height:y})=>f({path:"M111.5 0L0 142H51.433L31.5 253L143 111H91.567L111.5 0Z",aspectRatio:{width:143,height:253},width:b,height:y}),lightning2:({width:b,height:y})=>f({path:"M126 0H43L0 120.531H36L6 227L110 80.354H73L126 0Z",aspectRatio:{width:126,height:227},width:b,height:y}),magnet:({width:b,height:y})=>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:b,height:y}),mithosis:({width:b,height:y})=>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:b,height:y}),orangeRicky:({width:b,height:y})=>f({path:"M69 0H0V69V138V207H69H138V138H69V69V0Z",aspectRatio:{width:138,height:207},width:b,height:y}),party:({width:b,height:y})=>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:b,height:y}),pillow:({width:b,height:y})=>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:b,height:y}),polygon:({width:b,height:y})=>f({path:"M110 0L219.119 63V189L110 252L0.880798 189V63L110 0Z",aspectRatio:{width:220,height:252},width:b,height:y}),rainbow:({width:b,height:y})=>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:b,height:y}),rhodeIsland:({width:b,height:y})=>f({path:"M69 0H0V69V138H69V207H138V138V69H69V0Z",aspectRatio:{width:138,height:207},width:b,height:y}),shell:({width:b,height:y})=>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:b,height:y}),shield1:({width:b,height:y})=>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:b,height:y}),shield2:({width:b,height:y})=>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:b,height:y}),skewedRectangle:({width:b,height:y})=>f({path:"M85.9799 0H290L204.02 141H0L85.9799 0Z",aspectRatio:{width:290,height:141},width:b,height:y}),softFlower:({width:b,height:y})=>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:b,height:y}),softStar:({width:b,height:y})=>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:b,height:y}),stairs1:({width:b,height:y})=>f({path:"M0 0H67.667V67.667H135.333V135.333H203V203H0V0Z",aspectRatio:{width:203,height:203},width:b,height:y}),stairs2:({width:b,height:y})=>f({path:"M50 0H0V200H200V150H150V100H100V50H50V0Z",aspectRatio:{width:200,height:200},width:b,height:y}),teewee:({width:b,height:y})=>f({path:"M69 0H138V69H207V138H138H69H0V69H69V0Z",aspectRatio:{width:207,height:138},width:b,height:y}),blob1:({width:b,height:y})=>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:b,height:y}),blob10:({width:b,height:y})=>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:b,height:y}),blob11:({width:b,height:y})=>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:b,height:y}),blob12:({width:b,height:y})=>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:b,height:y}),blob13:({width:b,height:y})=>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:b,height:y}),blob14:({width:b,height:y})=>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:b,height:y}),blob15:({width:b,height:y})=>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:b,height:y}),blob16:({width:b,height:y})=>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:b,height:y}),blob17:({width:b,height:y})=>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:b,height:y}),blob18:({width:b,height:y})=>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:b,height:y}),blob19:({width:b,height:y})=>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:b,height:y}),blob2:({width:b,height:y})=>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:b,height:y}),blob20:({width:b,height:y})=>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:b,height:y}),blob21:({width:b,height:y})=>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:b,height:y}),blob22:({width:b,height:y})=>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:b,height:y}),blob23:({width:b,height:y})=>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:b,height:y}),blob24:({width:b,height:y})=>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:b,height:y}),blob25:({width:b,height:y})=>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:b,height:y}),blob26:({width:b,height:y})=>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:b,height:y}),blob27:({width:b,height:y})=>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:b,height:y}),blob28:({width:b,height:y})=>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:b,height:y}),blob29:({width:b,height:y})=>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:b,height:y}),blob3:({width:b,height:y})=>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:b,height:y}),blob30:({width:b,height:y})=>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:b,height:y}),blob31:({width:b,height:y})=>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:b,height:y}),blob32:({width:b,height:y})=>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:b,height:y}),blob4:({width:b,height:y})=>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:b,height:y}),blob5:({width:b,height:y})=>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:b,height:y}),blob6:({width:b,height:y})=>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:b,height:y}),blob7:({width:b,height:y})=>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:b,height:y}),blob8:({width:b,height:y})=>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:b,height:y}),blob9:({width:b,height:y})=>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:b,height:y})},e.subTypeToPathDataFunc=w,e.figureToSvg=S})(Zp);(function(e){var t=me&&me.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const r=t(Je),n=_i,i=Ca,a=Zp,o=Pl,l=Po,u=Wc,f={};e.FigureElement=(0,n.observer)(({element:h,store:E})=>{const w=h.selectable||E.role==="admin",p=(0,l.isTouchDevice)(),[S,b]=r.default.useState(!1),y=E.selectedShapes.indexOf(h)>=0,v=Math.min(h.strokeWidth,h.width/2,h.height/2),m=Math.max(0,Math.min(h.width/2,h.height/2,h.cornerRadius)),d=(0,u.useColor)(h,h.a.fill,"fill"),g=Object.assign(Object.assign({width:h.a.width,height:h.a.height},d),{cornerRadius:m,opacity:h.animated("opacity"),shadowEnabled:h.shadowEnabled,shadowBlur:h.shadowBlur,shadowOffsetX:h.shadowOffsetX,shadowOffsetY:h.shadowOffsetY,shadowColor:h.shadowColor,shadowOpacity:h.shadowOpacity,preventDefault:!p||y,hideInExport:!h.showInExport}),_=(0,u.useColor)(h,h.stroke,"stroke"),k=Object.assign(Object.assign({visible:v>0,x:v/2,y:v/2,width:h.a.width-v,height:h.a.height-v},_),{strokeWidth:v,cornerRadius:Math.max(0,m-v),dash:h.dash.map(x=>x*v),opacity:h.animated("opacity"),hideInExport:!h.showInExport,listening:!1}),C=(P=h.subType,f[P]||(f[P]=(O=(0,a.subTypeToPathDataFunc)(P),(0,n.observer)(({element:x,fillProps:A,strokeProps:L})=>{let I=O({width:x.a.width,height:x.a.height,cornerRadius:x.cornerRadius}),U=1,$=1;typeof I!="string"&&(U=I.scaleX,$=I.scaleY,I=I.path);const Z=r.default.useRef(null);return r.default.createElement(r.default.Fragment,null,r.default.createElement(i.Rect,{width:x.width,height:x.height,fill:"transparent"}),r.default.createElement(i.Path,Object.assign({},A,{ref:Z,data:I,scaleX:U,scaleY:$})),r.default.createElement(i.Group,{clipFunc:q=>{const z=Z.current;if(z){var W=z.dataArray;q.beginPath();for(var R=0;R<W.length;R++){var M=W[R].command,F=W[R].points;switch(M){case"L":q.lineTo(F[0],F[1]);break;case"M":q.moveTo(F[0],F[1]);break;case"C":q.bezierCurveTo(F[0],F[1],F[2],F[3],F[4],F[5]);break;case"Q":q.quadraticCurveTo(F[0],F[1],F[2],F[3]);break;case"A":var D=F[0],H=F[1],K=F[2],G=F[3],B=F[4],Y=F[5],X=F[6],Q=F[7],te=K>G?K:G,ee=K>G?1:K/G,ie=K>G?G/K:1;q.translate(D,H),q.rotate(X),q.scale(ee,ie),q.arc(0,0,te,B,B+Y,1-Q),q.scale(1/ee,1/ie),q.rotate(-X),q.translate(-D,-H);break;case"z":q.closePath()}}}},scaleX:U,scaleY:$},r.default.createElement(i.Path,Object.assign({},L,{x:0,y:0,data:I,strokeWidth:2*L.strokeWidth,dash:L.dash.map(q=>q)}))))}))),f[P]||i.Group);var P,O;return r.default.createElement(r.default.Fragment,null,r.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:p?h.draggable&&y:h.draggable,name:"element",onMouseEnter:()=>{b(!0)},onMouseLeave:()=>{b(!1)},onDragMove:x=>{h.set({x:x.target.x(),y:x.target.y()})},onDragEnd:x=>{h.set({x:x.target.x(),y:x.target.y()})},onTransform:x=>{const A=x.target.scale();x.target.scaleX(1),x.target.scaleY(1),h.set({width:h.width*A.x,height:h.height*A.y,x:x.target.x(),y:x.target.y(),rotation:x.target.rotation()})}},r.default.createElement(C,{element:h,fillProps:g,strokeProps:k})),S&&!y&&r.default.createElement(o.Highlighter,{element:h}))})})(dS);(function(e){var t=me&&me.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeComponent=void 0;const r=t(Je),n=_i,i=Zy,a=d2,o=nS,l=cS,u=fS,f=dS,h=Ca,E=Yn,w=(0,n.observer)(y=>{const{element:v,store:m}=y,{children:d}=v,g=v.selectable||m.role==="admin";return r.default.createElement(h.Group,{opacity:v.opacity,listening:g,hideInExport:!v.showInExport},d.map(_=>r.default.createElement(b,Object.assign({},y,{key:_.id,store:m,element:_}))))}),p={text:i.TextElement,image:a.ImageElement,svg:a.ImageElement,line:l.LineElement,video:u.VideoElement,figure:f.FigureElement,group:w};function S(y,v){p[y]=v}e.registerShapeComponent=S;const b=(0,n.observer)(y=>{let v=p[y.element.type];return y.element.type==="text"&&E.flags.htmlRenderEnabled&&(v=o.HTMLElement),y.element.visible?v?r.default.createElement(v,Object.assign({},y)):(console.error("Can not find component for "+y.element.type),null):null});e.default=b})(W9);var hS={};(function(e){function t(r,n,i="scale"){const a=n.width/n.height;let o,l;a>=r.width/r.height?(o=r.width,l=r.width/a):(o=r.height*a,l=r.height);let u=0,f=0;return i==="left-top"?(u=0,f=0):i==="left-middle"?(u=0,f=(r.height-l)/2):i==="left-bottom"?(u=0,f=r.height-l):i==="center-top"?(u=(r.width-o)/2,f=0):i==="center-middle"?(u=(r.width-o)/2,f=(r.height-l)/2):i==="center-bottom"?(u=(r.width-o)/2,f=r.height-l):i==="right-top"?(u=r.width-o,f=0):i==="right-middle"?(u=r.width-o,f=(r.height-l)/2):i==="right-bottom"?(u=r.width-o,f=r.height-l):i==="scale"?(u=0,f=0,o=r.width,l=r.height):console.error(new Error("Unknown clip position property - "+i)),{cropX:u,cropY:f,cropWidth:o,cropHeight:l}}Object.defineProperty(e,"__esModule",{value:!0}),e.getCrop=void 0,e.getCrop=t})(hS);var $g={},Gg={},w_;function sj(){return w_||(w_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.setAPI=e.iconscoutDownload=e.iconscoutList=e.svgapiDownload=e.svgapiList=e.unsplashDownload=e.unsplashList=e.textTemplateList=e.templateList=e.removeBackground=e.polotnoShapesList=e.getGoogleFontImage=e.getGoogleFontsListAPI=e.URLS=e.getAPI=e.API=e.URL=void 0;const t=S2();e.URL="https://api.polotno.com",e.API="https://api.polotno.com/api";const r=()=>e.URL+"/api";e.getAPI=r;const n={},i=(d,g)=>{n[d]||(n[d]=!0,console.error(g))},a=`API for iconscout is provided as a demonstration.
249
+ For production usage you have to use your own API endpoint.
250
+ https://iconscout.com/developers, https://iconscout.com/legal/api-license-development-agreement
251
+ https://polotno.com/docs/server-api`;e.URLS={unsplashList:({query:d,page:g=1})=>`${(0,e.getAPI)()}/get-unsplash?query=${d}&per_page=20&page=${g}&KEY=${(0,t.getKey)()}`,unsplashDownload:d=>`${(0,e.getAPI)()}/download-unsplash?id=${d}&KEY=${(0,t.getKey)()}`,svgapiList:({query:d,page:g=0})=>`${(0,e.getAPI)()}/get-svgapi?query=${d}&page=${g}&per_page=20&KEY=${(0,t.getKey)()}`,svgapiDownload:d=>`${(0,e.getAPI)()}/download-svgapi?path=${d}&KEY=${(0,t.getKey)()}`,iconscoutList:({query:d,page:g=1})=>(i("iconscout",a),`${(0,e.getAPI)()}/get-iconscout?query=${d}&page=${g}&KEY=${(0,t.getKey)()}`),iconscoutDownload:d=>(i("iconscout",a),`${(0,e.getAPI)()}/download-iconscout?uuid=${d}&KEY=${(0,t.getKey)()}`),nounProjectList:({query:d,page:g=1})=>`${(0,e.getAPI)()}/get-nounproject?query=${d}&page=${g}&KEY=${(0,t.getKey)()}`,nounProjectDownload:d=>`${(0,e.getAPI)()}/download-nounproject?id=${d}&KEY=${(0,t.getKey)()}`,templateList:({query:d,page:g=1,sizeQuery:_})=>`${(0,e.getAPI)()}/get-templates?${_}&query=${d}&per_page=30&page=${g}&KEY=${(0,t.getKey)()}`};const o=()=>`${(0,e.getAPI)()}/get-google-fonts?KEY=${(0,t.getKey)()}`;e.getGoogleFontsListAPI=o;const l=d=>{return`${e.URL}/google-fonts-previews/black/${g=d,_=" ",k="-",g.replace(new RegExp(_,"g"),k)}.png`;var g,_,k};e.getGoogleFontImage=l;const u=()=>`${(0,e.getAPI)()}/get-basic-shapes?KEY=${(0,t.getKey)()}`;e.polotnoShapesList=u;const f=()=>`${(0,e.getAPI)()}/remove-image-background?KEY=${(0,t.getKey)()}`;e.removeBackground=f;const h=d=>e.URLS.templateList(d);e.templateList=h;const E=()=>`${(0,e.getAPI)()}/get-text-templates?KEY=${(0,t.getKey)()}`;e.textTemplateList=E;const w=d=>e.URLS.unsplashList(d);e.unsplashList=w;const p=d=>e.URLS.unsplashDownload(d);e.unsplashDownload=p;const S=d=>e.URLS.svgapiList(d);e.svgapiList=S;const b=d=>e.URLS.svgapiDownload(d);e.svgapiDownload=b;const y=d=>e.URLS.iconscoutList(d);e.iconscoutList=y;const v=d=>e.URLS.iconscoutDownload(d);e.iconscoutDownload=v;const m=(d,g)=>{e.URLS[d]=g};e.setAPI=m}(Gg)),Gg}var S_;function S2(){return S_||(S_=1,function(e){var t=me&&me.__createBinding||(Object.create?function(k,C,P,O){O===void 0&&(O=P);var x=Object.getOwnPropertyDescriptor(C,P);x&&!("get"in x?!C.__esModule:x.writable||x.configurable)||(x={enumerable:!0,get:function(){return C[P]}}),Object.defineProperty(k,O,x)}:function(k,C,P,O){O===void 0&&(O=P),k[O]=C[P]}),r=me&&me.__setModuleDefault||(Object.create?function(k,C){Object.defineProperty(k,"default",{enumerable:!0,value:C})}:function(k,C){k.default=C}),n=me&&me.__importStar||function(k){if(k&&k.__esModule)return k;var C={};if(k!=null)for(var P in k)P!=="default"&&Object.prototype.hasOwnProperty.call(k,P)&&t(C,k,P);return r(C,k),C};Object.defineProperty(e,"__esModule",{value:!0}),e.validateKey=e.isKeyPaid=e.getKey=e.shouldShowCredit=void 0;const i=n(Ki),a=sj(),o=Yn;e.shouldShowCredit=i.observable({value:!1});const l=i.action(()=>{e.shouldShowCredit.value=!0});let u="";const f=()=>u||"";e.getKey=f;const h=5,E=3e3,w="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",p="Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet",S="Can not validate Polotno API key. Please report to anton@polotno.com immediately.",b="%cPolotno Free Version. Development or non-commercial usage only. https://polotno.com/";let y=window.location.origin;const v=navigator.userAgent.indexOf("Headless")>-1,m=navigator.userAgent.indexOf("Electron")>-1;y==="file://"&&v&&(y="headless"),y==="file://"&&m&&(y="electron");const d=`%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 g(k){for(let C=0;C<h;C++)try{const P=await fetch((0,a.getAPI)()+"/validate-key",{method:"POST",body:JSON.stringify({key:k,site:location.host})});if(!k)return console.warn(w),!1;if(P.status!==200){await new Promise(x=>setTimeout(x,E));continue}const O=await P.json();return O.is_valid||console.warn(p),O.is_paid||console.log(b,"background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),O.is_domain_valid||console.log(d,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),(0,o.useRemoveBackground)(O.remove_background_enabled),O.is_paid||!1}catch{await new Promise(O=>setTimeout(O,E))}return console.error(S),!0}async function _(k,C){u=k,await g(k)&&!C||l()}e.isKeyPaid=g,e.validateKey=_}($g)),$g}var Qp={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pxToUnitString=e.unitToPx=e.pxToUnitRounded=e.pxToUnit=void 0;const t=({px:a,unit:o="px",dpi:l})=>{switch(o){case"pt":default:return a;case"mm":return a/(l/25.4);case"cm":return a/(l/2.54);case"in":return a/l}};e.pxToUnit=t;const r=({px:a,precious:o=2,dpi:l=72,unit:u="px"})=>parseFloat((0,e.pxToUnit)({px:a,dpi:l,unit:u}).toFixed(o));e.pxToUnitRounded=r;const n=({unitVal:a,dpi:o,unit:l})=>a/(0,e.pxToUnit)({px:1,unit:l,dpi:o});e.unitToPx=n;const i=a=>{const o=parseFloat((0,e.pxToUnit)(a).toFixed(1));switch(a.unit){case"pt":return`${Math.round(o)}pt`;case"mm":return`${o}mm`;case"cm":return`${o}cm`;case"in":return`${o}in`;default:return`${Math.round(o)}px`}};e.pxToUnitString=i})(Qp);(function(e){var t=me&&me.__rest||function(z,W){var R={};for(var M in z)Object.prototype.hasOwnProperty.call(z,M)&&W.indexOf(M)<0&&(R[M]=z[M]);if(z!=null&&typeof Object.getOwnPropertySymbols=="function"){var F=0;for(M=Object.getOwnPropertySymbols(z);F<M.length;F++)W.indexOf(M[F])<0&&Object.prototype.propertyIsEnumerable.call(z,M[F])&&(R[M[F]]=z[M[F]])}return R},r=me&&me.__importDefault||function(z){return z&&z.__esModule?z:{default:z}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerNextDomDrop=e.registerTransformerAttrs=e.setTransformerStyle=void 0;const n=r(Je),i=_i,a=Ki,o=Ca,l=r(qp),u=r(Si),f=r(W9),h=w2,E=d2,w=hS,p=S2(),S=eu,b=Qp,y=Yn,v=Po,m=u.default.DD._drag;window.removeEventListener("mousemove",m),u.default.DD._drag=function(z){(0,a.runInAction)(()=>{m.call(this,z)})},window.addEventListener("mousemove",u.default.DD._drag);const d=new u.default.Group;d.add(new u.default.Rect({width:20,height:20,fill:"white"})),d.add(new u.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 g=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:z=>{z.hasName("rotater")&&z.setAttrs({width:20,height:20,cornerRadius:20/2,offsetX:20/2,offsetY:20/2,fillPatternImage:g,fillPatternScaleX:20/20/2,fillPatternScaleY:20/20/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}},k=z=>{Object.assign(_,z)};e.setTransformerStyle=k;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 P(z,W){C[z]=C[z]||W,Object.assign(C[z],W)}e.registerTransformerAttrs=P;const O=z=>n.default.createElement(o.Rect,Object.assign({},z,{preventDefault:!1})),x=z=>{var{url:W}=z,R=t(z,["url"]);const[M,F]=(0,l.default)(W,"anonymous"),D=M?(0,w.getCrop)(M,{width:R.width,height:R.height},"center-middle"):{};return(0,E.useImageLoader)(F,"background"),n.default.createElement(o.Image,Object.assign({image:M},R,D))},A=z=>n.default.createElement(o.Rect,Object.assign({},z)),L=z=>{const{background:W,scale:R,borderColor:M}=z,F=t(z,["background","scale","borderColor"]),D=n.default.useMemo(()=>!!u.default.Util.colorToRGBA(W),[W]),H=n.default.useMemo(()=>{const K=document.createElement("canvas"),G=30;K.width=60,K.height=60;const B=K.getContext("2d");return B&&(B.fillStyle="black",B.fillRect(G,0,G,G),B.fillRect(0,G,G,G)),K},[]);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Rect,Object.assign({fillPatternImage:H},F,{opacity:.1,hideInExport:!0})),D?n.default.createElement(A,Object.assign({fill:W},F)):n.default.createElement(x,Object.assign({url:W},F)))},I=(0,i.observer)(({selection:z})=>z.visible?n.default.createElement(o.Rect,{name:"selection",x:Math.min(z.x1,z.x2),y:Math.min(z.y1,z.y2),width:Math.abs(z.x1-z.x2),height:Math.abs(z.y1-z.y2),fill:"rgba(0, 161, 255, 0.3)"}):null),U=(0,i.observer)(({x:z,y:W,width:R,height:M,rotation:F,anchor:D,store:H})=>{const K=(0,S.getClientRect)({x:z,y:W,width:R,height:M,rotation:u.default.Util.radToDeg(F)});if(D===void 0)return null;const G=(M/2+70)*Math.cos(F-Math.PI/2),B=(M/2+70)*Math.sin(F-Math.PI/2),Y=(0,b.pxToUnitRounded)({unit:H.unit,dpi:H.dpi,px:R/H.scale,precious:H.unit==="px"?0:1})+" x "+(0,b.pxToUnitRounded)({unit:H.unit,dpi:H.dpi,px:M/H.scale,precious:H.unit==="px"?0:1})+(H.unit==="px"?"":" "+H.unit);return n.default.createElement(n.default.Fragment,null,n.default.createElement(o.Label,{x:(K.minX+K.maxX)/2+G,y:(K.minY+K.maxY)/2+B,offsetX:14,offsetY:14,visible:D==="rotater"},n.default.createElement(o.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)"}),n.default.createElement(o.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:Math.round(u.default.Util.radToDeg(F)).toString()+"°"})),n.default.createElement(o.Label,{x:(K.minX+K.maxX)/2,y:K.maxY+20,visible:D!=="rotater"},n.default.createElement(o.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"up",pointerHeight:0,pointerWidth:0}),n.default.createElement(o.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:Y})))}),$=(0,i.observer)(({elements:z,store:W})=>{const R=z.filter(F=>F.alwaysOnTop),M=z.filter(F=>!F.alwaysOnTop).concat(R);return n.default.createElement(n.default.Fragment,null,M.map(F=>n.default.createElement(f.default,{key:F.id,store:W,element:F,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))});let Z=null;const q=z=>{Z=z};e.registerNextDomDrop=q,e.default=(0,i.observer)(({store:z,page:W,width:R,height:M,pageControlsEnabled:F,backColor:D,pageBorderColor:H,activePageBorderColor:K,components:G,bleedColor:B,altCloneEnabled:Y})=>{const X=z.bleedVisible?W.bleed:0,Q=W.computedWidth+2*X,te=W.computedHeight+2*X,ee=(R-Q*z.scale)/2,ie=(M-te*z.scale)/2,ne=n.default.useRef(null),le=n.default.useRef(null),Te=n.default.useRef(null),Ie=F==null||F,[se,de]=n.default.useState(null),[_e,ve]=n.default.useState({}),re=z.selectedElements.find(ye=>ye._cropModeEnabled),ce=z.selectedShapes.filter(ye=>!ye.resizable).length>0,be=z.selectedShapes.filter(ye=>!ye.draggable).length>0,Oe=z.selectedElements.filter(ye=>!ye.visible).length>0;n.default.useLayoutEffect(()=>{var ye,Me,Pe;if(!ne.current)return;const we=ne.current.getStage(),et=z.selectedShapes.map(We=>We._cropModeEnabled?null:we.findOne("#"+We.id)).filter(We=>We),Se=z.selectedElements.length===1&&((ye=z.selectedElements[0])===null||ye===void 0?void 0:ye.type)||"many";C[Se]?(ne.current.setAttrs(Object.assign(Object.assign({},_),C[Se])),Se!=="svg"&&Se!=="image"||z.selectedElements[0].keepRatio||ne.current.setAttrs({enabledAnchors:_.enabledAnchors}),Se==="text"&&y.flags.textVerticalResizeEnabled&&ne.current.setAttrs({enabledAnchors:(Me=C.text.enabledAnchors)===null||Me===void 0?void 0:Me.concat(["bottom-center"])})):ne.current.setAttrs(_),ce&&ne.current.enabledAnchors([]),be&&ne.current.rotateEnabled(!1),et.find(We=>We==null?void 0:We.isDragging())&&et.forEach(We=>{We.isDragging()||We==null||We.startDrag()}),ne.current.nodes(et),(Pe=ne.current.getLayer())===null||Pe===void 0||Pe.batchDraw()},[z.selectedElements,re,ce,Oe,be]);const $e=(0,i.useLocalObservable)(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),Qe=n.default.useRef(!1),Ye=(0,v.isTouchDevice)(),Le=(0,a.action)(ye=>{var Me,Pe;if(Ye)return;Qe.current=!1;const we=ye.target.findAncestor(".elements-container"),et=ye.target.findAncestor("Transformer"),Se=ye.target.findAncestor(".page-abs-container");if(we||et||Se)return;const We=(Me=ye.target.getStage())===null||Me===void 0?void 0:Me.getPointerPosition();We&&($e.visible=!0,$e.x1=We.x,$e.y1=We.y,$e.x2=We.x,$e.y2=We.y,((Pe=ye.target.getStage())===null||Pe===void 0?void 0:Pe.getPointersPositions().length)>=2&&($e.visible=!1))});n.default.useEffect(()=>{const ye=(0,a.action)(Pe=>{var we,et;if(!$e.visible)return;(we=le.current)===null||we===void 0||we.setPointersPositions(Pe);let Se=((et=le.current)===null||et===void 0?void 0:et.getPointerPosition())||{x:$e.x2,y:$e.y2};$e.x2=Se.x,$e.y2=Se.y}),Me=(0,a.action)(()=>{if(!$e.visible||!le.current)return;const Pe=le.current.findOne(".selection"),we=Pe?Pe.getClientRect():{width:0,height:0,x:0,y:0};if(we.width&&we.height){const et=[];le.current.find(".element").forEach(We=>{const lr=We.getClientRect(),xe=z.getElementById(We.id()),ze=xe==null?void 0:xe.draggable,rt=xe==null?void 0:xe.selectable;u.default.Util.haveIntersection(we,lr)&&ze&&rt&&et.push(xe.top.id)});const Se=[...new Set(et)];z.selectElements(Se)}$e.visible=!1,Qe.current=!0});return window.addEventListener("mousemove",ye),window.addEventListener("touchmove",ye),window.addEventListener("mouseup",Me),window.addEventListener("touchend",Me),()=>{window.removeEventListener("mousemove",ye),window.removeEventListener("touchmove",ye),window.removeEventListener("mouseup",Me),window.removeEventListener("touchend",Me)}},[]);const Ee=ye=>{if(z.activePage!==W&&W.select(),Qe.current)return;const Me=ye.evt.ctrlKey||ye.evt.metaKey||ye.evt.shiftKey,Pe=ye.target.findAncestor(".elements-container"),we=ye.target.findAncestor(".page-abs-container"),et=ye.target.findAncestor("Transformer");if(!(Me||Pe||et||we))return void z.selectElements([]);const Se=ye.target.findAncestor(".element",!0),We=z.getElementById(Se==null?void 0:Se.id()),lr=We==null?void 0:We.top,xe=lr==null?void 0:lr.id,ze=z.selectedElementsIds.indexOf(xe)>=0;xe&&Me&&!ze?z.selectElements(z.selectedElementsIds.concat([xe])):xe&&Me&&ze?z.selectElements(z.selectedElementsIds.filter(rt=>rt!==xe)):!xe||Me||ze||z.selectElements([xe])};(0,h.useSnap)(ne,z);const Re=z.activePage===W,Ve=G==null?void 0:G.PageControls,oe=G==null?void 0:G.Tooltip,fe=1/z.scale,Ze=0/z.scale;return n.default.createElement("div",{ref:Te,onDragOver:ye=>ye.preventDefault(),onDrop:ye=>{if(ye.preventDefault(),!le.current)return;le.current.setPointersPositions(ye);const Me=le.current.findOne(".elements-container").getRelativePointerPosition(),Pe=le.current.getPointerPosition(),we=le.current.getAllIntersections(Pe).map(We=>We.findAncestor(".element",!0)).filter(Boolean),et=[...new Set(we.reverse())].map(We=>z.getElementById(We.id())),Se=et[0];Z&&(Z(Me,Se,{elements:et,page:W}),Z=null)},style:{position:"relative",width:R+"px"},className:"polotno-page-container"+(Re?" active-page":"")},n.default.createElement(o.Stage,{ref:le,width:Math.min(R,4*window.innerWidth),height:Math.min(M,4*window.innerHeight),onClick:Ee,onTap:Ee,onMouseDown:Le,onMouseMove:ye=>{if(!ye.evt.altKey&&se)return void de(null);if(!ye.evt.altKey)return;const Me=ye.target.findAncestor(".element",!0),Pe=Me==null?void 0:Me.id();if(!z.selectedElements[0]||z.selectedElementsIds.includes(Pe))return;const we=(0,S.getTotalClientRect)(z.selectedShapes),et=Pe?z.getElementById(Pe):{x:0,y:0,width:W.computedWidth,height:W.computedHeight,rotation:0},Se=(0,S.getClientRect)(et),We=[];we.minX>Se.maxX&&We.push({distance:we.minX-Se.maxX,box1:we,box2:Se,points:[{x:we.minX,y:we.minY+we.height/2},{x:Se.maxX,y:we.minY+we.height/2},{x:Se.maxX,y:Se.minY+Se.height/2}]}),we.maxX<Se.minX&&We.push({distance:Se.minX-we.maxX,box1:we,box2:Se,points:[{x:we.maxX,y:we.minY+we.height/2},{x:Se.minX,y:we.minY+we.height/2},{x:Se.minX,y:Se.minY+Se.height/2}]}),we.minY>Se.maxY&&We.push({box1:we,box2:Se,distance:we.minY-Se.maxY,points:[{x:we.minX+we.width/2,y:we.minY},{x:we.minX+we.width/2,y:Se.maxY},{x:Se.minX+Se.width/2,y:Se.maxY}]}),we.maxY<Se.minY&&We.push({box1:we,box2:Se,distance:Se.minY-we.maxY,points:[{x:we.minX+we.width/2,y:we.maxY},{x:we.minX+we.width/2,y:Se.minY},{x:Se.minX+Se.width/2,y:Se.minY}]}),we.minX>=Se.minX&&we.maxX<=Se.maxX&&we.minY>=Se.minY&&we.maxY<=Se.maxY&&(We.push({distance:we.minX-Se.minX,box1:we,box2:Se,points:[{x:we.minX,y:we.minY+we.height/2},{x:Se.minX,y:we.minY+we.height/2},{x:Se.minX,y:Se.minY+Se.height/2}]}),We.push({distance:Se.maxX-we.maxX,box1:we,box2:Se,points:[{x:we.maxX,y:we.minY+we.height/2},{x:Se.maxX,y:we.minY+we.height/2},{x:Se.maxX,y:Se.minY+Se.height/2}]}),We.push({box1:we,box2:Se,distance:we.minY-Se.minY,points:[{x:we.minX+we.width/2,y:we.minY},{x:we.minX+we.width/2,y:Se.minY},{x:Se.minX+Se.width/2,y:Se.minY}]}),We.push({box1:we,box2:Se,distance:Se.maxY-we.maxY,points:[{x:we.minX+we.width/2,y:we.maxY},{x:we.minX+we.width/2,y:Se.maxY},{x:Se.minX+Se.width/2,y:Se.maxY}]})),JSON.stringify(se)!==JSON.stringify(We)&&de(We)},onDragStart:ye=>{var Me;const Pe=ye.target.findAncestor(".element",!0);if(Pe){const we=z.getElementById(Pe==null?void 0:Pe.id()),et=we==null?void 0:we.top,Se=et==null?void 0:et.id;!(z.selectedElementsIds.indexOf(Se)>=0)&&Se&&(z.selectElements([Se]),ye.target.stopDrag(),ye.target.startDrag(ye),(Me=ne.current)===null||Me===void 0||Me.startDrag(ye))}se&&de(null)},pageId:W.id,style:{position:"relative"}},n.default.createElement(o.Layer,null,n.default.createElement(O,{width:R,height:M,fill:D}),n.default.createElement(o.Group,{x:ee,y:ie,scaleX:z.scale,scaleY:z.scale,name:"page-container"},n.default.createElement(o.Group,{name:"page-container-2"},n.default.createElement(o.Group,{name:"page-background-group",x:X,y:X},n.default.createElement(L,{x:-W.bleed,y:-W.bleed,width:W.computedWidth+2*W.bleed,height:W.computedHeight+2*W.bleed,background:W.background,name:"page-background",preventDefault:!1,scale:z.scale})),n.default.createElement(o.Group,{x:X,y:X,name:"elements-container",listening:!z.isPlaying},n.default.createElement(o.Rect,{name:"elements-area",width:W.computedWidth,height:W.computedHeight,listening:!1}),n.default.createElement($,{elements:W.children,store:z})),n.default.createElement(o.Rect,{stroke:B,name:"bleed",strokeWidth:W.bleed,x:W.bleed/2,y:W.bleed/2,width:W.computedWidth+W.bleed,height:W.computedHeight+W.bleed,listening:!1,visible:W.bleed>0&&z.bleedVisible,hideInExport:!0}))),n.default.createElement(o.Line,{name:"workspace-background",points:[0,0,R,0,R,M,0,M,0,0,ee,ie,ee,M-ie,R-ee,M-ie,R-ee,ie,ee,ie],listening:!1,closed:!0,fill:D}),n.default.createElement(o.Group,{x:ee,y:ie,scaleX:z.scale,scaleY:z.scale},n.default.createElement(o.Rect,{name:"page-highlight",hideInExport:!0,x:-fe/2-Ze,y:-fe/2-Ze,width:Q+fe+2*Ze,height:te+fe+2*Ze,stroke:Re&&z.pages.length>1?K:H,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),n.default.createElement(o.Group,{x:ee+X*z.scale,y:ie+X*z.scale,scaleX:z.scale,scaleY:z.scale,name:"page-abs-container"},n.default.createElement(o.Transformer,{ref:ne,onDragStart:ye=>{var Me;!((Me=ye.evt)===null||Me===void 0)&&Me.altKey&&Y&&z.selectedElements.forEach(Pe=>{const we=Pe.clone({},{skipSelect:!0}),et=W.children.indexOf(Pe);W.setElementZIndex(we.id,et)}),z.history.startTransaction()},onDragEnd:()=>{z.history.endTransaction()},onTransformStart:()=>{z.history.startTransaction()},boundBoxFunc:(ye,Me)=>{const Pe=Math.abs(Me.width)<1||Math.abs(Me.height)<1,we=Math.abs(ye.width)<1||Math.abs(ye.height)<1;return Pe&&!we?ye:Me},onTransform:ye=>{var Me,Pe;const we=ne.current.nodes(),et=we[we.length-1];if(ye.target!==et)return;const Se=(Me=ne.current)===null||Me===void 0?void 0:Me.__getNodeRect(),We=(Pe=ne.current)===null||Pe===void 0?void 0:Pe.getActiveAnchor();ve({anchor:We,x:Se.x,y:Se.y,rotation:Se.rotation,width:Se.width,height:Se.height})},onTransformEnd:ye=>{ve({}),z.history.endTransaction()},visible:!z.isPlaying}),se&&se.map(({points:ye,distance:Me,box1:Pe,box2:we},et)=>n.default.createElement(o.Group,{name:"distances-container",hideInExport:!0,key:et,listening:!1},n.default.createElement(o.Rect,Object.assign({},Pe,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(o.Rect,Object.assign({},we,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(o.Line,{points:[ye[0].x,ye[0].y,ye[1].x,ye[1].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Line,{points:[ye[1].x,ye[1].y,ye[2].x,ye[2].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(o.Label,{x:(ye[0].x+ye[1].x)/2,y:(ye[0].y+ye[1].y)/2,offsetY:-10,scaleX:1/z.scale,scaleY:1/z.scale},n.default.createElement(o.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"down"}),n.default.createElement(o.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:5,text:(0,b.pxToUnitString)({unit:z.unit,dpi:z.dpi,px:Me})})))),W._rendering&&n.default.createElement(o.Group,null,n.default.createElement(o.Rect,{width:Q,height:te,fill:"rgba(255,255,255,0.9)"}),n.default.createElement(o.Text,{text:"Rendering...",fontSize:60,width:Q,height:te,align:"center",verticalAlign:"middle"})),oe&&n.default.createElement(oe,{components:G,store:z,page:W,stageRef:le})),n.default.createElement(U,Object.assign({},_e,{store:z})),n.default.createElement(I,{selection:$e}),p.shouldShowCredit.value&&n.default.createElement(o.Text,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:R-170,y:M-18,onMouseEnter:ye=>{ye.target.getStage().container().style.cursor="pointer"},onMouseLeave:ye=>{ye.target.getStage().container().style.cursor=""},onTouchStart:ye=>{ye.cancelBubble=!0},onMouseDown:ye=>{ye.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),n.default.createElement(o.Group,{name:"line-guides"}))),Ie&&Re&&Ve&&n.default.createElement(Ve,{store:z,page:W,xPadding:ee,yPadding:ie}))})})(t9);var pS={};(function(e){var t=me&&me.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.LeftRules=e.TopRules=void 0;const r=t(Je),n=eu,i=Qp,a=_i,o=_2,l=(0,o.styled)("div",r.default.forwardRef)`
252
+ position: absolute;
253
+ top: 0;
254
+ left: 0;
255
+ pointer-events: none;
256
+ `,u=(0,o.styled)("div",r.default.forwardRef)`
257
+ height: 14px;
258
+ position: sticky;
259
+ font-size: 8px;
260
+ line-height: 14px;
261
+ top: 0;
262
+ left: 0;
263
+ color: grey;
264
+ border-bottom: 1px solid grey;
265
+ background-color: #e8e8e8;
266
+ overflow: hidden;
267
+ `,f=(0,o.styled)("div",r.default.forwardRef)`
268
+ left: 0;
269
+ width: 14px;
270
+ position: sticky;
271
+ font-size: 8px;
272
+ line-height: 14px;
273
+ color: grey;
274
+ border-right: 1px solid grey;
275
+ background-color: #e8e8e8;
276
+ overflow: hidden;
277
+ `,h=(0,o.styled)("div",r.default.forwardRef)`
278
+ position: absolute;
279
+ border-left: 1px solid grey;
280
+ padding-left: 2px;
281
+ `,E=(0,o.styled)("div",r.default.forwardRef)`
282
+ position: absolute;
283
+ left: 14px;
284
+ border-left: 1px solid grey;
285
+ padding-left: 2px;
286
+ transform: rotate(90deg);
287
+ transform-origin: left top;
288
+ overflow: hidden;
289
+ `,w=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4];function p(){return r.default.createElement("div",null,r.default.createElement("h1",null,"Top rules"))}e.TopRules=(0,a.observer)(({store:S,width:b,height:y})=>{const v=r.default.useRef(null);if(!S.activePage)return null;const m=S.activePage,d=(S.bleedVisible&&m.bleed,m.computedWidth*S.scale),g=m.computedHeight*S.scale,_=(b-d)/2,k=(C=L=>(0,i.unitToPx)({unitVal:L,dpi:S.dpi,unit:S.unit})*S.scale,w.find(L=>C(L)>30)||1e4);var C;const P=(0,i.unitToPx)({unitVal:k,dpi:S.dpi,unit:S.unit})*S.scale,O=Math.round(d/P)+1,x=Math.round(g/P)+1,A=(0,n.getTotalClientRect)(S.selectedShapes);return r.default.createElement(l,{ref:v,className:"polotno-rulers"},r.default.createElement(u,{style:{width:b+"px"},className:"polotno-x-ruler"},[...Array(O)].map((L,I)=>r.default.createElement(h,{key:I,style:{left:_+I*P+"px",width:P+"px"}},S.unit==="px"||k>=1?Math.round(k*I):(k*I).toFixed(1))),!!S.selectedShapes.length&&r.default.createElement("div",{style:{position:"absolute",left:_+A.x*S.scale+"px",height:"14px",width:A.width*S.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),S.pages.map((L,I)=>{var U;const $=L.computedHeight*S.scale,Z=(y-$)/2;return r.default.createElement(f,{key:L.id,style:{height:y+"px"},className:"polotno-y-ruler"},[...Array(x)].map((q,z)=>r.default.createElement(E,{key:z,style:{top:Z+z*P-14+"px",width:P+"px"}},S.unit==="px"||k>=1?Math.round(k*z):(k*z).toFixed(1))),((U=S.selectedShapes[0])===null||U===void 0?void 0:U.page)===L&&r.default.createElement("div",{style:{position:"absolute",top:Z+A.y*S.scale-14+"px",width:"14px",height:A.height*S.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))}),e.LeftRules=p})(pS);var gS={},Vg={};let uj="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",vS=e=>crypto.getRandomValues(new Uint8Array(e)),mS=(e,t,r)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,i=-~(1.6*n*t/e.length);return(a=t)=>{let o="";for(;;){let l=r(i),u=i;for(;u--;)if(o+=e[l[u]&n]||"",o.length===a)return o}}},cj=(e,t=21)=>mS(e,t,vS),fj=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,r)=>(r&=63,r<36?t+=r.toString(36):r<62?t+=(r-26).toString(36).toUpperCase():r>62?t+="-":t+="_",t),"");const dj=Object.freeze(Object.defineProperty({__proto__:null,customAlphabet:cj,customRandom:mS,nanoid:fj,random:vS,urlAlphabet:uj},Symbol.toStringTag,{value:"Module"})),Jp=po(dj);var qg={},Wg={},yS={},E2={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.deepEqual=void 0;const t=function(r,n){if(r===n)return!0;if(typeof r=="object"&&r!=null&&typeof n=="object"&&n!=null){if(Object.keys(r).length!=Object.keys(n).length)return!1;for(var i in r)if(!n.hasOwnProperty(i)||!(0,e.deepEqual)(r[i],n[i]))return!1;return!0}return!1};e.deepEqual=t})(E2);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UndoManager=void 0;const t=Ei,r=E2;Object.assign(t.types),e.UndoManager=t.types.model("UndoManager",{history:t.types.array(t.types.frozen()),undoIdx:-1,targetPath:""}).views(n=>({get canUndo(){return n.undoIdx>0},get canRedo(){return n.undoIdx<n.history.length-1}})).actions(n=>{let i,a,o=!1,l=null,u=0,f=0;const h=()=>f>0;function E(){const p=(0,t.getSnapshot)(i);return{pages:p.pages,width:p.width,height:p.height,custom:p.custom}}function w(p){const S=i.pages.map(y=>y.id),b=p.pages.map(y=>y.id);(0,r.deepEqual)(S,b)?i.pages.forEach((y,v)=>{(0,t.applySnapshot)(y,p.pages[v])}):(0,t.applySnapshot)(i.pages,p.pages),i.setSize(p.width,p.height)}return{startTransaction(){f++},endTransaction(p){f--,p||this.requestAddState(E())},async ignore(p,S=!1,b=!1){b&&await new Promise(g=>setTimeout(g,10)),u&&n.addUndoState();let y=h();n.startTransaction();let v=f;try{await p()}catch(g){setTimeout(()=>{throw g})}const m=v!==f,d=!m;n.endTransaction(d),S||y||n.replaceState(),m||(clearTimeout(u),u=0)},async transaction(p){await n.ignore(p,!0),this.addUndoState()},requestAddState(p){l=p,u||h()||(o?o=!1:u=setTimeout(()=>{u=0,clearTimeout(u),h()||this.addUndoState()},100))},addUndoState(){if(o)return void(o=!1);const p=n.history[n.undoIdx];!(0,r.deepEqual)(l,p)&&(clearTimeout(u),u=0,n.history.splice(n.undoIdx+1),n.history.push(l),n.undoIdx=n.history.length-1)},afterCreate(){if(i=(0,t.resolvePath)(n,".."),!i)throw new Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment");a=(0,t.onSnapshot)(i,()=>{this.requestAddState(E())}),n.history.length===0&&this.requestAddState(E())},clear(){clearTimeout(u),u=0,n.history.splice(0,n.history.length),n.undoIdx=-1,n.addUndoState(E())},beforeDestroy(){a()},undo(){u&&this.addUndoState(),n.canUndo?(n.undoIdx--,o=!0,w(n.history[n.undoIdx])):console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.")},redo(){u&&this.addUndoState(),n.canRedo?(n.undoIdx++,o=!0,w(n.history[n.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){n.history[n.undoIdx]=E()}}}),e.default=e.UndoManager})(yS);var bS={};(function(e){async function t(r,n){const i=await(await fetch(r)).blob(),a=document.createElement("a"),o=URL.createObjectURL(i);a.href=o,a.download=n,document.body.appendChild(a),a.click(),setTimeout(function(){document.body.removeChild(a),window.URL.revokeObjectURL(o)},0)}Object.defineProperty(e,"__esModule",{value:!0}),e.downloadFile=void 0,e.downloadFile=t})(bS);var _S={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsPDF=void 0;const t="https://unpkg.com/jspdf@2.2.0/dist/jspdf.umd.min.js";let r;function n(){return r?Promise.resolve(r):new Promise(i=>{var a=document.createElement("script");a.onload=function(){r=window.jspdf.jsPDF,i(r)},a.src=t,document.head.appendChild(a)})}e.getJsPDF=n})(_S);var wS={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createGIF=e.getGIF=void 0;const t="https://cdnjs.cloudflare.com/ajax/libs/gif.js/0.2.0/gif.js";function r(){return window.GIF?Promise.resolve(window.GIF):new Promise(i=>{var a=document.createElement("script");a.onload=function(){i(window.GIF)},a.src=t,document.head.appendChild(a)})}async function n({width:i,height:a}){return new(await r())({workers:4,width:i,height:a,workerScript:URL.createObjectURL(new Blob([`// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js
290
+ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){var NeuQuant=require("./TypedNeuQuant.js");var LZWEncoder=require("./LZWEncoder.js");function ByteArray(){this.page=-1;this.pages=[];this.newPage()}ByteArray.pageSize=4096;ByteArray.charMap={};for(var i=0;i<256;i++)ByteArray.charMap[i]=String.fromCharCode(i);ByteArray.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(ByteArray.pageSize);this.cursor=0};ByteArray.prototype.getData=function(){var rv="";for(var p=0;p<this.pages.length;p++){for(var i=0;i<ByteArray.pageSize;i++){rv+=ByteArray.charMap[this.pages[p][i]]}}return rv};ByteArray.prototype.writeByte=function(val){if(this.cursor>=ByteArray.pageSize)this.newPage();this.pages[this.page][this.cursor++]=val};ByteArray.prototype.writeUTFBytes=function(string){for(var l=string.length,i=0;i<l;i++)this.writeByte(string.charCodeAt(i))};ByteArray.prototype.writeBytes=function(array,offset,length){for(var l=length||array.length,i=offset||0;i<l;i++)this.writeByte(array[i])};function GIFEncoder(width,height){this.width=~~width;this.height=~~height;this.transparent=null;this.transIndex=0;this.repeat=-1;this.delay=0;this.image=null;this.pixels=null;this.indexedPixels=null;this.colorDepth=null;this.colorTab=null;this.neuQuant=null;this.usedEntry=new Array;this.palSize=7;this.dispose=-1;this.firstFrame=true;this.sample=10;this.dither=false;this.globalPalette=false;this.out=new ByteArray}GIFEncoder.prototype.setDelay=function(milliseconds){this.delay=Math.round(milliseconds/10)};GIFEncoder.prototype.setFrameRate=function(fps){this.delay=Math.round(100/fps)};GIFEncoder.prototype.setDispose=function(disposalCode){if(disposalCode>=0)this.dispose=disposalCode};GIFEncoder.prototype.setRepeat=function(repeat){this.repeat=repeat};GIFEncoder.prototype.setTransparent=function(color){this.transparent=color};GIFEncoder.prototype.addFrame=function(imageData){this.image=imageData;this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null;this.getImagePixels();this.analyzePixels();if(this.globalPalette===true)this.globalPalette=this.colorTab;if(this.firstFrame){this.writeLSD();this.writePalette();if(this.repeat>=0){this.writeNetscapeExt()}}this.writeGraphicCtrlExt();this.writeImageDesc();if(!this.firstFrame&&!this.globalPalette)this.writePalette();this.writePixels();this.firstFrame=false};GIFEncoder.prototype.finish=function(){this.out.writeByte(59)};GIFEncoder.prototype.setQuality=function(quality){if(quality<1)quality=1;this.sample=quality};GIFEncoder.prototype.setDither=function(dither){if(dither===true)dither="FloydSteinberg";this.dither=dither};GIFEncoder.prototype.setGlobalPalette=function(palette){this.globalPalette=palette};GIFEncoder.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};GIFEncoder.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")};GIFEncoder.prototype.analyzePixels=function(){if(!this.colorTab){this.neuQuant=new NeuQuant(this.pixels,this.sample);this.neuQuant.buildColormap();this.colorTab=this.neuQuant.getColormap()}if(this.dither){this.ditherPixels(this.dither.replace("-serpentine",""),this.dither.match(/-serpentine/)!==null)}else{this.indexPixels()}this.pixels=null;this.colorDepth=8;this.palSize=7;if(this.transparent!==null){this.transIndex=this.findClosest(this.transparent,true)}};GIFEncoder.prototype.indexPixels=function(imgq){var nPix=this.pixels.length/3;this.indexedPixels=new Uint8Array(nPix);var k=0;for(var j=0;j<nPix;j++){var index=this.findClosestRGB(this.pixels[k++]&255,this.pixels[k++]&255,this.pixels[k++]&255);this.usedEntry[index]=true;this.indexedPixels[j]=index}};GIFEncoder.prototype.ditherPixels=function(kernel,serpentine){var kernels={FalseFloydSteinberg:[[3/8,1,0],[3/8,0,1],[2/8,1,1]],FloydSteinberg:[[7/16,1,0],[3/16,-1,1],[5/16,0,1],[1/16,1,1]],Stucki:[[8/42,1,0],[4/42,2,0],[2/42,-2,1],[4/42,-1,1],[8/42,0,1],[4/42,1,1],[2/42,2,1],[1/42,-2,2],[2/42,-1,2],[4/42,0,2],[2/42,1,2],[1/42,2,2]],Atkinson:[[1/8,1,0],[1/8,2,0],[1/8,-1,1],[1/8,0,1],[1/8,1,1],[1/8,0,2]]};if(!kernel||!kernels[kernel]){throw"Unknown dithering kernel: "+kernel}var ds=kernels[kernel];var index=0,height=this.height,width=this.width,data=this.pixels;var direction=serpentine?-1:1;this.indexedPixels=new Uint8Array(this.pixels.length/3);for(var y=0;y<height;y++){if(serpentine)direction=direction*-1;for(var x=direction==1?0:width-1,xend=direction==1?width:0;x!==xend;x+=direction){index=y*width+x;var idx=index*3;var r1=data[idx];var g1=data[idx+1];var b1=data[idx+2];idx=this.findClosestRGB(r1,g1,b1);this.usedEntry[idx]=true;this.indexedPixels[index]=idx;idx*=3;var r2=this.colorTab[idx];var g2=this.colorTab[idx+1];var b2=this.colorTab[idx+2];var er=r1-r2;var eg=g1-g2;var eb=b1-b2;for(var i=direction==1?0:ds.length-1,end=direction==1?ds.length:0;i!==end;i+=direction){var x1=ds[i][1];var y1=ds[i][2];if(x1+x>=0&&x1+x<width&&y1+y>=0&&y1+y<height){var d=ds[i][0];idx=index+x1+y1*width;idx*=3;data[idx]=Math.max(0,Math.min(255,data[idx]+er*d));data[idx+1]=Math.max(0,Math.min(255,data[idx+1]+eg*d));data[idx+2]=Math.max(0,Math.min(255,data[idx+2]+eb*d))}}}}};GIFEncoder.prototype.findClosest=function(c,used){return this.findClosestRGB((c&16711680)>>16,(c&65280)>>8,c&255,used)};GIFEncoder.prototype.findClosestRGB=function(r,g,b,used){if(this.colorTab===null)return-1;if(this.neuQuant&&!used){return this.neuQuant.lookupRGB(r,g,b)}var c=b|g<<8|r<<16;var minpos=0;var dmin=256*256*256;var len=this.colorTab.length;for(var i=0,index=0;i<len;index++){var dr=r-(this.colorTab[i++]&255);var dg=g-(this.colorTab[i++]&255);var db=b-(this.colorTab[i++]&255);var d=dr*dr+dg*dg+db*db;if((!used||this.usedEntry[index])&&d<dmin){dmin=d;minpos=index}}return minpos};GIFEncoder.prototype.getImagePixels=function(){var w=this.width;var h=this.height;this.pixels=new Uint8Array(w*h*3);var data=this.image;var srcPos=0;var count=0;for(var i=0;i<h;i++){for(var j=0;j<w;j++){this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];srcPos++}}};GIFEncoder.prototype.writeGraphicCtrlExt=function(){this.out.writeByte(33);this.out.writeByte(249);this.out.writeByte(4);var transp,disp;if(this.transparent===null){transp=0;disp=0}else{transp=1;disp=2}if(this.dispose>=0){disp=dispose&7}disp<<=2;this.out.writeByte(0|disp|0|transp);this.writeShort(this.delay);this.out.writeByte(this.transIndex);this.out.writeByte(0)};GIFEncoder.prototype.writeImageDesc=function(){this.out.writeByte(44);this.writeShort(0);this.writeShort(0);this.writeShort(this.width);this.writeShort(this.height);if(this.firstFrame||this.globalPalette){this.out.writeByte(0)}else{this.out.writeByte(128|0|0|0|this.palSize)}};GIFEncoder.prototype.writeLSD=function(){this.writeShort(this.width);this.writeShort(this.height);this.out.writeByte(128|112|0|this.palSize);this.out.writeByte(0);this.out.writeByte(0)};GIFEncoder.prototype.writeNetscapeExt=function(){this.out.writeByte(33);this.out.writeByte(255);this.out.writeByte(11);this.out.writeUTFBytes("NETSCAPE2.0");this.out.writeByte(3);this.out.writeByte(1);this.writeShort(this.repeat);this.out.writeByte(0)};GIFEncoder.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var n=3*256-this.colorTab.length;for(var i=0;i<n;i++)this.out.writeByte(0)};GIFEncoder.prototype.writeShort=function(pValue){this.out.writeByte(pValue&255);this.out.writeByte(pValue>>8&255)};GIFEncoder.prototype.writePixels=function(){var enc=new LZWEncoder(this.width,this.height,this.indexedPixels,this.colorDepth);enc.encode(this.out)};GIFEncoder.prototype.stream=function(){return this.out};module.exports=GIFEncoder},{"./LZWEncoder.js":2,"./TypedNeuQuant.js":3}],2:[function(require,module,exports){var EOF=-1;var BITS=12;var HSIZE=5003;var masks=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function LZWEncoder(width,height,pixels,colorDepth){var initCodeSize=Math.max(2,colorDepth);var accum=new Uint8Array(256);var htab=new Int32Array(HSIZE);var codetab=new Int32Array(HSIZE);var cur_accum,cur_bits=0;var a_count;var free_ent=0;var maxcode;var clear_flg=false;var g_init_bits,ClearCode,EOFCode;function char_out(c,outs){accum[a_count++]=c;if(a_count>=254)flush_char(outs)}function cl_block(outs){cl_hash(HSIZE);free_ent=ClearCode+2;clear_flg=true;output(ClearCode,outs)}function cl_hash(hsize){for(var i=0;i<hsize;++i)htab[i]=-1}function compress(init_bits,outs){var fcode,c,i,ent,disp,hsize_reg,hshift;g_init_bits=init_bits;clear_flg=false;n_bits=g_init_bits;maxcode=MAXCODE(n_bits);ClearCode=1<<init_bits-1;EOFCode=ClearCode+1;free_ent=ClearCode+2;a_count=0;ent=nextPixel();hshift=0;for(fcode=HSIZE;fcode<65536;fcode*=2)++hshift;hshift=8-hshift;hsize_reg=HSIZE;cl_hash(hsize_reg);output(ClearCode,outs);outer_loop:while((c=nextPixel())!=EOF){fcode=(c<<BITS)+ent;i=c<<hshift^ent;if(htab[i]===fcode){ent=codetab[i];continue}else if(htab[i]>=0){disp=hsize_reg-i;if(i===0)disp=1;do{if((i-=disp)<0)i+=hsize_reg;if(htab[i]===fcode){ent=codetab[i];continue outer_loop}}while(htab[i]>=0)}output(ent,outs);ent=c;if(free_ent<1<<BITS){codetab[i]=free_ent++;htab[i]=fcode}else{cl_block(outs)}}output(ent,outs);output(EOFCode,outs)}function encode(outs){outs.writeByte(initCodeSize);remaining=width*height;curPixel=0;compress(initCodeSize+1,outs);outs.writeByte(0)}function flush_char(outs){if(a_count>0){outs.writeByte(a_count);outs.writeBytes(accum,0,a_count);a_count=0}}function MAXCODE(n_bits){return(1<<n_bits)-1}function nextPixel(){if(remaining===0)return EOF;--remaining;var pix=pixels[curPixel++];return pix&255}function output(code,outs){cur_accum&=masks[cur_bits];if(cur_bits>0)cur_accum|=code<<cur_bits;else cur_accum=code;cur_bits+=n_bits;while(cur_bits>=8){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}if(free_ent>maxcode||clear_flg){if(clear_flg){maxcode=MAXCODE(n_bits=g_init_bits);clear_flg=false}else{++n_bits;if(n_bits==BITS)maxcode=1<<BITS;else maxcode=MAXCODE(n_bits)}}if(code==EOFCode){while(cur_bits>0){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}flush_char(outs)}}this.encode=encode}module.exports=LZWEncoder},{}],3:[function(require,module,exports){var ncycles=100;var netsize=256;var maxnetpos=netsize-1;var netbiasshift=4;var intbiasshift=16;var intbias=1<<intbiasshift;var gammashift=10;var gamma=1<<gammashift;var betashift=10;var beta=intbias>>betashift;var betagamma=intbias<<gammashift-betashift;var initrad=netsize>>3;var radiusbiasshift=6;var radiusbias=1<<radiusbiasshift;var initradius=initrad*radiusbias;var radiusdec=30;var alphabiasshift=10;var initalpha=1<<alphabiasshift;var alphadec;var radbiasshift=8;var radbias=1<<radbiasshift;var alpharadbshift=alphabiasshift+radbiasshift;var alpharadbias=1<<alpharadbshift;var prime1=499;var prime2=491;var prime3=487;var prime4=503;var minpicturebytes=3*prime4;function NeuQuant(pixels,samplefac){var network;var netindex;var bias;var freq;var radpower;function init(){network=[];netindex=new Int32Array(256);bias=new Int32Array(netsize);freq=new Int32Array(netsize);radpower=new Int32Array(netsize>>3);var i,v;for(i=0;i<netsize;i++){v=(i<<netbiasshift+8)/netsize;network[i]=new Float64Array([v,v,v,0]);freq[i]=intbias/netsize;bias[i]=0}}function unbiasnet(){for(var i=0;i<netsize;i++){network[i][0]>>=netbiasshift;network[i][1]>>=netbiasshift;network[i][2]>>=netbiasshift;network[i][3]=i}}function altersingle(alpha,i,b,g,r){network[i][0]-=alpha*(network[i][0]-b)/initalpha;network[i][1]-=alpha*(network[i][1]-g)/initalpha;network[i][2]-=alpha*(network[i][2]-r)/initalpha}function alterneigh(radius,i,b,g,r){var lo=Math.abs(i-radius);var hi=Math.min(i+radius,netsize);var j=i+1;var k=i-1;var m=1;var p,a;while(j<hi||k>lo){a=radpower[m++];if(j<hi){p=network[j++];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}if(k>lo){p=network[k--];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}}}function contest(b,g,r){var bestd=~(1<<31);var bestbiasd=bestd;var bestpos=-1;var bestbiaspos=bestpos;var i,n,dist,biasdist,betafreq;for(i=0;i<netsize;i++){n=network[i];dist=Math.abs(n[0]-b)+Math.abs(n[1]-g)+Math.abs(n[2]-r);if(dist<bestd){bestd=dist;bestpos=i}biasdist=dist-(bias[i]>>intbiasshift-netbiasshift);if(biasdist<bestbiasd){bestbiasd=biasdist;bestbiaspos=i}betafreq=freq[i]>>betashift;freq[i]-=betafreq;bias[i]+=betafreq<<gammashift}freq[bestpos]+=beta;bias[bestpos]-=betagamma;return bestbiaspos}function inxbuild(){var i,j,p,q,smallpos,smallval,previouscol=0,startpos=0;for(i=0;i<netsize;i++){p=network[i];smallpos=i;smallval=p[1];for(j=i+1;j<netsize;j++){q=network[j];if(q[1]<smallval){smallpos=j;smallval=q[1]}}q=network[smallpos];if(i!=smallpos){j=q[0];q[0]=p[0];p[0]=j;j=q[1];q[1]=p[1];p[1]=j;j=q[2];q[2]=p[2];p[2]=j;j=q[3];q[3]=p[3];p[3]=j}if(smallval!=previouscol){netindex[previouscol]=startpos+i>>1;for(j=previouscol+1;j<smallval;j++)netindex[j]=i;previouscol=smallval;startpos=i}}netindex[previouscol]=startpos+maxnetpos>>1;for(j=previouscol+1;j<256;j++)netindex[j]=maxnetpos}function inxsearch(b,g,r){var a,p,dist;var bestd=1e3;var best=-1;var i=netindex[g];var j=i-1;while(i<netsize||j>=0){if(i<netsize){p=network[i];dist=p[1]-g;if(dist>=bestd)i=netsize;else{i++;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}if(j>=0){p=network[j];dist=g-p[1];if(dist>=bestd)j=-1;else{j--;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}}return best}function learn(){var i;var lengthcount=pixels.length;var alphadec=30+(samplefac-1)/3;var samplepixels=lengthcount/(3*samplefac);var delta=~~(samplepixels/ncycles);var alpha=initalpha;var radius=initradius;var rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(i=0;i<rad;i++)radpower[i]=alpha*((rad*rad-i*i)*radbias/(rad*rad));var step;if(lengthcount<minpicturebytes){samplefac=1;step=3}else if(lengthcount%prime1!==0){step=3*prime1}else if(lengthcount%prime2!==0){step=3*prime2}else if(lengthcount%prime3!==0){step=3*prime3}else{step=3*prime4}var b,g,r,j;var pix=0;i=0;while(i<samplepixels){b=(pixels[pix]&255)<<netbiasshift;g=(pixels[pix+1]&255)<<netbiasshift;r=(pixels[pix+2]&255)<<netbiasshift;j=contest(b,g,r);altersingle(alpha,j,b,g,r);if(rad!==0)alterneigh(rad,j,b,g,r);pix+=step;if(pix>=lengthcount)pix-=lengthcount;i++;if(delta===0)delta=1;if(i%delta===0){alpha-=alpha/alphadec;radius-=radius/radiusdec;rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(j=0;j<rad;j++)radpower[j]=alpha*((rad*rad-j*j)*radbias/(rad*rad))}}}function buildColormap(){init();learn();unbiasnet();inxbuild()}this.buildColormap=buildColormap;function getColormap(){var map=[];var index=[];for(var i=0;i<netsize;i++)index[network[i][3]]=i;var k=0;for(var l=0;l<netsize;l++){var j=index[l];map[k++]=network[j][0];map[k++]=network[j][1];map[k++]=network[j][2]}return map}this.getColormap=getColormap;this.lookupRGB=inxsearch}module.exports=NeuQuant},{}],4:[function(require,module,exports){var GIFEncoder,renderFrame;GIFEncoder=require("./GIFEncoder.js");renderFrame=function(frame){var encoder,page,stream,transfer;encoder=new GIFEncoder(frame.width,frame.height);if(frame.index===0){encoder.writeHeader()}else{encoder.firstFrame=false}encoder.setTransparent(frame.transparent);encoder.setRepeat(frame.repeat);encoder.setDelay(frame.delay);encoder.setQuality(frame.quality);encoder.setDither(frame.dither);encoder.setGlobalPalette(frame.globalPalette);encoder.addFrame(frame.data);if(frame.last){encoder.finish()}if(frame.globalPalette===true){frame.globalPalette=encoder.getGlobalPalette()}stream=encoder.stream();frame.data=stream.pages;frame.cursor=stream.cursor;frame.pageSize=stream.constructor.pageSize;if(frame.canTransfer){transfer=function(){var i,len,ref,results;ref=frame.data;results=[];for(i=0,len=ref.length;i<len;i++){page=ref[i];results.push(page.buffer)}return results}();return self.postMessage(frame,transfer)}else{return self.postMessage(frame)}};self.onmessage=function(event){return renderFrame(event.data)}},{"./GIFEncoder.js":1}]},{},[4]);
291
+ `],{type:"application/javascript"}))})}e.getGIF=r,e.createGIF=n})(wS);var SS={};(function(e){async function t(r){for(let n=0;n<30;n++){const i=await r();if(i)return i;await new Promise(a=>setTimeout(a,50))}}Object.defineProperty(e,"__esModule",{value:!0}),e.waitTillAvailable=void 0,e.waitTillAvailable=t})(SS);var ES={},xc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getCrop=e.cropImage=e.loadImage=e.getImageSize=void 0;const t=Qs;function r(o){return new Promise(l=>{const u=document.createElement("img");u.onload=async()=>{u.width===0||u.height===0?l(await(0,t.getSvgSize)(o)):l({width:u.width,height:u.height})},u.crossOrigin="anonymous",u.src=o})}function n(o){return new Promise((l,u)=>{const f=document.createElement("img");f.onload=()=>{l(f)},f.onerror=h=>{u(h)},f.crossOrigin="anonymous",f.src=o})}async function i(o,l){const u=await n(o),f=document.createElement("canvas");f.width=2*u.width,f.height=2*u.height,f.getContext("2d").drawImage(u,0,0,f.width,f.height);const h=document.createElement("canvas");h.width=l.width,h.height=l.height;const E=h.getContext("2d");let{cropX:w,cropY:p}=l;const S=f.width*l.cropWidth,b=f.height*l.cropHeight,y=l.width/l.height;let v,m;const d=S/b;return l.type==="svg"?(v=S,m=b):y>=d?(v=S,m=S/y):(v=b*y,m=b),E.drawImage(f,w*f.width,p*f.height,v,m,0,0,h.width,h.height),h.toDataURL("image/png")}function a(o,l){const{width:u,height:f}=o,h=u/f;let E,w;h>=l.width/l.height?(E=l.width,w=l.width/h):(E=l.height*h,w=l.height);const p=(l.width-E)/2,S=(l.height-w)/2;return{cropX:p/l.width,cropY:S/l.height,cropWidth:E/l.width,cropHeight:w/l.height}}e.getImageSize=r,e.loadImage=n,e.cropImage=i,e.getCrop=a})(xc);(function(e){var t=me&&me.__createBinding||(Object.create?function(O,x,A,L){L===void 0&&(L=A);var I=Object.getOwnPropertyDescriptor(x,A);I&&!("get"in I?!x.__esModule:I.writable||I.configurable)||(I={enumerable:!0,get:function(){return x[A]}}),Object.defineProperty(O,L,I)}:function(O,x,A,L){L===void 0&&(L=A),O[L]=x[A]}),r=me&&me.__setModuleDefault||(Object.create?function(O,x){Object.defineProperty(O,"default",{enumerable:!0,value:x})}:function(O,x){O.default=x}),n=me&&me.__importStar||function(O){if(O&&O.__esModule)return O;var x={};if(O!=null)for(var A in O)A!=="default"&&Object.prototype.hasOwnProperty.call(O,A)&&t(x,O,A);return r(x,O),x},i=me&&me.__rest||function(O,x){var A={};for(var L in O)Object.prototype.hasOwnProperty.call(O,L)&&x.indexOf(L)<0&&(A[L]=O[L]);if(O!=null&&typeof Object.getOwnPropertySymbols=="function"){var I=0;for(L=Object.getOwnPropertySymbols(O);I<L.length;I++)x.indexOf(L[I])<0&&Object.prototype.propertyIsEnumerable.call(O,L[I])&&(A[L[I]]=O[L[I]])}return A};Object.defineProperty(e,"__esModule",{value:!0}),e.jsonToHTML=e.jsonToDOM=e.fixRatio=void 0;const a=xc,o=n(Qs),l=xc,u=Zp,f=p2,h=(O,x,...A)=>({type:O,props:x,children:A||[]});function E(O){var x=new DOMParser().parseFromString(O,"image/svg+xml");return x.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(x)}e.fixRatio=E;const w=async({element:O,page:x,store:A})=>{let{src:L}=O;if(O.type==="svg"&&Object.keys(O.colorsReplace).length){const X=await o.urlToString(L);L=o.replaceColors(X,new Map(Object.entries(O.colorsReplace)))}let I="";O.flipX&&(I+="scaleX(-1)"),O.flipY&&(I+="scaleY(-1)"),I||(I="none");const U={};if(O.clipSrc){const X=await o.urlToBase64(O.clipSrc);U["clip-path"]=`url(${X})`}const $=await(0,l.loadImage)(L),Z=$.width*O.cropWidth,q=$.height*O.cropHeight,z=O.width/O.height;let W,R;const M=Z/q;O.type==="svg"?(W=Z,R=q):z>=M?(W=Z,R=Z/z):(W=q*z,R=q);const F=W/$.width,D=R/$.height,H=W/R>O.width/O.height?O.height/R:O.width/W,K=W*H/F,G=R*H/D,B=O.cropX*H*$.width,Y=O.cropY*H*$.height;return h("div",{style:Object.assign(Object.assign({},U),{width:"100%",height:"100%","border-radius":O.cornerRadius+"px",border:O.borderSize?`${O.borderSize}px solid ${O.borderColor}`:"none",background:`url(${L})`,transform:I,"background-size":`${Math.round(K)}px ${Math.round(G)}px`,"background-position-x":-Math.round(B)+"px","background-position-y":-Math.round(Y)+"px"})})},p=async({element:O,page:x,store:A})=>{let L={top:0,left:0};O.fill.indexOf("gradient")>=0&&(L=Object.assign(Object.assign({},L),{"background-color":O.fill,"background-image":O.fill,"background-clip":"text","text-fill-color":"transparent","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"}));const I=O.backgroundPadding*(O.fontSize*O.lineHeight),U=h("div",{style:{position:"absolute",top:-I/2+"px",left:-I/2+"px",display:O.backgroundEnabled?"block":"none",width:O.width+I+"px",height:O.height+I+"px","background-color":O.backgroundColor,"border-radius":O.backgroundCornerRadius*(O.fontSize*O.lineHeight*.5)+"px"}});O.verticalAlign==="middle"?(L.top="50%",L.transform="translateY(-50%)"):O.verticalAlign==="bottom"&&(L.bottom=0);const $=/<[a-z][\s\S]*>/i.test(O.text),Z=Object.assign(Object.assign({},L),{position:"absolute",width:O.width+"px",color:O.fill,"white-space":"pre-wrap","font-size":O.fontSize+"px","text-align":O.align,"font-family":O.fontFamily,"text-decoration":O.textDecoration||"none","line-height":O.lineHeight,"letter-spacing":O.letterSpacing+"em","font-style":O.fontStyle,"font-weight":O.fontWeight,"-webkit-text-stroke":`${O.strokeWidth}px ${O.stroke}`,"text-stroke":`${O.strokeWidth}px ${O.stroke}`}),q="el-"+O.id,z=$?{id:q}:{},W=`<style>#${q} {${f.resetStyleContent}}</style>`,R=h("div",Object.assign(Object.assign({style:Z},z),{innerHTML:$?`${W}${O.text}`:O.text.split(`
292
+ `).join("<br />")}));return h("div",{style:{position:"relative",width:"100%",height:"100%"}},U,R)},S=({element:O,type:x})=>{const A={"stroke-width":O.height,stroke:O.color,"line-cap":"round","stroke-linejoin":"round",opacity:O.opacity};return x==="arrow"||x==="triangle"?h("polyline",Object.assign({points:`${3*O.height},${2*-O.height} 0,0 ${3*O.height},${2*O.height}`},A)):x==="bar"?h("polyline",Object.assign({points:`0,${2*-O.height} 0,${2*O.height}`},A)):x==="circle"?h("circle",Object.assign({r:O.height},A)):x==="square"?h("polyline",Object.assign({points:`${-O.height},${-O.height} ${-O.height},${O.height} ${O.height},${O.height} ${O.height},${-O.height}`},A)):null},b=async({element:O,page:x,store:A})=>h("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},h("rect",{x:0,y:0,width:O.width,height:O.height,fill:O.color}),h("g",{transform:`translate(0 ${O.height/2})`},S({element:O,type:O.startHead})),h("g",{transform:`translate(${O.width} ${O.height/2}) rotate(180)`},S({element:O,type:O.endHead}))),y=async({element:O,page:x,store:A,elementHook:L})=>{const I=await Promise.all(O.children.map($=>d({element:$,page:x,store:A,elementHook:L}))),U=h("div",{style:{"transform-origin":"top left",opacity:O.opacity}},...I);return L&&L({dom:U,element:O})||U},v=async({element:O,page:x,store:A,elementHook:L})=>{const I=(0,u.figureToSvg)(O),U=h("div",{innerHTML:I});return L&&L({dom:U,element:O})||U},m={image:w,svg:w,text:p,line:b,figure:v,group:y};async function d({element:O,page:x,store:A,elementHook:L}){let I=await m[O.type];I||(I=()=>h("div",{}),console.error(`HTML export does not support ${O.type} type...`));const U=await I({element:O,page:x,store:A}),$=[];O.blurEnabled&&$.push(`blur(${O.blurRadius/2}px)`),O.brightnessEnabled&&$.push(`brightness(${100*O.brightness+100}%)`),O.sepiaEnabled&&$.push("sepia()"),O.grayscaleEnabled&&$.push("grayscale()"),O.shadowEnabled&&$.push(`drop-shadow(${O.shadowOffsetX}px ${O.shadowOffsetY}px ${O.shadowBlur}px ${O.shadowColor})`);const Z=h("div",{id:O.id,style:{position:"absolute",left:O.x+"px",top:O.y+"px",width:O.width+"px",height:O.height+"px",transform:`rotate(${O.rotation}deg)`,"transform-origin":"top left",opacity:O.opacity,display:O.visible&&O.showInExport?"block":"none",filter:$.join(" ")||"none"}},U);return L&&L({dom:Z,element:O})||Z}async function g({page:O,store:x,elementHook:A}){const L=await Promise.all(O.children.map(Z=>d({element:Z,page:O,store:x,elementHook:A}))),I=O.width==="auto"?x.width:O.width,U=O.height==="auto"?x.height:O.height;let $={};if(O.background.indexOf("url")>=0||O.background.indexOf("http")>=0||O.background.indexOf(".jpg")>=0||O.background.indexOf(".png")>=0||O.background.indexOf(".jpeg")>=0){const{width:Z,height:q}=await(0,l.loadImage)(O.background),z=await w({element:Object.assign({x:0,y:0,width:Z,height:q,src:O.background,cornerRadius:0},(0,a.getCrop)({width:Z,height:q},{width:Z,height:q})),page:O,store:x});L.unshift(z)}else $=Object.assign(Object.assign({},$),{"background-color":O.background});return h("div",{className:"page",id:O.id,style:Object.assign(Object.assign({},$),{width:I+"px",height:U+"px",border:"1px solid grey",overflow:"hidden",position:"relative"})},...L)}async function _({json:O,elementHook:x}){const A=await Promise.all(O.pages.map(U=>g({page:U,store:O,elementHook:x}))),L=[];O.pages.forEach(U=>{U.children.forEach($=>{$.type==="text"&&L.indexOf($.fontFamily)===-1&&L.push($.fontFamily)})});const I=L.map(U=>O.fonts.find($=>$.fontFamily===U)?h("style",{},""):h("link",{href:`https://fonts.googleapis.com/css?family=${U}`,rel:"stylesheet"}));return h("div",{className:"design"},...I,...A)}e.jsonToDOM=_;const k=(O,x)=>typeof x=="object"?`${O}="${Object.keys(x).map(A=>`${A}:${x[A]};`).join(" ")}"`:`${O}="${x}"`,C=({dom:O})=>{if(typeof O=="string")return O;if(!O)return"";const x=O.props,{innerHTML:A}=x,L=i(x,["innerHTML"]);return`<${O.type} ${Object.keys(L).map(I=>k(I,O.props[I])).join(" ")}>${A||O.children.map(I=>C({dom:I})).join("")}</${O.type}>`};async function P({json:O,elementHook:x}){const A=await _({json:O,elementHook:x});return C({dom:A})}e.jsonToHTML=P})(ES);var OS={};(function(e){var t=me&&me.__createBinding||(Object.create?function(O,x,A,L){L===void 0&&(L=A);var I=Object.getOwnPropertyDescriptor(x,A);I&&!("get"in I?!x.__esModule:I.writable||I.configurable)||(I={enumerable:!0,get:function(){return x[A]}}),Object.defineProperty(O,L,I)}:function(O,x,A,L){L===void 0&&(L=A),O[L]=x[A]}),r=me&&me.__setModuleDefault||(Object.create?function(O,x){Object.defineProperty(O,"default",{enumerable:!0,value:x})}:function(O,x){O.default=x}),n=me&&me.__importStar||function(O){if(O&&O.__esModule)return O;var x={};if(O!=null)for(var A in O)A!=="default"&&Object.prototype.hasOwnProperty.call(O,A)&&t(x,O,A);return r(x,O),x},i=me&&me.__rest||function(O,x){var A={};for(var L in O)Object.prototype.hasOwnProperty.call(O,L)&&x.indexOf(L)<0&&(A[L]=O[L]);if(O!=null&&typeof Object.getOwnPropertySymbols=="function"){var I=0;for(L=Object.getOwnPropertySymbols(O);I<L.length;I++)x.indexOf(L[I])<0&&Object.prototype.propertyIsEnumerable.call(O,L[I])&&(A[L[I]]=O[L[I]])}return A};Object.defineProperty(e,"__esModule",{value:!0}),e.jsonToSVG=e.jsonToDOM=e.fixRatio=void 0;const a=xc,o=n(Qs),l=xc,u=Zp,f=(O,x,...A)=>({type:O,props:x,children:A||[]});function h(O){var x=new DOMParser().parseFromString(O,"image/svg+xml");return x.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(x)}e.fixRatio=h;const E=async({element:O,page:x,store:A})=>{let{src:L}=O;if(O.type==="svg"){const Q=await o.urlToString(L);L=o.replaceColors(Q,new Map(Object.entries(O.colorsReplace)))}let I="";O.flipX&&(I+="scaleX(-1)"),O.flipY&&(I+="scaleY(-1)"),O.clipSrc&&await o.urlToBase64(O.clipSrc);const U=await(0,l.loadImage)(L),$=U.width*O.cropWidth,Z=U.height*O.cropHeight,q=O.width/O.height;let z,W;const R=$/Z;O.type==="svg"?(z=$,W=Z):q>=R?(z=$,W=$/q):(z=Z*q,W=Z);const M=z/U.width,F=W/U.height,D=z/W>O.width/O.height?O.height/W:O.width/z,H=z*D/M,K=W*D/F,G=O.cropX*U.width*D,B=O.cropY*U.height*D,Y=`clip-${O.id}`,X=L.replace(/&/g,"&amp;");return f("g",{style:{transform:I}},f("defs",{},f("clipPath",{id:Y},f("rect",{x:0,y:0,width:O.width,height:O.height}))),f("image",{"xlink:href":X,x:-G,y:-B,width:H,height:K,preserveAspectRatio:"none","clip-path":`url(#${Y})`}))},w=async({element:O,page:x,store:A})=>{const L=(q,z,W,R,M)=>{const F=document.createElement("canvas").getContext("2d");return F.font=`${M} ${R} ${z}px ${W}`,F.measureText(q).width},I=((q,z,W,R,M,F)=>{const D=[];return q.split(`
293
+ `).forEach(H=>{const K=H.split(" ");let G="";for(let B=0;B<K.length;B++){const Y=G+K[B]+" ";L(Y,W,R,M,F)>z&&B>0?(D.push(G.trim()),G=K[B]+" "):G=Y}D.push(G.trim())}),D})(O.text,O.width,O.fontSize,O.fontFamily,O.fontWeight,O.fontStyle),U=O.fontSize*O.lineHeight,$=O.align==="center"?"middle":O.align==="right"?"end":"start",Z=I.map((q,z)=>f("tspan",{x:O.align==="center"?O.width/2:O.align==="right"?O.width:0,dy:z===0?0:U,innerHTML:q}));return f("g",{},f("text",{fill:O.fill,y:O.fontSize,"font-size":O.fontSize+"px","text-anchor":$,"font-family":O.fontFamily,"font-style":O.fontStyle,"font-weight":O.fontWeight,"text-decoration":O.textDecoration,"line-height":O.lineHeight,"letter-spacing":O.letterSpacing+"em","stroke-width":O.strokeWidth,stroke:O.stroke},...Z))},p=({element:O,type:x})=>{const A={"stroke-width":O.height,stroke:O.color,"line-cap":"round","stroke-linejoin":"round",opacity:O.opacity};return x==="arrow"||x==="triangle"?f("polyline",Object.assign({points:`${3*O.height},${2*-O.height} 0,0 ${3*O.height},${2*O.height}`},A)):x==="bar"?f("polyline",Object.assign({points:`0,${2*-O.height} 0,${2*O.height}`},A)):x==="circle"?f("circle",Object.assign({r:O.height},A)):x==="square"?f("polyline",Object.assign({points:`${-O.height},${-O.height} ${-O.height},${O.height} ${O.height},${O.height} ${O.height},${-O.height}`},A)):null},S=async({element:O,page:x,store:A})=>f("g",{},f("line",{x1:0,y1:O.height/2,x2:O.width,y2:O.height/2,stroke:O.color,"stroke-width":O.height}),f("g",{transform:`translate(0 ${O.height/2})`},p({element:O,type:O.startHead})),f("g",{transform:`translate(${O.width} ${O.height/2}) rotate(180)`},p({element:O,type:O.endHead}))),b=async({element:O,page:x,store:A,elementHook:L})=>{const I=await Promise.all(O.children.map($=>d({element:$,page:x,store:A,elementHook:L}))),U=f("g",{opacity:O.opacity,transform:`translate(${O.x}, ${O.y}) rotate(${O.rotation})`,style:{"transform-origin":"top left"}},...I);return L&&L({dom:U,element:O})||U};function y(O){let x=O.replace(/<svg[^>]*>/,"");return x=x.replace(/<\/svg>/,""),x}const v=async({element:O,page:x,store:A,elementHook:L})=>{const I=y((0,u.figureToSvg)(O)),U=f("g",{innerHTML:I});return L&&L({dom:U,element:O})||U},m={image:E,svg:E,text:w,line:S,figure:v,group:b};async function d({element:O,page:x,store:A,elementHook:L}){let I=await m[O.type];I||(I=()=>f("g",{}),console.error(`SVG export does not support ${O.type} type...`));const U=await I({element:O,page:x,store:A}),$=[];O.blurEnabled&&$.push(`blur(${O.blurRadius/2}px)`),O.brightnessEnabled&&$.push(`brightness(${100*O.brightness+100}%)`),O.sepiaEnabled&&$.push("sepia()"),O.grayscaleEnabled&&$.push("grayscale()"),O.shadowEnabled&&$.push(`drop-shadow(${O.shadowOffsetX}px ${O.shadowOffsetY}px ${O.shadowBlur}px ${O.shadowColor})`);const Z=f("g",{className:"element",id:O.id,transform:`translate(${O.x}, ${O.y}) rotate(${O.rotation})`,display:O.visible?void 0:"none",style:{"transform-origin":"top left",filter:$.join(" ")}},U);return L&&L({dom:Z,element:O})||Z}async function g({page:O,store:x,elementHook:A}){const L=await Promise.all(O.children.map(U=>d({element:U,page:O,store:x,elementHook:A})));let I={};if(O.background.indexOf("url")>=0||O.background.indexOf("http")>=0||O.background.indexOf(".jpg")>=0||O.background.indexOf(".png")>=0||O.background.indexOf(".jpeg")>=0){const U=await(0,l.loadImage)(O.background),$=await(0,l.cropImage)(O.background,Object.assign({width:x.width,height:x.height,x:0,y:0},(0,a.getCrop)({width:x.width,height:x.height},{width:U.width,height:U.height})));I=Object.assign(Object.assign({},I),{"background-image":`url(${$})`})}return f("g",{className:"page",style:Object.assign(Object.assign({},I),{background:O.background})},f("rect",{x:0,y:0,width:x.width,height:x.height,fill:O.background}),...L)}async function _({json:O,elementHook:x}){const A=await Promise.all(O.pages.map(U=>g({page:U,store:O,elementHook:x}))),L=[];O.pages.forEach(U=>{U.children.forEach($=>{$.type==="text"&&L.indexOf($.fontFamily)===-1&&L.push($.fontFamily)})});const I=L.map(U=>O.fonts.find($=>$.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,"&amp;")})));return f("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:`0 0 ${O.width} ${O.height}`},...I,...A)}e.jsonToDOM=_;const k=(O,x)=>typeof x=="object"?`${O}="${Object.keys(x).map(A=>`${A}:${x[A]};`).join(" ")}"`:x==null||x===""?"":`${O}="${x}"`,C=({dom:O,nestLevel:x=0})=>{if(typeof O=="string")return O;if(!O)return"";const A=O.props,{innerHTML:L}=A,I=i(A,["innerHTML"]),U=" ".repeat(x);return`${U}<${O.type} ${Object.keys(I).map($=>k($,I[$])).join(" ")}>${L||`
294
+ `+O.children.map($=>C({dom:$,nestLevel:x+1})).join("")}${U}</${O.type}>
295
+ `};async function P({json:O,elementHook:x}){const A=await _({json:O,elementHook:x});return C({dom:A})}e.jsonToSVG=P})(OS);var Kg={},E_;function xS(){return E_||(E_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Page=void 0;const t=Ei,r=Jp,n=Pc(),i=O2(),a=Pc(),o=eu;e.Page=t.types.model("Page",{id:t.types.identifier,children:t.types.array(t.types.late(()=>n.ElementTypes)),width:t.types.optional(t.types.union(t.types.number,t.types.literal("auto")),"auto"),height:t.types.optional(t.types.union(t.types.number,t.types.literal("auto")),"auto"),background:"white",bleed:0,custom:t.types.frozen(),duration:5e3,_exporting:!1,_rendering:!1}).postProcessSnapshot(l=>{const u=Object.assign({},l),f={};for(var h in u)h[0]!=="_"&&(f[h]=l[h]);return f}).views(l=>({get store(){return(0,t.getParentOfType)(l,i.Store)}})).views(l=>({get startTime(){let u=0;for(const f of l.store.pages){if(f.id===l.id)return u;u+=f.duration}return u},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,t.getSnapshot)(l))),_forEachElementUp(u,f){const h=u.map(E=>({id:E,index:l.children.findIndex(w=>w.id===E)}));h.sort((E,w)=>w.index-E.index);for(const{index:E}of h){if(E==-1)continue;const w=E<l.children.length-1&&l.children[E+1],p=u.indexOf(w==null?void 0:w.id)>=0;E===l.children.length-1||p||f(E)}},_forEachElementDown(u,f){const h=u.map(E=>({id:E,index:l.children.findIndex(w=>w.id===E)}));h.sort((E,w)=>E.index-w.index);for(const{index:E}of h){if(E==-1)continue;const w=E>0&&l.children[E-1],p=u.indexOf(w==null?void 0:w.id)>=0;E===0||p||f(E)}return!1}})).actions(l=>({clone(u={}){const f=l.toJSON();f.children.forEach(p=>{p.id=(0,r.nanoid)(10),(0,a.forEveryChild)(p,S=>{S.id=(0,r.nanoid)(10)})});const h=Object.assign(Object.assign(Object.assign({},f),{id:(0,r.nanoid)(10)}),u),E=l.store.addPage(h),w=l.store.pages.indexOf(l);E.setZIndex(w+1),E.select()},setZIndex(u){l.store.setPageZIndex(l.id,u)},set(u){Object.assign(l,u)},select(){l.store.selectPage(l.id)},addElement(u,{skipSelect:f=!1}={}){const h=a.TYPES_MAP[u.type];if(!h)return void console.error("Can not find model with type "+u.type);u.children&&u.children.forEach(w=>{w.id=(0,r.nanoid)(10)});const E=h.create(Object.assign({id:(0,r.nanoid)(10)},u));return l.children.push(E),E.selectable&&!f&&l.store.selectElements([E.id]),E},canMoveElementsUp(u){let f=!1;return l._forEachElementUp(u,()=>{f=f||!0}),f},moveElementsUp(u){l._forEachElementUp(u,f=>{const h=l.children[f];(0,t.detach)(h),l.children.splice(f+1,0,h)})},canMoveElementsTop(u){return this.canMoveElementsUp(u)},moveElementsTop(u){const f=[],h=[];l.children.forEach(E=>{u.indexOf(E.id)>=0?f.push(E):h.push(E)}),l.children.replace(h.concat(f))},canMoveElementsDown(u){let f=!1;return l._forEachElementDown(u,()=>{f=f||!0}),f},moveElementsDown(u){l._forEachElementDown(u,f=>{const h=l.children[f];(0,t.detach)(h),l.children.splice(f-1,0,h)})},canMoveElementsBottom(u){return this.canMoveElementsDown(u)},moveElementsBottom(u){const f=[],h=[];l.children.forEach(E=>{u.indexOf(E.id)>=0?f.push(E):h.push(E)}),l.children.replace(f.concat(h))},setElementZIndex(u,f){const h=l.children.find(E=>E.id===u);h&&((0,t.detach)(h),l.children.remove(h),l.children.splice(f,0,h))},setSize({width:u,height:f,useMagic:h,softChange:E}){if(h){const w=[],p=I=>I.type==="image"&&I.x<1&&I.y<1&&I.width>=l.computedWidth-2&&I.height>=l.computedHeight-2;(0,a.forEveryChild)(l,I=>{I.type!=="group"&&(p(I)||w.push(I))});const S=w.length?(0,o.getTotalClientRect)(w):{x:0,y:0,width:l.computedWidth,height:l.computedHeight},b=0,y=Math.max(0,Math.min(S.x,l.computedWidth-S.x-S.width)),v=l.computedWidth*b,m=Math.max(0,y-v),d=Math.max(0,Math.min(S.y,l.computedHeight-S.y-S.height)),g=l.computedHeight*b,_=Math.max(0,d-g),k=l.computedWidth-2*m,C=l.computedHeight-2*_,P=u/k,O=f/C,x=Math.min(P,O),A=(u-k*x)/2-m*x,L=(f-C*x)/2-_*x;(0,a.forEveryChild)(l,I=>{I.type!=="group"&&(p(I)?I.set({x:I.x*x,y:I.y*x,width:I.width*P,height:I.height*O,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(I.set({x:A+I.x*x,y:L+I.y*x,width:I.width*x,height:I.height*x}),I.type==="text"?I.set({fontSize:I.fontSize*x}):I.type==="figure"&&I.set({strokeWidth:I.strokeWidth*x})))})}E||(l.width=u),E||(l.height=f)}})).actions(l=>({moveElementUp(u){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),l.moveElementsUp([u])},moveElementDown(u){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),l.moveElementsDown([u])},moveElementTop(u){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),l.moveElementsTop([u])},moveElementBottom(u){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),l.moveElementsBottom([u])},play(){l.store.play({startTime:l.startTime,endTime:l.startTime+l.duration})}}))}(Kg)),Kg}var O_;function O2(){return O_||(O_=1,function(e){var t=me&&me.__createBinding||(Object.create?function(P,O,x,A){A===void 0&&(A=x);var L=Object.getOwnPropertyDescriptor(O,x);L&&!("get"in L?!O.__esModule:L.writable||L.configurable)||(L={enumerable:!0,get:function(){return O[x]}}),Object.defineProperty(P,A,L)}:function(P,O,x,A){A===void 0&&(A=x),P[A]=O[x]}),r=me&&me.__setModuleDefault||(Object.create?function(P,O){Object.defineProperty(P,"default",{enumerable:!0,value:O})}:function(P,O){P.default=O}),n=me&&me.__importStar||function(P){if(P&&P.__esModule)return P;var O={};if(P!=null)for(var x in P)x!=="default"&&Object.prototype.hasOwnProperty.call(P,x)&&t(O,P,x);return r(O,P),O},i=me&&me.__rest||function(P,O){var x={};for(var A in P)Object.prototype.hasOwnProperty.call(P,A)&&O.indexOf(A)<0&&(x[A]=P[A]);if(P!=null&&typeof Object.getOwnPropertySymbols=="function"){var L=0;for(A=Object.getOwnPropertySymbols(P);L<A.length;L++)O.indexOf(A[L])<0&&Object.prototype.propertyIsEnumerable.call(P,A[L])&&(x[A[L]]=P[A[L]])}return x},a=me&&me.__importDefault||function(P){return P&&P.__esModule?P:{default:P}};Object.defineProperty(e,"__esModule",{value:!0}),e.createStore=e.Store=e.Font=void 0;const o=Ei,l=yS,u=Jp,f=a(Si),h=bS,E=_S,w=wS,p=S2(),S=n(Xs),b=$i,y=Qp,v=E2,m=SS,d=ES,g=OS,_=xS(),k=Pc();function C({key:P,showCredit:O}={key:"",showCredit:!1}){const x=e.Store.create();return(0,p.validateKey)(P,O),x}(0,o.setLivelinessChecking)("ignore"),e.Font=o.types.model("Font",{fontFamily:o.types.string,url:o.types.optional(o.types.string,""),styles:o.types.frozen()}).preProcessSnapshot(P=>Object.assign(Object.assign({},P),{fontFamily:P.fontFamily||P.name})),e.Store=o.types.model("Store",{role:"",pages:o.types.array(_.Page),fonts:o.types.array(e.Font),width:1080,height:1080,currentTime:0,isPlaying:!1,scale:1,scaleToFit:1,unit:"px",dpi:72,bleedVisible:!1,rulesVisible:!1,openedSidePanel:"",previousOpenedSidePanel:"",custom:o.types.frozen(),selectedElementsIds:o.types.array(o.types.string),animatedElementsIds:o.types.array(o.types.string),history:o.types.optional(l.UndoManager,{targetPath:"../pages"}),_elementsPixelRatio:window.devicePixelRatio||1,_activePageId:""}).views(P=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),P.bleedVisible},get selectedElements(){return P.selectedElementsIds.map(O=>{for(const x of P.pages)for(const A of x.children)if(A.id===O)return A}).filter(O=>!!O)},get children(){return P.pages},get selectedShapes(){const O=[];return(0,k.forEveryChild)({children:P.selectedElements},x=>{x.type!=="group"&&O.push(x)}),O},get activePage(){return P.pages.slice().find(O=>O.id===P._activePageId)||(P.pages.length?P.pages[0]:null)},get duration(){let O=0;return P.pages.forEach(x=>{O+=x.duration}),O},get _hasCroppedImages(){return P.find(O=>O.type==="image"&&O._cropModeEnabled)},find(O){let x;return(0,k.forEveryChild)({children:P.pages},A=>{if(!x&&O(A))return x=A,!0}),x},getElementById:O=>P.find(x=>x.id===O)})).actions(P=>{let O=0,x=null,A=!1;return{afterCreate(){P.history.canUndo},setCurrentTime(L){P.currentTime=L},play({animatedElementsIds:L=[],startTime:I=0,currentTime:U=0,endTime:$=P.duration,repeat:Z=!1}={}){U&&(console.warn("currentTime property of store.play() is deprecated. Please use startTime instead."),I=U),P.animatedElementsIds=(0,o.cast)(L),P.currentTime=I,P.isPlaying=!0,O=Date.now(),x=$,A=Z,requestAnimationFrame(P.seek)},checkActivePage(){let L=0;for(const I of P.pages){if(P.currentTime>=I.startTime&&P.currentTime<I.startTime+I.duration){P.selectPage(I.id);break}L+=I.duration}},seek(){if(!P.isPlaying)return;const L=Date.now(),I=L-O;O=L,P.currentTime+=I,P.checkActivePage();const U=x||P.duration;P.isPlaying&&P.currentTime<U?requestAnimationFrame(P.seek):P.isPlaying&&A?(P.currentTime=0,requestAnimationFrame(P.seek)):P.stop()},stop(){P.isPlaying=!1,P.currentTime=0,P.animatedElementsIds=(0,o.cast)([]),P.checkActivePage()}}}).actions(P=>({set(O){Object.assign(P,O)},setUnit({unit:O,dpi:x}){P.unit=O||P.unit,P.dpi=x||P.dpi},setRole(O){P.role=O},addPage(O){const x=_.Page.create(Object.assign({id:(0,u.nanoid)(10)},O));return P.pages.push(x),P._activePageId=x.id,x},selectPage(O){P._activePageId=O},selectElements(O){const x=O.map(A=>P.getElementById(A)).sort((A,L)=>A.page.children.indexOf(A)-A.page.children.indexOf(L)).filter(A=>!!A).map(A=>A.id);P.selectedElementsIds=(0,o.cast)(x)},toggleBleed(O){P.bleedVisible=O??!P.bleedVisible},toggleRulers(O){P.rulesVisible=O??!P.rulesVisible},openSidePanel(O){P.openedSidePanel!==O&&(P.previousOpenedSidePanel=P.openedSidePanel,P.openedSidePanel=O)},setScale(O){P.scale=O},_setScaleToFit(O){P.scaleToFit=O},setElementsPixelRatio(O){P._elementsPixelRatio=O},setSize(O,x,A){P.pages.forEach(L=>{L.setSize({width:O,height:x,useMagic:A,softChange:!0})}),P.width=O,P.height=x},setPageZIndex(O,x){const A=P.pages.find(L=>L.id===O);A&&((0,o.detach)(A),P.pages.remove(A),P.pages.splice(x,0,A))},deletePages(O){const x=P.pages.indexOf(P.activePage);O.forEach(I=>{const U=P.pages.find($=>$.id===I);(0,o.destroy)(U)});const A=Math.min(P.pages.length-1,x),L=P.pages[A];L&&(P._activePageId=L.id),P.selectedElementsIds=(0,o.cast)(P.selectedElementsIds.filter(I=>P.getElementById(I)))},groupElements(O){const x=O.map(I=>P.getElementById(I));x.forEach(I=>{I&&(0,o.detach)(I)});const A=P.activePage,L={id:(0,u.nanoid)(10),children:x,type:"group"};return A.children.push(L),P.selectedElementsIds=(0,o.cast)([L.id]),L},ungroupElements(O){const x=O.map(L=>P.getElementById(L)),A=[];x.forEach(L=>{if(L&&L.type==="group"){const I=L.page,U=I.children.indexOf(L);L.children.forEach($=>{A.push($.id)}),L.children.forEach($=>{(0,o.detach)($),I.children.push($)}),I.children.splice(U,1)}}),P.selectedElementsIds=(0,o.cast)(A)},deleteElements(O){const x=[];P.find(A=>(O.includes(A.id)&&x.push(A),!1)),x.forEach(A=>{(0,o.destroy)(A)}),P.selectedElementsIds=(0,o.cast)(P.selectedElementsIds.filter(A=>P.getElementById(A)))},on(O,x){if(O==="change"){let A=P.toJSON();return(0,o.onSnapshot)(P,L=>{const I=P.toJSON();!(0,v.deepEqual)(A,I)&&(A=I,x(I))})}},async _toCanvas({pixelRatio:O,ignoreBackground:x,pageId:A,mimeType:L,includeBleed:I,_skipTimeout:U}={}){var $;const Z=O||1;A=A||(($=P.pages[0])===null||$===void 0?void 0:$.id);const q=P.pages.find(ne=>ne.id===A);if(!q)throw new Error(`No page for export with id ${A}`);q==null||q.set({_exporting:!0});const z=await(0,m.waitTillAvailable)(()=>f.default.stages.find(ne=>ne.getAttr("pageId")===A));if(!z)throw new Error(`Export is failed. Can not find stage for page ${A}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);const W=!!z.findOne(".page-container"),R=P._elementsPixelRatio;Z>P._elementsPixelRatio&&P.setElementsPixelRatio(Z),await P.waitLoading({_skipTimeout:U});const M=z.findOne(".page-container");if(!M)throw P.setElementsPixelRatio(R),new Error(`Export is failed. Can't find page container. ${W}`);z.find("Transformer").forEach(ne=>ne.visible(!1)),M.find(".page-background").forEach(ne=>ne.shadowEnabled(!1)),M.find(".page-background").forEach(ne=>ne.strokeEnabled(!1)),M.find(".highlighter").forEach(ne=>ne.visible(!1));const F=M.findOne(".page-background-group"),D=F.clip();F.clip({x:null,y:null,width:null,height:null});const H=M.findOne(".elements-container"),K=H.clip();H.clip({x:null,y:null,width:null,height:null});const G=M.find(ne=>ne.getAttr("hideInExport"));G.forEach(ne=>{ne.setAttr("oldVisible",ne.visible()),ne.hide()});const B=M.find(ne=>!ne.visible()&&ne.getAttr("editModeEnabled"));B.forEach(ne=>{ne.setAttr("oldVisible",ne.visible()),ne.show()}),x&&M.find(".page-background").forEach(ne=>ne.hide());const Y=I?q.bleed:0;let X=Y;!P.bleedVisible&&I||(P.bleedVisible||I?P.bleedVisible&&I?X=0:P.bleedVisible&&!I&&(X=-q.bleed):X=0);const Q=document.createElement("canvas");Q.width=Math.round((q.computedWidth+2*Y)*Z),Q.height=Math.round((q.computedHeight+2*Y)*Z);const te=Q.getContext("2d");L==="image/jpeg"&&(te.fillStyle="white",te.fillRect(0,0,Q.width,Q.height));const ee=M.scale();M.scale({x:1,y:1});const ie=M.toCanvas({x:M.x()-X,y:M.y()-X,width:q.computedWidth+2*Y,height:q.computedHeight+2*Y,pixelRatio:Z});return M.scale(ee),te.drawImage(ie,0,0,Q.width,Q.height),f.default.Util.releaseCanvas(ie),x&&M.find(".page-background").forEach(ne=>ne.show()),G.forEach(ne=>{ne.visible(ne.getAttr("oldVisible"))}),B.forEach(ne=>{ne.visible(ne.getAttr("oldVisible"))}),M.find(".page-background").forEach(ne=>ne.shadowEnabled(!0)),M.find(".page-background").forEach(ne=>ne.strokeEnabled(!0)),z.find("Transformer").forEach(ne=>ne.visible(!0)),M.find(".highlighter").forEach(ne=>ne.visible(!0)),F.clip(D),H.clip(K),P.setElementsPixelRatio(R),q==null||q.set({_exporting:!1}),Q},async toDataURL(O={}){var{mimeType:x,quality:A}=O,L=i(O,["mimeType","quality"]);const I=await P._toCanvas(Object.assign({mimeType:x},L)),U=I.toDataURL(x,A);return f.default.Util.releaseCanvas(I),U},async toBlob(O={}){var{mimeType:x,quality:A}=O,L=i(O,["mimeType","quality"]);const I=await P._toCanvas(Object.assign({mimeType:x},L)),U=new Promise($=>{I.toBlob($,x,A)});return f.default.Util.releaseCanvas(I),U},async saveAsImage(O={}){var{fileName:x}=O,A=i(O,["fileName"]);const L=A.mimeType||"image/png",I=L.split("/")[1];(0,h.downloadFile)(await P.toDataURL(A),x||"polotno."+I,L)},async _toPDF(O){const x=O.dpi||P.dpi,A=O.parallel||1,L=O.unit||(P.unit==="px"?"mm":P.unit),I=O.pixelRatio||1,U=O.pageIds||P.pages.map(G=>G.id),$=P.pages.filter(G=>U.includes(G.id)),Z=await(0,E.getJsPDF)(),q=G=>(0,y.pxToUnit)({px:G,unit:L,dpi:x}),z=q(O.cropMarkSize||0),W=$[0]||{},R=O.includeBleed?W.bleed:0,M=q(W.computedWidth+2*R)+2*z,F=q(W.computedHeight+2*R)+2*z;var D=new Z({unit:L,orientation:M>F?"landscape":"portrait",format:[M,F],compress:!0,putOnlyUsedFonts:!0});D.deletePage(1);const H=((G,B)=>{for(var Y=[],X=0;X<G.length;X+=B)Y.push(G.slice(X,X+B));return Y})($,A);let K=0;for(const G of H){const B=G.map(async Y=>{const X=O.includeBleed?Y.bleed:0,Q=q(Y.computedWidth+2*X)+2*z,te=q(Y.computedHeight+2*X)+2*z;let ee=0,ie=I;for(;ee<10;){ee+=1,ee===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const ne=await P.toDataURL(Object.assign(Object.assign({},O),{pageId:Y.id,pixelRatio:ie}));if(ne.length>20)return O.onProgress&&O.onProgress(++K/U.length*.9),{url:ne,width:Q,height:te};ie*=.8}});(await Promise.all(B)).forEach(({url:Y,width:X,height:Q})=>{D.addPage([X,Q],X>Q?"landscape":"portrait"),z&&(D.setLineWidth(q(1)),D.line(2*z,0,2*z,z),D.line(0,2*z,z,2*z),D.line(X-2*z,0,X-2*z,z),D.line(X,2*z,X-z,2*z),D.line(0,Q-2*z,z,Q-2*z),D.line(2*z,Q,2*z,Q-z),D.line(X,Q-2*z,X-z,Q-2*z),D.line(X-2*z,Q,X-2*z,Q-z)),D.addImage(Y,z,z,X-2*z,Q-2*z,void 0,"FAST")})}return D},toPDFDataURL:async O=>(await P._toPDF(Object.assign({mimeType:"image/jpeg"},O))).output("datauristring"),async toGIFDataURL(O={}){const x=O.pixelRatio||1,A=await(0,w.createGIF)({width:P.width*x,height:P.height*x}),L=1e3/(O.fps||10),I=P.duration/L;for(let U=0;U<I-1;U++){const $=U*L||1;P.setCurrentTime($);let Z=0,q="";for(const W of P.pages)if(Z+=W.duration,W.set({_rendering:Z>$}),Z>$){q=W.id;break}const z=await P._toCanvas({pixelRatio:x,pageId:q,_skipTimeout:!0});A.addFrame(z.getContext("2d"),{delay:L,copy:!0})}for(const U of P.pages)U.set({_rendering:!1});return P.stop(),A.render(),new Promise(U=>{A.on("finished",function($){(function(Z,q){var z=new FileReader;z.onload=function(W){q(W.target.result)},z.readAsDataURL(Z)})($,U)})})},async saveAsGIF(O={}){var{fileName:x}=O,A=i(O,["fileName"]);const L=await P.toGIFDataURL(A);(0,h.downloadFile)(L,x||"polotno.gif")},async toHTML({elementHook:O}={elementHook:void 0}){const x=P.toJSON();return(0,d.jsonToHTML)({json:x,elementHook:O})},async saveAsHTML({fileName:O}={}){const x=await P.toHTML(),A="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(x)));(0,h.downloadFile)(A,O||"polotno.html")},async toSVG({elementHook:O}={elementHook:void 0}){const x=P.toJSON();return(0,g.jsonToSVG)({json:x,elementHook:O})},async saveAsSVG({fileName:O,elementHook:x}={}){const A=await P.toSVG({elementHook:x}),L="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(A)));(0,h.downloadFile)(L,O||"polotno.svg")},async saveAsPDF(O={}){var{fileName:x}=O,A=i(O,["fileName"]);(await P._toPDF(Object.assign({mimeType:"image/jpeg"},A))).save(x||"polotno.pdf")},async waitLoading({_skipTimeout:O=!1}={}){O||await new Promise(x=>setTimeout(x,50)),await(0,b.whenLoaded)()},toJSON:()=>({width:P.width,height:P.height,fonts:(0,o.getSnapshot)(P.fonts),pages:(0,o.getSnapshot)(P.pages),unit:P.unit,dpi:P.dpi,custom:P.custom}),loadJSON(O,x=!1){var A;const L=Object.assign({},O),I=P.pages.indexOf(P.activePage);let U=(A=L.pages[I]||L.pages[0])===null||A===void 0?void 0:A.id;L._activePageId=U;const $=Object.assign({},(0,o.getSnapshot)(P));Object.assign($,L),$.history=x?P.history.toJSON():{history:[],undoIdx:-1},(0,o.applySnapshot)(P,$)},clear({keepHistory:O=!1}={}){const x=P.pages.map(A=>A.id);P.deletePages(x),O||P.history.clear()},addFont(O){P.removeFont(O.fontFamily),P.fonts.push(O),P.loadFont(O.fontFamily)},removeFont(O){P.fonts.filter(x=>x.fontFamily===O).forEach(x=>(0,o.destroy)(x))},async loadFont(O){const x=P.fonts.find(A=>A.fontFamily===O)||S.globalFonts.find(A=>A.fontFamily===O);x?S.injectCustomFont(x):S.injectGoogleFont(O),await S.loadFont(O)},validate:O=>e.Store.validate(O,[{path:"",type:e.Store}]).map(x=>({path:"store"+x.context.map(A=>A.path).join("."),message:x.message}))})),e.createStore=C,e.default=C}(Wg)),Wg}var x_;function PS(){return x_||(x_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Node=void 0;const t=Ei,r=Jp,n=O2(),i=xS(),a=Pc();e.Node=t.types.model("Node",{id:t.types.identifier,type:"none",name:"",opacity:1,custom:t.types.frozen(),visible:!0,selectable:!0,removable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(o=>{for(var l in o)o[l]===null&&(o[l]=void 0);return o}).postProcessSnapshot(o=>{const l=Object.assign({},o),u={};for(var f in l)f[0]!=="_"&&(u[f]=o[f]);return u}).views(o=>({get locked(){return!(o.draggable||o.contentEditable||o.styleEditable||o.resizable)},get page(){return(0,t.getParentOfType)(o,i.Page)},get store(){return(0,t.getParentOfType)(o,n.Store)},get top(){let l=o;for(;;){if(!(0,t.hasParentOfType)(l,a.GroupElement))return l;l=(0,t.getParentOfType)(l,a.GroupElement)}},get parent(){return(0,t.hasParentOfType)(o,a.GroupElement)?(0,t.getParentOfType)(o,a.GroupElement):(0,t.hasParentOfType)(o,i.Page)?(0,t.getParentOfType)(o,i.Page):(0,t.hasParentOfType)(o,n.Store)?(0,t.getParentOfType)(o,n.Store):null},get zIndex(){return o.parent.children.indexOf(o)}})).actions(o=>({toJSON:()=>Object.assign({},(0,t.getSnapshot)(o))})).actions(o=>({clone(l={},{skipSelect:u=!1}={}){const f=JSON.parse(JSON.stringify(o.toJSON()));return l.id=l.id||(0,r.nanoid)(10),(0,a.forEveryChild)(f,h=>{h.id=(0,r.nanoid)(10)}),Object.assign(f,l),o.page.addElement(f,{skipSelect:u})},set(l){Object.assign(o,l)},moveUp(){o.page.moveElementsUp([o.id])},moveTop(){o.page.moveElementsTop([o.id])},moveDown(){o.page.moveElementsDown([o.id])},moveBottom(){o.page.moveElementsBottom([o.id])},setZIndex(l){o.parent.setElementZIndex(o.id,l)},beforeDestroy(){}}))}(qg)),qg}var Yg={},CS={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.registerAnimation=e.animate=e.animations=void 0;const t=eu,r={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}}};e.animations={fade:({dTime:a,element:o,animation:l})=>{const u=a/l.duration;return l.type==="enter"?{opacity:u*o.opacity}:{opacity:(1-u)*o.opacity}},rotate:({dTime:a,element:o,animation:l})=>{const u=a/l.duration*360;return(0,t.rotateAroundCenter)({x:o.x,y:o.y,width:o.width,height:o.height,rotation:o.rotation},u)},blink:({dTime:a,element:o,animation:l})=>{const u=l.duration,f=a%u/(u/2),h=f<=1?f:2-f;return{opacity:o.opacity*h}},bounce:({dTime:a,element:o,animation:l})=>{const u=l.duration,f=u/2,h={},E={x:o.x+o.width/3,y:o.y+o.height/3,width:o.width/3,height:o.height/3,fontSize:o.fontSize/3},w={x:o.x,y:o.y,width:o.width,height:o.height,fontSize:o.fontSize},p=a%u/f,S=p<=1?p:2-p;for(let b in E){const y=E[b],v=w[b]-y;h[b]=y+S*v}return h},move:({dTime:a,element:o,animation:l})=>{const u=r[l.data.direction]||r.right,f={};for(var h in u.from){let E=u.from[h],w=u.to[h];l.type==="exit"&&(E=u.to[h],w=-u.from[h]);const p=o[h]+E,S=o[h]+w-p;f[h]=p+a/l.duration*S}return f},zoom:({dTime:a,element:o,animation:l})=>{const u={},f={x:o.x+o.width/3,y:o.y+o.height/3,width:o.width/3,height:o.height/3,fontSize:o.fontSize/3},h={x:o.x,y:o.y,width:o.width,height:o.height,fontSize:o.fontSize};for(var E in f){let w=f[E],p=h[E];if(l.type==="exit"){const b=w;w=p,p=b}const S=p-w;u[E]=w+a/l.duration*S}return u}};const n=({element:a,dTime:o,animation:l})=>{const u=e.animations[l.name];return u?u({element:a,dTime:o,animation:l}):(console.error("Can not find animation type: "+l.name),{})};e.animate=n;const i=(a,o)=>{};e.registerAnimation=i})(CS);var P_;function tu(){return P_||(P_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.Animation=void 0;const t=Ei,r=CS,n=Ki,i=PS();e.Animation=t.types.model("Animation",{delay:0,duration:500,enabled:!0,type:t.types.enumeration("Type",["enter","exit","loop"]),name:"none",data:t.types.frozen({})}),e.Shape=i.Node.named("Shape").props({x:0,y:0,width:100,height:100,rotation:0,opacity:1,animations:t.types.array(e.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(a=>{const o=Object.assign(Object.assign({},a),{x:a.x||0,y:a.y||0});return"width"in a&&(o.width=o.width||1),"height"in a&&(o.height=o.height||1),a.locked&&(o.draggable=!1,o.contentEditable=!1,o.styleEditable=!1,o.resizable=!1,o.removable=!1),o}).views(a=>{const o=(0,n.observable)({x:a.x,y:a.y,width:a.width,height:a.height,rotation:a.rotation,opacity:a.opacity,color:a.color,fontSize:a.fontSize}),l=(0,n.action)(u=>{Object.assign(o,u)});return{get a(){const{currentTime:u}=a.store;if(l({x:a.x,y:a.y,width:a.width,height:a.height,rotation:a.rotation,opacity:a.opacity,color:a.color,fontSize:a.fontSize}),u===0)return o;const f=u-a.page.startTime;if(f>a.page.duration||f<0)return o;const h=a.store.animatedElementsIds;if(h.length&&!h.includes(a.id))return o;const E=a.animations.find(S=>S.type==="enter");if(E!=null&&E.enabled&&f<E.delay&&l({opacity:0}),E!=null&&E.enabled&&f>=E.delay&&f<=E.delay+E.duration){const S=f-E.delay,b=(0,r.animate)({element:a,animation:E,dTime:S});l(b)}const w=a.animations.find(S=>S.type==="exit");if(w!=null&&w.enabled&&f>=a.page.duration-w.duration-w.delay&&f<=a.page.duration-w.delay){const S=f-(a.page.duration-w.duration-w.delay),b=(0,r.animate)({element:a,animation:w,dTime:S});l(b)}w!=null&&w.enabled&&f>=a.page.duration-w.delay&&l({opacity:0});const p=a.animations.find(S=>S.type==="loop");if(p!=null&&p.enabled){const S=f,b=(0,r.animate)({element:a,animation:p,dTime:S});l(b)}return o},animated:u=>a.a[u]}}).actions(a=>({setAnimation(o,l){const u=a.animations.find(f=>f.type===o);u?Object.assign(u,l):a.animations.push(Object.assign({type:o},l))}}))}(Yg)),Yg}var Xg={},C_;function hj(){return C_||(C_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=void 0;const t=Ei,r=tu();e.TextElement=r.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:t.types.optional(t.types.union(t.types.number,t.types.string),1.2),letterSpacing:0,_editModeEnabled:!1,backgroundEnabled:!1,backgroundColor:"#7ED321",backgroundOpacity:1,backgroundCornerRadius:.5,backgroundPadding:.5}).preProcessSnapshot(n=>Object.assign({},n)).actions(n=>({toggleEditMode(i){n._editModeEnabled=i??!n._editModeEnabled,n._editModeEnabled?n.store.history.startTransaction():n.store.history.endTransaction()}}))}(Xg)),Xg}var Zg={},k_;function kS(){return k_||(k_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=void 0;const t=tu();e.ImageElement=t.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(r=>({toggleCropMode(n){r._cropModeEnabled=n??!r._cropModeEnabled,r._cropModeEnabled?r.store.history.startTransaction():r.store.history.endTransaction()},beforeDestroy(){r._cropModeEnabled&&r.store.history.endTransaction()}}))}(Zg)),Zg}var Qg={},T_;function pj(){return T_||(T_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=void 0;const t=kS();e.VideoElement=t.ImageElement.named("Video").props({type:"video",duration:0,startTime:0,endTime:1,volume:1})}(Qg)),Qg}var Jg={},A_;function gj(){return A_||(A_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0;const t=Ei,r=tu();e.LineElement=r.Shape.named("Line").props({type:"line",width:400,height:10,color:"black",dash:t.types.array(t.types.number),startHead:"",endHead:""}).actions(n=>({}))}(Jg)),Jg}var ev={},R_;function vj(){return R_||(R_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SVGElement=void 0;const t=Ei,r=tu();e.SVGElement=r.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:t.types.map(t.types.string)}).preProcessSnapshot(n=>Object.assign(Object.assign({},n),{src:n.src||n.svgSource})).actions(n=>({replaceColor(i,a){n.colorsReplace.set(i,a)}}))}(ev)),ev}var tv={},M_;function mj(){return M_||(M_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const t=Ei,r=tu();e.FigureElement=r.Shape.named("Figure").props({type:"figure",subType:"rect",fill:"rgb(0, 161, 255)",dash:t.types.array(t.types.number),strokeWidth:0,stroke:"rgba(98, 197, 255, 1)",cornerRadius:0})}(tv)),tv}var L_;function Pc(){return L_||(L_=1,function(e){var t=me&&me.__rest||function(y,v){var m={};for(var d in y)Object.prototype.hasOwnProperty.call(y,d)&&v.indexOf(d)<0&&(m[d]=y[d]);if(y!=null&&typeof Object.getOwnPropertySymbols=="function"){var g=0;for(d=Object.getOwnPropertySymbols(y);g<d.length;g++)v.indexOf(d[g])<0&&Object.prototype.propertyIsEnumerable.call(y,d[g])&&(m[d[g]]=y[d[g]])}return m};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeModel=e.TYPES_MAP=e.GroupElement=e.ElementTypes=e.forEveryChild=void 0;const r=Ei,n=Jp,i=PS(),a=tu(),o=hj(),l=kS(),u=pj(),f=gj(),h=vj(),E=mj(),w=(y,v)=>{if(y.children)for(const m of y.children){if(v(m)===!0)break;(0,e.forEveryChild)(m,v)}};e.forEveryChild=w;const p=[...new Array(20)].map((y,v)=>r.types.late(()=>S[v]));e.ElementTypes=r.types.union({dispatcher:y=>{const v=e.TYPES_MAP[y.type];if(!v)throw new Error(`Unknown element type: "${y.type}"`);return v}},h.SVGElement,o.TextElement,l.ImageElement,f.LineElement,u.VideoElement,E.FigureElement,r.types.late(()=>e.GroupElement),...p),e.GroupElement=i.Node.named("Group").props({type:"group",children:r.types.array(e.ElementTypes)}).views(y=>({get draggable(){let v=!0;return(0,e.forEveryChild)(y,m=>{m.draggable||(v=!1)}),v},get resizable(){let v=!0;return(0,e.forEveryChild)(y,m=>{m.resizable||(v=!1)}),v},get contentEditable(){let v=!0;return(0,e.forEveryChild)(y,m=>{m.contentEditable||(v=!1)}),v},get styleEditable(){let v=!0;return(0,e.forEveryChild)(y,m=>{m.styleEditable||(v=!1)}),v},get locked(){let v=!0;return(0,e.forEveryChild)(y,m=>{m.locked||(v=!1)}),v}})).actions(y=>({set(v){var{draggable:m,contentEditable:d,styleEditable:g,resizable:_}=v,k=t(v,["draggable","contentEditable","styleEditable","resizable"]);m!==void 0&&(0,e.forEveryChild)(y,C=>{C.set({draggable:m})}),d!==void 0&&(0,e.forEveryChild)(y,C=>{C.set({contentEditable:d})}),g!==void 0&&(0,e.forEveryChild)(y,C=>{C.set({styleEditable:g})}),_!==void 0&&(0,e.forEveryChild)(y,C=>{C.set({resizable:_})}),Object.assign(y,k)},addElement(v,{skipSelect:m=!1}={}){const d=e.TYPES_MAP[v.type];if(!d)return void console.error("Can not find model with type "+v.type);v.children&&v.children.forEach(_=>{_.id=(0,n.nanoid)(10)});const g=d.create(Object.assign({id:(0,n.nanoid)(10)},v));return y.children.push(g),g.selectable&&!m&&y.store.selectElements([g.id]),g},setElementZIndex(v,m){const d=y.children.find(g=>g.id===v);d&&((0,r.detach)(d),y.children.remove(d),y.children.splice(m,0,d))}}));const S=[];function b(y,v){const m=y.type;if(!m)throw new Error('You must pass "type" attribute to custom model.');let d=a.Shape.named(m).props(y);v&&(d=v(d)),e.TYPES_MAP[m]=d,S.push(d)}e.TYPES_MAP={svg:h.SVGElement,text:o.TextElement,image:l.ImageElement,group:e.GroupElement,line:f.LineElement,video:u.VideoElement,figure:E.FigureElement},e.registerShapeModel=b}(Vg)),Vg}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.handleHotkey=void 0;const t=Pc();let r=[],n="";const i="polotno_clipboard",a=u=>{r=JSON.parse(JSON.stringify(u));try{localStorage.setItem(i,JSON.stringify(u))}catch{}},o=()=>{try{const u=localStorage.getItem(i);if(u)return JSON.parse(u)}catch{}return r};function l(u,f){var h,E,w,p,S,b,y,v;if(((h=document.activeElement)===null||h===void 0?void 0:h.tagName)==="INPUT"||((E=document.activeElement)===null||E===void 0?void 0:E.tagName)==="TEXTAREA"||((w=document.activeElement)===null||w===void 0?void 0:w.contentEditable)==="true")return;const m=f.selectedElements.filter(k=>k.removable),d=m.map(k=>k.id);u.keyCode!==46&&u.keyCode!==8||f.deleteElements(d);const g=u.ctrlKey||u.metaKey,_=u.shiftKey;if(g&&!_&&u.code==="KeyZ"&&(u.preventDefault(),f.history.undo()),g&&_&&u.code==="KeyZ"&&(u.preventDefault(),f.history.redo()),g&&u.code==="KeyA"){u.preventDefault();const k=(p=f.activePage)===null||p===void 0?void 0:p.children.filter(P=>P.selectable),C=(k==null?void 0:k.map(P=>P.id))||[];f.selectElements(C)}if(g&&u.code==="KeyC"&&(u.preventDefault(),n=(S=f.activePage)===null||S===void 0?void 0:S.id,a(f.selectedElements.map(k=>k.toJSON()))),g&&u.code==="KeyX"&&(u.preventDefault(),n=(b=f.activePage)===null||b===void 0?void 0:b.id,a(f.selectedElements.map(k=>k.toJSON())),f.deleteElements(m)),g&&u.code==="KeyV"){u.preventDefault();let k=0;n===((y=f.activePage)===null||y===void 0?void 0:y.id)&&(k=f.width/20),n=(v=f.activePage)===null||v===void 0?void 0:v.id,f.history.transaction(()=>{const C=[],P=o();(0,t.forEveryChild)({children:P},O=>{delete O.id,O.type!=="group"&&(O.x+=k,O.y+=k)}),P.forEach(O=>{var x;const A=(x=f.activePage)===null||x===void 0?void 0:x.addElement(O);A&&C.push(A.id)}),a(P),f.selectElements(C)})}u.code==="ArrowDown"&&(u.preventDefault(),f.selectedElements.forEach(k=>{k.set({y:k.y+1})})),u.code==="ArrowUp"&&(u.preventDefault(),f.selectedElements.forEach(k=>{k.set({y:k.y-1})})),u.code==="ArrowLeft"&&(u.preventDefault(),f.selectedElements.forEach(k=>{k.set({x:k.x-1})})),u.code==="ArrowRight"&&(u.preventDefault(),f.selectedElements.forEach(k=>{k.set({x:k.x+1})}))}e.handleHotkey=l})(gS);var TS={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t=e.getTranslations=e.setTranslations=void 0;const t=Ki,r=(0,t.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"}},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"}});function n(h,E){var w,p=E.split("."),S=h;for(w=0;w<p.length;++w){if(S[p[w]]==null)return;S=S[p[w]]}return S}const i=h=>h&&typeof h=="object";function a(h,E){Object.keys(E).forEach(w=>{const p=h[w],S=E[w];i(S)&&i(p)?a(p,S):h[w]=S})}function o(h,E,w=""){Object.keys(E).forEach(p=>{const S=E[p],b=w?`${w}.${p}`:p;i(S)?i(h[p])?o(h[p],S,b):console.warn(`Missing nested translation object at '${b}'`):h[p]===void 0&&console.warn(`Missing translation '${b}'`)})}e.setTranslations=(0,t.action)((h,{validate:E=!1}={})=>{E&&o(h,r),a(r,h)});const l=()=>(0,t.toJS)(r);e.getTranslations=l;const u={},f=h=>{const E=n(r,h);if(E!==void 0)return E;u[h]||(u[h]=!0,console.warn(`Missing translation '${h}'`));const w=h.split("."),p=w[w.length-1]||" ";return p.charAt(0).toUpperCase()+p.slice(1)};e.t=f})(TS);(function(e){var t=me&&me.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceCanvas=void 0;const r=t(Je),n=_i,i=t(t9),a=pS,o=gS,l=TS,u=`Polotno warning: <Workspace /> component can not automatically detect its size.
296
+ Width or height of parent elements is equal 0.
297
+ Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
298
+ For simpler debugging here is the log of the parent element:`,f=(p,S,b,y,v,m)=>{const d=r.default.useRef({width:S,height:b}),g=r.default.useRef({top:0,left:0}),_=r.default.useRef(!1),k=r.default.useRef(v.pages.length);_.current=k.current!==v.pages.length,k.current=v.pages.length,r.default.useEffect(()=>{const C=p.current,P=O=>{g.current={top:C.scrollTop,left:C.scrollLeft}};return C.addEventListener("scroll",P),()=>{C.removeEventListener("scroll",P)}},[]),r.default.useLayoutEffect(()=>{if(!p.current||_.current)return;const C=p.current,P=(g.current.left+C.offsetWidth/2)/d.current.width,O=(g.current.top+C.offsetHeight/2)/d.current.height;m.current=!0,C.scrollLeft=P*S-C.offsetWidth/2,C.scrollTop=O*b-C.offsetHeight/2,d.current={width:S,height:b}},[y,S,b])},h=(p,S,b,y,v)=>{const m=r.default.useRef(!1),d=r.default.useRef(null);r.default.useEffect(()=>{const _=p.current,k=()=>{v.current};return _.addEventListener("scroll",k),()=>{_.removeEventListener("scroll",k)}},[]);const g=b.pages.indexOf(b.activePage);return r.default.useLayoutEffect(()=>{if(!b.activePage||!p.current||m.current)return;const _=p.current,k=b.pages.indexOf(b.activePage)*S;Math.abs(k-_.scrollTop)>.5*S&&(v.current=!0,_.scrollTop=k)},[b.activePage,g]),{handleScroll:_=>{if(v.current)return void(v.current=!1);m.current=!0,clearTimeout(d.current),d.current=setTimeout(()=>{m.current=!1},300);const k=_.currentTarget.childNodes[0].offsetHeight,C=_.currentTarget.scrollTop,P=Math.floor((C+y.height/3)/k),O=b.pages[P];O&&O.select()}}},E=({store:p})=>r.default.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},r.default.createElement("p",null,(0,l.t)("workspace.noPages")),r.default.createElement("button",{onClick:()=>{p.addPage()}},(0,l.t)("workspace.addPage"))),w=({width:p,height:S,xPadding:b,yPadding:y,backgroundColor:v})=>r.default.createElement("div",{style:{width:p+"px",height:S+"px",backgroundColor:v,paddingLeft:b+"px",paddingRight:b+"px",paddingTop:y+"px",paddingBottom:y+"px"}},r.default.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}}));e.WorkspaceCanvas=(0,n.observer)(({store:p,pageControlsEnabled:S,backgroundColor:b,pageBorderColor:y,activePageBorderColor:v,bleedColor:m,components:d,onKeyDown:g,paddingX:_,paddingY:k,altCloneEnabled:C=!0,visiblePagesOffset:P})=>{const O=_??20,x=k??55,[A,L]=r.default.useState({width:100,height:100}),I=r.default.useRef(A),U=r.default.useRef(null),$=r.default.useRef(null),Z=p.bleedVisible?Math.max(0,...p.pages.map(ee=>ee.bleed)):0,q=Math.max(...p.pages.map(ee=>ee.computedWidth)),z=Math.max(...p.pages.map(ee=>ee.computedHeight)),W=q+2*Z,R=z+2*Z,M=async({skipTimeout:ee}={skipTimeout:!1})=>{if(ee||await new Promise(de=>setTimeout(de,50)),U.current===null)return;const ie=U.current.getBoundingClientRect();ie.width!==0&&ie.height!==0||(console.warn(u),console.log(U.current));const ne=$.current.clientWidth||ie.width,le={width:ne,height:ie.height};(I.current.width!==le.width||I.current.height!==le.height)&&(L(le),I.current=le);const Te=(ne-2*O)/W,Ie=(ie.height-2*x)/R,se=Math.max(Math.min(Te,Ie),.01);p.scaleToFit!==se&&(p.setScale(se),p._setScaleToFit(se))};r.default.useLayoutEffect(()=>{M({skipTimeout:!0})},[]),r.default.useEffect(()=>{M()},[W,R]),r.default.useEffect(()=>{const ee=U.current;if(window.ResizeObserver){const ie=new ResizeObserver(()=>{M({skipTimeout:!0})});return ie.observe(ee),()=>ie.unobserve(ee)}{const ie=setInterval(()=>{M({skipTimeout:!0})},100);return()=>clearInterval(ie)}},[W,R]);const F=Math.max(O,(A.width-W*p.scale)/2),D=R*p.scale*p.pages.length,H=Math.max(x,(A.height-D)/p.pages.length/2);r.default.useEffect(()=>{const ee=ie=>{(g||o.handleHotkey)(ie,p)};return window.addEventListener("keydown",ee),()=>window.removeEventListener("keydown",ee)},[]),r.default.useEffect(()=>{var ee;const ie=ne=>{if(ne.ctrlKey||ne.metaKey){ne.preventDefault();const se=Math.max(3,p.scaleToFit),de=Math.min(.1,p.scaleToFit),_e=(le=ne.deltaY<0?1.05*p.scale:p.scale/1.05,Te=de,Ie=se,Math.max(Te,Math.min(Ie,le)));p.setScale(_e)}else var le,Te,Ie};return(ee=$.current)===null||ee===void 0||ee.addEventListener("wheel",ie),()=>{var ne;return(ne=$.current)===null||ne===void 0?void 0:ne.removeEventListener("wheel",ie)}},[]);const K=r.default.useRef(!1);f($,W*p.scale+2*F,R*p.scale+2*H,p.scale,p,K);const{handleScroll:G}=h($,R*p.scale+2*H,p,A,K),B=A.width>=W*p.scale+2*F,Y=b||"rgba(232, 232, 232, 0.9)",X=p.pages.indexOf(p.activePage),Q=(d==null?void 0:d.NoPages)||E,te=P??Math.min(3,Math.max(1,Math.ceil(A.height/2/(R*p.scale))));return r.default.createElement("div",{ref:U,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:Y},tabIndex:0,className:"polotno-workspace-container"},r.default.createElement("div",{ref:$,onScroll:G,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:B?"hidden":"auto"},className:"polotno-workspace-inner"},p.pages.map((ee,ie)=>Math.abs(ie-X)<=te||ee._exportingOrRendering?r.default.createElement(i.default,{key:ee.id,page:ee,xPadding:F,yPadding:H,width:W*p.scale+2*F,height:R*p.scale+2*H,store:p,pageControlsEnabled:S,backColor:Y,pageBorderColor:y||"lightgrey",activePageBorderColor:v||"rgb(0, 161, 255)",altCloneEnabled:C,bleedColor:m||"rgba(255, 0, 0, 0.1)",components:d}):r.default.createElement(w,{key:ee.id,width:W*p.scale+2*F,height:R*p.scale+2*H,backgroundColor:Y,xPadding:F,yPadding:H})),p.rulesVisible&&r.default.createElement(a.TopRules,{store:p,xPadding:F,yPadding:H,width:W*p.scale+2*F,height:R*p.scale+2*H}),p.pages.length===0&&r.default.createElement(Q,{store:p})))}),e.default=e.WorkspaceCanvas})(Vw);var yj=O2();xl.toggleFadeInAnimation(!1);Yn.setTextOverflow("change-font-size");const bj=new URLSearchParams(location.search).get("key"),AS=yj.createStore({key:bj});window.store=AS;window.config={addGlobalFont:Xs.addGlobalFont,unstable_useHtmlTextRender:Yn.useHtmlTextRender,unstable_setTextVerticalResizeEnabled:Yn.setTextVerticalResizeEnabled,unstable_setTextOverflow:Yn.setTextOverflow,onLoadError:$i.onLoadError,setAssetLoadTimeout:$i.setAssetLoadTimeout,setFontLoadTimeout:$i.setFontLoadTimeout};const _j=Dd.createRoot(document.getElementById("root"));_j.render(ht.createElement(Vw.WorkspaceCanvas,{visiblePagesOffset:0,store:AS,components:{PageControls:()=>null,Tooltip:()=>null}}));