polotno-node 2.11.4 → 2.11.6

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,321 +0,0 @@
1
- (function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const s of l.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function t(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function n(a){if(a.ep)return;a.ep=!0;const l=t(a);fetch(a.href,l)}})();var ic=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Xl(e){if(e.__esModule)return e;var i=e.default;if(typeof i=="function"){var t=function n(){return this instanceof n?Reflect.construct(i,arguments,this.constructor):i.apply(this,arguments)};t.prototype=i.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}),t}var E0={exports:{}},jt={};/**
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 gm;function X_(){if(gm)return jt;gm=1;var e=Symbol.for("react.element"),i=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),w=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),E=Symbol.iterator;function O(N){return N===null||typeof N!="object"?null:(N=E&&N[E]||N["@@iterator"],typeof N=="function"?N:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,p={};function h(N,U,$){this.props=N,this.context=U,this.refs=p,this.updater=$||v}h.prototype.isReactComponent={},h.prototype.setState=function(N,U){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,U,"setState")},h.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function P(){}P.prototype=h.prototype;function g(N,U,$){this.props=N,this.context=U,this.refs=p,this.updater=$||v}var y=g.prototype=new P;y.constructor=g,S(y,h.prototype),y.isPureReactComponent=!0;var b=Array.isArray,x=Object.prototype.hasOwnProperty,M={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function j(N,U,$){var ee,G={},Z=null,W=null;if(U!=null)for(ee in U.ref!==void 0&&(W=U.ref),U.key!==void 0&&(Z=""+U.key),U)x.call(U,ee)&&!T.hasOwnProperty(ee)&&(G[ee]=U[ee]);var te=arguments.length-2;if(te===1)G.children=$;else if(1<te){for(var re=Array(te),ie=0;ie<te;ie++)re[ie]=arguments[ie+2];G.children=re}if(N&&N.defaultProps)for(ee in te=N.defaultProps,te)G[ee]===void 0&&(G[ee]=te[ee]);return{$$typeof:e,type:N,key:Z,ref:W,props:G,_owner:M.current}}function I(N,U){return{$$typeof:e,type:N.type,key:U,ref:N.ref,props:N.props,_owner:N._owner}}function m(N){return typeof N=="object"&&N!==null&&N.$$typeof===e}function A(N){var U={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function($){return U[$]})}var L=/\/+/g;function k(N,U){return typeof N=="object"&&N!==null&&N.key!=null?A(""+N.key):U.toString(36)}function R(N,U,$,ee,G){var Z=typeof N;(Z==="undefined"||Z==="boolean")&&(N=null);var W=!1;if(N===null)W=!0;else switch(Z){case"string":case"number":W=!0;break;case"object":switch(N.$$typeof){case e:case i:W=!0}}if(W)return W=N,G=G(W),N=ee===""?"."+k(W,0):ee,b(G)?($="",N!=null&&($=N.replace(L,"$&/")+"/"),R(G,U,$,"",function(ie){return ie})):G!=null&&(m(G)&&(G=I(G,$+(!G.key||W&&W.key===G.key?"":(""+G.key).replace(L,"$&/")+"/")+N)),U.push(G)),1;if(W=0,ee=ee===""?".":ee+":",b(N))for(var te=0;te<N.length;te++){Z=N[te];var re=ee+k(Z,te);W+=R(Z,U,$,re,G)}else if(re=O(N),typeof re=="function")for(N=re.call(N),te=0;!(Z=N.next()).done;)Z=Z.value,re=ee+k(Z,te++),W+=R(Z,U,$,re,G);else if(Z==="object")throw U=String(N),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.");return W}function B(N,U,$){if(N==null)return N;var ee=[],G=0;return R(N,ee,"","",function(Z){return U.call($,Z,G++)}),ee}function X(N){if(N._status===-1){var U=N._result;U=U(),U.then(function($){(N._status===0||N._status===-1)&&(N._status=1,N._result=$)},function($){(N._status===0||N._status===-1)&&(N._status=2,N._result=$)}),N._status===-1&&(N._status=0,N._result=U)}if(N._status===1)return N._result.default;throw N._result}var Y={current:null},Q={transition:null},q={ReactCurrentDispatcher:Y,ReactCurrentBatchConfig:Q,ReactCurrentOwner:M};function z(){throw Error("act(...) is not supported in production builds of React.")}return jt.Children={map:B,forEach:function(N,U,$){B(N,function(){U.apply(this,arguments)},$)},count:function(N){var U=0;return B(N,function(){U++}),U},toArray:function(N){return B(N,function(U){return U})||[]},only:function(N){if(!m(N))throw Error("React.Children.only expected to receive a single React element child.");return N}},jt.Component=h,jt.Fragment=t,jt.Profiler=a,jt.PureComponent=g,jt.StrictMode=n,jt.Suspense=d,jt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=q,jt.act=z,jt.cloneElement=function(N,U,$){if(N==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+N+".");var ee=S({},N.props),G=N.key,Z=N.ref,W=N._owner;if(U!=null){if(U.ref!==void 0&&(Z=U.ref,W=M.current),U.key!==void 0&&(G=""+U.key),N.type&&N.type.defaultProps)var te=N.type.defaultProps;for(re in U)x.call(U,re)&&!T.hasOwnProperty(re)&&(ee[re]=U[re]===void 0&&te!==void 0?te[re]:U[re])}var re=arguments.length-2;if(re===1)ee.children=$;else if(1<re){te=Array(re);for(var ie=0;ie<re;ie++)te[ie]=arguments[ie+2];ee.children=te}return{$$typeof:e,type:N.type,key:G,ref:Z,props:ee,_owner:W}},jt.createContext=function(N){return N={$$typeof:s,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},N.Provider={$$typeof:l,_context:N},N.Consumer=N},jt.createElement=j,jt.createFactory=function(N){var U=j.bind(null,N);return U.type=N,U},jt.createRef=function(){return{current:null}},jt.forwardRef=function(N){return{$$typeof:c,render:N}},jt.isValidElement=m,jt.lazy=function(N){return{$$typeof:_,_payload:{_status:-1,_result:N},_init:X}},jt.memo=function(N,U){return{$$typeof:w,type:N,compare:U===void 0?null:U}},jt.startTransition=function(N){var U=Q.transition;Q.transition={};try{N()}finally{Q.transition=U}},jt.unstable_act=z,jt.useCallback=function(N,U){return Y.current.useCallback(N,U)},jt.useContext=function(N){return Y.current.useContext(N)},jt.useDebugValue=function(){},jt.useDeferredValue=function(N){return Y.current.useDeferredValue(N)},jt.useEffect=function(N,U){return Y.current.useEffect(N,U)},jt.useId=function(){return Y.current.useId()},jt.useImperativeHandle=function(N,U,$){return Y.current.useImperativeHandle(N,U,$)},jt.useInsertionEffect=function(N,U){return Y.current.useInsertionEffect(N,U)},jt.useLayoutEffect=function(N,U){return Y.current.useLayoutEffect(N,U)},jt.useMemo=function(N,U){return Y.current.useMemo(N,U)},jt.useReducer=function(N,U,$){return Y.current.useReducer(N,U,$)},jt.useRef=function(N){return Y.current.useRef(N)},jt.useState=function(N){return Y.current.useState(N)},jt.useSyncExternalStore=function(N,U,$){return Y.current.useSyncExternalStore(N,U,$)},jt.useTransition=function(){return Y.current.useTransition()},jt.version="18.3.1",jt}var vm;function Tn(){return vm||(vm=1,E0.exports=X_()),E0.exports}var xn=Tn();const qt=Rd(xn);var $h={},O0={exports:{}},pi={},x0={exports:{}},P0={};/**
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 mm;function Z_(){return mm||(mm=1,function(e){function i(Q,q){var z=Q.length;Q.push(q);e:for(;0<z;){var N=z-1>>>1,U=Q[N];if(0<a(U,q))Q[N]=q,Q[z]=U,z=N;else break e}}function t(Q){return Q.length===0?null:Q[0]}function n(Q){if(Q.length===0)return null;var q=Q[0],z=Q.pop();if(z!==q){Q[0]=z;e:for(var N=0,U=Q.length,$=U>>>1;N<$;){var ee=2*(N+1)-1,G=Q[ee],Z=ee+1,W=Q[Z];if(0>a(G,z))Z<U&&0>a(W,G)?(Q[N]=W,Q[Z]=z,N=Z):(Q[N]=G,Q[ee]=z,N=ee);else if(Z<U&&0>a(W,z))Q[N]=W,Q[Z]=z,N=Z;else break e}}return q}function a(Q,q){var z=Q.sortIndex-q.sortIndex;return z!==0?z:Q.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var s=Date,c=s.now();e.unstable_now=function(){return s.now()-c}}var d=[],w=[],_=1,E=null,O=3,v=!1,S=!1,p=!1,h=typeof setTimeout=="function"?setTimeout:null,P=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 y(Q){for(var q=t(w);q!==null;){if(q.callback===null)n(w);else if(q.startTime<=Q)n(w),q.sortIndex=q.expirationTime,i(d,q);else break;q=t(w)}}function b(Q){if(p=!1,y(Q),!S)if(t(d)!==null)S=!0,X(x);else{var q=t(w);q!==null&&Y(b,q.startTime-Q)}}function x(Q,q){S=!1,p&&(p=!1,P(j),j=-1),v=!0;var z=O;try{for(y(q),E=t(d);E!==null&&(!(E.expirationTime>q)||Q&&!A());){var N=E.callback;if(typeof N=="function"){E.callback=null,O=E.priorityLevel;var U=N(E.expirationTime<=q);q=e.unstable_now(),typeof U=="function"?E.callback=U:E===t(d)&&n(d),y(q)}else n(d);E=t(d)}if(E!==null)var $=!0;else{var ee=t(w);ee!==null&&Y(b,ee.startTime-q),$=!1}return $}finally{E=null,O=z,v=!1}}var M=!1,T=null,j=-1,I=5,m=-1;function A(){return!(e.unstable_now()-m<I)}function L(){if(T!==null){var Q=e.unstable_now();m=Q;var q=!0;try{q=T(!0,Q)}finally{q?k():(M=!1,T=null)}}else M=!1}var k;if(typeof g=="function")k=function(){g(L)};else if(typeof MessageChannel<"u"){var R=new MessageChannel,B=R.port2;R.port1.onmessage=L,k=function(){B.postMessage(null)}}else k=function(){h(L,0)};function X(Q){T=Q,M||(M=!0,k())}function Y(Q,q){j=h(function(){Q(e.unstable_now())},q)}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(Q){Q.callback=null},e.unstable_continueExecution=function(){S||v||(S=!0,X(x))},e.unstable_forceFrameRate=function(Q){0>Q||125<Q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<Q?Math.floor(1e3/Q):5},e.unstable_getCurrentPriorityLevel=function(){return O},e.unstable_getFirstCallbackNode=function(){return t(d)},e.unstable_next=function(Q){switch(O){case 1:case 2:case 3:var q=3;break;default:q=O}var z=O;O=q;try{return Q()}finally{O=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(Q,q){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var z=O;O=Q;try{return q()}finally{O=z}},e.unstable_scheduleCallback=function(Q,q,z){var N=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?N+z:N):z=N,Q){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=z+U,Q={id:_++,callback:q,priorityLevel:Q,startTime:z,expirationTime:U,sortIndex:-1},z>N?(Q.sortIndex=z,i(w,Q),t(d)===null&&Q===t(w)&&(p?(P(j),j=-1):p=!0,Y(b,z-N))):(Q.sortIndex=U,i(d,Q),S||v||(S=!0,X(x))),Q},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(Q){var q=O;return function(){var z=O;O=q;try{return Q.apply(this,arguments)}finally{O=z}}}}(P0)),P0}var ym;function $g(){return ym||(ym=1,x0.exports=Z_()),x0.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 bm;function Q_(){if(bm)return pi;bm=1;var e=Tn(),i=$g();function t(r){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+r,C=1;C<arguments.length;C++)o+="&args[]="+encodeURIComponent(arguments[C]);return"Minified React error #"+r+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,a={};function l(r,o){s(r,o),s(r+"Capture",o)}function s(r,o){for(a[r]=o,r=0;r<o.length;r++)n.add(o[r])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,w=/^[: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]*$/,_={},E={};function O(r){return d.call(E,r)?!0:d.call(_,r)?!1:w.test(r)?E[r]=!0:(_[r]=!0,!1)}function v(r,o,C,F){if(C!==null&&C.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return F?!1:C!==null?!C.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function S(r,o,C,F){if(o===null||typeof o>"u"||v(r,o,C,F))return!0;if(F)return!1;if(C!==null)switch(C.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function p(r,o,C,F,V,J,oe){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=F,this.attributeNamespace=V,this.mustUseProperty=C,this.propertyName=r,this.type=o,this.sanitizeURL=J,this.removeEmptyString=oe}var h={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){h[r]=new p(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var o=r[0];h[o]=new p(o,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){h[r]=new p(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){h[r]=new p(r,2,!1,r,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(r){h[r]=new p(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){h[r]=new p(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){h[r]=new p(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){h[r]=new p(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){h[r]=new p(r,5,!1,r.toLowerCase(),null,!1,!1)});var P=/[\-:]([a-z])/g;function g(r){return r[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(r){var o=r.replace(P,g);h[o]=new p(o,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var o=r.replace(P,g);h[o]=new p(o,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var o=r.replace(P,g);h[o]=new p(o,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){h[r]=new p(r,1,!1,r.toLowerCase(),null,!1,!1)}),h.xlinkHref=new p("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){h[r]=new p(r,1,!1,r.toLowerCase(),null,!0,!0)});function y(r,o,C,F){var V=h.hasOwnProperty(o)?h[o]:null;(V!==null?V.type!==0:F||!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(S(o,C,V,F)&&(C=null),F||V===null?O(o)&&(C===null?r.removeAttribute(o):r.setAttribute(o,""+C)):V.mustUseProperty?r[V.propertyName]=C===null?V.type===3?!1:"":C:(o=V.attributeName,F=V.attributeNamespace,C===null?r.removeAttribute(o):(V=V.type,C=V===3||V===4&&C===!0?"":""+C,F?r.setAttributeNS(F,o,C):r.setAttribute(o,C))))}var b=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,x=Symbol.for("react.element"),M=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),A=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),Y=Symbol.for("react.offscreen"),Q=Symbol.iterator;function q(r){return r===null||typeof r!="object"?null:(r=Q&&r[Q]||r["@@iterator"],typeof r=="function"?r:null)}var z=Object.assign,N;function U(r){if(N===void 0)try{throw Error()}catch(C){var o=C.stack.trim().match(/\n( *(at )?)/);N=o&&o[1]||""}return`
26
- `+N+r}var $=!1;function ee(r,o){if(!r||$)return"";$=!0;var C=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(o)if(o=function(){throw Error()},Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(Te){var F=Te}Reflect.construct(r,[],o)}else{try{o.call()}catch(Te){F=Te}r.call(o.prototype)}else{try{throw Error()}catch(Te){F=Te}r()}}catch(Te){if(Te&&F&&typeof Te.stack=="string"){for(var V=Te.stack.split(`
27
- `),J=F.stack.split(`
28
- `),oe=V.length-1,fe=J.length-1;1<=oe&&0<=fe&&V[oe]!==J[fe];)fe--;for(;1<=oe&&0<=fe;oe--,fe--)if(V[oe]!==J[fe]){if(oe!==1||fe!==1)do if(oe--,fe--,0>fe||V[oe]!==J[fe]){var ge=`
29
- `+V[oe].replace(" at new "," at ");return r.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",r.displayName)),ge}while(1<=oe&&0<=fe);break}}}finally{$=!1,Error.prepareStackTrace=C}return(r=r?r.displayName||r.name:"")?U(r):""}function G(r){switch(r.tag){case 5:return U(r.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 2:case 15:return r=ee(r.type,!1),r;case 11:return r=ee(r.type.render,!1),r;case 1:return r=ee(r.type,!0),r;default:return""}}function Z(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case T:return"Fragment";case M:return"Portal";case I:return"Profiler";case j:return"StrictMode";case k:return"Suspense";case R:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case A:return(r.displayName||"Context")+".Consumer";case m:return(r._context.displayName||"Context")+".Provider";case L:var o=r.render;return r=r.displayName,r||(r=o.displayName||o.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case B:return o=r.displayName||null,o!==null?o:Z(r.type)||"Memo";case X:o=r._payload,r=r._init;try{return Z(r(o))}catch{}}return null}function W(r){var o=r.type;switch(r.tag){case 24:return"Cache";case 9:return(o.displayName||"Context")+".Consumer";case 10:return(o._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=o.render,r=r.displayName||r.name||"",o.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return o;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Z(o);case 8:return o===j?"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 o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o}return null}function te(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function re(r){var o=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function ie(r){var o=re(r)?"checked":"value",C=Object.getOwnPropertyDescriptor(r.constructor.prototype,o),F=""+r[o];if(!r.hasOwnProperty(o)&&typeof C<"u"&&typeof C.get=="function"&&typeof C.set=="function"){var V=C.get,J=C.set;return Object.defineProperty(r,o,{configurable:!0,get:function(){return V.call(this)},set:function(oe){F=""+oe,J.call(this,oe)}}),Object.defineProperty(r,o,{enumerable:C.enumerable}),{getValue:function(){return F},setValue:function(oe){F=""+oe},stopTracking:function(){r._valueTracker=null,delete r[o]}}}}function ae(r){r._valueTracker||(r._valueTracker=ie(r))}function se(r){if(!r)return!1;var o=r._valueTracker;if(!o)return!0;var C=o.getValue(),F="";return r&&(F=re(r)?r.checked?"true":"false":r.value),r=F,r!==C?(o.setValue(r),!0):!1}function de(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function he(r,o){var C=o.checked;return z({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:C??r._wrapperState.initialChecked})}function Oe(r,o){var C=o.defaultValue==null?"":o.defaultValue,F=o.checked!=null?o.checked:o.defaultChecked;C=te(o.value!=null?o.value:C),r._wrapperState={initialChecked:F,initialValue:C,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function _e(r,o){o=o.checked,o!=null&&y(r,"checked",o,!1)}function Ae(r,o){_e(r,o);var C=te(o.value),F=o.type;if(C!=null)F==="number"?(C===0&&r.value===""||r.value!=C)&&(r.value=""+C):r.value!==""+C&&(r.value=""+C);else if(F==="submit"||F==="reset"){r.removeAttribute("value");return}o.hasOwnProperty("value")?pe(r,o.type,C):o.hasOwnProperty("defaultValue")&&pe(r,o.type,te(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(r.defaultChecked=!!o.defaultChecked)}function ce(r,o,C){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var F=o.type;if(!(F!=="submit"&&F!=="reset"||o.value!==void 0&&o.value!==null))return;o=""+r._wrapperState.initialValue,C||o===r.value||(r.value=o),r.defaultValue=o}C=r.name,C!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,C!==""&&(r.name=C)}function pe(r,o,C){(o!=="number"||de(r.ownerDocument)!==r)&&(C==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+C&&(r.defaultValue=""+C))}var Ce=Array.isArray;function Le(r,o,C,F){if(r=r.options,o){o={};for(var V=0;V<C.length;V++)o["$"+C[V]]=!0;for(C=0;C<r.length;C++)V=o.hasOwnProperty("$"+r[C].value),r[C].selected!==V&&(r[C].selected=V),V&&F&&(r[C].defaultSelected=!0)}else{for(C=""+te(C),o=null,V=0;V<r.length;V++){if(r[V].value===C){r[V].selected=!0,F&&(r[V].defaultSelected=!0);return}o!==null||r[V].disabled||(o=r[V])}o!==null&&(o.selected=!0)}}function ue(r,o){if(o.dangerouslySetInnerHTML!=null)throw Error(t(91));return z({},o,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function ve(r,o){var C=o.value;if(C==null){if(C=o.children,o=o.defaultValue,C!=null){if(o!=null)throw Error(t(92));if(Ce(C)){if(1<C.length)throw Error(t(93));C=C[0]}o=C}o==null&&(o=""),C=o}r._wrapperState={initialValue:te(C)}}function xe(r,o){var C=te(o.value),F=te(o.defaultValue);C!=null&&(C=""+C,C!==r.value&&(r.value=C),o.defaultValue==null&&r.defaultValue!==C&&(r.defaultValue=C)),F!=null&&(r.defaultValue=""+F)}function je(r){var o=r.textContent;o===r._wrapperState.initialValue&&o!==""&&o!==null&&(r.value=o)}function at(r){switch(r){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 ht(r,o){return r==null||r==="http://www.w3.org/1999/xhtml"?at(o):r==="http://www.w3.org/2000/svg"&&o==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var et,Ke=function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(o,C,F,V){MSApp.execUnsafeLocalFunction(function(){return r(o,C,F,V)})}:r}(function(r,o){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=o;else{for(et=et||document.createElement("div"),et.innerHTML="<svg>"+o.valueOf().toString()+"</svg>",o=et.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;o.firstChild;)r.appendChild(o.firstChild)}});function ze(r,o){if(o){var C=r.firstChild;if(C&&C===r.lastChild&&C.nodeType===3){C.nodeValue=o;return}}r.textContent=o}var Be={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},Ve=["Webkit","ms","Moz","O"];Object.keys(Be).forEach(function(r){Ve.forEach(function(o){o=o+r.charAt(0).toUpperCase()+r.substring(1),Be[o]=Be[r]})});function bt(r,o,C){return o==null||typeof o=="boolean"||o===""?"":C||typeof o!="number"||o===0||Be.hasOwnProperty(r)&&Be[r]?(""+o).trim():o+"px"}function Ct(r,o){r=r.style;for(var C in o)if(o.hasOwnProperty(C)){var F=C.indexOf("--")===0,V=bt(C,o[C],F);C==="float"&&(C="cssFloat"),F?r.setProperty(C,V):r[C]=V}}var we=z({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 Se(r,o){if(o){if(we[r]&&(o.children!=null||o.dangerouslySetInnerHTML!=null))throw Error(t(137,r));if(o.dangerouslySetInnerHTML!=null){if(o.children!=null)throw Error(t(60));if(typeof o.dangerouslySetInnerHTML!="object"||!("__html"in o.dangerouslySetInnerHTML))throw Error(t(61))}if(o.style!=null&&typeof o.style!="object")throw Error(t(62))}}function gt(r,o){if(r.indexOf("-")===-1)return typeof o.is=="string";switch(r){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 wt=null;function Pt(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var vt=null,Wt=null,pn=null;function Fe(r){if(r=_s(r)){if(typeof vt!="function")throw Error(t(280));var o=r.stateNode;o&&(o=Yn(o),vt(r.stateNode,r.type,o))}}function rt(r){Wt?pn?pn.push(r):pn=[r]:Wt=r}function ft(){if(Wt){var r=Wt,o=pn;if(pn=Wt=null,Fe(r),o)for(r=0;r<o.length;r++)Fe(o[r])}}function De(r,o){return r(o)}function Ie(){}var Me=!1;function Ye(r,o,C){if(Me)return r(o,C);Me=!0;try{return De(r,o,C)}finally{Me=!1,(Wt!==null||pn!==null)&&(Ie(),ft())}}function Mt(r,o){var C=r.stateNode;if(C===null)return null;var F=Yn(C);if(F===null)return null;C=F[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(F=!F.disabled)||(r=r.type,F=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!F;break e;default:r=!1}if(r)return null;if(C&&typeof C!="function")throw Error(t(231,o,typeof C));return C}var _t=!1;if(c)try{var Yt={};Object.defineProperty(Yt,"passive",{get:function(){_t=!0}}),window.addEventListener("test",Yt,Yt),window.removeEventListener("test",Yt,Yt)}catch{_t=!1}function wn(r,o,C,F,V,J,oe,fe,ge){var Te=Array.prototype.slice.call(arguments,3);try{o.apply(C,Te)}catch(qe){this.onError(qe)}}var Sn=!1,Qn=null,ii=!1,Sr=null,Ze={onError:function(r){Sn=!0,Qn=r}};function Et(r,o,C,F,V,J,oe,fe,ge){Sn=!1,Qn=null,wn.apply(Ze,arguments)}function Lt(r,o,C,F,V,J,oe,fe,ge){if(Et.apply(this,arguments),Sn){if(Sn){var Te=Qn;Sn=!1,Qn=null}else throw Error(t(198));ii||(ii=!0,Sr=Te)}}function Gt(r){var o=r,C=r;if(r.alternate)for(;o.return;)o=o.return;else{r=o;do o=r,o.flags&4098&&(C=o.return),r=o.return;while(r)}return o.tag===3?C:null}function Vt(r){if(r.tag===13){var o=r.memoizedState;if(o===null&&(r=r.alternate,r!==null&&(o=r.memoizedState)),o!==null)return o.dehydrated}return null}function Jn(r){if(Gt(r)!==r)throw Error(t(188))}function Gn(r){var o=r.alternate;if(!o){if(o=Gt(r),o===null)throw Error(t(188));return o!==r?null:r}for(var C=r,F=o;;){var V=C.return;if(V===null)break;var J=V.alternate;if(J===null){if(F=V.return,F!==null){C=F;continue}break}if(V.child===J.child){for(J=V.child;J;){if(J===C)return Jn(V),r;if(J===F)return Jn(V),o;J=J.sibling}throw Error(t(188))}if(C.return!==F.return)C=V,F=J;else{for(var oe=!1,fe=V.child;fe;){if(fe===C){oe=!0,C=V,F=J;break}if(fe===F){oe=!0,F=V,C=J;break}fe=fe.sibling}if(!oe){for(fe=J.child;fe;){if(fe===C){oe=!0,C=J,F=V;break}if(fe===F){oe=!0,F=J,C=V;break}fe=fe.sibling}if(!oe)throw Error(t(189))}}if(C.alternate!==F)throw Error(t(190))}if(C.tag!==3)throw Error(t(188));return C.stateNode.current===C?r:o}function En(r){return r=Gn(r),r!==null?oi(r):null}function oi(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var o=oi(r);if(o!==null)return o;r=r.sibling}return null}var Ir=i.unstable_scheduleCallback,Ii=i.unstable_cancelCallback,Io=i.unstable_shouldYield,rs=i.unstable_requestPaint,en=i.unstable_now,to=i.unstable_getCurrentPriorityLevel,Dr=i.unstable_ImmediatePriority,ha=i.unstable_UserBlockingPriority,no=i.unstable_NormalPriority,Vp=i.unstable_LowPriority,Qs=i.unstable_IdlePriority,ro=null,er=null;function cn(r){if(er&&typeof er.onCommitFiberRoot=="function")try{er.onCommitFiberRoot(ro,r,void 0,(r.current.flags&128)===128)}catch{}}var It=Math.clz32?Math.clz32:jr,Do=Math.log,fr=Math.LN2;function jr(r){return r>>>=0,r===0?32:31-(Do(r)/fr|0)|0}var Di=64,io=4194304;function Vn(r){switch(r&-r){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 r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function pa(r,o){var C=r.pendingLanes;if(C===0)return 0;var F=0,V=r.suspendedLanes,J=r.pingedLanes,oe=C&268435455;if(oe!==0){var fe=oe&~V;fe!==0?F=Vn(fe):(J&=oe,J!==0&&(F=Vn(J)))}else oe=C&~V,oe!==0?F=Vn(oe):J!==0&&(F=Vn(J));if(F===0)return 0;if(o!==0&&o!==F&&!(o&V)&&(V=F&-F,J=o&-o,V>=J||V===16&&(J&4194240)!==0))return o;if(F&4&&(F|=C&16),o=r.entangledLanes,o!==0)for(r=r.entanglements,o&=F;0<o;)C=31-It(o),V=1<<C,F|=r[C],o&=~V;return F}function Gd(r,o){switch(r){case 1:case 2:case 4:return o+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 o+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 Vd(r,o){for(var C=r.suspendedLanes,F=r.pingedLanes,V=r.expirationTimes,J=r.pendingLanes;0<J;){var oe=31-It(J),fe=1<<oe,ge=V[oe];ge===-1?(!(fe&C)||fe&F)&&(V[oe]=Gd(fe,o)):ge<=o&&(r.expiredLanes|=fe),J&=~fe}}function tl(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function Oc(){var r=Di;return Di<<=1,!(Di&4194240)&&(Di=64),r}function Gr(r){for(var o=[],C=0;31>C;C++)o.push(r);return o}function is(r,o,C){r.pendingLanes|=o,o!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,o=31-It(o),r[o]=C}function $p(r,o){var C=r.pendingLanes&~o;r.pendingLanes=o,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=o,r.mutableReadLanes&=o,r.entangledLanes&=o,o=r.entanglements;var F=r.eventTimes;for(r=r.expirationTimes;0<C;){var V=31-It(C),J=1<<V;o[V]=0,F[V]=-1,r[V]=-1,C&=~J}}function xc(r,o){var C=r.entangledLanes|=o;for(r=r.entanglements;C;){var F=31-It(C),V=1<<F;V&o|r[F]&o&&(r[F]|=o),C&=~V}}var Ht=0;function os(r){return r&=-r,1<r?4<r?r&268435455?16:536870912:4:1}var nl,rl,$d,Wd,Js,eu=!1,il=[],ai=null,jo=null,ji=null,Dt=new Map,ol=new Map,Fi=[],Yd="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 Kd(r,o){switch(r){case"focusin":case"focusout":ai=null;break;case"dragenter":case"dragleave":jo=null;break;case"mouseover":case"mouseout":ji=null;break;case"pointerover":case"pointerout":Dt.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":ol.delete(o.pointerId)}}function as(r,o,C,F,V,J){return r===null||r.nativeEvent!==J?(r={blockedOn:o,domEventName:C,eventSystemFlags:F,nativeEvent:J,targetContainers:[V]},o!==null&&(o=_s(o),o!==null&&rl(o)),r):(r.eventSystemFlags|=F,o=r.targetContainers,V!==null&&o.indexOf(V)===-1&&o.push(V),r)}function $n(r,o,C,F,V){switch(o){case"focusin":return ai=as(ai,r,o,C,F,V),!0;case"dragenter":return jo=as(jo,r,o,C,F,V),!0;case"mouseover":return ji=as(ji,r,o,C,F,V),!0;case"pointerover":var J=V.pointerId;return Dt.set(J,as(Dt.get(J)||null,r,o,C,F,V)),!0;case"gotpointercapture":return J=V.pointerId,ol.set(J,as(ol.get(J)||null,r,o,C,F,V)),!0}return!1}function tu(r){var o=Wo(r.target);if(o!==null){var C=Gt(o);if(C!==null){if(o=C.tag,o===13){if(o=Vt(C),o!==null){r.blockedOn=o,Js(r.priority,function(){$d(C)});return}}else if(o===3&&C.stateNode.current.memoizedState.isDehydrated){r.blockedOn=C.tag===3?C.stateNode.containerInfo:null;return}}}r.blockedOn=null}function nu(r){if(r.blockedOn!==null)return!1;for(var o=r.targetContainers;0<o.length;){var C=ou(r.domEventName,r.eventSystemFlags,o[0],r.nativeEvent);if(C===null){C=r.nativeEvent;var F=new C.constructor(C.type,C);wt=F,C.target.dispatchEvent(F),wt=null}else return o=_s(C),o!==null&&rl(o),r.blockedOn=C,!1;o.shift()}return!0}function ru(r,o,C){nu(r)&&C.delete(o)}function Wp(){eu=!1,ai!==null&&nu(ai)&&(ai=null),jo!==null&&nu(jo)&&(jo=null),ji!==null&&nu(ji)&&(ji=null),Dt.forEach(ru),ol.forEach(ru)}function Fo(r,o){r.blockedOn===o&&(r.blockedOn=null,eu||(eu=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Wp)))}function Fr(r){function o(V){return Fo(V,r)}if(0<il.length){Fo(il[0],r);for(var C=1;C<il.length;C++){var F=il[C];F.blockedOn===r&&(F.blockedOn=null)}}for(ai!==null&&Fo(ai,r),jo!==null&&Fo(jo,r),ji!==null&&Fo(ji,r),Dt.forEach(o),ol.forEach(o),C=0;C<Fi.length;C++)F=Fi[C],F.blockedOn===r&&(F.blockedOn=null);for(;0<Fi.length&&(C=Fi[0],C.blockedOn===null);)tu(C),C.blockedOn===null&&Fi.shift()}var al=b.ReactCurrentBatchConfig,iu=!0;function wi(r,o,C,F){var V=Ht,J=al.transition;al.transition=null;try{Ht=1,ll(r,o,C,F)}finally{Ht=V,al.transition=J}}function oo(r,o,C,F){var V=Ht,J=al.transition;al.transition=null;try{Ht=4,ll(r,o,C,F)}finally{Ht=V,al.transition=J}}function ll(r,o,C,F){if(iu){var V=ou(r,o,C,F);if(V===null)wu(r,o,F,sl,C),Kd(r,F);else if($n(V,r,o,C,F))F.stopPropagation();else if(Kd(r,F),o&4&&-1<Yd.indexOf(r)){for(;V!==null;){var J=_s(V);if(J!==null&&nl(J),J=ou(r,o,C,F),J===null&&wu(r,o,F,sl,C),J===V)break;V=J}V!==null&&F.stopPropagation()}else wu(r,o,F,null,C)}}var sl=null;function ou(r,o,C,F){if(sl=null,r=Pt(F),r=Wo(r),r!==null)if(o=Gt(r),o===null)r=null;else if(C=o.tag,C===13){if(r=Vt(o),r!==null)return r;r=null}else if(C===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;r=null}else o!==r&&(r=null);return sl=r,null}function Xd(r){switch(r){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(to()){case Dr:return 1;case ha:return 4;case no:case Vp:return 16;case Qs:return 536870912;default:return 16}default:return 16}}var tr=null,zo=null,ao=null;function ls(){if(ao)return ao;var r,o=zo,C=o.length,F,V="value"in tr?tr.value:tr.textContent,J=V.length;for(r=0;r<C&&o[r]===V[r];r++);var oe=C-r;for(F=1;F<=oe&&o[C-F]===V[J-F];F++);return ao=V.slice(r,1<F?1-F:void 0)}function ga(r){var o=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&o===13&&(r=13)):r=o,r===10&&(r=13),32<=r||r===13?r:0}function Er(){return!0}function Vr(){return!1}function Dn(r){function o(C,F,V,J,oe){this._reactName=C,this._targetInst=V,this.type=F,this.nativeEvent=J,this.target=oe,this.currentTarget=null;for(var fe in r)r.hasOwnProperty(fe)&&(C=r[fe],this[fe]=C?C(J):J[fe]);return this.isDefaultPrevented=(J.defaultPrevented!=null?J.defaultPrevented:J.returnValue===!1)?Er:Vr,this.isPropagationStopped=Vr,this}return z(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var C=this.nativeEvent;C&&(C.preventDefault?C.preventDefault():typeof C.returnValue!="unknown"&&(C.returnValue=!1),this.isDefaultPrevented=Er)},stopPropagation:function(){var C=this.nativeEvent;C&&(C.stopPropagation?C.stopPropagation():typeof C.cancelBubble!="unknown"&&(C.cancelBubble=!0),this.isPropagationStopped=Er)},persist:function(){},isPersistent:Er}),o}var zr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Si=Dn(zr),Ei=z({},zr,{view:0,detail:0}),Zd=Dn(Ei),ss,us,nr,Or=z({},Ei,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ma,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==nr&&(nr&&r.type==="mousemove"?(ss=r.screenX-nr.screenX,us=r.screenY-nr.screenY):us=ss=0,nr=r),ss)},movementY:function(r){return"movementY"in r?r.movementY:us}}),fn=Dn(Or),cs=z({},Or,{dataTransfer:0}),Oi=Dn(cs),Qd=z({},Ei,{relatedTarget:0}),au=Dn(Qd),Pc=z({},zr,{animationName:0,elapsedTime:0,pseudoElement:0}),Cc=Dn(Pc),Jd=z({},zr,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),lu=Dn(Jd),eh=z({},zr,{data:0}),va=Dn(eh),kc={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Yp={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"},su={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Kp(r){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(r):(r=su[r])?!!o[r]:!1}function ma(){return Kp}var uu=z({},Ei,{key:function(r){if(r.key){var o=kc[r.key]||r.key;if(o!=="Unidentified")return o}return r.type==="keypress"?(r=ga(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?Yp[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ma,charCode:function(r){return r.type==="keypress"?ga(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?ga(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),th=Dn(uu),nh=z({},Or,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ya=Dn(nh),rh=z({},Ei,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ma}),cu=Dn(rh),fu=z({},zr,{propertyName:0,elapsedTime:0,pseudoElement:0}),ul=Dn(fu),Ac=z({},Or,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),Tc=Dn(Ac),ih=[9,13,27,32],fs=c&&"CompositionEvent"in window,ba=null;c&&"documentMode"in document&&(ba=document.documentMode);var cl=c&&"TextEvent"in window&&!ba,$r=c&&(!fs||ba&&8<ba&&11>=ba),Bo=" ",du=!1;function Rc(r,o){switch(r){case"keyup":return ih.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xi(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Wr=!1;function Mc(r,o){switch(r){case"compositionend":return xi(o);case"keypress":return o.which!==32?null:(du=!0,Bo);case"textInput":return r=o.data,r===Bo&&du?null:r;default:return null}}function oh(r,o){if(Wr)return r==="compositionend"||!fs&&Rc(r,o)?(r=ls(),ao=zo=tr=null,Wr=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return $r&&o.locale!=="ko"?null:o.data;default:return null}}var lo={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 so(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o==="input"?!!lo[r.type]:o==="textarea"}function ds(r,o,C,F){rt(F),o=Su(o,"onChange"),0<o.length&&(C=new Si("onChange","change",null,C,F),r.push({event:C,listeners:o}))}var fl=null,Uo=null;function ah(r){Hc(r,0)}function qo(r){var o=Fn(r);if(se(o))return r}function li(r,o){if(r==="change")return o}var dl=!1;if(c){var Ho;if(c){var si="oninput"in document;if(!si){var hu=document.createElement("div");hu.setAttribute("oninput","return;"),si=typeof hu.oninput=="function"}Ho=si}else Ho=!1;dl=Ho&&(!document.documentMode||9<document.documentMode)}function _a(){fl&&(fl.detachEvent("onpropertychange",Lc),Uo=fl=null)}function Lc(r){if(r.propertyName==="value"&&qo(Uo)){var o=[];ds(o,Uo,r,Pt(r)),Ye(ah,o)}}function Nc(r,o,C){r==="focusin"?(_a(),fl=o,Uo=C,fl.attachEvent("onpropertychange",Lc)):r==="focusout"&&_a()}function On(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return qo(Uo)}function pu(r,o){if(r==="click")return qo(o)}function Ic(r,o){if(r==="input"||r==="change")return qo(o)}function Dc(r,o){return r===o&&(r!==0||1/r===1/o)||r!==r&&o!==o}var Br=typeof Object.is=="function"?Object.is:Dc;function wa(r,o){if(Br(r,o))return!0;if(typeof r!="object"||r===null||typeof o!="object"||o===null)return!1;var C=Object.keys(r),F=Object.keys(o);if(C.length!==F.length)return!1;for(F=0;F<C.length;F++){var V=C[F];if(!d.call(o,V)||!Br(r[V],o[V]))return!1}return!0}function Go(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function gn(r,o){var C=Go(r);r=0;for(var F;C;){if(C.nodeType===3){if(F=r+C.textContent.length,r<=o&&F>=o)return{node:C,offset:o-r};r=F}e:{for(;C;){if(C.nextSibling){C=C.nextSibling;break e}C=C.parentNode}C=void 0}C=Go(C)}}function Rn(r,o){return r&&o?r===o?!0:r&&r.nodeType===3?!1:o&&o.nodeType===3?Rn(r,o.parentNode):"contains"in r?r.contains(o):r.compareDocumentPosition?!!(r.compareDocumentPosition(o)&16):!1:!1}function jn(){for(var r=window,o=de();o instanceof r.HTMLIFrameElement;){try{var C=typeof o.contentWindow.location.href=="string"}catch{C=!1}if(C)r=o.contentWindow;else break;o=de(r.document)}return o}function hl(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o&&(o==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||o==="textarea"||r.contentEditable==="true")}function hs(r){var o=jn(),C=r.focusedElem,F=r.selectionRange;if(o!==C&&C&&C.ownerDocument&&Rn(C.ownerDocument.documentElement,C)){if(F!==null&&hl(C)){if(o=F.start,r=F.end,r===void 0&&(r=o),"selectionStart"in C)C.selectionStart=o,C.selectionEnd=Math.min(r,C.value.length);else if(r=(o=C.ownerDocument||document)&&o.defaultView||window,r.getSelection){r=r.getSelection();var V=C.textContent.length,J=Math.min(F.start,V);F=F.end===void 0?J:Math.min(F.end,V),!r.extend&&J>F&&(V=F,F=J,J=V),V=gn(C,J);var oe=gn(C,F);V&&oe&&(r.rangeCount!==1||r.anchorNode!==V.node||r.anchorOffset!==V.offset||r.focusNode!==oe.node||r.focusOffset!==oe.offset)&&(o=o.createRange(),o.setStart(V.node,V.offset),r.removeAllRanges(),J>F?(r.addRange(o),r.extend(oe.node,oe.offset)):(o.setEnd(oe.node,oe.offset),r.addRange(o)))}}for(o=[],r=C;r=r.parentNode;)r.nodeType===1&&o.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<o.length;C++)r=o[C],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}}var ps=c&&"documentMode"in document&&11>=document.documentMode,pl=null,Wn=null,Sa=null,gs=!1;function gu(r,o,C){var F=C.window===C?C.document:C.nodeType===9?C:C.ownerDocument;gs||pl==null||pl!==de(F)||(F=pl,"selectionStart"in F&&hl(F)?F={start:F.selectionStart,end:F.selectionEnd}:(F=(F.ownerDocument&&F.ownerDocument.defaultView||window).getSelection(),F={anchorNode:F.anchorNode,anchorOffset:F.anchorOffset,focusNode:F.focusNode,focusOffset:F.focusOffset}),Sa&&wa(Sa,F)||(Sa=F,F=Su(Wn,"onSelect"),0<F.length&&(o=new Si("onSelect","select",null,o,C),r.push({event:o,listeners:F}),o.target=pl)))}function Yr(r,o){var C={};return C[r.toLowerCase()]=o.toLowerCase(),C["Webkit"+r]="webkit"+o,C["Moz"+r]="moz"+o,C}var rr={animationend:Yr("Animation","AnimationEnd"),animationiteration:Yr("Animation","AnimationIteration"),animationstart:Yr("Animation","AnimationStart"),transitionend:Yr("Transition","TransitionEnd")},Ea={},vu={};c&&(vu=document.createElement("div").style,"AnimationEvent"in window||(delete rr.animationend.animation,delete rr.animationiteration.animation,delete rr.animationstart.animation),"TransitionEvent"in window||delete rr.transitionend.transition);function gl(r){if(Ea[r])return Ea[r];if(!rr[r])return r;var o=rr[r],C;for(C in o)if(o.hasOwnProperty(C)&&C in vu)return Ea[r]=o[C];return r}var jc=gl("animationend"),Fc=gl("animationiteration"),zc=gl("animationstart"),Bc=gl("transitionend"),Uc=new Map,qc="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 uo(r,o){Uc.set(r,o),l(o,[r])}for(var mu=0;mu<qc.length;mu++){var Oa=qc[mu],lh=Oa.toLowerCase(),yu=Oa[0].toUpperCase()+Oa.slice(1);uo(lh,"on"+yu)}uo(jc,"onAnimationEnd"),uo(Fc,"onAnimationIteration"),uo(zc,"onAnimationStart"),uo("dblclick","onDoubleClick"),uo("focusin","onFocus"),uo("focusout","onBlur"),uo(Bc,"onTransitionEnd"),s("onMouseEnter",["mouseout","mouseover"]),s("onMouseLeave",["mouseout","mouseover"]),s("onPointerEnter",["pointerout","pointerover"]),s("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Vo="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(" "),sh=new Set("cancel close invalid load scroll toggle".split(" ").concat(Vo));function bu(r,o,C){var F=r.type||"unknown-event";r.currentTarget=C,Lt(F,o,void 0,r),r.currentTarget=null}function Hc(r,o){o=(o&4)!==0;for(var C=0;C<r.length;C++){var F=r[C],V=F.event;F=F.listeners;e:{var J=void 0;if(o)for(var oe=F.length-1;0<=oe;oe--){var fe=F[oe],ge=fe.instance,Te=fe.currentTarget;if(fe=fe.listener,ge!==J&&V.isPropagationStopped())break e;bu(V,fe,Te),J=ge}else for(oe=0;oe<F.length;oe++){if(fe=F[oe],ge=fe.instance,Te=fe.currentTarget,fe=fe.listener,ge!==J&&V.isPropagationStopped())break e;bu(V,fe,Te),J=ge}}}if(ii)throw r=Sr,ii=!1,Sr=null,r}function on(r,o){var C=o[Ou];C===void 0&&(C=o[Ou]=new Set);var F=r+"__bubble";C.has(F)||(Gc(o,r,2,!1),C.add(F))}function _u(r,o,C){var F=0;o&&(F|=4),Gc(C,r,F,o)}var vs="_reactListening"+Math.random().toString(36).slice(2);function xa(r){if(!r[vs]){r[vs]=!0,n.forEach(function(C){C!=="selectionchange"&&(sh.has(C)||_u(C,!1,r),_u(C,!0,r))});var o=r.nodeType===9?r:r.ownerDocument;o===null||o[vs]||(o[vs]=!0,_u("selectionchange",!1,o))}}function Gc(r,o,C,F){switch(Xd(o)){case 1:var V=wi;break;case 4:V=oo;break;default:V=ll}C=V.bind(null,o,C,r),V=void 0,!_t||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(V=!0),F?V!==void 0?r.addEventListener(o,C,{capture:!0,passive:V}):r.addEventListener(o,C,!0):V!==void 0?r.addEventListener(o,C,{passive:V}):r.addEventListener(o,C,!1)}function wu(r,o,C,F,V){var J=F;if(!(o&1)&&!(o&2)&&F!==null)e:for(;;){if(F===null)return;var oe=F.tag;if(oe===3||oe===4){var fe=F.stateNode.containerInfo;if(fe===V||fe.nodeType===8&&fe.parentNode===V)break;if(oe===4)for(oe=F.return;oe!==null;){var ge=oe.tag;if((ge===3||ge===4)&&(ge=oe.stateNode.containerInfo,ge===V||ge.nodeType===8&&ge.parentNode===V))return;oe=oe.return}for(;fe!==null;){if(oe=Wo(fe),oe===null)return;if(ge=oe.tag,ge===5||ge===6){F=J=oe;continue e}fe=fe.parentNode}}F=F.return}Ye(function(){var Te=J,qe=Pt(C),He=[];e:{var Ue=Uc.get(r);if(Ue!==void 0){var tt=Si,lt=r;switch(r){case"keypress":if(ga(C)===0)break e;case"keydown":case"keyup":tt=th;break;case"focusin":lt="focus",tt=au;break;case"focusout":lt="blur",tt=au;break;case"beforeblur":case"afterblur":tt=au;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":tt=fn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":tt=Oi;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":tt=cu;break;case jc:case Fc:case zc:tt=Cc;break;case Bc:tt=ul;break;case"scroll":tt=Zd;break;case"wheel":tt=Tc;break;case"copy":case"cut":case"paste":tt=lu;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":tt=ya}var ut=(o&4)!==0,qn=!ut&&r==="scroll",Ee=ut?Ue!==null?Ue+"Capture":null:Ue;ut=[];for(var me=Te,Pe;me!==null;){Pe=me;var $e=Pe.stateNode;if(Pe.tag===5&&$e!==null&&(Pe=$e,Ee!==null&&($e=Mt(me,Ee),$e!=null&&ut.push(vl(me,$e,Pe)))),qn)break;me=me.return}0<ut.length&&(Ue=new tt(Ue,lt,null,C,qe),He.push({event:Ue,listeners:ut}))}}if(!(o&7)){e:{if(Ue=r==="mouseover"||r==="pointerover",tt=r==="mouseout"||r==="pointerout",Ue&&C!==wt&&(lt=C.relatedTarget||C.fromElement)&&(Wo(lt)||lt[Bi]))break e;if((tt||Ue)&&(Ue=qe.window===qe?qe:(Ue=qe.ownerDocument)?Ue.defaultView||Ue.parentWindow:window,tt?(lt=C.relatedTarget||C.toElement,tt=Te,lt=lt?Wo(lt):null,lt!==null&&(qn=Gt(lt),lt!==qn||lt.tag!==5&&lt.tag!==6)&&(lt=null)):(tt=null,lt=Te),tt!==lt)){if(ut=fn,$e="onMouseLeave",Ee="onMouseEnter",me="mouse",(r==="pointerout"||r==="pointerover")&&(ut=ya,$e="onPointerLeave",Ee="onPointerEnter",me="pointer"),qn=tt==null?Ue:Fn(tt),Pe=lt==null?Ue:Fn(lt),Ue=new ut($e,me+"leave",tt,C,qe),Ue.target=qn,Ue.relatedTarget=Pe,$e=null,Wo(qe)===Te&&(ut=new ut(Ee,me+"enter",lt,C,qe),ut.target=Pe,ut.relatedTarget=qn,$e=ut),qn=$e,tt&&lt)t:{for(ut=tt,Ee=lt,me=0,Pe=ut;Pe;Pe=Pa(Pe))me++;for(Pe=0,$e=Ee;$e;$e=Pa($e))Pe++;for(;0<me-Pe;)ut=Pa(ut),me--;for(;0<Pe-me;)Ee=Pa(Ee),Pe--;for(;me--;){if(ut===Ee||Ee!==null&&ut===Ee.alternate)break t;ut=Pa(ut),Ee=Pa(Ee)}ut=null}else ut=null;tt!==null&&uh(He,Ue,tt,ut,!1),lt!==null&&qn!==null&&uh(He,qn,lt,ut,!0)}}e:{if(Ue=Te?Fn(Te):window,tt=Ue.nodeName&&Ue.nodeName.toLowerCase(),tt==="select"||tt==="input"&&Ue.type==="file")var ct=li;else if(so(Ue))if(dl)ct=Ic;else{ct=On;var mt=Nc}else(tt=Ue.nodeName)&&tt.toLowerCase()==="input"&&(Ue.type==="checkbox"||Ue.type==="radio")&&(ct=pu);if(ct&&(ct=ct(r,Te))){ds(He,ct,C,qe);break e}mt&&mt(r,Ue,Te),r==="focusout"&&(mt=Ue._wrapperState)&&mt.controlled&&Ue.type==="number"&&pe(Ue,"number",Ue.value)}switch(mt=Te?Fn(Te):window,r){case"focusin":(so(mt)||mt.contentEditable==="true")&&(pl=mt,Wn=Te,Sa=null);break;case"focusout":Sa=Wn=pl=null;break;case"mousedown":gs=!0;break;case"contextmenu":case"mouseup":case"dragend":gs=!1,gu(He,C,qe);break;case"selectionchange":if(ps)break;case"keydown":case"keyup":gu(He,C,qe)}var yt;if(fs)e:{switch(r){case"compositionstart":var St="onCompositionStart";break e;case"compositionend":St="onCompositionEnd";break e;case"compositionupdate":St="onCompositionUpdate";break e}St=void 0}else Wr?Rc(r,C)&&(St="onCompositionEnd"):r==="keydown"&&C.keyCode===229&&(St="onCompositionStart");St&&($r&&C.locale!=="ko"&&(Wr||St!=="onCompositionStart"?St==="onCompositionEnd"&&Wr&&(yt=ls()):(tr=qe,zo="value"in tr?tr.value:tr.textContent,Wr=!0)),mt=Su(Te,St),0<mt.length&&(St=new va(St,r,null,C,qe),He.push({event:St,listeners:mt}),yt?St.data=yt:(yt=xi(C),yt!==null&&(St.data=yt)))),(yt=cl?Mc(r,C):oh(r,C))&&(Te=Su(Te,"onBeforeInput"),0<Te.length&&(qe=new va("onBeforeInput","beforeinput",null,C,qe),He.push({event:qe,listeners:Te}),qe.data=yt))}Hc(He,o)})}function vl(r,o,C){return{instance:r,listener:o,currentTarget:C}}function Su(r,o){for(var C=o+"Capture",F=[];r!==null;){var V=r,J=V.stateNode;V.tag===5&&J!==null&&(V=J,J=Mt(r,C),J!=null&&F.unshift(vl(r,J,V)),J=Mt(r,o),J!=null&&F.push(vl(r,J,V))),r=r.return}return F}function Pa(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function uh(r,o,C,F,V){for(var J=o._reactName,oe=[];C!==null&&C!==F;){var fe=C,ge=fe.alternate,Te=fe.stateNode;if(ge!==null&&ge===F)break;fe.tag===5&&Te!==null&&(fe=Te,V?(ge=Mt(C,J),ge!=null&&oe.unshift(vl(C,ge,fe))):V||(ge=Mt(C,J),ge!=null&&oe.push(vl(C,ge,fe)))),C=C.return}oe.length!==0&&r.push({event:o,listeners:oe})}var Xp=/\r\n?/g,ch=/\u0000|\uFFFD/g;function Vc(r){return(typeof r=="string"?r:""+r).replace(Xp,`
30
- `).replace(ch,"")}function ms(r,o,C){if(o=Vc(o),Vc(r)!==o&&C)throw Error(t(425))}function Ca(){}var $c=null,Wc=null;function Yc(r,o){return r==="textarea"||r==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Kr=typeof setTimeout=="function"?setTimeout:void 0,Kc=typeof clearTimeout=="function"?clearTimeout:void 0,ys=typeof Promise=="function"?Promise:void 0,fh=typeof queueMicrotask=="function"?queueMicrotask:typeof ys<"u"?function(r){return ys.resolve(null).then(r).catch(dh)}:Kr;function dh(r){setTimeout(function(){throw r})}function Eu(r,o){var C=o,F=0;do{var V=C.nextSibling;if(r.removeChild(C),V&&V.nodeType===8)if(C=V.data,C==="/$"){if(F===0){r.removeChild(V),Fr(o);return}F--}else C!=="$"&&C!=="$?"&&C!=="$!"||F++;C=V}while(C);Fr(o)}function zi(r){for(;r!=null;r=r.nextSibling){var o=r.nodeType;if(o===1||o===3)break;if(o===8){if(o=r.data,o==="$"||o==="$!"||o==="$?")break;if(o==="/$")return null}}return r}function ka(r){r=r.previousSibling;for(var o=0;r;){if(r.nodeType===8){var C=r.data;if(C==="$"||C==="$!"||C==="$?"){if(o===0)return r;o--}else C==="/$"&&o++}r=r.previousSibling}return null}var $o=Math.random().toString(36).slice(2),ui="__reactFiber$"+$o,bs="__reactProps$"+$o,Bi="__reactContainer$"+$o,Ou="__reactEvents$"+$o,hh="__reactListeners$"+$o,ph="__reactHandles$"+$o;function Wo(r){var o=r[ui];if(o)return o;for(var C=r.parentNode;C;){if(o=C[Bi]||C[ui]){if(C=o.alternate,o.child!==null||C!==null&&C.child!==null)for(r=ka(r);r!==null;){if(C=r[ui])return C;r=ka(r)}return o}r=C,C=r.parentNode}return null}function _s(r){return r=r[ui]||r[Bi],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function Fn(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(t(33))}function Yn(r){return r[bs]||null}var xu=[],Aa=-1;function co(r){return{current:r}}function an(r){0>Aa||(r.current=xu[Aa],xu[Aa]=null,Aa--)}function tn(r,o){Aa++,xu[Aa]=r.current,r.current=o}var Ui={},ir=co(Ui),dr=co(!1),Yo=Ui;function Ta(r,o){var C=r.type.contextTypes;if(!C)return Ui;var F=r.stateNode;if(F&&F.__reactInternalMemoizedUnmaskedChildContext===o)return F.__reactInternalMemoizedMaskedChildContext;var V={},J;for(J in C)V[J]=o[J];return F&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=o,r.__reactInternalMemoizedMaskedChildContext=V),V}function hr(r){return r=r.childContextTypes,r!=null}function ml(){an(dr),an(ir)}function Xc(r,o,C){if(ir.current!==Ui)throw Error(t(168));tn(ir,o),tn(dr,C)}function Pu(r,o,C){var F=r.stateNode;if(o=o.childContextTypes,typeof F.getChildContext!="function")return C;F=F.getChildContext();for(var V in F)if(!(V in o))throw Error(t(108,W(r)||"Unknown",V));return z({},C,F)}function Ra(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||Ui,Yo=ir.current,tn(ir,r),tn(dr,dr.current),!0}function gh(r,o,C){var F=r.stateNode;if(!F)throw Error(t(169));C?(r=Pu(r,o,Yo),F.__reactInternalMemoizedMergedChildContext=r,an(dr),an(ir),tn(ir,r)):an(dr),tn(dr,C)}var qi=null,yl=!1,Cu=!1;function ws(r){qi===null?qi=[r]:qi.push(r)}function fo(r){yl=!0,ws(r)}function Ko(){if(!Cu&&qi!==null){Cu=!0;var r=0,o=Ht;try{var C=qi;for(Ht=1;r<C.length;r++){var F=C[r];do F=F(!0);while(F!==null)}qi=null,yl=!1}catch(V){throw qi!==null&&(qi=qi.slice(r+1)),Ir(Dr,Ko),V}finally{Ht=o,Cu=!1}}return null}var xr=[],Ma=0,Xo=null,Zo=0,Pr=[],Cr=0,Qo=null,Xr=1,vn="";function La(r,o){xr[Ma++]=Zo,xr[Ma++]=Xo,Xo=r,Zo=o}function vh(r,o,C){Pr[Cr++]=Xr,Pr[Cr++]=vn,Pr[Cr++]=Qo,Qo=r;var F=Xr;r=vn;var V=32-It(F)-1;F&=~(1<<V),C+=1;var J=32-It(o)+V;if(30<J){var oe=V-V%5;J=(F&(1<<oe)-1).toString(32),F>>=oe,V-=oe,Xr=1<<32-It(o)+V|C<<V|F,vn=J+r}else Xr=1<<J|C<<V|F,vn=r}function bl(r){r.return!==null&&(La(r,1),vh(r,1,0))}function Kn(r){for(;r===Xo;)Xo=xr[--Ma],xr[Ma]=null,Zo=xr[--Ma],xr[Ma]=null;for(;r===Qo;)Qo=Pr[--Cr],Pr[Cr]=null,vn=Pr[--Cr],Pr[Cr]=null,Xr=Pr[--Cr],Pr[Cr]=null}var Zr=null,Xe=null,Zt=!1,Qr=null;function Zc(r,o){var C=Ki(5,null,null,0);C.elementType="DELETED",C.stateNode=o,C.return=r,o=r.deletions,o===null?(r.deletions=[C],r.flags|=16):o.push(C)}function mh(r,o){switch(r.tag){case 5:var C=r.type;return o=o.nodeType!==1||C.toLowerCase()!==o.nodeName.toLowerCase()?null:o,o!==null?(r.stateNode=o,Zr=r,Xe=zi(o.firstChild),!0):!1;case 6:return o=r.pendingProps===""||o.nodeType!==3?null:o,o!==null?(r.stateNode=o,Zr=r,Xe=null,!0):!1;case 13:return o=o.nodeType!==8?null:o,o!==null?(C=Qo!==null?{id:Xr,overflow:vn}:null,r.memoizedState={dehydrated:o,treeContext:C,retryLane:1073741824},C=Ki(18,null,null,0),C.stateNode=o,C.return=r,r.child=C,Zr=r,Xe=null,!0):!1;default:return!1}}function Na(r){return(r.mode&1)!==0&&(r.flags&128)===0}function _l(r){if(Zt){var o=Xe;if(o){var C=o;if(!mh(r,o)){if(Na(r))throw Error(t(418));o=zi(C.nextSibling);var F=Zr;o&&mh(r,o)?Zc(F,C):(r.flags=r.flags&-4097|2,Zt=!1,Zr=r)}}else{if(Na(r))throw Error(t(418));r.flags=r.flags&-4097|2,Zt=!1,Zr=r}}}function ku(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;Zr=r}function Ss(r){if(r!==Zr)return!1;if(!Zt)return ku(r),Zt=!0,!1;var o;if((o=r.tag!==3)&&!(o=r.tag!==5)&&(o=r.type,o=o!=="head"&&o!=="body"&&!Yc(r.type,r.memoizedProps)),o&&(o=Xe)){if(Na(r))throw Qc(),Error(t(418));for(;o;)Zc(r,o),o=zi(o.nextSibling)}if(ku(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(t(317));e:{for(r=r.nextSibling,o=0;r;){if(r.nodeType===8){var C=r.data;if(C==="/$"){if(o===0){Xe=zi(r.nextSibling);break e}o--}else C!=="$"&&C!=="$!"&&C!=="$?"||o++}r=r.nextSibling}Xe=null}}else Xe=Zr?zi(r.stateNode.nextSibling):null;return!0}function Qc(){for(var r=Xe;r;)r=zi(r.nextSibling)}function Ia(){Xe=Zr=null,Zt=!1}function Es(r){Qr===null?Qr=[r]:Qr.push(r)}var Jc=b.ReactCurrentBatchConfig;function kn(r,o,C){if(r=C.ref,r!==null&&typeof r!="function"&&typeof r!="object"){if(C._owner){if(C=C._owner,C){if(C.tag!==1)throw Error(t(309));var F=C.stateNode}if(!F)throw Error(t(147,r));var V=F,J=""+r;return o!==null&&o.ref!==null&&typeof o.ref=="function"&&o.ref._stringRef===J?o.ref:(o=function(oe){var fe=V.refs;oe===null?delete fe[J]:fe[J]=oe},o._stringRef=J,o)}if(typeof r!="string")throw Error(t(284));if(!C._owner)throw Error(t(290,r))}return r}function Ur(r,o){throw r=Object.prototype.toString.call(o),Error(t(31,r==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":r))}function Pi(r){var o=r._init;return o(r._payload)}function Au(r){function o(Ee,me){if(r){var Pe=Ee.deletions;Pe===null?(Ee.deletions=[me],Ee.flags|=16):Pe.push(me)}}function C(Ee,me){if(!r)return null;for(;me!==null;)o(Ee,me),me=me.sibling;return null}function F(Ee,me){for(Ee=new Map;me!==null;)me.key!==null?Ee.set(me.key,me):Ee.set(me.index,me),me=me.sibling;return Ee}function V(Ee,me){return Ee=Bl(Ee,me),Ee.index=0,Ee.sibling=null,Ee}function J(Ee,me,Pe){return Ee.index=Pe,r?(Pe=Ee.alternate,Pe!==null?(Pe=Pe.index,Pe<me?(Ee.flags|=2,me):Pe):(Ee.flags|=2,me)):(Ee.flags|=1048576,me)}function oe(Ee){return r&&Ee.alternate===null&&(Ee.flags|=2),Ee}function fe(Ee,me,Pe,$e){return me===null||me.tag!==6?(me=m0(Pe,Ee.mode,$e),me.return=Ee,me):(me=V(me,Pe),me.return=Ee,me)}function ge(Ee,me,Pe,$e){var ct=Pe.type;return ct===T?qe(Ee,me,Pe.props.children,$e,Pe.key):me!==null&&(me.elementType===ct||typeof ct=="object"&&ct!==null&&ct.$$typeof===X&&Pi(ct)===me.type)?($e=V(me,Pe.props),$e.ref=kn(Ee,me,Pe),$e.return=Ee,$e):($e=Fh(Pe.type,Pe.key,Pe.props,null,Ee.mode,$e),$e.ref=kn(Ee,me,Pe),$e.return=Ee,$e)}function Te(Ee,me,Pe,$e){return me===null||me.tag!==4||me.stateNode.containerInfo!==Pe.containerInfo||me.stateNode.implementation!==Pe.implementation?(me=y0(Pe,Ee.mode,$e),me.return=Ee,me):(me=V(me,Pe.children||[]),me.return=Ee,me)}function qe(Ee,me,Pe,$e,ct){return me===null||me.tag!==7?(me=Ns(Pe,Ee.mode,$e,ct),me.return=Ee,me):(me=V(me,Pe),me.return=Ee,me)}function He(Ee,me,Pe){if(typeof me=="string"&&me!==""||typeof me=="number")return me=m0(""+me,Ee.mode,Pe),me.return=Ee,me;if(typeof me=="object"&&me!==null){switch(me.$$typeof){case x:return Pe=Fh(me.type,me.key,me.props,null,Ee.mode,Pe),Pe.ref=kn(Ee,null,me),Pe.return=Ee,Pe;case M:return me=y0(me,Ee.mode,Pe),me.return=Ee,me;case X:var $e=me._init;return He(Ee,$e(me._payload),Pe)}if(Ce(me)||q(me))return me=Ns(me,Ee.mode,Pe,null),me.return=Ee,me;Ur(Ee,me)}return null}function Ue(Ee,me,Pe,$e){var ct=me!==null?me.key:null;if(typeof Pe=="string"&&Pe!==""||typeof Pe=="number")return ct!==null?null:fe(Ee,me,""+Pe,$e);if(typeof Pe=="object"&&Pe!==null){switch(Pe.$$typeof){case x:return Pe.key===ct?ge(Ee,me,Pe,$e):null;case M:return Pe.key===ct?Te(Ee,me,Pe,$e):null;case X:return ct=Pe._init,Ue(Ee,me,ct(Pe._payload),$e)}if(Ce(Pe)||q(Pe))return ct!==null?null:qe(Ee,me,Pe,$e,null);Ur(Ee,Pe)}return null}function tt(Ee,me,Pe,$e,ct){if(typeof $e=="string"&&$e!==""||typeof $e=="number")return Ee=Ee.get(Pe)||null,fe(me,Ee,""+$e,ct);if(typeof $e=="object"&&$e!==null){switch($e.$$typeof){case x:return Ee=Ee.get($e.key===null?Pe:$e.key)||null,ge(me,Ee,$e,ct);case M:return Ee=Ee.get($e.key===null?Pe:$e.key)||null,Te(me,Ee,$e,ct);case X:var mt=$e._init;return tt(Ee,me,Pe,mt($e._payload),ct)}if(Ce($e)||q($e))return Ee=Ee.get(Pe)||null,qe(me,Ee,$e,ct,null);Ur(me,$e)}return null}function lt(Ee,me,Pe,$e){for(var ct=null,mt=null,yt=me,St=me=0,br=null;yt!==null&&St<Pe.length;St++){yt.index>St?(br=yt,yt=null):br=yt.sibling;var Kt=Ue(Ee,yt,Pe[St],$e);if(Kt===null){yt===null&&(yt=br);break}r&&yt&&Kt.alternate===null&&o(Ee,yt),me=J(Kt,me,St),mt===null?ct=Kt:mt.sibling=Kt,mt=Kt,yt=br}if(St===Pe.length)return C(Ee,yt),Zt&&La(Ee,St),ct;if(yt===null){for(;St<Pe.length;St++)yt=He(Ee,Pe[St],$e),yt!==null&&(me=J(yt,me,St),mt===null?ct=yt:mt.sibling=yt,mt=yt);return Zt&&La(Ee,St),ct}for(yt=F(Ee,yt);St<Pe.length;St++)br=tt(yt,Ee,St,Pe[St],$e),br!==null&&(r&&br.alternate!==null&&yt.delete(br.key===null?St:br.key),me=J(br,me,St),mt===null?ct=br:mt.sibling=br,mt=br);return r&&yt.forEach(function(Ul){return o(Ee,Ul)}),Zt&&La(Ee,St),ct}function ut(Ee,me,Pe,$e){var ct=q(Pe);if(typeof ct!="function")throw Error(t(150));if(Pe=ct.call(Pe),Pe==null)throw Error(t(151));for(var mt=ct=null,yt=me,St=me=0,br=null,Kt=Pe.next();yt!==null&&!Kt.done;St++,Kt=Pe.next()){yt.index>St?(br=yt,yt=null):br=yt.sibling;var Ul=Ue(Ee,yt,Kt.value,$e);if(Ul===null){yt===null&&(yt=br);break}r&&yt&&Ul.alternate===null&&o(Ee,yt),me=J(Ul,me,St),mt===null?ct=Ul:mt.sibling=Ul,mt=Ul,yt=br}if(Kt.done)return C(Ee,yt),Zt&&La(Ee,St),ct;if(yt===null){for(;!Kt.done;St++,Kt=Pe.next())Kt=He(Ee,Kt.value,$e),Kt!==null&&(me=J(Kt,me,St),mt===null?ct=Kt:mt.sibling=Kt,mt=Kt);return Zt&&La(Ee,St),ct}for(yt=F(Ee,yt);!Kt.done;St++,Kt=Pe.next())Kt=tt(yt,Ee,St,Kt.value,$e),Kt!==null&&(r&&Kt.alternate!==null&&yt.delete(Kt.key===null?St:Kt.key),me=J(Kt,me,St),mt===null?ct=Kt:mt.sibling=Kt,mt=Kt);return r&&yt.forEach(function(K_){return o(Ee,K_)}),Zt&&La(Ee,St),ct}function qn(Ee,me,Pe,$e){if(typeof Pe=="object"&&Pe!==null&&Pe.type===T&&Pe.key===null&&(Pe=Pe.props.children),typeof Pe=="object"&&Pe!==null){switch(Pe.$$typeof){case x:e:{for(var ct=Pe.key,mt=me;mt!==null;){if(mt.key===ct){if(ct=Pe.type,ct===T){if(mt.tag===7){C(Ee,mt.sibling),me=V(mt,Pe.props.children),me.return=Ee,Ee=me;break e}}else if(mt.elementType===ct||typeof ct=="object"&&ct!==null&&ct.$$typeof===X&&Pi(ct)===mt.type){C(Ee,mt.sibling),me=V(mt,Pe.props),me.ref=kn(Ee,mt,Pe),me.return=Ee,Ee=me;break e}C(Ee,mt);break}else o(Ee,mt);mt=mt.sibling}Pe.type===T?(me=Ns(Pe.props.children,Ee.mode,$e,Pe.key),me.return=Ee,Ee=me):($e=Fh(Pe.type,Pe.key,Pe.props,null,Ee.mode,$e),$e.ref=kn(Ee,me,Pe),$e.return=Ee,Ee=$e)}return oe(Ee);case M:e:{for(mt=Pe.key;me!==null;){if(me.key===mt)if(me.tag===4&&me.stateNode.containerInfo===Pe.containerInfo&&me.stateNode.implementation===Pe.implementation){C(Ee,me.sibling),me=V(me,Pe.children||[]),me.return=Ee,Ee=me;break e}else{C(Ee,me);break}else o(Ee,me);me=me.sibling}me=y0(Pe,Ee.mode,$e),me.return=Ee,Ee=me}return oe(Ee);case X:return mt=Pe._init,qn(Ee,me,mt(Pe._payload),$e)}if(Ce(Pe))return lt(Ee,me,Pe,$e);if(q(Pe))return ut(Ee,me,Pe,$e);Ur(Ee,Pe)}return typeof Pe=="string"&&Pe!==""||typeof Pe=="number"?(Pe=""+Pe,me!==null&&me.tag===6?(C(Ee,me.sibling),me=V(me,Pe),me.return=Ee,Ee=me):(C(Ee,me),me=m0(Pe,Ee.mode,$e),me.return=Ee,Ee=me),oe(Ee)):C(Ee,me)}return qn}var Da=Au(!0),ci=Au(!1),Os=co(null),Jr=null,wl=null,Tu=null;function Ru(){Tu=wl=Jr=null}function Mu(r){var o=Os.current;an(Os),r._currentValue=o}function Lu(r,o,C){for(;r!==null;){var F=r.alternate;if((r.childLanes&o)!==o?(r.childLanes|=o,F!==null&&(F.childLanes|=o)):F!==null&&(F.childLanes&o)!==o&&(F.childLanes|=o),r===C)break;r=r.return}}function ho(r,o){Jr=r,Tu=wl=null,r=r.dependencies,r!==null&&r.firstContext!==null&&(r.lanes&o&&(ne=!0),r.firstContext=null)}function kr(r){var o=r._currentValue;if(Tu!==r)if(r={context:r,memoizedValue:o,next:null},wl===null){if(Jr===null)throw Error(t(308));wl=r,Jr.dependencies={lanes:0,firstContext:r}}else wl=wl.next=r;return o}var Hi=null;function Sl(r){Hi===null?Hi=[r]:Hi.push(r)}function xs(r,o,C,F){var V=o.interleaved;return V===null?(C.next=C,Sl(o)):(C.next=V.next,V.next=C),o.interleaved=C,ei(r,F)}function ei(r,o){r.lanes|=o;var C=r.alternate;for(C!==null&&(C.lanes|=o),C=r,r=r.return;r!==null;)r.childLanes|=o,C=r.alternate,C!==null&&(C.childLanes|=o),C=r,r=r.return;return C.tag===3?C.stateNode:null}var Gi=!1;function Ps(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Nu(r,o){r=r.updateQueue,o.updateQueue===r&&(o.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function Vi(r,o){return{eventTime:r,lane:o,tag:0,payload:null,callback:null,next:null}}function $i(r,o,C){var F=r.updateQueue;if(F===null)return null;if(F=F.shared,$t&2){var V=F.pending;return V===null?o.next=o:(o.next=V.next,V.next=o),F.pending=o,ei(r,C)}return V=F.interleaved,V===null?(o.next=o,Sl(F)):(o.next=V.next,V.next=o),F.interleaved=o,ei(r,C)}function Iu(r,o,C){if(o=o.updateQueue,o!==null&&(o=o.shared,(C&4194240)!==0)){var F=o.lanes;F&=r.pendingLanes,C|=F,o.lanes=C,xc(r,C)}}function Cs(r,o){var C=r.updateQueue,F=r.alternate;if(F!==null&&(F=F.updateQueue,C===F)){var V=null,J=null;if(C=C.firstBaseUpdate,C!==null){do{var oe={eventTime:C.eventTime,lane:C.lane,tag:C.tag,payload:C.payload,callback:C.callback,next:null};J===null?V=J=oe:J=J.next=oe,C=C.next}while(C!==null);J===null?V=J=o:J=J.next=o}else V=J=o;C={baseState:F.baseState,firstBaseUpdate:V,lastBaseUpdate:J,shared:F.shared,effects:F.effects},r.updateQueue=C;return}r=C.lastBaseUpdate,r===null?C.firstBaseUpdate=o:r.next=o,C.lastBaseUpdate=o}function El(r,o,C,F){var V=r.updateQueue;Gi=!1;var J=V.firstBaseUpdate,oe=V.lastBaseUpdate,fe=V.shared.pending;if(fe!==null){V.shared.pending=null;var ge=fe,Te=ge.next;ge.next=null,oe===null?J=Te:oe.next=Te,oe=ge;var qe=r.alternate;qe!==null&&(qe=qe.updateQueue,fe=qe.lastBaseUpdate,fe!==oe&&(fe===null?qe.firstBaseUpdate=Te:fe.next=Te,qe.lastBaseUpdate=ge))}if(J!==null){var He=V.baseState;oe=0,qe=Te=ge=null,fe=J;do{var Ue=fe.lane,tt=fe.eventTime;if((F&Ue)===Ue){qe!==null&&(qe=qe.next={eventTime:tt,lane:0,tag:fe.tag,payload:fe.payload,callback:fe.callback,next:null});e:{var lt=r,ut=fe;switch(Ue=o,tt=C,ut.tag){case 1:if(lt=ut.payload,typeof lt=="function"){He=lt.call(tt,He,Ue);break e}He=lt;break e;case 3:lt.flags=lt.flags&-65537|128;case 0:if(lt=ut.payload,Ue=typeof lt=="function"?lt.call(tt,He,Ue):lt,Ue==null)break e;He=z({},He,Ue);break e;case 2:Gi=!0}}fe.callback!==null&&fe.lane!==0&&(r.flags|=64,Ue=V.effects,Ue===null?V.effects=[fe]:Ue.push(fe))}else tt={eventTime:tt,lane:Ue,tag:fe.tag,payload:fe.payload,callback:fe.callback,next:null},qe===null?(Te=qe=tt,ge=He):qe=qe.next=tt,oe|=Ue;if(fe=fe.next,fe===null){if(fe=V.shared.pending,fe===null)break;Ue=fe,fe=Ue.next,Ue.next=null,V.lastBaseUpdate=Ue,V.shared.pending=null}}while(!0);if(qe===null&&(ge=He),V.baseState=ge,V.firstBaseUpdate=Te,V.lastBaseUpdate=qe,o=V.shared.interleaved,o!==null){V=o;do oe|=V.lane,V=V.next;while(V!==o)}else J===null&&(V.shared.lanes=0);Ts|=oe,r.lanes=oe,r.memoizedState=He}}function Pn(r,o,C){if(r=o.effects,o.effects=null,r!==null)for(o=0;o<r.length;o++){var F=r[o],V=F.callback;if(V!==null){if(F.callback=null,F=C,typeof V!="function")throw Error(t(191,V));V.call(F)}}}var kt={},nn=co(kt),mn=co(kt),An=co(kt);function zn(r){if(r===kt)throw Error(t(174));return r}function Jo(r,o){switch(tn(An,o),tn(mn,r),tn(nn,kt),r=o.nodeType,r){case 9:case 11:o=(o=o.documentElement)?o.namespaceURI:ht(null,"");break;default:r=r===8?o.parentNode:o,o=r.namespaceURI||null,r=r.tagName,o=ht(o,r)}an(nn),tn(nn,o)}function yn(){an(nn),an(mn),an(An)}function Ol(r){zn(An.current);var o=zn(nn.current),C=ht(o,r.type);o!==C&&(tn(mn,r),tn(nn,C))}function po(r){mn.current===r&&(an(nn),an(mn))}var ln=co(0);function xl(r){for(var o=r;o!==null;){if(o.tag===13){var C=o.memoizedState;if(C!==null&&(C=C.dehydrated,C===null||C.data==="$?"||C.data==="$!"))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!==void 0){if(o.flags&128)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var ja=[];function pr(){for(var r=0;r<ja.length;r++)ja[r]._workInProgressVersionPrimary=null;ja.length=0}var Pl=b.ReactCurrentDispatcher,ks=b.ReactCurrentBatchConfig,Ar=0,Jt=null,Cn=null,Mn=null,Ci=!1,ea=!1,fi=0,Du=0;function Ln(){throw Error(t(321))}function As(r,o){if(o===null)return!1;for(var C=0;C<o.length&&C<r.length;C++)if(!Br(r[C],o[C]))return!1;return!0}function Cl(r,o,C,F,V,J){if(Ar=J,Jt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,Pl.current=r===null||r.memoizedState===null?Qp:ra,r=C(F,V),ea){J=0;do{if(ea=!1,fi=0,25<=J)throw Error(t(301));J+=1,Mn=Cn=null,o.updateQueue=null,Pl.current=Uu,r=C(F,V)}while(ea)}if(Pl.current=Rl,o=Cn!==null&&Cn.next!==null,Ar=0,Mn=Cn=Jt=null,Ci=!1,o)throw Error(t(300));return r}function kl(){var r=fi!==0;return fi=0,r}function dn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mn===null?Jt.memoizedState=Mn=r:Mn=Mn.next=r,Mn}function Bn(){if(Cn===null){var r=Jt.alternate;r=r!==null?r.memoizedState:null}else r=Cn.next;var o=Mn===null?Jt.memoizedState:Mn.next;if(o!==null)Mn=o,Cn=r;else{if(r===null)throw Error(t(310));Cn=r,r={memoizedState:Cn.memoizedState,baseState:Cn.baseState,baseQueue:Cn.baseQueue,queue:Cn.queue,next:null},Mn===null?Jt.memoizedState=Mn=r:Mn=Mn.next=r}return Mn}function gr(r,o){return typeof o=="function"?o(r):o}function vr(r){var o=Bn(),C=o.queue;if(C===null)throw Error(t(311));C.lastRenderedReducer=r;var F=Cn,V=F.baseQueue,J=C.pending;if(J!==null){if(V!==null){var oe=V.next;V.next=J.next,J.next=oe}F.baseQueue=V=J,C.pending=null}if(V!==null){J=V.next,F=F.baseState;var fe=oe=null,ge=null,Te=J;do{var qe=Te.lane;if((Ar&qe)===qe)ge!==null&&(ge=ge.next={lane:0,action:Te.action,hasEagerState:Te.hasEagerState,eagerState:Te.eagerState,next:null}),F=Te.hasEagerState?Te.eagerState:r(F,Te.action);else{var He={lane:qe,action:Te.action,hasEagerState:Te.hasEagerState,eagerState:Te.eagerState,next:null};ge===null?(fe=ge=He,oe=F):ge=ge.next=He,Jt.lanes|=qe,Ts|=qe}Te=Te.next}while(Te!==null&&Te!==J);ge===null?oe=F:ge.next=fe,Br(F,o.memoizedState)||(ne=!0),o.memoizedState=F,o.baseState=oe,o.baseQueue=ge,C.lastRenderedState=F}if(r=C.interleaved,r!==null){V=r;do J=V.lane,Jt.lanes|=J,Ts|=J,V=V.next;while(V!==r)}else V===null&&(C.lanes=0);return[o.memoizedState,C.dispatch]}function ju(r){var o=Bn(),C=o.queue;if(C===null)throw Error(t(311));C.lastRenderedReducer=r;var F=C.dispatch,V=C.pending,J=o.memoizedState;if(V!==null){C.pending=null;var oe=V=V.next;do J=r(J,oe.action),oe=oe.next;while(oe!==V);Br(J,o.memoizedState)||(ne=!0),o.memoizedState=J,o.baseQueue===null&&(o.baseState=J),C.lastRenderedState=J}return[J,F]}function Fu(){}function zu(r,o){var C=Jt,F=Bn(),V=o(),J=!Br(F.memoizedState,V);if(J&&(F.memoizedState=V,ne=!0),F=F.queue,rf(ef.bind(null,C,F,r),[r]),F.getSnapshot!==o||J||Mn!==null&&Mn.memoizedState.tag&1){if(C.flags|=2048,Al(9,go.bind(null,C,F,V,o),void 0,null),yr===null)throw Error(t(349));Ar&30||yh(C,o,V)}return V}function yh(r,o,C){r.flags|=16384,r={getSnapshot:o,value:C},o=Jt.updateQueue,o===null?(o={lastEffect:null,stores:null},Jt.updateQueue=o,o.stores=[r]):(C=o.stores,C===null?o.stores=[r]:C.push(r))}function go(r,o,C,F){o.value=C,o.getSnapshot=F,tf(o)&&Bu(r)}function ef(r,o,C){return C(function(){tf(o)&&Bu(r)})}function tf(r){var o=r.getSnapshot;r=r.value;try{var C=o();return!Br(r,C)}catch{return!0}}function Bu(r){var o=ei(r,1);o!==null&&bo(o,r,1,-1)}function ta(r){var o=dn();return typeof r=="function"&&(r=r()),o.memoizedState=o.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:gr,lastRenderedState:r},o.queue=r,r=r.dispatch=Oh.bind(null,Jt,r),[o.memoizedState,r]}function Al(r,o,C,F){return r={tag:r,create:o,destroy:C,deps:F,next:null},o=Jt.updateQueue,o===null?(o={lastEffect:null,stores:null},Jt.updateQueue=o,o.lastEffect=r.next=r):(C=o.lastEffect,C===null?o.lastEffect=r.next=r:(F=C.next,C.next=r,r.next=F,o.lastEffect=r)),r}function nf(){return Bn().memoizedState}function Tl(r,o,C,F){var V=dn();Jt.flags|=r,V.memoizedState=Al(1|o,C,void 0,F===void 0?null:F)}function Fa(r,o,C,F){var V=Bn();F=F===void 0?null:F;var J=void 0;if(Cn!==null){var oe=Cn.memoizedState;if(J=oe.destroy,F!==null&&As(F,oe.deps)){V.memoizedState=Al(o,C,J,F);return}}Jt.flags|=r,V.memoizedState=Al(1|o,C,J,F)}function bh(r,o){return Tl(8390656,8,r,o)}function rf(r,o){return Fa(2048,8,r,o)}function of(r,o){return Fa(4,2,r,o)}function af(r,o){return Fa(4,4,r,o)}function na(r,o){if(typeof o=="function")return r=r(),o(r),function(){o(null)};if(o!=null)return r=r(),o.current=r,function(){o.current=null}}function _h(r,o,C){return C=C!=null?C.concat([r]):null,Fa(4,4,na.bind(null,o,r),C)}function vo(){}function lf(r,o){var C=Bn();o=o===void 0?null:o;var F=C.memoizedState;return F!==null&&o!==null&&As(o,F[1])?F[0]:(C.memoizedState=[r,o],r)}function hn(r,o){var C=Bn();o=o===void 0?null:o;var F=C.memoizedState;return F!==null&&o!==null&&As(o,F[1])?F[0]:(r=r(),C.memoizedState=[r,o],r)}function wh(r,o,C){return Ar&21?(Br(C,o)||(C=Oc(),Jt.lanes|=C,Ts|=C,r.baseState=!0),o):(r.baseState&&(r.baseState=!1,ne=!0),r.memoizedState=C)}function Sh(r,o){var C=Ht;Ht=C!==0&&4>C?C:4,r(!0);var F=ks.transition;ks.transition={};try{r(!1),o()}finally{Ht=C,ks.transition=F}}function Eh(){return Bn().memoizedState}function Zp(r,o,C){var F=Fl(r);if(C={lane:F,action:C,hasEagerState:!1,eagerState:null,next:null},sf(r))xh(o,C);else if(C=xs(r,o,C,F),C!==null){var V=ni();bo(C,r,F,V),ti(C,o,F)}}function Oh(r,o,C){var F=Fl(r),V={lane:F,action:C,hasEagerState:!1,eagerState:null,next:null};if(sf(r))xh(o,V);else{var J=r.alternate;if(r.lanes===0&&(J===null||J.lanes===0)&&(J=o.lastRenderedReducer,J!==null))try{var oe=o.lastRenderedState,fe=J(oe,C);if(V.hasEagerState=!0,V.eagerState=fe,Br(fe,oe)){var ge=o.interleaved;ge===null?(V.next=V,Sl(o)):(V.next=ge.next,ge.next=V),o.interleaved=V;return}}catch{}finally{}C=xs(r,o,V,F),C!==null&&(V=ni(),bo(C,r,F,V),ti(C,o,F))}}function sf(r){var o=r.alternate;return r===Jt||o!==null&&o===Jt}function xh(r,o){ea=Ci=!0;var C=r.pending;C===null?o.next=o:(o.next=C.next,C.next=o),r.pending=o}function ti(r,o,C){if(C&4194240){var F=o.lanes;F&=r.pendingLanes,C|=F,o.lanes=C,xc(r,C)}}var Rl={readContext:kr,useCallback:Ln,useContext:Ln,useEffect:Ln,useImperativeHandle:Ln,useInsertionEffect:Ln,useLayoutEffect:Ln,useMemo:Ln,useReducer:Ln,useRef:Ln,useState:Ln,useDebugValue:Ln,useDeferredValue:Ln,useTransition:Ln,useMutableSource:Ln,useSyncExternalStore:Ln,useId:Ln,unstable_isNewReconciler:!1},Qp={readContext:kr,useCallback:function(r,o){return dn().memoizedState=[r,o===void 0?null:o],r},useContext:kr,useEffect:bh,useImperativeHandle:function(r,o,C){return C=C!=null?C.concat([r]):null,Tl(4194308,4,na.bind(null,o,r),C)},useLayoutEffect:function(r,o){return Tl(4194308,4,r,o)},useInsertionEffect:function(r,o){return Tl(4,2,r,o)},useMemo:function(r,o){var C=dn();return o=o===void 0?null:o,r=r(),C.memoizedState=[r,o],r},useReducer:function(r,o,C){var F=dn();return o=C!==void 0?C(o):o,F.memoizedState=F.baseState=o,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:o},F.queue=r,r=r.dispatch=Zp.bind(null,Jt,r),[F.memoizedState,r]},useRef:function(r){var o=dn();return r={current:r},o.memoizedState=r},useState:ta,useDebugValue:vo,useDeferredValue:function(r){return dn().memoizedState=r},useTransition:function(){var r=ta(!1),o=r[0];return r=Sh.bind(null,r[1]),dn().memoizedState=r,[o,r]},useMutableSource:function(){},useSyncExternalStore:function(r,o,C){var F=Jt,V=dn();if(Zt){if(C===void 0)throw Error(t(407));C=C()}else{if(C=o(),yr===null)throw Error(t(349));Ar&30||yh(F,o,C)}V.memoizedState=C;var J={value:C,getSnapshot:o};return V.queue=J,bh(ef.bind(null,F,J,r),[r]),F.flags|=2048,Al(9,go.bind(null,F,J,C,o),void 0,null),C},useId:function(){var r=dn(),o=yr.identifierPrefix;if(Zt){var C=vn,F=Xr;C=(F&~(1<<32-It(F)-1)).toString(32)+C,o=":"+o+"R"+C,C=fi++,0<C&&(o+="H"+C.toString(32)),o+=":"}else C=Du++,o=":"+o+"r"+C.toString(32)+":";return r.memoizedState=o},unstable_isNewReconciler:!1},ra={readContext:kr,useCallback:lf,useContext:kr,useEffect:rf,useImperativeHandle:_h,useInsertionEffect:of,useLayoutEffect:af,useMemo:hn,useReducer:vr,useRef:nf,useState:function(){return vr(gr)},useDebugValue:vo,useDeferredValue:function(r){var o=Bn();return wh(o,Cn.memoizedState,r)},useTransition:function(){var r=vr(gr)[0],o=Bn().memoizedState;return[r,o]},useMutableSource:Fu,useSyncExternalStore:zu,useId:Eh,unstable_isNewReconciler:!1},Uu={readContext:kr,useCallback:lf,useContext:kr,useEffect:rf,useImperativeHandle:_h,useInsertionEffect:of,useLayoutEffect:af,useMemo:hn,useReducer:ju,useRef:nf,useState:function(){return ju(gr)},useDebugValue:vo,useDeferredValue:function(r){var o=Bn();return Cn===null?o.memoizedState=r:wh(o,Cn.memoizedState,r)},useTransition:function(){var r=ju(gr)[0],o=Bn().memoizedState;return[r,o]},useMutableSource:Fu,useSyncExternalStore:zu,useId:Eh,unstable_isNewReconciler:!1};function or(r,o){if(r&&r.defaultProps){o=z({},o),r=r.defaultProps;for(var C in r)o[C]===void 0&&(o[C]=r[C]);return o}return o}function Ml(r,o,C,F){o=r.memoizedState,C=C(F,o),C=C==null?o:z({},o,C),r.memoizedState=C,r.lanes===0&&(r.updateQueue.baseState=C)}var Ll={isMounted:function(r){return(r=r._reactInternals)?Gt(r)===r:!1},enqueueSetState:function(r,o,C){r=r._reactInternals;var F=ni(),V=Fl(r),J=Vi(F,V);J.payload=o,C!=null&&(J.callback=C),o=$i(r,J,V),o!==null&&(bo(o,r,V,F),Iu(o,r,V))},enqueueReplaceState:function(r,o,C){r=r._reactInternals;var F=ni(),V=Fl(r),J=Vi(F,V);J.tag=1,J.payload=o,C!=null&&(J.callback=C),o=$i(r,J,V),o!==null&&(bo(o,r,V,F),Iu(o,r,V))},enqueueForceUpdate:function(r,o){r=r._reactInternals;var C=ni(),F=Fl(r),V=Vi(C,F);V.tag=2,o!=null&&(V.callback=o),o=$i(r,V,F),o!==null&&(bo(o,r,F,C),Iu(o,r,F))}};function qu(r,o,C,F,V,J,oe){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(F,J,oe):o.prototype&&o.prototype.isPureReactComponent?!wa(C,F)||!wa(V,J):!0}function Ph(r,o,C){var F=!1,V=Ui,J=o.contextType;return typeof J=="object"&&J!==null?J=kr(J):(V=hr(o)?Yo:ir.current,F=o.contextTypes,J=(F=F!=null)?Ta(r,V):Ui),o=new o(C,J),r.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Ll,r.stateNode=o,o._reactInternals=r,F&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=V,r.__reactInternalMemoizedMaskedChildContext=J),o}function uf(r,o,C,F){r=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(C,F),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(C,F),o.state!==r&&Ll.enqueueReplaceState(o,o.state,null)}function Hu(r,o,C,F){var V=r.stateNode;V.props=C,V.state=r.memoizedState,V.refs={},Ps(r);var J=o.contextType;typeof J=="object"&&J!==null?V.context=kr(J):(J=hr(o)?Yo:ir.current,V.context=Ta(r,J)),V.state=r.memoizedState,J=o.getDerivedStateFromProps,typeof J=="function"&&(Ml(r,o,J,C),V.state=r.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof V.getSnapshotBeforeUpdate=="function"||typeof V.UNSAFE_componentWillMount!="function"&&typeof V.componentWillMount!="function"||(o=V.state,typeof V.componentWillMount=="function"&&V.componentWillMount(),typeof V.UNSAFE_componentWillMount=="function"&&V.UNSAFE_componentWillMount(),o!==V.state&&Ll.enqueueReplaceState(V,V.state,null),El(r,C,V,F),V.state=r.memoizedState),typeof V.componentDidMount=="function"&&(r.flags|=4194308)}function za(r,o){try{var C="",F=o;do C+=G(F),F=F.return;while(F);var V=C}catch(J){V=`
31
- Error generating stack: `+J.message+`
32
- `+J.stack}return{value:r,source:o,stack:V,digest:null}}function Gu(r,o,C){return{value:r,source:null,stack:C??null,digest:o??null}}function Nl(r,o){try{console.error(o.value)}catch(C){setTimeout(function(){throw C})}}var Jp=typeof WeakMap=="function"?WeakMap:Map;function Ch(r,o,C){C=Vi(-1,C),C.tag=3,C.payload={element:null};var F=o.value;return C.callback=function(){Mh||(Mh=!0,u0=F),Nl(r,o)},C}function u(r,o,C){C=Vi(-1,C),C.tag=3;var F=r.type.getDerivedStateFromError;if(typeof F=="function"){var V=o.value;C.payload=function(){return F(V)},C.callback=function(){Nl(r,o)}}var J=r.stateNode;return J!==null&&typeof J.componentDidCatch=="function"&&(C.callback=function(){Nl(r,o),typeof F!="function"&&(Dl===null?Dl=new Set([this]):Dl.add(this));var oe=o.stack;this.componentDidCatch(o.value,{componentStack:oe!==null?oe:""})}),C}function f(r,o,C){var F=r.pingCache;if(F===null){F=r.pingCache=new Jp;var V=new Set;F.set(o,V)}else V=F.get(o),V===void 0&&(V=new Set,F.set(o,V));V.has(C)||(V.add(C),r=F_.bind(null,r,o,C),o.then(r,r))}function D(r){do{var o;if((o=r.tag===13)&&(o=r.memoizedState,o=o!==null?o.dehydrated!==null:!0),o)return r;r=r.return}while(r!==null);return null}function H(r,o,C,F,V){return r.mode&1?(r.flags|=65536,r.lanes=V,r):(r===o?r.flags|=65536:(r.flags|=128,C.flags|=131072,C.flags&=-52805,C.tag===1&&(C.alternate===null?C.tag=17:(o=Vi(-1,1),o.tag=2,$i(C,o,1))),C.lanes|=1),r)}var K=b.ReactCurrentOwner,ne=!1;function le(r,o,C,F){o.child=r===null?ci(o,null,C,F):Da(o,r.child,C,F)}function ye(r,o,C,F,V){C=C.render;var J=o.ref;return ho(o,V),F=Cl(r,o,C,F,J,V),C=kl(),r!==null&&!ne?(o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~V,mr(r,o,V)):(Zt&&C&&bl(o),o.flags|=1,le(r,o,F,V),o.child)}function Re(r,o,C,F,V){if(r===null){var J=C.type;return typeof J=="function"&&!v0(J)&&J.defaultProps===void 0&&C.compare===null&&C.defaultProps===void 0?(o.tag=15,o.type=J,Ge(r,o,J,F,V)):(r=Fh(C.type,null,F,o,o.mode,V),r.ref=o.ref,r.return=o,o.child=r)}if(J=r.child,!(r.lanes&V)){var oe=J.memoizedProps;if(C=C.compare,C=C!==null?C:wa,C(oe,F)&&r.ref===o.ref)return mr(r,o,V)}return o.flags|=1,r=Bl(J,F),r.ref=o.ref,r.return=o,o.child=r}function Ge(r,o,C,F,V){if(r!==null){var J=r.memoizedProps;if(wa(J,F)&&r.ref===o.ref)if(ne=!1,o.pendingProps=F=J,(r.lanes&V)!==0)r.flags&131072&&(ne=!0);else return o.lanes=r.lanes,mr(r,o,V)}return Qe(r,o,C,F,V)}function it(r,o,C){var F=o.pendingProps,V=F.children,J=r!==null?r.memoizedState:null;if(F.mode==="hidden")if(!(o.mode&1))o.memoizedState={baseLanes:0,cachePool:null,transitions:null},tn($u,ki),ki|=C;else{if(!(C&1073741824))return r=J!==null?J.baseLanes|C:C,o.lanes=o.childLanes=1073741824,o.memoizedState={baseLanes:r,cachePool:null,transitions:null},o.updateQueue=null,tn($u,ki),ki|=r,null;o.memoizedState={baseLanes:0,cachePool:null,transitions:null},F=J!==null?J.baseLanes:C,tn($u,ki),ki|=F}else J!==null?(F=J.baseLanes|C,o.memoizedState=null):F=C,tn($u,ki),ki|=F;return le(r,o,V,C),o.child}function Ot(r,o){var C=o.ref;(r===null&&C!==null||r!==null&&r.ref!==C)&&(o.flags|=512,o.flags|=2097152)}function Qe(r,o,C,F,V){var J=hr(C)?Yo:ir.current;return J=Ta(o,J),ho(o,V),C=Cl(r,o,C,F,J,V),F=kl(),r!==null&&!ne?(o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~V,mr(r,o,V)):(Zt&&F&&bl(o),o.flags|=1,le(r,o,C,V),o.child)}function sn(r,o,C,F,V){if(hr(C)){var J=!0;Ra(o)}else J=!1;if(ho(o,V),o.stateNode===null)zt(r,o),Ph(o,C,F),Hu(o,C,F,V),F=!0;else if(r===null){var oe=o.stateNode,fe=o.memoizedProps;oe.props=fe;var ge=oe.context,Te=C.contextType;typeof Te=="object"&&Te!==null?Te=kr(Te):(Te=hr(C)?Yo:ir.current,Te=Ta(o,Te));var qe=C.getDerivedStateFromProps,He=typeof qe=="function"||typeof oe.getSnapshotBeforeUpdate=="function";He||typeof oe.UNSAFE_componentWillReceiveProps!="function"&&typeof oe.componentWillReceiveProps!="function"||(fe!==F||ge!==Te)&&uf(o,oe,F,Te),Gi=!1;var Ue=o.memoizedState;oe.state=Ue,El(o,F,oe,V),ge=o.memoizedState,fe!==F||Ue!==ge||dr.current||Gi?(typeof qe=="function"&&(Ml(o,C,qe,F),ge=o.memoizedState),(fe=Gi||qu(o,C,fe,F,Ue,ge,Te))?(He||typeof oe.UNSAFE_componentWillMount!="function"&&typeof oe.componentWillMount!="function"||(typeof oe.componentWillMount=="function"&&oe.componentWillMount(),typeof oe.UNSAFE_componentWillMount=="function"&&oe.UNSAFE_componentWillMount()),typeof oe.componentDidMount=="function"&&(o.flags|=4194308)):(typeof oe.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=F,o.memoizedState=ge),oe.props=F,oe.state=ge,oe.context=Te,F=fe):(typeof oe.componentDidMount=="function"&&(o.flags|=4194308),F=!1)}else{oe=o.stateNode,Nu(r,o),fe=o.memoizedProps,Te=o.type===o.elementType?fe:or(o.type,fe),oe.props=Te,He=o.pendingProps,Ue=oe.context,ge=C.contextType,typeof ge=="object"&&ge!==null?ge=kr(ge):(ge=hr(C)?Yo:ir.current,ge=Ta(o,ge));var tt=C.getDerivedStateFromProps;(qe=typeof tt=="function"||typeof oe.getSnapshotBeforeUpdate=="function")||typeof oe.UNSAFE_componentWillReceiveProps!="function"&&typeof oe.componentWillReceiveProps!="function"||(fe!==He||Ue!==ge)&&uf(o,oe,F,ge),Gi=!1,Ue=o.memoizedState,oe.state=Ue,El(o,F,oe,V);var lt=o.memoizedState;fe!==He||Ue!==lt||dr.current||Gi?(typeof tt=="function"&&(Ml(o,C,tt,F),lt=o.memoizedState),(Te=Gi||qu(o,C,Te,F,Ue,lt,ge)||!1)?(qe||typeof oe.UNSAFE_componentWillUpdate!="function"&&typeof oe.componentWillUpdate!="function"||(typeof oe.componentWillUpdate=="function"&&oe.componentWillUpdate(F,lt,ge),typeof oe.UNSAFE_componentWillUpdate=="function"&&oe.UNSAFE_componentWillUpdate(F,lt,ge)),typeof oe.componentDidUpdate=="function"&&(o.flags|=4),typeof oe.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof oe.componentDidUpdate!="function"||fe===r.memoizedProps&&Ue===r.memoizedState||(o.flags|=4),typeof oe.getSnapshotBeforeUpdate!="function"||fe===r.memoizedProps&&Ue===r.memoizedState||(o.flags|=1024),o.memoizedProps=F,o.memoizedState=lt),oe.props=F,oe.state=lt,oe.context=ge,F=Te):(typeof oe.componentDidUpdate!="function"||fe===r.memoizedProps&&Ue===r.memoizedState||(o.flags|=4),typeof oe.getSnapshotBeforeUpdate!="function"||fe===r.memoizedProps&&Ue===r.memoizedState||(o.flags|=1024),F=!1)}return Qt(r,o,C,F,J,V)}function Qt(r,o,C,F,V,J){Ot(r,o);var oe=(o.flags&128)!==0;if(!F&&!oe)return V&&gh(o,C,!1),mr(r,o,J);F=o.stateNode,K.current=o;var fe=oe&&typeof C.getDerivedStateFromError!="function"?null:F.render();return o.flags|=1,r!==null&&oe?(o.child=Da(o,r.child,null,J),o.child=Da(o,null,fe,J)):le(r,o,fe,J),o.memoizedState=F.state,V&&gh(o,C,!0),o.child}function Tr(r){var o=r.stateNode;o.pendingContext?Xc(r,o.pendingContext,o.pendingContext!==o.context):o.context&&Xc(r,o.context,!1),Jo(r,o.containerInfo)}function Wi(r,o,C,F,V){return Ia(),Es(V),o.flags|=256,le(r,o,C,F),o.child}var ke={dehydrated:null,treeContext:null,retryLane:0};function be(r){return{baseLanes:r,cachePool:null,transitions:null}}function Ne(r,o,C){var F=o.pendingProps,V=ln.current,J=!1,oe=(o.flags&128)!==0,fe;if((fe=oe)||(fe=r!==null&&r.memoizedState===null?!1:(V&2)!==0),fe?(J=!0,o.flags&=-129):(r===null||r.memoizedState!==null)&&(V|=1),tn(ln,V&1),r===null)return _l(o),r=o.memoizedState,r!==null&&(r=r.dehydrated,r!==null)?(o.mode&1?r.data==="$!"?o.lanes=8:o.lanes=1073741824:o.lanes=1,null):(oe=F.children,r=F.fallback,J?(F=o.mode,J=o.child,oe={mode:"hidden",children:oe},!(F&1)&&J!==null?(J.childLanes=0,J.pendingProps=oe):J=zh(oe,F,0,null),r=Ns(r,F,C,null),J.return=o,r.return=o,J.sibling=r,o.child=J,o.child.memoizedState=be(C),o.memoizedState=ke,r):Je(o,oe));if(V=r.memoizedState,V!==null&&(fe=V.dehydrated,fe!==null))return Rt(r,o,oe,F,fe,V,C);if(J){J=F.fallback,oe=o.mode,V=r.child,fe=V.sibling;var ge={mode:"hidden",children:F.children};return!(oe&1)&&o.child!==V?(F=o.child,F.childLanes=0,F.pendingProps=ge,o.deletions=null):(F=Bl(V,ge),F.subtreeFlags=V.subtreeFlags&14680064),fe!==null?J=Bl(fe,J):(J=Ns(J,oe,C,null),J.flags|=2),J.return=o,F.return=o,F.sibling=J,o.child=F,F=J,J=o.child,oe=r.child.memoizedState,oe=oe===null?be(C):{baseLanes:oe.baseLanes|C,cachePool:null,transitions:oe.transitions},J.memoizedState=oe,J.childLanes=r.childLanes&~C,o.memoizedState=ke,F}return J=r.child,r=J.sibling,F=Bl(J,{mode:"visible",children:F.children}),!(o.mode&1)&&(F.lanes=C),F.return=o,F.sibling=null,r!==null&&(C=o.deletions,C===null?(o.deletions=[r],o.flags|=16):C.push(r)),o.child=F,o.memoizedState=null,F}function Je(r,o){return o=zh({mode:"visible",children:o},r.mode,0,null),o.return=r,r.child=o}function pt(r,o,C,F){return F!==null&&Es(F),Da(o,r.child,null,C),r=Je(o,o.pendingProps.children),r.flags|=2,o.memoizedState=null,r}function Rt(r,o,C,F,V,J,oe){if(C)return o.flags&256?(o.flags&=-257,F=Gu(Error(t(422))),pt(r,o,oe,F)):o.memoizedState!==null?(o.child=r.child,o.flags|=128,null):(J=F.fallback,V=o.mode,F=zh({mode:"visible",children:F.children},V,0,null),J=Ns(J,V,oe,null),J.flags|=2,F.return=o,J.return=o,F.sibling=J,o.child=F,o.mode&1&&Da(o,r.child,null,oe),o.child.memoizedState=be(oe),o.memoizedState=ke,J);if(!(o.mode&1))return pt(r,o,oe,null);if(V.data==="$!"){if(F=V.nextSibling&&V.nextSibling.dataset,F)var fe=F.dgst;return F=fe,J=Error(t(419)),F=Gu(J,F,void 0),pt(r,o,oe,F)}if(fe=(oe&r.childLanes)!==0,ne||fe){if(F=yr,F!==null){switch(oe&-oe){case 4:V=2;break;case 16:V=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:V=32;break;case 536870912:V=268435456;break;default:V=0}V=V&(F.suspendedLanes|oe)?0:V,V!==0&&V!==J.retryLane&&(J.retryLane=V,ei(r,V),bo(F,r,V,-1))}return g0(),F=Gu(Error(t(421))),pt(r,o,oe,F)}return V.data==="$?"?(o.flags|=128,o.child=r.child,o=z_.bind(null,r),V._reactRetry=o,null):(r=J.treeContext,Xe=zi(V.nextSibling),Zr=o,Zt=!0,Qr=null,r!==null&&(Pr[Cr++]=Xr,Pr[Cr++]=vn,Pr[Cr++]=Qo,Xr=r.id,vn=r.overflow,Qo=o),o=Je(o,F.children),o.flags|=4096,o)}function xt(r,o,C){r.lanes|=o;var F=r.alternate;F!==null&&(F.lanes|=o),Lu(r.return,o,C)}function Ut(r,o,C,F,V){var J=r.memoizedState;J===null?r.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:F,tail:C,tailMode:V}:(J.isBackwards=o,J.rendering=null,J.renderingStartTime=0,J.last=F,J.tail=C,J.tailMode=V)}function Un(r,o,C){var F=o.pendingProps,V=F.revealOrder,J=F.tail;if(le(r,o,F.children,C),F=ln.current,F&2)F=F&1|2,o.flags|=128;else{if(r!==null&&r.flags&128)e:for(r=o.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&xt(r,C,o);else if(r.tag===19)xt(r,C,o);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===o)break e;for(;r.sibling===null;){if(r.return===null||r.return===o)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}F&=1}if(tn(ln,F),!(o.mode&1))o.memoizedState=null;else switch(V){case"forwards":for(C=o.child,V=null;C!==null;)r=C.alternate,r!==null&&xl(r)===null&&(V=C),C=C.sibling;C=V,C===null?(V=o.child,o.child=null):(V=C.sibling,C.sibling=null),Ut(o,!1,V,C,J);break;case"backwards":for(C=null,V=o.child,o.child=null;V!==null;){if(r=V.alternate,r!==null&&xl(r)===null){o.child=V;break}r=V.sibling,V.sibling=C,C=V,V=r}Ut(o,!0,C,null,J);break;case"together":Ut(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function zt(r,o){!(o.mode&1)&&r!==null&&(r.alternate=null,o.alternate=null,o.flags|=2)}function mr(r,o,C){if(r!==null&&(o.dependencies=r.dependencies),Ts|=o.lanes,!(C&o.childLanes))return null;if(r!==null&&o.child!==r.child)throw Error(t(153));if(o.child!==null){for(r=o.child,C=Bl(r,r.pendingProps),o.child=C,C.return=o;r.sibling!==null;)r=r.sibling,C=C.sibling=Bl(r,r.pendingProps),C.return=o;C.sibling=null}return o.child}function e0(r,o,C){switch(o.tag){case 3:Tr(o),Ia();break;case 5:Ol(o);break;case 1:hr(o.type)&&Ra(o);break;case 4:Jo(o,o.stateNode.containerInfo);break;case 10:var F=o.type._context,V=o.memoizedProps.value;tn(Os,F._currentValue),F._currentValue=V;break;case 13:if(F=o.memoizedState,F!==null)return F.dehydrated!==null?(tn(ln,ln.current&1),o.flags|=128,null):C&o.child.childLanes?Ne(r,o,C):(tn(ln,ln.current&1),r=mr(r,o,C),r!==null?r.sibling:null);tn(ln,ln.current&1);break;case 19:if(F=(C&o.childLanes)!==0,r.flags&128){if(F)return Un(r,o,C);o.flags|=128}if(V=o.memoizedState,V!==null&&(V.rendering=null,V.tail=null,V.lastEffect=null),tn(ln,ln.current),F)break;return null;case 22:case 23:return o.lanes=0,it(r,o,C)}return mr(r,o,C)}var Bv,t0,Uv,qv;Bv=function(r,o){for(var C=o.child;C!==null;){if(C.tag===5||C.tag===6)r.appendChild(C.stateNode);else if(C.tag!==4&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===o)break;for(;C.sibling===null;){if(C.return===null||C.return===o)return;C=C.return}C.sibling.return=C.return,C=C.sibling}},t0=function(){},Uv=function(r,o,C,F){var V=r.memoizedProps;if(V!==F){r=o.stateNode,zn(nn.current);var J=null;switch(C){case"input":V=he(r,V),F=he(r,F),J=[];break;case"select":V=z({},V,{value:void 0}),F=z({},F,{value:void 0}),J=[];break;case"textarea":V=ue(r,V),F=ue(r,F),J=[];break;default:typeof V.onClick!="function"&&typeof F.onClick=="function"&&(r.onclick=Ca)}Se(C,F);var oe;C=null;for(Te in V)if(!F.hasOwnProperty(Te)&&V.hasOwnProperty(Te)&&V[Te]!=null)if(Te==="style"){var fe=V[Te];for(oe in fe)fe.hasOwnProperty(oe)&&(C||(C={}),C[oe]="")}else Te!=="dangerouslySetInnerHTML"&&Te!=="children"&&Te!=="suppressContentEditableWarning"&&Te!=="suppressHydrationWarning"&&Te!=="autoFocus"&&(a.hasOwnProperty(Te)?J||(J=[]):(J=J||[]).push(Te,null));for(Te in F){var ge=F[Te];if(fe=V!=null?V[Te]:void 0,F.hasOwnProperty(Te)&&ge!==fe&&(ge!=null||fe!=null))if(Te==="style")if(fe){for(oe in fe)!fe.hasOwnProperty(oe)||ge&&ge.hasOwnProperty(oe)||(C||(C={}),C[oe]="");for(oe in ge)ge.hasOwnProperty(oe)&&fe[oe]!==ge[oe]&&(C||(C={}),C[oe]=ge[oe])}else C||(J||(J=[]),J.push(Te,C)),C=ge;else Te==="dangerouslySetInnerHTML"?(ge=ge?ge.__html:void 0,fe=fe?fe.__html:void 0,ge!=null&&fe!==ge&&(J=J||[]).push(Te,ge)):Te==="children"?typeof ge!="string"&&typeof ge!="number"||(J=J||[]).push(Te,""+ge):Te!=="suppressContentEditableWarning"&&Te!=="suppressHydrationWarning"&&(a.hasOwnProperty(Te)?(ge!=null&&Te==="onScroll"&&on("scroll",r),J||fe===ge||(J=[])):(J=J||[]).push(Te,ge))}C&&(J=J||[]).push("style",C);var Te=J;(o.updateQueue=Te)&&(o.flags|=4)}},qv=function(r,o,C,F){C!==F&&(o.flags|=4)};function cf(r,o){if(!Zt)switch(r.tailMode){case"hidden":o=r.tail;for(var C=null;o!==null;)o.alternate!==null&&(C=o),o=o.sibling;C===null?r.tail=null:C.sibling=null;break;case"collapsed":C=r.tail;for(var F=null;C!==null;)C.alternate!==null&&(F=C),C=C.sibling;F===null?o||r.tail===null?r.tail=null:r.tail.sibling=null:F.sibling=null}}function qr(r){var o=r.alternate!==null&&r.alternate.child===r.child,C=0,F=0;if(o)for(var V=r.child;V!==null;)C|=V.lanes|V.childLanes,F|=V.subtreeFlags&14680064,F|=V.flags&14680064,V.return=r,V=V.sibling;else for(V=r.child;V!==null;)C|=V.lanes|V.childLanes,F|=V.subtreeFlags,F|=V.flags,V.return=r,V=V.sibling;return r.subtreeFlags|=F,r.childLanes=C,o}function k_(r,o,C){var F=o.pendingProps;switch(Kn(o),o.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qr(o),null;case 1:return hr(o.type)&&ml(),qr(o),null;case 3:return F=o.stateNode,yn(),an(dr),an(ir),pr(),F.pendingContext&&(F.context=F.pendingContext,F.pendingContext=null),(r===null||r.child===null)&&(Ss(o)?o.flags|=4:r===null||r.memoizedState.isDehydrated&&!(o.flags&256)||(o.flags|=1024,Qr!==null&&(d0(Qr),Qr=null))),t0(r,o),qr(o),null;case 5:po(o);var V=zn(An.current);if(C=o.type,r!==null&&o.stateNode!=null)Uv(r,o,C,F,V),r.ref!==o.ref&&(o.flags|=512,o.flags|=2097152);else{if(!F){if(o.stateNode===null)throw Error(t(166));return qr(o),null}if(r=zn(nn.current),Ss(o)){F=o.stateNode,C=o.type;var J=o.memoizedProps;switch(F[ui]=o,F[bs]=J,r=(o.mode&1)!==0,C){case"dialog":on("cancel",F),on("close",F);break;case"iframe":case"object":case"embed":on("load",F);break;case"video":case"audio":for(V=0;V<Vo.length;V++)on(Vo[V],F);break;case"source":on("error",F);break;case"img":case"image":case"link":on("error",F),on("load",F);break;case"details":on("toggle",F);break;case"input":Oe(F,J),on("invalid",F);break;case"select":F._wrapperState={wasMultiple:!!J.multiple},on("invalid",F);break;case"textarea":ve(F,J),on("invalid",F)}Se(C,J),V=null;for(var oe in J)if(J.hasOwnProperty(oe)){var fe=J[oe];oe==="children"?typeof fe=="string"?F.textContent!==fe&&(J.suppressHydrationWarning!==!0&&ms(F.textContent,fe,r),V=["children",fe]):typeof fe=="number"&&F.textContent!==""+fe&&(J.suppressHydrationWarning!==!0&&ms(F.textContent,fe,r),V=["children",""+fe]):a.hasOwnProperty(oe)&&fe!=null&&oe==="onScroll"&&on("scroll",F)}switch(C){case"input":ae(F),ce(F,J,!0);break;case"textarea":ae(F),je(F);break;case"select":case"option":break;default:typeof J.onClick=="function"&&(F.onclick=Ca)}F=V,o.updateQueue=F,F!==null&&(o.flags|=4)}else{oe=V.nodeType===9?V:V.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=at(C)),r==="http://www.w3.org/1999/xhtml"?C==="script"?(r=oe.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof F.is=="string"?r=oe.createElement(C,{is:F.is}):(r=oe.createElement(C),C==="select"&&(oe=r,F.multiple?oe.multiple=!0:F.size&&(oe.size=F.size))):r=oe.createElementNS(r,C),r[ui]=o,r[bs]=F,Bv(r,o,!1,!1),o.stateNode=r;e:{switch(oe=gt(C,F),C){case"dialog":on("cancel",r),on("close",r),V=F;break;case"iframe":case"object":case"embed":on("load",r),V=F;break;case"video":case"audio":for(V=0;V<Vo.length;V++)on(Vo[V],r);V=F;break;case"source":on("error",r),V=F;break;case"img":case"image":case"link":on("error",r),on("load",r),V=F;break;case"details":on("toggle",r),V=F;break;case"input":Oe(r,F),V=he(r,F),on("invalid",r);break;case"option":V=F;break;case"select":r._wrapperState={wasMultiple:!!F.multiple},V=z({},F,{value:void 0}),on("invalid",r);break;case"textarea":ve(r,F),V=ue(r,F),on("invalid",r);break;default:V=F}Se(C,V),fe=V;for(J in fe)if(fe.hasOwnProperty(J)){var ge=fe[J];J==="style"?Ct(r,ge):J==="dangerouslySetInnerHTML"?(ge=ge?ge.__html:void 0,ge!=null&&Ke(r,ge)):J==="children"?typeof ge=="string"?(C!=="textarea"||ge!=="")&&ze(r,ge):typeof ge=="number"&&ze(r,""+ge):J!=="suppressContentEditableWarning"&&J!=="suppressHydrationWarning"&&J!=="autoFocus"&&(a.hasOwnProperty(J)?ge!=null&&J==="onScroll"&&on("scroll",r):ge!=null&&y(r,J,ge,oe))}switch(C){case"input":ae(r),ce(r,F,!1);break;case"textarea":ae(r),je(r);break;case"option":F.value!=null&&r.setAttribute("value",""+te(F.value));break;case"select":r.multiple=!!F.multiple,J=F.value,J!=null?Le(r,!!F.multiple,J,!1):F.defaultValue!=null&&Le(r,!!F.multiple,F.defaultValue,!0);break;default:typeof V.onClick=="function"&&(r.onclick=Ca)}switch(C){case"button":case"input":case"select":case"textarea":F=!!F.autoFocus;break e;case"img":F=!0;break e;default:F=!1}}F&&(o.flags|=4)}o.ref!==null&&(o.flags|=512,o.flags|=2097152)}return qr(o),null;case 6:if(r&&o.stateNode!=null)qv(r,o,r.memoizedProps,F);else{if(typeof F!="string"&&o.stateNode===null)throw Error(t(166));if(C=zn(An.current),zn(nn.current),Ss(o)){if(F=o.stateNode,C=o.memoizedProps,F[ui]=o,(J=F.nodeValue!==C)&&(r=Zr,r!==null))switch(r.tag){case 3:ms(F.nodeValue,C,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&ms(F.nodeValue,C,(r.mode&1)!==0)}J&&(o.flags|=4)}else F=(C.nodeType===9?C:C.ownerDocument).createTextNode(F),F[ui]=o,o.stateNode=F}return qr(o),null;case 13:if(an(ln),F=o.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(Zt&&Xe!==null&&o.mode&1&&!(o.flags&128))Qc(),Ia(),o.flags|=98560,J=!1;else if(J=Ss(o),F!==null&&F.dehydrated!==null){if(r===null){if(!J)throw Error(t(318));if(J=o.memoizedState,J=J!==null?J.dehydrated:null,!J)throw Error(t(317));J[ui]=o}else Ia(),!(o.flags&128)&&(o.memoizedState=null),o.flags|=4;qr(o),J=!1}else Qr!==null&&(d0(Qr),Qr=null),J=!0;if(!J)return o.flags&65536?o:null}return o.flags&128?(o.lanes=C,o):(F=F!==null,F!==(r!==null&&r.memoizedState!==null)&&F&&(o.child.flags|=8192,o.mode&1&&(r===null||ln.current&1?ar===0&&(ar=3):g0())),o.updateQueue!==null&&(o.flags|=4),qr(o),null);case 4:return yn(),t0(r,o),r===null&&xa(o.stateNode.containerInfo),qr(o),null;case 10:return Mu(o.type._context),qr(o),null;case 17:return hr(o.type)&&ml(),qr(o),null;case 19:if(an(ln),J=o.memoizedState,J===null)return qr(o),null;if(F=(o.flags&128)!==0,oe=J.rendering,oe===null)if(F)cf(J,!1);else{if(ar!==0||r!==null&&r.flags&128)for(r=o.child;r!==null;){if(oe=xl(r),oe!==null){for(o.flags|=128,cf(J,!1),F=oe.updateQueue,F!==null&&(o.updateQueue=F,o.flags|=4),o.subtreeFlags=0,F=C,C=o.child;C!==null;)J=C,r=F,J.flags&=14680066,oe=J.alternate,oe===null?(J.childLanes=0,J.lanes=r,J.child=null,J.subtreeFlags=0,J.memoizedProps=null,J.memoizedState=null,J.updateQueue=null,J.dependencies=null,J.stateNode=null):(J.childLanes=oe.childLanes,J.lanes=oe.lanes,J.child=oe.child,J.subtreeFlags=0,J.deletions=null,J.memoizedProps=oe.memoizedProps,J.memoizedState=oe.memoizedState,J.updateQueue=oe.updateQueue,J.type=oe.type,r=oe.dependencies,J.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),C=C.sibling;return tn(ln,ln.current&1|2),o.child}r=r.sibling}J.tail!==null&&en()>Wu&&(o.flags|=128,F=!0,cf(J,!1),o.lanes=4194304)}else{if(!F)if(r=xl(oe),r!==null){if(o.flags|=128,F=!0,C=r.updateQueue,C!==null&&(o.updateQueue=C,o.flags|=4),cf(J,!0),J.tail===null&&J.tailMode==="hidden"&&!oe.alternate&&!Zt)return qr(o),null}else 2*en()-J.renderingStartTime>Wu&&C!==1073741824&&(o.flags|=128,F=!0,cf(J,!1),o.lanes=4194304);J.isBackwards?(oe.sibling=o.child,o.child=oe):(C=J.last,C!==null?C.sibling=oe:o.child=oe,J.last=oe)}return J.tail!==null?(o=J.tail,J.rendering=o,J.tail=o.sibling,J.renderingStartTime=en(),o.sibling=null,C=ln.current,tn(ln,F?C&1|2:C&1),o):(qr(o),null);case 22:case 23:return p0(),F=o.memoizedState!==null,r!==null&&r.memoizedState!==null!==F&&(o.flags|=8192),F&&o.mode&1?ki&1073741824&&(qr(o),o.subtreeFlags&6&&(o.flags|=8192)):qr(o),null;case 24:return null;case 25:return null}throw Error(t(156,o.tag))}function A_(r,o){switch(Kn(o),o.tag){case 1:return hr(o.type)&&ml(),r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 3:return yn(),an(dr),an(ir),pr(),r=o.flags,r&65536&&!(r&128)?(o.flags=r&-65537|128,o):null;case 5:return po(o),null;case 13:if(an(ln),r=o.memoizedState,r!==null&&r.dehydrated!==null){if(o.alternate===null)throw Error(t(340));Ia()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 19:return an(ln),null;case 4:return yn(),null;case 10:return Mu(o.type._context),null;case 22:case 23:return p0(),null;case 24:return null;default:return null}}var kh=!1,Hr=!1,T_=typeof WeakSet=="function"?WeakSet:Set,ot=null;function Vu(r,o){var C=r.ref;if(C!==null)if(typeof C=="function")try{C(null)}catch(F){Nn(r,o,F)}else C.current=null}function n0(r,o,C){try{C()}catch(F){Nn(r,o,F)}}var Hv=!1;function R_(r,o){if($c=iu,r=jn(),hl(r)){if("selectionStart"in r)var C={start:r.selectionStart,end:r.selectionEnd};else e:{C=(C=r.ownerDocument)&&C.defaultView||window;var F=C.getSelection&&C.getSelection();if(F&&F.rangeCount!==0){C=F.anchorNode;var V=F.anchorOffset,J=F.focusNode;F=F.focusOffset;try{C.nodeType,J.nodeType}catch{C=null;break e}var oe=0,fe=-1,ge=-1,Te=0,qe=0,He=r,Ue=null;t:for(;;){for(var tt;He!==C||V!==0&&He.nodeType!==3||(fe=oe+V),He!==J||F!==0&&He.nodeType!==3||(ge=oe+F),He.nodeType===3&&(oe+=He.nodeValue.length),(tt=He.firstChild)!==null;)Ue=He,He=tt;for(;;){if(He===r)break t;if(Ue===C&&++Te===V&&(fe=oe),Ue===J&&++qe===F&&(ge=oe),(tt=He.nextSibling)!==null)break;He=Ue,Ue=He.parentNode}He=tt}C=fe===-1||ge===-1?null:{start:fe,end:ge}}else C=null}C=C||{start:0,end:0}}else C=null;for(Wc={focusedElem:r,selectionRange:C},iu=!1,ot=o;ot!==null;)if(o=ot,r=o.child,(o.subtreeFlags&1028)!==0&&r!==null)r.return=o,ot=r;else for(;ot!==null;){o=ot;try{var lt=o.alternate;if(o.flags&1024)switch(o.tag){case 0:case 11:case 15:break;case 1:if(lt!==null){var ut=lt.memoizedProps,qn=lt.memoizedState,Ee=o.stateNode,me=Ee.getSnapshotBeforeUpdate(o.elementType===o.type?ut:or(o.type,ut),qn);Ee.__reactInternalSnapshotBeforeUpdate=me}break;case 3:var Pe=o.stateNode.containerInfo;Pe.nodeType===1?Pe.textContent="":Pe.nodeType===9&&Pe.documentElement&&Pe.removeChild(Pe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch($e){Nn(o,o.return,$e)}if(r=o.sibling,r!==null){r.return=o.return,ot=r;break}ot=o.return}return lt=Hv,Hv=!1,lt}function ff(r,o,C){var F=o.updateQueue;if(F=F!==null?F.lastEffect:null,F!==null){var V=F=F.next;do{if((V.tag&r)===r){var J=V.destroy;V.destroy=void 0,J!==void 0&&n0(o,C,J)}V=V.next}while(V!==F)}}function Ah(r,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var C=o=o.next;do{if((C.tag&r)===r){var F=C.create;C.destroy=F()}C=C.next}while(C!==o)}}function r0(r){var o=r.ref;if(o!==null){var C=r.stateNode;switch(r.tag){case 5:r=C;break;default:r=C}typeof o=="function"?o(r):o.current=r}}function Gv(r){var o=r.alternate;o!==null&&(r.alternate=null,Gv(o)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(o=r.stateNode,o!==null&&(delete o[ui],delete o[bs],delete o[Ou],delete o[hh],delete o[ph])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function Vv(r){return r.tag===5||r.tag===3||r.tag===4}function $v(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Vv(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function i0(r,o,C){var F=r.tag;if(F===5||F===6)r=r.stateNode,o?C.nodeType===8?C.parentNode.insertBefore(r,o):C.insertBefore(r,o):(C.nodeType===8?(o=C.parentNode,o.insertBefore(r,C)):(o=C,o.appendChild(r)),C=C._reactRootContainer,C!=null||o.onclick!==null||(o.onclick=Ca));else if(F!==4&&(r=r.child,r!==null))for(i0(r,o,C),r=r.sibling;r!==null;)i0(r,o,C),r=r.sibling}function o0(r,o,C){var F=r.tag;if(F===5||F===6)r=r.stateNode,o?C.insertBefore(r,o):C.appendChild(r);else if(F!==4&&(r=r.child,r!==null))for(o0(r,o,C),r=r.sibling;r!==null;)o0(r,o,C),r=r.sibling}var Rr=null,mo=!1;function Il(r,o,C){for(C=C.child;C!==null;)Wv(r,o,C),C=C.sibling}function Wv(r,o,C){if(er&&typeof er.onCommitFiberUnmount=="function")try{er.onCommitFiberUnmount(ro,C)}catch{}switch(C.tag){case 5:Hr||Vu(C,o);case 6:var F=Rr,V=mo;Rr=null,Il(r,o,C),Rr=F,mo=V,Rr!==null&&(mo?(r=Rr,C=C.stateNode,r.nodeType===8?r.parentNode.removeChild(C):r.removeChild(C)):Rr.removeChild(C.stateNode));break;case 18:Rr!==null&&(mo?(r=Rr,C=C.stateNode,r.nodeType===8?Eu(r.parentNode,C):r.nodeType===1&&Eu(r,C),Fr(r)):Eu(Rr,C.stateNode));break;case 4:F=Rr,V=mo,Rr=C.stateNode.containerInfo,mo=!0,Il(r,o,C),Rr=F,mo=V;break;case 0:case 11:case 14:case 15:if(!Hr&&(F=C.updateQueue,F!==null&&(F=F.lastEffect,F!==null))){V=F=F.next;do{var J=V,oe=J.destroy;J=J.tag,oe!==void 0&&(J&2||J&4)&&n0(C,o,oe),V=V.next}while(V!==F)}Il(r,o,C);break;case 1:if(!Hr&&(Vu(C,o),F=C.stateNode,typeof F.componentWillUnmount=="function"))try{F.props=C.memoizedProps,F.state=C.memoizedState,F.componentWillUnmount()}catch(fe){Nn(C,o,fe)}Il(r,o,C);break;case 21:Il(r,o,C);break;case 22:C.mode&1?(Hr=(F=Hr)||C.memoizedState!==null,Il(r,o,C),Hr=F):Il(r,o,C);break;default:Il(r,o,C)}}function Yv(r){var o=r.updateQueue;if(o!==null){r.updateQueue=null;var C=r.stateNode;C===null&&(C=r.stateNode=new T_),o.forEach(function(F){var V=B_.bind(null,r,F);C.has(F)||(C.add(F),F.then(V,V))})}}function yo(r,o){var C=o.deletions;if(C!==null)for(var F=0;F<C.length;F++){var V=C[F];try{var J=r,oe=o,fe=oe;e:for(;fe!==null;){switch(fe.tag){case 5:Rr=fe.stateNode,mo=!1;break e;case 3:Rr=fe.stateNode.containerInfo,mo=!0;break e;case 4:Rr=fe.stateNode.containerInfo,mo=!0;break e}fe=fe.return}if(Rr===null)throw Error(t(160));Wv(J,oe,V),Rr=null,mo=!1;var ge=V.alternate;ge!==null&&(ge.return=null),V.return=null}catch(Te){Nn(V,o,Te)}}if(o.subtreeFlags&12854)for(o=o.child;o!==null;)Kv(o,r),o=o.sibling}function Kv(r,o){var C=r.alternate,F=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(yo(o,r),ia(r),F&4){try{ff(3,r,r.return),Ah(3,r)}catch(ut){Nn(r,r.return,ut)}try{ff(5,r,r.return)}catch(ut){Nn(r,r.return,ut)}}break;case 1:yo(o,r),ia(r),F&512&&C!==null&&Vu(C,C.return);break;case 5:if(yo(o,r),ia(r),F&512&&C!==null&&Vu(C,C.return),r.flags&32){var V=r.stateNode;try{ze(V,"")}catch(ut){Nn(r,r.return,ut)}}if(F&4&&(V=r.stateNode,V!=null)){var J=r.memoizedProps,oe=C!==null?C.memoizedProps:J,fe=r.type,ge=r.updateQueue;if(r.updateQueue=null,ge!==null)try{fe==="input"&&J.type==="radio"&&J.name!=null&&_e(V,J),gt(fe,oe);var Te=gt(fe,J);for(oe=0;oe<ge.length;oe+=2){var qe=ge[oe],He=ge[oe+1];qe==="style"?Ct(V,He):qe==="dangerouslySetInnerHTML"?Ke(V,He):qe==="children"?ze(V,He):y(V,qe,He,Te)}switch(fe){case"input":Ae(V,J);break;case"textarea":xe(V,J);break;case"select":var Ue=V._wrapperState.wasMultiple;V._wrapperState.wasMultiple=!!J.multiple;var tt=J.value;tt!=null?Le(V,!!J.multiple,tt,!1):Ue!==!!J.multiple&&(J.defaultValue!=null?Le(V,!!J.multiple,J.defaultValue,!0):Le(V,!!J.multiple,J.multiple?[]:"",!1))}V[bs]=J}catch(ut){Nn(r,r.return,ut)}}break;case 6:if(yo(o,r),ia(r),F&4){if(r.stateNode===null)throw Error(t(162));V=r.stateNode,J=r.memoizedProps;try{V.nodeValue=J}catch(ut){Nn(r,r.return,ut)}}break;case 3:if(yo(o,r),ia(r),F&4&&C!==null&&C.memoizedState.isDehydrated)try{Fr(o.containerInfo)}catch(ut){Nn(r,r.return,ut)}break;case 4:yo(o,r),ia(r);break;case 13:yo(o,r),ia(r),V=r.child,V.flags&8192&&(J=V.memoizedState!==null,V.stateNode.isHidden=J,!J||V.alternate!==null&&V.alternate.memoizedState!==null||(s0=en())),F&4&&Yv(r);break;case 22:if(qe=C!==null&&C.memoizedState!==null,r.mode&1?(Hr=(Te=Hr)||qe,yo(o,r),Hr=Te):yo(o,r),ia(r),F&8192){if(Te=r.memoizedState!==null,(r.stateNode.isHidden=Te)&&!qe&&r.mode&1)for(ot=r,qe=r.child;qe!==null;){for(He=ot=qe;ot!==null;){switch(Ue=ot,tt=Ue.child,Ue.tag){case 0:case 11:case 14:case 15:ff(4,Ue,Ue.return);break;case 1:Vu(Ue,Ue.return);var lt=Ue.stateNode;if(typeof lt.componentWillUnmount=="function"){F=Ue,C=Ue.return;try{o=F,lt.props=o.memoizedProps,lt.state=o.memoizedState,lt.componentWillUnmount()}catch(ut){Nn(F,C,ut)}}break;case 5:Vu(Ue,Ue.return);break;case 22:if(Ue.memoizedState!==null){Qv(He);continue}}tt!==null?(tt.return=Ue,ot=tt):Qv(He)}qe=qe.sibling}e:for(qe=null,He=r;;){if(He.tag===5){if(qe===null){qe=He;try{V=He.stateNode,Te?(J=V.style,typeof J.setProperty=="function"?J.setProperty("display","none","important"):J.display="none"):(fe=He.stateNode,ge=He.memoizedProps.style,oe=ge!=null&&ge.hasOwnProperty("display")?ge.display:null,fe.style.display=bt("display",oe))}catch(ut){Nn(r,r.return,ut)}}}else if(He.tag===6){if(qe===null)try{He.stateNode.nodeValue=Te?"":He.memoizedProps}catch(ut){Nn(r,r.return,ut)}}else if((He.tag!==22&&He.tag!==23||He.memoizedState===null||He===r)&&He.child!==null){He.child.return=He,He=He.child;continue}if(He===r)break e;for(;He.sibling===null;){if(He.return===null||He.return===r)break e;qe===He&&(qe=null),He=He.return}qe===He&&(qe=null),He.sibling.return=He.return,He=He.sibling}}break;case 19:yo(o,r),ia(r),F&4&&Yv(r);break;case 21:break;default:yo(o,r),ia(r)}}function ia(r){var o=r.flags;if(o&2){try{e:{for(var C=r.return;C!==null;){if(Vv(C)){var F=C;break e}C=C.return}throw Error(t(160))}switch(F.tag){case 5:var V=F.stateNode;F.flags&32&&(ze(V,""),F.flags&=-33);var J=$v(r);o0(r,J,V);break;case 3:case 4:var oe=F.stateNode.containerInfo,fe=$v(r);i0(r,fe,oe);break;default:throw Error(t(161))}}catch(ge){Nn(r,r.return,ge)}r.flags&=-3}o&4096&&(r.flags&=-4097)}function M_(r,o,C){ot=r,Xv(r)}function Xv(r,o,C){for(var F=(r.mode&1)!==0;ot!==null;){var V=ot,J=V.child;if(V.tag===22&&F){var oe=V.memoizedState!==null||kh;if(!oe){var fe=V.alternate,ge=fe!==null&&fe.memoizedState!==null||Hr;fe=kh;var Te=Hr;if(kh=oe,(Hr=ge)&&!Te)for(ot=V;ot!==null;)oe=ot,ge=oe.child,oe.tag===22&&oe.memoizedState!==null?Jv(V):ge!==null?(ge.return=oe,ot=ge):Jv(V);for(;J!==null;)ot=J,Xv(J),J=J.sibling;ot=V,kh=fe,Hr=Te}Zv(r)}else V.subtreeFlags&8772&&J!==null?(J.return=V,ot=J):Zv(r)}}function Zv(r){for(;ot!==null;){var o=ot;if(o.flags&8772){var C=o.alternate;try{if(o.flags&8772)switch(o.tag){case 0:case 11:case 15:Hr||Ah(5,o);break;case 1:var F=o.stateNode;if(o.flags&4&&!Hr)if(C===null)F.componentDidMount();else{var V=o.elementType===o.type?C.memoizedProps:or(o.type,C.memoizedProps);F.componentDidUpdate(V,C.memoizedState,F.__reactInternalSnapshotBeforeUpdate)}var J=o.updateQueue;J!==null&&Pn(o,J,F);break;case 3:var oe=o.updateQueue;if(oe!==null){if(C=null,o.child!==null)switch(o.child.tag){case 5:C=o.child.stateNode;break;case 1:C=o.child.stateNode}Pn(o,oe,C)}break;case 5:var fe=o.stateNode;if(C===null&&o.flags&4){C=fe;var ge=o.memoizedProps;switch(o.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(o.memoizedState===null){var Te=o.alternate;if(Te!==null){var qe=Te.memoizedState;if(qe!==null){var He=qe.dehydrated;He!==null&&Fr(He)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}Hr||o.flags&512&&r0(o)}catch(Ue){Nn(o,o.return,Ue)}}if(o===r){ot=null;break}if(C=o.sibling,C!==null){C.return=o.return,ot=C;break}ot=o.return}}function Qv(r){for(;ot!==null;){var o=ot;if(o===r){ot=null;break}var C=o.sibling;if(C!==null){C.return=o.return,ot=C;break}ot=o.return}}function Jv(r){for(;ot!==null;){var o=ot;try{switch(o.tag){case 0:case 11:case 15:var C=o.return;try{Ah(4,o)}catch(ge){Nn(o,C,ge)}break;case 1:var F=o.stateNode;if(typeof F.componentDidMount=="function"){var V=o.return;try{F.componentDidMount()}catch(ge){Nn(o,V,ge)}}var J=o.return;try{r0(o)}catch(ge){Nn(o,J,ge)}break;case 5:var oe=o.return;try{r0(o)}catch(ge){Nn(o,oe,ge)}}}catch(ge){Nn(o,o.return,ge)}if(o===r){ot=null;break}var fe=o.sibling;if(fe!==null){fe.return=o.return,ot=fe;break}ot=o.return}}var L_=Math.ceil,Th=b.ReactCurrentDispatcher,a0=b.ReactCurrentOwner,Yi=b.ReactCurrentBatchConfig,$t=0,yr=null,Xn=null,Mr=0,ki=0,$u=co(0),ar=0,df=null,Ts=0,Rh=0,l0=0,hf=null,di=null,s0=0,Wu=1/0,Ba=null,Mh=!1,u0=null,Dl=null,Lh=!1,jl=null,Nh=0,pf=0,c0=null,Ih=-1,Dh=0;function ni(){return $t&6?en():Ih!==-1?Ih:Ih=en()}function Fl(r){return r.mode&1?$t&2&&Mr!==0?Mr&-Mr:Jc.transition!==null?(Dh===0&&(Dh=Oc()),Dh):(r=Ht,r!==0||(r=window.event,r=r===void 0?16:Xd(r.type)),r):1}function bo(r,o,C,F){if(50<pf)throw pf=0,c0=null,Error(t(185));is(r,C,F),(!($t&2)||r!==yr)&&(r===yr&&(!($t&2)&&(Rh|=C),ar===4&&zl(r,Mr)),hi(r,F),C===1&&$t===0&&!(o.mode&1)&&(Wu=en()+500,yl&&Ko()))}function hi(r,o){var C=r.callbackNode;Vd(r,o);var F=pa(r,r===yr?Mr:0);if(F===0)C!==null&&Ii(C),r.callbackNode=null,r.callbackPriority=0;else if(o=F&-F,r.callbackPriority!==o){if(C!=null&&Ii(C),o===1)r.tag===0?fo(tm.bind(null,r)):ws(tm.bind(null,r)),fh(function(){!($t&6)&&Ko()}),C=null;else{switch(os(F)){case 1:C=Dr;break;case 4:C=ha;break;case 16:C=no;break;case 536870912:C=Qs;break;default:C=no}C=um(C,em.bind(null,r))}r.callbackPriority=o,r.callbackNode=C}}function em(r,o){if(Ih=-1,Dh=0,$t&6)throw Error(t(327));var C=r.callbackNode;if(Yu()&&r.callbackNode!==C)return null;var F=pa(r,r===yr?Mr:0);if(F===0)return null;if(F&30||F&r.expiredLanes||o)o=jh(r,F);else{o=F;var V=$t;$t|=2;var J=rm();(yr!==r||Mr!==o)&&(Ba=null,Wu=en()+500,Ms(r,o));do try{D_();break}catch(fe){nm(r,fe)}while(!0);Ru(),Th.current=J,$t=V,Xn!==null?o=0:(yr=null,Mr=0,o=ar)}if(o!==0){if(o===2&&(V=tl(r),V!==0&&(F=V,o=f0(r,V))),o===1)throw C=df,Ms(r,0),zl(r,F),hi(r,en()),C;if(o===6)zl(r,F);else{if(V=r.current.alternate,!(F&30)&&!N_(V)&&(o=jh(r,F),o===2&&(J=tl(r),J!==0&&(F=J,o=f0(r,J))),o===1))throw C=df,Ms(r,0),zl(r,F),hi(r,en()),C;switch(r.finishedWork=V,r.finishedLanes=F,o){case 0:case 1:throw Error(t(345));case 2:Ls(r,di,Ba);break;case 3:if(zl(r,F),(F&130023424)===F&&(o=s0+500-en(),10<o)){if(pa(r,0)!==0)break;if(V=r.suspendedLanes,(V&F)!==F){ni(),r.pingedLanes|=r.suspendedLanes&V;break}r.timeoutHandle=Kr(Ls.bind(null,r,di,Ba),o);break}Ls(r,di,Ba);break;case 4:if(zl(r,F),(F&4194240)===F)break;for(o=r.eventTimes,V=-1;0<F;){var oe=31-It(F);J=1<<oe,oe=o[oe],oe>V&&(V=oe),F&=~J}if(F=V,F=en()-F,F=(120>F?120:480>F?480:1080>F?1080:1920>F?1920:3e3>F?3e3:4320>F?4320:1960*L_(F/1960))-F,10<F){r.timeoutHandle=Kr(Ls.bind(null,r,di,Ba),F);break}Ls(r,di,Ba);break;case 5:Ls(r,di,Ba);break;default:throw Error(t(329))}}}return hi(r,en()),r.callbackNode===C?em.bind(null,r):null}function f0(r,o){var C=hf;return r.current.memoizedState.isDehydrated&&(Ms(r,o).flags|=256),r=jh(r,o),r!==2&&(o=di,di=C,o!==null&&d0(o)),r}function d0(r){di===null?di=r:di.push.apply(di,r)}function N_(r){for(var o=r;;){if(o.flags&16384){var C=o.updateQueue;if(C!==null&&(C=C.stores,C!==null))for(var F=0;F<C.length;F++){var V=C[F],J=V.getSnapshot;V=V.value;try{if(!Br(J(),V))return!1}catch{return!1}}}if(C=o.child,o.subtreeFlags&16384&&C!==null)C.return=o,o=C;else{if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function zl(r,o){for(o&=~l0,o&=~Rh,r.suspendedLanes|=o,r.pingedLanes&=~o,r=r.expirationTimes;0<o;){var C=31-It(o),F=1<<C;r[C]=-1,o&=~F}}function tm(r){if($t&6)throw Error(t(327));Yu();var o=pa(r,0);if(!(o&1))return hi(r,en()),null;var C=jh(r,o);if(r.tag!==0&&C===2){var F=tl(r);F!==0&&(o=F,C=f0(r,F))}if(C===1)throw C=df,Ms(r,0),zl(r,o),hi(r,en()),C;if(C===6)throw Error(t(345));return r.finishedWork=r.current.alternate,r.finishedLanes=o,Ls(r,di,Ba),hi(r,en()),null}function h0(r,o){var C=$t;$t|=1;try{return r(o)}finally{$t=C,$t===0&&(Wu=en()+500,yl&&Ko())}}function Rs(r){jl!==null&&jl.tag===0&&!($t&6)&&Yu();var o=$t;$t|=1;var C=Yi.transition,F=Ht;try{if(Yi.transition=null,Ht=1,r)return r()}finally{Ht=F,Yi.transition=C,$t=o,!($t&6)&&Ko()}}function p0(){ki=$u.current,an($u)}function Ms(r,o){r.finishedWork=null,r.finishedLanes=0;var C=r.timeoutHandle;if(C!==-1&&(r.timeoutHandle=-1,Kc(C)),Xn!==null)for(C=Xn.return;C!==null;){var F=C;switch(Kn(F),F.tag){case 1:F=F.type.childContextTypes,F!=null&&ml();break;case 3:yn(),an(dr),an(ir),pr();break;case 5:po(F);break;case 4:yn();break;case 13:an(ln);break;case 19:an(ln);break;case 10:Mu(F.type._context);break;case 22:case 23:p0()}C=C.return}if(yr=r,Xn=r=Bl(r.current,null),Mr=ki=o,ar=0,df=null,l0=Rh=Ts=0,di=hf=null,Hi!==null){for(o=0;o<Hi.length;o++)if(C=Hi[o],F=C.interleaved,F!==null){C.interleaved=null;var V=F.next,J=C.pending;if(J!==null){var oe=J.next;J.next=V,F.next=oe}C.pending=F}Hi=null}return r}function nm(r,o){do{var C=Xn;try{if(Ru(),Pl.current=Rl,Ci){for(var F=Jt.memoizedState;F!==null;){var V=F.queue;V!==null&&(V.pending=null),F=F.next}Ci=!1}if(Ar=0,Mn=Cn=Jt=null,ea=!1,fi=0,a0.current=null,C===null||C.return===null){ar=1,df=o,Xn=null;break}e:{var J=r,oe=C.return,fe=C,ge=o;if(o=Mr,fe.flags|=32768,ge!==null&&typeof ge=="object"&&typeof ge.then=="function"){var Te=ge,qe=fe,He=qe.tag;if(!(qe.mode&1)&&(He===0||He===11||He===15)){var Ue=qe.alternate;Ue?(qe.updateQueue=Ue.updateQueue,qe.memoizedState=Ue.memoizedState,qe.lanes=Ue.lanes):(qe.updateQueue=null,qe.memoizedState=null)}var tt=D(oe);if(tt!==null){tt.flags&=-257,H(tt,oe,fe,J,o),tt.mode&1&&f(J,Te,o),o=tt,ge=Te;var lt=o.updateQueue;if(lt===null){var ut=new Set;ut.add(ge),o.updateQueue=ut}else lt.add(ge);break e}else{if(!(o&1)){f(J,Te,o),g0();break e}ge=Error(t(426))}}else if(Zt&&fe.mode&1){var qn=D(oe);if(qn!==null){!(qn.flags&65536)&&(qn.flags|=256),H(qn,oe,fe,J,o),Es(za(ge,fe));break e}}J=ge=za(ge,fe),ar!==4&&(ar=2),hf===null?hf=[J]:hf.push(J),J=oe;do{switch(J.tag){case 3:J.flags|=65536,o&=-o,J.lanes|=o;var Ee=Ch(J,ge,o);Cs(J,Ee);break e;case 1:fe=ge;var me=J.type,Pe=J.stateNode;if(!(J.flags&128)&&(typeof me.getDerivedStateFromError=="function"||Pe!==null&&typeof Pe.componentDidCatch=="function"&&(Dl===null||!Dl.has(Pe)))){J.flags|=65536,o&=-o,J.lanes|=o;var $e=u(J,fe,o);Cs(J,$e);break e}}J=J.return}while(J!==null)}om(C)}catch(ct){o=ct,Xn===C&&C!==null&&(Xn=C=C.return);continue}break}while(!0)}function rm(){var r=Th.current;return Th.current=Rl,r===null?Rl:r}function g0(){(ar===0||ar===3||ar===2)&&(ar=4),yr===null||!(Ts&268435455)&&!(Rh&268435455)||zl(yr,Mr)}function jh(r,o){var C=$t;$t|=2;var F=rm();(yr!==r||Mr!==o)&&(Ba=null,Ms(r,o));do try{I_();break}catch(V){nm(r,V)}while(!0);if(Ru(),$t=C,Th.current=F,Xn!==null)throw Error(t(261));return yr=null,Mr=0,ar}function I_(){for(;Xn!==null;)im(Xn)}function D_(){for(;Xn!==null&&!Io();)im(Xn)}function im(r){var o=sm(r.alternate,r,ki);r.memoizedProps=r.pendingProps,o===null?om(r):Xn=o,a0.current=null}function om(r){var o=r;do{var C=o.alternate;if(r=o.return,o.flags&32768){if(C=A_(C,o),C!==null){C.flags&=32767,Xn=C;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{ar=6,Xn=null;return}}else if(C=k_(C,o,ki),C!==null){Xn=C;return}if(o=o.sibling,o!==null){Xn=o;return}Xn=o=r}while(o!==null);ar===0&&(ar=5)}function Ls(r,o,C){var F=Ht,V=Yi.transition;try{Yi.transition=null,Ht=1,j_(r,o,C,F)}finally{Yi.transition=V,Ht=F}return null}function j_(r,o,C,F){do Yu();while(jl!==null);if($t&6)throw Error(t(327));C=r.finishedWork;var V=r.finishedLanes;if(C===null)return null;if(r.finishedWork=null,r.finishedLanes=0,C===r.current)throw Error(t(177));r.callbackNode=null,r.callbackPriority=0;var J=C.lanes|C.childLanes;if($p(r,J),r===yr&&(Xn=yr=null,Mr=0),!(C.subtreeFlags&2064)&&!(C.flags&2064)||Lh||(Lh=!0,um(no,function(){return Yu(),null})),J=(C.flags&15990)!==0,C.subtreeFlags&15990||J){J=Yi.transition,Yi.transition=null;var oe=Ht;Ht=1;var fe=$t;$t|=4,a0.current=null,R_(r,C),Kv(C,r),hs(Wc),iu=!!$c,Wc=$c=null,r.current=C,M_(C),rs(),$t=fe,Ht=oe,Yi.transition=J}else r.current=C;if(Lh&&(Lh=!1,jl=r,Nh=V),J=r.pendingLanes,J===0&&(Dl=null),cn(C.stateNode),hi(r,en()),o!==null)for(F=r.onRecoverableError,C=0;C<o.length;C++)V=o[C],F(V.value,{componentStack:V.stack,digest:V.digest});if(Mh)throw Mh=!1,r=u0,u0=null,r;return Nh&1&&r.tag!==0&&Yu(),J=r.pendingLanes,J&1?r===c0?pf++:(pf=0,c0=r):pf=0,Ko(),null}function Yu(){if(jl!==null){var r=os(Nh),o=Yi.transition,C=Ht;try{if(Yi.transition=null,Ht=16>r?16:r,jl===null)var F=!1;else{if(r=jl,jl=null,Nh=0,$t&6)throw Error(t(331));var V=$t;for($t|=4,ot=r.current;ot!==null;){var J=ot,oe=J.child;if(ot.flags&16){var fe=J.deletions;if(fe!==null){for(var ge=0;ge<fe.length;ge++){var Te=fe[ge];for(ot=Te;ot!==null;){var qe=ot;switch(qe.tag){case 0:case 11:case 15:ff(8,qe,J)}var He=qe.child;if(He!==null)He.return=qe,ot=He;else for(;ot!==null;){qe=ot;var Ue=qe.sibling,tt=qe.return;if(Gv(qe),qe===Te){ot=null;break}if(Ue!==null){Ue.return=tt,ot=Ue;break}ot=tt}}}var lt=J.alternate;if(lt!==null){var ut=lt.child;if(ut!==null){lt.child=null;do{var qn=ut.sibling;ut.sibling=null,ut=qn}while(ut!==null)}}ot=J}}if(J.subtreeFlags&2064&&oe!==null)oe.return=J,ot=oe;else e:for(;ot!==null;){if(J=ot,J.flags&2048)switch(J.tag){case 0:case 11:case 15:ff(9,J,J.return)}var Ee=J.sibling;if(Ee!==null){Ee.return=J.return,ot=Ee;break e}ot=J.return}}var me=r.current;for(ot=me;ot!==null;){oe=ot;var Pe=oe.child;if(oe.subtreeFlags&2064&&Pe!==null)Pe.return=oe,ot=Pe;else e:for(oe=me;ot!==null;){if(fe=ot,fe.flags&2048)try{switch(fe.tag){case 0:case 11:case 15:Ah(9,fe)}}catch(ct){Nn(fe,fe.return,ct)}if(fe===oe){ot=null;break e}var $e=fe.sibling;if($e!==null){$e.return=fe.return,ot=$e;break e}ot=fe.return}}if($t=V,Ko(),er&&typeof er.onPostCommitFiberRoot=="function")try{er.onPostCommitFiberRoot(ro,r)}catch{}F=!0}return F}finally{Ht=C,Yi.transition=o}}return!1}function am(r,o,C){o=za(C,o),o=Ch(r,o,1),r=$i(r,o,1),o=ni(),r!==null&&(is(r,1,o),hi(r,o))}function Nn(r,o,C){if(r.tag===3)am(r,r,C);else for(;o!==null;){if(o.tag===3){am(o,r,C);break}else if(o.tag===1){var F=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof F.componentDidCatch=="function"&&(Dl===null||!Dl.has(F))){r=za(C,r),r=u(o,r,1),o=$i(o,r,1),r=ni(),o!==null&&(is(o,1,r),hi(o,r));break}}o=o.return}}function F_(r,o,C){var F=r.pingCache;F!==null&&F.delete(o),o=ni(),r.pingedLanes|=r.suspendedLanes&C,yr===r&&(Mr&C)===C&&(ar===4||ar===3&&(Mr&130023424)===Mr&&500>en()-s0?Ms(r,0):l0|=C),hi(r,o)}function lm(r,o){o===0&&(r.mode&1?(o=io,io<<=1,!(io&130023424)&&(io=4194304)):o=1);var C=ni();r=ei(r,o),r!==null&&(is(r,o,C),hi(r,C))}function z_(r){var o=r.memoizedState,C=0;o!==null&&(C=o.retryLane),lm(r,C)}function B_(r,o){var C=0;switch(r.tag){case 13:var F=r.stateNode,V=r.memoizedState;V!==null&&(C=V.retryLane);break;case 19:F=r.stateNode;break;default:throw Error(t(314))}F!==null&&F.delete(o),lm(r,C)}var sm;sm=function(r,o,C){if(r!==null)if(r.memoizedProps!==o.pendingProps||dr.current)ne=!0;else{if(!(r.lanes&C)&&!(o.flags&128))return ne=!1,e0(r,o,C);ne=!!(r.flags&131072)}else ne=!1,Zt&&o.flags&1048576&&vh(o,Zo,o.index);switch(o.lanes=0,o.tag){case 2:var F=o.type;zt(r,o),r=o.pendingProps;var V=Ta(o,ir.current);ho(o,C),V=Cl(null,o,F,r,V,C);var J=kl();return o.flags|=1,typeof V=="object"&&V!==null&&typeof V.render=="function"&&V.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,hr(F)?(J=!0,Ra(o)):J=!1,o.memoizedState=V.state!==null&&V.state!==void 0?V.state:null,Ps(o),V.updater=Ll,o.stateNode=V,V._reactInternals=o,Hu(o,F,r,C),o=Qt(null,o,F,!0,J,C)):(o.tag=0,Zt&&J&&bl(o),le(null,o,V,C),o=o.child),o;case 16:F=o.elementType;e:{switch(zt(r,o),r=o.pendingProps,V=F._init,F=V(F._payload),o.type=F,V=o.tag=q_(F),r=or(F,r),V){case 0:o=Qe(null,o,F,r,C);break e;case 1:o=sn(null,o,F,r,C);break e;case 11:o=ye(null,o,F,r,C);break e;case 14:o=Re(null,o,F,or(F.type,r),C);break e}throw Error(t(306,F,""))}return o;case 0:return F=o.type,V=o.pendingProps,V=o.elementType===F?V:or(F,V),Qe(r,o,F,V,C);case 1:return F=o.type,V=o.pendingProps,V=o.elementType===F?V:or(F,V),sn(r,o,F,V,C);case 3:e:{if(Tr(o),r===null)throw Error(t(387));F=o.pendingProps,J=o.memoizedState,V=J.element,Nu(r,o),El(o,F,null,C);var oe=o.memoizedState;if(F=oe.element,J.isDehydrated)if(J={element:F,isDehydrated:!1,cache:oe.cache,pendingSuspenseBoundaries:oe.pendingSuspenseBoundaries,transitions:oe.transitions},o.updateQueue.baseState=J,o.memoizedState=J,o.flags&256){V=za(Error(t(423)),o),o=Wi(r,o,F,C,V);break e}else if(F!==V){V=za(Error(t(424)),o),o=Wi(r,o,F,C,V);break e}else for(Xe=zi(o.stateNode.containerInfo.firstChild),Zr=o,Zt=!0,Qr=null,C=ci(o,null,F,C),o.child=C;C;)C.flags=C.flags&-3|4096,C=C.sibling;else{if(Ia(),F===V){o=mr(r,o,C);break e}le(r,o,F,C)}o=o.child}return o;case 5:return Ol(o),r===null&&_l(o),F=o.type,V=o.pendingProps,J=r!==null?r.memoizedProps:null,oe=V.children,Yc(F,V)?oe=null:J!==null&&Yc(F,J)&&(o.flags|=32),Ot(r,o),le(r,o,oe,C),o.child;case 6:return r===null&&_l(o),null;case 13:return Ne(r,o,C);case 4:return Jo(o,o.stateNode.containerInfo),F=o.pendingProps,r===null?o.child=Da(o,null,F,C):le(r,o,F,C),o.child;case 11:return F=o.type,V=o.pendingProps,V=o.elementType===F?V:or(F,V),ye(r,o,F,V,C);case 7:return le(r,o,o.pendingProps,C),o.child;case 8:return le(r,o,o.pendingProps.children,C),o.child;case 12:return le(r,o,o.pendingProps.children,C),o.child;case 10:e:{if(F=o.type._context,V=o.pendingProps,J=o.memoizedProps,oe=V.value,tn(Os,F._currentValue),F._currentValue=oe,J!==null)if(Br(J.value,oe)){if(J.children===V.children&&!dr.current){o=mr(r,o,C);break e}}else for(J=o.child,J!==null&&(J.return=o);J!==null;){var fe=J.dependencies;if(fe!==null){oe=J.child;for(var ge=fe.firstContext;ge!==null;){if(ge.context===F){if(J.tag===1){ge=Vi(-1,C&-C),ge.tag=2;var Te=J.updateQueue;if(Te!==null){Te=Te.shared;var qe=Te.pending;qe===null?ge.next=ge:(ge.next=qe.next,qe.next=ge),Te.pending=ge}}J.lanes|=C,ge=J.alternate,ge!==null&&(ge.lanes|=C),Lu(J.return,C,o),fe.lanes|=C;break}ge=ge.next}}else if(J.tag===10)oe=J.type===o.type?null:J.child;else if(J.tag===18){if(oe=J.return,oe===null)throw Error(t(341));oe.lanes|=C,fe=oe.alternate,fe!==null&&(fe.lanes|=C),Lu(oe,C,o),oe=J.sibling}else oe=J.child;if(oe!==null)oe.return=J;else for(oe=J;oe!==null;){if(oe===o){oe=null;break}if(J=oe.sibling,J!==null){J.return=oe.return,oe=J;break}oe=oe.return}J=oe}le(r,o,V.children,C),o=o.child}return o;case 9:return V=o.type,F=o.pendingProps.children,ho(o,C),V=kr(V),F=F(V),o.flags|=1,le(r,o,F,C),o.child;case 14:return F=o.type,V=or(F,o.pendingProps),V=or(F.type,V),Re(r,o,F,V,C);case 15:return Ge(r,o,o.type,o.pendingProps,C);case 17:return F=o.type,V=o.pendingProps,V=o.elementType===F?V:or(F,V),zt(r,o),o.tag=1,hr(F)?(r=!0,Ra(o)):r=!1,ho(o,C),Ph(o,F,V),Hu(o,F,V,C),Qt(null,o,F,!0,r,C);case 19:return Un(r,o,C);case 22:return it(r,o,C)}throw Error(t(156,o.tag))};function um(r,o){return Ir(r,o)}function U_(r,o,C,F){this.tag=r,this.key=C,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=F,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ki(r,o,C,F){return new U_(r,o,C,F)}function v0(r){return r=r.prototype,!(!r||!r.isReactComponent)}function q_(r){if(typeof r=="function")return v0(r)?1:0;if(r!=null){if(r=r.$$typeof,r===L)return 11;if(r===B)return 14}return 2}function Bl(r,o){var C=r.alternate;return C===null?(C=Ki(r.tag,o,r.key,r.mode),C.elementType=r.elementType,C.type=r.type,C.stateNode=r.stateNode,C.alternate=r,r.alternate=C):(C.pendingProps=o,C.type=r.type,C.flags=0,C.subtreeFlags=0,C.deletions=null),C.flags=r.flags&14680064,C.childLanes=r.childLanes,C.lanes=r.lanes,C.child=r.child,C.memoizedProps=r.memoizedProps,C.memoizedState=r.memoizedState,C.updateQueue=r.updateQueue,o=r.dependencies,C.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},C.sibling=r.sibling,C.index=r.index,C.ref=r.ref,C}function Fh(r,o,C,F,V,J){var oe=2;if(F=r,typeof r=="function")v0(r)&&(oe=1);else if(typeof r=="string")oe=5;else e:switch(r){case T:return Ns(C.children,V,J,o);case j:oe=8,V|=8;break;case I:return r=Ki(12,C,o,V|2),r.elementType=I,r.lanes=J,r;case k:return r=Ki(13,C,o,V),r.elementType=k,r.lanes=J,r;case R:return r=Ki(19,C,o,V),r.elementType=R,r.lanes=J,r;case Y:return zh(C,V,J,o);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case m:oe=10;break e;case A:oe=9;break e;case L:oe=11;break e;case B:oe=14;break e;case X:oe=16,F=null;break e}throw Error(t(130,r==null?r:typeof r,""))}return o=Ki(oe,C,o,V),o.elementType=r,o.type=F,o.lanes=J,o}function Ns(r,o,C,F){return r=Ki(7,r,F,o),r.lanes=C,r}function zh(r,o,C,F){return r=Ki(22,r,F,o),r.elementType=Y,r.lanes=C,r.stateNode={isHidden:!1},r}function m0(r,o,C){return r=Ki(6,r,null,o),r.lanes=C,r}function y0(r,o,C){return o=Ki(4,r.children!==null?r.children:[],r.key,o),o.lanes=C,o.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},o}function H_(r,o,C,F,V){this.tag=o,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Gr(0),this.expirationTimes=Gr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gr(0),this.identifierPrefix=F,this.onRecoverableError=V,this.mutableSourceEagerHydrationData=null}function b0(r,o,C,F,V,J,oe,fe,ge){return r=new H_(r,o,C,fe,ge),o===1?(o=1,J===!0&&(o|=8)):o=0,J=Ki(3,null,null,o),r.current=J,J.stateNode=r,J.memoizedState={element:F,isDehydrated:C,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ps(J),r}function G_(r,o,C){var F=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:F==null?null:""+F,children:r,containerInfo:o,implementation:C}}function cm(r){if(!r)return Ui;r=r._reactInternals;e:{if(Gt(r)!==r||r.tag!==1)throw Error(t(170));var o=r;do{switch(o.tag){case 3:o=o.stateNode.context;break e;case 1:if(hr(o.type)){o=o.stateNode.__reactInternalMemoizedMergedChildContext;break e}}o=o.return}while(o!==null);throw Error(t(171))}if(r.tag===1){var C=r.type;if(hr(C))return Pu(r,C,o)}return o}function fm(r,o,C,F,V,J,oe,fe,ge){return r=b0(C,F,!0,r,V,J,oe,fe,ge),r.context=cm(null),C=r.current,F=ni(),V=Fl(C),J=Vi(F,V),J.callback=o??null,$i(C,J,V),r.current.lanes=V,is(r,V,F),hi(r,F),r}function Bh(r,o,C,F){var V=o.current,J=ni(),oe=Fl(V);return C=cm(C),o.context===null?o.context=C:o.pendingContext=C,o=Vi(J,oe),o.payload={element:r},F=F===void 0?null:F,F!==null&&(o.callback=F),r=$i(V,o,oe),r!==null&&(bo(r,V,oe,J),Iu(r,V,oe)),oe}function Uh(r){if(r=r.current,!r.child)return null;switch(r.child.tag){case 5:return r.child.stateNode;default:return r.child.stateNode}}function dm(r,o){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var C=r.retryLane;r.retryLane=C!==0&&C<o?C:o}}function _0(r,o){dm(r,o),(r=r.alternate)&&dm(r,o)}function V_(){return null}var hm=typeof reportError=="function"?reportError:function(r){console.error(r)};function w0(r){this._internalRoot=r}qh.prototype.render=w0.prototype.render=function(r){var o=this._internalRoot;if(o===null)throw Error(t(409));Bh(r,o,null,null)},qh.prototype.unmount=w0.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var o=r.containerInfo;Rs(function(){Bh(null,r,null,null)}),o[Bi]=null}};function qh(r){this._internalRoot=r}qh.prototype.unstable_scheduleHydration=function(r){if(r){var o=Wd();r={blockedOn:null,target:r,priority:o};for(var C=0;C<Fi.length&&o!==0&&o<Fi[C].priority;C++);Fi.splice(C,0,r),C===0&&tu(r)}};function S0(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function Hh(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function pm(){}function $_(r,o,C,F,V){if(V){if(typeof F=="function"){var J=F;F=function(){var Te=Uh(oe);J.call(Te)}}var oe=fm(o,F,r,0,null,!1,!1,"",pm);return r._reactRootContainer=oe,r[Bi]=oe.current,xa(r.nodeType===8?r.parentNode:r),Rs(),oe}for(;V=r.lastChild;)r.removeChild(V);if(typeof F=="function"){var fe=F;F=function(){var Te=Uh(ge);fe.call(Te)}}var ge=b0(r,0,!1,null,null,!1,!1,"",pm);return r._reactRootContainer=ge,r[Bi]=ge.current,xa(r.nodeType===8?r.parentNode:r),Rs(function(){Bh(o,ge,C,F)}),ge}function Gh(r,o,C,F,V){var J=C._reactRootContainer;if(J){var oe=J;if(typeof V=="function"){var fe=V;V=function(){var ge=Uh(oe);fe.call(ge)}}Bh(o,oe,r,V)}else oe=$_(C,o,r,V,F);return Uh(oe)}nl=function(r){switch(r.tag){case 3:var o=r.stateNode;if(o.current.memoizedState.isDehydrated){var C=Vn(o.pendingLanes);C!==0&&(xc(o,C|1),hi(o,en()),!($t&6)&&(Wu=en()+500,Ko()))}break;case 13:Rs(function(){var F=ei(r,1);if(F!==null){var V=ni();bo(F,r,1,V)}}),_0(r,1)}},rl=function(r){if(r.tag===13){var o=ei(r,134217728);if(o!==null){var C=ni();bo(o,r,134217728,C)}_0(r,134217728)}},$d=function(r){if(r.tag===13){var o=Fl(r),C=ei(r,o);if(C!==null){var F=ni();bo(C,r,o,F)}_0(r,o)}},Wd=function(){return Ht},Js=function(r,o){var C=Ht;try{return Ht=r,o()}finally{Ht=C}},vt=function(r,o,C){switch(o){case"input":if(Ae(r,C),o=C.name,C.type==="radio"&&o!=null){for(C=r;C.parentNode;)C=C.parentNode;for(C=C.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),o=0;o<C.length;o++){var F=C[o];if(F!==r&&F.form===r.form){var V=Yn(F);if(!V)throw Error(t(90));se(F),Ae(F,V)}}}break;case"textarea":xe(r,C);break;case"select":o=C.value,o!=null&&Le(r,!!C.multiple,o,!1)}},De=h0,Ie=Rs;var W_={usingClientEntryPoint:!1,Events:[_s,Fn,Yn,rt,ft,h0]},gf={findFiberByHostInstance:Wo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Y_={bundleType:gf.bundleType,version:gf.version,rendererPackageName:gf.rendererPackageName,rendererConfig:gf.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:b.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=En(r),r===null?null:r.stateNode},findFiberByHostInstance:gf.findFiberByHostInstance||V_,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 Vh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vh.isDisabled&&Vh.supportsFiber)try{ro=Vh.inject(Y_),er=Vh}catch{}}return pi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W_,pi.createPortal=function(r,o){var C=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!S0(o))throw Error(t(200));return G_(r,o,null,C)},pi.createRoot=function(r,o){if(!S0(r))throw Error(t(299));var C=!1,F="",V=hm;return o!=null&&(o.unstable_strictMode===!0&&(C=!0),o.identifierPrefix!==void 0&&(F=o.identifierPrefix),o.onRecoverableError!==void 0&&(V=o.onRecoverableError)),o=b0(r,1,!1,null,null,C,!1,F,V),r[Bi]=o.current,xa(r.nodeType===8?r.parentNode:r),new w0(o)},pi.findDOMNode=function(r){if(r==null)return null;if(r.nodeType===1)return r;var o=r._reactInternals;if(o===void 0)throw typeof r.render=="function"?Error(t(188)):(r=Object.keys(r).join(","),Error(t(268,r)));return r=En(o),r=r===null?null:r.stateNode,r},pi.flushSync=function(r){return Rs(r)},pi.hydrate=function(r,o,C){if(!Hh(o))throw Error(t(200));return Gh(null,r,o,!0,C)},pi.hydrateRoot=function(r,o,C){if(!S0(r))throw Error(t(405));var F=C!=null&&C.hydratedSources||null,V=!1,J="",oe=hm;if(C!=null&&(C.unstable_strictMode===!0&&(V=!0),C.identifierPrefix!==void 0&&(J=C.identifierPrefix),C.onRecoverableError!==void 0&&(oe=C.onRecoverableError)),o=fm(o,null,r,1,C??null,V,!1,J,oe),r[Bi]=o.current,xa(r),F)for(r=0;r<F.length;r++)C=F[r],V=C._getVersion,V=V(C._source),o.mutableSourceEagerHydrationData==null?o.mutableSourceEagerHydrationData=[C,V]:o.mutableSourceEagerHydrationData.push(C,V);return new qh(o)},pi.render=function(r,o,C){if(!Hh(o))throw Error(t(200));return Gh(null,r,o,!1,C)},pi.unmountComponentAtNode=function(r){if(!Hh(r))throw Error(t(40));return r._reactRootContainer?(Rs(function(){Gh(null,null,r,!1,function(){r._reactRootContainer=null,r[Bi]=null})}),!0):!1},pi.unstable_batchedUpdates=h0,pi.unstable_renderSubtreeIntoContainer=function(r,o,C,F){if(!Hh(C))throw Error(t(200));if(r==null||r._reactInternals===void 0)throw Error(t(38));return Gh(r,o,C,!1,F)},pi.version="18.3.1-next-f1338f8080-20240426",pi}var _m;function R3(){if(_m)return O0.exports;_m=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(i){console.error(i)}}return e(),O0.exports=Q_(),O0.exports}var wm;function J_(){if(wm)return $h;wm=1;var e=R3();return $h.createRoot=e.createRoot,$h.hydrateRoot=e.hydrateRoot,$h}var e6=J_();const M3=Rd(e6);var vf={};function At(e){for(var i=arguments.length,t=new Array(i>1?i-1:0),n=1;n<i;n++)t[n-1]=arguments[n];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 t6={};function wp(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:t6}var L3=Object.assign,lp=Object.getOwnPropertyDescriptor,sa=Object.defineProperty,Md=Object.prototype,Rg=[];Object.freeze(Rg);var Wg={};Object.freeze(Wg);var n6=typeof Proxy<"u",r6=Object.toString();function N3(){n6||At("Proxy not available")}function I3(e){var i=!1;return function(){if(!i)return i=!0,e.apply(this,arguments)}}var ec=function(){};function Li(e){return typeof e=="function"}function Us(e){var i=typeof e;switch(i){case"string":case"symbol":case"number":return!0}return!1}function Sp(e){return e!==null&&typeof e=="object"}function Za(e){if(!Sp(e))return!1;var i=Object.getPrototypeOf(e);if(i==null)return!0;var t=Object.hasOwnProperty.call(i,"constructor")&&i.constructor;return typeof t=="function"&&t.toString()===r6}function D3(e){var i=e==null?void 0:e.constructor;return i?i.name==="GeneratorFunction"||i.displayName==="GeneratorFunction":!1}function Ld(e,i,t){sa(e,i,{enumerable:!1,writable:!0,configurable:!0,value:t})}function j3(e,i,t){sa(e,i,{enumerable:!1,writable:!1,configurable:!0,value:t})}function Zl(e,i){var t="isMobX"+e;return i.prototype[t]=!0,function(n){return Sp(n)&&n[t]===!0}}function vc(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function i6(e){var i=Object.getPrototypeOf(e),t=Object.getPrototypeOf(i),n=Object.getPrototypeOf(t);return n===null}function Wa(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var F3=typeof Object.getOwnPropertySymbols<"u";function o6(e){var i=Object.keys(e);if(!F3)return i;var t=Object.getOwnPropertySymbols(e);return t.length?[].concat(i,t.filter(function(n){return Md.propertyIsEnumerable.call(e,n)})):i}var oc=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:F3?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function z3(e){return e===null?null:typeof e=="object"?""+e:e}function Ya(e,i){return Md.hasOwnProperty.call(e,i)}var a6=Object.getOwnPropertyDescriptors||function(i){var t={};return oc(i).forEach(function(n){t[n]=lp(i,n)}),t};function Ri(e,i){return!!(e&i)}function Mi(e,i,t){return t?e|=i:e&=~i,e}function Sm(e,i){(i==null||i>e.length)&&(i=e.length);for(var t=0,n=Array(i);t<i;t++)n[t]=e[t];return n}function l6(e,i){for(var t=0;t<i.length;t++){var n=i[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u6(n.key),n)}}function mc(e,i,t){return i&&l6(e.prototype,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function tc(e,i){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=c6(e))||i){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
33
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yl(){return Yl=Object.assign?Object.assign.bind():function(e){for(var i=1;i<arguments.length;i++){var t=arguments[i];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},Yl.apply(null,arguments)}function B3(e,i){e.prototype=Object.create(i.prototype),e.prototype.constructor=e,Mg(e,i)}function Mg(e,i){return Mg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},Mg(e,i)}function s6(e,i){if(typeof e!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,i);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function u6(e){var i=s6(e,"string");return typeof i=="symbol"?i:i+""}function c6(e,i){if(e){if(typeof e=="string")return Sm(e,i);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)?Sm(e,i):void 0}}var la=Symbol("mobx-stored-annotations");function Co(e){function i(t,n){if(Id(n))return e.decorate_20223_(t,n);Nd(t,n,e)}return Object.assign(i,e)}function Nd(e,i,t){Ya(e,la)||Ld(e,la,Yl({},e[la])),b6(t)||(e[la][i]=t)}function f6(e){return Ya(e,la)||Ld(e,la,Yl({},e[la])),e[la]}function Id(e){return typeof e=="object"&&typeof e.kind=="string"}var dt=Symbol("mobx administration"),Ql=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 i=e.prototype;return i.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},i.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},i.reportObserved=function(){return o5(this)},i.reportChanged=function(){vi(),a5(this),mi()},i.toString=function(){return this.name_},mc(e,[{key:"isBeingObserved",get:function(){return Ri(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=Mi(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return Ri(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=Mi(this.flags_,e.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return Ri(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=Mi(this.flags_,e.diffValueMask_,n===1)}}])}();Ql.isBeingObservedMask_=1;Ql.isPendingUnobservationMask_=2;Ql.diffValueMask_=4;var Yg=Zl("Atom",Ql);function Od(e,i,t){i===void 0&&(i=ec),t===void 0&&(t=ec);var n=new Ql(e);return i!==ec&&g5(n,i),t!==ec&&ev(n,t),n}function d6(e,i){return e===i}function h6(e,i){return cv(e,i)}function p6(e,i){return cv(e,i,1)}function g6(e,i){return Object.is?Object.is(e,i):e===i?e!==0||1/e===1/i:e!==e&&i!==i}var qs={identity:d6,structural:h6,default:g6,shallow:p6};function Hs(e,i,t){return Tp(e)?e:Array.isArray(e)?un.array(e,{name:t}):Za(e)?un.object(e,void 0,{name:t}):vc(e)?un.map(e,{name:t}):Wa(e)?un.set(e,{name:t}):typeof e=="function"&&!sc(e)&&!uc(e)?D3(e)?Vs(e):ac(t,e):e}function v6(e,i,t){if(e==null||_r(e)||ri(e)||Nr(e)||lr(e))return e;if(Array.isArray(e))return un.array(e,{name:t,deep:!1});if(Za(e))return un.object(e,void 0,{name:t,deep:!1});if(vc(e))return un.map(e,{name:t,deep:!1});if(Wa(e))return un.set(e,{name:t,deep:!1})}function Ep(e){return e}function m6(e,i){return cv(e,i)?i:e}var U3="override",y6=Co({annotationType_:U3,make_:_6,extend_:w6,decorate_20223_:S6});function b6(e){return e.annotationType_===U3}function _6(e,i){return 0}function w6(e,i,t,n){At("'"+this.annotationType_+"' can only be used with 'makeObservable'")}function S6(e,i){console.warn("'"+this.annotationType_+"' cannot be used with decorators - this is a no-op")}function Dd(e,i){return{annotationType_:e,options_:i,make_:E6,extend_:O6,decorate_20223_:x6}}function E6(e,i,t,n){var a;if((a=this.options_)!=null&&a.bound)return this.extend_(e,i,t,!1)===null?0:1;if(n===e.target_)return this.extend_(e,i,t,!1)===null?0:2;if(sc(t.value))return 1;var l=q3(e,this,i,t,!1);return sa(n,i,l),2}function O6(e,i,t,n){var a=q3(e,this,i,t);return e.defineProperty_(i,a,n)}function x6(e,i){var t=i.kind,n=i.name,a=i.addInitializer,l=this,s=function(w){var _,E,O,v;return Kl((_=(E=l.options_)==null?void 0:E.name)!=null?_:n.toString(),w,(O=(v=l.options_)==null?void 0:v.autoAction)!=null?O:!1)};if(t=="field")return function(d){var w,_=d;return sc(_)||(_=s(_)),(w=l.options_)!=null&&w.bound&&(_=_.bind(this),_.isMobxAction=!0),_};if(t=="method"){var c;return sc(e)||(e=s(e)),(c=this.options_)!=null&&c.bound&&a(function(){var d=this,w=d[n].bind(d);w.isMobxAction=!0,d[n]=w}),e}At("Cannot apply '"+l.annotationType_+"' to '"+String(n)+"' (kind: "+t+"):"+(`
34
- '`+l.annotationType_+"' can only be used on properties with a function value."))}function P6(e,i,t,n){i.annotationType_,n.value}function q3(e,i,t,n,a){var l,s,c,d,w,_,E;a===void 0&&(a=We.safeDescriptors),P6(e,i,t,n);var O=n.value;if((l=i.options_)!=null&&l.bound){var v;O=O.bind((v=e.proxy_)!=null?v:e.target_)}return{value:Kl((s=(c=i.options_)==null?void 0:c.name)!=null?s:t.toString(),O,(d=(w=i.options_)==null?void 0:w.autoAction)!=null?d:!1,(_=i.options_)!=null&&_.bound?(E=e.proxy_)!=null?E:e.target_:void 0),configurable:a?e.isPlainObject_:!0,enumerable:!1,writable:!a}}function H3(e,i){return{annotationType_:e,options_:i,make_:C6,extend_:k6,decorate_20223_:A6}}function C6(e,i,t,n){var a;if(n===e.target_)return this.extend_(e,i,t,!1)===null?0:2;if((a=this.options_)!=null&&a.bound&&(!Ya(e.target_,i)||!uc(e.target_[i]))&&this.extend_(e,i,t,!1)===null)return 0;if(uc(t.value))return 1;var l=G3(e,this,i,t,!1,!1);return sa(n,i,l),2}function k6(e,i,t,n){var a,l=G3(e,this,i,t,(a=this.options_)==null?void 0:a.bound);return e.defineProperty_(i,l,n)}function A6(e,i){var t,n=i.name,a=i.addInitializer;return uc(e)||(e=Vs(e)),(t=this.options_)!=null&&t.bound&&a(function(){var l=this,s=l[n].bind(l);s.isMobXFlow=!0,l[n]=s}),e}function T6(e,i,t,n){i.annotationType_,n.value}function G3(e,i,t,n,a,l){l===void 0&&(l=We.safeDescriptors),T6(e,i,t,n);var s=n.value;if(uc(s)||(s=Vs(s)),a){var c;s=s.bind((c=e.proxy_)!=null?c:e.target_),s.isMobXFlow=!0}return{value:s,configurable:l?e.isPlainObject_:!0,enumerable:!1,writable:!l}}function Kg(e,i){return{annotationType_:e,options_:i,make_:R6,extend_:M6,decorate_20223_:L6}}function R6(e,i,t){return this.extend_(e,i,t,!1)===null?0:1}function M6(e,i,t,n){return N6(e,this,i,t),e.defineComputedProperty_(i,Yl({},this.options_,{get:t.get,set:t.set}),n)}function L6(e,i){var t=this,n=i.name,a=i.addInitializer;return a(function(){var l=Ys(this)[dt],s=Yl({},t.options_,{get:e,context:this});s.name||(s.name="ObservableObject."+n.toString()),l.values_.set(n,new To(s))}),function(){return this[dt].getObservablePropValue_(n)}}function N6(e,i,t,n){i.annotationType_,n.get}function Op(e,i){return{annotationType_:e,options_:i,make_:I6,extend_:D6,decorate_20223_:j6}}function I6(e,i,t){return this.extend_(e,i,t,!1)===null?0:1}function D6(e,i,t,n){var a,l;return F6(e,this),e.defineObservableProperty_(i,t.value,(a=(l=this.options_)==null?void 0:l.enhancer)!=null?a:Hs,n)}function j6(e,i){var t=this,n=i.kind,a=i.name,l=new WeakSet;function s(c,d){var w,_,E=Ys(c)[dt],O=new $l(d,(w=(_=t.options_)==null?void 0:_.enhancer)!=null?w:Hs,"ObservableObject."+a.toString(),!1);E.values_.set(a,O),l.add(c)}if(n=="accessor")return{get:function(){return l.has(this)||s(this,e.get.call(this)),this[dt].getObservablePropValue_(a)},set:function(d){return l.has(this)||s(this,d),this[dt].setObservablePropValue_(a,d)},init:function(d){return l.has(this)||s(this,d),d}}}function F6(e,i,t,n){i.annotationType_}var z6="true",B6=V3();function V3(e){return{annotationType_:z6,options_:e,make_:U6,extend_:q6,decorate_20223_:H6}}function U6(e,i,t,n){var a,l;if(t.get)return $s.make_(e,i,t,n);if(t.set){var s=Kl(i.toString(),t.set);return n===e.target_?e.defineProperty_(i,{configurable:We.safeDescriptors?e.isPlainObject_:!0,set:s})===null?0:2:(sa(n,i,{configurable:!0,set:s}),2)}if(n!==e.target_&&typeof t.value=="function"){var c;if(D3(t.value)){var d,w=(d=this.options_)!=null&&d.autoBind?Vs.bound:Vs;return w.make_(e,i,t,n)}var _=(c=this.options_)!=null&&c.autoBind?ac.bound:ac;return _.make_(e,i,t,n)}var E=((a=this.options_)==null?void 0:a.deep)===!1?un.ref:un;if(typeof t.value=="function"&&(l=this.options_)!=null&&l.autoBind){var O;t.value=t.value.bind((O=e.proxy_)!=null?O:e.target_)}return E.make_(e,i,t,n)}function q6(e,i,t,n){var a,l;if(t.get)return $s.extend_(e,i,t,n);if(t.set)return e.defineProperty_(i,{configurable:We.safeDescriptors?e.isPlainObject_:!0,set:Kl(i.toString(),t.set)},n);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=((l=this.options_)==null?void 0:l.deep)===!1?un.ref:un;return c.extend_(e,i,t,n)}function H6(e,i){At("'"+this.annotationType_+"' cannot be used as a decorator")}var G6="observable",V6="observable.ref",$6="observable.shallow",W6="observable.struct",$3={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze($3);function Wh(e){return e||$3}var Lg=Op(G6),Y6=Op(V6,{enhancer:Ep}),K6=Op($6,{enhancer:v6}),X6=Op(W6,{enhancer:m6}),W3=Co(Lg);function Yh(e){return e.deep===!0?Hs:e.deep===!1?Ep:Q6(e.defaultDecorator)}function Z6(e){var i;return e?(i=e.defaultDecorator)!=null?i:V3(e):void 0}function Q6(e){var i,t;return e&&(i=(t=e.options_)==null?void 0:t.enhancer)!=null?i:Hs}function Y3(e,i,t){if(Id(i))return Lg.decorate_20223_(e,i);if(Us(i)){Nd(e,i,Lg);return}return Tp(e)?e:Za(e)?un.object(e,i,t):Array.isArray(e)?un.array(e,i):vc(e)?un.map(e,i):Wa(e)?un.set(e,i):typeof e=="object"&&e!==null?e:un.box(e,i)}L3(Y3,W3);var J6={box:function(i,t){var n=Wh(t);return new $l(i,Yh(n),n.name,!0,n.equals)},array:function(i,t){var n=Wh(t);return(We.useProxies===!1||n.proxy===!1?o8:Kw)(i,Yh(n),n.name)},map:function(i,t){var n=Wh(t);return new Mp(i,Yh(n),n.name)},set:function(i,t){var n=Wh(t);return new sv(i,Yh(n),n.name)},object:function(i,t,n){return Jl(function(){return tv(We.useProxies===!1||(n==null?void 0:n.proxy)===!1?Ys({},n):Vw({},n),i,t)})},ref:Co(Y6),shallow:Co(K6),deep:W3,struct:Co(X6)},un=L3(Y3,J6),K3="computed",ew="computed.struct",Ng=Kg(K3),tw=Kg(ew,{equals:qs.structural}),$s=function(i,t){if(Id(t))return Ng.decorate_20223_(i,t);if(Us(t))return Nd(i,t,Ng);if(Za(i))return Co(Kg(K3,i));var n=Za(t)?t:{};return n.get=i,n.name||(n.name=i.name||""),new To(n)};Object.assign($s,Ng);$s.struct=Co(tw);var Em,Om,sp=0,nw=1,rw=(Em=(Om=lp(function(){},"name"))==null?void 0:Om.configurable)!=null?Em:!1,xm={value:"action",configurable:!0,writable:!1,enumerable:!1};function Kl(e,i,t,n){t===void 0&&(t=!1);function a(){return X3(e,t,i,n||this,arguments)}return a.isMobxAction=!0,a.toString=function(){return i.toString()},rw&&(xm.value=e,sa(a,"name",xm)),a}function X3(e,i,t,n,a){var l=Z3(e,i);try{return t.apply(n,a)}catch(s){throw l.error_=s,s}finally{Q3(l)}}function Z3(e,i,t,n){var a=!1,l=0,s=We.trackingDerivation,c=!i||!s;vi();var d=We.allowStateChanges;c&&(Ws(),d=xp(!0));var w=Cp(!0),_={runAsAction_:c,prevDerivation_:s,prevAllowStateChanges_:d,prevAllowStateReads_:w,notifySpy_:a,startTime_:l,actionId_:nw++,parentActionId_:sp};return sp=_.actionId_,_}function Q3(e){sp!==e.actionId_&&At(30),sp=e.parentActionId_,e.error_!==void 0&&(We.suppressReactionErrors=!0),Pp(e.prevAllowStateChanges_),rc(e.prevAllowStateReads_),mi(),e.runAsAction_&&Ka(e.prevDerivation_),We.suppressReactionErrors=!1}function Xg(e,i){var t=xp(e);try{return i()}finally{Pp(t)}}function xp(e){var i=We.allowStateChanges;return We.allowStateChanges=e,i}function Pp(e){We.allowStateChanges=e}var $l=function(e){function i(n,a,l,s,c){var d;return l===void 0&&(l="ObservableValue"),c===void 0&&(c=qs.default),d=e.call(this,l)||this,d.enhancer=void 0,d.name_=void 0,d.equals=void 0,d.hasUnreportedChange_=!1,d.interceptors_=void 0,d.changeListeners_=void 0,d.value_=void 0,d.dehancer=void 0,d.enhancer=a,d.name_=l,d.equals=c,d.value_=a(n,void 0,l),d}B3(i,e);var t=i.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!==We.UNCHANGED&&this.setNewValue_(a)},t.prepareNewValue_=function(a){if(Xi(this)){var l=Zi(this,{object:this,type:ua,newValue:a});if(!l)return We.UNCHANGED;a=l.newValue}return a=this.enhancer(a,this.value_,this.name_),this.equals(this.value_,a)?We.UNCHANGED:a},t.setNewValue_=function(a){var l=this.value_;this.value_=a,this.reportChanged(),ko(this)&&Ao(this,{type:ua,object:this,newValue:a,oldValue:l})},t.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},t.intercept_=function(a){return jd(this,a)},t.observe_=function(a,l){return l&&a({observableKind:"value",debugObjectName:this.name_,object:this,type:ua,newValue:this.value_,oldValue:void 0}),Fd(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 z3(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},i}(Ql),Zg=Zl("ObservableValue",$l),To=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 cp(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=up.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||At(31),this.derivation=t.get,this.name_=t.name||"ComputedValue",t.set&&(this.setter_=Kl("ComputedValue-setter",t.set)),this.equals_=t.equals||(t.compareStructural||t.struct?qs.structural:qs.default),this.scope_=t.context,this.requiresReaction_=t.requiresReaction,this.keepAlive_=!!t.keepAlive}var i=e.prototype;return i.onBecomeStale_=function(){hw(this)},i.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},i.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},i.get=function(){if(this.isComputing&&At(32,this.name_,this.derivation),We.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)Ig(this)&&(this.warnAboutUntrackedRead_(),vi(),this.value_=this.computeValue_(!1),mi());else if(o5(this),Ig(this)){var n=We.trackingContext;this.keepAlive_&&!n&&(We.trackingContext=this),this.trackAndCompute()&&dw(this),We.trackingContext=n}var a=this.value_;if(tp(a))throw a.cause;return a},i.set=function(n){if(this.setter_){this.isRunningSetter&&At(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter=!1}}else At(34,this.name_)},i.trackAndCompute=function(){var n=this.value_,a=this.dependenciesState_===Xt.NOT_TRACKING_,l=this.computeValue_(!0),s=a||tp(n)||tp(l)||!this.equals_(n,l);return s&&(this.value_=l),s},i.computeValue_=function(n){this.isComputing=!0;var a=xp(!1),l;if(n)l=J3(this,this.derivation,this.scope_);else if(We.disableErrorBoundaries===!0)l=this.derivation.call(this.scope_);else try{l=this.derivation.call(this.scope_)}catch(s){l=new cp(s)}return Pp(a),this.isComputing=!1,l},i.suspend_=function(){this.keepAlive_||(Dg(this),this.value_=void 0)},i.observe_=function(n,a){var l=this,s=!0,c=void 0;return Jg(function(){var d=l.get();if(!s||a){var w=Ws();n({observableKind:"computed",debugObjectName:l.name_,type:ua,object:l,newValue:d,oldValue:c}),Ka(w)}s=!1,c=d})},i.warnAboutUntrackedRead_=function(){},i.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},i.valueOf=function(){return z3(this.get())},i[Symbol.toPrimitive]=function(){return this.valueOf()},mc(e,[{key:"isComputing",get:function(){return Ri(this.flags_,e.isComputingMask_)},set:function(n){this.flags_=Mi(this.flags_,e.isComputingMask_,n)}},{key:"isRunningSetter",get:function(){return Ri(this.flags_,e.isRunningSetterMask_)},set:function(n){this.flags_=Mi(this.flags_,e.isRunningSetterMask_,n)}},{key:"isBeingObserved",get:function(){return Ri(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=Mi(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return Ri(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=Mi(this.flags_,e.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return Ri(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=Mi(this.flags_,e.diffValueMask_,n===1)}}])}();To.isComputingMask_=1;To.isRunningSetterMask_=2;To.isBeingObservedMask_=4;To.isPendingUnobservationMask_=8;To.diffValueMask_=16;var Gs=Zl("ComputedValue",To),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 up;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(up||(up={}));var cp=function(i){this.cause=void 0,this.cause=i};function tp(e){return e instanceof cp}function Ig(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 i=Cp(!0),t=Ws(),n=e.observing_,a=n.length,l=0;l<a;l++){var s=n[l];if(Gs(s)){if(We.disableErrorBoundaries)s.get();else try{s.get()}catch{return Ka(t),rc(i),!0}if(e.dependenciesState_===Xt.STALE_)return Ka(t),rc(i),!0}}return e5(e),Ka(t),rc(i),!1}}}function iw(){return We.trackingDerivation!==null}function J3(e,i,t){var n=Cp(!0);e5(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++We.runId;var a=We.trackingDerivation;We.trackingDerivation=e,We.inBatch++;var l;if(We.disableErrorBoundaries===!0)l=i.call(t);else try{l=i.call(t)}catch(s){l=new cp(s)}return We.inBatch--,We.trackingDerivation=a,ow(e),rc(n),l}function ow(e){for(var i=e.observing_,t=e.observing_=e.newObserving_,n=Xt.UP_TO_DATE_,a=0,l=e.unboundDepsCount_,s=0;s<l;s++){var c=t[s];c.diffValue===0&&(c.diffValue=1,a!==s&&(t[a]=c),a++),c.dependenciesState_>n&&(n=c.dependenciesState_)}for(t.length=a,e.newObserving_=null,l=i.length;l--;){var d=i[l];d.diffValue===0&&r5(d,e),d.diffValue=0}for(;a--;){var w=t[a];w.diffValue===1&&(w.diffValue=0,fw(w,e))}n!==Xt.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function Dg(e){var i=e.observing_;e.observing_=[];for(var t=i.length;t--;)r5(i[t],e);e.dependenciesState_=Xt.NOT_TRACKING_}function Qg(e){var i=Ws();try{return e()}finally{Ka(i)}}function Ws(){var e=We.trackingDerivation;return We.trackingDerivation=null,e}function Ka(e){We.trackingDerivation=e}function Cp(e){var i=We.allowStateReads;return We.allowStateReads=e,i}function rc(e){We.allowStateReads=e}function e5(e){if(e.dependenciesState_!==Xt.UP_TO_DATE_){e.dependenciesState_=Xt.UP_TO_DATE_;for(var i=e.observing_,t=i.length;t--;)i[t].lowestObserverState_=Xt.UP_TO_DATE_}}var aw=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED","useProxies"],_d=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},np=!0,t5=!1,We=function(){var e=wp();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(np=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new _d().version&&(np=!1),np?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new _d):(setTimeout(function(){t5||At(35)},1),new _d)}();function lw(){if((We.pendingReactions.length||We.inBatch||We.isRunningReactions)&&At(36),t5=!0,np){var e=wp();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),We=new _d}}function n5(){return We}function sw(){var e=new _d;for(var i in e)aw.indexOf(i)===-1&&(We[i]=e[i]);We.allowStateChanges=!We.enforceActions}function uw(e){return e.observers_&&e.observers_.size>0}function cw(e){return e.observers_}function fw(e,i){e.observers_.add(i),e.lowestObserverState_>i.dependenciesState_&&(e.lowestObserverState_=i.dependenciesState_)}function r5(e,i){e.observers_.delete(i),e.observers_.size===0&&i5(e)}function i5(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,We.pendingUnobservations.push(e))}function vi(){We.inBatch++}function mi(){if(--We.inBatch===0){l5();for(var e=We.pendingUnobservations,i=0;i<e.length;i++){var t=e[i];t.isPendingUnobservation=!1,t.observers_.size===0&&(t.isBeingObserved&&(t.isBeingObserved=!1,t.onBUO()),t instanceof To&&t.suspend_())}We.pendingUnobservations=[]}}function o5(e){var i=We.trackingDerivation;return i!==null?(i.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=i.runId_,i.newObserving_[i.unboundDepsCount_++]=e,!e.isBeingObserved&&We.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&We.inBatch>0&&i5(e),!1)}function a5(e){e.lowestObserverState_!==Xt.STALE_&&(e.lowestObserverState_=Xt.STALE_,e.observers_.forEach(function(i){i.dependenciesState_===Xt.UP_TO_DATE_&&i.onBecomeStale_(),i.dependenciesState_=Xt.STALE_}))}function dw(e){e.lowestObserverState_!==Xt.STALE_&&(e.lowestObserverState_=Xt.STALE_,e.observers_.forEach(function(i){i.dependenciesState_===Xt.POSSIBLY_STALE_?i.dependenciesState_=Xt.STALE_:i.dependenciesState_===Xt.UP_TO_DATE_&&(e.lowestObserverState_=Xt.UP_TO_DATE_)}))}function hw(e){e.lowestObserverState_===Xt.UP_TO_DATE_&&(e.lowestObserverState_=Xt.POSSIBLY_STALE_,e.observers_.forEach(function(i){i.dependenciesState_===Xt.UP_TO_DATE_&&(i.dependenciesState_=Xt.POSSIBLY_STALE_,i.onBecomeStale_())}))}var Ro=function(){function e(t,n,a,l){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_=up.NONE,this.name_=t,this.onInvalidate_=n,this.errorHandler_=a,this.requiresObservable_=l}var i=e.prototype;return i.onBecomeStale_=function(){this.schedule_()},i.schedule_=function(){this.isScheduled||(this.isScheduled=!0,We.pendingReactions.push(this),l5())},i.runReaction_=function(){if(!this.isDisposed){vi(),this.isScheduled=!1;var n=We.trackingContext;if(We.trackingContext=this,Ig(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(a){this.reportExceptionInDerivation_(a)}}We.trackingContext=n,mi()}},i.track=function(n){if(!this.isDisposed){vi(),this.isRunning=!0;var a=We.trackingContext;We.trackingContext=this;var l=J3(this,n,void 0);We.trackingContext=a,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&Dg(this),tp(l)&&this.reportExceptionInDerivation_(l.cause),mi()}},i.reportExceptionInDerivation_=function(n){var a=this;if(this.errorHandler_){this.errorHandler_(n,this);return}if(We.disableErrorBoundaries)throw n;var l="[mobx] uncaught error in '"+this+"'";We.suppressReactionErrors||console.error(l,n),We.globalReactionErrorHandlers.forEach(function(s){return s(n,a)})},i.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(vi(),Dg(this),mi()))},i.getDisposer_=function(n){var a=this,l=function s(){a.dispose(),n==null||n.removeEventListener==null||n.removeEventListener("abort",s)};return n==null||n.addEventListener==null||n.addEventListener("abort",l),l[dt]=this,l},i.toString=function(){return"Reaction["+this.name_+"]"},i.trace=function(n){},mc(e,[{key:"isDisposed",get:function(){return Ri(this.flags_,e.isDisposedMask_)},set:function(n){this.flags_=Mi(this.flags_,e.isDisposedMask_,n)}},{key:"isScheduled",get:function(){return Ri(this.flags_,e.isScheduledMask_)},set:function(n){this.flags_=Mi(this.flags_,e.isScheduledMask_,n)}},{key:"isTrackPending",get:function(){return Ri(this.flags_,e.isTrackPendingMask_)},set:function(n){this.flags_=Mi(this.flags_,e.isTrackPendingMask_,n)}},{key:"isRunning",get:function(){return Ri(this.flags_,e.isRunningMask_)},set:function(n){this.flags_=Mi(this.flags_,e.isRunningMask_,n)}},{key:"diffValue",get:function(){return Ri(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=Mi(this.flags_,e.diffValueMask_,n===1)}}])}();Ro.isDisposedMask_=1;Ro.isScheduledMask_=2;Ro.isTrackPendingMask_=4;Ro.isRunningMask_=8;Ro.diffValueMask_=16;function pw(e){return We.globalReactionErrorHandlers.push(e),function(){var i=We.globalReactionErrorHandlers.indexOf(e);i>=0&&We.globalReactionErrorHandlers.splice(i,1)}}var gw=100,jg=function(i){return i()};function l5(){We.inBatch>0||We.isRunningReactions||jg(vw)}function vw(){We.isRunningReactions=!0;for(var e=We.pendingReactions,i=0;e.length>0;){++i===gw&&(console.error("[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var t=e.splice(0),n=0,a=t.length;n<a;n++)t[n].runReaction_()}We.isRunningReactions=!1}var fp=Zl("Reaction",Ro);function mw(e){var i=jg;jg=function(n){return e(function(){return i(n)})}}function wd(){return!1}function s5(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var u5="action",yw="action.bound",c5="autoAction",bw="autoAction.bound",f5="<unnamed action>",Fg=Dd(u5),_w=Dd(yw,{bound:!0}),zg=Dd(c5,{autoAction:!0}),ww=Dd(bw,{autoAction:!0,bound:!0});function d5(e){var i=function(n,a){if(Li(n))return Kl(n.name||f5,n,e);if(Li(a))return Kl(n,a,e);if(Id(a))return(e?zg:Fg).decorate_20223_(n,a);if(Us(a))return Nd(n,a,e?zg:Fg);if(Us(n))return Co(Dd(e?c5:u5,{name:n,autoAction:e}))};return i}var Zn=d5(!1);Object.assign(Zn,Fg);var ac=d5(!0);Object.assign(ac,zg);Zn.bound=Co(_w);ac.bound=Co(ww);function lc(e){return X3(e.name||f5,!1,e,this,void 0)}function sc(e){return Li(e)&&e.isMobxAction===!0}function Jg(e,i){var t,n,a,l;i===void 0&&(i=Wg);var s=(t=(n=i)==null?void 0:n.name)!=null?t:"Autorun",c=!i.scheduler&&!i.delay,d;if(c)d=new Ro(s,function(){this.track(E)},i.onError,i.requiresObservable);else{var w=h5(i),_=!1;d=new Ro(s,function(){_||(_=!0,w(function(){_=!1,d.isDisposed||d.track(E)}))},i.onError,i.requiresObservable)}function E(){e(d)}return(a=i)!=null&&(a=a.signal)!=null&&a.aborted||d.schedule_(),d.getDisposer_((l=i)==null?void 0:l.signal)}var Sw=function(i){return i()};function h5(e){return e.scheduler?e.scheduler:e.delay?function(i){return setTimeout(i,e.delay)}:Sw}function p5(e,i,t){var n,a,l;t===void 0&&(t=Wg);var s=(n=t.name)!=null?n:"Reaction",c=Zn(s,t.onError?Ew(t.onError,i):i),d=!t.scheduler&&!t.delay,w=h5(t),_=!0,E=!1,O,v=t.compareStructural?qs.structural:t.equals||qs.default,S=new Ro(s,function(){_||d?p():E||(E=!0,w(p))},t.onError,t.requiresObservable);function p(){if(E=!1,!S.isDisposed){var h=!1,P=O;S.track(function(){var g=Xg(!1,function(){return e(S)});h=_||!v(O,g),O=g}),(_&&t.fireImmediately||!_&&h)&&c(O,P,S),_=!1}}return(a=t)!=null&&(a=a.signal)!=null&&a.aborted||S.schedule_(),S.getDisposer_((l=t)==null?void 0:l.signal)}function Ew(e,i){return function(){try{return i.apply(this,arguments)}catch(t){e.call(this,t)}}}var Ow="onBO",xw="onBUO";function g5(e,i,t){return v5(Ow,e,i,t)}function ev(e,i,t){return v5(xw,e,i,t)}function v5(e,i,t,n){var a=typeof n=="function"?ca(i,t):ca(i),l=Li(n)?n:t,s=e+"L";return a[s]?a[s].add(l):a[s]=new Set([l]),function(){var c=a[s];c&&(c.delete(l),c.size===0&&delete a[s])}}var Pw="never",Kh="always",Cw="observed";function m5(e){e.isolateGlobalState===!0&&lw();var i=e.useProxies,t=e.enforceActions;if(i!==void 0&&(We.useProxies=i===Kh?!0:i===Pw?!1:typeof Proxy<"u"),i==="ifavailable"&&(We.verifyProxies=!0),t!==void 0){var n=t===Kh?Kh:t===Cw;We.enforceActions=n,We.allowStateChanges=!(n===!0||n===Kh)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(a){a in e&&(We[a]=!!e[a])}),We.allowStateReads=!We.observableRequiresReaction,e.reactionScheduler&&mw(e.reactionScheduler)}function tv(e,i,t,n){var a=a6(i);return Jl(function(){var l=Ys(e,n)[dt];oc(a).forEach(function(s){l.extend_(s,a[s],t&&s in t?t[s]:!0)})}),e}function y5(e,i){return b5(ca(e,i))}function b5(e){var i={name:e.name_};return e.observing_&&e.observing_.length>0&&(i.dependencies=Aw(e.observing_).map(b5)),i}function kw(e,i){return _5(ca(e,i))}function _5(e){var i={name:e.name_};return uw(e)&&(i.observers=Array.from(cw(e)).map(_5)),i}function Aw(e){return Array.from(new Set(e))}var Tw=0;function kp(){this.message="FLOW_CANCELLED"}kp.prototype=Object.create(Error.prototype);function Rw(e){return e instanceof kp}var C0=H3("flow"),Mw=H3("flow.bound",{bound:!0}),Vs=Object.assign(function(i,t){if(Id(t))return C0.decorate_20223_(i,t);if(Us(t))return Nd(i,t,C0);var n=i,a=n.name||"<unnamed flow>",l=function(){var c=this,d=arguments,w=++Tw,_=Zn(a+" - runid: "+w+" - init",n).apply(c,d),E,O=void 0,v=new Promise(function(S,p){var h=0;E=p;function P(b){O=void 0;var x;try{x=Zn(a+" - runid: "+w+" - yield "+h++,_.next).call(_,b)}catch(M){return p(M)}y(x)}function g(b){O=void 0;var x;try{x=Zn(a+" - runid: "+w+" - yield "+h++,_.throw).call(_,b)}catch(M){return p(M)}y(x)}function y(b){if(Li(b==null?void 0:b.then)){b.then(y,p);return}return b.done?S(b.value):(O=Promise.resolve(b.value),O.then(P,g))}P(void 0)});return v.cancel=Zn(a+" - runid: "+w+" - cancel",function(){try{O&&Pm(O);var S=_.return(void 0),p=Promise.resolve(S.value);p.then(ec,ec),Pm(p),E(new kp)}catch(h){E(h)}}),v};return l.isMobXFlow=!0,l},C0);Vs.bound=Co(Mw);function Pm(e){Li(e.cancel)&&e.cancel()}function Lw(e){return e}function uc(e){return(e==null?void 0:e.isMobXFlow)===!0}function nv(e,i,t){var n;return Nr(e)||ri(e)||Zg(e)?n=Mo(e):_r(e)&&(n=Mo(e,i)),n.dehancer=typeof i=="function"?i:t,function(){n.dehancer=void 0}}function Ap(e,i,t){return Li(t)?Iw(e,i,t):Nw(e,i)}function Nw(e,i){return Mo(e).intercept_(i)}function Iw(e,i,t){return Mo(e,i).intercept_(t)}function w5(e,i){if(i===void 0)return Gs(e);if(_r(e)===!1||!e[dt].values_.has(i))return!1;var t=ca(e,i);return Gs(t)}function Dw(e){return w5(e)}function S5(e,i){return w5(e,i)}function E5(e,i){return e?i!==void 0?_r(e)?e[dt].values_.has(i):!1:_r(e)||!!e[dt]||Yg(e)||fp(e)||Gs(e):!1}function Tp(e){return E5(e)}function O5(e,i){return E5(e,i)}function xd(e){if(_r(e))return e[dt].keys_();if(Nr(e)||lr(e))return Array.from(e.keys());if(ri(e))return e.map(function(i,t){return t});At(5)}function rv(e){if(_r(e))return xd(e).map(function(i){return e[i]});if(Nr(e))return xd(e).map(function(i){return e.get(i)});if(lr(e))return Array.from(e.values());if(ri(e))return e.slice();At(6)}function x5(e){if(_r(e))return xd(e).map(function(i){return[i,e[i]]});if(Nr(e))return xd(e).map(function(i){return[i,e.get(i)]});if(lr(e))return Array.from(e.entries());if(ri(e))return e.map(function(i,t){return[t,i]});At(7)}function iv(e,i,t){if(arguments.length===2&&!lr(e)){vi();var n=i;try{for(var a in n)iv(e,a,n[a])}finally{mi()}return}_r(e)?e[dt].set_(i,t):Nr(e)?e.set(i,t):lr(e)?e.add(i):ri(e)?(typeof i!="number"&&(i=parseInt(i,10)),i<0&&At("Invalid index: '"+i+"'"),vi(),i>=e.length&&(e.length=i+1),e[i]=t,mi()):At(8)}function jw(e,i){_r(e)?e[dt].delete_(i):Nr(e)||lr(e)?e.delete(i):ri(e)?(typeof i!="number"&&(i=parseInt(i,10)),e.splice(i,1)):At(9)}function P5(e,i){if(_r(e))return e[dt].has_(i);if(Nr(e))return e.has(i);if(lr(e))return e.has(i);if(ri(e))return i>=0&&i<e.length;At(10)}function Fw(e,i){if(P5(e,i)){if(_r(e))return e[dt].get_(i);if(Nr(e))return e.get(i);if(ri(e))return e[i];At(11)}}function ov(e,i,t){if(_r(e))return e[dt].defineProperty_(i,t);At(39)}function C5(e){if(_r(e))return e[dt].ownKeys_();At(38)}function Rp(e,i,t,n){return Li(t)?Bw(e,i,t,n):zw(e,i,t)}function zw(e,i,t){return Mo(e).observe_(i,t)}function Bw(e,i,t,n){return Mo(e,i).observe_(t,n)}function Xh(e,i,t){return e.set(i,t),t}function Qu(e,i){if(e==null||typeof e!="object"||e instanceof Date||!Tp(e))return e;if(Zg(e)||Gs(e))return Qu(e.get(),i);if(i.has(e))return i.get(e);if(ri(e)){var t=Xh(i,e,new Array(e.length));return e.forEach(function(s,c){t[c]=Qu(s,i)}),t}if(lr(e)){var n=Xh(i,e,new Set);return e.forEach(function(s){n.add(Qu(s,i))}),n}if(Nr(e)){var a=Xh(i,e,new Map);return e.forEach(function(s,c){a.set(c,Qu(s,i))}),a}else{var l=Xh(i,e,{});return C5(e).forEach(function(s){Md.propertyIsEnumerable.call(e,s)&&(l[s]=Qu(e[s],i))}),l}}function Uw(e,i){return Qu(e,new Map)}function qw(){}function aa(e,i){i===void 0&&(i=void 0),vi();try{return e.apply(i)}finally{mi()}}function Bg(e,i,t){return arguments.length===1||i&&typeof i=="object"?Hw(e,i):k5(e,i,t||{})}function k5(e,i,t){var n;if(typeof t.timeout=="number"){var a=new Error("WHEN_TIMEOUT");n=setTimeout(function(){if(!s[dt].isDisposed)if(s(),t.onError)t.onError(a);else throw a},t.timeout)}t.name="When";var l=Kl("When-effect",i),s=Jg(function(c){var d=Xg(!1,e);d&&(c.dispose(),n&&clearTimeout(n),l())},t);return s}function Hw(e,i){var t;if(i!=null&&(t=i.signal)!=null&&t.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var n,a,l=new Promise(function(s,c){var d,w=k5(e,s,Yl({},i,{onError:c}));n=function(){w(),c(new Error("WHEN_CANCELLED"))},a=function(){w(),c(new Error("WHEN_ABORTED"))},i==null||(d=i.signal)==null||d.addEventListener==null||d.addEventListener("abort",a)}).finally(function(){var s;return i==null||(s=i.signal)==null||s.removeEventListener==null?void 0:s.removeEventListener("abort",a)});return l.cancel=n,l}function Ku(e){return e[dt]}var Gw={has:function(i,t){return Ku(i).has_(t)},get:function(i,t){return Ku(i).get_(t)},set:function(i,t,n){var a;return Us(t)?(a=Ku(i).set_(t,n,!0))!=null?a:!0:!1},deleteProperty:function(i,t){var n;return Us(t)?(n=Ku(i).delete_(t,!0))!=null?n:!0:!1},defineProperty:function(i,t,n){var a;return(a=Ku(i).defineProperty_(t,n))!=null?a:!0},ownKeys:function(i){return Ku(i).ownKeys_()},preventExtensions:function(i){At(13)}};function Vw(e,i){var t,n;return N3(),e=Ys(e,i),(n=(t=e[dt]).proxy_)!=null?n:t.proxy_=new Proxy(e,Gw)}function Xi(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function jd(e,i){var t=e.interceptors_||(e.interceptors_=[]);return t.push(i),I3(function(){var n=t.indexOf(i);n!==-1&&t.splice(n,1)})}function Zi(e,i){var t=Ws();try{for(var n=[].concat(e.interceptors_||[]),a=0,l=n.length;a<l&&(i=n[a](i),i&&!i.type&&At(14),!!i);a++);return i}finally{Ka(t)}}function ko(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function Fd(e,i){var t=e.changeListeners_||(e.changeListeners_=[]);return t.push(i),I3(function(){var n=t.indexOf(i);n!==-1&&t.splice(n,1)})}function Ao(e,i){var t=Ws(),n=e.changeListeners_;if(n){n=n.slice();for(var a=0,l=n.length;a<l;a++)n[a](i);Ka(t)}}function av(e,i,t){return Jl(function(){var n,a=Ys(e,t)[dt];(n=i)!=null||(i=f6(e)),oc(i).forEach(function(l){return a.make_(l,i[l])})}),e}var k0=Symbol("mobx-keys");function $w(e,i,t){return Za(e)?tv(e,e,i,t):(Jl(function(){var n=Ys(e,t)[dt];if(!e[k0]){var a=Object.getPrototypeOf(e),l=new Set([].concat(oc(e),oc(a)));l.delete("constructor"),l.delete(dt),Ld(a,k0,l)}e[k0].forEach(function(s){return n.make_(s,i&&s in i?i[s]:!0)})}),e)}var Cm="splice",ua="update",Ww=1e4,Yw={get:function(i,t){var n=i[dt];return t===dt?n:t==="length"?n.getArrayLength_():typeof t=="string"&&!isNaN(t)?n.get_(parseInt(t)):Ya(dp,t)?dp[t]:i[t]},set:function(i,t,n){var a=i[dt];return t==="length"&&a.setArrayLength_(n),typeof t=="symbol"||isNaN(t)?i[t]=n:a.set_(parseInt(t),n),!0},preventExtensions:function(){At(15)}},lv=function(){function e(t,n,a,l){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_=l,this.atom_=new Ql(t),this.enhancer_=function(s,c){return n(s,c,"ObservableArray[..]")}}var i=e.prototype;return i.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},i.dehanceValues_=function(n){return this.dehancer!==void 0&&n.length>0?n.map(this.dehancer):n},i.intercept_=function(n){return jd(this,n)},i.observe_=function(n,a){return a===void 0&&(a=!1),a&&n({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),Fd(this,n)},i.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},i.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&At("Out of range: "+n);var a=this.values_.length;if(n!==a)if(n>a){for(var l=new Array(n-a),s=0;s<n-a;s++)l[s]=void 0;this.spliceWithArray_(a,0,l)}else this.spliceWithArray_(n,a-n)},i.updateArrayLength_=function(n,a){n!==this.lastKnownLength_&&At(16),this.lastKnownLength_+=a,this.legacyMode_&&a>0&&L5(n+a+1)},i.spliceWithArray_=function(n,a,l){var s=this;this.atom_;var c=this.values_.length;if(n===void 0?n=0:n>c?n=c:n<0&&(n=Math.max(0,c+n)),arguments.length===1?a=c-n:a==null?a=0:a=Math.max(0,Math.min(a,c-n)),l===void 0&&(l=Rg),Xi(this)){var d=Zi(this,{object:this.proxy_,type:Cm,index:n,removedCount:a,added:l});if(!d)return Rg;a=d.removedCount,l=d.added}if(l=l.length===0?l:l.map(function(E){return s.enhancer_(E,void 0)}),this.legacyMode_){var w=l.length-a;this.updateArrayLength_(c,w)}var _=this.spliceItemsIntoValues_(n,a,l);return(a!==0||l.length!==0)&&this.notifyArraySplice_(n,l,_),this.dehanceValues_(_)},i.spliceItemsIntoValues_=function(n,a,l){if(l.length<Ww){var s;return(s=this.values_).splice.apply(s,[n,a].concat(l))}else{var c=this.values_.slice(n,n+a),d=this.values_.slice(n+a);this.values_.length+=l.length-a;for(var w=0;w<l.length;w++)this.values_[n+w]=l[w];for(var _=0;_<d.length;_++)this.values_[n+l.length+_]=d[_];return c}},i.notifyArrayChildUpdate_=function(n,a,l){var s=!this.owned_&&wd(),c=ko(this),d=c||s?{observableKind:"array",object:this.proxy_,type:ua,debugObjectName:this.atom_.name_,index:n,newValue:a,oldValue:l}:null;this.atom_.reportChanged(),c&&Ao(this,d)},i.notifyArraySplice_=function(n,a,l){var s=!this.owned_&&wd(),c=ko(this),d=c||s?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:Cm,index:n,removed:l,added:a,removedCount:l.length,addedCount:a.length}:null;this.atom_.reportChanged(),c&&Ao(this,d)},i.get_=function(n){if(this.legacyMode_&&n>=this.values_.length){console.warn("[mobx] Out of bounds read: "+n);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[n])},i.set_=function(n,a){var l=this.values_;if(this.legacyMode_&&n>l.length&&At(17,n,l.length),n<l.length){this.atom_;var s=l[n];if(Xi(this)){var c=Zi(this,{type:ua,object:this.proxy_,index:n,newValue:a});if(!c)return;a=c.newValue}a=this.enhancer_(a,s);var d=a!==s;d&&(l[n]=a,this.notifyArrayChildUpdate_(n,a,s))}else{for(var w=new Array(n+1-l.length),_=0;_<w.length-1;_++)w[_]=void 0;w[w.length-1]=a,this.spliceWithArray_(l.length,0,w)}},e}();function Kw(e,i,t,n){return t===void 0&&(t="ObservableArray"),n===void 0&&(n=!1),N3(),Jl(function(){var a=new lv(t,i,n,!1);j3(a.values_,dt,a);var l=new Proxy(a.values_,Yw);return a.proxy_=l,e&&e.length&&a.spliceWithArray_(0,0,e),l})}var dp={clear:function(){return this.splice(0)},replace:function(i){var t=this[dt];return t.spliceWithArray_(0,t.values_.length,i)},toJSON:function(){return this.slice()},splice:function(i,t){for(var n=arguments.length,a=new Array(n>2?n-2:0),l=2;l<n;l++)a[l-2]=arguments[l];var s=this[dt];switch(arguments.length){case 0:return[];case 1:return s.spliceWithArray_(i);case 2:return s.spliceWithArray_(i,t)}return s.spliceWithArray_(i,t,a)},spliceWithArray:function(i,t,n){return this[dt].spliceWithArray_(i,t,n)},push:function(){for(var i=this[dt],t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return i.spliceWithArray_(i.values_.length,0,n),i.values_.length},pop:function(){return this.splice(Math.max(this[dt].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var i=this[dt],t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return i.spliceWithArray_(0,0,n),i.values_.length},reverse:function(){return We.trackingDerivation&&At(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){We.trackingDerivation&&At(37,"sort");var i=this.slice();return i.sort.apply(i,arguments),this.replace(i),this},remove:function(i){var t=this[dt],n=t.dehanceValues_(t.values_).indexOf(i);return n>-1?(this.splice(n,1),!0):!1}};bn("at",Ni);bn("concat",Ni);bn("flat",Ni);bn("includes",Ni);bn("indexOf",Ni);bn("join",Ni);bn("lastIndexOf",Ni);bn("slice",Ni);bn("toString",Ni);bn("toLocaleString",Ni);bn("toSorted",Ni);bn("toSpliced",Ni);bn("with",Ni);bn("every",Lo);bn("filter",Lo);bn("find",Lo);bn("findIndex",Lo);bn("findLast",Lo);bn("findLastIndex",Lo);bn("flatMap",Lo);bn("forEach",Lo);bn("map",Lo);bn("some",Lo);bn("toReversed",Lo);bn("reduce",A5);bn("reduceRight",A5);function bn(e,i){typeof Array.prototype[e]=="function"&&(dp[e]=i(e))}function Ni(e){return function(){var i=this[dt];i.atom_.reportObserved();var t=i.dehanceValues_(i.values_);return t[e].apply(t,arguments)}}function Lo(e){return function(i,t){var n=this,a=this[dt];a.atom_.reportObserved();var l=a.dehanceValues_(a.values_);return l[e](function(s,c){return i.call(t,s,c,n)})}}function A5(e){return function(){var i=this,t=this[dt];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_),a=arguments[0];return arguments[0]=function(l,s,c){return a(l,s,c,i)},n[e].apply(n,arguments)}}var Xw=Zl("ObservableArrayAdministration",lv);function ri(e){return Sp(e)&&Xw(e[dt])}var Zw={},Vl="add",hp="delete",Mp=function(){function e(t,n,a){var l=this;n===void 0&&(n=Hs),a===void 0&&(a="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[dt]=Zw,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=n,this.name_=a,Li(Map)||At(18),Jl(function(){l.keysAtom_=Od("ObservableMap.keys()"),l.data_=new Map,l.hasMap_=new Map,t&&l.merge(t)})}var i=e.prototype;return i.has_=function(n){return this.data_.has(n)},i.has=function(n){var a=this;if(!We.trackingDerivation)return this.has_(n);var l=this.hasMap_.get(n);if(!l){var s=l=new $l(this.has_(n),Ep,"ObservableMap.key?",!1);this.hasMap_.set(n,s),ev(s,function(){return a.hasMap_.delete(n)})}return l.get()},i.set=function(n,a){var l=this.has_(n);if(Xi(this)){var s=Zi(this,{type:l?ua:Vl,object:this,newValue:a,name:n});if(!s)return this;a=s.newValue}return l?this.updateValue_(n,a):this.addValue_(n,a),this},i.delete=function(n){var a=this;if(this.keysAtom_,Xi(this)){var l=Zi(this,{type:hp,object:this,name:n});if(!l)return!1}if(this.has_(n)){var s=wd(),c=ko(this),d=c||s?{observableKind:"map",debugObjectName:this.name_,type:hp,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return aa(function(){var w;a.keysAtom_.reportChanged(),(w=a.hasMap_.get(n))==null||w.setNewValue_(!1);var _=a.data_.get(n);_.setNewValue_(void 0),a.data_.delete(n)}),c&&Ao(this,d),!0}return!1},i.updateValue_=function(n,a){var l=this.data_.get(n);if(a=l.prepareNewValue_(a),a!==We.UNCHANGED){var s=wd(),c=ko(this),d=c||s?{observableKind:"map",debugObjectName:this.name_,type:ua,object:this,oldValue:l.value_,name:n,newValue:a}:null;l.setNewValue_(a),c&&Ao(this,d)}},i.addValue_=function(n,a){var l=this;this.keysAtom_,aa(function(){var w,_=new $l(a,l.enhancer_,"ObservableMap.key",!1);l.data_.set(n,_),a=_.value_,(w=l.hasMap_.get(n))==null||w.setNewValue_(!0),l.keysAtom_.reportChanged()});var s=wd(),c=ko(this),d=c||s?{observableKind:"map",debugObjectName:this.name_,type:Vl,object:this,name:n,newValue:a}:null;c&&Ao(this,d)},i.get=function(n){return this.has(n)?this.dehanceValue_(this.data_.get(n).get()):this.dehanceValue_(void 0)},i.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},i.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},i.values=function(){var n=this,a=this.keys();return km({next:function(){var s=a.next(),c=s.done,d=s.value;return{done:c,value:c?void 0:n.get(d)}}})},i.entries=function(){var n=this,a=this.keys();return km({next:function(){var s=a.next(),c=s.done,d=s.value;return{done:c,value:c?void 0:[d,n.get(d)]}}})},i[Symbol.iterator]=function(){return this.entries()},i.forEach=function(n,a){for(var l=tc(this),s;!(s=l()).done;){var c=s.value,d=c[0],w=c[1];n.call(a,w,d,this)}},i.merge=function(n){var a=this;return Nr(n)&&(n=new Map(n)),aa(function(){Za(n)?o6(n).forEach(function(l){return a.set(l,n[l])}):Array.isArray(n)?n.forEach(function(l){var s=l[0],c=l[1];return a.set(s,c)}):vc(n)?(i6(n)||At(19,n),n.forEach(function(l,s){return a.set(s,l)})):n!=null&&At(20,n)}),this},i.clear=function(){var n=this;aa(function(){Qg(function(){for(var a=tc(n.keys()),l;!(l=a()).done;){var s=l.value;n.delete(s)}})})},i.replace=function(n){var a=this;return aa(function(){for(var l=Qw(n),s=new Map,c=!1,d=tc(a.data_.keys()),w;!(w=d()).done;){var _=w.value;if(!l.has(_)){var E=a.delete(_);if(E)c=!0;else{var O=a.data_.get(_);s.set(_,O)}}}for(var v=tc(l.entries()),S;!(S=v()).done;){var p=S.value,h=p[0],P=p[1],g=a.data_.has(h);if(a.set(h,P),a.data_.has(h)){var y=a.data_.get(h);s.set(h,y),g||(c=!0)}}if(!c)if(a.data_.size!==s.size)a.keysAtom_.reportChanged();else for(var b=a.data_.keys(),x=s.keys(),M=b.next(),T=x.next();!M.done;){if(M.value!==T.value){a.keysAtom_.reportChanged();break}M=b.next(),T=x.next()}a.data_=s}),this},i.toString=function(){return"[object ObservableMap]"},i.toJSON=function(){return Array.from(this)},i.observe_=function(n,a){return Fd(this,n)},i.intercept_=function(n){return jd(this,n)},mc(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),Nr=Zl("ObservableMap",Mp);function km(e){return e[Symbol.toStringTag]="MapIterator",fv(e)}function Qw(e){if(vc(e)||Nr(e))return e;if(Array.isArray(e))return new Map(e);if(Za(e)){var i=new Map;for(var t in e)i.set(t,e[t]);return i}else return At(21,e)}var Jw={},sv=function(){function e(t,n,a){var l=this;n===void 0&&(n=Hs),a===void 0&&(a="ObservableSet"),this.name_=void 0,this[dt]=Jw,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,Li(Set)||At(22),this.enhancer_=function(s,c){return n(s,c,a)},Jl(function(){l.atom_=Od(l.name_),t&&l.replace(t)})}var i=e.prototype;return i.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},i.clear=function(){var n=this;aa(function(){Qg(function(){for(var a=tc(n.data_.values()),l;!(l=a()).done;){var s=l.value;n.delete(s)}})})},i.forEach=function(n,a){for(var l=tc(this),s;!(s=l()).done;){var c=s.value;n.call(a,c,c,this)}},i.add=function(n){var a=this;if(this.atom_,Xi(this)){var l=Zi(this,{type:Vl,object:this,newValue:n});if(!l)return this}if(!this.has(n)){aa(function(){a.data_.add(a.enhancer_(n,void 0)),a.atom_.reportChanged()});var s=!1,c=ko(this),d=c||s?{observableKind:"set",debugObjectName:this.name_,type:Vl,object:this,newValue:n}:null;c&&Ao(this,d)}return this},i.delete=function(n){var a=this;if(Xi(this)){var l=Zi(this,{type:hp,object:this,oldValue:n});if(!l)return!1}if(this.has(n)){var s=!1,c=ko(this),d=c||s?{observableKind:"set",debugObjectName:this.name_,type:hp,object:this,oldValue:n}:null;return aa(function(){a.atom_.reportChanged(),a.data_.delete(n)}),c&&Ao(this,d),!0}return!1},i.has=function(n){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(n))},i.entries=function(){var n=0,a=Array.from(this.keys()),l=Array.from(this.values());return Am({next:function(){var c=n;return n+=1,c<l.length?{value:[a[c],l[c]],done:!1}:{value:void 0,done:!0}}})},i.keys=function(){return this.values()},i.values=function(){this.atom_.reportObserved();var n=this,a=0,l=Array.from(this.data_.values());return Am({next:function(){return a<l.length?{value:n.dehanceValue_(l[a++]),done:!1}:{value:void 0,done:!0}}})},i.intersection=function(n){if(Wa(n)&&!lr(n))return n.intersection(this);var a=new Set(this);return a.intersection(n)},i.union=function(n){if(Wa(n)&&!lr(n))return n.union(this);var a=new Set(this);return a.union(n)},i.difference=function(n){return new Set(this).difference(n)},i.symmetricDifference=function(n){if(Wa(n)&&!lr(n))return n.symmetricDifference(this);var a=new Set(this);return a.symmetricDifference(n)},i.isSubsetOf=function(n){return new Set(this).isSubsetOf(n)},i.isSupersetOf=function(n){return new Set(this).isSupersetOf(n)},i.isDisjointFrom=function(n){if(Wa(n)&&!lr(n))return n.isDisjointFrom(this);var a=new Set(this);return a.isDisjointFrom(n)},i.replace=function(n){var a=this;return lr(n)&&(n=new Set(n)),aa(function(){Array.isArray(n)?(a.clear(),n.forEach(function(l){return a.add(l)})):Wa(n)?(a.clear(),n.forEach(function(l){return a.add(l)})):n!=null&&At("Cannot initialize set from "+n)}),this},i.observe_=function(n,a){return Fd(this,n)},i.intercept_=function(n){return jd(this,n)},i.toJSON=function(){return Array.from(this)},i.toString=function(){return"[object ObservableSet]"},i[Symbol.iterator]=function(){return this.values()},mc(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),lr=Zl("ObservableSet",sv);function Am(e){return e[Symbol.toStringTag]="SetIterator",fv(e)}var Tm=Object.create(null),Rm="remove",T5=function(){function e(t,n,a,l){n===void 0&&(n=new Map),l===void 0&&(l=B6),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_=n,this.name_=a,this.defaultAnnotation_=l,this.keysAtom_=new Ql("ObservableObject.keys"),this.isPlainObject_=Za(this.target_)}var i=e.prototype;return i.getObservablePropValue_=function(n){return this.values_.get(n).get()},i.setObservablePropValue_=function(n,a){var l=this.values_.get(n);if(l instanceof To)return l.set(a),!0;if(Xi(this)){var s=Zi(this,{type:ua,object:this.proxy_||this.target_,name:n,newValue:a});if(!s)return null;a=s.newValue}if(a=l.prepareNewValue_(a),a!==We.UNCHANGED){var c=ko(this),d=!1,w=c||d?{type:ua,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:l.value_,name:n,newValue:a}:null;l.setNewValue_(a),c&&Ao(this,w)}return!0},i.get_=function(n){return We.trackingDerivation&&!Ya(this.target_,n)&&this.has_(n),this.target_[n]},i.set_=function(n,a,l){return l===void 0&&(l=!1),Ya(this.target_,n)?this.values_.has(n)?this.setObservablePropValue_(n,a):l?Reflect.set(this.target_,n,a):(this.target_[n]=a,!0):this.extend_(n,{value:a,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,l)},i.has_=function(n){if(!We.trackingDerivation)return n in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var a=this.pendingKeys_.get(n);return a||(a=new $l(n in this.target_,Ep,"ObservableObject.key?",!1),this.pendingKeys_.set(n,a)),a.get()},i.make_=function(n,a){if(a===!0&&(a=this.defaultAnnotation_),a!==!1){if(!(n in this.target_)){var l;if((l=this.target_[la])!=null&&l[n])return;At(1,a.annotationType_,this.name_+"."+n.toString())}for(var s=this.target_;s&&s!==Md;){var c=lp(s,n);if(c){var d=a.make_(this,n,c,s);if(d===0)return;if(d===1)break}s=Object.getPrototypeOf(s)}Lm(this,a,n)}},i.extend_=function(n,a,l,s){if(s===void 0&&(s=!1),l===!0&&(l=this.defaultAnnotation_),l===!1)return this.defineProperty_(n,a,s);var c=l.extend_(this,n,a,s);return c&&Lm(this,l,n),c},i.defineProperty_=function(n,a,l){l===void 0&&(l=!1),this.keysAtom_;try{vi();var s=this.delete_(n);if(!s)return s;if(Xi(this)){var c=Zi(this,{object:this.proxy_||this.target_,name:n,type:Vl,newValue:a.value});if(!c)return null;var d=c.newValue;a.value!==d&&(a=Yl({},a,{value:d}))}if(l){if(!Reflect.defineProperty(this.target_,n,a))return!1}else sa(this.target_,n,a);this.notifyPropertyAddition_(n,a.value)}finally{mi()}return!0},i.defineObservableProperty_=function(n,a,l,s){s===void 0&&(s=!1),this.keysAtom_;try{vi();var c=this.delete_(n);if(!c)return c;if(Xi(this)){var d=Zi(this,{object:this.proxy_||this.target_,name:n,type:Vl,newValue:a});if(!d)return null;a=d.newValue}var w=Mm(n),_={configurable:We.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:w.get,set:w.set};if(s){if(!Reflect.defineProperty(this.target_,n,_))return!1}else sa(this.target_,n,_);var E=new $l(a,l,"ObservableObject.key",!1);this.values_.set(n,E),this.notifyPropertyAddition_(n,E.value_)}finally{mi()}return!0},i.defineComputedProperty_=function(n,a,l){l===void 0&&(l=!1),this.keysAtom_;try{vi();var s=this.delete_(n);if(!s)return s;if(Xi(this)){var c=Zi(this,{object:this.proxy_||this.target_,name:n,type:Vl,newValue:void 0});if(!c)return null}a.name||(a.name="ObservableObject.key"),a.context=this.proxy_||this.target_;var d=Mm(n),w={configurable:We.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:d.get,set:d.set};if(l){if(!Reflect.defineProperty(this.target_,n,w))return!1}else sa(this.target_,n,w);this.values_.set(n,new To(a)),this.notifyPropertyAddition_(n,void 0)}finally{mi()}return!0},i.delete_=function(n,a){if(a===void 0&&(a=!1),this.keysAtom_,!Ya(this.target_,n))return!0;if(Xi(this)){var l=Zi(this,{object:this.proxy_||this.target_,name:n,type:Rm});if(!l)return null}try{var s;vi();var c=ko(this),d=!1,w=this.values_.get(n),_=void 0;if(!w&&(c||d)){var E;_=(E=lp(this.target_,n))==null?void 0:E.value}if(a){if(!Reflect.deleteProperty(this.target_,n))return!1}else delete this.target_[n];if(w&&(this.values_.delete(n),w instanceof $l&&(_=w.value_),a5(w)),this.keysAtom_.reportChanged(),(s=this.pendingKeys_)==null||(s=s.get(n))==null||s.set(n in this.target_),c||d){var O={type:Rm,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:_,name:n};c&&Ao(this,O)}}finally{mi()}return!0},i.observe_=function(n,a){return Fd(this,n)},i.intercept_=function(n){return jd(this,n)},i.notifyPropertyAddition_=function(n,a){var l,s=ko(this),c=!1;if(s||c){var d=s||c?{type:Vl,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:a}:null;s&&Ao(this,d)}(l=this.pendingKeys_)==null||(l=l.get(n))==null||l.set(!0),this.keysAtom_.reportChanged()},i.ownKeys_=function(){return this.keysAtom_.reportObserved(),oc(this.target_)},i.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function Ys(e,i){var t;if(Ya(e,dt))return e;var n=(t=i==null?void 0:i.name)!=null?t:"ObservableObject",a=new T5(e,new Map,String(n),Z6(i));return Ld(e,dt,a),e}var e8=Zl("ObservableObjectAdministration",T5);function Mm(e){return Tm[e]||(Tm[e]={get:function(){return this[dt].getObservablePropValue_(e)},set:function(t){return this[dt].setObservablePropValue_(e,t)}})}function _r(e){return Sp(e)?e8(e[dt]):!1}function Lm(e,i,t){var n;(n=e.target_[la])==null||delete n[t]}var t8=M5(0),n8=function(){var e=!1,i={};return Object.defineProperty(i,"0",{set:function(){e=!0}}),Object.create(i)[0]=1,e===!1}(),A0=0,R5=function(){};function r8(e,i){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,i):e.prototype.__proto__!==void 0?e.prototype.__proto__=i:e.prototype=i}r8(R5,Array.prototype);var uv=function(e){function i(n,a,l,s){var c;return l===void 0&&(l="ObservableArray"),s===void 0&&(s=!1),c=e.call(this)||this,Jl(function(){var d=new lv(l,a,s,!0);d.proxy_=c,j3(c,dt,d),n&&n.length&&c.spliceWithArray(0,0,n),n8&&Object.defineProperty(c,"0",t8)}),c}B3(i,e);var t=i.prototype;return t.concat=function(){this[dt].atom_.reportObserved();for(var a=arguments.length,l=new Array(a),s=0;s<a;s++)l[s]=arguments[s];return Array.prototype.concat.apply(this.slice(),l.map(function(c){return ri(c)?c.slice():c}))},t[Symbol.iterator]=function(){var n=this,a=0;return fv({next:function(){return a<n.length?{value:n[a++],done:!1}:{done:!0,value:void 0}}})},mc(i,[{key:"length",get:function(){return this[dt].getArrayLength_()},set:function(a){this[dt].setArrayLength_(a)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(R5);Object.entries(dp).forEach(function(e){var i=e[0],t=e[1];i!=="concat"&&Ld(uv.prototype,i,t)});function M5(e){return{enumerable:!1,configurable:!0,get:function(){return this[dt].get_(e)},set:function(t){this[dt].set_(e,t)}}}function i8(e){sa(uv.prototype,""+e,M5(e))}function L5(e){if(e>A0){for(var i=A0;i<e+100;i++)i8(i);A0=e}}L5(1e3);function o8(e,i,t){return new uv(e,i,t)}function ca(e,i){if(typeof e=="object"&&e!==null){if(ri(e))return i!==void 0&&At(23),e[dt].atom_;if(lr(e))return e.atom_;if(Nr(e)){if(i===void 0)return e.keysAtom_;var t=e.data_.get(i)||e.hasMap_.get(i);return t||At(25,i,pp(e)),t}if(_r(e)){if(!i)return At(26);var n=e[dt].values_.get(i);return n||At(27,i,pp(e)),n}if(Yg(e)||Gs(e)||fp(e))return e}else if(Li(e)&&fp(e[dt]))return e[dt];At(28)}function Mo(e,i){if(e||At(29),i!==void 0)return Mo(ca(e,i));if(Yg(e)||Gs(e)||fp(e)||Nr(e)||lr(e))return e;if(e[dt])return e[dt];At(24,e)}function pp(e,i){var t;if(i!==void 0)t=ca(e,i);else{if(sc(e))return e.name;_r(e)||Nr(e)||lr(e)?t=Mo(e):t=ca(e)}return t.name_}function Jl(e){var i=Ws(),t=xp(!0);vi();try{return e()}finally{mi(),Pp(t),Ka(i)}}var Nm=Md.toString;function cv(e,i,t){return t===void 0&&(t=-1),Ug(e,i,t)}function Ug(e,i,t,n,a){if(e===i)return e!==0||1/e===1/i;if(e==null||i==null)return!1;if(e!==e)return i!==i;var l=typeof e;if(l!=="function"&&l!=="object"&&typeof i!="object")return!1;var s=Nm.call(e);if(s!==Nm.call(i))return!1;switch(s){case"[object RegExp]":case"[object String]":return""+e==""+i;case"[object Number]":return+e!=+e?+i!=+i:+e==0?1/+e===1/i:+e==+i;case"[object Date]":case"[object Boolean]":return+e==+i;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(i);case"[object Map]":case"[object Set]":t>=0&&t++;break}e=Im(e),i=Im(i);var c=s==="[object Array]";if(!c){if(typeof e!="object"||typeof i!="object")return!1;var d=e.constructor,w=i.constructor;if(d!==w&&!(Li(d)&&d instanceof d&&Li(w)&&w instanceof w)&&"constructor"in e&&"constructor"in i)return!1}if(t===0)return!1;t<0&&(t=-1),n=n||[],a=a||[];for(var _=n.length;_--;)if(n[_]===e)return a[_]===i;if(n.push(e),a.push(i),c){if(_=e.length,_!==i.length)return!1;for(;_--;)if(!Ug(e[_],i[_],t-1,n,a))return!1}else{var E=Object.keys(e),O;if(_=E.length,Object.keys(i).length!==_)return!1;for(;_--;)if(O=E[_],!(Ya(i,O)&&Ug(e[O],i[O],t-1,n,a)))return!1}return n.pop(),a.pop(),!0}function Im(e){return ri(e)?e.slice():vc(e)||Nr(e)||Wa(e)||lr(e)?Array.from(e.entries()):e}var Dm,a8=((Dm=wp().Iterator)==null?void 0:Dm.prototype)||{};function fv(e){return e[Symbol.iterator]=l8,Object.assign(Object.create(a8),e)}function l8(){return this}["Symbol","Map","Set"].forEach(function(e){var i=wp();typeof i[e]>"u"&&At("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:s5,extras:{getDebugName:pp},$mobx:dt});const s8=Object.freeze(Object.defineProperty({__proto__:null,$mobx:dt,FlowCancellationError:kp,ObservableMap:Mp,ObservableSet:sv,Reaction:Ro,_allowStateChanges:Xg,_allowStateChangesInsideComputed:lc,_allowStateReadsEnd:rc,_allowStateReadsStart:Cp,_autoAction:ac,_endAction:Q3,_getAdministration:Mo,_getGlobalState:n5,_interceptReads:nv,_isComputingDerivation:iw,_resetGlobalState:sw,_startAction:Z3,action:Zn,autorun:Jg,comparer:qs,computed:$s,configure:m5,createAtom:Od,defineProperty:ov,entries:x5,extendObservable:tv,flow:Vs,flowResult:Lw,get:Fw,getAtom:ca,getDebugName:pp,getDependencyTree:y5,getObserverTree:kw,has:P5,intercept:Ap,isAction:sc,isBoxedObservable:Zg,isComputed:Dw,isComputedProp:S5,isFlow:uc,isFlowCancellationError:Rw,isObservable:Tp,isObservableArray:ri,isObservableMap:Nr,isObservableObject:_r,isObservableProp:O5,isObservableSet:lr,keys:xd,makeAutoObservable:$w,makeObservable:av,observable:un,observe:Rp,onBecomeObserved:g5,onBecomeUnobserved:ev,onReactionError:pw,override:y6,ownKeys:C5,reaction:p5,remove:jw,runInAction:lc,set:iv,spy:s5,toJS:Uw,trace:qw,transaction:aa,untracked:Qg,values:rv,when:Bg},Symbol.toStringTag,{value:"Module"}));if(!xn.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!av)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var u8=R3();function c8(e){e()}function N5(e){e||(e=c8),m5({reactionScheduler:e})}var f8=function(){return!0};function d8(e){return y5(e)}var I5=!1;function D5(e){I5=e}function dv(){return I5}var h8=1e4,p8=1e4,g8=function(){function e(i){var t=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(n){n===void 0&&(n=h8),clearTimeout(t.sweepTimeout),t.sweepTimeout=void 0;var a=Date.now();t.registrations.forEach(function(l,s){a-l.registeredAt>=n&&(t.finalize(l.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(i,t,n){this.registrations.set(n,{value:t,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(i){this.registrations.delete(i)}}),Object.defineProperty(e.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,p8))}}),e}(),v8=typeof FinalizationRegistry<"u"?FinalizationRegistry:g8,gp=new v8(function(e){var i;(i=e.reaction)===null||i===void 0||i.dispose(),e.reaction=null}),T0={exports:{}},R0={};/**
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 jm;function m8(){if(jm)return R0;jm=1;var e=Tn();function i(E,O){return E===O&&(E!==0||1/E===1/O)||E!==E&&O!==O}var t=typeof Object.is=="function"?Object.is:i,n=e.useState,a=e.useEffect,l=e.useLayoutEffect,s=e.useDebugValue;function c(E,O){var v=O(),S=n({inst:{value:v,getSnapshot:O}}),p=S[0].inst,h=S[1];return l(function(){p.value=v,p.getSnapshot=O,d(p)&&h({inst:p})},[E,v,O]),a(function(){return d(p)&&h({inst:p}),E(function(){d(p)&&h({inst:p})})},[E]),s(v),v}function d(E){var O=E.getSnapshot;E=E.value;try{var v=O();return!t(E,v)}catch{return!0}}function w(E,O){return O()}var _=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?w:c;return R0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:_,R0}var Fm;function y8(){return Fm||(Fm=1,T0.exports=m8()),T0.exports}var b8=y8();function zm(e){e.reaction=new Ro("observer".concat(e.name),function(){var i;e.stateVersion=Symbol(),(i=e.onStoreChange)===null||i===void 0||i.call(e)})}function hv(e,i){if(i===void 0&&(i="observed"),dv())return e();var t=qt.useRef(null);if(!t.current){var n={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:i,subscribe:function(c){return gp.unregister(n),n.onStoreChange=c,n.reaction||(zm(n),n.stateVersion=Symbol()),function(){var d;n.onStoreChange=null,(d=n.reaction)===null||d===void 0||d.dispose(),n.reaction=null}},getSnapshot:function(){return n.stateVersion}};t.current=n}var a=t.current;a.reaction||(zm(a),gp.register(t,a,a)),qt.useDebugValue(a.reaction,d8),b8.useSyncExternalStore(a.subscribe,a.getSnapshot,a.getSnapshot);var l,s;if(a.reaction.track(function(){try{l=e()}catch(c){s=c}}),s)throw s;return l}var M0,L0,j5=typeof Symbol=="function"&&Symbol.for,_8=(L0=(M0=Object.getOwnPropertyDescriptor(function(){},"name"))===null||M0===void 0?void 0:M0.configurable)!==null&&L0!==void 0?L0:!1,Bm=j5?Symbol.for("react.forward_ref"):typeof xn.forwardRef=="function"&&xn.forwardRef(function(e){return null}).$$typeof,Um=j5?Symbol.for("react.memo"):typeof xn.memo=="function"&&xn.memo(function(e){return null}).$$typeof;function w8(e,i){var t;if(Um&&e.$$typeof===Um)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(dv())return e;var n=(t=i==null?void 0:i.forwardRef)!==null&&t!==void 0?t:!1,a=e,l=e.displayName||e.name;if(Bm&&e.$$typeof===Bm&&(n=!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,d){return hv(function(){return a(c,d)},l)};return s.displayName=e.displayName,_8&&Object.defineProperty(s,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(s.contextTypes=e.contextTypes),n&&(s=xn.forwardRef(s)),s=xn.memo(s),E8(e,s),s}var S8={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function E8(e,i){Object.keys(e).forEach(function(t){S8[t]||Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(e,t))})}function F5(e){var i=e.children,t=e.render;i&&t&&console.error("MobX Observer: Do not use children and render in the same time in `Observer`");var n=i||t;return typeof n!="function"?null:hv(n)}F5.displayName="Observer";function O8(e,i){return xn.useState(function(){return un(e(),i,{autoBind:!0})})[0]}function z5(e){var i=xn.useState(function(){return un(e,{},{deep:!1})})[0];return lc(function(){Object.assign(i,e)}),i}function x8(e,i){var t=i&&z5(i);return xn.useState(function(){return un(e(t),void 0,{autoBind:!0})})[0]}var N0;N5(u8.unstable_batchedUpdates);var P8=(N0=gp.finalizeAllImmediately)!==null&&N0!==void 0?N0:function(){};function C8(e,i){return i===void 0&&(i="observed"),hv(e,i)}function k8(e){D5(e)}const A8=Object.freeze(Object.defineProperty({__proto__:null,Observer:F5,_observerFinalizationRegistry:gp,clearTimers:P8,enableStaticRendering:D5,isObserverBatched:f8,isUsingStaticRendering:dv,observer:w8,observerBatching:N5,useAsObservableSource:z5,useLocalObservable:O8,useLocalStore:x8,useObserver:C8,useStaticRendering:k8},Symbol.toStringTag,{value:"Module"})),Qi=Xl(A8);var Is={};const No=Xl(s8);var rp={exports:{}},mf={},I0={},D0={},qm;function Nt(){return qm||(qm=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._registerNode=e.Konva=e.glob=void 0;const i=Math.PI/180;function t(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}e.glob=typeof ic<"u"?ic:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},e.Konva={_global:e.glob,version:"9.3.18",isBrowser:t(),isUnminified:/param/.test((function(a){}).toString()),dblClickWindow:400,getAngle(a){return e.Konva.angleDeg?a*i: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 n=a=>{e.Konva[a.prototype.getClassName()]=a};e._registerNode=n,e.Konva._injectGlobal(e.Konva)}(D0)),D0}var j0={},Hm;function In(){return Hm||(Hm=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const i=Nt();class t{constructor(b=[1,0,0,1,0,0]){this.dirty=!1,this.m=b&&b.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(b){b.m[0]=this.m[0],b.m[1]=this.m[1],b.m[2]=this.m[2],b.m[3]=this.m[3],b.m[4]=this.m[4],b.m[5]=this.m[5]}point(b){const x=this.m;return{x:x[0]*b.x+x[2]*b.y+x[4],y:x[1]*b.x+x[3]*b.y+x[5]}}translate(b,x){return this.m[4]+=this.m[0]*b+this.m[2]*x,this.m[5]+=this.m[1]*b+this.m[3]*x,this}scale(b,x){return this.m[0]*=b,this.m[1]*=b,this.m[2]*=x,this.m[3]*=x,this}rotate(b){const x=Math.cos(b),M=Math.sin(b),T=this.m[0]*x+this.m[2]*M,j=this.m[1]*x+this.m[3]*M,I=this.m[0]*-M+this.m[2]*x,m=this.m[1]*-M+this.m[3]*x;return this.m[0]=T,this.m[1]=j,this.m[2]=I,this.m[3]=m,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(b,x){const M=this.m[0]+this.m[2]*x,T=this.m[1]+this.m[3]*x,j=this.m[2]+this.m[0]*b,I=this.m[3]+this.m[1]*b;return this.m[0]=M,this.m[1]=T,this.m[2]=j,this.m[3]=I,this}multiply(b){const x=this.m[0]*b.m[0]+this.m[2]*b.m[1],M=this.m[1]*b.m[0]+this.m[3]*b.m[1],T=this.m[0]*b.m[2]+this.m[2]*b.m[3],j=this.m[1]*b.m[2]+this.m[3]*b.m[3],I=this.m[0]*b.m[4]+this.m[2]*b.m[5]+this.m[4],m=this.m[1]*b.m[4]+this.m[3]*b.m[5]+this.m[5];return this.m[0]=x,this.m[1]=M,this.m[2]=T,this.m[3]=j,this.m[4]=I,this.m[5]=m,this}invert(){const b=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),x=this.m[3]*b,M=-this.m[1]*b,T=-this.m[2]*b,j=this.m[0]*b,I=b*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),m=b*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=x,this.m[1]=M,this.m[2]=T,this.m[3]=j,this.m[4]=I,this.m[5]=m,this}getMatrix(){return this.m}decompose(){const b=this.m[0],x=this.m[1],M=this.m[2],T=this.m[3],j=this.m[4],I=this.m[5],m=b*T-x*M,A={x:j,y:I,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(b!=0||x!=0){const L=Math.sqrt(b*b+x*x);A.rotation=x>0?Math.acos(b/L):-Math.acos(b/L),A.scaleX=L,A.scaleY=m/L,A.skewX=(b*M+x*T)/m,A.skewY=0}else if(M!=0||T!=0){const L=Math.sqrt(M*M+T*T);A.rotation=Math.PI/2-(T>0?Math.acos(-M/L):-Math.acos(M/L)),A.scaleX=m/L,A.scaleY=L,A.skewX=0,A.skewY=(b*M+x*T)/m}return A.rotation=e.Util._getRotation(A.rotation),A}}e.Transform=t;const n="[object Array]",a="[object Number]",l="[object String]",s="[object Boolean]",c=Math.PI/180,d=180/Math.PI,w="#",_="",E="0",O="Konva warning: ",v="Konva error: ",S="rgb(",p={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]},h=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let P=[];const g=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(y){setTimeout(y,60)};e.Util={_isElement(y){return!!(y&&y.nodeType==1)},_isFunction(y){return!!(y&&y.constructor&&y.call&&y.apply)},_isPlainObject(y){return!!y&&y.constructor===Object},_isArray(y){return Object.prototype.toString.call(y)===n},_isNumber(y){return Object.prototype.toString.call(y)===a&&!isNaN(y)&&isFinite(y)},_isString(y){return Object.prototype.toString.call(y)===l},_isBoolean(y){return Object.prototype.toString.call(y)===s},isObject(y){return y instanceof Object},isValidSelector(y){if(typeof y!="string")return!1;const b=y[0];return b==="#"||b==="."||b===b.toUpperCase()},_sign(y){return y===0||y>0?1:-1},requestAnimFrame(y){P.push(y),P.length===1&&g(function(){const b=P;P=[],b.forEach(function(x){x()})})},createCanvasElement(){const y=document.createElement("canvas");try{y.style=y.style||{}}catch{}return y},createImageElement(){return document.createElement("img")},_isInDocument(y){for(;y=y.parentNode;)if(y==document)return!0;return!1},_urlToImage(y,b){const x=e.Util.createImageElement();x.onload=function(){b(x)},x.src=y},_rgbToHex(y,b,x){return((1<<24)+(y<<16)+(b<<8)+x).toString(16).slice(1)},_hexToRgb(y){y=y.replace(w,_);const b=parseInt(y,16);return{r:b>>16&255,g:b>>8&255,b:b&255}},getRandomColor(){let y=(Math.random()*16777215<<0).toString(16);for(;y.length<6;)y=E+y;return w+y},getRGB(y){let b;return y in p?(b=p[y],{r:b[0],g:b[1],b:b[2]}):y[0]===w?this._hexToRgb(y.substring(1)):y.substr(0,4)===S?(b=h.exec(y.replace(/ /g,"")),{r:parseInt(b[1],10),g:parseInt(b[2],10),b:parseInt(b[3],10)}):{r:0,g:0,b:0}},colorToRGBA(y){return y=y||"black",e.Util._namedColorToRBA(y)||e.Util._hex3ColorToRGBA(y)||e.Util._hex4ColorToRGBA(y)||e.Util._hex6ColorToRGBA(y)||e.Util._hex8ColorToRGBA(y)||e.Util._rgbColorToRGBA(y)||e.Util._rgbaColorToRGBA(y)||e.Util._hslColorToRGBA(y)},_namedColorToRBA(y){const b=p[y.toLowerCase()];return b?{r:b[0],g:b[1],b:b[2],a:1}:null},_rgbColorToRGBA(y){if(y.indexOf("rgb(")===0){y=y.match(/rgb\(([^)]+)\)/)[1];const b=y.split(/ *, */).map(Number);return{r:b[0],g:b[1],b:b[2],a:1}}},_rgbaColorToRGBA(y){if(y.indexOf("rgba(")===0){y=y.match(/rgba\(([^)]+)\)/)[1];const b=y.split(/ *, */).map((x,M)=>x.slice(-1)==="%"?M===3?parseInt(x)/100:parseInt(x)/100*255:Number(x));return{r:b[0],g:b[1],b:b[2],a:b[3]}}},_hex8ColorToRGBA(y){if(y[0]==="#"&&y.length===9)return{r:parseInt(y.slice(1,3),16),g:parseInt(y.slice(3,5),16),b:parseInt(y.slice(5,7),16),a:parseInt(y.slice(7,9),16)/255}},_hex6ColorToRGBA(y){if(y[0]==="#"&&y.length===7)return{r:parseInt(y.slice(1,3),16),g:parseInt(y.slice(3,5),16),b:parseInt(y.slice(5,7),16),a:1}},_hex4ColorToRGBA(y){if(y[0]==="#"&&y.length===5)return{r:parseInt(y[1]+y[1],16),g:parseInt(y[2]+y[2],16),b:parseInt(y[3]+y[3],16),a:parseInt(y[4]+y[4],16)/255}},_hex3ColorToRGBA(y){if(y[0]==="#"&&y.length===4)return{r:parseInt(y[1]+y[1],16),g:parseInt(y[2]+y[2],16),b:parseInt(y[3]+y[3],16),a:1}},_hslColorToRGBA(y){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(y)){const[b,...x]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(y),M=Number(x[0])/360,T=Number(x[1])/100,j=Number(x[2])/100;let I,m,A;if(T===0)return A=j*255,{r:Math.round(A),g:Math.round(A),b:Math.round(A),a:1};j<.5?I=j*(1+T):I=j+T-j*T;const L=2*j-I,k=[0,0,0];for(let R=0;R<3;R++)m=M+1/3*-(R-1),m<0&&m++,m>1&&m--,6*m<1?A=L+(I-L)*6*m:2*m<1?A=I:3*m<2?A=L+(I-L)*(2/3-m)*6:A=L,k[R]=A*255;return{r:Math.round(k[0]),g:Math.round(k[1]),b:Math.round(k[2]),a:1}}},haveIntersection(y,b){return!(b.x>y.x+y.width||b.x+b.width<y.x||b.y>y.y+y.height||b.y+b.height<y.y)},cloneObject(y){const b={};for(const x in y)this._isPlainObject(y[x])?b[x]=this.cloneObject(y[x]):this._isArray(y[x])?b[x]=this.cloneArray(y[x]):b[x]=y[x];return b},cloneArray(y){return y.slice(0)},degToRad(y){return y*c},radToDeg(y){return y*d},_degToRad(y){return e.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),e.Util.degToRad(y)},_radToDeg(y){return e.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),e.Util.radToDeg(y)},_getRotation(y){return i.Konva.angleDeg?e.Util.radToDeg(y):y},_capitalize(y){return y.charAt(0).toUpperCase()+y.slice(1)},throw(y){throw new Error(v+y)},error(y){console.error(v+y)},warn(y){i.Konva.showWarnings&&console.warn(O+y)},each(y,b){for(const x in y)b(x,y[x])},_inRange(y,b,x){return b<=y&&y<x},_getProjectionToSegment(y,b,x,M,T,j){let I,m,A;const L=(y-x)*(y-x)+(b-M)*(b-M);if(L==0)I=y,m=b,A=(T-x)*(T-x)+(j-M)*(j-M);else{const k=((T-y)*(x-y)+(j-b)*(M-b))/L;k<0?(I=y,m=b,A=(y-T)*(y-T)+(b-j)*(b-j)):k>1?(I=x,m=M,A=(x-T)*(x-T)+(M-j)*(M-j)):(I=y+k*(x-y),m=b+k*(M-b),A=(I-T)*(I-T)+(m-j)*(m-j))}return[I,m,A]},_getProjectionToLine(y,b,x){const M=e.Util.cloneObject(y);let T=Number.MAX_VALUE;return b.forEach(function(j,I){if(!x&&I===b.length-1)return;const m=b[(I+1)%b.length],A=e.Util._getProjectionToSegment(j.x,j.y,m.x,m.y,y.x,y.y),L=A[0],k=A[1],R=A[2];R<T&&(M.x=L,M.y=k,T=R)}),M},_prepareArrayForTween(y,b,x){const M=[],T=[];if(y.length>b.length){const I=b;b=y,y=I}for(let I=0;I<y.length;I+=2)M.push({x:y[I],y:y[I+1]});for(let I=0;I<b.length;I+=2)T.push({x:b[I],y:b[I+1]});const j=[];return T.forEach(function(I){const m=e.Util._getProjectionToLine(I,M,x);j.push(m.x),j.push(m.y)}),j},_prepareToStringify(y){let b;y.visitedByCircularReferenceRemoval=!0;for(const x in y)if(y.hasOwnProperty(x)&&y[x]&&typeof y[x]=="object"){if(b=Object.getOwnPropertyDescriptor(y,x),y[x].visitedByCircularReferenceRemoval||e.Util._isElement(y[x]))if(b.configurable)delete y[x];else return null;else if(e.Util._prepareToStringify(y[x])===null)if(b.configurable)delete y[x];else return null}return delete y.visitedByCircularReferenceRemoval,y},_assign(y,b){for(const x in b)y[x]=b[x];return y},_getFirstPointerId(y){return y.touches?y.changedTouches[0].identifier:y.pointerId||999},releaseCanvas(...y){i.Konva.releaseCanvasOnDestroy&&y.forEach(b=>{b.width=0,b.height=0})},drawRoundedRectPath(y,b,x,M){let T=0,j=0,I=0,m=0;typeof M=="number"?T=j=I=m=Math.min(M,b/2,x/2):(T=Math.min(M[0]||0,b/2,x/2),j=Math.min(M[1]||0,b/2,x/2),m=Math.min(M[2]||0,b/2,x/2),I=Math.min(M[3]||0,b/2,x/2)),y.moveTo(T,0),y.lineTo(b-j,0),y.arc(b-j,j,j,Math.PI*3/2,0,!1),y.lineTo(b,x-m),y.arc(b-m,x-m,m,0,Math.PI/2,!1),y.lineTo(I,x),y.arc(I,x-I,I,Math.PI/2,Math.PI,!1),y.lineTo(0,T),y.arc(T,T,T,Math.PI,Math.PI*3/2,!1)}}}(j0)),j0}var yf={},F0={},gi={},Gm;function Bt(){if(Gm)return gi;Gm=1,Object.defineProperty(gi,"__esModule",{value:!0}),gi.RGBComponent=n,gi.alphaComponent=a,gi.getNumberValidator=l,gi.getNumberOrArrayOfNumbersValidator=s,gi.getNumberOrAutoValidator=c,gi.getStringValidator=d,gi.getStringOrGradientValidator=w,gi.getFunctionValidator=_,gi.getNumberArrayValidator=E,gi.getBooleanValidator=O,gi.getComponentValidator=v;const e=Nt(),i=In();function t(S){return i.Util._isString(S)?'"'+S+'"':Object.prototype.toString.call(S)==="[object Number]"||i.Util._isBoolean(S)?S:Object.prototype.toString.call(S)}function n(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 l(){if(e.Konva.isUnminified)return function(S,p){return i.Util._isNumber(S)||i.Util.warn(t(S)+' is a not valid value for "'+p+'" attribute. The value should be a number.'),S}}function s(S){if(e.Konva.isUnminified)return function(p,h){let P=i.Util._isNumber(p),g=i.Util._isArray(p)&&p.length==S;return!P&&!g&&i.Util.warn(t(p)+' is a not valid value for "'+h+'" attribute. The value should be a number or Array<number>('+S+")"),p}}function c(){if(e.Konva.isUnminified)return function(S,p){var h=i.Util._isNumber(S),P=S==="auto";return h||P||i.Util.warn(t(S)+' is a not valid value for "'+p+'" attribute. The value should be a number or "auto".'),S}}function d(){if(e.Konva.isUnminified)return function(S,p){return i.Util._isString(S)||i.Util.warn(t(S)+' is a not valid value for "'+p+'" attribute. The value should be a string.'),S}}function w(){if(e.Konva.isUnminified)return function(S,p){const h=i.Util._isString(S),P=Object.prototype.toString.call(S)==="[object CanvasGradient]"||S&&S.addColorStop;return h||P||i.Util.warn(t(S)+' is a not valid value for "'+p+'" attribute. The value should be a string or a native gradient.'),S}}function _(){if(e.Konva.isUnminified)return function(S,p){return i.Util._isFunction(S)||i.Util.warn(t(S)+' is a not valid value for "'+p+'" attribute. The value should be a function.'),S}}function E(){if(e.Konva.isUnminified)return function(S,p){const h=Int8Array?Object.getPrototypeOf(Int8Array):null;return h&&S instanceof h||(i.Util._isArray(S)?S.forEach(function(P){i.Util._isNumber(P)||i.Util.warn('"'+p+'" attribute has non numeric element '+P+". Make sure that all elements are numbers.")}):i.Util.warn(t(S)+' is a not valid value for "'+p+'" attribute. The value should be a array of numbers.')),S}}function O(){if(e.Konva.isUnminified)return function(S,p){var h=S===!0||S===!1;return h||i.Util.warn(t(S)+' is a not valid value for "'+p+'" attribute. The value should be a boolean.'),S}}function v(S){if(e.Konva.isUnminified)return function(p,h){return p==null||i.Util.isObject(p)||i.Util.warn(t(p)+' is a not valid value for "'+h+'" attribute. The value should be an object with properties '+S),p}}return gi}var Vm;function Ft(){return Vm||(Vm=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const i=In(),t=Bt(),n="get",a="set";e.Factory={addGetterSetter(l,s,c,d,w){e.Factory.addGetter(l,s,c),e.Factory.addSetter(l,s,d,w),e.Factory.addOverloadedGetterSetter(l,s)},addGetter(l,s,c){var d=n+i.Util._capitalize(s);l.prototype[d]=l.prototype[d]||function(){const w=this.attrs[s];return w===void 0?c:w}},addSetter(l,s,c,d){var w=a+i.Util._capitalize(s);l.prototype[w]||e.Factory.overWriteSetter(l,s,c,d)},overWriteSetter(l,s,c,d){var w=a+i.Util._capitalize(s);l.prototype[w]=function(_){return c&&_!==void 0&&_!==null&&(_=c.call(this,_,s)),this._setAttr(s,_),d&&d.call(this),this}},addComponentsGetterSetter(l,s,c,d,w){const _=c.length,E=i.Util._capitalize,O=n+E(s),v=a+E(s);l.prototype[O]=function(){const p={};for(let h=0;h<_;h++){const P=c[h];p[P]=this.getAttr(s+E(P))}return p};const S=(0,t.getComponentValidator)(c);l.prototype[v]=function(p){const h=this.attrs[s];d&&(p=d.call(this,p,s)),S&&S.call(this,p,s);for(const P in p)p.hasOwnProperty(P)&&this._setAttr(s+E(P),p[P]);return p||c.forEach(P=>{this._setAttr(s+E(P),void 0)}),this._fireChangeEvent(s,h,p),w&&w.call(this),this},e.Factory.addOverloadedGetterSetter(l,s)},addOverloadedGetterSetter(l,s){var c=i.Util._capitalize(s),d=a+c,w=n+c;l.prototype[s]=function(){return arguments.length?(this[d](arguments[0]),this):this[w]()}},addDeprecatedGetterSetter(l,s,c,d){i.Util.error("Adding deprecated "+s);const w=n+i.Util._capitalize(s),_=s+" property is deprecated and will be removed soon. Look at Konva change log for more information.";l.prototype[w]=function(){i.Util.error(_);const E=this.attrs[s];return E===void 0?c:E},e.Factory.addSetter(l,s,d,function(){i.Util.error(_)}),e.Factory.addOverloadedGetterSetter(l,s)},backCompat(l,s){i.Util.each(s,function(c,d){const w=l.prototype[d],_=n+i.Util._capitalize(c),E=a+i.Util._capitalize(c);function O(){w.apply(this,arguments),i.Util.error('"'+c+'" method is deprecated and will be removed soon. Use ""'+d+'" instead.')}l.prototype[c]=O,l.prototype[_]=O,l.prototype[E]=O})},afterSetFilter(){this._filterUpToDate=!1}}}(F0)),F0}var Ua={},qa={},$m;function B5(){if($m)return qa;$m=1,Object.defineProperty(qa,"__esModule",{value:!0}),qa.HitContext=qa.SceneContext=qa.Context=void 0;const e=In(),i=Nt();function t(P){const g=[],y=P.length,b=e.Util;for(let x=0;x<y;x++){let M=P[x];b._isNumber(M)?M=Math.round(M*1e3)/1e3:b._isString(M)||(M=M+""),g.push(M)}return g}const n=",",a="(",l=")",s="([",c="])",d=";",w="()",_="=",E=["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"],O=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"],v=100;let S=class{constructor(g){this.canvas=g,i.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,y){let b=this.traceArr,x=b.length,M="",T,j,I,m;for(T=0;T<x;T++)j=b[T],I=j.method,I?(m=j.args,M+=I,g?M+=w:e.Util._isArray(m[0])?M+=s+m.join(n)+c:(y&&(m=m.map(A=>typeof A=="number"?Math.floor(A):A)),M+=a+m.join(n)+l)):(M+=j.property,g||(M+=_+j.val)),M+=d;return M}clearTrace(){this.traceArr=[]}_trace(g){let y=this.traceArr,b;y.push(g),b=y.length,b>=v&&y.shift()}reset(){const g=this.getCanvas().getPixelRatio();this.setTransform(1*g,0,0,1*g,0,0)}getCanvas(){return this.canvas}clear(g){const y=this.getCanvas();g?this.clearRect(g.x||0,g.y||0,g.width||0,g.height||0):this.clearRect(0,0,y.getWidth()/y.pixelRatio,y.getHeight()/y.pixelRatio)}_applyLineCap(g){const y=g.attrs.lineCap;y&&this.setAttr("lineCap",y)}_applyOpacity(g){const y=g.getAbsoluteOpacity();y!==1&&this.setAttr("globalAlpha",y)}_applyLineJoin(g){const y=g.attrs.lineJoin;y&&this.setAttr("lineJoin",y)}setAttr(g,y){this._context[g]=y}arc(g,y,b,x,M,T){this._context.arc(g,y,b,x,M,T)}arcTo(g,y,b,x,M){this._context.arcTo(g,y,b,x,M)}beginPath(){this._context.beginPath()}bezierCurveTo(g,y,b,x,M,T){this._context.bezierCurveTo(g,y,b,x,M,T)}clearRect(g,y,b,x){this._context.clearRect(g,y,b,x)}clip(...g){this._context.clip.apply(this._context,g)}closePath(){this._context.closePath()}createImageData(g,y){const b=arguments;if(b.length===2)return this._context.createImageData(g,y);if(b.length===1)return this._context.createImageData(g)}createLinearGradient(g,y,b,x){return this._context.createLinearGradient(g,y,b,x)}createPattern(g,y){return this._context.createPattern(g,y)}createRadialGradient(g,y,b,x,M,T){return this._context.createRadialGradient(g,y,b,x,M,T)}drawImage(g,y,b,x,M,T,j,I,m){const A=arguments,L=this._context;A.length===3?L.drawImage(g,y,b):A.length===5?L.drawImage(g,y,b,x,M):A.length===9&&L.drawImage(g,y,b,x,M,T,j,I,m)}ellipse(g,y,b,x,M,T,j,I){this._context.ellipse(g,y,b,x,M,T,j,I)}isPointInPath(g,y,b,x){return b?this._context.isPointInPath(b,g,y,x):this._context.isPointInPath(g,y,x)}fill(...g){this._context.fill.apply(this._context,g)}fillRect(g,y,b,x){this._context.fillRect(g,y,b,x)}strokeRect(g,y,b,x){this._context.strokeRect(g,y,b,x)}fillText(g,y,b,x){x?this._context.fillText(g,y,b,x):this._context.fillText(g,y,b)}measureText(g){return this._context.measureText(g)}getImageData(g,y,b,x){return this._context.getImageData(g,y,b,x)}lineTo(g,y){this._context.lineTo(g,y)}moveTo(g,y){this._context.moveTo(g,y)}rect(g,y,b,x){this._context.rect(g,y,b,x)}roundRect(g,y,b,x,M){this._context.roundRect(g,y,b,x,M)}putImageData(g,y,b){this._context.putImageData(g,y,b)}quadraticCurveTo(g,y,b,x){this._context.quadraticCurveTo(g,y,b,x)}restore(){this._context.restore()}rotate(g){this._context.rotate(g)}save(){this._context.save()}scale(g,y){this._context.scale(g,y)}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,y,b,x,M,T){this._context.setTransform(g,y,b,x,M,T)}stroke(g){g?this._context.stroke(g):this._context.stroke()}strokeText(g,y,b,x){this._context.strokeText(g,y,b,x)}transform(g,y,b,x,M,T){this._context.transform(g,y,b,x,M,T)}translate(g,y){this._context.translate(g,y)}_enableTrace(){let g=this,y=E.length,b=this.setAttr,x,M;const T=function(j){let I=g[j],m;g[j]=function(){return M=t(Array.prototype.slice.call(arguments,0)),m=I.apply(g,arguments),g._trace({method:j,args:M}),m}};for(x=0;x<y;x++)T(E[x]);g.setAttr=function(){b.apply(g,arguments);const j=arguments[0];let I=arguments[1];(j==="shadowOffsetX"||j==="shadowOffsetY"||j==="shadowBlur")&&(I=I/this.canvas.getPixelRatio()),g._trace({property:j,val:I})}}_applyGlobalCompositeOperation(g){const y=g.attrs.globalCompositeOperation;!y||y==="source-over"||this.setAttr("globalCompositeOperation",y)}};qa.Context=S,O.forEach(function(P){Object.defineProperty(S.prototype,P,{get(){return this._context[P]},set(g){this._context[P]=g}})});class p extends S{constructor(g,{willReadFrequently:y=!1}={}){super(g),this._context=g._canvas.getContext("2d",{willReadFrequently:y})}_fillColor(g){const y=g.fill();this.setAttr("fillStyle",y),g._fillFunc(this)}_fillPattern(g){this.setAttr("fillStyle",g._getFillPattern()),g._fillFunc(this)}_fillLinearGradient(g){const y=g._getLinearGradient();y&&(this.setAttr("fillStyle",y),g._fillFunc(this))}_fillRadialGradient(g){const y=g._getRadialGradient();y&&(this.setAttr("fillStyle",y),g._fillFunc(this))}_fill(g){const y=g.fill(),b=g.getFillPriority();if(y&&b==="color"){this._fillColor(g);return}const x=g.getFillPatternImage();if(x&&b==="pattern"){this._fillPattern(g);return}const M=g.getFillLinearGradientColorStops();if(M&&b==="linear-gradient"){this._fillLinearGradient(g);return}const T=g.getFillRadialGradientColorStops();if(T&&b==="radial-gradient"){this._fillRadialGradient(g);return}y?this._fillColor(g):x?this._fillPattern(g):M?this._fillLinearGradient(g):T&&this._fillRadialGradient(g)}_strokeLinearGradient(g){const y=g.getStrokeLinearGradientStartPoint(),b=g.getStrokeLinearGradientEndPoint(),x=g.getStrokeLinearGradientColorStops(),M=this.createLinearGradient(y.x,y.y,b.x,b.y);if(x){for(let T=0;T<x.length;T+=2)M.addColorStop(x[T],x[T+1]);this.setAttr("strokeStyle",M)}}_stroke(g){const y=g.dash(),b=g.getStrokeScaleEnabled();if(g.hasStroke()){if(!b){this.save();const M=this.getCanvas().getPixelRatio();this.setTransform(M,0,0,M,0,0)}this._applyLineCap(g),y&&g.dashEnabled()&&(this.setLineDash(y),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),b||this.restore()}}_applyShadow(g){var y,b,x;const M=(y=g.getShadowRGBA())!==null&&y!==void 0?y:"black",T=(b=g.getShadowBlur())!==null&&b!==void 0?b:5,j=(x=g.getShadowOffset())!==null&&x!==void 0?x:{x:0,y:0},I=g.getAbsoluteScale(),m=this.canvas.getPixelRatio(),A=I.x*m,L=I.y*m;this.setAttr("shadowColor",M),this.setAttr("shadowBlur",T*Math.min(Math.abs(A),Math.abs(L))),this.setAttr("shadowOffsetX",j.x*A),this.setAttr("shadowOffsetY",j.y*L)}}qa.SceneContext=p;class h 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 y=g.getStrokeScaleEnabled();if(!y){this.save();const M=this.getCanvas().getPixelRatio();this.setTransform(M,0,0,M,0,0)}this._applyLineCap(g);const b=g.hitStrokeWidth(),x=b==="auto"?g.strokeWidth():b;this.setAttr("lineWidth",x),this.setAttr("strokeStyle",g.colorKey),g._strokeFuncHit(this),y||this.restore()}}}return qa.HitContext=h,qa}var Wm;function Lp(){if(Wm)return Ua;Wm=1,Object.defineProperty(Ua,"__esModule",{value:!0}),Ua.HitCanvas=Ua.SceneCanvas=Ua.Canvas=void 0;const e=In(),i=B5(),t=Nt(),n=Ft(),a=Bt();let l;function s(){if(l)return l;const _=e.Util.createCanvasElement(),E=_.getContext("2d");return l=function(){const O=t.Konva._global.devicePixelRatio||1,v=E.webkitBackingStorePixelRatio||E.mozBackingStorePixelRatio||E.msBackingStorePixelRatio||E.oBackingStorePixelRatio||E.backingStorePixelRatio||1;return O/v}(),e.Util.releaseCanvas(_),l}let c=class{constructor(E){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const v=(E||{}).pixelRatio||t.Konva.pixelRatio||s();this.pixelRatio=v,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(E){const O=this.pixelRatio;this.pixelRatio=E,this.setSize(this.getWidth()/O,this.getHeight()/O)}setWidth(E){this.width=this._canvas.width=E*this.pixelRatio,this._canvas.style.width=E+"px";const O=this.pixelRatio;this.getContext()._context.scale(O,O)}setHeight(E){this.height=this._canvas.height=E*this.pixelRatio,this._canvas.style.height=E+"px";const O=this.pixelRatio;this.getContext()._context.scale(O,O)}getWidth(){return this.width}getHeight(){return this.height}setSize(E,O){this.setWidth(E||0),this.setHeight(O||0)}toDataURL(E,O){try{return this._canvas.toDataURL(E,O)}catch{try{return this._canvas.toDataURL()}catch(S){return e.Util.error("Unable to get data URL. "+S.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}};Ua.Canvas=c,n.Factory.addGetterSetter(c,"pixelRatio",void 0,(0,a.getNumberValidator)());class d extends c{constructor(E={width:0,height:0,willReadFrequently:!1}){super(E),this.context=new i.SceneContext(this,{willReadFrequently:E.willReadFrequently}),this.setSize(E.width,E.height)}}Ua.SceneCanvas=d;class w extends c{constructor(E={width:0,height:0}){super(E),this.hitCanvas=!0,this.context=new i.HitContext(this),this.setSize(E.width,E.height)}}return Ua.HitCanvas=w,Ua}var z0={},Ym;function pv(){return Ym||(Ym=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const i=Nt(),t=In();e.DD={get isDragging(){let n=!1;return e.DD._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(n=!0)}),n},justDragged:!1,get node(){let n;return e.DD._dragElements.forEach(a=>{n=a.node}),n},_dragElements:new Map,_drag(n){const a=[];e.DD._dragElements.forEach((l,s)=>{const{node:c}=l,d=c.getStage();d.setPointersPositions(n),l.pointerId===void 0&&(l.pointerId=t.Util._getFirstPointerId(n));const w=d._changedPointerPositions.find(_=>_.id===l.pointerId);if(w){if(l.dragStatus!=="dragging"){const _=c.dragDistance();if(Math.max(Math.abs(w.x-l.startPointerPos.x),Math.abs(w.y-l.startPointerPos.y))<_||(c.startDrag({evt:n}),!c.isDragging()))return}c._setDragPosition(n,l),a.push(c)}}),a.forEach(l=>{l.fire("dragmove",{type:"dragmove",target:l,evt:n},!0)})},_endDragBefore(n){const a=[];e.DD._dragElements.forEach(l=>{const{node:s}=l,c=s.getStage();if(n&&c.setPointersPositions(n),!c._changedPointerPositions.find(_=>_.id===l.pointerId))return;(l.dragStatus==="dragging"||l.dragStatus==="stopped")&&(e.DD.justDragged=!0,i.Konva._mouseListenClick=!1,i.Konva._touchListenClick=!1,i.Konva._pointerListenClick=!1,l.dragStatus="stopped");const w=l.node.getLayer()||l.node instanceof i.Konva.Stage&&l.node;w&&a.indexOf(w)===-1&&a.push(w)}),a.forEach(l=>{l.draw()})},_endDragAfter(n){e.DD._dragElements.forEach((a,l)=>{a.dragStatus==="stopped"&&a.node.fire("dragend",{type:"dragend",target:a.node,evt:n},!0),a.dragStatus!=="dragging"&&e.DD._dragElements.delete(l)})}},i.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))}(z0)),z0}var Km;function Hn(){if(Km)return yf;Km=1,Object.defineProperty(yf,"__esModule",{value:!0}),yf.Node=void 0;const e=In(),i=Ft(),t=Lp(),n=Nt(),a=pv(),l=Bt(),s="absoluteOpacity",c="allEventListeners",d="absoluteTransform",w="absoluteScale",_="canvas",E="Change",O="children",v="konva",S="listening",p="mouseenter",h="mouseleave",P="set",g="Shape",y=" ",b="stage",x="transform",M="Stage",T="visible",j=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(y);let I=1;class m{constructor(k){this._id=I++,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(k),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(k){(k===x||k===d)&&this._cache.get(k)?this._cache.get(k).dirty=!0:k?this._cache.delete(k):this._cache.clear()}_getCache(k,R){let B=this._cache.get(k);return(B===void 0||(k===x||k===d)&&B.dirty===!0)&&(B=R.call(this),this._cache.set(k,B)),B}_calculate(k,R,B){if(!this._attachedDepsListeners.get(k)){const X=R.map(Y=>Y+"Change.konva").join(y);this.on(X,()=>{this._clearCache(k)}),this._attachedDepsListeners.set(k,!0)}return this._getCache(k,B)}_getCanvasCache(){return this._cache.get(_)}_clearSelfAndDescendantCache(k){this._clearCache(k),k===d&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(_)){const{scene:k,filter:R,hit:B}=this._cache.get(_);e.Util.releaseCanvas(k,R,B),this._cache.delete(_)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(k){const R=k||{};let B={};(R.x===void 0||R.y===void 0||R.width===void 0||R.height===void 0)&&(B=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let X=Math.ceil(R.width||B.width),Y=Math.ceil(R.height||B.height),Q=R.pixelRatio,q=R.x===void 0?Math.floor(B.x):R.x,z=R.y===void 0?Math.floor(B.y):R.y,N=R.offset||0,U=R.drawBorder||!1,$=R.hitCanvasPixelRatio||1;if(!X||!Y){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(B.x)-q)>.5?1:0,G=Math.abs(Math.round(B.y)-z)>.5?1:0;X+=N*2+ee,Y+=N*2+G,q-=N,z-=N;const Z=new t.SceneCanvas({pixelRatio:Q,width:X,height:Y}),W=new t.SceneCanvas({pixelRatio:Q,width:0,height:0,willReadFrequently:!0}),te=new t.HitCanvas({pixelRatio:$,width:X,height:Y}),re=Z.getContext(),ie=te.getContext();return te.isCache=!0,Z.isCache=!0,this._cache.delete(_),this._filterUpToDate=!1,R.imageSmoothingEnabled===!1&&(Z.getContext()._context.imageSmoothingEnabled=!1,W.getContext()._context.imageSmoothingEnabled=!1),re.save(),ie.save(),re.translate(-q,-z),ie.translate(-q,-z),this._isUnderCache=!0,this._clearSelfAndDescendantCache(s),this._clearSelfAndDescendantCache(w),this.drawScene(Z,this),this.drawHit(te,this),this._isUnderCache=!1,re.restore(),ie.restore(),U&&(re.save(),re.beginPath(),re.rect(0,0,X,Y),re.closePath(),re.setAttr("strokeStyle","red"),re.setAttr("lineWidth",5),re.stroke(),re.restore()),this._cache.set(_,{scene:Z,filter:W,hit:te,x:q,y:z}),this._requestDraw(),this}isCached(){return this._cache.has(_)}getClientRect(k){throw new Error('abstract "getClientRect" method call')}_transformedRect(k,R){const B=[{x:k.x,y:k.y},{x:k.x+k.width,y:k.y},{x:k.x+k.width,y:k.y+k.height},{x:k.x,y:k.y+k.height}];let X=1/0,Y=1/0,Q=-1/0,q=-1/0;const z=this.getAbsoluteTransform(R);return B.forEach(function(N){const U=z.point(N);X===void 0&&(X=Q=U.x,Y=q=U.y),X=Math.min(X,U.x),Y=Math.min(Y,U.y),Q=Math.max(Q,U.x),q=Math.max(q,U.y)}),{x:X,y:Y,width:Q-X,height:q-Y}}_drawCachedSceneCanvas(k){k.save(),k._applyOpacity(this),k._applyGlobalCompositeOperation(this);const R=this._getCanvasCache();k.translate(R.x,R.y);const B=this._getCachedSceneCanvas(),X=B.pixelRatio;k.drawImage(B._canvas,0,0,B.width/X,B.height/X),k.restore()}_drawCachedHitCanvas(k){const R=this._getCanvasCache(),B=R.hit;k.save(),k.translate(R.x,R.y),k.drawImage(B._canvas,0,0,B.width/B.pixelRatio,B.height/B.pixelRatio),k.restore()}_getCachedSceneCanvas(){let k=this.filters(),R=this._getCanvasCache(),B=R.scene,X=R.filter,Y=X.getContext(),Q,q,z,N;if(k){if(!this._filterUpToDate){const U=B.pixelRatio;X.setSize(B.width/B.pixelRatio,B.height/B.pixelRatio);try{for(Q=k.length,Y.clear(),Y.drawImage(B._canvas,0,0,B.getWidth()/U,B.getHeight()/U),q=Y.getImageData(0,0,X.getWidth(),X.getHeight()),z=0;z<Q;z++){if(N=k[z],typeof N!="function"){e.Util.error("Filter should be type of function, but got "+typeof N+" instead. Please check correct filters");continue}N.call(this,q),Y.putImageData(q,0,0)}}catch($){e.Util.error("Unable to apply filter. "+$.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return X}return B}on(k,R){if(this._cache&&this._cache.delete(c),arguments.length===3)return this._delegate.apply(this,arguments);let B=k.split(y),X=B.length,Y,Q,q,z,N;for(Y=0;Y<X;Y++)Q=B[Y],q=Q.split("."),z=q[0],N=q[1]||"",this.eventListeners[z]||(this.eventListeners[z]=[]),this.eventListeners[z].push({name:N,handler:R});return this}off(k,R){let B=(k||"").split(y),X=B.length,Y,Q,q,z,N,U;if(this._cache&&this._cache.delete(c),!k)for(Q in this.eventListeners)this._off(Q);for(Y=0;Y<X;Y++)if(q=B[Y],z=q.split("."),N=z[0],U=z[1],N)this.eventListeners[N]&&this._off(N,U,R);else for(Q in this.eventListeners)this._off(Q,U,R);return this}dispatchEvent(k){const R={target:this,type:k.type,evt:k};return this.fire(k.type,R),this}addEventListener(k,R){return this.on(k,function(B){R.call(this,B.evt)}),this}removeEventListener(k){return this.off(k),this}_delegate(k,R,B){const X=this;this.on(k,function(Y){const Q=Y.target.findAncestors(R,!0,X);for(let q=0;q<Q.length;q++)Y=e.Util.cloneObject(Y),Y.currentTarget=Q[q],B.call(Q[q],Y)})}remove(){return this.isDragging()&&this.stopDrag(),a.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(d),this._clearSelfAndDescendantCache(s),this._clearSelfAndDescendantCache(w),this._clearSelfAndDescendantCache(b),this._clearSelfAndDescendantCache(T),this._clearSelfAndDescendantCache(S)}_remove(){this._clearCaches();const k=this.getParent();k&&k.children&&(k.children.splice(this.index,1),k._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(k){const R="get"+e.Util._capitalize(k);return e.Util._isFunction(this[R])?this[R]():this.attrs[k]}getAncestors(){let k=this.getParent(),R=[];for(;k;)R.push(k),k=k.getParent();return R}getAttrs(){return this.attrs||{}}setAttrs(k){return this._batchTransformChanges(()=>{let R,B;if(!k)return this;for(R in k)R!==O&&(B=P+e.Util._capitalize(R),e.Util._isFunction(this[B])?this[B](k[R]):this._setAttr(R,k[R]))}),this}isListening(){return this._getCache(S,this._isListening)}_isListening(k){if(!this.listening())return!1;const B=this.getParent();return B&&B!==k&&this!==k?B._isListening(k):!0}isVisible(){return this._getCache(T,this._isVisible)}_isVisible(k){if(!this.visible())return!1;const B=this.getParent();return B&&B!==k&&this!==k?B._isVisible(k):!0}shouldDrawHit(k,R=!1){if(k)return this._isVisible(k)&&this._isListening(k);const B=this.getLayer();let X=!1;a.DD._dragElements.forEach(Q=>{Q.dragStatus==="dragging"&&(Q.node.nodeType==="Stage"||Q.node.getLayer()===B)&&(X=!0)});const Y=!R&&!n.Konva.hitOnDragEnabled&&(X||n.Konva.isTransforming());return this.isListening()&&this.isVisible()&&!Y}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let k=this.getDepth(),R=this,B=0,X,Y,Q,q;function z(U){for(X=[],Y=U.length,Q=0;Q<Y;Q++)q=U[Q],B++,q.nodeType!==g&&(X=X.concat(q.getChildren().slice())),q._id===R._id&&(Q=Y);X.length>0&&X[0].getDepth()<=k&&z(X)}const N=this.getStage();return R.nodeType!==M&&N&&z(N.getChildren()),B}getDepth(){let k=0,R=this.parent;for(;R;)k++,R=R.parent;return k}_batchTransformChanges(k){this._batchingTransformChange=!0,k(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(x),this._clearSelfAndDescendantCache(d)),this._needClearTransformCache=!1}setPosition(k){return this._batchTransformChanges(()=>{this.x(k.x),this.y(k.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const k=this.getStage();if(!k)return null;const R=k.getPointerPosition();if(!R)return null;const B=this.getAbsoluteTransform().copy();return B.invert(),B.point(R)}getAbsolutePosition(k){let R=!1,B=this.parent;for(;B;){if(B.isCached()){R=!0;break}B=B.parent}R&&!k&&(k=!0);const X=this.getAbsoluteTransform(k).getMatrix(),Y=new e.Transform,Q=this.offset();return Y.m=X.slice(),Y.translate(Q.x,Q.y),Y.getTranslation()}setAbsolutePosition(k){const{x:R,y:B,...X}=this._clearTransform();this.attrs.x=R,this.attrs.y=B,this._clearCache(x);const Y=this._getAbsoluteTransform().copy();return Y.invert(),Y.translate(k.x,k.y),k={x:this.attrs.x+Y.getTranslation().x,y:this.attrs.y+Y.getTranslation().y},this._setTransform(X),this.setPosition({x:k.x,y:k.y}),this._clearCache(x),this._clearSelfAndDescendantCache(d),this}_setTransform(k){let R;for(R in k)this.attrs[R]=k[R]}_clearTransform(){const k={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,k}move(k){let R=k.x,B=k.y,X=this.x(),Y=this.y();return R!==void 0&&(X+=R),B!==void 0&&(Y+=B),this.setPosition({x:X,y:Y}),this}_eachAncestorReverse(k,R){let B=[],X=this.getParent(),Y,Q;if(!(R&&R._id===this._id)){for(B.unshift(this);X&&(!R||X._id!==R._id);)B.unshift(X),X=X.parent;for(Y=B.length,Q=0;Q<Y;Q++)k(B[Q])}}rotate(k){return this.rotation(this.rotation()+k),this}moveToTop(){if(!this.parent)return e.Util.warn("Node has no parent. moveToTop function is ignored."),!1;const k=this.index,R=this.parent.getChildren().length;return k<R-1?(this.parent.children.splice(k,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 k=this.index,R=this.parent.getChildren().length;return k<R-1?(this.parent.children.splice(k,1),this.parent.children.splice(k+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 k=this.index;return k>0?(this.parent.children.splice(k,1),this.parent.children.splice(k-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 k=this.index;return k>0?(this.parent.children.splice(k,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(k){if(!this.parent)return e.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(k<0||k>=this.parent.children.length)&&e.Util.warn("Unexpected value "+k+" 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(k,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(s,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let k=this.opacity();const R=this.getParent();return R&&!R._isUnderCache&&(k*=R.getAbsoluteOpacity()),k}moveTo(k){return this.getParent()!==k&&(this._remove(),k.add(this)),this}toObject(){let k=this.getAttrs(),R,B,X,Y,Q;const q={attrs:{},className:this.getClassName()};for(R in k)B=k[R],Q=e.Util.isObject(B)&&!e.Util._isPlainObject(B)&&!e.Util._isArray(B),!Q&&(X=typeof this[R]=="function"&&this[R],delete k[R],Y=X?X.call(this):null,k[R]=B,Y!==B&&(q.attrs[R]=B));return e.Util._prepareToStringify(q)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(k,R,B){const X=[];R&&this._isMatch(k)&&X.push(this);let Y=this.parent;for(;Y;){if(Y===B)return X;Y._isMatch(k)&&X.push(Y),Y=Y.parent}return X}isAncestorOf(k){return!1}findAncestor(k,R,B){return this.findAncestors(k,R,B)[0]}_isMatch(k){if(!k)return!1;if(typeof k=="function")return k(this);let R=k.replace(/ /g,"").split(","),B=R.length,X,Y;for(X=0;X<B;X++)if(Y=R[X],e.Util.isValidSelector(Y)||(e.Util.warn('Selector "'+Y+'" 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?")),Y.charAt(0)==="#"){if(this.id()===Y.slice(1))return!0}else if(Y.charAt(0)==="."){if(this.hasName(Y.slice(1)))return!0}else if(this.className===Y||this.nodeType===Y)return!0;return!1}getLayer(){const k=this.getParent();return k?k.getLayer():null}getStage(){return this._getCache(b,this._getStage)}_getStage(){const k=this.getParent();return k?k.getStage():null}fire(k,R={},B){return R.target=R.target||this,B?this._fireAndBubble(k,R):this._fire(k,R),this}getAbsoluteTransform(k){return k?this._getAbsoluteTransform(k):this._getCache(d,this._getAbsoluteTransform)}_getAbsoluteTransform(k){let R;if(k)return R=new e.Transform,this._eachAncestorReverse(function(B){const X=B.transformsEnabled();X==="all"?R.multiply(B.getTransform()):X==="position"&&R.translate(B.x()-B.offsetX(),B.y()-B.offsetY())},k),R;{R=this._cache.get(d)||new e.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(R):R.reset();const B=this.transformsEnabled();if(B==="all")R.multiply(this.getTransform());else if(B==="position"){const X=this.attrs.x||0,Y=this.attrs.y||0,Q=this.attrs.offsetX||0,q=this.attrs.offsetY||0;R.translate(X-Q,Y-q)}return R.dirty=!1,R}}getAbsoluteScale(k){let R=this;for(;R;)R._isUnderCache&&(k=R),R=R.getParent();const X=this.getAbsoluteTransform(k).decompose();return{x:X.scaleX,y:X.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(x,this._getTransform)}_getTransform(){var k,R;const B=this._cache.get(x)||new e.Transform;B.reset();const X=this.x(),Y=this.y(),Q=n.Konva.getAngle(this.rotation()),q=(k=this.attrs.scaleX)!==null&&k!==void 0?k:1,z=(R=this.attrs.scaleY)!==null&&R!==void 0?R:1,N=this.attrs.skewX||0,U=this.attrs.skewY||0,$=this.attrs.offsetX||0,ee=this.attrs.offsetY||0;return(X!==0||Y!==0)&&B.translate(X,Y),Q!==0&&B.rotate(Q),(N!==0||U!==0)&&B.skew(N,U),(q!==1||z!==1)&&B.scale(q,z),($!==0||ee!==0)&&B.translate(-1*$,-1*ee),B.dirty=!1,B}clone(k){let R=e.Util.cloneObject(this.attrs),B,X,Y,Q,q;for(B in k)R[B]=k[B];const z=new this.constructor(R);for(B in this.eventListeners)for(X=this.eventListeners[B],Y=X.length,Q=0;Q<Y;Q++)q=X[Q],q.name.indexOf(v)<0&&(z.eventListeners[B]||(z.eventListeners[B]=[]),z.eventListeners[B].push(q));return z}_toKonvaCanvas(k){k=k||{};const R=this.getClientRect(),B=this.getStage(),X=k.x!==void 0?k.x:Math.floor(R.x),Y=k.y!==void 0?k.y:Math.floor(R.y),Q=k.pixelRatio||1,q=new t.SceneCanvas({width:k.width||Math.ceil(R.width)||(B?B.width():0),height:k.height||Math.ceil(R.height)||(B?B.height():0),pixelRatio:Q}),z=q.getContext(),N=new t.SceneCanvas({width:q.width/q.pixelRatio+Math.abs(X),height:q.height/q.pixelRatio+Math.abs(Y),pixelRatio:q.pixelRatio});return k.imageSmoothingEnabled===!1&&(z._context.imageSmoothingEnabled=!1),z.save(),(X||Y)&&z.translate(-1*X,-1*Y),this.drawScene(q,void 0,N),z.restore(),q}toCanvas(k){return this._toKonvaCanvas(k)._canvas}toDataURL(k){k=k||{};const R=k.mimeType||null,B=k.quality||null,X=this._toKonvaCanvas(k).toDataURL(R,B);return k.callback&&k.callback(X),X}toImage(k){return new Promise((R,B)=>{try{const X=k==null?void 0:k.callback;X&&delete k.callback,e.Util._urlToImage(this.toDataURL(k),function(Y){R(Y),X==null||X(Y)})}catch(X){B(X)}})}toBlob(k){return new Promise((R,B)=>{try{const X=k==null?void 0:k.callback;X&&delete k.callback,this.toCanvas(k).toBlob(Y=>{R(Y),X==null||X(Y)},k==null?void 0:k.mimeType,k==null?void 0:k.quality)}catch(X){B(X)}})}setSize(k){return this.width(k.width),this.height(k.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():n.Konva.dragDistance}_off(k,R,B){let X=this.eventListeners[k],Y,Q,q;for(Y=0;Y<X.length;Y++)if(Q=X[Y].name,q=X[Y].handler,(Q!=="konva"||R==="konva")&&(!R||Q===R)&&(!B||B===q)){if(X.splice(Y,1),X.length===0){delete this.eventListeners[k];break}Y--}}_fireChangeEvent(k,R,B){this._fire(k+E,{oldVal:R,newVal:B})}addName(k){if(!this.hasName(k)){const R=this.name(),B=R?R+" "+k:k;this.name(B)}return this}hasName(k){if(!k)return!1;const R=this.name();return R?(R||"").split(/\s/g).indexOf(k)!==-1:!1}removeName(k){const R=(this.name()||"").split(/\s/g),B=R.indexOf(k);return B!==-1&&(R.splice(B,1),this.name(R.join(" "))),this}setAttr(k,R){const B=this[P+e.Util._capitalize(k)];return e.Util._isFunction(B)?B.call(this,R):this._setAttr(k,R),this}_requestDraw(){if(n.Konva.autoDrawEnabled){const k=this.getLayer()||this.getStage();k==null||k.batchDraw()}}_setAttr(k,R){const B=this.attrs[k];B===R&&!e.Util.isObject(R)||(R==null?delete this.attrs[k]:this.attrs[k]=R,this._shouldFireChangeEvents&&this._fireChangeEvent(k,B,R),this._requestDraw())}_setComponentAttr(k,R,B){let X;B!==void 0&&(X=this.attrs[k],X||(this.attrs[k]=this.getAttr(k)),this.attrs[k][R]=B,this._fireChangeEvent(k,X,B))}_fireAndBubble(k,R,B){if(R&&this.nodeType===g&&(R.target=this),!((k===p||k===h)&&(B&&(this===B||this.isAncestorOf&&this.isAncestorOf(B))||this.nodeType==="Stage"&&!B))){this._fire(k,R);const Y=(k===p||k===h)&&B&&B.isAncestorOf&&B.isAncestorOf(this)&&!B.isAncestorOf(this.parent);(R&&!R.cancelBubble||!R)&&this.parent&&this.parent.isListening()&&!Y&&(B&&B.parent?this._fireAndBubble.call(this.parent,k,R,B):this._fireAndBubble.call(this.parent,k,R))}}_getProtoListeners(k){var R,B,X;const Y=(R=this._cache.get(c))!==null&&R!==void 0?R:{};let Q=Y==null?void 0:Y[k];if(Q===void 0){Q=[];let q=Object.getPrototypeOf(this);for(;q;){const z=(X=(B=q.eventListeners)===null||B===void 0?void 0:B[k])!==null&&X!==void 0?X:[];Q.push(...z),q=Object.getPrototypeOf(q)}Y[k]=Q,this._cache.set(c,Y)}return Q}_fire(k,R){R=R||{},R.currentTarget=this,R.type=k;const B=this._getProtoListeners(k);if(B)for(var X=0;X<B.length;X++)B[X].handler.call(this,R);const Y=this.eventListeners[k];if(Y)for(var X=0;X<Y.length;X++)Y[X].handler.call(this,R)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(k){const R=k?k.pointerId:void 0,B=this.getStage(),X=this.getAbsolutePosition();if(!B)return;const Y=B._getPointerById(R)||B._changedPointerPositions[0]||X;a.DD._dragElements.set(this._id,{node:this,startPointerPos:Y,offset:{x:Y.x-X.x,y:Y.y-X.y},dragStatus:"ready",pointerId:R})}startDrag(k,R=!0){a.DD._dragElements.has(this._id)||this._createDragElement(k);const B=a.DD._dragElements.get(this._id);B.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:k&&k.evt},R)}_setDragPosition(k,R){const B=this.getStage()._getPointerById(R.pointerId);if(!B)return;let X={x:B.x-R.offset.x,y:B.y-R.offset.y};const Y=this.dragBoundFunc();if(Y!==void 0){const Q=Y.call(this,X,k);Q?X=Q: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!==X.x||this._lastPos.y!==X.y)&&(this.setAbsolutePosition(X),this._requestDraw()),this._lastPos=X}stopDrag(k){const R=a.DD._dragElements.get(this._id);R&&(R.dragStatus="stopped"),a.DD._endDragBefore(k),a.DD._endDragAfter(k)}setDraggable(k){this._setAttr("draggable",k),this._dragChange()}isDragging(){const k=a.DD._dragElements.get(this._id);return k?k.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(k){if(!(!(k.evt.button!==void 0)||n.Konva.dragButtons.indexOf(k.evt.button)>=0)||this.isDragging())return;let X=!1;a.DD._dragElements.forEach(Y=>{this.isAncestorOf(Y.node)&&(X=!0)}),X||this._createDragElement(k)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const R=a.DD._dragElements.get(this._id),B=R&&R.dragStatus==="dragging",X=R&&R.dragStatus==="ready";B?this.stopDrag():X&&a.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(k={x:0,y:0}){const R=this.getStage();if(!R)return!1;const B={x:-k.x,y:-k.y,width:R.width()+2*k.x,height:R.height()+2*k.y};return e.Util.haveIntersection(B,this.getClientRect())}static create(k,R){return e.Util._isString(k)&&(k=JSON.parse(k)),this._createNode(k,R)}static _createNode(k,R){let B=m.prototype.getClassName.call(k),X=k.children,Y,Q,q;R&&(k.attrs.container=R),n.Konva[B]||(e.Util.warn('Can not find a node with class name "'+B+'". Fallback to "Shape".'),B="Shape");const z=n.Konva[B];if(Y=new z(k.attrs),X)for(Q=X.length,q=0;q<Q;q++)Y.add(m._createNode(X[q]));return Y}}yf.Node=m,m.prototype.nodeType="Node",m.prototype._attrsAffectingSize=[],m.prototype.eventListeners={},m.prototype.on.call(m.prototype,j,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(x),this._clearSelfAndDescendantCache(d)}),m.prototype.on.call(m.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(T)}),m.prototype.on.call(m.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(S)}),m.prototype.on.call(m.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(s)});const A=i.Factory.addGetterSetter;return A(m,"zIndex"),A(m,"absolutePosition"),A(m,"position"),A(m,"x",0,(0,l.getNumberValidator)()),A(m,"y",0,(0,l.getNumberValidator)()),A(m,"globalCompositeOperation","source-over",(0,l.getStringValidator)()),A(m,"opacity",1,(0,l.getNumberValidator)()),A(m,"name","",(0,l.getStringValidator)()),A(m,"id","",(0,l.getStringValidator)()),A(m,"rotation",0,(0,l.getNumberValidator)()),i.Factory.addComponentsGetterSetter(m,"scale",["x","y"]),A(m,"scaleX",1,(0,l.getNumberValidator)()),A(m,"scaleY",1,(0,l.getNumberValidator)()),i.Factory.addComponentsGetterSetter(m,"skew",["x","y"]),A(m,"skewX",0,(0,l.getNumberValidator)()),A(m,"skewY",0,(0,l.getNumberValidator)()),i.Factory.addComponentsGetterSetter(m,"offset",["x","y"]),A(m,"offsetX",0,(0,l.getNumberValidator)()),A(m,"offsetY",0,(0,l.getNumberValidator)()),A(m,"dragDistance",void 0,(0,l.getNumberValidator)()),A(m,"width",0,(0,l.getNumberValidator)()),A(m,"height",0,(0,l.getNumberValidator)()),A(m,"listening",!0,(0,l.getBooleanValidator)()),A(m,"preventDefault",!0,(0,l.getBooleanValidator)()),A(m,"filters",void 0,function(L){return this._filterUpToDate=!1,L}),A(m,"visible",!0,(0,l.getBooleanValidator)()),A(m,"transformsEnabled","all",(0,l.getStringValidator)()),A(m,"size"),A(m,"dragBoundFunc"),A(m,"draggable",!1,(0,l.getBooleanValidator)()),i.Factory.backCompat(m,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"}),yf}var bf={},Xm;function Np(){if(Xm)return bf;Xm=1,Object.defineProperty(bf,"__esModule",{value:!0}),bf.Container=void 0;const e=Ft(),i=Hn(),t=Bt();let n=class extends i.Node{constructor(){super(...arguments),this.children=[]}getChildren(l){if(!l)return this.children||[];const s=this.children||[],c=[];return s.forEach(function(d){l(d)&&c.push(d)}),c}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(l=>{l.parent=null,l.index=0,l.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(l=>{l.parent=null,l.index=0,l.destroy()}),this.children=[],this._requestDraw(),this}add(...l){if(l.length===0)return this;if(l.length>1){for(let c=0;c<l.length;c++)this.add(l[c]);return this}const s=l[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(l){return this._generalFind(l,!1)}findOne(l){const s=this._generalFind(l,!0);return s.length>0?s[0]:void 0}_generalFind(l,s){const c=[];return this._descendants(d=>{const w=d._isMatch(l);return w&&c.push(d),!!(w&&s)}),c}_descendants(l){let s=!1;const c=this.getChildren();for(const d of c){if(s=l(d),s)return!0;if(d.hasChildren()&&(s=d._descendants(l),s))return!0}return!1}toObject(){const l=i.Node.prototype.toObject.call(this);return l.children=[],this.getChildren().forEach(s=>{l.children.push(s.toObject())}),l}isAncestorOf(l){let s=l.getParent();for(;s;){if(s._id===this._id)return!0;s=s.getParent()}return!1}clone(l){const s=i.Node.prototype.clone.call(this,l);return this.getChildren().forEach(function(c){s.add(c.clone())}),s}getAllIntersections(l){const s=[];return this.find("Shape").forEach(c=>{c.isVisible()&&c.intersects(l)&&s.push(c)}),s}_clearSelfAndDescendantCache(l){var s;super._clearSelfAndDescendantCache(l),!this.isCached()&&((s=this.children)===null||s===void 0||s.forEach(function(c){c._clearSelfAndDescendantCache(l)}))}_setChildrenIndices(){var l;(l=this.children)===null||l===void 0||l.forEach(function(s,c){s.index=c}),this._requestDraw()}drawScene(l,s,c){const d=this.getLayer(),w=l||d&&d.getCanvas(),_=w&&w.getContext(),E=this._getCanvasCache(),O=E&&E.scene,v=w&&w.isCache;if(!this.isVisible()&&!v)return this;if(O){_.save();const S=this.getAbsoluteTransform(s).getMatrix();_.transform(S[0],S[1],S[2],S[3],S[4],S[5]),this._drawCachedSceneCanvas(_),_.restore()}else this._drawChildren("drawScene",w,s,c);return this}drawHit(l,s){if(!this.shouldDrawHit(s))return this;const c=this.getLayer(),d=l||c&&c.hitCanvas,w=d&&d.getContext(),_=this._getCanvasCache();if(_&&_.hit){w.save();const O=this.getAbsoluteTransform(s).getMatrix();w.transform(O[0],O[1],O[2],O[3],O[4],O[5]),this._drawCachedHitCanvas(w),w.restore()}else this._drawChildren("drawHit",d,s);return this}_drawChildren(l,s,c,d){var w;const _=s&&s.getContext(),E=this.clipWidth(),O=this.clipHeight(),v=this.clipFunc(),S=typeof E=="number"&&typeof O=="number"||v,p=c===this;if(S){_.save();const P=this.getAbsoluteTransform(c);let g=P.getMatrix();_.transform(g[0],g[1],g[2],g[3],g[4],g[5]),_.beginPath();let y;if(v)y=v.call(this,_,this);else{const b=this.clipX(),x=this.clipY();_.rect(b||0,x||0,E,O)}_.clip.apply(_,y),g=P.copy().invert().getMatrix(),_.transform(g[0],g[1],g[2],g[3],g[4],g[5])}const h=!p&&this.globalCompositeOperation()!=="source-over"&&l==="drawScene";h&&(_.save(),_._applyGlobalCompositeOperation(this)),(w=this.children)===null||w===void 0||w.forEach(function(P){P[l](s,c,d)}),h&&_.restore(),S&&_.restore()}getClientRect(l={}){var s;const c=l.skipTransform,d=l.relativeTo;let w,_,E,O,v={x:1/0,y:1/0,width:0,height:0};const S=this;(s=this.children)===null||s===void 0||s.forEach(function(P){if(!P.visible())return;const g=P.getClientRect({relativeTo:S,skipShadow:l.skipShadow,skipStroke:l.skipStroke});g.width===0&&g.height===0||(w===void 0?(w=g.x,_=g.y,E=g.x+g.width,O=g.y+g.height):(w=Math.min(w,g.x),_=Math.min(_,g.y),E=Math.max(E,g.x+g.width),O=Math.max(O,g.y+g.height)))});const p=this.find("Shape");let h=!1;for(let P=0;P<p.length;P++)if(p[P]._isVisible(this)){h=!0;break}return h&&w!==void 0?v={x:w,y:_,width:E-w,height:O-_}:v={x:0,y:0,width:0,height:0},c?v:this._transformedRect(v,d)}};return bf.Container=n,e.Factory.addComponentsGetterSetter(n,"clip",["x","y","width","height"]),e.Factory.addGetterSetter(n,"clipX",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipY",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipWidth",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipHeight",void 0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipFunc"),bf}var B0={},ql={},Zm;function U5(){if(Zm)return ql;Zm=1,Object.defineProperty(ql,"__esModule",{value:!0}),ql.getCapturedShape=n,ql.createEvent=a,ql.hasPointerCapture=l,ql.setPointerCapture=s,ql.releaseCapture=c;const e=Nt(),i=new Map,t=e.Konva._global.PointerEvent!==void 0;function n(d){return i.get(d)}function a(d){return{evt:d,pointerId:d.pointerId}}function l(d,w){return i.get(d)===w}function s(d,w){c(d),w.getStage()&&(i.set(d,w),t&&w._fire("gotpointercapture",a(new PointerEvent("gotpointercapture"))))}function c(d,w){const _=i.get(d);if(!_)return;const E=_.getStage();E&&E.content,i.delete(d),t&&_._fire("lostpointercapture",a(new PointerEvent("lostpointercapture")))}return ql}var Qm;function T8(){return Qm||(Qm=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const i=In(),t=Ft(),n=Np(),a=Nt(),l=Lp(),s=pv(),c=Nt(),d=U5(),w="Stage",_="string",E="px",O="mouseout",v="mouseleave",S="mouseover",p="mouseenter",h="mousemove",P="mousedown",g="mouseup",y="pointermove",b="pointerdown",x="pointerup",M="pointercancel",T="lostpointercapture",j="pointerout",I="pointerleave",m="pointerover",A="pointerenter",L="contextmenu",k="touchstart",R="touchend",B="touchmove",X="touchcancel",Y="wheel",Q=5,q=[[p,"_pointerenter"],[P,"_pointerdown"],[h,"_pointermove"],[g,"_pointerup"],[v,"_pointerleave"],[k,"_pointerdown"],[B,"_pointermove"],[R,"_pointerup"],[X,"_pointercancel"],[S,"_pointerover"],[Y,"_wheel"],[L,"_contextmenu"],[b,"_pointerdown"],[y,"_pointermove"],[x,"_pointerup"],[M,"_pointercancel"],[T,"_lostpointercapture"]],z={mouse:{[j]:O,[I]:v,[m]:S,[A]:p,[y]:h,[b]:P,[x]:g,[M]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[j]:"touchout",[I]:"touchleave",[m]:"touchover",[A]:"touchenter",[y]:B,[b]:k,[x]:R,[M]:X,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[j]:j,[I]:I,[m]:m,[A]:A,[y]:y,[b]:b,[x]:x,[M]:M,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},N=Z=>Z.indexOf("pointer")>=0?"pointer":Z.indexOf("touch")>=0?"touch":"mouse",U=Z=>{const W=N(Z);if(W==="pointer")return a.Konva.pointerEventsEnabled&&z.pointer;if(W==="touch")return z.touch;if(W==="mouse")return z.mouse};function $(Z={}){return(Z.clipFunc||Z.clipWidth||Z.clipHeight)&&i.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),Z}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 G extends n.Container{constructor(W){super($(W)),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",()=>{$(this.attrs)}),this._checkVisibility()}_validateAdd(W){const te=W.getType()==="Layer",re=W.getType()==="FastLayer";te||re||i.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const W=this.visible()?"":"none";this.content.style.display=W}setContainer(W){if(typeof W===_){if(W.charAt(0)==="."){const re=W.slice(1);W=document.getElementsByClassName(re)[0]}else{var te;W.charAt(0)!=="#"?te=W:te=W.slice(1),W=document.getElementById(te)}if(!W)throw"Can not find container in document with id "+te}return this._setAttr("container",W),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),W.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const W=this.children,te=W.length;for(let re=0;re<te;re++)W[re].clear();return this}clone(W){return W||(W={}),W.container=typeof document<"u"&&document.createElement("div"),n.Container.prototype.clone.call(this,W)}destroy(){super.destroy();const W=this.content;W&&i.Util._isInDocument(W)&&this.container().removeChild(W);const te=e.stages.indexOf(this);return te>-1&&e.stages.splice(te,1),i.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const W=this._pointerPositions[0]||this._changedPointerPositions[0];return W?{x:W.x,y:W.y}:(i.Util.warn(ee),null)}_getPointerById(W){return this._pointerPositions.find(te=>te.id===W)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(W){W=W||{},W.x=W.x||0,W.y=W.y||0,W.width=W.width||this.width(),W.height=W.height||this.height();const te=new l.SceneCanvas({width:W.width,height:W.height,pixelRatio:W.pixelRatio||1}),re=te.getContext()._context,ie=this.children;return(W.x||W.y)&&re.translate(-1*W.x,-1*W.y),ie.forEach(function(ae){if(!ae.isVisible())return;const se=ae._toKonvaCanvas(W);re.drawImage(se._canvas,W.x,W.y,se.getWidth()/se.getPixelRatio(),se.getHeight()/se.getPixelRatio())}),te}getIntersection(W){if(!W)return null;const te=this.children,re=te.length,ie=re-1;for(let ae=ie;ae>=0;ae--){const se=te[ae].getIntersection(W);if(se)return se}return null}_resizeDOM(){const W=this.width(),te=this.height();this.content&&(this.content.style.width=W+E,this.content.style.height=te+E),this.bufferCanvas.setSize(W,te),this.bufferHitCanvas.setSize(W,te),this.children.forEach(re=>{re.setSize({width:W,height:te}),re.draw()})}add(W,...te){if(arguments.length>1){for(let ie=0;ie<arguments.length;ie++)this.add(arguments[ie]);return this}super.add(W);const re=this.children.length;return re>Q&&i.Util.warn("The stage has "+re+" 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."),W.setSize({width:this.width(),height:this.height()}),W.draw(),a.Konva.isBrowser&&this.content.appendChild(W.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(W){return d.hasPointerCapture(W,this)}setPointerCapture(W){d.setPointerCapture(W,this)}releaseCapture(W){d.releaseCapture(W,this)}getLayers(){return this.children}_bindContentEvents(){a.Konva.isBrowser&&q.forEach(([W,te])=>{this.content.addEventListener(W,re=>{this[te](re)},{passive:!1})})}_pointerenter(W){this.setPointersPositions(W);const te=U(W.type);te&&this._fire(te.pointerenter,{evt:W,target:this,currentTarget:this})}_pointerover(W){this.setPointersPositions(W);const te=U(W.type);te&&this._fire(te.pointerover,{evt:W,target:this,currentTarget:this})}_getTargetShape(W){let te=this[W+"targetShape"];return te&&!te.getStage()&&(te=null),te}_pointerleave(W){const te=U(W.type),re=N(W.type);if(!te)return;this.setPointersPositions(W);const ie=this._getTargetShape(re),ae=!(a.Konva.isDragging()||a.Konva.isTransforming())||a.Konva.hitOnDragEnabled;ie&&ae?(ie._fireAndBubble(te.pointerout,{evt:W}),ie._fireAndBubble(te.pointerleave,{evt:W}),this._fire(te.pointerleave,{evt:W,target:this,currentTarget:this}),this[re+"targetShape"]=null):ae&&(this._fire(te.pointerleave,{evt:W,target:this,currentTarget:this}),this._fire(te.pointerout,{evt:W,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(W){const te=U(W.type),re=N(W.type);if(!te)return;this.setPointersPositions(W);let ie=!1;this._changedPointerPositions.forEach(ae=>{const se=this.getIntersection(ae);if(s.DD.justDragged=!1,a.Konva["_"+re+"ListenClick"]=!0,!se||!se.isListening()){this[re+"ClickStartShape"]=void 0;return}a.Konva.capturePointerEventsEnabled&&se.setPointerCapture(ae.id),this[re+"ClickStartShape"]=se,se._fireAndBubble(te.pointerdown,{evt:W,pointerId:ae.id}),ie=!0;const de=W.type.indexOf("touch")>=0;se.preventDefault()&&W.cancelable&&de&&W.preventDefault()}),ie||this._fire(te.pointerdown,{evt:W,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(W){const te=U(W.type),re=N(W.type);if(!te||(a.Konva.isDragging()&&s.DD.node.preventDefault()&&W.cancelable&&W.preventDefault(),this.setPointersPositions(W),!(!(a.Konva.isDragging()||a.Konva.isTransforming())||a.Konva.hitOnDragEnabled)))return;const ae={};let se=!1;const de=this._getTargetShape(re);this._changedPointerPositions.forEach(he=>{const Oe=d.getCapturedShape(he.id)||this.getIntersection(he),_e=he.id,Ae={evt:W,pointerId:_e},ce=de!==Oe;if(ce&&de&&(de._fireAndBubble(te.pointerout,{...Ae},Oe),de._fireAndBubble(te.pointerleave,{...Ae},Oe)),Oe){if(ae[Oe._id])return;ae[Oe._id]=!0}Oe&&Oe.isListening()?(se=!0,ce&&(Oe._fireAndBubble(te.pointerover,{...Ae},de),Oe._fireAndBubble(te.pointerenter,{...Ae},de),this[re+"targetShape"]=Oe),Oe._fireAndBubble(te.pointermove,{...Ae})):de&&(this._fire(te.pointerover,{evt:W,target:this,currentTarget:this,pointerId:_e}),this[re+"targetShape"]=null)}),se||this._fire(te.pointermove,{evt:W,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(W){const te=U(W.type),re=N(W.type);if(!te)return;this.setPointersPositions(W);const ie=this[re+"ClickStartShape"],ae=this[re+"ClickEndShape"],se={};let de=!1;this._changedPointerPositions.forEach(he=>{const Oe=d.getCapturedShape(he.id)||this.getIntersection(he);if(Oe){if(Oe.releaseCapture(he.id),se[Oe._id])return;se[Oe._id]=!0}const _e=he.id,Ae={evt:W,pointerId:_e};let ce=!1;a.Konva["_"+re+"InDblClickWindow"]?(ce=!0,clearTimeout(this[re+"DblTimeout"])):s.DD.justDragged||(a.Konva["_"+re+"InDblClickWindow"]=!0,clearTimeout(this[re+"DblTimeout"])),this[re+"DblTimeout"]=setTimeout(function(){a.Konva["_"+re+"InDblClickWindow"]=!1},a.Konva.dblClickWindow),Oe&&Oe.isListening()?(de=!0,this[re+"ClickEndShape"]=Oe,Oe._fireAndBubble(te.pointerup,{...Ae}),a.Konva["_"+re+"ListenClick"]&&ie&&ie===Oe&&(Oe._fireAndBubble(te.pointerclick,{...Ae}),ce&&ae&&ae===Oe&&Oe._fireAndBubble(te.pointerdblclick,{...Ae}))):(this[re+"ClickEndShape"]=null,a.Konva["_"+re+"ListenClick"]&&this._fire(te.pointerclick,{evt:W,target:this,currentTarget:this,pointerId:_e}),ce&&this._fire(te.pointerdblclick,{evt:W,target:this,currentTarget:this,pointerId:_e}))}),de||this._fire(te.pointerup,{evt:W,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),a.Konva["_"+re+"ListenClick"]=!1,W.cancelable&&re!=="touch"&&re!=="pointer"&&W.preventDefault()}_contextmenu(W){this.setPointersPositions(W);const te=this.getIntersection(this.getPointerPosition());te&&te.isListening()?te._fireAndBubble(L,{evt:W}):this._fire(L,{evt:W,target:this,currentTarget:this})}_wheel(W){this.setPointersPositions(W);const te=this.getIntersection(this.getPointerPosition());te&&te.isListening()?te._fireAndBubble(Y,{evt:W}):this._fire(Y,{evt:W,target:this,currentTarget:this})}_pointercancel(W){this.setPointersPositions(W);const te=d.getCapturedShape(W.pointerId)||this.getIntersection(this.getPointerPosition());te&&te._fireAndBubble(x,d.createEvent(W)),d.releaseCapture(W.pointerId)}_lostpointercapture(W){d.releaseCapture(W.pointerId)}setPointersPositions(W){const te=this._getContentPosition();let re=null,ie=null;W=W||window.event,W.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(W.touches,ae=>{this._pointerPositions.push({id:ae.identifier,x:(ae.clientX-te.left)/te.scaleX,y:(ae.clientY-te.top)/te.scaleY})}),Array.prototype.forEach.call(W.changedTouches||W.touches,ae=>{this._changedPointerPositions.push({id:ae.identifier,x:(ae.clientX-te.left)/te.scaleX,y:(ae.clientY-te.top)/te.scaleY})})):(re=(W.clientX-te.left)/te.scaleX,ie=(W.clientY-te.top)/te.scaleY,this.pointerPos={x:re,y:ie},this._pointerPositions=[{x:re,y:ie,id:i.Util._getFirstPointerId(W)}],this._changedPointerPositions=[{x:re,y:ie,id:i.Util._getFirstPointerId(W)}])}_setPointerPosition(W){i.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(W)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const W=this.content.getBoundingClientRect();return{top:W.top,left:W.left,scaleX:W.width/this.content.clientWidth||1,scaleY:W.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new l.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new l.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!a.Konva.isBrowser)return;const W=this.container();if(!W)throw"Stage has no container. A container is required.";W.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"),W.appendChild(this.content),this._resizeDOM()}cache(){return i.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(W){W.batchDraw()}),this}}e.Stage=G,G.prototype.nodeType=w,(0,c._registerNode)(G),t.Factory.addGetterSetter(G,"container"),a.Konva.isBrowser&&document.addEventListener("visibilitychange",()=>{e.stages.forEach(Z=>{Z.batchDraw()})})}(B0)),B0}var _f={},U0={},Jm;function wr(){return Jm||(Jm=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const i=Nt(),t=In(),n=Ft(),a=Hn(),l=Bt(),s=Nt(),c=U5(),d="hasShadow",w="shadowRGBA",_="patternImage",E="linearGradient",O="radialGradient";let v;function S(){return v||(v=t.Util.createCanvasElement().getContext("2d"),v)}e.shapes={};function p(I){const m=this.attrs.fillRule;m?I.fill(m):I.fill()}function h(I){I.stroke()}function P(I){const m=this.attrs.fillRule;m?I.fill(m):I.fill()}function g(I){I.stroke()}function y(){this._clearCache(d)}function b(){this._clearCache(w)}function x(){this._clearCache(_)}function M(){this._clearCache(E)}function T(){this._clearCache(O)}class j extends a.Node{constructor(m){super(m);let A;for(;A=t.Util.getRandomColor(),!(A&&!(A in e.shapes)););this.colorKey=A,e.shapes[A]=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(d,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(_,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const A=S().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(A&&A.setTransform){const L=new t.Transform;L.translate(this.fillPatternX(),this.fillPatternY()),L.rotate(i.Konva.getAngle(this.fillPatternRotation())),L.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),L.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const k=L.getMatrix(),R=typeof DOMMatrix>"u"?{a:k[0],b:k[1],c:k[2],d:k[3],e:k[4],f:k[5]}:new DOMMatrix(k);A.setTransform(R)}return A}}_getLinearGradient(){return this._getCache(E,this.__getLinearGradient)}__getLinearGradient(){const m=this.fillLinearGradientColorStops();if(m){const A=S(),L=this.fillLinearGradientStartPoint(),k=this.fillLinearGradientEndPoint(),R=A.createLinearGradient(L.x,L.y,k.x,k.y);for(let B=0;B<m.length;B+=2)R.addColorStop(m[B],m[B+1]);return R}}_getRadialGradient(){return this._getCache(O,this.__getRadialGradient)}__getRadialGradient(){const m=this.fillRadialGradientColorStops();if(m){const A=S(),L=this.fillRadialGradientStartPoint(),k=this.fillRadialGradientEndPoint(),R=A.createRadialGradient(L.x,L.y,this.fillRadialGradientStartRadius(),k.x,k.y,this.fillRadialGradientEndRadius());for(let B=0;B<m.length;B+=2)R.addColorStop(m[B],m[B+1]);return R}}getShadowRGBA(){return this._getCache(w,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const m=t.Util.colorToRGBA(this.shadowColor());if(m)return"rgba("+m.r+","+m.g+","+m.b+","+m.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 m=this.hitStrokeWidth();return m==="auto"?this.hasStroke():this.strokeEnabled()&&!!m}intersects(m){const A=this.getStage();if(!A)return!1;const L=A.bufferHitCanvas;return L.getContext().clear(),this.drawHit(L,void 0,!0),L.context.getImageData(Math.round(m.x),Math.round(m.y),1,1).data[3]>0}destroy(){return a.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(m){var A;if(!((A=this.attrs.perfectDrawEnabled)!==null&&A!==void 0?A:!0))return!1;const k=m||this.hasFill(),R=this.hasStroke(),B=this.getAbsoluteOpacity()!==1;if(k&&R&&B)return!0;const X=this.hasShadow(),Y=this.shadowForStrokeEnabled();return!!(k&&R&&X&&Y)}setStrokeHitEnabled(m){t.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),m?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const m=this.size();return{x:this._centroid?-m.width/2:0,y:this._centroid?-m.height/2:0,width:m.width,height:m.height}}getClientRect(m={}){let A=!1,L=this.getParent();for(;L;){if(L.isCached()){A=!0;break}L=L.getParent()}const k=m.skipTransform,R=m.relativeTo||A&&this.getStage()||void 0,B=this.getSelfRect(),Y=!m.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,Q=B.width+Y,q=B.height+Y,z=!m.skipShadow&&this.hasShadow(),N=z?this.shadowOffsetX():0,U=z?this.shadowOffsetY():0,$=Q+Math.abs(N),ee=q+Math.abs(U),G=z&&this.shadowBlur()||0,Z=$+G*2,W=ee+G*2,te={width:Z,height:W,x:-(Y/2+G)+Math.min(N,0)+B.x,y:-(Y/2+G)+Math.min(U,0)+B.y};return k?te:this._transformedRect(te,R)}drawScene(m,A,L){const k=this.getLayer();let R=m||k.getCanvas(),B=R.getContext(),X=this._getCanvasCache(),Y=this.getSceneFunc(),Q=this.hasShadow(),q,z;const N=R.isCache,U=A===this;if(!this.isVisible()&&!U)return this;if(X){B.save();const ee=this.getAbsoluteTransform(A).getMatrix();return B.transform(ee[0],ee[1],ee[2],ee[3],ee[4],ee[5]),this._drawCachedSceneCanvas(B),B.restore(),this}if(!Y)return this;if(B.save(),this._useBufferCanvas()&&!N){q=this.getStage();const ee=L||q.bufferCanvas;z=ee.getContext(),z.clear(),z.save(),z._applyLineJoin(this);var $=this.getAbsoluteTransform(A).getMatrix();z.transform($[0],$[1],$[2],$[3],$[4],$[5]),Y.call(this,z,this),z.restore();const G=ee.pixelRatio;Q&&B._applyShadow(this),B._applyOpacity(this),B._applyGlobalCompositeOperation(this),B.drawImage(ee._canvas,0,0,ee.width/G,ee.height/G)}else{if(B._applyLineJoin(this),!U){var $=this.getAbsoluteTransform(A).getMatrix();B.transform($[0],$[1],$[2],$[3],$[4],$[5]),B._applyOpacity(this),B._applyGlobalCompositeOperation(this)}Q&&B._applyShadow(this),Y.call(this,B,this)}return B.restore(),this}drawHit(m,A,L=!1){if(!this.shouldDrawHit(A,L))return this;const k=this.getLayer(),R=m||k.hitCanvas,B=R&&R.getContext(),X=this.hitFunc()||this.sceneFunc(),Y=this._getCanvasCache(),Q=Y&&Y.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()"),Q){B.save();const z=this.getAbsoluteTransform(A).getMatrix();return B.transform(z[0],z[1],z[2],z[3],z[4],z[5]),this._drawCachedHitCanvas(B),B.restore(),this}if(!X)return this;if(B.save(),B._applyLineJoin(this),!(this===A)){const z=this.getAbsoluteTransform(A).getMatrix();B.transform(z[0],z[1],z[2],z[3],z[4],z[5])}return X.call(this,B,this),B.restore(),this}drawHitFromCache(m=0){const A=this._getCanvasCache(),L=this._getCachedSceneCanvas(),k=A.hit,R=k.getContext(),B=k.getWidth(),X=k.getHeight();R.clear(),R.drawImage(L._canvas,0,0,B,X);try{const Y=R.getImageData(0,0,B,X),Q=Y.data,q=Q.length,z=t.Util._hexToRgb(this.colorKey);for(let N=0;N<q;N+=4)Q[N+3]>m?(Q[N]=z.r,Q[N+1]=z.g,Q[N+2]=z.b,Q[N+3]=255):Q[N+3]=0;R.putImageData(Y,0,0)}catch(Y){t.Util.error("Unable to draw hit graph from cached scene canvas. "+Y.message)}return this}hasPointerCapture(m){return c.hasPointerCapture(m,this)}setPointerCapture(m){c.setPointerCapture(m,this)}releaseCapture(m){c.releaseCapture(m,this)}}e.Shape=j,j.prototype._fillFunc=p,j.prototype._strokeFunc=h,j.prototype._fillFuncHit=P,j.prototype._strokeFuncHit=g,j.prototype._centroid=!1,j.prototype.nodeType="Shape",(0,s._registerNode)(j),j.prototype.eventListeners={},j.prototype.on.call(j.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",y),j.prototype.on.call(j.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",b),j.prototype.on.call(j.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",x),j.prototype.on.call(j.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",M),j.prototype.on.call(j.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",T),n.Factory.addGetterSetter(j,"stroke",void 0,(0,l.getStringOrGradientValidator)()),n.Factory.addGetterSetter(j,"strokeWidth",2,(0,l.getNumberValidator)()),n.Factory.addGetterSetter(j,"fillAfterStrokeEnabled",!1),n.Factory.addGetterSetter(j,"hitStrokeWidth","auto",(0,l.getNumberOrAutoValidator)()),n.Factory.addGetterSetter(j,"strokeHitEnabled",!0,(0,l.getBooleanValidator)()),n.Factory.addGetterSetter(j,"perfectDrawEnabled",!0,(0,l.getBooleanValidator)()),n.Factory.addGetterSetter(j,"shadowForStrokeEnabled",!0,(0,l.getBooleanValidator)()),n.Factory.addGetterSetter(j,"lineJoin"),n.Factory.addGetterSetter(j,"lineCap"),n.Factory.addGetterSetter(j,"sceneFunc"),n.Factory.addGetterSetter(j,"hitFunc"),n.Factory.addGetterSetter(j,"dash"),n.Factory.addGetterSetter(j,"dashOffset",0,(0,l.getNumberValidator)()),n.Factory.addGetterSetter(j,"shadowColor",void 0,(0,l.getStringValidator)()),n.Factory.addGetterSetter(j,"shadowBlur",0,(0,l.getNumberValidator)()),n.Factory.addGetterSetter(j,"shadowOpacity",1,(0,l.getNumberValidator)()),n.Factory.addComponentsGetterSetter(j,"shadowOffset",["x","y"]),n.Factory.addGetterSetter(j,"shadowOffsetX",0,(0,l.getNumberValidator)()),n.Factory.addGetterSetter(j,"shadowOffsetY",0,(0,l.getNumberValidator)()),n.Factory.addGetterSetter(j,"fillPatternImage"),n.Factory.addGetterSetter(j,"fill",void 0,(0,l.getStringOrGradientValidator)()),n.Factory.addGetterSetter(j,"fillPatternX",0,(0,l.getNumberValidator)()),n.Factory.addGetterSetter(j,"fillPatternY",0,(0,l.getNumberValidator)()),n.Factory.addGetterSetter(j,"fillLinearGradientColorStops"),n.Factory.addGetterSetter(j,"strokeLinearGradientColorStops"),n.Factory.addGetterSetter(j,"fillRadialGradientStartRadius",0),n.Factory.addGetterSetter(j,"fillRadialGradientEndRadius",0),n.Factory.addGetterSetter(j,"fillRadialGradientColorStops"),n.Factory.addGetterSetter(j,"fillPatternRepeat","repeat"),n.Factory.addGetterSetter(j,"fillEnabled",!0),n.Factory.addGetterSetter(j,"strokeEnabled",!0),n.Factory.addGetterSetter(j,"shadowEnabled",!0),n.Factory.addGetterSetter(j,"dashEnabled",!0),n.Factory.addGetterSetter(j,"strokeScaleEnabled",!0),n.Factory.addGetterSetter(j,"fillPriority","color"),n.Factory.addComponentsGetterSetter(j,"fillPatternOffset",["x","y"]),n.Factory.addGetterSetter(j,"fillPatternOffsetX",0,(0,l.getNumberValidator)()),n.Factory.addGetterSetter(j,"fillPatternOffsetY",0,(0,l.getNumberValidator)()),n.Factory.addComponentsGetterSetter(j,"fillPatternScale",["x","y"]),n.Factory.addGetterSetter(j,"fillPatternScaleX",1,(0,l.getNumberValidator)()),n.Factory.addGetterSetter(j,"fillPatternScaleY",1,(0,l.getNumberValidator)()),n.Factory.addComponentsGetterSetter(j,"fillLinearGradientStartPoint",["x","y"]),n.Factory.addComponentsGetterSetter(j,"strokeLinearGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(j,"fillLinearGradientStartPointX",0),n.Factory.addGetterSetter(j,"strokeLinearGradientStartPointX",0),n.Factory.addGetterSetter(j,"fillLinearGradientStartPointY",0),n.Factory.addGetterSetter(j,"strokeLinearGradientStartPointY",0),n.Factory.addComponentsGetterSetter(j,"fillLinearGradientEndPoint",["x","y"]),n.Factory.addComponentsGetterSetter(j,"strokeLinearGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(j,"fillLinearGradientEndPointX",0),n.Factory.addGetterSetter(j,"strokeLinearGradientEndPointX",0),n.Factory.addGetterSetter(j,"fillLinearGradientEndPointY",0),n.Factory.addGetterSetter(j,"strokeLinearGradientEndPointY",0),n.Factory.addComponentsGetterSetter(j,"fillRadialGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(j,"fillRadialGradientStartPointX",0),n.Factory.addGetterSetter(j,"fillRadialGradientStartPointY",0),n.Factory.addComponentsGetterSetter(j,"fillRadialGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(j,"fillRadialGradientEndPointX",0),n.Factory.addGetterSetter(j,"fillRadialGradientEndPointY",0),n.Factory.addGetterSetter(j,"fillPatternRotation",0),n.Factory.addGetterSetter(j,"fillRule",void 0,(0,l.getStringValidator)()),n.Factory.backCompat(j,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})}(U0)),U0}var ey;function q5(){if(ey)return _f;ey=1,Object.defineProperty(_f,"__esModule",{value:!0}),_f.Layer=void 0;const e=In(),i=Np(),t=Hn(),n=Ft(),a=Lp(),l=Bt(),s=wr(),c=Nt(),d="#",w="beforeDraw",_="draw",E=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],O=E.length;class v extends i.Container{constructor(p){super(p),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(p){return this.getContext().clear(p),this.getHitCanvas().getContext().clear(p),this}setZIndex(p){super.setZIndex(p);const h=this.getStage();return h&&h.content&&(h.content.removeChild(this.getNativeCanvasElement()),p<h.children.length-1?h.content.insertBefore(this.getNativeCanvasElement(),h.children[p+1].getCanvas()._canvas):h.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){t.Node.prototype.moveToTop.call(this);const p=this.getStage();return p&&p.content&&(p.content.removeChild(this.getNativeCanvasElement()),p.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!t.Node.prototype.moveUp.call(this))return!1;const h=this.getStage();return!h||!h.content?!1:(h.content.removeChild(this.getNativeCanvasElement()),this.index<h.children.length-1?h.content.insertBefore(this.getNativeCanvasElement(),h.children[this.index+1].getCanvas()._canvas):h.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(t.Node.prototype.moveDown.call(this)){const p=this.getStage();if(p){const h=p.children;p.content&&(p.content.removeChild(this.getNativeCanvasElement()),p.content.insertBefore(this.getNativeCanvasElement(),h[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(t.Node.prototype.moveToBottom.call(this)){const p=this.getStage();if(p){const h=p.children;p.content&&(p.content.removeChild(this.getNativeCanvasElement()),p.content.insertBefore(this.getNativeCanvasElement(),h[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const p=this.getNativeCanvasElement();return t.Node.prototype.remove.call(this),p&&p.parentNode&&e.Util._isInDocument(p)&&p.parentNode.removeChild(p),this}getStage(){return this.parent}setSize({width:p,height:h}){return this.canvas.setSize(p,h),this.hitCanvas.setSize(p,h),this._setSmoothEnabled(),this}_validateAdd(p){const h=p.getType();h!=="Group"&&h!=="Shape"&&e.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(p){return p=p||{},p.width=p.width||this.getWidth(),p.height=p.height||this.getHeight(),p.x=p.x!==void 0?p.x:this.x(),p.y=p.y!==void 0?p.y:this.y(),t.Node.prototype._toKonvaCanvas.call(this,p)}_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(p){if(!this.isListening()||!this.isVisible())return null;let h=1,P=!1;for(;;){for(let g=0;g<O;g++){const y=E[g],b=this._getIntersection({x:p.x+y.x*h,y:p.y+y.y*h}),x=b.shape;if(x)return x;if(P=!!b.antialiased,!b.antialiased)break}if(P)h+=1;else return null}}_getIntersection(p){const h=this.hitCanvas.pixelRatio,P=this.hitCanvas.context.getImageData(Math.round(p.x*h),Math.round(p.y*h),1,1).data,g=P[3];if(g===255){const y=e.Util._rgbToHex(P[0],P[1],P[2]),b=s.shapes[d+y];return b?{shape:b}:{antialiased:!0}}else if(g>0)return{antialiased:!0};return{}}drawScene(p,h){const P=this.getLayer(),g=p||P&&P.getCanvas();return this._fire(w,{node:this}),this.clearBeforeDraw()&&g.getContext().clear(),i.Container.prototype.drawScene.call(this,g,h),this._fire(_,{node:this}),this}drawHit(p,h){const P=this.getLayer(),g=p||P&&P.hitCanvas;return P&&P.clearBeforeDraw()&&P.getHitCanvas().getContext().clear(),i.Container.prototype.drawHit.call(this,g,h),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(p){e.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(p)}getHitGraphEnabled(p){return e.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const p=this.parent;!!this.hitCanvas._canvas.parentNode?p.content.removeChild(this.hitCanvas._canvas):p.content.appendChild(this.hitCanvas._canvas)}destroy(){return e.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}return _f.Layer=v,v.prototype.nodeType="Layer",(0,c._registerNode)(v),n.Factory.addGetterSetter(v,"imageSmoothingEnabled",!0),n.Factory.addGetterSetter(v,"clearBeforeDraw",!0),n.Factory.addGetterSetter(v,"hitGraphEnabled",!0,(0,l.getBooleanValidator)()),_f}var wf={},ty;function R8(){if(ty)return wf;ty=1,Object.defineProperty(wf,"__esModule",{value:!0}),wf.FastLayer=void 0;const e=In(),i=q5(),t=Nt();class n extends i.Layer{constructor(l){super(l),this.listening(!1),e.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}return wf.FastLayer=n,n.prototype.nodeType="FastLayer",(0,t._registerNode)(n),wf}var Sf={},ny;function gv(){if(ny)return Sf;ny=1,Object.defineProperty(Sf,"__esModule",{value:!0}),Sf.Group=void 0;const e=In(),i=Np(),t=Nt();class n extends i.Container{_validateAdd(l){const s=l.getType();s!=="Group"&&s!=="Shape"&&e.Util.throw("You may only add groups and shapes to groups.")}}return Sf.Group=n,n.prototype.nodeType="Group",(0,t._registerNode)(n),Sf}var Ef={},ry;function vv(){if(ry)return Ef;ry=1,Object.defineProperty(Ef,"__esModule",{value:!0}),Ef.Animation=void 0;const e=Nt(),i=In(),t=function(){return e.glob.performance&&e.glob.performance.now?function(){return e.glob.performance.now()}:function(){return new Date().getTime()}}();let n=class Ju{constructor(l,s){this.id=Ju.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:t(),frameRate:0},this.func=l,this.setLayers(s)}setLayers(l){let s=[];return l&&(s=Array.isArray(l)?l:[l]),this.layers=s,this}getLayers(){return this.layers}addLayer(l){const s=this.layers,c=s.length;for(let d=0;d<c;d++)if(s[d]._id===l._id)return!1;return this.layers.push(l),!0}isRunning(){const s=Ju.animations,c=s.length;for(let d=0;d<c;d++)if(s[d].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=t(),Ju._addAnimation(this),this}stop(){return Ju._removeAnimation(this),this}_updateFrameObject(l){this.frame.timeDiff=l-this.frame.lastTime,this.frame.lastTime=l,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(l){this.animations.push(l),this._handleAnimation()}static _removeAnimation(l){const s=l.id,c=this.animations,d=c.length;for(let w=0;w<d;w++)if(c[w].id===s){this.animations.splice(w,1);break}}static _runFrames(){const l={},s=this.animations;for(let c=0;c<s.length;c++){const d=s[c],w=d.layers,_=d.func;d._updateFrameObject(t());const E=w.length;let O;if(_?O=_.call(d,d.frame)!==!1:O=!0,!!O)for(let v=0;v<E;v++){const S=w[v];S._id!==void 0&&(l[S._id]=S)}}for(const c in l)l.hasOwnProperty(c)&&l[c].batchDraw()}static _animationLoop(){const l=Ju;l.animations.length?(l._runFrames(),i.Util.requestAnimFrame(l._animationLoop)):l.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,i.Util.requestAnimFrame(this._animationLoop))}};return Ef.Animation=n,n.animations=[],n.animIdCounter=0,n.animRunning=!1,Ef}var q0={},iy;function M8(){return iy||(iy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const i=In(),t=vv(),n=Hn(),a=Nt(),l={node:1,duration:1,easing:1,onFinish:1,yoyo:1},s=1,c=2,d=3,w=["fill","stroke","shadowColor"];let _=0;class E{constructor(S,p,h,P,g,y,b){this.prop=S,this.propFunc=p,this.begin=P,this._pos=P,this.duration=y,this._change=0,this.prevPos=0,this.yoyo=b,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=h,this._change=g-this.begin,this.pause()}fire(S){const p=this[S];p&&p()}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=d,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===d&&this.setTime(this.duration-S)}pause(){this.state=s,this.fire("onPause")}getTimer(){return new Date().getTime()}}class O{constructor(S){const p=this,h=S.node,P=h._id,g=S.easing||e.Easings.Linear,y=!!S.yoyo;let b,x;typeof S.duration>"u"?b=.3:S.duration===0?b=.001:b=S.duration,this.node=h,this._id=_++;const M=h.getLayer()||(h instanceof a.Konva.Stage?h.getLayers():null);M||i.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new t.Animation(function(){p.tween.onEnterFrame()},M),this.tween=new E(x,function(T){p._tweenFunc(T)},g,0,1,b*1e3,y),this._addListeners(),O.attrs[P]||(O.attrs[P]={}),O.attrs[P][this._id]||(O.attrs[P][this._id]={}),O.tweens[P]||(O.tweens[P]={});for(x in S)l[x]===void 0&&this._addAttr(x,S[x]);this.reset(),this.onFinish=S.onFinish,this.onReset=S.onReset,this.onUpdate=S.onUpdate}_addAttr(S,p){const h=this.node,P=h._id;let g,y,b,x,M;const T=O.tweens[P][S];T&&delete O.attrs[P][T][S];let j=h.getAttr(S);if(i.Util._isArray(p))if(g=[],y=Math.max(p.length,j.length),S==="points"&&p.length!==j.length&&(p.length>j.length?(x=j,j=i.Util._prepareArrayForTween(j,p,h.closed())):(b=p,p=i.Util._prepareArrayForTween(p,j,h.closed()))),S.indexOf("fill")===0)for(let I=0;I<y;I++)if(I%2===0)g.push(p[I]-j[I]);else{const m=i.Util.colorToRGBA(j[I]);M=i.Util.colorToRGBA(p[I]),j[I]=m,g.push({r:M.r-m.r,g:M.g-m.g,b:M.b-m.b,a:M.a-m.a})}else for(let I=0;I<y;I++)g.push(p[I]-j[I]);else w.indexOf(S)!==-1?(j=i.Util.colorToRGBA(j),M=i.Util.colorToRGBA(p),g={r:M.r-j.r,g:M.g-j.g,b:M.b-j.b,a:M.a-j.a}):g=p-j;O.attrs[P][this._id][S]={start:j,diff:g,end:p,trueEnd:b,trueStart:x},O.tweens[P][S]=this._id}_tweenFunc(S){const p=this.node,h=O.attrs[p._id][this._id];let P,g,y,b,x,M,T,j;for(P in h){if(g=h[P],y=g.start,b=g.diff,j=g.end,i.Util._isArray(y))if(x=[],T=Math.max(y.length,j.length),P.indexOf("fill")===0)for(M=0;M<T;M++)M%2===0?x.push((y[M]||0)+b[M]*S):x.push("rgba("+Math.round(y[M].r+b[M].r*S)+","+Math.round(y[M].g+b[M].g*S)+","+Math.round(y[M].b+b[M].b*S)+","+(y[M].a+b[M].a*S)+")");else for(M=0;M<T;M++)x.push((y[M]||0)+b[M]*S);else w.indexOf(P)!==-1?x="rgba("+Math.round(y.r+b.r*S)+","+Math.round(y.g+b.g*S)+","+Math.round(y.b+b.b*S)+","+(y.a+b.a*S)+")":x=y+b*S;p.setAttr(P,x)}}_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,p=O.attrs[S._id][this._id];p.points&&p.points.trueEnd&&S.setAttr("points",p.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const S=this.node,p=O.attrs[S._id][this._id];p.points&&p.points.trueStart&&S.points(p.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(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,p=this._id,h=O.tweens[S];this.pause();for(const P in h)delete O.tweens[S][P];delete O.attrs[S][p]}}e.Tween=O,O.attrs={},O.tweens={},n.Node.prototype.to=function(v){const S=v.onFinish;v.node=this,v.onFinish=function(){this.destroy(),S&&S()},new O(v).play()},e.Easings={BackEaseIn(v,S,p,h){return p*(v/=h)*v*((1.70158+1)*v-1.70158)+S},BackEaseOut(v,S,p,h){return p*((v=v/h-1)*v*((1.70158+1)*v+1.70158)+1)+S},BackEaseInOut(v,S,p,h){let P=1.70158;return(v/=h/2)<1?p/2*(v*v*(((P*=1.525)+1)*v-P))+S:p/2*((v-=2)*v*(((P*=1.525)+1)*v+P)+2)+S},ElasticEaseIn(v,S,p,h,P,g){let y=0;return v===0?S:(v/=h)===1?S+p:(g||(g=h*.3),!P||P<Math.abs(p)?(P=p,y=g/4):y=g/(2*Math.PI)*Math.asin(p/P),-(P*Math.pow(2,10*(v-=1))*Math.sin((v*h-y)*(2*Math.PI)/g))+S)},ElasticEaseOut(v,S,p,h,P,g){let y=0;return v===0?S:(v/=h)===1?S+p:(g||(g=h*.3),!P||P<Math.abs(p)?(P=p,y=g/4):y=g/(2*Math.PI)*Math.asin(p/P),P*Math.pow(2,-10*v)*Math.sin((v*h-y)*(2*Math.PI)/g)+p+S)},ElasticEaseInOut(v,S,p,h,P,g){let y=0;return v===0?S:(v/=h/2)===2?S+p:(g||(g=h*(.3*1.5)),!P||P<Math.abs(p)?(P=p,y=g/4):y=g/(2*Math.PI)*Math.asin(p/P),v<1?-.5*(P*Math.pow(2,10*(v-=1))*Math.sin((v*h-y)*(2*Math.PI)/g))+S:P*Math.pow(2,-10*(v-=1))*Math.sin((v*h-y)*(2*Math.PI)/g)*.5+p+S)},BounceEaseOut(v,S,p,h){return(v/=h)<1/2.75?p*(7.5625*v*v)+S:v<2/2.75?p*(7.5625*(v-=1.5/2.75)*v+.75)+S:v<2.5/2.75?p*(7.5625*(v-=2.25/2.75)*v+.9375)+S:p*(7.5625*(v-=2.625/2.75)*v+.984375)+S},BounceEaseIn(v,S,p,h){return p-e.Easings.BounceEaseOut(h-v,0,p,h)+S},BounceEaseInOut(v,S,p,h){return v<h/2?e.Easings.BounceEaseIn(v*2,0,p,h)*.5+S:e.Easings.BounceEaseOut(v*2-h,0,p,h)*.5+p*.5+S},EaseIn(v,S,p,h){return p*(v/=h)*v+S},EaseOut(v,S,p,h){return-p*(v/=h)*(v-2)+S},EaseInOut(v,S,p,h){return(v/=h/2)<1?p/2*v*v+S:-p/2*(--v*(v-2)-1)+S},StrongEaseIn(v,S,p,h){return p*(v/=h)*v*v*v*v+S},StrongEaseOut(v,S,p,h){return p*((v=v/h-1)*v*v*v*v+1)+S},StrongEaseInOut(v,S,p,h){return(v/=h/2)<1?p/2*v*v*v*v*v+S:p/2*((v-=2)*v*v*v*v+2)+S},Linear(v,S,p,h){return p*v/h+S}}}(q0)),q0}var oy;function qg(){return oy||(oy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const i=Nt(),t=In(),n=Hn(),a=Np(),l=T8(),s=q5(),c=R8(),d=gv(),w=pv(),_=wr(),E=vv(),O=M8(),v=B5(),S=Lp();e.Konva=t.Util._assign(i.Konva,{Util:t.Util,Transform:t.Transform,Node:n.Node,Container:a.Container,Stage:l.Stage,stages:l.stages,Layer:s.Layer,FastLayer:c.FastLayer,Group:d.Group,DD:w.DD,Shape:_.Shape,shapes:_.shapes,Animation:E.Animation,Tween:O.Tween,Easings:O.Easings,Context:v.Context,Canvas:S.Canvas}),e.default=e.Konva}(I0)),I0}var Of={},ay;function L8(){if(ay)return Of;ay=1,Object.defineProperty(Of,"__esModule",{value:!0}),Of.Arc=void 0;const e=Ft(),i=wr(),t=Nt(),n=Bt(),a=Nt();class l extends i.Shape{_sceneFunc(c){const d=t.Konva.getAngle(this.angle()),w=this.clockwise();c.beginPath(),c.arc(0,0,this.outerRadius(),0,d,w),c.arc(0,0,this.innerRadius(),d,0,!w),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(),d=this.outerRadius(),w=this.clockwise(),_=t.Konva.getAngle(w?360-this.angle():this.angle()),E=Math.cos(Math.min(_,Math.PI)),O=1,v=Math.sin(Math.min(Math.max(Math.PI,_),3*Math.PI/2)),S=Math.sin(Math.min(_,Math.PI/2)),p=E*(E>0?c:d),h=O*d,P=v*(v>0?c:d),g=S*(S>0?d:c);return{x:p,y:w?-1*g:P,width:h-p,height:g-P}}}return Of.Arc=l,l.prototype._centroid=!0,l.prototype.className="Arc",l.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,a._registerNode)(l),e.Factory.addGetterSetter(l,"innerRadius",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(l,"outerRadius",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(l,"angle",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(l,"clockwise",!1,(0,n.getBooleanValidator)()),Of}var xf={},Pf={},ly;function H5(){if(ly)return Pf;ly=1,Object.defineProperty(Pf,"__esModule",{value:!0}),Pf.Line=void 0;const e=Ft(),i=Nt(),t=wr(),n=Bt();function a(c,d,w,_,E,O,v){const S=Math.sqrt(Math.pow(w-c,2)+Math.pow(_-d,2)),p=Math.sqrt(Math.pow(E-w,2)+Math.pow(O-_,2)),h=v*S/(S+p),P=v*p/(S+p),g=w-h*(E-c),y=_-h*(O-d),b=w+P*(E-c),x=_+P*(O-d);return[g,y,b,x]}function l(c,d){const w=c.length,_=[];for(let E=2;E<w-2;E+=2){const O=a(c[E-2],c[E-1],c[E],c[E+1],c[E+2],c[E+3],d);isNaN(O[0])||(_.push(O[0]),_.push(O[1]),_.push(c[E]),_.push(c[E+1]),_.push(O[2]),_.push(O[3]))}return _}class s extends t.Shape{constructor(d){super(d),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(d){let w=this.points(),_=w.length,E=this.tension(),O=this.closed(),v=this.bezier(),S,p,h;if(_){if(d.beginPath(),d.moveTo(w[0],w[1]),E!==0&&_>4){for(S=this.getTensionPoints(),p=S.length,h=O?0:4,O||d.quadraticCurveTo(S[0],S[1],S[2],S[3]);h<p-2;)d.bezierCurveTo(S[h++],S[h++],S[h++],S[h++],S[h++],S[h++]);O||d.quadraticCurveTo(S[p-2],S[p-1],w[_-2],w[_-1])}else if(v)for(h=2;h<_;)d.bezierCurveTo(w[h++],w[h++],w[h++],w[h++],w[h++],w[h++]);else for(h=2;h<_;h+=2)d.lineTo(w[h],w[h+1]);O?(d.closePath(),d.fillStrokeShape(this)):d.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():l(this.points(),this.tension())}_getTensionPointsClosed(){const d=this.points(),w=d.length,_=this.tension(),E=a(d[w-2],d[w-1],d[0],d[1],d[2],d[3],_),O=a(d[w-4],d[w-3],d[w-2],d[w-1],d[0],d[1],_),v=l(d,_);return[E[2],E[3]].concat(v).concat([O[0],O[1],d[w-2],d[w-1],O[2],O[3],E[0],E[1],d[0],d[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let d=this.points();if(d.length<4)return{x:d[0]||0,y:d[1]||0,width:0,height:0};this.tension()!==0?d=[d[0],d[1],...this._getTensionPoints(),d[d.length-2],d[d.length-1]]:d=this.points();let w=d[0],_=d[0],E=d[1],O=d[1],v,S;for(let p=0;p<d.length/2;p++)v=d[p*2],S=d[p*2+1],w=Math.min(w,v),_=Math.max(_,v),E=Math.min(E,S),O=Math.max(O,S);return{x:w,y:E,width:_-w,height:O-E}}}return Pf.Line=s,s.prototype.className="Line",s.prototype._attrsAffectingSize=["points","bezier","tension"],(0,i._registerNode)(s),e.Factory.addGetterSetter(s,"closed",!1),e.Factory.addGetterSetter(s,"bezier",!1),e.Factory.addGetterSetter(s,"tension",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(s,"points",[],(0,n.getNumberArrayValidator)()),Pf}var Cf={},H0={},sy;function N8(){return sy||(sy=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 i=(s,c,d)=>{let w,_;const O=d/2;w=0;for(let v=0;v<20;v++)_=O*e.tValues[20][v]+O,w+=e.cValues[20][v]*n(s,c,_);return O*w};e.getCubicArcLength=i;const t=(s,c,d)=>{d===void 0&&(d=1);const w=s[0]-2*s[1]+s[2],_=c[0]-2*c[1]+c[2],E=2*s[1]-2*s[0],O=2*c[1]-2*c[0],v=4*(w*w+_*_),S=4*(w*E+_*O),p=E*E+O*O;if(v===0)return d*Math.sqrt(Math.pow(s[2]-s[0],2)+Math.pow(c[2]-c[0],2));const h=S/(2*v),P=p/v,g=d+h,y=P-h*h,b=g*g+y>0?Math.sqrt(g*g+y):0,x=h*h+y>0?Math.sqrt(h*h+y):0,M=h+Math.sqrt(h*h+y)!==0?y*Math.log(Math.abs((g+b)/(h+x))):0;return Math.sqrt(v)/2*(g*b-h*x+M)};e.getQuadraticArcLength=t;function n(s,c,d){const w=a(1,d,s),_=a(1,d,c),E=w*w+_*_;return Math.sqrt(E)}const a=(s,c,d)=>{const w=d.length-1;let _,E;if(w===0)return 0;if(s===0){E=0;for(let O=0;O<=w;O++)E+=e.binomialCoefficients[w][O]*Math.pow(1-c,w-O)*Math.pow(c,O)*d[O];return E}else{_=new Array(w);for(let O=0;O<w;O++)_[O]=w*(d[O+1]-d[O]);return a(s-1,c,_)}},l=(s,c,d)=>{let w=1,_=s/c,E=(s-d(_))/c,O=0;for(;w>.001;){const v=d(_+E),S=Math.abs(s-v)/c;if(S<w)w=S,_+=E;else{const p=d(_-E),h=Math.abs(s-p)/c;h<w?(w=h,_-=E):E/=2}if(O++,O>500)break}return _};e.t2length=l}(H0)),H0}var uy;function mv(){if(uy)return Cf;uy=1,Object.defineProperty(Cf,"__esModule",{value:!0}),Cf.Path=void 0;const e=Ft(),i=wr(),t=Nt(),n=N8();class a extends i.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 d=!1;for(let b=0;b<c.length;b++){const x=c[b].command,M=c[b].points;switch(x){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 w=M[0],_=M[1],E=M[2],O=M[3],v=M[4],S=M[5],p=M[6],h=M[7],P=E>O?E:O,g=E>O?1:E/O,y=E>O?O/E:1;s.translate(w,_),s.rotate(p),s.scale(g,y),s.arc(0,0,P,v,v+S,1-h),s.scale(1/g,1/y),s.rotate(-p),s.translate(-w,-_);break;case"z":d=!0,s.closePath();break}}!d&&!this.hasFill()?s.strokeShape(this):s.fillStrokeShape(this)}getSelfRect(){let s=[];this.dataArray.forEach(function(v){if(v.command==="A"){const S=v.points[4],p=v.points[5],h=v.points[4]+p;let P=Math.PI/180;if(Math.abs(S-h)<P&&(P=Math.abs(S-h)),p<0)for(let g=S-P;g>h;g-=P){const y=a.getPointOnEllipticalArc(v.points[0],v.points[1],v.points[2],v.points[3],g,0);s.push(y.x,y.y)}else for(let g=S+P;g<h;g+=P){const y=a.getPointOnEllipticalArc(v.points[0],v.points[1],v.points[2],v.points[3],g,0);s.push(y.x,y.y)}}else if(v.command==="C")for(let S=0;S<=1;S+=.01){const p=a.getPointOnCubicBezier(S,v.start.x,v.start.y,v.points[0],v.points[1],v.points[2],v.points[3],v.points[4],v.points[5]);s.push(p.x,p.y)}else s=s.concat(v.points)});let c=s[0],d=s[0],w=s[1],_=s[1],E,O;for(let v=0;v<s.length/2;v++)E=s[v*2],O=s[v*2+1],isNaN(E)||(c=Math.min(c,E),d=Math.max(d,E)),isNaN(O)||(w=Math.min(w,O),_=Math.max(_,O));return{x:c,y:w,width:d-c,height:_-w}}getLength(){return this.pathLength}getPointAtLength(s){return a.getPointAtLengthOfDataArray(s,this.dataArray)}static getLineLength(s,c,d,w){return Math.sqrt((d-s)*(d-s)+(w-c)*(w-c))}static getPathLength(s){let c=0;for(let d=0;d<s.length;++d)c+=s[d].pathLength;return c}static getPointAtLengthOfDataArray(s,c){let d,w=0,_=c.length;if(!_)return null;for(;w<_&&s>c[w].pathLength;)s-=c[w].pathLength,++w;if(w===_)return d=c[w-1].points.slice(-2),{x:d[0],y:d[1]};if(s<.01)return d=c[w].points.slice(0,2),{x:d[0],y:d[1]};const E=c[w],O=E.points;switch(E.command){case"L":return a.getPointOnLine(s,E.start.x,E.start.y,O[0],O[1]);case"C":return a.getPointOnCubicBezier((0,n.t2length)(s,a.getPathLength(c),b=>(0,n.getCubicArcLength)([E.start.x,O[0],O[2],O[4]],[E.start.y,O[1],O[3],O[5]],b)),E.start.x,E.start.y,O[0],O[1],O[2],O[3],O[4],O[5]);case"Q":return a.getPointOnQuadraticBezier((0,n.t2length)(s,a.getPathLength(c),b=>(0,n.getQuadraticArcLength)([E.start.x,O[0],O[2]],[E.start.y,O[1],O[3]],b)),E.start.x,E.start.y,O[0],O[1],O[2],O[3]);case"A":var v=O[0],S=O[1],p=O[2],h=O[3],P=O[4],g=O[5],y=O[6];return P+=g*s/E.pathLength,a.getPointOnEllipticalArc(v,S,p,h,P,y)}return null}static getPointOnLine(s,c,d,w,_,E,O){E=E??c,O=O??d;const v=this.getLineLength(c,d,w,_);if(v<1e-10)return{x:c,y:d};if(w===c)return{x:E,y:O+(_>d?s:-s)};const S=(_-d)/(w-c),p=Math.sqrt(s*s/(1+S*S))*(w<c?-1:1),h=S*p;if(Math.abs(O-d-S*(E-c))<1e-10)return{x:E+p,y:O+h};const P=((E-c)*(w-c)+(O-d)*(_-d))/(v*v),g=c+P*(w-c),y=d+P*(_-d),b=this.getLineLength(E,O,g,y),x=Math.sqrt(s*s-b*b),M=Math.sqrt(x*x/(1+S*S))*(w<c?-1:1),T=S*M;return{x:g+M,y:y+T}}static getPointOnCubicBezier(s,c,d,w,_,E,O,v,S){function p(x){return x*x*x}function h(x){return 3*x*x*(1-x)}function P(x){return 3*x*(1-x)*(1-x)}function g(x){return(1-x)*(1-x)*(1-x)}const y=v*p(s)+E*h(s)+w*P(s)+c*g(s),b=S*p(s)+O*h(s)+_*P(s)+d*g(s);return{x:y,y:b}}static getPointOnQuadraticBezier(s,c,d,w,_,E,O){function v(g){return g*g}function S(g){return 2*g*(1-g)}function p(g){return(1-g)*(1-g)}const h=E*v(s)+w*S(s)+c*p(s),P=O*v(s)+_*S(s)+d*p(s);return{x:h,y:P}}static getPointOnEllipticalArc(s,c,d,w,_,E){const O=Math.cos(E),v=Math.sin(E),S={x:d*Math.cos(_),y:w*Math.sin(_)};return{x:s+(S.x*O-S.y*v),y:c+(S.x*v+S.y*O)}}static parsePathData(s){if(!s)return[];let c=s;const d=["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 w=0;w<d.length;w++)c=c.replace(new RegExp(d[w],"g"),"|"+d[w]);const _=c.split("|"),E=[],O=[];let v=0,S=0;const p=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let h;for(w=1;w<_.length;w++){let k=_[w],R=k.charAt(0);for(k=k.slice(1),O.length=0;h=p.exec(k);)O.push(h[0]);const B=[];for(let X=0,Y=O.length;X<Y;X++){if(O[X]==="00"){B.push(0,0);continue}const Q=parseFloat(O[X]);isNaN(Q)?B.push(0):B.push(Q)}for(;B.length>0&&!isNaN(B[0]);){let X="",Y=[];const Q=v,q=S;var P,g,y,b,x,M,T,j,I,m;switch(R){case"l":v+=B.shift(),S+=B.shift(),X="L",Y.push(v,S);break;case"L":v=B.shift(),S=B.shift(),Y.push(v,S);break;case"m":var A=B.shift(),L=B.shift();if(v+=A,S+=L,X="M",E.length>2&&E[E.length-1].command==="z"){for(let z=E.length-2;z>=0;z--)if(E[z].command==="M"){v=E[z].points[0]+A,S=E[z].points[1]+L;break}}Y.push(v,S),R="l";break;case"M":v=B.shift(),S=B.shift(),X="M",Y.push(v,S),R="L";break;case"h":v+=B.shift(),X="L",Y.push(v,S);break;case"H":v=B.shift(),X="L",Y.push(v,S);break;case"v":S+=B.shift(),X="L",Y.push(v,S);break;case"V":S=B.shift(),X="L",Y.push(v,S);break;case"C":Y.push(B.shift(),B.shift(),B.shift(),B.shift()),v=B.shift(),S=B.shift(),Y.push(v,S);break;case"c":Y.push(v+B.shift(),S+B.shift(),v+B.shift(),S+B.shift()),v+=B.shift(),S+=B.shift(),X="C",Y.push(v,S);break;case"S":g=v,y=S,P=E[E.length-1],P.command==="C"&&(g=v+(v-P.points[2]),y=S+(S-P.points[3])),Y.push(g,y,B.shift(),B.shift()),v=B.shift(),S=B.shift(),X="C",Y.push(v,S);break;case"s":g=v,y=S,P=E[E.length-1],P.command==="C"&&(g=v+(v-P.points[2]),y=S+(S-P.points[3])),Y.push(g,y,v+B.shift(),S+B.shift()),v+=B.shift(),S+=B.shift(),X="C",Y.push(v,S);break;case"Q":Y.push(B.shift(),B.shift()),v=B.shift(),S=B.shift(),Y.push(v,S);break;case"q":Y.push(v+B.shift(),S+B.shift()),v+=B.shift(),S+=B.shift(),X="Q",Y.push(v,S);break;case"T":g=v,y=S,P=E[E.length-1],P.command==="Q"&&(g=v+(v-P.points[0]),y=S+(S-P.points[1])),v=B.shift(),S=B.shift(),X="Q",Y.push(g,y,v,S);break;case"t":g=v,y=S,P=E[E.length-1],P.command==="Q"&&(g=v+(v-P.points[0]),y=S+(S-P.points[1])),v+=B.shift(),S+=B.shift(),X="Q",Y.push(g,y,v,S);break;case"A":b=B.shift(),x=B.shift(),M=B.shift(),T=B.shift(),j=B.shift(),I=v,m=S,v=B.shift(),S=B.shift(),X="A",Y=this.convertEndpointToCenterParameterization(I,m,v,S,T,j,b,x,M);break;case"a":b=B.shift(),x=B.shift(),M=B.shift(),T=B.shift(),j=B.shift(),I=v,m=S,v+=B.shift(),S+=B.shift(),X="A",Y=this.convertEndpointToCenterParameterization(I,m,v,S,T,j,b,x,M);break}E.push({command:X||R,points:Y,start:{x:Q,y:q},pathLength:this.calcLength(Q,q,X||R,Y)})}(R==="z"||R==="Z")&&E.push({command:"z",points:[],start:void 0,pathLength:0})}return E}static calcLength(s,c,d,w){let _,E,O,v;const S=a;switch(d){case"L":return S.getLineLength(s,c,w[0],w[1]);case"C":return(0,n.getCubicArcLength)([s,w[0],w[2],w[4]],[c,w[1],w[3],w[5]],1);case"Q":return(0,n.getQuadraticArcLength)([s,w[0],w[2]],[c,w[1],w[3]],1);case"A":_=0;var p=w[4],h=w[5],P=w[4]+h,g=Math.PI/180;if(Math.abs(p-P)<g&&(g=Math.abs(p-P)),E=S.getPointOnEllipticalArc(w[0],w[1],w[2],w[3],p,0),h<0)for(v=p-g;v>P;v-=g)O=S.getPointOnEllipticalArc(w[0],w[1],w[2],w[3],v,0),_+=S.getLineLength(E.x,E.y,O.x,O.y),E=O;else for(v=p+g;v<P;v+=g)O=S.getPointOnEllipticalArc(w[0],w[1],w[2],w[3],v,0),_+=S.getLineLength(E.x,E.y,O.x,O.y),E=O;return O=S.getPointOnEllipticalArc(w[0],w[1],w[2],w[3],P,0),_+=S.getLineLength(E.x,E.y,O.x,O.y),_}return 0}static convertEndpointToCenterParameterization(s,c,d,w,_,E,O,v,S){const p=S*(Math.PI/180),h=Math.cos(p)*(s-d)/2+Math.sin(p)*(c-w)/2,P=-1*Math.sin(p)*(s-d)/2+Math.cos(p)*(c-w)/2,g=h*h/(O*O)+P*P/(v*v);g>1&&(O*=Math.sqrt(g),v*=Math.sqrt(g));let y=Math.sqrt((O*O*(v*v)-O*O*(P*P)-v*v*(h*h))/(O*O*(P*P)+v*v*(h*h)));_===E&&(y*=-1),isNaN(y)&&(y=0);const b=y*O*P/v,x=y*-v*h/O,M=(s+d)/2+Math.cos(p)*b-Math.sin(p)*x,T=(c+w)/2+Math.sin(p)*b+Math.cos(p)*x,j=function(B){return Math.sqrt(B[0]*B[0]+B[1]*B[1])},I=function(B,X){return(B[0]*X[0]+B[1]*X[1])/(j(B)*j(X))},m=function(B,X){return(B[0]*X[1]<B[1]*X[0]?-1:1)*Math.acos(I(B,X))},A=m([1,0],[(h-b)/O,(P-x)/v]),L=[(h-b)/O,(P-x)/v],k=[(-1*h-b)/O,(-1*P-x)/v];let R=m(L,k);return I(L,k)<=-1&&(R=Math.PI),I(L,k)>=1&&(R=0),E===0&&R>0&&(R=R-2*Math.PI),E===1&&R<0&&(R=R+2*Math.PI),[M,T,O,v,A,R,p,E]}}return Cf.Path=a,a.prototype.className="Path",a.prototype._attrsAffectingSize=["data"],(0,t._registerNode)(a),e.Factory.addGetterSetter(a,"data"),Cf}var cy;function I8(){if(cy)return xf;cy=1,Object.defineProperty(xf,"__esModule",{value:!0}),xf.Arrow=void 0;const e=Ft(),i=H5(),t=Bt(),n=Nt(),a=mv();class l extends i.Line{_sceneFunc(c){super._sceneFunc(c);const d=Math.PI*2,w=this.points();let _=w;const E=this.tension()!==0&&w.length>4;E&&(_=this.getTensionPoints());const O=this.pointerLength(),v=w.length;let S,p;if(E){const g=[_[_.length-4],_[_.length-3],_[_.length-2],_[_.length-1],w[v-2],w[v-1]],y=a.Path.calcLength(_[_.length-4],_[_.length-3],"C",g),b=a.Path.getPointOnQuadraticBezier(Math.min(1,1-O/y),g[0],g[1],g[2],g[3],g[4],g[5]);S=w[v-2]-b.x,p=w[v-1]-b.y}else S=w[v-2]-w[v-4],p=w[v-1]-w[v-3];const h=(Math.atan2(p,S)+d)%d,P=this.pointerWidth();this.pointerAtEnding()&&(c.save(),c.beginPath(),c.translate(w[v-2],w[v-1]),c.rotate(h),c.moveTo(0,0),c.lineTo(-O,P/2),c.lineTo(-O,-P/2),c.closePath(),c.restore(),this.__fillStroke(c)),this.pointerAtBeginning()&&(c.save(),c.beginPath(),c.translate(w[0],w[1]),E?(S=(_[0]+_[2])/2-w[0],p=(_[1]+_[3])/2-w[1]):(S=w[2]-w[0],p=w[3]-w[1]),c.rotate((Math.atan2(-p,-S)+d)%d),c.moveTo(0,0),c.lineTo(-O,P/2),c.lineTo(-O,-P/2),c.closePath(),c.restore(),this.__fillStroke(c))}__fillStroke(c){const d=this.dashEnabled();d&&(this.attrs.dashEnabled=!1,c.setLineDash([])),c.fillStrokeShape(this),d&&(this.attrs.dashEnabled=!0)}getSelfRect(){const c=super.getSelfRect(),d=this.pointerWidth()/2;return{x:c.x,y:c.y-d,width:c.width,height:c.height+d*2}}}return xf.Arrow=l,l.prototype.className="Arrow",(0,n._registerNode)(l),e.Factory.addGetterSetter(l,"pointerLength",10,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(l,"pointerWidth",10,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(l,"pointerAtBeginning",!1),e.Factory.addGetterSetter(l,"pointerAtEnding",!0),xf}var kf={},fy;function D8(){if(fy)return kf;fy=1,Object.defineProperty(kf,"__esModule",{value:!0}),kf.Circle=void 0;const e=Ft(),i=wr(),t=Bt(),n=Nt();class a extends i.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 kf.Circle=a,a.prototype._centroid=!0,a.prototype.className="Circle",a.prototype._attrsAffectingSize=["radius"],(0,n._registerNode)(a),e.Factory.addGetterSetter(a,"radius",0,(0,t.getNumberValidator)()),kf}var Af={},dy;function j8(){if(dy)return Af;dy=1,Object.defineProperty(Af,"__esModule",{value:!0}),Af.Ellipse=void 0;const e=Ft(),i=wr(),t=Bt(),n=Nt();class a extends i.Shape{_sceneFunc(s){const c=this.radiusX(),d=this.radiusY();s.beginPath(),s.save(),c!==d&&s.scale(1,d/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 Af.Ellipse=a,a.prototype.className="Ellipse",a.prototype._centroid=!0,a.prototype._attrsAffectingSize=["radiusX","radiusY"],(0,n._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)()),Af}var Tf={},hy;function F8(){if(hy)return Tf;hy=1,Object.defineProperty(Tf,"__esModule",{value:!0}),Tf.Image=void 0;const e=In(),i=Ft(),t=wr(),n=Nt(),a=Bt();class l extends t.Shape{constructor(c){super(c),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const c=this.image();c&&c.complete||c&&c.readyState===4||c&&c.addEventListener&&c.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){const c=!!this.cornerRadius(),d=this.hasShadow();return c&&d?!0:super._useBufferCanvas(!0)}_sceneFunc(c){const d=this.getWidth(),w=this.getHeight(),_=this.cornerRadius(),E=this.attrs.image;let O;if(E){const v=this.attrs.cropWidth,S=this.attrs.cropHeight;v&&S?O=[E,this.cropX(),this.cropY(),v,S,0,0,d,w]:O=[E,0,0,d,w]}(this.hasFill()||this.hasStroke()||_)&&(c.beginPath(),_?e.Util.drawRoundedRectPath(c,d,w,_):c.rect(0,0,d,w),c.closePath(),c.fillStrokeShape(this)),E&&(_&&c.clip(),c.drawImage.apply(c,O))}_hitFunc(c){const d=this.width(),w=this.height(),_=this.cornerRadius();c.beginPath(),_?e.Util.drawRoundedRectPath(c,d,w,_):c.rect(0,0,d,w),c.closePath(),c.fillStrokeShape(this)}getWidth(){var c,d;return(c=this.attrs.width)!==null&&c!==void 0?c:(d=this.image())===null||d===void 0?void 0:d.width}getHeight(){var c,d;return(c=this.attrs.height)!==null&&c!==void 0?c:(d=this.image())===null||d===void 0?void 0:d.height}static fromURL(c,d,w=null){const _=e.Util.createImageElement();_.onload=function(){const E=new l({image:_});d(E)},_.onerror=w,_.crossOrigin="Anonymous",_.src=c}}return Tf.Image=l,l.prototype.className="Image",(0,n._registerNode)(l),i.Factory.addGetterSetter(l,"cornerRadius",0,(0,a.getNumberOrArrayOfNumbersValidator)(4)),i.Factory.addGetterSetter(l,"image"),i.Factory.addComponentsGetterSetter(l,"crop",["x","y","width","height"]),i.Factory.addGetterSetter(l,"cropX",0,(0,a.getNumberValidator)()),i.Factory.addGetterSetter(l,"cropY",0,(0,a.getNumberValidator)()),i.Factory.addGetterSetter(l,"cropWidth",0,(0,a.getNumberValidator)()),i.Factory.addGetterSetter(l,"cropHeight",0,(0,a.getNumberValidator)()),Tf}var Ds={},py;function z8(){if(py)return Ds;py=1,Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.Tag=Ds.Label=void 0;const e=Ft(),i=wr(),t=gv(),n=Bt(),a=Nt(),l=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],s="Change.konva",c="none",d="up",w="right",_="down",E="left",O=l.length;class v extends t.Group{constructor(h){super(h),this.on("add.konva",function(P){this._addListeners(P.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(h){let P=this,g;const y=function(){P._sync()};for(g=0;g<O;g++)h.on(l[g]+s,y)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let h=this.getText(),P=this.getTag(),g,y,b,x,M,T,j;if(h&&P){switch(g=h.width(),y=h.height(),b=P.pointerDirection(),x=P.pointerWidth(),j=P.pointerHeight(),M=0,T=0,b){case d:M=g/2,T=-1*j;break;case w:M=g+x,T=y/2;break;case _:M=g/2,T=y+j;break;case E:M=-1*x,T=y/2;break}P.setAttrs({x:-1*M,y:-1*T,width:g,height:y}),h.setAttrs({x:-1*M,y:-1*T})}}}Ds.Label=v,v.prototype.className="Label",(0,a._registerNode)(v);class S extends i.Shape{_sceneFunc(h){const P=this.width(),g=this.height(),y=this.pointerDirection(),b=this.pointerWidth(),x=this.pointerHeight(),M=this.cornerRadius();let T=0,j=0,I=0,m=0;typeof M=="number"?T=j=I=m=Math.min(M,P/2,g/2):(T=Math.min(M[0]||0,P/2,g/2),j=Math.min(M[1]||0,P/2,g/2),m=Math.min(M[2]||0,P/2,g/2),I=Math.min(M[3]||0,P/2,g/2)),h.beginPath(),h.moveTo(T,0),y===d&&(h.lineTo((P-b)/2,0),h.lineTo(P/2,-1*x),h.lineTo((P+b)/2,0)),h.lineTo(P-j,0),h.arc(P-j,j,j,Math.PI*3/2,0,!1),y===w&&(h.lineTo(P,(g-x)/2),h.lineTo(P+b,g/2),h.lineTo(P,(g+x)/2)),h.lineTo(P,g-m),h.arc(P-m,g-m,m,0,Math.PI/2,!1),y===_&&(h.lineTo((P+b)/2,g),h.lineTo(P/2,g+x),h.lineTo((P-b)/2,g)),h.lineTo(I,g),h.arc(I,g-I,I,Math.PI/2,Math.PI,!1),y===E&&(h.lineTo(0,(g+x)/2),h.lineTo(-1*b,g/2),h.lineTo(0,(g-x)/2)),h.lineTo(0,T),h.arc(T,T,T,Math.PI,Math.PI*3/2,!1),h.closePath(),h.fillStrokeShape(this)}getSelfRect(){let h=0,P=0,g=this.pointerWidth(),y=this.pointerHeight(),b=this.pointerDirection(),x=this.width(),M=this.height();return b===d?(P-=y,M+=y):b===_?M+=y:b===E?(h-=g*1.5,x+=g):b===w&&(x+=g*1.5),{x:h,y:P,width:x,height:M}}}return Ds.Tag=S,S.prototype.className="Tag",(0,a._registerNode)(S),e.Factory.addGetterSetter(S,"pointerDirection",c),e.Factory.addGetterSetter(S,"pointerWidth",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(S,"pointerHeight",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(S,"cornerRadius",0,(0,n.getNumberOrArrayOfNumbersValidator)(4)),Ds}var Rf={},gy;function G5(){if(gy)return Rf;gy=1,Object.defineProperty(Rf,"__esModule",{value:!0}),Rf.Rect=void 0;const e=Ft(),i=wr(),t=Nt(),n=In(),a=Bt();class l extends i.Shape{_sceneFunc(c){const d=this.cornerRadius(),w=this.width(),_=this.height();c.beginPath(),d?n.Util.drawRoundedRectPath(c,w,_,d):c.rect(0,0,w,_),c.closePath(),c.fillStrokeShape(this)}}return Rf.Rect=l,l.prototype.className="Rect",(0,t._registerNode)(l),e.Factory.addGetterSetter(l,"cornerRadius",0,(0,a.getNumberOrArrayOfNumbersValidator)(4)),Rf}var Mf={},vy;function B8(){if(vy)return Mf;vy=1,Object.defineProperty(Mf,"__esModule",{value:!0}),Mf.RegularPolygon=void 0;const e=Ft(),i=wr(),t=Bt(),n=Nt();class a extends i.Shape{_sceneFunc(s){const c=this._getPoints();s.beginPath(),s.moveTo(c[0].x,c[0].y);for(let d=1;d<c.length;d++)s.lineTo(c[d].x,c[d].y);s.closePath(),s.fillStrokeShape(this)}_getPoints(){const s=this.attrs.sides,c=this.attrs.radius||0,d=[];for(let w=0;w<s;w++)d.push({x:c*Math.sin(w*2*Math.PI/s),y:-1*c*Math.cos(w*2*Math.PI/s)});return d}getSelfRect(){const s=this._getPoints();let c=s[0].x,d=s[0].y,w=s[0].x,_=s[0].y;return s.forEach(E=>{c=Math.min(c,E.x),d=Math.max(d,E.x),w=Math.min(w,E.y),_=Math.max(_,E.y)}),{x:c,y:w,width:d-c,height:_-w}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(s){this.radius(s/2)}setHeight(s){this.radius(s/2)}}return Mf.RegularPolygon=a,a.prototype.className="RegularPolygon",a.prototype._centroid=!0,a.prototype._attrsAffectingSize=["radius"],(0,n._registerNode)(a),e.Factory.addGetterSetter(a,"radius",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(a,"sides",0,(0,t.getNumberValidator)()),Mf}var Lf={},my;function U8(){if(my)return Lf;my=1,Object.defineProperty(Lf,"__esModule",{value:!0}),Lf.Ring=void 0;const e=Ft(),i=wr(),t=Bt(),n=Nt(),a=Math.PI*2;class l extends i.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 Lf.Ring=l,l.prototype.className="Ring",l.prototype._centroid=!0,l.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,n._registerNode)(l),e.Factory.addGetterSetter(l,"innerRadius",0,(0,t.getNumberValidator)()),e.Factory.addGetterSetter(l,"outerRadius",0,(0,t.getNumberValidator)()),Lf}var Nf={},yy;function q8(){if(yy)return Nf;yy=1,Object.defineProperty(Nf,"__esModule",{value:!0}),Nf.Sprite=void 0;const e=Ft(),i=wr(),t=vv(),n=Bt(),a=Nt();class l extends i.Shape{constructor(c){super(c),this._updated=!0,this.anim=new t.Animation(()=>{const d=this._updated;return this._updated=!1,d}),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 d=this.animation(),w=this.frameIndex(),_=w*4,E=this.animations()[d],O=this.frameOffsets(),v=E[_+0],S=E[_+1],p=E[_+2],h=E[_+3],P=this.image();if((this.hasFill()||this.hasStroke())&&(c.beginPath(),c.rect(0,0,p,h),c.closePath(),c.fillStrokeShape(this)),P)if(O){const g=O[d],y=w*2;c.drawImage(P,v,S,p,h,g[y+0],g[y+1],p,h)}else c.drawImage(P,v,S,p,h,0,0,p,h)}_hitFunc(c){const d=this.animation(),w=this.frameIndex(),_=w*4,E=this.animations()[d],O=this.frameOffsets(),v=E[_+2],S=E[_+3];if(c.beginPath(),O){const p=O[d],h=w*2;c.rect(p[h+0],p[h+1],v,S)}else c.rect(0,0,v,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(),d=this.animation(),w=this.animations(),_=w[d],E=_.length/4;c<E-1?this.frameIndex(c+1):this.frameIndex(0)}}return Nf.Sprite=l,l.prototype.className="Sprite",(0,a._registerNode)(l),e.Factory.addGetterSetter(l,"animation"),e.Factory.addGetterSetter(l,"animations"),e.Factory.addGetterSetter(l,"frameOffsets"),e.Factory.addGetterSetter(l,"image"),e.Factory.addGetterSetter(l,"frameIndex",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(l,"frameRate",17,(0,n.getNumberValidator)()),e.Factory.backCompat(l,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"}),Nf}var If={},by;function H8(){if(by)return If;by=1,Object.defineProperty(If,"__esModule",{value:!0}),If.Star=void 0;const e=Ft(),i=wr(),t=Bt(),n=Nt();class a extends i.Shape{_sceneFunc(s){const c=this.innerRadius(),d=this.outerRadius(),w=this.numPoints();s.beginPath(),s.moveTo(0,0-d);for(let _=1;_<w*2;_++){const E=_%2===0?d:c,O=E*Math.sin(_*Math.PI/w),v=-1*E*Math.cos(_*Math.PI/w);s.lineTo(O,v)}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 If.Star=a,a.prototype.className="Star",a.prototype._centroid=!0,a.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,n._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)()),If}var Xu={},_y;function V5(){if(_y)return Xu;_y=1,Object.defineProperty(Xu,"__esModule",{value:!0}),Xu.Text=void 0,Xu.stringToArray=s;const e=In(),i=Ft(),t=wr(),n=Nt(),a=Bt(),l=Nt();function s(U){return[...U].reduce(($,ee,G,Z)=>{if(new RegExp("\\p{Emoji}","u").test(ee)){const W=Z[G+1];W&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(W)?($.push(ee+W),Z[G+1]=""):$.push(ee)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(ee+(Z[G+1]||""))?$.push(ee+Z[G+1]):G>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(ee)?$[$.length-1]+=ee:ee&&$.push(ee);return $},[])}const c="auto",d="center",w="inherit",_="justify",E="Change.konva",O="2d",v="-",S="left",p="text",h="Text",P="top",g="bottom",y="middle",b="normal",x="px ",M=" ",T="right",j="rtl",I="word",m="char",A="none",L="…",k=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],R=k.length;function B(U){return U.split(",").map($=>{$=$.trim();const ee=$.indexOf(" ")>=0,G=$.indexOf('"')>=0||$.indexOf("'")>=0;return ee&&!G&&($=`"${$}"`),$}).join(", ")}let X;function Y(){return X||(X=e.Util.createCanvasElement().getContext(O),X)}function Q(U){U.fillText(this._partialText,this._partialTextX,this._partialTextY)}function q(U){U.setAttr("miterLimit",2),U.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function z(U){return U=U||{},!U.fillLinearGradientColorStops&&!U.fillRadialGradientColorStops&&!U.fillPatternImage&&(U.fill=U.fill||"black"),U}class N extends t.Shape{constructor($){super(z($)),this._partialTextX=0,this._partialTextY=0;for(let ee=0;ee<R;ee++)this.on(k[ee]+E,this._setTextData);this._setTextData()}_sceneFunc($){const ee=this.textArr,G=ee.length;if(!this.text())return;let Z=this.padding(),W=this.fontSize(),te=this.lineHeight()*W,re=this.verticalAlign(),ie=this.direction(),ae=0,se=this.align(),de=this.getWidth(),he=this.letterSpacing(),Oe=this.fill(),_e=this.textDecoration(),Ae=_e.indexOf("underline")!==-1,ce=_e.indexOf("line-through")!==-1,pe;ie=ie===w?$.direction:ie;let Ce=te/2,Le=y;if(n.Konva._fixTextRendering){const ze=this.measureSize("M");Le="alphabetic",Ce=(ze.fontBoundingBoxAscent-ze.fontBoundingBoxDescent)/2+te/2}var ue=0,ve=0;for(ie===j&&$.setAttr("direction",ie),$.setAttr("font",this._getContextFont()),$.setAttr("textBaseline",Le),$.setAttr("textAlign",S),re===y?ae=(this.getHeight()-G*te-Z*2)/2:re===g&&(ae=this.getHeight()-G*te-Z*2),$.translate(Z,ae+Z),pe=0;pe<G;pe++){var ue=0,ve=0,xe=ee[pe],je=xe.text,at=xe.width,ht=xe.lastInParagraph,et,Ke;if($.save(),se===T?ue+=de-at-Z*2:se===d&&(ue+=(de-at-Z*2)/2),Ae){$.save(),$.beginPath();const Ve=n.Konva._fixTextRendering?Math.round(W/4):Math.round(W/2),bt=ue,Ct=Ce+ve+Ve;$.moveTo(bt,Ct),et=je.split(" ").length-1,Ke=se===_&&!ht?de-Z*2:at,$.lineTo(bt+Math.round(Ke),Ct),$.lineWidth=W/15;const we=this._getLinearGradient();$.strokeStyle=we||Oe,$.stroke(),$.restore()}if(ce){$.save(),$.beginPath();const Ve=n.Konva._fixTextRendering?-Math.round(W/4):0;$.moveTo(ue,Ce+ve+Ve),et=je.split(" ").length-1,Ke=se===_&&!ht?de-Z*2:at,$.lineTo(ue+Math.round(Ke),Ce+ve+Ve),$.lineWidth=W/15;const bt=this._getLinearGradient();$.strokeStyle=bt||Oe,$.stroke(),$.restore()}if(ie!==j&&(he!==0||se===_)){et=je.split(" ").length-1;const Ve=s(je);for(let bt=0;bt<Ve.length;bt++){const Ct=Ve[bt];Ct===" "&&!ht&&se===_&&(ue+=(de-Z*2-at)/et),this._partialTextX=ue,this._partialTextY=Ce+ve,this._partialText=Ct,$.fillStrokeShape(this),ue+=this.measureSize(Ct).width+he}}else he!==0&&$.setAttr("letterSpacing",`${he}px`),this._partialTextX=ue,this._partialTextY=Ce+ve,this._partialText=je,$.fillStrokeShape(this);$.restore(),G>1&&(Ce+=te)}}_hitFunc($){const ee=this.getWidth(),G=this.getHeight();$.beginPath(),$.rect(0,0,ee,G),$.closePath(),$.fillStrokeShape(this)}setText($){const ee=e.Util._isString($)?$:$==null?"":$+"";return this._setAttr(p,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($){var ee,G,Z,W,te,re,ie,ae,se,de,he;let Oe=Y(),_e=this.fontSize(),Ae;Oe.save(),Oe.font=this._getContextFont(),Ae=Oe.measureText($),Oe.restore();const ce=_e/100;return{actualBoundingBoxAscent:(ee=Ae.actualBoundingBoxAscent)!==null&&ee!==void 0?ee:71.58203125*ce,actualBoundingBoxDescent:(G=Ae.actualBoundingBoxDescent)!==null&&G!==void 0?G:0,actualBoundingBoxLeft:(Z=Ae.actualBoundingBoxLeft)!==null&&Z!==void 0?Z:-7.421875*ce,actualBoundingBoxRight:(W=Ae.actualBoundingBoxRight)!==null&&W!==void 0?W:75.732421875*ce,alphabeticBaseline:(te=Ae.alphabeticBaseline)!==null&&te!==void 0?te:0,emHeightAscent:(re=Ae.emHeightAscent)!==null&&re!==void 0?re:100*ce,emHeightDescent:(ie=Ae.emHeightDescent)!==null&&ie!==void 0?ie:-20*ce,fontBoundingBoxAscent:(ae=Ae.fontBoundingBoxAscent)!==null&&ae!==void 0?ae:91*ce,fontBoundingBoxDescent:(se=Ae.fontBoundingBoxDescent)!==null&&se!==void 0?se:21*ce,hangingBaseline:(de=Ae.hangingBaseline)!==null&&de!==void 0?de:72.80000305175781*ce,ideographicBaseline:(he=Ae.ideographicBaseline)!==null&&he!==void 0?he:-21*ce,width:Ae.width,height:_e}}_getContextFont(){return this.fontStyle()+M+this.fontVariant()+M+(this.fontSize()+x)+B(this.fontFamily())}_addTextLine($){this.align()===_&&($=$.trim());const G=this._getTextWidth($);return this.textArr.push({text:$,width:G,lastInParagraph:!1})}_getTextWidth($){const ee=this.letterSpacing(),G=$.length;return Y().measureText($).width+ee*G}_setTextData(){let $=this.text().split(`
43
- `),ee=+this.fontSize(),G=0,Z=this.lineHeight()*ee,W=this.attrs.width,te=this.attrs.height,re=W!==c&&W!==void 0,ie=te!==c&&te!==void 0,ae=this.padding(),se=W-ae*2,de=te-ae*2,he=0,Oe=this.wrap(),_e=Oe!==A,Ae=Oe!==m&&_e,ce=this.ellipsis();this.textArr=[],Y().font=this._getContextFont();const pe=ce?this._getTextWidth(L):0;for(let Ce=0,Le=$.length;Ce<Le;++Ce){let ue=$[Ce],ve=this._getTextWidth(ue);if(re&&ve>se)for(;ue.length>0;){let xe=0,je=s(ue).length,at="",ht=0;for(;xe<je;){const et=xe+je>>>1,Ke=s(ue),ze=Ke.slice(0,et+1).join(""),Be=this._getTextWidth(ze)+pe;Be<=se?(xe=et+1,at=ze,ht=Be):je=et}if(at){if(Ae){const ze=s(ue),Be=s(at),Ve=ze[Be.length],bt=Ve===M||Ve===v;let Ct;if(bt&&ht<=se)Ct=Be.length;else{const we=Be.lastIndexOf(M),Se=Be.lastIndexOf(v);Ct=Math.max(we,Se)+1}Ct>0&&(xe=Ct,at=ze.slice(0,xe).join(""),ht=this._getTextWidth(at))}if(at=at.trimRight(),this._addTextLine(at),G=Math.max(G,ht),he+=Z,this._shouldHandleEllipsis(he)){this._tryToAddEllipsisToLastLine();break}if(ue=s(ue).slice(xe).join("").trimLeft(),ue.length>0&&(ve=this._getTextWidth(ue),ve<=se)){this._addTextLine(ue),he+=Z,G=Math.max(G,ve);break}}else break}else this._addTextLine(ue),he+=Z,G=Math.max(G,ve),this._shouldHandleEllipsis(he)&&Ce<Le-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),ie&&he+Z>de)break}this.textHeight=ee,this.textWidth=G}_shouldHandleEllipsis($){const ee=+this.fontSize(),G=this.lineHeight()*ee,Z=this.attrs.height,W=Z!==c&&Z!==void 0,te=this.padding(),re=Z-te*2;return!(this.wrap()!==A)||W&&$+G>re}_tryToAddEllipsisToLastLine(){const $=this.attrs.width,ee=$!==c&&$!==void 0,G=this.padding(),Z=$-G*2,W=this.ellipsis(),te=this.textArr[this.textArr.length-1];!te||!W||(ee&&(this._getTextWidth(te.text+L)<Z||(te.text=te.text.slice(0,te.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(te.text+L))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const $=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,ee=this.hasShadow();return $&&ee?!0:super._useBufferCanvas()}}return Xu.Text=N,N.prototype._fillFunc=Q,N.prototype._strokeFunc=q,N.prototype.className=h,N.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"],(0,l._registerNode)(N),i.Factory.overWriteSetter(N,"width",(0,a.getNumberOrAutoValidator)()),i.Factory.overWriteSetter(N,"height",(0,a.getNumberOrAutoValidator)()),i.Factory.addGetterSetter(N,"direction",w),i.Factory.addGetterSetter(N,"fontFamily","Arial"),i.Factory.addGetterSetter(N,"fontSize",12,(0,a.getNumberValidator)()),i.Factory.addGetterSetter(N,"fontStyle",b),i.Factory.addGetterSetter(N,"fontVariant",b),i.Factory.addGetterSetter(N,"padding",0,(0,a.getNumberValidator)()),i.Factory.addGetterSetter(N,"align",S),i.Factory.addGetterSetter(N,"verticalAlign",P),i.Factory.addGetterSetter(N,"lineHeight",1,(0,a.getNumberValidator)()),i.Factory.addGetterSetter(N,"wrap",I),i.Factory.addGetterSetter(N,"ellipsis",!1,(0,a.getBooleanValidator)()),i.Factory.addGetterSetter(N,"letterSpacing",0,(0,a.getNumberValidator)()),i.Factory.addGetterSetter(N,"text","",(0,a.getStringValidator)()),i.Factory.addGetterSetter(N,"textDecoration",""),Xu}var Df={},wy;function G8(){if(wy)return Df;wy=1,Object.defineProperty(Df,"__esModule",{value:!0}),Df.TextPath=void 0;const e=In(),i=Ft(),t=wr(),n=mv(),a=V5(),l=Bt(),s=Nt(),c="",d="normal";function w(O){O.fillText(this.partialText,0,0)}function _(O){O.strokeText(this.partialText,0,0)}class E extends t.Shape{constructor(v){super(v),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 n.Path.getPathLength(this.dataArray)}_getPointAtLength(v){if(!this.attrs.data)return null;const S=this.pathLength;return v-1>S?null:n.Path.getPointAtLengthOfDataArray(v,this.dataArray)}_readDataAttribute(){this.dataArray=n.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(v){v.setAttr("font",this._getContextFont()),v.setAttr("textBaseline",this.textBaseline()),v.setAttr("textAlign","left"),v.save();const S=this.textDecoration(),p=this.fill(),h=this.fontSize(),P=this.glyphInfo;S==="underline"&&v.beginPath();for(let g=0;g<P.length;g++){v.save();const y=P[g].p0;v.translate(y.x,y.y),v.rotate(P[g].rotation),this.partialText=P[g].text,v.fillStrokeShape(this),S==="underline"&&(g===0&&v.moveTo(0,h/2+1),v.lineTo(h,h/2+1)),v.restore()}S==="underline"&&(v.strokeStyle=p,v.lineWidth=h/20,v.stroke()),v.restore()}_hitFunc(v){v.beginPath();const S=this.glyphInfo;if(S.length>=1){const p=S[0].p0;v.moveTo(p.x,p.y)}for(let p=0;p<S.length;p++){const h=S[p].p1;v.lineTo(h.x,h.y)}v.setAttr("lineWidth",this.fontSize()),v.setAttr("strokeStyle",this.colorKey),v.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(v){return a.Text.prototype.setText.call(this,v)}_getContextFont(){return a.Text.prototype._getContextFont.call(this)}_getTextSize(v){const p=this.dummyCanvas.getContext("2d");p.save(),p.font=this._getContextFont();const h=p.measureText(v);return p.restore(),{width:h.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:v,height:S}=this._getTextSize(this.attrs.text);if(this.textWidth=v,this.textHeight=S,this.glyphInfo=[],!this.attrs.data)return null;const p=this.letterSpacing(),h=this.align(),P=this.kerningFunc(),g=Math.max(this.textWidth+((this.attrs.text||"").length-1)*p,0);let y=0;h==="center"&&(y=Math.max(0,this.pathLength/2-g/2)),h==="right"&&(y=Math.max(0,this.pathLength-g));const b=(0,a.stringToArray)(this.text());let x=y;for(let M=0;M<b.length;M++){const T=this._getPointAtLength(x);if(!T)return;let j=this._getTextSize(b[M]).width+p;if(b[M]===" "&&h==="justify"){const R=this.text().split(" ").length-1;j+=(this.pathLength-g)/R}const I=this._getPointAtLength(x+j);if(!I)return;const m=n.Path.getLineLength(T.x,T.y,I.x,I.y);let A=0;if(P)try{A=P(b[M-1],b[M])*this.fontSize()}catch{A=0}T.x+=A,I.x+=A,this.textWidth+=A;const L=n.Path.getPointOnLine(A+m/2,T.x,T.y,I.x,I.y),k=Math.atan2(I.y-T.y,I.x-T.x);this.glyphInfo.push({transposeX:L.x,transposeY:L.y,text:b[M],rotation:k,p0:T,p1:I}),x+=j}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const v=[];this.glyphInfo.forEach(function(x){v.push(x.p0.x),v.push(x.p0.y),v.push(x.p1.x),v.push(x.p1.y)});let S=v[0]||0,p=v[0]||0,h=v[1]||0,P=v[1]||0,g,y;for(let x=0;x<v.length/2;x++)g=v[x*2],y=v[x*2+1],S=Math.min(S,g),p=Math.max(p,g),h=Math.min(h,y),P=Math.max(P,y);const b=this.fontSize();return{x:S-b/2,y:h-b/2,width:p-S+b,height:P-h+b}}destroy(){return e.Util.releaseCanvas(this.dummyCanvas),super.destroy()}}return Df.TextPath=E,E.prototype._fillFunc=w,E.prototype._strokeFunc=_,E.prototype._fillFuncHit=w,E.prototype._strokeFuncHit=_,E.prototype.className="TextPath",E.prototype._attrsAffectingSize=["text","fontSize","data"],(0,s._registerNode)(E),i.Factory.addGetterSetter(E,"data"),i.Factory.addGetterSetter(E,"fontFamily","Arial"),i.Factory.addGetterSetter(E,"fontSize",12,(0,l.getNumberValidator)()),i.Factory.addGetterSetter(E,"fontStyle",d),i.Factory.addGetterSetter(E,"align","left"),i.Factory.addGetterSetter(E,"letterSpacing",0,(0,l.getNumberValidator)()),i.Factory.addGetterSetter(E,"textBaseline","middle"),i.Factory.addGetterSetter(E,"fontVariant",d),i.Factory.addGetterSetter(E,"text",c),i.Factory.addGetterSetter(E,"textDecoration",""),i.Factory.addGetterSetter(E,"kerningFunc",void 0),Df}var jf={},Sy;function V8(){if(Sy)return jf;Sy=1,Object.defineProperty(jf,"__esModule",{value:!0}),jf.Transformer=void 0;const e=In(),i=Ft(),t=Hn(),n=wr(),a=G5(),l=gv(),s=Nt(),c=Bt(),d=Nt(),w="tr-konva",_=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(I=>I+`.${w}`).join(" "),E="nodesRect",O=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],v={"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 p(I,m,A){if(I==="rotater")return A;m+=e.Util.degToRad(v[I]||0);const L=(e.Util.radToDeg(m)%360+360)%360;return e.Util._inRange(L,315+22.5,360)||e.Util._inRange(L,0,22.5)?"ns-resize":e.Util._inRange(L,45-22.5,45+22.5)?"nesw-resize":e.Util._inRange(L,90-22.5,90+22.5)?"ew-resize":e.Util._inRange(L,135-22.5,135+22.5)?"nwse-resize":e.Util._inRange(L,180-22.5,180+22.5)?"ns-resize":e.Util._inRange(L,225-22.5,225+22.5)?"nesw-resize":e.Util._inRange(L,270-22.5,270+22.5)?"ew-resize":e.Util._inRange(L,315-22.5,315+22.5)?"nwse-resize":(e.Util.error("Transformer has unknown angle for cursor detection: "+L),"pointer")}const h=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],P=1e8;function g(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 y(I,m,A){const L=A.x+(I.x-A.x)*Math.cos(m)-(I.y-A.y)*Math.sin(m),k=A.y+(I.x-A.x)*Math.sin(m)+(I.y-A.y)*Math.cos(m);return{...I,rotation:I.rotation+m,x:L,y:k}}function b(I,m){const A=g(I);return y(I,m,A)}function x(I,m,A){let L=m;for(let k=0;k<I.length;k++){const R=s.Konva.getAngle(I[k]),B=Math.abs(R-m)%(Math.PI*2);Math.min(B,Math.PI*2-B)<A&&(L=R)}return L}let M=0;class T extends l.Group{constructor(m){super(m),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(_,this.update),this.getNode()&&this.update()}attachTo(m){return this.setNode(m),this}setNode(m){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([m])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return w+this._id}setNodes(m=[]){this._nodes&&this._nodes.length&&this.detach();const A=m.filter(k=>k.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=m=A,m.length===1&&this.useSingleNodeRotation()?this.rotation(m[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(k=>{const R=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},B=k._attrsAffectingSize.map(X=>X+"Change."+this._getEventNamespace()).join(" ");k.on(B,R),k.on(O.map(X=>X+`.${this._getEventNamespace()}`).join(" "),R),k.on(`absoluteTransformChange.${this._getEventNamespace()}`,R),this._proxyDrag(k)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(m){let A;m.on(`dragstart.${this._getEventNamespace()}`,L=>{A=m.getAbsolutePosition(),!this.isDragging()&&m!==this.findOne(".back")&&this.startDrag(L,!1)}),m.on(`dragmove.${this._getEventNamespace()}`,L=>{if(!A)return;const k=m.getAbsolutePosition(),R=k.x-A.x,B=k.y-A.y;this.nodes().forEach(X=>{if(X===m||X.isDragging())return;const Y=X.getAbsolutePosition();X.setAbsolutePosition({x:Y.x+R,y:Y.y+B}),X.startDrag(L)}),A=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(m=>{m.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(E),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(E,this.__getNodeRect)}__getNodeShape(m,A=this.rotation(),L){const k=m.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),R=m.getAbsoluteScale(L),B=m.getAbsolutePosition(L),X=k.x*R.x-m.offsetX()*R.x,Y=k.y*R.y-m.offsetY()*R.y,Q=(s.Konva.getAngle(m.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),q={x:B.x+X*Math.cos(Q)+Y*Math.sin(-Q),y:B.y+Y*Math.cos(Q)+X*Math.sin(Q),width:k.width*R.x,height:k.height*R.y,rotation:Q};return y(q,-s.Konva.getAngle(A),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-P,y:-P,width:0,height:0,rotation:0};const A=[];this.nodes().map(Q=>{const q=Q.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),z=[{x:q.x,y:q.y},{x:q.x+q.width,y:q.y},{x:q.x+q.width,y:q.y+q.height},{x:q.x,y:q.y+q.height}],N=Q.getAbsoluteTransform();z.forEach(function(U){const $=N.point(U);A.push($)})});const L=new e.Transform;L.rotate(-s.Konva.getAngle(this.rotation()));let k=1/0,R=1/0,B=-1/0,X=-1/0;A.forEach(function(Q){const q=L.point(Q);k===void 0&&(k=B=q.x,R=X=q.y),k=Math.min(k,q.x),R=Math.min(R,q.y),B=Math.max(B,q.x),X=Math.max(X,q.y)}),L.invert();const Y=L.point({x:k,y:R});return{x:Y.x,y:Y.y,width:B-k,height:X-R,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(),h.forEach(m=>{this._createAnchor(m)}),this._createAnchor("rotater")}_createAnchor(m){const A=new a.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:m+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:S?10:"auto"}),L=this;A.on("mousedown touchstart",function(k){L._handleMouseDown(k)}),A.on("dragstart",k=>{A.stopDrag(),k.cancelBubble=!0}),A.on("dragend",k=>{k.cancelBubble=!0}),A.on("mouseenter",()=>{const k=s.Konva.getAngle(this.rotation()),R=this.rotateAnchorCursor(),B=p(m,k,R);A.getStage().content&&(A.getStage().content.style.cursor=B),this._cursorChange=!0}),A.on("mouseout",()=>{A.getStage().content&&(A.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(A)}_createBack(){const m=new n.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(A,L){const k=L.getParent(),R=k.padding();A.beginPath(),A.rect(-R,-R,L.width()+R*2,L.height()+R*2),A.moveTo(L.width()/2,-R),k.rotateEnabled()&&k.rotateLineVisible()&&A.lineTo(L.width()/2,-k.rotateAnchorOffset()*e.Util._sign(L.height())-R),A.fillStrokeShape(L)},hitFunc:(A,L)=>{if(!this.shouldOverdrawWholeArea())return;const k=this.padding();A.beginPath(),A.rect(-k,-k,L.width()+k*2,L.height()+k*2),A.fillStrokeShape(L)}});this.add(m),this._proxyDrag(m),m.on("dragstart",A=>{A.cancelBubble=!0}),m.on("dragmove",A=>{A.cancelBubble=!0}),m.on("dragend",A=>{A.cancelBubble=!0}),this.on("dragmove",A=>{this.update()})}_handleMouseDown(m){if(this._transforming)return;this._movingAnchorName=m.target.name().split(" ")[0];const A=this._getNodeRect(),L=A.width,k=A.height,R=Math.sqrt(Math.pow(L,2)+Math.pow(k,2));this.sin=Math.abs(k/R),this.cos=Math.abs(L/R),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 B=m.target.getAbsolutePosition(),X=m.target.getStage().getPointerPosition();this._anchorDragOffset={x:X.x-B.x,y:X.y-B.y},M++,this._fire("transformstart",{evt:m.evt,target:this.getNode()}),this._nodes.forEach(Y=>{Y._fire("transformstart",{evt:m.evt,target:Y})})}_handleMouseMove(m){let A,L,k;const R=this.findOne("."+this._movingAnchorName),B=R.getStage();B.setPointersPositions(m);const X=B.getPointerPosition();let Y={x:X.x-this._anchorDragOffset.x,y:X.y-this._anchorDragOffset.y};const Q=R.getAbsolutePosition();this.anchorDragBoundFunc()&&(Y=this.anchorDragBoundFunc()(Q,Y,m)),R.setAbsolutePosition(Y);const q=R.getAbsolutePosition();if(Q.x===q.x&&Q.y===q.y)return;if(this._movingAnchorName==="rotater"){const ie=this._getNodeRect();A=R.x()-ie.width/2,L=-R.y()+ie.height/2;let ae=Math.atan2(-L,A)+Math.PI/2;ie.height<0&&(ae-=Math.PI);const de=s.Konva.getAngle(this.rotation())+ae,he=s.Konva.getAngle(this.rotationSnapTolerance()),_e=x(this.rotationSnaps(),de,he)-ie.rotation,Ae=b(ie,_e);this._fitNodesInto(Ae,m);return}const z=this.shiftBehavior();let N;z==="inverted"?N=this.keepRatio()&&!m.shiftKey:z==="none"?N=this.keepRatio():N=this.keepRatio()||m.shiftKey;var Z=this.centeredScaling()||m.altKey;if(this._movingAnchorName==="top-left"){if(N){var U=Z?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};k=Math.sqrt(Math.pow(U.x-R.x(),2)+Math.pow(U.y-R.y(),2));var $=this.findOne(".top-left").x()>U.x?-1:1,ee=this.findOne(".top-left").y()>U.y?-1:1;A=k*this.cos*$,L=k*this.sin*ee,this.findOne(".top-left").x(U.x-A),this.findOne(".top-left").y(U.y-L)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(R.y());else if(this._movingAnchorName==="top-right"){if(N){var U=Z?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};k=Math.sqrt(Math.pow(R.x()-U.x,2)+Math.pow(U.y-R.y(),2));var $=this.findOne(".top-right").x()<U.x?-1:1,ee=this.findOne(".top-right").y()>U.y?-1:1;A=k*this.cos*$,L=k*this.sin*ee,this.findOne(".top-right").x(U.x+A),this.findOne(".top-right").y(U.y-L)}var G=R.position();this.findOne(".top-left").y(G.y),this.findOne(".bottom-right").x(G.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(R.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(R.x());else if(this._movingAnchorName==="bottom-left"){if(N){var U=Z?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};k=Math.sqrt(Math.pow(U.x-R.x(),2)+Math.pow(R.y()-U.y,2));var $=U.x<R.x()?-1:1,ee=R.y()<U.y?-1:1;A=k*this.cos*$,L=k*this.sin*ee,R.x(U.x-A),R.y(U.y+L)}G=R.position(),this.findOne(".top-left").x(G.x),this.findOne(".bottom-right").y(G.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(R.y());else if(this._movingAnchorName==="bottom-right"){if(N){var U=Z?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};k=Math.sqrt(Math.pow(R.x()-U.x,2)+Math.pow(R.y()-U.y,2));var $=this.findOne(".bottom-right").x()<U.x?-1:1,ee=this.findOne(".bottom-right").y()<U.y?-1:1;A=k*this.cos*$,L=k*this.sin*ee,this.findOne(".bottom-right").x(U.x+A),this.findOne(".bottom-right").y(U.y+L)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var Z=this.centeredScaling()||m.altKey;if(Z){const ie=this.findOne(".top-left"),ae=this.findOne(".bottom-right"),se=ie.x(),de=ie.y(),he=this.getWidth()-ae.x(),Oe=this.getHeight()-ae.y();ae.move({x:-se,y:-de}),ie.move({x:he,y:Oe})}const W=this.findOne(".top-left").getAbsolutePosition();A=W.x,L=W.y;const te=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),re=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:A,y:L,width:te,height:re,rotation:s.Konva.getAngle(this.rotation())},m)}_handleMouseUp(m){this._removeEvents(m)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(m){var A;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 L=this.getNode();M--,this._fire("transformend",{evt:m,target:L}),(A=this.getLayer())===null||A===void 0||A.batchDraw(),L&&this._nodes.forEach(k=>{var R;k._fire("transformend",{evt:m,target:k}),(R=k.getLayer())===null||R===void 0||R.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(m,A){const L=this._getNodeRect(),k=1;if(e.Util._inRange(m.width,-this.padding()*2-k,k)){this.update();return}if(e.Util._inRange(m.height,-this.padding()*2-k,k)){this.update();return}const R=new e.Transform;if(R.rotate(s.Konva.getAngle(this.rotation())),this._movingAnchorName&&m.width<0&&this._movingAnchorName.indexOf("left")>=0){const N=R.point({x:-this.padding()*2,y:0});m.x+=N.x,m.y+=N.y,m.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=N.x,this._anchorDragOffset.y-=N.y}else if(this._movingAnchorName&&m.width<0&&this._movingAnchorName.indexOf("right")>=0){const N=R.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=N.x,this._anchorDragOffset.y-=N.y,m.width+=this.padding()*2}if(this._movingAnchorName&&m.height<0&&this._movingAnchorName.indexOf("top")>=0){const N=R.point({x:0,y:-this.padding()*2});m.x+=N.x,m.y+=N.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=N.x,this._anchorDragOffset.y-=N.y,m.height+=this.padding()*2}else if(this._movingAnchorName&&m.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const N=R.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=N.x,this._anchorDragOffset.y-=N.y,m.height+=this.padding()*2}if(this.boundBoxFunc()){const N=this.boundBoxFunc()(L,m);N?m=N:e.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const B=1e7,X=new e.Transform;X.translate(L.x,L.y),X.rotate(L.rotation),X.scale(L.width/B,L.height/B);const Y=new e.Transform,Q=m.width/B,q=m.height/B;this.flipEnabled()===!1?(Y.translate(m.x,m.y),Y.rotate(m.rotation),Y.translate(m.width<0?m.width:0,m.height<0?m.height:0),Y.scale(Math.abs(Q),Math.abs(q))):(Y.translate(m.x,m.y),Y.rotate(m.rotation),Y.scale(Q,q));const z=Y.multiply(X.invert());this._nodes.forEach(N=>{var U;const $=N.getParent().getAbsoluteTransform(),ee=N.getTransform().copy();ee.translate(N.offsetX(),N.offsetY());const G=new e.Transform;G.multiply($.copy().invert()).multiply(z).multiply($).multiply(ee);const Z=G.decompose();N.setAttrs(Z),(U=N.getLayer())===null||U===void 0||U.batchDraw()}),this.rotation(e.Util._getRotation(m.rotation)),this._nodes.forEach(N=>{this._fire("transform",{evt:A,target:N}),N._fire("transform",{evt:A,target:N})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(m,A){this.findOne(m).setAttrs(A)}update(){var m;const A=this._getNodeRect();this.rotation(e.Util._getRotation(A.rotation));const L=A.width,k=A.height,R=this.enabledAnchors(),B=this.resizeEnabled(),X=this.padding(),Y=this.anchorSize(),Q=this.find("._anchor");Q.forEach(z=>{z.setAttrs({width:Y,height:Y,offsetX:Y/2,offsetY:Y/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:Y/2+X,offsetY:Y/2+X,visible:B&&R.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:L/2,y:0,offsetY:Y/2+X,visible:B&&R.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:L,y:0,offsetX:Y/2-X,offsetY:Y/2+X,visible:B&&R.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:k/2,offsetX:Y/2+X,visible:B&&R.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:L,y:k/2,offsetX:Y/2-X,visible:B&&R.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:k,offsetX:Y/2+X,offsetY:Y/2-X,visible:B&&R.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:L/2,y:k,offsetY:Y/2-X,visible:B&&R.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:L,y:k,offsetX:Y/2-X,offsetY:Y/2-X,visible:B&&R.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:L/2,y:-this.rotateAnchorOffset()*e.Util._sign(k)-X,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:L,height:k,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const q=this.anchorStyleFunc();q&&Q.forEach(z=>{q(z)}),(m=this.getLayer())===null||m===void 0||m.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const m=this.findOne("."+this._movingAnchorName);m&&m.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),l.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return t.Node.prototype.toObject.call(this)}clone(m){return t.Node.prototype.clone.call(this,m)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}jf.Transformer=T,T.isTransforming=()=>M>0;function j(I){return I instanceof Array||e.Util.warn("enabledAnchors value should be an array"),I instanceof Array&&I.forEach(function(m){h.indexOf(m)===-1&&e.Util.warn("Unknown anchor name: "+m+". Available names are: "+h.join(", "))}),I||[]}return T.prototype.className="Transformer",(0,d._registerNode)(T),i.Factory.addGetterSetter(T,"enabledAnchors",h,j),i.Factory.addGetterSetter(T,"flipEnabled",!0,(0,c.getBooleanValidator)()),i.Factory.addGetterSetter(T,"resizeEnabled",!0),i.Factory.addGetterSetter(T,"anchorSize",10,(0,c.getNumberValidator)()),i.Factory.addGetterSetter(T,"rotateEnabled",!0),i.Factory.addGetterSetter(T,"rotateLineVisible",!0),i.Factory.addGetterSetter(T,"rotationSnaps",[]),i.Factory.addGetterSetter(T,"rotateAnchorOffset",50,(0,c.getNumberValidator)()),i.Factory.addGetterSetter(T,"rotateAnchorCursor","crosshair"),i.Factory.addGetterSetter(T,"rotationSnapTolerance",5,(0,c.getNumberValidator)()),i.Factory.addGetterSetter(T,"borderEnabled",!0),i.Factory.addGetterSetter(T,"anchorStroke","rgb(0, 161, 255)"),i.Factory.addGetterSetter(T,"anchorStrokeWidth",1,(0,c.getNumberValidator)()),i.Factory.addGetterSetter(T,"anchorFill","white"),i.Factory.addGetterSetter(T,"anchorCornerRadius",0,(0,c.getNumberValidator)()),i.Factory.addGetterSetter(T,"borderStroke","rgb(0, 161, 255)"),i.Factory.addGetterSetter(T,"borderStrokeWidth",1,(0,c.getNumberValidator)()),i.Factory.addGetterSetter(T,"borderDash"),i.Factory.addGetterSetter(T,"keepRatio",!0),i.Factory.addGetterSetter(T,"shiftBehavior","default"),i.Factory.addGetterSetter(T,"centeredScaling",!1),i.Factory.addGetterSetter(T,"ignoreStroke",!1),i.Factory.addGetterSetter(T,"padding",0,(0,c.getNumberValidator)()),i.Factory.addGetterSetter(T,"nodes"),i.Factory.addGetterSetter(T,"node"),i.Factory.addGetterSetter(T,"boundBoxFunc"),i.Factory.addGetterSetter(T,"anchorDragBoundFunc"),i.Factory.addGetterSetter(T,"anchorStyleFunc"),i.Factory.addGetterSetter(T,"shouldOverdrawWholeArea",!1),i.Factory.addGetterSetter(T,"useSingleNodeRotation",!0),i.Factory.backCompat(T,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"}),jf}var Ff={},Ey;function $8(){if(Ey)return Ff;Ey=1,Object.defineProperty(Ff,"__esModule",{value:!0}),Ff.Wedge=void 0;const e=Ft(),i=wr(),t=Nt(),n=Bt(),a=Nt();class l extends i.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 Ff.Wedge=l,l.prototype.className="Wedge",l.prototype._centroid=!0,l.prototype._attrsAffectingSize=["radius"],(0,a._registerNode)(l),e.Factory.addGetterSetter(l,"radius",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(l,"angle",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(l,"clockwise",!1),e.Factory.backCompat(l,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"}),Ff}var zf={},Oy;function W8(){if(Oy)return zf;Oy=1,Object.defineProperty(zf,"__esModule",{value:!0}),zf.Blur=void 0;const e=Ft(),i=Hn(),t=Bt();function n(){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],l=[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(d,w){const _=d.data,E=d.width,O=d.height;let v,S,p,h,P,g,y,b,x,M,T,j,I,m,A,L,k,R,B,X,Y,Q,q,z;const N=w+w+1,U=E-1,$=O-1,ee=w+1,G=ee*(ee+1)/2,Z=new n,W=a[w],te=l[w];let re=null,ie=Z,ae=null,se=null;for(p=1;p<N;p++)ie=ie.next=new n,p===ee&&(re=ie);for(ie.next=Z,y=g=0,S=0;S<O;S++){for(L=k=R=B=b=x=M=T=0,j=ee*(X=_[g]),I=ee*(Y=_[g+1]),m=ee*(Q=_[g+2]),A=ee*(q=_[g+3]),b+=G*X,x+=G*Y,M+=G*Q,T+=G*q,ie=Z,p=0;p<ee;p++)ie.r=X,ie.g=Y,ie.b=Q,ie.a=q,ie=ie.next;for(p=1;p<ee;p++)h=g+((U<p?U:p)<<2),b+=(ie.r=X=_[h])*(z=ee-p),x+=(ie.g=Y=_[h+1])*z,M+=(ie.b=Q=_[h+2])*z,T+=(ie.a=q=_[h+3])*z,L+=X,k+=Y,R+=Q,B+=q,ie=ie.next;for(ae=Z,se=re,v=0;v<E;v++)_[g+3]=q=T*W>>te,q!==0?(q=255/q,_[g]=(b*W>>te)*q,_[g+1]=(x*W>>te)*q,_[g+2]=(M*W>>te)*q):_[g]=_[g+1]=_[g+2]=0,b-=j,x-=I,M-=m,T-=A,j-=ae.r,I-=ae.g,m-=ae.b,A-=ae.a,h=y+((h=v+w+1)<U?h:U)<<2,L+=ae.r=_[h],k+=ae.g=_[h+1],R+=ae.b=_[h+2],B+=ae.a=_[h+3],b+=L,x+=k,M+=R,T+=B,ae=ae.next,j+=X=se.r,I+=Y=se.g,m+=Q=se.b,A+=q=se.a,L-=X,k-=Y,R-=Q,B-=q,se=se.next,g+=4;y+=E}for(v=0;v<E;v++){for(k=R=B=L=x=M=T=b=0,g=v<<2,j=ee*(X=_[g]),I=ee*(Y=_[g+1]),m=ee*(Q=_[g+2]),A=ee*(q=_[g+3]),b+=G*X,x+=G*Y,M+=G*Q,T+=G*q,ie=Z,p=0;p<ee;p++)ie.r=X,ie.g=Y,ie.b=Q,ie.a=q,ie=ie.next;for(P=E,p=1;p<=w;p++)g=P+v<<2,b+=(ie.r=X=_[g])*(z=ee-p),x+=(ie.g=Y=_[g+1])*z,M+=(ie.b=Q=_[g+2])*z,T+=(ie.a=q=_[g+3])*z,L+=X,k+=Y,R+=Q,B+=q,ie=ie.next,p<$&&(P+=E);for(g=v,ae=Z,se=re,S=0;S<O;S++)h=g<<2,_[h+3]=q=T*W>>te,q>0?(q=255/q,_[h]=(b*W>>te)*q,_[h+1]=(x*W>>te)*q,_[h+2]=(M*W>>te)*q):_[h]=_[h+1]=_[h+2]=0,b-=j,x-=I,M-=m,T-=A,j-=ae.r,I-=ae.g,m-=ae.b,A-=ae.a,h=v+((h=S+ee)<$?h:$)*E<<2,b+=L+=ae.r=_[h],x+=k+=ae.g=_[h+1],M+=R+=ae.b=_[h+2],T+=B+=ae.a=_[h+3],ae=ae.next,j+=X=se.r,I+=Y=se.g,m+=Q=se.b,A+=q=se.a,L-=X,k-=Y,R-=Q,B-=q,se=se.next,g+=E}}const c=function(w){const _=Math.round(this.blurRadius());_>0&&s(w,_)};return zf.Blur=c,e.Factory.addGetterSetter(i.Node,"blurRadius",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),zf}var Bf={},xy;function Y8(){if(xy)return Bf;xy=1,Object.defineProperty(Bf,"__esModule",{value:!0}),Bf.Brighten=void 0;const e=Ft(),i=Hn(),t=Bt(),n=function(a){const l=this.brightness()*255,s=a.data,c=s.length;for(let d=0;d<c;d+=4)s[d]+=l,s[d+1]+=l,s[d+2]+=l};return Bf.Brighten=n,e.Factory.addGetterSetter(i.Node,"brightness",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Bf}var Uf={},Py;function K8(){if(Py)return Uf;Py=1,Object.defineProperty(Uf,"__esModule",{value:!0}),Uf.Contrast=void 0;const e=Ft(),i=Hn(),t=Bt(),n=function(a){const l=Math.pow((this.contrast()+100)/100,2),s=a.data,c=s.length;let d=150,w=150,_=150;for(let E=0;E<c;E+=4)d=s[E],w=s[E+1],_=s[E+2],d/=255,d-=.5,d*=l,d+=.5,d*=255,w/=255,w-=.5,w*=l,w+=.5,w*=255,_/=255,_-=.5,_*=l,_+=.5,_*=255,d=d<0?0:d>255?255:d,w=w<0?0:w>255?255:w,_=_<0?0:_>255?255:_,s[E]=d,s[E+1]=w,s[E+2]=_};return Uf.Contrast=n,e.Factory.addGetterSetter(i.Node,"contrast",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Uf}var qf={},Cy;function X8(){if(Cy)return qf;Cy=1,Object.defineProperty(qf,"__esModule",{value:!0}),qf.Emboss=void 0;const e=Ft(),i=Hn(),t=In(),n=Bt(),a=function(l){const s=this.embossStrength()*10,c=this.embossWhiteLevel()*255,d=this.embossDirection(),w=this.embossBlend(),_=l.data,E=l.width,O=l.height,v=E*4;let S=0,p=0,h=O;switch(d){case"top-left":S=-1,p=-1;break;case"top":S=-1,p=0;break;case"top-right":S=-1,p=1;break;case"right":S=0,p=1;break;case"bottom-right":S=1,p=1;break;case"bottom":S=1,p=0;break;case"bottom-left":S=1,p=-1;break;case"left":S=0,p=-1;break;default:t.Util.error("Unknown emboss direction: "+d)}do{const P=(h-1)*v;let g=S;h+g<1&&(g=0),h+g>O&&(g=0);const y=(h-1+g)*E*4;let b=E;do{const x=P+(b-1)*4;let M=p;b+M<1&&(M=0),b+M>E&&(M=0);const T=y+(b-1+M)*4,j=_[x]-_[T],I=_[x+1]-_[T+1],m=_[x+2]-_[T+2];let A=j;const L=A>0?A:-A,k=I>0?I:-I,R=m>0?m:-m;if(k>L&&(A=I),R>L&&(A=m),A*=s,w){const B=_[x]+A,X=_[x+1]+A,Y=_[x+2]+A;_[x]=B>255?255:B<0?0:B,_[x+1]=X>255?255:X<0?0:X,_[x+2]=Y>255?255:Y<0?0:Y}else{let B=c-A;B<0?B=0:B>255&&(B=255),_[x]=_[x+1]=_[x+2]=B}}while(--b)}while(--h)};return qf.Emboss=a,e.Factory.addGetterSetter(i.Node,"embossStrength",.5,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(i.Node,"embossWhiteLevel",.5,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(i.Node,"embossDirection","top-left",void 0,e.Factory.afterSetFilter),e.Factory.addGetterSetter(i.Node,"embossBlend",!1,void 0,e.Factory.afterSetFilter),qf}var Hf={},ky;function Z8(){if(ky)return Hf;ky=1,Object.defineProperty(Hf,"__esModule",{value:!0}),Hf.Enhance=void 0;const e=Ft(),i=Hn(),t=Bt();function n(l,s,c,d,w){const _=c-s,E=w-d;if(_===0)return d+E/2;if(E===0)return d;let O=(l-s)/_;return O=E*O+d,O}const a=function(l){const s=l.data,c=s.length;let d=s[0],w=d,_,E=s[1],O=E,v,S=s[2],p=S,h;const P=this.enhance();if(P===0)return;for(let A=0;A<c;A+=4)_=s[A+0],_<d?d=_:_>w&&(w=_),v=s[A+1],v<E?E=v:v>O&&(O=v),h=s[A+2],h<S?S=h:h>p&&(p=h);w===d&&(w=255,d=0),O===E&&(O=255,E=0),p===S&&(p=255,S=0);let g,y,b,x,M,T,j,I,m;P>0?(y=w+P*(255-w),b=d-P*(d-0),M=O+P*(255-O),T=E-P*(E-0),I=p+P*(255-p),m=S-P*(S-0)):(g=(w+d)*.5,y=w+P*(w-g),b=d+P*(d-g),x=(O+E)*.5,M=O+P*(O-x),T=E+P*(E-x),j=(p+S)*.5,I=p+P*(p-j),m=S+P*(S-j));for(let A=0;A<c;A+=4)s[A+0]=n(s[A+0],d,w,b,y),s[A+1]=n(s[A+1],E,O,T,M),s[A+2]=n(s[A+2],S,p,m,I)};return Hf.Enhance=a,e.Factory.addGetterSetter(i.Node,"enhance",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Hf}var Gf={},Ay;function Q8(){if(Ay)return Gf;Ay=1,Object.defineProperty(Gf,"__esModule",{value:!0}),Gf.Grayscale=void 0;const e=function(i){const t=i.data,n=t.length;for(let a=0;a<n;a+=4){const l=.34*t[a]+.5*t[a+1]+.16*t[a+2];t[a]=l,t[a+1]=l,t[a+2]=l}};return Gf.Grayscale=e,Gf}var Vf={},Ty;function J8(){if(Ty)return Vf;Ty=1,Object.defineProperty(Vf,"__esModule",{value:!0}),Vf.HSL=void 0;const e=Ft(),i=Hn(),t=Bt();e.Factory.addGetterSetter(i.Node,"hue",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(i.Node,"saturation",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(i.Node,"luminance",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter);const n=function(a){const l=a.data,s=l.length,c=1,d=Math.pow(2,this.saturation()),w=Math.abs(this.hue()+360)%360,_=this.luminance()*127,E=c*d*Math.cos(w*Math.PI/180),O=c*d*Math.sin(w*Math.PI/180),v=.299*c+.701*E+.167*O,S=.587*c-.587*E+.33*O,p=.114*c-.114*E-.497*O,h=.299*c-.299*E-.328*O,P=.587*c+.413*E+.035*O,g=.114*c-.114*E+.293*O,y=.299*c-.3*E+1.25*O,b=.587*c-.586*E-1.05*O,x=.114*c+.886*E-.2*O;let M,T,j,I;for(let m=0;m<s;m+=4)M=l[m+0],T=l[m+1],j=l[m+2],I=l[m+3],l[m+0]=v*M+S*T+p*j+_,l[m+1]=h*M+P*T+g*j+_,l[m+2]=y*M+b*T+x*j+_,l[m+3]=I};return Vf.HSL=n,Vf}var $f={},Ry;function e9(){if(Ry)return $f;Ry=1,Object.defineProperty($f,"__esModule",{value:!0}),$f.HSV=void 0;const e=Ft(),i=Hn(),t=Bt(),n=function(a){const l=a.data,s=l.length,c=Math.pow(2,this.value()),d=Math.pow(2,this.saturation()),w=Math.abs(this.hue()+360)%360,_=c*d*Math.cos(w*Math.PI/180),E=c*d*Math.sin(w*Math.PI/180),O=.299*c+.701*_+.167*E,v=.587*c-.587*_+.33*E,S=.114*c-.114*_-.497*E,p=.299*c-.299*_-.328*E,h=.587*c+.413*_+.035*E,P=.114*c-.114*_+.293*E,g=.299*c-.3*_+1.25*E,y=.587*c-.586*_-1.05*E,b=.114*c+.886*_-.2*E;let x,M,T,j;for(let I=0;I<s;I+=4)x=l[I+0],M=l[I+1],T=l[I+2],j=l[I+3],l[I+0]=O*x+v*M+S*T,l[I+1]=p*x+h*M+P*T,l[I+2]=g*x+y*M+b*T,l[I+3]=j};return $f.HSV=n,e.Factory.addGetterSetter(i.Node,"hue",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(i.Node,"saturation",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(i.Node,"value",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),$f}var Wf={},My;function t9(){if(My)return Wf;My=1,Object.defineProperty(Wf,"__esModule",{value:!0}),Wf.Invert=void 0;const e=function(i){const t=i.data,n=t.length;for(let a=0;a<n;a+=4)t[a]=255-t[a],t[a+1]=255-t[a+1],t[a+2]=255-t[a+2]};return Wf.Invert=e,Wf}var Yf={},Ly;function n9(){if(Ly)return Yf;Ly=1,Object.defineProperty(Yf,"__esModule",{value:!0}),Yf.Kaleidoscope=void 0;const e=Ft(),i=Hn(),t=In(),n=Bt(),a=function(c,d,w){const _=c.data,E=d.data,O=c.width,v=c.height,S=w.polarCenterX||O/2,p=w.polarCenterY||v/2;let h=Math.sqrt(S*S+p*p),P=O-S,g=v-p;const y=Math.sqrt(P*P+g*g);h=y>h?y:h;const b=v,x=O,M=360/x*Math.PI/180;for(let T=0;T<x;T+=1){const j=Math.sin(T*M),I=Math.cos(T*M);for(let m=0;m<b;m+=1){P=Math.floor(S+h*m/b*I),g=Math.floor(p+h*m/b*j);let A=(g*O+P)*4;const L=_[A+0],k=_[A+1],R=_[A+2],B=_[A+3];A=(T+m*O)*4,E[A+0]=L,E[A+1]=k,E[A+2]=R,E[A+3]=B}}},l=function(c,d,w){const _=c.data,E=d.data,O=c.width,v=c.height,S=w.polarCenterX||O/2,p=w.polarCenterY||v/2;let h=Math.sqrt(S*S+p*p),P=O-S,g=v-p;const y=Math.sqrt(P*P+g*g);h=y>h?y:h;const b=v,x=O,M=0;let T,j;for(P=0;P<O;P+=1)for(g=0;g<v;g+=1){const I=P-S,m=g-p,A=Math.sqrt(I*I+m*m)*b/h;let L=(Math.atan2(m,I)*180/Math.PI+360+M)%360;L=L*x/360,T=Math.floor(L),j=Math.floor(A);let k=(j*O+T)*4;const R=_[k+0],B=_[k+1],X=_[k+2],Y=_[k+3];k=(g*O+P)*4,E[k+0]=R,E[k+1]=B,E[k+2]=X,E[k+3]=Y}},s=function(c){const d=c.width,w=c.height;let _,E,O,v,S,p,h,P,g,y,b=Math.round(this.kaleidoscopePower());const x=Math.round(this.kaleidoscopeAngle()),M=Math.floor(d*(x%360)/360);if(b<1)return;const T=t.Util.createCanvasElement();T.width=d,T.height=w;const j=T.getContext("2d").getImageData(0,0,d,w);t.Util.releaseCanvas(T),a(c,j,{polarCenterX:d/2,polarCenterY:w/2});let I=d/Math.pow(2,b);for(;I<=8;)I=I*2,b-=1;I=Math.ceil(I);let m=I,A=0,L=m,k=1;for(M+I>d&&(A=m,L=0,k=-1),E=0;E<w;E+=1)for(_=A;_!==L;_+=k)O=Math.round(_+M)%d,g=(d*E+O)*4,S=j.data[g+0],p=j.data[g+1],h=j.data[g+2],P=j.data[g+3],y=(d*E+_)*4,j.data[y+0]=S,j.data[y+1]=p,j.data[y+2]=h,j.data[y+3]=P;for(E=0;E<w;E+=1)for(m=Math.floor(I),v=0;v<b;v+=1){for(_=0;_<m+1;_+=1)g=(d*E+_)*4,S=j.data[g+0],p=j.data[g+1],h=j.data[g+2],P=j.data[g+3],y=(d*E+m*2-_-1)*4,j.data[y+0]=S,j.data[y+1]=p,j.data[y+2]=h,j.data[y+3]=P;m*=2}l(j,c,{polarRotation:0})};return Yf.Kaleidoscope=s,e.Factory.addGetterSetter(i.Node,"kaleidoscopePower",2,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(i.Node,"kaleidoscopeAngle",0,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),Yf}var Kf={},Ny;function r9(){if(Ny)return Kf;Ny=1,Object.defineProperty(Kf,"__esModule",{value:!0}),Kf.Mask=void 0;const e=Ft(),i=Hn(),t=Bt();function n(O,v,S){let p=(S*O.width+v)*4;const h=[];return h.push(O.data[p++],O.data[p++],O.data[p++],O.data[p++]),h}function a(O,v){return Math.sqrt(Math.pow(O[0]-v[0],2)+Math.pow(O[1]-v[1],2)+Math.pow(O[2]-v[2],2))}function l(O){const v=[0,0,0];for(let S=0;S<O.length;S++)v[0]+=O[S][0],v[1]+=O[S][1],v[2]+=O[S][2];return v[0]/=O.length,v[1]/=O.length,v[2]/=O.length,v}function s(O,v){const S=n(O,0,0),p=n(O,O.width-1,0),h=n(O,0,O.height-1),P=n(O,O.width-1,O.height-1),g=v||10;if(a(S,p)<g&&a(p,P)<g&&a(P,h)<g&&a(h,S)<g){const y=l([p,S,P,h]),b=[];for(let x=0;x<O.width*O.height;x++){const M=a(y,[O.data[x*4],O.data[x*4+1],O.data[x*4+2]]);b[x]=M<g?0:255}return b}}function c(O,v){for(let S=0;S<O.width*O.height;S++)O.data[4*S+3]=v[S]}function d(O,v,S){const p=[1,1,1,1,0,1,1,1,1],h=Math.round(Math.sqrt(p.length)),P=Math.floor(h/2),g=[];for(let y=0;y<S;y++)for(let b=0;b<v;b++){const x=y*v+b;let M=0;for(let T=0;T<h;T++)for(let j=0;j<h;j++){const I=y+T-P,m=b+j-P;if(I>=0&&I<S&&m>=0&&m<v){const A=I*v+m,L=p[T*h+j];M+=O[A]*L}}g[x]=M===255*8?255:0}return g}function w(O,v,S){const p=[1,1,1,1,1,1,1,1,1],h=Math.round(Math.sqrt(p.length)),P=Math.floor(h/2),g=[];for(let y=0;y<S;y++)for(let b=0;b<v;b++){const x=y*v+b;let M=0;for(let T=0;T<h;T++)for(let j=0;j<h;j++){const I=y+T-P,m=b+j-P;if(I>=0&&I<S&&m>=0&&m<v){const A=I*v+m,L=p[T*h+j];M+=O[A]*L}}g[x]=M>=255*4?255:0}return g}function _(O,v,S){const p=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],h=Math.round(Math.sqrt(p.length)),P=Math.floor(h/2),g=[];for(let y=0;y<S;y++)for(let b=0;b<v;b++){const x=y*v+b;let M=0;for(let T=0;T<h;T++)for(let j=0;j<h;j++){const I=y+T-P,m=b+j-P;if(I>=0&&I<S&&m>=0&&m<v){const A=I*v+m,L=p[T*h+j];M+=O[A]*L}}g[x]=M}return g}const E=function(O){const v=this.threshold();let S=s(O,v);return S&&(S=d(S,O.width,O.height),S=w(S,O.width,O.height),S=_(S,O.width,O.height),c(O,S)),O};return Kf.Mask=E,e.Factory.addGetterSetter(i.Node,"threshold",0,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Kf}var Xf={},Iy;function i9(){if(Iy)return Xf;Iy=1,Object.defineProperty(Xf,"__esModule",{value:!0}),Xf.Noise=void 0;const e=Ft(),i=Hn(),t=Bt(),n=function(a){const l=this.noise()*255,s=a.data,c=s.length,d=l/2;for(let w=0;w<c;w+=4)s[w+0]+=d-2*d*Math.random(),s[w+1]+=d-2*d*Math.random(),s[w+2]+=d-2*d*Math.random()};return Xf.Noise=n,e.Factory.addGetterSetter(i.Node,"noise",.2,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Xf}var Zf={},Dy;function o9(){if(Dy)return Zf;Dy=1,Object.defineProperty(Zf,"__esModule",{value:!0}),Zf.Pixelate=void 0;const e=Ft(),i=In(),t=Hn(),n=Bt(),a=function(l){let s=Math.ceil(this.pixelSize()),c=l.width,d=l.height,w,_,E,O,v,S,p,h=Math.ceil(c/s),P=Math.ceil(d/s),g,y,b,x,M,T,j,I=l.data;if(s<=0){i.Util.error("pixelSize value can not be <= 0");return}for(M=0;M<h;M+=1)for(T=0;T<P;T+=1){for(O=0,v=0,S=0,p=0,g=M*s,y=g+s,b=T*s,x=b+s,j=0,w=g;w<y;w+=1)if(!(w>=c))for(_=b;_<x;_+=1)_>=d||(E=(c*_+w)*4,O+=I[E+0],v+=I[E+1],S+=I[E+2],p+=I[E+3],j+=1);for(O=O/j,v=v/j,S=S/j,p=p/j,w=g;w<y;w+=1)if(!(w>=c))for(_=b;_<x;_+=1)_>=d||(E=(c*_+w)*4,I[E+0]=O,I[E+1]=v,I[E+2]=S,I[E+3]=p)}};return Zf.Pixelate=a,e.Factory.addGetterSetter(t.Node,"pixelSize",8,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),Zf}var Qf={},jy;function a9(){if(jy)return Qf;jy=1,Object.defineProperty(Qf,"__esModule",{value:!0}),Qf.Posterize=void 0;const e=Ft(),i=Hn(),t=Bt(),n=function(a){const l=Math.round(this.levels()*254)+1,s=a.data,c=s.length,d=255/l;for(let w=0;w<c;w+=1)s[w]=Math.floor(s[w]/d)*d};return Qf.Posterize=n,e.Factory.addGetterSetter(i.Node,"levels",.5,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),Qf}var Jf={},Fy;function l9(){if(Fy)return Jf;Fy=1,Object.defineProperty(Jf,"__esModule",{value:!0}),Jf.RGB=void 0;const e=Ft(),i=Hn(),t=Bt(),n=function(a){const l=a.data,s=l.length,c=this.red(),d=this.green(),w=this.blue();for(let _=0;_<s;_+=4){const E=(.34*l[_]+.5*l[_+1]+.16*l[_+2])/255;l[_]=E*c,l[_+1]=E*d,l[_+2]=E*w,l[_+3]=l[_+3]}};return Jf.RGB=n,e.Factory.addGetterSetter(i.Node,"red",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(i.Node,"green",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(i.Node,"blue",0,t.RGBComponent,e.Factory.afterSetFilter),Jf}var ed={},zy;function s9(){if(zy)return ed;zy=1,Object.defineProperty(ed,"__esModule",{value:!0}),ed.RGBA=void 0;const e=Ft(),i=Hn(),t=Bt(),n=function(a){const l=a.data,s=l.length,c=this.red(),d=this.green(),w=this.blue(),_=this.alpha();for(let E=0;E<s;E+=4){const O=1-_;l[E]=c*_+l[E]*O,l[E+1]=d*_+l[E+1]*O,l[E+2]=w*_+l[E+2]*O}};return ed.RGBA=n,e.Factory.addGetterSetter(i.Node,"red",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(i.Node,"green",0,function(a){return this._filterUpToDate=!1,a>255?255:a<0?0:Math.round(a)}),e.Factory.addGetterSetter(i.Node,"blue",0,t.RGBComponent,e.Factory.afterSetFilter),e.Factory.addGetterSetter(i.Node,"alpha",1,function(a){return this._filterUpToDate=!1,a>1?1:a<0?0:a}),ed}var td={},By;function u9(){if(By)return td;By=1,Object.defineProperty(td,"__esModule",{value:!0}),td.Sepia=void 0;const e=function(i){const t=i.data,n=t.length;for(let a=0;a<n;a+=4){const l=t[a+0],s=t[a+1],c=t[a+2];t[a+0]=Math.min(255,l*.393+s*.769+c*.189),t[a+1]=Math.min(255,l*.349+s*.686+c*.168),t[a+2]=Math.min(255,l*.272+s*.534+c*.131)}};return td.Sepia=e,td}var nd={},Uy;function c9(){if(Uy)return nd;Uy=1,Object.defineProperty(nd,"__esModule",{value:!0}),nd.Solarize=void 0;const e=function(i){const t=i.data,n=i.width,a=i.height,l=n*4;let s=a;do{const c=(s-1)*l;let d=n;do{const w=c+(d-1)*4;let _=t[w],E=t[w+1],O=t[w+2];_>127&&(_=255-_),E>127&&(E=255-E),O>127&&(O=255-O),t[w]=_,t[w+1]=E,t[w+2]=O}while(--d)}while(--s)};return nd.Solarize=e,nd}var rd={},qy;function f9(){if(qy)return rd;qy=1,Object.defineProperty(rd,"__esModule",{value:!0}),rd.Threshold=void 0;const e=Ft(),i=Hn(),t=Bt(),n=function(a){const l=this.threshold()*255,s=a.data,c=s.length;for(let d=0;d<c;d+=1)s[d]=s[d]<l?0:255};return rd.Threshold=n,e.Factory.addGetterSetter(i.Node,"threshold",.5,(0,t.getNumberValidator)(),e.Factory.afterSetFilter),rd}var Hy;function d9(){if(Hy)return mf;Hy=1,Object.defineProperty(mf,"__esModule",{value:!0}),mf.Konva=void 0;const e=qg(),i=L8(),t=I8(),n=D8(),a=j8(),l=F8(),s=z8(),c=H5(),d=mv(),w=G5(),_=B8(),E=U8(),O=q8(),v=H8(),S=V5(),p=G8(),h=V8(),P=$8(),g=W8(),y=Y8(),b=K8(),x=X8(),M=Z8(),T=Q8(),j=J8(),I=e9(),m=t9(),A=n9(),L=r9(),k=i9(),R=o9(),B=a9(),X=l9(),Y=s9(),Q=u9(),q=c9(),z=f9();return mf.Konva=e.Konva.Util._assign(e.Konva,{Arc:i.Arc,Arrow:t.Arrow,Circle:n.Circle,Ellipse:a.Ellipse,Image:l.Image,Label:s.Label,Tag:s.Tag,Line:c.Line,Path:d.Path,Rect:w.Rect,RegularPolygon:_.RegularPolygon,Ring:E.Ring,Sprite:O.Sprite,Star:v.Star,Text:S.Text,TextPath:p.TextPath,Transformer:h.Transformer,Wedge:P.Wedge,Filters:{Blur:g.Blur,Brighten:y.Brighten,Contrast:b.Contrast,Emboss:x.Emboss,Enhance:M.Enhance,Grayscale:T.Grayscale,HSL:j.HSL,HSV:I.HSV,Invert:m.Invert,Kaleidoscope:A.Kaleidoscope,Mask:L.Mask,Noise:k.Noise,Pixelate:R.Pixelate,Posterize:B.Posterize,RGB:X.RGB,RGBA:Y.RGBA,Sepia:Q.Sepia,Solarize:q.Solarize,Threshold:z.Threshold}}),mf}var h9=rp.exports,Gy;function Ji(){if(Gy)return rp.exports;Gy=1,Object.defineProperty(h9,"__esModule",{value:!0});const e=d9();return rp.exports=e.Konva,rp.exports}Ji();var Zh={exports:{}},Vy;function p9(){return Vy||(Vy=1,function(e,i){Object.defineProperty(i,"__esModule",{value:!0}),i.Konva=void 0;var t=qg();Object.defineProperty(i,"Konva",{enumerable:!0,get:function(){return t.Konva}});const n=qg();e.exports=n.Konva}(Zh,Zh.exports)),Zh.exports}var g9=p9();const Pd=Rd(g9);var G0={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 V0,$y;function v9(){return $y||($y=1,V0=function(i){var t={},n=Tn(),a=$g(),l=Object.assign;function s(u){for(var f="https://reactjs.org/docs/error-decoder.html?invariant="+u,D=1;D<arguments.length;D++)f+="&args[]="+encodeURIComponent(arguments[D]);return"Minified React error #"+u+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var c=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,d=Symbol.for("react.element"),w=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),v=Symbol.for("react.provider"),S=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),x=Symbol.iterator;function M(u){return u===null||typeof u!="object"?null:(u=x&&u[x]||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 _:return"Fragment";case w:return"Portal";case O:return"Profiler";case E:return"StrictMode";case h:return"Suspense";case P:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case S:return(u.displayName||"Context")+".Consumer";case v:return(u._context.displayName||"Context")+".Provider";case p:var f=u.render;return u=u.displayName,u||(u=f.displayName||f.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case g:return f=u.displayName||null,f!==null?f:T(u.type)||"Memo";case y:f=u._payload,u=u._init;try{return T(u(f))}catch{}}return null}function j(u){var f=u.type;switch(u.tag){case 24:return"Cache";case 9:return(f.displayName||"Context")+".Consumer";case 10:return(f._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return u=f.render,u=u.displayName||u.name||"",f.displayName||(u!==""?"ForwardRef("+u+")":"ForwardRef");case 7:return"Fragment";case 5:return f;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return T(f);case 8:return f===E?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f}return null}function I(u){var f=u,D=u;if(u.alternate)for(;f.return;)f=f.return;else{u=f;do f=u,f.flags&4098&&(D=f.return),u=f.return;while(u)}return f.tag===3?D:null}function m(u){if(I(u)!==u)throw Error(s(188))}function A(u){var f=u.alternate;if(!f){if(f=I(u),f===null)throw Error(s(188));return f!==u?null:u}for(var D=u,H=f;;){var K=D.return;if(K===null)break;var ne=K.alternate;if(ne===null){if(H=K.return,H!==null){D=H;continue}break}if(K.child===ne.child){for(ne=K.child;ne;){if(ne===D)return m(K),u;if(ne===H)return m(K),f;ne=ne.sibling}throw Error(s(188))}if(D.return!==H.return)D=K,H=ne;else{for(var le=!1,ye=K.child;ye;){if(ye===D){le=!0,D=K,H=ne;break}if(ye===H){le=!0,H=K,D=ne;break}ye=ye.sibling}if(!le){for(ye=ne.child;ye;){if(ye===D){le=!0,D=ne,H=K;break}if(ye===H){le=!0,H=ne,D=K;break}ye=ye.sibling}if(!le)throw Error(s(189))}}if(D.alternate!==H)throw Error(s(190))}if(D.tag!==3)throw Error(s(188));return D.stateNode.current===D?u:f}function L(u){return u=A(u),u!==null?k(u):null}function k(u){if(u.tag===5||u.tag===6)return u;for(u=u.child;u!==null;){var f=k(u);if(f!==null)return f;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 f=R(u);if(f!==null)return f}u=u.sibling}return null}var B=Array.isArray,X=i.getPublicInstance,Y=i.getRootHostContext,Q=i.getChildHostContext,q=i.prepareForCommit,z=i.resetAfterCommit,N=i.createInstance,U=i.appendInitialChild,$=i.finalizeInitialChildren,ee=i.prepareUpdate,G=i.shouldSetTextContent,Z=i.createTextInstance,W=i.scheduleTimeout,te=i.cancelTimeout,re=i.noTimeout,ie=i.isPrimaryRenderer,ae=i.supportsMutation,se=i.supportsPersistence,de=i.supportsHydration,he=i.getInstanceFromNode,Oe=i.preparePortalMount,_e=i.getCurrentEventPriority,Ae=i.detachDeletedInstance,ce=i.supportsMicrotasks,pe=i.scheduleMicrotask,Ce=i.supportsTestSelectors,Le=i.findFiberRoot,ue=i.getBoundingRect,ve=i.getTextContent,xe=i.isHiddenSubtree,je=i.matchAccessibilityRole,at=i.setFocusIfFocusable,ht=i.setupIntersectionObserver,et=i.appendChild,Ke=i.appendChildToContainer,ze=i.commitTextUpdate,Be=i.commitMount,Ve=i.commitUpdate,bt=i.insertBefore,Ct=i.insertInContainerBefore,we=i.removeChild,Se=i.removeChildFromContainer,gt=i.resetTextContent,wt=i.hideInstance,Pt=i.hideTextInstance,vt=i.unhideInstance,Wt=i.unhideTextInstance,pn=i.clearContainer,Fe=i.cloneInstance,rt=i.createContainerChildSet,ft=i.appendChildToContainerChildSet,De=i.finalizeContainerChildren,Ie=i.replaceContainerChildren,Me=i.cloneHiddenInstance,Ye=i.cloneHiddenTextInstance,Mt=i.canHydrateInstance,_t=i.canHydrateTextInstance,Yt=i.canHydrateSuspenseInstance,wn=i.isSuspenseInstancePending,Sn=i.isSuspenseInstanceFallback,Qn=i.getSuspenseInstanceFallbackErrorDetails,ii=i.registerSuspenseInstanceRetry,Sr=i.getNextHydratableSibling,Ze=i.getFirstHydratableChild,Et=i.getFirstHydratableChildWithinContainer,Lt=i.getFirstHydratableChildWithinSuspenseInstance,Gt=i.hydrateInstance,Vt=i.hydrateTextInstance,Jn=i.hydrateSuspenseInstance,Gn=i.getNextHydratableInstanceAfterSuspenseInstance,En=i.commitHydratedContainer,oi=i.commitHydratedSuspenseInstance,Ir=i.clearSuspenseBoundary,Ii=i.clearSuspenseBoundaryFromContainer,Io=i.shouldDeleteUnhydratedTailInstances,rs=i.didNotMatchHydratedContainerTextInstance,en=i.didNotMatchHydratedTextInstance,to;function Dr(u){if(to===void 0)try{throw Error()}catch(D){var f=D.stack.trim().match(/\n( *(at )?)/);to=f&&f[1]||""}return`
52
- `+to+u}var ha=!1;function no(u,f){if(!u||ha)return"";ha=!0;var D=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(f)if(f=function(){throw Error()},Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(Ge){var H=Ge}Reflect.construct(u,[],f)}else{try{f.call()}catch(Ge){H=Ge}u.call(f.prototype)}else{try{throw Error()}catch(Ge){H=Ge}u()}}catch(Ge){if(Ge&&H&&typeof Ge.stack=="string"){for(var K=Ge.stack.split(`
53
- `),ne=H.stack.split(`
54
- `),le=K.length-1,ye=ne.length-1;1<=le&&0<=ye&&K[le]!==ne[ye];)ye--;for(;1<=le&&0<=ye;le--,ye--)if(K[le]!==ne[ye]){if(le!==1||ye!==1)do if(le--,ye--,0>ye||K[le]!==ne[ye]){var Re=`
55
- `+K[le].replace(" at new "," at ");return u.displayName&&Re.includes("<anonymous>")&&(Re=Re.replace("<anonymous>",u.displayName)),Re}while(1<=le&&0<=ye);break}}}finally{ha=!1,Error.prepareStackTrace=D}return(u=u?u.displayName||u.name:"")?Dr(u):""}var Vp=Object.prototype.hasOwnProperty,Qs=[],ro=-1;function er(u){return{current:u}}function cn(u){0>ro||(u.current=Qs[ro],Qs[ro]=null,ro--)}function It(u,f){ro++,Qs[ro]=u.current,u.current=f}var Do={},fr=er(Do),jr=er(!1),Di=Do;function io(u,f){var D=u.type.contextTypes;if(!D)return Do;var H=u.stateNode;if(H&&H.__reactInternalMemoizedUnmaskedChildContext===f)return H.__reactInternalMemoizedMaskedChildContext;var K={},ne;for(ne in D)K[ne]=f[ne];return H&&(u=u.stateNode,u.__reactInternalMemoizedUnmaskedChildContext=f,u.__reactInternalMemoizedMaskedChildContext=K),K}function Vn(u){return u=u.childContextTypes,u!=null}function pa(){cn(jr),cn(fr)}function Gd(u,f,D){if(fr.current!==Do)throw Error(s(168));It(fr,f),It(jr,D)}function Vd(u,f,D){var H=u.stateNode;if(f=f.childContextTypes,typeof H.getChildContext!="function")return D;H=H.getChildContext();for(var K in H)if(!(K in f))throw Error(s(108,j(u)||"Unknown",K));return l({},D,H)}function tl(u){return u=(u=u.stateNode)&&u.__reactInternalMemoizedMergedChildContext||Do,Di=fr.current,It(fr,u),It(jr,jr.current),!0}function Oc(u,f,D){var H=u.stateNode;if(!H)throw Error(s(169));D?(u=Vd(u,f,Di),H.__reactInternalMemoizedMergedChildContext=u,cn(jr),cn(fr),It(fr,u)):cn(jr),It(jr,D)}var Gr=Math.clz32?Math.clz32:xc,is=Math.log,$p=Math.LN2;function xc(u){return u>>>=0,u===0?32:31-(is(u)/$p|0)|0}var Ht=64,os=4194304;function nl(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 rl(u,f){var D=u.pendingLanes;if(D===0)return 0;var H=0,K=u.suspendedLanes,ne=u.pingedLanes,le=D&268435455;if(le!==0){var ye=le&~K;ye!==0?H=nl(ye):(ne&=le,ne!==0&&(H=nl(ne)))}else le=D&~K,le!==0?H=nl(le):ne!==0&&(H=nl(ne));if(H===0)return 0;if(f!==0&&f!==H&&!(f&K)&&(K=H&-H,ne=f&-f,K>=ne||K===16&&(ne&4194240)!==0))return f;if(H&4&&(H|=D&16),f=u.entangledLanes,f!==0)for(u=u.entanglements,f&=H;0<f;)D=31-Gr(f),K=1<<D,H|=u[D],f&=~K;return H}function $d(u,f){switch(u){case 1:case 2:case 4:return f+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 f+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 Wd(u,f){for(var D=u.suspendedLanes,H=u.pingedLanes,K=u.expirationTimes,ne=u.pendingLanes;0<ne;){var le=31-Gr(ne),ye=1<<le,Re=K[le];Re===-1?(!(ye&D)||ye&H)&&(K[le]=$d(ye,f)):Re<=f&&(u.expiredLanes|=ye),ne&=~ye}}function Js(u){return u=u.pendingLanes&-1073741825,u!==0?u:u&1073741824?1073741824:0}function eu(){var u=Ht;return Ht<<=1,!(Ht&4194240)&&(Ht=64),u}function il(u){for(var f=[],D=0;31>D;D++)f.push(u);return f}function ai(u,f,D){u.pendingLanes|=f,f!==536870912&&(u.suspendedLanes=0,u.pingedLanes=0),u=u.eventTimes,f=31-Gr(f),u[f]=D}function jo(u,f){var D=u.pendingLanes&~f;u.pendingLanes=f,u.suspendedLanes=0,u.pingedLanes=0,u.expiredLanes&=f,u.mutableReadLanes&=f,u.entangledLanes&=f,f=u.entanglements;var H=u.eventTimes;for(u=u.expirationTimes;0<D;){var K=31-Gr(D),ne=1<<K;f[K]=0,H[K]=-1,u[K]=-1,D&=~ne}}function ji(u,f){var D=u.entangledLanes|=f;for(u=u.entanglements;D;){var H=31-Gr(D),K=1<<H;K&f|u[H]&f&&(u[H]|=f),D&=~K}}var Dt=0;function ol(u){return u&=-u,1<u?4<u?u&268435455?16:536870912:4:1}var Fi=a.unstable_scheduleCallback,Yd=a.unstable_cancelCallback,Kd=a.unstable_shouldYield,as=a.unstable_requestPaint,$n=a.unstable_now,tu=a.unstable_ImmediatePriority,nu=a.unstable_UserBlockingPriority,ru=a.unstable_NormalPriority,Wp=a.unstable_IdlePriority,Fo=null,Fr=null;function al(u){if(Fr&&typeof Fr.onCommitFiberRoot=="function")try{Fr.onCommitFiberRoot(Fo,u,void 0,(u.current.flags&128)===128)}catch{}}function iu(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var wi=typeof Object.is=="function"?Object.is:iu,oo=null,ll=!1,sl=!1;function ou(u){oo===null?oo=[u]:oo.push(u)}function Xd(u){ll=!0,ou(u)}function tr(){if(!sl&&oo!==null){sl=!0;var u=0,f=Dt;try{var D=oo;for(Dt=1;u<D.length;u++){var H=D[u];do H=H(!0);while(H!==null)}oo=null,ll=!1}catch(K){throw oo!==null&&(oo=oo.slice(u+1)),Fi(tu,tr),K}finally{Dt=f,sl=!1}}return null}var zo=[],ao=0,ls=null,ga=0,Er=[],Vr=0,Dn=null,zr=1,Si="";function Ei(u,f){zo[ao++]=ga,zo[ao++]=ls,ls=u,ga=f}function Zd(u,f,D){Er[Vr++]=zr,Er[Vr++]=Si,Er[Vr++]=Dn,Dn=u;var H=zr;u=Si;var K=32-Gr(H)-1;H&=~(1<<K),D+=1;var ne=32-Gr(f)+K;if(30<ne){var le=K-K%5;ne=(H&(1<<le)-1).toString(32),H>>=le,K-=le,zr=1<<32-Gr(f)+K|D<<K|H,Si=ne+u}else zr=1<<ne|D<<K|H,Si=u}function ss(u){u.return!==null&&(Ei(u,1),Zd(u,1,0))}function us(u){for(;u===ls;)ls=zo[--ao],zo[ao]=null,ga=zo[--ao],zo[ao]=null;for(;u===Dn;)Dn=Er[--Vr],Er[Vr]=null,Si=Er[--Vr],Er[Vr]=null,zr=Er[--Vr],Er[Vr]=null}var nr=null,Or=null,fn=!1,cs=!1,Oi=null;function Qd(u,f){var D=ti(5,null,null,0);D.elementType="DELETED",D.stateNode=f,D.return=u,f=u.deletions,f===null?(u.deletions=[D],u.flags|=16):f.push(D)}function au(u,f){switch(u.tag){case 5:return f=Mt(f,u.type,u.pendingProps),f!==null?(u.stateNode=f,nr=u,Or=Ze(f),!0):!1;case 6:return f=_t(f,u.pendingProps),f!==null?(u.stateNode=f,nr=u,Or=null,!0):!1;case 13:if(f=Yt(f),f!==null){var D=Dn!==null?{id:zr,overflow:Si}:null;return u.memoizedState={dehydrated:f,treeContext:D,retryLane:1073741824},D=ti(18,null,null,0),D.stateNode=f,D.return=u,u.child=D,nr=u,Or=null,!0}return!1;default:return!1}}function Pc(u){return(u.mode&1)!==0&&(u.flags&128)===0}function Cc(u){if(fn){var f=Or;if(f){var D=f;if(!au(u,f)){if(Pc(u))throw Error(s(418));f=Sr(D);var H=nr;f&&au(u,f)?Qd(H,D):(u.flags=u.flags&-4097|2,fn=!1,nr=u)}}else{if(Pc(u))throw Error(s(418));u.flags=u.flags&-4097|2,fn=!1,nr=u}}}function Jd(u){for(u=u.return;u!==null&&u.tag!==5&&u.tag!==3&&u.tag!==13;)u=u.return;nr=u}function lu(u){if(!de||u!==nr)return!1;if(!fn)return Jd(u),fn=!0,!1;if(u.tag!==3&&(u.tag!==5||Io(u.type)&&!G(u.type,u.memoizedProps))){var f=Or;if(f){if(Pc(u))throw eh(),Error(s(418));for(;f;)Qd(u,f),f=Sr(f)}}if(Jd(u),u.tag===13){if(!de)throw Error(s(316));if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(s(317));Or=Gn(u)}else Or=nr?Sr(u.stateNode):null;return!0}function eh(){for(var u=Or;u;)u=Sr(u)}function va(){de&&(Or=nr=null,cs=fn=!1)}function kc(u){Oi===null?Oi=[u]:Oi.push(u)}var Yp=c.ReactCurrentBatchConfig;function su(u,f){if(wi(u,f))return!0;if(typeof u!="object"||u===null||typeof f!="object"||f===null)return!1;var D=Object.keys(u),H=Object.keys(f);if(D.length!==H.length)return!1;for(H=0;H<D.length;H++){var K=D[H];if(!Vp.call(f,K)||!wi(u[K],f[K]))return!1}return!0}function Kp(u){switch(u.tag){case 5:return Dr(u.type);case 16:return Dr("Lazy");case 13:return Dr("Suspense");case 19:return Dr("SuspenseList");case 0:case 2:case 15:return u=no(u.type,!1),u;case 11:return u=no(u.type.render,!1),u;case 1:return u=no(u.type,!0),u;default:return""}}function ma(u,f,D){if(u=D.ref,u!==null&&typeof u!="function"&&typeof u!="object"){if(D._owner){if(D=D._owner,D){if(D.tag!==1)throw Error(s(309));var H=D.stateNode}if(!H)throw Error(s(147,u));var K=H,ne=""+u;return f!==null&&f.ref!==null&&typeof f.ref=="function"&&f.ref._stringRef===ne?f.ref:(f=function(le){var ye=K.refs;le===null?delete ye[ne]:ye[ne]=le},f._stringRef=ne,f)}if(typeof u!="string")throw Error(s(284));if(!D._owner)throw Error(s(290,u))}return u}function uu(u,f){throw u=Object.prototype.toString.call(f),Error(s(31,u==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":u))}function th(u){var f=u._init;return f(u._payload)}function nh(u){function f(ke,be){if(u){var Ne=ke.deletions;Ne===null?(ke.deletions=[be],ke.flags|=16):Ne.push(be)}}function D(ke,be){if(!u)return null;for(;be!==null;)f(ke,be),be=be.sibling;return null}function H(ke,be){for(ke=new Map;be!==null;)be.key!==null?ke.set(be.key,be):ke.set(be.index,be),be=be.sibling;return ke}function K(ke,be){return ke=ra(ke,be),ke.index=0,ke.sibling=null,ke}function ne(ke,be,Ne){return ke.index=Ne,u?(Ne=ke.alternate,Ne!==null?(Ne=Ne.index,Ne<be?(ke.flags|=2,be):Ne):(ke.flags|=2,be)):(ke.flags|=1048576,be)}function le(ke){return u&&ke.alternate===null&&(ke.flags|=2),ke}function ye(ke,be,Ne,Je){return be===null||be.tag!==6?(be=Ll(Ne,ke.mode,Je),be.return=ke,be):(be=K(be,Ne),be.return=ke,be)}function Re(ke,be,Ne,Je){var pt=Ne.type;return pt===_?it(ke,be,Ne.props.children,Je,Ne.key):be!==null&&(be.elementType===pt||typeof pt=="object"&&pt!==null&&pt.$$typeof===y&&th(pt)===be.type)?(Je=K(be,Ne.props),Je.ref=ma(ke,be,Ne),Je.return=ke,Je):(Je=Uu(Ne.type,Ne.key,Ne.props,null,ke.mode,Je),Je.ref=ma(ke,be,Ne),Je.return=ke,Je)}function Ge(ke,be,Ne,Je){return be===null||be.tag!==4||be.stateNode.containerInfo!==Ne.containerInfo||be.stateNode.implementation!==Ne.implementation?(be=qu(Ne,ke.mode,Je),be.return=ke,be):(be=K(be,Ne.children||[]),be.return=ke,be)}function it(ke,be,Ne,Je,pt){return be===null||be.tag!==7?(be=or(Ne,ke.mode,Je,pt),be.return=ke,be):(be=K(be,Ne),be.return=ke,be)}function Ot(ke,be,Ne){if(typeof be=="string"&&be!==""||typeof be=="number")return be=Ll(""+be,ke.mode,Ne),be.return=ke,be;if(typeof be=="object"&&be!==null){switch(be.$$typeof){case d:return Ne=Uu(be.type,be.key,be.props,null,ke.mode,Ne),Ne.ref=ma(ke,null,be),Ne.return=ke,Ne;case w:return be=qu(be,ke.mode,Ne),be.return=ke,be;case y:var Je=be._init;return Ot(ke,Je(be._payload),Ne)}if(B(be)||M(be))return be=or(be,ke.mode,Ne,null),be.return=ke,be;uu(ke,be)}return null}function Qe(ke,be,Ne,Je){var pt=be!==null?be.key:null;if(typeof Ne=="string"&&Ne!==""||typeof Ne=="number")return pt!==null?null:ye(ke,be,""+Ne,Je);if(typeof Ne=="object"&&Ne!==null){switch(Ne.$$typeof){case d:return Ne.key===pt?Re(ke,be,Ne,Je):null;case w:return Ne.key===pt?Ge(ke,be,Ne,Je):null;case y:return pt=Ne._init,Qe(ke,be,pt(Ne._payload),Je)}if(B(Ne)||M(Ne))return pt!==null?null:it(ke,be,Ne,Je,null);uu(ke,Ne)}return null}function sn(ke,be,Ne,Je,pt){if(typeof Je=="string"&&Je!==""||typeof Je=="number")return ke=ke.get(Ne)||null,ye(be,ke,""+Je,pt);if(typeof Je=="object"&&Je!==null){switch(Je.$$typeof){case d:return ke=ke.get(Je.key===null?Ne:Je.key)||null,Re(be,ke,Je,pt);case w:return ke=ke.get(Je.key===null?Ne:Je.key)||null,Ge(be,ke,Je,pt);case y:var Rt=Je._init;return sn(ke,be,Ne,Rt(Je._payload),pt)}if(B(Je)||M(Je))return ke=ke.get(Ne)||null,it(be,ke,Je,pt,null);uu(be,Je)}return null}function Qt(ke,be,Ne,Je){for(var pt=null,Rt=null,xt=be,Ut=be=0,Un=null;xt!==null&&Ut<Ne.length;Ut++){xt.index>Ut?(Un=xt,xt=null):Un=xt.sibling;var zt=Qe(ke,xt,Ne[Ut],Je);if(zt===null){xt===null&&(xt=Un);break}u&&xt&&zt.alternate===null&&f(ke,xt),be=ne(zt,be,Ut),Rt===null?pt=zt:Rt.sibling=zt,Rt=zt,xt=Un}if(Ut===Ne.length)return D(ke,xt),fn&&Ei(ke,Ut),pt;if(xt===null){for(;Ut<Ne.length;Ut++)xt=Ot(ke,Ne[Ut],Je),xt!==null&&(be=ne(xt,be,Ut),Rt===null?pt=xt:Rt.sibling=xt,Rt=xt);return fn&&Ei(ke,Ut),pt}for(xt=H(ke,xt);Ut<Ne.length;Ut++)Un=sn(xt,ke,Ut,Ne[Ut],Je),Un!==null&&(u&&Un.alternate!==null&&xt.delete(Un.key===null?Ut:Un.key),be=ne(Un,be,Ut),Rt===null?pt=Un:Rt.sibling=Un,Rt=Un);return u&&xt.forEach(function(mr){return f(ke,mr)}),fn&&Ei(ke,Ut),pt}function Tr(ke,be,Ne,Je){var pt=M(Ne);if(typeof pt!="function")throw Error(s(150));if(Ne=pt.call(Ne),Ne==null)throw Error(s(151));for(var Rt=pt=null,xt=be,Ut=be=0,Un=null,zt=Ne.next();xt!==null&&!zt.done;Ut++,zt=Ne.next()){xt.index>Ut?(Un=xt,xt=null):Un=xt.sibling;var mr=Qe(ke,xt,zt.value,Je);if(mr===null){xt===null&&(xt=Un);break}u&&xt&&mr.alternate===null&&f(ke,xt),be=ne(mr,be,Ut),Rt===null?pt=mr:Rt.sibling=mr,Rt=mr,xt=Un}if(zt.done)return D(ke,xt),fn&&Ei(ke,Ut),pt;if(xt===null){for(;!zt.done;Ut++,zt=Ne.next())zt=Ot(ke,zt.value,Je),zt!==null&&(be=ne(zt,be,Ut),Rt===null?pt=zt:Rt.sibling=zt,Rt=zt);return fn&&Ei(ke,Ut),pt}for(xt=H(ke,xt);!zt.done;Ut++,zt=Ne.next())zt=sn(xt,ke,Ut,zt.value,Je),zt!==null&&(u&&zt.alternate!==null&&xt.delete(zt.key===null?Ut:zt.key),be=ne(zt,be,Ut),Rt===null?pt=zt:Rt.sibling=zt,Rt=zt);return u&&xt.forEach(function(e0){return f(ke,e0)}),fn&&Ei(ke,Ut),pt}function Wi(ke,be,Ne,Je){if(typeof Ne=="object"&&Ne!==null&&Ne.type===_&&Ne.key===null&&(Ne=Ne.props.children),typeof Ne=="object"&&Ne!==null){switch(Ne.$$typeof){case d:e:{for(var pt=Ne.key,Rt=be;Rt!==null;){if(Rt.key===pt){if(pt=Ne.type,pt===_){if(Rt.tag===7){D(ke,Rt.sibling),be=K(Rt,Ne.props.children),be.return=ke,ke=be;break e}}else if(Rt.elementType===pt||typeof pt=="object"&&pt!==null&&pt.$$typeof===y&&th(pt)===Rt.type){D(ke,Rt.sibling),be=K(Rt,Ne.props),be.ref=ma(ke,Rt,Ne),be.return=ke,ke=be;break e}D(ke,Rt);break}else f(ke,Rt);Rt=Rt.sibling}Ne.type===_?(be=or(Ne.props.children,ke.mode,Je,Ne.key),be.return=ke,ke=be):(Je=Uu(Ne.type,Ne.key,Ne.props,null,ke.mode,Je),Je.ref=ma(ke,be,Ne),Je.return=ke,ke=Je)}return le(ke);case w:e:{for(Rt=Ne.key;be!==null;){if(be.key===Rt)if(be.tag===4&&be.stateNode.containerInfo===Ne.containerInfo&&be.stateNode.implementation===Ne.implementation){D(ke,be.sibling),be=K(be,Ne.children||[]),be.return=ke,ke=be;break e}else{D(ke,be);break}else f(ke,be);be=be.sibling}be=qu(Ne,ke.mode,Je),be.return=ke,ke=be}return le(ke);case y:return Rt=Ne._init,Wi(ke,be,Rt(Ne._payload),Je)}if(B(Ne))return Qt(ke,be,Ne,Je);if(M(Ne))return Tr(ke,be,Ne,Je);uu(ke,Ne)}return typeof Ne=="string"&&Ne!==""||typeof Ne=="number"?(Ne=""+Ne,be!==null&&be.tag===6?(D(ke,be.sibling),be=K(be,Ne),be.return=ke,ke=be):(D(ke,be),be=Ll(Ne,ke.mode,Je),be.return=ke,ke=be),le(ke)):D(ke,be)}return Wi}var ya=nh(!0),rh=nh(!1),cu=er(null),fu=null,ul=null,Ac=null;function Tc(){Ac=ul=fu=null}function ih(u,f,D){ie?(It(cu,f._currentValue),f._currentValue=D):(It(cu,f._currentValue2),f._currentValue2=D)}function fs(u){var f=cu.current;cn(cu),ie?u._currentValue=f:u._currentValue2=f}function ba(u,f,D){for(;u!==null;){var H=u.alternate;if((u.childLanes&f)!==f?(u.childLanes|=f,H!==null&&(H.childLanes|=f)):H!==null&&(H.childLanes&f)!==f&&(H.childLanes|=f),u===D)break;u=u.return}}function cl(u,f){fu=u,Ac=ul=null,u=u.dependencies,u!==null&&u.firstContext!==null&&(u.lanes&f&&(Fn=!0),u.firstContext=null)}function $r(u){var f=ie?u._currentValue:u._currentValue2;if(Ac!==u)if(u={context:u,memoizedValue:f,next:null},ul===null){if(fu===null)throw Error(s(308));ul=u,fu.dependencies={lanes:0,firstContext:u}}else ul=ul.next=u;return f}var Bo=null;function du(u){Bo===null?Bo=[u]:Bo.push(u)}function Rc(u,f,D,H){var K=f.interleaved;return K===null?(D.next=D,du(f)):(D.next=K.next,K.next=D),f.interleaved=D,xi(u,H)}function xi(u,f){u.lanes|=f;var D=u.alternate;for(D!==null&&(D.lanes|=f),D=u,u=u.return;u!==null;)u.childLanes|=f,D=u.alternate,D!==null&&(D.childLanes|=f),D=u,u=u.return;return D.tag===3?D.stateNode:null}var Wr=!1;function Mc(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function oh(u,f){u=u.updateQueue,f.updateQueue===u&&(f.updateQueue={baseState:u.baseState,firstBaseUpdate:u.firstBaseUpdate,lastBaseUpdate:u.lastBaseUpdate,shared:u.shared,effects:u.effects})}function lo(u,f){return{eventTime:u,lane:f,tag:0,payload:null,callback:null,next:null}}function so(u,f,D){var H=u.updateQueue;if(H===null)return null;if(H=H.shared,kt&2){var K=H.pending;return K===null?f.next=f:(f.next=K.next,K.next=f),H.pending=f,xi(u,D)}return K=H.interleaved,K===null?(f.next=f,du(H)):(f.next=K.next,K.next=f),H.interleaved=f,xi(u,D)}function ds(u,f,D){if(f=f.updateQueue,f!==null&&(f=f.shared,(D&4194240)!==0)){var H=f.lanes;H&=u.pendingLanes,D|=H,f.lanes=D,ji(u,D)}}function fl(u,f){var D=u.updateQueue,H=u.alternate;if(H!==null&&(H=H.updateQueue,D===H)){var K=null,ne=null;if(D=D.firstBaseUpdate,D!==null){do{var le={eventTime:D.eventTime,lane:D.lane,tag:D.tag,payload:D.payload,callback:D.callback,next:null};ne===null?K=ne=le:ne=ne.next=le,D=D.next}while(D!==null);ne===null?K=ne=f:ne=ne.next=f}else K=ne=f;D={baseState:H.baseState,firstBaseUpdate:K,lastBaseUpdate:ne,shared:H.shared,effects:H.effects},u.updateQueue=D;return}u=D.lastBaseUpdate,u===null?D.firstBaseUpdate=f:u.next=f,D.lastBaseUpdate=f}function Uo(u,f,D,H){var K=u.updateQueue;Wr=!1;var ne=K.firstBaseUpdate,le=K.lastBaseUpdate,ye=K.shared.pending;if(ye!==null){K.shared.pending=null;var Re=ye,Ge=Re.next;Re.next=null,le===null?ne=Ge:le.next=Ge,le=Re;var it=u.alternate;it!==null&&(it=it.updateQueue,ye=it.lastBaseUpdate,ye!==le&&(ye===null?it.firstBaseUpdate=Ge:ye.next=Ge,it.lastBaseUpdate=Re))}if(ne!==null){var Ot=K.baseState;le=0,it=Ge=Re=null,ye=ne;do{var Qe=ye.lane,sn=ye.eventTime;if((H&Qe)===Qe){it!==null&&(it=it.next={eventTime:sn,lane:0,tag:ye.tag,payload:ye.payload,callback:ye.callback,next:null});e:{var Qt=u,Tr=ye;switch(Qe=f,sn=D,Tr.tag){case 1:if(Qt=Tr.payload,typeof Qt=="function"){Ot=Qt.call(sn,Ot,Qe);break e}Ot=Qt;break e;case 3:Qt.flags=Qt.flags&-65537|128;case 0:if(Qt=Tr.payload,Qe=typeof Qt=="function"?Qt.call(sn,Ot,Qe):Qt,Qe==null)break e;Ot=l({},Ot,Qe);break e;case 2:Wr=!0}}ye.callback!==null&&ye.lane!==0&&(u.flags|=64,Qe=K.effects,Qe===null?K.effects=[ye]:Qe.push(ye))}else sn={eventTime:sn,lane:Qe,tag:ye.tag,payload:ye.payload,callback:ye.callback,next:null},it===null?(Ge=it=sn,Re=Ot):it=it.next=sn,le|=Qe;if(ye=ye.next,ye===null){if(ye=K.shared.pending,ye===null)break;Qe=ye,ye=Qe.next,Qe.next=null,K.lastBaseUpdate=Qe,K.shared.pending=null}}while(!0);if(it===null&&(Re=Ot),K.baseState=Re,K.firstBaseUpdate=Ge,K.lastBaseUpdate=it,f=K.shared.interleaved,f!==null){K=f;do le|=K.lane,K=K.next;while(K!==f)}else ne===null&&(K.shared.lanes=0);po|=le,u.lanes=le,u.memoizedState=Ot}}function ah(u,f,D){if(u=f.effects,f.effects=null,u!==null)for(f=0;f<u.length;f++){var H=u[f],K=H.callback;if(K!==null){if(H.callback=null,H=D,typeof K!="function")throw Error(s(191,K));K.call(H)}}}var qo={},li=er(qo),dl=er(qo),Ho=er(qo);function si(u){if(u===qo)throw Error(s(174));return u}function hu(u,f){It(Ho,f),It(dl,u),It(li,qo),u=Y(f),cn(li),It(li,u)}function _a(){cn(li),cn(dl),cn(Ho)}function Lc(u){var f=si(Ho.current),D=si(li.current);f=Q(D,u.type,f),D!==f&&(It(dl,u),It(li,f))}function Nc(u){dl.current===u&&(cn(li),cn(dl))}var On=er(0);function pu(u){for(var f=u;f!==null;){if(f.tag===13){var D=f.memoizedState;if(D!==null&&(D=D.dehydrated,D===null||wn(D)||Sn(D)))return f}else if(f.tag===19&&f.memoizedProps.revealOrder!==void 0){if(f.flags&128)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===u)break;for(;f.sibling===null;){if(f.return===null||f.return===u)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}var Ic=[];function Dc(){for(var u=0;u<Ic.length;u++){var f=Ic[u];ie?f._workInProgressVersionPrimary=null:f._workInProgressVersionSecondary=null}Ic.length=0}var Br=c.ReactCurrentDispatcher,wa=c.ReactCurrentBatchConfig,Go=0,gn=null,Rn=null,jn=null,hl=!1,hs=!1,ps=0,pl=0;function Wn(){throw Error(s(321))}function Sa(u,f){if(f===null)return!1;for(var D=0;D<f.length&&D<u.length;D++)if(!wi(u[D],f[D]))return!1;return!0}function gs(u,f,D,H,K,ne){if(Go=ne,gn=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,Br.current=u===null||u.memoizedState===null?$c:Wc,u=D(H,K),hs){ne=0;do{if(hs=!1,ps=0,25<=ne)throw Error(s(301));ne+=1,jn=Rn=null,f.updateQueue=null,Br.current=Yc,u=D(H,K)}while(hs)}if(Br.current=Ca,f=Rn!==null&&Rn.next!==null,Go=0,jn=Rn=gn=null,hl=!1,f)throw Error(s(300));return u}function gu(){var u=ps!==0;return ps=0,u}function Yr(){var u={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jn===null?gn.memoizedState=jn=u:jn=jn.next=u,jn}function rr(){if(Rn===null){var u=gn.alternate;u=u!==null?u.memoizedState:null}else u=Rn.next;var f=jn===null?gn.memoizedState:jn.next;if(f!==null)jn=f,Rn=u;else{if(u===null)throw Error(s(310));Rn=u,u={memoizedState:Rn.memoizedState,baseState:Rn.baseState,baseQueue:Rn.baseQueue,queue:Rn.queue,next:null},jn===null?gn.memoizedState=jn=u:jn=jn.next=u}return jn}function Ea(u,f){return typeof f=="function"?f(u):f}function vu(u){var f=rr(),D=f.queue;if(D===null)throw Error(s(311));D.lastRenderedReducer=u;var H=Rn,K=H.baseQueue,ne=D.pending;if(ne!==null){if(K!==null){var le=K.next;K.next=ne.next,ne.next=le}H.baseQueue=K=ne,D.pending=null}if(K!==null){ne=K.next,H=H.baseState;var ye=le=null,Re=null,Ge=ne;do{var it=Ge.lane;if((Go&it)===it)Re!==null&&(Re=Re.next={lane:0,action:Ge.action,hasEagerState:Ge.hasEagerState,eagerState:Ge.eagerState,next:null}),H=Ge.hasEagerState?Ge.eagerState:u(H,Ge.action);else{var Ot={lane:it,action:Ge.action,hasEagerState:Ge.hasEagerState,eagerState:Ge.eagerState,next:null};Re===null?(ye=Re=Ot,le=H):Re=Re.next=Ot,gn.lanes|=it,po|=it}Ge=Ge.next}while(Ge!==null&&Ge!==ne);Re===null?le=H:Re.next=ye,wi(H,f.memoizedState)||(Fn=!0),f.memoizedState=H,f.baseState=le,f.baseQueue=Re,D.lastRenderedState=H}if(u=D.interleaved,u!==null){K=u;do ne=K.lane,gn.lanes|=ne,po|=ne,K=K.next;while(K!==u)}else K===null&&(D.lanes=0);return[f.memoizedState,D.dispatch]}function gl(u){var f=rr(),D=f.queue;if(D===null)throw Error(s(311));D.lastRenderedReducer=u;var H=D.dispatch,K=D.pending,ne=f.memoizedState;if(K!==null){D.pending=null;var le=K=K.next;do ne=u(ne,le.action),le=le.next;while(le!==K);wi(ne,f.memoizedState)||(Fn=!0),f.memoizedState=ne,f.baseQueue===null&&(f.baseState=ne),D.lastRenderedState=ne}return[ne,H]}function jc(){}function Fc(u,f){var D=gn,H=rr(),K=f(),ne=!wi(H.memoizedState,K);if(ne&&(H.memoizedState=K,Fn=!0),H=H.queue,bu(Uc.bind(null,D,H,u),[u]),H.getSnapshot!==f||ne||jn!==null&&jn.memoizedState.tag&1){if(D.flags|=2048,Oa(9,Bc.bind(null,D,H,K,f),void 0,null),nn===null)throw Error(s(349));Go&30||zc(D,f,K)}return K}function zc(u,f,D){u.flags|=16384,u={getSnapshot:f,value:D},f=gn.updateQueue,f===null?(f={lastEffect:null,stores:null},gn.updateQueue=f,f.stores=[u]):(D=f.stores,D===null?f.stores=[u]:D.push(u))}function Bc(u,f,D,H){f.value=D,f.getSnapshot=H,qc(f)&&uo(u)}function Uc(u,f,D){return D(function(){qc(f)&&uo(u)})}function qc(u){var f=u.getSnapshot;u=u.value;try{var D=f();return!wi(u,D)}catch{return!0}}function uo(u){var f=xi(u,1);f!==null&&gr(f,u,1,-1)}function mu(u){var f=Yr();return typeof u=="function"&&(u=u()),f.memoizedState=f.baseState=u,u={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ea,lastRenderedState:u},f.queue=u,u=u.dispatch=Xp.bind(null,gn,u),[f.memoizedState,u]}function Oa(u,f,D,H){return u={tag:u,create:f,destroy:D,deps:H,next:null},f=gn.updateQueue,f===null?(f={lastEffect:null,stores:null},gn.updateQueue=f,f.lastEffect=u.next=u):(D=f.lastEffect,D===null?f.lastEffect=u.next=u:(H=D.next,D.next=u,u.next=H,f.lastEffect=u)),u}function lh(){return rr().memoizedState}function yu(u,f,D,H){var K=Yr();gn.flags|=u,K.memoizedState=Oa(1|f,D,void 0,H===void 0?null:H)}function Vo(u,f,D,H){var K=rr();H=H===void 0?null:H;var ne=void 0;if(Rn!==null){var le=Rn.memoizedState;if(ne=le.destroy,H!==null&&Sa(H,le.deps)){K.memoizedState=Oa(f,D,ne,H);return}}gn.flags|=u,K.memoizedState=Oa(1|f,D,ne,H)}function sh(u,f){return yu(8390656,8,u,f)}function bu(u,f){return Vo(2048,8,u,f)}function Hc(u,f){return Vo(4,2,u,f)}function on(u,f){return Vo(4,4,u,f)}function _u(u,f){if(typeof f=="function")return u=u(),f(u),function(){f(null)};if(f!=null)return u=u(),f.current=u,function(){f.current=null}}function vs(u,f,D){return D=D!=null?D.concat([u]):null,Vo(4,4,_u.bind(null,f,u),D)}function xa(){}function Gc(u,f){var D=rr();f=f===void 0?null:f;var H=D.memoizedState;return H!==null&&f!==null&&Sa(f,H[1])?H[0]:(D.memoizedState=[u,f],u)}function wu(u,f){var D=rr();f=f===void 0?null:f;var H=D.memoizedState;return H!==null&&f!==null&&Sa(f,H[1])?H[0]:(u=u(),D.memoizedState=[u,f],u)}function vl(u,f,D){return Go&21?(wi(D,f)||(D=eu(),gn.lanes|=D,po|=D,u.baseState=!0),f):(u.baseState&&(u.baseState=!1,Fn=!0),u.memoizedState=D)}function Su(u,f){var D=Dt;Dt=D!==0&&4>D?D:4,u(!0);var H=wa.transition;wa.transition={};try{u(!1),f()}finally{Dt=D,wa.transition=H}}function Pa(){return rr().memoizedState}function uh(u,f,D){var H=Bn(u);if(D={lane:H,action:D,hasEagerState:!1,eagerState:null,next:null},ch(u))Vc(f,D);else if(D=Rc(u,f,D,H),D!==null){var K=dn();gr(D,u,H,K),ms(D,f,H)}}function Xp(u,f,D){var H=Bn(u),K={lane:H,action:D,hasEagerState:!1,eagerState:null,next:null};if(ch(u))Vc(f,K);else{var ne=u.alternate;if(u.lanes===0&&(ne===null||ne.lanes===0)&&(ne=f.lastRenderedReducer,ne!==null))try{var le=f.lastRenderedState,ye=ne(le,D);if(K.hasEagerState=!0,K.eagerState=ye,wi(ye,le)){var Re=f.interleaved;Re===null?(K.next=K,du(f)):(K.next=Re.next,Re.next=K),f.interleaved=K;return}}catch{}finally{}D=Rc(u,f,K,H),D!==null&&(K=dn(),gr(D,u,H,K),ms(D,f,H))}}function ch(u){var f=u.alternate;return u===gn||f!==null&&f===gn}function Vc(u,f){hs=hl=!0;var D=u.pending;D===null?f.next=f:(f.next=D.next,D.next=f),u.pending=f}function ms(u,f,D){if(D&4194240){var H=f.lanes;H&=u.pendingLanes,D|=H,f.lanes=D,ji(u,D)}}var Ca={readContext:$r,useCallback:Wn,useContext:Wn,useEffect:Wn,useImperativeHandle:Wn,useInsertionEffect:Wn,useLayoutEffect:Wn,useMemo:Wn,useReducer:Wn,useRef:Wn,useState:Wn,useDebugValue:Wn,useDeferredValue:Wn,useTransition:Wn,useMutableSource:Wn,useSyncExternalStore:Wn,useId:Wn,unstable_isNewReconciler:!1},$c={readContext:$r,useCallback:function(u,f){return Yr().memoizedState=[u,f===void 0?null:f],u},useContext:$r,useEffect:sh,useImperativeHandle:function(u,f,D){return D=D!=null?D.concat([u]):null,yu(4194308,4,_u.bind(null,f,u),D)},useLayoutEffect:function(u,f){return yu(4194308,4,u,f)},useInsertionEffect:function(u,f){return yu(4,2,u,f)},useMemo:function(u,f){var D=Yr();return f=f===void 0?null:f,u=u(),D.memoizedState=[u,f],u},useReducer:function(u,f,D){var H=Yr();return f=D!==void 0?D(f):f,H.memoizedState=H.baseState=f,u={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:f},H.queue=u,u=u.dispatch=uh.bind(null,gn,u),[H.memoizedState,u]},useRef:function(u){var f=Yr();return u={current:u},f.memoizedState=u},useState:mu,useDebugValue:xa,useDeferredValue:function(u){return Yr().memoizedState=u},useTransition:function(){var u=mu(!1),f=u[0];return u=Su.bind(null,u[1]),Yr().memoizedState=u,[f,u]},useMutableSource:function(){},useSyncExternalStore:function(u,f,D){var H=gn,K=Yr();if(fn){if(D===void 0)throw Error(s(407));D=D()}else{if(D=f(),nn===null)throw Error(s(349));Go&30||zc(H,f,D)}K.memoizedState=D;var ne={value:D,getSnapshot:f};return K.queue=ne,sh(Uc.bind(null,H,ne,u),[u]),H.flags|=2048,Oa(9,Bc.bind(null,H,ne,D,f),void 0,null),D},useId:function(){var u=Yr(),f=nn.identifierPrefix;if(fn){var D=Si,H=zr;D=(H&~(1<<32-Gr(H)-1)).toString(32)+D,f=":"+f+"R"+D,D=ps++,0<D&&(f+="H"+D.toString(32)),f+=":"}else D=pl++,f=":"+f+"r"+D.toString(32)+":";return u.memoizedState=f},unstable_isNewReconciler:!1},Wc={readContext:$r,useCallback:Gc,useContext:$r,useEffect:bu,useImperativeHandle:vs,useInsertionEffect:Hc,useLayoutEffect:on,useMemo:wu,useReducer:vu,useRef:lh,useState:function(){return vu(Ea)},useDebugValue:xa,useDeferredValue:function(u){var f=rr();return vl(f,Rn.memoizedState,u)},useTransition:function(){var u=vu(Ea)[0],f=rr().memoizedState;return[u,f]},useMutableSource:jc,useSyncExternalStore:Fc,useId:Pa,unstable_isNewReconciler:!1},Yc={readContext:$r,useCallback:Gc,useContext:$r,useEffect:bu,useImperativeHandle:vs,useInsertionEffect:Hc,useLayoutEffect:on,useMemo:wu,useReducer:gl,useRef:lh,useState:function(){return gl(Ea)},useDebugValue:xa,useDeferredValue:function(u){var f=rr();return Rn===null?f.memoizedState=u:vl(f,Rn.memoizedState,u)},useTransition:function(){var u=gl(Ea)[0],f=rr().memoizedState;return[u,f]},useMutableSource:jc,useSyncExternalStore:Fc,useId:Pa,unstable_isNewReconciler:!1};function Kr(u,f){if(u&&u.defaultProps){f=l({},f),u=u.defaultProps;for(var D in u)f[D]===void 0&&(f[D]=u[D]);return f}return f}function Kc(u,f,D,H){f=u.memoizedState,D=D(H,f),D=D==null?f:l({},f,D),u.memoizedState=D,u.lanes===0&&(u.updateQueue.baseState=D)}var ys={isMounted:function(u){return(u=u._reactInternals)?I(u)===u:!1},enqueueSetState:function(u,f,D){u=u._reactInternals;var H=dn(),K=Bn(u),ne=lo(H,K);ne.payload=f,D!=null&&(ne.callback=D),f=so(u,ne,K),f!==null&&(gr(f,u,K,H),ds(f,u,K))},enqueueReplaceState:function(u,f,D){u=u._reactInternals;var H=dn(),K=Bn(u),ne=lo(H,K);ne.tag=1,ne.payload=f,D!=null&&(ne.callback=D),f=so(u,ne,K),f!==null&&(gr(f,u,K,H),ds(f,u,K))},enqueueForceUpdate:function(u,f){u=u._reactInternals;var D=dn(),H=Bn(u),K=lo(D,H);K.tag=2,f!=null&&(K.callback=f),f=so(u,K,H),f!==null&&(gr(f,u,H,D),ds(f,u,H))}};function fh(u,f,D,H,K,ne,le){return u=u.stateNode,typeof u.shouldComponentUpdate=="function"?u.shouldComponentUpdate(H,ne,le):f.prototype&&f.prototype.isPureReactComponent?!su(D,H)||!su(K,ne):!0}function dh(u,f,D){var H=!1,K=Do,ne=f.contextType;return typeof ne=="object"&&ne!==null?ne=$r(ne):(K=Vn(f)?Di:fr.current,H=f.contextTypes,ne=(H=H!=null)?io(u,K):Do),f=new f(D,ne),u.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=ys,u.stateNode=f,f._reactInternals=u,H&&(u=u.stateNode,u.__reactInternalMemoizedUnmaskedChildContext=K,u.__reactInternalMemoizedMaskedChildContext=ne),f}function Eu(u,f,D,H){u=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(D,H),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(D,H),f.state!==u&&ys.enqueueReplaceState(f,f.state,null)}function zi(u,f,D,H){var K=u.stateNode;K.props=D,K.state=u.memoizedState,K.refs={},Mc(u);var ne=f.contextType;typeof ne=="object"&&ne!==null?K.context=$r(ne):(ne=Vn(f)?Di:fr.current,K.context=io(u,ne)),K.state=u.memoizedState,ne=f.getDerivedStateFromProps,typeof ne=="function"&&(Kc(u,f,ne,D),K.state=u.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof K.getSnapshotBeforeUpdate=="function"||typeof K.UNSAFE_componentWillMount!="function"&&typeof K.componentWillMount!="function"||(f=K.state,typeof K.componentWillMount=="function"&&K.componentWillMount(),typeof K.UNSAFE_componentWillMount=="function"&&K.UNSAFE_componentWillMount(),f!==K.state&&ys.enqueueReplaceState(K,K.state,null),Uo(u,D,K,H),K.state=u.memoizedState),typeof K.componentDidMount=="function"&&(u.flags|=4194308)}function ka(u,f){try{var D="",H=f;do D+=Kp(H),H=H.return;while(H);var K=D}catch(ne){K=`
56
- Error generating stack: `+ne.message+`
57
- `+ne.stack}return{value:u,source:f,stack:K,digest:null}}function $o(u,f,D){return{value:u,source:null,stack:D??null,digest:f??null}}function ui(u,f){try{console.error(f.value)}catch(D){setTimeout(function(){throw D})}}var bs=typeof WeakMap=="function"?WeakMap:Map;function Bi(u,f,D){D=lo(-1,D),D.tag=3,D.payload={element:null};var H=f.value;return D.callback=function(){Cn||(Cn=!0,Mn=H),ui(u,f)},D}function Ou(u,f,D){D=lo(-1,D),D.tag=3;var H=u.type.getDerivedStateFromError;if(typeof H=="function"){var K=f.value;D.payload=function(){return H(K)},D.callback=function(){ui(u,f)}}var ne=u.stateNode;return ne!==null&&typeof ne.componentDidCatch=="function"&&(D.callback=function(){ui(u,f),typeof H!="function"&&(Ci===null?Ci=new Set([this]):Ci.add(this));var le=f.stack;this.componentDidCatch(f.value,{componentStack:le!==null?le:""})}),D}function hh(u,f,D){var H=u.pingCache;if(H===null){H=u.pingCache=new bs;var K=new Set;H.set(f,K)}else K=H.get(f),K===void 0&&(K=new Set,H.set(f,K));K.has(D)||(K.add(D),u=wh.bind(null,u,f,D),f.then(u,u))}function ph(u){do{var f;if((f=u.tag===13)&&(f=u.memoizedState,f=f!==null?f.dehydrated!==null:!0),f)return u;u=u.return}while(u!==null);return null}function Wo(u,f,D,H,K){return u.mode&1?(u.flags|=65536,u.lanes=K,u):(u===f?u.flags|=65536:(u.flags|=128,D.flags|=131072,D.flags&=-52805,D.tag===1&&(D.alternate===null?D.tag=17:(f=lo(-1,1),f.tag=2,so(D,f,1))),D.lanes|=1),u)}var _s=c.ReactCurrentOwner,Fn=!1;function Yn(u,f,D,H){f.child=u===null?rh(f,null,D,H):ya(f,u.child,D,H)}function xu(u,f,D,H,K){D=D.render;var ne=f.ref;return cl(f,K),H=gs(u,f,D,H,ne,K),D=gu(),u!==null&&!Fn?(f.updateQueue=u.updateQueue,f.flags&=-2053,u.lanes&=~K,fo(u,f,K)):(fn&&D&&ss(f),f.flags|=1,Yn(u,f,H,K),f.child)}function Aa(u,f,D,H,K){if(u===null){var ne=D.type;return typeof ne=="function"&&!Rl(ne)&&ne.defaultProps===void 0&&D.compare===null&&D.defaultProps===void 0?(f.tag=15,f.type=ne,co(u,f,ne,H,K)):(u=Uu(D.type,null,H,f,f.mode,K),u.ref=f.ref,u.return=f,f.child=u)}if(ne=u.child,!(u.lanes&K)){var le=ne.memoizedProps;if(D=D.compare,D=D!==null?D:su,D(le,H)&&u.ref===f.ref)return fo(u,f,K)}return f.flags|=1,u=ra(ne,H),u.ref=f.ref,u.return=f,f.child=u}function co(u,f,D,H,K){if(u!==null){var ne=u.memoizedProps;if(su(ne,H)&&u.ref===f.ref)if(Fn=!1,f.pendingProps=H=ne,(u.lanes&K)!==0)u.flags&131072&&(Fn=!0);else return f.lanes=u.lanes,fo(u,f,K)}return Ui(u,f,D,H,K)}function an(u,f,D){var H=f.pendingProps,K=H.children,ne=u!==null?u.memoizedState:null;if(H.mode==="hidden")if(!(f.mode&1))f.memoizedState={baseLanes:0,cachePool:null,transitions:null},It(Jo,zn),zn|=D;else{if(!(D&1073741824))return u=ne!==null?ne.baseLanes|D:D,f.lanes=f.childLanes=1073741824,f.memoizedState={baseLanes:u,cachePool:null,transitions:null},f.updateQueue=null,It(Jo,zn),zn|=u,null;f.memoizedState={baseLanes:0,cachePool:null,transitions:null},H=ne!==null?ne.baseLanes:D,It(Jo,zn),zn|=H}else ne!==null?(H=ne.baseLanes|D,f.memoizedState=null):H=D,It(Jo,zn),zn|=H;return Yn(u,f,K,D),f.child}function tn(u,f){var D=f.ref;(u===null&&D!==null||u!==null&&u.ref!==D)&&(f.flags|=512,f.flags|=2097152)}function Ui(u,f,D,H,K){var ne=Vn(D)?Di:fr.current;return ne=io(f,ne),cl(f,K),D=gs(u,f,D,H,ne,K),H=gu(),u!==null&&!Fn?(f.updateQueue=u.updateQueue,f.flags&=-2053,u.lanes&=~K,fo(u,f,K)):(fn&&H&&ss(f),f.flags|=1,Yn(u,f,D,K),f.child)}function ir(u,f,D,H,K){if(Vn(D)){var ne=!0;tl(f)}else ne=!1;if(cl(f,K),f.stateNode===null)ws(u,f),dh(f,D,H),zi(f,D,H,K),H=!0;else if(u===null){var le=f.stateNode,ye=f.memoizedProps;le.props=ye;var Re=le.context,Ge=D.contextType;typeof Ge=="object"&&Ge!==null?Ge=$r(Ge):(Ge=Vn(D)?Di:fr.current,Ge=io(f,Ge));var it=D.getDerivedStateFromProps,Ot=typeof it=="function"||typeof le.getSnapshotBeforeUpdate=="function";Ot||typeof le.UNSAFE_componentWillReceiveProps!="function"&&typeof le.componentWillReceiveProps!="function"||(ye!==H||Re!==Ge)&&Eu(f,le,H,Ge),Wr=!1;var Qe=f.memoizedState;le.state=Qe,Uo(f,H,le,K),Re=f.memoizedState,ye!==H||Qe!==Re||jr.current||Wr?(typeof it=="function"&&(Kc(f,D,it,H),Re=f.memoizedState),(ye=Wr||fh(f,D,ye,H,Qe,Re,Ge))?(Ot||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"&&(f.flags|=4194308)):(typeof le.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=H,f.memoizedState=Re),le.props=H,le.state=Re,le.context=Ge,H=ye):(typeof le.componentDidMount=="function"&&(f.flags|=4194308),H=!1)}else{le=f.stateNode,oh(u,f),ye=f.memoizedProps,Ge=f.type===f.elementType?ye:Kr(f.type,ye),le.props=Ge,Ot=f.pendingProps,Qe=le.context,Re=D.contextType,typeof Re=="object"&&Re!==null?Re=$r(Re):(Re=Vn(D)?Di:fr.current,Re=io(f,Re));var sn=D.getDerivedStateFromProps;(it=typeof sn=="function"||typeof le.getSnapshotBeforeUpdate=="function")||typeof le.UNSAFE_componentWillReceiveProps!="function"&&typeof le.componentWillReceiveProps!="function"||(ye!==Ot||Qe!==Re)&&Eu(f,le,H,Re),Wr=!1,Qe=f.memoizedState,le.state=Qe,Uo(f,H,le,K);var Qt=f.memoizedState;ye!==Ot||Qe!==Qt||jr.current||Wr?(typeof sn=="function"&&(Kc(f,D,sn,H),Qt=f.memoizedState),(Ge=Wr||fh(f,D,Ge,H,Qe,Qt,Re)||!1)?(it||typeof le.UNSAFE_componentWillUpdate!="function"&&typeof le.componentWillUpdate!="function"||(typeof le.componentWillUpdate=="function"&&le.componentWillUpdate(H,Qt,Re),typeof le.UNSAFE_componentWillUpdate=="function"&&le.UNSAFE_componentWillUpdate(H,Qt,Re)),typeof le.componentDidUpdate=="function"&&(f.flags|=4),typeof le.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof le.componentDidUpdate!="function"||ye===u.memoizedProps&&Qe===u.memoizedState||(f.flags|=4),typeof le.getSnapshotBeforeUpdate!="function"||ye===u.memoizedProps&&Qe===u.memoizedState||(f.flags|=1024),f.memoizedProps=H,f.memoizedState=Qt),le.props=H,le.state=Qt,le.context=Re,H=Ge):(typeof le.componentDidUpdate!="function"||ye===u.memoizedProps&&Qe===u.memoizedState||(f.flags|=4),typeof le.getSnapshotBeforeUpdate!="function"||ye===u.memoizedProps&&Qe===u.memoizedState||(f.flags|=1024),H=!1)}return dr(u,f,D,H,ne,K)}function dr(u,f,D,H,K,ne){tn(u,f);var le=(f.flags&128)!==0;if(!H&&!le)return K&&Oc(f,D,!1),fo(u,f,ne);H=f.stateNode,_s.current=f;var ye=le&&typeof D.getDerivedStateFromError!="function"?null:H.render();return f.flags|=1,u!==null&&le?(f.child=ya(f,u.child,null,ne),f.child=ya(f,null,ye,ne)):Yn(u,f,ye,ne),f.memoizedState=H.state,K&&Oc(f,D,!0),f.child}function Yo(u){var f=u.stateNode;f.pendingContext?Gd(u,f.pendingContext,f.pendingContext!==f.context):f.context&&Gd(u,f.context,!1),hu(u,f.containerInfo)}function Ta(u,f,D,H,K){return va(),kc(K),f.flags|=256,Yn(u,f,D,H),f.child}var hr={dehydrated:null,treeContext:null,retryLane:0};function ml(u){return{baseLanes:u,cachePool:null,transitions:null}}function Xc(u,f,D){var H=f.pendingProps,K=On.current,ne=!1,le=(f.flags&128)!==0,ye;if((ye=le)||(ye=u!==null&&u.memoizedState===null?!1:(K&2)!==0),ye?(ne=!0,f.flags&=-129):(u===null||u.memoizedState!==null)&&(K|=1),It(On,K&1),u===null)return Cc(f),u=f.memoizedState,u!==null&&(u=u.dehydrated,u!==null)?(f.mode&1?Sn(u)?f.lanes=8:f.lanes=1073741824:f.lanes=1,null):(le=H.children,u=H.fallback,ne?(H=f.mode,ne=f.child,le={mode:"hidden",children:le},!(H&1)&&ne!==null?(ne.childLanes=0,ne.pendingProps=le):ne=Ml(le,H,0,null),u=or(u,H,D,null),ne.return=f,u.return=f,ne.sibling=u,f.child=ne,f.child.memoizedState=ml(D),f.memoizedState=hr,u):Pu(f,le));if(K=u.memoizedState,K!==null&&(ye=K.dehydrated,ye!==null))return gh(u,f,le,H,ye,K,D);if(ne){ne=H.fallback,le=f.mode,K=u.child,ye=K.sibling;var Re={mode:"hidden",children:H.children};return!(le&1)&&f.child!==K?(H=f.child,H.childLanes=0,H.pendingProps=Re,f.deletions=null):(H=ra(K,Re),H.subtreeFlags=K.subtreeFlags&14680064),ye!==null?ne=ra(ye,ne):(ne=or(ne,le,D,null),ne.flags|=2),ne.return=f,H.return=f,H.sibling=ne,f.child=H,H=ne,ne=f.child,le=u.child.memoizedState,le=le===null?ml(D):{baseLanes:le.baseLanes|D,cachePool:null,transitions:le.transitions},ne.memoizedState=le,ne.childLanes=u.childLanes&~D,f.memoizedState=hr,H}return ne=u.child,u=ne.sibling,H=ra(ne,{mode:"visible",children:H.children}),!(f.mode&1)&&(H.lanes=D),H.return=f,H.sibling=null,u!==null&&(D=f.deletions,D===null?(f.deletions=[u],f.flags|=16):D.push(u)),f.child=H,f.memoizedState=null,H}function Pu(u,f){return f=Ml({mode:"visible",children:f},u.mode,0,null),f.return=u,u.child=f}function Ra(u,f,D,H){return H!==null&&kc(H),ya(f,u.child,null,D),u=Pu(f,f.pendingProps.children),u.flags|=2,f.memoizedState=null,u}function gh(u,f,D,H,K,ne,le){if(D)return f.flags&256?(f.flags&=-257,H=$o(Error(s(422))),Ra(u,f,le,H)):f.memoizedState!==null?(f.child=u.child,f.flags|=128,null):(ne=H.fallback,K=f.mode,H=Ml({mode:"visible",children:H.children},K,0,null),ne=or(ne,K,le,null),ne.flags|=2,H.return=f,ne.return=f,H.sibling=ne,f.child=H,f.mode&1&&ya(f,u.child,null,le),f.child.memoizedState=ml(le),f.memoizedState=hr,ne);if(!(f.mode&1))return Ra(u,f,le,null);if(Sn(K))return H=Qn(K).digest,ne=Error(s(419)),H=$o(ne,H,void 0),Ra(u,f,le,H);if(D=(le&u.childLanes)!==0,Fn||D){if(H=nn,H!==null){switch(le&-le){case 4:K=2;break;case 16:K=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:K=32;break;case 536870912:K=268435456;break;default:K=0}K=K&(H.suspendedLanes|le)?0:K,K!==0&&K!==ne.retryLane&&(ne.retryLane=K,xi(u,K),gr(H,u,K,-1))}return Tl(),H=$o(Error(s(421))),Ra(u,f,le,H)}return wn(K)?(f.flags|=128,f.child=u.child,f=Eh.bind(null,u),ii(K,f),null):(u=ne.treeContext,de&&(Or=Lt(K),nr=f,fn=!0,Oi=null,cs=!1,u!==null&&(Er[Vr++]=zr,Er[Vr++]=Si,Er[Vr++]=Dn,zr=u.id,Si=u.overflow,Dn=f)),f=Pu(f,H.children),f.flags|=4096,f)}function qi(u,f,D){u.lanes|=f;var H=u.alternate;H!==null&&(H.lanes|=f),ba(u.return,f,D)}function yl(u,f,D,H,K){var ne=u.memoizedState;ne===null?u.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:H,tail:D,tailMode:K}:(ne.isBackwards=f,ne.rendering=null,ne.renderingStartTime=0,ne.last=H,ne.tail=D,ne.tailMode=K)}function Cu(u,f,D){var H=f.pendingProps,K=H.revealOrder,ne=H.tail;if(Yn(u,f,H.children,D),H=On.current,H&2)H=H&1|2,f.flags|=128;else{if(u!==null&&u.flags&128)e:for(u=f.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&qi(u,D,f);else if(u.tag===19)qi(u,D,f);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===f)break e;for(;u.sibling===null;){if(u.return===null||u.return===f)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}H&=1}if(It(On,H),!(f.mode&1))f.memoizedState=null;else switch(K){case"forwards":for(D=f.child,K=null;D!==null;)u=D.alternate,u!==null&&pu(u)===null&&(K=D),D=D.sibling;D=K,D===null?(K=f.child,f.child=null):(K=D.sibling,D.sibling=null),yl(f,!1,K,D,ne);break;case"backwards":for(D=null,K=f.child,f.child=null;K!==null;){if(u=K.alternate,u!==null&&pu(u)===null){f.child=K;break}u=K.sibling,K.sibling=D,D=K,K=u}yl(f,!0,D,null,ne);break;case"together":yl(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function ws(u,f){!(f.mode&1)&&u!==null&&(u.alternate=null,f.alternate=null,f.flags|=2)}function fo(u,f,D){if(u!==null&&(f.dependencies=u.dependencies),po|=f.lanes,!(D&f.childLanes))return null;if(u!==null&&f.child!==u.child)throw Error(s(153));if(f.child!==null){for(u=f.child,D=ra(u,u.pendingProps),f.child=D,D.return=f;u.sibling!==null;)u=u.sibling,D=D.sibling=ra(u,u.pendingProps),D.return=f;D.sibling=null}return f.child}function Ko(u,f,D){switch(f.tag){case 3:Yo(f),va();break;case 5:Lc(f);break;case 1:Vn(f.type)&&tl(f);break;case 4:hu(f,f.stateNode.containerInfo);break;case 10:ih(f,f.type._context,f.memoizedProps.value);break;case 13:var H=f.memoizedState;if(H!==null)return H.dehydrated!==null?(It(On,On.current&1),f.flags|=128,null):D&f.child.childLanes?Xc(u,f,D):(It(On,On.current&1),u=fo(u,f,D),u!==null?u.sibling:null);It(On,On.current&1);break;case 19:if(H=(D&f.childLanes)!==0,u.flags&128){if(H)return Cu(u,f,D);f.flags|=128}var K=f.memoizedState;if(K!==null&&(K.rendering=null,K.tail=null,K.lastEffect=null),It(On,On.current),H)break;return null;case 22:case 23:return f.lanes=0,an(u,f,D)}return fo(u,f,D)}function xr(u){u.flags|=4}function Ma(u,f){if(u!==null&&u.child===f.child)return!0;if(f.flags&16)return!1;for(u=f.child;u!==null;){if(u.flags&12854||u.subtreeFlags&12854)return!1;u=u.sibling}return!0}var Xo,Zo,Pr,Cr;if(ae)Xo=function(u,f){for(var D=f.child;D!==null;){if(D.tag===5||D.tag===6)U(u,D.stateNode);else if(D.tag!==4&&D.child!==null){D.child.return=D,D=D.child;continue}if(D===f)break;for(;D.sibling===null;){if(D.return===null||D.return===f)return;D=D.return}D.sibling.return=D.return,D=D.sibling}},Zo=function(){},Pr=function(u,f,D,H,K){if(u=u.memoizedProps,u!==H){var ne=f.stateNode,le=si(li.current);D=ee(ne,D,u,H,K,le),(f.updateQueue=D)&&xr(f)}},Cr=function(u,f,D,H){D!==H&&xr(f)};else if(se){Xo=function(u,f,D,H){for(var K=f.child;K!==null;){if(K.tag===5){var ne=K.stateNode;D&&H&&(ne=Me(ne,K.type,K.memoizedProps,K)),U(u,ne)}else if(K.tag===6)ne=K.stateNode,D&&H&&(ne=Ye(ne,K.memoizedProps,K)),U(u,ne);else if(K.tag!==4){if(K.tag===22&&K.memoizedState!==null)ne=K.child,ne!==null&&(ne.return=K),Xo(u,K,!0,!0);else if(K.child!==null){K.child.return=K,K=K.child;continue}}if(K===f)break;for(;K.sibling===null;){if(K.return===null||K.return===f)return;K=K.return}K.sibling.return=K.return,K=K.sibling}};var Qo=function(u,f,D,H){for(var K=f.child;K!==null;){if(K.tag===5){var ne=K.stateNode;D&&H&&(ne=Me(ne,K.type,K.memoizedProps,K)),ft(u,ne)}else if(K.tag===6)ne=K.stateNode,D&&H&&(ne=Ye(ne,K.memoizedProps,K)),ft(u,ne);else if(K.tag!==4){if(K.tag===22&&K.memoizedState!==null)ne=K.child,ne!==null&&(ne.return=K),Qo(u,K,!0,!0);else if(K.child!==null){K.child.return=K,K=K.child;continue}}if(K===f)break;for(;K.sibling===null;){if(K.return===null||K.return===f)return;K=K.return}K.sibling.return=K.return,K=K.sibling}};Zo=function(u,f){var D=f.stateNode;if(!Ma(u,f)){u=D.containerInfo;var H=rt(u);Qo(H,f,!1,!1),D.pendingChildren=H,xr(f),De(u,H)}},Pr=function(u,f,D,H,K){var ne=u.stateNode,le=u.memoizedProps;if((u=Ma(u,f))&&le===H)f.stateNode=ne;else{var ye=f.stateNode,Re=si(li.current),Ge=null;le!==H&&(Ge=ee(ye,D,le,H,K,Re)),u&&Ge===null?f.stateNode=ne:(ne=Fe(ne,Ge,D,le,H,f,u,ye),$(ne,D,H,K,Re)&&xr(f),f.stateNode=ne,u?xr(f):Xo(ne,f,!1,!1))}},Cr=function(u,f,D,H){D!==H?(u=si(Ho.current),D=si(li.current),f.stateNode=Z(H,u,D,f),xr(f)):f.stateNode=u.stateNode}}else Zo=function(){},Pr=function(){},Cr=function(){};function Xr(u,f){if(!fn)switch(u.tailMode){case"hidden":f=u.tail;for(var D=null;f!==null;)f.alternate!==null&&(D=f),f=f.sibling;D===null?u.tail=null:D.sibling=null;break;case"collapsed":D=u.tail;for(var H=null;D!==null;)D.alternate!==null&&(H=D),D=D.sibling;H===null?f||u.tail===null?u.tail=null:u.tail.sibling=null:H.sibling=null}}function vn(u){var f=u.alternate!==null&&u.alternate.child===u.child,D=0,H=0;if(f)for(var K=u.child;K!==null;)D|=K.lanes|K.childLanes,H|=K.subtreeFlags&14680064,H|=K.flags&14680064,K.return=u,K=K.sibling;else for(K=u.child;K!==null;)D|=K.lanes|K.childLanes,H|=K.subtreeFlags,H|=K.flags,K.return=u,K=K.sibling;return u.subtreeFlags|=H,u.childLanes=D,f}function La(u,f,D){var H=f.pendingProps;switch(us(f),f.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vn(f),null;case 1:return Vn(f.type)&&pa(),vn(f),null;case 3:return D=f.stateNode,_a(),cn(jr),cn(fr),Dc(),D.pendingContext&&(D.context=D.pendingContext,D.pendingContext=null),(u===null||u.child===null)&&(lu(f)?xr(f):u===null||u.memoizedState.isDehydrated&&!(f.flags&256)||(f.flags|=1024,Oi!==null&&(zu(Oi),Oi=null))),Zo(u,f),vn(f),null;case 5:Nc(f),D=si(Ho.current);var K=f.type;if(u!==null&&f.stateNode!=null)Pr(u,f,K,H,D),u.ref!==f.ref&&(f.flags|=512,f.flags|=2097152);else{if(!H){if(f.stateNode===null)throw Error(s(166));return vn(f),null}if(u=si(li.current),lu(f)){if(!de)throw Error(s(175));u=Gt(f.stateNode,f.type,f.memoizedProps,D,u,f,!cs),f.updateQueue=u,u!==null&&xr(f)}else{var ne=N(K,H,D,u,f);Xo(ne,f,!1,!1),f.stateNode=ne,$(ne,K,H,D,u)&&xr(f)}f.ref!==null&&(f.flags|=512,f.flags|=2097152)}return vn(f),null;case 6:if(u&&f.stateNode!=null)Cr(u,f,u.memoizedProps,H);else{if(typeof H!="string"&&f.stateNode===null)throw Error(s(166));if(u=si(Ho.current),D=si(li.current),lu(f)){if(!de)throw Error(s(176));if(u=f.stateNode,D=f.memoizedProps,(H=Vt(u,D,f,!cs))&&(K=nr,K!==null))switch(K.tag){case 3:rs(K.stateNode.containerInfo,u,D,(K.mode&1)!==0);break;case 5:en(K.type,K.memoizedProps,K.stateNode,u,D,(K.mode&1)!==0)}H&&xr(f)}else f.stateNode=Z(H,u,D,f)}return vn(f),null;case 13:if(cn(On),H=f.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if(fn&&Or!==null&&f.mode&1&&!(f.flags&128))eh(),va(),f.flags|=98560,K=!1;else if(K=lu(f),H!==null&&H.dehydrated!==null){if(u===null){if(!K)throw Error(s(318));if(!de)throw Error(s(344));if(K=f.memoizedState,K=K!==null?K.dehydrated:null,!K)throw Error(s(317));Jn(K,f)}else va(),!(f.flags&128)&&(f.memoizedState=null),f.flags|=4;vn(f),K=!1}else Oi!==null&&(zu(Oi),Oi=null),K=!0;if(!K)return f.flags&65536?f:null}return f.flags&128?(f.lanes=D,f):(D=H!==null,D!==(u!==null&&u.memoizedState!==null)&&D&&(f.child.flags|=8192,f.mode&1&&(u===null||On.current&1?yn===0&&(yn=3):Tl())),f.updateQueue!==null&&(f.flags|=4),vn(f),null);case 4:return _a(),Zo(u,f),u===null&&Oe(f.stateNode.containerInfo),vn(f),null;case 10:return fs(f.type._context),vn(f),null;case 17:return Vn(f.type)&&pa(),vn(f),null;case 19:if(cn(On),K=f.memoizedState,K===null)return vn(f),null;if(H=(f.flags&128)!==0,ne=K.rendering,ne===null)if(H)Xr(K,!1);else{if(yn!==0||u!==null&&u.flags&128)for(u=f.child;u!==null;){if(ne=pu(u),ne!==null){for(f.flags|=128,Xr(K,!1),u=ne.updateQueue,u!==null&&(f.updateQueue=u,f.flags|=4),f.subtreeFlags=0,u=D,D=f.child;D!==null;)H=D,K=u,H.flags&=14680066,ne=H.alternate,ne===null?(H.childLanes=0,H.lanes=K,H.child=null,H.subtreeFlags=0,H.memoizedProps=null,H.memoizedState=null,H.updateQueue=null,H.dependencies=null,H.stateNode=null):(H.childLanes=ne.childLanes,H.lanes=ne.lanes,H.child=ne.child,H.subtreeFlags=0,H.deletions=null,H.memoizedProps=ne.memoizedProps,H.memoizedState=ne.memoizedState,H.updateQueue=ne.updateQueue,H.type=ne.type,K=ne.dependencies,H.dependencies=K===null?null:{lanes:K.lanes,firstContext:K.firstContext}),D=D.sibling;return It(On,On.current&1|2),f.child}u=u.sibling}K.tail!==null&&$n()>ks&&(f.flags|=128,H=!0,Xr(K,!1),f.lanes=4194304)}else{if(!H)if(u=pu(ne),u!==null){if(f.flags|=128,H=!0,u=u.updateQueue,u!==null&&(f.updateQueue=u,f.flags|=4),Xr(K,!0),K.tail===null&&K.tailMode==="hidden"&&!ne.alternate&&!fn)return vn(f),null}else 2*$n()-K.renderingStartTime>ks&&D!==1073741824&&(f.flags|=128,H=!0,Xr(K,!1),f.lanes=4194304);K.isBackwards?(ne.sibling=f.child,f.child=ne):(u=K.last,u!==null?u.sibling=ne:f.child=ne,K.last=ne)}return K.tail!==null?(f=K.tail,K.rendering=f,K.tail=f.sibling,K.renderingStartTime=$n(),f.sibling=null,u=On.current,It(On,H?u&1|2:u&1),f):(vn(f),null);case 22:case 23:return Bu(),D=f.memoizedState!==null,u!==null&&u.memoizedState!==null!==D&&(f.flags|=8192),D&&f.mode&1?zn&1073741824&&(vn(f),ae&&f.subtreeFlags&6&&(f.flags|=8192)):vn(f),null;case 24:return null;case 25:return null}throw Error(s(156,f.tag))}function vh(u,f){switch(us(f),f.tag){case 1:return Vn(f.type)&&pa(),u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 3:return _a(),cn(jr),cn(fr),Dc(),u=f.flags,u&65536&&!(u&128)?(f.flags=u&-65537|128,f):null;case 5:return Nc(f),null;case 13:if(cn(On),u=f.memoizedState,u!==null&&u.dehydrated!==null){if(f.alternate===null)throw Error(s(340));va()}return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 19:return cn(On),null;case 4:return _a(),null;case 10:return fs(f.type._context),null;case 22:case 23:return Bu(),null;case 24:return null;default:return null}}var bl=!1,Kn=!1,Zr=typeof WeakSet=="function"?WeakSet:Set,Xe=null;function Zt(u,f){var D=u.ref;if(D!==null)if(typeof D=="function")try{D(null)}catch(H){hn(u,f,H)}else D.current=null}function Qr(u,f,D){try{D()}catch(H){hn(u,f,H)}}var Zc=!1;function mh(u,f){for(q(u.containerInfo),Xe=f;Xe!==null;)if(u=Xe,f=u.child,(u.subtreeFlags&1028)!==0&&f!==null)f.return=u,Xe=f;else for(;Xe!==null;){u=Xe;try{var D=u.alternate;if(u.flags&1024)switch(u.tag){case 0:case 11:case 15:break;case 1:if(D!==null){var H=D.memoizedProps,K=D.memoizedState,ne=u.stateNode,le=ne.getSnapshotBeforeUpdate(u.elementType===u.type?H:Kr(u.type,H),K);ne.__reactInternalSnapshotBeforeUpdate=le}break;case 3:ae&&pn(u.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(ye){hn(u,u.return,ye)}if(f=u.sibling,f!==null){f.return=u.return,Xe=f;break}Xe=u.return}return D=Zc,Zc=!1,D}function Na(u,f,D){var H=f.updateQueue;if(H=H!==null?H.lastEffect:null,H!==null){var K=H=H.next;do{if((K.tag&u)===u){var ne=K.destroy;K.destroy=void 0,ne!==void 0&&Qr(f,D,ne)}K=K.next}while(K!==H)}}function _l(u,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var D=f=f.next;do{if((D.tag&u)===u){var H=D.create;D.destroy=H()}D=D.next}while(D!==f)}}function ku(u){var f=u.ref;if(f!==null){var D=u.stateNode;switch(u.tag){case 5:u=X(D);break;default:u=D}typeof f=="function"?f(u):f.current=u}}function Ss(u){var f=u.alternate;f!==null&&(u.alternate=null,Ss(f)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(f=u.stateNode,f!==null&&Ae(f)),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 Qc(u){return u.tag===5||u.tag===3||u.tag===4}function Ia(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||Qc(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 Es(u,f,D){var H=u.tag;if(H===5||H===6)u=u.stateNode,f?Ct(D,u,f):Ke(D,u);else if(H!==4&&(u=u.child,u!==null))for(Es(u,f,D),u=u.sibling;u!==null;)Es(u,f,D),u=u.sibling}function Jc(u,f,D){var H=u.tag;if(H===5||H===6)u=u.stateNode,f?bt(D,u,f):et(D,u);else if(H!==4&&(u=u.child,u!==null))for(Jc(u,f,D),u=u.sibling;u!==null;)Jc(u,f,D),u=u.sibling}var kn=null,Ur=!1;function Pi(u,f,D){for(D=D.child;D!==null;)Au(u,f,D),D=D.sibling}function Au(u,f,D){if(Fr&&typeof Fr.onCommitFiberUnmount=="function")try{Fr.onCommitFiberUnmount(Fo,D)}catch{}switch(D.tag){case 5:Kn||Zt(D,f);case 6:if(ae){var H=kn,K=Ur;kn=null,Pi(u,f,D),kn=H,Ur=K,kn!==null&&(Ur?Se(kn,D.stateNode):we(kn,D.stateNode))}else Pi(u,f,D);break;case 18:ae&&kn!==null&&(Ur?Ii(kn,D.stateNode):Ir(kn,D.stateNode));break;case 4:ae?(H=kn,K=Ur,kn=D.stateNode.containerInfo,Ur=!0,Pi(u,f,D),kn=H,Ur=K):(se&&(H=D.stateNode.containerInfo,K=rt(H),Ie(H,K)),Pi(u,f,D));break;case 0:case 11:case 14:case 15:if(!Kn&&(H=D.updateQueue,H!==null&&(H=H.lastEffect,H!==null))){K=H=H.next;do{var ne=K,le=ne.destroy;ne=ne.tag,le!==void 0&&(ne&2||ne&4)&&Qr(D,f,le),K=K.next}while(K!==H)}Pi(u,f,D);break;case 1:if(!Kn&&(Zt(D,f),H=D.stateNode,typeof H.componentWillUnmount=="function"))try{H.props=D.memoizedProps,H.state=D.memoizedState,H.componentWillUnmount()}catch(ye){hn(D,f,ye)}Pi(u,f,D);break;case 21:Pi(u,f,D);break;case 22:D.mode&1?(Kn=(H=Kn)||D.memoizedState!==null,Pi(u,f,D),Kn=H):Pi(u,f,D);break;default:Pi(u,f,D)}}function Da(u){var f=u.updateQueue;if(f!==null){u.updateQueue=null;var D=u.stateNode;D===null&&(D=u.stateNode=new Zr),f.forEach(function(H){var K=Zp.bind(null,u,H);D.has(H)||(D.add(H),H.then(K,K))})}}function ci(u,f){var D=f.deletions;if(D!==null)for(var H=0;H<D.length;H++){var K=D[H];try{var ne=u,le=f;if(ae){var ye=le;e:for(;ye!==null;){switch(ye.tag){case 5:kn=ye.stateNode,Ur=!1;break e;case 3:kn=ye.stateNode.containerInfo,Ur=!0;break e;case 4:kn=ye.stateNode.containerInfo,Ur=!0;break e}ye=ye.return}if(kn===null)throw Error(s(160));Au(ne,le,K),kn=null,Ur=!1}else Au(ne,le,K);var Re=K.alternate;Re!==null&&(Re.return=null),K.return=null}catch(Ge){hn(K,f,Ge)}}if(f.subtreeFlags&12854)for(f=f.child;f!==null;)Os(f,u),f=f.sibling}function Os(u,f){var D=u.alternate,H=u.flags;switch(u.tag){case 0:case 11:case 14:case 15:if(ci(f,u),Jr(u),H&4){try{Na(3,u,u.return),_l(3,u)}catch(Qe){hn(u,u.return,Qe)}try{Na(5,u,u.return)}catch(Qe){hn(u,u.return,Qe)}}break;case 1:ci(f,u),Jr(u),H&512&&D!==null&&Zt(D,D.return);break;case 5:if(ci(f,u),Jr(u),H&512&&D!==null&&Zt(D,D.return),ae){if(u.flags&32){var K=u.stateNode;try{gt(K)}catch(Qe){hn(u,u.return,Qe)}}if(H&4&&(K=u.stateNode,K!=null)){var ne=u.memoizedProps;if(D=D!==null?D.memoizedProps:ne,H=u.type,f=u.updateQueue,u.updateQueue=null,f!==null)try{Ve(K,f,H,D,ne,u)}catch(Qe){hn(u,u.return,Qe)}}}break;case 6:if(ci(f,u),Jr(u),H&4&&ae){if(u.stateNode===null)throw Error(s(162));K=u.stateNode,ne=u.memoizedProps,D=D!==null?D.memoizedProps:ne;try{ze(K,D,ne)}catch(Qe){hn(u,u.return,Qe)}}break;case 3:if(ci(f,u),Jr(u),H&4){if(ae&&de&&D!==null&&D.memoizedState.isDehydrated)try{En(f.containerInfo)}catch(Qe){hn(u,u.return,Qe)}if(se){K=f.containerInfo,ne=f.pendingChildren;try{Ie(K,ne)}catch(Qe){hn(u,u.return,Qe)}}}break;case 4:if(ci(f,u),Jr(u),H&4&&se){ne=u.stateNode,K=ne.containerInfo,ne=ne.pendingChildren;try{Ie(K,ne)}catch(Qe){hn(u,u.return,Qe)}}break;case 13:ci(f,u),Jr(u),K=u.child,K.flags&8192&&(ne=K.memoizedState!==null,K.stateNode.isHidden=ne,!ne||K.alternate!==null&&K.alternate.memoizedState!==null||(Pl=$n())),H&4&&Da(u);break;case 22:var le=D!==null&&D.memoizedState!==null;if(u.mode&1?(Kn=(D=Kn)||le,ci(f,u),Kn=D):ci(f,u),Jr(u),H&8192){if(D=u.memoizedState!==null,(u.stateNode.isHidden=D)&&!le&&u.mode&1)for(Xe=u,H=u.child;H!==null;){for(f=Xe=H;Xe!==null;){le=Xe;var ye=le.child;switch(le.tag){case 0:case 11:case 14:case 15:Na(4,le,le.return);break;case 1:Zt(le,le.return);var Re=le.stateNode;if(typeof Re.componentWillUnmount=="function"){var Ge=le,it=le.return;try{var Ot=Ge;Re.props=Ot.memoizedProps,Re.state=Ot.memoizedState,Re.componentWillUnmount()}catch(Qe){hn(Ge,it,Qe)}}break;case 5:Zt(le,le.return);break;case 22:if(le.memoizedState!==null){Mu(f);continue}}ye!==null?(ye.return=le,Xe=ye):Mu(f)}H=H.sibling}if(ae){e:if(H=null,ae)for(f=u;;){if(f.tag===5){if(H===null){H=f;try{K=f.stateNode,D?wt(K):vt(f.stateNode,f.memoizedProps)}catch(Qe){hn(u,u.return,Qe)}}}else if(f.tag===6){if(H===null)try{ne=f.stateNode,D?Pt(ne):Wt(ne,f.memoizedProps)}catch(Qe){hn(u,u.return,Qe)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===u)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===u)break e;for(;f.sibling===null;){if(f.return===null||f.return===u)break e;H===f&&(H=null),f=f.return}H===f&&(H=null),f.sibling.return=f.return,f=f.sibling}}}break;case 19:ci(f,u),Jr(u),H&4&&Da(u);break;case 21:break;default:ci(f,u),Jr(u)}}function Jr(u){var f=u.flags;if(f&2){try{if(ae){e:{for(var D=u.return;D!==null;){if(Qc(D)){var H=D;break e}D=D.return}throw Error(s(160))}switch(H.tag){case 5:var K=H.stateNode;H.flags&32&&(gt(K),H.flags&=-33);var ne=Ia(u);Jc(u,ne,K);break;case 3:case 4:var le=H.stateNode.containerInfo,ye=Ia(u);Es(u,ye,le);break;default:throw Error(s(161))}}}catch(Re){hn(u,u.return,Re)}u.flags&=-3}f&4096&&(u.flags&=-4097)}function wl(u,f,D){Xe=u,Tu(u)}function Tu(u,f,D){for(var H=(u.mode&1)!==0;Xe!==null;){var K=Xe,ne=K.child;if(K.tag===22&&H){var le=K.memoizedState!==null||bl;if(!le){var ye=K.alternate,Re=ye!==null&&ye.memoizedState!==null||Kn;ye=bl;var Ge=Kn;if(bl=le,(Kn=Re)&&!Ge)for(Xe=K;Xe!==null;)le=Xe,Re=le.child,le.tag===22&&le.memoizedState!==null?Lu(K):Re!==null?(Re.return=le,Xe=Re):Lu(K);for(;ne!==null;)Xe=ne,Tu(ne),ne=ne.sibling;Xe=K,bl=ye,Kn=Ge}Ru(u)}else K.subtreeFlags&8772&&ne!==null?(ne.return=K,Xe=ne):Ru(u)}}function Ru(u){for(;Xe!==null;){var f=Xe;if(f.flags&8772){var D=f.alternate;try{if(f.flags&8772)switch(f.tag){case 0:case 11:case 15:Kn||_l(5,f);break;case 1:var H=f.stateNode;if(f.flags&4&&!Kn)if(D===null)H.componentDidMount();else{var K=f.elementType===f.type?D.memoizedProps:Kr(f.type,D.memoizedProps);H.componentDidUpdate(K,D.memoizedState,H.__reactInternalSnapshotBeforeUpdate)}var ne=f.updateQueue;ne!==null&&ah(f,ne,H);break;case 3:var le=f.updateQueue;if(le!==null){if(D=null,f.child!==null)switch(f.child.tag){case 5:D=X(f.child.stateNode);break;case 1:D=f.child.stateNode}ah(f,le,D)}break;case 5:var ye=f.stateNode;D===null&&f.flags&4&&Be(ye,f.type,f.memoizedProps,f);break;case 6:break;case 4:break;case 12:break;case 13:if(de&&f.memoizedState===null){var Re=f.alternate;if(Re!==null){var Ge=Re.memoizedState;if(Ge!==null){var it=Ge.dehydrated;it!==null&&oi(it)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(s(163))}Kn||f.flags&512&&ku(f)}catch(Ot){hn(f,f.return,Ot)}}if(f===u){Xe=null;break}if(D=f.sibling,D!==null){D.return=f.return,Xe=D;break}Xe=f.return}}function Mu(u){for(;Xe!==null;){var f=Xe;if(f===u){Xe=null;break}var D=f.sibling;if(D!==null){D.return=f.return,Xe=D;break}Xe=f.return}}function Lu(u){for(;Xe!==null;){var f=Xe;try{switch(f.tag){case 0:case 11:case 15:var D=f.return;try{_l(4,f)}catch(Re){hn(f,D,Re)}break;case 1:var H=f.stateNode;if(typeof H.componentDidMount=="function"){var K=f.return;try{H.componentDidMount()}catch(Re){hn(f,K,Re)}}var ne=f.return;try{ku(f)}catch(Re){hn(f,ne,Re)}break;case 5:var le=f.return;try{ku(f)}catch(Re){hn(f,le,Re)}}}catch(Re){hn(f,f.return,Re)}if(f===u){Xe=null;break}var ye=f.sibling;if(ye!==null){ye.return=f.return,Xe=ye;break}Xe=f.return}}var ho=0,kr=1,Hi=2,Sl=3,xs=4;if(typeof Symbol=="function"&&Symbol.for){var ei=Symbol.for;ho=ei("selector.component"),kr=ei("selector.has_pseudo_class"),Hi=ei("selector.role"),Sl=ei("selector.test_id"),xs=ei("selector.text")}function Gi(u){var f=he(u);if(f!=null){if(typeof f.memoizedProps["data-testname"]!="string")throw Error(s(364));return f}if(u=Le(u),u===null)throw Error(s(362));return u.stateNode.current}function Ps(u,f){switch(f.$$typeof){case ho:if(u.type===f.value)return!0;break;case kr:e:{f=f.value,u=[u,0];for(var D=0;D<u.length;){var H=u[D++],K=u[D++],ne=f[K];if(H.tag!==5||!xe(H)){for(;ne!=null&&Ps(H,ne);)K++,ne=f[K];if(K===f.length){f=!0;break e}else for(H=H.child;H!==null;)u.push(H,K),H=H.sibling}}f=!1}return f;case Hi:if(u.tag===5&&je(u.stateNode,f.value))return!0;break;case xs:if((u.tag===5||u.tag===6)&&(u=ve(u),u!==null&&0<=u.indexOf(f.value)))return!0;break;case Sl:if(u.tag===5&&(u=u.memoizedProps["data-testname"],typeof u=="string"&&u.toLowerCase()===f.value.toLowerCase()))return!0;break;default:throw Error(s(365))}return!1}function Nu(u){switch(u.$$typeof){case ho:return"<"+(T(u.value)||"Unknown")+">";case kr:return":has("+(Nu(u)||"")+")";case Hi:return'[role="'+u.value+'"]';case xs:return'"'+u.value+'"';case Sl:return'[data-testname="'+u.value+'"]';default:throw Error(s(365))}}function Vi(u,f){var D=[];u=[u,0];for(var H=0;H<u.length;){var K=u[H++],ne=u[H++],le=f[ne];if(K.tag!==5||!xe(K)){for(;le!=null&&Ps(K,le);)ne++,le=f[ne];if(ne===f.length)D.push(K);else for(K=K.child;K!==null;)u.push(K,ne),K=K.sibling}}return D}function $i(u,f){if(!Ce)throw Error(s(363));u=Gi(u),u=Vi(u,f),f=[],u=Array.from(u);for(var D=0;D<u.length;){var H=u[D++];if(H.tag===5)xe(H)||f.push(H.stateNode);else for(H=H.child;H!==null;)u.push(H),H=H.sibling}return f}var Iu=Math.ceil,Cs=c.ReactCurrentDispatcher,El=c.ReactCurrentOwner,Pn=c.ReactCurrentBatchConfig,kt=0,nn=null,mn=null,An=0,zn=0,Jo=er(0),yn=0,Ol=null,po=0,ln=0,xl=0,ja=null,pr=null,Pl=0,ks=1/0,Ar=null;function Jt(){ks=$n()+500}var Cn=!1,Mn=null,Ci=null,ea=!1,fi=null,Du=0,Ln=0,As=null,Cl=-1,kl=0;function dn(){return kt&6?$n():Cl!==-1?Cl:Cl=$n()}function Bn(u){return u.mode&1?kt&2&&An!==0?An&-An:Yp.transition!==null?(kl===0&&(kl=eu()),kl):(u=Dt,u!==0?u:_e()):1}function gr(u,f,D,H){if(50<Ln)throw Ln=0,As=null,Error(s(185));ai(u,D,H),(!(kt&2)||u!==nn)&&(u===nn&&(!(kt&2)&&(ln|=D),yn===4&&go(u,An)),vr(u,H),D===1&&kt===0&&!(f.mode&1)&&(Jt(),ll&&tr()))}function vr(u,f){var D=u.callbackNode;Wd(u,f);var H=rl(u,u===nn?An:0);if(H===0)D!==null&&Yd(D),u.callbackNode=null,u.callbackPriority=0;else if(f=H&-H,u.callbackPriority!==f){if(D!=null&&Yd(D),f===1)u.tag===0?Xd(ef.bind(null,u)):ou(ef.bind(null,u)),ce?pe(function(){!(kt&6)&&tr()}):Fi(tu,tr),D=null;else{switch(ol(H)){case 1:D=tu;break;case 4:D=nu;break;case 16:D=ru;break;case 536870912:D=Wp;break;default:D=ru}D=sf(D,ju.bind(null,u))}u.callbackPriority=f,u.callbackNode=D}}function ju(u,f){if(Cl=-1,kl=0,kt&6)throw Error(s(327));var D=u.callbackNode;if(vo()&&u.callbackNode!==D)return null;var H=rl(u,u===nn?An:0);if(H===0)return null;if(H&30||H&u.expiredLanes||f)f=Fa(u,H);else{f=H;var K=kt;kt|=2;var ne=nf();(nn!==u||An!==f)&&(Ar=null,Jt(),ta(u,f));do try{rf();break}catch(ye){Al(u,ye)}while(!0);Tc(),Cs.current=ne,kt=K,mn!==null?f=0:(nn=null,An=0,f=yn)}if(f!==0){if(f===2&&(K=Js(u),K!==0&&(H=K,f=Fu(u,K))),f===1)throw D=Ol,ta(u,0),go(u,H),vr(u,$n()),D;if(f===6)go(u,H);else{if(K=u.current.alternate,!(H&30)&&!yh(K)&&(f=Fa(u,H),f===2&&(ne=Js(u),ne!==0&&(H=ne,f=Fu(u,ne))),f===1))throw D=Ol,ta(u,0),go(u,H),vr(u,$n()),D;switch(u.finishedWork=K,u.finishedLanes=H,f){case 0:case 1:throw Error(s(345));case 2:na(u,pr,Ar);break;case 3:if(go(u,H),(H&130023424)===H&&(f=Pl+500-$n(),10<f)){if(rl(u,0)!==0)break;if(K=u.suspendedLanes,(K&H)!==H){dn(),u.pingedLanes|=u.suspendedLanes&K;break}u.timeoutHandle=W(na.bind(null,u,pr,Ar),f);break}na(u,pr,Ar);break;case 4:if(go(u,H),(H&4194240)===H)break;for(f=u.eventTimes,K=-1;0<H;){var le=31-Gr(H);ne=1<<le,le=f[le],le>K&&(K=le),H&=~ne}if(H=K,H=$n()-H,H=(120>H?120:480>H?480:1080>H?1080:1920>H?1920:3e3>H?3e3:4320>H?4320:1960*Iu(H/1960))-H,10<H){u.timeoutHandle=W(na.bind(null,u,pr,Ar),H);break}na(u,pr,Ar);break;case 5:na(u,pr,Ar);break;default:throw Error(s(329))}}}return vr(u,$n()),u.callbackNode===D?ju.bind(null,u):null}function Fu(u,f){var D=ja;return u.current.memoizedState.isDehydrated&&(ta(u,f).flags|=256),u=Fa(u,f),u!==2&&(f=pr,pr=D,f!==null&&zu(f)),u}function zu(u){pr===null?pr=u:pr.push.apply(pr,u)}function yh(u){for(var f=u;;){if(f.flags&16384){var D=f.updateQueue;if(D!==null&&(D=D.stores,D!==null))for(var H=0;H<D.length;H++){var K=D[H],ne=K.getSnapshot;K=K.value;try{if(!wi(ne(),K))return!1}catch{return!1}}}if(D=f.child,f.subtreeFlags&16384&&D!==null)D.return=f,f=D;else{if(f===u)break;for(;f.sibling===null;){if(f.return===null||f.return===u)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function go(u,f){for(f&=~xl,f&=~ln,u.suspendedLanes|=f,u.pingedLanes&=~f,u=u.expirationTimes;0<f;){var D=31-Gr(f),H=1<<D;u[D]=-1,f&=~H}}function ef(u){if(kt&6)throw Error(s(327));vo();var f=rl(u,0);if(!(f&1))return vr(u,$n()),null;var D=Fa(u,f);if(u.tag!==0&&D===2){var H=Js(u);H!==0&&(f=H,D=Fu(u,H))}if(D===1)throw D=Ol,ta(u,0),go(u,f),vr(u,$n()),D;if(D===6)throw Error(s(345));return u.finishedWork=u.current.alternate,u.finishedLanes=f,na(u,pr,Ar),vr(u,$n()),null}function tf(u){fi!==null&&fi.tag===0&&!(kt&6)&&vo();var f=kt;kt|=1;var D=Pn.transition,H=Dt;try{if(Pn.transition=null,Dt=1,u)return u()}finally{Dt=H,Pn.transition=D,kt=f,!(kt&6)&&tr()}}function Bu(){zn=Jo.current,cn(Jo)}function ta(u,f){u.finishedWork=null,u.finishedLanes=0;var D=u.timeoutHandle;if(D!==re&&(u.timeoutHandle=re,te(D)),mn!==null)for(D=mn.return;D!==null;){var H=D;switch(us(H),H.tag){case 1:H=H.type.childContextTypes,H!=null&&pa();break;case 3:_a(),cn(jr),cn(fr),Dc();break;case 5:Nc(H);break;case 4:_a();break;case 13:cn(On);break;case 19:cn(On);break;case 10:fs(H.type._context);break;case 22:case 23:Bu()}D=D.return}if(nn=u,mn=u=ra(u.current,null),An=zn=f,yn=0,Ol=null,xl=ln=po=0,pr=ja=null,Bo!==null){for(f=0;f<Bo.length;f++)if(D=Bo[f],H=D.interleaved,H!==null){D.interleaved=null;var K=H.next,ne=D.pending;if(ne!==null){var le=ne.next;ne.next=K,H.next=le}D.pending=H}Bo=null}return u}function Al(u,f){do{var D=mn;try{if(Tc(),Br.current=Ca,hl){for(var H=gn.memoizedState;H!==null;){var K=H.queue;K!==null&&(K.pending=null),H=H.next}hl=!1}if(Go=0,jn=Rn=gn=null,hs=!1,ps=0,El.current=null,D===null||D.return===null){yn=1,Ol=f,mn=null;break}e:{var ne=u,le=D.return,ye=D,Re=f;if(f=An,ye.flags|=32768,Re!==null&&typeof Re=="object"&&typeof Re.then=="function"){var Ge=Re,it=ye,Ot=it.tag;if(!(it.mode&1)&&(Ot===0||Ot===11||Ot===15)){var Qe=it.alternate;Qe?(it.updateQueue=Qe.updateQueue,it.memoizedState=Qe.memoizedState,it.lanes=Qe.lanes):(it.updateQueue=null,it.memoizedState=null)}var sn=ph(le);if(sn!==null){sn.flags&=-257,Wo(sn,le,ye,ne,f),sn.mode&1&&hh(ne,Ge,f),f=sn,Re=Ge;var Qt=f.updateQueue;if(Qt===null){var Tr=new Set;Tr.add(Re),f.updateQueue=Tr}else Qt.add(Re);break e}else{if(!(f&1)){hh(ne,Ge,f),Tl();break e}Re=Error(s(426))}}else if(fn&&ye.mode&1){var Wi=ph(le);if(Wi!==null){!(Wi.flags&65536)&&(Wi.flags|=256),Wo(Wi,le,ye,ne,f),kc(ka(Re,ye));break e}}ne=Re=ka(Re,ye),yn!==4&&(yn=2),ja===null?ja=[ne]:ja.push(ne),ne=le;do{switch(ne.tag){case 3:ne.flags|=65536,f&=-f,ne.lanes|=f;var ke=Bi(ne,Re,f);fl(ne,ke);break e;case 1:ye=Re;var be=ne.type,Ne=ne.stateNode;if(!(ne.flags&128)&&(typeof be.getDerivedStateFromError=="function"||Ne!==null&&typeof Ne.componentDidCatch=="function"&&(Ci===null||!Ci.has(Ne)))){ne.flags|=65536,f&=-f,ne.lanes|=f;var Je=Ou(ne,ye,f);fl(ne,Je);break e}}ne=ne.return}while(ne!==null)}af(D)}catch(pt){f=pt,mn===D&&D!==null&&(mn=D=D.return);continue}break}while(!0)}function nf(){var u=Cs.current;return Cs.current=Ca,u===null?Ca:u}function Tl(){(yn===0||yn===3||yn===2)&&(yn=4),nn===null||!(po&268435455)&&!(ln&268435455)||go(nn,An)}function Fa(u,f){var D=kt;kt|=2;var H=nf();(nn!==u||An!==f)&&(Ar=null,ta(u,f));do try{bh();break}catch(K){Al(u,K)}while(!0);if(Tc(),kt=D,Cs.current=H,mn!==null)throw Error(s(261));return nn=null,An=0,yn}function bh(){for(;mn!==null;)of(mn)}function rf(){for(;mn!==null&&!Kd();)of(mn)}function of(u){var f=Oh(u.alternate,u,zn);u.memoizedProps=u.pendingProps,f===null?af(u):mn=f,El.current=null}function af(u){var f=u;do{var D=f.alternate;if(u=f.return,f.flags&32768){if(D=vh(D,f),D!==null){D.flags&=32767,mn=D;return}if(u!==null)u.flags|=32768,u.subtreeFlags=0,u.deletions=null;else{yn=6,mn=null;return}}else if(D=La(D,f,zn),D!==null){mn=D;return}if(f=f.sibling,f!==null){mn=f;return}mn=f=u}while(f!==null);yn===0&&(yn=5)}function na(u,f,D){var H=Dt,K=Pn.transition;try{Pn.transition=null,Dt=1,_h(u,f,D,H)}finally{Pn.transition=K,Dt=H}return null}function _h(u,f,D,H){do vo();while(fi!==null);if(kt&6)throw Error(s(327));D=u.finishedWork;var K=u.finishedLanes;if(D===null)return null;if(u.finishedWork=null,u.finishedLanes=0,D===u.current)throw Error(s(177));u.callbackNode=null,u.callbackPriority=0;var ne=D.lanes|D.childLanes;if(jo(u,ne),u===nn&&(mn=nn=null,An=0),!(D.subtreeFlags&2064)&&!(D.flags&2064)||ea||(ea=!0,sf(ru,function(){return vo(),null})),ne=(D.flags&15990)!==0,D.subtreeFlags&15990||ne){ne=Pn.transition,Pn.transition=null;var le=Dt;Dt=1;var ye=kt;kt|=4,El.current=null,mh(u,D),Os(D,u),z(u.containerInfo),u.current=D,wl(D),as(),kt=ye,Dt=le,Pn.transition=ne}else u.current=D;if(ea&&(ea=!1,fi=u,Du=K),ne=u.pendingLanes,ne===0&&(Ci=null),al(D.stateNode),vr(u,$n()),f!==null)for(H=u.onRecoverableError,D=0;D<f.length;D++)K=f[D],H(K.value,{componentStack:K.stack,digest:K.digest});if(Cn)throw Cn=!1,u=Mn,Mn=null,u;return Du&1&&u.tag!==0&&vo(),ne=u.pendingLanes,ne&1?u===As?Ln++:(Ln=0,As=u):Ln=0,tr(),null}function vo(){if(fi!==null){var u=ol(Du),f=Pn.transition,D=Dt;try{if(Pn.transition=null,Dt=16>u?16:u,fi===null)var H=!1;else{if(u=fi,fi=null,Du=0,kt&6)throw Error(s(331));var K=kt;for(kt|=4,Xe=u.current;Xe!==null;){var ne=Xe,le=ne.child;if(Xe.flags&16){var ye=ne.deletions;if(ye!==null){for(var Re=0;Re<ye.length;Re++){var Ge=ye[Re];for(Xe=Ge;Xe!==null;){var it=Xe;switch(it.tag){case 0:case 11:case 15:Na(8,it,ne)}var Ot=it.child;if(Ot!==null)Ot.return=it,Xe=Ot;else for(;Xe!==null;){it=Xe;var Qe=it.sibling,sn=it.return;if(Ss(it),it===Ge){Xe=null;break}if(Qe!==null){Qe.return=sn,Xe=Qe;break}Xe=sn}}}var Qt=ne.alternate;if(Qt!==null){var Tr=Qt.child;if(Tr!==null){Qt.child=null;do{var Wi=Tr.sibling;Tr.sibling=null,Tr=Wi}while(Tr!==null)}}Xe=ne}}if(ne.subtreeFlags&2064&&le!==null)le.return=ne,Xe=le;else e:for(;Xe!==null;){if(ne=Xe,ne.flags&2048)switch(ne.tag){case 0:case 11:case 15:Na(9,ne,ne.return)}var ke=ne.sibling;if(ke!==null){ke.return=ne.return,Xe=ke;break e}Xe=ne.return}}var be=u.current;for(Xe=be;Xe!==null;){le=Xe;var Ne=le.child;if(le.subtreeFlags&2064&&Ne!==null)Ne.return=le,Xe=Ne;else e:for(le=be;Xe!==null;){if(ye=Xe,ye.flags&2048)try{switch(ye.tag){case 0:case 11:case 15:_l(9,ye)}}catch(pt){hn(ye,ye.return,pt)}if(ye===le){Xe=null;break e}var Je=ye.sibling;if(Je!==null){Je.return=ye.return,Xe=Je;break e}Xe=ye.return}}if(kt=K,tr(),Fr&&typeof Fr.onPostCommitFiberRoot=="function")try{Fr.onPostCommitFiberRoot(Fo,u)}catch{}H=!0}return H}finally{Dt=D,Pn.transition=f}}return!1}function lf(u,f,D){f=ka(D,f),f=Bi(u,f,1),u=so(u,f,1),f=dn(),u!==null&&(ai(u,1,f),vr(u,f))}function hn(u,f,D){if(u.tag===3)lf(u,u,D);else for(;f!==null;){if(f.tag===3){lf(f,u,D);break}else if(f.tag===1){var H=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof H.componentDidCatch=="function"&&(Ci===null||!Ci.has(H))){u=ka(D,u),u=Ou(f,u,1),f=so(f,u,1),u=dn(),f!==null&&(ai(f,1,u),vr(f,u));break}}f=f.return}}function wh(u,f,D){var H=u.pingCache;H!==null&&H.delete(f),f=dn(),u.pingedLanes|=u.suspendedLanes&D,nn===u&&(An&D)===D&&(yn===4||yn===3&&(An&130023424)===An&&500>$n()-Pl?ta(u,0):xl|=D),vr(u,f)}function Sh(u,f){f===0&&(u.mode&1?(f=os,os<<=1,!(os&130023424)&&(os=4194304)):f=1);var D=dn();u=xi(u,f),u!==null&&(ai(u,f,D),vr(u,D))}function Eh(u){var f=u.memoizedState,D=0;f!==null&&(D=f.retryLane),Sh(u,D)}function Zp(u,f){var D=0;switch(u.tag){case 13:var H=u.stateNode,K=u.memoizedState;K!==null&&(D=K.retryLane);break;case 19:H=u.stateNode;break;default:throw Error(s(314))}H!==null&&H.delete(f),Sh(u,D)}var Oh;Oh=function(u,f,D){if(u!==null)if(u.memoizedProps!==f.pendingProps||jr.current)Fn=!0;else{if(!(u.lanes&D)&&!(f.flags&128))return Fn=!1,Ko(u,f,D);Fn=!!(u.flags&131072)}else Fn=!1,fn&&f.flags&1048576&&Zd(f,ga,f.index);switch(f.lanes=0,f.tag){case 2:var H=f.type;ws(u,f),u=f.pendingProps;var K=io(f,fr.current);cl(f,D),K=gs(null,f,H,u,K,D);var ne=gu();return f.flags|=1,typeof K=="object"&&K!==null&&typeof K.render=="function"&&K.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,Vn(H)?(ne=!0,tl(f)):ne=!1,f.memoizedState=K.state!==null&&K.state!==void 0?K.state:null,Mc(f),K.updater=ys,f.stateNode=K,K._reactInternals=f,zi(f,H,u,D),f=dr(null,f,H,!0,ne,D)):(f.tag=0,fn&&ne&&ss(f),Yn(null,f,K,D),f=f.child),f;case 16:H=f.elementType;e:{switch(ws(u,f),u=f.pendingProps,K=H._init,H=K(H._payload),f.type=H,K=f.tag=Qp(H),u=Kr(H,u),K){case 0:f=Ui(null,f,H,u,D);break e;case 1:f=ir(null,f,H,u,D);break e;case 11:f=xu(null,f,H,u,D);break e;case 14:f=Aa(null,f,H,Kr(H.type,u),D);break e}throw Error(s(306,H,""))}return f;case 0:return H=f.type,K=f.pendingProps,K=f.elementType===H?K:Kr(H,K),Ui(u,f,H,K,D);case 1:return H=f.type,K=f.pendingProps,K=f.elementType===H?K:Kr(H,K),ir(u,f,H,K,D);case 3:e:{if(Yo(f),u===null)throw Error(s(387));H=f.pendingProps,ne=f.memoizedState,K=ne.element,oh(u,f),Uo(f,H,null,D);var le=f.memoizedState;if(H=le.element,de&&ne.isDehydrated)if(ne={element:H,isDehydrated:!1,cache:le.cache,pendingSuspenseBoundaries:le.pendingSuspenseBoundaries,transitions:le.transitions},f.updateQueue.baseState=ne,f.memoizedState=ne,f.flags&256){K=ka(Error(s(423)),f),f=Ta(u,f,H,D,K);break e}else if(H!==K){K=ka(Error(s(424)),f),f=Ta(u,f,H,D,K);break e}else for(de&&(Or=Et(f.stateNode.containerInfo),nr=f,fn=!0,Oi=null,cs=!1),D=rh(f,null,H,D),f.child=D;D;)D.flags=D.flags&-3|4096,D=D.sibling;else{if(va(),H===K){f=fo(u,f,D);break e}Yn(u,f,H,D)}f=f.child}return f;case 5:return Lc(f),u===null&&Cc(f),H=f.type,K=f.pendingProps,ne=u!==null?u.memoizedProps:null,le=K.children,G(H,K)?le=null:ne!==null&&G(H,ne)&&(f.flags|=32),tn(u,f),Yn(u,f,le,D),f.child;case 6:return u===null&&Cc(f),null;case 13:return Xc(u,f,D);case 4:return hu(f,f.stateNode.containerInfo),H=f.pendingProps,u===null?f.child=ya(f,null,H,D):Yn(u,f,H,D),f.child;case 11:return H=f.type,K=f.pendingProps,K=f.elementType===H?K:Kr(H,K),xu(u,f,H,K,D);case 7:return Yn(u,f,f.pendingProps,D),f.child;case 8:return Yn(u,f,f.pendingProps.children,D),f.child;case 12:return Yn(u,f,f.pendingProps.children,D),f.child;case 10:e:{if(H=f.type._context,K=f.pendingProps,ne=f.memoizedProps,le=K.value,ih(f,H,le),ne!==null)if(wi(ne.value,le)){if(ne.children===K.children&&!jr.current){f=fo(u,f,D);break e}}else for(ne=f.child,ne!==null&&(ne.return=f);ne!==null;){var ye=ne.dependencies;if(ye!==null){le=ne.child;for(var Re=ye.firstContext;Re!==null;){if(Re.context===H){if(ne.tag===1){Re=lo(-1,D&-D),Re.tag=2;var Ge=ne.updateQueue;if(Ge!==null){Ge=Ge.shared;var it=Ge.pending;it===null?Re.next=Re:(Re.next=it.next,it.next=Re),Ge.pending=Re}}ne.lanes|=D,Re=ne.alternate,Re!==null&&(Re.lanes|=D),ba(ne.return,D,f),ye.lanes|=D;break}Re=Re.next}}else if(ne.tag===10)le=ne.type===f.type?null:ne.child;else if(ne.tag===18){if(le=ne.return,le===null)throw Error(s(341));le.lanes|=D,ye=le.alternate,ye!==null&&(ye.lanes|=D),ba(le,D,f),le=ne.sibling}else le=ne.child;if(le!==null)le.return=ne;else for(le=ne;le!==null;){if(le===f){le=null;break}if(ne=le.sibling,ne!==null){ne.return=le.return,le=ne;break}le=le.return}ne=le}Yn(u,f,K.children,D),f=f.child}return f;case 9:return K=f.type,H=f.pendingProps.children,cl(f,D),K=$r(K),H=H(K),f.flags|=1,Yn(u,f,H,D),f.child;case 14:return H=f.type,K=Kr(H,f.pendingProps),K=Kr(H.type,K),Aa(u,f,H,K,D);case 15:return co(u,f,f.type,f.pendingProps,D);case 17:return H=f.type,K=f.pendingProps,K=f.elementType===H?K:Kr(H,K),ws(u,f),f.tag=1,Vn(H)?(u=!0,tl(f)):u=!1,cl(f,D),dh(f,H,K),zi(f,H,K,D),dr(null,f,H,!0,u,D);case 19:return Cu(u,f,D);case 22:return an(u,f,D)}throw Error(s(156,f.tag))};function sf(u,f){return Fi(u,f)}function xh(u,f,D,H){this.tag=u,this.key=D,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=H,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ti(u,f,D,H){return new xh(u,f,D,H)}function Rl(u){return u=u.prototype,!(!u||!u.isReactComponent)}function Qp(u){if(typeof u=="function")return Rl(u)?1:0;if(u!=null){if(u=u.$$typeof,u===p)return 11;if(u===g)return 14}return 2}function ra(u,f){var D=u.alternate;return D===null?(D=ti(u.tag,f,u.key,u.mode),D.elementType=u.elementType,D.type=u.type,D.stateNode=u.stateNode,D.alternate=u,u.alternate=D):(D.pendingProps=f,D.type=u.type,D.flags=0,D.subtreeFlags=0,D.deletions=null),D.flags=u.flags&14680064,D.childLanes=u.childLanes,D.lanes=u.lanes,D.child=u.child,D.memoizedProps=u.memoizedProps,D.memoizedState=u.memoizedState,D.updateQueue=u.updateQueue,f=u.dependencies,D.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},D.sibling=u.sibling,D.index=u.index,D.ref=u.ref,D}function Uu(u,f,D,H,K,ne){var le=2;if(H=u,typeof u=="function")Rl(u)&&(le=1);else if(typeof u=="string")le=5;else e:switch(u){case _:return or(D.children,K,ne,f);case E:le=8,K|=8;break;case O:return u=ti(12,D,f,K|2),u.elementType=O,u.lanes=ne,u;case h:return u=ti(13,D,f,K),u.elementType=h,u.lanes=ne,u;case P:return u=ti(19,D,f,K),u.elementType=P,u.lanes=ne,u;case b:return Ml(D,K,ne,f);default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case v:le=10;break e;case S:le=9;break e;case p:le=11;break e;case g:le=14;break e;case y:le=16,H=null;break e}throw Error(s(130,u==null?u:typeof u,""))}return f=ti(le,D,f,K),f.elementType=u,f.type=H,f.lanes=ne,f}function or(u,f,D,H){return u=ti(7,u,H,f),u.lanes=D,u}function Ml(u,f,D,H){return u=ti(22,u,H,f),u.elementType=b,u.lanes=D,u.stateNode={isHidden:!1},u}function Ll(u,f,D){return u=ti(6,u,null,f),u.lanes=D,u}function qu(u,f,D){return f=ti(4,u.children!==null?u.children:[],u.key,f),f.lanes=D,f.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},f}function Ph(u,f,D,H,K){this.tag=f,this.containerInfo=u,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=re,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=il(0),this.expirationTimes=il(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=il(0),this.identifierPrefix=H,this.onRecoverableError=K,de&&(this.mutableSourceEagerHydrationData=null)}function uf(u,f,D,H,K,ne,le,ye,Re){return u=new Ph(u,f,D,ye,Re),f===1?(f=1,ne===!0&&(f|=8)):f=0,ne=ti(3,null,null,f),u.current=ne,ne.stateNode=u,ne.memoizedState={element:H,isDehydrated:D,cache:null,transitions:null,pendingSuspenseBoundaries:null},Mc(ne),u}function Hu(u){if(!u)return Do;u=u._reactInternals;e:{if(I(u)!==u||u.tag!==1)throw Error(s(170));var f=u;do{switch(f.tag){case 3:f=f.stateNode.context;break e;case 1:if(Vn(f.type)){f=f.stateNode.__reactInternalMemoizedMergedChildContext;break e}}f=f.return}while(f!==null);throw Error(s(171))}if(u.tag===1){var D=u.type;if(Vn(D))return Vd(u,D,f)}return f}function za(u){var f=u._reactInternals;if(f===void 0)throw typeof u.render=="function"?Error(s(188)):(u=Object.keys(u).join(","),Error(s(268,u)));return u=L(f),u===null?null:u.stateNode}function Gu(u,f){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var D=u.retryLane;u.retryLane=D!==0&&D<f?D:f}}function Nl(u,f){Gu(u,f),(u=u.alternate)&&Gu(u,f)}function Jp(u){return u=L(u),u===null?null:u.stateNode}function Ch(){return null}return t.attemptContinuousHydration=function(u){if(u.tag===13){var f=xi(u,134217728);if(f!==null){var D=dn();gr(f,u,134217728,D)}Nl(u,134217728)}},t.attemptDiscreteHydration=function(u){if(u.tag===13){var f=xi(u,1);if(f!==null){var D=dn();gr(f,u,1,D)}Nl(u,1)}},t.attemptHydrationAtCurrentPriority=function(u){if(u.tag===13){var f=Bn(u),D=xi(u,f);if(D!==null){var H=dn();gr(D,u,f,H)}Nl(u,f)}},t.attemptSynchronousHydration=function(u){switch(u.tag){case 3:var f=u.stateNode;if(f.current.memoizedState.isDehydrated){var D=nl(f.pendingLanes);D!==0&&(ji(f,D|1),vr(f,$n()),!(kt&6)&&(Jt(),tr()))}break;case 13:tf(function(){var H=xi(u,1);if(H!==null){var K=dn();gr(H,u,1,K)}}),Nl(u,1)}},t.batchedUpdates=function(u,f){var D=kt;kt|=1;try{return u(f)}finally{kt=D,kt===0&&(Jt(),ll&&tr())}},t.createComponentSelector=function(u){return{$$typeof:ho,value:u}},t.createContainer=function(u,f,D,H,K,ne,le){return uf(u,f,!1,null,D,H,K,ne,le)},t.createHasPseudoClassSelector=function(u){return{$$typeof:kr,value:u}},t.createHydrationContainer=function(u,f,D,H,K,ne,le,ye,Re){return u=uf(D,H,!0,u,K,ne,le,ye,Re),u.context=Hu(null),D=u.current,H=dn(),K=Bn(D),ne=lo(H,K),ne.callback=f??null,so(D,ne,K),u.current.lanes=K,ai(u,K,H),vr(u,H),u},t.createPortal=function(u,f,D){var H=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:w,key:H==null?null:""+H,children:u,containerInfo:f,implementation:D}},t.createRoleSelector=function(u){return{$$typeof:Hi,value:u}},t.createTestNameSelector=function(u){return{$$typeof:Sl,value:u}},t.createTextSelector=function(u){return{$$typeof:xs,value:u}},t.deferredUpdates=function(u){var f=Dt,D=Pn.transition;try{return Pn.transition=null,Dt=16,u()}finally{Dt=f,Pn.transition=D}},t.discreteUpdates=function(u,f,D,H,K){var ne=Dt,le=Pn.transition;try{return Pn.transition=null,Dt=1,u(f,D,H,K)}finally{Dt=ne,Pn.transition=le,kt===0&&Jt()}},t.findAllNodes=$i,t.findBoundingRects=function(u,f){if(!Ce)throw Error(s(363));f=$i(u,f),u=[];for(var D=0;D<f.length;D++)u.push(ue(f[D]));for(f=u.length-1;0<f;f--){D=u[f];for(var H=D.x,K=H+D.width,ne=D.y,le=ne+D.height,ye=f-1;0<=ye;ye--)if(f!==ye){var Re=u[ye],Ge=Re.x,it=Ge+Re.width,Ot=Re.y,Qe=Ot+Re.height;if(H>=Ge&&ne>=Ot&&K<=it&&le<=Qe){u.splice(f,1);break}else if(H!==Ge||D.width!==Re.width||Qe<ne||Ot>le){if(!(ne!==Ot||D.height!==Re.height||it<H||Ge>K)){Ge>H&&(Re.width+=Ge-H,Re.x=H),it<K&&(Re.width=K-Ge),u.splice(f,1);break}}else{Ot>ne&&(Re.height+=Ot-ne,Re.y=ne),Qe<le&&(Re.height=le-Ot),u.splice(f,1);break}}}return u},t.findHostInstance=za,t.findHostInstanceWithNoPortals=function(u){return u=A(u),u=u!==null?R(u):null,u===null?null:u.stateNode},t.findHostInstanceWithWarning=function(u){return za(u)},t.flushControlled=function(u){var f=kt;kt|=1;var D=Pn.transition,H=Dt;try{Pn.transition=null,Dt=1,u()}finally{Dt=H,Pn.transition=D,kt=f,kt===0&&(Jt(),tr())}},t.flushPassiveEffects=vo,t.flushSync=tf,t.focusWithin=function(u,f){if(!Ce)throw Error(s(363));for(u=Gi(u),f=Vi(u,f),f=Array.from(f),u=0;u<f.length;){var D=f[u++];if(!xe(D)){if(D.tag===5&&at(D.stateNode))return!0;for(D=D.child;D!==null;)f.push(D),D=D.sibling}}return!1},t.getCurrentUpdatePriority=function(){return Dt},t.getFindAllNodesFailureDescription=function(u,f){if(!Ce)throw Error(s(363));var D=0,H=[];u=[Gi(u),0];for(var K=0;K<u.length;){var ne=u[K++],le=u[K++],ye=f[le];if((ne.tag!==5||!xe(ne))&&(Ps(ne,ye)&&(H.push(Nu(ye)),le++,le>D&&(D=le)),le<f.length))for(ne=ne.child;ne!==null;)u.push(ne,le),ne=ne.sibling}if(D<f.length){for(u=[];D<f.length;D++)u.push(Nu(f[D]));return`findAllNodes was able to match part of the selector:
58
- `+(H.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 X(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:Jp,findFiberByHostInstance:u.findFiberByHostInstance||Ch,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")u=!1;else{var f=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(f.isDisabled||!f.supportsFiber)u=!0;else{try{Fo=f.inject(u),Fr=f}catch{}u=!!f.checkDCE}}return u},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(u,f,D,H){if(!Ce)throw Error(s(363));u=$i(u,f);var K=ht(u,D,H).disconnect;return{disconnect:function(){K()}}},t.registerMutableSourceForHydration=function(u,f){var D=f._getVersion;D=D(f._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[f,D]:u.mutableSourceEagerHydrationData.push(f,D)},t.runWithPriority=function(u,f){var D=Dt;try{return Dt=u,f()}finally{Dt=D}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(u,f,D,H){var K=f.current,ne=dn(),le=Bn(K);return D=Hu(D),f.context===null?f.context=D:f.pendingContext=D,f=lo(ne,le),f.payload={element:u},H=H===void 0?null:H,H!==null&&(f.callback=H),u=so(K,f,le),u!==null&&(gr(u,K,le,ne),ds(u,K,le)),le},t}),V0}var Wy;function m9(){return Wy||(Wy=1,G0.exports=v9()),G0.exports}var y9=m9();const b9=Rd(y9);var $0={exports:{}},Hl={};/**
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 Yy;function _9(){return Yy||(Yy=1,Hl.ConcurrentRoot=1,Hl.ContinuousEventPriority=4,Hl.DefaultEventPriority=16,Hl.DiscreteEventPriority=1,Hl.IdleEventPriority=536870912,Hl.LegacyRoot=0),Hl}var Ky;function w9(){return Ky||(Ky=1,$0.exports=_9()),$0.exports}var $5=w9(),S9=Nt();const Xy={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let Zy=!1,Qy=!1;const yv=".react-konva-event";let W5=!1;function E9(e){W5=e}const O9=`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
- `,x9=`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
- `,P9={};function Ip(e,i,t=P9){if(!Zy&&"zIndex"in i&&(console.warn(x9),Zy=!0),!Qy&&i.draggable){var n=i.x!==void 0||i.y!==void 0,a=i.onDragEnd||i.onDragMove;n&&!a&&(console.warn(O9),Qy=!0)}for(var l in t)if(!Xy[l]){var s=l.slice(0,2)==="on",c=t[l]!==i[l];if(s&&c){var d=l.substr(2).toLowerCase();d.substr(0,7)==="content"&&(d="content"+d.substr(7,1).toUpperCase()+d.substr(8)),e.off(d,t[l])}var w=!i.hasOwnProperty(l);w&&e.setAttr(l,void 0)}var _=W5||i._useStrictMode,E={},O=!1;const v={};for(var l in i)if(!Xy[l]){var s=l.slice(0,2)==="on",S=t[l]!==i[l];if(s&&S){var d=l.substr(2).toLowerCase();d.substr(0,7)==="content"&&(d="content"+d.substr(7,1).toUpperCase()+d.substr(8)),i[l]&&(v[d]=i[l])}!s&&(i[l]!==t[l]||_&&i[l]!==e.getAttr(l))&&(O=!0,E[l]=i[l])}O&&(e.setAttrs(E),es(e));for(var d in v)e.on(d+yv,v[d])}function es(e){if(!S9.Konva.autoDrawEnabled){var i=e.getLayer()||e.getStage();i&&i.batchDraw()}}var W0=$g();const Y5={},C9={};Pd.Node.prototype._applyProps=Ip;function k9(e,i){if(typeof i=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${i}`);return}e.add(i),es(e)}function A9(e,i,t){let n=Pd[e];n||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),n=Pd.Group);const a={},l={};for(var s in i){var c=s.slice(0,2)==="on";c?l[s]=i[s]:a[s]=i[s]}const d=new n(a);return Ip(d,l),d}function T9(e,i,t){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function R9(e,i,t){return!1}function M9(e){return e}function L9(){return null}function N9(){return null}function I9(e,i,t,n){return C9}function D9(){}function j9(e){}function F9(e,i){return!1}function z9(){return Y5}function B9(){return Y5}const U9=setTimeout,q9=clearTimeout,H9=-1;function G9(e,i){return!1}const V9=!1,$9=!0,W9=!0;function Y9(e,i){i.parent===e?i.moveToTop():e.add(i),es(e)}function K9(e,i){i.parent===e?i.moveToTop():e.add(i),es(e)}function K5(e,i,t){i._remove(),e.add(i),i.setZIndex(t.getZIndex()),es(e)}function X9(e,i,t){K5(e,i,t)}function Z9(e,i){i.destroy(),i.off(yv),es(e)}function Q9(e,i){i.destroy(),i.off(yv),es(e)}function J9(e,i,t){console.error(`Text components are not yet supported in ReactKonva. You text is: "${t}"`)}function e7(e,i,t){}function t7(e,i,t,n,a){Ip(e,a,n)}function n7(e){e.hide(),es(e)}function r7(e){}function i7(e,i){(i.visible==null||i.visible)&&e.show()}function o7(e,i){}function a7(e){}function l7(){}const s7=()=>$5.DefaultEventPriority,u7=Object.freeze(Object.defineProperty({__proto__:null,appendChild:Y9,appendChildToContainer:K9,appendInitialChild:k9,cancelTimeout:q9,clearContainer:a7,commitMount:e7,commitTextUpdate:J9,commitUpdate:t7,createInstance:A9,createTextInstance:T9,detachDeletedInstance:l7,finalizeInitialChildren:R9,getChildHostContext:B9,getCurrentEventPriority:s7,getPublicInstance:M9,getRootHostContext:z9,hideInstance:n7,hideTextInstance:r7,idlePriority:W0.unstable_IdlePriority,insertBefore:K5,insertInContainerBefore:X9,isPrimaryRenderer:V9,noTimeout:H9,now:W0.unstable_now,prepareForCommit:L9,preparePortalMount:N9,prepareUpdate:I9,removeChild:Z9,removeChildFromContainer:Q9,resetAfterCommit:D9,resetTextContent:j9,run:W0.unstable_runWithPriority,scheduleTimeout:U9,shouldDeprioritizeSubtree:F9,shouldSetTextContent:G9,supportsMutation:W9,unhideInstance:i7,unhideTextInstance:o7,warnsIfNotActing:$9},Symbol.toStringTag,{value:"Module"}));var c7=Object.defineProperty,f7=Object.defineProperties,d7=Object.getOwnPropertyDescriptors,Jy=Object.getOwnPropertySymbols,h7=Object.prototype.hasOwnProperty,p7=Object.prototype.propertyIsEnumerable,e2=(e,i,t)=>i in e?c7(e,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[i]=t,t2=(e,i)=>{for(var t in i||(i={}))h7.call(i,t)&&e2(e,t,i[t]);if(Jy)for(var t of Jy(i))p7.call(i,t)&&e2(e,t,i[t]);return e},g7=(e,i)=>f7(e,d7(i)),n2,r2;typeof window<"u"&&((n2=window.document)!=null&&n2.createElement||((r2=window.navigator)==null?void 0:r2.product)==="ReactNative")?xn.useLayoutEffect:xn.useEffect;function X5(e,i,t){if(!e)return;if(t(e)===!0)return e;let n=e.child;for(;n;){const a=X5(n,i,t);if(a)return a;n=n.sibling}}function Z5(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const i2=console.error;console.error=function(){const e=[...arguments].join("");if(e!=null&&e.startsWith("Warning:")&&e.includes("useContext")){console.error=i2;return}return i2.apply(this,arguments)};const bv=Z5(xn.createContext(null));class Q5 extends xn.Component{render(){return xn.createElement(bv.Provider,{value:this._reactInternals},this.props.children)}}function v7(){const e=xn.useContext(bv);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const i=xn.useId();return xn.useMemo(()=>{for(const n of[e,e==null?void 0:e.alternate]){if(!n)continue;const a=X5(n,!1,l=>{let s=l.memoizedState;for(;s;){if(s.memoizedState===i)return!0;s=s.next}});if(a)return a}},[e,i])}function m7(){const e=v7(),[i]=xn.useState(()=>new Map);i.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!==bv&&!i.has(a)&&i.set(a,xn.useContext(Z5(a)))}t=t.return}return i}function J5(){const e=m7();return xn.useMemo(()=>Array.from(e.keys()).reduce((i,t)=>n=>xn.createElement(i,null,xn.createElement(t.Provider,g7(t2({},n),{value:e.get(t)}))),i=>xn.createElement(Q5,t2({},i))),[e])}function y7(e){const i=qt.useRef({});return qt.useLayoutEffect(()=>{i.current=e}),qt.useLayoutEffect(()=>()=>{i.current={}},[]),i.current}const b7=e=>{const i=qt.useRef(),t=qt.useRef(),n=qt.useRef(),a=y7(e),l=J5(),s=c=>{const{forwardedRef:d}=e;d&&(typeof d=="function"?d(c):d.current=c)};return qt.useLayoutEffect(()=>(t.current=new Pd.Stage({width:e.width,height:e.height,container:i.current}),s(t.current),n.current=nc.createContainer(t.current,$5.LegacyRoot,!1,null),nc.updateContainer(qt.createElement(l,{},e.children),n.current),()=>{Pd.isBrowser&&(s(null),nc.updateContainer(null,n.current,null),t.current.destroy())}),[]),qt.useLayoutEffect(()=>{s(t.current),Ip(t.current,e,a),nc.updateContainer(qt.createElement(l,{},e.children),n.current,null)}),qt.createElement("div",{ref:i,id:e.id,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},_7="Layer",w7="FastLayer",vp="Group",S7="Label",E7="Rect",O7="Circle",x7="Ellipse",P7="Wedge",C7="Line",k7="Sprite",A7="Image",T7="Text",R7="TextPath",M7="Star",L7="Ring",N7="Arc",I7="Tag",D7="Path",j7="RegularPolygon",F7="Arrow",z7="Shape",B7="Transformer",nc=b9(u7);nc.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:qt.version,rendererPackageName:"react-konva"});const U7=qt.forwardRef((e,i)=>qt.createElement(Q5,{},qt.createElement(b7,{...e,forwardedRef:i}))),q7=E9,H7=Object.freeze(Object.defineProperty({__proto__:null,Arc:N7,Arrow:F7,Circle:O7,Ellipse:x7,FastLayer:w7,Group:vp,Image:A7,KonvaRenderer:nc,Label:S7,Layer:_7,Line:C7,Path:D7,Rect:E7,RegularPolygon:j7,Ring:L7,Shape:z7,Sprite:k7,Stage:U7,Star:M7,Tag:I7,Text:T7,TextPath:R7,Transformer:B7,Wedge:P7,useStrictMode:q7},Symbol.toStringTag,{value:"Module"})),Ja=Xl(H7);var Y0,o2;function Dp(){if(o2)return Y0;o2=1;var e=Tn();return Y0=function(t,n,a){const l=e.useRef("loading"),s=e.useRef(),[c,d]=e.useState(0),w=e.useRef(),_=e.useRef(),E=e.useRef();return(w.current!==t||_.current!==n||E.current!==a)&&(l.current="loading",s.current=void 0,w.current=t,_.current=n,E.current=a),e.useLayoutEffect(function(){if(!t)return;var O=document.createElement("img");function v(){l.current="loaded",s.current=O,d(Math.random())}function S(){l.current="failed",s.current=void 0,d(Math.random())}return O.addEventListener("load",v),O.addEventListener("error",S),n&&(O.crossOrigin=n),a&&(O.referrerPolicy=a),O.src=t,function(){O.removeEventListener("load",v),O.removeEventListener("error",S)}},[t,n,a]),[s.current,l.current]},Y0}var id={},od={},G7=function(e,i){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&i.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)i.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(t[n[a]]=e[n[a]]);return t};const V7=e=>{const i=window.getComputedStyle(e).position;return!(i==="absolute"||i==="relative")};function e4(e=()=>{}){const i=qt.useRef(e);return i.current=e,qt.useCallback((...t)=>i.current.apply(null,t),[])}const $7=({children:e,groupProps:i,divProps:t,transform:n,transformFunc:a})=>{const l=J5(),s=qt.useRef(null),[c]=qt.useState(()=>document.createElement("div")),d=qt.useMemo(()=>M3.createRoot(c),[c]),w=n??!0,_=e4(()=>{if(w&&s.current){let p=s.current.getAbsoluteTransform().decompose();a&&(p=a(p)),c.style.position="absolute",c.style.zIndex="10",c.style.top="0px",c.style.left="0px",c.style.transform=`translate(${p.x}px, ${p.y}px) rotate(${p.rotation}deg) scaleX(${p.scaleX}) scaleY(${p.scaleY})`,c.style.transformOrigin="top left"}else c.style.position="",c.style.zIndex="",c.style.top="",c.style.left="",c.style.transform="",c.style.transformOrigin="";const E=t||{},{style:O}=E,v=G7(E,["style"]);Object.assign(c.style,O),Object.assign(c,v)});return qt.useLayoutEffect(()=>{var E;const O=s.current;if(!O)return;const v=(E=O.getStage())===null||E===void 0?void 0:E.container();if(v)return v.appendChild(c),w&&V7(v)&&(v.style.position="relative"),O.on("absoluteTransformChange",_),_(),()=>{var S;O.off("absoluteTransformChange",_),(S=c.parentNode)===null||S===void 0||S.removeChild(c)}},[w]),qt.useLayoutEffect(()=>{_()},[t,a]),qt.useLayoutEffect(()=>{d.render(qt.createElement(l,null,e))}),qt.useLayoutEffect(()=>()=>{setTimeout(()=>{d.unmount()})},[]),qt.createElement(vp,Object.assign({ref:s},i))},W7=({selector:e,enabled:i,children:t})=>{const n=qt.useRef(null),a=qt.useRef(null),l=qt.useRef(null),s=i??!0;return qt.useLayoutEffect(()=>{if(!n.current||!a.current)return;l.current=a.current;const d=n.current.getStage().findOne(e);s&&d?a.current.moveTo(d):a.current.moveTo(n.current);const w=n.current.getLayer();if(w&&(w.batchDraw(),d)){const _=d.getLayer();if(!_)return;_.batchDraw()}},[e,s]),qt.useEffect(()=>()=>{var c;(c=l.current)===null||c===void 0||c.destroy()},[]),qt.createElement(vp,{name:"_outer_portal",ref:n},qt.createElement(vp,{name:"_inner_portal",ref:a},t))};var Y7=Dp();const K7=Rd(Y7),X7=Object.freeze(Object.defineProperty({__proto__:null,Html:$7,Portal:W7,useEvent:e4,useImage:K7},Symbol.toStringTag,{value:"Module"})),yc=Xl(X7);function Z7(e,i){return Object.keys(e.values).forEach(t=>e.values[t]=e.values[t]&&parseFloat(e.values[t].toFixed(i))),e}function t4(e,i,t){const n=i-1,a=t[r4(n,t.length)];return a.marker!=="Z"?a:t4(e,n,t)}function n4(e,i,t){const n=i+1,a=t[r4(n,t.length)];return a.marker==="Z"?n4(e,n,t):a}function Q7(e,i,t){let n=t[i-1]||{values:{x:0,y:0}};if(e.marker===e.marker.toLowerCase())switch(e.marker=e.marker.toUpperCase(),e.marker){case"M":e.values.x+=n.values.x,e.values.y+=n.values.y;break;case"L":case"A":e.values.x+=n.values.x,e.values.y+=n.values.y;break;case"H":e.marker="L",e.values.x+=n.values.x,e.values.y=n.values.y;break;case"V":e.marker="L",e.values.x=n.values.x,e.values.y+=n.values.y;break;case"C":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x1+=n.values.x,e.values.y1+=n.values.y,e.values.x2+=n.values.x,e.values.y2+=n.values.y;break;case"S":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x2+=n.values.x,e.values.y2+=n.values.y;break;case"Q":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x1+=n.values.x,e.values.y1+=n.values.y;break;case"T":e.values.x+=n.values.x,e.values.y+=n.values.y;break}else if(e.marker===e.marker.toUpperCase())switch(e.marker){case"H":e.marker="L",e.values.y=n.values.y;break;case"V":e.marker="L",e.values.x=n.values.x;break}if(e.marker==="Z"){let l=function(c,d){return c[d].marker==="M"?c[d]:l(c,d-1)};var a=l;let s=l(t,i);e.values.x=s.values.x,e.values.y=s.values.y}return e}function J7(e,i){const t=[];switch(e.toUpperCase()){case"M":for(let n=0;n<i.length;n+=2){let a;e===e.toUpperCase()?a=n===0?"M":"L":a=n===0?"m":"l",t.push({marker:a,values:{x:i[n],y:i[n+1]}})}break;case"L":for(let n=0;n<i.length;n+=2)t.push({marker:e,values:{x:i[n],y:i[n+1]}});break;case"H":for(let n=0;n<i.length;n++)t.push({marker:e,values:{x:i[n],y:0}});break;case"V":for(let n=0;n<i.length;n++)t.push({marker:e,values:{x:0,y:i[n]}});break;case"C":for(let n=0;n<i.length;n+=6)t.push({marker:e,values:{x1:i[n],y1:i[n+1],x2:i[n+2],y2:i[n+3],x:i[n+4],y:i[n+5]}});break;case"S":for(let n=0;n<i.length;n+=4)t.push({marker:e,values:{x2:i[n],y2:i[n+1],x:i[n+2],y:i[n+3]}});break;case"Q":for(let n=0;n<i.length;n+=4)t.push({marker:e,values:{x1:i[n],y1:i[n+1],x:i[n+2],y:i[n+3]}});break;case"T":for(let n=0;n<i.length;n+=2)t.push({marker:e,values:{x:i[n],y:i[n+1]}});break;case"A":for(let n=0;n<i.length;n+=7)t.push({marker:e,values:{radiusX:i[n],radiusY:i[n+1],rotation:i[n+2],largeArc:i[n+3],sweep:i[n+4],x:i[n+5],y:i[n+6]}});break;case"Z":t.push({marker:e,values:{x:0,y:0}});break}return t}function r4(e,i){return(e%i+i)%i}function eS(e,i,t){if(i!==0&&e.marker==="L"){let n=t[i-1];["x","y"].every(l=>Math.round(Math.abs(n.values[l]-e.values[l]))===0)&&(e.overlap=!0)}return e}function Hg(e,i){const t=["x","y"].every(n=>Math.round(Math.abs(e[i].values[n]-e[0].values[n]))===0);e[i].marker==="L"&&t&&(e[i].overlap=!0,Hg(e,i-1)),e[i].marker==="Z"&&Hg(e,i-1)}function tS(e,i,t){const n=l2(e.values,t.values),a=l2(i.values,e.values);return Math.min(a,n)}function a2(e,i){return Math.atan2(i.x-e.x,i.y-e.y)}function l2(e,i){const t=e.x-i.x,n=e.y-i.y;return Math.sqrt(Math.pow(t,2)+Math.pow(n,2))}function s2(e,i){return Math.sin(e)*i}function u2(e,i){return Math.cos(e)*i}function c2(e,i){const t=i/Math.tan(e);return t===1/0||t===-1/0||isNaN(t)?i:t}function nS(e,i){return i*Math.tan(e)}function rS(e,i){let t,n=0,a=e*(180/Math.PI);return a<0&&a>=-180||a>180&&a<360?t=c2(e/2,-i):(t=c2(e/2,i),n=1,t===1/0&&(t=i)),{offset:t,sweepFlag:n}}function iS(e){const i=["radiusX","radiusY","rotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return e.map(t=>{let n="";if(t.marker!=="Z"){const a=Object.keys(t.values);n=i.filter(l=>a.indexOf(l)!==-1).map(l=>t.values[l]).join()}return`${t.marker}${n}`}).join("").trim()}function i4(e){const i=/[MmLlSsQqLlHhVvCcSsQqTtAaZz]/g,t=/-?[0-9]*\.?\d+/g;return[...e.matchAll(i)].map(n=>({marker:n[0],index:n.index})).reduceRight((n,a)=>{const l=e.substring(a.index,n.length?n[n.length-1].index:e.length);return n.concat([{marker:a.marker,index:a.index,chunk:l.length>0?l.substr(1,l.length-1):l}])},[]).reverse().flatMap(n=>{const a=n.chunk.match(t),l=a?a.map(parseFloat):[];return J7(n.marker,l)}).map(Q7)}function o4(e,i,t){let n=[],a=[];return t&&e.forEach(l=>Z7(l,t)),e.forEach(l=>{l.marker==="M"&&n.push([]),n[n.length-1].push(l)}),n.forEach(l=>{l.map(eS),Hg(l,l.length-1);const s=l[l.length-1].marker=="Z";l.filter(c=>!c.overlap).map((c,d,w)=>{const E=t4(c,d,w),O=n4(c,d,w),v=a2(c.values,E.values),S=a2(c.values,O.values),p=S-v,h=p*(180/Math.PI),P=tS(c,E,O),g=Math.abs(nS(p/2,P/2)),y=Math.min(i,g),b=rS(p,y),x=b.offset,M=b.sweepFlag,T=(d==0||d==w.length-1)&&!s;switch(c.marker){case"M":case"L":const j=[c.values.x+s2(v,x),c.values.y+u2(v,x)],I=[c.values.x+s2(S,x),c.values.y+u2(S,x)];T?a.push({marker:c.marker,values:c.values}):a.push({marker:c.marker,values:{x:parseFloat(j[0].toFixed(3)),y:parseFloat(j[1].toFixed(3))}}),!T&&(O.marker==="L"||O.marker==="M")&&a.push({marker:"A",radius:y,values:{radiusX:parseFloat(y.toFixed(3)),radiusY:parseFloat(y.toFixed(3)),rotation:h,largeArc:0,sweep:M,x:parseFloat(I[0].toFixed(3)),y:parseFloat(I[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:iS(a),commands:a}}function oS(e,i,t){return o4([...i4(e)],i,t)}const aS=Object.freeze(Object.defineProperty({__proto__:null,parsePath:i4,roundCommands:o4,roundCorners:oS},Symbol.toStringTag,{value:"Module"})),lS=Xl(aS);var _o={},ad={},Qh={},f2;function sS(){if(f2)return Qh;f2=1;var e=e||{};e.stringify=function(){var i={"visit_linear-gradient":function(t){return i.visit_gradient(t)},"visit_repeating-linear-gradient":function(t){return i.visit_gradient(t)},"visit_radial-gradient":function(t){return i.visit_gradient(t)},"visit_repeating-radial-gradient":function(t){return i.visit_gradient(t)},visit_gradient:function(t){var n=i.visit(t.orientation);return n&&(n+=", "),t.type+"("+n+i.visit(t.colorStops)+")"},visit_shape:function(t){var n=t.value,a=i.visit(t.at),l=i.visit(t.style);return l&&(n+=" "+l),a&&(n+=" at "+a),n},"visit_default-radial":function(t){var n="",a=i.visit(t.at);return a&&(n+=a),n},"visit_extent-keyword":function(t){var n=t.value,a=i.visit(t.at);return a&&(n+=" at "+a),n},"visit_position-keyword":function(t){return t.value},visit_position:function(t){return i.visit(t.value.x)+" "+i.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 i.visit_color(t.value,t)},visit_hex:function(t){return i.visit_color("#"+t.value,t)},visit_rgb:function(t){return i.visit_color("rgb("+t.value.join(", ")+")",t)},visit_rgba:function(t){return i.visit_color("rgba("+t.value.join(", ")+")",t)},visit_color:function(t,n){var a=t,l=i.visit(n.length);return l&&(a+=" "+l),a},visit_angular:function(t){return t.value+"deg"},visit_directional:function(t){return"to "+t.value},visit_array:function(t){var n="",a=t.length;return t.forEach(function(l,s){n+=i.visit(l),s<a-1&&(n+=", ")}),n},visit:function(t){if(!t)return"";var n="";if(t instanceof Array)return i.visit_array(t,n);if(t.type){var a=i["visit_"+t.type];if(a)return a(t);throw Error("Missing visitor visit_"+t.type)}else throw Error("Invalid node.")}};return function(t){return i.visit(t)}}();var e=e||{};return e.parse=function(){var i={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 n(Q){var q=new Error(t+": "+Q);throw q.source=t,q}function a(){var Q=l();return t.length>0&&n("Invalid input not EOF"),Q}function l(){return b(s)}function s(){return c("linear-gradient",i.linearGradient,w)||c("repeating-linear-gradient",i.repeatingLinearGradient,w)||c("radial-gradient",i.radialGradient,O)||c("repeating-radial-gradient",i.repeatingRadialGradient,O)}function c(Q,q,z){return d(q,function(N){var U=z();return U&&(X(i.comma)||n("Missing comma before color stops")),{type:Q,orientation:U,colorStops:b(x)}})}function d(Q,q){var z=X(Q);if(z){X(i.startCall)||n("Missing (");var N=q(z);return X(i.endCall)||n("Missing )"),N}}function w(){return _()||E()}function _(){return B("directional",i.sideOrCorner,1)}function E(){return B("angular",i.angleValue,1)}function O(){var Q,q=v(),z;return q&&(Q=[],Q.push(q),z=t,X(i.comma)&&(q=v(),q?Q.push(q):t=z)),Q}function v(){var Q=S()||p();if(Q)Q.at=P();else{var q=h();if(q){Q=q;var z=P();z&&(Q.at=z)}else{var N=g();N&&(Q={type:"default-radial",at:N})}}return Q}function S(){var Q=B("shape",/^(circle)/i,0);return Q&&(Q.style=R()||h()),Q}function p(){var Q=B("shape",/^(ellipse)/i,0);return Q&&(Q.style=L()||h()),Q}function h(){return B("extent-keyword",i.extentKeywords,1)}function P(){if(B("position",/^at/,0)){var Q=g();return Q||n("Missing positioning value"),Q}}function g(){var Q=y();if(Q.x||Q.y)return{type:"position",value:Q}}function y(){return{x:L(),y:L()}}function b(Q){var q=Q(),z=[];if(q)for(z.push(q);X(i.comma);)q=Q(),q?z.push(q):n("One extra comma");return z}function x(){var Q=M();return Q||n("Expected color definition"),Q.length=L(),Q}function M(){return j()||m()||I()||T()}function T(){return B("literal",i.literalColor,0)}function j(){return B("hex",i.hexColor,1)}function I(){return d(i.rgbColor,function(){return{type:"rgb",value:b(A)}})}function m(){return d(i.rgbaColor,function(){return{type:"rgba",value:b(A)}})}function A(){return X(i.number)[1]}function L(){return B("%",i.percentageValue,1)||k()||R()}function k(){return B("position-keyword",i.positionKeywords,1)}function R(){return B("px",i.pixelValue,1)||B("em",i.emValue,1)}function B(Q,q,z){var N=X(q);if(N)return{type:Q,value:N[z]}}function X(Q){var q,z;return z=/^[\n\r\t\s]+/.exec(t),z&&Y(z[0].length),q=Q.exec(t),q&&Y(q[0].length),q}function Y(Q){t=t.substr(Q)}return function(Q){return t=Q.toString(),a()}}(),Qh.parse=e.parse,Qh.stringify=e.stringify,Qh}var d2;function _v(){return d2||(d2=1,function(e){var i=ad&&ad.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0}),e.parseColor=e.isGradient=void 0;const t=i(sS()),n=s=>s.indexOf("linear-gradient")>=0;e.isGradient=n;const a=s=>s.type==="hex"?"#"+s.value:s.type==="literal"?s.value:`${s.type}(${s.value.join(",")})`,l=s=>{if(!(0,e.isGradient)(s))return{rotation:0,stops:[{offset:0,color:s},{offset:1,color:s}]};const c=t.default.parse(s)[0];return{rotation:parseFloat(c.orientation.value),stops:c.colorStops.map((d,w)=>({color:a(d),offset:d.length?parseFloat(d.length.value)/100:w/(c.colorStops.length-1)}))}};e.parseColor=l}(ad)),ad}var h2;function zd(){return h2||(h2=1,function(e){var i=_o&&_o.__createBinding||(Object.create?function(w,_,E,O){O===void 0&&(O=E);var v=Object.getOwnPropertyDescriptor(_,E);v&&!("get"in v?!_.__esModule:v.writable||v.configurable)||(v={enumerable:!0,get:function(){return _[E]}}),Object.defineProperty(w,O,v)}:function(w,_,E,O){O===void 0&&(O=E),w[O]=_[E]}),t=_o&&_o.__setModuleDefault||(Object.create?function(w,_){Object.defineProperty(w,"default",{enumerable:!0,value:_})}:function(w,_){w.default=_}),n=_o&&_o.__importStar||function(){var w=function(_){return w=Object.getOwnPropertyNames||function(E){var O=[];for(var v in E)Object.prototype.hasOwnProperty.call(E,v)&&(O[O.length]=v);return O},w(_)};return function(_){if(_&&_.__esModule)return _;var E={};if(_!=null)for(var O=w(_),v=0;v<O.length;v++)O[v]!=="default"&&i(E,_,O[v]);return t(E,_),E}}(),a=_o&&_o.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(e,"__esModule",{value:!0}),e.useColor=void 0;const l=a(Tn()),s=n(_v()),c=a(Ji()),d=(w,_=w.fill,E="fill")=>l.default.useMemo(()=>{if(!s.isGradient(_))return{[E]:_};const{stops:O,rotation:v}=s.parseColor(_),S={x:w.a.width/2,y:w.a.height/2},p=Math.sqrt(Math.pow(S.x,2)+Math.pow(S.y,2)),h=c.default.Util.degToRad(v)-Math.PI/2,P=[];return O.forEach(({offset:g,color:y})=>{P.push(g,y)}),E==="fill"?{fillLinearGradientStartPointX:S.x-p*Math.cos(h),fillLinearGradientStartPointY:S.y-p*Math.sin(h),fillLinearGradientColorStops:P,fillLinearGradientEndPointX:S.x+p*Math.cos(h),fillLinearGradientEndPointY:S.y+p*Math.sin(h),fill:O[1].color,fillPriority:"linear-gradient"}:{strokeLinearGradientStartPointX:S.x-p*Math.cos(h),strokeLinearGradientStartPointY:S.y-p*Math.sin(h),strokeLinearGradientColorStops:P,strokeLinearGradientEndPointX:S.x+p*Math.cos(h),strokeLinearGradientEndPointY:S.y+p*Math.sin(h)}},[_,w.width,w.height]);e.useColor=d}(_o)),_o}var K0={},ld={},p2;function bc(){return p2||(p2=1,function(e){var i=ld&&ld.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.isAnimationUsed=e.toggleFadeInAnimation=void 0,e.useFadeIn=c;const t=i(Tn()),n=i(Ji());let a=!1;const l=(d=!a)=>{a=d};e.toggleFadeInAnimation=l;const s=()=>a;function c(d,w){const _=t.default.useRef();t.default.useLayoutEffect(()=>{_.current&&_.current.destroy()},[w]),t.default.useLayoutEffect(()=>{if(!a)return;const E=d.current.opacity();return E?(d.current.opacity(0),_.current=new n.default.Tween({node:d.current,opacity:E,onFinish:()=>{var O;(O=_.current)===null||O===void 0||O.destroy()}}),_.current.play(),()=>{var O;(O=_.current)===null||O===void 0||O.destroy()}):void 0},[])}e.isAnimationUsed=s}(ld)),ld}var g2;function Ks(){return g2||(g2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getFontLoadTimeout=e.setFontLoadTimeout=e.getAssetLoadTimeout=e.setAssetLoadTimeout=void 0,e.incrementLoader=_,e.decrementLoader=E,e.whenLoaded=v,e.onLoadError=p,e.triggerLoadError=h;const i=bc();let t=0,n=[],a=3e4;const l=P=>{a=P};e.setAssetLoadTimeout=l;const s=()=>a;e.getAssetLoadTimeout=s;let c=6e3;const d=P=>{c=P};e.setFontLoadTimeout=d;const w=()=>c;function _(P){t+=1;let g=!1;const y=setTimeout(()=>{g||(h(`Timeout loading asset ${P}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",P),g=!0,E())},a);return()=>{g||(clearTimeout(y),E())}}function E(){t-=1,t===0&&(n.forEach(P=>P()),n=[])}function O(P){t===0?P():n.push(P)}function v(){return new Promise(P=>O(()=>{(0,i.isAnimationUsed)()?setTimeout(P,300):P(!0)}))}e.getFontLoadTimeout=w;let S=[];function p(P){S.push(P)}function h(P){S.forEach(g=>g(P))}}(K0)),K0}var Ha={},v2;function Bd(){return v2||(v2=1,function(e){var i=Ha&&Ha.__createBinding||(Object.create?function(A,L,k,R){R===void 0&&(R=k);var B=Object.getOwnPropertyDescriptor(L,k);B&&!("get"in B?!L.__esModule:B.writable||B.configurable)||(B={enumerable:!0,get:function(){return L[k]}}),Object.defineProperty(A,R,B)}:function(A,L,k,R){R===void 0&&(R=k),A[R]=L[k]}),t=Ha&&Ha.__setModuleDefault||(Object.create?function(A,L){Object.defineProperty(A,"default",{enumerable:!0,value:L})}:function(A,L){A.default=L}),n=Ha&&Ha.__importStar||function(){var A=function(L){return A=Object.getOwnPropertyNames||function(k){var R=[];for(var B in k)Object.prototype.hasOwnProperty.call(k,B)&&(R[R.length]=B);return R},A(L)};return function(L){if(L&&L.__esModule)return L;var k={};if(L!=null)for(var R=A(L),B=0;B<R.length;B++)R[B]!=="default"&&i(k,L,R[B]);return t(k,L),k}}();Object.defineProperty(e,"__esModule",{value:!0}),e.isFontLoaded=e.globalFonts=void 0,e.isGoogleFontChanged=d,e.setGoogleFonts=w,e.getFontsList=_,e.addGlobalFont=E,e.removeGlobalFont=O,e.replaceGlobalFonts=v,e.loadFont=y,e.setGoogleFontsVariants=M,e.getGoogleFontsVariants=T,e.injectGoogleFont=j,e.injectCustomFont=m;const a=n(No),l=Ks();let s=a.observable(["Roboto","Amatic SC","Press Start 2P","Marck Script","Rubik Mono One"]),c=a.observable({value:!1});function d(){return c.value}function w(A){A!=="default"?(c.value=!0,s.splice(0,s.length),s.push(...A)):c.value=!1}function _(){return s}function E(A){e.globalFonts.push(A)}function O(A){const L=e.globalFonts.findIndex(k=>k.fontFamily===A);L!==-1&&e.globalFonts.splice(L,1)}function v(A){e.globalFonts.replace(A)}e.globalFonts=a.observable([]);var S="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1",p=document.createElement("canvas");function h(A,L="Arial",k="normal",R="normal"){var B=p.getContext("2d");return B.font=`${k} ${R} 40px '${A}', ${L}`,B.measureText(S).width}const P={Arial:!0},g=A=>!!P[A];async function y(A,L,k){var R;if(P[A])return;const B=!!(!((R=document.fonts)===null||R===void 0)&&R.load),X=h("Arial","Arial",L,k);if(B)try{await document.fonts.load(`16px '${A}', ${L} ${k}`);const z=h(A,"Arial",L,k);if(X!==z)return void(P[A]=!0)}catch{}const Y=h("Times","Times",L,k),Q=h(A,"Arial",L,k),q=Math.min(6e3,(0,l.getFontLoadTimeout)())/60;for(let z=0;z<q;z++){const N=h(A,"Arial",L,k),U=h(A,"Times",L,k);if(N!==Q||N!==X||U!==Y)return void(P[A]=!0);await new Promise($=>setTimeout($,60))}console.warn(`Timeout for loading font "${A}". Looks like polotno can't load it. Is it a correct font family?`),(0,l.triggerLoadError)(`Timeout for loading font "${A}"`)}e.isFontLoaded=g;const b={};let x="400,400italic,700,700italic";function M(A){x=A}function T(){return x}function j(A){if(b[A])return;const L=`https://fonts.googleapis.com/css?family=${A.replace(/ /g,"+")}:${x}`,k=document.createElement("link");k.type="text/css",k.href=L,k.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(k),b[A]=!0}const I={};function m(A){const L=A.fontFamily;if(I[L]||!A.url&&!A.styles)return;const k=document.createElement("style");k.type="text/css";const R=A.styles||(A.url?[{src:`url("${A.url}")`}]:[]);let B="";R.forEach(X=>{B+=`
77
- @font-face {
78
- font-family: '${L}';
79
- src: ${X.src};
80
- font-style: ${X.fontStyle||"normal"};
81
- font-weight: ${X.fontWeight||"normal"};
82
- }
83
- `}),k.innerHTML=B,document.getElementsByTagName("head")[0].appendChild(k),I[A.fontFamily]=!0}}(Ha)),Ha}var Ga={},m2;function ts(){return m2||(m2=1,function(e){var i=Ga&&Ga.__createBinding||(Object.create?function(l,s,c,d){d===void 0&&(d=c);var w=Object.getOwnPropertyDescriptor(s,c);w&&!("get"in w?!s.__esModule:w.writable||w.configurable)||(w={enumerable:!0,get:function(){return s[c]}}),Object.defineProperty(l,d,w)}:function(l,s,c,d){d===void 0&&(d=c),l[d]=s[c]}),t=Ga&&Ga.__setModuleDefault||(Object.create?function(l,s){Object.defineProperty(l,"default",{enumerable:!0,value:s})}:function(l,s){l.default=s}),n=Ga&&Ga.__importStar||function(){var l=function(s){return l=Object.getOwnPropertyNames||function(c){var d=[];for(var w in c)Object.prototype.hasOwnProperty.call(c,w)&&(d[d.length]=w);return d},l(s)};return function(s){if(s&&s.__esModule)return s;var c={};if(s!=null)for(var d=l(s),w=0;w<d.length;w++)d[w]!=="default"&&i(c,s,d[w]);return t(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 a=n(No);e.flags=a.observable({imageDownScalingEnabled:!0,removeBackgroundEnabled:!0,htmlRenderEnabled:!1,forceTextFitEnabled:!1,textVerticalResizeEnabled:!1,textOverflow:"resize",textSplitAllowed:!1,animationsEnabled:!1}),e.setTextVerticalResizeEnabled=a.action(l=>{e.flags.textVerticalResizeEnabled=l}),e.useRemoveBackground=a.action(l=>{e.flags.removeBackgroundEnabled=l}),e.useHtmlTextRender=a.action(l=>{e.flags.htmlRenderEnabled=l}),e.setDownScalingEnabled=a.action(l=>{e.flags.imageDownScalingEnabled=l}),e.useDownScaling=a.action(l=>{console.warn("useDownScaling is deprecated. Use setDownScalingEnabled instead."),(0,e.setDownScalingEnabled)(l)}),e.setForceTextFit=a.action(l=>{console.warn("setForceTextFit is deprecated. Use setTextOverflow instead."),e.flags.textOverflow="change-font-size"}),e.setTextOverflow=a.action(l=>{e.flags.textOverflow=l}),e.setTextSplitAllowed=a.action(l=>{e.flags.textSplitAllowed=l}),e.setAnimationsEnabled=a.action(l=>{e.flags.animationsEnabled=l})}(Ga)),Ga}var X0={},y2;function a4(){return y2||(y2=1,function(e){function i(t=""){return(t.match(/<\/p>/gi)||[]).length>1&&(t=t.replace(/<\/p>/gi,(n,a,l)=>(l.slice(a+n.length).match(/<\/p>/gi)||[]).length>0?`
84
- `:n)),t.replace(/(<([^>]+)>)/gi,"")}Object.defineProperty(e,"__esModule",{value:!0}),e.removeTags=i}(X0)),X0}var sd={},b2;function jp(){return b2||(b2=1,function(e){var i=sd&&sd.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(e,"__esModule",{value:!0}),e.applyFilter=a;const t=i(Ji()),n={warm:l=>s=>{const c=s.data;for(let d=0;d<c.length;d+=4)c[d]=Math.min(c[d]+30*l,255),c[d+1]=Math.min(c[d+1]+15*l,255);return s},cold:l=>s=>{const c=s.data;for(let d=0;d<c.length;d+=4)c[d]=Math.min(c[d]-15*l,255),c[d+1]=Math.min(c[d+1]-10*l,255),c[d+2]=Math.min(c[d+2]+15*l,255);return s},natural:l=>s=>{const c=s.data;l=Math.max(0,Math.min(l,1));for(let d=0;d<c.length;d+=4){c[d]=Math.min(c[d]*(1+.1*l),255),c[d+1]=Math.min(c[d+1]*(1+.1*l),255),c[d+2]=Math.min(c[d+2]*(1+.1*l),255);const w=(c[d]+c[d+1]+c[d+2])/3;c[d]=Math.min((c[d]-w)*(1+.2*l)+w,255),c[d+1]=Math.min((c[d+1]-w)*(1+.2*l)+w,255),c[d+2]=Math.min((c[d+2]-w)*(1+.2*l)+w,255)}return s}};function a(l,s){var c;const d={filters:[]},w={};s.brightnessEnabled&&(d.filters.push(t.default.Filters.Brighten),d.brightness=s.brightness),s.blurEnabled&&(d.filters.push(t.default.Filters.Blur),d.blurRadius=s.blurRadius,s.type==="text"&&s.lineHeight<1&&(w.offset=s.fontSize)),s.sepiaEnabled&&d.filters.push(t.default.Filters.Sepia),s.grayscaleEnabled&&d.filters.push(t.default.Filters.Grayscale),s.filters.forEach((_,E)=>{const O=n[E];O&&d.filters.push(O(_.intensity))}),l.setAttrs(d),d.filters.length?l.cache(Object.assign(Object.assign({},w),{pixelRatio:s.store._elementsPixelRatio})):l.clearCache(),(c=l.getLayer())===null||c===void 0||c.batchDraw()}}(sd)),sd}var ud={},_2;function _c(){return _2||(_2=1,function(e){var i=ud&&ud.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(e,"__esModule",{value:!0}),e.Highlighter=e.setHighlighterStyle=void 0;const t=i(Tn()),n=Qi,a=Ja,l={stroke:"rgb(0, 161, 255)",strokeWidth:2},s=c=>{Object.assign(l,c)};e.setHighlighterStyle=s,e.Highlighter=(0,n.observer)(({element:c})=>t.default.createElement(a.Rect,Object.assign({name:"highlighter",x:c.a.x,y:c.a.y,rotation:c.a.rotation,width:c.a.width,height:c.a.height,listening:!1,strokeScaleEnabled:!1},l)))}(ud)),ud}var cd={},w2;function Xs(){return w2||(w2=1,function(e){var i=cd&&cd.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(e,"__esModule",{value:!0}),e.useMobile=e.isTouchDevice=e.mobileStyle=e.isMobile=e.MOBILE_BREAKPOINT=void 0;const t=i(Tn());e.MOBILE_BREAKPOINT=800;const n=()=>window.innerWidth<=e.MOBILE_BREAKPOINT;e.isMobile=n;const a=c=>`
85
- @media (max-width: ${e.MOBILE_BREAKPOINT}px) {
86
- ${c}
87
- }
88
-
89
- .polotno-mobile & {
90
- ${c}
91
- }
92
- `;e.mobileStyle=a;const l=()=>"ontouchstart"in window||navigator.maxTouchPoints>0;e.isTouchDevice=l;const s=()=>{const[c,d]=t.default.useState((0,e.isMobile)());return t.default.useEffect(()=>{const w=()=>{d((0,e.isMobile)())};return window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w)}},[]),c};e.useMobile=s}(cd)),cd}var S2={},l4="warn";function s4(e){l4=e}function u4(){return l4}function uS(e){s4(e)}var sr;(function(e){e.afterCreate="afterCreate",e.afterAttach="afterAttach",e.afterCreationFinalization="afterCreationFinalization",e.beforeDetach="beforeDetach",e.beforeDestroy="beforeDestroy"})(sr||(sr={}));var Gg=function(e,i){return Gg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])},Gg(e,i)};function _n(e,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");Gg(e,i);function t(){this.constructor=e}e.prototype=i===null?Object.create(i):(t.prototype=i.prototype,new t)}var ur=function(){return ur=Object.assign||function(i){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&(i[l]=t[l])}return i},ur.apply(this,arguments)};function cS(e,i){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&i.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)i.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(t[n[a]]=e[n[a]]);return t}function c4(e,i){var t={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},n,a,l,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(w){return function(_){return d([w,_])}}function d(w){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,w[0]&&(t=0)),t;)try{if(n=1,a&&(l=w[0]&2?a.return:w[0]?a.throw||((l=a.return)&&l.call(a),0):a.next)&&!(l=l.call(a,w[1])).done)return l;switch(a=0,l&&(w=[w[0]&2,l.value]),w[0]){case 0:case 1:l=w;break;case 4:return t.label++,{value:w[1],done:!1};case 5:t.label++,a=w[1],w=[0];continue;case 7:w=t.ops.pop(),t.trys.pop();continue;default:if(l=t.trys,!(l=l.length>0&&l[l.length-1])&&(w[0]===6||w[0]===2)){t=0;continue}if(w[0]===3&&(!l||w[1]>l[0]&&w[1]<l[3])){t.label=w[1];break}if(w[0]===6&&t.label<l[1]){t.label=l[1],l=w;break}if(l&&t.label<l[2]){t.label=l[2],t.ops.push(w);break}l[2]&&t.ops.pop(),t.trys.pop();continue}w=i.call(e,t)}catch(_){w=[6,_],a=0}finally{n=l=0}if(w[0]&5)throw w[1];return{value:w[0]?w[1]:void 0,done:!0}}}function Sd(e){var i=typeof Symbol=="function"&&Symbol.iterator,t=i&&e[i],n=0;if(t)return t.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")}function fa(e,i){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var n=t.call(e),a,l=[],s;try{for(;(i===void 0||i-- >0)&&!(a=n.next()).done;)l.push(a.value)}catch(c){s={error:c}}finally{try{a&&!a.done&&(t=n.return)&&t.call(n)}finally{if(s)throw s.error}}return l}function da(e,i,t){if(arguments.length===2)for(var n=0,a=i.length,l;n<a;n++)(l||!(n in i))&&(l||(l=Array.prototype.slice.call(i,0,n)),l[n]=i[n]);return e.concat(l||Array.prototype.slice.call(i))}function Ud(e){return st(e).type}function fS(e,i){return st(e).getChildType(i)}function f4(e,i){return st(e).onPatch(i)}function dS(e,i){return st(e).onSnapshot(i)}function cc(e,i){st(e).applyPatches(kv(i))}function hS(e,i){var t={patches:[],inversePatches:[]},n={},a,l={get recording(){return!!a},get patches(){return n.patches||(n.patches=t.patches.slice()),n.patches},get reversedInversePatches(){return n.reversedInversePatches||(n.reversedInversePatches=t.inversePatches.slice().reverse()),n.reversedInversePatches},get inversePatches(){return n.inversePatches||(n.inversePatches=t.inversePatches.slice()),n.inversePatches},stop:function(){a&&(a(),a=void 0)},resume:function(){a||(a=f4(e,function(s,c){i&&!i(s,c,Ov())||(t.patches.push(s),t.inversePatches.push(c),n.patches=void 0,n.inversePatches=void 0,n.reversedInversePatches=void 0)}))},replay:function(s){cc(s||e,t.patches)},undo:function(s){cc(s||e,t.inversePatches.slice().reverse())}};return l.resume(),l}function pS(e){var i=st(e);if(!i.isRoot)throw new nt("`protect` can only be invoked on root nodes");i.isProtectionEnabled=!0}function gS(e){var i=st(e);if(!i.isRoot)throw new nt("`unprotect` can only be invoked on root nodes");i.isProtectionEnabled=!1}function vS(e){return st(e).isProtected}function d4(e,i){return st(e).applySnapshot(i)}function wv(e,i){i===void 0&&(i=!0);var t=st(e);return i?t.snapshot:t.type.getSnapshot(t,!1)}function mS(e,i){i===void 0&&(i=1);for(var t=st(e).parent;t;){if(--i===0)return!0;t=t.parent}return!1}function yS(e,i){i===void 0&&(i=1);for(var t=i,n=st(e).parent;n;){if(--t===0)return n.storedValue;n=n.parent}throw new nt("Failed to find the parent of ".concat(st(e)," at depth ").concat(i))}function bS(e,i){for(var t=st(e).parent;t;){if(i.is(t.storedValue))return!0;t=t.parent}return!1}function _S(e,i){for(var t=st(e).parent;t;){if(i.is(t.storedValue))return t.storedValue;t=t.parent}throw new nt("Failed to find the parent of ".concat(st(e)," of a given type"))}function h4(e){return st(e).root.storedValue}function p4(e){return st(e).path}function wS(e){return gc(st(e).path)}function SS(e){return st(e).isRoot}function ES(e,i){var t=M4(st(e),i);return t?t.value:void 0}function OS(e,i,t){var n=st(i).root.identifierCache.resolve(e,wc(t));return n==null?void 0:n.value}function g4(e){return st(e).identifier}function xS(e,i){i===void 0&&(i=!0);try{var t=e();if(t==null)return;if(rn(t))return i?Sv(t)?t:void 0:t;throw new nt("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof Av)return;throw n}}function PS(e,i){i===void 0&&(i=!0);try{var t=e();if(t==null)return!1;if(rn(t))return i?Sv(t):!0;throw new nt("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof Av)return!1;throw n}}function v4(e,i){var t=M4(st(e),i,!1);if(t!==void 0)try{return t.value}catch{return}}function CS(e,i){return R4(st(e),st(i))}function kS(e,i){i===void 0&&(i=!0);var t=st(e);return t.type.create(t.snapshot,i===!0?t.root.environment:i===!1?void 0:i)}function AS(e){return st(e).detach(),e}function TS(e){var i=st(e);i.isRoot?i.die():i.parent.removeChild(i.subpath)}function Sv(e){return st(e).observableIsAlive}function RS(e,i){var t=st(e);return t.addDisposer(i),i}function MS(e){var i=st(e),t=i.root.environment;if(!t)throw new nt("Failed to find the environment of ".concat(i," ").concat(i.path));return t}function LS(e){var i=st(e),t=i.root.environment;return!!t}function m4(e,i){var t=st(e);t.getChildren().forEach(function(n){rn(n.storedValue)&&m4(n.storedValue,i)}),i(t.storedValue)}function y4(e){var i;return rn(e)?i=Ud(e):i=e,{name:i.name,properties:ur({},i.properties)}}function NS(e){var i=st(e).type,t=ur(ur({},y4(i)),{actions:[],volatile:[],views:[],flowActions:[]}),n=Object.getOwnPropertyNames(e);return n.forEach(function(a){if(!(a in t.properties)){var l=Object.getOwnPropertyDescriptor(e,a);if(l.get){S5(e,a)?t.views.push(a):t.volatile.push(a);return}l.value._isFlowAction===!0&&t.flowActions.push(a),l.value._isMSTAction===!0?t.actions.push(a):O5(e,a)?t.volatile.push(a):t.views.push(a)}}),t}function IS(e){return e}function DS(e){return e}function jS(e){return e}function FS(e){return st(e).nodeId}var b4=function(){function e(i,t,n,a){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:i}),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:Lr.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,n)}return Object.defineProperty(e.prototype,"subpath",{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},set:function(i){var t=this.isAlive;this._state=i;var n=this.isAlive;this.aliveAtom&&t!==n&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(i){this._hookSubscribers&&this._hookSubscribers.emit(i,this,i)}}),Object.defineProperty(e.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t){return this._hookSubscribers||(this._hookSubscribers=new j4),this._hookSubscribers.register(i,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(i,t){this._parent=i,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(i){return i&&(this.pathAtom||(this.pathAtom=Od("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?Wl(this._subpath):""),this.parent.getEscapedPath(i)+"/"+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!==Lr.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDetaching",{get:function(){return this.state===Lr.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=Od("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(i){if(this.state===Lr.CREATED){if(this.parent){if(this.parent.state!==Lr.FINALIZED)return;this.fireHook(sr.afterAttach)}this.state=Lr.FINALIZED,i&&i()}}}),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=Lr.DEAD}}),Object.defineProperty(e.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(sr.beforeDestroy)}}),e}(),Cd=function(e){_n(i,e);function i(t,n,a,l,s){var c=e.call(this,t,n,a,l)||this;try{c.storedValue=t.createNewInstance(s)}catch(d){throw c.state=Lr.DEAD,d}return c.state=Lr.CREATED,c.finalizeCreation(),c}return Object.defineProperty(i.prototype,"root",{get:function(){if(!this.parent)throw new nt("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this.parent!==t,l=this.subpath!==n;!a&&!l||(this.environment=void 0,this.baseSetParent(this.parent,n))}}),Object.defineProperty(i.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(i.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(i.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Lr.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(i.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(i.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(i.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(i.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.fireInternalHook(t)}}),i}(b4);Cd.prototype.die=Zn(Cd.prototype.die);var zS=1,Po;(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.CREATING=1]="CREATING",e[e.CREATED=2]="CREATED"})(Po||(Po={}));var Ti;(function(e){e.Dispose="dispose",e.Patch="patch",e.Snapshot="snapshot"})(Ti||(Ti={}));var BS={onError:function(e){throw e}},yi=function(e){_n(i,e);function i(t,n,a,l,s){var c=e.call(this,t,n,a,l)||this;if(Object.defineProperty(c,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++zS}),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:Po.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=$s(function(){return c.getSnapshot()}),c.unbox=c.unbox.bind(c),c._initialSnapshot=s,c.identifierAttribute=t.identifierAttribute,n||(c.identifierCache=new aE),c._childNodes=t.initializeChildNodes(c,c._initialSnapshot),c.identifier=null,c.unnormalizedIdentifier=null,c.identifierAttribute&&c._initialSnapshot){var d=c._initialSnapshot[c.identifierAttribute];if(d===void 0){var w=c._childNodes[c.identifierAttribute];w&&(d=w.value)}if(typeof d!="string"&&typeof d!="number")throw new nt("Instance identifier '".concat(c.identifierAttribute,"' for type '").concat(c.type.name,"' must be a string or a number"));c.identifier=wc(d),c.unnormalizedIdentifier=d}return n?n.root.identifierCache.addNodeToCache(c):c.identifierCache.addNodeToCache(c),c}return Object.defineProperty(i.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.createObservableInstanceIfNeeded(),this._applyPatches(t)}}),Object.defineProperty(i.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.createObservableInstanceIfNeeded(),this._applySnapshot(t)}}),Object.defineProperty(i.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(t){t===void 0&&(t=!0),this._observableInstanceState===Po.UNINITIALIZED&&this.createObservableInstance(t)}}),Object.defineProperty(i.prototype,"createObservableInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n,a,l,s;t===void 0&&(t=!0),this._observableInstanceState=Po.CREATING;for(var c=[],d=this.parent;d&&d._observableInstanceState===Po.UNINITIALIZED;)c.unshift(d),d=d.parent;try{for(var w=Sd(c),_=w.next();!_.done;_=w.next()){var E=_.value;E.createObservableInstanceIfNeeded(!1)}}catch(p){n={error:p}}finally{try{_&&!_.done&&(a=w.return)&&a.call(w)}finally{if(n)throw n.error}}var O=this.type;try{this.storedValue=O.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,O.finalizeNewInstance(this,this.storedValue)}catch(p){throw this.state=Lr.DEAD,p}finally{this._isRunningAction=!1}if(this._observableInstanceState=Po.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=hc,this.state=Lr.CREATED,t){this.fireHook(sr.afterCreate),this.finalizeCreation();try{for(var v=Sd(c.reverse()),S=v.next();!S.done;S=v.next()){var E=S.value;E.fireHook(sr.afterCreate),E.finalizeCreation()}}catch(p){l={error:p}}finally{try{S&&!S.done&&(s=v.return)&&s.call(v)}finally{if(l)throw l.error}}}}}),Object.defineProperty(i.prototype,"root",{get:function(){var t=this.parent;return t?t.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(sr.beforeDetach);var t=this.state;this.state=Lr.DETACHING;var n=this.root,a=n.environment,l=n.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=a,this.identifierCache=l}finally{this.state=t}}}}),Object.defineProperty(i.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=t!==this.parent,l=n!==this.subpath;!a&&!l||(a?(this.environment=void 0,t.root.identifierCache.mergeCache(this),this.baseSetParent(t,n),this.fireHook(sr.afterAttach)):l&&this.baseSetParent(this.parent,n))}}),Object.defineProperty(i.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this;this.fireInternalHook(t);var a=this.storedValue&&typeof this.storedValue=="object"&&this.storedValue[t];typeof a=="function"&&(lc?lc(function(){a.apply(n.storedValue)}):a.apply(this.storedValue))}}),Object.defineProperty(i.prototype,"snapshot",{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===Po.CREATED?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(i.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(i.prototype,"_getCachedInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var t=this.type,n=this._childNodes,a=this._initialSnapshot;this._cachedInitialSnapshot=t.processInitialSnapshot(n,a),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(i.prototype,"isRunningAction",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(i.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=u4();if(!this.isAlive&&n!=="ignore"){var a=this._getAssertAliveError(t);switch(n){case"error":throw new nt(a);case"warn":bE(a)}}}}),Object.defineProperty(i.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.getEscapedPath(!1)||this.pathUponDeath||"",a=t.subpath&&Wl(t.subpath)||"",l=t.actionContext||Ev();l&&l.type!=="action"&&l.parentActionEvent&&(l=l.parentActionEvent);var s="";if(l&&l.name!=null){var c=l&&l.context&&p4(l.context)||n;s="".concat(c,".").concat(l.name,"()")}return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '".concat(this.type.name,"', Path upon death: '").concat(n,"', Subpath: '").concat(a,"', Action: '").concat(s,"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.")}}),Object.defineProperty(i.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.assertAlive({subpath:t}),this._autoUnbox=!1;try{return this._observableInstanceState===Po.CREATED?this.type.getChildNode(this,t):this._childNodes[t]}finally{this._autoUnbox=!0}}}),Object.defineProperty(i.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(hc),this._autoUnbox=!1;try{return this._observableInstanceState===Po.CREATED?this.type.getChildren(this):N4(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(i.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.type.getChildType(t)}}),Object.defineProperty(i.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.assertAlive(t),!this.isRunningAction()&&this.isProtected)throw new nt("Cannot modify '".concat(this,"', the object is protected and can only be modified by using an action."))}}),Object.defineProperty(i.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.type.removeChild(this,t)}}),Object.defineProperty(i.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(i.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=(this.isAlive?this.path:this.pathUponDeath)||"<root>",n=this.identifier?"(id: ".concat(this.identifier,")"):"";return"".concat(this.type.name,"@").concat(t).concat(n).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(i.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;this.baseFinalizeCreation(function(){var n,a;try{for(var l=Sd(t.getChildren()),s=l.next();!s.done;s=l.next()){var c=s.value;c.finalizeCreation()}}catch(d){n={error:d}}finally{try{s&&!s.done&&(a=l.return)&&a.call(l)}finally{if(n)throw n.error}}t.fireInternalHook(sr.afterCreationFinalization)})}}),Object.defineProperty(i.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw new nt("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(i.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;this._applyPatches=kd(this.storedValue,"@APPLY_PATCHES",function(n){n.forEach(function(a){if(!a.path){t.type.applySnapshot(t,a.value);return}var l=gc(a.path),s=L4(t,l.slice(0,-1));s.applyPatchLocally(l[l.length-1],a)})}),this._applySnapshot=kd(this.storedValue,"@APPLY_SNAPSHOT",function(n){if(n!==t.snapshot)return t.type.applySnapshot(t,n)}),zs(this.storedValue,"$treenode",this),zs(this.storedValue,"toJSON",sE)}}),Object.defineProperty(i.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===Lr.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(i.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==Po.UNINITIALIZED&&(this.getChildren().forEach(function(t){t.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit(Ti.Dispose),this._internalEventsClear(Ti.Dispose))}}),Object.defineProperty(i.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(n){n.finalizeDeath()}),this.root.identifierCache.notifyDied(this);var t=this.snapshot;this._snapshotUponDeath=t,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(i.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._addSnapshotReaction(),this._internalEventsRegister(Ti.Snapshot,t)}}),Object.defineProperty(i.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._internalEventsEmit(Ti.Snapshot,t)}}),Object.defineProperty(i.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._internalEventsRegister(Ti.Patch,t)}}),Object.defineProperty(i.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(this._internalEventsHasSubscribers(Ti.Patch)){var a=n.path.substr(this.path.length)+(t.path?"/"+t.path:""),l=vE({},t,{path:a}),s=fa(xE(l),2),c=s[0],d=s[1];this._internalEventsEmit(Ti.Patch,c,d)}this.parent&&this.parent.emitPatch(t,n)}}),Object.defineProperty(i.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._internalEventsHas(Ti.Dispose,t)}}),Object.defineProperty(i.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!this.hasDisposer(t)){this._internalEventsRegister(Ti.Dispose,t,!0);return}throw new nt("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(i.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!this._internalEventsHas(Ti.Dispose,t))throw new nt("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister(Ti.Dispose,t)}}),Object.defineProperty(i.prototype,"removeMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.middlewares){var n=this.middlewares.indexOf(t);n>=0&&this.middlewares.splice(n,1)}}}),Object.defineProperty(i.prototype,"addMiddleWare",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this;n===void 0&&(n=!0);var l={handler:t,includeHooks:n};return this.middlewares?this.middlewares.push(l):this.middlewares=[l],function(){a.removeMiddleware(l)}}}),Object.defineProperty(i.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){this.assertWritable({subpath:t}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,t,n)}}),Object.defineProperty(i.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;if(!this._hasSnapshotReaction){var n=p5(function(){return t.snapshot},function(a){return t.emitSnapshot(a)},BS);this.addDisposer(n),this._hasSnapshotReaction=!0}}}),Object.defineProperty(i.prototype,"_internalEventsHasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return!!this._internalEvents&&this._internalEvents.hasSubscribers(t)}}),Object.defineProperty(i.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a){return a===void 0&&(a=!1),this._internalEvents||(this._internalEvents=new j4),this._internalEvents.register(t,n,a)}}),Object.defineProperty(i.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return!!this._internalEvents&&this._internalEvents.has(t,n)}}),Object.defineProperty(i.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){this._internalEvents&&this._internalEvents.unregister(t,n)}}),Object.defineProperty(i.prototype,"_internalEventsEmit",{enumerable:!1,configurable:!0,writable:!0,value:function(t){for(var n,a=[],l=1;l<arguments.length;l++)a[l-1]=arguments[l];this._internalEvents&&(n=this._internalEvents).emit.apply(n,da([t],fa(a),!1))}}),Object.defineProperty(i.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._internalEvents&&this._internalEvents.clear(t)}}),Object.defineProperty(i.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),i}(b4);yi.prototype.createObservableInstance=Zn(yi.prototype.createObservableInstance);yi.prototype.detach=Zn(yi.prototype.detach);yi.prototype.die=Zn(yi.prototype.die);var _4,Tt;(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"})(Tt||(Tt={}));var w4="cannotDetermine",US=Symbol("$type"),Qa=function(){function e(i){Object.defineProperty(this,_4,{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=i}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t){return Xa(this,i),this.instantiate(null,"",t,i).value}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t){throw new nt("unimplemented method")}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(i){return i===this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t){var n=T4(i);if(n){var a=Ud(i);return this.isAssignableFrom(a)?bi():_i(t,i)}return this.isValidSnapshot(i,t)}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(i){return this.validate(i,[{path:"",type:this}]).length===0}}),Object.defineProperty(e.prototype,"Type",{get:function(){throw new nt("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 nt("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 nt("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 nt("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}();_4=US;Qa.prototype.create=Zn(Qa.prototype.create);var fc=function(e){_n(i,e);function i(t){var n=e.call(this,t)||this;return Object.defineProperty(n,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),n}return Object.defineProperty(i.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return t===void 0&&(t=this.getDefaultSnapshot()),e.prototype.create.call(this,t,n)}}),Object.defineProperty(i.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.createObservableInstanceIfNeeded(),t.storedValue}}),Object.defineProperty(i.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return!t.identifierAttribute||t.identifier===wc(n[t.identifierAttribute])}}),Object.defineProperty(i.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return t.isDetaching?!1:t.snapshot===n||rn(n)&&st(n)===t?!0:t.type===this&&I4(n)&&!rn(n)&&this.isMatchingSnapshotId(t,n)?(t.applySnapshot(n),!0):!1}}),Object.defineProperty(i.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){var s=this.tryToReconcileNode(t,n);if(s)return t.setParent(a,l),t;if(t.die(),rn(n)&&this.isAssignableFrom(Ud(n))){var c=st(n);return c.setParent(a,l),c}return this.instantiate(a,l,void 0,n)}}),Object.defineProperty(i.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),i}(Qa);fc.prototype.create=Zn(fc.prototype.create);var Zs=function(e){_n(i,e);function i(){return e!==null&&e.apply(this,arguments)||this}return Object.defineProperty(i.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t}}),Object.defineProperty(i.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(i.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(i.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){if(!t.isDetaching&&t.type===this&&t.storedValue===n)return t;var s=this.instantiate(a,l,void 0,n);return t.die(),s}}),Object.defineProperty(i.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),i}(Qa);function cr(e){return typeof e=="object"&&e&&e.isType===!0}var oa=new Map;function qS(e){return function(t,n,a){switch(t.type){case"action":if(!e.filter||e.filter(t)===!0){var l=e.onStart(t);e.onResume(t,l),oa.set(t.id,{call:t,context:l,async:!1});try{var s=n(t);return e.onSuspend(t,l),oa.get(t.id).async===!1&&(oa.delete(t.id),e.onSuccess(t,l,s)),s}catch(d){throw oa.delete(t.id),e.onFail(t,l,d),d}}else return n(t);case"flow_spawn":{var c=oa.get(t.rootId);return c.async=!0,n(t)}case"flow_resume":case"flow_resume_error":{var c=oa.get(t.rootId);e.onResume(t,c.context);try{return n(t)}finally{e.onSuspend(t,c.context)}}case"flow_throw":{var c=oa.get(t.rootId);return oa.delete(t.rootId),e.onFail(t,c.context,t.args[0]),n(t)}case"flow_return":{var c=oa.get(t.rootId);return oa.delete(t.rootId),e.onSuccess(t,c.context,t.args[0]),n(t)}}}}var HS=function(){function e(i,t){Object.defineProperty(this,"hooks",{enumerable:!0,configurable:!0,writable:!0,value:i}),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}),i&&i.onStart(t)}return Object.defineProperty(e.prototype,"finish",{enumerable:!1,configurable:!0,writable:!0,value:function(i){this.running&&(this.running=!1,this.hooks&&this.hooks.onFinish(this.call,i))}}),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 GS(e){var i=new Map;return function(n,a){var l=n.parentActionEvent?i.get(n.parentActionEvent.id):void 0;if(n.type==="action"){var s=ur(ur({},n),{env:l&&l.call.env,parentCall:l&&l.call}),c=!e.filter||e.filter(s),d=c?e:void 0,w=new HS(d,s);i.set(n.id,w);var _=void 0;try{_=a(n)}catch(O){throw i.delete(n.id),w.finish(O),O}return w.hasFlowsPending||(i.delete(n.id),w.finish()),_}else{if(!l)return a(n);switch(n.type){case"flow_spawn":return l.incFlowsPending(),a(n);case"flow_resume":case"flow_resume_error":return a(n);case"flow_throw":{var E=n.args[0];try{return a(n)}finally{l.decFlowsPending(),l.hasFlowsPending||(i.delete(n.parentActionEvent.id),l.finish(E))}}case"flow_return":try{return a(n)}finally{l.decFlowsPending(),l.hasFlowsPending||(i.delete(n.parentActionEvent.id),l.finish())}}}}}function VS(e,i,t,n){if(n instanceof Date)return{$MST_DATE:n.getTime()};if(pc(n))return n;if(rn(n))return Jh("[MSTNode: ".concat(Ud(n).name,"]"));if(typeof n=="function")return Jh("[function]");if(typeof n=="object"&&!Fs(n)&&!Cv(n))return Jh("[object ".concat(n&&n.constructor&&n.constructor.name||"Complex Object","]"));try{return JSON.stringify(n),n}catch(a){return Jh(""+a)}}function $S(e,i){return i&&typeof i=="object"&&"$MST_DATE"in i?new Date(i.$MST_DATE):i}function Jh(e){return{$MST_UNSERIALIZABLE:!0,type:e}}function S4(e,i){lc(function(){kv(i).forEach(function(t){return WS(e,t)})})}function WS(e,i){var t=v4(e,i.path||"");if(!t)throw new nt("Invalid action path: ".concat(i.path||""));var n=st(t);if(i.name==="@APPLY_PATCHES")return cc.call(null,t,i.args[0]);if(i.name==="@APPLY_SNAPSHOT")return d4.call(null,t,i.args[0]);if(typeof t[i.name]!="function")throw new nt("Action '".concat(i.name,"' does not exist in '").concat(n.path,"'"));return t[i.name].apply(t,i.args?i.args.map(function(a){return $S(n,a)}):[])}function YS(e,i){var t=[],n=function(s){var c=i?i(s,Ov()):!0;c&&t.push(s)},a,l={actions:t,get recording(){return!!a},stop:function(){a&&(a(),a=void 0)},resume:function(){a||(a=E4(e,n))},replay:function(s){S4(s,t)}};return l.resume(),l}function E4(e,i,t){return t===void 0&&(t=!1),P4(e,function(a,l){if(a.type==="action"&&a.id===a.rootId){var s=st(a.context),c={name:a.name,path:R4(st(e),s),args:a.args.map(function(w,_){return VS(s,a.name,_,w)})};if(t){var d=l(a);return i(c),d}else return i(c),l(a)}else return l(a)})}var KS=1,Ed;function Ev(){return Ed}function O4(){return KS++}function Vg(e,i){var t=st(e.context);e.type==="action"&&t.assertAlive({actionContext:e});var n=t._isRunningAction;t._isRunningAction=!0;var a=Ed;Ed=e;try{return QS(t,e,i)}finally{Ed=a,t._isRunningAction=n}}function x4(e){if(e)return e.type==="action"?e:e.parentActionEvent}function kd(e,i,t){var n=function(){var a=O4(),l=Ed,s=x4(l);return Vg({type:"action",name:i,id:a,args:F4(arguments),context:e,tree:h4(e),rootId:l?l.rootId:a,parentId:l?l.id:0,allParentIds:l?da(da([],fa(l.allParentIds),!1),[l.id],!1):[],parentEvent:l,parentActionEvent:s},t)};return n._isMSTAction=!0,n._isFlowAction=t._isFlowAction,n}function P4(e,i,t){t===void 0&&(t=!0);var n=st(e);return n.addMiddleWare(i,t)}function XS(e,i,t){t===void 0&&(t=!0);var n={handler:e,includeHooks:t};return i.$mst_middleware=i.$mst_middleware||[],i.$mst_middleware.push(n),i}var ZS=function(){function e(i,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 n=i;n;)n.middlewares&&this.middlewares.push(n.middlewares),n=n.parent}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getNextMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(){var i=this.middlewares[this.arrayIndex];if(i){var t=i[this.inArrayIndex++];return t||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}}),e}();function QS(e,i,t){var n=new ZS(e,t);if(n.isEmpty)return Zn(t).apply(null,i.args);var a=null;function l(s){var c=n.getNextMiddleware(),d=c&&c.handler;if(!d)return Zn(t).apply(null,s.args);if(!c.includeHooks&&sr[s.name])return l(s);function w(E,O){a=l(E),O&&(a=O(a))}function _(E){a=E}return d(s,w,_),a}return l(i)}function Ov(){for(var e=Ev();e&&e.type!=="action";)e=e.parentActionEvent;return e}function C4(e,i,t){for(var n=typeof i=="number"?i:i.id,a=t?e:e.parentActionEvent;a;){if(a.id===n)return!0;a=a.parentActionEvent}return!1}function JS(e,i){return C4(e,i,!1)}function eE(e,i){return C4(e,i,!0)}function tE(e){try{return JSON.stringify(e)}catch(i){return"<Unserializable: ".concat(i,">")}}function k4(e){return typeof e=="function"?"<function".concat(e.name?" "+e.name:"",">"):rn(e)?"<".concat(e,">"):"`".concat(tE(e),"`")}function nE(e){return e.length<280?e:"".concat(e.substring(0,272),"......").concat(e.substring(e.length-8))}function rE(e){var i=e.value,t=e.context[e.context.length-1].type,n=e.context.map(function(c){var d=c.path;return d}).filter(function(c){return c.length>0}).join("/"),a=n.length>0?'at path "/'.concat(n,'" '):"",l=rn(i)?"value of type ".concat(st(i).type.name,":"):pc(i)?"value":"snapshot",s=t&&rn(i)&&t.is(st(i).snapshot);return"".concat(a).concat(l," ").concat(k4(i)," is not assignable ").concat(t?"to type: `".concat(t.name,"`"):"")+(e.message?" (".concat(e.message,")"):"")+(t?Z4(t)||pc(i)?".":", 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 xv(e,i,t){return e.concat([{path:i,type:t}])}function bi(){return dc}function _i(e,i,t){return[{context:e,value:i,message:t}]}function Fp(e){return e.reduce(function(i,t){return i.concat(t)},[])}function Xa(e,i){_E()&&A4(e,i)}function A4(e,i){var t=e.validate(i,[{path:"",type:e}]);if(t.length>0)throw new nt(iE(e,i,t))}function iE(e,i,t){if(t.length!==0)return"Error while converting ".concat(nE(k4(i))," to `").concat(e.name,`\`:
93
-
94
- `)+t.map(rE).join(`
95
- `)}var oE=0,aE=function(){function e(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:oE++}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:un.map()}),Object.defineProperty(this,"lastCacheModificationPerId",{enumerable:!0,configurable:!0,writable:!0,value:un.map()})}return Object.defineProperty(e.prototype,"updateLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(i){var t=this.lastCacheModificationPerId.get(i);this.lastCacheModificationPerId.set(i,t===void 0?1:t+1)}}),Object.defineProperty(e.prototype,"getLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(i){var t=this.lastCacheModificationPerId.get(i)||0;return"".concat(this.cacheId,"-").concat(t)}}),Object.defineProperty(e.prototype,"addNodeToCache",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t){if(t===void 0&&(t=!0),i.identifierAttribute){var n=i.identifier;this.cache.has(n)||this.cache.set(n,un.array([],zp));var a=this.cache.get(n);if(a.indexOf(i)!==-1)throw new nt("Already registered");a.push(i),t&&this.updateLastCacheModificationPerId(n)}}}),Object.defineProperty(e.prototype,"mergeCache",{enumerable:!1,configurable:!0,writable:!0,value:function(i){var t=this;rv(i.identifierCache.cache).forEach(function(n){return n.forEach(function(a){t.addNodeToCache(a)})})}}),Object.defineProperty(e.prototype,"notifyDied",{enumerable:!1,configurable:!0,writable:!0,value:function(i){if(i.identifierAttribute){var t=i.identifier,n=this.cache.get(t);n&&(n.remove(i),n.length||this.cache.delete(t),this.updateLastCacheModificationPerId(i.identifier))}}}),Object.defineProperty(e.prototype,"splitCache",{enumerable:!1,configurable:!0,writable:!0,value:function(i){var t=this,n=new e,a=i.path+"/";return x5(this.cache).forEach(function(l){for(var s=fa(l,2),c=s[0],d=s[1],w=!1,_=d.length-1;_>=0;_--){var E=d[_];(E===i||E.path.indexOf(a)===0)&&(n.addNodeToCache(E,!1),d.splice(_,1),d.length||t.cache.delete(c),w=!0)}w&&t.updateLastCacheModificationPerId(c)}),n}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t){var n=this.cache.get(t);return n?n.some(function(a){return i.isAssignableFrom(a.type)}):!1}}),Object.defineProperty(e.prototype,"resolve",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t){var n=this.cache.get(t);if(!n)return null;var a=n.filter(function(l){return i.isAssignableFrom(l.type)});switch(a.length){case 0:return null;case 1:return a[0];default:throw new nt("Cannot resolve a reference to type '".concat(i.name,"' with id: '").concat(t,"' unambigously, there are multiple candidates: ").concat(a.map(function(l){return l.path}).join(", ")))}}}),e}();function Pv(e,i,t,n,a){var l=T4(a);if(l){if(l.parent)throw new nt("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(i?i.path:"","/").concat(t,"', but it lives already at '").concat(l.path,"'"));return i&&l.setParent(i,t),l}return new yi(e,i,t,n,a)}function ns(e,i,t,n,a){return new Cd(e,i,t,n,a)}function lE(e){return e instanceof Cd||e instanceof yi}var Lr;(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"})(Lr||(Lr={}));function rn(e){return!!(e&&e.$treenode)}function st(e){if(!rn(e))throw new nt("Value ".concat(e," is no MST Node"));return e.$treenode}function T4(e){return e&&e.$treenode||null}function sE(){return st(this).snapshot}var uE=function(e){return".."};function R4(e,i){if(e.root!==i.root)throw new nt("Cannot calculate relative path: objects '".concat(e,"' and '").concat(i,"' are not part of the same object tree"));for(var t=gc(e.path),n=gc(i.path),a=0;a<t.length&&t[a]===n[a];a++);return t.slice(a).map(uE).join("/")+mp(n.slice(a))}function M4(e,i,t){return t===void 0&&(t=!0),L4(e,gc(i),t)}function L4(e,i,t){t===void 0&&(t=!0);var n=e;try{for(var a=0;a<i.length;a++){var l=i[a];if(l===".."){if(n=n.parent,n)continue}else{if(l===".")continue;if(n){if(n instanceof Cd){var s=n.value;rn(s)&&(n=st(s))}if(n instanceof yi){var c=n.getChildType(l);if(c&&(n=n.getChildNode(l),n))continue}}}throw new nt("Could not resolve '".concat(l,"' in path '").concat(mp(i.slice(0,a))||"/","' while resolving '").concat(mp(i),"'"))}}catch(d){if(!t)return;throw d}return n}function N4(e){if(!e)return dc;var i=Object.keys(e);if(!i.length)return dc;var t=new Array(i.length);return i.forEach(function(n,a){t[a]=e[n]}),t}function cE(e){return z4(),B4(e)}var fE=Object.toString(),dc=Object.freeze([]),hc=Object.freeze({}),zp=n5().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(zp);var nt=function(e){_n(i,e);function i(t){return t===void 0&&(t="Illegal state"),e.call(this,"[mobx-state-tree] ".concat(t))||this}return i}(Error);function dE(e){return e}var hE=Number.isInteger;function pE(e){return Number(e)===e&&e%1!==0}function gE(e){return Number.isFinite(e)}function Cv(e){return Array.isArray(e)||ri(e)}function kv(e){return e?Cv(e)?e:[e]:dc}function vE(e){for(var i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];for(var n=0;n<i.length;n++){var a=i[n];for(var l in a)e[l]=a[l]}return e}function Fs(e){var i;if(e===null||typeof e!="object")return!1;var t=Object.getPrototypeOf(e);return t==null?!0:((i=t.constructor)===null||i===void 0?void 0:i.toString())===fE}function I4(e){return e!==null&&typeof e=="object"&&!(e instanceof Date)&&!(e instanceof RegExp)}function pc(e,i){return i===void 0&&(i=!0),e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||i&&e instanceof Date}function D4(e){return typeof e!="function"}function mE(e,i,t){_r(e)?ov(e,i,t):Object.defineProperty(e,i,t)}function zs(e,i,t){mE(e,i,{enumerable:!1,writable:!1,configurable:!0,value:t})}var yE=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(i,t){var n=this;return t===void 0&&(t=!1),t?this.handlers.unshift(i):this.handlers.push(i),function(){n.unregister(i)}}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(i){return this.handlers.indexOf(i)>=0}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(i){var t=this.handlers.indexOf(i);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 i=[],t=0;t<arguments.length;t++)i[t]=arguments[t];var n=this.handlers.slice();n.forEach(function(a){return a.apply(void 0,da([],fa(i),!1))})}}),e}(),j4=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(i){var t=this.eventHandlers&&this.eventHandlers[i];return!!t&&t.hasSubscribers}}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t,n){n===void 0&&(n=!1),this.eventHandlers||(this.eventHandlers={});var a=this.eventHandlers[i];return a||(a=this.eventHandlers[i]=new yE),a.register(t,n)}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t){var n=this.eventHandlers&&this.eventHandlers[i];return!!n&&n.has(t)}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t){var n=this.eventHandlers&&this.eventHandlers[i];n&&n.unregister(t)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(i){this.eventHandlers&&delete this.eventHandlers[i]}}),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(i){for(var t,n=[],a=1;a<arguments.length;a++)n[a-1]=arguments[a];var l=this.eventHandlers&&this.eventHandlers[i];l&&(t=l).emit.apply(t,da([],fa(n),!1))}}),e}();function F4(e){for(var i=new Array(e.length),t=0;t<e.length;t++)i[t]=e[t];return i}function Z0(e,i){return e.indexOf(i)===0}var z4=function(e,i){};z4.ids={};function bE(e){console.warn(new Error("[mobx-state-tree] ".concat(e)))}function _E(){return typeof process<"u"&&S2&&S2.ENABLE_TYPE_CHECK==="true"}function Q0(e){typeof queueMicrotask=="function"?queueMicrotask(e):typeof setImmediate=="function"?setImmediate(e):setTimeout(e,1)}function B4(e){return OE(e.name,e)}function wE(e){return e}function SE(e){return function(){var i,t=[];for(i=0;i<arguments.length;i++)t[i]=arguments[i];return c4(this,function(n){switch(n.label){case 0:return[4,e.apply(void 0,da([],fa(t),!1))];case 1:return[2,n.sent()]}})}}function EE(e){return c4(this,function(i){switch(i.label){case 0:return[4,e];case 1:return[2,i.sent()]}})}function OE(e,i){var t=function(){var a=O4(),l=Ev();if(!l)throw new nt("a mst flow must always have a parent context");var s=x4(l);if(!s)throw new nt("a mst flow must always have a parent action context");var c={name:e,id:a,tree:l.tree,context:l.context,parentId:l.id,allParentIds:da(da([],fa(l.allParentIds),!1),[l.id],!1),rootId:l.rootId,parentEvent:l,parentActionEvent:s},d=arguments;function w(_,E,O){return _.$mst_middleware=t.$mst_middleware,Vg(ur(ur({},c),{type:E,args:[O]}),_)}return new Promise(function(_,E){var O,v=function(){O=i.apply(null,arguments),S(void 0)};v.$mst_middleware=t.$mst_middleware,Vg(ur(ur({},c),{type:"flow_spawn",args:F4(d)}),v);function S(P){var g;try{var y=w(function(b){g=O.next(b)},"flow_resume",P);y instanceof Error&&(g=O.throw(y))}catch(b){Q0(function(){w(function(x){E(b)},"flow_throw",b)});return}h(g)}function p(P){var g;try{w(function(y){g=O.throw(y)},"flow_resume_error",P)}catch(y){Q0(function(){w(function(b){E(y)},"flow_throw",y)});return}h(g)}function h(P){if(P.done){Q0(function(){w(function(g){_(g)},"flow_return",P.value)});return}if(!P.value||typeof P.value.then!="function")throw new nt("Only promises can be yielded to `async`, got: "+P);return P.value.then(S,p)}})};return t._isFlowAction=!0,t}function xE(e){if(!("oldValue"in e))throw new nt("Patches without `oldValue` field cannot be inversed");return[PE(e),CE(e)]}function PE(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 CE(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 kE(e){return typeof e=="number"}function Wl(e){return kE(e)===!0?""+e:e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function U4(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function mp(e){if(e.length===0)return"";var i=function(t){return t.map(Wl).join("/")};return e[0]==="."||e[0]===".."?i(e):"/"+i(e)}function gc(e){var i=e.split("/").map(U4),t=e===""||e==="."||e===".."||Z0(e,"/")||Z0(e,"./")||Z0(e,"../");if(!t)throw new nt("a json path must be either rooted, empty or relative, but got '".concat(e,"'"));return i[0]===""&&i.shift(),i}var J0=Symbol("$preProcessorFailed"),AE=function(e){_n(i,e);function i(t,n,a){var l=e.call(this,a||t.name)||this;return Object.defineProperty(l,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(l,"_processors",{enumerable:!0,configurable:!0,writable:!0,value:n}),l}return Object.defineProperty(i.prototype,"flags",{get:function(){return this._subtype.flags|Tt.SnapshotProcessor},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"snapshotProcessor(".concat(this._subtype.describe(),")")}}),Object.defineProperty(i.prototype,"preProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._processors.preProcessor?this._processors.preProcessor.call(null,t):t}}),Object.defineProperty(i.prototype,"preProcessSnapshotSafe",{enumerable:!1,configurable:!0,writable:!0,value:function(t){try{return this.preProcessSnapshot(t)}catch{return J0}}}),Object.defineProperty(i.prototype,"postProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this._processors.postProcessor?this._processors.postProcessor.call(null,t,n.storedValue):t}}),Object.defineProperty(i.prototype,"_fixNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this;TE(t.type,this,"create"),t instanceof yi&&(t.hasSnapshotPostProcessor=!!this._processors.postProcessor);var a=t.getSnapshot;t.getSnapshot=function(){return n.postProcessSnapshot(a.call(t),t)},J4(this._subtype)||(t.getReconciliationType=function(){return n})}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){var s=rn(l)?l:this.preProcessSnapshot(l),c=this._subtype.instantiate(t,n,a,s);return this._fixNode(c),c}}),Object.defineProperty(i.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){var s=this._subtype.reconcile(t,rn(n)?n:this.preProcessSnapshot(n),a,l);return s!==t&&this._fixNode(s),s}}),Object.defineProperty(i.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){n===void 0&&(n=!0);var a=this._subtype.getSnapshot(t);return n?this.postProcessSnapshot(a,t):a}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this.preProcessSnapshotSafe(t);return a===J0?_i(n,t,"Failed to preprocess value"):this._subtype.validate(a,n)}}),Object.defineProperty(i.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),Object.defineProperty(i.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=cr(t)?this._subtype:rn(t)?wv(t,!1):this.preProcessSnapshotSafe(t);return n===J0?!1:this._subtype.validate(n,[{path:"",type:this._subtype}]).length===0}}),Object.defineProperty(i.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._subtype.isAssignableFrom(t)}}),Object.defineProperty(i.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(!(this._subtype instanceof fc))return!1;var a=this.preProcessSnapshot(n);return this._subtype.isMatchingSnapshotId(t,a)}}),i}(Qa);function TE(e,i){for(var t,n,a=[],l=2;l<arguments.length;l++)a[l-2]=arguments[l];try{for(var s=Sd(a),c=s.next();!c.done;c=s.next()){var d=c.value;e[d]=i[d].bind(i)}}catch(w){t={error:w}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}}function RE(e,i,t){return new AE(e,i,t)}var E2="Map.put can only be used to store complex values that have an identifier type attribute";function q4(e,i){var t,n,a=e.getSubTypes();if(a===w4)return!1;if(a){var l=kv(a);try{for(var s=Sd(l),c=s.next();!c.done;c=s.next()){var d=c.value;if(!q4(d,i))return!1}}catch(w){t={error:w}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}}return e instanceof Ad&&i.push(e),!0}var Gl;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.YES=1]="YES",e[e.NO=2]="NO"})(Gl||(Gl={}));var ME=function(e){_n(i,e);function i(t,n){return e.call(this,t,un.ref.enhancer,n)||this}return Object.defineProperty(i.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.get.call(this,""+t)}}),Object.defineProperty(i.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.has.call(this,""+t)}}),Object.defineProperty(i.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.delete.call(this,""+t)}}),Object.defineProperty(i.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return e.prototype.set.call(this,""+t,n)}}),Object.defineProperty(i.prototype,"put",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!t)throw new nt("Map.put cannot be used to set empty values");if(rn(t)){var n=st(t);if(n.identifier===null)throw new nt(E2);return this.set(n.identifier,t),t}else if(I4(t)){var a=st(this),l=a.type;if(l.identifierMode!==Gl.YES)throw new nt(E2);var s=l.mapIdentifierAttribute,c=t[s];if(!Tv(c)){var d=this.put(l.getChildType().create(t,a.environment));return this.put(wv(d))}var w=wc(c);return this.set(w,t),this.get(w)}else throw new nt("Map.put can only be used to store complex values")}}),i}(Mp),yp=function(e){_n(i,e);function i(t,n,a){a===void 0&&(a=[]);var l=e.call(this,t)||this;return Object.defineProperty(l,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(l,"identifierMode",{enumerable:!0,configurable:!0,writable:!0,value:Gl.UNKNOWN}),Object.defineProperty(l,"mapIdentifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Tt.Map}),Object.defineProperty(l,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),l._determineIdentifierMode(),l.hookInitializers=a,l}return Object.defineProperty(i.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.hookInitializers.length>0?this.hookInitializers.concat(t):[t];return new i(this.name,this._subType,n)}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){return this._determineIdentifierMode(),Pv(this,t,n,a,l)}}),Object.defineProperty(i.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===Gl.UNKNOWN){var t=[];if(q4(this._subType,t)){var n=t.reduce(function(a,l){if(!l.identifierAttribute)return a;if(a&&a!==l.identifierAttribute)throw new nt("The objects in a map should all have the same identifier attribute, expected '".concat(a,"', but child of type '").concat(l.name,"' declared attribute '").concat(l.identifierAttribute,"' as identifier"));return l.identifierAttribute},void 0);n?(this.identifierMode=Gl.YES,this.mapIdentifierAttribute=n):this.identifierMode=Gl.NO}}}}),Object.defineProperty(i.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){n===void 0&&(n={});var a=t.type._subType,l={};return Object.keys(n).forEach(function(s){l[s]=a.instantiate(t,s,void 0,n[s])}),l}}),Object.defineProperty(i.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new ME(t,this.name)}}),Object.defineProperty(i.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){nv(n,t.unbox);var a=t.type;a.hookInitializers.forEach(function(l){var s=l(n);Object.keys(s).forEach(function(c){var d=s[c],w=kd(n,c,d);zs(n,c,w)})}),Ap(n,this.willChange),Rp(n,this.didChange)}}),Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(i.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return rv(t.storedValue)}}),Object.defineProperty(i.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=t.storedValue.get(""+n);if(!a)throw new nt("Not a child "+n);return a}}),Object.defineProperty(i.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=st(t.object),a=t.name;n.assertWritable({subpath:a});var l=n.type,s=l._subType;switch(t.type){case"update":{var c=t.newValue,d=t.object.get(a);if(c===d)return null;Xa(s,c),t.newValue=s.reconcile(n.getChildNode(a),t.newValue,n,a),l.processIdentifier(a,t.newValue)}break;case"add":Xa(s,t.newValue),t.newValue=s.instantiate(n,a,void 0,t.newValue),l.processIdentifier(a,t.newValue);break}return t}}),Object.defineProperty(i.prototype,"processIdentifier",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(this.identifierMode===Gl.YES&&n instanceof yi){var a=n.identifier;if(a!==t)throw new nt("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(i.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n={};return t.getChildren().forEach(function(a){n[a.subpath]=a.snapshot}),n}}),Object.defineProperty(i.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n={};return Object.keys(t).forEach(function(a){n[a]=t[a].getSnapshot()}),n}}),Object.defineProperty(i.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=st(t.object);switch(t.type){case"update":return void n.emitPatch({op:"replace",path:Wl(t.name),value:t.newValue.snapshot,oldValue:t.oldValue?t.oldValue.snapshot:void 0},n);case"add":return void n.emitPatch({op:"add",path:Wl(t.name),value:t.newValue.snapshot,oldValue:void 0},n);case"delete":var a=t.oldValue.snapshot;return t.oldValue.die(),void n.emitPatch({op:"remove",path:Wl(t.name),oldValue:a},n)}}}),Object.defineProperty(i.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a){var l=t.storedValue;switch(a.op){case"add":case"replace":l.set(n,a.value);break;case"remove":l.delete(n);break}}}),Object.defineProperty(i.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){Xa(this,n);var a=t.storedValue,l={};if(Array.from(a.keys()).forEach(function(c){l[c]=!1}),n)for(var s in n)a.set(s,n[s]),l[""+s]=!0;Object.keys(l).forEach(function(c){l[c]===!1&&a.delete(c)})}}),Object.defineProperty(i.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this;return Fs(t)?Fp(Object.keys(t).map(function(l){return a._subType.validate(t[l],xv(n,l,a._subType))})):_i(n,t,"Value is not a plain object")}}),Object.defineProperty(i.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return hc}}),Object.defineProperty(i.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){t.storedValue.delete(n)}}),i}(fc);yp.prototype.applySnapshot=Zn(yp.prototype.applySnapshot);function LE(e){return new yp("Map<string, ".concat(e.name,">"),e)}function NE(e){return cr(e)&&(e.flags&Tt.Map)>0}var bp=function(e){_n(i,e);function i(t,n,a){a===void 0&&(a=[]);var l=e.call(this,t)||this;return Object.defineProperty(l,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(l,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Tt.Array}),Object.defineProperty(l,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),l.hookInitializers=a,l}return Object.defineProperty(i.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.hookInitializers.length>0?this.hookInitializers.concat(t):[t];return new i(this.name,this._subType,n)}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){return Pv(this,t,n,a,l)}}),Object.defineProperty(i.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){n===void 0&&(n=[]);var a=t.type._subType,l={};return n.forEach(function(s,c){var d=""+c;l[d]=a.instantiate(t,d,void 0,s)}),l}}),Object.defineProperty(i.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=ur(ur({},zp),{name:this.name});return un.array(N4(t),n)}}),Object.defineProperty(i.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){Mo(n).dehancer=t.unbox;var a=t.type;a.hookInitializers.forEach(function(l){var s=l(n);Object.keys(s).forEach(function(c){var d=s[c],w=kd(n,c,d);zs(n,c,w)})}),Ap(n,this.willChange),Rp(n,this.didChange)}}),Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(i.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue.slice()}}),Object.defineProperty(i.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=Number(n);if(a<t.storedValue.length)return t.storedValue[a];throw new nt("Not a child: "+n)}}),Object.defineProperty(i.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=st(t.object);n.assertWritable({subpath:""+t.index});var a=n.type._subType,l=n.getChildren();switch(t.type){case"update":{if(t.newValue===t.object[t.index])return null;var s=O2(n,a,[l[t.index]],[t.newValue],[t.index]);if(!s)return null;t.newValue=s[0]}break;case"splice":{var c=t.index,d=t.removedCount,w=t.added,_=O2(n,a,l.slice(c,c+d),w,w.map(function(O,v){return c+v}));if(!_)return null;t.added=_;for(var E=c+d;E<l.length;E++)l[E].setParent(n,""+(E+w.length-d))}break}return t}}),Object.defineProperty(i.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.getChildren().map(function(n){return n.snapshot})}}),Object.defineProperty(i.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=[];return Object.keys(t).forEach(function(a){n.push(t[a].getSnapshot())}),n}}),Object.defineProperty(i.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=st(t.object);switch(t.type){case"update":return void n.emitPatch({op:"replace",path:""+t.index,value:t.newValue.snapshot,oldValue:t.oldValue?t.oldValue.snapshot:void 0},n);case"splice":if(t.removedCount&&t.addedCount===t.object.length)return void n.emitPatch({op:"replace",path:"",value:n.snapshot,oldValue:t.removed.map(function(l){return l.snapshot})},n);for(var a=t.removedCount-1;a>=0;a--)n.emitPatch({op:"remove",path:""+(t.index+a),oldValue:t.removed[a].snapshot},n);for(var a=0;a<t.addedCount;a++)n.emitPatch({op:"add",path:""+(t.index+a),value:t.added[a].snapshot,oldValue:void 0},n);return}}}),Object.defineProperty(i.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a){var l=t.storedValue,s=n==="-"?l.length:Number(n);switch(a.op){case"replace":l[s]=a.value;break;case"add":l.splice(s,0,a.value);break;case"remove":l.splice(s,1);break}}}),Object.defineProperty(i.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){Xa(this,n);var a=t.storedValue;a.replace(n)}}),Object.defineProperty(i.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this;return Cv(t)?Fp(t.map(function(l,s){return a._subType.validate(l,xv(n,""+s,a._subType))})):_i(n,t,"Value is not an array")}}),Object.defineProperty(i.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return dc}}),Object.defineProperty(i.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){t.storedValue.splice(Number(n),1)}}),i}(fc);bp.prototype.applySnapshot=Zn(bp.prototype.applySnapshot);function IE(e){return new bp("".concat(e.name,"[]"),e)}function O2(e,i,t,n,a){for(var l=!0,s=0;;s++){var c=s<=n.length-1,d=t[s],w=c?n[s]:void 0,_=""+a[s];if(lE(w)&&(w=w.storedValue),!d&&!c)break;if(!c)l=!1,t.splice(s,1),d instanceof yi&&d.createObservableInstanceIfNeeded(),d.die(),s--;else if(d)if(x2(d,w))t[s]=e1(i,e,_,w,d);else{for(var O=void 0,v=s;v<t.length;v++)if(x2(t[v],w)){O=t.splice(v,1)[0];break}l=!1;var E=e1(i,e,_,w,O);t.splice(s,0,E)}else{if(rn(w)&&st(w).parent===e)throw new nt("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(_,"', but it lives already at '").concat(st(w).path,"'"));l=!1;var E=e1(i,e,_,w);t.splice(s,0,E)}}return l?null:t}function e1(e,i,t,n,a){Xa(e,n);function l(){if(rn(n)){var c=st(n);if(c.assertAlive(hc),c.parent!==null&&c.parent===i)return c.setParent(i,t),c}return a?e.reconcile(a,n,i,t):e.instantiate(i,t,void 0,n)}var s=l();return a&&a!==s&&(a instanceof yi&&a.createObservableInstanceIfNeeded(),a.die()),s}function x2(e,i){if(!e.isAlive)return!1;if(rn(i)){var t=st(i);return t.isAlive&&t===e}if(e.snapshot===i)return!0;if(!(e instanceof yi))return!1;var n=e.getReconciliationType();return e.identifier!==null&&e.identifierAttribute&&Fs(i)&&n.is(i)&&n.isMatchingSnapshotId(e,i)}function DE(e){return cr(e)&&(e.flags&Tt.Array)>0}var P2="preProcessSnapshot",C2="postProcessSnapshot";function jE(){return st(this).toString()}var k2={name:"AnonymousModel",properties:{},initializers:dc};function FE(e){var i=Object.keys(e),t=new Set;return i.forEach(function(n){if(t.has(n))throw new nt("".concat(n," is declared twice in the model. Model should not contain the same keys"));t.add(n)}),i.reduce(function(n,a){if(a in sr)throw new nt("Hook '".concat(a,"' was defined as property. Hooks should be defined as part of the actions"));var l=Object.getOwnPropertyDescriptor(e,a);if("get"in l)throw new nt("Getters are not supported as properties. Please use views instead");var s=l.value;if(s==null)throw new nt("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(pc(s))n[a]=Bs(GE(s),s);else if(s instanceof yp)n[a]=Bs(s,{});else if(s instanceof bp)n[a]=Bs(s,[]);else if(!cr(s))throw new nt("Invalid type definition for property '".concat(a,"', cannot infer a type from a value like '").concat(s,"' (").concat(typeof s,")"));return n},ur({},e))}var Ad=function(e){_n(i,e);function i(t){var n=e.call(this,t.name||k2.name)||this;return Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Tt.Object}),Object.defineProperty(n,"initializers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"properties",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"preProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"postProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"propertyNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"named",{enumerable:!0,configurable:!0,writable:!0,value:function(a){return n.cloneAndEnhance({name:a})}}),Object.defineProperty(n,"props",{enumerable:!0,configurable:!0,writable:!0,value:function(a){return n.cloneAndEnhance({properties:a})}}),Object.defineProperty(n,"preProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(a){var l=n.preProcessor;return l?n.cloneAndEnhance({preProcessor:function(s){return l(a(s))}}):n.cloneAndEnhance({preProcessor:a})}}),Object.defineProperty(n,"postProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(a){var l=n.postProcessor;return l?n.cloneAndEnhance({postProcessor:function(s){return a(l(s))}}):n.cloneAndEnhance({postProcessor:a})}}),Object.assign(n,k2,t),n.properties=FE(n.properties),n.properties,n.propertyNames=Object.keys(n.properties),n.identifierAttribute=n._getIdentifierAttribute(),n}return Object.defineProperty(i.prototype,"_getIdentifierAttribute",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=void 0;return this.forAllProps(function(n,a){if(a.flags&Tt.Identifier){if(t)throw new nt("Cannot define property '".concat(n,"' as object identifier, property '").concat(t,"' is already defined as identifier property"));t=n}}),t}}),Object.defineProperty(i.prototype,"cloneAndEnhance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new i({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(i.prototype,"actions",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this,a=function(l){return n.instantiateActions(l,t(l)),l};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(i.prototype,"instantiateActions",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(!Fs(n))throw new nt("actions initializer should return a plain object containing actions");Object.keys(n).forEach(function(a){if(a===P2)throw new nt("Cannot define action '".concat(P2,"', it should be defined using 'type.preProcessSnapshot(fn)' instead"));if(a===C2)throw new nt("Cannot define action '".concat(C2,"', it should be defined using 'type.postProcessSnapshot(fn)' instead"));var l=n[a],s=t[a];if(a in sr&&s){var c=l;l=function(){s.apply(null,arguments),c.apply(null,arguments)}}var d=l.$mst_middleware,w=l.bind(n);w._isFlowAction=l._isFlowAction||!1,w.$mst_middleware=d;var _=kd(t,a,w);n[a]=_,zs(t,a,_)})}}),Object.defineProperty(i.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this;if(typeof t!="function")throw new nt("You passed an ".concat(typeof t," to volatile state as an argument, when function is expected"));var a=function(l){return n.instantiateVolatileState(l,t(l)),l};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(i.prototype,"instantiateVolatileState",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(!Fs(n))throw new nt("volatile state initializer should return a plain object containing state");iv(t,n)}}),Object.defineProperty(i.prototype,"extend",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this,a=function(l){var s=t(l),c=s.actions,d=s.views,w=s.state,_=cS(s,["actions","views","state"]);for(var E in _)throw new nt("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '".concat(E,"'"));return w&&n.instantiateVolatileState(l,w),d&&n.instantiateViews(l,d),c&&n.instantiateActions(l,c),l};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(i.prototype,"views",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this,a=function(l){return n.instantiateViews(l,t(l)),l};return this.cloneAndEnhance({initializers:[a]})}}),Object.defineProperty(i.prototype,"instantiateViews",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(!Fs(n))throw new nt("views initializer should return a plain object containing views");Object.getOwnPropertyNames(n).forEach(function(a){var l,s=Object.getOwnPropertyDescriptor(n,a);if("get"in s)ov(t,a,s),av(t,(l={},l[a]=$s,l));else if(typeof s.value=="function")zs(t,a,s.value);else throw new nt("A view member should either be a function or getter based property")})}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){var s=rn(l)?l:this.applySnapshotPreProcessor(l);return Pv(this,t,n,a,s)}}),Object.defineProperty(i.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){n===void 0&&(n={});var a=t.type,l={};return a.forAllProps(function(s,c){l[s]=c.instantiate(t,s,void 0,n[s])}),l}}),Object.defineProperty(i.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=ur(ur({},zp),{name:this.name});return un.object(t,hc,n)}}),Object.defineProperty(i.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){zs(n,"toString",jE),this.forAllProps(function(a){nv(n,a,t.unbox)}),this.initializers.reduce(function(a,l){return l(a)},n),Ap(n,this.willChange),Rp(n,this.didChange)}}),Object.defineProperty(i.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=t,a=st(n.object),l=n.name;a.assertWritable({subpath:l});var s=a.type.properties[l];return s&&(Xa(s,n.newValue),n.newValue=s.reconcile(a.getChildNode(l),n.newValue,a,l)),n}}),Object.defineProperty(i.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=t,a=st(n.object),l=a.type.properties[n.name];if(l){var s=n.oldValue?n.oldValue.snapshot:void 0;a.emitPatch({op:"replace",path:Wl(n.name),value:n.newValue.snapshot,oldValue:s},a)}}}),Object.defineProperty(i.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this,a=[];return this.forAllProps(function(l){a.push(n.getChildNode(t,l))}),a}}),Object.defineProperty(i.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a;if(!(n in this.properties))throw new nt("Not a value property: "+n);var l=Mo(t.storedValue,n),s=(a=l.raw)===null||a===void 0?void 0:a.call(l);if(!s)throw new nt("Node not available for property "+n);return s}}),Object.defineProperty(i.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this;n===void 0&&(n=!0);var l={};return this.forAllProps(function(s,c){try{var d=ca(t.storedValue,s);d.reportObserved()}catch{throw new nt("".concat(s," property is declared twice"))}l[s]=a.getChildNode(t,s).snapshot}),n?this.applySnapshotPostProcessor(l):l}}),Object.defineProperty(i.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n={};return Object.keys(t).forEach(function(a){n[a]=t[a].getSnapshot()}),this.applySnapshotPostProcessor(n)}}),Object.defineProperty(i.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a){if(!(a.op==="replace"||a.op==="add"))throw new nt("object does not support operation ".concat(a.op));t.storedValue[n]=a.value}}),Object.defineProperty(i.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){Xa(this,n);var a=this.applySnapshotPreProcessor(n);this.forAllProps(function(l){t.storedValue[l]=a[l]})}}),Object.defineProperty(i.prototype,"applySnapshotPreProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.preProcessor;return n?n.call(null,t):t}}),Object.defineProperty(i.prototype,"applySnapshotPostProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.postProcessor;return n?n.call(null,t):t}}),Object.defineProperty(i.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.properties[t]}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this,l=this.applySnapshotPreProcessor(t);return Fs(l)?Fp(this.propertyNames.map(function(s){return a.properties[s].validate(l[s],xv(n,s,a.properties[s]))})):_i(n,l,"Value is not a plain object")}}),Object.defineProperty(i.prototype,"forAllProps",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this;this.propertyNames.forEach(function(a){return t(a,n.properties[a])})}}),Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this;return"{ "+this.propertyNames.map(function(n){return n+": "+t.properties[n].describe()}).join("; ")+" }"}}),Object.defineProperty(i.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return hc}}),Object.defineProperty(i.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){t.storedValue[n]=void 0}}),i}(fc);Ad.prototype.applySnapshot=Zn(Ad.prototype.applySnapshot);function zE(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var t=typeof e[0]=="string"?e.shift():"AnonymousModel",n=e.shift()||{};return new Ad({name:t,properties:n})}function BE(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var t=typeof e[0]=="string",n=t?e[0]:"AnonymousModel";return t&&e.shift(),e.reduce(function(a,l){return a.cloneAndEnhance({name:a.name+"_"+l.name,properties:l.properties,initializers:l.initializers,preProcessor:function(s){return l.applySnapshotPreProcessor(a.applySnapshotPreProcessor(s))},postProcessor:function(s){return l.applySnapshotPostProcessor(a.applySnapshotPostProcessor(s))}})}).named(n)}function H4(e){return cr(e)&&(e.flags&Tt.Object)>0}var el=function(e){_n(i,e);function i(t,n,a,l){l===void 0&&(l=dE);var s=e.call(this,t)||this;return Object.defineProperty(s,"flags",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(s,"checker",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(s,"initializer",{enumerable:!0,configurable:!0,writable:!0,value:l}),s.flags=n,s}return Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){return ns(this,t,n,a,l)}}),Object.defineProperty(i.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.initializer(t)}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(pc(t)&&this.checker(t))return bi();var a=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return _i(n,t,"Value is not a ".concat(a))}}),i}(Zs),G4=new el("string",Tt.String,function(e){return typeof e=="string"}),V4=new el("number",Tt.Number,function(e){return typeof e=="number"}),UE=new el("integer",Tt.Integer,function(e){return hE(e)}),qE=new el("float",Tt.Float,function(e){return pE(e)}),HE=new el("finite",Tt.Finite,function(e){return gE(e)}),$4=new el("boolean",Tt.Boolean,function(e){return typeof e=="boolean"}),W4=new el("null",Tt.Null,function(e){return e===null}),Y4=new el("undefined",Tt.Undefined,function(e){return e===void 0}),K4=new el("Date",Tt.Date,function(e){return typeof e=="number"||e instanceof Date},function(e){return e instanceof Date?e:new Date(e)});K4.getSnapshot=function(e){return e.storedValue.getTime()};var X4=K4;function GE(e){switch(typeof e){case"string":return G4;case"number":return V4;case"boolean":return $4;case"object":if(e instanceof Date)return X4}throw new nt("Cannot determine primitive type from value "+e)}function Z4(e){return cr(e)&&(e.flags&(Tt.String|Tt.Number|Tt.Integer|Tt.Boolean|Tt.Date))>0}var VE=function(e){_n(i,e);function i(t){var n=e.call(this,JSON.stringify(t))||this;return Object.defineProperty(n,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Tt.Literal}),n.value=t,n}return Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){return ns(this,t,n,a,l)}}),Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify(this.value)}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return pc(t)&&t===this.value?bi():_i(n,t,"Value is not a literal ".concat(JSON.stringify(this.value)))}}),i}(Zs);function Q4(e){return new VE(e)}function $E(e){return cr(e)&&(e.flags&Tt.Literal)>0}var WE=function(e){_n(i,e);function i(t,n,a,l){var s=e.call(this,t)||this;return Object.defineProperty(s,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(s,"_predicate",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(s,"_message",{enumerable:!0,configurable:!0,writable:!0,value:l}),s}return Object.defineProperty(i.prototype,"flags",{get:function(){return this._subtype.flags|Tt.Refinement},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){return this._subtype.instantiate(t,n,a,l)}}),Object.defineProperty(i.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._subtype.isAssignableFrom(t)}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this._subtype.validate(t,n);if(a.length>0)return a;var l=rn(t)?st(t).snapshot:t;return this._predicate(l)?bi():_i(n,t,this._message(t))}}),Object.defineProperty(i.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){return this._subtype.reconcile(t,n,a,l)}}),Object.defineProperty(i.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),i}(Qa);function YE(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var t=typeof e[0]=="string"?e.shift():cr(e[0])?e[0].name:null,n=e[0],a=e[1],l=e[2]?e[2]:function(s){return"Value does not respect the refinement predicate"};return new WE(t,n,a,l)}function KE(e){return cr(e)&&(e.flags&Tt.Refinement)>0}function XE(e,i){var t=typeof e=="string"?i:e,n=Bp.apply(void 0,da([],fa(t.map(function(a){return Q4(""+a)})),!1));return typeof e=="string"&&(n.name=e),n}var ZE=function(e){_n(i,e);function i(t,n,a){var l=e.call(this,t)||this;return Object.defineProperty(l,"_types",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(l,"_dispatcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_eager",{enumerable:!0,configurable:!0,writable:!0,value:!0}),a=ur({eager:!0,dispatcher:void 0},a),l._dispatcher=a.dispatcher,a.eager||(l._eager=!1),l}return Object.defineProperty(i.prototype,"flags",{get:function(){var t=Tt.Union;return this._types.forEach(function(n){t|=n.flags}),t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._types.some(function(n){return n.isAssignableFrom(t)})}}),Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"("+this._types.map(function(t){return t.describe()}).join(" | ")+")"}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){var s=this.determineType(l,void 0);if(!s)throw new nt("No matching type for union "+this.describe());return s.instantiate(t,n,a,l)}}),Object.defineProperty(i.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){var s=this.determineType(n,t.getReconciliationType());if(!s)throw new nt("No matching type for union "+this.describe());return s.reconcile(t,n,a,l)}}),Object.defineProperty(i.prototype,"determineType",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this._dispatcher?this._dispatcher(t):n?n.is(t)?n:this._types.filter(function(a){return a!==n}).find(function(a){return a.is(t)}):this._types.find(function(a){return a.is(t)})}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(this._dispatcher)return this._dispatcher(t).validate(t,n);for(var a=[],l=0,s=0;s<this._types.length;s++){var c=this._types[s],d=c.validate(t,n);if(d.length===0){if(this._eager)return bi();l++}else a.push(d)}return l===1?bi():_i(n,t,"No type is applicable for the union").concat(Fp(a))}}),Object.defineProperty(i.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),i}(Qa);function Bp(e){for(var i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];var n=cr(e)?void 0:e,a=cr(e)?da([e],fa(i),!1):i,l="("+a.map(function(s){return s.name}).join(" | ")+")";return new ZE(l,a,n)}function J4(e){return cr(e)&&(e.flags&Tt.Union)>0}var QE=function(e){_n(i,e);function i(t,n,a){var l=e.call(this,t.name)||this;return Object.defineProperty(l,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(l,"_defaultValue",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(l,"optionalValues",{enumerable:!0,configurable:!0,writable:!0,value:a}),l}return Object.defineProperty(i.prototype,"flags",{get:function(){return this._subtype.flags|Tt.Optional},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype.describe()+"?"}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){if(this.optionalValues.indexOf(l)>=0){var s=this.getDefaultInstanceOrSnapshot();return this._subtype.instantiate(t,n,a,s)}return this._subtype.instantiate(t,n,a,l)}}),Object.defineProperty(i.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){return this._subtype.reconcile(t,this.optionalValues.indexOf(n)<0&&this._subtype.is(n)?n:this.getDefaultInstanceOrSnapshot(),a,l)}}),Object.defineProperty(i.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"&&Xa(this,t),t}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this.optionalValues.indexOf(t)>=0?bi():this._subtype.validate(t,n)}}),Object.defineProperty(i.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this._subtype.isAssignableFrom(t)}}),Object.defineProperty(i.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),i}(Qa);function JE(e,i){if(typeof i!="function"&&rn(i))throw new nt("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function Bs(e,i,t){return JE(e,i),new QE(e,i,t||eO)}var eO=[void 0];function tO(e){return cr(e)&&(e.flags&Tt.Optional)>0}var nO=Bs(Y4,void 0),rO=Bs(W4,null);function e_(e){return Bp(e,nO)}function iO(e){return Bp(e,rO)}var oO=function(e){_n(i,e);function i(t,n){var a=e.call(this,t)||this;return Object.defineProperty(a,"_definition",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),a}return Object.defineProperty(i.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|Tt.Late},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"getSubType",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(!this._subType){var n=void 0;try{n=this._definition()}catch(a){if(a instanceof ReferenceError)n=void 0;else throw a}if(t&&n===void 0)throw new nt("Late type seems to be used too early, the definition (still) returns undefined");n&&(this._subType=n)}return this._subType}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){return this.getSubType(!0).instantiate(t,n,a,l)}}),Object.defineProperty(i.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){return this.getSubType(!0).reconcile(t,n,a,l)}}),Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.getSubType(!1);return t?t.name:"<uknown late type>"}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this.getSubType(!1);return a?a.validate(t,n):bi()}}),Object.defineProperty(i.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this.getSubType(!1);return n?n.isAssignableFrom(t):!1}}),Object.defineProperty(i.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.getSubType(!1);return t||w4}}),i}(Qa);function aO(e,i){var t=typeof e=="string"?e:"late(".concat(e.toString(),")"),n=typeof e=="string"?i:e;return new oO(t,n)}function lO(e){return cr(e)&&(e.flags&Tt.Late)>0}function sO(e,i){return new uO(e,i)}var uO=function(e){_n(i,e);function i(t,n){var a=e.call(this,t)||this;return Object.defineProperty(a,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Tt.Lazy}),Object.defineProperty(a,"loadedType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(a,"pendingNodeList",{enumerable:!0,configurable:!0,writable:!0,value:un.array()}),Bg(function(){return a.pendingNodeList.length>0&&a.pendingNodeList.some(function(l){return l.isAlive&&a.options.shouldLoadPredicate(l.parent?l.parent.value:null)})},function(){a.options.loadType().then(Zn(function(l){a.loadedType=l,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(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<lazy ".concat(this.name,">")}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){var s=this;if(this.loadedType)return this.loadedType.instantiate(t,n,a,l);var c=ns(this,t,n,a,l);return this.pendingNodeList.push(c),Bg(function(){return!c.isAlive},function(){return s.pendingNodeList.splice(s.pendingNodeList.indexOf(c),1)}),c}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this.loadedType?this.loadedType.validate(t,n):D4(t)?bi():_i(n,t,"Value is not serializable and cannot be lazy")}}),Object.defineProperty(i.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){return this.loadedType?(t.die(),this.loadedType.instantiate(a,l,a.environment,n)):e.prototype.reconcile.call(this,t,n,a,l)}}),i}(Zs),t_=function(e){_n(i,e);function i(t){var n=e.call(this,t?"frozen(".concat(t.name,")"):"frozen")||this;return Object.defineProperty(n,"subType",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Tt.Frozen}),n}return Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<any immutable value>"}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){return ns(this,t,n,a,l)}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return D4(t)?this.subType?this.subType.validate(t,n):bi():_i(n,t,"Value is not serializable and cannot be frozen")}}),i}(Zs),A2=new t_;function cO(e){return arguments.length===0?A2:cr(e)?new t_(e):Bs(A2,e)}function fO(e){return cr(e)&&(e.flags&Tt.Frozen)>0}function dO(e){switch(e){case sr.beforeDestroy:return"destroy";case sr.beforeDetach:return"detach";default:return}}var hO=function(){function e(i,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}),Tv(i))this.identifier=i;else if(rn(i)){var n=st(i);if(!n.identifierAttribute)throw new nt("Can only store references with a defined identifier attribute.");var a=n.unnormalizedIdentifier;if(a==null)throw new nt("Can only store references to tree nodes with a defined identifier.");this.identifier=a}else throw new nt("Can only store references to tree nodes or identifiers, got: '".concat(i,"'"))}return Object.defineProperty(e.prototype,"updateResolvedReference",{enumerable:!1,configurable:!0,writable:!0,value:function(i){var t=wc(this.identifier),n=i.root,a=n.identifierCache.getLastCacheModificationPerId(t);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==a){var l=this.targetType,s=n.identifierCache.resolve(l,t);if(!s)throw new Av("[mobx-state-tree] Failed to resolve reference '".concat(this.identifier,"' to type '").concat(this.targetType.name,"' (from node: ").concat(i.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}(),Av=function(e){_n(i,e);function i(t){var n=e.call(this,t)||this;return Object.setPrototypeOf(n,i.prototype),n}return i}(Error),n_=function(e){_n(i,e);function i(t,n){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:n}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Tt.Reference}),a}return Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(i.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.targetType.isAssignableFrom(t)}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return Tv(t)?bi():_i(n,t,"Value is not a valid identifier, which is a string or a number")}}),Object.defineProperty(i.prototype,"fireInvalidated",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){var s=n.parent;if(!(!s||!s.isAlive)){var c=s.storedValue;c&&this.onInvalidated({cause:t,parent:c,invalidTarget:l?l.storedValue:void 0,invalidId:a,replaceRef:function(d){cc(n.root.storedValue,{op:"replace",value:d,path:n.path})},removeRef:function(){H4(s.type)?this.replaceRef(void 0):cc(n.root.storedValue,{op:"remove",path:n.path})}})}}}),Object.defineProperty(i.prototype,"addTargetNodeWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var a=this,l=this.getValue(t);if(l){var s=st(l),c=function(_,E){var O=dO(E);O&&a.fireInvalidated(O,t,n,s)},d=s.registerHook(sr.beforeDetach,c),w=s.registerHook(sr.beforeDestroy,c);return function(){d(),w()}}}}),Object.defineProperty(i.prototype,"watchTargetNodeForInvalidations",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a){var l=this;if(this.onInvalidated){var s;t.registerHook(sr.beforeDestroy,function(){s&&s()});var c=function(d){s&&s();var w=t.parent,_=w&&w.storedValue;if(w&&w.isAlive&&_){var E=void 0;a?E=!!a.get(n,_):E=t.root.identifierCache.has(l.targetType,wc(n)),E?s=l.addTargetNodeWatcher(t,n):d||l.fireInvalidated("invalidSnapshotReference",t,n,null)}};t.state===Lr.FINALIZED?c(!0):(t.isRoot||t.root.registerHook(sr.afterCreationFinalization,function(){t.parent&&t.parent.createObservableInstanceIfNeeded()}),t.registerHook(sr.afterAttach,function(){c(!1)}))}}}),i}(Zs),pO=function(e){_n(i,e);function i(t,n){return e.call(this,t,n)||this}return Object.defineProperty(i.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(t.isAlive){var n=t.storedValue;return n.resolvedValue}}}),Object.defineProperty(i.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=t.storedValue;return n.identifier}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){var s=rn(l)?g4(l):l,c=new hO(l,this.targetType),d=ns(this,t,n,a,c);return c.node=d,this.watchTargetNodeForInvalidations(d,s,void 0),d}}),Object.defineProperty(i.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){if(!t.isDetaching&&t.type===this){var s=rn(n),c=t.storedValue;if(!s&&c.identifier===n||s&&c.resolvedValue===n)return t.setParent(a,l),t}var d=this.instantiate(a,l,void 0,n);return t.die(),d}}),i}(n_),gO=function(e){_n(i,e);function i(t,n,a){var l=e.call(this,t,a)||this;return Object.defineProperty(l,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),l}return Object.defineProperty(i.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(t.isAlive){var n=this.options.get(t.storedValue,t.parent?t.parent.storedValue:null);return n}}}),Object.defineProperty(i.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){var s=rn(l)?this.options.set(l,t?t.storedValue:null):l,c=ns(this,t,n,a,s);return this.watchTargetNodeForInvalidations(c,s,this.options),c}}),Object.defineProperty(i.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){var s=rn(n)?this.options.set(n,t?t.storedValue:null):n;if(!t.isDetaching&&t.type===this&&t.storedValue===s)return t.setParent(a,l),t;var c=this.instantiate(a,l,void 0,s);return t.die(),c}}),i}(n_);function r_(e,i){var t=i||void 0,n=i?i.onInvalidated:void 0;return t&&(t.get||t.set)?new gO(e,{get:t.get,set:t.set},n):new pO(e,n)}function vO(e){return cr(e)&&(e.flags&Tt.Reference)>0}function mO(e,i){var t=r_(e,ur(ur({},i),{onInvalidated:function(n){i&&i.onInvalidated&&i.onInvalidated(n),n.removeRef()}}));return i&&i.acceptsUndefined===!1?t:e_(t)}var i_=function(e){_n(i,e);function i(t,n){var a=e.call(this,t)||this;return Object.defineProperty(a,"validType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Tt.Identifier}),a}return Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){if(!t||!(t.type instanceof Ad))throw new nt("Identifier types can only be instantiated as direct child of a model type");return ns(this,t,n,a,l)}}),Object.defineProperty(i.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){if(t.storedValue!==n)throw new nt("Tried to change identifier from '".concat(t.storedValue,"' to '").concat(n,"'. Changing identifiers is not allowed."));return t.setParent(a,l),t}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return typeof t!==this.validType?_i(n,t,"Value is not a valid ".concat(this.describe(),", expected a ").concat(this.validType)):bi()}}),i}(Zs),yO=function(e){_n(i,e);function i(){var t=e.call(this,"identifier","string")||this;return Object.defineProperty(t,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Tt.Identifier}),t}return Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),i}(i_),bO=function(e){_n(i,e);function i(){return e.call(this,"identifierNumber","number")||this}return Object.defineProperty(i.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t.storedValue}}),Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifierNumber"}}),i}(i_),_O=new yO,wO=new bO;function SO(e){return cr(e)&&(e.flags&Tt.Identifier)>0}function wc(e){return""+e}function Tv(e){return typeof e=="string"||typeof e=="number"}function EO(e){return new OO(e)}var OO=function(e){_n(i,e);function i(t){var n=e.call(this,t.name)||this;return Object.defineProperty(n,"options",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Tt.Custom}),n}return Object.defineProperty(i.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(i.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){if(this.options.isTargetType(t))return bi();var a=this.options.getValidationMessage(t);return a?_i(n,t,"Invalid value for type '".concat(this.name,"': ").concat(a)):bi()}}),Object.defineProperty(i.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.options.toSnapshot(t.storedValue)}}),Object.defineProperty(i.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){var s=this.options.isTargetType(l)?l:this.options.fromSnapshot(l,t&&t.root.environment);return ns(this,t,n,a,s)}}),Object.defineProperty(i.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,a,l){var s=!this.options.isTargetType(n);if(!t.isDetaching){var c=t.type===this&&(s?n===t.snapshot:n===t.storedValue);if(c)return t.setParent(a,l),t}var d=s?this.options.fromSnapshot(n,a.root.environment):n,w=this.instantiate(a,l,void 0,d);return t.die(),w}}),i}(Zs),T2={enumeration:XE,model:zE,compose:BE,custom:EO,reference:r_,safeReference:mO,union:Bp,optional:Bs,literal:Q4,maybe:e_,maybeNull:iO,refinement:YE,string:G4,boolean:$4,number:V4,integer:UE,float:qE,finite:HE,Date:X4,map:LE,array:IE,frozen:cO,identifier:_O,identifierNumber:wO,late:aO,lazy:sO,undefined:Y4,null:W4,snapshotProcessor:RE};const xO=Object.freeze(Object.defineProperty({__proto__:null,addDisposer:RS,addMiddleware:P4,applyAction:S4,applyPatch:cc,applySnapshot:d4,cast:IS,castFlowReturn:wE,castToReferenceSnapshot:jS,castToSnapshot:DS,clone:kS,createActionTrackingMiddleware:qS,createActionTrackingMiddleware2:GS,decorate:XS,destroy:TS,detach:AS,escapeJsonPath:Wl,flow:B4,getChildType:fS,getEnv:MS,getIdentifier:g4,getLivelinessChecking:u4,getMembers:NS,getNodeId:FS,getParent:yS,getParentOfType:_S,getPath:p4,getPathParts:wS,getPropertyMembers:y4,getRelativePath:CS,getRoot:h4,getRunningActionContext:Ov,getSnapshot:wv,getType:Ud,hasEnv:LS,hasParent:mS,hasParentOfType:bS,isActionContextChildOf:JS,isActionContextThisOrChildOf:eE,isAlive:Sv,isArrayType:DE,isFrozenType:fO,isIdentifierType:SO,isLateType:lO,isLiteralType:$E,isMapType:NE,isModelType:H4,isOptionalType:tO,isPrimitiveType:Z4,isProtected:vS,isReferenceType:vO,isRefinementType:KE,isRoot:SS,isStateTreeNode:rn,isType:cr,isUnionType:J4,isValidReference:PS,joinJsonPath:mp,onAction:E4,onPatch:f4,onSnapshot:dS,process:cE,protect:pS,recordActions:YS,recordPatches:hS,resolveIdentifier:OS,resolvePath:ES,setLivelinessChecking:s4,setLivelynessChecking:uS,splitJsonPath:gc,t:T2,toGenerator:EE,toGeneratorFunction:SE,tryReference:xS,tryResolve:v4,typecheck:A4,types:T2,unescapeJsonPath:U4,unprotect:gS,walk:m4},Symbol.toStringTag,{value:"Module"})),eo=Xl(xO);var t1={},R2;function o_(){return R2||(R2=1,function(e){function i({oldText:t,newText:n,element:a}){if(!(n.length/Math.max(20,t.length)>=4))return a.fontSize;const l=a.width*a.page.computedHeight/n.length,s=1.5*Math.sqrt(l),c=a.fontSize;return Math.min(c,Math.max(5,Math.round(s)))}Object.defineProperty(e,"__esModule",{value:!0}),e.getLimitedFontSize=i}(t1)),t1}var M2;function a_(){return M2||(M2=1,function(e){var i=od&&od.__importDefault||function(z){return z&&z.__esModule?z:{default:z}};Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=e.getLineHeight=e.useFontLoader=void 0,e.isRTLText=T,e.getDir=j,e.usePrevious=X;const t=i(Tn()),n=Qi,a=Ja,l=yc,s=No,c=i(Ji()),d=lS,w=zd(),_=Ks(),E=Bd(),O=ts(),v=a4(),S=jp(),p=bc(),h=_c(),P=Xs(),g=eo,y=o_();c.default._fixTextRendering=!0;const b=document.createElement("style");b.type="text/css",document.head.appendChild(b);const x={border:"none",padding:"0px",overflow:"hidden",background:"none",outline:"none",resize:"none",overflowWrap:"break-word",whiteSpace:"pre-wrap",userSelect:"text",wordBreak:"normal"};function M(z){var N="֑-߿‏‫‮יִ-﷽ﹰ-ﻼ";return new RegExp("^[^"+N+"]*?["+N+"]").test(z)}function T(z){z=z.replace(/\s/g,"");let N=0;for(var U=0;U<z.length;U++)M(z[U])&&(N+=1);return N>z.length/2}function j(z){return T(z)?"rtl":"ltr"}const I=(0,n.observer)(({textNodeRef:z,element:N,onBlur:U,selectAll:$,cursorPosition:ee})=>{const[G,Z]=t.default.useState(x),W=z.current;t.default.useLayoutEffect(()=>{const se={};se.width=W.width()-2*W.padding()+"px",se.height=W.height()-2*W.padding()+W.fontSize()*W.lineHeight()+"px",se.fontSize=W.fontSize()+"px",se.lineHeight=W.lineHeight()+.01,se.fontFamily=W.fontFamily(),se.textAlign=W.align(),se.color=W.fill(),se.fontWeight=N.fontWeight,se.fontStyle=N.fontStyle,se.letterSpacing=N.letterSpacing+"em";const de=`
96
- .polotno-input::placeholder {
97
- color: ${G.color};
98
- opacity: 0.6;
99
- }
100
- `;b.innerHTML="",b.appendChild(document.createTextNode(de)),JSON.stringify(se)!==JSON.stringify(G)&&Z(se)});const te=t.default.useRef(null);t.default.useLayoutEffect(()=>{var se;const de=te.current;if(!de)return;(se=te.current)===null||se===void 0||se.focus();const he=ee||de.value.length;de.selectionStart=de.selectionEnd=he,$&&(de==null||de.select(),document.execCommand("selectAll",!1,null))},[]),t.default.useEffect(()=>{window.addEventListener("blur",U);const se=de=>{var he;!((he=te.current)===null||he===void 0)&&he.contains(de.target)||U()};return window.addEventListener("touchstart",se),()=>{window.removeEventListener("blur",U),window.removeEventListener("touchstart",se)}},[]);let re=0;const ie=W.textArr.length*W.lineHeight()*W.fontSize();N.verticalAlign==="middle"&&(re=(N.a.height-ie)/2),N.verticalAlign==="bottom"&&(re=N.a.height-ie);const ae=(0,v.removeTags)(N.text);return t.default.createElement("textarea",{className:"polotno-input",ref:te,dir:j(ae),style:Object.assign(Object.assign(Object.assign({},x),G),{paddingTop:re+"px"}),value:ae,onChange:se=>{const de=(0,y.getLimitedFontSize)({oldText:N.text,newText:se.target.value,element:N});N.set({text:se.target.value,fontSize:de})},placeholder:N.placeholder,onBlur:U})}),m=z=>t.default.createElement(l.Html,null,t.default.createElement(I,Object.assign({},z))),A=z=>{const[N,U]=t.default.useState(!1),$=t.default.useRef(!1);return t.default.useEffect(()=>{var ee=!0;return setTimeout(()=>{ee&&(z._editModeEnabled&&($.current=!0),U(!0),setTimeout(()=>{$.current=!1},50))},50),()=>{ee=!1}},[]),{editorEnabled:N&&z._editModeEnabled,selectAll:$.current}},L=(z,N)=>{const[U,$]=t.default.useReducer(G=>G+1,0),ee=t.default.useRef((0,E.isFontLoaded)(N));return t.default.useLayoutEffect(()=>{if(ee.current=(0,E.isFontLoaded)(N),ee.current)return;let G=!0;return(async()=>{ee.current=!1,$();const Z=(0,_.incrementLoader)(`text ${N}`);await z.loadFont(N),setTimeout(Z,100),G&&(ee.current=!0,$())})(),()=>{G=!1}},[N]),[ee.current]};e.useFontLoader=L;const k=({fontLoaded:z,fontFamily:N,fontSize:U,lineHeight:$})=>t.default.useMemo(()=>{if(typeof $=="number")return $;const ee=document.createElement("div");ee.style.fontFamily=N,ee.style.fontSize=U+"px",ee.style.lineHeight=$,ee.innerText="Test text",document.body.appendChild(ee);const G=ee.offsetHeight;return document.body.removeChild(ee),G/U},[z,N,U,$]);function R(z){var N=z.getAbsoluteTransform().copy();N.invert();var U=z.getStage().getPointerPosition();return N.point(U)}function B(z){var N;const U=z.target,$=R(U),ee=U.textArr,G=Math.floor($.y/(U.fontSize()*U.lineHeight())),Z=ee.slice(0,G).reduce((re,ie)=>re+ie.text.length,G),W=(N=ee[G])!==null&&N!==void 0?N:ee[0];let te=0;return U.align()==="right"?te=U.width()-W.width:U.align()==="center"&&(te=U.width()/2-W.width/2),Z+Math.round(($.x-te)/W.width*W.text.length)}function X(z){const N=t.default.useRef(z),U=t.default.useRef(z);return t.default.useMemo(()=>{U.current=N.current,N.current=z},[z]),U.current}function Y(z){return/[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF\uAC00-\uD7AF]/.test(z)}function Q(z,N,U=!1){const $=z.fontSize(),ee=z.height(),G=(0,v.removeTags)(N.text);let Z=N.a.fontSize;z.height(void 0);const W=Math.round(2*N.a.fontSize)-1;for(let te=1;te<W;te++){const re=N.a.height&&z.height()>N.a.height;let ie=G.split(`
101
- `).join(" ").split(/[\s-]+/).reduce((de,he)=>Y(he)?de.concat(he.split("")):de.concat(he),[]),ae=z.textArr.map(de=>de.text).join(";");const se=ie.find(de=>!ae.includes(de)||(ae=ae.replace(de,""),!1));if(!(re||se&&!U))break;Z-=.5,z.fontSize(Z)}return z.fontSize($),z.height(ee),Z}function q({lines:z,lineHeight:N,width:U,align:$="left",padding:ee=0,cornerRadius:G=0}){var Z;z.forEach((ie,ae)=>{ie.cx=U/2,$==="right"?ie.cx=U-ie.width/2:$==="left"&&(ie.cx=ie.width/2),$!=="justify"||ie.lastInParagraph||(ie.width=U),$==="justify"&&(ie.cx=ie.width/2)});let W=`M ${(Z=z[0])===null||Z===void 0?void 0:Z.cx} ${-ee}`;z.forEach((ie,ae)=>{const{cx:se}=ie,de=z[ae-1];de&&de.width>ie.width?W+=` L ${se+ie.width/2+ee} ${ae*N+ee}`:W+=` L ${se+ie.width/2+ee} ${ae*N-ee}`;const he=z[ae+1];he&&he.width>ie.width?W+=` L ${se+ie.width/2+ee} ${(ae+1)*N-ee}`:W+=` L ${se+ie.width/2+ee} ${(ae+1)*N+ee}`});for(var te=z.length-1;te>=0;te--){const ie=z[te],{cx:ae}=ie,se=z[te+1];se&&se.width>ie.width?W+=` L ${ae-ie.width/2-ee} ${(te+1)*N-ee}`:W+=` L ${ae-ie.width/2-ee} ${(te+1)*N+ee}`;const de=z[te-1];de&&de.width>ie.width?W+=` L ${ae-ie.width/2-ee} ${te*N+ee}`:W+=` L ${ae-ie.width/2-ee} ${te*N-ee}`}W+=" Z";const re=(0,d.parsePath)(W);return(0,d.roundCommands)(re,G).path}e.getLineHeight=k,e.TextElement=(0,n.observer)(({element:z,store:N})=>{const U=t.default.useRef(null),$=t.default.useRef(null),{editorEnabled:ee,selectAll:G}=A(z),[Z,W]=t.default.useState(!1),[te,re]=t.default.useState(!1),ie=t.default.useRef(z.a.height),ae=N.selectedShapes.indexOf(z)>=0,{textVerticalResizeEnabled:se}=O.flags,de=X(z.fontFamily),[he,Oe]=t.default.useState([]);t.default.useEffect(()=>{var Ke,ze;const Be=(ze=(Ke=U.current)===null||Ke===void 0?void 0:Ke.textArr)!==null&&ze!==void 0?ze:[];JSON.stringify(Be)!==JSON.stringify(he)&&Oe(Be)}),t.default.useEffect(()=>{if(z.a.width)return;const Ke=U.current;Ke.width(600),z.set({width:1.4*Ke.getTextWidth()})},[]),t.default.useLayoutEffect(()=>(0,s.autorun)(()=>{const Ke=U.current;(0,S.applyFilter)(Ke,z)}));const[_e]=(0,e.useFontLoader)(N,z.fontFamily),Ae=(0,v.removeTags)(z.text),ce=()=>{const Ke=U.current.clone({height:void 0}),ze=Math.ceil(Ke.fontSize()*Ke.lineHeight()*Ke.textArr.length+1);return Ke.destroy(),ze};t.default.useLayoutEffect(()=>{if(!_e)return;const{textOverflow:Ke,textSplitAllowed:ze}=O.flags;if(z.a.height){if(!N.isPlaying)if(Ke!=="change-font-size"||te){if(Ke==="resize"){const Be=ce();se&&z.a.height<Be&&N.history.ignore(()=>{var Ve;(0,g.isAlive)(z)&&z.set({height:Be}),(Ve=U.current)===null||Ve===void 0||Ve.height(Be)},!1,!0),se||z.a.height===Be||N.history.ignore(()=>{var Ve;(0,g.isAlive)(z)&&z.set({height:Be}),(Ve=U.current)===null||Ve===void 0||Ve.height(Be)},!1,!0)}}else{const Be=Q(U.current,z,ze);if(Be!==z.a.fontSize)return void N.history.ignore(()=>{z.set({fontSize:Be})},!1,!0);const Ve=ce();z.a.height===Ve||se||N.history.ignore(()=>{z.set({height:Ve})},!1,!0)}}else{const Be=ce();N.history.ignore(()=>{z.set({height:Be})},!1,!0)}}),t.default.useLayoutEffect(()=>{const Ke=U.current;Ke&&(Ke.width(Ke.width()+1e-8),Ke._setTextData(),(0,S.applyFilter)(Ke,z))},[_e]);const pe=t.default.useRef(null),Ce=t.default.useRef(0),Le=Ke=>{Ke.evt.preventDefault(),N.selectedShapes.find(Be=>Be===z)&&z.contentEditable&&(Ce.current=B(Ke),z.toggleEditMode())},ue=!Ae&&z.placeholder?.6:z.a.opacity;(0,p.useFadeIn)(U,ue);const ve=(0,e.getLineHeight)({fontLoaded:_e,fontFamily:z.fontFamily,fontSize:z.a.fontSize,lineHeight:z.lineHeight}),xe=z.selectable||N.role==="admin",je=(0,w.useColor)(z),at=t.default.useMemo(()=>z.backgroundEnabled?q({lines:JSON.parse(JSON.stringify(he)),cornerRadius:z.backgroundCornerRadius*(z.a.fontSize*ve*.5),lineHeight:ve*z.a.fontSize,padding:z.backgroundPadding*(z.a.fontSize*ve*.5),width:z.a.width,align:z.align}):"",[z.backgroundEnabled,z.backgroundCornerRadius,z.a.fontSize,ve,z.backgroundPadding,z.a.width,z.align,he]),ht=(0,P.isTouchDevice)();let et=0;return z.verticalAlign==="middle"?et=(z.a.height-he.length*ve*z.a.fontSize)/2:z.verticalAlign==="bottom"&&(et=z.a.height-he.length*ve*z.a.fontSize),t.default.createElement(t.default.Fragment,null,t.default.createElement(a.Path,{ref:$,x:z.a.x,y:z.a.y,rotation:z.a.rotation,hideInExport:!z.showInExport,listening:!1,visible:z.backgroundEnabled,opacity:z.backgroundOpacity*ue,data:at,fill:z.backgroundColor,offsetY:-et}),t.default.createElement(a.Text,Object.assign({ref:U,id:z.id,name:"element",hideInExport:!z.showInExport,editModeEnabled:z._editModeEnabled,x:z.a.x,y:z.a.y,rotation:z.a.rotation,width:z.a.width,height:z.a.height,text:Ae||z.placeholder,direction:j(Ae)},je,{stroke:z.stroke,lineJoin:"round",strokeWidth:z.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:z.a.fontSize,fontFamily:`"${z.fontFamily}", "${de}"`,fontStyle:z.fontStyle+" "+z.fontWeight,textDecoration:z.textDecoration,align:z.align,verticalAlign:z.verticalAlign,draggable:ht?z.draggable&&ae:z.draggable,preventDefault:!ht||ae,opacity:ue,visible:!z._editModeEnabled,ellipsis:O.flags.textOverflow==="ellipsis",shadowEnabled:z.shadowEnabled,shadowBlur:z.shadowBlur,shadowOffsetX:z.shadowOffsetX,shadowOffsetY:z.shadowOffsetY,shadowColor:z.shadowColor,shadowOpacity:z.shadowOpacity,lineHeight:ve,letterSpacing:z.letterSpacing*z.a.fontSize,listening:xe,onDragMove:Ke=>{z.set({x:Ke.target.x(),y:Ke.target.y()})},onDragEnd:Ke=>{z.set({x:Ke.target.x(),y:Ke.target.y()})},onMouseEnter:()=>{W(!0)},onMouseLeave:()=>{W(!1)},onClick:Le,onTap:Le,onTransformStart:()=>{re(!0),ie.current=U.current.height()},onTransform:Ke=>{var ze,Be;const Ve=Ke.target;(ze=$.current)===null||ze===void 0||ze.setAttrs({x:Ve.x(),y:Ve.y(),rotation:Ve.rotation(),scale:Ve.scale()});const bt=((Be=Ve.getStage())===null||Be===void 0?void 0:Be.findOne("Transformer")).getActiveAnchor();if(bt==="middle-left"||bt==="middle-right"){const Ct=Ve.scaleX(),we=Ve.width()*Ct,Se=z.a.fontSize;let gt=we;we<Se&&(gt=Se,pe.current&&Ve.position(pe.current)),Ve.width(gt),Ve.scaleX(1),Ve.scaleY(1);const wt=ce();if(O.flags.textOverflow!=="ellipsis"){const Pt=Math.max(wt,ie.current);Ve.height(Pt),z.set({height:Ve.height()})}z.set({x:Ve.x(),y:Ve.y(),width:Ve.width(),rotation:Ve.rotation()}),(0,S.applyFilter)(Ve,z)}if(bt==="top-center"||bt==="bottom-center"){let Ct=O.flags.textOverflow==="resize"?ce():ve*z.a.fontSize;Ke.target.height(Math.max(Ct,Ke.target.height()*Ke.target.scaleY())),Ke.target.scaleY(1)}pe.current=Ke.target.position()},onTransformEnd:Ke=>{var ze;const Be=Ke.target.scaleX();Ke.target.scaleX(1),Ke.target.scaleY(1),z.set({fontSize:Math.round(z.a.fontSize*Be),width:Math.ceil(Ke.target.width()*Be),x:Ke.target.x(),y:Ke.target.y(),rotation:Ke.target.rotation(),height:Ke.target.height()*Be,shadowBlur:z.shadowBlur*Be,shadowOffsetX:z.shadowOffsetX*Be,shadowOffsetY:z.shadowOffsetY*Be,strokeWidth:z.strokeWidth*Be}),(ze=$.current)===null||ze===void 0||ze.setAttrs({scaleX:1,scaleY:1}),re(!1)}})),ee&&t.default.createElement(a.Group,{x:z.a.x,y:z.a.y,rotation:z.a.rotation},t.default.createElement(m,{textNodeRef:U,element:z,selectAll:G,cursorPosition:Ce.current,onBlur:()=>{z.toggleEditMode(!1)}})),!te&&(Z||ae)&&t.default.createElement(h.Highlighter,{element:z}))})}(od)),od}var wo={},fd={},n1={exports:{}},r1={exports:{}},L2;function Rv(){return L2||(L2=1,function(e,i){e.exports=t;function t(a){return n.bind(null,a)}function n(a){var l=[].slice.call(arguments,1);l.unshift("["+a+"]"),process.stderr.write(l.join(" ")+`
102
- `)}}(r1)),r1.exports}var N2;function l_(){return N2||(N2=1,function(e,i){Rv()("lex"),e.exports=t;function t(n){var a="",l,s=0,c=-1,d=0,w=1,_="before-selector",E=[_],O={},v=[],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 p(){return j(),n[c]}function h(Y){return Y?E[E.length-1-Y]:_}function P(Y){var Q=c+1;return Y===n.slice(Q,Q+Y.length)}function g(Y){var Q=n.slice(c).indexOf(Y);return Q>0?Q:!1}function y(Y){return Y===b(1)}function b(Y){return n[c+(Y||1)]}function x(){var Y=E.pop();return _=E[E.length-1],Y}function M(Y){return _=Y,E.push(_),E.length}function T(Y){var Q=_;return E[E.length-1]=_=Y,Q}function j(Y){if((Y||1)==1)n[c]==`
103
- `?(w++,s=1):s++,c++;else{var Q=n.slice(c,c+Y).split(`
104
- `);Q.length>1&&(w+=Q.length-1,s=1),s+=Q[Q.length-1].length,c=c+Y}}function I(){O.end={line:w,col:s},v.push(O),a="",O={}}function m(Y){O={type:Y,start:{line:w,col:s}}}for(;l=p();)switch(l){case" ":switch(h()){case"selector":case"value":case"value-paren":case"at-group":case"at-value":case"comment":case"double-string":case"single-string":a+=l;break}break;case`
105
- `:case" ":case"\r":case"\f":switch(h()){case"value":case"value-paren":case"at-group":case"comment":case"single-string":case"double-string":case"selector":a+=l;break;case"at-value":l===`
106
- `&&(O.value=a.trim(),I(),x());break}break;case":":switch(h()){case"name":O.name=a.trim(),a="",T("before-value");break;case"before-selector":a+=l,m("selector"),M("selector");break;case"before-value":T("value"),a+=l;break;default:a+=l;break}break;case";":switch(h()){case"name":case"before-value":case"value":a.trim().length>0&&(O.value=a.trim(),I()),T("before-name");break;case"value-paren":a+=l;break;case"at-value":O.value=a.trim(),I(),x();break;case"before-name":break;default:a+=l;break}break;case"{":switch(h()){case"selector":if(b(-1)==="\\"){a+=l;break}O.text=a.trim(),I(),T("before-name"),d=d+1;break;case"at-group":switch(O.name=a.trim(),O.type){case"font-face":case"viewport":case"page":M("before-name");break;default:M("before-selector")}I(),d=d+1;break;case"name":case"at-rule":O.name=a.trim(),I(),M("before-name"),d=d+1;break;case"comment":case"double-string":case"single-string":a+=l;break;case"before-value":T("value"),a+=l;break}break;case"}":switch(h()){case"before-name":case"name":case"before-value":case"value":a&&(O.value=a.trim()),O.name&&O.value&&I(),m("end"),I(),x(),h()==="at-group"&&(m("at-group-end"),I(),x()),d>0&&(d=d-1);break;case"at-group":case"before-selector":case"selector":if(b(-1)==="\\"){a+=l;break}d>0&&h(1)==="at-group"&&(m("at-group-end"),I()),d>1&&x(),d>0&&(d=d-1);break;case"double-string":case"single-string":case"comment":a+=l;break}break;case'"':case"'":switch(h()){case"double-string":l==='"'&&b(-1)!=="\\"&&x();break;case"single-string":l==="'"&&b(-1)!=="\\"&&x();break;case"before-at-value":T("at-value"),M(l==='"'?"double-string":"single-string");break;case"before-value":T("value"),M(l==='"'?"double-string":"single-string");break;case"comment":break;default:b(-1)!=="\\"&&M(l==='"'?"double-string":"single-string")}a+=l;break;case"/":switch(h()){case"comment":case"double-string":case"single-string":a+=l;break;case"before-value":case"selector":case"name":case"value":if(y("*")){var A=g("*/");A&&j(A+1)}else h()=="before-value"&&T("value"),a+=l;break;default:y("*")?(m("comment"),M("comment"),j()):a+=l;break}break;case"*":switch(h()){case"comment":y("/")?(O.text=a,j(),I(),x()):a+=l;break;case"before-selector":a+=l,m("selector"),M("selector");break;case"before-value":T("value"),a+=l;break;default:a+=l}break;case"@":switch(h()){case"comment":case"double-string":case"single-string":a+=l;break;case"before-value":T("value"),a+=l;break;default:for(var L=!1,k,R,B=0,X=S.length;!L&&B<X;++B)R=S[B],k=R.name||R,P(k)&&(L=!0,m(k),M(R.state||"at-group"),j(k.length),R.prefix&&(O.prefix=R.prefix),R.type&&(O.type=R.type));L||(a+=l);break}break;case"(":switch(h()){case"value":M("value-paren");break;case"before-value":T("value");break}a+=l;break;case")":switch(h()){case"value-paren":x();break;case"before-value":T("value");break}a+=l;break;default:switch(h()){case"before-selector":m("selector"),M("selector");break;case"before-name":m("property"),T("name");break;case"before-value":T("value");break;case"before-at-value":T("at-value");break}a+=l;break}return v}}(n1)),n1.exports}var i1={exports:{}},I2;function PO(){return I2||(I2=1,function(e,i){Rv()("parse");var t=l_();e.exports=c;var n,a,l,s;function c(x,M){M||(M={}),n=!!M.comments,l=!!M.position,a=0,s=Array.isArray(x)?x.slice():t(x);for(var T,j=[],I;I=w();)T=P(I),T&&j.push(T);return{type:"stylesheet",stylesheet:{rules:j}}}function d(x,M){M||(M={});for(var T,j=["type","name","value"],I={},m=0;m<j.length;++m)T=j[m],x[T]&&(I[T]=M[T]||x[T]);for(j=Object.keys(M),m=0;m<j.length;++m)T=j[m],I[T]||(I[T]=M[T]);return l&&(I.position={start:x.start,end:x.end}),I}function w(){var x=s.shift();return x}function _(x){a=a+1;var M={};switch(x.type){case"font-face":case"viewport":M.declarations=y();break;case"page":M.prefix=x.prefix,M.declarations=y();break;default:M.prefix=x.prefix,M.rules=b()}return d(x,M)}function E(x){return d(x)}function O(x){return d(x)}function v(x){return d(x,{text:x.text})}function S(x){return d(x)}function p(x){return d(x)}function h(x){function M(T){return T.trim()}return d(x,{type:"rule",selectors:x.text.split(",").map(M),declarations:y()})}function P(x){switch(x.type){case"property":return p(x);case"selector":return h(x);case"at-group-end":a=a-1;return;case"media":case"keyframes":return _(x);case"comment":if(n)return v(x);break;case"charset":return O(x);case"import":return E(x);case"namespace":return S(x);case"font-face":case"supports":case"viewport":case"document":case"page":return _(x)}}function g(x){for(var M,T=[],j;(j=w())&&x&&x(j);)M=P(j),M&&T.push(M);return j&&j.type!=="end"&&s.unshift(j),T}function y(){return g(function(x){return x.type==="property"||x.type==="comment"})}function b(){return g(function(){return a})}}(i1)),i1.exports}var o1={exports:{}},D2;function CO(){return D2||(D2=1,function(e,i){Rv()("stringify");var t,n,a,l,s,c;e.exports=d;function d(b,x){x||(x={}),a=x.indentation||"",n=!!x.compress,t=!!x.comments,l=1,n?s=c="":(s=`
107
- `,c=" ");var M=S(b.stylesheet.rules,g).join(`
108
- `).trim();return M}function w(b){if(b){l+=b;return}return n?"":Array(l).join(a||"")}function _(b){return"@"+b.type+" "+b.value+";"+s}function E(b){var x="",M=b.prefix||"";b.name&&(x=" "+b.name);var T=b.type!=="page";return"@"+M+b.type+x+c+p(b,T)+s}function O(b){return t?"/*"+(b.text||"")+"*/"+s:""}function v(b){var x;return b.selectors?x=b.selectors.join(","+s):(x="@"+b.type,x+=b.name?" "+b.name:""),w()+x+c+p(b)+s}function S(b,x){return b.reduce(function(M,T){var j=T.type==="comment"?O(T):x(T);return j&&M.push(j),M},[])}function p(b,x){var M=b.declarations,T=P;return b.rules&&(M=b.rules,T=v),M=h(M,T),M&&(M=s+M+(x?"":s)),"{"+M+w()+"}"}function h(b,x){if(!b)return"";w(1);var M=S(b,x);return w(-1),M.length?M.join(s):""}function P(b){if(b.type==="property")return y(b)}function g(b){switch(b.type){case"rule":return v(b);case"media":case"keyframes":return E(b);case"comment":return O(b);case"import":case"charset":case"namespace":return _(b);case"font-face":case"supports":case"viewport":case"document":case"page":return E(b)}}function y(b){var x=b.name?b.name+":"+c:"";return w()+x+b.value+";"}}(o1)),o1.exports}var a1,j2;function kO(){return j2||(j2=1,a1={lex:l_(),parse:PO(),stringify:CO()}),a1}var F2;function qd(){return F2||(F2=1,function(e){var i=fd&&fd.__importDefault||function(x){return x&&x.__esModule?x:{default:x}};Object.defineProperty(e,"__esModule",{value:!0}),e.useSvgColors=e.sameColors=void 0,e.urlToBase64=E,e.urlToString=O,e.getColors=v,e.svgToURL=S,e.getSvgSize=p,e.fixSize=h,e.replaceColors=y;const t=i(Ji()),n=i(Tn()),a=_v(),l=i(kO());function s(x){for(;x.parentNode;){if(x.nodeName==="defs")return!0;x=x.parentNode}return!1}function c(x){const M={};return x.querySelectorAll("style").forEach(T=>{const j=l.default.parse(T.textContent).stylesheet.rules;for(let I of j)I.selectors&&I.selectors.forEach(m=>{const A=M[m]||{};I.declarations.forEach(L=>{A[L.name]=L.value}),M[m]=A})}),M}function d(x,M){var T;const j={fill:"",stroke:""},I=((T=x.getAttribute("class"))===null||T===void 0?void 0:T.split(" "))||[],m=x.getAttribute("id");let A={};if(m&&M[`#${m}`]?A=M[`#${m}`]:I.forEach(L=>{M[`.${L}`]&&(A=Object.assign(Object.assign({},A),M[`.${L}`]))}),M[x.nodeName]&&(A=Object.assign(Object.assign({},A),M[x.nodeName])),x.getAttribute("fill")&&x.getAttribute("fill")!=="none"?j.fill=x.getAttribute("fill"):A.fill&&A.fill!=="none"&&(j.fill=A.fill),x.getAttribute("stroke")&&x.getAttribute("stroke")!=="none"?j.stroke=x.getAttribute("stroke"):A.stroke&&A.stroke!=="none"&&(j.stroke=A.stroke),!j.fill&&x.style.fill&&x.style.fill!=="none"&&(j.fill=x.style.fill),!j.stroke&&x.style.stroke&&x.style.stroke!=="none"&&(j.stroke=x.style.stroke),!j.stroke&&!j.fill){const L=x.ownerSVGElement,k=L&&L!==x&&d(L,M);(k==null?void 0:k.fill)==="currentColor"||(k==null?void 0:k.stroke)==="currentColor"||(j.fill="black")}return j}const w=["path","rect","circle","line","polygon","polyline","ellipse","text"];function _(x){for(var M=[],T=x.getElementsByTagName("*"),j=0,I=T.length;j<I;j++){const m=T[j];s(m)||(m.getAttribute("fill")!==null&&M.push(m),(m.getAttribute("stroke")!==null||m.style&&m.style.fill||w.indexOf(m.nodeName)>=0)&&M.push(m))}return M}async function E(x){const M=await fetch(x);return S(await M.text())}async function O(x){return await(await fetch(x,{mode:"cors"})).text()}function v(x){var M=new DOMParser().parseFromString(x,"image/svg+xml");const T=c(M),j=_(M),I=[];return j.forEach(m=>{const{fill:A,stroke:L}=d(m,T);[A,L].forEach(k=>{k&&(k==="currentColor"&&(k="black"),t.default.Util.colorToRGBA(k)&&I.indexOf(k)===-1&&I.push(k))})}),I}function S(x){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(x)))}async function p(x){const M=await O(x),T=new DOMParser().parseFromString(M,"image/svg+xml").documentElement.getAttribute("viewBox"),[j,I,m,A]=(T==null?void 0:T.split(" "))||[];return{width:parseFloat(m),height:parseFloat(A)}}function h(x){var M=new DOMParser().parseFromString(x,"image/svg+xml");const T=M.documentElement.getAttribute("viewBox"),[j,I,m,A]=(T==null?void 0:T.split(" "))||[],L=M.documentElement.getAttribute("width");!L&&M.documentElement.setAttribute("width",m+"px");const k=M.documentElement.getAttribute("height");if((!k||k.indexOf("%")>=0)&&M.documentElement.setAttribute("height",A+"px"),L&&L.indexOf("%")>=0&&k&&k.indexOf("%")===-1){const R=parseFloat(k)/parseFloat(A);M.documentElement.setAttribute("width",R*parseFloat(m)+"px")}if(k&&k.indexOf("%")>=0&&L&&L.indexOf("%")===-1){const R=parseFloat(L)/parseFloat(m);M.documentElement.setAttribute("height",R*parseFloat(A)+"px")}return L==="100%"&&k==="100%"&&(M.documentElement.setAttribute("width",m+"px"),M.documentElement.setAttribute("height",A+"px")),new XMLSerializer().serializeToString(M)}const P=(x,M)=>{if(!x||!M)return!1;if(M==="currentColor"&&x==="black")return!0;const T=t.default.Util.colorToRGBA(x),j=t.default.Util.colorToRGBA(M);return T&&j?T.r===j.r&&T.g===j.g&&T.b===j.b&&T.a===j.a:void 0};function g(x,M,T,j){var I=x.namespaceURI,m=document.createElementNS(I,"linearGradient");const A=t.default.Util.degToRad(T+90),L=(Math.cos(A)+1)/2,k=(Math.sin(A)+1)/2,R=(Math.cos(A+Math.PI)+1)/2,B=(Math.sin(A+Math.PI)+1)/2;m.setAttribute("x1",100*L+"%"),m.setAttribute("y1",100*k+"%"),m.setAttribute("x2",100*R+"%"),m.setAttribute("y2",100*B+"%"),m.setAttribute("gradientUnits","userSpaceOnUse"),m.setAttribute("id",M);for(var X=0;X<j.length;X++){var Y=j[X],Q=document.createElementNS(I,"stop");for(var q in Y)Y.hasOwnProperty(q)&&Q.setAttribute(q,Y[q]);m.appendChild(Q)}return(x.querySelector("defs")||x.insertBefore(document.createElementNS(I,"defs"),x.firstChild)).appendChild(m)}function y(x,M){var T=new DOMParser().parseFromString(x,"image/svg+xml");const j=_(T),I=Array.from(M.keys()),m=c(T);return j.forEach(A=>{const{fill:L,stroke:k}=d(A,m);[{prop:"fill",color:L},{prop:"stroke",color:k}].forEach(({prop:R,color:B})=>{const X=I.find(Y=>(0,e.sameColors)(Y,B));if(X){const Y=M.get(X);if((0,a.isGradient)(Y)){const{rotation:Q,stops:q}=(0,a.parseColor)(Y),z=q.map(U=>({offset:100*U.offset+"%","stop-color":U.color})),N="color"+Math.round(1e8*Math.random());g(T.children[0],N,Q,z),A.style[R]=null,A.setAttribute(R,`url('#${N}')`)}else A.style[R]=M.get(X)}})}),S(new XMLSerializer().serializeToString(T))}e.sameColors=P;const b=x=>{const[M,T]=n.default.useState([]);return n.default.useEffect(()=>{let j=!1;return(async()=>{T([]);const I=v(await O(x));j||T(I)})(),()=>{j=!0}},[x]),M};e.useSvgColors=b}(fd)),fd}var l1={},z2;function s_(){return z2||(z2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.trySetCanvasSize=void 0;const i=(t,n,a)=>{let l=n,s=a,c=1;for(;l>0&&s>0;){t.width=l,t.height=s;const d=t.getContext("2d");if(!d)return;if(d.fillStyle="rgba(0,0,0,0.1)",d.fillRect(0,0,1,1),d.getImageData(0,0,1,1).data[3]!==0)return void d.clearRect(0,0,t.width,t.height);if(c*=.9,l=Math.floor(n*c),s=Math.floor(a*c),l=Math.max(l,1),s=Math.max(s,1),l<=1&&s<=1)return t.width=1,void(t.height=1)}};e.trySetCanvasSize=i}(l1)),l1}var B2;function u_(){return B2||(B2=1,function(e){var i=wo&&wo.__createBinding||(Object.create?function(G,Z,W,te){te===void 0&&(te=W);var re=Object.getOwnPropertyDescriptor(Z,W);re&&!("get"in re?!Z.__esModule:re.writable||re.configurable)||(re={enumerable:!0,get:function(){return Z[W]}}),Object.defineProperty(G,te,re)}:function(G,Z,W,te){te===void 0&&(te=W),G[te]=Z[W]}),t=wo&&wo.__setModuleDefault||(Object.create?function(G,Z){Object.defineProperty(G,"default",{enumerable:!0,value:Z})}:function(G,Z){G.default=Z}),n=wo&&wo.__importStar||function(){var G=function(Z){return G=Object.getOwnPropertyNames||function(W){var te=[];for(var re in W)Object.prototype.hasOwnProperty.call(W,re)&&(te[te.length]=re);return te},G(Z)};return function(Z){if(Z&&Z.__esModule)return Z;var W={};if(Z!=null)for(var te=G(Z),re=0;re<te.length;re++)te[re]!=="default"&&i(W,Z,te[re]);return t(W,Z),W}}(),a=wo&&wo.__importDefault||function(G){return G&&G.__esModule?G:{default:G}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=e.useImageLoader=e.setImageLoaderHook=e.useSizeFixer=void 0;const l=a(Tn()),s=Qi,c=No,d=Ja,w=a(Dp()),_=a(Ji()),E=yc,O=_c(),v=Ks(),S=n(qd()),p=ts(),h=s_(),P=jp(),g=bc(),y=Xs();function b(){return document.createElement("canvas")}async function x(G){if(!(G.indexOf("data:image/svg+xml")>=0||G.indexOf(".svg")>=0))return G;const Z=await S.urlToString(G),W=S.fixSize(Z);return S.svgToURL(W)}const M=G=>{const[Z,W]=l.default.useState(G);return l.default.useEffect(()=>{(async()=>{const te=await x(G);te!==Z&&W(te)})()},[G]),Z};function T(G,Z){return Math.sqrt(Math.pow(Z.x-G.x,2)+Math.pow(Z.y-G.y,2))}function j(G,Z){return{x:(G.x+Z.x)/2,y:(G.y+Z.y)/2}}e.useSizeFixer=M;const I=(G,Z,W)=>{const te=l.default.useMemo(()=>{var re,ie;const{flipX:ae,flipY:se}=G,de=G.type==="svg"||G.src.indexOf("data:image/svg+xml")>=0||G.src.indexOf(".svg")>=0,he=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,Oe=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||he)&&de||G.maskSrc;if(!ae&&!se&&!Oe)return Z;if(!Z||!Z.width||!Z.height)return null;const _e=b();let Ae=1;G.type==="svg"&&(Ae=Math.max(G.a.width/Z.width*W,G.a.height/Z.height*W)),(0,h.trySetCanvasSize)(_e,Math.max(Z.width*Ae,1),Math.max(Z.height*Ae,1));let ce=ae?-_e.width:0,pe=se?-_e.height:0;return(re=_e.getContext("2d"))===null||re===void 0||re.scale(ae?-1:1,se?-1:1),(ie=_e.getContext("2d"))===null||ie===void 0||ie.drawImage(Z,ce,pe,_e.width,_e.height),_e},[G.maskSrc,G.flipX,G.flipY,Z,G.a.width,G.a.height,W]);return l.default.useEffect(()=>()=>{te&&te.nodeName==="CANVAS"&&_.default.Util.releaseCanvas(te)},[te]),te};function m(G,Z){const W=Z.width/Z.height;let te,re;return W>=G.width/G.height?(te=G.width,re=G.width/W):(te=G.height*W,re=G.height),{x:(G.width-te)/2,y:(G.height-re)/2,width:te,height:re}}function A(G,Z,W,te,re,ie,ae){for(var se=new ImageData(Z,W),de=new Int32Array(G.data.buffer),he=G.width,Oe=new Int32Array(se.data.buffer),_e=se.width,Ae=Z/ie,ce=W/ae,pe=Math.round(1/Ae),Ce=Math.round(1/ce),Le=pe*Ce,ue=0;ue<se.height;ue++)for(var ve=0;ve<_e;ve++){for(var xe=te+Math.round(ve/Ae)+(re+Math.round(ue/ce))*he,je=0,at=0,ht=0,et=0,Ke=0;Ke<Ce;Ke++)for(var ze=0;ze<pe;ze++){var Be=de[xe+ze+Ke*he];je+=Be<<24>>>24,at+=Be<<16>>>24,ht+=Be<<8>>>24,et+=Be>>>24}je=Math.round(je/Le),at=Math.round(at/Le),ht=Math.round(ht/Le),et=Math.round(et/Le),Oe[ve+ue*_e]=et<<24|ht<<16|at<<8|je}return se}function L(G,Z){var W,te;const re=b();re.width=G.width,re.height=G.height;const ie=Math.max(1,Math.floor(re.width*Z)),ae=Math.max(1,Math.floor(re.height*Z));(W=re.getContext("2d"))===null||W===void 0||W.drawImage(G,0,0,re.width,re.height);const se=A(re.getContext("2d").getImageData(0,0,re.width,re.height),ie,ae,0,0,re.width,re.height);return re.width=ie,re.height=ae,(te=re.getContext("2d"))===null||te===void 0||te.putImageData(se,0,0),re}const k=(G,Z)=>{const[W,te]=z(G.maskSrc,"anonymous"),re=G.maskSrc?te:"loaded";return(0,e.useImageLoader)(re,G.maskSrc||"",G.id),l.default.useMemo(()=>{if(!W||!Z||!Z.width||!Z.height)return Z;const ie=b();ie.width=Math.max(Z.width,1),ie.height=Math.max(Z.height,1);const ae=ie.getContext("2d");if(!ae)return Z;ae.drawImage(Z,0,0),ae.globalCompositeOperation="source-in";const se=m(W,G);return ae.drawImage(W,se.x,se.y,se.width,se.height,0,0,Z.width,Z.height),ie},[Z,W,G.a.width,G.a.height])},R=(G,Z,W)=>Math.max(Z,Math.min(W,G)),B=(G,Z,W,te,re=0,ie=!1,ae=!0)=>{const se=Math.floor(R(G.a.width*te,1,1e4)),de=Math.floor(R(G.a.height*te,1,1e4)),he=Math.min(re*te,se/2,de/2),Oe=Math.max(G.a.width/W.width,G.a.height/W.height)*te,_e=G.page._exportingOrRendering&&p.flags.imageDownScalingEnabled&&Oe<1&&!ie,Ae=W.x===0&&W.y===0&&W.width===(Z==null?void 0:Z.width)&&W.height===(Z==null?void 0:Z.height),ce=l.default.useMemo(()=>{if(!(!Z||!Z.width||!Z.height))return Ae&&he===0&&!_e?void 0:b()},[Z,he,_e,Ae]);return l.default.useLayoutEffect(()=>{if(!ce||!Z)return;(0,h.trySetCanvasSize)(ce,se,de);const pe=ce.getContext("2d");if(!pe)return;he&&(pe.beginPath(),pe.moveTo(he,0),pe.lineTo(se-he,0),pe.arc(se-he,he,he,3*Math.PI/2,0,!1),pe.lineTo(se,de-he),pe.arc(se-he,de-he,he,0,Math.PI/2,!1),pe.lineTo(he,de),pe.arc(he,de-he,he,Math.PI/2,Math.PI,!1),pe.lineTo(0,he),pe.arc(he,he,he,Math.PI,3*Math.PI/2,!1),pe.clip());const Ce=_e?L(Z,Oe):Z,Le=_e?{x:Math.floor(W.x*Oe),y:Math.floor(W.y*Oe),width:Math.floor(W.width*Oe),height:Math.floor(W.height*Oe)}:W;pe.drawImage(Ce,Le.x,Le.y,Le.width,Le.height,0,0,ce.width,ce.height)},[ce,G.a.width,G.a.height,W.x,W.y,W.width,W.height,re,te,ie,G.page._exportingOrRendering,_e]),l.default.useEffect(()=>()=>{ce&&ce.nodeName==="CANVAS"&&_.default.Util.releaseCanvas(ce)},[ce]),ce||Z},X=(G,Z,W,te)=>{const re=(0,e.useSizeFixer)(G.clipSrc||""),[ie,ae]=z(re,"anonymous"),se=G.clipSrc?ae:"loaded";(0,e.useImageLoader)(se,G.clipSrc,G.id);const de=l.default.useMemo(()=>{if(Z&&ie)return b()},[Z,ie]);return l.default.useLayoutEffect(()=>{var he;if(!ie||!Z||!Z.width||!Z.height||!ie||!ie.width||!ie.height||!de)return;const Oe=b(),_e=Math.max(G.a.width/ie.width*W,G.a.height/ie.height*W);Oe.width=ie.width*_e,Oe.height=ie.height*_e,(he=Oe.getContext("2d"))===null||he===void 0||he.drawImage(ie,0,0,Oe.width,Oe.height),de.width=Math.max(Z.width,1),de.height=Math.max(Z.height,1);const Ae=de.getContext("2d");Ae&&(Ae.save(),Ae.drawImage(Oe,0,0,Z.width,Z.height),_.default.Util.releaseCanvas(Oe),Ae.globalCompositeOperation="source-in",Ae.drawImage(Z,0,0,de.width,de.height),Ae.restore())},[de,Z,ie,G.a.width,G.a.height,W,...te]),G.clipSrc&&ie?de:Z},Y=b(),Q=(0,s.observer)(({element:G})=>{const Z=Math.min(30,G.a.width/4,G.a.height/4),W=l.default.useRef(null);return l.default.useEffect(()=>{const te=W.current;if(!te)return;const re=new _.default.Animation(ie=>{te.rotate(((ie==null?void 0:ie.timeDiff)||0)/2)},te.getLayer());return re.start(),()=>{re.stop()}}),l.default.createElement(d.Group,{x:G.x,y:G.y,rotation:G.rotation,listening:!1,opacity:G.a.opacity,hideInExport:!G.showInExport},l.default.createElement(d.Rect,{width:G.a.width,height:G.a.height,fill:"rgba(124, 173, 212, 0.8)"}),l.default.createElement(d.Arc,{ref:W,x:G.a.width/2,y:G.a.height/2,fill:"white",outerRadius:Math.abs(Z),innerRadius:Math.max(1,Z-5),angle:270}))}),q=(0,s.observer)(({element:G})=>{const Z="Can not load the image...",W=Math.max(10,Math.min(30,G.a.width/25));return l.default.createElement(d.Group,{x:G.x,y:G.y,rotation:G.rotation,listening:!1,opacity:G.a.opacity,hideInExport:!G.showInExport},l.default.createElement(d.Rect,{width:G.a.width,height:G.a.height,fill:"rgba(223, 102, 102, 0.8)"}),l.default.createElement(d.Text,{text:Z,fontSize:W,width:G.a.width,height:G.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let z=w.default;const N=G=>{z=G};e.setImageLoaderHook=N;const U=(G,Z="",W="")=>{const te=l.default.useRef(),re=()=>{var ie;(ie=te.current)===null||ie===void 0||ie.call(te),te.current=void 0};l.default.useEffect(()=>re,[]),l.default.useLayoutEffect(()=>{const ie=Z.slice(0,200),ae=`image with id ${W} url: ${ie}`;G!=="loading"||te.current||(te.current=(0,v.incrementLoader)(ae)),G!=="loading"&&re(),G==="failed"&&(0,v.triggerLoadError)(ae)},[G])};e.useImageLoader=U;const $=({image:G,status:Z,type:W})=>{const te=l.default.useRef();return l.default.useEffect(()=>{te.current=G||te.current},[G]),Z!=="failed"||Z!=="failed"&&W==="svg"?te.current:void 0},ee=G=>{const[Z,W]=l.default.useReducer(ae=>ae+1,0),te=l.default.useRef("loading"),re=l.default.useRef(G.src),ie=l.default.useRef(G.src);return ie.current!==G.src&&(ie.current=G.src,te.current="loading"),l.default.useEffect(()=>{if(G.type!=="svg"||!G.src)return;let ae=!1;return(async()=>{te.current="loading",W();const se=await S.urlToString(G.src),de=S.fixSize(se),he=S.replaceColors(de,G.colorsReplace);ae||(re.current=he,te.current="loaded",W())})(),()=>{ae=!0}},[G.src,JSON.stringify(G.colorsReplace)]),G.type!=="svg"?[G.src,"loaded"]:[re.current,te.current]};e.ImageElement=(0,s.observer)(({element:G,store:Z})=>{var W;const[te,re]=l.default.useState(!1),ie=l.default.useRef(null),ae=l.default.useRef(null),[se,de]=l.default.useState(!1),he=Z.selectedShapes.indexOf(G)>=0,[Oe,_e]=ee(G),[Ae,ce]=z(Oe,"anonymous"),pe=G.type!=="svg"||_e==="loaded"?ce:"loading";(0,e.useImageLoader)(pe,G.src,G.id);const Ce=G.page._exportingOrRendering?1:Math.max(1,Z.scale),Le=Z._elementsPixelRatio*Ce,ue=$({image:Ae,status:ce,type:G.type}),ve=I(G,Ae||ue,Le),xe=k(G,ve)||Y;let{cropX:je,cropY:at,cropWidth:ht,cropHeight:et}=G;ce!=="loaded"&&(je=at=0,ht=et=1);const Ke=xe.width*ht,ze=xe.height*et,Be=G.a.width/G.a.height;let Ve,bt;const Ct=Ke/ze,we=G.type==="svg";we?(Ve=Ke,bt=ze):Be>=Ct?(Ve=Ke,bt=Ke/Be):(Ve=ze*Be,bt=ze);const Se={x:xe.width*je,y:xe.height*at,width:Ve,height:bt},gt=(W=G.cornerRadius)!==null&&W!==void 0?W:0,wt=G.page._exportingOrRendering?1:Math.min(2,Z.scale),Pt=Z._elementsPixelRatio*wt;let vt=X(G,B(G,xe,Se,Pt,gt,te||G._cropModeEnabled||G.type==="svg",!0),Pt,[Se,gt,Pt]);const Wt=Math.max(G.a.width/Ve,G.a.height/bt);l.default.useEffect(()=>{var Ze;if(!G._cropModeEnabled)return;const Et=(Ze=ie.current)===null||Ze===void 0?void 0:Ze.getStage();function Lt(Vt){G._cropModeEnabled&&Vt.target!==ae.current&&G.toggleCropMode(!1)}function Gt(Vt){G._cropModeEnabled&&Vt.target.parentNode!==Et.content&&G.toggleCropMode(!1)}return document.body.addEventListener("click",Gt),Et==null||Et.on("click",Lt),Et==null||Et.on("tap",Lt),()=>{document.body.removeEventListener("click",Gt),document.body.removeEventListener("touchstart",Gt),Et==null||Et.off("click",Lt),Et==null||Et.off("click",Lt)}},[G._cropModeEnabled]),l.default.useLayoutEffect(()=>{if(!(te||G._cropModeEnabled))return(0,P.applyFilter)(ie.current,G),(0,c.autorun)(()=>{(0,P.applyFilter)(ie.current,G)},{delay:100})},[vt,G.page._exportingOrRendering,te,ht,et,G._cropModeEnabled]),l.default.useLayoutEffect(()=>{var Ze;te||G._cropModeEnabled?(Ze=ie.current)===null||Ze===void 0||Ze.clearCache():(0,P.applyFilter)(ie.current,G)},[te,G.a.width,G.a.height,G._cropModeEnabled]),l.default.useEffect(()=>{(0,P.applyFilter)(ie.current,G)},[G.shadowEnabled,G.shadowBlur,G.cornerRadius,G.shadowColor,G.shadowOffsetX,G.shadowOffsetY,G.shadowOpacity]);const pn=l.default.useRef(null),Fe=l.default.useRef(null),rt=l.default.useRef(null);l.default.useLayoutEffect(()=>{G._cropModeEnabled&&(Fe.current.nodes([pn.current]),rt.current.nodes([ae.current]))},[G._cropModeEnabled]);var ft=l.default.useRef(null),De=l.default.useRef(0),Ie=l.default.useRef(!1);const Me=Ze=>{var Et;((Et=Ze.evt.touches)===null||Et===void 0?void 0:Et.length)>2&&Ze.target.stopDrag(),Math.round(Ze.target.x())>0&&(Ze.target.x(0),Ze.target.scaleX(1)),Math.round(Ze.target.y())>0&&(Ze.target.y(0),Ze.target.scaleY(1));const Lt=Ze.target.width()*Ze.target.scaleX(),Gt=Ze.target.height()*Ze.target.scaleY(),Vt=Math.min(1,Ve/Lt),Jn=Math.min(1,bt/Gt),Gn=1-Vt,En=Math.min(Gn,Math.max(0,Math.round(-Ze.target.x())/Lt)),oi=1-Jn,Ir=Math.min(oi,Math.max(0,Math.round(-Ze.target.y())/Gt));Ze.target.setAttrs({x:-En*xe.width,y:-Ir*xe.height,scaleX:1,scaleY:1}),G.set({cropX:En,cropY:Ir,cropWidth:Vt,cropHeight:Jn})},Ye=()=>{G.type!=="svg"&&G.contentEditable&&setTimeout(()=>{G.toggleCropMode(!0)})},Mt=G.type==="svg"&&ue,_t=ce==="loading"&&!Mt,Yt=ce==="failed",wn=!_t&&!Yt,Sn=l.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Qn=wn?G.a.opacity:0;(0,g.useFadeIn)(ie,Qn);const ii=G.selectable||Z.role==="admin",Sr=(0,y.isTouchDevice)();return l.default.createElement(l.default.Fragment,null,_t&&l.default.createElement(Q,{element:G}),Yt&&l.default.createElement(q,{element:G}),l.default.createElement(d.Image,{ref:ie,name:"element",id:G.id,image:vt,x:G.a.x,y:G.a.y,width:G.a.width||1,height:G.a.height||1,rotation:G.a.rotation,opacity:Qn,shadowEnabled:G.shadowEnabled,shadowBlur:G.shadowBlur,shadowOffsetX:G.shadowOffsetX,shadowOffsetY:G.shadowOffsetY,shadowColor:G.shadowColor,shadowOpacity:G.shadowOpacity,customCrop:Se,listening:ii,draggable:Sr?G.draggable&&he:G.draggable,preventDefault:!Sr||he,hideInExport:!G.showInExport,onMouseEnter:()=>{de(!0)},onMouseLeave:()=>{de(!1)},onDragMove:Ze=>{G.set({x:Ze.target.x(),y:Ze.target.y()})},onDragEnd:Ze=>{G.set({x:Ze.target.x(),y:Ze.target.y()})},onDblClick:Ye,onDblTap:Ye,onTransformStart:()=>{re(!0),Sn.current={cropX:G.cropX,cropY:G.cropY,cropWidth:G.cropWidth,cropHeight:G.cropHeight}},onTransform:Ze=>{var Et;const Lt=Ze.currentTarget,Gt=Math.abs(Lt.scaleX()-1)<1e-7?1:Lt.scaleX(),Vt=Math.abs(Lt.scaleY()-1)<1e-7?1:Lt.scaleY();Lt.scaleX(1),Lt.scaleY(1);const Jn=(Et=Ze.target.getStage())===null||Et===void 0?void 0:Et.findOne("Transformer"),Gn=1-Ve/xe.width,En=Math.min(Gn,Math.max(0,G.cropX)),oi=1-bt/xe.height,Ir=Math.min(oi,Math.max(0,G.cropY)),Ii=Jn.getActiveAnchor(),Io=!(Ii.indexOf("middle")>=0||Ii.indexOf("center")>=0),rs=!Io&&Gt<1&&Sn.current.cropHeight>bt/xe.height;let en=Io?G.cropWidth:G.cropWidth*Gt;rs&&(en=G.cropWidth);const to=!Io&&Vt<1&&Sn.current.cropWidth>Ve/xe.width;let Dr=Io?G.cropHeight:G.cropHeight*Vt;to&&(Dr=G.cropHeight),we&&(en=G.cropWidth,Dr=G.cropHeight),G.set({cropX:En,cropY:Ir,x:Lt.x(),y:Lt.y(),width:Lt.width()*Gt,height:Lt.height()*Vt,rotation:Ze.target.rotation(),cropWidth:Math.min(en,1-En),cropHeight:Math.min(Dr,1-Ir)})},onTransformEnd:Ze=>{const Et=Ze.currentTarget;G.set({width:Et.width(),height:Et.height(),x:Et.x(),y:Et.y(),rotation:Ze.target.rotation(),cropWidth:Ve/xe.width,cropHeight:bt/xe.height}),re(!1)}}),l.default.createElement(d.Rect,{x:G.x,y:G.y,width:Math.max(G.a.width-G.borderSize,0),height:Math.max(G.a.height-G.borderSize,0),opacity:Qn,offsetX:-G.borderSize/2,offsetY:-G.borderSize/2,stroke:G.borderColor,strokeWidth:G.borderSize,listening:!1,visible:!!G.borderSize,rotation:G.rotation,cornerRadius:Math.max(0,gt-G.borderSize),hideInExport:!G.showInExport}),G._cropModeEnabled&&l.default.createElement(E.Portal,{selector:".page-abs-container",enabled:!0},l.default.createElement(d.Rect,{x:-window.innerWidth/Z.scale,y:-window.innerWidth/Z.scale,width:window.innerWidth/Z.scale*3,height:window.innerWidth/Z.scale*3,fill:"rgba(0,0,0,0.3)"}),l.default.createElement(d.Image,{listening:!1,image:vt,x:G.x,y:G.y,width:G.a.width,height:G.a.height,rotation:G.rotation,shadowEnabled:G.shadowEnabled,shadowBlur:G.shadowBlur}),l.default.createElement(d.Group,{x:G.x,y:G.y,rotation:G.rotation,scaleX:Wt,scaleY:Wt},l.default.createElement(d.Image,{image:xe,ref:ae,opacity:.4,draggable:!0,x:-G.cropX*xe.width,y:-G.cropY*xe.height,onDragMove:Me,onTransform:Me,onTouchMove:Ze=>{Ze.evt.preventDefault();const Et=Ze.target.getStage().getPointersPositions();var Lt=Et[0],Gt=Et[1];const Vt=Ze.target;if(Lt&&!Gt&&!Vt.isDragging()&&Ie.current&&(Vt.startDrag(),Ie.current=!1),Lt&&Gt){_.default.hitOnDragEnabled=!0,Vt.isDragging()&&(Ie.current=!0,Vt.stopDrag());const to=Ze.target.getAbsoluteTransform().copy();to.invert();var Jn={x:Lt.x,y:Lt.y},Gn={x:Gt.x,y:Gt.y};if(!ft.current)return void(ft.current=j(Jn,Gn));var En=j(Jn,Gn),oi=T(Jn,Gn);De.current||(De.current=oi);const Dr=Vt.position();var Ir={x:En.x-Dr.x,y:En.y-Dr.y},Ii=oi/De.current;Vt.scaleX(Ii),Vt.scaleY(Ii);const ha=to.point(En),no=to.point(ft.current);var Io=ha.x-no.x,rs=ha.y-no.y,en={x:Math.min(0,En.x-Ir.x*Ii+Io),y:Math.min(0,En.y-Ir.y*Ii+rs)};Vt.position(en),De.current=oi,ft.current=En,Me(Ze)}},onTouchEnd:Ze=>{De.current=0,ft.current=null,_.default.hitOnDragEnabled=!1}}),l.default.createElement(d.Transformer,{ref:rt,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ze,Et)=>Et.width<5||Et.height<5?Ze:Et,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),l.default.createElement(d.Rect,{width:Ve,height:bt,ref:pn,listening:!1,onTransform:Ze=>{Ze.target.x()<-G.cropX*xe.width-1e-9&&(Ze.target.x(-G.cropX*xe.width),Ze.target.scaleX(1)),Ze.target.y()<-G.cropY*xe.height-1e-9&&(Ze.target.y(-G.cropY*xe.height),Ze.target.scaleY(1));const Et=Math.min(1,Math.max(0,G.cropX+Ze.target.x()/xe.width)),Lt=Math.min(1,Math.max(0,Ze.target.y()/xe.height+G.cropY)),Gt=Ze.target.width()*Ze.target.scaleX(),Vt=Ze.target.height()*Ze.target.scaleY(),Jn=Math.min(1-Et,Gt/xe.width),Gn=Math.min(1-Lt,Vt/xe.height),En=Ze.target.getAbsolutePosition(Ze.target.getParent().getParent());Ze.target.scale({x:1,y:1}),Ze.target.position({x:0,y:0}),G.set({x:En.x,y:En.y,cropX:Et,cropY:Lt,cropWidth:Jn,cropHeight:Gn,width:Math.min(Gt*Wt,xe.width*(1-Et)*Wt),height:Math.min(Vt*Wt,xe.height*(1-Lt)*Wt)})}}),l.default.createElement(d.Transformer,{ref:Fe,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ze,Et)=>Et.width<5||Et.height<5?Ze:Et,visible:G.resizable,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2}))),(se||he)&&l.default.createElement(O.Highlighter,{element:G}))})}(wo)),wo}var So={},ip={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 AO=ip.exports,U2;function TO(){return U2||(U2=1,function(e,i){(function(n,a){e.exports=a()})(typeof self<"u"?self:AO,function(){return function(t){var n={};function a(l){if(n[l])return n[l].exports;var s=n[l]={i:l,l:!1,exports:{}};return t[l].call(s.exports,s,s.exports,a),s.l=!0,s.exports}return a.m=t,a.c=n,a.d=function(l,s,c){a.o(l,s)||Object.defineProperty(l,s,{configurable:!1,enumerable:!0,get:c})},a.n=function(l){var s=l&&l.__esModule?function(){return l.default}:function(){return l};return a.d(s,"a",s),s},a.o=function(l,s){return Object.prototype.hasOwnProperty.call(l,s)},a.p="",a(a.s=109)}([function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=a(17),s=a(18),c=a(19),d=a(45),w=a(46),_=a(47),E=a(48),O=a(49),v=a(12),S=a(32),p=a(33),h=a(31),P=a(1),g={Scope:P.Scope,create:P.create,find:P.find,query:P.query,register:P.register,Container:l.default,Format:s.default,Leaf:c.default,Embed:E.default,Scroll:d.default,Block:_.default,Inline:w.default,Text:O.default,Attributor:{Attribute:v.default,Class:S.default,Style:p.default,Store:h.default}};n.default=g},function(t,n,a){var l=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(P,g){P.__proto__=g}||function(P,g){for(var y in g)g.hasOwnProperty(y)&&(P[y]=g[y])};return function(P,g){h(P,g);function y(){this.constructor=P}P.prototype=g===null?Object.create(g):(y.prototype=g.prototype,new y)}}();Object.defineProperty(n,"__esModule",{value:!0});var s=function(h){l(P,h);function P(g){var y=this;return g="[Parchment] "+g,y=h.call(this,g)||this,y.message=g,y.name=y.constructor.name,y}return P}(Error);n.ParchmentError=s;var c={},d={},w={},_={};n.DATA_KEY="__blot";var E;(function(h){h[h.TYPE=3]="TYPE",h[h.LEVEL=12]="LEVEL",h[h.ATTRIBUTE=13]="ATTRIBUTE",h[h.BLOT=14]="BLOT",h[h.INLINE=7]="INLINE",h[h.BLOCK=11]="BLOCK",h[h.BLOCK_BLOT=10]="BLOCK_BLOT",h[h.INLINE_BLOT=6]="INLINE_BLOT",h[h.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",h[h.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",h[h.ANY=15]="ANY"})(E=n.Scope||(n.Scope={}));function O(h,P){var g=S(h);if(g==null)throw new s("Unable to create "+h+" blot");var y=g,b=h instanceof Node||h.nodeType===Node.TEXT_NODE?h:y.create(P);return new y(b,P)}n.create=O;function v(h,P){return P===void 0&&(P=!1),h==null?null:h[n.DATA_KEY]!=null?h[n.DATA_KEY].blot:P?v(h.parentNode,P):null}n.find=v;function S(h,P){P===void 0&&(P=E.ANY);var g;if(typeof h=="string")g=_[h]||c[h];else if(h instanceof Text||h.nodeType===Node.TEXT_NODE)g=_.text;else if(typeof h=="number")h&E.LEVEL&E.BLOCK?g=_.block:h&E.LEVEL&E.INLINE&&(g=_.inline);else if(h instanceof HTMLElement){var y=(h.getAttribute("class")||"").split(/\s+/);for(var b in y)if(g=d[y[b]],g)break;g=g||w[h.tagName]}return g==null?null:P&E.LEVEL&g.scope&&P&E.TYPE&g.scope?g:null}n.query=S;function p(){for(var h=[],P=0;P<arguments.length;P++)h[P]=arguments[P];if(h.length>1)return h.map(function(b){return p(b)});var g=h[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(_[g.blotName||g.attrName]=g,typeof g.keyName=="string")c[g.keyName]=g;else if(g.className!=null&&(d[g.className]=g),g.tagName!=null){Array.isArray(g.tagName)?g.tagName=g.tagName.map(function(b){return b.toUpperCase()}):g.tagName=g.tagName.toUpperCase();var y=Array.isArray(g.tagName)?g.tagName:[g.tagName];y.forEach(function(b){(w[b]==null||g.className==null)&&(w[b]=g)})}return g}n.register=p},function(t,n,a){var l=a(51),s=a(11),c=a(3),d=a(20),w="\0",_=function(E){Array.isArray(E)?this.ops=E:E!=null&&Array.isArray(E.ops)?this.ops=E.ops:this.ops=[]};_.prototype.insert=function(E,O){var v={};return E.length===0?this:(v.insert=E,O!=null&&typeof O=="object"&&Object.keys(O).length>0&&(v.attributes=O),this.push(v))},_.prototype.delete=function(E){return E<=0?this:this.push({delete:E})},_.prototype.retain=function(E,O){if(E<=0)return this;var v={retain:E};return O!=null&&typeof O=="object"&&Object.keys(O).length>0&&(v.attributes=O),this.push(v)},_.prototype.push=function(E){var O=this.ops.length,v=this.ops[O-1];if(E=c(!0,{},E),typeof v=="object"){if(typeof E.delete=="number"&&typeof v.delete=="number")return this.ops[O-1]={delete:v.delete+E.delete},this;if(typeof v.delete=="number"&&E.insert!=null&&(O-=1,v=this.ops[O-1],typeof v!="object"))return this.ops.unshift(E),this;if(s(E.attributes,v.attributes)){if(typeof E.insert=="string"&&typeof v.insert=="string")return this.ops[O-1]={insert:v.insert+E.insert},typeof E.attributes=="object"&&(this.ops[O-1].attributes=E.attributes),this;if(typeof E.retain=="number"&&typeof v.retain=="number")return this.ops[O-1]={retain:v.retain+E.retain},typeof E.attributes=="object"&&(this.ops[O-1].attributes=E.attributes),this}}return O===this.ops.length?this.ops.push(E):this.ops.splice(O,0,E),this},_.prototype.chop=function(){var E=this.ops[this.ops.length-1];return E&&E.retain&&!E.attributes&&this.ops.pop(),this},_.prototype.filter=function(E){return this.ops.filter(E)},_.prototype.forEach=function(E){this.ops.forEach(E)},_.prototype.map=function(E){return this.ops.map(E)},_.prototype.partition=function(E){var O=[],v=[];return this.forEach(function(S){var p=E(S)?O:v;p.push(S)}),[O,v]},_.prototype.reduce=function(E,O){return this.ops.reduce(E,O)},_.prototype.changeLength=function(){return this.reduce(function(E,O){return O.insert?E+d.length(O):O.delete?E-O.delete:E},0)},_.prototype.length=function(){return this.reduce(function(E,O){return E+d.length(O)},0)},_.prototype.slice=function(E,O){E=E||0,typeof O!="number"&&(O=1/0);for(var v=[],S=d.iterator(this.ops),p=0;p<O&&S.hasNext();){var h;p<E?h=S.next(E-p):(h=S.next(O-p),v.push(h)),p+=d.length(h)}return new _(v)},_.prototype.compose=function(E){var O=d.iterator(this.ops),v=d.iterator(E.ops),S=[],p=v.peek();if(p!=null&&typeof p.retain=="number"&&p.attributes==null){for(var h=p.retain;O.peekType()==="insert"&&O.peekLength()<=h;)h-=O.peekLength(),S.push(O.next());p.retain-h>0&&v.next(p.retain-h)}for(var P=new _(S);O.hasNext()||v.hasNext();)if(v.peekType()==="insert")P.push(v.next());else if(O.peekType()==="delete")P.push(O.next());else{var g=Math.min(O.peekLength(),v.peekLength()),y=O.next(g),b=v.next(g);if(typeof b.retain=="number"){var x={};typeof y.retain=="number"?x.retain=g:x.insert=y.insert;var M=d.attributes.compose(y.attributes,b.attributes,typeof y.retain=="number");if(M&&(x.attributes=M),P.push(x),!v.hasNext()&&s(P.ops[P.ops.length-1],x)){var T=new _(O.rest());return P.concat(T).chop()}}else typeof b.delete=="number"&&typeof y.retain=="number"&&P.push(b)}return P.chop()},_.prototype.concat=function(E){var O=new _(this.ops.slice());return E.ops.length>0&&(O.push(E.ops[0]),O.ops=O.ops.concat(E.ops.slice(1))),O},_.prototype.diff=function(E,O){if(this.ops===E.ops)return new _;var v=[this,E].map(function(g){return g.map(function(y){if(y.insert!=null)return typeof y.insert=="string"?y.insert:w;var b=g===E?"on":"with";throw new Error("diff() called "+b+" non-document")}).join("")}),S=new _,p=l(v[0],v[1],O),h=d.iterator(this.ops),P=d.iterator(E.ops);return p.forEach(function(g){for(var y=g[1].length;y>0;){var b=0;switch(g[0]){case l.INSERT:b=Math.min(P.peekLength(),y),S.push(P.next(b));break;case l.DELETE:b=Math.min(y,h.peekLength()),h.next(b),S.delete(b);break;case l.EQUAL:b=Math.min(h.peekLength(),P.peekLength(),y);var x=h.next(b),M=P.next(b);s(x.insert,M.insert)?S.retain(b,d.attributes.diff(x.attributes,M.attributes)):S.push(M).delete(b);break}y-=b}}),S.chop()},_.prototype.eachLine=function(E,O){O=O||`
114
- `;for(var v=d.iterator(this.ops),S=new _,p=0;v.hasNext();){if(v.peekType()!=="insert")return;var h=v.peek(),P=d.length(h)-v.peekLength(),g=typeof h.insert=="string"?h.insert.indexOf(O,P)-P:-1;if(g<0)S.push(v.next());else if(g>0)S.push(v.next(g));else{if(E(S,v.next(1).attributes||{},p)===!1)return;p+=1,S=new _}}S.length()>0&&E(S,{},p)},_.prototype.transform=function(E,O){if(O=!!O,typeof E=="number")return this.transformPosition(E,O);for(var v=d.iterator(this.ops),S=d.iterator(E.ops),p=new _;v.hasNext()||S.hasNext();)if(v.peekType()==="insert"&&(O||S.peekType()!=="insert"))p.retain(d.length(v.next()));else if(S.peekType()==="insert")p.push(S.next());else{var h=Math.min(v.peekLength(),S.peekLength()),P=v.next(h),g=S.next(h);if(P.delete)continue;g.delete?p.push(g):p.retain(h,d.attributes.transform(P.attributes,g.attributes,O))}return p.chop()},_.prototype.transformPosition=function(E,O){O=!!O;for(var v=d.iterator(this.ops),S=0;v.hasNext()&&S<=E;){var p=v.peekLength(),h=v.peekType();if(v.next(),h==="delete"){E-=Math.min(p,E-S);continue}else h==="insert"&&(S<E||!O)&&(E+=p);S+=p}return E},t.exports=_},function(t,n){var a=Object.prototype.hasOwnProperty,l=Object.prototype.toString,s=Object.defineProperty,c=Object.getOwnPropertyDescriptor,d=function(v){return typeof Array.isArray=="function"?Array.isArray(v):l.call(v)==="[object Array]"},w=function(v){if(!v||l.call(v)!=="[object Object]")return!1;var S=a.call(v,"constructor"),p=v.constructor&&v.constructor.prototype&&a.call(v.constructor.prototype,"isPrototypeOf");if(v.constructor&&!S&&!p)return!1;var h;for(h in v);return typeof h>"u"||a.call(v,h)},_=function(v,S){s&&S.name==="__proto__"?s(v,S.name,{enumerable:!0,configurable:!0,value:S.newValue,writable:!0}):v[S.name]=S.newValue},E=function(v,S){if(S==="__proto__")if(a.call(v,S)){if(c)return c(v,S).value}else return;return v[S]};t.exports=function O(){var v,S,p,h,P,g,y=arguments[0],b=1,x=arguments.length,M=!1;for(typeof y=="boolean"&&(M=y,y=arguments[1]||{},b=2),(y==null||typeof y!="object"&&typeof y!="function")&&(y={});b<x;++b)if(v=arguments[b],v!=null)for(S in v)p=E(y,S),h=E(v,S),y!==h&&(M&&h&&(w(h)||(P=d(h)))?(P?(P=!1,g=p&&d(p)?p:[]):g=p&&w(p)?p:{},_(y,{name:S,newValue:O(M,g,h)})):typeof h<"u"&&_(y,{name:S,newValue:h}));return y}},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BlockEmbed=n.bubbleFormats=void 0;var l=function(){function A(L,k){for(var R=0;R<k.length;R++){var B=k[R];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(L,B.key,B)}}return function(L,k,R){return k&&A(L.prototype,k),R&&A(L,R),L}}(),s=function A(L,k,R){L===null&&(L=Function.prototype);var B=Object.getOwnPropertyDescriptor(L,k);if(B===void 0){var X=Object.getPrototypeOf(L);return X===null?void 0:A(X,k,R)}else{if("value"in B)return B.value;var Y=B.get;return Y===void 0?void 0:Y.call(R)}},c=a(3),d=y(c),w=a(2),_=y(w),E=a(0),O=y(E),v=a(16),S=y(v),p=a(6),h=y(p),P=a(7),g=y(P);function y(A){return A&&A.__esModule?A:{default:A}}function b(A,L){if(!(A instanceof L))throw new TypeError("Cannot call a class as a function")}function x(A,L){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:A}function M(A,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);A.prototype=Object.create(L&&L.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(A,L):A.__proto__=L)}var T=1,j=function(A){M(L,A);function L(){return b(this,L),x(this,(L.__proto__||Object.getPrototypeOf(L)).apply(this,arguments))}return l(L,[{key:"attach",value:function(){s(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"attach",this).call(this),this.attributes=new O.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new _.default().insert(this.value(),(0,d.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(R,B){var X=O.default.query(R,O.default.Scope.BLOCK_ATTRIBUTE);X!=null&&this.attributes.attribute(X,B)}},{key:"formatAt",value:function(R,B,X,Y){this.format(X,Y)}},{key:"insertAt",value:function(R,B,X){if(typeof B=="string"&&B.endsWith(`
115
- `)){var Y=O.default.create(I.blotName);this.parent.insertBefore(Y,R===0?this:this.next),Y.insertAt(0,B.slice(0,-1))}else s(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertAt",this).call(this,R,B,X)}}]),L}(O.default.Embed);j.scope=O.default.Scope.BLOCK_BLOT;var I=function(A){M(L,A);function L(k){b(this,L);var R=x(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,k));return R.cache={},R}return l(L,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(O.default.Leaf).reduce(function(R,B){return B.length()===0?R:R.insert(B.value(),m(B))},new _.default).insert(`
116
- `,m(this))),this.cache.delta}},{key:"deleteAt",value:function(R,B){s(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"deleteAt",this).call(this,R,B),this.cache={}}},{key:"formatAt",value:function(R,B,X,Y){B<=0||(O.default.query(X,O.default.Scope.BLOCK)?R+B===this.length()&&this.format(X,Y):s(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"formatAt",this).call(this,R,Math.min(B,this.length()-R-1),X,Y),this.cache={})}},{key:"insertAt",value:function(R,B,X){if(X!=null)return s(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertAt",this).call(this,R,B,X);if(B.length!==0){var Y=B.split(`
117
- `),Q=Y.shift();Q.length>0&&(R<this.length()-1||this.children.tail==null?s(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertAt",this).call(this,Math.min(R,this.length()-1),Q):this.children.tail.insertAt(this.children.tail.length(),Q),this.cache={});var q=this;Y.reduce(function(z,N){return q=q.split(z,!0),q.insertAt(0,N),N.length},R+Q.length)}}},{key:"insertBefore",value:function(R,B){var X=this.children.head;s(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertBefore",this).call(this,R,B),X instanceof S.default&&X.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=s(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"length",this).call(this)+T),this.cache.length}},{key:"moveChildren",value:function(R,B){s(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"moveChildren",this).call(this,R,B),this.cache={}}},{key:"optimize",value:function(R){s(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"optimize",this).call(this,R),this.cache={}}},{key:"path",value:function(R){return s(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"path",this).call(this,R,!0)}},{key:"removeChild",value:function(R){s(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"removeChild",this).call(this,R),this.cache={}}},{key:"split",value:function(R){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(B&&(R===0||R>=this.length()-T)){var X=this.clone();return R===0?(this.parent.insertBefore(X,this),this):(this.parent.insertBefore(X,this.next),X)}else{var Y=s(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"split",this).call(this,R,B);return this.cache={},Y}}}]),L}(O.default.Block);I.blotName="block",I.tagName="P",I.defaultChild="break",I.allowedChildren=[h.default,O.default.Embed,g.default];function m(A){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return A==null||(typeof A.formats=="function"&&(L=(0,d.default)(L,A.formats())),A.parent==null||A.parent.blotName=="scroll"||A.parent.statics.scope!==A.statics.scope)?L:m(A.parent,L)}n.bubbleFormats=m,n.BlockEmbed=j,n.default=I},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.overload=n.expandConfig=void 0;var l=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,N){var U=[],$=!0,ee=!1,G=void 0;try{for(var Z=z[Symbol.iterator](),W;!($=(W=Z.next()).done)&&(U.push(W.value),!(N&&U.length===N));$=!0);}catch(te){ee=!0,G=te}finally{try{!$&&Z.return&&Z.return()}finally{if(ee)throw G}}return U}return function(z,N){if(Array.isArray(z))return z;if(Symbol.iterator in Object(z))return q(z,N);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function q(z,N){for(var U=0;U<N.length;U++){var $=N[U];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(z,$.key,$)}}return function(z,N,U){return N&&q(z.prototype,N),U&&q(z,U),z}}();a(50);var d=a(2),w=m(d),_=a(14),E=m(_),O=a(8),v=m(O),S=a(9),p=m(S),h=a(0),P=m(h),g=a(15),y=m(g),b=a(3),x=m(b),M=a(10),T=m(M),j=a(34),I=m(j);function m(q){return q&&q.__esModule?q:{default:q}}function A(q,z,N){return z in q?Object.defineProperty(q,z,{value:N,enumerable:!0,configurable:!0,writable:!0}):q[z]=N,q}function L(q,z){if(!(q instanceof z))throw new TypeError("Cannot call a class as a function")}var k=(0,T.default)("quill"),R=function(){c(q,null,[{key:"debug",value:function(N){N===!0&&(N="log"),T.default.level(N)}},{key:"find",value:function(N){return N.__quill||P.default.find(N)}},{key:"import",value:function(N){return this.imports[N]==null&&k.error("Cannot import "+N+". Are you sure it was registered?"),this.imports[N]}},{key:"register",value:function(N,U){var $=this,ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof N!="string"){var G=N.attrName||N.blotName;typeof G=="string"?this.register("formats/"+G,N,U):Object.keys(N).forEach(function(Z){$.register(Z,N[Z],U)})}else this.imports[N]!=null&&!ee&&k.warn("Overwriting "+N+" with",U),this.imports[N]=U,(N.startsWith("blots/")||N.startsWith("formats/"))&&U.blotName!=="abstract"?P.default.register(U):N.startsWith("modules")&&typeof U.register=="function"&&U.register()}}]);function q(z){var N=this,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(L(this,q),this.options=B(z,U),this.container=this.options.container,this.container==null)return k.error("Invalid Quill container",z);this.options.debug&&q.debug(this.options.debug);var $=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 v.default,this.scroll=P.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new E.default(this.scroll),this.selection=new y.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(v.default.events.EDITOR_CHANGE,function(G){G===v.default.events.TEXT_CHANGE&&N.root.classList.toggle("ql-blank",N.editor.isBlank())}),this.emitter.on(v.default.events.SCROLL_UPDATE,function(G,Z){var W=N.selection.lastRange,te=W&&W.length===0?W.index:void 0;X.call(N,function(){return N.editor.update(null,Z,te)},G)});var ee=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+$+"<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(q,[{key:"addContainer",value:function(N){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof N=="string"){var $=N;N=document.createElement("div"),N.classList.add($)}return this.container.insertBefore(N,U),N}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(N,U,$){var ee=this,G=Y(N,U,$),Z=s(G,4);return N=Z[0],U=Z[1],$=Z[3],X.call(this,function(){return ee.editor.deleteText(N,U)},$,N,-1*U)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(N),this.container.classList.toggle("ql-disabled",!N)}},{key:"focus",value:function(){var N=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=N,this.scrollIntoView()}},{key:"format",value:function(N,U){var $=this,ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:v.default.sources.API;return X.call(this,function(){var G=$.getSelection(!0),Z=new w.default;if(G==null)return Z;if(P.default.query(N,P.default.Scope.BLOCK))Z=$.editor.formatLine(G.index,G.length,A({},N,U));else{if(G.length===0)return $.selection.format(N,U),Z;Z=$.editor.formatText(G.index,G.length,A({},N,U))}return $.setSelection(G,v.default.sources.SILENT),Z},ee)}},{key:"formatLine",value:function(N,U,$,ee,G){var Z=this,W=void 0,te=Y(N,U,$,ee,G),re=s(te,4);return N=re[0],U=re[1],W=re[2],G=re[3],X.call(this,function(){return Z.editor.formatLine(N,U,W)},G,N,0)}},{key:"formatText",value:function(N,U,$,ee,G){var Z=this,W=void 0,te=Y(N,U,$,ee,G),re=s(te,4);return N=re[0],U=re[1],W=re[2],G=re[3],X.call(this,function(){return Z.editor.formatText(N,U,W)},G,N,0)}},{key:"getBounds",value:function(N){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,$=void 0;typeof N=="number"?$=this.selection.getBounds(N,U):$=this.selection.getBounds(N.index,N.length);var ee=this.container.getBoundingClientRect();return{bottom:$.bottom-ee.top,height:$.height,left:$.left-ee.left,right:$.right-ee.left,top:$.top-ee.top,width:$.width}}},{key:"getContents",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-N,$=Y(N,U),ee=s($,2);return N=ee[0],U=ee[1],this.editor.getContents(N,U)}},{key:"getFormat",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof N=="number"?this.editor.getFormat(N,U):this.editor.getFormat(N.index,N.length)}},{key:"getIndex",value:function(N){return N.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(N){return this.scroll.leaf(N)}},{key:"getLine",value:function(N){return this.scroll.line(N)}},{key:"getLines",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof N!="number"?this.scroll.lines(N.index,N.length):this.scroll.lines(N,U)}},{key:"getModule",value:function(N){return this.theme.modules[N]}},{key:"getSelection",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return N&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-N,$=Y(N,U),ee=s($,2);return N=ee[0],U=ee[1],this.editor.getText(N,U)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(N,U,$){var ee=this,G=arguments.length>3&&arguments[3]!==void 0?arguments[3]:q.sources.API;return X.call(this,function(){return ee.editor.insertEmbed(N,U,$)},G,N)}},{key:"insertText",value:function(N,U,$,ee,G){var Z=this,W=void 0,te=Y(N,0,$,ee,G),re=s(te,4);return N=re[0],W=re[2],G=re[3],X.call(this,function(){return Z.editor.insertText(N,U,W)},G,N,U.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(N,U,$){this.clipboard.dangerouslyPasteHTML(N,U,$)}},{key:"removeFormat",value:function(N,U,$){var ee=this,G=Y(N,U,$),Z=s(G,4);return N=Z[0],U=Z[1],$=Z[3],X.call(this,function(){return ee.editor.removeFormat(N,U)},$,N)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(N){var U=this,$=arguments.length>1&&arguments[1]!==void 0?arguments[1]:v.default.sources.API;return X.call(this,function(){N=new w.default(N);var ee=U.getLength(),G=U.editor.deleteText(0,ee),Z=U.editor.applyDelta(N),W=Z.ops[Z.ops.length-1];W!=null&&typeof W.insert=="string"&&W.insert[W.insert.length-1]===`
118
- `&&(U.editor.deleteText(U.getLength()-1,1),Z.delete(1));var te=G.compose(Z);return te},$)}},{key:"setSelection",value:function(N,U,$){if(N==null)this.selection.setRange(null,U||q.sources.API);else{var ee=Y(N,U,$),G=s(ee,4);N=G[0],U=G[1],$=G[3],this.selection.setRange(new g.Range(N,U),$),$!==v.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(N){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:v.default.sources.API,$=new w.default().insert(N);return this.setContents($,U)}},{key:"update",value:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v.default.sources.USER,U=this.scroll.update(N);return this.selection.update(N),U}},{key:"updateContents",value:function(N){var U=this,$=arguments.length>1&&arguments[1]!==void 0?arguments[1]:v.default.sources.API;return X.call(this,function(){return N=new w.default(N),U.editor.applyDelta(N,$)},$,!0)}}]),q}();R.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},R.events=v.default.events,R.sources=v.default.sources,R.version="1.3.7",R.imports={delta:w.default,parchment:P.default,"core/module":p.default,"core/theme":I.default};function B(q,z){if(z=(0,x.default)(!0,{container:q,modules:{clipboard:!0,keyboard:!0,history:!0}},z),!z.theme||z.theme===R.DEFAULTS.theme)z.theme=I.default;else if(z.theme=R.import("themes/"+z.theme),z.theme==null)throw new Error("Invalid theme "+z.theme+". Did you register it?");var N=(0,x.default)(!0,{},z.theme.DEFAULTS);[N,z].forEach(function(ee){ee.modules=ee.modules||{},Object.keys(ee.modules).forEach(function(G){ee.modules[G]===!0&&(ee.modules[G]={})})});var U=Object.keys(N.modules).concat(Object.keys(z.modules)),$=U.reduce(function(ee,G){var Z=R.import("modules/"+G);return Z==null?k.error("Cannot load "+G+" module. Are you sure you registered it?"):ee[G]=Z.DEFAULTS||{},ee},{});return z.modules!=null&&z.modules.toolbar&&z.modules.toolbar.constructor!==Object&&(z.modules.toolbar={container:z.modules.toolbar}),z=(0,x.default)(!0,{},R.DEFAULTS,{modules:$},N,z),["bounds","container","scrollingContainer"].forEach(function(ee){typeof z[ee]=="string"&&(z[ee]=document.querySelector(z[ee]))}),z.modules=Object.keys(z.modules).reduce(function(ee,G){return z.modules[G]&&(ee[G]=z.modules[G]),ee},{}),z}function X(q,z,N,U){if(this.options.strict&&!this.isEnabled()&&z===v.default.sources.USER)return new w.default;var $=N==null?null:this.getSelection(),ee=this.editor.delta,G=q();if($!=null&&(N===!0&&(N=$.index),U==null?$=Q($,G,z):U!==0&&($=Q($,N,U,z)),this.setSelection($,v.default.sources.SILENT)),G.length()>0){var Z,W=[v.default.events.TEXT_CHANGE,G,ee,z];if((Z=this.emitter).emit.apply(Z,[v.default.events.EDITOR_CHANGE].concat(W)),z!==v.default.sources.SILENT){var te;(te=this.emitter).emit.apply(te,W)}}return G}function Y(q,z,N,U,$){var ee={};return typeof q.index=="number"&&typeof q.length=="number"?typeof z!="number"?($=U,U=N,N=z,z=q.length,q=q.index):(z=q.length,q=q.index):typeof z!="number"&&($=U,U=N,N=z,z=0),(typeof N>"u"?"undefined":l(N))==="object"?(ee=N,$=U):typeof N=="string"&&(U!=null?ee[N]=U:$=N),$=$||v.default.sources.API,[q,z,ee,$]}function Q(q,z,N,U){if(q==null)return null;var $=void 0,ee=void 0;if(z instanceof w.default){var G=[q.index,q.index+q.length].map(function(re){return z.transformPosition(re,U!==v.default.sources.USER)}),Z=s(G,2);$=Z[0],ee=Z[1]}else{var W=[q.index,q.index+q.length].map(function(re){return re<z||re===z&&U===v.default.sources.USER?re:N>=0?re+N:Math.max(z,re+N)}),te=s(W,2);$=te[0],ee=te[1]}return new g.Range($,ee-$)}n.expandConfig=B,n.overload=Y,n.default=R},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function h(P,g){for(var y=0;y<g.length;y++){var b=g[y];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(P,b.key,b)}}return function(P,g,y){return g&&h(P.prototype,g),y&&h(P,y),P}}(),s=function h(P,g,y){P===null&&(P=Function.prototype);var b=Object.getOwnPropertyDescriptor(P,g);if(b===void 0){var x=Object.getPrototypeOf(P);return x===null?void 0:h(x,g,y)}else{if("value"in b)return b.value;var M=b.get;return M===void 0?void 0:M.call(y)}},c=a(7),d=E(c),w=a(0),_=E(w);function E(h){return h&&h.__esModule?h:{default:h}}function O(h,P){if(!(h instanceof P))throw new TypeError("Cannot call a class as a function")}function v(h,P){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:h}function S(h,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);h.prototype=Object.create(P&&P.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(h,P):h.__proto__=P)}var p=function(h){S(P,h);function P(){return O(this,P),v(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return l(P,[{key:"formatAt",value:function(y,b,x,M){if(P.compare(this.statics.blotName,x)<0&&_.default.query(x,_.default.Scope.BLOT)){var T=this.isolate(y,b);M&&T.wrap(x,M)}else s(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"formatAt",this).call(this,y,b,x,M)}},{key:"optimize",value:function(y){if(s(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"optimize",this).call(this,y),this.parent instanceof P&&P.compare(this.statics.blotName,this.parent.statics.blotName)>0){var b=this.parent.isolate(this.offset(),this.length());this.moveChildren(b),b.wrap(this)}}}],[{key:"compare",value:function(y,b){var x=P.order.indexOf(y),M=P.order.indexOf(b);return x>=0||M>=0?x-M:y===b?0:y<b?-1:1}}]),P}(_.default.Inline);p.allowedChildren=[p,_.default.Embed,d.default],p.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],n.default=p},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=a(0),s=c(l);function c(O){return O&&O.__esModule?O:{default:O}}function d(O,v){if(!(O instanceof v))throw new TypeError("Cannot call a class as a function")}function w(O,v){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:O}function _(O,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);O.prototype=Object.create(v&&v.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(O,v):O.__proto__=v)}var E=function(O){_(v,O);function v(){return d(this,v),w(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return v}(s.default.Text);n.default=E},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function g(y,b){for(var x=0;x<b.length;x++){var M=b[x];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(y,M.key,M)}}return function(y,b,x){return b&&g(y.prototype,b),x&&g(y,x),y}}(),s=function g(y,b,x){y===null&&(y=Function.prototype);var M=Object.getOwnPropertyDescriptor(y,b);if(M===void 0){var T=Object.getPrototypeOf(y);return T===null?void 0:g(T,b,x)}else{if("value"in M)return M.value;var j=M.get;return j===void 0?void 0:j.call(x)}},c=a(54),d=E(c),w=a(10),_=E(w);function E(g){return g&&g.__esModule?g:{default:g}}function O(g,y){if(!(g instanceof y))throw new TypeError("Cannot call a class as a function")}function v(g,y){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:g}function S(g,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);g.prototype=Object.create(y&&y.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(g,y):g.__proto__=y)}var p=(0,_.default)("quill:events"),h=["selectionchange","mousedown","mouseup","click"];h.forEach(function(g){document.addEventListener(g,function(){for(var y=arguments.length,b=Array(y),x=0;x<y;x++)b[x]=arguments[x];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(M){if(M.__quill&&M.__quill.emitter){var T;(T=M.__quill.emitter).handleDOM.apply(T,b)}})})});var P=function(g){S(y,g);function y(){O(this,y);var b=v(this,(y.__proto__||Object.getPrototypeOf(y)).call(this));return b.listeners={},b.on("error",p.error),b}return l(y,[{key:"emit",value:function(){p.log.apply(p,arguments),s(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(x){for(var M=arguments.length,T=Array(M>1?M-1:0),j=1;j<M;j++)T[j-1]=arguments[j];(this.listeners[x.type]||[]).forEach(function(I){var m=I.node,A=I.handler;(x.target===m||m.contains(x.target))&&A.apply(void 0,[x].concat(T))})}},{key:"listenDOM",value:function(x,M,T){this.listeners[x]||(this.listeners[x]=[]),this.listeners[x].push({node:M,handler:T})}}]),y}(d.default);P.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"},P.sources={API:"api",SILENT:"silent",USER:"user"},n.default=P},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});function l(c,d){if(!(c instanceof d))throw new TypeError("Cannot call a class as a function")}var s=function c(d){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};l(this,c),this.quill=d,this.options=w};s.DEFAULTS={},n.default=s},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=["error","warn","log","info"],s="warn";function c(w){if(l.indexOf(w)<=l.indexOf(s)){for(var _,E=arguments.length,O=Array(E>1?E-1:0),v=1;v<E;v++)O[v-1]=arguments[v];(_=console)[w].apply(_,O)}}function d(w){return l.reduce(function(_,E){return _[E]=c.bind(console,E,w),_},{})}c.level=d.level=function(w){s=w},n.default=d},function(t,n,a){var l=Array.prototype.slice,s=a(52),c=a(53),d=t.exports=function(O,v,S){return S||(S={}),O===v?!0:O instanceof Date&&v instanceof Date?O.getTime()===v.getTime():!O||!v||typeof O!="object"&&typeof v!="object"?S.strict?O===v:O==v:E(O,v,S)};function w(O){return O==null}function _(O){return!(!O||typeof O!="object"||typeof O.length!="number"||typeof O.copy!="function"||typeof O.slice!="function"||O.length>0&&typeof O[0]!="number")}function E(O,v,S){var p,h;if(w(O)||w(v)||O.prototype!==v.prototype)return!1;if(c(O))return c(v)?(O=l.call(O),v=l.call(v),d(O,v,S)):!1;if(_(O)){if(!_(v)||O.length!==v.length)return!1;for(p=0;p<O.length;p++)if(O[p]!==v[p])return!1;return!0}try{var P=s(O),g=s(v)}catch{return!1}if(P.length!=g.length)return!1;for(P.sort(),g.sort(),p=P.length-1;p>=0;p--)if(P[p]!=g[p])return!1;for(p=P.length-1;p>=0;p--)if(h=P[p],!d(O[h],v[h],S))return!1;return typeof O==typeof v}},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=a(1),s=function(){function c(d,w,_){_===void 0&&(_={}),this.attrName=d,this.keyName=w;var E=l.Scope.TYPE&l.Scope.ATTRIBUTE;_.scope!=null?this.scope=_.scope&l.Scope.LEVEL|E:this.scope=l.Scope.ATTRIBUTE,_.whitelist!=null&&(this.whitelist=_.whitelist)}return c.keys=function(d){return[].map.call(d.attributes,function(w){return w.name})},c.prototype.add=function(d,w){return this.canAdd(d,w)?(d.setAttribute(this.keyName,w),!0):!1},c.prototype.canAdd=function(d,w){var _=l.query(d,l.Scope.BLOT&(this.scope|l.Scope.TYPE));return _==null?!1:this.whitelist==null?!0:typeof w=="string"?this.whitelist.indexOf(w.replace(/["']/g,""))>-1:this.whitelist.indexOf(w)>-1},c.prototype.remove=function(d){d.removeAttribute(this.keyName)},c.prototype.value=function(d){var w=d.getAttribute(this.keyName);return this.canAdd(d,w)&&w?w:""},c}();n.default=s},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Code=void 0;var l=function(){function j(I,m){var A=[],L=!0,k=!1,R=void 0;try{for(var B=I[Symbol.iterator](),X;!(L=(X=B.next()).done)&&(A.push(X.value),!(m&&A.length===m));L=!0);}catch(Y){k=!0,R=Y}finally{try{!L&&B.return&&B.return()}finally{if(k)throw R}}return A}return function(I,m){if(Array.isArray(I))return I;if(Symbol.iterator in Object(I))return j(I,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function j(I,m){for(var A=0;A<m.length;A++){var L=m[A];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(I,L.key,L)}}return function(I,m,A){return m&&j(I.prototype,m),A&&j(I,A),I}}(),c=function j(I,m,A){I===null&&(I=Function.prototype);var L=Object.getOwnPropertyDescriptor(I,m);if(L===void 0){var k=Object.getPrototypeOf(I);return k===null?void 0:j(k,m,A)}else{if("value"in L)return L.value;var R=L.get;return R===void 0?void 0:R.call(A)}},d=a(2),w=g(d),_=a(0),E=g(_),O=a(4),v=g(O),S=a(6),p=g(S),h=a(7),P=g(h);function g(j){return j&&j.__esModule?j:{default:j}}function y(j,I){if(!(j instanceof I))throw new TypeError("Cannot call a class as a function")}function b(j,I){if(!j)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:j}function x(j,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);j.prototype=Object.create(I&&I.prototype,{constructor:{value:j,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(j,I):j.__proto__=I)}var M=function(j){x(I,j);function I(){return y(this,I),b(this,(I.__proto__||Object.getPrototypeOf(I)).apply(this,arguments))}return I}(p.default);M.blotName="code",M.tagName="CODE";var T=function(j){x(I,j);function I(){return y(this,I),b(this,(I.__proto__||Object.getPrototypeOf(I)).apply(this,arguments))}return s(I,[{key:"delta",value:function(){var A=this,L=this.domNode.textContent;return L.endsWith(`
119
- `)&&(L=L.slice(0,-1)),L.split(`
120
- `).reduce(function(k,R){return k.insert(R).insert(`
121
- `,A.formats())},new w.default)}},{key:"format",value:function(A,L){if(!(A===this.statics.blotName&&L)){var k=this.descendant(P.default,this.length()-1),R=l(k,1),B=R[0];B!=null&&B.deleteAt(B.length()-1,1),c(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"format",this).call(this,A,L)}}},{key:"formatAt",value:function(A,L,k,R){if(L!==0&&!(E.default.query(k,E.default.Scope.BLOCK)==null||k===this.statics.blotName&&R===this.statics.formats(this.domNode))){var B=this.newlineIndex(A);if(!(B<0||B>=A+L)){var X=this.newlineIndex(A,!0)+1,Y=B-X+1,Q=this.isolate(X,Y),q=Q.next;Q.format(k,R),q instanceof I&&q.formatAt(0,A-X+L-Y,k,R)}}}},{key:"insertAt",value:function(A,L,k){if(k==null){var R=this.descendant(P.default,A),B=l(R,2),X=B[0],Y=B[1];X.insertAt(Y,L)}}},{key:"length",value:function(){var A=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
122
- `)?A:A+1}},{key:"newlineIndex",value:function(A){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(L)return this.domNode.textContent.slice(0,A).lastIndexOf(`
123
- `);var k=this.domNode.textContent.slice(A).indexOf(`
124
- `);return k>-1?A+k:-1}},{key:"optimize",value:function(A){this.domNode.textContent.endsWith(`
125
- `)||this.appendChild(E.default.create("text",`
126
- `)),c(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"optimize",this).call(this,A);var L=this.next;L!=null&&L.prev===this&&L.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===L.statics.formats(L.domNode)&&(L.optimize(A),L.moveChildren(this),L.remove())}},{key:"replace",value:function(A){c(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"replace",this).call(this,A),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(L){var k=E.default.find(L);k==null?L.parentNode.removeChild(L):k instanceof E.default.Embed?k.remove():k.unwrap()})}}],[{key:"create",value:function(A){var L=c(I.__proto__||Object.getPrototypeOf(I),"create",this).call(this,A);return L.setAttribute("spellcheck",!1),L}},{key:"formats",value:function(){return!0}}]),I}(v.default);T.blotName="code-block",T.tagName="PRE",T.TAB=" ",n.Code=M,n.default=T},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=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,N){var U=[],$=!0,ee=!1,G=void 0;try{for(var Z=z[Symbol.iterator](),W;!($=(W=Z.next()).done)&&(U.push(W.value),!(N&&U.length===N));$=!0);}catch(te){ee=!0,G=te}finally{try{!$&&Z.return&&Z.return()}finally{if(ee)throw G}}return U}return function(z,N){if(Array.isArray(z))return z;if(Symbol.iterator in Object(z))return q(z,N);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function q(z,N){for(var U=0;U<N.length;U++){var $=N[U];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(z,$.key,$)}}return function(z,N,U){return N&&q(z.prototype,N),U&&q(z,U),z}}(),d=a(2),w=L(d),_=a(20),E=L(_),O=a(0),v=L(O),S=a(13),p=L(S),h=a(24),P=L(h),g=a(4),y=L(g),b=a(16),x=L(b),M=a(21),T=L(M),j=a(11),I=L(j),m=a(3),A=L(m);function L(q){return q&&q.__esModule?q:{default:q}}function k(q,z,N){return z in q?Object.defineProperty(q,z,{value:N,enumerable:!0,configurable:!0,writable:!0}):q[z]=N,q}function R(q,z){if(!(q instanceof z))throw new TypeError("Cannot call a class as a function")}var B=/^[ -~]*$/,X=function(){function q(z){R(this,q),this.scroll=z,this.delta=this.getDelta()}return c(q,[{key:"applyDelta",value:function(N){var U=this,$=!1;this.scroll.update();var ee=this.scroll.length();return this.scroll.batchStart(),N=Q(N),N.reduce(function(G,Z){var W=Z.retain||Z.delete||Z.insert.length||1,te=Z.attributes||{};if(Z.insert!=null){if(typeof Z.insert=="string"){var re=Z.insert;re.endsWith(`
127
- `)&&$&&($=!1,re=re.slice(0,-1)),G>=ee&&!re.endsWith(`
128
- `)&&($=!0),U.scroll.insertAt(G,re);var ie=U.scroll.line(G),ae=s(ie,2),se=ae[0],de=ae[1],he=(0,A.default)({},(0,g.bubbleFormats)(se));if(se instanceof y.default){var Oe=se.descendant(v.default.Leaf,de),_e=s(Oe,1),Ae=_e[0];he=(0,A.default)(he,(0,g.bubbleFormats)(Ae))}te=E.default.attributes.diff(he,te)||{}}else if(l(Z.insert)==="object"){var ce=Object.keys(Z.insert)[0];if(ce==null)return G;U.scroll.insertAt(G,ce,Z.insert[ce])}ee+=W}return Object.keys(te).forEach(function(pe){U.scroll.formatAt(G,W,pe,te[pe])}),G+W},0),N.reduce(function(G,Z){return typeof Z.delete=="number"?(U.scroll.deleteAt(G,Z.delete),G):G+(Z.retain||Z.insert.length||1)},0),this.scroll.batchEnd(),this.update(N)}},{key:"deleteText",value:function(N,U){return this.scroll.deleteAt(N,U),this.update(new w.default().retain(N).delete(U))}},{key:"formatLine",value:function(N,U){var $=this,ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(ee).forEach(function(G){if(!($.scroll.whitelist!=null&&!$.scroll.whitelist[G])){var Z=$.scroll.lines(N,Math.max(U,1)),W=U;Z.forEach(function(te){var re=te.length();if(!(te instanceof p.default))te.format(G,ee[G]);else{var ie=N-te.offset($.scroll),ae=te.newlineIndex(ie+W)-ie+1;te.formatAt(ie,ae,G,ee[G])}W-=re})}}),this.scroll.optimize(),this.update(new w.default().retain(N).retain(U,(0,T.default)(ee)))}},{key:"formatText",value:function(N,U){var $=this,ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(ee).forEach(function(G){$.scroll.formatAt(N,U,G,ee[G])}),this.update(new w.default().retain(N).retain(U,(0,T.default)(ee)))}},{key:"getContents",value:function(N,U){return this.delta.slice(N,N+U)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(N,U){return N.concat(U.delta())},new w.default)}},{key:"getFormat",value:function(N){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,$=[],ee=[];U===0?this.scroll.path(N).forEach(function(Z){var W=s(Z,1),te=W[0];te instanceof y.default?$.push(te):te instanceof v.default.Leaf&&ee.push(te)}):($=this.scroll.lines(N,U),ee=this.scroll.descendants(v.default.Leaf,N,U));var G=[$,ee].map(function(Z){if(Z.length===0)return{};for(var W=(0,g.bubbleFormats)(Z.shift());Object.keys(W).length>0;){var te=Z.shift();if(te==null)return W;W=Y((0,g.bubbleFormats)(te),W)}return W});return A.default.apply(A.default,G)}},{key:"getText",value:function(N,U){return this.getContents(N,U).filter(function($){return typeof $.insert=="string"}).map(function($){return $.insert}).join("")}},{key:"insertEmbed",value:function(N,U,$){return this.scroll.insertAt(N,U,$),this.update(new w.default().retain(N).insert(k({},U,$)))}},{key:"insertText",value:function(N,U){var $=this,ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return U=U.replace(/\r\n/g,`
129
- `).replace(/\r/g,`
130
- `),this.scroll.insertAt(N,U),Object.keys(ee).forEach(function(G){$.scroll.formatAt(N,U.length,G,ee[G])}),this.update(new w.default().retain(N).insert(U,(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 N=this.scroll.children.head;return N.statics.blotName!==y.default.blotName||N.children.length>1?!1:N.children.head instanceof x.default}},{key:"removeFormat",value:function(N,U){var $=this.getText(N,U),ee=this.scroll.line(N+U),G=s(ee,2),Z=G[0],W=G[1],te=0,re=new w.default;Z!=null&&(Z instanceof p.default?te=Z.newlineIndex(W)-W+1:te=Z.length()-W,re=Z.delta().slice(W,W+te-1).insert(`
131
- `));var ie=this.getContents(N,U+te),ae=ie.diff(new w.default().insert($).concat(re)),se=new w.default().retain(N).concat(ae);return this.applyDelta(se)}},{key:"update",value:function(N){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,ee=this.delta;if(U.length===1&&U[0].type==="characterData"&&U[0].target.data.match(B)&&v.default.find(U[0].target)){var G=v.default.find(U[0].target),Z=(0,g.bubbleFormats)(G),W=G.offset(this.scroll),te=U[0].oldValue.replace(P.default.CONTENTS,""),re=new w.default().insert(te),ie=new w.default().insert(G.value()),ae=new w.default().retain(W).concat(re.diff(ie,$));N=ae.reduce(function(se,de){return de.insert?se.insert(de.insert,Z):se.push(de)},new w.default),this.delta=ee.compose(N)}else this.delta=this.getDelta(),(!N||!(0,I.default)(ee.compose(N),this.delta))&&(N=ee.diff(this.delta,$));return N}}]),q}();function Y(q,z){return Object.keys(z).reduce(function(N,U){return q[U]==null||(z[U]===q[U]?N[U]=z[U]:Array.isArray(z[U])?z[U].indexOf(q[U])<0&&(N[U]=z[U].concat([q[U]])):N[U]=[z[U],q[U]]),N},{})}function Q(q){return q.reduce(function(z,N){if(N.insert===1){var U=(0,T.default)(N.attributes);return delete U.image,z.insert({image:N.attributes.image},U)}if(N.attributes!=null&&(N.attributes.list===!0||N.attributes.bullet===!0)&&(N=(0,T.default)(N),N.attributes.list?N.attributes.list="ordered":(N.attributes.list="bullet",delete N.attributes.bullet)),typeof N.insert=="string"){var $=N.insert.replace(/\r\n/g,`
132
- `).replace(/\r/g,`
133
- `);return z.insert($,N.attributes)}return z.push(N)},new w.default)}n.default=X},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var l=function(){function j(I,m){var A=[],L=!0,k=!1,R=void 0;try{for(var B=I[Symbol.iterator](),X;!(L=(X=B.next()).done)&&(A.push(X.value),!(m&&A.length===m));L=!0);}catch(Y){k=!0,R=Y}finally{try{!L&&B.return&&B.return()}finally{if(k)throw R}}return A}return function(I,m){if(Array.isArray(I))return I;if(Symbol.iterator in Object(I))return j(I,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function j(I,m){for(var A=0;A<m.length;A++){var L=m[A];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(I,L.key,L)}}return function(I,m,A){return m&&j(I.prototype,m),A&&j(I,A),I}}(),c=a(0),d=P(c),w=a(21),_=P(w),E=a(11),O=P(E),v=a(8),S=P(v),p=a(10),h=P(p);function P(j){return j&&j.__esModule?j:{default:j}}function g(j){if(Array.isArray(j)){for(var I=0,m=Array(j.length);I<j.length;I++)m[I]=j[I];return m}else return Array.from(j)}function y(j,I){if(!(j instanceof I))throw new TypeError("Cannot call a class as a function")}var b=(0,h.default)("quill:selection"),x=function j(I){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;y(this,j),this.index=I,this.length=m},M=function(){function j(I,m){var A=this;y(this,j),this.emitter=m,this.scroll=I,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=d.default.create("cursor",this),this.lastRange=this.savedRange=new x(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){A.mouseDown||setTimeout(A.update.bind(A,S.default.sources.USER),1)}),this.emitter.on(S.default.events.EDITOR_CHANGE,function(L,k){L===S.default.events.TEXT_CHANGE&&k.length()>0&&A.update(S.default.sources.SILENT)}),this.emitter.on(S.default.events.SCROLL_BEFORE_UPDATE,function(){if(A.hasFocus()){var L=A.getNativeRange();L!=null&&L.start.node!==A.cursor.textNode&&A.emitter.once(S.default.events.SCROLL_UPDATE,function(){try{A.setNativeRange(L.start.node,L.start.offset,L.end.node,L.end.offset)}catch{}})}}),this.emitter.on(S.default.events.SCROLL_OPTIMIZE,function(L,k){if(k.range){var R=k.range,B=R.startNode,X=R.startOffset,Y=R.endNode,Q=R.endOffset;A.setNativeRange(B,X,Y,Q)}}),this.update(S.default.sources.SILENT)}return s(j,[{key:"handleComposition",value:function(){var m=this;this.root.addEventListener("compositionstart",function(){m.composing=!0}),this.root.addEventListener("compositionend",function(){if(m.composing=!1,m.cursor.parent){var A=m.cursor.restore();if(!A)return;setTimeout(function(){m.setNativeRange(A.startNode,A.startOffset,A.endNode,A.endOffset)},1)}})}},{key:"handleDragging",value:function(){var m=this;this.emitter.listenDOM("mousedown",document.body,function(){m.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){m.mouseDown=!1,m.update(S.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(m,A){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[m])){this.scroll.update();var L=this.getNativeRange();if(!(L==null||!L.native.collapsed||d.default.query(m,d.default.Scope.BLOCK))){if(L.start.node!==this.cursor.textNode){var k=d.default.find(L.start.node,!1);if(k==null)return;if(k instanceof d.default.Leaf){var R=k.split(L.start.offset);k.parent.insertBefore(this.cursor,R)}else k.insertBefore(this.cursor,L.start.node);this.cursor.attach()}this.cursor.format(m,A),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(m){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,L=this.scroll.length();m=Math.min(m,L-1),A=Math.min(m+A,L-1)-m;var k=void 0,R=this.scroll.leaf(m),B=l(R,2),X=B[0],Y=B[1];if(X==null)return null;var Q=X.position(Y,!0),q=l(Q,2);k=q[0],Y=q[1];var z=document.createRange();if(A>0){z.setStart(k,Y);var N=this.scroll.leaf(m+A),U=l(N,2);if(X=U[0],Y=U[1],X==null)return null;var $=X.position(Y,!0),ee=l($,2);return k=ee[0],Y=ee[1],z.setEnd(k,Y),z.getBoundingClientRect()}else{var G="left",Z=void 0;return k instanceof Text?(Y<k.data.length?(z.setStart(k,Y),z.setEnd(k,Y+1)):(z.setStart(k,Y-1),z.setEnd(k,Y),G="right"),Z=z.getBoundingClientRect()):(Z=X.domNode.getBoundingClientRect(),Y>0&&(G="right")),{bottom:Z.top+Z.height,height:Z.height,left:Z[G],right:Z[G],top:Z.top,width:0}}}},{key:"getNativeRange",value:function(){var m=document.getSelection();if(m==null||m.rangeCount<=0)return null;var A=m.getRangeAt(0);if(A==null)return null;var L=this.normalizeNative(A);return b.info("getNativeRange",L),L}},{key:"getRange",value:function(){var m=this.getNativeRange();if(m==null)return[null,null];var A=this.normalizedToRange(m);return[A,m]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(m){var A=this,L=[[m.start.node,m.start.offset]];m.native.collapsed||L.push([m.end.node,m.end.offset]);var k=L.map(function(X){var Y=l(X,2),Q=Y[0],q=Y[1],z=d.default.find(Q,!0),N=z.offset(A.scroll);return q===0?N:z instanceof d.default.Container?N+z.length():N+z.index(Q,q)}),R=Math.min(Math.max.apply(Math,g(k)),this.scroll.length()-1),B=Math.min.apply(Math,[R].concat(g(k)));return new x(B,R-B)}},{key:"normalizeNative",value:function(m){if(!T(this.root,m.startContainer)||!m.collapsed&&!T(this.root,m.endContainer))return null;var A={start:{node:m.startContainer,offset:m.startOffset},end:{node:m.endContainer,offset:m.endOffset},native:m};return[A.start,A.end].forEach(function(L){for(var k=L.node,R=L.offset;!(k instanceof Text)&&k.childNodes.length>0;)if(k.childNodes.length>R)k=k.childNodes[R],R=0;else if(k.childNodes.length===R)k=k.lastChild,R=k instanceof Text?k.data.length:k.childNodes.length+1;else break;L.node=k,L.offset=R}),A}},{key:"rangeToNative",value:function(m){var A=this,L=m.collapsed?[m.index]:[m.index,m.index+m.length],k=[],R=this.scroll.length();return L.forEach(function(B,X){B=Math.min(R-1,B);var Y=void 0,Q=A.scroll.leaf(B),q=l(Q,2),z=q[0],N=q[1],U=z.position(N,X!==0),$=l(U,2);Y=$[0],N=$[1],k.push(Y,N)}),k.length<2&&(k=k.concat(k)),k}},{key:"scrollIntoView",value:function(m){var A=this.lastRange;if(A!=null){var L=this.getBounds(A.index,A.length);if(L!=null){var k=this.scroll.length()-1,R=this.scroll.line(Math.min(A.index,k)),B=l(R,1),X=B[0],Y=X;if(A.length>0){var Q=this.scroll.line(Math.min(A.index+A.length,k)),q=l(Q,1);Y=q[0]}if(!(X==null||Y==null)){var z=m.getBoundingClientRect();L.top<z.top?m.scrollTop-=z.top-L.top:L.bottom>z.bottom&&(m.scrollTop+=L.bottom-z.bottom)}}}}},{key:"setNativeRange",value:function(m,A){var L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:m,k=arguments.length>3&&arguments[3]!==void 0?arguments[3]:A,R=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(b.info("setNativeRange",m,A,L,k),!(m!=null&&(this.root.parentNode==null||m.parentNode==null||L.parentNode==null))){var B=document.getSelection();if(B!=null)if(m!=null){this.hasFocus()||this.root.focus();var X=(this.getNativeRange()||{}).native;if(X==null||R||m!==X.startContainer||A!==X.startOffset||L!==X.endContainer||k!==X.endOffset){m.tagName=="BR"&&(A=[].indexOf.call(m.parentNode.childNodes,m),m=m.parentNode),L.tagName=="BR"&&(k=[].indexOf.call(L.parentNode.childNodes,L),L=L.parentNode);var Y=document.createRange();Y.setStart(m,A),Y.setEnd(L,k),B.removeAllRanges(),B.addRange(Y)}}else B.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(m){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:S.default.sources.API;if(typeof A=="string"&&(L=A,A=!1),b.info("setRange",m),m!=null){var k=this.rangeToNative(m);this.setNativeRange.apply(this,g(k).concat([A]))}else this.setNativeRange(null);this.update(L)}},{key:"update",value:function(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:S.default.sources.USER,A=this.lastRange,L=this.getRange(),k=l(L,2),R=k[0],B=k[1];if(this.lastRange=R,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,O.default)(A,this.lastRange)){var X;!this.composing&&B!=null&&B.native.collapsed&&B.start.node!==this.cursor.textNode&&this.cursor.restore();var Y=[S.default.events.SELECTION_CHANGE,(0,_.default)(this.lastRange),(0,_.default)(A),m];if((X=this.emitter).emit.apply(X,[S.default.events.EDITOR_CHANGE].concat(Y)),m!==S.default.sources.SILENT){var Q;(Q=this.emitter).emit.apply(Q,Y)}}}}]),j}();function T(j,I){try{I.parentNode}catch{return!1}return I instanceof Text&&(I=I.parentNode),j.contains(I)}n.Range=x,n.default=M},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function S(p,h){for(var P=0;P<h.length;P++){var g=h[P];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(p,g.key,g)}}return function(p,h,P){return h&&S(p.prototype,h),P&&S(p,P),p}}(),s=function S(p,h,P){p===null&&(p=Function.prototype);var g=Object.getOwnPropertyDescriptor(p,h);if(g===void 0){var y=Object.getPrototypeOf(p);return y===null?void 0:S(y,h,P)}else{if("value"in g)return g.value;var b=g.get;return b===void 0?void 0:b.call(P)}},c=a(0),d=w(c);function w(S){return S&&S.__esModule?S:{default:S}}function _(S,p){if(!(S instanceof p))throw new TypeError("Cannot call a class as a function")}function E(S,p){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:S}function O(S,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);S.prototype=Object.create(p&&p.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(S,p):S.__proto__=p)}var v=function(S){O(p,S);function p(){return _(this,p),E(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return l(p,[{key:"insertInto",value:function(P,g){P.children.length===0?s(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"insertInto",this).call(this,P,g):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),p}(d.default.Embed);v.blotName="break",v.tagName="BR",n.default=v},function(t,n,a){var l=this&&this.__extends||function(){var E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,v){O.__proto__=v}||function(O,v){for(var S in v)v.hasOwnProperty(S)&&(O[S]=v[S])};return function(O,v){E(O,v);function S(){this.constructor=O}O.prototype=v===null?Object.create(v):(S.prototype=v.prototype,new S)}}();Object.defineProperty(n,"__esModule",{value:!0});var s=a(44),c=a(30),d=a(1),w=function(E){l(O,E);function O(v){var S=E.call(this,v)||this;return S.build(),S}return O.prototype.appendChild=function(v){this.insertBefore(v)},O.prototype.attach=function(){E.prototype.attach.call(this),this.children.forEach(function(v){v.attach()})},O.prototype.build=function(){var v=this;this.children=new s.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(S){try{var p=_(S);v.insertBefore(p,v.children.head||void 0)}catch(h){if(h instanceof d.ParchmentError)return;throw h}})},O.prototype.deleteAt=function(v,S){if(v===0&&S===this.length())return this.remove();this.children.forEachAt(v,S,function(p,h,P){p.deleteAt(h,P)})},O.prototype.descendant=function(v,S){var p=this.children.find(S),h=p[0],P=p[1];return v.blotName==null&&v(h)||v.blotName!=null&&h instanceof v?[h,P]:h instanceof O?h.descendant(v,P):[null,-1]},O.prototype.descendants=function(v,S,p){S===void 0&&(S=0),p===void 0&&(p=Number.MAX_VALUE);var h=[],P=p;return this.children.forEachAt(S,p,function(g,y,b){(v.blotName==null&&v(g)||v.blotName!=null&&g instanceof v)&&h.push(g),g instanceof O&&(h=h.concat(g.descendants(v,y,P))),P-=b}),h},O.prototype.detach=function(){this.children.forEach(function(v){v.detach()}),E.prototype.detach.call(this)},O.prototype.formatAt=function(v,S,p,h){this.children.forEachAt(v,S,function(P,g,y){P.formatAt(g,y,p,h)})},O.prototype.insertAt=function(v,S,p){var h=this.children.find(v),P=h[0],g=h[1];if(P)P.insertAt(g,S,p);else{var y=p==null?d.create("text",S):d.create(S,p);this.appendChild(y)}},O.prototype.insertBefore=function(v,S){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(p){return v instanceof p}))throw new d.ParchmentError("Cannot insert "+v.statics.blotName+" into "+this.statics.blotName);v.insertInto(this,S)},O.prototype.length=function(){return this.children.reduce(function(v,S){return v+S.length()},0)},O.prototype.moveChildren=function(v,S){this.children.forEach(function(p){v.insertBefore(p,S)})},O.prototype.optimize=function(v){if(E.prototype.optimize.call(this,v),this.children.length===0)if(this.statics.defaultChild!=null){var S=d.create(this.statics.defaultChild);this.appendChild(S),S.optimize(v)}else this.remove()},O.prototype.path=function(v,S){S===void 0&&(S=!1);var p=this.children.find(v,S),h=p[0],P=p[1],g=[[this,v]];return h instanceof O?g.concat(h.path(P,S)):(h!=null&&g.push([h,P]),g)},O.prototype.removeChild=function(v){this.children.remove(v)},O.prototype.replace=function(v){v instanceof O&&v.moveChildren(this),E.prototype.replace.call(this,v)},O.prototype.split=function(v,S){if(S===void 0&&(S=!1),!S){if(v===0)return this;if(v===this.length())return this.next}var p=this.clone();return this.parent.insertBefore(p,this.next),this.children.forEachAt(v,this.length(),function(h,P,g){h=h.split(P,S),p.appendChild(h)}),p},O.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},O.prototype.update=function(v,S){var p=this,h=[],P=[];v.forEach(function(g){g.target===p.domNode&&g.type==="childList"&&(h.push.apply(h,g.addedNodes),P.push.apply(P,g.removedNodes))}),P.forEach(function(g){if(!(g.parentNode!=null&&g.tagName!=="IFRAME"&&document.body.compareDocumentPosition(g)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var y=d.find(g);y!=null&&(y.domNode.parentNode==null||y.domNode.parentNode===p.domNode)&&y.detach()}}),h.filter(function(g){return g.parentNode==p.domNode}).sort(function(g,y){return g===y?0:g.compareDocumentPosition(y)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(g){var y=null;g.nextSibling!=null&&(y=d.find(g.nextSibling));var b=_(g);(b.next!=y||b.next==null)&&(b.parent!=null&&b.parent.removeChild(p),p.insertBefore(b,y||void 0))})},O}(c.default);function _(E){var O=d.find(E);if(O==null)try{O=d.create(E)}catch{O=d.create(d.Scope.INLINE),[].slice.call(E.childNodes).forEach(function(S){O.domNode.appendChild(S)}),E.parentNode&&E.parentNode.replaceChild(O.domNode,E),O.attach()}return O}n.default=w},function(t,n,a){var l=this&&this.__extends||function(){var E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,v){O.__proto__=v}||function(O,v){for(var S in v)v.hasOwnProperty(S)&&(O[S]=v[S])};return function(O,v){E(O,v);function S(){this.constructor=O}O.prototype=v===null?Object.create(v):(S.prototype=v.prototype,new S)}}();Object.defineProperty(n,"__esModule",{value:!0});var s=a(12),c=a(31),d=a(17),w=a(1),_=function(E){l(O,E);function O(v){var S=E.call(this,v)||this;return S.attributes=new c.default(S.domNode),S}return O.formats=function(v){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return v.tagName.toLowerCase()},O.prototype.format=function(v,S){var p=w.query(v);p instanceof s.default?this.attributes.attribute(p,S):S&&p!=null&&(v!==this.statics.blotName||this.formats()[v]!==S)&&this.replaceWith(v,S)},O.prototype.formats=function(){var v=this.attributes.values(),S=this.statics.formats(this.domNode);return S!=null&&(v[this.statics.blotName]=S),v},O.prototype.replaceWith=function(v,S){var p=E.prototype.replaceWith.call(this,v,S);return this.attributes.copy(p),p},O.prototype.update=function(v,S){var p=this;E.prototype.update.call(this,v,S),v.some(function(h){return h.target===p.domNode&&h.type==="attributes"})&&this.attributes.build()},O.prototype.wrap=function(v,S){var p=E.prototype.wrap.call(this,v,S);return p instanceof O&&p.statics.scope===this.statics.scope&&this.attributes.move(p),p},O}(d.default);n.default=_},function(t,n,a){var l=this&&this.__extends||function(){var w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,E){_.__proto__=E}||function(_,E){for(var O in E)E.hasOwnProperty(O)&&(_[O]=E[O])};return function(_,E){w(_,E);function O(){this.constructor=_}_.prototype=E===null?Object.create(E):(O.prototype=E.prototype,new O)}}();Object.defineProperty(n,"__esModule",{value:!0});var s=a(30),c=a(1),d=function(w){l(_,w);function _(){return w!==null&&w.apply(this,arguments)||this}return _.value=function(E){return!0},_.prototype.index=function(E,O){return this.domNode===E||this.domNode.compareDocumentPosition(E)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(O,1):-1},_.prototype.position=function(E,O){var v=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return E>0&&(v+=1),[this.parent.domNode,v]},_.prototype.value=function(){var E;return E={},E[this.statics.blotName]=this.statics.value(this.domNode)||!0,E},_.scope=c.Scope.INLINE_BLOT,_}(s.default);n.default=d},function(t,n,a){var l=a(11),s=a(3),c={attributes:{compose:function(w,_,E){typeof w!="object"&&(w={}),typeof _!="object"&&(_={});var O=s(!0,{},_);E||(O=Object.keys(O).reduce(function(S,p){return O[p]!=null&&(S[p]=O[p]),S},{}));for(var v in w)w[v]!==void 0&&_[v]===void 0&&(O[v]=w[v]);return Object.keys(O).length>0?O:void 0},diff:function(w,_){typeof w!="object"&&(w={}),typeof _!="object"&&(_={});var E=Object.keys(w).concat(Object.keys(_)).reduce(function(O,v){return l(w[v],_[v])||(O[v]=_[v]===void 0?null:_[v]),O},{});return Object.keys(E).length>0?E:void 0},transform:function(w,_,E){if(typeof w!="object")return _;if(typeof _=="object"){if(!E)return _;var O=Object.keys(_).reduce(function(v,S){return w[S]===void 0&&(v[S]=_[S]),v},{});return Object.keys(O).length>0?O:void 0}}},iterator:function(w){return new d(w)},length:function(w){return typeof w.delete=="number"?w.delete:typeof w.retain=="number"?w.retain:typeof w.insert=="string"?w.insert.length:1}};function d(w){this.ops=w,this.index=0,this.offset=0}d.prototype.hasNext=function(){return this.peekLength()<1/0},d.prototype.next=function(w){w||(w=1/0);var _=this.ops[this.index];if(_){var E=this.offset,O=c.length(_);if(w>=O-E?(w=O-E,this.index+=1,this.offset=0):this.offset+=w,typeof _.delete=="number")return{delete:w};var v={};return _.attributes&&(v.attributes=_.attributes),typeof _.retain=="number"?v.retain=w:typeof _.insert=="string"?v.insert=_.insert.substr(E,w):v.insert=_.insert,v}else return{retain:1/0}},d.prototype.peek=function(){return this.ops[this.index]},d.prototype.peekLength=function(){return this.ops[this.index]?c.length(this.ops[this.index])-this.offset:1/0},d.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"},d.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var w=this.offset,_=this.index,E=this.next(),O=this.ops.slice(this.index);return this.offset=w,this.index=_,[E].concat(O)}else return[]},t.exports=c},function(t,n){var a=function(){function l(p,h){return h!=null&&p instanceof h}var s;try{s=Map}catch{s=function(){}}var c;try{c=Set}catch{c=function(){}}var d;try{d=Promise}catch{d=function(){}}function w(p,h,P,g,y){typeof h=="object"&&(P=h.depth,g=h.prototype,y=h.includeNonEnumerable,h=h.circular);var b=[],x=[],M=typeof Buffer<"u";typeof h>"u"&&(h=!0),typeof P>"u"&&(P=1/0);function T(j,I){if(j===null)return null;if(I===0)return j;var m,A;if(typeof j!="object")return j;if(l(j,s))m=new s;else if(l(j,c))m=new c;else if(l(j,d))m=new d(function(z,N){j.then(function(U){z(T(U,I-1))},function(U){N(T(U,I-1))})});else if(w.__isArray(j))m=[];else if(w.__isRegExp(j))m=new RegExp(j.source,S(j)),j.lastIndex&&(m.lastIndex=j.lastIndex);else if(w.__isDate(j))m=new Date(j.getTime());else{if(M&&Buffer.isBuffer(j))return Buffer.allocUnsafe?m=Buffer.allocUnsafe(j.length):m=new Buffer(j.length),j.copy(m),m;l(j,Error)?m=Object.create(j):typeof g>"u"?(A=Object.getPrototypeOf(j),m=Object.create(A)):(m=Object.create(g),A=g)}if(h){var L=b.indexOf(j);if(L!=-1)return x[L];b.push(j),x.push(m)}l(j,s)&&j.forEach(function(z,N){var U=T(N,I-1),$=T(z,I-1);m.set(U,$)}),l(j,c)&&j.forEach(function(z){var N=T(z,I-1);m.add(N)});for(var k in j){var R;A&&(R=Object.getOwnPropertyDescriptor(A,k)),!(R&&R.set==null)&&(m[k]=T(j[k],I-1))}if(Object.getOwnPropertySymbols)for(var B=Object.getOwnPropertySymbols(j),k=0;k<B.length;k++){var X=B[k],Y=Object.getOwnPropertyDescriptor(j,X);Y&&!Y.enumerable&&!y||(m[X]=T(j[X],I-1),Y.enumerable||Object.defineProperty(m,X,{enumerable:!1}))}if(y)for(var Q=Object.getOwnPropertyNames(j),k=0;k<Q.length;k++){var q=Q[k],Y=Object.getOwnPropertyDescriptor(j,q);Y&&Y.enumerable||(m[q]=T(j[q],I-1),Object.defineProperty(m,q,{enumerable:!1}))}return m}return T(p,P)}w.clonePrototype=function(h){if(h===null)return null;var P=function(){};return P.prototype=h,new P};function _(p){return Object.prototype.toString.call(p)}w.__objToStr=_;function E(p){return typeof p=="object"&&_(p)==="[object Date]"}w.__isDate=E;function O(p){return typeof p=="object"&&_(p)==="[object Array]"}w.__isArray=O;function v(p){return typeof p=="object"&&_(p)==="[object RegExp]"}w.__isRegExp=v;function S(p){var h="";return p.global&&(h+="g"),p.ignoreCase&&(h+="i"),p.multiline&&(h+="m"),h}return w.__getRegExpFlags=S,w}();typeof t=="object"&&t.exports&&(t.exports=a)},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function m(A,L){var k=[],R=!0,B=!1,X=void 0;try{for(var Y=A[Symbol.iterator](),Q;!(R=(Q=Y.next()).done)&&(k.push(Q.value),!(L&&k.length===L));R=!0);}catch(q){B=!0,X=q}finally{try{!R&&Y.return&&Y.return()}finally{if(B)throw X}}return k}return function(A,L){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return m(A,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function m(A,L){for(var k=0;k<L.length;k++){var R=L[k];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(A,R.key,R)}}return function(A,L,k){return L&&m(A.prototype,L),k&&m(A,k),A}}(),c=function m(A,L,k){A===null&&(A=Function.prototype);var R=Object.getOwnPropertyDescriptor(A,L);if(R===void 0){var B=Object.getPrototypeOf(A);return B===null?void 0:m(B,L,k)}else{if("value"in R)return R.value;var X=R.get;return X===void 0?void 0:X.call(k)}},d=a(0),w=b(d),_=a(8),E=b(_),O=a(4),v=b(O),S=a(16),p=b(S),h=a(13),P=b(h),g=a(25),y=b(g);function b(m){return m&&m.__esModule?m:{default:m}}function x(m,A){if(!(m instanceof A))throw new TypeError("Cannot call a class as a function")}function M(m,A){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:m}function T(m,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);m.prototype=Object.create(A&&A.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(m,A):m.__proto__=A)}function j(m){return m instanceof v.default||m instanceof O.BlockEmbed}var I=function(m){T(A,m);function A(L,k){x(this,A);var R=M(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,L));return R.emitter=k.emitter,Array.isArray(k.whitelist)&&(R.whitelist=k.whitelist.reduce(function(B,X){return B[X]=!0,B},{})),R.domNode.addEventListener("DOMNodeInserted",function(){}),R.optimize(),R.enable(),R}return s(A,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(k,R){var B=this.line(k),X=l(B,2),Y=X[0],Q=X[1],q=this.line(k+R),z=l(q,1),N=z[0];if(c(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"deleteAt",this).call(this,k,R),N!=null&&Y!==N&&Q>0){if(Y instanceof O.BlockEmbed||N instanceof O.BlockEmbed){this.optimize();return}if(Y instanceof P.default){var U=Y.newlineIndex(Y.length(),!0);if(U>-1&&(Y=Y.split(U+1),Y===N)){this.optimize();return}}else if(N instanceof P.default){var $=N.newlineIndex(0);$>-1&&N.split($+1)}var ee=N.children.head instanceof p.default?null:N.children.head;Y.moveChildren(N,ee),Y.remove()}this.optimize()}},{key:"enable",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",k)}},{key:"formatAt",value:function(k,R,B,X){this.whitelist!=null&&!this.whitelist[B]||(c(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"formatAt",this).call(this,k,R,B,X),this.optimize())}},{key:"insertAt",value:function(k,R,B){if(!(B!=null&&this.whitelist!=null&&!this.whitelist[R])){if(k>=this.length())if(B==null||w.default.query(R,w.default.Scope.BLOCK)==null){var X=w.default.create(this.statics.defaultChild);this.appendChild(X),B==null&&R.endsWith(`
134
- `)&&(R=R.slice(0,-1)),X.insertAt(0,R,B)}else{var Y=w.default.create(R,B);this.appendChild(Y)}else c(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertAt",this).call(this,k,R,B);this.optimize()}}},{key:"insertBefore",value:function(k,R){if(k.statics.scope===w.default.Scope.INLINE_BLOT){var B=w.default.create(this.statics.defaultChild);B.appendChild(k),k=B}c(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertBefore",this).call(this,k,R)}},{key:"leaf",value:function(k){return this.path(k).pop()||[null,-1]}},{key:"line",value:function(k){return k===this.length()?this.line(k-1):this.descendant(j,k)}},{key:"lines",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,B=function X(Y,Q,q){var z=[],N=q;return Y.children.forEachAt(Q,q,function(U,$,ee){j(U)?z.push(U):U instanceof w.default.Container&&(z=z.concat(X(U,$,N))),N-=ee}),z};return B(this,k,R)}},{key:"optimize",value:function(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(c(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"optimize",this).call(this,k,R),k.length>0&&this.emitter.emit(E.default.events.SCROLL_OPTIMIZE,k,R))}},{key:"path",value:function(k){return c(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"path",this).call(this,k).slice(1)}},{key:"update",value:function(k){if(this.batch!==!0){var R=E.default.sources.USER;typeof k=="string"&&(R=k),Array.isArray(k)||(k=this.observer.takeRecords()),k.length>0&&this.emitter.emit(E.default.events.SCROLL_BEFORE_UPDATE,R,k),c(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"update",this).call(this,k.concat([])),k.length>0&&this.emitter.emit(E.default.events.SCROLL_UPDATE,R,k)}}}]),A}(w.default.Scroll);I.blotName="scroll",I.className="ql-editor",I.tagName="DIV",I.defaultChild="block",I.allowedChildren=[v.default,O.BlockEmbed,y.default],n.default=I},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.SHORTKEY=n.default=void 0;var l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Z){return typeof Z}:function(Z){return Z&&typeof Symbol=="function"&&Z.constructor===Symbol&&Z!==Symbol.prototype?"symbol":typeof Z},s=function(){function Z(W,te){var re=[],ie=!0,ae=!1,se=void 0;try{for(var de=W[Symbol.iterator](),he;!(ie=(he=de.next()).done)&&(re.push(he.value),!(te&&re.length===te));ie=!0);}catch(Oe){ae=!0,se=Oe}finally{try{!ie&&de.return&&de.return()}finally{if(ae)throw se}}return re}return function(W,te){if(Array.isArray(W))return W;if(Symbol.iterator in Object(W))return Z(W,te);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function Z(W,te){for(var re=0;re<te.length;re++){var ie=te[re];ie.enumerable=ie.enumerable||!1,ie.configurable=!0,"value"in ie&&(ie.writable=!0),Object.defineProperty(W,ie.key,ie)}}return function(W,te,re){return te&&Z(W.prototype,te),re&&Z(W,re),W}}(),d=a(21),w=m(d),_=a(11),E=m(_),O=a(3),v=m(O),S=a(2),p=m(S),h=a(20),P=m(h),g=a(0),y=m(g),b=a(5),x=m(b),M=a(10),T=m(M),j=a(9),I=m(j);function m(Z){return Z&&Z.__esModule?Z:{default:Z}}function A(Z,W,te){return W in Z?Object.defineProperty(Z,W,{value:te,enumerable:!0,configurable:!0,writable:!0}):Z[W]=te,Z}function L(Z,W){if(!(Z instanceof W))throw new TypeError("Cannot call a class as a function")}function k(Z,W){if(!Z)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return W&&(typeof W=="object"||typeof W=="function")?W:Z}function R(Z,W){if(typeof W!="function"&&W!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof W);Z.prototype=Object.create(W&&W.prototype,{constructor:{value:Z,enumerable:!1,writable:!0,configurable:!0}}),W&&(Object.setPrototypeOf?Object.setPrototypeOf(Z,W):Z.__proto__=W)}var B=(0,T.default)("quill:keyboard"),X=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",Y=function(Z){R(W,Z),c(W,null,[{key:"match",value:function(re,ie){return ie=G(ie),["altKey","ctrlKey","metaKey","shiftKey"].some(function(ae){return!!ie[ae]!==re[ae]&&ie[ae]!==null})?!1:ie.key===(re.which||re.keyCode)}}]);function W(te,re){L(this,W);var ie=k(this,(W.__proto__||Object.getPrototypeOf(W)).call(this,te,re));return ie.bindings={},Object.keys(ie.options.bindings).forEach(function(ae){ae==="list autofill"&&te.scroll.whitelist!=null&&!te.scroll.whitelist.list||ie.options.bindings[ae]&&ie.addBinding(ie.options.bindings[ae])}),ie.addBinding({key:W.keys.ENTER,shiftKey:null},U),ie.addBinding({key:W.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(ie.addBinding({key:W.keys.BACKSPACE},{collapsed:!0},q),ie.addBinding({key:W.keys.DELETE},{collapsed:!0},z)):(ie.addBinding({key:W.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},q),ie.addBinding({key:W.keys.DELETE},{collapsed:!0,suffix:/^.?$/},z)),ie.addBinding({key:W.keys.BACKSPACE},{collapsed:!1},N),ie.addBinding({key:W.keys.DELETE},{collapsed:!1},N),ie.addBinding({key:W.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},q),ie.listen(),ie}return c(W,[{key:"addBinding",value:function(re){var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ae=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},se=G(re);if(se==null||se.key==null)return B.warn("Attempted to add invalid keyboard binding",se);typeof ie=="function"&&(ie={handler:ie}),typeof ae=="function"&&(ae={handler:ae}),se=(0,v.default)(se,ie,ae),this.bindings[se.key]=this.bindings[se.key]||[],this.bindings[se.key].push(se)}},{key:"listen",value:function(){var re=this;this.quill.root.addEventListener("keydown",function(ie){if(!ie.defaultPrevented){var ae=ie.which||ie.keyCode,se=(re.bindings[ae]||[]).filter(function(ze){return W.match(ie,ze)});if(se.length!==0){var de=re.quill.getSelection();if(!(de==null||!re.quill.hasFocus())){var he=re.quill.getLine(de.index),Oe=s(he,2),_e=Oe[0],Ae=Oe[1],ce=re.quill.getLeaf(de.index),pe=s(ce,2),Ce=pe[0],Le=pe[1],ue=de.length===0?[Ce,Le]:re.quill.getLeaf(de.index+de.length),ve=s(ue,2),xe=ve[0],je=ve[1],at=Ce instanceof y.default.Text?Ce.value().slice(0,Le):"",ht=xe instanceof y.default.Text?xe.value().slice(je):"",et={collapsed:de.length===0,empty:de.length===0&&_e.length()<=1,format:re.quill.getFormat(de),offset:Ae,prefix:at,suffix:ht},Ke=se.some(function(ze){if(ze.collapsed!=null&&ze.collapsed!==et.collapsed||ze.empty!=null&&ze.empty!==et.empty||ze.offset!=null&&ze.offset!==et.offset)return!1;if(Array.isArray(ze.format)){if(ze.format.every(function(Be){return et.format[Be]==null}))return!1}else if(l(ze.format)==="object"&&!Object.keys(ze.format).every(function(Be){return ze.format[Be]===!0?et.format[Be]!=null:ze.format[Be]===!1?et.format[Be]==null:(0,E.default)(ze.format[Be],et.format[Be])}))return!1;return ze.prefix!=null&&!ze.prefix.test(et.prefix)||ze.suffix!=null&&!ze.suffix.test(et.suffix)?!1:ze.handler.call(re,de,et)!==!0});Ke&&ie.preventDefault()}}}})}}]),W}(I.default);Y.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},Y.DEFAULTS={bindings:{bold:ee("bold"),italic:ee("italic"),underline:ee("underline"),indent:{key:Y.keys.TAB,format:["blockquote","indent","list"],handler:function(W,te){if(te.collapsed&&te.offset!==0)return!0;this.quill.format("indent","+1",x.default.sources.USER)}},outdent:{key:Y.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(W,te){if(te.collapsed&&te.offset!==0)return!0;this.quill.format("indent","-1",x.default.sources.USER)}},"outdent backspace":{key:Y.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(W,te){te.format.indent!=null?this.quill.format("indent","-1",x.default.sources.USER):te.format.list!=null&&this.quill.format("list",!1,x.default.sources.USER)}},"indent code-block":$(!0),"outdent code-block":$(!1),"remove tab":{key:Y.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(W){this.quill.deleteText(W.index-1,1,x.default.sources.USER)}},tab:{key:Y.keys.TAB,handler:function(W){this.quill.history.cutoff();var te=new p.default().retain(W.index).delete(W.length).insert(" ");this.quill.updateContents(te,x.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(W.index+1,x.default.sources.SILENT)}},"list empty enter":{key:Y.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(W,te){this.quill.format("list",!1,x.default.sources.USER),te.format.indent&&this.quill.format("indent",!1,x.default.sources.USER)}},"checklist enter":{key:Y.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(W){var te=this.quill.getLine(W.index),re=s(te,2),ie=re[0],ae=re[1],se=(0,v.default)({},ie.formats(),{list:"checked"}),de=new p.default().retain(W.index).insert(`
135
- `,se).retain(ie.length()-ae-1).retain(1,{list:"unchecked"});this.quill.updateContents(de,x.default.sources.USER),this.quill.setSelection(W.index+1,x.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:Y.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(W,te){var re=this.quill.getLine(W.index),ie=s(re,2),ae=ie[0],se=ie[1],de=new p.default().retain(W.index).insert(`
136
- `,te.format).retain(ae.length()-se-1).retain(1,{header:null});this.quill.updateContents(de,x.default.sources.USER),this.quill.setSelection(W.index+1,x.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(W,te){var re=te.prefix.length,ie=this.quill.getLine(W.index),ae=s(ie,2),se=ae[0],de=ae[1];if(de>re)return!0;var he=void 0;switch(te.prefix.trim()){case"[]":case"[ ]":he="unchecked";break;case"[x]":he="checked";break;case"-":case"*":he="bullet";break;default:he="ordered"}this.quill.insertText(W.index," ",x.default.sources.USER),this.quill.history.cutoff();var Oe=new p.default().retain(W.index-de).delete(re+1).retain(se.length()-2-de).retain(1,{list:he});this.quill.updateContents(Oe,x.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(W.index-re,x.default.sources.SILENT)}},"code exit":{key:Y.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(W){var te=this.quill.getLine(W.index),re=s(te,2),ie=re[0],ae=re[1],se=new p.default().retain(W.index+ie.length()-ae-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(se,x.default.sources.USER)}},"embed left":Q(Y.keys.LEFT,!1),"embed left shift":Q(Y.keys.LEFT,!0),"embed right":Q(Y.keys.RIGHT,!1),"embed right shift":Q(Y.keys.RIGHT,!0)}};function Q(Z,W){var te,re=Z===Y.keys.LEFT?"prefix":"suffix";return te={key:Z,shiftKey:W,altKey:null},A(te,re,/^$/),A(te,"handler",function(ae){var se=ae.index;Z===Y.keys.RIGHT&&(se+=ae.length+1);var de=this.quill.getLeaf(se),he=s(de,1),Oe=he[0];return Oe instanceof y.default.Embed?(Z===Y.keys.LEFT?W?this.quill.setSelection(ae.index-1,ae.length+1,x.default.sources.USER):this.quill.setSelection(ae.index-1,x.default.sources.USER):W?this.quill.setSelection(ae.index,ae.length+1,x.default.sources.USER):this.quill.setSelection(ae.index+ae.length+1,x.default.sources.USER),!1):!0}),te}function q(Z,W){if(!(Z.index===0||this.quill.getLength()<=1)){var te=this.quill.getLine(Z.index),re=s(te,1),ie=re[0],ae={};if(W.offset===0){var se=this.quill.getLine(Z.index-1),de=s(se,1),he=de[0];if(he!=null&&he.length()>1){var Oe=ie.formats(),_e=this.quill.getFormat(Z.index-1,1);ae=P.default.attributes.diff(Oe,_e)||{}}}var Ae=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(W.prefix)?2:1;this.quill.deleteText(Z.index-Ae,Ae,x.default.sources.USER),Object.keys(ae).length>0&&this.quill.formatLine(Z.index-Ae,Ae,ae,x.default.sources.USER),this.quill.focus()}}function z(Z,W){var te=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(W.suffix)?2:1;if(!(Z.index>=this.quill.getLength()-te)){var re={},ie=0,ae=this.quill.getLine(Z.index),se=s(ae,1),de=se[0];if(W.offset>=de.length()-1){var he=this.quill.getLine(Z.index+1),Oe=s(he,1),_e=Oe[0];if(_e){var Ae=de.formats(),ce=this.quill.getFormat(Z.index,1);re=P.default.attributes.diff(Ae,ce)||{},ie=_e.length()}}this.quill.deleteText(Z.index,te,x.default.sources.USER),Object.keys(re).length>0&&this.quill.formatLine(Z.index+ie-1,te,re,x.default.sources.USER)}}function N(Z){var W=this.quill.getLines(Z),te={};if(W.length>1){var re=W[0].formats(),ie=W[W.length-1].formats();te=P.default.attributes.diff(ie,re)||{}}this.quill.deleteText(Z,x.default.sources.USER),Object.keys(te).length>0&&this.quill.formatLine(Z.index,1,te,x.default.sources.USER),this.quill.setSelection(Z.index,x.default.sources.SILENT),this.quill.focus()}function U(Z,W){var te=this;Z.length>0&&this.quill.scroll.deleteAt(Z.index,Z.length);var re=Object.keys(W.format).reduce(function(ie,ae){return y.default.query(ae,y.default.Scope.BLOCK)&&!Array.isArray(W.format[ae])&&(ie[ae]=W.format[ae]),ie},{});this.quill.insertText(Z.index,`
137
- `,re,x.default.sources.USER),this.quill.setSelection(Z.index+1,x.default.sources.SILENT),this.quill.focus(),Object.keys(W.format).forEach(function(ie){re[ie]==null&&(Array.isArray(W.format[ie])||ie!=="link"&&te.quill.format(ie,W.format[ie],x.default.sources.USER))})}function $(Z){return{key:Y.keys.TAB,shiftKey:!Z,format:{"code-block":!0},handler:function(te){var re=y.default.query("code-block"),ie=te.index,ae=te.length,se=this.quill.scroll.descendant(re,ie),de=s(se,2),he=de[0],Oe=de[1];if(he!=null){var _e=this.quill.getIndex(he),Ae=he.newlineIndex(Oe,!0)+1,ce=he.newlineIndex(_e+Oe+ae),pe=he.domNode.textContent.slice(Ae,ce).split(`
138
- `);Oe=0,pe.forEach(function(Ce,Le){Z?(he.insertAt(Ae+Oe,re.TAB),Oe+=re.TAB.length,Le===0?ie+=re.TAB.length:ae+=re.TAB.length):Ce.startsWith(re.TAB)&&(he.deleteAt(Ae+Oe,re.TAB.length),Oe-=re.TAB.length,Le===0?ie-=re.TAB.length:ae-=re.TAB.length),Oe+=Ce.length+1}),this.quill.update(x.default.sources.USER),this.quill.setSelection(ie,ae,x.default.sources.SILENT)}}}}function ee(Z){return{key:Z[0].toUpperCase(),shortKey:!0,handler:function(te,re){this.quill.format(Z,!re.format[Z],x.default.sources.USER)}}}function G(Z){if(typeof Z=="string"||typeof Z=="number")return G({key:Z});if((typeof Z>"u"?"undefined":l(Z))==="object"&&(Z=(0,w.default)(Z,!1)),typeof Z.key=="string")if(Y.keys[Z.key.toUpperCase()]!=null)Z.key=Y.keys[Z.key.toUpperCase()];else if(Z.key.length===1)Z.key=Z.key.toUpperCase().charCodeAt(0);else return null;return Z.shortKey&&(Z[X]=Z.shortKey,delete Z.shortKey),Z}n.default=Y,n.SHORTKEY=X},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function P(g,y){var b=[],x=!0,M=!1,T=void 0;try{for(var j=g[Symbol.iterator](),I;!(x=(I=j.next()).done)&&(b.push(I.value),!(y&&b.length===y));x=!0);}catch(m){M=!0,T=m}finally{try{!x&&j.return&&j.return()}finally{if(M)throw T}}return b}return function(g,y){if(Array.isArray(g))return g;if(Symbol.iterator in Object(g))return P(g,y);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function P(g,y,b){g===null&&(g=Function.prototype);var x=Object.getOwnPropertyDescriptor(g,y);if(x===void 0){var M=Object.getPrototypeOf(g);return M===null?void 0:P(M,y,b)}else{if("value"in x)return x.value;var T=x.get;return T===void 0?void 0:T.call(b)}},c=function(){function P(g,y){for(var b=0;b<y.length;b++){var x=y[b];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(g,x.key,x)}}return function(g,y,b){return y&&P(g.prototype,y),b&&P(g,b),g}}(),d=a(0),w=O(d),_=a(7),E=O(_);function O(P){return P&&P.__esModule?P:{default:P}}function v(P,g){if(!(P instanceof g))throw new TypeError("Cannot call a class as a function")}function S(P,g){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:P}function p(P,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);P.prototype=Object.create(g&&g.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(P,g):P.__proto__=g)}var h=function(P){p(g,P),c(g,null,[{key:"value",value:function(){}}]);function g(y,b){v(this,g);var x=S(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,y));return x.selection=b,x.textNode=document.createTextNode(g.CONTENTS),x.domNode.appendChild(x.textNode),x._length=0,x}return c(g,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(b,x){if(this._length!==0)return s(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"format",this).call(this,b,x);for(var M=this,T=0;M!=null&&M.statics.scope!==w.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,b,x),this._length=0)}},{key:"index",value:function(b,x){return b===this.textNode?0:s(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"index",this).call(this,b,x)}},{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 b=this.textNode,x=this.selection.getNativeRange(),M=void 0,T=void 0,j=void 0;if(x!=null&&x.start.node===b&&x.end.node===b){var I=[b,x.start.offset,x.end.offset];M=I[0],T=I[1],j=I[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 m=this.textNode.data.split(g.CONTENTS).join("");this.next instanceof E.default?(M=this.next.domNode,this.next.insertAt(0,m),this.textNode.data=g.CONTENTS):(this.textNode.data=m,this.parent.insertBefore(w.default.create(this.textNode),this),this.textNode=document.createTextNode(g.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),T!=null){var A=[T,j].map(function(k){return Math.max(0,Math.min(M.data.length,k-1))}),L=l(A,2);return T=L[0],j=L[1],{startNode:M,startOffset:T,endNode:M,endOffset:j}}}}},{key:"update",value:function(b,x){var M=this;if(b.some(function(j){return j.type==="characterData"&&j.target===M.textNode})){var T=this.restore();T&&(x.range=T)}}},{key:"value",value:function(){return""}}]),g}(w.default.Embed);h.blotName="cursor",h.className="ql-cursor",h.tagName="span",h.CONTENTS="\uFEFF",n.default=h},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=a(0),s=w(l),c=a(4),d=w(c);function w(S){return S&&S.__esModule?S:{default:S}}function _(S,p){if(!(S instanceof p))throw new TypeError("Cannot call a class as a function")}function E(S,p){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:S}function O(S,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);S.prototype=Object.create(p&&p.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(S,p):S.__proto__=p)}var v=function(S){O(p,S);function p(){return _(this,p),E(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(s.default.Container);v.allowedChildren=[d.default,c.BlockEmbed,v],n.default=v},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var l=function(){function h(P,g){for(var y=0;y<g.length;y++){var b=g[y];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(P,b.key,b)}}return function(P,g,y){return g&&h(P.prototype,g),y&&h(P,y),P}}(),s=function h(P,g,y){P===null&&(P=Function.prototype);var b=Object.getOwnPropertyDescriptor(P,g);if(b===void 0){var x=Object.getPrototypeOf(P);return x===null?void 0:h(x,g,y)}else{if("value"in b)return b.value;var M=b.get;return M===void 0?void 0:M.call(y)}},c=a(0),d=w(c);function w(h){return h&&h.__esModule?h:{default:h}}function _(h,P){if(!(h instanceof P))throw new TypeError("Cannot call a class as a function")}function E(h,P){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:h}function O(h,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);h.prototype=Object.create(P&&P.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(h,P):h.__proto__=P)}var v=function(h){O(P,h);function P(){return _(this,P),E(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return l(P,[{key:"value",value:function(y){var b=s(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"value",this).call(this,y);return b.startsWith("rgb(")?(b=b.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+b.split(",").map(function(x){return("00"+parseInt(x).toString(16)).slice(-2)}).join("")):b}}]),P}(d.default.Attributor.Style),S=new d.default.Attributor.Class("color","ql-color",{scope:d.default.Scope.INLINE}),p=new v("color","color",{scope:d.default.Scope.INLINE});n.ColorAttributor=v,n.ColorClass=S,n.ColorStyle=p},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var l=function(){function p(h,P){for(var g=0;g<P.length;g++){var y=P[g];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(h,y.key,y)}}return function(h,P,g){return P&&p(h.prototype,P),g&&p(h,g),h}}(),s=function p(h,P,g){h===null&&(h=Function.prototype);var y=Object.getOwnPropertyDescriptor(h,P);if(y===void 0){var b=Object.getPrototypeOf(h);return b===null?void 0:p(b,P,g)}else{if("value"in y)return y.value;var x=y.get;return x===void 0?void 0:x.call(g)}},c=a(6),d=w(c);function w(p){return p&&p.__esModule?p:{default:p}}function _(p,h){if(!(p instanceof h))throw new TypeError("Cannot call a class as a function")}function E(p,h){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:p}function O(p,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);p.prototype=Object.create(h&&h.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(p,h):p.__proto__=h)}var v=function(p){O(h,p);function h(){return _(this,h),E(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return l(h,[{key:"format",value:function(g,y){if(g!==this.statics.blotName||!y)return s(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"format",this).call(this,g,y);y=this.constructor.sanitize(y),this.domNode.setAttribute("href",y)}}],[{key:"create",value:function(g){var y=s(h.__proto__||Object.getPrototypeOf(h),"create",this).call(this,g);return g=this.sanitize(g),y.setAttribute("href",g),y.setAttribute("rel","noopener noreferrer"),y.setAttribute("target","_blank"),y}},{key:"formats",value:function(g){return g.getAttribute("href")}},{key:"sanitize",value:function(g){return S(g,this.PROTOCOL_WHITELIST)?g:this.SANITIZED_URL}}]),h}(d.default);v.blotName="link",v.tagName="A",v.SANITIZED_URL="about:blank",v.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function S(p,h){var P=document.createElement("a");P.href=p;var g=P.href.slice(0,P.href.indexOf(":"));return h.indexOf(g)>-1}n.default=v,n.sanitize=S},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},s=function(){function h(P,g){for(var y=0;y<g.length;y++){var b=g[y];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(P,b.key,b)}}return function(P,g,y){return g&&h(P.prototype,g),y&&h(P,y),P}}(),c=a(23),d=E(c),w=a(107),_=E(w);function E(h){return h&&h.__esModule?h:{default:h}}function O(h,P){if(!(h instanceof P))throw new TypeError("Cannot call a class as a function")}var v=0;function S(h,P){h.setAttribute(P,h.getAttribute(P)!=="true")}var p=function(){function h(P){var g=this;O(this,h),this.select=P,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){g.togglePicker()}),this.label.addEventListener("keydown",function(y){switch(y.keyCode){case d.default.keys.ENTER:g.togglePicker();break;case d.default.keys.ESCAPE:g.escape(),y.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return s(h,[{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 y=this,b=document.createElement("span");return b.tabIndex="0",b.setAttribute("role","button"),b.classList.add("ql-picker-item"),g.hasAttribute("value")&&b.setAttribute("data-value",g.getAttribute("value")),g.textContent&&b.setAttribute("data-label",g.textContent),b.addEventListener("click",function(){y.selectItem(b,!0)}),b.addEventListener("keydown",function(x){switch(x.keyCode){case d.default.keys.ENTER:y.selectItem(b,!0),x.preventDefault();break;case d.default.keys.ESCAPE:y.escape(),x.preventDefault();break}}),b}},{key:"buildLabel",value:function(){var g=document.createElement("span");return g.classList.add("ql-picker-label"),g.innerHTML=_.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,y=document.createElement("span");y.classList.add("ql-picker-options"),y.setAttribute("aria-hidden","true"),y.tabIndex="-1",y.id="ql-picker-options-"+v,v+=1,this.label.setAttribute("aria-controls",y.id),this.options=y,[].slice.call(this.select.options).forEach(function(b){var x=g.buildItem(b);y.appendChild(x),b.selected===!0&&g.selectItem(x)}),this.container.appendChild(y)}},{key:"buildPicker",value:function(){var g=this;[].slice.call(this.select.attributes).forEach(function(y){g.container.setAttribute(y.name,y.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 y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,b=this.container.querySelector(".ql-selected");if(g!==b&&(b!=null&&b.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"),y))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":l(Event))==="object"){var x=document.createEvent("Event");x.initEvent("change",!0,!0),this.select.dispatchEvent(x)}this.close()}}},{key:"update",value:function(){var g=void 0;if(this.select.selectedIndex>-1){var y=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];g=this.select.options[this.select.selectedIndex],this.selectItem(y)}else this.selectItem(null);var b=g!=null&&g!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",b)}}]),h}();n.default=p},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=a(0),s=B(l),c=a(5),d=B(c),w=a(4),_=B(w),E=a(16),O=B(E),v=a(25),S=B(v),p=a(24),h=B(p),P=a(35),g=B(P),y=a(6),b=B(y),x=a(22),M=B(x),T=a(7),j=B(T),I=a(55),m=B(I),A=a(42),L=B(A),k=a(23),R=B(k);function B(X){return X&&X.__esModule?X:{default:X}}d.default.register({"blots/block":_.default,"blots/block/embed":w.BlockEmbed,"blots/break":O.default,"blots/container":S.default,"blots/cursor":h.default,"blots/embed":g.default,"blots/inline":b.default,"blots/scroll":M.default,"blots/text":j.default,"modules/clipboard":m.default,"modules/history":L.default,"modules/keyboard":R.default}),s.default.register(_.default,O.default,h.default,b.default,M.default,j.default),n.default=d.default},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=a(1),s=function(){function c(d){this.domNode=d,this.domNode[l.DATA_KEY]={blot:this}}return Object.defineProperty(c.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),c.create=function(d){if(this.tagName==null)throw new l.ParchmentError("Blot definition missing tagName");var w;return Array.isArray(this.tagName)?(typeof d=="string"&&(d=d.toUpperCase(),parseInt(d).toString()===d&&(d=parseInt(d))),typeof d=="number"?w=document.createElement(this.tagName[d-1]):this.tagName.indexOf(d)>-1?w=document.createElement(d):w=document.createElement(this.tagName[0])):w=document.createElement(this.tagName),this.className&&w.classList.add(this.className),w},c.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},c.prototype.clone=function(){var d=this.domNode.cloneNode(!1);return l.create(d)},c.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[l.DATA_KEY]},c.prototype.deleteAt=function(d,w){var _=this.isolate(d,w);_.remove()},c.prototype.formatAt=function(d,w,_,E){var O=this.isolate(d,w);if(l.query(_,l.Scope.BLOT)!=null&&E)O.wrap(_,E);else if(l.query(_,l.Scope.ATTRIBUTE)!=null){var v=l.create(this.statics.scope);O.wrap(v),v.format(_,E)}},c.prototype.insertAt=function(d,w,_){var E=_==null?l.create("text",w):l.create(w,_),O=this.split(d);this.parent.insertBefore(E,O)},c.prototype.insertInto=function(d,w){w===void 0&&(w=null),this.parent!=null&&this.parent.children.remove(this);var _=null;d.children.insertBefore(this,w),w!=null&&(_=w.domNode),(this.domNode.parentNode!=d.domNode||this.domNode.nextSibling!=_)&&d.domNode.insertBefore(this.domNode,_),this.parent=d,this.attach()},c.prototype.isolate=function(d,w){var _=this.split(d);return _.split(w),_},c.prototype.length=function(){return 1},c.prototype.offset=function(d){return d===void 0&&(d=this.parent),this.parent==null||this==d?0:this.parent.children.offset(this)+this.parent.offset(d)},c.prototype.optimize=function(d){this.domNode[l.DATA_KEY]!=null&&delete this.domNode[l.DATA_KEY].mutations},c.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},c.prototype.replace=function(d){d.parent!=null&&(d.parent.insertBefore(this,d.next),d.remove())},c.prototype.replaceWith=function(d,w){var _=typeof d=="string"?l.create(d,w):d;return _.replace(this),_},c.prototype.split=function(d,w){return d===0?this:this.next},c.prototype.update=function(d,w){},c.prototype.wrap=function(d,w){var _=typeof d=="string"?l.create(d,w):d;return this.parent!=null&&this.parent.insertBefore(_,this.next),_.appendChild(this),_},c.blotName="abstract",c}();n.default=s},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=a(12),s=a(32),c=a(33),d=a(1),w=function(){function _(E){this.attributes={},this.domNode=E,this.build()}return _.prototype.attribute=function(E,O){O?E.add(this.domNode,O)&&(E.value(this.domNode)!=null?this.attributes[E.attrName]=E:delete this.attributes[E.attrName]):(E.remove(this.domNode),delete this.attributes[E.attrName])},_.prototype.build=function(){var E=this;this.attributes={};var O=l.default.keys(this.domNode),v=s.default.keys(this.domNode),S=c.default.keys(this.domNode);O.concat(v).concat(S).forEach(function(p){var h=d.query(p,d.Scope.ATTRIBUTE);h instanceof l.default&&(E.attributes[h.attrName]=h)})},_.prototype.copy=function(E){var O=this;Object.keys(this.attributes).forEach(function(v){var S=O.attributes[v].value(O.domNode);E.format(v,S)})},_.prototype.move=function(E){var O=this;this.copy(E),Object.keys(this.attributes).forEach(function(v){O.attributes[v].remove(O.domNode)}),this.attributes={}},_.prototype.values=function(){var E=this;return Object.keys(this.attributes).reduce(function(O,v){return O[v]=E.attributes[v].value(E.domNode),O},{})},_}();n.default=w},function(t,n,a){var l=this&&this.__extends||function(){var w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,E){_.__proto__=E}||function(_,E){for(var O in E)E.hasOwnProperty(O)&&(_[O]=E[O])};return function(_,E){w(_,E);function O(){this.constructor=_}_.prototype=E===null?Object.create(E):(O.prototype=E.prototype,new O)}}();Object.defineProperty(n,"__esModule",{value:!0});var s=a(12);function c(w,_){var E=w.getAttribute("class")||"";return E.split(/\s+/).filter(function(O){return O.indexOf(_+"-")===0})}var d=function(w){l(_,w);function _(){return w!==null&&w.apply(this,arguments)||this}return _.keys=function(E){return(E.getAttribute("class")||"").split(/\s+/).map(function(O){return O.split("-").slice(0,-1).join("-")})},_.prototype.add=function(E,O){return this.canAdd(E,O)?(this.remove(E),E.classList.add(this.keyName+"-"+O),!0):!1},_.prototype.remove=function(E){var O=c(E,this.keyName);O.forEach(function(v){E.classList.remove(v)}),E.classList.length===0&&E.removeAttribute("class")},_.prototype.value=function(E){var O=c(E,this.keyName)[0]||"",v=O.slice(this.keyName.length+1);return this.canAdd(E,v)?v:""},_}(s.default);n.default=d},function(t,n,a){var l=this&&this.__extends||function(){var w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,E){_.__proto__=E}||function(_,E){for(var O in E)E.hasOwnProperty(O)&&(_[O]=E[O])};return function(_,E){w(_,E);function O(){this.constructor=_}_.prototype=E===null?Object.create(E):(O.prototype=E.prototype,new O)}}();Object.defineProperty(n,"__esModule",{value:!0});var s=a(12);function c(w){var _=w.split("-"),E=_.slice(1).map(function(O){return O[0].toUpperCase()+O.slice(1)}).join("");return _[0]+E}var d=function(w){l(_,w);function _(){return w!==null&&w.apply(this,arguments)||this}return _.keys=function(E){return(E.getAttribute("style")||"").split(";").map(function(O){var v=O.split(":");return v[0].trim()})},_.prototype.add=function(E,O){return this.canAdd(E,O)?(E.style[c(this.keyName)]=O,!0):!1},_.prototype.remove=function(E){E.style[c(this.keyName)]="",E.getAttribute("style")||E.removeAttribute("style")},_.prototype.value=function(E){var O=E.style[c(this.keyName)];return this.canAdd(E,O)?O:""},_}(s.default);n.default=d},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function d(w,_){for(var E=0;E<_.length;E++){var O=_[E];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(w,O.key,O)}}return function(w,_,E){return _&&d(w.prototype,_),E&&d(w,E),w}}();function s(d,w){if(!(d instanceof w))throw new TypeError("Cannot call a class as a function")}var c=function(){function d(w,_){s(this,d),this.quill=w,this.options=_,this.modules={}}return l(d,[{key:"init",value:function(){var _=this;Object.keys(this.options.modules).forEach(function(E){_.modules[E]==null&&_.addModule(E)})}},{key:"addModule",value:function(_){var E=this.quill.constructor.import("modules/"+_);return this.modules[_]=new E(this.quill,this.options.modules[_]||{}),this.modules[_]}}]),d}();c.DEFAULTS={modules:{}},c.themes={default:c},n.default=c},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function P(g,y){for(var b=0;b<y.length;b++){var x=y[b];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(g,x.key,x)}}return function(g,y,b){return y&&P(g.prototype,y),b&&P(g,b),g}}(),s=function P(g,y,b){g===null&&(g=Function.prototype);var x=Object.getOwnPropertyDescriptor(g,y);if(x===void 0){var M=Object.getPrototypeOf(g);return M===null?void 0:P(M,y,b)}else{if("value"in x)return x.value;var T=x.get;return T===void 0?void 0:T.call(b)}},c=a(0),d=E(c),w=a(7),_=E(w);function E(P){return P&&P.__esModule?P:{default:P}}function O(P,g){if(!(P instanceof g))throw new TypeError("Cannot call a class as a function")}function v(P,g){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:P}function S(P,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);P.prototype=Object.create(g&&g.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(P,g):P.__proto__=g)}var p="\uFEFF",h=function(P){S(g,P);function g(y){O(this,g);var b=v(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,y));return b.contentNode=document.createElement("span"),b.contentNode.setAttribute("contenteditable",!1),[].slice.call(b.domNode.childNodes).forEach(function(x){b.contentNode.appendChild(x)}),b.leftGuard=document.createTextNode(p),b.rightGuard=document.createTextNode(p),b.domNode.appendChild(b.leftGuard),b.domNode.appendChild(b.contentNode),b.domNode.appendChild(b.rightGuard),b}return l(g,[{key:"index",value:function(b,x){return b===this.leftGuard?0:b===this.rightGuard?1:s(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"index",this).call(this,b,x)}},{key:"restore",value:function(b){var x=void 0,M=void 0,T=b.data.split(p).join("");if(b===this.leftGuard)if(this.prev instanceof _.default){var j=this.prev.length();this.prev.insertAt(j,T),x={startNode:this.prev.domNode,startOffset:j+T.length}}else M=document.createTextNode(T),this.parent.insertBefore(d.default.create(M),this),x={startNode:M,startOffset:T.length};else b===this.rightGuard&&(this.next instanceof _.default?(this.next.insertAt(0,T),x={startNode:this.next.domNode,startOffset:T.length}):(M=document.createTextNode(T),this.parent.insertBefore(d.default.create(M),this.next),x={startNode:M,startOffset:T.length}));return b.data=p,x}},{key:"update",value:function(b,x){var M=this;b.forEach(function(T){if(T.type==="characterData"&&(T.target===M.leftGuard||T.target===M.rightGuard)){var j=M.restore(T.target);j&&(x.range=j)}})}}]),g}(d.default.Embed);n.default=h},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.AlignStyle=n.AlignClass=n.AlignAttribute=void 0;var l=a(0),s=c(l);function c(O){return O&&O.__esModule?O:{default:O}}var d={scope:s.default.Scope.BLOCK,whitelist:["right","center","justify"]},w=new s.default.Attributor.Attribute("align","align",d),_=new s.default.Attributor.Class("align","ql-align",d),E=new s.default.Attributor.Style("align","text-align",d);n.AlignAttribute=w,n.AlignClass=_,n.AlignStyle=E},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.BackgroundStyle=n.BackgroundClass=void 0;var l=a(0),s=d(l),c=a(26);function d(E){return E&&E.__esModule?E:{default:E}}var w=new s.default.Attributor.Class("background","ql-bg",{scope:s.default.Scope.INLINE}),_=new c.ColorAttributor("background","background-color",{scope:s.default.Scope.INLINE});n.BackgroundClass=w,n.BackgroundStyle=_},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.DirectionStyle=n.DirectionClass=n.DirectionAttribute=void 0;var l=a(0),s=c(l);function c(O){return O&&O.__esModule?O:{default:O}}var d={scope:s.default.Scope.BLOCK,whitelist:["rtl"]},w=new s.default.Attributor.Attribute("direction","dir",d),_=new s.default.Attributor.Class("direction","ql-direction",d),E=new s.default.Attributor.Style("direction","direction",d);n.DirectionAttribute=w,n.DirectionClass=_,n.DirectionStyle=E},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var l=function(){function P(g,y){for(var b=0;b<y.length;b++){var x=y[b];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(g,x.key,x)}}return function(g,y,b){return y&&P(g.prototype,y),b&&P(g,b),g}}(),s=function P(g,y,b){g===null&&(g=Function.prototype);var x=Object.getOwnPropertyDescriptor(g,y);if(x===void 0){var M=Object.getPrototypeOf(g);return M===null?void 0:P(M,y,b)}else{if("value"in x)return x.value;var T=x.get;return T===void 0?void 0:T.call(b)}},c=a(0),d=w(c);function w(P){return P&&P.__esModule?P:{default:P}}function _(P,g){if(!(P instanceof g))throw new TypeError("Cannot call a class as a function")}function E(P,g){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:P}function O(P,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);P.prototype=Object.create(g&&g.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(P,g):P.__proto__=g)}var v={scope:d.default.Scope.INLINE,whitelist:["serif","monospace"]},S=new d.default.Attributor.Class("font","ql-font",v),p=function(P){O(g,P);function g(){return _(this,g),E(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return l(g,[{key:"value",value:function(b){return s(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"value",this).call(this,b).replace(/["']/g,"")}}]),g}(d.default.Attributor.Style),h=new p("font","font-family",v);n.FontStyle=h,n.FontClass=S},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.SizeStyle=n.SizeClass=void 0;var l=a(0),s=c(l);function c(_){return _&&_.__esModule?_:{default:_}}var d=new s.default.Attributor.Class("size","ql-size",{scope:s.default.Scope.INLINE,whitelist:["small","large","huge"]}),w=new s.default.Attributor.Style("size","font-size",{scope:s.default.Scope.INLINE,whitelist:["10px","18px","32px"]});n.SizeClass=d,n.SizeStyle=w},function(t,n,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,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.getLastChangeIndex=n.default=void 0;var l=function(){function y(b,x){for(var M=0;M<x.length;M++){var T=x[M];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(b,T.key,T)}}return function(b,x,M){return x&&y(b.prototype,x),M&&y(b,M),b}}(),s=a(0),c=O(s),d=a(5),w=O(d),_=a(9),E=O(_);function O(y){return y&&y.__esModule?y:{default:y}}function v(y,b){if(!(y instanceof b))throw new TypeError("Cannot call a class as a function")}function S(y,b){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:y}function p(y,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);y.prototype=Object.create(b&&b.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(y,b):y.__proto__=b)}var h=function(y){p(b,y);function b(x,M){v(this,b);var T=S(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,x,M));return T.lastRecorded=0,T.ignoreChange=!1,T.clear(),T.quill.on(w.default.events.EDITOR_CHANGE,function(j,I,m,A){j!==w.default.events.TEXT_CHANGE||T.ignoreChange||(!T.options.userOnly||A===w.default.sources.USER?T.record(I,m):T.transform(I))}),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 l(b,[{key:"change",value:function(M,T){if(this.stack[M].length!==0){var j=this.stack[M].pop();this.stack[T].push(j),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(j[M],w.default.sources.USER),this.ignoreChange=!1;var I=g(j[M]);this.quill.setSelection(I)}}},{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 j=this.quill.getContents().diff(T),I=Date.now();if(this.lastRecorded+this.options.delay>I&&this.stack.undo.length>0){var m=this.stack.undo.pop();j=j.compose(m.undo),M=m.redo.compose(M)}else this.lastRecorded=I;this.stack.undo.push({redo:M,undo:j}),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")}}]),b}(E.default);h.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function P(y){var b=y.ops[y.ops.length-1];return b==null?!1:b.insert!=null?typeof b.insert=="string"&&b.insert.endsWith(`
139
- `):b.attributes!=null?Object.keys(b.attributes).some(function(x){return c.default.query(x,c.default.Scope.BLOCK)!=null}):!1}function g(y){var b=y.reduce(function(M,T){return M+=T.delete||0,M},0),x=y.length()-b;return P(y)&&(x-=1),x}n.default=h,n.getLastChangeIndex=g},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var l=function(){function U($,ee){for(var G=0;G<ee.length;G++){var Z=ee[G];Z.enumerable=Z.enumerable||!1,Z.configurable=!0,"value"in Z&&(Z.writable=!0),Object.defineProperty($,Z.key,Z)}}return function($,ee,G){return ee&&U($.prototype,ee),G&&U($,G),$}}(),s=function U($,ee,G){$===null&&($=Function.prototype);var Z=Object.getOwnPropertyDescriptor($,ee);if(Z===void 0){var W=Object.getPrototypeOf($);return W===null?void 0:U(W,ee,G)}else{if("value"in Z)return Z.value;var te=Z.get;return te===void 0?void 0:te.call(G)}},c=a(3),d=I(c),w=a(2),_=I(w),E=a(8),O=I(E),v=a(23),S=I(v),p=a(34),h=I(p),P=a(59),g=I(P),y=a(60),b=I(y),x=a(28),M=I(x),T=a(61),j=I(T);function I(U){return U&&U.__esModule?U:{default:U}}function m(U,$){if(!(U instanceof $))throw new TypeError("Cannot call a class as a function")}function A(U,$){if(!U)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $&&(typeof $=="object"||typeof $=="function")?$:U}function L(U,$){if(typeof $!="function"&&$!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof $);U.prototype=Object.create($&&$.prototype,{constructor:{value:U,enumerable:!1,writable:!0,configurable:!0}}),$&&(Object.setPrototypeOf?Object.setPrototypeOf(U,$):U.__proto__=$)}var k=[!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"],B=[!1,"serif","monospace"],X=["1","2","3",!1],Y=["small",!1,"large","huge"],Q=function(U){L($,U);function $(ee,G){m(this,$);var Z=A(this,($.__proto__||Object.getPrototypeOf($)).call(this,ee,G)),W=function te(re){if(!document.body.contains(ee.root))return document.body.removeEventListener("click",te);Z.tooltip!=null&&!Z.tooltip.root.contains(re.target)&&document.activeElement!==Z.tooltip.textbox&&!Z.quill.hasFocus()&&Z.tooltip.hide(),Z.pickers!=null&&Z.pickers.forEach(function(ie){ie.container.contains(re.target)||ie.close()})};return ee.emitter.listenDOM("click",document.body,W),Z}return l($,[{key:"addModule",value:function(G){var Z=s($.prototype.__proto__||Object.getPrototypeOf($.prototype),"addModule",this).call(this,G);return G==="toolbar"&&this.extendToolbar(Z),Z}},{key:"buildButtons",value:function(G,Z){G.forEach(function(W){var te=W.getAttribute("class")||"";te.split(/\s+/).forEach(function(re){if(re.startsWith("ql-")&&(re=re.slice(3),Z[re]!=null))if(re==="direction")W.innerHTML=Z[re][""]+Z[re].rtl;else if(typeof Z[re]=="string")W.innerHTML=Z[re];else{var ie=W.value||"";ie!=null&&Z[re][ie]&&(W.innerHTML=Z[re][ie])}})})}},{key:"buildPickers",value:function(G,Z){var W=this;this.pickers=G.map(function(re){if(re.classList.contains("ql-align"))return re.querySelector("option")==null&&N(re,k),new b.default(re,Z.align);if(re.classList.contains("ql-background")||re.classList.contains("ql-color")){var ie=re.classList.contains("ql-background")?"background":"color";return re.querySelector("option")==null&&N(re,R,ie==="background"?"#ffffff":"#000000"),new g.default(re,Z[ie])}else return re.querySelector("option")==null&&(re.classList.contains("ql-font")?N(re,B):re.classList.contains("ql-header")?N(re,X):re.classList.contains("ql-size")&&N(re,Y)),new M.default(re)});var te=function(){W.pickers.forEach(function(ie){ie.update()})};this.quill.on(O.default.events.EDITOR_CHANGE,te)}}]),$}(h.default);Q.DEFAULTS=(0,d.default)(!0,{},h.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var $=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 G=new FileReader;G.onload=function(Z){var W=$.quill.getSelection(!0);$.quill.updateContents(new _.default().retain(W.index).delete(W.length).insert({image:Z.target.result}),O.default.sources.USER),$.quill.setSelection(W.index+1,O.default.sources.SILENT),ee.value=""},G.readAsDataURL(ee.files[0])}}),this.container.appendChild(ee)),ee.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var q=function(U){L($,U);function $(ee,G){m(this,$);var Z=A(this,($.__proto__||Object.getPrototypeOf($)).call(this,ee,G));return Z.textbox=Z.root.querySelector('input[type="text"]'),Z.listen(),Z}return l($,[{key:"listen",value:function(){var G=this;this.textbox.addEventListener("keydown",function(Z){S.default.match(Z,"enter")?(G.save(),Z.preventDefault()):S.default.match(Z,"escape")&&(G.cancel(),Z.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),Z!=null?this.textbox.value=Z:G!==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-"+G)||""),this.root.setAttribute("data-mode",G)}},{key:"restoreFocus",value:function(){var G=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=G}},{key:"save",value:function(){var G=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var Z=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",G,O.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",G,O.default.sources.USER)),this.quill.root.scrollTop=Z;break}case"video":G=z(G);case"formula":{if(!G)break;var W=this.quill.getSelection(!0);if(W!=null){var te=W.index+W.length;this.quill.insertEmbed(te,this.root.getAttribute("data-mode"),G,O.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(te+1," ",O.default.sources.USER),this.quill.setSelection(te+2,O.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),$}(j.default);function z(U){var $=U.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||U.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return $?($[1]||"https")+"://www.youtube.com/embed/"+$[2]+"?showinfo=0":($=U.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?($[1]||"https")+"://player.vimeo.com/video/"+$[2]+"/":U}function N(U,$){var ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;$.forEach(function(G){var Z=document.createElement("option");G===ee?Z.setAttribute("selected","selected"):Z.setAttribute("value",G),U.appendChild(Z)})}n.BaseTooltip=q,n.default=Q},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function s(){this.head=this.tail=null,this.length=0}return s.prototype.append=function(){for(var c=[],d=0;d<arguments.length;d++)c[d]=arguments[d];this.insertBefore(c[0],null),c.length>1&&this.append.apply(this,c.slice(1))},s.prototype.contains=function(c){for(var d,w=this.iterator();d=w();)if(d===c)return!0;return!1},s.prototype.insertBefore=function(c,d){c&&(c.next=d,d!=null?(c.prev=d.prev,d.prev!=null&&(d.prev.next=c),d.prev=c,d===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 d=0,w=this.head;w!=null;){if(w===c)return d;d+=w.length(),w=w.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 d=c;return c!=null&&(c=c.next),d}},s.prototype.find=function(c,d){d===void 0&&(d=!1);for(var w,_=this.iterator();w=_();){var E=w.length();if(c<E||d&&c===E&&(w.next==null||w.next.length()!==0))return[w,c];c-=E}return[null,0]},s.prototype.forEach=function(c){for(var d,w=this.iterator();d=w();)c(d)},s.prototype.forEachAt=function(c,d,w){if(!(d<=0))for(var _=this.find(c),E=_[0],O=_[1],v,S=c-O,p=this.iterator(E);(v=p())&&S<c+d;){var h=v.length();c>S?w(v,c-S,Math.min(d,S+h-c)):w(v,0,Math.min(h,c+d-S)),S+=h}},s.prototype.map=function(c){return this.reduce(function(d,w){return d.push(c(w)),d},[])},s.prototype.reduce=function(c,d){for(var w,_=this.iterator();w=_();)d=c(d,w);return d},s}();n.default=l},function(t,n,a){var l=this&&this.__extends||function(){var E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,v){O.__proto__=v}||function(O,v){for(var S in v)v.hasOwnProperty(S)&&(O[S]=v[S])};return function(O,v){E(O,v);function S(){this.constructor=O}O.prototype=v===null?Object.create(v):(S.prototype=v.prototype,new S)}}();Object.defineProperty(n,"__esModule",{value:!0});var s=a(17),c=a(1),d={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},w=100,_=function(E){l(O,E);function O(v){var S=E.call(this,v)||this;return S.scroll=S,S.observer=new MutationObserver(function(p){S.update(p)}),S.observer.observe(S.domNode,d),S.attach(),S}return O.prototype.detach=function(){E.prototype.detach.call(this),this.observer.disconnect()},O.prototype.deleteAt=function(v,S){this.update(),v===0&&S===this.length()?this.children.forEach(function(p){p.remove()}):E.prototype.deleteAt.call(this,v,S)},O.prototype.formatAt=function(v,S,p,h){this.update(),E.prototype.formatAt.call(this,v,S,p,h)},O.prototype.insertAt=function(v,S,p){this.update(),E.prototype.insertAt.call(this,v,S,p)},O.prototype.optimize=function(v,S){var p=this;v===void 0&&(v=[]),S===void 0&&(S={}),E.prototype.optimize.call(this,S);for(var h=[].slice.call(this.observer.takeRecords());h.length>0;)v.push(h.pop());for(var P=function(x,M){M===void 0&&(M=!0),!(x==null||x===p)&&x.domNode.parentNode!=null&&(x.domNode[c.DATA_KEY].mutations==null&&(x.domNode[c.DATA_KEY].mutations=[]),M&&P(x.parent))},g=function(x){x.domNode[c.DATA_KEY]==null||x.domNode[c.DATA_KEY].mutations==null||(x instanceof s.default&&x.children.forEach(g),x.optimize(S))},y=v,b=0;y.length>0;b+=1){if(b>=w)throw new Error("[Parchment] Maximum optimize iterations reached");for(y.forEach(function(x){var M=c.find(x.target,!0);M!=null&&(M.domNode===x.target&&(x.type==="childList"?(P(c.find(x.previousSibling,!1)),[].forEach.call(x.addedNodes,function(T){var j=c.find(T,!1);P(j,!1),j instanceof s.default&&j.children.forEach(function(I){P(I,!1)})})):x.type==="attributes"&&P(M.prev)),P(M))}),this.children.forEach(g),y=[].slice.call(this.observer.takeRecords()),h=y.slice();h.length>0;)v.push(h.pop())}},O.prototype.update=function(v,S){var p=this;S===void 0&&(S={}),v=v||this.observer.takeRecords(),v.map(function(h){var P=c.find(h.target,!0);return P==null?null:P.domNode[c.DATA_KEY].mutations==null?(P.domNode[c.DATA_KEY].mutations=[h],P):(P.domNode[c.DATA_KEY].mutations.push(h),null)}).forEach(function(h){h==null||h===p||h.domNode[c.DATA_KEY]==null||h.update(h.domNode[c.DATA_KEY].mutations||[],S)}),this.domNode[c.DATA_KEY].mutations!=null&&E.prototype.update.call(this,this.domNode[c.DATA_KEY].mutations,S),this.optimize(v,S)},O.blotName="scroll",O.defaultChild="block",O.scope=c.Scope.BLOCK_BLOT,O.tagName="DIV",O}(s.default);n.default=_},function(t,n,a){var l=this&&this.__extends||function(){var _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,O){E.__proto__=O}||function(E,O){for(var v in O)O.hasOwnProperty(v)&&(E[v]=O[v])};return function(E,O){_(E,O);function v(){this.constructor=E}E.prototype=O===null?Object.create(O):(v.prototype=O.prototype,new v)}}();Object.defineProperty(n,"__esModule",{value:!0});var s=a(18),c=a(1);function d(_,E){if(Object.keys(_).length!==Object.keys(E).length)return!1;for(var O in _)if(_[O]!==E[O])return!1;return!0}var w=function(_){l(E,_);function E(){return _!==null&&_.apply(this,arguments)||this}return E.formats=function(O){if(O.tagName!==E.tagName)return _.formats.call(this,O)},E.prototype.format=function(O,v){var S=this;O===this.statics.blotName&&!v?(this.children.forEach(function(p){p instanceof s.default||(p=p.wrap(E.blotName,!0)),S.attributes.copy(p)}),this.unwrap()):_.prototype.format.call(this,O,v)},E.prototype.formatAt=function(O,v,S,p){if(this.formats()[S]!=null||c.query(S,c.Scope.ATTRIBUTE)){var h=this.isolate(O,v);h.format(S,p)}else _.prototype.formatAt.call(this,O,v,S,p)},E.prototype.optimize=function(O){_.prototype.optimize.call(this,O);var v=this.formats();if(Object.keys(v).length===0)return this.unwrap();var S=this.next;S instanceof E&&S.prev===this&&d(v,S.formats())&&(S.moveChildren(this),S.remove())},E.blotName="inline",E.scope=c.Scope.INLINE_BLOT,E.tagName="SPAN",E}(s.default);n.default=w},function(t,n,a){var l=this&&this.__extends||function(){var w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,E){_.__proto__=E}||function(_,E){for(var O in E)E.hasOwnProperty(O)&&(_[O]=E[O])};return function(_,E){w(_,E);function O(){this.constructor=_}_.prototype=E===null?Object.create(E):(O.prototype=E.prototype,new O)}}();Object.defineProperty(n,"__esModule",{value:!0});var s=a(18),c=a(1),d=function(w){l(_,w);function _(){return w!==null&&w.apply(this,arguments)||this}return _.formats=function(E){var O=c.query(_.blotName).tagName;if(E.tagName!==O)return w.formats.call(this,E)},_.prototype.format=function(E,O){c.query(E,c.Scope.BLOCK)!=null&&(E===this.statics.blotName&&!O?this.replaceWith(_.blotName):w.prototype.format.call(this,E,O))},_.prototype.formatAt=function(E,O,v,S){c.query(v,c.Scope.BLOCK)!=null?this.format(v,S):w.prototype.formatAt.call(this,E,O,v,S)},_.prototype.insertAt=function(E,O,v){if(v==null||c.query(O,c.Scope.INLINE)!=null)w.prototype.insertAt.call(this,E,O,v);else{var S=this.split(E),p=c.create(O,v);S.parent.insertBefore(p,S)}},_.prototype.update=function(E,O){navigator.userAgent.match(/Trident/)?this.build():w.prototype.update.call(this,E,O)},_.blotName="block",_.scope=c.Scope.BLOCK_BLOT,_.tagName="P",_}(s.default);n.default=d},function(t,n,a){var l=this&&this.__extends||function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,_){w.__proto__=_}||function(w,_){for(var E in _)_.hasOwnProperty(E)&&(w[E]=_[E])};return function(w,_){d(w,_);function E(){this.constructor=w}w.prototype=_===null?Object.create(_):(E.prototype=_.prototype,new E)}}();Object.defineProperty(n,"__esModule",{value:!0});var s=a(19),c=function(d){l(w,d);function w(){return d!==null&&d.apply(this,arguments)||this}return w.formats=function(_){},w.prototype.format=function(_,E){d.prototype.formatAt.call(this,0,this.length(),_,E)},w.prototype.formatAt=function(_,E,O,v){_===0&&E===this.length()?this.format(O,v):d.prototype.formatAt.call(this,_,E,O,v)},w.prototype.formats=function(){return this.statics.formats(this.domNode)},w}(s.default);n.default=c},function(t,n,a){var l=this&&this.__extends||function(){var w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,E){_.__proto__=E}||function(_,E){for(var O in E)E.hasOwnProperty(O)&&(_[O]=E[O])};return function(_,E){w(_,E);function O(){this.constructor=_}_.prototype=E===null?Object.create(E):(O.prototype=E.prototype,new O)}}();Object.defineProperty(n,"__esModule",{value:!0});var s=a(19),c=a(1),d=function(w){l(_,w);function _(E){var O=w.call(this,E)||this;return O.text=O.statics.value(O.domNode),O}return _.create=function(E){return document.createTextNode(E)},_.value=function(E){var O=E.data;return O.normalize&&(O=O.normalize()),O},_.prototype.deleteAt=function(E,O){this.domNode.data=this.text=this.text.slice(0,E)+this.text.slice(E+O)},_.prototype.index=function(E,O){return this.domNode===E?O:-1},_.prototype.insertAt=function(E,O,v){v==null?(this.text=this.text.slice(0,E)+O+this.text.slice(E),this.domNode.data=this.text):w.prototype.insertAt.call(this,E,O,v)},_.prototype.length=function(){return this.text.length},_.prototype.optimize=function(E){w.prototype.optimize.call(this,E),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof _&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},_.prototype.position=function(E,O){return[this.domNode,E]},_.prototype.split=function(E,O){if(O===void 0&&(O=!1),!O){if(E===0)return this;if(E===this.length())return this.next}var v=c.create(this.domNode.splitText(E));return this.parent.insertBefore(v,this.next),this.text=this.statics.value(this.domNode),v},_.prototype.update=function(E,O){var v=this;E.some(function(S){return S.type==="characterData"&&S.target===v.domNode})&&(this.text=this.statics.value(this.domNode))},_.prototype.value=function(){return this.text},_.blotName="text",_.scope=c.Scope.INLINE_BLOT,_}(s.default);n.default=d},function(t,n,a){var l=document.createElement("div");if(l.classList.toggle("test-class",!1),l.classList.contains("test-class")){var s=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(c,d){return arguments.length>1&&!this.contains(c)==!d?d:s.call(this,c)}}String.prototype.startsWith||(String.prototype.startsWith=function(c,d){return d=d||0,this.substr(d,c.length)===c}),String.prototype.endsWith||(String.prototype.endsWith=function(c,d){var w=this.toString();(typeof d!="number"||!isFinite(d)||Math.floor(d)!==d||d>w.length)&&(d=w.length),d-=c.length;var _=w.indexOf(c,d);return _!==-1&&_===d}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(d){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof d!="function")throw new TypeError("predicate must be a function");for(var w=Object(this),_=w.length>>>0,E=arguments[1],O,v=0;v<_;v++)if(O=w[v],d.call(E,O,v,w))return O}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(t,n){var a=-1,l=1,s=0;function c(b,x,M){if(b==x)return b?[[s,b]]:[];(M<0||b.length<M)&&(M=null);var T=E(b,x),j=b.substring(0,T);b=b.substring(T),x=x.substring(T),T=O(b,x);var I=b.substring(b.length-T);b=b.substring(0,b.length-T),x=x.substring(0,x.length-T);var m=d(b,x);return j&&m.unshift([s,j]),I&&m.push([s,I]),S(m),M!=null&&(m=P(m,M)),m=g(m),m}function d(b,x){var M;if(!b)return[[l,x]];if(!x)return[[a,b]];var T=b.length>x.length?b:x,j=b.length>x.length?x:b,I=T.indexOf(j);if(I!=-1)return M=[[l,T.substring(0,I)],[s,j],[l,T.substring(I+j.length)]],b.length>x.length&&(M[0][0]=M[2][0]=a),M;if(j.length==1)return[[a,b],[l,x]];var m=v(b,x);if(m){var A=m[0],L=m[1],k=m[2],R=m[3],B=m[4],X=c(A,k),Y=c(L,R);return X.concat([[s,B]],Y)}return w(b,x)}function w(b,x){for(var M=b.length,T=x.length,j=Math.ceil((M+T)/2),I=j,m=2*j,A=new Array(m),L=new Array(m),k=0;k<m;k++)A[k]=-1,L[k]=-1;A[I+1]=0,L[I+1]=0;for(var R=M-T,B=R%2!=0,X=0,Y=0,Q=0,q=0,z=0;z<j;z++){for(var N=-z+X;N<=z-Y;N+=2){var U=I+N,$;N==-z||N!=z&&A[U-1]<A[U+1]?$=A[U+1]:$=A[U-1]+1;for(var ee=$-N;$<M&&ee<T&&b.charAt($)==x.charAt(ee);)$++,ee++;if(A[U]=$,$>M)Y+=2;else if(ee>T)X+=2;else if(B){var G=I+R-N;if(G>=0&&G<m&&L[G]!=-1){var Z=M-L[G];if($>=Z)return _(b,x,$,ee)}}}for(var W=-z+Q;W<=z-q;W+=2){var G=I+W,Z;W==-z||W!=z&&L[G-1]<L[G+1]?Z=L[G+1]:Z=L[G-1]+1;for(var te=Z-W;Z<M&&te<T&&b.charAt(M-Z-1)==x.charAt(T-te-1);)Z++,te++;if(L[G]=Z,Z>M)q+=2;else if(te>T)Q+=2;else if(!B){var U=I+R-W;if(U>=0&&U<m&&A[U]!=-1){var $=A[U],ee=I+$-U;if(Z=M-Z,$>=Z)return _(b,x,$,ee)}}}}return[[a,b],[l,x]]}function _(b,x,M,T){var j=b.substring(0,M),I=x.substring(0,T),m=b.substring(M),A=x.substring(T),L=c(j,I),k=c(m,A);return L.concat(k)}function E(b,x){if(!b||!x||b.charAt(0)!=x.charAt(0))return 0;for(var M=0,T=Math.min(b.length,x.length),j=T,I=0;M<j;)b.substring(I,j)==x.substring(I,j)?(M=j,I=M):T=j,j=Math.floor((T-M)/2+M);return j}function O(b,x){if(!b||!x||b.charAt(b.length-1)!=x.charAt(x.length-1))return 0;for(var M=0,T=Math.min(b.length,x.length),j=T,I=0;M<j;)b.substring(b.length-j,b.length-I)==x.substring(x.length-j,x.length-I)?(M=j,I=M):T=j,j=Math.floor((T-M)/2+M);return j}function v(b,x){var M=b.length>x.length?b:x,T=b.length>x.length?x:b;if(M.length<4||T.length*2<M.length)return null;function j(Y,Q,q){for(var z=Y.substring(q,q+Math.floor(Y.length/4)),N=-1,U="",$,ee,G,Z;(N=Q.indexOf(z,N+1))!=-1;){var W=E(Y.substring(q),Q.substring(N)),te=O(Y.substring(0,q),Q.substring(0,N));U.length<te+W&&(U=Q.substring(N-te,N)+Q.substring(N,N+W),$=Y.substring(0,q-te),ee=Y.substring(q+W),G=Q.substring(0,N-te),Z=Q.substring(N+W))}return U.length*2>=Y.length?[$,ee,G,Z,U]:null}var I=j(M,T,Math.ceil(M.length/4)),m=j(M,T,Math.ceil(M.length/2)),A;if(!I&&!m)return null;m?I?A=I[4].length>m[4].length?I:m:A=m:A=I;var L,k,R,B;b.length>x.length?(L=A[0],k=A[1],R=A[2],B=A[3]):(R=A[0],B=A[1],L=A[2],k=A[3]);var X=A[4];return[L,k,R,B,X]}function S(b){b.push([s,""]);for(var x=0,M=0,T=0,j="",I="",m;x<b.length;)switch(b[x][0]){case l:T++,I+=b[x][1],x++;break;case a:M++,j+=b[x][1],x++;break;case s:M+T>1?(M!==0&&T!==0&&(m=E(I,j),m!==0&&(x-M-T>0&&b[x-M-T-1][0]==s?b[x-M-T-1][1]+=I.substring(0,m):(b.splice(0,0,[s,I.substring(0,m)]),x++),I=I.substring(m),j=j.substring(m)),m=O(I,j),m!==0&&(b[x][1]=I.substring(I.length-m)+b[x][1],I=I.substring(0,I.length-m),j=j.substring(0,j.length-m))),M===0?b.splice(x-T,M+T,[l,I]):T===0?b.splice(x-M,M+T,[a,j]):b.splice(x-M-T,M+T,[a,j],[l,I]),x=x-M-T+(M?1:0)+(T?1:0)+1):x!==0&&b[x-1][0]==s?(b[x-1][1]+=b[x][1],b.splice(x,1)):x++,T=0,M=0,j="",I="";break}b[b.length-1][1]===""&&b.pop();var A=!1;for(x=1;x<b.length-1;)b[x-1][0]==s&&b[x+1][0]==s&&(b[x][1].substring(b[x][1].length-b[x-1][1].length)==b[x-1][1]?(b[x][1]=b[x-1][1]+b[x][1].substring(0,b[x][1].length-b[x-1][1].length),b[x+1][1]=b[x-1][1]+b[x+1][1],b.splice(x-1,1),A=!0):b[x][1].substring(0,b[x+1][1].length)==b[x+1][1]&&(b[x-1][1]+=b[x+1][1],b[x][1]=b[x][1].substring(b[x+1][1].length)+b[x+1][1],b.splice(x+1,1),A=!0)),x++;A&&S(b)}var p=c;p.INSERT=l,p.DELETE=a,p.EQUAL=s,t.exports=p;function h(b,x){if(x===0)return[s,b];for(var M=0,T=0;T<b.length;T++){var j=b[T];if(j[0]===a||j[0]===s){var I=M+j[1].length;if(x===I)return[T+1,b];if(x<I){b=b.slice();var m=x-M,A=[j[0],j[1].slice(0,m)],L=[j[0],j[1].slice(m)];return b.splice(T,1,A,L),[T+1,b]}else M=I}}throw new Error("cursor_pos is out of bounds!")}function P(b,x){var M=h(b,x),T=M[1],j=M[0],I=T[j],m=T[j+1];if(I==null)return b;if(I[0]!==s)return b;if(m!=null&&I[1]+m[1]===m[1]+I[1])return T.splice(j,2,m,I),y(T,j,2);if(m!=null&&m[1].indexOf(I[1])===0){T.splice(j,2,[m[0],I[1]],[0,I[1]]);var A=m[1].slice(I[1].length);return A.length>0&&T.splice(j+2,0,[m[0],A]),y(T,j,3)}else return b}function g(b){for(var x=!1,M=function(m){return m.charCodeAt(0)>=56320&&m.charCodeAt(0)<=57343},T=function(m){return m.charCodeAt(m.length-1)>=55296&&m.charCodeAt(m.length-1)<=56319},j=2;j<b.length;j+=1)b[j-2][0]===s&&T(b[j-2][1])&&b[j-1][0]===a&&M(b[j-1][1])&&b[j][0]===l&&M(b[j][1])&&(x=!0,b[j-1][1]=b[j-2][1].slice(-1)+b[j-1][1],b[j][1]=b[j-2][1].slice(-1)+b[j][1],b[j-2][1]=b[j-2][1].slice(0,-1));if(!x)return b;for(var I=[],j=0;j<b.length;j+=1)b[j][1].length>0&&I.push(b[j]);return I}function y(b,x,M){for(var T=x+M-1;T>=0&&T>=x-1;T--)if(T+1<b.length){var j=b[T],I=b[T+1];j[0]===I[1]&&b.splice(T,2,[j[0],j[1]+I[1]])}return b}},function(t,n){n=t.exports=typeof Object.keys=="function"?Object.keys:a,n.shim=a;function a(l){var s=[];for(var c in l)s.push(c);return s}},function(t,n){var a=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";n=t.exports=a?l:s,n.supported=l;function l(c){return Object.prototype.toString.call(c)=="[object Arguments]"}n.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,n){var a=Object.prototype.hasOwnProperty,l="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(l=!1));function c(w,_,E){this.fn=w,this.context=_,this.once=E||!1}function d(){this._events=new s,this._eventsCount=0}d.prototype.eventNames=function(){var _=[],E,O;if(this._eventsCount===0)return _;for(O in E=this._events)a.call(E,O)&&_.push(l?O.slice(1):O);return Object.getOwnPropertySymbols?_.concat(Object.getOwnPropertySymbols(E)):_},d.prototype.listeners=function(_,E){var O=l?l+_:_,v=this._events[O];if(E)return!!v;if(!v)return[];if(v.fn)return[v.fn];for(var S=0,p=v.length,h=new Array(p);S<p;S++)h[S]=v[S].fn;return h},d.prototype.emit=function(_,E,O,v,S,p){var h=l?l+_:_;if(!this._events[h])return!1;var P=this._events[h],g=arguments.length,y,b;if(P.fn){switch(P.once&&this.removeListener(_,P.fn,void 0,!0),g){case 1:return P.fn.call(P.context),!0;case 2:return P.fn.call(P.context,E),!0;case 3:return P.fn.call(P.context,E,O),!0;case 4:return P.fn.call(P.context,E,O,v),!0;case 5:return P.fn.call(P.context,E,O,v,S),!0;case 6:return P.fn.call(P.context,E,O,v,S,p),!0}for(b=1,y=new Array(g-1);b<g;b++)y[b-1]=arguments[b];P.fn.apply(P.context,y)}else{var x=P.length,M;for(b=0;b<x;b++)switch(P[b].once&&this.removeListener(_,P[b].fn,void 0,!0),g){case 1:P[b].fn.call(P[b].context);break;case 2:P[b].fn.call(P[b].context,E);break;case 3:P[b].fn.call(P[b].context,E,O);break;case 4:P[b].fn.call(P[b].context,E,O,v);break;default:if(!y)for(M=1,y=new Array(g-1);M<g;M++)y[M-1]=arguments[M];P[b].fn.apply(P[b].context,y)}}return!0},d.prototype.on=function(_,E,O){var v=new c(E,O||this),S=l?l+_:_;return this._events[S]?this._events[S].fn?this._events[S]=[this._events[S],v]:this._events[S].push(v):(this._events[S]=v,this._eventsCount++),this},d.prototype.once=function(_,E,O){var v=new c(E,O||this,!0),S=l?l+_:_;return this._events[S]?this._events[S].fn?this._events[S]=[this._events[S],v]:this._events[S].push(v):(this._events[S]=v,this._eventsCount++),this},d.prototype.removeListener=function(_,E,O,v){var S=l?l+_:_;if(!this._events[S])return this;if(!E)return--this._eventsCount===0?this._events=new s:delete this._events[S],this;var p=this._events[S];if(p.fn)p.fn===E&&(!v||p.once)&&(!O||p.context===O)&&(--this._eventsCount===0?this._events=new s:delete this._events[S]);else{for(var h=0,P=[],g=p.length;h<g;h++)(p[h].fn!==E||v&&!p[h].once||O&&p[h].context!==O)&&P.push(p[h]);P.length?this._events[S]=P.length===1?P[0]:P:--this._eventsCount===0?this._events=new s:delete this._events[S]}return this},d.prototype.removeAllListeners=function(_){var E;return _?(E=l?l+_:_,this._events[E]&&(--this._eventsCount===0?this._events=new s:delete this._events[E])):(this._events=new s,this._eventsCount=0),this},d.prototype.off=d.prototype.removeListener,d.prototype.addListener=d.prototype.on,d.prototype.setMaxListeners=function(){return this},d.prefixed=l,d.EventEmitter=d,typeof t<"u"&&(t.exports=d)},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.matchText=n.matchSpacing=n.matchNewline=n.matchBlot=n.matchAttributor=n.default=void 0;var l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ce){return typeof ce}:function(ce){return ce&&typeof Symbol=="function"&&ce.constructor===Symbol&&ce!==Symbol.prototype?"symbol":typeof ce},s=function(){function ce(pe,Ce){var Le=[],ue=!0,ve=!1,xe=void 0;try{for(var je=pe[Symbol.iterator](),at;!(ue=(at=je.next()).done)&&(Le.push(at.value),!(Ce&&Le.length===Ce));ue=!0);}catch(ht){ve=!0,xe=ht}finally{try{!ue&&je.return&&je.return()}finally{if(ve)throw xe}}return Le}return function(pe,Ce){if(Array.isArray(pe))return pe;if(Symbol.iterator in Object(pe))return ce(pe,Ce);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(){function ce(pe,Ce){for(var Le=0;Le<Ce.length;Le++){var ue=Ce[Le];ue.enumerable=ue.enumerable||!1,ue.configurable=!0,"value"in ue&&(ue.writable=!0),Object.defineProperty(pe,ue.key,ue)}}return function(pe,Ce,Le){return Ce&&ce(pe.prototype,Ce),Le&&ce(pe,Le),pe}}(),d=a(3),w=L(d),_=a(2),E=L(_),O=a(0),v=L(O),S=a(5),p=L(S),h=a(10),P=L(h),g=a(9),y=L(g),b=a(36),x=a(37),M=a(13),T=L(M),j=a(26),I=a(38),m=a(39),A=a(40);function L(ce){return ce&&ce.__esModule?ce:{default:ce}}function k(ce,pe,Ce){return pe in ce?Object.defineProperty(ce,pe,{value:Ce,enumerable:!0,configurable:!0,writable:!0}):ce[pe]=Ce,ce}function R(ce,pe){if(!(ce instanceof pe))throw new TypeError("Cannot call a class as a function")}function B(ce,pe){if(!ce)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return pe&&(typeof pe=="object"||typeof pe=="function")?pe:ce}function X(ce,pe){if(typeof pe!="function"&&pe!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof pe);ce.prototype=Object.create(pe&&pe.prototype,{constructor:{value:ce,enumerable:!1,writable:!0,configurable:!0}}),pe&&(Object.setPrototypeOf?Object.setPrototypeOf(ce,pe):ce.__proto__=pe)}var Y=(0,P.default)("quill:clipboard"),Q="__ql-matcher",q=[[Node.TEXT_NODE,Ae],[Node.TEXT_NODE,he],["br",ae],[Node.ELEMENT_NODE,he],[Node.ELEMENT_NODE,ie],[Node.ELEMENT_NODE,Oe],[Node.ELEMENT_NODE,re],[Node.ELEMENT_NODE,_e],["li",de],["b",te.bind(te,"bold")],["i",te.bind(te,"italic")],["style",se]],z=[b.AlignAttribute,I.DirectionAttribute].reduce(function(ce,pe){return ce[pe.keyName]=pe,ce},{}),N=[b.AlignStyle,x.BackgroundStyle,j.ColorStyle,I.DirectionStyle,m.FontStyle,A.SizeStyle].reduce(function(ce,pe){return ce[pe.keyName]=pe,ce},{}),U=function(ce){X(pe,ce);function pe(Ce,Le){R(this,pe);var ue=B(this,(pe.__proto__||Object.getPrototypeOf(pe)).call(this,Ce,Le));return ue.quill.root.addEventListener("paste",ue.onPaste.bind(ue)),ue.container=ue.quill.addContainer("ql-clipboard"),ue.container.setAttribute("contenteditable",!0),ue.container.setAttribute("tabindex",-1),ue.matchers=[],q.concat(ue.options.matchers).forEach(function(ve){var xe=s(ve,2),je=xe[0],at=xe[1];!Le.matchVisual&&at===Oe||ue.addMatcher(je,at)}),ue}return c(pe,[{key:"addMatcher",value:function(Le,ue){this.matchers.push([Le,ue])}},{key:"convert",value:function(Le){if(typeof Le=="string")return this.container.innerHTML=Le.replace(/\>\r?\n +\</g,"><"),this.convert();var ue=this.quill.getFormat(this.quill.selection.savedRange.index);if(ue[T.default.blotName]){var ve=this.container.innerText;return this.container.innerHTML="",new E.default().insert(ve,k({},T.default.blotName,ue[T.default.blotName]))}var xe=this.prepareMatching(),je=s(xe,2),at=je[0],ht=je[1],et=W(this.container,at,ht);return G(et,`
140
- `)&&et.ops[et.ops.length-1].attributes==null&&(et=et.compose(new E.default().retain(et.length()-1).delete(1))),Y.log("convert",this.container.innerHTML,et),this.container.innerHTML="",et}},{key:"dangerouslyPasteHTML",value:function(Le,ue){var ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:p.default.sources.API;if(typeof Le=="string")this.quill.setContents(this.convert(Le),ue),this.quill.setSelection(0,p.default.sources.SILENT);else{var xe=this.convert(ue);this.quill.updateContents(new E.default().retain(Le).concat(xe),ve),this.quill.setSelection(Le+xe.length(),p.default.sources.SILENT)}}},{key:"onPaste",value:function(Le){var ue=this;if(!(Le.defaultPrevented||!this.quill.isEnabled())){var ve=this.quill.getSelection(),xe=new E.default().retain(ve.index),je=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(p.default.sources.SILENT),setTimeout(function(){xe=xe.concat(ue.convert()).delete(ve.length),ue.quill.updateContents(xe,p.default.sources.USER),ue.quill.setSelection(xe.length()-ve.length,p.default.sources.SILENT),ue.quill.scrollingContainer.scrollTop=je,ue.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var Le=this,ue=[],ve=[];return this.matchers.forEach(function(xe){var je=s(xe,2),at=je[0],ht=je[1];switch(at){case Node.TEXT_NODE:ve.push(ht);break;case Node.ELEMENT_NODE:ue.push(ht);break;default:[].forEach.call(Le.container.querySelectorAll(at),function(et){et[Q]=et[Q]||[],et[Q].push(ht)});break}}),[ue,ve]}}]),pe}(y.default);U.DEFAULTS={matchers:[],matchVisual:!0};function $(ce,pe,Ce){return(typeof pe>"u"?"undefined":l(pe))==="object"?Object.keys(pe).reduce(function(Le,ue){return $(Le,ue,pe[ue])},ce):ce.reduce(function(Le,ue){return ue.attributes&&ue.attributes[pe]?Le.push(ue):Le.insert(ue.insert,(0,w.default)({},k({},pe,Ce),ue.attributes))},new E.default)}function ee(ce){if(ce.nodeType!==Node.ELEMENT_NODE)return{};var pe="__ql-computed-style";return ce[pe]||(ce[pe]=window.getComputedStyle(ce))}function G(ce,pe){for(var Ce="",Le=ce.ops.length-1;Le>=0&&Ce.length<pe.length;--Le){var ue=ce.ops[Le];if(typeof ue.insert!="string")break;Ce=ue.insert+Ce}return Ce.slice(-1*pe.length)===pe}function Z(ce){if(ce.childNodes.length===0)return!1;var pe=ee(ce);return["block","list-item"].indexOf(pe.display)>-1}function W(ce,pe,Ce){return ce.nodeType===ce.TEXT_NODE?Ce.reduce(function(Le,ue){return ue(ce,Le)},new E.default):ce.nodeType===ce.ELEMENT_NODE?[].reduce.call(ce.childNodes||[],function(Le,ue){var ve=W(ue,pe,Ce);return ue.nodeType===ce.ELEMENT_NODE&&(ve=pe.reduce(function(xe,je){return je(ue,xe)},ve),ve=(ue[Q]||[]).reduce(function(xe,je){return je(ue,xe)},ve)),Le.concat(ve)},new E.default):new E.default}function te(ce,pe,Ce){return $(Ce,ce,!0)}function re(ce,pe){var Ce=v.default.Attributor.Attribute.keys(ce),Le=v.default.Attributor.Class.keys(ce),ue=v.default.Attributor.Style.keys(ce),ve={};return Ce.concat(Le).concat(ue).forEach(function(xe){var je=v.default.query(xe,v.default.Scope.ATTRIBUTE);je!=null&&(ve[je.attrName]=je.value(ce),ve[je.attrName])||(je=z[xe],je!=null&&(je.attrName===xe||je.keyName===xe)&&(ve[je.attrName]=je.value(ce)||void 0),je=N[xe],je!=null&&(je.attrName===xe||je.keyName===xe)&&(je=N[xe],ve[je.attrName]=je.value(ce)||void 0))}),Object.keys(ve).length>0&&(pe=$(pe,ve)),pe}function ie(ce,pe){var Ce=v.default.query(ce);if(Ce==null)return pe;if(Ce.prototype instanceof v.default.Embed){var Le={},ue=Ce.value(ce);ue!=null&&(Le[Ce.blotName]=ue,pe=new E.default().insert(Le,Ce.formats(ce)))}else typeof Ce.formats=="function"&&(pe=$(pe,Ce.blotName,Ce.formats(ce)));return pe}function ae(ce,pe){return G(pe,`
141
- `)||pe.insert(`
142
- `),pe}function se(){return new E.default}function de(ce,pe){var Ce=v.default.query(ce);if(Ce==null||Ce.blotName!=="list-item"||!G(pe,`
143
- `))return pe;for(var Le=-1,ue=ce.parentNode;!ue.classList.contains("ql-clipboard");)(v.default.query(ue)||{}).blotName==="list"&&(Le+=1),ue=ue.parentNode;return Le<=0?pe:pe.compose(new E.default().retain(pe.length()-1).retain(1,{indent:Le}))}function he(ce,pe){return G(pe,`
144
- `)||(Z(ce)||pe.length()>0&&ce.nextSibling&&Z(ce.nextSibling))&&pe.insert(`
145
- `),pe}function Oe(ce,pe){if(Z(ce)&&ce.nextElementSibling!=null&&!G(pe,`
146
-
147
- `)){var Ce=ce.offsetHeight+parseFloat(ee(ce).marginTop)+parseFloat(ee(ce).marginBottom);ce.nextElementSibling.offsetTop>ce.offsetTop+Ce*1.5&&pe.insert(`
148
- `)}return pe}function _e(ce,pe){var Ce={},Le=ce.style||{};return Le.fontStyle&&ee(ce).fontStyle==="italic"&&(Ce.italic=!0),Le.fontWeight&&(ee(ce).fontWeight.startsWith("bold")||parseInt(ee(ce).fontWeight)>=700)&&(Ce.bold=!0),Object.keys(Ce).length>0&&(pe=$(pe,Ce)),parseFloat(Le.textIndent||0)>0&&(pe=new E.default().insert(" ").concat(pe)),pe}function Ae(ce,pe){var Ce=ce.data;if(ce.parentNode.tagName==="O:P")return pe.insert(Ce.trim());if(Ce.trim().length===0&&ce.parentNode.classList.contains("ql-clipboard"))return pe;if(!ee(ce.parentNode).whiteSpace.startsWith("pre")){var Le=function(ve,xe){return xe=xe.replace(/[^\u00a0]/g,""),xe.length<1&&ve?" ":xe};Ce=Ce.replace(/\r\n/g," ").replace(/\n/g," "),Ce=Ce.replace(/\s\s+/g,Le.bind(Le,!0)),(ce.previousSibling==null&&Z(ce.parentNode)||ce.previousSibling!=null&&Z(ce.previousSibling))&&(Ce=Ce.replace(/^\s+/,Le.bind(Le,!1))),(ce.nextSibling==null&&Z(ce.parentNode)||ce.nextSibling!=null&&Z(ce.nextSibling))&&(Ce=Ce.replace(/\s+$/,Le.bind(Le,!1)))}return pe.insert(Ce)}n.default=U,n.matchAttributor=re,n.matchBlot=ie,n.matchNewline=he,n.matchSpacing=Oe,n.matchText=Ae},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function S(p,h){for(var P=0;P<h.length;P++){var g=h[P];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(p,g.key,g)}}return function(p,h,P){return h&&S(p.prototype,h),P&&S(p,P),p}}(),s=function S(p,h,P){p===null&&(p=Function.prototype);var g=Object.getOwnPropertyDescriptor(p,h);if(g===void 0){var y=Object.getPrototypeOf(p);return y===null?void 0:S(y,h,P)}else{if("value"in g)return g.value;var b=g.get;return b===void 0?void 0:b.call(P)}},c=a(6),d=w(c);function w(S){return S&&S.__esModule?S:{default:S}}function _(S,p){if(!(S instanceof p))throw new TypeError("Cannot call a class as a function")}function E(S,p){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:S}function O(S,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);S.prototype=Object.create(p&&p.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(S,p):S.__proto__=p)}var v=function(S){O(p,S);function p(){return _(this,p),E(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return l(p,[{key:"optimize",value:function(P){s(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"optimize",this).call(this,P),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return s(p.__proto__||Object.getPrototypeOf(p),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),p}(d.default);v.blotName="bold",v.tagName=["STRONG","B"],n.default=v},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var l=function(){function A(L,k){var R=[],B=!0,X=!1,Y=void 0;try{for(var Q=L[Symbol.iterator](),q;!(B=(q=Q.next()).done)&&(R.push(q.value),!(k&&R.length===k));B=!0);}catch(z){X=!0,Y=z}finally{try{!B&&Q.return&&Q.return()}finally{if(X)throw Y}}return R}return function(L,k){if(Array.isArray(L))return L;if(Symbol.iterator in Object(L))return A(L,k);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function A(L,k){for(var R=0;R<k.length;R++){var B=k[R];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(L,B.key,B)}}return function(L,k,R){return k&&A(L.prototype,k),R&&A(L,R),L}}(),c=a(2),d=P(c),w=a(0),_=P(w),E=a(5),O=P(E),v=a(10),S=P(v),p=a(9),h=P(p);function P(A){return A&&A.__esModule?A:{default:A}}function g(A,L,k){return L in A?Object.defineProperty(A,L,{value:k,enumerable:!0,configurable:!0,writable:!0}):A[L]=k,A}function y(A,L){if(!(A instanceof L))throw new TypeError("Cannot call a class as a function")}function b(A,L){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:A}function x(A,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);A.prototype=Object.create(L&&L.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(A,L):A.__proto__=L)}var M=(0,S.default)("quill:toolbar"),T=function(A){x(L,A);function L(k,R){y(this,L);var B=b(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,k,R));if(Array.isArray(B.options.container)){var X=document.createElement("div");I(X,B.options.container),k.container.parentNode.insertBefore(X,k.container),B.container=X}else typeof B.options.container=="string"?B.container=document.querySelector(B.options.container):B.container=B.options.container;if(!(B.container instanceof HTMLElement)){var Y;return Y=M.error("Container required for toolbar",B.options),b(B,Y)}return B.container.classList.add("ql-toolbar"),B.controls=[],B.handlers={},Object.keys(B.options.handlers).forEach(function(Q){B.addHandler(Q,B.options.handlers[Q])}),[].forEach.call(B.container.querySelectorAll("button, select"),function(Q){B.attach(Q)}),B.quill.on(O.default.events.EDITOR_CHANGE,function(Q,q){Q===O.default.events.SELECTION_CHANGE&&B.update(q)}),B.quill.on(O.default.events.SCROLL_OPTIMIZE,function(){var Q=B.quill.selection.getRange(),q=l(Q,1),z=q[0];B.update(z)}),B}return s(L,[{key:"addHandler",value:function(R,B){this.handlers[R]=B}},{key:"attach",value:function(R){var B=this,X=[].find.call(R.classList,function(Q){return Q.indexOf("ql-")===0});if(X){if(X=X.slice(3),R.tagName==="BUTTON"&&R.setAttribute("type","button"),this.handlers[X]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[X]==null){M.warn("ignoring attaching to disabled format",X,R);return}if(_.default.query(X)==null){M.warn("ignoring attaching to nonexistent format",X,R);return}}var Y=R.tagName==="SELECT"?"change":"click";R.addEventListener(Y,function(Q){var q=void 0;if(R.tagName==="SELECT"){if(R.selectedIndex<0)return;var z=R.options[R.selectedIndex];z.hasAttribute("selected")?q=!1:q=z.value||!1}else R.classList.contains("ql-active")?q=!1:q=R.value||!R.hasAttribute("value"),Q.preventDefault();B.quill.focus();var N=B.quill.selection.getRange(),U=l(N,1),$=U[0];if(B.handlers[X]!=null)B.handlers[X].call(B,q);else if(_.default.query(X).prototype instanceof _.default.Embed){if(q=prompt("Enter "+X),!q)return;B.quill.updateContents(new d.default().retain($.index).delete($.length).insert(g({},X,q)),O.default.sources.USER)}else B.quill.format(X,q,O.default.sources.USER);B.update($)}),this.controls.push([X,R])}}},{key:"update",value:function(R){var B=R==null?{}:this.quill.getFormat(R);this.controls.forEach(function(X){var Y=l(X,2),Q=Y[0],q=Y[1];if(q.tagName==="SELECT"){var z=void 0;if(R==null)z=null;else if(B[Q]==null)z=q.querySelector("option[selected]");else if(!Array.isArray(B[Q])){var N=B[Q];typeof N=="string"&&(N=N.replace(/\"/g,'\\"')),z=q.querySelector('option[value="'+N+'"]')}z==null?(q.value="",q.selectedIndex=-1):z.selected=!0}else if(R==null)q.classList.remove("ql-active");else if(q.hasAttribute("value")){var U=B[Q]===q.getAttribute("value")||B[Q]!=null&&B[Q].toString()===q.getAttribute("value")||B[Q]==null&&!q.getAttribute("value");q.classList.toggle("ql-active",U)}else q.classList.toggle("ql-active",B[Q]!=null)})}}]),L}(h.default);T.DEFAULTS={};function j(A,L,k){var R=document.createElement("button");R.setAttribute("type","button"),R.classList.add("ql-"+L),k!=null&&(R.value=k),A.appendChild(R)}function I(A,L){Array.isArray(L[0])||(L=[L]),L.forEach(function(k){var R=document.createElement("span");R.classList.add("ql-formats"),k.forEach(function(B){if(typeof B=="string")j(R,B);else{var X=Object.keys(B)[0],Y=B[X];Array.isArray(Y)?m(R,X,Y):j(R,X,Y)}}),A.appendChild(R)})}function m(A,L,k){var R=document.createElement("select");R.classList.add("ql-"+L),k.forEach(function(B){var X=document.createElement("option");B!==!1?X.setAttribute("value",B):X.setAttribute("selected","selected"),R.appendChild(X)}),A.appendChild(R)}T.DEFAULTS={container:null,handlers:{clean:function(){var L=this,k=this.quill.getSelection();if(k!=null)if(k.length==0){var R=this.quill.getFormat();Object.keys(R).forEach(function(B){_.default.query(B,_.default.Scope.INLINE)!=null&&L.quill.format(B,!1)})}else this.quill.removeFormat(k,O.default.sources.USER)},direction:function(L){var k=this.quill.getFormat().align;L==="rtl"&&k==null?this.quill.format("align","right",O.default.sources.USER):!L&&k==="right"&&this.quill.format("align",!1,O.default.sources.USER),this.quill.format("direction",L,O.default.sources.USER)},indent:function(L){var k=this.quill.getSelection(),R=this.quill.getFormat(k),B=parseInt(R.indent||0);if(L==="+1"||L==="-1"){var X=L==="+1"?1:-1;R.direction==="rtl"&&(X*=-1),this.quill.format("indent",B+X,O.default.sources.USER)}},link:function(L){L===!0&&(L=prompt("Enter link URL:")),this.quill.format("link",L,O.default.sources.USER)},list:function(L){var k=this.quill.getSelection(),R=this.quill.getFormat(k);L==="check"?R.list==="checked"||R.list==="unchecked"?this.quill.format("list",!1,O.default.sources.USER):this.quill.format("list","unchecked",O.default.sources.USER):this.quill.format("list",L,O.default.sources.USER)}}},n.default=T,n.addControls=I},function(t,n){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,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function S(p,h){for(var P=0;P<h.length;P++){var g=h[P];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(p,g.key,g)}}return function(p,h,P){return h&&S(p.prototype,h),P&&S(p,P),p}}(),s=function S(p,h,P){p===null&&(p=Function.prototype);var g=Object.getOwnPropertyDescriptor(p,h);if(g===void 0){var y=Object.getPrototypeOf(p);return y===null?void 0:S(y,h,P)}else{if("value"in g)return g.value;var b=g.get;return b===void 0?void 0:b.call(P)}},c=a(28),d=w(c);function w(S){return S&&S.__esModule?S:{default:S}}function _(S,p){if(!(S instanceof p))throw new TypeError("Cannot call a class as a function")}function E(S,p){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:S}function O(S,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);S.prototype=Object.create(p&&p.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(S,p):S.__proto__=p)}var v=function(S){O(p,S);function p(h,P){_(this,p);var g=E(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,h));return g.label.innerHTML=P,g.container.classList.add("ql-color-picker"),[].slice.call(g.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(y){y.classList.add("ql-primary")}),g}return l(p,[{key:"buildItem",value:function(P){var g=s(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"buildItem",this).call(this,P);return g.style.backgroundColor=P.getAttribute("value")||"",g}},{key:"selectItem",value:function(P,g){s(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"selectItem",this).call(this,P,g);var y=this.label.querySelector(".ql-color-label"),b=P&&P.getAttribute("data-value")||"";y&&(y.tagName==="line"?y.style.stroke=b:y.style.fill=b)}}]),p}(d.default);n.default=v},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function S(p,h){for(var P=0;P<h.length;P++){var g=h[P];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(p,g.key,g)}}return function(p,h,P){return h&&S(p.prototype,h),P&&S(p,P),p}}(),s=function S(p,h,P){p===null&&(p=Function.prototype);var g=Object.getOwnPropertyDescriptor(p,h);if(g===void 0){var y=Object.getPrototypeOf(p);return y===null?void 0:S(y,h,P)}else{if("value"in g)return g.value;var b=g.get;return b===void 0?void 0:b.call(P)}},c=a(28),d=w(c);function w(S){return S&&S.__esModule?S:{default:S}}function _(S,p){if(!(S instanceof p))throw new TypeError("Cannot call a class as a function")}function E(S,p){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:S}function O(S,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);S.prototype=Object.create(p&&p.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(S,p):S.__proto__=p)}var v=function(S){O(p,S);function p(h,P){_(this,p);var g=E(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,h));return g.container.classList.add("ql-icon-picker"),[].forEach.call(g.container.querySelectorAll(".ql-picker-item"),function(y){y.innerHTML=P[y.getAttribute("data-value")||""]}),g.defaultItem=g.container.querySelector(".ql-selected"),g.selectItem(g.defaultItem),g}return l(p,[{key:"selectItem",value:function(P,g){s(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"selectItem",this).call(this,P,g),P=P||this.defaultItem,this.label.innerHTML=P.innerHTML}}]),p}(d.default);n.default=v},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function d(w,_){for(var E=0;E<_.length;E++){var O=_[E];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(w,O.key,O)}}return function(w,_,E){return _&&d(w.prototype,_),E&&d(w,E),w}}();function s(d,w){if(!(d instanceof w))throw new TypeError("Cannot call a class as a function")}var c=function(){function d(w,_){var E=this;s(this,d),this.quill=w,this.boundsContainer=_||document.body,this.root=w.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){E.root.style.marginTop=-1*E.quill.root.scrollTop+"px"}),this.hide()}return l(d,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(_){var E=_.left+_.width/2-this.root.offsetWidth/2,O=_.bottom+this.quill.root.scrollTop;this.root.style.left=E+"px",this.root.style.top=O+"px",this.root.classList.remove("ql-flip");var v=this.boundsContainer.getBoundingClientRect(),S=this.root.getBoundingClientRect(),p=0;if(S.right>v.right&&(p=v.right-S.right,this.root.style.left=E+p+"px"),S.left<v.left&&(p=v.left-S.left,this.root.style.left=E+p+"px"),S.bottom>v.bottom){var h=S.bottom-S.top,P=_.bottom-_.top+h;this.root.style.top=O-P+"px",this.root.classList.add("ql-flip")}return p}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),d}();n.default=c},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function m(A,L){var k=[],R=!0,B=!1,X=void 0;try{for(var Y=A[Symbol.iterator](),Q;!(R=(Q=Y.next()).done)&&(k.push(Q.value),!(L&&k.length===L));R=!0);}catch(q){B=!0,X=q}finally{try{!R&&Y.return&&Y.return()}finally{if(B)throw X}}return k}return function(A,L){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return m(A,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function m(A,L,k){A===null&&(A=Function.prototype);var R=Object.getOwnPropertyDescriptor(A,L);if(R===void 0){var B=Object.getPrototypeOf(A);return B===null?void 0:m(B,L,k)}else{if("value"in R)return R.value;var X=R.get;return X===void 0?void 0:X.call(k)}},c=function(){function m(A,L){for(var k=0;k<L.length;k++){var R=L[k];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(A,R.key,R)}}return function(A,L,k){return L&&m(A.prototype,L),k&&m(A,k),A}}(),d=a(3),w=y(d),_=a(8),E=y(_),O=a(43),v=y(O),S=a(27),p=y(S),h=a(15),P=a(41),g=y(P);function y(m){return m&&m.__esModule?m:{default:m}}function b(m,A){if(!(m instanceof A))throw new TypeError("Cannot call a class as a function")}function x(m,A){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:m}function M(m,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);m.prototype=Object.create(A&&A.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(m,A):m.__proto__=A)}var T=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],j=function(m){M(A,m);function A(L,k){b(this,A),k.modules.toolbar!=null&&k.modules.toolbar.container==null&&(k.modules.toolbar.container=T);var R=x(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,L,k));return R.quill.container.classList.add("ql-snow"),R}return c(A,[{key:"extendToolbar",value:function(k){k.container.classList.add("ql-snow"),this.buildButtons([].slice.call(k.container.querySelectorAll("button")),g.default),this.buildPickers([].slice.call(k.container.querySelectorAll("select")),g.default),this.tooltip=new I(this.quill,this.options.bounds),k.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(R,B){k.handlers.link.call(k,!B.format.link)})}}]),A}(v.default);j.DEFAULTS=(0,w.default)(!0,{},v.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(A){if(A){var L=this.quill.getSelection();if(L==null||L.length==0)return;var k=this.quill.getText(L);/^\S+@\S+\.\S+$/.test(k)&&k.indexOf("mailto:")!==0&&(k="mailto:"+k);var R=this.quill.theme.tooltip;R.edit("link",k)}else this.quill.format("link",!1)}}}}});var I=function(m){M(A,m);function A(L,k){b(this,A);var R=x(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,L,k));return R.preview=R.root.querySelector("a.ql-preview"),R}return c(A,[{key:"listen",value:function(){var k=this;s(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(R){k.root.classList.contains("ql-editing")?k.save():k.edit("link",k.preview.textContent),R.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(R){if(k.linkRange!=null){var B=k.linkRange;k.restoreFocus(),k.quill.formatText(B,"link",!1,E.default.sources.USER),delete k.linkRange}R.preventDefault(),k.hide()}),this.quill.on(E.default.events.SELECTION_CHANGE,function(R,B,X){if(R!=null){if(R.length===0&&X===E.default.sources.USER){var Y=k.quill.scroll.descendant(p.default,R.index),Q=l(Y,2),q=Q[0],z=Q[1];if(q!=null){k.linkRange=new h.Range(R.index-z,q.length());var N=p.default.formats(q.domNode);k.preview.textContent=N,k.preview.setAttribute("href",N),k.show(),k.position(k.quill.getBounds(k.linkRange));return}}else delete k.linkRange;k.hide()}})}},{key:"show",value:function(){s(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),A}(O.BaseTooltip);I.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),n.default=j},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=a(29),s=ue(l),c=a(36),d=a(38),w=a(64),_=a(65),E=ue(_),O=a(66),v=ue(O),S=a(67),p=ue(S),h=a(37),P=a(26),g=a(39),y=a(40),b=a(56),x=ue(b),M=a(68),T=ue(M),j=a(27),I=ue(j),m=a(69),A=ue(m),L=a(70),k=ue(L),R=a(71),B=ue(R),X=a(72),Y=ue(X),Q=a(73),q=ue(Q),z=a(13),N=ue(z),U=a(74),$=ue(U),ee=a(75),G=ue(ee),Z=a(57),W=ue(Z),te=a(41),re=ue(te),ie=a(28),ae=ue(ie),se=a(59),de=ue(se),he=a(60),Oe=ue(he),_e=a(61),Ae=ue(_e),ce=a(108),pe=ue(ce),Ce=a(62),Le=ue(Ce);function ue(ve){return ve&&ve.__esModule?ve:{default:ve}}s.default.register({"attributors/attribute/direction":d.DirectionAttribute,"attributors/class/align":c.AlignClass,"attributors/class/background":h.BackgroundClass,"attributors/class/color":P.ColorClass,"attributors/class/direction":d.DirectionClass,"attributors/class/font":g.FontClass,"attributors/class/size":y.SizeClass,"attributors/style/align":c.AlignStyle,"attributors/style/background":h.BackgroundStyle,"attributors/style/color":P.ColorStyle,"attributors/style/direction":d.DirectionStyle,"attributors/style/font":g.FontStyle,"attributors/style/size":y.SizeStyle},!0),s.default.register({"formats/align":c.AlignClass,"formats/direction":d.DirectionClass,"formats/indent":w.IndentClass,"formats/background":h.BackgroundStyle,"formats/color":P.ColorStyle,"formats/font":g.FontClass,"formats/size":y.SizeClass,"formats/blockquote":E.default,"formats/code-block":N.default,"formats/header":v.default,"formats/list":p.default,"formats/bold":x.default,"formats/code":z.Code,"formats/italic":T.default,"formats/link":I.default,"formats/script":A.default,"formats/strike":k.default,"formats/underline":B.default,"formats/image":Y.default,"formats/video":q.default,"formats/list/item":S.ListItem,"modules/formula":$.default,"modules/syntax":G.default,"modules/toolbar":W.default,"themes/bubble":pe.default,"themes/snow":Le.default,"ui/icons":re.default,"ui/picker":ae.default,"ui/icon-picker":Oe.default,"ui/color-picker":de.default,"ui/tooltip":Ae.default},!0),n.default=s.default},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.IndentClass=void 0;var l=function(){function p(h,P){for(var g=0;g<P.length;g++){var y=P[g];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(h,y.key,y)}}return function(h,P,g){return P&&p(h.prototype,P),g&&p(h,g),h}}(),s=function p(h,P,g){h===null&&(h=Function.prototype);var y=Object.getOwnPropertyDescriptor(h,P);if(y===void 0){var b=Object.getPrototypeOf(h);return b===null?void 0:p(b,P,g)}else{if("value"in y)return y.value;var x=y.get;return x===void 0?void 0:x.call(g)}},c=a(0),d=w(c);function w(p){return p&&p.__esModule?p:{default:p}}function _(p,h){if(!(p instanceof h))throw new TypeError("Cannot call a class as a function")}function E(p,h){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:p}function O(p,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);p.prototype=Object.create(h&&h.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(p,h):p.__proto__=h)}var v=function(p){O(h,p);function h(){return _(this,h),E(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return l(h,[{key:"add",value:function(g,y){if(y==="+1"||y==="-1"){var b=this.value(g)||0;y=y==="+1"?b+1:b-1}return y===0?(this.remove(g),!0):s(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"add",this).call(this,g,y)}},{key:"canAdd",value:function(g,y){return s(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"canAdd",this).call(this,g,y)||s(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"canAdd",this).call(this,g,parseInt(y))}},{key:"value",value:function(g){return parseInt(s(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"value",this).call(this,g))||void 0}}]),h}(d.default.Attributor.Class),S=new v("indent","ql-indent",{scope:d.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});n.IndentClass=S},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=a(4),s=c(l);function c(O){return O&&O.__esModule?O:{default:O}}function d(O,v){if(!(O instanceof v))throw new TypeError("Cannot call a class as a function")}function w(O,v){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:O}function _(O,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);O.prototype=Object.create(v&&v.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(O,v):O.__proto__=v)}var E=function(O){_(v,O);function v(){return d(this,v),w(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return v}(s.default);E.blotName="blockquote",E.tagName="blockquote",n.default=E},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function v(S,p){for(var h=0;h<p.length;h++){var P=p[h];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(S,P.key,P)}}return function(S,p,h){return p&&v(S.prototype,p),h&&v(S,h),S}}(),s=a(4),c=d(s);function d(v){return v&&v.__esModule?v:{default:v}}function w(v,S){if(!(v instanceof S))throw new TypeError("Cannot call a class as a function")}function _(v,S){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:v}function E(v,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);v.prototype=Object.create(S&&S.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(v,S):v.__proto__=S)}var O=function(v){E(S,v);function S(){return w(this,S),_(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return l(S,null,[{key:"formats",value:function(h){return this.tagName.indexOf(h.tagName)+1}}]),S}(c.default);O.blotName="header",O.tagName=["H1","H2","H3","H4","H5","H6"],n.default=O},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var l=function(){function b(x,M){for(var T=0;T<M.length;T++){var j=M[T];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(x,j.key,j)}}return function(x,M,T){return M&&b(x.prototype,M),T&&b(x,T),x}}(),s=function b(x,M,T){x===null&&(x=Function.prototype);var j=Object.getOwnPropertyDescriptor(x,M);if(j===void 0){var I=Object.getPrototypeOf(x);return I===null?void 0:b(I,M,T)}else{if("value"in j)return j.value;var m=j.get;return m===void 0?void 0:m.call(T)}},c=a(0),d=v(c),w=a(4),_=v(w),E=a(25),O=v(E);function v(b){return b&&b.__esModule?b:{default:b}}function S(b,x,M){return x in b?Object.defineProperty(b,x,{value:M,enumerable:!0,configurable:!0,writable:!0}):b[x]=M,b}function p(b,x){if(!(b instanceof x))throw new TypeError("Cannot call a class as a function")}function h(b,x){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:b}function P(b,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);b.prototype=Object.create(x&&x.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(b,x):b.__proto__=x)}var g=function(b){P(x,b);function x(){return p(this,x),h(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return l(x,[{key:"format",value:function(T,j){T===y.blotName&&!j?this.replaceWith(d.default.create(this.statics.scope)):s(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"format",this).call(this,T,j)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():s(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(T,j){return this.parent.isolate(this.offset(this.parent),this.length()),T===this.parent.statics.blotName?(this.parent.replaceWith(T,j),this):(this.parent.unwrap(),s(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"replaceWith",this).call(this,T,j))}}],[{key:"formats",value:function(T){return T.tagName===this.tagName?void 0:s(x.__proto__||Object.getPrototypeOf(x),"formats",this).call(this,T)}}]),x}(_.default);g.blotName="list-item",g.tagName="LI";var y=function(b){P(x,b),l(x,null,[{key:"create",value:function(T){var j=T==="ordered"?"OL":"UL",I=s(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this,j);return(T==="checked"||T==="unchecked")&&I.setAttribute("data-checked",T==="checked"),I}},{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 x(M){p(this,x);var T=h(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,M)),j=function(m){if(m.target.parentNode===M){var A=T.statics.formats(M),L=d.default.find(m.target);A==="checked"?L.format("list","unchecked"):A==="unchecked"&&L.format("list","checked")}};return M.addEventListener("touchstart",j),M.addEventListener("mousedown",j),T}return l(x,[{key:"format",value:function(T,j){this.children.length>0&&this.children.tail.format(T,j)}},{key:"formats",value:function(){return S({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(T,j){if(T instanceof g)s(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"insertBefore",this).call(this,T,j);else{var I=j==null?this.length():j.offset(this),m=this.split(I);m.parent.insertBefore(T,m)}}},{key:"optimize",value:function(T){s(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"optimize",this).call(this,T);var j=this.next;j!=null&&j.prev===this&&j.statics.blotName===this.statics.blotName&&j.domNode.tagName===this.domNode.tagName&&j.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(j.moveChildren(this),j.remove())}},{key:"replace",value:function(T){if(T.statics.blotName!==this.statics.blotName){var j=d.default.create(this.statics.defaultChild);T.moveChildren(j),this.appendChild(j)}s(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"replace",this).call(this,T)}}]),x}(O.default);y.blotName="list",y.scope=d.default.Scope.BLOCK_BLOT,y.tagName=["OL","UL"],y.defaultChild="list-item",y.allowedChildren=[g],n.ListItem=g,n.default=y},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=a(56),s=c(l);function c(O){return O&&O.__esModule?O:{default:O}}function d(O,v){if(!(O instanceof v))throw new TypeError("Cannot call a class as a function")}function w(O,v){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:O}function _(O,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);O.prototype=Object.create(v&&v.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(O,v):O.__proto__=v)}var E=function(O){_(v,O);function v(){return d(this,v),w(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return v}(s.default);E.blotName="italic",E.tagName=["EM","I"],n.default=E},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function S(p,h){for(var P=0;P<h.length;P++){var g=h[P];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(p,g.key,g)}}return function(p,h,P){return h&&S(p.prototype,h),P&&S(p,P),p}}(),s=function S(p,h,P){p===null&&(p=Function.prototype);var g=Object.getOwnPropertyDescriptor(p,h);if(g===void 0){var y=Object.getPrototypeOf(p);return y===null?void 0:S(y,h,P)}else{if("value"in g)return g.value;var b=g.get;return b===void 0?void 0:b.call(P)}},c=a(6),d=w(c);function w(S){return S&&S.__esModule?S:{default:S}}function _(S,p){if(!(S instanceof p))throw new TypeError("Cannot call a class as a function")}function E(S,p){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:S}function O(S,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);S.prototype=Object.create(p&&p.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(S,p):S.__proto__=p)}var v=function(S){O(p,S);function p(){return _(this,p),E(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return l(p,null,[{key:"create",value:function(P){return P==="super"?document.createElement("sup"):P==="sub"?document.createElement("sub"):s(p.__proto__||Object.getPrototypeOf(p),"create",this).call(this,P)}},{key:"formats",value:function(P){if(P.tagName==="SUB")return"sub";if(P.tagName==="SUP")return"super"}}]),p}(d.default);v.blotName="script",v.tagName=["SUB","SUP"],n.default=v},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=a(6),s=c(l);function c(O){return O&&O.__esModule?O:{default:O}}function d(O,v){if(!(O instanceof v))throw new TypeError("Cannot call a class as a function")}function w(O,v){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:O}function _(O,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);O.prototype=Object.create(v&&v.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(O,v):O.__proto__=v)}var E=function(O){_(v,O);function v(){return d(this,v),w(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return v}(s.default);E.blotName="strike",E.tagName="S",n.default=E},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=a(6),s=c(l);function c(O){return O&&O.__esModule?O:{default:O}}function d(O,v){if(!(O instanceof v))throw new TypeError("Cannot call a class as a function")}function w(O,v){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:O}function _(O,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);O.prototype=Object.create(v&&v.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(O,v):O.__proto__=v)}var E=function(O){_(v,O);function v(){return d(this,v),w(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return v}(s.default);E.blotName="underline",E.tagName="U",n.default=E},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function h(P,g){for(var y=0;y<g.length;y++){var b=g[y];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(P,b.key,b)}}return function(P,g,y){return g&&h(P.prototype,g),y&&h(P,y),P}}(),s=function h(P,g,y){P===null&&(P=Function.prototype);var b=Object.getOwnPropertyDescriptor(P,g);if(b===void 0){var x=Object.getPrototypeOf(P);return x===null?void 0:h(x,g,y)}else{if("value"in b)return b.value;var M=b.get;return M===void 0?void 0:M.call(y)}},c=a(0),d=_(c),w=a(27);function _(h){return h&&h.__esModule?h:{default:h}}function E(h,P){if(!(h instanceof P))throw new TypeError("Cannot call a class as a function")}function O(h,P){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:h}function v(h,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);h.prototype=Object.create(P&&P.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(h,P):h.__proto__=P)}var S=["alt","height","width"],p=function(h){v(P,h);function P(){return E(this,P),O(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return l(P,[{key:"format",value:function(y,b){S.indexOf(y)>-1?b?this.domNode.setAttribute(y,b):this.domNode.removeAttribute(y):s(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"format",this).call(this,y,b)}}],[{key:"create",value:function(y){var b=s(P.__proto__||Object.getPrototypeOf(P),"create",this).call(this,y);return typeof y=="string"&&b.setAttribute("src",this.sanitize(y)),b}},{key:"formats",value:function(y){return S.reduce(function(b,x){return y.hasAttribute(x)&&(b[x]=y.getAttribute(x)),b},{})}},{key:"match",value:function(y){return/\.(jpe?g|gif|png)$/.test(y)||/^data:image\/.+;base64/.test(y)}},{key:"sanitize",value:function(y){return(0,w.sanitize)(y,["http","https","data"])?y:"//:0"}},{key:"value",value:function(y){return y.getAttribute("src")}}]),P}(d.default.Embed);p.blotName="image",p.tagName="IMG",n.default=p},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function h(P,g){for(var y=0;y<g.length;y++){var b=g[y];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(P,b.key,b)}}return function(P,g,y){return g&&h(P.prototype,g),y&&h(P,y),P}}(),s=function h(P,g,y){P===null&&(P=Function.prototype);var b=Object.getOwnPropertyDescriptor(P,g);if(b===void 0){var x=Object.getPrototypeOf(P);return x===null?void 0:h(x,g,y)}else{if("value"in b)return b.value;var M=b.get;return M===void 0?void 0:M.call(y)}},c=a(4),d=a(27),w=_(d);function _(h){return h&&h.__esModule?h:{default:h}}function E(h,P){if(!(h instanceof P))throw new TypeError("Cannot call a class as a function")}function O(h,P){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:h}function v(h,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);h.prototype=Object.create(P&&P.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(h,P):h.__proto__=P)}var S=["height","width"],p=function(h){v(P,h);function P(){return E(this,P),O(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return l(P,[{key:"format",value:function(y,b){S.indexOf(y)>-1?b?this.domNode.setAttribute(y,b):this.domNode.removeAttribute(y):s(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"format",this).call(this,y,b)}}],[{key:"create",value:function(y){var b=s(P.__proto__||Object.getPrototypeOf(P),"create",this).call(this,y);return b.setAttribute("frameborder","0"),b.setAttribute("allowfullscreen",!0),b.setAttribute("src",this.sanitize(y)),b}},{key:"formats",value:function(y){return S.reduce(function(b,x){return y.hasAttribute(x)&&(b[x]=y.getAttribute(x)),b},{})}},{key:"sanitize",value:function(y){return w.default.sanitize(y)}},{key:"value",value:function(y){return y.getAttribute("src")}}]),P}(c.BlockEmbed);p.blotName="video",p.className="ql-video",p.tagName="IFRAME",n.default=p},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.FormulaBlot=void 0;var l=function(){function y(b,x){for(var M=0;M<x.length;M++){var T=x[M];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(b,T.key,T)}}return function(b,x,M){return x&&y(b.prototype,x),M&&y(b,M),b}}(),s=function y(b,x,M){b===null&&(b=Function.prototype);var T=Object.getOwnPropertyDescriptor(b,x);if(T===void 0){var j=Object.getPrototypeOf(b);return j===null?void 0:y(j,x,M)}else{if("value"in T)return T.value;var I=T.get;return I===void 0?void 0:I.call(M)}},c=a(35),d=v(c),w=a(5),_=v(w),E=a(9),O=v(E);function v(y){return y&&y.__esModule?y:{default:y}}function S(y,b){if(!(y instanceof b))throw new TypeError("Cannot call a class as a function")}function p(y,b){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:y}function h(y,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);y.prototype=Object.create(b&&b.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(y,b):y.__proto__=b)}var P=function(y){h(b,y);function b(){return S(this,b),p(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return l(b,null,[{key:"create",value:function(M){var T=s(b.__proto__||Object.getPrototypeOf(b),"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")}}]),b}(d.default);P.blotName="formula",P.className="ql-formula",P.tagName="SPAN";var g=function(y){h(b,y),l(b,null,[{key:"register",value:function(){_.default.register(P,!0)}}]);function b(){S(this,b);var x=p(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return x}return b}(O.default);n.FormulaBlot=P,n.default=g},function(t,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var l=function(){function M(T,j){for(var I=0;I<j.length;I++){var m=j[I];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(T,m.key,m)}}return function(T,j,I){return j&&M(T.prototype,j),I&&M(T,I),T}}(),s=function M(T,j,I){T===null&&(T=Function.prototype);var m=Object.getOwnPropertyDescriptor(T,j);if(m===void 0){var A=Object.getPrototypeOf(T);return A===null?void 0:M(A,j,I)}else{if("value"in m)return m.value;var L=m.get;return L===void 0?void 0:L.call(I)}},c=a(0),d=p(c),w=a(5),_=p(w),E=a(9),O=p(E),v=a(13),S=p(v);function p(M){return M&&M.__esModule?M:{default:M}}function h(M,T){if(!(M instanceof T))throw new TypeError("Cannot call a class as a function")}function P(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 y=function(M){g(T,M);function T(){return h(this,T),P(this,(T.__proto__||Object.getPrototypeOf(T)).apply(this,arguments))}return l(T,[{key:"replaceWith",value:function(I){this.domNode.textContent=this.domNode.textContent,this.attach(),s(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"replaceWith",this).call(this,I)}},{key:"highlight",value:function(I){var m=this.domNode.textContent;this.cachedText!==m&&((m.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=I(m),this.domNode.normalize(),this.attach()),this.cachedText=m)}}]),T}(S.default);y.className="ql-syntax";var b=new d.default.Attributor.Class("token","hljs",{scope:d.default.Scope.INLINE}),x=function(M){g(T,M),l(T,null,[{key:"register",value:function(){_.default.register(b,!0),_.default.register(y,!0)}}]);function T(j,I){h(this,T);var m=P(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,j,I));if(typeof m.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var A=null;return m.quill.on(_.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(A),A=setTimeout(function(){m.highlight(),A=null},m.options.interval)}),m.highlight(),m}return l(T,[{key:"highlight",value:function(){var I=this;if(!this.quill.selection.composing){this.quill.update(_.default.sources.USER);var m=this.quill.getSelection();this.quill.scroll.descendants(y).forEach(function(A){A.highlight(I.options.highlight)}),this.quill.update(_.default.sources.SILENT),m!=null&&this.quill.setSelection(m,_.default.sources.SILENT)}}}]),T}(O.default);x.DEFAULTS={highlight:function(){return window.hljs==null?null:function(M){var T=window.hljs.highlightAuto(M);return T.value}}(),interval:1e3},n.CodeBlock=y,n.CodeToken=b,n.default=x},function(t,n){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,n){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,n){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,n){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,n){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,n){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,n){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,n){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,n){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,n){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,n){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,n){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,n){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,n){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,n){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,n){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,n){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,n){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,n){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,n){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,n){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,n){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,n){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,n){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,n){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,n){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,n){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,n){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,n){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,n){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,n){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,n){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,n,a){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BubbleTooltip=void 0;var l=function T(j,I,m){j===null&&(j=Function.prototype);var A=Object.getOwnPropertyDescriptor(j,I);if(A===void 0){var L=Object.getPrototypeOf(j);return L===null?void 0:T(L,I,m)}else{if("value"in A)return A.value;var k=A.get;return k===void 0?void 0:k.call(m)}},s=function(){function T(j,I){for(var m=0;m<I.length;m++){var A=I[m];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(j,A.key,A)}}return function(j,I,m){return I&&T(j.prototype,I),m&&T(j,m),j}}(),c=a(3),d=h(c),w=a(8),_=h(w),E=a(43),O=h(E),v=a(15),S=a(41),p=h(S);function h(T){return T&&T.__esModule?T:{default:T}}function P(T,j){if(!(T instanceof j))throw new TypeError("Cannot call a class as a function")}function g(T,j){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j&&(typeof j=="object"||typeof j=="function")?j:T}function y(T,j){if(typeof j!="function"&&j!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof j);T.prototype=Object.create(j&&j.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),j&&(Object.setPrototypeOf?Object.setPrototypeOf(T,j):T.__proto__=j)}var b=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],x=function(T){y(j,T);function j(I,m){P(this,j),m.modules.toolbar!=null&&m.modules.toolbar.container==null&&(m.modules.toolbar.container=b);var A=g(this,(j.__proto__||Object.getPrototypeOf(j)).call(this,I,m));return A.quill.container.classList.add("ql-bubble"),A}return s(j,[{key:"extendToolbar",value:function(m){this.tooltip=new M(this.quill,this.options.bounds),this.tooltip.root.appendChild(m.container),this.buildButtons([].slice.call(m.container.querySelectorAll("button")),p.default),this.buildPickers([].slice.call(m.container.querySelectorAll("select")),p.default)}}]),j}(O.default);x.DEFAULTS=(0,d.default)(!0,{},O.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(j){j?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var M=function(T){y(j,T);function j(I,m){P(this,j);var A=g(this,(j.__proto__||Object.getPrototypeOf(j)).call(this,I,m));return A.quill.on(_.default.events.EDITOR_CHANGE,function(L,k,R,B){if(L===_.default.events.SELECTION_CHANGE)if(k!=null&&k.length>0&&B===_.default.sources.USER){A.show(),A.root.style.left="0px",A.root.style.width="",A.root.style.width=A.root.offsetWidth+"px";var X=A.quill.getLines(k.index,k.length);if(X.length===1)A.position(A.quill.getBounds(k));else{var Y=X[X.length-1],Q=A.quill.getIndex(Y),q=Math.min(Y.length()-1,k.index+k.length-Q),z=A.quill.getBounds(new v.Range(Q,q));A.position(z)}}else document.activeElement!==A.textbox&&A.quill.hasFocus()&&A.hide()}),A}return s(j,[{key:"listen",value:function(){var m=this;l(j.prototype.__proto__||Object.getPrototypeOf(j.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){m.root.classList.remove("ql-editing")}),this.quill.on(_.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!m.root.classList.contains("ql-hidden")){var A=m.quill.getSelection();A!=null&&m.position(m.quill.getBounds(A))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(m){var A=l(j.prototype.__proto__||Object.getPrototypeOf(j.prototype),"position",this).call(this,m),L=this.root.querySelector(".ql-tooltip-arrow");if(L.style.marginLeft="",A===0)return A;L.style.marginLeft=-1*A-L.offsetWidth/2+"px"}}]),j}(E.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(""),n.BubbleTooltip=M,n.default=x},function(t,n,a){t.exports=a(63)}]).default})}(ip)),ip.exports}var Va={},op={exports:{}},js={},yd={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var RO=yd.exports,q2;function MO(){return q2||(q2=1,function(e,i){(function(t){var n=i&&!i.nodeType&&i,a=e&&!e.nodeType&&e,l=typeof ic=="object"&&ic;(l.global===l||l.window===l||l.self===l)&&(t=l);var s,c=2147483647,d=36,w=1,_=26,E=38,O=700,v=72,S=128,p="-",h=/^xn--/,P=/[^\x20-\x7E]/,g=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=d-w,x=Math.floor,M=String.fromCharCode,T;function j(z){throw new RangeError(y[z])}function I(z,N){for(var U=z.length,$=[];U--;)$[U]=N(z[U]);return $}function m(z,N){var U=z.split("@"),$="";U.length>1&&($=U[0]+"@",z=U[1]),z=z.replace(g,".");var ee=z.split("."),G=I(ee,N).join(".");return $+G}function A(z){for(var N=[],U=0,$=z.length,ee,G;U<$;)ee=z.charCodeAt(U++),ee>=55296&&ee<=56319&&U<$?(G=z.charCodeAt(U++),(G&64512)==56320?N.push(((ee&1023)<<10)+(G&1023)+65536):(N.push(ee),U--)):N.push(ee);return N}function L(z){return I(z,function(N){var U="";return N>65535&&(N-=65536,U+=M(N>>>10&1023|55296),N=56320|N&1023),U+=M(N),U}).join("")}function k(z){return z-48<10?z-22:z-65<26?z-65:z-97<26?z-97:d}function R(z,N){return z+22+75*(z<26)-((N!=0)<<5)}function B(z,N,U){var $=0;for(z=U?x(z/O):z>>1,z+=x(z/N);z>b*_>>1;$+=d)z=x(z/b);return x($+(b+1)*z/(z+E))}function X(z){var N=[],U=z.length,$,ee=0,G=S,Z=v,W,te,re,ie,ae,se,de,he,Oe;for(W=z.lastIndexOf(p),W<0&&(W=0),te=0;te<W;++te)z.charCodeAt(te)>=128&&j("not-basic"),N.push(z.charCodeAt(te));for(re=W>0?W+1:0;re<U;){for(ie=ee,ae=1,se=d;re>=U&&j("invalid-input"),de=k(z.charCodeAt(re++)),(de>=d||de>x((c-ee)/ae))&&j("overflow"),ee+=de*ae,he=se<=Z?w:se>=Z+_?_:se-Z,!(de<he);se+=d)Oe=d-he,ae>x(c/Oe)&&j("overflow"),ae*=Oe;$=N.length+1,Z=B(ee-ie,$,ie==0),x(ee/$)>c-G&&j("overflow"),G+=x(ee/$),ee%=$,N.splice(ee++,0,G)}return L(N)}function Y(z){var N,U,$,ee,G,Z,W,te,re,ie,ae,se=[],de,he,Oe,_e;for(z=A(z),de=z.length,N=S,U=0,G=v,Z=0;Z<de;++Z)ae=z[Z],ae<128&&se.push(M(ae));for($=ee=se.length,ee&&se.push(p);$<de;){for(W=c,Z=0;Z<de;++Z)ae=z[Z],ae>=N&&ae<W&&(W=ae);for(he=$+1,W-N>x((c-U)/he)&&j("overflow"),U+=(W-N)*he,N=W,Z=0;Z<de;++Z)if(ae=z[Z],ae<N&&++U>c&&j("overflow"),ae==N){for(te=U,re=d;ie=re<=G?w:re>=G+_?_:re-G,!(te<ie);re+=d)_e=te-ie,Oe=d-ie,se.push(M(R(ie+_e%Oe,0))),te=x(_e/Oe);se.push(M(R(te,0))),G=B(U,he,$==ee),U=0,++$}++U,++N}return se.join("")}function Q(z){return m(z,function(N){return h.test(N)?X(N.slice(4).toLowerCase()):N})}function q(z){return m(z,function(N){return P.test(N)?"xn--"+Y(N):N})}if(s={version:"1.4.1",ucs2:{decode:A,encode:L},decode:X,encode:Y,toASCII:q,toUnicode:Q},n&&a)if(e.exports==n)a.exports=s;else for(T in s)s.hasOwnProperty(T)&&(n[T]=s[T]);else t.punycode=s})(RO)}(yd,yd.exports)),yd.exports}var s1,H2;function Sc(){return H2||(H2=1,s1=TypeError),s1}const LO={},NO=Object.freeze(Object.defineProperty({__proto__:null,default:LO},Symbol.toStringTag,{value:"Module"})),IO=Xl(NO);var u1,G2;function Up(){if(G2)return u1;G2=1;var e=typeof Map=="function"&&Map.prototype,i=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,t=e&&i&&typeof i.get=="function"?i.get:null,n=e&&Map.prototype.forEach,a=typeof Set=="function"&&Set.prototype,l=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=a&&l&&typeof l.get=="function"?l.get:null,c=a&&Set.prototype.forEach,d=typeof WeakMap=="function"&&WeakMap.prototype,w=d?WeakMap.prototype.has:null,_=typeof WeakSet=="function"&&WeakSet.prototype,E=_?WeakSet.prototype.has:null,O=typeof WeakRef=="function"&&WeakRef.prototype,v=O?WeakRef.prototype.deref:null,S=Boolean.prototype.valueOf,p=Object.prototype.toString,h=Function.prototype.toString,P=String.prototype.match,g=String.prototype.slice,y=String.prototype.replace,b=String.prototype.toUpperCase,x=String.prototype.toLowerCase,M=RegExp.prototype.test,T=Array.prototype.concat,j=Array.prototype.join,I=Array.prototype.slice,m=Math.floor,A=typeof BigInt=="function"?BigInt.prototype.valueOf:null,L=Object.getOwnPropertySymbols,k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,R=typeof Symbol=="function"&&typeof Symbol.iterator=="object",B=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===R||!0)?Symbol.toStringTag:null,X=Object.prototype.propertyIsEnumerable,Y=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(we){return we.__proto__}:null);function Q(we,Se){if(we===1/0||we===-1/0||we!==we||we&&we>-1e3&&we<1e3||M.call(/e/,Se))return Se;var gt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof we=="number"){var wt=we<0?-m(-we):m(we);if(wt!==we){var Pt=String(wt),vt=g.call(Se,Pt.length+1);return y.call(Pt,gt,"$&_")+"."+y.call(y.call(vt,/([0-9]{3})/g,"$&_"),/_$/,"")}}return y.call(Se,gt,"$&_")}var q=IO,z=q.custom,N=de(z)?z:null,U={__proto__:null,double:'"',single:"'"},$={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};u1=function we(Se,gt,wt,Pt){var vt=gt||{};if(_e(vt,"quoteStyle")&&!_e(U,vt.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(_e(vt,"maxStringLength")&&(typeof vt.maxStringLength=="number"?vt.maxStringLength<0&&vt.maxStringLength!==1/0:vt.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Wt=_e(vt,"customInspect")?vt.customInspect:!0;if(typeof Wt!="boolean"&&Wt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(_e(vt,"indent")&&vt.indent!==null&&vt.indent!==" "&&!(parseInt(vt.indent,10)===vt.indent&&vt.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(_e(vt,"numericSeparator")&&typeof vt.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var pn=vt.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 at(Se,vt);if(typeof Se=="number"){if(Se===0)return 1/0/Se>0?"0":"-0";var Fe=String(Se);return pn?Q(Se,Fe):Fe}if(typeof Se=="bigint"){var rt=String(Se)+"n";return pn?Q(Se,rt):rt}var ft=typeof vt.depth>"u"?5:vt.depth;if(typeof wt>"u"&&(wt=0),wt>=ft&&ft>0&&typeof Se=="object")return Z(Se)?"[Array]":"[Object]";var De=Ve(vt,wt);if(typeof Pt>"u")Pt=[];else if(pe(Pt,Se)>=0)return"[Circular]";function Ie(Gn,En,oi){if(En&&(Pt=I.call(Pt),Pt.push(En)),oi){var Ir={depth:vt.depth};return _e(vt,"quoteStyle")&&(Ir.quoteStyle=vt.quoteStyle),we(Gn,Ir,wt+1,Pt)}return we(Gn,vt,wt+1,Pt)}if(typeof Se=="function"&&!te(Se)){var Me=ce(Se),Ye=Ct(Se,Ie);return"[Function"+(Me?": "+Me:" (anonymous)")+"]"+(Ye.length>0?" { "+j.call(Ye,", ")+" }":"")}if(de(Se)){var Mt=R?y.call(String(Se),/^(Symbol\(.*\))_[^)]*$/,"$1"):k.call(Se);return typeof Se=="object"&&!R?et(Mt):Mt}if(je(Se)){for(var _t="<"+x.call(String(Se.nodeName)),Yt=Se.attributes||[],wn=0;wn<Yt.length;wn++)_t+=" "+Yt[wn].name+"="+ee(G(Yt[wn].value),"double",vt);return _t+=">",Se.childNodes&&Se.childNodes.length&&(_t+="..."),_t+="</"+x.call(String(Se.nodeName))+">",_t}if(Z(Se)){if(Se.length===0)return"[]";var Sn=Ct(Se,Ie);return De&&!Be(Sn)?"["+bt(Sn,De)+"]":"[ "+j.call(Sn,", ")+" ]"}if(re(Se)){var Qn=Ct(Se,Ie);return!("cause"in Error.prototype)&&"cause"in Se&&!X.call(Se,"cause")?"{ ["+String(Se)+"] "+j.call(T.call("[cause]: "+Ie(Se.cause),Qn),", ")+" }":Qn.length===0?"["+String(Se)+"]":"{ ["+String(Se)+"] "+j.call(Qn,", ")+" }"}if(typeof Se=="object"&&Wt){if(N&&typeof Se[N]=="function"&&q)return q(Se,{depth:ft-wt});if(Wt!=="symbol"&&typeof Se.inspect=="function")return Se.inspect()}if(Ce(Se)){var ii=[];return n&&n.call(Se,function(Gn,En){ii.push(Ie(En,Se,!0)+" => "+Ie(Gn,Se))}),ze("Map",t.call(Se),ii,De)}if(ve(Se)){var Sr=[];return c&&c.call(Se,function(Gn){Sr.push(Ie(Gn,Se))}),ze("Set",s.call(Se),Sr,De)}if(Le(Se))return Ke("WeakMap");if(xe(Se))return Ke("WeakSet");if(ue(Se))return Ke("WeakRef");if(ae(Se))return et(Ie(Number(Se)));if(he(Se))return et(Ie(A.call(Se)));if(se(Se))return et(S.call(Se));if(ie(Se))return et(Ie(String(Se)));if(typeof window<"u"&&Se===window)return"{ [object Window] }";if(typeof globalThis<"u"&&Se===globalThis||typeof ic<"u"&&Se===ic)return"{ [object globalThis] }";if(!W(Se)&&!te(Se)){var Ze=Ct(Se,Ie),Et=Y?Y(Se)===Object.prototype:Se instanceof Object||Se.constructor===Object,Lt=Se instanceof Object?"":"null prototype",Gt=!Et&&B&&Object(Se)===Se&&B in Se?g.call(Ae(Se),8,-1):Lt?"Object":"",Vt=Et||typeof Se.constructor!="function"?"":Se.constructor.name?Se.constructor.name+" ":"",Jn=Vt+(Gt||Lt?"["+j.call(T.call([],Gt||[],Lt||[]),": ")+"] ":"");return Ze.length===0?Jn+"{}":De?Jn+"{"+bt(Ze,De)+"}":Jn+"{ "+j.call(Ze,", ")+" }"}return String(Se)};function ee(we,Se,gt){var wt=gt.quoteStyle||Se,Pt=U[wt];return Pt+we+Pt}function G(we){return y.call(String(we),/"/g,"&quot;")}function Z(we){return Ae(we)==="[object Array]"&&(!B||!(typeof we=="object"&&B in we))}function W(we){return Ae(we)==="[object Date]"&&(!B||!(typeof we=="object"&&B in we))}function te(we){return Ae(we)==="[object RegExp]"&&(!B||!(typeof we=="object"&&B in we))}function re(we){return Ae(we)==="[object Error]"&&(!B||!(typeof we=="object"&&B in we))}function ie(we){return Ae(we)==="[object String]"&&(!B||!(typeof we=="object"&&B in we))}function ae(we){return Ae(we)==="[object Number]"&&(!B||!(typeof we=="object"&&B in we))}function se(we){return Ae(we)==="[object Boolean]"&&(!B||!(typeof we=="object"&&B in we))}function de(we){if(R)return we&&typeof we=="object"&&we instanceof Symbol;if(typeof we=="symbol")return!0;if(!we||typeof we!="object"||!k)return!1;try{return k.call(we),!0}catch{}return!1}function he(we){if(!we||typeof we!="object"||!A)return!1;try{return A.call(we),!0}catch{}return!1}var Oe=Object.prototype.hasOwnProperty||function(we){return we in this};function _e(we,Se){return Oe.call(we,Se)}function Ae(we){return p.call(we)}function ce(we){if(we.name)return we.name;var Se=P.call(h.call(we),/^function\s*([\w$]+)/);return Se?Se[1]:null}function pe(we,Se){if(we.indexOf)return we.indexOf(Se);for(var gt=0,wt=we.length;gt<wt;gt++)if(we[gt]===Se)return gt;return-1}function Ce(we){if(!t||!we||typeof we!="object")return!1;try{t.call(we);try{s.call(we)}catch{return!0}return we instanceof Map}catch{}return!1}function Le(we){if(!w||!we||typeof we!="object")return!1;try{w.call(we,w);try{E.call(we,E)}catch{return!0}return we instanceof WeakMap}catch{}return!1}function ue(we){if(!v||!we||typeof we!="object")return!1;try{return v.call(we),!0}catch{}return!1}function ve(we){if(!s||!we||typeof we!="object")return!1;try{s.call(we);try{t.call(we)}catch{return!0}return we instanceof Set}catch{}return!1}function xe(we){if(!E||!we||typeof we!="object")return!1;try{E.call(we,E);try{w.call(we,w)}catch{return!0}return we instanceof WeakSet}catch{}return!1}function je(we){return!we||typeof we!="object"?!1:typeof HTMLElement<"u"&&we instanceof HTMLElement?!0:typeof we.nodeName=="string"&&typeof we.getAttribute=="function"}function at(we,Se){if(we.length>Se.maxStringLength){var gt=we.length-Se.maxStringLength,wt="... "+gt+" more character"+(gt>1?"s":"");return at(g.call(we,0,Se.maxStringLength),Se)+wt}var Pt=$[Se.quoteStyle||"single"];Pt.lastIndex=0;var vt=y.call(y.call(we,Pt,"\\$1"),/[\x00-\x1f]/g,ht);return ee(vt,"single",Se)}function ht(we){var Se=we.charCodeAt(0),gt={8:"b",9:"t",10:"n",12:"f",13:"r"}[Se];return gt?"\\"+gt:"\\x"+(Se<16?"0":"")+b.call(Se.toString(16))}function et(we){return"Object("+we+")"}function Ke(we){return we+" { ? }"}function ze(we,Se,gt,wt){var Pt=wt?bt(gt,wt):j.call(gt,", ");return we+" ("+Se+") {"+Pt+"}"}function Be(we){for(var Se=0;Se<we.length;Se++)if(pe(we[Se],`
149
- `)>=0)return!1;return!0}function Ve(we,Se){var gt;if(we.indent===" ")gt=" ";else if(typeof we.indent=="number"&&we.indent>0)gt=j.call(Array(we.indent+1)," ");else return null;return{base:gt,prev:j.call(Array(Se+1),gt)}}function bt(we,Se){if(we.length===0)return"";var gt=`
150
- `+Se.prev+Se.base;return gt+j.call(we,","+gt)+`
151
- `+Se.prev}function Ct(we,Se){var gt=Z(we),wt=[];if(gt){wt.length=we.length;for(var Pt=0;Pt<we.length;Pt++)wt[Pt]=_e(we,Pt)?Se(we[Pt],we):""}var vt=typeof L=="function"?L(we):[],Wt;if(R){Wt={};for(var pn=0;pn<vt.length;pn++)Wt["$"+vt[pn]]=vt[pn]}for(var Fe in we)_e(we,Fe)&&(gt&&String(Number(Fe))===Fe&&Fe<we.length||R&&Wt["$"+Fe]instanceof Symbol||(M.call(/[^\w$]/,Fe)?wt.push(Se(Fe,we)+": "+Se(we[Fe],we)):wt.push(Fe+": "+Se(we[Fe],we))));if(typeof L=="function")for(var rt=0;rt<vt.length;rt++)X.call(we,vt[rt])&&wt.push("["+Se(vt[rt])+"]: "+Se(we[vt[rt]],we));return wt}return u1}var c1,V2;function DO(){if(V2)return c1;V2=1;var e=Up(),i=Sc(),t=function(c,d,w){for(var _=c,E;(E=_.next)!=null;_=E)if(E.key===d)return _.next=E.next,w||(E.next=c.next,c.next=E),E},n=function(c,d){if(c){var w=t(c,d);return w&&w.value}},a=function(c,d,w){var _=t(c,d);_?_.value=w:c.next={key:d,next:c.next,value:w}},l=function(c,d){return c?!!t(c,d):!1},s=function(c,d){if(c)return t(c,d,!0)};return c1=function(){var d,w={assert:function(_){if(!w.has(_))throw new i("Side channel does not contain "+e(_))},delete:function(_){var E=d&&d.next,O=s(d,_);return O&&E&&E===O&&(d=void 0),!!O},get:function(_){return n(d,_)},has:function(_){return l(d,_)},set:function(_,E){d||(d={next:void 0}),a(d,_,E)}};return w},c1}var f1,$2;function jO(){return $2||($2=1,f1=Object),f1}var d1,W2;function FO(){return W2||(W2=1,d1=Error),d1}var h1,Y2;function zO(){return Y2||(Y2=1,h1=EvalError),h1}var p1,K2;function BO(){return K2||(K2=1,p1=RangeError),p1}var g1,X2;function UO(){return X2||(X2=1,g1=ReferenceError),g1}var v1,Z2;function qO(){return Z2||(Z2=1,v1=SyntaxError),v1}var m1,Q2;function HO(){return Q2||(Q2=1,m1=URIError),m1}var y1,J2;function GO(){return J2||(J2=1,y1=Math.abs),y1}var b1,eb;function VO(){return eb||(eb=1,b1=Math.floor),b1}var _1,tb;function $O(){return tb||(tb=1,_1=Math.max),_1}var w1,nb;function WO(){return nb||(nb=1,w1=Math.min),w1}var S1,rb;function YO(){return rb||(rb=1,S1=Math.pow),S1}var E1,ib;function KO(){return ib||(ib=1,E1=Object.getOwnPropertyDescriptor),E1}var O1,ob;function c_(){if(ob)return O1;ob=1;var e=KO();if(e)try{e([],"length")}catch{e=null}return O1=e,O1}var x1,ab;function XO(){if(ab)return x1;ab=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return x1=e,x1}var P1,lb;function ZO(){return lb||(lb=1,P1=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var i={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;i[t]=a;for(var l in i)return!1;if(typeof Object.keys=="function"&&Object.keys(i).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(i).length!==0)return!1;var s=Object.getOwnPropertySymbols(i);if(s.length!==1||s[0]!==t||!Object.prototype.propertyIsEnumerable.call(i,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(i,t);if(c.value!==a||c.enumerable!==!0)return!1}return!0}),P1}var C1,sb;function QO(){if(sb)return C1;sb=1;var e=typeof Symbol<"u"&&Symbol,i=ZO();return C1=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:i()},C1}var k1,ub;function JO(){if(ub)return k1;ub=1;var e="Function.prototype.bind called on incompatible ",i=Object.prototype.toString,t=Math.max,n="[object Function]",a=function(d,w){for(var _=[],E=0;E<d.length;E+=1)_[E]=d[E];for(var O=0;O<w.length;O+=1)_[O+d.length]=w[O];return _},l=function(d,w){for(var _=[],E=w,O=0;E<d.length;E+=1,O+=1)_[O]=d[E];return _},s=function(c,d){for(var w="",_=0;_<c.length;_+=1)w+=c[_],_+1<c.length&&(w+=d);return w};return k1=function(d){var w=this;if(typeof w!="function"||i.apply(w)!==n)throw new TypeError(e+w);for(var _=l(arguments,1),E,O=function(){if(this instanceof E){var P=w.apply(this,a(_,arguments));return Object(P)===P?P:this}return w.apply(d,a(_,arguments))},v=t(0,w.length-_.length),S=[],p=0;p<v;p++)S[p]="$"+p;if(E=Function("binder","return function ("+s(S,",")+"){ return binder.apply(this,arguments); }")(O),w.prototype){var h=function(){};h.prototype=w.prototype,E.prototype=new h,h.prototype=null}return E},k1}var A1,cb;function qp(){if(cb)return A1;cb=1;var e=JO();return A1=Function.prototype.bind||e,A1}var T1,fb;function Mv(){return fb||(fb=1,T1=Function.prototype.call),T1}var R1,db;function f_(){return db||(db=1,R1=Function.prototype.apply),R1}var M1,hb;function ex(){return hb||(hb=1,M1=typeof Reflect<"u"&&Reflect&&Reflect.apply),M1}var L1,pb;function tx(){if(pb)return L1;pb=1;var e=qp(),i=f_(),t=Mv(),n=ex();return L1=n||e.call(t,i),L1}var N1,gb;function d_(){if(gb)return N1;gb=1;var e=qp(),i=Sc(),t=Mv(),n=tx();return N1=function(l){if(l.length<1||typeof l[0]!="function")throw new i("a function is required");return n(e,t,l)},N1}var I1,vb;function nx(){if(vb)return I1;vb=1;var e=d_(),i=c_(),t=[].__proto__===Array.prototype,n=t&&i&&i(Object.prototype,"__proto__"),a=Object,l=a.getPrototypeOf;return I1=n&&typeof n.get=="function"?e([n.get]):typeof l=="function"?function(c){return l(c==null?c:a(c))}:!1,I1}var D1,mb;function rx(){if(mb)return D1;mb=1;var e=Function.prototype.call,i=Object.prototype.hasOwnProperty,t=qp();return D1=t.call(e,i),D1}var j1,yb;function Lv(){if(yb)return j1;yb=1;var e,i=jO(),t=FO(),n=zO(),a=BO(),l=UO(),s=qO(),c=Sc(),d=HO(),w=GO(),_=VO(),E=$O(),O=WO(),v=YO(),S=Function,p=function(Z){try{return S('"use strict"; return ('+Z+").constructor;")()}catch{}},h=c_(),P=XO(),g=function(){throw new c},y=h?function(){try{return arguments.callee,g}catch{try{return h(arguments,"callee").get}catch{return g}}}():g,b=QO()(),x=nx(),M=typeof Reflect=="function"&&Reflect.getPrototypeOf||i.getPrototypeOf||x,T=f_(),j=Mv(),I={},m=typeof Uint8Array>"u"||!M?e:M(Uint8Array),A={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":b&&M?M([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":I,"%AsyncGenerator%":I,"%AsyncGeneratorFunction%":I,"%AsyncIteratorPrototype%":I,"%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%":n,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":S,"%GeneratorFunction%":I,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":b&&M?M(M([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!b||!M?e:M(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":h,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":a,"%ReferenceError%":l,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!b||!M?e:M(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":b&&M?M(""[Symbol.iterator]()):e,"%Symbol%":b?Symbol:e,"%SyntaxError%":s,"%ThrowTypeError%":y,"%TypedArray%":m,"%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%":d,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":j,"%Function.prototype.apply%":T,"%Object.defineProperty%":P,"%Math.abs%":w,"%Math.floor%":_,"%Math.max%":E,"%Math.min%":O,"%Math.pow%":v};if(M)try{null.error}catch(Z){var L=M(M(Z));A["%Error.prototype%"]=L}var k=function Z(W){var te;if(W==="%AsyncFunction%")te=p("async function () {}");else if(W==="%GeneratorFunction%")te=p("function* () {}");else if(W==="%AsyncGeneratorFunction%")te=p("async function* () {}");else if(W==="%AsyncGenerator%"){var re=Z("%AsyncGeneratorFunction%");re&&(te=re.prototype)}else if(W==="%AsyncIteratorPrototype%"){var ie=Z("%AsyncGenerator%");ie&&M&&(te=M(ie.prototype))}return A[W]=te,te},R={__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"]},B=qp(),X=rx(),Y=B.call(j,Array.prototype.concat),Q=B.call(T,Array.prototype.splice),q=B.call(j,String.prototype.replace),z=B.call(j,String.prototype.slice),N=B.call(j,RegExp.prototype.exec),U=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,$=/\\(\\)?/g,ee=function(W){var te=z(W,0,1),re=z(W,-1);if(te==="%"&&re!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(re==="%"&&te!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var ie=[];return q(W,U,function(ae,se,de,he){ie[ie.length]=de?q(he,$,"$1"):se||ae}),ie},G=function(W,te){var re=W,ie;if(X(R,re)&&(ie=R[re],re="%"+ie[0]+"%"),X(A,re)){var ae=A[re];if(ae===I&&(ae=k(re)),typeof ae>"u"&&!te)throw new c("intrinsic "+W+" exists, but is not available. Please file an issue!");return{alias:ie,name:re,value:ae}}throw new s("intrinsic "+W+" does not exist!")};return j1=function(W,te){if(typeof W!="string"||W.length===0)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof te!="boolean")throw new c('"allowMissing" argument must be a boolean');if(N(/^%?[^%]*%?$/,W)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var re=ee(W),ie=re.length>0?re[0]:"",ae=G("%"+ie+"%",te),se=ae.name,de=ae.value,he=!1,Oe=ae.alias;Oe&&(ie=Oe[0],Q(re,Y([0,1],Oe)));for(var _e=1,Ae=!0;_e<re.length;_e+=1){var ce=re[_e],pe=z(ce,0,1),Ce=z(ce,-1);if((pe==='"'||pe==="'"||pe==="`"||Ce==='"'||Ce==="'"||Ce==="`")&&pe!==Ce)throw new s("property names with quotes must have matching quotes");if((ce==="constructor"||!Ae)&&(he=!0),ie+="."+ce,se="%"+ie+"%",X(A,se))de=A[se];else if(de!=null){if(!(ce in de)){if(!te)throw new c("base intrinsic for "+W+" exists, but the property is not available.");return}if(h&&_e+1>=re.length){var Le=h(de,ce);Ae=!!Le,Ae&&"get"in Le&&!("originalValue"in Le.get)?de=Le.get:de=de[ce]}else Ae=X(de,ce),de=de[ce];Ae&&!he&&(A[se]=de)}}return de},j1}var F1,bb;function h_(){if(bb)return F1;bb=1;var e=Lv(),i=d_(),t=i([e("%String.prototype.indexOf%")]);return F1=function(a,l){var s=e(a,!!l);return typeof s=="function"&&t(a,".prototype.")>-1?i([s]):s},F1}var z1,_b;function p_(){if(_b)return z1;_b=1;var e=Lv(),i=h_(),t=Up(),n=Sc(),a=e("%Map%",!0),l=i("Map.prototype.get",!0),s=i("Map.prototype.set",!0),c=i("Map.prototype.has",!0),d=i("Map.prototype.delete",!0),w=i("Map.prototype.size",!0);return z1=!!a&&function(){var E,O={assert:function(v){if(!O.has(v))throw new n("Side channel does not contain "+t(v))},delete:function(v){if(E){var S=d(E,v);return w(E)===0&&(E=void 0),S}return!1},get:function(v){if(E)return l(E,v)},has:function(v){return E?c(E,v):!1},set:function(v,S){E||(E=new a),s(E,v,S)}};return O},z1}var B1,wb;function ix(){if(wb)return B1;wb=1;var e=Lv(),i=h_(),t=Up(),n=p_(),a=Sc(),l=e("%WeakMap%",!0),s=i("WeakMap.prototype.get",!0),c=i("WeakMap.prototype.set",!0),d=i("WeakMap.prototype.has",!0),w=i("WeakMap.prototype.delete",!0);return B1=l?function(){var E,O,v={assert:function(S){if(!v.has(S))throw new a("Side channel does not contain "+t(S))},delete:function(S){if(l&&S&&(typeof S=="object"||typeof S=="function")){if(E)return w(E,S)}else if(n&&O)return O.delete(S);return!1},get:function(S){return l&&S&&(typeof S=="object"||typeof S=="function")&&E?s(E,S):O&&O.get(S)},has:function(S){return l&&S&&(typeof S=="object"||typeof S=="function")&&E?d(E,S):!!O&&O.has(S)},set:function(S,p){l&&S&&(typeof S=="object"||typeof S=="function")?(E||(E=new l),c(E,S,p)):n&&(O||(O=n()),O.set(S,p))}};return v}:n,B1}var U1,Sb;function ox(){if(Sb)return U1;Sb=1;var e=Sc(),i=Up(),t=DO(),n=p_(),a=ix(),l=a||n||t;return U1=function(){var c,d={assert:function(w){if(!d.has(w))throw new e("Side channel does not contain "+i(w))},delete:function(w){return!!c&&c.delete(w)},get:function(w){return c&&c.get(w)},has:function(w){return!!c&&c.has(w)},set:function(w,_){c||(c=l()),c.set(w,_)}};return d},U1}var q1,Eb;function Nv(){if(Eb)return q1;Eb=1;var e=String.prototype.replace,i=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return q1={default:t.RFC3986,formatters:{RFC1738:function(n){return e.call(n,i,"+")},RFC3986:function(n){return String(n)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},q1}var H1,Ob;function g_(){if(Ob)return H1;Ob=1;var e=Nv(),i=Object.prototype.hasOwnProperty,t=Array.isArray,n=function(){for(var h=[],P=0;P<256;++P)h.push("%"+((P<16?"0":"")+P.toString(16)).toUpperCase());return h}(),a=function(P){for(;P.length>1;){var g=P.pop(),y=g.obj[g.prop];if(t(y)){for(var b=[],x=0;x<y.length;++x)typeof y[x]<"u"&&b.push(y[x]);g.obj[g.prop]=b}}},l=function(P,g){for(var y=g&&g.plainObjects?{__proto__:null}:{},b=0;b<P.length;++b)typeof P[b]<"u"&&(y[b]=P[b]);return y},s=function h(P,g,y){if(!g)return P;if(typeof g!="object"&&typeof g!="function"){if(t(P))P.push(g);else if(P&&typeof P=="object")(y&&(y.plainObjects||y.allowPrototypes)||!i.call(Object.prototype,g))&&(P[g]=!0);else return[P,g];return P}if(!P||typeof P!="object")return[P].concat(g);var b=P;return t(P)&&!t(g)&&(b=l(P,y)),t(P)&&t(g)?(g.forEach(function(x,M){if(i.call(P,M)){var T=P[M];T&&typeof T=="object"&&x&&typeof x=="object"?P[M]=h(T,x,y):P.push(x)}else P[M]=x}),P):Object.keys(g).reduce(function(x,M){var T=g[M];return i.call(x,M)?x[M]=h(x[M],T,y):x[M]=T,x},b)},c=function(P,g){return Object.keys(g).reduce(function(y,b){return y[b]=g[b],y},P)},d=function(h,P,g){var y=h.replace(/\+/g," ");if(g==="iso-8859-1")return y.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(y)}catch{return y}},w=1024,_=function(P,g,y,b,x){if(P.length===0)return P;var M=P;if(typeof P=="symbol"?M=Symbol.prototype.toString.call(P):typeof P!="string"&&(M=String(P)),y==="iso-8859-1")return escape(M).replace(/%u[0-9a-f]{4}/gi,function(k){return"%26%23"+parseInt(k.slice(2),16)+"%3B"});for(var T="",j=0;j<M.length;j+=w){for(var I=M.length>=w?M.slice(j,j+w):M,m=[],A=0;A<I.length;++A){var L=I.charCodeAt(A);if(L===45||L===46||L===95||L===126||L>=48&&L<=57||L>=65&&L<=90||L>=97&&L<=122||x===e.RFC1738&&(L===40||L===41)){m[m.length]=I.charAt(A);continue}if(L<128){m[m.length]=n[L];continue}if(L<2048){m[m.length]=n[192|L>>6]+n[128|L&63];continue}if(L<55296||L>=57344){m[m.length]=n[224|L>>12]+n[128|L>>6&63]+n[128|L&63];continue}A+=1,L=65536+((L&1023)<<10|I.charCodeAt(A)&1023),m[m.length]=n[240|L>>18]+n[128|L>>12&63]+n[128|L>>6&63]+n[128|L&63]}T+=m.join("")}return T},E=function(P){for(var g=[{obj:{o:P},prop:"o"}],y=[],b=0;b<g.length;++b)for(var x=g[b],M=x.obj[x.prop],T=Object.keys(M),j=0;j<T.length;++j){var I=T[j],m=M[I];typeof m=="object"&&m!==null&&y.indexOf(m)===-1&&(g.push({obj:M,prop:I}),y.push(m))}return a(g),P},O=function(P){return Object.prototype.toString.call(P)==="[object RegExp]"},v=function(P){return!P||typeof P!="object"?!1:!!(P.constructor&&P.constructor.isBuffer&&P.constructor.isBuffer(P))},S=function(P,g){return[].concat(P,g)},p=function(P,g){if(t(P)){for(var y=[],b=0;b<P.length;b+=1)y.push(g(P[b]));return y}return g(P)};return H1={arrayToObject:l,assign:c,combine:S,compact:E,decode:d,encode:_,isBuffer:v,isRegExp:O,maybeMap:p,merge:s},H1}var G1,xb;function ax(){if(xb)return G1;xb=1;var e=ox(),i=g_(),t=Nv(),n=Object.prototype.hasOwnProperty,a={brackets:function(h){return h+"[]"},comma:"comma",indices:function(h,P){return h+"["+P+"]"},repeat:function(h){return h}},l=Array.isArray,s=Array.prototype.push,c=function(p,h){s.apply(p,l(h)?h:[h])},d=Date.prototype.toISOString,w=t.default,_={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:i.encode,encodeValuesOnly:!1,filter:void 0,format:w,formatter:t.formatters[w],indices:!1,serializeDate:function(h){return d.call(h)},skipNulls:!1,strictNullHandling:!1},E=function(h){return typeof h=="string"||typeof h=="number"||typeof h=="boolean"||typeof h=="symbol"||typeof h=="bigint"},O={},v=function p(h,P,g,y,b,x,M,T,j,I,m,A,L,k,R,B,X,Y){for(var Q=h,q=Y,z=0,N=!1;(q=q.get(O))!==void 0&&!N;){var U=q.get(h);if(z+=1,typeof U<"u"){if(U===z)throw new RangeError("Cyclic object value");N=!0}typeof q.get(O)>"u"&&(z=0)}if(typeof I=="function"?Q=I(P,Q):Q instanceof Date?Q=L(Q):g==="comma"&&l(Q)&&(Q=i.maybeMap(Q,function(Oe){return Oe instanceof Date?L(Oe):Oe})),Q===null){if(x)return j&&!B?j(P,_.encoder,X,"key",k):P;Q=""}if(E(Q)||i.isBuffer(Q)){if(j){var $=B?P:j(P,_.encoder,X,"key",k);return[R($)+"="+R(j(Q,_.encoder,X,"value",k))]}return[R(P)+"="+R(String(Q))]}var ee=[];if(typeof Q>"u")return ee;var G;if(g==="comma"&&l(Q))B&&j&&(Q=i.maybeMap(Q,j)),G=[{value:Q.length>0?Q.join(",")||null:void 0}];else if(l(I))G=I;else{var Z=Object.keys(Q);G=m?Z.sort(m):Z}var W=T?String(P).replace(/\./g,"%2E"):String(P),te=y&&l(Q)&&Q.length===1?W+"[]":W;if(b&&l(Q)&&Q.length===0)return te+"[]";for(var re=0;re<G.length;++re){var ie=G[re],ae=typeof ie=="object"&&ie&&typeof ie.value<"u"?ie.value:Q[ie];if(!(M&&ae===null)){var se=A&&T?String(ie).replace(/\./g,"%2E"):String(ie),de=l(Q)?typeof g=="function"?g(te,se):te:te+(A?"."+se:"["+se+"]");Y.set(h,z);var he=e();he.set(O,Y),c(ee,p(ae,de,g,y,b,x,M,T,g==="comma"&&B&&l(Q)?null:j,I,m,A,L,k,R,B,X,he))}}return ee},S=function(h){if(!h)return _;if(typeof h.allowEmptyArrays<"u"&&typeof h.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof h.encodeDotInKeys<"u"&&typeof h.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(h.encoder!==null&&typeof h.encoder<"u"&&typeof h.encoder!="function")throw new TypeError("Encoder has to be a function.");var P=h.charset||_.charset;if(typeof h.charset<"u"&&h.charset!=="utf-8"&&h.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 h.format<"u"){if(!n.call(t.formatters,h.format))throw new TypeError("Unknown format option provided.");g=h.format}var y=t.formatters[g],b=_.filter;(typeof h.filter=="function"||l(h.filter))&&(b=h.filter);var x;if(h.arrayFormat in a?x=h.arrayFormat:"indices"in h?x=h.indices?"indices":"repeat":x=_.arrayFormat,"commaRoundTrip"in h&&typeof h.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var M=typeof h.allowDots>"u"?h.encodeDotInKeys===!0?!0:_.allowDots:!!h.allowDots;return{addQueryPrefix:typeof h.addQueryPrefix=="boolean"?h.addQueryPrefix:_.addQueryPrefix,allowDots:M,allowEmptyArrays:typeof h.allowEmptyArrays=="boolean"?!!h.allowEmptyArrays:_.allowEmptyArrays,arrayFormat:x,charset:P,charsetSentinel:typeof h.charsetSentinel=="boolean"?h.charsetSentinel:_.charsetSentinel,commaRoundTrip:!!h.commaRoundTrip,delimiter:typeof h.delimiter>"u"?_.delimiter:h.delimiter,encode:typeof h.encode=="boolean"?h.encode:_.encode,encodeDotInKeys:typeof h.encodeDotInKeys=="boolean"?h.encodeDotInKeys:_.encodeDotInKeys,encoder:typeof h.encoder=="function"?h.encoder:_.encoder,encodeValuesOnly:typeof h.encodeValuesOnly=="boolean"?h.encodeValuesOnly:_.encodeValuesOnly,filter:b,format:g,formatter:y,serializeDate:typeof h.serializeDate=="function"?h.serializeDate:_.serializeDate,skipNulls:typeof h.skipNulls=="boolean"?h.skipNulls:_.skipNulls,sort:typeof h.sort=="function"?h.sort:null,strictNullHandling:typeof h.strictNullHandling=="boolean"?h.strictNullHandling:_.strictNullHandling}};return G1=function(p,h){var P=p,g=S(h),y,b;typeof g.filter=="function"?(b=g.filter,P=b("",P)):l(g.filter)&&(b=g.filter,y=b);var x=[];if(typeof P!="object"||P===null)return"";var M=a[g.arrayFormat],T=M==="comma"&&g.commaRoundTrip;y||(y=Object.keys(P)),g.sort&&y.sort(g.sort);for(var j=e(),I=0;I<y.length;++I){var m=y[I],A=P[m];g.skipNulls&&A===null||c(x,v(A,m,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,j))}var L=x.join(g.delimiter),k=g.addQueryPrefix===!0?"?":"";return g.charsetSentinel&&(g.charset==="iso-8859-1"?k+="utf8=%26%2310003%3B&":k+="utf8=%E2%9C%93&"),L.length>0?k+L:""},G1}var V1,Pb;function lx(){if(Pb)return V1;Pb=1;var e=g_(),i=Object.prototype.hasOwnProperty,t=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:e.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},a=function(O){return O.replace(/&#(\d+);/g,function(v,S){return String.fromCharCode(parseInt(S,10))})},l=function(O,v){return O&&typeof O=="string"&&v.comma&&O.indexOf(",")>-1?O.split(","):O},s="utf8=%26%2310003%3B",c="utf8=%E2%9C%93",d=function(v,S){var p={__proto__:null},h=S.ignoreQueryPrefix?v.replace(/^\?/,""):v;h=h.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var P=S.parameterLimit===1/0?void 0:S.parameterLimit,g=h.split(S.delimiter,P),y=-1,b,x=S.charset;if(S.charsetSentinel)for(b=0;b<g.length;++b)g[b].indexOf("utf8=")===0&&(g[b]===c?x="utf-8":g[b]===s&&(x="iso-8859-1"),y=b,b=g.length);for(b=0;b<g.length;++b)if(b!==y){var M=g[b],T=M.indexOf("]="),j=T===-1?M.indexOf("="):T+1,I,m;j===-1?(I=S.decoder(M,n.decoder,x,"key"),m=S.strictNullHandling?null:""):(I=S.decoder(M.slice(0,j),n.decoder,x,"key"),m=e.maybeMap(l(M.slice(j+1),S),function(L){return S.decoder(L,n.decoder,x,"value")})),m&&S.interpretNumericEntities&&x==="iso-8859-1"&&(m=a(String(m))),M.indexOf("[]=")>-1&&(m=t(m)?[m]:m);var A=i.call(p,I);A&&S.duplicates==="combine"?p[I]=e.combine(p[I],m):(!A||S.duplicates==="last")&&(p[I]=m)}return p},w=function(O,v,S,p){for(var h=p?v:l(v,S),P=O.length-1;P>=0;--P){var g,y=O[P];if(y==="[]"&&S.parseArrays)g=S.allowEmptyArrays&&(h===""||S.strictNullHandling&&h===null)?[]:[].concat(h);else{g=S.plainObjects?{__proto__:null}:{};var b=y.charAt(0)==="["&&y.charAt(y.length-1)==="]"?y.slice(1,-1):y,x=S.decodeDotInKeys?b.replace(/%2E/g,"."):b,M=parseInt(x,10);!S.parseArrays&&x===""?g={0:h}:!isNaN(M)&&y!==x&&String(M)===x&&M>=0&&S.parseArrays&&M<=S.arrayLimit?(g=[],g[M]=h):x!=="__proto__"&&(g[x]=h)}h=g}return h},_=function(v,S,p,h){if(v){var P=p.allowDots?v.replace(/\.([^.[]+)/g,"[$1]"):v,g=/(\[[^[\]]*])/,y=/(\[[^[\]]*])/g,b=p.depth>0&&g.exec(P),x=b?P.slice(0,b.index):P,M=[];if(x){if(!p.plainObjects&&i.call(Object.prototype,x)&&!p.allowPrototypes)return;M.push(x)}for(var T=0;p.depth>0&&(b=y.exec(P))!==null&&T<p.depth;){if(T+=1,!p.plainObjects&&i.call(Object.prototype,b[1].slice(1,-1))&&!p.allowPrototypes)return;M.push(b[1])}if(b){if(p.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+p.depth+" and strictDepth is true");M.push("["+P.slice(b.index)+"]")}return w(M,S,p,h)}},E=function(v){if(!v)return n;if(typeof v.allowEmptyArrays<"u"&&typeof v.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof v.decodeDotInKeys<"u"&&typeof v.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(v.decoder!==null&&typeof v.decoder<"u"&&typeof v.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof v.charset<"u"&&v.charset!=="utf-8"&&v.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var S=typeof v.charset>"u"?n.charset:v.charset,p=typeof v.duplicates>"u"?n.duplicates:v.duplicates;if(p!=="combine"&&p!=="first"&&p!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var h=typeof v.allowDots>"u"?v.decodeDotInKeys===!0?!0:n.allowDots:!!v.allowDots;return{allowDots:h,allowEmptyArrays:typeof v.allowEmptyArrays=="boolean"?!!v.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof v.allowPrototypes=="boolean"?v.allowPrototypes:n.allowPrototypes,allowSparse:typeof v.allowSparse=="boolean"?v.allowSparse:n.allowSparse,arrayLimit:typeof v.arrayLimit=="number"?v.arrayLimit:n.arrayLimit,charset:S,charsetSentinel:typeof v.charsetSentinel=="boolean"?v.charsetSentinel:n.charsetSentinel,comma:typeof v.comma=="boolean"?v.comma:n.comma,decodeDotInKeys:typeof v.decodeDotInKeys=="boolean"?v.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof v.decoder=="function"?v.decoder:n.decoder,delimiter:typeof v.delimiter=="string"||e.isRegExp(v.delimiter)?v.delimiter:n.delimiter,depth:typeof v.depth=="number"||v.depth===!1?+v.depth:n.depth,duplicates:p,ignoreQueryPrefix:v.ignoreQueryPrefix===!0,interpretNumericEntities:typeof v.interpretNumericEntities=="boolean"?v.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof v.parameterLimit=="number"?v.parameterLimit:n.parameterLimit,parseArrays:v.parseArrays!==!1,plainObjects:typeof v.plainObjects=="boolean"?v.plainObjects:n.plainObjects,strictDepth:typeof v.strictDepth=="boolean"?!!v.strictDepth:n.strictDepth,strictNullHandling:typeof v.strictNullHandling=="boolean"?v.strictNullHandling:n.strictNullHandling}};return V1=function(O,v){var S=E(v);if(O===""||O===null||typeof O>"u")return S.plainObjects?{__proto__:null}:{};for(var p=typeof O=="string"?d(O,S):O,h=S.plainObjects?{__proto__:null}:{},P=Object.keys(p),g=0;g<P.length;++g){var y=P[g],b=_(y,p[y],S,typeof O=="string");h=e.merge(h,b,S)}return S.allowSparse===!0?h:e.compact(h)},V1}var $1,Cb;function sx(){if(Cb)return $1;Cb=1;var e=ax(),i=lx(),t=Nv();return $1={formats:t,parse:i,stringify:e},$1}var kb;function v_(){if(kb)return js;kb=1;var e=MO();function i(){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,n=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,l=["<",">",'"',"`"," ","\r",`
152
- `," "],s=["{","}","|","\\","^","`"].concat(l),c=["'"].concat(s),d=["%","/","?",";","#"].concat(c),w=["/","?","#"],_=255,E=/^[+a-z0-9A-Z_-]{0,63}$/,O=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},S={javascript:!0,"javascript:":!0},p={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},h=sx();function P(x,M,T){if(x&&typeof x=="object"&&x instanceof i)return x;var j=new i;return j.parse(x,M,T),j}i.prototype.parse=function(x,M,T){if(typeof x!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof x);var j=x.indexOf("?"),I=j!==-1&&j<x.indexOf("#")?"?":"#",m=x.split(I),A=/\\/g;m[0]=m[0].replace(A,"/"),x=m.join(I);var L=x;if(L=L.trim(),!T&&x.split("#").length===1){var k=a.exec(L);if(k)return this.path=L,this.href=L,this.pathname=k[1],k[2]?(this.search=k[2],M?this.query=h.parse(this.search.substr(1)):this.query=this.search.substr(1)):M&&(this.search="",this.query={}),this}var R=t.exec(L);if(R){R=R[0];var B=R.toLowerCase();this.protocol=B,L=L.substr(R.length)}if(T||R||L.match(/^\/\/[^@/]+@[^@/]+/)){var X=L.substr(0,2)==="//";X&&!(R&&S[R])&&(L=L.substr(2),this.slashes=!0)}if(!S[R]&&(X||R&&!p[R])){for(var Y=-1,Q=0;Q<w.length;Q++){var q=L.indexOf(w[Q]);q!==-1&&(Y===-1||q<Y)&&(Y=q)}var z,N;Y===-1?N=L.lastIndexOf("@"):N=L.lastIndexOf("@",Y),N!==-1&&(z=L.slice(0,N),L=L.slice(N+1),this.auth=decodeURIComponent(z)),Y=-1;for(var Q=0;Q<d.length;Q++){var q=L.indexOf(d[Q]);q!==-1&&(Y===-1||q<Y)&&(Y=q)}Y===-1&&(Y=L.length),this.host=L.slice(0,Y),L=L.slice(Y),this.parseHost(),this.hostname=this.hostname||"";var U=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!U)for(var $=this.hostname.split(/\./),Q=0,ee=$.length;Q<ee;Q++){var G=$[Q];if(G&&!G.match(E)){for(var Z="",W=0,te=G.length;W<te;W++)G.charCodeAt(W)>127?Z+="x":Z+=G[W];if(!Z.match(E)){var re=$.slice(0,Q),ie=$.slice(Q+1),ae=G.match(O);ae&&(re.push(ae[1]),ie.unshift(ae[2])),ie.length&&(L="/"+ie.join(".")+L),this.hostname=re.join(".");break}}}this.hostname.length>_?this.hostname="":this.hostname=this.hostname.toLowerCase(),U||(this.hostname=e.toASCII(this.hostname));var se=this.port?":"+this.port:"",de=this.hostname||"";this.host=de+se,this.href+=this.host,U&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),L[0]!=="/"&&(L="/"+L))}if(!v[B])for(var Q=0,ee=c.length;Q<ee;Q++){var he=c[Q];if(L.indexOf(he)!==-1){var Oe=encodeURIComponent(he);Oe===he&&(Oe=escape(he)),L=L.split(he).join(Oe)}}var _e=L.indexOf("#");_e!==-1&&(this.hash=L.substr(_e),L=L.slice(0,_e));var Ae=L.indexOf("?");if(Ae!==-1?(this.search=L.substr(Ae),this.query=L.substr(Ae+1),M&&(this.query=h.parse(this.query)),L=L.slice(0,Ae)):M&&(this.search="",this.query={}),L&&(this.pathname=L),p[B]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var se=this.pathname||"",ce=this.search||"";this.path=se+ce}return this.href=this.format(),this};function g(x){return typeof x=="string"&&(x=P(x)),x instanceof i?x.format():i.prototype.format.call(x)}i.prototype.format=function(){var x=this.auth||"";x&&(x=encodeURIComponent(x),x=x.replace(/%3A/i,":"),x+="@");var M=this.protocol||"",T=this.pathname||"",j=this.hash||"",I=!1,m="";this.host?I=x+this.host:this.hostname&&(I=x+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(I+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(m=h.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var A=this.search||m&&"?"+m||"";return M&&M.substr(-1)!==":"&&(M+=":"),this.slashes||(!M||p[M])&&I!==!1?(I="//"+(I||""),T&&T.charAt(0)!=="/"&&(T="/"+T)):I||(I=""),j&&j.charAt(0)!=="#"&&(j="#"+j),A&&A.charAt(0)!=="?"&&(A="?"+A),T=T.replace(/[?#]/g,function(L){return encodeURIComponent(L)}),A=A.replace("#","%23"),M+I+T+A+j};function y(x,M){return P(x,!1,!0).resolve(M)}i.prototype.resolve=function(x){return this.resolveObject(P(x,!1,!0)).format()};function b(x,M){return x?P(x,!1,!0).resolveObject(M):M}return i.prototype.resolveObject=function(x){if(typeof x=="string"){var M=new i;M.parse(x,!1,!0),x=M}for(var T=new i,j=Object.keys(this),I=0;I<j.length;I++){var m=j[I];T[m]=this[m]}if(T.hash=x.hash,x.href==="")return T.href=T.format(),T;if(x.slashes&&!x.protocol){for(var A=Object.keys(x),L=0;L<A.length;L++){var k=A[L];k!=="protocol"&&(T[k]=x[k])}return p[T.protocol]&&T.hostname&&!T.pathname&&(T.pathname="/",T.path=T.pathname),T.href=T.format(),T}if(x.protocol&&x.protocol!==T.protocol){if(!p[x.protocol]){for(var R=Object.keys(x),B=0;B<R.length;B++){var X=R[B];T[X]=x[X]}return T.href=T.format(),T}if(T.protocol=x.protocol,!x.host&&!S[x.protocol]){for(var ee=(x.pathname||"").split("/");ee.length&&!(x.host=ee.shift()););x.host||(x.host=""),x.hostname||(x.hostname=""),ee[0]!==""&&ee.unshift(""),ee.length<2&&ee.unshift(""),T.pathname=ee.join("/")}else T.pathname=x.pathname;if(T.search=x.search,T.query=x.query,T.host=x.host||"",T.auth=x.auth,T.hostname=x.hostname||x.host,T.port=x.port,T.pathname||T.search){var Y=T.pathname||"",Q=T.search||"";T.path=Y+Q}return T.slashes=T.slashes||x.slashes,T.href=T.format(),T}var q=T.pathname&&T.pathname.charAt(0)==="/",z=x.host||x.pathname&&x.pathname.charAt(0)==="/",N=z||q||T.host&&x.pathname,U=N,$=T.pathname&&T.pathname.split("/")||[],ee=x.pathname&&x.pathname.split("/")||[],G=T.protocol&&!p[T.protocol];if(G&&(T.hostname="",T.port=null,T.host&&($[0]===""?$[0]=T.host:$.unshift(T.host)),T.host="",x.protocol&&(x.hostname=null,x.port=null,x.host&&(ee[0]===""?ee[0]=x.host:ee.unshift(x.host)),x.host=null),N=N&&(ee[0]===""||$[0]==="")),z)T.host=x.host||x.host===""?x.host:T.host,T.hostname=x.hostname||x.hostname===""?x.hostname:T.hostname,T.search=x.search,T.query=x.query,$=ee;else if(ee.length)$||($=[]),$.pop(),$=$.concat(ee),T.search=x.search,T.query=x.query;else if(x.search!=null){if(G){T.host=$.shift(),T.hostname=T.host;var Z=T.host&&T.host.indexOf("@")>0?T.host.split("@"):!1;Z&&(T.auth=Z.shift(),T.hostname=Z.shift(),T.host=T.hostname)}return T.search=x.search,T.query=x.query,(T.pathname!==null||T.search!==null)&&(T.path=(T.pathname?T.pathname:"")+(T.search?T.search:"")),T.href=T.format(),T}if(!$.length)return T.pathname=null,T.search?T.path="/"+T.search:T.path=null,T.href=T.format(),T;for(var W=$.slice(-1)[0],te=(T.host||x.host||$.length>1)&&(W==="."||W==="..")||W==="",re=0,ie=$.length;ie>=0;ie--)W=$[ie],W==="."?$.splice(ie,1):W===".."?($.splice(ie,1),re++):re&&($.splice(ie,1),re--);if(!N&&!U)for(;re--;re)$.unshift("..");N&&$[0]!==""&&(!$[0]||$[0].charAt(0)!=="/")&&$.unshift(""),te&&$.join("/").substr(-1)!=="/"&&$.push("");var ae=$[0]===""||$[0]&&$[0].charAt(0)==="/";if(G){T.hostname=ae?"":$.length?$.shift():"",T.host=T.hostname;var Z=T.host&&T.host.indexOf("@")>0?T.host.split("@"):!1;Z&&(T.auth=Z.shift(),T.hostname=Z.shift(),T.host=T.hostname)}return N=N||T.host&&$.length,N&&!ae&&$.unshift(""),$.length>0?T.pathname=$.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=x.auth||T.auth,T.slashes=T.slashes||x.slashes,T.href=T.format(),T},i.prototype.parseHost=function(){var x=this.host,M=n.exec(x);M&&(M=M[0],M!==":"&&(this.port=M.substr(1)),x=x.substr(0,x.length-M.length)),x&&(this.hostname=x)},js.parse=P,js.resolve=y,js.resolveObject=b,js.format=g,js.Url=i,js}var ap={exports:{}},ux=ap.exports,Ab;function cx(){return Ab||(Ab=1,function(e){(function(i,t){e.exports?e.exports=t():i.xmlserializer=t()})(ux,function(){var i=function(v){return v.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")},t=function(v){return v.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")},n=function(v){return v.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},a=function(v){var S=v.value;return" "+v.name+'="'+t(S)+'"'},l=function(v){var S=v.tagName;return v.namespaceURI==="http://www.w3.org/1999/xhtml"&&(S=S.toLowerCase()),S},s=function(v,S){var p=Array.prototype.map.call(v.attributes||v.attrs,function(h){return h.name}).indexOf("xmlns")>=0;return!p&&(S||v.namespaceURI!==v.parentNode.namespaceURI)?' xmlns="'+v.namespaceURI+'"':""},c=function(v){return Array.prototype.map.call(v.childNodes,function(S){return O(S)}).join("")},d=function(v,S){var p="<"+l(v);return p+=s(v,S),Array.prototype.forEach.call(v.attributes||v.attrs,function(h){p+=a(h)}),v.childNodes.length>0?(p+=">",p+=c(v),p+="</"+l(v)+">"):p+="/>",p},w=function(v){var S=v.nodeValue||v.value||"";return n(S)},_=function(v){return"<!--"+v.data.replace(/-/g,"&#45;")+"-->"},E=function(v){return"<![CDATA["+v.nodeValue+"]]>"},O=function(v,S){var p=S&&S.rootNode;if(v.nodeName==="#document"||v.nodeName==="#document-fragment")return c(v);if(v.tagName)return d(v,p);if(v.nodeName==="#text")return w(v);if(v.nodeName==="#comment")return _(v);if(v.nodeName==="#cdata-section")return E(v)};return{serializeToString:function(v){return i(O(v,{rootNode:!0}))}}})}(ap)),ap.exports}var W1={},Tb;function fx(){if(Tb)return W1;Tb=1;var e=function(l){var s=new XMLSerializer;return Array.prototype.map.call(l.childNodes,function(c){return s.serializeToString(c)}).join("")},i=function(l){if(l.documentElement.tagName==="parsererror"&&l.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml")return l.documentElement;if((l.documentElement.tagName==="xml"||l.documentElement.tagName==="html")&&l.documentElement.childNodes&&l.documentElement.childNodes.length>0&&l.documentElement.childNodes[0].nodeName==="parsererror")return l.documentElement.childNodes[0];if(l.documentElement.tagName==="html"&&l.documentElement.childNodes&&l.documentElement.childNodes.length>0&&l.documentElement.childNodes[0].nodeName==="body"&&l.documentElement.childNodes[0].childNodes&&l.documentElement.childNodes[0].childNodes.length&&l.documentElement.childNodes[0].childNodes[0].nodeName==="parsererror")return l.documentElement.childNodes[0].childNodes[0]},t=[new RegExp(`^<h3[^>]*>This page contains the following errors:</h3><div[^>]*>(.+?)
153
- ?</div>`),new RegExp(`^(.+)
154
- `)],n=function(l){var s=e(l),c,d;for(c=0;c<t.length;c++)if(d=t[c].exec(s),d)return d[1]},a=function(l){var s;if(l===null)throw new Error("Parse error");var c=i(l);if(c!==void 0)throw s=n(c)||"Parse error",new Error(s)};return W1.failOnParseError=function(l){return a(l),l},W1}var Y1={},K1={},Rb;function Hp(){return Rb||(Rb=1,function(e){var i=v_();e.getDocumentBaseUrl=function(c){return c.baseURI!=="about:blank"?c.baseURI:null},e.clone=function(c){var d={},w;for(w in c)c.hasOwnProperty(w)&&(d[w]=c[w]);return d},e.cloneArray=function(c){return Array.prototype.slice.apply(c,[0])},e.joinUrl=function(c,d){return c?i.resolve(c,d):d},e.isDataUri=function(c){return/^data:/.test(c)},e.collectAndReportErrors=function(c){var d=[];return Promise.all(c.map(function(w){return w.catch(function(_){d.push(_)})})).then(function(){return d})};var t=null,n=function(c,d){return d===!1||d==="none"||d==="repeated"?((t===null||d!=="repeated")&&(t=Date.now()),c+"?_="+t):c};e.ajax=function(c,d){return new Promise(function(w,_){var E=new window.XMLHttpRequest,O=e.joinUrl(d.baseUrl,c),v,S=function(){_({msg:"Unable to load url",url:O})};v=n(O,d.cache),E.addEventListener("load",function(){E.status===200||E.status===0?w(E.response):S()},!1),E.addEventListener("error",S,!1);try{E.open("GET",v,!0),E.overrideMimeType(d.mimeType),E.send(null)}catch{S()}})},e.binaryAjax=function(c,d){var w=e.clone(d);return w.mimeType="text/plain; charset=x-user-defined",e.ajax(c,w).then(function(_){for(var E="",O=0;O<_.length;O++)E+=String.fromCharCode(_.charCodeAt(O)&255);return E})};var a=function(c){var d=function(w,_){return w.substring(0,_.length)===_};return d(c,"<?xml")||d(c,"<svg")?"image/svg+xml":"image/png"};e.getDataURIForImageURL=function(c,d){return e.binaryAjax(c,d).then(function(w){var _=btoa(w),E=a(w);return"data:"+E+";base64,"+_})};var l=[],s=function(c){return l.indexOf(c)<0&&l.push(c),l.indexOf(c)};e.memoize=function(c,d,w){if(typeof w!="object")throw new Error("cacheBucket is not an object");return function(){var _=Array.prototype.slice.call(arguments),E=d(_),O=s(c),v;return w[O]&&w[O][E]?w[O][E]:(v=c.apply(null,_),w[O]=w[O]||{},w[O][E]=v,v)}}}(K1)),K1}var X1={},Mb;function dx(){if(Mb)return X1;Mb=1;var e=Hp(),i=function(l,s){var c=null;l.hasAttribute("src")?c=l.getAttribute("src"):l.hasAttributeNS("http://www.w3.org/1999/xlink","href")?c=l.getAttributeNS("http://www.w3.org/1999/xlink","href"):l.hasAttribute("href")&&(c=l.getAttribute("href"));var d=e.getDocumentBaseUrl(l.ownerDocument),w=e.clone(s);return!w.baseUrl&&d&&(w.baseUrl=d),e.getDataURIForImageURL(c,w).then(function(_){return _},function(_){throw{resourceType:"image",url:_.url,msg:"Unable to load image "+_.url}})},t=function(l){return l.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)})},n=function(l){return Array.prototype.filter.call(l,function(s){return s.type==="image"})},a=function(l){return Array.prototype.slice.call(l)};return X1.inline=function(l,s){var c=a(l.getElementsByTagName("img")),d=a(l.getElementsByTagName("image")),w=n(l.getElementsByTagName("input"));c=c.concat(d),c=c.concat(w);var _=t(c);return e.collectAndReportErrors(_.map(function(E){return i(E,s).then(function(O){E.attributes.src?E.attributes.src.value=O:E.attributes["xlink:href"]?E.attributes["xlink:href"].value=O:E.attributes.href&&(E.attributes.href.value=O)})}))},X1}var Z1={},Lb;function hx(){if(Lb)return Z1;Lb=1;var e=Hp(),i=function(l,s){var c=l.attributes.src.value,d=e.getDocumentBaseUrl(l.ownerDocument),w=e.clone(s);return!w.baseUrl&&d&&(w.baseUrl=d),e.ajax(c,w).catch(function(_){throw{resourceType:"script",url:_.url,msg:"Unable to load script "+_.url}})},t=function(l){return l.replace(/<\//g,"<\\/")},n=function(l,s){l.attributes.removeNamedItem("src"),l.textContent=t(s)},a=function(l){var s=l.getElementsByTagName("script");return Array.prototype.filter.call(s,function(c){return!!c.attributes.src})};return Z1.inline=function(l,s){var c=a(l);return e.collectAndReportErrors(c.map(function(d){return i(d,s).then(function(w){n(d,w)})}))},Z1}var Q1={},J1={},Nb;function Iv(){return Nb||(Nb=1,function(e){e.unquoteString=function(i){var t=/^"(.*)"$/,n=/^'(.*)'$/;return t.test(i)?i.replace(t,"$1"):n.test(i)?i.replace(n,"$1"):i},e.rulesForCssText=function(i){var t=document.implementation.createHTMLDocument(""),n=document.createElement("style"),a;return n.textContent=i,t.body.appendChild(n),a=n.sheet.cssRules,Array.prototype.slice.call(a)},e.cssRulesToText=function(i){return i.reduce(function(t,n){return t+n.cssText},"")},e.exchangeRule=function(i,t,n){var a=i.indexOf(t);i[a]=e.rulesForCssText(n)[0]},e.changeFontFaceRuleSrc=function(i,t,n){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: "+n+"}",e.exchangeRule(i,t,a)}}(J1)),J1}var eg={},Ib;function px(){return Ib||(Ib=1,function(e){var i=Iv(),t=function(l){var s=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return l.replace(s,"$1")};e.extractCssUrl=function(l){var s=/^url\(("[^"]+"|'[^']+'|[^\)]+)\)/,c;if(!s.test(l))throw new Error("Invalid url");return c=s.exec(l)[1],i.unquoteString(t(c))};var n=function(l){var s=`\\s*(?:"[^"]*"|'[^']*'|[^\\(]+)\\s*`,c="(url\\("+s+"\\)|[^,\\s]+)",d="(?:\\s*"+c+")+",w="^\\s*("+d+")(?:\\s*,\\s*("+d+"))*\\s*$",_=new RegExp(d,"g"),E,O=[],v=function(S){var p=new RegExp(c,"g"),h=[],P;for(P=p.exec(S);P;)h.push(P[1]),P=p.exec(S);return h};if(l.match(new RegExp(w))){for(E=_.exec(l);E;)O.push(v(E[0])),E=_.exec(l);return O}return[]},a=function(l){var s,c;for(s=0;s<l.length;s++)try{return c=e.extractCssUrl(l[s]),{url:c,idx:s}}catch{}};e.parse=function(l){var s=n(l);return s.map(function(c){var d=a(c);return d?{preUrl:c.slice(0,d.idx),url:d.url,postUrl:c.slice(d.idx+1)}:{preUrl:c}})},e.serialize=function(l){var s=l.map(function(c){var d=[].concat(c.preUrl);return c.url&&d.push('url("'+c.url+'")'),c.postUrl&&(d=d.concat(c.postUrl)),d.join(" ")});return s.join(", ")}}(eg)),eg}function ep(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 tg={exports:{}},Db;function gx(){return Db||(Db=1,function(e,i){(function(t){e.exports=t()})(function(){return function t(n,a,l){function s(w,_){if(!a[w]){if(!n[w]){var E=typeof ep=="function"&&ep;if(!_&&E)return E(w,!0);if(c)return c(w,!0);var O=new Error("Cannot find module '"+w+"'");throw O.code="MODULE_NOT_FOUND",O}var v=a[w]={exports:{}};n[w][0].call(v.exports,function(S){var p=n[w][1][S];return s(p||S)},v,v.exports,t,n,a,l)}return a[w].exports}for(var c=typeof ep=="function"&&ep,d=0;d<l.length;d++)s(l[d]);return s}({1:[function(t,n,a){function l(d,w){function _(){this.constructor=d}_.prototype=w.prototype,d.prototype=new _}function s(d,w,_,E){this.message=d,this.expected=w,this.found=_,this.location=E,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,s)}l(s,Error),s.buildMessage=function(d,w){var _={literal:function(P){return'"'+O(P.text)+'"'},class:function(P){var g="",y;for(y=0;y<P.parts.length;y++)g+=P.parts[y]instanceof Array?v(P.parts[y][0])+"-"+v(P.parts[y][1]):v(P.parts[y]);return"["+(P.inverted?"^":"")+g+"]"},any:function(P){return"any character"},end:function(P){return"end of input"},other:function(P){return P.description}};function E(P){return P.charCodeAt(0).toString(16).toUpperCase()}function O(P){return P.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(g){return"\\x0"+E(g)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(g){return"\\x"+E(g)})}function v(P){return P.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(g){return"\\x0"+E(g)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(g){return"\\x"+E(g)})}function S(P){return _[P.type](P)}function p(P){var g=new Array(P.length),y,b;for(y=0;y<P.length;y++)g[y]=S(P[y]);if(g.sort(),g.length>0){for(y=1,b=1;y<g.length;y++)g[y-1]!==g[y]&&(g[b]=g[y],b++);g.length=b}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 h(P){return P?'"'+O(P)+'"':"end of input"}return"Expected "+p(d)+" but "+h(w)+" found."};function c(d,w){w=w!==void 0?w:{};var _={},E={start:se},O=se,v="",S=function(){return[]},p=",",h=G(",",!1),P=function(ue,ve){return[ue].concat(ve)},g=function(ue){return[ue]},y=function(ue,ve){return{url:ue,format:ve}},b=function(ue){return{url:ue}},x="url(",M=G("url(",!1),T=")",j=G(")",!1),I=function(ue){return ue},m="format(",A=G("format(",!1),L="local(",k=G("local(",!1),R=function(ue){return{local:ue}},B=/^[^)]/,X=Z([")"],!0,!1),Y=function(ue){return Le.extractValue(ue.join(""))},Q=/^[ \t\r\n\f]/,q=Z([" "," ","\r",`
155
- `,"\f"],!1,!1),z=0,N=[{line:1,column:1}],U=0,$=[],ee;if("startRule"in w){if(!(w.startRule in E))throw new Error(`Can't start parsing from rule "`+w.startRule+'".');O=E[w.startRule]}function G(ue,ve){return{type:"literal",text:ue,ignoreCase:ve}}function Z(ue,ve,xe){return{type:"class",parts:ue,inverted:ve,ignoreCase:xe}}function W(){return{type:"end"}}function te(ue){var ve=N[ue],xe;if(ve)return ve;for(xe=ue-1;!N[xe];)xe--;for(ve=N[xe],ve={line:ve.line,column:ve.column};xe<ue;)d.charCodeAt(xe)===10?(ve.line++,ve.column=1):ve.column++,xe++;return N[ue]=ve,ve}function re(ue,ve){var xe=te(ue),je=te(ve);return{start:{offset:ue,line:xe.line,column:xe.column},end:{offset:ve,line:je.line,column:je.column}}}function ie(ue){z<U||(z>U&&(U=z,$=[]),$.push(ue))}function ae(ue,ve,xe){return new s(s.buildMessage(ue,ve),ue,ve,xe)}function se(){var ue,ve;return ue=de(),ue===_&&(ue=z,ve=v,ve!==_&&(ve=S()),ue=ve),ue}function de(){var ue,ve,xe,je,at,ht;if(ue=z,ve=he(),ve!==_){for(xe=[],je=Ce();je!==_;)xe.push(je),je=Ce();if(xe!==_)if(d.charCodeAt(z)===44?(je=p,z++):(je=_,ie(h)),je!==_){for(at=[],ht=Ce();ht!==_;)at.push(ht),ht=Ce();at!==_?(ht=de(),ht!==_?(ve=P(ve,ht),ue=ve):(z=ue,ue=_)):(z=ue,ue=_)}else z=ue,ue=_;else z=ue,ue=_}else z=ue,ue=_;return ue===_&&(ue=z,ve=he(),ve!==_&&(ve=g(ve)),ue=ve),ue}function he(){var ue;return ue=Oe(),ue===_&&(ue=ce()),ue}function Oe(){var ue,ve,xe,je;if(ue=z,ve=_e(),ve!==_){if(xe=[],je=Ce(),je!==_)for(;je!==_;)xe.push(je),je=Ce();else xe=_;xe!==_?(je=Ae(),je!==_?(ve=y(ve,je),ue=ve):(z=ue,ue=_)):(z=ue,ue=_)}else z=ue,ue=_;return ue===_&&(ue=z,ve=_e(),ve!==_&&(ve=b(ve)),ue=ve),ue}function _e(){var ue,ve,xe,je;return ue=z,d.substr(z,4)===x?(ve=x,z+=4):(ve=_,ie(M)),ve!==_?(xe=pe(),xe!==_?(d.charCodeAt(z)===41?(je=T,z++):(je=_,ie(j)),je!==_?(ve=I(xe),ue=ve):(z=ue,ue=_)):(z=ue,ue=_)):(z=ue,ue=_),ue}function Ae(){var ue,ve,xe,je;return ue=z,d.substr(z,7)===m?(ve=m,z+=7):(ve=_,ie(A)),ve!==_?(xe=pe(),xe!==_?(d.charCodeAt(z)===41?(je=T,z++):(je=_,ie(j)),je!==_?(ve=I(xe),ue=ve):(z=ue,ue=_)):(z=ue,ue=_)):(z=ue,ue=_),ue}function ce(){var ue,ve,xe,je;return ue=z,d.substr(z,6)===L?(ve=L,z+=6):(ve=_,ie(k)),ve!==_?(xe=pe(),xe!==_?(d.charCodeAt(z)===41?(je=T,z++):(je=_,ie(j)),je!==_?(ve=R(xe),ue=ve):(z=ue,ue=_)):(z=ue,ue=_)):(z=ue,ue=_),ue}function pe(){var ue,ve,xe;if(ue=z,ve=[],B.test(d.charAt(z))?(xe=d.charAt(z),z++):(xe=_,ie(X)),xe!==_)for(;xe!==_;)ve.push(xe),B.test(d.charAt(z))?(xe=d.charAt(z),z++):(xe=_,ie(X));else ve=_;return ve!==_&&(ve=Y(ve)),ue=ve,ue}function Ce(){var ue;return Q.test(d.charAt(z))?(ue=d.charAt(z),z++):(ue=_,ie(q)),ue}var Le=t("../util");if(ee=O(),ee!==_&&z===d.length)return ee;throw ee!==_&&z<d.length&&ie(W()),ae($,U<d.length?d.charAt(U):null,U<d.length?re(U,U+1):re(U,U))}n.exports={SyntaxError:s,parse:c}},{"../util":3}],2:[function(t,n,a){var l=t("./grammar");a.SyntaxError=function(s,c){this.message=s,this.offset=c},a.parse=function(s){try{return l.parse(s)}catch(c){throw new a.SyntaxError(c.message,c.offset)}},a.serialize=function(s){return s.map(function(c){var d;return c.url?(d='url("'+c.url+'")',c.format&&(d+=' format("'+c.format+'")')):d='local("'+c.local+'")',d}).join(", ")}},{"./grammar":1}],3:[function(t,n,a){var l=function(c){var d=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return c.replace(d,"$1")},s=function(c){var d=/^"(.*)"$/,w=/^'(.*)'$/;return d.test(c)?c.replace(d,"$1"):w.test(c)?c.replace(w,"$1"):c};a.extractValue=function(c){return s(l(c))}},{}]},{},[2])(2)})}(tg)),tg.exports}var jb;function vx(){return jb||(jb=1,function(e){var i=Hp(),t=Iv(),n=px(),a=gx(),l=function(g,y,b){g.style.setProperty(y,b,g.style.getPropertyPriority(y))},s=function(g){return g.filter(function(y){return y.type===window.CSSRule.STYLE_RULE&&(y.style.getPropertyValue("background-image")||y.style.getPropertyValue("background"))})},c=function(g){var y=[];return g.forEach(function(b){b.style.getPropertyValue("background-image")?y.push({property:"background-image",value:b.style.getPropertyValue("background-image"),rule:b}):b.style.getPropertyValue("background")&&y.push({property:"background",value:b.style.getPropertyValue("background"),rule:b})}),y},d=function(g){return g.filter(function(y){return y.type===window.CSSRule.FONT_FACE_RULE&&y.style.getPropertyValue("src")})},w=function(g){return g.filter(function(y){return y.type===window.CSSRule.IMPORT_RULE&&y.href})},_=function(g){var y=[];return g.forEach(function(b,x){b.url&&!i.isDataUri(b.url)&&y.push(x)}),y},E=function(g){var y=[];return g.forEach(function(b,x){b.url&&!i.isDataUri(b.url)&&y.push(x)}),y};e.adjustPathsOfCssResources=function(g,y){var b=s(y),x=c(b),M=!1;return x.forEach(function(T){var j=n.parse(T.value),I=_(j),m;I.length>0&&(I.forEach(function(A){var L=j[A].url,k=i.joinUrl(g,L);j[A].url=k}),m=n.serialize(j),l(T.rule,T.property,m),M=!0)}),d(y).forEach(function(T){var j=T.style.getPropertyValue("src"),I,m;try{I=a.parse(j)}catch{return}m=E(I),m.length>0&&(m.forEach(function(A){var L=I[A].url,k=i.joinUrl(g,L);I[A].url=k}),t.changeFontFaceRuleSrc(y,T,a.serialize(I)),M=!0)}),w(y).forEach(function(T){var j=T.href,I=i.joinUrl(g,j);t.exchangeRule(y,T,"@import url("+I+");"),M=!0}),M};var O=function(g,y,b){var x=g.indexOf(y);g.splice(x,1),b.forEach(function(M,T){g.splice(x+T,0,M)})},v=function(g,y,b,x){var M=y.href,T;return M=t.unquoteString(M),T=i.joinUrl(x.baseUrl,M),b.indexOf(T)>=0?(O(g,y,[]),Promise.resolve([])):(b.push(T),i.ajax(M,x).then(function(j){var I=t.rulesForCssText(j);return e.loadCSSImportsForRules(I,b,x).then(function(m){return e.adjustPathsOfCssResources(M,I),O(g,y,I),m.errors})},function(j){throw{resourceType:"stylesheet",url:j.url,msg:"Unable to load stylesheet "+j.url}}))};e.loadCSSImportsForRules=function(g,y,b){var x=w(g),M=[],T=!1;return Promise.all(x.map(function(j){return v(g,j,y,b).then(function(I){M=M.concat(I),T=!0},function(I){M.push(I)})})).then(function(){return{hasChanges:T,errors:M}})};var S=function(g,y){var b=n.parse(g),x=_(b),M=!1;return i.collectAndReportErrors(x.map(function(T){var j=b[T].url;return i.getDataURIForImageURL(j,y).then(function(I){b[T].url=I,M=!0},function(I){throw{resourceType:"backgroundImage",url:I.url,msg:"Unable to load background-image "+I.url}})})).then(function(T){return{backgroundValue:n.serialize(b),hasChanges:M,errors:T}})},p=function(g,y){var b=s(g),x=c(b),M=[],T=!1;return Promise.all(x.map(function(j){return S(j.value,y).then(function(I){I.hasChanges&&(l(j.rule,j.property,I.backgroundValue),T=!0),M=M.concat(I.errors)})})).then(function(){return{hasChanges:T,errors:M}})},h=function(g,y){var b=!1,x,M;try{x=a.parse(g)}catch{x=[]}return M=E(x),i.collectAndReportErrors(M.map(function(T){var j=x[T],I=j.format||"woff";return i.binaryAjax(j.url,y).then(function(m){var A=btoa(m);j.url="data:font/"+I+";base64,"+A,b=!0},function(m){throw{resourceType:"fontFace",url:m.url,msg:"Unable to load font-face "+m.url}})})).then(function(T){return{srcDeclarationValue:a.serialize(x),hasChanges:b,errors:T}})},P=function(g,y){var b=d(g),x=[],M=!1;return Promise.all(b.map(function(T){var j=T.style.getPropertyValue("src");return h(j,y).then(function(I){I.hasChanges&&(t.changeFontFaceRuleSrc(g,T,I.srcDeclarationValue),M=!0),x=x.concat(I.errors)})})).then(function(){return{hasChanges:M,errors:x}})};e.loadAndInlineCSSResourcesForRules=function(g,y){var b=!1,x=[];return Promise.all([p,P].map(function(M){return M(g,y).then(function(T){b=b||T.hasChanges,x=x.concat(T.errors)})})).then(function(){return{hasChanges:b,errors:x}})}}(Q1)),Q1}var Fb;function mx(){return Fb||(Fb=1,function(e){var i=Hp(),t=dx(),n=hx(),a=vx(),l=Iv(),s=function(h){return i.joinUrl(h,".")},c=function(h){var P=h.map(function(g,y){return y===h.length-1&&(g={baseUrl:s(g.baseUrl)}),JSON.stringify(g)});return P},d=function(h,P){return P.cache!==!1&&P.cache!=="none"&&P.cacheBucket?i.memoize(h,c,P.cacheBucket):h},w=function(h,P,g){var y=l.rulesForCssText(h);return a.loadCSSImportsForRules(y,P,g).then(function(b){return a.loadAndInlineCSSResourcesForRules(y,g).then(function(x){var M=b.errors.concat(x.errors),T=b.hasChanges||x.hasChanges;return T&&(h=l.cssRulesToText(y)),{hasChanges:T,content:h,errors:M}})})},_=function(h,P,g){var y=h.textContent,b=d(w,P);return b(y,g,P).then(function(x){return x.hasChanges&&(h.childNodes[0].nodeValue=x.content),i.cloneArray(x.errors)})},E=function(h){var P=h.getElementsByTagName("style");return Array.prototype.filter.call(P,function(g){return!g.attributes.type||g.attributes.type.value==="text/css"})};e.loadAndInlineStyles=function(h,P){var g=E(h),y=[],b=[],x;return x=i.clone(P),x.baseUrl=x.baseUrl||i.getDocumentBaseUrl(h),Promise.all(g.map(function(M){return _(M,x,b).then(function(T){y=y.concat(T)})})).then(function(){return y})};var O=function(h,P){var g=h.parentNode,y;P=P.trim(),P&&(y=h.ownerDocument.createElement("style"),y.type="text/css",y.appendChild(h.ownerDocument.createTextNode(P)),g.insertBefore(y,h)),g.removeChild(h)},v=function(h,P){return i.ajax(h,P).then(function(g){var y=l.rulesForCssText(g);return{content:g,cssRules:y}}).then(function(g){var y=a.adjustPathsOfCssResources(h,g.cssRules);return{content:g.content,cssRules:g.cssRules,hasChanges:y}}).then(function(g){return a.loadCSSImportsForRules(g.cssRules,[],P).then(function(y){return{content:g.content,cssRules:g.cssRules,hasChanges:g.hasChanges||y.hasChanges,errors:y.errors}})}).then(function(g){return a.loadAndInlineCSSResourcesForRules(g.cssRules,P).then(function(y){return{content:g.content,cssRules:g.cssRules,hasChanges:g.hasChanges||y.hasChanges,errors:g.errors.concat(y.errors)}})}).then(function(g){var y=g.content;return g.hasChanges&&(y=l.cssRulesToText(g.cssRules)),{content:y,errors:g.errors}})},S=function(h,P){var g=h.attributes.href.value,y=i.getDocumentBaseUrl(h.ownerDocument),b=i.clone(P);!b.baseUrl&&y&&(b.baseUrl=y);var x=d(v,P);return x(g,b).then(function(M){return{content:M.content,errors:i.cloneArray(M.errors)}})},p=function(h){var P=h.getElementsByTagName("link");return Array.prototype.filter.call(P,function(g){return g.attributes.rel&&g.attributes.rel.value==="stylesheet"&&(!g.attributes.type||g.attributes.type.value==="text/css")})};e.loadAndInlineCssLinks=function(h,P){var g=p(h),y=[];return Promise.all(g.map(function(b){return S(b,P).then(function(x){O(b,x.content+`
156
- `),y=y.concat(x.errors)},function(x){y.push({resourceType:"stylesheet",url:x.url,msg:"Unable to load stylesheet "+x.url})})})).then(function(){return y})},e.loadAndInlineImages=t.inline,e.loadAndInlineScript=n.inline,e.inlineReferences=function(h,P){var g=[],y=[e.loadAndInlineImages,e.loadAndInlineStyles,e.loadAndInlineCssLinks];return P.inlineScripts!==!1&&y.push(e.loadAndInlineScript),Promise.all(y.map(function(b){return b(h,P).then(function(x){g=g.concat(x)})})).then(function(){return g})}}(Y1)),Y1}/*! 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 yx=op.exports,zb;function bx(){return zb||(zb=1,function(e){(function(i,t){i===void 0&&window!==void 0&&(i=window),e.exports?e.exports=t(v_(),cx(),fx(),mx()):i.rasterizeHTML=t(i.url,i.xmlserializer,i.sanedomparsererror,i.inlineresources)})(yx,function(i,t,n,a){var l=function(S){var p={},h=[];p.joinUrl=function(y,b){return y?S.resolve(y,b):b},p.getConstantUniqueIdFor=function(y){return h.indexOf(y)<0&&h.push(y),h.indexOf(y)},p.clone=function(y){var b={},x;for(x in y)y.hasOwnProperty(x)&&(b[x]=y[x]);return b};var P=function(y){return typeof y=="object"&&y!==null},g=function(y){return P(y)&&Object.prototype.toString.apply(y).match(/\[object (Canvas|HTMLCanvasElement)\]/i)};return p.parseOptionalParameters=function(y){var b={canvas:null,options:{}};return y[0]==null||g(y[0])?(b.canvas=y[0]||null,b.options=p.clone(y[1])):b.options=p.clone(y[0]),b},p}(i),s=function(S){var p={},h=function(P,g,y){var b=P[g];return P[g]=function(){var x=Array.prototype.slice.call(arguments);return y.apply(this,[x,b])},b};return p.baseUrlRespectingXhr=function(P,g){var y=function(){var b=new P;return h(b,"open",function(x,M){var T=x.shift(),j=x.shift(),I=S.joinUrl(g,j);return M.apply(this,[T,I].concat(x))}),b};return y},p.finishNotifyingXhr=function(P){var g=0,y=0,b=!1,x,M=new Promise(function(j){x=function(){var I=g-y;I<=0&&b&&j({totalCount:g})}}),T=function(){var j=new P;return h(j,"send",function(I,m){return g+=1,m.apply(this,arguments)}),j.addEventListener("load",function(){y+=1,x()}),j};return T.waitForRequestsToFinish=function(){return b=!0,x(),M},T},p}(l),c=function(){var S={},p=function(T){return Array.prototype.slice.call(T)};S.addClassName=function(T,j){T.className+=" "+j},S.addClassNameRecursively=function(T,j){S.addClassName(T,j),T.parentNode!==T.ownerDocument&&S.addClassNameRecursively(T.parentNode,j)};var h=function(T,j){var I=T.parentStyleSheet,m=p(I.cssRules).indexOf(T);I.insertRule(j,m+1),I.deleteRule(m)},P=function(T,j){var I=T.cssText.replace(/^[^\{]+/,""),m=j+" "+I;h(T,m)},g=function(T){return p(T).reduce(function(j,I){return j+I.cssText},"")},y=function(T){T.textContent=g(T.sheet.cssRules)},b=function(T){var j=document.implementation.createHTMLDocument(""),I=document.createElement("style");I.textContent=T.textContent,j.body.appendChild(I),T.sheet=I.sheet},x=function(T){return"((?:^|[^.#:\\w])|(?=\\W))("+T.join("|")+")(?=\\W|$)"},M=function(T,j,I){var m=x(j);p(T.querySelectorAll("style")).forEach(function(A){typeof A.sheet>"u"&&b(A);var L=p(A.sheet.cssRules).filter(function(k){return k.selectorText&&new RegExp(m,"i").test(k.selectorText)});L.length&&(L.forEach(function(k){var R=k.selectorText.replace(new RegExp(m,"gi"),function(B,X,Y){return X+I(Y)});R!==k.selectorText&&P(k,R)}),y(A))})};return S.rewriteCssSelectorWith=function(T,j,I){M(T,[j],function(){return I})},S.lowercaseCssTypeSelectors=function(T,j){M(T,j,function(I){return I.toLowerCase()})},S.findHtmlOnlyNodeNames=function(T){var j=T.ownerDocument.createTreeWalker(T,NodeFilter.SHOW_ELEMENT),I={},m={},A;do A=j.currentNode.tagName.toLowerCase(),j.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?I[A]=!0:m[A]=!0;while(j.nextNode());return Object.keys(I).filter(function(L){return!m[L]})},S}(),d=function(S){var p={},h=function(g){return Array.prototype.slice.call(g)},P={active:!0,hover:!0,focus:!1,target:!1};return p.fakeUserAction=function(g,y,b){var x=g.querySelector(y),M=":"+b,T="rasterizehtml"+b;x&&(P[b]?S.addClassNameRecursively(x,T):S.addClassName(x,T),S.rewriteCssSelectorWith(g,M,"."+T))},p.persistInputValues=function(g){var y=g.querySelectorAll("input"),b=g.querySelectorAll("textarea"),x=function(M){return M.type==="checkbox"||M.type==="radio"};h(y).filter(x).forEach(function(M){M.checked?M.setAttribute("checked",""):M.removeAttribute("checked")}),h(y).filter(function(M){return!x(M)}).forEach(function(M){M.setAttribute("value",M.value)}),h(b).forEach(function(M){M.textContent=M.value})},p.rewriteTagNameSelectorsToLowerCase=function(g){S.lowercaseCssTypeSelectors(g,S.findHtmlOnlyNodeNames(g))},p}(c),w=function(S,p,h,P){var g={},y=function(Y,Q,q,z){var N=Y.createElement(Q);return N.style.visibility="hidden",N.style.width=q+"px",N.style.height=z+"px",N.style.position="absolute",N.style.top=-1e4-z+"px",N.style.left=-1e4-q+"px",Y.getElementsByTagName("body")[0].appendChild(N),N},b=function(Y){return Y>0?new Promise(function(Q){setTimeout(Q,Y)}):Promise.resolve()};g.executeJavascript=function(Y,Q){return new Promise(function(q){var z=y(P.document,"iframe",Q.width,Q.height),N=Y.outerHTML,U=[],$=Q.executeJsTimeout||0,ee=function(){P.document.getElementsByTagName("body")[0].removeChild(z)},G=function(){var re=z.contentDocument;q({document:re,errors:U,cleanUp:ee})},Z=z.contentWindow.XMLHttpRequest,W=p.finishNotifyingXhr(Z),te=p.baseUrlRespectingXhr(W,Q.baseUrl);z.onload=function(){b($).then(W.waitForRequestsToFinish).then(G)},z.contentDocument.open(),z.contentWindow.XMLHttpRequest=te,z.contentWindow.onerror=function(re){U.push({resourceType:"scriptExecution",msg:re})},z.contentDocument.write("<!DOCTYPE html>"),z.contentDocument.write(N),z.contentDocument.close()})};var x=function(Y,Q,q){var z=Y.createElement("iframe");return z.style.width=Q+"px",z.style.height=q+"px",z.style.visibility="hidden",z.style.position="absolute",z.style.top=-1e4-q+"px",z.style.left=-1e4-Q+"px",z.style.borderWidth=0,z.sandbox="allow-same-origin",z.scrolling="no",z},M=function(Y,Q,q){var z=Math.floor(Y/q),N=Math.floor(Q/q);return x(P.document,z,N)},T=function(Y,Q,q,z){return{width:Math.max(Y.width*z,Q),height:Math.max(Y.height*z,q)}},j=function(Y,Q){var q=Y.querySelector(Q);if(q)return q;if(Y.ownerDocument.querySelector(Q)===Y)return Y;throw{message:"Clipping selector not found"}},I=function(Y,Q,q,z,N){var U=Math.max(Y.scrollWidth,Y.clientWidth),$=Math.max(Y.scrollHeight,Y.clientHeight),ee,G,Z,W,te,re,ie,ae;return Q?(re=j(Y,Q),ie=re.getBoundingClientRect(),ee=ie.top,G=ie.left,Z=ie.width,W=ie.height):(ee=0,G=0,Z=U,W=$),ae=T({width:Z,height:W},q,z,N),te=P.getComputedStyle(Y.ownerDocument.documentElement).fontSize,{left:G,top:ee,width:ae.width,height:ae.height,viewportWidth:U,viewportHeight:$,rootFontSize:te}},m=function(Y,Q){var q=Y.tagName;return Q.querySelector(q)},A=function(Y){var Q=Y.tagName.toLowerCase();return Q==="html"||Q==="body"?Y.outerHTML:'<body style="margin: 0;">'+Y.outerHTML+"</body>"};g.calculateDocumentContentSize=function(Y,Q){return new Promise(function(q,z){var N=Q.zoom||1,U;U=M(Q.width,Q.height,N),P.document.getElementsByTagName("body")[0].appendChild(U),U.onload=function(){var $=U.contentDocument,ee;try{ee=I(m(Y,$),Q.clip,Q.width,Q.height,N),q(ee)}catch(G){z(G)}finally{P.document.getElementsByTagName("body")[0].removeChild(U)}},U.contentDocument.open(),U.contentDocument.write("<!DOCTYPE html>"),U.contentDocument.write(A(Y)),U.contentDocument.close()})},g.parseHtmlFragment=function(Y){var Q=P.document.implementation.createHTMLDocument("");Q.documentElement.innerHTML=Y;var q=Q.querySelector("body").firstChild;if(!q)throw"Invalid source";return q};var L=function(Y,Q){var q=/<html((?:\s+[^>]*)?)>/im.exec(Q),z=P.document.implementation.createHTMLDocument(""),N,U,$,ee;if(q)for(N="<div"+q[1]+"></div>",z.documentElement.innerHTML=N,$=z.querySelector("div"),U=0;U<$.attributes.length;U++)ee=$.attributes[U],Y.documentElement.setAttribute(ee.name,ee.value)};g.parseHTML=function(Y){var Q=P.document.implementation.createHTMLDocument("");return Q.documentElement.innerHTML=Y,L(Q,Y),Q};var k=function(Y){try{return h.failOnParseError(Y)}catch(Q){throw{message:"Invalid source",originalError:Q}}};g.validateXHTML=function(Y){var Q=new DOMParser,q=Q.parseFromString(Y,"application/xml");k(q)};var R=null,B=function(Y,Q){return Q==="none"||Q==="repeated"?((R===null||Q!=="repeated")&&(R=Date.now()),Y+"?_="+R):Y},X=function(Y,Q){return new Promise(function(q,z){var N=new window.XMLHttpRequest,U=S.joinUrl(Q.baseUrl,Y),$=B(U,Q.cache),ee=function(G){z({message:"Unable to load page",originalError:G})};N.addEventListener("load",function(){N.status===200||N.status===0?q(N.responseXML):ee(N.statusText)},!1),N.addEventListener("error",function(G){ee(G)},!1);try{N.open("GET",$,!0),N.responseType="document",N.send(null)}catch(G){ee(G)}})};return g.loadDocument=function(Y,Q){return X(Y,Q).then(function(q){return k(q)})},g}(l,s,n,window),_=function(S){var p={},h=function(m,A){return A?URL.createObjectURL(new Blob([m],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(m)},P=function(m){m instanceof Blob&&URL.revokeObjectURL(m)},g='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',y=function(m){return new Promise(function(A,L){var k=document.createElement("canvas"),R=new Image;R.onload=function(){var B=k.getContext("2d");try{B.drawImage(R,0,0),k.toDataURL("image/png"),A(!0)}catch{A(!1)}},R.onerror=L,R.src=m})},b=function(){var m=h(g,!0);return y(m).then(function(A){return P(m),A?!1:y(h(g,!1)).then(function(L){return L})},function(){return!1})},x=function(){if(S.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch{}return!1},M=function(){return new Promise(function(m,A){x()&&S.URL?b().then(function(L){m(!L)},function(){A()}):m(!1)})},T,j=function(){return T===void 0&&(T=M()),T},I=function(m){return j().then(function(A){return h(m,A)})};return p.renderSvg=function(m){return new Promise(function(A,L){var k,R,B=function(){R.onload=null,R.onerror=null},X=function(){k&&P(k)};R=new Image,R.onload=function(){B(),X(),A(R)},R.onerror=function(){X(),L()},I(m).then(function(Y){k=Y,R.src=k},L)})},p}(window),E=function(S,p,h,P){var g={},y=function(m,A){var L=A||1,k={width:m.width,height:m.height,"font-size":m.rootFontSize};return L!==1&&(k.style="transform:scale("+L+"); transform-origin: 0 0;"),k},b=function(m){var A,L,k,R;A=Math.round(m.viewportWidth),L=Math.round(m.viewportHeight),k=-m.left,R=-m.top;var B={x:k,y:R,width:A,height:L};return B},x=function(m){var A=m.style||"";m.style=A+"float: left;"},M=function(m){m.externalResourcesRequired=!0},T=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},j=function(m){var A=Object.keys(m);return A.length?" "+A.map(function(L){return L+'="'+m[L]+'"'}).join(" "):""},I=function(m,A,L){var k=P.serializeToString(m);p.validateXHTML(k);var R=b(A);return x(R),M(R),'<svg xmlns="http://www.w3.org/2000/svg"'+j(y(A,L))+">"+T()+"<foreignObject"+j(R)+">"+k+"</foreignObject></svg>"};return g.getSvgForDocument=function(m,A,L){return h.rewriteTagNameSelectorsToLowerCase(m),I(m,A,L)},g.drawDocumentAsSvg=function(m,A){return["hover","active","focus","target"].forEach(function(L){A[L]&&h.fakeUserAction(m,A[L],L)}),p.calculateDocumentContentSize(m,A).then(function(L){return g.getSvgForDocument(m,L,A.zoom)})},g}(l,w,d,t),O=function(S,p,h,P,g,y){var b={},x=function(m){return{message:"Error rendering page",originalError:m}},M=function(m){return g.renderSvg(m).then(function(A){return{image:A,svg:m}},function(A){throw x(A)})},T=function(m,A){try{A.getContext("2d").drawImage(m,0,0)}catch(L){throw x(L)}},j=function(m,A,L){return P.drawDocumentAsSvg(m,L).then(M).then(function(k){return A&&T(k.image,A),k})},I=function(m,A){return p.executeJavascript(m,A).then(function(L){var k=L.document;return h.persistInputValues(k),{document:k,errors:L.errors,cleanUp:L.cleanUp}})};return b.rasterize=function(m,A,L){var k;return k=S.clone(L),k.inlineScripts=L.executeJs===!0,y.inlineReferences(m,k).then(function(R){return L.executeJs?I(m,L).then(function(B){return{element:B.document.documentElement,errors:R.concat(B.errors),cleanUp:B.cleanUp}}):{element:m,errors:R,cleanUp:function(){}}}).then(function(R){return j(R.element,A,L).then(function(B){return R.cleanUp(),{image:B.image,svg:B.svg,errors:R.errors}})})},b}(l,w,d,E,_,a),v=function(S,p,h){var P={},g=function(T,j){var I=300,m=200,A=T?T.width:I,L=T?T.height:m,k=j.width!==void 0?j.width:A,R=j.height!==void 0?j.height:L;return{width:k,height:R}},y=function(T){var j=g(T.canvas,T.options),I;return I=S.clone(T.options),I.width=j.width,I.height=j.height,I};P.drawDocument=function(){var T=arguments[0],j=Array.prototype.slice.call(arguments,1),I=S.parseOptionalParameters(j),m=T.documentElement?T.documentElement:T;return h.rasterize(m,I.canvas,y(I))};var b=function(T,j,I){var m=p.parseHTML(T);return P.drawDocument(m,j,I)};P.drawHTML=function(){var T=arguments[0],j=Array.prototype.slice.call(arguments,1),I=S.parseOptionalParameters(j);return b(T,I.canvas,I.options)};var x=function(T,j,I){var m=document.implementation.createHTMLDocument("");m.replaceChild(T.documentElement,m.documentElement);var A=I?S.clone(I):{};return I.baseUrl||(A.baseUrl=j),{document:m,options:A}},M=function(T,j,I){return p.loadDocument(T,I).then(function(m){var A=x(m,T,I);return P.drawDocument(A.document,j,A.options)})};return P.drawURL=function(){var T=arguments[0],j=Array.prototype.slice.call(arguments,1),I=S.parseOptionalParameters(j);return M(T,I.canvas,I.options)},P}(l,w,O);return v})}(op)),op.exports}var Bb;function m_(){return Bb||(Bb=1,function(e){var i=Va&&Va.__createBinding||(Object.create?function(b,x,M,T){T===void 0&&(T=M);var j=Object.getOwnPropertyDescriptor(x,M);j&&!("get"in j?!x.__esModule:j.writable||j.configurable)||(j={enumerable:!0,get:function(){return x[M]}}),Object.defineProperty(b,T,j)}:function(b,x,M,T){T===void 0&&(T=M),b[T]=x[M]}),t=Va&&Va.__setModuleDefault||(Object.create?function(b,x){Object.defineProperty(b,"default",{enumerable:!0,value:x})}:function(b,x){b.default=x}),n=Va&&Va.__importStar||function(){var b=function(x){return b=Object.getOwnPropertyNames||function(M){var T=[];for(var j in M)Object.prototype.hasOwnProperty.call(M,j)&&(T[T.length]=j);return T},b(x)};return function(x){if(x&&x.__esModule)return x;var M={};if(x!=null)for(var T=b(x),j=0;j<T.length;j++)T[j]!=="default"&&i(M,x,T[j]);return t(M,x),M}}();Object.defineProperty(e,"__esModule",{value:!0}),e.prerenderFont=e.resetStyleContent=void 0,e.isContentWrapping=v,e.detectSize=S,e.htmlToCanvas=y;const a=n(bx()),l=Bd(),s=s_();e.resetStyleContent=`
159
- p {
160
- margin: 0;
161
- padding: 0;
162
- word-wrap: break-word; /* Required for Firefox */
163
- /* a text may have several spaces, we need to preserve them */
164
- white-space: pre-wrap;
165
- }
166
- ul, ol {
167
- list-style-position: outside;
168
- margin: 0;
169
- padding: 0;
170
- display: inline-block;
171
- text-align: left;
172
- width: 100%;
173
- /*
174
- * somehow display: inline-block is removing text-decoration
175
- * let's try to restore it that way
176
- */
177
- text-decoration: inherit;
178
- }
179
- li {
180
- margin-left: 1.7em;
181
- padding-left: 0.5em; /* This should match the margin-left value */
182
- }
183
- /* Add resets */
184
- ul {
185
- list-style-type: disc;
186
- }
187
- ol {
188
- list-style-type: decimal;
189
- }
190
-
191
- `;const c=`
192
- <style>
193
- html, body {
194
- padding: 0;
195
- margin: 0;
196
- }
197
- ${e.resetStyleContent}
198
- </style>
199
- `;let d;const w=()=>(d||(d=document.createElement("div"),d.id="polotno-hidden-do-not-touch",d.style.overflow="hidden",d.style.position="relative",document.body.appendChild(d),d.innerHTML=`<style>#polotno-hidden-do-not-touch {${e.resetStyleContent}}</style>`),d),_=new Map,E=navigator.userAgent.includes("Firefox"),O=async b=>{if(_.has(b))return _.get(b);const x=(async()=>{const M=`<div style="font-family: ${b}; font-size: 100px;">${b}<strong>${b}</strong></div>`,T=document.createElement("div");T.innerHTML=M,T.style.visibility="hidden",T.style.position="absolute";const j=w();j.appendChild(T);const I=E?180:50;await new Promise(m=>setTimeout(m,I)),j.removeChild(T)})();return _.set(b,x),x};function v({html:b}){const x=document.createElement("div");x.innerHTML=b,x.style.display="inline-block",x.style.position="fixed",x.style.top="0px",x.style.left="0px",x.style.zIndex="1000",x.style.whiteSpace="nowrap",x.style.visibility="hidden";const M=w();M.appendChild(x);const T=x.textContent,j=x.childNodes[0],I=T.split(/\s+/);let m=!1;for(let A=0;A<I.length;A++){const L=I[A];if(j.textContent=L,m=j.scrollWidth>x.clientWidth,m)break}return M.removeChild(x),m}function S(b){b.indexOf("Avellino");const x=document.createElement("div");x.innerHTML=b,x.style.display="inline-block",x.style.position="fixed",x.style.top="0px",x.style.left="0px",x.style.zIndex="1000";const M=w();M.appendChild(x);const T=x.getBoundingClientRect();return M.removeChild(x),{width:T.width,height:T.height}}e.prerenderFont=O;const p={};function h(b){const x=[];for(const M of document.styleSheets)try{for(const T of M.cssRules)T instanceof CSSFontFaceRule&&T.style.fontFamily.replace(/['"]/g,"")===b&&x.push(T)}catch(T){console.warn(`Could not access stylesheet: ${M.href}`,T)}return x}const P={},g=b=>{if(P[b])return P[b];const x=h(b).filter(M=>M.style.fontFamily.replace(/['"]/g,"")===b).map(M=>({src:M.style.src,fontStyle:M.style.fontStyle||"normal",fontWeight:M.style.fontWeight||"normal"}));return P[b]=x,x};async function y({html:b,width:x,height:M,fontFamily:T,padding:j,font:I,pixelRatio:m}){if(T!=="Arial"&&!I){const R=(0,l.getGoogleFontsVariants)();b+=`<link type="text/css" href="https://fonts.googleapis.com/css?family=${T}:${R}" rel="stylesheet">`}if(I){const R=I.styles||(I.url?[{src:`url("${I.url}")`}]:g(T));b+="<style>",R.forEach(B=>{b+=`
200
- @font-face {
201
- font-family: '${T}';
202
- src: ${B.src};
203
- font-style: ${B.fontStyle||"normal"};
204
- font-weight: ${B.fontWeight||"normal"};
205
- }
206
- `}),b+="</style>"}b+=c;const A=document.createElement("canvas"),L=await a.drawHTML(`<div style="padding: ${j}px;">${b}</div>`,A,{width:x+2*j,height:M+2*j,cacheBucket:p});(0,s.trySetCanvasSize)(A,(x+2*j)*m,(M+2*j)*m);const k=A.getContext("2d");return k==null||k.drawImage(L.image,0,0,A.width,A.height),A}}(Va)),Va}var Zu={},ng={},Ub;function y_(){return Ub||(Ub=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.keyframes=e.glob=e.extractCss=void 0,e.css=E,e.setup=P,e.styled=g;let i={data:""},t=y=>typeof window=="object"?((y?y.querySelector("#_goober"):window._goober)||Object.assign((y||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:y||i,n=y=>{let b=t(y),x=b.data;return b.data="",x},a=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,l=/\/\*[^]*?\*\/|\s\s+|\n/g,s=(y,b)=>{let x="",M="",T="";for(let j in y){let I=y[j];j[0]=="@"?j[1]=="i"?x=j+" "+I+";":M+=j[1]=="f"?s(I,j):j+"{"+s(I,j[1]=="k"?"":b)+"}":typeof I=="object"?M+=s(I,b?b.replace(/([^,])+/g,m=>j.replace(/(^:.*)|([^,])+/g,A=>/&/.test(A)?A.replace(/&/g,m):m?m+" "+A:A)):j):I!=null&&(j=j.replace(/[A-Z]/g,"-$&").toLowerCase(),T+=s.p?s.p(j,I):j+":"+I+";")}return x+(b&&T?b+"{"+T+"}":T)+M},c={},d=y=>{if(typeof y=="object"){let b="";for(let x in y)b+=x+d(y[x]);return b}return y},w=(y,b,x,M,T)=>{let j=d(y),I=c[j]||(c[j]=(m=>{let A=0,L=11;for(;A<m.length;)L=101*L+m.charCodeAt(A++)>>>0;return"go"+L})(j));if(!c[I]){let m=j!==y?y:(A=>{let L,k=[{}];for(;L=a.exec(A.replace(l,""));)L[4]?k.shift():L[3]?k.unshift(k[0][L[3]]=k[0][L[3]]||{}):k[0][L[1]]=L[2];return k[0]})(y);c[I]=s(T?{["@keyframes "+I]:m}:m,x?"":"."+I)}return((m,A,L)=>{A.data.indexOf(m)==-1&&(A.data=L?m+A.data:A.data+m)})(c[I],b,M),I},_=(y,b,x)=>y.reduce((M,T,j)=>{let I=b[j];if(I&&I.call){let m=I(x),A=m&&m.props&&m.props.className||/^go/.test(m)&&m;I=A?"."+A:m&&typeof m=="object"?m.props?"":s(m,""):m===!1?"":m}return M+T+(I??"")},"");function E(y){let b=this||{},x=y.call?y(b.p):y;return w(x.unshift?x.raw?_(x,[].slice.call(arguments,1),b.p):x.reduce((M,T)=>Object.assign(M,T&&T.call?T(b.p):T),{}):x,t(b.target),b.g,b.o,b.k)}e.extractCss=n;let O,v,S,p=E.bind({g:1}),h=E.bind({k:1});function P(y,b,x,M){s.p=b,O=y,v=x,S=M}function g(y,b){let x=this||{};return function(){let M=arguments;function T(j,I){let m=Object.assign({},j),A=m.className||T.className;x.p=Object.assign({theme:v&&v()},m),x.o=/ *go\d+/.test(A),m.className=E.apply(x,M)+(A?" "+A:""),b&&(m.ref=I);let L=y;return y[0]&&(L=m.as||y,delete m.as),S&&L[0]&&S(m),O(L,m)}return b?b(T):T}}e.glob=p,e.keyframes=h}(ng)),ng}var qb;function _x(){if(qb)return Zu;qb=1;var e=Zu&&Zu.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Zu,"__esModule",{value:!0});const i=e(Tn()),t=y_();return(0,t.setup)(i.default.createElement),Zu.default=t.styled,Zu}var Hb;function wx(){return Hb||(Hb=1,function(e){var i=So&&So.__createBinding||(Object.create?function(N,U,$,ee){ee===void 0&&(ee=$);var G=Object.getOwnPropertyDescriptor(U,$);G&&!("get"in G?!U.__esModule:G.writable||G.configurable)||(G={enumerable:!0,get:function(){return U[$]}}),Object.defineProperty(N,ee,G)}:function(N,U,$,ee){ee===void 0&&(ee=$),N[ee]=U[$]}),t=So&&So.__setModuleDefault||(Object.create?function(N,U){Object.defineProperty(N,"default",{enumerable:!0,value:U})}:function(N,U){N.default=U}),n=So&&So.__importStar||function(){var N=function(U){return N=Object.getOwnPropertyNames||function($){var ee=[];for(var G in $)Object.prototype.hasOwnProperty.call($,G)&&(ee[ee.length]=G);return ee},N(U)};return function(U){if(U&&U.__esModule)return U;var $={};if(U!=null)for(var ee=N(U),G=0;G<ee.length;G++)ee[G]!=="default"&&i($,U,ee[G]);return t($,U),$}}(),a=So&&So.__importDefault||function(N){return N&&N.__esModule?N:{default:N}};Object.defineProperty(e,"__esModule",{value:!0}),e.HTMLElement=e.setQuillContent=e.createQuill=e.setQuillFormats=e.quillRef=void 0;const l=a(Tn()),s=Qi,c=Ja,d=a(TO()),w=a(Ji()),_=n(No),E=ts(),O=jp(),v=a_(),S=zd(),p=m_(),h=bc(),P=_c(),g=yc,y=a(_x()),b=Ks(),x=a4(),M=n(Bd()),T=Xs(),j=o_();e.quillRef=_.observable({enabled:!1,currentFormat:{},editor:_.observable.object({instance:null},{},{deep:!1})});const I=(0,y.default)("div",l.default.forwardRef)`
207
- .ql-editor {
208
- outline: none;
209
- }
210
- ${p.resetStyleContent}
211
- strong {
212
- font-weight: 700;
213
- }
214
- .ql-direction-rtl {
215
- direction: rtl;
216
- }
217
- `;let m=["bold","color","font","italic","size","strike","underline","indent","list","direction"];const A=N=>{m=N};e.setQuillFormats=A;const L=N=>new d.default(N,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:m});e.createQuill=L;const k=(N,U)=>{var $=N.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+U+"<p><br></p></div>");N.setContents($),N.history.clear()};e.setQuillContent=k;const R=({html:N,onBlur:U,onChange:$,element:ee})=>{const G=l.default.useRef(null);l.default.useEffect(()=>{if(!G.current)return;const W=(0,e.createQuill)(G.current);return _.runInAction(()=>{e.quillRef.editor.instance=W}),window.__polotnoQuill=W,W.on("text-change",()=>{W.getSelection()&&_.runInAction(()=>{e.quillRef.currentFormat=W.getFormat()}),setTimeout(()=>{var te;const re=(te=G.current)===null||te===void 0?void 0:te.childNodes[0];$(re.innerHTML)},10)}),W.setSelection(0,0,"api"),W.on("selection-change",te=>{te||U(),te&&_.runInAction(()=>{e.quillRef.currentFormat=W.getFormat()})}),G.current.childNodes[0].addEventListener("blur",te=>{var re;!((re=te.relatedTarget)===null||re===void 0)&&re.classList.contains("ql-clipboard")||U()}),()=>{_.runInAction(()=>{e.quillRef.editor.instance=null,e.quillRef.currentFormat={}}),delete window.__polotnoQuill}},[]),l.default.useEffect(()=>{var W;const te=e.quillRef.editor.instance;if(!te)return;const re=te.getSelection();((W=G.current)===null||W===void 0?void 0:W.childNodes[0].innerHTML)===ee.text||((0,e.setQuillContent)(te,N),re&&(te.setSelection(re.index,re.length),_.runInAction(()=>{e.quillRef.currentFormat=te.getFormat()})))},[ee.text]);const Z={color:ee.fill};return ee.fill.indexOf("gradient")>=0&&(Z.backgroundColor=ee.fill,Z.backgroundImage=ee.fill,Z.backgroundSize="100% 100%",Z.backgroundRepeat="repeat",Z.webkitBackgroundClip="text",Z.MozBackgroundClip="text",Z.WebkitTextFillColor="transparent",Z.MozTextFillColor="transparent"),l.default.createElement(I,{ref:G,style:Object.assign(Object.assign({},Z),{fontSize:ee.fontSize,width:ee.a.width,fontFamily:ee.fontFamily,lineHeight:ee.lineHeight,letterSpacing:ee.letterSpacing+"rem",textAlign:ee.align}),dir:(0,v.getDir)((0,x.removeTags)(ee.text))})};function B(N,U,$){return l.default.useMemo(()=>(0,p.detectSize)(N),[N,U.width,$])}function X(N){const U=N.getContext("2d").getImageData(0,0,N.width,N.height).data;for(let $=0;$<U.length;$+=4)if(U[$+3]!==0)return!0;return!1}function Y(N){return!X(N)}function Q(N,{fontFamily:U="",color:$="black"}={}){let ee=`color: ${$||N.fill}`;return N.fill.indexOf("gradient")>=0&&(ee=`
218
- background-color: ${$};
219
- background-image: ${N.fill};
220
- background-size: 100% 100%;
221
- background-repeat: repeat;
222
- -webkit-background-clip: text;
223
- -moz-background-clip: text;
224
- -webkit-text-fill-color: transparent;
225
- -moz-text-fill-color: transparent;
226
- `),`<div style="${["white-space: pre-wrap",`width: ${Math.round(N.width||100)}px`,ee,`font-size: ${N.fontSize}px`,`font-family: '${U}'`,`text-align: ${N.align}`,N.textDecoration?`text-decoration: ${N.textDecoration}`:"",N.lineHeight?`line-height: ${N.lineHeight}`:"",N.letterSpacing?`letter-spacing: ${N.letterSpacing}rem`:"",N.fontStyle?`font-style: ${N.fontStyle}`:"",N.fontWeight?`font-weight: ${N.fontWeight}`:"",N.strokeWidth?`-webkit-text-stroke: ${N.strokeWidth}px ${N.stroke}`:"",N.strokeWidth?"paint-order: stroke fill":""].filter(Boolean).join("; ")}" contentEditable dir="${(0,v.getDir)((0,x.removeTags)(N.text))}">${N.text.replaceAll(`
227
- `,"</br>")}</div>`}const q=N=>{let U=N.fontSize;for(let $=1;$<50;$++){const ee=Q(Object.assign(Object.assign({},N.toJSON()),{fontSize:U}),{fontFamily:N.fontFamily}),{height:G}=(0,p.detectSize)(ee),Z=N.height&&G>N.height,W=(0,p.isContentWrapping)({html:ee});if(!(Z||W))break;U-=.5}return U},z=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);e.HTMLElement=(0,s.observer)(({element:N,store:U})=>{const $=l.default.useRef(null),[ee,G]=l.default.useState(),[Z,W]=l.default.useState(!1),[te,re]=l.default.useState(!0),[ie,ae]=l.default.useState(!1),se=l.default.useRef(N.height),de=U.selectedShapes.indexOf(N)>=0,he=N.fontSize/3,{textVerticalResizeEnabled:Oe}=E.flags,_e=(0,v.usePrevious)(N.fontFamily),[Ae]=(0,v.useFontLoader)(U,N.fontFamily),ce=N._editModeEnabled;(0,h.useFadeIn)($);const pe=Ae?N.fontFamily:_e!==N.fontFamily?_e:"Arial",Ce=(0,S.useColor)(N).fill,Le=Q(N,{fontFamily:pe,color:Ce}),{width:ue,height:ve}=B(Le,N,Ae);l.default.useEffect(()=>{if(!Ae)return;if(!N.height)return void N.set({height:ve});const{textOverflow:ze}=E.flags;if(ze!=="change-font-size"||Z)ze==="resize"&&(Oe&&N.height<ve&&U.history.ignore(()=>{N.set({height:ve})}),Oe||N.height===ve||U.history.ignore(()=>{N.set({height:ve})}));else{const Be=q(N);Be!==N.fontSize?U.history.ignore(()=>{N.set({fontSize:Be})}):N.height!==ve&&(Oe&&N.height<ve?U.history.ignore(()=>{N.set({height:ve})}):Oe||U.history.ignore(()=>{N.set({height:ve})}))}});const xe=l.default.useRef(0),je=l.default.useMemo(()=>{const ze={lastArgs:null,lastResult:null};return async function(Be){return ze.lastArgs&&ze.lastResult&&(Ve=ze.lastArgs,bt=Be,JSON.stringify(Ve)===JSON.stringify(bt))||(ze.lastResult=await(0,p.htmlToCanvas)(Be),ze.lastArgs=Object.assign({},Be)),ze.lastResult;var Ve,bt}},[]);l.default.useEffect(()=>{Z||ce||(async()=>{xe.current++;const ze=xe.current,Be=(0,b.incrementLoader)(`text ${N.id}`);re(!0);let Ve=null;const bt=z?5:1;for(let Ct=0;Ct<bt;Ct++){if(Ve=await(Ct>0?je:p.htmlToCanvas)({skipCache:Ct>0,html:Le,width:N.width||1,height:N.height||ve||1,fontFamily:pe,padding:he,pixelRatio:U._elementsPixelRatio,font:U.fonts.find(Se=>Se.fontFamily===pe)||M.globalFonts.find(Se=>Se.fontFamily===pe)}),ze!==xe.current)return void Be();Y(Ve)&&z&&await new Promise(Se=>setTimeout(Se,50*(Ct+1)))}Ve?(G(Ve),re(!1),w.default.Util.requestAnimFrame(Be)):Be()})()},[Le,Z,ve,ce,pe,N.height,U._elementsPixelRatio,Ae]);const at=Z||te;l.default.useEffect(()=>_.autorun(()=>{const ze=$.current;(0,O.applyFilter)(ze,N)}),[ee,at,N.shadowColor,N.shadowOffsetX,N.shadowOffsetY,N.shadowOpacity]);let ht=0;N.verticalAlign==="middle"&&(ht=(N.height-ve)/2),N.verticalAlign==="bottom"&&(ht=N.height-ve);const et=(0,v.getLineHeight)({fontLoaded:Ae,fontFamily:N.fontFamily,fontSize:N.fontSize,lineHeight:N.lineHeight}),Ke=(0,T.isTouchDevice)();return l.default.createElement(l.default.Fragment,null,l.default.createElement(c.Rect,{x:N.a.x,y:N.a.y,offsetX:N.backgroundPadding*(N.fontSize*et*.5),offsetY:N.backgroundPadding*(N.fontSize*et*.5),rotation:N.a.rotation,hideInExport:!N.showInExport,listening:!1,visible:N.backgroundEnabled,opacity:N.backgroundOpacity*N.a.opacity,fill:N.backgroundColor,width:N.a.width+N.backgroundPadding*(N.fontSize*et),height:N.a.height+N.backgroundPadding*(N.fontSize*et),cornerRadius:N.backgroundCornerRadius*(N.fontSize*et*.5)}),l.default.createElement(c.Rect,{ref:$,name:"element",x:N.a.x,y:N.a.y,listening:N.selectable,rotation:N.a.rotation,width:N.a.width,height:N.a.height,visible:!at,draggable:Ke?N.draggable&&de:N.draggable,preventDefault:!Ke||de,opacity:ce?0:N.a.opacity,hideInExport:!N.showInExport,onMouseEnter:()=>{ae(!0)},onMouseLeave:()=>{ae(!1)},onDragMove:ze=>{N.set({x:ze.target.x(),y:ze.target.y()})},onDragEnd:ze=>{N.set({x:ze.target.x(),y:ze.target.y()})},id:N.id,onDblClick:()=>{N.contentEditable&&N.toggleEditMode(!0)},onDblTap:()=>{N.contentEditable&&N.toggleEditMode(!0)},onTransformStart:ze=>{W(!0),se.current=N.height},onTransform:ze=>{var Be;const Ve=ze.target,bt=((Be=Ve.getStage())===null||Be===void 0?void 0:Be.findOne("Transformer")).getActiveAnchor(),Ct=bt==="middle-left"||bt==="middle-right",we=bt==="top-center"||bt==="bottom-center",Se=Ve.scaleX();if(Ct){const gt=Ve.scaleX(),wt=Math.max(Ve.width()*gt,N.fontSize);if(Ve.width(wt),Ve.scaleX(1),E.flags.textVerticalResizeEnabled){const Pt=Math.max(ve,se.current);N.set({height:Pt})}N.set({width:wt,x:Ve.x(),y:Ve.y()})}else if(we){let gt=E.flags.textOverflow==="resize"?ve:N.lineHeight*N.fontSize;const wt=Math.max(gt,ze.target.height()*ze.target.scaleY());Ve.scaleY(1),N.set({x:Ve.x(),y:Ve.y(),height:wt,rotation:Ve.rotation()})}else Ve.scaleX(1),Ve.scaleY(1),N.set({fontSize:N.fontSize*Se,width:Ve.width()*Se,x:Ve.x(),y:Ve.y(),rotation:Ve.rotation(),height:Ve.height()*Se})},onTransformEnd:ze=>{W(!1),re(!0);const Be=ze.target.scaleX();ze.target.scaleX(1),ze.target.scaleY(1),N.set({fontSize:N.fontSize*Be,width:ze.target.width()*Be,x:ze.target.x(),y:ze.target.y(),rotation:ze.target.rotation(),shadowBlur:N.shadowBlur*Be,shadowOffsetX:N.shadowOffsetX*Be,shadowOffsetY:N.shadowOffsetY*Be,strokeWidth:N.strokeWidth*Be})}}),l.default.createElement(c.Image,{ref:$,image:ee,x:N.a.x,y:N.a.y,offsetX:he,offsetY:he-ht,listening:!1,rotation:N.rotation,width:N.a.width+2*he,height:N.a.height+2*he,visible:!at,opacity:ce?0:N.a.opacity,shadowEnabled:N.shadowEnabled,shadowBlur:N.shadowBlur,shadowOffsetX:N.shadowOffsetX,shadowOffsetY:N.shadowOffsetY,shadowColor:N.shadowColor,shadowOpacity:N.shadowOpacity,hideInExport:!N.showInExport}),at&&l.default.createElement(c.Group,{x:N.a.x,y:N.a.y,rotation:N.rotation,offsetY:-ht},l.default.createElement(g.Html,{divProps:{style:{pointerEvents:"none"}}},l.default.createElement(I,{dangerouslySetInnerHTML:{__html:Le},style:{pointerEvents:"none",display:"inline-block"}}))),ce&&l.default.createElement(c.Group,{x:N.a.x,y:N.a.y,rotation:N.rotation,offsetY:-ht},l.default.createElement(g.Html,null,l.default.createElement(R,{html:Le,element:N,onChange:ze=>{const Be=(0,j.getLimitedFontSize)({oldText:(0,x.removeTags)(N.text),newText:(0,x.removeTags)(ze),element:N});N.set({text:ze,fontSize:Be})},onBlur:ze=>{N.toggleEditMode(!1)}}))),(de||ie)&&l.default.createElement(P.Highlighter,{element:N}))})}(So)),So}var dd={},hd={},rg={},Gb;function Hd(){return Gb||(Gb=1,function(e){function i(d){return d/180*Math.PI}function t(d,w,_,E,O){const v=Math.sqrt(_*_+E*E);return O+=Math.atan2(E,_),{x:d+v*Math.cos(O),y:w+v*Math.sin(O)}}function n(d){const{x:w,y:_,width:E,height:O}=d,v=i(d.rotation),S=t(w,_,0,0,v),p=t(w,_,E,0,v),h=t(w,_,E,O,v),P=t(w,_,0,O,v),g=Math.min(S.x,p.x,h.x,P.x),y=Math.min(S.y,p.y,h.y,P.y),b=Math.max(S.x,p.x,h.x,P.x),x=Math.max(S.y,p.y,h.y,P.y);return{x:g,y,width:b-g,height:x-y,minX:g,minY:y,maxX:b,maxY:x}}function a(d){const w=d.map(S=>n(S)),_=Math.min(...w.map(S=>S.minX)),E=Math.min(...w.map(S=>S.minY)),O=Math.max(...w.map(S=>S.maxX)),v=Math.max(...w.map(S=>S.maxY));return{x:_,y:E,width:O-_,height:v-E,minX:_,minY:E,maxX:O,maxY:v}}function l(d){const w=i(d.rotation||0);return{x:d.x+d.width/2*Math.cos(w)+d.height/2*Math.sin(-w),y:d.y+d.height/2*Math.cos(w)+d.width/2*Math.sin(w)}}function s(d,w,_){const E=i(w),O=_.x+(d.x-_.x)*Math.cos(E)-(d.y-_.y)*Math.sin(E),v=_.y+(d.x-_.x)*Math.sin(E)+(d.y-_.y)*Math.cos(E);return Object.assign(Object.assign({},d),{rotation:d.rotation+w,x:O,y:v})}function c(d,w){return s(d,w,l(d))}Object.defineProperty(e,"__esModule",{value:!0}),e.degToRad=i,e.getClientRect=n,e.getTotalClientRect=a,e.getCenter=l,e.rotateAroundPoint=s,e.rotateAroundCenter=c}(rg)),rg}var Vb;function b_(){return Vb||(Vb=1,function(e){var i=hd&&hd.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(e,"__esModule",{value:!0}),e.setSnapFilterFunc=void 0,e.useSnap=_,e.useAnchorSnap=O;const t=i(Tn()),n=i(Ji()),a=Hd();var l=5;let s=({targetKonvaNodes:v,guideKonvaNode:S,distance:p,snapDirection:h})=>p<l;const c=v=>{s=v};function d(v){const S=v.__getNodeRect(),p=(0,a.getClientRect)(Object.assign(Object.assign({},S),{rotation:n.default.Util.radToDeg(S.rotation)})),h=v.getAbsolutePosition();return{vertical:[{guide:p.x,offset:h.x-p.x,snap:"start",nodes:v.nodes()},{guide:p.x+p.width/2,offset:h.x-p.x-p.width/2,snap:"center",nodes:v.nodes()},{guide:p.x+p.width,offset:h.x-p.x-p.width,snap:"end",nodes:v.nodes()}],horizontal:[{guide:p.y,offset:h.y-p.y,snap:"start",nodes:v.nodes()},{guide:p.y+p.height/2,offset:h.y-p.y-p.height/2,snap:"center",nodes:v.nodes()},{guide:p.y+p.height,offset:h.y-p.y-p.height,snap:"end",nodes:v.nodes()}]}}function w(v,S){var p=[],h=[];v.vertical.forEach(M=>{S.vertical.forEach(T=>{var j=Math.abs(M.offset-T.guide);s({targetKonvaNodes:T.nodes,guideKonvaNode:M.node,distance:j,snapDirection:M.snap})&&p.push({lineGuide:M.offset,diff:j,snap:T.snap,offset:T.offset})})}),v.horizontal.forEach(M=>{S.horizontal.forEach(T=>{var j=Math.abs(M.offset-T.guide);s({targetKonvaNodes:T.nodes,guideKonvaNode:M.node,distance:j,snapDirection:M.snap})&&h.push({lineGuide:M.offset,diff:j,snap:T.snap,offset:T.offset})})});var P=[];const g=p.sort((M,T)=>M.diff-T.diff),y=h.sort((M,T)=>M.diff-T.diff);var b=g[0],x=y[0];return b&&g.filter(M=>Math.abs(M.diff-b.diff)<.1).forEach(M=>{P.push(Object.assign({orientation:"V"},M))}),x&&y.filter(M=>Math.abs(M.diff-x.diff)<.1).forEach(M=>{P.push(Object.assign({orientation:"H"},M))}),P}function _(v,S){const p=t.default.useRef(),h=M=>M.hasName("element")||M.hasName("page-background")||!p.current&&M.hasName("elements-area");function P(M){var T;const j=(T=v.current)===null||T===void 0?void 0:T.getStage(),I=[],m=[];return j.find(h).forEach(A=>{if(!(M.indexOf(A)>=0)){var L=A.getClientRect({skipShadow:!0,skipStroke:!0});I.push({offset:L.x,node:A,snap:"start"},{offset:L.x+L.width,node:A,snap:"end"},{offset:L.x+L.width/2,node:A,snap:"center"}),m.push({offset:L.y,node:A,snap:"start"},{offset:L.y+L.height,node:A,snap:"end"},{offset:L.y+L.height/2,node:A,snap:"center"})}}),{vertical:I,horizontal:m}}function g(M){var T;const j=(T=v.current)===null||T===void 0?void 0:T.getLayer(),I=j==null?void 0:j.children.find(m=>m.name()==="line-guides");M.forEach(m=>{if(m.orientation==="H"){var A=new n.default.Line({points:[-6e3,m.lineGuide,6e3,m.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});I==null||I.add(A),j.batchDraw()}else m.orientation==="V"&&(A=new n.default.Line({points:[m.lineGuide,-6e3,m.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),I==null||I.add(A))})}const y=M=>{const T=M.target.getLayer().children.find(k=>k.name()==="line-guides");T==null||T.destroyChildren();var j=w(P(M.target.nodes()),d(M.target));if(!j.length)return;g(j);const I=M.target.getAbsolutePosition(),m=(M.target.nodes().map(k=>k.getAbsolutePosition()),Object.assign({},I));j.forEach(k=>{switch(k.snap){case"start":case"center":case"end":switch(k.orientation){case"V":m.x=k.lineGuide+k.offset;break;case"H":m.y=k.lineGuide+k.offset}}});const A=m.x-I.x,L=m.y-I.y;M.evt.ctrlKey||M.evt.metaKey||M.target.nodes().forEach(k=>{const R=k.getAbsolutePosition();k.setAbsolutePosition({x:R.x+A,y:R.y+L})})},b=(M,T,j)=>{const I=v.current,m=I.getLayer(),A=m.children.find(Y=>Y.name()==="line-guides");if(A==null||A.destroyChildren(),I.getActiveAnchor()==="rotater"||Math.sqrt(Math.pow(T.x-M.x,2)+Math.pow(T.y-M.y,2))>50||!m)return T;var L=w(P(I.nodes()),{vertical:[{guide:T.x,offset:0,snap:"start",nodes:I.nodes()}],horizontal:[{guide:T.y,offset:0,snap:"start",nodes:I.nodes()}]});if(!L.length||(g(L),j.ctrlKey||j.metaKey))return T;let k=T.x,R=T.x;L.forEach(Y=>{switch(Y.orientation){case"V":k=Y.lineGuide;break;case"H":R=Y.lineGuide}});const B=Math.abs(T.x-k)<10,X=Math.abs(T.y-R)<10;return B&&!X?{x:k,y:M.y}:X&&!B?{x:M.x,y:R}:B&&X?{x:k,y:R}:T},x=M=>{if(!M.target)return;const T=M.target.getLayer(),j=T.children.find(I=>I.name()==="line-guides");j==null||j.destroyChildren(),T.batchDraw()};t.default.useEffect(()=>{v.current&&(v.current.anchorDragBoundFunc(b),v.current.on("dragstart",M=>{setTimeout(()=>{if(n.default.DD._dragElements.size===0)return;const T=[...n.default.DD._dragElements.entries()],j=T.find(([I,m])=>m.node instanceof n.default.Transformer);j&&(T.splice(T.indexOf(j),1),T.unshift(j),n.default.DD._dragElements.clear(),T.forEach(([I,m])=>{n.default.DD._dragElements.set(I,m)}))})}),v.current.on("dragmove",y),v.current.on("dragend",x),v.current.on("transformend",x),v.current.on("transform",M=>{var T,j;M.evt.ctrlKey||M.evt.metaKey?(T=v.current)===null||T===void 0||T.rotationSnapTolerance(0):(j=v.current)===null||j===void 0||j.rotationSnapTolerance(5)}))},[])}function E(v){return{vertical:[{guide:v.absolutePosition().x,offset:0,snap:"center",nodes:[v]}],horizontal:[{guide:v.absolutePosition().y,offset:0,snap:"center",nodes:[v]}]}}function O(v,S,p){const h=y=>y.hasName("element")||y.hasName("line-anchor")||y.hasName("page-background")||y.hasName("elements-area"),P=y=>{const b=y.target.getLayer().children.find(m=>m.name()==="line-guides");b==null||b.destroyChildren();var x=w(function(m){var A;const L=(A=v.current)===null||A===void 0?void 0:A.getStage();var k=[],R=[];return L.find(h).forEach(B=>{if(!(m.indexOf(B)>=0)){var X=B.getClientRect({skipShadow:!0,skipStroke:!0});B.hasName("line-anchor")&&(X={x:B.absolutePosition().x,y:B.absolutePosition().y,width:0,height:0}),k.push({offset:X.x,node:B,snap:"start"},{offset:X.x+X.width,node:B,snap:"end"},{offset:X.x+X.width/2,node:B,snap:"center"}),R.push({offset:X.y,node:B,snap:"start"},{offset:X.y+X.height,node:B,snap:"end"},{offset:X.y+X.height/2,node:B,snap:"center"})}}),{vertical:k,horizontal:R}}([y.target,...S.map(m=>m.current)]),E(y.target));if(!x.length)return;(function(m){var A;const L=(A=v.current)===null||A===void 0?void 0:A.getLayer(),k=L==null?void 0:L.children.find(R=>R.name()==="line-guides");m.forEach(R=>{if(R.orientation==="H"){var B=new n.default.Line({points:[-6e3,R.lineGuide,6e3,R.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});k==null||k.add(B),L.batchDraw()}else R.orientation==="V"&&(B=new n.default.Line({points:[R.lineGuide,-6e3,R.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]}),k==null||k.add(B))})})(x);const M=y.target.getAbsolutePosition(),T=Object.assign({},M);x.forEach(m=>{switch(m.snap){case"start":case"center":case"end":switch(m.orientation){case"V":T.x=m.lineGuide+m.offset;break;case"H":T.y=m.lineGuide+m.offset}}});const j=T.x-M.x,I=T.y-M.y;if(!(y.evt.ctrlKey||y.evt.metaKey)){const m=y.target.getAbsolutePosition();y.target.absolutePosition({x:m.x+j,y:m.y+I})}},g=y=>{if(!y.target)return;const b=y.target.getLayer(),x=b.children.find(M=>M.name()==="line-guides");x==null||x.destroyChildren(),b.batchDraw()};t.default.useEffect(()=>{v.current&&(v.current.on("dragmove",P),v.current.on("dragend",g))},p)}e.setSnapFilterFunc=c}(hd)),hd}var $b;function Sx(){return $b||($b=1,function(e){var i=dd&&dd.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0,e.getMiddlePoints=_,e.getLinePositionFromMiddlePoints=E;const t=i(Tn()),n=Qi,a=Ja,l=zd(),s=yc,c=_c(),d=b_(),w=Xs();function _(S){const{x:p,y:h,width:P,height:g,rotation:y}=S.a,b=y*Math.PI/180,x={x:p+g/2*Math.cos(b+Math.PI/2),y:h+g/2*Math.sin(b+Math.PI/2)};return{middleLeft:x,middleRight:{x:x.x+P*Math.cos(b),y:x.y+P*Math.sin(b)}}}function E(S,p,h){const P=Math.sqrt(Math.pow(p.x-S.x,2)+Math.pow(p.y-S.y,2)),g=Math.atan2(p.y-S.y,p.x-S.x),y=180*g/Math.PI;return{x:S.x+Math.cos(g-Math.PI/2)*h/2,y:S.y+Math.sin(g-Math.PI/2)*h/2,width:P,height:h,rotation:y}}const O=(S,p)=>({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:h=>{h.target.getStage().container().style.cursor="crosshair"},onMouseLeave:h=>{h.target.getStage().container().style.cursor=""},onDragStart:h=>{p.history.startTransaction()},onDragEnd:h=>{p.history.endTransaction()}}),v=(0,n.observer)(({element:S,type:p})=>{const h=(0,l.useColor)(S,S.a.color,"fill"),P=(0,l.useColor)(S,S.a.color,"stroke"),g=Object.assign(Object.assign(Object.assign({strokeWidth:S.height,lineCap:"round",lineJoin:"round"},P),h),{opacity:S.a.opacity,hideInExport:!S.showInExport});return t.default.createElement(t.default.Fragment,null,p==="arrow"&&t.default.createElement(a.Line,Object.assign({points:[3*S.height,2*-S.height,0,0,3*S.height,2*S.height]},g)),p==="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)),p==="bar"&&t.default.createElement(a.Line,Object.assign({points:[0,2*-S.height,0,2*S.height],closed:!0},g)),p==="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)),p==="circle"&&t.default.createElement(a.Circle,Object.assign({x:2*S.height,y:0,radius:2*S.height},g)))});e.LineElement=(0,n.observer)(({element:S,store:p})=>{const h=t.default.useRef(null),P=t.default.useRef(null),g=t.default.useRef(null),y=S.selectable||p.role==="admin",b=(0,w.isTouchDevice)(),[x,M]=t.default.useState(!1),T=p.selectedElements.indexOf(S)>=0&&p.selectedElements.length===1,j=p.selectedShapes.indexOf(S)>=0,{middleLeft:I,middleRight:m}=_(S);(0,d.useAnchorSnap)(P,[h],[T]),(0,d.useAnchorSnap)(g,[h],[T]);const A=(0,l.useColor)(S,S.a.color,"stroke");return t.default.createElement(t.default.Fragment,null,t.default.createElement(a.Line,Object.assign({ref:h,name:"element",id:S.id,x:S.a.x,y:S.a.y,points:[0,0,S.a.width,0],offsetY:-S.a.height/2,strokeWidth:S.a.height,hitStrokeWidth:Math.max(S.a.height,20),dash:S.dash.map(L=>L*S.a.height)},A,{rotation:S.a.rotation,opacity:S.animated("opacity"),shadowEnabled:S.shadowEnabled,shadowBlur:S.shadowBlur,shadowOffsetX:S.shadowOffsetX,shadowOffsetY:S.shadowOffsetY,shadowColor:S.shadowColor,shadowOpacity:S.shadowOpacity,listening:y,draggable:b?S.draggable&&j:S.draggable,preventDefault:!b||j,hideInExport:!S.showInExport,onMouseEnter:()=>{M(!0)},onMouseLeave:()=>{M(!1)},onDragMove:L=>{S.set({x:L.target.x(),y:L.target.y()})},onDragEnd:L=>{S.set({x:L.target.x(),y:L.target.y()})},onTransform:L=>{const k=L.target.scaleX();L.target.scaleX(1),L.target.scaleY(1),S.set({height:S.height*k,width:S.width*k,x:L.target.x(),y:L.target.y(),rotation:L.target.rotation()})}})),t.default.createElement(a.Group,{x:I.x,y:I.y,rotation:S.rotation,hideInExport:!S.showInExport},t.default.createElement(v,{element:S,type:S.startHead})),t.default.createElement(a.Group,{x:m.x,y:m.y,rotation:S.rotation+180},t.default.createElement(v,{element:S,type:S.endHead})),(x||j&&!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:I.x,y:I.y,ref:P,name:"line-anchor"},O(p.scale,p),{onDragMove:L=>{const k=E(L.target.position(),m,S.height);S.set({x:k.x,y:k.y,width:k.width,rotation:k.rotation})}})),t.default.createElement(a.Rect,Object.assign({x:m.x,y:m.y,ref:g,name:"line-anchor"},O(p.scale,p),{onDragMove:L=>{const k=E(I,L.target.position(),S.height);S.set({x:k.x,y:k.y,width:k.width,rotation:k.rotation})}})))))})}(dd)),dd}var Eo={},Wb;function Ex(){return Wb||(Wb=1,function(e){var i=Eo&&Eo.__createBinding||(Object.create?function(q,z,N,U){U===void 0&&(U=N);var $=Object.getOwnPropertyDescriptor(z,N);$&&!("get"in $?!z.__esModule:$.writable||$.configurable)||($={enumerable:!0,get:function(){return z[N]}}),Object.defineProperty(q,U,$)}:function(q,z,N,U){U===void 0&&(U=N),q[U]=z[N]}),t=Eo&&Eo.__setModuleDefault||(Object.create?function(q,z){Object.defineProperty(q,"default",{enumerable:!0,value:z})}:function(q,z){q.default=z}),n=Eo&&Eo.__importStar||function(){var q=function(z){return q=Object.getOwnPropertyNames||function(N){var U=[];for(var $ in N)Object.prototype.hasOwnProperty.call(N,$)&&(U[U.length]=$);return U},q(z)};return function(z){if(z&&z.__esModule)return z;var N={};if(z!=null)for(var U=q(z),$=0;$<U.length;$++)U[$]!=="default"&&i(N,z,U[$]);return t(N,z),N}}(),a=Eo&&Eo.__importDefault||function(q){return q&&q.__esModule?q:{default:q}};Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=e.useLoader=e.setVideoLoaderHook=void 0;const l=a(Tn()),s=Qi,c=No,d=Ja,w=a(Dp()),_=a(Ji()),E=yc,O=_c(),v=Ks(),S=n(qd()),p=ts(),h=jp(),P=bc(),g=Xs();function y(){return document.createElement("canvas")}async function b(q){if(!(q.indexOf("data:image/svg+xml")>=0||q.indexOf(".svg")>=0))return q;const z=await S.urlToString(q),N=S.fixSize(z);return S.svgToURL(N)}const x=q=>{const[z,N]=l.default.useState(q);return l.default.useEffect(()=>{(async()=>{const U=await b(q);U!==z&&N(U)})()},[q]),z},M=new window.Image;M.src=S.svgToURL(`
228
- <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
229
- <path opacity="0.6" d="M4 5.49683V18.5032C4 20.05 5.68077 21.0113 7.01404 20.227L18.0694 13.7239C19.384 12.9506 19.384 11.0494 18.0694 10.2761L7.01404 3.77296C5.68077 2.98869 4 3.95 4 5.49683Z" fill="white"/>
230
- <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"/>
231
- </svg>
232
- `);const T=new window.Image;T.src=S.svgToURL(`
233
- <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
234
- <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"/>
235
- <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"/>
236
- <path d="M14 19L14 5C14 3.89543 14.8954 3 16 3L17 3C18.1046 3 19 3.89543 19 5L19 19C19 20.1046 18.1046 21 17 21L16 21C14.8954 21 14 20.1046 14 19Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
237
- <path d="M10 19L10 5C10 3.89543 9.10457 3 8 3L7 3C5.89543 3 5 3.89543 5 5L5 19C5 20.1046 5.89543 21 7 21L8 21C9.10457 21 10 20.1046 10 19Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
238
- </svg>
239
- `);function j(q,z,N,U,$,ee,G){for(var Z=new ImageData(z,N),W=new Int32Array(q.data.buffer),te=q.width,re=new Int32Array(Z.data.buffer),ie=Z.width,ae=z/ee,se=N/G,de=Math.round(1/ae),he=Math.round(1/se),Oe=de*he,_e=0;_e<Z.height;_e++)for(var Ae=0;Ae<ie;Ae++){for(var ce=U+Math.round(Ae/ae)+($+Math.round(_e/se))*te,pe=0,Ce=0,Le=0,ue=0,ve=0;ve<he;ve++)for(var xe=0;xe<de;xe++){var je=W[ce+xe+ve*te];pe+=je<<24>>>24,Ce+=je<<16>>>24,Le+=je<<8>>>24,ue+=je>>>24}pe=Math.round(pe/Oe),Ce=Math.round(Ce/Oe),Le=Math.round(Le/Oe),ue=Math.round(ue/Oe),re[Ae+_e*ie]=ue<<24|Le<<16|Ce<<8|pe}return Z}function I(q,z){var N,U;const $=y();$.width=q.width,$.height=q.height,(N=$.getContext("2d"))===null||N===void 0||N.drawImage(q,0,0,$.width,$.height);const ee=j($.getContext("2d").getImageData(0,0,$.width,$.height),Math.floor($.width*z),Math.floor($.height*z),0,0,$.width,$.height);return $.width=Math.floor($.width*z),$.height=Math.floor($.height*z),(U=$.getContext("2d"))===null||U===void 0||U.putImageData(ee,0,0),$}const m=(q,z,N,U,$=0,ee=!1)=>{const G=Math.floor(Math.max(q.width*U,1)),Z=Math.floor(Math.max(q.height*U,1)),W=Math.min($*U,G/2,Z/2),te=Math.max(q.width/N.width,q.height/N.height)*U,re=q.page._exportingOrRendering&&p.flags.imageDownScalingEnabled&&te<1&&!ee,ie=N.x===0&&N.y===0&&N.width===(z==null?void 0:z.width)&&N.height===(z==null?void 0:z.height),ae=l.default.useMemo(()=>{if(!(!z||!z.width||!z.height))return ie&&W===0&&!re?void 0:y()},[z,W,re,ie]),se=()=>{if(!ae||!z)return;ae.width=G,ae.height=Z;const de=ae.getContext("2d");if(!de)return;W&&(de.beginPath(),de.moveTo(W,0),de.lineTo(G-W,0),de.arc(G-W,W,W,3*Math.PI/2,0,!1),de.lineTo(G,Z-W),de.arc(G-W,Z-W,W,0,Math.PI/2,!1),de.lineTo(W,Z),de.arc(W,Z-W,W,Math.PI/2,Math.PI,!1),de.lineTo(0,W),de.arc(W,W,W,Math.PI,3*Math.PI/2,!1),de.clip());const he=re?I(z,te):z,Oe=re?{x:Math.floor(N.x*te),y:Math.floor(N.y*te),width:Math.floor(N.width*te),height:Math.floor(N.height*te)}:N;de.drawImage(he,Oe.x,Oe.y,Oe.width,Oe.height,0,0,ae.width,ae.height)};return l.default.useLayoutEffect(()=>{se()},[ae,q.width,q.height,N.x,N.y,N.width,N.height,$,U,ee,q.page._exportingOrRendering,re]),l.default.useEffect(()=>()=>{ae&&ae.nodeName==="CANVAS"&&_.default.Util.releaseCanvas(ae)},[ae]),[ae||z,se]},A=(q,z,N,U)=>{const $=x(q.clipSrc||""),[ee,G]=(0,w.default)($,"anonymous"),Z=q.clipSrc?G:"loaded";(0,e.useLoader)(Z,q.clipSrc,q.id);const W=l.default.useMemo(()=>{if(z&&ee)return y()},[z,ee]);function te(){var re;if(!ee||!z||!z.width||!z.height||!ee||!ee.width||!ee.height||!W)return;const ie=y(),ae=Math.max(q.width/ee.width*N,q.height/ee.height*N);ie.width=ee.width*ae,ie.height=ee.height*ae,(re=ie.getContext("2d"))===null||re===void 0||re.drawImage(ee,0,0,ie.width,ie.height),W.width=Math.max(z.width,1),W.height=Math.max(z.height,1);const se=W.getContext("2d");se&&(se.save(),se.drawImage(ie,0,0,z.width,z.height),_.default.Util.releaseCanvas(ie),se.globalCompositeOperation="source-in",se.drawImage(z,0,0,W.width,W.height),se.restore())}return l.default.useLayoutEffect(()=>{te()},[W,z,ee,q.width,q.height,N,...U]),[q.clipSrc&&ee?W:z,te]},L=y(),k=(0,s.observer)(({element:q})=>{const z=Math.min(30,q.width/4,q.height/4),N=l.default.useRef(null);return l.default.useEffect(()=>{const U=N.current;if(!U)return;const $=new _.default.Animation(ee=>{U.rotate(((ee==null?void 0:ee.timeDiff)||0)/2)},U.getLayer());return $.start(),()=>{$.stop()}}),l.default.createElement(d.Group,{x:q.a.x,y:q.a.y,rotation:q.a.rotation,listening:!1,opacity:q.a.opacity,hideInExport:!q.showInExport},l.default.createElement(d.Rect,{width:q.width,height:q.height,fill:"rgba(124, 173, 212, 0.8)"}),l.default.createElement(d.Arc,{ref:N,x:q.width/2,y:q.height/2,fill:"white",outerRadius:Math.abs(z),innerRadius:Math.max(1,z-5),angle:270}))}),R=(0,s.observer)(({element:q})=>{const z="Can not load the video...",N=Math.max(10,Math.min(30,q.width/25));return l.default.createElement(d.Group,{x:q.a.x,y:q.a.y,rotation:q.a.rotation,listening:!1,opacity:q.a.opacity,hideInExport:!q.showInExport},l.default.createElement(d.Rect,{width:q.width,height:q.height,fill:"rgba(223, 102, 102, 0.8)"}),l.default.createElement(d.Text,{text:z,fontSize:N,width:q.width,height:q.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});function B(q,z,N){const U=l.default.useRef("loading"),$=l.default.useRef(null),[ee,G]=l.default.useState(0),Z=l.default.useRef(),W=l.default.useRef(),te=l.default.useRef();return Z.current===q&&W.current===z&&te.current===N||(U.current="loading",$.current=void 0,Z.current=q,W.current=z,te.current=N),l.default.useLayoutEffect(function(){if(q){var re=document.createElement("video");return re.addEventListener("canplay",ie),re.addEventListener("error",ae),z&&(re.crossOrigin=z),N&&(re.referrerpolicy=N),re.src=q,re.load(),function(){re.removeEventListener("canplay",ie),re.removeEventListener("error",ae)}}function ie(){U.current="loaded",$.current=re,$.current.currentTime=0,G(Math.random()),$.current.removeEventListener("canplay",ie)}function ae(se){U.current="failed",$.current=void 0,G(Math.random())}},[q,z,N]),[$.current,U.current]}let X=B;const Y=q=>{X=q};e.setVideoLoaderHook=Y;const Q=(q,z,N)=>{const U=l.default.useRef(),$=()=>{var ee;(ee=U.current)===null||ee===void 0||ee.call(U),U.current=void 0};l.default.useEffect(()=>$,[]),l.default.useLayoutEffect(()=>{const ee=z.slice(0,200),G=`video with id ${N} url: ${ee}`;q!=="loading"||U.current||(U.current=(0,v.incrementLoader)(G)),q!=="loading"&&$(),q==="failed"&&(0,v.triggerLoadError)(G)},[q])};e.useLoader=Q,e.VideoElement=(0,s.observer)(({element:q,store:z})=>{var N;const[U,$]=l.default.useState(!1),ee=l.default.useRef(null),G=l.default.useRef(null),[Z,W]=l.default.useState(!1),te=z.selectedShapes.indexOf(q)>=0,[re,ie]=l.default.useState(!1),[ae,se]=X(q.src,"anonymous"),de=z.activePage===q.page;(0,e.useLoader)(se,q.src,q.id),ae&&(ae.width=ae.videoWidth,ae.height=ae.videoHeight,ae.playsInline=!0);const he=ae||L;l.default.useEffect(()=>{ae&&z.history.ignore(()=>{q.set({duration:1e3*ae.duration})})},[ae]),l.default.useEffect(()=>{var Ie;if(!ae)return;const Me=z.animatedElementsIds,Ye=(!Me.length||Me.includes(q.id))&&z.isPlaying,Mt=de&&(Ye||re);if(!Mt)return void ae.pause();Mt&&(ae.currentTime=q.startTime*ae.duration,ae.play());const _t=new _.default.Animation(()=>{bt()},(Ie=ee.current)===null||Ie===void 0?void 0:Ie.getLayer());_t.start();const Yt=()=>{ie(!1),ae.currentTime=q.startTime*ae.duration},wn=()=>{ae.currentTime>=q.endTime*ae.duration&&(ae.pause(),ae.currentTime=q.startTime*ae.duration,ie(!1))};return ae.addEventListener("ended",Yt),ae.addEventListener("timeupdate",wn),()=>{ae.pause(),_t.stop(),ae.removeEventListener("ended",Yt),ae.removeEventListener("timeupdate",wn)}},[ae,re,z.isPlaying,de]),l.default.useEffect(()=>{ae&&(ae.volume=q.volume)},[ae,q.volume]);const Oe=l.default.useRef();l.default.useEffect(()=>{const Ie=(0,c.autorun)(()=>{var Me,Ye;if(ae){const Mt=z.animatedElementsIds;if(Mt.length&&!Mt.includes(q.id))return;const _t=(z.currentTime-q.page.startTime)%q.duration;if(Math.abs(1e3*ae.currentTime-_t)>500||!z.isPlaying){const Yt=_t/1e3;Yt!==ae.currentTime&&(ae.currentTime=Yt),ae.readyState!==4&&!z.isPlaying&&!Oe.current&&(Oe.current=(0,v.incrementLoader)(`video ${q.id}`))}bt(),(Ye=(Me=ee.current)===null||Me===void 0?void 0:Me.getLayer())===null||Ye===void 0||Ye.batchDraw()}});return()=>{Ie(),Oe.current&&(Oe.current(),Oe.current=null)}},[z,ae]),l.default.useEffect(()=>{if(!ae)return;const Ie=()=>{var Ye,Mt;ae.readyState!==4&&q.page._exportingOrRendering||Oe.current&&(bt(),(Mt=(Ye=ee.current)===null||Ye===void 0?void 0:Ye.getLayer())===null||Mt===void 0||Mt.batchDraw(),Oe.current(),Oe.current=null)};let Me;return q.page._exportingOrRendering&&(Me=setInterval(Ie,50)),ae.addEventListener("timeupdate",Ie),ae.addEventListener("canplay",Ie),()=>{clearInterval(Me),ae.removeEventListener("timeupdate",Ie),ae.removeEventListener("canplay",Ie)}},[q.page._exportingOrRendering,ae,q.id,v.incrementLoader]);let{cropX:_e,cropY:Ae,cropWidth:ce,cropHeight:pe}=q;se!=="loaded"&&(_e=Ae=0,ce=pe=1);const Ce=he.width*ce,Le=he.height*pe,ue=q.width/q.height;let ve,xe;const je=Ce/Le,at=q.type==="svg";at?(ve=Ce,xe=Le):ue>=je?(ve=Ce,xe=Ce/ue):(ve=Le*ue,xe=Le);const ht={x:he.width*_e,y:he.height*Ae,width:ve,height:xe},et=(N=q.cornerRadius)!==null&&N!==void 0?N:0,[Ke,ze]=m(q,he,ht,z._elementsPixelRatio,et,U||q._cropModeEnabled||q.type==="svg");let[Be,Ve]=A(q,Ke,z._elementsPixelRatio,[ht,et,z._elementsPixelRatio]);function bt(){ze(),Ve()}const Ct=Math.max(q.width/ve,q.height/xe);l.default.useEffect(()=>{var Ie;if(!q._cropModeEnabled)return;const Me=(Ie=ee.current)===null||Ie===void 0?void 0:Ie.getStage();function Ye(_t){q._cropModeEnabled&&_t.target!==G.current&&q.toggleCropMode(!1)}function Mt(_t){q._cropModeEnabled&&_t.target.parentNode!==Me.content&&q.toggleCropMode(!1)}return document.body.addEventListener("click",Mt),Me==null||Me.on("click",Ye),Me==null||Me.on("tap",Ye),()=>{document.body.removeEventListener("click",Mt),document.body.removeEventListener("touchstart",Mt),Me==null||Me.off("click",Ye),Me==null||Me.off("click",Ye)}},[q._cropModeEnabled]),l.default.useLayoutEffect(()=>{if(!(U||q._cropModeEnabled))return(0,h.applyFilter)(ee.current,q),(0,c.autorun)(()=>{(0,h.applyFilter)(ee.current,q)},{delay:100})},[he,U,ce,pe,q._cropModeEnabled]),l.default.useLayoutEffect(()=>{var Ie;U||q._cropModeEnabled?(Ie=ee.current)===null||Ie===void 0||Ie.clearCache():(0,h.applyFilter)(ee.current,q)},[U,q.width,q.height,q._cropModeEnabled]),l.default.useEffect(()=>{(0,h.applyFilter)(ee.current,q)},[q.shadowEnabled,q.shadowBlur,q.cornerRadius,q.shadowColor,q.shadowOffsetX,q.shadowOffsetY,q.shadowOpacity]);const we=l.default.useRef(null),Se=l.default.useRef(null),gt=l.default.useRef(null);l.default.useLayoutEffect(()=>{q._cropModeEnabled&&(Se.current.nodes([we.current]),gt.current.nodes([G.current]))},[q._cropModeEnabled]);const wt=Ie=>{Math.round(Ie.target.x())>0&&(Ie.target.x(0),Ie.target.scaleX(1)),Math.round(Ie.target.y())>0&&(Ie.target.y(0),Ie.target.scaleY(1));const Me=Ie.target.width()*Ie.target.scaleX(),Ye=Ie.target.height()*Ie.target.scaleY(),Mt=Math.min(1,ve/Me),_t=Math.min(1,xe/Ye),Yt=1-Mt,wn=Math.min(Yt,Math.max(0,Math.round(-Ie.target.x())/Me)),Sn=1-_t,Qn=Math.min(Sn,Math.max(0,Math.round(-Ie.target.y())/Ye));Ie.target.setAttrs({x:-wn*he.width,y:-Qn*he.height,scaleX:1,scaleY:1}),q.set({cropX:wn,cropY:Qn,cropWidth:Mt,cropHeight:_t})},Pt=()=>{q.type!=="svg"&&q.contentEditable&&setTimeout(()=>{q.toggleCropMode(!0)})},vt=se==="loading",Wt=se==="failed",pn=!vt&&!Wt,Fe=l.default.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),rt=pn?q.a.opacity:0;(0,P.useFadeIn)(ee,rt);const ft=q.selectable||z.role==="admin",De=(0,g.isTouchDevice)();return l.default.createElement(l.default.Fragment,null,vt&&l.default.createElement(k,{element:q}),Wt&&l.default.createElement(R,{element:q}),l.default.createElement(d.Image,{ref:ee,name:"element",id:q.id,image:Be,x:q.a.x,y:q.a.y,width:q.a.width||1,height:q.a.height||1,rotation:q.a.rotation,opacity:rt,shadowEnabled:q.shadowEnabled,shadowBlur:q.shadowBlur,shadowOffsetX:q.shadowOffsetX,shadowOffsetY:q.shadowOffsetY,shadowColor:q.shadowColor,shadowOpacity:q.shadowOpacity,customCrop:ht,listening:ft,draggable:De?q.draggable&&te:q.draggable,preventDefault:!De||te,hideInExport:!q.showInExport,onMouseEnter:()=>{W(!0)},onMouseLeave:()=>{W(!1)},onDragMove:Ie=>{q.set({x:Ie.target.x(),y:Ie.target.y()})},onDragEnd:Ie=>{q.set({x:Ie.target.x(),y:Ie.target.y()})},onDblClick:Pt,onDblTap:Pt,onTransformStart:()=>{$(!0),Fe.current={cropX:q.cropX,cropY:q.cropY,cropWidth:q.cropWidth,cropHeight:q.cropHeight}},onTransform:Ie=>{var Me;const Ye=Ie.currentTarget,Mt=Math.abs(Ye.scaleX()-1)<1e-7?1:Ye.scaleX(),_t=Math.abs(Ye.scaleY()-1)<1e-7?1:Ye.scaleY();Ye.scaleX(1),Ye.scaleY(1);const Yt=(Me=Ie.target.getStage())===null||Me===void 0?void 0:Me.findOne("Transformer"),wn=1-ve/he.width,Sn=Math.min(wn,Math.max(0,q.cropX)),Qn=1-xe/he.height,ii=Math.min(Qn,Math.max(0,q.cropY)),Sr=Yt.getActiveAnchor(),Ze=!(Sr.indexOf("middle")>=0||Sr.indexOf("center")>=0),Et=!Ze&&Mt<1&&Fe.current.cropHeight>xe/he.height;let Lt=Ze?q.cropWidth:q.cropWidth*Mt;Et&&(Lt=q.cropWidth);const Gt=!Ze&&_t<1&&Fe.current.cropWidth>ve/he.width;let Vt=Ze?q.cropHeight:q.cropHeight*_t;Gt&&(Vt=q.cropHeight),at&&(Lt=q.cropWidth,Vt=q.cropHeight),q.set({cropX:Sn,cropY:ii,x:Ye.x(),y:Ye.y(),width:Ye.width()*Mt,height:Ye.height()*_t,rotation:Ie.target.rotation(),cropWidth:Math.min(Lt,1-Sn),cropHeight:Math.min(Vt,1-ii)})},onTransformEnd:Ie=>{const Me=Ie.currentTarget;q.set({width:Me.width(),height:Me.height(),x:Me.x(),y:Me.y(),rotation:Ie.target.rotation(),cropWidth:ve/he.width,cropHeight:xe/he.height}),$(!1)}}),l.default.createElement(d.Rect,{x:q.a.x,y:q.a.y,width:Math.max(q.a.width-q.borderSize,0),height:Math.max(q.a.height-q.borderSize,0),opacity:rt,offsetX:-q.borderSize/2,offsetY:-q.borderSize/2,stroke:q.borderColor,strokeWidth:q.borderSize,listening:!1,visible:!!q.borderSize,rotation:q.rotation,cornerRadius:Math.max(0,et-q.borderSize),hideInExport:!q.showInExport}),!z.isPlaying&&l.default.createElement(d.Image,{image:re?T:M,x:q.a.x,y:q.a.y,offsetX:-q.a.width/2+15/z.scale,offsetY:-q.a.height/2+15/z.scale,rotation:q.a.rotation,width:30/z.scale,height:30/z.scale,hideInExport:!0,onClick:()=>ie(!re),onTap:()=>ie(!re)}),q._cropModeEnabled&&l.default.createElement(E.Portal,{selector:".page-abs-container",enabled:!0},l.default.createElement(d.Rect,{x:-window.innerWidth/z.scale,y:-window.innerWidth/z.scale,width:window.innerWidth/z.scale*3,height:window.innerWidth/z.scale*3,fill:"rgba(0,0,0,0.3)"}),l.default.createElement(d.Image,{listening:!1,image:Be,x:q.a.x,y:q.a.y,width:q.a.width,height:q.a.height,rotation:q.a.rotation,shadowEnabled:q.shadowEnabled,shadowBlur:q.shadowBlur}),l.default.createElement(d.Group,{x:q.a.x,y:q.a.y,rotation:q.a.rotation,scaleX:Ct,scaleY:Ct},l.default.createElement(d.Image,{image:he,ref:G,opacity:.4,draggable:!0,x:-q.cropX*he.width,y:-q.cropY*he.height,onDragMove:wt,onTransform:wt}),l.default.createElement(d.Transformer,{ref:gt,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ie,Me)=>Me.width<5||Me.height<5?Ie:Me,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),l.default.createElement(d.Rect,{width:ve,height:xe,ref:we,listening:!1,onTransform:Ie=>{Ie.target.x()<-q.cropX*he.width-1e-9&&(Ie.target.x(-q.cropX*he.width),Ie.target.scaleX(1)),Ie.target.y()<-q.cropY*he.height-1e-9&&(Ie.target.y(-q.cropY*he.height),Ie.target.scaleY(1));const Me=Math.min(1,Math.max(0,q.cropX+Ie.target.x()/he.width)),Ye=Math.min(1,Math.max(0,Ie.target.y()/he.height+q.cropY)),Mt=Ie.target.width()*Ie.target.scaleX(),_t=Ie.target.height()*Ie.target.scaleY(),Yt=Math.min(1-Me,Mt/he.width),wn=Math.min(1-Ye,_t/he.height),Sn=Ie.target.getAbsolutePosition(Ie.target.getParent().getParent());Ie.target.scale({x:1,y:1}),Ie.target.position({x:0,y:0}),q.set({x:Sn.x,y:Sn.y,cropX:Me,cropY:Ye,cropWidth:Yt,cropHeight:wn,width:Math.min(Mt*Ct,he.width*(1-Me)*Ct),height:Math.min(_t*Ct,he.height*(1-Ye)*Ct)})}}),l.default.createElement(d.Transformer,{ref:Se,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ie,Me)=>Me.width<5||Me.height<5?Ie:Me,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2,visible:q.resizable}))),(Z||te)&&l.default.createElement(O.Highlighter,{element:q}))})}(Eo)),Eo}var pd={},ig={},Yb;function Dv(){return Yb||(Yb=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TYPES=e.circleData=e.rightTriangleData=e.triangleData=e.rectData=void 0,e.starPath=l,e.diamondPath=s,e.pentagonPath=c,e.hexagonPath=d,e.speechBubblePath=_,e.crossPath=E,e.subTypeToPathDataFunc=O,e.figureToSvg=S;const i=({width:p,height:h,cornerRadius:P})=>{if(P>0){const g=Math.min(P,p/2,h/2);return`M 0 ${g} A ${g} ${g} 0 0 1 ${g} 0 L ${p-g} 0 A ${g} ${g} 0 0 1 ${p} ${g} L ${p} ${h-g} A ${g} ${g} 0 0 1 ${p-g} ${h} L ${g} ${h} A ${g} ${g} 0 0 1 0 ${h-g} Z`}return`M 0 0 L ${p} 0 L ${p} ${h} L 0 ${h} Z`};e.rectData=i;const t=({width:p,height:h})=>`M ${p/2} 0 L ${p} ${h} L 0 ${h} Z`;e.triangleData=t;const n=({width:p,height:h})=>`M 0 0 L ${p} 0 L 0 ${h} Z`;e.rightTriangleData=n;const a=({width:p,height:h})=>`M ${p/2} ${h/2} m -${p/2}, 0 a ${p/2},${h/2} 0 1,0 ${p},0 a ${p/2},${h/2} 0 1,0 -${p},0`;function l({width:p,height:h}){const P=p/2,g=h/2,y=p/2,b=h/2,x=y/2,M=b/2;let T="",j=Math.PI/5;for(let I=0;I<10;I++){const m=I%2==0?b:M,A=P+(I%2==0?y:x)*Math.sin(I*j),L=g-m*Math.cos(I*j);I===0?T=`M ${A} ${L}`:T+=` L ${A} ${L}`}return T+" Z"}function s({width:p,height:h}){const P=p/2,g=h/2;return`M ${P} 0 L ${p} ${g} L ${P} ${h} L 0 ${g} Z`}function c({width:p,height:h}){const P=p/2,g=h/2,y=p/2,b=h/2;let x="",M=2*Math.PI/5;for(let T=0;T<5;T++){const j=b,I=P+y*Math.sin(T*M),m=g-j*Math.cos(T*M);T===0?x=`M ${I} ${m}`:x+=` L ${I} ${m}`}return x+" Z"}function d({width:p,height:h}){const P=p/2,g=h/2,y=p/2,b=h/2;let x="",M=2*Math.PI/6;for(let T=0;T<6;T++){const j=b,I=P+y*Math.sin(T*M),m=g-j*Math.cos(T*M);T===0?x=`M ${I} ${m}`:x+=` L ${I} ${m}`}return x+" Z"}function w({path:p,aspectRatio:h,width:P,height:g}){return{path:p,scaleX:P/h.width,scaleY:g/h.height}}function _({width:p,height:h}){const P=.1*Math.min(p,h),g=.2*p,y=.2*h,b=.5*p;let x=`M ${P},0`;return x+=" H "+(p-P),x+=` A ${P},${P} 0 0 1 ${p},${P}`,x+=" V "+(h-P-y),x+=` A ${P},${P} 0 0 1 ${p-P},${h-y}`,x+=` H ${b+g/2}`,x+=` L ${b},${h}`,x+=` L ${b-g/2},${h-y}`,x+=` H ${P}`,x+=` A ${P},${P} 0 0 1 0,${h-P-y}`,x+=` V ${P}`,x+=` A ${P},${P} 0 0 1 ${P},0`,x+=" Z",x}function E({width:p,height:h}){const P=.3*p,g=.3*h,y=p/2,b=h/2,x=y-P/2,M=y+P/2,T=b-g/2,j=b+g/2;let I=`M ${x},0 `;return I+=`H ${M} `,I+=`V ${T} `,I+=`H ${p} `,I+=`V ${j} `,I+=`H ${M} `,I+=`V ${h} `,I+=`H ${x} `,I+=`V ${j} `,I+="H 0 ",I+=`V ${T} `,I+=`H ${x} `,I+="V 0 ",I+="Z",I}function O(p){return e.TYPES[p]||e.rectData}function v(p,h){const{width:P,height:g,fill:y,stroke:b,strokeWidth:x,dash:M}=p,T=(M||[]).map(L=>L*x);let j=h(p),I=1,m=1;typeof j!="string"&&(I=j.scaleX,m=j.scaleY,j=j.path);const A=`clip-${p.id||Math.random()}`;return`
240
- <svg xmlns="http://www.w3.org/2000/svg" width="${P}" height="${g}">
241
- <defs>
242
- <clipPath id="${A}">
243
- <path d="${j}" />
244
- </clipPath>
245
- </defs>
246
-
247
- <!-- Path for the fill -->
248
- <path d="${j}" fill="${y}" transform="scale(${I}, ${m})"/>
249
-
250
- <!-- Path for the stroke, clipped by the star path -->
251
- <path d="${j}" fill="none" stroke="${b}" stroke-width="${2*x}" clip-path="url(#${A})" transform="scale(${I}, ${m})" stroke-dasharray="${T.join(" ")}"/>
252
- </svg>
253
- `}function S(p){const{subType:h}=p,P=O(h);return P?v(p,P):(console.error(`Polotno error: Can not convert ${p.subType} figure to svg.`),(0,e.rectData)(p))}e.circleData=a,e.TYPES={rect:e.rectData,circle:e.circleData,star:l,triangle:e.triangleData,rightTriangle:e.rightTriangleData,diamond:s,pentagon:c,hexagon:d,speechBubble:_,cross:E,arc:({width:p,height:h})=>w({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:p,height:h}),cloud:({width:p,height:h})=>w({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:p,height:h}),rightArrow:({width:p,height:h})=>{const P=.6*p;return`M 0 ${h/4} L ${P} ${h/4} L ${P} 0 L ${p} ${h/2} L ${P} ${h} L ${P} ${.75*h} L 0 ${.75*h} Z`},leftArrow:({width:p,height:h})=>{const P=.4*p;return`M ${p} ${h/4} L ${P} ${h/4} L ${P} 0 L 0 ${h/2} L ${P} ${h} L ${P} ${.75*h} L ${p} ${.75*h} Z`},downArrow:({width:p,height:h})=>{const P=.6*h;return`M ${p/4} 0 L ${p/4} ${P} L 0 ${P} L ${p/2} ${h} L ${p} ${P} L ${.75*p} ${P} L ${.75*p} 0 Z`},upArrow:({width:p,height:h})=>{const P=.4*h;return`M ${p/4} ${h} L ${p/4} ${P} L 0 ${P} L ${p/2} 0 L ${p} ${P} L ${.75*p} ${P} L ${.75*p} ${h} Z`},asterisk1:({width:p,height:h})=>w({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:p,height:h}),asterisk2:({width:p,height:h})=>w({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:p,height:h}),bookmark:({width:p,height:h})=>w({path:"M0 0H199V238L99.5 142.8L0 238V0Z",aspectRatio:{width:199,height:238},width:p,height:h}),butterfly:({width:p,height:h})=>w({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:p,height:h}),cylinder:({width:p,height:h})=>w({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:p,height:h}),diamond2:({width:p,height:h})=>w({path:"M0 55.5L124 185L248 55.5L189.307 0H58.6933L0 55.5Z",aspectRatio:{width:248,height:185},width:p,height:h}),door:({width:p,height:h})=>w({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:p,height:h}),drop1:({width:p,height:h})=>w({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:p,height:h}),drop2:({width:p,height:h})=>w({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:p,height:h}),explosion:({width:p,height:h})=>w({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:p,height:h}),flag:({width:p,height:h})=>w({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:p,height:h}),flower:({width:p,height:h})=>w({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:p,height:h}),frame:({width:p,height:h})=>w({path:"M0 0H240L200 88L240 176H0L40 88L0 0Z",aspectRatio:{width:240,height:176},width:p,height:h}),heart1:({width:p,height:h})=>w({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:p,height:h}),home:({width:p,height:h})=>w({path:"M0 62.143L95.5 0L191 62.143V195H0V62.143Z",aspectRatio:{width:191,height:195},width:p,height:h}),home2:({width:p,height:h})=>w({path:"M206 94.076L103 0L0 94.076H31.2377V189H175.607V94.076H206Z",aspectRatio:{width:206,height:189},width:p,height:h}),hourglass:({width:p,height:h})=>w({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:p,height:h}),house:({width:p,height:h})=>w({path:"M0 92.367L95 0L190 92.367V223H0V92.367Z",aspectRatio:{width:190,height:223},width:p,height:h}),keyhole:({width:p,height:h})=>w({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:p,height:h}),kiss:({width:p,height:h})=>w({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:p,height:h}),leaf:({width:p,height:h})=>w({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:p,height:h}),lightning1:({width:p,height:h})=>w({path:"M111.5 0L0 142H51.433L31.5 253L143 111H91.567L111.5 0Z",aspectRatio:{width:143,height:253},width:p,height:h}),lightning2:({width:p,height:h})=>w({path:"M126 0H43L0 120.531H36L6 227L110 80.354H73L126 0Z",aspectRatio:{width:126,height:227},width:p,height:h}),magnet:({width:p,height:h})=>w({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:p,height:h}),mithosis:({width:p,height:h})=>w({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:p,height:h}),orangeRicky:({width:p,height:h})=>w({path:"M69 0H0V69V138V207H69H138V138H69V69V0Z",aspectRatio:{width:138,height:207},width:p,height:h}),party:({width:p,height:h})=>w({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:p,height:h}),pillow:({width:p,height:h})=>w({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:p,height:h}),polygon:({width:p,height:h})=>w({path:"M110 0L219.119 63V189L110 252L0.880798 189V63L110 0Z",aspectRatio:{width:220,height:252},width:p,height:h}),rainbow:({width:p,height:h})=>w({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:p,height:h}),rhodeIsland:({width:p,height:h})=>w({path:"M69 0H0V69V138H69V207H138V138V69H69V0Z",aspectRatio:{width:138,height:207},width:p,height:h}),shell:({width:p,height:h})=>w({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:p,height:h}),shield1:({width:p,height:h})=>w({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:p,height:h}),shield2:({width:p,height:h})=>w({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:p,height:h}),skewedRectangle:({width:p,height:h})=>w({path:"M85.9799 0H290L204.02 141H0L85.9799 0Z",aspectRatio:{width:290,height:141},width:p,height:h}),softFlower:({width:p,height:h})=>w({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:p,height:h}),softStar:({width:p,height:h})=>w({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:p,height:h}),stairs1:({width:p,height:h})=>w({path:"M0 0H67.667V67.667H135.333V135.333H203V203H0V0Z",aspectRatio:{width:203,height:203},width:p,height:h}),stairs2:({width:p,height:h})=>w({path:"M50 0H0V200H200V150H150V100H100V50H50V0Z",aspectRatio:{width:200,height:200},width:p,height:h}),teewee:({width:p,height:h})=>w({path:"M69 0H138V69H207V138H138H69H0V69H69V0Z",aspectRatio:{width:207,height:138},width:p,height:h}),blob1:({width:p,height:h})=>w({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:p,height:h}),blob10:({width:p,height:h})=>w({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:p,height:h}),blob11:({width:p,height:h})=>w({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:p,height:h}),blob12:({width:p,height:h})=>w({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:p,height:h}),blob13:({width:p,height:h})=>w({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:p,height:h}),blob14:({width:p,height:h})=>w({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:p,height:h}),blob15:({width:p,height:h})=>w({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:p,height:h}),blob16:({width:p,height:h})=>w({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:p,height:h}),blob17:({width:p,height:h})=>w({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:p,height:h}),blob18:({width:p,height:h})=>w({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:p,height:h}),blob19:({width:p,height:h})=>w({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:p,height:h}),blob2:({width:p,height:h})=>w({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:p,height:h}),blob20:({width:p,height:h})=>w({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:p,height:h}),blob21:({width:p,height:h})=>w({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:p,height:h}),blob22:({width:p,height:h})=>w({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:p,height:h}),blob23:({width:p,height:h})=>w({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:p,height:h}),blob24:({width:p,height:h})=>w({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:p,height:h}),blob25:({width:p,height:h})=>w({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:p,height:h}),blob26:({width:p,height:h})=>w({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:p,height:h}),blob27:({width:p,height:h})=>w({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:p,height:h}),blob28:({width:p,height:h})=>w({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:p,height:h}),blob29:({width:p,height:h})=>w({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:p,height:h}),blob3:({width:p,height:h})=>w({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:p,height:h}),blob30:({width:p,height:h})=>w({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:p,height:h}),blob31:({width:p,height:h})=>w({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:p,height:h}),blob32:({width:p,height:h})=>w({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:p,height:h}),blob4:({width:p,height:h})=>w({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:p,height:h}),blob5:({width:p,height:h})=>w({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:p,height:h}),blob6:({width:p,height:h})=>w({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:p,height:h}),blob7:({width:p,height:h})=>w({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:p,height:h}),blob8:({width:p,height:h})=>w({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:p,height:h}),blob9:({width:p,height:h})=>w({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:p,height:h})}}(ig)),ig}var Kb;function Ox(){return Kb||(Kb=1,function(e){var i=pd&&pd.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const t=i(Tn()),n=Qi,a=Ja,l=Dv(),s=_c(),c=Xs(),d=zd(),w={};e.FigureElement=(0,n.observer)(({element:_,store:E})=>{const O=_.selectable||E.role==="admin",v=(0,c.isTouchDevice)(),[S,p]=t.default.useState(!1),h=E.selectedShapes.indexOf(_)>=0,P=Math.min(_.strokeWidth,_.width/2,_.height/2),g=Math.max(0,Math.min(_.width/2,_.height/2,_.cornerRadius)),y=(0,d.useColor)(_,_.a.fill,"fill"),b=Object.assign(Object.assign({width:_.a.width,height:_.a.height},y),{cornerRadius:g,opacity:_.animated("opacity"),shadowEnabled:_.shadowEnabled,shadowBlur:_.shadowBlur,shadowOffsetX:_.shadowOffsetX,shadowOffsetY:_.shadowOffsetY,shadowColor:_.shadowColor,shadowOpacity:_.shadowOpacity,preventDefault:!v||h,hideInExport:!_.showInExport}),x=(0,d.useColor)(_,_.stroke,"stroke"),M=Object.assign(Object.assign({visible:P>0,x:P/2,y:P/2,width:_.a.width-P,height:_.a.height-P},x),{strokeWidth:P,cornerRadius:Math.max(0,g-P),dash:_.dash.map(m=>m*P),opacity:_.animated("opacity"),hideInExport:!_.showInExport,listening:!1}),T=(j=_.subType,w[j]||(w[j]=(I=(0,l.subTypeToPathDataFunc)(j),(0,n.observer)(({element:m,fillProps:A,strokeProps:L})=>{let k=I({width:m.a.width,height:m.a.height,cornerRadius:m.cornerRadius}),R=1,B=1;typeof k!="string"&&(R=k.scaleX,B=k.scaleY,k=k.path);const X=t.default.useRef(null);return t.default.createElement(t.default.Fragment,null,t.default.createElement(a.Rect,{width:m.width,height:m.height,fill:"transparent"}),t.default.createElement(a.Path,Object.assign({},A,{ref:X,data:k,scaleX:R,scaleY:B})),t.default.createElement(a.Group,{clipFunc:Y=>{const Q=X.current;if(Q){var q=Q.dataArray;Y.beginPath();for(var z=0;z<q.length;z++){var N=q[z].command,U=q[z].points;switch(N){case"L":Y.lineTo(U[0],U[1]);break;case"M":Y.moveTo(U[0],U[1]);break;case"C":Y.bezierCurveTo(U[0],U[1],U[2],U[3],U[4],U[5]);break;case"Q":Y.quadraticCurveTo(U[0],U[1],U[2],U[3]);break;case"A":var $=U[0],ee=U[1],G=U[2],Z=U[3],W=U[4],te=U[5],re=U[6],ie=U[7],ae=G>Z?G:Z,se=G>Z?1:G/Z,de=G>Z?Z/G:1;Y.translate($,ee),Y.rotate(re),Y.scale(se,de),Y.arc(0,0,ae,W,W+te,1-ie),Y.scale(1/se,1/de),Y.rotate(-re),Y.translate(-$,-ee);break;case"z":Y.closePath()}}}},scaleX:R,scaleY:B},t.default.createElement(a.Path,Object.assign({},L,{x:0,y:0,data:k,strokeWidth:2*L.strokeWidth,dash:L.dash.map(Y=>Y)}))))}))),w[j]||a.Group);var j,I;return t.default.createElement(t.default.Fragment,null,t.default.createElement(a.Group,{id:_.id,x:_.a.x,y:_.a.y,rotation:_.a.rotation,opacity:_.a.opacity,listening:O,draggable:v?_.draggable&&h:_.draggable,name:"element",onMouseEnter:()=>{p(!0)},onMouseLeave:()=>{p(!1)},onDragMove:m=>{_.set({x:m.target.x(),y:m.target.y()})},onDragEnd:m=>{_.set({x:m.target.x(),y:m.target.y()})},onTransform:m=>{const A=m.target.scale();m.target.scaleX(1),m.target.scaleY(1),_.set({width:_.width*A.x,height:_.height*A.y,x:m.target.x(),y:m.target.y(),rotation:m.target.rotation()})}},t.default.createElement(T,{element:_,fillProps:b,strokeProps:M})),(S||h)&&t.default.createElement(s.Highlighter,{element:_}))})}(pd)),pd}var Xb;function xx(){return Xb||(Xb=1,function(e){var i=id&&id.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(e,"__esModule",{value:!0}),e.registerShapeComponent=S;const t=i(Tn()),n=Qi,a=a_(),l=u_(),s=wx(),c=Sx(),d=Ex(),w=Ox(),_=Ja,E=ts(),O=(0,n.observer)(h=>{const{element:P,store:g}=h,{children:y}=P,b=P.selectable||g.role==="admin";return t.default.createElement(_.Group,{opacity:P.opacity,listening:b,hideInExport:!P.showInExport},y.map(x=>t.default.createElement(p,Object.assign({},h,{key:x.id,store:g,element:x}))))}),v={text:a.TextElement,image:l.ImageElement,svg:l.ImageElement,line:c.LineElement,video:d.VideoElement,figure:w.FigureElement,group:O};function S(h,P){v[h]=P}const p=(0,n.observer)(h=>{let P=v[h.element.type];return h.element.type==="text"&&E.flags.htmlRenderEnabled&&(P=s.HTMLElement),h.element.visible?P?t.default.createElement(P,Object.assign({},h)):(console.error("Can not find component for "+h.element.type),null):null});e.default=p}(id)),id}var og={},Zb;function Px(){return Zb||(Zb=1,function(e){function i(t,n,a="scale"){const l=n.width/n.height;let s,c;l>=t.width/t.height?(s=t.width,c=t.width/l):(s=t.height*l,c=t.height);let d=0,w=0;return a==="left-top"?(d=0,w=0):a==="left-middle"?(d=0,w=(t.height-c)/2):a==="left-bottom"?(d=0,w=t.height-c):a==="center-top"?(d=(t.width-s)/2,w=0):a==="center-middle"?(d=(t.width-s)/2,w=(t.height-c)/2):a==="center-bottom"?(d=(t.width-s)/2,w=t.height-c):a==="right-top"?(d=t.width-s,w=0):a==="right-middle"?(d=t.width-s,w=(t.height-c)/2):a==="right-bottom"?(d=t.width-s,w=t.height-c):a==="scale"?(d=0,w=0,s=t.width,c=t.height):console.error(new Error("Unknown clip position property - "+a)),{cropX:d,cropY:w,cropWidth:s,cropHeight:c}}Object.defineProperty(e,"__esModule",{value:!0}),e.getCrop=i}(og)),og}var $a={},ag={},Qb;function Cx(){return Qb||(Qb=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 i=jv();e.URL="https://api.polotno.com",e.API="https://api.polotno.com/api";const t=()=>e.URL+"/api";e.getAPI=t;const n={},a=(y,b)=>{n[y]||(n[y]=!0,console.error(b))},l=`API for iconscout is provided as a demonstration.
254
- For production usage you have to use your own API endpoint.
255
- https://iconscout.com/developers, https://iconscout.com/legal/api-license-development-agreement
256
- https://polotno.com/docs/server-api`;e.URLS={unsplashList:({query:y,page:b=1})=>`${(0,e.getAPI)()}/get-unsplash?query=${y}&per_page=20&page=${b}&KEY=${(0,i.getKey)()}`,unsplashDownload:y=>`${(0,e.getAPI)()}/download-unsplash?id=${y}&KEY=${(0,i.getKey)()}`,svgapiList:({query:y,page:b=0})=>`${(0,e.getAPI)()}/get-svgapi?query=${y}&page=${b}&per_page=20&KEY=${(0,i.getKey)()}`,svgapiDownload:y=>`${(0,e.getAPI)()}/download-svgapi?path=${y}&KEY=${(0,i.getKey)()}`,iconscoutList:({query:y,page:b=1})=>(a("iconscout",l),`${(0,e.getAPI)()}/get-iconscout?query=${y}&page=${b}&KEY=${(0,i.getKey)()}`),iconscoutDownload:y=>(a("iconscout",l),`${(0,e.getAPI)()}/download-iconscout?uuid=${y}&KEY=${(0,i.getKey)()}`),nounProjectList:({query:y,page:b=1})=>`${(0,e.getAPI)()}/get-nounproject?query=${y}&page=${b}&KEY=${(0,i.getKey)()}`,nounProjectDownload:y=>`${(0,e.getAPI)()}/download-nounproject?id=${y}&KEY=${(0,i.getKey)()}`,templateList:({query:y,page:b=1,sizeQuery:x})=>`${(0,e.getAPI)()}/get-templates?${x}&query=${y}&per_page=30&page=${b}&KEY=${(0,i.getKey)()}`,googleFontsList:()=>`${(0,e.getAPI)()}/get-google-fonts?KEY=${(0,i.getKey)()}`,googleFontImage:y=>{return`${e.URL}/google-fonts-previews/black/${b=y,x=" ",M="-",b.replace(new RegExp(x,"g"),M)}.png`;var b,x,M},textTemplateList:()=>`${(0,e.getAPI)()}/get-text-templates?KEY=${(0,i.getKey)()}`,removeBackground:()=>`${(0,e.getAPI)()}/remove-image-background?KEY=${(0,i.getKey)()}`,aiText:()=>`${(0,e.getAPI)()}/ai/text?KEY=${(0,i.getKey)()}`};const s=()=>e.URLS.googleFontsList();e.getGoogleFontsListAPI=s;const c=y=>e.URLS.googleFontImage(y);e.getGoogleFontImage=c;const d=()=>`${(0,e.getAPI)()}/get-basic-shapes?KEY=${(0,i.getKey)()}`;e.polotnoShapesList=d;const w=()=>e.URLS.removeBackground();e.removeBackground=w;const _=y=>e.URLS.templateList(y);e.templateList=_;const E=()=>e.URLS.textTemplateList();e.textTemplateList=E;const O=y=>e.URLS.unsplashList(y);e.unsplashList=O;const v=y=>e.URLS.unsplashDownload(y);e.unsplashDownload=v;const S=y=>e.URLS.svgapiList(y);e.svgapiList=S;const p=y=>e.URLS.svgapiDownload(y);e.svgapiDownload=p;const h=y=>e.URLS.iconscoutList(y);e.iconscoutList=h;const P=y=>e.URLS.iconscoutDownload(y);e.iconscoutDownload=P;const g=(y,b)=>{e.URLS[y]=b};e.setAPI=g}(ag)),ag}var Jb;function jv(){return Jb||(Jb=1,function(e){var i=$a&&$a.__createBinding||(Object.create?function(m,A,L,k){k===void 0&&(k=L);var R=Object.getOwnPropertyDescriptor(A,L);R&&!("get"in R?!A.__esModule:R.writable||R.configurable)||(R={enumerable:!0,get:function(){return A[L]}}),Object.defineProperty(m,k,R)}:function(m,A,L,k){k===void 0&&(k=L),m[k]=A[L]}),t=$a&&$a.__setModuleDefault||(Object.create?function(m,A){Object.defineProperty(m,"default",{enumerable:!0,value:A})}:function(m,A){m.default=A}),n=$a&&$a.__importStar||function(){var m=function(A){return m=Object.getOwnPropertyNames||function(L){var k=[];for(var R in L)Object.prototype.hasOwnProperty.call(L,R)&&(k[k.length]=R);return k},m(A)};return function(A){if(A&&A.__esModule)return A;var L={};if(A!=null)for(var k=m(A),R=0;R<k.length;R++)k[R]!=="default"&&i(L,A,k[R]);return t(L,A),L}}();Object.defineProperty(e,"__esModule",{value:!0}),e.__=e.getKey=e.isCreditVisible=void 0,e.isKeyPaid=j,e.validateKey=I;const a=n(No),l=Cx(),s=ts(),c=a.observable({value:!1}),d=()=>c.value;e.isCreditVisible=d;const w=a.action(()=>{c.value=!0});let _="";const E=()=>_||"";e.getKey=E;const O=5,v=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",p="Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet",h="Can not validate Polotno API key. Please report to anton@polotno.com immediately.",P="%cPolotno Free Version. Development or non-commercial usage only. https://polotno.com/";let g=window.location.origin;const y=navigator.userAgent.indexOf("Headless")>-1,b=navigator.userAgent.indexOf("Electron")>-1;g==="file://"&&y&&(g="headless"),g==="file://"&&b&&(g="electron");const x=`%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;const T=m=>{M=m};async function j(m){for(let A=0;A<O;A++)try{const L=await M((0,l.getAPI)()+"/validate-key",{method:"POST",body:JSON.stringify({key:m,site:location.host})});if(!m)return console.warn(S),!1;if(L.status!==200){await new Promise(R=>setTimeout(R,v));continue}const k=await L.json();return k.is_valid||console.warn(p),k.is_paid||console.log(P,"background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),k.is_domain_valid||console.log(x,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),(0,s.useRemoveBackground)(k.remove_background_enabled),k.is_paid||!1}catch{await new Promise(k=>setTimeout(k,v))}return console.error(h),!0}async function I(m,A){_=m,await j(m)&&!A||w()}e.__=T}($a)),$a}var lg={},e3;function Fv(){return e3||(e3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.pxToUnitString=e.unitToPx=e.pxToUnitRounded=e.pxToUnit=void 0;const i=({px:l,unit:s="px",dpi:c})=>{switch(s){case"pt":default:return l;case"mm":return l/(c/25.4);case"cm":return l/(c/2.54);case"in":return l/c}};e.pxToUnit=i;const t=({px:l,precious:s=2,dpi:c=72,unit:d="px"})=>parseFloat((0,e.pxToUnit)({px:l,dpi:c,unit:d}).toFixed(s));e.pxToUnitRounded=t;const n=({unitVal:l,dpi:s,unit:c})=>l/(0,e.pxToUnit)({px:1,unit:c,dpi:s});e.unitToPx=n;const a=l=>{const s=parseFloat((0,e.pxToUnit)(l).toFixed(1));switch(l.unit){case"pt":return`${Math.round(s)}pt`;case"mm":return`${s}mm`;case"cm":return`${s}cm`;case"in":return`${s}in`;default:return`${Math.round(s)}px`}};e.pxToUnitString=a}(lg)),lg}var t3;function kx(){return t3||(t3=1,function(e){var i=Is&&Is.__rest||function(U,$){var ee={};for(var G in U)Object.prototype.hasOwnProperty.call(U,G)&&$.indexOf(G)<0&&(ee[G]=U[G]);if(U!=null&&typeof Object.getOwnPropertySymbols=="function"){var Z=0;for(G=Object.getOwnPropertySymbols(U);Z<G.length;Z++)$.indexOf(G[Z])<0&&Object.prototype.propertyIsEnumerable.call(U,G[Z])&&(ee[G[Z]]=U[G[Z]])}return ee},t=Is&&Is.__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=A;const n=t(Tn()),a=Qi,l=No,s=Ja,c=t(Dp()),d=t(Ji()),w=t(xx()),_=b_(),E=u_(),O=Px(),v=jv(),S=Hd(),p=Fv(),h=ts(),P=Xs(),g=zd(),y=_v(),b=yc,x=d.default.DD._drag;window.removeEventListener("mousemove",x),d.default.DD._drag=function(U){(0,l.runInAction)(()=>{x.call(this,U)})},window.addEventListener("mousemove",d.default.DD._drag);const M=new d.default.Group;M.add(new d.default.Rect({width:20,height:20,fill:"white"})),M.add(new d.default.Path({scaleX:20/24,scaleY:20/24,data:"M4.98313549,11.0001422 C5.49589839,10.9914935 5.92501998,11.3703506 5.99116425,11.8666444 L5.99985778,11.9831355 L6.00348884,12.2068855 C6.11245031,15.4321748 8.76323537,17.9999971 11.9999971,17.9999971 C12.1869612,17.9999971 12.3726725,17.9914753 12.5567465,17.9745765 L12.2928932,17.7071068 C11.9023689,17.3165825 11.9023689,16.6834175 12.2928932,16.2928932 C12.6834175,15.9023689 13.3165825,15.9023689 13.7071068,16.2928932 L15.7071068,18.2928932 C16.0976311,18.6834175 16.0976311,19.3165825 15.7071068,19.7071068 L13.7071068,21.7071068 C13.3165825,22.0976311 12.6834175,22.0976311 12.2928932,21.7071068 C11.9023689,21.3165825 11.9023689,20.6834175 12.2928932,20.2928932 L12.6111505,19.9769552 C12.4086045,19.9922816 12.2047796,19.9999971 11.9999971,19.9999971 C7.7687005,19.9999971 4.28886152,16.7094374 4.01666425,12.5105203 L4.00420123,12.2575143 L4.00014222,12.0168645 C3.9908282,11.4646583 4.43092928,11.0094562 4.98313549,11.0001422 Z M11.7071068,2.29289322 C12.0675907,2.65337718 12.0953203,3.22060824 11.7902954,3.61289944 L11.7071068,3.70710678 L11.3891629,4.0230186 C11.5916051,4.00770767 11.7953244,4 12,4 C16.418278,4 20,7.581722 20,12 C20,12.5522847 19.5522847,13 19,13 C18.4477153,13 18,12.5522847 18,12 C18,8.6862915 15.3137085,6 12,6 C11.8129339,6 11.6271216,6.00853145 11.4429483,6.02544919 L11.7071068,6.29289322 C12.0976311,6.68341751 12.0976311,7.31658249 11.7071068,7.70710678 C11.3466228,8.06759074 10.7793918,8.09532028 10.3871006,7.79029539 L10.2928932,7.70710678 L8.29289322,5.70710678 C7.93240926,5.34662282 7.90467972,4.77939176 8.20970461,4.38710056 L8.29289322,4.29289322 L10.2928932,2.29289322 C10.6834175,1.90236893 11.3165825,1.90236893 11.7071068,2.29289322 Z",fill:"black"}));const T=M.toCanvas({pixelRatio:2,width:20,height:20}),j={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:T,fillPatternScaleX:20/20/2,fillPatternScaleY:20/20/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}},I=U=>{Object.assign(j,U)};e.setTransformerStyle=I;const m={text:{enabledAnchors:["top-left","top-right","middle-left","bottom-left","bottom-right","middle-right"]},svg:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},line:{enabledAnchors:[],borderEnabled:!1,rotateEnabled:!1},image:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},many:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},group:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]}};function A(U,$){m[U]=m[U]||$,Object.assign(m[U],$)}const L=U=>n.default.createElement(s.Rect,Object.assign({},U,{preventDefault:!1})),k=U=>{var{url:$}=U,ee=i(U,["url"]);const[G,Z]=(0,c.default)($,"anonymous"),W=G?(0,O.getCrop)(G,{width:ee.width,height:ee.height},"center-middle"):{};return(0,E.useImageLoader)(Z,$,"page background"),n.default.createElement(s.Image,Object.assign({image:G},ee,W))},R=U=>{const $=(0,g.useColor)({fill:U.fill,a:{width:U.width,height:U.height}});return n.default.createElement(s.Rect,Object.assign({},U,$))},B=U=>{const{background:$,scale:ee,borderColor:G}=U,Z=i(U,["background","scale","borderColor"]),W=n.default.useMemo(()=>!!d.default.Util.colorToRGBA($)||(0,y.isGradient)($),[$]),te=n.default.useMemo(()=>{const re=document.createElement("canvas"),ie=30;re.width=60,re.height=60;const ae=re.getContext("2d");return ae&&(ae.fillStyle="black",ae.fillRect(ie,0,ie,ie),ae.fillRect(0,ie,ie,ie)),re},[]);return n.default.createElement(n.default.Fragment,null,n.default.createElement(s.Rect,Object.assign({fillPatternImage:te},Z,{opacity:.1,hideInExport:!0})),W?n.default.createElement(R,Object.assign({fill:$},Z)):n.default.createElement(k,Object.assign({url:$},Z)))},X=(0,a.observer)(({selection:U})=>U.visible?n.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),Y=(0,a.observer)(({x:U,y:$,width:ee,height:G,rotation:Z,anchor:W,store:te})=>{const re=(0,S.getClientRect)({x:U,y:$,width:ee,height:G,rotation:d.default.Util.radToDeg(Z)});if(W===void 0)return null;const ie=(G/2+70)*Math.cos(Z-Math.PI/2),ae=(G/2+70)*Math.sin(Z-Math.PI/2),se=(0,p.pxToUnitRounded)({unit:te.unit,dpi:te.dpi,px:ee/te.scale,precious:te.unit==="px"?0:1})+" x "+(0,p.pxToUnitRounded)({unit:te.unit,dpi:te.dpi,px:G/te.scale,precious:te.unit==="px"?0:1})+(te.unit==="px"?"":" "+te.unit);return n.default.createElement(n.default.Fragment,null,n.default.createElement(s.Label,{x:(re.minX+re.maxX)/2+ie,y:(re.minY+re.maxY)/2+ae,offsetX:14,offsetY:14,visible:W==="rotater"},n.default.createElement(s.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)"}),n.default.createElement(s.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:Math.round(d.default.Util.radToDeg(Z)).toString()+"°"})),n.default.createElement(s.Label,{x:(re.minX+re.maxX)/2,y:re.maxY+20,visible:W!=="rotater"},n.default.createElement(s.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"up",pointerHeight:0,pointerWidth:0}),n.default.createElement(s.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:se})))}),Q=(0,a.observer)(({elements:U,store:$})=>{const ee=U.filter(Z=>Z.alwaysOnTop),G=U.filter(Z=>!Z.alwaysOnTop).concat(ee);return n.default.createElement(n.default.Fragment,null,G.map(Z=>n.default.createElement(w.default,{key:Z.id,store:$,element:Z,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))}),q=({store:U})=>{const[$,ee]=n.default.useState(!1),[G,Z]=n.default.useState({x:0,y:0});return{open:n.default.useCallback(te=>{ee(!0),Z(te)},[]),close:n.default.useCallback(()=>{ee(!1)},[]),props:{isOpen:$,offset:G,setIsOpen:ee}}};e.useContextMenu=q;let z=null;const N=U=>{z=U};e.registerNextDomDrop=N,e.default=(0,a.observer)(({store:U,page:$,width:ee,height:G,pageControlsEnabled:Z,backColor:W,pageBorderColor:te,activePageBorderColor:re,components:ie,bleedColor:ae,altCloneEnabled:se})=>{const de=U.bleedVisible?$.bleed:0,he=$.computedWidth+2*de,Oe=$.computedHeight+2*de,_e=(ee-he*U.scale)/2,Ae=(G-Oe*U.scale)/2,ce=n.default.useRef(null),pe=n.default.useRef(null),Ce=n.default.useRef(null),Le=Z==null||Z,[ue,ve]=n.default.useState(null),[xe,je]=n.default.useState({}),at=(0,e.useContextMenu)({store:U}),ht=U.selectedElements.find(Fe=>Fe._cropModeEnabled),et=U.selectedShapes.filter(Fe=>!Fe.resizable).length>0,Ke=U.selectedShapes.filter(Fe=>!Fe.draggable).length>0,ze=U.selectedElements.filter(Fe=>!Fe.visible).length>0;n.default.useLayoutEffect(()=>{var Fe,rt,ft;if(!ce.current)return;const De=ce.current.getStage(),Ie=U.selectedShapes.map(Ye=>Ye._cropModeEnabled?null:De.findOne("#"+Ye.id)).filter(Ye=>Ye),Me=U.selectedElements.length===1&&((Fe=U.selectedElements[0])===null||Fe===void 0?void 0:Fe.type)||"many";m[Me]?(ce.current.setAttrs(Object.assign(Object.assign({},j),m[Me])),Me!=="svg"&&Me!=="image"||U.selectedElements[0].keepRatio||ce.current.setAttrs({enabledAnchors:j.enabledAnchors}),Me==="text"&&h.flags.textVerticalResizeEnabled&&ce.current.setAttrs({enabledAnchors:(rt=m.text.enabledAnchors)===null||rt===void 0?void 0:rt.concat(["bottom-center"])})):ce.current.setAttrs(j),et&&ce.current.enabledAnchors([]),Ke&&ce.current.rotateEnabled(!1),Ie.find(Ye=>Ye==null?void 0:Ye.isDragging())&&Ie.forEach(Ye=>{Ye.isDragging()||Ye==null||Ye.startDrag()}),ce.current.nodes(Ie),(ft=ce.current.getLayer())===null||ft===void 0||ft.batchDraw()},[U.selectedElements,ht,et,ze,Ke]);const Be=(0,a.useLocalObservable)(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),Ve=n.default.useRef(!1),bt=(0,P.isTouchDevice)(),Ct=(0,l.action)(Fe=>{var rt,ft;if(bt)return;Ve.current=!1;const De=Fe.target.findAncestor(".elements-container"),Ie=Fe.target.findAncestor("Transformer"),Me=Fe.target.findAncestor(".page-abs-container");if(De||Ie||Me)return;const Ye=(rt=Fe.target.getStage())===null||rt===void 0?void 0:rt.getPointerPosition();Ye&&(Be.visible=!0,Be.x1=Ye.x,Be.y1=Ye.y,Be.x2=Ye.x,Be.y2=Ye.y,((ft=Fe.target.getStage())===null||ft===void 0?void 0:ft.getPointersPositions().length)>=2&&(Be.visible=!1))});n.default.useEffect(()=>{const Fe=(0,l.action)(ft=>{var De,Ie;if(!Be.visible)return;(De=pe.current)===null||De===void 0||De.setPointersPositions(ft);let Me=((Ie=pe.current)===null||Ie===void 0?void 0:Ie.getPointerPosition())||{x:Be.x2,y:Be.y2};Be.x2=Me.x,Be.y2=Me.y}),rt=(0,l.action)(()=>{if(!Be.visible||!pe.current)return;const ft=pe.current.findOne(".selection"),De=ft?ft.getClientRect():{width:0,height:0,x:0,y:0};if(De.width&&De.height){const Ie=[];pe.current.find(".element").forEach(Ye=>{const Mt=Ye.getClientRect(),_t=U.getElementById(Ye.id()),Yt=_t==null?void 0:_t.draggable,wn=_t==null?void 0:_t.selectable;d.default.Util.haveIntersection(De,Mt)&&Yt&&wn&&Ie.push(_t.top.id)});const Me=[...new Set(Ie)];U.selectElements(Me)}Be.visible=!1,Ve.current=!0});return window.addEventListener("mousemove",Fe),window.addEventListener("touchmove",Fe),window.addEventListener("mouseup",rt),window.addEventListener("touchend",rt),()=>{window.removeEventListener("mousemove",Fe),window.removeEventListener("touchmove",Fe),window.removeEventListener("mouseup",rt),window.removeEventListener("touchend",rt)}},[]);const we=n.default.useRef(!1);n.default.useEffect(()=>{var Fe;let rt;const ft=(Fe=Ce.current)===null||Fe===void 0?void 0:Fe.closest(".polotno-workspace-inner"),De=()=>{we.current=!0,clearTimeout(rt),rt=setTimeout(()=>{we.current=!1},300)};return ft.addEventListener("scroll",De),()=>{clearTimeout(rt),ft.removeEventListener("scroll",De)}},[]);const Se=Fe=>{if(U.activePage!==$&&$.select(),we.current||Ve.current)return;const rt=Fe.evt.ctrlKey||Fe.evt.metaKey||Fe.evt.shiftKey,ft=Fe.target.findAncestor(".elements-container"),De=Fe.target.findAncestor(".page-abs-container"),Ie=Fe.target.findAncestor("Transformer");if(!(rt||ft||Ie||De))return void U.selectElements([]);const Me=Fe.target.findAncestor(".element",!0),Ye=U.getElementById(Me==null?void 0:Me.id()),Mt=Ye==null?void 0:Ye.top,_t=Mt==null?void 0:Mt.id,Yt=U.selectedElementsIds.indexOf(_t)>=0;_t&&rt&&!Yt?U.selectElements(U.selectedElementsIds.concat([_t])):_t&&rt&&Yt?U.selectElements(U.selectedElementsIds.filter(wn=>wn!==_t)):!_t||rt||Yt||U.selectElements([_t])};(0,_.useSnap)(ce,U);const gt=U.activePage===$,wt=ie==null?void 0:ie.PageControls,Pt=ie==null?void 0:ie.Tooltip,vt=ie==null?void 0:ie.ContextMenu,Wt=1/U.scale,pn=0/U.scale;return n.default.createElement("div",{ref:Ce,onDragOver:Fe=>Fe.preventDefault(),onDrop:Fe=>{if(Fe.preventDefault(),!pe.current)return;pe.current.setPointersPositions(Fe);const rt=pe.current.findOne(".elements-container").getRelativePointerPosition(),ft=pe.current.getPointerPosition(),De=pe.current.getAllIntersections(ft).map(Ye=>Ye.findAncestor(".element",!0)).filter(Boolean),Ie=[...new Set(De.reverse())].map(Ye=>U.getElementById(Ye.id())),Me=Ie[0];z&&(z(rt,Me,{elements:Ie,page:$}),z=null)},style:{position:"relative",width:ee+"px"},className:"polotno-page-container"+(gt?" active-page":"")},n.default.createElement(s.Stage,{ref:pe,width:Math.min(ee,10*window.innerWidth),height:Math.min(G,10*window.innerHeight),onClick:Se,onTap:Se,onContextMenu:Fe=>{Fe.evt.preventDefault();const rt=Fe.target.findAncestor(".element",!0),ft=U.getElementById(rt==null?void 0:rt.id()),De=ft==null?void 0:ft.top,Ie=De==null?void 0:De.id;Ie?U.selectedElementsIds.indexOf(Ie)>=0||U.selectElements([Ie]):U.selectElements([]),at.open({x:Fe.evt.clientX,y:Fe.evt.clientY})},onMouseDown:Ct,onMouseMove:Fe=>{if(!Fe.evt.altKey&&ue)return void ve(null);if(!Fe.evt.altKey)return;const rt=Fe.target.findAncestor(".element",!0),ft=rt==null?void 0:rt.id();if(!U.selectedElements[0]||U.selectedElementsIds.includes(ft))return;const De=(0,S.getTotalClientRect)(U.selectedShapes),Ie=ft?U.getElementById(ft):{x:0,y:0,width:$.computedWidth,height:$.computedHeight,rotation:0},Me=(0,S.getClientRect)(Ie),Ye=[];De.minX>Me.maxX&&Ye.push({distance:De.minX-Me.maxX,box1:De,box2:Me,points:[{x:De.minX,y:De.minY+De.height/2},{x:Me.maxX,y:De.minY+De.height/2},{x:Me.maxX,y:Me.minY+Me.height/2}]}),De.maxX<Me.minX&&Ye.push({distance:Me.minX-De.maxX,box1:De,box2:Me,points:[{x:De.maxX,y:De.minY+De.height/2},{x:Me.minX,y:De.minY+De.height/2},{x:Me.minX,y:Me.minY+Me.height/2}]}),De.minY>Me.maxY&&Ye.push({box1:De,box2:Me,distance:De.minY-Me.maxY,points:[{x:De.minX+De.width/2,y:De.minY},{x:De.minX+De.width/2,y:Me.maxY},{x:Me.minX+Me.width/2,y:Me.maxY}]}),De.maxY<Me.minY&&Ye.push({box1:De,box2:Me,distance:Me.minY-De.maxY,points:[{x:De.minX+De.width/2,y:De.maxY},{x:De.minX+De.width/2,y:Me.minY},{x:Me.minX+Me.width/2,y:Me.minY}]}),De.minX>=Me.minX&&De.maxX<=Me.maxX&&De.minY>=Me.minY&&De.maxY<=Me.maxY&&(Ye.push({distance:De.minX-Me.minX,box1:De,box2:Me,points:[{x:De.minX,y:De.minY+De.height/2},{x:Me.minX,y:De.minY+De.height/2},{x:Me.minX,y:Me.minY+Me.height/2}]}),Ye.push({distance:Me.maxX-De.maxX,box1:De,box2:Me,points:[{x:De.maxX,y:De.minY+De.height/2},{x:Me.maxX,y:De.minY+De.height/2},{x:Me.maxX,y:Me.minY+Me.height/2}]}),Ye.push({box1:De,box2:Me,distance:De.minY-Me.minY,points:[{x:De.minX+De.width/2,y:De.minY},{x:De.minX+De.width/2,y:Me.minY},{x:Me.minX+Me.width/2,y:Me.minY}]}),Ye.push({box1:De,box2:Me,distance:Me.maxY-De.maxY,points:[{x:De.minX+De.width/2,y:De.maxY},{x:De.minX+De.width/2,y:Me.maxY},{x:Me.minX+Me.width/2,y:Me.maxY}]})),JSON.stringify(ue)!==JSON.stringify(Ye)&&ve(Ye)},onDragStart:Fe=>{var rt;const ft=Fe.target.findAncestor(".element",!0);if(ft){const De=U.getElementById(ft==null?void 0:ft.id()),Ie=De==null?void 0:De.top,Me=Ie==null?void 0:Ie.id;!(U.selectedElementsIds.indexOf(Me)>=0)&&Me&&(U.selectElements([Me]),Fe.target.stopDrag(),Fe.target.startDrag(Fe),(rt=ce.current)===null||rt===void 0||rt.startDrag(Fe))}ue&&ve(null)},pageId:$.id,style:{position:"relative"}},n.default.createElement(s.Layer,null,n.default.createElement(L,{width:ee,height:G,fill:W}),n.default.createElement(s.Group,{x:_e,y:Ae,scaleX:U.scale,scaleY:U.scale,name:"page-container"},n.default.createElement(s.Group,{name:"page-container-2"},n.default.createElement(s.Group,{name:"page-background-group",x:de,y:de},n.default.createElement(B,{x:-$.bleed,y:-$.bleed,width:$.computedWidth+2*$.bleed,height:$.computedHeight+2*$.bleed,background:$.background,name:"page-background",preventDefault:!1,scale:U.scale})),n.default.createElement(s.Group,{x:de,y:de,name:"elements-container",listening:!U.isPlaying},n.default.createElement(s.Rect,{name:"elements-area",width:$.computedWidth,height:$.computedHeight,listening:!1}),n.default.createElement(Q,{elements:$.children,store:U})),n.default.createElement(s.Rect,{stroke:ae,name:"bleed",strokeWidth:$.bleed,x:$.bleed/2,y:$.bleed/2,width:$.computedWidth+$.bleed,height:$.computedHeight+$.bleed,listening:!1,visible:$.bleed>0&&U.bleedVisible,hideInExport:!0}))),n.default.createElement(s.Line,{name:"workspace-background",points:[0,0,ee,0,ee,G,0,G,0,0,_e,Ae,_e,G-Ae,ee-_e,G-Ae,ee-_e,Ae,_e,Ae],listening:!1,closed:!0,fill:W}),n.default.createElement(s.Group,{x:_e,y:Ae,scaleX:U.scale,scaleY:U.scale},n.default.createElement(s.Rect,{name:"page-highlight",hideInExport:!0,x:-Wt/2-pn,y:-Wt/2-pn,width:he+Wt+2*pn,height:Oe+Wt+2*pn,stroke:gt&&U.pages.length>1?re:te,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),n.default.createElement(s.Group,{x:_e+de*U.scale,y:Ae+de*U.scale,scaleX:U.scale,scaleY:U.scale,name:"page-abs-container"},n.default.createElement(s.Transformer,{ref:ce,onDragStart:Fe=>{var rt;!((rt=Fe.evt)===null||rt===void 0)&&rt.altKey&&se&&U.selectedElements.forEach(ft=>{const De=ft.clone({},{skipSelect:!0}),Ie=$.children.indexOf(ft);$.setElementZIndex(De.id,Ie)}),U.history.startTransaction()},onDragEnd:()=>{U.history.endTransaction()},onTransformStart:()=>{U.history.startTransaction()},boundBoxFunc:(Fe,rt)=>{const ft=Math.abs(rt.width)<1||Math.abs(rt.height)<1,De=Math.abs(Fe.width)<1||Math.abs(Fe.height)<1;return ft&&!De?Fe:rt},onTransform:Fe=>{var rt,ft;const De=ce.current.nodes(),Ie=De[De.length-1];if(Fe.target!==Ie)return;const Me=(rt=ce.current)===null||rt===void 0?void 0:rt.__getNodeRect(),Ye=(ft=ce.current)===null||ft===void 0?void 0:ft.getActiveAnchor();je({anchor:Ye,x:Me.x,y:Me.y,rotation:Me.rotation,width:Me.width,height:Me.height})},onTransformEnd:Fe=>{je({}),U.history.endTransaction()},visible:!U.isPlaying}),ue&&ue.map(({points:Fe,distance:rt,box1:ft,box2:De},Ie)=>n.default.createElement(s.Group,{name:"distances-container",hideInExport:!0,key:Ie,listening:!1},n.default.createElement(s.Rect,Object.assign({},ft,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(s.Rect,Object.assign({},De,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),n.default.createElement(s.Line,{points:[Fe[0].x,Fe[0].y,Fe[1].x,Fe[1].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(s.Line,{points:[Fe[1].x,Fe[1].y,Fe[2].x,Fe[2].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),n.default.createElement(s.Label,{x:(Fe[0].x+Fe[1].x)/2,y:(Fe[0].y+Fe[1].y)/2,offsetY:-10,scaleX:1/U.scale,scaleY:1/U.scale},n.default.createElement(s.Tag,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"down"}),n.default.createElement(s.Text,{align:"center",verticalAlign:"middle",fill:"white",padding:5,text:(0,p.pxToUnitString)({unit:U.unit,dpi:U.dpi,px:rt})})))),$._rendering&&n.default.createElement(s.Group,null,n.default.createElement(s.Rect,{width:he,height:Oe,fill:"rgba(255,255,255,0.9)"}),n.default.createElement(s.Text,{text:"Rendering...",fontSize:60,width:he,height:Oe,align:"center",verticalAlign:"middle"})),Pt&&n.default.createElement(Pt,{components:ie,store:U,page:$,stageRef:pe}),vt&&n.default.createElement(b.Html,null,n.default.createElement(vt,Object.assign({components:ie,store:U},at.props)))),n.default.createElement(Y,Object.assign({},xe,{store:U})),n.default.createElement(X,{selection:Be}),(0,v.isCreditVisible)()&&n.default.createElement(s.Text,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:ee-170,y:G-18,onMouseEnter:Fe=>{Fe.target.getStage().container().style.cursor="pointer"},onMouseLeave:Fe=>{Fe.target.getStage().container().style.cursor=""},onTouchStart:Fe=>{Fe.cancelBubble=!0},onMouseDown:Fe=>{Fe.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),n.default.createElement(s.Group,{name:"line-guides"}))),Le&&wt&&n.default.createElement(wt,{store:U,page:$,xPadding:_e,yPadding:Ae}))})}(Is)),Is}var gd={},n3;function Ax(){return n3||(n3=1,function(e){var i=gd&&gd.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.TopRules=void 0,e.LeftRules=v;const t=i(Tn()),n=Hd(),a=Fv(),l=Qi,s=y_(),c=(0,s.styled)("div",t.default.forwardRef)`
257
- position: absolute;
258
- top: 0;
259
- left: 0;
260
- pointer-events: none;
261
- `,d=(0,s.styled)("div",t.default.forwardRef)`
262
- height: 14px;
263
- position: sticky;
264
- font-size: 8px;
265
- line-height: 14px;
266
- top: 0;
267
- left: 0;
268
- color: grey;
269
- border-bottom: 1px solid grey;
270
- background-color: #e8e8e8;
271
- overflow: hidden;
272
- `,w=(0,s.styled)("div",t.default.forwardRef)`
273
- left: 0;
274
- width: 14px;
275
- position: sticky;
276
- font-size: 8px;
277
- line-height: 14px;
278
- color: grey;
279
- border-right: 1px solid grey;
280
- background-color: #e8e8e8;
281
- overflow: hidden;
282
- `,_=(0,s.styled)("div",t.default.forwardRef)`
283
- position: absolute;
284
- border-left: 1px solid grey;
285
- padding-left: 2px;
286
- `,E=(0,s.styled)("div",t.default.forwardRef)`
287
- position: absolute;
288
- left: 14px;
289
- border-left: 1px solid grey;
290
- padding-left: 2px;
291
- transform: rotate(90deg);
292
- transform-origin: left top;
293
- overflow: hidden;
294
- `,O=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4];function v(){return t.default.createElement("div",null,t.default.createElement("h1",null,"Top rules"))}e.TopRules=(0,l.observer)(({store:S,width:p,height:h})=>{const P=t.default.useRef(null);if(!S.activePage)return null;const g=S.activePage,y=(S.bleedVisible&&g.bleed,g.computedWidth*S.scale),b=g.computedHeight*S.scale,x=(p-y)/2,M=(T=L=>(0,a.unitToPx)({unitVal:L,dpi:S.dpi,unit:S.unit})*S.scale,O.find(L=>T(L)>30)||1e4);var T;const j=(0,a.unitToPx)({unitVal:M,dpi:S.dpi,unit:S.unit})*S.scale,I=Math.round(y/j)+1,m=Math.round(b/j)+1,A=(0,n.getTotalClientRect)(S.selectedShapes);return t.default.createElement(c,{ref:P,className:"polotno-rulers"},t.default.createElement(d,{style:{width:p+"px"},className:"polotno-x-ruler"},[...Array(I)].map((L,k)=>t.default.createElement(_,{key:k,style:{left:x+k*j+"px",width:j+"px"}},S.unit==="px"||M>=1?Math.round(M*k):(M*k).toFixed(1))),!!S.selectedShapes.length&&t.default.createElement("div",{style:{position:"absolute",left:x+A.x*S.scale+"px",height:"14px",width:A.width*S.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),S.pages.map((L,k)=>{var R;const B=L.computedHeight*S.scale,X=(h-B)/2;return t.default.createElement(w,{key:L.id,style:{height:h+"px"},className:"polotno-y-ruler"},[...Array(m)].map((Y,Q)=>t.default.createElement(E,{key:Q,style:{top:X+Q*j-14+"px",width:j+"px"}},S.unit==="px"||M>=1?Math.round(M*Q):(M*Q).toFixed(1))),((R=S.selectedShapes[0])===null||R===void 0?void 0:R.page)===L&&t.default.createElement("div",{style:{position:"absolute",top:X+A.y*S.scale-14+"px",width:"14px",height:A.height*S.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))})}(gd)),gd}var vd={},r3;function Tx(){return r3||(r3=1,function(e){var i=vd&&vd.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0}),e.AudioElement=void 0;const t=i(Tn()),n=Qi,a=No;function l(s){const[c,d]=t.default.useState(null),[w,_]=t.default.useState("loading");return t.default.useEffect(()=>{const E=new Audio(s),O=()=>{_("loaded"),d(E)},v=()=>{_("failed"),d(null)};return E.addEventListener("canplay",O),E.addEventListener("error",v),()=>{E.removeEventListener("canplay",O),E.removeEventListener("error",v)}},[s]),[c,w]}e.AudioElement=(0,n.observer)(({audio:s,store:c})=>{const[d,w]=l(s.src);return t.default.useEffect(()=>{d&&c.history.ignore(()=>{s.set({duration:1e3*d.duration})})},[d,s,c.history]),t.default.useEffect(()=>{if(!d)return;const _=()=>{d.currentTime=s.startTime*s.duration/1e3},E=()=>{const v=s.endTime*s.duration/1e3;d.currentTime>=v&&(d.pause(),d.currentTime=s.startTime*s.duration/1e3)};d.addEventListener("ended",_),d.addEventListener("timeupdate",E);const O=(0,a.autorun)(()=>{const v=c.animatedElementsIds;if(v.length&&!v.includes(s.id))return;const S=c.currentTime-s.delay,p=s.duration*(s.endTime-s.startTime),h=S>=0&&S<p;if(!(c.isPlaying&&c.animatedElementsIds.length===0&&h))return void d.pause();d.volume=s.volume,d.paused&&d.play();const P=S%p/1e3+s.startTime*s.duration/1e3,g=d.currentTime;Math.abs(g-P)>.5&&P!==g&&(d.currentTime=P)});return()=>{d.pause(),d.removeEventListener("ended",_),d.removeEventListener("timeupdate",E),O()}},[c.isPlaying,s.startTime,s.endTime,s.volume,d]),null})}(vd)),vd}var sg={},ug={},md={};let Rx="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",__=e=>crypto.getRandomValues(new Uint8Array(e)),w_=(e,i,t)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,a=-~(1.6*n*i/e.length);return(l=i)=>{let s="";for(;;){let c=t(a),d=a;for(;d--;)if(s+=e[c[d]&n]||"",s.length===l)return s}}},Mx=(e,i=21)=>w_(e,i,__),Lx=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((i,t)=>(t&=63,t<36?i+=t.toString(36):t<62?i+=(t-26).toString(36).toUpperCase():t>62?i+="-":i+="_",i),"");const Nx=Object.freeze(Object.defineProperty({__proto__:null,customAlphabet:Mx,customRandom:w_,nanoid:Lx,random:__,urlAlphabet:Rx},Symbol.toStringTag,{value:"Module"})),Gp=Xl(Nx);var cg={},Ai={},fg={},dg={},i3;function S_(){return i3||(i3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.deepEqual=void 0;const i=function(t,n){if(t===n)return!0;if(typeof t=="object"&&t!=null&&typeof n=="object"&&n!=null){if(Object.keys(t).length!=Object.keys(n).length)return!1;for(var a in t)if(!n.hasOwnProperty(a)||!(0,e.deepEqual)(t[a],n[a]))return!1;return!0}return!1};e.deepEqual=i}(dg)),dg}var o3;function Ix(){return o3||(o3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UndoManager=void 0;const i=eo,t=S_();Object.assign(i.types),e.UndoManager=i.types.model("UndoManager",{history:i.types.array(i.types.frozen()),undoIdx:-1,targetPath:""}).views(n=>({get canUndo(){return n.undoIdx>0},get canRedo(){return n.undoIdx<n.history.length-1}})).actions(n=>{let a,l,s=!1,c=null,d=0,w=0;const _=()=>w>0;function E(){const v=(0,i.getSnapshot)(a);return{pages:v.pages,width:v.width,height:v.height,custom:v.custom}}function O(v){const S=a.pages.map(g=>g.id),p=v.pages.map(g=>g.id),h=!(0,t.deepEqual)(S,p),P=!(0,t.deepEqual)(a.custom,v.custom);h?(0,i.applySnapshot)(a.pages,v.pages):a.pages.forEach((g,y)=>{(0,i.applySnapshot)(g,v.pages[y])}),P&&a.set({custom:v.custom}),a.setSize(v.width,v.height)}return{startTransaction(){w++},endTransaction(v){w--,v||this.requestAddState(E())},async ignore(v,S=!1,p=!1){p&&await new Promise(b=>setTimeout(b,10)),d&&n.addUndoState();let h=_();n.startTransaction();let P=w;try{await v()}catch(b){setTimeout(()=>{throw b})}const g=P!==w,y=!g;n.endTransaction(y),S||h||n.replaceState(),g||(clearTimeout(d),d=0)},async transaction(v){await n.ignore(v,!0),this.addUndoState()},requestAddState(v){c=v,d||_()||(s?s=!1:d=setTimeout(()=>{d=0,clearTimeout(d),_()||this.addUndoState()},100))},addUndoState(){if(s)return void(s=!1);const v=n.history[n.undoIdx];!(0,t.deepEqual)(c,v)&&(clearTimeout(d),d=0,n.history.splice(n.undoIdx+1),n.history.push(c),n.undoIdx=n.history.length-1)},afterCreate(){if(a=(0,i.resolvePath)(n,".."),!a)throw new Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment");l=(0,i.onSnapshot)(a,()=>{this.requestAddState(E())}),n.history.length===0&&this.requestAddState(E())},clear(){clearTimeout(d),d=0,n.history.splice(0,n.history.length),n.undoIdx=-1,n.addUndoState(E())},beforeDestroy(){l()},undo(){d&&this.addUndoState(),n.canUndo?(n.undoIdx--,s=!0,O(n.history[n.undoIdx])):console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.")},redo(){d&&this.addUndoState(),n.canRedo?(n.undoIdx++,s=!0,O(n.history[n.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){n.history[n.undoIdx]=E()}}}),e.default=e.UndoManager}(fg)),fg}var hg={},a3;function Dx(){return a3||(a3=1,function(e){async function i(t,n){const a=await(await fetch(t)).blob(),l=document.createElement("a"),s=URL.createObjectURL(a);l.href=s,l.download=n,document.body.appendChild(l),l.click(),setTimeout(function(){document.body.removeChild(l),window.URL.revokeObjectURL(s)},0)}Object.defineProperty(e,"__esModule",{value:!0}),e.downloadFile=i}(hg)),hg}var pg={},l3;function jx(){return l3||(l3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsPDF=n;const i="https://unpkg.com/jspdf@2.2.0/dist/jspdf.umd.min.js";let t;function n(){return t?Promise.resolve(t):new Promise(a=>{var l=document.createElement("script");l.onload=function(){t=window.jspdf.jsPDF,a(t)},l.src=i,document.head.appendChild(l)})}}(pg)),pg}var gg={},s3;function Fx(){return s3||(s3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getGIF=t,e.createGIF=n;const i="https://cdnjs.cloudflare.com/ajax/libs/gif.js/0.2.0/gif.js";function t(){return window.GIF?Promise.resolve(window.GIF):new Promise(a=>{var l=document.createElement("script");l.onload=function(){a(window.GIF)},l.src=i,document.head.appendChild(l)})}async function n({width:a,height:l}){return new(await t())({workers:4,width:a,height:l,workerScript:URL.createObjectURL(new Blob([`// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js
295
- (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]);
296
- `],{type:"application/javascript"}))})}}(gg)),gg}var vg={},u3;function zx(){return u3||(u3=1,function(e){async function i(t){for(let n=0;n<30;n++){const a=await t();if(a)return a;await new Promise(l=>setTimeout(l,50))}}Object.defineProperty(e,"__esModule",{value:!0}),e.waitTillAvailable=i}(vg)),vg}var Oo={},mg={},c3;function _p(){return c3||(c3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getImageSize=t,e.loadImage=n,e.cropImage=a,e.getCrop=l;const i=qd();function t(s){return new Promise(c=>{const d=document.createElement("img");d.onload=async()=>{d.width===0||d.height===0?c(await(0,i.getSvgSize)(s)):c({width:d.width,height:d.height})},d.crossOrigin="anonymous",d.src=s})}function n(s){return new Promise((c,d)=>{const w=document.createElement("img");w.onload=()=>{c(w)},w.onerror=_=>{d(_)},w.crossOrigin="anonymous",w.src=s})}async function a(s,c){const d=await n(s),w=document.createElement("canvas");w.width=2*d.width,w.height=2*d.height,w.getContext("2d").drawImage(d,0,0,w.width,w.height);const _=document.createElement("canvas");_.width=c.width,_.height=c.height;const E=_.getContext("2d");let{cropX:O,cropY:v}=c;const S=w.width*c.cropWidth,p=w.height*c.cropHeight,h=c.width/c.height;let P,g;const y=S/p;return c.type==="svg"?(P=S,g=p):h>=y?(P=S,g=S/h):(P=p*h,g=p),E.drawImage(w,O*w.width,v*w.height,P,g,0,0,_.width,_.height),_.toDataURL("image/png")}function l(s,c){const{width:d,height:w}=s,_=d/w;let E,O;_>=c.width/c.height?(E=c.width,O=c.width/_):(E=c.height*_,O=c.height);const v=(c.width-E)/2,S=(c.height-O)/2;return{cropX:v/c.width,cropY:S/c.height,cropWidth:E/c.width,cropHeight:O/c.height}}}(mg)),mg}var yg={},f3;function E_(){return f3||(f3=1,function(e){var i;function t(n){let a={filter:"",html:void 0};switch(n){case i.warm:return a.filter="sepia(0.5) saturate(1.5) brightness(1.1) contrast(1.1)",a;case i.cold:return a.filter="url(#blue-boost)",a.html=`
297
- <svg style="display: none">
298
- <filter id="blue-boost">
299
- <feColorMatrix
300
- type="matrix"
301
- values="
302
- 0.85 0 0 0 0
303
- 0 0.9 0 0 0
304
- 0 0 1.15 0 0
305
- 0 0 0 1 0"
306
- />
307
- </filter>
308
- </svg>`,a;case"natural":return a.filter="saturate(1.3) brightness(1.1) contrast(1.2)",a;default:return null}}Object.defineProperty(e,"__esModule",{value:!0}),e.Effects=void 0,e.shapeFilterToCSS=t,function(n){n.sepia="sepia",n.grayscale="grayscale",n.natural="natural",n.warm="warm",n.cold="cold"}(i||(e.Effects=i={}))}(yg)),yg}var d3;function Bx(){return d3||(d3=1,function(e){var i=Oo&&Oo.__createBinding||(Object.create?function(m,A,L,k){k===void 0&&(k=L);var R=Object.getOwnPropertyDescriptor(A,L);R&&!("get"in R?!A.__esModule:R.writable||R.configurable)||(R={enumerable:!0,get:function(){return A[L]}}),Object.defineProperty(m,k,R)}:function(m,A,L,k){k===void 0&&(k=L),m[k]=A[L]}),t=Oo&&Oo.__setModuleDefault||(Object.create?function(m,A){Object.defineProperty(m,"default",{enumerable:!0,value:A})}:function(m,A){m.default=A}),n=Oo&&Oo.__importStar||function(){var m=function(A){return m=Object.getOwnPropertyNames||function(L){var k=[];for(var R in L)Object.prototype.hasOwnProperty.call(L,R)&&(k[k.length]=R);return k},m(A)};return function(A){if(A&&A.__esModule)return A;var L={};if(A!=null)for(var k=m(A),R=0;R<k.length;R++)k[R]!=="default"&&i(L,A,k[R]);return t(L,A),L}}(),a=Oo&&Oo.__rest||function(m,A){var L={};for(var k in m)Object.prototype.hasOwnProperty.call(m,k)&&A.indexOf(k)<0&&(L[k]=m[k]);if(m!=null&&typeof Object.getOwnPropertySymbols=="function"){var R=0;for(k=Object.getOwnPropertySymbols(m);R<k.length;R++)A.indexOf(k[R])<0&&Object.prototype.propertyIsEnumerable.call(m,k[R])&&(L[k[R]]=m[k[R]])}return L};Object.defineProperty(e,"__esModule",{value:!0}),e.fixRatio=O,e.jsonToDOM=M,e.jsonToHTML=I;const l=_p(),s=n(qd()),c=_p(),d=Dv(),w=m_(),_=E_(),E=(m,A,...L)=>({type:m,props:A,children:L||[]});function O(m){var A=new DOMParser().parseFromString(m,"image/svg+xml");return A.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(A)}const v=async({element:m,page:A,store:L})=>{let{src:k}=m;if(m.type==="svg"&&Object.keys(m.colorsReplace).length){const ie=await s.urlToString(k);k=s.replaceColors(ie,new Map(Object.entries(m.colorsReplace)))}let R="";m.flipX&&(R+="scaleX(-1)"),m.flipY&&(R+="scaleY(-1)"),R||(R="none");const B={};if(m.clipSrc){const ie=await s.urlToBase64(m.clipSrc);B["clip-path"]=`url(${ie})`}const X=await(0,c.loadImage)(k),Y=X.width*m.cropWidth,Q=X.height*m.cropHeight,q=m.width/m.height;let z,N;const U=Y/Q;m.type==="svg"?(z=Y,N=Q):q>=U?(z=Y,N=Y/q):(z=Q*q,N=Q);const $=z/X.width,ee=N/X.height,G=z/N>m.width/m.height?m.height/N:m.width/z,Z=z*G/$,W=N*G/ee,te=m.cropX*G*X.width,re=m.cropY*G*X.height;return E("div",{style:Object.assign(Object.assign({},B),{width:"100%",height:"100%","border-radius":m.cornerRadius+"px",border:m.borderSize?`${m.borderSize}px solid ${m.borderColor}`:"none",background:`url(${k})`,transform:R,"background-size":`${Math.round(Z)}px ${Math.round(W)}px`,"background-position-x":-Math.round(te)+"px","background-position-y":-Math.round(re)+"px"})})},S=async({element:m,page:A,store:L})=>{let k={top:0,left:0};m.fill.indexOf("gradient")>=0&&(k=Object.assign(Object.assign({},k),{"background-color":m.fill,"background-image":m.fill,"background-clip":"text","text-fill-color":"transparent","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"}));const R=m.backgroundPadding*(m.fontSize*m.lineHeight),B=E("div",{style:{position:"absolute",top:-R/2+"px",left:-R/2+"px",display:m.backgroundEnabled?"block":"none",width:m.width+R+"px",height:m.height+R+"px","background-color":m.backgroundColor,"border-radius":m.backgroundCornerRadius*(m.fontSize*m.lineHeight*.5)+"px"}});m.verticalAlign==="middle"?(k.top="50%",k.transform="translateY(-50%)"):m.verticalAlign==="bottom"&&(k.bottom=0);const X=/<[a-z][\s\S]*>/i.test(m.text),Y=Object.assign(Object.assign({},k),{position:"absolute",width:m.width+"px",color:m.fill,"white-space":"pre-wrap","font-size":m.fontSize+"px","text-align":m.align,"font-family":m.fontFamily,"text-decoration":m.textDecoration||"none","line-height":m.lineHeight,"letter-spacing":m.letterSpacing+"em","font-style":m.fontStyle,"font-weight":m.fontWeight,"-webkit-text-stroke":`${m.strokeWidth}px ${m.stroke}`,"text-stroke":`${m.strokeWidth}px ${m.stroke}`}),Q="el-"+m.id,q=X?{id:Q}:{},z=`<style>#${Q} {${w.resetStyleContent}}</style>`,N=E("div",Object.assign(Object.assign({style:Y},q),{innerHTML:X?`${z}${m.text}`:m.text.split(`
309
- `).join("<br />")}));return E("div",{style:{position:"relative",width:"100%",height:"100%"}},B,N)},p=({element:m,type:A})=>{const L={"stroke-width":m.height,stroke:m.color,"line-cap":"round","stroke-linejoin":"round",opacity:m.opacity};return A==="arrow"||A==="triangle"?E("polyline",Object.assign({points:`${3*m.height},${2*-m.height} 0,0 ${3*m.height},${2*m.height}`},L)):A==="bar"?E("polyline",Object.assign({points:`0,${2*-m.height} 0,${2*m.height}`},L)):A==="circle"?E("circle",Object.assign({r:m.height},L)):A==="square"?E("polyline",Object.assign({points:`${-m.height},${-m.height} ${-m.height},${m.height} ${m.height},${m.height} ${m.height},${-m.height}`},L)):null},h=async({element:m,page:A,store:L})=>E("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},E("rect",{x:0,y:0,width:m.width,height:m.height,fill:m.color}),E("g",{transform:`translate(0 ${m.height/2})`},p({element:m,type:m.startHead})),E("g",{transform:`translate(${m.width} ${m.height/2}) rotate(180)`},p({element:m,type:m.endHead}))),P=async({element:m,page:A,store:L,elementHook:k})=>{const R=await Promise.all(m.children.map(X=>b({element:X,page:A,store:L,elementHook:k}))),B=E("div",{style:{"transform-origin":"top left",opacity:m.opacity}},...R);return k&&k({dom:B,element:m})||B},g=async({element:m,page:A,store:L,elementHook:k})=>{const R=(0,d.figureToSvg)(m),B=E("div",{innerHTML:R});return k&&k({dom:B,element:m})||B},y={image:v,svg:v,text:S,line:h,figure:g,group:P};async function b({element:m,page:A,store:L,elementHook:k}){let R=await y[m.type];R||(R=()=>E("div",{}),console.error(`HTML export does not support ${m.type} type...`));const B=await R({element:m,page:A,store:L}),X=[],Y=[];if(m.blurEnabled&&X.push(`blur(${m.blurRadius/2}px)`),m.brightnessEnabled&&X.push(`brightness(${100*m.brightness+100}%)`),m.sepiaEnabled&&X.push("sepia()"),m.grayscaleEnabled&&X.push("grayscale()"),m.filters)for(const q of Object.keys(m.filters)){const z=(0,_.shapeFilterToCSS)(_.Effects[q]);z&&(X.push(z.filter),z.html&&Y.push(z.html))}m.shadowEnabled&&X.push(`drop-shadow(${m.shadowOffsetX}px ${m.shadowOffsetY}px ${m.shadowBlur}px ${m.shadowColor})`);const Q=E("div",{id:m.id,style:{position:"absolute",left:m.x+"px",top:m.y+"px",width:m.width+"px",height:m.height+"px",transform:`rotate(${m.rotation}deg)`,"transform-origin":"top left",opacity:m.opacity,display:m.visible&&m.showInExport?"block":"none",filter:X.join(" ")||"none"}},B,...Y);return k&&k({dom:Q,element:m})||Q}async function x({page:m,store:A,elementHook:L}){const k=await Promise.all(m.children.map(Y=>b({element:Y,page:m,store:A,elementHook:L}))),R=m.width==="auto"?A.width:m.width,B=m.height==="auto"?A.height:m.height;let X={};if(m.background.indexOf("url")>=0||m.background.indexOf("http")>=0||m.background.indexOf(".jpg")>=0||m.background.indexOf(".png")>=0||m.background.indexOf(".jpeg")>=0){const{width:Y,height:Q}=await(0,c.loadImage)(m.background),q=await v({element:Object.assign({x:0,y:0,width:Y,height:Q,src:m.background,cornerRadius:0},(0,l.getCrop)({width:Y,height:Q},{width:Y,height:Q})),page:m,store:A});k.unshift(q)}else X=Object.assign(Object.assign({},X),{"background-color":m.background});return E("div",{className:"page",id:m.id,style:Object.assign(Object.assign({},X),{width:R+"px",height:B+"px",border:"1px solid grey",overflow:"hidden",position:"relative"})},...k)}async function M({json:m,elementHook:A}){const L=await Promise.all(m.pages.map(B=>x({page:B,store:m,elementHook:A}))),k=[];m.pages.forEach(B=>{B.children.forEach(X=>{X.type==="text"&&k.indexOf(X.fontFamily)===-1&&k.push(X.fontFamily)})});const R=k.map(B=>m.fonts.find(X=>X.fontFamily===B)?E("style",{},""):E("link",{href:`https://fonts.googleapis.com/css?family=${B}`,rel:"stylesheet"}));return E("div",{className:"design"},...R,...L)}const T=(m,A)=>typeof A=="object"?`${m}="${Object.keys(A).map(L=>`${L}:${A[L]};`).join(" ")}"`:`${m}="${A}"`,j=({dom:m})=>{if(typeof m=="string")return m;if(!m)return"";const A=m.props,{innerHTML:L}=A,k=a(A,["innerHTML"]);return`<${m.type} ${Object.keys(k).map(R=>T(R,m.props[R])).join(" ")}>${L||m.children.map(R=>j({dom:R})).join("")}</${m.type}>`};async function I({json:m,elementHook:A}){const L=await M({json:m,elementHook:A});return j({dom:L})}}(Oo)),Oo}var xo={},h3;function Ux(){return h3||(h3=1,function(e){var i=xo&&xo.__createBinding||(Object.create?function(R,B,X,Y){Y===void 0&&(Y=X);var Q=Object.getOwnPropertyDescriptor(B,X);Q&&!("get"in Q?!B.__esModule:Q.writable||Q.configurable)||(Q={enumerable:!0,get:function(){return B[X]}}),Object.defineProperty(R,Y,Q)}:function(R,B,X,Y){Y===void 0&&(Y=X),R[Y]=B[X]}),t=xo&&xo.__setModuleDefault||(Object.create?function(R,B){Object.defineProperty(R,"default",{enumerable:!0,value:B})}:function(R,B){R.default=B}),n=xo&&xo.__importStar||function(){var R=function(B){return R=Object.getOwnPropertyNames||function(X){var Y=[];for(var Q in X)Object.prototype.hasOwnProperty.call(X,Q)&&(Y[Y.length]=Q);return Y},R(B)};return function(B){if(B&&B.__esModule)return B;var X={};if(B!=null)for(var Y=R(B),Q=0;Q<Y.length;Q++)Y[Q]!=="default"&&i(X,B,Y[Q]);return t(X,B),X}}(),a=xo&&xo.__rest||function(R,B){var X={};for(var Y in R)Object.prototype.hasOwnProperty.call(R,Y)&&B.indexOf(Y)<0&&(X[Y]=R[Y]);if(R!=null&&typeof Object.getOwnPropertySymbols=="function"){var Q=0;for(Y=Object.getOwnPropertySymbols(R);Q<Y.length;Q++)B.indexOf(Y[Q])<0&&Object.prototype.propertyIsEnumerable.call(R,Y[Q])&&(X[Y[Q]]=R[Y[Q]])}return X};Object.defineProperty(e,"__esModule",{value:!0}),e.forEveryChild=void 0,e.fixRatio=O,e.jsonToDOM=m,e.jsonToSVG=k;const l=_p(),s=n(qd()),c=_p(),d=Dv(),w=E_(),_=(R,B)=>{if(R.children)for(const X of R.children){if(B(X)===!0)break;(0,e.forEveryChild)(X,B)}};e.forEveryChild=_;const E=(R,B,...X)=>({type:R,props:B,children:X||[]});function O(R){var B=new DOMParser().parseFromString(R,"image/svg+xml");return B.documentElement.setAttribute("preserveAspectRatio","none"),new XMLSerializer().serializeToString(B)}const v=async R=>{try{const B=await fetch(R);if(typeof Buffer<"u"){const X=await B.arrayBuffer(),Y=Buffer.from(X).toString("base64");return`data:${B.headers.get("content-type")||"image/png"};base64,${Y}`}{const X=await B.blob();return new Promise((Y,Q)=>{const q=new FileReader;q.onloadend=()=>Y(q.result),q.onerror=Q,q.readAsDataURL(X)})}}catch(B){return console.error("Error converting URL to data URL:",B),R}},S=async({element:R,page:B,store:X})=>{let{src:Y}=R;if(R.type==="svg"){const Oe=await s.urlToString(Y);Y=s.replaceColors(Oe,new Map(Object.entries(R.colorsReplace)))}else Y=await v(Y);let Q="";R.flipX&&(Q+="scaleX(-1)"),R.flipY&&(Q+="scaleY(-1)"),R.clipSrc&&await s.urlToBase64(R.clipSrc);const q=await(0,c.loadImage)(Y),z=q.width*R.cropWidth,N=q.height*R.cropHeight,U=R.width/R.height;let $,ee;const G=z/N;R.type==="svg"?($=z,ee=N):U>=G?($=z,ee=z/U):($=N*U,ee=N);const Z=$/q.width,W=ee/q.height,te=$/ee>R.width/R.height?R.height/ee:R.width/$,re=$*te/Z,ie=ee*te/W,ae=R.cropX*q.width*te,se=R.cropY*q.height*te,de=`clip-${R.id}`,he=Y.replace(/&/g,"&amp;");return E("g",{style:{transform:Q}},E("defs",{},E("clipPath",{id:de},E("rect",{x:0,y:0,width:R.width,height:R.height}))),E("image",{href:he,x:-ae,y:-se,width:re,height:ie,preserveAspectRatio:"none","clip-path":`url(#${de})`}))},p=async({element:R,page:B,store:X})=>{const Y=(U,$,ee,G,Z)=>{const W=document.createElement("canvas").getContext("2d");return W.font=`${Z} ${G} ${$}px ${ee}`,W.measureText(U).width},Q=((U,$,ee,G,Z,W)=>{const te=[];return U.split(`
310
- `).forEach(re=>{const ie=re.split(" ");let ae="";for(let se=0;se<ie.length;se++){const de=ae+ie[se]+" ";Y(de,ee,G,Z,W)>$+.5&&se>0?(te.push(ae.trim()),ae=ie[se]+" "):ae=de}te.push(ae.trim())}),te})(R.text,R.width,R.fontSize,R.fontFamily,R.fontWeight,R.fontStyle),q=R.fontSize*R.lineHeight,z=R.align==="center"?"middle":R.align==="right"?"end":"start",N=Q.map((U,$)=>E("tspan",{x:R.align==="center"?R.width/2:R.align==="right"?R.width:0,dy:$===0?0:q,innerHTML:U}));return E("g",{},E("text",{fill:R.fill,y:R.fontSize,"font-size":R.fontSize+"px","text-anchor":z,"font-family":R.fontFamily,"font-style":R.fontStyle,"font-weight":R.fontWeight,"text-decoration":R.textDecoration,"line-height":R.lineHeight,"letter-spacing":R.letterSpacing+"em","stroke-width":R.strokeWidth,stroke:R.stroke},...N))},h=({element:R,type:B})=>{const X={"stroke-width":R.height,stroke:R.color,"line-cap":"round","stroke-linejoin":"round",opacity:R.opacity};return B==="arrow"||B==="triangle"?E("polyline",Object.assign({points:`${3*R.height},${2*-R.height} 0,0 ${3*R.height},${2*R.height}`},X)):B==="bar"?E("polyline",Object.assign({points:`0,${2*-R.height} 0,${2*R.height}`},X)):B==="circle"?E("circle",Object.assign({r:R.height},X)):B==="square"?E("polyline",Object.assign({points:`${-R.height},${-R.height} ${-R.height},${R.height} ${R.height},${R.height} ${R.height},${-R.height}`},X)):null},P=async({element:R,page:B,store:X})=>E("g",{},E("line",{x1:0,y1:R.height/2,x2:R.width,y2:R.height/2,stroke:R.color,"stroke-width":R.height}),E("g",{transform:`translate(0 ${R.height/2})`},h({element:R,type:R.startHead})),E("g",{transform:`translate(${R.width} ${R.height/2}) rotate(180)`},h({element:R,type:R.endHead}))),g=async({element:R,page:B,store:X,elementHook:Y})=>{const Q=await Promise.all(R.children.map(z=>M({element:z,page:B,store:X,elementHook:Y}))),q=E("g",{opacity:R.opacity,style:{"transform-origin":"top left"}},...Q);return Y&&Y({dom:q,element:R})||q};function y(R){let B=R.replace(/<svg[^>]*>/,"");return B=B.replace(/<\/svg>/,""),B}const b=async({element:R,page:B,store:X,elementHook:Y})=>{const Q=y((0,d.figureToSvg)(R)),q=E("g",{innerHTML:Q});return Y&&Y({dom:q,element:R})||q},x={image:S,svg:S,text:p,line:P,figure:b,group:g};async function M({element:R,page:B,store:X,elementHook:Y}){let Q=await x[R.type];Q||(Q=()=>E("g",{}),console.error(`SVG export does not support ${R.type} type...`));const q=await Q({element:R,page:B,store:X}),z=[],N=[];if(R.blurEnabled&&z.push(`blur(${R.blurRadius/2}px)`),R.brightnessEnabled&&z.push(`brightness(${100*R.brightness+100}%)`),R.sepiaEnabled&&z.push("sepia()"),R.grayscaleEnabled&&z.push("grayscale()"),R.shadowEnabled&&z.push(`drop-shadow(${R.shadowOffsetX}px ${R.shadowOffsetY}px ${R.shadowBlur}px ${R.shadowColor})`),R.filters)for(const $ of Object.keys(R.filters)){const ee=(0,w.shapeFilterToCSS)(w.Effects[$]);if(ee&&(z.push(ee.filter),ee.html)){const G=ee.html.replace(/<svg([^>]*)>/,"<g$1>").replace(/<\/svg>/,"</g>");N.push(G)}}const U=E("g",{className:"element",id:R.id,transform:R.type!=="group"?`translate(${R.x}, ${R.y}) rotate(${R.rotation})`:void 0,display:R.visible?void 0:"none",style:{"transform-origin":"top left",filter:z.join(" ")}},q,...N);return Y&&Y({dom:U,element:R})||U}async function T({page:R,store:B,elementHook:X}){const Y=await Promise.all(R.children.map(z=>M({element:z,page:R,store:B,elementHook:X}))),Q=R.background.indexOf("url")>=0||R.background.indexOf("http")>=0||R.background.indexOf(".jpg")>=0||R.background.indexOf(".png")>=0||R.background.indexOf(".jpeg")>=0;let q;if(Q){const z=await(0,c.loadImage)(R.background);q=await(0,c.cropImage)(R.background,Object.assign({width:B.width,height:B.height,x:0,y:0},(0,l.getCrop)({width:B.width,height:B.height},{width:z.width,height:z.height})))}return E("g",{className:"page",style:{}},Q?E("image",{"xlink:href":q,x:0,y:0,width:B.width,height:B.height,preserveAspectRatio:"none"}):E("rect",{x:0,y:0,width:B.width,height:B.height,fill:Q?void 0:R.background}),...Y)}async function j(R){try{const B=await fetch(R),X=await B.blob();return new Promise((Y,Q)=>{const q=new FileReader;q.onloadend=()=>Y(q.result),q.onerror=Q,q.readAsDataURL(X)})}catch(B){return console.error("Error embedding font:",B),R}}async function I(R,B){return await Promise.all(R.map(async X=>{var Y,Q;const q=B.find(z=>z.fontFamily===X);if(q){const z=await j(q.url);return E("style",{},`@font-face { font-family: ${X}; src: url(${z}); }`)}{const z=`https://fonts.googleapis.com/css?family=${X}:bi,normal,i,b`;try{const N=await fetch(z),U=await N.text(),$=(Q=(Y=U.match(/url\((.*?)\)/g))===null||Y===void 0?void 0:Y.map(G=>G.replace(/url\((.*?)\)/,"$1")))===null||Q===void 0?void 0:Q.filter(G=>G.startsWith("https"));if(!($!=null&&$.length))throw new Error("No font URLs found");const ee=await Promise.all($.map(async G=>{const Z=await j(G),W=U.match(/font-style:\s*(.*?);/),te=U.match(/font-weight:\s*(.*?);/),re=W?W[1]:"normal",ie=te?te[1]:"normal";return`@font-face {
311
- font-family: ${X};
312
- font-style: ${re};
313
- font-weight: ${ie};
314
- src: url(${Z});
315
- }`}));return E("style",{},ee.join(`
316
- `))}catch(N){return console.error("Error embedding Google Font:",N),E("defs",{},E("style",{type:"text/css",innerHTML:`@import url('${z}');`.replace(/&/g,"&amp;")}))}}}))}async function m({json:R,elementHook:B}){const X=await Promise.all(R.pages.map(q=>T({page:q,store:R,elementHook:B}))),Y=[];(0,e.forEveryChild)({children:R.pages},q=>{q.type==="text"&&Y.indexOf(q.fontFamily)===-1&&Y.push(q.fontFamily)});const Q=await I(Y,R.fonts);return E("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:`0 0 ${R.width} ${R.height}`,width:R.width,height:R.height},...Q,...X)}const A=(R,B)=>typeof B=="object"?`${R}="${Object.keys(B).map(X=>`${X}:${B[X]};`).join(" ")}"`:B==null||B===""?"":`${R}="${B}"`,L=({dom:R,nestLevel:B=0})=>{if(typeof R=="string")return R;if(!R)return"";const X=R.props,{innerHTML:Y}=X,Q=a(X,["innerHTML"]),q=" ".repeat(B);return`${q}<${R.type} ${Object.keys(Q).map(z=>A(z,Q[z])).join(" ")}>${Y||`
317
- `+R.children.map(z=>L({dom:z,nestLevel:B+1})).join("")}${q}</${R.type}>
318
- `};async function k({json:R,elementHook:B}){const X=await m({json:R,elementHook:B});return L({dom:X})}}(xo)),xo}var bg={},p3;function O_(){return p3||(p3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Page=void 0;const i=eo,t=Gp,n=Td(),a=zv(),l=Td(),s=Hd();e.Page=i.types.model("Page",{id:i.types.identifier,children:i.types.array(i.types.late(()=>n.ElementTypes)),width:i.types.optional(i.types.union(i.types.number,i.types.literal("auto")),"auto"),height:i.types.optional(i.types.union(i.types.number,i.types.literal("auto")),"auto"),background:"white",bleed:0,custom:i.types.frozen(),duration:5e3,_exporting:!1,_rendering:!1,_forceMount:!1}).postProcessSnapshot(c=>{const d=Object.assign({},c),w={};for(var _ in d)_[0]!=="_"&&(w[_]=c[_]);return w}).views(c=>({get store(){return(0,i.getParentOfType)(c,a.Store)}})).views(c=>({get startTime(){let d=0;for(const w of c.store.pages){if(w.id===c.id)return d;d+=w.duration}return d},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,i.getSnapshot)(c))),_forEachElementUp(d,w){const _=d.map(E=>({id:E,index:c.children.findIndex(O=>O.id===E)}));_.sort((E,O)=>O.index-E.index);for(const{index:E}of _){if(E==-1)continue;const O=E<c.children.length-1&&c.children[E+1],v=d.indexOf(O==null?void 0:O.id)>=0;E===c.children.length-1||v||w(E)}},_forEachElementDown(d,w){const _=d.map(E=>({id:E,index:c.children.findIndex(O=>O.id===E)}));_.sort((E,O)=>E.index-O.index);for(const{index:E}of _){if(E==-1)continue;const O=E>0&&c.children[E-1],v=d.indexOf(O==null?void 0:O.id)>=0;E===0||v||w(E)}return!1}})).actions(c=>({clone(d={}){const w=c.toJSON();w.children.forEach(v=>{v.id=(0,t.nanoid)(10),(0,l.forEveryChild)(v,S=>{S.id=(0,t.nanoid)(10)})});const _=Object.assign(Object.assign(Object.assign({},w),{id:(0,t.nanoid)(10)}),d),E=c.store.addPage(_),O=c.store.pages.indexOf(c);E.setZIndex(O+1),E.select()},setZIndex(d){c.store.setPageZIndex(c.id,d)},set(d){Object.assign(c,d)},select(){c.store.selectPage(c.id)},addElement(d,{skipSelect:w=!1}={}){const _=l.TYPES_MAP[d.type];if(!_)return void console.error("Can not find model with type "+d.type);"children"in d&&Array.isArray(d.children)&&d.children.forEach(O=>{O.id=(0,t.nanoid)(10)});const E=_.create(Object.assign({id:(0,t.nanoid)(10)},d));return c.children.push(E),E.selectable&&!w&&c.store.selectElements([E.id]),E},canMoveElementsUp(d){let w=!1;return c._forEachElementUp(d,()=>{w=w||!0}),w},moveElementsUp(d){c._forEachElementUp(d,w=>{const _=c.children[w];(0,i.detach)(_),c.children.splice(w+1,0,_)})},canMoveElementsTop(d){return this.canMoveElementsUp(d)},moveElementsTop(d){const w=[],_=[];c.children.forEach(E=>{d.indexOf(E.id)>=0?w.push(E):_.push(E)}),c.children.replace(_.concat(w))},canMoveElementsDown(d){let w=!1;return c._forEachElementDown(d,()=>{w=w||!0}),w},moveElementsDown(d){c._forEachElementDown(d,w=>{const _=c.children[w];(0,i.detach)(_),c.children.splice(w-1,0,_)})},canMoveElementsBottom(d){return this.canMoveElementsDown(d)},moveElementsBottom(d){const w=[],_=[];c.children.forEach(E=>{d.indexOf(E.id)>=0?w.push(E):_.push(E)}),c.children.replace(w.concat(_))},setElementZIndex(d,w){const _=c.children.find(E=>E.id===d);_&&((0,i.detach)(_),c.children.remove(_),c.children.splice(w,0,_))},setSize({width:d,height:w,useMagic:_,softChange:E}){if(_){const O=[],v=k=>k.type==="image"&&k.x<1&&k.y<1&&k.width>=c.computedWidth-2&&k.height>=c.computedHeight-2;(0,l.forEveryChild)(c,k=>{k.type!=="group"&&(v(k)||O.push(k))});const S=O.length?(0,s.getTotalClientRect)(O):{x:0,y:0,width:c.computedWidth,height:c.computedHeight},p=1/4,h=Math.max(0,Math.min(S.x,c.computedWidth-S.x-S.width)),P=c.computedWidth*p,g=Math.max(0,h-P),y=Math.max(0,Math.min(S.y,c.computedHeight-S.y-S.height)),b=c.computedHeight*p,x=Math.max(0,y-b),M=c.computedWidth-2*g,T=c.computedHeight-2*x,j=d/M,I=w/T,m=Math.min(j,I),A=(d-M*m)/2-g*m,L=(w-T*m)/2-x*m;(0,l.forEveryChild)(c,k=>{k.type!=="group"&&(v(k)?k.set({x:k.x*m,y:k.y*m,width:k.width*j,height:k.height*I,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(k.set({x:A+k.x*m,y:L+k.y*m,width:k.width*m,height:k.height*m}),k.type==="text"?k.set({fontSize:k.fontSize*m}):k.type==="figure"&&k.set({strokeWidth:k.strokeWidth*m})))})}E||(c.width=d),E||(c.height=w)}})).actions(c=>({moveElementUp(d){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),c.moveElementsUp([d])},moveElementDown(d){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),c.moveElementsDown([d])},moveElementTop(d){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),c.moveElementsTop([d])},moveElementBottom(d){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),c.moveElementsBottom([d])},play(){c.store.play({startTime:c.startTime,endTime:c.startTime+c.duration})}}))}(bg)),bg}var _g={},g3;function qx(){return g3||(g3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Audio=void 0;const i=eo;e.Audio=i.types.model("Audio",{id:i.types.identifier,src:"",duration:0,startTime:0,endTime:1,volume:1,delay:0}).actions(t=>({toJSON:()=>Object.assign({},(0,i.getSnapshot)(t))})).actions(t=>({set(n){Object.assign(t,n)}}))}(_g)),_g}var v3;function zv(){return v3||(v3=1,function(e){var i=Ai&&Ai.__createBinding||(Object.create?function(I,m,A,L){L===void 0&&(L=A);var k=Object.getOwnPropertyDescriptor(m,A);k&&!("get"in k?!m.__esModule:k.writable||k.configurable)||(k={enumerable:!0,get:function(){return m[A]}}),Object.defineProperty(I,L,k)}:function(I,m,A,L){L===void 0&&(L=A),I[L]=m[A]}),t=Ai&&Ai.__setModuleDefault||(Object.create?function(I,m){Object.defineProperty(I,"default",{enumerable:!0,value:m})}:function(I,m){I.default=m}),n=Ai&&Ai.__importStar||function(){var I=function(m){return I=Object.getOwnPropertyNames||function(A){var L=[];for(var k in A)Object.prototype.hasOwnProperty.call(A,k)&&(L[L.length]=k);return L},I(m)};return function(m){if(m&&m.__esModule)return m;var A={};if(m!=null)for(var L=I(m),k=0;k<L.length;k++)L[k]!=="default"&&i(A,m,L[k]);return t(A,m),A}}(),a=Ai&&Ai.__rest||function(I,m){var A={};for(var L in I)Object.prototype.hasOwnProperty.call(I,L)&&m.indexOf(L)<0&&(A[L]=I[L]);if(I!=null&&typeof Object.getOwnPropertySymbols=="function"){var k=0;for(L=Object.getOwnPropertySymbols(I);k<L.length;k++)m.indexOf(L[k])<0&&Object.prototype.propertyIsEnumerable.call(I,L[k])&&(A[L[k]]=I[L[k]])}return A},l=Ai&&Ai.__importDefault||function(I){return I&&I.__esModule?I:{default:I}};Object.defineProperty(e,"__esModule",{value:!0}),e.Store=e.Font=void 0,e.createStore=j;const s=eo,c=Ix(),d=Gp,w=l(Ji()),_=Dx(),E=jx(),O=Fx(),v=jv(),S=n(Bd()),p=Ks(),h=Fv(),P=S_(),g=zx(),y=Bx(),b=Ux(),x=O_(),M=Td(),T=qx();function j({key:I,showCredit:m}={key:"",showCredit:!1}){return e.Store.create({_forceShowCredit:m,_key:I})}(0,s.setLivelinessChecking)("ignore"),e.Font=s.types.model("Font",{fontFamily:s.types.string,url:s.types.optional(s.types.string,""),styles:s.types.frozen()}).preProcessSnapshot(I=>Object.assign(Object.assign({},I),{fontFamily:I.fontFamily||I.name})),e.Store=s.types.model("Store",{role:"",pages:s.types.array(x.Page),fonts:s.types.array(e.Font),audios:s.types.array(T.Audio),width:1080,height:1080,currentTime:0,isPlaying:!1,scale:1,scaleToFit:1,unit:"px",dpi:72,bleedVisible:!1,rulesVisible:!1,openedSidePanel:"",previousOpenedSidePanel:"",custom:s.types.frozen(),selectedElementsIds:s.types.array(s.types.string),animatedElementsIds:s.types.array(s.types.string),history:s.types.optional(c.UndoManager,{targetPath:"../pages"}),_elementsPixelRatio:Math.min(2,window.devicePixelRatio||1),_activePageId:"",_forceShowCredit:!1,_key:"",_validated:!1}).views(I=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),I.bleedVisible},get selectedElements(){return I.selectedElementsIds.map(m=>{for(const A of I.pages)for(const L of A.children)if(L.id===m)return L}).filter(m=>!!m)},get children(){return I.pages},get selectedShapes(){const m=[];return(0,M.forEveryChild)({children:I.selectedElements},A=>{A.type!=="group"&&m.push(A)}),m},get activePage(){return I.pages.slice().find(m=>m.id===I._activePageId)||(I.pages.length?I.pages[0]:null)},get duration(){let m=0;return I.pages.forEach(A=>{m+=A.duration}),m},get _hasCroppedImages(){return I.find(m=>m.type==="image"&&m._cropModeEnabled)},find(m){let A;return(0,M.forEveryChild)({children:I.pages},L=>{if(!A&&m(L))return A=L,!0}),A},getElementById:m=>I.find(A=>A.id===m)})).actions(I=>{let m=0,A=null,L=!1;return{afterCreate(){I.history.canUndo},setCurrentTime(k){I.currentTime=k},_togglePlaying(k=!I.isPlaying){I.isPlaying=k},play({animatedElementsIds:k=[],startTime:R=0,currentTime:B=0,endTime:X=I.duration,repeat:Y=!1}={}){B&&(console.warn("currentTime property of store.play() is deprecated. Please use startTime instead."),R=B),I.animatedElementsIds=(0,s.cast)(k),I.currentTime=R,I.isPlaying=!0,m=Date.now(),A=X,L=Y,requestAnimationFrame(I.seek)},checkActivePage(){let k=0;for(const R of I.pages){if(I.currentTime>=R.startTime&&I.currentTime<R.startTime+R.duration){I.selectPage(R.id);break}k+=R.duration}},seek(){if(!I.isPlaying)return;const k=Date.now(),R=k-m;m=k,I.currentTime+=R,I.checkActivePage();const B=A||I.duration;I.isPlaying&&I.currentTime<B?requestAnimationFrame(I.seek):I.isPlaying&&L?(I.currentTime=0,requestAnimationFrame(I.seek)):I.stop()},stop(){I.isPlaying=!1,I.currentTime=0,I.animatedElementsIds=(0,s.cast)([]),I.checkActivePage()}}}).actions(I=>({__(){I._validated||((0,v.validateKey)(I._key,I._forceShowCredit),I._validated=!0)},set(m){Object.assign(I,m)},setUnit({unit:m,dpi:A}){I.unit=m||I.unit,I.dpi=A||I.dpi},setRole(m){I.role=m},addPage(m){const A=x.Page.create(Object.assign({id:(0,d.nanoid)(10)},m));return I.pages.push(A),I._activePageId=A.id,A},selectPage(m){I._activePageId=m},selectElements(m){const A=m.map(L=>I.getElementById(L)).sort((L,k)=>L.page.children.indexOf(L)-L.page.children.indexOf(k)).filter(L=>!!L).map(L=>L.id);I.selectedElementsIds=(0,s.cast)(A)},toggleBleed(m){I.bleedVisible=m??!I.bleedVisible},toggleRulers(m){I.rulesVisible=m??!I.rulesVisible},openSidePanel(m){I.openedSidePanel!==m&&(I.previousOpenedSidePanel=I.openedSidePanel,I.openedSidePanel=m)},setScale(m){I.scale=m},_setScaleToFit(m){I.scaleToFit=m},setElementsPixelRatio(m){I._elementsPixelRatio=m},setSize(m,A,L){I.pages.forEach(k=>{k.setSize({width:m,height:A,useMagic:L,softChange:!0})}),I.width=m,I.height=A},setPageZIndex(m,A){const L=I.pages.find(k=>k.id===m);L&&((0,s.detach)(L),I.pages.remove(L),I.pages.splice(A,0,L))},deletePages(m){const A=I.pages.indexOf(I.activePage);m.forEach(R=>{const B=I.pages.find(X=>X.id===R);(0,s.destroy)(B)});const L=Math.min(I.pages.length-1,A),k=I.pages[L];k&&(I._activePageId=k.id),I.selectedElementsIds=(0,s.cast)(I.selectedElementsIds.filter(R=>I.getElementById(R)))},groupElements(m){const A=m.map(R=>I.getElementById(R));A.forEach(R=>{R&&(0,s.detach)(R)});const L=I.activePage,k={id:(0,d.nanoid)(10),children:A,type:"group"};return L.children.push(k),I.selectedElementsIds=(0,s.cast)([k.id]),L.children.find(R=>R.id===k.id)},ungroupElements(m){const A=m.map(k=>I.getElementById(k)),L=[];A.forEach(k=>{if(k&&k.type==="group"){const R=k.page,B=R.children.indexOf(k);k.children.forEach(X=>{L.push(X.id)}),k.children.forEach(X=>{(0,s.detach)(X),R.children.push(X)}),R.children.splice(B,1)}}),I.selectedElementsIds=(0,s.cast)(L)},deleteElements(m){const A=[];I.find(L=>(m.includes(L.id)&&A.push(L),!1)),A.forEach(L=>{(0,s.destroy)(L)}),I.selectedElementsIds=(0,s.cast)(I.selectedElementsIds.filter(L=>I.getElementById(L)))},on(m,A){if(m==="change"){let L=I.toJSON();return(0,s.onSnapshot)(I,k=>{const R=I.toJSON();!(0,P.deepEqual)(L,R)&&(L=R,A(R))})}},async _toCanvas({pixelRatio:m,ignoreBackground:A,pageId:L,mimeType:k,includeBleed:R,_skipTimeout:B,quickMode:X=!1}={}){var Y;const Q=m||1;L=L||((Y=I.pages[0])===null||Y===void 0?void 0:Y.id);const q=I.pages.find(_e=>_e.id===L);if(!q)throw new Error(`No page for export with id ${L}`);X?q==null||q.set({_forceMount:!0}):q==null||q.set({_exporting:!0});const z=await(0,g.waitTillAvailable)(()=>w.default.stages.find(_e=>_e.getAttr("pageId")===L));if(!z)throw q==null||q.set({_forceMount:!1,_exporting:!1}),new Error(`Export is failed. Can not find stage for page ${L}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);const N=!!z.findOne(".page-container"),U=I._elementsPixelRatio;Q>I._elementsPixelRatio&&I.setElementsPixelRatio(Q),await I.waitLoading({_skipTimeout:B});const $=z.findOne(".page-container");if(!$)throw I.setElementsPixelRatio(U),q==null||q.set({_forceMount:!1,_exporting:!1}),new Error(`Export is failed. Can't find page container. ${N}`);z.find("Transformer").forEach(_e=>_e.visible(!1)),$.find(".page-background").forEach(_e=>_e.shadowEnabled(!1)),$.find(".page-background").forEach(_e=>_e.strokeEnabled(!1)),$.find(".highlighter").forEach(_e=>_e.visible(!1));const ee=$.findOne(".page-background-group"),G=ee.clip();ee.clip({x:null,y:null,width:null,height:null});const Z=$.findOne(".elements-container"),W=Z.clip();Z.clip({x:null,y:null,width:null,height:null});const te=$.find(_e=>_e.getAttr("hideInExport"));te.forEach(_e=>{_e.setAttr("oldVisible",_e.visible()),_e.hide()});const re=$.find(_e=>!_e.visible()&&_e.getAttr("editModeEnabled"));re.forEach(_e=>{_e.setAttr("oldVisible",_e.visible()),_e.show()}),A&&$.find(".page-background").forEach(_e=>_e.hide());const ie=R?q.bleed:0;let ae=ie;!I.bleedVisible&&R||(I.bleedVisible||R?I.bleedVisible&&R?ae=0:I.bleedVisible&&!R&&(ae=-q.bleed):ae=0);const se=document.createElement("canvas");se.width=Math.round((q.computedWidth+2*ie)*Q),se.height=Math.round((q.computedHeight+2*ie)*Q);const de=se.getContext("2d");k==="image/jpeg"&&(de.fillStyle="white",de.fillRect(0,0,se.width,se.height));const he=$.scale();$.scale({x:1,y:1});const Oe=$.toCanvas({x:$.x()-ae,y:$.y()-ae,width:q.computedWidth+2*ie,height:q.computedHeight+2*ie,pixelRatio:Q});return $.scale(he),de.drawImage(Oe,0,0,se.width,se.height),w.default.Util.releaseCanvas(Oe),A&&$.find(".page-background").forEach(_e=>_e.show()),te.forEach(_e=>{_e.visible(_e.getAttr("oldVisible"))}),re.forEach(_e=>{_e.visible(_e.getAttr("oldVisible"))}),$.find(".page-background").forEach(_e=>_e.shadowEnabled(!0)),$.find(".page-background").forEach(_e=>_e.strokeEnabled(!0)),z.find("Transformer").forEach(_e=>_e.visible(!0)),$.find(".highlighter").forEach(_e=>_e.visible(!0)),ee.clip(G),Z.clip(W),I.setElementsPixelRatio(U),q==null||q.set({_exporting:!1,_forceMount:!1}),se},async toDataURL(m={}){var{mimeType:A,quality:L}=m,k=a(m,["mimeType","quality"]);const R=await I._toCanvas(Object.assign({mimeType:A},k)),B=R.toDataURL(A,L);return w.default.Util.releaseCanvas(R),B},async toBlob(m={}){var{mimeType:A,quality:L}=m,k=a(m,["mimeType","quality"]);const R=await I._toCanvas(Object.assign({mimeType:A},k)),B=await new Promise(X=>{R.toBlob(X,A,L)});return w.default.Util.releaseCanvas(R),B},async saveAsImage(m={}){var{fileName:A}=m,L=a(m,["fileName"]);const k=L.mimeType||"image/png",R=k.split("/")[1];(0,_.downloadFile)(await I.toDataURL(L),A||"polotno."+R,k)},async _toPDF(m){const A=m.dpi||I.dpi,L=m.parallel||1,k=m.unit||(I.unit==="px"?"mm":I.unit),R=m.pixelRatio||1,B=m.pageIds||I.pages.map(te=>te.id),X=I.pages.filter(te=>B.includes(te.id)),Y=await(0,E.getJsPDF)(),Q=te=>(0,h.pxToUnit)({px:te,unit:k,dpi:A}),q=m.cropMarkSize||0,z=Q(q),N=X[0]||{},U=m.includeBleed?N.bleed:0,$=Q(N.computedWidth+2*U+2*z),ee=Q(N.computedHeight+2*U+2*z);var G=new Y({unit:k,orientation:$>ee?"landscape":"portrait",format:[$,ee],compress:!0,putOnlyUsedFonts:!0});G.deletePage(1);const Z=((te,re)=>{for(var ie=[],ae=0;ae<te.length;ae+=re)ie.push(te.slice(ae,ae+re));return ie})(X,L);let W=0;for(const te of Z){const re=te.map(async ie=>{const ae=m.includeBleed?ie.bleed:0,se=ie.computedWidth+2*ae+2*q,de=ie.computedHeight+2*ae+2*q,he=Q(se),Oe=Q(de);let _e=0,Ae=R;for(;_e<10;){_e+=1,_e===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const ce=await I.toDataURL(Object.assign(Object.assign({},m),{pageId:ie.id,pixelRatio:Ae}));if(ce.length>20)return m.onProgress&&m.onProgress(++W/B.length*.9),{url:ce,width:he,height:Oe,widthPx:se,heightPx:de};Ae*=.8}});(await Promise.all(re)).forEach(({url:ie,width:ae,height:se,widthPx:de,heightPx:he})=>{G.addPage([ae,se],ae>se?"landscape":"portrait");const Oe=G.getCurrentPageInfo();var _e;switch(k){case"pt":_e=1;break;case"mm":_e=72/25.4;break;case"cm":_e=72/2.54;break;case"in":_e=72;break;case"px":_e=.75;break;case"pc":case"em":_e=12;break;case"ex":_e=6;break;default:throw"Invalid unit: "+k}if(Oe.pageContext.cropBox={bottomLeftX:0,bottomLeftY:0,topRightX:ae*_e,topRightY:se*_e},Oe.pageContext.artBox={bottomLeftX:Q(q+U)*_e,bottomLeftY:Q(q+U)*_e,topRightX:Q(de-q-U)*_e,topRightY:Q(he-q-U)*_e},Oe.pageContext.bleedBox={bottomLeftX:Q(q+U)*_e,bottomLeftY:Q(q+U)*_e,topRightX:Q(de-q-U)*_e,topRightY:Q(he-q-U)*_e},z){G.setLineWidth(Q(1));const Ae=z+Q(U);G.line(Ae,0,Ae,z),G.line(0,Ae,z,Ae),G.line(ae-Ae,0,ae-Ae,z),G.line(ae,Ae,ae-z,Ae),G.line(0,se-Ae,z,se-Ae),G.line(Ae,se,Ae,se-z),G.line(ae,se-Ae,ae-z,se-Ae),G.line(ae-Ae,se,ae-Ae,se-z)}G.addImage(ie,z,z,ae-2*z,se-2*z,void 0,"FAST")})}return G},toPDFDataURL:async m=>(await I._toPDF(Object.assign({mimeType:"image/jpeg"},m))).output("datauristring"),async toGIFDataURL(m={}){const A=m.pixelRatio||1,L=await(0,O.createGIF)({width:I.width*A,height:I.height*A}),k=1e3/(m.fps||10),R=I.duration/k;for(let B=0;B<R-1;B++){const X=B*k||1;I.setCurrentTime(X);let Y=0,Q="";for(const z of I.pages)if(Y+=z.duration,z.set({_rendering:Y>X}),Y>X){Q=z.id;break}const q=await I._toCanvas({pixelRatio:A,pageId:Q,_skipTimeout:!0});L.addFrame(q.getContext("2d"),{delay:k,copy:!0})}for(const B of I.pages)B.set({_rendering:!1});return I.stop(),L.render(),new Promise(B=>{L.on("finished",function(X){(function(Y,Q){var q=new FileReader;q.onload=function(z){Q(z.target.result)},q.readAsDataURL(Y)})(X,B)})})},async saveAsGIF(m={}){var{fileName:A}=m,L=a(m,["fileName"]);const k=await I.toGIFDataURL(L);(0,_.downloadFile)(k,A||"polotno.gif")},async toHTML({elementHook:m}={elementHook:void 0}){const A=I.toJSON();return(0,y.jsonToHTML)({json:A,elementHook:m})},async saveAsHTML({fileName:m}={}){const A=await I.toHTML(),L="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(A)));(0,_.downloadFile)(L,m||"polotno.html")},async toSVG({elementHook:m,pageId:A}={elementHook:void 0,pageId:void 0}){var L;const k=I.toJSON();A=A||((L=k.pages[0])===null||L===void 0?void 0:L.id);const R=k.pages.find(B=>B.id===A);return(0,b.jsonToSVG)({json:Object.assign(Object.assign({},k),{pages:R?[R]:[]}),elementHook:m})},async saveAsSVG({fileName:m,elementHook:A,pageId:L}={}){const k=await I.toSVG({elementHook:A,pageId:L}),R="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(k)));(0,_.downloadFile)(R,m||"polotno.svg")},async saveAsPDF(m={}){var{fileName:A}=m,L=a(m,["fileName"]);(await I._toPDF(Object.assign({mimeType:"image/jpeg"},L))).save(A||"polotno.pdf")},async waitLoading({_skipTimeout:m=!1}={}){m||await new Promise(A=>setTimeout(A,50)),await(0,p.whenLoaded)()},toJSON:()=>({width:I.width,height:I.height,fonts:(0,s.getSnapshot)(I.fonts),pages:(0,s.getSnapshot)(I.pages),audios:(0,s.getSnapshot)(I.audios),unit:I.unit,dpi:I.dpi,custom:I.custom}),loadJSON(m,A=!1){var L;const k=Object.assign({},m),R=I.pages.indexOf(I.activePage);let B=(L=k.pages[R]||k.pages[0])===null||L===void 0?void 0:L.id;k._activePageId=B;const X=Object.assign({},(0,s.getSnapshot)(I));Object.assign(X,k),X.history=A?I.history.toJSON():{history:[],undoIdx:-1},(0,s.applySnapshot)(I,X)},clear({keepHistory:m=!1}={}){const A=I.pages.map(L=>L.id);I.deletePages(A),I.custom=null,m||I.history.clear()},addFont(m){I.removeFont(m.fontFamily),I.fonts.push(m),I.loadFont(m.fontFamily)},removeFont(m){I.fonts.filter(A=>A.fontFamily===m).forEach(A=>(0,s.destroy)(A))},addAudio(m){const A=T.Audio.create(Object.assign({id:(0,d.nanoid)(10)},m));I.audios.push(A)},removeAudio(m){const A=I.audios.find(L=>L.id===m);A&&I.audios.remove(A)},async loadFont(m){const A=I.fonts.find(k=>k.fontFamily===m)||S.globalFonts.find(k=>k.fontFamily===m);let L=[{fontStyle:"normal",fontWeight:"normal"}];return A?(A.styles&&(L=A.styles.map(k=>({fontStyle:k.fontStyle||"normal",fontWeight:k.fontWeight||"normal"}))),S.injectCustomFont(A)):S.injectGoogleFont(m),Promise.all(L.map(k=>S.loadFont(m,k.fontStyle,k.fontWeight)))},validate:m=>e.Store.validate(m,[{path:"",type:e.Store}]).map(A=>({path:"store"+A.context.map(L=>L.path).join("."),message:A.message}))})),e.default=j}(Ai)),Ai}var m3;function x_(){return m3||(m3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Node=void 0;const i=eo,t=Gp,n=zv(),a=O_(),l=Td();e.Node=i.types.model("Node",{id:i.types.identifier,type:"none",name:"",opacity:1,custom:i.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),d={};for(var w in c)w[0]!=="_"&&(d[w]=s[w]);return d}).views(s=>({get locked(){return!(s.draggable||s.contentEditable||s.styleEditable||s.resizable)},get page(){return(0,i.getParentOfType)(s,a.Page)},get store(){return(0,i.getParentOfType)(s,n.Store)},get top(){let c=s;for(;;){if(!(0,i.hasParentOfType)(c,l.GroupElement))return c;c=(0,i.getParentOfType)(c,l.GroupElement)}},get parent(){return(0,i.hasParentOfType)(s,l.GroupElement)?(0,i.getParentOfType)(s,l.GroupElement):(0,i.hasParentOfType)(s,a.Page)?(0,i.getParentOfType)(s,a.Page):(0,i.hasParentOfType)(s,n.Store)?(0,i.getParentOfType)(s,n.Store):null},get zIndex(){return s.parent.children.indexOf(s)}})).actions(s=>({toJSON:()=>Object.assign({},(0,i.getSnapshot)(s))})).actions(s=>({clone(c={},{skipSelect:d=!1}={}){const w=JSON.parse(JSON.stringify(s.toJSON()));return c.id=c.id||(0,t.nanoid)(10),(0,l.forEveryChild)(w,_=>{_.id=(0,t.nanoid)(10)}),Object.assign(w,c),s.page.addElement(w,{skipSelect:d})},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(){}}))}(cg)),cg}var wg={},Sg={},y3;function Hx(){return y3||(y3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.registerAnimation=e.animate=e.animations=void 0;const i=Hd(),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}}};e.animations={fade:({dTime:l,element:s,animation:c})=>{const d=l/c.duration;return c.type==="enter"?{opacity:d*s.opacity}:{opacity:(1-d)*s.opacity}},rotate:({dTime:l,element:s,animation:c})=>{const d=l/c.duration*360;return(0,i.rotateAroundCenter)({x:s.x,y:s.y,width:s.width,height:s.height,rotation:s.rotation},d)},blink:({dTime:l,element:s,animation:c})=>{const d=c.duration,w=l%d/(d/2),_=w<=1?w:2-w;return{opacity:s.opacity*_}},bounce:({dTime:l,element:s,animation:c})=>{const d=c.duration,w=d/2,_={},E={x:s.x+s.width/3,y:s.y+s.height/3,width:s.width/3,height:s.height/3,fontSize:s.fontSize/3},O={x:s.x,y:s.y,width:s.width,height:s.height,fontSize:s.fontSize},v=l%d/w,S=v<=1?v:2-v;for(let p in E){const h=E[p],P=O[p]-h;_[p]=h+S*P}return _},move:({dTime:l,element:s,animation:c})=>{const d=t[c.data.direction]||t.right,w={};for(var _ in d.from){let E=d.from[_],O=d.to[_];c.type==="exit"&&(E=d.to[_],O=-d.from[_]);const v=s[_]+E,S=s[_]+O-v;w[_]=v+l/c.duration*S}return w},zoom:({dTime:l,element:s,animation:c})=>{const d={},w=((c.data.direction||"in")==="in"?1:-1)>0?.75:1.25,_=s.rotation*Math.PI/180,E=Math.cos(_),O=Math.sin(_),v=s.width*(1-w),S=s.height*(1-w),p=(v*E-S*O)/2,h=(v*O+S*E)/2,P={x:s.x+p,y:s.y+h,width:s.width*w,height:s.height*w,fontSize:s.fontSize*w},g={x:s.x,y:s.y,width:s.width,height:s.height,fontSize:s.fontSize};for(var y in P){let b=P[y],x=g[y];if(c.type==="exit"){const T=b;b=x,x=T}const M=x-b;d[y]=b+l/c.duration*M}return d}};const n=({element:l,dTime:s,animation:c})=>{const d=e.animations[c.name];return d?d({element:l,dTime:s,animation:c}):(console.error("Can not find animation type: "+c.name),{})};e.animate=n;const a=(l,s)=>{};e.registerAnimation=a}(Sg)),Sg}var b3;function Ec(){return b3||(b3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.ShapeFilter=e.getDiff=e.Animation=void 0;const i=eo,t=Hx(),n=No,a=x_();e.Animation=i.types.model("Animation",{delay:0,duration:500,enabled:!0,type:i.types.enumeration("Type",["enter","exit","loop"]),name:"none",data:i.types.frozen({})});const l=(s,c)=>{const d={};for(const w in c)if(typeof s[w]=="number"&&typeof c[w]=="number"){const _=c[w]-s[w];_!==0&&(d[w]=_)}return d};e.getDiff=l,e.ShapeFilter=i.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:i.types.array(e.Animation),blurEnabled:!1,blurRadius:10,brightnessEnabled:!1,brightness:0,sepiaEnabled:!1,grayscaleEnabled:!1,filters:i.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(s=>{const c=Object.assign(Object.assign({},s),{x:s.x||0,y:s.y||0,filters:Array.isArray(s.filters)?{}:s.filters});return"width"in s&&(c.width=c.width||1),"height"in s&&(c.height=c.height||1),s.locked&&(c.draggable=!1,c.contentEditable=!1,c.styleEditable=!1,c.resizable=!1,c.removable=!1),c}).views(s=>{const c=(0,n.observable)({x:s.x,y:s.y,width:s.width,height:s.height,rotation:s.rotation,opacity:s.opacity,color:s.color,fontSize:s.fontSize}),d=(0,n.action)(_=>{Object.assign(c,_)}),w=(0,n.action)(_=>{for(const E in _)typeof c[E]=="number"&&(c[E]=c[E]+_[E])});return{get a(){const{currentTime:_}=s.store;if(d({x:s.x,y:s.y,width:s.width,height:s.height,rotation:s.rotation,opacity:s.opacity,color:s.color,fontSize:s.fontSize}),_===0)return c;const E=_-s.page.startTime;if(E>s.page.duration||E<0)return c;const O=s.store.animatedElementsIds;if(O.length&&!O.includes(s.id))return c;const v=s.animations.find(g=>g.type==="enter"),S=(v==null?void 0:v.enabled)&&E<v.delay;S&&d({opacity:0});const p=(v==null?void 0:v.enabled)&&E>=v.delay&&E<=v.delay+v.duration;if(p){const g=E-v.delay,y=(0,t.animate)({element:s,animation:v,dTime:g}),b=(0,e.getDiff)(s,y);w(b)}const h=s.animations.find(g=>g.type==="exit");if(!S&&!p&&(h!=null&&h.enabled)&&E>=s.page.duration-h.duration-h.delay&&E<=s.page.duration-h.delay){const g=E-(s.page.duration-h.duration-h.delay),y=(0,t.animate)({element:s,animation:h,dTime:g}),b=(0,e.getDiff)(s,y);w(b)}h!=null&&h.enabled&&E>=s.page.duration-h.delay&&d({opacity:0});const P=s.animations.find(g=>g.type==="loop");if(P!=null&&P.enabled){const g=E,y=(0,t.animate)({element:s,animation:P,dTime:g}),b=(0,e.getDiff)(s,y);w(b)}return c},animated:_=>s.a[_]}}).actions(s=>({setAnimation(c,d){const w=s.animations.find(_=>_.type===c);w?Object.assign(w,d):s.animations.push(Object.assign({type:c},d))},setFilter(c,d){s.filters.clear(),d!==0&&s.filters.set(c,{intensity:d})}}))}(wg)),wg}var Eg={},_3;function Gx(){return _3||(_3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextElement=void 0;const i=eo,t=Ec();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:i.types.optional(i.types.union(i.types.number,i.types.string),1.2),letterSpacing:0,_editModeEnabled:!1,backgroundEnabled:!1,backgroundColor:"#7ED321",backgroundOpacity:1,backgroundCornerRadius:.5,backgroundPadding:.5}).preProcessSnapshot(n=>Object.assign({},n)).actions(n=>({toggleEditMode(a){n._editModeEnabled=a??!n._editModeEnabled,n._editModeEnabled?n.store.history.startTransaction():n.store.history.endTransaction()}}))}(Eg)),Eg}var Og={},w3;function P_(){return w3||(w3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageElement=void 0;const i=Ec();e.ImageElement=i.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(n){t._cropModeEnabled=n??!t._cropModeEnabled,t._cropModeEnabled?t.store.history.startTransaction():t.store.history.endTransaction()},beforeDestroy(){t._cropModeEnabled&&t.store.history.endTransaction()}}))}(Og)),Og}var xg={},S3;function Vx(){return S3||(S3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VideoElement=void 0;const i=P_();e.VideoElement=i.ImageElement.named("Video").props({type:"video",duration:0,startTime:0,endTime:1,volume:1})}(xg)),xg}var Pg={},E3;function $x(){return E3||(E3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0;const i=eo,t=Ec();e.LineElement=t.Shape.named("Line").props({type:"line",width:400,height:10,color:"black",dash:i.types.array(i.types.number),startHead:"",endHead:""}).actions(n=>({}))}(Pg)),Pg}var Cg={},O3;function Wx(){return O3||(O3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SVGElement=void 0;const i=eo,t=Ec();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:i.types.map(i.types.string)}).preProcessSnapshot(n=>Object.assign(Object.assign({},n),{src:n.src||n.svgSource,colorsReplace:Array.isArray(n.colorsReplace)?{}:n.colorsReplace})).actions(n=>({replaceColor(a,l){n.colorsReplace.set(a,l)}}))}(Cg)),Cg}var kg={},x3;function Yx(){return x3||(x3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FigureElement=void 0;const i=eo,t=Ec();e.FigureElement=t.Shape.named("Figure").props({type:"figure",subType:"rect",fill:"rgb(0, 161, 255)",dash:i.types.array(i.types.number),strokeWidth:0,stroke:"rgba(98, 197, 255, 1)",cornerRadius:0})}(kg)),kg}var P3;function Td(){return P3||(P3=1,function(e){var i=md&&md.__rest||function(h,P){var g={};for(var y in h)Object.prototype.hasOwnProperty.call(h,y)&&P.indexOf(y)<0&&(g[y]=h[y]);if(h!=null&&typeof Object.getOwnPropertySymbols=="function"){var b=0;for(y=Object.getOwnPropertySymbols(h);b<y.length;b++)P.indexOf(y[b])<0&&Object.prototype.propertyIsEnumerable.call(h,y[b])&&(g[y[b]]=h[y[b]])}return g};Object.defineProperty(e,"__esModule",{value:!0}),e.TYPES_MAP=e.GroupElement=e.ElementTypes=e.forEveryChild=void 0,e.registerShapeModel=p;const t=eo,n=Gp,a=x_(),l=Ec(),s=Gx(),c=P_(),d=Vx(),w=$x(),_=Wx(),E=Yx(),O=(h,P)=>{if(h.children)for(const g of h.children){if(P(g)===!0)break;(0,e.forEveryChild)(g,P)}};e.forEveryChild=O;const v=[...new Array(20)].map((h,P)=>t.types.late(()=>S[P]));e.ElementTypes=t.types.union({dispatcher:h=>{const P=e.TYPES_MAP[h.type];if(!P)throw new Error(`Unknown element type: "${h.type}"`);return P}},_.SVGElement,s.TextElement,c.ImageElement,w.LineElement,d.VideoElement,E.FigureElement,t.types.late(()=>e.GroupElement),...v),e.GroupElement=a.Node.named("Group").props({type:"group",children:t.types.array(e.ElementTypes)}).views(h=>({get draggable(){let P=!0;return(0,e.forEveryChild)(h,g=>{g.draggable||(P=!1)}),P},get resizable(){let P=!0;return(0,e.forEveryChild)(h,g=>{g.resizable||(P=!1)}),P},get contentEditable(){let P=!0;return(0,e.forEveryChild)(h,g=>{g.contentEditable||(P=!1)}),P},get styleEditable(){let P=!0;return(0,e.forEveryChild)(h,g=>{g.styleEditable||(P=!1)}),P},get locked(){let P=!0;return(0,e.forEveryChild)(h,g=>{g.locked||(P=!1)}),P}})).actions(h=>({set(P){var{draggable:g,contentEditable:y,styleEditable:b,resizable:x}=P,M=i(P,["draggable","contentEditable","styleEditable","resizable"]);g!==void 0&&(0,e.forEveryChild)(h,T=>{T.set({draggable:g})}),y!==void 0&&(0,e.forEveryChild)(h,T=>{T.set({contentEditable:y})}),b!==void 0&&(0,e.forEveryChild)(h,T=>{T.set({styleEditable:b})}),x!==void 0&&(0,e.forEveryChild)(h,T=>{T.set({resizable:x})}),Object.assign(h,M)},addElement(P,{skipSelect:g=!1}={}){const y=e.TYPES_MAP[P.type];if(!y)return void console.error("Can not find model with type "+P.type);P.children&&P.children.forEach(x=>{x.id=(0,n.nanoid)(10)});const b=y.create(Object.assign({id:(0,n.nanoid)(10)},P));return h.children.push(b),b.selectable&&!g&&h.store.selectElements([b.id]),b},setElementZIndex(P,g){const y=h.children.find(b=>b.id===P);y&&((0,t.detach)(y),h.children.remove(y),h.children.splice(g,0,y))}}));const S=[];function p(h,P){const g=h.type;if(!g)throw new Error('You must pass "type" attribute to custom model.');let y=l.Shape.named(g).props(h);P&&(y=P(y)),e.TYPES_MAP[g]=y,S.push(y)}e.TYPES_MAP={svg:_.SVGElement,text:s.TextElement,image:c.ImageElement,group:e.GroupElement,line:w.LineElement,video:d.VideoElement,figure:E.FigureElement}}(md)),md}var C3;function Kx(){return C3||(C3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isClipboardEmpty=e.paste=e.cut=e.copy=void 0;const i=Td();let t=[],n="";const a="polotno_clipboard",l=E=>{t=JSON.parse(JSON.stringify(E));try{localStorage.setItem(a,JSON.stringify(E))}catch{}},s=()=>{try{const E=localStorage.getItem(a);if(E)return JSON.parse(E)}catch{}return t},c=E=>{var O;n=(O=E.activePage)===null||O===void 0?void 0:O.id,l(E.selectedElements.map(v=>v.toJSON()))};e.copy=c;const d=E=>{var O;n=(O=E.activePage)===null||O===void 0?void 0:O.id,l(E.selectedElements.map(S=>S.toJSON()));let v=E.selectedElements.filter(S=>S.removable).map(S=>S.id);E.deleteElements(v)};e.cut=d;const w=E=>{var O,v;let S=0;n===((O=E.activePage)===null||O===void 0?void 0:O.id)&&(S=E.width/20),n=(v=E.activePage)===null||v===void 0?void 0:v.id,E.history.transaction(()=>{const p=[],h=s();(0,i.forEveryChild)({children:h},P=>{delete P.id,P.type!=="group"&&(P.x+=S,P.y+=S)}),h.forEach(P=>{var g;const y=(g=E.activePage)===null||g===void 0?void 0:g.addElement(P);y&&p.push(y.id)}),l(h),E.selectElements(p)})};e.paste=w;const _=()=>s().length===0;e.isClipboardEmpty=_}(ug)),ug}var k3;function Xx(){return k3||(k3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.handleHotkey=t;const i=Kx();function t(n,a){var l,s,c,d;if(((l=document.activeElement)===null||l===void 0?void 0:l.tagName)==="INPUT"||((s=document.activeElement)===null||s===void 0?void 0:s.tagName)==="TEXTAREA"||((c=document.activeElement)===null||c===void 0?void 0:c.contentEditable)==="true")return;const w=a.selectedElements.filter(O=>O.removable).map(O=>O.id);n.keyCode!==46&&n.keyCode!==8||a.deleteElements(w);const _=n.ctrlKey||n.metaKey,E=n.shiftKey;if(_&&!E&&n.code==="KeyZ"&&(n.preventDefault(),a.history.undo()),_&&E&&n.code==="KeyZ"&&(n.preventDefault(),a.history.redo()),_&&n.code==="KeyA"){n.preventDefault();const O=(d=a.activePage)===null||d===void 0?void 0:d.children.filter(S=>S.selectable),v=(O==null?void 0:O.map(S=>S.id))||[];a.selectElements(v)}_&&n.code==="KeyC"&&(n.preventDefault(),(0,i.copy)(a)),_&&n.code==="KeyX"&&(n.preventDefault(),(0,i.cut)(a)),_&&n.code==="KeyV"&&(n.preventDefault(),(0,i.paste)(a)),n.code==="ArrowDown"&&(n.preventDefault(),a.selectedElements.forEach(O=>{O.draggable&&O.set({y:O.y+1})})),n.code==="ArrowUp"&&(n.preventDefault(),a.selectedElements.forEach(O=>{O.draggable&&O.set({y:O.y-1})})),n.code==="ArrowLeft"&&(n.preventDefault(),a.selectedElements.forEach(O=>{O.draggable&&O.set({x:O.x-1})})),n.code==="ArrowRight"&&(n.preventDefault(),a.selectedElements.forEach(O=>{O.draggable&&O.set({x:O.x+1})}))}}(sg)),sg}var Ag={},A3;function Zx(){return A3||(A3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t=e.getTranslations=e.setTranslations=void 0;const i=No,t=(0,i.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",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:"Upload Image",uploadTip:"Do you want to upload your own images?",background:"Background",resize:"Resize",layers:"Layers",layerTypes:{image:"Image",text:"Text",svg:"SVG",line:"Line",figure:"Figure",group:"Group"},layersTip:"Elements on your active page:",noLayers:"No elements on the page...",namePlaceholder:"Type element name...",useMagicResize:"Use magic resize",clipImage:"Mask image",width:"Width",height:"Height",magicResizeDescription:"Magic resize will automatically resize and move all elements on the canvas",headerText:"Header",createHeader:"Create header",subHeaderText:"Sub Header",createSubHeader:"Create sub header",bodyText:"Body text",createBody:"Create body text"},pagesTimeline:{pages:"Pages",removePage:"Remove page",addPage:"Add page",duplicatePage:"Duplicate page",removeAudio:"Remove audio"},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"}});function n(_,E){var O,v=E.split("."),S=_;for(O=0;O<v.length;++O){if(S[v[O]]==null)return;S=S[v[O]]}return S}const a=_=>_&&typeof _=="object";function l(_,E){Object.keys(E).forEach(O=>{const v=_[O],S=E[O];a(S)&&a(v)?l(v,S):_[O]=S})}function s(_,E,O=""){Object.keys(E).forEach(v=>{const S=E[v],p=O?`${O}.${v}`:v;a(S)?a(_[v])?s(_[v],S,p):console.warn(`Missing nested translation object at '${p}'`):_[v]===void 0&&console.warn(`Missing translation '${p}'`)})}e.setTranslations=(0,i.action)((_,{validate:E=!1}={})=>{E&&s(_,t),l(t,_)});const c=()=>(0,i.toJS)(t);e.getTranslations=c;const d={},w=_=>{const E=n(t,_);if(E!==void 0)return E;d[_]||(d[_]=!0,console.warn(`Missing translation '${_}'`));const O=_.split("."),v=O[O.length-1]||" ";return v.charAt(0).toUpperCase()+v.slice(1)};e.t=w}(Ag)),Ag}var T3;function Qx(){return T3||(T3=1,function(e){var i=vf&&vf.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceCanvas=void 0;const t=i(Tn()),n=Qi,a=i(kx()),l=Ax(),s=Tx(),c=Xx(),d=Zx(),w=`Polotno warning: <Workspace /> component can not automatically detect its size.
319
- Width or height of parent elements is equal 0.
320
- Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
321
- For simpler debugging here is the log of the parent element:`,_=(p,h,P,g,y,b)=>{const x=t.default.useRef({width:h,height:P}),M=t.default.useRef({top:0,left:0}),T=t.default.useRef(!1),j=t.default.useRef(y.pages.length);T.current=j.current!==y.pages.length,j.current=y.pages.length,t.default.useEffect(()=>{const I=p.current,m=A=>{M.current={top:I.scrollTop,left:I.scrollLeft}};return I.addEventListener("scroll",m),()=>{I.removeEventListener("scroll",m)}},[]),t.default.useLayoutEffect(()=>{if(!p.current||T.current)return;const I=p.current,m=(M.current.left+I.offsetWidth/2)/x.current.width,A=(M.current.top+I.offsetHeight/2)/x.current.height;b.current=!0,I.scrollLeft=m*h-I.offsetWidth/2,I.scrollTop=A*P-I.offsetHeight/2,x.current={width:h,height:P}},[g,h,P])},E=({element:p,scrollTop:h=0,duration:P=300,onFinish:g=()=>{}})=>{const y=p.scrollTop,b=h-y;let x=0,M=!1;if(P===0)return p.scrollTop=h,()=>{};const T=()=>{if(M)return;x+=20;const I=j(x,y,b,P);p.scrollTop=I,x<P?setTimeout(T,20):g()},j=(I,m,A,L)=>(I/=L/2)<1?A/2*I*I+m:-A/2*(--I*(I-2)-1)+m;return T(),()=>{M=!0}},O=(p,h,P,g,y,b)=>{const x=t.default.useRef(!1),M=t.default.useRef(null),T=t.default.useRef(!1);t.default.useEffect(()=>{const I=p.current,m=()=>{y.current};return I.addEventListener("scroll",m),()=>{I.removeEventListener("scroll",m)}},[]);const j=P.pages.indexOf(P.activePage);return t.default.useLayoutEffect(()=>{if(!P.activePage||!p.current||x.current)return;const I=p.current,m=P.pages.indexOf(P.activePage)*h;let A=()=>{};return(Math.abs(m-I.scrollTop)>.5*h||T.current)&&(T.current=!0,A=E({element:I,scrollTop:m,onFinish:()=>{T.current=!1},duration:P.isPlaying?0:300})),A},[P.activePage,j,P.isPlaying]),{handleScroll:I=>{if(b||T.current)return;x.current=!0,clearTimeout(M.current),M.current=setTimeout(()=>{x.current=!1},300);const m=I.currentTarget.childNodes[0].offsetHeight,A=I.currentTarget.scrollTop,L=Math.floor((A+g.height/3)/m),k=P.pages[L];k&&P.activePage!==k&&k.select()}}},v=({store:p})=>t.default.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},t.default.createElement("p",null,(0,d.t)("workspace.noPages")),t.default.createElement("button",{onClick:()=>{p.addPage()}},(0,d.t)("workspace.addPage"))),S=({width:p,height:h,xPadding:P,yPadding:g,backgroundColor:y})=>t.default.createElement("div",{style:{width:p+"px",height:h+"px",backgroundColor:y,paddingLeft:P+"px",paddingRight:P+"px",paddingTop:g+"px",paddingBottom:g+"px"}},t.default.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}}));e.WorkspaceCanvas=(0,n.observer)(({store:p,pageControlsEnabled:h,backgroundColor:P,pageBorderColor:g,activePageBorderColor:y,bleedColor:b,components:x,onKeyDown:M,paddingX:T,paddingY:j,altCloneEnabled:I=!0,visiblePagesOffset:m,renderOnlyActivePage:A})=>{var L;const k=T??20,R=j??55,[B,X]=t.default.useState({width:100,height:100}),Y=t.default.useRef(B),Q=t.default.useRef(null),q=t.default.useRef(null),z=p.bleedVisible?Math.max(0,...p.pages.map(ce=>ce.bleed)):0,N=Math.max(...p.pages.map(ce=>ce.computedWidth)),U=Math.max(...p.pages.map(ce=>ce.computedHeight)),$=((L=p.activePage)===null||L===void 0?void 0:L.computedHeight)||0,ee=N+2*z,G=(A?$:U)+2*z,Z=async({skipTimeout:ce}={skipTimeout:!1})=>{if(ce||await new Promise(at=>setTimeout(at,50)),Q.current===null)return;const pe=Q.current.getBoundingClientRect();pe.width!==0&&pe.height!==0||(console.warn(w),console.log(Q.current));const Ce=q.current.clientWidth||pe.width,Le={width:Ce,height:pe.height};(Y.current.width!==Le.width||Y.current.height!==Le.height)&&(X(Le),Y.current=Le);const ue=(Ce-2*k)/ee,ve=p.pages.length>1?3.1:2,xe=(pe.height-R*ve)/G,je=Math.max(Math.min(ue,xe),.01);p.scaleToFit!==je&&(p.setScale(je),p._setScaleToFit(je))};t.default.useLayoutEffect(()=>{Z({skipTimeout:!0})},[]),t.default.useEffect(()=>{Z()},[ee,G]),t.default.useEffect(()=>{p.__()},[]),t.default.useEffect(()=>{const ce=Q.current;if(window.ResizeObserver){const pe=new ResizeObserver(()=>{Z({skipTimeout:!0})});return pe.observe(ce),()=>pe.unobserve(ce)}{const pe=setInterval(()=>{Z({skipTimeout:!0})},100);return()=>clearInterval(pe)}},[ee,G]);const W=Math.max(k,(B.width-ee*p.scale)/2),te=A?1:p.pages.length,re=G*p.scale*te,ie=Math.max(R,(B.height-re)/te/2);t.default.useEffect(()=>{const ce=pe=>{(M||c.handleHotkey)(pe,p)};return window.addEventListener("keydown",ce),()=>window.removeEventListener("keydown",ce)},[]),t.default.useEffect(()=>{var ce;const pe=Ce=>{if(Ce.ctrlKey||Ce.metaKey){Ce.preventDefault();const xe=Math.max(3,p.scaleToFit),je=Math.min(.1,p.scaleToFit),at=(Le=Ce.deltaY<0?1.05*p.scale:p.scale/1.05,ue=je,ve=xe,Math.max(ue,Math.min(ve,Le)));p.setScale(at)}else var Le,ue,ve};return(ce=q.current)===null||ce===void 0||ce.addEventListener("wheel",pe),()=>{var Ce;return(Ce=q.current)===null||Ce===void 0?void 0:Ce.removeEventListener("wheel",pe)}},[]);const ae=t.default.useRef(!1);_(q,ee*p.scale+2*W,G*p.scale+2*ie,p.scale,p,ae);const{handleScroll:se}=O(q,G*p.scale+2*ie,p,B,ae,A),de=B.width>=ee*p.scale+2*W,he=P||"rgba(232, 232, 232, 0.9)",Oe=p.pages.indexOf(p.activePage),_e=(x==null?void 0:x.NoPages)||v,Ae=m??Math.min(3,Math.max(1,Math.ceil(B.height/2/(G*p.scale))));return t.default.createElement("div",{ref:Q,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:he},tabIndex:0,className:"polotno-workspace-container"},t.default.createElement("div",{ref:q,onScroll:se,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:de?"hidden":"auto"},className:"polotno-workspace-inner"},p.pages.map((ce,pe)=>{const Ce=ce===p.activePage;if(A&&!Ce&&!ce._exportingOrRendering&&!ce._forceMount)return null;if(!(Math.abs(pe-Oe)<=Ae||ce._exportingOrRendering||ce._forceMount))return t.default.createElement(S,{key:ce.id,width:ee*p.scale+2*W,height:G*p.scale+2*ie,backgroundColor:he,xPadding:W,yPadding:ie});const Le=t.default.createElement(a.default,{key:ce.id,page:ce,xPadding:W,yPadding:ie,width:ee*p.scale+2*W,height:G*p.scale+2*ie,store:p,pageControlsEnabled:h,backColor:he,pageBorderColor:g||"lightgrey",activePageBorderColor:y||"rgb(0, 161, 255)",altCloneEnabled:I,bleedColor:b||"rgba(255, 0, 0, 0.1)",components:x});return(ce._exportingOrRendering||ce._forceMount)&&!Ce&&A?t.default.createElement("div",{style:{display:"none"},key:ce.id},Le):Le}),p.rulesVisible&&t.default.createElement(l.TopRules,{store:p,xPadding:W,yPadding:ie,width:ee*p.scale+2*W,height:G*p.scale+2*ie}),p.pages.length===0&&t.default.createElement(_e,{store:p}),p.audios.map(ce=>t.default.createElement(s.AudioElement,{key:ce.id,audio:ce,store:p}))))}),e.default=e.WorkspaceCanvas}(vf)),vf}var Jx=Qx(),eP=zv(),tP=bc(),bd=ts(),Tg=Ks(),nP=Bd();tP.toggleFadeInAnimation(!1);bd.setTextOverflow("change-font-size");const rP=new URLSearchParams(location.search).get("key"),C_=eP.createStore({key:rP});window.store=C_;window.config={addGlobalFont:nP.addGlobalFont,unstable_useHtmlTextRender:bd.useHtmlTextRender,unstable_setTextVerticalResizeEnabled:bd.setTextVerticalResizeEnabled,unstable_setTextOverflow:bd.setTextOverflow,onLoadError:Tg.onLoadError,setAssetLoadTimeout:Tg.setAssetLoadTimeout,setFontLoadTimeout:Tg.setFontLoadTimeout,unstable_setTextSplitAllowed:bd.setTextSplitAllowed};const iP=M3.createRoot(document.getElementById("root"));iP.render(qt.createElement(Jx.WorkspaceCanvas,{visiblePagesOffset:0,store:C_,components:{PageControls:()=>null,Tooltip:()=>null}}));