polotno-node 2.11.9 → 2.11.11

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.
@@ -1,329 +0,0 @@
1
- (function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function t(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=t(a);fetch(a.href,o)}})();var oc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function jd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Yl(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var n=e.default;if(typeof n=="function"){var t=function r(){return this instanceof r?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};t.prototype=n.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),t}var Ag={exports:{}},Bt={};/**
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 Mm;function R_(){if(Mm)return Bt;Mm=1;var e=Symbol.for("react.element"),n=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.iterator;function E(z){return z===null||typeof z!="object"?null:(z=y&&z[y]||z["@@iterator"],typeof z=="function"?z:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,x={};function _(z,Y,U){this.props=z,this.context=Y,this.refs=x,this.updater=U||w}_.prototype.isReactComponent={},_.prototype.setState=function(z,Y){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,Y,"setState")},_.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function b(){}b.prototype=_.prototype;function g(z,Y,U){this.props=z,this.context=Y,this.refs=x,this.updater=U||w}var h=g.prototype=new b;h.constructor=g,S(h,_.prototype),h.isPureReactComponent=!0;var d=Array.isArray,P=Object.prototype.hasOwnProperty,M={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function I(z,Y,U){var ee,te={},Q=null,Z=null;if(Y!=null)for(ee in Y.ref!==void 0&&(Z=Y.ref),Y.key!==void 0&&(Q=""+Y.key),Y)P.call(Y,ee)&&!T.hasOwnProperty(ee)&&(te[ee]=Y[ee]);var re=arguments.length-2;if(re===1)te.children=U;else if(1<re){for(var ne=Array(re),ae=0;ae<re;ae++)ne[ae]=arguments[ae+2];te.children=ne}if(z&&z.defaultProps)for(ee in re=z.defaultProps,re)te[ee]===void 0&&(te[ee]=re[ee]);return{$$typeof:e,type:z,key:Q,ref:Z,props:te,_owner:M.current}}function F(z,Y){return{$$typeof:e,type:z.type,key:Y,ref:z.ref,props:z.props,_owner:z._owner}}function k(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function O(z){var Y={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(U){return Y[U]})}var N=/\/+/g;function A(z,Y){return typeof z=="object"&&z!==null&&z.key!=null?O(""+z.key):Y.toString(36)}function R(z,Y,U,ee,te){var Q=typeof z;(Q==="undefined"||Q==="boolean")&&(z=null);var Z=!1;if(z===null)Z=!0;else switch(Q){case"string":case"number":Z=!0;break;case"object":switch(z.$$typeof){case e:case n:Z=!0}}if(Z)return Z=z,te=te(Z),z=ee===""?"."+A(Z,0):ee,d(te)?(U="",z!=null&&(U=z.replace(N,"$&/")+"/"),R(te,Y,U,"",function(ae){return ae})):te!=null&&(k(te)&&(te=F(te,U+(!te.key||Z&&Z.key===te.key?"":(""+te.key).replace(N,"$&/")+"/")+z)),Y.push(te)),1;if(Z=0,ee=ee===""?".":ee+":",d(z))for(var re=0;re<z.length;re++){Q=z[re];var ne=ee+A(Q,re);Z+=R(Q,Y,U,ne,te)}else if(ne=E(z),typeof ne=="function")for(z=ne.call(z),re=0;!(Q=z.next()).done;)Q=Q.value,ne=ee+A(Q,re++),Z+=R(Q,Y,U,ne,te);else if(Q==="object")throw Y=String(z),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.");return Z}function L(z,Y,U){if(z==null)return z;var ee=[],te=0;return R(z,ee,"","",function(Q){return Y.call(U,Q,te++)}),ee}function V(z){if(z._status===-1){var Y=z._result;Y=Y(),Y.then(function(U){(z._status===0||z._status===-1)&&(z._status=1,z._result=U)},function(U){(z._status===0||z._status===-1)&&(z._status=2,z._result=U)}),z._status===-1&&(z._status=0,z._result=Y)}if(z._status===1)return z._result.default;throw z._result}var G={current:null},W={transition:null},X={ReactCurrentDispatcher:G,ReactCurrentBatchConfig:W,ReactCurrentOwner:M};function q(){throw Error("act(...) is not supported in production builds of React.")}return Bt.Children={map:L,forEach:function(z,Y,U){L(z,function(){Y.apply(this,arguments)},U)},count:function(z){var Y=0;return L(z,function(){Y++}),Y},toArray:function(z){return L(z,function(Y){return Y})||[]},only:function(z){if(!k(z))throw Error("React.Children.only expected to receive a single React element child.");return z}},Bt.Component=_,Bt.Fragment=t,Bt.Profiler=a,Bt.PureComponent=g,Bt.StrictMode=r,Bt.Suspense=m,Bt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=X,Bt.act=q,Bt.cloneElement=function(z,Y,U){if(z==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+z+".");var ee=S({},z.props),te=z.key,Q=z.ref,Z=z._owner;if(Y!=null){if(Y.ref!==void 0&&(Q=Y.ref,Z=M.current),Y.key!==void 0&&(te=""+Y.key),z.type&&z.type.defaultProps)var re=z.type.defaultProps;for(ne in Y)P.call(Y,ne)&&!T.hasOwnProperty(ne)&&(ee[ne]=Y[ne]===void 0&&re!==void 0?re[ne]:Y[ne])}var ne=arguments.length-2;if(ne===1)ee.children=U;else if(1<ne){re=Array(ne);for(var ae=0;ae<ne;ae++)re[ae]=arguments[ae+2];ee.children=re}return{$$typeof:e,type:z.type,key:te,ref:Q,props:ee,_owner:Z}},Bt.createContext=function(z){return z={$$typeof:s,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},z.Provider={$$typeof:o,_context:z},z.Consumer=z},Bt.createElement=I,Bt.createFactory=function(z){var Y=I.bind(null,z);return Y.type=z,Y},Bt.createRef=function(){return{current:null}},Bt.forwardRef=function(z){return{$$typeof:c,render:z}},Bt.isValidElement=k,Bt.lazy=function(z){return{$$typeof:v,_payload:{_status:-1,_result:z},_init:V}},Bt.memo=function(z,Y){return{$$typeof:f,type:z,compare:Y===void 0?null:Y}},Bt.startTransition=function(z){var Y=W.transition;W.transition={};try{z()}finally{W.transition=Y}},Bt.unstable_act=q,Bt.useCallback=function(z,Y){return G.current.useCallback(z,Y)},Bt.useContext=function(z){return G.current.useContext(z)},Bt.useDebugValue=function(){},Bt.useDeferredValue=function(z){return G.current.useDeferredValue(z)},Bt.useEffect=function(z,Y){return G.current.useEffect(z,Y)},Bt.useId=function(){return G.current.useId()},Bt.useImperativeHandle=function(z,Y,U){return G.current.useImperativeHandle(z,Y,U)},Bt.useInsertionEffect=function(z,Y){return G.current.useInsertionEffect(z,Y)},Bt.useLayoutEffect=function(z,Y){return G.current.useLayoutEffect(z,Y)},Bt.useMemo=function(z,Y){return G.current.useMemo(z,Y)},Bt.useReducer=function(z,Y,U){return G.current.useReducer(z,Y,U)},Bt.useRef=function(z){return G.current.useRef(z)},Bt.useState=function(z){return G.current.useState(z)},Bt.useSyncExternalStore=function(z,Y,U){return G.current.useSyncExternalStore(z,Y,U)},Bt.useTransition=function(){return G.current.useTransition()},Bt.version="18.3.1",Bt}var Lm;function Or(){return Lm||(Lm=1,Ag.exports=R_()),Ag.exports}var Sr=Or();const Gt=jd(Sr);var Zh={},Tg={exports:{}},ci={},Rg={exports:{}},Mg={};/**
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
- */var Nm;function M_(){return Nm||(Nm=1,function(e){function n(W,X){var q=W.length;W.push(X);e:for(;0<q;){var z=q-1>>>1,Y=W[z];if(0<a(Y,X))W[z]=X,W[q]=Y,q=z;else break e}}function t(W){return W.length===0?null:W[0]}function r(W){if(W.length===0)return null;var X=W[0],q=W.pop();if(q!==X){W[0]=q;e:for(var z=0,Y=W.length,U=Y>>>1;z<U;){var ee=2*(z+1)-1,te=W[ee],Q=ee+1,Z=W[Q];if(0>a(te,q))Q<Y&&0>a(Z,te)?(W[z]=Z,W[Q]=q,z=Q):(W[z]=te,W[ee]=q,z=ee);else if(Q<Y&&0>a(Z,q))W[z]=Z,W[Q]=q,z=Q;else break e}}return X}function a(W,X){var q=W.sortIndex-X.sortIndex;return q!==0?q:W.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,c=s.now();e.unstable_now=function(){return s.now()-c}}var m=[],f=[],v=1,y=null,E=3,w=!1,S=!1,x=!1,_=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function h(W){for(var X=t(f);X!==null;){if(X.callback===null)r(f);else if(X.startTime<=W)r(f),X.sortIndex=X.expirationTime,n(m,X);else break;X=t(f)}}function d(W){if(x=!1,h(W),!S)if(t(m)!==null)S=!0,V(P);else{var X=t(f);X!==null&&G(d,X.startTime-W)}}function P(W,X){S=!1,x&&(x=!1,b(I),I=-1),w=!0;var q=E;try{for(h(X),y=t(m);y!==null&&(!(y.expirationTime>X)||W&&!O());){var z=y.callback;if(typeof z=="function"){y.callback=null,E=y.priorityLevel;var Y=z(y.expirationTime<=X);X=e.unstable_now(),typeof Y=="function"?y.callback=Y:y===t(m)&&r(m),h(X)}else r(m);y=t(m)}if(y!==null)var U=!0;else{var ee=t(f);ee!==null&&G(d,ee.startTime-X),U=!1}return U}finally{y=null,E=q,w=!1}}var M=!1,T=null,I=-1,F=5,k=-1;function O(){return!(e.unstable_now()-k<F)}function N(){if(T!==null){var W=e.unstable_now();k=W;var X=!0;try{X=T(!0,W)}finally{X?A():(M=!1,T=null)}}else M=!1}var A;if(typeof g=="function")A=function(){g(N)};else if(typeof MessageChannel<"u"){var R=new MessageChannel,L=R.port2;R.port1.onmessage=N,A=function(){L.postMessage(null)}}else A=function(){_(N,0)};function V(W){T=W,M||(M=!0,A())}function G(W,X){I=_(function(){W(e.unstable_now())},X)}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(W){W.callback=null},e.unstable_continueExecution=function(){S||w||(S=!0,V(P))},e.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<W?Math.floor(1e3/W):5},e.unstable_getCurrentPriorityLevel=function(){return E},e.unstable_getFirstCallbackNode=function(){return t(m)},e.unstable_next=function(W){switch(E){case 1:case 2:case 3:var X=3;break;default:X=E}var q=E;E=X;try{return W()}finally{E=q}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(W,X){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var q=E;E=W;try{return X()}finally{E=q}},e.unstable_scheduleCallback=function(W,X,q){var z=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?z+q:z):q=z,W){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=q+Y,W={id:v++,callback:X,priorityLevel:W,startTime:q,expirationTime:Y,sortIndex:-1},q>z?(W.sortIndex=q,n(f,W),t(m)===null&&W===t(f)&&(x?(b(I),I=-1):x=!0,G(d,q-z))):(W.sortIndex=Y,n(m,W),S||w||(S=!0,V(P))),W},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(W){var X=E;return function(){var q=E;E=X;try{return W.apply(this,arguments)}finally{E=q}}}}(Mg)),Mg}var Im;function lv(){return Im||(Im=1,Rg.exports=M_()),Rg.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 jm;function L_(){if(jm)return ci;jm=1;var e=Or(),n=lv();function t(i){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+i,C=1;C<arguments.length;C++)l+="&args[]="+encodeURIComponent(arguments[C]);return"Minified React error #"+i+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,a={};function o(i,l){s(i,l),s(i+"Capture",l)}function s(i,l){for(a[i]=l,i=0;i<l.length;i++)r.add(l[i])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),m=Object.prototype.hasOwnProperty,f=/^[: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]*$/,v={},y={};function E(i){return m.call(y,i)?!0:m.call(v,i)?!1:f.test(i)?y[i]=!0:(v[i]=!0,!1)}function w(i,l,C,D){if(C!==null&&C.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return D?!1:C!==null?!C.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function S(i,l,C,D){if(l===null||typeof l>"u"||w(i,l,C,D))return!0;if(D)return!1;if(C!==null)switch(C.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function x(i,l,C,D,H,K,ie){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=D,this.attributeNamespace=H,this.mustUseProperty=C,this.propertyName=i,this.type=l,this.sanitizeURL=K,this.removeEmptyString=ie}var _={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){_[i]=new x(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var l=i[0];_[l]=new x(l,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){_[i]=new x(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){_[i]=new x(i,2,!1,i,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(i){_[i]=new x(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){_[i]=new x(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){_[i]=new x(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){_[i]=new x(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){_[i]=new x(i,5,!1,i.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function g(i){return i[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(i){var l=i.replace(b,g);_[l]=new x(l,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var l=i.replace(b,g);_[l]=new x(l,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var l=i.replace(b,g);_[l]=new x(l,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){_[i]=new x(i,1,!1,i.toLowerCase(),null,!1,!1)}),_.xlinkHref=new x("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){_[i]=new x(i,1,!1,i.toLowerCase(),null,!0,!0)});function h(i,l,C,D){var H=_.hasOwnProperty(l)?_[l]:null;(H!==null?H.type!==0:D||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(S(l,C,H,D)&&(C=null),D||H===null?E(l)&&(C===null?i.removeAttribute(l):i.setAttribute(l,""+C)):H.mustUseProperty?i[H.propertyName]=C===null?H.type===3?!1:"":C:(l=H.attributeName,D=H.attributeNamespace,C===null?i.removeAttribute(l):(H=H.type,C=H===3||H===4&&C===!0?"":""+C,D?i.setAttributeNS(D,l,C):i.setAttribute(l,C))))}var d=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,P=Symbol.for("react.element"),M=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),k=Symbol.for("react.provider"),O=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),G=Symbol.for("react.offscreen"),W=Symbol.iterator;function X(i){return i===null||typeof i!="object"?null:(i=W&&i[W]||i["@@iterator"],typeof i=="function"?i:null)}var q=Object.assign,z;function Y(i){if(z===void 0)try{throw Error()}catch(C){var l=C.stack.trim().match(/\n( *(at )?)/);z=l&&l[1]||""}return`
26
- `+z+i}var U=!1;function ee(i,l){if(!i||U)return"";U=!0;var C=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(Ne){var D=Ne}Reflect.construct(i,[],l)}else{try{l.call()}catch(Ne){D=Ne}i.call(l.prototype)}else{try{throw Error()}catch(Ne){D=Ne}i()}}catch(Ne){if(Ne&&D&&typeof Ne.stack=="string"){for(var H=Ne.stack.split(`
27
- `),K=D.stack.split(`
28
- `),ie=H.length-1,ce=K.length-1;1<=ie&&0<=ce&&H[ie]!==K[ce];)ce--;for(;1<=ie&&0<=ce;ie--,ce--)if(H[ie]!==K[ce]){if(ie!==1||ce!==1)do if(ie--,ce--,0>ce||H[ie]!==K[ce]){var ge=`
29
- `+H[ie].replace(" at new "," at ");return i.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",i.displayName)),ge}while(1<=ie&&0<=ce);break}}}finally{U=!1,Error.prepareStackTrace=C}return(i=i?i.displayName||i.name:"")?Y(i):""}function te(i){switch(i.tag){case 5:return Y(i.type);case 16:return Y("Lazy");case 13:return Y("Suspense");case 19:return Y("SuspenseList");case 0:case 2:case 15:return i=ee(i.type,!1),i;case 11:return i=ee(i.type.render,!1),i;case 1:return i=ee(i.type,!0),i;default:return""}}function Q(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case T:return"Fragment";case M:return"Portal";case F:return"Profiler";case I:return"StrictMode";case A:return"Suspense";case R:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case O:return(i.displayName||"Context")+".Consumer";case k:return(i._context.displayName||"Context")+".Provider";case N:var l=i.render;return i=i.displayName,i||(i=l.displayName||l.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case L:return l=i.displayName||null,l!==null?l:Q(i.type)||"Memo";case V:l=i._payload,i=i._init;try{return Q(i(l))}catch{}}return null}function Z(i){var l=i.type;switch(i.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=l.render,i=i.displayName||i.name||"",l.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Q(l);case 8:return l===I?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function re(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function ne(i){var l=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function ae(i){var l=ne(i)?"checked":"value",C=Object.getOwnPropertyDescriptor(i.constructor.prototype,l),D=""+i[l];if(!i.hasOwnProperty(l)&&typeof C<"u"&&typeof C.get=="function"&&typeof C.set=="function"){var H=C.get,K=C.set;return Object.defineProperty(i,l,{configurable:!0,get:function(){return H.call(this)},set:function(ie){D=""+ie,K.call(this,ie)}}),Object.defineProperty(i,l,{enumerable:C.enumerable}),{getValue:function(){return D},setValue:function(ie){D=""+ie},stopTracking:function(){i._valueTracker=null,delete i[l]}}}}function ue(i){i._valueTracker||(i._valueTracker=ae(i))}function fe(i){if(!i)return!1;var l=i._valueTracker;if(!l)return!0;var C=l.getValue(),D="";return i&&(D=ne(i)?i.checked?"true":"false":i.value),i=D,i!==C?(l.setValue(i),!0):!1}function pe(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function ye(i,l){var C=l.checked;return q({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:C??i._wrapperState.initialChecked})}function we(i,l){var C=l.defaultValue==null?"":l.defaultValue,D=l.checked!=null?l.checked:l.defaultChecked;C=re(l.value!=null?l.value:C),i._wrapperState={initialChecked:D,initialValue:C,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function je(i,l){l=l.checked,l!=null&&h(i,"checked",l,!1)}function Te(i,l){je(i,l);var C=re(l.value),D=l.type;if(C!=null)D==="number"?(C===0&&i.value===""||i.value!=C)&&(i.value=""+C):i.value!==""+C&&(i.value=""+C);else if(D==="submit"||D==="reset"){i.removeAttribute("value");return}l.hasOwnProperty("value")?_e(i,l.type,C):l.hasOwnProperty("defaultValue")&&_e(i,l.type,re(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(i.defaultChecked=!!l.defaultChecked)}function se(i,l,C){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var D=l.type;if(!(D!=="submit"&&D!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+i._wrapperState.initialValue,C||l===i.value||(i.value=l),i.defaultValue=l}C=i.name,C!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,C!==""&&(i.name=C)}function _e(i,l,C){(l!=="number"||pe(i.ownerDocument)!==i)&&(C==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+C&&(i.defaultValue=""+C))}var he=Array.isArray;function xe(i,l,C,D){if(i=i.options,l){l={};for(var H=0;H<C.length;H++)l["$"+C[H]]=!0;for(C=0;C<i.length;C++)H=l.hasOwnProperty("$"+i[C].value),i[C].selected!==H&&(i[C].selected=H),H&&D&&(i[C].defaultSelected=!0)}else{for(C=""+re(C),l=null,H=0;H<i.length;H++){if(i[H].value===C){i[H].selected=!0,D&&(i[H].defaultSelected=!0);return}l!==null||i[H].disabled||(l=i[H])}l!==null&&(l.selected=!0)}}function oe(i,l){if(l.dangerouslySetInnerHTML!=null)throw Error(t(91));return q({},l,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function ve(i,l){var C=l.value;if(C==null){if(C=l.children,l=l.defaultValue,C!=null){if(l!=null)throw Error(t(92));if(he(C)){if(1<C.length)throw Error(t(93));C=C[0]}l=C}l==null&&(l=""),C=l}i._wrapperState={initialValue:re(C)}}function de(i,l){var C=re(l.value),D=re(l.defaultValue);C!=null&&(C=""+C,C!==i.value&&(i.value=C),l.defaultValue==null&&i.defaultValue!==C&&(i.defaultValue=C)),D!=null&&(i.defaultValue=""+D)}function ke(i){var l=i.textContent;l===i._wrapperState.initialValue&&l!==""&&l!==null&&(i.value=l)}function Be(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Qe(i,l){return i==null||i==="http://www.w3.org/1999/xhtml"?Be(l):i==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var Ke,St=function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,C,D,H){MSApp.execUnsafeLocalFunction(function(){return i(l,C,D,H)})}:i}(function(i,l){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=l;else{for(Ke=Ke||document.createElement("div"),Ke.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=Ke.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;l.firstChild;)i.appendChild(l.firstChild)}});function Ue(i,l){if(l){var C=i.firstChild;if(C&&C===i.lastChild&&C.nodeType===3){C.nodeValue=l;return}}i.textContent=l}var rt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},gt=["Webkit","ms","Moz","O"];Object.keys(rt).forEach(function(i){gt.forEach(function(l){l=l+i.charAt(0).toUpperCase()+i.substring(1),rt[l]=rt[i]})});function mt(i,l,C){return l==null||typeof l=="boolean"||l===""?"":C||typeof l!="number"||l===0||rt.hasOwnProperty(i)&&rt[i]?(""+l).trim():l+"px"}function kt(i,l){i=i.style;for(var C in l)if(l.hasOwnProperty(C)){var D=C.indexOf("--")===0,H=mt(C,l[C],D);C==="float"&&(C="cssFloat"),D?i.setProperty(C,H):i[C]=H}}var jt=q({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Oe(i,l){if(l){if(jt[i]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(t(137,i));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(t(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(t(61))}if(l.style!=null&&typeof l.style!="object")throw Error(t(62))}}function Se(i,l){if(i.indexOf("-")===-1)return typeof l.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var yt=null;function Fe(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var qe=null,$e=null,Et=null;function Pt(i){if(i=bs(i)){if(typeof qe!="function")throw Error(t(280));var l=i.stateNode;l&&(l=Wr(l),qe(i.stateNode,i.type,l))}}function ht(i){$e?Et?Et.push(i):Et=[i]:$e=i}function ze(){if($e){var i=$e,l=Et;if(Et=$e=null,Pt(i),l)for(i=0;i<l.length;i++)Pt(l[i])}}function at(i,l){return i(l)}function Pe(){}var me=!1;function He(i,l,C){if(me)return i(l,C);me=!0;try{return at(i,l,C)}finally{me=!1,($e!==null||Et!==null)&&(Pe(),ze())}}function Me(i,l){var C=i.stateNode;if(C===null)return null;var D=Wr(C);if(D===null)return null;C=D[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(D=!D.disabled)||(i=i.type,D=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!D;break e;default:i=!1}if(i)return null;if(C&&typeof C!="function")throw Error(t(231,l,typeof C));return C}var Ye=!1;if(c)try{var et={};Object.defineProperty(et,"passive",{get:function(){Ye=!0}}),window.addEventListener("test",et,et),window.removeEventListener("test",et,et)}catch{Ye=!1}function ut(i,l,C,D,H,K,ie,ce,ge){var Ne=Array.prototype.slice.call(arguments,3);try{l.apply(C,Ne)}catch(Ve){this.onError(Ve)}}var wt=!1,Ct=null,Jt=!1,Wt=null,er={onError:function(i){wt=!0,Ct=i}};function cr(i,l,C,D,H,K,ie,ce,ge){wt=!1,Ct=null,ut.apply(er,arguments)}function Jn(i,l,C,D,H,K,ie,ce,ge){if(cr.apply(this,arguments),wt){if(wt){var Ne=Ct;wt=!1,Ct=null}else throw Error(t(198));Jt||(Jt=!0,Wt=Ne)}}function Nr(i){var l=i,C=i;if(i.alternate)for(;l.return;)l=l.return;else{i=l;do l=i,(l.flags&4098)!==0&&(C=l.return),i=l.return;while(i)}return l.tag===3?C:null}function ei(i){if(i.tag===13){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function lo(i){if(Nr(i)!==i)throw Error(t(188))}function ka(i){var l=i.alternate;if(!l){if(l=Nr(i),l===null)throw Error(t(188));return l!==i?null:i}for(var C=i,D=l;;){var H=C.return;if(H===null)break;var K=H.alternate;if(K===null){if(D=H.return,D!==null){C=D;continue}break}if(H.child===K.child){for(K=H.child;K;){if(K===C)return lo(H),i;if(K===D)return lo(H),l;K=K.sibling}throw Error(t(188))}if(C.return!==D.return)C=H,D=K;else{for(var ie=!1,ce=H.child;ce;){if(ce===C){ie=!0,C=H,D=K;break}if(ce===D){ie=!0,D=H,C=K;break}ce=ce.sibling}if(!ie){for(ce=K.child;ce;){if(ce===C){ie=!0,C=K,D=H;break}if(ce===D){ie=!0,D=K,C=H;break}ce=ce.sibling}if(!ie)throw Error(t(189))}}if(C.alternate!==D)throw Error(t(190))}if(C.tag!==3)throw Error(t(188));return C.stateNode.current===C?i:l}function ti(i){return i=ka(i),i!==null?Li(i):null}function Li(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var l=Li(i);if(l!==null)return l;i=i.sibling}return null}var Qs=n.unstable_scheduleCallback,rs=n.unstable_cancelCallback,Kp=n.unstable_shouldYield,Xp=n.unstable_requestPaint,Pr=n.unstable_now,Oc=n.unstable_getCurrentPriorityLevel,so=n.unstable_ImmediatePriority,Js=n.unstable_UserBlockingPriority,Qo=n.unstable_NormalPriority,Zp=n.unstable_LowPriority,eu=n.unstable_IdlePriority,Qi=null,Zr=null;function fr(i){if(Zr&&typeof Zr.onCommitFiberRoot=="function")try{Zr.onCommitFiberRoot(Qi,i,void 0,(i.current.flags&128)===128)}catch{}}var Ft=Math.clz32?Math.clz32:Mn,Aa=Math.log,un=Math.LN2;function Mn(i){return i>>>=0,i===0?32:31-(Aa(i)/un|0)|0}var Ni=64,Ji=4194304;function Gr(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function uo(i,l){var C=i.pendingLanes;if(C===0)return 0;var D=0,H=i.suspendedLanes,K=i.pingedLanes,ie=C&268435455;if(ie!==0){var ce=ie&~H;ce!==0?D=Gr(ce):(K&=ie,K!==0&&(D=Gr(K)))}else ie=C&~H,ie!==0?D=Gr(ie):K!==0&&(D=Gr(K));if(D===0)return 0;if(l!==0&&l!==D&&(l&H)===0&&(H=D&-D,K=l&-l,H>=K||H===16&&(K&4194240)!==0))return l;if((D&4)!==0&&(D|=C&16),l=i.entangledLanes,l!==0)for(i=i.entanglements,l&=D;0<l;)C=31-Ft(l),H=1<<C,D|=i[C],l&=~H;return D}function Kd(i,l){switch(i){case 1:case 2:case 4:return l+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Xd(i,l){for(var C=i.suspendedLanes,D=i.pingedLanes,H=i.expirationTimes,K=i.pendingLanes;0<K;){var ie=31-Ft(K),ce=1<<ie,ge=H[ie];ge===-1?((ce&C)===0||(ce&D)!==0)&&(H[ie]=Kd(ce,l)):ge<=l&&(i.expiredLanes|=ce),K&=~ce}}function Jo(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function Pc(){var i=Ni;return Ni<<=1,(Ni&4194240)===0&&(Ni=64),i}function zn(i){for(var l=[],C=0;31>C;C++)l.push(i);return l}function ns(i,l,C){i.pendingLanes|=l,l!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,l=31-Ft(l),i[l]=C}function Qp(i,l){var C=i.pendingLanes&~l;i.pendingLanes=l,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=l,i.mutableReadLanes&=l,i.entangledLanes&=l,l=i.entanglements;var D=i.eventTimes;for(i=i.expirationTimes;0<C;){var H=31-Ft(C),K=1<<H;l[H]=0,D[H]=-1,i[H]=-1,C&=~K}}function Cc(i,l){var C=i.entangledLanes|=l;for(i=i.entanglements;C;){var D=31-Ft(C),H=1<<D;H&l|i[D]&l&&(i[D]|=l),C&=~H}}var $t=0;function is(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var el,tl,Zd,Qd,tu,ru=!1,rl=[],ri=null,Ta=null,Ii=null,zt=new Map,nl=new Map,ji=[],Jd="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function eh(i,l){switch(i){case"focusin":case"focusout":ri=null;break;case"dragenter":case"dragleave":Ta=null;break;case"mouseover":case"mouseout":Ii=null;break;case"pointerover":case"pointerout":zt.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":nl.delete(l.pointerId)}}function as(i,l,C,D,H,K){return i===null||i.nativeEvent!==K?(i={blockedOn:l,domEventName:C,eventSystemFlags:D,nativeEvent:K,targetContainers:[H]},l!==null&&(l=bs(l),l!==null&&tl(l)),i):(i.eventSystemFlags|=D,l=i.targetContainers,H!==null&&l.indexOf(H)===-1&&l.push(H),i)}function Vr(i,l,C,D,H){switch(l){case"focusin":return ri=as(ri,i,l,C,D,H),!0;case"dragenter":return Ta=as(Ta,i,l,C,D,H),!0;case"mouseover":return Ii=as(Ii,i,l,C,D,H),!0;case"pointerover":var K=H.pointerId;return zt.set(K,as(zt.get(K)||null,i,l,C,D,H)),!0;case"gotpointercapture":return K=H.pointerId,nl.set(K,as(nl.get(K)||null,i,l,C,D,H)),!0}return!1}function nu(i){var l=Ba(i.target);if(l!==null){var C=Nr(l);if(C!==null){if(l=C.tag,l===13){if(l=ei(C),l!==null){i.blockedOn=l,tu(i.priority,function(){Zd(C)});return}}else if(l===3&&C.stateNode.current.memoizedState.isDehydrated){i.blockedOn=C.tag===3?C.stateNode.containerInfo:null;return}}}i.blockedOn=null}function iu(i){if(i.blockedOn!==null)return!1;for(var l=i.targetContainers;0<l.length;){var C=lu(i.domEventName,i.eventSystemFlags,l[0],i.nativeEvent);if(C===null){C=i.nativeEvent;var D=new C.constructor(C.type,C);yt=D,C.target.dispatchEvent(D),yt=null}else return l=bs(C),l!==null&&tl(l),i.blockedOn=C,!1;l.shift()}return!0}function au(i,l,C){iu(i)&&C.delete(l)}function Jp(){ru=!1,ri!==null&&iu(ri)&&(ri=null),Ta!==null&&iu(Ta)&&(Ta=null),Ii!==null&&iu(Ii)&&(Ii=null),zt.forEach(au),nl.forEach(au)}function Ra(i,l){i.blockedOn===l&&(i.blockedOn=null,ru||(ru=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Jp)))}function Ln(i){function l(H){return Ra(H,i)}if(0<rl.length){Ra(rl[0],i);for(var C=1;C<rl.length;C++){var D=rl[C];D.blockedOn===i&&(D.blockedOn=null)}}for(ri!==null&&Ra(ri,i),Ta!==null&&Ra(Ta,i),Ii!==null&&Ra(Ii,i),zt.forEach(l),nl.forEach(l),C=0;C<ji.length;C++)D=ji[C],D.blockedOn===i&&(D.blockedOn=null);for(;0<ji.length&&(C=ji[0],C.blockedOn===null);)nu(C),C.blockedOn===null&&ji.shift()}var il=d.ReactCurrentBatchConfig,ou=!0;function mi(i,l,C,D){var H=$t,K=il.transition;il.transition=null;try{$t=1,al(i,l,C,D)}finally{$t=H,il.transition=K}}function ea(i,l,C,D){var H=$t,K=il.transition;il.transition=null;try{$t=4,al(i,l,C,D)}finally{$t=H,il.transition=K}}function al(i,l,C,D){if(ou){var H=lu(i,l,C,D);if(H===null)Eu(i,l,D,ol,C),eh(i,D);else if(Vr(H,i,l,C,D))D.stopPropagation();else if(eh(i,D),l&4&&-1<Jd.indexOf(i)){for(;H!==null;){var K=bs(H);if(K!==null&&el(K),K=lu(i,l,C,D),K===null&&Eu(i,l,D,ol,C),K===H)break;H=K}H!==null&&D.stopPropagation()}else Eu(i,l,D,null,C)}}var ol=null;function lu(i,l,C,D){if(ol=null,i=Fe(D),i=Ba(i),i!==null)if(l=Nr(i),l===null)i=null;else if(C=l.tag,C===13){if(i=ei(l),i!==null)return i;i=null}else if(C===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;i=null}else l!==i&&(i=null);return ol=i,null}function th(i){switch(i){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Oc()){case so:return 1;case Js:return 4;case Qo:case Zp:return 16;case eu:return 536870912;default:return 16}default:return 16}}var Qr=null,Ma=null,ta=null;function os(){if(ta)return ta;var i,l=Ma,C=l.length,D,H="value"in Qr?Qr.value:Qr.textContent,K=H.length;for(i=0;i<C&&l[i]===H[i];i++);var ie=C-i;for(D=1;D<=ie&&l[C-D]===H[K-D];D++);return ta=H.slice(i,1<D?1-D:void 0)}function co(i){var l=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&l===13&&(i=13)):i=l,i===10&&(i=13),32<=i||i===13?i:0}function wn(){return!0}function Bn(){return!1}function Ir(i){function l(C,D,H,K,ie){this._reactName=C,this._targetInst=H,this.type=D,this.nativeEvent=K,this.target=ie,this.currentTarget=null;for(var ce in i)i.hasOwnProperty(ce)&&(C=i[ce],this[ce]=C?C(K):K[ce]);return this.isDefaultPrevented=(K.defaultPrevented!=null?K.defaultPrevented:K.returnValue===!1)?wn:Bn,this.isPropagationStopped=Bn,this}return q(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var C=this.nativeEvent;C&&(C.preventDefault?C.preventDefault():typeof C.returnValue!="unknown"&&(C.returnValue=!1),this.isDefaultPrevented=wn)},stopPropagation:function(){var C=this.nativeEvent;C&&(C.stopPropagation?C.stopPropagation():typeof C.cancelBubble!="unknown"&&(C.cancelBubble=!0),this.isPropagationStopped=wn)},persist:function(){},isPersistent:wn}),l}var Nn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yi=Ir(Nn),bi=q({},Nn,{view:0,detail:0}),rh=Ir(bi),ls,ss,Jr,_n=q({},bi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ho,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Jr&&(Jr&&i.type==="mousemove"?(ls=i.screenX-Jr.screenX,ss=i.screenY-Jr.screenY):ss=ls=0,Jr=i),ls)},movementY:function(i){return"movementY"in i?i.movementY:ss}}),dr=Ir(_n),us=q({},_n,{dataTransfer:0}),wi=Ir(us),nh=q({},bi,{relatedTarget:0}),su=Ir(nh),kc=q({},Nn,{animationName:0,elapsedTime:0,pseudoElement:0}),Ac=Ir(kc),ih=q({},Nn,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),uu=Ir(ih),ah=q({},Nn,{data:0}),fo=Ir(ah),Tc={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},eg={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},cu={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tg(i){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(i):(i=cu[i])?!!l[i]:!1}function ho(){return tg}var fu=q({},bi,{key:function(i){if(i.key){var l=Tc[i.key]||i.key;if(l!=="Unidentified")return l}return i.type==="keypress"?(i=co(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?eg[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ho,charCode:function(i){return i.type==="keypress"?co(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?co(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),oh=Ir(fu),lh=q({},_n,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),po=Ir(lh),sh=q({},bi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ho}),du=Ir(sh),hu=q({},Nn,{propertyName:0,elapsedTime:0,pseudoElement:0}),ll=Ir(hu),Rc=q({},_n,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),Mc=Ir(Rc),uh=[9,13,27,32],cs=c&&"CompositionEvent"in window,go=null;c&&"documentMode"in document&&(go=document.documentMode);var sl=c&&"TextEvent"in window&&!go,Un=c&&(!cs||go&&8<go&&11>=go),La=" ",pu=!1;function Lc(i,l){switch(i){case"keyup":return uh.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _i(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var qn=!1;function Nc(i,l){switch(i){case"compositionend":return _i(l);case"keypress":return l.which!==32?null:(pu=!0,La);case"textInput":return i=l.data,i===La&&pu?null:i;default:return null}}function ch(i,l){if(qn)return i==="compositionend"||!cs&&Lc(i,l)?(i=os(),ta=Ma=Qr=null,qn=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return Un&&l.locale!=="ko"?null:l.data;default:return null}}var ra={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function na(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l==="input"?!!ra[i.type]:l==="textarea"}function fs(i,l,C,D){ht(D),l=xu(l,"onChange"),0<l.length&&(C=new yi("onChange","change",null,C,D),i.push({event:C,listeners:l}))}var ul=null,Na=null;function fh(i){Vc(i,0)}function Ia(i){var l=Dr(i);if(fe(l))return i}function ni(i,l){if(i==="change")return l}var cl=!1;if(c){var ja;if(c){var ii="oninput"in document;if(!ii){var gu=document.createElement("div");gu.setAttribute("oninput","return;"),ii=typeof gu.oninput=="function"}ja=ii}else ja=!1;cl=ja&&(!document.documentMode||9<document.documentMode)}function vo(){ul&&(ul.detachEvent("onpropertychange",Ic),Na=ul=null)}function Ic(i){if(i.propertyName==="value"&&Ia(Na)){var l=[];fs(l,Na,i,Fe(i)),He(fh,l)}}function jc(i,l,C){i==="focusin"?(vo(),ul=l,Na=C,ul.attachEvent("onpropertychange",Ic)):i==="focusout"&&vo()}function _r(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Ia(Na)}function vu(i,l){if(i==="click")return Ia(l)}function Dc(i,l){if(i==="input"||i==="change")return Ia(l)}function Fc(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var In=typeof Object.is=="function"?Object.is:Fc;function mo(i,l){if(In(i,l))return!0;if(typeof i!="object"||i===null||typeof l!="object"||l===null)return!1;var C=Object.keys(i),D=Object.keys(l);if(C.length!==D.length)return!1;for(D=0;D<C.length;D++){var H=C[D];if(!m.call(l,H)||!In(i[H],l[H]))return!1}return!0}function Da(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function gr(i,l){var C=Da(i);i=0;for(var D;C;){if(C.nodeType===3){if(D=i+C.textContent.length,i<=l&&D>=l)return{node:C,offset:l-i};i=D}e:{for(;C;){if(C.nextSibling){C=C.nextSibling;break e}C=C.parentNode}C=void 0}C=Da(C)}}function Ar(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?Ar(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function jr(){for(var i=window,l=pe();l instanceof i.HTMLIFrameElement;){try{var C=typeof l.contentWindow.location.href=="string"}catch{C=!1}if(C)i=l.contentWindow;else break;l=pe(i.document)}return l}function fl(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l&&(l==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||l==="textarea"||i.contentEditable==="true")}function ds(i){var l=jr(),C=i.focusedElem,D=i.selectionRange;if(l!==C&&C&&C.ownerDocument&&Ar(C.ownerDocument.documentElement,C)){if(D!==null&&fl(C)){if(l=D.start,i=D.end,i===void 0&&(i=l),"selectionStart"in C)C.selectionStart=l,C.selectionEnd=Math.min(i,C.value.length);else if(i=(l=C.ownerDocument||document)&&l.defaultView||window,i.getSelection){i=i.getSelection();var H=C.textContent.length,K=Math.min(D.start,H);D=D.end===void 0?K:Math.min(D.end,H),!i.extend&&K>D&&(H=D,D=K,K=H),H=gr(C,K);var ie=gr(C,D);H&&ie&&(i.rangeCount!==1||i.anchorNode!==H.node||i.anchorOffset!==H.offset||i.focusNode!==ie.node||i.focusOffset!==ie.offset)&&(l=l.createRange(),l.setStart(H.node,H.offset),i.removeAllRanges(),K>D?(i.addRange(l),i.extend(ie.node,ie.offset)):(l.setEnd(ie.node,ie.offset),i.addRange(l)))}}for(l=[],i=C;i=i.parentNode;)i.nodeType===1&&l.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<l.length;C++)i=l[C],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var hs=c&&"documentMode"in document&&11>=document.documentMode,dl=null,$r=null,yo=null,ps=!1;function mu(i,l,C){var D=C.window===C?C.document:C.nodeType===9?C:C.ownerDocument;ps||dl==null||dl!==pe(D)||(D=dl,"selectionStart"in D&&fl(D)?D={start:D.selectionStart,end:D.selectionEnd}:(D=(D.ownerDocument&&D.ownerDocument.defaultView||window).getSelection(),D={anchorNode:D.anchorNode,anchorOffset:D.anchorOffset,focusNode:D.focusNode,focusOffset:D.focusOffset}),yo&&mo(yo,D)||(yo=D,D=xu($r,"onSelect"),0<D.length&&(l=new yi("onSelect","select",null,l,C),i.push({event:l,listeners:D}),l.target=dl)))}function Hn(i,l){var C={};return C[i.toLowerCase()]=l.toLowerCase(),C["Webkit"+i]="webkit"+l,C["Moz"+i]="moz"+l,C}var en={animationend:Hn("Animation","AnimationEnd"),animationiteration:Hn("Animation","AnimationIteration"),animationstart:Hn("Animation","AnimationStart"),transitionend:Hn("Transition","TransitionEnd")},bo={},yu={};c&&(yu=document.createElement("div").style,"AnimationEvent"in window||(delete en.animationend.animation,delete en.animationiteration.animation,delete en.animationstart.animation),"TransitionEvent"in window||delete en.transitionend.transition);function hl(i){if(bo[i])return bo[i];if(!en[i])return i;var l=en[i],C;for(C in l)if(l.hasOwnProperty(C)&&C in yu)return bo[i]=l[C];return i}var zc=hl("animationend"),Bc=hl("animationiteration"),Uc=hl("animationstart"),qc=hl("transitionend"),Hc=new Map,Gc="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ia(i,l){Hc.set(i,l),o(l,[i])}for(var bu=0;bu<Gc.length;bu++){var wo=Gc[bu],dh=wo.toLowerCase(),wu=wo[0].toUpperCase()+wo.slice(1);ia(dh,"on"+wu)}ia(zc,"onAnimationEnd"),ia(Bc,"onAnimationIteration"),ia(Uc,"onAnimationStart"),ia("dblclick","onDoubleClick"),ia("focusin","onFocus"),ia("focusout","onBlur"),ia(qc,"onTransitionEnd"),s("onMouseEnter",["mouseout","mouseover"]),s("onMouseLeave",["mouseout","mouseover"]),s("onPointerEnter",["pointerout","pointerover"]),s("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fa="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),hh=new Set("cancel close invalid load scroll toggle".split(" ").concat(Fa));function _u(i,l,C){var D=i.type||"unknown-event";i.currentTarget=C,Jn(D,l,void 0,i),i.currentTarget=null}function Vc(i,l){l=(l&4)!==0;for(var C=0;C<i.length;C++){var D=i[C],H=D.event;D=D.listeners;e:{var K=void 0;if(l)for(var ie=D.length-1;0<=ie;ie--){var ce=D[ie],ge=ce.instance,Ne=ce.currentTarget;if(ce=ce.listener,ge!==K&&H.isPropagationStopped())break e;_u(H,ce,Ne),K=ge}else for(ie=0;ie<D.length;ie++){if(ce=D[ie],ge=ce.instance,Ne=ce.currentTarget,ce=ce.listener,ge!==K&&H.isPropagationStopped())break e;_u(H,ce,Ne),K=ge}}}if(Jt)throw i=Wt,Jt=!1,Wt=null,i}function ar(i,l){var C=l[Pu];C===void 0&&(C=l[Pu]=new Set);var D=i+"__bubble";C.has(D)||($c(l,i,2,!1),C.add(D))}function Su(i,l,C){var D=0;l&&(D|=4),$c(C,i,D,l)}var gs="_reactListening"+Math.random().toString(36).slice(2);function _o(i){if(!i[gs]){i[gs]=!0,r.forEach(function(C){C!=="selectionchange"&&(hh.has(C)||Su(C,!1,i),Su(C,!0,i))});var l=i.nodeType===9?i:i.ownerDocument;l===null||l[gs]||(l[gs]=!0,Su("selectionchange",!1,l))}}function $c(i,l,C,D){switch(th(l)){case 1:var H=mi;break;case 4:H=ea;break;default:H=al}C=H.bind(null,l,C,i),H=void 0,!Ye||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(H=!0),D?H!==void 0?i.addEventListener(l,C,{capture:!0,passive:H}):i.addEventListener(l,C,!0):H!==void 0?i.addEventListener(l,C,{passive:H}):i.addEventListener(l,C,!1)}function Eu(i,l,C,D,H){var K=D;if((l&1)===0&&(l&2)===0&&D!==null)e:for(;;){if(D===null)return;var ie=D.tag;if(ie===3||ie===4){var ce=D.stateNode.containerInfo;if(ce===H||ce.nodeType===8&&ce.parentNode===H)break;if(ie===4)for(ie=D.return;ie!==null;){var ge=ie.tag;if((ge===3||ge===4)&&(ge=ie.stateNode.containerInfo,ge===H||ge.nodeType===8&&ge.parentNode===H))return;ie=ie.return}for(;ce!==null;){if(ie=Ba(ce),ie===null)return;if(ge=ie.tag,ge===5||ge===6){D=K=ie;continue e}ce=ce.parentNode}}D=D.return}He(function(){var Ne=K,Ve=Fe(C),We=[];e:{var Ge=Hc.get(i);if(Ge!==void 0){var ot=yi,ft=i;switch(i){case"keypress":if(co(C)===0)break e;case"keydown":case"keyup":ot=oh;break;case"focusin":ft="focus",ot=su;break;case"focusout":ft="blur",ot=su;break;case"beforeblur":case"afterblur":ot=su;break;case"click":if(C.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ot=dr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ot=wi;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ot=du;break;case zc:case Bc:case Uc:ot=Ac;break;case qc:ot=ll;break;case"scroll":ot=rh;break;case"wheel":ot=Mc;break;case"copy":case"cut":case"paste":ot=uu;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ot=po}var pt=(l&4)!==0,Ur=!pt&&i==="scroll",Ae=pt?Ge!==null?Ge+"Capture":null:Ge;pt=[];for(var be=Ne,Re;be!==null;){Re=be;var Ze=Re.stateNode;if(Re.tag===5&&Ze!==null&&(Re=Ze,Ae!==null&&(Ze=Me(be,Ae),Ze!=null&&pt.push(pl(be,Ze,Re)))),Ur)break;be=be.return}0<pt.length&&(Ge=new ot(Ge,ft,null,C,Ve),We.push({event:Ge,listeners:pt}))}}if((l&7)===0){e:{if(Ge=i==="mouseover"||i==="pointerover",ot=i==="mouseout"||i==="pointerout",Ge&&C!==yt&&(ft=C.relatedTarget||C.fromElement)&&(Ba(ft)||ft[Fi]))break e;if((ot||Ge)&&(Ge=Ve.window===Ve?Ve:(Ge=Ve.ownerDocument)?Ge.defaultView||Ge.parentWindow:window,ot?(ft=C.relatedTarget||C.toElement,ot=Ne,ft=ft?Ba(ft):null,ft!==null&&(Ur=Nr(ft),ft!==Ur||ft.tag!==5&&ft.tag!==6)&&(ft=null)):(ot=null,ft=Ne),ot!==ft)){if(pt=dr,Ze="onMouseLeave",Ae="onMouseEnter",be="mouse",(i==="pointerout"||i==="pointerover")&&(pt=po,Ze="onPointerLeave",Ae="onPointerEnter",be="pointer"),Ur=ot==null?Ge:Dr(ot),Re=ft==null?Ge:Dr(ft),Ge=new pt(Ze,be+"leave",ot,C,Ve),Ge.target=Ur,Ge.relatedTarget=Re,Ze=null,Ba(Ve)===Ne&&(pt=new pt(Ae,be+"enter",ft,C,Ve),pt.target=Re,pt.relatedTarget=Ur,Ze=pt),Ur=Ze,ot&&ft)t:{for(pt=ot,Ae=ft,be=0,Re=pt;Re;Re=So(Re))be++;for(Re=0,Ze=Ae;Ze;Ze=So(Ze))Re++;for(;0<be-Re;)pt=So(pt),be--;for(;0<Re-be;)Ae=So(Ae),Re--;for(;be--;){if(pt===Ae||Ae!==null&&pt===Ae.alternate)break t;pt=So(pt),Ae=So(Ae)}pt=null}else pt=null;ot!==null&&ph(We,Ge,ot,pt,!1),ft!==null&&Ur!==null&&ph(We,Ur,ft,pt,!0)}}e:{if(Ge=Ne?Dr(Ne):window,ot=Ge.nodeName&&Ge.nodeName.toLowerCase(),ot==="select"||ot==="input"&&Ge.type==="file")var vt=ni;else if(na(Ge))if(cl)vt=Dc;else{vt=_r;var xt=jc}else(ot=Ge.nodeName)&&ot.toLowerCase()==="input"&&(Ge.type==="checkbox"||Ge.type==="radio")&&(vt=vu);if(vt&&(vt=vt(i,Ne))){fs(We,vt,C,Ve);break e}xt&&xt(i,Ge,Ne),i==="focusout"&&(xt=Ge._wrapperState)&&xt.controlled&&Ge.type==="number"&&_e(Ge,"number",Ge.value)}switch(xt=Ne?Dr(Ne):window,i){case"focusin":(na(xt)||xt.contentEditable==="true")&&(dl=xt,$r=Ne,yo=null);break;case"focusout":yo=$r=dl=null;break;case"mousedown":ps=!0;break;case"contextmenu":case"mouseup":case"dragend":ps=!1,mu(We,C,Ve);break;case"selectionchange":if(hs)break;case"keydown":case"keyup":mu(We,C,Ve)}var Ot;if(cs)e:{switch(i){case"compositionstart":var At="onCompositionStart";break e;case"compositionend":At="onCompositionEnd";break e;case"compositionupdate":At="onCompositionUpdate";break e}At=void 0}else qn?Lc(i,C)&&(At="onCompositionEnd"):i==="keydown"&&C.keyCode===229&&(At="onCompositionStart");At&&(Un&&C.locale!=="ko"&&(qn||At!=="onCompositionStart"?At==="onCompositionEnd"&&qn&&(Ot=os()):(Qr=Ve,Ma="value"in Qr?Qr.value:Qr.textContent,qn=!0)),xt=xu(Ne,At),0<xt.length&&(At=new fo(At,i,null,C,Ve),We.push({event:At,listeners:xt}),Ot?At.data=Ot:(Ot=_i(C),Ot!==null&&(At.data=Ot)))),(Ot=sl?Nc(i,C):ch(i,C))&&(Ne=xu(Ne,"onBeforeInput"),0<Ne.length&&(Ve=new fo("onBeforeInput","beforeinput",null,C,Ve),We.push({event:Ve,listeners:Ne}),Ve.data=Ot))}Vc(We,l)})}function pl(i,l,C){return{instance:i,listener:l,currentTarget:C}}function xu(i,l){for(var C=l+"Capture",D=[];i!==null;){var H=i,K=H.stateNode;H.tag===5&&K!==null&&(H=K,K=Me(i,C),K!=null&&D.unshift(pl(i,K,H)),K=Me(i,l),K!=null&&D.push(pl(i,K,H))),i=i.return}return D}function So(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function ph(i,l,C,D,H){for(var K=l._reactName,ie=[];C!==null&&C!==D;){var ce=C,ge=ce.alternate,Ne=ce.stateNode;if(ge!==null&&ge===D)break;ce.tag===5&&Ne!==null&&(ce=Ne,H?(ge=Me(C,K),ge!=null&&ie.unshift(pl(C,ge,ce))):H||(ge=Me(C,K),ge!=null&&ie.push(pl(C,ge,ce)))),C=C.return}ie.length!==0&&i.push({event:l,listeners:ie})}var rg=/\r\n?/g,gh=/\u0000|\uFFFD/g;function Wc(i){return(typeof i=="string"?i:""+i).replace(rg,`
30
- `).replace(gh,"")}function vs(i,l,C){if(l=Wc(l),Wc(i)!==l&&C)throw Error(t(425))}function Eo(){}var Yc=null,Kc=null;function Xc(i,l){return i==="textarea"||i==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var Gn=typeof setTimeout=="function"?setTimeout:void 0,Zc=typeof clearTimeout=="function"?clearTimeout:void 0,ms=typeof Promise=="function"?Promise:void 0,vh=typeof queueMicrotask=="function"?queueMicrotask:typeof ms<"u"?function(i){return ms.resolve(null).then(i).catch(mh)}:Gn;function mh(i){setTimeout(function(){throw i})}function Ou(i,l){var C=l,D=0;do{var H=C.nextSibling;if(i.removeChild(C),H&&H.nodeType===8)if(C=H.data,C==="/$"){if(D===0){i.removeChild(H),Ln(l);return}D--}else C!=="$"&&C!=="$?"&&C!=="$!"||D++;C=H}while(C);Ln(l)}function Di(i){for(;i!=null;i=i.nextSibling){var l=i.nodeType;if(l===1||l===3)break;if(l===8){if(l=i.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return i}function xo(i){i=i.previousSibling;for(var l=0;i;){if(i.nodeType===8){var C=i.data;if(C==="$"||C==="$!"||C==="$?"){if(l===0)return i;l--}else C==="/$"&&l++}i=i.previousSibling}return null}var za=Math.random().toString(36).slice(2),ai="__reactFiber$"+za,ys="__reactProps$"+za,Fi="__reactContainer$"+za,Pu="__reactEvents$"+za,yh="__reactListeners$"+za,bh="__reactHandles$"+za;function Ba(i){var l=i[ai];if(l)return l;for(var C=i.parentNode;C;){if(l=C[Fi]||C[ai]){if(C=l.alternate,l.child!==null||C!==null&&C.child!==null)for(i=xo(i);i!==null;){if(C=i[ai])return C;i=xo(i)}return l}i=C,C=i.parentNode}return null}function bs(i){return i=i[ai]||i[Fi],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function Dr(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(t(33))}function Wr(i){return i[ys]||null}var Cu=[],Oo=-1;function aa(i){return{current:i}}function or(i){0>Oo||(i.current=Cu[Oo],Cu[Oo]=null,Oo--)}function rr(i,l){Oo++,Cu[Oo]=i.current,i.current=l}var zi={},tn=aa(zi),cn=aa(!1),Ua=zi;function Po(i,l){var C=i.type.contextTypes;if(!C)return zi;var D=i.stateNode;if(D&&D.__reactInternalMemoizedUnmaskedChildContext===l)return D.__reactInternalMemoizedMaskedChildContext;var H={},K;for(K in C)H[K]=l[K];return D&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=l,i.__reactInternalMemoizedMaskedChildContext=H),H}function fn(i){return i=i.childContextTypes,i!=null}function gl(){or(cn),or(tn)}function Qc(i,l,C){if(tn.current!==zi)throw Error(t(168));rr(tn,l),rr(cn,C)}function ku(i,l,C){var D=i.stateNode;if(l=l.childContextTypes,typeof D.getChildContext!="function")return C;D=D.getChildContext();for(var H in D)if(!(H in l))throw Error(t(108,Z(i)||"Unknown",H));return q({},C,D)}function Co(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||zi,Ua=tn.current,rr(tn,i),rr(cn,cn.current),!0}function wh(i,l,C){var D=i.stateNode;if(!D)throw Error(t(169));C?(i=ku(i,l,Ua),D.__reactInternalMemoizedMergedChildContext=i,or(cn),or(tn),rr(tn,i)):or(cn),rr(cn,C)}var Bi=null,vl=!1,Au=!1;function ws(i){Bi===null?Bi=[i]:Bi.push(i)}function oa(i){vl=!0,ws(i)}function qa(){if(!Au&&Bi!==null){Au=!0;var i=0,l=$t;try{var C=Bi;for($t=1;i<C.length;i++){var D=C[i];do D=D(!0);while(D!==null)}Bi=null,vl=!1}catch(H){throw Bi!==null&&(Bi=Bi.slice(i+1)),Qs(so,qa),H}finally{$t=l,Au=!1}}return null}var Sn=[],ko=0,Ha=null,Ga=0,En=[],xn=0,Va=null,Vn=1,vr="";function Ao(i,l){Sn[ko++]=Ga,Sn[ko++]=Ha,Ha=i,Ga=l}function _h(i,l,C){En[xn++]=Vn,En[xn++]=vr,En[xn++]=Va,Va=i;var D=Vn;i=vr;var H=32-Ft(D)-1;D&=~(1<<H),C+=1;var K=32-Ft(l)+H;if(30<K){var ie=H-H%5;K=(D&(1<<ie)-1).toString(32),D>>=ie,H-=ie,Vn=1<<32-Ft(l)+H|C<<H|D,vr=K+i}else Vn=1<<K|C<<H|D,vr=i}function ml(i){i.return!==null&&(Ao(i,1),_h(i,1,0))}function Yr(i){for(;i===Ha;)Ha=Sn[--ko],Sn[ko]=null,Ga=Sn[--ko],Sn[ko]=null;for(;i===Va;)Va=En[--xn],En[xn]=null,vr=En[--xn],En[xn]=null,Vn=En[--xn],En[xn]=null}var $n=null,tt=null,Zt=!1,Wn=null;function Jc(i,l){var C=Wi(5,null,null,0);C.elementType="DELETED",C.stateNode=l,C.return=i,l=i.deletions,l===null?(i.deletions=[C],i.flags|=16):l.push(C)}function Sh(i,l){switch(i.tag){case 5:var C=i.type;return l=l.nodeType!==1||C.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(i.stateNode=l,$n=i,tt=Di(l.firstChild),!0):!1;case 6:return l=i.pendingProps===""||l.nodeType!==3?null:l,l!==null?(i.stateNode=l,$n=i,tt=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(C=Va!==null?{id:Vn,overflow:vr}:null,i.memoizedState={dehydrated:l,treeContext:C,retryLane:1073741824},C=Wi(18,null,null,0),C.stateNode=l,C.return=i,i.child=C,$n=i,tt=null,!0):!1;default:return!1}}function To(i){return(i.mode&1)!==0&&(i.flags&128)===0}function yl(i){if(Zt){var l=tt;if(l){var C=l;if(!Sh(i,l)){if(To(i))throw Error(t(418));l=Di(C.nextSibling);var D=$n;l&&Sh(i,l)?Jc(D,C):(i.flags=i.flags&-4097|2,Zt=!1,$n=i)}}else{if(To(i))throw Error(t(418));i.flags=i.flags&-4097|2,Zt=!1,$n=i}}}function Tu(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;$n=i}function _s(i){if(i!==$n)return!1;if(!Zt)return Tu(i),Zt=!0,!1;var l;if((l=i.tag!==3)&&!(l=i.tag!==5)&&(l=i.type,l=l!=="head"&&l!=="body"&&!Xc(i.type,i.memoizedProps)),l&&(l=tt)){if(To(i))throw ef(),Error(t(418));for(;l;)Jc(i,l),l=Di(l.nextSibling)}if(Tu(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(t(317));e:{for(i=i.nextSibling,l=0;i;){if(i.nodeType===8){var C=i.data;if(C==="/$"){if(l===0){tt=Di(i.nextSibling);break e}l--}else C!=="$"&&C!=="$!"&&C!=="$?"||l++}i=i.nextSibling}tt=null}}else tt=$n?Di(i.stateNode.nextSibling):null;return!0}function ef(){for(var i=tt;i;)i=Di(i.nextSibling)}function Ro(){tt=$n=null,Zt=!1}function Ss(i){Wn===null?Wn=[i]:Wn.push(i)}var tf=d.ReactCurrentBatchConfig;function Cr(i,l,C){if(i=C.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(C._owner){if(C=C._owner,C){if(C.tag!==1)throw Error(t(309));var D=C.stateNode}if(!D)throw Error(t(147,i));var H=D,K=""+i;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===K?l.ref:(l=function(ie){var ce=H.refs;ie===null?delete ce[K]:ce[K]=ie},l._stringRef=K,l)}if(typeof i!="string")throw Error(t(284));if(!C._owner)throw Error(t(290,i))}return i}function jn(i,l){throw i=Object.prototype.toString.call(l),Error(t(31,i==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":i))}function Si(i){var l=i._init;return l(i._payload)}function Ru(i){function l(Ae,be){if(i){var Re=Ae.deletions;Re===null?(Ae.deletions=[be],Ae.flags|=16):Re.push(be)}}function C(Ae,be){if(!i)return null;for(;be!==null;)l(Ae,be),be=be.sibling;return null}function D(Ae,be){for(Ae=new Map;be!==null;)be.key!==null?Ae.set(be.key,be):Ae.set(be.index,be),be=be.sibling;return Ae}function H(Ae,be){return Ae=Fl(Ae,be),Ae.index=0,Ae.sibling=null,Ae}function K(Ae,be,Re){return Ae.index=Re,i?(Re=Ae.alternate,Re!==null?(Re=Re.index,Re<be?(Ae.flags|=2,be):Re):(Ae.flags|=2,be)):(Ae.flags|=1048576,be)}function ie(Ae){return i&&Ae.alternate===null&&(Ae.flags|=2),Ae}function ce(Ae,be,Re,Ze){return be===null||be.tag!==6?(be=Eg(Re,Ae.mode,Ze),be.return=Ae,be):(be=H(be,Re),be.return=Ae,be)}function ge(Ae,be,Re,Ze){var vt=Re.type;return vt===T?Ve(Ae,be,Re.props.children,Ze,Re.key):be!==null&&(be.elementType===vt||typeof vt=="object"&&vt!==null&&vt.$$typeof===V&&Si(vt)===be.type)?(Ze=H(be,Re.props),Ze.ref=Cr(Ae,be,Re),Ze.return=Ae,Ze):(Ze=Hh(Re.type,Re.key,Re.props,null,Ae.mode,Ze),Ze.ref=Cr(Ae,be,Re),Ze.return=Ae,Ze)}function Ne(Ae,be,Re,Ze){return be===null||be.tag!==4||be.stateNode.containerInfo!==Re.containerInfo||be.stateNode.implementation!==Re.implementation?(be=xg(Re,Ae.mode,Ze),be.return=Ae,be):(be=H(be,Re.children||[]),be.return=Ae,be)}function Ve(Ae,be,Re,Ze,vt){return be===null||be.tag!==7?(be=Ls(Re,Ae.mode,Ze,vt),be.return=Ae,be):(be=H(be,Re),be.return=Ae,be)}function We(Ae,be,Re){if(typeof be=="string"&&be!==""||typeof be=="number")return be=Eg(""+be,Ae.mode,Re),be.return=Ae,be;if(typeof be=="object"&&be!==null){switch(be.$$typeof){case P:return Re=Hh(be.type,be.key,be.props,null,Ae.mode,Re),Re.ref=Cr(Ae,null,be),Re.return=Ae,Re;case M:return be=xg(be,Ae.mode,Re),be.return=Ae,be;case V:var Ze=be._init;return We(Ae,Ze(be._payload),Re)}if(he(be)||X(be))return be=Ls(be,Ae.mode,Re,null),be.return=Ae,be;jn(Ae,be)}return null}function Ge(Ae,be,Re,Ze){var vt=be!==null?be.key:null;if(typeof Re=="string"&&Re!==""||typeof Re=="number")return vt!==null?null:ce(Ae,be,""+Re,Ze);if(typeof Re=="object"&&Re!==null){switch(Re.$$typeof){case P:return Re.key===vt?ge(Ae,be,Re,Ze):null;case M:return Re.key===vt?Ne(Ae,be,Re,Ze):null;case V:return vt=Re._init,Ge(Ae,be,vt(Re._payload),Ze)}if(he(Re)||X(Re))return vt!==null?null:Ve(Ae,be,Re,Ze,null);jn(Ae,Re)}return null}function ot(Ae,be,Re,Ze,vt){if(typeof Ze=="string"&&Ze!==""||typeof Ze=="number")return Ae=Ae.get(Re)||null,ce(be,Ae,""+Ze,vt);if(typeof Ze=="object"&&Ze!==null){switch(Ze.$$typeof){case P:return Ae=Ae.get(Ze.key===null?Re:Ze.key)||null,ge(be,Ae,Ze,vt);case M:return Ae=Ae.get(Ze.key===null?Re:Ze.key)||null,Ne(be,Ae,Ze,vt);case V:var xt=Ze._init;return ot(Ae,be,Re,xt(Ze._payload),vt)}if(he(Ze)||X(Ze))return Ae=Ae.get(Re)||null,Ve(be,Ae,Ze,vt,null);jn(be,Ze)}return null}function ft(Ae,be,Re,Ze){for(var vt=null,xt=null,Ot=be,At=be=0,mn=null;Ot!==null&&At<Re.length;At++){Ot.index>At?(mn=Ot,Ot=null):mn=Ot.sibling;var Kt=Ge(Ae,Ot,Re[At],Ze);if(Kt===null){Ot===null&&(Ot=mn);break}i&&Ot&&Kt.alternate===null&&l(Ae,Ot),be=K(Kt,be,At),xt===null?vt=Kt:xt.sibling=Kt,xt=Kt,Ot=mn}if(At===Re.length)return C(Ae,Ot),Zt&&Ao(Ae,At),vt;if(Ot===null){for(;At<Re.length;At++)Ot=We(Ae,Re[At],Ze),Ot!==null&&(be=K(Ot,be,At),xt===null?vt=Ot:xt.sibling=Ot,xt=Ot);return Zt&&Ao(Ae,At),vt}for(Ot=D(Ae,Ot);At<Re.length;At++)mn=ot(Ot,Ae,At,Re[At],Ze),mn!==null&&(i&&mn.alternate!==null&&Ot.delete(mn.key===null?At:mn.key),be=K(mn,be,At),xt===null?vt=mn:xt.sibling=mn,xt=mn);return i&&Ot.forEach(function(zl){return l(Ae,zl)}),Zt&&Ao(Ae,At),vt}function pt(Ae,be,Re,Ze){var vt=X(Re);if(typeof vt!="function")throw Error(t(150));if(Re=vt.call(Re),Re==null)throw Error(t(151));for(var xt=vt=null,Ot=be,At=be=0,mn=null,Kt=Re.next();Ot!==null&&!Kt.done;At++,Kt=Re.next()){Ot.index>At?(mn=Ot,Ot=null):mn=Ot.sibling;var zl=Ge(Ae,Ot,Kt.value,Ze);if(zl===null){Ot===null&&(Ot=mn);break}i&&Ot&&zl.alternate===null&&l(Ae,Ot),be=K(zl,be,At),xt===null?vt=zl:xt.sibling=zl,xt=zl,Ot=mn}if(Kt.done)return C(Ae,Ot),Zt&&Ao(Ae,At),vt;if(Ot===null){for(;!Kt.done;At++,Kt=Re.next())Kt=We(Ae,Kt.value,Ze),Kt!==null&&(be=K(Kt,be,At),xt===null?vt=Kt:xt.sibling=Kt,xt=Kt);return Zt&&Ao(Ae,At),vt}for(Ot=D(Ae,Ot);!Kt.done;At++,Kt=Re.next())Kt=ot(Ot,Ae,At,Kt.value,Ze),Kt!==null&&(i&&Kt.alternate!==null&&Ot.delete(Kt.key===null?At:Kt.key),be=K(Kt,be,At),xt===null?vt=Kt:xt.sibling=Kt,xt=Kt);return i&&Ot.forEach(function(T_){return l(Ae,T_)}),Zt&&Ao(Ae,At),vt}function Ur(Ae,be,Re,Ze){if(typeof Re=="object"&&Re!==null&&Re.type===T&&Re.key===null&&(Re=Re.props.children),typeof Re=="object"&&Re!==null){switch(Re.$$typeof){case P:e:{for(var vt=Re.key,xt=be;xt!==null;){if(xt.key===vt){if(vt=Re.type,vt===T){if(xt.tag===7){C(Ae,xt.sibling),be=H(xt,Re.props.children),be.return=Ae,Ae=be;break e}}else if(xt.elementType===vt||typeof vt=="object"&&vt!==null&&vt.$$typeof===V&&Si(vt)===xt.type){C(Ae,xt.sibling),be=H(xt,Re.props),be.ref=Cr(Ae,xt,Re),be.return=Ae,Ae=be;break e}C(Ae,xt);break}else l(Ae,xt);xt=xt.sibling}Re.type===T?(be=Ls(Re.props.children,Ae.mode,Ze,Re.key),be.return=Ae,Ae=be):(Ze=Hh(Re.type,Re.key,Re.props,null,Ae.mode,Ze),Ze.ref=Cr(Ae,be,Re),Ze.return=Ae,Ae=Ze)}return ie(Ae);case M:e:{for(xt=Re.key;be!==null;){if(be.key===xt)if(be.tag===4&&be.stateNode.containerInfo===Re.containerInfo&&be.stateNode.implementation===Re.implementation){C(Ae,be.sibling),be=H(be,Re.children||[]),be.return=Ae,Ae=be;break e}else{C(Ae,be);break}else l(Ae,be);be=be.sibling}be=xg(Re,Ae.mode,Ze),be.return=Ae,Ae=be}return ie(Ae);case V:return xt=Re._init,Ur(Ae,be,xt(Re._payload),Ze)}if(he(Re))return ft(Ae,be,Re,Ze);if(X(Re))return pt(Ae,be,Re,Ze);jn(Ae,Re)}return typeof Re=="string"&&Re!==""||typeof Re=="number"?(Re=""+Re,be!==null&&be.tag===6?(C(Ae,be.sibling),be=H(be,Re),be.return=Ae,Ae=be):(C(Ae,be),be=Eg(Re,Ae.mode,Ze),be.return=Ae,Ae=be),ie(Ae)):C(Ae,be)}return Ur}var Mo=Ru(!0),oi=Ru(!1),Es=aa(null),Yn=null,bl=null,Mu=null;function Lu(){Mu=bl=Yn=null}function Nu(i){var l=Es.current;or(Es),i._currentValue=l}function Iu(i,l,C){for(;i!==null;){var D=i.alternate;if((i.childLanes&l)!==l?(i.childLanes|=l,D!==null&&(D.childLanes|=l)):D!==null&&(D.childLanes&l)!==l&&(D.childLanes|=l),i===C)break;i=i.return}}function la(i,l){Yn=i,Mu=bl=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&l)!==0&&(J=!0),i.firstContext=null)}function On(i){var l=i._currentValue;if(Mu!==i)if(i={context:i,memoizedValue:l,next:null},bl===null){if(Yn===null)throw Error(t(308));bl=i,Yn.dependencies={lanes:0,firstContext:i}}else bl=bl.next=i;return l}var Ui=null;function wl(i){Ui===null?Ui=[i]:Ui.push(i)}function xs(i,l,C,D){var H=l.interleaved;return H===null?(C.next=C,wl(l)):(C.next=H.next,H.next=C),l.interleaved=C,Kn(i,D)}function Kn(i,l){i.lanes|=l;var C=i.alternate;for(C!==null&&(C.lanes|=l),C=i,i=i.return;i!==null;)i.childLanes|=l,C=i.alternate,C!==null&&(C.childLanes|=l),C=i,i=i.return;return C.tag===3?C.stateNode:null}var qi=!1;function Os(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ju(i,l){i=i.updateQueue,l.updateQueue===i&&(l.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function Hi(i,l){return{eventTime:i,lane:l,tag:0,payload:null,callback:null,next:null}}function Gi(i,l,C){var D=i.updateQueue;if(D===null)return null;if(D=D.shared,(Yt&2)!==0){var H=D.pending;return H===null?l.next=l:(l.next=H.next,H.next=l),D.pending=l,Kn(i,C)}return H=D.interleaved,H===null?(l.next=l,wl(D)):(l.next=H.next,H.next=l),D.interleaved=l,Kn(i,C)}function Du(i,l,C){if(l=l.updateQueue,l!==null&&(l=l.shared,(C&4194240)!==0)){var D=l.lanes;D&=i.pendingLanes,C|=D,l.lanes=C,Cc(i,C)}}function Ps(i,l){var C=i.updateQueue,D=i.alternate;if(D!==null&&(D=D.updateQueue,C===D)){var H=null,K=null;if(C=C.firstBaseUpdate,C!==null){do{var ie={eventTime:C.eventTime,lane:C.lane,tag:C.tag,payload:C.payload,callback:C.callback,next:null};K===null?H=K=ie:K=K.next=ie,C=C.next}while(C!==null);K===null?H=K=l:K=K.next=l}else H=K=l;C={baseState:D.baseState,firstBaseUpdate:H,lastBaseUpdate:K,shared:D.shared,effects:D.effects},i.updateQueue=C;return}i=C.lastBaseUpdate,i===null?C.firstBaseUpdate=l:i.next=l,C.lastBaseUpdate=l}function _l(i,l,C,D){var H=i.updateQueue;qi=!1;var K=H.firstBaseUpdate,ie=H.lastBaseUpdate,ce=H.shared.pending;if(ce!==null){H.shared.pending=null;var ge=ce,Ne=ge.next;ge.next=null,ie===null?K=Ne:ie.next=Ne,ie=ge;var Ve=i.alternate;Ve!==null&&(Ve=Ve.updateQueue,ce=Ve.lastBaseUpdate,ce!==ie&&(ce===null?Ve.firstBaseUpdate=Ne:ce.next=Ne,Ve.lastBaseUpdate=ge))}if(K!==null){var We=H.baseState;ie=0,Ve=Ne=ge=null,ce=K;do{var Ge=ce.lane,ot=ce.eventTime;if((D&Ge)===Ge){Ve!==null&&(Ve=Ve.next={eventTime:ot,lane:0,tag:ce.tag,payload:ce.payload,callback:ce.callback,next:null});e:{var ft=i,pt=ce;switch(Ge=l,ot=C,pt.tag){case 1:if(ft=pt.payload,typeof ft=="function"){We=ft.call(ot,We,Ge);break e}We=ft;break e;case 3:ft.flags=ft.flags&-65537|128;case 0:if(ft=pt.payload,Ge=typeof ft=="function"?ft.call(ot,We,Ge):ft,Ge==null)break e;We=q({},We,Ge);break e;case 2:qi=!0}}ce.callback!==null&&ce.lane!==0&&(i.flags|=64,Ge=H.effects,Ge===null?H.effects=[ce]:Ge.push(ce))}else ot={eventTime:ot,lane:Ge,tag:ce.tag,payload:ce.payload,callback:ce.callback,next:null},Ve===null?(Ne=Ve=ot,ge=We):Ve=Ve.next=ot,ie|=Ge;if(ce=ce.next,ce===null){if(ce=H.shared.pending,ce===null)break;Ge=ce,ce=Ge.next,Ge.next=null,H.lastBaseUpdate=Ge,H.shared.pending=null}}while(!0);if(Ve===null&&(ge=We),H.baseState=ge,H.firstBaseUpdate=Ne,H.lastBaseUpdate=Ve,l=H.shared.interleaved,l!==null){H=l;do ie|=H.lane,H=H.next;while(H!==l)}else K===null&&(H.shared.lanes=0);As|=ie,i.lanes=ie,i.memoizedState=We}}function Er(i,l,C){if(i=l.effects,l.effects=null,i!==null)for(l=0;l<i.length;l++){var D=i[l],H=D.callback;if(H!==null){if(D.callback=null,D=C,typeof H!="function")throw Error(t(191,H));H.call(D)}}}var Mt={},nr=aa(Mt),mr=aa(Mt),kr=aa(Mt);function Fr(i){if(i===Mt)throw Error(t(174));return i}function $a(i,l){switch(rr(kr,l),rr(mr,i),rr(nr,Mt),i=l.nodeType,i){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:Qe(null,"");break;default:i=i===8?l.parentNode:l,l=i.namespaceURI||null,i=i.tagName,l=Qe(l,i)}or(nr),rr(nr,l)}function yr(){or(nr),or(mr),or(kr)}function Sl(i){Fr(kr.current);var l=Fr(nr.current),C=Qe(l,i.type);l!==C&&(rr(mr,i),rr(nr,C))}function sa(i){mr.current===i&&(or(nr),or(mr))}var lr=aa(0);function El(i){for(var l=i;l!==null;){if(l.tag===13){var C=l.memoizedState;if(C!==null&&(C=C.dehydrated,C===null||C.data==="$?"||C.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Lo=[];function dn(){for(var i=0;i<Lo.length;i++)Lo[i]._workInProgressVersionPrimary=null;Lo.length=0}var xl=d.ReactCurrentDispatcher,Cs=d.ReactCurrentBatchConfig,Pn=0,tr=null,xr=null,Tr=null,Ei=!1,Wa=!1,li=0,Fu=0;function Rr(){throw Error(t(321))}function ks(i,l){if(l===null)return!1;for(var C=0;C<l.length&&C<i.length;C++)if(!In(i[C],l[C]))return!1;return!0}function Ol(i,l,C,D,H,K){if(Pn=K,tr=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,xl.current=i===null||i.memoizedState===null?ig:Xa,i=C(D,H),Wa){K=0;do{if(Wa=!1,li=0,25<=K)throw Error(t(301));K+=1,Tr=xr=null,l.updateQueue=null,xl.current=Hu,i=C(D,H)}while(Wa)}if(xl.current=Al,l=xr!==null&&xr.next!==null,Pn=0,Tr=xr=tr=null,Ei=!1,l)throw Error(t(300));return i}function Pl(){var i=li!==0;return li=0,i}function hr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tr===null?tr.memoizedState=Tr=i:Tr=Tr.next=i,Tr}function zr(){if(xr===null){var i=tr.alternate;i=i!==null?i.memoizedState:null}else i=xr.next;var l=Tr===null?tr.memoizedState:Tr.next;if(l!==null)Tr=l,xr=i;else{if(i===null)throw Error(t(310));xr=i,i={memoizedState:xr.memoizedState,baseState:xr.baseState,baseQueue:xr.baseQueue,queue:xr.queue,next:null},Tr===null?tr.memoizedState=Tr=i:Tr=Tr.next=i}return Tr}function hn(i,l){return typeof l=="function"?l(i):l}function pn(i){var l=zr(),C=l.queue;if(C===null)throw Error(t(311));C.lastRenderedReducer=i;var D=xr,H=D.baseQueue,K=C.pending;if(K!==null){if(H!==null){var ie=H.next;H.next=K.next,K.next=ie}D.baseQueue=H=K,C.pending=null}if(H!==null){K=H.next,D=D.baseState;var ce=ie=null,ge=null,Ne=K;do{var Ve=Ne.lane;if((Pn&Ve)===Ve)ge!==null&&(ge=ge.next={lane:0,action:Ne.action,hasEagerState:Ne.hasEagerState,eagerState:Ne.eagerState,next:null}),D=Ne.hasEagerState?Ne.eagerState:i(D,Ne.action);else{var We={lane:Ve,action:Ne.action,hasEagerState:Ne.hasEagerState,eagerState:Ne.eagerState,next:null};ge===null?(ce=ge=We,ie=D):ge=ge.next=We,tr.lanes|=Ve,As|=Ve}Ne=Ne.next}while(Ne!==null&&Ne!==K);ge===null?ie=D:ge.next=ce,In(D,l.memoizedState)||(J=!0),l.memoizedState=D,l.baseState=ie,l.baseQueue=ge,C.lastRenderedState=D}if(i=C.interleaved,i!==null){H=i;do K=H.lane,tr.lanes|=K,As|=K,H=H.next;while(H!==i)}else H===null&&(C.lanes=0);return[l.memoizedState,C.dispatch]}function zu(i){var l=zr(),C=l.queue;if(C===null)throw Error(t(311));C.lastRenderedReducer=i;var D=C.dispatch,H=C.pending,K=l.memoizedState;if(H!==null){C.pending=null;var ie=H=H.next;do K=i(K,ie.action),ie=ie.next;while(ie!==H);In(K,l.memoizedState)||(J=!0),l.memoizedState=K,l.baseQueue===null&&(l.baseState=K),C.lastRenderedState=K}return[K,D]}function Bu(){}function Uu(i,l){var C=tr,D=zr(),H=l(),K=!In(D.memoizedState,H);if(K&&(D.memoizedState=H,J=!0),D=D.queue,of(rf.bind(null,C,D,i),[i]),D.getSnapshot!==l||K||Tr!==null&&Tr.memoizedState.tag&1){if(C.flags|=2048,Cl(9,ua.bind(null,C,D,H,l),void 0,null),vn===null)throw Error(t(349));(Pn&30)!==0||Eh(C,l,H)}return H}function Eh(i,l,C){i.flags|=16384,i={getSnapshot:l,value:C},l=tr.updateQueue,l===null?(l={lastEffect:null,stores:null},tr.updateQueue=l,l.stores=[i]):(C=l.stores,C===null?l.stores=[i]:C.push(i))}function ua(i,l,C,D){l.value=C,l.getSnapshot=D,nf(l)&&qu(i)}function rf(i,l,C){return C(function(){nf(l)&&qu(i)})}function nf(i){var l=i.getSnapshot;i=i.value;try{var C=l();return!In(i,C)}catch{return!0}}function qu(i){var l=Kn(i,1);l!==null&&ha(l,i,1,-1)}function Ya(i){var l=hr();return typeof i=="function"&&(i=i()),l.memoizedState=l.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:hn,lastRenderedState:i},l.queue=i,i=i.dispatch=Ah.bind(null,tr,i),[l.memoizedState,i]}function Cl(i,l,C,D){return i={tag:i,create:l,destroy:C,deps:D,next:null},l=tr.updateQueue,l===null?(l={lastEffect:null,stores:null},tr.updateQueue=l,l.lastEffect=i.next=i):(C=l.lastEffect,C===null?l.lastEffect=i.next=i:(D=C.next,C.next=i,i.next=D,l.lastEffect=i)),i}function af(){return zr().memoizedState}function kl(i,l,C,D){var H=hr();tr.flags|=i,H.memoizedState=Cl(1|l,C,void 0,D===void 0?null:D)}function No(i,l,C,D){var H=zr();D=D===void 0?null:D;var K=void 0;if(xr!==null){var ie=xr.memoizedState;if(K=ie.destroy,D!==null&&ks(D,ie.deps)){H.memoizedState=Cl(l,C,K,D);return}}tr.flags|=i,H.memoizedState=Cl(1|l,C,K,D)}function xh(i,l){return kl(8390656,8,i,l)}function of(i,l){return No(2048,8,i,l)}function lf(i,l){return No(4,2,i,l)}function sf(i,l){return No(4,4,i,l)}function Ka(i,l){if(typeof l=="function")return i=i(),l(i),function(){l(null)};if(l!=null)return i=i(),l.current=i,function(){l.current=null}}function Oh(i,l,C){return C=C!=null?C.concat([i]):null,No(4,4,Ka.bind(null,l,i),C)}function ca(){}function uf(i,l){var C=zr();l=l===void 0?null:l;var D=C.memoizedState;return D!==null&&l!==null&&ks(l,D[1])?D[0]:(C.memoizedState=[i,l],i)}function pr(i,l){var C=zr();l=l===void 0?null:l;var D=C.memoizedState;return D!==null&&l!==null&&ks(l,D[1])?D[0]:(i=i(),C.memoizedState=[i,l],i)}function Ph(i,l,C){return(Pn&21)===0?(i.baseState&&(i.baseState=!1,J=!0),i.memoizedState=C):(In(C,l)||(C=Pc(),tr.lanes|=C,As|=C,i.baseState=!0),l)}function Ch(i,l){var C=$t;$t=C!==0&&4>C?C:4,i(!0);var D=Cs.transition;Cs.transition={};try{i(!1),l()}finally{$t=C,Cs.transition=D}}function kh(){return zr().memoizedState}function ng(i,l,C){var D=jl(i);if(C={lane:D,action:C,hasEagerState:!1,eagerState:null,next:null},cf(i))Th(l,C);else if(C=xs(i,l,C,D),C!==null){var H=Zn();ha(C,i,D,H),Xn(C,l,D)}}function Ah(i,l,C){var D=jl(i),H={lane:D,action:C,hasEagerState:!1,eagerState:null,next:null};if(cf(i))Th(l,H);else{var K=i.alternate;if(i.lanes===0&&(K===null||K.lanes===0)&&(K=l.lastRenderedReducer,K!==null))try{var ie=l.lastRenderedState,ce=K(ie,C);if(H.hasEagerState=!0,H.eagerState=ce,In(ce,ie)){var ge=l.interleaved;ge===null?(H.next=H,wl(l)):(H.next=ge.next,ge.next=H),l.interleaved=H;return}}catch{}finally{}C=xs(i,l,H,D),C!==null&&(H=Zn(),ha(C,i,D,H),Xn(C,l,D))}}function cf(i){var l=i.alternate;return i===tr||l!==null&&l===tr}function Th(i,l){Wa=Ei=!0;var C=i.pending;C===null?l.next=l:(l.next=C.next,C.next=l),i.pending=l}function Xn(i,l,C){if((C&4194240)!==0){var D=l.lanes;D&=i.pendingLanes,C|=D,l.lanes=C,Cc(i,C)}}var Al={readContext:On,useCallback:Rr,useContext:Rr,useEffect:Rr,useImperativeHandle:Rr,useInsertionEffect:Rr,useLayoutEffect:Rr,useMemo:Rr,useReducer:Rr,useRef:Rr,useState:Rr,useDebugValue:Rr,useDeferredValue:Rr,useTransition:Rr,useMutableSource:Rr,useSyncExternalStore:Rr,useId:Rr,unstable_isNewReconciler:!1},ig={readContext:On,useCallback:function(i,l){return hr().memoizedState=[i,l===void 0?null:l],i},useContext:On,useEffect:xh,useImperativeHandle:function(i,l,C){return C=C!=null?C.concat([i]):null,kl(4194308,4,Ka.bind(null,l,i),C)},useLayoutEffect:function(i,l){return kl(4194308,4,i,l)},useInsertionEffect:function(i,l){return kl(4,2,i,l)},useMemo:function(i,l){var C=hr();return l=l===void 0?null:l,i=i(),C.memoizedState=[i,l],i},useReducer:function(i,l,C){var D=hr();return l=C!==void 0?C(l):l,D.memoizedState=D.baseState=l,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:l},D.queue=i,i=i.dispatch=ng.bind(null,tr,i),[D.memoizedState,i]},useRef:function(i){var l=hr();return i={current:i},l.memoizedState=i},useState:Ya,useDebugValue:ca,useDeferredValue:function(i){return hr().memoizedState=i},useTransition:function(){var i=Ya(!1),l=i[0];return i=Ch.bind(null,i[1]),hr().memoizedState=i,[l,i]},useMutableSource:function(){},useSyncExternalStore:function(i,l,C){var D=tr,H=hr();if(Zt){if(C===void 0)throw Error(t(407));C=C()}else{if(C=l(),vn===null)throw Error(t(349));(Pn&30)!==0||Eh(D,l,C)}H.memoizedState=C;var K={value:C,getSnapshot:l};return H.queue=K,xh(rf.bind(null,D,K,i),[i]),D.flags|=2048,Cl(9,ua.bind(null,D,K,C,l),void 0,null),C},useId:function(){var i=hr(),l=vn.identifierPrefix;if(Zt){var C=vr,D=Vn;C=(D&~(1<<32-Ft(D)-1)).toString(32)+C,l=":"+l+"R"+C,C=li++,0<C&&(l+="H"+C.toString(32)),l+=":"}else C=Fu++,l=":"+l+"r"+C.toString(32)+":";return i.memoizedState=l},unstable_isNewReconciler:!1},Xa={readContext:On,useCallback:uf,useContext:On,useEffect:of,useImperativeHandle:Oh,useInsertionEffect:lf,useLayoutEffect:sf,useMemo:pr,useReducer:pn,useRef:af,useState:function(){return pn(hn)},useDebugValue:ca,useDeferredValue:function(i){var l=zr();return Ph(l,xr.memoizedState,i)},useTransition:function(){var i=pn(hn)[0],l=zr().memoizedState;return[i,l]},useMutableSource:Bu,useSyncExternalStore:Uu,useId:kh,unstable_isNewReconciler:!1},Hu={readContext:On,useCallback:uf,useContext:On,useEffect:of,useImperativeHandle:Oh,useInsertionEffect:lf,useLayoutEffect:sf,useMemo:pr,useReducer:zu,useRef:af,useState:function(){return zu(hn)},useDebugValue:ca,useDeferredValue:function(i){var l=zr();return xr===null?l.memoizedState=i:Ph(l,xr.memoizedState,i)},useTransition:function(){var i=zu(hn)[0],l=zr().memoizedState;return[i,l]},useMutableSource:Bu,useSyncExternalStore:Uu,useId:kh,unstable_isNewReconciler:!1};function rn(i,l){if(i&&i.defaultProps){l=q({},l),i=i.defaultProps;for(var C in i)l[C]===void 0&&(l[C]=i[C]);return l}return l}function Tl(i,l,C,D){l=i.memoizedState,C=C(D,l),C=C==null?l:q({},l,C),i.memoizedState=C,i.lanes===0&&(i.updateQueue.baseState=C)}var Rl={isMounted:function(i){return(i=i._reactInternals)?Nr(i)===i:!1},enqueueSetState:function(i,l,C){i=i._reactInternals;var D=Zn(),H=jl(i),K=Hi(D,H);K.payload=l,C!=null&&(K.callback=C),l=Gi(i,K,H),l!==null&&(ha(l,i,H,D),Du(l,i,H))},enqueueReplaceState:function(i,l,C){i=i._reactInternals;var D=Zn(),H=jl(i),K=Hi(D,H);K.tag=1,K.payload=l,C!=null&&(K.callback=C),l=Gi(i,K,H),l!==null&&(ha(l,i,H,D),Du(l,i,H))},enqueueForceUpdate:function(i,l){i=i._reactInternals;var C=Zn(),D=jl(i),H=Hi(C,D);H.tag=2,l!=null&&(H.callback=l),l=Gi(i,H,D),l!==null&&(ha(l,i,D,C),Du(l,i,D))}};function Gu(i,l,C,D,H,K,ie){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(D,K,ie):l.prototype&&l.prototype.isPureReactComponent?!mo(C,D)||!mo(H,K):!0}function Rh(i,l,C){var D=!1,H=zi,K=l.contextType;return typeof K=="object"&&K!==null?K=On(K):(H=fn(l)?Ua:tn.current,D=l.contextTypes,K=(D=D!=null)?Po(i,H):zi),l=new l(C,K),i.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Rl,i.stateNode=l,l._reactInternals=i,D&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=H,i.__reactInternalMemoizedMaskedChildContext=K),l}function ff(i,l,C,D){i=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(C,D),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(C,D),l.state!==i&&Rl.enqueueReplaceState(l,l.state,null)}function Vu(i,l,C,D){var H=i.stateNode;H.props=C,H.state=i.memoizedState,H.refs={},Os(i);var K=l.contextType;typeof K=="object"&&K!==null?H.context=On(K):(K=fn(l)?Ua:tn.current,H.context=Po(i,K)),H.state=i.memoizedState,K=l.getDerivedStateFromProps,typeof K=="function"&&(Tl(i,l,K,C),H.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof H.getSnapshotBeforeUpdate=="function"||typeof H.UNSAFE_componentWillMount!="function"&&typeof H.componentWillMount!="function"||(l=H.state,typeof H.componentWillMount=="function"&&H.componentWillMount(),typeof H.UNSAFE_componentWillMount=="function"&&H.UNSAFE_componentWillMount(),l!==H.state&&Rl.enqueueReplaceState(H,H.state,null),_l(i,C,H,D),H.state=i.memoizedState),typeof H.componentDidMount=="function"&&(i.flags|=4194308)}function Io(i,l){try{var C="",D=l;do C+=te(D),D=D.return;while(D);var H=C}catch(K){H=`
31
- Error generating stack: `+K.message+`
32
- `+K.stack}return{value:i,source:l,stack:H,digest:null}}function $u(i,l,C){return{value:i,source:null,stack:C??null,digest:l??null}}function Ml(i,l){try{console.error(l.value)}catch(C){setTimeout(function(){throw C})}}var ag=typeof WeakMap=="function"?WeakMap:Map;function Mh(i,l,C){C=Hi(-1,C),C.tag=3,C.payload={element:null};var D=l.value;return C.callback=function(){Dh||(Dh=!0,gg=D),Ml(i,l)},C}function u(i,l,C){C=Hi(-1,C),C.tag=3;var D=i.type.getDerivedStateFromError;if(typeof D=="function"){var H=l.value;C.payload=function(){return D(H)},C.callback=function(){Ml(i,l)}}var K=i.stateNode;return K!==null&&typeof K.componentDidCatch=="function"&&(C.callback=function(){Ml(i,l),typeof D!="function"&&(Nl===null?Nl=new Set([this]):Nl.add(this));var ie=l.stack;this.componentDidCatch(l.value,{componentStack:ie!==null?ie:""})}),C}function p(i,l,C){var D=i.pingCache;if(D===null){D=i.pingCache=new ag;var H=new Set;D.set(l,H)}else H=D.get(l),H===void 0&&(H=new Set,D.set(l,H));H.has(C)||(H.add(C),i=b_.bind(null,i,l,C),l.then(i,i))}function j(i){do{var l;if((l=i.tag===13)&&(l=i.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return i;i=i.return}while(i!==null);return null}function B(i,l,C,D,H){return(i.mode&1)===0?(i===l?i.flags|=65536:(i.flags|=128,C.flags|=131072,C.flags&=-52805,C.tag===1&&(C.alternate===null?C.tag=17:(l=Hi(-1,1),l.tag=2,Gi(C,l,1))),C.lanes|=1),i):(i.flags|=65536,i.lanes=H,i)}var $=d.ReactCurrentOwner,J=!1;function le(i,l,C,D){l.child=i===null?oi(l,null,C,D):Mo(l,i.child,C,D)}function Ee(i,l,C,D,H){C=C.render;var K=l.ref;return la(l,H),D=Ol(i,l,C,D,K,H),C=Pl(),i!==null&&!J?(l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~H,gn(i,l,H)):(Zt&&C&&ml(l),l.flags|=1,le(i,l,D,H),l.child)}function Ie(i,l,C,D,H){if(i===null){var K=C.type;return typeof K=="function"&&!Sg(K)&&K.defaultProps===void 0&&C.compare===null&&C.defaultProps===void 0?(l.tag=15,l.type=K,Xe(i,l,K,D,H)):(i=Hh(C.type,null,D,l,l.mode,H),i.ref=l.ref,i.return=l,l.child=i)}if(K=i.child,(i.lanes&H)===0){var ie=K.memoizedProps;if(C=C.compare,C=C!==null?C:mo,C(ie,D)&&i.ref===l.ref)return gn(i,l,H)}return l.flags|=1,i=Fl(K,D),i.ref=l.ref,i.return=l,l.child=i}function Xe(i,l,C,D,H){if(i!==null){var K=i.memoizedProps;if(mo(K,D)&&i.ref===l.ref)if(J=!1,l.pendingProps=D=K,(i.lanes&H)!==0)(i.flags&131072)!==0&&(J=!0);else return l.lanes=i.lanes,gn(i,l,H)}return nt(i,l,C,D,H)}function st(i,l,C){var D=l.pendingProps,H=D.children,K=i!==null?i.memoizedState:null;if(D.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},rr(Yu,xi),xi|=C;else{if((C&1073741824)===0)return i=K!==null?K.baseLanes|C:C,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:i,cachePool:null,transitions:null},l.updateQueue=null,rr(Yu,xi),xi|=i,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},D=K!==null?K.baseLanes:C,rr(Yu,xi),xi|=D}else K!==null?(D=K.baseLanes|C,l.memoizedState=null):D=C,rr(Yu,xi),xi|=D;return le(i,l,H,C),l.child}function Tt(i,l){var C=l.ref;(i===null&&C!==null||i!==null&&i.ref!==C)&&(l.flags|=512,l.flags|=2097152)}function nt(i,l,C,D,H){var K=fn(C)?Ua:tn.current;return K=Po(l,K),la(l,H),C=Ol(i,l,C,D,K,H),D=Pl(),i!==null&&!J?(l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~H,gn(i,l,H)):(Zt&&D&&ml(l),l.flags|=1,le(i,l,C,H),l.child)}function sr(i,l,C,D,H){if(fn(C)){var K=!0;Co(l)}else K=!1;if(la(l,H),l.stateNode===null)Ut(i,l),Rh(l,C,D),Vu(l,C,D,H),D=!0;else if(i===null){var ie=l.stateNode,ce=l.memoizedProps;ie.props=ce;var ge=ie.context,Ne=C.contextType;typeof Ne=="object"&&Ne!==null?Ne=On(Ne):(Ne=fn(C)?Ua:tn.current,Ne=Po(l,Ne));var Ve=C.getDerivedStateFromProps,We=typeof Ve=="function"||typeof ie.getSnapshotBeforeUpdate=="function";We||typeof ie.UNSAFE_componentWillReceiveProps!="function"&&typeof ie.componentWillReceiveProps!="function"||(ce!==D||ge!==Ne)&&ff(l,ie,D,Ne),qi=!1;var Ge=l.memoizedState;ie.state=Ge,_l(l,D,ie,H),ge=l.memoizedState,ce!==D||Ge!==ge||cn.current||qi?(typeof Ve=="function"&&(Tl(l,C,Ve,D),ge=l.memoizedState),(ce=qi||Gu(l,C,ce,D,Ge,ge,Ne))?(We||typeof ie.UNSAFE_componentWillMount!="function"&&typeof ie.componentWillMount!="function"||(typeof ie.componentWillMount=="function"&&ie.componentWillMount(),typeof ie.UNSAFE_componentWillMount=="function"&&ie.UNSAFE_componentWillMount()),typeof ie.componentDidMount=="function"&&(l.flags|=4194308)):(typeof ie.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=D,l.memoizedState=ge),ie.props=D,ie.state=ge,ie.context=Ne,D=ce):(typeof ie.componentDidMount=="function"&&(l.flags|=4194308),D=!1)}else{ie=l.stateNode,ju(i,l),ce=l.memoizedProps,Ne=l.type===l.elementType?ce:rn(l.type,ce),ie.props=Ne,We=l.pendingProps,Ge=ie.context,ge=C.contextType,typeof ge=="object"&&ge!==null?ge=On(ge):(ge=fn(C)?Ua:tn.current,ge=Po(l,ge));var ot=C.getDerivedStateFromProps;(Ve=typeof ot=="function"||typeof ie.getSnapshotBeforeUpdate=="function")||typeof ie.UNSAFE_componentWillReceiveProps!="function"&&typeof ie.componentWillReceiveProps!="function"||(ce!==We||Ge!==ge)&&ff(l,ie,D,ge),qi=!1,Ge=l.memoizedState,ie.state=Ge,_l(l,D,ie,H);var ft=l.memoizedState;ce!==We||Ge!==ft||cn.current||qi?(typeof ot=="function"&&(Tl(l,C,ot,D),ft=l.memoizedState),(Ne=qi||Gu(l,C,Ne,D,Ge,ft,ge)||!1)?(Ve||typeof ie.UNSAFE_componentWillUpdate!="function"&&typeof ie.componentWillUpdate!="function"||(typeof ie.componentWillUpdate=="function"&&ie.componentWillUpdate(D,ft,ge),typeof ie.UNSAFE_componentWillUpdate=="function"&&ie.UNSAFE_componentWillUpdate(D,ft,ge)),typeof ie.componentDidUpdate=="function"&&(l.flags|=4),typeof ie.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof ie.componentDidUpdate!="function"||ce===i.memoizedProps&&Ge===i.memoizedState||(l.flags|=4),typeof ie.getSnapshotBeforeUpdate!="function"||ce===i.memoizedProps&&Ge===i.memoizedState||(l.flags|=1024),l.memoizedProps=D,l.memoizedState=ft),ie.props=D,ie.state=ft,ie.context=ge,D=Ne):(typeof ie.componentDidUpdate!="function"||ce===i.memoizedProps&&Ge===i.memoizedState||(l.flags|=4),typeof ie.getSnapshotBeforeUpdate!="function"||ce===i.memoizedProps&&Ge===i.memoizedState||(l.flags|=1024),D=!1)}return Qt(i,l,C,D,K,H)}function Qt(i,l,C,D,H,K){Tt(i,l);var ie=(l.flags&128)!==0;if(!D&&!ie)return H&&wh(l,C,!1),gn(i,l,K);D=l.stateNode,$.current=l;var ce=ie&&typeof C.getDerivedStateFromError!="function"?null:D.render();return l.flags|=1,i!==null&&ie?(l.child=Mo(l,i.child,null,K),l.child=Mo(l,null,ce,K)):le(i,l,ce,K),l.memoizedState=D.state,H&&wh(l,C,!0),l.child}function Cn(i){var l=i.stateNode;l.pendingContext?Qc(i,l.pendingContext,l.pendingContext!==l.context):l.context&&Qc(i,l.context,!1),$a(i,l.containerInfo)}function Vi(i,l,C,D,H){return Ro(),Ss(H),l.flags|=256,le(i,l,C,D),l.child}var Le={dehydrated:null,treeContext:null,retryLane:0};function Ce(i){return{baseLanes:i,cachePool:null,transitions:null}}function De(i,l,C){var D=l.pendingProps,H=lr.current,K=!1,ie=(l.flags&128)!==0,ce;if((ce=ie)||(ce=i!==null&&i.memoizedState===null?!1:(H&2)!==0),ce?(K=!0,l.flags&=-129):(i===null||i.memoizedState!==null)&&(H|=1),rr(lr,H&1),i===null)return yl(l),i=l.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((l.mode&1)===0?l.lanes=1:i.data==="$!"?l.lanes=8:l.lanes=1073741824,null):(ie=D.children,i=D.fallback,K?(D=l.mode,K=l.child,ie={mode:"hidden",children:ie},(D&1)===0&&K!==null?(K.childLanes=0,K.pendingProps=ie):K=Gh(ie,D,0,null),i=Ls(i,D,C,null),K.return=l,i.return=l,K.sibling=i,l.child=K,l.child.memoizedState=Ce(C),l.memoizedState=Le,i):it(l,ie));if(H=i.memoizedState,H!==null&&(ce=H.dehydrated,ce!==null))return It(i,l,ie,D,ce,H,C);if(K){K=D.fallback,ie=l.mode,H=i.child,ce=H.sibling;var ge={mode:"hidden",children:D.children};return(ie&1)===0&&l.child!==H?(D=l.child,D.childLanes=0,D.pendingProps=ge,l.deletions=null):(D=Fl(H,ge),D.subtreeFlags=H.subtreeFlags&14680064),ce!==null?K=Fl(ce,K):(K=Ls(K,ie,C,null),K.flags|=2),K.return=l,D.return=l,D.sibling=K,l.child=D,D=K,K=l.child,ie=i.child.memoizedState,ie=ie===null?Ce(C):{baseLanes:ie.baseLanes|C,cachePool:null,transitions:ie.transitions},K.memoizedState=ie,K.childLanes=i.childLanes&~C,l.memoizedState=Le,D}return K=i.child,i=K.sibling,D=Fl(K,{mode:"visible",children:D.children}),(l.mode&1)===0&&(D.lanes=C),D.return=l,D.sibling=null,i!==null&&(C=l.deletions,C===null?(l.deletions=[i],l.flags|=16):C.push(i)),l.child=D,l.memoizedState=null,D}function it(i,l){return l=Gh({mode:"visible",children:l},i.mode,0,null),l.return=i,i.child=l}function _t(i,l,C,D){return D!==null&&Ss(D),Mo(l,i.child,null,C),i=it(l,l.pendingProps.children),i.flags|=2,l.memoizedState=null,i}function It(i,l,C,D,H,K,ie){if(C)return l.flags&256?(l.flags&=-257,D=$u(Error(t(422))),_t(i,l,ie,D)):l.memoizedState!==null?(l.child=i.child,l.flags|=128,null):(K=D.fallback,H=l.mode,D=Gh({mode:"visible",children:D.children},H,0,null),K=Ls(K,H,ie,null),K.flags|=2,D.return=l,K.return=l,D.sibling=K,l.child=D,(l.mode&1)!==0&&Mo(l,i.child,null,ie),l.child.memoizedState=Ce(ie),l.memoizedState=Le,K);if((l.mode&1)===0)return _t(i,l,ie,null);if(H.data==="$!"){if(D=H.nextSibling&&H.nextSibling.dataset,D)var ce=D.dgst;return D=ce,K=Error(t(419)),D=$u(K,D,void 0),_t(i,l,ie,D)}if(ce=(ie&i.childLanes)!==0,J||ce){if(D=vn,D!==null){switch(ie&-ie){case 4:H=2;break;case 16:H=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:H=32;break;case 536870912:H=268435456;break;default:H=0}H=(H&(D.suspendedLanes|ie))!==0?0:H,H!==0&&H!==K.retryLane&&(K.retryLane=H,Kn(i,H),ha(D,i,H,-1))}return _g(),D=$u(Error(t(421))),_t(i,l,ie,D)}return H.data==="$?"?(l.flags|=128,l.child=i.child,l=w_.bind(null,i),H._reactRetry=l,null):(i=K.treeContext,tt=Di(H.nextSibling),$n=l,Zt=!0,Wn=null,i!==null&&(En[xn++]=Vn,En[xn++]=vr,En[xn++]=Va,Vn=i.id,vr=i.overflow,Va=l),l=it(l,D.children),l.flags|=4096,l)}function Rt(i,l,C){i.lanes|=l;var D=i.alternate;D!==null&&(D.lanes|=l),Iu(i.return,l,C)}function Ht(i,l,C,D,H){var K=i.memoizedState;K===null?i.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:D,tail:C,tailMode:H}:(K.isBackwards=l,K.rendering=null,K.renderingStartTime=0,K.last=D,K.tail=C,K.tailMode=H)}function Br(i,l,C){var D=l.pendingProps,H=D.revealOrder,K=D.tail;if(le(i,l,D.children,C),D=lr.current,(D&2)!==0)D=D&1|2,l.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=l.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Rt(i,C,l);else if(i.tag===19)Rt(i,C,l);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break e;for(;i.sibling===null;){if(i.return===null||i.return===l)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}D&=1}if(rr(lr,D),(l.mode&1)===0)l.memoizedState=null;else switch(H){case"forwards":for(C=l.child,H=null;C!==null;)i=C.alternate,i!==null&&El(i)===null&&(H=C),C=C.sibling;C=H,C===null?(H=l.child,l.child=null):(H=C.sibling,C.sibling=null),Ht(l,!1,H,C,K);break;case"backwards":for(C=null,H=l.child,l.child=null;H!==null;){if(i=H.alternate,i!==null&&El(i)===null){l.child=H;break}i=H.sibling,H.sibling=C,C=H,H=i}Ht(l,!0,C,null,K);break;case"together":Ht(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Ut(i,l){(l.mode&1)===0&&i!==null&&(i.alternate=null,l.alternate=null,l.flags|=2)}function gn(i,l,C){if(i!==null&&(l.dependencies=i.dependencies),As|=l.lanes,(C&l.childLanes)===0)return null;if(i!==null&&l.child!==i.child)throw Error(t(153));if(l.child!==null){for(i=l.child,C=Fl(i,i.pendingProps),l.child=C,C.return=l;i.sibling!==null;)i=i.sibling,C=C.sibling=Fl(i,i.pendingProps),C.return=l;C.sibling=null}return l.child}function og(i,l,C){switch(l.tag){case 3:Cn(l),Ro();break;case 5:Sl(l);break;case 1:fn(l.type)&&Co(l);break;case 4:$a(l,l.stateNode.containerInfo);break;case 10:var D=l.type._context,H=l.memoizedProps.value;rr(Es,D._currentValue),D._currentValue=H;break;case 13:if(D=l.memoizedState,D!==null)return D.dehydrated!==null?(rr(lr,lr.current&1),l.flags|=128,null):(C&l.child.childLanes)!==0?De(i,l,C):(rr(lr,lr.current&1),i=gn(i,l,C),i!==null?i.sibling:null);rr(lr,lr.current&1);break;case 19:if(D=(C&l.childLanes)!==0,(i.flags&128)!==0){if(D)return Br(i,l,C);l.flags|=128}if(H=l.memoizedState,H!==null&&(H.rendering=null,H.tail=null,H.lastEffect=null),rr(lr,lr.current),D)break;return null;case 22:case 23:return l.lanes=0,st(i,l,C)}return gn(i,l,C)}var nm,lg,im,am;nm=function(i,l){for(var C=l.child;C!==null;){if(C.tag===5||C.tag===6)i.appendChild(C.stateNode);else if(C.tag!==4&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===l)break;for(;C.sibling===null;){if(C.return===null||C.return===l)return;C=C.return}C.sibling.return=C.return,C=C.sibling}},lg=function(){},im=function(i,l,C,D){var H=i.memoizedProps;if(H!==D){i=l.stateNode,Fr(nr.current);var K=null;switch(C){case"input":H=ye(i,H),D=ye(i,D),K=[];break;case"select":H=q({},H,{value:void 0}),D=q({},D,{value:void 0}),K=[];break;case"textarea":H=oe(i,H),D=oe(i,D),K=[];break;default:typeof H.onClick!="function"&&typeof D.onClick=="function"&&(i.onclick=Eo)}Oe(C,D);var ie;C=null;for(Ne in H)if(!D.hasOwnProperty(Ne)&&H.hasOwnProperty(Ne)&&H[Ne]!=null)if(Ne==="style"){var ce=H[Ne];for(ie in ce)ce.hasOwnProperty(ie)&&(C||(C={}),C[ie]="")}else Ne!=="dangerouslySetInnerHTML"&&Ne!=="children"&&Ne!=="suppressContentEditableWarning"&&Ne!=="suppressHydrationWarning"&&Ne!=="autoFocus"&&(a.hasOwnProperty(Ne)?K||(K=[]):(K=K||[]).push(Ne,null));for(Ne in D){var ge=D[Ne];if(ce=H!=null?H[Ne]:void 0,D.hasOwnProperty(Ne)&&ge!==ce&&(ge!=null||ce!=null))if(Ne==="style")if(ce){for(ie in ce)!ce.hasOwnProperty(ie)||ge&&ge.hasOwnProperty(ie)||(C||(C={}),C[ie]="");for(ie in ge)ge.hasOwnProperty(ie)&&ce[ie]!==ge[ie]&&(C||(C={}),C[ie]=ge[ie])}else C||(K||(K=[]),K.push(Ne,C)),C=ge;else Ne==="dangerouslySetInnerHTML"?(ge=ge?ge.__html:void 0,ce=ce?ce.__html:void 0,ge!=null&&ce!==ge&&(K=K||[]).push(Ne,ge)):Ne==="children"?typeof ge!="string"&&typeof ge!="number"||(K=K||[]).push(Ne,""+ge):Ne!=="suppressContentEditableWarning"&&Ne!=="suppressHydrationWarning"&&(a.hasOwnProperty(Ne)?(ge!=null&&Ne==="onScroll"&&ar("scroll",i),K||ce===ge||(K=[])):(K=K||[]).push(Ne,ge))}C&&(K=K||[]).push("style",C);var Ne=K;(l.updateQueue=Ne)&&(l.flags|=4)}},am=function(i,l,C,D){C!==D&&(l.flags|=4)};function df(i,l){if(!Zt)switch(i.tailMode){case"hidden":l=i.tail;for(var C=null;l!==null;)l.alternate!==null&&(C=l),l=l.sibling;C===null?i.tail=null:C.sibling=null;break;case"collapsed":C=i.tail;for(var D=null;C!==null;)C.alternate!==null&&(D=C),C=C.sibling;D===null?l||i.tail===null?i.tail=null:i.tail.sibling=null:D.sibling=null}}function Dn(i){var l=i.alternate!==null&&i.alternate.child===i.child,C=0,D=0;if(l)for(var H=i.child;H!==null;)C|=H.lanes|H.childLanes,D|=H.subtreeFlags&14680064,D|=H.flags&14680064,H.return=i,H=H.sibling;else for(H=i.child;H!==null;)C|=H.lanes|H.childLanes,D|=H.subtreeFlags,D|=H.flags,H.return=i,H=H.sibling;return i.subtreeFlags|=D,i.childLanes=C,l}function u_(i,l,C){var D=l.pendingProps;switch(Yr(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Dn(l),null;case 1:return fn(l.type)&&gl(),Dn(l),null;case 3:return D=l.stateNode,yr(),or(cn),or(tn),dn(),D.pendingContext&&(D.context=D.pendingContext,D.pendingContext=null),(i===null||i.child===null)&&(_s(l)?l.flags|=4:i===null||i.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Wn!==null&&(yg(Wn),Wn=null))),lg(i,l),Dn(l),null;case 5:sa(l);var H=Fr(kr.current);if(C=l.type,i!==null&&l.stateNode!=null)im(i,l,C,D,H),i.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!D){if(l.stateNode===null)throw Error(t(166));return Dn(l),null}if(i=Fr(nr.current),_s(l)){D=l.stateNode,C=l.type;var K=l.memoizedProps;switch(D[ai]=l,D[ys]=K,i=(l.mode&1)!==0,C){case"dialog":ar("cancel",D),ar("close",D);break;case"iframe":case"object":case"embed":ar("load",D);break;case"video":case"audio":for(H=0;H<Fa.length;H++)ar(Fa[H],D);break;case"source":ar("error",D);break;case"img":case"image":case"link":ar("error",D),ar("load",D);break;case"details":ar("toggle",D);break;case"input":we(D,K),ar("invalid",D);break;case"select":D._wrapperState={wasMultiple:!!K.multiple},ar("invalid",D);break;case"textarea":ve(D,K),ar("invalid",D)}Oe(C,K),H=null;for(var ie in K)if(K.hasOwnProperty(ie)){var ce=K[ie];ie==="children"?typeof ce=="string"?D.textContent!==ce&&(K.suppressHydrationWarning!==!0&&vs(D.textContent,ce,i),H=["children",ce]):typeof ce=="number"&&D.textContent!==""+ce&&(K.suppressHydrationWarning!==!0&&vs(D.textContent,ce,i),H=["children",""+ce]):a.hasOwnProperty(ie)&&ce!=null&&ie==="onScroll"&&ar("scroll",D)}switch(C){case"input":ue(D),se(D,K,!0);break;case"textarea":ue(D),ke(D);break;case"select":case"option":break;default:typeof K.onClick=="function"&&(D.onclick=Eo)}D=H,l.updateQueue=D,D!==null&&(l.flags|=4)}else{ie=H.nodeType===9?H:H.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=Be(C)),i==="http://www.w3.org/1999/xhtml"?C==="script"?(i=ie.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof D.is=="string"?i=ie.createElement(C,{is:D.is}):(i=ie.createElement(C),C==="select"&&(ie=i,D.multiple?ie.multiple=!0:D.size&&(ie.size=D.size))):i=ie.createElementNS(i,C),i[ai]=l,i[ys]=D,nm(i,l,!1,!1),l.stateNode=i;e:{switch(ie=Se(C,D),C){case"dialog":ar("cancel",i),ar("close",i),H=D;break;case"iframe":case"object":case"embed":ar("load",i),H=D;break;case"video":case"audio":for(H=0;H<Fa.length;H++)ar(Fa[H],i);H=D;break;case"source":ar("error",i),H=D;break;case"img":case"image":case"link":ar("error",i),ar("load",i),H=D;break;case"details":ar("toggle",i),H=D;break;case"input":we(i,D),H=ye(i,D),ar("invalid",i);break;case"option":H=D;break;case"select":i._wrapperState={wasMultiple:!!D.multiple},H=q({},D,{value:void 0}),ar("invalid",i);break;case"textarea":ve(i,D),H=oe(i,D),ar("invalid",i);break;default:H=D}Oe(C,H),ce=H;for(K in ce)if(ce.hasOwnProperty(K)){var ge=ce[K];K==="style"?kt(i,ge):K==="dangerouslySetInnerHTML"?(ge=ge?ge.__html:void 0,ge!=null&&St(i,ge)):K==="children"?typeof ge=="string"?(C!=="textarea"||ge!=="")&&Ue(i,ge):typeof ge=="number"&&Ue(i,""+ge):K!=="suppressContentEditableWarning"&&K!=="suppressHydrationWarning"&&K!=="autoFocus"&&(a.hasOwnProperty(K)?ge!=null&&K==="onScroll"&&ar("scroll",i):ge!=null&&h(i,K,ge,ie))}switch(C){case"input":ue(i),se(i,D,!1);break;case"textarea":ue(i),ke(i);break;case"option":D.value!=null&&i.setAttribute("value",""+re(D.value));break;case"select":i.multiple=!!D.multiple,K=D.value,K!=null?xe(i,!!D.multiple,K,!1):D.defaultValue!=null&&xe(i,!!D.multiple,D.defaultValue,!0);break;default:typeof H.onClick=="function"&&(i.onclick=Eo)}switch(C){case"button":case"input":case"select":case"textarea":D=!!D.autoFocus;break e;case"img":D=!0;break e;default:D=!1}}D&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return Dn(l),null;case 6:if(i&&l.stateNode!=null)am(i,l,i.memoizedProps,D);else{if(typeof D!="string"&&l.stateNode===null)throw Error(t(166));if(C=Fr(kr.current),Fr(nr.current),_s(l)){if(D=l.stateNode,C=l.memoizedProps,D[ai]=l,(K=D.nodeValue!==C)&&(i=$n,i!==null))switch(i.tag){case 3:vs(D.nodeValue,C,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&vs(D.nodeValue,C,(i.mode&1)!==0)}K&&(l.flags|=4)}else D=(C.nodeType===9?C:C.ownerDocument).createTextNode(D),D[ai]=l,l.stateNode=D}return Dn(l),null;case 13:if(or(lr),D=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(Zt&&tt!==null&&(l.mode&1)!==0&&(l.flags&128)===0)ef(),Ro(),l.flags|=98560,K=!1;else if(K=_s(l),D!==null&&D.dehydrated!==null){if(i===null){if(!K)throw Error(t(318));if(K=l.memoizedState,K=K!==null?K.dehydrated:null,!K)throw Error(t(317));K[ai]=l}else Ro(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Dn(l),K=!1}else Wn!==null&&(yg(Wn),Wn=null),K=!0;if(!K)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=C,l):(D=D!==null,D!==(i!==null&&i.memoizedState!==null)&&D&&(l.child.flags|=8192,(l.mode&1)!==0&&(i===null||(lr.current&1)!==0?nn===0&&(nn=3):_g())),l.updateQueue!==null&&(l.flags|=4),Dn(l),null);case 4:return yr(),lg(i,l),i===null&&_o(l.stateNode.containerInfo),Dn(l),null;case 10:return Nu(l.type._context),Dn(l),null;case 17:return fn(l.type)&&gl(),Dn(l),null;case 19:if(or(lr),K=l.memoizedState,K===null)return Dn(l),null;if(D=(l.flags&128)!==0,ie=K.rendering,ie===null)if(D)df(K,!1);else{if(nn!==0||i!==null&&(i.flags&128)!==0)for(i=l.child;i!==null;){if(ie=El(i),ie!==null){for(l.flags|=128,df(K,!1),D=ie.updateQueue,D!==null&&(l.updateQueue=D,l.flags|=4),l.subtreeFlags=0,D=C,C=l.child;C!==null;)K=C,i=D,K.flags&=14680066,ie=K.alternate,ie===null?(K.childLanes=0,K.lanes=i,K.child=null,K.subtreeFlags=0,K.memoizedProps=null,K.memoizedState=null,K.updateQueue=null,K.dependencies=null,K.stateNode=null):(K.childLanes=ie.childLanes,K.lanes=ie.lanes,K.child=ie.child,K.subtreeFlags=0,K.deletions=null,K.memoizedProps=ie.memoizedProps,K.memoizedState=ie.memoizedState,K.updateQueue=ie.updateQueue,K.type=ie.type,i=ie.dependencies,K.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),C=C.sibling;return rr(lr,lr.current&1|2),l.child}i=i.sibling}K.tail!==null&&Pr()>Ku&&(l.flags|=128,D=!0,df(K,!1),l.lanes=4194304)}else{if(!D)if(i=El(ie),i!==null){if(l.flags|=128,D=!0,C=i.updateQueue,C!==null&&(l.updateQueue=C,l.flags|=4),df(K,!0),K.tail===null&&K.tailMode==="hidden"&&!ie.alternate&&!Zt)return Dn(l),null}else 2*Pr()-K.renderingStartTime>Ku&&C!==1073741824&&(l.flags|=128,D=!0,df(K,!1),l.lanes=4194304);K.isBackwards?(ie.sibling=l.child,l.child=ie):(C=K.last,C!==null?C.sibling=ie:l.child=ie,K.last=ie)}return K.tail!==null?(l=K.tail,K.rendering=l,K.tail=l.sibling,K.renderingStartTime=Pr(),l.sibling=null,C=lr.current,rr(lr,D?C&1|2:C&1),l):(Dn(l),null);case 22:case 23:return wg(),D=l.memoizedState!==null,i!==null&&i.memoizedState!==null!==D&&(l.flags|=8192),D&&(l.mode&1)!==0?(xi&1073741824)!==0&&(Dn(l),l.subtreeFlags&6&&(l.flags|=8192)):Dn(l),null;case 24:return null;case 25:return null}throw Error(t(156,l.tag))}function c_(i,l){switch(Yr(l),l.tag){case 1:return fn(l.type)&&gl(),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return yr(),or(cn),or(tn),dn(),i=l.flags,(i&65536)!==0&&(i&128)===0?(l.flags=i&-65537|128,l):null;case 5:return sa(l),null;case 13:if(or(lr),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(t(340));Ro()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return or(lr),null;case 4:return yr(),null;case 10:return Nu(l.type._context),null;case 22:case 23:return wg(),null;case 24:return null;default:return null}}var Lh=!1,Fn=!1,f_=typeof WeakSet=="function"?WeakSet:Set,ct=null;function Wu(i,l){var C=i.ref;if(C!==null)if(typeof C=="function")try{C(null)}catch(D){Mr(i,l,D)}else C.current=null}function sg(i,l,C){try{C()}catch(D){Mr(i,l,D)}}var om=!1;function d_(i,l){if(Yc=ou,i=jr(),fl(i)){if("selectionStart"in i)var C={start:i.selectionStart,end:i.selectionEnd};else e:{C=(C=i.ownerDocument)&&C.defaultView||window;var D=C.getSelection&&C.getSelection();if(D&&D.rangeCount!==0){C=D.anchorNode;var H=D.anchorOffset,K=D.focusNode;D=D.focusOffset;try{C.nodeType,K.nodeType}catch{C=null;break e}var ie=0,ce=-1,ge=-1,Ne=0,Ve=0,We=i,Ge=null;t:for(;;){for(var ot;We!==C||H!==0&&We.nodeType!==3||(ce=ie+H),We!==K||D!==0&&We.nodeType!==3||(ge=ie+D),We.nodeType===3&&(ie+=We.nodeValue.length),(ot=We.firstChild)!==null;)Ge=We,We=ot;for(;;){if(We===i)break t;if(Ge===C&&++Ne===H&&(ce=ie),Ge===K&&++Ve===D&&(ge=ie),(ot=We.nextSibling)!==null)break;We=Ge,Ge=We.parentNode}We=ot}C=ce===-1||ge===-1?null:{start:ce,end:ge}}else C=null}C=C||{start:0,end:0}}else C=null;for(Kc={focusedElem:i,selectionRange:C},ou=!1,ct=l;ct!==null;)if(l=ct,i=l.child,(l.subtreeFlags&1028)!==0&&i!==null)i.return=l,ct=i;else for(;ct!==null;){l=ct;try{var ft=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(ft!==null){var pt=ft.memoizedProps,Ur=ft.memoizedState,Ae=l.stateNode,be=Ae.getSnapshotBeforeUpdate(l.elementType===l.type?pt:rn(l.type,pt),Ur);Ae.__reactInternalSnapshotBeforeUpdate=be}break;case 3:var Re=l.stateNode.containerInfo;Re.nodeType===1?Re.textContent="":Re.nodeType===9&&Re.documentElement&&Re.removeChild(Re.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(Ze){Mr(l,l.return,Ze)}if(i=l.sibling,i!==null){i.return=l.return,ct=i;break}ct=l.return}return ft=om,om=!1,ft}function hf(i,l,C){var D=l.updateQueue;if(D=D!==null?D.lastEffect:null,D!==null){var H=D=D.next;do{if((H.tag&i)===i){var K=H.destroy;H.destroy=void 0,K!==void 0&&sg(l,C,K)}H=H.next}while(H!==D)}}function Nh(i,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var C=l=l.next;do{if((C.tag&i)===i){var D=C.create;C.destroy=D()}C=C.next}while(C!==l)}}function ug(i){var l=i.ref;if(l!==null){var C=i.stateNode;switch(i.tag){case 5:i=C;break;default:i=C}typeof l=="function"?l(i):l.current=i}}function lm(i){var l=i.alternate;l!==null&&(i.alternate=null,lm(l)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(l=i.stateNode,l!==null&&(delete l[ai],delete l[ys],delete l[Pu],delete l[yh],delete l[bh])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function sm(i){return i.tag===5||i.tag===3||i.tag===4}function um(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||sm(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function cg(i,l,C){var D=i.tag;if(D===5||D===6)i=i.stateNode,l?C.nodeType===8?C.parentNode.insertBefore(i,l):C.insertBefore(i,l):(C.nodeType===8?(l=C.parentNode,l.insertBefore(i,C)):(l=C,l.appendChild(i)),C=C._reactRootContainer,C!=null||l.onclick!==null||(l.onclick=Eo));else if(D!==4&&(i=i.child,i!==null))for(cg(i,l,C),i=i.sibling;i!==null;)cg(i,l,C),i=i.sibling}function fg(i,l,C){var D=i.tag;if(D===5||D===6)i=i.stateNode,l?C.insertBefore(i,l):C.appendChild(i);else if(D!==4&&(i=i.child,i!==null))for(fg(i,l,C),i=i.sibling;i!==null;)fg(i,l,C),i=i.sibling}var kn=null,fa=!1;function Ll(i,l,C){for(C=C.child;C!==null;)cm(i,l,C),C=C.sibling}function cm(i,l,C){if(Zr&&typeof Zr.onCommitFiberUnmount=="function")try{Zr.onCommitFiberUnmount(Qi,C)}catch{}switch(C.tag){case 5:Fn||Wu(C,l);case 6:var D=kn,H=fa;kn=null,Ll(i,l,C),kn=D,fa=H,kn!==null&&(fa?(i=kn,C=C.stateNode,i.nodeType===8?i.parentNode.removeChild(C):i.removeChild(C)):kn.removeChild(C.stateNode));break;case 18:kn!==null&&(fa?(i=kn,C=C.stateNode,i.nodeType===8?Ou(i.parentNode,C):i.nodeType===1&&Ou(i,C),Ln(i)):Ou(kn,C.stateNode));break;case 4:D=kn,H=fa,kn=C.stateNode.containerInfo,fa=!0,Ll(i,l,C),kn=D,fa=H;break;case 0:case 11:case 14:case 15:if(!Fn&&(D=C.updateQueue,D!==null&&(D=D.lastEffect,D!==null))){H=D=D.next;do{var K=H,ie=K.destroy;K=K.tag,ie!==void 0&&((K&2)!==0||(K&4)!==0)&&sg(C,l,ie),H=H.next}while(H!==D)}Ll(i,l,C);break;case 1:if(!Fn&&(Wu(C,l),D=C.stateNode,typeof D.componentWillUnmount=="function"))try{D.props=C.memoizedProps,D.state=C.memoizedState,D.componentWillUnmount()}catch(ce){Mr(C,l,ce)}Ll(i,l,C);break;case 21:Ll(i,l,C);break;case 22:C.mode&1?(Fn=(D=Fn)||C.memoizedState!==null,Ll(i,l,C),Fn=D):Ll(i,l,C);break;default:Ll(i,l,C)}}function fm(i){var l=i.updateQueue;if(l!==null){i.updateQueue=null;var C=i.stateNode;C===null&&(C=i.stateNode=new f_),l.forEach(function(D){var H=__.bind(null,i,D);C.has(D)||(C.add(D),D.then(H,H))})}}function da(i,l){var C=l.deletions;if(C!==null)for(var D=0;D<C.length;D++){var H=C[D];try{var K=i,ie=l,ce=ie;e:for(;ce!==null;){switch(ce.tag){case 5:kn=ce.stateNode,fa=!1;break e;case 3:kn=ce.stateNode.containerInfo,fa=!0;break e;case 4:kn=ce.stateNode.containerInfo,fa=!0;break e}ce=ce.return}if(kn===null)throw Error(t(160));cm(K,ie,H),kn=null,fa=!1;var ge=H.alternate;ge!==null&&(ge.return=null),H.return=null}catch(Ne){Mr(H,l,Ne)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)dm(l,i),l=l.sibling}function dm(i,l){var C=i.alternate,D=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(da(l,i),Za(i),D&4){try{hf(3,i,i.return),Nh(3,i)}catch(pt){Mr(i,i.return,pt)}try{hf(5,i,i.return)}catch(pt){Mr(i,i.return,pt)}}break;case 1:da(l,i),Za(i),D&512&&C!==null&&Wu(C,C.return);break;case 5:if(da(l,i),Za(i),D&512&&C!==null&&Wu(C,C.return),i.flags&32){var H=i.stateNode;try{Ue(H,"")}catch(pt){Mr(i,i.return,pt)}}if(D&4&&(H=i.stateNode,H!=null)){var K=i.memoizedProps,ie=C!==null?C.memoizedProps:K,ce=i.type,ge=i.updateQueue;if(i.updateQueue=null,ge!==null)try{ce==="input"&&K.type==="radio"&&K.name!=null&&je(H,K),Se(ce,ie);var Ne=Se(ce,K);for(ie=0;ie<ge.length;ie+=2){var Ve=ge[ie],We=ge[ie+1];Ve==="style"?kt(H,We):Ve==="dangerouslySetInnerHTML"?St(H,We):Ve==="children"?Ue(H,We):h(H,Ve,We,Ne)}switch(ce){case"input":Te(H,K);break;case"textarea":de(H,K);break;case"select":var Ge=H._wrapperState.wasMultiple;H._wrapperState.wasMultiple=!!K.multiple;var ot=K.value;ot!=null?xe(H,!!K.multiple,ot,!1):Ge!==!!K.multiple&&(K.defaultValue!=null?xe(H,!!K.multiple,K.defaultValue,!0):xe(H,!!K.multiple,K.multiple?[]:"",!1))}H[ys]=K}catch(pt){Mr(i,i.return,pt)}}break;case 6:if(da(l,i),Za(i),D&4){if(i.stateNode===null)throw Error(t(162));H=i.stateNode,K=i.memoizedProps;try{H.nodeValue=K}catch(pt){Mr(i,i.return,pt)}}break;case 3:if(da(l,i),Za(i),D&4&&C!==null&&C.memoizedState.isDehydrated)try{Ln(l.containerInfo)}catch(pt){Mr(i,i.return,pt)}break;case 4:da(l,i),Za(i);break;case 13:da(l,i),Za(i),H=i.child,H.flags&8192&&(K=H.memoizedState!==null,H.stateNode.isHidden=K,!K||H.alternate!==null&&H.alternate.memoizedState!==null||(pg=Pr())),D&4&&fm(i);break;case 22:if(Ve=C!==null&&C.memoizedState!==null,i.mode&1?(Fn=(Ne=Fn)||Ve,da(l,i),Fn=Ne):da(l,i),Za(i),D&8192){if(Ne=i.memoizedState!==null,(i.stateNode.isHidden=Ne)&&!Ve&&(i.mode&1)!==0)for(ct=i,Ve=i.child;Ve!==null;){for(We=ct=Ve;ct!==null;){switch(Ge=ct,ot=Ge.child,Ge.tag){case 0:case 11:case 14:case 15:hf(4,Ge,Ge.return);break;case 1:Wu(Ge,Ge.return);var ft=Ge.stateNode;if(typeof ft.componentWillUnmount=="function"){D=Ge,C=Ge.return;try{l=D,ft.props=l.memoizedProps,ft.state=l.memoizedState,ft.componentWillUnmount()}catch(pt){Mr(D,C,pt)}}break;case 5:Wu(Ge,Ge.return);break;case 22:if(Ge.memoizedState!==null){gm(We);continue}}ot!==null?(ot.return=Ge,ct=ot):gm(We)}Ve=Ve.sibling}e:for(Ve=null,We=i;;){if(We.tag===5){if(Ve===null){Ve=We;try{H=We.stateNode,Ne?(K=H.style,typeof K.setProperty=="function"?K.setProperty("display","none","important"):K.display="none"):(ce=We.stateNode,ge=We.memoizedProps.style,ie=ge!=null&&ge.hasOwnProperty("display")?ge.display:null,ce.style.display=mt("display",ie))}catch(pt){Mr(i,i.return,pt)}}}else if(We.tag===6){if(Ve===null)try{We.stateNode.nodeValue=Ne?"":We.memoizedProps}catch(pt){Mr(i,i.return,pt)}}else if((We.tag!==22&&We.tag!==23||We.memoizedState===null||We===i)&&We.child!==null){We.child.return=We,We=We.child;continue}if(We===i)break e;for(;We.sibling===null;){if(We.return===null||We.return===i)break e;Ve===We&&(Ve=null),We=We.return}Ve===We&&(Ve=null),We.sibling.return=We.return,We=We.sibling}}break;case 19:da(l,i),Za(i),D&4&&fm(i);break;case 21:break;default:da(l,i),Za(i)}}function Za(i){var l=i.flags;if(l&2){try{e:{for(var C=i.return;C!==null;){if(sm(C)){var D=C;break e}C=C.return}throw Error(t(160))}switch(D.tag){case 5:var H=D.stateNode;D.flags&32&&(Ue(H,""),D.flags&=-33);var K=um(i);fg(i,K,H);break;case 3:case 4:var ie=D.stateNode.containerInfo,ce=um(i);cg(i,ce,ie);break;default:throw Error(t(161))}}catch(ge){Mr(i,i.return,ge)}i.flags&=-3}l&4096&&(i.flags&=-4097)}function h_(i,l,C){ct=i,hm(i)}function hm(i,l,C){for(var D=(i.mode&1)!==0;ct!==null;){var H=ct,K=H.child;if(H.tag===22&&D){var ie=H.memoizedState!==null||Lh;if(!ie){var ce=H.alternate,ge=ce!==null&&ce.memoizedState!==null||Fn;ce=Lh;var Ne=Fn;if(Lh=ie,(Fn=ge)&&!Ne)for(ct=H;ct!==null;)ie=ct,ge=ie.child,ie.tag===22&&ie.memoizedState!==null?vm(H):ge!==null?(ge.return=ie,ct=ge):vm(H);for(;K!==null;)ct=K,hm(K),K=K.sibling;ct=H,Lh=ce,Fn=Ne}pm(i)}else(H.subtreeFlags&8772)!==0&&K!==null?(K.return=H,ct=K):pm(i)}}function pm(i){for(;ct!==null;){var l=ct;if((l.flags&8772)!==0){var C=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:Fn||Nh(5,l);break;case 1:var D=l.stateNode;if(l.flags&4&&!Fn)if(C===null)D.componentDidMount();else{var H=l.elementType===l.type?C.memoizedProps:rn(l.type,C.memoizedProps);D.componentDidUpdate(H,C.memoizedState,D.__reactInternalSnapshotBeforeUpdate)}var K=l.updateQueue;K!==null&&Er(l,K,D);break;case 3:var ie=l.updateQueue;if(ie!==null){if(C=null,l.child!==null)switch(l.child.tag){case 5:C=l.child.stateNode;break;case 1:C=l.child.stateNode}Er(l,ie,C)}break;case 5:var ce=l.stateNode;if(C===null&&l.flags&4){C=ce;var ge=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":ge.autoFocus&&C.focus();break;case"img":ge.src&&(C.src=ge.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var Ne=l.alternate;if(Ne!==null){var Ve=Ne.memoizedState;if(Ve!==null){var We=Ve.dehydrated;We!==null&&Ln(We)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}Fn||l.flags&512&&ug(l)}catch(Ge){Mr(l,l.return,Ge)}}if(l===i){ct=null;break}if(C=l.sibling,C!==null){C.return=l.return,ct=C;break}ct=l.return}}function gm(i){for(;ct!==null;){var l=ct;if(l===i){ct=null;break}var C=l.sibling;if(C!==null){C.return=l.return,ct=C;break}ct=l.return}}function vm(i){for(;ct!==null;){var l=ct;try{switch(l.tag){case 0:case 11:case 15:var C=l.return;try{Nh(4,l)}catch(ge){Mr(l,C,ge)}break;case 1:var D=l.stateNode;if(typeof D.componentDidMount=="function"){var H=l.return;try{D.componentDidMount()}catch(ge){Mr(l,H,ge)}}var K=l.return;try{ug(l)}catch(ge){Mr(l,K,ge)}break;case 5:var ie=l.return;try{ug(l)}catch(ge){Mr(l,ie,ge)}}}catch(ge){Mr(l,l.return,ge)}if(l===i){ct=null;break}var ce=l.sibling;if(ce!==null){ce.return=l.return,ct=ce;break}ct=l.return}}var p_=Math.ceil,Ih=d.ReactCurrentDispatcher,dg=d.ReactCurrentOwner,$i=d.ReactCurrentBatchConfig,Yt=0,vn=null,Kr=null,An=0,xi=0,Yu=aa(0),nn=0,pf=null,As=0,jh=0,hg=0,gf=null,si=null,pg=0,Ku=1/0,jo=null,Dh=!1,gg=null,Nl=null,Fh=!1,Il=null,zh=0,vf=0,vg=null,Bh=-1,Uh=0;function Zn(){return(Yt&6)!==0?Pr():Bh!==-1?Bh:Bh=Pr()}function jl(i){return(i.mode&1)===0?1:(Yt&2)!==0&&An!==0?An&-An:tf.transition!==null?(Uh===0&&(Uh=Pc()),Uh):(i=$t,i!==0||(i=window.event,i=i===void 0?16:th(i.type)),i)}function ha(i,l,C,D){if(50<vf)throw vf=0,vg=null,Error(t(185));ns(i,C,D),((Yt&2)===0||i!==vn)&&(i===vn&&((Yt&2)===0&&(jh|=C),nn===4&&Dl(i,An)),ui(i,D),C===1&&Yt===0&&(l.mode&1)===0&&(Ku=Pr()+500,vl&&qa()))}function ui(i,l){var C=i.callbackNode;Xd(i,l);var D=uo(i,i===vn?An:0);if(D===0)C!==null&&rs(C),i.callbackNode=null,i.callbackPriority=0;else if(l=D&-D,i.callbackPriority!==l){if(C!=null&&rs(C),l===1)i.tag===0?oa(ym.bind(null,i)):ws(ym.bind(null,i)),vh(function(){(Yt&6)===0&&qa()}),C=null;else{switch(is(D)){case 1:C=so;break;case 4:C=Js;break;case 16:C=Qo;break;case 536870912:C=eu;break;default:C=Qo}C=Pm(C,mm.bind(null,i))}i.callbackPriority=l,i.callbackNode=C}}function mm(i,l){if(Bh=-1,Uh=0,(Yt&6)!==0)throw Error(t(327));var C=i.callbackNode;if(Xu()&&i.callbackNode!==C)return null;var D=uo(i,i===vn?An:0);if(D===0)return null;if((D&30)!==0||(D&i.expiredLanes)!==0||l)l=qh(i,D);else{l=D;var H=Yt;Yt|=2;var K=wm();(vn!==i||An!==l)&&(jo=null,Ku=Pr()+500,Rs(i,l));do try{m_();break}catch(ce){bm(i,ce)}while(!0);Lu(),Ih.current=K,Yt=H,Kr!==null?l=0:(vn=null,An=0,l=nn)}if(l!==0){if(l===2&&(H=Jo(i),H!==0&&(D=H,l=mg(i,H))),l===1)throw C=pf,Rs(i,0),Dl(i,D),ui(i,Pr()),C;if(l===6)Dl(i,D);else{if(H=i.current.alternate,(D&30)===0&&!g_(H)&&(l=qh(i,D),l===2&&(K=Jo(i),K!==0&&(D=K,l=mg(i,K))),l===1))throw C=pf,Rs(i,0),Dl(i,D),ui(i,Pr()),C;switch(i.finishedWork=H,i.finishedLanes=D,l){case 0:case 1:throw Error(t(345));case 2:Ms(i,si,jo);break;case 3:if(Dl(i,D),(D&130023424)===D&&(l=pg+500-Pr(),10<l)){if(uo(i,0)!==0)break;if(H=i.suspendedLanes,(H&D)!==D){Zn(),i.pingedLanes|=i.suspendedLanes&H;break}i.timeoutHandle=Gn(Ms.bind(null,i,si,jo),l);break}Ms(i,si,jo);break;case 4:if(Dl(i,D),(D&4194240)===D)break;for(l=i.eventTimes,H=-1;0<D;){var ie=31-Ft(D);K=1<<ie,ie=l[ie],ie>H&&(H=ie),D&=~K}if(D=H,D=Pr()-D,D=(120>D?120:480>D?480:1080>D?1080:1920>D?1920:3e3>D?3e3:4320>D?4320:1960*p_(D/1960))-D,10<D){i.timeoutHandle=Gn(Ms.bind(null,i,si,jo),D);break}Ms(i,si,jo);break;case 5:Ms(i,si,jo);break;default:throw Error(t(329))}}}return ui(i,Pr()),i.callbackNode===C?mm.bind(null,i):null}function mg(i,l){var C=gf;return i.current.memoizedState.isDehydrated&&(Rs(i,l).flags|=256),i=qh(i,l),i!==2&&(l=si,si=C,l!==null&&yg(l)),i}function yg(i){si===null?si=i:si.push.apply(si,i)}function g_(i){for(var l=i;;){if(l.flags&16384){var C=l.updateQueue;if(C!==null&&(C=C.stores,C!==null))for(var D=0;D<C.length;D++){var H=C[D],K=H.getSnapshot;H=H.value;try{if(!In(K(),H))return!1}catch{return!1}}}if(C=l.child,l.subtreeFlags&16384&&C!==null)C.return=l,l=C;else{if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Dl(i,l){for(l&=~hg,l&=~jh,i.suspendedLanes|=l,i.pingedLanes&=~l,i=i.expirationTimes;0<l;){var C=31-Ft(l),D=1<<C;i[C]=-1,l&=~D}}function ym(i){if((Yt&6)!==0)throw Error(t(327));Xu();var l=uo(i,0);if((l&1)===0)return ui(i,Pr()),null;var C=qh(i,l);if(i.tag!==0&&C===2){var D=Jo(i);D!==0&&(l=D,C=mg(i,D))}if(C===1)throw C=pf,Rs(i,0),Dl(i,l),ui(i,Pr()),C;if(C===6)throw Error(t(345));return i.finishedWork=i.current.alternate,i.finishedLanes=l,Ms(i,si,jo),ui(i,Pr()),null}function bg(i,l){var C=Yt;Yt|=1;try{return i(l)}finally{Yt=C,Yt===0&&(Ku=Pr()+500,vl&&qa())}}function Ts(i){Il!==null&&Il.tag===0&&(Yt&6)===0&&Xu();var l=Yt;Yt|=1;var C=$i.transition,D=$t;try{if($i.transition=null,$t=1,i)return i()}finally{$t=D,$i.transition=C,Yt=l,(Yt&6)===0&&qa()}}function wg(){xi=Yu.current,or(Yu)}function Rs(i,l){i.finishedWork=null,i.finishedLanes=0;var C=i.timeoutHandle;if(C!==-1&&(i.timeoutHandle=-1,Zc(C)),Kr!==null)for(C=Kr.return;C!==null;){var D=C;switch(Yr(D),D.tag){case 1:D=D.type.childContextTypes,D!=null&&gl();break;case 3:yr(),or(cn),or(tn),dn();break;case 5:sa(D);break;case 4:yr();break;case 13:or(lr);break;case 19:or(lr);break;case 10:Nu(D.type._context);break;case 22:case 23:wg()}C=C.return}if(vn=i,Kr=i=Fl(i.current,null),An=xi=l,nn=0,pf=null,hg=jh=As=0,si=gf=null,Ui!==null){for(l=0;l<Ui.length;l++)if(C=Ui[l],D=C.interleaved,D!==null){C.interleaved=null;var H=D.next,K=C.pending;if(K!==null){var ie=K.next;K.next=H,D.next=ie}C.pending=D}Ui=null}return i}function bm(i,l){do{var C=Kr;try{if(Lu(),xl.current=Al,Ei){for(var D=tr.memoizedState;D!==null;){var H=D.queue;H!==null&&(H.pending=null),D=D.next}Ei=!1}if(Pn=0,Tr=xr=tr=null,Wa=!1,li=0,dg.current=null,C===null||C.return===null){nn=1,pf=l,Kr=null;break}e:{var K=i,ie=C.return,ce=C,ge=l;if(l=An,ce.flags|=32768,ge!==null&&typeof ge=="object"&&typeof ge.then=="function"){var Ne=ge,Ve=ce,We=Ve.tag;if((Ve.mode&1)===0&&(We===0||We===11||We===15)){var Ge=Ve.alternate;Ge?(Ve.updateQueue=Ge.updateQueue,Ve.memoizedState=Ge.memoizedState,Ve.lanes=Ge.lanes):(Ve.updateQueue=null,Ve.memoizedState=null)}var ot=j(ie);if(ot!==null){ot.flags&=-257,B(ot,ie,ce,K,l),ot.mode&1&&p(K,Ne,l),l=ot,ge=Ne;var ft=l.updateQueue;if(ft===null){var pt=new Set;pt.add(ge),l.updateQueue=pt}else ft.add(ge);break e}else{if((l&1)===0){p(K,Ne,l),_g();break e}ge=Error(t(426))}}else if(Zt&&ce.mode&1){var Ur=j(ie);if(Ur!==null){(Ur.flags&65536)===0&&(Ur.flags|=256),B(Ur,ie,ce,K,l),Ss(Io(ge,ce));break e}}K=ge=Io(ge,ce),nn!==4&&(nn=2),gf===null?gf=[K]:gf.push(K),K=ie;do{switch(K.tag){case 3:K.flags|=65536,l&=-l,K.lanes|=l;var Ae=Mh(K,ge,l);Ps(K,Ae);break e;case 1:ce=ge;var be=K.type,Re=K.stateNode;if((K.flags&128)===0&&(typeof be.getDerivedStateFromError=="function"||Re!==null&&typeof Re.componentDidCatch=="function"&&(Nl===null||!Nl.has(Re)))){K.flags|=65536,l&=-l,K.lanes|=l;var Ze=u(K,ce,l);Ps(K,Ze);break e}}K=K.return}while(K!==null)}Sm(C)}catch(vt){l=vt,Kr===C&&C!==null&&(Kr=C=C.return);continue}break}while(!0)}function wm(){var i=Ih.current;return Ih.current=Al,i===null?Al:i}function _g(){(nn===0||nn===3||nn===2)&&(nn=4),vn===null||(As&268435455)===0&&(jh&268435455)===0||Dl(vn,An)}function qh(i,l){var C=Yt;Yt|=2;var D=wm();(vn!==i||An!==l)&&(jo=null,Rs(i,l));do try{v_();break}catch(H){bm(i,H)}while(!0);if(Lu(),Yt=C,Ih.current=D,Kr!==null)throw Error(t(261));return vn=null,An=0,nn}function v_(){for(;Kr!==null;)_m(Kr)}function m_(){for(;Kr!==null&&!Kp();)_m(Kr)}function _m(i){var l=Om(i.alternate,i,xi);i.memoizedProps=i.pendingProps,l===null?Sm(i):Kr=l,dg.current=null}function Sm(i){var l=i;do{var C=l.alternate;if(i=l.return,(l.flags&32768)===0){if(C=u_(C,l,xi),C!==null){Kr=C;return}}else{if(C=c_(C,l),C!==null){C.flags&=32767,Kr=C;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{nn=6,Kr=null;return}}if(l=l.sibling,l!==null){Kr=l;return}Kr=l=i}while(l!==null);nn===0&&(nn=5)}function Ms(i,l,C){var D=$t,H=$i.transition;try{$i.transition=null,$t=1,y_(i,l,C,D)}finally{$i.transition=H,$t=D}return null}function y_(i,l,C,D){do Xu();while(Il!==null);if((Yt&6)!==0)throw Error(t(327));C=i.finishedWork;var H=i.finishedLanes;if(C===null)return null;if(i.finishedWork=null,i.finishedLanes=0,C===i.current)throw Error(t(177));i.callbackNode=null,i.callbackPriority=0;var K=C.lanes|C.childLanes;if(Qp(i,K),i===vn&&(Kr=vn=null,An=0),(C.subtreeFlags&2064)===0&&(C.flags&2064)===0||Fh||(Fh=!0,Pm(Qo,function(){return Xu(),null})),K=(C.flags&15990)!==0,(C.subtreeFlags&15990)!==0||K){K=$i.transition,$i.transition=null;var ie=$t;$t=1;var ce=Yt;Yt|=4,dg.current=null,d_(i,C),dm(C,i),ds(Kc),ou=!!Yc,Kc=Yc=null,i.current=C,h_(C),Xp(),Yt=ce,$t=ie,$i.transition=K}else i.current=C;if(Fh&&(Fh=!1,Il=i,zh=H),K=i.pendingLanes,K===0&&(Nl=null),fr(C.stateNode),ui(i,Pr()),l!==null)for(D=i.onRecoverableError,C=0;C<l.length;C++)H=l[C],D(H.value,{componentStack:H.stack,digest:H.digest});if(Dh)throw Dh=!1,i=gg,gg=null,i;return(zh&1)!==0&&i.tag!==0&&Xu(),K=i.pendingLanes,(K&1)!==0?i===vg?vf++:(vf=0,vg=i):vf=0,qa(),null}function Xu(){if(Il!==null){var i=is(zh),l=$i.transition,C=$t;try{if($i.transition=null,$t=16>i?16:i,Il===null)var D=!1;else{if(i=Il,Il=null,zh=0,(Yt&6)!==0)throw Error(t(331));var H=Yt;for(Yt|=4,ct=i.current;ct!==null;){var K=ct,ie=K.child;if((ct.flags&16)!==0){var ce=K.deletions;if(ce!==null){for(var ge=0;ge<ce.length;ge++){var Ne=ce[ge];for(ct=Ne;ct!==null;){var Ve=ct;switch(Ve.tag){case 0:case 11:case 15:hf(8,Ve,K)}var We=Ve.child;if(We!==null)We.return=Ve,ct=We;else for(;ct!==null;){Ve=ct;var Ge=Ve.sibling,ot=Ve.return;if(lm(Ve),Ve===Ne){ct=null;break}if(Ge!==null){Ge.return=ot,ct=Ge;break}ct=ot}}}var ft=K.alternate;if(ft!==null){var pt=ft.child;if(pt!==null){ft.child=null;do{var Ur=pt.sibling;pt.sibling=null,pt=Ur}while(pt!==null)}}ct=K}}if((K.subtreeFlags&2064)!==0&&ie!==null)ie.return=K,ct=ie;else e:for(;ct!==null;){if(K=ct,(K.flags&2048)!==0)switch(K.tag){case 0:case 11:case 15:hf(9,K,K.return)}var Ae=K.sibling;if(Ae!==null){Ae.return=K.return,ct=Ae;break e}ct=K.return}}var be=i.current;for(ct=be;ct!==null;){ie=ct;var Re=ie.child;if((ie.subtreeFlags&2064)!==0&&Re!==null)Re.return=ie,ct=Re;else e:for(ie=be;ct!==null;){if(ce=ct,(ce.flags&2048)!==0)try{switch(ce.tag){case 0:case 11:case 15:Nh(9,ce)}}catch(vt){Mr(ce,ce.return,vt)}if(ce===ie){ct=null;break e}var Ze=ce.sibling;if(Ze!==null){Ze.return=ce.return,ct=Ze;break e}ct=ce.return}}if(Yt=H,qa(),Zr&&typeof Zr.onPostCommitFiberRoot=="function")try{Zr.onPostCommitFiberRoot(Qi,i)}catch{}D=!0}return D}finally{$t=C,$i.transition=l}}return!1}function Em(i,l,C){l=Io(C,l),l=Mh(i,l,1),i=Gi(i,l,1),l=Zn(),i!==null&&(ns(i,1,l),ui(i,l))}function Mr(i,l,C){if(i.tag===3)Em(i,i,C);else for(;l!==null;){if(l.tag===3){Em(l,i,C);break}else if(l.tag===1){var D=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof D.componentDidCatch=="function"&&(Nl===null||!Nl.has(D))){i=Io(C,i),i=u(l,i,1),l=Gi(l,i,1),i=Zn(),l!==null&&(ns(l,1,i),ui(l,i));break}}l=l.return}}function b_(i,l,C){var D=i.pingCache;D!==null&&D.delete(l),l=Zn(),i.pingedLanes|=i.suspendedLanes&C,vn===i&&(An&C)===C&&(nn===4||nn===3&&(An&130023424)===An&&500>Pr()-pg?Rs(i,0):hg|=C),ui(i,l)}function xm(i,l){l===0&&((i.mode&1)===0?l=1:(l=Ji,Ji<<=1,(Ji&130023424)===0&&(Ji=4194304)));var C=Zn();i=Kn(i,l),i!==null&&(ns(i,l,C),ui(i,C))}function w_(i){var l=i.memoizedState,C=0;l!==null&&(C=l.retryLane),xm(i,C)}function __(i,l){var C=0;switch(i.tag){case 13:var D=i.stateNode,H=i.memoizedState;H!==null&&(C=H.retryLane);break;case 19:D=i.stateNode;break;default:throw Error(t(314))}D!==null&&D.delete(l),xm(i,C)}var Om;Om=function(i,l,C){if(i!==null)if(i.memoizedProps!==l.pendingProps||cn.current)J=!0;else{if((i.lanes&C)===0&&(l.flags&128)===0)return J=!1,og(i,l,C);J=(i.flags&131072)!==0}else J=!1,Zt&&(l.flags&1048576)!==0&&_h(l,Ga,l.index);switch(l.lanes=0,l.tag){case 2:var D=l.type;Ut(i,l),i=l.pendingProps;var H=Po(l,tn.current);la(l,C),H=Ol(null,l,D,i,H,C);var K=Pl();return l.flags|=1,typeof H=="object"&&H!==null&&typeof H.render=="function"&&H.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,fn(D)?(K=!0,Co(l)):K=!1,l.memoizedState=H.state!==null&&H.state!==void 0?H.state:null,Os(l),H.updater=Rl,l.stateNode=H,H._reactInternals=l,Vu(l,D,i,C),l=Qt(null,l,D,!0,K,C)):(l.tag=0,Zt&&K&&ml(l),le(null,l,H,C),l=l.child),l;case 16:D=l.elementType;e:{switch(Ut(i,l),i=l.pendingProps,H=D._init,D=H(D._payload),l.type=D,H=l.tag=E_(D),i=rn(D,i),H){case 0:l=nt(null,l,D,i,C);break e;case 1:l=sr(null,l,D,i,C);break e;case 11:l=Ee(null,l,D,i,C);break e;case 14:l=Ie(null,l,D,rn(D.type,i),C);break e}throw Error(t(306,D,""))}return l;case 0:return D=l.type,H=l.pendingProps,H=l.elementType===D?H:rn(D,H),nt(i,l,D,H,C);case 1:return D=l.type,H=l.pendingProps,H=l.elementType===D?H:rn(D,H),sr(i,l,D,H,C);case 3:e:{if(Cn(l),i===null)throw Error(t(387));D=l.pendingProps,K=l.memoizedState,H=K.element,ju(i,l),_l(l,D,null,C);var ie=l.memoizedState;if(D=ie.element,K.isDehydrated)if(K={element:D,isDehydrated:!1,cache:ie.cache,pendingSuspenseBoundaries:ie.pendingSuspenseBoundaries,transitions:ie.transitions},l.updateQueue.baseState=K,l.memoizedState=K,l.flags&256){H=Io(Error(t(423)),l),l=Vi(i,l,D,C,H);break e}else if(D!==H){H=Io(Error(t(424)),l),l=Vi(i,l,D,C,H);break e}else for(tt=Di(l.stateNode.containerInfo.firstChild),$n=l,Zt=!0,Wn=null,C=oi(l,null,D,C),l.child=C;C;)C.flags=C.flags&-3|4096,C=C.sibling;else{if(Ro(),D===H){l=gn(i,l,C);break e}le(i,l,D,C)}l=l.child}return l;case 5:return Sl(l),i===null&&yl(l),D=l.type,H=l.pendingProps,K=i!==null?i.memoizedProps:null,ie=H.children,Xc(D,H)?ie=null:K!==null&&Xc(D,K)&&(l.flags|=32),Tt(i,l),le(i,l,ie,C),l.child;case 6:return i===null&&yl(l),null;case 13:return De(i,l,C);case 4:return $a(l,l.stateNode.containerInfo),D=l.pendingProps,i===null?l.child=Mo(l,null,D,C):le(i,l,D,C),l.child;case 11:return D=l.type,H=l.pendingProps,H=l.elementType===D?H:rn(D,H),Ee(i,l,D,H,C);case 7:return le(i,l,l.pendingProps,C),l.child;case 8:return le(i,l,l.pendingProps.children,C),l.child;case 12:return le(i,l,l.pendingProps.children,C),l.child;case 10:e:{if(D=l.type._context,H=l.pendingProps,K=l.memoizedProps,ie=H.value,rr(Es,D._currentValue),D._currentValue=ie,K!==null)if(In(K.value,ie)){if(K.children===H.children&&!cn.current){l=gn(i,l,C);break e}}else for(K=l.child,K!==null&&(K.return=l);K!==null;){var ce=K.dependencies;if(ce!==null){ie=K.child;for(var ge=ce.firstContext;ge!==null;){if(ge.context===D){if(K.tag===1){ge=Hi(-1,C&-C),ge.tag=2;var Ne=K.updateQueue;if(Ne!==null){Ne=Ne.shared;var Ve=Ne.pending;Ve===null?ge.next=ge:(ge.next=Ve.next,Ve.next=ge),Ne.pending=ge}}K.lanes|=C,ge=K.alternate,ge!==null&&(ge.lanes|=C),Iu(K.return,C,l),ce.lanes|=C;break}ge=ge.next}}else if(K.tag===10)ie=K.type===l.type?null:K.child;else if(K.tag===18){if(ie=K.return,ie===null)throw Error(t(341));ie.lanes|=C,ce=ie.alternate,ce!==null&&(ce.lanes|=C),Iu(ie,C,l),ie=K.sibling}else ie=K.child;if(ie!==null)ie.return=K;else for(ie=K;ie!==null;){if(ie===l){ie=null;break}if(K=ie.sibling,K!==null){K.return=ie.return,ie=K;break}ie=ie.return}K=ie}le(i,l,H.children,C),l=l.child}return l;case 9:return H=l.type,D=l.pendingProps.children,la(l,C),H=On(H),D=D(H),l.flags|=1,le(i,l,D,C),l.child;case 14:return D=l.type,H=rn(D,l.pendingProps),H=rn(D.type,H),Ie(i,l,D,H,C);case 15:return Xe(i,l,l.type,l.pendingProps,C);case 17:return D=l.type,H=l.pendingProps,H=l.elementType===D?H:rn(D,H),Ut(i,l),l.tag=1,fn(D)?(i=!0,Co(l)):i=!1,la(l,C),Rh(l,D,H),Vu(l,D,H,C),Qt(null,l,D,!0,i,C);case 19:return Br(i,l,C);case 22:return st(i,l,C)}throw Error(t(156,l.tag))};function Pm(i,l){return Qs(i,l)}function S_(i,l,C,D){this.tag=i,this.key=C,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=D,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wi(i,l,C,D){return new S_(i,l,C,D)}function Sg(i){return i=i.prototype,!(!i||!i.isReactComponent)}function E_(i){if(typeof i=="function")return Sg(i)?1:0;if(i!=null){if(i=i.$$typeof,i===N)return 11;if(i===L)return 14}return 2}function Fl(i,l){var C=i.alternate;return C===null?(C=Wi(i.tag,l,i.key,i.mode),C.elementType=i.elementType,C.type=i.type,C.stateNode=i.stateNode,C.alternate=i,i.alternate=C):(C.pendingProps=l,C.type=i.type,C.flags=0,C.subtreeFlags=0,C.deletions=null),C.flags=i.flags&14680064,C.childLanes=i.childLanes,C.lanes=i.lanes,C.child=i.child,C.memoizedProps=i.memoizedProps,C.memoizedState=i.memoizedState,C.updateQueue=i.updateQueue,l=i.dependencies,C.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},C.sibling=i.sibling,C.index=i.index,C.ref=i.ref,C}function Hh(i,l,C,D,H,K){var ie=2;if(D=i,typeof i=="function")Sg(i)&&(ie=1);else if(typeof i=="string")ie=5;else e:switch(i){case T:return Ls(C.children,H,K,l);case I:ie=8,H|=8;break;case F:return i=Wi(12,C,l,H|2),i.elementType=F,i.lanes=K,i;case A:return i=Wi(13,C,l,H),i.elementType=A,i.lanes=K,i;case R:return i=Wi(19,C,l,H),i.elementType=R,i.lanes=K,i;case G:return Gh(C,H,K,l);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case k:ie=10;break e;case O:ie=9;break e;case N:ie=11;break e;case L:ie=14;break e;case V:ie=16,D=null;break e}throw Error(t(130,i==null?i:typeof i,""))}return l=Wi(ie,C,l,H),l.elementType=i,l.type=D,l.lanes=K,l}function Ls(i,l,C,D){return i=Wi(7,i,D,l),i.lanes=C,i}function Gh(i,l,C,D){return i=Wi(22,i,D,l),i.elementType=G,i.lanes=C,i.stateNode={isHidden:!1},i}function Eg(i,l,C){return i=Wi(6,i,null,l),i.lanes=C,i}function xg(i,l,C){return l=Wi(4,i.children!==null?i.children:[],i.key,l),l.lanes=C,l.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},l}function x_(i,l,C,D,H){this.tag=l,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zn(0),this.expirationTimes=zn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zn(0),this.identifierPrefix=D,this.onRecoverableError=H,this.mutableSourceEagerHydrationData=null}function Og(i,l,C,D,H,K,ie,ce,ge){return i=new x_(i,l,C,ce,ge),l===1?(l=1,K===!0&&(l|=8)):l=0,K=Wi(3,null,null,l),i.current=K,K.stateNode=i,K.memoizedState={element:D,isDehydrated:C,cache:null,transitions:null,pendingSuspenseBoundaries:null},Os(K),i}function O_(i,l,C){var D=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:D==null?null:""+D,children:i,containerInfo:l,implementation:C}}function Cm(i){if(!i)return zi;i=i._reactInternals;e:{if(Nr(i)!==i||i.tag!==1)throw Error(t(170));var l=i;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(fn(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(t(171))}if(i.tag===1){var C=i.type;if(fn(C))return ku(i,C,l)}return l}function km(i,l,C,D,H,K,ie,ce,ge){return i=Og(C,D,!0,i,H,K,ie,ce,ge),i.context=Cm(null),C=i.current,D=Zn(),H=jl(C),K=Hi(D,H),K.callback=l??null,Gi(C,K,H),i.current.lanes=H,ns(i,H,D),ui(i,D),i}function Vh(i,l,C,D){var H=l.current,K=Zn(),ie=jl(H);return C=Cm(C),l.context===null?l.context=C:l.pendingContext=C,l=Hi(K,ie),l.payload={element:i},D=D===void 0?null:D,D!==null&&(l.callback=D),i=Gi(H,l,ie),i!==null&&(ha(i,H,ie,K),Du(i,H,ie)),ie}function $h(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function Am(i,l){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var C=i.retryLane;i.retryLane=C!==0&&C<l?C:l}}function Pg(i,l){Am(i,l),(i=i.alternate)&&Am(i,l)}function P_(){return null}var Tm=typeof reportError=="function"?reportError:function(i){console.error(i)};function Cg(i){this._internalRoot=i}Wh.prototype.render=Cg.prototype.render=function(i){var l=this._internalRoot;if(l===null)throw Error(t(409));Vh(i,l,null,null)},Wh.prototype.unmount=Cg.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var l=i.containerInfo;Ts(function(){Vh(null,i,null,null)}),l[Fi]=null}};function Wh(i){this._internalRoot=i}Wh.prototype.unstable_scheduleHydration=function(i){if(i){var l=Qd();i={blockedOn:null,target:i,priority:l};for(var C=0;C<ji.length&&l!==0&&l<ji[C].priority;C++);ji.splice(C,0,i),C===0&&nu(i)}};function kg(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function Yh(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function Rm(){}function C_(i,l,C,D,H){if(H){if(typeof D=="function"){var K=D;D=function(){var Ne=$h(ie);K.call(Ne)}}var ie=km(l,D,i,0,null,!1,!1,"",Rm);return i._reactRootContainer=ie,i[Fi]=ie.current,_o(i.nodeType===8?i.parentNode:i),Ts(),ie}for(;H=i.lastChild;)i.removeChild(H);if(typeof D=="function"){var ce=D;D=function(){var Ne=$h(ge);ce.call(Ne)}}var ge=Og(i,0,!1,null,null,!1,!1,"",Rm);return i._reactRootContainer=ge,i[Fi]=ge.current,_o(i.nodeType===8?i.parentNode:i),Ts(function(){Vh(l,ge,C,D)}),ge}function Kh(i,l,C,D,H){var K=C._reactRootContainer;if(K){var ie=K;if(typeof H=="function"){var ce=H;H=function(){var ge=$h(ie);ce.call(ge)}}Vh(l,ie,i,H)}else ie=C_(C,l,i,H,D);return $h(ie)}el=function(i){switch(i.tag){case 3:var l=i.stateNode;if(l.current.memoizedState.isDehydrated){var C=Gr(l.pendingLanes);C!==0&&(Cc(l,C|1),ui(l,Pr()),(Yt&6)===0&&(Ku=Pr()+500,qa()))}break;case 13:Ts(function(){var D=Kn(i,1);if(D!==null){var H=Zn();ha(D,i,1,H)}}),Pg(i,1)}},tl=function(i){if(i.tag===13){var l=Kn(i,134217728);if(l!==null){var C=Zn();ha(l,i,134217728,C)}Pg(i,134217728)}},Zd=function(i){if(i.tag===13){var l=jl(i),C=Kn(i,l);if(C!==null){var D=Zn();ha(C,i,l,D)}Pg(i,l)}},Qd=function(){return $t},tu=function(i,l){var C=$t;try{return $t=i,l()}finally{$t=C}},qe=function(i,l,C){switch(l){case"input":if(Te(i,C),l=C.name,C.type==="radio"&&l!=null){for(C=i;C.parentNode;)C=C.parentNode;for(C=C.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<C.length;l++){var D=C[l];if(D!==i&&D.form===i.form){var H=Wr(D);if(!H)throw Error(t(90));fe(D),Te(D,H)}}}break;case"textarea":de(i,C);break;case"select":l=C.value,l!=null&&xe(i,!!C.multiple,l,!1)}},at=bg,Pe=Ts;var k_={usingClientEntryPoint:!1,Events:[bs,Dr,Wr,ht,ze,bg]},mf={findFiberByHostInstance:Ba,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},A_={bundleType:mf.bundleType,version:mf.version,rendererPackageName:mf.rendererPackageName,rendererConfig:mf.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:d.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=ti(i),i===null?null:i.stateNode},findFiberByHostInstance:mf.findFiberByHostInstance||P_,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xh.isDisabled&&Xh.supportsFiber)try{Qi=Xh.inject(A_),Zr=Xh}catch{}}return ci.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=k_,ci.createPortal=function(i,l){var C=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!kg(l))throw Error(t(200));return O_(i,l,null,C)},ci.createRoot=function(i,l){if(!kg(i))throw Error(t(299));var C=!1,D="",H=Tm;return l!=null&&(l.unstable_strictMode===!0&&(C=!0),l.identifierPrefix!==void 0&&(D=l.identifierPrefix),l.onRecoverableError!==void 0&&(H=l.onRecoverableError)),l=Og(i,1,!1,null,null,C,!1,D,H),i[Fi]=l.current,_o(i.nodeType===8?i.parentNode:i),new Cg(l)},ci.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var l=i._reactInternals;if(l===void 0)throw typeof i.render=="function"?Error(t(188)):(i=Object.keys(i).join(","),Error(t(268,i)));return i=ti(l),i=i===null?null:i.stateNode,i},ci.flushSync=function(i){return Ts(i)},ci.hydrate=function(i,l,C){if(!Yh(l))throw Error(t(200));return Kh(null,i,l,!0,C)},ci.hydrateRoot=function(i,l,C){if(!kg(i))throw Error(t(405));var D=C!=null&&C.hydratedSources||null,H=!1,K="",ie=Tm;if(C!=null&&(C.unstable_strictMode===!0&&(H=!0),C.identifierPrefix!==void 0&&(K=C.identifierPrefix),C.onRecoverableError!==void 0&&(ie=C.onRecoverableError)),l=km(l,null,i,1,C??null,H,!1,K,ie),i[Fi]=l.current,_o(i),D)for(i=0;i<D.length;i++)C=D[i],H=C._getVersion,H=H(C._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[C,H]:l.mutableSourceEagerHydrationData.push(C,H);return new Wh(l)},ci.render=function(i,l,C){if(!Yh(l))throw Error(t(200));return Kh(null,i,l,!1,C)},ci.unmountComponentAtNode=function(i){if(!Yh(i))throw Error(t(40));return i._reactRootContainer?(Ts(function(){Kh(null,null,i,!1,function(){i._reactRootContainer=null,i[Fi]=null})}),!0):!1},ci.unstable_batchedUpdates=bg,ci.unstable_renderSubtreeIntoContainer=function(i,l,C,D){if(!Yh(C))throw Error(t(200));if(i==null||i._reactInternals===void 0)throw Error(t(38));return Kh(i,l,C,!1,D)},ci.version="18.3.1-next-f1338f8080-20240426",ci}var Dm;function u5(){if(Dm)return Tg.exports;Dm=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Tg.exports=L_(),Tg.exports}var Fm;function N_(){if(Fm)return Zh;Fm=1;var e=u5();return Zh.createRoot=e.createRoot,Zh.hydrateRoot=e.hydrateRoot,Zh}var I_=N_();const c5=jd(I_);var yf={};function Lt(e){for(var n=arguments.length,t=new Array(n>1?n-1:0),r=1;r<n;r++)t[r-1]=arguments[r];throw new Error(typeof e=="number"?"[MobX] minified error nr: "+e+(t.length?" "+t.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+e)}var j_={};function Pp(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:j_}var f5=Object.assign,dp=Object.getOwnPropertyDescriptor,to=Object.defineProperty,Dd=Object.prototype,$1=[];Object.freeze($1);var sv={};Object.freeze(sv);var D_=typeof Proxy<"u",F_=Object.toString();function d5(){D_||Lt("Proxy not available")}function h5(e){var n=!1;return function(){if(!n)return n=!0,e.apply(this,arguments)}}var rc=function(){};function Ai(e){return typeof e=="function"}function Bs(e){var n=typeof e;switch(n){case"string":case"symbol":case"number":return!0}return!1}function Cp(e){return e!==null&&typeof e=="object"}function Ko(e){if(!Cp(e))return!1;var n=Object.getPrototypeOf(e);if(n==null)return!0;var t=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return typeof t=="function"&&t.toString()===F_}function p5(e){var n=e==null?void 0:e.constructor;return n?n.name==="GeneratorFunction"||n.displayName==="GeneratorFunction":!1}function Fd(e,n,t){to(e,n,{enumerable:!1,writable:!0,configurable:!0,value:t})}function g5(e,n,t){to(e,n,{enumerable:!1,writable:!1,configurable:!0,value:t})}function Kl(e,n){var t="isMobX"+e;return n.prototype[t]=!0,function(r){return Cp(r)&&r[t]===!0}}function yc(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function z_(e){var n=Object.getPrototypeOf(e),t=Object.getPrototypeOf(n),r=Object.getPrototypeOf(t);return r===null}function Vo(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var v5=typeof Object.getOwnPropertySymbols<"u";function B_(e){var n=Object.keys(e);if(!v5)return n;var t=Object.getOwnPropertySymbols(e);return t.length?[].concat(n,t.filter(function(r){return Dd.propertyIsEnumerable.call(e,r)})):n}var lc=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:v5?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function m5(e){return e===null?null:typeof e=="object"?""+e:e}function $o(e,n){return Dd.hasOwnProperty.call(e,n)}var U_=Object.getOwnPropertyDescriptors||function(n){var t={};return lc(n).forEach(function(r){t[r]=dp(n,r)}),t};function Ci(e,n){return!!(e&n)}function ki(e,n,t){return t?e|=n:e&=~n,e}function zm(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function q_(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,G_(r.key),r)}}function bc(e,n,t){return n&&q_(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function nc(e,n){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=V_(e))||n){t&&(e=t);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
33
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $l(){return $l=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},$l.apply(null,arguments)}function y5(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,W1(e,n)}function W1(e,n){return W1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},W1(e,n)}function H_(e,n){if(typeof e!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var r=t.call(e,n);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function G_(e){var n=H_(e,"string");return typeof n=="symbol"?n:n+""}function V_(e,n){if(e){if(typeof e=="string")return zm(e,n);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?zm(e,n):void 0}}var eo=Symbol("mobx-stored-annotations");function _a(e){function n(t,r){if(Bd(r))return e.decorate_20223_(t,r);zd(t,r,e)}return Object.assign(n,e)}function zd(e,n,t){$o(e,eo)||Fd(e,eo,$l({},e[eo])),e6(t)||(e[eo][n]=t)}function $_(e){return $o(e,eo)||Fd(e,eo,$l({},e[eo])),e[eo]}function Bd(e){return typeof e=="object"&&typeof e.kind=="string"}var bt=Symbol("mobx administration"),Xl=function(){function e(t){t===void 0&&(t="Atom"),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=Xt.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=t}var n=e.prototype;return n.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},n.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},n.reportObserved=function(){return D5(this)},n.reportChanged=function(){di(),F5(this),hi()},n.toString=function(){return this.name_},bc(e,[{key:"isBeingObserved",get:function(){return Ci(this.flags_,e.isBeingObservedMask_)},set:function(r){this.flags_=ki(this.flags_,e.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return Ci(this.flags_,e.isPendingUnobservationMask_)},set:function(r){this.flags_=ki(this.flags_,e.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return Ci(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=ki(this.flags_,e.diffValueMask_,r===1)}}])}();Xl.isBeingObservedMask_=1;Xl.isPendingUnobservationMask_=2;Xl.diffValueMask_=4;var uv=Kl("Atom",Xl);function Ad(e,n,t){n===void 0&&(n=rc),t===void 0&&(t=rc);var r=new Xl(e);return n!==rc&&W5(r,n),t!==rc&&gv(r,t),r}function W_(e,n){return e===n}function Y_(e,n){return Ov(e,n)}function K_(e,n){return Ov(e,n,1)}function X_(e,n){return Object.is?Object.is(e,n):e===n?e!==0||1/e===1/n:e!==e&&n!==n}var Us={identity:W_,structural:Y_,default:X_,shallow:K_};function qs(e,n,t){return Ip(e)?e:Array.isArray(e)?ur.array(e,{name:t}):Ko(e)?ur.object(e,void 0,{name:t}):yc(e)?ur.map(e,{name:t}):Vo(e)?ur.set(e,{name:t}):typeof e=="function"&&!cc(e)&&!fc(e)?p5(e)?Gs(e):sc(t,e):e}function Z_(e,n,t){if(e==null||yn(e)||Qn(e)||Rn(e)||an(e))return e;if(Array.isArray(e))return ur.array(e,{name:t,deep:!1});if(Ko(e))return ur.object(e,void 0,{name:t,deep:!1});if(yc(e))return ur.map(e,{name:t,deep:!1});if(Vo(e))return ur.set(e,{name:t,deep:!1})}function kp(e){return e}function Q_(e,n){return Ov(e,n)?n:e}var b5="override",J_=_a({annotationType_:b5,make_:t6,extend_:r6,decorate_20223_:n6});function e6(e){return e.annotationType_===b5}function t6(e,n){return 0}function r6(e,n,t,r){Lt("'"+this.annotationType_+"' can only be used with 'makeObservable'")}function n6(e,n){console.warn("'"+this.annotationType_+"' cannot be used with decorators - this is a no-op")}function Ud(e,n){return{annotationType_:e,options_:n,make_:i6,extend_:a6,decorate_20223_:o6}}function i6(e,n,t,r){var a;if((a=this.options_)!=null&&a.bound)return this.extend_(e,n,t,!1)===null?0:1;if(r===e.target_)return this.extend_(e,n,t,!1)===null?0:2;if(cc(t.value))return 1;var o=w5(e,this,n,t,!1);return to(r,n,o),2}function a6(e,n,t,r){var a=w5(e,this,n,t);return e.defineProperty_(n,a,r)}function o6(e,n){var t=n.kind,r=n.name,a=n.addInitializer,o=this,s=function(f){var v,y,E,w;return Wl((v=(y=o.options_)==null?void 0:y.name)!=null?v:r.toString(),f,(E=(w=o.options_)==null?void 0:w.autoAction)!=null?E:!1)};if(t=="field")return function(m){var f,v=m;return cc(v)||(v=s(v)),(f=o.options_)!=null&&f.bound&&(v=v.bind(this),v.isMobxAction=!0),v};if(t=="method"){var c;return cc(e)||(e=s(e)),(c=this.options_)!=null&&c.bound&&a(function(){var m=this,f=m[r].bind(m);f.isMobxAction=!0,m[r]=f}),e}Lt("Cannot apply '"+o.annotationType_+"' to '"+String(r)+"' (kind: "+t+"):"+(`
34
- '`+o.annotationType_+"' can only be used on properties with a function value."))}function l6(e,n,t,r){n.annotationType_,r.value}function w5(e,n,t,r,a){var o,s,c,m,f,v,y;a===void 0&&(a=Je.safeDescriptors),l6(e,n,t,r);var E=r.value;if((o=n.options_)!=null&&o.bound){var w;E=E.bind((w=e.proxy_)!=null?w:e.target_)}return{value:Wl((s=(c=n.options_)==null?void 0:c.name)!=null?s:t.toString(),E,(m=(f=n.options_)==null?void 0:f.autoAction)!=null?m:!1,(v=n.options_)!=null&&v.bound?(y=e.proxy_)!=null?y:e.target_:void 0),configurable:a?e.isPlainObject_:!0,enumerable:!1,writable:!a}}function _5(e,n){return{annotationType_:e,options_:n,make_:s6,extend_:u6,decorate_20223_:c6}}function s6(e,n,t,r){var a;if(r===e.target_)return this.extend_(e,n,t,!1)===null?0:2;if((a=this.options_)!=null&&a.bound&&(!$o(e.target_,n)||!fc(e.target_[n]))&&this.extend_(e,n,t,!1)===null)return 0;if(fc(t.value))return 1;var o=S5(e,this,n,t,!1,!1);return to(r,n,o),2}function u6(e,n,t,r){var a,o=S5(e,this,n,t,(a=this.options_)==null?void 0:a.bound);return e.defineProperty_(n,o,r)}function c6(e,n){var t,r=n.name,a=n.addInitializer;return fc(e)||(e=Gs(e)),(t=this.options_)!=null&&t.bound&&a(function(){var o=this,s=o[r].bind(o);s.isMobXFlow=!0,o[r]=s}),e}function f6(e,n,t,r){n.annotationType_,r.value}function S5(e,n,t,r,a,o){o===void 0&&(o=Je.safeDescriptors),f6(e,n,t,r);var s=r.value;if(fc(s)||(s=Gs(s)),a){var c;s=s.bind((c=e.proxy_)!=null?c:e.target_),s.isMobXFlow=!0}return{value:s,configurable:o?e.isPlainObject_:!0,enumerable:!1,writable:!o}}function cv(e,n){return{annotationType_:e,options_:n,make_:d6,extend_:h6,decorate_20223_:p6}}function d6(e,n,t){return this.extend_(e,n,t,!1)===null?0:1}function h6(e,n,t,r){return g6(e,this,n,t),e.defineComputedProperty_(n,$l({},this.options_,{get:t.get,set:t.set}),r)}function p6(e,n){var t=this,r=n.name,a=n.addInitializer;return a(function(){var o=Ws(this)[bt],s=$l({},t.options_,{get:e,context:this});s.name||(s.name="ObservableObject."+r.toString()),o.values_.set(r,new xa(s))}),function(){return this[bt].getObservablePropValue_(r)}}function g6(e,n,t,r){n.annotationType_,r.get}function Ap(e,n){return{annotationType_:e,options_:n,make_:v6,extend_:m6,decorate_20223_:y6}}function v6(e,n,t){return this.extend_(e,n,t,!1)===null?0:1}function m6(e,n,t,r){var a,o;return b6(e,this),e.defineObservableProperty_(n,t.value,(a=(o=this.options_)==null?void 0:o.enhancer)!=null?a:qs,r)}function y6(e,n){var t=this,r=n.kind,a=n.name,o=new WeakSet;function s(c,m){var f,v,y=Ws(c)[bt],E=new Gl(m,(f=(v=t.options_)==null?void 0:v.enhancer)!=null?f:qs,"ObservableObject."+a.toString(),!1);y.values_.set(a,E),o.add(c)}if(r=="accessor")return{get:function(){return o.has(this)||s(this,e.get.call(this)),this[bt].getObservablePropValue_(a)},set:function(m){return o.has(this)||s(this,m),this[bt].setObservablePropValue_(a,m)},init:function(m){return o.has(this)||s(this,m),m}}}function b6(e,n,t,r){n.annotationType_}var w6="true",_6=E5();function E5(e){return{annotationType_:w6,options_:e,make_:S6,extend_:E6,decorate_20223_:x6}}function S6(e,n,t,r){var a,o;if(t.get)return Vs.make_(e,n,t,r);if(t.set){var s=Wl(n.toString(),t.set);return r===e.target_?e.defineProperty_(n,{configurable:Je.safeDescriptors?e.isPlainObject_:!0,set:s})===null?0:2:(to(r,n,{configurable:!0,set:s}),2)}if(r!==e.target_&&typeof t.value=="function"){var c;if(p5(t.value)){var m,f=(m=this.options_)!=null&&m.autoBind?Gs.bound:Gs;return f.make_(e,n,t,r)}var v=(c=this.options_)!=null&&c.autoBind?sc.bound:sc;return v.make_(e,n,t,r)}var y=((a=this.options_)==null?void 0:a.deep)===!1?ur.ref:ur;if(typeof t.value=="function"&&(o=this.options_)!=null&&o.autoBind){var E;t.value=t.value.bind((E=e.proxy_)!=null?E:e.target_)}return y.make_(e,n,t,r)}function E6(e,n,t,r){var a,o;if(t.get)return Vs.extend_(e,n,t,r);if(t.set)return e.defineProperty_(n,{configurable:Je.safeDescriptors?e.isPlainObject_:!0,set:Wl(n.toString(),t.set)},r);if(typeof t.value=="function"&&(a=this.options_)!=null&&a.autoBind){var s;t.value=t.value.bind((s=e.proxy_)!=null?s:e.target_)}var c=((o=this.options_)==null?void 0:o.deep)===!1?ur.ref:ur;return c.extend_(e,n,t,r)}function x6(e,n){Lt("'"+this.annotationType_+"' cannot be used as a decorator")}var O6="observable",P6="observable.ref",C6="observable.shallow",k6="observable.struct",x5={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(x5);function Qh(e){return e||x5}var Y1=Ap(O6),A6=Ap(P6,{enhancer:kp}),T6=Ap(C6,{enhancer:Z_}),R6=Ap(k6,{enhancer:Q_}),O5=_a(Y1);function Jh(e){return e.deep===!0?qs:e.deep===!1?kp:L6(e.defaultDecorator)}function M6(e){var n;return e?(n=e.defaultDecorator)!=null?n:E5(e):void 0}function L6(e){var n,t;return e&&(n=(t=e.options_)==null?void 0:t.enhancer)!=null?n:qs}function P5(e,n,t){if(Bd(n))return Y1.decorate_20223_(e,n);if(Bs(n)){zd(e,n,Y1);return}return Ip(e)?e:Ko(e)?ur.object(e,n,t):Array.isArray(e)?ur.array(e,n):yc(e)?ur.map(e,n):Vo(e)?ur.set(e,n):typeof e=="object"&&e!==null?e:ur.box(e,n)}f5(P5,O5);var N6={box:function(n,t){var r=Qh(t);return new Gl(n,Jh(r),r.name,!0,r.equals)},array:function(n,t){var r=Qh(t);return(Je.useProxies===!1||r.proxy===!1?B8:T8)(n,Jh(r),r.name)},map:function(n,t){var r=Qh(t);return new Dp(n,Jh(r),r.name)},set:function(n,t){var r=Qh(t);return new Ev(n,Jh(r),r.name)},object:function(n,t,r){return Zl(function(){return vv(Je.useProxies===!1||(r==null?void 0:r.proxy)===!1?Ws({},r):P8({},r),n,t)})},ref:_a(A6),shallow:_a(T6),deep:O5,struct:_a(R6)},ur=f5(P5,N6),C5="computed",I6="computed.struct",K1=cv(C5),j6=cv(I6,{equals:Us.structural}),Vs=function(n,t){if(Bd(t))return K1.decorate_20223_(n,t);if(Bs(t))return zd(n,t,K1);if(Ko(n))return _a(cv(C5,n));var r=Ko(t)?t:{};return r.get=n,r.name||(r.name=n.name||""),new xa(r)};Object.assign(Vs,K1);Vs.struct=_a(j6);var Bm,Um,hp=0,D6=1,F6=(Bm=(Um=dp(function(){},"name"))==null?void 0:Um.configurable)!=null?Bm:!1,qm={value:"action",configurable:!0,writable:!1,enumerable:!1};function Wl(e,n,t,r){t===void 0&&(t=!1);function a(){return k5(e,t,n,r||this,arguments)}return a.isMobxAction=!0,a.toString=function(){return n.toString()},F6&&(qm.value=e,to(a,"name",qm)),a}function k5(e,n,t,r,a){var o=A5(e,n);try{return t.apply(r,a)}catch(s){throw o.error_=s,s}finally{T5(o)}}function A5(e,n,t,r){var a=!1,o=0,s=Je.trackingDerivation,c=!n||!s;di();var m=Je.allowStateChanges;c&&($s(),m=Tp(!0));var f=Mp(!0),v={runAsAction_:c,prevDerivation_:s,prevAllowStateChanges_:m,prevAllowStateReads_:f,notifySpy_:a,startTime_:o,actionId_:D6++,parentActionId_:hp};return hp=v.actionId_,v}function T5(e){hp!==e.actionId_&&Lt(30),hp=e.parentActionId_,e.error_!==void 0&&(Je.suppressReactionErrors=!0),Rp(e.prevAllowStateChanges_),ac(e.prevAllowStateReads_),hi(),e.runAsAction_&&Wo(e.prevDerivation_),Je.suppressReactionErrors=!1}function fv(e,n){var t=Tp(e);try{return n()}finally{Rp(t)}}function Tp(e){var n=Je.allowStateChanges;return Je.allowStateChanges=e,n}function Rp(e){Je.allowStateChanges=e}var Gl=function(e){function n(r,a,o,s,c){var m;return o===void 0&&(o="ObservableValue"),c===void 0&&(c=Us.default),m=e.call(this,o)||this,m.enhancer=void 0,m.name_=void 0,m.equals=void 0,m.hasUnreportedChange_=!1,m.interceptors_=void 0,m.changeListeners_=void 0,m.value_=void 0,m.dehancer=void 0,m.enhancer=a,m.name_=o,m.equals=c,m.value_=a(r,void 0,o),m}y5(n,e);var t=n.prototype;return t.dehanceValue=function(a){return this.dehancer!==void 0?this.dehancer(a):a},t.set=function(a){this.value_,a=this.prepareNewValue_(a),a!==Je.UNCHANGED&&this.setNewValue_(a)},t.prepareNewValue_=function(a){if(Yi(this)){var o=Ki(this,{object:this,type:ro,newValue:a});if(!o)return Je.UNCHANGED;a=o.newValue}return a=this.enhancer(a,this.value_,this.name_),this.equals(this.value_,a)?Je.UNCHANGED:a},t.setNewValue_=function(a){var o=this.value_;this.value_=a,this.reportChanged(),Sa(this)&&Ea(this,{type:ro,object:this,newValue:a,oldValue:o})},t.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},t.intercept_=function(a){return qd(this,a)},t.observe_=function(a,o){return o&&a({observableKind:"value",debugObjectName:this.name_,object:this,type:ro,newValue:this.value_,oldValue:void 0}),Hd(this,a)},t.raw=function(){return this.value_},t.toJSON=function(){return this.get()},t.toString=function(){return this.name_+"["+this.value_+"]"},t.valueOf=function(){return m5(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},n}(Xl),dv=Kl("ObservableValue",Gl),xa=function(){function e(t){this.dependenciesState_=Xt.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Xt.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new gp(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=pp.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,t.get||Lt(31),this.derivation=t.get,this.name_=t.name||"ComputedValue",t.set&&(this.setter_=Wl("ComputedValue-setter",t.set)),this.equals_=t.equals||(t.compareStructural||t.struct?Us.structural:Us.default),this.scope_=t.context,this.requiresReaction_=t.requiresReaction,this.keepAlive_=!!t.keepAlive}var n=e.prototype;return n.onBecomeStale_=function(){Y6(this)},n.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},n.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},n.get=function(){if(this.isComputing&&Lt(32,this.name_,this.derivation),Je.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)X1(this)&&(this.warnAboutUntrackedRead_(),di(),this.value_=this.computeValue_(!1),hi());else if(D5(this),X1(this)){var r=Je.trackingContext;this.keepAlive_&&!r&&(Je.trackingContext=this),this.trackAndCompute()&&W6(this),Je.trackingContext=r}var a=this.value_;if(op(a))throw a.cause;return a},n.set=function(r){if(this.setter_){this.isRunningSetter&&Lt(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,r)}finally{this.isRunningSetter=!1}}else Lt(34,this.name_)},n.trackAndCompute=function(){var r=this.value_,a=this.dependenciesState_===Xt.NOT_TRACKING_,o=this.computeValue_(!0),s=a||op(r)||op(o)||!this.equals_(r,o);return s&&(this.value_=o),s},n.computeValue_=function(r){this.isComputing=!0;var a=Tp(!1),o;if(r)o=R5(this,this.derivation,this.scope_);else if(Je.disableErrorBoundaries===!0)o=this.derivation.call(this.scope_);else try{o=this.derivation.call(this.scope_)}catch(s){o=new gp(s)}return Rp(a),this.isComputing=!1,o},n.suspend_=function(){this.keepAlive_||(Z1(this),this.value_=void 0)},n.observe_=function(r,a){var o=this,s=!0,c=void 0;return pv(function(){var m=o.get();if(!s||a){var f=$s();r({observableKind:"computed",debugObjectName:o.name_,type:ro,object:o,newValue:m,oldValue:c}),Wo(f)}s=!1,c=m})},n.warnAboutUntrackedRead_=function(){},n.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},n.valueOf=function(){return m5(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},bc(e,[{key:"isComputing",get:function(){return Ci(this.flags_,e.isComputingMask_)},set:function(r){this.flags_=ki(this.flags_,e.isComputingMask_,r)}},{key:"isRunningSetter",get:function(){return Ci(this.flags_,e.isRunningSetterMask_)},set:function(r){this.flags_=ki(this.flags_,e.isRunningSetterMask_,r)}},{key:"isBeingObserved",get:function(){return Ci(this.flags_,e.isBeingObservedMask_)},set:function(r){this.flags_=ki(this.flags_,e.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return Ci(this.flags_,e.isPendingUnobservationMask_)},set:function(r){this.flags_=ki(this.flags_,e.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return Ci(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=ki(this.flags_,e.diffValueMask_,r===1)}}])}();xa.isComputingMask_=1;xa.isRunningSetterMask_=2;xa.isBeingObservedMask_=4;xa.isPendingUnobservationMask_=8;xa.diffValueMask_=16;var Hs=Kl("ComputedValue",xa),Xt;(function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"})(Xt||(Xt={}));var pp;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(pp||(pp={}));var gp=function(n){this.cause=void 0,this.cause=n};function op(e){return e instanceof gp}function X1(e){switch(e.dependenciesState_){case Xt.UP_TO_DATE_:return!1;case Xt.NOT_TRACKING_:case Xt.STALE_:return!0;case Xt.POSSIBLY_STALE_:{for(var n=Mp(!0),t=$s(),r=e.observing_,a=r.length,o=0;o<a;o++){var s=r[o];if(Hs(s)){if(Je.disableErrorBoundaries)s.get();else try{s.get()}catch{return Wo(t),ac(n),!0}if(e.dependenciesState_===Xt.STALE_)return Wo(t),ac(n),!0}}return M5(e),Wo(t),ac(n),!1}}}function z6(){return Je.trackingDerivation!==null}function R5(e,n,t){var r=Mp(!0);M5(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++Je.runId;var a=Je.trackingDerivation;Je.trackingDerivation=e,Je.inBatch++;var o;if(Je.disableErrorBoundaries===!0)o=n.call(t);else try{o=n.call(t)}catch(s){o=new gp(s)}return Je.inBatch--,Je.trackingDerivation=a,B6(e),ac(r),o}function B6(e){for(var n=e.observing_,t=e.observing_=e.newObserving_,r=Xt.UP_TO_DATE_,a=0,o=e.unboundDepsCount_,s=0;s<o;s++){var c=t[s];c.diffValue===0&&(c.diffValue=1,a!==s&&(t[a]=c),a++),c.dependenciesState_>r&&(r=c.dependenciesState_)}for(t.length=a,e.newObserving_=null,o=n.length;o--;){var m=n[o];m.diffValue===0&&I5(m,e),m.diffValue=0}for(;a--;){var f=t[a];f.diffValue===1&&(f.diffValue=0,$6(f,e))}r!==Xt.UP_TO_DATE_&&(e.dependenciesState_=r,e.onBecomeStale_())}function Z1(e){var n=e.observing_;e.observing_=[];for(var t=n.length;t--;)I5(n[t],e);e.dependenciesState_=Xt.NOT_TRACKING_}function hv(e){var n=$s();try{return e()}finally{Wo(n)}}function $s(){var e=Je.trackingDerivation;return Je.trackingDerivation=null,e}function Wo(e){Je.trackingDerivation=e}function Mp(e){var n=Je.allowStateReads;return Je.allowStateReads=e,n}function ac(e){Je.allowStateReads=e}function M5(e){if(e.dependenciesState_!==Xt.UP_TO_DATE_){e.dependenciesState_=Xt.UP_TO_DATE_;for(var n=e.observing_,t=n.length;t--;)n[t].lowestObserverState_=Xt.UP_TO_DATE_}}var U6=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED","useProxies"],Od=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},lp=!0,L5=!1,Je=function(){var e=Pp();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(lp=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new Od().version&&(lp=!1),lp?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Od):(setTimeout(function(){L5||Lt(35)},1),new Od)}();function q6(){if((Je.pendingReactions.length||Je.inBatch||Je.isRunningReactions)&&Lt(36),L5=!0,lp){var e=Pp();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),Je=new Od}}function N5(){return Je}function H6(){var e=new Od;for(var n in e)U6.indexOf(n)===-1&&(Je[n]=e[n]);Je.allowStateChanges=!Je.enforceActions}function G6(e){return e.observers_&&e.observers_.size>0}function V6(e){return e.observers_}function $6(e,n){e.observers_.add(n),e.lowestObserverState_>n.dependenciesState_&&(e.lowestObserverState_=n.dependenciesState_)}function I5(e,n){e.observers_.delete(n),e.observers_.size===0&&j5(e)}function j5(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,Je.pendingUnobservations.push(e))}function di(){Je.inBatch++}function hi(){if(--Je.inBatch===0){z5();for(var e=Je.pendingUnobservations,n=0;n<e.length;n++){var t=e[n];t.isPendingUnobservation=!1,t.observers_.size===0&&(t.isBeingObserved&&(t.isBeingObserved=!1,t.onBUO()),t instanceof xa&&t.suspend_())}Je.pendingUnobservations=[]}}function D5(e){var n=Je.trackingDerivation;return n!==null?(n.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=n.runId_,n.newObserving_[n.unboundDepsCount_++]=e,!e.isBeingObserved&&Je.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&Je.inBatch>0&&j5(e),!1)}function F5(e){e.lowestObserverState_!==Xt.STALE_&&(e.lowestObserverState_=Xt.STALE_,e.observers_.forEach(function(n){n.dependenciesState_===Xt.UP_TO_DATE_&&n.onBecomeStale_(),n.dependenciesState_=Xt.STALE_}))}function W6(e){e.lowestObserverState_!==Xt.STALE_&&(e.lowestObserverState_=Xt.STALE_,e.observers_.forEach(function(n){n.dependenciesState_===Xt.POSSIBLY_STALE_?n.dependenciesState_=Xt.STALE_:n.dependenciesState_===Xt.UP_TO_DATE_&&(e.lowestObserverState_=Xt.UP_TO_DATE_)}))}function Y6(e){e.lowestObserverState_===Xt.UP_TO_DATE_&&(e.lowestObserverState_=Xt.POSSIBLY_STALE_,e.observers_.forEach(function(n){n.dependenciesState_===Xt.UP_TO_DATE_&&(n.dependenciesState_=Xt.POSSIBLY_STALE_,n.onBecomeStale_())}))}var Oa=function(){function e(t,r,a,o){t===void 0&&(t="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Xt.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=pp.NONE,this.name_=t,this.onInvalidate_=r,this.errorHandler_=a,this.requiresObservable_=o}var n=e.prototype;return n.onBecomeStale_=function(){this.schedule_()},n.schedule_=function(){this.isScheduled||(this.isScheduled=!0,Je.pendingReactions.push(this),z5())},n.runReaction_=function(){if(!this.isDisposed){di(),this.isScheduled=!1;var r=Je.trackingContext;if(Je.trackingContext=this,X1(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(a){this.reportExceptionInDerivation_(a)}}Je.trackingContext=r,hi()}},n.track=function(r){if(!this.isDisposed){di(),this.isRunning=!0;var a=Je.trackingContext;Je.trackingContext=this;var o=R5(this,r,void 0);Je.trackingContext=a,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&Z1(this),op(o)&&this.reportExceptionInDerivation_(o.cause),hi()}},n.reportExceptionInDerivation_=function(r){var a=this;if(this.errorHandler_){this.errorHandler_(r,this);return}if(Je.disableErrorBoundaries)throw r;var o="[mobx] uncaught error in '"+this+"'";Je.suppressReactionErrors||console.error(o,r),Je.globalReactionErrorHandlers.forEach(function(s){return s(r,a)})},n.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(di(),Z1(this),hi()))},n.getDisposer_=function(r){var a=this,o=function s(){a.dispose(),r==null||r.removeEventListener==null||r.removeEventListener("abort",s)};return r==null||r.addEventListener==null||r.addEventListener("abort",o),o[bt]=this,o},n.toString=function(){return"Reaction["+this.name_+"]"},n.trace=function(r){},bc(e,[{key:"isDisposed",get:function(){return Ci(this.flags_,e.isDisposedMask_)},set:function(r){this.flags_=ki(this.flags_,e.isDisposedMask_,r)}},{key:"isScheduled",get:function(){return Ci(this.flags_,e.isScheduledMask_)},set:function(r){this.flags_=ki(this.flags_,e.isScheduledMask_,r)}},{key:"isTrackPending",get:function(){return Ci(this.flags_,e.isTrackPendingMask_)},set:function(r){this.flags_=ki(this.flags_,e.isTrackPendingMask_,r)}},{key:"isRunning",get:function(){return Ci(this.flags_,e.isRunningMask_)},set:function(r){this.flags_=ki(this.flags_,e.isRunningMask_,r)}},{key:"diffValue",get:function(){return Ci(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=ki(this.flags_,e.diffValueMask_,r===1)}}])}();Oa.isDisposedMask_=1;Oa.isScheduledMask_=2;Oa.isTrackPendingMask_=4;Oa.isRunningMask_=8;Oa.diffValueMask_=16;function K6(e){return Je.globalReactionErrorHandlers.push(e),function(){var n=Je.globalReactionErrorHandlers.indexOf(e);n>=0&&Je.globalReactionErrorHandlers.splice(n,1)}}var X6=100,Q1=function(n){return n()};function z5(){Je.inBatch>0||Je.isRunningReactions||Q1(Z6)}function Z6(){Je.isRunningReactions=!0;for(var e=Je.pendingReactions,n=0;e.length>0;){++n===X6&&(console.error("[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var t=e.splice(0),r=0,a=t.length;r<a;r++)t[r].runReaction_()}Je.isRunningReactions=!1}var vp=Kl("Reaction",Oa);function Q6(e){var n=Q1;Q1=function(r){return e(function(){return n(r)})}}function Pd(){return!1}function B5(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var U5="action",J6="action.bound",q5="autoAction",e8="autoAction.bound",H5="<unnamed action>",J1=Ud(U5),t8=Ud(J6,{bound:!0}),ev=Ud(q5,{autoAction:!0}),r8=Ud(e8,{autoAction:!0,bound:!0});function G5(e){var n=function(r,a){if(Ai(r))return Wl(r.name||H5,r,e);if(Ai(a))return Wl(r,a,e);if(Bd(a))return(e?ev:J1).decorate_20223_(r,a);if(Bs(a))return zd(r,a,e?ev:J1);if(Bs(r))return _a(Ud(e?q5:U5,{name:r,autoAction:e}))};return n}var Xr=G5(!1);Object.assign(Xr,J1);var sc=G5(!0);Object.assign(sc,ev);Xr.bound=_a(t8);sc.bound=_a(r8);function uc(e){return k5(e.name||H5,!1,e,this,void 0)}function cc(e){return Ai(e)&&e.isMobxAction===!0}function pv(e,n){var t,r,a,o;n===void 0&&(n=sv);var s=(t=(r=n)==null?void 0:r.name)!=null?t:"Autorun",c=!n.scheduler&&!n.delay,m;if(c)m=new Oa(s,function(){this.track(y)},n.onError,n.requiresObservable);else{var f=V5(n),v=!1;m=new Oa(s,function(){v||(v=!0,f(function(){v=!1,m.isDisposed||m.track(y)}))},n.onError,n.requiresObservable)}function y(){e(m)}return(a=n)!=null&&(a=a.signal)!=null&&a.aborted||m.schedule_(),m.getDisposer_((o=n)==null?void 0:o.signal)}var n8=function(n){return n()};function V5(e){return e.scheduler?e.scheduler:e.delay?function(n){return setTimeout(n,e.delay)}:n8}function $5(e,n,t){var r,a,o;t===void 0&&(t=sv);var s=(r=t.name)!=null?r:"Reaction",c=Xr(s,t.onError?i8(t.onError,n):n),m=!t.scheduler&&!t.delay,f=V5(t),v=!0,y=!1,E,w=t.compareStructural?Us.structural:t.equals||Us.default,S=new Oa(s,function(){v||m?x():y||(y=!0,f(x))},t.onError,t.requiresObservable);function x(){if(y=!1,!S.isDisposed){var _=!1,b=E;S.track(function(){var g=fv(!1,function(){return e(S)});_=v||!w(E,g),E=g}),(v&&t.fireImmediately||!v&&_)&&c(E,b,S),v=!1}}return(a=t)!=null&&(a=a.signal)!=null&&a.aborted||S.schedule_(),S.getDisposer_((o=t)==null?void 0:o.signal)}function i8(e,n){return function(){try{return n.apply(this,arguments)}catch(t){e.call(this,t)}}}var a8="onBO",o8="onBUO";function W5(e,n,t){return Y5(a8,e,n,t)}function gv(e,n,t){return Y5(o8,e,n,t)}function Y5(e,n,t,r){var a=typeof r=="function"?no(n,t):no(n),o=Ai(r)?r:t,s=e+"L";return a[s]?a[s].add(o):a[s]=new Set([o]),function(){var c=a[s];c&&(c.delete(o),c.size===0&&delete a[s])}}var l8="never",ep="always",s8="observed";function K5(e){e.isolateGlobalState===!0&&q6();var n=e.useProxies,t=e.enforceActions;if(n!==void 0&&(Je.useProxies=n===ep?!0:n===l8?!1:typeof Proxy<"u"),n==="ifavailable"&&(Je.verifyProxies=!0),t!==void 0){var r=t===ep?ep:t===s8;Je.enforceActions=r,Je.allowStateChanges=!(r===!0||r===ep)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(a){a in e&&(Je[a]=!!e[a])}),Je.allowStateReads=!Je.observableRequiresReaction,e.reactionScheduler&&Q6(e.reactionScheduler)}function vv(e,n,t,r){var a=U_(n);return Zl(function(){var o=Ws(e,r)[bt];lc(a).forEach(function(s){o.extend_(s,a[s],t&&s in t?t[s]:!0)})}),e}function X5(e,n){return Z5(no(e,n))}function Z5(e){var n={name:e.name_};return e.observing_&&e.observing_.length>0&&(n.dependencies=c8(e.observing_).map(Z5)),n}function u8(e,n){return Q5(no(e,n))}function Q5(e){var n={name:e.name_};return G6(e)&&(n.observers=Array.from(V6(e)).map(Q5)),n}function c8(e){return Array.from(new Set(e))}var f8=0;function Lp(){this.message="FLOW_CANCELLED"}Lp.prototype=Object.create(Error.prototype);function d8(e){return e instanceof Lp}var Lg=_5("flow"),h8=_5("flow.bound",{bound:!0}),Gs=Object.assign(function(n,t){if(Bd(t))return Lg.decorate_20223_(n,t);if(Bs(t))return zd(n,t,Lg);var r=n,a=r.name||"<unnamed flow>",o=function(){var c=this,m=arguments,f=++f8,v=Xr(a+" - runid: "+f+" - init",r).apply(c,m),y,E=void 0,w=new Promise(function(S,x){var _=0;y=x;function b(d){E=void 0;var P;try{P=Xr(a+" - runid: "+f+" - yield "+_++,v.next).call(v,d)}catch(M){return x(M)}h(P)}function g(d){E=void 0;var P;try{P=Xr(a+" - runid: "+f+" - yield "+_++,v.throw).call(v,d)}catch(M){return x(M)}h(P)}function h(d){if(Ai(d==null?void 0:d.then)){d.then(h,x);return}return d.done?S(d.value):(E=Promise.resolve(d.value),E.then(b,g))}b(void 0)});return w.cancel=Xr(a+" - runid: "+f+" - cancel",function(){try{E&&Hm(E);var S=v.return(void 0),x=Promise.resolve(S.value);x.then(rc,rc),Hm(x),y(new Lp)}catch(_){y(_)}}),w};return o.isMobXFlow=!0,o},Lg);Gs.bound=_a(h8);function Hm(e){Ai(e.cancel)&&e.cancel()}function p8(e){return e}function fc(e){return(e==null?void 0:e.isMobXFlow)===!0}function mv(e,n,t){var r;return Rn(e)||Qn(e)||dv(e)?r=Pa(e):yn(e)&&(r=Pa(e,n)),r.dehancer=typeof n=="function"?n:t,function(){r.dehancer=void 0}}function Np(e,n,t){return Ai(t)?v8(e,n,t):g8(e,n)}function g8(e,n){return Pa(e).intercept_(n)}function v8(e,n,t){return Pa(e,n).intercept_(t)}function J5(e,n){if(n===void 0)return Hs(e);if(yn(e)===!1||!e[bt].values_.has(n))return!1;var t=no(e,n);return Hs(t)}function m8(e){return J5(e)}function ew(e,n){return J5(e,n)}function tw(e,n){return e?n!==void 0?yn(e)?e[bt].values_.has(n):!1:yn(e)||!!e[bt]||uv(e)||vp(e)||Hs(e):!1}function Ip(e){return tw(e)}function rw(e,n){return tw(e,n)}function Td(e){if(yn(e))return e[bt].keys_();if(Rn(e)||an(e))return Array.from(e.keys());if(Qn(e))return e.map(function(n,t){return t});Lt(5)}function yv(e){if(yn(e))return Td(e).map(function(n){return e[n]});if(Rn(e))return Td(e).map(function(n){return e.get(n)});if(an(e))return Array.from(e.values());if(Qn(e))return e.slice();Lt(6)}function nw(e){if(yn(e))return Td(e).map(function(n){return[n,e[n]]});if(Rn(e))return Td(e).map(function(n){return[n,e.get(n)]});if(an(e))return Array.from(e.entries());if(Qn(e))return e.map(function(n,t){return[t,n]});Lt(7)}function bv(e,n,t){if(arguments.length===2&&!an(e)){di();var r=n;try{for(var a in r)bv(e,a,r[a])}finally{hi()}return}yn(e)?e[bt].set_(n,t):Rn(e)?e.set(n,t):an(e)?e.add(n):Qn(e)?(typeof n!="number"&&(n=parseInt(n,10)),n<0&&Lt("Invalid index: '"+n+"'"),di(),n>=e.length&&(e.length=n+1),e[n]=t,hi()):Lt(8)}function y8(e,n){yn(e)?e[bt].delete_(n):Rn(e)||an(e)?e.delete(n):Qn(e)?(typeof n!="number"&&(n=parseInt(n,10)),e.splice(n,1)):Lt(9)}function iw(e,n){if(yn(e))return e[bt].has_(n);if(Rn(e))return e.has(n);if(an(e))return e.has(n);if(Qn(e))return n>=0&&n<e.length;Lt(10)}function b8(e,n){if(iw(e,n)){if(yn(e))return e[bt].get_(n);if(Rn(e))return e.get(n);if(Qn(e))return e[n];Lt(11)}}function wv(e,n,t){if(yn(e))return e[bt].defineProperty_(n,t);Lt(39)}function aw(e){if(yn(e))return e[bt].ownKeys_();Lt(38)}function jp(e,n,t,r){return Ai(t)?_8(e,n,t,r):w8(e,n,t)}function w8(e,n,t){return Pa(e).observe_(n,t)}function _8(e,n,t,r){return Pa(e,n).observe_(t,r)}function tp(e,n,t){return e.set(n,t),t}function ec(e,n){if(e==null||typeof e!="object"||e instanceof Date||!Ip(e))return e;if(dv(e)||Hs(e))return ec(e.get(),n);if(n.has(e))return n.get(e);if(Qn(e)){var t=tp(n,e,new Array(e.length));return e.forEach(function(s,c){t[c]=ec(s,n)}),t}if(an(e)){var r=tp(n,e,new Set);return e.forEach(function(s){r.add(ec(s,n))}),r}if(Rn(e)){var a=tp(n,e,new Map);return e.forEach(function(s,c){a.set(c,ec(s,n))}),a}else{var o=tp(n,e,{});return aw(e).forEach(function(s){Dd.propertyIsEnumerable.call(e,s)&&(o[s]=ec(e[s],n))}),o}}function S8(e,n){return ec(e,new Map)}function E8(){}function Ja(e,n){n===void 0&&(n=void 0),di();try{return e.apply(n)}finally{hi()}}function tv(e,n,t){return arguments.length===1||n&&typeof n=="object"?x8(e,n):ow(e,n,t||{})}function ow(e,n,t){var r;if(typeof t.timeout=="number"){var a=new Error("WHEN_TIMEOUT");r=setTimeout(function(){if(!s[bt].isDisposed)if(s(),t.onError)t.onError(a);else throw a},t.timeout)}t.name="When";var o=Wl("When-effect",n),s=pv(function(c){var m=fv(!1,e);m&&(c.dispose(),r&&clearTimeout(r),o())},t);return s}function x8(e,n){var t;if(n!=null&&(t=n.signal)!=null&&t.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var r,a,o=new Promise(function(s,c){var m,f=ow(e,s,$l({},n,{onError:c}));r=function(){f(),c(new Error("WHEN_CANCELLED"))},a=function(){f(),c(new Error("WHEN_ABORTED"))},n==null||(m=n.signal)==null||m.addEventListener==null||m.addEventListener("abort",a)}).finally(function(){var s;return n==null||(s=n.signal)==null||s.removeEventListener==null?void 0:s.removeEventListener("abort",a)});return o.cancel=r,o}function Zu(e){return e[bt]}var O8={has:function(n,t){return Zu(n).has_(t)},get:function(n,t){return Zu(n).get_(t)},set:function(n,t,r){var a;return Bs(t)?(a=Zu(n).set_(t,r,!0))!=null?a:!0:!1},deleteProperty:function(n,t){var r;return Bs(t)?(r=Zu(n).delete_(t,!0))!=null?r:!0:!1},defineProperty:function(n,t,r){var a;return(a=Zu(n).defineProperty_(t,r))!=null?a:!0},ownKeys:function(n){return Zu(n).ownKeys_()},preventExtensions:function(n){Lt(13)}};function P8(e,n){var t,r;return d5(),e=Ws(e,n),(r=(t=e[bt]).proxy_)!=null?r:t.proxy_=new Proxy(e,O8)}function Yi(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function qd(e,n){var t=e.interceptors_||(e.interceptors_=[]);return t.push(n),h5(function(){var r=t.indexOf(n);r!==-1&&t.splice(r,1)})}function Ki(e,n){var t=$s();try{for(var r=[].concat(e.interceptors_||[]),a=0,o=r.length;a<o&&(n=r[a](n),n&&!n.type&&Lt(14),!!n);a++);return n}finally{Wo(t)}}function Sa(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function Hd(e,n){var t=e.changeListeners_||(e.changeListeners_=[]);return t.push(n),h5(function(){var r=t.indexOf(n);r!==-1&&t.splice(r,1)})}function Ea(e,n){var t=$s(),r=e.changeListeners_;if(r){r=r.slice();for(var a=0,o=r.length;a<o;a++)r[a](n);Wo(t)}}function _v(e,n,t){return Zl(function(){var r,a=Ws(e,t)[bt];(r=n)!=null||(n=$_(e)),lc(n).forEach(function(o){return a.make_(o,n[o])})}),e}var Ng=Symbol("mobx-keys");function C8(e,n,t){return Ko(e)?vv(e,e,n,t):(Zl(function(){var r=Ws(e,t)[bt];if(!e[Ng]){var a=Object.getPrototypeOf(e),o=new Set([].concat(lc(e),lc(a)));o.delete("constructor"),o.delete(bt),Fd(a,Ng,o)}e[Ng].forEach(function(s){return r.make_(s,n&&s in n?n[s]:!0)})}),e)}var Gm="splice",ro="update",k8=1e4,A8={get:function(n,t){var r=n[bt];return t===bt?r:t==="length"?r.getArrayLength_():typeof t=="string"&&!isNaN(t)?r.get_(parseInt(t)):$o(mp,t)?mp[t]:n[t]},set:function(n,t,r){var a=n[bt];return t==="length"&&a.setArrayLength_(r),typeof t=="symbol"||isNaN(t)?n[t]=r:a.set_(parseInt(t),r),!0},preventExtensions:function(){Lt(15)}},Sv=function(){function e(t,r,a,o){t===void 0&&(t="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=a,this.legacyMode_=o,this.atom_=new Xl(t),this.enhancer_=function(s,c){return r(s,c,"ObservableArray[..]")}}var n=e.prototype;return n.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},n.dehanceValues_=function(r){return this.dehancer!==void 0&&r.length>0?r.map(this.dehancer):r},n.intercept_=function(r){return qd(this,r)},n.observe_=function(r,a){return a===void 0&&(a=!1),a&&r({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),Hd(this,r)},n.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},n.setArrayLength_=function(r){(typeof r!="number"||isNaN(r)||r<0)&&Lt("Out of range: "+r);var a=this.values_.length;if(r!==a)if(r>a){for(var o=new Array(r-a),s=0;s<r-a;s++)o[s]=void 0;this.spliceWithArray_(a,0,o)}else this.spliceWithArray_(r,a-r)},n.updateArrayLength_=function(r,a){r!==this.lastKnownLength_&&Lt(16),this.lastKnownLength_+=a,this.legacyMode_&&a>0&&fw(r+a+1)},n.spliceWithArray_=function(r,a,o){var s=this;this.atom_;var c=this.values_.length;if(r===void 0?r=0:r>c?r=c:r<0&&(r=Math.max(0,c+r)),arguments.length===1?a=c-r:a==null?a=0:a=Math.max(0,Math.min(a,c-r)),o===void 0&&(o=$1),Yi(this)){var m=Ki(this,{object:this.proxy_,type:Gm,index:r,removedCount:a,added:o});if(!m)return $1;a=m.removedCount,o=m.added}if(o=o.length===0?o:o.map(function(y){return s.enhancer_(y,void 0)}),this.legacyMode_){var f=o.length-a;this.updateArrayLength_(c,f)}var v=this.spliceItemsIntoValues_(r,a,o);return(a!==0||o.length!==0)&&this.notifyArraySplice_(r,o,v),this.dehanceValues_(v)},n.spliceItemsIntoValues_=function(r,a,o){if(o.length<k8){var s;return(s=this.values_).splice.apply(s,[r,a].concat(o))}else{var c=this.values_.slice(r,r+a),m=this.values_.slice(r+a);this.values_.length+=o.length-a;for(var f=0;f<o.length;f++)this.values_[r+f]=o[f];for(var v=0;v<m.length;v++)this.values_[r+o.length+v]=m[v];return c}},n.notifyArrayChildUpdate_=function(r,a,o){var s=!this.owned_&&Pd(),c=Sa(this),m=c||s?{observableKind:"array",object:this.proxy_,type:ro,debugObjectName:this.atom_.name_,index:r,newValue:a,oldValue:o}:null;this.atom_.reportChanged(),c&&Ea(this,m)},n.notifyArraySplice_=function(r,a,o){var s=!this.owned_&&Pd(),c=Sa(this),m=c||s?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:Gm,index:r,removed:o,added:a,removedCount:o.length,addedCount:a.length}:null;this.atom_.reportChanged(),c&&Ea(this,m)},n.get_=function(r){if(this.legacyMode_&&r>=this.values_.length){console.warn("[mobx] Out of bounds read: "+r);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[r])},n.set_=function(r,a){var o=this.values_;if(this.legacyMode_&&r>o.length&&Lt(17,r,o.length),r<o.length){this.atom_;var s=o[r];if(Yi(this)){var c=Ki(this,{type:ro,object:this.proxy_,index:r,newValue:a});if(!c)return;a=c.newValue}a=this.enhancer_(a,s);var m=a!==s;m&&(o[r]=a,this.notifyArrayChildUpdate_(r,a,s))}else{for(var f=new Array(r+1-o.length),v=0;v<f.length-1;v++)f[v]=void 0;f[f.length-1]=a,this.spliceWithArray_(o.length,0,f)}},e}();function T8(e,n,t,r){return t===void 0&&(t="ObservableArray"),r===void 0&&(r=!1),d5(),Zl(function(){var a=new Sv(t,n,r,!1);g5(a.values_,bt,a);var o=new Proxy(a.values_,A8);return a.proxy_=o,e&&e.length&&a.spliceWithArray_(0,0,e),o})}var mp={clear:function(){return this.splice(0)},replace:function(n){var t=this[bt];return t.spliceWithArray_(0,t.values_.length,n)},toJSON:function(){return this.slice()},splice:function(n,t){for(var r=arguments.length,a=new Array(r>2?r-2:0),o=2;o<r;o++)a[o-2]=arguments[o];var s=this[bt];switch(arguments.length){case 0:return[];case 1:return s.spliceWithArray_(n);case 2:return s.spliceWithArray_(n,t)}return s.spliceWithArray_(n,t,a)},spliceWithArray:function(n,t,r){return this[bt].spliceWithArray_(n,t,r)},push:function(){for(var n=this[bt],t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return n.spliceWithArray_(n.values_.length,0,r),n.values_.length},pop:function(){return this.splice(Math.max(this[bt].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var n=this[bt],t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return n.spliceWithArray_(0,0,r),n.values_.length},reverse:function(){return Je.trackingDerivation&&Lt(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){Je.trackingDerivation&&Lt(37,"sort");var n=this.slice();return n.sort.apply(n,arguments),this.replace(n),this},remove:function(n){var t=this[bt],r=t.dehanceValues_(t.values_).indexOf(n);return r>-1?(this.splice(r,1),!0):!1}};br("at",Ti);br("concat",Ti);br("flat",Ti);br("includes",Ti);br("indexOf",Ti);br("join",Ti);br("lastIndexOf",Ti);br("slice",Ti);br("toString",Ti);br("toLocaleString",Ti);br("toSorted",Ti);br("toSpliced",Ti);br("with",Ti);br("every",Ca);br("filter",Ca);br("find",Ca);br("findIndex",Ca);br("findLast",Ca);br("findLastIndex",Ca);br("flatMap",Ca);br("forEach",Ca);br("map",Ca);br("some",Ca);br("toReversed",Ca);br("reduce",lw);br("reduceRight",lw);function br(e,n){typeof Array.prototype[e]=="function"&&(mp[e]=n(e))}function Ti(e){return function(){var n=this[bt];n.atom_.reportObserved();var t=n.dehanceValues_(n.values_);return t[e].apply(t,arguments)}}function Ca(e){return function(n,t){var r=this,a=this[bt];a.atom_.reportObserved();var o=a.dehanceValues_(a.values_);return o[e](function(s,c){return n.call(t,s,c,r)})}}function lw(e){return function(){var n=this,t=this[bt];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_),a=arguments[0];return arguments[0]=function(o,s,c){return a(o,s,c,n)},r[e].apply(r,arguments)}}var R8=Kl("ObservableArrayAdministration",Sv);function Qn(e){return Cp(e)&&R8(e[bt])}var M8={},Hl="add",yp="delete",Dp=function(){function e(t,r,a){var o=this;r===void 0&&(r=qs),a===void 0&&(a="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[bt]=M8,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=r,this.name_=a,Ai(Map)||Lt(18),Zl(function(){o.keysAtom_=Ad("ObservableMap.keys()"),o.data_=new Map,o.hasMap_=new Map,t&&o.merge(t)})}var n=e.prototype;return n.has_=function(r){return this.data_.has(r)},n.has=function(r){var a=this;if(!Je.trackingDerivation)return this.has_(r);var o=this.hasMap_.get(r);if(!o){var s=o=new Gl(this.has_(r),kp,"ObservableMap.key?",!1);this.hasMap_.set(r,s),gv(s,function(){return a.hasMap_.delete(r)})}return o.get()},n.set=function(r,a){var o=this.has_(r);if(Yi(this)){var s=Ki(this,{type:o?ro:Hl,object:this,newValue:a,name:r});if(!s)return this;a=s.newValue}return o?this.updateValue_(r,a):this.addValue_(r,a),this},n.delete=function(r){var a=this;if(this.keysAtom_,Yi(this)){var o=Ki(this,{type:yp,object:this,name:r});if(!o)return!1}if(this.has_(r)){var s=Pd(),c=Sa(this),m=c||s?{observableKind:"map",debugObjectName:this.name_,type:yp,object:this,oldValue:this.data_.get(r).value_,name:r}:null;return Ja(function(){var f;a.keysAtom_.reportChanged(),(f=a.hasMap_.get(r))==null||f.setNewValue_(!1);var v=a.data_.get(r);v.setNewValue_(void 0),a.data_.delete(r)}),c&&Ea(this,m),!0}return!1},n.updateValue_=function(r,a){var o=this.data_.get(r);if(a=o.prepareNewValue_(a),a!==Je.UNCHANGED){var s=Pd(),c=Sa(this),m=c||s?{observableKind:"map",debugObjectName:this.name_,type:ro,object:this,oldValue:o.value_,name:r,newValue:a}:null;o.setNewValue_(a),c&&Ea(this,m)}},n.addValue_=function(r,a){var o=this;this.keysAtom_,Ja(function(){var f,v=new Gl(a,o.enhancer_,"ObservableMap.key",!1);o.data_.set(r,v),a=v.value_,(f=o.hasMap_.get(r))==null||f.setNewValue_(!0),o.keysAtom_.reportChanged()});var s=Pd(),c=Sa(this),m=c||s?{observableKind:"map",debugObjectName:this.name_,type:Hl,object:this,name:r,newValue:a}:null;c&&Ea(this,m)},n.get=function(r){return this.has(r)?this.dehanceValue_(this.data_.get(r).get()):this.dehanceValue_(void 0)},n.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},n.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},n.values=function(){var r=this,a=this.keys();return Vm({next:function(){var s=a.next(),c=s.done,m=s.value;return{done:c,value:c?void 0:r.get(m)}}})},n.entries=function(){var r=this,a=this.keys();return Vm({next:function(){var s=a.next(),c=s.done,m=s.value;return{done:c,value:c?void 0:[m,r.get(m)]}}})},n[Symbol.iterator]=function(){return this.entries()},n.forEach=function(r,a){for(var o=nc(this),s;!(s=o()).done;){var c=s.value,m=c[0],f=c[1];r.call(a,f,m,this)}},n.merge=function(r){var a=this;return Rn(r)&&(r=new Map(r)),Ja(function(){Ko(r)?B_(r).forEach(function(o){return a.set(o,r[o])}):Array.isArray(r)?r.forEach(function(o){var s=o[0],c=o[1];return a.set(s,c)}):yc(r)?(z_(r)||Lt(19,r),r.forEach(function(o,s){return a.set(s,o)})):r!=null&&Lt(20,r)}),this},n.clear=function(){var r=this;Ja(function(){hv(function(){for(var a=nc(r.keys()),o;!(o=a()).done;){var s=o.value;r.delete(s)}})})},n.replace=function(r){var a=this;return Ja(function(){for(var o=L8(r),s=new Map,c=!1,m=nc(a.data_.keys()),f;!(f=m()).done;){var v=f.value;if(!o.has(v)){var y=a.delete(v);if(y)c=!0;else{var E=a.data_.get(v);s.set(v,E)}}}for(var w=nc(o.entries()),S;!(S=w()).done;){var x=S.value,_=x[0],b=x[1],g=a.data_.has(_);if(a.set(_,b),a.data_.has(_)){var h=a.data_.get(_);s.set(_,h),g||(c=!0)}}if(!c)if(a.data_.size!==s.size)a.keysAtom_.reportChanged();else for(var d=a.data_.keys(),P=s.keys(),M=d.next(),T=P.next();!M.done;){if(M.value!==T.value){a.keysAtom_.reportChanged();break}M=d.next(),T=P.next()}a.data_=s}),this},n.toString=function(){return"[object ObservableMap]"},n.toJSON=function(){return Array.from(this)},n.observe_=function(r,a){return Hd(this,r)},n.intercept_=function(r){return qd(this,r)},bc(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),Rn=Kl("ObservableMap",Dp);function Vm(e){return e[Symbol.toStringTag]="MapIterator",Pv(e)}function L8(e){if(yc(e)||Rn(e))return e;if(Array.isArray(e))return new Map(e);if(Ko(e)){var n=new Map;for(var t in e)n.set(t,e[t]);return n}else return Lt(21,e)}var N8={},Ev=function(){function e(t,r,a){var o=this;r===void 0&&(r=qs),a===void 0&&(a="ObservableSet"),this.name_=void 0,this[bt]=N8,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=a,Ai(Set)||Lt(22),this.enhancer_=function(s,c){return r(s,c,a)},Zl(function(){o.atom_=Ad(o.name_),t&&o.replace(t)})}var n=e.prototype;return n.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},n.clear=function(){var r=this;Ja(function(){hv(function(){for(var a=nc(r.data_.values()),o;!(o=a()).done;){var s=o.value;r.delete(s)}})})},n.forEach=function(r,a){for(var o=nc(this),s;!(s=o()).done;){var c=s.value;r.call(a,c,c,this)}},n.add=function(r){var a=this;if(this.atom_,Yi(this)){var o=Ki(this,{type:Hl,object:this,newValue:r});if(!o)return this;r=o.newValue}if(!this.has(r)){Ja(function(){a.data_.add(a.enhancer_(r,void 0)),a.atom_.reportChanged()});var s=!1,c=Sa(this),m=c||s?{observableKind:"set",debugObjectName:this.name_,type:Hl,object:this,newValue:r}:null;c&&Ea(this,m)}return this},n.delete=function(r){var a=this;if(Yi(this)){var o=Ki(this,{type:yp,object:this,oldValue:r});if(!o)return!1}if(this.has(r)){var s=!1,c=Sa(this),m=c||s?{observableKind:"set",debugObjectName:this.name_,type:yp,object:this,oldValue:r}:null;return Ja(function(){a.atom_.reportChanged(),a.data_.delete(r)}),c&&Ea(this,m),!0}return!1},n.has=function(r){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(r))},n.entries=function(){var r=this.values();return $m({next:function(){var o=r.next(),s=o.value,c=o.done;return c?{value:void 0,done:c}:{value:[s,s],done:c}}})},n.keys=function(){return this.values()},n.values=function(){this.atom_.reportObserved();var r=this,a=this.data_.values();return $m({next:function(){var s=a.next(),c=s.value,m=s.done;return m?{value:void 0,done:m}:{value:r.dehanceValue_(c),done:m}}})},n.intersection=function(r){if(Vo(r)&&!an(r))return r.intersection(this);var a=new Set(this);return a.intersection(r)},n.union=function(r){if(Vo(r)&&!an(r))return r.union(this);var a=new Set(this);return a.union(r)},n.difference=function(r){return new Set(this).difference(r)},n.symmetricDifference=function(r){if(Vo(r)&&!an(r))return r.symmetricDifference(this);var a=new Set(this);return a.symmetricDifference(r)},n.isSubsetOf=function(r){return new Set(this).isSubsetOf(r)},n.isSupersetOf=function(r){return new Set(this).isSupersetOf(r)},n.isDisjointFrom=function(r){if(Vo(r)&&!an(r))return r.isDisjointFrom(this);var a=new Set(this);return a.isDisjointFrom(r)},n.replace=function(r){var a=this;return an(r)&&(r=new Set(r)),Ja(function(){Array.isArray(r)?(a.clear(),r.forEach(function(o){return a.add(o)})):Vo(r)?(a.clear(),r.forEach(function(o){return a.add(o)})):r!=null&&Lt("Cannot initialize set from "+r)}),this},n.observe_=function(r,a){return Hd(this,r)},n.intercept_=function(r){return qd(this,r)},n.toJSON=function(){return Array.from(this)},n.toString=function(){return"[object ObservableSet]"},n[Symbol.iterator]=function(){return this.values()},bc(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),an=Kl("ObservableSet",Ev);function $m(e){return e[Symbol.toStringTag]="SetIterator",Pv(e)}var Wm=Object.create(null),Ym="remove",sw=function(){function e(t,r,a,o){r===void 0&&(r=new Map),o===void 0&&(o=_6),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=t,this.values_=r,this.name_=a,this.defaultAnnotation_=o,this.keysAtom_=new Xl("ObservableObject.keys"),this.isPlainObject_=Ko(this.target_)}var n=e.prototype;return n.getObservablePropValue_=function(r){return this.values_.get(r).get()},n.setObservablePropValue_=function(r,a){var o=this.values_.get(r);if(o instanceof xa)return o.set(a),!0;if(Yi(this)){var s=Ki(this,{type:ro,object:this.proxy_||this.target_,name:r,newValue:a});if(!s)return null;a=s.newValue}if(a=o.prepareNewValue_(a),a!==Je.UNCHANGED){var c=Sa(this),m=!1,f=c||m?{type:ro,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:o.value_,name:r,newValue:a}:null;o.setNewValue_(a),c&&Ea(this,f)}return!0},n.get_=function(r){return Je.trackingDerivation&&!$o(this.target_,r)&&this.has_(r),this.target_[r]},n.set_=function(r,a,o){return o===void 0&&(o=!1),$o(this.target_,r)?this.values_.has(r)?this.setObservablePropValue_(r,a):o?Reflect.set(this.target_,r,a):(this.target_[r]=a,!0):this.extend_(r,{value:a,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,o)},n.has_=function(r){if(!Je.trackingDerivation)return r in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var a=this.pendingKeys_.get(r);return a||(a=new Gl(r in this.target_,kp,"ObservableObject.key?",!1),this.pendingKeys_.set(r,a)),a.get()},n.make_=function(r,a){if(a===!0&&(a=this.defaultAnnotation_),a!==!1){if(!(r in this.target_)){var o;if((o=this.target_[eo])!=null&&o[r])return;Lt(1,a.annotationType_,this.name_+"."+r.toString())}for(var s=this.target_;s&&s!==Dd;){var c=dp(s,r);if(c){var m=a.make_(this,r,c,s);if(m===0)return;if(m===1)break}s=Object.getPrototypeOf(s)}Xm(this,a,r)}},n.extend_=function(r,a,o,s){if(s===void 0&&(s=!1),o===!0&&(o=this.defaultAnnotation_),o===!1)return this.defineProperty_(r,a,s);var c=o.extend_(this,r,a,s);return c&&Xm(this,o,r),c},n.defineProperty_=function(r,a,o){o===void 0&&(o=!1),this.keysAtom_;try{di();var s=this.delete_(r);if(!s)return s;if(Yi(this)){var c=Ki(this,{object:this.proxy_||this.target_,name:r,type:Hl,newValue:a.value});if(!c)return null;var m=c.newValue;a.value!==m&&(a=$l({},a,{value:m}))}if(o){if(!Reflect.defineProperty(this.target_,r,a))return!1}else to(this.target_,r,a);this.notifyPropertyAddition_(r,a.value)}finally{hi()}return!0},n.defineObservableProperty_=function(r,a,o,s){s===void 0&&(s=!1),this.keysAtom_;try{di();var c=this.delete_(r);if(!c)return c;if(Yi(this)){var m=Ki(this,{object:this.proxy_||this.target_,name:r,type:Hl,newValue:a});if(!m)return null;a=m.newValue}var f=Km(r),v={configurable:Je.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:f.get,set:f.set};if(s){if(!Reflect.defineProperty(this.target_,r,v))return!1}else to(this.target_,r,v);var y=new Gl(a,o,"ObservableObject.key",!1);this.values_.set(r,y),this.notifyPropertyAddition_(r,y.value_)}finally{hi()}return!0},n.defineComputedProperty_=function(r,a,o){o===void 0&&(o=!1),this.keysAtom_;try{di();var s=this.delete_(r);if(!s)return s;if(Yi(this)){var c=Ki(this,{object:this.proxy_||this.target_,name:r,type:Hl,newValue:void 0});if(!c)return null}a.name||(a.name="ObservableObject.key"),a.context=this.proxy_||this.target_;var m=Km(r),f={configurable:Je.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:m.get,set:m.set};if(o){if(!Reflect.defineProperty(this.target_,r,f))return!1}else to(this.target_,r,f);this.values_.set(r,new xa(a)),this.notifyPropertyAddition_(r,void 0)}finally{hi()}return!0},n.delete_=function(r,a){if(a===void 0&&(a=!1),this.keysAtom_,!$o(this.target_,r))return!0;if(Yi(this)){var o=Ki(this,{object:this.proxy_||this.target_,name:r,type:Ym});if(!o)return null}try{var s;di();var c=Sa(this),m=!1,f=this.values_.get(r),v=void 0;if(!f&&(c||m)){var y;v=(y=dp(this.target_,r))==null?void 0:y.value}if(a){if(!Reflect.deleteProperty(this.target_,r))return!1}else delete this.target_[r];if(f&&(this.values_.delete(r),f instanceof Gl&&(v=f.value_),F5(f)),this.keysAtom_.reportChanged(),(s=this.pendingKeys_)==null||(s=s.get(r))==null||s.set(r in this.target_),c||m){var E={type:Ym,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:v,name:r};c&&Ea(this,E)}}finally{hi()}return!0},n.observe_=function(r,a){return Hd(this,r)},n.intercept_=function(r){return qd(this,r)},n.notifyPropertyAddition_=function(r,a){var o,s=Sa(this),c=!1;if(s||c){var m=s||c?{type:Hl,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:r,newValue:a}:null;s&&Ea(this,m)}(o=this.pendingKeys_)==null||(o=o.get(r))==null||o.set(!0),this.keysAtom_.reportChanged()},n.ownKeys_=function(){return this.keysAtom_.reportObserved(),lc(this.target_)},n.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function Ws(e,n){var t;if($o(e,bt))return e;var r=(t=n==null?void 0:n.name)!=null?t:"ObservableObject",a=new sw(e,new Map,String(r),M6(n));return Fd(e,bt,a),e}var I8=Kl("ObservableObjectAdministration",sw);function Km(e){return Wm[e]||(Wm[e]={get:function(){return this[bt].getObservablePropValue_(e)},set:function(t){return this[bt].setObservablePropValue_(e,t)}})}function yn(e){return Cp(e)?I8(e[bt]):!1}function Xm(e,n,t){var r;(r=e.target_[eo])==null||delete r[t]}var j8=cw(0),D8=function(){var e=!1,n={};return Object.defineProperty(n,"0",{set:function(){e=!0}}),Object.create(n)[0]=1,e===!1}(),Ig=0,uw=function(){};function F8(e,n){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,n):e.prototype.__proto__!==void 0?e.prototype.__proto__=n:e.prototype=n}F8(uw,Array.prototype);var xv=function(e){function n(r,a,o,s){var c;return o===void 0&&(o="ObservableArray"),s===void 0&&(s=!1),c=e.call(this)||this,Zl(function(){var m=new Sv(o,a,s,!0);m.proxy_=c,g5(c,bt,m),r&&r.length&&c.spliceWithArray(0,0,r),D8&&Object.defineProperty(c,"0",j8)}),c}y5(n,e);var t=n.prototype;return t.concat=function(){this[bt].atom_.reportObserved();for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];return Array.prototype.concat.apply(this.slice(),o.map(function(c){return Qn(c)?c.slice():c}))},t[Symbol.iterator]=function(){var r=this,a=0;return Pv({next:function(){return a<r.length?{value:r[a++],done:!1}:{done:!0,value:void 0}}})},bc(n,[{key:"length",get:function(){return this[bt].getArrayLength_()},set:function(a){this[bt].setArrayLength_(a)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(uw);Object.entries(mp).forEach(function(e){var n=e[0],t=e[1];n!=="concat"&&Fd(xv.prototype,n,t)});function cw(e){return{enumerable:!1,configurable:!0,get:function(){return this[bt].get_(e)},set:function(t){this[bt].set_(e,t)}}}function z8(e){to(xv.prototype,""+e,cw(e))}function fw(e){if(e>Ig){for(var n=Ig;n<e+100;n++)z8(n);Ig=e}}fw(1e3);function B8(e,n,t){return new xv(e,n,t)}function no(e,n){if(typeof e=="object"&&e!==null){if(Qn(e))return n!==void 0&&Lt(23),e[bt].atom_;if(an(e))return e.atom_;if(Rn(e)){if(n===void 0)return e.keysAtom_;var t=e.data_.get(n)||e.hasMap_.get(n);return t||Lt(25,n,bp(e)),t}if(yn(e)){if(!n)return Lt(26);var r=e[bt].values_.get(n);return r||Lt(27,n,bp(e)),r}if(uv(e)||Hs(e)||vp(e))return e}else if(Ai(e)&&vp(e[bt]))return e[bt];Lt(28)}function Pa(e,n){if(e||Lt(29),n!==void 0)return Pa(no(e,n));if(uv(e)||Hs(e)||vp(e)||Rn(e)||an(e))return e;if(e[bt])return e[bt];Lt(24,e)}function bp(e,n){var t;if(n!==void 0)t=no(e,n);else{if(cc(e))return e.name;yn(e)||Rn(e)||an(e)?t=Pa(e):t=no(e)}return t.name_}function Zl(e){var n=$s(),t=Tp(!0);di();try{return e()}finally{hi(),Rp(t),Wo(n)}}var Zm=Dd.toString;function Ov(e,n,t){return t===void 0&&(t=-1),rv(e,n,t)}function rv(e,n,t,r,a){if(e===n)return e!==0||1/e===1/n;if(e==null||n==null)return!1;if(e!==e)return n!==n;var o=typeof e;if(o!=="function"&&o!=="object"&&typeof n!="object")return!1;var s=Zm.call(e);if(s!==Zm.call(n))return!1;switch(s){case"[object RegExp]":case"[object String]":return""+e==""+n;case"[object Number]":return+e!=+e?+n!=+n:+e==0?1/+e===1/n:+e==+n;case"[object Date]":case"[object Boolean]":return+e==+n;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(n);case"[object Map]":case"[object Set]":t>=0&&t++;break}e=Qm(e),n=Qm(n);var c=s==="[object Array]";if(!c){if(typeof e!="object"||typeof n!="object")return!1;var m=e.constructor,f=n.constructor;if(m!==f&&!(Ai(m)&&m instanceof m&&Ai(f)&&f instanceof f)&&"constructor"in e&&"constructor"in n)return!1}if(t===0)return!1;t<0&&(t=-1),r=r||[],a=a||[];for(var v=r.length;v--;)if(r[v]===e)return a[v]===n;if(r.push(e),a.push(n),c){if(v=e.length,v!==n.length)return!1;for(;v--;)if(!rv(e[v],n[v],t-1,r,a))return!1}else{var y=Object.keys(e),E=y.length;if(Object.keys(n).length!==E)return!1;for(var w=0;w<E;w++){var S=y[w];if(!($o(n,S)&&rv(e[S],n[S],t-1,r,a)))return!1}}return r.pop(),a.pop(),!0}function Qm(e){return Qn(e)?e.slice():yc(e)||Rn(e)||Vo(e)||an(e)?Array.from(e.entries()):e}var Jm,U8=((Jm=Pp().Iterator)==null?void 0:Jm.prototype)||{};function Pv(e){return e[Symbol.iterator]=q8,Object.assign(Object.create(U8),e)}function q8(){return this}["Symbol","Map","Set"].forEach(function(e){var n=Pp();typeof n[e]>"u"&&Lt("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:B5,extras:{getDebugName:bp},$mobx:bt});const H8=Object.freeze(Object.defineProperty({__proto__:null,$mobx:bt,FlowCancellationError:Lp,ObservableMap:Dp,ObservableSet:Ev,Reaction:Oa,_allowStateChanges:fv,_allowStateChangesInsideComputed:uc,_allowStateReadsEnd:ac,_allowStateReadsStart:Mp,_autoAction:sc,_endAction:T5,_getAdministration:Pa,_getGlobalState:N5,_interceptReads:mv,_isComputingDerivation:z6,_resetGlobalState:H6,_startAction:A5,action:Xr,autorun:pv,comparer:Us,computed:Vs,configure:K5,createAtom:Ad,defineProperty:wv,entries:nw,extendObservable:vv,flow:Gs,flowResult:p8,get:b8,getAtom:no,getDebugName:bp,getDependencyTree:X5,getObserverTree:u8,has:iw,intercept:Np,isAction:cc,isBoxedObservable:dv,isComputed:m8,isComputedProp:ew,isFlow:fc,isFlowCancellationError:d8,isObservable:Ip,isObservableArray:Qn,isObservableMap:Rn,isObservableObject:yn,isObservableProp:rw,isObservableSet:an,keys:Td,makeAutoObservable:C8,makeObservable:_v,observable:ur,observe:jp,onBecomeObserved:W5,onBecomeUnobserved:gv,onReactionError:K6,override:J_,ownKeys:aw,reaction:$5,remove:y8,runInAction:uc,set:bv,spy:B5,toJS:S8,trace:E8,transaction:Ja,untracked:hv,values:yv,when:tv},Symbol.toStringTag,{value:"Module"}));if(!Sr.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!_v)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var G8=u5();function V8(e){e()}function dw(e){e||(e=V8),K5({reactionScheduler:e})}var $8=function(){return!0};function W8(e){return X5(e)}var hw=!1;function pw(e){hw=e}function Cv(){return hw}var Y8=1e4,K8=1e4,X8=function(){function e(n){var t=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(r){r===void 0&&(r=Y8),clearTimeout(t.sweepTimeout),t.sweepTimeout=void 0;var a=Date.now();t.registrations.forEach(function(o,s){a-o.registeredAt>=r&&(t.finalize(o.value),t.registrations.delete(s))}),t.registrations.size>0&&t.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){t.sweep(0)}})}return Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t,r){this.registrations.set(r,{value:t,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.registrations.delete(n)}}),Object.defineProperty(e.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,K8))}}),e}(),Z8=typeof FinalizationRegistry<"u"?FinalizationRegistry:X8,wp=new Z8(function(e){var n;(n=e.reaction)===null||n===void 0||n.dispose(),e.reaction=null}),jg={exports:{}},Dg={};/**
35
- * @license React
36
- * use-sync-external-store-shim.production.js
37
- *
38
- * Copyright (c) Meta Platforms, Inc. and 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 ey;function Q8(){if(ey)return Dg;ey=1;var e=Or();function n(y,E){return y===E&&(y!==0||1/y===1/E)||y!==y&&E!==E}var t=typeof Object.is=="function"?Object.is:n,r=e.useState,a=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function c(y,E){var w=E(),S=r({inst:{value:w,getSnapshot:E}}),x=S[0].inst,_=S[1];return o(function(){x.value=w,x.getSnapshot=E,m(x)&&_({inst:x})},[y,w,E]),a(function(){return m(x)&&_({inst:x}),y(function(){m(x)&&_({inst:x})})},[y]),s(w),w}function m(y){var E=y.getSnapshot;y=y.value;try{var w=E();return!t(y,w)}catch{return!0}}function f(y,E){return E()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return Dg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Dg}var ty;function J8(){return ty||(ty=1,jg.exports=Q8()),jg.exports}var e9=J8();function ry(e){e.reaction=new Oa("observer".concat(e.name),function(){var n;e.stateVersion=Symbol(),(n=e.onStoreChange)===null||n===void 0||n.call(e)})}function kv(e,n){if(n===void 0&&(n="observed"),Cv())return e();var t=Gt.useRef(null);if(!t.current){var r={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:n,subscribe:function(c){return wp.unregister(r),r.onStoreChange=c,r.reaction||(ry(r),r.stateVersion=Symbol()),function(){var m;r.onStoreChange=null,(m=r.reaction)===null||m===void 0||m.dispose(),r.reaction=null}},getSnapshot:function(){return r.stateVersion}};t.current=r}var a=t.current;a.reaction||(ry(a),wp.register(t,a,a)),Gt.useDebugValue(a.reaction,W8),e9.useSyncExternalStore(a.subscribe,a.getSnapshot,a.getSnapshot);var o,s;if(a.reaction.track(function(){try{o=e()}catch(c){s=c}}),s)throw s;return o}var Fg,zg,gw=typeof Symbol=="function"&&Symbol.for,t9=(zg=(Fg=Object.getOwnPropertyDescriptor(function(){},"name"))===null||Fg===void 0?void 0:Fg.configurable)!==null&&zg!==void 0?zg:!1,ny=gw?Symbol.for("react.forward_ref"):typeof Sr.forwardRef=="function"&&Sr.forwardRef(function(e){return null}).$$typeof,iy=gw?Symbol.for("react.memo"):typeof Sr.memo=="function"&&Sr.memo(function(e){return null}).$$typeof;function r9(e,n){var t;if(iy&&e.$$typeof===iy)throw new Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");if(Cv())return e;var r=(t=n==null?void 0:n.forwardRef)!==null&&t!==void 0?t:!1,a=e,o=e.displayName||e.name;if(ny&&e.$$typeof===ny&&(r=!0,a=e.render,typeof a!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var s=function(c,m){return kv(function(){return a(c,m)},o)};return s.displayName=e.displayName,t9&&Object.defineProperty(s,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(s.contextTypes=e.contextTypes),r&&(s=Sr.forwardRef(s)),s=Sr.memo(s),i9(e,s),s}var n9={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function i9(e,n){Object.keys(e).forEach(function(t){n9[t]||Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))})}function vw(e){var n=e.children,t=e.render;n&&t&&console.error("MobX Observer: Do not use children and render in the same time in `Observer`");var r=n||t;return typeof r!="function"?null:kv(r)}vw.displayName="Observer";function a9(e,n){return Sr.useState(function(){return ur(e(),n,{autoBind:!0})})[0]}function mw(e){var n=Sr.useState(function(){return ur(e,{},{deep:!1})})[0];return uc(function(){Object.assign(n,e)}),n}function o9(e,n){var t=n&&mw(n);return Sr.useState(function(){return ur(e(t),void 0,{autoBind:!0})})[0]}var Bg;dw(G8.unstable_batchedUpdates);var l9=(Bg=wp.finalizeAllImmediately)!==null&&Bg!==void 0?Bg:function(){};function s9(e,n){return n===void 0&&(n="observed"),kv(e,n)}function u9(e){pw(e)}const c9=Object.freeze(Object.defineProperty({__proto__:null,Observer:vw,_observerFinalizationRegistry:wp,clearTimers:l9,enableStaticRendering:pw,isObserverBatched:$8,isUsingStaticRendering:Cv,observer:r9,observerBatching:dw,useAsObservableSource:mw,useLocalObservable:a9,useLocalStore:o9,useObserver:s9,useStaticRendering:u9},Symbol.toStringTag,{value:"Module"})),Ri=Yl(c9);var Ns={};const Xi=Yl(H8);var sp={exports:{}},bf={},Ug={},qg={},ay;function Dt(){return ay||(ay=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._registerNode=e.Konva=e.glob=void 0;const n=Math.PI/180;function t(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}e.glob=typeof oc<"u"?oc:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},e.Konva={_global:e.glob,version:"9.3.19",isBrowser:t(),isUnminified:/param/.test((function(a){}).toString()),dblClickWindow:400,getAngle(a){return e.Konva.angleDeg?a*n:a},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_fixTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return e.Konva.DD.isDragging},isTransforming(){var a;return(a=e.Konva.Transformer)===null||a===void 0?void 0:a.isTransforming()},isDragReady(){return!!e.Konva.DD.node},releaseCanvasOnDestroy:!0,document:e.glob.document,_injectGlobal(a){e.glob.Konva=a}};const r=a=>{e.Konva[a.prototype.getClassName()]=a};e._registerNode=r,e.Konva._injectGlobal(e.Konva)}(qg)),qg}var Hg={},oy;function Lr(){return oy||(oy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const n=Dt();class t{constructor(d=[1,0,0,1,0,0]){this.dirty=!1,this.m=d&&d.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new t(this.m)}copyInto(d){d.m[0]=this.m[0],d.m[1]=this.m[1],d.m[2]=this.m[2],d.m[3]=this.m[3],d.m[4]=this.m[4],d.m[5]=this.m[5]}point(d){const P=this.m;return{x:P[0]*d.x+P[2]*d.y+P[4],y:P[1]*d.x+P[3]*d.y+P[5]}}translate(d,P){return this.m[4]+=this.m[0]*d+this.m[2]*P,this.m[5]+=this.m[1]*d+this.m[3]*P,this}scale(d,P){return this.m[0]*=d,this.m[1]*=d,this.m[2]*=P,this.m[3]*=P,this}rotate(d){const P=Math.cos(d),M=Math.sin(d),T=this.m[0]*P+this.m[2]*M,I=this.m[1]*P+this.m[3]*M,F=this.m[0]*-M+this.m[2]*P,k=this.m[1]*-M+this.m[3]*P;return this.m[0]=T,this.m[1]=I,this.m[2]=F,this.m[3]=k,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(d,P){const M=this.m[0]+this.m[2]*P,T=this.m[1]+this.m[3]*P,I=this.m[2]+this.m[0]*d,F=this.m[3]+this.m[1]*d;return this.m[0]=M,this.m[1]=T,this.m[2]=I,this.m[3]=F,this}multiply(d){const P=this.m[0]*d.m[0]+this.m[2]*d.m[1],M=this.m[1]*d.m[0]+this.m[3]*d.m[1],T=this.m[0]*d.m[2]+this.m[2]*d.m[3],I=this.m[1]*d.m[2]+this.m[3]*d.m[3],F=this.m[0]*d.m[4]+this.m[2]*d.m[5]+this.m[4],k=this.m[1]*d.m[4]+this.m[3]*d.m[5]+this.m[5];return this.m[0]=P,this.m[1]=M,this.m[2]=T,this.m[3]=I,this.m[4]=F,this.m[5]=k,this}invert(){const d=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),P=this.m[3]*d,M=-this.m[1]*d,T=-this.m[2]*d,I=this.m[0]*d,F=d*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),k=d*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=P,this.m[1]=M,this.m[2]=T,this.m[3]=I,this.m[4]=F,this.m[5]=k,this}getMatrix(){return this.m}decompose(){const d=this.m[0],P=this.m[1],M=this.m[2],T=this.m[3],I=this.m[4],F=this.m[5],k=d*T-P*M,O={x:I,y:F,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(d!=0||P!=0){const N=Math.sqrt(d*d+P*P);O.rotation=P>0?Math.acos(d/N):-Math.acos(d/N),O.scaleX=N,O.scaleY=k/N,O.skewX=(d*M+P*T)/k,O.skewY=0}else if(M!=0||T!=0){const N=Math.sqrt(M*M+T*T);O.rotation=Math.PI/2-(T>0?Math.acos(-M/N):-Math.acos(M/N)),O.scaleX=k/N,O.scaleY=N,O.skewX=0,O.skewY=(d*M+P*T)/k}return O.rotation=e.Util._getRotation(O.rotation),O}}e.Transform=t;const r="[object Array]",a="[object Number]",o="[object String]",s="[object Boolean]",c=Math.PI/180,m=180/Math.PI,f="#",v="",y="0",E="Konva warning: ",w="Konva error: ",S="rgb(",x={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},_=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let b=[];const g=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(h){setTimeout(h,60)};e.Util={_isElement(h){return!!(h&&h.nodeType==1)},_isFunction(h){return!!(h&&h.constructor&&h.call&&h.apply)},_isPlainObject(h){return!!h&&h.constructor===Object},_isArray(h){return Object.prototype.toString.call(h)===r},_isNumber(h){return Object.prototype.toString.call(h)===a&&!isNaN(h)&&isFinite(h)},_isString(h){return Object.prototype.toString.call(h)===o},_isBoolean(h){return Object.prototype.toString.call(h)===s},isObject(h){return h instanceof Object},isValidSelector(h){if(typeof h!="string")return!1;const d=h[0];return d==="#"||d==="."||d===d.toUpperCase()},_sign(h){return h===0||h>0?1:-1},requestAnimFrame(h){b.push(h),b.length===1&&g(function(){const d=b;b=[],d.forEach(function(P){P()})})},createCanvasElement(){const h=document.createElement("canvas");try{h.style=h.style||{}}catch{}return h},createImageElement(){return document.createElement("img")},_isInDocument(h){for(;h=h.parentNode;)if(h==document)return!0;return!1},_urlToImage(h,d){const P=e.Util.createImageElement();P.onload=function(){d(P)},P.src=h},_rgbToHex(h,d,P){return((1<<24)+(h<<16)+(d<<8)+P).toString(16).slice(1)},_hexToRgb(h){h=h.replace(f,v);const d=parseInt(h,16);return{r:d>>16&255,g:d>>8&255,b:d&255}},getRandomColor(){let h=(Math.random()*16777215<<0).toString(16);for(;h.length<6;)h=y+h;return f+h},getRGB(h){let d;return h in x?(d=x[h],{r:d[0],g:d[1],b:d[2]}):h[0]===f?this._hexToRgb(h.substring(1)):h.substr(0,4)===S?(d=_.exec(h.replace(/ /g,"")),{r:parseInt(d[1],10),g:parseInt(d[2],10),b:parseInt(d[3],10)}):{r:0,g:0,b:0}},colorToRGBA(h){return h=h||"black",e.Util._namedColorToRBA(h)||e.Util._hex3ColorToRGBA(h)||e.Util._hex4ColorToRGBA(h)||e.Util._hex6ColorToRGBA(h)||e.Util._hex8ColorToRGBA(h)||e.Util._rgbColorToRGBA(h)||e.Util._rgbaColorToRGBA(h)||e.Util._hslColorToRGBA(h)},_namedColorToRBA(h){const d=x[h.toLowerCase()];return d?{r:d[0],g:d[1],b:d[2],a:1}:null},_rgbColorToRGBA(h){if(h.indexOf("rgb(")===0){h=h.match(/rgb\(([^)]+)\)/)[1];const d=h.split(/ *, */).map(Number);return{r:d[0],g:d[1],b:d[2],a:1}}},_rgbaColorToRGBA(h){if(h.indexOf("rgba(")===0){h=h.match(/rgba\(([^)]+)\)/)[1];const d=h.split(/ *, */).map((P,M)=>P.slice(-1)==="%"?M===3?parseInt(P)/100:parseInt(P)/100*255:Number(P));return{r:d[0],g:d[1],b:d[2],a:d[3]}}},_hex8ColorToRGBA(h){if(h[0]==="#"&&h.length===9)return{r:parseInt(h.slice(1,3),16),g:parseInt(h.slice(3,5),16),b:parseInt(h.slice(5,7),16),a:parseInt(h.slice(7,9),16)/255}},_hex6ColorToRGBA(h){if(h[0]==="#"&&h.length===7)return{r:parseInt(h.slice(1,3),16),g:parseInt(h.slice(3,5),16),b:parseInt(h.slice(5,7),16),a:1}},_hex4ColorToRGBA(h){if(h[0]==="#"&&h.length===5)return{r:parseInt(h[1]+h[1],16),g:parseInt(h[2]+h[2],16),b:parseInt(h[3]+h[3],16),a:parseInt(h[4]+h[4],16)/255}},_hex3ColorToRGBA(h){if(h[0]==="#"&&h.length===4)return{r:parseInt(h[1]+h[1],16),g:parseInt(h[2]+h[2],16),b:parseInt(h[3]+h[3],16),a:1}},_hslColorToRGBA(h){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(h)){const[d,...P]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(h),M=Number(P[0])/360,T=Number(P[1])/100,I=Number(P[2])/100;let F,k,O;if(T===0)return O=I*255,{r:Math.round(O),g:Math.round(O),b:Math.round(O),a:1};I<.5?F=I*(1+T):F=I+T-I*T;const N=2*I-F,A=[0,0,0];for(let R=0;R<3;R++)k=M+1/3*-(R-1),k<0&&k++,k>1&&k--,6*k<1?O=N+(F-N)*6*k:2*k<1?O=F:3*k<2?O=N+(F-N)*(2/3-k)*6:O=N,A[R]=O*255;return{r:Math.round(A[0]),g:Math.round(A[1]),b:Math.round(A[2]),a:1}}},haveIntersection(h,d){return!(d.x>h.x+h.width||d.x+d.width<h.x||d.y>h.y+h.height||d.y+d.height<h.y)},cloneObject(h){const d={};for(const P in h)this._isPlainObject(h[P])?d[P]=this.cloneObject(h[P]):this._isArray(h[P])?d[P]=this.cloneArray(h[P]):d[P]=h[P];return d},cloneArray(h){return h.slice(0)},degToRad(h){return h*c},radToDeg(h){return h*m},_degToRad(h){return e.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),e.Util.degToRad(h)},_radToDeg(h){return e.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),e.Util.radToDeg(h)},_getRotation(h){return n.Konva.angleDeg?e.Util.radToDeg(h):h},_capitalize(h){return h.charAt(0).toUpperCase()+h.slice(1)},throw(h){throw new Error(w+h)},error(h){console.error(w+h)},warn(h){n.Konva.showWarnings&&console.warn(E+h)},each(h,d){for(const P in h)d(P,h[P])},_inRange(h,d,P){return d<=h&&h<P},_getProjectionToSegment(h,d,P,M,T,I){let F,k,O;const N=(h-P)*(h-P)+(d-M)*(d-M);if(N==0)F=h,k=d,O=(T-P)*(T-P)+(I-M)*(I-M);else{const A=((T-h)*(P-h)+(I-d)*(M-d))/N;A<0?(F=h,k=d,O=(h-T)*(h-T)+(d-I)*(d-I)):A>1?(F=P,k=M,O=(P-T)*(P-T)+(M-I)*(M-I)):(F=h+A*(P-h),k=d+A*(M-d),O=(F-T)*(F-T)+(k-I)*(k-I))}return[F,k,O]},_getProjectionToLine(h,d,P){const M=e.Util.cloneObject(h);let T=Number.MAX_VALUE;return d.forEach(function(I,F){if(!P&&F===d.length-1)return;const k=d[(F+1)%d.length],O=e.Util._getProjectionToSegment(I.x,I.y,k.x,k.y,h.x,h.y),N=O[0],A=O[1],R=O[2];R<T&&(M.x=N,M.y=A,T=R)}),M},_prepareArrayForTween(h,d,P){const M=[],T=[];if(h.length>d.length){const F=d;d=h,h=F}for(let F=0;F<h.length;F+=2)M.push({x:h[F],y:h[F+1]});for(let F=0;F<d.length;F+=2)T.push({x:d[F],y:d[F+1]});const I=[];return T.forEach(function(F){const k=e.Util._getProjectionToLine(F,M,P);I.push(k.x),I.push(k.y)}),I},_prepareToStringify(h){let d;h.visitedByCircularReferenceRemoval=!0;for(const P in h)if(h.hasOwnProperty(P)&&h[P]&&typeof h[P]=="object"){if(d=Object.getOwnPropertyDescriptor(h,P),h[P].visitedByCircularReferenceRemoval||e.Util._isElement(h[P]))if(d.configurable)delete h[P];else return null;else if(e.Util._prepareToStringify(h[P])===null)if(d.configurable)delete h[P];else return null}return delete h.visitedByCircularReferenceRemoval,h},_assign(h,d){for(const P in d)h[P]=d[P];return h},_getFirstPointerId(h){return h.touches?h.changedTouches[0].identifier:h.pointerId||999},releaseCanvas(...h){n.Konva.releaseCanvasOnDestroy&&h.forEach(d=>{d.width=0,d.height=0})},drawRoundedRectPath(h,d,P,M){let T=0,I=0,F=0,k=0;typeof M=="number"?T=I=F=k=Math.min(M,d/2,P/2):(T=Math.min(M[0]||0,d/2,P/2),I=Math.min(M[1]||0,d/2,P/2),k=Math.min(M[2]||0,d/2,P/2),F=Math.min(M[3]||0,d/2,P/2)),h.moveTo(T,0),h.lineTo(d-I,0),h.arc(d-I,I,I,Math.PI*3/2,0,!1),h.lineTo(d,P-k),h.arc(d-k,P-k,k,0,Math.PI/2,!1),h.lineTo(F,P),h.arc(F,P-F,F,Math.PI/2,Math.PI,!1),h.lineTo(0,T),h.arc(T,T,T,Math.PI,Math.PI*3/2,!1)}}}(Hg)),Hg}var wf={},Gg={},fi={},ly;function Vt(){if(ly)return fi;ly=1,Object.defineProperty(fi,"__esModule",{value:!0}),fi.RGBComponent=r,fi.alphaComponent=a,fi.getNumberValidator=o,fi.getNumberOrArrayOfNumbersValidator=s,fi.getNumberOrAutoValidator=c,fi.getStringValidator=m,fi.getStringOrGradientValidator=f,fi.getFunctionValidator=v,fi.getNumberArrayValidator=y,fi.getBooleanValidator=E,fi.getComponentValidator=w;const e=Dt(),n=Lr();function t(S){return n.Util._isString(S)?'"'+S+'"':Object.prototype.toString.call(S)==="[object Number]"||n.Util._isBoolean(S)?S:Object.prototype.toString.call(S)}function r(S){return S>255?255:S<0?0:Math.round(S)}function a(S){return S>1?1:S<1e-4?1e-4:S}function o(){if(e.Konva.isUnminified)return function(S,x){return n.Util._isNumber(S)||n.Util.warn(t(S)+' is a not valid value for "'+x+'" attribute. The value should be a number.'),S}}function s(S){if(e.Konva.isUnminified)return function(x,_){let b=n.Util._isNumber(x),g=n.Util._isArray(x)&&x.length==S;return!b&&!g&&n.Util.warn(t(x)+' is a not valid value for "'+_+'" attribute. The value should be a number or Array<number>('+S+")"),x}}function c(){if(e.Konva.isUnminified)return function(S,x){var _=n.Util._isNumber(S),b=S==="auto";return _||b||n.Util.warn(t(S)+' is a not valid value for "'+x+'" attribute. The value should be a number or "auto".'),S}}function m(){if(e.Konva.isUnminified)return function(S,x){return n.Util._isString(S)||n.Util.warn(t(S)+' is a not valid value for "'+x+'" attribute. The value should be a string.'),S}}function f(){if(e.Konva.isUnminified)return function(S,x){const _=n.Util._isString(S),b=Object.prototype.toString.call(S)==="[object CanvasGradient]"||S&&S.addColorStop;return _||b||n.Util.warn(t(S)+' is a not valid value for "'+x+'" attribute. The value should be a string or a native gradient.'),S}}function v(){if(e.Konva.isUnminified)return function(S,x){return n.Util._isFunction(S)||n.Util.warn(t(S)+' is a not valid value for "'+x+'" attribute. The value should be a function.'),S}}function y(){if(e.Konva.isUnminified)return function(S,x){const _=Int8Array?Object.getPrototypeOf(Int8Array):null;return _&&S instanceof _||(n.Util._isArray(S)?S.forEach(function(b){n.Util._isNumber(b)||n.Util.warn('"'+x+'" attribute has non numeric element '+b+". Make sure that all elements are numbers.")}):n.Util.warn(t(S)+' is a not valid value for "'+x+'" attribute. The value should be a array of numbers.')),S}}function E(){if(e.Konva.isUnminified)return function(S,x){var _=S===!0||S===!1;return _||n.Util.warn(t(S)+' is a not valid value for "'+x+'" attribute. The value should be a boolean.'),S}}function w(S){if(e.Konva.isUnminified)return function(x,_){return x==null||n.Util.isObject(x)||n.Util.warn(t(x)+' is a not valid value for "'+_+'" attribute. The value should be an object with properties '+S),x}}return fi}var sy;function qt(){return sy||(sy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const n=Lr(),t=Vt(),r="get",a="set";e.Factory={addGetterSetter(o,s,c,m,f){e.Factory.addGetter(o,s,c),e.Factory.addSetter(o,s,m,f),e.Factory.addOverloadedGetterSetter(o,s)},addGetter(o,s,c){var m=r+n.Util._capitalize(s);o.prototype[m]=o.prototype[m]||function(){const f=this.attrs[s];return f===void 0?c:f}},addSetter(o,s,c,m){var f=a+n.Util._capitalize(s);o.prototype[f]||e.Factory.overWriteSetter(o,s,c,m)},overWriteSetter(o,s,c,m){var f=a+n.Util._capitalize(s);o.prototype[f]=function(v){return c&&v!==void 0&&v!==null&&(v=c.call(this,v,s)),this._setAttr(s,v),m&&m.call(this),this}},addComponentsGetterSetter(o,s,c,m,f){const v=c.length,y=n.Util._capitalize,E=r+y(s),w=a+y(s);o.prototype[E]=function(){const x={};for(let _=0;_<v;_++){const b=c[_];x[b]=this.getAttr(s+y(b))}return x};const S=(0,t.getComponentValidator)(c);o.prototype[w]=function(x){const _=this.attrs[s];m&&(x=m.call(this,x,s)),S&&S.call(this,x,s);for(const b in x)x.hasOwnProperty(b)&&this._setAttr(s+y(b),x[b]);return x||c.forEach(b=>{this._setAttr(s+y(b),void 0)}),this._fireChangeEvent(s,_,x),f&&f.call(this),this},e.Factory.addOverloadedGetterSetter(o,s)},addOverloadedGetterSetter(o,s){var c=n.Util._capitalize(s),m=a+c,f=r+c;o.prototype[s]=function(){return arguments.length?(this[m](arguments[0]),this):this[f]()}},addDeprecatedGetterSetter(o,s,c,m){n.Util.error("Adding deprecated "+s);const f=r+n.Util._capitalize(s),v=s+" property is deprecated and will be removed soon. Look at Konva change log for more information.";o.prototype[f]=function(){n.Util.error(v);const y=this.attrs[s];return y===void 0?c:y},e.Factory.addSetter(o,s,m,function(){n.Util.error(v)}),e.Factory.addOverloadedGetterSetter(o,s)},backCompat(o,s){n.Util.each(s,function(c,m){const f=o.prototype[m],v=r+n.Util._capitalize(c),y=a+n.Util._capitalize(c);function E(){f.apply(this,arguments),n.Util.error('"'+c+'" method is deprecated and will be removed soon. Use ""'+m+'" instead.')}o.prototype[c]=E,o.prototype[v]=E,o.prototype[y]=E})},afterSetFilter(){this._filterUpToDate=!1}}}(Gg)),Gg}var Do={},Fo={},uy;function yw(){if(uy)return Fo;uy=1,Object.defineProperty(Fo,"__esModule",{value:!0}),Fo.HitContext=Fo.SceneContext=Fo.Context=void 0;const e=Lr(),n=Dt();function t(b){const g=[],h=b.length,d=e.Util;for(let P=0;P<h;P++){let M=b[P];d._isNumber(M)?M=Math.round(M*1e3)/1e3:d._isString(M)||(M=M+""),g.push(M)}return g}const r=",",a="(",o=")",s="([",c="])",m=";",f="()",v="=",y=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],E=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"],w=100;let S=class{constructor(g){this.canvas=g,n.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(g){g.fillEnabled()&&this._fill(g)}_fill(g){}strokeShape(g){g.hasStroke()&&this._stroke(g)}_stroke(g){}fillStrokeShape(g){g.attrs.fillAfterStrokeEnabled?(this.strokeShape(g),this.fillShape(g)):(this.fillShape(g),this.strokeShape(g))}getTrace(g,h){let d=this.traceArr,P=d.length,M="",T,I,F,k;for(T=0;T<P;T++)I=d[T],F=I.method,F?(k=I.args,M+=F,g?M+=f:e.Util._isArray(k[0])?M+=s+k.join(r)+c:(h&&(k=k.map(O=>typeof O=="number"?Math.floor(O):O)),M+=a+k.join(r)+o)):(M+=I.property,g||(M+=v+I.val)),M+=m;return M}clearTrace(){this.traceArr=[]}_trace(g){let h=this.traceArr,d;h.push(g),d=h.length,d>=w&&h.shift()}reset(){const g=this.getCanvas().getPixelRatio();this.setTransform(1*g,0,0,1*g,0,0)}getCanvas(){return this.canvas}clear(g){const h=this.getCanvas();g?this.clearRect(g.x||0,g.y||0,g.width||0,g.height||0):this.clearRect(0,0,h.getWidth()/h.pixelRatio,h.getHeight()/h.pixelRatio)}_applyLineCap(g){const h=g.attrs.lineCap;h&&this.setAttr("lineCap",h)}_applyOpacity(g){const h=g.getAbsoluteOpacity();h!==1&&this.setAttr("globalAlpha",h)}_applyLineJoin(g){const h=g.attrs.lineJoin;h&&this.setAttr("lineJoin",h)}setAttr(g,h){this._context[g]=h}arc(g,h,d,P,M,T){this._context.arc(g,h,d,P,M,T)}arcTo(g,h,d,P,M){this._context.arcTo(g,h,d,P,M)}beginPath(){this._context.beginPath()}bezierCurveTo(g,h,d,P,M,T){this._context.bezierCurveTo(g,h,d,P,M,T)}clearRect(g,h,d,P){this._context.clearRect(g,h,d,P)}clip(...g){this._context.clip.apply(this._context,g)}closePath(){this._context.closePath()}createImageData(g,h){const d=arguments;if(d.length===2)return this._context.createImageData(g,h);if(d.length===1)return this._context.createImageData(g)}createLinearGradient(g,h,d,P){return this._context.createLinearGradient(g,h,d,P)}createPattern(g,h){return this._context.createPattern(g,h)}createRadialGradient(g,h,d,P,M,T){return this._context.createRadialGradient(g,h,d,P,M,T)}drawImage(g,h,d,P,M,T,I,F,k){const O=arguments,N=this._context;O.length===3?N.drawImage(g,h,d):O.length===5?N.drawImage(g,h,d,P,M):O.length===9&&N.drawImage(g,h,d,P,M,T,I,F,k)}ellipse(g,h,d,P,M,T,I,F){this._context.ellipse(g,h,d,P,M,T,I,F)}isPointInPath(g,h,d,P){return d?this._context.isPointInPath(d,g,h,P):this._context.isPointInPath(g,h,P)}fill(...g){this._context.fill.apply(this._context,g)}fillRect(g,h,d,P){this._context.fillRect(g,h,d,P)}strokeRect(g,h,d,P){this._context.strokeRect(g,h,d,P)}fillText(g,h,d,P){P?this._context.fillText(g,h,d,P):this._context.fillText(g,h,d)}measureText(g){return this._context.measureText(g)}getImageData(g,h,d,P){return this._context.getImageData(g,h,d,P)}lineTo(g,h){this._context.lineTo(g,h)}moveTo(g,h){this._context.moveTo(g,h)}rect(g,h,d,P){this._context.rect(g,h,d,P)}roundRect(g,h,d,P,M){this._context.roundRect(g,h,d,P,M)}putImageData(g,h,d){this._context.putImageData(g,h,d)}quadraticCurveTo(g,h,d,P){this._context.quadraticCurveTo(g,h,d,P)}restore(){this._context.restore()}rotate(g){this._context.rotate(g)}save(){this._context.save()}scale(g,h){this._context.scale(g,h)}setLineDash(g){this._context.setLineDash?this._context.setLineDash(g):"mozDash"in this._context?this._context.mozDash=g:"webkitLineDash"in this._context&&(this._context.webkitLineDash=g)}getLineDash(){return this._context.getLineDash()}setTransform(g,h,d,P,M,T){this._context.setTransform(g,h,d,P,M,T)}stroke(g){g?this._context.stroke(g):this._context.stroke()}strokeText(g,h,d,P){this._context.strokeText(g,h,d,P)}transform(g,h,d,P,M,T){this._context.transform(g,h,d,P,M,T)}translate(g,h){this._context.translate(g,h)}_enableTrace(){let g=this,h=y.length,d=this.setAttr,P,M;const T=function(I){let F=g[I],k;g[I]=function(){return M=t(Array.prototype.slice.call(arguments,0)),k=F.apply(g,arguments),g._trace({method:I,args:M}),k}};for(P=0;P<h;P++)T(y[P]);g.setAttr=function(){d.apply(g,arguments);const I=arguments[0];let F=arguments[1];(I==="shadowOffsetX"||I==="shadowOffsetY"||I==="shadowBlur")&&(F=F/this.canvas.getPixelRatio()),g._trace({property:I,val:F})}}_applyGlobalCompositeOperation(g){const h=g.attrs.globalCompositeOperation;!h||h==="source-over"||this.setAttr("globalCompositeOperation",h)}};Fo.Context=S,E.forEach(function(b){Object.defineProperty(S.prototype,b,{get(){return this._context[b]},set(g){this._context[b]=g}})});class x extends S{constructor(g,{willReadFrequently:h=!1}={}){super(g),this._context=g._canvas.getContext("2d",{willReadFrequently:h})}_fillColor(g){const h=g.fill();this.setAttr("fillStyle",h),g._fillFunc(this)}_fillPattern(g){this.setAttr("fillStyle",g._getFillPattern()),g._fillFunc(this)}_fillLinearGradient(g){const h=g._getLinearGradient();h&&(this.setAttr("fillStyle",h),g._fillFunc(this))}_fillRadialGradient(g){const h=g._getRadialGradient();h&&(this.setAttr("fillStyle",h),g._fillFunc(this))}_fill(g){const h=g.fill(),d=g.getFillPriority();if(h&&d==="color"){this._fillColor(g);return}const P=g.getFillPatternImage();if(P&&d==="pattern"){this._fillPattern(g);return}const M=g.getFillLinearGradientColorStops();if(M&&d==="linear-gradient"){this._fillLinearGradient(g);return}const T=g.getFillRadialGradientColorStops();if(T&&d==="radial-gradient"){this._fillRadialGradient(g);return}h?this._fillColor(g):P?this._fillPattern(g):M?this._fillLinearGradient(g):T&&this._fillRadialGradient(g)}_strokeLinearGradient(g){const h=g.getStrokeLinearGradientStartPoint(),d=g.getStrokeLinearGradientEndPoint(),P=g.getStrokeLinearGradientColorStops(),M=this.createLinearGradient(h.x,h.y,d.x,d.y);if(P){for(let T=0;T<P.length;T+=2)M.addColorStop(P[T],P[T+1]);this.setAttr("strokeStyle",M)}}_stroke(g){const h=g.dash(),d=g.getStrokeScaleEnabled();if(g.hasStroke()){if(!d){this.save();const M=this.getCanvas().getPixelRatio();this.setTransform(M,0,0,M,0,0)}this._applyLineCap(g),h&&g.dashEnabled()&&(this.setLineDash(h),this.setAttr("lineDashOffset",g.dashOffset())),this.setAttr("lineWidth",g.strokeWidth()),g.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),g.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(g):this.setAttr("strokeStyle",g.stroke()),g._strokeFunc(this),d||this.restore()}}_applyShadow(g){var h,d,P;const M=(h=g.getShadowRGBA())!==null&&h!==void 0?h:"black",T=(d=g.getShadowBlur())!==null&&d!==void 0?d:5,I=(P=g.getShadowOffset())!==null&&P!==void 0?P:{x:0,y:0},F=g.getAbsoluteScale(),k=this.canvas.getPixelRatio(),O=F.x*k,N=F.y*k;this.setAttr("shadowColor",M),this.setAttr("shadowBlur",T*Math.min(Math.abs(O),Math.abs(N))),this.setAttr("shadowOffsetX",I.x*O),this.setAttr("shadowOffsetY",I.y*N)}}Fo.SceneContext=x;class _ extends S{constructor(g){super(g),this._context=g._canvas.getContext("2d",{willReadFrequently:!0})}_fill(g){this.save(),this.setAttr("fillStyle",g.colorKey),g._fillFuncHit(this),this.restore()}strokeShape(g){g.hasHitStroke()&&this._stroke(g)}_stroke(g){if(g.hasHitStroke()){const h=g.getStrokeScaleEnabled();if(!h){this.save();const M=this.getCanvas().getPixelRatio();this.setTransform(M,0,0,M,0,0)}this._applyLineCap(g);const d=g.hitStrokeWidth(),P=d==="auto"?g.strokeWidth():d;this.setAttr("lineWidth",P),this.setAttr("strokeStyle",g.colorKey),g._strokeFuncHit(this),h||this.restore()}}}return Fo.HitContext=_,Fo}var cy;function Fp(){if(cy)return Do;cy=1,Object.defineProperty(Do,"__esModule",{value:!0}),Do.HitCanvas=Do.SceneCanvas=Do.Canvas=void 0;const e=Lr(),n=yw(),t=Dt();let r;function a(){if(r)return r;const m=e.Util.createCanvasElement(),f=m.getContext("2d");return r=function(){const v=t.Konva._global.devicePixelRatio||1,y=f.webkitBackingStorePixelRatio||f.mozBackingStorePixelRatio||f.msBackingStorePixelRatio||f.oBackingStorePixelRatio||f.backingStorePixelRatio||1;return v/y}(),e.Util.releaseCanvas(m),r}let o=class{constructor(f){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const y=(f||{}).pixelRatio||t.Konva.pixelRatio||a();this.pixelRatio=y,this._canvas=e.Util.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(f){const v=this.pixelRatio;this.pixelRatio=f,this.setSize(this.getWidth()/v,this.getHeight()/v)}setWidth(f){this.width=this._canvas.width=f*this.pixelRatio,this._canvas.style.width=f+"px";const v=this.pixelRatio;this.getContext()._context.scale(v,v)}setHeight(f){this.height=this._canvas.height=f*this.pixelRatio,this._canvas.style.height=f+"px";const v=this.pixelRatio;this.getContext()._context.scale(v,v)}getWidth(){return this.width}getHeight(){return this.height}setSize(f,v){this.setWidth(f||0),this.setHeight(v||0)}toDataURL(f,v){try{return this._canvas.toDataURL(f,v)}catch{try{return this._canvas.toDataURL()}catch(E){return e.Util.error("Unable to get data URL. "+E.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}};Do.Canvas=o;class s extends o{constructor(f={width:0,height:0,willReadFrequently:!1}){super(f),this.context=new n.SceneContext(this,{willReadFrequently:f.willReadFrequently}),this.setSize(f.width,f.height)}}Do.SceneCanvas=s;class c extends o{constructor(f={width:0,height:0}){super(f),this.hitCanvas=!0,this.context=new n.HitContext(this),this.setSize(f.width,f.height)}}return Do.HitCanvas=c,Do}var Vg={},fy;function Av(){return fy||(fy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const n=Dt(),t=Lr();e.DD={get isDragging(){let r=!1;return e.DD._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(r=!0)}),r},justDragged:!1,get node(){let r;return e.DD._dragElements.forEach(a=>{r=a.node}),r},_dragElements:new Map,_drag(r){const a=[];e.DD._dragElements.forEach((o,s)=>{const{node:c}=o,m=c.getStage();m.setPointersPositions(r),o.pointerId===void 0&&(o.pointerId=t.Util._getFirstPointerId(r));const f=m._changedPointerPositions.find(v=>v.id===o.pointerId);if(f){if(o.dragStatus!=="dragging"){const v=c.dragDistance();if(Math.max(Math.abs(f.x-o.startPointerPos.x),Math.abs(f.y-o.startPointerPos.y))<v||(c.startDrag({evt:r}),!c.isDragging()))return}c._setDragPosition(r,o),a.push(c)}}),a.forEach(o=>{o.fire("dragmove",{type:"dragmove",target:o,evt:r},!0)})},_endDragBefore(r){const a=[];e.DD._dragElements.forEach(o=>{const{node:s}=o,c=s.getStage();if(r&&c.setPointersPositions(r),!c._changedPointerPositions.find(v=>v.id===o.pointerId))return;(o.dragStatus==="dragging"||o.dragStatus==="stopped")&&(e.DD.justDragged=!0,n.Konva._mouseListenClick=!1,n.Konva._touchListenClick=!1,n.Konva._pointerListenClick=!1,o.dragStatus="stopped");const f=o.node.getLayer()||o.node instanceof n.Konva.Stage&&o.node;f&&a.indexOf(f)===-1&&a.push(f)}),a.forEach(o=>{o.draw()})},_endDragAfter(r){e.DD._dragElements.forEach((a,o)=>{a.dragStatus==="stopped"&&a.node.fire("dragend",{type:"dragend",target:a.node,evt:r},!0),a.dragStatus!=="dragging"&&e.DD._dragElements.delete(o)})}},n.Konva.isBrowser&&(window.addEventListener("mouseup",e.DD._endDragBefore,!0),window.addEventListener("touchend",e.DD._endDragBefore,!0),window.addEventListener("touchcancel",e.DD._endDragBefore,!0),window.addEventListener("mousemove",e.DD._drag),window.addEventListener("touchmove",e.DD._drag),window.addEventListener("mouseup",e.DD._endDragAfter,!1),window.addEventListener("touchend",e.DD._endDragAfter,!1),window.addEventListener("touchcancel",e.DD._endDragAfter,!1))}(Vg)),Vg}var dy;function Hr(){if(dy)return wf;dy=1,Object.defineProperty(wf,"__esModule",{value:!0}),wf.Node=void 0;const e=Lr(),n=qt(),t=Fp(),r=Dt(),a=Av(),o=Vt(),s="absoluteOpacity",c="allEventListeners",m="absoluteTransform",f="absoluteScale",v="canvas",y="Change",E="children",w="konva",S="listening",x="mouseenter",_="mouseleave",b="set",g="Shape",h=" ",d="stage",P="transform",M="Stage",T="visible",I=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(h);let F=1;class k{constructor(A){this._id=F++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(A),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(A){(A===P||A===m)&&this._cache.get(A)?this._cache.get(A).dirty=!0:A?this._cache.delete(A):this._cache.clear()}_getCache(A,R){let L=this._cache.get(A);return(L===void 0||(A===P||A===m)&&L.dirty===!0)&&(L=R.call(this),this._cache.set(A,L)),L}_calculate(A,R,L){if(!this._attachedDepsListeners.get(A)){const V=R.map(G=>G+"Change.konva").join(h);this.on(V,()=>{this._clearCache(A)}),this._attachedDepsListeners.set(A,!0)}return this._getCache(A,L)}_getCanvasCache(){return this._cache.get(v)}_clearSelfAndDescendantCache(A){this._clearCache(A),A===m&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(v)){const{scene:A,filter:R,hit:L}=this._cache.get(v);e.Util.releaseCanvas(A,R,L),this._cache.delete(v)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(A){const R=A||{};let L={};(R.x===void 0||R.y===void 0||R.width===void 0||R.height===void 0)&&(L=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let V=Math.ceil(R.width||L.width),G=Math.ceil(R.height||L.height),W=R.pixelRatio,X=R.x===void 0?Math.floor(L.x):R.x,q=R.y===void 0?Math.floor(L.y):R.y,z=R.offset||0,Y=R.drawBorder||!1,U=R.hitCanvasPixelRatio||1;if(!V||!G){e.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const ee=Math.abs(Math.round(L.x)-X)>.5?1:0,te=Math.abs(Math.round(L.y)-q)>.5?1:0;V+=z*2+ee,G+=z*2+te,X-=z,q-=z;const Q=new t.SceneCanvas({pixelRatio:W,width:V,height:G}),Z=new t.SceneCanvas({pixelRatio:W,width:0,height:0,willReadFrequently:!0}),re=new t.HitCanvas({pixelRatio:U,width:V,height:G}),ne=Q.getContext(),ae=re.getContext();return re.isCache=!0,Q.isCache=!0,this._cache.delete(v),this._filterUpToDate=!1,R.imageSmoothingEnabled===!1&&(Q.getContext()._context.imageSmoothingEnabled=!1,Z.getContext()._context.imageSmoothingEnabled=!1),ne.save(),ae.save(),ne.translate(-X,-q),ae.translate(-X,-q),this._isUnderCache=!0,this._clearSelfAndDescendantCache(s),this._clearSelfAndDescendantCache(f),this.drawScene(Q,this),this.drawHit(re,this),this._isUnderCache=!1,ne.restore(),ae.restore(),Y&&(ne.save(),ne.beginPath(),ne.rect(0,0,V,G),ne.closePath(),ne.setAttr("strokeStyle","red"),ne.setAttr("lineWidth",5),ne.stroke(),ne.restore()),this._cache.set(v,{scene:Q,filter:Z,hit:re,x:X,y:q}),this._requestDraw(),this}isCached(){return this._cache.has(v)}getClientRect(A){throw new Error('abstract "getClientRect" method call')}_transformedRect(A,R){const L=[{x:A.x,y:A.y},{x:A.x+A.width,y:A.y},{x:A.x+A.width,y:A.y+A.height},{x:A.x,y:A.y+A.height}];let V=1/0,G=1/0,W=-1/0,X=-1/0;const q=this.getAbsoluteTransform(R);return L.forEach(function(z){const Y=q.point(z);V===void 0&&(V=W=Y.x,G=X=Y.y),V=Math.min(V,Y.x),G=Math.min(G,Y.y),W=Math.max(W,Y.x),X=Math.max(X,Y.y)}),{x:V,y:G,width:W-V,height:X-G}}_drawCachedSceneCanvas(A){A.save(),A._applyOpacity(this),A._applyGlobalCompositeOperation(this);const R=this._getCanvasCache();A.translate(R.x,R.y);const L=this._getCachedSceneCanvas(),V=L.pixelRatio;A.drawImage(L._canvas,0,0,L.width/V,L.height/V),A.restore()}_drawCachedHitCanvas(A){const R=this._getCanvasCache(),L=R.hit;A.save(),A.translate(R.x,R.y),A.drawImage(L._canvas,0,0,L.width/L.pixelRatio,L.height/L.pixelRatio),A.restore()}_getCachedSceneCanvas(){let A=this.filters(),R=this._getCanvasCache(),L=R.scene,V=R.filter,G=V.getContext(),W,X,q,z;if(A){if(!this._filterUpToDate){const Y=L.pixelRatio;V.setSize(L.width/L.pixelRatio,L.height/L.pixelRatio);try{for(W=A.length,G.clear(),G.drawImage(L._canvas,0,0,L.getWidth()/Y,L.getHeight()/Y),X=G.getImageData(0,0,V.getWidth(),V.getHeight()),q=0;q<W;q++){if(z=A[q],typeof z!="function"){e.Util.error("Filter should be type of function, but got "+typeof z+" instead. Please check correct filters");continue}z.call(this,X),G.putImageData(X,0,0)}}catch(U){e.Util.error("Unable to apply filter. "+U.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return V}return L}on(A,R){if(this._cache&&this._cache.delete(c),arguments.length===3)return this._delegate.apply(this,arguments);let L=A.split(h),V=L.length,G,W,X,q,z;for(G=0;G<V;G++)W=L[G],X=W.split("."),q=X[0],z=X[1]||"",this.eventListeners[q]||(this.eventListeners[q]=[]),this.eventListeners[q].push({name:z,handler:R});return this}off(A,R){let L=(A||"").split(h),V=L.length,G,W,X,q,z,Y;if(this._cache&&this._cache.delete(c),!A)for(W in this.eventListeners)this._off(W);for(G=0;G<V;G++)if(X=L[G],q=X.split("."),z=q[0],Y=q[1],z)this.eventListeners[z]&&this._off(z,Y,R);else for(W in this.eventListeners)this._off(W,Y,R);return this}dispatchEvent(A){const R={target:this,type:A.type,evt:A};return this.fire(A.type,R),this}addEventListener(A,R){return this.on(A,function(L){R.call(this,L.evt)}),this}removeEventListener(A){return this.off(A),this}_delegate(A,R,L){const V=this;this.on(A,function(G){const W=G.target.findAncestors(R,!0,V);for(let X=0;X<W.length;X++)G=e.Util.cloneObject(G),G.currentTarget=W[X],L.call(W[X],G)})}remove(){return this.isDragging()&&this.stopDrag(),a.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(m),this._clearSelfAndDescendantCache(s),this._clearSelfAndDescendantCache(f),this._clearSelfAndDescendantCache(d),this._clearSelfAndDescendantCache(T),this._clearSelfAndDescendantCache(S)}_remove(){this._clearCaches();const A=this.getParent();A&&A.children&&(A.children.splice(this.index,1),A._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(A){const R="get"+e.Util._capitalize(A);return e.Util._isFunction(this[R])?this[R]():this.attrs[A]}getAncestors(){let A=this.getParent(),R=[];for(;A;)R.push(A),A=A.getParent();return R}getAttrs(){return this.attrs||{}}setAttrs(A){return this._batchTransformChanges(()=>{let R,L;if(!A)return this;for(R in A)R!==E&&(L=b+e.Util._capitalize(R),e.Util._isFunction(this[L])?this[L](A[R]):this._setAttr(R,A[R]))}),this}isListening(){return this._getCache(S,this._isListening)}_isListening(A){if(!this.listening())return!1;const L=this.getParent();return L&&L!==A&&this!==A?L._isListening(A):!0}isVisible(){return this._getCache(T,this._isVisible)}_isVisible(A){if(!this.visible())return!1;const L=this.getParent();return L&&L!==A&&this!==A?L._isVisible(A):!0}shouldDrawHit(A,R=!1){if(A)return this._isVisible(A)&&this._isListening(A);const L=this.getLayer();let V=!1;a.DD._dragElements.forEach(W=>{W.dragStatus==="dragging"&&(W.node.nodeType==="Stage"||W.node.getLayer()===L)&&(V=!0)});const G=!R&&!r.Konva.hitOnDragEnabled&&(V||r.Konva.isTransforming());return this.isListening()&&this.isVisible()&&!G}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let A=this.getDepth(),R=this,L=0,V,G,W,X;function q(Y){for(V=[],G=Y.length,W=0;W<G;W++)X=Y[W],L++,X.nodeType!==g&&(V=V.concat(X.getChildren().slice())),X._id===R._id&&(W=G);V.length>0&&V[0].getDepth()<=A&&q(V)}const z=this.getStage();return R.nodeType!==M&&z&&q(z.getChildren()),L}getDepth(){let A=0,R=this.parent;for(;R;)A++,R=R.parent;return A}_batchTransformChanges(A){this._batchingTransformChange=!0,A(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(P),this._clearSelfAndDescendantCache(m)),this._needClearTransformCache=!1}setPosition(A){return this._batchTransformChanges(()=>{this.x(A.x),this.y(A.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const A=this.getStage();if(!A)return null;const R=A.getPointerPosition();if(!R)return null;const L=this.getAbsoluteTransform().copy();return L.invert(),L.point(R)}getAbsolutePosition(A){let R=!1,L=this.parent;for(;L;){if(L.isCached()){R=!0;break}L=L.parent}R&&!A&&(A=!0);const V=this.getAbsoluteTransform(A).getMatrix(),G=new e.Transform,W=this.offset();return G.m=V.slice(),G.translate(W.x,W.y),G.getTranslation()}setAbsolutePosition(A){const{x:R,y:L,...V}=this._clearTransform();this.attrs.x=R,this.attrs.y=L,this._clearCache(P);const G=this._getAbsoluteTransform().copy();return G.invert(),G.translate(A.x,A.y),A={x:this.attrs.x+G.getTranslation().x,y:this.attrs.y+G.getTranslation().y},this._setTransform(V),this.setPosition({x:A.x,y:A.y}),this._clearCache(P),this._clearSelfAndDescendantCache(m),this}_setTransform(A){let R;for(R in A)this.attrs[R]=A[R]}_clearTransform(){const A={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,A}move(A){let R=A.x,L=A.y,V=this.x(),G=this.y();return R!==void 0&&(V+=R),L!==void 0&&(G+=L),this.setPosition({x:V,y:G}),this}_eachAncestorReverse(A,R){let L=[],V=this.getParent(),G,W;if(!(R&&R._id===this._id)){for(L.unshift(this);V&&(!R||V._id!==R._id);)L.unshift(V),V=V.parent;for(G=L.length,W=0;W<G;W++)A(L[W])}}rotate(A){return this.rotation(this.rotation()+A),this}moveToTop(){if(!this.parent)return e.Util.warn("Node has no parent. moveToTop function is ignored."),!1;const A=this.index,R=this.parent.getChildren().length;return A<R-1?(this.parent.children.splice(A,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return e.Util.warn("Node has no parent. moveUp function is ignored."),!1;const A=this.index,R=this.parent.getChildren().length;return A<R-1?(this.parent.children.splice(A,1),this.parent.children.splice(A+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return e.Util.warn("Node has no parent. moveDown function is ignored."),!1;const A=this.index;return A>0?(this.parent.children.splice(A,1),this.parent.children.splice(A-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return e.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;const A=this.index;return A>0?(this.parent.children.splice(A,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(A){if(!this.parent)return e.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(A<0||A>=this.parent.children.length)&&e.Util.warn("Unexpected value "+A+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");const R=this.index;return this.parent.children.splice(R,1),this.parent.children.splice(A,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(s,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let A=this.opacity();const R=this.getParent();return R&&!R._isUnderCache&&(A*=R.getAbsoluteOpacity()),A}moveTo(A){return this.getParent()!==A&&(this._remove(),A.add(this)),this}toObject(){let A=this.getAttrs(),R,L,V,G,W;const X={attrs:{},className:this.getClassName()};for(R in A)L=A[R],W=e.Util.isObject(L)&&!e.Util._isPlainObject(L)&&!e.Util._isArray(L),!W&&(V=typeof this[R]=="function"&&this[R],delete A[R],G=V?V.call(this):null,A[R]=L,G!==L&&(X.attrs[R]=L));return e.Util._prepareToStringify(X)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(A,R,L){const V=[];R&&this._isMatch(A)&&V.push(this);let G=this.parent;for(;G;){if(G===L)return V;G._isMatch(A)&&V.push(G),G=G.parent}return V}isAncestorOf(A){return!1}findAncestor(A,R,L){return this.findAncestors(A,R,L)[0]}_isMatch(A){if(!A)return!1;if(typeof A=="function")return A(this);let R=A.replace(/ /g,"").split(","),L=R.length,V,G;for(V=0;V<L;V++)if(G=R[V],e.Util.isValidSelector(G)||(e.Util.warn('Selector "'+G+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),e.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),e.Util.warn("Konva is awesome, right?")),G.charAt(0)==="#"){if(this.id()===G.slice(1))return!0}else if(G.charAt(0)==="."){if(this.hasName(G.slice(1)))return!0}else if(this.className===G||this.nodeType===G)return!0;return!1}getLayer(){const A=this.getParent();return A?A.getLayer():null}getStage(){return this._getCache(d,this._getStage)}_getStage(){const A=this.getParent();return A?A.getStage():null}fire(A,R={},L){return R.target=R.target||this,L?this._fireAndBubble(A,R):this._fire(A,R),this}getAbsoluteTransform(A){return A?this._getAbsoluteTransform(A):this._getCache(m,this._getAbsoluteTransform)}_getAbsoluteTransform(A){let R;if(A)return R=new e.Transform,this._eachAncestorReverse(function(L){const V=L.transformsEnabled();V==="all"?R.multiply(L.getTransform()):V==="position"&&R.translate(L.x()-L.offsetX(),L.y()-L.offsetY())},A),R;{R=this._cache.get(m)||new e.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(R):R.reset();const L=this.transformsEnabled();if(L==="all")R.multiply(this.getTransform());else if(L==="position"){const V=this.attrs.x||0,G=this.attrs.y||0,W=this.attrs.offsetX||0,X=this.attrs.offsetY||0;R.translate(V-W,G-X)}return R.dirty=!1,R}}getAbsoluteScale(A){let R=this;for(;R;)R._isUnderCache&&(A=R),R=R.getParent();const V=this.getAbsoluteTransform(A).decompose();return{x:V.scaleX,y:V.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(P,this._getTransform)}_getTransform(){var A,R;const L=this._cache.get(P)||new e.Transform;L.reset();const V=this.x(),G=this.y(),W=r.Konva.getAngle(this.rotation()),X=(A=this.attrs.scaleX)!==null&&A!==void 0?A:1,q=(R=this.attrs.scaleY)!==null&&R!==void 0?R:1,z=this.attrs.skewX||0,Y=this.attrs.skewY||0,U=this.attrs.offsetX||0,ee=this.attrs.offsetY||0;return(V!==0||G!==0)&&L.translate(V,G),W!==0&&L.rotate(W),(z!==0||Y!==0)&&L.skew(z,Y),(X!==1||q!==1)&&L.scale(X,q),(U!==0||ee!==0)&&L.translate(-1*U,-1*ee),L.dirty=!1,L}clone(A){let R=e.Util.cloneObject(this.attrs),L,V,G,W,X;for(L in A)R[L]=A[L];const q=new this.constructor(R);for(L in this.eventListeners)for(V=this.eventListeners[L],G=V.length,W=0;W<G;W++)X=V[W],X.name.indexOf(w)<0&&(q.eventListeners[L]||(q.eventListeners[L]=[]),q.eventListeners[L].push(X));return q}_toKonvaCanvas(A){A=A||{};const R=this.getClientRect(),L=this.getStage(),V=A.x!==void 0?A.x:Math.floor(R.x),G=A.y!==void 0?A.y:Math.floor(R.y),W=A.pixelRatio||1,X=new t.SceneCanvas({width:A.width||Math.ceil(R.width)||(L?L.width():0),height:A.height||Math.ceil(R.height)||(L?L.height():0),pixelRatio:W}),q=X.getContext(),z=new t.SceneCanvas({width:X.width/X.pixelRatio+Math.abs(V),height:X.height/X.pixelRatio+Math.abs(G),pixelRatio:X.pixelRatio});return A.imageSmoothingEnabled===!1&&(q._context.imageSmoothingEnabled=!1),q.save(),(V||G)&&q.translate(-1*V,-1*G),this.drawScene(X,void 0,z),q.restore(),X}toCanvas(A){return this._toKonvaCanvas(A)._canvas}toDataURL(A){A=A||{};const R=A.mimeType||null,L=A.quality||null,V=this._toKonvaCanvas(A).toDataURL(R,L);return A.callback&&A.callback(V),V}toImage(A){return new Promise((R,L)=>{try{const V=A==null?void 0:A.callback;V&&delete A.callback,e.Util._urlToImage(this.toDataURL(A),function(G){R(G),V==null||V(G)})}catch(V){L(V)}})}toBlob(A){return new Promise((R,L)=>{try{const V=A==null?void 0:A.callback;V&&delete A.callback,this.toCanvas(A).toBlob(G=>{R(G),V==null||V(G)},A==null?void 0:A.mimeType,A==null?void 0:A.quality)}catch(V){L(V)}})}setSize(A){return this.width(A.width),this.height(A.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():r.Konva.dragDistance}_off(A,R,L){let V=this.eventListeners[A],G,W,X;for(G=0;G<V.length;G++)if(W=V[G].name,X=V[G].handler,(W!=="konva"||R==="konva")&&(!R||W===R)&&(!L||L===X)){if(V.splice(G,1),V.length===0){delete this.eventListeners[A];break}G--}}_fireChangeEvent(A,R,L){this._fire(A+y,{oldVal:R,newVal:L})}addName(A){if(!this.hasName(A)){const R=this.name(),L=R?R+" "+A:A;this.name(L)}return this}hasName(A){if(!A)return!1;const R=this.name();return R?(R||"").split(/\s/g).indexOf(A)!==-1:!1}removeName(A){const R=(this.name()||"").split(/\s/g),L=R.indexOf(A);return L!==-1&&(R.splice(L,1),this.name(R.join(" "))),this}setAttr(A,R){const L=this[b+e.Util._capitalize(A)];return e.Util._isFunction(L)?L.call(this,R):this._setAttr(A,R),this}_requestDraw(){if(r.Konva.autoDrawEnabled){const A=this.getLayer()||this.getStage();A==null||A.batchDraw()}}_setAttr(A,R){const L=this.attrs[A];L===R&&!e.Util.isObject(R)||(R==null?delete this.attrs[A]:this.attrs[A]=R,this._shouldFireChangeEvents&&this._fireChangeEvent(A,L,R),this._requestDraw())}_setComponentAttr(A,R,L){let V;L!==void 0&&(V=this.attrs[A],V||(this.attrs[A]=this.getAttr(A)),this.attrs[A][R]=L,this._fireChangeEvent(A,V,L))}_fireAndBubble(A,R,L){if(R&&this.nodeType===g&&(R.target=this),!((A===x||A===_)&&(L&&(this===L||this.isAncestorOf&&this.isAncestorOf(L))||this.nodeType==="Stage"&&!L))){this._fire(A,R);const G=(A===x||A===_)&&L&&L.isAncestorOf&&L.isAncestorOf(this)&&!L.isAncestorOf(this.parent);(R&&!R.cancelBubble||!R)&&this.parent&&this.parent.isListening()&&!G&&(L&&L.parent?this._fireAndBubble.call(this.parent,A,R,L):this._fireAndBubble.call(this.parent,A,R))}}_getProtoListeners(A){var R,L,V;const G=(R=this._cache.get(c))!==null&&R!==void 0?R:{};let W=G==null?void 0:G[A];if(W===void 0){W=[];let X=Object.getPrototypeOf(this);for(;X;){const q=(V=(L=X.eventListeners)===null||L===void 0?void 0:L[A])!==null&&V!==void 0?V:[];W.push(...q),X=Object.getPrototypeOf(X)}G[A]=W,this._cache.set(c,G)}return W}_fire(A,R){R=R||{},R.currentTarget=this,R.type=A;const L=this._getProtoListeners(A);if(L)for(var V=0;V<L.length;V++)L[V].handler.call(this,R);const G=this.eventListeners[A];if(G)for(var V=0;V<G.length;V++)G[V].handler.call(this,R)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(A){const R=A?A.pointerId:void 0,L=this.getStage(),V=this.getAbsolutePosition();if(!L)return;const G=L._getPointerById(R)||L._changedPointerPositions[0]||V;a.DD._dragElements.set(this._id,{node:this,startPointerPos:G,offset:{x:G.x-V.x,y:G.y-V.y},dragStatus:"ready",pointerId:R})}startDrag(A,R=!0){a.DD._dragElements.has(this._id)||this._createDragElement(A);const L=a.DD._dragElements.get(this._id);L.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:A&&A.evt},R)}_setDragPosition(A,R){const L=this.getStage()._getPointerById(R.pointerId);if(!L)return;let V={x:L.x-R.offset.x,y:L.y-R.offset.y};const G=this.dragBoundFunc();if(G!==void 0){const W=G.call(this,V,A);W?V=W:e.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==V.x||this._lastPos.y!==V.y)&&(this.setAbsolutePosition(V),this._requestDraw()),this._lastPos=V}stopDrag(A){const R=a.DD._dragElements.get(this._id);R&&(R.dragStatus="stopped"),a.DD._endDragBefore(A),a.DD._endDragAfter(A)}setDraggable(A){this._setAttr("draggable",A),this._dragChange()}isDragging(){const A=a.DD._dragElements.get(this._id);return A?A.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(A){if(!(!(A.evt.button!==void 0)||r.Konva.dragButtons.indexOf(A.evt.button)>=0)||this.isDragging())return;let V=!1;a.DD._dragElements.forEach(G=>{this.isAncestorOf(G.node)&&(V=!0)}),V||this._createDragElement(A)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const R=a.DD._dragElements.get(this._id),L=R&&R.dragStatus==="dragging",V=R&&R.dragStatus==="ready";L?this.stopDrag():V&&a.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(A={x:0,y:0}){const R=this.getStage();if(!R)return!1;const L={x:-A.x,y:-A.y,width:R.width()+2*A.x,height:R.height()+2*A.y};return e.Util.haveIntersection(L,this.getClientRect())}static create(A,R){return e.Util._isString(A)&&(A=JSON.parse(A)),this._createNode(A,R)}static _createNode(A,R){let L=k.prototype.getClassName.call(A),V=A.children,G,W,X;R&&(A.attrs.container=R),r.Konva[L]||(e.Util.warn('Can not find a node with class name "'+L+'". Fallback to "Shape".'),L="Shape");const q=r.Konva[L];if(G=new q(A.attrs),V)for(W=V.length,X=0;X<W;X++)G.add(k._createNode(V[X]));return G}}wf.Node=k,k.prototype.nodeType="Node",k.prototype._attrsAffectingSize=[],k.prototype.eventListeners={},k.prototype.on.call(k.prototype,I,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(P),this._clearSelfAndDescendantCache(m)}),k.prototype.on.call(k.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(T)}),k.prototype.on.call(k.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(S)}),k.prototype.on.call(k.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(s)});const O=n.Factory.addGetterSetter;return O(k,"zIndex"),O(k,"absolutePosition"),O(k,"position"),O(k,"x",0,(0,o.getNumberValidator)()),O(k,"y",0,(0,o.getNumberValidator)()),O(k,"globalCompositeOperation","source-over",(0,o.getStringValidator)()),O(k,"opacity",1,(0,o.getNumberValidator)()),O(k,"name","",(0,o.getStringValidator)()),O(k,"id","",(0,o.getStringValidator)()),O(k,"rotation",0,(0,o.getNumberValidator)()),n.Factory.addComponentsGetterSetter(k,"scale",["x","y"]),O(k,"scaleX",1,(0,o.getNumberValidator)()),O(k,"scaleY",1,(0,o.getNumberValidator)()),n.Factory.addComponentsGetterSetter(k,"skew",["x","y"]),O(k,"skewX",0,(0,o.getNumberValidator)()),O(k,"skewY",0,(0,o.getNumberValidator)()),n.Factory.addComponentsGetterSetter(k,"offset",["x","y"]),O(k,"offsetX",0,(0,o.getNumberValidator)()),O(k,"offsetY",0,(0,o.getNumberValidator)()),O(k,"dragDistance",void 0,(0,o.getNumberValidator)()),O(k,"width",0,(0,o.getNumberValidator)()),O(k,"height",0,(0,o.getNumberValidator)()),O(k,"listening",!0,(0,o.getBooleanValidator)()),O(k,"preventDefault",!0,(0,o.getBooleanValidator)()),O(k,"filters",void 0,function(N){return this._filterUpToDate=!1,N}),O(k,"visible",!0,(0,o.getBooleanValidator)()),O(k,"transformsEnabled","all",(0,o.getStringValidator)()),O(k,"size"),O(k,"dragBoundFunc"),O(k,"draggable",!1,(0,o.getBooleanValidator)()),n.Factory.backCompat(k,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"}),wf}var _f={},hy;function zp(){if(hy)return _f;hy=1,Object.defineProperty(_f,"__esModule",{value:!0}),_f.Container=void 0;const e=qt(),n=Hr(),t=Vt();let r=class extends n.Node{constructor(){super(...arguments),this.children=[]}getChildren(o){if(!o)return this.children||[];const s=this.children||[],c=[];return s.forEach(function(m){o(m)&&c.push(m)}),c}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(o=>{o.parent=null,o.index=0,o.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(o=>{o.parent=null,o.index=0,o.destroy()}),this.children=[],this._requestDraw(),this}add(...o){if(o.length===0)return this;if(o.length>1){for(let c=0;c<o.length;c++)this.add(o[c]);return this}const s=o[0];return s.getParent()?(s.moveTo(this),this):(this._validateAdd(s),s.index=this.getChildren().length,s.parent=this,s._clearCaches(),this.getChildren().push(s),this._fire("add",{child:s}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(o){return this._generalFind(o,!1)}findOne(o){const s=this._generalFind(o,!0);return s.length>0?s[0]:void 0}_generalFind(o,s){const c=[];return this._descendants(m=>{const f=m._isMatch(o);return f&&c.push(m),!!(f&&s)}),c}_descendants(o){let s=!1;const c=this.getChildren();for(const m of c){if(s=o(m),s)return!0;if(m.hasChildren()&&(s=m._descendants(o),s))return!0}return!1}toObject(){const o=n.Node.prototype.toObject.call(this);return o.children=[],this.getChildren().forEach(s=>{o.children.push(s.toObject())}),o}isAncestorOf(o){let s=o.getParent();for(;s;){if(s._id===this._id)return!0;s=s.getParent()}return!1}clone(o){const s=n.Node.prototype.clone.call(this,o);return this.getChildren().forEach(function(c){s.add(c.clone())}),s}getAllIntersections(o){const s=[];return this.find("Shape").forEach(c=>{c.isVisible()&&c.intersects(o)&&s.push(c)}),s}_clearSelfAndDescendantCache(o){var s;super._clearSelfAndDescendantCache(o),!this.isCached()&&((s=this.children)===null||s===void 0||s.forEach(function(c){c._clearSelfAndDescendantCache(o)}))}_setChildrenIndices(){var o;(o=this.children)===null||o===void 0||o.forEach(function(s,c){s.index=c}),this._requestDraw()}drawScene(o,s,c){const m=this.getLayer(),f=o||m&&m.getCanvas(),v=f&&f.getContext(),y=this._getCanvasCache(),E=y&&y.scene,w=f&&f.isCache;if(!this.isVisible()&&!w)return this;if(E){v.save();const S=this.getAbsoluteTransform(s).getMatrix();v.transform(S[0],S[1],S[2],S[3],S[4],S[5]),this._drawCachedSceneCanvas(v),v.restore()}else this._drawChildren("drawScene",f,s,c);return this}drawHit(o,s){if(!this.shouldDrawHit(s))return this;const c=this.getLayer(),m=o||c&&c.hitCanvas,f=m&&m.getContext(),v=this._getCanvasCache();if(v&&v.hit){f.save();const E=this.getAbsoluteTransform(s).getMatrix();f.transform(E[0],E[1],E[2],E[3],E[4],E[5]),this._drawCachedHitCanvas(f),f.restore()}else this._drawChildren("drawHit",m,s);return this}_drawChildren(o,s,c,m){var f;const v=s&&s.getContext(),y=this.clipWidth(),E=this.clipHeight(),w=this.clipFunc(),S=typeof y=="number"&&typeof E=="number"||w,x=c===this;if(S){v.save();const b=this.getAbsoluteTransform(c);let g=b.getMatrix();v.transform(g[0],g[1],g[2],g[3],g[4],g[5]),v.beginPath();let h;if(w)h=w.call(this,v,this);else{const d=this.clipX(),P=this.clipY();v.rect(d||0,P||0,y,E)}v.clip.apply(v,h),g=b.copy().invert().getMatrix(),v.transform(g[0],g[1],g[2],g[3],g[4],g[5])}const _=!x&&this.globalCompositeOperation()!=="source-over"&&o==="drawScene";_&&(v.save(),v._applyGlobalCompositeOperation(this)),(f=this.children)===null||f===void 0||f.forEach(function(b){b[o](s,c,m)}),_&&v.restore(),S&&v.restore()}getClientRect(o={}){var s;const c=o.skipTransform,m=o.relativeTo;let f,v,y,E,w={x:1/0,y:1/0,width:0,height:0};const S=this;(s=this.children)===null||s===void 0||s.forEach(function(b){if(!b.visible())return;const g=b.getClientRect({relativeTo:S,skipShadow:o.skipShadow,skipStroke:o.skipStroke});g.width===0&&g.height===0||(f===void 0?(f=g.x,v=g.y,y=g.x+g.width,E=g.y+g.height):(f=Math.min(f,g.x),v=Math.min(v,g.y),y=Math.max(y,g.x+g.width),E=Math.max(E,g.y+g.height)))});const x=this.find("Shape");let _=!1;for(let b=0;b<x.length;b++)if(x[b]._isVisible(this)){_=!0;break}return _&&f!==void 0?w={x:f,y:v,width:y-f,height:E-v}:w={x:0,y:0,width:0,height:0},c?w:this._transformedRect(w,m)}};return _f.Container=r,e.Factory.addComponentsGetterSetter(r,"clip",["x","y","width","height"]),e.Factory.addGetterSetter(r,"clipX",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(r,"clipY",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(r,"clipWidth",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(r,"clipHeight",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(r,"clipFunc"),_f}var $g={},Bl={},py;function bw(){if(py)return Bl;py=1,Object.defineProperty(Bl,"__esModule",{value:!0}),Bl.getCapturedShape=r,Bl.createEvent=a,Bl.hasPointerCapture=o,Bl.setPointerCapture=s,Bl.releaseCapture=c;const e=Dt(),n=new Map,t=e.Konva._global.PointerEvent!==void 0;function r(m){return n.get(m)}function a(m){return{evt:m,pointerId:m.pointerId}}function o(m,f){return n.get(m)===f}function s(m,f){c(m),f.getStage()&&(n.set(m,f),t&&f._fire("gotpointercapture",a(new PointerEvent("gotpointercapture"))))}function c(m,f){const v=n.get(m);if(!v)return;const y=v.getStage();y&&y.content,n.delete(m),t&&v._fire("lostpointercapture",a(new PointerEvent("lostpointercapture")))}return Bl}var gy;function f9(){return gy||(gy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const n=Lr(),t=qt(),r=zp(),a=Dt(),o=Fp(),s=Av(),c=Dt(),m=bw(),f="Stage",v="string",y="px",E="mouseout",w="mouseleave",S="mouseover",x="mouseenter",_="mousemove",b="mousedown",g="mouseup",h="pointermove",d="pointerdown",P="pointerup",M="pointercancel",T="lostpointercapture",I="pointerout",F="pointerleave",k="pointerover",O="pointerenter",N="contextmenu",A="touchstart",R="touchend",L="touchmove",V="touchcancel",G="wheel",W=5,X=[[x,"_pointerenter"],[b,"_pointerdown"],[_,"_pointermove"],[g,"_pointerup"],[w,"_pointerleave"],[A,"_pointerdown"],[L,"_pointermove"],[R,"_pointerup"],[V,"_pointercancel"],[S,"_pointerover"],[G,"_wheel"],[N,"_contextmenu"],[d,"_pointerdown"],[h,"_pointermove"],[P,"_pointerup"],[M,"_pointercancel"],[T,"_lostpointercapture"]],q={mouse:{[I]:E,[F]:w,[k]:S,[O]:x,[h]:_,[d]:b,[P]:g,[M]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[I]:"touchout",[F]:"touchleave",[k]:"touchover",[O]:"touchenter",[h]:L,[d]:A,[P]:R,[M]:V,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[I]:I,[F]:F,[k]:k,[O]:O,[h]:h,[d]:d,[P]:P,[M]:M,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},z=Q=>Q.indexOf("pointer")>=0?"pointer":Q.indexOf("touch")>=0?"touch":"mouse",Y=Q=>{const Z=z(Q);if(Z==="pointer")return a.Konva.pointerEventsEnabled&&q.pointer;if(Z==="touch")return q.touch;if(Z==="mouse")return q.mouse};function U(Q={}){return(Q.clipFunc||Q.clipWidth||Q.clipHeight)&&n.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),Q}const ee="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);";e.stages=[];class te extends r.Container{constructor(Z){super(U(Z)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),e.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{U(this.attrs)}),this._checkVisibility()}_validateAdd(Z){const re=Z.getType()==="Layer",ne=Z.getType()==="FastLayer";re||ne||n.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const Z=this.visible()?"":"none";this.content.style.display=Z}setContainer(Z){if(typeof Z===v){if(Z.charAt(0)==="."){const ne=Z.slice(1);Z=document.getElementsByClassName(ne)[0]}else{var re;Z.charAt(0)!=="#"?re=Z:re=Z.slice(1),Z=document.getElementById(re)}if(!Z)throw"Can not find container in document with id "+re}return this._setAttr("container",Z),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),Z.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const Z=this.children,re=Z.length;for(let ne=0;ne<re;ne++)Z[ne].clear();return this}clone(Z){return Z||(Z={}),Z.container=typeof document<"u"&&document.createElement("div"),r.Container.prototype.clone.call(this,Z)}destroy(){super.destroy();const Z=this.content;Z&&n.Util._isInDocument(Z)&&this.container().removeChild(Z);const re=e.stages.indexOf(this);return re>-1&&e.stages.splice(re,1),n.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const Z=this._pointerPositions[0]||this._changedPointerPositions[0];return Z?{x:Z.x,y:Z.y}:(n.Util.warn(ee),null)}_getPointerById(Z){return this._pointerPositions.find(re=>re.id===Z)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(Z){Z=Z||{},Z.x=Z.x||0,Z.y=Z.y||0,Z.width=Z.width||this.width(),Z.height=Z.height||this.height();const re=new o.SceneCanvas({width:Z.width,height:Z.height,pixelRatio:Z.pixelRatio||1}),ne=re.getContext()._context,ae=this.children;return(Z.x||Z.y)&&ne.translate(-1*Z.x,-1*Z.y),ae.forEach(function(ue){if(!ue.isVisible())return;const fe=ue._toKonvaCanvas(Z);ne.drawImage(fe._canvas,Z.x,Z.y,fe.getWidth()/fe.getPixelRatio(),fe.getHeight()/fe.getPixelRatio())}),re}getIntersection(Z){if(!Z)return null;const re=this.children,ne=re.length,ae=ne-1;for(let ue=ae;ue>=0;ue--){const fe=re[ue].getIntersection(Z);if(fe)return fe}return null}_resizeDOM(){const Z=this.width(),re=this.height();this.content&&(this.content.style.width=Z+y,this.content.style.height=re+y),this.bufferCanvas.setSize(Z,re),this.bufferHitCanvas.setSize(Z,re),this.children.forEach(ne=>{ne.setSize({width:Z,height:re}),ne.draw()})}add(Z,...re){if(arguments.length>1){for(let ae=0;ae<arguments.length;ae++)this.add(arguments[ae]);return this}super.add(Z);const ne=this.children.length;return ne>W&&n.Util.warn("The stage has "+ne+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),Z.setSize({width:this.width(),height:this.height()}),Z.draw(),a.Konva.isBrowser&&this.content.appendChild(Z.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(Z){return m.hasPointerCapture(Z,this)}setPointerCapture(Z){m.setPointerCapture(Z,this)}releaseCapture(Z){m.releaseCapture(Z,this)}getLayers(){return this.children}_bindContentEvents(){a.Konva.isBrowser&&X.forEach(([Z,re])=>{this.content.addEventListener(Z,ne=>{this[re](ne)},{passive:!1})})}_pointerenter(Z){this.setPointersPositions(Z);const re=Y(Z.type);re&&this._fire(re.pointerenter,{evt:Z,target:this,currentTarget:this})}_pointerover(Z){this.setPointersPositions(Z);const re=Y(Z.type);re&&this._fire(re.pointerover,{evt:Z,target:this,currentTarget:this})}_getTargetShape(Z){let re=this[Z+"targetShape"];return re&&!re.getStage()&&(re=null),re}_pointerleave(Z){const re=Y(Z.type),ne=z(Z.type);if(!re)return;this.setPointersPositions(Z);const ae=this._getTargetShape(ne),ue=!(a.Konva.isDragging()||a.Konva.isTransforming())||a.Konva.hitOnDragEnabled;ae&&ue?(ae._fireAndBubble(re.pointerout,{evt:Z}),ae._fireAndBubble(re.pointerleave,{evt:Z}),this._fire(re.pointerleave,{evt:Z,target:this,currentTarget:this}),this[ne+"targetShape"]=null):ue&&(this._fire(re.pointerleave,{evt:Z,target:this,currentTarget:this}),this._fire(re.pointerout,{evt:Z,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(Z){const re=Y(Z.type),ne=z(Z.type);if(!re)return;this.setPointersPositions(Z);let ae=!1;this._changedPointerPositions.forEach(ue=>{const fe=this.getIntersection(ue);if(s.DD.justDragged=!1,a.Konva["_"+ne+"ListenClick"]=!0,!fe||!fe.isListening()){this[ne+"ClickStartShape"]=void 0;return}a.Konva.capturePointerEventsEnabled&&fe.setPointerCapture(ue.id),this[ne+"ClickStartShape"]=fe,fe._fireAndBubble(re.pointerdown,{evt:Z,pointerId:ue.id}),ae=!0;const pe=Z.type.indexOf("touch")>=0;fe.preventDefault()&&Z.cancelable&&pe&&Z.preventDefault()}),ae||this._fire(re.pointerdown,{evt:Z,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(Z){const re=Y(Z.type),ne=z(Z.type);if(!re||(a.Konva.isDragging()&&s.DD.node.preventDefault()&&Z.cancelable&&Z.preventDefault(),this.setPointersPositions(Z),!(!(a.Konva.isDragging()||a.Konva.isTransforming())||a.Konva.hitOnDragEnabled)))return;const ue={};let fe=!1;const pe=this._getTargetShape(ne);this._changedPointerPositions.forEach(ye=>{const we=m.getCapturedShape(ye.id)||this.getIntersection(ye),je=ye.id,Te={evt:Z,pointerId:je},se=pe!==we;if(se&&pe&&(pe._fireAndBubble(re.pointerout,{...Te},we),pe._fireAndBubble(re.pointerleave,{...Te},we)),we){if(ue[we._id])return;ue[we._id]=!0}we&&we.isListening()?(fe=!0,se&&(we._fireAndBubble(re.pointerover,{...Te},pe),we._fireAndBubble(re.pointerenter,{...Te},pe),this[ne+"targetShape"]=we),we._fireAndBubble(re.pointermove,{...Te})):pe&&(this._fire(re.pointerover,{evt:Z,target:this,currentTarget:this,pointerId:je}),this[ne+"targetShape"]=null)}),fe||this._fire(re.pointermove,{evt:Z,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(Z){const re=Y(Z.type),ne=z(Z.type);if(!re)return;this.setPointersPositions(Z);const ae=this[ne+"ClickStartShape"],ue=this[ne+"ClickEndShape"],fe={};let pe=!1;this._changedPointerPositions.forEach(ye=>{const we=m.getCapturedShape(ye.id)||this.getIntersection(ye);if(we){if(we.releaseCapture(ye.id),fe[we._id])return;fe[we._id]=!0}const je=ye.id,Te={evt:Z,pointerId:je};let se=!1;a.Konva["_"+ne+"InDblClickWindow"]?(se=!0,clearTimeout(this[ne+"DblTimeout"])):s.DD.justDragged||(a.Konva["_"+ne+"InDblClickWindow"]=!0,clearTimeout(this[ne+"DblTimeout"])),this[ne+"DblTimeout"]=setTimeout(function(){a.Konva["_"+ne+"InDblClickWindow"]=!1},a.Konva.dblClickWindow),we&&we.isListening()?(pe=!0,this[ne+"ClickEndShape"]=we,we._fireAndBubble(re.pointerup,{...Te}),a.Konva["_"+ne+"ListenClick"]&&ae&&ae===we&&(we._fireAndBubble(re.pointerclick,{...Te}),se&&ue&&ue===we&&we._fireAndBubble(re.pointerdblclick,{...Te}))):(this[ne+"ClickEndShape"]=null,a.Konva["_"+ne+"ListenClick"]&&this._fire(re.pointerclick,{evt:Z,target:this,currentTarget:this,pointerId:je}),se&&this._fire(re.pointerdblclick,{evt:Z,target:this,currentTarget:this,pointerId:je}))}),pe||this._fire(re.pointerup,{evt:Z,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),a.Konva["_"+ne+"ListenClick"]=!1,Z.cancelable&&ne!=="touch"&&ne!=="pointer"&&Z.preventDefault()}_contextmenu(Z){this.setPointersPositions(Z);const re=this.getIntersection(this.getPointerPosition());re&&re.isListening()?re._fireAndBubble(N,{evt:Z}):this._fire(N,{evt:Z,target:this,currentTarget:this})}_wheel(Z){this.setPointersPositions(Z);const re=this.getIntersection(this.getPointerPosition());re&&re.isListening()?re._fireAndBubble(G,{evt:Z}):this._fire(G,{evt:Z,target:this,currentTarget:this})}_pointercancel(Z){this.setPointersPositions(Z);const re=m.getCapturedShape(Z.pointerId)||this.getIntersection(this.getPointerPosition());re&&re._fireAndBubble(P,m.createEvent(Z)),m.releaseCapture(Z.pointerId)}_lostpointercapture(Z){m.releaseCapture(Z.pointerId)}setPointersPositions(Z){const re=this._getContentPosition();let ne=null,ae=null;Z=Z||window.event,Z.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(Z.touches,ue=>{this._pointerPositions.push({id:ue.identifier,x:(ue.clientX-re.left)/re.scaleX,y:(ue.clientY-re.top)/re.scaleY})}),Array.prototype.forEach.call(Z.changedTouches||Z.touches,ue=>{this._changedPointerPositions.push({id:ue.identifier,x:(ue.clientX-re.left)/re.scaleX,y:(ue.clientY-re.top)/re.scaleY})})):(ne=(Z.clientX-re.left)/re.scaleX,ae=(Z.clientY-re.top)/re.scaleY,this.pointerPos={x:ne,y:ae},this._pointerPositions=[{x:ne,y:ae,id:n.Util._getFirstPointerId(Z)}],this._changedPointerPositions=[{x:ne,y:ae,id:n.Util._getFirstPointerId(Z)}])}_setPointerPosition(Z){n.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(Z)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const Z=this.content.getBoundingClientRect();return{top:Z.top,left:Z.left,scaleX:Z.width/this.content.clientWidth||1,scaleY:Z.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new o.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new o.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!a.Konva.isBrowser)return;const Z=this.container();if(!Z)throw"Stage has no container. A container is required.";Z.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),Z.appendChild(this.content),this._resizeDOM()}cache(){return n.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(Z){Z.batchDraw()}),this}}e.Stage=te,te.prototype.nodeType=f,(0,c._registerNode)(te),t.Factory.addGetterSetter(te,"container"),a.Konva.isBrowser&&document.addEventListener("visibilitychange",()=>{e.stages.forEach(Q=>{Q.batchDraw()})})}($g)),$g}var Sf={},Wg={},vy;function bn(){return vy||(vy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const n=Dt(),t=Lr(),r=qt(),a=Hr(),o=Vt(),s=Dt(),c=bw(),m="hasShadow",f="shadowRGBA",v="patternImage",y="linearGradient",E="radialGradient";let w;function S(){return w||(w=t.Util.createCanvasElement().getContext("2d"),w)}e.shapes={};function x(F){const k=this.attrs.fillRule;k?F.fill(k):F.fill()}function _(F){F.stroke()}function b(F){const k=this.attrs.fillRule;k?F.fill(k):F.fill()}function g(F){F.stroke()}function h(){this._clearCache(m)}function d(){this._clearCache(f)}function P(){this._clearCache(v)}function M(){this._clearCache(y)}function T(){this._clearCache(E)}class I extends a.Node{constructor(k){super(k);let O;for(;O=t.Util.getRandomColor(),!(O&&!(O in e.shapes)););this.colorKey=O,e.shapes[O]=this}getContext(){return t.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return t.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(m,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(v,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const O=S().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(O&&O.setTransform){const N=new t.Transform;N.translate(this.fillPatternX(),this.fillPatternY()),N.rotate(n.Konva.getAngle(this.fillPatternRotation())),N.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),N.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const A=N.getMatrix(),R=typeof DOMMatrix>"u"?{a:A[0],b:A[1],c:A[2],d:A[3],e:A[4],f:A[5]}:new DOMMatrix(A);O.setTransform(R)}return O}}_getLinearGradient(){return this._getCache(y,this.__getLinearGradient)}__getLinearGradient(){const k=this.fillLinearGradientColorStops();if(k){const O=S(),N=this.fillLinearGradientStartPoint(),A=this.fillLinearGradientEndPoint(),R=O.createLinearGradient(N.x,N.y,A.x,A.y);for(let L=0;L<k.length;L+=2)R.addColorStop(k[L],k[L+1]);return R}}_getRadialGradient(){return this._getCache(E,this.__getRadialGradient)}__getRadialGradient(){const k=this.fillRadialGradientColorStops();if(k){const O=S(),N=this.fillRadialGradientStartPoint(),A=this.fillRadialGradientEndPoint(),R=O.createRadialGradient(N.x,N.y,this.fillRadialGradientStartRadius(),A.x,A.y,this.fillRadialGradientEndRadius());for(let L=0;L<k.length;L+=2)R.addColorStop(k[L],k[L+1]);return R}}getShadowRGBA(){return this._getCache(f,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const k=t.Util.colorToRGBA(this.shadowColor());if(k)return"rgba("+k.r+","+k.g+","+k.b+","+k.a*(this.shadowOpacity()||1)+")"}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const k=this.hitStrokeWidth();return k==="auto"?this.hasStroke():this.strokeEnabled()&&!!k}intersects(k){const O=this.getStage();if(!O)return!1;const N=O.bufferHitCanvas;return N.getContext().clear(),this.drawHit(N,void 0,!0),N.context.getImageData(Math.round(k.x),Math.round(k.y),1,1).data[3]>0}destroy(){return a.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(k){var O;if(!((O=this.attrs.perfectDrawEnabled)!==null&&O!==void 0?O:!0))return!1;const A=k||this.hasFill(),R=this.hasStroke(),L=this.getAbsoluteOpacity()!==1;if(A&&R&&L)return!0;const V=this.hasShadow(),G=this.shadowForStrokeEnabled();return!!(A&&R&&V&&G)}setStrokeHitEnabled(k){t.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),k?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const k=this.size();return{x:this._centroid?-k.width/2:0,y:this._centroid?-k.height/2:0,width:k.width,height:k.height}}getClientRect(k={}){let O=!1,N=this.getParent();for(;N;){if(N.isCached()){O=!0;break}N=N.getParent()}const A=k.skipTransform,R=k.relativeTo||O&&this.getStage()||void 0,L=this.getSelfRect(),G=!k.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,W=L.width+G,X=L.height+G,q=!k.skipShadow&&this.hasShadow(),z=q?this.shadowOffsetX():0,Y=q?this.shadowOffsetY():0,U=W+Math.abs(z),ee=X+Math.abs(Y),te=q&&this.shadowBlur()||0,Q=U+te*2,Z=ee+te*2,re={width:Q,height:Z,x:-(G/2+te)+Math.min(z,0)+L.x,y:-(G/2+te)+Math.min(Y,0)+L.y};return A?re:this._transformedRect(re,R)}drawScene(k,O,N){const A=this.getLayer();let R=k||A.getCanvas(),L=R.getContext(),V=this._getCanvasCache(),G=this.getSceneFunc(),W=this.hasShadow(),X,q;const z=R.isCache,Y=O===this;if(!this.isVisible()&&!Y)return this;if(V){L.save();const ee=this.getAbsoluteTransform(O).getMatrix();return L.transform(ee[0],ee[1],ee[2],ee[3],ee[4],ee[5]),this._drawCachedSceneCanvas(L),L.restore(),this}if(!G)return this;if(L.save(),this._useBufferCanvas()&&!z){X=this.getStage();const ee=N||X.bufferCanvas;q=ee.getContext(),q.clear(),q.save(),q._applyLineJoin(this);var U=this.getAbsoluteTransform(O).getMatrix();q.transform(U[0],U[1],U[2],U[3],U[4],U[5]),G.call(this,q,this),q.restore();const te=ee.pixelRatio;W&&L._applyShadow(this),L._applyOpacity(this),L._applyGlobalCompositeOperation(this),L.drawImage(ee._canvas,0,0,ee.width/te,ee.height/te)}else{if(L._applyLineJoin(this),!Y){var U=this.getAbsoluteTransform(O).getMatrix();L.transform(U[0],U[1],U[2],U[3],U[4],U[5]),L._applyOpacity(this),L._applyGlobalCompositeOperation(this)}W&&L._applyShadow(this),G.call(this,L,this)}return L.restore(),this}drawHit(k,O,N=!1){if(!this.shouldDrawHit(O,N))return this;const A=this.getLayer(),R=k||A.hitCanvas,L=R&&R.getContext(),V=this.hitFunc()||this.sceneFunc(),G=this._getCanvasCache(),W=G&&G.hit;if(this.colorKey||t.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),W){L.save();const q=this.getAbsoluteTransform(O).getMatrix();return L.transform(q[0],q[1],q[2],q[3],q[4],q[5]),this._drawCachedHitCanvas(L),L.restore(),this}if(!V)return this;if(L.save(),L._applyLineJoin(this),!(this===O)){const q=this.getAbsoluteTransform(O).getMatrix();L.transform(q[0],q[1],q[2],q[3],q[4],q[5])}return V.call(this,L,this),L.restore(),this}drawHitFromCache(k=0){const O=this._getCanvasCache(),N=this._getCachedSceneCanvas(),A=O.hit,R=A.getContext(),L=A.getWidth(),V=A.getHeight();R.clear(),R.drawImage(N._canvas,0,0,L,V);try{const G=R.getImageData(0,0,L,V),W=G.data,X=W.length,q=t.Util._hexToRgb(this.colorKey);for(let z=0;z<X;z+=4)W[z+3]>k?(W[z]=q.r,W[z+1]=q.g,W[z+2]=q.b,W[z+3]=255):W[z+3]=0;R.putImageData(G,0,0)}catch(G){t.Util.error("Unable to draw hit graph from cached scene canvas. "+G.message)}return this}hasPointerCapture(k){return c.hasPointerCapture(k,this)}setPointerCapture(k){c.setPointerCapture(k,this)}releaseCapture(k){c.releaseCapture(k,this)}}e.Shape=I,I.prototype._fillFunc=x,I.prototype._strokeFunc=_,I.prototype._fillFuncHit=b,I.prototype._strokeFuncHit=g,I.prototype._centroid=!1,I.prototype.nodeType="Shape",(0,s._registerNode)(I),I.prototype.eventListeners={},I.prototype.on.call(I.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",h),I.prototype.on.call(I.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",d),I.prototype.on.call(I.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",P),I.prototype.on.call(I.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",M),I.prototype.on.call(I.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",T),r.Factory.addGetterSetter(I,"stroke",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(I,"strokeWidth",2,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillAfterStrokeEnabled",!1),r.Factory.addGetterSetter(I,"hitStrokeWidth","auto",(0,o.getNumberOrAutoValidator)()),r.Factory.addGetterSetter(I,"strokeHitEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(I,"perfectDrawEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(I,"shadowForStrokeEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(I,"lineJoin"),r.Factory.addGetterSetter(I,"lineCap"),r.Factory.addGetterSetter(I,"sceneFunc"),r.Factory.addGetterSetter(I,"hitFunc"),r.Factory.addGetterSetter(I,"dash"),r.Factory.addGetterSetter(I,"dashOffset",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"shadowColor",void 0,(0,o.getStringValidator)()),r.Factory.addGetterSetter(I,"shadowBlur",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"shadowOpacity",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(I,"shadowOffset",["x","y"]),r.Factory.addGetterSetter(I,"shadowOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"shadowOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillPatternImage"),r.Factory.addGetterSetter(I,"fill",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(I,"fillPatternX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillPatternY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillLinearGradientColorStops"),r.Factory.addGetterSetter(I,"strokeLinearGradientColorStops"),r.Factory.addGetterSetter(I,"fillRadialGradientStartRadius",0),r.Factory.addGetterSetter(I,"fillRadialGradientEndRadius",0),r.Factory.addGetterSetter(I,"fillRadialGradientColorStops"),r.Factory.addGetterSetter(I,"fillPatternRepeat","repeat"),r.Factory.addGetterSetter(I,"fillEnabled",!0),r.Factory.addGetterSetter(I,"strokeEnabled",!0),r.Factory.addGetterSetter(I,"shadowEnabled",!0),r.Factory.addGetterSetter(I,"dashEnabled",!0),r.Factory.addGetterSetter(I,"strokeScaleEnabled",!0),r.Factory.addGetterSetter(I,"fillPriority","color"),r.Factory.addComponentsGetterSetter(I,"fillPatternOffset",["x","y"]),r.Factory.addGetterSetter(I,"fillPatternOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillPatternOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(I,"fillPatternScale",["x","y"]),r.Factory.addGetterSetter(I,"fillPatternScaleX",1,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillPatternScaleY",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(I,"fillLinearGradientStartPoint",["x","y"]),r.Factory.addComponentsGetterSetter(I,"strokeLinearGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(I,"fillLinearGradientStartPointX",0),r.Factory.addGetterSetter(I,"strokeLinearGradientStartPointX",0),r.Factory.addGetterSetter(I,"fillLinearGradientStartPointY",0),r.Factory.addGetterSetter(I,"strokeLinearGradientStartPointY",0),r.Factory.addComponentsGetterSetter(I,"fillLinearGradientEndPoint",["x","y"]),r.Factory.addComponentsGetterSetter(I,"strokeLinearGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(I,"fillLinearGradientEndPointX",0),r.Factory.addGetterSetter(I,"strokeLinearGradientEndPointX",0),r.Factory.addGetterSetter(I,"fillLinearGradientEndPointY",0),r.Factory.addGetterSetter(I,"strokeLinearGradientEndPointY",0),r.Factory.addComponentsGetterSetter(I,"fillRadialGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(I,"fillRadialGradientStartPointX",0),r.Factory.addGetterSetter(I,"fillRadialGradientStartPointY",0),r.Factory.addComponentsGetterSetter(I,"fillRadialGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(I,"fillRadialGradientEndPointX",0),r.Factory.addGetterSetter(I,"fillRadialGradientEndPointY",0),r.Factory.addGetterSetter(I,"fillPatternRotation",0),r.Factory.addGetterSetter(I,"fillRule",void 0,(0,o.getStringValidator)()),r.Factory.backCompat(I,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})}(Wg)),Wg}var my;function ww(){if(my)return Sf;my=1,Object.defineProperty(Sf,"__esModule",{value:!0}),Sf.Layer=void 0;const e=Lr(),n=zp(),t=Hr(),r=qt(),a=Fp(),o=Vt(),s=bn(),c=Dt(),m="#",f="beforeDraw",v="draw",y=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],E=y.length;class w extends n.Container{constructor(x){super(x),this.canvas=new a.SceneCanvas,this.hitCanvas=new a.HitCanvas({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(x){return this.getContext().clear(x),this.getHitCanvas().getContext().clear(x),this}setZIndex(x){super.setZIndex(x);const _=this.getStage();return _&&_.content&&(_.content.removeChild(this.getNativeCanvasElement()),x<_.children.length-1?_.content.insertBefore(this.getNativeCanvasElement(),_.children[x+1].getCanvas()._canvas):_.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){t.Node.prototype.moveToTop.call(this);const x=this.getStage();return x&&x.content&&(x.content.removeChild(this.getNativeCanvasElement()),x.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!t.Node.prototype.moveUp.call(this))return!1;const _=this.getStage();return!_||!_.content?!1:(_.content.removeChild(this.getNativeCanvasElement()),this.index<_.children.length-1?_.content.insertBefore(this.getNativeCanvasElement(),_.children[this.index+1].getCanvas()._canvas):_.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(t.Node.prototype.moveDown.call(this)){const x=this.getStage();if(x){const _=x.children;x.content&&(x.content.removeChild(this.getNativeCanvasElement()),x.content.insertBefore(this.getNativeCanvasElement(),_[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(t.Node.prototype.moveToBottom.call(this)){const x=this.getStage();if(x){const _=x.children;x.content&&(x.content.removeChild(this.getNativeCanvasElement()),x.content.insertBefore(this.getNativeCanvasElement(),_[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const x=this.getNativeCanvasElement();return t.Node.prototype.remove.call(this),x&&x.parentNode&&e.Util._isInDocument(x)&&x.parentNode.removeChild(x),this}getStage(){return this.parent}setSize({width:x,height:_}){return this.canvas.setSize(x,_),this.hitCanvas.setSize(x,_),this._setSmoothEnabled(),this}_validateAdd(x){const _=x.getType();_!=="Group"&&_!=="Shape"&&e.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(x){return x=x||{},x.width=x.width||this.getWidth(),x.height=x.height||this.getHeight(),x.x=x.x!==void 0?x.x:this.x(),x.y=x.y!==void 0?x.y:this.y(),t.Node.prototype._toKonvaCanvas.call(this,x)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){e.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){e.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,e.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(x){if(!this.isListening()||!this.isVisible())return null;let _=1,b=!1;for(;;){for(let g=0;g<E;g++){const h=y[g],d=this._getIntersection({x:x.x+h.x*_,y:x.y+h.y*_}),P=d.shape;if(P)return P;if(b=!!d.antialiased,!d.antialiased)break}if(b)_+=1;else return null}}_getIntersection(x){const _=this.hitCanvas.pixelRatio,b=this.hitCanvas.context.getImageData(Math.round(x.x*_),Math.round(x.y*_),1,1).data,g=b[3];if(g===255){const h=e.Util._rgbToHex(b[0],b[1],b[2]),d=s.shapes[m+h];return d?{shape:d}:{antialiased:!0}}else if(g>0)return{antialiased:!0};return{}}drawScene(x,_){const b=this.getLayer(),g=x||b&&b.getCanvas();return this._fire(f,{node:this}),this.clearBeforeDraw()&&g.getContext().clear(),n.Container.prototype.drawScene.call(this,g,_),this._fire(v,{node:this}),this}drawHit(x,_){const b=this.getLayer(),g=x||b&&b.hitCanvas;return b&&b.clearBeforeDraw()&&b.getHitCanvas().getContext().clear(),n.Container.prototype.drawHit.call(this,g,_),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(x){e.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(x)}getHitGraphEnabled(x){return e.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const x=this.parent;!!this.hitCanvas._canvas.parentNode?x.content.removeChild(this.hitCanvas._canvas):x.content.appendChild(this.hitCanvas._canvas)}destroy(){return e.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}return Sf.Layer=w,w.prototype.nodeType="Layer",(0,c._registerNode)(w),r.Factory.addGetterSetter(w,"imageSmoothingEnabled",!0),r.Factory.addGetterSetter(w,"clearBeforeDraw",!0),r.Factory.addGetterSetter(w,"hitGraphEnabled",!0,(0,o.getBooleanValidator)()),Sf}var Ef={},yy;function d9(){if(yy)return Ef;yy=1,Object.defineProperty(Ef,"__esModule",{value:!0}),Ef.FastLayer=void 0;const e=Lr(),n=ww(),t=Dt();class r extends n.Layer{constructor(o){super(o),this.listening(!1),e.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}return Ef.FastLayer=r,r.prototype.nodeType="FastLayer",(0,t._registerNode)(r),Ef}var xf={},by;function Tv(){if(by)return xf;by=1,Object.defineProperty(xf,"__esModule",{value:!0}),xf.Group=void 0;const e=Lr(),n=zp(),t=Dt();class r extends n.Container{_validateAdd(o){const s=o.getType();s!=="Group"&&s!=="Shape"&&e.Util.throw("You may only add groups and shapes to groups.")}}return xf.Group=r,r.prototype.nodeType="Group",(0,t._registerNode)(r),xf}var Of={},wy;function Rv(){if(wy)return Of;wy=1,Object.defineProperty(Of,"__esModule",{value:!0}),Of.Animation=void 0;const e=Dt(),n=Lr(),t=function(){return e.glob.performance&&e.glob.performance.now?function(){return e.glob.performance.now()}:function(){return new Date().getTime()}}();let r=class tc{constructor(o,s){this.id=tc.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:t(),frameRate:0},this.func=o,this.setLayers(s)}setLayers(o){let s=[];return o&&(s=Array.isArray(o)?o:[o]),this.layers=s,this}getLayers(){return this.layers}addLayer(o){const s=this.layers,c=s.length;for(let m=0;m<c;m++)if(s[m]._id===o._id)return!1;return this.layers.push(o),!0}isRunning(){const s=tc.animations,c=s.length;for(let m=0;m<c;m++)if(s[m].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=t(),tc._addAnimation(this),this}stop(){return tc._removeAnimation(this),this}_updateFrameObject(o){this.frame.timeDiff=o-this.frame.lastTime,this.frame.lastTime=o,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(o){this.animations.push(o),this._handleAnimation()}static _removeAnimation(o){const s=o.id,c=this.animations,m=c.length;for(let f=0;f<m;f++)if(c[f].id===s){this.animations.splice(f,1);break}}static _runFrames(){const o={},s=this.animations;for(let c=0;c<s.length;c++){const m=s[c],f=m.layers,v=m.func;m._updateFrameObject(t());const y=f.length;let E;if(v?E=v.call(m,m.frame)!==!1:E=!0,!!E)for(let w=0;w<y;w++){const S=f[w];S._id!==void 0&&(o[S._id]=S)}}for(const c in o)o.hasOwnProperty(c)&&o[c].batchDraw()}static _animationLoop(){const o=tc;o.animations.length?(o._runFrames(),n.Util.requestAnimFrame(o._animationLoop)):o.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,n.Util.requestAnimFrame(this._animationLoop))}};return Of.Animation=r,r.animations=[],r.animIdCounter=0,r.animRunning=!1,Of}var Yg={},_y;function h9(){return _y||(_y=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const n=Lr(),t=Rv(),r=Hr(),a=Dt(),o={node:1,duration:1,easing:1,onFinish:1,yoyo:1},s=1,c=2,m=3,f=["fill","stroke","shadowColor"];let v=0;class y{constructor(S,x,_,b,g,h,d){this.prop=S,this.propFunc=x,this.begin=b,this._pos=b,this.duration=h,this._change=0,this.prevPos=0,this.yoyo=d,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=_,this._change=g-this.begin,this.pause()}fire(S){const x=this[S];x&&x()}setTime(S){S>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():S<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=S,this.update())}getTime(){return this._time}setPosition(S){this.prevPos=this._pos,this.propFunc(S),this._pos=S}getPosition(S){return S===void 0&&(S=this._time),this.func(S,this.begin,this._change,this.duration)}play(){this.state=c,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=m,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(S){this.pause(),this._time=S,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){const S=this.getTimer()-this._startTime;this.state===c?this.setTime(S):this.state===m&&this.setTime(this.duration-S)}pause(){this.state=s,this.fire("onPause")}getTimer(){return new Date().getTime()}}class E{constructor(S){const x=this,_=S.node,b=_._id,g=S.easing||e.Easings.Linear,h=!!S.yoyo;let d,P;typeof S.duration>"u"?d=.3:S.duration===0?d=.001:d=S.duration,this.node=_,this._id=v++;const M=_.getLayer()||(_ instanceof a.Konva.Stage?_.getLayers():null);M||n.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new t.Animation(function(){x.tween.onEnterFrame()},M),this.tween=new y(P,function(T){x._tweenFunc(T)},g,0,1,d*1e3,h),this._addListeners(),E.attrs[b]||(E.attrs[b]={}),E.attrs[b][this._id]||(E.attrs[b][this._id]={}),E.tweens[b]||(E.tweens[b]={});for(P in S)o[P]===void 0&&this._addAttr(P,S[P]);this.reset(),this.onFinish=S.onFinish,this.onReset=S.onReset,this.onUpdate=S.onUpdate}_addAttr(S,x){const _=this.node,b=_._id;let g,h,d,P,M;const T=E.tweens[b][S];T&&delete E.attrs[b][T][S];let I=_.getAttr(S);if(n.Util._isArray(x))if(g=[],h=Math.max(x.length,I.length),S==="points"&&x.length!==I.length&&(x.length>I.length?(P=I,I=n.Util._prepareArrayForTween(I,x,_.closed())):(d=x,x=n.Util._prepareArrayForTween(x,I,_.closed()))),S.indexOf("fill")===0)for(let F=0;F<h;F++)if(F%2===0)g.push(x[F]-I[F]);else{const k=n.Util.colorToRGBA(I[F]);M=n.Util.colorToRGBA(x[F]),I[F]=k,g.push({r:M.r-k.r,g:M.g-k.g,b:M.b-k.b,a:M.a-k.a})}else for(let F=0;F<h;F++)g.push(x[F]-I[F]);else f.indexOf(S)!==-1?(I=n.Util.colorToRGBA(I),M=n.Util.colorToRGBA(x),g={r:M.r-I.r,g:M.g-I.g,b:M.b-I.b,a:M.a-I.a}):g=x-I;E.attrs[b][this._id][S]={start:I,diff:g,end:x,trueEnd:d,trueStart:P},E.tweens[b][S]=this._id}_tweenFunc(S){const x=this.node,_=E.attrs[x._id][this._id];let b,g,h,d,P,M,T,I;for(b in _){if(g=_[b],h=g.start,d=g.diff,I=g.end,n.Util._isArray(h))if(P=[],T=Math.max(h.length,I.length),b.indexOf("fill")===0)for(M=0;M<T;M++)M%2===0?P.push((h[M]||0)+d[M]*S):P.push("rgba("+Math.round(h[M].r+d[M].r*S)+","+Math.round(h[M].g+d[M].g*S)+","+Math.round(h[M].b+d[M].b*S)+","+(h[M].a+d[M].a*S)+")");else for(M=0;M<T;M++)P.push((h[M]||0)+d[M]*S);else f.indexOf(b)!==-1?P="rgba("+Math.round(h.r+d.r*S)+","+Math.round(h.g+d.g*S)+","+Math.round(h.b+d.b*S)+","+(h.a+d.a*S)+")":P=h+d*S;x.setAttr(b,P)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const S=this.node,x=E.attrs[S._id][this._id];x.points&&x.points.trueEnd&&S.setAttr("points",x.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const S=this.node,x=E.attrs[S._id][this._id];x.points&&x.points.trueStart&&S.points(x.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(S){return this.tween.seek(S*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const S=this.node._id,x=this._id,_=E.tweens[S];this.pause();for(const b in _)delete E.tweens[S][b];delete E.attrs[S][x]}}e.Tween=E,E.attrs={},E.tweens={},r.Node.prototype.to=function(w){const S=w.onFinish;w.node=this,w.onFinish=function(){this.destroy(),S&&S()},new E(w).play()},e.Easings={BackEaseIn(w,S,x,_){return x*(w/=_)*w*((1.70158+1)*w-1.70158)+S},BackEaseOut(w,S,x,_){return x*((w=w/_-1)*w*((1.70158+1)*w+1.70158)+1)+S},BackEaseInOut(w,S,x,_){let b=1.70158;return(w/=_/2)<1?x/2*(w*w*(((b*=1.525)+1)*w-b))+S:x/2*((w-=2)*w*(((b*=1.525)+1)*w+b)+2)+S},ElasticEaseIn(w,S,x,_,b,g){let h=0;return w===0?S:(w/=_)===1?S+x:(g||(g=_*.3),!b||b<Math.abs(x)?(b=x,h=g/4):h=g/(2*Math.PI)*Math.asin(x/b),-(b*Math.pow(2,10*(w-=1))*Math.sin((w*_-h)*(2*Math.PI)/g))+S)},ElasticEaseOut(w,S,x,_,b,g){let h=0;return w===0?S:(w/=_)===1?S+x:(g||(g=_*.3),!b||b<Math.abs(x)?(b=x,h=g/4):h=g/(2*Math.PI)*Math.asin(x/b),b*Math.pow(2,-10*w)*Math.sin((w*_-h)*(2*Math.PI)/g)+x+S)},ElasticEaseInOut(w,S,x,_,b,g){let h=0;return w===0?S:(w/=_/2)===2?S+x:(g||(g=_*(.3*1.5)),!b||b<Math.abs(x)?(b=x,h=g/4):h=g/(2*Math.PI)*Math.asin(x/b),w<1?-.5*(b*Math.pow(2,10*(w-=1))*Math.sin((w*_-h)*(2*Math.PI)/g))+S:b*Math.pow(2,-10*(w-=1))*Math.sin((w*_-h)*(2*Math.PI)/g)*.5+x+S)},BounceEaseOut(w,S,x,_){return(w/=_)<1/2.75?x*(7.5625*w*w)+S:w<2/2.75?x*(7.5625*(w-=1.5/2.75)*w+.75)+S:w<2.5/2.75?x*(7.5625*(w-=2.25/2.75)*w+.9375)+S:x*(7.5625*(w-=2.625/2.75)*w+.984375)+S},BounceEaseIn(w,S,x,_){return x-e.Easings.BounceEaseOut(_-w,0,x,_)+S},BounceEaseInOut(w,S,x,_){return w<_/2?e.Easings.BounceEaseIn(w*2,0,x,_)*.5+S:e.Easings.BounceEaseOut(w*2-_,0,x,_)*.5+x*.5+S},EaseIn(w,S,x,_){return x*(w/=_)*w+S},EaseOut(w,S,x,_){return-x*(w/=_)*(w-2)+S},EaseInOut(w,S,x,_){return(w/=_/2)<1?x/2*w*w+S:-x/2*(--w*(w-2)-1)+S},StrongEaseIn(w,S,x,_){return x*(w/=_)*w*w*w*w+S},StrongEaseOut(w,S,x,_){return x*((w=w/_-1)*w*w*w*w+1)+S},StrongEaseInOut(w,S,x,_){return(w/=_/2)<1?x/2*w*w*w*w*w+S:x/2*((w-=2)*w*w*w*w+2)+S},Linear(w,S,x,_){return x*w/_+S}}}(Yg)),Yg}var Sy;function nv(){return Sy||(Sy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const n=Dt(),t=Lr(),r=Hr(),a=zp(),o=f9(),s=ww(),c=d9(),m=Tv(),f=Av(),v=bn(),y=Rv(),E=h9(),w=yw(),S=Fp();e.Konva=t.Util._assign(n.Konva,{Util:t.Util,Transform:t.Transform,Node:r.Node,Container:a.Container,Stage:o.Stage,stages:o.stages,Layer:s.Layer,FastLayer:c.FastLayer,Group:m.Group,DD:f.DD,Shape:v.Shape,shapes:v.shapes,Animation:y.Animation,Tween:E.Tween,Easings:E.Easings,Context:w.Context,Canvas:S.Canvas}),e.default=e.Konva}(Ug)),Ug}var Pf={},Ey;function p9(){if(Ey)return Pf;Ey=1,Object.defineProperty(Pf,"__esModule",{value:!0}),Pf.Arc=void 0;const e=qt(),n=bn(),t=Dt(),r=Vt(),a=Dt();class o extends n.Shape{_sceneFunc(c){const m=t.Konva.getAngle(this.angle()),f=this.clockwise();c.beginPath(),c.arc(0,0,this.outerRadius(),0,m,f),c.arc(0,0,this.innerRadius(),m,0,!f),c.closePath(),c.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(c){this.outerRadius(c/2)}setHeight(c){this.outerRadius(c/2)}getSelfRect(){const c=this.innerRadius(),m=this.outerRadius(),f=this.clockwise(),v=t.Konva.getAngle(f?360-this.angle():this.angle()),y=Math.cos(Math.min(v,Math.PI)),E=1,w=Math.sin(Math.min(Math.max(Math.PI,v),3*Math.PI/2)),S=Math.sin(Math.min(v,Math.PI/2)),x=y*(y>0?c:m),_=E*m,b=w*(w>0?c:m),g=S*(S>0?m:c);return{x,y:f?-1*g:b,width:_-x,height:g-b}}}return Pf.Arc=o,o.prototype._centroid=!0,o.prototype.className="Arc",o.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"],(0,a._registerNode)(o),e.Factory.addGetterSetter(o,"innerRadius",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(o,"outerRadius",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(o,"angle",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(o,"clockwise",!1,(0,r.getBooleanValidator)()),Pf}var Cf={},kf={},xy;function _w(){if(xy)return kf;xy=1,Object.defineProperty(kf,"__esModule",{value:!0}),kf.Line=void 0;const e=qt(),n=Dt(),t=bn(),r=Vt();function a(c,m,f,v,y,E,w){const S=Math.sqrt(Math.pow(f-c,2)+Math.pow(v-m,2)),x=Math.sqrt(Math.pow(y-f,2)+Math.pow(E-v,2)),_=w*S/(S+x),b=w*x/(S+x),g=f-_*(y-c),h=v-_*(E-m),d=f+b*(y-c),P=v+b*(E-m);return[g,h,d,P]}function o(c,m){const f=c.length,v=[];for(let y=2;y<f-2;y+=2){const E=a(c[y-2],c[y-1],c[y],c[y+1],c[y+2],c[y+3],m);isNaN(E[0])||(v.push(E[0]),v.push(E[1]),v.push(c[y]),v.push(c[y+1]),v.push(E[2]),v.push(E[3]))}return v}class s extends t.Shape{constructor(m){super(m),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(m){let f=this.points(),v=f.length,y=this.tension(),E=this.closed(),w=this.bezier(),S,x,_;if(v){if(m.beginPath(),m.moveTo(f[0],f[1]),y!==0&&v>4){for(S=this.getTensionPoints(),x=S.length,_=E?0:4,E||m.quadraticCurveTo(S[0],S[1],S[2],S[3]);_<x-2;)m.bezierCurveTo(S[_++],S[_++],S[_++],S[_++],S[_++],S[_++]);E||m.quadraticCurveTo(S[x-2],S[x-1],f[v-2],f[v-1])}else if(w)for(_=2;_<v;)m.bezierCurveTo(f[_++],f[_++],f[_++],f[_++],f[_++],f[_++]);else for(_=2;_<v;_+=2)m.lineTo(f[_],f[_+1]);E?(m.closePath(),m.fillStrokeShape(this)):m.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():o(this.points(),this.tension())}_getTensionPointsClosed(){const m=this.points(),f=m.length,v=this.tension(),y=a(m[f-2],m[f-1],m[0],m[1],m[2],m[3],v),E=a(m[f-4],m[f-3],m[f-2],m[f-1],m[0],m[1],v),w=o(m,v);return[y[2],y[3]].concat(w).concat([E[0],E[1],m[f-2],m[f-1],E[2],E[3],y[0],y[1],m[0],m[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let m=this.points();if(m.length<4)return{x:m[0]||0,y:m[1]||0,width:0,height:0};this.tension()!==0?m=[m[0],m[1],...this._getTensionPoints(),m[m.length-2],m[m.length-1]]:m=this.points();let f=m[0],v=m[0],y=m[1],E=m[1],w,S;for(let x=0;x<m.length/2;x++)w=m[x*2],S=m[x*2+1],f=Math.min(f,w),v=Math.max(v,w),y=Math.min(y,S),E=Math.max(E,S);return{x:f,y,width:v-f,height:E-y}}}return kf.Line=s,s.prototype.className="Line",s.prototype._attrsAffectingSize=["points","bezier","tension"],(0,n._registerNode)(s),e.Factory.addGetterSetter(s,"closed",!1),e.Factory.addGetterSetter(s,"bezier",!1),e.Factory.addGetterSetter(s,"tension",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(s,"points",[],(0,r.getNumberArrayValidator)()),kf}var Af={},Kg={},Oy;function g9(){return Oy||(Oy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t2length=e.getQuadraticArcLength=e.getCubicArcLength=e.binomialCoefficients=e.cValues=e.tValues=void 0,e.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],e.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],e.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const n=(s,c,m)=>{let f,v;const E=m/2;f=0;for(let w=0;w<20;w++)v=E*e.tValues[20][w]+E,f+=e.cValues[20][w]*r(s,c,v);return E*f};e.getCubicArcLength=n;const t=(s,c,m)=>{m===void 0&&(m=1);const f=s[0]-2*s[1]+s[2],v=c[0]-2*c[1]+c[2],y=2*s[1]-2*s[0],E=2*c[1]-2*c[0],w=4*(f*f+v*v),S=4*(f*y+v*E),x=y*y+E*E;if(w===0)return m*Math.sqrt(Math.pow(s[2]-s[0],2)+Math.pow(c[2]-c[0],2));const _=S/(2*w),b=x/w,g=m+_,h=b-_*_,d=g*g+h>0?Math.sqrt(g*g+h):0,P=_*_+h>0?Math.sqrt(_*_+h):0,M=_+Math.sqrt(_*_+h)!==0?h*Math.log(Math.abs((g+d)/(_+P))):0;return Math.sqrt(w)/2*(g*d-_*P+M)};e.getQuadraticArcLength=t;function r(s,c,m){const f=a(1,m,s),v=a(1,m,c),y=f*f+v*v;return Math.sqrt(y)}const a=(s,c,m)=>{const f=m.length-1;let v,y;if(f===0)return 0;if(s===0){y=0;for(let E=0;E<=f;E++)y+=e.binomialCoefficients[f][E]*Math.pow(1-c,f-E)*Math.pow(c,E)*m[E];return y}else{v=new Array(f);for(let E=0;E<f;E++)v[E]=f*(m[E+1]-m[E]);return a(s-1,c,v)}},o=(s,c,m)=>{let f=1,v=s/c,y=(s-m(v))/c,E=0;for(;f>.001;){const w=m(v+y),S=Math.abs(s-w)/c;if(S<f)f=S,v+=y;else{const x=m(v-y),_=Math.abs(s-x)/c;_<f?(f=_,v-=y):y/=2}if(E++,E>500)break}return v};e.t2length=o}(Kg)),Kg}var Py;function Mv(){if(Py)return Af;Py=1,Object.defineProperty(Af,"__esModule",{value:!0}),Af.Path=void 0;const e=qt(),n=bn(),t=Dt(),r=g9();class a extends n.Shape{constructor(s){super(s),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=a.parsePathData(this.data()),this.pathLength=a.getPathLength(this.dataArray)}_sceneFunc(s){const c=this.dataArray;s.beginPath();let m=!1;for(let d=0;d<c.length;d++){const P=c[d].command,M=c[d].points;switch(P){case"L":s.lineTo(M[0],M[1]);break;case"M":s.moveTo(M[0],M[1]);break;case"C":s.bezierCurveTo(M[0],M[1],M[2],M[3],M[4],M[5]);break;case"Q":s.quadraticCurveTo(M[0],M[1],M[2],M[3]);break;case"A":var f=M[0],v=M[1],y=M[2],E=M[3],w=M[4],S=M[5],x=M[6],_=M[7],b=y>E?y:E,g=y>E?1:y/E,h=y>E?E/y:1;s.translate(f,v),s.rotate(x),s.scale(g,h),s.arc(0,0,b,w,w+S,1-_),s.scale(1/g,1/h),s.rotate(-x),s.translate(-f,-v);break;case"z":m=!0,s.closePath();break}}!m&&!this.hasFill()?s.strokeShape(this):s.fillStrokeShape(this)}getSelfRect(){let s=[];this.dataArray.forEach(function(w){if(w.command==="A"){const S=w.points[4],x=w.points[5],_=w.points[4]+x;let b=Math.PI/180;if(Math.abs(S-_)<b&&(b=Math.abs(S-_)),x<0)for(let g=S-b;g>_;g-=b){const h=a.getPointOnEllipticalArc(w.points[0],w.points[1],w.points[2],w.points[3],g,0);s.push(h.x,h.y)}else for(let g=S+b;g<_;g+=b){const h=a.getPointOnEllipticalArc(w.points[0],w.points[1],w.points[2],w.points[3],g,0);s.push(h.x,h.y)}}else if(w.command==="C")for(let S=0;S<=1;S+=.01){const x=a.getPointOnCubicBezier(S,w.start.x,w.start.y,w.points[0],w.points[1],w.points[2],w.points[3],w.points[4],w.points[5]);s.push(x.x,x.y)}else s=s.concat(w.points)});let c=s[0],m=s[0],f=s[1],v=s[1],y,E;for(let w=0;w<s.length/2;w++)y=s[w*2],E=s[w*2+1],isNaN(y)||(c=Math.min(c,y),m=Math.max(m,y)),isNaN(E)||(f=Math.min(f,E),v=Math.max(v,E));return{x:c,y:f,width:m-c,height:v-f}}getLength(){return this.pathLength}getPointAtLength(s){return a.getPointAtLengthOfDataArray(s,this.dataArray)}static getLineLength(s,c,m,f){return Math.sqrt((m-s)*(m-s)+(f-c)*(f-c))}static getPathLength(s){let c=0;for(let m=0;m<s.length;++m)c+=s[m].pathLength;return c}static getPointAtLengthOfDataArray(s,c){let m,f=0,v=c.length;if(!v)return null;for(;f<v&&s>c[f].pathLength;)s-=c[f].pathLength,++f;if(f===v)return m=c[f-1].points.slice(-2),{x:m[0],y:m[1]};if(s<.01)return m=c[f].points.slice(0,2),{x:m[0],y:m[1]};const y=c[f],E=y.points;switch(y.command){case"L":return a.getPointOnLine(s,y.start.x,y.start.y,E[0],E[1]);case"C":return a.getPointOnCubicBezier((0,r.t2length)(s,a.getPathLength(c),d=>(0,r.getCubicArcLength)([y.start.x,E[0],E[2],E[4]],[y.start.y,E[1],E[3],E[5]],d)),y.start.x,y.start.y,E[0],E[1],E[2],E[3],E[4],E[5]);case"Q":return a.getPointOnQuadraticBezier((0,r.t2length)(s,a.getPathLength(c),d=>(0,r.getQuadraticArcLength)([y.start.x,E[0],E[2]],[y.start.y,E[1],E[3]],d)),y.start.x,y.start.y,E[0],E[1],E[2],E[3]);case"A":var w=E[0],S=E[1],x=E[2],_=E[3],b=E[4],g=E[5],h=E[6];return b+=g*s/y.pathLength,a.getPointOnEllipticalArc(w,S,x,_,b,h)}return null}static getPointOnLine(s,c,m,f,v,y,E){y=y??c,E=E??m;const w=this.getLineLength(c,m,f,v);if(w<1e-10)return{x:c,y:m};if(f===c)return{x:y,y:E+(v>m?s:-s)};const S=(v-m)/(f-c),x=Math.sqrt(s*s/(1+S*S))*(f<c?-1:1),_=S*x;if(Math.abs(E-m-S*(y-c))<1e-10)return{x:y+x,y:E+_};const b=((y-c)*(f-c)+(E-m)*(v-m))/(w*w),g=c+b*(f-c),h=m+b*(v-m),d=this.getLineLength(y,E,g,h),P=Math.sqrt(s*s-d*d),M=Math.sqrt(P*P/(1+S*S))*(f<c?-1:1),T=S*M;return{x:g+M,y:h+T}}static getPointOnCubicBezier(s,c,m,f,v,y,E,w,S){function x(P){return P*P*P}function _(P){return 3*P*P*(1-P)}function b(P){return 3*P*(1-P)*(1-P)}function g(P){return(1-P)*(1-P)*(1-P)}const h=w*x(s)+y*_(s)+f*b(s)+c*g(s),d=S*x(s)+E*_(s)+v*b(s)+m*g(s);return{x:h,y:d}}static getPointOnQuadraticBezier(s,c,m,f,v,y,E){function w(g){return g*g}function S(g){return 2*g*(1-g)}function x(g){return(1-g)*(1-g)}const _=y*w(s)+f*S(s)+c*x(s),b=E*w(s)+v*S(s)+m*x(s);return{x:_,y:b}}static getPointOnEllipticalArc(s,c,m,f,v,y){const E=Math.cos(y),w=Math.sin(y),S={x:m*Math.cos(v),y:f*Math.sin(v)};return{x:s+(S.x*E-S.y*w),y:c+(S.x*w+S.y*E)}}static parsePathData(s){if(!s)return[];let c=s;const m=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];c=c.replace(new RegExp(" ","g"),",");for(var f=0;f<m.length;f++)c=c.replace(new RegExp(m[f],"g"),"|"+m[f]);const v=c.split("|"),y=[],E=[];let w=0,S=0;const x=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let _;for(f=1;f<v.length;f++){let A=v[f],R=A.charAt(0);for(A=A.slice(1),E.length=0;_=x.exec(A);)E.push(_[0]);const L=[];for(let V=0,G=E.length;V<G;V++){if(E[V]==="00"){L.push(0,0);continue}const W=parseFloat(E[V]);isNaN(W)?L.push(0):L.push(W)}for(;L.length>0&&!isNaN(L[0]);){let V="",G=[];const W=w,X=S;var b,g,h,d,P,M,T,I,F,k;switch(R){case"l":w+=L.shift(),S+=L.shift(),V="L",G.push(w,S);break;case"L":w=L.shift(),S=L.shift(),G.push(w,S);break;case"m":var O=L.shift(),N=L.shift();if(w+=O,S+=N,V="M",y.length>2&&y[y.length-1].command==="z"){for(let q=y.length-2;q>=0;q--)if(y[q].command==="M"){w=y[q].points[0]+O,S=y[q].points[1]+N;break}}G.push(w,S),R="l";break;case"M":w=L.shift(),S=L.shift(),V="M",G.push(w,S),R="L";break;case"h":w+=L.shift(),V="L",G.push(w,S);break;case"H":w=L.shift(),V="L",G.push(w,S);break;case"v":S+=L.shift(),V="L",G.push(w,S);break;case"V":S=L.shift(),V="L",G.push(w,S);break;case"C":G.push(L.shift(),L.shift(),L.shift(),L.shift()),w=L.shift(),S=L.shift(),G.push(w,S);break;case"c":G.push(w+L.shift(),S+L.shift(),w+L.shift(),S+L.shift()),w+=L.shift(),S+=L.shift(),V="C",G.push(w,S);break;case"S":g=w,h=S,b=y[y.length-1],b.command==="C"&&(g=w+(w-b.points[2]),h=S+(S-b.points[3])),G.push(g,h,L.shift(),L.shift()),w=L.shift(),S=L.shift(),V="C",G.push(w,S);break;case"s":g=w,h=S,b=y[y.length-1],b.command==="C"&&(g=w+(w-b.points[2]),h=S+(S-b.points[3])),G.push(g,h,w+L.shift(),S+L.shift()),w+=L.shift(),S+=L.shift(),V="C",G.push(w,S);break;case"Q":G.push(L.shift(),L.shift()),w=L.shift(),S=L.shift(),G.push(w,S);break;case"q":G.push(w+L.shift(),S+L.shift()),w+=L.shift(),S+=L.shift(),V="Q",G.push(w,S);break;case"T":g=w,h=S,b=y[y.length-1],b.command==="Q"&&(g=w+(w-b.points[0]),h=S+(S-b.points[1])),w=L.shift(),S=L.shift(),V="Q",G.push(g,h,w,S);break;case"t":g=w,h=S,b=y[y.length-1],b.command==="Q"&&(g=w+(w-b.points[0]),h=S+(S-b.points[1])),w+=L.shift(),S+=L.shift(),V="Q",G.push(g,h,w,S);break;case"A":d=L.shift(),P=L.shift(),M=L.shift(),T=L.shift(),I=L.shift(),F=w,k=S,w=L.shift(),S=L.shift(),V="A",G=this.convertEndpointToCenterParameterization(F,k,w,S,T,I,d,P,M);break;case"a":d=L.shift(),P=L.shift(),M=L.shift(),T=L.shift(),I=L.shift(),F=w,k=S,w+=L.shift(),S+=L.shift(),V="A",G=this.convertEndpointToCenterParameterization(F,k,w,S,T,I,d,P,M);break}y.push({command:V||R,points:G,start:{x:W,y:X},pathLength:this.calcLength(W,X,V||R,G)})}(R==="z"||R==="Z")&&y.push({command:"z",points:[],start:void 0,pathLength:0})}return y}static calcLength(s,c,m,f){let v,y,E,w;const S=a;switch(m){case"L":return S.getLineLength(s,c,f[0],f[1]);case"C":return(0,r.getCubicArcLength)([s,f[0],f[2],f[4]],[c,f[1],f[3],f[5]],1);case"Q":return(0,r.getQuadraticArcLength)([s,f[0],f[2]],[c,f[1],f[3]],1);case"A":v=0;var x=f[4],_=f[5],b=f[4]+_,g=Math.PI/180;if(Math.abs(x-b)<g&&(g=Math.abs(x-b)),y=S.getPointOnEllipticalArc(f[0],f[1],f[2],f[3],x,0),_<0)for(w=x-g;w>b;w-=g)E=S.getPointOnEllipticalArc(f[0],f[1],f[2],f[3],w,0),v+=S.getLineLength(y.x,y.y,E.x,E.y),y=E;else for(w=x+g;w<b;w+=g)E=S.getPointOnEllipticalArc(f[0],f[1],f[2],f[3],w,0),v+=S.getLineLength(y.x,y.y,E.x,E.y),y=E;return E=S.getPointOnEllipticalArc(f[0],f[1],f[2],f[3],b,0),v+=S.getLineLength(y.x,y.y,E.x,E.y),v}return 0}static convertEndpointToCenterParameterization(s,c,m,f,v,y,E,w,S){const x=S*(Math.PI/180),_=Math.cos(x)*(s-m)/2+Math.sin(x)*(c-f)/2,b=-1*Math.sin(x)*(s-m)/2+Math.cos(x)*(c-f)/2,g=_*_/(E*E)+b*b/(w*w);g>1&&(E*=Math.sqrt(g),w*=Math.sqrt(g));let h=Math.sqrt((E*E*(w*w)-E*E*(b*b)-w*w*(_*_))/(E*E*(b*b)+w*w*(_*_)));v===y&&(h*=-1),isNaN(h)&&(h=0);const d=h*E*b/w,P=h*-w*_/E,M=(s+m)/2+Math.cos(x)*d-Math.sin(x)*P,T=(c+f)/2+Math.sin(x)*d+Math.cos(x)*P,I=function(L){return Math.sqrt(L[0]*L[0]+L[1]*L[1])},F=function(L,V){return(L[0]*V[0]+L[1]*V[1])/(I(L)*I(V))},k=function(L,V){return(L[0]*V[1]<L[1]*V[0]?-1:1)*Math.acos(F(L,V))},O=k([1,0],[(_-d)/E,(b-P)/w]),N=[(_-d)/E,(b-P)/w],A=[(-1*_-d)/E,(-1*b-P)/w];let R=k(N,A);return F(N,A)<=-1&&(R=Math.PI),F(N,A)>=1&&(R=0),y===0&&R>0&&(R=R-2*Math.PI),y===1&&R<0&&(R=R+2*Math.PI),[M,T,E,w,O,R,x,y]}}return Af.Path=a,a.prototype.className="Path",a.prototype._attrsAffectingSize=["data"],(0,t._registerNode)(a),e.Factory.addGetterSetter(a,"data"),Af}var Cy;function v9(){if(Cy)return Cf;Cy=1,Object.defineProperty(Cf,"__esModule",{value:!0}),Cf.Arrow=void 0;const e=qt(),n=_w(),t=Vt(),r=Dt(),a=Mv();class o extends n.Line{_sceneFunc(c){super._sceneFunc(c);const m=Math.PI*2,f=this.points();let v=f;const y=this.tension()!==0&&f.length>4;y&&(v=this.getTensionPoints());const E=this.pointerLength(),w=f.length;let S,x;if(y){const g=[v[v.length-4],v[v.length-3],v[v.length-2],v[v.length-1],f[w-2],f[w-1]],h=a.Path.calcLength(v[v.length-4],v[v.length-3],"C",g),d=a.Path.getPointOnQuadraticBezier(Math.min(1,1-E/h),g[0],g[1],g[2],g[3],g[4],g[5]);S=f[w-2]-d.x,x=f[w-1]-d.y}else S=f[w-2]-f[w-4],x=f[w-1]-f[w-3];const _=(Math.atan2(x,S)+m)%m,b=this.pointerWidth();this.pointerAtEnding()&&(c.save(),c.beginPath(),c.translate(f[w-2],f[w-1]),c.rotate(_),c.moveTo(0,0),c.lineTo(-E,b/2),c.lineTo(-E,-b/2),c.closePath(),c.restore(),this.__fillStroke(c)),this.pointerAtBeginning()&&(c.save(),c.beginPath(),c.translate(f[0],f[1]),y?(S=(v[0]+v[2])/2-f[0],x=(v[1]+v[3])/2-f[1]):(S=f[2]-f[0],x=f[3]-f[1]),c.rotate((Math.atan2(-x,-S)+m)%m),c.moveTo(0,0),c.lineTo(-E,b/2),c.lineTo(-E,-b/2),c.closePath(),c.restore(),this.__fillStroke(c))}__fillStroke(c){const m=this.dashEnabled();m&&(this.attrs.dashEnabled=!1,c.setLineDash([])),c.fillStrokeShape(this),m&&(this.attrs.dashEnabled=!0)}getSelfRect(){const c=super.getSelfRect(),m=this.pointerWidth()/2;return{x:c.x,y:c.y-m,width:c.width,height:c.height+m*2}}}return Cf.Arrow=o,o.prototype.className="Arrow",(0,r._registerNode)(o),e.Factory.addGetterSetter(o,"pointerLength",10,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(o,"pointerWidth",10,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(o,"pointerAtBeginning",!1),e.Factory.addGetterSetter(o,"pointerAtEnding",!0),Cf}var Tf={},ky;function m9(){if(ky)return Tf;ky=1,Object.defineProperty(Tf,"__esModule",{value:!0}),Tf.Circle=void 0;const e=qt(),n=bn(),t=Vt(),r=Dt();class a extends n.Shape{_sceneFunc(s){s.beginPath(),s.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),s.closePath(),s.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(s){this.radius()!==s/2&&this.radius(s/2)}setHeight(s){this.radius()!==s/2&&this.radius(s/2)}}return Tf.Circle=a,a.prototype._centroid=!0,a.prototype.className="Circle",a.prototype._attrsAffectingSize=["radius"],(0,r._registerNode)(a),e.Factory.addGetterSetter(a,"radius",0,(0,t.getNumberValidator)()),Tf}var Rf={},Ay;function y9(){if(Ay)return Rf;Ay=1,Object.defineProperty(Rf,"__esModule",{value:!0}),Rf.Ellipse=void 0;const e=qt(),n=bn(),t=Vt(),r=Dt();class a extends n.Shape{_sceneFunc(s){const c=this.radiusX(),m=this.radiusY();s.beginPath(),s.save(),c!==m&&s.scale(1,m/c),s.arc(0,0,c,0,Math.PI*2,!1),s.restore(),s.closePath(),s.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(s){this.radiusX(s/2)}setHeight(s){this.radiusY(s/2)}}return Rf.Ellipse=a,a.prototype.className="Ellipse",a.prototype._centroid=!0,a.prototype._attrsAffectingSize=["radiusX","radiusY"],(0,r._registerNode)(a),e.Factory.addComponentsGetterSetter(a,"radius",["x","y"]),e.Factory.addGetterSetter(a,"radiusX",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(a,"radiusY",0,(0,t.getNumberValidator)()),Rf}var Mf={},Ty;function b9(){if(Ty)return Mf;Ty=1,Object.defineProperty(Mf,"__esModule",{value:!0}),Mf.Image=void 0;const e=Lr(),n=qt(),t=bn(),r=Dt(),a=Vt();class o extends t.Shape{constructor(c){super(c),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",m=>{this._removeImageLoad(m.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const c=this.image();c&&c.complete||c&&c.readyState===4||c&&c.addEventListener&&c.addEventListener("load",this._loadListener)}_removeImageLoad(c){c&&c.removeEventListener&&c.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const c=!!this.cornerRadius(),m=this.hasShadow();return c&&m?!0:super._useBufferCanvas(!0)}_sceneFunc(c){const m=this.getWidth(),f=this.getHeight(),v=this.cornerRadius(),y=this.attrs.image;let E;if(y){const w=this.attrs.cropWidth,S=this.attrs.cropHeight;w&&S?E=[y,this.cropX(),this.cropY(),w,S,0,0,m,f]:E=[y,0,0,m,f]}(this.hasFill()||this.hasStroke()||v)&&(c.beginPath(),v?e.Util.drawRoundedRectPath(c,m,f,v):c.rect(0,0,m,f),c.closePath(),c.fillStrokeShape(this)),y&&(v&&c.clip(),c.drawImage.apply(c,E))}_hitFunc(c){const m=this.width(),f=this.height(),v=this.cornerRadius();c.beginPath(),v?e.Util.drawRoundedRectPath(c,m,f,v):c.rect(0,0,m,f),c.closePath(),c.fillStrokeShape(this)}getWidth(){var c,m;return(c=this.attrs.width)!==null&&c!==void 0?c:(m=this.image())===null||m===void 0?void 0:m.width}getHeight(){var c,m;return(c=this.attrs.height)!==null&&c!==void 0?c:(m=this.image())===null||m===void 0?void 0:m.height}static fromURL(c,m,f=null){const v=e.Util.createImageElement();v.onload=function(){const y=new o({image:v});m(y)},v.onerror=f,v.crossOrigin="Anonymous",v.src=c}}return Mf.Image=o,o.prototype.className="Image",(0,r._registerNode)(o),n.Factory.addGetterSetter(o,"cornerRadius",0,(0,a.getNumberOrArrayOfNumbersValidator)(4)),n.Factory.addGetterSetter(o,"image"),n.Factory.addComponentsGetterSetter(o,"crop",["x","y","width","height"]),n.Factory.addGetterSetter(o,"cropX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(o,"cropY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(o,"cropWidth",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(o,"cropHeight",0,(0,a.getNumberValidator)()),Mf}var Is={},Ry;function w9(){if(Ry)return Is;Ry=1,Object.defineProperty(Is,"__esModule",{value:!0}),Is.Tag=Is.Label=void 0;const e=qt(),n=bn(),t=Tv(),r=Vt(),a=Dt(),o=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],s="Change.konva",c="none",m="up",f="right",v="down",y="left",E=o.length;class w extends t.Group{constructor(_){super(_),this.on("add.konva",function(b){this._addListeners(b.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(_){let b=this,g;const h=function(){b._sync()};for(g=0;g<E;g++)_.on(o[g]+s,h)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let _=this.getText(),b=this.getTag(),g,h,d,P,M,T,I;if(_&&b){switch(g=_.width(),h=_.height(),d=b.pointerDirection(),P=b.pointerWidth(),I=b.pointerHeight(),M=0,T=0,d){case m:M=g/2,T=-1*I;break;case f:M=g+P,T=h/2;break;case v:M=g/2,T=h+I;break;case y:M=-1*P,T=h/2;break}b.setAttrs({x:-1*M,y:-1*T,width:g,height:h}),_.setAttrs({x:-1*M,y:-1*T})}}}Is.Label=w,w.prototype.className="Label",(0,a._registerNode)(w);class S extends n.Shape{_sceneFunc(_){const b=this.width(),g=this.height(),h=this.pointerDirection(),d=this.pointerWidth(),P=this.pointerHeight(),M=this.cornerRadius();let T=0,I=0,F=0,k=0;typeof M=="number"?T=I=F=k=Math.min(M,b/2,g/2):(T=Math.min(M[0]||0,b/2,g/2),I=Math.min(M[1]||0,b/2,g/2),k=Math.min(M[2]||0,b/2,g/2),F=Math.min(M[3]||0,b/2,g/2)),_.beginPath(),_.moveTo(T,0),h===m&&(_.lineTo((b-d)/2,0),_.lineTo(b/2,-1*P),_.lineTo((b+d)/2,0)),_.lineTo(b-I,0),_.arc(b-I,I,I,Math.PI*3/2,0,!1),h===f&&(_.lineTo(b,(g-P)/2),_.lineTo(b+d,g/2),_.lineTo(b,(g+P)/2)),_.lineTo(b,g-k),_.arc(b-k,g-k,k,0,Math.PI/2,!1),h===v&&(_.lineTo((b+d)/2,g),_.lineTo(b/2,g+P),_.lineTo((b-d)/2,g)),_.lineTo(F,g),_.arc(F,g-F,F,Math.PI/2,Math.PI,!1),h===y&&(_.lineTo(0,(g+P)/2),_.lineTo(-1*d,g/2),_.lineTo(0,(g-P)/2)),_.lineTo(0,T),_.arc(T,T,T,Math.PI,Math.PI*3/2,!1),_.closePath(),_.fillStrokeShape(this)}getSelfRect(){let _=0,b=0,g=this.pointerWidth(),h=this.pointerHeight(),d=this.pointerDirection(),P=this.width(),M=this.height();return d===m?(b-=h,M+=h):d===v?M+=h:d===y?(_-=g*1.5,P+=g):d===f&&(P+=g*1.5),{x:_,y:b,width:P,height:M}}}return Is.Tag=S,S.prototype.className="Tag",(0,a._registerNode)(S),e.Factory.addGetterSetter(S,"pointerDirection",c),e.Factory.addGetterSetter(S,"pointerWidth",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(S,"pointerHeight",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(S,"cornerRadius",0,(0,r.getNumberOrArrayOfNumbersValidator)(4)),Is}var Lf={},My;function Sw(){if(My)return Lf;My=1,Object.defineProperty(Lf,"__esModule",{value:!0}),Lf.Rect=void 0;const e=qt(),n=bn(),t=Dt(),r=Lr(),a=Vt();class o extends n.Shape{_sceneFunc(c){const m=this.cornerRadius(),f=this.width(),v=this.height();c.beginPath(),m?r.Util.drawRoundedRectPath(c,f,v,m):c.rect(0,0,f,v),c.closePath(),c.fillStrokeShape(this)}}return Lf.Rect=o,o.prototype.className="Rect",(0,t._registerNode)(o),e.Factory.addGetterSetter(o,"cornerRadius",0,(0,a.getNumberOrArrayOfNumbersValidator)(4)),Lf}var Nf={},Ly;function _9(){if(Ly)return Nf;Ly=1,Object.defineProperty(Nf,"__esModule",{value:!0}),Nf.RegularPolygon=void 0;const e=qt(),n=bn(),t=Vt(),r=Dt();class a extends n.Shape{_sceneFunc(s){const c=this._getPoints();s.beginPath(),s.moveTo(c[0].x,c[0].y);for(let m=1;m<c.length;m++)s.lineTo(c[m].x,c[m].y);s.closePath(),s.fillStrokeShape(this)}_getPoints(){const s=this.attrs.sides,c=this.attrs.radius||0,m=[];for(let f=0;f<s;f++)m.push({x:c*Math.sin(f*2*Math.PI/s),y:-1*c*Math.cos(f*2*Math.PI/s)});return m}getSelfRect(){const s=this._getPoints();let c=s[0].x,m=s[0].y,f=s[0].x,v=s[0].y;return s.forEach(y=>{c=Math.min(c,y.x),m=Math.max(m,y.x),f=Math.min(f,y.y),v=Math.max(v,y.y)}),{x:c,y:f,width:m-c,height:v-f}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(s){this.radius(s/2)}setHeight(s){this.radius(s/2)}}return Nf.RegularPolygon=a,a.prototype.className="RegularPolygon",a.prototype._centroid=!0,a.prototype._attrsAffectingSize=["radius"],(0,r._registerNode)(a),e.Factory.addGetterSetter(a,"radius",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(a,"sides",0,(0,t.getNumberValidator)()),Nf}var If={},Ny;function S9(){if(Ny)return If;Ny=1,Object.defineProperty(If,"__esModule",{value:!0}),If.Ring=void 0;const e=qt(),n=bn(),t=Vt(),r=Dt(),a=Math.PI*2;class o extends n.Shape{_sceneFunc(c){c.beginPath(),c.arc(0,0,this.innerRadius(),0,a,!1),c.moveTo(this.outerRadius(),0),c.arc(0,0,this.outerRadius(),a,0,!0),c.closePath(),c.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(c){this.outerRadius(c/2)}setHeight(c){this.outerRadius(c/2)}}return If.Ring=o,o.prototype.className="Ring",o.prototype._centroid=!0,o.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,r._registerNode)(o),e.Factory.addGetterSetter(o,"innerRadius",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(o,"outerRadius",0,(0,t.getNumberValidator)()),If}var jf={},Iy;function E9(){if(Iy)return jf;Iy=1,Object.defineProperty(jf,"__esModule",{value:!0}),jf.Sprite=void 0;const e=qt(),n=bn(),t=Rv(),r=Vt(),a=Dt();class o extends n.Shape{constructor(c){super(c),this._updated=!0,this.anim=new t.Animation(()=>{const m=this._updated;return this._updated=!1,m}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(c){const m=this.animation(),f=this.frameIndex(),v=f*4,y=this.animations()[m],E=this.frameOffsets(),w=y[v+0],S=y[v+1],x=y[v+2],_=y[v+3],b=this.image();if((this.hasFill()||this.hasStroke())&&(c.beginPath(),c.rect(0,0,x,_),c.closePath(),c.fillStrokeShape(this)),b)if(E){const g=E[m],h=f*2;c.drawImage(b,w,S,x,_,g[h+0],g[h+1],x,_)}else c.drawImage(b,w,S,x,_,0,0,x,_)}_hitFunc(c){const m=this.animation(),f=this.frameIndex(),v=f*4,y=this.animations()[m],E=this.frameOffsets(),w=y[v+2],S=y[v+3];if(c.beginPath(),E){const x=E[m],_=f*2;c.rect(x[_+0],x[_+1],w,S)}else c.rect(0,0,w,S);c.closePath(),c.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const c=this;this.interval=setInterval(function(){c._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const c=this.getLayer();this.anim.setLayers(c),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const c=this.frameIndex(),m=this.animation(),f=this.animations(),v=f[m],y=v.length/4;c<y-1?this.frameIndex(c+1):this.frameIndex(0)}}return jf.Sprite=o,o.prototype.className="Sprite",(0,a._registerNode)(o),e.Factory.addGetterSetter(o,"animation"),e.Factory.addGetterSetter(o,"animations"),e.Factory.addGetterSetter(o,"frameOffsets"),e.Factory.addGetterSetter(o,"image"),e.Factory.addGetterSetter(o,"frameIndex",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(o,"frameRate",17,(0,r.getNumberValidator)()),e.Factory.backCompat(o,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"}),jf}var Df={},jy;function x9(){if(jy)return Df;jy=1,Object.defineProperty(Df,"__esModule",{value:!0}),Df.Star=void 0;const e=qt(),n=bn(),t=Vt(),r=Dt();class a extends n.Shape{_sceneFunc(s){const c=this.innerRadius(),m=this.outerRadius(),f=this.numPoints();s.beginPath(),s.moveTo(0,0-m);for(let v=1;v<f*2;v++){const y=v%2===0?m:c,E=y*Math.sin(v*Math.PI/f),w=-1*y*Math.cos(v*Math.PI/f);s.lineTo(E,w)}s.closePath(),s.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(s){this.outerRadius(s/2)}setHeight(s){this.outerRadius(s/2)}}return Df.Star=a,a.prototype.className="Star",a.prototype._centroid=!0,a.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,r._registerNode)(a),e.Factory.addGetterSetter(a,"numPoints",5,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(a,"innerRadius",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(a,"outerRadius",0,(0,t.getNumberValidator)()),Df}var Qu={},Dy;function Ew(){if(Dy)return Qu;Dy=1,Object.defineProperty(Qu,"__esModule",{value:!0}),Qu.Text=void 0,Qu.stringToArray=s;const e=Lr(),n=qt(),t=bn(),r=Dt(),a=Vt(),o=Dt();function s(Y){return[...Y].reduce((U,ee,te,Q)=>{if(new RegExp("\\p{Emoji}","u").test(ee)){const Z=Q[te+1];Z&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(Z)?(U.push(ee+Z),Q[te+1]=""):U.push(ee)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(ee+(Q[te+1]||""))?U.push(ee+Q[te+1]):te>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(ee)?U[U.length-1]+=ee:ee&&U.push(ee);return U},[])}const c="auto",m="center",f="inherit",v="justify",y="Change.konva",E="2d",w="-",S="left",x="text",_="Text",b="top",g="bottom",h="middle",d="normal",P="px ",M=" ",T="right",I="rtl",F="word",k="char",O="none",N="…",A=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],R=A.length;function L(Y){return Y.split(",").map(U=>{U=U.trim();const ee=U.indexOf(" ")>=0,te=U.indexOf('"')>=0||U.indexOf("'")>=0;return ee&&!te&&(U=`"${U}"`),U}).join(", ")}let V;function G(){return V||(V=e.Util.createCanvasElement().getContext(E),V)}function W(Y){Y.fillText(this._partialText,this._partialTextX,this._partialTextY)}function X(Y){Y.setAttr("miterLimit",2),Y.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function q(Y){return Y=Y||{},!Y.fillLinearGradientColorStops&&!Y.fillRadialGradientColorStops&&!Y.fillPatternImage&&(Y.fill=Y.fill||"black"),Y}class z extends t.Shape{constructor(U){super(q(U)),this._partialTextX=0,this._partialTextY=0;for(let ee=0;ee<R;ee++)this.on(A[ee]+y,this._setTextData);this._setTextData()}_sceneFunc(U){const ee=this.textArr,te=ee.length;if(!this.text())return;let Q=this.padding(),Z=this.fontSize(),re=this.lineHeight()*Z,ne=this.verticalAlign(),ae=this.direction(),ue=0,fe=this.align(),pe=this.getWidth(),ye=this.letterSpacing(),we=this.fill(),je=this.textDecoration(),Te=je.indexOf("underline")!==-1,se=je.indexOf("line-through")!==-1,_e;ae=ae===f?U.direction:ae;let he=re/2,xe=h;if(r.Konva._fixTextRendering){const Ue=this.measureSize("M");xe="alphabetic",he=(Ue.fontBoundingBoxAscent-Ue.fontBoundingBoxDescent)/2+re/2}var oe=0,ve=0;for(ae===I&&U.setAttr("direction",ae),U.setAttr("font",this._getContextFont()),U.setAttr("textBaseline",xe),U.setAttr("textAlign",S),ne===h?ue=(this.getHeight()-te*re-Q*2)/2:ne===g&&(ue=this.getHeight()-te*re-Q*2),U.translate(Q,ue+Q),_e=0;_e<te;_e++){var oe=0,ve=0,de=ee[_e],ke=de.text,Be=de.width,Qe=de.lastInParagraph,Ke,St;if(U.save(),fe===T?oe+=pe-Be-Q*2:fe===m&&(oe+=(pe-Be-Q*2)/2),Te){U.save(),U.beginPath();const gt=r.Konva._fixTextRendering?Math.round(Z/4):Math.round(Z/2),mt=oe,kt=he+ve+gt;U.moveTo(mt,kt),Ke=ke.split(" ").length-1,St=fe===v&&!Qe?pe-Q*2:Be,U.lineTo(mt+Math.round(St),kt),U.lineWidth=Z/15;const jt=this._getLinearGradient();U.strokeStyle=jt||we,U.stroke(),U.restore()}if(se){U.save(),U.beginPath();const gt=r.Konva._fixTextRendering?-Math.round(Z/4):0;U.moveTo(oe,he+ve+gt),Ke=ke.split(" ").length-1,St=fe===v&&!Qe?pe-Q*2:Be,U.lineTo(oe+Math.round(St),he+ve+gt),U.lineWidth=Z/15;const mt=this._getLinearGradient();U.strokeStyle=mt||we,U.stroke(),U.restore()}if(ae!==I&&(ye!==0||fe===v)){Ke=ke.split(" ").length-1;const gt=s(ke);for(let mt=0;mt<gt.length;mt++){const kt=gt[mt];kt===" "&&!Qe&&fe===v&&(oe+=(pe-Q*2-Be)/Ke),this._partialTextX=oe,this._partialTextY=he+ve,this._partialText=kt,U.fillStrokeShape(this),oe+=this.measureSize(kt).width+ye}}else ye!==0&&U.setAttr("letterSpacing",`${ye}px`),this._partialTextX=oe,this._partialTextY=he+ve,this._partialText=ke,U.fillStrokeShape(this);U.restore(),te>1&&(he+=re)}}_hitFunc(U){const ee=this.getWidth(),te=this.getHeight();U.beginPath(),U.rect(0,0,ee,te),U.closePath(),U.fillStrokeShape(this)}setText(U){const ee=e.Util._isString(U)?U:U==null?"":U+"";return this._setAttr(x,ee),this}getWidth(){return this.attrs.width===c||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===c||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return e.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(U){var ee,te,Q,Z,re,ne,ae,ue,fe,pe,ye;let we=G(),je=this.fontSize(),Te;we.save(),we.font=this._getContextFont(),Te=we.measureText(U),we.restore();const se=je/100;return{actualBoundingBoxAscent:(ee=Te.actualBoundingBoxAscent)!==null&&ee!==void 0?ee:71.58203125*se,actualBoundingBoxDescent:(te=Te.actualBoundingBoxDescent)!==null&&te!==void 0?te:0,actualBoundingBoxLeft:(Q=Te.actualBoundingBoxLeft)!==null&&Q!==void 0?Q:-7.421875*se,actualBoundingBoxRight:(Z=Te.actualBoundingBoxRight)!==null&&Z!==void 0?Z:75.732421875*se,alphabeticBaseline:(re=Te.alphabeticBaseline)!==null&&re!==void 0?re:0,emHeightAscent:(ne=Te.emHeightAscent)!==null&&ne!==void 0?ne:100*se,emHeightDescent:(ae=Te.emHeightDescent)!==null&&ae!==void 0?ae:-20*se,fontBoundingBoxAscent:(ue=Te.fontBoundingBoxAscent)!==null&&ue!==void 0?ue:91*se,fontBoundingBoxDescent:(fe=Te.fontBoundingBoxDescent)!==null&&fe!==void 0?fe:21*se,hangingBaseline:(pe=Te.hangingBaseline)!==null&&pe!==void 0?pe:72.80000305175781*se,ideographicBaseline:(ye=Te.ideographicBaseline)!==null&&ye!==void 0?ye:-21*se,width:Te.width,height:je}}_getContextFont(){return this.fontStyle()+M+this.fontVariant()+M+(this.fontSize()+P)+L(this.fontFamily())}_addTextLine(U){this.align()===v&&(U=U.trim());const te=this._getTextWidth(U);return this.textArr.push({text:U,width:te,lastInParagraph:!1})}_getTextWidth(U){const ee=this.letterSpacing(),te=U.length;return G().measureText(U).width+ee*te}_setTextData(){let U=this.text().split(`
43
- `),ee=+this.fontSize(),te=0,Q=this.lineHeight()*ee,Z=this.attrs.width,re=this.attrs.height,ne=Z!==c&&Z!==void 0,ae=re!==c&&re!==void 0,ue=this.padding(),fe=Z-ue*2,pe=re-ue*2,ye=0,we=this.wrap(),je=we!==O,Te=we!==k&&je,se=this.ellipsis();this.textArr=[],G().font=this._getContextFont();const _e=se?this._getTextWidth(N):0;for(let he=0,xe=U.length;he<xe;++he){let oe=U[he],ve=this._getTextWidth(oe);if(ne&&ve>fe)for(;oe.length>0;){let de=0,ke=s(oe).length,Be="",Qe=0;for(;de<ke;){const Ke=de+ke>>>1,St=s(oe),Ue=St.slice(0,Ke+1).join(""),rt=this._getTextWidth(Ue)+_e;rt<=fe?(de=Ke+1,Be=Ue,Qe=rt):ke=Ke}if(Be){if(Te){const Ue=s(oe),rt=s(Be),gt=Ue[rt.length],mt=gt===M||gt===w;let kt;if(mt&&Qe<=fe)kt=rt.length;else{const jt=rt.lastIndexOf(M),Oe=rt.lastIndexOf(w);kt=Math.max(jt,Oe)+1}kt>0&&(de=kt,Be=Ue.slice(0,de).join(""),Qe=this._getTextWidth(Be))}if(Be=Be.trimRight(),this._addTextLine(Be),te=Math.max(te,Qe),ye+=Q,this._shouldHandleEllipsis(ye)){this._tryToAddEllipsisToLastLine();break}if(oe=s(oe).slice(de).join("").trimLeft(),oe.length>0&&(ve=this._getTextWidth(oe),ve<=fe)){this._addTextLine(oe),ye+=Q,te=Math.max(te,ve);break}}else break}else this._addTextLine(oe),ye+=Q,te=Math.max(te,ve),this._shouldHandleEllipsis(ye)&&he<xe-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),ae&&ye+Q>pe)break}this.textHeight=ee,this.textWidth=te}_shouldHandleEllipsis(U){const ee=+this.fontSize(),te=this.lineHeight()*ee,Q=this.attrs.height,Z=Q!==c&&Q!==void 0,re=this.padding(),ne=Q-re*2;return!(this.wrap()!==O)||Z&&U+te>ne}_tryToAddEllipsisToLastLine(){const U=this.attrs.width,ee=U!==c&&U!==void 0,te=this.padding(),Q=U-te*2,Z=this.ellipsis(),re=this.textArr[this.textArr.length-1];!re||!Z||(ee&&(this._getTextWidth(re.text+N)<Q||(re.text=re.text.slice(0,re.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(re.text+N))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const U=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,ee=this.hasShadow();return U&&ee?!0:super._useBufferCanvas()}}return Qu.Text=z,z.prototype._fillFunc=W,z.prototype._strokeFunc=X,z.prototype.className=_,z.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"],(0,o._registerNode)(z),n.Factory.overWriteSetter(z,"width",(0,a.getNumberOrAutoValidator)()),n.Factory.overWriteSetter(z,"height",(0,a.getNumberOrAutoValidator)()),n.Factory.addGetterSetter(z,"direction",f),n.Factory.addGetterSetter(z,"fontFamily","Arial"),n.Factory.addGetterSetter(z,"fontSize",12,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(z,"fontStyle",d),n.Factory.addGetterSetter(z,"fontVariant",d),n.Factory.addGetterSetter(z,"padding",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(z,"align",S),n.Factory.addGetterSetter(z,"verticalAlign",b),n.Factory.addGetterSetter(z,"lineHeight",1,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(z,"wrap",F),n.Factory.addGetterSetter(z,"ellipsis",!1,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(z,"letterSpacing",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(z,"text","",(0,a.getStringValidator)()),n.Factory.addGetterSetter(z,"textDecoration",""),Qu}var Ff={},Fy;function O9(){if(Fy)return Ff;Fy=1,Object.defineProperty(Ff,"__esModule",{value:!0}),Ff.TextPath=void 0;const e=Lr(),n=qt(),t=bn(),r=Mv(),a=Ew(),o=Vt(),s=Dt(),c="",m="normal";function f(E){E.fillText(this.partialText,0,0)}function v(E){E.strokeText(this.partialText,0,0)}class y extends t.Shape{constructor(w){super(w),this.dummyCanvas=e.Util.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return r.Path.getPathLength(this.dataArray)}_getPointAtLength(w){if(!this.attrs.data)return null;const S=this.pathLength;return w-1>S?null:r.Path.getPointAtLengthOfDataArray(w,this.dataArray)}_readDataAttribute(){this.dataArray=r.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(w){w.setAttr("font",this._getContextFont()),w.setAttr("textBaseline",this.textBaseline()),w.setAttr("textAlign","left"),w.save();const S=this.textDecoration(),x=this.fill(),_=this.fontSize(),b=this.glyphInfo;S==="underline"&&w.beginPath();for(let g=0;g<b.length;g++){w.save();const h=b[g].p0;w.translate(h.x,h.y),w.rotate(b[g].rotation),this.partialText=b[g].text,w.fillStrokeShape(this),S==="underline"&&(g===0&&w.moveTo(0,_/2+1),w.lineTo(_,_/2+1)),w.restore()}S==="underline"&&(w.strokeStyle=x,w.lineWidth=_/20,w.stroke()),w.restore()}_hitFunc(w){w.beginPath();const S=this.glyphInfo;if(S.length>=1){const x=S[0].p0;w.moveTo(x.x,x.y)}for(let x=0;x<S.length;x++){const _=S[x].p1;w.lineTo(_.x,_.y)}w.setAttr("lineWidth",this.fontSize()),w.setAttr("strokeStyle",this.colorKey),w.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return e.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(w){return a.Text.prototype.setText.call(this,w)}_getContextFont(){return a.Text.prototype._getContextFont.call(this)}_getTextSize(w){const x=this.dummyCanvas.getContext("2d");x.save(),x.font=this._getContextFont();const _=x.measureText(w);return x.restore(),{width:_.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:w,height:S}=this._getTextSize(this.attrs.text);if(this.textWidth=w,this.textHeight=S,this.glyphInfo=[],!this.attrs.data)return null;const x=this.letterSpacing(),_=this.align(),b=this.kerningFunc(),g=Math.max(this.textWidth+((this.attrs.text||"").length-1)*x,0);let h=0;_==="center"&&(h=Math.max(0,this.pathLength/2-g/2)),_==="right"&&(h=Math.max(0,this.pathLength-g));const d=(0,a.stringToArray)(this.text());let P=h;for(let M=0;M<d.length;M++){const T=this._getPointAtLength(P);if(!T)return;let I=this._getTextSize(d[M]).width+x;if(d[M]===" "&&_==="justify"){const R=this.text().split(" ").length-1;I+=(this.pathLength-g)/R}const F=this._getPointAtLength(P+I);if(!F)return;const k=r.Path.getLineLength(T.x,T.y,F.x,F.y);let O=0;if(b)try{O=b(d[M-1],d[M])*this.fontSize()}catch{O=0}T.x+=O,F.x+=O,this.textWidth+=O;const N=r.Path.getPointOnLine(O+k/2,T.x,T.y,F.x,F.y),A=Math.atan2(F.y-T.y,F.x-T.x);this.glyphInfo.push({transposeX:N.x,transposeY:N.y,text:d[M],rotation:A,p0:T,p1:F}),P+=I}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const w=[];this.glyphInfo.forEach(function(P){w.push(P.p0.x),w.push(P.p0.y),w.push(P.p1.x),w.push(P.p1.y)});let S=w[0]||0,x=w[0]||0,_=w[1]||0,b=w[1]||0,g,h;for(let P=0;P<w.length/2;P++)g=w[P*2],h=w[P*2+1],S=Math.min(S,g),x=Math.max(x,g),_=Math.min(_,h),b=Math.max(b,h);const d=this.fontSize();return{x:S-d/2,y:_-d/2,width:x-S+d,height:b-_+d}}destroy(){return e.Util.releaseCanvas(this.dummyCanvas),super.destroy()}}return Ff.TextPath=y,y.prototype._fillFunc=f,y.prototype._strokeFunc=v,y.prototype._fillFuncHit=f,y.prototype._strokeFuncHit=v,y.prototype.className="TextPath",y.prototype._attrsAffectingSize=["text","fontSize","data"],(0,s._registerNode)(y),n.Factory.addGetterSetter(y,"data"),n.Factory.addGetterSetter(y,"fontFamily","Arial"),n.Factory.addGetterSetter(y,"fontSize",12,(0,o.getNumberValidator)()),n.Factory.addGetterSetter(y,"fontStyle",m),n.Factory.addGetterSetter(y,"align","left"),n.Factory.addGetterSetter(y,"letterSpacing",0,(0,o.getNumberValidator)()),n.Factory.addGetterSetter(y,"textBaseline","middle"),n.Factory.addGetterSetter(y,"fontVariant",m),n.Factory.addGetterSetter(y,"text",c),n.Factory.addGetterSetter(y,"textDecoration",""),n.Factory.addGetterSetter(y,"kerningFunc",void 0),Ff}var zf={},zy;function P9(){if(zy)return zf;zy=1,Object.defineProperty(zf,"__esModule",{value:!0}),zf.Transformer=void 0;const e=Lr(),n=qt(),t=Hr(),r=bn(),a=Sw(),o=Tv(),s=Dt(),c=Vt(),m=Dt(),f="tr-konva",v=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(I=>I+`.${f}`).join(" "),y="nodesRect",E=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],w={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},S="ontouchstart"in s.Konva._global;function x(I,F,k){if(I==="rotater")return k;F+=e.Util.degToRad(w[I]||0);const O=(e.Util.radToDeg(F)%360+360)%360;return e.Util._inRange(O,315+22.5,360)||e.Util._inRange(O,0,22.5)?"ns-resize":e.Util._inRange(O,45-22.5,45+22.5)?"nesw-resize":e.Util._inRange(O,90-22.5,90+22.5)?"ew-resize":e.Util._inRange(O,135-22.5,135+22.5)?"nwse-resize":e.Util._inRange(O,180-22.5,180+22.5)?"ns-resize":e.Util._inRange(O,225-22.5,225+22.5)?"nesw-resize":e.Util._inRange(O,270-22.5,270+22.5)?"ew-resize":e.Util._inRange(O,315-22.5,315+22.5)?"nwse-resize":(e.Util.error("Transformer has unknown angle for cursor detection: "+O),"pointer")}const _=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function b(I){return{x:I.x+I.width/2*Math.cos(I.rotation)+I.height/2*Math.sin(-I.rotation),y:I.y+I.height/2*Math.cos(I.rotation)+I.width/2*Math.sin(I.rotation)}}function g(I,F,k){const O=k.x+(I.x-k.x)*Math.cos(F)-(I.y-k.y)*Math.sin(F),N=k.y+(I.x-k.x)*Math.sin(F)+(I.y-k.y)*Math.cos(F);return{...I,rotation:I.rotation+F,x:O,y:N}}function h(I,F){const k=b(I);return g(I,F,k)}function d(I,F,k){let O=F;for(let N=0;N<I.length;N++){const A=s.Konva.getAngle(I[N]),R=Math.abs(A-F)%(Math.PI*2);Math.min(R,Math.PI*2-R)<k&&(O=A)}return O}let P=0;class M extends o.Group{constructor(F){super(F),this._movingAnchorName=null,this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(v,this.update),this.getNode()&&this.update()}attachTo(F){return this.setNode(F),this}setNode(F){return e.Util.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([F])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return f+this._id}setNodes(F=[]){this._nodes&&this._nodes.length&&this.detach();const k=F.filter(N=>N.isAncestorOf(this)?(e.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=F=k,F.length===1&&this.useSingleNodeRotation()?this.rotation(F[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(N=>{const A=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(N._attrsAffectingSize.length){const R=N._attrsAffectingSize.map(L=>L+"Change."+this._getEventNamespace()).join(" ");N.on(R,A)}N.on(E.map(R=>R+`.${this._getEventNamespace()}`).join(" "),A),N.on(`absoluteTransformChange.${this._getEventNamespace()}`,A),this._proxyDrag(N)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(F){let k;F.on(`dragstart.${this._getEventNamespace()}`,O=>{k=F.getAbsolutePosition(),!this.isDragging()&&F!==this.findOne(".back")&&this.startDrag(O,!1)}),F.on(`dragmove.${this._getEventNamespace()}`,O=>{if(!k)return;const N=F.getAbsolutePosition(),A=N.x-k.x,R=N.y-k.y;this.nodes().forEach(L=>{if(L===F||L.isDragging())return;const V=L.getAbsolutePosition();L.setAbsolutePosition({x:V.x+A,y:V.y+R}),L.startDrag(O)}),k=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(F=>{F.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(y),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(y,this.__getNodeRect)}__getNodeShape(F,k=this.rotation(),O){const N=F.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),A=F.getAbsoluteScale(O),R=F.getAbsolutePosition(O),L=N.x*A.x-F.offsetX()*A.x,V=N.y*A.y-F.offsetY()*A.y,G=(s.Konva.getAngle(F.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),W={x:R.x+L*Math.cos(G)+V*Math.sin(-G),y:R.y+V*Math.cos(G)+L*Math.sin(G),width:N.width*A.x,height:N.height*A.y,rotation:G};return g(W,-s.Konva.getAngle(k),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const k=[];this.nodes().map(G=>{const W=G.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),X=[{x:W.x,y:W.y},{x:W.x+W.width,y:W.y},{x:W.x+W.width,y:W.y+W.height},{x:W.x,y:W.y+W.height}],q=G.getAbsoluteTransform();X.forEach(function(z){const Y=q.point(z);k.push(Y)})});const O=new e.Transform;O.rotate(-s.Konva.getAngle(this.rotation()));let N=1/0,A=1/0,R=-1/0,L=-1/0;k.forEach(function(G){const W=O.point(G);N===void 0&&(N=R=W.x,A=L=W.y),N=Math.min(N,W.x),A=Math.min(A,W.y),R=Math.max(R,W.x),L=Math.max(L,W.y)}),O.invert();const V=O.point({x:N,y:A});return{x:V.x,y:V.y,width:R-N,height:L-A,rotation:s.Konva.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),_.forEach(F=>{this._createAnchor(F)}),this._createAnchor("rotater")}_createAnchor(F){const k=new a.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:F+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:S?10:"auto"}),O=this;k.on("mousedown touchstart",function(N){O._handleMouseDown(N)}),k.on("dragstart",N=>{k.stopDrag(),N.cancelBubble=!0}),k.on("dragend",N=>{N.cancelBubble=!0}),k.on("mouseenter",()=>{const N=s.Konva.getAngle(this.rotation()),A=this.rotateAnchorCursor(),R=x(F,N,A);k.getStage().content&&(k.getStage().content.style.cursor=R),this._cursorChange=!0}),k.on("mouseout",()=>{k.getStage().content&&(k.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(k)}_createBack(){const F=new r.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(k,O){const N=O.getParent(),A=N.padding();k.beginPath(),k.rect(-A,-A,O.width()+A*2,O.height()+A*2),k.moveTo(O.width()/2,-A),N.rotateEnabled()&&N.rotateLineVisible()&&k.lineTo(O.width()/2,-N.rotateAnchorOffset()*e.Util._sign(O.height())-A),k.fillStrokeShape(O)},hitFunc:(k,O)=>{if(!this.shouldOverdrawWholeArea())return;const N=this.padding();k.beginPath(),k.rect(-N,-N,O.width()+N*2,O.height()+N*2),k.fillStrokeShape(O)}});this.add(F),this._proxyDrag(F),F.on("dragstart",k=>{k.cancelBubble=!0}),F.on("dragmove",k=>{k.cancelBubble=!0}),F.on("dragend",k=>{k.cancelBubble=!0}),this.on("dragmove",k=>{this.update()})}_handleMouseDown(F){if(this._transforming)return;this._movingAnchorName=F.target.name().split(" ")[0];const k=this._getNodeRect(),O=k.width,N=k.height,A=Math.sqrt(Math.pow(O,2)+Math.pow(N,2));this.sin=Math.abs(N/A),this.cos=Math.abs(O/A),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;const R=F.target.getAbsolutePosition(),L=F.target.getStage().getPointerPosition();this._anchorDragOffset={x:L.x-R.x,y:L.y-R.y},P++,this._fire("transformstart",{evt:F.evt,target:this.getNode()}),this._nodes.forEach(V=>{V._fire("transformstart",{evt:F.evt,target:V})})}_handleMouseMove(F){let k,O,N;const A=this.findOne("."+this._movingAnchorName),R=A.getStage();R.setPointersPositions(F);const L=R.getPointerPosition();let V={x:L.x-this._anchorDragOffset.x,y:L.y-this._anchorDragOffset.y};const G=A.getAbsolutePosition();this.anchorDragBoundFunc()&&(V=this.anchorDragBoundFunc()(G,V,F)),A.setAbsolutePosition(V);const W=A.getAbsolutePosition();if(G.x===W.x&&G.y===W.y)return;if(this._movingAnchorName==="rotater"){const ne=this._getNodeRect();k=A.x()-ne.width/2,O=-A.y()+ne.height/2;let ae=Math.atan2(-O,k)+Math.PI/2;ne.height<0&&(ae-=Math.PI);const fe=s.Konva.getAngle(this.rotation())+ae,pe=s.Konva.getAngle(this.rotationSnapTolerance()),we=d(this.rotationSnaps(),fe,pe)-ne.rotation,je=h(ne,we);this._fitNodesInto(je,F);return}const X=this.shiftBehavior();let q;X==="inverted"?q=this.keepRatio()&&!F.shiftKey:X==="none"?q=this.keepRatio():q=this.keepRatio()||F.shiftKey;var te=this.centeredScaling()||F.altKey;if(this._movingAnchorName==="top-left"){if(q){var z=te?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};N=Math.sqrt(Math.pow(z.x-A.x(),2)+Math.pow(z.y-A.y(),2));var Y=this.findOne(".top-left").x()>z.x?-1:1,U=this.findOne(".top-left").y()>z.y?-1:1;k=N*this.cos*Y,O=N*this.sin*U,this.findOne(".top-left").x(z.x-k),this.findOne(".top-left").y(z.y-O)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(A.y());else if(this._movingAnchorName==="top-right"){if(q){var z=te?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};N=Math.sqrt(Math.pow(A.x()-z.x,2)+Math.pow(z.y-A.y(),2));var Y=this.findOne(".top-right").x()<z.x?-1:1,U=this.findOne(".top-right").y()>z.y?-1:1;k=N*this.cos*Y,O=N*this.sin*U,this.findOne(".top-right").x(z.x+k),this.findOne(".top-right").y(z.y-O)}var ee=A.position();this.findOne(".top-left").y(ee.y),this.findOne(".bottom-right").x(ee.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(A.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(A.x());else if(this._movingAnchorName==="bottom-left"){if(q){var z=te?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};N=Math.sqrt(Math.pow(z.x-A.x(),2)+Math.pow(A.y()-z.y,2));var Y=z.x<A.x()?-1:1,U=A.y()<z.y?-1:1;k=N*this.cos*Y,O=N*this.sin*U,A.x(z.x-k),A.y(z.y+O)}ee=A.position(),this.findOne(".top-left").x(ee.x),this.findOne(".bottom-right").y(ee.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(A.y());else if(this._movingAnchorName==="bottom-right"){if(q){var z=te?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};N=Math.sqrt(Math.pow(A.x()-z.x,2)+Math.pow(A.y()-z.y,2));var Y=this.findOne(".bottom-right").x()<z.x?-1:1,U=this.findOne(".bottom-right").y()<z.y?-1:1;k=N*this.cos*Y,O=N*this.sin*U,this.findOne(".bottom-right").x(z.x+k),this.findOne(".bottom-right").y(z.y+O)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var te=this.centeredScaling()||F.altKey;if(te){const ne=this.findOne(".top-left"),ae=this.findOne(".bottom-right"),ue=ne.x(),fe=ne.y(),pe=this.getWidth()-ae.x(),ye=this.getHeight()-ae.y();ae.move({x:-ue,y:-fe}),ne.move({x:pe,y:ye})}const Q=this.findOne(".top-left").getAbsolutePosition();k=Q.x,O=Q.y;const Z=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),re=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:k,y:O,width:Z,height:re,rotation:s.Konva.getAngle(this.rotation())},F)}_handleMouseUp(F){this._removeEvents(F)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(F){var k;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));const O=this.getNode();P--,this._fire("transformend",{evt:F,target:O}),(k=this.getLayer())===null||k===void 0||k.batchDraw(),O&&this._nodes.forEach(N=>{var A;N._fire("transformend",{evt:F,target:N}),(A=N.getLayer())===null||A===void 0||A.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(F,k){const O=this._getNodeRect(),N=1;if(e.Util._inRange(F.width,-this.padding()*2-N,N)){this.update();return}if(e.Util._inRange(F.height,-this.padding()*2-N,N)){this.update();return}const A=new e.Transform;if(A.rotate(s.Konva.getAngle(this.rotation())),this._movingAnchorName&&F.width<0&&this._movingAnchorName.indexOf("left")>=0){const q=A.point({x:-this.padding()*2,y:0});F.x+=q.x,F.y+=q.y,F.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=q.x,this._anchorDragOffset.y-=q.y}else if(this._movingAnchorName&&F.width<0&&this._movingAnchorName.indexOf("right")>=0){const q=A.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=q.x,this._anchorDragOffset.y-=q.y,F.width+=this.padding()*2}if(this._movingAnchorName&&F.height<0&&this._movingAnchorName.indexOf("top")>=0){const q=A.point({x:0,y:-this.padding()*2});F.x+=q.x,F.y+=q.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=q.x,this._anchorDragOffset.y-=q.y,F.height+=this.padding()*2}else if(this._movingAnchorName&&F.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const q=A.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=q.x,this._anchorDragOffset.y-=q.y,F.height+=this.padding()*2}if(this.boundBoxFunc()){const q=this.boundBoxFunc()(O,F);q?F=q:e.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const R=1e7,L=new e.Transform;L.translate(O.x,O.y),L.rotate(O.rotation),L.scale(O.width/R,O.height/R);const V=new e.Transform,G=F.width/R,W=F.height/R;this.flipEnabled()===!1?(V.translate(F.x,F.y),V.rotate(F.rotation),V.translate(F.width<0?F.width:0,F.height<0?F.height:0),V.scale(Math.abs(G),Math.abs(W))):(V.translate(F.x,F.y),V.rotate(F.rotation),V.scale(G,W));const X=V.multiply(L.invert());this._nodes.forEach(q=>{var z;const Y=q.getParent().getAbsoluteTransform(),U=q.getTransform().copy();U.translate(q.offsetX(),q.offsetY());const ee=new e.Transform;ee.multiply(Y.copy().invert()).multiply(X).multiply(Y).multiply(U);const te=ee.decompose();q.setAttrs(te),(z=q.getLayer())===null||z===void 0||z.batchDraw()}),this.rotation(e.Util._getRotation(F.rotation)),this._nodes.forEach(q=>{this._fire("transform",{evt:k,target:q}),q._fire("transform",{evt:k,target:q})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(F,k){this.findOne(F).setAttrs(k)}update(){var F;const k=this._getNodeRect();this.rotation(e.Util._getRotation(k.rotation));const O=k.width,N=k.height,A=this.enabledAnchors(),R=this.resizeEnabled(),L=this.padding(),V=this.anchorSize(),G=this.find("._anchor");G.forEach(X=>{X.setAttrs({width:V,height:V,offsetX:V/2,offsetY:V/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:V/2+L,offsetY:V/2+L,visible:R&&A.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:O/2,y:0,offsetY:V/2+L,visible:R&&A.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:O,y:0,offsetX:V/2-L,offsetY:V/2+L,visible:R&&A.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:N/2,offsetX:V/2+L,visible:R&&A.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:O,y:N/2,offsetX:V/2-L,visible:R&&A.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:N,offsetX:V/2+L,offsetY:V/2-L,visible:R&&A.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:O/2,y:N,offsetY:V/2-L,visible:R&&A.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:O,y:N,offsetX:V/2-L,offsetY:V/2-L,visible:R&&A.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:O/2,y:-this.rotateAnchorOffset()*e.Util._sign(N)-L,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:O,height:N,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const W=this.anchorStyleFunc();W&&G.forEach(X=>{W(X)}),(F=this.getLayer())===null||F===void 0||F.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const F=this.findOne("."+this._movingAnchorName);F&&F.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),o.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return t.Node.prototype.toObject.call(this)}clone(F){return t.Node.prototype.clone.call(this,F)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}zf.Transformer=M,M.isTransforming=()=>P>0;function T(I){return I instanceof Array||e.Util.warn("enabledAnchors value should be an array"),I instanceof Array&&I.forEach(function(F){_.indexOf(F)===-1&&e.Util.warn("Unknown anchor name: "+F+". Available names are: "+_.join(", "))}),I||[]}return M.prototype.className="Transformer",(0,m._registerNode)(M),n.Factory.addGetterSetter(M,"enabledAnchors",_,T),n.Factory.addGetterSetter(M,"flipEnabled",!0,(0,c.getBooleanValidator)()),n.Factory.addGetterSetter(M,"resizeEnabled",!0),n.Factory.addGetterSetter(M,"anchorSize",10,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(M,"rotateEnabled",!0),n.Factory.addGetterSetter(M,"rotateLineVisible",!0),n.Factory.addGetterSetter(M,"rotationSnaps",[]),n.Factory.addGetterSetter(M,"rotateAnchorOffset",50,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(M,"rotateAnchorCursor","crosshair"),n.Factory.addGetterSetter(M,"rotationSnapTolerance",5,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(M,"borderEnabled",!0),n.Factory.addGetterSetter(M,"anchorStroke","rgb(0, 161, 255)"),n.Factory.addGetterSetter(M,"anchorStrokeWidth",1,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(M,"anchorFill","white"),n.Factory.addGetterSetter(M,"anchorCornerRadius",0,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(M,"borderStroke","rgb(0, 161, 255)"),n.Factory.addGetterSetter(M,"borderStrokeWidth",1,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(M,"borderDash"),n.Factory.addGetterSetter(M,"keepRatio",!0),n.Factory.addGetterSetter(M,"shiftBehavior","default"),n.Factory.addGetterSetter(M,"centeredScaling",!1),n.Factory.addGetterSetter(M,"ignoreStroke",!1),n.Factory.addGetterSetter(M,"padding",0,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(M,"nodes"),n.Factory.addGetterSetter(M,"node"),n.Factory.addGetterSetter(M,"boundBoxFunc"),n.Factory.addGetterSetter(M,"anchorDragBoundFunc"),n.Factory.addGetterSetter(M,"anchorStyleFunc"),n.Factory.addGetterSetter(M,"shouldOverdrawWholeArea",!1),n.Factory.addGetterSetter(M,"useSingleNodeRotation",!0),n.Factory.backCompat(M,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"}),zf}var Bf={},By;function C9(){if(By)return Bf;By=1,Object.defineProperty(Bf,"__esModule",{value:!0}),Bf.Wedge=void 0;const e=qt(),n=bn(),t=Dt(),r=Vt(),a=Dt();class o extends n.Shape{_sceneFunc(c){c.beginPath(),c.arc(0,0,this.radius(),0,t.Konva.getAngle(this.angle()),this.clockwise()),c.lineTo(0,0),c.closePath(),c.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(c){this.radius(c/2)}setHeight(c){this.radius(c/2)}}return Bf.Wedge=o,o.prototype.className="Wedge",o.prototype._centroid=!0,o.prototype._attrsAffectingSize=["radius"],(0,a._registerNode)(o),e.Factory.addGetterSetter(o,"radius",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(o,"angle",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(o,"clockwise",!1),e.Factory.backCompat(o,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"}),Bf}var Uf={},Uy;function k9(){if(Uy)return Uf;Uy=1,Object.defineProperty(Uf,"__esModule",{value:!0}),Uf.Blur=void 0;const e=qt(),n=Hr(),t=Vt();function r(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const a=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],o=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function s(m,f){const v=m.data,y=m.width,E=m.height;let w,S,x,_,b,g,h,d,P,M,T,I,F,k,O,N,A,R,L,V,G,W,X,q;const z=f+f+1,Y=y-1,U=E-1,ee=f+1,te=ee*(ee+1)/2,Q=new r,Z=a[f],re=o[f];let ne=null,ae=Q,ue=null,fe=null;for(x=1;x<z;x++)ae=ae.next=new r,x===ee&&(ne=ae);for(ae.next=Q,h=g=0,S=0;S<E;S++){for(N=A=R=L=d=P=M=T=0,I=ee*(V=v[g]),F=ee*(G=v[g+1]),k=ee*(W=v[g+2]),O=ee*(X=v[g+3]),d+=te*V,P+=te*G,M+=te*W,T+=te*X,ae=Q,x=0;x<ee;x++)ae.r=V,ae.g=G,ae.b=W,ae.a=X,ae=ae.next;for(x=1;x<ee;x++)_=g+((Y<x?Y:x)<<2),d+=(ae.r=V=v[_])*(q=ee-x),P+=(ae.g=G=v[_+1])*q,M+=(ae.b=W=v[_+2])*q,T+=(ae.a=X=v[_+3])*q,N+=V,A+=G,R+=W,L+=X,ae=ae.next;for(ue=Q,fe=ne,w=0;w<y;w++)v[g+3]=X=T*Z>>re,X!==0?(X=255/X,v[g]=(d*Z>>re)*X,v[g+1]=(P*Z>>re)*X,v[g+2]=(M*Z>>re)*X):v[g]=v[g+1]=v[g+2]=0,d-=I,P-=F,M-=k,T-=O,I-=ue.r,F-=ue.g,k-=ue.b,O-=ue.a,_=h+((_=w+f+1)<Y?_:Y)<<2,N+=ue.r=v[_],A+=ue.g=v[_+1],R+=ue.b=v[_+2],L+=ue.a=v[_+3],d+=N,P+=A,M+=R,T+=L,ue=ue.next,I+=V=fe.r,F+=G=fe.g,k+=W=fe.b,O+=X=fe.a,N-=V,A-=G,R-=W,L-=X,fe=fe.next,g+=4;h+=y}for(w=0;w<y;w++){for(A=R=L=N=P=M=T=d=0,g=w<<2,I=ee*(V=v[g]),F=ee*(G=v[g+1]),k=ee*(W=v[g+2]),O=ee*(X=v[g+3]),d+=te*V,P+=te*G,M+=te*W,T+=te*X,ae=Q,x=0;x<ee;x++)ae.r=V,ae.g=G,ae.b=W,ae.a=X,ae=ae.next;for(b=y,x=1;x<=f;x++)g=b+w<<2,d+=(ae.r=V=v[g])*(q=ee-x),P+=(ae.g=G=v[g+1])*q,M+=(ae.b=W=v[g+2])*q,T+=(ae.a=X=v[g+3])*q,N+=V,A+=G,R+=W,L+=X,ae=ae.next,x<U&&(b+=y);for(g=w,ue=Q,fe=ne,S=0;S<E;S++)_=g<<2,v[_+3]=X=T*Z>>re,X>0?(X=255/X,v[_]=(d*Z>>re)*X,v[_+1]=(P*Z>>re)*X,v[_+2]=(M*Z>>re)*X):v[_]=v[_+1]=v[_+2]=0,d-=I,P-=F,M-=k,T-=O,I-=ue.r,F-=ue.g,k-=ue.b,O-=ue.a,_=w+((_=S+ee)<U?_:U)*y<<2,d+=N+=ue.r=v[_],P+=A+=ue.g=v[_+1],M+=R+=ue.b=v[_+2],T+=L+=ue.a=v[_+3],ue=ue.next,I+=V=fe.r,F+=G=fe.g,k+=W=fe.b,O+=X=fe.a,N-=V,A-=G,R-=W,L-=X,fe=fe.next,g+=y}}const c=function(f){const v=Math.round(this.blurRadius());v>0&&s(f,v)};return Uf.Blur=c,e.Factory.addGetterSetter(n.Node,"blurRadius",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Uf}var qf={},qy;function A9(){if(qy)return qf;qy=1,Object.defineProperty(qf,"__esModule",{value:!0}),qf.Brighten=void 0;const e=qt(),n=Hr(),t=Vt(),r=function(a){const o=this.brightness()*255,s=a.data,c=s.length;for(let m=0;m<c;m+=4)s[m]+=o,s[m+1]+=o,s[m+2]+=o};return qf.Brighten=r,e.Factory.addGetterSetter(n.Node,"brightness",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),qf}var Hf={},Hy;function T9(){if(Hy)return Hf;Hy=1,Object.defineProperty(Hf,"__esModule",{value:!0}),Hf.Contrast=void 0;const e=qt(),n=Hr(),t=Vt(),r=function(a){const o=Math.pow((this.contrast()+100)/100,2),s=a.data,c=s.length;let m=150,f=150,v=150;for(let y=0;y<c;y+=4)m=s[y],f=s[y+1],v=s[y+2],m/=255,m-=.5,m*=o,m+=.5,m*=255,f/=255,f-=.5,f*=o,f+=.5,f*=255,v/=255,v-=.5,v*=o,v+=.5,v*=255,m=m<0?0:m>255?255:m,f=f<0?0:f>255?255:f,v=v<0?0:v>255?255:v,s[y]=m,s[y+1]=f,s[y+2]=v};return Hf.Contrast=r,e.Factory.addGetterSetter(n.Node,"contrast",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Hf}var Gf={},Gy;function R9(){if(Gy)return Gf;Gy=1,Object.defineProperty(Gf,"__esModule",{value:!0}),Gf.Emboss=void 0;const e=qt(),n=Hr(),t=Lr(),r=Vt(),a=function(o){const s=this.embossStrength()*10,c=this.embossWhiteLevel()*255,m=this.embossDirection(),f=this.embossBlend(),v=o.data,y=o.width,E=o.height,w=y*4;let S=0,x=0,_=E;switch(m){case"top-left":S=-1,x=-1;break;case"top":S=-1,x=0;break;case"top-right":S=-1,x=1;break;case"right":S=0,x=1;break;case"bottom-right":S=1,x=1;break;case"bottom":S=1,x=0;break;case"bottom-left":S=1,x=-1;break;case"left":S=0,x=-1;break;default:t.Util.error("Unknown emboss direction: "+m)}do{const b=(_-1)*w;let g=S;_+g<1&&(g=0),_+g>E&&(g=0);const h=(_-1+g)*y*4;let d=y;do{const P=b+(d-1)*4;let M=x;d+M<1&&(M=0),d+M>y&&(M=0);const T=h+(d-1+M)*4,I=v[P]-v[T],F=v[P+1]-v[T+1],k=v[P+2]-v[T+2];let O=I;const N=O>0?O:-O,A=F>0?F:-F,R=k>0?k:-k;if(A>N&&(O=F),R>N&&(O=k),O*=s,f){const L=v[P]+O,V=v[P+1]+O,G=v[P+2]+O;v[P]=L>255?255:L<0?0:L,v[P+1]=V>255?255:V<0?0:V,v[P+2]=G>255?255:G<0?0:G}else{let L=c-O;L<0?L=0:L>255&&(L=255),v[P]=v[P+1]=v[P+2]=L}}while(--d)}while(--_)};return Gf.Emboss=a,e.Factory.addGetterSetter(n.Node,"embossStrength",.5,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"embossWhiteLevel",.5,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"embossDirection","top-left",void 0,e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"embossBlend",!1,void 0,e.Factory.afterSetFilter),Gf}var Vf={},Vy;function M9(){if(Vy)return Vf;Vy=1,Object.defineProperty(Vf,"__esModule",{value:!0}),Vf.Enhance=void 0;const e=qt(),n=Hr(),t=Vt();function r(o,s,c,m,f){const v=c-s,y=f-m;if(v===0)return m+y/2;if(y===0)return m;let E=(o-s)/v;return E=y*E+m,E}const a=function(o){const s=o.data,c=s.length;let m=s[0],f=m,v,y=s[1],E=y,w,S=s[2],x=S,_;const b=this.enhance();if(b===0)return;for(let O=0;O<c;O+=4)v=s[O+0],v<m?m=v:v>f&&(f=v),w=s[O+1],w<y?y=w:w>E&&(E=w),_=s[O+2],_<S?S=_:_>x&&(x=_);f===m&&(f=255,m=0),E===y&&(E=255,y=0),x===S&&(x=255,S=0);let g,h,d,P,M,T,I,F,k;b>0?(h=f+b*(255-f),d=m-b*(m-0),M=E+b*(255-E),T=y-b*(y-0),F=x+b*(255-x),k=S-b*(S-0)):(g=(f+m)*.5,h=f+b*(f-g),d=m+b*(m-g),P=(E+y)*.5,M=E+b*(E-P),T=y+b*(y-P),I=(x+S)*.5,F=x+b*(x-I),k=S+b*(S-I));for(let O=0;O<c;O+=4)s[O+0]=r(s[O+0],m,f,d,h),s[O+1]=r(s[O+1],y,E,T,M),s[O+2]=r(s[O+2],S,x,k,F)};return Vf.Enhance=a,e.Factory.addGetterSetter(n.Node,"enhance",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Vf}var $f={},$y;function L9(){if($y)return $f;$y=1,Object.defineProperty($f,"__esModule",{value:!0}),$f.Grayscale=void 0;const e=function(n){const t=n.data,r=t.length;for(let a=0;a<r;a+=4){const o=.34*t[a]+.5*t[a+1]+.16*t[a+2];t[a]=o,t[a+1]=o,t[a+2]=o}};return $f.Grayscale=e,$f}var Wf={},Wy;function N9(){if(Wy)return Wf;Wy=1,Object.defineProperty(Wf,"__esModule",{value:!0}),Wf.HSL=void 0;const e=qt(),n=Hr(),t=Vt();e.Factory.addGetterSetter(n.Node,"hue",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"saturation",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"luminance",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter);const r=function(a){const o=a.data,s=o.length,c=1,m=Math.pow(2,this.saturation()),f=Math.abs(this.hue()+360)%360,v=this.luminance()*127,y=c*m*Math.cos(f*Math.PI/180),E=c*m*Math.sin(f*Math.PI/180),w=.299*c+.701*y+.167*E,S=.587*c-.587*y+.33*E,x=.114*c-.114*y-.497*E,_=.299*c-.299*y-.328*E,b=.587*c+.413*y+.035*E,g=.114*c-.114*y+.293*E,h=.299*c-.3*y+1.25*E,d=.587*c-.586*y-1.05*E,P=.114*c+.886*y-.2*E;let M,T,I,F;for(let k=0;k<s;k+=4)M=o[k+0],T=o[k+1],I=o[k+2],F=o[k+3],o[k+0]=w*M+S*T+x*I+v,o[k+1]=_*M+b*T+g*I+v,o[k+2]=h*M+d*T+P*I+v,o[k+3]=F};return Wf.HSL=r,Wf}var Yf={},Yy;function I9(){if(Yy)return Yf;Yy=1,Object.defineProperty(Yf,"__esModule",{value:!0}),Yf.HSV=void 0;const e=qt(),n=Hr(),t=Vt(),r=function(a){const o=a.data,s=o.length,c=Math.pow(2,this.value()),m=Math.pow(2,this.saturation()),f=Math.abs(this.hue()+360)%360,v=c*m*Math.cos(f*Math.PI/180),y=c*m*Math.sin(f*Math.PI/180),E=.299*c+.701*v+.167*y,w=.587*c-.587*v+.33*y,S=.114*c-.114*v-.497*y,x=.299*c-.299*v-.328*y,_=.587*c+.413*v+.035*y,b=.114*c-.114*v+.293*y,g=.299*c-.3*v+1.25*y,h=.587*c-.586*v-1.05*y,d=.114*c+.886*v-.2*y;let P,M,T,I;for(let F=0;F<s;F+=4)P=o[F+0],M=o[F+1],T=o[F+2],I=o[F+3],o[F+0]=E*P+w*M+S*T,o[F+1]=x*P+_*M+b*T,o[F+2]=g*P+h*M+d*T,o[F+3]=I};return Yf.HSV=r,e.Factory.addGetterSetter(n.Node,"hue",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"saturation",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"value",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Yf}var Kf={},Ky;function j9(){if(Ky)return Kf;Ky=1,Object.defineProperty(Kf,"__esModule",{value:!0}),Kf.Invert=void 0;const e=function(n){const t=n.data,r=t.length;for(let a=0;a<r;a+=4)t[a]=255-t[a],t[a+1]=255-t[a+1],t[a+2]=255-t[a+2]};return Kf.Invert=e,Kf}var Xf={},Xy;function D9(){if(Xy)return Xf;Xy=1,Object.defineProperty(Xf,"__esModule",{value:!0}),Xf.Kaleidoscope=void 0;const e=qt(),n=Hr(),t=Lr(),r=Vt(),a=function(c,m,f){const v=c.data,y=m.data,E=c.width,w=c.height,S=f.polarCenterX||E/2,x=f.polarCenterY||w/2;let _=Math.sqrt(S*S+x*x),b=E-S,g=w-x;const h=Math.sqrt(b*b+g*g);_=h>_?h:_;const d=w,P=E,M=360/P*Math.PI/180;for(let T=0;T<P;T+=1){const I=Math.sin(T*M),F=Math.cos(T*M);for(let k=0;k<d;k+=1){b=Math.floor(S+_*k/d*F),g=Math.floor(x+_*k/d*I);let O=(g*E+b)*4;const N=v[O+0],A=v[O+1],R=v[O+2],L=v[O+3];O=(T+k*E)*4,y[O+0]=N,y[O+1]=A,y[O+2]=R,y[O+3]=L}}},o=function(c,m,f){const v=c.data,y=m.data,E=c.width,w=c.height,S=f.polarCenterX||E/2,x=f.polarCenterY||w/2;let _=Math.sqrt(S*S+x*x),b=E-S,g=w-x;const h=Math.sqrt(b*b+g*g);_=h>_?h:_;const d=w,P=E,M=0;let T,I;for(b=0;b<E;b+=1)for(g=0;g<w;g+=1){const F=b-S,k=g-x,O=Math.sqrt(F*F+k*k)*d/_;let N=(Math.atan2(k,F)*180/Math.PI+360+M)%360;N=N*P/360,T=Math.floor(N),I=Math.floor(O);let A=(I*E+T)*4;const R=v[A+0],L=v[A+1],V=v[A+2],G=v[A+3];A=(g*E+b)*4,y[A+0]=R,y[A+1]=L,y[A+2]=V,y[A+3]=G}},s=function(c){const m=c.width,f=c.height;let v,y,E,w,S,x,_,b,g,h,d=Math.round(this.kaleidoscopePower());const P=Math.round(this.kaleidoscopeAngle()),M=Math.floor(m*(P%360)/360);if(d<1)return;const T=t.Util.createCanvasElement();T.width=m,T.height=f;const I=T.getContext("2d").getImageData(0,0,m,f);t.Util.releaseCanvas(T),a(c,I,{polarCenterX:m/2,polarCenterY:f/2});let F=m/Math.pow(2,d);for(;F<=8;)F=F*2,d-=1;F=Math.ceil(F);let k=F,O=0,N=k,A=1;for(M+F>m&&(O=k,N=0,A=-1),y=0;y<f;y+=1)for(v=O;v!==N;v+=A)E=Math.round(v+M)%m,g=(m*y+E)*4,S=I.data[g+0],x=I.data[g+1],_=I.data[g+2],b=I.data[g+3],h=(m*y+v)*4,I.data[h+0]=S,I.data[h+1]=x,I.data[h+2]=_,I.data[h+3]=b;for(y=0;y<f;y+=1)for(k=Math.floor(F),w=0;w<d;w+=1){for(v=0;v<k+1;v+=1)g=(m*y+v)*4,S=I.data[g+0],x=I.data[g+1],_=I.data[g+2],b=I.data[g+3],h=(m*y+k*2-v-1)*4,I.data[h+0]=S,I.data[h+1]=x,I.data[h+2]=_,I.data[h+3]=b;k*=2}o(I,c,{})};return Xf.Kaleidoscope=s,e.Factory.addGetterSetter(n.Node,"kaleidoscopePower",2,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"kaleidoscopeAngle",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),Xf}var Zf={},Zy;function F9(){if(Zy)return Zf;Zy=1,Object.defineProperty(Zf,"__esModule",{value:!0}),Zf.Mask=void 0;const e=qt(),n=Hr(),t=Vt();function r(E,w,S){let x=(S*E.width+w)*4;const _=[];return _.push(E.data[x++],E.data[x++],E.data[x++],E.data[x++]),_}function a(E,w){return Math.sqrt(Math.pow(E[0]-w[0],2)+Math.pow(E[1]-w[1],2)+Math.pow(E[2]-w[2],2))}function o(E){const w=[0,0,0];for(let S=0;S<E.length;S++)w[0]+=E[S][0],w[1]+=E[S][1],w[2]+=E[S][2];return w[0]/=E.length,w[1]/=E.length,w[2]/=E.length,w}function s(E,w){const S=r(E,0,0),x=r(E,E.width-1,0),_=r(E,0,E.height-1),b=r(E,E.width-1,E.height-1),g=w||10;if(a(S,x)<g&&a(x,b)<g&&a(b,_)<g&&a(_,S)<g){const h=o([x,S,b,_]),d=[];for(let P=0;P<E.width*E.height;P++){const M=a(h,[E.data[P*4],E.data[P*4+1],E.data[P*4+2]]);d[P]=M<g?0:255}return d}}function c(E,w){for(let S=0;S<E.width*E.height;S++)E.data[4*S+3]=w[S]}function m(E,w,S){const x=[1,1,1,1,0,1,1,1,1],_=Math.round(Math.sqrt(x.length)),b=Math.floor(_/2),g=[];for(let h=0;h<S;h++)for(let d=0;d<w;d++){const P=h*w+d;let M=0;for(let T=0;T<_;T++)for(let I=0;I<_;I++){const F=h+T-b,k=d+I-b;if(F>=0&&F<S&&k>=0&&k<w){const O=F*w+k,N=x[T*_+I];M+=E[O]*N}}g[P]=M===255*8?255:0}return g}function f(E,w,S){const x=[1,1,1,1,1,1,1,1,1],_=Math.round(Math.sqrt(x.length)),b=Math.floor(_/2),g=[];for(let h=0;h<S;h++)for(let d=0;d<w;d++){const P=h*w+d;let M=0;for(let T=0;T<_;T++)for(let I=0;I<_;I++){const F=h+T-b,k=d+I-b;if(F>=0&&F<S&&k>=0&&k<w){const O=F*w+k,N=x[T*_+I];M+=E[O]*N}}g[P]=M>=255*4?255:0}return g}function v(E,w,S){const x=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],_=Math.round(Math.sqrt(x.length)),b=Math.floor(_/2),g=[];for(let h=0;h<S;h++)for(let d=0;d<w;d++){const P=h*w+d;let M=0;for(let T=0;T<_;T++)for(let I=0;I<_;I++){const F=h+T-b,k=d+I-b;if(F>=0&&F<S&&k>=0&&k<w){const O=F*w+k,N=x[T*_+I];M+=E[O]*N}}g[P]=M}return g}const y=function(E){const w=this.threshold();let S=s(E,w);return S&&(S=m(S,E.width,E.height),S=f(S,E.width,E.height),S=v(S,E.width,E.height),c(E,S)),E};return Zf.Mask=y,e.Factory.addGetterSetter(n.Node,"threshold",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Zf}var Qf={},Qy;function z9(){if(Qy)return Qf;Qy=1,Object.defineProperty(Qf,"__esModule",{value:!0}),Qf.Noise=void 0;const e=qt(),n=Hr(),t=Vt(),r=function(a){const o=this.noise()*255,s=a.data,c=s.length,m=o/2;for(let f=0;f<c;f+=4)s[f+0]+=m-2*m*Math.random(),s[f+1]+=m-2*m*Math.random(),s[f+2]+=m-2*m*Math.random()};return Qf.Noise=r,e.Factory.addGetterSetter(n.Node,"noise",.2,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Qf}var Jf={},Jy;function B9(){if(Jy)return Jf;Jy=1,Object.defineProperty(Jf,"__esModule",{value:!0}),Jf.Pixelate=void 0;const e=qt(),n=Lr(),t=Hr(),r=Vt(),a=function(o){let s=Math.ceil(this.pixelSize()),c=o.width,m=o.height,f,v,y,E,w,S,x,_=Math.ceil(c/s),b=Math.ceil(m/s),g,h,d,P,M,T,I,F=o.data;if(s<=0){n.Util.error("pixelSize value can not be <= 0");return}for(M=0;M<_;M+=1)for(T=0;T<b;T+=1){for(E=0,w=0,S=0,x=0,g=M*s,h=g+s,d=T*s,P=d+s,I=0,f=g;f<h;f+=1)if(!(f>=c))for(v=d;v<P;v+=1)v>=m||(y=(c*v+f)*4,E+=F[y+0],w+=F[y+1],S+=F[y+2],x+=F[y+3],I+=1);for(E=E/I,w=w/I,S=S/I,x=x/I,f=g;f<h;f+=1)if(!(f>=c))for(v=d;v<P;v+=1)v>=m||(y=(c*v+f)*4,F[y+0]=E,F[y+1]=w,F[y+2]=S,F[y+3]=x)}};return Jf.Pixelate=a,e.Factory.addGetterSetter(t.Node,"pixelSize",8,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),Jf}var ed={},e2;function U9(){if(e2)return ed;e2=1,Object.defineProperty(ed,"__esModule",{value:!0}),ed.Posterize=void 0;const e=qt(),n=Hr(),t=Vt(),r=function(a){const o=Math.round(this.levels()*254)+1,s=a.data,c=s.length,m=255/o;for(let f=0;f<c;f+=1)s[f]=Math.floor(s[f]/m)*m};return ed.Posterize=r,e.Factory.addGetterSetter(n.Node,"levels",.5,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),ed}var td={},t2;function q9(){if(t2)return td;t2=1,Object.defineProperty(td,"__esModule",{value:!0}),td.RGB=void 0;const e=qt(),n=Hr(),t=Vt(),r=function(a){const o=a.data,s=o.length,c=this.red(),m=this.green(),f=this.blue();for(let v=0;v<s;v+=4){const y=(.34*o[v]+.5*o[v+1]+.16*o[v+2])/255;o[v]=y*c,o[v+1]=y*m,o[v+2]=y*f,o[v+3]=o[v+3]}};return td.RGB=r,e.Factory.addGetterSetter(n.Node,"red",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(n.Node,"green",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(n.Node,"blue",0,t.RGBComponent,e.Factory.afterSetFilter),td}var rd={},r2;function H9(){if(r2)return rd;r2=1,Object.defineProperty(rd,"__esModule",{value:!0}),rd.RGBA=void 0;const e=qt(),n=Hr(),t=Vt(),r=function(a){const o=a.data,s=o.length,c=this.red(),m=this.green(),f=this.blue(),v=this.alpha();for(let y=0;y<s;y+=4){const E=1-v;o[y]=c*v+o[y]*E,o[y+1]=m*v+o[y+1]*E,o[y+2]=f*v+o[y+2]*E}};return rd.RGBA=r,e.Factory.addGetterSetter(n.Node,"red",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(n.Node,"green",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(n.Node,"blue",0,t.RGBComponent,e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"alpha",1,function(a){return this._filterUpToDate=!1,a>1?1:a<0?0:a}),rd}var nd={},n2;function G9(){if(n2)return nd;n2=1,Object.defineProperty(nd,"__esModule",{value:!0}),nd.Sepia=void 0;const e=function(n){const t=n.data,r=t.length;for(let a=0;a<r;a+=4){const o=t[a+0],s=t[a+1],c=t[a+2];t[a+0]=Math.min(255,o*.393+s*.769+c*.189),t[a+1]=Math.min(255,o*.349+s*.686+c*.168),t[a+2]=Math.min(255,o*.272+s*.534+c*.131)}};return nd.Sepia=e,nd}var id={},i2;function V9(){if(i2)return id;i2=1,Object.defineProperty(id,"__esModule",{value:!0}),id.Solarize=void 0;const e=function(n){const t=n.data,r=n.width,a=n.height,o=r*4;let s=a;do{const c=(s-1)*o;let m=r;do{const f=c+(m-1)*4;let v=t[f],y=t[f+1],E=t[f+2];v>127&&(v=255-v),y>127&&(y=255-y),E>127&&(E=255-E),t[f]=v,t[f+1]=y,t[f+2]=E}while(--m)}while(--s)};return id.Solarize=e,id}var ad={},a2;function $9(){if(a2)return ad;a2=1,Object.defineProperty(ad,"__esModule",{value:!0}),ad.Threshold=void 0;const e=qt(),n=Hr(),t=Vt(),r=function(a){const o=this.threshold()*255,s=a.data,c=s.length;for(let m=0;m<c;m+=1)s[m]=s[m]<o?0:255};return ad.Threshold=r,e.Factory.addGetterSetter(n.Node,"threshold",.5,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),ad}var o2;function W9(){if(o2)return bf;o2=1,Object.defineProperty(bf,"__esModule",{value:!0}),bf.Konva=void 0;const e=nv(),n=p9(),t=v9(),r=m9(),a=y9(),o=b9(),s=w9(),c=_w(),m=Mv(),f=Sw(),v=_9(),y=S9(),E=E9(),w=x9(),S=Ew(),x=O9(),_=P9(),b=C9(),g=k9(),h=A9(),d=T9(),P=R9(),M=M9(),T=L9(),I=N9(),F=I9(),k=j9(),O=D9(),N=F9(),A=z9(),R=B9(),L=U9(),V=q9(),G=H9(),W=G9(),X=V9(),q=$9();return bf.Konva=e.Konva.Util._assign(e.Konva,{Arc:n.Arc,Arrow:t.Arrow,Circle:r.Circle,Ellipse:a.Ellipse,Image:o.Image,Label:s.Label,Tag:s.Tag,Line:c.Line,Path:m.Path,Rect:f.Rect,RegularPolygon:v.RegularPolygon,Ring:y.Ring,Sprite:E.Sprite,Star:w.Star,Text:S.Text,TextPath:x.TextPath,Transformer:_.Transformer,Wedge:b.Wedge,Filters:{Blur:g.Blur,Brighten:h.Brighten,Contrast:d.Contrast,Emboss:P.Emboss,Enhance:M.Enhance,Grayscale:T.Grayscale,HSL:I.HSL,HSV:F.HSV,Invert:k.Invert,Kaleidoscope:O.Kaleidoscope,Mask:N.Mask,Noise:A.Noise,Pixelate:R.Pixelate,Posterize:L.Posterize,RGB:V.RGB,RGBA:G.RGBA,Sepia:W.Sepia,Solarize:X.Solarize,Threshold:q.Threshold}}),bf}var Y9=sp.exports,l2;function Mi(){if(l2)return sp.exports;l2=1,Object.defineProperty(Y9,"__esModule",{value:!0});const e=W9();return sp.exports=e.Konva,sp.exports}Mi();var rp={exports:{}},s2;function K9(){return s2||(s2=1,function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.Konva=void 0;var t=nv();Object.defineProperty(n,"Konva",{enumerable:!0,get:function(){return t.Konva}});const r=nv();e.exports=r.Konva}(rp,rp.exports)),rp.exports}var X9=K9();const Rd=jd(X9);var Xg={exports:{}};/**
44
- * @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 Zg,u2;function Z9(){return u2||(u2=1,Zg=function(n){var t={},r=Or(),a=lv(),o=Object.assign;function s(u){for(var p="https://reactjs.org/docs/error-decoder.html?invariant="+u,j=1;j<arguments.length;j++)p+="&args[]="+encodeURIComponent(arguments[j]);return"Minified React error #"+u+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var c=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,m=Symbol.for("react.element"),f=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),w=Symbol.for("react.provider"),S=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),d=Symbol.for("react.offscreen"),P=Symbol.iterator;function M(u){return u===null||typeof u!="object"?null:(u=P&&u[P]||u["@@iterator"],typeof u=="function"?u:null)}function T(u){if(u==null)return null;if(typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case v:return"Fragment";case f:return"Portal";case E:return"Profiler";case y:return"StrictMode";case _:return"Suspense";case b:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case S:return(u.displayName||"Context")+".Consumer";case w:return(u._context.displayName||"Context")+".Provider";case x:var p=u.render;return u=u.displayName,u||(u=p.displayName||p.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case g:return p=u.displayName||null,p!==null?p:T(u.type)||"Memo";case h:p=u._payload,u=u._init;try{return T(u(p))}catch{}}return null}function I(u){var p=u.type;switch(u.tag){case 24:return"Cache";case 9:return(p.displayName||"Context")+".Consumer";case 10:return(p._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return u=p.render,u=u.displayName||u.name||"",p.displayName||(u!==""?"ForwardRef("+u+")":"ForwardRef");case 7:return"Fragment";case 5:return p;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return T(p);case 8:return p===y?"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 p=="function")return p.displayName||p.name||null;if(typeof p=="string")return p}return null}function F(u){var p=u,j=u;if(u.alternate)for(;p.return;)p=p.return;else{u=p;do p=u,(p.flags&4098)!==0&&(j=p.return),u=p.return;while(u)}return p.tag===3?j:null}function k(u){if(F(u)!==u)throw Error(s(188))}function O(u){var p=u.alternate;if(!p){if(p=F(u),p===null)throw Error(s(188));return p!==u?null:u}for(var j=u,B=p;;){var $=j.return;if($===null)break;var J=$.alternate;if(J===null){if(B=$.return,B!==null){j=B;continue}break}if($.child===J.child){for(J=$.child;J;){if(J===j)return k($),u;if(J===B)return k($),p;J=J.sibling}throw Error(s(188))}if(j.return!==B.return)j=$,B=J;else{for(var le=!1,Ee=$.child;Ee;){if(Ee===j){le=!0,j=$,B=J;break}if(Ee===B){le=!0,B=$,j=J;break}Ee=Ee.sibling}if(!le){for(Ee=J.child;Ee;){if(Ee===j){le=!0,j=J,B=$;break}if(Ee===B){le=!0,B=J,j=$;break}Ee=Ee.sibling}if(!le)throw Error(s(189))}}if(j.alternate!==B)throw Error(s(190))}if(j.tag!==3)throw Error(s(188));return j.stateNode.current===j?u:p}function N(u){return u=O(u),u!==null?A(u):null}function A(u){if(u.tag===5||u.tag===6)return u;for(u=u.child;u!==null;){var p=A(u);if(p!==null)return p;u=u.sibling}return null}function R(u){if(u.tag===5||u.tag===6)return u;for(u=u.child;u!==null;){if(u.tag!==4){var p=R(u);if(p!==null)return p}u=u.sibling}return null}var L=Array.isArray,V=n.getPublicInstance,G=n.getRootHostContext,W=n.getChildHostContext,X=n.prepareForCommit,q=n.resetAfterCommit,z=n.createInstance,Y=n.appendInitialChild,U=n.finalizeInitialChildren,ee=n.prepareUpdate,te=n.shouldSetTextContent,Q=n.createTextInstance,Z=n.scheduleTimeout,re=n.cancelTimeout,ne=n.noTimeout,ae=n.isPrimaryRenderer,ue=n.supportsMutation,fe=n.supportsPersistence,pe=n.supportsHydration,ye=n.getInstanceFromNode,we=n.preparePortalMount,je=n.getCurrentEventPriority,Te=n.detachDeletedInstance,se=n.supportsMicrotasks,_e=n.scheduleMicrotask,he=n.supportsTestSelectors,xe=n.findFiberRoot,oe=n.getBoundingRect,ve=n.getTextContent,de=n.isHiddenSubtree,ke=n.matchAccessibilityRole,Be=n.setFocusIfFocusable,Qe=n.setupIntersectionObserver,Ke=n.appendChild,St=n.appendChildToContainer,Ue=n.commitTextUpdate,rt=n.commitMount,gt=n.commitUpdate,mt=n.insertBefore,kt=n.insertInContainerBefore,jt=n.removeChild,Oe=n.removeChildFromContainer,Se=n.resetTextContent,yt=n.hideInstance,Fe=n.hideTextInstance,qe=n.unhideInstance,$e=n.unhideTextInstance,Et=n.clearContainer,Pt=n.cloneInstance,ht=n.createContainerChildSet,ze=n.appendChildToContainerChildSet,at=n.finalizeContainerChildren,Pe=n.replaceContainerChildren,me=n.cloneHiddenInstance,He=n.cloneHiddenTextInstance,Me=n.canHydrateInstance,Ye=n.canHydrateTextInstance,et=n.canHydrateSuspenseInstance,ut=n.isSuspenseInstancePending,wt=n.isSuspenseInstanceFallback,Ct=n.getSuspenseInstanceFallbackErrorDetails,Jt=n.registerSuspenseInstanceRetry,Wt=n.getNextHydratableSibling,er=n.getFirstHydratableChild,cr=n.getFirstHydratableChildWithinContainer,Jn=n.getFirstHydratableChildWithinSuspenseInstance,Nr=n.hydrateInstance,ei=n.hydrateTextInstance,lo=n.hydrateSuspenseInstance,ka=n.getNextHydratableInstanceAfterSuspenseInstance,ti=n.commitHydratedContainer,Li=n.commitHydratedSuspenseInstance,Qs=n.clearSuspenseBoundary,rs=n.clearSuspenseBoundaryFromContainer,Kp=n.shouldDeleteUnhydratedTailInstances,Xp=n.didNotMatchHydratedContainerTextInstance,Pr=n.didNotMatchHydratedTextInstance,Oc;function so(u){if(Oc===void 0)try{throw Error()}catch(j){var p=j.stack.trim().match(/\n( *(at )?)/);Oc=p&&p[1]||""}return`
52
- `+Oc+u}var Js=!1;function Qo(u,p){if(!u||Js)return"";Js=!0;var j=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(p)if(p=function(){throw Error()},Object.defineProperty(p.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(p,[])}catch(Xe){var B=Xe}Reflect.construct(u,[],p)}else{try{p.call()}catch(Xe){B=Xe}u.call(p.prototype)}else{try{throw Error()}catch(Xe){B=Xe}u()}}catch(Xe){if(Xe&&B&&typeof Xe.stack=="string"){for(var $=Xe.stack.split(`
53
- `),J=B.stack.split(`
54
- `),le=$.length-1,Ee=J.length-1;1<=le&&0<=Ee&&$[le]!==J[Ee];)Ee--;for(;1<=le&&0<=Ee;le--,Ee--)if($[le]!==J[Ee]){if(le!==1||Ee!==1)do if(le--,Ee--,0>Ee||$[le]!==J[Ee]){var Ie=`
55
- `+$[le].replace(" at new "," at ");return u.displayName&&Ie.includes("<anonymous>")&&(Ie=Ie.replace("<anonymous>",u.displayName)),Ie}while(1<=le&&0<=Ee);break}}}finally{Js=!1,Error.prepareStackTrace=j}return(u=u?u.displayName||u.name:"")?so(u):""}var Zp=Object.prototype.hasOwnProperty,eu=[],Qi=-1;function Zr(u){return{current:u}}function fr(u){0>Qi||(u.current=eu[Qi],eu[Qi]=null,Qi--)}function Ft(u,p){Qi++,eu[Qi]=u.current,u.current=p}var Aa={},un=Zr(Aa),Mn=Zr(!1),Ni=Aa;function Ji(u,p){var j=u.type.contextTypes;if(!j)return Aa;var B=u.stateNode;if(B&&B.__reactInternalMemoizedUnmaskedChildContext===p)return B.__reactInternalMemoizedMaskedChildContext;var $={},J;for(J in j)$[J]=p[J];return B&&(u=u.stateNode,u.__reactInternalMemoizedUnmaskedChildContext=p,u.__reactInternalMemoizedMaskedChildContext=$),$}function Gr(u){return u=u.childContextTypes,u!=null}function uo(){fr(Mn),fr(un)}function Kd(u,p,j){if(un.current!==Aa)throw Error(s(168));Ft(un,p),Ft(Mn,j)}function Xd(u,p,j){var B=u.stateNode;if(p=p.childContextTypes,typeof B.getChildContext!="function")return j;B=B.getChildContext();for(var $ in B)if(!($ in p))throw Error(s(108,I(u)||"Unknown",$));return o({},j,B)}function Jo(u){return u=(u=u.stateNode)&&u.__reactInternalMemoizedMergedChildContext||Aa,Ni=un.current,Ft(un,u),Ft(Mn,Mn.current),!0}function Pc(u,p,j){var B=u.stateNode;if(!B)throw Error(s(169));j?(u=Xd(u,p,Ni),B.__reactInternalMemoizedMergedChildContext=u,fr(Mn),fr(un),Ft(un,u)):fr(Mn),Ft(Mn,j)}var zn=Math.clz32?Math.clz32:Cc,ns=Math.log,Qp=Math.LN2;function Cc(u){return u>>>=0,u===0?32:31-(ns(u)/Qp|0)|0}var $t=64,is=4194304;function el(u){switch(u&-u){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return u&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return u}}function tl(u,p){var j=u.pendingLanes;if(j===0)return 0;var B=0,$=u.suspendedLanes,J=u.pingedLanes,le=j&268435455;if(le!==0){var Ee=le&~$;Ee!==0?B=el(Ee):(J&=le,J!==0&&(B=el(J)))}else le=j&~$,le!==0?B=el(le):J!==0&&(B=el(J));if(B===0)return 0;if(p!==0&&p!==B&&(p&$)===0&&($=B&-B,J=p&-p,$>=J||$===16&&(J&4194240)!==0))return p;if((B&4)!==0&&(B|=j&16),p=u.entangledLanes,p!==0)for(u=u.entanglements,p&=B;0<p;)j=31-zn(p),$=1<<j,B|=u[j],p&=~$;return B}function Zd(u,p){switch(u){case 1:case 2:case 4:return p+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 p+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 Qd(u,p){for(var j=u.suspendedLanes,B=u.pingedLanes,$=u.expirationTimes,J=u.pendingLanes;0<J;){var le=31-zn(J),Ee=1<<le,Ie=$[le];Ie===-1?((Ee&j)===0||(Ee&B)!==0)&&($[le]=Zd(Ee,p)):Ie<=p&&(u.expiredLanes|=Ee),J&=~Ee}}function tu(u){return u=u.pendingLanes&-1073741825,u!==0?u:u&1073741824?1073741824:0}function ru(){var u=$t;return $t<<=1,($t&4194240)===0&&($t=64),u}function rl(u){for(var p=[],j=0;31>j;j++)p.push(u);return p}function ri(u,p,j){u.pendingLanes|=p,p!==536870912&&(u.suspendedLanes=0,u.pingedLanes=0),u=u.eventTimes,p=31-zn(p),u[p]=j}function Ta(u,p){var j=u.pendingLanes&~p;u.pendingLanes=p,u.suspendedLanes=0,u.pingedLanes=0,u.expiredLanes&=p,u.mutableReadLanes&=p,u.entangledLanes&=p,p=u.entanglements;var B=u.eventTimes;for(u=u.expirationTimes;0<j;){var $=31-zn(j),J=1<<$;p[$]=0,B[$]=-1,u[$]=-1,j&=~J}}function Ii(u,p){var j=u.entangledLanes|=p;for(u=u.entanglements;j;){var B=31-zn(j),$=1<<B;$&p|u[B]&p&&(u[B]|=p),j&=~$}}var zt=0;function nl(u){return u&=-u,1<u?4<u?(u&268435455)!==0?16:536870912:4:1}var ji=a.unstable_scheduleCallback,Jd=a.unstable_cancelCallback,eh=a.unstable_shouldYield,as=a.unstable_requestPaint,Vr=a.unstable_now,nu=a.unstable_ImmediatePriority,iu=a.unstable_UserBlockingPriority,au=a.unstable_NormalPriority,Jp=a.unstable_IdlePriority,Ra=null,Ln=null;function il(u){if(Ln&&typeof Ln.onCommitFiberRoot=="function")try{Ln.onCommitFiberRoot(Ra,u,void 0,(u.current.flags&128)===128)}catch{}}function ou(u,p){return u===p&&(u!==0||1/u===1/p)||u!==u&&p!==p}var mi=typeof Object.is=="function"?Object.is:ou,ea=null,al=!1,ol=!1;function lu(u){ea===null?ea=[u]:ea.push(u)}function th(u){al=!0,lu(u)}function Qr(){if(!ol&&ea!==null){ol=!0;var u=0,p=zt;try{var j=ea;for(zt=1;u<j.length;u++){var B=j[u];do B=B(!0);while(B!==null)}ea=null,al=!1}catch($){throw ea!==null&&(ea=ea.slice(u+1)),ji(nu,Qr),$}finally{zt=p,ol=!1}}return null}var Ma=[],ta=0,os=null,co=0,wn=[],Bn=0,Ir=null,Nn=1,yi="";function bi(u,p){Ma[ta++]=co,Ma[ta++]=os,os=u,co=p}function rh(u,p,j){wn[Bn++]=Nn,wn[Bn++]=yi,wn[Bn++]=Ir,Ir=u;var B=Nn;u=yi;var $=32-zn(B)-1;B&=~(1<<$),j+=1;var J=32-zn(p)+$;if(30<J){var le=$-$%5;J=(B&(1<<le)-1).toString(32),B>>=le,$-=le,Nn=1<<32-zn(p)+$|j<<$|B,yi=J+u}else Nn=1<<J|j<<$|B,yi=u}function ls(u){u.return!==null&&(bi(u,1),rh(u,1,0))}function ss(u){for(;u===os;)os=Ma[--ta],Ma[ta]=null,co=Ma[--ta],Ma[ta]=null;for(;u===Ir;)Ir=wn[--Bn],wn[Bn]=null,yi=wn[--Bn],wn[Bn]=null,Nn=wn[--Bn],wn[Bn]=null}var Jr=null,_n=null,dr=!1,us=!1,wi=null;function nh(u,p){var j=Xn(5,null,null,0);j.elementType="DELETED",j.stateNode=p,j.return=u,p=u.deletions,p===null?(u.deletions=[j],u.flags|=16):p.push(j)}function su(u,p){switch(u.tag){case 5:return p=Me(p,u.type,u.pendingProps),p!==null?(u.stateNode=p,Jr=u,_n=er(p),!0):!1;case 6:return p=Ye(p,u.pendingProps),p!==null?(u.stateNode=p,Jr=u,_n=null,!0):!1;case 13:if(p=et(p),p!==null){var j=Ir!==null?{id:Nn,overflow:yi}:null;return u.memoizedState={dehydrated:p,treeContext:j,retryLane:1073741824},j=Xn(18,null,null,0),j.stateNode=p,j.return=u,u.child=j,Jr=u,_n=null,!0}return!1;default:return!1}}function kc(u){return(u.mode&1)!==0&&(u.flags&128)===0}function Ac(u){if(dr){var p=_n;if(p){var j=p;if(!su(u,p)){if(kc(u))throw Error(s(418));p=Wt(j);var B=Jr;p&&su(u,p)?nh(B,j):(u.flags=u.flags&-4097|2,dr=!1,Jr=u)}}else{if(kc(u))throw Error(s(418));u.flags=u.flags&-4097|2,dr=!1,Jr=u}}}function ih(u){for(u=u.return;u!==null&&u.tag!==5&&u.tag!==3&&u.tag!==13;)u=u.return;Jr=u}function uu(u){if(!pe||u!==Jr)return!1;if(!dr)return ih(u),dr=!0,!1;if(u.tag!==3&&(u.tag!==5||Kp(u.type)&&!te(u.type,u.memoizedProps))){var p=_n;if(p){if(kc(u))throw ah(),Error(s(418));for(;p;)nh(u,p),p=Wt(p)}}if(ih(u),u.tag===13){if(!pe)throw Error(s(316));if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(s(317));_n=ka(u)}else _n=Jr?Wt(u.stateNode):null;return!0}function ah(){for(var u=_n;u;)u=Wt(u)}function fo(){pe&&(_n=Jr=null,us=dr=!1)}function Tc(u){wi===null?wi=[u]:wi.push(u)}var eg=c.ReactCurrentBatchConfig;function cu(u,p){if(mi(u,p))return!0;if(typeof u!="object"||u===null||typeof p!="object"||p===null)return!1;var j=Object.keys(u),B=Object.keys(p);if(j.length!==B.length)return!1;for(B=0;B<j.length;B++){var $=j[B];if(!Zp.call(p,$)||!mi(u[$],p[$]))return!1}return!0}function tg(u){switch(u.tag){case 5:return so(u.type);case 16:return so("Lazy");case 13:return so("Suspense");case 19:return so("SuspenseList");case 0:case 2:case 15:return u=Qo(u.type,!1),u;case 11:return u=Qo(u.type.render,!1),u;case 1:return u=Qo(u.type,!0),u;default:return""}}function ho(u,p,j){if(u=j.ref,u!==null&&typeof u!="function"&&typeof u!="object"){if(j._owner){if(j=j._owner,j){if(j.tag!==1)throw Error(s(309));var B=j.stateNode}if(!B)throw Error(s(147,u));var $=B,J=""+u;return p!==null&&p.ref!==null&&typeof p.ref=="function"&&p.ref._stringRef===J?p.ref:(p=function(le){var Ee=$.refs;le===null?delete Ee[J]:Ee[J]=le},p._stringRef=J,p)}if(typeof u!="string")throw Error(s(284));if(!j._owner)throw Error(s(290,u))}return u}function fu(u,p){throw u=Object.prototype.toString.call(p),Error(s(31,u==="[object Object]"?"object with keys {"+Object.keys(p).join(", ")+"}":u))}function oh(u){var p=u._init;return p(u._payload)}function lh(u){function p(Le,Ce){if(u){var De=Le.deletions;De===null?(Le.deletions=[Ce],Le.flags|=16):De.push(Ce)}}function j(Le,Ce){if(!u)return null;for(;Ce!==null;)p(Le,Ce),Ce=Ce.sibling;return null}function B(Le,Ce){for(Le=new Map;Ce!==null;)Ce.key!==null?Le.set(Ce.key,Ce):Le.set(Ce.index,Ce),Ce=Ce.sibling;return Le}function $(Le,Ce){return Le=Xa(Le,Ce),Le.index=0,Le.sibling=null,Le}function J(Le,Ce,De){return Le.index=De,u?(De=Le.alternate,De!==null?(De=De.index,De<Ce?(Le.flags|=2,Ce):De):(Le.flags|=2,Ce)):(Le.flags|=1048576,Ce)}function le(Le){return u&&Le.alternate===null&&(Le.flags|=2),Le}function Ee(Le,Ce,De,it){return Ce===null||Ce.tag!==6?(Ce=Rl(De,Le.mode,it),Ce.return=Le,Ce):(Ce=$(Ce,De),Ce.return=Le,Ce)}function Ie(Le,Ce,De,it){var _t=De.type;return _t===v?st(Le,Ce,De.props.children,it,De.key):Ce!==null&&(Ce.elementType===_t||typeof _t=="object"&&_t!==null&&_t.$$typeof===h&&oh(_t)===Ce.type)?(it=$(Ce,De.props),it.ref=ho(Le,Ce,De),it.return=Le,it):(it=Hu(De.type,De.key,De.props,null,Le.mode,it),it.ref=ho(Le,Ce,De),it.return=Le,it)}function Xe(Le,Ce,De,it){return Ce===null||Ce.tag!==4||Ce.stateNode.containerInfo!==De.containerInfo||Ce.stateNode.implementation!==De.implementation?(Ce=Gu(De,Le.mode,it),Ce.return=Le,Ce):(Ce=$(Ce,De.children||[]),Ce.return=Le,Ce)}function st(Le,Ce,De,it,_t){return Ce===null||Ce.tag!==7?(Ce=rn(De,Le.mode,it,_t),Ce.return=Le,Ce):(Ce=$(Ce,De),Ce.return=Le,Ce)}function Tt(Le,Ce,De){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number")return Ce=Rl(""+Ce,Le.mode,De),Ce.return=Le,Ce;if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case m:return De=Hu(Ce.type,Ce.key,Ce.props,null,Le.mode,De),De.ref=ho(Le,null,Ce),De.return=Le,De;case f:return Ce=Gu(Ce,Le.mode,De),Ce.return=Le,Ce;case h:var it=Ce._init;return Tt(Le,it(Ce._payload),De)}if(L(Ce)||M(Ce))return Ce=rn(Ce,Le.mode,De,null),Ce.return=Le,Ce;fu(Le,Ce)}return null}function nt(Le,Ce,De,it){var _t=Ce!==null?Ce.key:null;if(typeof De=="string"&&De!==""||typeof De=="number")return _t!==null?null:Ee(Le,Ce,""+De,it);if(typeof De=="object"&&De!==null){switch(De.$$typeof){case m:return De.key===_t?Ie(Le,Ce,De,it):null;case f:return De.key===_t?Xe(Le,Ce,De,it):null;case h:return _t=De._init,nt(Le,Ce,_t(De._payload),it)}if(L(De)||M(De))return _t!==null?null:st(Le,Ce,De,it,null);fu(Le,De)}return null}function sr(Le,Ce,De,it,_t){if(typeof it=="string"&&it!==""||typeof it=="number")return Le=Le.get(De)||null,Ee(Ce,Le,""+it,_t);if(typeof it=="object"&&it!==null){switch(it.$$typeof){case m:return Le=Le.get(it.key===null?De:it.key)||null,Ie(Ce,Le,it,_t);case f:return Le=Le.get(it.key===null?De:it.key)||null,Xe(Ce,Le,it,_t);case h:var It=it._init;return sr(Le,Ce,De,It(it._payload),_t)}if(L(it)||M(it))return Le=Le.get(De)||null,st(Ce,Le,it,_t,null);fu(Ce,it)}return null}function Qt(Le,Ce,De,it){for(var _t=null,It=null,Rt=Ce,Ht=Ce=0,Br=null;Rt!==null&&Ht<De.length;Ht++){Rt.index>Ht?(Br=Rt,Rt=null):Br=Rt.sibling;var Ut=nt(Le,Rt,De[Ht],it);if(Ut===null){Rt===null&&(Rt=Br);break}u&&Rt&&Ut.alternate===null&&p(Le,Rt),Ce=J(Ut,Ce,Ht),It===null?_t=Ut:It.sibling=Ut,It=Ut,Rt=Br}if(Ht===De.length)return j(Le,Rt),dr&&bi(Le,Ht),_t;if(Rt===null){for(;Ht<De.length;Ht++)Rt=Tt(Le,De[Ht],it),Rt!==null&&(Ce=J(Rt,Ce,Ht),It===null?_t=Rt:It.sibling=Rt,It=Rt);return dr&&bi(Le,Ht),_t}for(Rt=B(Le,Rt);Ht<De.length;Ht++)Br=sr(Rt,Le,Ht,De[Ht],it),Br!==null&&(u&&Br.alternate!==null&&Rt.delete(Br.key===null?Ht:Br.key),Ce=J(Br,Ce,Ht),It===null?_t=Br:It.sibling=Br,It=Br);return u&&Rt.forEach(function(gn){return p(Le,gn)}),dr&&bi(Le,Ht),_t}function Cn(Le,Ce,De,it){var _t=M(De);if(typeof _t!="function")throw Error(s(150));if(De=_t.call(De),De==null)throw Error(s(151));for(var It=_t=null,Rt=Ce,Ht=Ce=0,Br=null,Ut=De.next();Rt!==null&&!Ut.done;Ht++,Ut=De.next()){Rt.index>Ht?(Br=Rt,Rt=null):Br=Rt.sibling;var gn=nt(Le,Rt,Ut.value,it);if(gn===null){Rt===null&&(Rt=Br);break}u&&Rt&&gn.alternate===null&&p(Le,Rt),Ce=J(gn,Ce,Ht),It===null?_t=gn:It.sibling=gn,It=gn,Rt=Br}if(Ut.done)return j(Le,Rt),dr&&bi(Le,Ht),_t;if(Rt===null){for(;!Ut.done;Ht++,Ut=De.next())Ut=Tt(Le,Ut.value,it),Ut!==null&&(Ce=J(Ut,Ce,Ht),It===null?_t=Ut:It.sibling=Ut,It=Ut);return dr&&bi(Le,Ht),_t}for(Rt=B(Le,Rt);!Ut.done;Ht++,Ut=De.next())Ut=sr(Rt,Le,Ht,Ut.value,it),Ut!==null&&(u&&Ut.alternate!==null&&Rt.delete(Ut.key===null?Ht:Ut.key),Ce=J(Ut,Ce,Ht),It===null?_t=Ut:It.sibling=Ut,It=Ut);return u&&Rt.forEach(function(og){return p(Le,og)}),dr&&bi(Le,Ht),_t}function Vi(Le,Ce,De,it){if(typeof De=="object"&&De!==null&&De.type===v&&De.key===null&&(De=De.props.children),typeof De=="object"&&De!==null){switch(De.$$typeof){case m:e:{for(var _t=De.key,It=Ce;It!==null;){if(It.key===_t){if(_t=De.type,_t===v){if(It.tag===7){j(Le,It.sibling),Ce=$(It,De.props.children),Ce.return=Le,Le=Ce;break e}}else if(It.elementType===_t||typeof _t=="object"&&_t!==null&&_t.$$typeof===h&&oh(_t)===It.type){j(Le,It.sibling),Ce=$(It,De.props),Ce.ref=ho(Le,It,De),Ce.return=Le,Le=Ce;break e}j(Le,It);break}else p(Le,It);It=It.sibling}De.type===v?(Ce=rn(De.props.children,Le.mode,it,De.key),Ce.return=Le,Le=Ce):(it=Hu(De.type,De.key,De.props,null,Le.mode,it),it.ref=ho(Le,Ce,De),it.return=Le,Le=it)}return le(Le);case f:e:{for(It=De.key;Ce!==null;){if(Ce.key===It)if(Ce.tag===4&&Ce.stateNode.containerInfo===De.containerInfo&&Ce.stateNode.implementation===De.implementation){j(Le,Ce.sibling),Ce=$(Ce,De.children||[]),Ce.return=Le,Le=Ce;break e}else{j(Le,Ce);break}else p(Le,Ce);Ce=Ce.sibling}Ce=Gu(De,Le.mode,it),Ce.return=Le,Le=Ce}return le(Le);case h:return It=De._init,Vi(Le,Ce,It(De._payload),it)}if(L(De))return Qt(Le,Ce,De,it);if(M(De))return Cn(Le,Ce,De,it);fu(Le,De)}return typeof De=="string"&&De!==""||typeof De=="number"?(De=""+De,Ce!==null&&Ce.tag===6?(j(Le,Ce.sibling),Ce=$(Ce,De),Ce.return=Le,Le=Ce):(j(Le,Ce),Ce=Rl(De,Le.mode,it),Ce.return=Le,Le=Ce),le(Le)):j(Le,Ce)}return Vi}var po=lh(!0),sh=lh(!1),du=Zr(null),hu=null,ll=null,Rc=null;function Mc(){Rc=ll=hu=null}function uh(u,p,j){ae?(Ft(du,p._currentValue),p._currentValue=j):(Ft(du,p._currentValue2),p._currentValue2=j)}function cs(u){var p=du.current;fr(du),ae?u._currentValue=p:u._currentValue2=p}function go(u,p,j){for(;u!==null;){var B=u.alternate;if((u.childLanes&p)!==p?(u.childLanes|=p,B!==null&&(B.childLanes|=p)):B!==null&&(B.childLanes&p)!==p&&(B.childLanes|=p),u===j)break;u=u.return}}function sl(u,p){hu=u,Rc=ll=null,u=u.dependencies,u!==null&&u.firstContext!==null&&((u.lanes&p)!==0&&(Dr=!0),u.firstContext=null)}function Un(u){var p=ae?u._currentValue:u._currentValue2;if(Rc!==u)if(u={context:u,memoizedValue:p,next:null},ll===null){if(hu===null)throw Error(s(308));ll=u,hu.dependencies={lanes:0,firstContext:u}}else ll=ll.next=u;return p}var La=null;function pu(u){La===null?La=[u]:La.push(u)}function Lc(u,p,j,B){var $=p.interleaved;return $===null?(j.next=j,pu(p)):(j.next=$.next,$.next=j),p.interleaved=j,_i(u,B)}function _i(u,p){u.lanes|=p;var j=u.alternate;for(j!==null&&(j.lanes|=p),j=u,u=u.return;u!==null;)u.childLanes|=p,j=u.alternate,j!==null&&(j.childLanes|=p),j=u,u=u.return;return j.tag===3?j.stateNode:null}var qn=!1;function Nc(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ch(u,p){u=u.updateQueue,p.updateQueue===u&&(p.updateQueue={baseState:u.baseState,firstBaseUpdate:u.firstBaseUpdate,lastBaseUpdate:u.lastBaseUpdate,shared:u.shared,effects:u.effects})}function ra(u,p){return{eventTime:u,lane:p,tag:0,payload:null,callback:null,next:null}}function na(u,p,j){var B=u.updateQueue;if(B===null)return null;if(B=B.shared,(Mt&2)!==0){var $=B.pending;return $===null?p.next=p:(p.next=$.next,$.next=p),B.pending=p,_i(u,j)}return $=B.interleaved,$===null?(p.next=p,pu(B)):(p.next=$.next,$.next=p),B.interleaved=p,_i(u,j)}function fs(u,p,j){if(p=p.updateQueue,p!==null&&(p=p.shared,(j&4194240)!==0)){var B=p.lanes;B&=u.pendingLanes,j|=B,p.lanes=j,Ii(u,j)}}function ul(u,p){var j=u.updateQueue,B=u.alternate;if(B!==null&&(B=B.updateQueue,j===B)){var $=null,J=null;if(j=j.firstBaseUpdate,j!==null){do{var le={eventTime:j.eventTime,lane:j.lane,tag:j.tag,payload:j.payload,callback:j.callback,next:null};J===null?$=J=le:J=J.next=le,j=j.next}while(j!==null);J===null?$=J=p:J=J.next=p}else $=J=p;j={baseState:B.baseState,firstBaseUpdate:$,lastBaseUpdate:J,shared:B.shared,effects:B.effects},u.updateQueue=j;return}u=j.lastBaseUpdate,u===null?j.firstBaseUpdate=p:u.next=p,j.lastBaseUpdate=p}function Na(u,p,j,B){var $=u.updateQueue;qn=!1;var J=$.firstBaseUpdate,le=$.lastBaseUpdate,Ee=$.shared.pending;if(Ee!==null){$.shared.pending=null;var Ie=Ee,Xe=Ie.next;Ie.next=null,le===null?J=Xe:le.next=Xe,le=Ie;var st=u.alternate;st!==null&&(st=st.updateQueue,Ee=st.lastBaseUpdate,Ee!==le&&(Ee===null?st.firstBaseUpdate=Xe:Ee.next=Xe,st.lastBaseUpdate=Ie))}if(J!==null){var Tt=$.baseState;le=0,st=Xe=Ie=null,Ee=J;do{var nt=Ee.lane,sr=Ee.eventTime;if((B&nt)===nt){st!==null&&(st=st.next={eventTime:sr,lane:0,tag:Ee.tag,payload:Ee.payload,callback:Ee.callback,next:null});e:{var Qt=u,Cn=Ee;switch(nt=p,sr=j,Cn.tag){case 1:if(Qt=Cn.payload,typeof Qt=="function"){Tt=Qt.call(sr,Tt,nt);break e}Tt=Qt;break e;case 3:Qt.flags=Qt.flags&-65537|128;case 0:if(Qt=Cn.payload,nt=typeof Qt=="function"?Qt.call(sr,Tt,nt):Qt,nt==null)break e;Tt=o({},Tt,nt);break e;case 2:qn=!0}}Ee.callback!==null&&Ee.lane!==0&&(u.flags|=64,nt=$.effects,nt===null?$.effects=[Ee]:nt.push(Ee))}else sr={eventTime:sr,lane:nt,tag:Ee.tag,payload:Ee.payload,callback:Ee.callback,next:null},st===null?(Xe=st=sr,Ie=Tt):st=st.next=sr,le|=nt;if(Ee=Ee.next,Ee===null){if(Ee=$.shared.pending,Ee===null)break;nt=Ee,Ee=nt.next,nt.next=null,$.lastBaseUpdate=nt,$.shared.pending=null}}while(!0);if(st===null&&(Ie=Tt),$.baseState=Ie,$.firstBaseUpdate=Xe,$.lastBaseUpdate=st,p=$.shared.interleaved,p!==null){$=p;do le|=$.lane,$=$.next;while($!==p)}else J===null&&($.shared.lanes=0);sa|=le,u.lanes=le,u.memoizedState=Tt}}function fh(u,p,j){if(u=p.effects,p.effects=null,u!==null)for(p=0;p<u.length;p++){var B=u[p],$=B.callback;if($!==null){if(B.callback=null,B=j,typeof $!="function")throw Error(s(191,$));$.call(B)}}}var Ia={},ni=Zr(Ia),cl=Zr(Ia),ja=Zr(Ia);function ii(u){if(u===Ia)throw Error(s(174));return u}function gu(u,p){Ft(ja,p),Ft(cl,u),Ft(ni,Ia),u=G(p),fr(ni),Ft(ni,u)}function vo(){fr(ni),fr(cl),fr(ja)}function Ic(u){var p=ii(ja.current),j=ii(ni.current);p=W(j,u.type,p),j!==p&&(Ft(cl,u),Ft(ni,p))}function jc(u){cl.current===u&&(fr(ni),fr(cl))}var _r=Zr(0);function vu(u){for(var p=u;p!==null;){if(p.tag===13){var j=p.memoizedState;if(j!==null&&(j=j.dehydrated,j===null||ut(j)||wt(j)))return p}else if(p.tag===19&&p.memoizedProps.revealOrder!==void 0){if((p.flags&128)!==0)return p}else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===u)break;for(;p.sibling===null;){if(p.return===null||p.return===u)return null;p=p.return}p.sibling.return=p.return,p=p.sibling}return null}var Dc=[];function Fc(){for(var u=0;u<Dc.length;u++){var p=Dc[u];ae?p._workInProgressVersionPrimary=null:p._workInProgressVersionSecondary=null}Dc.length=0}var In=c.ReactCurrentDispatcher,mo=c.ReactCurrentBatchConfig,Da=0,gr=null,Ar=null,jr=null,fl=!1,ds=!1,hs=0,dl=0;function $r(){throw Error(s(321))}function yo(u,p){if(p===null)return!1;for(var j=0;j<p.length&&j<u.length;j++)if(!mi(u[j],p[j]))return!1;return!0}function ps(u,p,j,B,$,J){if(Da=J,gr=p,p.memoizedState=null,p.updateQueue=null,p.lanes=0,In.current=u===null||u.memoizedState===null?Yc:Kc,u=j(B,$),ds){J=0;do{if(ds=!1,hs=0,25<=J)throw Error(s(301));J+=1,jr=Ar=null,p.updateQueue=null,In.current=Xc,u=j(B,$)}while(ds)}if(In.current=Eo,p=Ar!==null&&Ar.next!==null,Da=0,jr=Ar=gr=null,fl=!1,p)throw Error(s(300));return u}function mu(){var u=hs!==0;return hs=0,u}function Hn(){var u={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jr===null?gr.memoizedState=jr=u:jr=jr.next=u,jr}function en(){if(Ar===null){var u=gr.alternate;u=u!==null?u.memoizedState:null}else u=Ar.next;var p=jr===null?gr.memoizedState:jr.next;if(p!==null)jr=p,Ar=u;else{if(u===null)throw Error(s(310));Ar=u,u={memoizedState:Ar.memoizedState,baseState:Ar.baseState,baseQueue:Ar.baseQueue,queue:Ar.queue,next:null},jr===null?gr.memoizedState=jr=u:jr=jr.next=u}return jr}function bo(u,p){return typeof p=="function"?p(u):p}function yu(u){var p=en(),j=p.queue;if(j===null)throw Error(s(311));j.lastRenderedReducer=u;var B=Ar,$=B.baseQueue,J=j.pending;if(J!==null){if($!==null){var le=$.next;$.next=J.next,J.next=le}B.baseQueue=$=J,j.pending=null}if($!==null){J=$.next,B=B.baseState;var Ee=le=null,Ie=null,Xe=J;do{var st=Xe.lane;if((Da&st)===st)Ie!==null&&(Ie=Ie.next={lane:0,action:Xe.action,hasEagerState:Xe.hasEagerState,eagerState:Xe.eagerState,next:null}),B=Xe.hasEagerState?Xe.eagerState:u(B,Xe.action);else{var Tt={lane:st,action:Xe.action,hasEagerState:Xe.hasEagerState,eagerState:Xe.eagerState,next:null};Ie===null?(Ee=Ie=Tt,le=B):Ie=Ie.next=Tt,gr.lanes|=st,sa|=st}Xe=Xe.next}while(Xe!==null&&Xe!==J);Ie===null?le=B:Ie.next=Ee,mi(B,p.memoizedState)||(Dr=!0),p.memoizedState=B,p.baseState=le,p.baseQueue=Ie,j.lastRenderedState=B}if(u=j.interleaved,u!==null){$=u;do J=$.lane,gr.lanes|=J,sa|=J,$=$.next;while($!==u)}else $===null&&(j.lanes=0);return[p.memoizedState,j.dispatch]}function hl(u){var p=en(),j=p.queue;if(j===null)throw Error(s(311));j.lastRenderedReducer=u;var B=j.dispatch,$=j.pending,J=p.memoizedState;if($!==null){j.pending=null;var le=$=$.next;do J=u(J,le.action),le=le.next;while(le!==$);mi(J,p.memoizedState)||(Dr=!0),p.memoizedState=J,p.baseQueue===null&&(p.baseState=J),j.lastRenderedState=J}return[J,B]}function zc(){}function Bc(u,p){var j=gr,B=en(),$=p(),J=!mi(B.memoizedState,$);if(J&&(B.memoizedState=$,Dr=!0),B=B.queue,_u(Hc.bind(null,j,B,u),[u]),B.getSnapshot!==p||J||jr!==null&&jr.memoizedState.tag&1){if(j.flags|=2048,wo(9,qc.bind(null,j,B,$,p),void 0,null),nr===null)throw Error(s(349));(Da&30)!==0||Uc(j,p,$)}return $}function Uc(u,p,j){u.flags|=16384,u={getSnapshot:p,value:j},p=gr.updateQueue,p===null?(p={lastEffect:null,stores:null},gr.updateQueue=p,p.stores=[u]):(j=p.stores,j===null?p.stores=[u]:j.push(u))}function qc(u,p,j,B){p.value=j,p.getSnapshot=B,Gc(p)&&ia(u)}function Hc(u,p,j){return j(function(){Gc(p)&&ia(u)})}function Gc(u){var p=u.getSnapshot;u=u.value;try{var j=p();return!mi(u,j)}catch{return!0}}function ia(u){var p=_i(u,1);p!==null&&hn(p,u,1,-1)}function bu(u){var p=Hn();return typeof u=="function"&&(u=u()),p.memoizedState=p.baseState=u,u={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:bo,lastRenderedState:u},p.queue=u,u=u.dispatch=rg.bind(null,gr,u),[p.memoizedState,u]}function wo(u,p,j,B){return u={tag:u,create:p,destroy:j,deps:B,next:null},p=gr.updateQueue,p===null?(p={lastEffect:null,stores:null},gr.updateQueue=p,p.lastEffect=u.next=u):(j=p.lastEffect,j===null?p.lastEffect=u.next=u:(B=j.next,j.next=u,u.next=B,p.lastEffect=u)),u}function dh(){return en().memoizedState}function wu(u,p,j,B){var $=Hn();gr.flags|=u,$.memoizedState=wo(1|p,j,void 0,B===void 0?null:B)}function Fa(u,p,j,B){var $=en();B=B===void 0?null:B;var J=void 0;if(Ar!==null){var le=Ar.memoizedState;if(J=le.destroy,B!==null&&yo(B,le.deps)){$.memoizedState=wo(p,j,J,B);return}}gr.flags|=u,$.memoizedState=wo(1|p,j,J,B)}function hh(u,p){return wu(8390656,8,u,p)}function _u(u,p){return Fa(2048,8,u,p)}function Vc(u,p){return Fa(4,2,u,p)}function ar(u,p){return Fa(4,4,u,p)}function Su(u,p){if(typeof p=="function")return u=u(),p(u),function(){p(null)};if(p!=null)return u=u(),p.current=u,function(){p.current=null}}function gs(u,p,j){return j=j!=null?j.concat([u]):null,Fa(4,4,Su.bind(null,p,u),j)}function _o(){}function $c(u,p){var j=en();p=p===void 0?null:p;var B=j.memoizedState;return B!==null&&p!==null&&yo(p,B[1])?B[0]:(j.memoizedState=[u,p],u)}function Eu(u,p){var j=en();p=p===void 0?null:p;var B=j.memoizedState;return B!==null&&p!==null&&yo(p,B[1])?B[0]:(u=u(),j.memoizedState=[u,p],u)}function pl(u,p,j){return(Da&21)===0?(u.baseState&&(u.baseState=!1,Dr=!0),u.memoizedState=j):(mi(j,p)||(j=ru(),gr.lanes|=j,sa|=j,u.baseState=!0),p)}function xu(u,p){var j=zt;zt=j!==0&&4>j?j:4,u(!0);var B=mo.transition;mo.transition={};try{u(!1),p()}finally{zt=j,mo.transition=B}}function So(){return en().memoizedState}function ph(u,p,j){var B=zr(u);if(j={lane:B,action:j,hasEagerState:!1,eagerState:null,next:null},gh(u))Wc(p,j);else if(j=Lc(u,p,j,B),j!==null){var $=hr();hn(j,u,B,$),vs(j,p,B)}}function rg(u,p,j){var B=zr(u),$={lane:B,action:j,hasEagerState:!1,eagerState:null,next:null};if(gh(u))Wc(p,$);else{var J=u.alternate;if(u.lanes===0&&(J===null||J.lanes===0)&&(J=p.lastRenderedReducer,J!==null))try{var le=p.lastRenderedState,Ee=J(le,j);if($.hasEagerState=!0,$.eagerState=Ee,mi(Ee,le)){var Ie=p.interleaved;Ie===null?($.next=$,pu(p)):($.next=Ie.next,Ie.next=$),p.interleaved=$;return}}catch{}finally{}j=Lc(u,p,$,B),j!==null&&($=hr(),hn(j,u,B,$),vs(j,p,B))}}function gh(u){var p=u.alternate;return u===gr||p!==null&&p===gr}function Wc(u,p){ds=fl=!0;var j=u.pending;j===null?p.next=p:(p.next=j.next,j.next=p),u.pending=p}function vs(u,p,j){if((j&4194240)!==0){var B=p.lanes;B&=u.pendingLanes,j|=B,p.lanes=j,Ii(u,j)}}var Eo={readContext:Un,useCallback:$r,useContext:$r,useEffect:$r,useImperativeHandle:$r,useInsertionEffect:$r,useLayoutEffect:$r,useMemo:$r,useReducer:$r,useRef:$r,useState:$r,useDebugValue:$r,useDeferredValue:$r,useTransition:$r,useMutableSource:$r,useSyncExternalStore:$r,useId:$r,unstable_isNewReconciler:!1},Yc={readContext:Un,useCallback:function(u,p){return Hn().memoizedState=[u,p===void 0?null:p],u},useContext:Un,useEffect:hh,useImperativeHandle:function(u,p,j){return j=j!=null?j.concat([u]):null,wu(4194308,4,Su.bind(null,p,u),j)},useLayoutEffect:function(u,p){return wu(4194308,4,u,p)},useInsertionEffect:function(u,p){return wu(4,2,u,p)},useMemo:function(u,p){var j=Hn();return p=p===void 0?null:p,u=u(),j.memoizedState=[u,p],u},useReducer:function(u,p,j){var B=Hn();return p=j!==void 0?j(p):p,B.memoizedState=B.baseState=p,u={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:p},B.queue=u,u=u.dispatch=ph.bind(null,gr,u),[B.memoizedState,u]},useRef:function(u){var p=Hn();return u={current:u},p.memoizedState=u},useState:bu,useDebugValue:_o,useDeferredValue:function(u){return Hn().memoizedState=u},useTransition:function(){var u=bu(!1),p=u[0];return u=xu.bind(null,u[1]),Hn().memoizedState=u,[p,u]},useMutableSource:function(){},useSyncExternalStore:function(u,p,j){var B=gr,$=Hn();if(dr){if(j===void 0)throw Error(s(407));j=j()}else{if(j=p(),nr===null)throw Error(s(349));(Da&30)!==0||Uc(B,p,j)}$.memoizedState=j;var J={value:j,getSnapshot:p};return $.queue=J,hh(Hc.bind(null,B,J,u),[u]),B.flags|=2048,wo(9,qc.bind(null,B,J,j,p),void 0,null),j},useId:function(){var u=Hn(),p=nr.identifierPrefix;if(dr){var j=yi,B=Nn;j=(B&~(1<<32-zn(B)-1)).toString(32)+j,p=":"+p+"R"+j,j=hs++,0<j&&(p+="H"+j.toString(32)),p+=":"}else j=dl++,p=":"+p+"r"+j.toString(32)+":";return u.memoizedState=p},unstable_isNewReconciler:!1},Kc={readContext:Un,useCallback:$c,useContext:Un,useEffect:_u,useImperativeHandle:gs,useInsertionEffect:Vc,useLayoutEffect:ar,useMemo:Eu,useReducer:yu,useRef:dh,useState:function(){return yu(bo)},useDebugValue:_o,useDeferredValue:function(u){var p=en();return pl(p,Ar.memoizedState,u)},useTransition:function(){var u=yu(bo)[0],p=en().memoizedState;return[u,p]},useMutableSource:zc,useSyncExternalStore:Bc,useId:So,unstable_isNewReconciler:!1},Xc={readContext:Un,useCallback:$c,useContext:Un,useEffect:_u,useImperativeHandle:gs,useInsertionEffect:Vc,useLayoutEffect:ar,useMemo:Eu,useReducer:hl,useRef:dh,useState:function(){return hl(bo)},useDebugValue:_o,useDeferredValue:function(u){var p=en();return Ar===null?p.memoizedState=u:pl(p,Ar.memoizedState,u)},useTransition:function(){var u=hl(bo)[0],p=en().memoizedState;return[u,p]},useMutableSource:zc,useSyncExternalStore:Bc,useId:So,unstable_isNewReconciler:!1};function Gn(u,p){if(u&&u.defaultProps){p=o({},p),u=u.defaultProps;for(var j in u)p[j]===void 0&&(p[j]=u[j]);return p}return p}function Zc(u,p,j,B){p=u.memoizedState,j=j(B,p),j=j==null?p:o({},p,j),u.memoizedState=j,u.lanes===0&&(u.updateQueue.baseState=j)}var ms={isMounted:function(u){return(u=u._reactInternals)?F(u)===u:!1},enqueueSetState:function(u,p,j){u=u._reactInternals;var B=hr(),$=zr(u),J=ra(B,$);J.payload=p,j!=null&&(J.callback=j),p=na(u,J,$),p!==null&&(hn(p,u,$,B),fs(p,u,$))},enqueueReplaceState:function(u,p,j){u=u._reactInternals;var B=hr(),$=zr(u),J=ra(B,$);J.tag=1,J.payload=p,j!=null&&(J.callback=j),p=na(u,J,$),p!==null&&(hn(p,u,$,B),fs(p,u,$))},enqueueForceUpdate:function(u,p){u=u._reactInternals;var j=hr(),B=zr(u),$=ra(j,B);$.tag=2,p!=null&&($.callback=p),p=na(u,$,B),p!==null&&(hn(p,u,B,j),fs(p,u,B))}};function vh(u,p,j,B,$,J,le){return u=u.stateNode,typeof u.shouldComponentUpdate=="function"?u.shouldComponentUpdate(B,J,le):p.prototype&&p.prototype.isPureReactComponent?!cu(j,B)||!cu($,J):!0}function mh(u,p,j){var B=!1,$=Aa,J=p.contextType;return typeof J=="object"&&J!==null?J=Un(J):($=Gr(p)?Ni:un.current,B=p.contextTypes,J=(B=B!=null)?Ji(u,$):Aa),p=new p(j,J),u.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=ms,u.stateNode=p,p._reactInternals=u,B&&(u=u.stateNode,u.__reactInternalMemoizedUnmaskedChildContext=$,u.__reactInternalMemoizedMaskedChildContext=J),p}function Ou(u,p,j,B){u=p.state,typeof p.componentWillReceiveProps=="function"&&p.componentWillReceiveProps(j,B),typeof p.UNSAFE_componentWillReceiveProps=="function"&&p.UNSAFE_componentWillReceiveProps(j,B),p.state!==u&&ms.enqueueReplaceState(p,p.state,null)}function Di(u,p,j,B){var $=u.stateNode;$.props=j,$.state=u.memoizedState,$.refs={},Nc(u);var J=p.contextType;typeof J=="object"&&J!==null?$.context=Un(J):(J=Gr(p)?Ni:un.current,$.context=Ji(u,J)),$.state=u.memoizedState,J=p.getDerivedStateFromProps,typeof J=="function"&&(Zc(u,p,J,j),$.state=u.memoizedState),typeof p.getDerivedStateFromProps=="function"||typeof $.getSnapshotBeforeUpdate=="function"||typeof $.UNSAFE_componentWillMount!="function"&&typeof $.componentWillMount!="function"||(p=$.state,typeof $.componentWillMount=="function"&&$.componentWillMount(),typeof $.UNSAFE_componentWillMount=="function"&&$.UNSAFE_componentWillMount(),p!==$.state&&ms.enqueueReplaceState($,$.state,null),Na(u,j,$,B),$.state=u.memoizedState),typeof $.componentDidMount=="function"&&(u.flags|=4194308)}function xo(u,p){try{var j="",B=p;do j+=tg(B),B=B.return;while(B);var $=j}catch(J){$=`
56
- Error generating stack: `+J.message+`
57
- `+J.stack}return{value:u,source:p,stack:$,digest:null}}function za(u,p,j){return{value:u,source:null,stack:j??null,digest:p??null}}function ai(u,p){try{console.error(p.value)}catch(j){setTimeout(function(){throw j})}}var ys=typeof WeakMap=="function"?WeakMap:Map;function Fi(u,p,j){j=ra(-1,j),j.tag=3,j.payload={element:null};var B=p.value;return j.callback=function(){xr||(xr=!0,Tr=B),ai(u,p)},j}function Pu(u,p,j){j=ra(-1,j),j.tag=3;var B=u.type.getDerivedStateFromError;if(typeof B=="function"){var $=p.value;j.payload=function(){return B($)},j.callback=function(){ai(u,p)}}var J=u.stateNode;return J!==null&&typeof J.componentDidCatch=="function"&&(j.callback=function(){ai(u,p),typeof B!="function"&&(Ei===null?Ei=new Set([this]):Ei.add(this));var le=p.stack;this.componentDidCatch(p.value,{componentStack:le!==null?le:""})}),j}function yh(u,p,j){var B=u.pingCache;if(B===null){B=u.pingCache=new ys;var $=new Set;B.set(p,$)}else $=B.get(p),$===void 0&&($=new Set,B.set(p,$));$.has(j)||($.add(j),u=Ph.bind(null,u,p,j),p.then(u,u))}function bh(u){do{var p;if((p=u.tag===13)&&(p=u.memoizedState,p=p!==null?p.dehydrated!==null:!0),p)return u;u=u.return}while(u!==null);return null}function Ba(u,p,j,B,$){return(u.mode&1)===0?(u===p?u.flags|=65536:(u.flags|=128,j.flags|=131072,j.flags&=-52805,j.tag===1&&(j.alternate===null?j.tag=17:(p=ra(-1,1),p.tag=2,na(j,p,1))),j.lanes|=1),u):(u.flags|=65536,u.lanes=$,u)}var bs=c.ReactCurrentOwner,Dr=!1;function Wr(u,p,j,B){p.child=u===null?sh(p,null,j,B):po(p,u.child,j,B)}function Cu(u,p,j,B,$){j=j.render;var J=p.ref;return sl(p,$),B=ps(u,p,j,B,J,$),j=mu(),u!==null&&!Dr?(p.updateQueue=u.updateQueue,p.flags&=-2053,u.lanes&=~$,oa(u,p,$)):(dr&&j&&ls(p),p.flags|=1,Wr(u,p,B,$),p.child)}function Oo(u,p,j,B,$){if(u===null){var J=j.type;return typeof J=="function"&&!Al(J)&&J.defaultProps===void 0&&j.compare===null&&j.defaultProps===void 0?(p.tag=15,p.type=J,aa(u,p,J,B,$)):(u=Hu(j.type,null,B,p,p.mode,$),u.ref=p.ref,u.return=p,p.child=u)}if(J=u.child,(u.lanes&$)===0){var le=J.memoizedProps;if(j=j.compare,j=j!==null?j:cu,j(le,B)&&u.ref===p.ref)return oa(u,p,$)}return p.flags|=1,u=Xa(J,B),u.ref=p.ref,u.return=p,p.child=u}function aa(u,p,j,B,$){if(u!==null){var J=u.memoizedProps;if(cu(J,B)&&u.ref===p.ref)if(Dr=!1,p.pendingProps=B=J,(u.lanes&$)!==0)(u.flags&131072)!==0&&(Dr=!0);else return p.lanes=u.lanes,oa(u,p,$)}return zi(u,p,j,B,$)}function or(u,p,j){var B=p.pendingProps,$=B.children,J=u!==null?u.memoizedState:null;if(B.mode==="hidden")if((p.mode&1)===0)p.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ft($a,Fr),Fr|=j;else{if((j&1073741824)===0)return u=J!==null?J.baseLanes|j:j,p.lanes=p.childLanes=1073741824,p.memoizedState={baseLanes:u,cachePool:null,transitions:null},p.updateQueue=null,Ft($a,Fr),Fr|=u,null;p.memoizedState={baseLanes:0,cachePool:null,transitions:null},B=J!==null?J.baseLanes:j,Ft($a,Fr),Fr|=B}else J!==null?(B=J.baseLanes|j,p.memoizedState=null):B=j,Ft($a,Fr),Fr|=B;return Wr(u,p,$,j),p.child}function rr(u,p){var j=p.ref;(u===null&&j!==null||u!==null&&u.ref!==j)&&(p.flags|=512,p.flags|=2097152)}function zi(u,p,j,B,$){var J=Gr(j)?Ni:un.current;return J=Ji(p,J),sl(p,$),j=ps(u,p,j,B,J,$),B=mu(),u!==null&&!Dr?(p.updateQueue=u.updateQueue,p.flags&=-2053,u.lanes&=~$,oa(u,p,$)):(dr&&B&&ls(p),p.flags|=1,Wr(u,p,j,$),p.child)}function tn(u,p,j,B,$){if(Gr(j)){var J=!0;Jo(p)}else J=!1;if(sl(p,$),p.stateNode===null)ws(u,p),mh(p,j,B),Di(p,j,B,$),B=!0;else if(u===null){var le=p.stateNode,Ee=p.memoizedProps;le.props=Ee;var Ie=le.context,Xe=j.contextType;typeof Xe=="object"&&Xe!==null?Xe=Un(Xe):(Xe=Gr(j)?Ni:un.current,Xe=Ji(p,Xe));var st=j.getDerivedStateFromProps,Tt=typeof st=="function"||typeof le.getSnapshotBeforeUpdate=="function";Tt||typeof le.UNSAFE_componentWillReceiveProps!="function"&&typeof le.componentWillReceiveProps!="function"||(Ee!==B||Ie!==Xe)&&Ou(p,le,B,Xe),qn=!1;var nt=p.memoizedState;le.state=nt,Na(p,B,le,$),Ie=p.memoizedState,Ee!==B||nt!==Ie||Mn.current||qn?(typeof st=="function"&&(Zc(p,j,st,B),Ie=p.memoizedState),(Ee=qn||vh(p,j,Ee,B,nt,Ie,Xe))?(Tt||typeof le.UNSAFE_componentWillMount!="function"&&typeof le.componentWillMount!="function"||(typeof le.componentWillMount=="function"&&le.componentWillMount(),typeof le.UNSAFE_componentWillMount=="function"&&le.UNSAFE_componentWillMount()),typeof le.componentDidMount=="function"&&(p.flags|=4194308)):(typeof le.componentDidMount=="function"&&(p.flags|=4194308),p.memoizedProps=B,p.memoizedState=Ie),le.props=B,le.state=Ie,le.context=Xe,B=Ee):(typeof le.componentDidMount=="function"&&(p.flags|=4194308),B=!1)}else{le=p.stateNode,ch(u,p),Ee=p.memoizedProps,Xe=p.type===p.elementType?Ee:Gn(p.type,Ee),le.props=Xe,Tt=p.pendingProps,nt=le.context,Ie=j.contextType,typeof Ie=="object"&&Ie!==null?Ie=Un(Ie):(Ie=Gr(j)?Ni:un.current,Ie=Ji(p,Ie));var sr=j.getDerivedStateFromProps;(st=typeof sr=="function"||typeof le.getSnapshotBeforeUpdate=="function")||typeof le.UNSAFE_componentWillReceiveProps!="function"&&typeof le.componentWillReceiveProps!="function"||(Ee!==Tt||nt!==Ie)&&Ou(p,le,B,Ie),qn=!1,nt=p.memoizedState,le.state=nt,Na(p,B,le,$);var Qt=p.memoizedState;Ee!==Tt||nt!==Qt||Mn.current||qn?(typeof sr=="function"&&(Zc(p,j,sr,B),Qt=p.memoizedState),(Xe=qn||vh(p,j,Xe,B,nt,Qt,Ie)||!1)?(st||typeof le.UNSAFE_componentWillUpdate!="function"&&typeof le.componentWillUpdate!="function"||(typeof le.componentWillUpdate=="function"&&le.componentWillUpdate(B,Qt,Ie),typeof le.UNSAFE_componentWillUpdate=="function"&&le.UNSAFE_componentWillUpdate(B,Qt,Ie)),typeof le.componentDidUpdate=="function"&&(p.flags|=4),typeof le.getSnapshotBeforeUpdate=="function"&&(p.flags|=1024)):(typeof le.componentDidUpdate!="function"||Ee===u.memoizedProps&&nt===u.memoizedState||(p.flags|=4),typeof le.getSnapshotBeforeUpdate!="function"||Ee===u.memoizedProps&&nt===u.memoizedState||(p.flags|=1024),p.memoizedProps=B,p.memoizedState=Qt),le.props=B,le.state=Qt,le.context=Ie,B=Xe):(typeof le.componentDidUpdate!="function"||Ee===u.memoizedProps&&nt===u.memoizedState||(p.flags|=4),typeof le.getSnapshotBeforeUpdate!="function"||Ee===u.memoizedProps&&nt===u.memoizedState||(p.flags|=1024),B=!1)}return cn(u,p,j,B,J,$)}function cn(u,p,j,B,$,J){rr(u,p);var le=(p.flags&128)!==0;if(!B&&!le)return $&&Pc(p,j,!1),oa(u,p,J);B=p.stateNode,bs.current=p;var Ee=le&&typeof j.getDerivedStateFromError!="function"?null:B.render();return p.flags|=1,u!==null&&le?(p.child=po(p,u.child,null,J),p.child=po(p,null,Ee,J)):Wr(u,p,Ee,J),p.memoizedState=B.state,$&&Pc(p,j,!0),p.child}function Ua(u){var p=u.stateNode;p.pendingContext?Kd(u,p.pendingContext,p.pendingContext!==p.context):p.context&&Kd(u,p.context,!1),gu(u,p.containerInfo)}function Po(u,p,j,B,$){return fo(),Tc($),p.flags|=256,Wr(u,p,j,B),p.child}var fn={dehydrated:null,treeContext:null,retryLane:0};function gl(u){return{baseLanes:u,cachePool:null,transitions:null}}function Qc(u,p,j){var B=p.pendingProps,$=_r.current,J=!1,le=(p.flags&128)!==0,Ee;if((Ee=le)||(Ee=u!==null&&u.memoizedState===null?!1:($&2)!==0),Ee?(J=!0,p.flags&=-129):(u===null||u.memoizedState!==null)&&($|=1),Ft(_r,$&1),u===null)return Ac(p),u=p.memoizedState,u!==null&&(u=u.dehydrated,u!==null)?((p.mode&1)===0?p.lanes=1:wt(u)?p.lanes=8:p.lanes=1073741824,null):(le=B.children,u=B.fallback,J?(B=p.mode,J=p.child,le={mode:"hidden",children:le},(B&1)===0&&J!==null?(J.childLanes=0,J.pendingProps=le):J=Tl(le,B,0,null),u=rn(u,B,j,null),J.return=p,u.return=p,J.sibling=u,p.child=J,p.child.memoizedState=gl(j),p.memoizedState=fn,u):ku(p,le));if($=u.memoizedState,$!==null&&(Ee=$.dehydrated,Ee!==null))return wh(u,p,le,B,Ee,$,j);if(J){J=B.fallback,le=p.mode,$=u.child,Ee=$.sibling;var Ie={mode:"hidden",children:B.children};return(le&1)===0&&p.child!==$?(B=p.child,B.childLanes=0,B.pendingProps=Ie,p.deletions=null):(B=Xa($,Ie),B.subtreeFlags=$.subtreeFlags&14680064),Ee!==null?J=Xa(Ee,J):(J=rn(J,le,j,null),J.flags|=2),J.return=p,B.return=p,B.sibling=J,p.child=B,B=J,J=p.child,le=u.child.memoizedState,le=le===null?gl(j):{baseLanes:le.baseLanes|j,cachePool:null,transitions:le.transitions},J.memoizedState=le,J.childLanes=u.childLanes&~j,p.memoizedState=fn,B}return J=u.child,u=J.sibling,B=Xa(J,{mode:"visible",children:B.children}),(p.mode&1)===0&&(B.lanes=j),B.return=p,B.sibling=null,u!==null&&(j=p.deletions,j===null?(p.deletions=[u],p.flags|=16):j.push(u)),p.child=B,p.memoizedState=null,B}function ku(u,p){return p=Tl({mode:"visible",children:p},u.mode,0,null),p.return=u,u.child=p}function Co(u,p,j,B){return B!==null&&Tc(B),po(p,u.child,null,j),u=ku(p,p.pendingProps.children),u.flags|=2,p.memoizedState=null,u}function wh(u,p,j,B,$,J,le){if(j)return p.flags&256?(p.flags&=-257,B=za(Error(s(422))),Co(u,p,le,B)):p.memoizedState!==null?(p.child=u.child,p.flags|=128,null):(J=B.fallback,$=p.mode,B=Tl({mode:"visible",children:B.children},$,0,null),J=rn(J,$,le,null),J.flags|=2,B.return=p,J.return=p,B.sibling=J,p.child=B,(p.mode&1)!==0&&po(p,u.child,null,le),p.child.memoizedState=gl(le),p.memoizedState=fn,J);if((p.mode&1)===0)return Co(u,p,le,null);if(wt($))return B=Ct($).digest,J=Error(s(419)),B=za(J,B,void 0),Co(u,p,le,B);if(j=(le&u.childLanes)!==0,Dr||j){if(B=nr,B!==null){switch(le&-le){case 4:$=2;break;case 16:$=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:$=32;break;case 536870912:$=268435456;break;default:$=0}$=($&(B.suspendedLanes|le))!==0?0:$,$!==0&&$!==J.retryLane&&(J.retryLane=$,_i(u,$),hn(B,u,$,-1))}return kl(),B=za(Error(s(421))),Co(u,p,le,B)}return ut($)?(p.flags|=128,p.child=u.child,p=kh.bind(null,u),Jt($,p),null):(u=J.treeContext,pe&&(_n=Jn($),Jr=p,dr=!0,wi=null,us=!1,u!==null&&(wn[Bn++]=Nn,wn[Bn++]=yi,wn[Bn++]=Ir,Nn=u.id,yi=u.overflow,Ir=p)),p=ku(p,B.children),p.flags|=4096,p)}function Bi(u,p,j){u.lanes|=p;var B=u.alternate;B!==null&&(B.lanes|=p),go(u.return,p,j)}function vl(u,p,j,B,$){var J=u.memoizedState;J===null?u.memoizedState={isBackwards:p,rendering:null,renderingStartTime:0,last:B,tail:j,tailMode:$}:(J.isBackwards=p,J.rendering=null,J.renderingStartTime=0,J.last=B,J.tail=j,J.tailMode=$)}function Au(u,p,j){var B=p.pendingProps,$=B.revealOrder,J=B.tail;if(Wr(u,p,B.children,j),B=_r.current,(B&2)!==0)B=B&1|2,p.flags|=128;else{if(u!==null&&(u.flags&128)!==0)e:for(u=p.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&Bi(u,j,p);else if(u.tag===19)Bi(u,j,p);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===p)break e;for(;u.sibling===null;){if(u.return===null||u.return===p)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}B&=1}if(Ft(_r,B),(p.mode&1)===0)p.memoizedState=null;else switch($){case"forwards":for(j=p.child,$=null;j!==null;)u=j.alternate,u!==null&&vu(u)===null&&($=j),j=j.sibling;j=$,j===null?($=p.child,p.child=null):($=j.sibling,j.sibling=null),vl(p,!1,$,j,J);break;case"backwards":for(j=null,$=p.child,p.child=null;$!==null;){if(u=$.alternate,u!==null&&vu(u)===null){p.child=$;break}u=$.sibling,$.sibling=j,j=$,$=u}vl(p,!0,j,null,J);break;case"together":vl(p,!1,null,null,void 0);break;default:p.memoizedState=null}return p.child}function ws(u,p){(p.mode&1)===0&&u!==null&&(u.alternate=null,p.alternate=null,p.flags|=2)}function oa(u,p,j){if(u!==null&&(p.dependencies=u.dependencies),sa|=p.lanes,(j&p.childLanes)===0)return null;if(u!==null&&p.child!==u.child)throw Error(s(153));if(p.child!==null){for(u=p.child,j=Xa(u,u.pendingProps),p.child=j,j.return=p;u.sibling!==null;)u=u.sibling,j=j.sibling=Xa(u,u.pendingProps),j.return=p;j.sibling=null}return p.child}function qa(u,p,j){switch(p.tag){case 3:Ua(p),fo();break;case 5:Ic(p);break;case 1:Gr(p.type)&&Jo(p);break;case 4:gu(p,p.stateNode.containerInfo);break;case 10:uh(p,p.type._context,p.memoizedProps.value);break;case 13:var B=p.memoizedState;if(B!==null)return B.dehydrated!==null?(Ft(_r,_r.current&1),p.flags|=128,null):(j&p.child.childLanes)!==0?Qc(u,p,j):(Ft(_r,_r.current&1),u=oa(u,p,j),u!==null?u.sibling:null);Ft(_r,_r.current&1);break;case 19:if(B=(j&p.childLanes)!==0,(u.flags&128)!==0){if(B)return Au(u,p,j);p.flags|=128}var $=p.memoizedState;if($!==null&&($.rendering=null,$.tail=null,$.lastEffect=null),Ft(_r,_r.current),B)break;return null;case 22:case 23:return p.lanes=0,or(u,p,j)}return oa(u,p,j)}function Sn(u){u.flags|=4}function ko(u,p){if(u!==null&&u.child===p.child)return!0;if((p.flags&16)!==0)return!1;for(u=p.child;u!==null;){if((u.flags&12854)!==0||(u.subtreeFlags&12854)!==0)return!1;u=u.sibling}return!0}var Ha,Ga,En,xn;if(ue)Ha=function(u,p){for(var j=p.child;j!==null;){if(j.tag===5||j.tag===6)Y(u,j.stateNode);else if(j.tag!==4&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===p)break;for(;j.sibling===null;){if(j.return===null||j.return===p)return;j=j.return}j.sibling.return=j.return,j=j.sibling}},Ga=function(){},En=function(u,p,j,B,$){if(u=u.memoizedProps,u!==B){var J=p.stateNode,le=ii(ni.current);j=ee(J,j,u,B,$,le),(p.updateQueue=j)&&Sn(p)}},xn=function(u,p,j,B){j!==B&&Sn(p)};else if(fe){Ha=function(u,p,j,B){for(var $=p.child;$!==null;){if($.tag===5){var J=$.stateNode;j&&B&&(J=me(J,$.type,$.memoizedProps,$)),Y(u,J)}else if($.tag===6)J=$.stateNode,j&&B&&(J=He(J,$.memoizedProps,$)),Y(u,J);else if($.tag!==4){if($.tag===22&&$.memoizedState!==null)J=$.child,J!==null&&(J.return=$),Ha(u,$,!0,!0);else if($.child!==null){$.child.return=$,$=$.child;continue}}if($===p)break;for(;$.sibling===null;){if($.return===null||$.return===p)return;$=$.return}$.sibling.return=$.return,$=$.sibling}};var Va=function(u,p,j,B){for(var $=p.child;$!==null;){if($.tag===5){var J=$.stateNode;j&&B&&(J=me(J,$.type,$.memoizedProps,$)),ze(u,J)}else if($.tag===6)J=$.stateNode,j&&B&&(J=He(J,$.memoizedProps,$)),ze(u,J);else if($.tag!==4){if($.tag===22&&$.memoizedState!==null)J=$.child,J!==null&&(J.return=$),Va(u,$,!0,!0);else if($.child!==null){$.child.return=$,$=$.child;continue}}if($===p)break;for(;$.sibling===null;){if($.return===null||$.return===p)return;$=$.return}$.sibling.return=$.return,$=$.sibling}};Ga=function(u,p){var j=p.stateNode;if(!ko(u,p)){u=j.containerInfo;var B=ht(u);Va(B,p,!1,!1),j.pendingChildren=B,Sn(p),at(u,B)}},En=function(u,p,j,B,$){var J=u.stateNode,le=u.memoizedProps;if((u=ko(u,p))&&le===B)p.stateNode=J;else{var Ee=p.stateNode,Ie=ii(ni.current),Xe=null;le!==B&&(Xe=ee(Ee,j,le,B,$,Ie)),u&&Xe===null?p.stateNode=J:(J=Pt(J,Xe,j,le,B,p,u,Ee),U(J,j,B,$,Ie)&&Sn(p),p.stateNode=J,u?Sn(p):Ha(J,p,!1,!1))}},xn=function(u,p,j,B){j!==B?(u=ii(ja.current),j=ii(ni.current),p.stateNode=Q(B,u,j,p),Sn(p)):p.stateNode=u.stateNode}}else Ga=function(){},En=function(){},xn=function(){};function Vn(u,p){if(!dr)switch(u.tailMode){case"hidden":p=u.tail;for(var j=null;p!==null;)p.alternate!==null&&(j=p),p=p.sibling;j===null?u.tail=null:j.sibling=null;break;case"collapsed":j=u.tail;for(var B=null;j!==null;)j.alternate!==null&&(B=j),j=j.sibling;B===null?p||u.tail===null?u.tail=null:u.tail.sibling=null:B.sibling=null}}function vr(u){var p=u.alternate!==null&&u.alternate.child===u.child,j=0,B=0;if(p)for(var $=u.child;$!==null;)j|=$.lanes|$.childLanes,B|=$.subtreeFlags&14680064,B|=$.flags&14680064,$.return=u,$=$.sibling;else for($=u.child;$!==null;)j|=$.lanes|$.childLanes,B|=$.subtreeFlags,B|=$.flags,$.return=u,$=$.sibling;return u.subtreeFlags|=B,u.childLanes=j,p}function Ao(u,p,j){var B=p.pendingProps;switch(ss(p),p.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vr(p),null;case 1:return Gr(p.type)&&uo(),vr(p),null;case 3:return j=p.stateNode,vo(),fr(Mn),fr(un),Fc(),j.pendingContext&&(j.context=j.pendingContext,j.pendingContext=null),(u===null||u.child===null)&&(uu(p)?Sn(p):u===null||u.memoizedState.isDehydrated&&(p.flags&256)===0||(p.flags|=1024,wi!==null&&(Uu(wi),wi=null))),Ga(u,p),vr(p),null;case 5:jc(p),j=ii(ja.current);var $=p.type;if(u!==null&&p.stateNode!=null)En(u,p,$,B,j),u.ref!==p.ref&&(p.flags|=512,p.flags|=2097152);else{if(!B){if(p.stateNode===null)throw Error(s(166));return vr(p),null}if(u=ii(ni.current),uu(p)){if(!pe)throw Error(s(175));u=Nr(p.stateNode,p.type,p.memoizedProps,j,u,p,!us),p.updateQueue=u,u!==null&&Sn(p)}else{var J=z($,B,j,u,p);Ha(J,p,!1,!1),p.stateNode=J,U(J,$,B,j,u)&&Sn(p)}p.ref!==null&&(p.flags|=512,p.flags|=2097152)}return vr(p),null;case 6:if(u&&p.stateNode!=null)xn(u,p,u.memoizedProps,B);else{if(typeof B!="string"&&p.stateNode===null)throw Error(s(166));if(u=ii(ja.current),j=ii(ni.current),uu(p)){if(!pe)throw Error(s(176));if(u=p.stateNode,j=p.memoizedProps,(B=ei(u,j,p,!us))&&($=Jr,$!==null))switch($.tag){case 3:Xp($.stateNode.containerInfo,u,j,($.mode&1)!==0);break;case 5:Pr($.type,$.memoizedProps,$.stateNode,u,j,($.mode&1)!==0)}B&&Sn(p)}else p.stateNode=Q(B,u,j,p)}return vr(p),null;case 13:if(fr(_r),B=p.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if(dr&&_n!==null&&(p.mode&1)!==0&&(p.flags&128)===0)ah(),fo(),p.flags|=98560,$=!1;else if($=uu(p),B!==null&&B.dehydrated!==null){if(u===null){if(!$)throw Error(s(318));if(!pe)throw Error(s(344));if($=p.memoizedState,$=$!==null?$.dehydrated:null,!$)throw Error(s(317));lo($,p)}else fo(),(p.flags&128)===0&&(p.memoizedState=null),p.flags|=4;vr(p),$=!1}else wi!==null&&(Uu(wi),wi=null),$=!0;if(!$)return p.flags&65536?p:null}return(p.flags&128)!==0?(p.lanes=j,p):(j=B!==null,j!==(u!==null&&u.memoizedState!==null)&&j&&(p.child.flags|=8192,(p.mode&1)!==0&&(u===null||(_r.current&1)!==0?yr===0&&(yr=3):kl())),p.updateQueue!==null&&(p.flags|=4),vr(p),null);case 4:return vo(),Ga(u,p),u===null&&we(p.stateNode.containerInfo),vr(p),null;case 10:return cs(p.type._context),vr(p),null;case 17:return Gr(p.type)&&uo(),vr(p),null;case 19:if(fr(_r),$=p.memoizedState,$===null)return vr(p),null;if(B=(p.flags&128)!==0,J=$.rendering,J===null)if(B)Vn($,!1);else{if(yr!==0||u!==null&&(u.flags&128)!==0)for(u=p.child;u!==null;){if(J=vu(u),J!==null){for(p.flags|=128,Vn($,!1),u=J.updateQueue,u!==null&&(p.updateQueue=u,p.flags|=4),p.subtreeFlags=0,u=j,j=p.child;j!==null;)B=j,$=u,B.flags&=14680066,J=B.alternate,J===null?(B.childLanes=0,B.lanes=$,B.child=null,B.subtreeFlags=0,B.memoizedProps=null,B.memoizedState=null,B.updateQueue=null,B.dependencies=null,B.stateNode=null):(B.childLanes=J.childLanes,B.lanes=J.lanes,B.child=J.child,B.subtreeFlags=0,B.deletions=null,B.memoizedProps=J.memoizedProps,B.memoizedState=J.memoizedState,B.updateQueue=J.updateQueue,B.type=J.type,$=J.dependencies,B.dependencies=$===null?null:{lanes:$.lanes,firstContext:$.firstContext}),j=j.sibling;return Ft(_r,_r.current&1|2),p.child}u=u.sibling}$.tail!==null&&Vr()>Cs&&(p.flags|=128,B=!0,Vn($,!1),p.lanes=4194304)}else{if(!B)if(u=vu(J),u!==null){if(p.flags|=128,B=!0,u=u.updateQueue,u!==null&&(p.updateQueue=u,p.flags|=4),Vn($,!0),$.tail===null&&$.tailMode==="hidden"&&!J.alternate&&!dr)return vr(p),null}else 2*Vr()-$.renderingStartTime>Cs&&j!==1073741824&&(p.flags|=128,B=!0,Vn($,!1),p.lanes=4194304);$.isBackwards?(J.sibling=p.child,p.child=J):(u=$.last,u!==null?u.sibling=J:p.child=J,$.last=J)}return $.tail!==null?(p=$.tail,$.rendering=p,$.tail=p.sibling,$.renderingStartTime=Vr(),p.sibling=null,u=_r.current,Ft(_r,B?u&1|2:u&1),p):(vr(p),null);case 22:case 23:return qu(),j=p.memoizedState!==null,u!==null&&u.memoizedState!==null!==j&&(p.flags|=8192),j&&(p.mode&1)!==0?(Fr&1073741824)!==0&&(vr(p),ue&&p.subtreeFlags&6&&(p.flags|=8192)):vr(p),null;case 24:return null;case 25:return null}throw Error(s(156,p.tag))}function _h(u,p){switch(ss(p),p.tag){case 1:return Gr(p.type)&&uo(),u=p.flags,u&65536?(p.flags=u&-65537|128,p):null;case 3:return vo(),fr(Mn),fr(un),Fc(),u=p.flags,(u&65536)!==0&&(u&128)===0?(p.flags=u&-65537|128,p):null;case 5:return jc(p),null;case 13:if(fr(_r),u=p.memoizedState,u!==null&&u.dehydrated!==null){if(p.alternate===null)throw Error(s(340));fo()}return u=p.flags,u&65536?(p.flags=u&-65537|128,p):null;case 19:return fr(_r),null;case 4:return vo(),null;case 10:return cs(p.type._context),null;case 22:case 23:return qu(),null;case 24:return null;default:return null}}var ml=!1,Yr=!1,$n=typeof WeakSet=="function"?WeakSet:Set,tt=null;function Zt(u,p){var j=u.ref;if(j!==null)if(typeof j=="function")try{j(null)}catch(B){pr(u,p,B)}else j.current=null}function Wn(u,p,j){try{j()}catch(B){pr(u,p,B)}}var Jc=!1;function Sh(u,p){for(X(u.containerInfo),tt=p;tt!==null;)if(u=tt,p=u.child,(u.subtreeFlags&1028)!==0&&p!==null)p.return=u,tt=p;else for(;tt!==null;){u=tt;try{var j=u.alternate;if((u.flags&1024)!==0)switch(u.tag){case 0:case 11:case 15:break;case 1:if(j!==null){var B=j.memoizedProps,$=j.memoizedState,J=u.stateNode,le=J.getSnapshotBeforeUpdate(u.elementType===u.type?B:Gn(u.type,B),$);J.__reactInternalSnapshotBeforeUpdate=le}break;case 3:ue&&Et(u.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(Ee){pr(u,u.return,Ee)}if(p=u.sibling,p!==null){p.return=u.return,tt=p;break}tt=u.return}return j=Jc,Jc=!1,j}function To(u,p,j){var B=p.updateQueue;if(B=B!==null?B.lastEffect:null,B!==null){var $=B=B.next;do{if(($.tag&u)===u){var J=$.destroy;$.destroy=void 0,J!==void 0&&Wn(p,j,J)}$=$.next}while($!==B)}}function yl(u,p){if(p=p.updateQueue,p=p!==null?p.lastEffect:null,p!==null){var j=p=p.next;do{if((j.tag&u)===u){var B=j.create;j.destroy=B()}j=j.next}while(j!==p)}}function Tu(u){var p=u.ref;if(p!==null){var j=u.stateNode;switch(u.tag){case 5:u=V(j);break;default:u=j}typeof p=="function"?p(u):p.current=u}}function _s(u){var p=u.alternate;p!==null&&(u.alternate=null,_s(p)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(p=u.stateNode,p!==null&&Te(p)),u.stateNode=null,u.return=null,u.dependencies=null,u.memoizedProps=null,u.memoizedState=null,u.pendingProps=null,u.stateNode=null,u.updateQueue=null}function ef(u){return u.tag===5||u.tag===3||u.tag===4}function Ro(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||ef(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&u.tag!==18;){if(u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function Ss(u,p,j){var B=u.tag;if(B===5||B===6)u=u.stateNode,p?kt(j,u,p):St(j,u);else if(B!==4&&(u=u.child,u!==null))for(Ss(u,p,j),u=u.sibling;u!==null;)Ss(u,p,j),u=u.sibling}function tf(u,p,j){var B=u.tag;if(B===5||B===6)u=u.stateNode,p?mt(j,u,p):Ke(j,u);else if(B!==4&&(u=u.child,u!==null))for(tf(u,p,j),u=u.sibling;u!==null;)tf(u,p,j),u=u.sibling}var Cr=null,jn=!1;function Si(u,p,j){for(j=j.child;j!==null;)Ru(u,p,j),j=j.sibling}function Ru(u,p,j){if(Ln&&typeof Ln.onCommitFiberUnmount=="function")try{Ln.onCommitFiberUnmount(Ra,j)}catch{}switch(j.tag){case 5:Yr||Zt(j,p);case 6:if(ue){var B=Cr,$=jn;Cr=null,Si(u,p,j),Cr=B,jn=$,Cr!==null&&(jn?Oe(Cr,j.stateNode):jt(Cr,j.stateNode))}else Si(u,p,j);break;case 18:ue&&Cr!==null&&(jn?rs(Cr,j.stateNode):Qs(Cr,j.stateNode));break;case 4:ue?(B=Cr,$=jn,Cr=j.stateNode.containerInfo,jn=!0,Si(u,p,j),Cr=B,jn=$):(fe&&(B=j.stateNode.containerInfo,$=ht(B),Pe(B,$)),Si(u,p,j));break;case 0:case 11:case 14:case 15:if(!Yr&&(B=j.updateQueue,B!==null&&(B=B.lastEffect,B!==null))){$=B=B.next;do{var J=$,le=J.destroy;J=J.tag,le!==void 0&&((J&2)!==0||(J&4)!==0)&&Wn(j,p,le),$=$.next}while($!==B)}Si(u,p,j);break;case 1:if(!Yr&&(Zt(j,p),B=j.stateNode,typeof B.componentWillUnmount=="function"))try{B.props=j.memoizedProps,B.state=j.memoizedState,B.componentWillUnmount()}catch(Ee){pr(j,p,Ee)}Si(u,p,j);break;case 21:Si(u,p,j);break;case 22:j.mode&1?(Yr=(B=Yr)||j.memoizedState!==null,Si(u,p,j),Yr=B):Si(u,p,j);break;default:Si(u,p,j)}}function Mo(u){var p=u.updateQueue;if(p!==null){u.updateQueue=null;var j=u.stateNode;j===null&&(j=u.stateNode=new $n),p.forEach(function(B){var $=ng.bind(null,u,B);j.has(B)||(j.add(B),B.then($,$))})}}function oi(u,p){var j=p.deletions;if(j!==null)for(var B=0;B<j.length;B++){var $=j[B];try{var J=u,le=p;if(ue){var Ee=le;e:for(;Ee!==null;){switch(Ee.tag){case 5:Cr=Ee.stateNode,jn=!1;break e;case 3:Cr=Ee.stateNode.containerInfo,jn=!0;break e;case 4:Cr=Ee.stateNode.containerInfo,jn=!0;break e}Ee=Ee.return}if(Cr===null)throw Error(s(160));Ru(J,le,$),Cr=null,jn=!1}else Ru(J,le,$);var Ie=$.alternate;Ie!==null&&(Ie.return=null),$.return=null}catch(Xe){pr($,p,Xe)}}if(p.subtreeFlags&12854)for(p=p.child;p!==null;)Es(p,u),p=p.sibling}function Es(u,p){var j=u.alternate,B=u.flags;switch(u.tag){case 0:case 11:case 14:case 15:if(oi(p,u),Yn(u),B&4){try{To(3,u,u.return),yl(3,u)}catch(nt){pr(u,u.return,nt)}try{To(5,u,u.return)}catch(nt){pr(u,u.return,nt)}}break;case 1:oi(p,u),Yn(u),B&512&&j!==null&&Zt(j,j.return);break;case 5:if(oi(p,u),Yn(u),B&512&&j!==null&&Zt(j,j.return),ue){if(u.flags&32){var $=u.stateNode;try{Se($)}catch(nt){pr(u,u.return,nt)}}if(B&4&&($=u.stateNode,$!=null)){var J=u.memoizedProps;if(j=j!==null?j.memoizedProps:J,B=u.type,p=u.updateQueue,u.updateQueue=null,p!==null)try{gt($,p,B,j,J,u)}catch(nt){pr(u,u.return,nt)}}}break;case 6:if(oi(p,u),Yn(u),B&4&&ue){if(u.stateNode===null)throw Error(s(162));$=u.stateNode,J=u.memoizedProps,j=j!==null?j.memoizedProps:J;try{Ue($,j,J)}catch(nt){pr(u,u.return,nt)}}break;case 3:if(oi(p,u),Yn(u),B&4){if(ue&&pe&&j!==null&&j.memoizedState.isDehydrated)try{ti(p.containerInfo)}catch(nt){pr(u,u.return,nt)}if(fe){$=p.containerInfo,J=p.pendingChildren;try{Pe($,J)}catch(nt){pr(u,u.return,nt)}}}break;case 4:if(oi(p,u),Yn(u),B&4&&fe){J=u.stateNode,$=J.containerInfo,J=J.pendingChildren;try{Pe($,J)}catch(nt){pr(u,u.return,nt)}}break;case 13:oi(p,u),Yn(u),$=u.child,$.flags&8192&&(J=$.memoizedState!==null,$.stateNode.isHidden=J,!J||$.alternate!==null&&$.alternate.memoizedState!==null||(xl=Vr())),B&4&&Mo(u);break;case 22:var le=j!==null&&j.memoizedState!==null;if(u.mode&1?(Yr=(j=Yr)||le,oi(p,u),Yr=j):oi(p,u),Yn(u),B&8192){if(j=u.memoizedState!==null,(u.stateNode.isHidden=j)&&!le&&(u.mode&1)!==0)for(tt=u,B=u.child;B!==null;){for(p=tt=B;tt!==null;){le=tt;var Ee=le.child;switch(le.tag){case 0:case 11:case 14:case 15:To(4,le,le.return);break;case 1:Zt(le,le.return);var Ie=le.stateNode;if(typeof Ie.componentWillUnmount=="function"){var Xe=le,st=le.return;try{var Tt=Xe;Ie.props=Tt.memoizedProps,Ie.state=Tt.memoizedState,Ie.componentWillUnmount()}catch(nt){pr(Xe,st,nt)}}break;case 5:Zt(le,le.return);break;case 22:if(le.memoizedState!==null){Nu(p);continue}}Ee!==null?(Ee.return=le,tt=Ee):Nu(p)}B=B.sibling}if(ue){e:if(B=null,ue)for(p=u;;){if(p.tag===5){if(B===null){B=p;try{$=p.stateNode,j?yt($):qe(p.stateNode,p.memoizedProps)}catch(nt){pr(u,u.return,nt)}}}else if(p.tag===6){if(B===null)try{J=p.stateNode,j?Fe(J):$e(J,p.memoizedProps)}catch(nt){pr(u,u.return,nt)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===u)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===u)break e;for(;p.sibling===null;){if(p.return===null||p.return===u)break e;B===p&&(B=null),p=p.return}B===p&&(B=null),p.sibling.return=p.return,p=p.sibling}}}break;case 19:oi(p,u),Yn(u),B&4&&Mo(u);break;case 21:break;default:oi(p,u),Yn(u)}}function Yn(u){var p=u.flags;if(p&2){try{if(ue){e:{for(var j=u.return;j!==null;){if(ef(j)){var B=j;break e}j=j.return}throw Error(s(160))}switch(B.tag){case 5:var $=B.stateNode;B.flags&32&&(Se($),B.flags&=-33);var J=Ro(u);tf(u,J,$);break;case 3:case 4:var le=B.stateNode.containerInfo,Ee=Ro(u);Ss(u,Ee,le);break;default:throw Error(s(161))}}}catch(Ie){pr(u,u.return,Ie)}u.flags&=-3}p&4096&&(u.flags&=-4097)}function bl(u,p,j){tt=u,Mu(u)}function Mu(u,p,j){for(var B=(u.mode&1)!==0;tt!==null;){var $=tt,J=$.child;if($.tag===22&&B){var le=$.memoizedState!==null||ml;if(!le){var Ee=$.alternate,Ie=Ee!==null&&Ee.memoizedState!==null||Yr;Ee=ml;var Xe=Yr;if(ml=le,(Yr=Ie)&&!Xe)for(tt=$;tt!==null;)le=tt,Ie=le.child,le.tag===22&&le.memoizedState!==null?Iu($):Ie!==null?(Ie.return=le,tt=Ie):Iu($);for(;J!==null;)tt=J,Mu(J),J=J.sibling;tt=$,ml=Ee,Yr=Xe}Lu(u)}else($.subtreeFlags&8772)!==0&&J!==null?(J.return=$,tt=J):Lu(u)}}function Lu(u){for(;tt!==null;){var p=tt;if((p.flags&8772)!==0){var j=p.alternate;try{if((p.flags&8772)!==0)switch(p.tag){case 0:case 11:case 15:Yr||yl(5,p);break;case 1:var B=p.stateNode;if(p.flags&4&&!Yr)if(j===null)B.componentDidMount();else{var $=p.elementType===p.type?j.memoizedProps:Gn(p.type,j.memoizedProps);B.componentDidUpdate($,j.memoizedState,B.__reactInternalSnapshotBeforeUpdate)}var J=p.updateQueue;J!==null&&fh(p,J,B);break;case 3:var le=p.updateQueue;if(le!==null){if(j=null,p.child!==null)switch(p.child.tag){case 5:j=V(p.child.stateNode);break;case 1:j=p.child.stateNode}fh(p,le,j)}break;case 5:var Ee=p.stateNode;j===null&&p.flags&4&&rt(Ee,p.type,p.memoizedProps,p);break;case 6:break;case 4:break;case 12:break;case 13:if(pe&&p.memoizedState===null){var Ie=p.alternate;if(Ie!==null){var Xe=Ie.memoizedState;if(Xe!==null){var st=Xe.dehydrated;st!==null&&Li(st)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(s(163))}Yr||p.flags&512&&Tu(p)}catch(Tt){pr(p,p.return,Tt)}}if(p===u){tt=null;break}if(j=p.sibling,j!==null){j.return=p.return,tt=j;break}tt=p.return}}function Nu(u){for(;tt!==null;){var p=tt;if(p===u){tt=null;break}var j=p.sibling;if(j!==null){j.return=p.return,tt=j;break}tt=p.return}}function Iu(u){for(;tt!==null;){var p=tt;try{switch(p.tag){case 0:case 11:case 15:var j=p.return;try{yl(4,p)}catch(Ie){pr(p,j,Ie)}break;case 1:var B=p.stateNode;if(typeof B.componentDidMount=="function"){var $=p.return;try{B.componentDidMount()}catch(Ie){pr(p,$,Ie)}}var J=p.return;try{Tu(p)}catch(Ie){pr(p,J,Ie)}break;case 5:var le=p.return;try{Tu(p)}catch(Ie){pr(p,le,Ie)}}}catch(Ie){pr(p,p.return,Ie)}if(p===u){tt=null;break}var Ee=p.sibling;if(Ee!==null){Ee.return=p.return,tt=Ee;break}tt=p.return}}var la=0,On=1,Ui=2,wl=3,xs=4;if(typeof Symbol=="function"&&Symbol.for){var Kn=Symbol.for;la=Kn("selector.component"),On=Kn("selector.has_pseudo_class"),Ui=Kn("selector.role"),wl=Kn("selector.test_id"),xs=Kn("selector.text")}function qi(u){var p=ye(u);if(p!=null){if(typeof p.memoizedProps["data-testname"]!="string")throw Error(s(364));return p}if(u=xe(u),u===null)throw Error(s(362));return u.stateNode.current}function Os(u,p){switch(p.$$typeof){case la:if(u.type===p.value)return!0;break;case On:e:{p=p.value,u=[u,0];for(var j=0;j<u.length;){var B=u[j++],$=u[j++],J=p[$];if(B.tag!==5||!de(B)){for(;J!=null&&Os(B,J);)$++,J=p[$];if($===p.length){p=!0;break e}else for(B=B.child;B!==null;)u.push(B,$),B=B.sibling}}p=!1}return p;case Ui:if(u.tag===5&&ke(u.stateNode,p.value))return!0;break;case xs:if((u.tag===5||u.tag===6)&&(u=ve(u),u!==null&&0<=u.indexOf(p.value)))return!0;break;case wl:if(u.tag===5&&(u=u.memoizedProps["data-testname"],typeof u=="string"&&u.toLowerCase()===p.value.toLowerCase()))return!0;break;default:throw Error(s(365))}return!1}function ju(u){switch(u.$$typeof){case la:return"<"+(T(u.value)||"Unknown")+">";case On:return":has("+(ju(u)||"")+")";case Ui:return'[role="'+u.value+'"]';case xs:return'"'+u.value+'"';case wl:return'[data-testname="'+u.value+'"]';default:throw Error(s(365))}}function Hi(u,p){var j=[];u=[u,0];for(var B=0;B<u.length;){var $=u[B++],J=u[B++],le=p[J];if($.tag!==5||!de($)){for(;le!=null&&Os($,le);)J++,le=p[J];if(J===p.length)j.push($);else for($=$.child;$!==null;)u.push($,J),$=$.sibling}}return j}function Gi(u,p){if(!he)throw Error(s(363));u=qi(u),u=Hi(u,p),p=[],u=Array.from(u);for(var j=0;j<u.length;){var B=u[j++];if(B.tag===5)de(B)||p.push(B.stateNode);else for(B=B.child;B!==null;)u.push(B),B=B.sibling}return p}var Du=Math.ceil,Ps=c.ReactCurrentDispatcher,_l=c.ReactCurrentOwner,Er=c.ReactCurrentBatchConfig,Mt=0,nr=null,mr=null,kr=0,Fr=0,$a=Zr(0),yr=0,Sl=null,sa=0,lr=0,El=0,Lo=null,dn=null,xl=0,Cs=1/0,Pn=null;function tr(){Cs=Vr()+500}var xr=!1,Tr=null,Ei=null,Wa=!1,li=null,Fu=0,Rr=0,ks=null,Ol=-1,Pl=0;function hr(){return(Mt&6)!==0?Vr():Ol!==-1?Ol:Ol=Vr()}function zr(u){return(u.mode&1)===0?1:(Mt&2)!==0&&kr!==0?kr&-kr:eg.transition!==null?(Pl===0&&(Pl=ru()),Pl):(u=zt,u!==0?u:je())}function hn(u,p,j,B){if(50<Rr)throw Rr=0,ks=null,Error(s(185));ri(u,j,B),((Mt&2)===0||u!==nr)&&(u===nr&&((Mt&2)===0&&(lr|=j),yr===4&&ua(u,kr)),pn(u,B),j===1&&Mt===0&&(p.mode&1)===0&&(tr(),al&&Qr()))}function pn(u,p){var j=u.callbackNode;Qd(u,p);var B=tl(u,u===nr?kr:0);if(B===0)j!==null&&Jd(j),u.callbackNode=null,u.callbackPriority=0;else if(p=B&-B,u.callbackPriority!==p){if(j!=null&&Jd(j),p===1)u.tag===0?th(rf.bind(null,u)):lu(rf.bind(null,u)),se?_e(function(){(Mt&6)===0&&Qr()}):ji(nu,Qr),j=null;else{switch(nl(B)){case 1:j=nu;break;case 4:j=iu;break;case 16:j=au;break;case 536870912:j=Jp;break;default:j=au}j=cf(j,zu.bind(null,u))}u.callbackPriority=p,u.callbackNode=j}}function zu(u,p){if(Ol=-1,Pl=0,(Mt&6)!==0)throw Error(s(327));var j=u.callbackNode;if(ca()&&u.callbackNode!==j)return null;var B=tl(u,u===nr?kr:0);if(B===0)return null;if((B&30)!==0||(B&u.expiredLanes)!==0||p)p=No(u,B);else{p=B;var $=Mt;Mt|=2;var J=af();(nr!==u||kr!==p)&&(Pn=null,tr(),Ya(u,p));do try{of();break}catch(Ee){Cl(u,Ee)}while(!0);Mc(),Ps.current=J,Mt=$,mr!==null?p=0:(nr=null,kr=0,p=yr)}if(p!==0){if(p===2&&($=tu(u),$!==0&&(B=$,p=Bu(u,$))),p===1)throw j=Sl,Ya(u,0),ua(u,B),pn(u,Vr()),j;if(p===6)ua(u,B);else{if($=u.current.alternate,(B&30)===0&&!Eh($)&&(p=No(u,B),p===2&&(J=tu(u),J!==0&&(B=J,p=Bu(u,J))),p===1))throw j=Sl,Ya(u,0),ua(u,B),pn(u,Vr()),j;switch(u.finishedWork=$,u.finishedLanes=B,p){case 0:case 1:throw Error(s(345));case 2:Ka(u,dn,Pn);break;case 3:if(ua(u,B),(B&130023424)===B&&(p=xl+500-Vr(),10<p)){if(tl(u,0)!==0)break;if($=u.suspendedLanes,($&B)!==B){hr(),u.pingedLanes|=u.suspendedLanes&$;break}u.timeoutHandle=Z(Ka.bind(null,u,dn,Pn),p);break}Ka(u,dn,Pn);break;case 4:if(ua(u,B),(B&4194240)===B)break;for(p=u.eventTimes,$=-1;0<B;){var le=31-zn(B);J=1<<le,le=p[le],le>$&&($=le),B&=~J}if(B=$,B=Vr()-B,B=(120>B?120:480>B?480:1080>B?1080:1920>B?1920:3e3>B?3e3:4320>B?4320:1960*Du(B/1960))-B,10<B){u.timeoutHandle=Z(Ka.bind(null,u,dn,Pn),B);break}Ka(u,dn,Pn);break;case 5:Ka(u,dn,Pn);break;default:throw Error(s(329))}}}return pn(u,Vr()),u.callbackNode===j?zu.bind(null,u):null}function Bu(u,p){var j=Lo;return u.current.memoizedState.isDehydrated&&(Ya(u,p).flags|=256),u=No(u,p),u!==2&&(p=dn,dn=j,p!==null&&Uu(p)),u}function Uu(u){dn===null?dn=u:dn.push.apply(dn,u)}function Eh(u){for(var p=u;;){if(p.flags&16384){var j=p.updateQueue;if(j!==null&&(j=j.stores,j!==null))for(var B=0;B<j.length;B++){var $=j[B],J=$.getSnapshot;$=$.value;try{if(!mi(J(),$))return!1}catch{return!1}}}if(j=p.child,p.subtreeFlags&16384&&j!==null)j.return=p,p=j;else{if(p===u)break;for(;p.sibling===null;){if(p.return===null||p.return===u)return!0;p=p.return}p.sibling.return=p.return,p=p.sibling}}return!0}function ua(u,p){for(p&=~El,p&=~lr,u.suspendedLanes|=p,u.pingedLanes&=~p,u=u.expirationTimes;0<p;){var j=31-zn(p),B=1<<j;u[j]=-1,p&=~B}}function rf(u){if((Mt&6)!==0)throw Error(s(327));ca();var p=tl(u,0);if((p&1)===0)return pn(u,Vr()),null;var j=No(u,p);if(u.tag!==0&&j===2){var B=tu(u);B!==0&&(p=B,j=Bu(u,B))}if(j===1)throw j=Sl,Ya(u,0),ua(u,p),pn(u,Vr()),j;if(j===6)throw Error(s(345));return u.finishedWork=u.current.alternate,u.finishedLanes=p,Ka(u,dn,Pn),pn(u,Vr()),null}function nf(u){li!==null&&li.tag===0&&(Mt&6)===0&&ca();var p=Mt;Mt|=1;var j=Er.transition,B=zt;try{if(Er.transition=null,zt=1,u)return u()}finally{zt=B,Er.transition=j,Mt=p,(Mt&6)===0&&Qr()}}function qu(){Fr=$a.current,fr($a)}function Ya(u,p){u.finishedWork=null,u.finishedLanes=0;var j=u.timeoutHandle;if(j!==ne&&(u.timeoutHandle=ne,re(j)),mr!==null)for(j=mr.return;j!==null;){var B=j;switch(ss(B),B.tag){case 1:B=B.type.childContextTypes,B!=null&&uo();break;case 3:vo(),fr(Mn),fr(un),Fc();break;case 5:jc(B);break;case 4:vo();break;case 13:fr(_r);break;case 19:fr(_r);break;case 10:cs(B.type._context);break;case 22:case 23:qu()}j=j.return}if(nr=u,mr=u=Xa(u.current,null),kr=Fr=p,yr=0,Sl=null,El=lr=sa=0,dn=Lo=null,La!==null){for(p=0;p<La.length;p++)if(j=La[p],B=j.interleaved,B!==null){j.interleaved=null;var $=B.next,J=j.pending;if(J!==null){var le=J.next;J.next=$,B.next=le}j.pending=B}La=null}return u}function Cl(u,p){do{var j=mr;try{if(Mc(),In.current=Eo,fl){for(var B=gr.memoizedState;B!==null;){var $=B.queue;$!==null&&($.pending=null),B=B.next}fl=!1}if(Da=0,jr=Ar=gr=null,ds=!1,hs=0,_l.current=null,j===null||j.return===null){yr=1,Sl=p,mr=null;break}e:{var J=u,le=j.return,Ee=j,Ie=p;if(p=kr,Ee.flags|=32768,Ie!==null&&typeof Ie=="object"&&typeof Ie.then=="function"){var Xe=Ie,st=Ee,Tt=st.tag;if((st.mode&1)===0&&(Tt===0||Tt===11||Tt===15)){var nt=st.alternate;nt?(st.updateQueue=nt.updateQueue,st.memoizedState=nt.memoizedState,st.lanes=nt.lanes):(st.updateQueue=null,st.memoizedState=null)}var sr=bh(le);if(sr!==null){sr.flags&=-257,Ba(sr,le,Ee,J,p),sr.mode&1&&yh(J,Xe,p),p=sr,Ie=Xe;var Qt=p.updateQueue;if(Qt===null){var Cn=new Set;Cn.add(Ie),p.updateQueue=Cn}else Qt.add(Ie);break e}else{if((p&1)===0){yh(J,Xe,p),kl();break e}Ie=Error(s(426))}}else if(dr&&Ee.mode&1){var Vi=bh(le);if(Vi!==null){(Vi.flags&65536)===0&&(Vi.flags|=256),Ba(Vi,le,Ee,J,p),Tc(xo(Ie,Ee));break e}}J=Ie=xo(Ie,Ee),yr!==4&&(yr=2),Lo===null?Lo=[J]:Lo.push(J),J=le;do{switch(J.tag){case 3:J.flags|=65536,p&=-p,J.lanes|=p;var Le=Fi(J,Ie,p);ul(J,Le);break e;case 1:Ee=Ie;var Ce=J.type,De=J.stateNode;if((J.flags&128)===0&&(typeof Ce.getDerivedStateFromError=="function"||De!==null&&typeof De.componentDidCatch=="function"&&(Ei===null||!Ei.has(De)))){J.flags|=65536,p&=-p,J.lanes|=p;var it=Pu(J,Ee,p);ul(J,it);break e}}J=J.return}while(J!==null)}sf(j)}catch(_t){p=_t,mr===j&&j!==null&&(mr=j=j.return);continue}break}while(!0)}function af(){var u=Ps.current;return Ps.current=Eo,u===null?Eo:u}function kl(){(yr===0||yr===3||yr===2)&&(yr=4),nr===null||(sa&268435455)===0&&(lr&268435455)===0||ua(nr,kr)}function No(u,p){var j=Mt;Mt|=2;var B=af();(nr!==u||kr!==p)&&(Pn=null,Ya(u,p));do try{xh();break}catch($){Cl(u,$)}while(!0);if(Mc(),Mt=j,Ps.current=B,mr!==null)throw Error(s(261));return nr=null,kr=0,yr}function xh(){for(;mr!==null;)lf(mr)}function of(){for(;mr!==null&&!eh();)lf(mr)}function lf(u){var p=Ah(u.alternate,u,Fr);u.memoizedProps=u.pendingProps,p===null?sf(u):mr=p,_l.current=null}function sf(u){var p=u;do{var j=p.alternate;if(u=p.return,(p.flags&32768)===0){if(j=Ao(j,p,Fr),j!==null){mr=j;return}}else{if(j=_h(j,p),j!==null){j.flags&=32767,mr=j;return}if(u!==null)u.flags|=32768,u.subtreeFlags=0,u.deletions=null;else{yr=6,mr=null;return}}if(p=p.sibling,p!==null){mr=p;return}mr=p=u}while(p!==null);yr===0&&(yr=5)}function Ka(u,p,j){var B=zt,$=Er.transition;try{Er.transition=null,zt=1,Oh(u,p,j,B)}finally{Er.transition=$,zt=B}return null}function Oh(u,p,j,B){do ca();while(li!==null);if((Mt&6)!==0)throw Error(s(327));j=u.finishedWork;var $=u.finishedLanes;if(j===null)return null;if(u.finishedWork=null,u.finishedLanes=0,j===u.current)throw Error(s(177));u.callbackNode=null,u.callbackPriority=0;var J=j.lanes|j.childLanes;if(Ta(u,J),u===nr&&(mr=nr=null,kr=0),(j.subtreeFlags&2064)===0&&(j.flags&2064)===0||Wa||(Wa=!0,cf(au,function(){return ca(),null})),J=(j.flags&15990)!==0,(j.subtreeFlags&15990)!==0||J){J=Er.transition,Er.transition=null;var le=zt;zt=1;var Ee=Mt;Mt|=4,_l.current=null,Sh(u,j),Es(j,u),q(u.containerInfo),u.current=j,bl(j),as(),Mt=Ee,zt=le,Er.transition=J}else u.current=j;if(Wa&&(Wa=!1,li=u,Fu=$),J=u.pendingLanes,J===0&&(Ei=null),il(j.stateNode),pn(u,Vr()),p!==null)for(B=u.onRecoverableError,j=0;j<p.length;j++)$=p[j],B($.value,{componentStack:$.stack,digest:$.digest});if(xr)throw xr=!1,u=Tr,Tr=null,u;return(Fu&1)!==0&&u.tag!==0&&ca(),J=u.pendingLanes,(J&1)!==0?u===ks?Rr++:(Rr=0,ks=u):Rr=0,Qr(),null}function ca(){if(li!==null){var u=nl(Fu),p=Er.transition,j=zt;try{if(Er.transition=null,zt=16>u?16:u,li===null)var B=!1;else{if(u=li,li=null,Fu=0,(Mt&6)!==0)throw Error(s(331));var $=Mt;for(Mt|=4,tt=u.current;tt!==null;){var J=tt,le=J.child;if((tt.flags&16)!==0){var Ee=J.deletions;if(Ee!==null){for(var Ie=0;Ie<Ee.length;Ie++){var Xe=Ee[Ie];for(tt=Xe;tt!==null;){var st=tt;switch(st.tag){case 0:case 11:case 15:To(8,st,J)}var Tt=st.child;if(Tt!==null)Tt.return=st,tt=Tt;else for(;tt!==null;){st=tt;var nt=st.sibling,sr=st.return;if(_s(st),st===Xe){tt=null;break}if(nt!==null){nt.return=sr,tt=nt;break}tt=sr}}}var Qt=J.alternate;if(Qt!==null){var Cn=Qt.child;if(Cn!==null){Qt.child=null;do{var Vi=Cn.sibling;Cn.sibling=null,Cn=Vi}while(Cn!==null)}}tt=J}}if((J.subtreeFlags&2064)!==0&&le!==null)le.return=J,tt=le;else e:for(;tt!==null;){if(J=tt,(J.flags&2048)!==0)switch(J.tag){case 0:case 11:case 15:To(9,J,J.return)}var Le=J.sibling;if(Le!==null){Le.return=J.return,tt=Le;break e}tt=J.return}}var Ce=u.current;for(tt=Ce;tt!==null;){le=tt;var De=le.child;if((le.subtreeFlags&2064)!==0&&De!==null)De.return=le,tt=De;else e:for(le=Ce;tt!==null;){if(Ee=tt,(Ee.flags&2048)!==0)try{switch(Ee.tag){case 0:case 11:case 15:yl(9,Ee)}}catch(_t){pr(Ee,Ee.return,_t)}if(Ee===le){tt=null;break e}var it=Ee.sibling;if(it!==null){it.return=Ee.return,tt=it;break e}tt=Ee.return}}if(Mt=$,Qr(),Ln&&typeof Ln.onPostCommitFiberRoot=="function")try{Ln.onPostCommitFiberRoot(Ra,u)}catch{}B=!0}return B}finally{zt=j,Er.transition=p}}return!1}function uf(u,p,j){p=xo(j,p),p=Fi(u,p,1),u=na(u,p,1),p=hr(),u!==null&&(ri(u,1,p),pn(u,p))}function pr(u,p,j){if(u.tag===3)uf(u,u,j);else for(;p!==null;){if(p.tag===3){uf(p,u,j);break}else if(p.tag===1){var B=p.stateNode;if(typeof p.type.getDerivedStateFromError=="function"||typeof B.componentDidCatch=="function"&&(Ei===null||!Ei.has(B))){u=xo(j,u),u=Pu(p,u,1),p=na(p,u,1),u=hr(),p!==null&&(ri(p,1,u),pn(p,u));break}}p=p.return}}function Ph(u,p,j){var B=u.pingCache;B!==null&&B.delete(p),p=hr(),u.pingedLanes|=u.suspendedLanes&j,nr===u&&(kr&j)===j&&(yr===4||yr===3&&(kr&130023424)===kr&&500>Vr()-xl?Ya(u,0):El|=j),pn(u,p)}function Ch(u,p){p===0&&((u.mode&1)===0?p=1:(p=is,is<<=1,(is&130023424)===0&&(is=4194304)));var j=hr();u=_i(u,p),u!==null&&(ri(u,p,j),pn(u,j))}function kh(u){var p=u.memoizedState,j=0;p!==null&&(j=p.retryLane),Ch(u,j)}function ng(u,p){var j=0;switch(u.tag){case 13:var B=u.stateNode,$=u.memoizedState;$!==null&&(j=$.retryLane);break;case 19:B=u.stateNode;break;default:throw Error(s(314))}B!==null&&B.delete(p),Ch(u,j)}var Ah;Ah=function(u,p,j){if(u!==null)if(u.memoizedProps!==p.pendingProps||Mn.current)Dr=!0;else{if((u.lanes&j)===0&&(p.flags&128)===0)return Dr=!1,qa(u,p,j);Dr=(u.flags&131072)!==0}else Dr=!1,dr&&(p.flags&1048576)!==0&&rh(p,co,p.index);switch(p.lanes=0,p.tag){case 2:var B=p.type;ws(u,p),u=p.pendingProps;var $=Ji(p,un.current);sl(p,j),$=ps(null,p,B,u,$,j);var J=mu();return p.flags|=1,typeof $=="object"&&$!==null&&typeof $.render=="function"&&$.$$typeof===void 0?(p.tag=1,p.memoizedState=null,p.updateQueue=null,Gr(B)?(J=!0,Jo(p)):J=!1,p.memoizedState=$.state!==null&&$.state!==void 0?$.state:null,Nc(p),$.updater=ms,p.stateNode=$,$._reactInternals=p,Di(p,B,u,j),p=cn(null,p,B,!0,J,j)):(p.tag=0,dr&&J&&ls(p),Wr(null,p,$,j),p=p.child),p;case 16:B=p.elementType;e:{switch(ws(u,p),u=p.pendingProps,$=B._init,B=$(B._payload),p.type=B,$=p.tag=ig(B),u=Gn(B,u),$){case 0:p=zi(null,p,B,u,j);break e;case 1:p=tn(null,p,B,u,j);break e;case 11:p=Cu(null,p,B,u,j);break e;case 14:p=Oo(null,p,B,Gn(B.type,u),j);break e}throw Error(s(306,B,""))}return p;case 0:return B=p.type,$=p.pendingProps,$=p.elementType===B?$:Gn(B,$),zi(u,p,B,$,j);case 1:return B=p.type,$=p.pendingProps,$=p.elementType===B?$:Gn(B,$),tn(u,p,B,$,j);case 3:e:{if(Ua(p),u===null)throw Error(s(387));B=p.pendingProps,J=p.memoizedState,$=J.element,ch(u,p),Na(p,B,null,j);var le=p.memoizedState;if(B=le.element,pe&&J.isDehydrated)if(J={element:B,isDehydrated:!1,cache:le.cache,pendingSuspenseBoundaries:le.pendingSuspenseBoundaries,transitions:le.transitions},p.updateQueue.baseState=J,p.memoizedState=J,p.flags&256){$=xo(Error(s(423)),p),p=Po(u,p,B,j,$);break e}else if(B!==$){$=xo(Error(s(424)),p),p=Po(u,p,B,j,$);break e}else for(pe&&(_n=cr(p.stateNode.containerInfo),Jr=p,dr=!0,wi=null,us=!1),j=sh(p,null,B,j),p.child=j;j;)j.flags=j.flags&-3|4096,j=j.sibling;else{if(fo(),B===$){p=oa(u,p,j);break e}Wr(u,p,B,j)}p=p.child}return p;case 5:return Ic(p),u===null&&Ac(p),B=p.type,$=p.pendingProps,J=u!==null?u.memoizedProps:null,le=$.children,te(B,$)?le=null:J!==null&&te(B,J)&&(p.flags|=32),rr(u,p),Wr(u,p,le,j),p.child;case 6:return u===null&&Ac(p),null;case 13:return Qc(u,p,j);case 4:return gu(p,p.stateNode.containerInfo),B=p.pendingProps,u===null?p.child=po(p,null,B,j):Wr(u,p,B,j),p.child;case 11:return B=p.type,$=p.pendingProps,$=p.elementType===B?$:Gn(B,$),Cu(u,p,B,$,j);case 7:return Wr(u,p,p.pendingProps,j),p.child;case 8:return Wr(u,p,p.pendingProps.children,j),p.child;case 12:return Wr(u,p,p.pendingProps.children,j),p.child;case 10:e:{if(B=p.type._context,$=p.pendingProps,J=p.memoizedProps,le=$.value,uh(p,B,le),J!==null)if(mi(J.value,le)){if(J.children===$.children&&!Mn.current){p=oa(u,p,j);break e}}else for(J=p.child,J!==null&&(J.return=p);J!==null;){var Ee=J.dependencies;if(Ee!==null){le=J.child;for(var Ie=Ee.firstContext;Ie!==null;){if(Ie.context===B){if(J.tag===1){Ie=ra(-1,j&-j),Ie.tag=2;var Xe=J.updateQueue;if(Xe!==null){Xe=Xe.shared;var st=Xe.pending;st===null?Ie.next=Ie:(Ie.next=st.next,st.next=Ie),Xe.pending=Ie}}J.lanes|=j,Ie=J.alternate,Ie!==null&&(Ie.lanes|=j),go(J.return,j,p),Ee.lanes|=j;break}Ie=Ie.next}}else if(J.tag===10)le=J.type===p.type?null:J.child;else if(J.tag===18){if(le=J.return,le===null)throw Error(s(341));le.lanes|=j,Ee=le.alternate,Ee!==null&&(Ee.lanes|=j),go(le,j,p),le=J.sibling}else le=J.child;if(le!==null)le.return=J;else for(le=J;le!==null;){if(le===p){le=null;break}if(J=le.sibling,J!==null){J.return=le.return,le=J;break}le=le.return}J=le}Wr(u,p,$.children,j),p=p.child}return p;case 9:return $=p.type,B=p.pendingProps.children,sl(p,j),$=Un($),B=B($),p.flags|=1,Wr(u,p,B,j),p.child;case 14:return B=p.type,$=Gn(B,p.pendingProps),$=Gn(B.type,$),Oo(u,p,B,$,j);case 15:return aa(u,p,p.type,p.pendingProps,j);case 17:return B=p.type,$=p.pendingProps,$=p.elementType===B?$:Gn(B,$),ws(u,p),p.tag=1,Gr(B)?(u=!0,Jo(p)):u=!1,sl(p,j),mh(p,B,$),Di(p,B,$,j),cn(null,p,B,!0,u,j);case 19:return Au(u,p,j);case 22:return or(u,p,j)}throw Error(s(156,p.tag))};function cf(u,p){return ji(u,p)}function Th(u,p,j,B){this.tag=u,this.key=j,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=p,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=B,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xn(u,p,j,B){return new Th(u,p,j,B)}function Al(u){return u=u.prototype,!(!u||!u.isReactComponent)}function ig(u){if(typeof u=="function")return Al(u)?1:0;if(u!=null){if(u=u.$$typeof,u===x)return 11;if(u===g)return 14}return 2}function Xa(u,p){var j=u.alternate;return j===null?(j=Xn(u.tag,p,u.key,u.mode),j.elementType=u.elementType,j.type=u.type,j.stateNode=u.stateNode,j.alternate=u,u.alternate=j):(j.pendingProps=p,j.type=u.type,j.flags=0,j.subtreeFlags=0,j.deletions=null),j.flags=u.flags&14680064,j.childLanes=u.childLanes,j.lanes=u.lanes,j.child=u.child,j.memoizedProps=u.memoizedProps,j.memoizedState=u.memoizedState,j.updateQueue=u.updateQueue,p=u.dependencies,j.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext},j.sibling=u.sibling,j.index=u.index,j.ref=u.ref,j}function Hu(u,p,j,B,$,J){var le=2;if(B=u,typeof u=="function")Al(u)&&(le=1);else if(typeof u=="string")le=5;else e:switch(u){case v:return rn(j.children,$,J,p);case y:le=8,$|=8;break;case E:return u=Xn(12,j,p,$|2),u.elementType=E,u.lanes=J,u;case _:return u=Xn(13,j,p,$),u.elementType=_,u.lanes=J,u;case b:return u=Xn(19,j,p,$),u.elementType=b,u.lanes=J,u;case d:return Tl(j,$,J,p);default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case w:le=10;break e;case S:le=9;break e;case x:le=11;break e;case g:le=14;break e;case h:le=16,B=null;break e}throw Error(s(130,u==null?u:typeof u,""))}return p=Xn(le,j,p,$),p.elementType=u,p.type=B,p.lanes=J,p}function rn(u,p,j,B){return u=Xn(7,u,B,p),u.lanes=j,u}function Tl(u,p,j,B){return u=Xn(22,u,B,p),u.elementType=d,u.lanes=j,u.stateNode={isHidden:!1},u}function Rl(u,p,j){return u=Xn(6,u,null,p),u.lanes=j,u}function Gu(u,p,j){return p=Xn(4,u.children!==null?u.children:[],u.key,p),p.lanes=j,p.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},p}function Rh(u,p,j,B,$){this.tag=p,this.containerInfo=u,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=ne,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=rl(0),this.expirationTimes=rl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rl(0),this.identifierPrefix=B,this.onRecoverableError=$,pe&&(this.mutableSourceEagerHydrationData=null)}function ff(u,p,j,B,$,J,le,Ee,Ie){return u=new Rh(u,p,j,Ee,Ie),p===1?(p=1,J===!0&&(p|=8)):p=0,J=Xn(3,null,null,p),u.current=J,J.stateNode=u,J.memoizedState={element:B,isDehydrated:j,cache:null,transitions:null,pendingSuspenseBoundaries:null},Nc(J),u}function Vu(u){if(!u)return Aa;u=u._reactInternals;e:{if(F(u)!==u||u.tag!==1)throw Error(s(170));var p=u;do{switch(p.tag){case 3:p=p.stateNode.context;break e;case 1:if(Gr(p.type)){p=p.stateNode.__reactInternalMemoizedMergedChildContext;break e}}p=p.return}while(p!==null);throw Error(s(171))}if(u.tag===1){var j=u.type;if(Gr(j))return Xd(u,j,p)}return p}function Io(u){var p=u._reactInternals;if(p===void 0)throw typeof u.render=="function"?Error(s(188)):(u=Object.keys(u).join(","),Error(s(268,u)));return u=N(p),u===null?null:u.stateNode}function $u(u,p){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var j=u.retryLane;u.retryLane=j!==0&&j<p?j:p}}function Ml(u,p){$u(u,p),(u=u.alternate)&&$u(u,p)}function ag(u){return u=N(u),u===null?null:u.stateNode}function Mh(){return null}return t.attemptContinuousHydration=function(u){if(u.tag===13){var p=_i(u,134217728);if(p!==null){var j=hr();hn(p,u,134217728,j)}Ml(u,134217728)}},t.attemptDiscreteHydration=function(u){if(u.tag===13){var p=_i(u,1);if(p!==null){var j=hr();hn(p,u,1,j)}Ml(u,1)}},t.attemptHydrationAtCurrentPriority=function(u){if(u.tag===13){var p=zr(u),j=_i(u,p);if(j!==null){var B=hr();hn(j,u,p,B)}Ml(u,p)}},t.attemptSynchronousHydration=function(u){switch(u.tag){case 3:var p=u.stateNode;if(p.current.memoizedState.isDehydrated){var j=el(p.pendingLanes);j!==0&&(Ii(p,j|1),pn(p,Vr()),(Mt&6)===0&&(tr(),Qr()))}break;case 13:nf(function(){var B=_i(u,1);if(B!==null){var $=hr();hn(B,u,1,$)}}),Ml(u,1)}},t.batchedUpdates=function(u,p){var j=Mt;Mt|=1;try{return u(p)}finally{Mt=j,Mt===0&&(tr(),al&&Qr())}},t.createComponentSelector=function(u){return{$$typeof:la,value:u}},t.createContainer=function(u,p,j,B,$,J,le){return ff(u,p,!1,null,j,B,$,J,le)},t.createHasPseudoClassSelector=function(u){return{$$typeof:On,value:u}},t.createHydrationContainer=function(u,p,j,B,$,J,le,Ee,Ie){return u=ff(j,B,!0,u,$,J,le,Ee,Ie),u.context=Vu(null),j=u.current,B=hr(),$=zr(j),J=ra(B,$),J.callback=p??null,na(j,J,$),u.current.lanes=$,ri(u,$,B),pn(u,B),u},t.createPortal=function(u,p,j){var B=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:B==null?null:""+B,children:u,containerInfo:p,implementation:j}},t.createRoleSelector=function(u){return{$$typeof:Ui,value:u}},t.createTestNameSelector=function(u){return{$$typeof:wl,value:u}},t.createTextSelector=function(u){return{$$typeof:xs,value:u}},t.deferredUpdates=function(u){var p=zt,j=Er.transition;try{return Er.transition=null,zt=16,u()}finally{zt=p,Er.transition=j}},t.discreteUpdates=function(u,p,j,B,$){var J=zt,le=Er.transition;try{return Er.transition=null,zt=1,u(p,j,B,$)}finally{zt=J,Er.transition=le,Mt===0&&tr()}},t.findAllNodes=Gi,t.findBoundingRects=function(u,p){if(!he)throw Error(s(363));p=Gi(u,p),u=[];for(var j=0;j<p.length;j++)u.push(oe(p[j]));for(p=u.length-1;0<p;p--){j=u[p];for(var B=j.x,$=B+j.width,J=j.y,le=J+j.height,Ee=p-1;0<=Ee;Ee--)if(p!==Ee){var Ie=u[Ee],Xe=Ie.x,st=Xe+Ie.width,Tt=Ie.y,nt=Tt+Ie.height;if(B>=Xe&&J>=Tt&&$<=st&&le<=nt){u.splice(p,1);break}else if(B!==Xe||j.width!==Ie.width||nt<J||Tt>le){if(!(J!==Tt||j.height!==Ie.height||st<B||Xe>$)){Xe>B&&(Ie.width+=Xe-B,Ie.x=B),st<$&&(Ie.width=$-Xe),u.splice(p,1);break}}else{Tt>J&&(Ie.height+=Tt-J,Ie.y=J),nt<le&&(Ie.height=le-Tt),u.splice(p,1);break}}}return u},t.findHostInstance=Io,t.findHostInstanceWithNoPortals=function(u){return u=O(u),u=u!==null?R(u):null,u===null?null:u.stateNode},t.findHostInstanceWithWarning=function(u){return Io(u)},t.flushControlled=function(u){var p=Mt;Mt|=1;var j=Er.transition,B=zt;try{Er.transition=null,zt=1,u()}finally{zt=B,Er.transition=j,Mt=p,Mt===0&&(tr(),Qr())}},t.flushPassiveEffects=ca,t.flushSync=nf,t.focusWithin=function(u,p){if(!he)throw Error(s(363));for(u=qi(u),p=Hi(u,p),p=Array.from(p),u=0;u<p.length;){var j=p[u++];if(!de(j)){if(j.tag===5&&Be(j.stateNode))return!0;for(j=j.child;j!==null;)p.push(j),j=j.sibling}}return!1},t.getCurrentUpdatePriority=function(){return zt},t.getFindAllNodesFailureDescription=function(u,p){if(!he)throw Error(s(363));var j=0,B=[];u=[qi(u),0];for(var $=0;$<u.length;){var J=u[$++],le=u[$++],Ee=p[le];if((J.tag!==5||!de(J))&&(Os(J,Ee)&&(B.push(ju(Ee)),le++,le>j&&(j=le)),le<p.length))for(J=J.child;J!==null;)u.push(J,le),J=J.sibling}if(j<p.length){for(u=[];j<p.length;j++)u.push(ju(p[j]));return`findAllNodes was able to match part of the selector:
58
- `+(B.join(" > ")+`
59
-
60
- No matching component was found for:
61
- `)+u.join(" > ")}return null},t.getPublicRootInstance=function(u){if(u=u.current,!u.child)return null;switch(u.child.tag){case 5:return V(u.child.stateNode);default:return u.child.stateNode}},t.injectIntoDevTools=function(u){if(u={bundleType:u.bundleType,version:u.version,rendererPackageName:u.rendererPackageName,rendererConfig:u.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:c.ReactCurrentDispatcher,findHostInstanceByFiber:ag,findFiberByHostInstance:u.findFiberByHostInstance||Mh,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")u=!1;else{var p=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(p.isDisabled||!p.supportsFiber)u=!0;else{try{Ra=p.inject(u),Ln=p}catch{}u=!!p.checkDCE}}return u},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(u,p,j,B){if(!he)throw Error(s(363));u=Gi(u,p);var $=Qe(u,j,B).disconnect;return{disconnect:function(){$()}}},t.registerMutableSourceForHydration=function(u,p){var j=p._getVersion;j=j(p._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[p,j]:u.mutableSourceEagerHydrationData.push(p,j)},t.runWithPriority=function(u,p){var j=zt;try{return zt=u,p()}finally{zt=j}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(u,p,j,B){var $=p.current,J=hr(),le=zr($);return j=Vu(j),p.context===null?p.context=j:p.pendingContext=j,p=ra(J,le),p.payload={element:u},B=B===void 0?null:B,B!==null&&(p.callback=B),u=na($,p,le),u!==null&&(hn(u,$,le,J),fs(u,$,le)),le},t}),Zg}var c2;function Q9(){return c2||(c2=1,Xg.exports=Z9()),Xg.exports}var J9=Q9();const e7=jd(J9);var Qg={exports:{}},Ul={};/**
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
- */var f2;function t7(){return f2||(f2=1,Ul.ConcurrentRoot=1,Ul.ContinuousEventPriority=4,Ul.DefaultEventPriority=16,Ul.DiscreteEventPriority=1,Ul.IdleEventPriority=536870912,Ul.LegacyRoot=0),Ul}var d2;function r7(){return d2||(d2=1,Qg.exports=t7()),Qg.exports}var xw=r7(),n7=Dt();const h2={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let p2=!1,g2=!1;const Lv=".react-konva-event";let Ow=!1;function i7(e){Ow=e}const a7=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
70
- 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
- `,o7=`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
- `,l7={};function Bp(e,n,t=l7){if(!p2&&"zIndex"in n&&(console.warn(o7),p2=!0),!g2&&n.draggable){var r=n.x!==void 0||n.y!==void 0,a=n.onDragEnd||n.onDragMove;r&&!a&&(console.warn(a7),g2=!0)}for(var o in t)if(!h2[o]){var s=o.slice(0,2)==="on",c=t[o]!==n[o];if(s&&c){var m=o.substr(2).toLowerCase();m.substr(0,7)==="content"&&(m="content"+m.substr(7,1).toUpperCase()+m.substr(8)),e.off(m,t[o])}var f=!n.hasOwnProperty(o);f&&e.setAttr(o,void 0)}var v=Ow||n._useStrictMode,y={},E=!1;const w={};for(var o in n)if(!h2[o]){var s=o.slice(0,2)==="on",S=t[o]!==n[o];if(s&&S){var m=o.substr(2).toLowerCase();m.substr(0,7)==="content"&&(m="content"+m.substr(7,1).toUpperCase()+m.substr(8)),n[o]&&(w[m]=n[o])}!s&&(n[o]!==t[o]||v&&n[o]!==e.getAttr(o))&&(E=!0,y[o]=n[o])}E&&(e.setAttrs(y),Ql(e));for(var m in w)e.on(m+Lv,w[m])}function Ql(e){if(!n7.Konva.autoDrawEnabled){var n=e.getLayer()||e.getStage();n&&n.batchDraw()}}var Jg=lv();const Pw={},s7={};Rd.Node.prototype._applyProps=Bp;function u7(e,n){if(typeof n=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${n}`);return}e.add(n),Ql(e)}function c7(e,n,t){let r=Rd[e];r||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),r=Rd.Group);const a={},o={};for(var s in n){var c=s.slice(0,2)==="on";c?o[s]=n[s]:a[s]=n[s]}const m=new r(a);return Bp(m,o),m}function f7(e,n,t){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function d7(e,n,t){return!1}function h7(e){return e}function p7(){return null}function g7(){return null}function v7(e,n,t,r){return s7}function m7(){}function y7(e){}function b7(e,n){return!1}function w7(){return Pw}function _7(){return Pw}const S7=setTimeout,E7=clearTimeout,x7=-1;function O7(e,n){return!1}const P7=!1,C7=!0,k7=!0;function A7(e,n){n.parent===e?n.moveToTop():e.add(n),Ql(e)}function T7(e,n){n.parent===e?n.moveToTop():e.add(n),Ql(e)}function Cw(e,n,t){n._remove(),e.add(n),n.setZIndex(t.getZIndex()),Ql(e)}function R7(e,n,t){Cw(e,n,t)}function M7(e,n){n.destroy(),n.off(Lv),Ql(e)}function L7(e,n){n.destroy(),n.off(Lv),Ql(e)}function N7(e,n,t){console.error(`Text components are not yet supported in ReactKonva. You text is: "${t}"`)}function I7(e,n,t){}function j7(e,n,t,r,a){Bp(e,a,r)}function D7(e){e.hide(),Ql(e)}function F7(e){}function z7(e,n){(n.visible==null||n.visible)&&e.show()}function B7(e,n){}function U7(e){}function q7(){}const H7=()=>xw.DefaultEventPriority,G7=Object.freeze(Object.defineProperty({__proto__:null,appendChild:A7,appendChildToContainer:T7,appendInitialChild:u7,cancelTimeout:E7,clearContainer:U7,commitMount:I7,commitTextUpdate:N7,commitUpdate:j7,createInstance:c7,createTextInstance:f7,detachDeletedInstance:q7,finalizeInitialChildren:d7,getChildHostContext:_7,getCurrentEventPriority:H7,getPublicInstance:h7,getRootHostContext:w7,hideInstance:D7,hideTextInstance:F7,idlePriority:Jg.unstable_IdlePriority,insertBefore:Cw,insertInContainerBefore:R7,isPrimaryRenderer:P7,noTimeout:x7,now:Jg.unstable_now,prepareForCommit:p7,preparePortalMount:g7,prepareUpdate:v7,removeChild:M7,removeChildFromContainer:L7,resetAfterCommit:m7,resetTextContent:y7,run:Jg.unstable_runWithPriority,scheduleTimeout:S7,shouldDeprioritizeSubtree:b7,shouldSetTextContent:O7,supportsMutation:k7,unhideInstance:z7,unhideTextInstance:B7,warnsIfNotActing:C7},Symbol.toStringTag,{value:"Module"}));var V7=Object.defineProperty,$7=Object.defineProperties,W7=Object.getOwnPropertyDescriptors,v2=Object.getOwnPropertySymbols,Y7=Object.prototype.hasOwnProperty,K7=Object.prototype.propertyIsEnumerable,m2=(e,n,t)=>n in e?V7(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,y2=(e,n)=>{for(var t in n||(n={}))Y7.call(n,t)&&m2(e,t,n[t]);if(v2)for(var t of v2(n))K7.call(n,t)&&m2(e,t,n[t]);return e},X7=(e,n)=>$7(e,W7(n)),b2,w2;typeof window<"u"&&((b2=window.document)!=null&&b2.createElement||((w2=window.navigator)==null?void 0:w2.product)==="ReactNative")?Sr.useLayoutEffect:Sr.useEffect;function kw(e,n,t){if(!e)return;if(t(e)===!0)return e;let r=e.child;for(;r;){const a=kw(r,n,t);if(a)return a;r=r.sibling}}function Aw(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const _2=console.error;console.error=function(){const e=[...arguments].join("");if(e!=null&&e.startsWith("Warning:")&&e.includes("useContext")){console.error=_2;return}return _2.apply(this,arguments)};const Nv=Aw(Sr.createContext(null));class Tw extends Sr.Component{render(){return Sr.createElement(Nv.Provider,{value:this._reactInternals},this.props.children)}}function Z7(){const e=Sr.useContext(Nv);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const n=Sr.useId();return Sr.useMemo(()=>{for(const r of[e,e==null?void 0:e.alternate]){if(!r)continue;const a=kw(r,!1,o=>{let s=o.memoizedState;for(;s;){if(s.memoizedState===n)return!0;s=s.next}});if(a)return a}},[e,n])}function Q7(){const e=Z7(),[n]=Sr.useState(()=>new Map);n.clear();let t=e;for(;t;){if(t.type&&typeof t.type=="object"){const a=t.type._context===void 0&&t.type.Provider===t.type?t.type:t.type._context;a&&a!==Nv&&!n.has(a)&&n.set(a,Sr.useContext(Aw(a)))}t=t.return}return n}function Rw(){const e=Q7();return Sr.useMemo(()=>Array.from(e.keys()).reduce((n,t)=>r=>Sr.createElement(n,null,Sr.createElement(t.Provider,X7(y2({},r),{value:e.get(t)}))),n=>Sr.createElement(Tw,y2({},n))),[e])}function J7(e){const n=Gt.useRef({});return Gt.useLayoutEffect(()=>{n.current=e}),Gt.useLayoutEffect(()=>()=>{n.current={}},[]),n.current}const eS=e=>{const n=Gt.useRef(),t=Gt.useRef(),r=Gt.useRef(),a=J7(e),o=Rw(),s=c=>{const{forwardedRef:m}=e;m&&(typeof m=="function"?m(c):m.current=c)};return Gt.useLayoutEffect(()=>(t.current=new Rd.Stage({width:e.width,height:e.height,container:n.current}),s(t.current),r.current=ic.createContainer(t.current,xw.LegacyRoot,!1,null),ic.updateContainer(Gt.createElement(o,{},e.children),r.current),()=>{Rd.isBrowser&&(s(null),ic.updateContainer(null,r.current,null),t.current.destroy())}),[]),Gt.useLayoutEffect(()=>{s(t.current),Bp(t.current,e,a),ic.updateContainer(Gt.createElement(o,{},e.children),r.current,null)}),Gt.createElement("div",{ref:n,id:e.id,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},tS="Layer",rS="FastLayer",_p="Group",nS="Label",iS="Rect",aS="Circle",oS="Ellipse",lS="Wedge",sS="Line",uS="Sprite",cS="Image",fS="Text",dS="TextPath",hS="Star",pS="Ring",gS="Arc",vS="Tag",mS="Path",yS="RegularPolygon",bS="Arrow",wS="Shape",_S="Transformer",ic=e7(G7);ic.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:Gt.version,rendererPackageName:"react-konva"});const SS=Gt.forwardRef((e,n)=>Gt.createElement(Tw,{},Gt.createElement(eS,{...e,forwardedRef:n}))),ES=i7,xS=Object.freeze(Object.defineProperty({__proto__:null,Arc:gS,Arrow:bS,Circle:aS,Ellipse:oS,FastLayer:rS,Group:_p,Image:cS,KonvaRenderer:ic,Label:nS,Layer:tS,Line:sS,Path:mS,Rect:iS,RegularPolygon:yS,Ring:pS,Shape:wS,Sprite:uS,Stage:SS,Star:hS,Tag:vS,Text:fS,TextPath:dS,Transformer:_S,Wedge:lS,useStrictMode:ES},Symbol.toStringTag,{value:"Module"})),oo=Yl(xS);var e0,S2;function Up(){if(S2)return e0;S2=1;var e=Or();return e0=function(t,r,a){const o=e.useRef("loading"),s=e.useRef(),[c,m]=e.useState(0),f=e.useRef(),v=e.useRef(),y=e.useRef();return(f.current!==t||v.current!==r||y.current!==a)&&(o.current="loading",s.current=void 0,f.current=t,v.current=r,y.current=a),e.useLayoutEffect(function(){if(!t)return;var E=document.createElement("img");function w(){o.current="loaded",s.current=E,m(Math.random())}function S(){o.current="failed",s.current=void 0,m(Math.random())}return E.addEventListener("load",w),E.addEventListener("error",S),r&&(E.crossOrigin=r),a&&(E.referrerPolicy=a),E.src=t,function(){E.removeEventListener("load",w),E.removeEventListener("error",S)}},[t,r,a]),[s.current,o.current]},e0}var od={},ld={},OS=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)n.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(t[r[a]]=e[r[a]]);return t};const PS=e=>{const n=window.getComputedStyle(e).position;return!(n==="absolute"||n==="relative")};function Mw(e=()=>{}){const n=Gt.useRef(e);return n.current=e,Gt.useCallback((...t)=>n.current.apply(null,t),[])}const CS=({children:e,groupProps:n,divProps:t,transform:r,transformFunc:a,parentNodeFunc:o})=>{const s=Rw(),c=Gt.useRef(null),[m]=Gt.useState(()=>document.createElement("div")),f=Gt.useMemo(()=>c5.createRoot(m),[m]),v=r??!0,y=Mw(()=>{if(v&&c.current){let _=c.current.getAbsoluteTransform().decompose();a&&(_=a(_)),m.style.position="absolute",m.style.zIndex="10",m.style.top="0px",m.style.left="0px",m.style.transform=`translate(${_.x}px, ${_.y}px) rotate(${_.rotation}deg) scaleX(${_.scaleX}) scaleY(${_.scaleY})`,m.style.transformOrigin="top left"}else m.style.position="",m.style.zIndex="",m.style.top="",m.style.left="",m.style.transform="",m.style.transformOrigin="";const E=t||{},{style:w}=E,S=OS(E,["style"]);Object.assign(m.style,w),Object.assign(m,S)});return Gt.useLayoutEffect(()=>{var E;const w=c.current;if(!w)return;const S=o?o({stage:w.getStage()}):(E=w.getStage())===null||E===void 0?void 0:E.container();if(S)return S.appendChild(m),v&&PS(S)&&(S.style.position="relative"),w.on("absoluteTransformChange",y),y(),()=>{var x;w.off("absoluteTransformChange",y),(x=m.parentNode)===null||x===void 0||x.removeChild(m)}},[v,o]),Gt.useLayoutEffect(()=>{y()},[t,a]),Gt.useLayoutEffect(()=>{f.render(Gt.createElement(s,null,e))}),Gt.useLayoutEffect(()=>()=>{setTimeout(()=>{f.unmount()})},[]),Gt.createElement(_p,Object.assign({ref:c},n))},kS=({selector:e,enabled:n,children:t})=>{const r=Gt.useRef(null),a=Gt.useRef(null),o=Gt.useRef(null),s=n??!0;return Gt.useLayoutEffect(()=>{if(!r.current||!a.current)return;o.current=a.current;const m=r.current.getStage().findOne(e);s&&m?a.current.moveTo(m):a.current.moveTo(r.current);const f=r.current.getLayer();if(f&&(f.batchDraw(),m)){const v=m.getLayer();if(!v)return;v.batchDraw()}},[e,s]),Gt.useEffect(()=>()=>{var c;(c=o.current)===null||c===void 0||c.destroy()},[]),Gt.createElement(_p,{name:"_outer_portal",ref:r},Gt.createElement(_p,{name:"_inner_portal",ref:a},t))};var AS=Up();const TS=jd(AS),RS=Object.freeze(Object.defineProperty({__proto__:null,Html:CS,Portal:kS,useEvent:Mw,useImage:TS},Symbol.toStringTag,{value:"Module"})),wc=Yl(RS);function MS(e,n){return Object.keys(e.values).forEach(t=>e.values[t]=e.values[t]&&parseFloat(e.values[t].toFixed(n))),e}function Lw(e,n,t){const r=n-1,a=t[Iw(r,t.length)];return a.marker!=="Z"?a:Lw(e,r,t)}function Nw(e,n,t){const r=n+1,a=t[Iw(r,t.length)];return a.marker==="Z"?Nw(e,r,t):a}function LS(e,n,t){let r=t[n-1]||{values:{x:0,y:0}};if(e.marker===e.marker.toLowerCase())switch(e.marker=e.marker.toUpperCase(),e.marker){case"M":e.values.x+=r.values.x,e.values.y+=r.values.y;break;case"L":case"A":e.values.x+=r.values.x,e.values.y+=r.values.y;break;case"H":e.marker="L",e.values.x+=r.values.x,e.values.y=r.values.y;break;case"V":e.marker="L",e.values.x=r.values.x,e.values.y+=r.values.y;break;case"C":e.values.x+=r.values.x,e.values.y+=r.values.y,e.values.x1+=r.values.x,e.values.y1+=r.values.y,e.values.x2+=r.values.x,e.values.y2+=r.values.y;break;case"S":e.values.x+=r.values.x,e.values.y+=r.values.y,e.values.x2+=r.values.x,e.values.y2+=r.values.y;break;case"Q":e.values.x+=r.values.x,e.values.y+=r.values.y,e.values.x1+=r.values.x,e.values.y1+=r.values.y;break;case"T":e.values.x+=r.values.x,e.values.y+=r.values.y;break}else if(e.marker===e.marker.toUpperCase())switch(e.marker){case"H":e.marker="L",e.values.y=r.values.y;break;case"V":e.marker="L",e.values.x=r.values.x;break}if(e.marker==="Z"){let o=function(c,m){return c[m].marker==="M"?c[m]:o(c,m-1)};var a=o;let s=o(t,n);e.values.x=s.values.x,e.values.y=s.values.y}return e}function NS(e,n){const t=[];switch(e.toUpperCase()){case"M":for(let r=0;r<n.length;r+=2){let a;e===e.toUpperCase()?a=r===0?"M":"L":a=r===0?"m":"l",t.push({marker:a,values:{x:n[r],y:n[r+1]}})}break;case"L":for(let r=0;r<n.length;r+=2)t.push({marker:e,values:{x:n[r],y:n[r+1]}});break;case"H":for(let r=0;r<n.length;r++)t.push({marker:e,values:{x:n[r],y:0}});break;case"V":for(let r=0;r<n.length;r++)t.push({marker:e,values:{x:0,y:n[r]}});break;case"C":for(let r=0;r<n.length;r+=6)t.push({marker:e,values:{x1:n[r],y1:n[r+1],x2:n[r+2],y2:n[r+3],x:n[r+4],y:n[r+5]}});break;case"S":for(let r=0;r<n.length;r+=4)t.push({marker:e,values:{x2:n[r],y2:n[r+1],x:n[r+2],y:n[r+3]}});break;case"Q":for(let r=0;r<n.length;r+=4)t.push({marker:e,values:{x1:n[r],y1:n[r+1],x:n[r+2],y:n[r+3]}});break;case"T":for(let r=0;r<n.length;r+=2)t.push({marker:e,values:{x:n[r],y:n[r+1]}});break;case"A":for(let r=0;r<n.length;r+=7)t.push({marker:e,values:{radiusX:n[r],radiusY:n[r+1],rotation:n[r+2],largeArc:n[r+3],sweep:n[r+4],x:n[r+5],y:n[r+6]}});break;case"Z":t.push({marker:e,values:{x:0,y:0}});break}return t}function Iw(e,n){return(e%n+n)%n}function IS(e,n,t){if(n!==0&&e.marker==="L"){let r=t[n-1];["x","y"].every(o=>Math.round(Math.abs(r.values[o]-e.values[o]))===0)&&(e.overlap=!0)}return e}function iv(e,n){const t=["x","y"].every(r=>Math.round(Math.abs(e[n].values[r]-e[0].values[r]))===0);e[n].marker==="L"&&t&&(e[n].overlap=!0,iv(e,n-1)),e[n].marker==="Z"&&iv(e,n-1)}function jS(e,n,t){const r=x2(e.values,t.values),a=x2(n.values,e.values);return Math.min(a,r)}function E2(e,n){return Math.atan2(n.x-e.x,n.y-e.y)}function x2(e,n){const t=e.x-n.x,r=e.y-n.y;return Math.sqrt(Math.pow(t,2)+Math.pow(r,2))}function O2(e,n){return Math.sin(e)*n}function P2(e,n){return Math.cos(e)*n}function C2(e,n){const t=n/Math.tan(e);return t===1/0||t===-1/0||isNaN(t)?n:t}function DS(e,n){return n*Math.tan(e)}function FS(e,n){let t,r=0,a=e*(180/Math.PI);return a<0&&a>=-180||a>180&&a<360?t=C2(e/2,-n):(t=C2(e/2,n),r=1,t===1/0&&(t=n)),{offset:t,sweepFlag:r}}function zS(e){const n=["radiusX","radiusY","rotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return e.map(t=>{let r="";if(t.marker!=="Z"){const a=Object.keys(t.values);r=n.filter(o=>a.indexOf(o)!==-1).map(o=>t.values[o]).join()}return`${t.marker}${r}`}).join("").trim()}function jw(e){const n=/[MmLlSsQqLlHhVvCcSsQqTtAaZz]/g,t=/-?[0-9]*\.?\d+/g;return[...e.matchAll(n)].map(r=>({marker:r[0],index:r.index})).reduceRight((r,a)=>{const o=e.substring(a.index,r.length?r[r.length-1].index:e.length);return r.concat([{marker:a.marker,index:a.index,chunk:o.length>0?o.substr(1,o.length-1):o}])},[]).reverse().flatMap(r=>{const a=r.chunk.match(t),o=a?a.map(parseFloat):[];return NS(r.marker,o)}).map(LS)}function Dw(e,n,t){let r=[],a=[];return t&&e.forEach(o=>MS(o,t)),e.forEach(o=>{o.marker==="M"&&r.push([]),r[r.length-1].push(o)}),r.forEach(o=>{o.map(IS),iv(o,o.length-1);const s=o[o.length-1].marker=="Z";o.filter(c=>!c.overlap).map((c,m,f)=>{const y=Lw(c,m,f),E=Nw(c,m,f),w=E2(c.values,y.values),S=E2(c.values,E.values),x=S-w,_=x*(180/Math.PI),b=jS(c,y,E),g=Math.abs(DS(x/2,b/2)),h=Math.min(n,g),d=FS(x,h),P=d.offset,M=d.sweepFlag,T=(m==0||m==f.length-1)&&!s;switch(c.marker){case"M":case"L":const I=[c.values.x+O2(w,P),c.values.y+P2(w,P)],F=[c.values.x+O2(S,P),c.values.y+P2(S,P)];T?a.push({marker:c.marker,values:c.values}):a.push({marker:c.marker,values:{x:parseFloat(I[0].toFixed(3)),y:parseFloat(I[1].toFixed(3))}}),!T&&(E.marker==="L"||E.marker==="M")&&a.push({marker:"A",radius:h,values:{radiusX:parseFloat(h.toFixed(3)),radiusY:parseFloat(h.toFixed(3)),rotation:_,largeArc:0,sweep:M,x:parseFloat(F[0].toFixed(3)),y:parseFloat(F[1].toFixed(3))}});break;case"C":case"S":case"Q":case"T":case"A":case"Z":a.push({marker:c.marker,values:c.values});break}})}),{path:zS(a),commands:a}}function BS(e,n,t){return Dw([...jw(e)],n,t)}const US=Object.freeze(Object.defineProperty({__proto__:null,parsePath:jw,roundCommands:Dw,roundCorners:BS},Symbol.toStringTag,{value:"Module"})),qS=Yl(US);var pa={},sd={},np={},k2;function HS(){if(k2)return np;k2=1;var e=e||{};e.stringify=function(){var n={"visit_linear-gradient":function(t){return n.visit_gradient(t)},"visit_repeating-linear-gradient":function(t){return n.visit_gradient(t)},"visit_radial-gradient":function(t){return n.visit_gradient(t)},"visit_repeating-radial-gradient":function(t){return n.visit_gradient(t)},visit_gradient:function(t){var r=n.visit(t.orientation);return r&&(r+=", "),t.type+"("+r+n.visit(t.colorStops)+")"},visit_shape:function(t){var r=t.value,a=n.visit(t.at),o=n.visit(t.style);return o&&(r+=" "+o),a&&(r+=" at "+a),r},"visit_default-radial":function(t){var r="",a=n.visit(t.at);return a&&(r+=a),r},"visit_extent-keyword":function(t){var r=t.value,a=n.visit(t.at);return a&&(r+=" at "+a),r},"visit_position-keyword":function(t){return t.value},visit_position:function(t){return n.visit(t.value.x)+" "+n.visit(t.value.y)},"visit_%":function(t){return t.value+"%"},visit_em:function(t){return t.value+"em"},visit_px:function(t){return t.value+"px"},visit_literal:function(t){return n.visit_color(t.value,t)},visit_hex:function(t){return n.visit_color("#"+t.value,t)},visit_rgb:function(t){return n.visit_color("rgb("+t.value.join(", ")+")",t)},visit_rgba:function(t){return n.visit_color("rgba("+t.value.join(", ")+")",t)},visit_color:function(t,r){var a=t,o=n.visit(r.length);return o&&(a+=" "+o),a},visit_angular:function(t){return t.value+"deg"},visit_directional:function(t){return"to "+t.value},visit_array:function(t){var r="",a=t.length;return t.forEach(function(o,s){r+=n.visit(o),s<a-1&&(r+=", ")}),r},visit:function(t){if(!t)return"";var r="";if(t instanceof Array)return n.visit_array(t,r);if(t.type){var a=n["visit_"+t.type];if(a)return a(t);throw Error("Missing visitor visit_"+t.type)}else throw Error("Invalid node.")}};return function(t){return n.visit(t)}}();var e=e||{};return e.parse=function(){var n={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},t="";function r(W){var X=new Error(t+": "+W);throw X.source=t,X}function a(){var W=o();return t.length>0&&r("Invalid input not EOF"),W}function o(){return d(s)}function s(){return c("linear-gradient",n.linearGradient,f)||c("repeating-linear-gradient",n.repeatingLinearGradient,f)||c("radial-gradient",n.radialGradient,E)||c("repeating-radial-gradient",n.repeatingRadialGradient,E)}function c(W,X,q){return m(X,function(z){var Y=q();return Y&&(V(n.comma)||r("Missing comma before color stops")),{type:W,orientation:Y,colorStops:d(P)}})}function m(W,X){var q=V(W);if(q){V(n.startCall)||r("Missing (");var z=X(q);return V(n.endCall)||r("Missing )"),z}}function f(){return v()||y()}function v(){return L("directional",n.sideOrCorner,1)}function y(){return L("angular",n.angleValue,1)}function E(){var W,X=w(),q;return X&&(W=[],W.push(X),q=t,V(n.comma)&&(X=w(),X?W.push(X):t=q)),W}function w(){var W=S()||x();if(W)W.at=b();else{var X=_();if(X){W=X;var q=b();q&&(W.at=q)}else{var z=g();z&&(W={type:"default-radial",at:z})}}return W}function S(){var W=L("shape",/^(circle)/i,0);return W&&(W.style=R()||_()),W}function x(){var W=L("shape",/^(ellipse)/i,0);return W&&(W.style=N()||_()),W}function _(){return L("extent-keyword",n.extentKeywords,1)}function b(){if(L("position",/^at/,0)){var W=g();return W||r("Missing positioning value"),W}}function g(){var W=h();if(W.x||W.y)return{type:"position",value:W}}function h(){return{x:N(),y:N()}}function d(W){var X=W(),q=[];if(X)for(q.push(X);V(n.comma);)X=W(),X?q.push(X):r("One extra comma");return q}function P(){var W=M();return W||r("Expected color definition"),W.length=N(),W}function M(){return I()||k()||F()||T()}function T(){return L("literal",n.literalColor,0)}function I(){return L("hex",n.hexColor,1)}function F(){return m(n.rgbColor,function(){return{type:"rgb",value:d(O)}})}function k(){return m(n.rgbaColor,function(){return{type:"rgba",value:d(O)}})}function O(){return V(n.number)[1]}function N(){return L("%",n.percentageValue,1)||A()||R()}function A(){return L("position-keyword",n.positionKeywords,1)}function R(){return L("px",n.pixelValue,1)||L("em",n.emValue,1)}function L(W,X,q){var z=V(X);if(z)return{type:W,value:z[q]}}function V(W){var X,q;return q=/^[\n\r\t\s]+/.exec(t),q&&G(q[0].length),X=W.exec(t),X&&G(X[0].length),X}function G(W){t=t.substr(W)}return function(W){return t=W.toString(),a()}}(),np.parse=e.parse,np.stringify=e.stringify,np}var A2;function Iv(){return A2||(A2=1,function(e){var n=sd&&sd.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.isGradient=void 0;const t=n(HS());e.isGradient=a=>a.indexOf("linear-gradient")>=0;const r=a=>a.type==="hex"?"#"+a.value:a.type==="literal"?a.value:`${a.type}(${a.value.join(",")})`;e.parseColor=a=>{if(!(0,e.isGradient)(a))return{rotation:0,stops:[{offset:0,color:a},{offset:1,color:a}]};const o=t.default.parse(a)[0];return{rotation:parseFloat(o.orientation.value),stops:o.colorStops.map((s,c)=>({color:r(s),offset:s.length?parseFloat(s.length.value)/100:c/(o.colorStops.length-1)}))}}}(sd)),sd}var T2;function Gd(){return T2||(T2=1,function(e){var n,t=pa&&pa.__createBinding||(Object.create?function(f,v,y,E){E===void 0&&(E=y);var w=Object.getOwnPropertyDescriptor(v,y);w&&!("get"in w?!v.__esModule:w.writable||w.configurable)||(w={enumerable:!0,get:function(){return v[y]}}),Object.defineProperty(f,E,w)}:function(f,v,y,E){E===void 0&&(E=y),f[E]=v[y]}),r=pa&&pa.__setModuleDefault||(Object.create?function(f,v){Object.defineProperty(f,"default",{enumerable:!0,value:v})}:function(f,v){f.default=v}),a=pa&&pa.__importStar||(n=function(f){return n=Object.getOwnPropertyNames||function(v){var y=[];for(var E in v)Object.prototype.hasOwnProperty.call(v,E)&&(y[y.length]=E);return y},n(f)},function(f){if(f&&f.__esModule)return f;var v={};if(f!=null)for(var y=n(f),E=0;E<y.length;E++)y[E]!=="default"&&t(v,f,y[E]);return r(v,f),v}),o=pa&&pa.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.useColor=void 0;const s=o(Or()),c=a(Iv()),m=o(Mi());e.useColor=(f,v=f.fill,y="fill")=>s.default.useMemo(()=>{if(!c.isGradient(v))return{[y]:v};const{stops:E,rotation:w}=c.parseColor(v),S={x:f.a.width/2,y:f.a.height/2},x=Math.sqrt(Math.pow(S.x,2)+Math.pow(S.y,2)),_=m.default.Util.degToRad(w)-Math.PI/2,b=[];return E.forEach(({offset:g,color:h})=>{b.push(g,h)}),y==="fill"?{fillLinearGradientStartPointX:S.x-x*Math.cos(_),fillLinearGradientStartPointY:S.y-x*Math.sin(_),fillLinearGradientColorStops:b,fillLinearGradientEndPointX:S.x+x*Math.cos(_),fillLinearGradientEndPointY:S.y+x*Math.sin(_),fill:E[1].color,fillPriority:"linear-gradient"}:{strokeLinearGradientStartPointX:S.x-x*Math.cos(_),strokeLinearGradientStartPointY:S.y-x*Math.sin(_),strokeLinearGradientColorStops:b,strokeLinearGradientEndPointX:S.x+x*Math.cos(_),strokeLinearGradientEndPointY:S.y+x*Math.sin(_)}},[v,f.width,f.height])}(pa)),pa}var t0={},ud={},R2;function Ys(){return R2||(R2=1,function(e){var n=ud&&ud.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0}),e.isAnimationUsed=e.toggleFadeInAnimation=void 0,e.useFadeIn=function(o,s){const c=t.default.useRef();t.default.useLayoutEffect(()=>{c.current&&c.current.destroy()},[s]),t.default.useLayoutEffect(()=>{if(!a)return;const m=o.current.opacity();return m?(o.current.opacity(0),c.current=new r.default.Tween({node:o.current,opacity:m,onFinish:()=>{var f;(f=c.current)===null||f===void 0||f.destroy()}}),c.current.play(),()=>{var f;(f=c.current)===null||f===void 0||f.destroy()}):void 0},[])};const t=n(Or()),r=n(Mi());let a=!1;e.toggleFadeInAnimation=(o=!a)=>{a=o},e.isAnimationUsed=()=>a}(ud)),ud}var M2;function Ks(){return M2||(M2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getFontLoadTimeout=e.setFontLoadTimeout=e.getAssetLoadTimeout=e.setAssetLoadTimeout=void 0,e.incrementLoader=function(f){t+=1;let v=!1;const y=setTimeout(()=>{v||(m(`Timeout loading asset ${f}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",f),v=!0,s())},a);return()=>{v||(clearTimeout(y),s())}},e.decrementLoader=s,e.whenLoaded=function(){return new Promise(f=>{return v=()=>{(0,n.isAnimationUsed)()?setTimeout(f,300):f(!0)},void(t===0?v():r.push(v));var v})},e.onLoadError=function(f){c.push(f)},e.triggerLoadError=m;const n=Ys();let t=0,r=[],a=3e4;e.setAssetLoadTimeout=f=>{a=f},e.getAssetLoadTimeout=()=>a;let o=6e3;function s(){t-=1,t===0&&(r.forEach(f=>f()),r=[])}e.setFontLoadTimeout=f=>{o=f},e.getFontLoadTimeout=()=>o;let c=[];function m(f){c.forEach(v=>v(f))}}(t0)),t0}var zo={},L2;function Vd(){return L2||(L2=1,function(e){var n,t=zo&&zo.__createBinding||(Object.create?function(_,b,g,h){h===void 0&&(h=g);var d=Object.getOwnPropertyDescriptor(b,g);d&&!("get"in d?!b.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return b[g]}}),Object.defineProperty(_,h,d)}:function(_,b,g,h){h===void 0&&(h=g),_[h]=b[g]}),r=zo&&zo.__setModuleDefault||(Object.create?function(_,b){Object.defineProperty(_,"default",{enumerable:!0,value:b})}:function(_,b){_.default=b}),a=zo&&zo.__importStar||(n=function(_){return n=Object.getOwnPropertyNames||function(b){var g=[];for(var h in b)Object.prototype.hasOwnProperty.call(b,h)&&(g[g.length]=h);return g},n(_)},function(_){if(_&&_.__esModule)return _;var b={};if(_!=null)for(var g=n(_),h=0;h<g.length;h++)g[h]!=="default"&&t(b,_,g[h]);return r(b,_),b});Object.defineProperty(e,"__esModule",{value:!0}),e.isFontLoaded=e.globalFonts=void 0,e.isGoogleFontChanged=function(){return m.value},e.setGoogleFonts=function(_){_!=="default"?(m.value=!0,c.splice(0,c.length),c.push(..._)):m.value=!1},e.getFontsList=function(){return c},e.addGlobalFont=function(_){e.globalFonts.push(_)},e.removeGlobalFont=function(_){const b=e.globalFonts.findIndex(g=>g.fontFamily===_);b!==-1&&e.globalFonts.splice(b,1)},e.replaceGlobalFonts=function(_){e.globalFonts.replace(_)},e.loadFont=async function(_,b,g){var h;if(E[_])return;const d=!!(!((h=document.fonts)===null||h===void 0)&&h.load),P=y("Arial","Arial",b,g);if(d)try{if(await document.fonts.load(`16px '${_}', ${b} ${g}`),P!==y(_,"Arial",b,g))return void(E[_]=!0)}catch{}const M=y("Times","Times",b,g),T=y(_,"Arial",b,g),I=Math.min(6e3,(0,s.getFontLoadTimeout)())/60;for(let F=0;F<I;F++){const k=y(_,"Arial",b,g),O=y(_,"Times",b,g);if(k!==T||k!==P||O!==M)return void(E[_]=!0);await new Promise(N=>setTimeout(N,60))}console.warn(`Timeout for loading font "${_}". Looks like polotno can't load it. Is it a correct font family?`),(0,s.triggerLoadError)(`Timeout for loading font "${_}"`)},e.setGoogleFontsVariants=function(_){S=_},e.getGoogleFontsVariants=function(){return S},e.injectGoogleFont=function(_){if(w[_])return;const b=`https://fonts.googleapis.com/css?family=${_.replace(/ /g,"+")}:${S}`,g=document.createElement("link");g.type="text/css",g.href=b,g.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(g),w[_]=!0},e.injectCustomFont=function(_){const b=_.fontFamily;if(x[b]||!_.url&&!_.styles)return;const g=document.createElement("style");g.type="text/css";const h=_.styles||(_.url?[{src:`url("${_.url}")`}]:[]);let d="";h.forEach(P=>{d+=`
77
- @font-face {
78
- font-family: '${b}';
79
- src: ${P.src};
80
- font-style: ${P.fontStyle||"normal"};
81
- font-weight: ${P.fontWeight||"normal"};
82
- }
83
- `}),g.innerHTML=d,document.getElementsByTagName("head")[0].appendChild(g),x[_.fontFamily]=!0};const o=a(Xi),s=Ks();let c=o.observable(["Roboto","Amatic SC","Press Start 2P","Marck Script","Rubik Mono One"]),m=o.observable({value:!1});e.globalFonts=o.observable([]);var f="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1",v=document.createElement("canvas");function y(_,b="Arial",g="normal",h="normal"){var d=v.getContext("2d");return d.font=`${g} ${h} 40px '${_}', ${b}`,d.measureText(f).width}const E={Arial:!0};e.isFontLoaded=_=>!!E[_];const w={};let S="400,400italic,700,700italic";const x={}}(zo)),zo}var Bo={},N2;function Jl(){return N2||(N2=1,function(e){var n,t=Bo&&Bo.__createBinding||(Object.create?function(s,c,m,f){f===void 0&&(f=m);var v=Object.getOwnPropertyDescriptor(c,m);v&&!("get"in v?!c.__esModule:v.writable||v.configurable)||(v={enumerable:!0,get:function(){return c[m]}}),Object.defineProperty(s,f,v)}:function(s,c,m,f){f===void 0&&(f=m),s[f]=c[m]}),r=Bo&&Bo.__setModuleDefault||(Object.create?function(s,c){Object.defineProperty(s,"default",{enumerable:!0,value:c})}:function(s,c){s.default=c}),a=Bo&&Bo.__importStar||(n=function(s){return n=Object.getOwnPropertyNames||function(c){var m=[];for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(m[m.length]=f);return m},n(s)},function(s){if(s&&s.__esModule)return s;var c={};if(s!=null)for(var m=n(s),f=0;f<m.length;f++)m[f]!=="default"&&t(c,s,m[f]);return r(c,s),c});Object.defineProperty(e,"__esModule",{value:!0}),e.setAnimationsEnabled=e.setTextSplitAllowed=e.setTextOverflow=e.setForceTextFit=e.useDownScaling=e.setDownScalingEnabled=e.useHtmlTextRender=e.useRemoveBackground=e.setTextVerticalResizeEnabled=e.flags=void 0;const o=a(Xi);e.flags=o.observable({imageDownScalingEnabled:!0,removeBackgroundEnabled:!0,htmlRenderEnabled:!1,forceTextFitEnabled:!1,textVerticalResizeEnabled:!1,textOverflow:"resize",textSplitAllowed:!1,animationsEnabled:!1}),e.setTextVerticalResizeEnabled=o.action(s=>{e.flags.textVerticalResizeEnabled=s}),e.useRemoveBackground=o.action(s=>{e.flags.removeBackgroundEnabled=s}),e.useHtmlTextRender=o.action(s=>{e.flags.htmlRenderEnabled=s}),e.setDownScalingEnabled=o.action(s=>{e.flags.imageDownScalingEnabled=s}),e.useDownScaling=o.action(s=>{console.warn("useDownScaling is deprecated. Use setDownScalingEnabled instead."),(0,e.setDownScalingEnabled)(s)}),e.setForceTextFit=o.action(s=>{console.warn("setForceTextFit is deprecated. Use setTextOverflow instead."),e.flags.textOverflow="change-font-size"}),e.setTextOverflow=o.action(s=>{e.flags.textOverflow=s}),e.setTextSplitAllowed=o.action(s=>{e.flags.textSplitAllowed=s}),e.setAnimationsEnabled=o.action(s=>{e.flags.animationsEnabled=s})}(Bo)),Bo}var r0={},I2;function Fw(){return I2||(I2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.removeTags=function(n=""){return(n.match(/<\/p>/gi)||[]).length>1&&(n=n.replace(/<\/p>/gi,(t,r,a)=>(a.slice(r+t.length).match(/<\/p>/gi)||[]).length>0?`
84
- `:t)),n.replace(/(<([^>]+)>)/gi,"")},e.sanitizeHtml=function(n){return n?/<[a-z][a-z0-9]*(\s[^>]*)?>[^<]*<\/[a-z][a-z0-9]*>/i.test(n)?(n=n.replace(/<(?![a-z/!])/gi,"&lt;")).replace(/([^a-z0-9"'\s/])>/gi,"$1&gt;"):n.replace(/</g,"&lt;").replace(/>/g,"&gt;"):""}}(r0)),r0}var cd={},j2;function $d(){return j2||(j2=1,function(e){var n=cd&&cd.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0}),e.applyFilter=function(a,o){var s;const c={filters:[]},m={};o.brightnessEnabled&&(c.filters.push(t.default.Filters.Brighten),c.brightness=o.brightness),o.blurEnabled&&(c.filters.push(t.default.Filters.Blur),c.blurRadius=o.blurRadius,o.type==="text"&&o.lineHeight<1&&(m.offset=o.fontSize)),o.sepiaEnabled&&c.filters.push(t.default.Filters.Sepia),o.grayscaleEnabled&&c.filters.push(t.default.Filters.Grayscale),o.filters.forEach((f,v)=>{const y=r[v];y&&c.filters.push(y(f.intensity))}),a.setAttrs(c),c.filters.length?a.cache(Object.assign(Object.assign({},m),{pixelRatio:o.store._elementsPixelRatio})):a.clearCache(),(s=a.getLayer())===null||s===void 0||s.batchDraw()};const t=n(Mi()),r={warm:a=>o=>{const s=o.data;for(let c=0;c<s.length;c+=4)s[c]=Math.min(s[c]+30*a,255),s[c+1]=Math.min(s[c+1]+15*a,255);return o},cold:a=>o=>{const s=o.data;for(let c=0;c<s.length;c+=4)s[c]=Math.min(s[c]-15*a,255),s[c+1]=Math.min(s[c+1]-10*a,255),s[c+2]=Math.min(s[c+2]+15*a,255);return o},natural:a=>o=>{const s=o.data;a=Math.max(0,Math.min(a,1));for(let c=0;c<s.length;c+=4){s[c]=Math.min(s[c]*(1+.1*a),255),s[c+1]=Math.min(s[c+1]*(1+.1*a),255),s[c+2]=Math.min(s[c+2]*(1+.1*a),255);const m=(s[c]+s[c+1]+s[c+2])/3;s[c]=Math.min((s[c]-m)*(1+.2*a)+m,255),s[c+1]=Math.min((s[c+1]-m)*(1+.2*a)+m,255),s[c+2]=Math.min((s[c+2]-m)*(1+.2*a)+m,255)}return o}}}(cd)),cd}var fd={},D2;function Xs(){return D2||(D2=1,function(e){var n=fd&&fd.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0}),e.Highlighter=e.setHighlighterStyle=void 0;const t=n(Or()),r=Ri,a=oo,o={stroke:"rgb(0, 161, 255)",strokeWidth:2};e.setHighlighterStyle=s=>{Object.assign(o,s)},e.Highlighter=(0,r.observer)(({element:s})=>t.default.createElement(a.Rect,Object.assign({name:"highlighter",x:s.a.x,y:s.a.y,rotation:s.a.rotation,width:s.a.width,height:s.a.height,listening:!1,strokeScaleEnabled:!1},o)))}(fd)),fd}var dd={},F2;function es(){return F2||(F2=1,function(e){var n=dd&&dd.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(e,"__esModule",{value:!0}),e.useMobile=e.isTouchDevice=e.mobileStyle=e.isMobile=e.MOBILE_BREAKPOINT=void 0;const t=n(Or());e.MOBILE_BREAKPOINT=800,e.isMobile=()=>window.innerWidth<=e.MOBILE_BREAKPOINT,e.mobileStyle=r=>`
85
- @media (max-width: ${e.MOBILE_BREAKPOINT}px) {
86
- ${r}
87
- }
88
-
89
- .polotno-mobile & {
90
- ${r}
91
- }
92
- `,e.isTouchDevice=()=>"ontouchstart"in window||navigator.maxTouchPoints>0,e.useMobile=()=>{const[r,a]=t.default.useState((0,e.isMobile)());return t.default.useEffect(()=>{const o=()=>{a((0,e.isMobile)())};return window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)}},[]),r}}(dd)),dd}var z2={},zw="warn";function Bw(e){zw=e}function Uw(){return zw}function GS(e){Bw(e)}var on;(function(e){e.afterCreate="afterCreate",e.afterAttach="afterAttach",e.afterCreationFinalization="afterCreationFinalization",e.beforeDetach="beforeDetach",e.beforeDestroy="beforeDestroy"})(on||(on={}));var av=function(e,n){return av=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])},av(e,n)};function wr(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");av(e,n);function t(){this.constructor=e}e.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}var ln=function(){return ln=Object.assign||function(n){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}return n},ln.apply(this,arguments)};function VS(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)n.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(t[r[a]]=e[r[a]]);return t}function qw(e,n){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,a,o,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(f){return function(v){return m([f,v])}}function m(f){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,f[0]&&(t=0)),t;)try{if(r=1,a&&(o=f[0]&2?a.return:f[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,f[1])).done)return o;switch(a=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return t.label++,{value:f[1],done:!1};case 5:t.label++,a=f[1],f=[0];continue;case 7:f=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){t=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){t.label=f[1];break}if(f[0]===6&&t.label<o[1]){t.label=o[1],o=f;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(f);break}o[2]&&t.ops.pop(),t.trys.pop();continue}f=n.call(e,t)}catch(v){f=[6,v],a=0}finally{r=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function Cd(e){var n=typeof Symbol=="function"&&Symbol.iterator,t=n&&e[n],r=0;if(t)return t.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function io(e,n){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var r=t.call(e),a,o=[],s;try{for(;(n===void 0||n-- >0)&&!(a=r.next()).done;)o.push(a.value)}catch(c){s={error:c}}finally{try{a&&!a.done&&(t=r.return)&&t.call(r)}finally{if(s)throw s.error}}return o}function ao(e,n,t){if(arguments.length===2)for(var r=0,a=n.length,o;r<a;r++)(o||!(r in n))&&(o||(o=Array.prototype.slice.call(n,0,r)),o[r]=n[r]);return e.concat(o||Array.prototype.slice.call(n))}function Wd(e){return dt(e).type}function $S(e,n){return dt(e).getChildType(n)}function Hw(e,n){return dt(e).onPatch(n)}function WS(e,n){return dt(e).onSnapshot(n)}function dc(e,n){dt(e).applyPatches(Hv(n))}function YS(e,n){var t={patches:[],inversePatches:[]},r={},a,o={get recording(){return!!a},get patches(){return r.patches||(r.patches=t.patches.slice()),r.patches},get reversedInversePatches(){return r.reversedInversePatches||(r.reversedInversePatches=t.inversePatches.slice().reverse()),r.reversedInversePatches},get inversePatches(){return r.inversePatches||(r.inversePatches=t.inversePatches.slice()),r.inversePatches},stop:function(){a&&(a(),a=void 0)},resume:function(){a||(a=Hw(e,function(s,c){n&&!n(s,c,zv())||(t.patches.push(s),t.inversePatches.push(c),r.patches=void 0,r.inversePatches=void 0,r.reversedInversePatches=void 0)}))},replay:function(s){dc(s||e,t.patches)},undo:function(s){dc(s||e,t.inversePatches.slice().reverse())}};return o.resume(),o}function KS(e){var n=dt(e);if(!n.isRoot)throw new lt("`protect` can only be invoked on root nodes");n.isProtectionEnabled=!0}function XS(e){var n=dt(e);if(!n.isRoot)throw new lt("`unprotect` can only be invoked on root nodes");n.isProtectionEnabled=!1}function ZS(e){return dt(e).isProtected}function Gw(e,n){return dt(e).applySnapshot(n)}function jv(e,n){n===void 0&&(n=!0);var t=dt(e);return n?t.snapshot:t.type.getSnapshot(t,!1)}function QS(e,n){n===void 0&&(n=1);for(var t=dt(e).parent;t;){if(--n===0)return!0;t=t.parent}return!1}function JS(e,n){n===void 0&&(n=1);for(var t=n,r=dt(e).parent;r;){if(--t===0)return r.storedValue;r=r.parent}throw new lt("Failed to find the parent of ".concat(dt(e)," at depth ").concat(n))}function eE(e,n){for(var t=dt(e).parent;t;){if(n.is(t.storedValue))return!0;t=t.parent}return!1}function tE(e,n){for(var t=dt(e).parent;t;){if(n.is(t.storedValue))return t.storedValue;t=t.parent}throw new lt("Failed to find the parent of ".concat(dt(e)," of a given type"))}function Vw(e){return dt(e).root.storedValue}function $w(e){return dt(e).path}function rE(e){return mc(dt(e).path)}function nE(e){return dt(e).isRoot}function iE(e,n){var t=c4(dt(e),n);return t?t.value:void 0}function aE(e,n,t){var r=dt(n).root.identifierCache.resolve(e,_c(t));return r==null?void 0:r.value}function Ww(e){return dt(e).identifier}function oE(e,n){n===void 0&&(n=!0);try{var t=e();if(t==null)return;if(ir(t))return n?Dv(t)?t:void 0:t;throw new lt("The reference to be checked is not one of node, null or undefined")}catch(r){if(r instanceof Gv)return;throw r}}function lE(e,n){n===void 0&&(n=!0);try{var t=e();if(t==null)return!1;if(ir(t))return n?Dv(t):!0;throw new lt("The reference to be checked is not one of node, null or undefined")}catch(r){if(r instanceof Gv)return!1;throw r}}function Yw(e,n){var t=c4(dt(e),n,!1);if(t!==void 0)try{return t.value}catch{return}}function sE(e,n){return u4(dt(e),dt(n))}function uE(e,n){n===void 0&&(n=!0);var t=dt(e);return t.type.create(t.snapshot,n===!0?t.root.environment:n===!1?void 0:n)}function cE(e){return dt(e).detach(),e}function fE(e){var n=dt(e);n.isRoot?n.die():n.parent.removeChild(n.subpath)}function Dv(e){return dt(e).observableIsAlive}function dE(e,n){var t=dt(e);return t.addDisposer(n),n}function hE(e){var n=dt(e),t=n.root.environment;if(!t)throw new lt("Failed to find the environment of ".concat(n," ").concat(n.path));return t}function pE(e){var n=dt(e),t=n.root.environment;return!!t}function Kw(e,n){var t=dt(e);t.getChildren().forEach(function(r){ir(r.storedValue)&&Kw(r.storedValue,n)}),n(t.storedValue)}function Xw(e){var n;return ir(e)?n=Wd(e):n=e,{name:n.name,properties:ln({},n.properties)}}function gE(e){var n=dt(e).type,t=ln(ln({},Xw(n)),{actions:[],volatile:[],views:[],flowActions:[]}),r=Object.getOwnPropertyNames(e);return r.forEach(function(a){if(!(a in t.properties)){var o=Object.getOwnPropertyDescriptor(e,a);if(o.get){ew(e,a)?t.views.push(a):t.volatile.push(a);return}o.value._isFlowAction===!0&&t.flowActions.push(a),o.value._isMSTAction===!0?t.actions.push(a):rw(e,a)?t.volatile.push(a):t.views.push(a)}}),t}function vE(e){return e}function mE(e){return e}function yE(e){return e}function bE(e){return dt(e).nodeId}var Zw=function(){function e(n,t,r,a){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"_escapedSubpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storedValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"aliveAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_state",{enumerable:!0,configurable:!0,writable:!0,value:Tn.INITIALIZING}),Object.defineProperty(this,"_hookSubscribers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.environment=a,this.baseSetParent(t,r)}return Object.defineProperty(e.prototype,"subpath",{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},set:function(n){var t=this.isAlive;this._state=n;var r=this.isAlive;this.aliveAtom&&t!==r&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this._hookSubscribers&&this._hookSubscribers.emit(n,this,n)}}),Object.defineProperty(e.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){return this._hookSubscribers||(this._hookSubscribers=new g4),this._hookSubscribers.register(n,t)}}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getReconciliationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(e.prototype,"baseSetParent",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){this._parent=n,this._subpath=t,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(e.prototype,"path",{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getEscapedPath",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n&&(this.pathAtom||(this.pathAtom=Ad("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?Vl(this._subpath):""),this.parent.getEscapedPath(n)+"/"+this._escapedSubpath):""}}),Object.defineProperty(e.prototype,"isRoot",{get:function(){return this.parent===null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAlive",{get:function(){return this.state!==Tn.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDetaching",{get:function(){return this.state===Tn.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=Ad("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(this.state===Tn.CREATED){if(this.parent){if(this.parent.state!==Tn.FINALIZED)return;this.fireHook(on.afterAttach)}this.state=Tn.FINALIZED,n&&n()}}}),Object.defineProperty(e.prototype,"baseFinalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._hookSubscribers&&this._hookSubscribers.clearAll(),this._subpathUponDeath=this._subpath,this._pathUponDeath=this.getEscapedPath(!1),this.baseSetParent(null,""),this.state=Tn.DEAD}}),Object.defineProperty(e.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(on.beforeDestroy)}}),e}(),Md=function(e){wr(n,e);function n(t,r,a,o,s){var c=e.call(this,t,r,a,o)||this;try{c.storedValue=t.createNewInstance(s)}catch(m){throw c.state=Tn.DEAD,m}return c.state=Tn.CREATED,c.finalizeCreation(),c}return Object.defineProperty(n.prototype,"root",{get:function(){if(!this.parent)throw new lt("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this.parent!==t,o=this.subpath!==r;!a&&!o||(this.environment=void 0,this.baseSetParent(this.parent,r))}}),Object.defineProperty(n.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(n.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=(this.isAlive?this.path:this.pathUponDeath)||"<root>";return"".concat(this.type.name,"@").concat(t).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(n.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Tn.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(n.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(n.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(n.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(n.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.fireInternalHook(t)}}),n}(Zw);Md.prototype.die=Xr(Md.prototype.die);var wE=1,wa;(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.CREATING=1]="CREATING",e[e.CREATED=2]="CREATED"})(wa||(wa={}));var Pi;(function(e){e.Dispose="dispose",e.Patch="patch",e.Snapshot="snapshot"})(Pi||(Pi={}));var _E={onError:function(e){throw e}},pi=function(e){wr(n,e);function n(t,r,a,o,s){var c=e.call(this,t,r,a,o)||this;if(Object.defineProperty(c,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++wE}),Object.defineProperty(c,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"unnormalizedIdentifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"identifierCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"isProtectionEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(c,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"hasSnapshotPostProcessor",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(c,"_applyPatches",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_applySnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_autoUnbox",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(c,"_isRunningAction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(c,"_hasSnapshotReaction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(c,"_observableInstanceState",{enumerable:!0,configurable:!0,writable:!0,value:wa.UNINITIALIZED}),Object.defineProperty(c,"_childNodes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_initialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_cachedInitialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_cachedInitialSnapshotCreated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(c,"_snapshotComputed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_snapshotUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_internalEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),c._snapshotComputed=Vs(function(){return c.getSnapshot()}),c.unbox=c.unbox.bind(c),c._initialSnapshot=s,c.identifierAttribute=t.identifierAttribute,r||(c.identifierCache=new UE),c._childNodes=t.initializeChildNodes(c,c._initialSnapshot),c.identifier=null,c.unnormalizedIdentifier=null,c.identifierAttribute&&c._initialSnapshot){var m=c._initialSnapshot[c.identifierAttribute];if(m===void 0){var f=c._childNodes[c.identifierAttribute];f&&(m=f.value)}if(typeof m!="string"&&typeof m!="number")throw new lt("Instance identifier '".concat(c.identifierAttribute,"' for type '").concat(c.type.name,"' must be a string or a number"));c.identifier=_c(m),c.unnormalizedIdentifier=m}return r?r.root.identifierCache.addNodeToCache(c):c.identifierCache.addNodeToCache(c),c}return Object.defineProperty(n.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.createObservableInstanceIfNeeded(),this._applyPatches(t)}}),Object.defineProperty(n.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.createObservableInstanceIfNeeded(),this._applySnapshot(t)}}),Object.defineProperty(n.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(t){t===void 0&&(t=!0),this._observableInstanceState===wa.UNINITIALIZED&&this.createObservableInstance(t)}}),Object.defineProperty(n.prototype,"createObservableInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r,a,o,s;t===void 0&&(t=!0),this._observableInstanceState=wa.CREATING;for(var c=[],m=this.parent;m&&m._observableInstanceState===wa.UNINITIALIZED;)c.unshift(m),m=m.parent;try{for(var f=Cd(c),v=f.next();!v.done;v=f.next()){var y=v.value;y.createObservableInstanceIfNeeded(!1)}}catch(x){r={error:x}}finally{try{v&&!v.done&&(a=f.return)&&a.call(f)}finally{if(r)throw r.error}}var E=this.type;try{this.storedValue=E.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,E.finalizeNewInstance(this,this.storedValue)}catch(x){throw this.state=Tn.DEAD,x}finally{this._isRunningAction=!1}if(this._observableInstanceState=wa.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=gc,this.state=Tn.CREATED,t){this.fireHook(on.afterCreate),this.finalizeCreation();try{for(var w=Cd(c.reverse()),S=w.next();!S.done;S=w.next()){var y=S.value;y.fireHook(on.afterCreate),y.finalizeCreation()}}catch(x){o={error:x}}finally{try{S&&!S.done&&(s=w.return)&&s.call(w)}finally{if(o)throw o.error}}}}}),Object.defineProperty(n.prototype,"root",{get:function(){var t=this.parent;return t?t.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(on.beforeDetach);var t=this.state;this.state=Tn.DETACHING;var r=this.root,a=r.environment,o=r.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=a,this.identifierCache=o}finally{this.state=t}}}}),Object.defineProperty(n.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=t!==this.parent,o=r!==this.subpath;!a&&!o||(a?(this.environment=void 0,t.root.identifierCache.mergeCache(this),this.baseSetParent(t,r),this.fireHook(on.afterAttach)):o&&this.baseSetParent(this.parent,r))}}),Object.defineProperty(n.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this;this.fireInternalHook(t);var a=this.storedValue&&typeof this.storedValue=="object"&&this.storedValue[t];typeof a=="function"&&(uc?uc(function(){a.apply(r.storedValue)}):a.apply(this.storedValue))}}),Object.defineProperty(n.prototype,"snapshot",{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===wa.CREATED?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(n.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(n.prototype,"_getCachedInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var t=this.type,r=this._childNodes,a=this._initialSnapshot;this._cachedInitialSnapshot=t.processInitialSnapshot(r,a),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(n.prototype,"isRunningAction",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(n.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=Uw();if(!this.isAlive&&r!=="ignore"){var a=this._getAssertAliveError(t);switch(r){case"error":throw new lt(a);case"warn":ex(a)}}}}),Object.defineProperty(n.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.getEscapedPath(!1)||this.pathUponDeath||"",a=t.subpath&&Vl(t.subpath)||"",o=t.actionContext||Fv();o&&o.type!=="action"&&o.parentActionEvent&&(o=o.parentActionEvent);var s="";if(o&&o.name!=null){var c=o&&o.context&&$w(o.context)||r;s="".concat(c,".").concat(o.name,"()")}return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '".concat(this.type.name,"', Path upon death: '").concat(r,"', Subpath: '").concat(a,"', Action: '").concat(s,"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.")}}),Object.defineProperty(n.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.assertAlive({subpath:t}),this._autoUnbox=!1;try{return this._observableInstanceState===wa.CREATED?this.type.getChildNode(this,t):this._childNodes[t]}finally{this._autoUnbox=!0}}}),Object.defineProperty(n.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(gc),this._autoUnbox=!1;try{return this._observableInstanceState===wa.CREATED?this.type.getChildren(this):d4(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(n.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.type.getChildType(t)}}),Object.defineProperty(n.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.assertAlive(t),!this.isRunningAction()&&this.isProtected)throw new lt("Cannot modify '".concat(this,"', the object is protected and can only be modified by using an action."))}}),Object.defineProperty(n.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.type.removeChild(this,t)}}),Object.defineProperty(n.prototype,"unbox",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t&&(this.assertAlive({subpath:t.subpath||t.subpathUponDeath}),this._autoUnbox?t.value:t)}}),Object.defineProperty(n.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=(this.isAlive?this.path:this.pathUponDeath)||"<root>",r=this.identifier?"(id: ".concat(this.identifier,")"):"";return"".concat(this.type.name,"@").concat(t).concat(r).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(n.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;this.baseFinalizeCreation(function(){var r,a;try{for(var o=Cd(t.getChildren()),s=o.next();!s.done;s=o.next()){var c=s.value;c.finalizeCreation()}}catch(m){r={error:m}}finally{try{s&&!s.done&&(a=o.return)&&a.call(o)}finally{if(r)throw r.error}}t.fireInternalHook(on.afterCreationFinalization)})}}),Object.defineProperty(n.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw new lt("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(n.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;this._applyPatches=Ld(this.storedValue,"@APPLY_PATCHES",function(r){r.forEach(function(a){if(!a.path){t.type.applySnapshot(t,a.value);return}var o=mc(a.path),s=f4(t,o.slice(0,-1));s.applyPatchLocally(o[o.length-1],a)})}),this._applySnapshot=Ld(this.storedValue,"@APPLY_SNAPSHOT",function(r){if(r!==t.snapshot)return t.type.applySnapshot(t,r)}),Fs(this.storedValue,"$treenode",this),Fs(this.storedValue,"toJSON",HE)}}),Object.defineProperty(n.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Tn.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(n.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==wa.UNINITIALIZED&&(this.getChildren().forEach(function(t){t.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit(Pi.Dispose),this._internalEventsClear(Pi.Dispose))}}),Object.defineProperty(n.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(r){r.finalizeDeath()}),this.root.identifierCache.notifyDied(this);var t=this.snapshot;this._snapshotUponDeath=t,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(n.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._addSnapshotReaction(),this._internalEventsRegister(Pi.Snapshot,t)}}),Object.defineProperty(n.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._internalEventsEmit(Pi.Snapshot,t)}}),Object.defineProperty(n.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._internalEventsRegister(Pi.Patch,t)}}),Object.defineProperty(n.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(this._internalEventsHasSubscribers(Pi.Patch)){var a=r.path.substr(this.path.length)+(t.path?"/"+t.path:""),o=ZE({},t,{path:a}),s=io(ox(o),2),c=s[0],m=s[1];this._internalEventsEmit(Pi.Patch,c,m)}this.parent&&this.parent.emitPatch(t,r)}}),Object.defineProperty(n.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._internalEventsHas(Pi.Dispose,t)}}),Object.defineProperty(n.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!this.hasDisposer(t)){this._internalEventsRegister(Pi.Dispose,t,!0);return}throw new lt("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(n.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!this._internalEventsHas(Pi.Dispose,t))throw new lt("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister(Pi.Dispose,t)}}),Object.defineProperty(n.prototype,"removeMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.middlewares){var r=this.middlewares.indexOf(t);r>=0&&this.middlewares.splice(r,1)}}}),Object.defineProperty(n.prototype,"addMiddleWare",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this;r===void 0&&(r=!0);var o={handler:t,includeHooks:r};return this.middlewares?this.middlewares.push(o):this.middlewares=[o],function(){a.removeMiddleware(o)}}}),Object.defineProperty(n.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){this.assertWritable({subpath:t}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,t,r)}}),Object.defineProperty(n.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;if(!this._hasSnapshotReaction){var r=$5(function(){return t.snapshot},function(a){return t.emitSnapshot(a)},_E);this.addDisposer(r),this._hasSnapshotReaction=!0}}}),Object.defineProperty(n.prototype,"_internalEventsHasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return!!this._internalEvents&&this._internalEvents.hasSubscribers(t)}}),Object.defineProperty(n.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a){return a===void 0&&(a=!1),this._internalEvents||(this._internalEvents=new g4),this._internalEvents.register(t,r,a)}}),Object.defineProperty(n.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return!!this._internalEvents&&this._internalEvents.has(t,r)}}),Object.defineProperty(n.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){this._internalEvents&&this._internalEvents.unregister(t,r)}}),Object.defineProperty(n.prototype,"_internalEventsEmit",{enumerable:!1,configurable:!0,writable:!0,value:function(t){for(var r,a=[],o=1;o<arguments.length;o++)a[o-1]=arguments[o];this._internalEvents&&(r=this._internalEvents).emit.apply(r,ao([t],io(a),!1))}}),Object.defineProperty(n.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._internalEvents&&this._internalEvents.clear(t)}}),Object.defineProperty(n.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),n}(Zw);pi.prototype.createObservableInstance=Xr(pi.prototype.createObservableInstance);pi.prototype.detach=Xr(pi.prototype.detach);pi.prototype.die=Xr(pi.prototype.die);var Qw,Nt;(function(e){e[e.String=1]="String",e[e.Number=2]="Number",e[e.Boolean=4]="Boolean",e[e.Date=8]="Date",e[e.Literal=16]="Literal",e[e.Array=32]="Array",e[e.Map=64]="Map",e[e.Object=128]="Object",e[e.Frozen=256]="Frozen",e[e.Optional=512]="Optional",e[e.Reference=1024]="Reference",e[e.Identifier=2048]="Identifier",e[e.Late=4096]="Late",e[e.Refinement=8192]="Refinement",e[e.Union=16384]="Union",e[e.Null=32768]="Null",e[e.Undefined=65536]="Undefined",e[e.Integer=131072]="Integer",e[e.Custom=262144]="Custom",e[e.SnapshotProcessor=524288]="SnapshotProcessor",e[e.Lazy=1048576]="Lazy",e[e.Finite=2097152]="Finite",e[e.Float=4194304]="Float"})(Nt||(Nt={}));var Jw="cannotDetermine",SE=Symbol("$type"),Xo=function(){function e(n){Object.defineProperty(this,Qw,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"C",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"S",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"T",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"N",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isType",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=n}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){return Yo(this,n),this.instantiate(null,"",t,n).value}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){throw new lt("unimplemented method")}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n===this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){var r=s4(n);if(r){var a=Wd(n);return this.isAssignableFrom(a)?gi():vi(t,n)}return this.isValidSnapshot(n,t)}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this.validate(n,[{path:"",type:this}]).length===0}}),Object.defineProperty(e.prototype,"Type",{get:function(){throw new lt("Factory.Type should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.Type`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"TypeWithoutSTN",{get:function(){throw new lt("Factory.TypeWithoutSTN should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.TypeWithoutSTN`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SnapshotType",{get:function(){throw new lt("Factory.SnapshotType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.SnapshotType`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CreationType",{get:function(){throw new lt("Factory.CreationType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.CreationType`")},enumerable:!1,configurable:!0}),e}();Qw=SE;Xo.prototype.create=Xr(Xo.prototype.create);var hc=function(e){wr(n,e);function n(t){var r=e.call(this,t)||this;return Object.defineProperty(r,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),r}return Object.defineProperty(n.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return t===void 0&&(t=this.getDefaultSnapshot()),e.prototype.create.call(this,t,r)}}),Object.defineProperty(n.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.createObservableInstanceIfNeeded(),t.storedValue}}),Object.defineProperty(n.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return!t.identifierAttribute||t.identifier===_c(r[t.identifierAttribute])}}),Object.defineProperty(n.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return t.isDetaching?!1:t.snapshot===r||ir(r)&&dt(r)===t?!0:t.type===this&&h4(r)&&!ir(r)&&this.isMatchingSnapshotId(t,r)?(t.applySnapshot(r),!0):!1}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=this.tryToReconcileNode(t,r);if(s)return t.setParent(a,o),t;if(t.die(),ir(r)&&this.isAssignableFrom(Wd(r))){var c=dt(r);return c.setParent(a,o),c}return this.instantiate(a,o,void 0,r)}}),Object.defineProperty(n.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),n}(Xo);hc.prototype.create=Xr(hc.prototype.create);var Zs=function(e){wr(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}return Object.defineProperty(n.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t}}),Object.defineProperty(n.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){if(!t.isDetaching&&t.type===this&&t.storedValue===r)return t;var s=this.instantiate(a,o,void 0,r);return t.die(),s}}),Object.defineProperty(n.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),n}(Xo);function sn(e){return typeof e=="object"&&e&&e.isType===!0}var Qa=new Map;function EE(e){return function(t,r,a){switch(t.type){case"action":if(!e.filter||e.filter(t)===!0){var o=e.onStart(t);e.onResume(t,o),Qa.set(t.id,{call:t,context:o,async:!1});try{var s=r(t);return e.onSuspend(t,o),Qa.get(t.id).async===!1&&(Qa.delete(t.id),e.onSuccess(t,o,s)),s}catch(m){throw Qa.delete(t.id),e.onFail(t,o,m),m}}else return r(t);case"flow_spawn":{var c=Qa.get(t.rootId);return c.async=!0,r(t)}case"flow_resume":case"flow_resume_error":{var c=Qa.get(t.rootId);e.onResume(t,c.context);try{return r(t)}finally{e.onSuspend(t,c.context)}}case"flow_throw":{var c=Qa.get(t.rootId);return Qa.delete(t.rootId),e.onFail(t,c.context,t.args[0]),r(t)}case"flow_return":{var c=Qa.get(t.rootId);return Qa.delete(t.rootId),e.onSuccess(t,c.context,t.args[0]),r(t)}}}}var xE=function(){function e(n,t){Object.defineProperty(this,"hooks",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"call",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"flowsPending",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"running",{enumerable:!0,configurable:!0,writable:!0,value:!0}),n&&n.onStart(t)}return Object.defineProperty(e.prototype,"finish",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.running&&(this.running=!1,this.hooks&&this.hooks.onFinish(this.call,n))}}),Object.defineProperty(e.prototype,"incFlowsPending",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending++}}),Object.defineProperty(e.prototype,"decFlowsPending",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending--}}),Object.defineProperty(e.prototype,"hasFlowsPending",{get:function(){return this.flowsPending>0},enumerable:!1,configurable:!0}),e}();function OE(e){var n=new Map;return function(r,a){var o=r.parentActionEvent?n.get(r.parentActionEvent.id):void 0;if(r.type==="action"){var s=ln(ln({},r),{env:o&&o.call.env,parentCall:o&&o.call}),c=!e.filter||e.filter(s),m=c?e:void 0,f=new xE(m,s);n.set(r.id,f);var v=void 0;try{v=a(r)}catch(E){throw n.delete(r.id),f.finish(E),E}return f.hasFlowsPending||(n.delete(r.id),f.finish()),v}else{if(!o)return a(r);switch(r.type){case"flow_spawn":return o.incFlowsPending(),a(r);case"flow_resume":case"flow_resume_error":return a(r);case"flow_throw":{var y=r.args[0];try{return a(r)}finally{o.decFlowsPending(),o.hasFlowsPending||(n.delete(r.parentActionEvent.id),o.finish(y))}}case"flow_return":try{return a(r)}finally{o.decFlowsPending(),o.hasFlowsPending||(n.delete(r.parentActionEvent.id),o.finish())}}}}}function PE(e,n,t,r){if(r instanceof Date)return{$MST_DATE:r.getTime()};if(vc(r))return r;if(ir(r))return ip("[MSTNode: ".concat(Wd(r).name,"]"));if(typeof r=="function")return ip("[function]");if(typeof r=="object"&&!Ds(r)&&!qv(r))return ip("[object ".concat(r&&r.constructor&&r.constructor.name||"Complex Object","]"));try{return JSON.stringify(r),r}catch(a){return ip(""+a)}}function CE(e,n){return n&&typeof n=="object"&&"$MST_DATE"in n?new Date(n.$MST_DATE):n}function ip(e){return{$MST_UNSERIALIZABLE:!0,type:e}}function e4(e,n){uc(function(){Hv(n).forEach(function(t){return kE(e,t)})})}function kE(e,n){var t=Yw(e,n.path||"");if(!t)throw new lt("Invalid action path: ".concat(n.path||""));var r=dt(t);if(n.name==="@APPLY_PATCHES")return dc.call(null,t,n.args[0]);if(n.name==="@APPLY_SNAPSHOT")return Gw.call(null,t,n.args[0]);if(typeof t[n.name]!="function")throw new lt("Action '".concat(n.name,"' does not exist in '").concat(r.path,"'"));return t[n.name].apply(t,n.args?n.args.map(function(a){return CE(r,a)}):[])}function AE(e,n){var t=[],r=function(s){var c=n?n(s,zv()):!0;c&&t.push(s)},a,o={actions:t,get recording(){return!!a},stop:function(){a&&(a(),a=void 0)},resume:function(){a||(a=t4(e,r))},replay:function(s){e4(s,t)}};return o.resume(),o}function t4(e,n,t){return t===void 0&&(t=!1),i4(e,function(a,o){if(a.type==="action"&&a.id===a.rootId){var s=dt(a.context),c={name:a.name,path:u4(dt(e),s),args:a.args.map(function(f,v){return PE(s,a.name,v,f)})};if(t){var m=o(a);return n(c),m}else return n(c),o(a)}else return o(a)})}var TE=1,kd;function Fv(){return kd}function r4(){return TE++}function ov(e,n){var t=dt(e.context);e.type==="action"&&t.assertAlive({actionContext:e});var r=t._isRunningAction;t._isRunningAction=!0;var a=kd;kd=e;try{return LE(t,e,n)}finally{kd=a,t._isRunningAction=r}}function n4(e){if(e)return e.type==="action"?e:e.parentActionEvent}function Ld(e,n,t){var r=function(){var a=r4(),o=kd,s=n4(o);return ov({type:"action",name:n,id:a,args:v4(arguments),context:e,tree:Vw(e),rootId:o?o.rootId:a,parentId:o?o.id:0,allParentIds:o?ao(ao([],io(o.allParentIds),!1),[o.id],!1):[],parentEvent:o,parentActionEvent:s},t)};return r._isMSTAction=!0,r._isFlowAction=t._isFlowAction,r}function i4(e,n,t){t===void 0&&(t=!0);var r=dt(e);return r.addMiddleWare(n,t)}function RE(e,n,t){t===void 0&&(t=!0);var r={handler:e,includeHooks:t};return n.$mst_middleware=n.$mst_middleware||[],n.$mst_middleware.push(r),n}var ME=function(){function e(n,t){Object.defineProperty(this,"arrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"inArrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:[]}),t.$mst_middleware&&this.middlewares.push(t.$mst_middleware);for(var r=n;r;)r.middlewares&&this.middlewares.push(r.middlewares),r=r.parent}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getNextMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=this.middlewares[this.arrayIndex];if(n){var t=n[this.inArrayIndex++];return t||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}}),e}();function LE(e,n,t){var r=new ME(e,t);if(r.isEmpty)return Xr(t).apply(null,n.args);var a=null;function o(s){var c=r.getNextMiddleware(),m=c&&c.handler;if(!m)return Xr(t).apply(null,s.args);if(!c.includeHooks&&on[s.name])return o(s);function f(y,E){a=o(y),E&&(a=E(a))}function v(y){a=y}return m(s,f,v),a}return o(n)}function zv(){for(var e=Fv();e&&e.type!=="action";)e=e.parentActionEvent;return e}function a4(e,n,t){for(var r=typeof n=="number"?n:n.id,a=t?e:e.parentActionEvent;a;){if(a.id===r)return!0;a=a.parentActionEvent}return!1}function NE(e,n){return a4(e,n,!1)}function IE(e,n){return a4(e,n,!0)}function jE(e){try{return JSON.stringify(e)}catch(n){return"<Unserializable: ".concat(n,">")}}function o4(e){return typeof e=="function"?"<function".concat(e.name?" "+e.name:"",">"):ir(e)?"<".concat(e,">"):"`".concat(jE(e),"`")}function DE(e){return e.length<280?e:"".concat(e.substring(0,272),"......").concat(e.substring(e.length-8))}function FE(e){var n=e.value,t=e.context[e.context.length-1].type,r=e.context.map(function(c){var m=c.path;return m}).filter(function(c){return c.length>0}).join("/"),a=r.length>0?'at path "/'.concat(r,'" '):"",o=ir(n)?"value of type ".concat(dt(n).type.name,":"):vc(n)?"value":"snapshot",s=t&&ir(n)&&t.is(dt(n).snapshot);return"".concat(a).concat(o," ").concat(o4(n)," is not assignable ").concat(t?"to type: `".concat(t.name,"`"):"")+(e.message?" (".concat(e.message,")"):"")+(t?k4(t)||vc(n)?".":", expected an instance of `".concat(t.name,"` or a snapshot like `").concat(t.describe(),"` instead.")+(s?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function Bv(e,n,t){return e.concat([{path:n,type:t}])}function gi(){return pc}function vi(e,n,t){return[{context:e,value:n,message:t}]}function qp(e){return e.reduce(function(n,t){return n.concat(t)},[])}function Yo(e,n){tx()&&l4(e,n)}function l4(e,n){var t=e.validate(n,[{path:"",type:e}]);if(t.length>0)throw new lt(zE(e,n,t))}function zE(e,n,t){if(t.length!==0)return"Error while converting ".concat(DE(o4(n))," to `").concat(e.name,`\`:
93
-
94
- `)+t.map(FE).join(`
95
- `)}var BE=0,UE=function(){function e(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:BE++}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:ur.map()}),Object.defineProperty(this,"lastCacheModificationPerId",{enumerable:!0,configurable:!0,writable:!0,value:ur.map()})}return Object.defineProperty(e.prototype,"updateLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var t=this.lastCacheModificationPerId.get(n);this.lastCacheModificationPerId.set(n,t===void 0?1:t+1)}}),Object.defineProperty(e.prototype,"getLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var t=this.lastCacheModificationPerId.get(n)||0;return"".concat(this.cacheId,"-").concat(t)}}),Object.defineProperty(e.prototype,"addNodeToCache",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){if(t===void 0&&(t=!0),n.identifierAttribute){var r=n.identifier;this.cache.has(r)||this.cache.set(r,ur.array([],Hp));var a=this.cache.get(r);if(a.indexOf(n)!==-1)throw new lt("Already registered");a.push(n),t&&this.updateLastCacheModificationPerId(r)}}}),Object.defineProperty(e.prototype,"mergeCache",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var t=this;yv(n.identifierCache.cache).forEach(function(r){return r.forEach(function(a){t.addNodeToCache(a)})})}}),Object.defineProperty(e.prototype,"notifyDied",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(n.identifierAttribute){var t=n.identifier,r=this.cache.get(t);r&&(r.remove(n),r.length||this.cache.delete(t),this.updateLastCacheModificationPerId(n.identifier))}}}),Object.defineProperty(e.prototype,"splitCache",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var t=this,r=new e,a=n.path+"/";return nw(this.cache).forEach(function(o){for(var s=io(o,2),c=s[0],m=s[1],f=!1,v=m.length-1;v>=0;v--){var y=m[v];(y===n||y.path.indexOf(a)===0)&&(r.addNodeToCache(y,!1),m.splice(v,1),m.length||t.cache.delete(c),f=!0)}f&&t.updateLastCacheModificationPerId(c)}),r}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){var r=this.cache.get(t);return r?r.some(function(a){return n.isAssignableFrom(a.type)}):!1}}),Object.defineProperty(e.prototype,"resolve",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){var r=this.cache.get(t);if(!r)return null;var a=r.filter(function(o){return n.isAssignableFrom(o.type)});switch(a.length){case 0:return null;case 1:return a[0];default:throw new lt("Cannot resolve a reference to type '".concat(n.name,"' with id: '").concat(t,"' unambigously, there are multiple candidates: ").concat(a.map(function(o){return o.path}).join(", ")))}}}),e}();function Uv(e,n,t,r,a){var o=s4(a);if(o){if(o.parent)throw new lt("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(n?n.path:"","/").concat(t,"', but it lives already at '").concat(o.path,"'"));return n&&o.setParent(n,t),o}return new pi(e,n,t,r,a)}function ts(e,n,t,r,a){return new Md(e,n,t,r,a)}function qE(e){return e instanceof Md||e instanceof pi}var Tn;(function(e){e[e.INITIALIZING=0]="INITIALIZING",e[e.CREATED=1]="CREATED",e[e.FINALIZED=2]="FINALIZED",e[e.DETACHING=3]="DETACHING",e[e.DEAD=4]="DEAD"})(Tn||(Tn={}));function ir(e){return!!(e&&e.$treenode)}function dt(e){if(!ir(e))throw new lt("Value ".concat(e," is no MST Node"));return e.$treenode}function s4(e){return e&&e.$treenode||null}function HE(){return dt(this).snapshot}var GE=function(e){return".."};function u4(e,n){if(e.root!==n.root)throw new lt("Cannot calculate relative path: objects '".concat(e,"' and '").concat(n,"' are not part of the same object tree"));for(var t=mc(e.path),r=mc(n.path),a=0;a<t.length&&t[a]===r[a];a++);return t.slice(a).map(GE).join("/")+Sp(r.slice(a))}function c4(e,n,t){return t===void 0&&(t=!0),f4(e,mc(n),t)}function f4(e,n,t){t===void 0&&(t=!0);var r=e;try{for(var a=0;a<n.length;a++){var o=n[a];if(o===".."){if(r=r.parent,r)continue}else{if(o===".")continue;if(r){if(r instanceof Md){var s=r.value;ir(s)&&(r=dt(s))}if(r instanceof pi){var c=r.getChildType(o);if(c&&(r=r.getChildNode(o),r))continue}}}throw new lt("Could not resolve '".concat(o,"' in path '").concat(Sp(n.slice(0,a))||"/","' while resolving '").concat(Sp(n),"'"))}}catch(m){if(!t)return;throw m}return r}function d4(e){if(!e)return pc;var n=Object.keys(e);if(!n.length)return pc;var t=new Array(n.length);return n.forEach(function(r,a){t[a]=e[r]}),t}function VE(e){return m4(e)}var $E=Object.toString(),pc=Object.freeze([]),gc=Object.freeze({}),Hp=N5().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(Hp);var lt=function(e){wr(n,e);function n(t){return t===void 0&&(t="Illegal state"),e.call(this,"[mobx-state-tree] ".concat(t))||this}return n}(Error);function WE(e){return e}var YE=Number.isInteger;function KE(e){return Number(e)===e&&e%1!==0}function XE(e){return Number.isFinite(e)}function qv(e){return Array.isArray(e)||Qn(e)}function Hv(e){return e?qv(e)?e:[e]:pc}function ZE(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];for(var r=0;r<n.length;r++){var a=n[r];for(var o in a)e[o]=a[o]}return e}function Ds(e){var n;if(e===null||typeof e!="object")return!1;var t=Object.getPrototypeOf(e);return t==null?!0:((n=t.constructor)===null||n===void 0?void 0:n.toString())===$E}function h4(e){return e!==null&&typeof e=="object"&&!(e instanceof Date)&&!(e instanceof RegExp)}function vc(e,n){return n===void 0&&(n=!0),e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||n&&e instanceof Date}function p4(e){return typeof e!="function"}function QE(e,n,t){yn(e)?wv(e,n,t):Object.defineProperty(e,n,t)}function Fs(e,n,t){QE(e,n,{enumerable:!1,writable:!1,configurable:!0,value:t})}var JE=function(){function e(){Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,"hasSubscribers",{get:function(){return this.handlers.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){var r=this;return t===void 0&&(t=!1),t?this.handlers.unshift(n):this.handlers.push(n),function(){r.unregister(n)}}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this.handlers.indexOf(n)>=0}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var t=this.handlers.indexOf(n);t>=0&&this.handlers.splice(t,1)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.handlers.length=0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var r=this.handlers.slice();r.forEach(function(a){return a.apply(void 0,ao([],io(n),!1))})}}),e}(),g4=function(){function e(){Object.defineProperty(this,"eventHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"hasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var t=this.eventHandlers&&this.eventHandlers[n];return!!t&&t.hasSubscribers}}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t,r){r===void 0&&(r=!1),this.eventHandlers||(this.eventHandlers={});var a=this.eventHandlers[n];return a||(a=this.eventHandlers[n]=new JE),a.register(t,r)}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){var r=this.eventHandlers&&this.eventHandlers[n];return!!r&&r.has(t)}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){var r=this.eventHandlers&&this.eventHandlers[n];r&&r.unregister(t)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.eventHandlers&&delete this.eventHandlers[n]}}),Object.defineProperty(e.prototype,"clearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.eventHandlers=void 0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(n){for(var t,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];var o=this.eventHandlers&&this.eventHandlers[n];o&&(t=o).emit.apply(t,ao([],io(r),!1))}}),e}();function v4(e){for(var n=new Array(e.length),t=0;t<e.length;t++)n[t]=e[t];return n}function n0(e,n){return e.indexOf(n)===0}function ex(e){console.warn(new Error("[mobx-state-tree] ".concat(e)))}function tx(){return typeof process<"u"&&z2&&z2.ENABLE_TYPE_CHECK==="true"}function i0(e){typeof queueMicrotask=="function"?queueMicrotask(e):typeof setImmediate=="function"?setImmediate(e):setTimeout(e,1)}function m4(e){return ax(e.name,e)}function rx(e){return e}function nx(e){return function(){var n,t=[];for(n=0;n<arguments.length;n++)t[n]=arguments[n];return qw(this,function(r){switch(r.label){case 0:return[4,e.apply(void 0,ao([],io(t),!1))];case 1:return[2,r.sent()]}})}}function ix(e){return qw(this,function(n){switch(n.label){case 0:return[4,e];case 1:return[2,n.sent()]}})}function ax(e,n){var t=function(){var a=r4(),o=Fv();if(!o)throw new lt("a mst flow must always have a parent context");var s=n4(o);if(!s)throw new lt("a mst flow must always have a parent action context");var c={name:e,id:a,tree:o.tree,context:o.context,parentId:o.id,allParentIds:ao(ao([],io(o.allParentIds),!1),[o.id],!1),rootId:o.rootId,parentEvent:o,parentActionEvent:s},m=arguments;function f(v,y,E){return v.$mst_middleware=t.$mst_middleware,ov(ln(ln({},c),{type:y,args:[E]}),v)}return new Promise(function(v,y){var E,w=function(){E=n.apply(null,arguments),S(void 0)};w.$mst_middleware=t.$mst_middleware,ov(ln(ln({},c),{type:"flow_spawn",args:v4(m)}),w);function S(b){var g;try{var h=f(function(d){g=E.next(d)},"flow_resume",b);h instanceof Error&&(g=E.throw(h))}catch(d){i0(function(){f(function(P){y(d)},"flow_throw",d)});return}_(g)}function x(b){var g;try{f(function(h){g=E.throw(h)},"flow_resume_error",b)}catch(h){i0(function(){f(function(d){y(h)},"flow_throw",h)});return}_(g)}function _(b){if(b.done){i0(function(){f(function(g){v(g)},"flow_return",b.value)});return}if(!b.value||typeof b.value.then!="function")throw new lt("Only promises can be yielded to `async`, got: "+b);return b.value.then(S,x)}})};return t._isFlowAction=!0,t}function ox(e){if(!("oldValue"in e))throw new lt("Patches without `oldValue` field cannot be inversed");return[lx(e),sx(e)]}function lx(e){switch(e.op){case"add":return{op:"add",path:e.path,value:e.value};case"remove":return{op:"remove",path:e.path};case"replace":return{op:"replace",path:e.path,value:e.value}}}function sx(e){switch(e.op){case"add":return{op:"remove",path:e.path};case"remove":return{op:"add",path:e.path,value:e.oldValue};case"replace":return{op:"replace",path:e.path,value:e.oldValue}}}function ux(e){return typeof e=="number"}function Vl(e){return ux(e)===!0?""+e:e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function y4(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Sp(e){if(e.length===0)return"";var n=function(t){return t.map(Vl).join("/")};return e[0]==="."||e[0]===".."?n(e):"/"+n(e)}function mc(e){var n=e.split("/").map(y4),t=e===""||e==="."||e===".."||n0(e,"/")||n0(e,"./")||n0(e,"../");if(!t)throw new lt("a json path must be either rooted, empty or relative, but got '".concat(e,"'"));return n[0]===""&&n.shift(),n}var a0=Symbol("$preProcessorFailed"),cx=function(e){wr(n,e);function n(t,r,a){var o=e.call(this,a||t.name)||this;return Object.defineProperty(o,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"_processors",{enumerable:!0,configurable:!0,writable:!0,value:r}),o}return Object.defineProperty(n.prototype,"flags",{get:function(){return this._subtype.flags|Nt.SnapshotProcessor},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"snapshotProcessor(".concat(this._subtype.describe(),")")}}),Object.defineProperty(n.prototype,"preProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._processors.preProcessor?this._processors.preProcessor.call(null,t):t}}),Object.defineProperty(n.prototype,"preProcessSnapshotSafe",{enumerable:!1,configurable:!0,writable:!0,value:function(t){try{return this.preProcessSnapshot(t)}catch{return a0}}}),Object.defineProperty(n.prototype,"postProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this._processors.postProcessor?this._processors.postProcessor.call(null,t,r.storedValue):t}}),Object.defineProperty(n.prototype,"_fixNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this;fx(t.type,this,"create"),t instanceof pi&&(t.hasSnapshotPostProcessor=!!this._processors.postProcessor);var a=t.getSnapshot;t.getSnapshot=function(){return r.postProcessSnapshot(a.call(t),t)},T4(this._subtype)||(t.getReconciliationType=function(){return r})}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=ir(o)?o:this.preProcessSnapshot(o),c=this._subtype.instantiate(t,r,a,s);return this._fixNode(c),c}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=this._subtype.reconcile(t,ir(r)?r:this.preProcessSnapshot(r),a,o);return s!==t&&this._fixNode(s),s}}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){r===void 0&&(r=!0);var a=this._subtype.getSnapshot(t);return r?this.postProcessSnapshot(a,t):a}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this.preProcessSnapshotSafe(t);return a===a0?vi(r,t,"Failed to preprocess value"):this._subtype.validate(a,r)}}),Object.defineProperty(n.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),Object.defineProperty(n.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=sn(t)?this._subtype:ir(t)?jv(t,!1):this.preProcessSnapshotSafe(t);return r===a0?!1:this._subtype.validate(r,[{path:"",type:this._subtype}]).length===0}}),Object.defineProperty(n.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._subtype.isAssignableFrom(t)}}),Object.defineProperty(n.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(!(this._subtype instanceof hc))return!1;var a=this.preProcessSnapshot(r);return this._subtype.isMatchingSnapshotId(t,a)}}),n}(Xo);function fx(e,n){for(var t,r,a=[],o=2;o<arguments.length;o++)a[o-2]=arguments[o];try{for(var s=Cd(a),c=s.next();!c.done;c=s.next()){var m=c.value;e[m]=n[m].bind(n)}}catch(f){t={error:f}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}}function dx(e,n,t){return new cx(e,n,t)}var B2="Map.put can only be used to store complex values that have an identifier type attribute";function b4(e,n){var t,r,a=e.getSubTypes();if(a===Jw)return!1;if(a){var o=Hv(a);try{for(var s=Cd(o),c=s.next();!c.done;c=s.next()){var m=c.value;if(!b4(m,n))return!1}}catch(f){t={error:f}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}}return e instanceof Nd&&n.push(e),!0}var ql;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.YES=1]="YES",e[e.NO=2]="NO"})(ql||(ql={}));var hx=function(e){wr(n,e);function n(t,r){return e.call(this,t,ur.ref.enhancer,r)||this}return Object.defineProperty(n.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.get.call(this,""+t)}}),Object.defineProperty(n.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.has.call(this,""+t)}}),Object.defineProperty(n.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.delete.call(this,""+t)}}),Object.defineProperty(n.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return e.prototype.set.call(this,""+t,r)}}),Object.defineProperty(n.prototype,"put",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!t)throw new lt("Map.put cannot be used to set empty values");if(ir(t)){var r=dt(t);if(r.identifier===null)throw new lt(B2);return this.set(r.identifier,t),t}else if(h4(t)){var a=dt(this),o=a.type;if(o.identifierMode!==ql.YES)throw new lt(B2);var s=o.mapIdentifierAttribute,c=t[s];if(!Vv(c)){var m=this.put(o.getChildType().create(t,a.environment));return this.put(jv(m))}var f=_c(c);return this.set(f,t),this.get(f)}else throw new lt("Map.put can only be used to store complex values")}}),n}(Dp),Ep=function(e){wr(n,e);function n(t,r,a){a===void 0&&(a=[]);var o=e.call(this,t)||this;return Object.defineProperty(o,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"identifierMode",{enumerable:!0,configurable:!0,writable:!0,value:ql.UNKNOWN}),Object.defineProperty(o,"mapIdentifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Map}),Object.defineProperty(o,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),o._determineIdentifierMode(),o.hookInitializers=a,o}return Object.defineProperty(n.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.hookInitializers.length>0?this.hookInitializers.concat(t):[t];return new n(this.name,this._subType,r)}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return this._determineIdentifierMode(),Uv(this,t,r,a,o)}}),Object.defineProperty(n.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===ql.UNKNOWN){var t=[];if(b4(this._subType,t)){var r=t.reduce(function(a,o){if(!o.identifierAttribute)return a;if(a&&a!==o.identifierAttribute)throw new lt("The objects in a map should all have the same identifier attribute, expected '".concat(a,"', but child of type '").concat(o.name,"' declared attribute '").concat(o.identifierAttribute,"' as identifier"));return o.identifierAttribute},void 0);r?(this.identifierMode=ql.YES,this.mapIdentifierAttribute=r):this.identifierMode=ql.NO}}}}),Object.defineProperty(n.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){r===void 0&&(r={});var a=t.type._subType,o={};return Object.keys(r).forEach(function(s){o[s]=a.instantiate(t,s,void 0,r[s])}),o}}),Object.defineProperty(n.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new hx(t,this.name)}}),Object.defineProperty(n.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){mv(r,t.unbox);var a=t.type;a.hookInitializers.forEach(function(o){var s=o(r);Object.keys(s).forEach(function(c){var m=s[c],f=Ld(r,c,m);Fs(r,c,f)})}),Np(r,this.willChange),jp(r,this.didChange)}}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(n.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return yv(t.storedValue)}}),Object.defineProperty(n.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=t.storedValue.get(""+r);if(!a)throw new lt("Not a child "+r);return a}}),Object.defineProperty(n.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=dt(t.object),a=t.name;r.assertWritable({subpath:a});var o=r.type,s=o._subType;switch(t.type){case"update":{var c=t.newValue,m=t.object.get(a);if(c===m)return null;Yo(s,c),t.newValue=s.reconcile(r.getChildNode(a),t.newValue,r,a),o.processIdentifier(a,t.newValue)}break;case"add":Yo(s,t.newValue),t.newValue=s.instantiate(r,a,void 0,t.newValue),o.processIdentifier(a,t.newValue);break}return t}}),Object.defineProperty(n.prototype,"processIdentifier",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(this.identifierMode===ql.YES&&r instanceof pi){var a=r.identifier;if(a!==t)throw new lt("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '".concat(a,"', but expected: '").concat(t,"'"))}}}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r={};return t.getChildren().forEach(function(a){r[a.subpath]=a.snapshot}),r}}),Object.defineProperty(n.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r={};return Object.keys(t).forEach(function(a){r[a]=t[a].getSnapshot()}),r}}),Object.defineProperty(n.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=dt(t.object);switch(t.type){case"update":return void r.emitPatch({op:"replace",path:Vl(t.name),value:t.newValue.snapshot,oldValue:t.oldValue?t.oldValue.snapshot:void 0},r);case"add":return void r.emitPatch({op:"add",path:Vl(t.name),value:t.newValue.snapshot,oldValue:void 0},r);case"delete":var a=t.oldValue.snapshot;return t.oldValue.die(),void r.emitPatch({op:"remove",path:Vl(t.name),oldValue:a},r)}}}),Object.defineProperty(n.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a){var o=t.storedValue;switch(a.op){case"add":case"replace":o.set(r,a.value);break;case"remove":o.delete(r);break}}}),Object.defineProperty(n.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){Yo(this,r);var a=t.storedValue,o={};if(Array.from(a.keys()).forEach(function(c){o[c]=!1}),r)for(var s in r)a.set(s,r[s]),o[""+s]=!0;Object.keys(o).forEach(function(c){o[c]===!1&&a.delete(c)})}}),Object.defineProperty(n.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this;return Ds(t)?qp(Object.keys(t).map(function(o){return a._subType.validate(t[o],Bv(r,o,a._subType))})):vi(r,t,"Value is not a plain object")}}),Object.defineProperty(n.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return gc}}),Object.defineProperty(n.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){t.storedValue.delete(r)}}),n}(hc);Ep.prototype.applySnapshot=Xr(Ep.prototype.applySnapshot);function px(e){return new Ep("Map<string, ".concat(e.name,">"),e)}function gx(e){return sn(e)&&(e.flags&Nt.Map)>0}var xp=function(e){wr(n,e);function n(t,r,a){a===void 0&&(a=[]);var o=e.call(this,t)||this;return Object.defineProperty(o,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Array}),Object.defineProperty(o,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),o.hookInitializers=a,o}return Object.defineProperty(n.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.hookInitializers.length>0?this.hookInitializers.concat(t):[t];return new n(this.name,this._subType,r)}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return Uv(this,t,r,a,o)}}),Object.defineProperty(n.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){r===void 0&&(r=[]);var a=t.type._subType,o={};return r.forEach(function(s,c){var m=""+c;o[m]=a.instantiate(t,m,void 0,s)}),o}}),Object.defineProperty(n.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=ln(ln({},Hp),{name:this.name});return ur.array(d4(t),r)}}),Object.defineProperty(n.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){Pa(r).dehancer=t.unbox;var a=t.type;a.hookInitializers.forEach(function(o){var s=o(r);Object.keys(s).forEach(function(c){var m=s[c],f=Ld(r,c,m);Fs(r,c,f)})}),Np(r,this.willChange),jp(r,this.didChange)}}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(n.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue.slice()}}),Object.defineProperty(n.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=Number(r);if(a<t.storedValue.length)return t.storedValue[a];throw new lt("Not a child: "+r)}}),Object.defineProperty(n.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=dt(t.object);r.assertWritable({subpath:""+t.index});var a=r.type._subType,o=r.getChildren();switch(t.type){case"update":{if(t.newValue===t.object[t.index])return null;var s=U2(r,a,[o[t.index]],[t.newValue],[t.index]);if(!s)return null;t.newValue=s[0]}break;case"splice":{var c=t.index,m=t.removedCount,f=t.added,v=U2(r,a,o.slice(c,c+m),f,f.map(function(E,w){return c+w}));if(!v)return null;t.added=v;for(var y=c+m;y<o.length;y++)o[y].setParent(r,""+(y+f.length-m))}break}return t}}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.getChildren().map(function(r){return r.snapshot})}}),Object.defineProperty(n.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=[];return Object.keys(t).forEach(function(a){r.push(t[a].getSnapshot())}),r}}),Object.defineProperty(n.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=dt(t.object);switch(t.type){case"update":return void r.emitPatch({op:"replace",path:""+t.index,value:t.newValue.snapshot,oldValue:t.oldValue?t.oldValue.snapshot:void 0},r);case"splice":if(t.removedCount&&t.addedCount===t.object.length)return void r.emitPatch({op:"replace",path:"",value:r.snapshot,oldValue:t.removed.map(function(o){return o.snapshot})},r);for(var a=t.removedCount-1;a>=0;a--)r.emitPatch({op:"remove",path:""+(t.index+a),oldValue:t.removed[a].snapshot},r);for(var a=0;a<t.addedCount;a++)r.emitPatch({op:"add",path:""+(t.index+a),value:t.added[a].snapshot,oldValue:void 0},r);return}}}),Object.defineProperty(n.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a){var o=t.storedValue,s=r==="-"?o.length:Number(r);switch(a.op){case"replace":o[s]=a.value;break;case"add":o.splice(s,0,a.value);break;case"remove":o.splice(s,1);break}}}),Object.defineProperty(n.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){Yo(this,r);var a=t.storedValue;a.replace(r)}}),Object.defineProperty(n.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this;return qv(t)?qp(t.map(function(o,s){return a._subType.validate(o,Bv(r,""+s,a._subType))})):vi(r,t,"Value is not an array")}}),Object.defineProperty(n.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return pc}}),Object.defineProperty(n.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){t.storedValue.splice(Number(r),1)}}),n}(hc);xp.prototype.applySnapshot=Xr(xp.prototype.applySnapshot);function vx(e){return new xp("".concat(e.name,"[]"),e)}function U2(e,n,t,r,a){for(var o=!0,s=0;;s++){var c=s<=r.length-1,m=t[s],f=c?r[s]:void 0,v=""+a[s];if(qE(f)&&(f=f.storedValue),!m&&!c)break;if(!c)o=!1,t.splice(s,1),m instanceof pi&&m.createObservableInstanceIfNeeded(),m.die(),s--;else if(m)if(q2(m,f))t[s]=o0(n,e,v,f,m);else{for(var E=void 0,w=s;w<t.length;w++)if(q2(t[w],f)){E=t.splice(w,1)[0];break}o=!1;var y=o0(n,e,v,f,E);t.splice(s,0,y)}else{if(ir(f)&&dt(f).parent===e)throw new lt("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(e.path,"/").concat(v,"', but it lives already at '").concat(dt(f).path,"'"));o=!1;var y=o0(n,e,v,f);t.splice(s,0,y)}}return o?null:t}function o0(e,n,t,r,a){Yo(e,r);function o(){if(ir(r)){var c=dt(r);if(c.assertAlive(gc),c.parent!==null&&c.parent===n)return c.setParent(n,t),c}return a?e.reconcile(a,r,n,t):e.instantiate(n,t,void 0,r)}var s=o();return a&&a!==s&&(a instanceof pi&&a.createObservableInstanceIfNeeded(),a.die()),s}function q2(e,n){if(!e.isAlive)return!1;if(ir(n)){var t=dt(n);return t.isAlive&&t===e}if(e.snapshot===n)return!0;if(!(e instanceof pi))return!1;var r=e.getReconciliationType();return e.identifier!==null&&e.identifierAttribute&&Ds(n)&&r.is(n)&&r.isMatchingSnapshotId(e,n)}function mx(e){return sn(e)&&(e.flags&Nt.Array)>0}var H2="preProcessSnapshot",G2="postProcessSnapshot";function yx(){return dt(this).toString()}var V2={name:"AnonymousModel",properties:{},initializers:pc};function bx(e){var n=Object.keys(e),t=new Set;return n.forEach(function(r){if(t.has(r))throw new lt("".concat(r," is declared twice in the model. Model should not contain the same keys"));t.add(r)}),n.reduce(function(r,a){if(a in on)throw new lt("Hook '".concat(a,"' was defined as property. Hooks should be defined as part of the actions"));var o=Object.getOwnPropertyDescriptor(e,a);if("get"in o)throw new lt("Getters are not supported as properties. Please use views instead");var s=o.value;if(s==null)throw new lt("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(vc(s))r[a]=zs(Ox(s),s);else if(s instanceof Ep)r[a]=zs(s,{});else if(s instanceof xp)r[a]=zs(s,[]);else if(!sn(s))throw new lt("Invalid type definition for property '".concat(a,"', cannot infer a type from a value like '").concat(s,"' (").concat(typeof s,")"));return r},ln({},e))}var Nd=function(e){wr(n,e);function n(t){var r=e.call(this,t.name||V2.name)||this;return Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Object}),Object.defineProperty(r,"initializers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"properties",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"preProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"postProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"propertyNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"named",{enumerable:!0,configurable:!0,writable:!0,value:function(a){return r.cloneAndEnhance({name:a})}}),Object.defineProperty(r,"props",{enumerable:!0,configurable:!0,writable:!0,value:function(a){return r.cloneAndEnhance({properties:a})}}),Object.defineProperty(r,"preProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(a){var o=r.preProcessor;return o?r.cloneAndEnhance({preProcessor:function(s){return o(a(s))}}):r.cloneAndEnhance({preProcessor:a})}}),Object.defineProperty(r,"postProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(a){var o=r.postProcessor;return o?r.cloneAndEnhance({postProcessor:function(s){return a(o(s))}}):r.cloneAndEnhance({postProcessor:a})}}),Object.assign(r,V2,t),r.properties=bx(r.properties),r.properties,r.propertyNames=Object.keys(r.properties),r.identifierAttribute=r._getIdentifierAttribute(),r}return Object.defineProperty(n.prototype,"_getIdentifierAttribute",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=void 0;return this.forAllProps(function(r,a){if(a.flags&Nt.Identifier){if(t)throw new lt("Cannot define property '".concat(r,"' as object identifier, property '").concat(t,"' is already defined as identifier property"));t=r}}),t}}),Object.defineProperty(n.prototype,"cloneAndEnhance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new n({name:t.name||this.name,properties:Object.assign({},this.properties,t.properties),initializers:this.initializers.concat(t.initializers||[]),preProcessor:t.preProcessor||this.preProcessor,postProcessor:t.postProcessor||this.postProcessor})}}),Object.defineProperty(n.prototype,"actions",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this,a=function(o){return r.instantiateActions(o,t(o)),o};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(n.prototype,"instantiateActions",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(!Ds(r))throw new lt("actions initializer should return a plain object containing actions");Object.keys(r).forEach(function(a){if(a===H2)throw new lt("Cannot define action '".concat(H2,"', it should be defined using 'type.preProcessSnapshot(fn)' instead"));if(a===G2)throw new lt("Cannot define action '".concat(G2,"', it should be defined using 'type.postProcessSnapshot(fn)' instead"));var o=r[a],s=t[a];if(a in on&&s){var c=o;o=function(){s.apply(null,arguments),c.apply(null,arguments)}}var m=o.$mst_middleware,f=o.bind(r);f._isFlowAction=o._isFlowAction||!1,f.$mst_middleware=m;var v=Ld(t,a,f);r[a]=v,Fs(t,a,v)})}}),Object.defineProperty(n.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this;if(typeof t!="function")throw new lt("You passed an ".concat(typeof t," to volatile state as an argument, when function is expected"));var a=function(o){return r.instantiateVolatileState(o,t(o)),o};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(n.prototype,"instantiateVolatileState",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(!Ds(r))throw new lt("volatile state initializer should return a plain object containing state");bv(t,r)}}),Object.defineProperty(n.prototype,"extend",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this,a=function(o){var s=t(o),c=s.actions,m=s.views,f=s.state,v=VS(s,["actions","views","state"]);for(var y in v)throw new lt("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '".concat(y,"'"));return f&&r.instantiateVolatileState(o,f),m&&r.instantiateViews(o,m),c&&r.instantiateActions(o,c),o};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(n.prototype,"views",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this,a=function(o){return r.instantiateViews(o,t(o)),o};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(n.prototype,"instantiateViews",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(!Ds(r))throw new lt("views initializer should return a plain object containing views");Object.getOwnPropertyNames(r).forEach(function(a){var o,s=Object.getOwnPropertyDescriptor(r,a);if("get"in s)wv(t,a,s),_v(t,(o={},o[a]=Vs,o));else if(typeof s.value=="function")Fs(t,a,s.value);else throw new lt("A view member should either be a function or getter based property")})}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=ir(o)?o:this.applySnapshotPreProcessor(o);return Uv(this,t,r,a,s)}}),Object.defineProperty(n.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){r===void 0&&(r={});var a=t.type,o={};return a.forAllProps(function(s,c){o[s]=c.instantiate(t,s,void 0,r[s])}),o}}),Object.defineProperty(n.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=ln(ln({},Hp),{name:this.name});return ur.object(t,gc,r)}}),Object.defineProperty(n.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){Fs(r,"toString",yx),this.forAllProps(function(a){mv(r,a,t.unbox)}),this.initializers.reduce(function(a,o){return o(a)},r),Np(r,this.willChange),jp(r,this.didChange)}}),Object.defineProperty(n.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=t,a=dt(r.object),o=r.name;a.assertWritable({subpath:o});var s=a.type.properties[o];return s&&(Yo(s,r.newValue),r.newValue=s.reconcile(a.getChildNode(o),r.newValue,a,o)),r}}),Object.defineProperty(n.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=t,a=dt(r.object),o=a.type.properties[r.name];if(o){var s=r.oldValue?r.oldValue.snapshot:void 0;a.emitPatch({op:"replace",path:Vl(r.name),value:r.newValue.snapshot,oldValue:s},a)}}}),Object.defineProperty(n.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this,a=[];return this.forAllProps(function(o){a.push(r.getChildNode(t,o))}),a}}),Object.defineProperty(n.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a;if(!(r in this.properties))throw new lt("Not a value property: "+r);var o=Pa(t.storedValue,r),s=(a=o.raw)===null||a===void 0?void 0:a.call(o);if(!s)throw new lt("Node not available for property "+r);return s}}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this;r===void 0&&(r=!0);var o={};return this.forAllProps(function(s,c){try{var m=no(t.storedValue,s);m.reportObserved()}catch{throw new lt("".concat(s," property is declared twice"))}o[s]=a.getChildNode(t,s).snapshot}),r?this.applySnapshotPostProcessor(o):o}}),Object.defineProperty(n.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r={};return Object.keys(t).forEach(function(a){r[a]=t[a].getSnapshot()}),this.applySnapshotPostProcessor(r)}}),Object.defineProperty(n.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a){if(!(a.op==="replace"||a.op==="add"))throw new lt("object does not support operation ".concat(a.op));t.storedValue[r]=a.value}}),Object.defineProperty(n.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){Yo(this,r);var a=this.applySnapshotPreProcessor(r);this.forAllProps(function(o){t.storedValue[o]=a[o]})}}),Object.defineProperty(n.prototype,"applySnapshotPreProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.preProcessor;return r?r.call(null,t):t}}),Object.defineProperty(n.prototype,"applySnapshotPostProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.postProcessor;return r?r.call(null,t):t}}),Object.defineProperty(n.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.properties[t]}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this,o=this.applySnapshotPreProcessor(t);return Ds(o)?qp(this.propertyNames.map(function(s){return a.properties[s].validate(o[s],Bv(r,s,a.properties[s]))})):vi(r,o,"Value is not a plain object")}}),Object.defineProperty(n.prototype,"forAllProps",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this;this.propertyNames.forEach(function(a){return t(a,r.properties[a])})}}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;return"{ "+this.propertyNames.map(function(r){return r+": "+t.properties[r].describe()}).join("; ")+" }"}}),Object.defineProperty(n.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return gc}}),Object.defineProperty(n.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){t.storedValue[r]=void 0}}),n}(hc);Nd.prototype.applySnapshot=Xr(Nd.prototype.applySnapshot);function wx(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=typeof e[0]=="string"?e.shift():"AnonymousModel",r=e.shift()||{};return new Nd({name:t,properties:r})}function _x(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=typeof e[0]=="string",r=t?e[0]:"AnonymousModel";return t&&e.shift(),e.reduce(function(a,o){return a.cloneAndEnhance({name:a.name+"_"+o.name,properties:o.properties,initializers:o.initializers,preProcessor:function(s){return o.applySnapshotPreProcessor(a.applySnapshotPreProcessor(s))},postProcessor:function(s){return o.applySnapshotPostProcessor(a.applySnapshotPostProcessor(s))}})}).named(r)}function w4(e){return sn(e)&&(e.flags&Nt.Object)>0}var Zo=function(e){wr(n,e);function n(t,r,a,o){o===void 0&&(o=WE);var s=e.call(this,t)||this;return Object.defineProperty(s,"flags",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(s,"checker",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(s,"initializer",{enumerable:!0,configurable:!0,writable:!0,value:o}),s.flags=r,s}return Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return ts(this,t,r,a,o)}}),Object.defineProperty(n.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.initializer(t)}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(vc(t)&&this.checker(t))return gi();var a=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return vi(r,t,"Value is not a ".concat(a))}}),n}(Zs),_4=new Zo("string",Nt.String,function(e){return typeof e=="string"}),S4=new Zo("number",Nt.Number,function(e){return typeof e=="number"}),Sx=new Zo("integer",Nt.Integer,function(e){return YE(e)}),Ex=new Zo("float",Nt.Float,function(e){return KE(e)}),xx=new Zo("finite",Nt.Finite,function(e){return XE(e)}),E4=new Zo("boolean",Nt.Boolean,function(e){return typeof e=="boolean"}),x4=new Zo("null",Nt.Null,function(e){return e===null}),O4=new Zo("undefined",Nt.Undefined,function(e){return e===void 0}),P4=new Zo("Date",Nt.Date,function(e){return typeof e=="number"||e instanceof Date},function(e){return e instanceof Date?e:new Date(e)});P4.getSnapshot=function(e){return e.storedValue.getTime()};var C4=P4;function Ox(e){switch(typeof e){case"string":return _4;case"number":return S4;case"boolean":return E4;case"object":if(e instanceof Date)return C4}throw new lt("Cannot determine primitive type from value "+e)}function k4(e){return sn(e)&&(e.flags&(Nt.String|Nt.Number|Nt.Integer|Nt.Boolean|Nt.Date))>0}var Px=function(e){wr(n,e);function n(t){var r=e.call(this,JSON.stringify(t))||this;return Object.defineProperty(r,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Literal}),r.value=t,r}return Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return ts(this,t,r,a,o)}}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify(this.value)}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return vc(t)&&t===this.value?gi():vi(r,t,"Value is not a literal ".concat(JSON.stringify(this.value)))}}),n}(Zs);function A4(e){return new Px(e)}function Cx(e){return sn(e)&&(e.flags&Nt.Literal)>0}var kx=function(e){wr(n,e);function n(t,r,a,o){var s=e.call(this,t)||this;return Object.defineProperty(s,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(s,"_predicate",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(s,"_message",{enumerable:!0,configurable:!0,writable:!0,value:o}),s}return Object.defineProperty(n.prototype,"flags",{get:function(){return this._subtype.flags|Nt.Refinement},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return this._subtype.instantiate(t,r,a,o)}}),Object.defineProperty(n.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._subtype.isAssignableFrom(t)}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this._subtype.validate(t,r);if(a.length>0)return a;var o=ir(t)?dt(t).snapshot:t;return this._predicate(o)?gi():vi(r,t,this._message(t))}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return this._subtype.reconcile(t,r,a,o)}}),Object.defineProperty(n.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),n}(Xo);function Ax(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=typeof e[0]=="string"?e.shift():sn(e[0])?e[0].name:null,r=e[0],a=e[1],o=e[2]?e[2]:function(s){return"Value does not respect the refinement predicate"};return new kx(t,r,a,o)}function Tx(e){return sn(e)&&(e.flags&Nt.Refinement)>0}function Rx(e,n){var t=typeof e=="string"?n:e,r=Gp.apply(void 0,ao([],io(t.map(function(a){return A4(""+a)})),!1));return typeof e=="string"&&(r.name=e),r}var Mx=function(e){wr(n,e);function n(t,r,a){var o=e.call(this,t)||this;return Object.defineProperty(o,"_types",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"_dispatcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_eager",{enumerable:!0,configurable:!0,writable:!0,value:!0}),a=ln({eager:!0,dispatcher:void 0},a),o._dispatcher=a.dispatcher,a.eager||(o._eager=!1),o}return Object.defineProperty(n.prototype,"flags",{get:function(){var t=Nt.Union;return this._types.forEach(function(r){t|=r.flags}),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._types.some(function(r){return r.isAssignableFrom(t)})}}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"("+this._types.map(function(t){return t.describe()}).join(" | ")+")"}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=this.determineType(o,void 0);if(!s)throw new lt("No matching type for union "+this.describe());return s.instantiate(t,r,a,o)}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=this.determineType(r,t.getReconciliationType());if(!s)throw new lt("No matching type for union "+this.describe());return s.reconcile(t,r,a,o)}}),Object.defineProperty(n.prototype,"determineType",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this._dispatcher?this._dispatcher(t):r?r.is(t)?r:this._types.filter(function(a){return a!==r}).find(function(a){return a.is(t)}):this._types.find(function(a){return a.is(t)})}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(this._dispatcher)return this._dispatcher(t).validate(t,r);for(var a=[],o=0,s=0;s<this._types.length;s++){var c=this._types[s],m=c.validate(t,r);if(m.length===0){if(this._eager)return gi();o++}else a.push(m)}return o===1?gi():vi(r,t,"No type is applicable for the union").concat(qp(a))}}),Object.defineProperty(n.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),n}(Xo);function Gp(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];var r=sn(e)?void 0:e,a=sn(e)?ao([e],io(n),!1):n,o="("+a.map(function(s){return s.name}).join(" | ")+")";return new Mx(o,a,r)}function T4(e){return sn(e)&&(e.flags&Nt.Union)>0}var Lx=function(e){wr(n,e);function n(t,r,a){var o=e.call(this,t.name)||this;return Object.defineProperty(o,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"_defaultValue",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"optionalValues",{enumerable:!0,configurable:!0,writable:!0,value:a}),o}return Object.defineProperty(n.prototype,"flags",{get:function(){return this._subtype.flags|Nt.Optional},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype.describe()+"?"}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){if(this.optionalValues.indexOf(o)>=0){var s=this.getDefaultInstanceOrSnapshot();return this._subtype.instantiate(t,r,a,s)}return this._subtype.instantiate(t,r,a,o)}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return this._subtype.reconcile(t,this.optionalValues.indexOf(r)<0&&this._subtype.is(r)?r:this.getDefaultInstanceOrSnapshot(),a,o)}}),Object.defineProperty(n.prototype,"getDefaultInstanceOrSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=typeof this._defaultValue=="function"?this._defaultValue():this._defaultValue;return typeof this._defaultValue=="function"&&Yo(this,t),t}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this.optionalValues.indexOf(t)>=0?gi():this._subtype.validate(t,r)}}),Object.defineProperty(n.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._subtype.isAssignableFrom(t)}}),Object.defineProperty(n.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),n}(Xo);function Nx(e,n){if(typeof n!="function"&&ir(n))throw new lt("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function zs(e,n,t){return Nx(e,n),new Lx(e,n,t||Ix)}var Ix=[void 0];function jx(e){return sn(e)&&(e.flags&Nt.Optional)>0}var Dx=zs(O4,void 0),Fx=zs(x4,null);function R4(e){return Gp(e,Dx)}function zx(e){return Gp(e,Fx)}var Bx=function(e){wr(n,e);function n(t,r){var a=e.call(this,t)||this;return Object.defineProperty(a,"_definition",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),a}return Object.defineProperty(n.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|Nt.Late},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"getSubType",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!this._subType){var r=void 0;try{r=this._definition()}catch(a){if(a instanceof ReferenceError)r=void 0;else throw a}if(t&&r===void 0)throw new lt("Late type seems to be used too early, the definition (still) returns undefined");r&&(this._subType=r)}return this._subType}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return this.getSubType(!0).instantiate(t,r,a,o)}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return this.getSubType(!0).reconcile(t,r,a,o)}}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.getSubType(!1);return t?t.name:"<uknown late type>"}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this.getSubType(!1);return a?a.validate(t,r):gi()}}),Object.defineProperty(n.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.getSubType(!1);return r?r.isAssignableFrom(t):!1}}),Object.defineProperty(n.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.getSubType(!1);return t||Jw}}),n}(Xo);function Ux(e,n){var t=typeof e=="string"?e:"late(".concat(e.toString(),")"),r=typeof e=="string"?n:e;return new Bx(t,r)}function qx(e){return sn(e)&&(e.flags&Nt.Late)>0}function Hx(e,n){return new Gx(e,n)}var Gx=function(e){wr(n,e);function n(t,r){var a=e.call(this,t)||this;return Object.defineProperty(a,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Lazy}),Object.defineProperty(a,"loadedType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(a,"pendingNodeList",{enumerable:!0,configurable:!0,writable:!0,value:ur.array()}),tv(function(){return a.pendingNodeList.length>0&&a.pendingNodeList.some(function(o){return o.isAlive&&a.options.shouldLoadPredicate(o.parent?o.parent.value:null)})},function(){a.options.loadType().then(Xr(function(o){a.loadedType=o,a.pendingNodeList.forEach(function(s){s.parent&&a.loadedType&&s.parent.applyPatches([{op:"replace",path:"/".concat(s.subpath),value:s.snapshot}])})}))}),a}return Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<lazy ".concat(this.name,">")}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=this;if(this.loadedType)return this.loadedType.instantiate(t,r,a,o);var c=ts(this,t,r,a,o);return this.pendingNodeList.push(c),tv(function(){return!c.isAlive},function(){return s.pendingNodeList.splice(s.pendingNodeList.indexOf(c),1)}),c}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this.loadedType?this.loadedType.validate(t,r):p4(t)?gi():vi(r,t,"Value is not serializable and cannot be lazy")}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return this.loadedType?(t.die(),this.loadedType.instantiate(a,o,a.environment,r)):e.prototype.reconcile.call(this,t,r,a,o)}}),n}(Zs),M4=function(e){wr(n,e);function n(t){var r=e.call(this,t?"frozen(".concat(t.name,")"):"frozen")||this;return Object.defineProperty(r,"subType",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Frozen}),r}return Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<any immutable value>"}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){return ts(this,t,r,a,o)}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return p4(t)?this.subType?this.subType.validate(t,r):gi():vi(r,t,"Value is not serializable and cannot be frozen")}}),n}(Zs),$2=new M4;function Vx(e){return arguments.length===0?$2:sn(e)?new M4(e):zs($2,e)}function $x(e){return sn(e)&&(e.flags&Nt.Frozen)>0}function Wx(e){switch(e){case on.beforeDestroy:return"destroy";case on.beforeDetach:return"detach";default:return}}var Yx=function(){function e(n,t){if(Object.defineProperty(this,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"node",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolvedReference",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Vv(n))this.identifier=n;else if(ir(n)){var r=dt(n);if(!r.identifierAttribute)throw new lt("Can only store references with a defined identifier attribute.");var a=r.unnormalizedIdentifier;if(a==null)throw new lt("Can only store references to tree nodes with a defined identifier.");this.identifier=a}else throw new lt("Can only store references to tree nodes or identifiers, got: '".concat(n,"'"))}return Object.defineProperty(e.prototype,"updateResolvedReference",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var t=_c(this.identifier),r=n.root,a=r.identifierCache.getLastCacheModificationPerId(t);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==a){var o=this.targetType,s=r.identifierCache.resolve(o,t);if(!s)throw new Gv("[mobx-state-tree] Failed to resolve reference '".concat(this.identifier,"' to type '").concat(this.targetType.name,"' (from node: ").concat(n.path,")"));this.resolvedReference={node:s,lastCacheModification:a}}}}),Object.defineProperty(e.prototype,"resolvedValue",{get:function(){return this.updateResolvedReference(this.node),this.resolvedReference.node.value},enumerable:!1,configurable:!0}),e}(),Gv=function(e){wr(n,e);function n(t){var r=e.call(this,t)||this;return Object.setPrototypeOf(r,n.prototype),r}return n}(Error),L4=function(e){wr(n,e);function n(t,r){var a=e.call(this,"reference(".concat(t.name,")"))||this;return Object.defineProperty(a,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(a,"onInvalidated",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Reference}),a}return Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(n.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.targetType.isAssignableFrom(t)}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return Vv(t)?gi():vi(r,t,"Value is not a valid identifier, which is a string or a number")}}),Object.defineProperty(n.prototype,"fireInvalidated",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=r.parent;if(!(!s||!s.isAlive)){var c=s.storedValue;c&&this.onInvalidated({cause:t,parent:c,invalidTarget:o?o.storedValue:void 0,invalidId:a,replaceRef:function(m){dc(r.root.storedValue,{op:"replace",value:m,path:r.path})},removeRef:function(){w4(s.type)?this.replaceRef(void 0):dc(r.root.storedValue,{op:"remove",path:r.path})}})}}}),Object.defineProperty(n.prototype,"addTargetNodeWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var a=this,o=this.getValue(t);if(o){var s=dt(o),c=function(v,y){var E=Wx(y);E&&a.fireInvalidated(E,t,r,s)},m=s.registerHook(on.beforeDetach,c),f=s.registerHook(on.beforeDestroy,c);return function(){m(),f()}}}}),Object.defineProperty(n.prototype,"watchTargetNodeForInvalidations",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a){var o=this;if(this.onInvalidated){var s;t.registerHook(on.beforeDestroy,function(){s&&s()});var c=function(m){s&&s();var f=t.parent,v=f&&f.storedValue;if(f&&f.isAlive&&v){var y=void 0;a?y=!!a.get(r,v):y=t.root.identifierCache.has(o.targetType,_c(r)),y?s=o.addTargetNodeWatcher(t,r):m||o.fireInvalidated("invalidSnapshotReference",t,r,null)}};t.state===Tn.FINALIZED?c(!0):(t.isRoot||t.root.registerHook(on.afterCreationFinalization,function(){t.parent&&t.parent.createObservableInstanceIfNeeded()}),t.registerHook(on.afterAttach,function(){c(!1)}))}}}),n}(Zs),Kx=function(e){wr(n,e);function n(t,r){return e.call(this,t,r)||this}return Object.defineProperty(n.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(t.isAlive){var r=t.storedValue;return r.resolvedValue}}}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=t.storedValue;return r.identifier}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=ir(o)?Ww(o):o,c=new Yx(o,this.targetType),m=ts(this,t,r,a,c);return c.node=m,this.watchTargetNodeForInvalidations(m,s,void 0),m}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){if(!t.isDetaching&&t.type===this){var s=ir(r),c=t.storedValue;if(!s&&c.identifier===r||s&&c.resolvedValue===r)return t.setParent(a,o),t}var m=this.instantiate(a,o,void 0,r);return t.die(),m}}),n}(L4),Xx=function(e){wr(n,e);function n(t,r,a){var o=e.call(this,t,a)||this;return Object.defineProperty(o,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),o}return Object.defineProperty(n.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(t.isAlive){var r=this.options.get(t.storedValue,t.parent?t.parent.storedValue:null);return r}}}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=ir(o)?this.options.set(o,t?t.storedValue:null):o,c=ts(this,t,r,a,s);return this.watchTargetNodeForInvalidations(c,s,this.options),c}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=ir(r)?this.options.set(r,t?t.storedValue:null):r;if(!t.isDetaching&&t.type===this&&t.storedValue===s)return t.setParent(a,o),t;var c=this.instantiate(a,o,void 0,s);return t.die(),c}}),n}(L4);function N4(e,n){var t=n||void 0,r=n?n.onInvalidated:void 0;return t&&(t.get||t.set)?new Xx(e,{get:t.get,set:t.set},r):new Kx(e,r)}function Zx(e){return sn(e)&&(e.flags&Nt.Reference)>0}function Qx(e,n){var t=N4(e,ln(ln({},n),{onInvalidated:function(r){n&&n.onInvalidated&&n.onInvalidated(r),r.removeRef()}}));return n&&n.acceptsUndefined===!1?t:R4(t)}var I4=function(e){wr(n,e);function n(t,r){var a=e.call(this,t)||this;return Object.defineProperty(a,"validType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Identifier}),a}return Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){if(!t||!(t.type instanceof Nd))throw new lt("Identifier types can only be instantiated as direct child of a model type");return ts(this,t,r,a,o)}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){if(t.storedValue!==r)throw new lt("Tried to change identifier from '".concat(t.storedValue,"' to '").concat(r,"'. Changing identifiers is not allowed."));return t.setParent(a,o),t}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return typeof t!==this.validType?vi(r,t,"Value is not a valid ".concat(this.describe(),", expected a ").concat(this.validType)):gi()}}),n}(Zs),Jx=function(e){wr(n,e);function n(){var t=e.call(this,"identifier","string")||this;return Object.defineProperty(t,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Identifier}),t}return Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),n}(I4),eO=function(e){wr(n,e);function n(){return e.call(this,"identifierNumber","number")||this}return Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifierNumber"}}),n}(I4),tO=new Jx,rO=new eO;function nO(e){return sn(e)&&(e.flags&Nt.Identifier)>0}function _c(e){return""+e}function Vv(e){return typeof e=="string"||typeof e=="number"}function iO(e){return new aO(e)}var aO=function(e){wr(n,e);function n(t){var r=e.call(this,t.name)||this;return Object.defineProperty(r,"options",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Nt.Custom}),r}return Object.defineProperty(n.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(n.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(this.options.isTargetType(t))return gi();var a=this.options.getValidationMessage(t);return a?vi(r,t,"Invalid value for type '".concat(this.name,"': ").concat(a)):gi()}}),Object.defineProperty(n.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.options.toSnapshot(t.storedValue)}}),Object.defineProperty(n.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=this.options.isTargetType(o)?o:this.options.fromSnapshot(o,t&&t.root.environment);return ts(this,t,r,a,s)}}),Object.defineProperty(n.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,a,o){var s=!this.options.isTargetType(r);if(!t.isDetaching){var c=t.type===this&&(s?r===t.snapshot:r===t.storedValue);if(c)return t.setParent(a,o),t}var m=s?this.options.fromSnapshot(r,a.root.environment):r,f=this.instantiate(a,o,void 0,m);return t.die(),f}}),n}(Zs),W2={enumeration:Rx,model:wx,compose:_x,custom:iO,reference:N4,safeReference:Qx,union:Gp,optional:zs,literal:A4,maybe:R4,maybeNull:zx,refinement:Ax,string:_4,boolean:E4,number:S4,integer:Sx,float:Ex,finite:xx,Date:C4,map:px,array:vx,frozen:Vx,identifier:tO,identifierNumber:rO,late:Ux,lazy:Hx,undefined:O4,null:x4,snapshotProcessor:dx};const oO=Object.freeze(Object.defineProperty({__proto__:null,addDisposer:dE,addMiddleware:i4,applyAction:e4,applyPatch:dc,applySnapshot:Gw,cast:vE,castFlowReturn:rx,castToReferenceSnapshot:yE,castToSnapshot:mE,clone:uE,createActionTrackingMiddleware:EE,createActionTrackingMiddleware2:OE,decorate:RE,destroy:fE,detach:cE,escapeJsonPath:Vl,flow:m4,getChildType:$S,getEnv:hE,getIdentifier:Ww,getLivelinessChecking:Uw,getMembers:gE,getNodeId:bE,getParent:JS,getParentOfType:tE,getPath:$w,getPathParts:rE,getPropertyMembers:Xw,getRelativePath:sE,getRoot:Vw,getRunningActionContext:zv,getSnapshot:jv,getType:Wd,hasEnv:pE,hasParent:QS,hasParentOfType:eE,isActionContextChildOf:NE,isActionContextThisOrChildOf:IE,isAlive:Dv,isArrayType:mx,isFrozenType:$x,isIdentifierType:nO,isLateType:qx,isLiteralType:Cx,isMapType:gx,isModelType:w4,isOptionalType:jx,isPrimitiveType:k4,isProtected:ZS,isReferenceType:Zx,isRefinementType:Tx,isRoot:nE,isStateTreeNode:ir,isType:sn,isUnionType:T4,isValidReference:lE,joinJsonPath:Sp,onAction:t4,onPatch:Hw,onSnapshot:WS,process:VE,protect:KS,recordActions:AE,recordPatches:YS,resolveIdentifier:aE,resolvePath:iE,setLivelinessChecking:Bw,setLivelynessChecking:GS,splitJsonPath:mc,t:W2,toGenerator:ix,toGeneratorFunction:nx,tryReference:oE,tryResolve:Yw,typecheck:l4,types:W2,unescapeJsonPath:y4,unprotect:XS,walk:Kw},Symbol.toStringTag,{value:"Module"})),Zi=Yl(oO);var l0={},Y2;function j4(){return Y2||(Y2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getLimitedFontSize=function({oldText:n,newText:t,element:r}){if(!(t.length/Math.max(20,n.length)>=4))return r.fontSize;const a=r.width*r.page.computedHeight/t.length,o=1.5*Math.sqrt(a),s=r.fontSize;return Math.min(s,Math.max(5,Math.round(o)))}}(l0)),l0}var K2;function D4(){return K2||(K2=1,function(e){var n=ld&&ld.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=e.getLineHeight=e.useFontLoader=void 0,e.isRTLText=M,e.getDir=T,e.usePrevious=k;const t=n(Or()),r=Ri,a=oo,o=wc,s=Xi,c=n(Mi()),m=qS,f=Gd(),v=Ks(),y=Vd(),E=Jl(),w=Fw(),S=$d(),x=Ys(),_=Xs(),b=es(),g=Zi,h=j4();c.default._fixTextRendering=!0;const d=document.createElement("style");d.type="text/css",document.head.appendChild(d);const P={border:"none",padding:"0px",overflow:"hidden",background:"none",outline:"none",resize:"none",overflowWrap:"break-word",whiteSpace:"pre-wrap",userSelect:"text",wordBreak:"normal"};function M(O){O=O.replace(/\s/g,"");let N=0;for(var A=0;A<O.length;A++)R=O[A],L="֑-߿‏‫‮יִ-﷽ﹰ-ﻼ",new RegExp("^[^"+L+"]*?["+L+"]").test(R)&&(N+=1);var R,L;return N>O.length/2}function T(O){return M(O)?"rtl":"ltr"}const I=(0,r.observer)(({textNodeRef:O,element:N,onBlur:A,selectAll:R,cursorPosition:L})=>{const[V,G]=t.default.useState(P),W=O.current;t.default.useLayoutEffect(()=>{const U={};U.width=W.width()-2*W.padding()+"px",U.height=W.height()-2*W.padding()+W.fontSize()*W.lineHeight()+"px",U.fontSize=W.fontSize()+"px",U.lineHeight=W.lineHeight()+.01,U.fontFamily=W.fontFamily(),U.textAlign=W.align(),U.color=W.fill(),U.fontWeight=N.fontWeight,U.fontStyle=N.fontStyle,U.letterSpacing=N.letterSpacing+"em";const ee=`
96
- .polotno-input::placeholder {
97
- color: ${V.color};
98
- opacity: 0.6;
99
- }
100
- `;d.innerHTML="",d.appendChild(document.createTextNode(ee)),JSON.stringify(U)!==JSON.stringify(V)&&G(U)});const X=t.default.useRef(null);t.default.useLayoutEffect(()=>{var U;const ee=X.current;if(!ee)return;(U=X.current)===null||U===void 0||U.focus();const te=L||ee.value.length;ee.selectionStart=ee.selectionEnd=te,R&&(ee==null||ee.select(),document.execCommand("selectAll",!1,null))},[]),t.default.useEffect(()=>{window.addEventListener("blur",A);const U=ee=>{var te;!((te=X.current)===null||te===void 0)&&te.contains(ee.target)||A()};return window.addEventListener("touchstart",U),()=>{window.removeEventListener("blur",A),window.removeEventListener("touchstart",U)}},[]);let q=0;const z=W.textArr.length*W.lineHeight()*W.fontSize();N.verticalAlign==="middle"&&(q=(N.a.height-z)/2),N.verticalAlign==="bottom"&&(q=N.a.height-z);const Y=(0,w.removeTags)(N.text);return t.default.createElement("textarea",{className:"polotno-input",ref:X,dir:T(Y),style:Object.assign(Object.assign(Object.assign({},P),V),{paddingTop:q+"px"}),value:Y,onChange:U=>{const ee=(0,h.getLimitedFontSize)({oldText:N.text,newText:U.target.value,element:N});N.set({text:U.target.value,fontSize:ee})},placeholder:N.placeholder,onBlur:A})}),F=O=>t.default.createElement(o.Html,null,t.default.createElement(I,Object.assign({},O)));function k(O){const N=t.default.useRef(O),A=t.default.useRef(O);return t.default.useMemo(()=>{A.current=N.current,N.current=O},[O]),A.current}e.useFontLoader=(O,N)=>{const[A,R]=t.default.useReducer(V=>V+1,0),L=t.default.useRef((0,y.isFontLoaded)(N));return t.default.useLayoutEffect(()=>{if(L.current=(0,y.isFontLoaded)(N),L.current)return;let V=!0;return(async()=>{L.current=!1,R();const G=(0,v.incrementLoader)(`text ${N}`);await O.loadFont(N),setTimeout(G,100),V&&(L.current=!0,R())})(),()=>{V=!1}},[N]),[L.current]},e.getLineHeight=({fontLoaded:O,fontFamily:N,fontSize:A,lineHeight:R})=>t.default.useMemo(()=>{if(typeof R=="number")return R;const L=document.createElement("div");L.style.fontFamily=N,L.style.fontSize=A+"px",L.style.lineHeight=R,L.innerText="Test text",document.body.appendChild(L);const V=L.offsetHeight;return document.body.removeChild(L),V/A},[O,N,A,R]),e.TextElement=(0,r.observer)(({element:O,store:N})=>{const A=t.default.useRef(null),R=t.default.useRef(null),{editorEnabled:L,selectAll:V}=(he=>{const[xe,oe]=t.default.useState(!1),ve=t.default.useRef(!1);return t.default.useEffect(()=>{var de=!0;return setTimeout(()=>{de&&(he._editModeEnabled&&(ve.current=!0),oe(!0),setTimeout(()=>{ve.current=!1},50))},50),()=>{de=!1}},[]),{editorEnabled:xe&&he._editModeEnabled,selectAll:ve.current}})(O),[G,W]=t.default.useState(!1),[X,q]=t.default.useState(!1),z=t.default.useRef(O.a.height),Y=N.selectedShapes.indexOf(O)>=0,{textVerticalResizeEnabled:U}=E.flags,ee=k(O.fontFamily),[te,Q]=t.default.useState([]);t.default.useEffect(()=>{var he,xe;const oe=(xe=(he=A.current)===null||he===void 0?void 0:he.textArr)!==null&&xe!==void 0?xe:[];JSON.stringify(oe)!==JSON.stringify(te)&&Q(oe)}),t.default.useEffect(()=>{if(O.a.width)return;const he=A.current;he.width(600),O.set({width:1.4*he.getTextWidth()})},[]),t.default.useLayoutEffect(()=>(0,s.autorun)(()=>{const he=A.current;(0,S.applyFilter)(he,O)}));const[Z]=(0,e.useFontLoader)(N,O.fontFamily),re=(0,w.removeTags)(O.text),ne=()=>{const he=A.current.clone({height:void 0}),xe=Math.ceil(he.fontSize()*he.lineHeight()*he.textArr.length+1);return he.destroy(),xe};t.default.useLayoutEffect(()=>{if(!Z)return;const{textOverflow:he,textSplitAllowed:xe}=E.flags;if(O.a.height){if(!N.isPlaying)if(he!=="change-font-size"||X){if(he==="resize"){const oe=ne();U&&O.a.height<oe&&N.history.ignore(()=>{var ve;(0,g.isAlive)(O)&&O.set({height:oe}),(ve=A.current)===null||ve===void 0||ve.height(oe)},!1,!0),U||O.a.height===oe||N.history.ignore(()=>{var ve;(0,g.isAlive)(O)&&O.set({height:oe}),(ve=A.current)===null||ve===void 0||ve.height(oe)},!1,!0)}}else{const oe=function(de,ke,Be=!1){const Qe=de.fontSize(),Ke=de.height(),St=(0,w.removeTags)(ke.text);let Ue=ke.a.fontSize;de.height(void 0);const rt=Math.round(2*ke.a.fontSize)-1;for(let gt=1;gt<rt;gt++){const mt=ke.a.height&&de.height()>ke.a.height;let kt=St.split(`
101
- `).join(" ").split(/[\s-]+/).reduce((Se,yt)=>/[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF\uAC00-\uD7AF]/.test(yt)?Se.concat(yt.split("")):Se.concat(yt),[]),jt=de.textArr.map(Se=>Se.text).join(";");const Oe=kt.find(Se=>!jt.includes(Se)||(jt=jt.replace(Se,""),!1));if(!(mt||Oe&&!Be))break;Ue-=.5,de.fontSize(Ue)}return de.fontSize(Qe),de.height(Ke),Ue}(A.current,O,xe);if(oe!==O.a.fontSize)return void N.history.ignore(()=>{O.set({fontSize:oe})},!1,!0);const ve=ne();O.a.height===ve||U||N.history.ignore(()=>{O.set({height:ve})},!1,!0)}}else{const oe=ne();N.history.ignore(()=>{O.set({height:oe})},!1,!0)}}),t.default.useLayoutEffect(()=>{const he=A.current;he&&(he.width(he.width()+1e-8),he._setTextData(),(0,S.applyFilter)(he,O))},[Z]);const ae=t.default.useRef(null),ue=t.default.useRef(0),fe=he=>{he.evt.preventDefault(),N.selectedShapes.find(oe=>oe===O)&&O.contentEditable&&(ue.current=function(oe){var ve;const de=oe.target,ke=function(rt){var gt=rt.getAbsoluteTransform().copy();gt.invert();var mt=rt.getStage().getPointerPosition();return gt.point(mt)}(de),Be=de.textArr,Qe=Math.floor(ke.y/(de.fontSize()*de.lineHeight())),Ke=Be.slice(0,Qe).reduce((rt,gt)=>rt+gt.text.length,Qe),St=(ve=Be[Qe])!==null&&ve!==void 0?ve:Be[0];let Ue=0;return de.align()==="right"?Ue=de.width()-St.width:de.align()==="center"&&(Ue=de.width()/2-St.width/2),Ke+Math.round((ke.x-Ue)/St.width*St.text.length)}(he),O.toggleEditMode())},pe=!re&&O.placeholder?.6:O.a.opacity;(0,x.useFadeIn)(A,pe);const ye=(0,e.getLineHeight)({fontLoaded:Z,fontFamily:O.fontFamily,fontSize:O.a.fontSize,lineHeight:O.lineHeight}),we=O.selectable||N.role==="admin",je=(0,f.useColor)(O),Te=t.default.useMemo(()=>O.backgroundEnabled?function({lines:he,lineHeight:xe,width:oe,align:ve="left",padding:de=0,cornerRadius:ke=0}){var Be;he.forEach((Ue,rt)=>{Ue.cx=oe/2,ve==="right"?Ue.cx=oe-Ue.width/2:ve==="left"&&(Ue.cx=Ue.width/2),ve!=="justify"||Ue.lastInParagraph||(Ue.width=oe),ve==="justify"&&(Ue.cx=Ue.width/2)});let Qe=`M ${(Be=he[0])===null||Be===void 0?void 0:Be.cx} ${-de}`;he.forEach((Ue,rt)=>{const{cx:gt}=Ue,mt=he[rt-1];mt&&mt.width>Ue.width?Qe+=` L ${gt+Ue.width/2+de} ${rt*xe+de}`:Qe+=` L ${gt+Ue.width/2+de} ${rt*xe-de}`;const kt=he[rt+1];kt&&kt.width>Ue.width?Qe+=` L ${gt+Ue.width/2+de} ${(rt+1)*xe-de}`:Qe+=` L ${gt+Ue.width/2+de} ${(rt+1)*xe+de}`});for(var Ke=he.length-1;Ke>=0;Ke--){const Ue=he[Ke],{cx:rt}=Ue,gt=he[Ke+1];gt&&gt.width>Ue.width?Qe+=` L ${rt-Ue.width/2-de} ${(Ke+1)*xe-de}`:Qe+=` L ${rt-Ue.width/2-de} ${(Ke+1)*xe+de}`;const mt=he[Ke-1];mt&&mt.width>Ue.width?Qe+=` L ${rt-Ue.width/2-de} ${Ke*xe+de}`:Qe+=` L ${rt-Ue.width/2-de} ${Ke*xe-de}`}Qe+=" Z";const St=(0,m.parsePath)(Qe);return(0,m.roundCommands)(St,ke).path}({lines:JSON.parse(JSON.stringify(te)),cornerRadius:O.backgroundCornerRadius*(O.a.fontSize*ye*.5),lineHeight:ye*O.a.fontSize,padding:O.backgroundPadding*(O.a.fontSize*ye*.5),width:O.a.width,align:O.align}):"",[O.backgroundEnabled,O.backgroundCornerRadius,O.a.fontSize,ye,O.backgroundPadding,O.a.width,O.align,te]),se=(0,b.isTouchDevice)();let _e=0;return O.verticalAlign==="middle"?_e=(O.a.height-te.length*ye*O.a.fontSize)/2:O.verticalAlign==="bottom"&&(_e=O.a.height-te.length*ye*O.a.fontSize),t.default.createElement(t.default.Fragment,null,t.default.createElement(a.Path,{ref:R,x:O.a.x,y:O.a.y,rotation:O.a.rotation,hideInExport:!O.showInExport,listening:!1,visible:O.backgroundEnabled,opacity:O.backgroundOpacity*pe,data:Te,fill:O.backgroundColor,offsetY:-_e}),t.default.createElement(a.Text,Object.assign({ref:A,id:O.id,name:"element",hideInExport:!O.showInExport,editModeEnabled:O._editModeEnabled,x:O.a.x,y:O.a.y,rotation:O.a.rotation,width:O.a.width,height:O.a.height,text:re||O.placeholder,direction:T(re)},je,{stroke:O.stroke,lineJoin:"round",strokeWidth:O.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:O.a.fontSize,fontFamily:`"${O.fontFamily}", "${ee}"`,fontStyle:O.fontStyle+" "+O.fontWeight,textDecoration:O.textDecoration,align:O.align,verticalAlign:O.verticalAlign,draggable:se?O.draggable&&Y:O.draggable,preventDefault:!se||Y,opacity:pe,visible:!O._editModeEnabled,ellipsis:E.flags.textOverflow==="ellipsis",shadowEnabled:O.shadowEnabled,shadowBlur:O.shadowBlur,shadowOffsetX:O.shadowOffsetX,shadowOffsetY:O.shadowOffsetY,shadowColor:O.shadowColor,shadowOpacity:O.shadowOpacity,lineHeight:ye,letterSpacing:O.letterSpacing*O.a.fontSize,listening:we,onDragMove:he=>{O.set({x:he.target.x(),y:he.target.y()})},onDragEnd:he=>{O.set({x:he.target.x(),y:he.target.y()})},onMouseEnter:()=>{W(!0)},onMouseLeave:()=>{W(!1)},onClick:fe,onTap:fe,onTransformStart:()=>{q(!0),z.current=A.current.height()},onTransform:he=>{var xe,oe;const ve=he.target;(xe=R.current)===null||xe===void 0||xe.setAttrs({x:ve.x(),y:ve.y(),rotation:ve.rotation(),scale:ve.scale()});const de=((oe=ve.getStage())===null||oe===void 0?void 0:oe.findOne("Transformer")).getActiveAnchor();if(de==="middle-left"||de==="middle-right"){const ke=ve.scaleX(),Be=ve.width()*ke,Qe=O.a.fontSize;let Ke=Be;Be<Qe&&(Ke=Qe,ae.current&&ve.position(ae.current)),ve.width(Ke),ve.scaleX(1),ve.scaleY(1);const St=ne();if(E.flags.textOverflow!=="ellipsis"){const Ue=Math.max(St,z.current);ve.height(Ue),O.set({height:ve.height()})}O.set({x:ve.x(),y:ve.y(),width:ve.width(),rotation:ve.rotation()}),(0,S.applyFilter)(ve,O)}if(de==="top-center"||de==="bottom-center"){let ke=E.flags.textOverflow==="resize"?ne():ye*O.a.fontSize;he.target.height(Math.max(ke,he.target.height()*he.target.scaleY())),he.target.scaleY(1)}ae.current=he.target.position()},onTransformEnd:he=>{var xe;const oe=he.target.scaleX();he.target.scaleX(1),he.target.scaleY(1),O.set({fontSize:Math.round(O.a.fontSize*oe),width:Math.ceil(he.target.width()*oe),x:he.target.x(),y:he.target.y(),rotation:he.target.rotation(),height:he.target.height()*oe,shadowBlur:O.shadowBlur*oe,shadowOffsetX:O.shadowOffsetX*oe,shadowOffsetY:O.shadowOffsetY*oe,strokeWidth:O.strokeWidth*oe}),(xe=R.current)===null||xe===void 0||xe.setAttrs({scaleX:1,scaleY:1}),q(!1)}})),L&&t.default.createElement(a.Group,{x:O.a.x,y:O.a.y,rotation:O.a.rotation},t.default.createElement(F,{textNodeRef:A,element:O,selectAll:V,cursorPosition:ue.current,onBlur:()=>{O.toggleEditMode(!1)}})),!X&&(G||Y)&&t.default.createElement(_.Highlighter,{element:O}))})}(ld)),ld}var ga={},hd={},s0={exports:{}},u0={exports:{}},X2;function $v(){return X2||(X2=1,function(e,n){e.exports=t;function t(a){return r.bind(null,a)}function r(a){var o=[].slice.call(arguments,1);o.unshift("["+a+"]"),process.stderr.write(o.join(" ")+`
102
- `)}}(u0)),u0.exports}var Z2;function F4(){return Z2||(Z2=1,function(e,n){$v()("lex"),e.exports=t;function t(r){var a="",o,s=0,c=-1,m=0,f=1,v="before-selector",y=[v],E={},w=[],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 x(){return I(),r[c]}function _(G){return G?y[y.length-1-G]:v}function b(G){var W=c+1;return G===r.slice(W,W+G.length)}function g(G){var W=r.slice(c).indexOf(G);return W>0?W:!1}function h(G){return G===d(1)}function d(G){return r[c+(G||1)]}function P(){var G=y.pop();return v=y[y.length-1],G}function M(G){return v=G,y.push(v),y.length}function T(G){var W=v;return y[y.length-1]=v=G,W}function I(G){if((G||1)==1)r[c]==`
103
- `?(f++,s=1):s++,c++;else{var W=r.slice(c,c+G).split(`
104
- `);W.length>1&&(f+=W.length-1,s=1),s+=W[W.length-1].length,c=c+G}}function F(){E.end={line:f,col:s},w.push(E),a="",E={}}function k(G){E={type:G,start:{line:f,col:s}}}for(;o=x();)switch(o){case" ":switch(_()){case"selector":case"value":case"value-paren":case"at-group":case"at-value":case"comment":case"double-string":case"single-string":a+=o;break}break;case`
105
- `:case" ":case"\r":case"\f":switch(_()){case"value":case"value-paren":case"at-group":case"comment":case"single-string":case"double-string":case"selector":a+=o;break;case"at-value":o===`
106
- `&&(E.value=a.trim(),F(),P());break}break;case":":switch(_()){case"name":E.name=a.trim(),a="",T("before-value");break;case"before-selector":a+=o,k("selector"),M("selector");break;case"before-value":T("value"),a+=o;break;default:a+=o;break}break;case";":switch(_()){case"name":case"before-value":case"value":a.trim().length>0&&(E.value=a.trim(),F()),T("before-name");break;case"value-paren":a+=o;break;case"at-value":E.value=a.trim(),F(),P();break;case"before-name":break;default:a+=o;break}break;case"{":switch(_()){case"selector":if(d(-1)==="\\"){a+=o;break}E.text=a.trim(),F(),T("before-name"),m=m+1;break;case"at-group":switch(E.name=a.trim(),E.type){case"font-face":case"viewport":case"page":M("before-name");break;default:M("before-selector")}F(),m=m+1;break;case"name":case"at-rule":E.name=a.trim(),F(),M("before-name"),m=m+1;break;case"comment":case"double-string":case"single-string":a+=o;break;case"before-value":T("value"),a+=o;break}break;case"}":switch(_()){case"before-name":case"name":case"before-value":case"value":a&&(E.value=a.trim()),E.name&&E.value&&F(),k("end"),F(),P(),_()==="at-group"&&(k("at-group-end"),F(),P()),m>0&&(m=m-1);break;case"at-group":case"before-selector":case"selector":if(d(-1)==="\\"){a+=o;break}m>0&&_(1)==="at-group"&&(k("at-group-end"),F()),m>1&&P(),m>0&&(m=m-1);break;case"double-string":case"single-string":case"comment":a+=o;break}break;case'"':case"'":switch(_()){case"double-string":o==='"'&&d(-1)!=="\\"&&P();break;case"single-string":o==="'"&&d(-1)!=="\\"&&P();break;case"before-at-value":T("at-value"),M(o==='"'?"double-string":"single-string");break;case"before-value":T("value"),M(o==='"'?"double-string":"single-string");break;case"comment":break;default:d(-1)!=="\\"&&M(o==='"'?"double-string":"single-string")}a+=o;break;case"/":switch(_()){case"comment":case"double-string":case"single-string":a+=o;break;case"before-value":case"selector":case"name":case"value":if(h("*")){var O=g("*/");O&&I(O+1)}else _()=="before-value"&&T("value"),a+=o;break;default:h("*")?(k("comment"),M("comment"),I()):a+=o;break}break;case"*":switch(_()){case"comment":h("/")?(E.text=a,I(),F(),P()):a+=o;break;case"before-selector":a+=o,k("selector"),M("selector");break;case"before-value":T("value"),a+=o;break;default:a+=o}break;case"@":switch(_()){case"comment":case"double-string":case"single-string":a+=o;break;case"before-value":T("value"),a+=o;break;default:for(var N=!1,A,R,L=0,V=S.length;!N&&L<V;++L)R=S[L],A=R.name||R,b(A)&&(N=!0,k(A),M(R.state||"at-group"),I(A.length),R.prefix&&(E.prefix=R.prefix),R.type&&(E.type=R.type));N||(a+=o);break}break;case"(":switch(_()){case"value":M("value-paren");break;case"before-value":T("value");break}a+=o;break;case")":switch(_()){case"value-paren":P();break;case"before-value":T("value");break}a+=o;break;default:switch(_()){case"before-selector":k("selector"),M("selector");break;case"before-name":k("property"),T("name");break;case"before-value":T("value");break;case"before-at-value":T("at-value");break}a+=o;break}return w}}(s0)),s0.exports}var c0={exports:{}},Q2;function lO(){return Q2||(Q2=1,function(e,n){$v()("parse");var t=F4();e.exports=c;var r,a,o,s;function c(P,M){M||(M={}),r=!!M.comments,o=!!M.position,a=0,s=Array.isArray(P)?P.slice():t(P);for(var T,I=[],F;F=f();)T=b(F),T&&I.push(T);return{type:"stylesheet",stylesheet:{rules:I}}}function m(P,M){M||(M={});for(var T,I=["type","name","value"],F={},k=0;k<I.length;++k)T=I[k],P[T]&&(F[T]=M[T]||P[T]);for(I=Object.keys(M),k=0;k<I.length;++k)T=I[k],F[T]||(F[T]=M[T]);return o&&(F.position={start:P.start,end:P.end}),F}function f(){var P=s.shift();return P}function v(P){a=a+1;var M={};switch(P.type){case"font-face":case"viewport":M.declarations=h();break;case"page":M.prefix=P.prefix,M.declarations=h();break;default:M.prefix=P.prefix,M.rules=d()}return m(P,M)}function y(P){return m(P)}function E(P){return m(P)}function w(P){return m(P,{text:P.text})}function S(P){return m(P)}function x(P){return m(P)}function _(P){function M(T){return T.trim()}return m(P,{type:"rule",selectors:P.text.split(",").map(M),declarations:h()})}function b(P){switch(P.type){case"property":return x(P);case"selector":return _(P);case"at-group-end":a=a-1;return;case"media":case"keyframes":return v(P);case"comment":if(r)return w(P);break;case"charset":return E(P);case"import":return y(P);case"namespace":return S(P);case"font-face":case"supports":case"viewport":case"document":case"page":return v(P)}}function g(P){for(var M,T=[],I;(I=f())&&P&&P(I);)M=b(I),M&&T.push(M);return I&&I.type!=="end"&&s.unshift(I),T}function h(){return g(function(P){return P.type==="property"||P.type==="comment"})}function d(){return g(function(){return a})}}(c0)),c0.exports}var f0={exports:{}},J2;function sO(){return J2||(J2=1,function(e,n){$v()("stringify");var t,r,a,o,s,c;e.exports=m;function m(d,P){P||(P={}),a=P.indentation||"",r=!!P.compress,t=!!P.comments,o=1,r?s=c="":(s=`
107
- `,c=" ");var M=S(d.stylesheet.rules,g).join(`
108
- `).trim();return M}function f(d){if(d){o+=d;return}return r?"":Array(o).join(a||"")}function v(d){return"@"+d.type+" "+d.value+";"+s}function y(d){var P="",M=d.prefix||"";d.name&&(P=" "+d.name);var T=d.type!=="page";return"@"+M+d.type+P+c+x(d,T)+s}function E(d){return t?"/*"+(d.text||"")+"*/"+s:""}function w(d){var P;return d.selectors?P=d.selectors.join(","+s):(P="@"+d.type,P+=d.name?" "+d.name:""),f()+P+c+x(d)+s}function S(d,P){return d.reduce(function(M,T){var I=T.type==="comment"?E(T):P(T);return I&&M.push(I),M},[])}function x(d,P){var M=d.declarations,T=b;return d.rules&&(M=d.rules,T=w),M=_(M,T),M&&(M=s+M+(P?"":s)),"{"+M+f()+"}"}function _(d,P){if(!d)return"";f(1);var M=S(d,P);return f(-1),M.length?M.join(s):""}function b(d){if(d.type==="property")return h(d)}function g(d){switch(d.type){case"rule":return w(d);case"media":case"keyframes":return y(d);case"comment":return E(d);case"import":case"charset":case"namespace":return v(d);case"font-face":case"supports":case"viewport":case"document":case"page":return y(d)}}function h(d){var P=d.name?d.name+":"+c:"";return f()+P+d.value+";"}}(f0)),f0.exports}var d0,eb;function uO(){return eb||(eb=1,d0={lex:F4(),parse:lO(),stringify:sO()}),d0}var tb;function Yd(){return tb||(tb=1,function(e){var n=hd&&hd.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.useSvgColors=e.sameColors=void 0,e.urlToBase64=async function(S){const x=await fetch(S);return w(await x.text())},e.urlToString=y,e.getColors=E,e.svgToURL=w,e.getSvgSize=async function(S){const x=await y(S),_=new DOMParser().parseFromString(x,"image/svg+xml").documentElement.getAttribute("viewBox"),[b,g,h,d]=(_==null?void 0:_.split(" "))||[];return{width:parseFloat(h),height:parseFloat(d)}},e.fixSize=function(S){var x=new DOMParser().parseFromString(S,"image/svg+xml");const _=x.documentElement.getAttribute("viewBox"),[b,g,h,d]=(_==null?void 0:_.split(" "))||[],P=x.documentElement.getAttribute("width");P||x.documentElement.setAttribute("width",h+"px");const M=x.documentElement.getAttribute("height");if((!M||M.indexOf("%")>=0)&&x.documentElement.setAttribute("height",d+"px"),P&&P.indexOf("%")>=0&&M&&M.indexOf("%")===-1){const T=parseFloat(M)/parseFloat(d);x.documentElement.setAttribute("width",T*parseFloat(h)+"px")}if(M&&M.indexOf("%")>=0&&P&&P.indexOf("%")===-1){const T=parseFloat(P)/parseFloat(h);x.documentElement.setAttribute("height",T*parseFloat(d)+"px")}return P==="100%"&&M==="100%"&&(x.documentElement.setAttribute("width",h+"px"),x.documentElement.setAttribute("height",d+"px")),new XMLSerializer().serializeToString(x)},e.replaceColors=function(S,x){var _=new DOMParser().parseFromString(S,"image/svg+xml");const b=v(_),g=Array.from(x.keys()),h=c(_);return b.forEach(d=>{const{fill:P,stroke:M}=m(d,h);[{prop:"fill",color:P},{prop:"stroke",color:M}].forEach(({prop:T,color:I})=>{const F=g.find(k=>(0,e.sameColors)(k,I));if(F){const k=x.get(F);if((0,a.isGradient)(k)){const{rotation:O,stops:N}=(0,a.parseColor)(k),A=N.map(L=>({offset:100*L.offset+"%","stop-color":L.color})),R="color"+Math.round(1e8*Math.random());(function(L,V,G,W){var X=L.namespaceURI,q=document.createElementNS(X,"linearGradient");const z=t.default.Util.degToRad(G+90),Y=(Math.cos(z)+1)/2,U=(Math.sin(z)+1)/2,ee=(Math.cos(z+Math.PI)+1)/2,te=(Math.sin(z+Math.PI)+1)/2;q.setAttribute("x1",100*Y+"%"),q.setAttribute("y1",100*U+"%"),q.setAttribute("x2",100*ee+"%"),q.setAttribute("y2",100*te+"%"),q.setAttribute("gradientUnits","userSpaceOnUse"),q.setAttribute("id",V);for(var Q=0;Q<W.length;Q++){var Z=W[Q],re=document.createElementNS(X,"stop");for(var ne in Z)Z.hasOwnProperty(ne)&&re.setAttribute(ne,Z[ne]);q.appendChild(re)}(L.querySelector("defs")||L.insertBefore(document.createElementNS(X,"defs"),L.firstChild)).appendChild(q)})(_.children[0],R,O,A),d.style[T]=null,d.setAttribute(T,`url('#${R}')`)}else d.style[T]=x.get(F)}})}),w(new XMLSerializer().serializeToString(_))};const t=n(Mi()),r=n(Or()),a=Iv(),o=n(uO());function s(S){for(;S.parentNode;){if(S.nodeName==="defs")return!0;S=S.parentNode}return!1}function c(S){const x={};return S.querySelectorAll("style").forEach(_=>{const b=o.default.parse(_.textContent).stylesheet.rules;for(let g of b)g.selectors&&g.selectors.forEach(h=>{const d=x[h]||{};g.declarations.forEach(P=>{d[P.name]=P.value}),x[h]=d})}),x}function m(S,x){var _;const b={fill:"",stroke:""},g=((_=S.getAttribute("class"))===null||_===void 0?void 0:_.split(" "))||[],h=S.getAttribute("id");let d={};if(h&&x[`#${h}`]?d=x[`#${h}`]:g.forEach(P=>{x[`.${P}`]&&(d=Object.assign(Object.assign({},d),x[`.${P}`]))}),x[S.nodeName]&&(d=Object.assign(Object.assign({},d),x[S.nodeName])),S.getAttribute("fill")&&S.getAttribute("fill")!=="none"?b.fill=S.getAttribute("fill"):d.fill&&d.fill!=="none"&&(b.fill=d.fill),S.getAttribute("stroke")&&S.getAttribute("stroke")!=="none"?b.stroke=S.getAttribute("stroke"):d.stroke&&d.stroke!=="none"&&(b.stroke=d.stroke),!b.fill&&S.style.fill&&S.style.fill!=="none"&&(b.fill=S.style.fill),!b.stroke&&S.style.stroke&&S.style.stroke!=="none"&&(b.stroke=S.style.stroke),!b.stroke&&!b.fill){const P=S.ownerSVGElement,M=P&&P!==S&&m(P,x);(M==null?void 0:M.fill)==="currentColor"||(M==null?void 0:M.stroke)==="currentColor"||(b.fill="black")}return b}const f=["path","rect","circle","line","polygon","polyline","ellipse","text"];function v(S){for(var x=[],_=S.getElementsByTagName("*"),b=0,g=_.length;b<g;b++){const h=_[b];s(h)||(h.getAttribute("fill")!==null&&x.push(h),(h.getAttribute("stroke")!==null||h.style&&h.style.fill||f.indexOf(h.nodeName)>=0)&&x.push(h))}return x}async function y(S){return await(await fetch(S,{mode:"cors"})).text()}function E(S){var x=new DOMParser().parseFromString(S,"image/svg+xml");const _=c(x),b=v(x),g=[];return b.forEach(h=>{const{fill:d,stroke:P}=m(h,_);[d,P].forEach(M=>{M&&(M==="currentColor"&&(M="black"),t.default.Util.colorToRGBA(M)&&g.indexOf(M)===-1&&g.push(M))})}),g}function w(S){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(S)))}e.sameColors=(S,x)=>{if(!S||!x)return!1;if(x==="currentColor"&&S==="black")return!0;const _=t.default.Util.colorToRGBA(S),b=t.default.Util.colorToRGBA(x);return _&&b?_.r===b.r&&_.g===b.g&&_.b===b.b&&_.a===b.a:void 0},e.useSvgColors=S=>{const[x,_]=r.default.useState([]);return r.default.useEffect(()=>{let b=!1;return(async()=>{_([]);const g=E(await y(S));b||_(g)})(),()=>{b=!0}},[S]),x}}(hd)),hd}var h0={},rb;function z4(){return rb||(rb=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.trySetCanvasSize=void 0,e.trySetCanvasSize=(n,t,r)=>{let a=t,o=r,s=1;for(;a>0&&o>0;){n.width=a,n.height=o;const c=n.getContext("2d");if(!c)return;if(c.fillStyle="rgba(0,0,0,0.1)",c.fillRect(0,0,1,1),c.getImageData(0,0,1,1).data[3]!==0)return void c.clearRect(0,0,n.width,n.height);if(s*=.9,a=Math.floor(t*s),o=Math.floor(r*s),a=Math.max(a,1),o=Math.max(o,1),a<=1&&o<=1)return n.width=1,void(n.height=1)}}}(h0)),h0}var nb;function Wv(){return nb||(nb=1,function(e){var n,t=ga&&ga.__createBinding||(Object.create?function(R,L,V,G){G===void 0&&(G=V);var W=Object.getOwnPropertyDescriptor(L,V);W&&!("get"in W?!L.__esModule:W.writable||W.configurable)||(W={enumerable:!0,get:function(){return L[V]}}),Object.defineProperty(R,G,W)}:function(R,L,V,G){G===void 0&&(G=V),R[G]=L[V]}),r=ga&&ga.__setModuleDefault||(Object.create?function(R,L){Object.defineProperty(R,"default",{enumerable:!0,value:L})}:function(R,L){R.default=L}),a=ga&&ga.__importStar||(n=function(R){return n=Object.getOwnPropertyNames||function(L){var V=[];for(var G in L)Object.prototype.hasOwnProperty.call(L,G)&&(V[V.length]=G);return V},n(R)},function(R){if(R&&R.__esModule)return R;var L={};if(R!=null)for(var V=n(R),G=0;G<V.length;G++)V[G]!=="default"&&t(L,R,V[G]);return r(L,R),L}),o=ga&&ga.__importDefault||function(R){return R&&R.__esModule?R:{default:R}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=e.useImageLoader=e.setImageLoaderHook=e.useCornerRadiusAndCrop=e.setOuterImageCropTransformerStyle=e.setInnerImageCropTransformerStyle=e.useSizeFixer=void 0;const s=o(Or()),c=Ri,m=Xi,f=oo,v=o(Up()),y=o(Mi()),E=wc,w=Xs(),S=Ks(),x=a(Yd()),_=Jl(),b=z4(),g=$d(),h=Ys(),d=es();function P(){return document.createElement("canvas")}function M(R,L){return{x:(R.x+L.x)/2,y:(R.y+L.y)/2}}e.useSizeFixer=R=>{const[L,V]=s.default.useState(R);return s.default.useEffect(()=>{(async()=>{const G=await async function(W){if(!(W.indexOf("data:image/svg+xml")>=0||W.indexOf(".svg")>=0))return W;const X=await x.urlToString(W),q=x.fixSize(X);return x.svgToURL(q)}(R);G!==L&&V(G)})()},[R]),L};const T={boundBoxFunc:(R,L)=>L.width<5||L.height<5?R:L,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2};e.setInnerImageCropTransformerStyle=R=>{Object.assign(T,R)};const I={boundBoxFunc:(R,L)=>L.width<5||L.height<5?R:L,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2};e.setOuterImageCropTransformerStyle=R=>{Object.assign(I,R)};const F=(R,L,V)=>Math.max(L,Math.min(V,R));e.useCornerRadiusAndCrop=(R,L,V,G,W=0,X=!1,q=!0)=>{const z=Math.floor(F(R.a.width*G,1,1e4)),Y=Math.floor(F(R.a.height*G,1,1e4)),U=Math.min(W*G,z/2,Y/2),ee=Math.max(R.a.width/V.width,R.a.height/V.height)*G,te=R.page._exportingOrRendering&&_.flags.imageDownScalingEnabled&&ee<1&&!X,Q=V.x===0&&V.y===0&&V.width===(L==null?void 0:L.width)&&V.height===(L==null?void 0:L.height),Z=s.default.useMemo(()=>{if(L&&L.width&&L.height)return Q&&U===0&&!te?void 0:P()},[L,U,te,Q]);return s.default.useLayoutEffect(()=>{if(!Z||!L)return;(0,b.trySetCanvasSize)(Z,z,Y);const re=Z.getContext("2d");if(!re)return;U&&(re.beginPath(),re.moveTo(U,0),re.lineTo(z-U,0),re.arc(z-U,U,U,3*Math.PI/2,0,!1),re.lineTo(z,Y-U),re.arc(z-U,Y-U,U,0,Math.PI/2,!1),re.lineTo(U,Y),re.arc(U,Y-U,U,Math.PI/2,Math.PI,!1),re.lineTo(0,U),re.arc(U,U,U,Math.PI,3*Math.PI/2,!1),re.clip());const ne=te?function(ue,fe){var pe,ye;const we=P();we.width=ue.width,we.height=ue.height;const je=Math.max(1,Math.floor(we.width*fe)),Te=Math.max(1,Math.floor(we.height*fe));(pe=we.getContext("2d"))===null||pe===void 0||pe.drawImage(ue,0,0,we.width,we.height);const se=function(_e,he,xe,oe,ve,de,ke){for(var Be=new ImageData(he,xe),Qe=new Int32Array(_e.data.buffer),Ke=_e.width,St=new Int32Array(Be.data.buffer),Ue=Be.width,rt=he/de,gt=xe/ke,mt=Math.round(1/rt),kt=Math.round(1/gt),jt=mt*kt,Oe=0;Oe<Be.height;Oe++)for(var Se=0;Se<Ue;Se++){for(var yt=0+Math.round(Se/rt)+(0+Math.round(Oe/gt))*Ke,Fe=0,qe=0,$e=0,Et=0,Pt=0;Pt<kt;Pt++)for(var ht=0;ht<mt;ht++){var ze=Qe[yt+ht+Pt*Ke];Fe+=ze<<24>>>24,qe+=ze<<16>>>24,$e+=ze<<8>>>24,Et+=ze>>>24}Fe=Math.round(Fe/jt),qe=Math.round(qe/jt),$e=Math.round($e/jt),Et=Math.round(Et/jt),St[Se+Oe*Ue]=Et<<24|$e<<16|qe<<8|Fe}return Be}(we.getContext("2d").getImageData(0,0,we.width,we.height),je,Te,0,0,we.width,we.height);return we.width=je,we.height=Te,(ye=we.getContext("2d"))===null||ye===void 0||ye.putImageData(se,0,0),we}(L,ee):L,ae=te?{x:Math.floor(V.x*ee),y:Math.floor(V.y*ee),width:Math.floor(V.width*ee),height:Math.floor(V.height*ee)}:V;re.drawImage(ne,ae.x,ae.y,ae.width,ae.height,0,0,Z.width,Z.height)},[Z,R.a.width,R.a.height,V.x,V.y,V.width,V.height,W,G,X,R.page._exportingOrRendering,te]),s.default.useEffect(()=>()=>{Z&&Z.nodeName==="CANVAS"&&y.default.Util.releaseCanvas(Z)},[Z]),Z||L};const k=P(),O=(0,c.observer)(({element:R})=>{const L=Math.min(30,R.a.width/4,R.a.height/4),V=s.default.useRef(null);return s.default.useEffect(()=>{const G=V.current;if(!G)return;const W=new y.default.Animation(X=>{G.rotate(((X==null?void 0:X.timeDiff)||0)/2)},G.getLayer());return W.start(),()=>{W.stop()}}),s.default.createElement(f.Group,{x:R.x,y:R.y,rotation:R.rotation,listening:!1,opacity:R.a.opacity,hideInExport:!R.showInExport},s.default.createElement(f.Rect,{width:R.a.width,height:R.a.height,fill:"rgba(124, 173, 212, 0.8)"}),s.default.createElement(f.Arc,{ref:V,x:R.a.width/2,y:R.a.height/2,fill:"white",outerRadius:Math.abs(L),innerRadius:Math.max(1,L-5),angle:270}))}),N=(0,c.observer)(({element:R})=>{const L=Math.max(10,Math.min(30,R.a.width/25));return s.default.createElement(f.Group,{x:R.x,y:R.y,rotation:R.rotation,listening:!1,opacity:R.a.opacity,hideInExport:!R.showInExport},s.default.createElement(f.Rect,{width:R.a.width,height:R.a.height,fill:"rgba(223, 102, 102, 0.8)"}),s.default.createElement(f.Text,{text:"Can not load the image...",fontSize:L,width:R.a.width,height:R.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let A=v.default;e.setImageLoaderHook=R=>{A=R},e.useImageLoader=(R,L="",V="")=>{const G=s.default.useRef(),W=()=>{var X;(X=G.current)===null||X===void 0||X.call(G),G.current=void 0};s.default.useEffect(()=>W,[]),s.default.useLayoutEffect(()=>{const X=L.slice(0,200),q=`image with id ${V} url: ${X}`;R!=="loading"||G.current||(G.current=(0,S.incrementLoader)(q)),R!=="loading"&&W(),R==="failed"&&(0,S.triggerLoadError)(q)},[R])},e.ImageElement=(0,c.observer)(({element:R,store:L})=>{var V;const[G,W]=s.default.useState(!1),X=s.default.useRef(null),q=s.default.useRef(null),[z,Y]=s.default.useState(!1),U=L.selectedShapes.indexOf(R)>=0,[ee,te]=(Pe=>{const[me,He]=s.default.useReducer(ut=>ut+1,0),Me=s.default.useRef("loading"),Ye=s.default.useRef(Pe.src),et=s.default.useRef(Pe.src);return et.current!==Pe.src&&(et.current=Pe.src,Me.current="loading"),s.default.useEffect(()=>{if(Pe.type!=="svg"||!Pe.src)return;let ut=!1;return(async()=>{Me.current="loading",He();const wt=await x.urlToString(Pe.src),Ct=x.fixSize(wt),Jt=x.replaceColors(Ct,Pe.colorsReplace);ut||(Ye.current=Jt,Me.current="loaded",He())})(),()=>{ut=!0}},[Pe.src,JSON.stringify(Pe.colorsReplace)]),Pe.type!=="svg"?[Pe.src,"loaded"]:[Ye.current,Me.current]})(R),[Q,Z]=A(ee,"anonymous"),re=R.type!=="svg"||te==="loaded"?Z:"loading";(0,e.useImageLoader)(re,R.src,R.id);const ne=R.page._exportingOrRendering?1:Math.max(1,L.scale),ae=L._elementsPixelRatio*ne,ue=(({image:Pe,status:me,type:He})=>{const Me=s.default.useRef();return s.default.useEffect(()=>{Me.current=Pe||Me.current},[Pe]),me!=="failed"||me!=="failed"&&He==="svg"?Me.current:void 0})({image:Q,status:Z,type:R.type}),fe=((Pe,me,He)=>{const Me=s.default.useMemo(()=>{var Ye,et;const{flipX:ut,flipY:wt}=Pe,Ct=Pe.type==="svg"||Pe.src.indexOf("data:image/svg+xml")>=0||Pe.src.indexOf(".svg")>=0,Jt=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,Wt=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||Jt)&&Ct||Pe.maskSrc;if(!ut&&!wt&&!Wt)return me;if(!me||!me.width||!me.height)return null;const er=P();let cr=1;Pe.type==="svg"&&(cr=Math.max(Pe.a.width/me.width*He,Pe.a.height/me.height*He)),(0,b.trySetCanvasSize)(er,Math.max(me.width*cr,1),Math.max(me.height*cr,1));let Jn=ut?-er.width:0,Nr=wt?-er.height:0;return(Ye=er.getContext("2d"))===null||Ye===void 0||Ye.scale(ut?-1:1,wt?-1:1),(et=er.getContext("2d"))===null||et===void 0||et.drawImage(me,Jn,Nr,er.width,er.height),er},[Pe.maskSrc,Pe.flipX,Pe.flipY,me,Pe.a.width,Pe.a.height,He]);return s.default.useEffect(()=>()=>{Me&&Me.nodeName==="CANVAS"&&y.default.Util.releaseCanvas(Me)},[Me]),Me})(R,Q||ue,ae),pe=((Pe,me)=>{const[He,Me]=A(Pe.maskSrc,"anonymous"),Ye=Pe.maskSrc?Me:"loaded";return(0,e.useImageLoader)(Ye,Pe.maskSrc||"",Pe.id),s.default.useMemo(()=>{if(!He||!me||!me.width||!me.height)return me;const et=P();et.width=Math.max(me.width,1),et.height=Math.max(me.height,1);const ut=et.getContext("2d");if(!ut)return me;ut.drawImage(me,0,0),ut.globalCompositeOperation="source-in";const wt=function(Ct,Jt){const Wt=Jt.width/Jt.height;let er,cr;return Wt>=Ct.width/Ct.height?(er=Ct.width,cr=Ct.width/Wt):(er=Ct.height*Wt,cr=Ct.height),{x:(Ct.width-er)/2,y:(Ct.height-cr)/2,width:er,height:cr}}(He,Pe);return ut.drawImage(He,wt.x,wt.y,wt.width,wt.height,0,0,me.width,me.height),et},[me,He,Pe.a.width,Pe.a.height])})(R,fe)||k;let{cropX:ye,cropY:we,cropWidth:je,cropHeight:Te}=R.a;Z!=="loaded"&&(ye=we=0,je=Te=1);const se=pe.width*je,_e=pe.height*Te,he=R.a.width/R.a.height;let xe,oe;const ve=se/_e,de=R.type==="svg";de?(xe=se,oe=_e):he>=ve?(xe=se,oe=se/he):(xe=_e*he,oe=_e);const ke={x:pe.width*ye,y:pe.height*we,width:xe,height:oe},Be=(V=R.cornerRadius)!==null&&V!==void 0?V:0,Qe=R.page._exportingOrRendering?1:Math.min(2,L.scale),Ke=L._elementsPixelRatio*Qe;let St=((Pe,me,He,Me)=>{const Ye=(0,e.useSizeFixer)(Pe.clipSrc||""),[et,ut]=A(Ye,"anonymous"),wt=Pe.clipSrc?ut:"loaded";(0,e.useImageLoader)(wt,Pe.clipSrc,Pe.id);const Ct=s.default.useMemo(()=>{if(me&&et)return P()},[me,et]);return s.default.useLayoutEffect(()=>{var Jt;if(!et||!me||!me.width||!me.height||!et||!et.width||!et.height||!Ct)return;const Wt=P(),er=Math.max(Pe.a.width/et.width*He,Pe.a.height/et.height*He);Wt.width=et.width*er,Wt.height=et.height*er,(Jt=Wt.getContext("2d"))===null||Jt===void 0||Jt.drawImage(et,0,0,Wt.width,Wt.height),Ct.width=Math.max(me.width,1),Ct.height=Math.max(me.height,1);const cr=Ct.getContext("2d");cr&&(cr.save(),cr.drawImage(Wt,0,0,me.width,me.height),y.default.Util.releaseCanvas(Wt),cr.globalCompositeOperation="source-in",cr.drawImage(me,0,0,Ct.width,Ct.height),cr.restore())},[Ct,me,et,Pe.a.width,Pe.a.height,He,...Me]),Pe.clipSrc&&et?Ct:me})(R,(0,e.useCornerRadiusAndCrop)(R,pe,ke,Ke,Be,G||R._cropModeEnabled||R.type==="svg",!0),Ke,[ke,Be,Ke]);const Ue=Math.max(R.a.width/xe,R.a.height/oe);s.default.useEffect(()=>{var Pe;if(!R._cropModeEnabled)return;const me=(Pe=X.current)===null||Pe===void 0?void 0:Pe.getStage();function He(Ye){R._cropModeEnabled&&Ye.target!==q.current&&R.toggleCropMode(!1)}function Me(Ye){R._cropModeEnabled&&Ye.target.parentNode!==me.content&&R.toggleCropMode(!1)}return document.body.addEventListener("click",Me),me==null||me.on("click",He),me==null||me.on("tap",He),()=>{document.body.removeEventListener("click",Me),document.body.removeEventListener("touchstart",Me),me==null||me.off("click",He),me==null||me.off("click",He)}},[R._cropModeEnabled]),s.default.useLayoutEffect(()=>{if(!G&&!R._cropModeEnabled)return(0,g.applyFilter)(X.current,R),(0,m.autorun)(()=>{(0,g.applyFilter)(X.current,R)},{delay:100})},[St,R.page._exportingOrRendering,G,je,Te,R._cropModeEnabled]),s.default.useLayoutEffect(()=>{var Pe;G||R._cropModeEnabled?(Pe=X.current)===null||Pe===void 0||Pe.clearCache():(0,g.applyFilter)(X.current,R)},[G,R.a.width,R.a.height,R._cropModeEnabled]),s.default.useEffect(()=>{(0,g.applyFilter)(X.current,R)},[R.shadowEnabled,R.shadowBlur,R.cornerRadius,R.shadowColor,R.shadowOffsetX,R.shadowOffsetY,R.shadowOpacity]);const rt=s.default.useRef(null),gt=s.default.useRef(null),mt=s.default.useRef(null);s.default.useLayoutEffect(()=>{R._cropModeEnabled&&(gt.current.nodes([rt.current]),mt.current.nodes([q.current]))},[R._cropModeEnabled]);var kt=s.default.useRef(null),jt=s.default.useRef(0),Oe=s.default.useRef(!1);const Se=Pe=>{var me;((me=Pe.evt.touches)===null||me===void 0?void 0:me.length)>2&&Pe.target.stopDrag(),Math.round(Pe.target.x())>0&&(Pe.target.x(0),Pe.target.scaleX(1)),Math.round(Pe.target.y())>0&&(Pe.target.y(0),Pe.target.scaleY(1));const He=Pe.target.width()*Pe.target.scaleX(),Me=Pe.target.height()*Pe.target.scaleY(),Ye=Math.min(1,xe/He),et=Math.min(1,oe/Me),ut=1-Ye,wt=Math.min(ut,Math.max(0,Math.round(-Pe.target.x())/He)),Ct=1-et,Jt=Math.min(Ct,Math.max(0,Math.round(-Pe.target.y())/Me));Pe.target.setAttrs({x:-wt*pe.width,y:-Jt*pe.height,scaleX:1,scaleY:1}),R.set({cropX:wt,cropY:Jt,cropWidth:Ye,cropHeight:et})},yt=()=>{R.type!=="svg"&&R.contentEditable&&setTimeout(()=>{R.toggleCropMode(!0)})},Fe=R.type==="svg"&&ue,qe=Z==="loading"&&!Fe,$e=Z==="failed",Et=!qe&&!$e,Pt=s.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),ht=Et?R.a.opacity:0;(0,h.useFadeIn)(X,ht);const ze=R.selectable||L.role==="admin",at=(0,d.isTouchDevice)();return s.default.createElement(s.default.Fragment,null,qe&&s.default.createElement(O,{element:R}),$e&&s.default.createElement(N,{element:R}),s.default.createElement(f.Image,{ref:X,name:"element",id:R.id,image:St,x:R.a.x,y:R.a.y,width:R.a.width||1,height:R.a.height||1,rotation:R.a.rotation,opacity:ht,shadowEnabled:R.shadowEnabled,shadowBlur:R.shadowBlur,shadowOffsetX:R.shadowOffsetX,shadowOffsetY:R.shadowOffsetY,shadowColor:R.shadowColor,shadowOpacity:R.shadowOpacity,customCrop:ke,listening:ze,draggable:at?R.draggable&&U:R.draggable,preventDefault:!at||U,hideInExport:!R.showInExport,onMouseEnter:()=>{Y(!0)},onMouseLeave:()=>{Y(!1)},onDragMove:Pe=>{R.set({x:Pe.target.x(),y:Pe.target.y()})},onDragEnd:Pe=>{R.set({x:Pe.target.x(),y:Pe.target.y()})},onDblClick:yt,onDblTap:yt,onTransformStart:()=>{W(!0),Pt.current={cropX:R.cropX,cropY:R.cropY,cropWidth:R.cropWidth,cropHeight:R.cropHeight}},onTransform:Pe=>{var me;const He=Pe.currentTarget,Me=Math.abs(He.scaleX()-1)<1e-7?1:He.scaleX(),Ye=Math.abs(He.scaleY()-1)<1e-7?1:He.scaleY();He.scaleX(1),He.scaleY(1);const et=(me=Pe.target.getStage())===null||me===void 0?void 0:me.findOne("Transformer"),ut=1-xe/pe.width,wt=Math.min(ut,Math.max(0,R.cropX)),Ct=1-oe/pe.height,Jt=Math.min(Ct,Math.max(0,R.cropY)),Wt=et.getActiveAnchor(),er=!(Wt.indexOf("middle")>=0||Wt.indexOf("center")>=0),cr=!er&&Me<1&&Pt.current.cropHeight>oe/pe.height;let Jn=er?R.cropWidth:R.cropWidth*Me;cr&&(Jn=R.cropWidth);const Nr=!er&&Ye<1&&Pt.current.cropWidth>xe/pe.width;let ei=er?R.cropHeight:R.cropHeight*Ye;Nr&&(ei=R.cropHeight),de&&(Jn=R.cropWidth,ei=R.cropHeight),R.set({cropX:wt,cropY:Jt,x:He.x(),y:He.y(),width:He.width()*Me,height:He.height()*Ye,rotation:Pe.target.rotation(),cropWidth:Math.min(Jn,1-wt),cropHeight:Math.min(ei,1-Jt)})},onTransformEnd:Pe=>{const me=Pe.currentTarget;R.set({width:me.width(),height:me.height(),x:me.x(),y:me.y(),rotation:Pe.target.rotation(),cropWidth:xe/pe.width,cropHeight:oe/pe.height}),W(!1)}}),s.default.createElement(f.Rect,{x:R.x,y:R.y,width:Math.max(R.a.width-R.borderSize,0),height:Math.max(R.a.height-R.borderSize,0),opacity:ht,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,Be-R.borderSize),hideInExport:!R.showInExport}),R._cropModeEnabled&&s.default.createElement(E.Portal,{selector:".page-abs-container",enabled:!0},s.default.createElement(f.Rect,{x:-window.innerWidth/L.scale,y:-window.innerWidth/L.scale,width:window.innerWidth/L.scale*3,height:window.innerWidth/L.scale*3,fill:"rgba(0,0,0,0.3)"}),s.default.createElement(f.Image,{listening:!1,image:St,x:R.x,y:R.y,width:R.a.width,height:R.a.height,rotation:R.rotation,shadowEnabled:R.shadowEnabled,shadowBlur:R.shadowBlur}),s.default.createElement(f.Group,{x:R.x,y:R.y,rotation:R.rotation,scaleX:Ue,scaleY:Ue},s.default.createElement(f.Image,{image:pe,ref:q,opacity:.4,draggable:!0,x:-R.cropX*pe.width,y:-R.cropY*pe.height,onDragMove:Se,onTransform:Se,onTouchMove:Pe=>{Pe.evt.preventDefault();const me=Pe.target.getStage().getPointersPositions();var He=me[0],Me=me[1];const Ye=Pe.target;if(He&&!Me&&!Ye.isDragging()&&Oe.current&&(Ye.startDrag(),Oe.current=!1),He&&Me){y.default.hitOnDragEnabled=!0,Ye.isDragging()&&(Oe.current=!0,Ye.stopDrag());const Nr=Pe.target.getAbsoluteTransform().copy();Nr.invert();var et={x:He.x,y:He.y},ut={x:Me.x,y:Me.y};if(!kt.current)return void(kt.current=M(et,ut));var wt=M(et,ut),Ct=function(ti,Li){return Math.sqrt(Math.pow(Li.x-ti.x,2)+Math.pow(Li.y-ti.y,2))}(et,ut);jt.current||(jt.current=Ct);const ei=Ye.position();var Jt={x:wt.x-ei.x,y:wt.y-ei.y},Wt=Ct/jt.current;Ye.scaleX(Wt),Ye.scaleY(Wt);const lo=Nr.point(wt),ka=Nr.point(kt.current);var er=lo.x-ka.x,cr=lo.y-ka.y,Jn={x:Math.min(0,wt.x-Jt.x*Wt+er),y:Math.min(0,wt.y-Jt.y*Wt+cr)};Ye.position(Jn),jt.current=Ct,kt.current=wt,Se(Pe)}},onTouchEnd:Pe=>{jt.current=0,kt.current=null,y.default.hitOnDragEnabled=!1}}),s.default.createElement(f.Transformer,Object.assign({ref:mt},I)),s.default.createElement(f.Rect,{width:xe,height:oe,ref:rt,listening:!1,onTransform:Pe=>{Pe.target.x()<-R.cropX*pe.width-1e-9&&(Pe.target.x(-R.cropX*pe.width),Pe.target.scaleX(1)),Pe.target.y()<-R.cropY*pe.height-1e-9&&(Pe.target.y(-R.cropY*pe.height),Pe.target.scaleY(1));const me=Math.min(1,Math.max(0,R.cropX+Pe.target.x()/pe.width)),He=Math.min(1,Math.max(0,Pe.target.y()/pe.height+R.cropY)),Me=Pe.target.width()*Pe.target.scaleX(),Ye=Pe.target.height()*Pe.target.scaleY(),et=Math.min(1-me,Me/pe.width),ut=Math.min(1-He,Ye/pe.height),wt=Pe.target.getAbsolutePosition(Pe.target.getParent().getParent());Pe.target.scale({x:1,y:1}),Pe.target.position({x:0,y:0}),R.set({x:wt.x,y:wt.y,cropX:me,cropY:He,cropWidth:et,cropHeight:ut,width:Math.min(Me*Ue,pe.width*(1-me)*Ue),height:Math.min(Ye*Ue,pe.height*(1-He)*Ue)})}}),s.default.createElement(f.Transformer,Object.assign({ref:gt},T,{visible:R.resizable})))),(z||U)&&s.default.createElement(w.Highlighter,{element:R}))})}(ga)),ga}var va={},up={exports:{}};/*!
109
- * Quill Editor v1.3.7
110
- * https://quilljs.com/
111
- * Copyright (c) 2014, Jason Chen
112
- * Copyright (c) 2013, salesforce.com
113
- */var cO=up.exports,ib;function fO(){return ib||(ib=1,function(e,n){(function(r,a){e.exports=a()})(typeof self<"u"?self:cO,function(){return function(t){var r={};function a(o){if(r[o])return r[o].exports;var s=r[o]={i:o,l:!1,exports:{}};return t[o].call(s.exports,s,s.exports,a),s.l=!0,s.exports}return a.m=t,a.c=r,a.d=function(o,s,c){a.o(o,s)||Object.defineProperty(o,s,{configurable:!1,enumerable:!0,get:c})},a.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return a.d(s,"a",s),s},a.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},a.p="",a(a.s=109)}([function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=a(17),s=a(18),c=a(19),m=a(45),f=a(46),v=a(47),y=a(48),E=a(49),w=a(12),S=a(32),x=a(33),_=a(31),b=a(1),g={Scope:b.Scope,create:b.create,find:b.find,query:b.query,register:b.register,Container:o.default,Format:s.default,Leaf:c.default,Embed:y.default,Scroll:m.default,Block:v.default,Inline:f.default,Text:E.default,Attributor:{Attribute:w.default,Class:S.default,Style:x.default,Store:_.default}};r.default=g},function(t,r,a){var o=this&&this.__extends||function(){var _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,g){b.__proto__=g}||function(b,g){for(var h in g)g.hasOwnProperty(h)&&(b[h]=g[h])};return function(b,g){_(b,g);function h(){this.constructor=b}b.prototype=g===null?Object.create(g):(h.prototype=g.prototype,new h)}}();Object.defineProperty(r,"__esModule",{value:!0});var s=function(_){o(b,_);function b(g){var h=this;return g="[Parchment] "+g,h=_.call(this,g)||this,h.message=g,h.name=h.constructor.name,h}return b}(Error);r.ParchmentError=s;var c={},m={},f={},v={};r.DATA_KEY="__blot";var y;(function(_){_[_.TYPE=3]="TYPE",_[_.LEVEL=12]="LEVEL",_[_.ATTRIBUTE=13]="ATTRIBUTE",_[_.BLOT=14]="BLOT",_[_.INLINE=7]="INLINE",_[_.BLOCK=11]="BLOCK",_[_.BLOCK_BLOT=10]="BLOCK_BLOT",_[_.INLINE_BLOT=6]="INLINE_BLOT",_[_.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",_[_.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",_[_.ANY=15]="ANY"})(y=r.Scope||(r.Scope={}));function E(_,b){var g=S(_);if(g==null)throw new s("Unable to create "+_+" blot");var h=g,d=_ instanceof Node||_.nodeType===Node.TEXT_NODE?_:h.create(b);return new h(d,b)}r.create=E;function w(_,b){return b===void 0&&(b=!1),_==null?null:_[r.DATA_KEY]!=null?_[r.DATA_KEY].blot:b?w(_.parentNode,b):null}r.find=w;function S(_,b){b===void 0&&(b=y.ANY);var g;if(typeof _=="string")g=v[_]||c[_];else if(_ instanceof Text||_.nodeType===Node.TEXT_NODE)g=v.text;else if(typeof _=="number")_&y.LEVEL&y.BLOCK?g=v.block:_&y.LEVEL&y.INLINE&&(g=v.inline);else if(_ instanceof HTMLElement){var h=(_.getAttribute("class")||"").split(/\s+/);for(var d in h)if(g=m[h[d]],g)break;g=g||f[_.tagName]}return g==null?null:b&y.LEVEL&g.scope&&b&y.TYPE&g.scope?g:null}r.query=S;function x(){for(var _=[],b=0;b<arguments.length;b++)_[b]=arguments[b];if(_.length>1)return _.map(function(d){return x(d)});var g=_[0];if(typeof g.blotName!="string"&&typeof g.attrName!="string")throw new s("Invalid definition");if(g.blotName==="abstract")throw new s("Cannot register abstract class");if(v[g.blotName||g.attrName]=g,typeof g.keyName=="string")c[g.keyName]=g;else if(g.className!=null&&(m[g.className]=g),g.tagName!=null){Array.isArray(g.tagName)?g.tagName=g.tagName.map(function(d){return d.toUpperCase()}):g.tagName=g.tagName.toUpperCase();var h=Array.isArray(g.tagName)?g.tagName:[g.tagName];h.forEach(function(d){(f[d]==null||g.className==null)&&(f[d]=g)})}return g}r.register=x},function(t,r,a){var o=a(51),s=a(11),c=a(3),m=a(20),f="\0",v=function(y){Array.isArray(y)?this.ops=y:y!=null&&Array.isArray(y.ops)?this.ops=y.ops:this.ops=[]};v.prototype.insert=function(y,E){var w={};return y.length===0?this:(w.insert=y,E!=null&&typeof E=="object"&&Object.keys(E).length>0&&(w.attributes=E),this.push(w))},v.prototype.delete=function(y){return y<=0?this:this.push({delete:y})},v.prototype.retain=function(y,E){if(y<=0)return this;var w={retain:y};return E!=null&&typeof E=="object"&&Object.keys(E).length>0&&(w.attributes=E),this.push(w)},v.prototype.push=function(y){var E=this.ops.length,w=this.ops[E-1];if(y=c(!0,{},y),typeof w=="object"){if(typeof y.delete=="number"&&typeof w.delete=="number")return this.ops[E-1]={delete:w.delete+y.delete},this;if(typeof w.delete=="number"&&y.insert!=null&&(E-=1,w=this.ops[E-1],typeof w!="object"))return this.ops.unshift(y),this;if(s(y.attributes,w.attributes)){if(typeof y.insert=="string"&&typeof w.insert=="string")return this.ops[E-1]={insert:w.insert+y.insert},typeof y.attributes=="object"&&(this.ops[E-1].attributes=y.attributes),this;if(typeof y.retain=="number"&&typeof w.retain=="number")return this.ops[E-1]={retain:w.retain+y.retain},typeof y.attributes=="object"&&(this.ops[E-1].attributes=y.attributes),this}}return E===this.ops.length?this.ops.push(y):this.ops.splice(E,0,y),this},v.prototype.chop=function(){var y=this.ops[this.ops.length-1];return y&&y.retain&&!y.attributes&&this.ops.pop(),this},v.prototype.filter=function(y){return this.ops.filter(y)},v.prototype.forEach=function(y){this.ops.forEach(y)},v.prototype.map=function(y){return this.ops.map(y)},v.prototype.partition=function(y){var E=[],w=[];return this.forEach(function(S){var x=y(S)?E:w;x.push(S)}),[E,w]},v.prototype.reduce=function(y,E){return this.ops.reduce(y,E)},v.prototype.changeLength=function(){return this.reduce(function(y,E){return E.insert?y+m.length(E):E.delete?y-E.delete:y},0)},v.prototype.length=function(){return this.reduce(function(y,E){return y+m.length(E)},0)},v.prototype.slice=function(y,E){y=y||0,typeof E!="number"&&(E=1/0);for(var w=[],S=m.iterator(this.ops),x=0;x<E&&S.hasNext();){var _;x<y?_=S.next(y-x):(_=S.next(E-x),w.push(_)),x+=m.length(_)}return new v(w)},v.prototype.compose=function(y){var E=m.iterator(this.ops),w=m.iterator(y.ops),S=[],x=w.peek();if(x!=null&&typeof x.retain=="number"&&x.attributes==null){for(var _=x.retain;E.peekType()==="insert"&&E.peekLength()<=_;)_-=E.peekLength(),S.push(E.next());x.retain-_>0&&w.next(x.retain-_)}for(var b=new v(S);E.hasNext()||w.hasNext();)if(w.peekType()==="insert")b.push(w.next());else if(E.peekType()==="delete")b.push(E.next());else{var g=Math.min(E.peekLength(),w.peekLength()),h=E.next(g),d=w.next(g);if(typeof d.retain=="number"){var P={};typeof h.retain=="number"?P.retain=g:P.insert=h.insert;var M=m.attributes.compose(h.attributes,d.attributes,typeof h.retain=="number");if(M&&(P.attributes=M),b.push(P),!w.hasNext()&&s(b.ops[b.ops.length-1],P)){var T=new v(E.rest());return b.concat(T).chop()}}else typeof d.delete=="number"&&typeof h.retain=="number"&&b.push(d)}return b.chop()},v.prototype.concat=function(y){var E=new v(this.ops.slice());return y.ops.length>0&&(E.push(y.ops[0]),E.ops=E.ops.concat(y.ops.slice(1))),E},v.prototype.diff=function(y,E){if(this.ops===y.ops)return new v;var w=[this,y].map(function(g){return g.map(function(h){if(h.insert!=null)return typeof h.insert=="string"?h.insert:f;var d=g===y?"on":"with";throw new Error("diff() called "+d+" non-document")}).join("")}),S=new v,x=o(w[0],w[1],E),_=m.iterator(this.ops),b=m.iterator(y.ops);return x.forEach(function(g){for(var h=g[1].length;h>0;){var d=0;switch(g[0]){case o.INSERT:d=Math.min(b.peekLength(),h),S.push(b.next(d));break;case o.DELETE:d=Math.min(h,_.peekLength()),_.next(d),S.delete(d);break;case o.EQUAL:d=Math.min(_.peekLength(),b.peekLength(),h);var P=_.next(d),M=b.next(d);s(P.insert,M.insert)?S.retain(d,m.attributes.diff(P.attributes,M.attributes)):S.push(M).delete(d);break}h-=d}}),S.chop()},v.prototype.eachLine=function(y,E){E=E||`
114
- `;for(var w=m.iterator(this.ops),S=new v,x=0;w.hasNext();){if(w.peekType()!=="insert")return;var _=w.peek(),b=m.length(_)-w.peekLength(),g=typeof _.insert=="string"?_.insert.indexOf(E,b)-b:-1;if(g<0)S.push(w.next());else if(g>0)S.push(w.next(g));else{if(y(S,w.next(1).attributes||{},x)===!1)return;x+=1,S=new v}}S.length()>0&&y(S,{},x)},v.prototype.transform=function(y,E){if(E=!!E,typeof y=="number")return this.transformPosition(y,E);for(var w=m.iterator(this.ops),S=m.iterator(y.ops),x=new v;w.hasNext()||S.hasNext();)if(w.peekType()==="insert"&&(E||S.peekType()!=="insert"))x.retain(m.length(w.next()));else if(S.peekType()==="insert")x.push(S.next());else{var _=Math.min(w.peekLength(),S.peekLength()),b=w.next(_),g=S.next(_);if(b.delete)continue;g.delete?x.push(g):x.retain(_,m.attributes.transform(b.attributes,g.attributes,E))}return x.chop()},v.prototype.transformPosition=function(y,E){E=!!E;for(var w=m.iterator(this.ops),S=0;w.hasNext()&&S<=y;){var x=w.peekLength(),_=w.peekType();if(w.next(),_==="delete"){y-=Math.min(x,y-S);continue}else _==="insert"&&(S<y||!E)&&(y+=x);S+=x}return y},t.exports=v},function(t,r){var a=Object.prototype.hasOwnProperty,o=Object.prototype.toString,s=Object.defineProperty,c=Object.getOwnPropertyDescriptor,m=function(w){return typeof Array.isArray=="function"?Array.isArray(w):o.call(w)==="[object Array]"},f=function(w){if(!w||o.call(w)!=="[object Object]")return!1;var S=a.call(w,"constructor"),x=w.constructor&&w.constructor.prototype&&a.call(w.constructor.prototype,"isPrototypeOf");if(w.constructor&&!S&&!x)return!1;var _;for(_ in w);return typeof _>"u"||a.call(w,_)},v=function(w,S){s&&S.name==="__proto__"?s(w,S.name,{enumerable:!0,configurable:!0,value:S.newValue,writable:!0}):w[S.name]=S.newValue},y=function(w,S){if(S==="__proto__")if(a.call(w,S)){if(c)return c(w,S).value}else return;return w[S]};t.exports=function E(){var w,S,x,_,b,g,h=arguments[0],d=1,P=arguments.length,M=!1;for(typeof h=="boolean"&&(M=h,h=arguments[1]||{},d=2),(h==null||typeof h!="object"&&typeof h!="function")&&(h={});d<P;++d)if(w=arguments[d],w!=null)for(S in w)x=y(h,S),_=y(w,S),h!==_&&(M&&_&&(f(_)||(b=m(_)))?(b?(b=!1,g=x&&m(x)?x:[]):g=x&&f(x)?x:{},v(h,{name:S,newValue:E(M,g,_)})):typeof _<"u"&&v(h,{name:S,newValue:_}));return h}},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.BlockEmbed=r.bubbleFormats=void 0;var o=function(){function O(N,A){for(var R=0;R<A.length;R++){var L=A[R];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(N,L.key,L)}}return function(N,A,R){return A&&O(N.prototype,A),R&&O(N,R),N}}(),s=function O(N,A,R){N===null&&(N=Function.prototype);var L=Object.getOwnPropertyDescriptor(N,A);if(L===void 0){var V=Object.getPrototypeOf(N);return V===null?void 0:O(V,A,R)}else{if("value"in L)return L.value;var G=L.get;return G===void 0?void 0:G.call(R)}},c=a(3),m=h(c),f=a(2),v=h(f),y=a(0),E=h(y),w=a(16),S=h(w),x=a(6),_=h(x),b=a(7),g=h(b);function h(O){return O&&O.__esModule?O:{default:O}}function d(O,N){if(!(O instanceof N))throw new TypeError("Cannot call a class as a function")}function P(O,N){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N&&(typeof N=="object"||typeof N=="function")?N:O}function M(O,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof N);O.prototype=Object.create(N&&N.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),N&&(Object.setPrototypeOf?Object.setPrototypeOf(O,N):O.__proto__=N)}var T=1,I=function(O){M(N,O);function N(){return d(this,N),P(this,(N.__proto__||Object.getPrototypeOf(N)).apply(this,arguments))}return o(N,[{key:"attach",value:function(){s(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"attach",this).call(this),this.attributes=new E.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new v.default().insert(this.value(),(0,m.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(R,L){var V=E.default.query(R,E.default.Scope.BLOCK_ATTRIBUTE);V!=null&&this.attributes.attribute(V,L)}},{key:"formatAt",value:function(R,L,V,G){this.format(V,G)}},{key:"insertAt",value:function(R,L,V){if(typeof L=="string"&&L.endsWith(`
115
- `)){var G=E.default.create(F.blotName);this.parent.insertBefore(G,R===0?this:this.next),G.insertAt(0,L.slice(0,-1))}else s(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"insertAt",this).call(this,R,L,V)}}]),N}(E.default.Embed);I.scope=E.default.Scope.BLOCK_BLOT;var F=function(O){M(N,O);function N(A){d(this,N);var R=P(this,(N.__proto__||Object.getPrototypeOf(N)).call(this,A));return R.cache={},R}return o(N,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(E.default.Leaf).reduce(function(R,L){return L.length()===0?R:R.insert(L.value(),k(L))},new v.default).insert(`
116
- `,k(this))),this.cache.delta}},{key:"deleteAt",value:function(R,L){s(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"deleteAt",this).call(this,R,L),this.cache={}}},{key:"formatAt",value:function(R,L,V,G){L<=0||(E.default.query(V,E.default.Scope.BLOCK)?R+L===this.length()&&this.format(V,G):s(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"formatAt",this).call(this,R,Math.min(L,this.length()-R-1),V,G),this.cache={})}},{key:"insertAt",value:function(R,L,V){if(V!=null)return s(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"insertAt",this).call(this,R,L,V);if(L.length!==0){var G=L.split(`
117
- `),W=G.shift();W.length>0&&(R<this.length()-1||this.children.tail==null?s(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"insertAt",this).call(this,Math.min(R,this.length()-1),W):this.children.tail.insertAt(this.children.tail.length(),W),this.cache={});var X=this;G.reduce(function(q,z){return X=X.split(q,!0),X.insertAt(0,z),z.length},R+W.length)}}},{key:"insertBefore",value:function(R,L){var V=this.children.head;s(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"insertBefore",this).call(this,R,L),V instanceof S.default&&V.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=s(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"length",this).call(this)+T),this.cache.length}},{key:"moveChildren",value:function(R,L){s(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"moveChildren",this).call(this,R,L),this.cache={}}},{key:"optimize",value:function(R){s(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"optimize",this).call(this,R),this.cache={}}},{key:"path",value:function(R){return s(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"path",this).call(this,R,!0)}},{key:"removeChild",value:function(R){s(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"removeChild",this).call(this,R),this.cache={}}},{key:"split",value:function(R){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(L&&(R===0||R>=this.length()-T)){var V=this.clone();return R===0?(this.parent.insertBefore(V,this),this):(this.parent.insertBefore(V,this.next),V)}else{var G=s(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"split",this).call(this,R,L);return this.cache={},G}}}]),N}(E.default.Block);F.blotName="block",F.tagName="P",F.defaultChild="break",F.allowedChildren=[_.default,E.default.Embed,g.default];function k(O){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return O==null||(typeof O.formats=="function"&&(N=(0,m.default)(N,O.formats())),O.parent==null||O.parent.blotName=="scroll"||O.parent.statics.scope!==O.statics.scope)?N:k(O.parent,N)}r.bubbleFormats=k,r.BlockEmbed=I,r.default=F},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.overload=r.expandConfig=void 0;var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(X){return typeof X}:function(X){return X&&typeof Symbol=="function"&&X.constructor===Symbol&&X!==Symbol.prototype?"symbol":typeof X},s=function(){function X(q,z){var Y=[],U=!0,ee=!1,te=void 0;try{for(var Q=q[Symbol.iterator](),Z;!(U=(Z=Q.next()).done)&&(Y.push(Z.value),!(z&&Y.length===z));U=!0);}catch(re){ee=!0,te=re}finally{try{!U&&Q.return&&Q.return()}finally{if(ee)throw te}}return Y}return function(q,z){if(Array.isArray(q))return q;if(Symbol.iterator in Object(q))return X(q,z);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function X(q,z){for(var Y=0;Y<z.length;Y++){var U=z[Y];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(q,U.key,U)}}return function(q,z,Y){return z&&X(q.prototype,z),Y&&X(q,Y),q}}();a(50);var m=a(2),f=k(m),v=a(14),y=k(v),E=a(8),w=k(E),S=a(9),x=k(S),_=a(0),b=k(_),g=a(15),h=k(g),d=a(3),P=k(d),M=a(10),T=k(M),I=a(34),F=k(I);function k(X){return X&&X.__esModule?X:{default:X}}function O(X,q,z){return q in X?Object.defineProperty(X,q,{value:z,enumerable:!0,configurable:!0,writable:!0}):X[q]=z,X}function N(X,q){if(!(X instanceof q))throw new TypeError("Cannot call a class as a function")}var A=(0,T.default)("quill"),R=function(){c(X,null,[{key:"debug",value:function(z){z===!0&&(z="log"),T.default.level(z)}},{key:"find",value:function(z){return z.__quill||b.default.find(z)}},{key:"import",value:function(z){return this.imports[z]==null&&A.error("Cannot import "+z+". Are you sure it was registered?"),this.imports[z]}},{key:"register",value:function(z,Y){var U=this,ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof z!="string"){var te=z.attrName||z.blotName;typeof te=="string"?this.register("formats/"+te,z,Y):Object.keys(z).forEach(function(Q){U.register(Q,z[Q],Y)})}else this.imports[z]!=null&&!ee&&A.warn("Overwriting "+z+" with",Y),this.imports[z]=Y,(z.startsWith("blots/")||z.startsWith("formats/"))&&Y.blotName!=="abstract"?b.default.register(Y):z.startsWith("modules")&&typeof Y.register=="function"&&Y.register()}}]);function X(q){var z=this,Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(N(this,X),this.options=L(q,Y),this.container=this.options.container,this.container==null)return A.error("Invalid Quill container",q);this.options.debug&&X.debug(this.options.debug);var U=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 w.default,this.scroll=b.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new y.default(this.scroll),this.selection=new h.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(w.default.events.EDITOR_CHANGE,function(te){te===w.default.events.TEXT_CHANGE&&z.root.classList.toggle("ql-blank",z.editor.isBlank())}),this.emitter.on(w.default.events.SCROLL_UPDATE,function(te,Q){var Z=z.selection.lastRange,re=Z&&Z.length===0?Z.index:void 0;V.call(z,function(){return z.editor.update(null,Q,re)},te)});var ee=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+U+"<p><br></p></div>");this.setContents(ee),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return c(X,[{key:"addContainer",value:function(z){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof z=="string"){var U=z;z=document.createElement("div"),z.classList.add(U)}return this.container.insertBefore(z,Y),z}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(z,Y,U){var ee=this,te=G(z,Y,U),Q=s(te,4);return z=Q[0],Y=Q[1],U=Q[3],V.call(this,function(){return ee.editor.deleteText(z,Y)},U,z,-1*Y)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(z),this.container.classList.toggle("ql-disabled",!z)}},{key:"focus",value:function(){var z=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=z,this.scrollIntoView()}},{key:"format",value:function(z,Y){var U=this,ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:w.default.sources.API;return V.call(this,function(){var te=U.getSelection(!0),Q=new f.default;if(te==null)return Q;if(b.default.query(z,b.default.Scope.BLOCK))Q=U.editor.formatLine(te.index,te.length,O({},z,Y));else{if(te.length===0)return U.selection.format(z,Y),Q;Q=U.editor.formatText(te.index,te.length,O({},z,Y))}return U.setSelection(te,w.default.sources.SILENT),Q},ee)}},{key:"formatLine",value:function(z,Y,U,ee,te){var Q=this,Z=void 0,re=G(z,Y,U,ee,te),ne=s(re,4);return z=ne[0],Y=ne[1],Z=ne[2],te=ne[3],V.call(this,function(){return Q.editor.formatLine(z,Y,Z)},te,z,0)}},{key:"formatText",value:function(z,Y,U,ee,te){var Q=this,Z=void 0,re=G(z,Y,U,ee,te),ne=s(re,4);return z=ne[0],Y=ne[1],Z=ne[2],te=ne[3],V.call(this,function(){return Q.editor.formatText(z,Y,Z)},te,z,0)}},{key:"getBounds",value:function(z){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,U=void 0;typeof z=="number"?U=this.selection.getBounds(z,Y):U=this.selection.getBounds(z.index,z.length);var ee=this.container.getBoundingClientRect();return{bottom:U.bottom-ee.top,height:U.height,left:U.left-ee.left,right:U.right-ee.left,top:U.top-ee.top,width:U.width}}},{key:"getContents",value:function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-z,U=G(z,Y),ee=s(U,2);return z=ee[0],Y=ee[1],this.editor.getContents(z,Y)}},{key:"getFormat",value:function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof z=="number"?this.editor.getFormat(z,Y):this.editor.getFormat(z.index,z.length)}},{key:"getIndex",value:function(z){return z.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(z){return this.scroll.leaf(z)}},{key:"getLine",value:function(z){return this.scroll.line(z)}},{key:"getLines",value:function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof z!="number"?this.scroll.lines(z.index,z.length):this.scroll.lines(z,Y)}},{key:"getModule",value:function(z){return this.theme.modules[z]}},{key:"getSelection",value:function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return z&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-z,U=G(z,Y),ee=s(U,2);return z=ee[0],Y=ee[1],this.editor.getText(z,Y)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(z,Y,U){var ee=this,te=arguments.length>3&&arguments[3]!==void 0?arguments[3]:X.sources.API;return V.call(this,function(){return ee.editor.insertEmbed(z,Y,U)},te,z)}},{key:"insertText",value:function(z,Y,U,ee,te){var Q=this,Z=void 0,re=G(z,0,U,ee,te),ne=s(re,4);return z=ne[0],Z=ne[2],te=ne[3],V.call(this,function(){return Q.editor.insertText(z,Y,Z)},te,z,Y.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(z,Y,U){this.clipboard.dangerouslyPasteHTML(z,Y,U)}},{key:"removeFormat",value:function(z,Y,U){var ee=this,te=G(z,Y,U),Q=s(te,4);return z=Q[0],Y=Q[1],U=Q[3],V.call(this,function(){return ee.editor.removeFormat(z,Y)},U,z)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(z){var Y=this,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w.default.sources.API;return V.call(this,function(){z=new f.default(z);var ee=Y.getLength(),te=Y.editor.deleteText(0,ee),Q=Y.editor.applyDelta(z),Z=Q.ops[Q.ops.length-1];Z!=null&&typeof Z.insert=="string"&&Z.insert[Z.insert.length-1]===`
118
- `&&(Y.editor.deleteText(Y.getLength()-1,1),Q.delete(1));var re=te.compose(Q);return re},U)}},{key:"setSelection",value:function(z,Y,U){if(z==null)this.selection.setRange(null,Y||X.sources.API);else{var ee=G(z,Y,U),te=s(ee,4);z=te[0],Y=te[1],U=te[3],this.selection.setRange(new g.Range(z,Y),U),U!==w.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(z){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w.default.sources.API,U=new f.default().insert(z);return this.setContents(U,Y)}},{key:"update",value:function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:w.default.sources.USER,Y=this.scroll.update(z);return this.selection.update(z),Y}},{key:"updateContents",value:function(z){var Y=this,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w.default.sources.API;return V.call(this,function(){return z=new f.default(z),Y.editor.applyDelta(z,U)},U,!0)}}]),X}();R.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},R.events=w.default.events,R.sources=w.default.sources,R.version="1.3.7",R.imports={delta:f.default,parchment:b.default,"core/module":x.default,"core/theme":F.default};function L(X,q){if(q=(0,P.default)(!0,{container:X,modules:{clipboard:!0,keyboard:!0,history:!0}},q),!q.theme||q.theme===R.DEFAULTS.theme)q.theme=F.default;else if(q.theme=R.import("themes/"+q.theme),q.theme==null)throw new Error("Invalid theme "+q.theme+". Did you register it?");var z=(0,P.default)(!0,{},q.theme.DEFAULTS);[z,q].forEach(function(ee){ee.modules=ee.modules||{},Object.keys(ee.modules).forEach(function(te){ee.modules[te]===!0&&(ee.modules[te]={})})});var Y=Object.keys(z.modules).concat(Object.keys(q.modules)),U=Y.reduce(function(ee,te){var Q=R.import("modules/"+te);return Q==null?A.error("Cannot load "+te+" module. Are you sure you registered it?"):ee[te]=Q.DEFAULTS||{},ee},{});return q.modules!=null&&q.modules.toolbar&&q.modules.toolbar.constructor!==Object&&(q.modules.toolbar={container:q.modules.toolbar}),q=(0,P.default)(!0,{},R.DEFAULTS,{modules:U},z,q),["bounds","container","scrollingContainer"].forEach(function(ee){typeof q[ee]=="string"&&(q[ee]=document.querySelector(q[ee]))}),q.modules=Object.keys(q.modules).reduce(function(ee,te){return q.modules[te]&&(ee[te]=q.modules[te]),ee},{}),q}function V(X,q,z,Y){if(this.options.strict&&!this.isEnabled()&&q===w.default.sources.USER)return new f.default;var U=z==null?null:this.getSelection(),ee=this.editor.delta,te=X();if(U!=null&&(z===!0&&(z=U.index),Y==null?U=W(U,te,q):Y!==0&&(U=W(U,z,Y,q)),this.setSelection(U,w.default.sources.SILENT)),te.length()>0){var Q,Z=[w.default.events.TEXT_CHANGE,te,ee,q];if((Q=this.emitter).emit.apply(Q,[w.default.events.EDITOR_CHANGE].concat(Z)),q!==w.default.sources.SILENT){var re;(re=this.emitter).emit.apply(re,Z)}}return te}function G(X,q,z,Y,U){var ee={};return typeof X.index=="number"&&typeof X.length=="number"?typeof q!="number"?(U=Y,Y=z,z=q,q=X.length,X=X.index):(q=X.length,X=X.index):typeof q!="number"&&(U=Y,Y=z,z=q,q=0),(typeof z>"u"?"undefined":o(z))==="object"?(ee=z,U=Y):typeof z=="string"&&(Y!=null?ee[z]=Y:U=z),U=U||w.default.sources.API,[X,q,ee,U]}function W(X,q,z,Y){if(X==null)return null;var U=void 0,ee=void 0;if(q instanceof f.default){var te=[X.index,X.index+X.length].map(function(ne){return q.transformPosition(ne,Y!==w.default.sources.USER)}),Q=s(te,2);U=Q[0],ee=Q[1]}else{var Z=[X.index,X.index+X.length].map(function(ne){return ne<q||ne===q&&Y===w.default.sources.USER?ne:z>=0?ne+z:Math.max(q,ne+z)}),re=s(Z,2);U=re[0],ee=re[1]}return new g.Range(U,ee-U)}r.expandConfig=L,r.overload=G,r.default=R},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function _(b,g){for(var h=0;h<g.length;h++){var d=g[h];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(b,d.key,d)}}return function(b,g,h){return g&&_(b.prototype,g),h&&_(b,h),b}}(),s=function _(b,g,h){b===null&&(b=Function.prototype);var d=Object.getOwnPropertyDescriptor(b,g);if(d===void 0){var P=Object.getPrototypeOf(b);return P===null?void 0:_(P,g,h)}else{if("value"in d)return d.value;var M=d.get;return M===void 0?void 0:M.call(h)}},c=a(7),m=y(c),f=a(0),v=y(f);function y(_){return _&&_.__esModule?_:{default:_}}function E(_,b){if(!(_ instanceof b))throw new TypeError("Cannot call a class as a function")}function w(_,b){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:_}function S(_,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);_.prototype=Object.create(b&&b.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(_,b):_.__proto__=b)}var x=function(_){S(b,_);function b(){return E(this,b),w(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return o(b,[{key:"formatAt",value:function(h,d,P,M){if(b.compare(this.statics.blotName,P)<0&&v.default.query(P,v.default.Scope.BLOT)){var T=this.isolate(h,d);M&&T.wrap(P,M)}else s(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"formatAt",this).call(this,h,d,P,M)}},{key:"optimize",value:function(h){if(s(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"optimize",this).call(this,h),this.parent instanceof b&&b.compare(this.statics.blotName,this.parent.statics.blotName)>0){var d=this.parent.isolate(this.offset(),this.length());this.moveChildren(d),d.wrap(this)}}}],[{key:"compare",value:function(h,d){var P=b.order.indexOf(h),M=b.order.indexOf(d);return P>=0||M>=0?P-M:h===d?0:h<d?-1:1}}]),b}(v.default.Inline);x.allowedChildren=[x,v.default.Embed,m.default],x.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],r.default=x},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=a(0),s=c(o);function c(E){return E&&E.__esModule?E:{default:E}}function m(E,w){if(!(E instanceof w))throw new TypeError("Cannot call a class as a function")}function f(E,w){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:E}function v(E,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);E.prototype=Object.create(w&&w.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(E,w):E.__proto__=w)}var y=function(E){v(w,E);function w(){return m(this,w),f(this,(w.__proto__||Object.getPrototypeOf(w)).apply(this,arguments))}return w}(s.default.Text);r.default=y},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function g(h,d){for(var P=0;P<d.length;P++){var M=d[P];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(h,M.key,M)}}return function(h,d,P){return d&&g(h.prototype,d),P&&g(h,P),h}}(),s=function g(h,d,P){h===null&&(h=Function.prototype);var M=Object.getOwnPropertyDescriptor(h,d);if(M===void 0){var T=Object.getPrototypeOf(h);return T===null?void 0:g(T,d,P)}else{if("value"in M)return M.value;var I=M.get;return I===void 0?void 0:I.call(P)}},c=a(54),m=y(c),f=a(10),v=y(f);function y(g){return g&&g.__esModule?g:{default:g}}function E(g,h){if(!(g instanceof h))throw new TypeError("Cannot call a class as a function")}function w(g,h){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:g}function S(g,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);g.prototype=Object.create(h&&h.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(g,h):g.__proto__=h)}var x=(0,v.default)("quill:events"),_=["selectionchange","mousedown","mouseup","click"];_.forEach(function(g){document.addEventListener(g,function(){for(var h=arguments.length,d=Array(h),P=0;P<h;P++)d[P]=arguments[P];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(M){if(M.__quill&&M.__quill.emitter){var T;(T=M.__quill.emitter).handleDOM.apply(T,d)}})})});var b=function(g){S(h,g);function h(){E(this,h);var d=w(this,(h.__proto__||Object.getPrototypeOf(h)).call(this));return d.listeners={},d.on("error",x.error),d}return o(h,[{key:"emit",value:function(){x.log.apply(x,arguments),s(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(P){for(var M=arguments.length,T=Array(M>1?M-1:0),I=1;I<M;I++)T[I-1]=arguments[I];(this.listeners[P.type]||[]).forEach(function(F){var k=F.node,O=F.handler;(P.target===k||k.contains(P.target))&&O.apply(void 0,[P].concat(T))})}},{key:"listenDOM",value:function(P,M,T){this.listeners[P]||(this.listeners[P]=[]),this.listeners[P].push({node:M,handler:T})}}]),h}(m.default);b.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"},b.sources={API:"api",SILENT:"silent",USER:"user"},r.default=b},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});function o(c,m){if(!(c instanceof m))throw new TypeError("Cannot call a class as a function")}var s=function c(m){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};o(this,c),this.quill=m,this.options=f};s.DEFAULTS={},r.default=s},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=["error","warn","log","info"],s="warn";function c(f){if(o.indexOf(f)<=o.indexOf(s)){for(var v,y=arguments.length,E=Array(y>1?y-1:0),w=1;w<y;w++)E[w-1]=arguments[w];(v=console)[f].apply(v,E)}}function m(f){return o.reduce(function(v,y){return v[y]=c.bind(console,y,f),v},{})}c.level=m.level=function(f){s=f},r.default=m},function(t,r,a){var o=Array.prototype.slice,s=a(52),c=a(53),m=t.exports=function(E,w,S){return S||(S={}),E===w?!0:E instanceof Date&&w instanceof Date?E.getTime()===w.getTime():!E||!w||typeof E!="object"&&typeof w!="object"?S.strict?E===w:E==w:y(E,w,S)};function f(E){return E==null}function v(E){return!(!E||typeof E!="object"||typeof E.length!="number"||typeof E.copy!="function"||typeof E.slice!="function"||E.length>0&&typeof E[0]!="number")}function y(E,w,S){var x,_;if(f(E)||f(w)||E.prototype!==w.prototype)return!1;if(c(E))return c(w)?(E=o.call(E),w=o.call(w),m(E,w,S)):!1;if(v(E)){if(!v(w)||E.length!==w.length)return!1;for(x=0;x<E.length;x++)if(E[x]!==w[x])return!1;return!0}try{var b=s(E),g=s(w)}catch{return!1}if(b.length!=g.length)return!1;for(b.sort(),g.sort(),x=b.length-1;x>=0;x--)if(b[x]!=g[x])return!1;for(x=b.length-1;x>=0;x--)if(_=b[x],!m(E[_],w[_],S))return!1;return typeof E==typeof w}},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=a(1),s=function(){function c(m,f,v){v===void 0&&(v={}),this.attrName=m,this.keyName=f;var y=o.Scope.TYPE&o.Scope.ATTRIBUTE;v.scope!=null?this.scope=v.scope&o.Scope.LEVEL|y:this.scope=o.Scope.ATTRIBUTE,v.whitelist!=null&&(this.whitelist=v.whitelist)}return c.keys=function(m){return[].map.call(m.attributes,function(f){return f.name})},c.prototype.add=function(m,f){return this.canAdd(m,f)?(m.setAttribute(this.keyName,f),!0):!1},c.prototype.canAdd=function(m,f){var v=o.query(m,o.Scope.BLOT&(this.scope|o.Scope.TYPE));return v==null?!1:this.whitelist==null?!0:typeof f=="string"?this.whitelist.indexOf(f.replace(/["']/g,""))>-1:this.whitelist.indexOf(f)>-1},c.prototype.remove=function(m){m.removeAttribute(this.keyName)},c.prototype.value=function(m){var f=m.getAttribute(this.keyName);return this.canAdd(m,f)&&f?f:""},c}();r.default=s},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.Code=void 0;var o=function(){function I(F,k){var O=[],N=!0,A=!1,R=void 0;try{for(var L=F[Symbol.iterator](),V;!(N=(V=L.next()).done)&&(O.push(V.value),!(k&&O.length===k));N=!0);}catch(G){A=!0,R=G}finally{try{!N&&L.return&&L.return()}finally{if(A)throw R}}return O}return function(F,k){if(Array.isArray(F))return F;if(Symbol.iterator in Object(F))return I(F,k);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function I(F,k){for(var O=0;O<k.length;O++){var N=k[O];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(F,N.key,N)}}return function(F,k,O){return k&&I(F.prototype,k),O&&I(F,O),F}}(),c=function I(F,k,O){F===null&&(F=Function.prototype);var N=Object.getOwnPropertyDescriptor(F,k);if(N===void 0){var A=Object.getPrototypeOf(F);return A===null?void 0:I(A,k,O)}else{if("value"in N)return N.value;var R=N.get;return R===void 0?void 0:R.call(O)}},m=a(2),f=g(m),v=a(0),y=g(v),E=a(4),w=g(E),S=a(6),x=g(S),_=a(7),b=g(_);function g(I){return I&&I.__esModule?I:{default:I}}function h(I,F){if(!(I instanceof F))throw new TypeError("Cannot call a class as a function")}function d(I,F){if(!I)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return F&&(typeof F=="object"||typeof F=="function")?F:I}function P(I,F){if(typeof F!="function"&&F!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof F);I.prototype=Object.create(F&&F.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}}),F&&(Object.setPrototypeOf?Object.setPrototypeOf(I,F):I.__proto__=F)}var M=function(I){P(F,I);function F(){return h(this,F),d(this,(F.__proto__||Object.getPrototypeOf(F)).apply(this,arguments))}return F}(x.default);M.blotName="code",M.tagName="CODE";var T=function(I){P(F,I);function F(){return h(this,F),d(this,(F.__proto__||Object.getPrototypeOf(F)).apply(this,arguments))}return s(F,[{key:"delta",value:function(){var O=this,N=this.domNode.textContent;return N.endsWith(`
119
- `)&&(N=N.slice(0,-1)),N.split(`
120
- `).reduce(function(A,R){return A.insert(R).insert(`
121
- `,O.formats())},new f.default)}},{key:"format",value:function(O,N){if(!(O===this.statics.blotName&&N)){var A=this.descendant(b.default,this.length()-1),R=o(A,1),L=R[0];L!=null&&L.deleteAt(L.length()-1,1),c(F.prototype.__proto__||Object.getPrototypeOf(F.prototype),"format",this).call(this,O,N)}}},{key:"formatAt",value:function(O,N,A,R){if(N!==0&&!(y.default.query(A,y.default.Scope.BLOCK)==null||A===this.statics.blotName&&R===this.statics.formats(this.domNode))){var L=this.newlineIndex(O);if(!(L<0||L>=O+N)){var V=this.newlineIndex(O,!0)+1,G=L-V+1,W=this.isolate(V,G),X=W.next;W.format(A,R),X instanceof F&&X.formatAt(0,O-V+N-G,A,R)}}}},{key:"insertAt",value:function(O,N,A){if(A==null){var R=this.descendant(b.default,O),L=o(R,2),V=L[0],G=L[1];V.insertAt(G,N)}}},{key:"length",value:function(){var O=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
122
- `)?O:O+1}},{key:"newlineIndex",value:function(O){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(N)return this.domNode.textContent.slice(0,O).lastIndexOf(`
123
- `);var A=this.domNode.textContent.slice(O).indexOf(`
124
- `);return A>-1?O+A:-1}},{key:"optimize",value:function(O){this.domNode.textContent.endsWith(`
125
- `)||this.appendChild(y.default.create("text",`
126
- `)),c(F.prototype.__proto__||Object.getPrototypeOf(F.prototype),"optimize",this).call(this,O);var N=this.next;N!=null&&N.prev===this&&N.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===N.statics.formats(N.domNode)&&(N.optimize(O),N.moveChildren(this),N.remove())}},{key:"replace",value:function(O){c(F.prototype.__proto__||Object.getPrototypeOf(F.prototype),"replace",this).call(this,O),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(N){var A=y.default.find(N);A==null?N.parentNode.removeChild(N):A instanceof y.default.Embed?A.remove():A.unwrap()})}}],[{key:"create",value:function(O){var N=c(F.__proto__||Object.getPrototypeOf(F),"create",this).call(this,O);return N.setAttribute("spellcheck",!1),N}},{key:"formats",value:function(){return!0}}]),F}(w.default);T.blotName="code-block",T.tagName="PRE",T.TAB=" ",r.Code=M,r.default=T},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(X){return typeof X}:function(X){return X&&typeof Symbol=="function"&&X.constructor===Symbol&&X!==Symbol.prototype?"symbol":typeof X},s=function(){function X(q,z){var Y=[],U=!0,ee=!1,te=void 0;try{for(var Q=q[Symbol.iterator](),Z;!(U=(Z=Q.next()).done)&&(Y.push(Z.value),!(z&&Y.length===z));U=!0);}catch(re){ee=!0,te=re}finally{try{!U&&Q.return&&Q.return()}finally{if(ee)throw te}}return Y}return function(q,z){if(Array.isArray(q))return q;if(Symbol.iterator in Object(q))return X(q,z);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function X(q,z){for(var Y=0;Y<z.length;Y++){var U=z[Y];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(q,U.key,U)}}return function(q,z,Y){return z&&X(q.prototype,z),Y&&X(q,Y),q}}(),m=a(2),f=N(m),v=a(20),y=N(v),E=a(0),w=N(E),S=a(13),x=N(S),_=a(24),b=N(_),g=a(4),h=N(g),d=a(16),P=N(d),M=a(21),T=N(M),I=a(11),F=N(I),k=a(3),O=N(k);function N(X){return X&&X.__esModule?X:{default:X}}function A(X,q,z){return q in X?Object.defineProperty(X,q,{value:z,enumerable:!0,configurable:!0,writable:!0}):X[q]=z,X}function R(X,q){if(!(X instanceof q))throw new TypeError("Cannot call a class as a function")}var L=/^[ -~]*$/,V=function(){function X(q){R(this,X),this.scroll=q,this.delta=this.getDelta()}return c(X,[{key:"applyDelta",value:function(z){var Y=this,U=!1;this.scroll.update();var ee=this.scroll.length();return this.scroll.batchStart(),z=W(z),z.reduce(function(te,Q){var Z=Q.retain||Q.delete||Q.insert.length||1,re=Q.attributes||{};if(Q.insert!=null){if(typeof Q.insert=="string"){var ne=Q.insert;ne.endsWith(`
127
- `)&&U&&(U=!1,ne=ne.slice(0,-1)),te>=ee&&!ne.endsWith(`
128
- `)&&(U=!0),Y.scroll.insertAt(te,ne);var ae=Y.scroll.line(te),ue=s(ae,2),fe=ue[0],pe=ue[1],ye=(0,O.default)({},(0,g.bubbleFormats)(fe));if(fe instanceof h.default){var we=fe.descendant(w.default.Leaf,pe),je=s(we,1),Te=je[0];ye=(0,O.default)(ye,(0,g.bubbleFormats)(Te))}re=y.default.attributes.diff(ye,re)||{}}else if(o(Q.insert)==="object"){var se=Object.keys(Q.insert)[0];if(se==null)return te;Y.scroll.insertAt(te,se,Q.insert[se])}ee+=Z}return Object.keys(re).forEach(function(_e){Y.scroll.formatAt(te,Z,_e,re[_e])}),te+Z},0),z.reduce(function(te,Q){return typeof Q.delete=="number"?(Y.scroll.deleteAt(te,Q.delete),te):te+(Q.retain||Q.insert.length||1)},0),this.scroll.batchEnd(),this.update(z)}},{key:"deleteText",value:function(z,Y){return this.scroll.deleteAt(z,Y),this.update(new f.default().retain(z).delete(Y))}},{key:"formatLine",value:function(z,Y){var U=this,ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(ee).forEach(function(te){if(!(U.scroll.whitelist!=null&&!U.scroll.whitelist[te])){var Q=U.scroll.lines(z,Math.max(Y,1)),Z=Y;Q.forEach(function(re){var ne=re.length();if(!(re instanceof x.default))re.format(te,ee[te]);else{var ae=z-re.offset(U.scroll),ue=re.newlineIndex(ae+Z)-ae+1;re.formatAt(ae,ue,te,ee[te])}Z-=ne})}}),this.scroll.optimize(),this.update(new f.default().retain(z).retain(Y,(0,T.default)(ee)))}},{key:"formatText",value:function(z,Y){var U=this,ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(ee).forEach(function(te){U.scroll.formatAt(z,Y,te,ee[te])}),this.update(new f.default().retain(z).retain(Y,(0,T.default)(ee)))}},{key:"getContents",value:function(z,Y){return this.delta.slice(z,z+Y)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(z,Y){return z.concat(Y.delta())},new f.default)}},{key:"getFormat",value:function(z){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,U=[],ee=[];Y===0?this.scroll.path(z).forEach(function(Q){var Z=s(Q,1),re=Z[0];re instanceof h.default?U.push(re):re instanceof w.default.Leaf&&ee.push(re)}):(U=this.scroll.lines(z,Y),ee=this.scroll.descendants(w.default.Leaf,z,Y));var te=[U,ee].map(function(Q){if(Q.length===0)return{};for(var Z=(0,g.bubbleFormats)(Q.shift());Object.keys(Z).length>0;){var re=Q.shift();if(re==null)return Z;Z=G((0,g.bubbleFormats)(re),Z)}return Z});return O.default.apply(O.default,te)}},{key:"getText",value:function(z,Y){return this.getContents(z,Y).filter(function(U){return typeof U.insert=="string"}).map(function(U){return U.insert}).join("")}},{key:"insertEmbed",value:function(z,Y,U){return this.scroll.insertAt(z,Y,U),this.update(new f.default().retain(z).insert(A({},Y,U)))}},{key:"insertText",value:function(z,Y){var U=this,ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Y=Y.replace(/\r\n/g,`
129
- `).replace(/\r/g,`
130
- `),this.scroll.insertAt(z,Y),Object.keys(ee).forEach(function(te){U.scroll.formatAt(z,Y.length,te,ee[te])}),this.update(new f.default().retain(z).insert(Y,(0,T.default)(ee)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var z=this.scroll.children.head;return z.statics.blotName!==h.default.blotName||z.children.length>1?!1:z.children.head instanceof P.default}},{key:"removeFormat",value:function(z,Y){var U=this.getText(z,Y),ee=this.scroll.line(z+Y),te=s(ee,2),Q=te[0],Z=te[1],re=0,ne=new f.default;Q!=null&&(Q instanceof x.default?re=Q.newlineIndex(Z)-Z+1:re=Q.length()-Z,ne=Q.delta().slice(Z,Z+re-1).insert(`
131
- `));var ae=this.getContents(z,Y+re),ue=ae.diff(new f.default().insert(U).concat(ne)),fe=new f.default().retain(z).concat(ue);return this.applyDelta(fe)}},{key:"update",value:function(z){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,ee=this.delta;if(Y.length===1&&Y[0].type==="characterData"&&Y[0].target.data.match(L)&&w.default.find(Y[0].target)){var te=w.default.find(Y[0].target),Q=(0,g.bubbleFormats)(te),Z=te.offset(this.scroll),re=Y[0].oldValue.replace(b.default.CONTENTS,""),ne=new f.default().insert(re),ae=new f.default().insert(te.value()),ue=new f.default().retain(Z).concat(ne.diff(ae,U));z=ue.reduce(function(fe,pe){return pe.insert?fe.insert(pe.insert,Q):fe.push(pe)},new f.default),this.delta=ee.compose(z)}else this.delta=this.getDelta(),(!z||!(0,F.default)(ee.compose(z),this.delta))&&(z=ee.diff(this.delta,U));return z}}]),X}();function G(X,q){return Object.keys(q).reduce(function(z,Y){return X[Y]==null||(q[Y]===X[Y]?z[Y]=q[Y]:Array.isArray(q[Y])?q[Y].indexOf(X[Y])<0&&(z[Y]=q[Y].concat([X[Y]])):z[Y]=[q[Y],X[Y]]),z},{})}function W(X){return X.reduce(function(q,z){if(z.insert===1){var Y=(0,T.default)(z.attributes);return delete Y.image,q.insert({image:z.attributes.image},Y)}if(z.attributes!=null&&(z.attributes.list===!0||z.attributes.bullet===!0)&&(z=(0,T.default)(z),z.attributes.list?z.attributes.list="ordered":(z.attributes.list="bullet",delete z.attributes.bullet)),typeof z.insert=="string"){var U=z.insert.replace(/\r\n/g,`
132
- `).replace(/\r/g,`
133
- `);return q.insert(U,z.attributes)}return q.push(z)},new f.default)}r.default=V},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.Range=void 0;var o=function(){function I(F,k){var O=[],N=!0,A=!1,R=void 0;try{for(var L=F[Symbol.iterator](),V;!(N=(V=L.next()).done)&&(O.push(V.value),!(k&&O.length===k));N=!0);}catch(G){A=!0,R=G}finally{try{!N&&L.return&&L.return()}finally{if(A)throw R}}return O}return function(F,k){if(Array.isArray(F))return F;if(Symbol.iterator in Object(F))return I(F,k);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function I(F,k){for(var O=0;O<k.length;O++){var N=k[O];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(F,N.key,N)}}return function(F,k,O){return k&&I(F.prototype,k),O&&I(F,O),F}}(),c=a(0),m=b(c),f=a(21),v=b(f),y=a(11),E=b(y),w=a(8),S=b(w),x=a(10),_=b(x);function b(I){return I&&I.__esModule?I:{default:I}}function g(I){if(Array.isArray(I)){for(var F=0,k=Array(I.length);F<I.length;F++)k[F]=I[F];return k}else return Array.from(I)}function h(I,F){if(!(I instanceof F))throw new TypeError("Cannot call a class as a function")}var d=(0,_.default)("quill:selection"),P=function I(F){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;h(this,I),this.index=F,this.length=k},M=function(){function I(F,k){var O=this;h(this,I),this.emitter=k,this.scroll=F,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=m.default.create("cursor",this),this.lastRange=this.savedRange=new P(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){O.mouseDown||setTimeout(O.update.bind(O,S.default.sources.USER),1)}),this.emitter.on(S.default.events.EDITOR_CHANGE,function(N,A){N===S.default.events.TEXT_CHANGE&&A.length()>0&&O.update(S.default.sources.SILENT)}),this.emitter.on(S.default.events.SCROLL_BEFORE_UPDATE,function(){if(O.hasFocus()){var N=O.getNativeRange();N!=null&&N.start.node!==O.cursor.textNode&&O.emitter.once(S.default.events.SCROLL_UPDATE,function(){try{O.setNativeRange(N.start.node,N.start.offset,N.end.node,N.end.offset)}catch{}})}}),this.emitter.on(S.default.events.SCROLL_OPTIMIZE,function(N,A){if(A.range){var R=A.range,L=R.startNode,V=R.startOffset,G=R.endNode,W=R.endOffset;O.setNativeRange(L,V,G,W)}}),this.update(S.default.sources.SILENT)}return s(I,[{key:"handleComposition",value:function(){var k=this;this.root.addEventListener("compositionstart",function(){k.composing=!0}),this.root.addEventListener("compositionend",function(){if(k.composing=!1,k.cursor.parent){var O=k.cursor.restore();if(!O)return;setTimeout(function(){k.setNativeRange(O.startNode,O.startOffset,O.endNode,O.endOffset)},1)}})}},{key:"handleDragging",value:function(){var k=this;this.emitter.listenDOM("mousedown",document.body,function(){k.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){k.mouseDown=!1,k.update(S.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(k,O){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[k])){this.scroll.update();var N=this.getNativeRange();if(!(N==null||!N.native.collapsed||m.default.query(k,m.default.Scope.BLOCK))){if(N.start.node!==this.cursor.textNode){var A=m.default.find(N.start.node,!1);if(A==null)return;if(A instanceof m.default.Leaf){var R=A.split(N.start.offset);A.parent.insertBefore(this.cursor,R)}else A.insertBefore(this.cursor,N.start.node);this.cursor.attach()}this.cursor.format(k,O),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(k){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,N=this.scroll.length();k=Math.min(k,N-1),O=Math.min(k+O,N-1)-k;var A=void 0,R=this.scroll.leaf(k),L=o(R,2),V=L[0],G=L[1];if(V==null)return null;var W=V.position(G,!0),X=o(W,2);A=X[0],G=X[1];var q=document.createRange();if(O>0){q.setStart(A,G);var z=this.scroll.leaf(k+O),Y=o(z,2);if(V=Y[0],G=Y[1],V==null)return null;var U=V.position(G,!0),ee=o(U,2);return A=ee[0],G=ee[1],q.setEnd(A,G),q.getBoundingClientRect()}else{var te="left",Q=void 0;return A instanceof Text?(G<A.data.length?(q.setStart(A,G),q.setEnd(A,G+1)):(q.setStart(A,G-1),q.setEnd(A,G),te="right"),Q=q.getBoundingClientRect()):(Q=V.domNode.getBoundingClientRect(),G>0&&(te="right")),{bottom:Q.top+Q.height,height:Q.height,left:Q[te],right:Q[te],top:Q.top,width:0}}}},{key:"getNativeRange",value:function(){var k=document.getSelection();if(k==null||k.rangeCount<=0)return null;var O=k.getRangeAt(0);if(O==null)return null;var N=this.normalizeNative(O);return d.info("getNativeRange",N),N}},{key:"getRange",value:function(){var k=this.getNativeRange();if(k==null)return[null,null];var O=this.normalizedToRange(k);return[O,k]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(k){var O=this,N=[[k.start.node,k.start.offset]];k.native.collapsed||N.push([k.end.node,k.end.offset]);var A=N.map(function(V){var G=o(V,2),W=G[0],X=G[1],q=m.default.find(W,!0),z=q.offset(O.scroll);return X===0?z:q instanceof m.default.Container?z+q.length():z+q.index(W,X)}),R=Math.min(Math.max.apply(Math,g(A)),this.scroll.length()-1),L=Math.min.apply(Math,[R].concat(g(A)));return new P(L,R-L)}},{key:"normalizeNative",value:function(k){if(!T(this.root,k.startContainer)||!k.collapsed&&!T(this.root,k.endContainer))return null;var O={start:{node:k.startContainer,offset:k.startOffset},end:{node:k.endContainer,offset:k.endOffset},native:k};return[O.start,O.end].forEach(function(N){for(var A=N.node,R=N.offset;!(A instanceof Text)&&A.childNodes.length>0;)if(A.childNodes.length>R)A=A.childNodes[R],R=0;else if(A.childNodes.length===R)A=A.lastChild,R=A instanceof Text?A.data.length:A.childNodes.length+1;else break;N.node=A,N.offset=R}),O}},{key:"rangeToNative",value:function(k){var O=this,N=k.collapsed?[k.index]:[k.index,k.index+k.length],A=[],R=this.scroll.length();return N.forEach(function(L,V){L=Math.min(R-1,L);var G=void 0,W=O.scroll.leaf(L),X=o(W,2),q=X[0],z=X[1],Y=q.position(z,V!==0),U=o(Y,2);G=U[0],z=U[1],A.push(G,z)}),A.length<2&&(A=A.concat(A)),A}},{key:"scrollIntoView",value:function(k){var O=this.lastRange;if(O!=null){var N=this.getBounds(O.index,O.length);if(N!=null){var A=this.scroll.length()-1,R=this.scroll.line(Math.min(O.index,A)),L=o(R,1),V=L[0],G=V;if(O.length>0){var W=this.scroll.line(Math.min(O.index+O.length,A)),X=o(W,1);G=X[0]}if(!(V==null||G==null)){var q=k.getBoundingClientRect();N.top<q.top?k.scrollTop-=q.top-N.top:N.bottom>q.bottom&&(k.scrollTop+=N.bottom-q.bottom)}}}}},{key:"setNativeRange",value:function(k,O){var N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:k,A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:O,R=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(d.info("setNativeRange",k,O,N,A),!(k!=null&&(this.root.parentNode==null||k.parentNode==null||N.parentNode==null))){var L=document.getSelection();if(L!=null)if(k!=null){this.hasFocus()||this.root.focus();var V=(this.getNativeRange()||{}).native;if(V==null||R||k!==V.startContainer||O!==V.startOffset||N!==V.endContainer||A!==V.endOffset){k.tagName=="BR"&&(O=[].indexOf.call(k.parentNode.childNodes,k),k=k.parentNode),N.tagName=="BR"&&(A=[].indexOf.call(N.parentNode.childNodes,N),N=N.parentNode);var G=document.createRange();G.setStart(k,O),G.setEnd(N,A),L.removeAllRanges(),L.addRange(G)}}else L.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(k){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:S.default.sources.API;if(typeof O=="string"&&(N=O,O=!1),d.info("setRange",k),k!=null){var A=this.rangeToNative(k);this.setNativeRange.apply(this,g(A).concat([O]))}else this.setNativeRange(null);this.update(N)}},{key:"update",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:S.default.sources.USER,O=this.lastRange,N=this.getRange(),A=o(N,2),R=A[0],L=A[1];if(this.lastRange=R,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,E.default)(O,this.lastRange)){var V;!this.composing&&L!=null&&L.native.collapsed&&L.start.node!==this.cursor.textNode&&this.cursor.restore();var G=[S.default.events.SELECTION_CHANGE,(0,v.default)(this.lastRange),(0,v.default)(O),k];if((V=this.emitter).emit.apply(V,[S.default.events.EDITOR_CHANGE].concat(G)),k!==S.default.sources.SILENT){var W;(W=this.emitter).emit.apply(W,G)}}}}]),I}();function T(I,F){try{F.parentNode}catch{return!1}return F instanceof Text&&(F=F.parentNode),I.contains(F)}r.Range=P,r.default=M},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function S(x,_){for(var b=0;b<_.length;b++){var g=_[b];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(x,g.key,g)}}return function(x,_,b){return _&&S(x.prototype,_),b&&S(x,b),x}}(),s=function S(x,_,b){x===null&&(x=Function.prototype);var g=Object.getOwnPropertyDescriptor(x,_);if(g===void 0){var h=Object.getPrototypeOf(x);return h===null?void 0:S(h,_,b)}else{if("value"in g)return g.value;var d=g.get;return d===void 0?void 0:d.call(b)}},c=a(0),m=f(c);function f(S){return S&&S.__esModule?S:{default:S}}function v(S,x){if(!(S instanceof x))throw new TypeError("Cannot call a class as a function")}function y(S,x){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:S}function E(S,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);S.prototype=Object.create(x&&x.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(S,x):S.__proto__=x)}var w=function(S){E(x,S);function x(){return v(this,x),y(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return o(x,[{key:"insertInto",value:function(b,g){b.children.length===0?s(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"insertInto",this).call(this,b,g):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),x}(m.default.Embed);w.blotName="break",w.tagName="BR",r.default=w},function(t,r,a){var o=this&&this.__extends||function(){var y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,w){E.__proto__=w}||function(E,w){for(var S in w)w.hasOwnProperty(S)&&(E[S]=w[S])};return function(E,w){y(E,w);function S(){this.constructor=E}E.prototype=w===null?Object.create(w):(S.prototype=w.prototype,new S)}}();Object.defineProperty(r,"__esModule",{value:!0});var s=a(44),c=a(30),m=a(1),f=function(y){o(E,y);function E(w){var S=y.call(this,w)||this;return S.build(),S}return E.prototype.appendChild=function(w){this.insertBefore(w)},E.prototype.attach=function(){y.prototype.attach.call(this),this.children.forEach(function(w){w.attach()})},E.prototype.build=function(){var w=this;this.children=new s.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(S){try{var x=v(S);w.insertBefore(x,w.children.head||void 0)}catch(_){if(_ instanceof m.ParchmentError)return;throw _}})},E.prototype.deleteAt=function(w,S){if(w===0&&S===this.length())return this.remove();this.children.forEachAt(w,S,function(x,_,b){x.deleteAt(_,b)})},E.prototype.descendant=function(w,S){var x=this.children.find(S),_=x[0],b=x[1];return w.blotName==null&&w(_)||w.blotName!=null&&_ instanceof w?[_,b]:_ instanceof E?_.descendant(w,b):[null,-1]},E.prototype.descendants=function(w,S,x){S===void 0&&(S=0),x===void 0&&(x=Number.MAX_VALUE);var _=[],b=x;return this.children.forEachAt(S,x,function(g,h,d){(w.blotName==null&&w(g)||w.blotName!=null&&g instanceof w)&&_.push(g),g instanceof E&&(_=_.concat(g.descendants(w,h,b))),b-=d}),_},E.prototype.detach=function(){this.children.forEach(function(w){w.detach()}),y.prototype.detach.call(this)},E.prototype.formatAt=function(w,S,x,_){this.children.forEachAt(w,S,function(b,g,h){b.formatAt(g,h,x,_)})},E.prototype.insertAt=function(w,S,x){var _=this.children.find(w),b=_[0],g=_[1];if(b)b.insertAt(g,S,x);else{var h=x==null?m.create("text",S):m.create(S,x);this.appendChild(h)}},E.prototype.insertBefore=function(w,S){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(x){return w instanceof x}))throw new m.ParchmentError("Cannot insert "+w.statics.blotName+" into "+this.statics.blotName);w.insertInto(this,S)},E.prototype.length=function(){return this.children.reduce(function(w,S){return w+S.length()},0)},E.prototype.moveChildren=function(w,S){this.children.forEach(function(x){w.insertBefore(x,S)})},E.prototype.optimize=function(w){if(y.prototype.optimize.call(this,w),this.children.length===0)if(this.statics.defaultChild!=null){var S=m.create(this.statics.defaultChild);this.appendChild(S),S.optimize(w)}else this.remove()},E.prototype.path=function(w,S){S===void 0&&(S=!1);var x=this.children.find(w,S),_=x[0],b=x[1],g=[[this,w]];return _ instanceof E?g.concat(_.path(b,S)):(_!=null&&g.push([_,b]),g)},E.prototype.removeChild=function(w){this.children.remove(w)},E.prototype.replace=function(w){w instanceof E&&w.moveChildren(this),y.prototype.replace.call(this,w)},E.prototype.split=function(w,S){if(S===void 0&&(S=!1),!S){if(w===0)return this;if(w===this.length())return this.next}var x=this.clone();return this.parent.insertBefore(x,this.next),this.children.forEachAt(w,this.length(),function(_,b,g){_=_.split(b,S),x.appendChild(_)}),x},E.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},E.prototype.update=function(w,S){var x=this,_=[],b=[];w.forEach(function(g){g.target===x.domNode&&g.type==="childList"&&(_.push.apply(_,g.addedNodes),b.push.apply(b,g.removedNodes))}),b.forEach(function(g){if(!(g.parentNode!=null&&g.tagName!=="IFRAME"&&document.body.compareDocumentPosition(g)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var h=m.find(g);h!=null&&(h.domNode.parentNode==null||h.domNode.parentNode===x.domNode)&&h.detach()}}),_.filter(function(g){return g.parentNode==x.domNode}).sort(function(g,h){return g===h?0:g.compareDocumentPosition(h)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(g){var h=null;g.nextSibling!=null&&(h=m.find(g.nextSibling));var d=v(g);(d.next!=h||d.next==null)&&(d.parent!=null&&d.parent.removeChild(x),x.insertBefore(d,h||void 0))})},E}(c.default);function v(y){var E=m.find(y);if(E==null)try{E=m.create(y)}catch{E=m.create(m.Scope.INLINE),[].slice.call(y.childNodes).forEach(function(S){E.domNode.appendChild(S)}),y.parentNode&&y.parentNode.replaceChild(E.domNode,y),E.attach()}return E}r.default=f},function(t,r,a){var o=this&&this.__extends||function(){var y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,w){E.__proto__=w}||function(E,w){for(var S in w)w.hasOwnProperty(S)&&(E[S]=w[S])};return function(E,w){y(E,w);function S(){this.constructor=E}E.prototype=w===null?Object.create(w):(S.prototype=w.prototype,new S)}}();Object.defineProperty(r,"__esModule",{value:!0});var s=a(12),c=a(31),m=a(17),f=a(1),v=function(y){o(E,y);function E(w){var S=y.call(this,w)||this;return S.attributes=new c.default(S.domNode),S}return E.formats=function(w){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return w.tagName.toLowerCase()},E.prototype.format=function(w,S){var x=f.query(w);x instanceof s.default?this.attributes.attribute(x,S):S&&x!=null&&(w!==this.statics.blotName||this.formats()[w]!==S)&&this.replaceWith(w,S)},E.prototype.formats=function(){var w=this.attributes.values(),S=this.statics.formats(this.domNode);return S!=null&&(w[this.statics.blotName]=S),w},E.prototype.replaceWith=function(w,S){var x=y.prototype.replaceWith.call(this,w,S);return this.attributes.copy(x),x},E.prototype.update=function(w,S){var x=this;y.prototype.update.call(this,w,S),w.some(function(_){return _.target===x.domNode&&_.type==="attributes"})&&this.attributes.build()},E.prototype.wrap=function(w,S){var x=y.prototype.wrap.call(this,w,S);return x instanceof E&&x.statics.scope===this.statics.scope&&this.attributes.move(x),x},E}(m.default);r.default=v},function(t,r,a){var o=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,y){v.__proto__=y}||function(v,y){for(var E in y)y.hasOwnProperty(E)&&(v[E]=y[E])};return function(v,y){f(v,y);function E(){this.constructor=v}v.prototype=y===null?Object.create(y):(E.prototype=y.prototype,new E)}}();Object.defineProperty(r,"__esModule",{value:!0});var s=a(30),c=a(1),m=function(f){o(v,f);function v(){return f!==null&&f.apply(this,arguments)||this}return v.value=function(y){return!0},v.prototype.index=function(y,E){return this.domNode===y||this.domNode.compareDocumentPosition(y)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(E,1):-1},v.prototype.position=function(y,E){var w=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return y>0&&(w+=1),[this.parent.domNode,w]},v.prototype.value=function(){var y;return y={},y[this.statics.blotName]=this.statics.value(this.domNode)||!0,y},v.scope=c.Scope.INLINE_BLOT,v}(s.default);r.default=m},function(t,r,a){var o=a(11),s=a(3),c={attributes:{compose:function(f,v,y){typeof f!="object"&&(f={}),typeof v!="object"&&(v={});var E=s(!0,{},v);y||(E=Object.keys(E).reduce(function(S,x){return E[x]!=null&&(S[x]=E[x]),S},{}));for(var w in f)f[w]!==void 0&&v[w]===void 0&&(E[w]=f[w]);return Object.keys(E).length>0?E:void 0},diff:function(f,v){typeof f!="object"&&(f={}),typeof v!="object"&&(v={});var y=Object.keys(f).concat(Object.keys(v)).reduce(function(E,w){return o(f[w],v[w])||(E[w]=v[w]===void 0?null:v[w]),E},{});return Object.keys(y).length>0?y:void 0},transform:function(f,v,y){if(typeof f!="object")return v;if(typeof v=="object"){if(!y)return v;var E=Object.keys(v).reduce(function(w,S){return f[S]===void 0&&(w[S]=v[S]),w},{});return Object.keys(E).length>0?E:void 0}}},iterator:function(f){return new m(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 m(f){this.ops=f,this.index=0,this.offset=0}m.prototype.hasNext=function(){return this.peekLength()<1/0},m.prototype.next=function(f){f||(f=1/0);var v=this.ops[this.index];if(v){var y=this.offset,E=c.length(v);if(f>=E-y?(f=E-y,this.index+=1,this.offset=0):this.offset+=f,typeof v.delete=="number")return{delete:f};var w={};return v.attributes&&(w.attributes=v.attributes),typeof v.retain=="number"?w.retain=f:typeof v.insert=="string"?w.insert=v.insert.substr(y,f):w.insert=v.insert,w}else return{retain:1/0}},m.prototype.peek=function(){return this.ops[this.index]},m.prototype.peekLength=function(){return this.ops[this.index]?c.length(this.ops[this.index])-this.offset:1/0},m.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"},m.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var f=this.offset,v=this.index,y=this.next(),E=this.ops.slice(this.index);return this.offset=f,this.index=v,[y].concat(E)}else return[]},t.exports=c},function(t,r){var a=function(){function o(x,_){return _!=null&&x instanceof _}var s;try{s=Map}catch{s=function(){}}var c;try{c=Set}catch{c=function(){}}var m;try{m=Promise}catch{m=function(){}}function f(x,_,b,g,h){typeof _=="object"&&(b=_.depth,g=_.prototype,h=_.includeNonEnumerable,_=_.circular);var d=[],P=[],M=typeof Buffer<"u";typeof _>"u"&&(_=!0),typeof b>"u"&&(b=1/0);function T(I,F){if(I===null)return null;if(F===0)return I;var k,O;if(typeof I!="object")return I;if(o(I,s))k=new s;else if(o(I,c))k=new c;else if(o(I,m))k=new m(function(q,z){I.then(function(Y){q(T(Y,F-1))},function(Y){z(T(Y,F-1))})});else if(f.__isArray(I))k=[];else if(f.__isRegExp(I))k=new RegExp(I.source,S(I)),I.lastIndex&&(k.lastIndex=I.lastIndex);else if(f.__isDate(I))k=new Date(I.getTime());else{if(M&&Buffer.isBuffer(I))return Buffer.allocUnsafe?k=Buffer.allocUnsafe(I.length):k=new Buffer(I.length),I.copy(k),k;o(I,Error)?k=Object.create(I):typeof g>"u"?(O=Object.getPrototypeOf(I),k=Object.create(O)):(k=Object.create(g),O=g)}if(_){var N=d.indexOf(I);if(N!=-1)return P[N];d.push(I),P.push(k)}o(I,s)&&I.forEach(function(q,z){var Y=T(z,F-1),U=T(q,F-1);k.set(Y,U)}),o(I,c)&&I.forEach(function(q){var z=T(q,F-1);k.add(z)});for(var A in I){var R;O&&(R=Object.getOwnPropertyDescriptor(O,A)),!(R&&R.set==null)&&(k[A]=T(I[A],F-1))}if(Object.getOwnPropertySymbols)for(var L=Object.getOwnPropertySymbols(I),A=0;A<L.length;A++){var V=L[A],G=Object.getOwnPropertyDescriptor(I,V);G&&!G.enumerable&&!h||(k[V]=T(I[V],F-1),G.enumerable||Object.defineProperty(k,V,{enumerable:!1}))}if(h)for(var W=Object.getOwnPropertyNames(I),A=0;A<W.length;A++){var X=W[A],G=Object.getOwnPropertyDescriptor(I,X);G&&G.enumerable||(k[X]=T(I[X],F-1),Object.defineProperty(k,X,{enumerable:!1}))}return k}return T(x,b)}f.clonePrototype=function(_){if(_===null)return null;var b=function(){};return b.prototype=_,new b};function v(x){return Object.prototype.toString.call(x)}f.__objToStr=v;function y(x){return typeof x=="object"&&v(x)==="[object Date]"}f.__isDate=y;function E(x){return typeof x=="object"&&v(x)==="[object Array]"}f.__isArray=E;function w(x){return typeof x=="object"&&v(x)==="[object RegExp]"}f.__isRegExp=w;function S(x){var _="";return x.global&&(_+="g"),x.ignoreCase&&(_+="i"),x.multiline&&(_+="m"),_}return f.__getRegExpFlags=S,f}();typeof t=="object"&&t.exports&&(t.exports=a)},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function k(O,N){var A=[],R=!0,L=!1,V=void 0;try{for(var G=O[Symbol.iterator](),W;!(R=(W=G.next()).done)&&(A.push(W.value),!(N&&A.length===N));R=!0);}catch(X){L=!0,V=X}finally{try{!R&&G.return&&G.return()}finally{if(L)throw V}}return A}return function(O,N){if(Array.isArray(O))return O;if(Symbol.iterator in Object(O))return k(O,N);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function k(O,N){for(var A=0;A<N.length;A++){var R=N[A];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(O,R.key,R)}}return function(O,N,A){return N&&k(O.prototype,N),A&&k(O,A),O}}(),c=function k(O,N,A){O===null&&(O=Function.prototype);var R=Object.getOwnPropertyDescriptor(O,N);if(R===void 0){var L=Object.getPrototypeOf(O);return L===null?void 0:k(L,N,A)}else{if("value"in R)return R.value;var V=R.get;return V===void 0?void 0:V.call(A)}},m=a(0),f=d(m),v=a(8),y=d(v),E=a(4),w=d(E),S=a(16),x=d(S),_=a(13),b=d(_),g=a(25),h=d(g);function d(k){return k&&k.__esModule?k:{default:k}}function P(k,O){if(!(k instanceof O))throw new TypeError("Cannot call a class as a function")}function M(k,O){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:k}function T(k,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);k.prototype=Object.create(O&&O.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(k,O):k.__proto__=O)}function I(k){return k instanceof w.default||k instanceof E.BlockEmbed}var F=function(k){T(O,k);function O(N,A){P(this,O);var R=M(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,N));return R.emitter=A.emitter,Array.isArray(A.whitelist)&&(R.whitelist=A.whitelist.reduce(function(L,V){return L[V]=!0,L},{})),R.domNode.addEventListener("DOMNodeInserted",function(){}),R.optimize(),R.enable(),R}return s(O,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(A,R){var L=this.line(A),V=o(L,2),G=V[0],W=V[1],X=this.line(A+R),q=o(X,1),z=q[0];if(c(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"deleteAt",this).call(this,A,R),z!=null&&G!==z&&W>0){if(G instanceof E.BlockEmbed||z instanceof E.BlockEmbed){this.optimize();return}if(G instanceof b.default){var Y=G.newlineIndex(G.length(),!0);if(Y>-1&&(G=G.split(Y+1),G===z)){this.optimize();return}}else if(z instanceof b.default){var U=z.newlineIndex(0);U>-1&&z.split(U+1)}var ee=z.children.head instanceof x.default?null:z.children.head;G.moveChildren(z,ee),G.remove()}this.optimize()}},{key:"enable",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",A)}},{key:"formatAt",value:function(A,R,L,V){this.whitelist!=null&&!this.whitelist[L]||(c(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"formatAt",this).call(this,A,R,L,V),this.optimize())}},{key:"insertAt",value:function(A,R,L){if(!(L!=null&&this.whitelist!=null&&!this.whitelist[R])){if(A>=this.length())if(L==null||f.default.query(R,f.default.Scope.BLOCK)==null){var V=f.default.create(this.statics.defaultChild);this.appendChild(V),L==null&&R.endsWith(`
134
- `)&&(R=R.slice(0,-1)),V.insertAt(0,R,L)}else{var G=f.default.create(R,L);this.appendChild(G)}else c(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertAt",this).call(this,A,R,L);this.optimize()}}},{key:"insertBefore",value:function(A,R){if(A.statics.scope===f.default.Scope.INLINE_BLOT){var L=f.default.create(this.statics.defaultChild);L.appendChild(A),A=L}c(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"insertBefore",this).call(this,A,R)}},{key:"leaf",value:function(A){return this.path(A).pop()||[null,-1]}},{key:"line",value:function(A){return A===this.length()?this.line(A-1):this.descendant(I,A)}},{key:"lines",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,L=function V(G,W,X){var q=[],z=X;return G.children.forEachAt(W,X,function(Y,U,ee){I(Y)?q.push(Y):Y instanceof f.default.Container&&(q=q.concat(V(Y,U,z))),z-=ee}),q};return L(this,A,R)}},{key:"optimize",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(c(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"optimize",this).call(this,A,R),A.length>0&&this.emitter.emit(y.default.events.SCROLL_OPTIMIZE,A,R))}},{key:"path",value:function(A){return c(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"path",this).call(this,A).slice(1)}},{key:"update",value:function(A){if(this.batch!==!0){var R=y.default.sources.USER;typeof A=="string"&&(R=A),Array.isArray(A)||(A=this.observer.takeRecords()),A.length>0&&this.emitter.emit(y.default.events.SCROLL_BEFORE_UPDATE,R,A),c(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"update",this).call(this,A.concat([])),A.length>0&&this.emitter.emit(y.default.events.SCROLL_UPDATE,R,A)}}}]),O}(f.default.Scroll);F.blotName="scroll",F.className="ql-editor",F.tagName="DIV",F.defaultChild="block",F.allowedChildren=[w.default,E.BlockEmbed,h.default],r.default=F},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0}),r.SHORTKEY=r.default=void 0;var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Q){return typeof Q}:function(Q){return Q&&typeof Symbol=="function"&&Q.constructor===Symbol&&Q!==Symbol.prototype?"symbol":typeof Q},s=function(){function Q(Z,re){var ne=[],ae=!0,ue=!1,fe=void 0;try{for(var pe=Z[Symbol.iterator](),ye;!(ae=(ye=pe.next()).done)&&(ne.push(ye.value),!(re&&ne.length===re));ae=!0);}catch(we){ue=!0,fe=we}finally{try{!ae&&pe.return&&pe.return()}finally{if(ue)throw fe}}return ne}return function(Z,re){if(Array.isArray(Z))return Z;if(Symbol.iterator in Object(Z))return Q(Z,re);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function Q(Z,re){for(var ne=0;ne<re.length;ne++){var ae=re[ne];ae.enumerable=ae.enumerable||!1,ae.configurable=!0,"value"in ae&&(ae.writable=!0),Object.defineProperty(Z,ae.key,ae)}}return function(Z,re,ne){return re&&Q(Z.prototype,re),ne&&Q(Z,ne),Z}}(),m=a(21),f=k(m),v=a(11),y=k(v),E=a(3),w=k(E),S=a(2),x=k(S),_=a(20),b=k(_),g=a(0),h=k(g),d=a(5),P=k(d),M=a(10),T=k(M),I=a(9),F=k(I);function k(Q){return Q&&Q.__esModule?Q:{default:Q}}function O(Q,Z,re){return Z in Q?Object.defineProperty(Q,Z,{value:re,enumerable:!0,configurable:!0,writable:!0}):Q[Z]=re,Q}function N(Q,Z){if(!(Q instanceof Z))throw new TypeError("Cannot call a class as a function")}function A(Q,Z){if(!Q)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Z&&(typeof Z=="object"||typeof Z=="function")?Z:Q}function R(Q,Z){if(typeof Z!="function"&&Z!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Z);Q.prototype=Object.create(Z&&Z.prototype,{constructor:{value:Q,enumerable:!1,writable:!0,configurable:!0}}),Z&&(Object.setPrototypeOf?Object.setPrototypeOf(Q,Z):Q.__proto__=Z)}var L=(0,T.default)("quill:keyboard"),V=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",G=function(Q){R(Z,Q),c(Z,null,[{key:"match",value:function(ne,ae){return ae=te(ae),["altKey","ctrlKey","metaKey","shiftKey"].some(function(ue){return!!ae[ue]!==ne[ue]&&ae[ue]!==null})?!1:ae.key===(ne.which||ne.keyCode)}}]);function Z(re,ne){N(this,Z);var ae=A(this,(Z.__proto__||Object.getPrototypeOf(Z)).call(this,re,ne));return ae.bindings={},Object.keys(ae.options.bindings).forEach(function(ue){ue==="list autofill"&&re.scroll.whitelist!=null&&!re.scroll.whitelist.list||ae.options.bindings[ue]&&ae.addBinding(ae.options.bindings[ue])}),ae.addBinding({key:Z.keys.ENTER,shiftKey:null},Y),ae.addBinding({key:Z.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(ae.addBinding({key:Z.keys.BACKSPACE},{collapsed:!0},X),ae.addBinding({key:Z.keys.DELETE},{collapsed:!0},q)):(ae.addBinding({key:Z.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},X),ae.addBinding({key:Z.keys.DELETE},{collapsed:!0,suffix:/^.?$/},q)),ae.addBinding({key:Z.keys.BACKSPACE},{collapsed:!1},z),ae.addBinding({key:Z.keys.DELETE},{collapsed:!1},z),ae.addBinding({key:Z.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},X),ae.listen(),ae}return c(Z,[{key:"addBinding",value:function(ne){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ue=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},fe=te(ne);if(fe==null||fe.key==null)return L.warn("Attempted to add invalid keyboard binding",fe);typeof ae=="function"&&(ae={handler:ae}),typeof ue=="function"&&(ue={handler:ue}),fe=(0,w.default)(fe,ae,ue),this.bindings[fe.key]=this.bindings[fe.key]||[],this.bindings[fe.key].push(fe)}},{key:"listen",value:function(){var ne=this;this.quill.root.addEventListener("keydown",function(ae){if(!ae.defaultPrevented){var ue=ae.which||ae.keyCode,fe=(ne.bindings[ue]||[]).filter(function(Ue){return Z.match(ae,Ue)});if(fe.length!==0){var pe=ne.quill.getSelection();if(!(pe==null||!ne.quill.hasFocus())){var ye=ne.quill.getLine(pe.index),we=s(ye,2),je=we[0],Te=we[1],se=ne.quill.getLeaf(pe.index),_e=s(se,2),he=_e[0],xe=_e[1],oe=pe.length===0?[he,xe]:ne.quill.getLeaf(pe.index+pe.length),ve=s(oe,2),de=ve[0],ke=ve[1],Be=he instanceof h.default.Text?he.value().slice(0,xe):"",Qe=de instanceof h.default.Text?de.value().slice(ke):"",Ke={collapsed:pe.length===0,empty:pe.length===0&&je.length()<=1,format:ne.quill.getFormat(pe),offset:Te,prefix:Be,suffix:Qe},St=fe.some(function(Ue){if(Ue.collapsed!=null&&Ue.collapsed!==Ke.collapsed||Ue.empty!=null&&Ue.empty!==Ke.empty||Ue.offset!=null&&Ue.offset!==Ke.offset)return!1;if(Array.isArray(Ue.format)){if(Ue.format.every(function(rt){return Ke.format[rt]==null}))return!1}else if(o(Ue.format)==="object"&&!Object.keys(Ue.format).every(function(rt){return Ue.format[rt]===!0?Ke.format[rt]!=null:Ue.format[rt]===!1?Ke.format[rt]==null:(0,y.default)(Ue.format[rt],Ke.format[rt])}))return!1;return Ue.prefix!=null&&!Ue.prefix.test(Ke.prefix)||Ue.suffix!=null&&!Ue.suffix.test(Ke.suffix)?!1:Ue.handler.call(ne,pe,Ke)!==!0});St&&ae.preventDefault()}}}})}}]),Z}(F.default);G.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},G.DEFAULTS={bindings:{bold:ee("bold"),italic:ee("italic"),underline:ee("underline"),indent:{key:G.keys.TAB,format:["blockquote","indent","list"],handler:function(Z,re){if(re.collapsed&&re.offset!==0)return!0;this.quill.format("indent","+1",P.default.sources.USER)}},outdent:{key:G.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(Z,re){if(re.collapsed&&re.offset!==0)return!0;this.quill.format("indent","-1",P.default.sources.USER)}},"outdent backspace":{key:G.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(Z,re){re.format.indent!=null?this.quill.format("indent","-1",P.default.sources.USER):re.format.list!=null&&this.quill.format("list",!1,P.default.sources.USER)}},"indent code-block":U(!0),"outdent code-block":U(!1),"remove tab":{key:G.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(Z){this.quill.deleteText(Z.index-1,1,P.default.sources.USER)}},tab:{key:G.keys.TAB,handler:function(Z){this.quill.history.cutoff();var re=new x.default().retain(Z.index).delete(Z.length).insert(" ");this.quill.updateContents(re,P.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(Z.index+1,P.default.sources.SILENT)}},"list empty enter":{key:G.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(Z,re){this.quill.format("list",!1,P.default.sources.USER),re.format.indent&&this.quill.format("indent",!1,P.default.sources.USER)}},"checklist enter":{key:G.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(Z){var re=this.quill.getLine(Z.index),ne=s(re,2),ae=ne[0],ue=ne[1],fe=(0,w.default)({},ae.formats(),{list:"checked"}),pe=new x.default().retain(Z.index).insert(`
135
- `,fe).retain(ae.length()-ue-1).retain(1,{list:"unchecked"});this.quill.updateContents(pe,P.default.sources.USER),this.quill.setSelection(Z.index+1,P.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:G.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(Z,re){var ne=this.quill.getLine(Z.index),ae=s(ne,2),ue=ae[0],fe=ae[1],pe=new x.default().retain(Z.index).insert(`
136
- `,re.format).retain(ue.length()-fe-1).retain(1,{header:null});this.quill.updateContents(pe,P.default.sources.USER),this.quill.setSelection(Z.index+1,P.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(Z,re){var ne=re.prefix.length,ae=this.quill.getLine(Z.index),ue=s(ae,2),fe=ue[0],pe=ue[1];if(pe>ne)return!0;var ye=void 0;switch(re.prefix.trim()){case"[]":case"[ ]":ye="unchecked";break;case"[x]":ye="checked";break;case"-":case"*":ye="bullet";break;default:ye="ordered"}this.quill.insertText(Z.index," ",P.default.sources.USER),this.quill.history.cutoff();var we=new x.default().retain(Z.index-pe).delete(ne+1).retain(fe.length()-2-pe).retain(1,{list:ye});this.quill.updateContents(we,P.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(Z.index-ne,P.default.sources.SILENT)}},"code exit":{key:G.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(Z){var re=this.quill.getLine(Z.index),ne=s(re,2),ae=ne[0],ue=ne[1],fe=new x.default().retain(Z.index+ae.length()-ue-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(fe,P.default.sources.USER)}},"embed left":W(G.keys.LEFT,!1),"embed left shift":W(G.keys.LEFT,!0),"embed right":W(G.keys.RIGHT,!1),"embed right shift":W(G.keys.RIGHT,!0)}};function W(Q,Z){var re,ne=Q===G.keys.LEFT?"prefix":"suffix";return re={key:Q,shiftKey:Z,altKey:null},O(re,ne,/^$/),O(re,"handler",function(ue){var fe=ue.index;Q===G.keys.RIGHT&&(fe+=ue.length+1);var pe=this.quill.getLeaf(fe),ye=s(pe,1),we=ye[0];return we instanceof h.default.Embed?(Q===G.keys.LEFT?Z?this.quill.setSelection(ue.index-1,ue.length+1,P.default.sources.USER):this.quill.setSelection(ue.index-1,P.default.sources.USER):Z?this.quill.setSelection(ue.index,ue.length+1,P.default.sources.USER):this.quill.setSelection(ue.index+ue.length+1,P.default.sources.USER),!1):!0}),re}function X(Q,Z){if(!(Q.index===0||this.quill.getLength()<=1)){var re=this.quill.getLine(Q.index),ne=s(re,1),ae=ne[0],ue={};if(Z.offset===0){var fe=this.quill.getLine(Q.index-1),pe=s(fe,1),ye=pe[0];if(ye!=null&&ye.length()>1){var we=ae.formats(),je=this.quill.getFormat(Q.index-1,1);ue=b.default.attributes.diff(we,je)||{}}}var Te=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(Z.prefix)?2:1;this.quill.deleteText(Q.index-Te,Te,P.default.sources.USER),Object.keys(ue).length>0&&this.quill.formatLine(Q.index-Te,Te,ue,P.default.sources.USER),this.quill.focus()}}function q(Q,Z){var re=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(Z.suffix)?2:1;if(!(Q.index>=this.quill.getLength()-re)){var ne={},ae=0,ue=this.quill.getLine(Q.index),fe=s(ue,1),pe=fe[0];if(Z.offset>=pe.length()-1){var ye=this.quill.getLine(Q.index+1),we=s(ye,1),je=we[0];if(je){var Te=pe.formats(),se=this.quill.getFormat(Q.index,1);ne=b.default.attributes.diff(Te,se)||{},ae=je.length()}}this.quill.deleteText(Q.index,re,P.default.sources.USER),Object.keys(ne).length>0&&this.quill.formatLine(Q.index+ae-1,re,ne,P.default.sources.USER)}}function z(Q){var Z=this.quill.getLines(Q),re={};if(Z.length>1){var ne=Z[0].formats(),ae=Z[Z.length-1].formats();re=b.default.attributes.diff(ae,ne)||{}}this.quill.deleteText(Q,P.default.sources.USER),Object.keys(re).length>0&&this.quill.formatLine(Q.index,1,re,P.default.sources.USER),this.quill.setSelection(Q.index,P.default.sources.SILENT),this.quill.focus()}function Y(Q,Z){var re=this;Q.length>0&&this.quill.scroll.deleteAt(Q.index,Q.length);var ne=Object.keys(Z.format).reduce(function(ae,ue){return h.default.query(ue,h.default.Scope.BLOCK)&&!Array.isArray(Z.format[ue])&&(ae[ue]=Z.format[ue]),ae},{});this.quill.insertText(Q.index,`
137
- `,ne,P.default.sources.USER),this.quill.setSelection(Q.index+1,P.default.sources.SILENT),this.quill.focus(),Object.keys(Z.format).forEach(function(ae){ne[ae]==null&&(Array.isArray(Z.format[ae])||ae!=="link"&&re.quill.format(ae,Z.format[ae],P.default.sources.USER))})}function U(Q){return{key:G.keys.TAB,shiftKey:!Q,format:{"code-block":!0},handler:function(re){var ne=h.default.query("code-block"),ae=re.index,ue=re.length,fe=this.quill.scroll.descendant(ne,ae),pe=s(fe,2),ye=pe[0],we=pe[1];if(ye!=null){var je=this.quill.getIndex(ye),Te=ye.newlineIndex(we,!0)+1,se=ye.newlineIndex(je+we+ue),_e=ye.domNode.textContent.slice(Te,se).split(`
138
- `);we=0,_e.forEach(function(he,xe){Q?(ye.insertAt(Te+we,ne.TAB),we+=ne.TAB.length,xe===0?ae+=ne.TAB.length:ue+=ne.TAB.length):he.startsWith(ne.TAB)&&(ye.deleteAt(Te+we,ne.TAB.length),we-=ne.TAB.length,xe===0?ae-=ne.TAB.length:ue-=ne.TAB.length),we+=he.length+1}),this.quill.update(P.default.sources.USER),this.quill.setSelection(ae,ue,P.default.sources.SILENT)}}}}function ee(Q){return{key:Q[0].toUpperCase(),shortKey:!0,handler:function(re,ne){this.quill.format(Q,!ne.format[Q],P.default.sources.USER)}}}function te(Q){if(typeof Q=="string"||typeof Q=="number")return te({key:Q});if((typeof Q>"u"?"undefined":o(Q))==="object"&&(Q=(0,f.default)(Q,!1)),typeof Q.key=="string")if(G.keys[Q.key.toUpperCase()]!=null)Q.key=G.keys[Q.key.toUpperCase()];else if(Q.key.length===1)Q.key=Q.key.toUpperCase().charCodeAt(0);else return null;return Q.shortKey&&(Q[V]=Q.shortKey,delete Q.shortKey),Q}r.default=G,r.SHORTKEY=V},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function b(g,h){var d=[],P=!0,M=!1,T=void 0;try{for(var I=g[Symbol.iterator](),F;!(P=(F=I.next()).done)&&(d.push(F.value),!(h&&d.length===h));P=!0);}catch(k){M=!0,T=k}finally{try{!P&&I.return&&I.return()}finally{if(M)throw T}}return d}return function(g,h){if(Array.isArray(g))return g;if(Symbol.iterator in Object(g))return b(g,h);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function b(g,h,d){g===null&&(g=Function.prototype);var P=Object.getOwnPropertyDescriptor(g,h);if(P===void 0){var M=Object.getPrototypeOf(g);return M===null?void 0:b(M,h,d)}else{if("value"in P)return P.value;var T=P.get;return T===void 0?void 0:T.call(d)}},c=function(){function b(g,h){for(var d=0;d<h.length;d++){var P=h[d];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(g,P.key,P)}}return function(g,h,d){return h&&b(g.prototype,h),d&&b(g,d),g}}(),m=a(0),f=E(m),v=a(7),y=E(v);function E(b){return b&&b.__esModule?b:{default:b}}function w(b,g){if(!(b instanceof g))throw new TypeError("Cannot call a class as a function")}function S(b,g){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:b}function x(b,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);b.prototype=Object.create(g&&g.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(b,g):b.__proto__=g)}var _=function(b){x(g,b),c(g,null,[{key:"value",value:function(){}}]);function g(h,d){w(this,g);var P=S(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,h));return P.selection=d,P.textNode=document.createTextNode(g.CONTENTS),P.domNode.appendChild(P.textNode),P._length=0,P}return c(g,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(d,P){if(this._length!==0)return s(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"format",this).call(this,d,P);for(var M=this,T=0;M!=null&&M.statics.scope!==f.default.Scope.BLOCK_BLOT;)T+=M.offset(M.parent),M=M.parent;M!=null&&(this._length=g.CONTENTS.length,M.optimize(),M.formatAt(T,g.CONTENTS.length,d,P),this._length=0)}},{key:"index",value:function(d,P){return d===this.textNode?0:s(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"index",this).call(this,d,P)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){s(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var d=this.textNode,P=this.selection.getNativeRange(),M=void 0,T=void 0,I=void 0;if(P!=null&&P.start.node===d&&P.end.node===d){var F=[d,P.start.offset,P.end.offset];M=F[0],T=F[1],I=F[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==g.CONTENTS){var k=this.textNode.data.split(g.CONTENTS).join("");this.next instanceof y.default?(M=this.next.domNode,this.next.insertAt(0,k),this.textNode.data=g.CONTENTS):(this.textNode.data=k,this.parent.insertBefore(f.default.create(this.textNode),this),this.textNode=document.createTextNode(g.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),T!=null){var O=[T,I].map(function(A){return Math.max(0,Math.min(M.data.length,A-1))}),N=o(O,2);return T=N[0],I=N[1],{startNode:M,startOffset:T,endNode:M,endOffset:I}}}}},{key:"update",value:function(d,P){var M=this;if(d.some(function(I){return I.type==="characterData"&&I.target===M.textNode})){var T=this.restore();T&&(P.range=T)}}},{key:"value",value:function(){return""}}]),g}(f.default.Embed);_.blotName="cursor",_.className="ql-cursor",_.tagName="span",_.CONTENTS="\uFEFF",r.default=_},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=a(0),s=f(o),c=a(4),m=f(c);function f(S){return S&&S.__esModule?S:{default:S}}function v(S,x){if(!(S instanceof x))throw new TypeError("Cannot call a class as a function")}function y(S,x){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:S}function E(S,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);S.prototype=Object.create(x&&x.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(S,x):S.__proto__=x)}var w=function(S){E(x,S);function x(){return v(this,x),y(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return x}(s.default.Container);w.allowedChildren=[m.default,c.BlockEmbed,w],r.default=w},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0}),r.ColorStyle=r.ColorClass=r.ColorAttributor=void 0;var o=function(){function _(b,g){for(var h=0;h<g.length;h++){var d=g[h];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(b,d.key,d)}}return function(b,g,h){return g&&_(b.prototype,g),h&&_(b,h),b}}(),s=function _(b,g,h){b===null&&(b=Function.prototype);var d=Object.getOwnPropertyDescriptor(b,g);if(d===void 0){var P=Object.getPrototypeOf(b);return P===null?void 0:_(P,g,h)}else{if("value"in d)return d.value;var M=d.get;return M===void 0?void 0:M.call(h)}},c=a(0),m=f(c);function f(_){return _&&_.__esModule?_:{default:_}}function v(_,b){if(!(_ instanceof b))throw new TypeError("Cannot call a class as a function")}function y(_,b){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:_}function E(_,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);_.prototype=Object.create(b&&b.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(_,b):_.__proto__=b)}var w=function(_){E(b,_);function b(){return v(this,b),y(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return o(b,[{key:"value",value:function(h){var d=s(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"value",this).call(this,h);return d.startsWith("rgb(")?(d=d.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+d.split(",").map(function(P){return("00"+parseInt(P).toString(16)).slice(-2)}).join("")):d}}]),b}(m.default.Attributor.Style),S=new m.default.Attributor.Class("color","ql-color",{scope:m.default.Scope.INLINE}),x=new w("color","color",{scope:m.default.Scope.INLINE});r.ColorAttributor=w,r.ColorClass=S,r.ColorStyle=x},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0}),r.sanitize=r.default=void 0;var o=function(){function x(_,b){for(var g=0;g<b.length;g++){var h=b[g];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(_,h.key,h)}}return function(_,b,g){return b&&x(_.prototype,b),g&&x(_,g),_}}(),s=function x(_,b,g){_===null&&(_=Function.prototype);var h=Object.getOwnPropertyDescriptor(_,b);if(h===void 0){var d=Object.getPrototypeOf(_);return d===null?void 0:x(d,b,g)}else{if("value"in h)return h.value;var P=h.get;return P===void 0?void 0:P.call(g)}},c=a(6),m=f(c);function f(x){return x&&x.__esModule?x:{default:x}}function v(x,_){if(!(x instanceof _))throw new TypeError("Cannot call a class as a function")}function y(x,_){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:x}function E(x,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);x.prototype=Object.create(_&&_.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(x,_):x.__proto__=_)}var w=function(x){E(_,x);function _(){return v(this,_),y(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return o(_,[{key:"format",value:function(g,h){if(g!==this.statics.blotName||!h)return s(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"format",this).call(this,g,h);h=this.constructor.sanitize(h),this.domNode.setAttribute("href",h)}}],[{key:"create",value:function(g){var h=s(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this,g);return g=this.sanitize(g),h.setAttribute("href",g),h.setAttribute("rel","noopener noreferrer"),h.setAttribute("target","_blank"),h}},{key:"formats",value:function(g){return g.getAttribute("href")}},{key:"sanitize",value:function(g){return S(g,this.PROTOCOL_WHITELIST)?g:this.SANITIZED_URL}}]),_}(m.default);w.blotName="link",w.tagName="A",w.SANITIZED_URL="about:blank",w.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function S(x,_){var b=document.createElement("a");b.href=x;var g=b.href.slice(0,b.href.indexOf(":"));return _.indexOf(g)>-1}r.default=w,r.sanitize=S},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(_){return typeof _}:function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},s=function(){function _(b,g){for(var h=0;h<g.length;h++){var d=g[h];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(b,d.key,d)}}return function(b,g,h){return g&&_(b.prototype,g),h&&_(b,h),b}}(),c=a(23),m=y(c),f=a(107),v=y(f);function y(_){return _&&_.__esModule?_:{default:_}}function E(_,b){if(!(_ instanceof b))throw new TypeError("Cannot call a class as a function")}var w=0;function S(_,b){_.setAttribute(b,_.getAttribute(b)!=="true")}var x=function(){function _(b){var g=this;E(this,_),this.select=b,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(){g.togglePicker()}),this.label.addEventListener("keydown",function(h){switch(h.keyCode){case m.default.keys.ENTER:g.togglePicker();break;case m.default.keys.ESCAPE:g.escape(),h.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return s(_,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),S(this.label,"aria-expanded"),S(this.options,"aria-hidden")}},{key:"buildItem",value:function(g){var h=this,d=document.createElement("span");return d.tabIndex="0",d.setAttribute("role","button"),d.classList.add("ql-picker-item"),g.hasAttribute("value")&&d.setAttribute("data-value",g.getAttribute("value")),g.textContent&&d.setAttribute("data-label",g.textContent),d.addEventListener("click",function(){h.selectItem(d,!0)}),d.addEventListener("keydown",function(P){switch(P.keyCode){case m.default.keys.ENTER:h.selectItem(d,!0),P.preventDefault();break;case m.default.keys.ESCAPE:h.escape(),P.preventDefault();break}}),d}},{key:"buildLabel",value:function(){var g=document.createElement("span");return g.classList.add("ql-picker-label"),g.innerHTML=v.default,g.tabIndex="0",g.setAttribute("role","button"),g.setAttribute("aria-expanded","false"),this.container.appendChild(g),g}},{key:"buildOptions",value:function(){var g=this,h=document.createElement("span");h.classList.add("ql-picker-options"),h.setAttribute("aria-hidden","true"),h.tabIndex="-1",h.id="ql-picker-options-"+w,w+=1,this.label.setAttribute("aria-controls",h.id),this.options=h,[].slice.call(this.select.options).forEach(function(d){var P=g.buildItem(d);h.appendChild(P),d.selected===!0&&g.selectItem(P)}),this.container.appendChild(h)}},{key:"buildPicker",value:function(){var g=this;[].slice.call(this.select.attributes).forEach(function(h){g.container.setAttribute(h.name,h.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var g=this;this.close(),setTimeout(function(){return g.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(g){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=this.container.querySelector(".ql-selected");if(g!==d&&(d!=null&&d.classList.remove("ql-selected"),g!=null&&(g.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(g.parentNode.children,g),g.hasAttribute("data-value")?this.label.setAttribute("data-value",g.getAttribute("data-value")):this.label.removeAttribute("data-value"),g.hasAttribute("data-label")?this.label.setAttribute("data-label",g.getAttribute("data-label")):this.label.removeAttribute("data-label"),h))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":o(Event))==="object"){var P=document.createEvent("Event");P.initEvent("change",!0,!0),this.select.dispatchEvent(P)}this.close()}}},{key:"update",value:function(){var g=void 0;if(this.select.selectedIndex>-1){var h=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];g=this.select.options[this.select.selectedIndex],this.selectItem(h)}else this.selectItem(null);var d=g!=null&&g!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",d)}}]),_}();r.default=x},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=a(0),s=L(o),c=a(5),m=L(c),f=a(4),v=L(f),y=a(16),E=L(y),w=a(25),S=L(w),x=a(24),_=L(x),b=a(35),g=L(b),h=a(6),d=L(h),P=a(22),M=L(P),T=a(7),I=L(T),F=a(55),k=L(F),O=a(42),N=L(O),A=a(23),R=L(A);function L(V){return V&&V.__esModule?V:{default:V}}m.default.register({"blots/block":v.default,"blots/block/embed":f.BlockEmbed,"blots/break":E.default,"blots/container":S.default,"blots/cursor":_.default,"blots/embed":g.default,"blots/inline":d.default,"blots/scroll":M.default,"blots/text":I.default,"modules/clipboard":k.default,"modules/history":N.default,"modules/keyboard":R.default}),s.default.register(v.default,E.default,_.default,d.default,M.default,I.default),r.default=m.default},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=a(1),s=function(){function c(m){this.domNode=m,this.domNode[o.DATA_KEY]={blot:this}}return Object.defineProperty(c.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),c.create=function(m){if(this.tagName==null)throw new o.ParchmentError("Blot definition missing tagName");var f;return Array.isArray(this.tagName)?(typeof m=="string"&&(m=m.toUpperCase(),parseInt(m).toString()===m&&(m=parseInt(m))),typeof m=="number"?f=document.createElement(this.tagName[m-1]):this.tagName.indexOf(m)>-1?f=document.createElement(m):f=document.createElement(this.tagName[0])):f=document.createElement(this.tagName),this.className&&f.classList.add(this.className),f},c.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},c.prototype.clone=function(){var m=this.domNode.cloneNode(!1);return o.create(m)},c.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[o.DATA_KEY]},c.prototype.deleteAt=function(m,f){var v=this.isolate(m,f);v.remove()},c.prototype.formatAt=function(m,f,v,y){var E=this.isolate(m,f);if(o.query(v,o.Scope.BLOT)!=null&&y)E.wrap(v,y);else if(o.query(v,o.Scope.ATTRIBUTE)!=null){var w=o.create(this.statics.scope);E.wrap(w),w.format(v,y)}},c.prototype.insertAt=function(m,f,v){var y=v==null?o.create("text",f):o.create(f,v),E=this.split(m);this.parent.insertBefore(y,E)},c.prototype.insertInto=function(m,f){f===void 0&&(f=null),this.parent!=null&&this.parent.children.remove(this);var v=null;m.children.insertBefore(this,f),f!=null&&(v=f.domNode),(this.domNode.parentNode!=m.domNode||this.domNode.nextSibling!=v)&&m.domNode.insertBefore(this.domNode,v),this.parent=m,this.attach()},c.prototype.isolate=function(m,f){var v=this.split(m);return v.split(f),v},c.prototype.length=function(){return 1},c.prototype.offset=function(m){return m===void 0&&(m=this.parent),this.parent==null||this==m?0:this.parent.children.offset(this)+this.parent.offset(m)},c.prototype.optimize=function(m){this.domNode[o.DATA_KEY]!=null&&delete this.domNode[o.DATA_KEY].mutations},c.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},c.prototype.replace=function(m){m.parent!=null&&(m.parent.insertBefore(this,m.next),m.remove())},c.prototype.replaceWith=function(m,f){var v=typeof m=="string"?o.create(m,f):m;return v.replace(this),v},c.prototype.split=function(m,f){return m===0?this:this.next},c.prototype.update=function(m,f){},c.prototype.wrap=function(m,f){var v=typeof m=="string"?o.create(m,f):m;return this.parent!=null&&this.parent.insertBefore(v,this.next),v.appendChild(this),v},c.blotName="abstract",c}();r.default=s},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=a(12),s=a(32),c=a(33),m=a(1),f=function(){function v(y){this.attributes={},this.domNode=y,this.build()}return v.prototype.attribute=function(y,E){E?y.add(this.domNode,E)&&(y.value(this.domNode)!=null?this.attributes[y.attrName]=y:delete this.attributes[y.attrName]):(y.remove(this.domNode),delete this.attributes[y.attrName])},v.prototype.build=function(){var y=this;this.attributes={};var E=o.default.keys(this.domNode),w=s.default.keys(this.domNode),S=c.default.keys(this.domNode);E.concat(w).concat(S).forEach(function(x){var _=m.query(x,m.Scope.ATTRIBUTE);_ instanceof o.default&&(y.attributes[_.attrName]=_)})},v.prototype.copy=function(y){var E=this;Object.keys(this.attributes).forEach(function(w){var S=E.attributes[w].value(E.domNode);y.format(w,S)})},v.prototype.move=function(y){var E=this;this.copy(y),Object.keys(this.attributes).forEach(function(w){E.attributes[w].remove(E.domNode)}),this.attributes={}},v.prototype.values=function(){var y=this;return Object.keys(this.attributes).reduce(function(E,w){return E[w]=y.attributes[w].value(y.domNode),E},{})},v}();r.default=f},function(t,r,a){var o=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,y){v.__proto__=y}||function(v,y){for(var E in y)y.hasOwnProperty(E)&&(v[E]=y[E])};return function(v,y){f(v,y);function E(){this.constructor=v}v.prototype=y===null?Object.create(y):(E.prototype=y.prototype,new E)}}();Object.defineProperty(r,"__esModule",{value:!0});var s=a(12);function c(f,v){var y=f.getAttribute("class")||"";return y.split(/\s+/).filter(function(E){return E.indexOf(v+"-")===0})}var m=function(f){o(v,f);function v(){return f!==null&&f.apply(this,arguments)||this}return v.keys=function(y){return(y.getAttribute("class")||"").split(/\s+/).map(function(E){return E.split("-").slice(0,-1).join("-")})},v.prototype.add=function(y,E){return this.canAdd(y,E)?(this.remove(y),y.classList.add(this.keyName+"-"+E),!0):!1},v.prototype.remove=function(y){var E=c(y,this.keyName);E.forEach(function(w){y.classList.remove(w)}),y.classList.length===0&&y.removeAttribute("class")},v.prototype.value=function(y){var E=c(y,this.keyName)[0]||"",w=E.slice(this.keyName.length+1);return this.canAdd(y,w)?w:""},v}(s.default);r.default=m},function(t,r,a){var o=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,y){v.__proto__=y}||function(v,y){for(var E in y)y.hasOwnProperty(E)&&(v[E]=y[E])};return function(v,y){f(v,y);function E(){this.constructor=v}v.prototype=y===null?Object.create(y):(E.prototype=y.prototype,new E)}}();Object.defineProperty(r,"__esModule",{value:!0});var s=a(12);function c(f){var v=f.split("-"),y=v.slice(1).map(function(E){return E[0].toUpperCase()+E.slice(1)}).join("");return v[0]+y}var m=function(f){o(v,f);function v(){return f!==null&&f.apply(this,arguments)||this}return v.keys=function(y){return(y.getAttribute("style")||"").split(";").map(function(E){var w=E.split(":");return w[0].trim()})},v.prototype.add=function(y,E){return this.canAdd(y,E)?(y.style[c(this.keyName)]=E,!0):!1},v.prototype.remove=function(y){y.style[c(this.keyName)]="",y.getAttribute("style")||y.removeAttribute("style")},v.prototype.value=function(y){var E=y.style[c(this.keyName)];return this.canAdd(y,E)?E:""},v}(s.default);r.default=m},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function m(f,v){for(var y=0;y<v.length;y++){var E=v[y];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(f,E.key,E)}}return function(f,v,y){return v&&m(f.prototype,v),y&&m(f,y),f}}();function s(m,f){if(!(m instanceof f))throw new TypeError("Cannot call a class as a function")}var c=function(){function m(f,v){s(this,m),this.quill=f,this.options=v,this.modules={}}return o(m,[{key:"init",value:function(){var v=this;Object.keys(this.options.modules).forEach(function(y){v.modules[y]==null&&v.addModule(y)})}},{key:"addModule",value:function(v){var y=this.quill.constructor.import("modules/"+v);return this.modules[v]=new y(this.quill,this.options.modules[v]||{}),this.modules[v]}}]),m}();c.DEFAULTS={modules:{}},c.themes={default:c},r.default=c},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function b(g,h){for(var d=0;d<h.length;d++){var P=h[d];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(g,P.key,P)}}return function(g,h,d){return h&&b(g.prototype,h),d&&b(g,d),g}}(),s=function b(g,h,d){g===null&&(g=Function.prototype);var P=Object.getOwnPropertyDescriptor(g,h);if(P===void 0){var M=Object.getPrototypeOf(g);return M===null?void 0:b(M,h,d)}else{if("value"in P)return P.value;var T=P.get;return T===void 0?void 0:T.call(d)}},c=a(0),m=y(c),f=a(7),v=y(f);function y(b){return b&&b.__esModule?b:{default:b}}function E(b,g){if(!(b instanceof g))throw new TypeError("Cannot call a class as a function")}function w(b,g){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:b}function S(b,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);b.prototype=Object.create(g&&g.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(b,g):b.__proto__=g)}var x="\uFEFF",_=function(b){S(g,b);function g(h){E(this,g);var d=w(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,h));return d.contentNode=document.createElement("span"),d.contentNode.setAttribute("contenteditable",!1),[].slice.call(d.domNode.childNodes).forEach(function(P){d.contentNode.appendChild(P)}),d.leftGuard=document.createTextNode(x),d.rightGuard=document.createTextNode(x),d.domNode.appendChild(d.leftGuard),d.domNode.appendChild(d.contentNode),d.domNode.appendChild(d.rightGuard),d}return o(g,[{key:"index",value:function(d,P){return d===this.leftGuard?0:d===this.rightGuard?1:s(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"index",this).call(this,d,P)}},{key:"restore",value:function(d){var P=void 0,M=void 0,T=d.data.split(x).join("");if(d===this.leftGuard)if(this.prev instanceof v.default){var I=this.prev.length();this.prev.insertAt(I,T),P={startNode:this.prev.domNode,startOffset:I+T.length}}else M=document.createTextNode(T),this.parent.insertBefore(m.default.create(M),this),P={startNode:M,startOffset:T.length};else d===this.rightGuard&&(this.next instanceof v.default?(this.next.insertAt(0,T),P={startNode:this.next.domNode,startOffset:T.length}):(M=document.createTextNode(T),this.parent.insertBefore(m.default.create(M),this.next),P={startNode:M,startOffset:T.length}));return d.data=x,P}},{key:"update",value:function(d,P){var M=this;d.forEach(function(T){if(T.type==="characterData"&&(T.target===M.leftGuard||T.target===M.rightGuard)){var I=M.restore(T.target);I&&(P.range=I)}})}}]),g}(m.default.Embed);r.default=_},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0}),r.AlignStyle=r.AlignClass=r.AlignAttribute=void 0;var o=a(0),s=c(o);function c(E){return E&&E.__esModule?E:{default:E}}var m={scope:s.default.Scope.BLOCK,whitelist:["right","center","justify"]},f=new s.default.Attributor.Attribute("align","align",m),v=new s.default.Attributor.Class("align","ql-align",m),y=new s.default.Attributor.Style("align","text-align",m);r.AlignAttribute=f,r.AlignClass=v,r.AlignStyle=y},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0}),r.BackgroundStyle=r.BackgroundClass=void 0;var o=a(0),s=m(o),c=a(26);function m(y){return y&&y.__esModule?y:{default:y}}var f=new s.default.Attributor.Class("background","ql-bg",{scope:s.default.Scope.INLINE}),v=new c.ColorAttributor("background","background-color",{scope:s.default.Scope.INLINE});r.BackgroundClass=f,r.BackgroundStyle=v},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0}),r.DirectionStyle=r.DirectionClass=r.DirectionAttribute=void 0;var o=a(0),s=c(o);function c(E){return E&&E.__esModule?E:{default:E}}var m={scope:s.default.Scope.BLOCK,whitelist:["rtl"]},f=new s.default.Attributor.Attribute("direction","dir",m),v=new s.default.Attributor.Class("direction","ql-direction",m),y=new s.default.Attributor.Style("direction","direction",m);r.DirectionAttribute=f,r.DirectionClass=v,r.DirectionStyle=y},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0}),r.FontClass=r.FontStyle=void 0;var o=function(){function b(g,h){for(var d=0;d<h.length;d++){var P=h[d];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(g,P.key,P)}}return function(g,h,d){return h&&b(g.prototype,h),d&&b(g,d),g}}(),s=function b(g,h,d){g===null&&(g=Function.prototype);var P=Object.getOwnPropertyDescriptor(g,h);if(P===void 0){var M=Object.getPrototypeOf(g);return M===null?void 0:b(M,h,d)}else{if("value"in P)return P.value;var T=P.get;return T===void 0?void 0:T.call(d)}},c=a(0),m=f(c);function f(b){return b&&b.__esModule?b:{default:b}}function v(b,g){if(!(b instanceof g))throw new TypeError("Cannot call a class as a function")}function y(b,g){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:b}function E(b,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);b.prototype=Object.create(g&&g.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(b,g):b.__proto__=g)}var w={scope:m.default.Scope.INLINE,whitelist:["serif","monospace"]},S=new m.default.Attributor.Class("font","ql-font",w),x=function(b){E(g,b);function g(){return v(this,g),y(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return o(g,[{key:"value",value:function(d){return s(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"value",this).call(this,d).replace(/["']/g,"")}}]),g}(m.default.Attributor.Style),_=new x("font","font-family",w);r.FontStyle=_,r.FontClass=S},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0}),r.SizeStyle=r.SizeClass=void 0;var o=a(0),s=c(o);function c(v){return v&&v.__esModule?v:{default:v}}var m=new s.default.Attributor.Class("size","ql-size",{scope:s.default.Scope.INLINE,whitelist:["small","large","huge"]}),f=new s.default.Attributor.Style("size","font-size",{scope:s.default.Scope.INLINE,whitelist:["10px","18px","32px"]});r.SizeClass=m,r.SizeStyle=f},function(t,r,a){t.exports={align:{"":a(76),center:a(77),right:a(78),justify:a(79)},background:a(80),blockquote:a(81),bold:a(82),clean:a(83),code:a(58),"code-block":a(58),color:a(84),direction:{"":a(85),rtl:a(86)},float:{center:a(87),full:a(88),left:a(89),right:a(90)},formula:a(91),header:{1:a(92),2:a(93)},italic:a(94),image:a(95),indent:{"+1":a(96),"-1":a(97)},link:a(98),list:{ordered:a(99),bullet:a(100),check:a(101)},script:{sub:a(102),super:a(103)},strike:a(104),underline:a(105),video:a(106)}},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0}),r.getLastChangeIndex=r.default=void 0;var o=function(){function h(d,P){for(var M=0;M<P.length;M++){var T=P[M];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(d,T.key,T)}}return function(d,P,M){return P&&h(d.prototype,P),M&&h(d,M),d}}(),s=a(0),c=E(s),m=a(5),f=E(m),v=a(9),y=E(v);function E(h){return h&&h.__esModule?h:{default:h}}function w(h,d){if(!(h instanceof d))throw new TypeError("Cannot call a class as a function")}function S(h,d){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:h}function x(h,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);h.prototype=Object.create(d&&d.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(h,d):h.__proto__=d)}var _=function(h){x(d,h);function d(P,M){w(this,d);var T=S(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,P,M));return T.lastRecorded=0,T.ignoreChange=!1,T.clear(),T.quill.on(f.default.events.EDITOR_CHANGE,function(I,F,k,O){I!==f.default.events.TEXT_CHANGE||T.ignoreChange||(!T.options.userOnly||O===f.default.sources.USER?T.record(F,k):T.transform(F))}),T.quill.keyboard.addBinding({key:"Z",shortKey:!0},T.undo.bind(T)),T.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},T.redo.bind(T)),/Win/i.test(navigator.platform)&&T.quill.keyboard.addBinding({key:"Y",shortKey:!0},T.redo.bind(T)),T}return o(d,[{key:"change",value:function(M,T){if(this.stack[M].length!==0){var I=this.stack[M].pop();this.stack[T].push(I),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(I[M],f.default.sources.USER),this.ignoreChange=!1;var F=g(I[M]);this.quill.setSelection(F)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(M,T){if(M.ops.length!==0){this.stack.redo=[];var I=this.quill.getContents().diff(T),F=Date.now();if(this.lastRecorded+this.options.delay>F&&this.stack.undo.length>0){var k=this.stack.undo.pop();I=I.compose(k.undo),M=k.redo.compose(M)}else this.lastRecorded=F;this.stack.undo.push({redo:M,undo:I}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(M){this.stack.undo.forEach(function(T){T.undo=M.transform(T.undo,!0),T.redo=M.transform(T.redo,!0)}),this.stack.redo.forEach(function(T){T.undo=M.transform(T.undo,!0),T.redo=M.transform(T.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),d}(y.default);_.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function b(h){var d=h.ops[h.ops.length-1];return d==null?!1:d.insert!=null?typeof d.insert=="string"&&d.insert.endsWith(`
139
- `):d.attributes!=null?Object.keys(d.attributes).some(function(P){return c.default.query(P,c.default.Scope.BLOCK)!=null}):!1}function g(h){var d=h.reduce(function(M,T){return M+=T.delete||0,M},0),P=h.length()-d;return b(h)&&(P-=1),P}r.default=_,r.getLastChangeIndex=g},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.BaseTooltip=void 0;var o=function(){function Y(U,ee){for(var te=0;te<ee.length;te++){var Q=ee[te];Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q&&(Q.writable=!0),Object.defineProperty(U,Q.key,Q)}}return function(U,ee,te){return ee&&Y(U.prototype,ee),te&&Y(U,te),U}}(),s=function Y(U,ee,te){U===null&&(U=Function.prototype);var Q=Object.getOwnPropertyDescriptor(U,ee);if(Q===void 0){var Z=Object.getPrototypeOf(U);return Z===null?void 0:Y(Z,ee,te)}else{if("value"in Q)return Q.value;var re=Q.get;return re===void 0?void 0:re.call(te)}},c=a(3),m=F(c),f=a(2),v=F(f),y=a(8),E=F(y),w=a(23),S=F(w),x=a(34),_=F(x),b=a(59),g=F(b),h=a(60),d=F(h),P=a(28),M=F(P),T=a(61),I=F(T);function F(Y){return Y&&Y.__esModule?Y:{default:Y}}function k(Y,U){if(!(Y instanceof U))throw new TypeError("Cannot call a class as a function")}function O(Y,U){if(!Y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return U&&(typeof U=="object"||typeof U=="function")?U:Y}function N(Y,U){if(typeof U!="function"&&U!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof U);Y.prototype=Object.create(U&&U.prototype,{constructor:{value:Y,enumerable:!1,writable:!0,configurable:!0}}),U&&(Object.setPrototypeOf?Object.setPrototypeOf(Y,U):Y.__proto__=U)}var A=[!1,"center","right","justify"],R=["#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"],L=[!1,"serif","monospace"],V=["1","2","3",!1],G=["small",!1,"large","huge"],W=function(Y){N(U,Y);function U(ee,te){k(this,U);var Q=O(this,(U.__proto__||Object.getPrototypeOf(U)).call(this,ee,te)),Z=function re(ne){if(!document.body.contains(ee.root))return document.body.removeEventListener("click",re);Q.tooltip!=null&&!Q.tooltip.root.contains(ne.target)&&document.activeElement!==Q.tooltip.textbox&&!Q.quill.hasFocus()&&Q.tooltip.hide(),Q.pickers!=null&&Q.pickers.forEach(function(ae){ae.container.contains(ne.target)||ae.close()})};return ee.emitter.listenDOM("click",document.body,Z),Q}return o(U,[{key:"addModule",value:function(te){var Q=s(U.prototype.__proto__||Object.getPrototypeOf(U.prototype),"addModule",this).call(this,te);return te==="toolbar"&&this.extendToolbar(Q),Q}},{key:"buildButtons",value:function(te,Q){te.forEach(function(Z){var re=Z.getAttribute("class")||"";re.split(/\s+/).forEach(function(ne){if(ne.startsWith("ql-")&&(ne=ne.slice(3),Q[ne]!=null))if(ne==="direction")Z.innerHTML=Q[ne][""]+Q[ne].rtl;else if(typeof Q[ne]=="string")Z.innerHTML=Q[ne];else{var ae=Z.value||"";ae!=null&&Q[ne][ae]&&(Z.innerHTML=Q[ne][ae])}})})}},{key:"buildPickers",value:function(te,Q){var Z=this;this.pickers=te.map(function(ne){if(ne.classList.contains("ql-align"))return ne.querySelector("option")==null&&z(ne,A),new d.default(ne,Q.align);if(ne.classList.contains("ql-background")||ne.classList.contains("ql-color")){var ae=ne.classList.contains("ql-background")?"background":"color";return ne.querySelector("option")==null&&z(ne,R,ae==="background"?"#ffffff":"#000000"),new g.default(ne,Q[ae])}else return ne.querySelector("option")==null&&(ne.classList.contains("ql-font")?z(ne,L):ne.classList.contains("ql-header")?z(ne,V):ne.classList.contains("ql-size")&&z(ne,G)),new M.default(ne)});var re=function(){Z.pickers.forEach(function(ae){ae.update()})};this.quill.on(E.default.events.EDITOR_CHANGE,re)}}]),U}(_.default);W.DEFAULTS=(0,m.default)(!0,{},_.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var U=this,ee=this.container.querySelector("input.ql-image[type=file]");ee==null&&(ee=document.createElement("input"),ee.setAttribute("type","file"),ee.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),ee.classList.add("ql-image"),ee.addEventListener("change",function(){if(ee.files!=null&&ee.files[0]!=null){var te=new FileReader;te.onload=function(Q){var Z=U.quill.getSelection(!0);U.quill.updateContents(new v.default().retain(Z.index).delete(Z.length).insert({image:Q.target.result}),E.default.sources.USER),U.quill.setSelection(Z.index+1,E.default.sources.SILENT),ee.value=""},te.readAsDataURL(ee.files[0])}}),this.container.appendChild(ee)),ee.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var X=function(Y){N(U,Y);function U(ee,te){k(this,U);var Q=O(this,(U.__proto__||Object.getPrototypeOf(U)).call(this,ee,te));return Q.textbox=Q.root.querySelector('input[type="text"]'),Q.listen(),Q}return o(U,[{key:"listen",value:function(){var te=this;this.textbox.addEventListener("keydown",function(Q){S.default.match(Q,"enter")?(te.save(),Q.preventDefault()):S.default.match(Q,"escape")&&(te.cancel(),Q.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),Q!=null?this.textbox.value=Q:te!==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-"+te)||""),this.root.setAttribute("data-mode",te)}},{key:"restoreFocus",value:function(){var te=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=te}},{key:"save",value:function(){var te=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var Q=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",te,E.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",te,E.default.sources.USER)),this.quill.root.scrollTop=Q;break}case"video":te=q(te);case"formula":{if(!te)break;var Z=this.quill.getSelection(!0);if(Z!=null){var re=Z.index+Z.length;this.quill.insertEmbed(re,this.root.getAttribute("data-mode"),te,E.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(re+1," ",E.default.sources.USER),this.quill.setSelection(re+2,E.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),U}(I.default);function q(Y){var U=Y.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||Y.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return U?(U[1]||"https")+"://www.youtube.com/embed/"+U[2]+"?showinfo=0":(U=Y.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(U[1]||"https")+"://player.vimeo.com/video/"+U[2]+"/":Y}function z(Y,U){var ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;U.forEach(function(te){var Q=document.createElement("option");te===ee?Q.setAttribute("selected","selected"):Q.setAttribute("value",te),Y.appendChild(Q)})}r.BaseTooltip=X,r.default=W},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function s(){this.head=this.tail=null,this.length=0}return s.prototype.append=function(){for(var c=[],m=0;m<arguments.length;m++)c[m]=arguments[m];this.insertBefore(c[0],null),c.length>1&&this.append.apply(this,c.slice(1))},s.prototype.contains=function(c){for(var m,f=this.iterator();m=f();)if(m===c)return!0;return!1},s.prototype.insertBefore=function(c,m){c&&(c.next=m,m!=null?(c.prev=m.prev,m.prev!=null&&(m.prev.next=c),m.prev=c,m===this.head&&(this.head=c)):this.tail!=null?(this.tail.next=c,c.prev=this.tail,this.tail=c):(c.prev=null,this.head=this.tail=c),this.length+=1)},s.prototype.offset=function(c){for(var m=0,f=this.head;f!=null;){if(f===c)return m;m+=f.length(),f=f.next}return-1},s.prototype.remove=function(c){this.contains(c)&&(c.prev!=null&&(c.prev.next=c.next),c.next!=null&&(c.next.prev=c.prev),c===this.head&&(this.head=c.next),c===this.tail&&(this.tail=c.prev),this.length-=1)},s.prototype.iterator=function(c){return c===void 0&&(c=this.head),function(){var m=c;return c!=null&&(c=c.next),m}},s.prototype.find=function(c,m){m===void 0&&(m=!1);for(var f,v=this.iterator();f=v();){var y=f.length();if(c<y||m&&c===y&&(f.next==null||f.next.length()!==0))return[f,c];c-=y}return[null,0]},s.prototype.forEach=function(c){for(var m,f=this.iterator();m=f();)c(m)},s.prototype.forEachAt=function(c,m,f){if(!(m<=0))for(var v=this.find(c),y=v[0],E=v[1],w,S=c-E,x=this.iterator(y);(w=x())&&S<c+m;){var _=w.length();c>S?f(w,c-S,Math.min(m,S+_-c)):f(w,0,Math.min(_,c+m-S)),S+=_}},s.prototype.map=function(c){return this.reduce(function(m,f){return m.push(c(f)),m},[])},s.prototype.reduce=function(c,m){for(var f,v=this.iterator();f=v();)m=c(m,f);return m},s}();r.default=o},function(t,r,a){var o=this&&this.__extends||function(){var y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,w){E.__proto__=w}||function(E,w){for(var S in w)w.hasOwnProperty(S)&&(E[S]=w[S])};return function(E,w){y(E,w);function S(){this.constructor=E}E.prototype=w===null?Object.create(w):(S.prototype=w.prototype,new S)}}();Object.defineProperty(r,"__esModule",{value:!0});var s=a(17),c=a(1),m={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},f=100,v=function(y){o(E,y);function E(w){var S=y.call(this,w)||this;return S.scroll=S,S.observer=new MutationObserver(function(x){S.update(x)}),S.observer.observe(S.domNode,m),S.attach(),S}return E.prototype.detach=function(){y.prototype.detach.call(this),this.observer.disconnect()},E.prototype.deleteAt=function(w,S){this.update(),w===0&&S===this.length()?this.children.forEach(function(x){x.remove()}):y.prototype.deleteAt.call(this,w,S)},E.prototype.formatAt=function(w,S,x,_){this.update(),y.prototype.formatAt.call(this,w,S,x,_)},E.prototype.insertAt=function(w,S,x){this.update(),y.prototype.insertAt.call(this,w,S,x)},E.prototype.optimize=function(w,S){var x=this;w===void 0&&(w=[]),S===void 0&&(S={}),y.prototype.optimize.call(this,S);for(var _=[].slice.call(this.observer.takeRecords());_.length>0;)w.push(_.pop());for(var b=function(P,M){M===void 0&&(M=!0),!(P==null||P===x)&&P.domNode.parentNode!=null&&(P.domNode[c.DATA_KEY].mutations==null&&(P.domNode[c.DATA_KEY].mutations=[]),M&&b(P.parent))},g=function(P){P.domNode[c.DATA_KEY]==null||P.domNode[c.DATA_KEY].mutations==null||(P instanceof s.default&&P.children.forEach(g),P.optimize(S))},h=w,d=0;h.length>0;d+=1){if(d>=f)throw new Error("[Parchment] Maximum optimize iterations reached");for(h.forEach(function(P){var M=c.find(P.target,!0);M!=null&&(M.domNode===P.target&&(P.type==="childList"?(b(c.find(P.previousSibling,!1)),[].forEach.call(P.addedNodes,function(T){var I=c.find(T,!1);b(I,!1),I instanceof s.default&&I.children.forEach(function(F){b(F,!1)})})):P.type==="attributes"&&b(M.prev)),b(M))}),this.children.forEach(g),h=[].slice.call(this.observer.takeRecords()),_=h.slice();_.length>0;)w.push(_.pop())}},E.prototype.update=function(w,S){var x=this;S===void 0&&(S={}),w=w||this.observer.takeRecords(),w.map(function(_){var b=c.find(_.target,!0);return b==null?null:b.domNode[c.DATA_KEY].mutations==null?(b.domNode[c.DATA_KEY].mutations=[_],b):(b.domNode[c.DATA_KEY].mutations.push(_),null)}).forEach(function(_){_==null||_===x||_.domNode[c.DATA_KEY]==null||_.update(_.domNode[c.DATA_KEY].mutations||[],S)}),this.domNode[c.DATA_KEY].mutations!=null&&y.prototype.update.call(this,this.domNode[c.DATA_KEY].mutations,S),this.optimize(w,S)},E.blotName="scroll",E.defaultChild="block",E.scope=c.Scope.BLOCK_BLOT,E.tagName="DIV",E}(s.default);r.default=v},function(t,r,a){var o=this&&this.__extends||function(){var v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,E){y.__proto__=E}||function(y,E){for(var w in E)E.hasOwnProperty(w)&&(y[w]=E[w])};return function(y,E){v(y,E);function w(){this.constructor=y}y.prototype=E===null?Object.create(E):(w.prototype=E.prototype,new w)}}();Object.defineProperty(r,"__esModule",{value:!0});var s=a(18),c=a(1);function m(v,y){if(Object.keys(v).length!==Object.keys(y).length)return!1;for(var E in v)if(v[E]!==y[E])return!1;return!0}var f=function(v){o(y,v);function y(){return v!==null&&v.apply(this,arguments)||this}return y.formats=function(E){if(E.tagName!==y.tagName)return v.formats.call(this,E)},y.prototype.format=function(E,w){var S=this;E===this.statics.blotName&&!w?(this.children.forEach(function(x){x instanceof s.default||(x=x.wrap(y.blotName,!0)),S.attributes.copy(x)}),this.unwrap()):v.prototype.format.call(this,E,w)},y.prototype.formatAt=function(E,w,S,x){if(this.formats()[S]!=null||c.query(S,c.Scope.ATTRIBUTE)){var _=this.isolate(E,w);_.format(S,x)}else v.prototype.formatAt.call(this,E,w,S,x)},y.prototype.optimize=function(E){v.prototype.optimize.call(this,E);var w=this.formats();if(Object.keys(w).length===0)return this.unwrap();var S=this.next;S instanceof y&&S.prev===this&&m(w,S.formats())&&(S.moveChildren(this),S.remove())},y.blotName="inline",y.scope=c.Scope.INLINE_BLOT,y.tagName="SPAN",y}(s.default);r.default=f},function(t,r,a){var o=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,y){v.__proto__=y}||function(v,y){for(var E in y)y.hasOwnProperty(E)&&(v[E]=y[E])};return function(v,y){f(v,y);function E(){this.constructor=v}v.prototype=y===null?Object.create(y):(E.prototype=y.prototype,new E)}}();Object.defineProperty(r,"__esModule",{value:!0});var s=a(18),c=a(1),m=function(f){o(v,f);function v(){return f!==null&&f.apply(this,arguments)||this}return v.formats=function(y){var E=c.query(v.blotName).tagName;if(y.tagName!==E)return f.formats.call(this,y)},v.prototype.format=function(y,E){c.query(y,c.Scope.BLOCK)!=null&&(y===this.statics.blotName&&!E?this.replaceWith(v.blotName):f.prototype.format.call(this,y,E))},v.prototype.formatAt=function(y,E,w,S){c.query(w,c.Scope.BLOCK)!=null?this.format(w,S):f.prototype.formatAt.call(this,y,E,w,S)},v.prototype.insertAt=function(y,E,w){if(w==null||c.query(E,c.Scope.INLINE)!=null)f.prototype.insertAt.call(this,y,E,w);else{var S=this.split(y),x=c.create(E,w);S.parent.insertBefore(x,S)}},v.prototype.update=function(y,E){navigator.userAgent.match(/Trident/)?this.build():f.prototype.update.call(this,y,E)},v.blotName="block",v.scope=c.Scope.BLOCK_BLOT,v.tagName="P",v}(s.default);r.default=m},function(t,r,a){var o=this&&this.__extends||function(){var m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,v){f.__proto__=v}||function(f,v){for(var y in v)v.hasOwnProperty(y)&&(f[y]=v[y])};return function(f,v){m(f,v);function y(){this.constructor=f}f.prototype=v===null?Object.create(v):(y.prototype=v.prototype,new y)}}();Object.defineProperty(r,"__esModule",{value:!0});var s=a(19),c=function(m){o(f,m);function f(){return m!==null&&m.apply(this,arguments)||this}return f.formats=function(v){},f.prototype.format=function(v,y){m.prototype.formatAt.call(this,0,this.length(),v,y)},f.prototype.formatAt=function(v,y,E,w){v===0&&y===this.length()?this.format(E,w):m.prototype.formatAt.call(this,v,y,E,w)},f.prototype.formats=function(){return this.statics.formats(this.domNode)},f}(s.default);r.default=c},function(t,r,a){var o=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,y){v.__proto__=y}||function(v,y){for(var E in y)y.hasOwnProperty(E)&&(v[E]=y[E])};return function(v,y){f(v,y);function E(){this.constructor=v}v.prototype=y===null?Object.create(y):(E.prototype=y.prototype,new E)}}();Object.defineProperty(r,"__esModule",{value:!0});var s=a(19),c=a(1),m=function(f){o(v,f);function v(y){var E=f.call(this,y)||this;return E.text=E.statics.value(E.domNode),E}return v.create=function(y){return document.createTextNode(y)},v.value=function(y){var E=y.data;return E.normalize&&(E=E.normalize()),E},v.prototype.deleteAt=function(y,E){this.domNode.data=this.text=this.text.slice(0,y)+this.text.slice(y+E)},v.prototype.index=function(y,E){return this.domNode===y?E:-1},v.prototype.insertAt=function(y,E,w){w==null?(this.text=this.text.slice(0,y)+E+this.text.slice(y),this.domNode.data=this.text):f.prototype.insertAt.call(this,y,E,w)},v.prototype.length=function(){return this.text.length},v.prototype.optimize=function(y){f.prototype.optimize.call(this,y),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof v&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},v.prototype.position=function(y,E){return[this.domNode,y]},v.prototype.split=function(y,E){if(E===void 0&&(E=!1),!E){if(y===0)return this;if(y===this.length())return this.next}var w=c.create(this.domNode.splitText(y));return this.parent.insertBefore(w,this.next),this.text=this.statics.value(this.domNode),w},v.prototype.update=function(y,E){var w=this;y.some(function(S){return S.type==="characterData"&&S.target===w.domNode})&&(this.text=this.statics.value(this.domNode))},v.prototype.value=function(){return this.text},v.blotName="text",v.scope=c.Scope.INLINE_BLOT,v}(s.default);r.default=m},function(t,r,a){var o=document.createElement("div");if(o.classList.toggle("test-class",!1),o.classList.contains("test-class")){var s=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(c,m){return arguments.length>1&&!this.contains(c)==!m?m:s.call(this,c)}}String.prototype.startsWith||(String.prototype.startsWith=function(c,m){return m=m||0,this.substr(m,c.length)===c}),String.prototype.endsWith||(String.prototype.endsWith=function(c,m){var f=this.toString();(typeof m!="number"||!isFinite(m)||Math.floor(m)!==m||m>f.length)&&(m=f.length),m-=c.length;var v=f.indexOf(c,m);return v!==-1&&v===m}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(m){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof m!="function")throw new TypeError("predicate must be a function");for(var f=Object(this),v=f.length>>>0,y=arguments[1],E,w=0;w<v;w++)if(E=f[w],m.call(y,E,w,f))return E}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(t,r){var a=-1,o=1,s=0;function c(d,P,M){if(d==P)return d?[[s,d]]:[];(M<0||d.length<M)&&(M=null);var T=y(d,P),I=d.substring(0,T);d=d.substring(T),P=P.substring(T),T=E(d,P);var F=d.substring(d.length-T);d=d.substring(0,d.length-T),P=P.substring(0,P.length-T);var k=m(d,P);return I&&k.unshift([s,I]),F&&k.push([s,F]),S(k),M!=null&&(k=b(k,M)),k=g(k),k}function m(d,P){var M;if(!d)return[[o,P]];if(!P)return[[a,d]];var T=d.length>P.length?d:P,I=d.length>P.length?P:d,F=T.indexOf(I);if(F!=-1)return M=[[o,T.substring(0,F)],[s,I],[o,T.substring(F+I.length)]],d.length>P.length&&(M[0][0]=M[2][0]=a),M;if(I.length==1)return[[a,d],[o,P]];var k=w(d,P);if(k){var O=k[0],N=k[1],A=k[2],R=k[3],L=k[4],V=c(O,A),G=c(N,R);return V.concat([[s,L]],G)}return f(d,P)}function f(d,P){for(var M=d.length,T=P.length,I=Math.ceil((M+T)/2),F=I,k=2*I,O=new Array(k),N=new Array(k),A=0;A<k;A++)O[A]=-1,N[A]=-1;O[F+1]=0,N[F+1]=0;for(var R=M-T,L=R%2!=0,V=0,G=0,W=0,X=0,q=0;q<I;q++){for(var z=-q+V;z<=q-G;z+=2){var Y=F+z,U;z==-q||z!=q&&O[Y-1]<O[Y+1]?U=O[Y+1]:U=O[Y-1]+1;for(var ee=U-z;U<M&&ee<T&&d.charAt(U)==P.charAt(ee);)U++,ee++;if(O[Y]=U,U>M)G+=2;else if(ee>T)V+=2;else if(L){var te=F+R-z;if(te>=0&&te<k&&N[te]!=-1){var Q=M-N[te];if(U>=Q)return v(d,P,U,ee)}}}for(var Z=-q+W;Z<=q-X;Z+=2){var te=F+Z,Q;Z==-q||Z!=q&&N[te-1]<N[te+1]?Q=N[te+1]:Q=N[te-1]+1;for(var re=Q-Z;Q<M&&re<T&&d.charAt(M-Q-1)==P.charAt(T-re-1);)Q++,re++;if(N[te]=Q,Q>M)X+=2;else if(re>T)W+=2;else if(!L){var Y=F+R-Z;if(Y>=0&&Y<k&&O[Y]!=-1){var U=O[Y],ee=F+U-Y;if(Q=M-Q,U>=Q)return v(d,P,U,ee)}}}}return[[a,d],[o,P]]}function v(d,P,M,T){var I=d.substring(0,M),F=P.substring(0,T),k=d.substring(M),O=P.substring(T),N=c(I,F),A=c(k,O);return N.concat(A)}function y(d,P){if(!d||!P||d.charAt(0)!=P.charAt(0))return 0;for(var M=0,T=Math.min(d.length,P.length),I=T,F=0;M<I;)d.substring(F,I)==P.substring(F,I)?(M=I,F=M):T=I,I=Math.floor((T-M)/2+M);return I}function E(d,P){if(!d||!P||d.charAt(d.length-1)!=P.charAt(P.length-1))return 0;for(var M=0,T=Math.min(d.length,P.length),I=T,F=0;M<I;)d.substring(d.length-I,d.length-F)==P.substring(P.length-I,P.length-F)?(M=I,F=M):T=I,I=Math.floor((T-M)/2+M);return I}function w(d,P){var M=d.length>P.length?d:P,T=d.length>P.length?P:d;if(M.length<4||T.length*2<M.length)return null;function I(G,W,X){for(var q=G.substring(X,X+Math.floor(G.length/4)),z=-1,Y="",U,ee,te,Q;(z=W.indexOf(q,z+1))!=-1;){var Z=y(G.substring(X),W.substring(z)),re=E(G.substring(0,X),W.substring(0,z));Y.length<re+Z&&(Y=W.substring(z-re,z)+W.substring(z,z+Z),U=G.substring(0,X-re),ee=G.substring(X+Z),te=W.substring(0,z-re),Q=W.substring(z+Z))}return Y.length*2>=G.length?[U,ee,te,Q,Y]:null}var F=I(M,T,Math.ceil(M.length/4)),k=I(M,T,Math.ceil(M.length/2)),O;if(!F&&!k)return null;k?F?O=F[4].length>k[4].length?F:k:O=k:O=F;var N,A,R,L;d.length>P.length?(N=O[0],A=O[1],R=O[2],L=O[3]):(R=O[0],L=O[1],N=O[2],A=O[3]);var V=O[4];return[N,A,R,L,V]}function S(d){d.push([s,""]);for(var P=0,M=0,T=0,I="",F="",k;P<d.length;)switch(d[P][0]){case o:T++,F+=d[P][1],P++;break;case a:M++,I+=d[P][1],P++;break;case s:M+T>1?(M!==0&&T!==0&&(k=y(F,I),k!==0&&(P-M-T>0&&d[P-M-T-1][0]==s?d[P-M-T-1][1]+=F.substring(0,k):(d.splice(0,0,[s,F.substring(0,k)]),P++),F=F.substring(k),I=I.substring(k)),k=E(F,I),k!==0&&(d[P][1]=F.substring(F.length-k)+d[P][1],F=F.substring(0,F.length-k),I=I.substring(0,I.length-k))),M===0?d.splice(P-T,M+T,[o,F]):T===0?d.splice(P-M,M+T,[a,I]):d.splice(P-M-T,M+T,[a,I],[o,F]),P=P-M-T+(M?1:0)+(T?1:0)+1):P!==0&&d[P-1][0]==s?(d[P-1][1]+=d[P][1],d.splice(P,1)):P++,T=0,M=0,I="",F="";break}d[d.length-1][1]===""&&d.pop();var O=!1;for(P=1;P<d.length-1;)d[P-1][0]==s&&d[P+1][0]==s&&(d[P][1].substring(d[P][1].length-d[P-1][1].length)==d[P-1][1]?(d[P][1]=d[P-1][1]+d[P][1].substring(0,d[P][1].length-d[P-1][1].length),d[P+1][1]=d[P-1][1]+d[P+1][1],d.splice(P-1,1),O=!0):d[P][1].substring(0,d[P+1][1].length)==d[P+1][1]&&(d[P-1][1]+=d[P+1][1],d[P][1]=d[P][1].substring(d[P+1][1].length)+d[P+1][1],d.splice(P+1,1),O=!0)),P++;O&&S(d)}var x=c;x.INSERT=o,x.DELETE=a,x.EQUAL=s,t.exports=x;function _(d,P){if(P===0)return[s,d];for(var M=0,T=0;T<d.length;T++){var I=d[T];if(I[0]===a||I[0]===s){var F=M+I[1].length;if(P===F)return[T+1,d];if(P<F){d=d.slice();var k=P-M,O=[I[0],I[1].slice(0,k)],N=[I[0],I[1].slice(k)];return d.splice(T,1,O,N),[T+1,d]}else M=F}}throw new Error("cursor_pos is out of bounds!")}function b(d,P){var M=_(d,P),T=M[1],I=M[0],F=T[I],k=T[I+1];if(F==null)return d;if(F[0]!==s)return d;if(k!=null&&F[1]+k[1]===k[1]+F[1])return T.splice(I,2,k,F),h(T,I,2);if(k!=null&&k[1].indexOf(F[1])===0){T.splice(I,2,[k[0],F[1]],[0,F[1]]);var O=k[1].slice(F[1].length);return O.length>0&&T.splice(I+2,0,[k[0],O]),h(T,I,3)}else return d}function g(d){for(var P=!1,M=function(k){return k.charCodeAt(0)>=56320&&k.charCodeAt(0)<=57343},T=function(k){return k.charCodeAt(k.length-1)>=55296&&k.charCodeAt(k.length-1)<=56319},I=2;I<d.length;I+=1)d[I-2][0]===s&&T(d[I-2][1])&&d[I-1][0]===a&&M(d[I-1][1])&&d[I][0]===o&&M(d[I][1])&&(P=!0,d[I-1][1]=d[I-2][1].slice(-1)+d[I-1][1],d[I][1]=d[I-2][1].slice(-1)+d[I][1],d[I-2][1]=d[I-2][1].slice(0,-1));if(!P)return d;for(var F=[],I=0;I<d.length;I+=1)d[I][1].length>0&&F.push(d[I]);return F}function h(d,P,M){for(var T=P+M-1;T>=0&&T>=P-1;T--)if(T+1<d.length){var I=d[T],F=d[T+1];I[0]===F[1]&&d.splice(T,2,[I[0],I[1]+F[1]])}return d}},function(t,r){r=t.exports=typeof Object.keys=="function"?Object.keys:a,r.shim=a;function a(o){var s=[];for(var c in o)s.push(c);return s}},function(t,r){var a=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";r=t.exports=a?o:s,r.supported=o;function o(c){return Object.prototype.toString.call(c)=="[object Arguments]"}r.unsupported=s;function s(c){return c&&typeof c=="object"&&typeof c.length=="number"&&Object.prototype.hasOwnProperty.call(c,"callee")&&!Object.prototype.propertyIsEnumerable.call(c,"callee")||!1}},function(t,r){var a=Object.prototype.hasOwnProperty,o="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(o=!1));function c(f,v,y){this.fn=f,this.context=v,this.once=y||!1}function m(){this._events=new s,this._eventsCount=0}m.prototype.eventNames=function(){var v=[],y,E;if(this._eventsCount===0)return v;for(E in y=this._events)a.call(y,E)&&v.push(o?E.slice(1):E);return Object.getOwnPropertySymbols?v.concat(Object.getOwnPropertySymbols(y)):v},m.prototype.listeners=function(v,y){var E=o?o+v:v,w=this._events[E];if(y)return!!w;if(!w)return[];if(w.fn)return[w.fn];for(var S=0,x=w.length,_=new Array(x);S<x;S++)_[S]=w[S].fn;return _},m.prototype.emit=function(v,y,E,w,S,x){var _=o?o+v:v;if(!this._events[_])return!1;var b=this._events[_],g=arguments.length,h,d;if(b.fn){switch(b.once&&this.removeListener(v,b.fn,void 0,!0),g){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,y),!0;case 3:return b.fn.call(b.context,y,E),!0;case 4:return b.fn.call(b.context,y,E,w),!0;case 5:return b.fn.call(b.context,y,E,w,S),!0;case 6:return b.fn.call(b.context,y,E,w,S,x),!0}for(d=1,h=new Array(g-1);d<g;d++)h[d-1]=arguments[d];b.fn.apply(b.context,h)}else{var P=b.length,M;for(d=0;d<P;d++)switch(b[d].once&&this.removeListener(v,b[d].fn,void 0,!0),g){case 1:b[d].fn.call(b[d].context);break;case 2:b[d].fn.call(b[d].context,y);break;case 3:b[d].fn.call(b[d].context,y,E);break;case 4:b[d].fn.call(b[d].context,y,E,w);break;default:if(!h)for(M=1,h=new Array(g-1);M<g;M++)h[M-1]=arguments[M];b[d].fn.apply(b[d].context,h)}}return!0},m.prototype.on=function(v,y,E){var w=new c(y,E||this),S=o?o+v:v;return this._events[S]?this._events[S].fn?this._events[S]=[this._events[S],w]:this._events[S].push(w):(this._events[S]=w,this._eventsCount++),this},m.prototype.once=function(v,y,E){var w=new c(y,E||this,!0),S=o?o+v:v;return this._events[S]?this._events[S].fn?this._events[S]=[this._events[S],w]:this._events[S].push(w):(this._events[S]=w,this._eventsCount++),this},m.prototype.removeListener=function(v,y,E,w){var S=o?o+v:v;if(!this._events[S])return this;if(!y)return--this._eventsCount===0?this._events=new s:delete this._events[S],this;var x=this._events[S];if(x.fn)x.fn===y&&(!w||x.once)&&(!E||x.context===E)&&(--this._eventsCount===0?this._events=new s:delete this._events[S]);else{for(var _=0,b=[],g=x.length;_<g;_++)(x[_].fn!==y||w&&!x[_].once||E&&x[_].context!==E)&&b.push(x[_]);b.length?this._events[S]=b.length===1?b[0]:b:--this._eventsCount===0?this._events=new s:delete this._events[S]}return this},m.prototype.removeAllListeners=function(v){var y;return v?(y=o?o+v:v,this._events[y]&&(--this._eventsCount===0?this._events=new s:delete this._events[y])):(this._events=new s,this._eventsCount=0),this},m.prototype.off=m.prototype.removeListener,m.prototype.addListener=m.prototype.on,m.prototype.setMaxListeners=function(){return this},m.prefixed=o,m.EventEmitter=m,typeof t<"u"&&(t.exports=m)},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0}),r.matchText=r.matchSpacing=r.matchNewline=r.matchBlot=r.matchAttributor=r.default=void 0;var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(se){return typeof se}:function(se){return se&&typeof Symbol=="function"&&se.constructor===Symbol&&se!==Symbol.prototype?"symbol":typeof se},s=function(){function se(_e,he){var xe=[],oe=!0,ve=!1,de=void 0;try{for(var ke=_e[Symbol.iterator](),Be;!(oe=(Be=ke.next()).done)&&(xe.push(Be.value),!(he&&xe.length===he));oe=!0);}catch(Qe){ve=!0,de=Qe}finally{try{!oe&&ke.return&&ke.return()}finally{if(ve)throw de}}return xe}return function(_e,he){if(Array.isArray(_e))return _e;if(Symbol.iterator in Object(_e))return se(_e,he);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function se(_e,he){for(var xe=0;xe<he.length;xe++){var oe=he[xe];oe.enumerable=oe.enumerable||!1,oe.configurable=!0,"value"in oe&&(oe.writable=!0),Object.defineProperty(_e,oe.key,oe)}}return function(_e,he,xe){return he&&se(_e.prototype,he),xe&&se(_e,xe),_e}}(),m=a(3),f=N(m),v=a(2),y=N(v),E=a(0),w=N(E),S=a(5),x=N(S),_=a(10),b=N(_),g=a(9),h=N(g),d=a(36),P=a(37),M=a(13),T=N(M),I=a(26),F=a(38),k=a(39),O=a(40);function N(se){return se&&se.__esModule?se:{default:se}}function A(se,_e,he){return _e in se?Object.defineProperty(se,_e,{value:he,enumerable:!0,configurable:!0,writable:!0}):se[_e]=he,se}function R(se,_e){if(!(se instanceof _e))throw new TypeError("Cannot call a class as a function")}function L(se,_e){if(!se)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _e&&(typeof _e=="object"||typeof _e=="function")?_e:se}function V(se,_e){if(typeof _e!="function"&&_e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _e);se.prototype=Object.create(_e&&_e.prototype,{constructor:{value:se,enumerable:!1,writable:!0,configurable:!0}}),_e&&(Object.setPrototypeOf?Object.setPrototypeOf(se,_e):se.__proto__=_e)}var G=(0,b.default)("quill:clipboard"),W="__ql-matcher",X=[[Node.TEXT_NODE,Te],[Node.TEXT_NODE,ye],["br",ue],[Node.ELEMENT_NODE,ye],[Node.ELEMENT_NODE,ae],[Node.ELEMENT_NODE,we],[Node.ELEMENT_NODE,ne],[Node.ELEMENT_NODE,je],["li",pe],["b",re.bind(re,"bold")],["i",re.bind(re,"italic")],["style",fe]],q=[d.AlignAttribute,F.DirectionAttribute].reduce(function(se,_e){return se[_e.keyName]=_e,se},{}),z=[d.AlignStyle,P.BackgroundStyle,I.ColorStyle,F.DirectionStyle,k.FontStyle,O.SizeStyle].reduce(function(se,_e){return se[_e.keyName]=_e,se},{}),Y=function(se){V(_e,se);function _e(he,xe){R(this,_e);var oe=L(this,(_e.__proto__||Object.getPrototypeOf(_e)).call(this,he,xe));return oe.quill.root.addEventListener("paste",oe.onPaste.bind(oe)),oe.container=oe.quill.addContainer("ql-clipboard"),oe.container.setAttribute("contenteditable",!0),oe.container.setAttribute("tabindex",-1),oe.matchers=[],X.concat(oe.options.matchers).forEach(function(ve){var de=s(ve,2),ke=de[0],Be=de[1];!xe.matchVisual&&Be===we||oe.addMatcher(ke,Be)}),oe}return c(_e,[{key:"addMatcher",value:function(xe,oe){this.matchers.push([xe,oe])}},{key:"convert",value:function(xe){if(typeof xe=="string")return this.container.innerHTML=xe.replace(/\>\r?\n +\</g,"><"),this.convert();var oe=this.quill.getFormat(this.quill.selection.savedRange.index);if(oe[T.default.blotName]){var ve=this.container.innerText;return this.container.innerHTML="",new y.default().insert(ve,A({},T.default.blotName,oe[T.default.blotName]))}var de=this.prepareMatching(),ke=s(de,2),Be=ke[0],Qe=ke[1],Ke=Z(this.container,Be,Qe);return te(Ke,`
140
- `)&&Ke.ops[Ke.ops.length-1].attributes==null&&(Ke=Ke.compose(new y.default().retain(Ke.length()-1).delete(1))),G.log("convert",this.container.innerHTML,Ke),this.container.innerHTML="",Ke}},{key:"dangerouslyPasteHTML",value:function(xe,oe){var ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:x.default.sources.API;if(typeof xe=="string")this.quill.setContents(this.convert(xe),oe),this.quill.setSelection(0,x.default.sources.SILENT);else{var de=this.convert(oe);this.quill.updateContents(new y.default().retain(xe).concat(de),ve),this.quill.setSelection(xe+de.length(),x.default.sources.SILENT)}}},{key:"onPaste",value:function(xe){var oe=this;if(!(xe.defaultPrevented||!this.quill.isEnabled())){var ve=this.quill.getSelection(),de=new y.default().retain(ve.index),ke=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(x.default.sources.SILENT),setTimeout(function(){de=de.concat(oe.convert()).delete(ve.length),oe.quill.updateContents(de,x.default.sources.USER),oe.quill.setSelection(de.length()-ve.length,x.default.sources.SILENT),oe.quill.scrollingContainer.scrollTop=ke,oe.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var xe=this,oe=[],ve=[];return this.matchers.forEach(function(de){var ke=s(de,2),Be=ke[0],Qe=ke[1];switch(Be){case Node.TEXT_NODE:ve.push(Qe);break;case Node.ELEMENT_NODE:oe.push(Qe);break;default:[].forEach.call(xe.container.querySelectorAll(Be),function(Ke){Ke[W]=Ke[W]||[],Ke[W].push(Qe)});break}}),[oe,ve]}}]),_e}(h.default);Y.DEFAULTS={matchers:[],matchVisual:!0};function U(se,_e,he){return(typeof _e>"u"?"undefined":o(_e))==="object"?Object.keys(_e).reduce(function(xe,oe){return U(xe,oe,_e[oe])},se):se.reduce(function(xe,oe){return oe.attributes&&oe.attributes[_e]?xe.push(oe):xe.insert(oe.insert,(0,f.default)({},A({},_e,he),oe.attributes))},new y.default)}function ee(se){if(se.nodeType!==Node.ELEMENT_NODE)return{};var _e="__ql-computed-style";return se[_e]||(se[_e]=window.getComputedStyle(se))}function te(se,_e){for(var he="",xe=se.ops.length-1;xe>=0&&he.length<_e.length;--xe){var oe=se.ops[xe];if(typeof oe.insert!="string")break;he=oe.insert+he}return he.slice(-1*_e.length)===_e}function Q(se){if(se.childNodes.length===0)return!1;var _e=ee(se);return["block","list-item"].indexOf(_e.display)>-1}function Z(se,_e,he){return se.nodeType===se.TEXT_NODE?he.reduce(function(xe,oe){return oe(se,xe)},new y.default):se.nodeType===se.ELEMENT_NODE?[].reduce.call(se.childNodes||[],function(xe,oe){var ve=Z(oe,_e,he);return oe.nodeType===se.ELEMENT_NODE&&(ve=_e.reduce(function(de,ke){return ke(oe,de)},ve),ve=(oe[W]||[]).reduce(function(de,ke){return ke(oe,de)},ve)),xe.concat(ve)},new y.default):new y.default}function re(se,_e,he){return U(he,se,!0)}function ne(se,_e){var he=w.default.Attributor.Attribute.keys(se),xe=w.default.Attributor.Class.keys(se),oe=w.default.Attributor.Style.keys(se),ve={};return he.concat(xe).concat(oe).forEach(function(de){var ke=w.default.query(de,w.default.Scope.ATTRIBUTE);ke!=null&&(ve[ke.attrName]=ke.value(se),ve[ke.attrName])||(ke=q[de],ke!=null&&(ke.attrName===de||ke.keyName===de)&&(ve[ke.attrName]=ke.value(se)||void 0),ke=z[de],ke!=null&&(ke.attrName===de||ke.keyName===de)&&(ke=z[de],ve[ke.attrName]=ke.value(se)||void 0))}),Object.keys(ve).length>0&&(_e=U(_e,ve)),_e}function ae(se,_e){var he=w.default.query(se);if(he==null)return _e;if(he.prototype instanceof w.default.Embed){var xe={},oe=he.value(se);oe!=null&&(xe[he.blotName]=oe,_e=new y.default().insert(xe,he.formats(se)))}else typeof he.formats=="function"&&(_e=U(_e,he.blotName,he.formats(se)));return _e}function ue(se,_e){return te(_e,`
141
- `)||_e.insert(`
142
- `),_e}function fe(){return new y.default}function pe(se,_e){var he=w.default.query(se);if(he==null||he.blotName!=="list-item"||!te(_e,`
143
- `))return _e;for(var xe=-1,oe=se.parentNode;!oe.classList.contains("ql-clipboard");)(w.default.query(oe)||{}).blotName==="list"&&(xe+=1),oe=oe.parentNode;return xe<=0?_e:_e.compose(new y.default().retain(_e.length()-1).retain(1,{indent:xe}))}function ye(se,_e){return te(_e,`
144
- `)||(Q(se)||_e.length()>0&&se.nextSibling&&Q(se.nextSibling))&&_e.insert(`
145
- `),_e}function we(se,_e){if(Q(se)&&se.nextElementSibling!=null&&!te(_e,`
146
-
147
- `)){var he=se.offsetHeight+parseFloat(ee(se).marginTop)+parseFloat(ee(se).marginBottom);se.nextElementSibling.offsetTop>se.offsetTop+he*1.5&&_e.insert(`
148
- `)}return _e}function je(se,_e){var he={},xe=se.style||{};return xe.fontStyle&&ee(se).fontStyle==="italic"&&(he.italic=!0),xe.fontWeight&&(ee(se).fontWeight.startsWith("bold")||parseInt(ee(se).fontWeight)>=700)&&(he.bold=!0),Object.keys(he).length>0&&(_e=U(_e,he)),parseFloat(xe.textIndent||0)>0&&(_e=new y.default().insert(" ").concat(_e)),_e}function Te(se,_e){var he=se.data;if(se.parentNode.tagName==="O:P")return _e.insert(he.trim());if(he.trim().length===0&&se.parentNode.classList.contains("ql-clipboard"))return _e;if(!ee(se.parentNode).whiteSpace.startsWith("pre")){var xe=function(ve,de){return de=de.replace(/[^\u00a0]/g,""),de.length<1&&ve?" ":de};he=he.replace(/\r\n/g," ").replace(/\n/g," "),he=he.replace(/\s\s+/g,xe.bind(xe,!0)),(se.previousSibling==null&&Q(se.parentNode)||se.previousSibling!=null&&Q(se.previousSibling))&&(he=he.replace(/^\s+/,xe.bind(xe,!1))),(se.nextSibling==null&&Q(se.parentNode)||se.nextSibling!=null&&Q(se.nextSibling))&&(he=he.replace(/\s+$/,xe.bind(xe,!1)))}return _e.insert(he)}r.default=Y,r.matchAttributor=ne,r.matchBlot=ae,r.matchNewline=ye,r.matchSpacing=we,r.matchText=Te},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function S(x,_){for(var b=0;b<_.length;b++){var g=_[b];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(x,g.key,g)}}return function(x,_,b){return _&&S(x.prototype,_),b&&S(x,b),x}}(),s=function S(x,_,b){x===null&&(x=Function.prototype);var g=Object.getOwnPropertyDescriptor(x,_);if(g===void 0){var h=Object.getPrototypeOf(x);return h===null?void 0:S(h,_,b)}else{if("value"in g)return g.value;var d=g.get;return d===void 0?void 0:d.call(b)}},c=a(6),m=f(c);function f(S){return S&&S.__esModule?S:{default:S}}function v(S,x){if(!(S instanceof x))throw new TypeError("Cannot call a class as a function")}function y(S,x){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:S}function E(S,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);S.prototype=Object.create(x&&x.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(S,x):S.__proto__=x)}var w=function(S){E(x,S);function x(){return v(this,x),y(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return o(x,[{key:"optimize",value:function(b){s(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"optimize",this).call(this,b),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return s(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),x}(m.default);w.blotName="bold",w.tagName=["STRONG","B"],r.default=w},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0}),r.addControls=r.default=void 0;var o=function(){function O(N,A){var R=[],L=!0,V=!1,G=void 0;try{for(var W=N[Symbol.iterator](),X;!(L=(X=W.next()).done)&&(R.push(X.value),!(A&&R.length===A));L=!0);}catch(q){V=!0,G=q}finally{try{!L&&W.return&&W.return()}finally{if(V)throw G}}return R}return function(N,A){if(Array.isArray(N))return N;if(Symbol.iterator in Object(N))return O(N,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function O(N,A){for(var R=0;R<A.length;R++){var L=A[R];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(N,L.key,L)}}return function(N,A,R){return A&&O(N.prototype,A),R&&O(N,R),N}}(),c=a(2),m=b(c),f=a(0),v=b(f),y=a(5),E=b(y),w=a(10),S=b(w),x=a(9),_=b(x);function b(O){return O&&O.__esModule?O:{default:O}}function g(O,N,A){return N in O?Object.defineProperty(O,N,{value:A,enumerable:!0,configurable:!0,writable:!0}):O[N]=A,O}function h(O,N){if(!(O instanceof N))throw new TypeError("Cannot call a class as a function")}function d(O,N){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N&&(typeof N=="object"||typeof N=="function")?N:O}function P(O,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof N);O.prototype=Object.create(N&&N.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),N&&(Object.setPrototypeOf?Object.setPrototypeOf(O,N):O.__proto__=N)}var M=(0,S.default)("quill:toolbar"),T=function(O){P(N,O);function N(A,R){h(this,N);var L=d(this,(N.__proto__||Object.getPrototypeOf(N)).call(this,A,R));if(Array.isArray(L.options.container)){var V=document.createElement("div");F(V,L.options.container),A.container.parentNode.insertBefore(V,A.container),L.container=V}else typeof L.options.container=="string"?L.container=document.querySelector(L.options.container):L.container=L.options.container;if(!(L.container instanceof HTMLElement)){var G;return G=M.error("Container required for toolbar",L.options),d(L,G)}return L.container.classList.add("ql-toolbar"),L.controls=[],L.handlers={},Object.keys(L.options.handlers).forEach(function(W){L.addHandler(W,L.options.handlers[W])}),[].forEach.call(L.container.querySelectorAll("button, select"),function(W){L.attach(W)}),L.quill.on(E.default.events.EDITOR_CHANGE,function(W,X){W===E.default.events.SELECTION_CHANGE&&L.update(X)}),L.quill.on(E.default.events.SCROLL_OPTIMIZE,function(){var W=L.quill.selection.getRange(),X=o(W,1),q=X[0];L.update(q)}),L}return s(N,[{key:"addHandler",value:function(R,L){this.handlers[R]=L}},{key:"attach",value:function(R){var L=this,V=[].find.call(R.classList,function(W){return W.indexOf("ql-")===0});if(V){if(V=V.slice(3),R.tagName==="BUTTON"&&R.setAttribute("type","button"),this.handlers[V]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[V]==null){M.warn("ignoring attaching to disabled format",V,R);return}if(v.default.query(V)==null){M.warn("ignoring attaching to nonexistent format",V,R);return}}var G=R.tagName==="SELECT"?"change":"click";R.addEventListener(G,function(W){var X=void 0;if(R.tagName==="SELECT"){if(R.selectedIndex<0)return;var q=R.options[R.selectedIndex];q.hasAttribute("selected")?X=!1:X=q.value||!1}else R.classList.contains("ql-active")?X=!1:X=R.value||!R.hasAttribute("value"),W.preventDefault();L.quill.focus();var z=L.quill.selection.getRange(),Y=o(z,1),U=Y[0];if(L.handlers[V]!=null)L.handlers[V].call(L,X);else if(v.default.query(V).prototype instanceof v.default.Embed){if(X=prompt("Enter "+V),!X)return;L.quill.updateContents(new m.default().retain(U.index).delete(U.length).insert(g({},V,X)),E.default.sources.USER)}else L.quill.format(V,X,E.default.sources.USER);L.update(U)}),this.controls.push([V,R])}}},{key:"update",value:function(R){var L=R==null?{}:this.quill.getFormat(R);this.controls.forEach(function(V){var G=o(V,2),W=G[0],X=G[1];if(X.tagName==="SELECT"){var q=void 0;if(R==null)q=null;else if(L[W]==null)q=X.querySelector("option[selected]");else if(!Array.isArray(L[W])){var z=L[W];typeof z=="string"&&(z=z.replace(/\"/g,'\\"')),q=X.querySelector('option[value="'+z+'"]')}q==null?(X.value="",X.selectedIndex=-1):q.selected=!0}else if(R==null)X.classList.remove("ql-active");else if(X.hasAttribute("value")){var Y=L[W]===X.getAttribute("value")||L[W]!=null&&L[W].toString()===X.getAttribute("value")||L[W]==null&&!X.getAttribute("value");X.classList.toggle("ql-active",Y)}else X.classList.toggle("ql-active",L[W]!=null)})}}]),N}(_.default);T.DEFAULTS={};function I(O,N,A){var R=document.createElement("button");R.setAttribute("type","button"),R.classList.add("ql-"+N),A!=null&&(R.value=A),O.appendChild(R)}function F(O,N){Array.isArray(N[0])||(N=[N]),N.forEach(function(A){var R=document.createElement("span");R.classList.add("ql-formats"),A.forEach(function(L){if(typeof L=="string")I(R,L);else{var V=Object.keys(L)[0],G=L[V];Array.isArray(G)?k(R,V,G):I(R,V,G)}}),O.appendChild(R)})}function k(O,N,A){var R=document.createElement("select");R.classList.add("ql-"+N),A.forEach(function(L){var V=document.createElement("option");L!==!1?V.setAttribute("value",L):V.setAttribute("selected","selected"),R.appendChild(V)}),O.appendChild(R)}T.DEFAULTS={container:null,handlers:{clean:function(){var N=this,A=this.quill.getSelection();if(A!=null)if(A.length==0){var R=this.quill.getFormat();Object.keys(R).forEach(function(L){v.default.query(L,v.default.Scope.INLINE)!=null&&N.quill.format(L,!1)})}else this.quill.removeFormat(A,E.default.sources.USER)},direction:function(N){var A=this.quill.getFormat().align;N==="rtl"&&A==null?this.quill.format("align","right",E.default.sources.USER):!N&&A==="right"&&this.quill.format("align",!1,E.default.sources.USER),this.quill.format("direction",N,E.default.sources.USER)},indent:function(N){var A=this.quill.getSelection(),R=this.quill.getFormat(A),L=parseInt(R.indent||0);if(N==="+1"||N==="-1"){var V=N==="+1"?1:-1;R.direction==="rtl"&&(V*=-1),this.quill.format("indent",L+V,E.default.sources.USER)}},link:function(N){N===!0&&(N=prompt("Enter link URL:")),this.quill.format("link",N,E.default.sources.USER)},list:function(N){var A=this.quill.getSelection(),R=this.quill.getFormat(A);N==="check"?R.list==="checked"||R.list==="unchecked"?this.quill.format("list",!1,E.default.sources.USER):this.quill.format("list","unchecked",E.default.sources.USER):this.quill.format("list",N,E.default.sources.USER)}}},r.default=T,r.addControls=F},function(t,r){t.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(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function S(x,_){for(var b=0;b<_.length;b++){var g=_[b];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(x,g.key,g)}}return function(x,_,b){return _&&S(x.prototype,_),b&&S(x,b),x}}(),s=function S(x,_,b){x===null&&(x=Function.prototype);var g=Object.getOwnPropertyDescriptor(x,_);if(g===void 0){var h=Object.getPrototypeOf(x);return h===null?void 0:S(h,_,b)}else{if("value"in g)return g.value;var d=g.get;return d===void 0?void 0:d.call(b)}},c=a(28),m=f(c);function f(S){return S&&S.__esModule?S:{default:S}}function v(S,x){if(!(S instanceof x))throw new TypeError("Cannot call a class as a function")}function y(S,x){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:S}function E(S,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);S.prototype=Object.create(x&&x.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(S,x):S.__proto__=x)}var w=function(S){E(x,S);function x(_,b){v(this,x);var g=y(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,_));return g.label.innerHTML=b,g.container.classList.add("ql-color-picker"),[].slice.call(g.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(h){h.classList.add("ql-primary")}),g}return o(x,[{key:"buildItem",value:function(b){var g=s(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"buildItem",this).call(this,b);return g.style.backgroundColor=b.getAttribute("value")||"",g}},{key:"selectItem",value:function(b,g){s(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"selectItem",this).call(this,b,g);var h=this.label.querySelector(".ql-color-label"),d=b&&b.getAttribute("data-value")||"";h&&(h.tagName==="line"?h.style.stroke=d:h.style.fill=d)}}]),x}(m.default);r.default=w},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function S(x,_){for(var b=0;b<_.length;b++){var g=_[b];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(x,g.key,g)}}return function(x,_,b){return _&&S(x.prototype,_),b&&S(x,b),x}}(),s=function S(x,_,b){x===null&&(x=Function.prototype);var g=Object.getOwnPropertyDescriptor(x,_);if(g===void 0){var h=Object.getPrototypeOf(x);return h===null?void 0:S(h,_,b)}else{if("value"in g)return g.value;var d=g.get;return d===void 0?void 0:d.call(b)}},c=a(28),m=f(c);function f(S){return S&&S.__esModule?S:{default:S}}function v(S,x){if(!(S instanceof x))throw new TypeError("Cannot call a class as a function")}function y(S,x){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:S}function E(S,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);S.prototype=Object.create(x&&x.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(S,x):S.__proto__=x)}var w=function(S){E(x,S);function x(_,b){v(this,x);var g=y(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,_));return g.container.classList.add("ql-icon-picker"),[].forEach.call(g.container.querySelectorAll(".ql-picker-item"),function(h){h.innerHTML=b[h.getAttribute("data-value")||""]}),g.defaultItem=g.container.querySelector(".ql-selected"),g.selectItem(g.defaultItem),g}return o(x,[{key:"selectItem",value:function(b,g){s(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"selectItem",this).call(this,b,g),b=b||this.defaultItem,this.label.innerHTML=b.innerHTML}}]),x}(m.default);r.default=w},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function m(f,v){for(var y=0;y<v.length;y++){var E=v[y];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(f,E.key,E)}}return function(f,v,y){return v&&m(f.prototype,v),y&&m(f,y),f}}();function s(m,f){if(!(m instanceof f))throw new TypeError("Cannot call a class as a function")}var c=function(){function m(f,v){var y=this;s(this,m),this.quill=f,this.boundsContainer=v||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(){y.root.style.marginTop=-1*y.quill.root.scrollTop+"px"}),this.hide()}return o(m,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(v){var y=v.left+v.width/2-this.root.offsetWidth/2,E=v.bottom+this.quill.root.scrollTop;this.root.style.left=y+"px",this.root.style.top=E+"px",this.root.classList.remove("ql-flip");var w=this.boundsContainer.getBoundingClientRect(),S=this.root.getBoundingClientRect(),x=0;if(S.right>w.right&&(x=w.right-S.right,this.root.style.left=y+x+"px"),S.left<w.left&&(x=w.left-S.left,this.root.style.left=y+x+"px"),S.bottom>w.bottom){var _=S.bottom-S.top,b=v.bottom-v.top+_;this.root.style.top=E-b+"px",this.root.classList.add("ql-flip")}return x}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),m}();r.default=c},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function k(O,N){var A=[],R=!0,L=!1,V=void 0;try{for(var G=O[Symbol.iterator](),W;!(R=(W=G.next()).done)&&(A.push(W.value),!(N&&A.length===N));R=!0);}catch(X){L=!0,V=X}finally{try{!R&&G.return&&G.return()}finally{if(L)throw V}}return A}return function(O,N){if(Array.isArray(O))return O;if(Symbol.iterator in Object(O))return k(O,N);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function k(O,N,A){O===null&&(O=Function.prototype);var R=Object.getOwnPropertyDescriptor(O,N);if(R===void 0){var L=Object.getPrototypeOf(O);return L===null?void 0:k(L,N,A)}else{if("value"in R)return R.value;var V=R.get;return V===void 0?void 0:V.call(A)}},c=function(){function k(O,N){for(var A=0;A<N.length;A++){var R=N[A];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(O,R.key,R)}}return function(O,N,A){return N&&k(O.prototype,N),A&&k(O,A),O}}(),m=a(3),f=h(m),v=a(8),y=h(v),E=a(43),w=h(E),S=a(27),x=h(S),_=a(15),b=a(41),g=h(b);function h(k){return k&&k.__esModule?k:{default:k}}function d(k,O){if(!(k instanceof O))throw new TypeError("Cannot call a class as a function")}function P(k,O){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:k}function M(k,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);k.prototype=Object.create(O&&O.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(k,O):k.__proto__=O)}var T=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],I=function(k){M(O,k);function O(N,A){d(this,O),A.modules.toolbar!=null&&A.modules.toolbar.container==null&&(A.modules.toolbar.container=T);var R=P(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,N,A));return R.quill.container.classList.add("ql-snow"),R}return c(O,[{key:"extendToolbar",value:function(A){A.container.classList.add("ql-snow"),this.buildButtons([].slice.call(A.container.querySelectorAll("button")),g.default),this.buildPickers([].slice.call(A.container.querySelectorAll("select")),g.default),this.tooltip=new F(this.quill,this.options.bounds),A.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(R,L){A.handlers.link.call(A,!L.format.link)})}}]),O}(w.default);I.DEFAULTS=(0,f.default)(!0,{},w.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(O){if(O){var N=this.quill.getSelection();if(N==null||N.length==0)return;var A=this.quill.getText(N);/^\S+@\S+\.\S+$/.test(A)&&A.indexOf("mailto:")!==0&&(A="mailto:"+A);var R=this.quill.theme.tooltip;R.edit("link",A)}else this.quill.format("link",!1)}}}}});var F=function(k){M(O,k);function O(N,A){d(this,O);var R=P(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,N,A));return R.preview=R.root.querySelector("a.ql-preview"),R}return c(O,[{key:"listen",value:function(){var A=this;s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(R){A.root.classList.contains("ql-editing")?A.save():A.edit("link",A.preview.textContent),R.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(R){if(A.linkRange!=null){var L=A.linkRange;A.restoreFocus(),A.quill.formatText(L,"link",!1,y.default.sources.USER),delete A.linkRange}R.preventDefault(),A.hide()}),this.quill.on(y.default.events.SELECTION_CHANGE,function(R,L,V){if(R!=null){if(R.length===0&&V===y.default.sources.USER){var G=A.quill.scroll.descendant(x.default,R.index),W=o(G,2),X=W[0],q=W[1];if(X!=null){A.linkRange=new _.Range(R.index-q,X.length());var z=x.default.formats(X.domNode);A.preview.textContent=z,A.preview.setAttribute("href",z),A.show(),A.position(A.quill.getBounds(A.linkRange));return}}else delete A.linkRange;A.hide()}})}},{key:"show",value:function(){s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),O}(E.BaseTooltip);F.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),r.default=I},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=a(29),s=oe(o),c=a(36),m=a(38),f=a(64),v=a(65),y=oe(v),E=a(66),w=oe(E),S=a(67),x=oe(S),_=a(37),b=a(26),g=a(39),h=a(40),d=a(56),P=oe(d),M=a(68),T=oe(M),I=a(27),F=oe(I),k=a(69),O=oe(k),N=a(70),A=oe(N),R=a(71),L=oe(R),V=a(72),G=oe(V),W=a(73),X=oe(W),q=a(13),z=oe(q),Y=a(74),U=oe(Y),ee=a(75),te=oe(ee),Q=a(57),Z=oe(Q),re=a(41),ne=oe(re),ae=a(28),ue=oe(ae),fe=a(59),pe=oe(fe),ye=a(60),we=oe(ye),je=a(61),Te=oe(je),se=a(108),_e=oe(se),he=a(62),xe=oe(he);function oe(ve){return ve&&ve.__esModule?ve:{default:ve}}s.default.register({"attributors/attribute/direction":m.DirectionAttribute,"attributors/class/align":c.AlignClass,"attributors/class/background":_.BackgroundClass,"attributors/class/color":b.ColorClass,"attributors/class/direction":m.DirectionClass,"attributors/class/font":g.FontClass,"attributors/class/size":h.SizeClass,"attributors/style/align":c.AlignStyle,"attributors/style/background":_.BackgroundStyle,"attributors/style/color":b.ColorStyle,"attributors/style/direction":m.DirectionStyle,"attributors/style/font":g.FontStyle,"attributors/style/size":h.SizeStyle},!0),s.default.register({"formats/align":c.AlignClass,"formats/direction":m.DirectionClass,"formats/indent":f.IndentClass,"formats/background":_.BackgroundStyle,"formats/color":b.ColorStyle,"formats/font":g.FontClass,"formats/size":h.SizeClass,"formats/blockquote":y.default,"formats/code-block":z.default,"formats/header":w.default,"formats/list":x.default,"formats/bold":P.default,"formats/code":q.Code,"formats/italic":T.default,"formats/link":F.default,"formats/script":O.default,"formats/strike":A.default,"formats/underline":L.default,"formats/image":G.default,"formats/video":X.default,"formats/list/item":S.ListItem,"modules/formula":U.default,"modules/syntax":te.default,"modules/toolbar":Z.default,"themes/bubble":_e.default,"themes/snow":xe.default,"ui/icons":ne.default,"ui/picker":ue.default,"ui/icon-picker":we.default,"ui/color-picker":pe.default,"ui/tooltip":Te.default},!0),r.default=s.default},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0}),r.IndentClass=void 0;var o=function(){function x(_,b){for(var g=0;g<b.length;g++){var h=b[g];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(_,h.key,h)}}return function(_,b,g){return b&&x(_.prototype,b),g&&x(_,g),_}}(),s=function x(_,b,g){_===null&&(_=Function.prototype);var h=Object.getOwnPropertyDescriptor(_,b);if(h===void 0){var d=Object.getPrototypeOf(_);return d===null?void 0:x(d,b,g)}else{if("value"in h)return h.value;var P=h.get;return P===void 0?void 0:P.call(g)}},c=a(0),m=f(c);function f(x){return x&&x.__esModule?x:{default:x}}function v(x,_){if(!(x instanceof _))throw new TypeError("Cannot call a class as a function")}function y(x,_){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:x}function E(x,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);x.prototype=Object.create(_&&_.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(x,_):x.__proto__=_)}var w=function(x){E(_,x);function _(){return v(this,_),y(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return o(_,[{key:"add",value:function(g,h){if(h==="+1"||h==="-1"){var d=this.value(g)||0;h=h==="+1"?d+1:d-1}return h===0?(this.remove(g),!0):s(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"add",this).call(this,g,h)}},{key:"canAdd",value:function(g,h){return s(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"canAdd",this).call(this,g,h)||s(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"canAdd",this).call(this,g,parseInt(h))}},{key:"value",value:function(g){return parseInt(s(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"value",this).call(this,g))||void 0}}]),_}(m.default.Attributor.Class),S=new w("indent","ql-indent",{scope:m.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});r.IndentClass=S},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=a(4),s=c(o);function c(E){return E&&E.__esModule?E:{default:E}}function m(E,w){if(!(E instanceof w))throw new TypeError("Cannot call a class as a function")}function f(E,w){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:E}function v(E,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);E.prototype=Object.create(w&&w.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(E,w):E.__proto__=w)}var y=function(E){v(w,E);function w(){return m(this,w),f(this,(w.__proto__||Object.getPrototypeOf(w)).apply(this,arguments))}return w}(s.default);y.blotName="blockquote",y.tagName="blockquote",r.default=y},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function w(S,x){for(var _=0;_<x.length;_++){var b=x[_];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(S,b.key,b)}}return function(S,x,_){return x&&w(S.prototype,x),_&&w(S,_),S}}(),s=a(4),c=m(s);function m(w){return w&&w.__esModule?w:{default:w}}function f(w,S){if(!(w instanceof S))throw new TypeError("Cannot call a class as a function")}function v(w,S){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:w}function y(w,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);w.prototype=Object.create(S&&S.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(w,S):w.__proto__=S)}var E=function(w){y(S,w);function S(){return f(this,S),v(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return o(S,null,[{key:"formats",value:function(_){return this.tagName.indexOf(_.tagName)+1}}]),S}(c.default);E.blotName="header",E.tagName=["H1","H2","H3","H4","H5","H6"],r.default=E},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.ListItem=void 0;var o=function(){function d(P,M){for(var T=0;T<M.length;T++){var I=M[T];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(P,I.key,I)}}return function(P,M,T){return M&&d(P.prototype,M),T&&d(P,T),P}}(),s=function d(P,M,T){P===null&&(P=Function.prototype);var I=Object.getOwnPropertyDescriptor(P,M);if(I===void 0){var F=Object.getPrototypeOf(P);return F===null?void 0:d(F,M,T)}else{if("value"in I)return I.value;var k=I.get;return k===void 0?void 0:k.call(T)}},c=a(0),m=w(c),f=a(4),v=w(f),y=a(25),E=w(y);function w(d){return d&&d.__esModule?d:{default:d}}function S(d,P,M){return P in d?Object.defineProperty(d,P,{value:M,enumerable:!0,configurable:!0,writable:!0}):d[P]=M,d}function x(d,P){if(!(d instanceof P))throw new TypeError("Cannot call a class as a function")}function _(d,P){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:d}function b(d,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);d.prototype=Object.create(P&&P.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(d,P):d.__proto__=P)}var g=function(d){b(P,d);function P(){return x(this,P),_(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return o(P,[{key:"format",value:function(T,I){T===h.blotName&&!I?this.replaceWith(m.default.create(this.statics.scope)):s(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"format",this).call(this,T,I)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():s(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(T,I){return this.parent.isolate(this.offset(this.parent),this.length()),T===this.parent.statics.blotName?(this.parent.replaceWith(T,I),this):(this.parent.unwrap(),s(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"replaceWith",this).call(this,T,I))}}],[{key:"formats",value:function(T){return T.tagName===this.tagName?void 0:s(P.__proto__||Object.getPrototypeOf(P),"formats",this).call(this,T)}}]),P}(v.default);g.blotName="list-item",g.tagName="LI";var h=function(d){b(P,d),o(P,null,[{key:"create",value:function(T){var I=T==="ordered"?"OL":"UL",F=s(P.__proto__||Object.getPrototypeOf(P),"create",this).call(this,I);return(T==="checked"||T==="unchecked")&&F.setAttribute("data-checked",T==="checked"),F}},{key:"formats",value:function(T){if(T.tagName==="OL")return"ordered";if(T.tagName==="UL")return T.hasAttribute("data-checked")?T.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function P(M){x(this,P);var T=_(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,M)),I=function(k){if(k.target.parentNode===M){var O=T.statics.formats(M),N=m.default.find(k.target);O==="checked"?N.format("list","unchecked"):O==="unchecked"&&N.format("list","checked")}};return M.addEventListener("touchstart",I),M.addEventListener("mousedown",I),T}return o(P,[{key:"format",value:function(T,I){this.children.length>0&&this.children.tail.format(T,I)}},{key:"formats",value:function(){return S({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(T,I){if(T instanceof g)s(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"insertBefore",this).call(this,T,I);else{var F=I==null?this.length():I.offset(this),k=this.split(F);k.parent.insertBefore(T,k)}}},{key:"optimize",value:function(T){s(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"optimize",this).call(this,T);var I=this.next;I!=null&&I.prev===this&&I.statics.blotName===this.statics.blotName&&I.domNode.tagName===this.domNode.tagName&&I.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(I.moveChildren(this),I.remove())}},{key:"replace",value:function(T){if(T.statics.blotName!==this.statics.blotName){var I=m.default.create(this.statics.defaultChild);T.moveChildren(I),this.appendChild(I)}s(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"replace",this).call(this,T)}}]),P}(E.default);h.blotName="list",h.scope=m.default.Scope.BLOCK_BLOT,h.tagName=["OL","UL"],h.defaultChild="list-item",h.allowedChildren=[g],r.ListItem=g,r.default=h},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=a(56),s=c(o);function c(E){return E&&E.__esModule?E:{default:E}}function m(E,w){if(!(E instanceof w))throw new TypeError("Cannot call a class as a function")}function f(E,w){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:E}function v(E,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);E.prototype=Object.create(w&&w.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(E,w):E.__proto__=w)}var y=function(E){v(w,E);function w(){return m(this,w),f(this,(w.__proto__||Object.getPrototypeOf(w)).apply(this,arguments))}return w}(s.default);y.blotName="italic",y.tagName=["EM","I"],r.default=y},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function S(x,_){for(var b=0;b<_.length;b++){var g=_[b];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(x,g.key,g)}}return function(x,_,b){return _&&S(x.prototype,_),b&&S(x,b),x}}(),s=function S(x,_,b){x===null&&(x=Function.prototype);var g=Object.getOwnPropertyDescriptor(x,_);if(g===void 0){var h=Object.getPrototypeOf(x);return h===null?void 0:S(h,_,b)}else{if("value"in g)return g.value;var d=g.get;return d===void 0?void 0:d.call(b)}},c=a(6),m=f(c);function f(S){return S&&S.__esModule?S:{default:S}}function v(S,x){if(!(S instanceof x))throw new TypeError("Cannot call a class as a function")}function y(S,x){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:S}function E(S,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);S.prototype=Object.create(x&&x.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(S,x):S.__proto__=x)}var w=function(S){E(x,S);function x(){return v(this,x),y(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return o(x,null,[{key:"create",value:function(b){return b==="super"?document.createElement("sup"):b==="sub"?document.createElement("sub"):s(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this,b)}},{key:"formats",value:function(b){if(b.tagName==="SUB")return"sub";if(b.tagName==="SUP")return"super"}}]),x}(m.default);w.blotName="script",w.tagName=["SUB","SUP"],r.default=w},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=a(6),s=c(o);function c(E){return E&&E.__esModule?E:{default:E}}function m(E,w){if(!(E instanceof w))throw new TypeError("Cannot call a class as a function")}function f(E,w){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:E}function v(E,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);E.prototype=Object.create(w&&w.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(E,w):E.__proto__=w)}var y=function(E){v(w,E);function w(){return m(this,w),f(this,(w.__proto__||Object.getPrototypeOf(w)).apply(this,arguments))}return w}(s.default);y.blotName="strike",y.tagName="S",r.default=y},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=a(6),s=c(o);function c(E){return E&&E.__esModule?E:{default:E}}function m(E,w){if(!(E instanceof w))throw new TypeError("Cannot call a class as a function")}function f(E,w){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:E}function v(E,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);E.prototype=Object.create(w&&w.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(E,w):E.__proto__=w)}var y=function(E){v(w,E);function w(){return m(this,w),f(this,(w.__proto__||Object.getPrototypeOf(w)).apply(this,arguments))}return w}(s.default);y.blotName="underline",y.tagName="U",r.default=y},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function _(b,g){for(var h=0;h<g.length;h++){var d=g[h];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(b,d.key,d)}}return function(b,g,h){return g&&_(b.prototype,g),h&&_(b,h),b}}(),s=function _(b,g,h){b===null&&(b=Function.prototype);var d=Object.getOwnPropertyDescriptor(b,g);if(d===void 0){var P=Object.getPrototypeOf(b);return P===null?void 0:_(P,g,h)}else{if("value"in d)return d.value;var M=d.get;return M===void 0?void 0:M.call(h)}},c=a(0),m=v(c),f=a(27);function v(_){return _&&_.__esModule?_:{default:_}}function y(_,b){if(!(_ instanceof b))throw new TypeError("Cannot call a class as a function")}function E(_,b){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:_}function w(_,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);_.prototype=Object.create(b&&b.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(_,b):_.__proto__=b)}var S=["alt","height","width"],x=function(_){w(b,_);function b(){return y(this,b),E(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return o(b,[{key:"format",value:function(h,d){S.indexOf(h)>-1?d?this.domNode.setAttribute(h,d):this.domNode.removeAttribute(h):s(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,h,d)}}],[{key:"create",value:function(h){var d=s(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,h);return typeof h=="string"&&d.setAttribute("src",this.sanitize(h)),d}},{key:"formats",value:function(h){return S.reduce(function(d,P){return h.hasAttribute(P)&&(d[P]=h.getAttribute(P)),d},{})}},{key:"match",value:function(h){return/\.(jpe?g|gif|png)$/.test(h)||/^data:image\/.+;base64/.test(h)}},{key:"sanitize",value:function(h){return(0,f.sanitize)(h,["http","https","data"])?h:"//:0"}},{key:"value",value:function(h){return h.getAttribute("src")}}]),b}(m.default.Embed);x.blotName="image",x.tagName="IMG",r.default=x},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function _(b,g){for(var h=0;h<g.length;h++){var d=g[h];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(b,d.key,d)}}return function(b,g,h){return g&&_(b.prototype,g),h&&_(b,h),b}}(),s=function _(b,g,h){b===null&&(b=Function.prototype);var d=Object.getOwnPropertyDescriptor(b,g);if(d===void 0){var P=Object.getPrototypeOf(b);return P===null?void 0:_(P,g,h)}else{if("value"in d)return d.value;var M=d.get;return M===void 0?void 0:M.call(h)}},c=a(4),m=a(27),f=v(m);function v(_){return _&&_.__esModule?_:{default:_}}function y(_,b){if(!(_ instanceof b))throw new TypeError("Cannot call a class as a function")}function E(_,b){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:_}function w(_,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);_.prototype=Object.create(b&&b.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(_,b):_.__proto__=b)}var S=["height","width"],x=function(_){w(b,_);function b(){return y(this,b),E(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return o(b,[{key:"format",value:function(h,d){S.indexOf(h)>-1?d?this.domNode.setAttribute(h,d):this.domNode.removeAttribute(h):s(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,h,d)}}],[{key:"create",value:function(h){var d=s(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,h);return d.setAttribute("frameborder","0"),d.setAttribute("allowfullscreen",!0),d.setAttribute("src",this.sanitize(h)),d}},{key:"formats",value:function(h){return S.reduce(function(d,P){return h.hasAttribute(P)&&(d[P]=h.getAttribute(P)),d},{})}},{key:"sanitize",value:function(h){return f.default.sanitize(h)}},{key:"value",value:function(h){return h.getAttribute("src")}}]),b}(c.BlockEmbed);x.blotName="video",x.className="ql-video",x.tagName="IFRAME",r.default=x},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.FormulaBlot=void 0;var o=function(){function h(d,P){for(var M=0;M<P.length;M++){var T=P[M];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(d,T.key,T)}}return function(d,P,M){return P&&h(d.prototype,P),M&&h(d,M),d}}(),s=function h(d,P,M){d===null&&(d=Function.prototype);var T=Object.getOwnPropertyDescriptor(d,P);if(T===void 0){var I=Object.getPrototypeOf(d);return I===null?void 0:h(I,P,M)}else{if("value"in T)return T.value;var F=T.get;return F===void 0?void 0:F.call(M)}},c=a(35),m=w(c),f=a(5),v=w(f),y=a(9),E=w(y);function w(h){return h&&h.__esModule?h:{default:h}}function S(h,d){if(!(h instanceof d))throw new TypeError("Cannot call a class as a function")}function x(h,d){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:h}function _(h,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);h.prototype=Object.create(d&&d.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(h,d):h.__proto__=d)}var b=function(h){_(d,h);function d(){return S(this,d),x(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return o(d,null,[{key:"create",value:function(M){var T=s(d.__proto__||Object.getPrototypeOf(d),"create",this).call(this,M);return typeof M=="string"&&(window.katex.render(M,T,{throwOnError:!1,errorColor:"#f00"}),T.setAttribute("data-value",M)),T}},{key:"value",value:function(M){return M.getAttribute("data-value")}}]),d}(m.default);b.blotName="formula",b.className="ql-formula",b.tagName="SPAN";var g=function(h){_(d,h),o(d,null,[{key:"register",value:function(){v.default.register(b,!0)}}]);function d(){S(this,d);var P=x(this,(d.__proto__||Object.getPrototypeOf(d)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return P}return d}(E.default);r.FormulaBlot=b,r.default=g},function(t,r,a){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.CodeToken=r.CodeBlock=void 0;var o=function(){function M(T,I){for(var F=0;F<I.length;F++){var k=I[F];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(T,k.key,k)}}return function(T,I,F){return I&&M(T.prototype,I),F&&M(T,F),T}}(),s=function M(T,I,F){T===null&&(T=Function.prototype);var k=Object.getOwnPropertyDescriptor(T,I);if(k===void 0){var O=Object.getPrototypeOf(T);return O===null?void 0:M(O,I,F)}else{if("value"in k)return k.value;var N=k.get;return N===void 0?void 0:N.call(F)}},c=a(0),m=x(c),f=a(5),v=x(f),y=a(9),E=x(y),w=a(13),S=x(w);function x(M){return M&&M.__esModule?M:{default:M}}function _(M,T){if(!(M instanceof T))throw new TypeError("Cannot call a class as a function")}function b(M,T){if(!M)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:M}function g(M,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);M.prototype=Object.create(T&&T.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(M,T):M.__proto__=T)}var h=function(M){g(T,M);function T(){return _(this,T),b(this,(T.__proto__||Object.getPrototypeOf(T)).apply(this,arguments))}return o(T,[{key:"replaceWith",value:function(F){this.domNode.textContent=this.domNode.textContent,this.attach(),s(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"replaceWith",this).call(this,F)}},{key:"highlight",value:function(F){var k=this.domNode.textContent;this.cachedText!==k&&((k.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=F(k),this.domNode.normalize(),this.attach()),this.cachedText=k)}}]),T}(S.default);h.className="ql-syntax";var d=new m.default.Attributor.Class("token","hljs",{scope:m.default.Scope.INLINE}),P=function(M){g(T,M),o(T,null,[{key:"register",value:function(){v.default.register(d,!0),v.default.register(h,!0)}}]);function T(I,F){_(this,T);var k=b(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,I,F));if(typeof k.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var O=null;return k.quill.on(v.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(O),O=setTimeout(function(){k.highlight(),O=null},k.options.interval)}),k.highlight(),k}return o(T,[{key:"highlight",value:function(){var F=this;if(!this.quill.selection.composing){this.quill.update(v.default.sources.USER);var k=this.quill.getSelection();this.quill.scroll.descendants(h).forEach(function(O){O.highlight(F.options.highlight)}),this.quill.update(v.default.sources.SILENT),k!=null&&this.quill.setSelection(k,v.default.sources.SILENT)}}}]),T}(E.default);P.DEFAULTS={highlight:function(){return window.hljs==null?null:function(M){var T=window.hljs.highlightAuto(M);return T.value}}(),interval:1e3},r.CodeBlock=h,r.CodeToken=d,r.default=P},function(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r){t.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(t,r,a){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.BubbleTooltip=void 0;var o=function T(I,F,k){I===null&&(I=Function.prototype);var O=Object.getOwnPropertyDescriptor(I,F);if(O===void 0){var N=Object.getPrototypeOf(I);return N===null?void 0:T(N,F,k)}else{if("value"in O)return O.value;var A=O.get;return A===void 0?void 0:A.call(k)}},s=function(){function T(I,F){for(var k=0;k<F.length;k++){var O=F[k];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(I,O.key,O)}}return function(I,F,k){return F&&T(I.prototype,F),k&&T(I,k),I}}(),c=a(3),m=_(c),f=a(8),v=_(f),y=a(43),E=_(y),w=a(15),S=a(41),x=_(S);function _(T){return T&&T.__esModule?T:{default:T}}function b(T,I){if(!(T instanceof I))throw new TypeError("Cannot call a class as a function")}function g(T,I){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:T}function h(T,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);T.prototype=Object.create(I&&I.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(T,I):T.__proto__=I)}var d=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],P=function(T){h(I,T);function I(F,k){b(this,I),k.modules.toolbar!=null&&k.modules.toolbar.container==null&&(k.modules.toolbar.container=d);var O=g(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,F,k));return O.quill.container.classList.add("ql-bubble"),O}return s(I,[{key:"extendToolbar",value:function(k){this.tooltip=new M(this.quill,this.options.bounds),this.tooltip.root.appendChild(k.container),this.buildButtons([].slice.call(k.container.querySelectorAll("button")),x.default),this.buildPickers([].slice.call(k.container.querySelectorAll("select")),x.default)}}]),I}(E.default);P.DEFAULTS=(0,m.default)(!0,{},E.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(I){I?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var M=function(T){h(I,T);function I(F,k){b(this,I);var O=g(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,F,k));return O.quill.on(v.default.events.EDITOR_CHANGE,function(N,A,R,L){if(N===v.default.events.SELECTION_CHANGE)if(A!=null&&A.length>0&&L===v.default.sources.USER){O.show(),O.root.style.left="0px",O.root.style.width="",O.root.style.width=O.root.offsetWidth+"px";var V=O.quill.getLines(A.index,A.length);if(V.length===1)O.position(O.quill.getBounds(A));else{var G=V[V.length-1],W=O.quill.getIndex(G),X=Math.min(G.length()-1,A.index+A.length-W),q=O.quill.getBounds(new w.Range(W,X));O.position(q)}}else document.activeElement!==O.textbox&&O.quill.hasFocus()&&O.hide()}),O}return s(I,[{key:"listen",value:function(){var k=this;o(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){k.root.classList.remove("ql-editing")}),this.quill.on(v.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!k.root.classList.contains("ql-hidden")){var O=k.quill.getSelection();O!=null&&k.position(k.quill.getBounds(O))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(k){var O=o(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"position",this).call(this,k),N=this.root.querySelector(".ql-tooltip-arrow");if(N.style.marginLeft="",O===0)return O;N.style.marginLeft=-1*O-N.offsetWidth/2+"px"}}]),I}(y.BaseTooltip);M.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),r.BubbleTooltip=M,r.default=P},function(t,r,a){t.exports=a(63)}]).default})}(up)),up.exports}var Uo={},cp={exports:{}},js={},Ed={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var dO=Ed.exports,ab;function hO(){return ab||(ab=1,function(e,n){(function(t){var r=n&&!n.nodeType&&n,a=e&&!e.nodeType&&e,o=typeof oc=="object"&&oc;(o.global===o||o.window===o||o.self===o)&&(t=o);var s,c=2147483647,m=36,f=1,v=26,y=38,E=700,w=72,S=128,x="-",_=/^xn--/,b=/[^\x20-\x7E]/,g=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=m-f,P=Math.floor,M=String.fromCharCode,T;function I(q){throw new RangeError(h[q])}function F(q,z){for(var Y=q.length,U=[];Y--;)U[Y]=z(q[Y]);return U}function k(q,z){var Y=q.split("@"),U="";Y.length>1&&(U=Y[0]+"@",q=Y[1]),q=q.replace(g,".");var ee=q.split("."),te=F(ee,z).join(".");return U+te}function O(q){for(var z=[],Y=0,U=q.length,ee,te;Y<U;)ee=q.charCodeAt(Y++),ee>=55296&&ee<=56319&&Y<U?(te=q.charCodeAt(Y++),(te&64512)==56320?z.push(((ee&1023)<<10)+(te&1023)+65536):(z.push(ee),Y--)):z.push(ee);return z}function N(q){return F(q,function(z){var Y="";return z>65535&&(z-=65536,Y+=M(z>>>10&1023|55296),z=56320|z&1023),Y+=M(z),Y}).join("")}function A(q){return q-48<10?q-22:q-65<26?q-65:q-97<26?q-97:m}function R(q,z){return q+22+75*(q<26)-((z!=0)<<5)}function L(q,z,Y){var U=0;for(q=Y?P(q/E):q>>1,q+=P(q/z);q>d*v>>1;U+=m)q=P(q/d);return P(U+(d+1)*q/(q+y))}function V(q){var z=[],Y=q.length,U,ee=0,te=S,Q=w,Z,re,ne,ae,ue,fe,pe,ye,we;for(Z=q.lastIndexOf(x),Z<0&&(Z=0),re=0;re<Z;++re)q.charCodeAt(re)>=128&&I("not-basic"),z.push(q.charCodeAt(re));for(ne=Z>0?Z+1:0;ne<Y;){for(ae=ee,ue=1,fe=m;ne>=Y&&I("invalid-input"),pe=A(q.charCodeAt(ne++)),(pe>=m||pe>P((c-ee)/ue))&&I("overflow"),ee+=pe*ue,ye=fe<=Q?f:fe>=Q+v?v:fe-Q,!(pe<ye);fe+=m)we=m-ye,ue>P(c/we)&&I("overflow"),ue*=we;U=z.length+1,Q=L(ee-ae,U,ae==0),P(ee/U)>c-te&&I("overflow"),te+=P(ee/U),ee%=U,z.splice(ee++,0,te)}return N(z)}function G(q){var z,Y,U,ee,te,Q,Z,re,ne,ae,ue,fe=[],pe,ye,we,je;for(q=O(q),pe=q.length,z=S,Y=0,te=w,Q=0;Q<pe;++Q)ue=q[Q],ue<128&&fe.push(M(ue));for(U=ee=fe.length,ee&&fe.push(x);U<pe;){for(Z=c,Q=0;Q<pe;++Q)ue=q[Q],ue>=z&&ue<Z&&(Z=ue);for(ye=U+1,Z-z>P((c-Y)/ye)&&I("overflow"),Y+=(Z-z)*ye,z=Z,Q=0;Q<pe;++Q)if(ue=q[Q],ue<z&&++Y>c&&I("overflow"),ue==z){for(re=Y,ne=m;ae=ne<=te?f:ne>=te+v?v:ne-te,!(re<ae);ne+=m)je=re-ae,we=m-ae,fe.push(M(R(ae+je%we,0))),re=P(je/we);fe.push(M(R(re,0))),te=L(Y,ye,U==ee),Y=0,++U}++Y,++z}return fe.join("")}function W(q){return k(q,function(z){return _.test(z)?V(z.slice(4).toLowerCase()):z})}function X(q){return k(q,function(z){return b.test(z)?"xn--"+G(z):z})}if(s={version:"1.4.1",ucs2:{decode:O,encode:N},decode:V,encode:G,toASCII:X,toUnicode:W},r&&a)if(e.exports==r)a.exports=s;else for(T in s)s.hasOwnProperty(T)&&(r[T]=s[T]);else t.punycode=s})(dO)}(Ed,Ed.exports)),Ed.exports}var p0,ob;function Sc(){return ob||(ob=1,p0=TypeError),p0}const pO={},gO=Object.freeze(Object.defineProperty({__proto__:null,default:pO},Symbol.toStringTag,{value:"Module"})),vO=Yl(gO);var g0,lb;function Vp(){if(lb)return g0;lb=1;var e=typeof Map=="function"&&Map.prototype,n=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,t=e&&n&&typeof n.get=="function"?n.get:null,r=e&&Map.prototype.forEach,a=typeof Set=="function"&&Set.prototype,o=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=a&&o&&typeof o.get=="function"?o.get:null,c=a&&Set.prototype.forEach,m=typeof WeakMap=="function"&&WeakMap.prototype,f=m?WeakMap.prototype.has:null,v=typeof WeakSet=="function"&&WeakSet.prototype,y=v?WeakSet.prototype.has:null,E=typeof WeakRef=="function"&&WeakRef.prototype,w=E?WeakRef.prototype.deref:null,S=Boolean.prototype.valueOf,x=Object.prototype.toString,_=Function.prototype.toString,b=String.prototype.match,g=String.prototype.slice,h=String.prototype.replace,d=String.prototype.toUpperCase,P=String.prototype.toLowerCase,M=RegExp.prototype.test,T=Array.prototype.concat,I=Array.prototype.join,F=Array.prototype.slice,k=Math.floor,O=typeof BigInt=="function"?BigInt.prototype.valueOf:null,N=Object.getOwnPropertySymbols,A=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,R=typeof Symbol=="function"&&typeof Symbol.iterator=="object",L=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===R||!0)?Symbol.toStringTag:null,V=Object.prototype.propertyIsEnumerable,G=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(Oe){return Oe.__proto__}:null);function W(Oe,Se){if(Oe===1/0||Oe===-1/0||Oe!==Oe||Oe&&Oe>-1e3&&Oe<1e3||M.call(/e/,Se))return Se;var yt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof Oe=="number"){var Fe=Oe<0?-k(-Oe):k(Oe);if(Fe!==Oe){var qe=String(Fe),$e=g.call(Se,qe.length+1);return h.call(qe,yt,"$&_")+"."+h.call(h.call($e,/([0-9]{3})/g,"$&_"),/_$/,"")}}return h.call(Se,yt,"$&_")}var X=vO,q=X.custom,z=ye(q)?q:null,Y={__proto__:null,double:'"',single:"'"},U={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};g0=function Oe(Se,yt,Fe,qe){var $e=yt||{};if(Te($e,"quoteStyle")&&!Te(Y,$e.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Te($e,"maxStringLength")&&(typeof $e.maxStringLength=="number"?$e.maxStringLength<0&&$e.maxStringLength!==1/0:$e.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Et=Te($e,"customInspect")?$e.customInspect:!0;if(typeof Et!="boolean"&&Et!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Te($e,"indent")&&$e.indent!==null&&$e.indent!==" "&&!(parseInt($e.indent,10)===$e.indent&&$e.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Te($e,"numericSeparator")&&typeof $e.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Pt=$e.numericSeparator;if(typeof Se>"u")return"undefined";if(Se===null)return"null";if(typeof Se=="boolean")return Se?"true":"false";if(typeof Se=="string")return Qe(Se,$e);if(typeof Se=="number"){if(Se===0)return 1/0/Se>0?"0":"-0";var ht=String(Se);return Pt?W(Se,ht):ht}if(typeof Se=="bigint"){var ze=String(Se)+"n";return Pt?W(Se,ze):ze}var at=typeof $e.depth>"u"?5:$e.depth;if(typeof Fe>"u"&&(Fe=0),Fe>=at&&at>0&&typeof Se=="object")return Z(Se)?"[Array]":"[Object]";var Pe=mt($e,Fe);if(typeof qe>"u")qe=[];else if(he(qe,Se)>=0)return"[Circular]";function me(ti,Li,Qs){if(Li&&(qe=F.call(qe),qe.push(Li)),Qs){var rs={depth:$e.depth};return Te($e,"quoteStyle")&&(rs.quoteStyle=$e.quoteStyle),Oe(ti,rs,Fe+1,qe)}return Oe(ti,$e,Fe+1,qe)}if(typeof Se=="function"&&!ne(Se)){var He=_e(Se),Me=jt(Se,me);return"[Function"+(He?": "+He:" (anonymous)")+"]"+(Me.length>0?" { "+I.call(Me,", ")+" }":"")}if(ye(Se)){var Ye=R?h.call(String(Se),/^(Symbol\(.*\))_[^)]*$/,"$1"):A.call(Se);return typeof Se=="object"&&!R?St(Ye):Ye}if(Be(Se)){for(var et="<"+P.call(String(Se.nodeName)),ut=Se.attributes||[],wt=0;wt<ut.length;wt++)et+=" "+ut[wt].name+"="+ee(te(ut[wt].value),"double",$e);return et+=">",Se.childNodes&&Se.childNodes.length&&(et+="..."),et+="</"+P.call(String(Se.nodeName))+">",et}if(Z(Se)){if(Se.length===0)return"[]";var Ct=jt(Se,me);return Pe&&!gt(Ct)?"["+kt(Ct,Pe)+"]":"[ "+I.call(Ct,", ")+" ]"}if(ae(Se)){var Jt=jt(Se,me);return!("cause"in Error.prototype)&&"cause"in Se&&!V.call(Se,"cause")?"{ ["+String(Se)+"] "+I.call(T.call("[cause]: "+me(Se.cause),Jt),", ")+" }":Jt.length===0?"["+String(Se)+"]":"{ ["+String(Se)+"] "+I.call(Jt,", ")+" }"}if(typeof Se=="object"&&Et){if(z&&typeof Se[z]=="function"&&X)return X(Se,{depth:at-Fe});if(Et!=="symbol"&&typeof Se.inspect=="function")return Se.inspect()}if(xe(Se)){var Wt=[];return r&&r.call(Se,function(ti,Li){Wt.push(me(Li,Se,!0)+" => "+me(ti,Se))}),rt("Map",t.call(Se),Wt,Pe)}if(de(Se)){var er=[];return c&&c.call(Se,function(ti){er.push(me(ti,Se))}),rt("Set",s.call(Se),er,Pe)}if(oe(Se))return Ue("WeakMap");if(ke(Se))return Ue("WeakSet");if(ve(Se))return Ue("WeakRef");if(fe(Se))return St(me(Number(Se)));if(we(Se))return St(me(O.call(Se)));if(pe(Se))return St(S.call(Se));if(ue(Se))return St(me(String(Se)));if(typeof window<"u"&&Se===window)return"{ [object Window] }";if(typeof globalThis<"u"&&Se===globalThis||typeof oc<"u"&&Se===oc)return"{ [object globalThis] }";if(!re(Se)&&!ne(Se)){var cr=jt(Se,me),Jn=G?G(Se)===Object.prototype:Se instanceof Object||Se.constructor===Object,Nr=Se instanceof Object?"":"null prototype",ei=!Jn&&L&&Object(Se)===Se&&L in Se?g.call(se(Se),8,-1):Nr?"Object":"",lo=Jn||typeof Se.constructor!="function"?"":Se.constructor.name?Se.constructor.name+" ":"",ka=lo+(ei||Nr?"["+I.call(T.call([],ei||[],Nr||[]),": ")+"] ":"");return cr.length===0?ka+"{}":Pe?ka+"{"+kt(cr,Pe)+"}":ka+"{ "+I.call(cr,", ")+" }"}return String(Se)};function ee(Oe,Se,yt){var Fe=yt.quoteStyle||Se,qe=Y[Fe];return qe+Oe+qe}function te(Oe){return h.call(String(Oe),/"/g,"&quot;")}function Q(Oe){return!L||!(typeof Oe=="object"&&(L in Oe||typeof Oe[L]<"u"))}function Z(Oe){return se(Oe)==="[object Array]"&&Q(Oe)}function re(Oe){return se(Oe)==="[object Date]"&&Q(Oe)}function ne(Oe){return se(Oe)==="[object RegExp]"&&Q(Oe)}function ae(Oe){return se(Oe)==="[object Error]"&&Q(Oe)}function ue(Oe){return se(Oe)==="[object String]"&&Q(Oe)}function fe(Oe){return se(Oe)==="[object Number]"&&Q(Oe)}function pe(Oe){return se(Oe)==="[object Boolean]"&&Q(Oe)}function ye(Oe){if(R)return Oe&&typeof Oe=="object"&&Oe instanceof Symbol;if(typeof Oe=="symbol")return!0;if(!Oe||typeof Oe!="object"||!A)return!1;try{return A.call(Oe),!0}catch{}return!1}function we(Oe){if(!Oe||typeof Oe!="object"||!O)return!1;try{return O.call(Oe),!0}catch{}return!1}var je=Object.prototype.hasOwnProperty||function(Oe){return Oe in this};function Te(Oe,Se){return je.call(Oe,Se)}function se(Oe){return x.call(Oe)}function _e(Oe){if(Oe.name)return Oe.name;var Se=b.call(_.call(Oe),/^function\s*([\w$]+)/);return Se?Se[1]:null}function he(Oe,Se){if(Oe.indexOf)return Oe.indexOf(Se);for(var yt=0,Fe=Oe.length;yt<Fe;yt++)if(Oe[yt]===Se)return yt;return-1}function xe(Oe){if(!t||!Oe||typeof Oe!="object")return!1;try{t.call(Oe);try{s.call(Oe)}catch{return!0}return Oe instanceof Map}catch{}return!1}function oe(Oe){if(!f||!Oe||typeof Oe!="object")return!1;try{f.call(Oe,f);try{y.call(Oe,y)}catch{return!0}return Oe instanceof WeakMap}catch{}return!1}function ve(Oe){if(!w||!Oe||typeof Oe!="object")return!1;try{return w.call(Oe),!0}catch{}return!1}function de(Oe){if(!s||!Oe||typeof Oe!="object")return!1;try{s.call(Oe);try{t.call(Oe)}catch{return!0}return Oe instanceof Set}catch{}return!1}function ke(Oe){if(!y||!Oe||typeof Oe!="object")return!1;try{y.call(Oe,y);try{f.call(Oe,f)}catch{return!0}return Oe instanceof WeakSet}catch{}return!1}function Be(Oe){return!Oe||typeof Oe!="object"?!1:typeof HTMLElement<"u"&&Oe instanceof HTMLElement?!0:typeof Oe.nodeName=="string"&&typeof Oe.getAttribute=="function"}function Qe(Oe,Se){if(Oe.length>Se.maxStringLength){var yt=Oe.length-Se.maxStringLength,Fe="... "+yt+" more character"+(yt>1?"s":"");return Qe(g.call(Oe,0,Se.maxStringLength),Se)+Fe}var qe=U[Se.quoteStyle||"single"];qe.lastIndex=0;var $e=h.call(h.call(Oe,qe,"\\$1"),/[\x00-\x1f]/g,Ke);return ee($e,"single",Se)}function Ke(Oe){var Se=Oe.charCodeAt(0),yt={8:"b",9:"t",10:"n",12:"f",13:"r"}[Se];return yt?"\\"+yt:"\\x"+(Se<16?"0":"")+d.call(Se.toString(16))}function St(Oe){return"Object("+Oe+")"}function Ue(Oe){return Oe+" { ? }"}function rt(Oe,Se,yt,Fe){var qe=Fe?kt(yt,Fe):I.call(yt,", ");return Oe+" ("+Se+") {"+qe+"}"}function gt(Oe){for(var Se=0;Se<Oe.length;Se++)if(he(Oe[Se],`
149
- `)>=0)return!1;return!0}function mt(Oe,Se){var yt;if(Oe.indent===" ")yt=" ";else if(typeof Oe.indent=="number"&&Oe.indent>0)yt=I.call(Array(Oe.indent+1)," ");else return null;return{base:yt,prev:I.call(Array(Se+1),yt)}}function kt(Oe,Se){if(Oe.length===0)return"";var yt=`
150
- `+Se.prev+Se.base;return yt+I.call(Oe,","+yt)+`
151
- `+Se.prev}function jt(Oe,Se){var yt=Z(Oe),Fe=[];if(yt){Fe.length=Oe.length;for(var qe=0;qe<Oe.length;qe++)Fe[qe]=Te(Oe,qe)?Se(Oe[qe],Oe):""}var $e=typeof N=="function"?N(Oe):[],Et;if(R){Et={};for(var Pt=0;Pt<$e.length;Pt++)Et["$"+$e[Pt]]=$e[Pt]}for(var ht in Oe)Te(Oe,ht)&&(yt&&String(Number(ht))===ht&&ht<Oe.length||R&&Et["$"+ht]instanceof Symbol||(M.call(/[^\w$]/,ht)?Fe.push(Se(ht,Oe)+": "+Se(Oe[ht],Oe)):Fe.push(ht+": "+Se(Oe[ht],Oe))));if(typeof N=="function")for(var ze=0;ze<$e.length;ze++)V.call(Oe,$e[ze])&&Fe.push("["+Se($e[ze])+"]: "+Se(Oe[$e[ze]],Oe));return Fe}return g0}var v0,sb;function mO(){if(sb)return v0;sb=1;var e=Vp(),n=Sc(),t=function(c,m,f){for(var v=c,y;(y=v.next)!=null;v=y)if(y.key===m)return v.next=y.next,f||(y.next=c.next,c.next=y),y},r=function(c,m){if(c){var f=t(c,m);return f&&f.value}},a=function(c,m,f){var v=t(c,m);v?v.value=f:c.next={key:m,next:c.next,value:f}},o=function(c,m){return c?!!t(c,m):!1},s=function(c,m){if(c)return t(c,m,!0)};return v0=function(){var m,f={assert:function(v){if(!f.has(v))throw new n("Side channel does not contain "+e(v))},delete:function(v){var y=m&&m.next,E=s(m,v);return E&&y&&y===E&&(m=void 0),!!E},get:function(v){return r(m,v)},has:function(v){return o(m,v)},set:function(v,y){m||(m={next:void 0}),a(m,v,y)}};return f},v0}var m0,ub;function B4(){return ub||(ub=1,m0=Object),m0}var y0,cb;function yO(){return cb||(cb=1,y0=Error),y0}var b0,fb;function bO(){return fb||(fb=1,b0=EvalError),b0}var w0,db;function wO(){return db||(db=1,w0=RangeError),w0}var _0,hb;function _O(){return hb||(hb=1,_0=ReferenceError),_0}var S0,pb;function SO(){return pb||(pb=1,S0=SyntaxError),S0}var E0,gb;function EO(){return gb||(gb=1,E0=URIError),E0}var x0,vb;function xO(){return vb||(vb=1,x0=Math.abs),x0}var O0,mb;function OO(){return mb||(mb=1,O0=Math.floor),O0}var P0,yb;function PO(){return yb||(yb=1,P0=Math.max),P0}var C0,bb;function CO(){return bb||(bb=1,C0=Math.min),C0}var k0,wb;function kO(){return wb||(wb=1,k0=Math.pow),k0}var A0,_b;function AO(){return _b||(_b=1,A0=Math.round),A0}var T0,Sb;function TO(){return Sb||(Sb=1,T0=Number.isNaN||function(n){return n!==n}),T0}var R0,Eb;function RO(){if(Eb)return R0;Eb=1;var e=TO();return R0=function(t){return e(t)||t===0?t:t<0?-1:1},R0}var M0,xb;function MO(){return xb||(xb=1,M0=Object.getOwnPropertyDescriptor),M0}var L0,Ob;function U4(){if(Ob)return L0;Ob=1;var e=MO();if(e)try{e([],"length")}catch{e=null}return L0=e,L0}var N0,Pb;function LO(){if(Pb)return N0;Pb=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return N0=e,N0}var I0,Cb;function NO(){return Cb||(Cb=1,I0=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var n={},t=Symbol("test"),r=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var a=42;n[t]=a;for(var o in n)return!1;if(typeof Object.keys=="function"&&Object.keys(n).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(n).length!==0)return!1;var s=Object.getOwnPropertySymbols(n);if(s.length!==1||s[0]!==t||!Object.prototype.propertyIsEnumerable.call(n,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(n,t);if(c.value!==a||c.enumerable!==!0)return!1}return!0}),I0}var j0,kb;function IO(){if(kb)return j0;kb=1;var e=typeof Symbol<"u"&&Symbol,n=NO();return j0=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:n()},j0}var D0,Ab;function q4(){return Ab||(Ab=1,D0=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),D0}var F0,Tb;function H4(){if(Tb)return F0;Tb=1;var e=B4();return F0=e.getPrototypeOf||null,F0}var z0,Rb;function jO(){if(Rb)return z0;Rb=1;var e="Function.prototype.bind called on incompatible ",n=Object.prototype.toString,t=Math.max,r="[object Function]",a=function(m,f){for(var v=[],y=0;y<m.length;y+=1)v[y]=m[y];for(var E=0;E<f.length;E+=1)v[E+m.length]=f[E];return v},o=function(m,f){for(var v=[],y=f,E=0;y<m.length;y+=1,E+=1)v[E]=m[y];return v},s=function(c,m){for(var f="",v=0;v<c.length;v+=1)f+=c[v],v+1<c.length&&(f+=m);return f};return z0=function(m){var f=this;if(typeof f!="function"||n.apply(f)!==r)throw new TypeError(e+f);for(var v=o(arguments,1),y,E=function(){if(this instanceof y){var b=f.apply(this,a(v,arguments));return Object(b)===b?b:this}return f.apply(m,a(v,arguments))},w=t(0,f.length-v.length),S=[],x=0;x<w;x++)S[x]="$"+x;if(y=Function("binder","return function ("+s(S,",")+"){ return binder.apply(this,arguments); }")(E),f.prototype){var _=function(){};_.prototype=f.prototype,y.prototype=new _,_.prototype=null}return y},z0}var B0,Mb;function $p(){if(Mb)return B0;Mb=1;var e=jO();return B0=Function.prototype.bind||e,B0}var U0,Lb;function Yv(){return Lb||(Lb=1,U0=Function.prototype.call),U0}var q0,Nb;function G4(){return Nb||(Nb=1,q0=Function.prototype.apply),q0}var H0,Ib;function DO(){return Ib||(Ib=1,H0=typeof Reflect<"u"&&Reflect&&Reflect.apply),H0}var G0,jb;function FO(){if(jb)return G0;jb=1;var e=$p(),n=G4(),t=Yv(),r=DO();return G0=r||e.call(t,n),G0}var V0,Db;function V4(){if(Db)return V0;Db=1;var e=$p(),n=Sc(),t=Yv(),r=FO();return V0=function(o){if(o.length<1||typeof o[0]!="function")throw new n("a function is required");return r(e,t,o)},V0}var $0,Fb;function zO(){if(Fb)return $0;Fb=1;var e=V4(),n=U4(),t;try{t=[].__proto__===Array.prototype}catch(s){if(!s||typeof s!="object"||!("code"in s)||s.code!=="ERR_PROTO_ACCESS")throw s}var r=!!t&&n&&n(Object.prototype,"__proto__"),a=Object,o=a.getPrototypeOf;return $0=r&&typeof r.get=="function"?e([r.get]):typeof o=="function"?function(c){return o(c==null?c:a(c))}:!1,$0}var W0,zb;function BO(){if(zb)return W0;zb=1;var e=q4(),n=H4(),t=zO();return W0=e?function(a){return e(a)}:n?function(a){if(!a||typeof a!="object"&&typeof a!="function")throw new TypeError("getProto: not an object");return n(a)}:t?function(a){return t(a)}:null,W0}var Y0,Bb;function UO(){if(Bb)return Y0;Bb=1;var e=Function.prototype.call,n=Object.prototype.hasOwnProperty,t=$p();return Y0=t.call(e,n),Y0}var K0,Ub;function Kv(){if(Ub)return K0;Ub=1;var e,n=B4(),t=yO(),r=bO(),a=wO(),o=_O(),s=SO(),c=Sc(),m=EO(),f=xO(),v=OO(),y=PO(),E=CO(),w=kO(),S=AO(),x=RO(),_=Function,b=function(ne){try{return _('"use strict"; return ('+ne+").constructor;")()}catch{}},g=U4(),h=LO(),d=function(){throw new c},P=g?function(){try{return arguments.callee,d}catch{try{return g(arguments,"callee").get}catch{return d}}}():d,M=IO()(),T=BO(),I=H4(),F=q4(),k=G4(),O=Yv(),N={},A=typeof Uint8Array>"u"||!T?e:T(Uint8Array),R={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":M&&T?T([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":N,"%AsyncGenerator%":N,"%AsyncGeneratorFunction%":N,"%AsyncIteratorPrototype%":N,"%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,"%Float16Array%":typeof Float16Array>"u"?e:Float16Array,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":_,"%GeneratorFunction%":N,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":M&&T?T(T([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!M||!T?e:T(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":n,"%Object.getOwnPropertyDescriptor%":g,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":a,"%ReferenceError%":o,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!M||!T?e:T(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":M&&T?T(""[Symbol.iterator]()):e,"%Symbol%":M?Symbol:e,"%SyntaxError%":s,"%ThrowTypeError%":P,"%TypedArray%":A,"%TypeError%":c,"%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%":m,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":O,"%Function.prototype.apply%":k,"%Object.defineProperty%":h,"%Object.getPrototypeOf%":I,"%Math.abs%":f,"%Math.floor%":v,"%Math.max%":y,"%Math.min%":E,"%Math.pow%":w,"%Math.round%":S,"%Math.sign%":x,"%Reflect.getPrototypeOf%":F};if(T)try{null.error}catch(ne){var L=T(T(ne));R["%Error.prototype%"]=L}var V=function ne(ae){var ue;if(ae==="%AsyncFunction%")ue=b("async function () {}");else if(ae==="%GeneratorFunction%")ue=b("function* () {}");else if(ae==="%AsyncGeneratorFunction%")ue=b("async function* () {}");else if(ae==="%AsyncGenerator%"){var fe=ne("%AsyncGeneratorFunction%");fe&&(ue=fe.prototype)}else if(ae==="%AsyncIteratorPrototype%"){var pe=ne("%AsyncGenerator%");pe&&T&&(ue=T(pe.prototype))}return R[ae]=ue,ue},G={__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"]},W=$p(),X=UO(),q=W.call(O,Array.prototype.concat),z=W.call(k,Array.prototype.splice),Y=W.call(O,String.prototype.replace),U=W.call(O,String.prototype.slice),ee=W.call(O,RegExp.prototype.exec),te=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Q=/\\(\\)?/g,Z=function(ae){var ue=U(ae,0,1),fe=U(ae,-1);if(ue==="%"&&fe!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(fe==="%"&&ue!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var pe=[];return Y(ae,te,function(ye,we,je,Te){pe[pe.length]=je?Y(Te,Q,"$1"):we||ye}),pe},re=function(ae,ue){var fe=ae,pe;if(X(G,fe)&&(pe=G[fe],fe="%"+pe[0]+"%"),X(R,fe)){var ye=R[fe];if(ye===N&&(ye=V(fe)),typeof ye>"u"&&!ue)throw new c("intrinsic "+ae+" exists, but is not available. Please file an issue!");return{alias:pe,name:fe,value:ye}}throw new s("intrinsic "+ae+" does not exist!")};return K0=function(ae,ue){if(typeof ae!="string"||ae.length===0)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ue!="boolean")throw new c('"allowMissing" argument must be a boolean');if(ee(/^%?[^%]*%?$/,ae)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var fe=Z(ae),pe=fe.length>0?fe[0]:"",ye=re("%"+pe+"%",ue),we=ye.name,je=ye.value,Te=!1,se=ye.alias;se&&(pe=se[0],z(fe,q([0,1],se)));for(var _e=1,he=!0;_e<fe.length;_e+=1){var xe=fe[_e],oe=U(xe,0,1),ve=U(xe,-1);if((oe==='"'||oe==="'"||oe==="`"||ve==='"'||ve==="'"||ve==="`")&&oe!==ve)throw new s("property names with quotes must have matching quotes");if((xe==="constructor"||!he)&&(Te=!0),pe+="."+xe,we="%"+pe+"%",X(R,we))je=R[we];else if(je!=null){if(!(xe in je)){if(!ue)throw new c("base intrinsic for "+ae+" exists, but the property is not available.");return}if(g&&_e+1>=fe.length){var de=g(je,xe);he=!!de,he&&"get"in de&&!("originalValue"in de.get)?je=de.get:je=je[xe]}else he=X(je,xe),je=je[xe];he&&!Te&&(R[we]=je)}}return je},K0}var X0,qb;function $4(){if(qb)return X0;qb=1;var e=Kv(),n=V4(),t=n([e("%String.prototype.indexOf%")]);return X0=function(a,o){var s=e(a,!!o);return typeof s=="function"&&t(a,".prototype.")>-1?n([s]):s},X0}var Z0,Hb;function W4(){if(Hb)return Z0;Hb=1;var e=Kv(),n=$4(),t=Vp(),r=Sc(),a=e("%Map%",!0),o=n("Map.prototype.get",!0),s=n("Map.prototype.set",!0),c=n("Map.prototype.has",!0),m=n("Map.prototype.delete",!0),f=n("Map.prototype.size",!0);return Z0=!!a&&function(){var y,E={assert:function(w){if(!E.has(w))throw new r("Side channel does not contain "+t(w))},delete:function(w){if(y){var S=m(y,w);return f(y)===0&&(y=void 0),S}return!1},get:function(w){if(y)return o(y,w)},has:function(w){return y?c(y,w):!1},set:function(w,S){y||(y=new a),s(y,w,S)}};return E},Z0}var Q0,Gb;function qO(){if(Gb)return Q0;Gb=1;var e=Kv(),n=$4(),t=Vp(),r=W4(),a=Sc(),o=e("%WeakMap%",!0),s=n("WeakMap.prototype.get",!0),c=n("WeakMap.prototype.set",!0),m=n("WeakMap.prototype.has",!0),f=n("WeakMap.prototype.delete",!0);return Q0=o?function(){var y,E,w={assert:function(S){if(!w.has(S))throw new a("Side channel does not contain "+t(S))},delete:function(S){if(o&&S&&(typeof S=="object"||typeof S=="function")){if(y)return f(y,S)}else if(r&&E)return E.delete(S);return!1},get:function(S){return o&&S&&(typeof S=="object"||typeof S=="function")&&y?s(y,S):E&&E.get(S)},has:function(S){return o&&S&&(typeof S=="object"||typeof S=="function")&&y?m(y,S):!!E&&E.has(S)},set:function(S,x){o&&S&&(typeof S=="object"||typeof S=="function")?(y||(y=new o),c(y,S,x)):r&&(E||(E=r()),E.set(S,x))}};return w}:r,Q0}var J0,Vb;function HO(){if(Vb)return J0;Vb=1;var e=Sc(),n=Vp(),t=mO(),r=W4(),a=qO(),o=a||r||t;return J0=function(){var c,m={assert:function(f){if(!m.has(f))throw new e("Side channel does not contain "+n(f))},delete:function(f){return!!c&&c.delete(f)},get:function(f){return c&&c.get(f)},has:function(f){return!!c&&c.has(f)},set:function(f,v){c||(c=o()),c.set(f,v)}};return m},J0}var e1,$b;function Xv(){if($b)return e1;$b=1;var e=String.prototype.replace,n=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return e1={default:t.RFC3986,formatters:{RFC1738:function(r){return e.call(r,n,"+")},RFC3986:function(r){return String(r)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},e1}var t1,Wb;function Y4(){if(Wb)return t1;Wb=1;var e=Xv(),n=Object.prototype.hasOwnProperty,t=Array.isArray,r=function(){for(var _=[],b=0;b<256;++b)_.push("%"+((b<16?"0":"")+b.toString(16)).toUpperCase());return _}(),a=function(b){for(;b.length>1;){var g=b.pop(),h=g.obj[g.prop];if(t(h)){for(var d=[],P=0;P<h.length;++P)typeof h[P]<"u"&&d.push(h[P]);g.obj[g.prop]=d}}},o=function(b,g){for(var h=g&&g.plainObjects?{__proto__:null}:{},d=0;d<b.length;++d)typeof b[d]<"u"&&(h[d]=b[d]);return h},s=function _(b,g,h){if(!g)return b;if(typeof g!="object"&&typeof g!="function"){if(t(b))b.push(g);else if(b&&typeof b=="object")(h&&(h.plainObjects||h.allowPrototypes)||!n.call(Object.prototype,g))&&(b[g]=!0);else return[b,g];return b}if(!b||typeof b!="object")return[b].concat(g);var d=b;return t(b)&&!t(g)&&(d=o(b,h)),t(b)&&t(g)?(g.forEach(function(P,M){if(n.call(b,M)){var T=b[M];T&&typeof T=="object"&&P&&typeof P=="object"?b[M]=_(T,P,h):b.push(P)}else b[M]=P}),b):Object.keys(g).reduce(function(P,M){var T=g[M];return n.call(P,M)?P[M]=_(P[M],T,h):P[M]=T,P},d)},c=function(b,g){return Object.keys(g).reduce(function(h,d){return h[d]=g[d],h},b)},m=function(_,b,g){var h=_.replace(/\+/g," ");if(g==="iso-8859-1")return h.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(h)}catch{return h}},f=1024,v=function(b,g,h,d,P){if(b.length===0)return b;var M=b;if(typeof b=="symbol"?M=Symbol.prototype.toString.call(b):typeof b!="string"&&(M=String(b)),h==="iso-8859-1")return escape(M).replace(/%u[0-9a-f]{4}/gi,function(A){return"%26%23"+parseInt(A.slice(2),16)+"%3B"});for(var T="",I=0;I<M.length;I+=f){for(var F=M.length>=f?M.slice(I,I+f):M,k=[],O=0;O<F.length;++O){var N=F.charCodeAt(O);if(N===45||N===46||N===95||N===126||N>=48&&N<=57||N>=65&&N<=90||N>=97&&N<=122||P===e.RFC1738&&(N===40||N===41)){k[k.length]=F.charAt(O);continue}if(N<128){k[k.length]=r[N];continue}if(N<2048){k[k.length]=r[192|N>>6]+r[128|N&63];continue}if(N<55296||N>=57344){k[k.length]=r[224|N>>12]+r[128|N>>6&63]+r[128|N&63];continue}O+=1,N=65536+((N&1023)<<10|F.charCodeAt(O)&1023),k[k.length]=r[240|N>>18]+r[128|N>>12&63]+r[128|N>>6&63]+r[128|N&63]}T+=k.join("")}return T},y=function(b){for(var g=[{obj:{o:b},prop:"o"}],h=[],d=0;d<g.length;++d)for(var P=g[d],M=P.obj[P.prop],T=Object.keys(M),I=0;I<T.length;++I){var F=T[I],k=M[F];typeof k=="object"&&k!==null&&h.indexOf(k)===-1&&(g.push({obj:M,prop:F}),h.push(k))}return a(g),b},E=function(b){return Object.prototype.toString.call(b)==="[object RegExp]"},w=function(b){return!b||typeof b!="object"?!1:!!(b.constructor&&b.constructor.isBuffer&&b.constructor.isBuffer(b))},S=function(b,g){return[].concat(b,g)},x=function(b,g){if(t(b)){for(var h=[],d=0;d<b.length;d+=1)h.push(g(b[d]));return h}return g(b)};return t1={arrayToObject:o,assign:c,combine:S,compact:y,decode:m,encode:v,isBuffer:w,isRegExp:E,maybeMap:x,merge:s},t1}var r1,Yb;function GO(){if(Yb)return r1;Yb=1;var e=HO(),n=Y4(),t=Xv(),r=Object.prototype.hasOwnProperty,a={brackets:function(_){return _+"[]"},comma:"comma",indices:function(_,b){return _+"["+b+"]"},repeat:function(_){return _}},o=Array.isArray,s=Array.prototype.push,c=function(x,_){s.apply(x,o(_)?_:[_])},m=Date.prototype.toISOString,f=t.default,v={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:n.encode,encodeValuesOnly:!1,filter:void 0,format:f,formatter:t.formatters[f],indices:!1,serializeDate:function(_){return m.call(_)},skipNulls:!1,strictNullHandling:!1},y=function(_){return typeof _=="string"||typeof _=="number"||typeof _=="boolean"||typeof _=="symbol"||typeof _=="bigint"},E={},w=function x(_,b,g,h,d,P,M,T,I,F,k,O,N,A,R,L,V,G){for(var W=_,X=G,q=0,z=!1;(X=X.get(E))!==void 0&&!z;){var Y=X.get(_);if(q+=1,typeof Y<"u"){if(Y===q)throw new RangeError("Cyclic object value");z=!0}typeof X.get(E)>"u"&&(q=0)}if(typeof F=="function"?W=F(b,W):W instanceof Date?W=N(W):g==="comma"&&o(W)&&(W=n.maybeMap(W,function(we){return we instanceof Date?N(we):we})),W===null){if(P)return I&&!L?I(b,v.encoder,V,"key",A):b;W=""}if(y(W)||n.isBuffer(W)){if(I){var U=L?b:I(b,v.encoder,V,"key",A);return[R(U)+"="+R(I(W,v.encoder,V,"value",A))]}return[R(b)+"="+R(String(W))]}var ee=[];if(typeof W>"u")return ee;var te;if(g==="comma"&&o(W))L&&I&&(W=n.maybeMap(W,I)),te=[{value:W.length>0?W.join(",")||null:void 0}];else if(o(F))te=F;else{var Q=Object.keys(W);te=k?Q.sort(k):Q}var Z=T?String(b).replace(/\./g,"%2E"):String(b),re=h&&o(W)&&W.length===1?Z+"[]":Z;if(d&&o(W)&&W.length===0)return re+"[]";for(var ne=0;ne<te.length;++ne){var ae=te[ne],ue=typeof ae=="object"&&ae&&typeof ae.value<"u"?ae.value:W[ae];if(!(M&&ue===null)){var fe=O&&T?String(ae).replace(/\./g,"%2E"):String(ae),pe=o(W)?typeof g=="function"?g(re,fe):re:re+(O?"."+fe:"["+fe+"]");G.set(_,q);var ye=e();ye.set(E,G),c(ee,x(ue,pe,g,h,d,P,M,T,g==="comma"&&L&&o(W)?null:I,F,k,O,N,A,R,L,V,ye))}}return ee},S=function(_){if(!_)return v;if(typeof _.allowEmptyArrays<"u"&&typeof _.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof _.encodeDotInKeys<"u"&&typeof _.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(_.encoder!==null&&typeof _.encoder<"u"&&typeof _.encoder!="function")throw new TypeError("Encoder has to be a function.");var b=_.charset||v.charset;if(typeof _.charset<"u"&&_.charset!=="utf-8"&&_.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var g=t.default;if(typeof _.format<"u"){if(!r.call(t.formatters,_.format))throw new TypeError("Unknown format option provided.");g=_.format}var h=t.formatters[g],d=v.filter;(typeof _.filter=="function"||o(_.filter))&&(d=_.filter);var P;if(_.arrayFormat in a?P=_.arrayFormat:"indices"in _?P=_.indices?"indices":"repeat":P=v.arrayFormat,"commaRoundTrip"in _&&typeof _.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var M=typeof _.allowDots>"u"?_.encodeDotInKeys===!0?!0:v.allowDots:!!_.allowDots;return{addQueryPrefix:typeof _.addQueryPrefix=="boolean"?_.addQueryPrefix:v.addQueryPrefix,allowDots:M,allowEmptyArrays:typeof _.allowEmptyArrays=="boolean"?!!_.allowEmptyArrays:v.allowEmptyArrays,arrayFormat:P,charset:b,charsetSentinel:typeof _.charsetSentinel=="boolean"?_.charsetSentinel:v.charsetSentinel,commaRoundTrip:!!_.commaRoundTrip,delimiter:typeof _.delimiter>"u"?v.delimiter:_.delimiter,encode:typeof _.encode=="boolean"?_.encode:v.encode,encodeDotInKeys:typeof _.encodeDotInKeys=="boolean"?_.encodeDotInKeys:v.encodeDotInKeys,encoder:typeof _.encoder=="function"?_.encoder:v.encoder,encodeValuesOnly:typeof _.encodeValuesOnly=="boolean"?_.encodeValuesOnly:v.encodeValuesOnly,filter:d,format:g,formatter:h,serializeDate:typeof _.serializeDate=="function"?_.serializeDate:v.serializeDate,skipNulls:typeof _.skipNulls=="boolean"?_.skipNulls:v.skipNulls,sort:typeof _.sort=="function"?_.sort:null,strictNullHandling:typeof _.strictNullHandling=="boolean"?_.strictNullHandling:v.strictNullHandling}};return r1=function(x,_){var b=x,g=S(_),h,d;typeof g.filter=="function"?(d=g.filter,b=d("",b)):o(g.filter)&&(d=g.filter,h=d);var P=[];if(typeof b!="object"||b===null)return"";var M=a[g.arrayFormat],T=M==="comma"&&g.commaRoundTrip;h||(h=Object.keys(b)),g.sort&&h.sort(g.sort);for(var I=e(),F=0;F<h.length;++F){var k=h[F],O=b[k];g.skipNulls&&O===null||c(P,w(O,k,M,T,g.allowEmptyArrays,g.strictNullHandling,g.skipNulls,g.encodeDotInKeys,g.encode?g.encoder:null,g.filter,g.sort,g.allowDots,g.serializeDate,g.format,g.formatter,g.encodeValuesOnly,g.charset,I))}var N=P.join(g.delimiter),A=g.addQueryPrefix===!0?"?":"";return g.charsetSentinel&&(g.charset==="iso-8859-1"?A+="utf8=%26%2310003%3B&":A+="utf8=%E2%9C%93&"),N.length>0?A+N:""},r1}var n1,Kb;function VO(){if(Kb)return n1;Kb=1;var e=Y4(),n=Object.prototype.hasOwnProperty,t=Array.isArray,r={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,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},a=function(E){return E.replace(/&#(\d+);/g,function(w,S){return String.fromCharCode(parseInt(S,10))})},o=function(E,w,S){if(E&&typeof E=="string"&&w.comma&&E.indexOf(",")>-1)return E.split(",");if(w.throwOnLimitExceeded&&S>=w.arrayLimit)throw new RangeError("Array limit exceeded. Only "+w.arrayLimit+" element"+(w.arrayLimit===1?"":"s")+" allowed in an array.");return E},s="utf8=%26%2310003%3B",c="utf8=%E2%9C%93",m=function(w,S){var x={__proto__:null},_=S.ignoreQueryPrefix?w.replace(/^\?/,""):w;_=_.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var b=S.parameterLimit===1/0?void 0:S.parameterLimit,g=_.split(S.delimiter,S.throwOnLimitExceeded?b+1:b);if(S.throwOnLimitExceeded&&g.length>b)throw new RangeError("Parameter limit exceeded. Only "+b+" parameter"+(b===1?"":"s")+" allowed.");var h=-1,d,P=S.charset;if(S.charsetSentinel)for(d=0;d<g.length;++d)g[d].indexOf("utf8=")===0&&(g[d]===c?P="utf-8":g[d]===s&&(P="iso-8859-1"),h=d,d=g.length);for(d=0;d<g.length;++d)if(d!==h){var M=g[d],T=M.indexOf("]="),I=T===-1?M.indexOf("="):T+1,F,k;I===-1?(F=S.decoder(M,r.decoder,P,"key"),k=S.strictNullHandling?null:""):(F=S.decoder(M.slice(0,I),r.decoder,P,"key"),k=e.maybeMap(o(M.slice(I+1),S,t(x[F])?x[F].length:0),function(N){return S.decoder(N,r.decoder,P,"value")})),k&&S.interpretNumericEntities&&P==="iso-8859-1"&&(k=a(String(k))),M.indexOf("[]=")>-1&&(k=t(k)?[k]:k);var O=n.call(x,F);O&&S.duplicates==="combine"?x[F]=e.combine(x[F],k):(!O||S.duplicates==="last")&&(x[F]=k)}return x},f=function(E,w,S,x){var _=0;if(E.length>0&&E[E.length-1]==="[]"){var b=E.slice(0,-1).join("");_=Array.isArray(w)&&w[b]?w[b].length:0}for(var g=x?w:o(w,S,_),h=E.length-1;h>=0;--h){var d,P=E[h];if(P==="[]"&&S.parseArrays)d=S.allowEmptyArrays&&(g===""||S.strictNullHandling&&g===null)?[]:e.combine([],g);else{d=S.plainObjects?{__proto__:null}:{};var M=P.charAt(0)==="["&&P.charAt(P.length-1)==="]"?P.slice(1,-1):P,T=S.decodeDotInKeys?M.replace(/%2E/g,"."):M,I=parseInt(T,10);!S.parseArrays&&T===""?d={0:g}:!isNaN(I)&&P!==T&&String(I)===T&&I>=0&&S.parseArrays&&I<=S.arrayLimit?(d=[],d[I]=g):T!=="__proto__"&&(d[T]=g)}g=d}return g},v=function(w,S,x,_){if(w){var b=x.allowDots?w.replace(/\.([^.[]+)/g,"[$1]"):w,g=/(\[[^[\]]*])/,h=/(\[[^[\]]*])/g,d=x.depth>0&&g.exec(b),P=d?b.slice(0,d.index):b,M=[];if(P){if(!x.plainObjects&&n.call(Object.prototype,P)&&!x.allowPrototypes)return;M.push(P)}for(var T=0;x.depth>0&&(d=h.exec(b))!==null&&T<x.depth;){if(T+=1,!x.plainObjects&&n.call(Object.prototype,d[1].slice(1,-1))&&!x.allowPrototypes)return;M.push(d[1])}if(d){if(x.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+x.depth+" and strictDepth is true");M.push("["+b.slice(d.index)+"]")}return f(M,S,x,_)}},y=function(w){if(!w)return r;if(typeof w.allowEmptyArrays<"u"&&typeof w.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof w.decodeDotInKeys<"u"&&typeof w.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(w.decoder!==null&&typeof w.decoder<"u"&&typeof w.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof w.charset<"u"&&w.charset!=="utf-8"&&w.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof w.throwOnLimitExceeded<"u"&&typeof w.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var S=typeof w.charset>"u"?r.charset:w.charset,x=typeof w.duplicates>"u"?r.duplicates:w.duplicates;if(x!=="combine"&&x!=="first"&&x!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var _=typeof w.allowDots>"u"?w.decodeDotInKeys===!0?!0:r.allowDots:!!w.allowDots;return{allowDots:_,allowEmptyArrays:typeof w.allowEmptyArrays=="boolean"?!!w.allowEmptyArrays:r.allowEmptyArrays,allowPrototypes:typeof w.allowPrototypes=="boolean"?w.allowPrototypes:r.allowPrototypes,allowSparse:typeof w.allowSparse=="boolean"?w.allowSparse:r.allowSparse,arrayLimit:typeof w.arrayLimit=="number"?w.arrayLimit:r.arrayLimit,charset:S,charsetSentinel:typeof w.charsetSentinel=="boolean"?w.charsetSentinel:r.charsetSentinel,comma:typeof w.comma=="boolean"?w.comma:r.comma,decodeDotInKeys:typeof w.decodeDotInKeys=="boolean"?w.decodeDotInKeys:r.decodeDotInKeys,decoder:typeof w.decoder=="function"?w.decoder:r.decoder,delimiter:typeof w.delimiter=="string"||e.isRegExp(w.delimiter)?w.delimiter:r.delimiter,depth:typeof w.depth=="number"||w.depth===!1?+w.depth:r.depth,duplicates:x,ignoreQueryPrefix:w.ignoreQueryPrefix===!0,interpretNumericEntities:typeof w.interpretNumericEntities=="boolean"?w.interpretNumericEntities:r.interpretNumericEntities,parameterLimit:typeof w.parameterLimit=="number"?w.parameterLimit:r.parameterLimit,parseArrays:w.parseArrays!==!1,plainObjects:typeof w.plainObjects=="boolean"?w.plainObjects:r.plainObjects,strictDepth:typeof w.strictDepth=="boolean"?!!w.strictDepth:r.strictDepth,strictNullHandling:typeof w.strictNullHandling=="boolean"?w.strictNullHandling:r.strictNullHandling,throwOnLimitExceeded:typeof w.throwOnLimitExceeded=="boolean"?w.throwOnLimitExceeded:!1}};return n1=function(E,w){var S=y(w);if(E===""||E===null||typeof E>"u")return S.plainObjects?{__proto__:null}:{};for(var x=typeof E=="string"?m(E,S):E,_=S.plainObjects?{__proto__:null}:{},b=Object.keys(x),g=0;g<b.length;++g){var h=b[g],d=v(h,x[h],S,typeof E=="string");_=e.merge(_,d,S)}return S.allowSparse===!0?_:e.compact(_)},n1}var i1,Xb;function $O(){if(Xb)return i1;Xb=1;var e=GO(),n=VO(),t=Xv();return i1={formats:t,parse:n,stringify:e},i1}var Zb;function K4(){if(Zb)return js;Zb=1;var e=hO();function n(){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 t=/^([a-z0-9.+-]+:)/i,r=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,o=["<",">",'"',"`"," ","\r",`
152
- `," "],s=["{","}","|","\\","^","`"].concat(o),c=["'"].concat(s),m=["%","/","?",";","#"].concat(c),f=["/","?","#"],v=255,y=/^[+a-z0-9A-Z_-]{0,63}$/,E=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,w={javascript:!0,"javascript:":!0},S={javascript:!0,"javascript:":!0},x={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_=$O();function b(P,M,T){if(P&&typeof P=="object"&&P instanceof n)return P;var I=new n;return I.parse(P,M,T),I}n.prototype.parse=function(P,M,T){if(typeof P!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof P);var I=P.indexOf("?"),F=I!==-1&&I<P.indexOf("#")?"?":"#",k=P.split(F),O=/\\/g;k[0]=k[0].replace(O,"/"),P=k.join(F);var N=P;if(N=N.trim(),!T&&P.split("#").length===1){var A=a.exec(N);if(A)return this.path=N,this.href=N,this.pathname=A[1],A[2]?(this.search=A[2],M?this.query=_.parse(this.search.substr(1)):this.query=this.search.substr(1)):M&&(this.search="",this.query={}),this}var R=t.exec(N);if(R){R=R[0];var L=R.toLowerCase();this.protocol=L,N=N.substr(R.length)}if(T||R||N.match(/^\/\/[^@/]+@[^@/]+/)){var V=N.substr(0,2)==="//";V&&!(R&&S[R])&&(N=N.substr(2),this.slashes=!0)}if(!S[R]&&(V||R&&!x[R])){for(var G=-1,W=0;W<f.length;W++){var X=N.indexOf(f[W]);X!==-1&&(G===-1||X<G)&&(G=X)}var q,z;G===-1?z=N.lastIndexOf("@"):z=N.lastIndexOf("@",G),z!==-1&&(q=N.slice(0,z),N=N.slice(z+1),this.auth=decodeURIComponent(q)),G=-1;for(var W=0;W<m.length;W++){var X=N.indexOf(m[W]);X!==-1&&(G===-1||X<G)&&(G=X)}G===-1&&(G=N.length),this.host=N.slice(0,G),N=N.slice(G),this.parseHost(),this.hostname=this.hostname||"";var Y=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!Y)for(var U=this.hostname.split(/\./),W=0,ee=U.length;W<ee;W++){var te=U[W];if(te&&!te.match(y)){for(var Q="",Z=0,re=te.length;Z<re;Z++)te.charCodeAt(Z)>127?Q+="x":Q+=te[Z];if(!Q.match(y)){var ne=U.slice(0,W),ae=U.slice(W+1),ue=te.match(E);ue&&(ne.push(ue[1]),ae.unshift(ue[2])),ae.length&&(N="/"+ae.join(".")+N),this.hostname=ne.join(".");break}}}this.hostname.length>v?this.hostname="":this.hostname=this.hostname.toLowerCase(),Y||(this.hostname=e.toASCII(this.hostname));var fe=this.port?":"+this.port:"",pe=this.hostname||"";this.host=pe+fe,this.href+=this.host,Y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),N[0]!=="/"&&(N="/"+N))}if(!w[L])for(var W=0,ee=c.length;W<ee;W++){var ye=c[W];if(N.indexOf(ye)!==-1){var we=encodeURIComponent(ye);we===ye&&(we=escape(ye)),N=N.split(ye).join(we)}}var je=N.indexOf("#");je!==-1&&(this.hash=N.substr(je),N=N.slice(0,je));var Te=N.indexOf("?");if(Te!==-1?(this.search=N.substr(Te),this.query=N.substr(Te+1),M&&(this.query=_.parse(this.query)),N=N.slice(0,Te)):M&&(this.search="",this.query={}),N&&(this.pathname=N),x[L]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var fe=this.pathname||"",se=this.search||"";this.path=fe+se}return this.href=this.format(),this};function g(P){return typeof P=="string"&&(P=b(P)),P instanceof n?P.format():n.prototype.format.call(P)}n.prototype.format=function(){var P=this.auth||"";P&&(P=encodeURIComponent(P),P=P.replace(/%3A/i,":"),P+="@");var M=this.protocol||"",T=this.pathname||"",I=this.hash||"",F=!1,k="";this.host?F=P+this.host:this.hostname&&(F=P+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(F+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(k=_.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var O=this.search||k&&"?"+k||"";return M&&M.substr(-1)!==":"&&(M+=":"),this.slashes||(!M||x[M])&&F!==!1?(F="//"+(F||""),T&&T.charAt(0)!=="/"&&(T="/"+T)):F||(F=""),I&&I.charAt(0)!=="#"&&(I="#"+I),O&&O.charAt(0)!=="?"&&(O="?"+O),T=T.replace(/[?#]/g,function(N){return encodeURIComponent(N)}),O=O.replace("#","%23"),M+F+T+O+I};function h(P,M){return b(P,!1,!0).resolve(M)}n.prototype.resolve=function(P){return this.resolveObject(b(P,!1,!0)).format()};function d(P,M){return P?b(P,!1,!0).resolveObject(M):M}return n.prototype.resolveObject=function(P){if(typeof P=="string"){var M=new n;M.parse(P,!1,!0),P=M}for(var T=new n,I=Object.keys(this),F=0;F<I.length;F++){var k=I[F];T[k]=this[k]}if(T.hash=P.hash,P.href==="")return T.href=T.format(),T;if(P.slashes&&!P.protocol){for(var O=Object.keys(P),N=0;N<O.length;N++){var A=O[N];A!=="protocol"&&(T[A]=P[A])}return x[T.protocol]&&T.hostname&&!T.pathname&&(T.pathname="/",T.path=T.pathname),T.href=T.format(),T}if(P.protocol&&P.protocol!==T.protocol){if(!x[P.protocol]){for(var R=Object.keys(P),L=0;L<R.length;L++){var V=R[L];T[V]=P[V]}return T.href=T.format(),T}if(T.protocol=P.protocol,!P.host&&!S[P.protocol]){for(var ee=(P.pathname||"").split("/");ee.length&&!(P.host=ee.shift()););P.host||(P.host=""),P.hostname||(P.hostname=""),ee[0]!==""&&ee.unshift(""),ee.length<2&&ee.unshift(""),T.pathname=ee.join("/")}else T.pathname=P.pathname;if(T.search=P.search,T.query=P.query,T.host=P.host||"",T.auth=P.auth,T.hostname=P.hostname||P.host,T.port=P.port,T.pathname||T.search){var G=T.pathname||"",W=T.search||"";T.path=G+W}return T.slashes=T.slashes||P.slashes,T.href=T.format(),T}var X=T.pathname&&T.pathname.charAt(0)==="/",q=P.host||P.pathname&&P.pathname.charAt(0)==="/",z=q||X||T.host&&P.pathname,Y=z,U=T.pathname&&T.pathname.split("/")||[],ee=P.pathname&&P.pathname.split("/")||[],te=T.protocol&&!x[T.protocol];if(te&&(T.hostname="",T.port=null,T.host&&(U[0]===""?U[0]=T.host:U.unshift(T.host)),T.host="",P.protocol&&(P.hostname=null,P.port=null,P.host&&(ee[0]===""?ee[0]=P.host:ee.unshift(P.host)),P.host=null),z=z&&(ee[0]===""||U[0]==="")),q)T.host=P.host||P.host===""?P.host:T.host,T.hostname=P.hostname||P.hostname===""?P.hostname:T.hostname,T.search=P.search,T.query=P.query,U=ee;else if(ee.length)U||(U=[]),U.pop(),U=U.concat(ee),T.search=P.search,T.query=P.query;else if(P.search!=null){if(te){T.host=U.shift(),T.hostname=T.host;var Q=T.host&&T.host.indexOf("@")>0?T.host.split("@"):!1;Q&&(T.auth=Q.shift(),T.hostname=Q.shift(),T.host=T.hostname)}return T.search=P.search,T.query=P.query,(T.pathname!==null||T.search!==null)&&(T.path=(T.pathname?T.pathname:"")+(T.search?T.search:"")),T.href=T.format(),T}if(!U.length)return T.pathname=null,T.search?T.path="/"+T.search:T.path=null,T.href=T.format(),T;for(var Z=U.slice(-1)[0],re=(T.host||P.host||U.length>1)&&(Z==="."||Z==="..")||Z==="",ne=0,ae=U.length;ae>=0;ae--)Z=U[ae],Z==="."?U.splice(ae,1):Z===".."?(U.splice(ae,1),ne++):ne&&(U.splice(ae,1),ne--);if(!z&&!Y)for(;ne--;ne)U.unshift("..");z&&U[0]!==""&&(!U[0]||U[0].charAt(0)!=="/")&&U.unshift(""),re&&U.join("/").substr(-1)!=="/"&&U.push("");var ue=U[0]===""||U[0]&&U[0].charAt(0)==="/";if(te){T.hostname=ue?"":U.length?U.shift():"",T.host=T.hostname;var Q=T.host&&T.host.indexOf("@")>0?T.host.split("@"):!1;Q&&(T.auth=Q.shift(),T.hostname=Q.shift(),T.host=T.hostname)}return z=z||T.host&&U.length,z&&!ue&&U.unshift(""),U.length>0?T.pathname=U.join("/"):(T.pathname=null,T.path=null),(T.pathname!==null||T.search!==null)&&(T.path=(T.pathname?T.pathname:"")+(T.search?T.search:"")),T.auth=P.auth||T.auth,T.slashes=T.slashes||P.slashes,T.href=T.format(),T},n.prototype.parseHost=function(){var P=this.host,M=r.exec(P);M&&(M=M[0],M!==":"&&(this.port=M.substr(1)),P=P.substr(0,P.length-M.length)),P&&(this.hostname=P)},js.parse=b,js.resolve=h,js.resolveObject=d,js.format=g,js.Url=n,js}var fp={exports:{}},WO=fp.exports,Qb;function YO(){return Qb||(Qb=1,function(e){(function(n,t){e.exports?e.exports=t():n.xmlserializer=t()})(WO,function(){var n=function(w){return w.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")},t=function(w){return w.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")},r=function(w){return w.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},a=function(w){var S=w.value;return" "+w.name+'="'+t(S)+'"'},o=function(w){var S=w.tagName;return w.namespaceURI==="http://www.w3.org/1999/xhtml"&&(S=S.toLowerCase()),S},s=function(w,S){var x=Array.prototype.map.call(w.attributes||w.attrs,function(_){return _.name}).indexOf("xmlns")>=0;return!x&&(S||w.namespaceURI!==w.parentNode.namespaceURI)?' xmlns="'+w.namespaceURI+'"':""},c=function(w){return Array.prototype.map.call(w.childNodes,function(S){return E(S)}).join("")},m=function(w,S){var x="<"+o(w);return x+=s(w,S),Array.prototype.forEach.call(w.attributes||w.attrs,function(_){x+=a(_)}),w.childNodes.length>0?(x+=">",x+=c(w),x+="</"+o(w)+">"):x+="/>",x},f=function(w){var S=w.nodeValue||w.value||"";return r(S)},v=function(w){return"<!--"+w.data.replace(/-/g,"&#45;")+"-->"},y=function(w){return"<![CDATA["+w.nodeValue+"]]>"},E=function(w,S){var x=S&&S.rootNode;if(w.nodeName==="#document"||w.nodeName==="#document-fragment")return c(w);if(w.tagName)return m(w,x);if(w.nodeName==="#text")return f(w);if(w.nodeName==="#comment")return v(w);if(w.nodeName==="#cdata-section")return y(w)};return{serializeToString:function(w){return n(E(w,{rootNode:!0}))}}})}(fp)),fp.exports}var a1={},Jb;function KO(){if(Jb)return a1;Jb=1;var e=function(o){var s=new XMLSerializer;return Array.prototype.map.call(o.childNodes,function(c){return s.serializeToString(c)}).join("")},n=function(o){if(o.documentElement.tagName==="parsererror"&&o.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml")return o.documentElement;if((o.documentElement.tagName==="xml"||o.documentElement.tagName==="html")&&o.documentElement.childNodes&&o.documentElement.childNodes.length>0&&o.documentElement.childNodes[0].nodeName==="parsererror")return o.documentElement.childNodes[0];if(o.documentElement.tagName==="html"&&o.documentElement.childNodes&&o.documentElement.childNodes.length>0&&o.documentElement.childNodes[0].nodeName==="body"&&o.documentElement.childNodes[0].childNodes&&o.documentElement.childNodes[0].childNodes.length&&o.documentElement.childNodes[0].childNodes[0].nodeName==="parsererror")return o.documentElement.childNodes[0].childNodes[0]},t=[new RegExp(`^<h3[^>]*>This page contains the following errors:</h3><div[^>]*>(.+?)
153
- ?</div>`),new RegExp(`^(.+)
154
- `)],r=function(o){var s=e(o),c,m;for(c=0;c<t.length;c++)if(m=t[c].exec(s),m)return m[1]},a=function(o){var s;if(o===null)throw new Error("Parse error");var c=n(o);if(c!==void 0)throw s=r(c)||"Parse error",new Error(s)};return a1.failOnParseError=function(o){return a(o),o},a1}var o1={},l1={},e3;function Wp(){return e3||(e3=1,function(e){var n=K4();e.getDocumentBaseUrl=function(c){return c.baseURI!=="about:blank"?c.baseURI:null},e.clone=function(c){var m={},f;for(f in c)c.hasOwnProperty(f)&&(m[f]=c[f]);return m},e.cloneArray=function(c){return Array.prototype.slice.apply(c,[0])},e.joinUrl=function(c,m){return c?n.resolve(c,m):m},e.isDataUri=function(c){return/^data:/.test(c)},e.collectAndReportErrors=function(c){var m=[];return Promise.all(c.map(function(f){return f.catch(function(v){m.push(v)})})).then(function(){return m})};var t=null,r=function(c,m){return m===!1||m==="none"||m==="repeated"?((t===null||m!=="repeated")&&(t=Date.now()),c+"?_="+t):c};e.ajax=function(c,m){return new Promise(function(f,v){var y=new window.XMLHttpRequest,E=e.joinUrl(m.baseUrl,c),w,S=function(){v({msg:"Unable to load url",url:E})};w=r(E,m.cache),y.addEventListener("load",function(){y.status===200||y.status===0?f(y.response):S()},!1),y.addEventListener("error",S,!1);try{y.open("GET",w,!0),y.overrideMimeType(m.mimeType),y.send(null)}catch{S()}})},e.binaryAjax=function(c,m){var f=e.clone(m);return f.mimeType="text/plain; charset=x-user-defined",e.ajax(c,f).then(function(v){for(var y="",E=0;E<v.length;E++)y+=String.fromCharCode(v.charCodeAt(E)&255);return y})};var a=function(c){var m=function(f,v){return f.substring(0,v.length)===v};return m(c,"<?xml")||m(c,"<svg")?"image/svg+xml":"image/png"};e.getDataURIForImageURL=function(c,m){return e.binaryAjax(c,m).then(function(f){var v=btoa(f),y=a(f);return"data:"+y+";base64,"+v})};var o=[],s=function(c){return o.indexOf(c)<0&&o.push(c),o.indexOf(c)};e.memoize=function(c,m,f){if(typeof f!="object")throw new Error("cacheBucket is not an object");return function(){var v=Array.prototype.slice.call(arguments),y=m(v),E=s(c),w;return f[E]&&f[E][y]?f[E][y]:(w=c.apply(null,v),f[E]=f[E]||{},f[E][y]=w,w)}}}(l1)),l1}var s1={},t3;function XO(){if(t3)return s1;t3=1;var e=Wp(),n=function(o,s){var c=null;o.hasAttribute("src")?c=o.getAttribute("src"):o.hasAttributeNS("http://www.w3.org/1999/xlink","href")?c=o.getAttributeNS("http://www.w3.org/1999/xlink","href"):o.hasAttribute("href")&&(c=o.getAttribute("href"));var m=e.getDocumentBaseUrl(o.ownerDocument),f=e.clone(s);return!f.baseUrl&&m&&(f.baseUrl=m),e.getDataURIForImageURL(c,f).then(function(v){return v},function(v){throw{resourceType:"image",url:v.url,msg:"Unable to load image "+v.url}})},t=function(o){return o.filter(function(s){var c=null;return s.hasAttribute("src")?c=s.getAttribute("src"):s.hasAttributeNS("http://www.w3.org/1999/xlink","href")?c=s.getAttributeNS("http://www.w3.org/1999/xlink","href"):s.hasAttribute("href")&&(c=s.getAttribute("href")),c!==null&&!e.isDataUri(c)})},r=function(o){return Array.prototype.filter.call(o,function(s){return s.type==="image"})},a=function(o){return Array.prototype.slice.call(o)};return s1.inline=function(o,s){var c=a(o.getElementsByTagName("img")),m=a(o.getElementsByTagName("image")),f=r(o.getElementsByTagName("input"));c=c.concat(m),c=c.concat(f);var v=t(c);return e.collectAndReportErrors(v.map(function(y){return n(y,s).then(function(E){y.attributes.src?y.attributes.src.value=E:y.attributes["xlink:href"]?y.attributes["xlink:href"].value=E:y.attributes.href&&(y.attributes.href.value=E)})}))},s1}var u1={},r3;function ZO(){if(r3)return u1;r3=1;var e=Wp(),n=function(o,s){var c=o.attributes.src.value,m=e.getDocumentBaseUrl(o.ownerDocument),f=e.clone(s);return!f.baseUrl&&m&&(f.baseUrl=m),e.ajax(c,f).catch(function(v){throw{resourceType:"script",url:v.url,msg:"Unable to load script "+v.url}})},t=function(o){return o.replace(/<\//g,"<\\/")},r=function(o,s){o.attributes.removeNamedItem("src"),o.textContent=t(s)},a=function(o){var s=o.getElementsByTagName("script");return Array.prototype.filter.call(s,function(c){return!!c.attributes.src})};return u1.inline=function(o,s){var c=a(o);return e.collectAndReportErrors(c.map(function(m){return n(m,s).then(function(f){r(m,f)})}))},u1}var c1={},f1={},n3;function Zv(){return n3||(n3=1,function(e){e.unquoteString=function(n){var t=/^"(.*)"$/,r=/^'(.*)'$/;return t.test(n)?n.replace(t,"$1"):r.test(n)?n.replace(r,"$1"):n},e.rulesForCssText=function(n){var t=document.implementation.createHTMLDocument(""),r=document.createElement("style"),a;return r.textContent=n,t.body.appendChild(r),a=r.sheet.cssRules,Array.prototype.slice.call(a)},e.cssRulesToText=function(n){return n.reduce(function(t,r){return t+r.cssText},"")},e.exchangeRule=function(n,t,r){var a=n.indexOf(t);n[a]=e.rulesForCssText(r)[0]},e.changeFontFaceRuleSrc=function(n,t,r){var a="@font-face { font-family: "+t.style.getPropertyValue("font-family")+"; ";t.style.getPropertyValue("font-style")&&(a+="font-style: "+t.style.getPropertyValue("font-style")+"; "),t.style.getPropertyValue("font-weight")&&(a+="font-weight: "+t.style.getPropertyValue("font-weight")+"; "),t.style.getPropertyValue("unicode-range")&&(a+="unicode-range: "+t.style.getPropertyValue("unicode-range")+"; "),a+="src: "+r+"}",e.exchangeRule(n,t,a)}}(f1)),f1}var d1={},i3;function QO(){return i3||(i3=1,function(e){var n=Zv(),t=function(o){var s=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return o.replace(s,"$1")};e.extractCssUrl=function(o){var s=/^url\(("[^"]+"|'[^']+'|[^\)]+)\)/,c;if(!s.test(o))throw new Error("Invalid url");return c=s.exec(o)[1],n.unquoteString(t(c))};var r=function(o){var s=`\\s*(?:"[^"]*"|'[^']*'|[^\\(]+)\\s*`,c="(url\\("+s+"\\)|[^,\\s]+)",m="(?:\\s*"+c+")+",f="^\\s*("+m+")(?:\\s*,\\s*("+m+"))*\\s*$",v=new RegExp(m,"g"),y,E=[],w=function(S){var x=new RegExp(c,"g"),_=[],b;for(b=x.exec(S);b;)_.push(b[1]),b=x.exec(S);return _};if(o.match(new RegExp(f))){for(y=v.exec(o);y;)E.push(w(y[0])),y=v.exec(o);return E}return[]},a=function(o){var s,c;for(s=0;s<o.length;s++)try{return c=e.extractCssUrl(o[s]),{url:c,idx:s}}catch{}};e.parse=function(o){var s=r(o);return s.map(function(c){var m=a(c);return m?{preUrl:c.slice(0,m.idx),url:m.url,postUrl:c.slice(m.idx+1)}:{preUrl:c}})},e.serialize=function(o){var s=o.map(function(c){var m=[].concat(c.preUrl);return c.url&&m.push('url("'+c.url+'")'),c.postUrl&&(m=m.concat(c.postUrl)),m.join(" ")});return s.join(", ")}}(d1)),d1}function ap(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 h1={exports:{}},a3;function JO(){return a3||(a3=1,function(e,n){(function(t){e.exports=t()})(function(){return function t(r,a,o){function s(f,v){if(!a[f]){if(!r[f]){var y=typeof ap=="function"&&ap;if(!v&&y)return y(f,!0);if(c)return c(f,!0);var E=new Error("Cannot find module '"+f+"'");throw E.code="MODULE_NOT_FOUND",E}var w=a[f]={exports:{}};r[f][0].call(w.exports,function(S){var x=r[f][1][S];return s(x||S)},w,w.exports,t,r,a,o)}return a[f].exports}for(var c=typeof ap=="function"&&ap,m=0;m<o.length;m++)s(o[m]);return s}({1:[function(t,r,a){function o(m,f){function v(){this.constructor=m}v.prototype=f.prototype,m.prototype=new v}function s(m,f,v,y){this.message=m,this.expected=f,this.found=v,this.location=y,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,s)}o(s,Error),s.buildMessage=function(m,f){var v={literal:function(b){return'"'+E(b.text)+'"'},class:function(b){var g="",h;for(h=0;h<b.parts.length;h++)g+=b.parts[h]instanceof Array?w(b.parts[h][0])+"-"+w(b.parts[h][1]):w(b.parts[h]);return"["+(b.inverted?"^":"")+g+"]"},any:function(b){return"any character"},end:function(b){return"end of input"},other:function(b){return b.description}};function y(b){return b.charCodeAt(0).toString(16).toUpperCase()}function E(b){return b.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(g){return"\\x0"+y(g)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(g){return"\\x"+y(g)})}function w(b){return b.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(g){return"\\x0"+y(g)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(g){return"\\x"+y(g)})}function S(b){return v[b.type](b)}function x(b){var g=new Array(b.length),h,d;for(h=0;h<b.length;h++)g[h]=S(b[h]);if(g.sort(),g.length>0){for(h=1,d=1;h<g.length;h++)g[h-1]!==g[h]&&(g[d]=g[h],d++);g.length=d}switch(g.length){case 1:return g[0];case 2:return g[0]+" or "+g[1];default:return g.slice(0,-1).join(", ")+", or "+g[g.length-1]}}function _(b){return b?'"'+E(b)+'"':"end of input"}return"Expected "+x(m)+" but "+_(f)+" found."};function c(m,f){f=f!==void 0?f:{};var v={},y={start:fe},E=fe,w="",S=function(){return[]},x=",",_=te(",",!1),b=function(oe,ve){return[oe].concat(ve)},g=function(oe){return[oe]},h=function(oe,ve){return{url:oe,format:ve}},d=function(oe){return{url:oe}},P="url(",M=te("url(",!1),T=")",I=te(")",!1),F=function(oe){return oe},k="format(",O=te("format(",!1),N="local(",A=te("local(",!1),R=function(oe){return{local:oe}},L=/^[^)]/,V=Q([")"],!0,!1),G=function(oe){return xe.extractValue(oe.join(""))},W=/^[ \t\r\n\f]/,X=Q([" "," ","\r",`
155
- `,"\f"],!1,!1),q=0,z=[{line:1,column:1}],Y=0,U=[],ee;if("startRule"in f){if(!(f.startRule in y))throw new Error(`Can't start parsing from rule "`+f.startRule+'".');E=y[f.startRule]}function te(oe,ve){return{type:"literal",text:oe,ignoreCase:ve}}function Q(oe,ve,de){return{type:"class",parts:oe,inverted:ve,ignoreCase:de}}function Z(){return{type:"end"}}function re(oe){var ve=z[oe],de;if(ve)return ve;for(de=oe-1;!z[de];)de--;for(ve=z[de],ve={line:ve.line,column:ve.column};de<oe;)m.charCodeAt(de)===10?(ve.line++,ve.column=1):ve.column++,de++;return z[oe]=ve,ve}function ne(oe,ve){var de=re(oe),ke=re(ve);return{start:{offset:oe,line:de.line,column:de.column},end:{offset:ve,line:ke.line,column:ke.column}}}function ae(oe){q<Y||(q>Y&&(Y=q,U=[]),U.push(oe))}function ue(oe,ve,de){return new s(s.buildMessage(oe,ve),oe,ve,de)}function fe(){var oe,ve;return oe=pe(),oe===v&&(oe=q,ve=w,ve!==v&&(ve=S()),oe=ve),oe}function pe(){var oe,ve,de,ke,Be,Qe;if(oe=q,ve=ye(),ve!==v){for(de=[],ke=he();ke!==v;)de.push(ke),ke=he();if(de!==v)if(m.charCodeAt(q)===44?(ke=x,q++):(ke=v,ae(_)),ke!==v){for(Be=[],Qe=he();Qe!==v;)Be.push(Qe),Qe=he();Be!==v?(Qe=pe(),Qe!==v?(ve=b(ve,Qe),oe=ve):(q=oe,oe=v)):(q=oe,oe=v)}else q=oe,oe=v;else q=oe,oe=v}else q=oe,oe=v;return oe===v&&(oe=q,ve=ye(),ve!==v&&(ve=g(ve)),oe=ve),oe}function ye(){var oe;return oe=we(),oe===v&&(oe=se()),oe}function we(){var oe,ve,de,ke;if(oe=q,ve=je(),ve!==v){if(de=[],ke=he(),ke!==v)for(;ke!==v;)de.push(ke),ke=he();else de=v;de!==v?(ke=Te(),ke!==v?(ve=h(ve,ke),oe=ve):(q=oe,oe=v)):(q=oe,oe=v)}else q=oe,oe=v;return oe===v&&(oe=q,ve=je(),ve!==v&&(ve=d(ve)),oe=ve),oe}function je(){var oe,ve,de,ke;return oe=q,m.substr(q,4)===P?(ve=P,q+=4):(ve=v,ae(M)),ve!==v?(de=_e(),de!==v?(m.charCodeAt(q)===41?(ke=T,q++):(ke=v,ae(I)),ke!==v?(ve=F(de),oe=ve):(q=oe,oe=v)):(q=oe,oe=v)):(q=oe,oe=v),oe}function Te(){var oe,ve,de,ke;return oe=q,m.substr(q,7)===k?(ve=k,q+=7):(ve=v,ae(O)),ve!==v?(de=_e(),de!==v?(m.charCodeAt(q)===41?(ke=T,q++):(ke=v,ae(I)),ke!==v?(ve=F(de),oe=ve):(q=oe,oe=v)):(q=oe,oe=v)):(q=oe,oe=v),oe}function se(){var oe,ve,de,ke;return oe=q,m.substr(q,6)===N?(ve=N,q+=6):(ve=v,ae(A)),ve!==v?(de=_e(),de!==v?(m.charCodeAt(q)===41?(ke=T,q++):(ke=v,ae(I)),ke!==v?(ve=R(de),oe=ve):(q=oe,oe=v)):(q=oe,oe=v)):(q=oe,oe=v),oe}function _e(){var oe,ve,de;if(oe=q,ve=[],L.test(m.charAt(q))?(de=m.charAt(q),q++):(de=v,ae(V)),de!==v)for(;de!==v;)ve.push(de),L.test(m.charAt(q))?(de=m.charAt(q),q++):(de=v,ae(V));else ve=v;return ve!==v&&(ve=G(ve)),oe=ve,oe}function he(){var oe;return W.test(m.charAt(q))?(oe=m.charAt(q),q++):(oe=v,ae(X)),oe}var xe=t("../util");if(ee=E(),ee!==v&&q===m.length)return ee;throw ee!==v&&q<m.length&&ae(Z()),ue(U,Y<m.length?m.charAt(Y):null,Y<m.length?ne(Y,Y+1):ne(Y,Y))}r.exports={SyntaxError:s,parse:c}},{"../util":3}],2:[function(t,r,a){var o=t("./grammar");a.SyntaxError=function(s,c){this.message=s,this.offset=c},a.parse=function(s){try{return o.parse(s)}catch(c){throw new a.SyntaxError(c.message,c.offset)}},a.serialize=function(s){return s.map(function(c){var m;return c.url?(m='url("'+c.url+'")',c.format&&(m+=' format("'+c.format+'")')):m='local("'+c.local+'")',m}).join(", ")}},{"./grammar":1}],3:[function(t,r,a){var o=function(c){var m=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return c.replace(m,"$1")},s=function(c){var m=/^"(.*)"$/,f=/^'(.*)'$/;return m.test(c)?c.replace(m,"$1"):f.test(c)?c.replace(f,"$1"):c};a.extractValue=function(c){return s(o(c))}},{}]},{},[2])(2)})}(h1)),h1.exports}var o3;function eP(){return o3||(o3=1,function(e){var n=Wp(),t=Zv(),r=QO(),a=JO(),o=function(g,h,d){g.style.setProperty(h,d,g.style.getPropertyPriority(h))},s=function(g){return g.filter(function(h){return h.type===window.CSSRule.STYLE_RULE&&(h.style.getPropertyValue("background-image")||h.style.getPropertyValue("background"))})},c=function(g){var h=[];return g.forEach(function(d){d.style.getPropertyValue("background-image")?h.push({property:"background-image",value:d.style.getPropertyValue("background-image"),rule:d}):d.style.getPropertyValue("background")&&h.push({property:"background",value:d.style.getPropertyValue("background"),rule:d})}),h},m=function(g){return g.filter(function(h){return h.type===window.CSSRule.FONT_FACE_RULE&&h.style.getPropertyValue("src")})},f=function(g){return g.filter(function(h){return h.type===window.CSSRule.IMPORT_RULE&&h.href})},v=function(g){var h=[];return g.forEach(function(d,P){d.url&&!n.isDataUri(d.url)&&h.push(P)}),h},y=function(g){var h=[];return g.forEach(function(d,P){d.url&&!n.isDataUri(d.url)&&h.push(P)}),h};e.adjustPathsOfCssResources=function(g,h){var d=s(h),P=c(d),M=!1;return P.forEach(function(T){var I=r.parse(T.value),F=v(I),k;F.length>0&&(F.forEach(function(O){var N=I[O].url,A=n.joinUrl(g,N);I[O].url=A}),k=r.serialize(I),o(T.rule,T.property,k),M=!0)}),m(h).forEach(function(T){var I=T.style.getPropertyValue("src"),F,k;try{F=a.parse(I)}catch{return}k=y(F),k.length>0&&(k.forEach(function(O){var N=F[O].url,A=n.joinUrl(g,N);F[O].url=A}),t.changeFontFaceRuleSrc(h,T,a.serialize(F)),M=!0)}),f(h).forEach(function(T){var I=T.href,F=n.joinUrl(g,I);t.exchangeRule(h,T,"@import url("+F+");"),M=!0}),M};var E=function(g,h,d){var P=g.indexOf(h);g.splice(P,1),d.forEach(function(M,T){g.splice(P+T,0,M)})},w=function(g,h,d,P){var M=h.href,T;return M=t.unquoteString(M),T=n.joinUrl(P.baseUrl,M),d.indexOf(T)>=0?(E(g,h,[]),Promise.resolve([])):(d.push(T),n.ajax(M,P).then(function(I){var F=t.rulesForCssText(I);return e.loadCSSImportsForRules(F,d,P).then(function(k){return e.adjustPathsOfCssResources(M,F),E(g,h,F),k.errors})},function(I){throw{resourceType:"stylesheet",url:I.url,msg:"Unable to load stylesheet "+I.url}}))};e.loadCSSImportsForRules=function(g,h,d){var P=f(g),M=[],T=!1;return Promise.all(P.map(function(I){return w(g,I,h,d).then(function(F){M=M.concat(F),T=!0},function(F){M.push(F)})})).then(function(){return{hasChanges:T,errors:M}})};var S=function(g,h){var d=r.parse(g),P=v(d),M=!1;return n.collectAndReportErrors(P.map(function(T){var I=d[T].url;return n.getDataURIForImageURL(I,h).then(function(F){d[T].url=F,M=!0},function(F){throw{resourceType:"backgroundImage",url:F.url,msg:"Unable to load background-image "+F.url}})})).then(function(T){return{backgroundValue:r.serialize(d),hasChanges:M,errors:T}})},x=function(g,h){var d=s(g),P=c(d),M=[],T=!1;return Promise.all(P.map(function(I){return S(I.value,h).then(function(F){F.hasChanges&&(o(I.rule,I.property,F.backgroundValue),T=!0),M=M.concat(F.errors)})})).then(function(){return{hasChanges:T,errors:M}})},_=function(g,h){var d=!1,P,M;try{P=a.parse(g)}catch{P=[]}return M=y(P),n.collectAndReportErrors(M.map(function(T){var I=P[T],F=I.format||"woff";return n.binaryAjax(I.url,h).then(function(k){var O=btoa(k);I.url="data:font/"+F+";base64,"+O,d=!0},function(k){throw{resourceType:"fontFace",url:k.url,msg:"Unable to load font-face "+k.url}})})).then(function(T){return{srcDeclarationValue:a.serialize(P),hasChanges:d,errors:T}})},b=function(g,h){var d=m(g),P=[],M=!1;return Promise.all(d.map(function(T){var I=T.style.getPropertyValue("src");return _(I,h).then(function(F){F.hasChanges&&(t.changeFontFaceRuleSrc(g,T,F.srcDeclarationValue),M=!0),P=P.concat(F.errors)})})).then(function(){return{hasChanges:M,errors:P}})};e.loadAndInlineCSSResourcesForRules=function(g,h){var d=!1,P=[];return Promise.all([x,b].map(function(M){return M(g,h).then(function(T){d=d||T.hasChanges,P=P.concat(T.errors)})})).then(function(){return{hasChanges:d,errors:P}})}}(c1)),c1}var l3;function tP(){return l3||(l3=1,function(e){var n=Wp(),t=XO(),r=ZO(),a=eP(),o=Zv(),s=function(_){return n.joinUrl(_,".")},c=function(_){var b=_.map(function(g,h){return h===_.length-1&&(g={baseUrl:s(g.baseUrl)}),JSON.stringify(g)});return b},m=function(_,b){return b.cache!==!1&&b.cache!=="none"&&b.cacheBucket?n.memoize(_,c,b.cacheBucket):_},f=function(_,b,g){var h=o.rulesForCssText(_);return a.loadCSSImportsForRules(h,b,g).then(function(d){return a.loadAndInlineCSSResourcesForRules(h,g).then(function(P){var M=d.errors.concat(P.errors),T=d.hasChanges||P.hasChanges;return T&&(_=o.cssRulesToText(h)),{hasChanges:T,content:_,errors:M}})})},v=function(_,b,g){var h=_.textContent,d=m(f,b);return d(h,g,b).then(function(P){return P.hasChanges&&(_.childNodes[0].nodeValue=P.content),n.cloneArray(P.errors)})},y=function(_){var b=_.getElementsByTagName("style");return Array.prototype.filter.call(b,function(g){return!g.attributes.type||g.attributes.type.value==="text/css"})};e.loadAndInlineStyles=function(_,b){var g=y(_),h=[],d=[],P;return P=n.clone(b),P.baseUrl=P.baseUrl||n.getDocumentBaseUrl(_),Promise.all(g.map(function(M){return v(M,P,d).then(function(T){h=h.concat(T)})})).then(function(){return h})};var E=function(_,b){var g=_.parentNode,h;b=b.trim(),b&&(h=_.ownerDocument.createElement("style"),h.type="text/css",h.appendChild(_.ownerDocument.createTextNode(b)),g.insertBefore(h,_)),g.removeChild(_)},w=function(_,b){return n.ajax(_,b).then(function(g){var h=o.rulesForCssText(g);return{content:g,cssRules:h}}).then(function(g){var h=a.adjustPathsOfCssResources(_,g.cssRules);return{content:g.content,cssRules:g.cssRules,hasChanges:h}}).then(function(g){return a.loadCSSImportsForRules(g.cssRules,[],b).then(function(h){return{content:g.content,cssRules:g.cssRules,hasChanges:g.hasChanges||h.hasChanges,errors:h.errors}})}).then(function(g){return a.loadAndInlineCSSResourcesForRules(g.cssRules,b).then(function(h){return{content:g.content,cssRules:g.cssRules,hasChanges:g.hasChanges||h.hasChanges,errors:g.errors.concat(h.errors)}})}).then(function(g){var h=g.content;return g.hasChanges&&(h=o.cssRulesToText(g.cssRules)),{content:h,errors:g.errors}})},S=function(_,b){var g=_.attributes.href.value,h=n.getDocumentBaseUrl(_.ownerDocument),d=n.clone(b);!d.baseUrl&&h&&(d.baseUrl=h);var P=m(w,b);return P(g,d).then(function(M){return{content:M.content,errors:n.cloneArray(M.errors)}})},x=function(_){var b=_.getElementsByTagName("link");return Array.prototype.filter.call(b,function(g){return g.attributes.rel&&g.attributes.rel.value==="stylesheet"&&(!g.attributes.type||g.attributes.type.value==="text/css")})};e.loadAndInlineCssLinks=function(_,b){var g=x(_),h=[];return Promise.all(g.map(function(d){return S(d,b).then(function(P){E(d,P.content+`
156
- `),h=h.concat(P.errors)},function(P){h.push({resourceType:"stylesheet",url:P.url,msg:"Unable to load stylesheet "+P.url})})})).then(function(){return h})},e.loadAndInlineImages=t.inline,e.loadAndInlineScript=r.inline,e.inlineReferences=function(_,b){var g=[],h=[e.loadAndInlineImages,e.loadAndInlineStyles,e.loadAndInlineCssLinks];return b.inlineScripts!==!1&&h.push(e.loadAndInlineScript),Promise.all(h.map(function(d){return d(_,b).then(function(P){g=g.concat(P)})})).then(function(){return g})}}(o1)),o1}/*! rasterizeHTML.js - v1.3.1 - 2022-01-16
157
- * http://www.github.com/cburgmer/rasterizeHTML.js
158
- * Copyright (c) 2022 Christoph Burgmer; Licensed MIT */var rP=cp.exports,s3;function nP(){return s3||(s3=1,function(e){(function(n,t){n===void 0&&window!==void 0&&(n=window),e.exports?e.exports=t(K4(),YO(),KO(),tP()):n.rasterizeHTML=t(n.url,n.xmlserializer,n.sanedomparsererror,n.inlineresources)})(rP,function(n,t,r,a){var o=function(S){var x={},_=[];x.joinUrl=function(h,d){return h?S.resolve(h,d):d},x.getConstantUniqueIdFor=function(h){return _.indexOf(h)<0&&_.push(h),_.indexOf(h)},x.clone=function(h){var d={},P;for(P in h)h.hasOwnProperty(P)&&(d[P]=h[P]);return d};var b=function(h){return typeof h=="object"&&h!==null},g=function(h){return b(h)&&Object.prototype.toString.apply(h).match(/\[object (Canvas|HTMLCanvasElement)\]/i)};return x.parseOptionalParameters=function(h){var d={canvas:null,options:{}};return h[0]==null||g(h[0])?(d.canvas=h[0]||null,d.options=x.clone(h[1])):d.options=x.clone(h[0]),d},x}(n),s=function(S){var x={},_=function(b,g,h){var d=b[g];return b[g]=function(){var P=Array.prototype.slice.call(arguments);return h.apply(this,[P,d])},d};return x.baseUrlRespectingXhr=function(b,g){var h=function(){var d=new b;return _(d,"open",function(P,M){var T=P.shift(),I=P.shift(),F=S.joinUrl(g,I);return M.apply(this,[T,F].concat(P))}),d};return h},x.finishNotifyingXhr=function(b){var g=0,h=0,d=!1,P,M=new Promise(function(I){P=function(){var F=g-h;F<=0&&d&&I({totalCount:g})}}),T=function(){var I=new b;return _(I,"send",function(F,k){return g+=1,k.apply(this,arguments)}),I.addEventListener("load",function(){h+=1,P()}),I};return T.waitForRequestsToFinish=function(){return d=!0,P(),M},T},x}(o),c=function(){var S={},x=function(T){return Array.prototype.slice.call(T)};S.addClassName=function(T,I){T.className+=" "+I},S.addClassNameRecursively=function(T,I){S.addClassName(T,I),T.parentNode!==T.ownerDocument&&S.addClassNameRecursively(T.parentNode,I)};var _=function(T,I){var F=T.parentStyleSheet,k=x(F.cssRules).indexOf(T);F.insertRule(I,k+1),F.deleteRule(k)},b=function(T,I){var F=T.cssText.replace(/^[^\{]+/,""),k=I+" "+F;_(T,k)},g=function(T){return x(T).reduce(function(I,F){return I+F.cssText},"")},h=function(T){T.textContent=g(T.sheet.cssRules)},d=function(T){var I=document.implementation.createHTMLDocument(""),F=document.createElement("style");F.textContent=T.textContent,I.body.appendChild(F),T.sheet=F.sheet},P=function(T){return"((?:^|[^.#:\\w])|(?=\\W))("+T.join("|")+")(?=\\W|$)"},M=function(T,I,F){var k=P(I);x(T.querySelectorAll("style")).forEach(function(O){typeof O.sheet>"u"&&d(O);var N=x(O.sheet.cssRules).filter(function(A){return A.selectorText&&new RegExp(k,"i").test(A.selectorText)});N.length&&(N.forEach(function(A){var R=A.selectorText.replace(new RegExp(k,"gi"),function(L,V,G){return V+F(G)});R!==A.selectorText&&b(A,R)}),h(O))})};return S.rewriteCssSelectorWith=function(T,I,F){M(T,[I],function(){return F})},S.lowercaseCssTypeSelectors=function(T,I){M(T,I,function(F){return F.toLowerCase()})},S.findHtmlOnlyNodeNames=function(T){var I=T.ownerDocument.createTreeWalker(T,NodeFilter.SHOW_ELEMENT),F={},k={},O;do O=I.currentNode.tagName.toLowerCase(),I.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?F[O]=!0:k[O]=!0;while(I.nextNode());return Object.keys(F).filter(function(N){return!k[N]})},S}(),m=function(S){var x={},_=function(g){return Array.prototype.slice.call(g)},b={active:!0,hover:!0,focus:!1,target:!1};return x.fakeUserAction=function(g,h,d){var P=g.querySelector(h),M=":"+d,T="rasterizehtml"+d;P&&(b[d]?S.addClassNameRecursively(P,T):S.addClassName(P,T),S.rewriteCssSelectorWith(g,M,"."+T))},x.persistInputValues=function(g){var h=g.querySelectorAll("input"),d=g.querySelectorAll("textarea"),P=function(M){return M.type==="checkbox"||M.type==="radio"};_(h).filter(P).forEach(function(M){M.checked?M.setAttribute("checked",""):M.removeAttribute("checked")}),_(h).filter(function(M){return!P(M)}).forEach(function(M){M.setAttribute("value",M.value)}),_(d).forEach(function(M){M.textContent=M.value})},x.rewriteTagNameSelectorsToLowerCase=function(g){S.lowercaseCssTypeSelectors(g,S.findHtmlOnlyNodeNames(g))},x}(c),f=function(S,x,_,b){var g={},h=function(G,W,X,q){var z=G.createElement(W);return z.style.visibility="hidden",z.style.width=X+"px",z.style.height=q+"px",z.style.position="absolute",z.style.top=-1e4-q+"px",z.style.left=-1e4-X+"px",G.getElementsByTagName("body")[0].appendChild(z),z},d=function(G){return G>0?new Promise(function(W){setTimeout(W,G)}):Promise.resolve()};g.executeJavascript=function(G,W){return new Promise(function(X){var q=h(b.document,"iframe",W.width,W.height),z=G.outerHTML,Y=[],U=W.executeJsTimeout||0,ee=function(){b.document.getElementsByTagName("body")[0].removeChild(q)},te=function(){var ne=q.contentDocument;X({document:ne,errors:Y,cleanUp:ee})},Q=q.contentWindow.XMLHttpRequest,Z=x.finishNotifyingXhr(Q),re=x.baseUrlRespectingXhr(Z,W.baseUrl);q.onload=function(){d(U).then(Z.waitForRequestsToFinish).then(te)},q.contentDocument.open(),q.contentWindow.XMLHttpRequest=re,q.contentWindow.onerror=function(ne){Y.push({resourceType:"scriptExecution",msg:ne})},q.contentDocument.write("<!DOCTYPE html>"),q.contentDocument.write(z),q.contentDocument.close()})};var P=function(G,W,X){var q=G.createElement("iframe");return q.style.width=W+"px",q.style.height=X+"px",q.style.visibility="hidden",q.style.position="absolute",q.style.top=-1e4-X+"px",q.style.left=-1e4-W+"px",q.style.borderWidth=0,q.sandbox="allow-same-origin",q.scrolling="no",q},M=function(G,W,X){var q=Math.floor(G/X),z=Math.floor(W/X);return P(b.document,q,z)},T=function(G,W,X,q){return{width:Math.max(G.width*q,W),height:Math.max(G.height*q,X)}},I=function(G,W){var X=G.querySelector(W);if(X)return X;if(G.ownerDocument.querySelector(W)===G)return G;throw{message:"Clipping selector not found"}},F=function(G,W,X,q,z){var Y=Math.max(G.scrollWidth,G.clientWidth),U=Math.max(G.scrollHeight,G.clientHeight),ee,te,Q,Z,re,ne,ae,ue;return W?(ne=I(G,W),ae=ne.getBoundingClientRect(),ee=ae.top,te=ae.left,Q=ae.width,Z=ae.height):(ee=0,te=0,Q=Y,Z=U),ue=T({width:Q,height:Z},X,q,z),re=b.getComputedStyle(G.ownerDocument.documentElement).fontSize,{left:te,top:ee,width:ue.width,height:ue.height,viewportWidth:Y,viewportHeight:U,rootFontSize:re}},k=function(G,W){var X=G.tagName;return W.querySelector(X)},O=function(G){var W=G.tagName.toLowerCase();return W==="html"||W==="body"?G.outerHTML:'<body style="margin: 0;">'+G.outerHTML+"</body>"};g.calculateDocumentContentSize=function(G,W){return new Promise(function(X,q){var z=W.zoom||1,Y;Y=M(W.width,W.height,z),b.document.getElementsByTagName("body")[0].appendChild(Y),Y.onload=function(){var U=Y.contentDocument,ee;try{ee=F(k(G,U),W.clip,W.width,W.height,z),X(ee)}catch(te){q(te)}finally{b.document.getElementsByTagName("body")[0].removeChild(Y)}},Y.contentDocument.open(),Y.contentDocument.write("<!DOCTYPE html>"),Y.contentDocument.write(O(G)),Y.contentDocument.close()})},g.parseHtmlFragment=function(G){var W=b.document.implementation.createHTMLDocument("");W.documentElement.innerHTML=G;var X=W.querySelector("body").firstChild;if(!X)throw"Invalid source";return X};var N=function(G,W){var X=/<html((?:\s+[^>]*)?)>/im.exec(W),q=b.document.implementation.createHTMLDocument(""),z,Y,U,ee;if(X)for(z="<div"+X[1]+"></div>",q.documentElement.innerHTML=z,U=q.querySelector("div"),Y=0;Y<U.attributes.length;Y++)ee=U.attributes[Y],G.documentElement.setAttribute(ee.name,ee.value)};g.parseHTML=function(G){var W=b.document.implementation.createHTMLDocument("");return W.documentElement.innerHTML=G,N(W,G),W};var A=function(G){try{return _.failOnParseError(G)}catch(W){throw{message:"Invalid source",originalError:W}}};g.validateXHTML=function(G){var W=new DOMParser,X=W.parseFromString(G,"application/xml");A(X)};var R=null,L=function(G,W){return W==="none"||W==="repeated"?((R===null||W!=="repeated")&&(R=Date.now()),G+"?_="+R):G},V=function(G,W){return new Promise(function(X,q){var z=new window.XMLHttpRequest,Y=S.joinUrl(W.baseUrl,G),U=L(Y,W.cache),ee=function(te){q({message:"Unable to load page",originalError:te})};z.addEventListener("load",function(){z.status===200||z.status===0?X(z.responseXML):ee(z.statusText)},!1),z.addEventListener("error",function(te){ee(te)},!1);try{z.open("GET",U,!0),z.responseType="document",z.send(null)}catch(te){ee(te)}})};return g.loadDocument=function(G,W){return V(G,W).then(function(X){return A(X)})},g}(o,s,r,window),v=function(S){var x={},_=function(k,O){return O?URL.createObjectURL(new Blob([k],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(k)},b=function(k){k instanceof Blob&&URL.revokeObjectURL(k)},g='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',h=function(k){return new Promise(function(O,N){var A=document.createElement("canvas"),R=new Image;R.onload=function(){var L=A.getContext("2d");try{L.drawImage(R,0,0),A.toDataURL("image/png"),O(!0)}catch{O(!1)}},R.onerror=N,R.src=k})},d=function(){var k=_(g,!0);return h(k).then(function(O){return b(k),O?!1:h(_(g,!1)).then(function(N){return N})},function(){return!1})},P=function(){if(S.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch{}return!1},M=function(){return new Promise(function(k,O){P()&&S.URL?d().then(function(N){k(!N)},function(){O()}):k(!1)})},T,I=function(){return T===void 0&&(T=M()),T},F=function(k){return I().then(function(O){return _(k,O)})};return x.renderSvg=function(k){return new Promise(function(O,N){var A,R,L=function(){R.onload=null,R.onerror=null},V=function(){A&&b(A)};R=new Image,R.onload=function(){L(),V(),O(R)},R.onerror=function(){V(),N()},F(k).then(function(G){A=G,R.src=A},N)})},x}(window),y=function(S,x,_,b){var g={},h=function(k,O){var N=O||1,A={width:k.width,height:k.height,"font-size":k.rootFontSize};return N!==1&&(A.style="transform:scale("+N+"); transform-origin: 0 0;"),A},d=function(k){var O,N,A,R;O=Math.round(k.viewportWidth),N=Math.round(k.viewportHeight),A=-k.left,R=-k.top;var L={x:A,y:R,width:O,height:N};return L},P=function(k){var O=k.style||"";k.style=O+"float: left;"},M=function(k){k.externalResourcesRequired=!0},T=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},I=function(k){var O=Object.keys(k);return O.length?" "+O.map(function(N){return N+'="'+k[N]+'"'}).join(" "):""},F=function(k,O,N){var A=b.serializeToString(k);x.validateXHTML(A);var R=d(O);return P(R),M(R),'<svg xmlns="http://www.w3.org/2000/svg"'+I(h(O,N))+">"+T()+"<foreignObject"+I(R)+">"+A+"</foreignObject></svg>"};return g.getSvgForDocument=function(k,O,N){return _.rewriteTagNameSelectorsToLowerCase(k),F(k,O,N)},g.drawDocumentAsSvg=function(k,O){return["hover","active","focus","target"].forEach(function(N){O[N]&&_.fakeUserAction(k,O[N],N)}),x.calculateDocumentContentSize(k,O).then(function(N){return g.getSvgForDocument(k,N,O.zoom)})},g}(o,f,m,t),E=function(S,x,_,b,g,h){var d={},P=function(k){return{message:"Error rendering page",originalError:k}},M=function(k){return g.renderSvg(k).then(function(O){return{image:O,svg:k}},function(O){throw P(O)})},T=function(k,O){try{O.getContext("2d").drawImage(k,0,0)}catch(N){throw P(N)}},I=function(k,O,N){return b.drawDocumentAsSvg(k,N).then(M).then(function(A){return O&&T(A.image,O),A})},F=function(k,O){return x.executeJavascript(k,O).then(function(N){var A=N.document;return _.persistInputValues(A),{document:A,errors:N.errors,cleanUp:N.cleanUp}})};return d.rasterize=function(k,O,N){var A;return A=S.clone(N),A.inlineScripts=N.executeJs===!0,h.inlineReferences(k,A).then(function(R){return N.executeJs?F(k,N).then(function(L){return{element:L.document.documentElement,errors:R.concat(L.errors),cleanUp:L.cleanUp}}):{element:k,errors:R,cleanUp:function(){}}}).then(function(R){return I(R.element,O,N).then(function(L){return R.cleanUp(),{image:L.image,svg:L.svg,errors:R.errors}})})},d}(o,f,m,y,v,a),w=function(S,x,_){var b={},g=function(T,I){var F=300,k=200,O=T?T.width:F,N=T?T.height:k,A=I.width!==void 0?I.width:O,R=I.height!==void 0?I.height:N;return{width:A,height:R}},h=function(T){var I=g(T.canvas,T.options),F;return F=S.clone(T.options),F.width=I.width,F.height=I.height,F};b.drawDocument=function(){var T=arguments[0],I=Array.prototype.slice.call(arguments,1),F=S.parseOptionalParameters(I),k=T.documentElement?T.documentElement:T;return _.rasterize(k,F.canvas,h(F))};var d=function(T,I,F){var k=x.parseHTML(T);return b.drawDocument(k,I,F)};b.drawHTML=function(){var T=arguments[0],I=Array.prototype.slice.call(arguments,1),F=S.parseOptionalParameters(I);return d(T,F.canvas,F.options)};var P=function(T,I,F){var k=document.implementation.createHTMLDocument("");k.replaceChild(T.documentElement,k.documentElement);var O=F?S.clone(F):{};return F.baseUrl||(O.baseUrl=I),{document:k,options:O}},M=function(T,I,F){return x.loadDocument(T,F).then(function(k){var O=P(k,T,F);return b.drawDocument(O.document,I,O.options)})};return b.drawURL=function(){var T=arguments[0],I=Array.prototype.slice.call(arguments,1),F=S.parseOptionalParameters(I);return M(T,F.canvas,F.options)},b}(o,f,E);return w})}(cp)),cp.exports}var u3;function X4(){return u3||(u3=1,function(e){var n,t=Uo&&Uo.__createBinding||(Object.create?function(_,b,g,h){h===void 0&&(h=g);var d=Object.getOwnPropertyDescriptor(b,g);d&&!("get"in d?!b.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return b[g]}}),Object.defineProperty(_,h,d)}:function(_,b,g,h){h===void 0&&(h=g),_[h]=b[g]}),r=Uo&&Uo.__setModuleDefault||(Object.create?function(_,b){Object.defineProperty(_,"default",{enumerable:!0,value:b})}:function(_,b){_.default=b}),a=Uo&&Uo.__importStar||(n=function(_){return n=Object.getOwnPropertyNames||function(b){var g=[];for(var h in b)Object.prototype.hasOwnProperty.call(b,h)&&(g[g.length]=h);return g},n(_)},function(_){if(_&&_.__esModule)return _;var b={};if(_!=null)for(var g=n(_),h=0;h<g.length;h++)g[h]!=="default"&&t(b,_,g[h]);return r(b,_),b});Object.defineProperty(e,"__esModule",{value:!0}),e.prerenderFont=e.resetStyleContent=void 0,e.isContentWrapping=function({html:_}){const b=document.createElement("div");b.innerHTML=_,b.style.display="inline-block",b.style.position="fixed",b.style.top="0px",b.style.left="0px",b.style.zIndex="1000",b.style.whiteSpace="nowrap",b.style.visibility="hidden";const g=v();g.appendChild(b);const h=b.textContent,d=b.childNodes[0],P=h.split(/\s+/);let M=!1;for(let T=0;T<P.length;T++){const I=P[T];if(d.textContent=I,M=d.scrollWidth>b.clientWidth,M)break}return g.removeChild(b),M},e.detectSize=function(_){_.indexOf("Avellino");const b=document.createElement("div");b.innerHTML=_,b.style.display="inline-block",b.style.position="fixed",b.style.top="0px",b.style.left="0px",b.style.zIndex="1000";const g=v();g.appendChild(b);const h=b.getBoundingClientRect();return g.removeChild(b),{width:h.width,height:h.height}},e.htmlToCanvas=async function({html:_,width:b,height:g,fontFamily:h,padding:d,font:P,pixelRatio:M}){if(h!=="Arial"&&!P){const k=(0,s.getGoogleFontsVariants)();_+=`<link type="text/css" href="https://fonts.googleapis.com/css?family=${h}:${k}" rel="stylesheet">`}if(P){const k=P.styles||(P.url?[{src:`url("${P.url}")`}]:x(h));_+="<style>",k.forEach(O=>{_+=`
159
- @font-face {
160
- font-family: '${h}';
161
- src: ${O.src};
162
- font-style: ${O.fontStyle||"normal"};
163
- font-weight: ${O.fontWeight||"normal"};
164
- }
165
- `}),_+="</style>"}_+=m;const T=document.createElement("canvas"),I=await o.drawHTML(`<div style="padding: ${d}px;" dir="auto">${_}</div>`,T,{width:b+2*d,height:g+2*d,cacheBucket:w});(0,c.trySetCanvasSize)(T,(b+2*d)*M,(g+2*d)*M);const F=T.getContext("2d");return F==null||F.drawImage(I.image,0,0,T.width,T.height),T};const o=a(nP()),s=Vd(),c=z4();e.resetStyleContent=`
166
- p {
167
- margin: 0;
168
- padding: 0;
169
- word-wrap: break-word; /* Required for Firefox */
170
- /* a text may have several spaces, we need to preserve them */
171
- white-space: pre-wrap;
172
- }
173
- ul, ol {
174
- list-style-position: outside;
175
- margin: 0;
176
- padding: 0;
177
- display: inline-block;
178
- width: 100%;
179
- text-decoration: inherit;
180
- }
181
-
182
- /*
183
- * List item styles using CSS logical properties that automatically adapt to text direction
184
- * - padding-inline-start/end: Padding at the start/end of text flow (left in LTR, right in RTL)
185
- * - margin-inline-start/end: Margin at the start/end of text flow (left in LTR, right in RTL)
186
- * These properties automatically flip based on the text direction (dir attribute)
187
- * without requiring separate RTL/LTR selectors
188
- */
189
- li {
190
- padding-inline-start: 0.5em;
191
- margin-inline-start: 1.7em;
192
- margin-inline-end: 0;
193
- padding-inline-end: 0;
194
- }
195
-
196
- /* Add resets */
197
- ul {
198
- list-style-type: disc;
199
- }
200
- ol {
201
- list-style-type: decimal;
202
- }
203
-
204
- `;const m=`
205
- <style>
206
- html, body {
207
- padding: 0;
208
- margin: 0;
209
- }
210
- ${e.resetStyleContent}
211
- </style>
212
- `;let f;const v=()=>(f||(f=document.createElement("div"),f.id="polotno-hidden-do-not-touch",f.style.overflow="hidden",f.style.position="relative",document.body.appendChild(f),f.innerHTML=`<style>#polotno-hidden-do-not-touch {${e.resetStyleContent}}</style>`),f),y=new Map,E=navigator.userAgent.includes("Firefox");e.prerenderFont=async _=>{if(y.has(_))return y.get(_);const b=(async()=>{const g=`<div style="font-family: ${_}; font-size: 100px;">${_}<strong>${_}</strong></div>`,h=document.createElement("div");h.innerHTML=g,h.style.visibility="hidden",h.style.position="absolute";const d=v();d.appendChild(h);const P=E?180:50;await new Promise(M=>setTimeout(M,P)),d.removeChild(h)})();return y.set(_,b),b};const w={},S={},x=_=>{if(S[_])return S[_];const b=function(h){const d=[];for(const P of document.styleSheets)try{for(const M of P.cssRules)M instanceof CSSFontFaceRule&&M.style.fontFamily.replace(/['"]/g,"")===h&&d.push(M)}catch(M){console.warn(`Could not access stylesheet: ${P.href}`,M)}return d}(_),g=b.filter(h=>h.style.fontFamily.replace(/['"]/g,"")===_).map(h=>({src:h.style.src,fontStyle:h.style.fontStyle||"normal",fontWeight:h.style.fontWeight||"normal"}));return S[_]=g,g}}(Uo)),Uo}var Ju={},p1={},c3;function Z4(){return c3||(c3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.keyframes=e.glob=e.extractCss=void 0,e.css=v,e.setup=function(_,b,g,h){o.p=b,y=_,E=g,w=h},e.styled=function(_,b){let g=this||{};return function(){let h=arguments;function d(P,M){let T=Object.assign({},P),I=T.className||d.className;g.p=Object.assign({theme:E&&E()},T),g.o=/ *go\d+/.test(I),T.className=v.apply(g,h)+(I?" "+I:""),b&&(T.ref=M);let F=_;return _[0]&&(F=T.as||_,delete T.as),w&&F[0]&&w(T),y(F,T)}return b?b(d):d}};let n={data:""},t=_=>typeof window=="object"?((_?_.querySelector("#_goober"):window._goober)||Object.assign((_||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:_||n,r=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/|\s\s+|\n/g,o=(_,b)=>{let g="",h="",d="";for(let P in _){let M=_[P];P[0]=="@"?P[1]=="i"?g=P+" "+M+";":h+=P[1]=="f"?o(M,P):P+"{"+o(M,P[1]=="k"?"":b)+"}":typeof M=="object"?h+=o(M,b?b.replace(/([^,])+/g,T=>P.replace(/(^:.*)|([^,])+/g,I=>/&/.test(I)?I.replace(/&/g,T):T?T+" "+I:I)):P):M!=null&&(P=P.replace(/[A-Z]/g,"-$&").toLowerCase(),d+=o.p?o.p(P,M):P+":"+M+";")}return g+(b&&d?b+"{"+d+"}":d)+h},s={},c=_=>{if(typeof _=="object"){let b="";for(let g in _)b+=g+c(_[g]);return b}return _},m=(_,b,g,h,d)=>{let P=c(_),M=s[P]||(s[P]=(T=>{let I=0,F=11;for(;I<T.length;)F=101*F+T.charCodeAt(I++)>>>0;return"go"+F})(P));if(!s[M]){let T=P!==_?_:(I=>{let F,k=[{}];for(;F=r.exec(I.replace(a,""));)F[4]?k.shift():F[3]?k.unshift(k[0][F[3]]=k[0][F[3]]||{}):k[0][F[1]]=F[2];return k[0]})(_);s[M]=o(d?{["@keyframes "+M]:T}:T,g?"":"."+M)}return((T,I,F)=>{I.data.indexOf(T)==-1&&(I.data=F?T+I.data:I.data+T)})(s[M],b,h),M},f=(_,b,g)=>_.reduce((h,d,P)=>{let M=b[P];if(M&&M.call){let T=M(g),I=T&&T.props&&T.props.className||/^go/.test(T)&&T;M=I?"."+I:T&&typeof T=="object"?T.props?"":o(T,""):T===!1?"":T}return h+d+(M??"")},"");function v(_){let b=this||{},g=_.call?_(b.p):_;return m(g.unshift?g.raw?f(g,[].slice.call(arguments,1),b.p):g.reduce((h,d)=>Object.assign(h,d&&d.call?d(b.p):d),{}):g,t(b.target),b.g,b.o,b.k)}e.extractCss=_=>{let b=t(_),g=b.data;return b.data="",g};let y,E,w,S=v.bind({g:1}),x=v.bind({k:1});e.glob=S,e.keyframes=x}(p1)),p1}var f3;function iP(){if(f3)return Ju;f3=1;var e=Ju&&Ju.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ju,"__esModule",{value:!0});const n=e(Or()),t=Z4();return(0,t.setup)(n.default.createElement),Ju.default=t.styled,Ju}var d3;function aP(){return d3||(d3=1,function(e){var n,t=va&&va.__createBinding||(Object.create?function(L,V,G,W){W===void 0&&(W=G);var X=Object.getOwnPropertyDescriptor(V,G);X&&!("get"in X?!V.__esModule:X.writable||X.configurable)||(X={enumerable:!0,get:function(){return V[G]}}),Object.defineProperty(L,W,X)}:function(L,V,G,W){W===void 0&&(W=G),L[W]=V[G]}),r=va&&va.__setModuleDefault||(Object.create?function(L,V){Object.defineProperty(L,"default",{enumerable:!0,value:V})}:function(L,V){L.default=V}),a=va&&va.__importStar||(n=function(L){return n=Object.getOwnPropertyNames||function(V){var G=[];for(var W in V)Object.prototype.hasOwnProperty.call(V,W)&&(G[G.length]=W);return G},n(L)},function(L){if(L&&L.__esModule)return L;var V={};if(L!=null)for(var G=n(L),W=0;W<G.length;W++)G[W]!=="default"&&t(V,L,G[W]);return r(V,L),V}),o=va&&va.__importDefault||function(L){return L&&L.__esModule?L:{default:L}};Object.defineProperty(e,"__esModule",{value:!0}),e.HTMLElement=e.setQuillContent=e.createQuill=e.setQuillFormats=e.quillRef=void 0;const s=o(Or()),c=Ri,m=oo,f=o(fO()),v=o(Mi()),y=a(Xi),E=Jl(),w=$d(),S=D4(),x=Gd(),_=X4(),b=Ys(),g=Xs(),h=wc,d=o(iP()),P=Ks(),M=Fw(),T=a(Vd()),I=es(),F=j4();e.quillRef=y.observable({enabled:!1,currentFormat:{},editor:y.observable.object({instance:null},{},{deep:!1})});const k=(0,d.default)("div",s.default.forwardRef)`
213
- .ql-editor {
214
- outline: none;
215
- }
216
- .ql-clipboard {
217
- pointer-events: none;
218
- }
219
- ${_.resetStyleContent}
220
- strong {
221
- font-weight: 700;
222
- }
223
- .ql-direction-rtl {
224
- direction: rtl;
225
- }
226
- `;let O=["bold","color","font","italic","size","strike","underline","indent","list","direction"];e.setQuillFormats=L=>{O=L},e.createQuill=L=>new f.default(L,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:O}),e.setQuillContent=(L,V)=>{var G=L.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+V+"<p><br></p></div>");L.setContents(G),L.history.clear()};const N=({html:L,onBlur:V,onChange:G,element:W})=>{const X=s.default.useRef(null);s.default.useEffect(()=>{if(!X.current)return;const z=(0,e.createQuill)(X.current);return y.runInAction(()=>{e.quillRef.editor.instance=z}),window.__polotnoQuill=z,z.on("text-change",()=>{z.getSelection()&&y.runInAction(()=>{e.quillRef.currentFormat=z.getFormat()}),setTimeout(()=>{var Y;const U=(Y=X.current)===null||Y===void 0?void 0:Y.childNodes[0];G(U.innerHTML)},10)}),z.setSelection(0,0,"api"),z.on("selection-change",(Y,U,ee)=>{Y&&y.runInAction(()=>{e.quillRef.currentFormat=z.getFormat()})}),X.current.childNodes[0].addEventListener("blur",Y=>{var U;if(!((U=Y.relatedTarget)===null||U===void 0)&&U.classList.contains("ql-clipboard"))return;(function(te){return!!te&&!!te.closest(".sketch-picker")})(Y.relatedTarget)||V()}),()=>{y.runInAction(()=>{e.quillRef.editor.instance=null,e.quillRef.currentFormat={}}),delete window.__polotnoQuill}},[]),s.default.useEffect(()=>{var z;const Y=e.quillRef.editor.instance;if(!Y)return;const U=Y.getSelection();((z=X.current)===null||z===void 0?void 0:z.childNodes[0].innerHTML)===W.text||((0,e.setQuillContent)(Y,L),U&&(Y.setSelection(U.index,U.length),y.runInAction(()=>{e.quillRef.currentFormat=Y.getFormat()})))},[W.text]);const q={color:W.fill};return W.fill.indexOf("gradient")>=0&&(q.backgroundColor=W.fill,q.backgroundImage=W.fill,q.backgroundSize="100% 100%",q.backgroundRepeat="repeat",q.webkitBackgroundClip="text",q.MozBackgroundClip="text",q.WebkitTextFillColor="transparent",q.MozTextFillColor="transparent"),s.default.createElement(k,{ref:X,style:Object.assign(Object.assign({},q),{fontSize:W.fontSize,fontWeight:W.fontWeight,width:W.a.width,fontFamily:W.fontFamily,lineHeight:W.lineHeight,letterSpacing:W.letterSpacing+"rem",textAlign:W.align}),dir:(0,S.getDir)((0,M.removeTags)(W.text))})};function A(L,{fontFamily:V="",color:G="black"}={}){let W=`color: ${G||L.fill}`;return L.fill.indexOf("gradient")>=0&&(W=`
227
- background-color: ${G};
228
- background-image: ${L.fill};
229
- background-size: 100% 100%;
230
- background-repeat: repeat;
231
- -webkit-background-clip: text;
232
- -moz-background-clip: text;
233
- -webkit-text-fill-color: transparent;
234
- -moz-text-fill-color: transparent;
235
- `),`<div style="${["white-space: pre-wrap",`width: ${Math.round(L.width||100)}px`,W,`font-size: ${L.fontSize}px`,`font-family: '${V}'`,`text-align: ${L.align}`,L.textDecoration?`text-decoration: ${L.textDecoration}; text-decoration-color: ${G||L.fill}; text-decoration-layer: over`:"",L.lineHeight?`line-height: ${L.lineHeight}`:"",L.letterSpacing?`letter-spacing: ${L.letterSpacing}rem`:"",L.fontStyle?`font-style: ${L.fontStyle}`:"",L.fontWeight?`font-weight: ${L.fontWeight}`:"",L.strokeWidth?`-webkit-text-stroke: ${L.strokeWidth}px ${L.stroke}`:"",L.strokeWidth?"paint-order: stroke fill":""].filter(Boolean).join("; ")}" contentEditable dir="${(0,S.getDir)((0,M.removeTags)(L.text))}">${(0,M.sanitizeHtml)(L.text).replace(/\n/g,"</br>")}</div>`}const R=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);e.HTMLElement=(0,c.observer)(({element:L,store:V})=>{const G=s.default.useRef(null),[W,X]=s.default.useState(),[q,z]=s.default.useState(!1),[Y,U]=s.default.useState(!0),[ee,te]=s.default.useState(!1),Q=s.default.useRef(L.height),Z=V.selectedShapes.indexOf(L)>=0,re=L.fontSize/3,{textVerticalResizeEnabled:ne}=E.flags,ae=(0,S.usePrevious)(L.fontFamily),[ue]=(0,S.useFontLoader)(V,L.fontFamily),fe=L._editModeEnabled;(0,b.useFadeIn)(G);const pe=ue?L.fontFamily:ae!==L.fontFamily?ae:"Arial",ye=(0,x.useColor)(L).fill,we=A(L,{fontFamily:pe,color:ye}),{width:je,height:Te}=function(de,ke,Be){return s.default.useMemo(()=>(0,_.detectSize)(de),[de,ke.width,Be])}(we,L,ue);s.default.useEffect(()=>{if(!ue)return;if(!L.height)return void L.set({height:Te});const{textOverflow:de}=E.flags;if(de!=="change-font-size"||q)de==="resize"&&(ne&&L.height<Te&&V.history.ignore(()=>{L.set({height:Te})}),ne||L.height===Te||V.history.ignore(()=>{L.set({height:Te})}));else{const ke=(Be=>{let Qe=Be.fontSize;for(let Ke=1;Ke<50;Ke++){const St=A(Object.assign(Object.assign({},Be.toJSON()),{fontSize:Qe}),{fontFamily:Be.fontFamily}),{height:Ue}=(0,_.detectSize)(St),rt=Be.height&&Ue>Be.height,gt=(0,_.isContentWrapping)({html:St});if(!rt&&!gt)break;Qe-=.5}return Qe})(L);ke!==L.fontSize?V.history.ignore(()=>{L.set({fontSize:ke})}):L.height!==Te&&(ne&&L.height<Te?V.history.ignore(()=>{L.set({height:Te})}):ne||V.history.ignore(()=>{L.set({height:Te})}))}});const se=s.default.useRef(0),_e=s.default.useMemo(()=>{const de={lastArgs:null,lastResult:null};return async function(ke){return de.lastArgs&&de.lastResult&&(Be=de.lastArgs,Qe=ke,JSON.stringify(Be)===JSON.stringify(Qe))||(de.lastResult=await(0,_.htmlToCanvas)(ke),de.lastArgs=Object.assign({},ke)),de.lastResult;var Be,Qe}},[]);s.default.useEffect(()=>{q||fe||(async()=>{se.current++;const de=se.current,ke=(0,P.incrementLoader)(`text ${L.id}`);U(!0);let Be=null;const Qe=R?5:1;for(let Ke=0;Ke<Qe;Ke++){const St=Ke>0?_e:_.htmlToCanvas;try{if(Be=await St({skipCache:Ke>0,html:we,width:L.width||1,height:L.height||Te||1,fontFamily:pe,padding:re,pixelRatio:V._elementsPixelRatio,font:V.fonts.find(Ue=>Ue.fontFamily===pe)||T.globalFonts.find(Ue=>Ue.fontFamily===pe)}),de!==se.current)return void ke();if(!function(Ue){const rt=Ue.getContext("2d").getImageData(0,0,Ue.width,Ue.height).data;for(let gt=0;gt<rt.length;gt+=4)if(rt[gt+3]!==0)return!0;return!1}(Be)&&R){await new Promise(Ue=>setTimeout(Ue,50*(Ke+1)));continue}}catch{(0,P.triggerLoadError)(`Error rendering rich text with id ${L.id}`);break}}Be?(X(Be),U(!1),v.default.Util.requestAnimFrame(ke)):ke()})()},[we,q,Te,fe,pe,L.height,V._elementsPixelRatio,ue]);const he=q||Y;s.default.useEffect(()=>y.autorun(()=>{const de=G.current;(0,w.applyFilter)(de,L)}),[W,he,L.shadowColor,L.shadowOffsetX,L.shadowOffsetY,L.shadowOpacity]);let xe=0;L.verticalAlign==="middle"&&(xe=(L.height-Te)/2),L.verticalAlign==="bottom"&&(xe=L.height-Te);const oe=(0,S.getLineHeight)({fontLoaded:ue,fontFamily:L.fontFamily,fontSize:L.fontSize,lineHeight:L.lineHeight}),ve=(0,I.isTouchDevice)();return s.default.createElement(s.default.Fragment,null,s.default.createElement(m.Rect,{x:L.a.x,y:L.a.y,offsetX:L.backgroundPadding*(L.fontSize*oe*.5),offsetY:L.backgroundPadding*(L.fontSize*oe*.5),rotation:L.a.rotation,hideInExport:!L.showInExport,listening:!1,visible:L.backgroundEnabled,opacity:L.backgroundOpacity*L.a.opacity,fill:L.backgroundColor,width:L.a.width+L.backgroundPadding*(L.fontSize*oe),height:L.a.height+L.backgroundPadding*(L.fontSize*oe),cornerRadius:L.backgroundCornerRadius*(L.fontSize*oe*.5)}),s.default.createElement(m.Rect,{ref:G,name:"element",x:L.a.x,y:L.a.y,listening:L.selectable,rotation:L.a.rotation,width:L.a.width,height:L.a.height,visible:!he,draggable:ve?L.draggable&&Z:L.draggable,preventDefault:!ve||Z,opacity:fe?0:L.a.opacity,hideInExport:!L.showInExport,onMouseEnter:()=>{te(!0)},onMouseLeave:()=>{te(!1)},onDragMove:de=>{L.set({x:de.target.x(),y:de.target.y()})},onDragEnd:de=>{L.set({x:de.target.x(),y:de.target.y()})},id:L.id,onDblClick:()=>{L.contentEditable&&L.toggleEditMode(!0)},onDblTap:()=>{L.contentEditable&&L.toggleEditMode(!0)},onTransformStart:de=>{z(!0),Q.current=L.height},onTransform:de=>{var ke;const Be=de.target,Qe=((ke=Be.getStage())===null||ke===void 0?void 0:ke.findOne("Transformer")).getActiveAnchor(),Ke=Qe==="middle-left"||Qe==="middle-right",St=Qe==="top-center"||Qe==="bottom-center",Ue=Be.scaleX();if(Ke){const rt=Be.scaleX(),gt=Math.max(Be.width()*rt,L.fontSize);if(Be.width(gt),Be.scaleX(1),E.flags.textVerticalResizeEnabled){const mt=Math.max(Te,Q.current);L.set({height:mt})}L.set({width:gt,x:Be.x(),y:Be.y()})}else if(St){let rt=E.flags.textOverflow==="resize"?Te:L.lineHeight*L.fontSize;const gt=Math.max(rt,de.target.height()*de.target.scaleY());Be.scaleY(1),L.set({x:Be.x(),y:Be.y(),height:gt,rotation:Be.rotation()})}else Be.scaleX(1),Be.scaleY(1),L.set({fontSize:L.fontSize*Ue,width:Be.width()*Ue,x:Be.x(),y:Be.y(),rotation:Be.rotation(),height:Be.height()*Ue})},onTransformEnd:de=>{z(!1),U(!0);const ke=de.target.scaleX();de.target.scaleX(1),de.target.scaleY(1),L.set({fontSize:L.fontSize*ke,width:de.target.width()*ke,x:de.target.x(),y:de.target.y(),rotation:de.target.rotation(),shadowBlur:L.shadowBlur*ke,shadowOffsetX:L.shadowOffsetX*ke,shadowOffsetY:L.shadowOffsetY*ke,strokeWidth:L.strokeWidth*ke})}}),s.default.createElement(m.Image,{ref:G,image:W,x:L.a.x,y:L.a.y,offsetX:re,offsetY:re-xe,listening:!1,rotation:L.rotation,width:L.a.width+2*re,height:L.a.height+2*re,visible:!he,opacity:fe?0:L.a.opacity,shadowEnabled:L.shadowEnabled,shadowBlur:L.shadowBlur,shadowOffsetX:L.shadowOffsetX,shadowOffsetY:L.shadowOffsetY,shadowColor:L.shadowColor,shadowOpacity:L.shadowOpacity,hideInExport:!L.showInExport}),he&&s.default.createElement(m.Group,{x:L.a.x,y:L.a.y,rotation:L.rotation,offsetY:-xe},s.default.createElement(h.Html,{divProps:{style:{pointerEvents:"none"}}},s.default.createElement(k,{dangerouslySetInnerHTML:{__html:we},style:{pointerEvents:"none",display:"inline-block"}}))),fe&&s.default.createElement(m.Group,{x:L.a.x,y:L.a.y,rotation:L.rotation,offsetY:-xe},s.default.createElement(h.Html,null,s.default.createElement(N,{html:we,element:L,onChange:de=>{const ke=(0,F.getLimitedFontSize)({oldText:(0,M.removeTags)(L.text),newText:(0,M.removeTags)(de),element:L});L.set({text:de,fontSize:ke})},onBlur:de=>{L.toggleEditMode(!1)}}))),(Z||ee)&&s.default.createElement(g.Highlighter,{element:L}))})}(va)),va}var pd={},gd={},g1={},h3;function Ec(){return h3||(h3=1,function(e){function n(s){return s/180*Math.PI}function t(s,c,m,f,v){const y=Math.sqrt(m*m+f*f);return v+=Math.atan2(f,m),{x:s+y*Math.cos(v),y:c+y*Math.sin(v)}}function r(s){const{x:c,y:m,width:f,height:v}=s,y=n(s.rotation),E=t(c,m,0,0,y),w=t(c,m,f,0,y),S=t(c,m,f,v,y),x=t(c,m,0,v,y),_=Math.min(E.x,w.x,S.x,x.x),b=Math.min(E.y,w.y,S.y,x.y),g=Math.max(E.x,w.x,S.x,x.x),h=Math.max(E.y,w.y,S.y,x.y);return{x:_,y:b,width:g-_,height:h-b,minX:_,minY:b,maxX:g,maxY:h}}function a(s){const c=n(s.rotation||0);return{x:s.x+s.width/2*Math.cos(c)+s.height/2*Math.sin(-c),y:s.y+s.height/2*Math.cos(c)+s.width/2*Math.sin(c)}}function o(s,c,m){const f=n(c),v=m.x+(s.x-m.x)*Math.cos(f)-(s.y-m.y)*Math.sin(f),y=m.y+(s.x-m.x)*Math.sin(f)+(s.y-m.y)*Math.cos(f);return Object.assign(Object.assign({},s),{rotation:s.rotation+c,x:v,y})}Object.defineProperty(e,"__esModule",{value:!0}),e.degToRad=n,e.getClientRect=r,e.getTotalClientRect=function(s){const c=s.map(E=>r(E)),m=Math.min(...c.map(E=>E.minX)),f=Math.min(...c.map(E=>E.minY)),v=Math.max(...c.map(E=>E.maxX)),y=Math.max(...c.map(E=>E.maxY));return{x:m,y:f,width:v-m,height:y-f,minX:m,minY:f,maxX:v,maxY:y}},e.getCenter=a,e.rotateAroundPoint=o,e.rotateAroundCenter=function(s,c){return o(s,c,a(s))}}(g1)),g1}var p3;function Q4(){return p3||(p3=1,function(e){var n=gd&&gd.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.setSnapFilterFunc=void 0,e.useSnap=function(f,v){const y=t.default.useRef(null),E=g=>g.hasName("element")||g.hasName("page-background")||!y.current&&g.hasName("elements-area");function w(g){var h;const d=(h=f.current)===null||h===void 0?void 0:h.getStage(),P=[],M=[];return d.find(E).forEach(T=>{if(!(g.indexOf(T)>=0)){var I=T.getClientRect({skipShadow:!0,skipStroke:!0});P.push({offset:I.x,node:T,snap:"start"},{offset:I.x+I.width,node:T,snap:"end"},{offset:I.x+I.width/2,node:T,snap:"center"}),M.push({offset:I.y,node:T,snap:"start"},{offset:I.y+I.height,node:T,snap:"end"},{offset:I.y+I.height/2,node:T,snap:"center"})}}),{vertical:P,horizontal:M}}function S(g){var h;const d=(h=f.current)===null||h===void 0?void 0:h.getLayer(),P=d==null?void 0:d.children.find(M=>M.name()==="line-guides");g.forEach(M=>{if(M.orientation==="H"){var T=new r.default.Line({x:-d.getStage().x(),y:-d.getStage().y(),points:[-6e3,M.lineGuide,6e3,M.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});P==null||P.add(T),d.batchDraw()}else M.orientation==="V"&&(T=new r.default.Line({x:-d.getStage().x(),y:-d.getStage().y(),points:[M.lineGuide,-6e3,M.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),P==null||P.add(T))})}const x=g=>{const h=g.target.getLayer().children.find(O=>O.name()==="line-guides");h==null||h.destroyChildren();var d=w(g.target.nodes()),P=function(O){const N=O.__getNodeRect(),A=(0,a.getClientRect)(Object.assign(Object.assign({},N),{rotation:r.default.Util.radToDeg(N.rotation)})),R=O.getAbsolutePosition();return{vertical:[{guide:A.x,offset:R.x-A.x,snap:"start",nodes:O.nodes()},{guide:A.x+A.width/2,offset:R.x-A.x-A.width/2,snap:"center",nodes:O.nodes()},{guide:A.x+A.width,offset:R.x-A.x-A.width,snap:"end",nodes:O.nodes()}],horizontal:[{guide:A.y,offset:R.y-A.y,snap:"start",nodes:O.nodes()},{guide:A.y+A.height/2,offset:R.y-A.y-A.height/2,snap:"center",nodes:O.nodes()},{guide:A.y+A.height,offset:R.y-A.y-A.height,snap:"end",nodes:O.nodes()}]}}(g.target),M=s(d,P);if(!M.length)return;S(M);const T=g.target.getAbsolutePosition(),I=(g.target.nodes().map(O=>O.getAbsolutePosition()),Object.assign({},T));M.forEach(O=>{switch(O.snap){case"start":case"center":case"end":switch(O.orientation){case"V":I.x=O.lineGuide+O.offset;break;case"H":I.y=O.lineGuide+O.offset}}});const F=I.x-T.x,k=I.y-T.y;g.evt.ctrlKey||g.evt.metaKey||g.target.nodes().forEach(O=>{const N=O.getAbsolutePosition();O.setAbsolutePosition({x:N.x+F,y:N.y+k})})},_=(g,h,d)=>{var P;const M=f.current,T=M.getLayer().children.find(V=>V.name()==="line-guides");if(T==null||T.destroyChildren(),M.getActiveAnchor()==="rotater")return h;const I=M.getActiveAnchor(),F=m[I],k=(P=M.findOne(`.${F}`))===null||P===void 0?void 0:P.getAbsolutePosition();if(!k)return h;const O={x:g.x-k.x,y:g.y-k.y},N=function(V,G){const W=c(V,G)/c(G,G);return{x:W*G.x,y:W*G.y}}({x:h.x-g.x,y:h.y-g.y},O),A={x:g.x+N.x,y:g.y+N.y};var R=s(w(M.nodes()),{vertical:[{guide:A.x,offset:0,snap:"start",nodes:M.nodes()}],horizontal:[{guide:A.y,offset:0,snap:"start",nodes:M.nodes()}]});if(!R.length||(S(R),d.ctrlKey||d.metaKey))return h;const L=[];if(R.forEach(V=>{const G=function(W,X,q){if(q.orientation==="V"){const z=q.lineGuide;if(Math.abs(X.x-W.x)<1e-4)return null;const Y=(X.y-W.y)/(X.x-W.x);return{x:z,y:Y*z+(W.y-Y*W.x)}}{const z=q.lineGuide;if(Math.abs(X.y-W.y)<1e-4)return null;const Y=(X.y-W.y)/(X.x-W.x);return{x:(z-W.y)/Y+W.x,y:z}}}(A,k,{orientation:V.orientation,lineGuide:V.lineGuide});G&&L.push(G)}),L.length>0){let V=L[0],G=Math.sqrt(Math.pow(A.x-V.x,2)+Math.pow(A.y-V.y,2));if(L.forEach(W=>{const X=Math.sqrt(Math.pow(A.x-W.x,2)+Math.pow(A.y-W.y,2));X<G&&(G=X,V=W)}),G<10)return V}return A},b=g=>{if(!g.target)return;const h=g.target.getLayer(),d=h.children.find(P=>P.name()==="line-guides");d==null||d.destroyChildren(),h.batchDraw()};t.default.useEffect(()=>{f.current&&(f.current.anchorDragBoundFunc(_),f.current.on("dragstart",g=>{setTimeout(()=>{if(r.default.DD._dragElements.size===0)return;const h=[...r.default.DD._dragElements.entries()],d=h.find(([P,M])=>M.node instanceof r.default.Transformer);d&&(h.splice(h.indexOf(d),1),h.unshift(d),r.default.DD._dragElements.clear(),h.forEach(([P,M])=>{r.default.DD._dragElements.set(P,M)}))})}),f.current.on("dragmove",x),f.current.on("dragend",b),f.current.on("transformend",b),f.current.on("transform",g=>{var h,d;g.evt.ctrlKey||g.evt.metaKey?(h=f.current)===null||h===void 0||h.rotationSnapTolerance(0):(d=f.current)===null||d===void 0||d.rotationSnapTolerance(5)}))},[])},e.useAnchorSnap=function(f,v,y){const E=x=>x.hasName("element")||x.hasName("line-anchor")||x.hasName("page-background")||x.hasName("elements-area"),w=x=>{const _=x.target.getLayer().children.find(T=>T.name()==="line-guides");_==null||_.destroyChildren();var b,g=s(function(T){var I;const F=(I=f.current)===null||I===void 0?void 0:I.getStage();var k=[],O=[];return F.find(E).forEach(N=>{if(!(T.indexOf(N)>=0)){var A=N.getClientRect({skipShadow:!0,skipStroke:!0});N.hasName("line-anchor")&&(A={x:N.absolutePosition().x,y:N.absolutePosition().y,width:0,height:0}),k.push({offset:A.x,node:N,snap:"start"},{offset:A.x+A.width,node:N,snap:"end"},{offset:A.x+A.width/2,node:N,snap:"center"}),O.push({offset:A.y,node:N,snap:"start"},{offset:A.y+A.height,node:N,snap:"end"},{offset:A.y+A.height/2,node:N,snap:"center"})}}),{vertical:k,horizontal:O}}([x.target,...v.map(T=>T.current)]),{vertical:[{guide:(b=x.target).absolutePosition().x,offset:0,snap:"center",nodes:[b]}],horizontal:[{guide:b.absolutePosition().y,offset:0,snap:"center",nodes:[b]}]});if(!g.length)return;(function(T){var I;const F=(I=f.current)===null||I===void 0?void 0:I.getLayer(),k=F==null?void 0:F.children.find(O=>O.name()==="line-guides");T.forEach(O=>{if(O.orientation==="H"){var N=new r.default.Line({points:[-6e3,O.lineGuide,6e3,O.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});k==null||k.add(N),F.batchDraw()}else O.orientation==="V"&&(N=new r.default.Line({points:[O.lineGuide,-6e3,O.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),k==null||k.add(N))})})(g);const h=x.target.getAbsolutePosition(),d=Object.assign({},h);g.forEach(T=>{switch(T.snap){case"start":case"center":case"end":switch(T.orientation){case"V":d.x=T.lineGuide+T.offset;break;case"H":d.y=T.lineGuide+T.offset}}});const P=d.x-h.x,M=d.y-h.y;if(!x.evt.ctrlKey&&!x.evt.metaKey){const T=x.target.getAbsolutePosition();x.target.absolutePosition({x:T.x+P,y:T.y+M})}},S=x=>{if(!x.target)return;const _=x.target.getLayer(),b=_.children.find(g=>g.name()==="line-guides");b==null||b.destroyChildren(),_.batchDraw()};t.default.useEffect(()=>{f.current&&(f.current.on("dragmove",w),f.current.on("dragend",S))},y)};const t=n(Or()),r=n(Mi()),a=Ec();let o=({targetKonvaNodes:f,guideKonvaNode:v,distance:y,snapDirection:E})=>y<5;function s(f,v){var y=[],E=[];f.vertical.forEach(g=>{v.vertical.forEach(h=>{var d=Math.abs(g.offset-h.guide);o({targetKonvaNodes:h.nodes,guideKonvaNode:g.node,distance:d,snapDirection:g.snap})&&y.push({lineGuide:g.offset,diff:d,snap:h.snap,offset:h.offset})})}),f.horizontal.forEach(g=>{v.horizontal.forEach(h=>{var d=Math.abs(g.offset-h.guide);o({targetKonvaNodes:h.nodes,guideKonvaNode:g.node,distance:d,snapDirection:g.snap})&&E.push({lineGuide:g.offset,diff:d,snap:h.snap,offset:h.offset})})});var w=[];const S=y.sort((g,h)=>g.diff-h.diff),x=E.sort((g,h)=>g.diff-h.diff);var _=S[0],b=x[0];return _&&S.filter(g=>Math.abs(g.diff-_.diff)<.1).forEach(g=>{w.push(Object.assign({orientation:"V"},g))}),b&&x.filter(g=>Math.abs(g.diff-b.diff)<.1).forEach(g=>{w.push(Object.assign({orientation:"H"},g))}),w}function c(f,v){return f.x*v.x+f.y*v.y}e.setSnapFilterFunc=f=>{o=f};const m={"top-left":"bottom-right","top-center":"bottom-center","top-right":"bottom-left","middle-right":"middle-left","bottom-right":"top-left","bottom-center":"top-center","bottom-left":"top-right","middle-left":"middle-right"}}(gd)),gd}var g3;function oP(){return g3||(g3=1,function(e){var n=pd&&pd.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0,e.getMiddlePoints=v,e.getLinePositionFromMiddlePoints=y;const t=n(Or()),r=Ri,a=oo,o=Gd(),s=wc,c=Xs(),m=Q4(),f=es();function v(S){const{x,y:_,width:b,height:g,rotation:h}=S.a,d=h*Math.PI/180,P={x:x+g/2*Math.cos(d+Math.PI/2),y:_+g/2*Math.sin(d+Math.PI/2)};return{middleLeft:P,middleRight:{x:P.x+b*Math.cos(d),y:P.y+b*Math.sin(d)}}}function y(S,x,_){const b=Math.sqrt(Math.pow(x.x-S.x,2)+Math.pow(x.y-S.y,2)),g=Math.atan2(x.y-S.y,x.x-S.x),h=180*g/Math.PI;return{x:S.x+Math.cos(g-Math.PI/2)*_/2,y:S.y+Math.sin(g-Math.PI/2)*_/2,width:b,height:_,rotation:h}}const E=(S,x)=>({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:_=>{_.target.getStage().container().style.cursor="crosshair"},onMouseLeave:_=>{_.target.getStage().container().style.cursor=""},onDragStart:_=>{x.history.startTransaction()},onDragEnd:_=>{x.history.endTransaction()}}),w=(0,r.observer)(({element:S,type:x})=>{const _=(0,o.useColor)(S,S.a.color,"fill"),b=(0,o.useColor)(S,S.a.color,"stroke"),g=Object.assign(Object.assign(Object.assign({strokeWidth:S.height,lineCap:"round",lineJoin:"round"},b),_),{opacity:S.a.opacity,hideInExport:!S.showInExport});return t.default.createElement(t.default.Fragment,null,x==="arrow"&&t.default.createElement(a.Line,Object.assign({points:[3*S.height,2*-S.height,0,0,3*S.height,2*S.height]},g)),x==="triangle"&&t.default.createElement(a.Line,Object.assign({points:[3*S.height,2*-S.height,0,0,3*S.height,2*S.height],closed:!0},g)),x==="bar"&&t.default.createElement(a.Line,Object.assign({points:[0,2*-S.height,0,2*S.height],closed:!0},g)),x==="square"&&t.default.createElement(a.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},g)),x==="circle"&&t.default.createElement(a.Circle,Object.assign({x:2*S.height,y:0,radius:2*S.height},g)))});e.LineElement=(0,r.observer)(({element:S,store:x})=>{const _=t.default.useRef(null),b=t.default.useRef(null),g=t.default.useRef(null),h=S.selectable||x.role==="admin",d=(0,f.isTouchDevice)(),[P,M]=t.default.useState(!1),T=x.selectedElements.indexOf(S)>=0&&x.selectedElements.length===1,I=x.selectedShapes.indexOf(S)>=0,{middleLeft:F,middleRight:k}=v(S);(0,m.useAnchorSnap)(b,[_],[T]),(0,m.useAnchorSnap)(g,[_],[T]);const O=(0,o.useColor)(S,S.a.color,"stroke");return t.default.createElement(t.default.Fragment,null,t.default.createElement(a.Line,Object.assign({ref:_,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(N=>N*S.a.height)},O,{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:h,draggable:d?S.draggable&&I:S.draggable,preventDefault:!d||I,hideInExport:!S.showInExport,onMouseEnter:()=>{M(!0)},onMouseLeave:()=>{M(!1)},onDragMove:N=>{S.set({x:N.target.x(),y:N.target.y()})},onDragEnd:N=>{S.set({x:N.target.x(),y:N.target.y()})},onTransform:N=>{const A=N.target.scaleX();N.target.scaleX(1),N.target.scaleY(1),S.set({height:S.height*A,width:S.width*A,x:N.target.x(),y:N.target.y(),rotation:N.target.rotation()})}})),t.default.createElement(a.Group,{x:F.x,y:F.y,rotation:S.rotation,hideInExport:!S.showInExport},t.default.createElement(w,{element:S,type:S.startHead})),t.default.createElement(a.Group,{x:k.x,y:k.y,rotation:S.rotation+180},t.default.createElement(w,{element:S,type:S.endHead})),(P||I&&!T)&&t.default.createElement(c.Highlighter,{element:S}),T&&S.resizable&&t.default.createElement(s.Portal,{selector:".page-abs-container",enabled:!0},t.default.createElement(a.Group,{visible:T},t.default.createElement(a.Rect,Object.assign({x:F.x,y:F.y,ref:b,name:"line-anchor"},E(x.scale,x),{onDragMove:N=>{const A=y(N.target.position(),k,S.height);S.set({x:A.x,y:A.y,width:A.width,rotation:A.rotation})}})),t.default.createElement(a.Rect,Object.assign({x:k.x,y:k.y,ref:g,name:"line-anchor"},E(x.scale,x),{onDragMove:N=>{const A=y(F,N.target.position(),S.height);S.set({x:A.x,y:A.y,width:A.width,rotation:A.rotation})}})))))})}(pd)),pd}var ma={},v3;function J4(){return v3||(v3=1,function(e){var n,t=ma&&ma.__createBinding||(Object.create?function(O,N,A,R){R===void 0&&(R=A);var L=Object.getOwnPropertyDescriptor(N,A);L&&!("get"in L?!N.__esModule:L.writable||L.configurable)||(L={enumerable:!0,get:function(){return N[A]}}),Object.defineProperty(O,R,L)}:function(O,N,A,R){R===void 0&&(R=A),O[R]=N[A]}),r=ma&&ma.__setModuleDefault||(Object.create?function(O,N){Object.defineProperty(O,"default",{enumerable:!0,value:N})}:function(O,N){O.default=N}),a=ma&&ma.__importStar||(n=function(O){return n=Object.getOwnPropertyNames||function(N){var A=[];for(var R in N)Object.prototype.hasOwnProperty.call(N,R)&&(A[A.length]=R);return A},n(O)},function(O){if(O&&O.__esModule)return O;var N={};if(O!=null)for(var A=n(O),R=0;R<A.length;R++)A[R]!=="default"&&t(N,O,A[R]);return r(N,O),N}),o=ma&&ma.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=e.useLoader=e.setVideoLoaderHook=e.useCornerRadiusAndCrop=void 0;const s=o(Or()),c=Ri,m=Xi,f=oo,v=o(Up()),y=o(Mi()),E=wc,w=Xs(),S=Ks(),x=a(Yd()),_=Jl(),b=$d(),g=Ys(),h=es();function d(){return document.createElement("canvas")}const P=new window.Image;P.src=x.svgToURL(`
236
- <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
237
- <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"/>
238
- <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"/>
239
- </svg>
240
- `);const M=new window.Image;M.src=x.svgToURL(`
241
- <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
242
- <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"/>
243
- <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"/>
244
- <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"/>
245
- <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"/>
246
- </svg>
247
- `),e.useCornerRadiusAndCrop=(O,N,A,R,L=0,V=!1)=>{const G=Math.floor(Math.max(O.width*R,1)),W=Math.floor(Math.max(O.height*R,1)),X=Math.min(L*R,G/2,W/2),q=Math.max(O.width/A.width,O.height/A.height)*R,z=O.page._exportingOrRendering&&_.flags.imageDownScalingEnabled&&q<1&&!V,Y=A.x===0&&A.y===0&&A.width===(N==null?void 0:N.width)&&A.height===(N==null?void 0:N.height),U=s.default.useMemo(()=>{if(N&&N.width&&N.height)return Y&&X===0&&!z?void 0:d()},[N,X,z,Y]),ee=()=>{if(!U||!N)return;U.width=G,U.height=W;const te=U.getContext("2d");if(!te)return;X&&(te.beginPath(),te.moveTo(X,0),te.lineTo(G-X,0),te.arc(G-X,X,X,3*Math.PI/2,0,!1),te.lineTo(G,W-X),te.arc(G-X,W-X,X,0,Math.PI/2,!1),te.lineTo(X,W),te.arc(X,W-X,X,Math.PI/2,Math.PI,!1),te.lineTo(0,X),te.arc(X,X,X,Math.PI,3*Math.PI/2,!1),te.clip());const Q=z?function(re,ne){var ae,ue;const fe=d();fe.width=re.width,fe.height=re.height,(ae=fe.getContext("2d"))===null||ae===void 0||ae.drawImage(re,0,0,fe.width,fe.height);const pe=function(ye,we,je,Te,se,_e,he){for(var xe=new ImageData(we,je),oe=new Int32Array(ye.data.buffer),ve=ye.width,de=new Int32Array(xe.data.buffer),ke=xe.width,Be=we/_e,Qe=je/he,Ke=Math.round(1/Be),St=Math.round(1/Qe),Ue=Ke*St,rt=0;rt<xe.height;rt++)for(var gt=0;gt<ke;gt++){for(var mt=0+Math.round(gt/Be)+(0+Math.round(rt/Qe))*ve,kt=0,jt=0,Oe=0,Se=0,yt=0;yt<St;yt++)for(var Fe=0;Fe<Ke;Fe++){var qe=oe[mt+Fe+yt*ve];kt+=qe<<24>>>24,jt+=qe<<16>>>24,Oe+=qe<<8>>>24,Se+=qe>>>24}kt=Math.round(kt/Ue),jt=Math.round(jt/Ue),Oe=Math.round(Oe/Ue),Se=Math.round(Se/Ue),de[gt+rt*ke]=Se<<24|Oe<<16|jt<<8|kt}return xe}(fe.getContext("2d").getImageData(0,0,fe.width,fe.height),Math.floor(fe.width*ne),Math.floor(fe.height*ne),0,0,fe.width,fe.height);return fe.width=Math.floor(fe.width*ne),fe.height=Math.floor(fe.height*ne),(ue=fe.getContext("2d"))===null||ue===void 0||ue.putImageData(pe,0,0),fe}(N,q):N,Z=z?{x:Math.floor(A.x*q),y:Math.floor(A.y*q),width:Math.floor(A.width*q),height:Math.floor(A.height*q)}:A;te.drawImage(Q,Z.x,Z.y,Z.width,Z.height,0,0,U.width,U.height)};return s.default.useLayoutEffect(()=>{ee()},[U,O.width,O.height,A.x,A.y,A.width,A.height,L,R,V,O.page._exportingOrRendering,z]),s.default.useEffect(()=>()=>{U&&U.nodeName==="CANVAS"&&y.default.Util.releaseCanvas(U)},[U]),[U||N,ee]};const T=d(),I=(0,c.observer)(({element:O})=>{const N=Math.min(30,O.width/4,O.height/4),A=s.default.useRef(null);return s.default.useEffect(()=>{const R=A.current;if(!R)return;const L=new y.default.Animation(V=>{R.rotate(((V==null?void 0:V.timeDiff)||0)/2)},R.getLayer());return L.start(),()=>{L.stop()}}),s.default.createElement(f.Group,{x:O.a.x,y:O.a.y,rotation:O.a.rotation,listening:!1,opacity:O.a.opacity,hideInExport:!O.showInExport},s.default.createElement(f.Rect,{width:O.width,height:O.height,fill:"rgba(124, 173, 212, 0.8)"}),s.default.createElement(f.Arc,{ref:A,x:O.width/2,y:O.height/2,fill:"white",outerRadius:Math.abs(N),innerRadius:Math.max(1,N-5),angle:270}))}),F=(0,c.observer)(({element:O})=>{const N=Math.max(10,Math.min(30,O.width/25));return s.default.createElement(f.Group,{x:O.a.x,y:O.a.y,rotation:O.a.rotation,listening:!1,opacity:O.a.opacity,hideInExport:!O.showInExport},s.default.createElement(f.Rect,{width:O.width,height:O.height,fill:"rgba(223, 102, 102, 0.8)"}),s.default.createElement(f.Text,{text:"Can not load the video...",fontSize:N,width:O.width,height:O.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let k=function(O,N,A){const R=s.default.useRef("loading"),L=s.default.useRef(null),[V,G]=s.default.useState(0),W=s.default.useRef(),X=s.default.useRef(),q=s.default.useRef();return W.current===O&&X.current===N&&q.current===A||(R.current="loading",L.current=void 0,W.current=O,X.current=N,q.current=A),s.default.useLayoutEffect(function(){if(O){var z=document.createElement("video");return z.addEventListener("canplay",Y),z.addEventListener("error",U),N&&(z.crossOrigin=N),A&&(z.referrerpolicy=A),z.src=O,z.load(),function(){z.removeEventListener("canplay",Y),z.removeEventListener("error",U)}}function Y(){R.current="loaded",L.current=z,L.current.currentTime=0,G(Math.random()),L.current.removeEventListener("canplay",Y)}function U(ee){const te=z.readyState===4,Q=z.buffered&&z.buffered.length>0&&z.buffered.end(z.buffered.length-1)/z.duration*100>=100;te&&Q||(R.current="failed",L.current=void 0,G(Math.random()))}},[O,N,A]),[L.current,R.current]};e.setVideoLoaderHook=O=>{k=O},e.useLoader=(O,N,A)=>{const R=s.default.useRef(),L=()=>{var V;(V=R.current)===null||V===void 0||V.call(R),R.current=void 0};s.default.useEffect(()=>L,[]),s.default.useLayoutEffect(()=>{const V=N.slice(0,200),G=`video with id ${A} url: ${V}`;O!=="loading"||R.current||(R.current=(0,S.incrementLoader)(G)),O!=="loading"&&L(),O==="failed"&&(0,S.triggerLoadError)(G)},[O])},e.VideoElement=(0,c.observer)(({element:O,store:N})=>{var A;const[R,L]=s.default.useState(!1),V=s.default.useRef(null),G=s.default.useRef(null),[W,X]=s.default.useState(!1),q=N.selectedShapes.indexOf(O)>=0,[z,Y]=s.default.useState(!1),[U,ee]=k(O.src,"anonymous"),te=N.activePage===O.page;(0,e.useLoader)(ee,O.src,O.id),U&&(U.width=U.videoWidth,U.height=U.videoHeight,U.playsInline=!0);const Q=U||T;s.default.useEffect(()=>{U&&N.history.ignore(()=>{O.set({duration:1e3*U.duration})})},[U]),s.default.useEffect(()=>{var Fe;if(!U)return;const qe=N.animatedElementsIds,$e=(!qe.length||qe.includes(O.id))&&N.isPlaying,Et=te&&($e||z);if(!Et)return void U.pause();Et&&(U.currentTime=O.startTime*U.duration,U.play());const Pt=new y.default.Animation(()=>{ke()},(Fe=V.current)===null||Fe===void 0?void 0:Fe.getLayer());Pt.start();const ht=()=>{Y(!1),U.currentTime=O.startTime*U.duration},ze=()=>{U.currentTime>=O.endTime*U.duration&&(U.pause(),U.currentTime=O.startTime*U.duration,Y(!1))};return U.addEventListener("ended",ht),U.addEventListener("timeupdate",ze),()=>{U.pause(),Pt.stop(),U.removeEventListener("ended",ht),U.removeEventListener("timeupdate",ze)}},[U,z,N.isPlaying,te]),s.default.useEffect(()=>{U&&(U.volume=O.volume)},[U,O.volume]);const Z=s.default.useRef();s.default.useEffect(()=>{const Fe=(0,m.autorun)(()=>{var qe,$e;if(U){const Et=N.animatedElementsIds;if(Et.length&&!Et.includes(O.id))return;const Pt=(N.currentTime-O.page.startTime)%O.duration;if(Math.abs(1e3*U.currentTime-Pt)>500||!N.isPlaying){const ht=Pt/1e3;ht!==U.currentTime&&(U.currentTime=ht),U.readyState!==4&&!N.isPlaying&&!Z.current&&(Z.current=(0,S.incrementLoader)(`video ${O.id}`))}ke(),($e=(qe=V.current)===null||qe===void 0?void 0:qe.getLayer())===null||$e===void 0||$e.batchDraw()}});return()=>{Fe(),Z.current&&(Z.current(),Z.current=null)}},[N,U]),s.default.useEffect(()=>{if(!U)return;const Fe=()=>{var $e,Et;U.readyState!==4&&O.page._exportingOrRendering||Z.current&&(ke(),(Et=($e=V.current)===null||$e===void 0?void 0:$e.getLayer())===null||Et===void 0||Et.batchDraw(),Z.current(),Z.current=null)};let qe;return O.page._exportingOrRendering&&(qe=setInterval(Fe,50)),U.addEventListener("timeupdate",Fe),U.addEventListener("canplay",Fe),()=>{clearInterval(qe),U.removeEventListener("timeupdate",Fe),U.removeEventListener("canplay",Fe)}},[O.page._exportingOrRendering,U,O.id,S.incrementLoader]);let{cropX:re,cropY:ne,cropWidth:ae,cropHeight:ue}=O;ee!=="loaded"&&(re=ne=0,ae=ue=1);const fe=Q.width*ae,pe=Q.height*ue,ye=O.width/O.height;let we,je;const Te=fe/pe,se=O.type==="svg";se?(we=fe,je=pe):ye>=Te?(we=fe,je=fe/ye):(we=pe*ye,je=pe);const _e={x:Q.width*re,y:Q.height*ne,width:we,height:je},he=(A=O.cornerRadius)!==null&&A!==void 0?A:0,[xe,oe]=(0,e.useCornerRadiusAndCrop)(O,Q,_e,N._elementsPixelRatio,he,R||O._cropModeEnabled||O.type==="svg");let[ve,de]=((Fe,qe,$e,Et)=>{const Pt=(He=>{const[Me,Ye]=s.default.useState(He);return s.default.useEffect(()=>{(async()=>{const et=await async function(ut){if(!(ut.indexOf("data:image/svg+xml")>=0||ut.indexOf(".svg")>=0))return ut;const wt=await x.urlToString(ut),Ct=x.fixSize(wt);return x.svgToURL(Ct)}(He);et!==Me&&Ye(et)})()},[He]),Me})(Fe.clipSrc||""),[ht,ze]=(0,v.default)(Pt,"anonymous"),at=Fe.clipSrc?ze:"loaded";(0,e.useLoader)(at,Fe.clipSrc,Fe.id);const Pe=s.default.useMemo(()=>{if(qe&&ht)return d()},[qe,ht]);function me(){var He;if(!ht||!qe||!qe.width||!qe.height||!ht||!ht.width||!ht.height||!Pe)return;const Me=d(),Ye=Math.max(Fe.width/ht.width*$e,Fe.height/ht.height*$e);Me.width=ht.width*Ye,Me.height=ht.height*Ye,(He=Me.getContext("2d"))===null||He===void 0||He.drawImage(ht,0,0,Me.width,Me.height),Pe.width=Math.max(qe.width,1),Pe.height=Math.max(qe.height,1);const et=Pe.getContext("2d");et&&(et.save(),et.drawImage(Me,0,0,qe.width,qe.height),y.default.Util.releaseCanvas(Me),et.globalCompositeOperation="source-in",et.drawImage(qe,0,0,Pe.width,Pe.height),et.restore())}return s.default.useLayoutEffect(()=>{me()},[Pe,qe,ht,Fe.width,Fe.height,$e,...Et]),[Fe.clipSrc&&ht?Pe:qe,me]})(O,xe,N._elementsPixelRatio,[_e,he,N._elementsPixelRatio]);function ke(){oe(),de()}const Be=Math.max(O.width/we,O.height/je);s.default.useEffect(()=>{var Fe;if(!O._cropModeEnabled)return;const qe=(Fe=V.current)===null||Fe===void 0?void 0:Fe.getStage();function $e(Pt){O._cropModeEnabled&&Pt.target!==G.current&&O.toggleCropMode(!1)}function Et(Pt){O._cropModeEnabled&&Pt.target.parentNode!==qe.content&&O.toggleCropMode(!1)}return document.body.addEventListener("click",Et),qe==null||qe.on("click",$e),qe==null||qe.on("tap",$e),()=>{document.body.removeEventListener("click",Et),document.body.removeEventListener("touchstart",Et),qe==null||qe.off("click",$e),qe==null||qe.off("click",$e)}},[O._cropModeEnabled]),s.default.useLayoutEffect(()=>{if(!R&&!O._cropModeEnabled)return(0,b.applyFilter)(V.current,O),(0,m.autorun)(()=>{(0,b.applyFilter)(V.current,O)},{delay:100})},[Q,R,ae,ue,O._cropModeEnabled]),s.default.useLayoutEffect(()=>{var Fe;R||O._cropModeEnabled?(Fe=V.current)===null||Fe===void 0||Fe.clearCache():(0,b.applyFilter)(V.current,O)},[R,O.width,O.height,O._cropModeEnabled]),s.default.useEffect(()=>{(0,b.applyFilter)(V.current,O)},[O.shadowEnabled,O.shadowBlur,O.cornerRadius,O.shadowColor,O.shadowOffsetX,O.shadowOffsetY,O.shadowOpacity]);const Qe=s.default.useRef(null),Ke=s.default.useRef(null),St=s.default.useRef(null);s.default.useLayoutEffect(()=>{O._cropModeEnabled&&(Ke.current.nodes([Qe.current]),St.current.nodes([G.current]))},[O._cropModeEnabled]);const Ue=Fe=>{Math.round(Fe.target.x())>0&&(Fe.target.x(0),Fe.target.scaleX(1)),Math.round(Fe.target.y())>0&&(Fe.target.y(0),Fe.target.scaleY(1));const qe=Fe.target.width()*Fe.target.scaleX(),$e=Fe.target.height()*Fe.target.scaleY(),Et=Math.min(1,we/qe),Pt=Math.min(1,je/$e),ht=1-Et,ze=Math.min(ht,Math.max(0,Math.round(-Fe.target.x())/qe)),at=1-Pt,Pe=Math.min(at,Math.max(0,Math.round(-Fe.target.y())/$e));Fe.target.setAttrs({x:-ze*Q.width,y:-Pe*Q.height,scaleX:1,scaleY:1}),O.set({cropX:ze,cropY:Pe,cropWidth:Et,cropHeight:Pt})},rt=()=>{O.type!=="svg"&&O.contentEditable&&setTimeout(()=>{O.toggleCropMode(!0)})},gt=ee==="loading",mt=ee==="failed",kt=!gt&&!mt,jt=s.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Oe=kt?O.a.opacity:0;(0,g.useFadeIn)(V,Oe);const Se=O.selectable||N.role==="admin",yt=(0,h.isTouchDevice)();return s.default.createElement(s.default.Fragment,null,gt&&s.default.createElement(I,{element:O}),mt&&s.default.createElement(F,{element:O}),s.default.createElement(f.Image,{ref:V,name:"element",id:O.id,image:ve,x:O.a.x,y:O.a.y,width:O.a.width||1,height:O.a.height||1,rotation:O.a.rotation,opacity:Oe,shadowEnabled:O.shadowEnabled,shadowBlur:O.shadowBlur,shadowOffsetX:O.shadowOffsetX,shadowOffsetY:O.shadowOffsetY,shadowColor:O.shadowColor,shadowOpacity:O.shadowOpacity,customCrop:_e,listening:Se,draggable:yt?O.draggable&&q:O.draggable,preventDefault:!yt||q,hideInExport:!O.showInExport,onMouseEnter:()=>{X(!0)},onMouseLeave:()=>{X(!1)},onDragMove:Fe=>{O.set({x:Fe.target.x(),y:Fe.target.y()})},onDragEnd:Fe=>{O.set({x:Fe.target.x(),y:Fe.target.y()})},onDblClick:rt,onDblTap:rt,onTransformStart:()=>{L(!0),jt.current={cropX:O.cropX,cropY:O.cropY,cropWidth:O.cropWidth,cropHeight:O.cropHeight}},onTransform:Fe=>{var qe;const $e=Fe.currentTarget,Et=Math.abs($e.scaleX()-1)<1e-7?1:$e.scaleX(),Pt=Math.abs($e.scaleY()-1)<1e-7?1:$e.scaleY();$e.scaleX(1),$e.scaleY(1);const ht=(qe=Fe.target.getStage())===null||qe===void 0?void 0:qe.findOne("Transformer"),ze=1-we/Q.width,at=Math.min(ze,Math.max(0,O.cropX)),Pe=1-je/Q.height,me=Math.min(Pe,Math.max(0,O.cropY)),He=ht.getActiveAnchor(),Me=!(He.indexOf("middle")>=0||He.indexOf("center")>=0),Ye=!Me&&Et<1&&jt.current.cropHeight>je/Q.height;let et=Me?O.cropWidth:O.cropWidth*Et;Ye&&(et=O.cropWidth);const ut=!Me&&Pt<1&&jt.current.cropWidth>we/Q.width;let wt=Me?O.cropHeight:O.cropHeight*Pt;ut&&(wt=O.cropHeight),se&&(et=O.cropWidth,wt=O.cropHeight),O.set({cropX:at,cropY:me,x:$e.x(),y:$e.y(),width:$e.width()*Et,height:$e.height()*Pt,rotation:Fe.target.rotation(),cropWidth:Math.min(et,1-at),cropHeight:Math.min(wt,1-me)})},onTransformEnd:Fe=>{const qe=Fe.currentTarget;O.set({width:qe.width(),height:qe.height(),x:qe.x(),y:qe.y(),rotation:Fe.target.rotation(),cropWidth:we/Q.width,cropHeight:je/Q.height}),L(!1)}}),s.default.createElement(f.Rect,{x:O.a.x,y:O.a.y,width:Math.max(O.a.width-O.borderSize,0),height:Math.max(O.a.height-O.borderSize,0),opacity:Oe,offsetX:-O.borderSize/2,offsetY:-O.borderSize/2,stroke:O.borderColor,strokeWidth:O.borderSize,listening:!1,visible:!!O.borderSize,rotation:O.rotation,cornerRadius:Math.max(0,he-O.borderSize),hideInExport:!O.showInExport}),!N.isPlaying&&s.default.createElement(f.Image,{image:z?M:P,x:O.a.x,y:O.a.y,offsetX:-O.a.width/2+15/N.scale,offsetY:-O.a.height/2+15/N.scale,rotation:O.a.rotation,width:30/N.scale,height:30/N.scale,hideInExport:!0,onClick:()=>Y(!z),onTap:()=>Y(!z)}),O._cropModeEnabled&&s.default.createElement(E.Portal,{selector:".page-abs-container",enabled:!0},s.default.createElement(f.Rect,{x:-window.innerWidth/N.scale,y:-window.innerWidth/N.scale,width:window.innerWidth/N.scale*3,height:window.innerWidth/N.scale*3,fill:"rgba(0,0,0,0.3)"}),s.default.createElement(f.Image,{listening:!1,image:ve,x:O.a.x,y:O.a.y,width:O.a.width,height:O.a.height,rotation:O.a.rotation,shadowEnabled:O.shadowEnabled,shadowBlur:O.shadowBlur}),s.default.createElement(f.Group,{x:O.a.x,y:O.a.y,rotation:O.a.rotation,scaleX:Be,scaleY:Be},s.default.createElement(f.Image,{image:Q,ref:G,opacity:.4,draggable:!0,x:-O.cropX*Q.width,y:-O.cropY*Q.height,onDragMove:Ue,onTransform:Ue}),s.default.createElement(f.Transformer,{ref:St,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Fe,qe)=>qe.width<5||qe.height<5?Fe:qe,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),s.default.createElement(f.Rect,{width:we,height:je,ref:Qe,listening:!1,onTransform:Fe=>{Fe.target.x()<-O.cropX*Q.width-1e-9&&(Fe.target.x(-O.cropX*Q.width),Fe.target.scaleX(1)),Fe.target.y()<-O.cropY*Q.height-1e-9&&(Fe.target.y(-O.cropY*Q.height),Fe.target.scaleY(1));const qe=Math.min(1,Math.max(0,O.cropX+Fe.target.x()/Q.width)),$e=Math.min(1,Math.max(0,Fe.target.y()/Q.height+O.cropY)),Et=Fe.target.width()*Fe.target.scaleX(),Pt=Fe.target.height()*Fe.target.scaleY(),ht=Math.min(1-qe,Et/Q.width),ze=Math.min(1-$e,Pt/Q.height),at=Fe.target.getAbsolutePosition(Fe.target.getParent().getParent());Fe.target.scale({x:1,y:1}),Fe.target.position({x:0,y:0}),O.set({x:at.x,y:at.y,cropX:qe,cropY:$e,cropWidth:ht,cropHeight:ze,width:Math.min(Et*Be,Q.width*(1-qe)*Be),height:Math.min(Pt*Be,Q.height*(1-$e)*Be)})}}),s.default.createElement(f.Transformer,{ref:Ke,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Fe,qe)=>qe.width<5||qe.height<5?Fe:qe,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2,visible:O.resizable}))),(W||q)&&s.default.createElement(w.Highlighter,{element:O}))})}(ma)),ma}var vd={},v1={},m3;function Qv(){return m3||(m3=1,function(e){function n({width:f,height:v}){const y=f/2,E=v/2,w=f/2,S=v/2,x=w/2,_=S/2;let b="",g=Math.PI/5;for(let h=0;h<10;h++){const d=h%2==0?S:_,P=y+(h%2==0?w:x)*Math.sin(h*g),M=E-d*Math.cos(h*g);h===0?b=`M ${P} ${M}`:b+=` L ${P} ${M}`}return b+" Z"}function t({width:f,height:v}){const y=f/2,E=v/2;return`M ${y} 0 L ${f} ${E} L ${y} ${v} L 0 ${E} Z`}function r({width:f,height:v}){const y=f/2,E=v/2,w=f/2,S=v/2;let x="",_=2*Math.PI/5;for(let b=0;b<5;b++){const g=S,h=y+w*Math.sin(b*_),d=E-g*Math.cos(b*_);b===0?x=`M ${h} ${d}`:x+=` L ${h} ${d}`}return x+" Z"}function a({width:f,height:v}){const y=f/2,E=v/2,w=f/2,S=v/2;let x="",_=2*Math.PI/6;for(let b=0;b<6;b++){const g=S,h=y+w*Math.sin(b*_),d=E-g*Math.cos(b*_);b===0?x=`M ${h} ${d}`:x+=` L ${h} ${d}`}return x+" Z"}function o({path:f,aspectRatio:v,width:y,height:E}){return{path:f,scaleX:y/v.width,scaleY:E/v.height}}function s({width:f,height:v}){const y=.1*Math.min(f,v),E=.2*f,w=.2*v,S=.5*f;let x=`M ${y},0`;return x+=" H "+(f-y),x+=` A ${y},${y} 0 0 1 ${f},${y}`,x+=" V "+(v-y-w),x+=` A ${y},${y} 0 0 1 ${f-y},${v-w}`,x+=` H ${S+E/2}`,x+=` L ${S},${v}`,x+=` L ${S-E/2},${v-w}`,x+=` H ${y}`,x+=` A ${y},${y} 0 0 1 0,${v-y-w}`,x+=` V ${y}`,x+=` A ${y},${y} 0 0 1 ${y},0`,x+=" Z",x}function c({width:f,height:v}){const y=.3*f,E=.3*v,w=f/2,S=v/2,x=w-y/2,_=w+y/2,b=S-E/2,g=S+E/2;let h=`M ${x},0 `;return h+=`H ${_} `,h+=`V ${b} `,h+=`H ${f} `,h+=`V ${g} `,h+=`H ${_} `,h+=`V ${v} `,h+=`H ${x} `,h+=`V ${g} `,h+="H 0 ",h+=`V ${b} `,h+=`H ${x} `,h+="V 0 ",h+="Z",h}function m(f){return e.TYPES[f]||e.rectData}Object.defineProperty(e,"__esModule",{value:!0}),e.TYPES=e.circleData=e.rightTriangleData=e.triangleData=e.rectData=void 0,e.starPath=n,e.diamondPath=t,e.pentagonPath=r,e.hexagonPath=a,e.speechBubblePath=s,e.crossPath=c,e.subTypeToPathDataFunc=m,e.figureToSvg=function(f){const{subType:v}=f,y=m(v);return y?function(E,w){const{width:S,height:x,fill:_,stroke:b,strokeWidth:g,dash:h}=E,d=(h||[]).map(F=>F*g);let P=w(E),M=1,T=1;typeof P!="string"&&(M=P.scaleX,T=P.scaleY,P=P.path);const I=`clip-${E.id||Math.random()}`;return`
248
- <svg xmlns="http://www.w3.org/2000/svg" width="${S}" height="${x}">
249
- <defs>
250
- <clipPath id="${I}">
251
- <path d="${P}" />
252
- </clipPath>
253
- </defs>
254
-
255
- <!-- Path for the fill -->
256
- <path d="${P}" fill="${_}" transform="scale(${M}, ${T})"/>
257
-
258
- <!-- Path for the stroke, clipped by the star path -->
259
- <path d="${P}" fill="none" stroke="${b}" stroke-width="${2*g}" clip-path="url(#${I})" transform="scale(${M}, ${T})" stroke-dasharray="${d.join(" ")}"/>
260
- </svg>
261
- `}(f,y):(console.error(`Polotno error: Can not convert ${f.subType} figure to svg.`),(0,e.rectData)(f))},e.rectData=({width:f,height:v,cornerRadius:y})=>{if(y>0){const E=Math.min(y,f/2,v/2);return`M 0 ${E} A ${E} ${E} 0 0 1 ${E} 0 L ${f-E} 0 A ${E} ${E} 0 0 1 ${f} ${E} L ${f} ${v-E} A ${E} ${E} 0 0 1 ${f-E} ${v} L ${E} ${v} A ${E} ${E} 0 0 1 0 ${v-E} Z`}return`M 0 0 L ${f} 0 L ${f} ${v} L 0 ${v} Z`},e.triangleData=({width:f,height:v})=>`M ${f/2} 0 L ${f} ${v} L 0 ${v} Z`,e.rightTriangleData=({width:f,height:v})=>`M 0 0 L ${f} 0 L 0 ${v} Z`,e.circleData=({width:f,height:v})=>`M ${f/2} ${v/2} m -${f/2}, 0 a ${f/2},${v/2} 0 1,0 ${f},0 a ${f/2},${v/2} 0 1,0 -${f},0`,e.TYPES={rect:e.rectData,circle:e.circleData,star:n,triangle:e.triangleData,rightTriangle:e.rightTriangleData,diamond:t,pentagon:r,hexagon:a,speechBubble:s,cross:c,arc:({width:f,height:v})=>o({path:"M234 117C234 85.97 221.673 56.21 199.731 34.269C177.79 12.327 148.03 0 117 0C85.97 0 56.2103 12.327 34.2685 34.268C12.3268 56.21 0 85.97 0 117H117H234Z",aspectRatio:{width:234,height:117},width:f,height:v}),cloud:({width:f,height:v})=>o({path:"M216.41 57.006C216.961 54.084 217.249 51.069 217.249 47.986C217.249 21.4841 195.972 0 169.725 0C153.666 0 139.467 8.043 130.865 20.3575C122.606 13.3566 111.954 9.1402 100.327 9.1402C74.3322 9.1402 53.2123 30.2136 52.8094 56.364H52.8035C23.6407 56.364 0 80.235 0 109.682C0 139.129 23.6407 163 52.8035 163H208.197C237.359 163 261 139.129 261 109.682C261 83.056 241.672 60.99 216.41 57.006Z",aspectRatio:{width:261,height:163},width:f,height:v}),rightArrow:({width:f,height:v})=>{const y=.6*f;return`M 0 ${v/4} L ${y} ${v/4} L ${y} 0 L ${f} ${v/2} L ${y} ${v} L ${y} ${.75*v} L 0 ${.75*v} Z`},leftArrow:({width:f,height:v})=>{const y=.4*f;return`M ${f} ${v/4} L ${y} ${v/4} L ${y} 0 L 0 ${v/2} L ${y} ${v} L ${y} ${.75*v} L ${f} ${.75*v} Z`},downArrow:({width:f,height:v})=>{const y=.6*v;return`M ${f/4} 0 L ${f/4} ${y} L 0 ${y} L ${f/2} ${v} L ${f} ${y} L ${.75*f} ${y} L ${.75*f} 0 Z`},upArrow:({width:f,height:v})=>{const y=.4*v;return`M ${f/4} ${v} L ${f/4} ${y} L 0 ${y} L ${f/2} 0 L ${f} ${y} L ${.75*f} ${y} L ${.75*f} ${v} Z`},asterisk1:({width:f,height:v})=>o({path:"M45.5265 218.498C51.5466 222.87 58.5359 224.98 65.4742 224.98C75.916 224.98 86.221 220.2 92.853 211.217C92.872 211.198 92.89 211.178 92.907 211.157C92.923 211.136 92.939 211.115 92.954 211.094L92.977 211.061C92.993 211.039 93.008 211.017 93.023 210.996L116.491 178.725L139.959 210.996C139.982 211.031 140.006 211.058 140.029 211.088C140.04 211.102 140.05 211.116 140.061 211.132C151.115 226.188 172.355 229.505 187.473 218.515C202.608 207.526 205.992 186.278 195.074 171.104L195.05 171.066C195.03 171.034 195.014 171.01 194.989 170.985L171.572 138.696L209.512 126.346C227.334 120.545 237.129 101.305 231.33 83.476C225.532 65.648 206.315 55.8493 188.476 61.6334L150.537 73.933L150.52 34.0064C150.502 15.2594 135.248 0 116.508 0C97.768 0 82.514 15.2594 82.497 34.0234L82.463 73.916L44.5233 61.6163C44.5083 61.6163 44.49 61.613 44.4716 61.6078C44.4477 61.6014 44.4232 61.5918 44.4041 61.5823C26.5992 55.8664 7.45076 65.665 1.66886 83.46C-4.11314 101.254 5.61427 120.426 23.3511 126.278C23.3675 126.283 23.3822 126.289 23.3963 126.295L23.4588 126.319L23.4873 126.329L61.4098 138.679L37.9929 170.968C37.9844 170.985 37.9718 171.002 37.9591 171.019C37.9462 171.036 37.9336 171.053 37.9251 171.07C26.9903 186.244 30.3915 207.509 45.5265 218.498Z",aspectRatio:{width:233,height:225},width:f,height:v}),asterisk2:({width:f,height:v})=>o({path:"M46.0556 112L0 85.388L33.9456 26.6121L80.028 53.1781L80.054 0H147.946L147.972 53.1781L194.054 26.6121L228 85.388L181.944 112L228 138.612L194.054 197.388L147.972 170.822L147.946 224H80.054L80.028 170.822L33.9456 197.388L0 138.612L46.0556 112Z",aspectRatio:{width:228,height:224},width:f,height:v}),bookmark:({width:f,height:v})=>o({path:"M0 0H199V238L99.5 142.8L0 238V0Z",aspectRatio:{width:199,height:238},width:f,height:v}),butterfly:({width:f,height:v})=>o({path:"M94.5 100.713C91.935 150.916 50.703 190.909 0 191.493V0C50.703 0.5845 91.935 40.5767 94.5 90.78C97.031 41.2385 137.217 1.6407 187 0.0438004V191.45C137.217 189.853 97.031 150.255 94.5 100.713Z",aspectRatio:{width:187,height:192},width:f,height:v}),cylinder:({width:f,height:v})=>o({path:"M169 36.8497V218.15C169 238.502 131.168 255 84.5 255C37.832 255 0 238.502 0 218.15V36.8497C0 16.4982 37.832 0 84.5 0C131.168 0 169 16.4982 169 36.8497Z",aspectRatio:{width:169,height:255},width:f,height:v}),diamond2:({width:f,height:v})=>o({path:"M0 55.5L124 185L248 55.5L189.307 0H58.6933L0 55.5Z",aspectRatio:{width:248,height:185},width:f,height:v}),door:({width:f,height:v})=>o({path:"M140 69.697C140 31.2044 108.66 0 70 0C31.34 0 0 31.2044 0 69.697V207H140V69.697Z",aspectRatio:{width:140,height:207},width:f,height:v}),drop1:({width:f,height:v})=>o({path:"M167 150.687C167 196.328 129.407 234 83.139 234C37.593 234 0 196.328 0 150.687C0 100.7 51.329 36.9474 83.139 0C114.948 39.1207 167 98.526 167 150.687Z",aspectRatio:{width:167,height:234},width:f,height:v}),drop2:({width:f,height:v})=>o({path:"M73 239C53.64 239 35.071 231.315 21.3812 217.634C7.691 203.954 0 185.4 0 166.054C0 136.091 13.8696 113.633 30.768 86.27C43.912 64.9877 58.888 40.7377 70.597 7.6816C71.281 5.7496 72.989 0 72.989 0C72.989 0 72.993 0.0124998 73 0.0363998C73.007 0.0124998 73.011 0 73.011 0C73.011 0 74.719 5.7496 75.403 7.6816C87.112 40.7377 102.088 64.9877 115.232 86.27C132.13 113.633 146 136.091 146 166.054C146 185.4 138.309 203.954 124.619 217.634C111.025 231.218 92.225 239 73 239Z",aspectRatio:{width:146,height:239},width:f,height:v}),explosion:({width:f,height:v})=>o({path:"M165.802 184.465L118.997 260L125.343 182.079L34.9058 219.45L99.164 159.817L0 163.792L78.538 134.373L0 74.7401L86.471 89.052V0L118.997 89.052L165.802 10.3364L149.143 97.798L217.368 29.419L165.802 112.905L245.927 81.101L165.802 143.914H261L165.802 184.465Z",aspectRatio:{width:261,height:260},width:f,height:v}),flag:({width:f,height:v})=>o({path:"M0 142.161C0 142.161 51.9956 118.626 103 137.469C159.992 158.525 206 141.31 206 141.31V11.1373C206 11.1373 160 28.3218 103.016 7.28273C52 -11.553 0 12.0974 0 12.0974V142.161Z",aspectRatio:{width:206,height:148},width:f,height:v}),flower:({width:f,height:v})=>o({path:"M135.351 66.1893C196.683 -5.00591 256.536 100.304 164.908 117.361C256.536 135.16 195.944 239.728 135.351 168.532C166.386 257.526 45.9394 256.785 76.975 168.532C15.643 239.728 -44.2109 135.16 47.4173 117.361C-44.9498 100.304 15.643 -4.26431 76.975 66.1893C45.2005 -22.0631 166.386 -22.0631 135.351 66.1893ZM105.793 104.012C113.183 104.012 119.833 109.945 119.833 117.361C119.833 124.777 113.183 131.452 105.793 131.452C98.404 131.452 92.492 124.777 92.492 117.361C92.492 109.945 98.404 104.012 105.793 104.012Z",aspectRatio:{width:212,height:235},width:f,height:v}),frame:({width:f,height:v})=>o({path:"M0 0H240L200 88L240 176H0L40 88L0 0Z",aspectRatio:{width:240,height:176},width:f,height:v}),heart1:({width:f,height:v})=>o({path:"M215.886 56.157C215.886 24.729 191.112 0 160.584 0C135.933 0 115.08 16.983 107.937 39.93C100.788 16.986 79.935 0.591 55.284 0.591C24.75 0.591 0 24.615 0 56.055C0 71.919 6.321 83.127 16.494 95.121L107.988 189.447L199.377 95.121C209.559 83.127 215.886 72.009 215.886 56.157Z",aspectRatio:{width:216,height:190},width:f,height:v}),home:({width:f,height:v})=>o({path:"M0 62.143L95.5 0L191 62.143V195H0V62.143Z",aspectRatio:{width:191,height:195},width:f,height:v}),home2:({width:f,height:v})=>o({path:"M206 94.076L103 0L0 94.076H31.2377V189H175.607V94.076H206Z",aspectRatio:{width:206,height:189},width:f,height:v}),hourglass:({width:f,height:v})=>o({path:"M0.392782 0H187.607C193.014 43.3688 140.804 53.797 140.804 97.5C140.804 141.203 193.014 151.631 187.607 195H0.392782C-5.01452 151.631 47.196 141.203 47.196 97.5C47.196 53.797 -5.01452 43.3688 0.392782 0Z",aspectRatio:{width:188,height:195},width:f,height:v}),house:({width:f,height:v})=>o({path:"M0 92.367L95 0L190 92.367V223H0V92.367Z",aspectRatio:{width:190,height:223},width:f,height:v}),keyhole:({width:f,height:v})=>o({path:"M115 57.0494C115 25.5387 89.416 0 57.863 0C26.311 0 0.726898 25.5414 0.726898 57.0494C0.726898 78.652 12.759 97.451 30.505 107.136L0 219H114.845L84.448 107.524C102.608 97.962 115 78.959 115 57.0494Z",aspectRatio:{width:115,height:219},width:f,height:v}),kiss:({width:f,height:v})=>o({path:"M124.5 17.1468C80.036 -36.5162 0 52.9218 0 52.9218C0 52.9218 44.4643 120 124.5 120C204.536 120 249 52.9218 249 52.9218C249 52.9218 168.964 -36.5162 124.5 17.1468Z",aspectRatio:{width:249,height:120},width:f,height:v}),leaf:({width:f,height:v})=>o({path:"M204.414 0.0151567C204.414 0.0151567 206.837 93.9509 150.394 150.394C93.9507 206.837 0.0151569 204.413 0.0151569 204.413C0.0151569 204.413 -2.40835 110.478 54.0347 54.0349C110.478 -2.40834 204.414 0.0151567 204.414 0.0151567Z",aspectRatio:{width:205,height:205},width:f,height:v}),lightning1:({width:f,height:v})=>o({path:"M111.5 0L0 142H51.433L31.5 253L143 111H91.567L111.5 0Z",aspectRatio:{width:143,height:253},width:f,height:v}),lightning2:({width:f,height:v})=>o({path:"M126 0H43L0 120.531H36L6 227L110 80.354H73L126 0Z",aspectRatio:{width:126,height:227},width:f,height:v}),magnet:({width:f,height:v})=>o({path:"M88.402 0H0V67.669H88.402C105.271 67.669 118.957 81.308 118.957 98C118.957 114.689 105.271 128.331 88.402 128.331H0V196H88.402C142.747 196 187 152.072 187 98C187 43.9279 142.747 0 88.402 0Z",aspectRatio:{width:187,height:196},width:f,height:v}),mithosis:({width:f,height:v})=>o({path:"M150.996 136.45C137.141 128.926 117.559 128.7 103.532 135.896C93.843 140.867 82.875 143.67 71.2577 143.67C31.9033 143.67 0 111.508 0 71.835C0 32.161 31.9033 0 71.2577 0C83.467 0 94.959 3.0955 105.004 8.5504C118.859 16.0745 138.441 16.3 152.467 9.1038C162.157 4.1328 173.125 1.3303 184.742 1.3303C224.097 1.3303 256 33.492 256 73.165C256 112.839 224.097 145 184.742 145C172.533 145 161.041 141.905 150.996 136.45Z",aspectRatio:{width:256,height:145},width:f,height:v}),orangeRicky:({width:f,height:v})=>o({path:"M69 0H0V69V138V207H69H138V138H69V69V0Z",aspectRatio:{width:138,height:207},width:f,height:v}),party:({width:f,height:v})=>o({path:"M134.622 0L144.682 68.2539L174.415 5.9977L163.91 74.1846L210.671 23.4578L180.535 85.519L240.169 50.8289L193.079 101.25L260.29 85.679L200.43 119.98L269.245 124.911L201.934 140.044L266.237 165.04L197.456 159.661L251.535 202.5L187.396 177.086L226.445 233.962L172.646 190.771L193.197 256.631L154.518 199.501L154.743 268.492L134.622 202.5L114.501 268.492L114.727 199.501L76.0482 256.631L96.5985 190.771L42.7992 233.962L81.8489 177.086L17.7091 202.5L71.7885 159.661L3.0072 165.04L67.3112 140.044L0 124.911L68.8149 119.98L8.9545 85.679L76.1658 101.25L29.0753 50.8289L88.7105 85.519L58.5743 23.4578L105.335 74.1846L94.8305 5.9977L124.562 68.2539L134.622 0Z",aspectRatio:{width:270,height:269},width:f,height:v}),pillow:({width:f,height:v})=>o({path:"M176 0.00169945C157.812 16.9062 125.203 28.174 88.001 28.174C50.798 28.174 18.1881 16.9054 0 0V258.421C18.1882 241.516 50.798 230.248 88 230.248C125.202 230.248 157.812 241.516 176 258.421V0.00169945Z",aspectRatio:{width:176,height:259},width:f,height:v}),polygon:({width:f,height:v})=>o({path:"M110 0L219.119 63V189L110 252L0.880798 189V63L110 0Z",aspectRatio:{width:220,height:252},width:f,height:v}),rainbow:({width:f,height:v})=>o({path:"M186.907 141H282C282 63.128 218.872 0 141 0C63.1278 0 0 63.128 0 141H95.093C95.093 115.646 115.646 95.093 141 95.093C166.354 95.093 186.907 115.646 186.907 141Z",aspectRatio:{width:282,height:141},width:f,height:v}),rhodeIsland:({width:f,height:v})=>o({path:"M69 0H0V69V138H69V207H138V138V69H69V0Z",aspectRatio:{width:138,height:207},width:f,height:v}),shell:({width:f,height:v})=>o({path:"M109 0C169.199 0 218 48.743 218 108.87C185.392 108.87 158.958 135.273 158.958 167.842C158.958 179.736 158.958 191 158.958 191H59.042C59.042 191 59.042 179.736 59.042 167.842C59.042 135.273 32.6077 108.87 0 108.87C0 48.743 48.8007 0 109 0Z",aspectRatio:{width:218,height:191},width:f,height:v}),shield1:({width:f,height:v})=>o({path:"M203.184 30.7277C142.457 30.7277 102.853 0 102.853 0C102.853 0 63.249 30.7277 3.05098 30.7277C3.05098 30.7277 -3.81372 128.209 3.05098 162.115C9.38758 193.902 102.853 249 102.853 249C102.853 249 196.319 193.902 203.184 162.115C209.52 128.738 203.184 30.7277 203.184 30.7277Z",aspectRatio:{width:206,height:249},width:f,height:v}),shield2:({width:f,height:v})=>o({path:"M0 12.9585C64.624 -4.3195 136.376 -4.3195 201 12.9585C201 51.0564 201 89.154 201 127.252C201 184.396 100.498 240 100.498 240C100.498 240 0 184.406 0 127.252C0 89.154 0 51.0564 0 12.9585Z",aspectRatio:{width:201,height:240},width:f,height:v}),skewedRectangle:({width:f,height:v})=>o({path:"M85.9799 0H290L204.02 141H0L85.9799 0Z",aspectRatio:{width:290,height:141},width:f,height:v}),softFlower:({width:f,height:v})=>o({path:"M109 0C80.073 0 56.6234 23.4498 56.6234 52.3766C56.6234 54.722 54.722 56.6234 52.3766 56.6234C23.4498 56.6234 0 80.073 0 109C0 137.927 23.4498 161.377 52.3766 161.377C54.722 161.377 56.6234 163.278 56.6234 165.623C56.6234 194.55 80.073 218 109 218C137.927 218 161.377 194.55 161.377 165.623C161.377 163.278 163.278 161.377 165.623 161.377C194.55 161.377 218 137.927 218 109C218 80.073 194.55 56.6234 165.623 56.6234C163.278 56.6234 161.377 54.722 161.377 52.3766C161.377 23.4498 137.927 0 109 0Z",aspectRatio:{width:218,height:218},width:f,height:v}),softStar:({width:f,height:v})=>o({path:"M130.424 3.17662C130.927 -1.05888 137.073 -1.05888 137.576 3.17662L141.792 38.7086C147.236 84.59 183.41 120.764 229.291 126.208L264.823 130.424C269.059 130.927 269.059 137.073 264.823 137.576L229.291 141.792C183.41 147.236 147.236 183.41 141.792 229.291L137.576 264.823C137.073 269.059 130.927 269.059 130.424 264.823L126.208 229.291C120.764 183.41 84.59 147.236 38.7086 141.792L3.17662 137.576C-1.05888 137.073 -1.05888 130.927 3.17662 130.424L38.7086 126.208C84.59 120.764 120.764 84.59 126.208 38.7086L130.424 3.17662Z",aspectRatio:{width:268,height:268},width:f,height:v}),stairs1:({width:f,height:v})=>o({path:"M0 0H67.667V67.667H135.333V135.333H203V203H0V0Z",aspectRatio:{width:203,height:203},width:f,height:v}),stairs2:({width:f,height:v})=>o({path:"M50 0H0V200H200V150H150V100H100V50H50V0Z",aspectRatio:{width:200,height:200},width:f,height:v}),teewee:({width:f,height:v})=>o({path:"M69 0H138V69H207V138H138H69H0V69H69V0Z",aspectRatio:{width:207,height:138},width:f,height:v}),blob1:({width:f,height:v})=>o({path:"M172.979 19.611C191.285 33.0858 204.505 54.442 210.861 78.5949C217.471 103.002 217.471 130.46 205.776 151.816C194.335 173.427 171.454 189.444 147.047 196.054C122.639 202.919 96.7069 200.631 75.3506 190.715C54.2486 180.546 37.7229 163.003 23.4855 142.155C9.5022 121.307 -2.19289 97.4087 0.349524 74.7813C3.14617 52.1538 19.9261 30.7976 40.2654 17.8313C60.6046 4.61077 84.5033 -0.474048 108.148 0.0344341C131.538 0.542916 154.928 6.13621 172.979 19.611Z",aspectRatio:{width:216,height:200},width:f,height:v}),blob10:({width:f,height:v})=>o({path:"M188.684 8.95173C205.601 24.3309 200.988 63.0866 191.453 99.3816C182.225 135.677 168.076 169.511 146.238 175.355C124.399 181.507 94.871 159.668 66.5733 143.059C37.9679 126.449 10.5929 115.068 2.59569 95.0754C-5.4015 75.0824 5.97912 46.1694 24.4342 30.4826C42.8893 14.7958 68.4188 12.0276 100.715 6.79864C132.704 1.5697 171.767 -6.42749 188.684 8.95173Z",aspectRatio:{width:200,height:177},width:f,height:v}),blob11:({width:f,height:v})=>o({path:"M137.368 29.4923C148.97 46.7605 146.542 72.1231 148.161 99.1046C149.779 126.086 155.715 154.956 144.113 174.383C132.781 193.81 103.911 203.793 80.4369 198.666C56.963 193.27 38.6156 173.034 28.3626 153.607C17.8398 134.181 15.4115 115.833 9.47555 91.5498C3.53961 67.2664 -5.63411 37.3169 4.61887 20.0488C15.1417 2.51078 45.0911 -1.80626 72.8821 0.622074C100.673 2.78059 126.036 12.2241 137.368 29.4923Z",aspectRatio:{width:152,height:200},width:f,height:v}),blob12:({width:f,height:v})=>o({path:"M158.391 17.923C172.491 28.5703 180.261 48.1384 187.743 70.5842C194.937 93.3177 202.419 118.641 194.649 138.785C187.167 158.928 164.146 173.317 138.535 184.54C112.923 196.05 84.4347 204.108 58.8235 197.777C33.2123 191.446 10.191 170.439 2.99688 146.267C-4.48504 121.807 3.57241 94.181 10.4788 68.282C17.0974 42.0953 22.565 17.6352 37.8166 7.27563C53.0682 -3.37171 78.1038 0.081487 100.837 2.67138C123.859 5.26127 144.29 7.27563 158.391 17.923Z",aspectRatio:{width:198,height:200},width:f,height:v}),blob13:({width:f,height:v})=>o({path:"M149.668 1.37595C170.663 5.22017 193.728 17.3442 198.755 34.7911C204.078 52.2379 191.363 75.3032 178.943 93.9329C166.819 112.563 154.99 126.757 140.501 145.386C126.011 164.312 108.86 187.673 92.5957 186.194C76.3317 185.011 60.9549 159.285 45.8737 140.655C30.4968 122.321 15.7114 110.788 7.43151 95.1157C-0.848339 79.4432 -2.32688 59.0392 3.5873 41.5924C9.50148 23.8498 23.1041 8.76868 38.7767 3.44592C54.745 -1.87685 73.3746 2.55879 91.7086 2.26308C110.338 2.26308 128.968 -2.17256 149.668 1.37595Z",aspectRatio:{width:200,height:187},width:f,height:v}),blob14:({width:f,height:v})=>o({path:"M137.838 28.6426C150.711 40.5617 165.014 46.5213 178.363 58.2021C191.474 69.8828 203.87 87.0464 198.864 99.6807C193.858 112.315 171.689 120.42 157.862 135.676C144.275 151.171 139.269 173.579 126.873 182.161C114.477 190.505 94.9294 185.022 76.8123 178.109C58.4568 171.196 41.5316 163.091 28.1822 150.456C14.5943 137.822 4.58225 120.42 1.24488 101.826C-2.09248 83.2322 1.00651 62.9697 13.8792 52.4809C26.7519 41.992 49.1598 41.0385 65.6083 30.788C82.0567 20.5376 92.0688 0.990158 103.034 0.0366268C113.762 -0.916905 125.204 16.9618 137.838 28.6426Z",aspectRatio:{width:200,height:187},width:f,height:v}),blob15:({width:f,height:v})=>o({path:"M185.203 1.52939C197.679 7.62217 200 32.2835 200 51.7223C200 71.1612 197.389 85.3777 197.679 100.175C198.259 114.681 201.741 129.768 198.259 143.114C194.778 156.46 184.623 168.356 171.567 173.868C158.801 179.671 143.134 179.091 130.368 174.739C117.312 170.387 106.867 162.263 86.8482 160.812C66.539 159.362 36.9454 164.294 18.9572 155.3C0.968966 146.306 -5.41395 123.095 5.03083 105.977C15.4756 88.5692 42.4579 77.5442 55.5139 59.5559C68.2798 41.8578 67.1192 17.4867 76.9837 9.6531C86.5581 2.10965 107.158 11.3939 128.627 9.6531C150.097 8.20244 172.728 -4.27327 185.203 1.52939Z",aspectRatio:{width:200,height:179},width:f,height:v}),blob16:({width:f,height:v})=>o({path:"M158.441 55.3221C167.253 80.2399 160.264 105.462 147.501 134.938C134.738 164.717 116.81 199.055 97.0576 199.967C77.3057 201.182 55.7305 168.668 34.4592 133.722C13.1879 99.0802 -7.77953 62.3112 2.85612 36.4818C13.4918 10.6523 56.0344 -3.93369 90.0685 0.928322C123.799 6.09421 149.324 30.7081 158.441 55.3221Z",aspectRatio:{width:163,height:200},width:f,height:v}),blob17:({width:f,height:v})=>o({path:"M168.917 36.7587C178.871 53.2457 175.138 76.5764 172.961 106.129C170.472 135.37 169.85 170.832 150.563 187.63C131.276 204.739 93.3252 203.495 65.0173 187.63C36.7095 172.077 18.0449 142.213 7.77943 107.373C-2.79714 72.2213 -4.35252 32.7147 14.312 14.0502C32.9765 -4.3033 72.1721 -1.50361 103.591 4.7179C135.32 10.6283 158.962 20.2717 168.917 36.7587Z",aspectRatio:{width:176,height:200},width:f,height:v}),blob18:({width:f,height:v})=>o({path:"M178.188 21.1464C193.012 36.3069 196.381 62.9219 198.739 88.1893C200.76 113.12 201.771 136.366 190.316 149.168C178.862 162.307 155.279 164.665 135.065 167.697C115.188 170.73 99.0168 174.098 72.4018 177.131C46.1237 180.163 9.40176 182.521 1.65309 168.371C-6.09559 154.221 15.4659 123.564 23.5515 92.9059C31.6371 62.2481 26.2467 31.2534 38.3751 15.4192C50.1665 -0.0781831 79.8136 -1.08888 107.776 0.595609C136.076 1.9432 163.028 5.64909 178.188 21.1464Z",aspectRatio:{width:200,height:180},width:f,height:v}),blob19:({width:f,height:v})=>o({path:"M148.621 13.3857C171.945 24.3818 194.937 41.3756 192.938 60.702C190.605 80.3615 163.282 101.687 149.953 123.346C136.958 145.005 137.958 166.664 128.295 174.661C118.631 182.325 98.3054 175.994 73.6476 181.991C48.9899 187.989 20.0004 205.983 11.0036 197.986C1.67366 189.989 12.6697 156.001 12.3365 131.343C12.0033 106.685 0.340809 91.0243 0.00759636 75.0301C-0.325616 59.0359 10.3372 42.3753 25.3318 28.7135C39.9931 15.0518 58.9863 4.05578 80.3119 1.05687C101.638 -2.27526 124.962 2.38972 148.621 13.3857Z",aspectRatio:{width:194,height:200},width:f,height:v}),blob2:({width:f,height:v})=>o({path:"M140.464 18.6393C156.081 28.3718 169.887 39.9149 178.714 54.853C187.541 69.5649 191.389 87.6717 189.578 104.421C187.768 121.396 180.525 137.239 172.377 153.535C164.455 169.832 155.854 186.58 142.048 194.276C128.241 201.971 109.456 200.613 92.4804 197.671C75.2789 194.502 60.1144 189.749 45.1762 182.733C30.4644 175.716 16.2052 166.21 8.28346 153.083C0.361703 139.729 -1.44898 122.527 1.04072 106.91C3.30408 91.2931 9.64147 76.8076 15.9789 60.5114C22.0899 44.2153 28.201 26.1084 40.6495 14.7916C53.0979 3.24849 71.8838 -1.27823 89.7643 0.306124C107.871 1.66414 124.846 9.13322 140.464 18.6393Z",aspectRatio:{width:191,height:200},width:f,height:v}),blob20:({width:f,height:v})=>o({path:"M150.035 13.2464C157.376 24.9386 153.026 48.323 157.92 65.7254C163.087 83.1277 177.498 94.2761 182.392 108.415C187.287 122.555 182.392 139.957 173.147 156.272C163.63 172.587 149.763 187.814 132.089 195.155C114.414 202.225 93.2053 201.137 73.6276 194.611C54.3219 188.357 36.9196 176.937 25.7712 161.438C14.8947 145.667 10.5441 126.09 5.92163 105.696C1.57105 85.0311 -3.05145 63.5501 2.65869 45.0601C8.64075 26.5701 24.6835 11.0711 43.1735 4.54524C61.6635 -1.98064 82.6007 0.194657 102.722 1.01039C122.844 1.82613 142.421 1.55421 150.035 13.2464Z",aspectRatio:{width:185,height:200},width:f,height:v}),blob21:({width:f,height:v})=>o({path:"M152.611 0.184799C172.596 -0.723643 197.73 1.39606 199.85 13.8114C201.969 26.2268 181.075 48.9379 174.716 68.0151C168.357 87.0924 176.533 102.536 174.11 114.649C171.991 127.064 159.575 136.148 146.252 139.782C132.928 143.719 118.696 141.902 105.977 139.176C93.562 136.451 82.6606 132.212 63.2805 131.909C43.9004 131.606 16.0416 135.24 5.44306 125.853C-5.15543 116.465 1.50648 94.0572 10.2881 76.4939C18.7669 59.2335 29.6682 46.8182 38.7526 35.3112C48.1398 23.5015 56.3158 12.903 66.9143 8.36078C77.5128 4.12138 91.1394 6.24108 104.766 5.63546C118.696 4.72701 132.928 1.09324 152.611 0.184799Z",aspectRatio:{width:200,height:143},width:f,height:v}),blob22:({width:f,height:v})=>o({path:"M195.507 15.5715C206.818 33.1668 193.622 69.3001 190.166 101.663C186.71 134.34 193.308 163.561 181.996 178.014C170.685 192.153 141.464 191.525 114.443 189.326C87.1072 187.44 62.2852 183.67 40.6052 169.531C19.2395 155.077 1.6441 130.255 0.0730908 103.862C-1.18372 77.4694 13.898 49.5054 35.2638 31.91C56.6296 14.0004 84.5936 6.45958 116.328 2.37494C148.063 -1.70969 184.196 -2.3381 195.507 15.5715Z",aspectRatio:{width:200,height:191},width:f,height:v}),blob23:({width:f,height:v})=>o({path:"M135.742 9.14189C157.815 19.2326 179.258 38.4681 176.105 56.7576C172.951 74.7317 145.202 92.0751 127.858 109.734C110.83 127.077 104.523 145.052 87.4953 164.918C70.4672 184.468 42.7177 206.227 27.5816 198.343C12.4455 190.46 9.60747 153.566 6.45411 126.762C2.98542 100.274 -0.798607 84.1917 0.147399 67.1636C0.77807 50.4508 6.76944 32.4767 19.0675 20.8093C31.0503 9.14189 49.6551 3.78119 70.4672 1.2585C90.964 -1.26418 113.668 -0.633508 135.742 9.14189Z",aspectRatio:{width:177,height:200},width:f,height:v}),blob24:({width:f,height:v})=>o({path:"M165.663 24.3715C171.555 44.4059 158.003 76.2254 151.816 96.2598C145.923 116.294 147.691 124.544 148.28 135.445C148.575 146.346 147.396 159.309 140.62 170.8C133.549 181.996 120.88 191.424 104.381 196.432C87.8821 201.441 67.553 202.03 54.8841 192.602C41.9207 183.469 36.6174 164.023 25.1271 143.105C13.3421 122.187 -4.33535 99.7953 0.967891 85.0641C6.27113 70.6275 34.2604 63.8511 56.0626 48.5307C77.5702 33.5048 92.8907 9.93489 113.22 2.56928C133.843 -4.79633 159.77 4.04241 165.663 24.3715Z",aspectRatio:{width:168,height:200},width:f,height:v}),blob25:({width:f,height:v})=>o({path:"M180.115 1.256C192.651 2.1962 189.83 34.163 190.771 58.2947C191.711 82.4265 196.098 98.4099 198.606 117.214C201.113 136.018 201.426 157.642 189.204 165.791C177.294 173.626 153.163 167.671 135.299 163.91C117.749 159.836 106.466 157.956 85.7818 162.97C65.0974 168.298 35.3244 180.521 18.7143 174.253C1.79068 167.985 -1.97012 142.913 0.850478 120.975C3.67107 99.0367 13.0731 79.6059 18.4009 54.8473C23.7287 30.0888 24.9823 -0.310996 40.0254 0.00240332C54.7552 0.00240332 82.9612 31.029 111.167 31.029C139.373 31.029 167.579 0.315802 180.115 1.256Z",aspectRatio:{width:200,height:176},width:f,height:v}),blob26:({width:f,height:v})=>o({path:"M142.571 0.586925C159.976 3.39414 176.258 15.1844 184.96 30.9048C193.662 46.6253 194.224 66.8372 189.171 83.6805C183.837 100.805 172.327 114.56 163.064 129.157C153.8 143.755 146.501 158.914 134.43 173.231C122.359 187.828 105.516 201.303 89.5146 199.899C73.2327 198.776 58.0738 182.775 42.9148 169.862C28.0366 157.23 13.7198 147.685 6.42103 134.491C-0.877729 121.297 -1.15845 103.892 1.64876 88.4528C4.45598 72.7324 10.0704 58.6963 18.4921 47.4674C27.1944 36.2386 38.4233 27.8169 50.4943 22.2025C62.846 16.3073 75.7592 13.5001 91.1989 8.72785C106.919 4.23631 125.166 -1.93957 142.571 0.586925Z",aspectRatio:{width:193,height:200},width:f,height:v}),blob27:({width:f,height:v})=>o({path:"M112.602 54.9337C129.225 71.8646 155.391 78.9448 158.777 89.719C162.471 100.493 143.693 114.654 127.07 135.586C110.447 156.519 96.2866 184.224 71.0442 194.998C46.1096 205.465 10.4008 199.308 2.0893 178.375C-6.22223 157.443 12.5557 121.734 18.4045 92.1817C24.5612 62.6296 17.7889 38.9263 26.4082 21.9954C34.7197 5.06454 58.423 -5.40183 73.5069 2.9097C88.8986 10.9134 95.9788 38.0028 112.602 54.9337Z",aspectRatio:{width:160,height:200},width:f,height:v}),blob28:({width:f,height:v})=>o({path:"M125.281 68.5835C142.15 82.9923 165.344 90.021 181.862 108.998C198.028 127.624 207.516 158.902 192.405 166.634C177.293 174.716 137.581 159.605 112.629 156.442C87.326 152.928 77.1344 161.713 59.9142 165.579C43.0453 169.445 19.1478 168.391 11.7677 157.496C4.73907 146.25 14.2278 124.813 11.4163 94.2382C8.2534 63.6634 -6.85825 23.9514 3.68476 8.48836C14.2278 -7.32615 50.4254 1.10826 73.9715 16.2199C97.5175 31.683 108.412 54.1747 125.281 68.5835Z",aspectRatio:{width:200,height:169},width:f,height:v}),blob29:({width:f,height:v})=>o({path:"M162.987 10.2348C169.16 25.1809 154.864 58.6471 147.066 79.4417C139.268 100.236 138.293 108.359 134.719 114.532C131.47 120.706 125.297 124.93 119.448 143.45C113.6 161.97 107.426 194.461 98.004 199.335C88.5814 204.209 75.5849 181.14 55.7651 167.494C35.6203 153.522 8.65241 148.648 1.8292 135.327C-4.994 122.33 8.65241 100.561 20.0244 82.041C31.3964 63.5208 40.1691 48.2498 53.4906 35.5782C66.8122 22.9065 84.0326 13.159 106.452 6.33584C128.871 -0.812285 156.489 -4.71127 162.987 10.2348Z",aspectRatio:{width:165,height:200},width:f,height:v}),blob3:({width:f,height:v})=>o({path:"M158.095 64.2637C176.543 95.19 192.277 129.1 181.697 155.686C171.117 182.001 133.951 201.533 99.4982 199.905C64.7739 198.549 33.0338 176.032 15.4004 145.377C-2.23296 114.994 -5.75963 76.2002 10.2461 46.6303C26.2518 17.0605 61.5185 -3.557 89.732 0.512241C118.217 4.58149 139.377 33.0662 158.095 64.2637Z",aspectRatio:{width:186,height:200},width:f,height:v}),blob30:({width:f,height:v})=>o({path:"M146.076 34.4585C157.052 54.582 155.833 80.1936 164.675 100.622C173.212 121.355 191.201 136.905 189.372 149.711C187.542 162.212 165.285 171.969 146.99 175.018C129.001 178.372 114.671 174.713 103.39 175.018C92.1083 175.018 83.876 178.982 66.8015 186.299C49.7271 193.617 23.8105 204.288 14.3586 198.19C4.90665 191.787 11.6145 168.615 10.3949 147.882C8.87037 127.148 -0.581561 108.549 0.0282404 89.3407C0.638042 70.1319 11.6145 50.6182 28.384 32.934C44.8487 15.5546 67.4113 0.309578 89.974 0.00467694C112.537 -0.300224 135.099 14.335 146.076 34.4585Z",aspectRatio:{width:190,height:200},width:f,height:v}),blob31:({width:f,height:v})=>o({path:"M134.218 44.0392C153.568 36.4264 184.97 26.9105 195.755 33.2544C206.222 39.9156 195.755 62.1194 181.481 76.3933C166.89 90.35 148.175 96.0596 145.638 116.36C143.1 136.661 156.74 171.235 151.664 183.923C146.589 196.928 123.434 187.413 105.036 178.531C86.6388 169.967 73.3165 161.72 52.0643 158.548C30.812 155.058 1.62986 156.644 0.0438693 145.225C-1.22492 133.806 25.4197 109.382 29.2261 86.8609C32.7152 64.3398 13.6834 44.0392 11.7802 26.9105C9.877 9.46461 24.7853 -4.80928 42.5484 1.53467C59.9942 7.87863 79.9777 34.5232 93.6172 45.308C107.257 56.4099 114.869 51.3347 134.218 44.0392Z",aspectRatio:{width:200,height:191},width:f,height:v}),blob32:({width:f,height:v})=>o({path:"M200 100.339C200 149.831 145.763 197.966 95.5932 197.966C45.7627 197.966 0 149.831 0 100.339C0 50.8475 45.7627 0 95.5932 0C145.763 0 200 50.8475 200 100.339Z",aspectRatio:{width:200,height:198},width:f,height:v}),blob4:({width:f,height:v})=>o({path:"M183.427 38.712C198.21 63.2519 196.141 95.1833 189.341 126.523C182.836 157.863 171.305 188.908 150.609 197.482C130.208 205.76 100.642 192.16 69.8936 177.968C39.4405 164.072 7.80478 150.176 1.30024 128.593C-5.2043 107.01 13.718 77.7393 35.3012 51.7211C56.5888 25.9986 81.1287 3.23272 108.921 0.276112C137.009 -2.38484 168.349 14.4678 183.427 38.712Z",aspectRatio:{width:195,height:200},width:f,height:v}),blob5:({width:f,height:v})=>o({path:"M166.251 30.6913C183.816 48.5185 195.875 71.8512 199.021 98.8542C202.429 125.595 197.186 155.744 179.359 169.115C161.794 182.223 131.645 178.815 103.331 176.979C75.0171 175.144 48.8006 174.882 29.6625 161.512C10.7866 148.141 -0.748681 121.925 0.0378149 96.2326C0.824311 70.8025 14.1947 46.159 33.0706 28.3318C52.2087 10.5045 76.8522 -0.5064 100.971 0.0179307C125.091 0.804426 148.423 12.864 166.251 30.6913Z",aspectRatio:{width:200,height:179},width:f,height:v}),blob6:({width:f,height:v})=>o({path:"M149.146 50.5452C161.911 68.0278 171.901 81.9028 176.619 97.9979C181.336 114.37 180.781 133.241 173.011 149.891C165.519 166.541 151.366 180.693 133.051 189.851C114.736 199.008 92.2586 202.893 71.446 197.621C50.6334 192.348 30.9308 177.918 18.1658 158.216C5.12323 138.791 -0.981801 113.815 0.128204 87.7304C1.51571 61.6453 10.6733 34.1726 29.2658 17.5226C48.1359 1.14999 76.996 -4.40004 98.9186 3.6475C120.841 11.695 136.381 32.7851 149.146 50.5452Z",aspectRatio:{width:180,height:200},width:f,height:v}),blob7:({width:f,height:v})=>o({path:"M158.662 41.8295C178.593 57.8305 204.138 64.5677 213.402 79.7266C222.666 94.6047 215.367 118.466 203.015 135.028C190.383 151.871 172.698 161.977 156.416 168.434C140.134 174.89 124.975 177.697 104.483 185.277C83.9903 192.856 58.1642 205.208 44.9704 197.629C31.4959 190.33 31.2152 163.1 21.9514 138.116C12.9684 112.851 -4.71688 90.1132 1.17822 75.5158C7.35404 61.1991 36.8295 55.5847 58.7256 40.1452C80.9024 24.7056 95.4998 -0.278374 109.816 0.00234533C124.414 0.283064 138.45 25.8285 158.662 41.8295Z",aspectRatio:{width:218,height:200},width:f,height:v}),blob8:({width:f,height:v})=>o({path:"M153.53 11.0108C168.179 18.1858 181.931 29.5461 192.993 44.4939C203.755 59.4417 212.425 78.2759 210.631 96.5122C209.136 114.748 197.477 132.088 182.529 142.252C167.581 152.716 148.747 156.004 128.717 168.262C108.687 180.22 87.1622 201.147 69.8228 199.951C52.7823 198.456 39.6283 174.54 32.4533 153.015C25.2784 131.49 24.0826 112.357 16.6087 91.131C9.13477 70.2041 -4.31825 46.8855 1.36191 31.9377C7.04207 16.691 31.8554 9.51607 52.7823 5.33069C73.4103 0.846349 90.4507 -0.648433 106.594 0.248435C123.037 1.1453 138.882 4.13486 153.53 11.0108Z",aspectRatio:{width:211,height:200},width:f,height:v}),blob9:({width:f,height:v})=>o({path:"M140.289 20.2182C156.96 27.7956 176.661 32.0895 189.29 43.9608C201.667 55.5796 206.718 75.0283 202.424 91.6987C198.131 108.622 184.491 122.766 175.651 140.952C166.81 158.885 162.769 180.607 150.393 191.216C138.016 201.824 117.052 201.572 98.866 197.025C80.6802 192.479 65.2727 183.891 48.3497 175.808C31.4268 167.726 13.2409 160.148 5.1583 146.761C-2.67172 133.122 -0.398493 113.673 4.14797 96.7504C8.69444 80.08 15.5141 65.6828 23.3442 52.296C31.4268 38.6566 40.5197 25.775 52.6436 15.6717C65.0201 5.82101 80.6802 -1.50385 95.3299 0.264221C109.98 1.77971 123.619 12.6407 140.289 20.2182Z",aspectRatio:{width:204,height:200},width:f,height:v})}}(v1)),v1}var y3;function lP(){return y3||(y3=1,function(e){var n=vd&&vd.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const t=n(Or()),r=Ri,a=oo,o=Qv(),s=Xs(),c=es(),m=Gd(),f={};e.FigureElement=(0,r.observer)(({element:v,store:y})=>{const E=v.selectable||y.role==="admin",w=(0,c.isTouchDevice)(),[S,x]=t.default.useState(!1),_=y.selectedShapes.indexOf(v)>=0,b=Math.min(v.strokeWidth,v.width/2,v.height/2),g=Math.max(0,Math.min(v.width/2,v.height/2,v.cornerRadius)),h=(0,m.useColor)(v,v.a.fill,"fill"),d=Object.assign(Object.assign({width:v.a.width,height:v.a.height},h),{cornerRadius:g,opacity:v.animated("opacity"),shadowEnabled:v.shadowEnabled,shadowBlur:v.shadowBlur,shadowOffsetX:v.shadowOffsetX,shadowOffsetY:v.shadowOffsetY,shadowColor:v.shadowColor,shadowOpacity:v.shadowOpacity,preventDefault:!w||_,hideInExport:!v.showInExport}),P=(0,m.useColor)(v,v.stroke,"stroke"),M=Object.assign(Object.assign({visible:b>0,x:b/2,y:b/2,width:v.a.width-b,height:v.a.height-b},P),{strokeWidth:b,cornerRadius:Math.max(0,g-b),dash:v.dash.map(k=>k*b),opacity:v.animated("opacity"),hideInExport:!v.showInExport,listening:!1}),T=(I=v.subType,f[I]||(f[I]=(F=(0,o.subTypeToPathDataFunc)(I),(0,r.observer)(({element:k,fillProps:O,strokeProps:N})=>{let A=F({width:k.a.width,height:k.a.height,cornerRadius:k.cornerRadius}),R=1,L=1;typeof A!="string"&&(R=A.scaleX,L=A.scaleY,A=A.path);const V=t.default.useRef(null);return t.default.createElement(t.default.Fragment,null,t.default.createElement(a.Rect,{width:k.width,height:k.height,fill:"transparent"}),t.default.createElement(a.Path,Object.assign({},O,{ref:V,data:A,scaleX:R,scaleY:L})),t.default.createElement(a.Group,{clipFunc:G=>{const W=V.current;if(W){var X=W.dataArray;G.beginPath();for(var q=0;q<X.length;q++){var z=X[q].command,Y=X[q].points;switch(z){case"L":G.lineTo(Y[0],Y[1]);break;case"M":G.moveTo(Y[0],Y[1]);break;case"C":G.bezierCurveTo(Y[0],Y[1],Y[2],Y[3],Y[4],Y[5]);break;case"Q":G.quadraticCurveTo(Y[0],Y[1],Y[2],Y[3]);break;case"A":var U=Y[0],ee=Y[1],te=Y[2],Q=Y[3],Z=Y[4],re=Y[5],ne=Y[6],ae=Y[7],ue=te>Q?te:Q,fe=te>Q?1:te/Q,pe=te>Q?Q/te:1;G.translate(U,ee),G.rotate(ne),G.scale(fe,pe),G.arc(0,0,ue,Z,Z+re,1-ae),G.scale(1/fe,1/pe),G.rotate(-ne),G.translate(-U,-ee);break;case"z":G.closePath()}}}},scaleX:R,scaleY:L},t.default.createElement(a.Path,Object.assign({},N,{x:0,y:0,data:A,strokeWidth:2*N.strokeWidth,dash:N.dash.map(G=>G)}))))}))),f[I]||a.Group);var I,F;return t.default.createElement(t.default.Fragment,null,t.default.createElement(a.Group,{id:v.id,x:v.a.x,y:v.a.y,rotation:v.a.rotation,opacity:v.a.opacity,listening:E,draggable:w?v.draggable&&_:v.draggable,name:"element",onMouseEnter:()=>{x(!0)},onMouseLeave:()=>{x(!1)},onDragMove:k=>{v.set({x:k.target.x(),y:k.target.y()})},onDragEnd:k=>{v.set({x:k.target.x(),y:k.target.y()})},onTransform:k=>{const O=k.target.scale();k.target.scaleX(1),k.target.scaleY(1),v.set({width:v.width*O.x,height:v.height*O.y,x:k.target.x(),y:k.target.y(),rotation:k.target.rotation()})}},t.default.createElement(T,{element:v,fillProps:d,strokeProps:M})),(S||_)&&t.default.createElement(s.Highlighter,{element:v}))})}(vd)),vd}var md={},qo={},m1={},Ho={},b3;function e_(){if(b3)return Ho;b3=1,Object.defineProperty(Ho,"__esModule",{value:!0}),Ho.loop=Ho.conditional=Ho.parse=void 0;var e=function r(a,o){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:s;if(Array.isArray(o))o.forEach(function(f){return r(a,f,s,c)});else if(typeof o=="function")o(a,s,c,r);else{var m=Object.keys(o)[0];Array.isArray(o[m])?(c[m]={},r(a,o[m],s,c[m])):c[m]=o[m](a,s,c,r)}return s};Ho.parse=e;var n=function(a,o){return function(s,c,m,f){o(s,c,m)&&f(s,a,c,m)}};Ho.conditional=n;var t=function(a,o){return function(s,c,m,f){for(var v=[],y=s.pos;o(s,c,m);){var E={};if(f(s,a,c,E),s.pos===y)break;y=s.pos,v.push(E)}return v}};return Ho.loop=t,Ho}var qr={},w3;function t_(){if(w3)return qr;w3=1,Object.defineProperty(qr,"__esModule",{value:!0}),qr.readBits=qr.readArray=qr.readUnsigned=qr.readString=qr.peekBytes=qr.readBytes=qr.peekByte=qr.readByte=qr.buildStream=void 0;var e=function(y){return{data:y,pos:0}};qr.buildStream=e;var n=function(){return function(y){return y.data[y.pos++]}};qr.readByte=n;var t=function(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(E){return E.data[E.pos+y]}};qr.peekByte=t;var r=function(y){return function(E){return E.data.subarray(E.pos,E.pos+=y)}};qr.readBytes=r;var a=function(y){return function(E){return E.data.subarray(E.pos,E.pos+y)}};qr.peekBytes=a;var o=function(y){return function(E){return Array.from(r(y)(E)).map(function(w){return String.fromCharCode(w)}).join("")}};qr.readString=o;var s=function(y){return function(E){var w=r(2)(E);return y?(w[1]<<8)+w[0]:(w[0]<<8)+w[1]}};qr.readUnsigned=s;var c=function(y,E){return function(w,S,x){for(var _=typeof E=="function"?E(w,S,x):E,b=r(y),g=new Array(_),h=0;h<_;h++)g[h]=b(w);return g}};qr.readArray=c;var m=function(y,E,w){for(var S=0,x=0;x<w;x++)S+=y[E+x]&&Math.pow(2,w-x-1);return S},f=function(y){return function(E){for(var w=n()(E),S=new Array(8),x=0;x<8;x++)S[7-x]=!!(w&1<<x);return Object.keys(y).reduce(function(_,b){var g=y[b];return g.length?_[b]=m(S,g.index,g.length):_[b]=S[g.index],_},{})}};return qr.readBits=f,qr}var _3;function sP(){return _3||(_3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=e_(),t=t_(),r={blocks:function(E){for(var w=0,S=[],x=E.data.length,_=0,b=(0,t.readByte)()(E);b!==w&&b;b=(0,t.readByte)()(E)){if(E.pos+b>=x){var g=x-E.pos;S.push((0,t.readBytes)(g)(E)),_+=g;break}S.push((0,t.readBytes)(b)(E)),_+=b}for(var h=new Uint8Array(_),d=0,P=0;P<S.length;P++)h.set(S[P],d),d+=S[P].length;return h}},a=(0,n.conditional)({gce:[{codes:(0,t.readBytes)(2)},{byteSize:(0,t.readByte)()},{extras:(0,t.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,t.readUnsigned)(!0)},{transparentColorIndex:(0,t.readByte)()},{terminator:(0,t.readByte)()}]},function(y){var E=(0,t.peekBytes)(2)(y);return E[0]===33&&E[1]===249}),o=(0,n.conditional)({image:[{code:(0,t.readByte)()},{descriptor:[{left:(0,t.readUnsigned)(!0)},{top:(0,t.readUnsigned)(!0)},{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{lct:(0,t.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,n.conditional)({lct:(0,t.readArray)(3,function(y,E,w){return Math.pow(2,w.descriptor.lct.size+1)})},function(y,E,w){return w.descriptor.lct.exists}),{data:[{minCodeSize:(0,t.readByte)()},r]}]},function(y){return(0,t.peekByte)()(y)===44}),s=(0,n.conditional)({text:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{preData:function(E,w,S){return(0,t.readBytes)(S.text.blockSize)(E)}},r]},function(y){var E=(0,t.peekBytes)(2)(y);return E[0]===33&&E[1]===1}),c=(0,n.conditional)({application:[{codes:(0,t.readBytes)(2)},{blockSize:(0,t.readByte)()},{id:function(E,w,S){return(0,t.readString)(S.blockSize)(E)}},r]},function(y){var E=(0,t.peekBytes)(2)(y);return E[0]===33&&E[1]===255}),m=(0,n.conditional)({comment:[{codes:(0,t.readBytes)(2)},r]},function(y){var E=(0,t.peekBytes)(2)(y);return E[0]===33&&E[1]===254}),f=[{header:[{signature:(0,t.readString)(3)},{version:(0,t.readString)(3)}]},{lsd:[{width:(0,t.readUnsigned)(!0)},{height:(0,t.readUnsigned)(!0)},{gct:(0,t.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,t.readByte)()},{pixelAspectRatio:(0,t.readByte)()}]},(0,n.conditional)({gct:(0,t.readArray)(3,function(y,E){return Math.pow(2,E.lsd.gct.size+1)})},function(y,E){return E.lsd.gct.exists}),{frames:(0,n.loop)([a,c,m,o,s],function(y){var E=(0,t.peekByte)()(y);return E===33||E===44})}],v=f;e.default=v}(m1)),m1}var yd={},S3;function uP(){if(S3)return yd;S3=1,Object.defineProperty(yd,"__esModule",{value:!0}),yd.deinterlace=void 0;var e=function(t,r){for(var a=new Array(t.length),o=t.length/r,s=function(w,S){var x=t.slice(S*r,(S+1)*r);a.splice.apply(a,[w*r,r].concat(x))},c=[0,4,2,1],m=[8,8,4,2],f=0,v=0;v<4;v++)for(var y=c[v];y<o;y+=m[v])s(y,f),f++;return a};return yd.deinterlace=e,yd}var bd={},E3;function cP(){if(E3)return bd;E3=1,Object.defineProperty(bd,"__esModule",{value:!0}),bd.lzw=void 0;var e=function(t,r,a){var o=4096,s=-1,c=a,m,f,v,y,E,w,S,T,x,_,M,b,I,F,O,k,g=new Array(a),h=new Array(o),d=new Array(o),P=new Array(o+1);for(b=t,f=1<<b,E=f+1,m=f+2,S=s,y=b+1,v=(1<<y)-1,x=0;x<f;x++)h[x]=0,d[x]=x;var M,T,I,F,k,O;for(M=T=I=F=k=O=0,_=0;_<c;){if(F===0){if(T<y){M+=r[O]<<T,T+=8,O++;continue}if(x=M&v,M>>=y,T-=y,x>m||x==E)break;if(x==f){y=b+1,v=(1<<y)-1,m=f+2,S=s;continue}if(S==s){P[F++]=d[x],S=x,I=x;continue}for(w=x,x==m&&(P[F++]=I,x=S);x>f;)P[F++]=d[x],x=h[x];I=d[x]&255,P[F++]=I,m<o&&(h[m]=S,d[m]=I,m++,(m&v)===0&&m<o&&(y++,v+=m)),S=w}F--,g[k++]=P[F],_++}for(_=k;_<c;_++)g[_]=0;return g};return bd.lzw=e,bd}var x3;function fP(){if(x3)return qo;x3=1,Object.defineProperty(qo,"__esModule",{value:!0}),qo.decompressFrames=qo.decompressFrame=qo.parseGIF=void 0;var e=o(sP()),n=e_(),t=t_(),r=uP(),a=cP();function o(v){return v&&v.__esModule?v:{default:v}}var s=function(y){var E=new Uint8Array(y);return(0,n.parse)((0,t.buildStream)(E),e.default)};qo.parseGIF=s;var c=function(y){for(var E=y.pixels.length,w=new Uint8ClampedArray(E*4),S=0;S<E;S++){var x=S*4,_=y.pixels[S],b=y.colorTable[_]||[0,0,0];w[x]=b[0],w[x+1]=b[1],w[x+2]=b[2],w[x+3]=_!==y.transparentIndex?255:0}return w},m=function(y,E,w){if(!y.image){console.warn("gif frame does not have associated image.");return}var S=y.image,x=S.descriptor.width*S.descriptor.height,_=(0,a.lzw)(S.data.minCodeSize,S.data.blocks,x);S.descriptor.lct.interlaced&&(_=(0,r.deinterlace)(_,S.descriptor.width));var b={pixels:_,dims:{top:y.image.descriptor.top,left:y.image.descriptor.left,width:y.image.descriptor.width,height:y.image.descriptor.height}};return S.descriptor.lct&&S.descriptor.lct.exists?b.colorTable=S.lct:b.colorTable=E,y.gce&&(b.delay=(y.gce.delay||10)*10,b.disposalType=y.gce.extras.disposal,y.gce.extras.transparentColorGiven&&(b.transparentIndex=y.gce.transparentColorIndex)),w&&(b.patch=c(b)),b};qo.decompressFrame=m;var f=function(y,E){return y.frames.filter(function(w){return w.image}).map(function(w){return m(w,y.gct,E)})};return qo.decompressFrames=f,qo}var O3;function dP(){return O3||(O3=1,function(e){var n=md&&md.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(e,"__esModule",{value:!0}),e.GifElement=void 0;const t=n(Or()),r=Ri,a=Xi,o=oo,s=n(Mi()),c=fP(),m=Xs(),f=J4(),v=Wv(),y=$d(),E=Ys(),w=es();function S(b,g,h){const d=g.getContext("2d"),P=h.getContext("2d");if(!d||!P)return;b.disposalType===2&&d.clearRect(0,0,g.width,g.height),h.width=b.width,h.height=b.height;const M=P.createImageData(b.width,b.height);M.data.set(b.patch),P.putImageData(M,0,0),d.drawImage(h,b.left,b.top)}const x=(0,r.observer)(({element:b})=>{const g=Math.min(30,b.width/4,b.height/4),h=t.default.useRef(null);return t.default.useEffect(()=>{const d=h.current;if(!d)return;const P=new s.default.Animation(M=>{d.rotate(((M==null?void 0:M.timeDiff)||0)/2)},d.getLayer());return P.start(),()=>{P.stop()}},[]),t.default.createElement(o.Group,{x:b.a.x,y:b.a.y,rotation:b.a.rotation,listening:!1,opacity:b.a.opacity,hideInExport:!b.showInExport},t.default.createElement(o.Rect,{width:b.width,height:b.height,fill:"rgba(124, 173, 212, 0.8)"}),t.default.createElement(o.Arc,{ref:h,x:b.width/2,y:b.height/2,fill:"white",outerRadius:Math.abs(g),innerRadius:Math.max(1,g-5),angle:270}))}),_=(0,r.observer)(({element:b})=>{const g=Math.max(10,Math.min(30,b.width/22));return t.default.createElement(o.Group,{x:b.a.x,y:b.a.y,rotation:b.a.rotation,listening:!1,opacity:b.a.opacity,hideInExport:!b.showInExport},t.default.createElement(o.Rect,{width:b.width,height:b.height,fill:"rgba(223, 102, 102, 0.8)"}),t.default.createElement(o.Text,{text:"Cannot load the GIF...",fontSize:g,width:b.width,height:b.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});e.GifElement=(0,r.observer)(({element:b,store:g})=>{var h;const[d,P]=t.default.useState(!1),[M,T]=t.default.useState(!1),I=g.selectedShapes.indexOf(b)>=0,F=t.default.useRef(null),k=t.default.useRef(),[O,N,A,R]=function(re){const[ne,ae]=t.default.useState([]),[ue,fe]=t.default.useState(0),[pe,ye]=t.default.useState("loading"),[we,je]=t.default.useState({width:0,height:0});return t.default.useEffect(()=>{(async()=>{try{const Te=await fetch(re),se=await Te.arrayBuffer(),_e=(0,c.parseGIF)(se),he=(0,c.decompressFrames)(_e,!0),xe=_e.lsd.width,oe=_e.lsd.height;je({width:xe,height:oe});const ve=he.map(ke=>({patch:new Uint8ClampedArray(ke.patch),delay:ke.delay,width:ke.dims.width,height:ke.dims.height,left:ke.dims.left,top:ke.dims.top,disposalType:ke.disposalType})),de=ve.reduce((ke,Be)=>ke+Be.delay,0);ae(ve),fe(de),ye("loaded")}catch(Te){console.error("Failed to load GIF:",Te),ye("failed")}})()},[re]),[ne,ue,we,pe]}(b.src);(0,v.useImageLoader)(R,b.src,b.id),t.default.useEffect(()=>(k.current=document.createElement("canvas"),()=>{k.current&&s.default.Util.releaseCanvas(k.current)}),[]),t.default.useEffect(()=>{if(R==="loaded"&&k.current&&(k.current.width=A.width,k.current.height=A.height,O.length>0)){const re=k.current.getContext("2d");if(re){re.clearRect(0,0,A.width,A.height);const ne=document.createElement("canvas");S(O[0],k.current,ne)}}},[A,R,O]),t.default.useEffect(()=>{if(!O.length||!k.current)return;const re=k.current;re.width=A.width,re.height=A.height;const ne=document.createElement("canvas"),ae=re.getContext("2d");ae&&ae.clearRect(0,0,re.width,re.height);let ue=-1;S(O[0],re,ne),Y(),ue=0;const fe=pe=>{const ye=(we=>{const je=we%N;let Te=0;for(let se=0;se<O.length;se++)if(Te+=O[se].delay,Te>je)return se;return 0})(pe);ye!==ue&&(S(O[ye],re,ne),Y(),F.current.getLayer().draw(),ue=ye)};if(g.isPlaying||b.page._exportingOrRendering)return(0,a.autorun)(()=>{fe(g.currentTime-b.page.startTime)});{const pe=window.setInterval(()=>{fe(g.currentTime||performance.now())},16);return()=>{clearInterval(pe)}}},[g.isPlaying,O,N,b.page._exportingOrRendering]),t.default.useEffect(()=>{N&&g.history.ignore(()=>{b.set({duration:N})})},[N]);let{cropX:L,cropY:V,cropWidth:G,cropHeight:W}=b;R!=="loaded"&&(L=V=0,G=W=1);const X={x:A.width*L,y:A.height*V,width:A.width*G,height:A.height*W},q=(h=b.cornerRadius)!==null&&h!==void 0?h:0,[z,Y]=(0,f.useCornerRadiusAndCrop)(b,k.current,X,g._elementsPixelRatio,q,d||b._cropModeEnabled);t.default.useLayoutEffect(()=>{if(!d&&!b._cropModeEnabled&&F.current)return(0,y.applyFilter)(F.current,b),(0,a.autorun)(()=>{(0,y.applyFilter)(F.current,b)},{delay:100})},[k.current,d,G,W,b._cropModeEnabled,A.width,A.height]);const U=R==="loading",ee=R==="failed",te=U||ee?0:b.a.opacity;(0,E.useFadeIn)(F,te);const Q=b.selectable||g.role==="admin",Z=(0,w.isTouchDevice)();return t.default.createElement(t.default.Fragment,null,U&&t.default.createElement(x,{element:b}),ee&&t.default.createElement(_,{element:b}),t.default.createElement(o.Image,{ref:F,name:"element",id:b.id,image:z,x:b.a.x,y:b.a.y,width:b.a.width||1,height:b.a.height||1,rotation:b.a.rotation,opacity:te,shadowEnabled:b.shadowEnabled,shadowBlur:b.shadowBlur,shadowOffsetX:b.shadowOffsetX,shadowOffsetY:b.shadowOffsetY,shadowColor:b.shadowColor,shadowOpacity:b.shadowOpacity,customCrop:X,listening:Q,draggable:Z?b.draggable&&I:b.draggable,preventDefault:!Z||I,hideInExport:!b.showInExport,onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),onDragMove:re=>{b.set({x:re.target.x(),y:re.target.y()})},onDragEnd:re=>{b.set({x:re.target.x(),y:re.target.y()})},onTransformStart:()=>P(!0),onTransform:re=>{const ne=re.currentTarget,ae=Math.abs(ne.scaleX()-1)<1e-7?1:ne.scaleX(),ue=Math.abs(ne.scaleY()-1)<1e-7?1:ne.scaleY();ne.scaleX(1),ne.scaleY(1),b.set({x:ne.x(),y:ne.y(),width:ne.width()*ae,height:ne.height()*ue,rotation:ne.rotation()})},onTransformEnd:()=>P(!1)}),t.default.createElement(o.Rect,{x:b.a.x,y:b.a.y,width:Math.max(b.a.width-b.borderSize,0),height:Math.max(b.a.height-b.borderSize,0),opacity:te,offsetX:-b.borderSize/2,offsetY:-b.borderSize/2,stroke:b.borderColor,strokeWidth:b.borderSize,listening:!1,visible:!!b.borderSize,rotation:b.rotation,cornerRadius:Math.max(0,q-b.borderSize),hideInExport:!b.showInExport}),(M||I)&&t.default.createElement(m.Highlighter,{element:b}))})}(md)),md}var P3;function hP(){return P3||(P3=1,function(e){var n=od&&od.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeComponent=function(_,b){S[_]=b};const t=n(Or()),r=Ri,a=D4(),o=Wv(),s=aP(),c=oP(),m=J4(),f=lP(),v=dP(),y=oo,E=Jl(),w=(0,r.observer)(_=>{const{element:b,store:g}=_,{children:h}=b,d=b.selectable||g.role==="admin";return t.default.createElement(y.Group,{opacity:b.opacity,listening:d,hideInExport:!b.showInExport},h.map(P=>t.default.createElement(x,Object.assign({},_,{key:P.id,store:g,element:P}))))}),S={text:a.TextElement,image:o.ImageElement,svg:o.ImageElement,line:c.LineElement,video:m.VideoElement,figure:f.FigureElement,group:w,gif:v.GifElement},x=(0,r.observer)(_=>{let b=S[_.element.type];return _.element.type==="text"&&E.flags.htmlRenderEnabled&&(b=s.HTMLElement),_.element.visible?b?t.default.createElement(b,Object.assign({},_)):(console.error("Can not find component for "+_.element.type),null):null});e.default=x}(od)),od}var y1={},C3;function pP(){return C3||(C3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getCrop=function(n,t,r="scale"){const a=t.width/t.height;let o,s;a>=n.width/n.height?(o=n.width,s=n.width/a):(o=n.height*a,s=n.height);let c=0,m=0;return r==="left-top"?(c=0,m=0):r==="left-middle"?(c=0,m=(n.height-s)/2):r==="left-bottom"?(c=0,m=n.height-s):r==="center-top"?(c=(n.width-o)/2,m=0):r==="center-middle"?(c=(n.width-o)/2,m=(n.height-s)/2):r==="center-bottom"?(c=(n.width-o)/2,m=n.height-s):r==="right-top"?(c=n.width-o,m=0):r==="right-middle"?(c=n.width-o,m=(n.height-s)/2):r==="right-bottom"?(c=n.width-o,m=n.height-s):r==="scale"?(c=0,m=0,o=n.width,s=n.height):console.error(new Error("Unknown clip position property - "+r)),{cropX:c,cropY:m,cropWidth:o,cropHeight:s}}}(y1)),y1}var Go={},b1={},k3;function gP(){return k3||(k3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.setAPI=e.iconscoutDownload=e.iconscoutList=e.svgapiDownload=e.svgapiList=e.unsplashDownload=e.unsplashList=e.textTemplateList=e.templateList=e.removeBackground=e.polotnoShapesList=e.getGoogleFontImage=e.getGoogleFontsListAPI=e.URLS=e.getAPI=e.API=e.URL=void 0;const n=Jv();e.URL="https://api.polotno.com",e.API=`${e.URL}/api`,e.getAPI=()=>e.URL+"/api";const t={},r=(o,s)=>{t[o]||(t[o]=!0,console.error(s))},a=`API for iconscout is provided as a demonstration.
262
- For production usage you have to use your own API endpoint.
263
- https://iconscout.com/developers, https://iconscout.com/legal/api-license-development-agreement
264
- https://polotno.com/docs/server-api`;e.URLS={unsplashList:({query:o,page:s=1})=>`${(0,e.getAPI)()}/get-unsplash?query=${o}&per_page=20&page=${s}&KEY=${(0,n.getKey)()}`,unsplashDownload:o=>`${(0,e.getAPI)()}/download-unsplash?id=${o}&KEY=${(0,n.getKey)()}`,svgapiList:({query:o,page:s=0})=>`${(0,e.getAPI)()}/get-svgapi?query=${o}&page=${s}&per_page=20&KEY=${(0,n.getKey)()}`,svgapiDownload:o=>`${(0,e.getAPI)()}/download-svgapi?path=${o}&KEY=${(0,n.getKey)()}`,iconscoutList:({query:o,page:s=1})=>(r("iconscout",a),`${(0,e.getAPI)()}/get-iconscout?query=${o}&page=${s}&KEY=${(0,n.getKey)()}`),iconscoutDownload:o=>(r("iconscout",a),`${(0,e.getAPI)()}/download-iconscout?uuid=${o}&KEY=${(0,n.getKey)()}`),nounProjectList:({query:o,page:s=1})=>`${(0,e.getAPI)()}/get-nounproject?query=${o}&page=${s}&KEY=${(0,n.getKey)()}`,nounProjectDownload:o=>`${(0,e.getAPI)()}/download-nounproject?id=${o}&KEY=${(0,n.getKey)()}`,templateList:({query:o,page:s=1,sizeQuery:c})=>`${(0,e.getAPI)()}/get-templates?${c}&query=${o}&per_page=30&page=${s}&KEY=${(0,n.getKey)()}`,googleFontsList:()=>`${(0,e.getAPI)()}/get-google-fonts?KEY=${(0,n.getKey)()}`,googleFontImage:o=>{return`${e.URL}/google-fonts-previews/black/${s=o,s.replace(new RegExp(" ","g"),"-")}.png`;var s},textTemplateList:()=>`${(0,e.getAPI)()}/get-text-templates?KEY=${(0,n.getKey)()}`,removeBackground:()=>`${(0,e.getAPI)()}/remove-image-background?KEY=${(0,n.getKey)()}`,aiText:()=>`${(0,e.getAPI)()}/ai/text?KEY=${(0,n.getKey)()}`},e.getGoogleFontsListAPI=()=>e.URLS.googleFontsList(),e.getGoogleFontImage=o=>e.URLS.googleFontImage(o),e.polotnoShapesList=()=>`${(0,e.getAPI)()}/get-basic-shapes?KEY=${(0,n.getKey)()}`,e.removeBackground=()=>e.URLS.removeBackground(),e.templateList=o=>e.URLS.templateList(o),e.textTemplateList=()=>e.URLS.textTemplateList(),e.unsplashList=o=>e.URLS.unsplashList(o),e.unsplashDownload=o=>e.URLS.unsplashDownload(o),e.svgapiList=o=>e.URLS.svgapiList(o),e.svgapiDownload=o=>e.URLS.svgapiDownload(o),e.iconscoutList=o=>e.URLS.iconscoutList(o),e.iconscoutDownload=o=>e.URLS.iconscoutDownload(o),e.setAPI=(o,s)=>{e.URLS[o]=s}}(b1)),b1}var A3;function Jv(){return A3||(A3=1,function(e){var n,t=Go&&Go.__createBinding||(Object.create?function(I,F,k,O){O===void 0&&(O=k);var N=Object.getOwnPropertyDescriptor(F,k);N&&!("get"in N?!F.__esModule:N.writable||N.configurable)||(N={enumerable:!0,get:function(){return F[k]}}),Object.defineProperty(I,O,N)}:function(I,F,k,O){O===void 0&&(O=k),I[O]=F[k]}),r=Go&&Go.__setModuleDefault||(Object.create?function(I,F){Object.defineProperty(I,"default",{enumerable:!0,value:F})}:function(I,F){I.default=F}),a=Go&&Go.__importStar||(n=function(I){return n=Object.getOwnPropertyNames||function(F){var k=[];for(var O in F)Object.prototype.hasOwnProperty.call(F,O)&&(k[k.length]=O);return k},n(I)},function(I){if(I&&I.__esModule)return I;var F={};if(I!=null)for(var k=n(I),O=0;O<k.length;O++)k[O]!=="default"&&t(F,I,k[O]);return r(F,I),F});Object.defineProperty(e,"__esModule",{value:!0}),e.__=e.getKey=e.isCreditVisible=e.___=void 0,e.isKeyPaid=T,e.validateKey=async function(I,F){y=I,await T(I)&&!F||v()};const o=a(Xi),s=gP(),c=Jl(),m=o.observable({value:!1}),f=o.observable({value:"v1"});e.___=()=>f.value,e.isCreditVisible=()=>m.value;const v=o.action(()=>{m.value=!0});let y="";e.getKey=()=>y||"";const E=5,w=3e3,S="Polotno API is initialized without API key. It may lead to unexpected behavior and stop working. Please create API key here: https://polotno.com/cabinet",x="Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet",_="Can not validate Polotno API key. Please report to anton@polotno.com immediately.",b="%cPolotno Free Version. Development or non-commercial usage only. https://polotno.com/";let g=window.location.origin;const h=navigator.userAgent.indexOf("Headless")>-1,d=navigator.userAgent.indexOf("Electron")>-1;g==="file://"&&h&&(g="headless"),g==="file://"&&d&&(g="electron");const P=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${g}" here: https://polotno.com/cabinet`;let M=fetch;async function T(I){for(let F=0;F<E;F++)try{const k=await M((0,s.getAPI)()+"/validate-key",{method:"POST",body:JSON.stringify({key:I,site:location.host,skdVersion:"2.21.5"})});if(f.value=k.headers.get("x-api-version"),!I)return console.warn(S),!1;if(k.status!==200){await new Promise(N=>setTimeout(N,w));continue}const O=await k.json();return O.is_valid||console.warn(x),O.is_paid||console.log(b,"background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),O.is_domain_valid||console.log(P,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),(0,c.useRemoveBackground)(O.remove_background_enabled),O.is_paid||!1}catch{await new Promise(O=>setTimeout(O,w))}return console.error(_),!0}e.__=I=>{M=I}}(Go)),Go}var w1={},T3;function em(){return T3||(T3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pxToUnitString=e.unitToPx=e.pxToUnitRounded=e.pxToUnit=void 0,e.pxToUnit=({px:n,unit:t="px",dpi:r})=>{switch(t){case"pt":default:return n;case"mm":return n/(r/25.4);case"cm":return n/(r/2.54);case"in":return n/r}},e.pxToUnitRounded=({px:n,precious:t=2,dpi:r=72,unit:a="px"})=>parseFloat((0,e.pxToUnit)({px:n,dpi:r,unit:a}).toFixed(t)),e.unitToPx=({unitVal:n,dpi:t,unit:r})=>n/(0,e.pxToUnit)({px:1,unit:r,dpi:t}),e.pxToUnitString=n=>{const t=parseFloat((0,e.pxToUnit)(n).toFixed(1));switch(n.unit){case"pt":return`${Math.round(t)}pt`;case"mm":return`${t}mm`;case"cm":return`${t}cm`;case"in":return`${t}in`;default:return`${Math.round(t)}px`}}}(w1)),w1}var R3;function vP(){return R3||(R3=1,function(e){var n=Ns&&Ns.__rest||function(U,ee){var te={};for(var Q in U)Object.prototype.hasOwnProperty.call(U,Q)&&ee.indexOf(Q)<0&&(te[Q]=U[Q]);if(U!=null&&typeof Object.getOwnPropertySymbols=="function"){var Z=0;for(Q=Object.getOwnPropertySymbols(U);Z<Q.length;Z++)ee.indexOf(Q[Z])<0&&Object.prototype.propertyIsEnumerable.call(U,Q[Z])&&(te[Q[Z]]=U[Q[Z]])}return te},t=Ns&&Ns.__importDefault||function(U){return U&&U.__esModule?U:{default:U}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerNextDomDrop=e.useContextMenu=e.setTransformerStyle=void 0,e.registerTransformerAttrs=function(U,ee){k[U]=k[U]||ee,Object.assign(k[U],ee)};const r=t(Or()),a=Ri,o=Xi,s=oo,c=t(Up()),m=t(Mi()),f=t(hP()),v=Q4(),y=Wv(),E=pP(),w=Jv(),S=Ec(),x=em(),_=Jl(),b=es(),g=Gd(),h=Iv(),d=wc,P=m.default.DD._drag;window.removeEventListener("mousemove",P),m.default.DD._drag=function(U){(0,o.runInAction)(()=>{P.call(this,U)})},window.addEventListener("mousemove",m.default.DD._drag);const M=new m.default.Group,T=20;M.add(new m.default.Rect({width:T,height:T,fill:"white"})),M.add(new m.default.Path({scaleX:T/24,scaleY:T/24,data:"M4.98313549,11.0001422 C5.49589839,10.9914935 5.92501998,11.3703506 5.99116425,11.8666444 L5.99985778,11.9831355 L6.00348884,12.2068855 C6.11245031,15.4321748 8.76323537,17.9999971 11.9999971,17.9999971 C12.1869612,17.9999971 12.3726725,17.9914753 12.5567465,17.9745765 L12.2928932,17.7071068 C11.9023689,17.3165825 11.9023689,16.6834175 12.2928932,16.2928932 C12.6834175,15.9023689 13.3165825,15.9023689 13.7071068,16.2928932 L15.7071068,18.2928932 C16.0976311,18.6834175 16.0976311,19.3165825 15.7071068,19.7071068 L13.7071068,21.7071068 C13.3165825,22.0976311 12.6834175,22.0976311 12.2928932,21.7071068 C11.9023689,21.3165825 11.9023689,20.6834175 12.2928932,20.2928932 L12.6111505,19.9769552 C12.4086045,19.9922816 12.2047796,19.9999971 11.9999971,19.9999971 C7.7687005,19.9999971 4.28886152,16.7094374 4.01666425,12.5105203 L4.00420123,12.2575143 L4.00014222,12.0168645 C3.9908282,11.4646583 4.43092928,11.0094562 4.98313549,11.0001422 Z M11.7071068,2.29289322 C12.0675907,2.65337718 12.0953203,3.22060824 11.7902954,3.61289944 L11.7071068,3.70710678 L11.3891629,4.0230186 C11.5916051,4.00770767 11.7953244,4 12,4 C16.418278,4 20,7.581722 20,12 C20,12.5522847 19.5522847,13 19,13 C18.4477153,13 18,12.5522847 18,12 C18,8.6862915 15.3137085,6 12,6 C11.8129339,6 11.6271216,6.00853145 11.4429483,6.02544919 L11.7071068,6.29289322 C12.0976311,6.68341751 12.0976311,7.31658249 11.7071068,7.70710678 C11.3466228,8.06759074 10.7793918,8.09532028 10.3871006,7.79029539 L10.2928932,7.70710678 L8.29289322,5.70710678 C7.93240926,5.34662282 7.90467972,4.77939176 8.20970461,4.38710056 L8.29289322,4.29289322 L10.2928932,2.29289322 C10.6834175,1.90236893 11.3165825,1.90236893 11.7071068,2.29289322 Z",fill:"black"}));const I=M.toCanvas({pixelRatio:2,width:T,height:T}),F={enabledAnchors:["top-left","top-center","top-right","middle-left","bottom-left","bottom-right","bottom-center","middle-right"],borderEnabled:!0,rotateEnabled:!0,rotationSnaps:[0,45,90,135,180,225,270,315],ignoreStroke:!0,flipEnabled:!1,anchorStrokeWidth:2,borderStrokeWidth:2,rotateAnchorOffset:30,anchorStyleFunc:U=>{U.hasName("rotater")&&U.setAttrs({width:20,height:20,cornerRadius:20/2,offsetX:20/2,offsetY:20/2,fillPatternImage:I,fillPatternScaleX:20/T/2,fillPatternScaleY:20/T/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}};e.setTransformerStyle=U=>{Object.assign(F,U)};const k={text:{enabledAnchors:["top-left","top-right","middle-left","bottom-left","bottom-right","middle-right"]},svg:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},gif:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},line:{enabledAnchors:[],borderEnabled:!1,rotateEnabled:!1},image:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},many:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},group:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]}},O=U=>r.default.createElement(s.Rect,Object.assign({},U,{preventDefault:!1})),N=U=>{var{url:ee}=U,te=n(U,["url"]);const[Q,Z]=(0,c.default)(ee,"anonymous"),re=Q?(0,E.getCrop)(Q,{width:te.width,height:te.height},"center-middle"):{};return(0,y.useImageLoader)(Z,ee,"page background"),r.default.createElement(s.Image,Object.assign({image:Q},te,re))},A=U=>{const ee=(0,g.useColor)({fill:U.fill,a:{width:U.width,height:U.height}});return r.default.createElement(s.Rect,Object.assign({},U,ee))},R=U=>{const{background:ee,scale:te,borderColor:Q}=U,Z=n(U,["background","scale","borderColor"]),re=r.default.useMemo(()=>!!m.default.Util.colorToRGBA(ee)||(0,h.isGradient)(ee),[ee]),ne=r.default.useMemo(()=>{const ae=document.createElement("canvas"),ue=30;ae.width=60,ae.height=60;const fe=ae.getContext("2d");return fe&&(fe.fillStyle="black",fe.fillRect(ue,0,ue,ue),fe.fillRect(0,ue,ue,ue)),ae},[]);return r.default.createElement(r.default.Fragment,null,r.default.createElement(s.Rect,Object.assign({fillPatternImage:ne},Z,{opacity:.1,hideInExport:!0})),re?r.default.createElement(A,Object.assign({fill:ee},Z)):r.default.createElement(N,Object.assign({url:ee},Z)))},L=(0,a.observer)(({selection:U})=>U.visible?r.default.createElement(s.Rect,{name:"selection",x:Math.min(U.x1,U.x2),y:Math.min(U.y1,U.y2),width:Math.abs(U.x1-U.x2),height:Math.abs(U.y1-U.y2),fill:"rgba(0, 161, 255, 0.3)"}):null),V=(0,a.observer)(({x:U,y:ee,width:te,height:Q,rotation:Z,anchor:re,store:ne})=>{const ae=(0,S.getClientRect)({x:U,y:ee,width:te,height:Q,rotation:m.default.Util.radToDeg(Z)});if(re===void 0)return null;const ue=(Q/2+70)*Math.cos(Z-Math.PI/2),fe=(Q/2+70)*Math.sin(Z-Math.PI/2),pe=(0,x.pxToUnitRounded)({unit:ne.unit,dpi:ne.dpi,px:te/ne.scale,precious:ne.unit==="px"?0:1})+" x "+(0,x.pxToUnitRounded)({unit:ne.unit,dpi:ne.dpi,px:Q/ne.scale,precious:ne.unit==="px"?0:1})+(ne.unit==="px"?"":" "+ne.unit);return r.default.createElement(r.default.Fragment,null,r.default.createElement(s.Label,{x:(ae.minX+ae.maxX)/2+ue,y:(ae.minY+ae.maxY)/2+fe,offsetX:14,offsetY:14,visible:re==="rotater"},r.default.createElement(s.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)"}),r.default.createElement(s.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:Math.round(m.default.Util.radToDeg(Z)).toString()+"°"})),r.default.createElement(s.Label,{x:(ae.minX+ae.maxX)/2,y:ae.maxY+20,visible:re!=="rotater"},r.default.createElement(s.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"up",pointerHeight:0,pointerWidth:0}),r.default.createElement(s.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:pe})))}),G=(0,a.observer)(({elements:U,store:ee})=>{const te=U.filter(Z=>Z.alwaysOnTop),Q=U.filter(Z=>!Z.alwaysOnTop).concat(te);return r.default.createElement(r.default.Fragment,null,Q.map(Z=>r.default.createElement(f.default,{key:Z.id,store:ee,element:Z,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))});e.useContextMenu=({store:U})=>{const[ee,te]=r.default.useState(!1),[Q,Z]=r.default.useState({x:0,y:0});return{open:r.default.useCallback(ne=>{te(!0),Z(ne)},[]),close:r.default.useCallback(()=>{te(!1)},[]),props:{isOpen:ee,offset:Q,setIsOpen:te}}};let W=null;e.registerNextDomDrop=U=>{W=U};const X=atob("UG9sb3RubyBmcmVlIGxpY2Vuc2UgbGltaXRhdGlvbiBleGNlZWRlZCAtIFBsZWFzZSB1cGdyYWRlIHlvdXIgYWNjb3VudC4="),q=atob("cmVk"),z=atob("djAuOS4y"),Y=U=>r.default.createElement(r.default.Fragment,null,r.default.createElement(s.Label,{fill:q,height:200},r.default.createElement(s.Tag,{fill:q}),r.default.createElement(s.Text,Object.assign({},U,{fill:"white",text:X,height:void 0,padding:10,fontSize:20}))));e.default=(0,a.observer)(({store:U,page:ee,width:te,height:Q,pageControlsEnabled:Z,backColor:re,pageBorderColor:ne,activePageBorderColor:ae,components:ue,bleedColor:fe,altCloneEnabled:pe,viewportSize:ye})=>{const we=U.bleedVisible?ee.bleed:0,je=ee.computedWidth+2*we,Te=ee.computedHeight+2*we,se=(te-je*U.scale)/2,_e=(Q-Te*U.scale)/2,he=r.default.useRef(null),xe=r.default.useRef(null),oe=r.default.useRef(null),ve=Z==null||Z,[de,ke]=r.default.useState(null),[Be,Qe]=r.default.useState({}),Ke=(0,e.useContextMenu)({store:U}),St=U.selectedElements.find(ze=>ze._cropModeEnabled),Ue=U.selectedShapes.filter(ze=>!ze.resizable).length>0,rt=U.selectedShapes.filter(ze=>!ze.draggable).length>0,gt=U.selectedElements.filter(ze=>!ze.visible).length>0;r.default.useLayoutEffect(()=>{var ze,at,Pe;if(!he.current)return;const me=he.current.getStage(),He=U.selectedShapes.map(Ye=>Ye._cropModeEnabled?null:me.findOne("#"+Ye.id)).filter(Ye=>Ye),Me=U.selectedElements.length===1&&((ze=U.selectedElements[0])===null||ze===void 0?void 0:ze.type)||"many";k[Me]?(he.current.setAttrs(Object.assign(Object.assign({},F),k[Me])),Me!=="svg"&&Me!=="image"&&Me!=="gif"||U.selectedElements[0].keepRatio||he.current.setAttrs({enabledAnchors:F.enabledAnchors}),Me==="text"&&_.flags.textVerticalResizeEnabled&&he.current.setAttrs({enabledAnchors:(at=k.text.enabledAnchors)===null||at===void 0?void 0:at.concat(["bottom-center"])})):he.current.setAttrs(F),Ue&&he.current.enabledAnchors([]),rt&&he.current.rotateEnabled(!1),He.find(Ye=>Ye==null?void 0:Ye.isDragging())&&He.forEach(Ye=>{Ye.isDragging()||Ye==null||Ye.startDrag()}),he.current.nodes(He),(Pe=he.current.getLayer())===null||Pe===void 0||Pe.batchDraw()},[U.selectedShapes,St,Ue,gt,rt]);const mt=(0,a.useLocalObservable)(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),kt=r.default.useRef(!1),jt=(0,b.isTouchDevice)(),Oe=(0,o.action)(ze=>{var at,Pe,me,He;if(jt)return;kt.current=!1;const Me=ze.target.findAncestor(".elements-container"),Ye=ze.target.findAncestor("Transformer"),et=ze.target.findAncestor(".page-abs-container");if(Me||Ye||et)return;const ut=(at=ze.target.getStage())===null||at===void 0?void 0:at.getPointerPosition();ut.x-=(Pe=ze.target.getStage())===null||Pe===void 0?void 0:Pe.x(),ut.y-=(me=ze.target.getStage())===null||me===void 0?void 0:me.y(),ut&&(mt.visible=!0,mt.x1=ut.x,mt.y1=ut.y,mt.x2=ut.x,mt.y2=ut.y,((He=ze.target.getStage())===null||He===void 0?void 0:He.getPointersPositions().length)>=2&&(mt.visible=!1))});(({stageRef:ze,containerRef:at,viewportSize:Pe})=>{r.default.useEffect(()=>{var me;const He=(me=at.current)===null||me===void 0?void 0:me.closest(".polotno-workspace-inner");function Me(){var Ye;if(!ze.current)return;const et=(Ye=at.current)===null||Ye===void 0?void 0:Ye.getBoundingClientRect(),ut=He==null?void 0:He.getBoundingClientRect(),wt=Math.max(0,ut.left-et.left-100),Ct=Math.max(0,ut.top-et.top-100);ze.current.position({x:-wt,y:-Ct}),ze.current.container().style.transform=`translate(${wt}px, ${Ct}px)`}return Me(),He.addEventListener("scroll",Me),()=>{He.removeEventListener("scroll",Me)}},[Pe.width,Pe.height])})({stageRef:xe,containerRef:oe,viewportSize:ye}),r.default.useEffect(()=>{const ze=(0,o.action)(Pe=>{var me,He,Me,Ye;if(!mt.visible)return;(me=xe.current)===null||me===void 0||me.setPointersPositions(Pe);let et=(He=xe.current)===null||He===void 0?void 0:He.getPointerPosition();et?(et.x-=(Me=xe.current)===null||Me===void 0?void 0:Me.x(),et.y-=(Ye=xe.current)===null||Ye===void 0?void 0:Ye.y()):et={x:mt.x2,y:mt.y2},mt.x2=et.x,mt.y2=et.y}),at=(0,o.action)(()=>{if(!mt.visible||!xe.current)return;const Pe=xe.current.findOne(".selection"),me=Pe?Pe.getClientRect():{width:0,height:0,x:0,y:0};if(me.width&&me.height){const He=[];xe.current.find(".element").forEach(Ye=>{const et=Ye.getClientRect(),ut=U.getElementById(Ye.id()),wt=ut==null?void 0:ut.draggable,Ct=ut==null?void 0:ut.selectable;m.default.Util.haveIntersection(me,et)&&wt&&Ct&&He.push(ut.top.id)});const Me=[...new Set(He)];U.selectElements(Me)}mt.visible=!1,kt.current=!0});return window.addEventListener("mousemove",ze),window.addEventListener("touchmove",ze),window.addEventListener("mouseup",at),window.addEventListener("touchend",at),()=>{window.removeEventListener("mousemove",ze),window.removeEventListener("touchmove",ze),window.removeEventListener("mouseup",at),window.removeEventListener("touchend",at)}},[]);const Se=r.default.useRef(!1);r.default.useEffect(()=>{var ze;let at;const Pe=(ze=oe.current)===null||ze===void 0?void 0:ze.closest(".polotno-workspace-inner"),me=()=>{Se.current=!0,clearTimeout(at),at=setTimeout(()=>{Se.current=!1},300)};return Pe.addEventListener("scroll",me),()=>{clearTimeout(at),Pe.removeEventListener("scroll",me)}},[]);const yt=ze=>{if(U.activePage!==ee&&ee.select(),Se.current||kt.current)return;const at=ze.evt.ctrlKey||ze.evt.metaKey||ze.evt.shiftKey,Pe=ze.target.findAncestor(".elements-container"),me=ze.target.findAncestor(".page-abs-container"),He=ze.target.findAncestor("Transformer");if(!(at||Pe||He||me))return void U.selectElements([]);const Me=ze.target.findAncestor(".element",!0),Ye=U.getElementById(Me==null?void 0:Me.id()),et=Ye==null?void 0:Ye.top,ut=et==null?void 0:et.id,wt=U.selectedElementsIds.indexOf(ut)>=0;ut&&at&&!wt?U.selectElements(U.selectedElementsIds.concat([ut])):ut&&at&&wt?U.selectElements(U.selectedElementsIds.filter(Ct=>Ct!==ut)):!ut||at||wt||U.selectElements([ut])};(0,v.useSnap)(he,U);const Fe=U.activePage===ee,qe=ue==null?void 0:ue.PageControls,$e=ue==null?void 0:ue.Tooltip,Et=ue==null?void 0:ue.ContextMenu,Pt=1/U.scale,ht=0/U.scale;return r.default.createElement("div",{ref:oe,onDragOver:ze=>ze.preventDefault(),onDrop:ze=>{if(ze.preventDefault(),!xe.current)return;xe.current.setPointersPositions(ze);const at=xe.current.findOne(".elements-container").getRelativePointerPosition(),Pe=xe.current.getPointerPosition(),me=xe.current.getAllIntersections(Pe).map(Ye=>Ye.findAncestor(".element",!0)).filter(Boolean),He=[...new Set(me.reverse())].map(Ye=>U.getElementById(Ye.id())),Me=He[0];W&&(W(at,Me,{elements:He,page:ee}),W=null)},style:{position:"relative",width:te+"px",height:Q+"px",overflow:"hidden"},className:"polotno-page-container"+(Fe?" active-page":"")},r.default.createElement(s.Stage,{ref:xe,width:Math.min(te,ye.width+200),height:Math.min(ye.height+200,Q),onClick:yt,onTap:yt,onContextMenu:ze=>{ze.evt.preventDefault();const at=ze.target.findAncestor(".element",!0),Pe=U.getElementById(at==null?void 0:at.id()),me=Pe==null?void 0:Pe.top,He=me==null?void 0:me.id;He?U.selectedElementsIds.indexOf(He)>=0||U.selectElements([He]):U.selectElements([]),Ke.open({x:ze.evt.clientX,y:ze.evt.clientY})},onMouseDown:Oe,onMouseMove:ze=>{if(!ze.evt.altKey&&de)return void ke(null);if(!ze.evt.altKey)return;const at=ze.target.findAncestor(".element",!0),Pe=at==null?void 0:at.id();if(!U.selectedElements[0]||U.selectedElementsIds.includes(Pe))return;const me=(0,S.getTotalClientRect)(U.selectedShapes),He=Pe?U.getElementById(Pe):{x:0,y:0,width:ee.computedWidth,height:ee.computedHeight,rotation:0},Me=(0,S.getClientRect)(He),Ye=[];me.minX>Me.maxX&&Ye.push({distance:me.minX-Me.maxX,box1:me,box2:Me,points:[{x:me.minX,y:me.minY+me.height/2},{x:Me.maxX,y:me.minY+me.height/2},{x:Me.maxX,y:Me.minY+Me.height/2}]}),me.maxX<Me.minX&&Ye.push({distance:Me.minX-me.maxX,box1:me,box2:Me,points:[{x:me.maxX,y:me.minY+me.height/2},{x:Me.minX,y:me.minY+me.height/2},{x:Me.minX,y:Me.minY+Me.height/2}]}),me.minY>Me.maxY&&Ye.push({box1:me,box2:Me,distance:me.minY-Me.maxY,points:[{x:me.minX+me.width/2,y:me.minY},{x:me.minX+me.width/2,y:Me.maxY},{x:Me.minX+Me.width/2,y:Me.maxY}]}),me.maxY<Me.minY&&Ye.push({box1:me,box2:Me,distance:Me.minY-me.maxY,points:[{x:me.minX+me.width/2,y:me.maxY},{x:me.minX+me.width/2,y:Me.minY},{x:Me.minX+Me.width/2,y:Me.minY}]}),me.minX>=Me.minX&&me.maxX<=Me.maxX&&me.minY>=Me.minY&&me.maxY<=Me.maxY&&(Ye.push({distance:me.minX-Me.minX,box1:me,box2:Me,points:[{x:me.minX,y:me.minY+me.height/2},{x:Me.minX,y:me.minY+me.height/2},{x:Me.minX,y:Me.minY+Me.height/2}]}),Ye.push({distance:Me.maxX-me.maxX,box1:me,box2:Me,points:[{x:me.maxX,y:me.minY+me.height/2},{x:Me.maxX,y:me.minY+me.height/2},{x:Me.maxX,y:Me.minY+Me.height/2}]}),Ye.push({box1:me,box2:Me,distance:me.minY-Me.minY,points:[{x:me.minX+me.width/2,y:me.minY},{x:me.minX+me.width/2,y:Me.minY},{x:Me.minX+Me.width/2,y:Me.minY}]}),Ye.push({box1:me,box2:Me,distance:Me.maxY-me.maxY,points:[{x:me.minX+me.width/2,y:me.maxY},{x:me.minX+me.width/2,y:Me.maxY},{x:Me.minX+Me.width/2,y:Me.maxY}]})),JSON.stringify(de)!==JSON.stringify(Ye)&&ke(Ye)},onDragStart:ze=>{var at;const Pe=ze.target.findAncestor(".element",!0);if(Pe){const me=U.getElementById(Pe==null?void 0:Pe.id()),He=me==null?void 0:me.top,Me=He==null?void 0:He.id;!(U.selectedElementsIds.indexOf(Me)>=0)&&Me&&(U.selectElements([Me]),ze.target.stopDrag(),ze.target.startDrag(ze),(at=he.current)===null||at===void 0||at.startDrag(ze))}de&&ke(null)},pageId:ee.id,style:{position:"absolute",overflow:"hidden",top:0,left:0}},r.default.createElement(s.Layer,null,r.default.createElement(O,{width:te,height:Q,fill:re}),r.default.createElement(s.Group,{x:se,y:_e,scaleX:U.scale,scaleY:U.scale,name:"page-container"},r.default.createElement(s.Group,{name:"page-container-2"},r.default.createElement(s.Group,{name:"page-background-group",x:we,y:we},r.default.createElement(R,{x:-ee.bleed,y:-ee.bleed,width:ee.computedWidth+2*ee.bleed,height:ee.computedHeight+2*ee.bleed,background:ee.background,name:"page-background",preventDefault:!1,scale:U.scale})),r.default.createElement(s.Group,{x:we,y:we,name:"elements-container",listening:!U.isPlaying},r.default.createElement(s.Rect,{name:"elements-area",width:ee.computedWidth,height:ee.computedHeight,listening:!1}),r.default.createElement(G,{elements:ee.children,store:U})),r.default.createElement(s.Rect,{stroke:fe,name:"bleed",strokeWidth:ee.bleed,x:ee.bleed/2,y:ee.bleed/2,width:ee.computedWidth+ee.bleed,height:ee.computedHeight+ee.bleed,listening:!1,visible:ee.bleed>0&&U.bleedVisible,hideInExport:!0}),(0,w.___)()===z&&r.default.createElement(Y,{name:"hit-detection",x:-Pt/2-ht,y:-Pt/2-ht,width:je+Pt+2*ht,height:Te+Pt+2*ht}))),r.default.createElement(s.Line,{name:"workspace-background",points:[0,0,te,0,te,Q,0,Q,0,0,se,_e,se,Q-_e,te-se,Q-_e,te-se,_e,se,_e],listening:!1,closed:!0,fill:re}),r.default.createElement(s.Group,{x:se,y:_e,scaleX:U.scale,scaleY:U.scale},r.default.createElement(s.Rect,{name:"page-highlight",hideInExport:!0,x:-Pt/2-ht,y:-Pt/2-ht,width:je+Pt+2*ht,height:Te+Pt+2*ht,stroke:Fe&&U.pages.length>1?ae:ne,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),r.default.createElement(s.Group,{x:se+we*U.scale,y:_e+we*U.scale,scaleX:U.scale,scaleY:U.scale,name:"page-abs-container"},r.default.createElement(s.Transformer,{ref:he,onDragStart:ze=>{var at;!((at=ze.evt)===null||at===void 0)&&at.altKey&&pe&&U.selectedElements.forEach(Pe=>{const me=Pe.clone({},{skipSelect:!0}),He=ee.children.indexOf(Pe);ee.setElementZIndex(me.id,He)}),U.history.startTransaction()},onDragEnd:()=>{U.history.endTransaction()},onTransformStart:()=>{U.history.startTransaction()},boundBoxFunc:(ze,at)=>{const Pe=Math.abs(at.width)<1||Math.abs(at.height)<1,me=Math.abs(ze.width)<1||Math.abs(ze.height)<1;return Pe&&!me?ze:at},onTransform:ze=>{var at,Pe;const me=he.current.nodes(),He=me[me.length-1];if(ze.target!==He)return;const Me=(at=he.current)===null||at===void 0?void 0:at.__getNodeRect(),Ye=(Pe=he.current)===null||Pe===void 0?void 0:Pe.getActiveAnchor();Qe({anchor:Ye,x:Me.x,y:Me.y,rotation:Me.rotation,width:Me.width,height:Me.height})},onTransformEnd:ze=>{Qe({}),U.history.endTransaction()},visible:!U.isPlaying}),de&&de.map(({points:ze,distance:at,box1:Pe,box2:me},He)=>r.default.createElement(s.Group,{name:"distances-container",hideInExport:!0,key:He,listening:!1},r.default.createElement(s.Rect,Object.assign({},Pe,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),r.default.createElement(s.Rect,Object.assign({},me,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),r.default.createElement(s.Line,{points:[ze[0].x,ze[0].y,ze[1].x,ze[1].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),r.default.createElement(s.Line,{points:[ze[1].x,ze[1].y,ze[2].x,ze[2].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),r.default.createElement(s.Label,{x:(ze[0].x+ze[1].x)/2,y:(ze[0].y+ze[1].y)/2,offsetY:-10,scaleX:1/U.scale,scaleY:1/U.scale},r.default.createElement(s.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"down"}),r.default.createElement(s.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:5,text:(0,x.pxToUnitString)({unit:U.unit,dpi:U.dpi,px:at})})))),ee._rendering&&r.default.createElement(s.Group,null,r.default.createElement(s.Rect,{width:je,height:Te,fill:"rgba(255,255,255,0.9)"}),r.default.createElement(s.Text,{text:"Rendering...",fontSize:60,width:je,height:Te,align:"center",verticalAlign:"middle"})),$e&&r.default.createElement($e,{components:ue,store:U,page:ee,stageRef:xe}),Et&&r.default.createElement(d.Html,null,r.default.createElement(Et,Object.assign({components:ue,store:U},Ke.props)))),r.default.createElement(V,Object.assign({},Be,{store:U})),r.default.createElement(L,{selection:mt}),(0,w.isCreditVisible)()&&r.default.createElement(s.Text,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:te-170,y:Q-18,onMouseEnter:ze=>{ze.target.getStage().container().style.cursor="pointer"},onMouseLeave:ze=>{ze.target.getStage().container().style.cursor=""},onTouchStart:ze=>{ze.cancelBubble=!0},onMouseDown:ze=>{ze.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),r.default.createElement(s.Group,{name:"line-guides"}))),ve&&qe&&r.default.createElement(qe,{store:U,page:ee,xPadding:se,yPadding:_e}))})}(Ns)),Ns}var wd={},M3;function mP(){return M3||(M3=1,function(e){var n=wd&&wd.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(e,"__esModule",{value:!0}),e.TopRules=void 0,e.LeftRules=function(){return t.default.createElement("div",null,t.default.createElement("h1",null,"Top rules"))};const t=n(Or()),r=Ec(),a=em(),o=Ri,s=Z4(),c=(0,s.styled)("div",t.default.forwardRef)`
265
- position: absolute;
266
- top: 0;
267
- left: 0;
268
- pointer-events: none;
269
- `,m=(0,s.styled)("div",t.default.forwardRef)`
270
- height: 14px;
271
- position: sticky;
272
- font-size: 8px;
273
- line-height: 14px;
274
- top: 0;
275
- left: 0;
276
- color: grey;
277
- border-bottom: 1px solid grey;
278
- background-color: #e8e8e8;
279
- overflow: hidden;
280
- `,f=(0,s.styled)("div",t.default.forwardRef)`
281
- left: 0;
282
- width: 14px;
283
- position: sticky;
284
- font-size: 8px;
285
- line-height: 14px;
286
- color: grey;
287
- border-right: 1px solid grey;
288
- background-color: #e8e8e8;
289
- overflow: hidden;
290
- `,v=(0,s.styled)("div",t.default.forwardRef)`
291
- position: absolute;
292
- border-left: 1px solid grey;
293
- padding-left: 2px;
294
- `,y=(0,s.styled)("div",t.default.forwardRef)`
295
- position: absolute;
296
- left: 14px;
297
- border-left: 1px solid grey;
298
- padding-left: 2px;
299
- transform: rotate(90deg);
300
- transform-origin: left top;
301
- overflow: hidden;
302
- `,E=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4];e.TopRules=(0,o.observer)(({store:w,width:S,height:x})=>{const _=t.default.useRef(null);if(!w.activePage)return null;const b=w.activePage,g=(w.bleedVisible&&b.bleed,b.computedWidth*w.scale),h=b.computedHeight*w.scale,d=(S-g)/2,P=(M=O=>(0,a.unitToPx)({unitVal:O,dpi:w.dpi,unit:w.unit})*w.scale,E.find(O=>M(O)>30)||1e4);var M;const T=(0,a.unitToPx)({unitVal:P,dpi:w.dpi,unit:w.unit})*w.scale,I=Math.round(g/T)+1,F=Math.round(h/T)+1,k=(0,r.getTotalClientRect)(w.selectedShapes);return t.default.createElement(c,{ref:_,className:"polotno-rulers"},t.default.createElement(m,{style:{width:S+"px"},className:"polotno-x-ruler"},[...Array(I)].map((O,N)=>t.default.createElement(v,{key:N,style:{left:d+N*T+"px",width:T+"px"}},w.unit==="px"||P>=1?Math.round(P*N):(P*N).toFixed(1))),!!w.selectedShapes.length&&t.default.createElement("div",{style:{position:"absolute",left:d+k.x*w.scale+"px",height:"14px",width:k.width*w.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),w.pages.map((O,N)=>{var A;const R=O.computedHeight*w.scale,L=(x-R)/2;return t.default.createElement(f,{key:O.id,style:{height:x+"px"},className:"polotno-y-ruler"},[...Array(F)].map((V,G)=>t.default.createElement(y,{key:G,style:{top:L+G*T-14+"px",width:T+"px"}},w.unit==="px"||P>=1?Math.round(P*G):(P*G).toFixed(1))),((A=w.selectedShapes[0])===null||A===void 0?void 0:A.page)===O&&t.default.createElement("div",{style:{position:"absolute",top:L+k.y*w.scale-14+"px",width:"14px",height:k.height*w.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))})}(wd)),wd}var _d={},L3;function yP(){return L3||(L3=1,function(e){var n=_d&&_d.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0}),e.AudioElement=void 0;const t=n(Or()),r=Ri,a=Xi;e.AudioElement=(0,r.observer)(({audio:o,store:s})=>{const[c,m]=function(f){const[v,y]=t.default.useState(null),[E,w]=t.default.useState("loading");return t.default.useEffect(()=>{const S=new Audio(f),x=()=>{w("loaded"),y(S)},_=()=>{w("failed"),y(null)};return S.addEventListener("canplay",x),S.addEventListener("error",_),()=>{S.removeEventListener("canplay",x),S.removeEventListener("error",_)}},[f]),[v,E]}(o.src);return t.default.useEffect(()=>{c&&s.history.ignore(()=>{o.set({duration:1e3*c.duration})})},[c,o,s.history]),t.default.useEffect(()=>{if(!c)return;const f=()=>{c.currentTime=o.startTime*o.duration/1e3},v=()=>{const E=o.endTime*o.duration/1e3;c.currentTime>=E&&(c.pause(),c.currentTime=o.startTime*o.duration/1e3)};c.addEventListener("ended",f),c.addEventListener("timeupdate",v);const y=(0,a.autorun)(()=>{const E=s.animatedElementsIds;if(E.length&&!E.includes(o.id))return;const w=s.currentTime-o.delay,S=o.duration*(o.endTime-o.startTime),x=w>=0&&w<S;if(!s.isPlaying||s.animatedElementsIds.length!==0||!x)return void c.pause();c.volume=o.volume,c.paused&&c.play();const _=w%S/1e3+o.startTime*o.duration/1e3,b=c.currentTime;Math.abs(b-_)>.5&&_!==b&&(c.currentTime=_)});return()=>{c.pause(),c.removeEventListener("ended",f),c.removeEventListener("timeupdate",v),y()}},[s.isPlaying,o.startTime,o.endTime,o.volume,c]),null})}(_d)),_d}var _1={},S1={},Sd={};let bP="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",r_=e=>crypto.getRandomValues(new Uint8Array(e)),n_=(e,n,t)=>{let r=(2<<Math.log(e.length-1)/Math.LN2)-1,a=-~(1.6*r*n/e.length);return(o=n)=>{let s="";for(;;){let c=t(a),m=a;for(;m--;)if(s+=e[c[m]&r]||"",s.length===o)return s}}},wP=(e,n=21)=>n_(e,n,r_),_P=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((n,t)=>(t&=63,t<36?n+=t.toString(36):t<62?n+=(t-26).toString(36).toUpperCase():t>62?n+="-":n+="_",n),"");const SP=Object.freeze(Object.defineProperty({__proto__:null,customAlphabet:wP,customRandom:n_,nanoid:_P,random:r_,urlAlphabet:bP},Symbol.toStringTag,{value:"Module"})),Yp=Yl(SP);var E1={},Oi={},x1={},O1={},N3;function i_(){return N3||(N3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.deepEqual=void 0,e.deepEqual=function(n,t){if(n===t)return!0;if(typeof n=="object"&&n!=null&&typeof t=="object"&&t!=null){if(Object.keys(n).length!=Object.keys(t).length)return!1;for(var r in n)if(!t.hasOwnProperty(r)||!(0,e.deepEqual)(n[r],t[r]))return!1;return!0}return!1}}(O1)),O1}var I3;function EP(){return I3||(I3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UndoManager=void 0;const n=Zi,t=i_();Object.assign(n.types),e.UndoManager=n.types.model("UndoManager",{history:n.types.array(n.types.frozen()),undoIdx:-1,targetPath:""}).views(r=>({get canUndo(){return r.undoIdx>0},get canRedo(){return r.undoIdx<r.history.length-1}})).actions(r=>{let a,o,s=!1,c=null,m=0,f=0;const v=()=>f>0;function y(){const w=(0,n.getSnapshot)(a);return{pages:w.pages,width:w.width,height:w.height,custom:w.custom}}function E(w){const S=a.pages.map(g=>g.id),x=w.pages.map(g=>g.id),_=!(0,t.deepEqual)(S,x),b=!(0,t.deepEqual)(a.custom,w.custom);_?(0,n.applySnapshot)(a.pages,w.pages):a.pages.forEach((g,h)=>{(0,n.applySnapshot)(g,w.pages[h])}),b&&a.set({custom:w.custom}),a.setSize(w.width,w.height)}return{startTransaction(){f++},endTransaction(w){f--,w||this.requestAddState(y())},async ignore(w,S=!1,x=!1){x&&await new Promise(d=>setTimeout(d,10)),m&&r.addUndoState();let _=v();r.startTransaction();let b=f;try{await w()}catch(d){setTimeout(()=>{throw d})}const g=b!==f,h=!g;r.endTransaction(h),S||_||r.replaceState(),g||(clearTimeout(m),m=0)},async transaction(w){await r.ignore(w,!0),this.addUndoState()},requestAddState(w){c=w,m||v()||(s?s=!1:m=setTimeout(()=>{m=0,clearTimeout(m),v()||this.addUndoState()},100))},addUndoState(){if(s)return void(s=!1);const w=r.history[r.undoIdx];!(0,t.deepEqual)(c,w)&&(clearTimeout(m),m=0,r.history.splice(r.undoIdx+1),r.history.push(c),r.undoIdx=r.history.length-1)},afterCreate(){if(a=(0,n.resolvePath)(r,".."),!a)throw new Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment");o=(0,n.onSnapshot)(a,()=>{this.requestAddState(y())}),r.history.length===0&&this.requestAddState(y())},clear(){clearTimeout(m),m=0,r.history.splice(0,r.history.length),r.undoIdx=-1,r.addUndoState(y())},beforeDestroy(){o()},undo(){m&&this.addUndoState(),r.canUndo?(r.undoIdx--,s=!0,E(r.history[r.undoIdx])):console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.")},redo(){m&&this.addUndoState(),r.canRedo?(r.undoIdx++,s=!0,E(r.history[r.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){r.history[r.undoIdx]=y()}}}),e.default=e.UndoManager}(x1)),x1}var P1={},j3;function xP(){return j3||(j3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.downloadFile=async function(n,t){const r=await(await fetch(n)).blob(),a=document.createElement("a"),o=URL.createObjectURL(r);a.href=o,a.download=t,document.body.appendChild(a),a.click(),setTimeout(function(){document.body.removeChild(a),window.URL.revokeObjectURL(o)},0)}}(P1)),P1}var C1={},D3;function OP(){return D3||(D3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsPDF=function(){return t?Promise.resolve(t):new Promise(r=>{var a=document.createElement("script");a.onload=function(){t=window.jspdf.jsPDF,r(t)},a.src=n,document.head.appendChild(a)})};const n="https://cdnjs.cloudflare.com/ajax/libs/jspdf/3.0.1/jspdf.umd.min.js";let t}(C1)),C1}var k1={},F3;function PP(){return F3||(F3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getGIF=t,e.createGIF=async function({width:r,height:a}){return new(await t())({workers:4,width:r,height:a,workerScript:URL.createObjectURL(new Blob([`// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js
303
- (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){var NeuQuant=require("./TypedNeuQuant.js");var LZWEncoder=require("./LZWEncoder.js");function ByteArray(){this.page=-1;this.pages=[];this.newPage()}ByteArray.pageSize=4096;ByteArray.charMap={};for(var i=0;i<256;i++)ByteArray.charMap[i]=String.fromCharCode(i);ByteArray.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(ByteArray.pageSize);this.cursor=0};ByteArray.prototype.getData=function(){var rv="";for(var p=0;p<this.pages.length;p++){for(var i=0;i<ByteArray.pageSize;i++){rv+=ByteArray.charMap[this.pages[p][i]]}}return rv};ByteArray.prototype.writeByte=function(val){if(this.cursor>=ByteArray.pageSize)this.newPage();this.pages[this.page][this.cursor++]=val};ByteArray.prototype.writeUTFBytes=function(string){for(var l=string.length,i=0;i<l;i++)this.writeByte(string.charCodeAt(i))};ByteArray.prototype.writeBytes=function(array,offset,length){for(var l=length||array.length,i=offset||0;i<l;i++)this.writeByte(array[i])};function GIFEncoder(width,height){this.width=~~width;this.height=~~height;this.transparent=null;this.transIndex=0;this.repeat=-1;this.delay=0;this.image=null;this.pixels=null;this.indexedPixels=null;this.colorDepth=null;this.colorTab=null;this.neuQuant=null;this.usedEntry=new Array;this.palSize=7;this.dispose=-1;this.firstFrame=true;this.sample=10;this.dither=false;this.globalPalette=false;this.out=new ByteArray}GIFEncoder.prototype.setDelay=function(milliseconds){this.delay=Math.round(milliseconds/10)};GIFEncoder.prototype.setFrameRate=function(fps){this.delay=Math.round(100/fps)};GIFEncoder.prototype.setDispose=function(disposalCode){if(disposalCode>=0)this.dispose=disposalCode};GIFEncoder.prototype.setRepeat=function(repeat){this.repeat=repeat};GIFEncoder.prototype.setTransparent=function(color){this.transparent=color};GIFEncoder.prototype.addFrame=function(imageData){this.image=imageData;this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null;this.getImagePixels();this.analyzePixels();if(this.globalPalette===true)this.globalPalette=this.colorTab;if(this.firstFrame){this.writeLSD();this.writePalette();if(this.repeat>=0){this.writeNetscapeExt()}}this.writeGraphicCtrlExt();this.writeImageDesc();if(!this.firstFrame&&!this.globalPalette)this.writePalette();this.writePixels();this.firstFrame=false};GIFEncoder.prototype.finish=function(){this.out.writeByte(59)};GIFEncoder.prototype.setQuality=function(quality){if(quality<1)quality=1;this.sample=quality};GIFEncoder.prototype.setDither=function(dither){if(dither===true)dither="FloydSteinberg";this.dither=dither};GIFEncoder.prototype.setGlobalPalette=function(palette){this.globalPalette=palette};GIFEncoder.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};GIFEncoder.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")};GIFEncoder.prototype.analyzePixels=function(){if(!this.colorTab){this.neuQuant=new NeuQuant(this.pixels,this.sample);this.neuQuant.buildColormap();this.colorTab=this.neuQuant.getColormap()}if(this.dither){this.ditherPixels(this.dither.replace("-serpentine",""),this.dither.match(/-serpentine/)!==null)}else{this.indexPixels()}this.pixels=null;this.colorDepth=8;this.palSize=7;if(this.transparent!==null){this.transIndex=this.findClosest(this.transparent,true)}};GIFEncoder.prototype.indexPixels=function(imgq){var nPix=this.pixels.length/3;this.indexedPixels=new Uint8Array(nPix);var k=0;for(var j=0;j<nPix;j++){var index=this.findClosestRGB(this.pixels[k++]&255,this.pixels[k++]&255,this.pixels[k++]&255);this.usedEntry[index]=true;this.indexedPixels[j]=index}};GIFEncoder.prototype.ditherPixels=function(kernel,serpentine){var kernels={FalseFloydSteinberg:[[3/8,1,0],[3/8,0,1],[2/8,1,1]],FloydSteinberg:[[7/16,1,0],[3/16,-1,1],[5/16,0,1],[1/16,1,1]],Stucki:[[8/42,1,0],[4/42,2,0],[2/42,-2,1],[4/42,-1,1],[8/42,0,1],[4/42,1,1],[2/42,2,1],[1/42,-2,2],[2/42,-1,2],[4/42,0,2],[2/42,1,2],[1/42,2,2]],Atkinson:[[1/8,1,0],[1/8,2,0],[1/8,-1,1],[1/8,0,1],[1/8,1,1],[1/8,0,2]]};if(!kernel||!kernels[kernel]){throw"Unknown dithering kernel: "+kernel}var ds=kernels[kernel];var index=0,height=this.height,width=this.width,data=this.pixels;var direction=serpentine?-1:1;this.indexedPixels=new Uint8Array(this.pixels.length/3);for(var y=0;y<height;y++){if(serpentine)direction=direction*-1;for(var x=direction==1?0:width-1,xend=direction==1?width:0;x!==xend;x+=direction){index=y*width+x;var idx=index*3;var r1=data[idx];var g1=data[idx+1];var b1=data[idx+2];idx=this.findClosestRGB(r1,g1,b1);this.usedEntry[idx]=true;this.indexedPixels[index]=idx;idx*=3;var r2=this.colorTab[idx];var g2=this.colorTab[idx+1];var b2=this.colorTab[idx+2];var er=r1-r2;var eg=g1-g2;var eb=b1-b2;for(var i=direction==1?0:ds.length-1,end=direction==1?ds.length:0;i!==end;i+=direction){var x1=ds[i][1];var y1=ds[i][2];if(x1+x>=0&&x1+x<width&&y1+y>=0&&y1+y<height){var d=ds[i][0];idx=index+x1+y1*width;idx*=3;data[idx]=Math.max(0,Math.min(255,data[idx]+er*d));data[idx+1]=Math.max(0,Math.min(255,data[idx+1]+eg*d));data[idx+2]=Math.max(0,Math.min(255,data[idx+2]+eb*d))}}}}};GIFEncoder.prototype.findClosest=function(c,used){return this.findClosestRGB((c&16711680)>>16,(c&65280)>>8,c&255,used)};GIFEncoder.prototype.findClosestRGB=function(r,g,b,used){if(this.colorTab===null)return-1;if(this.neuQuant&&!used){return this.neuQuant.lookupRGB(r,g,b)}var c=b|g<<8|r<<16;var minpos=0;var dmin=256*256*256;var len=this.colorTab.length;for(var i=0,index=0;i<len;index++){var dr=r-(this.colorTab[i++]&255);var dg=g-(this.colorTab[i++]&255);var db=b-(this.colorTab[i++]&255);var d=dr*dr+dg*dg+db*db;if((!used||this.usedEntry[index])&&d<dmin){dmin=d;minpos=index}}return minpos};GIFEncoder.prototype.getImagePixels=function(){var w=this.width;var h=this.height;this.pixels=new Uint8Array(w*h*3);var data=this.image;var srcPos=0;var count=0;for(var i=0;i<h;i++){for(var j=0;j<w;j++){this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];srcPos++}}};GIFEncoder.prototype.writeGraphicCtrlExt=function(){this.out.writeByte(33);this.out.writeByte(249);this.out.writeByte(4);var transp,disp;if(this.transparent===null){transp=0;disp=0}else{transp=1;disp=2}if(this.dispose>=0){disp=dispose&7}disp<<=2;this.out.writeByte(0|disp|0|transp);this.writeShort(this.delay);this.out.writeByte(this.transIndex);this.out.writeByte(0)};GIFEncoder.prototype.writeImageDesc=function(){this.out.writeByte(44);this.writeShort(0);this.writeShort(0);this.writeShort(this.width);this.writeShort(this.height);if(this.firstFrame||this.globalPalette){this.out.writeByte(0)}else{this.out.writeByte(128|0|0|0|this.palSize)}};GIFEncoder.prototype.writeLSD=function(){this.writeShort(this.width);this.writeShort(this.height);this.out.writeByte(128|112|0|this.palSize);this.out.writeByte(0);this.out.writeByte(0)};GIFEncoder.prototype.writeNetscapeExt=function(){this.out.writeByte(33);this.out.writeByte(255);this.out.writeByte(11);this.out.writeUTFBytes("NETSCAPE2.0");this.out.writeByte(3);this.out.writeByte(1);this.writeShort(this.repeat);this.out.writeByte(0)};GIFEncoder.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var n=3*256-this.colorTab.length;for(var i=0;i<n;i++)this.out.writeByte(0)};GIFEncoder.prototype.writeShort=function(pValue){this.out.writeByte(pValue&255);this.out.writeByte(pValue>>8&255)};GIFEncoder.prototype.writePixels=function(){var enc=new LZWEncoder(this.width,this.height,this.indexedPixels,this.colorDepth);enc.encode(this.out)};GIFEncoder.prototype.stream=function(){return this.out};module.exports=GIFEncoder},{"./LZWEncoder.js":2,"./TypedNeuQuant.js":3}],2:[function(require,module,exports){var EOF=-1;var BITS=12;var HSIZE=5003;var masks=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function LZWEncoder(width,height,pixels,colorDepth){var initCodeSize=Math.max(2,colorDepth);var accum=new Uint8Array(256);var htab=new Int32Array(HSIZE);var codetab=new Int32Array(HSIZE);var cur_accum,cur_bits=0;var a_count;var free_ent=0;var maxcode;var clear_flg=false;var g_init_bits,ClearCode,EOFCode;function char_out(c,outs){accum[a_count++]=c;if(a_count>=254)flush_char(outs)}function cl_block(outs){cl_hash(HSIZE);free_ent=ClearCode+2;clear_flg=true;output(ClearCode,outs)}function cl_hash(hsize){for(var i=0;i<hsize;++i)htab[i]=-1}function compress(init_bits,outs){var fcode,c,i,ent,disp,hsize_reg,hshift;g_init_bits=init_bits;clear_flg=false;n_bits=g_init_bits;maxcode=MAXCODE(n_bits);ClearCode=1<<init_bits-1;EOFCode=ClearCode+1;free_ent=ClearCode+2;a_count=0;ent=nextPixel();hshift=0;for(fcode=HSIZE;fcode<65536;fcode*=2)++hshift;hshift=8-hshift;hsize_reg=HSIZE;cl_hash(hsize_reg);output(ClearCode,outs);outer_loop:while((c=nextPixel())!=EOF){fcode=(c<<BITS)+ent;i=c<<hshift^ent;if(htab[i]===fcode){ent=codetab[i];continue}else if(htab[i]>=0){disp=hsize_reg-i;if(i===0)disp=1;do{if((i-=disp)<0)i+=hsize_reg;if(htab[i]===fcode){ent=codetab[i];continue outer_loop}}while(htab[i]>=0)}output(ent,outs);ent=c;if(free_ent<1<<BITS){codetab[i]=free_ent++;htab[i]=fcode}else{cl_block(outs)}}output(ent,outs);output(EOFCode,outs)}function encode(outs){outs.writeByte(initCodeSize);remaining=width*height;curPixel=0;compress(initCodeSize+1,outs);outs.writeByte(0)}function flush_char(outs){if(a_count>0){outs.writeByte(a_count);outs.writeBytes(accum,0,a_count);a_count=0}}function MAXCODE(n_bits){return(1<<n_bits)-1}function nextPixel(){if(remaining===0)return EOF;--remaining;var pix=pixels[curPixel++];return pix&255}function output(code,outs){cur_accum&=masks[cur_bits];if(cur_bits>0)cur_accum|=code<<cur_bits;else cur_accum=code;cur_bits+=n_bits;while(cur_bits>=8){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}if(free_ent>maxcode||clear_flg){if(clear_flg){maxcode=MAXCODE(n_bits=g_init_bits);clear_flg=false}else{++n_bits;if(n_bits==BITS)maxcode=1<<BITS;else maxcode=MAXCODE(n_bits)}}if(code==EOFCode){while(cur_bits>0){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}flush_char(outs)}}this.encode=encode}module.exports=LZWEncoder},{}],3:[function(require,module,exports){var ncycles=100;var netsize=256;var maxnetpos=netsize-1;var netbiasshift=4;var intbiasshift=16;var intbias=1<<intbiasshift;var gammashift=10;var gamma=1<<gammashift;var betashift=10;var beta=intbias>>betashift;var betagamma=intbias<<gammashift-betashift;var initrad=netsize>>3;var radiusbiasshift=6;var radiusbias=1<<radiusbiasshift;var initradius=initrad*radiusbias;var radiusdec=30;var alphabiasshift=10;var initalpha=1<<alphabiasshift;var alphadec;var radbiasshift=8;var radbias=1<<radbiasshift;var alpharadbshift=alphabiasshift+radbiasshift;var alpharadbias=1<<alpharadbshift;var prime1=499;var prime2=491;var prime3=487;var prime4=503;var minpicturebytes=3*prime4;function NeuQuant(pixels,samplefac){var network;var netindex;var bias;var freq;var radpower;function init(){network=[];netindex=new Int32Array(256);bias=new Int32Array(netsize);freq=new Int32Array(netsize);radpower=new Int32Array(netsize>>3);var i,v;for(i=0;i<netsize;i++){v=(i<<netbiasshift+8)/netsize;network[i]=new Float64Array([v,v,v,0]);freq[i]=intbias/netsize;bias[i]=0}}function unbiasnet(){for(var i=0;i<netsize;i++){network[i][0]>>=netbiasshift;network[i][1]>>=netbiasshift;network[i][2]>>=netbiasshift;network[i][3]=i}}function altersingle(alpha,i,b,g,r){network[i][0]-=alpha*(network[i][0]-b)/initalpha;network[i][1]-=alpha*(network[i][1]-g)/initalpha;network[i][2]-=alpha*(network[i][2]-r)/initalpha}function alterneigh(radius,i,b,g,r){var lo=Math.abs(i-radius);var hi=Math.min(i+radius,netsize);var j=i+1;var k=i-1;var m=1;var p,a;while(j<hi||k>lo){a=radpower[m++];if(j<hi){p=network[j++];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}if(k>lo){p=network[k--];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}}}function contest(b,g,r){var bestd=~(1<<31);var bestbiasd=bestd;var bestpos=-1;var bestbiaspos=bestpos;var i,n,dist,biasdist,betafreq;for(i=0;i<netsize;i++){n=network[i];dist=Math.abs(n[0]-b)+Math.abs(n[1]-g)+Math.abs(n[2]-r);if(dist<bestd){bestd=dist;bestpos=i}biasdist=dist-(bias[i]>>intbiasshift-netbiasshift);if(biasdist<bestbiasd){bestbiasd=biasdist;bestbiaspos=i}betafreq=freq[i]>>betashift;freq[i]-=betafreq;bias[i]+=betafreq<<gammashift}freq[bestpos]+=beta;bias[bestpos]-=betagamma;return bestbiaspos}function inxbuild(){var i,j,p,q,smallpos,smallval,previouscol=0,startpos=0;for(i=0;i<netsize;i++){p=network[i];smallpos=i;smallval=p[1];for(j=i+1;j<netsize;j++){q=network[j];if(q[1]<smallval){smallpos=j;smallval=q[1]}}q=network[smallpos];if(i!=smallpos){j=q[0];q[0]=p[0];p[0]=j;j=q[1];q[1]=p[1];p[1]=j;j=q[2];q[2]=p[2];p[2]=j;j=q[3];q[3]=p[3];p[3]=j}if(smallval!=previouscol){netindex[previouscol]=startpos+i>>1;for(j=previouscol+1;j<smallval;j++)netindex[j]=i;previouscol=smallval;startpos=i}}netindex[previouscol]=startpos+maxnetpos>>1;for(j=previouscol+1;j<256;j++)netindex[j]=maxnetpos}function inxsearch(b,g,r){var a,p,dist;var bestd=1e3;var best=-1;var i=netindex[g];var j=i-1;while(i<netsize||j>=0){if(i<netsize){p=network[i];dist=p[1]-g;if(dist>=bestd)i=netsize;else{i++;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}if(j>=0){p=network[j];dist=g-p[1];if(dist>=bestd)j=-1;else{j--;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}}return best}function learn(){var i;var lengthcount=pixels.length;var alphadec=30+(samplefac-1)/3;var samplepixels=lengthcount/(3*samplefac);var delta=~~(samplepixels/ncycles);var alpha=initalpha;var radius=initradius;var rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(i=0;i<rad;i++)radpower[i]=alpha*((rad*rad-i*i)*radbias/(rad*rad));var step;if(lengthcount<minpicturebytes){samplefac=1;step=3}else if(lengthcount%prime1!==0){step=3*prime1}else if(lengthcount%prime2!==0){step=3*prime2}else if(lengthcount%prime3!==0){step=3*prime3}else{step=3*prime4}var b,g,r,j;var pix=0;i=0;while(i<samplepixels){b=(pixels[pix]&255)<<netbiasshift;g=(pixels[pix+1]&255)<<netbiasshift;r=(pixels[pix+2]&255)<<netbiasshift;j=contest(b,g,r);altersingle(alpha,j,b,g,r);if(rad!==0)alterneigh(rad,j,b,g,r);pix+=step;if(pix>=lengthcount)pix-=lengthcount;i++;if(delta===0)delta=1;if(i%delta===0){alpha-=alpha/alphadec;radius-=radius/radiusdec;rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(j=0;j<rad;j++)radpower[j]=alpha*((rad*rad-j*j)*radbias/(rad*rad))}}}function buildColormap(){init();learn();unbiasnet();inxbuild()}this.buildColormap=buildColormap;function getColormap(){var map=[];var index=[];for(var i=0;i<netsize;i++)index[network[i][3]]=i;var k=0;for(var l=0;l<netsize;l++){var j=index[l];map[k++]=network[j][0];map[k++]=network[j][1];map[k++]=network[j][2]}return map}this.getColormap=getColormap;this.lookupRGB=inxsearch}module.exports=NeuQuant},{}],4:[function(require,module,exports){var GIFEncoder,renderFrame;GIFEncoder=require("./GIFEncoder.js");renderFrame=function(frame){var encoder,page,stream,transfer;encoder=new GIFEncoder(frame.width,frame.height);if(frame.index===0){encoder.writeHeader()}else{encoder.firstFrame=false}encoder.setTransparent(frame.transparent);encoder.setRepeat(frame.repeat);encoder.setDelay(frame.delay);encoder.setQuality(frame.quality);encoder.setDither(frame.dither);encoder.setGlobalPalette(frame.globalPalette);encoder.addFrame(frame.data);if(frame.last){encoder.finish()}if(frame.globalPalette===true){frame.globalPalette=encoder.getGlobalPalette()}stream=encoder.stream();frame.data=stream.pages;frame.cursor=stream.cursor;frame.pageSize=stream.constructor.pageSize;if(frame.canTransfer){transfer=function(){var i,len,ref,results;ref=frame.data;results=[];for(i=0,len=ref.length;i<len;i++){page=ref[i];results.push(page.buffer)}return results}();return self.postMessage(frame,transfer)}else{return self.postMessage(frame)}};self.onmessage=function(event){return renderFrame(event.data)}},{"./GIFEncoder.js":1}]},{},[4]);
304
- `],{type:"application/javascript"}))})};const n="https://cdnjs.cloudflare.com/ajax/libs/gif.js/0.2.0/gif.js";function t(){return window.GIF?Promise.resolve(window.GIF):new Promise(r=>{var a=document.createElement("script");a.onload=function(){r(window.GIF)},a.src=n,document.head.appendChild(a)})}}(k1)),k1}var A1={},z3;function CP(){return z3||(z3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.waitTillAvailable=async function(n){for(let t=0;t<30;t++){const r=await n();if(r)return r;await new Promise(a=>setTimeout(a,50))}}}(A1)),A1}var ya={},T1={},B3;function Op(){return B3||(B3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getImageSize=function(r){return new Promise(a=>{const o=document.createElement("img");o.onload=async()=>{o.width===0||o.height===0?a(await(0,n.getSvgSize)(r)):a({width:o.width,height:o.height})},o.crossOrigin="anonymous",o.src=r})},e.loadImage=t,e.cropImage=async function(r,a){const o=await t(r),s=document.createElement("canvas");s.width=2*o.width,s.height=2*o.height,s.getContext("2d").drawImage(o,0,0,s.width,s.height);const c=document.createElement("canvas");c.width=a.width,c.height=a.height;const m=c.getContext("2d");let{cropX:f,cropY:v}=a;const y=s.width*a.cropWidth,E=s.height*a.cropHeight,w=a.width/a.height;let S,x;const _=y/E;return a.type==="svg"?(S=y,x=E):w>=_?(S=y,x=y/w):(S=E*w,x=E),m.drawImage(s,f*s.width,v*s.height,S,x,0,0,c.width,c.height),c.toDataURL("image/png")},e.getCrop=function(r,a){const{width:o,height:s}=r,c=o/s;let m,f;c>=a.width/a.height?(m=a.width,f=a.width/c):(m=a.height*c,f=a.height);const v=(a.width-m)/2,y=(a.height-f)/2;return{cropX:v/a.width,cropY:y/a.height,cropWidth:m/a.width,cropHeight:f/a.height}};const n=Yd();function t(r){return new Promise((a,o)=>{const s=document.createElement("img");s.onload=()=>{a(s)},s.onerror=c=>{o(c)},s.crossOrigin="anonymous",s.src=r})}}(T1)),T1}var R1={},U3;function a_(){return U3||(U3=1,function(e){var n;Object.defineProperty(e,"__esModule",{value:!0}),e.Effects=void 0,e.shapeFilterToCSS=function(t){let r={filter:"",html:void 0};switch(t){case n.warm:return r.filter="sepia(0.5) saturate(1.5) brightness(1.1) contrast(1.1)",r;case n.cold:return r.filter="url(#blue-boost)",r.html=`
305
- <svg style="display: none">
306
- <filter id="blue-boost">
307
- <feColorMatrix
308
- type="matrix"
309
- values="
310
- 0.85 0 0 0 0
311
- 0 0.9 0 0 0
312
- 0 0 1.15 0 0
313
- 0 0 0 1 0"
314
- />
315
- </filter>
316
- </svg>`,r;case"natural":return r.filter="saturate(1.3) brightness(1.1) contrast(1.2)",r;default:return null}},function(t){t.sepia="sepia",t.grayscale="grayscale",t.natural="natural",t.warm="warm",t.cold="cold"}(n||(e.Effects=n={}))}(R1)),R1}var M1={},q3;function kP(){return q3||(q3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getVideoSize=async function(n){return new Promise(t=>{const r=document.createElement("video");r.crossOrigin="anonymous",r.src=n,r.addEventListener("loadedmetadata",()=>{const{videoWidth:a,videoHeight:o}=r;t({width:a,height:o})})})},e.getVideoDuration=async function(n){return new Promise(t=>{const r=document.createElement("video");r.crossOrigin="anonymous",r.src=n,r.addEventListener("loadedmetadata",()=>{const{duration:a}=r;t(a)})})},e.getVideoPreview=async function(n,t=5){return new Promise((r,a)=>{var o=document.createElement("video"),s=document.createElement("canvas");s.width=480,s.height=360;var c=s.getContext("2d");o.crossOrigin="anonymous",o.src=n,o.addEventListener("error",m=>{a(m)}),o.addEventListener("loadeddata",function(){const m=o.videoWidth/o.videoHeight;s.width=480,s.height=480/m,o.currentTime=t}),o.addEventListener("seeked",function(){c.drawImage(o,0,0,s.width,s.height);try{var m=s.toDataURL();r(m)}catch(f){a(f)}})})},e.getVideoObjectPreview=async function(n,t,r){return new Promise((a,o)=>{const s=t.getContext("2d"),c=()=>{try{s.drawImage(n,0,0,t.width,t.height);const m=t.toDataURL();a(m),n.removeEventListener("seeked",c)}catch(m){o(m),n.removeEventListener("seeked",c)}};n.addEventListener("seeked",c),n.currentTime=r})}}(M1)),M1}var H3;function AP(){return H3||(H3=1,function(e){var n,t=ya&&ya.__createBinding||(Object.create?function(d,P,M,T){T===void 0&&(T=M);var I=Object.getOwnPropertyDescriptor(P,M);I&&!("get"in I?!P.__esModule:I.writable||I.configurable)||(I={enumerable:!0,get:function(){return P[M]}}),Object.defineProperty(d,T,I)}:function(d,P,M,T){T===void 0&&(T=M),d[T]=P[M]}),r=ya&&ya.__setModuleDefault||(Object.create?function(d,P){Object.defineProperty(d,"default",{enumerable:!0,value:P})}:function(d,P){d.default=P}),a=ya&&ya.__importStar||(n=function(d){return n=Object.getOwnPropertyNames||function(P){var M=[];for(var T in P)Object.prototype.hasOwnProperty.call(P,T)&&(M[M.length]=T);return M},n(d)},function(d){if(d&&d.__esModule)return d;var P={};if(d!=null)for(var M=n(d),T=0;T<M.length;T++)M[T]!=="default"&&t(P,d,M[T]);return r(P,d),P}),o=ya&&ya.__rest||function(d,P){var M={};for(var T in d)Object.prototype.hasOwnProperty.call(d,T)&&P.indexOf(T)<0&&(M[T]=d[T]);if(d!=null&&typeof Object.getOwnPropertySymbols=="function"){var I=0;for(T=Object.getOwnPropertySymbols(d);I<T.length;I++)P.indexOf(T[I])<0&&Object.prototype.propertyIsEnumerable.call(d,T[I])&&(M[T[I]]=d[T[I]])}return M};Object.defineProperty(e,"__esModule",{value:!0}),e.fixRatio=function(d){var P=new DOMParser().parseFromString(d,"image/svg+xml");return P.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(P)},e.jsonToDOM=g,e.jsonToHTML=async function({json:d,elementHook:P}){const M=await g({json:d,elementHook:P});return h({dom:M})};const s=Op(),c=a(Yd()),m=Op(),f=Qv(),v=X4(),y=a_(),E=kP(),w=(d,P,...M)=>({type:d,props:P,children:M||[]}),S=async({element:d,page:P,store:M})=>{let{src:T}=d;if(d.type==="svg"&&Object.keys(d.colorsReplace).length){const ee=await c.urlToString(T);T=c.replaceColors(ee,new Map(Object.entries(d.colorsReplace)))}let I="";d.flipX&&(I+="scaleX(-1)"),d.flipY&&(I+="scaleY(-1)"),I||(I="none");const F={};if(d.clipSrc){const ee=await c.urlToBase64(d.clipSrc);F["clip-path"]=`url(${ee})`}const k=await(0,m.loadImage)(T),O=k.width*d.cropWidth,N=k.height*d.cropHeight,A=d.width/d.height;let R,L;const V=O/N;d.type==="svg"?(R=O,L=N):A>=V?(R=O,L=O/A):(R=N*A,L=N);const G=R/k.width,W=L/k.height,X=R/L>d.width/d.height?d.height/L:d.width/R,q=R*X/G,z=L*X/W,Y=d.cropX*X*k.width,U=d.cropY*X*k.height;return w("div",{style:Object.assign(Object.assign({},F),{width:"100%",height:"100%","border-radius":d.cornerRadius+"px",border:d.borderSize?`${d.borderSize}px solid ${d.borderColor}`:"none",background:`url(${T})`,transform:I,"background-size":`${Math.round(q)}px ${Math.round(z)}px`,"background-position-x":-Math.round(Y)+"px","background-position-y":-Math.round(U)+"px"})})},x=({element:d,type:P})=>{const M={"stroke-width":d.height,stroke:d.color,"line-cap":"round","stroke-linejoin":"round",opacity:d.opacity};return P==="arrow"||P==="triangle"?w("polyline",Object.assign({points:`${3*d.height},${2*-d.height} 0,0 ${3*d.height},${2*d.height}`},M)):P==="bar"?w("polyline",Object.assign({points:`0,${2*-d.height} 0,${2*d.height}`},M)):P==="circle"?w("circle",Object.assign({r:d.height},M)):P==="square"?w("polyline",Object.assign({points:`${-d.height},${-d.height} ${-d.height},${d.height} ${d.height},${d.height} ${d.height},${-d.height}`},M)):null},_={image:S,svg:S,text:async({element:d,page:P,store:M})=>{let T={top:0,left:0};d.fill.indexOf("gradient")>=0&&(T=Object.assign(Object.assign({},T),{"background-color":d.fill,"background-image":d.fill,"background-clip":"text","text-fill-color":"transparent","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"}));const I=d.backgroundPadding*(d.fontSize*d.lineHeight),F=w("div",{style:{position:"absolute",top:-I/2+"px",left:-I/2+"px",display:d.backgroundEnabled?"block":"none",width:d.width+I+"px",height:d.height+I+"px","background-color":d.backgroundColor,"border-radius":d.backgroundCornerRadius*(d.fontSize*d.lineHeight*.5)+"px"}});d.verticalAlign==="middle"?(T.top="50%",T.transform="translateY(-50%)"):d.verticalAlign==="bottom"&&(T.bottom=0);const k=/<[a-z][\s\S]*>/i.test(d.text),O=Object.assign(Object.assign({},T),{position:"absolute",width:d.width+"px",color:d.fill,"white-space":"pre-wrap","font-size":d.fontSize+"px","text-align":d.align,"font-family":d.fontFamily,"text-decoration":d.textDecoration||"none","line-height":d.lineHeight,"letter-spacing":d.letterSpacing+"em","font-style":d.fontStyle,"font-weight":d.fontWeight,"-webkit-text-stroke":`${d.strokeWidth}px ${d.stroke}`,"text-stroke":`${d.strokeWidth}px ${d.stroke}`}),N="el-"+d.id,A=k?{id:N}:{},R=`<style>#${N} {${v.resetStyleContent}}</style>`,L=w("div",Object.assign(Object.assign({style:O},A),{innerHTML:k?`${R}${d.text}`:d.text.split(`
317
- `).join("<br />")}));return w("div",{style:{position:"relative",width:"100%",height:"100%"}},F,L)},line:async({element:d,page:P,store:M})=>w("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},w("rect",{x:0,y:0,width:d.width,height:d.height,fill:d.color}),w("g",{transform:`translate(0 ${d.height/2})`},x({element:d,type:d.startHead})),w("g",{transform:`translate(${d.width} ${d.height/2}) rotate(180)`},x({element:d,type:d.endHead}))),figure:async({element:d,page:P,store:M,elementHook:T})=>{const I=(0,f.figureToSvg)(d),F=w("div",{innerHTML:I});return T&&T({dom:F,element:d})||F},group:async({element:d,page:P,store:M,elementHook:T})=>{const I=await Promise.all(d.children.map(k=>b({element:k,page:P,store:M,elementHook:T}))),F=w("div",{style:{"transform-origin":"top left",opacity:d.opacity}},...I);return T&&T({dom:F,element:d})||F},video:async({element:d,page:P,store:M,elementHook:T})=>{const{cropX:I,cropY:F,cropWidth:k,cropHeight:O}=d,N=await(0,E.getVideoSize)(d.src),A=N.width*k,R=N.height*O,L=d.width/d.height;let V,G;L>=A/R?(V=A,G=A/L):(V=R*L,G=R);const W=V/k,X=G/O,q=I*N.width,z=F*N.height,Y=Math.max(d.width/N.width,d.height/N.height),U={position:"absolute",width:`${Math.round(W*Y)}px`,height:`${Math.round(X*Y)}px`,left:-Math.round(q*Y)+"px",top:-Math.round(z*Y)+"px","object-fit":"fill"},ee=`video-${d.id}`,te=w("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden","border-radius":d.cornerRadius+"px",border:d.borderSize?`${d.borderSize}px solid ${d.borderColor}`:"none"}},w("video",{id:ee,src:d.src,style:U,controls:!0,playsInline:!0,muted:!0,volume:d.volume}));return T&&T({dom:te,element:d})||te},gif:S};async function b({element:d,page:P,store:M,elementHook:T}){let I=await _[d.type];I||(I=()=>w("div",{}),console.error(`HTML export does not support ${d.type} type...`));const F=await I({element:d,page:P,store:M}),k=[],O=[];if(d.blurEnabled&&k.push(`blur(${d.blurRadius/2}px)`),d.brightnessEnabled&&k.push(`brightness(${100*d.brightness+100}%)`),d.sepiaEnabled&&k.push("sepia()"),d.grayscaleEnabled&&k.push("grayscale()"),d.filters)for(const A of Object.keys(d.filters)){const R=(0,y.shapeFilterToCSS)(y.Effects[A]);R&&(k.push(R.filter),R.html&&O.push(R.html))}d.shadowEnabled&&k.push(`drop-shadow(${d.shadowOffsetX}px ${d.shadowOffsetY}px ${d.shadowBlur}px ${d.shadowColor})`);const N=w("div",{id:d.id,style:{position:"absolute",left:d.x+"px",top:d.y+"px",width:d.width+"px",height:d.height+"px",transform:`rotate(${d.rotation}deg)`,"transform-origin":"top left",opacity:d.opacity,display:d.visible&&d.showInExport?"block":"none",filter:k.join(" ")||"none"}},F,...O);return T&&T({dom:N,element:d})||N}async function g({json:d,elementHook:P}){const M=await Promise.all(d.pages.map(F=>async function({page:k,store:O,elementHook:N}){const A=await Promise.all(k.children.map(G=>b({element:G,page:k,store:O,elementHook:N}))),R=k.width==="auto"?O.width:k.width,L=k.height==="auto"?O.height:k.height;let V={};if(k.background.indexOf("url")>=0||k.background.indexOf("http")>=0||k.background.indexOf(".jpg")>=0||k.background.indexOf(".png")>=0||k.background.indexOf(".jpeg")>=0){const{width:G,height:W}=await(0,m.loadImage)(k.background),X=await S({element:Object.assign({x:0,y:0,width:G,height:W,src:k.background,cornerRadius:0},(0,s.getCrop)({width:G,height:W},{width:G,height:W})),page:k,store:O});A.unshift(X)}else V=Object.assign(Object.assign({},V),{"background-color":k.background});return w("div",{className:"page",id:k.id,style:Object.assign(Object.assign({},V),{width:R+"px",height:L+"px",border:"1px solid grey",overflow:"hidden",position:"relative"})},...A)}({page:F,store:d,elementHook:P}))),T=[];d.pages.forEach(F=>{F.children.forEach(k=>{k.type==="text"&&T.indexOf(k.fontFamily)===-1&&T.push(k.fontFamily)})});const I=T.map(F=>d.fonts.find(k=>k.fontFamily===F)?w("style",{},""):w("link",{href:`https://fonts.googleapis.com/css?family=${F}`,rel:"stylesheet"}));return w("div",{className:"design"},...I,...M)}const h=({dom:d})=>{if(typeof d=="string")return d;if(!d)return"";const P=d.props,{innerHTML:M}=P,T=o(P,["innerHTML"]);return`<${d.type} ${Object.keys(T).map(I=>((F,k)=>typeof k=="object"?`${F}="${Object.keys(k).map(O=>`${O}:${k[O]};`).join(" ")}"`:`${F}="${k}"`)(I,d.props[I])).join(" ")}>${M||d.children.map(I=>h({dom:I})).join("")}</${d.type}>`}}(ya)),ya}var ba={},G3;function TP(){return G3||(G3=1,function(e){var n,t=ba&&ba.__createBinding||(Object.create?function(h,d,P,M){M===void 0&&(M=P);var T=Object.getOwnPropertyDescriptor(d,P);T&&!("get"in T?!d.__esModule:T.writable||T.configurable)||(T={enumerable:!0,get:function(){return d[P]}}),Object.defineProperty(h,M,T)}:function(h,d,P,M){M===void 0&&(M=P),h[M]=d[P]}),r=ba&&ba.__setModuleDefault||(Object.create?function(h,d){Object.defineProperty(h,"default",{enumerable:!0,value:d})}:function(h,d){h.default=d}),a=ba&&ba.__importStar||(n=function(h){return n=Object.getOwnPropertyNames||function(d){var P=[];for(var M in d)Object.prototype.hasOwnProperty.call(d,M)&&(P[P.length]=M);return P},n(h)},function(h){if(h&&h.__esModule)return h;var d={};if(h!=null)for(var P=n(h),M=0;M<P.length;M++)P[M]!=="default"&&t(d,h,P[M]);return r(d,h),d}),o=ba&&ba.__rest||function(h,d){var P={};for(var M in h)Object.prototype.hasOwnProperty.call(h,M)&&d.indexOf(M)<0&&(P[M]=h[M]);if(h!=null&&typeof Object.getOwnPropertySymbols=="function"){var T=0;for(M=Object.getOwnPropertySymbols(h);T<M.length;T++)d.indexOf(M[T])<0&&Object.prototype.propertyIsEnumerable.call(h,M[T])&&(P[M[T]]=h[M[T]])}return P};Object.defineProperty(e,"__esModule",{value:!0}),e.forEveryChild=void 0,e.fixRatio=function(h){var d=new DOMParser().parseFromString(h,"image/svg+xml");return d.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(d)},e.jsonToDOM=b,e.jsonToSVG=async function({json:h,elementHook:d}){const P=await b({json:h,elementHook:d});return g({dom:P})};const s=Op(),c=a(Yd()),m=Op(),f=Qv(),v=a_();e.forEveryChild=(h,d)=>{if(h.children)for(const P of h.children){if(d(P)===!0)break;(0,e.forEveryChild)(P,d)}};const y=(h,d,...P)=>({type:h,props:d,children:P||[]}),E=async({element:h,page:d,store:P})=>{let{src:M}=h;if(h.type==="svg"){const ee=await c.urlToString(M);M=c.replaceColors(ee,new Map(Object.entries(h.colorsReplace)))}else M=await(async ee=>{try{const te=await fetch(ee);if(typeof Buffer<"u"){const Q=await te.arrayBuffer(),Z=Buffer.from(Q).toString("base64");return`data:${te.headers.get("content-type")||"image/png"};base64,${Z}`}{const Q=await te.blob();return new Promise((Z,re)=>{const ne=new FileReader;ne.onloadend=()=>Z(ne.result),ne.onerror=re,ne.readAsDataURL(Q)})}}catch(te){return console.error("Error converting URL to data URL:",te),ee}})(M);let T="";h.flipX&&(T+="scaleX(-1)"),h.flipY&&(T+="scaleY(-1)"),h.clipSrc&&await c.urlToBase64(h.clipSrc);const I=await(0,m.loadImage)(M),F=I.width*h.cropWidth,k=I.height*h.cropHeight,O=h.width/h.height;let N,A;const R=F/k;h.type==="svg"?(N=F,A=k):O>=R?(N=F,A=F/O):(N=k*O,A=k);const L=N/I.width,V=A/I.height,G=N/A>h.width/h.height?h.height/A:h.width/N,W=N*G/L,X=A*G/V,q=h.cropX*I.width*G,z=h.cropY*I.height*G,Y=`clip-${h.id}`,U=M.replace(/&/g,"&amp;");return y("g",{style:{transform:T}},y("defs",{},y("clipPath",{id:Y},y("rect",{x:0,y:0,width:h.width,height:h.height}))),y("image",{href:U,x:-q,y:-z,width:W,height:X,preserveAspectRatio:"none","clip-path":`url(#${Y})`}))},w=({element:h,type:d})=>{const P={"stroke-width":h.height,stroke:h.color,"line-cap":"round","stroke-linejoin":"round",opacity:h.opacity};return d==="arrow"||d==="triangle"?y("polyline",Object.assign({points:`${3*h.height},${2*-h.height} 0,0 ${3*h.height},${2*h.height}`},P)):d==="bar"?y("polyline",Object.assign({points:`0,${2*-h.height} 0,${2*h.height}`},P)):d==="circle"?y("circle",Object.assign({r:h.height},P)):d==="square"?y("polyline",Object.assign({points:`${-h.height},${-h.height} ${-h.height},${h.height} ${h.height},${h.height} ${h.height},${-h.height}`},P)):null},S={image:E,svg:E,text:async({element:h,page:d,store:P})=>{const M=(O,N,A,R,L)=>{const V=document.createElement("canvas").getContext("2d");return V.font=`${L} ${R} ${N}px ${A}`,V.measureText(O).width},T=((O,N,A,R,L,V)=>{const G=[];return O.split(`
318
- `).forEach(W=>{const X=W.split(" ");let q="";for(let z=0;z<X.length;z++){const Y=q+X[z]+" ";M(Y,A,R,L,V)>N+.5&&z>0?(G.push(q.trim()),q=X[z]+" "):q=Y}G.push(q.trim())}),G})(h.text,h.width,h.fontSize,h.fontFamily,h.fontWeight,h.fontStyle),I=h.fontSize*h.lineHeight,F=h.align==="center"?"middle":h.align==="right"?"end":"start",k=T.map((O,N)=>y("tspan",{x:h.align==="center"?h.width/2:h.align==="right"?h.width:0,dy:N===0?0:I,innerHTML:O}));return y("g",{},y("text",{fill:h.fill,y:h.fontSize,"font-size":h.fontSize+"px","text-anchor":F,"font-family":h.fontFamily,"font-style":h.fontStyle,"font-weight":h.fontWeight,"text-decoration":h.textDecoration,"line-height":h.lineHeight,"letter-spacing":h.letterSpacing+"em","stroke-width":h.strokeWidth,stroke:h.stroke},...k))},line:async({element:h,page:d,store:P})=>y("g",{},y("line",{x1:0,y1:h.height/2,x2:h.width,y2:h.height/2,stroke:h.color,"stroke-width":h.height}),y("g",{transform:`translate(0 ${h.height/2})`},w({element:h,type:h.startHead})),y("g",{transform:`translate(${h.width} ${h.height/2}) rotate(180)`},w({element:h,type:h.endHead}))),figure:async({element:h,page:d,store:P,elementHook:M})=>{const T=function(F){let k=F.replace(/<svg[^>]*>/,"");return k=k.replace(/<\/svg>/,""),k}((0,f.figureToSvg)(h)),I=y("g",{innerHTML:T});return M&&M({dom:I,element:h})||I},group:async({element:h,page:d,store:P,elementHook:M})=>{const T=await Promise.all(h.children.map(F=>x({element:F,page:d,store:P,elementHook:M}))),I=y("g",{opacity:h.opacity,style:{"transform-origin":"top left"}},...T);return M&&M({dom:I,element:h})||I},gif:E};async function x({element:h,page:d,store:P,elementHook:M}){let T=await S[h.type];T||(T=()=>y("g",{}),console.error(`SVG export does not support ${h.type} type...`));const I=await T({element:h,page:d,store:P}),F=[],k=[];if(h.blurEnabled&&F.push(`blur(${h.blurRadius/2}px)`),h.brightnessEnabled&&F.push(`brightness(${100*h.brightness+100}%)`),h.sepiaEnabled&&F.push("sepia()"),h.grayscaleEnabled&&F.push("grayscale()"),h.shadowEnabled&&F.push(`drop-shadow(${h.shadowOffsetX}px ${h.shadowOffsetY}px ${h.shadowBlur}px ${h.shadowColor})`),h.filters)for(const N of Object.keys(h.filters)){const A=(0,v.shapeFilterToCSS)(v.Effects[N]);if(A&&(F.push(A.filter),A.html)){const R=A.html.replace(/<svg([^>]*)>/,"<g$1>").replace(/<\/svg>/,"</g>");k.push(R)}}const O=y("g",{className:"element",id:h.id,transform:h.type!=="group"?`translate(${h.x}, ${h.y}) rotate(${h.rotation})`:void 0,display:h.visible?void 0:"none",style:{"transform-origin":"top left",filter:F.join(" ")}},I,...k);return M&&M({dom:O,element:h})||O}async function _(h){try{const d=await fetch(h),P=await d.blob();return new Promise((M,T)=>{const I=new FileReader;I.onloadend=()=>M(I.result),I.onerror=T,I.readAsDataURL(P)})}catch(d){return console.error("Error embedding font:",d),h}}async function b({json:h,elementHook:d}){const P=await Promise.all(h.pages.map(I=>async function({page:F,store:k,elementHook:O}){const N=await Promise.all(F.children.map(L=>x({element:L,page:F,store:k,elementHook:O}))),A=F.background.indexOf("url")>=0||F.background.indexOf("http")>=0||F.background.indexOf(".jpg")>=0||F.background.indexOf(".png")>=0||F.background.indexOf(".jpeg")>=0;let R;if(A){const L=await(0,m.loadImage)(F.background);R=await(0,m.cropImage)(F.background,Object.assign({width:k.width,height:k.height,x:0,y:0},(0,s.getCrop)({width:k.width,height:k.height},{width:L.width,height:L.height})))}return y("g",{className:"page",style:{}},A?y("image",{"xlink:href":R,x:0,y:0,width:k.width,height:k.height,preserveAspectRatio:"none"}):y("rect",{x:0,y:0,width:k.width,height:k.height,fill:A?void 0:F.background}),...N)}({page:I,store:h,elementHook:d}))),M=[];(0,e.forEveryChild)({children:h.pages},I=>{I.type==="text"&&M.indexOf(I.fontFamily)===-1&&M.push(I.fontFamily)});const T=await async function(I,F){return await Promise.all(I.map(async k=>{var O,N;const A=F.find(R=>R.fontFamily===k);if(A){const R=await _(A.url);return y("style",{},`@font-face { font-family: ${k}; src: url(${R}); }`)}{const R=`https://fonts.googleapis.com/css?family=${k}:bi,normal,i,b`;try{const L=await fetch(R),V=await L.text(),G=(N=(O=V.match(/url\((.*?)\)/g))===null||O===void 0?void 0:O.map(X=>X.replace(/url\((.*?)\)/,"$1")))===null||N===void 0?void 0:N.filter(X=>X.startsWith("https"));if(!(G!=null&&G.length))throw new Error("No font URLs found");const W=await Promise.all(G.map(async X=>{const q=await _(X),z=V.match(/font-style:\s*(.*?);/),Y=V.match(/font-weight:\s*(.*?);/),U=z?z[1]:"normal",ee=Y?Y[1]:"normal";return`@font-face {
319
- font-family: ${k};
320
- font-style: ${U};
321
- font-weight: ${ee};
322
- src: url(${q});
323
- }`}));return y("style",{},W.join(`
324
- `))}catch(L){return console.error("Error embedding Google Font:",L),y("defs",{},y("style",{type:"text/css",innerHTML:`@import url('${R}');`.replace(/&/g,"&amp;")}))}}}))}(M,h.fonts);return y("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:`0 0 ${h.width} ${h.height}`,width:h.width,height:h.height},...T,...P)}const g=({dom:h,nestLevel:d=0})=>{if(typeof h=="string")return h;if(!h)return"";const P=h.props,{innerHTML:M}=P,T=o(P,["innerHTML"]),I=" ".repeat(d);return`${I}<${h.type} ${Object.keys(T).map(F=>((k,O)=>typeof O=="object"?`${k}="${Object.keys(O).map(N=>`${N}:${O[N]};`).join(" ")}"`:O==null||O===""?"":`${k}="${O}"`)(F,T[F])).join(" ")}>${M||`
325
- `+h.children.map(F=>g({dom:F,nestLevel:d+1})).join("")}${I}</${h.type}>
326
- `}}(ba)),ba}var L1={},V3;function o_(){return V3||(V3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Page=void 0;const n=Zi,t=Yp,r=Id(),a=tm(),o=Id(),s=Ec();e.Page=n.types.model("Page",{id:n.types.identifier,children:n.types.array(n.types.late(()=>r.ElementTypes)),width:n.types.optional(n.types.union(n.types.number,n.types.literal("auto")),"auto"),height:n.types.optional(n.types.union(n.types.number,n.types.literal("auto")),"auto"),background:"white",bleed:0,custom:n.types.frozen(),duration:5e3,_exporting:!1,_rendering:!1,_forceMount:!1}).postProcessSnapshot(c=>{const m=Object.assign({},c),f={};for(var v in m)v[0]!=="_"&&(f[v]=c[v]);return f}).views(c=>({get store(){return(0,n.getParentOfType)(c,a.Store)}})).views(c=>({get startTime(){let m=0;for(const f of c.store.pages){if(f.id===c.id)return m;m+=f.duration}return m},get _exportingOrRendering(){return c._exporting||c._rendering}})).views(c=>({get computedWidth(){return c.width==="auto"?c.store.width:c.width},get computedHeight(){return c.height==="auto"?c.store.height:c.height}})).actions(c=>({toJSON:()=>JSON.parse(JSON.stringify((0,n.getSnapshot)(c))),_forEachElementUp(m,f){const v=m.map(y=>({id:y,index:c.children.findIndex(E=>E.id===y)}));v.sort((y,E)=>E.index-y.index);for(const{index:y}of v){if(y==-1)continue;const E=y<c.children.length-1&&c.children[y+1],w=m.indexOf(E==null?void 0:E.id)>=0;y===c.children.length-1||w||f(y)}},_forEachElementDown(m,f){const v=m.map(y=>({id:y,index:c.children.findIndex(E=>E.id===y)}));v.sort((y,E)=>y.index-E.index);for(const{index:y}of v){if(y==-1)continue;const E=y>0&&c.children[y-1],w=m.indexOf(E==null?void 0:E.id)>=0;y===0||w||f(y)}return!1}})).actions(c=>({clone(m={}){const f=c.toJSON();f.children.forEach(w=>{w.id=(0,t.nanoid)(10),(0,o.forEveryChild)(w,S=>{S.id=(0,t.nanoid)(10)})});const v=Object.assign(Object.assign(Object.assign({},f),{id:(0,t.nanoid)(10)}),m),y=c.store.addPage(v),E=c.store.pages.indexOf(c);y.setZIndex(E+1),y.select()},setZIndex(m){c.store.setPageZIndex(c.id,m)},set(m){Object.assign(c,m)},select(){c.store.selectPage(c.id)},addElement(m,{skipSelect:f=!1}={}){const v=o.TYPES_MAP[m.type];if(!v)return void console.error("Can not find model with type "+m.type);"children"in m&&Array.isArray(m.children)&&m.children.forEach(E=>{E.id=(0,t.nanoid)(10)});const y=v.create(Object.assign({id:(0,t.nanoid)(10)},m));return c.children.push(y),y.selectable&&!f&&c.store.selectElements([y.id]),y},canMoveElementsUp(m){let f=!1;return c._forEachElementUp(m,()=>{f=f||!0}),f},moveElementsUp(m){c._forEachElementUp(m,f=>{const v=c.children[f];(0,n.detach)(v),c.children.splice(f+1,0,v)})},canMoveElementsTop(m){return this.canMoveElementsUp(m)},moveElementsTop(m){const f=[],v=[];c.children.forEach(y=>{m.indexOf(y.id)>=0?f.push(y):v.push(y)}),c.children.replace(v.concat(f))},canMoveElementsDown(m){let f=!1;return c._forEachElementDown(m,()=>{f=f||!0}),f},moveElementsDown(m){c._forEachElementDown(m,f=>{const v=c.children[f];(0,n.detach)(v),c.children.splice(f-1,0,v)})},canMoveElementsBottom(m){return this.canMoveElementsDown(m)},moveElementsBottom(m){const f=[],v=[];c.children.forEach(y=>{m.indexOf(y.id)>=0?f.push(y):v.push(y)}),c.children.replace(f.concat(v))},setElementZIndex(m,f){const v=c.children.find(y=>y.id===m);v&&((0,n.detach)(v),c.children.remove(v),c.children.splice(f,0,v))},setSize({width:m,height:f,useMagic:v,softChange:y}){if(v){const E=[],w=A=>A.type==="image"&&A.x<1&&A.y<1&&A.width>=c.computedWidth-2&&A.height>=c.computedHeight-2;(0,o.forEveryChild)(c,A=>{A.type!=="group"&&(w(A)||E.push(A))});const S=E.length?(0,s.getTotalClientRect)(E):{x:0,y:0,width:c.computedWidth,height:c.computedHeight},x=1/4,_=Math.max(0,Math.min(S.x,c.computedWidth-S.x-S.width)),b=c.computedWidth*x,g=Math.max(0,_-b),h=Math.max(0,Math.min(S.y,c.computedHeight-S.y-S.height)),d=c.computedHeight*x,P=Math.max(0,h-d),M=c.computedWidth-2*g,T=c.computedHeight-2*P,I=m/M,F=f/T,k=Math.min(I,F),O=(m-M*k)/2-g*k,N=(f-T*k)/2-P*k;(0,o.forEveryChild)(c,A=>{A.type!=="group"&&(w(A)?A.set({x:A.x*k,y:A.y*k,width:A.width*I,height:A.height*F,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(A.set({x:O+A.x*k,y:N+A.y*k,width:A.width*k,height:A.height*k}),A.type==="text"?A.set({fontSize:A.fontSize*k}):A.type==="figure"&&A.set({strokeWidth:A.strokeWidth*k})))})}y||(c.width=m),y||(c.height=f)}})).actions(c=>({moveElementUp(m){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),c.moveElementsUp([m])},moveElementDown(m){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),c.moveElementsDown([m])},moveElementTop(m){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),c.moveElementsTop([m])},moveElementBottom(m){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),c.moveElementsBottom([m])},play(){c.store.play({startTime:c.startTime,endTime:c.startTime+c.duration})}}))}(L1)),L1}var N1={},$3;function RP(){return $3||($3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Audio=void 0;const n=Zi;e.Audio=n.types.model("Audio",{id:n.types.identifier,src:"",duration:0,startTime:0,endTime:1,volume:1,delay:0}).actions(t=>({toJSON:()=>Object.assign({},(0,n.getSnapshot)(t))})).actions(t=>({set(r){Object.assign(t,r)}}))}(N1)),N1}var W3;function tm(){return W3||(W3=1,function(e){var n,t=Oi&&Oi.__createBinding||(Object.create?function(k,O,N,A){A===void 0&&(A=N);var R=Object.getOwnPropertyDescriptor(O,N);R&&!("get"in R?!O.__esModule:R.writable||R.configurable)||(R={enumerable:!0,get:function(){return O[N]}}),Object.defineProperty(k,A,R)}:function(k,O,N,A){A===void 0&&(A=N),k[A]=O[N]}),r=Oi&&Oi.__setModuleDefault||(Object.create?function(k,O){Object.defineProperty(k,"default",{enumerable:!0,value:O})}:function(k,O){k.default=O}),a=Oi&&Oi.__importStar||(n=function(k){return n=Object.getOwnPropertyNames||function(O){var N=[];for(var A in O)Object.prototype.hasOwnProperty.call(O,A)&&(N[N.length]=A);return N},n(k)},function(k){if(k&&k.__esModule)return k;var O={};if(k!=null)for(var N=n(k),A=0;A<N.length;A++)N[A]!=="default"&&t(O,k,N[A]);return r(O,k),O}),o=Oi&&Oi.__rest||function(k,O){var N={};for(var A in k)Object.prototype.hasOwnProperty.call(k,A)&&O.indexOf(A)<0&&(N[A]=k[A]);if(k!=null&&typeof Object.getOwnPropertySymbols=="function"){var R=0;for(A=Object.getOwnPropertySymbols(k);R<A.length;R++)O.indexOf(A[R])<0&&Object.prototype.propertyIsEnumerable.call(k,A[R])&&(N[A[R]]=k[A[R]])}return N},s=Oi&&Oi.__importDefault||function(k){return k&&k.__esModule?k:{default:k}};Object.defineProperty(e,"__esModule",{value:!0}),e.Store=e.Font=void 0,e.createStore=F;const c=Zi,m=EP(),f=Yp,v=s(Mi()),y=xP(),E=OP(),w=PP(),S=Jv(),x=a(Vd()),_=Ks(),b=em(),g=i_(),h=CP(),d=AP(),P=TP(),M=o_(),T=Id(),I=RP();function F({key:k,showCredit:O}={key:"",showCredit:!1}){return e.Store.create({_forceShowCredit:O,_key:k})}(0,c.setLivelinessChecking)("ignore"),e.Font=c.types.model("Font",{fontFamily:c.types.string,url:c.types.optional(c.types.string,""),styles:c.types.frozen()}).preProcessSnapshot(k=>Object.assign(Object.assign({},k),{fontFamily:k.fontFamily||k.name})),e.Store=c.types.model("Store",{role:"",pages:c.types.array(M.Page),fonts:c.types.array(e.Font),audios:c.types.array(I.Audio),width:1080,height:1080,currentTime:0,isPlaying:!1,scale:1,scaleToFit:1,unit:"px",dpi:72,bleedVisible:!1,rulesVisible:!1,openedSidePanel:"",previousOpenedSidePanel:"",custom:c.types.frozen(),selectedElementsIds:c.types.array(c.types.string),animatedElementsIds:c.types.array(c.types.string),history:c.types.optional(m.UndoManager,{targetPath:"../pages"}),_elementsPixelRatio:Math.min(2,window.devicePixelRatio||1),_activePageId:"",_forceShowCredit:!1,_key:"",_validated:!1}).views(k=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),k.bleedVisible},get selectedElements(){return k.selectedElementsIds.map(O=>{for(const N of k.pages)for(const A of N.children)if(A.id===O)return A}).filter(O=>!!O)},get children(){return k.pages},get selectedShapes(){const O=[];return(0,T.forEveryChild)({children:k.selectedElements},N=>{N.type!=="group"&&O.push(N)}),O},get activePage(){return k.pages.slice().find(O=>O.id===k._activePageId)||(k.pages.length?k.pages[0]:null)},get duration(){let O=0;return k.pages.forEach(N=>{O+=N.duration}),O},get _hasCroppedImages(){return k.find(O=>O.type==="image"&&O._cropModeEnabled)},find(O){let N;return(0,T.forEveryChild)({children:k.pages},A=>{if(!N&&O(A))return N=A,!0}),N},getElementById:O=>k.find(N=>N.id===O)})).actions(k=>{let O=0,N=null,A=!1;return{afterCreate(){k.history.canUndo},setCurrentTime(R){k.currentTime=R},_togglePlaying(R=!k.isPlaying){k.isPlaying=R},play({animatedElementsIds:R=[],startTime:L=0,currentTime:V=0,endTime:G=k.duration,repeat:W=!1}={}){V&&(console.warn("currentTime property of store.play() is deprecated. Please use startTime instead."),L=V),k.animatedElementsIds=(0,c.cast)(R),k.currentTime=L,k.isPlaying=!0,O=Date.now(),N=G,A=W,requestAnimationFrame(k.seek)},checkActivePage(){let R=0;for(const L of k.pages){if(k.currentTime>=L.startTime&&k.currentTime<L.startTime+L.duration){k.selectPage(L.id);break}R+=L.duration}},seek(){if(!k.isPlaying)return;const R=Date.now(),L=R-O;O=R,k.currentTime+=L,k.checkActivePage();const V=N||k.duration;k.isPlaying&&k.currentTime<V?requestAnimationFrame(k.seek):k.isPlaying&&A?(k.currentTime=0,requestAnimationFrame(k.seek)):k.stop()},stop(){k.isPlaying=!1,k.currentTime=0,k.animatedElementsIds=(0,c.cast)([]),k.checkActivePage()}}}).actions(k=>({__(){k._validated||((0,S.validateKey)(k._key,k._forceShowCredit),k._validated=!0)},set(O){Object.assign(k,O)},setUnit({unit:O,dpi:N}){k.unit=O||k.unit,k.dpi=N||k.dpi},setRole(O){k.role=O},addPage(O){const N=M.Page.create(Object.assign({id:(0,f.nanoid)(10)},O));return k.pages.push(N),k._activePageId=N.id,N},selectPage(O){k._activePageId=O},selectElements(O){const N=O.map(A=>k.getElementById(A)).sort((A,R)=>A.page.children.indexOf(A)-A.page.children.indexOf(R)).filter(A=>!!A).map(A=>A.id);k.selectedElementsIds=(0,c.cast)(N)},toggleBleed(O){k.bleedVisible=O??!k.bleedVisible},toggleRulers(O){k.rulesVisible=O??!k.rulesVisible},openSidePanel(O){k.openedSidePanel!==O&&(k.previousOpenedSidePanel=k.openedSidePanel,k.openedSidePanel=O)},setScale(O){k.scale=O},_setScaleToFit(O){k.scaleToFit=O},setElementsPixelRatio(O){k._elementsPixelRatio=O},setSize(O,N,A){k.pages.forEach(R=>{R.setSize({width:O,height:N,useMagic:A,softChange:!0})}),k.width=O,k.height=N},setPageZIndex(O,N){const A=k.pages.find(R=>R.id===O);A&&((0,c.detach)(A),k.pages.remove(A),k.pages.splice(N,0,A))},deletePages(O){const N=k.pages.indexOf(k.activePage);O.forEach(L=>{const V=k.pages.find(G=>G.id===L);(0,c.destroy)(V)});const A=Math.min(k.pages.length-1,N),R=k.pages[A];R&&(k._activePageId=R.id),k.selectedElementsIds=(0,c.cast)(k.selectedElementsIds.filter(L=>k.getElementById(L)))},groupElements(O){const N=O.map(L=>k.getElementById(L));N.forEach(L=>{L&&(0,c.detach)(L)});const A=k.activePage,R={id:(0,f.nanoid)(10),children:N,type:"group"};return A.children.push(R),k.selectedElementsIds=(0,c.cast)([R.id]),A.children.find(L=>L.id===R.id)},ungroupElements(O){const N=O.map(R=>k.getElementById(R)),A=[];N.forEach(R=>{if(R&&R.type==="group"){const L=R.page,V=L.children.indexOf(R);R.children.forEach(G=>{A.push(G.id)}),R.children.forEach(G=>{(0,c.detach)(G),L.children.push(G)}),L.children.splice(V,1)}}),k.selectedElementsIds=(0,c.cast)(A)},deleteElements(O){const N=[];k.find(A=>(O.includes(A.id)&&N.push(A),!1)),N.forEach(A=>{(0,c.destroy)(A)}),k.selectedElementsIds=(0,c.cast)(k.selectedElementsIds.filter(A=>k.getElementById(A)))},on(O,N){if(O==="change"){let A=k.toJSON();return(0,c.onSnapshot)(k,R=>{const L=k.toJSON();!(0,g.deepEqual)(A,L)&&(A=L,N(L))})}},async _toCanvas({pixelRatio:O,ignoreBackground:N,pageId:A,mimeType:R,includeBleed:L,_skipTimeout:V,quickMode:G=!1}={}){var W;const X=O||1;A=A||((W=k.pages[0])===null||W===void 0?void 0:W.id);const q=k.pages.find(se=>se.id===A);if(!q)throw new Error(`No page for export with id ${A}`);G?q==null||q.set({_forceMount:!0}):q==null||q.set({_exporting:!0});const z=await(0,h.waitTillAvailable)(()=>v.default.stages.find(se=>se.getAttr("pageId")===A));if(!z)throw q==null||q.set({_forceMount:!1,_exporting:!1}),new Error(`Export is failed. Can not find stage for page ${A}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);const Y=!!z.findOne(".page-container"),U=k._elementsPixelRatio;X>k._elementsPixelRatio&&k.setElementsPixelRatio(X),await k.waitLoading({_skipTimeout:V});const ee=z.findOne(".page-container");if(!ee)throw k.setElementsPixelRatio(U),q==null||q.set({_forceMount:!1,_exporting:!1}),new Error(`Export is failed. Can't find page container. ${Y}`);const te=z.position();z.position({x:0,y:0}),z.find("Transformer").forEach(se=>{se.setAttr("oldVisible",se.visible()),se.visible(!1)}),ee.find(".page-background").forEach(se=>se.shadowEnabled(!1)),ee.find(".page-background").forEach(se=>se.strokeEnabled(!1)),ee.find(".highlighter").forEach(se=>se.visible(!1));const Q=ee.findOne(".page-background-group"),Z=Q.clip();Q.clip({x:null,y:null,width:null,height:null});const re=ee.findOne(".elements-container"),ne=re.clip();re.clip({x:null,y:null,width:null,height:null});const ae=ee.find(se=>se.getAttr("hideInExport"));ae.forEach(se=>{se.setAttr("oldVisible",se.visible()),se.hide()});const ue=ee.find(se=>!se.visible()&&se.getAttr("editModeEnabled"));ue.forEach(se=>{se.setAttr("oldVisible",se.visible()),se.show()}),N&&ee.find(".page-background").forEach(se=>se.hide());const fe=L?q.bleed:0;let pe=fe;!k.bleedVisible&&L||(k.bleedVisible||L?k.bleedVisible&&L?pe=0:k.bleedVisible&&!L&&(pe=-q.bleed):pe=0);const ye=document.createElement("canvas");ye.width=Math.round((q.computedWidth+2*fe)*X),ye.height=Math.round((q.computedHeight+2*fe)*X);const we=ye.getContext("2d");R==="image/jpeg"&&(we.fillStyle="white",we.fillRect(0,0,ye.width,ye.height));const je=ee.scale();ee.scale({x:1,y:1});const Te=ee.toCanvas({x:ee.x()-pe,y:ee.y()-pe,width:q.computedWidth+2*fe,height:q.computedHeight+2*fe,pixelRatio:X});return ee.scale(je),we.drawImage(Te,0,0,ye.width,ye.height),v.default.Util.releaseCanvas(Te),N&&ee.find(".page-background").forEach(se=>se.show()),ae.forEach(se=>{se.visible(se.getAttr("oldVisible"))}),ue.forEach(se=>{se.visible(se.getAttr("oldVisible"))}),ee.find(".page-background").forEach(se=>se.shadowEnabled(!0)),ee.find(".page-background").forEach(se=>se.strokeEnabled(!0)),z.find("Transformer").forEach(se=>{se.visible(se.getAttr("oldVisible"))}),ee.find(".highlighter").forEach(se=>se.visible(!0)),Q.clip(Z),re.clip(ne),z.position(te),k.setElementsPixelRatio(U),q==null||q.set({_exporting:!1,_forceMount:!1}),ye},async toDataURL(O={}){var{mimeType:N,quality:A}=O,R=o(O,["mimeType","quality"]);const L=await k._toCanvas(Object.assign({mimeType:N},R)),V=L.toDataURL(N,A);return v.default.Util.releaseCanvas(L),V},async toBlob(O={}){var{mimeType:N,quality:A}=O,R=o(O,["mimeType","quality"]);const L=await k._toCanvas(Object.assign({mimeType:N},R)),V=await new Promise(G=>{L.toBlob(G,N,A)});return v.default.Util.releaseCanvas(L),V},async saveAsImage(O={}){var{fileName:N}=O,A=o(O,["fileName"]);const R=A.mimeType||"image/png",L=R.split("/")[1];(0,y.downloadFile)(await k.toDataURL(A),N||"polotno."+L,R)},async _toPDF(O){const N=O.dpi||k.dpi,A=O.parallel||1,R=O.unit||(k.unit==="px"?"mm":k.unit),L=O.pixelRatio||1,V=O.pageIds||k.pages.map(ne=>ne.id),G=k.pages.filter(ne=>V.includes(ne.id)),W=await(0,E.getJsPDF)(),X=ne=>(0,b.pxToUnit)({px:ne,unit:R,dpi:N}),q=O.cropMarkSize||0,z=X(q),Y=G[0]||{},U=O.includeBleed?Y.bleed:0,ee=X(Y.computedWidth+2*U+2*z),te=X(Y.computedHeight+2*U+2*z);var Q=new W({unit:R,orientation:ee>te?"landscape":"portrait",format:[ee,te],compress:!0,putOnlyUsedFonts:!0});Q.deletePage(1);const Z=((ne,ae)=>{for(var ue=[],fe=0;fe<ne.length;fe+=ae)ue.push(ne.slice(fe,fe+ae));return ue})(G,A);let re=0;for(const ne of Z){const ae=ne.map(async ue=>{const fe=O.includeBleed?ue.bleed:0,pe=ue.computedWidth+2*fe+2*q,ye=ue.computedHeight+2*fe+2*q,we=X(pe),je=X(ye);let Te=0,se=L;for(;Te<10;){Te+=1,Te===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const _e=await k.toDataURL(Object.assign(Object.assign({},O),{pageId:ue.id,pixelRatio:se}));if(_e.length>20)return O.onProgress&&O.onProgress(++re/V.length*.9),{url:_e,width:we,height:je,widthPx:pe,heightPx:ye};se*=.8}});(await Promise.all(ae)).forEach(({url:ue,width:fe,height:pe,widthPx:ye,heightPx:we})=>{Q.addPage([fe,pe],fe>pe?"landscape":"portrait");const je=Q.getCurrentPageInfo();var Te;switch(R){case"pt":Te=1;break;case"mm":Te=72/25.4;break;case"cm":Te=72/2.54;break;case"in":Te=72;break;case"px":Te=.75;break;case"pc":case"em":Te=12;break;case"ex":Te=6;break;default:throw"Invalid unit: "+R}if(je.pageContext.cropBox={bottomLeftX:0,bottomLeftY:0,topRightX:fe*Te,topRightY:pe*Te},je.pageContext.artBox={bottomLeftX:X(q+U)*Te,bottomLeftY:X(q+U)*Te,topRightX:X(ye-q-U)*Te,topRightY:X(we-q-U)*Te},je.pageContext.bleedBox={bottomLeftX:X(q+U)*Te,bottomLeftY:X(q+U)*Te,topRightX:X(ye-q-U)*Te,topRightY:X(we-q-U)*Te},z){Q.setLineWidth(X(1));const se=z+X(U);Q.line(se,0,se,z),Q.line(0,se,z,se),Q.line(fe-se,0,fe-se,z),Q.line(fe,se,fe-z,se),Q.line(0,pe-se,z,pe-se),Q.line(se,pe,se,pe-z),Q.line(fe,pe-se,fe-z,pe-se),Q.line(fe-se,pe,fe-se,pe-z)}Q.addImage(ue,z,z,fe-2*z,pe-2*z,void 0,"FAST")})}return Q},toPDFDataURL:async O=>(await k._toPDF(Object.assign({mimeType:"image/jpeg"},O))).output("datauristring"),async toGIFDataURL(O={}){const N=O.pixelRatio||1,A=await(0,w.createGIF)({width:k.width*N,height:k.height*N}),R=1e3/(O.fps||10),L=k.duration/R;for(let V=0;V<L-1;V++){const G=V*R||1;k.setCurrentTime(G);let W=0,X="";for(const z of k.pages)if(W+=z.duration,z.set({_rendering:W>G}),W>G){X=z.id;break}const q=await k._toCanvas({pixelRatio:N,pageId:X,_skipTimeout:!0});A.addFrame(q.getContext("2d"),{delay:R,copy:!0})}for(const V of k.pages)V.set({_rendering:!1});return k.stop(),A.render(),new Promise(V=>{A.on("finished",function(G){(function(W,X){var q=new FileReader;q.onload=function(z){X(z.target.result)},q.readAsDataURL(W)})(G,V)})})},async saveAsGIF(O={}){var{fileName:N}=O,A=o(O,["fileName"]);const R=await k.toGIFDataURL(A);(0,y.downloadFile)(R,N||"polotno.gif")},async toHTML({elementHook:O}={elementHook:void 0}){const N=k.toJSON();return(0,d.jsonToHTML)({json:N,elementHook:O})},async saveAsHTML({fileName:O}={}){const N=await k.toHTML(),A="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(N)));(0,y.downloadFile)(A,O||"polotno.html")},async toSVG({elementHook:O,pageId:N}={elementHook:void 0,pageId:void 0}){var A;const R=k.toJSON();N=N||((A=R.pages[0])===null||A===void 0?void 0:A.id);const L=R.pages.find(V=>V.id===N);return(0,P.jsonToSVG)({json:Object.assign(Object.assign({},R),{pages:L?[L]:[]}),elementHook:O})},async saveAsSVG({fileName:O,elementHook:N,pageId:A}={}){const R=await k.toSVG({elementHook:N,pageId:A}),L="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(R)));(0,y.downloadFile)(L,O||"polotno.svg")},async saveAsPDF(O={}){var{fileName:N}=O,A=o(O,["fileName"]);(await k._toPDF(Object.assign({mimeType:"image/jpeg"},A))).save(N||"polotno.pdf")},async waitLoading({_skipTimeout:O=!1}={}){O||await new Promise(N=>setTimeout(N,50)),await(0,_.whenLoaded)()},toJSON:()=>({width:k.width,height:k.height,fonts:(0,c.getSnapshot)(k.fonts),pages:(0,c.getSnapshot)(k.pages),audios:(0,c.getSnapshot)(k.audios),unit:k.unit,dpi:k.dpi,custom:k.custom}),loadJSON(O,N=!1){var A;const R=Object.assign({},O),L=k.pages.indexOf(k.activePage);let V=(A=R.pages[L]||R.pages[0])===null||A===void 0?void 0:A.id;R._activePageId=V;const G=Object.assign({},(0,c.getSnapshot)(k));Object.assign(G,R),G.history=N?k.history.toJSON():{history:[],undoIdx:-1},(0,c.applySnapshot)(k,G)},clear({keepHistory:O=!1}={}){const N=k.pages.map(A=>A.id);k.deletePages(N),k.custom=null,O||k.history.clear()},addFont(O){k.removeFont(O.fontFamily),k.fonts.push(O),k.loadFont(O.fontFamily)},removeFont(O){k.fonts.filter(N=>N.fontFamily===O).forEach(N=>(0,c.destroy)(N))},addAudio(O){const N=I.Audio.create(Object.assign({id:(0,f.nanoid)(10)},O));k.audios.push(N)},removeAudio(O){const N=k.audios.find(A=>A.id===O);N&&k.audios.remove(N)},async loadFont(O){const N=k.fonts.find(R=>R.fontFamily===O)||x.globalFonts.find(R=>R.fontFamily===O);let A=[{fontStyle:"normal",fontWeight:"normal"}];return N?(N.styles&&(A=N.styles.map(R=>({fontStyle:R.fontStyle||"normal",fontWeight:R.fontWeight||"normal"}))),x.injectCustomFont(N)):x.injectGoogleFont(O),Promise.all(A.map(R=>x.loadFont(O,R.fontStyle,R.fontWeight)))},validate:O=>e.Store.validate(O,[{path:"",type:e.Store}]).map(N=>({path:"store"+N.context.map(A=>A.path).join("."),message:N.message}))})),e.default=F}(Oi)),Oi}var Y3;function l_(){return Y3||(Y3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Node=void 0;const n=Zi,t=Yp,r=tm(),a=o_(),o=Id();e.Node=n.types.model("Node",{id:n.types.identifier,type:"none",name:"",opacity:1,custom:n.types.frozen(),visible:!0,selectable:!0,removable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(s=>{for(var c in s)s[c]===null&&(s[c]=void 0);return s}).postProcessSnapshot(s=>{const c=Object.assign({},s),m={};for(var f in c)f[0]!=="_"&&(m[f]=s[f]);return m}).views(s=>({get locked(){return!(s.draggable||s.contentEditable||s.styleEditable||s.resizable)},get page(){return(0,n.getParentOfType)(s,a.Page)},get store(){return(0,n.getParentOfType)(s,r.Store)},get top(){let c=s;for(;;){if(!(0,n.hasParentOfType)(c,o.GroupElement))return c;c=(0,n.getParentOfType)(c,o.GroupElement)}},get parent(){return(0,n.hasParentOfType)(s,o.GroupElement)?(0,n.getParentOfType)(s,o.GroupElement):(0,n.hasParentOfType)(s,a.Page)?(0,n.getParentOfType)(s,a.Page):(0,n.hasParentOfType)(s,r.Store)?(0,n.getParentOfType)(s,r.Store):null},get zIndex(){return s.parent.children.indexOf(s)}})).actions(s=>({toJSON:()=>Object.assign({},(0,n.getSnapshot)(s))})).actions(s=>({clone(c={},{skipSelect:m=!1}={}){const f=JSON.parse(JSON.stringify(s.toJSON()));return c.id=c.id||(0,t.nanoid)(10),(0,o.forEveryChild)(f,v=>{v.id=(0,t.nanoid)(10)}),Object.assign(f,c),s.page.addElement(f,{skipSelect:m})},set(c){Object.assign(s,c)},moveUp(){s.page.moveElementsUp([s.id])},moveTop(){s.page.moveElementsTop([s.id])},moveDown(){s.page.moveElementsDown([s.id])},moveBottom(){s.page.moveElementsBottom([s.id])},setZIndex(c){s.parent.setElementZIndex(s.id,c)},beforeDestroy(){}}))}(E1)),E1}var I1={},j1={},K3;function MP(){return K3||(K3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.registerAnimation=e.animate=e.animations=void 0;const n=Ec(),t={right:{from:{x:-200},to:{x:0}},left:{from:{x:200},to:{x:0}},up:{from:{y:200},to:{y:0}},down:{from:{y:-200},to:{y:0}},"bottom-right":{from:{x:-200,y:-200},to:{x:0,y:0}},"bottom-left":{from:{x:200,y:-200},to:{x:0,y:0}},"top-right":{from:{x:-200,y:200},to:{x:0,y:0}},"top-left":{from:{x:200,y:200},to:{x:0,y:0}}},r={right:{cropX:-1},left:{cropX:1},up:{cropY:1},down:{cropY:-1}};e.animations={fade:({dTime:a,element:o,animation:s})=>{const c=a/s.duration;return s.type==="enter"?{opacity:c*o.opacity}:{opacity:(1-c)*o.opacity}},rotate:({dTime:a,element:o,animation:s})=>{const c=a/s.duration*360;return(0,n.rotateAroundCenter)({x:o.x,y:o.y,width:o.width,height:o.height,rotation:o.rotation},c)},blink:({dTime:a,element:o,animation:s})=>{const c=s.duration,m=a%c/(c/2),f=m<=1?m:2-m;return{opacity:o.opacity*f}},bounce:({dTime:a,element:o,animation:s})=>{var c;const m=s.duration,f=m/2,v=(c=s.data.strength)!==null&&c!==void 0?c:1,y={},E={x:o.x+o.width/3*v,y:o.y+o.height/3*v,width:o.width/3*v,height:o.height/3*v,fontSize:o.fontSize/3*v},w={x:o.x,y:o.y,width:o.width,height:o.height,fontSize:o.fontSize},S=a%m/f,x=S<=1?S:2-S;for(let _ in E){const b=E[_],g=w[_]-b;y[_]=b+x*g}return y},move:({dTime:a,element:o,animation:s})=>{var c;const m=t[s.data.direction]||t.right,f=(c=s.data.strength)!==null&&c!==void 0?c:1,v={};for(var y in m.from){let E=m.from[y],w=m.to[y];s.type==="exit"&&(E=m.to[y],w=-m.from[y]),E*=f,w*=f;const S=o[y]+E,x=o[y]+w-S;v[y]=S+a/s.duration*x}return v},zoom:({dTime:a,element:o,animation:s})=>{var c;const m={},f=1+(((s.data.direction||"in")==="in"?.75:1.25)-1)*((c=s.data.strength)!==null&&c!==void 0?c:1),v=o.rotation*Math.PI/180,y=Math.cos(v),E=Math.sin(v),w=o.width*(1-f),S=o.height*(1-f),x=(w*y-S*E)/2,_=(w*E+S*y)/2,b={x:o.x+x,y:o.y+_,width:o.width*f,height:o.height*f,fontSize:o.fontSize*f},g={x:o.x,y:o.y,width:o.width,height:o.height,fontSize:o.fontSize};for(var h in b){let d=b[h],P=g[h];if(s.type==="exit"){const T=d;d=P,P=T}const M=P-d;m[h]=d+a/s.duration*M}return m},cameraZoom:({dTime:a,element:o,animation:s})=>{var c,m,f;const v={},y=s.data.direction||"right",E=r[y]||r.right,w=(c=s.data.movementStrength)!==null&&c!==void 0?c:.1,S=(m=s.data.shakeStrength)!==null&&m!==void 0?m:.015;f=s.data.zoomStrength;const x=a/s.duration,_=S*(1-x),b=Math.sin(12*x)*_*.7+Math.sin(8*x)*_*.3;s.type==="exit"&&Math.max(o.cropWidth||1,o.cropHeight||1),s.type;const g=1-Math.pow(1-x,2),h=o.cropX||0,d=o.cropY||0,P=o.cropWidth||1,M=o.cropHeight||1,T=P,I=M;let F,k,O=0,N=0;if(E.cropX){const A=E.cropX>0?1-(h+P):h;O=Math.min(A,Math.abs(w))*E.cropX}if(E.cropY){const A=E.cropY>0?1-(d+M):d;N=Math.min(A,Math.abs(w))*E.cropY}return s.type==="enter"?(F=E.cropX?h+O*(1-g):h,k=E.cropY?d+N*(1-g):d):(F=E.cropX?h+O*g:h,k=E.cropY?d+N*g:d),v.cropX=Math.max(0,Math.min(1-T,F+b*T)),v.cropY=Math.max(0,Math.min(1-I,k+b*I)),v.cropWidth=T,v.cropHeight=I,v}},e.animate=({element:a,dTime:o,animation:s})=>{const c=e.animations[s.name];return c?c({element:a,dTime:o,animation:s}):(console.error("Can not find animation type: "+s.name),{})},e.registerAnimation=(a,o)=>{e.animations[a]&&console.warn(`Animation "${a}" already exists and will be overridden`),e.animations[a]=o}}(j1)),j1}var X3;function xc(){return X3||(X3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.ShapeFilter=e.getDiff=e.Animation=void 0;const n=Zi,t=MP(),r=Xi,a=l_();e.Animation=n.types.model("Animation",{delay:0,duration:500,enabled:!0,type:n.types.enumeration("Type",["enter","exit","loop"]),name:"none",data:n.types.frozen({})}),e.getDiff=(o,s)=>{const c={};for(const m in s)if(typeof o[m]=="number"&&typeof s[m]=="number"){const f=s[m]-o[m];f!==0&&(c[m]=f)}return c},e.ShapeFilter=n.types.model("ShapeFilter",{intensity:1}),e.Shape=a.Node.named("Shape").props({x:0,y:0,width:100,height:100,rotation:0,opacity:1,animations:n.types.array(e.Animation),blurEnabled:!1,blurRadius:10,brightnessEnabled:!1,brightness:0,sepiaEnabled:!1,grayscaleEnabled:!1,filters:n.types.map(e.ShapeFilter),shadowEnabled:!1,shadowBlur:5,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black",shadowOpacity:1,visible:!0,draggable:!0,resizable:!0,selectable:!0,contentEditable:!0,styleEditable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(o=>{const s=Object.assign(Object.assign({},o),{x:o.x||0,y:o.y||0,filters:Array.isArray(o.filters)?{}:o.filters});return"width"in o&&(s.width=s.width||1),"height"in o&&(s.height=s.height||1),o.locked&&(s.draggable=!1,s.contentEditable=!1,s.styleEditable=!1,s.resizable=!1,s.removable=!1),s}).views(o=>{const s=(0,r.observable)({x:o.x,y:o.y,width:o.width,height:o.height,rotation:o.rotation,opacity:o.opacity,color:o.color,fontSize:o.fontSize}),c=(0,r.action)(f=>{Object.assign(s,f)}),m=(0,r.action)(f=>{for(const v in f)typeof s[v]=="number"&&(s[v]=s[v]+f[v])});return{get a(){const{currentTime:f}=o.store;if(c({x:o.x,y:o.y,width:o.width,height:o.height,rotation:o.rotation,opacity:o.opacity,color:o.color,fontSize:o.fontSize,cropX:o.cropX,cropY:o.cropY,cropWidth:o.cropWidth,cropHeight:o.cropHeight}),f===0)return s;const v=f-o.page.startTime;if(v>o.page.duration||v<0)return s;const y=o.store.animatedElementsIds;if(y.length&&!y.includes(o.id))return s;const E=o.animations.find(b=>b.type==="enter"),w=(E==null?void 0:E.enabled)&&v<E.delay;w&&c({opacity:0});const S=(E==null?void 0:E.enabled)&&v>=E.delay&&v<=E.delay+E.duration;if(S){const b=v-E.delay,g=(0,t.animate)({element:o,animation:E,dTime:b}),h=(0,e.getDiff)(o,g);m(h)}const x=o.animations.find(b=>b.type==="exit");if(!w&&!S&&(x!=null&&x.enabled)&&v>=o.page.duration-x.duration-x.delay&&v<=o.page.duration-x.delay){const b=v-(o.page.duration-x.duration-x.delay),g=(0,t.animate)({element:o,animation:x,dTime:b}),h=(0,e.getDiff)(o,g);m(h)}x!=null&&x.enabled&&v>=o.page.duration-x.delay&&c({opacity:0});const _=o.animations.find(b=>b.type==="loop");if(_!=null&&_.enabled){const b=v,g=(0,t.animate)({element:o,animation:_,dTime:b}),h=(0,e.getDiff)(o,g);m(h)}return s},animated:f=>o.a[f]}}).actions(o=>({setAnimation(s,c){const m=o.animations.find(f=>f.type===s);m?Object.assign(m,c):o.animations.push(Object.assign({type:s},c))},setFilter(s,c){o.filters.clear(),c!==0&&o.filters.set(s,{intensity:c})}}))}(I1)),I1}var D1={},Z3;function LP(){return Z3||(Z3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=void 0;const n=Zi,t=xc();e.TextElement=t.Shape.named("Text").props({type:"text",text:"",placeholder:"",fontSize:14,fontFamily:"Roboto",fontStyle:"normal",fontWeight:"normal",textDecoration:"",fill:"black",align:"center",width:100,height:0,verticalAlign:"top",strokeWidth:0,stroke:"black",lineHeight:n.types.optional(n.types.union(n.types.number,n.types.string),1.2),letterSpacing:0,_editModeEnabled:!1,backgroundEnabled:!1,backgroundColor:"#7ED321",backgroundOpacity:1,backgroundCornerRadius:.5,backgroundPadding:.5}).preProcessSnapshot(r=>Object.assign({},r)).actions(r=>({toggleEditMode(a){r._editModeEnabled=a??!r._editModeEnabled,r._editModeEnabled?r.store.history.startTransaction():r.store.history.endTransaction()}}))}(D1)),D1}var F1={},Q3;function rm(){return Q3||(Q3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=void 0;const n=xc();e.ImageElement=n.Shape.named("Image").props({type:"image",width:100,height:100,src:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,cornerRadius:0,flipX:!1,flipY:!1,clipSrc:"",borderColor:"black",borderSize:0,keepRatio:!1,_cropModeEnabled:!1}).actions(t=>({toggleCropMode(r){t._cropModeEnabled=r??!t._cropModeEnabled,t._cropModeEnabled?t.store.history.startTransaction():t.store.history.endTransaction()},beforeDestroy(){t._cropModeEnabled&&t.store.history.endTransaction()}}))}(F1)),F1}var z1={},J3;function NP(){return J3||(J3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=void 0;const n=rm();e.VideoElement=n.ImageElement.named("Video").props({type:"video",duration:0,startTime:0,endTime:1,volume:1})}(z1)),z1}var B1={},e5;function IP(){return e5||(e5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0;const n=Zi,t=xc();e.LineElement=t.Shape.named("Line").props({type:"line",width:400,height:10,color:"black",dash:n.types.array(n.types.number),startHead:"",endHead:""}).actions(r=>({}))}(B1)),B1}var U1={},t5;function jP(){return t5||(t5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SVGElement=void 0;const n=Zi,t=xc();e.SVGElement=t.Shape.named("SVG").props({type:"svg",src:"",maskSrc:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,keepRatio:!0,flipX:!1,flipY:!1,width:100,height:100,borderColor:"black",borderSize:0,cornerRadius:0,colorsReplace:n.types.map(n.types.string)}).preProcessSnapshot(r=>Object.assign(Object.assign({},r),{src:r.src||r.svgSource,colorsReplace:Array.isArray(r.colorsReplace)?{}:r.colorsReplace})).actions(r=>({replaceColor(a,o){r.colorsReplace.set(a,o)}}))}(U1)),U1}var q1={},r5;function DP(){return r5||(r5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const n=Zi,t=xc();e.FigureElement=t.Shape.named("Figure").props({type:"figure",subType:"rect",fill:"rgb(0, 161, 255)",dash:n.types.array(n.types.number),strokeWidth:0,stroke:"rgba(98, 197, 255, 1)",cornerRadius:0})}(q1)),q1}var H1={},n5;function FP(){return n5||(n5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GifElement=void 0;const n=rm();e.GifElement=n.ImageElement.named("Gif").props({type:"gif",duration:0,keepRatio:!0})}(H1)),H1}var i5;function Id(){return i5||(i5=1,function(e){var n=Sd&&Sd.__rest||function(x,_){var b={};for(var g in x)Object.prototype.hasOwnProperty.call(x,g)&&_.indexOf(g)<0&&(b[g]=x[g]);if(x!=null&&typeof Object.getOwnPropertySymbols=="function"){var h=0;for(g=Object.getOwnPropertySymbols(x);h<g.length;h++)_.indexOf(g[h])<0&&Object.prototype.propertyIsEnumerable.call(x,g[h])&&(b[g[h]]=x[g[h]])}return b};Object.defineProperty(e,"__esModule",{value:!0}),e.TYPES_MAP=e.GroupElement=e.ElementTypes=e.forEveryChild=void 0,e.registerShapeModel=function(x,_){const b=x.type;if(!b)throw new Error('You must pass "type" attribute to custom model.');let g=o.Shape.named(b).props(x);_&&(g=_(g)),e.TYPES_MAP[b]=g,S.push(g)};const t=Zi,r=Yp,a=l_(),o=xc(),s=LP(),c=rm(),m=NP(),f=IP(),v=jP(),y=DP(),E=FP();e.forEveryChild=(x,_)=>{if(x.children)for(const b of x.children){if(_(b)===!0)break;(0,e.forEveryChild)(b,_)}};const w=[...new Array(20)].map((x,_)=>t.types.late(()=>S[_]));e.ElementTypes=t.types.union({dispatcher:x=>{const _=e.TYPES_MAP[x.type];if(!_)throw new Error(`Unknown element type: "${x.type}"`);return _}},v.SVGElement,s.TextElement,c.ImageElement,f.LineElement,m.VideoElement,y.FigureElement,E.GifElement,t.types.late(()=>e.GroupElement),...w),e.GroupElement=a.Node.named("Group").props({type:"group",children:t.types.array(e.ElementTypes)}).views(x=>({get draggable(){let _=!0;return(0,e.forEveryChild)(x,b=>{b.draggable||(_=!1)}),_},get resizable(){let _=!0;return(0,e.forEveryChild)(x,b=>{b.resizable||(_=!1)}),_},get contentEditable(){let _=!0;return(0,e.forEveryChild)(x,b=>{b.contentEditable||(_=!1)}),_},get styleEditable(){let _=!0;return(0,e.forEveryChild)(x,b=>{b.styleEditable||(_=!1)}),_},get locked(){let _=!0;return(0,e.forEveryChild)(x,b=>{b.locked||(_=!1)}),_}})).actions(x=>({set(_){var{draggable:b,contentEditable:g,styleEditable:h,resizable:d}=_,P=n(_,["draggable","contentEditable","styleEditable","resizable"]);b!==void 0&&(0,e.forEveryChild)(x,M=>{M.set({draggable:b})}),g!==void 0&&(0,e.forEveryChild)(x,M=>{M.set({contentEditable:g})}),h!==void 0&&(0,e.forEveryChild)(x,M=>{M.set({styleEditable:h})}),d!==void 0&&(0,e.forEveryChild)(x,M=>{M.set({resizable:d})}),Object.assign(x,P)},addElement(_,{skipSelect:b=!1}={}){const g=e.TYPES_MAP[_.type];if(!g)return void console.error("Can not find model with type "+_.type);_.children&&_.children.forEach(d=>{d.id=(0,r.nanoid)(10)});const h=g.create(Object.assign({id:(0,r.nanoid)(10)},_));return x.children.push(h),h.selectable&&!b&&x.store.selectElements([h.id]),h},setElementZIndex(_,b){const g=x.children.find(h=>h.id===_);g&&((0,t.detach)(g),x.children.remove(g),x.children.splice(b,0,g))}}));const S=[];e.TYPES_MAP={svg:v.SVGElement,text:s.TextElement,image:c.ImageElement,group:e.GroupElement,line:f.LineElement,video:m.VideoElement,figure:y.FigureElement,gif:E.GifElement}}(Sd)),Sd}var a5;function zP(){return a5||(a5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isClipboardEmpty=e.paste=e.cut=e.copy=void 0;const n=Id(),t=Ec();let r={data:[],pageId:""};const a="polotno_clipboard",o=(c,m)=>{r={data:JSON.parse(JSON.stringify(c)),pageId:m};try{localStorage.setItem(a,JSON.stringify(c)),localStorage.setItem(a+"_page",m)}catch{}},s=()=>{try{const c=localStorage.getItem(a),m=localStorage.getItem(a+"_page");if(c)return{data:JSON.parse(c),pageId:m}}catch{}return r};e.copy=c=>{var m;c.selectedElements.length!==0&&o(c.selectedElements.map(f=>f.toJSON()),(m=c.activePage)===null||m===void 0?void 0:m.id)},e.cut=c=>{var m;o(c.selectedElements.map(v=>v.toJSON()),(m=c.activePage)===null||m===void 0?void 0:m.id);let f=c.selectedElements.filter(v=>v.removable).map(v=>v.id);c.deleteElements(f)},e.paste=c=>{c.history.transaction(()=>{var m,f;let v=0,y=0;const{data:E,pageId:w}=s();if(w===((m=c.activePage)===null||m===void 0?void 0:m.id))v=c.width/20,y=c.height/20;else{const x=[];(0,n.forEveryChild)({children:E},b=>{b.type!=="group"&&x.push(b)});const _=(0,t.getTotalClientRect)(x);_.maxX>c.width&&(v=-_.minX),_.maxY>c.height&&(y=-_.minY)}const S=[];(0,n.forEveryChild)({children:E},x=>{delete x.id,x.type!=="group"&&(x.x+=v,x.y+=y)}),E.forEach(x=>{var _;const b=(_=c.activePage)===null||_===void 0?void 0:_.addElement(x);b&&S.push(b.id)}),o(E,(f=c.activePage)===null||f===void 0?void 0:f.id),c.selectElements(S)})},e.isClipboardEmpty=()=>s().data.length===0}(S1)),S1}var o5;function BP(){return o5||(o5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.handleHotkey=function(t,r){var a,o,s,c;if(((a=document.activeElement)===null||a===void 0?void 0:a.tagName)==="INPUT"||((o=document.activeElement)===null||o===void 0?void 0:o.tagName)==="TEXTAREA"||((s=document.activeElement)===null||s===void 0?void 0:s.contentEditable)==="true")return;const m=r.selectedElements.filter(y=>y.removable).map(y=>y.id);t.keyCode!==46&&t.keyCode!==8||r.deleteElements(m);const f=t.ctrlKey||t.metaKey,v=t.shiftKey;if(!f||v||t.key.toLowerCase()!=="z"&&t.key.toLowerCase()!=="y"||(t.preventDefault(),r.history.undo()),f&&v&&(t.key.toLowerCase()==="z"||t.key.toLowerCase()==="y")&&(t.preventDefault(),r.history.redo()),f&&t.code==="KeyA"){t.preventDefault();const y=(c=r.activePage)===null||c===void 0?void 0:c.children.filter(w=>w.selectable),E=(y==null?void 0:y.map(w=>w.id))||[];r.selectElements(E)}f&&t.code==="KeyC"&&(t.preventDefault(),(0,n.copy)(r)),f&&t.code==="KeyX"&&(t.preventDefault(),(0,n.cut)(r)),f&&t.code==="KeyV"&&(t.preventDefault(),(0,n.paste)(r)),t.code==="ArrowDown"&&(t.preventDefault(),r.selectedElements.forEach(y=>{y.draggable&&y.set({y:y.y+1})})),t.code==="ArrowUp"&&(t.preventDefault(),r.selectedElements.forEach(y=>{y.draggable&&y.set({y:y.y-1})})),t.code==="ArrowLeft"&&(t.preventDefault(),r.selectedElements.forEach(y=>{y.draggable&&y.set({x:y.x-1})})),t.code==="ArrowRight"&&(t.preventDefault(),r.selectedElements.forEach(y=>{y.draggable&&y.set({x:y.x+1})}))};const n=zP()}(_1)),_1}var G1={},l5;function UP(){return l5||(l5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t=e.getTranslations=e.setTranslations=void 0;const n=Xi,t=(0,n.observable)({toolbar:{duration:"Duration",opacity:"Opacity",effects:"Effects",blur:"Blur",textBackground:"Background",backgroundCornerRadius:"Corner radius",backgroundOpacity:"Opacity",backgroundPadding:"Padding",brightness:"Brightness",filters:"Filters",sepia:"Sepia",grayscale:"Grayscale",textStroke:"Text Stroke",shadow:"Shadow",border:"Border",cornerRadius:"Corner Radius",copyStyle:"Copy style",position:"Position",layering:"Layering",toForward:"To forward",up:"Up",down:"Down",toBottom:"To bottom",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom",flip:"Flip",flipHorizontally:"Flip horizontally",flipVertically:"Flip vertically",fitToBackground:"Fit to page",removeBackground:"Remove background",removeBackgroundTitle:"Remove background from image",cancelRemoveBackground:"Cancel",confirmRemoveBackground:"Confirm",crop:"Crop",cropDone:"Done",cropCancel:"Cancel",clip:"Apply mask",removeClip:"Remove mask",removeMask:"Remove mask",transparency:"Transparency",lockedDescription:"Object is locked. Unlock it to allow changes from canvas.",unlockedDescription:"Object is unlocked. Lock it to prevent changes from canvas.",removeElements:"Remove elements",duplicateElements:"Duplicate elements",download:"Download",saveAsImage:"Save as image",saveAsPDF:"Save as PDF",lineHeight:"Line height",letterSpacing:"Letter spacing",offsetX:"Offset X",offsetY:"Offset Y",color:"Color",selectable:"Selectable",draggable:"Draggable",removable:"Removable",resizable:"Resizable",contentEditable:"Can change content",styleEditable:"Can change style",alwaysOnTop:"Always on top",showInExport:"Show in export",ungroupElements:"Ungroup",groupElements:"Group",lineSize:"Line size",fade:"Fade",move:"Move",zoom:"Zoom",animate:"Animate",rotate:"Rotate",none:"None",bounce:"Bounce",blink:"Blink",strength:"Strength",spaceEvenly:"Space evenly",horizontalDistribution:"Horizontally",verticalDistribution:"Vertically",strokeWidth:"Stroke Width",colorPicker:{solid:"Solid",linear:"Linear"},aiText:{aiWrite:"AI write",rewrite:"Rewrite",shorten:"Shorten",continue:"Continue writing",proofread:"Proofread",tones:"Tones",friendly:"Friendly",professional:"Professional",humorous:"Humorous",formal:"Formal",customPrompt:"Custom prompt",generatedResult:"Generated result",cancel:"Cancel",generate:"Generate",back:"Back",tryAgain:"Try Again",insert:"Insert",promptPlaceholder:"Describe what you want to generate"}},workspace:{noPages:"There are no pages yet...",addPage:"Add page",removePage:"Remove page",duplicatePage:"Duplicate page",moveUp:"Move up",moveDown:"Move down"},scale:{reset:"Reset"},error:{removeBackground:"Ops! Something went wrong. Background can not be removed."},sidePanel:{templates:"Templates",searchTemplatesWithSameSize:"Show templates with the same size",searchPlaceholder:"Search...",otherFormats:"Other formats",noResults:"No results",error:"Loading is failed...",text:"Text",uploadFont:"Upload font",myFonts:"My fonts",photos:"Photos",videos:"Videos",animations:"Animations",effects:"Effects",elements:"Elements",shapes:"Shapes",lines:"Lines",upload:"Upload",uploadImage:"Add file",uploadTip:"Upload your assets",background:"Background",resize:"Resize",layers:"Layers",animate:"Animate",layerTypes:{image:"Image",text:"Text",svg:"SVG",line:"Line",figure:"Figure",group:"Group"},layersTip:"Elements on your active page:",noLayers:"No elements on the page...",namePlaceholder:"Type element name...",useMagicResize:"Use magic resize",clipImage:"Mask image",width:"Width",height:"Height",magicResizeDescription:"Magic resize will automatically resize and move all elements on the canvas",headerText:"Header",createHeader:"Create header",subHeaderText:"Sub Header",createSubHeader:"Create sub header",bodyText:"Body text",createBody:"Create body text"},pagesTimeline:{pages:"Pages",removePage:"Remove page",addPage:"Add page",duplicatePage:"Duplicate page",removeAudio:"Remove audio"},contextMenu:{duplicate:"Duplicate",remove:"Remove",lock:"Lock",unlock:"Unlock",copy:"Copy",paste:"Paste",copyStyle:"Copy style",moveUp:"Move up",moveDown:"Move down",moveBack:"Move back",moveForward:"Move forward"}}),r=c=>c&&typeof c=="object";function a(c,m){Object.keys(m).forEach(f=>{const v=c[f],y=m[f];r(y)&&r(v)?a(v,y):c[f]=y})}function o(c,m,f=""){Object.keys(m).forEach(v=>{const y=m[v],E=f?`${f}.${v}`:v;r(y)?r(c[v])?o(c[v],y,E):console.warn(`Missing nested translation object at '${E}'`):c[v]===void 0&&console.warn(`Missing translation '${E}'`)})}e.setTranslations=(0,n.action)((c,{validate:m=!1}={})=>{m&&o(c,t),a(t,c)}),e.getTranslations=()=>(0,n.toJS)(t);const s={};e.t=c=>{const m=function(y,E){var w,S=E.split("."),x=y;for(w=0;w<S.length;++w){if(x[S[w]]==null)return;x=x[S[w]]}return x}(t,c);if(m!==void 0)return m;s[c]||(s[c]=!0,console.warn(`Missing translation '${c}'`));const f=c.split("."),v=f[f.length-1]||" ";return v.charAt(0).toUpperCase()+v.slice(1)}}(G1)),G1}var s5;function qP(){return s5||(s5=1,function(e){var n=yf&&yf.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceCanvas=void 0;const t=n(Or()),r=Ri,a=n(vP()),o=mP(),s=yP(),c=BP(),m=UP(),f=({store:y})=>t.default.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},t.default.createElement("p",null,(0,m.t)("workspace.noPages")),t.default.createElement("button",{onClick:()=>{y.addPage()}},(0,m.t)("workspace.addPage"))),v=({width:y,height:E,xPadding:w,yPadding:S,backgroundColor:x})=>t.default.createElement("div",{style:{width:y+"px",height:E+"px",backgroundColor:x,paddingLeft:w+"px",paddingRight:w+"px",paddingTop:S+"px",paddingBottom:S+"px"}},t.default.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}}));e.WorkspaceCanvas=(0,r.observer)(({store:y,pageControlsEnabled:E,backgroundColor:w,pageBorderColor:S,activePageBorderColor:x,bleedColor:_,components:b,onKeyDown:g,paddingX:h,paddingY:d,altCloneEnabled:P=!0,visiblePagesOffset:M,renderOnlyActivePage:T})=>{var I;const F=h??20,k=d??55,[O,N]=t.default.useState({width:100,height:100}),A=t.default.useRef(O),R=t.default.useRef(null),L=t.default.useRef(null),V=y.bleedVisible?Math.max(0,...y.pages.map(ye=>ye.bleed)):0,G=Math.max(...y.pages.map(ye=>ye.computedWidth)),W=Math.max(...y.pages.map(ye=>ye.computedHeight)),X=((I=y.activePage)===null||I===void 0?void 0:I.computedHeight)||0,q=G+2*V,z=(T?X:W)+2*V,Y=async({skipTimeout:ye}={skipTimeout:!1})=>{if(ye||await new Promise(oe=>setTimeout(oe,50)),R.current===null)return;const we=R.current.getBoundingClientRect();we.width!==0&&we.height!==0||(console.warn(`Polotno warning: <Workspace /> component can not automatically detect its size.
327
- Width or height of parent elements is equal 0.
328
- Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
329
- For simpler debugging here is the log of the parent element:`),console.log(R.current));const je=L.current.clientWidth||we.width,Te={width:je,height:we.height};(A.current.width!==Te.width||A.current.height!==Te.height)&&(N(Te),A.current=Te);const se=(je-2*F)/q,_e=y.pages.length>1?3.1:2,he=(we.height-k*_e)/z,xe=Math.max(Math.min(se,he),.01);y.scaleToFit!==xe&&(y.setScale(xe),y._setScaleToFit(xe))};t.default.useLayoutEffect(()=>{Y({skipTimeout:!0})},[]),t.default.useEffect(()=>{Y()},[q,z]),t.default.useEffect(()=>{y.__()},[]),t.default.useEffect(()=>{const ye=R.current;if(window.ResizeObserver){const we=new ResizeObserver(()=>{Y({skipTimeout:!0})});return we.observe(ye),()=>we.unobserve(ye)}{const we=setInterval(()=>{Y({skipTimeout:!0})},100);return()=>clearInterval(we)}},[q,z]);const U=Math.max(F,(O.width-q*y.scale)/2),ee=T?1:y.pages.length,te=z*y.scale*ee,Q=Math.max(k,(O.height-te)/ee/2);t.default.useEffect(()=>{const ye=we=>{(g||c.handleHotkey)(we,y)};return window.addEventListener("keydown",ye),()=>window.removeEventListener("keydown",ye)},[]),t.default.useEffect(()=>{var ye;const we=je=>{if(je.ctrlKey||je.metaKey){je.preventDefault();const he=Math.max(3,y.scaleToFit),xe=Math.min(.1,y.scaleToFit),oe=(Te=je.deltaY<0?1.02*y.scale:y.scale/1.02,se=xe,_e=he,Math.max(se,Math.min(_e,Te)));y.setScale(oe)}else var Te,se,_e};return(ye=L.current)===null||ye===void 0||ye.addEventListener("wheel",we),()=>{var je;return(je=L.current)===null||je===void 0?void 0:je.removeEventListener("wheel",we)}},[]);const Z=t.default.useRef(!1);((ye,we,je,Te,se,_e)=>{const he=t.default.useRef({width:we,height:je}),xe=t.default.useRef({top:0,left:0}),oe=t.default.useRef(!1),ve=t.default.useRef(se.pages.length);oe.current=ve.current!==se.pages.length,ve.current=se.pages.length,t.default.useEffect(()=>{const de=ye.current,ke=Be=>{xe.current={top:de.scrollTop,left:de.scrollLeft}};return de.addEventListener("scroll",ke),()=>{de.removeEventListener("scroll",ke)}},[]),t.default.useLayoutEffect(()=>{if(!ye.current||oe.current)return;const de=ye.current,ke=(xe.current.left+de.offsetWidth/2)/he.current.width,Be=(xe.current.top+de.offsetHeight/2)/he.current.height;_e.current=!0,de.scrollLeft=ke*we-de.offsetWidth/2,de.scrollTop=Be*je-de.offsetHeight/2,he.current={width:we,height:je}},[Te,we,je])})(L,q*y.scale+2*U,z*y.scale+2*Q,y.scale,y,Z);const{handleScroll:re}=((ye,we,je,Te,se,_e)=>{const he=t.default.useRef(!1),xe=t.default.useRef(null),oe=t.default.useRef(!1);t.default.useEffect(()=>{const de=ye.current,ke=()=>{se.current};return de.addEventListener("scroll",ke),()=>{de.removeEventListener("scroll",ke)}},[]);const ve=je.pages.indexOf(je.activePage);return t.default.useLayoutEffect(()=>{if(!je.activePage||!ye.current||he.current)return;const de=ye.current,ke=je.pages.indexOf(je.activePage)*we;let Be=()=>{};return(Math.abs(ke-de.scrollTop)>.5*we||oe.current)&&(oe.current=!0,Be=(({element:Qe,scrollTop:Ke=0,duration:St=300,onFinish:Ue=()=>{}})=>{const rt=Qe.scrollTop,gt=Ke-rt;let mt=0,kt=!1;if(St===0)return Qe.scrollTop=Ke,()=>{};const jt=()=>{if(kt)return;mt+=20;const Se=Oe(mt,rt,gt,St);Qe.scrollTop=Se,mt<St?setTimeout(jt,20):Ue()},Oe=(Se,yt,Fe,qe)=>(Se/=qe/2)<1?Fe/2*Se*Se+yt:-Fe/2*(--Se*(Se-2)-1)+yt;return jt(),()=>{kt=!0}})({element:de,scrollTop:ke,onFinish:()=>{oe.current=!1},duration:je.isPlaying?0:300})),Be},[je.activePage,ve,je.isPlaying]),{handleScroll:de=>{if(_e||oe.current)return;he.current=!0,clearTimeout(xe.current),xe.current=setTimeout(()=>{he.current=!1},300);const ke=de.currentTarget.childNodes[0].offsetHeight,Be=de.currentTarget.scrollTop,Qe=Math.floor((Be+Te.height/3)/ke),Ke=je.pages[Qe];Ke&&je.activePage!==Ke&&Ke.select()}}})(L,z*y.scale+2*Q,y,O,Z,T),ne=O.width>=q*y.scale+2*U,ae=w||"rgba(232, 232, 232, 0.9)",ue=y.pages.indexOf(y.activePage),fe=(b==null?void 0:b.NoPages)||f,pe=M??Math.min(3,Math.max(1,Math.ceil(O.height/2/(z*y.scale))));return t.default.createElement("div",{ref:R,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:ae,overflow:"hidden"},tabIndex:0,className:"polotno-workspace-container"},t.default.createElement("div",{ref:L,onScroll:re,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:ne?"hidden":"auto"},className:"polotno-workspace-inner"},y.pages.map((ye,we)=>{const je=ye===y.activePage;if(T&&!je&&!ye._exportingOrRendering&&!ye._forceMount)return null;if(!(Math.abs(we-ue)<=pe||ye._exportingOrRendering||ye._forceMount))return t.default.createElement(v,{key:ye.id,width:q*y.scale+2*U,height:z*y.scale+2*Q,backgroundColor:ae,xPadding:U,yPadding:Q});const Te=t.default.createElement(a.default,{key:ye.id,page:ye,xPadding:U,yPadding:Q,width:q*y.scale+2*U,height:z*y.scale+2*Q,store:y,pageControlsEnabled:E,backColor:ae,pageBorderColor:S||"lightgrey",activePageBorderColor:x||"rgb(0, 161, 255)",altCloneEnabled:P,bleedColor:_||"rgba(255, 0, 0, 0.1)",components:b,viewportSize:O});return(ye._exportingOrRendering||ye._forceMount)&&!je&&T?t.default.createElement("div",{style:{display:"none"},key:ye.id},Te):Te}),y.rulesVisible&&t.default.createElement(o.TopRules,{store:y,xPadding:U,yPadding:Q,width:q*y.scale+2*U,height:z*y.scale+2*Q}),y.pages.length===0&&t.default.createElement(fe,{store:y}),y.audios.map(ye=>t.default.createElement(s.AudioElement,{key:ye.id,audio:ye,store:y}))))}),e.default=e.WorkspaceCanvas}(yf)),yf}var HP=qP(),GP=tm(),VP=Ys(),xd=Jl(),V1=Ks(),$P=Vd();VP.toggleFadeInAnimation(!1);xd.setTextOverflow("change-font-size");const WP=new URLSearchParams(location.search).get("key"),s_=GP.createStore({key:WP});window.store=s_;window.config={addGlobalFont:$P.addGlobalFont,unstable_useHtmlTextRender:xd.useHtmlTextRender,unstable_setTextVerticalResizeEnabled:xd.setTextVerticalResizeEnabled,unstable_setTextOverflow:xd.setTextOverflow,onLoadError:V1.onLoadError,setAssetLoadTimeout:V1.setAssetLoadTimeout,setFontLoadTimeout:V1.setFontLoadTimeout,unstable_setTextSplitAllowed:xd.setTextSplitAllowed};const YP=c5.createRoot(document.getElementById("root"));YP.render(Gt.createElement(HP.WorkspaceCanvas,{visiblePagesOffset:0,renderOnlyActivePage:!0,store:s_,components:{PageControls:()=>null,Tooltip:()=>null}}));