polotno-node 2.12.27 → 2.12.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,603 @@
1
+ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();var a0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ph(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Dx(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function r(){var i=!1;try{i=this instanceof r}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var Cg={exports:{}},Bn={};/**
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 t5;function Fx(){if(t5)return Bn;t5=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),g=Symbol.iterator;function v(B){return B===null||typeof B!="object"?null:(B=g&&B[g]||B["@@iterator"],typeof B=="function"?B:null)}var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,_={};function x(B,D,U){this.props=B,this.context=D,this.refs=_,this.updater=U||p}x.prototype.isReactComponent={},x.prototype.setState=function(B,D){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,D,"setState")},x.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function b(){}b.prototype=x.prototype;function E(B,D,U){this.props=B,this.context=D,this.refs=_,this.updater=U||p}var A=E.prototype=new b;A.constructor=E,y(A,x.prototype),A.isPureReactComponent=!0;var S=Array.isArray,k=Object.prototype.hasOwnProperty,I={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function M(B,D,U){var X,ee={},K=null,oe=null;if(D!=null)for(X in D.ref!==void 0&&(oe=D.ref),D.key!==void 0&&(K=""+D.key),D)k.call(D,X)&&!O.hasOwnProperty(X)&&(ee[X]=D[X]);var me=arguments.length-2;if(me===1)ee.children=U;else if(1<me){for(var de=Array(me),ye=0;ye<me;ye++)de[ye]=arguments[ye+2];ee.children=de}if(B&&B.defaultProps)for(X in me=B.defaultProps,me)ee[X]===void 0&&(ee[X]=me[X]);return{$$typeof:t,type:B,key:K,ref:oe,props:ee,_owner:I.current}}function F(B,D){return{$$typeof:t,type:B.type,key:D,ref:B.ref,props:B.props,_owner:B._owner}}function j(B){return typeof B=="object"&&B!==null&&B.$$typeof===t}function T(B){var D={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(U){return D[U]})}var L=/\/+/g;function $(B,D){return typeof B=="object"&&B!==null&&B.key!=null?T(""+B.key):D.toString(36)}function q(B,D,U,X,ee){var K=typeof B;(K==="undefined"||K==="boolean")&&(B=null);var oe=!1;if(B===null)oe=!0;else switch(K){case"string":case"number":oe=!0;break;case"object":switch(B.$$typeof){case t:case e:oe=!0}}if(oe)return oe=B,ee=ee(oe),B=X===""?"."+$(oe,0):X,S(ee)?(U="",B!=null&&(U=B.replace(L,"$&/")+"/"),q(ee,D,U,"",function(ye){return ye})):ee!=null&&(j(ee)&&(ee=F(ee,U+(!ee.key||oe&&oe.key===ee.key?"":(""+ee.key).replace(L,"$&/")+"/")+B)),D.push(ee)),1;if(oe=0,X=X===""?".":X+":",S(B))for(var me=0;me<B.length;me++){K=B[me];var de=X+$(K,me);oe+=q(K,D,U,de,ee)}else if(de=v(B),typeof de=="function")for(B=de.call(B),me=0;!(K=B.next()).done;)K=K.value,de=X+$(K,me++),oe+=q(K,D,U,de,ee);else if(K==="object")throw D=String(B),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.");return oe}function J(B,D,U){if(B==null)return B;var X=[],ee=0;return q(B,X,"","",function(K){return D.call(U,K,ee++)}),X}function ae(B){if(B._status===-1){var D=B._result;D=D(),D.then(function(U){(B._status===0||B._status===-1)&&(B._status=1,B._result=U)},function(U){(B._status===0||B._status===-1)&&(B._status=2,B._result=U)}),B._status===-1&&(B._status=0,B._result=D)}if(B._status===1)return B._result.default;throw B._result}var ie={current:null},Z={transition:null},te={ReactCurrentDispatcher:ie,ReactCurrentBatchConfig:Z,ReactCurrentOwner:I};function V(){throw Error("act(...) is not supported in production builds of React.")}return Bn.Children={map:J,forEach:function(B,D,U){J(B,function(){D.apply(this,arguments)},U)},count:function(B){var D=0;return J(B,function(){D++}),D},toArray:function(B){return J(B,function(D){return D})||[]},only:function(B){if(!j(B))throw Error("React.Children.only expected to receive a single React element child.");return B}},Bn.Component=x,Bn.Fragment=n,Bn.Profiler=i,Bn.PureComponent=E,Bn.StrictMode=r,Bn.Suspense=u,Bn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=te,Bn.act=V,Bn.cloneElement=function(B,D,U){if(B==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+B+".");var X=y({},B.props),ee=B.key,K=B.ref,oe=B._owner;if(D!=null){if(D.ref!==void 0&&(K=D.ref,oe=I.current),D.key!==void 0&&(ee=""+D.key),B.type&&B.type.defaultProps)var me=B.type.defaultProps;for(de in D)k.call(D,de)&&!O.hasOwnProperty(de)&&(X[de]=D[de]===void 0&&me!==void 0?me[de]:D[de])}var de=arguments.length-2;if(de===1)X.children=U;else if(1<de){me=Array(de);for(var ye=0;ye<de;ye++)me[ye]=arguments[ye+2];X.children=me}return{$$typeof:t,type:B.type,key:ee,ref:K,props:X,_owner:oe}},Bn.createContext=function(B){return B={$$typeof:o,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},B.Provider={$$typeof:a,_context:B},B.Consumer=B},Bn.createElement=M,Bn.createFactory=function(B){var D=M.bind(null,B);return D.type=B,D},Bn.createRef=function(){return{current:null}},Bn.forwardRef=function(B){return{$$typeof:s,render:B}},Bn.isValidElement=j,Bn.lazy=function(B){return{$$typeof:f,_payload:{_status:-1,_result:B},_init:ae}},Bn.memo=function(B,D){return{$$typeof:h,type:B,compare:D===void 0?null:D}},Bn.startTransition=function(B){var D=Z.transition;Z.transition={};try{B()}finally{Z.transition=D}},Bn.unstable_act=V,Bn.useCallback=function(B,D){return ie.current.useCallback(B,D)},Bn.useContext=function(B){return ie.current.useContext(B)},Bn.useDebugValue=function(){},Bn.useDeferredValue=function(B){return ie.current.useDeferredValue(B)},Bn.useEffect=function(B,D){return ie.current.useEffect(B,D)},Bn.useId=function(){return ie.current.useId()},Bn.useImperativeHandle=function(B,D,U){return ie.current.useImperativeHandle(B,D,U)},Bn.useInsertionEffect=function(B,D){return ie.current.useInsertionEffect(B,D)},Bn.useLayoutEffect=function(B,D){return ie.current.useLayoutEffect(B,D)},Bn.useMemo=function(B,D){return ie.current.useMemo(B,D)},Bn.useReducer=function(B,D,U){return ie.current.useReducer(B,D,U)},Bn.useRef=function(B){return ie.current.useRef(B)},Bn.useState=function(B){return ie.current.useState(B)},Bn.useSyncExternalStore=function(B,D,U){return ie.current.useSyncExternalStore(B,D,U)},Bn.useTransition=function(){return ie.current.useTransition()},Bn.version="18.3.1",Bn}var n5;function Pp(){return n5||(n5=1,Cg.exports=Fx()),Cg.exports}var ji=Pp();const se=ph(ji);var d1={},Lg={exports:{}},Ls={},Ng={exports:{}},Tg={};/**
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 r5;function Bx(){return r5||(r5=1,(function(t){function e(Z,te){var V=Z.length;Z.push(te);e:for(;0<V;){var B=V-1>>>1,D=Z[B];if(0<i(D,te))Z[B]=te,Z[V]=D,V=B;else break e}}function n(Z){return Z.length===0?null:Z[0]}function r(Z){if(Z.length===0)return null;var te=Z[0],V=Z.pop();if(V!==te){Z[0]=V;e:for(var B=0,D=Z.length,U=D>>>1;B<U;){var X=2*(B+1)-1,ee=Z[X],K=X+1,oe=Z[K];if(0>i(ee,V))K<D&&0>i(oe,ee)?(Z[B]=oe,Z[K]=V,B=K):(Z[B]=ee,Z[X]=V,B=X);else if(K<D&&0>i(oe,V))Z[B]=oe,Z[K]=V,B=K;else break e}}return te}function i(Z,te){var V=Z.sortIndex-te.sortIndex;return V!==0?V:Z.id-te.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();t.unstable_now=function(){return o.now()-s}}var u=[],h=[],f=1,g=null,v=3,p=!1,y=!1,_=!1,x=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(Z){for(var te=n(h);te!==null;){if(te.callback===null)r(h);else if(te.startTime<=Z)r(h),te.sortIndex=te.expirationTime,e(u,te);else break;te=n(h)}}function S(Z){if(_=!1,A(Z),!y)if(n(u)!==null)y=!0,ae(k);else{var te=n(h);te!==null&&ie(S,te.startTime-Z)}}function k(Z,te){y=!1,_&&(_=!1,b(M),M=-1),p=!0;var V=v;try{for(A(te),g=n(u);g!==null&&(!(g.expirationTime>te)||Z&&!T());){var B=g.callback;if(typeof B=="function"){g.callback=null,v=g.priorityLevel;var D=B(g.expirationTime<=te);te=t.unstable_now(),typeof D=="function"?g.callback=D:g===n(u)&&r(u),A(te)}else r(u);g=n(u)}if(g!==null)var U=!0;else{var X=n(h);X!==null&&ie(S,X.startTime-te),U=!1}return U}finally{g=null,v=V,p=!1}}var I=!1,O=null,M=-1,F=5,j=-1;function T(){return!(t.unstable_now()-j<F)}function L(){if(O!==null){var Z=t.unstable_now();j=Z;var te=!0;try{te=O(!0,Z)}finally{te?$():(I=!1,O=null)}}else I=!1}var $;if(typeof E=="function")$=function(){E(L)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,J=q.port2;q.port1.onmessage=L,$=function(){J.postMessage(null)}}else $=function(){x(L,0)};function ae(Z){O=Z,I||(I=!0,$())}function ie(Z,te){M=x(function(){Z(t.unstable_now())},te)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(Z){Z.callback=null},t.unstable_continueExecution=function(){y||p||(y=!0,ae(k))},t.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<Z?Math.floor(1e3/Z):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_getFirstCallbackNode=function(){return n(u)},t.unstable_next=function(Z){switch(v){case 1:case 2:case 3:var te=3;break;default:te=v}var V=v;v=te;try{return Z()}finally{v=V}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(Z,te){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var V=v;v=Z;try{return te()}finally{v=V}},t.unstable_scheduleCallback=function(Z,te,V){var B=t.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?B+V:B):V=B,Z){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=V+D,Z={id:f++,callback:te,priorityLevel:Z,startTime:V,expirationTime:D,sortIndex:-1},V>B?(Z.sortIndex=V,e(h,Z),n(u)===null&&Z===n(h)&&(_?(b(M),M=-1):_=!0,ie(S,V-B))):(Z.sortIndex=D,e(u,Z),y||p||(y=!0,ae(k))),Z},t.unstable_shouldYield=T,t.unstable_wrapCallback=function(Z){var te=v;return function(){var V=v;v=te;try{return Z.apply(this,arguments)}finally{v=V}}}})(Tg)),Tg}var i5;function jm(){return i5||(i5=1,Ng.exports=Bx()),Ng.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 a5;function zx(){if(a5)return Ls;a5=1;var t=Pp(),e=jm();function n(l){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+l,w=1;w<arguments.length;w++)c+="&args[]="+encodeURIComponent(arguments[w]);return"Minified React error #"+l+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function a(l,c){o(l,c),o(l+"Capture",c)}function o(l,c){for(i[l]=c,l=0;l<c.length;l++)r.add(c[l])}var s=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,h=/^[: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]*$/,f={},g={};function v(l){return u.call(g,l)?!0:u.call(f,l)?!1:h.test(l)?g[l]=!0:(f[l]=!0,!1)}function p(l,c,w,N){if(w!==null&&w.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return N?!1:w!==null?!w.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function y(l,c,w,N){if(c===null||typeof c>"u"||p(l,c,w,N))return!0;if(N)return!1;if(w!==null)switch(w.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function _(l,c,w,N,G,Q,he){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=N,this.attributeNamespace=G,this.mustUseProperty=w,this.propertyName=l,this.type=c,this.sanitizeURL=Q,this.removeEmptyString=he}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){x[l]=new _(l,0,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var c=l[0];x[c]=new _(c,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){x[l]=new _(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){x[l]=new _(l,2,!1,l,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(l){x[l]=new _(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){x[l]=new _(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){x[l]=new _(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){x[l]=new _(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){x[l]=new _(l,5,!1,l.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function E(l){return l[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(l){var c=l.replace(b,E);x[c]=new _(c,1,!1,l,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(l){var c=l.replace(b,E);x[c]=new _(c,1,!1,l,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(l){var c=l.replace(b,E);x[c]=new _(c,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){x[l]=new _(l,1,!1,l.toLowerCase(),null,!1,!1)}),x.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){x[l]=new _(l,1,!1,l.toLowerCase(),null,!0,!0)});function A(l,c,w,N){var G=x.hasOwnProperty(c)?x[c]:null;(G!==null?G.type!==0:N||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(y(c,w,G,N)&&(w=null),N||G===null?v(c)&&(w===null?l.removeAttribute(c):l.setAttribute(c,""+w)):G.mustUseProperty?l[G.propertyName]=w===null?G.type===3?!1:"":w:(c=G.attributeName,N=G.attributeNamespace,w===null?l.removeAttribute(c):(G=G.type,w=G===3||G===4&&w===!0?"":""+w,N?l.setAttributeNS(N,c,w):l.setAttribute(c,w))))}var S=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,k=Symbol.for("react.element"),I=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),j=Symbol.for("react.provider"),T=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),ie=Symbol.for("react.offscreen"),Z=Symbol.iterator;function te(l){return l===null||typeof l!="object"?null:(l=Z&&l[Z]||l["@@iterator"],typeof l=="function"?l:null)}var V=Object.assign,B;function D(l){if(B===void 0)try{throw Error()}catch(w){var c=w.stack.trim().match(/\n( *(at )?)/);B=c&&c[1]||""}return`
26
+ `+B+l}var U=!1;function X(l,c){if(!l||U)return"";U=!0;var w=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(rt){var N=rt}Reflect.construct(l,[],c)}else{try{c.call()}catch(rt){N=rt}l.call(c.prototype)}else{try{throw Error()}catch(rt){N=rt}l()}}catch(rt){if(rt&&N&&typeof rt.stack=="string"){for(var G=rt.stack.split(`
27
+ `),Q=N.stack.split(`
28
+ `),he=G.length-1,Ie=Q.length-1;1<=he&&0<=Ie&&G[he]!==Q[Ie];)Ie--;for(;1<=he&&0<=Ie;he--,Ie--)if(G[he]!==Q[Ie]){if(he!==1||Ie!==1)do if(he--,Ie--,0>Ie||G[he]!==Q[Ie]){var ze=`
29
+ `+G[he].replace(" at new "," at ");return l.displayName&&ze.includes("<anonymous>")&&(ze=ze.replace("<anonymous>",l.displayName)),ze}while(1<=he&&0<=Ie);break}}}finally{U=!1,Error.prepareStackTrace=w}return(l=l?l.displayName||l.name:"")?D(l):""}function ee(l){switch(l.tag){case 5:return D(l.type);case 16:return D("Lazy");case 13:return D("Suspense");case 19:return D("SuspenseList");case 0:case 2:case 15:return l=X(l.type,!1),l;case 11:return l=X(l.type.render,!1),l;case 1:return l=X(l.type,!0),l;default:return""}}function K(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case O:return"Fragment";case I:return"Portal";case F:return"Profiler";case M:return"StrictMode";case $:return"Suspense";case q:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case T:return(l.displayName||"Context")+".Consumer";case j:return(l._context.displayName||"Context")+".Provider";case L:var c=l.render;return l=l.displayName,l||(l=c.displayName||c.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case J:return c=l.displayName||null,c!==null?c:K(l.type)||"Memo";case ae:c=l._payload,l=l._init;try{return K(l(c))}catch{}}return null}function oe(l){var c=l.type;switch(l.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=c.render,l=l.displayName||l.name||"",c.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return K(c);case 8:return c===M?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function me(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function de(l){var c=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function ye(l){var c=de(l)?"checked":"value",w=Object.getOwnPropertyDescriptor(l.constructor.prototype,c),N=""+l[c];if(!l.hasOwnProperty(c)&&typeof w<"u"&&typeof w.get=="function"&&typeof w.set=="function"){var G=w.get,Q=w.set;return Object.defineProperty(l,c,{configurable:!0,get:function(){return G.call(this)},set:function(he){N=""+he,Q.call(this,he)}}),Object.defineProperty(l,c,{enumerable:w.enumerable}),{getValue:function(){return N},setValue:function(he){N=""+he},stopTracking:function(){l._valueTracker=null,delete l[c]}}}}function Re(l){l._valueTracker||(l._valueTracker=ye(l))}function Oe(l){if(!l)return!1;var c=l._valueTracker;if(!c)return!0;var w=c.getValue(),N="";return l&&(N=de(l)?l.checked?"true":"false":l.value),l=N,l!==w?(c.setValue(l),!0):!1}function Me(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function Ee(l,c){var w=c.checked;return V({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:w??l._wrapperState.initialChecked})}function ge(l,c){var w=c.defaultValue==null?"":c.defaultValue,N=c.checked!=null?c.checked:c.defaultChecked;w=me(c.value!=null?c.value:w),l._wrapperState={initialChecked:N,initialValue:w,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function Te(l,c){c=c.checked,c!=null&&A(l,"checked",c,!1)}function Be(l,c){Te(l,c);var w=me(c.value),N=c.type;if(w!=null)N==="number"?(w===0&&l.value===""||l.value!=w)&&(l.value=""+w):l.value!==""+w&&(l.value=""+w);else if(N==="submit"||N==="reset"){l.removeAttribute("value");return}c.hasOwnProperty("value")?fe(l,c.type,w):c.hasOwnProperty("defaultValue")&&fe(l,c.type,me(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(l.defaultChecked=!!c.defaultChecked)}function Ce(l,c,w){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var N=c.type;if(!(N!=="submit"&&N!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+l._wrapperState.initialValue,w||c===l.value||(l.value=c),l.defaultValue=c}w=l.name,w!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,w!==""&&(l.name=w)}function fe(l,c,w){(c!=="number"||Me(l.ownerDocument)!==l)&&(w==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+w&&(l.defaultValue=""+w))}var Le=Array.isArray;function Ne(l,c,w,N){if(l=l.options,c){c={};for(var G=0;G<w.length;G++)c["$"+w[G]]=!0;for(w=0;w<l.length;w++)G=c.hasOwnProperty("$"+l[w].value),l[w].selected!==G&&(l[w].selected=G),G&&N&&(l[w].defaultSelected=!0)}else{for(w=""+me(w),c=null,G=0;G<l.length;G++){if(l[G].value===w){l[G].selected=!0,N&&(l[G].defaultSelected=!0);return}c!==null||l[G].disabled||(c=l[G])}c!==null&&(c.selected=!0)}}function ue(l,c){if(c.dangerouslySetInnerHTML!=null)throw Error(n(91));return V({},c,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function Ae(l,c){var w=c.value;if(w==null){if(w=c.children,c=c.defaultValue,w!=null){if(c!=null)throw Error(n(92));if(Le(w)){if(1<w.length)throw Error(n(93));w=w[0]}c=w}c==null&&(c=""),w=c}l._wrapperState={initialValue:me(w)}}function Pe(l,c){var w=me(c.value),N=me(c.defaultValue);w!=null&&(w=""+w,w!==l.value&&(l.value=w),c.defaultValue==null&&l.defaultValue!==w&&(l.defaultValue=w)),N!=null&&(l.defaultValue=""+N)}function Ue(l){var c=l.textContent;c===l._wrapperState.initialValue&&c!==""&&c!==null&&(l.value=c)}function st(l){switch(l){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 dt(l,c){return l==null||l==="http://www.w3.org/1999/xhtml"?st(c):l==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var pt,xt=(function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,w,N,G){MSApp.execUnsafeLocalFunction(function(){return l(c,w,N,G)})}:l})(function(l,c){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=c;else{for(pt=pt||document.createElement("div"),pt.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=pt.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;c.firstChild;)l.appendChild(c.firstChild)}});function bt(l,c){if(c){var w=l.firstChild;if(w&&w===l.lastChild&&w.nodeType===3){w.nodeValue=c;return}}l.textContent=c}var kt={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},qn=["Webkit","ms","Moz","O"];Object.keys(kt).forEach(function(l){qn.forEach(function(c){c=c+l.charAt(0).toUpperCase()+l.substring(1),kt[c]=kt[l]})});function xn(l,c,w){return c==null||typeof c=="boolean"||c===""?"":w||typeof c!="number"||c===0||kt.hasOwnProperty(l)&&kt[l]?(""+c).trim():c+"px"}function It(l,c){l=l.style;for(var w in c)if(c.hasOwnProperty(w)){var N=w.indexOf("--")===0,G=xn(w,c[w],N);w==="float"&&(w="cssFloat"),N?l.setProperty(w,G):l[w]=G}}var Jt=V({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 Ve(l,c){if(c){if(Jt[l]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(n(137,l));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(n(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(n(61))}if(c.style!=null&&typeof c.style!="object")throw Error(n(62))}}function qe(l,c){if(l.indexOf("-")===-1)return typeof c.is=="string";switch(l){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 Nt=null;function Ct(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var an=null,Ut=null,Sn=null;function en(l){if(l=wu(l)){if(typeof an!="function")throw Error(n(280));var c=l.stateNode;c&&(c=Ni(c),an(l.stateNode,l.type,c))}}function gn(l){Ut?Sn?Sn.push(l):Sn=[l]:Ut=l}function Bi(){if(Ut){var l=Ut,c=Sn;if(Sn=Ut=null,en(l),c)for(l=0;l<c.length;l++)en(c[l])}}function oi(l,c){return l(c)}function Ei(){}var Sr=!1;function Qt(l,c,w){if(Sr)return l(c,w);Sr=!0;try{return oi(l,c,w)}finally{Sr=!1,(Ut!==null||Sn!==null)&&(Ei(),Bi())}}function ca(l,c){var w=l.stateNode;if(w===null)return null;var N=Ni(w);if(N===null)return null;w=N[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(N=!N.disabled)||(l=l.type,N=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!N;break e;default:l=!1}if(l)return null;if(w&&typeof w!="function")throw Error(n(231,c,typeof w));return w}var Fa=!1;if(s)try{var Kr={};Object.defineProperty(Kr,"passive",{get:function(){Fa=!0}}),window.addEventListener("test",Kr,Kr),window.removeEventListener("test",Kr,Kr)}catch{Fa=!1}function Yi(l,c,w,N,G,Q,he,Ie,ze){var rt=Array.prototype.slice.call(arguments,3);try{c.apply(w,rt)}catch(vt){this.onError(vt)}}var Un=!1,Er=null,Rr=!1,Sa=null,Ho={onError:function(l){Un=!0,Er=l}};function Ea(l,c,w,N,G,Q,he,Ie,ze){Un=!1,Er=null,Yi.apply(Ho,arguments)}function eo(l,c,w,N,G,Q,he,Ie,ze){if(Ea.apply(this,arguments),Un){if(Un){var rt=Er;Un=!1,Er=null}else throw Error(n(198));Rr||(Rr=!0,Sa=rt)}}function si(l){var c=l,w=l;if(l.alternate)for(;c.return;)c=c.return;else{l=c;do c=l,(c.flags&4098)!==0&&(w=c.return),l=c.return;while(l)}return c.tag===3?w:null}function ka(l){if(l.tag===13){var c=l.memoizedState;if(c===null&&(l=l.alternate,l!==null&&(c=l.memoizedState)),c!==null)return c.dehydrated}return null}function Aa(l){if(si(l)!==l)throw Error(n(188))}function $o(l){var c=l.alternate;if(!c){if(c=si(l),c===null)throw Error(n(188));return c!==l?null:l}for(var w=l,N=c;;){var G=w.return;if(G===null)break;var Q=G.alternate;if(Q===null){if(N=G.return,N!==null){w=N;continue}break}if(G.child===Q.child){for(Q=G.child;Q;){if(Q===w)return Aa(G),l;if(Q===N)return Aa(G),c;Q=Q.sibling}throw Error(n(188))}if(w.return!==N.return)w=G,N=Q;else{for(var he=!1,Ie=G.child;Ie;){if(Ie===w){he=!0,w=G,N=Q;break}if(Ie===N){he=!0,N=G,w=Q;break}Ie=Ie.sibling}if(!he){for(Ie=Q.child;Ie;){if(Ie===w){he=!0,w=Q,N=G;break}if(Ie===N){he=!0,N=Q,w=G;break}Ie=Ie.sibling}if(!he)throw Error(n(189))}}if(w.alternate!==N)throw Error(n(190))}if(w.tag!==3)throw Error(n(188));return w.stateNode.current===w?l:c}function zi(l){return l=$o(l),l!==null?to(l):null}function to(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var c=to(l);if(c!==null)return c;l=l.sibling}return null}var Bs=e.unstable_scheduleCallback,is=e.unstable_cancelCallback,lu=e.unstable_shouldYield,Tf=e.unstable_requestPaint,kr=e.unstable_now,uu=e.unstable_getCurrentPriorityLevel,as=e.unstable_ImmediatePriority,Pa=e.unstable_UserBlockingPriority,os=e.unstable_NormalPriority,kc=e.unstable_LowPriority,ll=e.unstable_IdlePriority,_o=null,gi=null;function cr(l){if(gi&&typeof gi.onCommitFiberRoot=="function")try{gi.onCommitFiberRoot(_o,l,void 0,(l.current.flags&128)===128)}catch{}}var En=Math.clz32?Math.clz32:Xi,ss=Math.log,Rn=Math.LN2;function Xi(l){return l>>>=0,l===0?32:31-(ss(l)/Rn|0)|0}var no=64,Ki=4194304;function Mr(l){switch(l&-l){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 l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function Zi(l,c){var w=l.pendingLanes;if(w===0)return 0;var N=0,G=l.suspendedLanes,Q=l.pingedLanes,he=w&268435455;if(he!==0){var Ie=he&~G;Ie!==0?N=Mr(Ie):(Q&=he,Q!==0&&(N=Mr(Q)))}else he=w&~G,he!==0?N=Mr(he):Q!==0&&(N=Mr(Q));if(N===0)return 0;if(c!==0&&c!==N&&(c&G)===0&&(G=N&-N,Q=c&-c,G>=Q||G===16&&(Q&4194240)!==0))return c;if((N&4)!==0&&(N|=w&16),c=l.entangledLanes,c!==0)for(l=l.entanglements,c&=N;0<c;)w=31-En(c),G=1<<w,N|=l[w],c&=~G;return N}function ul(l,c){switch(l){case 1:case 2:case 4:return c+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Zr(l,c){for(var w=l.suspendedLanes,N=l.pingedLanes,G=l.expirationTimes,Q=l.pendingLanes;0<Q;){var he=31-En(Q),Ie=1<<he,ze=G[he];ze===-1?((Ie&w)===0||(Ie&N)!==0)&&(G[he]=ul(Ie,c)):ze<=c&&(l.expiredLanes|=Ie),Q&=~Ie}}function ls(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function Vu(){var l=no;return no<<=1,(no&4194240)===0&&(no=64),l}function Oa(l){for(var c=[],w=0;31>w;w++)c.push(l);return c}function Tl(l,c,w){l.pendingLanes|=c,c!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,c=31-En(c),l[c]=w}function us(l,c){var w=l.pendingLanes&~c;l.pendingLanes=c,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=c,l.mutableReadLanes&=c,l.entangledLanes&=c,c=l.entanglements;var N=l.eventTimes;for(l=l.expirationTimes;0<w;){var G=31-En(w),Q=1<<G;c[G]=0,N[G]=-1,l[G]=-1,w&=~Q}}function cu(l,c){var w=l.entangledLanes|=c;for(l=l.entanglements;w;){var N=31-En(w),G=1<<N;G&c|l[N]&c&&(l[N]|=c),w&=~G}}var Mn=0;function xo(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var cs,cl,Ac,Pc,fl,fs=!1,ro=[],Ba=null,za=null,qa=null,Pt=new Map,hl=new Map,So=[],Oc="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 Cc(l,c){switch(l){case"focusin":case"focusout":Ba=null;break;case"dragenter":case"dragleave":za=null;break;case"mouseover":case"mouseout":qa=null;break;case"pointerover":case"pointerout":Pt.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":hl.delete(c.pointerId)}}function io(l,c,w,N,G,Q){return l===null||l.nativeEvent!==Q?(l={blockedOn:c,domEventName:w,eventSystemFlags:N,nativeEvent:Q,targetContainers:[G]},c!==null&&(c=wu(c),c!==null&&cl(c)),l):(l.eventSystemFlags|=N,c=l.targetContainers,G!==null&&c.indexOf(G)===-1&&c.push(G),l)}function wr(l,c,w,N,G){switch(c){case"focusin":return Ba=io(Ba,l,c,w,N,G),!0;case"dragenter":return za=io(za,l,c,w,N,G),!0;case"mouseover":return qa=io(qa,l,c,w,N,G),!0;case"pointerover":var Q=G.pointerId;return Pt.set(Q,io(Pt.get(Q)||null,l,c,w,N,G)),!0;case"gotpointercapture":return Q=G.pointerId,hl.set(Q,io(hl.get(Q)||null,l,c,w,N,G)),!0}return!1}function fu(l){var c=Ys(l.target);if(c!==null){var w=si(c);if(w!==null){if(c=w.tag,c===13){if(c=ka(w),c!==null){l.blockedOn=c,fl(l.priority,function(){Ac(w)});return}}else if(c===3&&w.stateNode.current.memoizedState.isDehydrated){l.blockedOn=w.tag===3?w.stateNode.containerInfo:null;return}}}l.blockedOn=null}function hu(l){if(l.blockedOn!==null)return!1;for(var c=l.targetContainers;0<c.length;){var w=dl(l.domEventName,l.eventSystemFlags,c[0],l.nativeEvent);if(w===null){w=l.nativeEvent;var N=new w.constructor(w.type,w);Nt=N,w.target.dispatchEvent(N),Nt=null}else return c=wu(w),c!==null&&cl(c),l.blockedOn=w,!1;c.shift()}return!0}function zs(l,c,w){hu(l)&&w.delete(c)}function Yu(){fs=!1,Ba!==null&&hu(Ba)&&(Ba=null),za!==null&&hu(za)&&(za=null),qa!==null&&hu(qa)&&(qa=null),Pt.forEach(zs),hl.forEach(zs)}function Ua(l,c){l.blockedOn===c&&(l.blockedOn=null,fs||(fs=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Yu)))}function ki(l){function c(G){return Ua(G,l)}if(0<ro.length){Ua(ro[0],l);for(var w=1;w<ro.length;w++){var N=ro[w];N.blockedOn===l&&(N.blockedOn=null)}}for(Ba!==null&&Ua(Ba,l),za!==null&&Ua(za,l),qa!==null&&Ua(qa,l),Pt.forEach(c),hl.forEach(c),w=0;w<So.length;w++)N=So[w],N.blockedOn===l&&(N.blockedOn=null);for(;0<So.length&&(w=So[0],w.blockedOn===null);)fu(w),w.blockedOn===null&&So.shift()}var Go=S.ReactCurrentBatchConfig,du=!0;function Ca(l,c,w,N){var G=Mn,Q=Go.transition;Go.transition=null;try{Mn=1,Eo(l,c,w,N)}finally{Mn=G,Go.transition=Q}}function ao(l,c,w,N){var G=Mn,Q=Go.transition;Go.transition=null;try{Mn=4,Eo(l,c,w,N)}finally{Mn=G,Go.transition=Q}}function Eo(l,c,w,N){if(du){var G=dl(l,c,w,N);if(G===null)mu(l,c,N,ko,w),Cc(l,N);else if(wr(G,l,c,w,N))N.stopPropagation();else if(Cc(l,N),c&4&&-1<Oc.indexOf(l)){for(;G!==null;){var Q=wu(G);if(Q!==null&&cs(Q),Q=dl(l,c,w,N),Q===null&&mu(l,c,N,ko,w),Q===G)break;G=Q}G!==null&&N.stopPropagation()}else mu(l,c,N,null,w)}}var ko=null;function dl(l,c,w,N){if(ko=null,l=Ct(N),l=Ys(l),l!==null)if(c=si(l),c===null)l=null;else if(w=c.tag,w===13){if(l=ka(c),l!==null)return l;l=null}else if(w===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;l=null}else c!==l&&(l=null);return ko=l,null}function Rl(l){switch(l){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(uu()){case as:return 1;case Pa:return 4;case os:case kc:return 16;case ll:return 536870912;default:return 16}default:return 16}}var li=null,Ha=null,Ao=null;function pl(){if(Ao)return Ao;var l,c=Ha,w=c.length,N,G="value"in li?li.value:li.textContent,Q=G.length;for(l=0;l<w&&c[l]===G[l];l++);var he=w-l;for(N=1;N<=he&&c[w-N]===G[Q-N];N++);return Ao=G.slice(l,1<N?1-N:void 0)}function La(l){var c=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&c===13&&(l=13)):l=c,l===10&&(l=13),32<=l||l===13?l:0}function Br(){return!0}function fa(){return!1}function Qr(l){function c(w,N,G,Q,he){this._reactName=w,this._targetInst=G,this.type=N,this.nativeEvent=Q,this.target=he,this.currentTarget=null;for(var Ie in l)l.hasOwnProperty(Ie)&&(w=l[Ie],this[Ie]=w?w(Q):Q[Ie]);return this.isDefaultPrevented=(Q.defaultPrevented!=null?Q.defaultPrevented:Q.returnValue===!1)?Br:fa,this.isPropagationStopped=fa,this}return V(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var w=this.nativeEvent;w&&(w.preventDefault?w.preventDefault():typeof w.returnValue!="unknown"&&(w.returnValue=!1),this.isDefaultPrevented=Br)},stopPropagation:function(){var w=this.nativeEvent;w&&(w.stopPropagation?w.stopPropagation():typeof w.cancelBubble!="unknown"&&(w.cancelBubble=!0),this.isPropagationStopped=Br)},persist:function(){},isPersistent:Br}),c}var vi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$a=Qr(vi),H=V({},vi,{view:0,detail:0}),ce=Qr(H),ke,De,Ge,at=V({},H,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Oo,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==Ge&&(Ge&&l.type==="mousemove"?(ke=l.screenX-Ge.screenX,De=l.screenY-Ge.screenY):De=ke=0,Ge=l),ke)},movementY:function(l){return"movementY"in l?l.movementY:De}}),ct=Qr(at),Dt=V({},at,{dataTransfer:0}),jt=Qr(Dt),fn=V({},H,{relatedTarget:0}),hn=Qr(fn),Hn=V({},vi,{animationName:0,elapsedTime:0,pseudoElement:0}),Ar=Qr(Hn),ui=V({},vi,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),or=Qr(ui),mi=V({},vi,{data:0}),_r=Qr(mi),Ai={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Po={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"},Qi={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Lc(l){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(l):(l=Qi[l])?!!c[l]:!1}function Oo(){return Lc}var hs=V({},H,{key:function(l){if(l.key){var c=Ai[l.key]||l.key;if(c!=="Unidentified")return c}return l.type==="keypress"?(l=La(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?Po[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Oo,charCode:function(l){return l.type==="keypress"?La(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?La(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),qs=Qr(hs),gl=V({},at,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),oo=Qr(gl),vl=V({},H,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Oo}),Pi=Qr(vl),ds=V({},vi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Co=Qr(ds),Ml=V({},at,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),Il=Qr(Ml),zr=[9,13,27,32],so=s&&"CompositionEvent"in window,Lo=null;s&&"documentMode"in document&&(Lo=document.documentMode);var Us=s&&"TextEvent"in window&&!Lo,Ir=s&&(!so||Lo&&8<Lo&&11>=Lo),Ga=" ",ml=!1;function jl(l,c){switch(l){case"keyup":return zr.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qi(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Oi=!1;function Na(l,c){switch(l){case"compositionend":return qi(c);case"keypress":return c.which!==32?null:(ml=!0,Ga);case"textInput":return l=c.data,l===Ga&&ml?null:l;default:return null}}function Wa(l,c){if(Oi)return l==="compositionend"||!so&&jl(l,c)?(l=pl(),Ao=Ha=li=null,Oi=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return Ir&&c.locale!=="ko"?null:c.data;default:return null}}var ha={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 Ji(l){var c=l&&l.nodeName&&l.nodeName.toLowerCase();return c==="input"?!!ha[l.type]:c==="textarea"}function No(l,c,w,N){gn(N),c=Dc(c,"onChange"),0<c.length&&(w=new $a("onChange","change",null,w,N),l.push({event:w,listeners:c}))}var ps=null,lo=null;function Jr(l){gu(l,0)}function Wo(l){var c=yi(l);if(Oe(c))return l}function ci(l,c){if(l==="change")return c}var Ta=!1;if(s){var To;if(s){var da="oninput"in document;if(!da){var yl=document.createElement("div");yl.setAttribute("oninput","return;"),da=typeof yl.oninput=="function"}To=da}else To=!1;Ta=To&&(!document.documentMode||9<document.documentMode)}function Vo(){ps&&(ps.detachEvent("onpropertychange",gs),lo=ps=null)}function gs(l){if(l.propertyName==="value"&&Wo(lo)){var c=[];No(c,lo,l,Ct(l)),Qt(Jr,c)}}function vs(l,c,w){l==="focusin"?(Vo(),ps=c,lo=w,ps.attachEvent("onpropertychange",gs)):l==="focusout"&&Vo()}function tr(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return Wo(lo)}function ms(l,c){if(l==="click")return Wo(c)}function ys(l,c){if(l==="input"||l==="change")return Wo(c)}function Hs(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}var Pr=typeof Object.is=="function"?Object.is:Hs;function pa(l,c){if(Pr(l,c))return!0;if(typeof l!="object"||l===null||typeof c!="object"||c===null)return!1;var w=Object.keys(l),N=Object.keys(c);if(w.length!==N.length)return!1;for(N=0;N<w.length;N++){var G=w[N];if(!u.call(c,G)||!Pr(l[G],c[G]))return!1}return!0}function Ln(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function on(l,c){var w=Ln(l);l=0;for(var N;w;){if(w.nodeType===3){if(N=l+w.textContent.length,l<=c&&N>=c)return{node:w,offset:c-l};l=N}e:{for(;w;){if(w.nextSibling){w=w.nextSibling;break e}w=w.parentNode}w=void 0}w=Ln(w)}}function kn(l,c){return l&&c?l===c?!0:l&&l.nodeType===3?!1:c&&c.nodeType===3?kn(l,c.parentNode):"contains"in l?l.contains(c):l.compareDocumentPosition?!!(l.compareDocumentPosition(c)&16):!1:!1}function Nn(){for(var l=window,c=Me();c instanceof l.HTMLIFrameElement;){try{var w=typeof c.contentWindow.location.href=="string"}catch{w=!1}if(w)l=c.contentWindow;else break;c=Me(l.document)}return c}function Va(l){var c=l&&l.nodeName&&l.nodeName.toLowerCase();return c&&(c==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||c==="textarea"||l.contentEditable==="true")}function $s(l){var c=Nn(),w=l.focusedElem,N=l.selectionRange;if(c!==w&&w&&w.ownerDocument&&kn(w.ownerDocument.documentElement,w)){if(N!==null&&Va(w)){if(c=N.start,l=N.end,l===void 0&&(l=c),"selectionStart"in w)w.selectionStart=c,w.selectionEnd=Math.min(l,w.value.length);else if(l=(c=w.ownerDocument||document)&&c.defaultView||window,l.getSelection){l=l.getSelection();var G=w.textContent.length,Q=Math.min(N.start,G);N=N.end===void 0?Q:Math.min(N.end,G),!l.extend&&Q>N&&(G=N,N=Q,Q=G),G=on(w,Q);var he=on(w,N);G&&he&&(l.rangeCount!==1||l.anchorNode!==G.node||l.anchorOffset!==G.offset||l.focusNode!==he.node||l.focusOffset!==he.offset)&&(c=c.createRange(),c.setStart(G.node,G.offset),l.removeAllRanges(),Q>N?(l.addRange(c),l.extend(he.node,he.offset)):(c.setEnd(he.node,he.offset),l.addRange(c)))}}for(c=[],l=w;l=l.parentNode;)l.nodeType===1&&c.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<c.length;w++)l=c[w],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var bs=s&&"documentMode"in document&&11>=document.documentMode,Gs=null,Ci=null,bl=null,pu=!1;function Xu(l,c,w){var N=w.window===w?w.document:w.nodeType===9?w:w.ownerDocument;pu||Gs==null||Gs!==Me(N)||(N=Gs,"selectionStart"in N&&Va(N)?N={start:N.selectionStart,end:N.selectionEnd}:(N=(N.ownerDocument&&N.ownerDocument.defaultView||window).getSelection(),N={anchorNode:N.anchorNode,anchorOffset:N.anchorOffset,focusNode:N.focusNode,focusOffset:N.focusOffset}),bl&&pa(bl,N)||(bl=N,N=Dc(Ci,"onSelect"),0<N.length&&(c=new $a("onSelect","select",null,c,w),l.push({event:c,listeners:N}),c.target=Gs)))}function Ya(l,c){var w={};return w[l.toLowerCase()]=c.toLowerCase(),w["Webkit"+l]="webkit"+c,w["Moz"+l]="moz"+c,w}var Ui={animationend:Ya("Animation","AnimationEnd"),animationiteration:Ya("Animation","AnimationIteration"),animationstart:Ya("Animation","AnimationStart"),transitionend:Ya("Transition","TransitionEnd")},Yo={},Ku={};s&&(Ku=document.createElement("div").style,"AnimationEvent"in window||(delete Ui.animationend.animation,delete Ui.animationiteration.animation,delete Ui.animationstart.animation),"TransitionEvent"in window||delete Ui.transitionend.transition);function Dl(l){if(Yo[l])return Yo[l];if(!Ui[l])return l;var c=Ui[l],w;for(w in c)if(c.hasOwnProperty(w)&&w in Ku)return Yo[l]=c[w];return l}var Nc=Dl("animationend"),Tc=Dl("animationiteration"),Rc=Dl("animationstart"),Mc=Dl("transitionend"),Ic=new Map,jc="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 Xo(l,c){Ic.set(l,c),a(c,[l])}for(var Fl=0;Fl<jc.length;Fl++){var Li=jc[Fl],uo=Li.toLowerCase(),Bl=Li[0].toUpperCase()+Li.slice(1);Xo(uo,"on"+Bl)}Xo(Nc,"onAnimationEnd"),Xo(Tc,"onAnimationIteration"),Xo(Rc,"onAnimationStart"),Xo("dblclick","onDoubleClick"),Xo("focusin","onFocus"),Xo("focusout","onBlur"),Xo(Mc,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ko="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(" "),Rf=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ko));function zl(l,c,w){var N=l.type||"unknown-event";l.currentTarget=w,eo(N,c,void 0,l),l.currentTarget=null}function gu(l,c){c=(c&4)!==0;for(var w=0;w<l.length;w++){var N=l[w],G=N.event;N=N.listeners;e:{var Q=void 0;if(c)for(var he=N.length-1;0<=he;he--){var Ie=N[he],ze=Ie.instance,rt=Ie.currentTarget;if(Ie=Ie.listener,ze!==Q&&G.isPropagationStopped())break e;zl(G,Ie,rt),Q=ze}else for(he=0;he<N.length;he++){if(Ie=N[he],ze=Ie.instance,rt=Ie.currentTarget,Ie=Ie.listener,ze!==Q&&G.isPropagationStopped())break e;zl(G,Ie,rt),Q=ze}}}if(Rr)throw l=Sa,Rr=!1,Sa=null,l}function fr(l,c){var w=c[Ra];w===void 0&&(w=c[Ra]=new Set);var N=l+"__bubble";w.has(N)||(vu(c,l,2,!1),w.add(N))}function Zu(l,c,w){var N=0;c&&(N|=4),vu(w,l,N,c)}var ql="_reactListening"+Math.random().toString(36).slice(2);function Ws(l){if(!l[ql]){l[ql]=!0,r.forEach(function(w){w!=="selectionchange"&&(Rf.has(w)||Zu(w,!1,l),Zu(w,!0,l))});var c=l.nodeType===9?l:l.ownerDocument;c===null||c[ql]||(c[ql]=!0,Zu("selectionchange",!1,c))}}function vu(l,c,w,N){switch(Rl(c)){case 1:var G=Ca;break;case 4:G=ao;break;default:G=Eo}w=G.bind(null,c,w,l),G=void 0,!Fa||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(G=!0),N?G!==void 0?l.addEventListener(c,w,{capture:!0,passive:G}):l.addEventListener(c,w,!0):G!==void 0?l.addEventListener(c,w,{passive:G}):l.addEventListener(c,w,!1)}function mu(l,c,w,N,G){var Q=N;if((c&1)===0&&(c&2)===0&&N!==null)e:for(;;){if(N===null)return;var he=N.tag;if(he===3||he===4){var Ie=N.stateNode.containerInfo;if(Ie===G||Ie.nodeType===8&&Ie.parentNode===G)break;if(he===4)for(he=N.return;he!==null;){var ze=he.tag;if((ze===3||ze===4)&&(ze=he.stateNode.containerInfo,ze===G||ze.nodeType===8&&ze.parentNode===G))return;he=he.return}for(;Ie!==null;){if(he=Ys(Ie),he===null)return;if(ze=he.tag,ze===5||ze===6){N=Q=he;continue e}Ie=Ie.parentNode}}N=N.return}Qt(function(){var rt=Q,vt=Ct(w),yt=[];e:{var gt=Ic.get(l);if(gt!==void 0){var qt=$a,Vt=l;switch(l){case"keypress":if(La(w)===0)break e;case"keydown":case"keyup":qt=qs;break;case"focusin":Vt="focus",qt=hn;break;case"focusout":Vt="blur",qt=hn;break;case"beforeblur":case"afterblur":qt=hn;break;case"click":if(w.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":qt=ct;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":qt=jt;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":qt=Pi;break;case Nc:case Tc:case Rc:qt=Ar;break;case Mc:qt=Co;break;case"scroll":qt=ce;break;case"wheel":qt=Il;break;case"copy":case"cut":case"paste":qt=or;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":qt=oo}var Xt=(c&4)!==0,aa=!Xt&&l==="scroll",et=Xt?gt!==null?gt+"Capture":null:gt;Xt=[];for(var We=rt,tt;We!==null;){tt=We;var _t=tt.stateNode;if(tt.tag===5&&_t!==null&&(tt=_t,et!==null&&(_t=ca(We,et),_t!=null&&Xt.push(yu(We,_t,tt)))),aa)break;We=We.return}0<Xt.length&&(gt=new qt(gt,Vt,null,w,vt),yt.push({event:gt,listeners:Xt}))}}if((c&7)===0){e:{if(gt=l==="mouseover"||l==="pointerover",qt=l==="mouseout"||l==="pointerout",gt&&w!==Nt&&(Vt=w.relatedTarget||w.fromElement)&&(Ys(Vt)||Vt[na]))break e;if((qt||gt)&&(gt=vt.window===vt?vt:(gt=vt.ownerDocument)?gt.defaultView||gt.parentWindow:window,qt?(Vt=w.relatedTarget||w.toElement,qt=rt,Vt=Vt?Ys(Vt):null,Vt!==null&&(aa=si(Vt),Vt!==aa||Vt.tag!==5&&Vt.tag!==6)&&(Vt=null)):(qt=null,Vt=rt),qt!==Vt)){if(Xt=ct,_t="onMouseLeave",et="onMouseEnter",We="mouse",(l==="pointerout"||l==="pointerover")&&(Xt=oo,_t="onPointerLeave",et="onPointerEnter",We="pointer"),aa=qt==null?gt:yi(qt),tt=Vt==null?gt:yi(Vt),gt=new Xt(_t,We+"leave",qt,w,vt),gt.target=aa,gt.relatedTarget=tt,_t=null,Ys(vt)===rt&&(Xt=new Xt(et,We+"enter",Vt,w,vt),Xt.target=tt,Xt.relatedTarget=aa,_t=Xt),aa=_t,qt&&Vt)t:{for(Xt=qt,et=Vt,We=0,tt=Xt;tt;tt=wl(tt))We++;for(tt=0,_t=et;_t;_t=wl(_t))tt++;for(;0<We-tt;)Xt=wl(Xt),We--;for(;0<tt-We;)et=wl(et),tt--;for(;We--;){if(Xt===et||et!==null&&Xt===et.alternate)break t;Xt=wl(Xt),et=wl(et)}Xt=null}else Xt=null;qt!==null&&Oh(yt,gt,qt,Xt,!1),Vt!==null&&aa!==null&&Oh(yt,aa,Vt,Xt,!0)}}e:{if(gt=rt?yi(rt):window,qt=gt.nodeName&&gt.nodeName.toLowerCase(),qt==="select"||qt==="input"&&gt.type==="file")var Kt=ci;else if(Ji(gt))if(Ta)Kt=ys;else{Kt=tr;var un=vs}else(qt=gt.nodeName)&&qt.toLowerCase()==="input"&&(gt.type==="checkbox"||gt.type==="radio")&&(Kt=ms);if(Kt&&(Kt=Kt(l,rt))){No(yt,Kt,w,vt);break e}un&&un(l,gt,rt),l==="focusout"&&(un=gt._wrapperState)&&un.controlled&&gt.type==="number"&&fe(gt,"number",gt.value)}switch(un=rt?yi(rt):window,l){case"focusin":(Ji(un)||un.contentEditable==="true")&&(Gs=un,Ci=rt,bl=null);break;case"focusout":bl=Ci=Gs=null;break;case"mousedown":pu=!0;break;case"contextmenu":case"mouseup":case"dragend":pu=!1,Xu(yt,w,vt);break;case"selectionchange":if(bs)break;case"keydown":case"keyup":Xu(yt,w,vt)}var cn;if(so)e:{switch(l){case"compositionstart":var yn="onCompositionStart";break e;case"compositionend":yn="onCompositionEnd";break e;case"compositionupdate":yn="onCompositionUpdate";break e}yn=void 0}else Oi?jl(l,w)&&(yn="onCompositionEnd"):l==="keydown"&&w.keyCode===229&&(yn="onCompositionStart");yn&&(Ir&&w.locale!=="ko"&&(Oi||yn!=="onCompositionStart"?yn==="onCompositionEnd"&&Oi&&(cn=pl()):(li=vt,Ha="value"in li?li.value:li.textContent,Oi=!0)),un=Dc(rt,yn),0<un.length&&(yn=new _r(yn,l,null,w,vt),yt.push({event:yn,listeners:un}),cn?yn.data=cn:(cn=qi(w),cn!==null&&(yn.data=cn)))),(cn=Us?Na(l,w):Wa(l,w))&&(rt=Dc(rt,"onBeforeInput"),0<rt.length&&(vt=new _r("onBeforeInput","beforeinput",null,w,vt),yt.push({event:vt,listeners:rt}),vt.data=cn))}gu(yt,c)})}function yu(l,c,w){return{instance:l,listener:c,currentTarget:w}}function Dc(l,c){for(var w=c+"Capture",N=[];l!==null;){var G=l,Q=G.stateNode;G.tag===5&&Q!==null&&(G=Q,Q=ca(l,w),Q!=null&&N.unshift(yu(l,Q,G)),Q=ca(l,c),Q!=null&&N.push(yu(l,Q,G))),l=l.return}return N}function wl(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function Oh(l,c,w,N,G){for(var Q=c._reactName,he=[];w!==null&&w!==N;){var Ie=w,ze=Ie.alternate,rt=Ie.stateNode;if(ze!==null&&ze===N)break;Ie.tag===5&&rt!==null&&(Ie=rt,G?(ze=ca(w,Q),ze!=null&&he.unshift(yu(w,ze,Ie))):G||(ze=ca(w,Q),ze!=null&&he.push(yu(w,ze,Ie)))),w=w.return}he.length!==0&&l.push({event:c,listeners:he})}var Pd=/\r\n?/g,Ch=/\u0000|\uFFFD/g;function Mf(l){return(typeof l=="string"?l:""+l).replace(Pd,`
30
+ `).replace(Ch,"")}function Qu(l,c,w){if(c=Mf(c),Mf(l)!==c&&w)throw Error(n(425))}function Vs(){}var Ju=null,Ul=null;function If(l,c){return l==="textarea"||l==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var co=typeof setTimeout=="function"?setTimeout:void 0,Fc=typeof clearTimeout=="function"?clearTimeout:void 0,ec=typeof Promise=="function"?Promise:void 0,Lh=typeof queueMicrotask=="function"?queueMicrotask:typeof ec<"u"?function(l){return ec.resolve(null).then(l).catch(Nh)}:co;function Nh(l){setTimeout(function(){throw l})}function Bc(l,c){var w=c,N=0;do{var G=w.nextSibling;if(l.removeChild(w),G&&G.nodeType===8)if(w=G.data,w==="/$"){if(N===0){l.removeChild(G),ki(c);return}N--}else w!=="$"&&w!=="$?"&&w!=="$!"||N++;w=G}while(w);ki(c)}function ea(l){for(;l!=null;l=l.nextSibling){var c=l.nodeType;if(c===1||c===3)break;if(c===8){if(c=l.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return l}function ta(l){l=l.previousSibling;for(var c=0;l;){if(l.nodeType===8){var w=l.data;if(w==="$"||w==="$!"||w==="$?"){if(c===0)return l;c--}else w==="/$"&&c++}l=l.previousSibling}return null}var ga=Math.random().toString(36).slice(2),Ro="__reactFiber$"+ga,bu="__reactProps$"+ga,na="__reactContainer$"+ga,Ra="__reactEvents$"+ga,Th="__reactListeners$"+ga,Rh="__reactHandles$"+ga;function Ys(l){var c=l[Ro];if(c)return c;for(var w=l.parentNode;w;){if(c=w[na]||w[Ro]){if(w=c.alternate,c.child!==null||w!==null&&w.child!==null)for(l=ta(l);l!==null;){if(w=l[Ro])return w;l=ta(l)}return c}l=w,w=l.parentNode}return null}function wu(l){return l=l[Ro]||l[na],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function yi(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(n(33))}function Ni(l){return l[bu]||null}var zc=[],ws=-1;function Mo(l){return{current:l}}function nr(l){0>ws||(l.current=zc[ws],zc[ws]=null,ws--)}function sr(l,c){ws++,zc[ws]=l.current,l.current=c}var _s={},Hi=Mo(_s),va=Mo(!1),_l=_s;function Hl(l,c){var w=l.type.contextTypes;if(!w)return _s;var N=l.stateNode;if(N&&N.__reactInternalMemoizedUnmaskedChildContext===c)return N.__reactInternalMemoizedMaskedChildContext;var G={},Q;for(Q in w)G[Q]=c[Q];return N&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=c,l.__reactInternalMemoizedMaskedChildContext=G),G}function ma(l){return l=l.childContextTypes,l!=null}function _u(){nr(va),nr(Hi)}function jf(l,c,w){if(Hi.current!==_s)throw Error(n(168));sr(Hi,c),sr(va,w)}function tc(l,c,w){var N=l.stateNode;if(c=c.childContextTypes,typeof N.getChildContext!="function")return w;N=N.getChildContext();for(var G in N)if(!(G in c))throw Error(n(108,oe(l)||"Unknown",G));return V({},w,N)}function xs(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||_s,_l=Hi.current,sr(Hi,l),sr(va,va.current),!0}function Mh(l,c,w){var N=l.stateNode;if(!N)throw Error(n(169));w?(l=tc(l,c,_l),N.__reactInternalMemoizedMergedChildContext=l,nr(va),nr(Hi),sr(Hi,l)):nr(va),sr(va,w)}var Ss=null,$l=!1,P=!1;function R(l){Ss===null?Ss=[l]:Ss.push(l)}function Y(l){$l=!0,R(l)}function ne(){if(!P&&Ss!==null){P=!0;var l=0,c=Mn;try{var w=Ss;for(Mn=1;l<w.length;l++){var N=w[l];do N=N(!0);while(N!==null)}Ss=null,$l=!1}catch(G){throw Ss!==null&&(Ss=Ss.slice(l+1)),Bs(as,ne),G}finally{Mn=c,P=!1}}return null}var le=[],pe=0,ve=null,be=0,we=[],Se=0,Fe=null,Je=1,xe="";function $e(l,c){le[pe++]=be,le[pe++]=ve,ve=l,be=c}function Qe(l,c,w){we[Se++]=Je,we[Se++]=xe,we[Se++]=Fe,Fe=l;var N=Je;l=xe;var G=32-En(N)-1;N&=~(1<<G),w+=1;var Q=32-En(c)+G;if(30<Q){var he=G-G%5;Q=(N&(1<<he)-1).toString(32),N>>=he,G-=he,Je=1<<32-En(c)+G|w<<G|N,xe=Q+l}else Je=1<<Q|w<<G|N,xe=l}function lt(l){l.return!==null&&($e(l,1),Qe(l,1,0))}function Xe(l){for(;l===ve;)ve=le[--pe],le[pe]=null,be=le[--pe],le[pe]=null;for(;l===Fe;)Fe=we[--Se],we[Se]=null,xe=we[--Se],we[Se]=null,Je=we[--Se],we[Se]=null}var ot=null,He=null,ft=!1,ht=null;function Wt(l,c){var w=kl(5,null,null,0);w.elementType="DELETED",w.stateNode=c,w.return=l,c=l.deletions,c===null?(l.deletions=[w],l.flags|=16):c.push(w)}function Bt(l,c){switch(l.tag){case 5:var w=l.type;return c=c.nodeType!==1||w.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(l.stateNode=c,ot=l,He=ea(c.firstChild),!0):!1;case 6:return c=l.pendingProps===""||c.nodeType!==3?null:c,c!==null?(l.stateNode=c,ot=l,He=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(w=Fe!==null?{id:Je,overflow:xe}:null,l.memoizedState={dehydrated:c,treeContext:w,retryLane:1073741824},w=kl(18,null,null,0),w.stateNode=c,w.return=l,l.child=w,ot=l,He=null,!0):!1;default:return!1}}function dn(l){return(l.mode&1)!==0&&(l.flags&128)===0}function zt(l){if(ft){var c=He;if(c){var w=c;if(!Bt(l,c)){if(dn(l))throw Error(n(418));c=ea(w.nextSibling);var N=ot;c&&Bt(l,c)?Wt(N,w):(l.flags=l.flags&-4097|2,ft=!1,ot=l)}}else{if(dn(l))throw Error(n(418));l.flags=l.flags&-4097|2,ft=!1,ot=l}}}function On(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;ot=l}function qr(l){if(l!==ot)return!1;if(!ft)return On(l),ft=!0,!1;var c;if((c=l.tag!==3)&&!(c=l.tag!==5)&&(c=l.type,c=c!=="head"&&c!=="body"&&!If(l.type,l.memoizedProps)),c&&(c=He)){if(dn(l))throw mn(),Error(n(418));for(;c;)Wt(l,c),c=ea(c.nextSibling)}if(On(l),l.tag===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(n(317));e:{for(l=l.nextSibling,c=0;l;){if(l.nodeType===8){var w=l.data;if(w==="/$"){if(c===0){He=ea(l.nextSibling);break e}c--}else w!=="$"&&w!=="$!"&&w!=="$?"||c++}l=l.nextSibling}He=null}}else He=ot?ea(l.stateNode.nextSibling):null;return!0}function mn(){for(var l=He;l;)l=ea(l.nextSibling)}function Ft(){He=ot=null,ft=!1}function St(l){ht===null?ht=[l]:ht.push(l)}var Ur=S.ReactCurrentBatchConfig;function Ht(l,c,w){if(l=w.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(w._owner){if(w=w._owner,w){if(w.tag!==1)throw Error(n(309));var N=w.stateNode}if(!N)throw Error(n(147,l));var G=N,Q=""+l;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===Q?c.ref:(c=function(he){var Ie=G.refs;he===null?delete Ie[Q]:Ie[Q]=he},c._stringRef=Q,c)}if(typeof l!="string")throw Error(n(284));if(!w._owner)throw Error(n(290,l))}return l}function pn(l,c){throw l=Object.prototype.toString.call(c),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":l))}function In(l){var c=l._init;return c(l._payload)}function bi(l){function c(et,We){if(l){var tt=et.deletions;tt===null?(et.deletions=[We],et.flags|=16):tt.push(We)}}function w(et,We){if(!l)return null;for(;We!==null;)c(et,We),We=We.sibling;return null}function N(et,We){for(et=new Map;We!==null;)We.key!==null?et.set(We.key,We):et.set(We.index,We),We=We.sibling;return et}function G(et,We){return et=ef(et,We),et.index=0,et.sibling=null,et}function Q(et,We,tt){return et.index=tt,l?(tt=et.alternate,tt!==null?(tt=tt.index,tt<We?(et.flags|=2,We):tt):(et.flags|=2,We)):(et.flags|=1048576,We)}function he(et){return l&&et.alternate===null&&(et.flags|=2),et}function Ie(et,We,tt,_t){return We===null||We.tag!==6?(We=Sg(tt,et.mode,_t),We.return=et,We):(We=G(We,tt),We.return=et,We)}function ze(et,We,tt,_t){var Kt=tt.type;return Kt===O?vt(et,We,tt.props.children,_t,tt.key):We!==null&&(We.elementType===Kt||typeof Kt=="object"&&Kt!==null&&Kt.$$typeof===ae&&In(Kt)===We.type)?(_t=G(We,tt.props),_t.ref=Ht(et,We,tt),_t.return=et,_t):(_t=a1(tt.type,tt.key,tt.props,null,et.mode,_t),_t.ref=Ht(et,We,tt),_t.return=et,_t)}function rt(et,We,tt,_t){return We===null||We.tag!==4||We.stateNode.containerInfo!==tt.containerInfo||We.stateNode.implementation!==tt.implementation?(We=Eg(tt,et.mode,_t),We.return=et,We):(We=G(We,tt.children||[]),We.return=et,We)}function vt(et,We,tt,_t,Kt){return We===null||We.tag!==7?(We=Hf(tt,et.mode,_t,Kt),We.return=et,We):(We=G(We,tt),We.return=et,We)}function yt(et,We,tt){if(typeof We=="string"&&We!==""||typeof We=="number")return We=Sg(""+We,et.mode,tt),We.return=et,We;if(typeof We=="object"&&We!==null){switch(We.$$typeof){case k:return tt=a1(We.type,We.key,We.props,null,et.mode,tt),tt.ref=Ht(et,null,We),tt.return=et,tt;case I:return We=Eg(We,et.mode,tt),We.return=et,We;case ae:var _t=We._init;return yt(et,_t(We._payload),tt)}if(Le(We)||te(We))return We=Hf(We,et.mode,tt,null),We.return=et,We;pn(et,We)}return null}function gt(et,We,tt,_t){var Kt=We!==null?We.key:null;if(typeof tt=="string"&&tt!==""||typeof tt=="number")return Kt!==null?null:Ie(et,We,""+tt,_t);if(typeof tt=="object"&&tt!==null){switch(tt.$$typeof){case k:return tt.key===Kt?ze(et,We,tt,_t):null;case I:return tt.key===Kt?rt(et,We,tt,_t):null;case ae:return Kt=tt._init,gt(et,We,Kt(tt._payload),_t)}if(Le(tt)||te(tt))return Kt!==null?null:vt(et,We,tt,_t,null);pn(et,tt)}return null}function qt(et,We,tt,_t,Kt){if(typeof _t=="string"&&_t!==""||typeof _t=="number")return et=et.get(tt)||null,Ie(We,et,""+_t,Kt);if(typeof _t=="object"&&_t!==null){switch(_t.$$typeof){case k:return et=et.get(_t.key===null?tt:_t.key)||null,ze(We,et,_t,Kt);case I:return et=et.get(_t.key===null?tt:_t.key)||null,rt(We,et,_t,Kt);case ae:var un=_t._init;return qt(et,We,tt,un(_t._payload),Kt)}if(Le(_t)||te(_t))return et=et.get(tt)||null,vt(We,et,_t,Kt,null);pn(We,_t)}return null}function Vt(et,We,tt,_t){for(var Kt=null,un=null,cn=We,yn=We=0,Qa=null;cn!==null&&yn<tt.length;yn++){cn.index>yn?(Qa=cn,cn=null):Qa=cn.sibling;var pr=gt(et,cn,tt[yn],_t);if(pr===null){cn===null&&(cn=Qa);break}l&&cn&&pr.alternate===null&&c(et,cn),We=Q(pr,We,yn),un===null?Kt=pr:un.sibling=pr,un=pr,cn=Qa}if(yn===tt.length)return w(et,cn),ft&&$e(et,yn),Kt;if(cn===null){for(;yn<tt.length;yn++)cn=yt(et,tt[yn],_t),cn!==null&&(We=Q(cn,We,yn),un===null?Kt=cn:un.sibling=cn,un=cn);return ft&&$e(et,yn),Kt}for(cn=N(et,cn);yn<tt.length;yn++)Qa=qt(cn,et,yn,tt[yn],_t),Qa!==null&&(l&&Qa.alternate!==null&&cn.delete(Qa.key===null?yn:Qa.key),We=Q(Qa,We,yn),un===null?Kt=Qa:un.sibling=Qa,un=Qa);return l&&cn.forEach(function(tf){return c(et,tf)}),ft&&$e(et,yn),Kt}function Xt(et,We,tt,_t){var Kt=te(tt);if(typeof Kt!="function")throw Error(n(150));if(tt=Kt.call(tt),tt==null)throw Error(n(151));for(var un=Kt=null,cn=We,yn=We=0,Qa=null,pr=tt.next();cn!==null&&!pr.done;yn++,pr=tt.next()){cn.index>yn?(Qa=cn,cn=null):Qa=cn.sibling;var tf=gt(et,cn,pr.value,_t);if(tf===null){cn===null&&(cn=Qa);break}l&&cn&&tf.alternate===null&&c(et,cn),We=Q(tf,We,yn),un===null?Kt=tf:un.sibling=tf,un=tf,cn=Qa}if(pr.done)return w(et,cn),ft&&$e(et,yn),Kt;if(cn===null){for(;!pr.done;yn++,pr=tt.next())pr=yt(et,pr.value,_t),pr!==null&&(We=Q(pr,We,yn),un===null?Kt=pr:un.sibling=pr,un=pr);return ft&&$e(et,yn),Kt}for(cn=N(et,cn);!pr.done;yn++,pr=tt.next())pr=qt(cn,et,yn,pr.value,_t),pr!==null&&(l&&pr.alternate!==null&&cn.delete(pr.key===null?yn:pr.key),We=Q(pr,We,yn),un===null?Kt=pr:un.sibling=pr,un=pr);return l&&cn.forEach(function(jx){return c(et,jx)}),ft&&$e(et,yn),Kt}function aa(et,We,tt,_t){if(typeof tt=="object"&&tt!==null&&tt.type===O&&tt.key===null&&(tt=tt.props.children),typeof tt=="object"&&tt!==null){switch(tt.$$typeof){case k:e:{for(var Kt=tt.key,un=We;un!==null;){if(un.key===Kt){if(Kt=tt.type,Kt===O){if(un.tag===7){w(et,un.sibling),We=G(un,tt.props.children),We.return=et,et=We;break e}}else if(un.elementType===Kt||typeof Kt=="object"&&Kt!==null&&Kt.$$typeof===ae&&In(Kt)===un.type){w(et,un.sibling),We=G(un,tt.props),We.ref=Ht(et,un,tt),We.return=et,et=We;break e}w(et,un);break}else c(et,un);un=un.sibling}tt.type===O?(We=Hf(tt.props.children,et.mode,_t,tt.key),We.return=et,et=We):(_t=a1(tt.type,tt.key,tt.props,null,et.mode,_t),_t.ref=Ht(et,We,tt),_t.return=et,et=_t)}return he(et);case I:e:{for(un=tt.key;We!==null;){if(We.key===un)if(We.tag===4&&We.stateNode.containerInfo===tt.containerInfo&&We.stateNode.implementation===tt.implementation){w(et,We.sibling),We=G(We,tt.children||[]),We.return=et,et=We;break e}else{w(et,We);break}else c(et,We);We=We.sibling}We=Eg(tt,et.mode,_t),We.return=et,et=We}return he(et);case ae:return un=tt._init,aa(et,We,un(tt._payload),_t)}if(Le(tt))return Vt(et,We,tt,_t);if(te(tt))return Xt(et,We,tt,_t);pn(et,tt)}return typeof tt=="string"&&tt!==""||typeof tt=="number"?(tt=""+tt,We!==null&&We.tag===6?(w(et,We.sibling),We=G(We,tt),We.return=et,et=We):(w(et,We),We=Sg(tt,et.mode,_t),We.return=et,et=We),he(et)):w(et,We)}return aa}var fi=bi(!0),$n=bi(!1),wi=Mo(null),vr=null,jr=null,Tn=null;function Wn(){Tn=jr=vr=null}function Or(l){var c=wi.current;nr(wi),l._currentValue=c}function Vn(l,c,w){for(;l!==null;){var N=l.alternate;if((l.childLanes&c)!==c?(l.childLanes|=c,N!==null&&(N.childLanes|=c)):N!==null&&(N.childLanes&c)!==c&&(N.childLanes|=c),l===w)break;l=l.return}}function Cr(l,c){vr=l,Tn=jr=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&c)!==0&&(re=!0),l.firstContext=null)}function Lr(l){var c=l._currentValue;if(Tn!==l)if(l={context:l,memoizedValue:c,next:null},jr===null){if(vr===null)throw Error(n(308));jr=l,vr.dependencies={lanes:0,firstContext:l}}else jr=jr.next=l;return c}var rr=null;function Ti(l){rr===null?rr=[l]:rr.push(l)}function Zn(l,c,w,N){var G=c.interleaved;return G===null?(w.next=w,Ti(c)):(w.next=G.next,G.next=w),c.interleaved=w,Qn(l,N)}function Qn(l,c){l.lanes|=c;var w=l.alternate;for(w!==null&&(w.lanes|=c),w=l,l=l.return;l!==null;)l.childLanes|=c,w=l.alternate,w!==null&&(w.childLanes|=c),w=l,l=l.return;return w.tag===3?w.stateNode:null}var ei=!1;function Ri(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ya(l,c){l=l.updateQueue,c.updateQueue===l&&(c.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function ti(l,c){return{eventTime:l,lane:c,tag:0,payload:null,callback:null,next:null}}function Hr(l,c,w){var N=l.updateQueue;if(N===null)return null;if(N=N.shared,(ur&2)!==0){var G=N.pending;return G===null?c.next=c:(c.next=G.next,G.next=c),N.pending=c,Qn(l,w)}return G=N.interleaved,G===null?(c.next=c,Ti(N)):(c.next=G.next,G.next=c),N.interleaved=c,Qn(l,w)}function ba(l,c,w){if(c=c.updateQueue,c!==null&&(c=c.shared,(w&4194240)!==0)){var N=c.lanes;N&=l.pendingLanes,w|=N,c.lanes=w,cu(l,w)}}function ir(l,c){var w=l.updateQueue,N=l.alternate;if(N!==null&&(N=N.updateQueue,w===N)){var G=null,Q=null;if(w=w.firstBaseUpdate,w!==null){do{var he={eventTime:w.eventTime,lane:w.lane,tag:w.tag,payload:w.payload,callback:w.callback,next:null};Q===null?G=Q=he:Q=Q.next=he,w=w.next}while(w!==null);Q===null?G=Q=c:Q=Q.next=c}else G=Q=c;w={baseState:N.baseState,firstBaseUpdate:G,lastBaseUpdate:Q,shared:N.shared,effects:N.effects},l.updateQueue=w;return}l=w.lastBaseUpdate,l===null?w.firstBaseUpdate=c:l.next=c,w.lastBaseUpdate=c}function $i(l,c,w,N){var G=l.updateQueue;ei=!1;var Q=G.firstBaseUpdate,he=G.lastBaseUpdate,Ie=G.shared.pending;if(Ie!==null){G.shared.pending=null;var ze=Ie,rt=ze.next;ze.next=null,he===null?Q=rt:he.next=rt,he=ze;var vt=l.alternate;vt!==null&&(vt=vt.updateQueue,Ie=vt.lastBaseUpdate,Ie!==he&&(Ie===null?vt.firstBaseUpdate=rt:Ie.next=rt,vt.lastBaseUpdate=ze))}if(Q!==null){var yt=G.baseState;he=0,vt=rt=ze=null,Ie=Q;do{var gt=Ie.lane,qt=Ie.eventTime;if((N&gt)===gt){vt!==null&&(vt=vt.next={eventTime:qt,lane:0,tag:Ie.tag,payload:Ie.payload,callback:Ie.callback,next:null});e:{var Vt=l,Xt=Ie;switch(gt=c,qt=w,Xt.tag){case 1:if(Vt=Xt.payload,typeof Vt=="function"){yt=Vt.call(qt,yt,gt);break e}yt=Vt;break e;case 3:Vt.flags=Vt.flags&-65537|128;case 0:if(Vt=Xt.payload,gt=typeof Vt=="function"?Vt.call(qt,yt,gt):Vt,gt==null)break e;yt=V({},yt,gt);break e;case 2:ei=!0}}Ie.callback!==null&&Ie.lane!==0&&(l.flags|=64,gt=G.effects,gt===null?G.effects=[Ie]:gt.push(Ie))}else qt={eventTime:qt,lane:gt,tag:Ie.tag,payload:Ie.payload,callback:Ie.callback,next:null},vt===null?(rt=vt=qt,ze=yt):vt=vt.next=qt,he|=gt;if(Ie=Ie.next,Ie===null){if(Ie=G.shared.pending,Ie===null)break;gt=Ie,Ie=gt.next,gt.next=null,G.lastBaseUpdate=gt,G.shared.pending=null}}while(!0);if(vt===null&&(ze=yt),G.baseState=ze,G.firstBaseUpdate=rt,G.lastBaseUpdate=vt,c=G.shared.interleaved,c!==null){G=c;do he|=G.lane,G=G.next;while(G!==c)}else Q===null&&(G.shared.lanes=0);Bf|=he,l.lanes=he,l.memoizedState=yt}}function Yn(l,c,w){if(l=c.effects,c.effects=null,l!==null)for(c=0;c<l.length;c++){var N=l[c],G=N.callback;if(G!==null){if(N.callback=null,N=w,typeof G!="function")throw Error(n(191,G));G.call(N)}}}var ln={},jn=Mo(ln),An=Mo(ln),Dr=Mo(ln);function hi(l){if(l===ln)throw Error(n(174));return l}function Zo(l,c){switch(sr(Dr,c),sr(An,l),sr(jn,ln),l=c.nodeType,l){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:dt(null,"");break;default:l=l===8?c.parentNode:c,c=l.namespaceURI||null,l=l.tagName,c=dt(c,l)}nr(jn),sr(jn,c)}function hr(){nr(jn),nr(An),nr(Dr)}function xu(l){hi(Dr.current);var c=hi(jn.current),w=dt(c,l.type);c!==w&&(sr(An,l),sr(jn,w))}function Xs(l){An.current===l&&(nr(jn),nr(An))}var dr=Mo(0);function fo(l){for(var c=l;c!==null;){if(c.tag===13){var w=c.memoizedState;if(w!==null&&(w=w.dehydrated,w===null||w.data==="$?"||w.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var Gl=[];function wa(){for(var l=0;l<Gl.length;l++)Gl[l]._workInProgressVersionPrimary=null;Gl.length=0}var Su=S.ReactCurrentDispatcher,Eu=S.ReactCurrentBatchConfig,Gi=0,lr=null,$r=null,Gr=null,ho=!1,Io=!1,po=0,qc=0;function Wr(){throw Error(n(321))}function ku(l,c){if(c===null)return!1;for(var w=0;w<c.length&&w<l.length;w++)if(!Pr(l[w],c[w]))return!1;return!0}function xl(l,c,w,N,G,Q){if(Gi=Q,lr=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Su.current=l===null||l.memoizedState===null?ig:Pu,l=w(N,G),Io){Q=0;do{if(Io=!1,po=0,25<=Q)throw Error(n(301));Q+=1,Gr=$r=null,c.updateQueue=null,Su.current=jh,l=w(N,G)}while(Io)}if(Su.current=Gc,c=$r!==null&&$r.next!==null,Gi=0,Gr=$r=lr=null,ho=!1,c)throw Error(n(300));return l}function go(){var l=po!==0;return po=0,l}function xr(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Gr===null?lr.memoizedState=Gr=l:Gr=Gr.next=l,Gr}function _i(){if($r===null){var l=lr.alternate;l=l!==null?l.memoizedState:null}else l=$r.next;var c=Gr===null?lr.memoizedState:Gr.next;if(c!==null)Gr=c,$r=l;else{if(l===null)throw Error(n(310));$r=l,l={memoizedState:$r.memoizedState,baseState:$r.baseState,baseQueue:$r.baseQueue,queue:$r.queue,next:null},Gr===null?lr.memoizedState=Gr=l:Gr=Gr.next=l}return Gr}function _a(l,c){return typeof c=="function"?c(l):c}function ra(l){var c=_i(),w=c.queue;if(w===null)throw Error(n(311));w.lastRenderedReducer=l;var N=$r,G=N.baseQueue,Q=w.pending;if(Q!==null){if(G!==null){var he=G.next;G.next=Q.next,Q.next=he}N.baseQueue=G=Q,w.pending=null}if(G!==null){Q=G.next,N=N.baseState;var Ie=he=null,ze=null,rt=Q;do{var vt=rt.lane;if((Gi&vt)===vt)ze!==null&&(ze=ze.next={lane:0,action:rt.action,hasEagerState:rt.hasEagerState,eagerState:rt.eagerState,next:null}),N=rt.hasEagerState?rt.eagerState:l(N,rt.action);else{var yt={lane:vt,action:rt.action,hasEagerState:rt.hasEagerState,eagerState:rt.eagerState,next:null};ze===null?(Ie=ze=yt,he=N):ze=ze.next=yt,lr.lanes|=vt,Bf|=vt}rt=rt.next}while(rt!==null&&rt!==Q);ze===null?he=N:ze.next=Ie,Pr(N,c.memoizedState)||(re=!0),c.memoizedState=N,c.baseState=he,c.baseQueue=ze,w.lastRenderedState=N}if(l=w.interleaved,l!==null){G=l;do Q=G.lane,lr.lanes|=Q,Bf|=Q,G=G.next;while(G!==l)}else G===null&&(w.lanes=0);return[c.memoizedState,w.dispatch]}function Ks(l){var c=_i(),w=c.queue;if(w===null)throw Error(n(311));w.lastRenderedReducer=l;var N=w.dispatch,G=w.pending,Q=c.memoizedState;if(G!==null){w.pending=null;var he=G=G.next;do Q=l(Q,he.action),he=he.next;while(he!==G);Pr(Q,c.memoizedState)||(re=!0),c.memoizedState=Q,c.baseQueue===null&&(c.baseState=Q),w.lastRenderedState=Q}return[Q,N]}function Uc(){}function nc(l,c){var w=lr,N=_i(),G=c(),Q=!Pr(N.memoizedState,G);if(Q&&(N.memoizedState=G,re=!0),N=N.queue,$c(Df.bind(null,w,N,l),[l]),N.getSnapshot!==c||Q||Gr!==null&&Gr.memoizedState.tag&1){if(w.flags|=2048,Xa(9,Es.bind(null,w,N,G,c),void 0,null),Za===null)throw Error(n(349));(Gi&30)!==0||Ih(w,c,G)}return G}function Ih(l,c,w){l.flags|=16384,l={getSnapshot:c,value:w},c=lr.updateQueue,c===null?(c={lastEffect:null,stores:null},lr.updateQueue=c,c.stores=[l]):(w=c.stores,w===null?c.stores=[l]:w.push(l))}function Es(l,c,w,N){c.value=w,c.getSnapshot=N,Wl(c)&&Au(l)}function Df(l,c,w){return w(function(){Wl(c)&&Au(l)})}function Wl(l){var c=l.getSnapshot;l=l.value;try{var w=c();return!Pr(l,w)}catch{return!0}}function Au(l){var c=Qn(l,1);c!==null&&Kl(c,l,1,-1)}function Qo(l){var c=xr();return typeof l=="function"&&(l=l()),c.memoizedState=c.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:_a,lastRenderedState:l},c.queue=l,l=l.dispatch=Gp.bind(null,lr,l),[c.memoizedState,l]}function Xa(l,c,w,N){return l={tag:l,create:c,destroy:w,deps:N,next:null},c=lr.updateQueue,c===null?(c={lastEffect:null,stores:null},lr.updateQueue=c,c.lastEffect=l.next=l):(w=c.lastEffect,w===null?c.lastEffect=l.next=l:(N=w.next,w.next=l,l.next=N,c.lastEffect=l)),l}function ks(){return _i().memoizedState}function vo(l,c,w,N){var G=xr();lr.flags|=l,G.memoizedState=Xa(1|c,w,void 0,N===void 0?null:N)}function As(l,c,w,N){var G=_i();N=N===void 0?null:N;var Q=void 0;if($r!==null){var he=$r.memoizedState;if(Q=he.destroy,N!==null&&ku(N,he.deps)){G.memoizedState=Xa(c,w,Q,N);return}}lr.flags|=l,G.memoizedState=Xa(1|c,w,Q,N)}function Hc(l,c){return vo(8390656,8,l,c)}function $c(l,c){return As(2048,8,l,c)}function Ff(l,c){return As(4,2,l,c)}function rc(l,c){return As(4,4,l,c)}function Ps(l,c){if(typeof c=="function")return l=l(),c(l),function(){c(null)};if(c!=null)return l=l(),c.current=l,function(){c.current=null}}function qp(l,c,w){return w=w!=null?w.concat([l]):null,As(4,4,Ps.bind(null,c,l),w)}function Vl(){}function Od(l,c){var w=_i();c=c===void 0?null:c;var N=w.memoizedState;return N!==null&&c!==null&&ku(c,N[1])?N[0]:(w.memoizedState=[l,c],l)}function Vr(l,c){var w=_i();c=c===void 0?null:c;var N=w.memoizedState;return N!==null&&c!==null&&ku(c,N[1])?N[0]:(l=l(),w.memoizedState=[l,c],l)}function Up(l,c,w){return(Gi&21)===0?(l.baseState&&(l.baseState=!1,re=!0),l.memoizedState=w):(Pr(w,c)||(w=Vu(),lr.lanes|=w,Bf|=w,l.baseState=!0),c)}function Hp(l,c){var w=Mn;Mn=w!==0&&4>w?w:4,l(!0);var N=Eu.transition;Eu.transition={};try{l(!1),c()}finally{Mn=w,Eu.transition=N}}function $p(){return _i().memoizedState}function rg(l,c,w){var N=Qc(l);if(w={lane:N,action:w,hasEagerState:!1,eagerState:null,next:null},Cd(l))Wp(c,w);else if(w=Zn(l,c,w,N),w!==null){var G=es();Kl(w,l,N,G),Jo(w,c,N)}}function Gp(l,c,w){var N=Qc(l),G={lane:N,action:w,hasEagerState:!1,eagerState:null,next:null};if(Cd(l))Wp(c,G);else{var Q=l.alternate;if(l.lanes===0&&(Q===null||Q.lanes===0)&&(Q=c.lastRenderedReducer,Q!==null))try{var he=c.lastRenderedState,Ie=Q(he,w);if(G.hasEagerState=!0,G.eagerState=Ie,Pr(Ie,he)){var ze=c.interleaved;ze===null?(G.next=G,Ti(c)):(G.next=ze.next,ze.next=G),c.interleaved=G;return}}catch{}finally{}w=Zn(l,c,G,N),w!==null&&(G=es(),Kl(w,l,N,G),Jo(w,c,N))}}function Cd(l){var c=l.alternate;return l===lr||c!==null&&c===lr}function Wp(l,c){Io=ho=!0;var w=l.pending;w===null?c.next=c:(c.next=w.next,w.next=c),l.pending=c}function Jo(l,c,w){if((w&4194240)!==0){var N=c.lanes;N&=l.pendingLanes,w|=N,c.lanes=w,cu(l,w)}}var Gc={readContext:Lr,useCallback:Wr,useContext:Wr,useEffect:Wr,useImperativeHandle:Wr,useInsertionEffect:Wr,useLayoutEffect:Wr,useMemo:Wr,useReducer:Wr,useRef:Wr,useState:Wr,useDebugValue:Wr,useDeferredValue:Wr,useTransition:Wr,useMutableSource:Wr,useSyncExternalStore:Wr,useId:Wr,unstable_isNewReconciler:!1},ig={readContext:Lr,useCallback:function(l,c){return xr().memoizedState=[l,c===void 0?null:c],l},useContext:Lr,useEffect:Hc,useImperativeHandle:function(l,c,w){return w=w!=null?w.concat([l]):null,vo(4194308,4,Ps.bind(null,c,l),w)},useLayoutEffect:function(l,c){return vo(4194308,4,l,c)},useInsertionEffect:function(l,c){return vo(4,2,l,c)},useMemo:function(l,c){var w=xr();return c=c===void 0?null:c,l=l(),w.memoizedState=[l,c],l},useReducer:function(l,c,w){var N=xr();return c=w!==void 0?w(c):c,N.memoizedState=N.baseState=c,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:c},N.queue=l,l=l.dispatch=rg.bind(null,lr,l),[N.memoizedState,l]},useRef:function(l){var c=xr();return l={current:l},c.memoizedState=l},useState:Qo,useDebugValue:Vl,useDeferredValue:function(l){return xr().memoizedState=l},useTransition:function(){var l=Qo(!1),c=l[0];return l=Hp.bind(null,l[1]),xr().memoizedState=l,[c,l]},useMutableSource:function(){},useSyncExternalStore:function(l,c,w){var N=lr,G=xr();if(ft){if(w===void 0)throw Error(n(407));w=w()}else{if(w=c(),Za===null)throw Error(n(349));(Gi&30)!==0||Ih(N,c,w)}G.memoizedState=w;var Q={value:w,getSnapshot:c};return G.queue=Q,Hc(Df.bind(null,N,Q,l),[l]),N.flags|=2048,Xa(9,Es.bind(null,N,Q,w,c),void 0,null),w},useId:function(){var l=xr(),c=Za.identifierPrefix;if(ft){var w=xe,N=Je;w=(N&~(1<<32-En(N)-1)).toString(32)+w,c=":"+c+"R"+w,w=po++,0<w&&(c+="H"+w.toString(32)),c+=":"}else w=qc++,c=":"+c+"r"+w.toString(32)+":";return l.memoizedState=c},unstable_isNewReconciler:!1},Pu={readContext:Lr,useCallback:Od,useContext:Lr,useEffect:$c,useImperativeHandle:qp,useInsertionEffect:Ff,useLayoutEffect:rc,useMemo:Vr,useReducer:ra,useRef:ks,useState:function(){return ra(_a)},useDebugValue:Vl,useDeferredValue:function(l){var c=_i();return Up(c,$r.memoizedState,l)},useTransition:function(){var l=ra(_a)[0],c=_i().memoizedState;return[l,c]},useMutableSource:Uc,useSyncExternalStore:nc,useId:$p,unstable_isNewReconciler:!1},jh={readContext:Lr,useCallback:Od,useContext:Lr,useEffect:$c,useImperativeHandle:qp,useInsertionEffect:Ff,useLayoutEffect:rc,useMemo:Vr,useReducer:Ks,useRef:ks,useState:function(){return Ks(_a)},useDebugValue:Vl,useDeferredValue:function(l){var c=_i();return $r===null?c.memoizedState=l:Up(c,$r.memoizedState,l)},useTransition:function(){var l=Ks(_a)[0],c=_i().memoizedState;return[l,c]},useMutableSource:Uc,useSyncExternalStore:nc,useId:$p,unstable_isNewReconciler:!1};function Ma(l,c){if(l&&l.defaultProps){c=V({},c),l=l.defaultProps;for(var w in l)c[w]===void 0&&(c[w]=l[w]);return c}return c}function Wc(l,c,w,N){c=l.memoizedState,w=w(N,c),w=w==null?c:V({},c,w),l.memoizedState=w,l.lanes===0&&(l.updateQueue.baseState=w)}var Vc={isMounted:function(l){return(l=l._reactInternals)?si(l)===l:!1},enqueueSetState:function(l,c,w){l=l._reactInternals;var N=es(),G=Qc(l),Q=ti(N,G);Q.payload=c,w!=null&&(Q.callback=w),c=Hr(l,Q,G),c!==null&&(Kl(c,l,G,N),ba(c,l,G))},enqueueReplaceState:function(l,c,w){l=l._reactInternals;var N=es(),G=Qc(l),Q=ti(N,G);Q.tag=1,Q.payload=c,w!=null&&(Q.callback=w),c=Hr(l,Q,G),c!==null&&(Kl(c,l,G,N),ba(c,l,G))},enqueueForceUpdate:function(l,c){l=l._reactInternals;var w=es(),N=Qc(l),G=ti(w,N);G.tag=2,c!=null&&(G.callback=c),c=Hr(l,G,N),c!==null&&(Kl(c,l,N,w),ba(c,l,N))}};function Dh(l,c,w,N,G,Q,he){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(N,Q,he):c.prototype&&c.prototype.isPureReactComponent?!pa(w,N)||!pa(G,Q):!0}function Vp(l,c,w){var N=!1,G=_s,Q=c.contextType;return typeof Q=="object"&&Q!==null?Q=Lr(Q):(G=ma(c)?_l:Hi.current,N=c.contextTypes,Q=(N=N!=null)?Hl(l,G):_s),c=new c(w,Q),l.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Vc,l.stateNode=c,c._reactInternals=l,N&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=G,l.__reactInternalMemoizedMaskedChildContext=Q),c}function Ld(l,c,w,N){l=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(w,N),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(w,N),c.state!==l&&Vc.enqueueReplaceState(c,c.state,null)}function Fh(l,c,w,N){var G=l.stateNode;G.props=w,G.state=l.memoizedState,G.refs={},Ri(l);var Q=c.contextType;typeof Q=="object"&&Q!==null?G.context=Lr(Q):(Q=ma(c)?_l:Hi.current,G.context=Hl(l,Q)),G.state=l.memoizedState,Q=c.getDerivedStateFromProps,typeof Q=="function"&&(Wc(l,c,Q,w),G.state=l.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof G.getSnapshotBeforeUpdate=="function"||typeof G.UNSAFE_componentWillMount!="function"&&typeof G.componentWillMount!="function"||(c=G.state,typeof G.componentWillMount=="function"&&G.componentWillMount(),typeof G.UNSAFE_componentWillMount=="function"&&G.UNSAFE_componentWillMount(),c!==G.state&&Vc.enqueueReplaceState(G,G.state,null),$i(l,w,G,N),G.state=l.memoizedState),typeof G.componentDidMount=="function"&&(l.flags|=4194308)}function ic(l,c){try{var w="",N=c;do w+=ee(N),N=N.return;while(N);var G=w}catch(Q){G=`
31
+ Error generating stack: `+Q.message+`
32
+ `+Q.stack}return{value:l,source:c,stack:G,digest:null}}function Bh(l,c,w){return{value:l,source:null,stack:w??null,digest:c??null}}function Yc(l,c){try{console.error(c.value)}catch(w){setTimeout(function(){throw w})}}var ag=typeof WeakMap=="function"?WeakMap:Map;function Yp(l,c,w){w=ti(-1,w),w.tag=3,w.payload={element:null};var N=c.value;return w.callback=function(){Jp||(Jp=!0,gg=N),Yc(l,c)},w}function d(l,c,w){w=ti(-1,w),w.tag=3;var N=l.type.getDerivedStateFromError;if(typeof N=="function"){var G=c.value;w.payload=function(){return N(G)},w.callback=function(){Yc(l,c)}}var Q=l.stateNode;return Q!==null&&typeof Q.componentDidCatch=="function"&&(w.callback=function(){Yc(l,c),typeof N!="function"&&(Kc===null?Kc=new Set([this]):Kc.add(this));var he=c.stack;this.componentDidCatch(c.value,{componentStack:he!==null?he:""})}),w}function m(l,c,w){var N=l.pingCache;if(N===null){N=l.pingCache=new ag;var G=new Set;N.set(c,G)}else G=N.get(c),G===void 0&&(G=new Set,N.set(c,G));G.has(w)||(G.add(w),l=kx.bind(null,l,c,w),c.then(l,l))}function C(l){do{var c;if((c=l.tag===13)&&(c=l.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return l;l=l.return}while(l!==null);return null}function z(l,c,w,N,G){return(l.mode&1)===0?(l===c?l.flags|=65536:(l.flags|=128,w.flags|=131072,w.flags&=-52805,w.tag===1&&(w.alternate===null?w.tag=17:(c=ti(-1,1),c.tag=2,Hr(w,c,1))),w.lanes|=1),l):(l.flags|=65536,l.lanes=G,l)}var W=S.ReactCurrentOwner,re=!1;function _e(l,c,w,N){c.child=l===null?$n(c,null,w,N):fi(c,l.child,w,N)}function Ye(l,c,w,N,G){w=w.render;var Q=c.ref;return Cr(c,G),N=xl(l,c,w,N,Q,G),w=go(),l!==null&&!re?(c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~G,Ka(l,c,G)):(ft&&w&&lt(c),c.flags|=1,_e(l,c,N,G),c.child)}function it(l,c,w,N,G){if(l===null){var Q=w.type;return typeof Q=="function"&&!xg(Q)&&Q.defaultProps===void 0&&w.compare===null&&w.defaultProps===void 0?(c.tag=15,c.type=Q,wt(l,c,Q,N,G)):(l=a1(w.type,null,N,c,c.mode,G),l.ref=c.ref,l.return=c,c.child=l)}if(Q=l.child,(l.lanes&G)===0){var he=Q.memoizedProps;if(w=w.compare,w=w!==null?w:pa,w(he,N)&&l.ref===c.ref)return Ka(l,c,G)}return c.flags|=1,l=ef(Q,N),l.ref=c.ref,l.return=c,c.child=l}function wt(l,c,w,N,G){if(l!==null){var Q=l.memoizedProps;if(pa(Q,N)&&l.ref===c.ref)if(re=!1,c.pendingProps=N=Q,(l.lanes&G)!==0)(l.flags&131072)!==0&&(re=!0);else return c.lanes=l.lanes,Ka(l,c,G)}return Tt(l,c,w,N,G)}function $t(l,c,w){var N=c.pendingProps,G=N.children,Q=l!==null?l.memoizedState:null;if(N.mode==="hidden")if((c.mode&1)===0)c.memoizedState={baseLanes:0,cachePool:null,transitions:null},sr(qh,Zs),Zs|=w;else{if((w&1073741824)===0)return l=Q!==null?Q.baseLanes|w:w,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:l,cachePool:null,transitions:null},c.updateQueue=null,sr(qh,Zs),Zs|=l,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},N=Q!==null?Q.baseLanes:w,sr(qh,Zs),Zs|=N}else Q!==null?(N=Q.baseLanes|w,c.memoizedState=null):N=w,sr(qh,Zs),Zs|=N;return _e(l,c,G,w),c.child}function wn(l,c){var w=c.ref;(l===null&&w!==null||l!==null&&l.ref!==w)&&(c.flags|=512,c.flags|=2097152)}function Tt(l,c,w,N,G){var Q=ma(w)?_l:Hi.current;return Q=Hl(c,Q),Cr(c,G),w=xl(l,c,w,N,Q,G),N=go(),l!==null&&!re?(c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~G,Ka(l,c,G)):(ft&&N&&lt(c),c.flags|=1,_e(l,c,w,G),c.child)}function Fr(l,c,w,N,G){if(ma(w)){var Q=!0;xs(c)}else Q=!1;if(Cr(c,G),c.stateNode===null)Gn(l,c),Vp(c,w,N),Fh(c,w,N,G),N=!0;else if(l===null){var he=c.stateNode,Ie=c.memoizedProps;he.props=Ie;var ze=he.context,rt=w.contextType;typeof rt=="object"&&rt!==null?rt=Lr(rt):(rt=ma(w)?_l:Hi.current,rt=Hl(c,rt));var vt=w.getDerivedStateFromProps,yt=typeof vt=="function"||typeof he.getSnapshotBeforeUpdate=="function";yt||typeof he.UNSAFE_componentWillReceiveProps!="function"&&typeof he.componentWillReceiveProps!="function"||(Ie!==N||ze!==rt)&&Ld(c,he,N,rt),ei=!1;var gt=c.memoizedState;he.state=gt,$i(c,N,he,G),ze=c.memoizedState,Ie!==N||gt!==ze||va.current||ei?(typeof vt=="function"&&(Wc(c,w,vt,N),ze=c.memoizedState),(Ie=ei||Dh(c,w,Ie,N,gt,ze,rt))?(yt||typeof he.UNSAFE_componentWillMount!="function"&&typeof he.componentWillMount!="function"||(typeof he.componentWillMount=="function"&&he.componentWillMount(),typeof he.UNSAFE_componentWillMount=="function"&&he.UNSAFE_componentWillMount()),typeof he.componentDidMount=="function"&&(c.flags|=4194308)):(typeof he.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=N,c.memoizedState=ze),he.props=N,he.state=ze,he.context=rt,N=Ie):(typeof he.componentDidMount=="function"&&(c.flags|=4194308),N=!1)}else{he=c.stateNode,ya(l,c),Ie=c.memoizedProps,rt=c.type===c.elementType?Ie:Ma(c.type,Ie),he.props=rt,yt=c.pendingProps,gt=he.context,ze=w.contextType,typeof ze=="object"&&ze!==null?ze=Lr(ze):(ze=ma(w)?_l:Hi.current,ze=Hl(c,ze));var qt=w.getDerivedStateFromProps;(vt=typeof qt=="function"||typeof he.getSnapshotBeforeUpdate=="function")||typeof he.UNSAFE_componentWillReceiveProps!="function"&&typeof he.componentWillReceiveProps!="function"||(Ie!==yt||gt!==ze)&&Ld(c,he,N,ze),ei=!1,gt=c.memoizedState,he.state=gt,$i(c,N,he,G);var Vt=c.memoizedState;Ie!==yt||gt!==Vt||va.current||ei?(typeof qt=="function"&&(Wc(c,w,qt,N),Vt=c.memoizedState),(rt=ei||Dh(c,w,rt,N,gt,Vt,ze)||!1)?(vt||typeof he.UNSAFE_componentWillUpdate!="function"&&typeof he.componentWillUpdate!="function"||(typeof he.componentWillUpdate=="function"&&he.componentWillUpdate(N,Vt,ze),typeof he.UNSAFE_componentWillUpdate=="function"&&he.UNSAFE_componentWillUpdate(N,Vt,ze)),typeof he.componentDidUpdate=="function"&&(c.flags|=4),typeof he.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof he.componentDidUpdate!="function"||Ie===l.memoizedProps&&gt===l.memoizedState||(c.flags|=4),typeof he.getSnapshotBeforeUpdate!="function"||Ie===l.memoizedProps&&gt===l.memoizedState||(c.flags|=1024),c.memoizedProps=N,c.memoizedState=Vt),he.props=N,he.state=Vt,he.context=ze,N=rt):(typeof he.componentDidUpdate!="function"||Ie===l.memoizedProps&&gt===l.memoizedState||(c.flags|=4),typeof he.getSnapshotBeforeUpdate!="function"||Ie===l.memoizedProps&&gt===l.memoizedState||(c.flags|=1024),N=!1)}return mr(l,c,w,N,Q,G)}function mr(l,c,w,N,G,Q){wn(l,c);var he=(c.flags&128)!==0;if(!N&&!he)return G&&Mh(c,w,!1),Ka(l,c,Q);N=c.stateNode,W.current=c;var Ie=he&&typeof w.getDerivedStateFromError!="function"?null:N.render();return c.flags|=1,l!==null&&he?(c.child=fi(c,l.child,null,Q),c.child=fi(c,null,Ie,Q)):_e(l,c,Ie,Q),c.memoizedState=N.state,G&&Mh(c,w,!0),c.child}function mo(l){var c=l.stateNode;c.pendingContext?jf(l,c.pendingContext,c.pendingContext!==c.context):c.context&&jf(l,c.context,!1),Zo(l,c.containerInfo)}function Sl(l,c,w,N,G){return Ft(),St(G),c.flags|=256,_e(l,c,w,N),c.child}var nt={dehydrated:null,treeContext:null,retryLane:0};function Ke(l){return{baseLanes:l,cachePool:null,transitions:null}}function ut(l,c,w){var N=c.pendingProps,G=dr.current,Q=!1,he=(c.flags&128)!==0,Ie;if((Ie=he)||(Ie=l!==null&&l.memoizedState===null?!1:(G&2)!==0),Ie?(Q=!0,c.flags&=-129):(l===null||l.memoizedState!==null)&&(G|=1),sr(dr,G&1),l===null)return zt(c),l=c.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?((c.mode&1)===0?c.lanes=1:l.data==="$!"?c.lanes=8:c.lanes=1073741824,null):(he=N.children,l=N.fallback,Q?(N=c.mode,Q=c.child,he={mode:"hidden",children:he},(N&1)===0&&Q!==null?(Q.childLanes=0,Q.pendingProps=he):Q=o1(he,N,0,null),l=Hf(l,N,w,null),Q.return=c,l.return=c,Q.sibling=l,c.child=Q,c.child.memoizedState=Ke(w),c.memoizedState=nt,l):Rt(c,he));if(G=l.memoizedState,G!==null&&(Ie=G.dehydrated,Ie!==null))return Cn(l,c,he,N,Ie,G,w);if(Q){Q=N.fallback,he=c.mode,G=l.child,Ie=G.sibling;var ze={mode:"hidden",children:N.children};return(he&1)===0&&c.child!==G?(N=c.child,N.childLanes=0,N.pendingProps=ze,c.deletions=null):(N=ef(G,ze),N.subtreeFlags=G.subtreeFlags&14680064),Ie!==null?Q=ef(Ie,Q):(Q=Hf(Q,he,w,null),Q.flags|=2),Q.return=c,N.return=c,N.sibling=Q,c.child=N,N=Q,Q=c.child,he=l.child.memoizedState,he=he===null?Ke(w):{baseLanes:he.baseLanes|w,cachePool:null,transitions:he.transitions},Q.memoizedState=he,Q.childLanes=l.childLanes&~w,c.memoizedState=nt,N}return Q=l.child,l=Q.sibling,N=ef(Q,{mode:"visible",children:N.children}),(c.mode&1)===0&&(N.lanes=w),N.return=c,N.sibling=null,l!==null&&(w=c.deletions,w===null?(c.deletions=[l],c.flags|=16):w.push(l)),c.child=N,c.memoizedState=null,N}function Rt(l,c){return c=o1({mode:"visible",children:c},l.mode,0,null),c.return=l,l.child=c}function rn(l,c,w,N){return N!==null&&St(N),fi(c,l.child,null,w),l=Rt(c,c.pendingProps.children),l.flags|=2,c.memoizedState=null,l}function Cn(l,c,w,N,G,Q,he){if(w)return c.flags&256?(c.flags&=-257,N=Bh(Error(n(422))),rn(l,c,he,N)):c.memoizedState!==null?(c.child=l.child,c.flags|=128,null):(Q=N.fallback,G=c.mode,N=o1({mode:"visible",children:N.children},G,0,null),Q=Hf(Q,G,he,null),Q.flags|=2,N.return=c,Q.return=c,N.sibling=Q,c.child=N,(c.mode&1)!==0&&fi(c,l.child,null,he),c.child.memoizedState=Ke(he),c.memoizedState=nt,Q);if((c.mode&1)===0)return rn(l,c,he,null);if(G.data==="$!"){if(N=G.nextSibling&&G.nextSibling.dataset,N)var Ie=N.dgst;return N=Ie,Q=Error(n(419)),N=Bh(Q,N,void 0),rn(l,c,he,N)}if(Ie=(he&l.childLanes)!==0,re||Ie){if(N=Za,N!==null){switch(he&-he){case 4:G=2;break;case 16:G=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:G=32;break;case 536870912:G=268435456;break;default:G=0}G=(G&(N.suspendedLanes|he))!==0?0:G,G!==0&&G!==Q.retryLane&&(Q.retryLane=G,Qn(l,G),Kl(N,l,G,-1))}return _g(),N=Bh(Error(n(421))),rn(l,c,he,N)}return G.data==="$?"?(c.flags|=128,c.child=l.child,c=Ax.bind(null,l),G._reactRetry=c,null):(l=Q.treeContext,He=ea(G.nextSibling),ot=c,ft=!0,ht=null,l!==null&&(we[Se++]=Je,we[Se++]=xe,we[Se++]=Fe,Je=l.id,xe=l.overflow,Fe=c),c=Rt(c,N.children),c.flags|=4096,c)}function _n(l,c,w){l.lanes|=c;var N=l.alternate;N!==null&&(N.lanes|=c),Vn(l.return,c,w)}function Xn(l,c,w,N,G){var Q=l.memoizedState;Q===null?l.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:N,tail:w,tailMode:G}:(Q.isBackwards=c,Q.rendering=null,Q.renderingStartTime=0,Q.last=N,Q.tail=w,Q.tailMode=G)}function ia(l,c,w){var N=c.pendingProps,G=N.revealOrder,Q=N.tail;if(_e(l,c,N.children,w),N=dr.current,(N&2)!==0)N=N&1|2,c.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=c.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&_n(l,w,c);else if(l.tag===19)_n(l,w,c);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===c)break e;for(;l.sibling===null;){if(l.return===null||l.return===c)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}N&=1}if(sr(dr,N),(c.mode&1)===0)c.memoizedState=null;else switch(G){case"forwards":for(w=c.child,G=null;w!==null;)l=w.alternate,l!==null&&fo(l)===null&&(G=w),w=w.sibling;w=G,w===null?(G=c.child,c.child=null):(G=w.sibling,w.sibling=null),Xn(c,!1,G,w,Q);break;case"backwards":for(w=null,G=c.child,c.child=null;G!==null;){if(l=G.alternate,l!==null&&fo(l)===null){c.child=G;break}l=G.sibling,G.sibling=w,w=G,G=l}Xn(c,!0,w,null,Q);break;case"together":Xn(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Gn(l,c){(c.mode&1)===0&&l!==null&&(l.alternate=null,c.alternate=null,c.flags|=2)}function Ka(l,c,w){if(l!==null&&(c.dependencies=l.dependencies),Bf|=c.lanes,(w&c.childLanes)===0)return null;if(l!==null&&c.child!==l.child)throw Error(n(153));if(c.child!==null){for(l=c.child,w=ef(l,l.pendingProps),c.child=w,w.return=c;l.sibling!==null;)l=l.sibling,w=w.sibling=ef(l,l.pendingProps),w.return=c;w.sibling=null}return c.child}function og(l,c,w){switch(c.tag){case 3:mo(c),Ft();break;case 5:xu(c);break;case 1:ma(c.type)&&xs(c);break;case 4:Zo(c,c.stateNode.containerInfo);break;case 10:var N=c.type._context,G=c.memoizedProps.value;sr(wi,N._currentValue),N._currentValue=G;break;case 13:if(N=c.memoizedState,N!==null)return N.dehydrated!==null?(sr(dr,dr.current&1),c.flags|=128,null):(w&c.child.childLanes)!==0?ut(l,c,w):(sr(dr,dr.current&1),l=Ka(l,c,w),l!==null?l.sibling:null);sr(dr,dr.current&1);break;case 19:if(N=(w&c.childLanes)!==0,(l.flags&128)!==0){if(N)return ia(l,c,w);c.flags|=128}if(G=c.memoizedState,G!==null&&(G.rendering=null,G.tail=null,G.lastEffect=null),sr(dr,dr.current),N)break;return null;case 22:case 23:return c.lanes=0,$t(l,c,w)}return Ka(l,c,w)}var Ay,sg,Py,Oy;Ay=function(l,c){for(var w=c.child;w!==null;){if(w.tag===5||w.tag===6)l.appendChild(w.stateNode);else if(w.tag!==4&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===c)break;for(;w.sibling===null;){if(w.return===null||w.return===c)return;w=w.return}w.sibling.return=w.return,w=w.sibling}},sg=function(){},Py=function(l,c,w,N){var G=l.memoizedProps;if(G!==N){l=c.stateNode,hi(jn.current);var Q=null;switch(w){case"input":G=Ee(l,G),N=Ee(l,N),Q=[];break;case"select":G=V({},G,{value:void 0}),N=V({},N,{value:void 0}),Q=[];break;case"textarea":G=ue(l,G),N=ue(l,N),Q=[];break;default:typeof G.onClick!="function"&&typeof N.onClick=="function"&&(l.onclick=Vs)}Ve(w,N);var he;w=null;for(rt in G)if(!N.hasOwnProperty(rt)&&G.hasOwnProperty(rt)&&G[rt]!=null)if(rt==="style"){var Ie=G[rt];for(he in Ie)Ie.hasOwnProperty(he)&&(w||(w={}),w[he]="")}else rt!=="dangerouslySetInnerHTML"&&rt!=="children"&&rt!=="suppressContentEditableWarning"&&rt!=="suppressHydrationWarning"&&rt!=="autoFocus"&&(i.hasOwnProperty(rt)?Q||(Q=[]):(Q=Q||[]).push(rt,null));for(rt in N){var ze=N[rt];if(Ie=G?.[rt],N.hasOwnProperty(rt)&&ze!==Ie&&(ze!=null||Ie!=null))if(rt==="style")if(Ie){for(he in Ie)!Ie.hasOwnProperty(he)||ze&&ze.hasOwnProperty(he)||(w||(w={}),w[he]="");for(he in ze)ze.hasOwnProperty(he)&&Ie[he]!==ze[he]&&(w||(w={}),w[he]=ze[he])}else w||(Q||(Q=[]),Q.push(rt,w)),w=ze;else rt==="dangerouslySetInnerHTML"?(ze=ze?ze.__html:void 0,Ie=Ie?Ie.__html:void 0,ze!=null&&Ie!==ze&&(Q=Q||[]).push(rt,ze)):rt==="children"?typeof ze!="string"&&typeof ze!="number"||(Q=Q||[]).push(rt,""+ze):rt!=="suppressContentEditableWarning"&&rt!=="suppressHydrationWarning"&&(i.hasOwnProperty(rt)?(ze!=null&&rt==="onScroll"&&fr("scroll",l),Q||Ie===ze||(Q=[])):(Q=Q||[]).push(rt,ze))}w&&(Q=Q||[]).push("style",w);var rt=Q;(c.updateQueue=rt)&&(c.flags|=4)}},Oy=function(l,c,w,N){w!==N&&(c.flags|=4)};function Nd(l,c){if(!ft)switch(l.tailMode){case"hidden":c=l.tail;for(var w=null;c!==null;)c.alternate!==null&&(w=c),c=c.sibling;w===null?l.tail=null:w.sibling=null;break;case"collapsed":w=l.tail;for(var N=null;w!==null;)w.alternate!==null&&(N=w),w=w.sibling;N===null?c||l.tail===null?l.tail=null:l.tail.sibling=null:N.sibling=null}}function jo(l){var c=l.alternate!==null&&l.alternate.child===l.child,w=0,N=0;if(c)for(var G=l.child;G!==null;)w|=G.lanes|G.childLanes,N|=G.subtreeFlags&14680064,N|=G.flags&14680064,G.return=l,G=G.sibling;else for(G=l.child;G!==null;)w|=G.lanes|G.childLanes,N|=G.subtreeFlags,N|=G.flags,G.return=l,G=G.sibling;return l.subtreeFlags|=N,l.childLanes=w,c}function gx(l,c,w){var N=c.pendingProps;switch(Xe(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jo(c),null;case 1:return ma(c.type)&&_u(),jo(c),null;case 3:return N=c.stateNode,hr(),nr(va),nr(Hi),wa(),N.pendingContext&&(N.context=N.pendingContext,N.pendingContext=null),(l===null||l.child===null)&&(qr(c)?c.flags|=4:l===null||l.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,ht!==null&&(yg(ht),ht=null))),sg(l,c),jo(c),null;case 5:Xs(c);var G=hi(Dr.current);if(w=c.type,l!==null&&c.stateNode!=null)Py(l,c,w,N,G),l.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!N){if(c.stateNode===null)throw Error(n(166));return jo(c),null}if(l=hi(jn.current),qr(c)){N=c.stateNode,w=c.type;var Q=c.memoizedProps;switch(N[Ro]=c,N[bu]=Q,l=(c.mode&1)!==0,w){case"dialog":fr("cancel",N),fr("close",N);break;case"iframe":case"object":case"embed":fr("load",N);break;case"video":case"audio":for(G=0;G<Ko.length;G++)fr(Ko[G],N);break;case"source":fr("error",N);break;case"img":case"image":case"link":fr("error",N),fr("load",N);break;case"details":fr("toggle",N);break;case"input":ge(N,Q),fr("invalid",N);break;case"select":N._wrapperState={wasMultiple:!!Q.multiple},fr("invalid",N);break;case"textarea":Ae(N,Q),fr("invalid",N)}Ve(w,Q),G=null;for(var he in Q)if(Q.hasOwnProperty(he)){var Ie=Q[he];he==="children"?typeof Ie=="string"?N.textContent!==Ie&&(Q.suppressHydrationWarning!==!0&&Qu(N.textContent,Ie,l),G=["children",Ie]):typeof Ie=="number"&&N.textContent!==""+Ie&&(Q.suppressHydrationWarning!==!0&&Qu(N.textContent,Ie,l),G=["children",""+Ie]):i.hasOwnProperty(he)&&Ie!=null&&he==="onScroll"&&fr("scroll",N)}switch(w){case"input":Re(N),Ce(N,Q,!0);break;case"textarea":Re(N),Ue(N);break;case"select":case"option":break;default:typeof Q.onClick=="function"&&(N.onclick=Vs)}N=G,c.updateQueue=N,N!==null&&(c.flags|=4)}else{he=G.nodeType===9?G:G.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=st(w)),l==="http://www.w3.org/1999/xhtml"?w==="script"?(l=he.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof N.is=="string"?l=he.createElement(w,{is:N.is}):(l=he.createElement(w),w==="select"&&(he=l,N.multiple?he.multiple=!0:N.size&&(he.size=N.size))):l=he.createElementNS(l,w),l[Ro]=c,l[bu]=N,Ay(l,c,!1,!1),c.stateNode=l;e:{switch(he=qe(w,N),w){case"dialog":fr("cancel",l),fr("close",l),G=N;break;case"iframe":case"object":case"embed":fr("load",l),G=N;break;case"video":case"audio":for(G=0;G<Ko.length;G++)fr(Ko[G],l);G=N;break;case"source":fr("error",l),G=N;break;case"img":case"image":case"link":fr("error",l),fr("load",l),G=N;break;case"details":fr("toggle",l),G=N;break;case"input":ge(l,N),G=Ee(l,N),fr("invalid",l);break;case"option":G=N;break;case"select":l._wrapperState={wasMultiple:!!N.multiple},G=V({},N,{value:void 0}),fr("invalid",l);break;case"textarea":Ae(l,N),G=ue(l,N),fr("invalid",l);break;default:G=N}Ve(w,G),Ie=G;for(Q in Ie)if(Ie.hasOwnProperty(Q)){var ze=Ie[Q];Q==="style"?It(l,ze):Q==="dangerouslySetInnerHTML"?(ze=ze?ze.__html:void 0,ze!=null&&xt(l,ze)):Q==="children"?typeof ze=="string"?(w!=="textarea"||ze!=="")&&bt(l,ze):typeof ze=="number"&&bt(l,""+ze):Q!=="suppressContentEditableWarning"&&Q!=="suppressHydrationWarning"&&Q!=="autoFocus"&&(i.hasOwnProperty(Q)?ze!=null&&Q==="onScroll"&&fr("scroll",l):ze!=null&&A(l,Q,ze,he))}switch(w){case"input":Re(l),Ce(l,N,!1);break;case"textarea":Re(l),Ue(l);break;case"option":N.value!=null&&l.setAttribute("value",""+me(N.value));break;case"select":l.multiple=!!N.multiple,Q=N.value,Q!=null?Ne(l,!!N.multiple,Q,!1):N.defaultValue!=null&&Ne(l,!!N.multiple,N.defaultValue,!0);break;default:typeof G.onClick=="function"&&(l.onclick=Vs)}switch(w){case"button":case"input":case"select":case"textarea":N=!!N.autoFocus;break e;case"img":N=!0;break e;default:N=!1}}N&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return jo(c),null;case 6:if(l&&c.stateNode!=null)Oy(l,c,l.memoizedProps,N);else{if(typeof N!="string"&&c.stateNode===null)throw Error(n(166));if(w=hi(Dr.current),hi(jn.current),qr(c)){if(N=c.stateNode,w=c.memoizedProps,N[Ro]=c,(Q=N.nodeValue!==w)&&(l=ot,l!==null))switch(l.tag){case 3:Qu(N.nodeValue,w,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&Qu(N.nodeValue,w,(l.mode&1)!==0)}Q&&(c.flags|=4)}else N=(w.nodeType===9?w:w.ownerDocument).createTextNode(N),N[Ro]=c,c.stateNode=N}return jo(c),null;case 13:if(nr(dr),N=c.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(ft&&He!==null&&(c.mode&1)!==0&&(c.flags&128)===0)mn(),Ft(),c.flags|=98560,Q=!1;else if(Q=qr(c),N!==null&&N.dehydrated!==null){if(l===null){if(!Q)throw Error(n(318));if(Q=c.memoizedState,Q=Q!==null?Q.dehydrated:null,!Q)throw Error(n(317));Q[Ro]=c}else Ft(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;jo(c),Q=!1}else ht!==null&&(yg(ht),ht=null),Q=!0;if(!Q)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=w,c):(N=N!==null,N!==(l!==null&&l.memoizedState!==null)&&N&&(c.child.flags|=8192,(c.mode&1)!==0&&(l===null||(dr.current&1)!==0?Ia===0&&(Ia=3):_g())),c.updateQueue!==null&&(c.flags|=4),jo(c),null);case 4:return hr(),sg(l,c),l===null&&Ws(c.stateNode.containerInfo),jo(c),null;case 10:return Or(c.type._context),jo(c),null;case 17:return ma(c.type)&&_u(),jo(c),null;case 19:if(nr(dr),Q=c.memoizedState,Q===null)return jo(c),null;if(N=(c.flags&128)!==0,he=Q.rendering,he===null)if(N)Nd(Q,!1);else{if(Ia!==0||l!==null&&(l.flags&128)!==0)for(l=c.child;l!==null;){if(he=fo(l),he!==null){for(c.flags|=128,Nd(Q,!1),N=he.updateQueue,N!==null&&(c.updateQueue=N,c.flags|=4),c.subtreeFlags=0,N=w,w=c.child;w!==null;)Q=w,l=N,Q.flags&=14680066,he=Q.alternate,he===null?(Q.childLanes=0,Q.lanes=l,Q.child=null,Q.subtreeFlags=0,Q.memoizedProps=null,Q.memoizedState=null,Q.updateQueue=null,Q.dependencies=null,Q.stateNode=null):(Q.childLanes=he.childLanes,Q.lanes=he.lanes,Q.child=he.child,Q.subtreeFlags=0,Q.deletions=null,Q.memoizedProps=he.memoizedProps,Q.memoizedState=he.memoizedState,Q.updateQueue=he.updateQueue,Q.type=he.type,l=he.dependencies,Q.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),w=w.sibling;return sr(dr,dr.current&1|2),c.child}l=l.sibling}Q.tail!==null&&kr()>Uh&&(c.flags|=128,N=!0,Nd(Q,!1),c.lanes=4194304)}else{if(!N)if(l=fo(he),l!==null){if(c.flags|=128,N=!0,w=l.updateQueue,w!==null&&(c.updateQueue=w,c.flags|=4),Nd(Q,!0),Q.tail===null&&Q.tailMode==="hidden"&&!he.alternate&&!ft)return jo(c),null}else 2*kr()-Q.renderingStartTime>Uh&&w!==1073741824&&(c.flags|=128,N=!0,Nd(Q,!1),c.lanes=4194304);Q.isBackwards?(he.sibling=c.child,c.child=he):(w=Q.last,w!==null?w.sibling=he:c.child=he,Q.last=he)}return Q.tail!==null?(c=Q.tail,Q.rendering=c,Q.tail=c.sibling,Q.renderingStartTime=kr(),c.sibling=null,w=dr.current,sr(dr,N?w&1|2:w&1),c):(jo(c),null);case 22:case 23:return wg(),N=c.memoizedState!==null,l!==null&&l.memoizedState!==null!==N&&(c.flags|=8192),N&&(c.mode&1)!==0?(Zs&1073741824)!==0&&(jo(c),c.subtreeFlags&6&&(c.flags|=8192)):jo(c),null;case 24:return null;case 25:return null}throw Error(n(156,c.tag))}function vx(l,c){switch(Xe(c),c.tag){case 1:return ma(c.type)&&_u(),l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 3:return hr(),nr(va),nr(Hi),wa(),l=c.flags,(l&65536)!==0&&(l&128)===0?(c.flags=l&-65537|128,c):null;case 5:return Xs(c),null;case 13:if(nr(dr),l=c.memoizedState,l!==null&&l.dehydrated!==null){if(c.alternate===null)throw Error(n(340));Ft()}return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 19:return nr(dr),null;case 4:return hr(),null;case 10:return Or(c.type._context),null;case 22:case 23:return wg(),null;case 24:return null;default:return null}}var Xp=!1,Do=!1,mx=typeof WeakSet=="function"?WeakSet:Set,Gt=null;function zh(l,c){var w=l.ref;if(w!==null)if(typeof w=="function")try{w(null)}catch(N){Wi(l,c,N)}else w.current=null}function lg(l,c,w){try{w()}catch(N){Wi(l,c,N)}}var Cy=!1;function yx(l,c){if(Ju=du,l=Nn(),Va(l)){if("selectionStart"in l)var w={start:l.selectionStart,end:l.selectionEnd};else e:{w=(w=l.ownerDocument)&&w.defaultView||window;var N=w.getSelection&&w.getSelection();if(N&&N.rangeCount!==0){w=N.anchorNode;var G=N.anchorOffset,Q=N.focusNode;N=N.focusOffset;try{w.nodeType,Q.nodeType}catch{w=null;break e}var he=0,Ie=-1,ze=-1,rt=0,vt=0,yt=l,gt=null;t:for(;;){for(var qt;yt!==w||G!==0&&yt.nodeType!==3||(Ie=he+G),yt!==Q||N!==0&&yt.nodeType!==3||(ze=he+N),yt.nodeType===3&&(he+=yt.nodeValue.length),(qt=yt.firstChild)!==null;)gt=yt,yt=qt;for(;;){if(yt===l)break t;if(gt===w&&++rt===G&&(Ie=he),gt===Q&&++vt===N&&(ze=he),(qt=yt.nextSibling)!==null)break;yt=gt,gt=yt.parentNode}yt=qt}w=Ie===-1||ze===-1?null:{start:Ie,end:ze}}else w=null}w=w||{start:0,end:0}}else w=null;for(Ul={focusedElem:l,selectionRange:w},du=!1,Gt=c;Gt!==null;)if(c=Gt,l=c.child,(c.subtreeFlags&1028)!==0&&l!==null)l.return=c,Gt=l;else for(;Gt!==null;){c=Gt;try{var Vt=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(Vt!==null){var Xt=Vt.memoizedProps,aa=Vt.memoizedState,et=c.stateNode,We=et.getSnapshotBeforeUpdate(c.elementType===c.type?Xt:Ma(c.type,Xt),aa);et.__reactInternalSnapshotBeforeUpdate=We}break;case 3:var tt=c.stateNode.containerInfo;tt.nodeType===1?tt.textContent="":tt.nodeType===9&&tt.documentElement&&tt.removeChild(tt.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(_t){Wi(c,c.return,_t)}if(l=c.sibling,l!==null){l.return=c.return,Gt=l;break}Gt=c.return}return Vt=Cy,Cy=!1,Vt}function Td(l,c,w){var N=c.updateQueue;if(N=N!==null?N.lastEffect:null,N!==null){var G=N=N.next;do{if((G.tag&l)===l){var Q=G.destroy;G.destroy=void 0,Q!==void 0&&lg(c,w,Q)}G=G.next}while(G!==N)}}function Kp(l,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var w=c=c.next;do{if((w.tag&l)===l){var N=w.create;w.destroy=N()}w=w.next}while(w!==c)}}function ug(l){var c=l.ref;if(c!==null){var w=l.stateNode;switch(l.tag){case 5:l=w;break;default:l=w}typeof c=="function"?c(l):c.current=l}}function Ly(l){var c=l.alternate;c!==null&&(l.alternate=null,Ly(c)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(c=l.stateNode,c!==null&&(delete c[Ro],delete c[bu],delete c[Ra],delete c[Th],delete c[Rh])),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function Ny(l){return l.tag===5||l.tag===3||l.tag===4}function Ty(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||Ny(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function cg(l,c,w){var N=l.tag;if(N===5||N===6)l=l.stateNode,c?w.nodeType===8?w.parentNode.insertBefore(l,c):w.insertBefore(l,c):(w.nodeType===8?(c=w.parentNode,c.insertBefore(l,w)):(c=w,c.appendChild(l)),w=w._reactRootContainer,w!=null||c.onclick!==null||(c.onclick=Vs));else if(N!==4&&(l=l.child,l!==null))for(cg(l,c,w),l=l.sibling;l!==null;)cg(l,c,w),l=l.sibling}function fg(l,c,w){var N=l.tag;if(N===5||N===6)l=l.stateNode,c?w.insertBefore(l,c):w.appendChild(l);else if(N!==4&&(l=l.child,l!==null))for(fg(l,c,w),l=l.sibling;l!==null;)fg(l,c,w),l=l.sibling}var yo=null,Yl=!1;function Xc(l,c,w){for(w=w.child;w!==null;)Ry(l,c,w),w=w.sibling}function Ry(l,c,w){if(gi&&typeof gi.onCommitFiberUnmount=="function")try{gi.onCommitFiberUnmount(_o,w)}catch{}switch(w.tag){case 5:Do||zh(w,c);case 6:var N=yo,G=Yl;yo=null,Xc(l,c,w),yo=N,Yl=G,yo!==null&&(Yl?(l=yo,w=w.stateNode,l.nodeType===8?l.parentNode.removeChild(w):l.removeChild(w)):yo.removeChild(w.stateNode));break;case 18:yo!==null&&(Yl?(l=yo,w=w.stateNode,l.nodeType===8?Bc(l.parentNode,w):l.nodeType===1&&Bc(l,w),ki(l)):Bc(yo,w.stateNode));break;case 4:N=yo,G=Yl,yo=w.stateNode.containerInfo,Yl=!0,Xc(l,c,w),yo=N,Yl=G;break;case 0:case 11:case 14:case 15:if(!Do&&(N=w.updateQueue,N!==null&&(N=N.lastEffect,N!==null))){G=N=N.next;do{var Q=G,he=Q.destroy;Q=Q.tag,he!==void 0&&((Q&2)!==0||(Q&4)!==0)&&lg(w,c,he),G=G.next}while(G!==N)}Xc(l,c,w);break;case 1:if(!Do&&(zh(w,c),N=w.stateNode,typeof N.componentWillUnmount=="function"))try{N.props=w.memoizedProps,N.state=w.memoizedState,N.componentWillUnmount()}catch(Ie){Wi(w,c,Ie)}Xc(l,c,w);break;case 21:Xc(l,c,w);break;case 22:w.mode&1?(Do=(N=Do)||w.memoizedState!==null,Xc(l,c,w),Do=N):Xc(l,c,w);break;default:Xc(l,c,w)}}function My(l){var c=l.updateQueue;if(c!==null){l.updateQueue=null;var w=l.stateNode;w===null&&(w=l.stateNode=new mx),c.forEach(function(N){var G=Px.bind(null,l,N);w.has(N)||(w.add(N),N.then(G,G))})}}function Xl(l,c){var w=c.deletions;if(w!==null)for(var N=0;N<w.length;N++){var G=w[N];try{var Q=l,he=c,Ie=he;e:for(;Ie!==null;){switch(Ie.tag){case 5:yo=Ie.stateNode,Yl=!1;break e;case 3:yo=Ie.stateNode.containerInfo,Yl=!0;break e;case 4:yo=Ie.stateNode.containerInfo,Yl=!0;break e}Ie=Ie.return}if(yo===null)throw Error(n(160));Ry(Q,he,G),yo=null,Yl=!1;var ze=G.alternate;ze!==null&&(ze.return=null),G.return=null}catch(rt){Wi(G,c,rt)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)Iy(c,l),c=c.sibling}function Iy(l,c){var w=l.alternate,N=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Xl(c,l),Ou(l),N&4){try{Td(3,l,l.return),Kp(3,l)}catch(Xt){Wi(l,l.return,Xt)}try{Td(5,l,l.return)}catch(Xt){Wi(l,l.return,Xt)}}break;case 1:Xl(c,l),Ou(l),N&512&&w!==null&&zh(w,w.return);break;case 5:if(Xl(c,l),Ou(l),N&512&&w!==null&&zh(w,w.return),l.flags&32){var G=l.stateNode;try{bt(G,"")}catch(Xt){Wi(l,l.return,Xt)}}if(N&4&&(G=l.stateNode,G!=null)){var Q=l.memoizedProps,he=w!==null?w.memoizedProps:Q,Ie=l.type,ze=l.updateQueue;if(l.updateQueue=null,ze!==null)try{Ie==="input"&&Q.type==="radio"&&Q.name!=null&&Te(G,Q),qe(Ie,he);var rt=qe(Ie,Q);for(he=0;he<ze.length;he+=2){var vt=ze[he],yt=ze[he+1];vt==="style"?It(G,yt):vt==="dangerouslySetInnerHTML"?xt(G,yt):vt==="children"?bt(G,yt):A(G,vt,yt,rt)}switch(Ie){case"input":Be(G,Q);break;case"textarea":Pe(G,Q);break;case"select":var gt=G._wrapperState.wasMultiple;G._wrapperState.wasMultiple=!!Q.multiple;var qt=Q.value;qt!=null?Ne(G,!!Q.multiple,qt,!1):gt!==!!Q.multiple&&(Q.defaultValue!=null?Ne(G,!!Q.multiple,Q.defaultValue,!0):Ne(G,!!Q.multiple,Q.multiple?[]:"",!1))}G[bu]=Q}catch(Xt){Wi(l,l.return,Xt)}}break;case 6:if(Xl(c,l),Ou(l),N&4){if(l.stateNode===null)throw Error(n(162));G=l.stateNode,Q=l.memoizedProps;try{G.nodeValue=Q}catch(Xt){Wi(l,l.return,Xt)}}break;case 3:if(Xl(c,l),Ou(l),N&4&&w!==null&&w.memoizedState.isDehydrated)try{ki(c.containerInfo)}catch(Xt){Wi(l,l.return,Xt)}break;case 4:Xl(c,l),Ou(l);break;case 13:Xl(c,l),Ou(l),G=l.child,G.flags&8192&&(Q=G.memoizedState!==null,G.stateNode.isHidden=Q,!Q||G.alternate!==null&&G.alternate.memoizedState!==null||(pg=kr())),N&4&&My(l);break;case 22:if(vt=w!==null&&w.memoizedState!==null,l.mode&1?(Do=(rt=Do)||vt,Xl(c,l),Do=rt):Xl(c,l),Ou(l),N&8192){if(rt=l.memoizedState!==null,(l.stateNode.isHidden=rt)&&!vt&&(l.mode&1)!==0)for(Gt=l,vt=l.child;vt!==null;){for(yt=Gt=vt;Gt!==null;){switch(gt=Gt,qt=gt.child,gt.tag){case 0:case 11:case 14:case 15:Td(4,gt,gt.return);break;case 1:zh(gt,gt.return);var Vt=gt.stateNode;if(typeof Vt.componentWillUnmount=="function"){N=gt,w=gt.return;try{c=N,Vt.props=c.memoizedProps,Vt.state=c.memoizedState,Vt.componentWillUnmount()}catch(Xt){Wi(N,w,Xt)}}break;case 5:zh(gt,gt.return);break;case 22:if(gt.memoizedState!==null){Fy(yt);continue}}qt!==null?(qt.return=gt,Gt=qt):Fy(yt)}vt=vt.sibling}e:for(vt=null,yt=l;;){if(yt.tag===5){if(vt===null){vt=yt;try{G=yt.stateNode,rt?(Q=G.style,typeof Q.setProperty=="function"?Q.setProperty("display","none","important"):Q.display="none"):(Ie=yt.stateNode,ze=yt.memoizedProps.style,he=ze!=null&&ze.hasOwnProperty("display")?ze.display:null,Ie.style.display=xn("display",he))}catch(Xt){Wi(l,l.return,Xt)}}}else if(yt.tag===6){if(vt===null)try{yt.stateNode.nodeValue=rt?"":yt.memoizedProps}catch(Xt){Wi(l,l.return,Xt)}}else if((yt.tag!==22&&yt.tag!==23||yt.memoizedState===null||yt===l)&&yt.child!==null){yt.child.return=yt,yt=yt.child;continue}if(yt===l)break e;for(;yt.sibling===null;){if(yt.return===null||yt.return===l)break e;vt===yt&&(vt=null),yt=yt.return}vt===yt&&(vt=null),yt.sibling.return=yt.return,yt=yt.sibling}}break;case 19:Xl(c,l),Ou(l),N&4&&My(l);break;case 21:break;default:Xl(c,l),Ou(l)}}function Ou(l){var c=l.flags;if(c&2){try{e:{for(var w=l.return;w!==null;){if(Ny(w)){var N=w;break e}w=w.return}throw Error(n(160))}switch(N.tag){case 5:var G=N.stateNode;N.flags&32&&(bt(G,""),N.flags&=-33);var Q=Ty(l);fg(l,Q,G);break;case 3:case 4:var he=N.stateNode.containerInfo,Ie=Ty(l);cg(l,Ie,he);break;default:throw Error(n(161))}}catch(ze){Wi(l,l.return,ze)}l.flags&=-3}c&4096&&(l.flags&=-4097)}function bx(l,c,w){Gt=l,jy(l)}function jy(l,c,w){for(var N=(l.mode&1)!==0;Gt!==null;){var G=Gt,Q=G.child;if(G.tag===22&&N){var he=G.memoizedState!==null||Xp;if(!he){var Ie=G.alternate,ze=Ie!==null&&Ie.memoizedState!==null||Do;Ie=Xp;var rt=Do;if(Xp=he,(Do=ze)&&!rt)for(Gt=G;Gt!==null;)he=Gt,ze=he.child,he.tag===22&&he.memoizedState!==null?By(G):ze!==null?(ze.return=he,Gt=ze):By(G);for(;Q!==null;)Gt=Q,jy(Q),Q=Q.sibling;Gt=G,Xp=Ie,Do=rt}Dy(l)}else(G.subtreeFlags&8772)!==0&&Q!==null?(Q.return=G,Gt=Q):Dy(l)}}function Dy(l){for(;Gt!==null;){var c=Gt;if((c.flags&8772)!==0){var w=c.alternate;try{if((c.flags&8772)!==0)switch(c.tag){case 0:case 11:case 15:Do||Kp(5,c);break;case 1:var N=c.stateNode;if(c.flags&4&&!Do)if(w===null)N.componentDidMount();else{var G=c.elementType===c.type?w.memoizedProps:Ma(c.type,w.memoizedProps);N.componentDidUpdate(G,w.memoizedState,N.__reactInternalSnapshotBeforeUpdate)}var Q=c.updateQueue;Q!==null&&Yn(c,Q,N);break;case 3:var he=c.updateQueue;if(he!==null){if(w=null,c.child!==null)switch(c.child.tag){case 5:w=c.child.stateNode;break;case 1:w=c.child.stateNode}Yn(c,he,w)}break;case 5:var Ie=c.stateNode;if(w===null&&c.flags&4){w=Ie;var ze=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":ze.autoFocus&&w.focus();break;case"img":ze.src&&(w.src=ze.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var rt=c.alternate;if(rt!==null){var vt=rt.memoizedState;if(vt!==null){var yt=vt.dehydrated;yt!==null&&ki(yt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Do||c.flags&512&&ug(c)}catch(gt){Wi(c,c.return,gt)}}if(c===l){Gt=null;break}if(w=c.sibling,w!==null){w.return=c.return,Gt=w;break}Gt=c.return}}function Fy(l){for(;Gt!==null;){var c=Gt;if(c===l){Gt=null;break}var w=c.sibling;if(w!==null){w.return=c.return,Gt=w;break}Gt=c.return}}function By(l){for(;Gt!==null;){var c=Gt;try{switch(c.tag){case 0:case 11:case 15:var w=c.return;try{Kp(4,c)}catch(ze){Wi(c,w,ze)}break;case 1:var N=c.stateNode;if(typeof N.componentDidMount=="function"){var G=c.return;try{N.componentDidMount()}catch(ze){Wi(c,G,ze)}}var Q=c.return;try{ug(c)}catch(ze){Wi(c,Q,ze)}break;case 5:var he=c.return;try{ug(c)}catch(ze){Wi(c,he,ze)}}}catch(ze){Wi(c,c.return,ze)}if(c===l){Gt=null;break}var Ie=c.sibling;if(Ie!==null){Ie.return=c.return,Gt=Ie;break}Gt=c.return}}var wx=Math.ceil,Zp=S.ReactCurrentDispatcher,hg=S.ReactCurrentOwner,El=S.ReactCurrentBatchConfig,ur=0,Za=null,xa=null,bo=0,Zs=0,qh=Mo(0),Ia=0,Rd=null,Bf=0,Qp=0,dg=0,Md=null,Os=null,pg=0,Uh=1/0,ac=null,Jp=!1,gg=null,Kc=null,e1=!1,Zc=null,t1=0,Id=0,vg=null,n1=-1,r1=0;function es(){return(ur&6)!==0?kr():n1!==-1?n1:n1=kr()}function Qc(l){return(l.mode&1)===0?1:(ur&2)!==0&&bo!==0?bo&-bo:Ur.transition!==null?(r1===0&&(r1=Vu()),r1):(l=Mn,l!==0||(l=window.event,l=l===void 0?16:Rl(l.type)),l)}function Kl(l,c,w,N){if(50<Id)throw Id=0,vg=null,Error(n(185));Tl(l,w,N),((ur&2)===0||l!==Za)&&(l===Za&&((ur&2)===0&&(Qp|=w),Ia===4&&Jc(l,bo)),Cs(l,N),w===1&&ur===0&&(c.mode&1)===0&&(Uh=kr()+500,$l&&ne()))}function Cs(l,c){var w=l.callbackNode;Zr(l,c);var N=Zi(l,l===Za?bo:0);if(N===0)w!==null&&is(w),l.callbackNode=null,l.callbackPriority=0;else if(c=N&-N,l.callbackPriority!==c){if(w!=null&&is(w),c===1)l.tag===0?Y(qy.bind(null,l)):R(qy.bind(null,l)),Lh(function(){(ur&6)===0&&ne()}),w=null;else{switch(xo(N)){case 1:w=as;break;case 4:w=Pa;break;case 16:w=os;break;case 536870912:w=ll;break;default:w=os}w=Xy(w,zy.bind(null,l))}l.callbackPriority=c,l.callbackNode=w}}function zy(l,c){if(n1=-1,r1=0,(ur&6)!==0)throw Error(n(327));var w=l.callbackNode;if(Hh()&&l.callbackNode!==w)return null;var N=Zi(l,l===Za?bo:0);if(N===0)return null;if((N&30)!==0||(N&l.expiredLanes)!==0||c)c=i1(l,N);else{c=N;var G=ur;ur|=2;var Q=Hy();(Za!==l||bo!==c)&&(ac=null,Uh=kr()+500,qf(l,c));do try{Sx();break}catch(Ie){Uy(l,Ie)}while(!0);Wn(),Zp.current=Q,ur=G,xa!==null?c=0:(Za=null,bo=0,c=Ia)}if(c!==0){if(c===2&&(G=ls(l),G!==0&&(N=G,c=mg(l,G))),c===1)throw w=Rd,qf(l,0),Jc(l,N),Cs(l,kr()),w;if(c===6)Jc(l,N);else{if(G=l.current.alternate,(N&30)===0&&!_x(G)&&(c=i1(l,N),c===2&&(Q=ls(l),Q!==0&&(N=Q,c=mg(l,Q))),c===1))throw w=Rd,qf(l,0),Jc(l,N),Cs(l,kr()),w;switch(l.finishedWork=G,l.finishedLanes=N,c){case 0:case 1:throw Error(n(345));case 2:Uf(l,Os,ac);break;case 3:if(Jc(l,N),(N&130023424)===N&&(c=pg+500-kr(),10<c)){if(Zi(l,0)!==0)break;if(G=l.suspendedLanes,(G&N)!==N){es(),l.pingedLanes|=l.suspendedLanes&G;break}l.timeoutHandle=co(Uf.bind(null,l,Os,ac),c);break}Uf(l,Os,ac);break;case 4:if(Jc(l,N),(N&4194240)===N)break;for(c=l.eventTimes,G=-1;0<N;){var he=31-En(N);Q=1<<he,he=c[he],he>G&&(G=he),N&=~Q}if(N=G,N=kr()-N,N=(120>N?120:480>N?480:1080>N?1080:1920>N?1920:3e3>N?3e3:4320>N?4320:1960*wx(N/1960))-N,10<N){l.timeoutHandle=co(Uf.bind(null,l,Os,ac),N);break}Uf(l,Os,ac);break;case 5:Uf(l,Os,ac);break;default:throw Error(n(329))}}}return Cs(l,kr()),l.callbackNode===w?zy.bind(null,l):null}function mg(l,c){var w=Md;return l.current.memoizedState.isDehydrated&&(qf(l,c).flags|=256),l=i1(l,c),l!==2&&(c=Os,Os=w,c!==null&&yg(c)),l}function yg(l){Os===null?Os=l:Os.push.apply(Os,l)}function _x(l){for(var c=l;;){if(c.flags&16384){var w=c.updateQueue;if(w!==null&&(w=w.stores,w!==null))for(var N=0;N<w.length;N++){var G=w[N],Q=G.getSnapshot;G=G.value;try{if(!Pr(Q(),G))return!1}catch{return!1}}}if(w=c.child,c.subtreeFlags&16384&&w!==null)w.return=c,c=w;else{if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Jc(l,c){for(c&=~dg,c&=~Qp,l.suspendedLanes|=c,l.pingedLanes&=~c,l=l.expirationTimes;0<c;){var w=31-En(c),N=1<<w;l[w]=-1,c&=~N}}function qy(l){if((ur&6)!==0)throw Error(n(327));Hh();var c=Zi(l,0);if((c&1)===0)return Cs(l,kr()),null;var w=i1(l,c);if(l.tag!==0&&w===2){var N=ls(l);N!==0&&(c=N,w=mg(l,N))}if(w===1)throw w=Rd,qf(l,0),Jc(l,c),Cs(l,kr()),w;if(w===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=c,Uf(l,Os,ac),Cs(l,kr()),null}function bg(l,c){var w=ur;ur|=1;try{return l(c)}finally{ur=w,ur===0&&(Uh=kr()+500,$l&&ne())}}function zf(l){Zc!==null&&Zc.tag===0&&(ur&6)===0&&Hh();var c=ur;ur|=1;var w=El.transition,N=Mn;try{if(El.transition=null,Mn=1,l)return l()}finally{Mn=N,El.transition=w,ur=c,(ur&6)===0&&ne()}}function wg(){Zs=qh.current,nr(qh)}function qf(l,c){l.finishedWork=null,l.finishedLanes=0;var w=l.timeoutHandle;if(w!==-1&&(l.timeoutHandle=-1,Fc(w)),xa!==null)for(w=xa.return;w!==null;){var N=w;switch(Xe(N),N.tag){case 1:N=N.type.childContextTypes,N!=null&&_u();break;case 3:hr(),nr(va),nr(Hi),wa();break;case 5:Xs(N);break;case 4:hr();break;case 13:nr(dr);break;case 19:nr(dr);break;case 10:Or(N.type._context);break;case 22:case 23:wg()}w=w.return}if(Za=l,xa=l=ef(l.current,null),bo=Zs=c,Ia=0,Rd=null,dg=Qp=Bf=0,Os=Md=null,rr!==null){for(c=0;c<rr.length;c++)if(w=rr[c],N=w.interleaved,N!==null){w.interleaved=null;var G=N.next,Q=w.pending;if(Q!==null){var he=Q.next;Q.next=G,N.next=he}w.pending=N}rr=null}return l}function Uy(l,c){do{var w=xa;try{if(Wn(),Su.current=Gc,ho){for(var N=lr.memoizedState;N!==null;){var G=N.queue;G!==null&&(G.pending=null),N=N.next}ho=!1}if(Gi=0,Gr=$r=lr=null,Io=!1,po=0,hg.current=null,w===null||w.return===null){Ia=1,Rd=c,xa=null;break}e:{var Q=l,he=w.return,Ie=w,ze=c;if(c=bo,Ie.flags|=32768,ze!==null&&typeof ze=="object"&&typeof ze.then=="function"){var rt=ze,vt=Ie,yt=vt.tag;if((vt.mode&1)===0&&(yt===0||yt===11||yt===15)){var gt=vt.alternate;gt?(vt.updateQueue=gt.updateQueue,vt.memoizedState=gt.memoizedState,vt.lanes=gt.lanes):(vt.updateQueue=null,vt.memoizedState=null)}var qt=C(he);if(qt!==null){qt.flags&=-257,z(qt,he,Ie,Q,c),qt.mode&1&&m(Q,rt,c),c=qt,ze=rt;var Vt=c.updateQueue;if(Vt===null){var Xt=new Set;Xt.add(ze),c.updateQueue=Xt}else Vt.add(ze);break e}else{if((c&1)===0){m(Q,rt,c),_g();break e}ze=Error(n(426))}}else if(ft&&Ie.mode&1){var aa=C(he);if(aa!==null){(aa.flags&65536)===0&&(aa.flags|=256),z(aa,he,Ie,Q,c),St(ic(ze,Ie));break e}}Q=ze=ic(ze,Ie),Ia!==4&&(Ia=2),Md===null?Md=[Q]:Md.push(Q),Q=he;do{switch(Q.tag){case 3:Q.flags|=65536,c&=-c,Q.lanes|=c;var et=Yp(Q,ze,c);ir(Q,et);break e;case 1:Ie=ze;var We=Q.type,tt=Q.stateNode;if((Q.flags&128)===0&&(typeof We.getDerivedStateFromError=="function"||tt!==null&&typeof tt.componentDidCatch=="function"&&(Kc===null||!Kc.has(tt)))){Q.flags|=65536,c&=-c,Q.lanes|=c;var _t=d(Q,Ie,c);ir(Q,_t);break e}}Q=Q.return}while(Q!==null)}Gy(w)}catch(Kt){c=Kt,xa===w&&w!==null&&(xa=w=w.return);continue}break}while(!0)}function Hy(){var l=Zp.current;return Zp.current=Gc,l===null?Gc:l}function _g(){(Ia===0||Ia===3||Ia===2)&&(Ia=4),Za===null||(Bf&268435455)===0&&(Qp&268435455)===0||Jc(Za,bo)}function i1(l,c){var w=ur;ur|=2;var N=Hy();(Za!==l||bo!==c)&&(ac=null,qf(l,c));do try{xx();break}catch(G){Uy(l,G)}while(!0);if(Wn(),ur=w,Zp.current=N,xa!==null)throw Error(n(261));return Za=null,bo=0,Ia}function xx(){for(;xa!==null;)$y(xa)}function Sx(){for(;xa!==null&&!lu();)$y(xa)}function $y(l){var c=Yy(l.alternate,l,Zs);l.memoizedProps=l.pendingProps,c===null?Gy(l):xa=c,hg.current=null}function Gy(l){var c=l;do{var w=c.alternate;if(l=c.return,(c.flags&32768)===0){if(w=gx(w,c,Zs),w!==null){xa=w;return}}else{if(w=vx(w,c),w!==null){w.flags&=32767,xa=w;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{Ia=6,xa=null;return}}if(c=c.sibling,c!==null){xa=c;return}xa=c=l}while(c!==null);Ia===0&&(Ia=5)}function Uf(l,c,w){var N=Mn,G=El.transition;try{El.transition=null,Mn=1,Ex(l,c,w,N)}finally{El.transition=G,Mn=N}return null}function Ex(l,c,w,N){do Hh();while(Zc!==null);if((ur&6)!==0)throw Error(n(327));w=l.finishedWork;var G=l.finishedLanes;if(w===null)return null;if(l.finishedWork=null,l.finishedLanes=0,w===l.current)throw Error(n(177));l.callbackNode=null,l.callbackPriority=0;var Q=w.lanes|w.childLanes;if(us(l,Q),l===Za&&(xa=Za=null,bo=0),(w.subtreeFlags&2064)===0&&(w.flags&2064)===0||e1||(e1=!0,Xy(os,function(){return Hh(),null})),Q=(w.flags&15990)!==0,(w.subtreeFlags&15990)!==0||Q){Q=El.transition,El.transition=null;var he=Mn;Mn=1;var Ie=ur;ur|=4,hg.current=null,yx(l,w),Iy(w,l),$s(Ul),du=!!Ju,Ul=Ju=null,l.current=w,bx(w),Tf(),ur=Ie,Mn=he,El.transition=Q}else l.current=w;if(e1&&(e1=!1,Zc=l,t1=G),Q=l.pendingLanes,Q===0&&(Kc=null),cr(w.stateNode),Cs(l,kr()),c!==null)for(N=l.onRecoverableError,w=0;w<c.length;w++)G=c[w],N(G.value,{componentStack:G.stack,digest:G.digest});if(Jp)throw Jp=!1,l=gg,gg=null,l;return(t1&1)!==0&&l.tag!==0&&Hh(),Q=l.pendingLanes,(Q&1)!==0?l===vg?Id++:(Id=0,vg=l):Id=0,ne(),null}function Hh(){if(Zc!==null){var l=xo(t1),c=El.transition,w=Mn;try{if(El.transition=null,Mn=16>l?16:l,Zc===null)var N=!1;else{if(l=Zc,Zc=null,t1=0,(ur&6)!==0)throw Error(n(331));var G=ur;for(ur|=4,Gt=l.current;Gt!==null;){var Q=Gt,he=Q.child;if((Gt.flags&16)!==0){var Ie=Q.deletions;if(Ie!==null){for(var ze=0;ze<Ie.length;ze++){var rt=Ie[ze];for(Gt=rt;Gt!==null;){var vt=Gt;switch(vt.tag){case 0:case 11:case 15:Td(8,vt,Q)}var yt=vt.child;if(yt!==null)yt.return=vt,Gt=yt;else for(;Gt!==null;){vt=Gt;var gt=vt.sibling,qt=vt.return;if(Ly(vt),vt===rt){Gt=null;break}if(gt!==null){gt.return=qt,Gt=gt;break}Gt=qt}}}var Vt=Q.alternate;if(Vt!==null){var Xt=Vt.child;if(Xt!==null){Vt.child=null;do{var aa=Xt.sibling;Xt.sibling=null,Xt=aa}while(Xt!==null)}}Gt=Q}}if((Q.subtreeFlags&2064)!==0&&he!==null)he.return=Q,Gt=he;else e:for(;Gt!==null;){if(Q=Gt,(Q.flags&2048)!==0)switch(Q.tag){case 0:case 11:case 15:Td(9,Q,Q.return)}var et=Q.sibling;if(et!==null){et.return=Q.return,Gt=et;break e}Gt=Q.return}}var We=l.current;for(Gt=We;Gt!==null;){he=Gt;var tt=he.child;if((he.subtreeFlags&2064)!==0&&tt!==null)tt.return=he,Gt=tt;else e:for(he=We;Gt!==null;){if(Ie=Gt,(Ie.flags&2048)!==0)try{switch(Ie.tag){case 0:case 11:case 15:Kp(9,Ie)}}catch(Kt){Wi(Ie,Ie.return,Kt)}if(Ie===he){Gt=null;break e}var _t=Ie.sibling;if(_t!==null){_t.return=Ie.return,Gt=_t;break e}Gt=Ie.return}}if(ur=G,ne(),gi&&typeof gi.onPostCommitFiberRoot=="function")try{gi.onPostCommitFiberRoot(_o,l)}catch{}N=!0}return N}finally{Mn=w,El.transition=c}}return!1}function Wy(l,c,w){c=ic(w,c),c=Yp(l,c,1),l=Hr(l,c,1),c=es(),l!==null&&(Tl(l,1,c),Cs(l,c))}function Wi(l,c,w){if(l.tag===3)Wy(l,l,w);else for(;c!==null;){if(c.tag===3){Wy(c,l,w);break}else if(c.tag===1){var N=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof N.componentDidCatch=="function"&&(Kc===null||!Kc.has(N))){l=ic(w,l),l=d(c,l,1),c=Hr(c,l,1),l=es(),c!==null&&(Tl(c,1,l),Cs(c,l));break}}c=c.return}}function kx(l,c,w){var N=l.pingCache;N!==null&&N.delete(c),c=es(),l.pingedLanes|=l.suspendedLanes&w,Za===l&&(bo&w)===w&&(Ia===4||Ia===3&&(bo&130023424)===bo&&500>kr()-pg?qf(l,0):dg|=w),Cs(l,c)}function Vy(l,c){c===0&&((l.mode&1)===0?c=1:(c=Ki,Ki<<=1,(Ki&130023424)===0&&(Ki=4194304)));var w=es();l=Qn(l,c),l!==null&&(Tl(l,c,w),Cs(l,w))}function Ax(l){var c=l.memoizedState,w=0;c!==null&&(w=c.retryLane),Vy(l,w)}function Px(l,c){var w=0;switch(l.tag){case 13:var N=l.stateNode,G=l.memoizedState;G!==null&&(w=G.retryLane);break;case 19:N=l.stateNode;break;default:throw Error(n(314))}N!==null&&N.delete(c),Vy(l,w)}var Yy;Yy=function(l,c,w){if(l!==null)if(l.memoizedProps!==c.pendingProps||va.current)re=!0;else{if((l.lanes&w)===0&&(c.flags&128)===0)return re=!1,og(l,c,w);re=(l.flags&131072)!==0}else re=!1,ft&&(c.flags&1048576)!==0&&Qe(c,be,c.index);switch(c.lanes=0,c.tag){case 2:var N=c.type;Gn(l,c),l=c.pendingProps;var G=Hl(c,Hi.current);Cr(c,w),G=xl(null,c,N,l,G,w);var Q=go();return c.flags|=1,typeof G=="object"&&G!==null&&typeof G.render=="function"&&G.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,ma(N)?(Q=!0,xs(c)):Q=!1,c.memoizedState=G.state!==null&&G.state!==void 0?G.state:null,Ri(c),G.updater=Vc,c.stateNode=G,G._reactInternals=c,Fh(c,N,l,w),c=mr(null,c,N,!0,Q,w)):(c.tag=0,ft&&Q&&lt(c),_e(null,c,G,w),c=c.child),c;case 16:N=c.elementType;e:{switch(Gn(l,c),l=c.pendingProps,G=N._init,N=G(N._payload),c.type=N,G=c.tag=Cx(N),l=Ma(N,l),G){case 0:c=Tt(null,c,N,l,w);break e;case 1:c=Fr(null,c,N,l,w);break e;case 11:c=Ye(null,c,N,l,w);break e;case 14:c=it(null,c,N,Ma(N.type,l),w);break e}throw Error(n(306,N,""))}return c;case 0:return N=c.type,G=c.pendingProps,G=c.elementType===N?G:Ma(N,G),Tt(l,c,N,G,w);case 1:return N=c.type,G=c.pendingProps,G=c.elementType===N?G:Ma(N,G),Fr(l,c,N,G,w);case 3:e:{if(mo(c),l===null)throw Error(n(387));N=c.pendingProps,Q=c.memoizedState,G=Q.element,ya(l,c),$i(c,N,null,w);var he=c.memoizedState;if(N=he.element,Q.isDehydrated)if(Q={element:N,isDehydrated:!1,cache:he.cache,pendingSuspenseBoundaries:he.pendingSuspenseBoundaries,transitions:he.transitions},c.updateQueue.baseState=Q,c.memoizedState=Q,c.flags&256){G=ic(Error(n(423)),c),c=Sl(l,c,N,w,G);break e}else if(N!==G){G=ic(Error(n(424)),c),c=Sl(l,c,N,w,G);break e}else for(He=ea(c.stateNode.containerInfo.firstChild),ot=c,ft=!0,ht=null,w=$n(c,null,N,w),c.child=w;w;)w.flags=w.flags&-3|4096,w=w.sibling;else{if(Ft(),N===G){c=Ka(l,c,w);break e}_e(l,c,N,w)}c=c.child}return c;case 5:return xu(c),l===null&&zt(c),N=c.type,G=c.pendingProps,Q=l!==null?l.memoizedProps:null,he=G.children,If(N,G)?he=null:Q!==null&&If(N,Q)&&(c.flags|=32),wn(l,c),_e(l,c,he,w),c.child;case 6:return l===null&&zt(c),null;case 13:return ut(l,c,w);case 4:return Zo(c,c.stateNode.containerInfo),N=c.pendingProps,l===null?c.child=fi(c,null,N,w):_e(l,c,N,w),c.child;case 11:return N=c.type,G=c.pendingProps,G=c.elementType===N?G:Ma(N,G),Ye(l,c,N,G,w);case 7:return _e(l,c,c.pendingProps,w),c.child;case 8:return _e(l,c,c.pendingProps.children,w),c.child;case 12:return _e(l,c,c.pendingProps.children,w),c.child;case 10:e:{if(N=c.type._context,G=c.pendingProps,Q=c.memoizedProps,he=G.value,sr(wi,N._currentValue),N._currentValue=he,Q!==null)if(Pr(Q.value,he)){if(Q.children===G.children&&!va.current){c=Ka(l,c,w);break e}}else for(Q=c.child,Q!==null&&(Q.return=c);Q!==null;){var Ie=Q.dependencies;if(Ie!==null){he=Q.child;for(var ze=Ie.firstContext;ze!==null;){if(ze.context===N){if(Q.tag===1){ze=ti(-1,w&-w),ze.tag=2;var rt=Q.updateQueue;if(rt!==null){rt=rt.shared;var vt=rt.pending;vt===null?ze.next=ze:(ze.next=vt.next,vt.next=ze),rt.pending=ze}}Q.lanes|=w,ze=Q.alternate,ze!==null&&(ze.lanes|=w),Vn(Q.return,w,c),Ie.lanes|=w;break}ze=ze.next}}else if(Q.tag===10)he=Q.type===c.type?null:Q.child;else if(Q.tag===18){if(he=Q.return,he===null)throw Error(n(341));he.lanes|=w,Ie=he.alternate,Ie!==null&&(Ie.lanes|=w),Vn(he,w,c),he=Q.sibling}else he=Q.child;if(he!==null)he.return=Q;else for(he=Q;he!==null;){if(he===c){he=null;break}if(Q=he.sibling,Q!==null){Q.return=he.return,he=Q;break}he=he.return}Q=he}_e(l,c,G.children,w),c=c.child}return c;case 9:return G=c.type,N=c.pendingProps.children,Cr(c,w),G=Lr(G),N=N(G),c.flags|=1,_e(l,c,N,w),c.child;case 14:return N=c.type,G=Ma(N,c.pendingProps),G=Ma(N.type,G),it(l,c,N,G,w);case 15:return wt(l,c,c.type,c.pendingProps,w);case 17:return N=c.type,G=c.pendingProps,G=c.elementType===N?G:Ma(N,G),Gn(l,c),c.tag=1,ma(N)?(l=!0,xs(c)):l=!1,Cr(c,w),Vp(c,N,G),Fh(c,N,G,w),mr(null,c,N,!0,l,w);case 19:return ia(l,c,w);case 22:return $t(l,c,w)}throw Error(n(156,c.tag))};function Xy(l,c){return Bs(l,c)}function Ox(l,c,w,N){this.tag=l,this.key=w,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=N,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kl(l,c,w,N){return new Ox(l,c,w,N)}function xg(l){return l=l.prototype,!(!l||!l.isReactComponent)}function Cx(l){if(typeof l=="function")return xg(l)?1:0;if(l!=null){if(l=l.$$typeof,l===L)return 11;if(l===J)return 14}return 2}function ef(l,c){var w=l.alternate;return w===null?(w=kl(l.tag,c,l.key,l.mode),w.elementType=l.elementType,w.type=l.type,w.stateNode=l.stateNode,w.alternate=l,l.alternate=w):(w.pendingProps=c,w.type=l.type,w.flags=0,w.subtreeFlags=0,w.deletions=null),w.flags=l.flags&14680064,w.childLanes=l.childLanes,w.lanes=l.lanes,w.child=l.child,w.memoizedProps=l.memoizedProps,w.memoizedState=l.memoizedState,w.updateQueue=l.updateQueue,c=l.dependencies,w.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},w.sibling=l.sibling,w.index=l.index,w.ref=l.ref,w}function a1(l,c,w,N,G,Q){var he=2;if(N=l,typeof l=="function")xg(l)&&(he=1);else if(typeof l=="string")he=5;else e:switch(l){case O:return Hf(w.children,G,Q,c);case M:he=8,G|=8;break;case F:return l=kl(12,w,c,G|2),l.elementType=F,l.lanes=Q,l;case $:return l=kl(13,w,c,G),l.elementType=$,l.lanes=Q,l;case q:return l=kl(19,w,c,G),l.elementType=q,l.lanes=Q,l;case ie:return o1(w,G,Q,c);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case j:he=10;break e;case T:he=9;break e;case L:he=11;break e;case J:he=14;break e;case ae:he=16,N=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return c=kl(he,w,c,G),c.elementType=l,c.type=N,c.lanes=Q,c}function Hf(l,c,w,N){return l=kl(7,l,N,c),l.lanes=w,l}function o1(l,c,w,N){return l=kl(22,l,N,c),l.elementType=ie,l.lanes=w,l.stateNode={isHidden:!1},l}function Sg(l,c,w){return l=kl(6,l,null,c),l.lanes=w,l}function Eg(l,c,w){return c=kl(4,l.children!==null?l.children:[],l.key,c),c.lanes=w,c.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},c}function Lx(l,c,w,N,G){this.tag=c,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Oa(0),this.expirationTimes=Oa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Oa(0),this.identifierPrefix=N,this.onRecoverableError=G,this.mutableSourceEagerHydrationData=null}function kg(l,c,w,N,G,Q,he,Ie,ze){return l=new Lx(l,c,w,Ie,ze),c===1?(c=1,Q===!0&&(c|=8)):c=0,Q=kl(3,null,null,c),l.current=Q,Q.stateNode=l,Q.memoizedState={element:N,isDehydrated:w,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ri(Q),l}function Nx(l,c,w){var N=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:I,key:N==null?null:""+N,children:l,containerInfo:c,implementation:w}}function Ky(l){if(!l)return _s;l=l._reactInternals;e:{if(si(l)!==l||l.tag!==1)throw Error(n(170));var c=l;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(ma(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(n(171))}if(l.tag===1){var w=l.type;if(ma(w))return tc(l,w,c)}return c}function Zy(l,c,w,N,G,Q,he,Ie,ze){return l=kg(w,N,!0,l,G,Q,he,Ie,ze),l.context=Ky(null),w=l.current,N=es(),G=Qc(w),Q=ti(N,G),Q.callback=c??null,Hr(w,Q,G),l.current.lanes=G,Tl(l,G,N),Cs(l,N),l}function s1(l,c,w,N){var G=c.current,Q=es(),he=Qc(G);return w=Ky(w),c.context===null?c.context=w:c.pendingContext=w,c=ti(Q,he),c.payload={element:l},N=N===void 0?null:N,N!==null&&(c.callback=N),l=Hr(G,c,he),l!==null&&(Kl(l,G,he,Q),ba(l,G,he)),he}function l1(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 5:return l.child.stateNode;default:return l.child.stateNode}}function Qy(l,c){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var w=l.retryLane;l.retryLane=w!==0&&w<c?w:c}}function Ag(l,c){Qy(l,c),(l=l.alternate)&&Qy(l,c)}function Tx(){return null}var Jy=typeof reportError=="function"?reportError:function(l){console.error(l)};function Pg(l){this._internalRoot=l}u1.prototype.render=Pg.prototype.render=function(l){var c=this._internalRoot;if(c===null)throw Error(n(409));s1(l,c,null,null)},u1.prototype.unmount=Pg.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var c=l.containerInfo;zf(function(){s1(null,l,null,null)}),c[na]=null}};function u1(l){this._internalRoot=l}u1.prototype.unstable_scheduleHydration=function(l){if(l){var c=Pc();l={blockedOn:null,target:l,priority:c};for(var w=0;w<So.length&&c!==0&&c<So[w].priority;w++);So.splice(w,0,l),w===0&&fu(l)}};function Og(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function c1(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function e5(){}function Rx(l,c,w,N,G){if(G){if(typeof N=="function"){var Q=N;N=function(){var rt=l1(he);Q.call(rt)}}var he=Zy(c,N,l,0,null,!1,!1,"",e5);return l._reactRootContainer=he,l[na]=he.current,Ws(l.nodeType===8?l.parentNode:l),zf(),he}for(;G=l.lastChild;)l.removeChild(G);if(typeof N=="function"){var Ie=N;N=function(){var rt=l1(ze);Ie.call(rt)}}var ze=kg(l,0,!1,null,null,!1,!1,"",e5);return l._reactRootContainer=ze,l[na]=ze.current,Ws(l.nodeType===8?l.parentNode:l),zf(function(){s1(c,ze,w,N)}),ze}function f1(l,c,w,N,G){var Q=w._reactRootContainer;if(Q){var he=Q;if(typeof G=="function"){var Ie=G;G=function(){var ze=l1(he);Ie.call(ze)}}s1(c,he,l,G)}else he=Rx(w,c,l,G,N);return l1(he)}cs=function(l){switch(l.tag){case 3:var c=l.stateNode;if(c.current.memoizedState.isDehydrated){var w=Mr(c.pendingLanes);w!==0&&(cu(c,w|1),Cs(c,kr()),(ur&6)===0&&(Uh=kr()+500,ne()))}break;case 13:zf(function(){var N=Qn(l,1);if(N!==null){var G=es();Kl(N,l,1,G)}}),Ag(l,1)}},cl=function(l){if(l.tag===13){var c=Qn(l,134217728);if(c!==null){var w=es();Kl(c,l,134217728,w)}Ag(l,134217728)}},Ac=function(l){if(l.tag===13){var c=Qc(l),w=Qn(l,c);if(w!==null){var N=es();Kl(w,l,c,N)}Ag(l,c)}},Pc=function(){return Mn},fl=function(l,c){var w=Mn;try{return Mn=l,c()}finally{Mn=w}},an=function(l,c,w){switch(c){case"input":if(Be(l,w),c=w.name,w.type==="radio"&&c!=null){for(w=l;w.parentNode;)w=w.parentNode;for(w=w.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<w.length;c++){var N=w[c];if(N!==l&&N.form===l.form){var G=Ni(N);if(!G)throw Error(n(90));Oe(N),Be(N,G)}}}break;case"textarea":Pe(l,w);break;case"select":c=w.value,c!=null&&Ne(l,!!w.multiple,c,!1)}},oi=bg,Ei=zf;var Mx={usingClientEntryPoint:!1,Events:[wu,yi,Ni,gn,Bi,bg]},jd={findFiberByHostInstance:Ys,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Ix={bundleType:jd.bundleType,version:jd.version,rendererPackageName:jd.rendererPackageName,rendererConfig:jd.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:S.ReactCurrentDispatcher,findHostInstanceByFiber:function(l){return l=zi(l),l===null?null:l.stateNode},findFiberByHostInstance:jd.findFiberByHostInstance||Tx,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 h1=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!h1.isDisabled&&h1.supportsFiber)try{_o=h1.inject(Ix),gi=h1}catch{}}return Ls.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Mx,Ls.createPortal=function(l,c){var w=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Og(c))throw Error(n(200));return Nx(l,c,null,w)},Ls.createRoot=function(l,c){if(!Og(l))throw Error(n(299));var w=!1,N="",G=Jy;return c!=null&&(c.unstable_strictMode===!0&&(w=!0),c.identifierPrefix!==void 0&&(N=c.identifierPrefix),c.onRecoverableError!==void 0&&(G=c.onRecoverableError)),c=kg(l,1,!1,null,null,w,!1,N,G),l[na]=c.current,Ws(l.nodeType===8?l.parentNode:l),new Pg(c)},Ls.findDOMNode=function(l){if(l==null)return null;if(l.nodeType===1)return l;var c=l._reactInternals;if(c===void 0)throw typeof l.render=="function"?Error(n(188)):(l=Object.keys(l).join(","),Error(n(268,l)));return l=zi(c),l=l===null?null:l.stateNode,l},Ls.flushSync=function(l){return zf(l)},Ls.hydrate=function(l,c,w){if(!c1(c))throw Error(n(200));return f1(null,l,c,!0,w)},Ls.hydrateRoot=function(l,c,w){if(!Og(l))throw Error(n(405));var N=w!=null&&w.hydratedSources||null,G=!1,Q="",he=Jy;if(w!=null&&(w.unstable_strictMode===!0&&(G=!0),w.identifierPrefix!==void 0&&(Q=w.identifierPrefix),w.onRecoverableError!==void 0&&(he=w.onRecoverableError)),c=Zy(c,null,l,1,w??null,G,!1,Q,he),l[na]=c.current,Ws(l),N)for(l=0;l<N.length;l++)w=N[l],G=w._getVersion,G=G(w._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[w,G]:c.mutableSourceEagerHydrationData.push(w,G);return new u1(c)},Ls.render=function(l,c,w){if(!c1(c))throw Error(n(200));return f1(null,l,c,!1,w)},Ls.unmountComponentAtNode=function(l){if(!c1(l))throw Error(n(40));return l._reactRootContainer?(zf(function(){f1(null,null,l,!1,function(){l._reactRootContainer=null,l[na]=null})}),!0):!1},Ls.unstable_batchedUpdates=bg,Ls.unstable_renderSubtreeIntoContainer=function(l,c,w,N){if(!c1(w))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return f1(l,c,w,!1,N)},Ls.version="18.3.1-next-f1338f8080-20240426",Ls}var o5;function Kw(){if(o5)return Lg.exports;o5=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Lg.exports=zx(),Lg.exports}var s5;function qx(){if(s5)return d1;s5=1;var t=Kw();return d1.createRoot=t.createRoot,d1.hydrateRoot=t.hydrateRoot,d1}var Ux=qx();const Zw=ph(Ux);function Fn(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];throw new Error(typeof t=="number"?"[MobX] minified error nr: "+t+(n.length?" "+n.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+t)}var Hx={};function C0(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:Hx}var Qw=Object.assign,o0=Object.getOwnPropertyDescriptor,Iu=Object.defineProperty,L0=Object.prototype,$v=[];Object.freeze($v);var Dm={};Object.freeze(Dm);var $x=typeof Proxy<"u",Gx=Object.toString();function Jw(){$x||Fn("Proxy not available")}function e6(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}var td=function(){};function ol(t){return typeof t=="function"}function oh(t){var e=typeof t;switch(e){case"string":case"symbol":case"number":return!0}return!1}function N0(t){return t!==null&&typeof t=="object"}function mf(t){if(!N0(t))return!1;var e=Object.getPrototypeOf(t);if(e==null)return!0;var n=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n.toString()===Gx}function t6(t){var e=t?.constructor;return e?e.name==="GeneratorFunction"||e.displayName==="GeneratorFunction":!1}function T0(t,e,n){Iu(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function n6(t,e,n){Iu(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}function Sf(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(r){return N0(r)&&r[n]===!0}}function yd(t){return t!=null&&Object.prototype.toString.call(t)==="[object Map]"}function Wx(t){var e=Object.getPrototypeOf(t),n=Object.getPrototypeOf(e),r=Object.getPrototypeOf(n);return r===null}function dc(t){return t!=null&&Object.prototype.toString.call(t)==="[object Set]"}var r6=typeof Object.getOwnPropertySymbols<"u";function Vx(t){var e=Object.keys(t);if(!r6)return e;var n=Object.getOwnPropertySymbols(t);return n.length?[].concat(e,n.filter(function(r){return L0.propertyIsEnumerable.call(t,r)})):e}var R0=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:r6?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames;function i6(t){return t===null?null:typeof t=="object"?""+t:t}function vc(t,e){return L0.hasOwnProperty.call(t,e)}var Yx=Object.getOwnPropertyDescriptors||function(e){var n={};return R0(e).forEach(function(r){n[r]=o0(e,r)}),n};function tl(t,e){return!!(t&e)}function nl(t,e,n){return n?t|=e:t&=~e,t}function l5(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Xx(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Zx(r.key),r)}}function bd(t,e,n){return e&&Xx(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function nd(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=Qx(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
33
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yf(){return yf=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},yf.apply(null,arguments)}function a6(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Gv(t,e)}function Gv(t,e){return Gv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Gv(t,e)}function Kx(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Zx(t){var e=Kx(t,"string");return typeof e=="symbol"?e:e+""}function Qx(t,e){if(t){if(typeof t=="string")return l5(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l5(t,e):void 0}}var Nu=Symbol("mobx-stored-annotations");function ju(t){function e(n,r){if(Cp(r))return t.decorate_20223_(n,r);Op(n,r,t)}return Object.assign(e,t)}function Op(t,e,n){vc(t,Nu)||T0(t,Nu,yf({},t[Nu])),a9(n)||(t[Nu][e]=n)}function Jx(t){return vc(t,Nu)||T0(t,Nu,yf({},t[Nu])),t[Nu]}function Cp(t){return typeof t=="object"&&typeof t.kind=="string"}var vn=Symbol("mobx administration"),Ef=(function(){function t(n){n===void 0&&(n="Atom"),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=gr.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=n}var e=t.prototype;return e.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},e.reportObserved=function(){return x6(this)},e.reportChanged=function(){Ts(),S6(this),Rs()},e.toString=function(){return this.name_},bd(t,[{key:"isBeingObserved",get:function(){return tl(this.flags_,t.isBeingObservedMask_)},set:function(r){this.flags_=nl(this.flags_,t.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return tl(this.flags_,t.isPendingUnobservationMask_)},set:function(r){this.flags_=nl(this.flags_,t.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return tl(this.flags_,t.diffValueMask_)?1:0},set:function(r){this.flags_=nl(this.flags_,t.diffValueMask_,r===1)}}])})();Ef.isBeingObservedMask_=1;Ef.isPendingUnobservationMask_=2;Ef.diffValueMask_=4;var Fm=Sf("Atom",Ef);function s0(t,e,n){e===void 0&&(e=td),n===void 0&&(n=td);var r=new Ef(t);return e!==td&&lS(r,e),n!==td&&N6(r,n),r}function e9(t,e){return Y6(t,e)}function t9(t,e){return Object.is?Object.is(t,e):t===e?t!==0||1/t===1/e:t!==t&&e!==e}var fd={structural:e9,default:t9};function sh(t,e,n){return j6(t)?t:Array.isArray(t)?Kn.array(t,{name:n}):mf(t)?Kn.object(t,void 0,{name:n}):yd(t)?Kn.map(t,{name:n}):dc(t)?Kn.set(t,{name:n}):typeof t=="function"&&!gp(t)&&!vp(t)?t6(t)?hd(t):pp(n,t):t}function n9(t,e,n){if(t==null||iu(t)||Hu(t)||Nl(t)||ns(t))return t;if(Array.isArray(t))return Kn.array(t,{name:n,deep:!1});if(mf(t))return Kn.object(t,void 0,{name:n,deep:!1});if(yd(t))return Kn.map(t,{name:n,deep:!1});if(dc(t))return Kn.set(t,{name:n,deep:!1})}function M0(t){return t}function r9(t,e){return Y6(t,e)?e:t}var i9="override";function a9(t){return t.annotationType_===i9}function Lp(t,e){return{annotationType_:t,options_:e,make_:o9,extend_:s9,decorate_20223_:l9}}function o9(t,e,n,r){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(t,e,n,!1)===null?0:1;if(r===t.target_)return this.extend_(t,e,n,!1)===null?0:2;if(gp(n.value))return 1;var a=o6(t,this,e,n,!1);return Iu(r,e,a),2}function s9(t,e,n,r){var i=o6(t,this,e,n);return t.defineProperty_(e,i,r)}function l9(t,e){var n=e.kind,r=e.name,i=e.addInitializer,a=this,o=function(h){var f,g,v,p;return bf((f=(g=a.options_)==null?void 0:g.name)!=null?f:r.toString(),h,(v=(p=a.options_)==null?void 0:p.autoAction)!=null?v:!1)};if(n=="field")return function(u){var h,f=u;return gp(f)||(f=o(f)),(h=a.options_)!=null&&h.bound&&(f=f.bind(this),f.isMobxAction=!0),f};if(n=="method"){var s;return gp(t)||(t=o(t)),(s=this.options_)!=null&&s.bound&&i(function(){var u=this,h=u[r].bind(u);h.isMobxAction=!0,u[r]=h}),t}Fn("Cannot apply '"+a.annotationType_+"' to '"+String(r)+"' (kind: "+n+"):"+(`
34
+ '`+a.annotationType_+"' can only be used on properties with a function value."))}function u9(t,e,n,r){e.annotationType_,r.value}function o6(t,e,n,r,i){var a,o,s,u,h,f,g;i===void 0&&(i=Lt.safeDescriptors),u9(t,e,n,r);var v=r.value;if((a=e.options_)!=null&&a.bound){var p;v=v.bind((p=t.proxy_)!=null?p:t.target_)}return{value:bf((o=(s=e.options_)==null?void 0:s.name)!=null?o:n.toString(),v,(u=(h=e.options_)==null?void 0:h.autoAction)!=null?u:!1,(f=e.options_)!=null&&f.bound?(g=t.proxy_)!=null?g:t.target_:void 0),configurable:i?t.isPlainObject_:!0,enumerable:!1,writable:!i}}function s6(t,e){return{annotationType_:t,options_:e,make_:c9,extend_:f9,decorate_20223_:h9}}function c9(t,e,n,r){var i;if(r===t.target_)return this.extend_(t,e,n,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!vc(t.target_,e)||!vp(t.target_[e]))&&this.extend_(t,e,n,!1)===null)return 0;if(vp(n.value))return 1;var a=l6(t,this,e,n,!1,!1);return Iu(r,e,a),2}function f9(t,e,n,r){var i,a=l6(t,this,e,n,(i=this.options_)==null?void 0:i.bound);return t.defineProperty_(e,a,r)}function h9(t,e){var n,r=e.name,i=e.addInitializer;return vp(t)||(t=hd(t)),(n=this.options_)!=null&&n.bound&&i(function(){var a=this,o=a[r].bind(a);o.isMobXFlow=!0,a[r]=o}),t}function d9(t,e,n,r){e.annotationType_,r.value}function l6(t,e,n,r,i,a){a===void 0&&(a=Lt.safeDescriptors),d9(t,e,n,r);var o=r.value;if(vp(o)||(o=hd(o)),i){var s;o=o.bind((s=t.proxy_)!=null?s:t.target_),o.isMobXFlow=!0}return{value:o,configurable:a?t.isPlainObject_:!0,enumerable:!1,writable:!a}}function Bm(t,e){return{annotationType_:t,options_:e,make_:p9,extend_:g9,decorate_20223_:v9}}function p9(t,e,n){return this.extend_(t,e,n,!1)===null?0:1}function g9(t,e,n,r){return m9(t,this,e,n),t.defineComputedProperty_(e,yf({},this.options_,{get:n.get,set:n.set}),r)}function v9(t,e){var n=this,r=e.name,i=e.addInitializer;return i(function(){var a=wd(this)[vn],o=yf({},n.options_,{get:t,context:this});o.name||(o.name="ObservableObject."+r.toString()),a.values_.set(r,new tu(o))}),function(){return this[vn].getObservablePropValue_(r)}}function m9(t,e,n,r){e.annotationType_,r.get}function I0(t,e){return{annotationType_:t,options_:e,make_:y9,extend_:b9,decorate_20223_:w9}}function y9(t,e,n){return this.extend_(t,e,n,!1)===null?0:1}function b9(t,e,n,r){var i,a;return _9(t,this),t.defineObservableProperty_(e,n.value,(i=(a=this.options_)==null?void 0:a.enhancer)!=null?i:sh,r)}function w9(t,e){var n=this,r=e.kind,i=e.name,a=new WeakSet;function o(s,u){var h,f,g=wd(s)[vn],v=new vf(u,(h=(f=n.options_)==null?void 0:f.enhancer)!=null?h:sh,"ObservableObject."+i.toString(),!1);g.values_.set(i,v),a.add(s)}if(r=="accessor")return{get:function(){return a.has(this)||o(this,t.get.call(this)),this[vn].getObservablePropValue_(i)},set:function(u){return a.has(this)||o(this,u),this[vn].setObservablePropValue_(i,u)},init:function(u){return a.has(this)||o(this,u),u}}}function _9(t,e,n,r){e.annotationType_}var x9="true",S9=u6();function u6(t){return{annotationType_:x9,options_:t,make_:E9,extend_:k9,decorate_20223_:A9}}function E9(t,e,n,r){var i,a;if(n.get)return gh.make_(t,e,n,r);if(n.set){var o=bf(e.toString(),n.set);return r===t.target_?t.defineProperty_(e,{configurable:Lt.safeDescriptors?t.isPlainObject_:!0,set:o})===null?0:2:(Iu(r,e,{configurable:!0,set:o}),2)}if(r!==t.target_&&typeof n.value=="function"){var s;if(t6(n.value)){var u,h=(u=this.options_)!=null&&u.autoBind?hd.bound:hd;return h.make_(t,e,n,r)}var f=(s=this.options_)!=null&&s.autoBind?pp.bound:pp;return f.make_(t,e,n,r)}var g=((i=this.options_)==null?void 0:i.deep)===!1?Kn.ref:Kn;if(typeof n.value=="function"&&(a=this.options_)!=null&&a.autoBind){var v;n.value=n.value.bind((v=t.proxy_)!=null?v:t.target_)}return g.make_(t,e,n,r)}function k9(t,e,n,r){var i,a;if(n.get)return gh.extend_(t,e,n,r);if(n.set)return t.defineProperty_(e,{configurable:Lt.safeDescriptors?t.isPlainObject_:!0,set:bf(e.toString(),n.set)},r);if(typeof n.value=="function"&&(i=this.options_)!=null&&i.autoBind){var o;n.value=n.value.bind((o=t.proxy_)!=null?o:t.target_)}var s=((a=this.options_)==null?void 0:a.deep)===!1?Kn.ref:Kn;return s.extend_(t,e,n,r)}function A9(t,e){Fn("'"+this.annotationType_+"' cannot be used as a decorator")}var P9="observable",O9="observable.ref",C9="observable.shallow",L9="observable.struct",c6={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(c6);function p1(t){return t||c6}var Wv=I0(P9),N9=I0(O9,{enhancer:M0}),T9=I0(C9,{enhancer:n9}),R9=I0(L9,{enhancer:r9}),f6=ju(Wv);function g1(t){return t.deep===!0?sh:t.deep===!1?M0:I9(t.defaultDecorator)}function M9(t){var e;return t?(e=t.defaultDecorator)!=null?e:u6(t):void 0}function I9(t){var e,n;return t&&(e=(n=t.options_)==null?void 0:n.enhancer)!=null?e:sh}function h6(t,e,n){if(Cp(e))return Wv.decorate_20223_(t,e);if(oh(e)){Op(t,e,Wv);return}return j6(t)?t:mf(t)?Kn.object(t,e,n):Array.isArray(t)?Kn.array(t,e):yd(t)?Kn.map(t,e):dc(t)?Kn.set(t,e):typeof t=="object"&&t!==null?t:Kn.box(t,e)}Qw(h6,f6);var j9={box:function(e,n){var r=p1(n);return new vf(e,g1(r),r.name,!0,r.equals)},array:function(e,n){var r=p1(n);return(Lt.useProxies===!1||r.proxy===!1?FS:OS)(e,g1(r),r.name)},map:function(e,n){var r=p1(n);return new $m(e,g1(r),r.name)},set:function(e,n){var r=p1(n);return new H6(e,g1(r),r.name)},object:function(e,n,r){return mh(function(){return hS(Lt.useProxies===!1||r?.proxy===!1?wd({},r):kS({},r),e,n)})},ref:ju(N9),shallow:ju(T9),deep:f6,struct:ju(R9)},Kn=Qw(h6,j9),d6="computed",D9="computed.struct",Vv=Bm(d6),F9=Bm(D9,{equals:fd.structural}),gh=function(e,n){if(Cp(n))return Vv.decorate_20223_(e,n);if(oh(n))return Op(e,n,Vv);if(mf(e))return ju(Bm(d6,e));var r=mf(n)?n:{};return r.get=e,r.name||(r.name=e.name||""),new tu(r)};Object.assign(gh,Vv);gh.struct=ju(F9);var u5,c5,l0=0,B9=1,z9=(u5=(c5=o0(function(){},"name"))==null?void 0:c5.configurable)!=null?u5:!1,f5={value:"action",configurable:!0,writable:!1,enumerable:!1};function bf(t,e,n,r){n===void 0&&(n=!1);function i(){return p6(t,n,e,r||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return e.toString()},z9&&(f5.value=t,Iu(i,"name",f5)),i}function p6(t,e,n,r,i){var a=q9(t,e);try{return n.apply(r,i)}catch(o){throw a.error_=o,o}finally{U9(a)}}function q9(t,e,n,r){var i=!1,a=0,o=Lt.trackingDerivation,s=!e||!o;Ts();var u=Lt.allowStateChanges;s&&(vh(),u=j0(!0));var h=zm(!0),f={runAsAction_:s,prevDerivation_:o,prevAllowStateChanges_:u,prevAllowStateReads_:h,notifySpy_:i,startTime_:a,actionId_:B9++,parentActionId_:l0};return l0=f.actionId_,f}function U9(t){l0!==t.actionId_&&Fn(30),l0=t.parentActionId_,t.error_!==void 0&&(Lt.suppressReactionErrors=!0),D0(t.prevAllowStateChanges_),ep(t.prevAllowStateReads_),Rs(),t.runAsAction_&&mc(t.prevDerivation_),Lt.suppressReactionErrors=!1}function g6(t,e){var n=j0(t);try{return e()}finally{D0(n)}}function j0(t){var e=Lt.allowStateChanges;return Lt.allowStateChanges=t,e}function D0(t){Lt.allowStateChanges=t}var vf=(function(t){function e(r,i,a,o,s){var u;return a===void 0&&(a="ObservableValue"),s===void 0&&(s=fd.default),u=t.call(this,a)||this,u.enhancer=void 0,u.name_=void 0,u.equals=void 0,u.hasUnreportedChange_=!1,u.interceptors_=void 0,u.changeListeners_=void 0,u.value_=void 0,u.dehancer=void 0,u.enhancer=i,u.name_=a,u.equals=s,u.value_=i(r,void 0,a),u}a6(e,t);var n=e.prototype;return n.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},n.set=function(i){this.value_,i=this.prepareNewValue_(i),i!==Lt.UNCHANGED&&this.setNewValue_(i)},n.prepareNewValue_=function(i){if(Al(this)){var a=Pl(this,{object:this,type:Du,newValue:i});if(!a)return Lt.UNCHANGED;i=a.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?Lt.UNCHANGED:i},n.setNewValue_=function(i){var a=this.value_;this.value_=i,this.reportChanged(),Jl(this)&&eu(this,{type:Du,object:this,newValue:i,oldValue:a})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(i){return Np(this,i)},n.observe_=function(i,a){return a&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:Du,newValue:this.value_,oldValue:void 0}),Tp(this,i)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+"["+this.value_+"]"},n.valueOf=function(){return i6(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},e})(Ef),H9=Sf("ObservableValue",vf),tu=(function(){function t(n){this.dependenciesState_=gr.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=gr.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new c0(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=u0.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,n.get||Fn(31),this.derivation=n.get,this.name_=n.name||"ComputedValue",n.set&&(this.setter_=bf("ComputedValue-setter",n.set)),this.equals_=n.equals||(n.compareStructural||n.struct?fd.structural:fd.default),this.scope_=n.context,this.requiresReaction_=n.requiresReaction,this.keepAlive_=!!n.keepAlive}var e=t.prototype;return e.onBecomeStale_=function(){X9(this)},e.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},e.get=function(){if(this.isComputing&&Fn(32,this.name_,this.derivation),Lt.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)Yv(this)&&(this.warnAboutUntrackedRead_(),Ts(),this.value_=this.computeValue_(!1),Rs());else if(x6(this),Yv(this)){var r=Lt.trackingContext;this.keepAlive_&&!r&&(Lt.trackingContext=this),this.trackAndCompute()&&Y9(this),Lt.trackingContext=r}var i=this.value_;if($1(i))throw i.cause;return i},e.set=function(r){if(this.setter_){this.isRunningSetter&&Fn(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,r)}finally{this.isRunningSetter=!1}}else Fn(34,this.name_)},e.trackAndCompute=function(){var r=this.value_,i=this.dependenciesState_===gr.NOT_TRACKING_,a=this.computeValue_(!0),o=i||$1(r)||$1(a)||!this.equals_(r,a);return o&&(this.value_=a),o},e.computeValue_=function(r){this.isComputing=!0;var i=j0(!1),a;if(r)a=v6(this,this.derivation,this.scope_);else if(Lt.disableErrorBoundaries===!0)a=this.derivation.call(this.scope_);else try{a=this.derivation.call(this.scope_)}catch(o){a=new c0(o)}return D0(i),this.isComputing=!1,a},e.suspend_=function(){this.keepAlive_||(Xv(this),this.value_=void 0)},e.observe_=function(r,i){var a=this,o=!0,s=void 0;return zu(function(){var u=a.get();if(!o||i){var h=vh();r({observableKind:"computed",debugObjectName:a.name_,type:Du,object:a,newValue:u,oldValue:s}),mc(h)}o=!1,s=u})},e.warnAboutUntrackedRead_=function(){},e.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},e.valueOf=function(){return i6(this.get())},e[Symbol.toPrimitive]=function(){return this.valueOf()},bd(t,[{key:"isComputing",get:function(){return tl(this.flags_,t.isComputingMask_)},set:function(r){this.flags_=nl(this.flags_,t.isComputingMask_,r)}},{key:"isRunningSetter",get:function(){return tl(this.flags_,t.isRunningSetterMask_)},set:function(r){this.flags_=nl(this.flags_,t.isRunningSetterMask_,r)}},{key:"isBeingObserved",get:function(){return tl(this.flags_,t.isBeingObservedMask_)},set:function(r){this.flags_=nl(this.flags_,t.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return tl(this.flags_,t.isPendingUnobservationMask_)},set:function(r){this.flags_=nl(this.flags_,t.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return tl(this.flags_,t.diffValueMask_)?1:0},set:function(r){this.flags_=nl(this.flags_,t.diffValueMask_,r===1)}}])})();tu.isComputingMask_=1;tu.isRunningSetterMask_=2;tu.isBeingObservedMask_=4;tu.isPendingUnobservationMask_=8;tu.diffValueMask_=16;var F0=Sf("ComputedValue",tu),gr;(function(t){t[t.NOT_TRACKING_=-1]="NOT_TRACKING_",t[t.UP_TO_DATE_=0]="UP_TO_DATE_",t[t.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",t[t.STALE_=2]="STALE_"})(gr||(gr={}));var u0;(function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"})(u0||(u0={}));var c0=function(e){this.cause=void 0,this.cause=e};function $1(t){return t instanceof c0}function Yv(t){switch(t.dependenciesState_){case gr.UP_TO_DATE_:return!1;case gr.NOT_TRACKING_:case gr.STALE_:return!0;case gr.POSSIBLY_STALE_:{for(var e=zm(!0),n=vh(),r=t.observing_,i=r.length,a=0;a<i;a++){var o=r[a];if(F0(o)){if(Lt.disableErrorBoundaries)o.get();else try{o.get()}catch{return mc(n),ep(e),!0}if(t.dependenciesState_===gr.STALE_)return mc(n),ep(e),!0}}return y6(t),mc(n),ep(e),!1}}}function v6(t,e,n){var r=zm(!0);y6(t),t.newObserving_=new Array(t.runId_===0?100:t.observing_.length),t.unboundDepsCount_=0,t.runId_=++Lt.runId;var i=Lt.trackingDerivation;Lt.trackingDerivation=t,Lt.inBatch++;var a;if(Lt.disableErrorBoundaries===!0)a=e.call(n);else try{a=e.call(n)}catch(o){a=new c0(o)}return Lt.inBatch--,Lt.trackingDerivation=i,$9(t),ep(r),a}function $9(t){for(var e=t.observing_,n=t.observing_=t.newObserving_,r=gr.UP_TO_DATE_,i=0,a=t.unboundDepsCount_,o=0;o<a;o++){var s=n[o];s.diffValue===0&&(s.diffValue=1,i!==o&&(n[i]=s),i++),s.dependenciesState_>r&&(r=s.dependenciesState_)}for(n.length=i,t.newObserving_=null,a=e.length;a--;){var u=e[a];u.diffValue===0&&w6(u,t),u.diffValue=0}for(;i--;){var h=n[i];h.diffValue===1&&(h.diffValue=0,V9(h,t))}r!==gr.UP_TO_DATE_&&(t.dependenciesState_=r,t.onBecomeStale_())}function Xv(t){var e=t.observing_;t.observing_=[];for(var n=e.length;n--;)w6(e[n],t);t.dependenciesState_=gr.NOT_TRACKING_}function m6(t){var e=vh();try{return t()}finally{mc(e)}}function vh(){var t=Lt.trackingDerivation;return Lt.trackingDerivation=null,t}function mc(t){Lt.trackingDerivation=t}function zm(t){var e=Lt.allowStateReads;return Lt.allowStateReads=t,e}function ep(t){Lt.allowStateReads=t}function y6(t){if(t.dependenciesState_!==gr.UP_TO_DATE_){t.dependenciesState_=gr.UP_TO_DATE_;for(var e=t.observing_,n=e.length;n--;)e[n].lowestObserverState_=gr.UP_TO_DATE_}}var G1=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},W1=!0,b6=!1,Lt=(function(){var t=C0();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(W1=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==new G1().version&&(W1=!1),W1?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new G1):(setTimeout(function(){b6||Fn(35)},1),new G1)})();function G9(){if((Lt.pendingReactions.length||Lt.inBatch||Lt.isRunningReactions)&&Fn(36),b6=!0,W1){var t=C0();--t.__mobxInstanceCount===0&&(t.__mobxGlobals=void 0),Lt=new G1}}function W9(){return Lt}function V9(t,e){t.observers_.add(e),t.lowestObserverState_>e.dependenciesState_&&(t.lowestObserverState_=e.dependenciesState_)}function w6(t,e){t.observers_.delete(e),t.observers_.size===0&&_6(t)}function _6(t){t.isPendingUnobservation===!1&&(t.isPendingUnobservation=!0,Lt.pendingUnobservations.push(t))}function Ts(){Lt.inBatch++}function Rs(){if(--Lt.inBatch===0){E6();for(var t=Lt.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation=!1,n.observers_.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBUO()),n instanceof tu&&n.suspend_())}Lt.pendingUnobservations=[]}}function x6(t){var e=Lt.trackingDerivation;return e!==null?(e.runId_!==t.lastAccessedBy_&&(t.lastAccessedBy_=e.runId_,e.newObserving_[e.unboundDepsCount_++]=t,!t.isBeingObserved&&Lt.trackingContext&&(t.isBeingObserved=!0,t.onBO())),t.isBeingObserved):(t.observers_.size===0&&Lt.inBatch>0&&_6(t),!1)}function S6(t){t.lowestObserverState_!==gr.STALE_&&(t.lowestObserverState_=gr.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===gr.UP_TO_DATE_&&e.onBecomeStale_(),e.dependenciesState_=gr.STALE_}))}function Y9(t){t.lowestObserverState_!==gr.STALE_&&(t.lowestObserverState_=gr.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===gr.POSSIBLY_STALE_?e.dependenciesState_=gr.STALE_:e.dependenciesState_===gr.UP_TO_DATE_&&(t.lowestObserverState_=gr.UP_TO_DATE_)}))}function X9(t){t.lowestObserverState_===gr.UP_TO_DATE_&&(t.lowestObserverState_=gr.POSSIBLY_STALE_,t.observers_.forEach(function(e){e.dependenciesState_===gr.UP_TO_DATE_&&(e.dependenciesState_=gr.POSSIBLY_STALE_,e.onBecomeStale_())}))}var Bu=(function(){function t(n,r,i,a){n===void 0&&(n="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=gr.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=u0.NONE,this.name_=n,this.onInvalidate_=r,this.errorHandler_=i,this.requiresObservable_=a}var e=t.prototype;return e.onBecomeStale_=function(){this.schedule_()},e.schedule_=function(){this.isScheduled||(this.isScheduled=!0,Lt.pendingReactions.push(this),E6())},e.runReaction_=function(){if(!this.isDisposed){Ts(),this.isScheduled=!1;var r=Lt.trackingContext;if(Lt.trackingContext=this,Yv(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(i){this.reportExceptionInDerivation_(i)}}Lt.trackingContext=r,Rs()}},e.track=function(r){if(!this.isDisposed){Ts(),this.isRunning=!0;var i=Lt.trackingContext;Lt.trackingContext=this;var a=v6(this,r,void 0);Lt.trackingContext=i,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&Xv(this),$1(a)&&this.reportExceptionInDerivation_(a.cause),Rs()}},e.reportExceptionInDerivation_=function(r){var i=this;if(this.errorHandler_){this.errorHandler_(r,this);return}if(Lt.disableErrorBoundaries)throw r;var a="[mobx] uncaught error in '"+this+"'";Lt.suppressReactionErrors||console.error(a,r),Lt.globalReactionErrorHandlers.forEach(function(o){return o(r,i)})},e.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(Ts(),Xv(this),Rs()))},e.getDisposer_=function(r){var i=this,a=function o(){i.dispose(),r==null||r.removeEventListener==null||r.removeEventListener("abort",o)};return r==null||r.addEventListener==null||r.addEventListener("abort",a),a[vn]=this,a},e.toString=function(){return"Reaction["+this.name_+"]"},e.trace=function(r){},bd(t,[{key:"isDisposed",get:function(){return tl(this.flags_,t.isDisposedMask_)},set:function(r){this.flags_=nl(this.flags_,t.isDisposedMask_,r)}},{key:"isScheduled",get:function(){return tl(this.flags_,t.isScheduledMask_)},set:function(r){this.flags_=nl(this.flags_,t.isScheduledMask_,r)}},{key:"isTrackPending",get:function(){return tl(this.flags_,t.isTrackPendingMask_)},set:function(r){this.flags_=nl(this.flags_,t.isTrackPendingMask_,r)}},{key:"isRunning",get:function(){return tl(this.flags_,t.isRunningMask_)},set:function(r){this.flags_=nl(this.flags_,t.isRunningMask_,r)}},{key:"diffValue",get:function(){return tl(this.flags_,t.diffValueMask_)?1:0},set:function(r){this.flags_=nl(this.flags_,t.diffValueMask_,r===1)}}])})();Bu.isDisposedMask_=1;Bu.isScheduledMask_=2;Bu.isTrackPendingMask_=4;Bu.isRunningMask_=8;Bu.diffValueMask_=16;var K9=100,Kv=function(e){return e()};function E6(){Lt.inBatch>0||Lt.isRunningReactions||Kv(Z9)}function Z9(){Lt.isRunningReactions=!0;for(var t=Lt.pendingReactions,e=0;t.length>0;){++e===K9&&(console.error("[mobx] cycle in reaction: "+t[0]),t.splice(0));for(var n=t.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction_()}Lt.isRunningReactions=!1}var f0=Sf("Reaction",Bu);function Q9(t){var e=Kv;Kv=function(r){return t(function(){return e(r)})}}function tp(){return!1}function J9(t){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var k6="action",eS="action.bound",A6="autoAction",tS="autoAction.bound",P6="<unnamed action>",Zv=Lp(k6),nS=Lp(eS,{bound:!0}),Qv=Lp(A6,{autoAction:!0}),rS=Lp(tS,{autoAction:!0,bound:!0});function O6(t){var e=function(r,i){if(ol(r))return bf(r.name||P6,r,t);if(ol(i))return bf(r,i,t);if(Cp(i))return(t?Qv:Zv).decorate_20223_(r,i);if(oh(i))return Op(r,i,t?Qv:Zv);if(oh(r))return ju(Lp(t?A6:k6,{name:r,autoAction:t}))};return e}var Jn=O6(!1);Object.assign(Jn,Zv);var pp=O6(!0);Object.assign(pp,Qv);Jn.bound=ju(nS);pp.bound=ju(rS);function pc(t){return p6(t.name||P6,!1,t,this,void 0)}function gp(t){return ol(t)&&t.isMobxAction===!0}function zu(t,e){var n,r,i,a;e===void 0&&(e=Dm);var o=(n=(r=e)==null?void 0:r.name)!=null?n:"Autorun",s=!e.scheduler&&!e.delay,u;if(s)u=new Bu(o,function(){this.track(g)},e.onError,e.requiresObservable);else{var h=C6(e),f=!1;u=new Bu(o,function(){f||(f=!0,h(function(){f=!1,u.isDisposed||u.track(g)}))},e.onError,e.requiresObservable)}function g(){t(u)}return(i=e)!=null&&(i=i.signal)!=null&&i.aborted||u.schedule_(),u.getDisposer_((a=e)==null?void 0:a.signal)}var iS=function(e){return e()};function C6(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:iS}function L6(t,e,n){var r,i,a;n===void 0&&(n=Dm);var o=(r=n.name)!=null?r:"Reaction",s=Jn(o,n.onError?aS(n.onError,e):e),u=!n.scheduler&&!n.delay,h=C6(n),f=!0,g=!1,v,p=n.compareStructural?fd.structural:n.equals||fd.default,y=new Bu(o,function(){f||u?_():g||(g=!0,h(_))},n.onError,n.requiresObservable);function _(){if(g=!1,!y.isDisposed){var x=!1,b=v;y.track(function(){var E=g6(!1,function(){return t(y)});x=f||!p(v,E),v=E}),(f&&n.fireImmediately||!f&&x)&&s(v,b,y),f=!1}}return(i=n)!=null&&(i=i.signal)!=null&&i.aborted||y.schedule_(),y.getDisposer_((a=n)==null?void 0:a.signal)}function aS(t,e){return function(){try{return e.apply(this,arguments)}catch(n){t.call(this,n)}}}var oS="onBO",sS="onBUO";function lS(t,e,n){return T6(oS,t,e,n)}function N6(t,e,n){return T6(sS,t,e,n)}function T6(t,e,n,r){var i=dd(e),a=ol(r)?r:n,o=t+"L";return i[o]?i[o].add(a):i[o]=new Set([a]),function(){var s=i[o];s&&(s.delete(a),s.size===0&&delete i[o])}}var uS="never",v1="always",cS="observed";function fS(t){t.isolateGlobalState===!0&&G9();var e=t.useProxies,n=t.enforceActions;if(e!==void 0&&(Lt.useProxies=e===v1?!0:e===uS?!1:typeof Proxy<"u"),e==="ifavailable"&&(Lt.verifyProxies=!0),n!==void 0){var r=n===v1?v1:n===cS;Lt.enforceActions=r,Lt.allowStateChanges=!(r===!0||r===v1)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in t&&(Lt[i]=!!t[i])}),Lt.allowStateReads=!Lt.observableRequiresReaction,t.reactionScheduler&&Q9(t.reactionScheduler)}function hS(t,e,n,r){var i=Yx(e);return mh(function(){var a=wd(t,r)[vn];R0(i).forEach(function(o){a.extend_(o,i[o],n&&o in n?n[o]:!0)})}),t}function dS(t,e){return R6(dd(t,e))}function R6(t){var e={name:t.name_};return t.observing_&&t.observing_.length>0&&(e.dependencies=pS(t.observing_).map(R6)),e}function pS(t){return Array.from(new Set(t))}var gS=0;function M6(){this.message="FLOW_CANCELLED"}M6.prototype=Object.create(Error.prototype);var Rg=s6("flow"),vS=s6("flow.bound",{bound:!0}),hd=Object.assign(function(e,n){if(Cp(n))return Rg.decorate_20223_(e,n);if(oh(n))return Op(e,n,Rg);var r=e,i=r.name||"<unnamed flow>",a=function(){var s=this,u=arguments,h=++gS,f=Jn(i+" - runid: "+h+" - init",r).apply(s,u),g,v=void 0,p=new Promise(function(y,_){var x=0;g=_;function b(S){v=void 0;var k;try{k=Jn(i+" - runid: "+h+" - yield "+x++,f.next).call(f,S)}catch(I){return _(I)}A(k)}function E(S){v=void 0;var k;try{k=Jn(i+" - runid: "+h+" - yield "+x++,f.throw).call(f,S)}catch(I){return _(I)}A(k)}function A(S){if(ol(S?.then)){S.then(A,_);return}return S.done?y(S.value):(v=Promise.resolve(S.value),v.then(b,E))}b(void 0)});return p.cancel=Jn(i+" - runid: "+h+" - cancel",function(){try{v&&h5(v);var y=f.return(void 0),_=Promise.resolve(y.value);_.then(td,td),h5(_),g(new M6)}catch(x){g(x)}}),p};return a.isMobXFlow=!0,a},Rg);hd.bound=ju(vS);function h5(t){ol(t.cancel)&&t.cancel()}function vp(t){return t?.isMobXFlow===!0}function I6(t,e,n){var r;return Nl(t)||Hu(t)||H9(t)?r=qu(t):iu(t)&&(r=qu(t,e)),r.dehancer=typeof e=="function"?e:n,function(){r.dehancer=void 0}}function qm(t,e,n){return ol(n)?yS(t,e,n):mS(t,e)}function mS(t,e){return qu(t).intercept_(e)}function yS(t,e,n){return qu(t,e).intercept_(n)}function bS(t,e){return t?iu(t)||!!t[vn]||Fm(t)||f0(t)||F0(t):!1}function j6(t){return bS(t)}function h0(t){if(iu(t))return t[vn].keys_();if(Nl(t)||ns(t))return Array.from(t.keys());if(Hu(t))return t.map(function(e,n){return n});Fn(5)}function D6(t){if(iu(t))return h0(t).map(function(e){return t[e]});if(Nl(t))return h0(t).map(function(e){return t.get(e)});if(ns(t))return Array.from(t.values());if(Hu(t))return t.slice();Fn(6)}function wS(t){if(iu(t))return h0(t).map(function(e){return[e,t[e]]});if(Nl(t))return h0(t).map(function(e){return[e,t.get(e)]});if(ns(t))return Array.from(t.entries());if(Hu(t))return t.map(function(e,n){return[n,e]});Fn(7)}function F6(t,e,n){if(arguments.length===2&&!ns(t)){Ts();var r=e;try{for(var i in r)F6(t,i,r[i])}finally{Rs()}return}iu(t)?t[vn].set_(e,n):Nl(t)?t.set(e,n):ns(t)?t.add(e):Hu(t)?(typeof e!="number"&&(e=parseInt(e,10)),e<0&&Fn("Invalid index: '"+e+"'"),Ts(),e>=t.length&&(t.length=e+1),t[e]=n,Rs()):Fn(8)}function B6(t,e,n){if(iu(t))return t[vn].defineProperty_(e,n);Fn(39)}function Um(t,e,n,r){return ol(n)?xS(t,e,n,r):_S(t,e,n)}function _S(t,e,n){return qu(t).observe_(e,n)}function xS(t,e,n,r){return qu(t,e).observe_(n,r)}function gc(t,e){e===void 0&&(e=void 0),Ts();try{return t.apply(e)}finally{Rs()}}function d5(t,e,n){return arguments.length===1||e&&typeof e=="object"?SS(t,e):z6(t,e,{})}function z6(t,e,n){var r;if(typeof n.timeout=="number"){var i=new Error("WHEN_TIMEOUT");r=setTimeout(function(){if(!o[vn].isDisposed)if(o(),n.onError)n.onError(i);else throw i},n.timeout)}n.name="When";var a=bf("When-effect",e),o=zu(function(s){var u=g6(!1,t);u&&(s.dispose(),r&&clearTimeout(r),a())},n);return o}function SS(t,e){var n;if(e!=null&&(n=e.signal)!=null&&n.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var r,i,a=new Promise(function(o,s){var u,h=z6(t,o,yf({},e,{onError:s}));r=function(){h(),s(new Error("WHEN_CANCELLED"))},i=function(){h(),s(new Error("WHEN_ABORTED"))},e==null||(u=e.signal)==null||u.addEventListener==null||u.addEventListener("abort",i)}).finally(function(){var o;return e==null||(o=e.signal)==null||o.removeEventListener==null?void 0:o.removeEventListener("abort",i)});return a.cancel=r,a}function $h(t){return t[vn]}var ES={has:function(e,n){return $h(e).has_(n)},get:function(e,n){return $h(e).get_(n)},set:function(e,n,r){var i;return oh(n)?(i=$h(e).set_(n,r,!0))!=null?i:!0:!1},deleteProperty:function(e,n){var r;return oh(n)?(r=$h(e).delete_(n,!0))!=null?r:!0:!1},defineProperty:function(e,n,r){var i;return(i=$h(e).defineProperty_(n,r))!=null?i:!0},ownKeys:function(e){return $h(e).ownKeys_()},preventExtensions:function(e){Fn(13)}};function kS(t,e){var n,r;return Jw(),t=wd(t,e),(r=(n=t[vn]).proxy_)!=null?r:n.proxy_=new Proxy(t,ES)}function Al(t){return t.interceptors_!==void 0&&t.interceptors_.length>0}function Np(t,e){var n=t.interceptors_||(t.interceptors_=[]);return n.push(e),e6(function(){var r=n.indexOf(e);r!==-1&&n.splice(r,1)})}function Pl(t,e){var n=vh();try{for(var r=[].concat(t.interceptors_||[]),i=0,a=r.length;i<a&&(e=r[i](e),e&&!e.type&&Fn(14),!!e);i++);return e}finally{mc(n)}}function Jl(t){return t.changeListeners_!==void 0&&t.changeListeners_.length>0}function Tp(t,e){var n=t.changeListeners_||(t.changeListeners_=[]);return n.push(e),e6(function(){var r=n.indexOf(e);r!==-1&&n.splice(r,1)})}function eu(t,e){var n=vh(),r=t.changeListeners_;if(r){r=r.slice();for(var i=0,a=r.length;i<a;i++)r[i](e);mc(n)}}function q6(t,e,n){return mh(function(){var r,i=wd(t,n)[vn];(r=e)!=null||(e=Jx(t)),R0(e).forEach(function(a){return i.make_(a,e[a])})}),t}var p5="splice",Du="update",AS=1e4,PS={get:function(e,n){var r=e[vn];return n===vn?r:n==="length"?r.getArrayLength_():typeof n=="string"&&!isNaN(n)?r.get_(parseInt(n)):vc(d0,n)?d0[n]:e[n]},set:function(e,n,r){var i=e[vn];return n==="length"&&i.setArrayLength_(r),typeof n=="symbol"||isNaN(n)?e[n]=r:i.set_(parseInt(n),r),!0},preventExtensions:function(){Fn(15)}},Hm=(function(){function t(n,r,i,a){n===void 0&&(n="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=i,this.legacyMode_=a,this.atom_=new Ef(n),this.enhancer_=function(o,s){return r(o,s,"ObservableArray[..]")}}var e=t.prototype;return e.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},e.dehanceValues_=function(r){return this.dehancer!==void 0&&r.length>0?r.map(this.dehancer):r},e.intercept_=function(r){return Np(this,r)},e.observe_=function(r,i){return i===void 0&&(i=!1),i&&r({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),Tp(this,r)},e.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},e.setArrayLength_=function(r){(typeof r!="number"||isNaN(r)||r<0)&&Fn("Out of range: "+r);var i=this.values_.length;if(r!==i)if(r>i){for(var a=new Array(r-i),o=0;o<r-i;o++)a[o]=void 0;this.spliceWithArray_(i,0,a)}else this.spliceWithArray_(r,i-r)},e.updateArrayLength_=function(r,i){r!==this.lastKnownLength_&&Fn(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&V6(r+i+1)},e.spliceWithArray_=function(r,i,a){var o=this;this.atom_;var s=this.values_.length;if(r===void 0?r=0:r>s?r=s:r<0&&(r=Math.max(0,s+r)),arguments.length===1?i=s-r:i==null?i=0:i=Math.max(0,Math.min(i,s-r)),a===void 0&&(a=$v),Al(this)){var u=Pl(this,{object:this.proxy_,type:p5,index:r,removedCount:i,added:a});if(!u)return $v;i=u.removedCount,a=u.added}if(a=a.length===0?a:a.map(function(g){return o.enhancer_(g,void 0)}),this.legacyMode_){var h=a.length-i;this.updateArrayLength_(s,h)}var f=this.spliceItemsIntoValues_(r,i,a);return(i!==0||a.length!==0)&&this.notifyArraySplice_(r,a,f),this.dehanceValues_(f)},e.spliceItemsIntoValues_=function(r,i,a){if(a.length<AS){var o;return(o=this.values_).splice.apply(o,[r,i].concat(a))}else{var s=this.values_.slice(r,r+i),u=this.values_.slice(r+i);this.values_.length+=a.length-i;for(var h=0;h<a.length;h++)this.values_[r+h]=a[h];for(var f=0;f<u.length;f++)this.values_[r+a.length+f]=u[f];return s}},e.notifyArrayChildUpdate_=function(r,i,a){var o=!this.owned_&&tp(),s=Jl(this),u=s||o?{observableKind:"array",object:this.proxy_,type:Du,debugObjectName:this.atom_.name_,index:r,newValue:i,oldValue:a}:null;this.atom_.reportChanged(),s&&eu(this,u)},e.notifyArraySplice_=function(r,i,a){var o=!this.owned_&&tp(),s=Jl(this),u=s||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:p5,index:r,removed:a,added:i,removedCount:a.length,addedCount:i.length}:null;this.atom_.reportChanged(),s&&eu(this,u)},e.get_=function(r){if(this.legacyMode_&&r>=this.values_.length){console.warn("[mobx] Out of bounds read: "+r);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[r])},e.set_=function(r,i){var a=this.values_;if(this.legacyMode_&&r>a.length&&Fn(17,r,a.length),r<a.length){this.atom_;var o=a[r];if(Al(this)){var s=Pl(this,{type:Du,object:this.proxy_,index:r,newValue:i});if(!s)return;i=s.newValue}i=this.enhancer_(i,o);var u=i!==o;u&&(a[r]=i,this.notifyArrayChildUpdate_(r,i,o))}else{for(var h=new Array(r+1-a.length),f=0;f<h.length-1;f++)h[f]=void 0;h[h.length-1]=i,this.spliceWithArray_(a.length,0,h)}},t})();function OS(t,e,n,r){return n===void 0&&(n="ObservableArray"),r===void 0&&(r=!1),Jw(),mh(function(){var i=new Hm(n,e,r,!1);n6(i.values_,vn,i);var a=new Proxy(i.values_,PS);return i.proxy_=a,t&&t.length&&i.spliceWithArray_(0,0,t),a})}var d0={clear:function(){return this.splice(0)},replace:function(e){var n=this[vn];return n.spliceWithArray_(0,n.values_.length,e)},toJSON:function(){return this.slice()},splice:function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];var o=this[vn];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(e);case 2:return o.spliceWithArray_(e,n)}return o.spliceWithArray_(e,n,i)},spliceWithArray:function(e,n,r){return this[vn].spliceWithArray_(e,n,r)},push:function(){for(var e=this[vn],n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.spliceWithArray_(e.values_.length,0,r),e.values_.length},pop:function(){return this.splice(Math.max(this[vn].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var e=this[vn],n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.spliceWithArray_(0,0,r),e.values_.length},reverse:function(){return Lt.trackingDerivation&&Fn(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){Lt.trackingDerivation&&Fn(37,"sort");var e=this.slice();return e.sort.apply(e,arguments),this.replace(e),this},remove:function(e){var n=this[vn],r=n.dehanceValues_(n.values_).indexOf(e);return r>-1?(this.splice(r,1),!0):!1}};ii("at",sl);ii("concat",sl);ii("flat",sl);ii("includes",sl);ii("indexOf",sl);ii("join",sl);ii("lastIndexOf",sl);ii("slice",sl);ii("toString",sl);ii("toLocaleString",sl);ii("toSorted",sl);ii("toSpliced",sl);ii("with",sl);ii("every",ru);ii("filter",ru);ii("find",ru);ii("findIndex",ru);ii("findLast",ru);ii("findLastIndex",ru);ii("flatMap",ru);ii("forEach",ru);ii("map",ru);ii("some",ru);ii("toReversed",ru);ii("reduce",U6);ii("reduceRight",U6);function ii(t,e){typeof Array.prototype[t]=="function"&&(d0[t]=e(t))}function sl(t){return function(){var e=this[vn];e.atom_.reportObserved();var n=e.dehanceValues_(e.values_);return n[t].apply(n,arguments)}}function ru(t){return function(e,n){var r=this,i=this[vn];i.atom_.reportObserved();var a=i.dehanceValues_(i.values_);return a[t](function(o,s){return e.call(n,o,s,r)})}}function U6(t){return function(){var e=this,n=this[vn];n.atom_.reportObserved();var r=n.dehanceValues_(n.values_),i=arguments[0];return arguments[0]=function(a,o,s){return i(a,o,s,e)},r[t].apply(r,arguments)}}var CS=Sf("ObservableArrayAdministration",Hm);function Hu(t){return N0(t)&&CS(t[vn])}var LS={},hf="add",p0="delete",$m=(function(){function t(n,r,i){var a=this;r===void 0&&(r=sh),i===void 0&&(i="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[vn]=LS,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=r,this.name_=i,ol(Map)||Fn(18),mh(function(){a.keysAtom_=s0("ObservableMap.keys()"),a.data_=new Map,a.hasMap_=new Map,n&&a.merge(n)})}var e=t.prototype;return e.has_=function(r){return this.data_.has(r)},e.has=function(r){var i=this;if(!Lt.trackingDerivation)return this.has_(r);var a=this.hasMap_.get(r);if(!a){var o=a=new vf(this.has_(r),M0,"ObservableMap.key?",!1);this.hasMap_.set(r,o),N6(o,function(){return i.hasMap_.delete(r)})}return a.get()},e.set=function(r,i){var a=this.has_(r);if(Al(this)){var o=Pl(this,{type:a?Du:hf,object:this,newValue:i,name:r});if(!o)return this;i=o.newValue}return a?this.updateValue_(r,i):this.addValue_(r,i),this},e.delete=function(r){var i=this;if(this.keysAtom_,Al(this)){var a=Pl(this,{type:p0,object:this,name:r});if(!a)return!1}if(this.has_(r)){var o=tp(),s=Jl(this),u=s||o?{observableKind:"map",debugObjectName:this.name_,type:p0,object:this,oldValue:this.data_.get(r).value_,name:r}:null;return gc(function(){var h;i.keysAtom_.reportChanged(),(h=i.hasMap_.get(r))==null||h.setNewValue_(!1);var f=i.data_.get(r);f.setNewValue_(void 0),i.data_.delete(r)}),s&&eu(this,u),!0}return!1},e.updateValue_=function(r,i){var a=this.data_.get(r);if(i=a.prepareNewValue_(i),i!==Lt.UNCHANGED){var o=tp(),s=Jl(this),u=s||o?{observableKind:"map",debugObjectName:this.name_,type:Du,object:this,oldValue:a.value_,name:r,newValue:i}:null;a.setNewValue_(i),s&&eu(this,u)}},e.addValue_=function(r,i){var a=this;this.keysAtom_,gc(function(){var h,f=new vf(i,a.enhancer_,"ObservableMap.key",!1);a.data_.set(r,f),i=f.value_,(h=a.hasMap_.get(r))==null||h.setNewValue_(!0),a.keysAtom_.reportChanged()});var o=tp(),s=Jl(this),u=s||o?{observableKind:"map",debugObjectName:this.name_,type:hf,object:this,name:r,newValue:i}:null;s&&eu(this,u)},e.get=function(r){return this.has(r)?this.dehanceValue_(this.data_.get(r).get()):this.dehanceValue_(void 0)},e.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},e.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},e.values=function(){var r=this,i=this.keys();return g5({next:function(){var o=i.next(),s=o.done,u=o.value;return{done:s,value:s?void 0:r.get(u)}}})},e.entries=function(){var r=this,i=this.keys();return g5({next:function(){var o=i.next(),s=o.done,u=o.value;return{done:s,value:s?void 0:[u,r.get(u)]}}})},e[Symbol.iterator]=function(){return this.entries()},e.forEach=function(r,i){for(var a=nd(this),o;!(o=a()).done;){var s=o.value,u=s[0],h=s[1];r.call(i,h,u,this)}},e.merge=function(r){var i=this;return Nl(r)&&(r=new Map(r)),gc(function(){mf(r)?Vx(r).forEach(function(a){return i.set(a,r[a])}):Array.isArray(r)?r.forEach(function(a){var o=a[0],s=a[1];return i.set(o,s)}):yd(r)?(Wx(r)||Fn(19,r),r.forEach(function(a,o){return i.set(o,a)})):r!=null&&Fn(20,r)}),this},e.clear=function(){var r=this;gc(function(){m6(function(){for(var i=nd(r.keys()),a;!(a=i()).done;){var o=a.value;r.delete(o)}})})},e.replace=function(r){var i=this;return gc(function(){for(var a=NS(r),o=new Map,s=!1,u=nd(i.data_.keys()),h;!(h=u()).done;){var f=h.value;if(!a.has(f)){var g=i.delete(f);if(g)s=!0;else{var v=i.data_.get(f);o.set(f,v)}}}for(var p=nd(a.entries()),y;!(y=p()).done;){var _=y.value,x=_[0],b=_[1],E=i.data_.has(x);if(i.set(x,b),i.data_.has(x)){var A=i.data_.get(x);o.set(x,A),E||(s=!0)}}if(!s)if(i.data_.size!==o.size)i.keysAtom_.reportChanged();else for(var S=i.data_.keys(),k=o.keys(),I=S.next(),O=k.next();!I.done;){if(I.value!==O.value){i.keysAtom_.reportChanged();break}I=S.next(),O=k.next()}i.data_=o}),this},e.toString=function(){return"[object ObservableMap]"},e.toJSON=function(){return Array.from(this)},e.observe_=function(r,i){return Tp(this,r)},e.intercept_=function(r){return Np(this,r)},bd(t,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])})(),Nl=Sf("ObservableMap",$m);function g5(t){return t[Symbol.toStringTag]="MapIterator",Wm(t)}function NS(t){if(yd(t)||Nl(t))return t;if(Array.isArray(t))return new Map(t);if(mf(t)){var e=new Map;for(var n in t)e.set(n,t[n]);return e}else return Fn(21,t)}var TS={},H6=(function(){function t(n,r,i){var a=this;r===void 0&&(r=sh),i===void 0&&(i="ObservableSet"),this.name_=void 0,this[vn]=TS,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=i,ol(Set)||Fn(22),this.enhancer_=function(o,s){return r(o,s,i)},mh(function(){a.atom_=s0(a.name_),n&&a.replace(n)})}var e=t.prototype;return e.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},e.clear=function(){var r=this;gc(function(){m6(function(){for(var i=nd(r.data_.values()),a;!(a=i()).done;){var o=a.value;r.delete(o)}})})},e.forEach=function(r,i){for(var a=nd(this),o;!(o=a()).done;){var s=o.value;r.call(i,s,s,this)}},e.add=function(r){var i=this;if(this.atom_,Al(this)){var a=Pl(this,{type:hf,object:this,newValue:r});if(!a)return this;r=a.newValue}if(!this.has(r)){gc(function(){i.data_.add(i.enhancer_(r,void 0)),i.atom_.reportChanged()});var o=!1,s=Jl(this),u=s||o?{observableKind:"set",debugObjectName:this.name_,type:hf,object:this,newValue:r}:null;s&&eu(this,u)}return this},e.delete=function(r){var i=this;if(Al(this)){var a=Pl(this,{type:p0,object:this,oldValue:r});if(!a)return!1}if(this.has(r)){var o=!1,s=Jl(this),u=s||o?{observableKind:"set",debugObjectName:this.name_,type:p0,object:this,oldValue:r}:null;return gc(function(){i.atom_.reportChanged(),i.data_.delete(r)}),s&&eu(this,u),!0}return!1},e.has=function(r){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(r))},e.entries=function(){var r=this.values();return v5({next:function(){var a=r.next(),o=a.value,s=a.done;return s?{value:void 0,done:s}:{value:[o,o],done:s}}})},e.keys=function(){return this.values()},e.values=function(){this.atom_.reportObserved();var r=this,i=this.data_.values();return v5({next:function(){var o=i.next(),s=o.value,u=o.done;return u?{value:void 0,done:u}:{value:r.dehanceValue_(s),done:u}}})},e.intersection=function(r){if(dc(r)&&!ns(r))return r.intersection(this);var i=new Set(this);return i.intersection(r)},e.union=function(r){if(dc(r)&&!ns(r))return r.union(this);var i=new Set(this);return i.union(r)},e.difference=function(r){return new Set(this).difference(r)},e.symmetricDifference=function(r){if(dc(r)&&!ns(r))return r.symmetricDifference(this);var i=new Set(this);return i.symmetricDifference(r)},e.isSubsetOf=function(r){return new Set(this).isSubsetOf(r)},e.isSupersetOf=function(r){return new Set(this).isSupersetOf(r)},e.isDisjointFrom=function(r){if(dc(r)&&!ns(r))return r.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(r)},e.replace=function(r){var i=this;return ns(r)&&(r=new Set(r)),gc(function(){Array.isArray(r)?(i.clear(),r.forEach(function(a){return i.add(a)})):dc(r)?(i.clear(),r.forEach(function(a){return i.add(a)})):r!=null&&Fn("Cannot initialize set from "+r)}),this},e.observe_=function(r,i){return Tp(this,r)},e.intercept_=function(r){return Np(this,r)},e.toJSON=function(){return Array.from(this)},e.toString=function(){return"[object ObservableSet]"},e[Symbol.iterator]=function(){return this.values()},bd(t,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])})(),ns=Sf("ObservableSet",H6);function v5(t){return t[Symbol.toStringTag]="SetIterator",Wm(t)}var m5=Object.create(null),y5="remove",$6=(function(){function t(n,r,i,a){r===void 0&&(r=new Map),a===void 0&&(a=S9),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_=n,this.values_=r,this.name_=i,this.defaultAnnotation_=a,this.keysAtom_=new Ef("ObservableObject.keys"),this.isPlainObject_=mf(this.target_)}var e=t.prototype;return e.getObservablePropValue_=function(r){return this.values_.get(r).get()},e.setObservablePropValue_=function(r,i){var a=this.values_.get(r);if(a instanceof tu)return a.set(i),!0;if(Al(this)){var o=Pl(this,{type:Du,object:this.proxy_||this.target_,name:r,newValue:i});if(!o)return null;i=o.newValue}if(i=a.prepareNewValue_(i),i!==Lt.UNCHANGED){var s=Jl(this),u=!1,h=s||u?{type:Du,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:a.value_,name:r,newValue:i}:null;a.setNewValue_(i),s&&eu(this,h)}return!0},e.get_=function(r){return Lt.trackingDerivation&&!vc(this.target_,r)&&this.has_(r),this.target_[r]},e.set_=function(r,i,a){return a===void 0&&(a=!1),vc(this.target_,r)?this.values_.has(r)?this.setObservablePropValue_(r,i):a?Reflect.set(this.target_,r,i):(this.target_[r]=i,!0):this.extend_(r,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,a)},e.has_=function(r){if(!Lt.trackingDerivation)return r in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(r);return i||(i=new vf(r in this.target_,M0,"ObservableObject.key?",!1),this.pendingKeys_.set(r,i)),i.get()},e.make_=function(r,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(!(r in this.target_)){var a;if((a=this.target_[Nu])!=null&&a[r])return;Fn(1,i.annotationType_,this.name_+"."+r.toString())}for(var o=this.target_;o&&o!==L0;){var s=o0(o,r);if(s){var u=i.make_(this,r,s,o);if(u===0)return;if(u===1)break}o=Object.getPrototypeOf(o)}w5(this,i,r)}},e.extend_=function(r,i,a,o){if(o===void 0&&(o=!1),a===!0&&(a=this.defaultAnnotation_),a===!1)return this.defineProperty_(r,i,o);var s=a.extend_(this,r,i,o);return s&&w5(this,a,r),s},e.defineProperty_=function(r,i,a){a===void 0&&(a=!1),this.keysAtom_;try{Ts();var o=this.delete_(r);if(!o)return o;if(Al(this)){var s=Pl(this,{object:this.proxy_||this.target_,name:r,type:hf,newValue:i.value});if(!s)return null;var u=s.newValue;i.value!==u&&(i=yf({},i,{value:u}))}if(a){if(!Reflect.defineProperty(this.target_,r,i))return!1}else Iu(this.target_,r,i);this.notifyPropertyAddition_(r,i.value)}finally{Rs()}return!0},e.defineObservableProperty_=function(r,i,a,o){o===void 0&&(o=!1),this.keysAtom_;try{Ts();var s=this.delete_(r);if(!s)return s;if(Al(this)){var u=Pl(this,{object:this.proxy_||this.target_,name:r,type:hf,newValue:i});if(!u)return null;i=u.newValue}var h=b5(r),f={configurable:Lt.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:h.get,set:h.set};if(o){if(!Reflect.defineProperty(this.target_,r,f))return!1}else Iu(this.target_,r,f);var g=new vf(i,a,"ObservableObject.key",!1);this.values_.set(r,g),this.notifyPropertyAddition_(r,g.value_)}finally{Rs()}return!0},e.defineComputedProperty_=function(r,i,a){a===void 0&&(a=!1),this.keysAtom_;try{Ts();var o=this.delete_(r);if(!o)return o;if(Al(this)){var s=Pl(this,{object:this.proxy_||this.target_,name:r,type:hf,newValue:void 0});if(!s)return null}i.name||(i.name="ObservableObject.key"),i.context=this.proxy_||this.target_;var u=b5(r),h={configurable:Lt.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:u.get,set:u.set};if(a){if(!Reflect.defineProperty(this.target_,r,h))return!1}else Iu(this.target_,r,h);this.values_.set(r,new tu(i)),this.notifyPropertyAddition_(r,void 0)}finally{Rs()}return!0},e.delete_=function(r,i){if(i===void 0&&(i=!1),this.keysAtom_,!vc(this.target_,r))return!0;if(Al(this)){var a=Pl(this,{object:this.proxy_||this.target_,name:r,type:y5});if(!a)return null}try{var o;Ts();var s=Jl(this),u=!1,h=this.values_.get(r),f=void 0;if(!h&&(s||u)){var g;f=(g=o0(this.target_,r))==null?void 0:g.value}if(i){if(!Reflect.deleteProperty(this.target_,r))return!1}else delete this.target_[r];if(h&&(this.values_.delete(r),h instanceof vf&&(f=h.value_),S6(h)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(o=o.get(r))==null||o.set(r in this.target_),s||u){var v={type:y5,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:f,name:r};s&&eu(this,v)}}finally{Rs()}return!0},e.observe_=function(r,i){return Tp(this,r)},e.intercept_=function(r){return Np(this,r)},e.notifyPropertyAddition_=function(r,i){var a,o=Jl(this),s=!1;if(o||s){var u=o||s?{type:hf,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:r,newValue:i}:null;o&&eu(this,u)}(a=this.pendingKeys_)==null||(a=a.get(r))==null||a.set(!0),this.keysAtom_.reportChanged()},e.ownKeys_=function(){return this.keysAtom_.reportObserved(),R0(this.target_)},e.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},t})();function wd(t,e){var n;if(vc(t,vn))return t;var r=(n=e?.name)!=null?n:"ObservableObject",i=new $6(t,new Map,String(r),M9(e));return T0(t,vn,i),t}var RS=Sf("ObservableObjectAdministration",$6);function b5(t){return m5[t]||(m5[t]={get:function(){return this[vn].getObservablePropValue_(t)},set:function(n){return this[vn].setObservablePropValue_(t,n)}})}function iu(t){return N0(t)?RS(t[vn]):!1}function w5(t,e,n){var r;(r=t.target_[Nu])==null||delete r[n]}var MS=W6(0),IS=(function(){var t=!1,e={};return Object.defineProperty(e,"0",{set:function(){t=!0}}),Object.create(e)[0]=1,t===!1})(),Mg=0,G6=function(){};function jS(t,e){Object.setPrototypeOf?Object.setPrototypeOf(t.prototype,e):t.prototype.__proto__!==void 0?t.prototype.__proto__=e:t.prototype=e}jS(G6,Array.prototype);var Gm=(function(t){function e(r,i,a,o){var s;return a===void 0&&(a="ObservableArray"),o===void 0&&(o=!1),s=t.call(this)||this,mh(function(){var u=new Hm(a,i,o,!0);u.proxy_=s,n6(s,vn,u),r&&r.length&&s.spliceWithArray(0,0,r),IS&&Object.defineProperty(s,"0",MS)}),s}a6(e,t);var n=e.prototype;return n.concat=function(){this[vn].atom_.reportObserved();for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return Array.prototype.concat.apply(this.slice(),a.map(function(s){return Hu(s)?s.slice():s}))},n[Symbol.iterator]=function(){var r=this,i=0;return Wm({next:function(){return i<r.length?{value:r[i++],done:!1}:{done:!0,value:void 0}}})},bd(e,[{key:"length",get:function(){return this[vn].getArrayLength_()},set:function(i){this[vn].setArrayLength_(i)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])})(G6);Object.entries(d0).forEach(function(t){var e=t[0],n=t[1];e!=="concat"&&T0(Gm.prototype,e,n)});function W6(t){return{enumerable:!1,configurable:!0,get:function(){return this[vn].get_(t)},set:function(n){this[vn].set_(t,n)}}}function DS(t){Iu(Gm.prototype,""+t,W6(t))}function V6(t){if(t>Mg){for(var e=Mg;e<t+100;e++)DS(e);Mg=t}}V6(1e3);function FS(t,e,n){return new Gm(t,e,n)}function dd(t,e){if(typeof t=="object"&&t!==null){if(Hu(t))return e!==void 0&&Fn(23),t[vn].atom_;if(ns(t))return t.atom_;if(Nl(t)){if(e===void 0)return t.keysAtom_;var n=t.data_.get(e)||t.hasMap_.get(e);return n||Fn(25,e,Jv(t)),n}if(iu(t)){if(!e)return Fn(26);var r=t[vn].values_.get(e);return r||Fn(27,e,Jv(t)),r}if(Fm(t)||F0(t)||f0(t))return t}else if(ol(t)&&f0(t[vn]))return t[vn];Fn(28)}function qu(t,e){if(t||Fn(29),e!==void 0)return qu(dd(t,e));if(Fm(t)||F0(t)||f0(t)||Nl(t)||ns(t))return t;if(t[vn])return t[vn];Fn(24,t)}function Jv(t,e){var n;if(e!==void 0)n=dd(t,e);else{if(gp(t))return t.name;iu(t)||Nl(t)||ns(t)?n=qu(t):n=dd(t)}return n.name_}function mh(t){var e=vh(),n=j0(!0);Ts();try{return t()}finally{Rs(),D0(n),mc(e)}}var _5=L0.toString;function Y6(t,e,n){return n===void 0&&(n=-1),em(t,e,n)}function em(t,e,n,r,i){if(t===e)return t!==0||1/t===1/e;if(t==null||e==null)return!1;if(t!==t)return e!==e;var a=typeof t;if(a!=="function"&&a!=="object"&&typeof e!="object")return!1;var o=_5.call(t);if(o!==_5.call(e))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:+t==0?1/+t===1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e);case"[object Map]":case"[object Set]":n>=0&&n++;break}t=x5(t),e=x5(e);var s=o==="[object Array]";if(!s){if(typeof t!="object"||typeof e!="object")return!1;var u=t.constructor,h=e.constructor;if(u!==h&&!(ol(u)&&u instanceof u&&ol(h)&&h instanceof h)&&"constructor"in t&&"constructor"in e)return!1}if(n===0)return!1;n<0&&(n=-1),r=r||[],i=i||[];for(var f=r.length;f--;)if(r[f]===t)return i[f]===e;if(r.push(t),i.push(e),s){if(f=t.length,f!==e.length)return!1;for(;f--;)if(!em(t[f],e[f],n-1,r,i))return!1}else{var g=Object.keys(t),v=g.length;if(Object.keys(e).length!==v)return!1;for(var p=0;p<v;p++){var y=g[p];if(!(vc(e,y)&&em(t[y],e[y],n-1,r,i)))return!1}}return r.pop(),i.pop(),!0}function x5(t){return Hu(t)?t.slice():yd(t)||Nl(t)||dc(t)||ns(t)?Array.from(t.entries()):t}var S5,BS=((S5=C0().Iterator)==null?void 0:S5.prototype)||{};function Wm(t){return t[Symbol.iterator]=zS,Object.assign(Object.create(BS),t)}function zS(){return this}["Symbol","Map","Set"].forEach(function(t){var e=C0();typeof e[t]>"u"&&Fn("MobX requires global '"+t+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:J9,extras:{getDebugName:Jv},$mobx:vn});if(!ji.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!q6)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var X6=Kw();function qS(t){t()}function US(t){t||(t=qS),fS({reactionScheduler:t})}function HS(t){return dS(t)}var $S=1e4,GS=1e4,WS=(function(){function t(e){var n=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(r){r===void 0&&(r=$S),clearTimeout(n.sweepTimeout),n.sweepTimeout=void 0;var i=Date.now();n.registrations.forEach(function(a,o){i-a.registeredAt>=r&&(n.finalize(a.value),n.registrations.delete(o))}),n.registrations.size>0&&n.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){n.sweep(0)}})}return Object.defineProperty(t.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n,r){this.registrations.set(r,{value:n,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(t.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.registrations.delete(e)}}),Object.defineProperty(t.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,GS))}}),t})(),VS=typeof FinalizationRegistry<"u"?FinalizationRegistry:WS,tm=new VS(function(t){var e;(e=t.reaction)===null||e===void 0||e.dispose(),t.reaction=null}),Ig={exports:{}},jg={};/**
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 E5;function YS(){if(E5)return jg;E5=1;var t=Pp();function e(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,i=t.useEffect,a=t.useLayoutEffect,o=t.useDebugValue;function s(g,v){var p=v(),y=r({inst:{value:p,getSnapshot:v}}),_=y[0].inst,x=y[1];return a(function(){_.value=p,_.getSnapshot=v,u(_)&&x({inst:_})},[g,p,v]),i(function(){return u(_)&&x({inst:_}),g(function(){u(_)&&x({inst:_})})},[g]),o(p),p}function u(g){var v=g.getSnapshot;g=g.value;try{var p=v();return!n(g,p)}catch{return!0}}function h(g,v){return v()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:s;return jg.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:f,jg}var k5;function XS(){return k5||(k5=1,Ig.exports=YS()),Ig.exports}var KS=XS();function A5(t){t.reaction=new Bu("observer".concat(t.name),function(){var e;t.stateVersion=Symbol(),(e=t.onStoreChange)===null||e===void 0||e.call(t)})}function ZS(t,e){e===void 0&&(e="observed");var n=se.useRef(null);if(!n.current){var r={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:e,subscribe:function(s){return tm.unregister(r),r.onStoreChange=s,r.reaction||(A5(r),r.stateVersion=Symbol()),function(){var u;r.onStoreChange=null,(u=r.reaction)===null||u===void 0||u.dispose(),r.reaction=null}},getSnapshot:function(){return r.stateVersion}};n.current=r}var i=n.current;i.reaction||(A5(i),tm.register(n,i,i)),se.useDebugValue(i.reaction,HS),KS.useSyncExternalStore(i.subscribe,i.getSnapshot,i.getSnapshot);var a,o;if(i.reaction.track(function(){try{a=t()}catch(s){o=s}}),o)throw o;return a}var Dg,Fg,K6=typeof Symbol=="function"&&Symbol.for,QS=(Fg=(Dg=Object.getOwnPropertyDescriptor(function(){},"name"))===null||Dg===void 0?void 0:Dg.configurable)!==null&&Fg!==void 0?Fg:!1,P5=K6?Symbol.for("react.forward_ref"):typeof ji.forwardRef=="function"&&ji.forwardRef(function(t){return null}).$$typeof,O5=K6?Symbol.for("react.memo"):typeof ji.memo=="function"&&ji.memo(function(t){return null}).$$typeof;function ri(t,e){var n;if(O5&&t.$$typeof===O5)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.");var r=(n=void 0)!==null&&n!==void 0?n:!1,i=t,a=t.displayName||t.name;if(P5&&t.$$typeof===P5&&(r=!0,i=t.render,typeof i!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var o=function(s,u){return ZS(function(){return i(s,u)},a)};return o.displayName=t.displayName,QS&&Object.defineProperty(o,"name",{value:t.name,writable:!0,configurable:!0}),t.contextTypes&&(o.contextTypes=t.contextTypes),r&&(o=ji.forwardRef(o)),o=ji.memo(o),eE(t,o),o}var JS={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function eE(t,e){Object.keys(t).forEach(function(n){JS[n]||Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}function tE(t,e){return ji.useState(function(){return Kn(t(),e,{autoBind:!0})})[0]}var Bg;US(X6.unstable_batchedUpdates);Bg=tm.finalizeAllImmediately;const nE=Math.PI/180;function rE(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const Qf=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},Ot={_global:Qf,version:"10.0.2",isBrowser:rE(),isUnminified:/param/.test((function(t){}).toString()),dblClickWindow:400,getAngle(t){return Ot.angleDeg?t*nE:t},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,_renderBackend:"web",legacyTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return Ot.DD.isDragging},isTransforming(){var t,e;return(e=(t=Ot.Transformer)===null||t===void 0?void 0:t.isTransforming())!==null&&e!==void 0?e:!1},isDragReady(){return!!Ot.DD.node},releaseCanvasOnDestroy:!0,document:Qf.document,_injectGlobal(t){typeof Qf.Konva<"u"&&console.error("Severa Konva instances detected. It is not recommended to use multiple Konva instances in the same environment."),Qf.Konva=t}},Fi=t=>{Ot[t.prototype.getClassName()]=t};Ot._injectGlobal(Ot);const iE=`Konva.js unsupported environment.
43
+
44
+ Looks like you are trying to use Konva.js in Node.js environment. because "document" object is undefined.
45
+
46
+ To use Konva.js in Node.js environment, you need to use the "canvas-backend" or "skia-backend" module.
47
+
48
+ bash: npm install canvas
49
+ js: import "konva/canvas-backend";
50
+
51
+ or
52
+
53
+ bash: npm install skia-canvas
54
+ js: import "konva/skia-backend";
55
+ `,C5=()=>{if(typeof document>"u")throw new Error(iE)};class rl{constructor(e=[1,0,0,1,0,0]){this.dirty=!1,this.m=e&&e.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 rl(this.m)}copyInto(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}point(e){const n=this.m;return{x:n[0]*e.x+n[2]*e.y+n[4],y:n[1]*e.x+n[3]*e.y+n[5]}}translate(e,n){return this.m[4]+=this.m[0]*e+this.m[2]*n,this.m[5]+=this.m[1]*e+this.m[3]*n,this}scale(e,n){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=n,this.m[3]*=n,this}rotate(e){const n=Math.cos(e),r=Math.sin(e),i=this.m[0]*n+this.m[2]*r,a=this.m[1]*n+this.m[3]*r,o=this.m[0]*-r+this.m[2]*n,s=this.m[1]*-r+this.m[3]*n;return this.m[0]=i,this.m[1]=a,this.m[2]=o,this.m[3]=s,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(e,n){const r=this.m[0]+this.m[2]*n,i=this.m[1]+this.m[3]*n,a=this.m[2]+this.m[0]*e,o=this.m[3]+this.m[1]*e;return this.m[0]=r,this.m[1]=i,this.m[2]=a,this.m[3]=o,this}multiply(e){const n=this.m[0]*e.m[0]+this.m[2]*e.m[1],r=this.m[1]*e.m[0]+this.m[3]*e.m[1],i=this.m[0]*e.m[2]+this.m[2]*e.m[3],a=this.m[1]*e.m[2]+this.m[3]*e.m[3],o=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],s=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=a,this.m[4]=o,this.m[5]=s,this}invert(){const e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),n=this.m[3]*e,r=-this.m[1]*e,i=-this.m[2]*e,a=this.m[0]*e,o=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),s=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=a,this.m[4]=o,this.m[5]=s,this}getMatrix(){return this.m}decompose(){const e=this.m[0],n=this.m[1],r=this.m[2],i=this.m[3],a=this.m[4],o=this.m[5],s=e*i-n*r,u={x:a,y:o,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(e!=0||n!=0){const h=Math.sqrt(e*e+n*n);u.rotation=n>0?Math.acos(e/h):-Math.acos(e/h),u.scaleX=h,u.scaleY=s/h,u.skewX=(e*r+n*i)/s,u.skewY=0}else if(r!=0||i!=0){const h=Math.sqrt(r*r+i*i);u.rotation=Math.PI/2-(i>0?Math.acos(-r/h):-Math.acos(r/h)),u.scaleX=s/h,u.scaleY=h,u.skewX=0,u.skewY=(e*r+n*i)/s}return u.rotation=Ze._getRotation(u.rotation),u}}const aE="[object Array]",oE="[object Number]",sE="[object String]",lE="[object Boolean]",uE=Math.PI/180,cE=180/Math.PI,zg="#",fE="",hE="0",dE="Konva warning: ",L5="Konva error: ",pE="rgb(",qg={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]},gE=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let m1=[];const vE=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(t){setTimeout(t,60)},Ze={_isElement(t){return!!(t&&t.nodeType==1)},_isFunction(t){return!!(t&&t.constructor&&t.call&&t.apply)},_isPlainObject(t){return!!t&&t.constructor===Object},_isArray(t){return Object.prototype.toString.call(t)===aE},_isNumber(t){return Object.prototype.toString.call(t)===oE&&!isNaN(t)&&isFinite(t)},_isString(t){return Object.prototype.toString.call(t)===sE},_isBoolean(t){return Object.prototype.toString.call(t)===lE},isObject(t){return t instanceof Object},isValidSelector(t){if(typeof t!="string")return!1;const e=t[0];return e==="#"||e==="."||e===e.toUpperCase()},_sign(t){return t===0||t>0?1:-1},requestAnimFrame(t){m1.push(t),m1.length===1&&vE(function(){const e=m1;m1=[],e.forEach(function(n){n()})})},createCanvasElement(){C5();const t=document.createElement("canvas");try{t.style=t.style||{}}catch{}return t},createImageElement(){return C5(),document.createElement("img")},_isInDocument(t){for(;t=t.parentNode;)if(t==document)return!0;return!1},_urlToImage(t,e){const n=Ze.createImageElement();n.onload=function(){e(n)},n.src=t},_rgbToHex(t,e,n){return((1<<24)+(t<<16)+(e<<8)+n).toString(16).slice(1)},_hexToRgb(t){t=t.replace(zg,fE);const e=parseInt(t,16);return{r:e>>16&255,g:e>>8&255,b:e&255}},getRandomColor(){let t=(Math.random()*16777215<<0).toString(16);for(;t.length<6;)t=hE+t;return zg+t},getRGB(t){let e;return t in qg?(e=qg[t],{r:e[0],g:e[1],b:e[2]}):t[0]===zg?this._hexToRgb(t.substring(1)):t.substr(0,4)===pE?(e=gE.exec(t.replace(/ /g,"")),{r:parseInt(e[1],10),g:parseInt(e[2],10),b:parseInt(e[3],10)}):{r:0,g:0,b:0}},colorToRGBA(t){return t=t||"black",Ze._namedColorToRBA(t)||Ze._hex3ColorToRGBA(t)||Ze._hex4ColorToRGBA(t)||Ze._hex6ColorToRGBA(t)||Ze._hex8ColorToRGBA(t)||Ze._rgbColorToRGBA(t)||Ze._rgbaColorToRGBA(t)||Ze._hslColorToRGBA(t)},_namedColorToRBA(t){const e=qg[t.toLowerCase()];return e?{r:e[0],g:e[1],b:e[2],a:1}:null},_rgbColorToRGBA(t){if(t.indexOf("rgb(")===0){t=t.match(/rgb\(([^)]+)\)/)[1];const e=t.split(/ *, */).map(Number);return{r:e[0],g:e[1],b:e[2],a:1}}},_rgbaColorToRGBA(t){if(t.indexOf("rgba(")===0){t=t.match(/rgba\(([^)]+)\)/)[1];const e=t.split(/ *, */).map((n,r)=>n.slice(-1)==="%"?r===3?parseInt(n)/100:parseInt(n)/100*255:Number(n));return{r:e[0],g:e[1],b:e[2],a:e[3]}}},_hex8ColorToRGBA(t){if(t[0]==="#"&&t.length===9)return{r:parseInt(t.slice(1,3),16),g:parseInt(t.slice(3,5),16),b:parseInt(t.slice(5,7),16),a:parseInt(t.slice(7,9),16)/255}},_hex6ColorToRGBA(t){if(t[0]==="#"&&t.length===7)return{r:parseInt(t.slice(1,3),16),g:parseInt(t.slice(3,5),16),b:parseInt(t.slice(5,7),16),a:1}},_hex4ColorToRGBA(t){if(t[0]==="#"&&t.length===5)return{r:parseInt(t[1]+t[1],16),g:parseInt(t[2]+t[2],16),b:parseInt(t[3]+t[3],16),a:parseInt(t[4]+t[4],16)/255}},_hex3ColorToRGBA(t){if(t[0]==="#"&&t.length===4)return{r:parseInt(t[1]+t[1],16),g:parseInt(t[2]+t[2],16),b:parseInt(t[3]+t[3],16),a:1}},_hslColorToRGBA(t){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(t)){const[e,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(t),r=Number(n[0])/360,i=Number(n[1])/100,a=Number(n[2])/100;let o,s,u;if(i===0)return u=a*255,{r:Math.round(u),g:Math.round(u),b:Math.round(u),a:1};a<.5?o=a*(1+i):o=a+i-a*i;const h=2*a-o,f=[0,0,0];for(let g=0;g<3;g++)s=r+1/3*-(g-1),s<0&&s++,s>1&&s--,6*s<1?u=h+(o-h)*6*s:2*s<1?u=o:3*s<2?u=h+(o-h)*(2/3-s)*6:u=h,f[g]=u*255;return{r:Math.round(f[0]),g:Math.round(f[1]),b:Math.round(f[2]),a:1}}},haveIntersection(t,e){return!(e.x>t.x+t.width||e.x+e.width<t.x||e.y>t.y+t.height||e.y+e.height<t.y)},cloneObject(t){const e={};for(const n in t)this._isPlainObject(t[n])?e[n]=this.cloneObject(t[n]):this._isArray(t[n])?e[n]=this.cloneArray(t[n]):e[n]=t[n];return e},cloneArray(t){return t.slice(0)},degToRad(t){return t*uE},radToDeg(t){return t*cE},_degToRad(t){return Ze.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),Ze.degToRad(t)},_radToDeg(t){return Ze.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),Ze.radToDeg(t)},_getRotation(t){return Ot.angleDeg?Ze.radToDeg(t):t},_capitalize(t){return t.charAt(0).toUpperCase()+t.slice(1)},throw(t){throw new Error(L5+t)},error(t){console.error(L5+t)},warn(t){Ot.showWarnings&&console.warn(dE+t)},each(t,e){for(const n in t)e(n,t[n])},_inRange(t,e,n){return e<=t&&t<n},_getProjectionToSegment(t,e,n,r,i,a){let o,s,u;const h=(t-n)*(t-n)+(e-r)*(e-r);if(h==0)o=t,s=e,u=(i-n)*(i-n)+(a-r)*(a-r);else{const f=((i-t)*(n-t)+(a-e)*(r-e))/h;f<0?(o=t,s=e,u=(t-i)*(t-i)+(e-a)*(e-a)):f>1?(o=n,s=r,u=(n-i)*(n-i)+(r-a)*(r-a)):(o=t+f*(n-t),s=e+f*(r-e),u=(o-i)*(o-i)+(s-a)*(s-a))}return[o,s,u]},_getProjectionToLine(t,e,n){const r=Ze.cloneObject(t);let i=Number.MAX_VALUE;return e.forEach(function(a,o){if(!n&&o===e.length-1)return;const s=e[(o+1)%e.length],u=Ze._getProjectionToSegment(a.x,a.y,s.x,s.y,t.x,t.y),h=u[0],f=u[1],g=u[2];g<i&&(r.x=h,r.y=f,i=g)}),r},_prepareArrayForTween(t,e,n){const r=[],i=[];if(t.length>e.length){const o=e;e=t,t=o}for(let o=0;o<t.length;o+=2)r.push({x:t[o],y:t[o+1]});for(let o=0;o<e.length;o+=2)i.push({x:e[o],y:e[o+1]});const a=[];return i.forEach(function(o){const s=Ze._getProjectionToLine(o,r,n);a.push(s.x),a.push(s.y)}),a},_prepareToStringify(t){let e;t.visitedByCircularReferenceRemoval=!0;for(const n in t)if(t.hasOwnProperty(n)&&t[n]&&typeof t[n]=="object"){if(e=Object.getOwnPropertyDescriptor(t,n),t[n].visitedByCircularReferenceRemoval||Ze._isElement(t[n]))if(e.configurable)delete t[n];else return null;else if(Ze._prepareToStringify(t[n])===null)if(e.configurable)delete t[n];else return null}return delete t.visitedByCircularReferenceRemoval,t},_assign(t,e){for(const n in e)t[n]=e[n];return t},_getFirstPointerId(t){return t.touches?t.changedTouches[0].identifier:t.pointerId||999},releaseCanvas(...t){Ot.releaseCanvasOnDestroy&&t.forEach(e=>{e.width=0,e.height=0})},drawRoundedRectPath(t,e,n,r){let i=e<0?e:0,a=n<0?n:0;e=Math.abs(e),n=Math.abs(n);let o=0,s=0,u=0,h=0;typeof r=="number"?o=s=u=h=Math.min(r,e/2,n/2):(o=Math.min(r[0]||0,e/2,n/2),s=Math.min(r[1]||0,e/2,n/2),h=Math.min(r[2]||0,e/2,n/2),u=Math.min(r[3]||0,e/2,n/2)),t.moveTo(i+o,a),t.lineTo(i+e-s,a),t.arc(i+e-s,a+s,s,Math.PI*3/2,0,!1),t.lineTo(i+e,a+n-h),t.arc(i+e-h,a+n-h,h,0,Math.PI/2,!1),t.lineTo(i+u,a+n),t.arc(i+u,a+n-u,u,Math.PI/2,Math.PI,!1),t.lineTo(i,a+o),t.arc(i+o,a+o,o,Math.PI,Math.PI*3/2,!1)},drawRoundedPolygonPath(t,e,n,r,i){r=Math.abs(r);for(let a=0;a<n;a++){const o=e[(a-1+n)%n],s=e[a],u=e[(a+1)%n],h={x:s.x-o.x,y:s.y-o.y},f={x:u.x-s.x,y:u.y-s.y},g=Math.hypot(h.x,h.y),v=Math.hypot(f.x,f.y);let p;typeof i=="number"?p=i:p=a<i.length?i[a]:0,p=r*Math.cos(Math.PI/n)*Math.min(1,p/r*2);const _={x:h.x/g,y:h.y/g},x={x:f.x/v,y:f.y/v},b={x:s.x-_.x*p,y:s.y-_.y*p},E={x:s.x+x.x*p,y:s.y+x.y*p};a===0?t.moveTo(b.x,b.y):t.lineTo(b.x,b.y),t.arcTo(s.x,s.y,E.x,E.y,p)}}};function mE(t){const e=[],n=t.length,r=Ze;for(let i=0;i<n;i++){let a=t[i];r._isNumber(a)?a=Math.round(a*1e3)/1e3:r._isString(a)||(a=a+""),e.push(a)}return e}const N5=",",yE="(",bE=")",wE="([",_E="])",xE=";",SE="()",EE="=",T5=["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"],kE=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","filter"],AE=100;let y1=null;function R5(){if(y1!==null)return y1;try{const e=Ze.createCanvasElement().getContext("2d");return e?!!e&&"filter"in e:(y1=!1,!1)}catch{return y1=!1,!1}}class B0{constructor(e){this.canvas=e,Ot.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(e){e.fillEnabled()&&this._fill(e)}_fill(e){}strokeShape(e){e.hasStroke()&&this._stroke(e)}_stroke(e){}fillStrokeShape(e){e.attrs.fillAfterStrokeEnabled?(this.strokeShape(e),this.fillShape(e)):(this.fillShape(e),this.strokeShape(e))}getTrace(e,n){let r=this.traceArr,i=r.length,a="",o,s,u,h;for(o=0;o<i;o++)s=r[o],u=s.method,u?(h=s.args,a+=u,e?a+=SE:Ze._isArray(h[0])?a+=wE+h.join(N5)+_E:(n&&(h=h.map(f=>typeof f=="number"?Math.floor(f):f)),a+=yE+h.join(N5)+bE)):(a+=s.property,e||(a+=EE+s.val)),a+=xE;return a}clearTrace(){this.traceArr=[]}_trace(e){let n=this.traceArr,r;n.push(e),r=n.length,r>=AE&&n.shift()}reset(){const e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){const n=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(e){const n=e.attrs.lineCap;n&&this.setAttr("lineCap",n)}_applyOpacity(e){const n=e.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(e){const n=e.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}_applyMiterLimit(e){const n=e.attrs.miterLimit;n!=null&&this.setAttr("miterLimit",n)}setAttr(e,n){this._context[e]=n}arc(e,n,r,i,a,o){this._context.arc(e,n,r,i,a,o)}arcTo(e,n,r,i,a){this._context.arcTo(e,n,r,i,a)}beginPath(){this._context.beginPath()}bezierCurveTo(e,n,r,i,a,o){this._context.bezierCurveTo(e,n,r,i,a,o)}clearRect(e,n,r,i){this._context.clearRect(e,n,r,i)}clip(...e){this._context.clip.apply(this._context,e)}closePath(){this._context.closePath()}createImageData(e,n){const r=arguments;if(r.length===2)return this._context.createImageData(e,n);if(r.length===1)return this._context.createImageData(e)}createLinearGradient(e,n,r,i){return this._context.createLinearGradient(e,n,r,i)}createPattern(e,n){return this._context.createPattern(e,n)}createRadialGradient(e,n,r,i,a,o){return this._context.createRadialGradient(e,n,r,i,a,o)}drawImage(e,n,r,i,a,o,s,u,h){const f=arguments,g=this._context;f.length===3?g.drawImage(e,n,r):f.length===5?g.drawImage(e,n,r,i,a):f.length===9&&g.drawImage(e,n,r,i,a,o,s,u,h)}ellipse(e,n,r,i,a,o,s,u){this._context.ellipse(e,n,r,i,a,o,s,u)}isPointInPath(e,n,r,i){return r?this._context.isPointInPath(r,e,n,i):this._context.isPointInPath(e,n,i)}fill(...e){this._context.fill.apply(this._context,e)}fillRect(e,n,r,i){this._context.fillRect(e,n,r,i)}strokeRect(e,n,r,i){this._context.strokeRect(e,n,r,i)}fillText(e,n,r,i){i?this._context.fillText(e,n,r,i):this._context.fillText(e,n,r)}measureText(e){return this._context.measureText(e)}getImageData(e,n,r,i){return this._context.getImageData(e,n,r,i)}lineTo(e,n){this._context.lineTo(e,n)}moveTo(e,n){this._context.moveTo(e,n)}rect(e,n,r,i){this._context.rect(e,n,r,i)}roundRect(e,n,r,i,a){this._context.roundRect(e,n,r,i,a)}putImageData(e,n,r){this._context.putImageData(e,n,r)}quadraticCurveTo(e,n,r,i){this._context.quadraticCurveTo(e,n,r,i)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,n){this._context.scale(e,n)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,n,r,i,a,o){this._context.setTransform(e,n,r,i,a,o)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,n,r,i){this._context.strokeText(e,n,r,i)}transform(e,n,r,i,a,o){this._context.transform(e,n,r,i,a,o)}translate(e,n){this._context.translate(e,n)}_enableTrace(){let e=this,n=T5.length,r=this.setAttr,i,a;const o=function(s){let u=e[s],h;e[s]=function(){return a=mE(Array.prototype.slice.call(arguments,0)),h=u.apply(e,arguments),e._trace({method:s,args:a}),h}};for(i=0;i<n;i++)o(T5[i]);e.setAttr=function(){r.apply(e,arguments);const s=arguments[0];let u=arguments[1];(s==="shadowOffsetX"||s==="shadowOffsetY"||s==="shadowBlur")&&(u=u/this.canvas.getPixelRatio()),e._trace({property:s,val:u})}}_applyGlobalCompositeOperation(e){const n=e.attrs.globalCompositeOperation;!n||n==="source-over"||this.setAttr("globalCompositeOperation",n)}}kE.forEach(function(t){Object.defineProperty(B0.prototype,t,{get(){return this._context[t]},set(e){this._context[t]=e}})});class PE extends B0{constructor(e,{willReadFrequently:n=!1}={}){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:n})}_fillColor(e){const n=e.fill();this.setAttr("fillStyle",n),e._fillFunc(this)}_fillPattern(e){this.setAttr("fillStyle",e._getFillPattern()),e._fillFunc(this)}_fillLinearGradient(e){const n=e._getLinearGradient();n&&(this.setAttr("fillStyle",n),e._fillFunc(this))}_fillRadialGradient(e){const n=e._getRadialGradient();n&&(this.setAttr("fillStyle",n),e._fillFunc(this))}_fill(e){const n=e.fill(),r=e.getFillPriority();if(n&&r==="color"){this._fillColor(e);return}const i=e.getFillPatternImage();if(i&&r==="pattern"){this._fillPattern(e);return}const a=e.getFillLinearGradientColorStops();if(a&&r==="linear-gradient"){this._fillLinearGradient(e);return}const o=e.getFillRadialGradientColorStops();if(o&&r==="radial-gradient"){this._fillRadialGradient(e);return}n?this._fillColor(e):i?this._fillPattern(e):a?this._fillLinearGradient(e):o&&this._fillRadialGradient(e)}_strokeLinearGradient(e){const n=e.getStrokeLinearGradientStartPoint(),r=e.getStrokeLinearGradientEndPoint(),i=e.getStrokeLinearGradientColorStops(),a=this.createLinearGradient(n.x,n.y,r.x,r.y);if(i){for(let o=0;o<i.length;o+=2)a.addColorStop(i[o],i[o+1]);this.setAttr("strokeStyle",a)}}_stroke(e){const n=e.dash(),r=e.getStrokeScaleEnabled();if(e.hasStroke()){if(!r){this.save();const a=this.getCanvas().getPixelRatio();this.setTransform(a,0,0,a,0,0)}this._applyLineCap(e),n&&e.dashEnabled()&&(this.setLineDash(n),this.setAttr("lineDashOffset",e.dashOffset())),this.setAttr("lineWidth",e.strokeWidth()),e.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),e.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(e):this.setAttr("strokeStyle",e.stroke()),e._strokeFunc(this),r||this.restore()}}_applyShadow(e){var n,r,i;const a=(n=e.getShadowRGBA())!==null&&n!==void 0?n:"black",o=(r=e.getShadowBlur())!==null&&r!==void 0?r:5,s=(i=e.getShadowOffset())!==null&&i!==void 0?i:{x:0,y:0},u=e.getAbsoluteScale(),h=this.canvas.getPixelRatio(),f=u.x*h,g=u.y*h;this.setAttr("shadowColor",a),this.setAttr("shadowBlur",o*Math.min(Math.abs(f),Math.abs(g))),this.setAttr("shadowOffsetX",s.x*f),this.setAttr("shadowOffsetY",s.y*g)}}class OE extends B0{constructor(e){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:!0})}_fill(e){this.save(),this.setAttr("fillStyle",e.colorKey),e._fillFuncHit(this),this.restore()}strokeShape(e){e.hasHitStroke()&&this._stroke(e)}_stroke(e){if(e.hasHitStroke()){const n=e.getStrokeScaleEnabled();if(!n){this.save();const a=this.getCanvas().getPixelRatio();this.setTransform(a,0,0,a,0,0)}this._applyLineCap(e);const r=e.hitStrokeWidth(),i=r==="auto"?e.strokeWidth():r;this.setAttr("lineWidth",i),this.setAttr("strokeStyle",e.colorKey),e._strokeFuncHit(this),n||this.restore()}}}let b1;function CE(){if(b1)return b1;const t=Ze.createCanvasElement(),e=t.getContext("2d");return b1=(function(){const n=Ot._global.devicePixelRatio||1,r=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return n/r})(),Ze.releaseCanvas(t),b1}class Vm{constructor(e){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const r=(e||{}).pixelRatio||Ot.pixelRatio||CE();this.pixelRatio=r,this._canvas=Ze.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(e){const n=this.pixelRatio;this.pixelRatio=e,this.setSize(this.getWidth()/n,this.getHeight()/n)}setWidth(e){this.width=this._canvas.width=e*this.pixelRatio,this._canvas.style.width=e+"px";const n=this.pixelRatio;this.getContext()._context.scale(n,n)}setHeight(e){this.height=this._canvas.height=e*this.pixelRatio,this._canvas.style.height=e+"px";const n=this.pixelRatio;this.getContext()._context.scale(n,n)}getWidth(){return this.width}getHeight(){return this.height}setSize(e,n){this.setWidth(e||0),this.setHeight(n||0)}toDataURL(e,n){try{return this._canvas.toDataURL(e,n)}catch{try{return this._canvas.toDataURL()}catch(i){return Ze.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}class uf extends Vm{constructor(e={width:0,height:0,willReadFrequently:!1}){super(e),this.context=new PE(this,{willReadFrequently:e.willReadFrequently}),this.setSize(e.width,e.height)}}function M5(){const t=Ze.createCanvasElement();t.width=1,t.height=1;const e=t.getContext("2d",{willReadFrequently:!0});e.clearRect(0,0,1,1),e.fillStyle="rgba(255,0,255,1)",e.fillRect(0,0,1,1);const n=e.getImageData(0,0,1,1).data;return!(n[0]===255&&n[1]===0&&n[2]===255&&n[3]===255)}function I5(){var t,e;return typeof navigator>"u"?!1:(e=(t=navigator.brave)===null||t===void 0?void 0:t.isBrave())!==null&&e!==void 0?e:!1}let j5=!1;function LE(){return I5()&&M5()&&!j5&&(j5=!0,Ze.error('Looks like you have "Brave shield" enabled in your browser. It breaks KonvaJS internals. Please disable it. You may need to ask your users to do the same.')),I5()&&M5()}class Ym extends Vm{constructor(e={width:0,height:0}){super(e),this.hitCanvas=!0,this.context=new OE(this),this.setSize(e.width,e.height),LE()}}const yr={get isDragging(){let t=!1;return yr._dragElements.forEach(e=>{e.dragStatus==="dragging"&&(t=!0)}),t},justDragged:!1,get node(){let t;return yr._dragElements.forEach(e=>{t=e.node}),t},_dragElements:new Map,_drag(t){const e=[];yr._dragElements.forEach((n,r)=>{const{node:i}=n,a=i.getStage();a.setPointersPositions(t),n.pointerId===void 0&&(n.pointerId=Ze._getFirstPointerId(t));const o=a._changedPointerPositions.find(s=>s.id===n.pointerId);if(o){if(n.dragStatus!=="dragging"){const s=i.dragDistance();if(Math.max(Math.abs(o.x-n.startPointerPos.x),Math.abs(o.y-n.startPointerPos.y))<s||(i.startDrag({evt:t}),!i.isDragging()))return}i._setDragPosition(t,n),e.push(i)}}),e.forEach(n=>{n.fire("dragmove",{type:"dragmove",target:n,evt:t},!0)})},_endDragBefore(t){const e=[];yr._dragElements.forEach(n=>{const{node:r}=n,i=r.getStage();if(t&&i.setPointersPositions(t),!i._changedPointerPositions.find(s=>s.id===n.pointerId))return;(n.dragStatus==="dragging"||n.dragStatus==="stopped")&&(yr.justDragged=!0,Ot._mouseListenClick=!1,Ot._touchListenClick=!1,Ot._pointerListenClick=!1,n.dragStatus="stopped");const o=n.node.getLayer()||n.node instanceof Ot.Stage&&n.node;o&&e.indexOf(o)===-1&&e.push(o)}),e.forEach(n=>{n.draw()})},_endDragAfter(t){yr._dragElements.forEach((e,n)=>{e.dragStatus==="stopped"&&e.node.fire("dragend",{type:"dragend",target:e.node,evt:t},!0),e.dragStatus!=="dragging"&&yr._dragElements.delete(n)})}};Ot.isBrowser&&(window.addEventListener("mouseup",yr._endDragBefore,!0),window.addEventListener("touchend",yr._endDragBefore,!0),window.addEventListener("touchcancel",yr._endDragBefore,!0),window.addEventListener("mousemove",yr._drag),window.addEventListener("touchmove",yr._drag),window.addEventListener("mouseup",yr._endDragAfter,!1),window.addEventListener("touchend",yr._endDragAfter,!1),window.addEventListener("touchcancel",yr._endDragAfter,!1));function kf(t){return Ze._isString(t)?'"'+t+'"':Object.prototype.toString.call(t)==="[object Number]"||Ze._isBoolean(t)?t:Object.prototype.toString.call(t)}function Z6(t){return t>255?255:t<0?0:Math.round(t)}function Et(){if(Ot.isUnminified)return function(t,e){return Ze._isNumber(t)||Ze.warn(kf(t)+' is a not valid value for "'+e+'" attribute. The value should be a number.'),t}}function z0(t){if(Ot.isUnminified)return function(e,n){let r=Ze._isNumber(e),i=Ze._isArray(e)&&e.length==t;return!r&&!i&&Ze.warn(kf(e)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+t+")"),e}}function Xm(){if(Ot.isUnminified)return function(t,e){return Ze._isNumber(t)||t==="auto"||Ze.warn(kf(t)+' is a not valid value for "'+e+'" attribute. The value should be a number or "auto".'),t}}function yh(){if(Ot.isUnminified)return function(t,e){return Ze._isString(t)||Ze.warn(kf(t)+' is a not valid value for "'+e+'" attribute. The value should be a string.'),t}}function Q6(){if(Ot.isUnminified)return function(t,e){const n=Ze._isString(t),r=Object.prototype.toString.call(t)==="[object CanvasGradient]"||t&&t.addColorStop;return n||r||Ze.warn(kf(t)+' is a not valid value for "'+e+'" attribute. The value should be a string or a native gradient.'),t}}function NE(){if(Ot.isUnminified)return function(t,e){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&t instanceof n||(Ze._isArray(t)?t.forEach(function(r){Ze._isNumber(r)||Ze.warn('"'+e+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):Ze.warn(kf(t)+' is a not valid value for "'+e+'" attribute. The value should be a array of numbers.')),t}}function au(){if(Ot.isUnminified)return function(t,e){return t===!0||t===!1||Ze.warn(kf(t)+' is a not valid value for "'+e+'" attribute. The value should be a boolean.'),t}}function TE(t){if(Ot.isUnminified)return function(e,n){return e==null||Ze.isObject(e)||Ze.warn(kf(e)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+t),e}}const Dd="get",Fd="set",je={addGetterSetter(t,e,n,r,i){je.addGetter(t,e,n),je.addSetter(t,e,r,i),je.addOverloadedGetterSetter(t,e)},addGetter(t,e,n){const r=Dd+Ze._capitalize(e);t.prototype[r]=t.prototype[r]||function(){const i=this.attrs[e];return i===void 0?n:i}},addSetter(t,e,n,r){const i=Fd+Ze._capitalize(e);t.prototype[i]||je.overWriteSetter(t,e,n,r)},overWriteSetter(t,e,n,r){const i=Fd+Ze._capitalize(e);t.prototype[i]=function(a){return n&&a!==void 0&&a!==null&&(a=n.call(this,a,e)),this._setAttr(e,a),r&&r.call(this),this}},addComponentsGetterSetter(t,e,n,r,i){const a=n.length,o=Ze._capitalize,s=Dd+o(e),u=Fd+o(e);t.prototype[s]=function(){const f={};for(let g=0;g<a;g++){const v=n[g];f[v]=this.getAttr(e+o(v))}return f};const h=TE(n);t.prototype[u]=function(f){const g=this.attrs[e];r&&(f=r.call(this,f,e)),h&&h.call(this,f,e);for(const v in f)f.hasOwnProperty(v)&&this._setAttr(e+o(v),f[v]);return f||n.forEach(v=>{this._setAttr(e+o(v),void 0)}),this._fireChangeEvent(e,g,f),i&&i.call(this),this},je.addOverloadedGetterSetter(t,e)},addOverloadedGetterSetter(t,e){const n=Ze._capitalize(e),r=Fd+n,i=Dd+n;t.prototype[e]=function(){return arguments.length?(this[r](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(t,e,n,r){Ze.error("Adding deprecated "+e);const i=Dd+Ze._capitalize(e),a=e+" property is deprecated and will be removed soon. Look at Konva change log for more information.";t.prototype[i]=function(){Ze.error(a);const o=this.attrs[e];return o===void 0?n:o},je.addSetter(t,e,r,function(){Ze.error(a)}),je.addOverloadedGetterSetter(t,e)},backCompat(t,e){Ze.each(e,function(n,r){const i=t.prototype[r],a=Dd+Ze._capitalize(n),o=Fd+Ze._capitalize(n);function s(){i.apply(this,arguments),Ze.error('"'+n+'" method is deprecated and will be removed soon. Use ""'+r+'" instead.')}t.prototype[n]=s,t.prototype[a]=s,t.prototype[o]=s})},afterSetFilter(){this._filterUpToDate=!1}};function RE(t){const e=/(\w+)\(([^)]+)\)/g;let n;for(;(n=e.exec(t))!==null;){const[,r,i]=n;switch(r){case"blur":{const a=parseFloat(i.replace("px",""));return function(o){this.blurRadius(a*.5);const s=Ot.Filters;s&&s.Blur&&s.Blur.call(this,o)}}case"brightness":{const a=i.includes("%")?parseFloat(i)/100:parseFloat(i);return function(o){this.brightness(a);const s=Ot.Filters;s&&s.Brightness&&s.Brightness.call(this,o)}}case"contrast":{const a=parseFloat(i);return function(o){const s=100*(Math.sqrt(a)-1);this.contrast(s);const u=Ot.Filters;u&&u.Contrast&&u.Contrast.call(this,o)}}case"grayscale":return function(a){const o=Ot.Filters;o&&o.Grayscale&&o.Grayscale.call(this,a)};case"sepia":return function(a){const o=Ot.Filters;o&&o.Sepia&&o.Sepia.call(this,a)};case"invert":return function(a){const o=Ot.Filters;o&&o.Invert&&o.Invert.call(this,a)};default:Ze.warn(`CSS filter "${r}" is not supported in fallback mode. Consider using function filters for better compatibility.`);break}}return()=>{}}const V1="absoluteOpacity",w1="allEventListeners",cc="absoluteTransform",D5="absoluteScale",$f="canvas",ME="Change",IE="children",jE="konva",nm="listening",DE="mouseenter",FE="mouseleave",BE="pointerenter",zE="pointerleave",qE="touchenter",UE="touchleave",F5="set",B5="Shape",Y1=" ",z5="stage",sf="transform",HE="Stage",rm="visible",$E=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(Y1);let GE=1,At=class im{constructor(e){this._id=GE++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){(e===sf||e===cc)&&this._cache.get(e)?this._cache.get(e).dirty=!0:e?this._cache.delete(e):this._cache.clear()}_getCache(e,n){let r=this._cache.get(e);return(r===void 0||(e===sf||e===cc)&&r.dirty===!0)&&(r=n.call(this),this._cache.set(e,r)),r}_calculate(e,n,r){if(!this._attachedDepsListeners.get(e)){const i=n.map(a=>a+"Change.konva").join(Y1);this.on(i,()=>{this._clearCache(e)}),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,r)}_getCanvasCache(){return this._cache.get($f)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===cc&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has($f)){const{scene:e,filter:n,hit:r,buffer:i}=this._cache.get($f);Ze.releaseCanvas(e,n,r,i),this._cache.delete($f)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){const n=e||{};let r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let i=Math.ceil(n.width||r.width),a=Math.ceil(n.height||r.height),o=n.pixelRatio,s=n.x===void 0?Math.floor(r.x):n.x,u=n.y===void 0?Math.floor(r.y):n.y,h=n.offset||0,f=n.drawBorder||!1,g=n.hitCanvasPixelRatio||1;if(!i||!a){Ze.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const v=Math.abs(Math.round(r.x)-s)>.5?1:0,p=Math.abs(Math.round(r.y)-u)>.5?1:0;i+=h*2+v,a+=h*2+p,s-=h,u-=h;const y=new uf({pixelRatio:o,width:i,height:a}),_=new uf({pixelRatio:o,width:0,height:0,willReadFrequently:!0}),x=new Ym({pixelRatio:g,width:i,height:a}),b=y.getContext(),E=x.getContext(),A=new uf({width:y.width/y.pixelRatio+Math.abs(s),height:y.height/y.pixelRatio+Math.abs(u),pixelRatio:y.pixelRatio}),S=A.getContext();return x.isCache=!0,y.isCache=!0,this._cache.delete($f),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(y.getContext()._context.imageSmoothingEnabled=!1,_.getContext()._context.imageSmoothingEnabled=!1),b.save(),E.save(),S.save(),b.translate(-s,-u),E.translate(-s,-u),S.translate(-s,-u),A.x=s,A.y=u,this._isUnderCache=!0,this._clearSelfAndDescendantCache(V1),this._clearSelfAndDescendantCache(D5),this.drawScene(y,this,A),this.drawHit(x,this),this._isUnderCache=!1,b.restore(),E.restore(),f&&(b.save(),b.beginPath(),b.rect(0,0,i,a),b.closePath(),b.setAttr("strokeStyle","red"),b.setAttr("lineWidth",5),b.stroke(),b.restore()),this._cache.set($f,{scene:y,filter:_,hit:x,buffer:A,x:s,y:u}),this._requestDraw(),this}isCached(){return this._cache.has($f)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,n){const r=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}];let i=1/0,a=1/0,o=-1/0,s=-1/0;const u=this.getAbsoluteTransform(n);return r.forEach(function(h){const f=u.point(h);i===void 0&&(i=o=f.x,a=s=f.y),i=Math.min(i,f.x),a=Math.min(a,f.y),o=Math.max(o,f.x),s=Math.max(s,f.y)}),{x:i,y:a,width:o-i,height:s-a}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();e.translate(n.x,n.y);const r=this._getCachedSceneCanvas(),i=r.pixelRatio;e.drawImage(r._canvas,0,0,r.width/i,r.height/i),e.restore()}_drawCachedHitCanvas(e){const n=this._getCanvasCache(),r=n.hit;e.save(),e.translate(n.x,n.y),e.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),e.restore()}_getCachedSceneCanvas(){let e=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,a=i.getContext(),o,s,u,h;if(!e||e.length===0)return r;if(this._filterUpToDate)return i;let f=!0;for(let v=0;v<e.length;v++)if(typeof e[v]=="string"&&R5(),typeof e[v]!="string"||!R5()){f=!1;break}const g=r.pixelRatio;if(i.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio),f){const v=e.join(" ");return a.save(),a.setAttr("filter",v),a.drawImage(r._canvas,0,0,r.getWidth()/g,r.getHeight()/g),a.restore(),this._filterUpToDate=!0,i}try{for(o=e.length,a.clear(),a.drawImage(r._canvas,0,0,r.getWidth()/g,r.getHeight()/g),s=a.getImageData(0,0,i.getWidth(),i.getHeight()),u=0;u<o;u++)h=e[u],typeof h=="string"&&(h=RE(h)),h.call(this,s),a.putImageData(s,0,0)}catch(v){Ze.error("Unable to apply filter. "+v.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}return this._filterUpToDate=!0,i}on(e,n){if(this._cache&&this._cache.delete(w1),arguments.length===3)return this._delegate.apply(this,arguments);const r=e.split(Y1);for(let i=0;i<r.length;i++){const o=r[i].split("."),s=o[0],u=o[1]||"";this.eventListeners[s]||(this.eventListeners[s]=[]),this.eventListeners[s].push({name:u,handler:n})}return this}off(e,n){let r=(e||"").split(Y1),i=r.length,a,o,s,u,h,f;if(this._cache&&this._cache.delete(w1),!e)for(o in this.eventListeners)this._off(o);for(a=0;a<i;a++)if(s=r[a],u=s.split("."),h=u[0],f=u[1],h)this.eventListeners[h]&&this._off(h,f,n);else for(o in this.eventListeners)this._off(o,f,n);return this}dispatchEvent(e){const n={target:this,type:e.type,evt:e};return this.fire(e.type,n),this}addEventListener(e,n){return this.on(e,function(r){n.call(this,r.evt)}),this}removeEventListener(e){return this.off(e),this}_delegate(e,n,r){const i=this;this.on(e,function(a){const o=a.target.findAncestors(n,!0,i);for(let s=0;s<o.length;s++)a=Ze.cloneObject(a),a.currentTarget=o[s],r.call(o[s],a)})}remove(){return this.isDragging()&&this.stopDrag(),yr._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(cc),this._clearSelfAndDescendantCache(V1),this._clearSelfAndDescendantCache(D5),this._clearSelfAndDescendantCache(z5),this._clearSelfAndDescendantCache(rm),this._clearSelfAndDescendantCache(nm)}_remove(){this._clearCaches();const e=this.getParent();e&&e.children&&(e.children.splice(this.index,1),e._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(e){const n="get"+Ze._capitalize(e);return Ze._isFunction(this[n])?this[n]():this.attrs[e]}getAncestors(){let e=this.getParent(),n=[];for(;e;)n.push(e),e=e.getParent();return n}getAttrs(){return this.attrs||{}}setAttrs(e){return this._batchTransformChanges(()=>{let n,r;if(!e)return this;for(n in e)n!==IE&&(r=F5+Ze._capitalize(n),Ze._isFunction(this[r])?this[r](e[n]):this._setAttr(n,e[n]))}),this}isListening(){return this._getCache(nm,this._isListening)}_isListening(e){if(!this.listening())return!1;const r=this.getParent();return r&&r!==e&&this!==e?r._isListening(e):!0}isVisible(){return this._getCache(rm,this._isVisible)}_isVisible(e){if(!this.visible())return!1;const r=this.getParent();return r&&r!==e&&this!==e?r._isVisible(e):!0}shouldDrawHit(e,n=!1){if(e)return this._isVisible(e)&&this._isListening(e);const r=this.getLayer();let i=!1;yr._dragElements.forEach(o=>{o.dragStatus==="dragging"&&(o.node.nodeType==="Stage"||o.node.getLayer()===r)&&(i=!0)});const a=!n&&!Ot.hitOnDragEnabled&&(i||Ot.isTransforming());return this.isListening()&&this.isVisible()&&!a}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let e=this.getDepth(),n=this,r=0,i,a,o,s;function u(f){for(i=[],a=f.length,o=0;o<a;o++)s=f[o],r++,s.nodeType!==B5&&(i=i.concat(s.getChildren().slice())),s._id===n._id&&(o=a);i.length>0&&i[0].getDepth()<=e&&u(i)}const h=this.getStage();return n.nodeType!==HE&&h&&u(h.getChildren()),r}getDepth(){let e=0,n=this.parent;for(;n;)e++,n=n.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(sf),this._clearSelfAndDescendantCache(cc)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges(()=>{this.x(e.x),this.y(e.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const e=this.getStage();if(!e)return null;const n=e.getPointerPosition();if(!n)return null;const r=this.getAbsoluteTransform().copy();return r.invert(),r.point(n)}getAbsolutePosition(e){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!e&&(e=!0);const i=this.getAbsoluteTransform(e).getMatrix(),a=new rl,o=this.offset();return a.m=i.slice(),a.translate(o.x,o.y),a.getTranslation()}setAbsolutePosition(e){const{x:n,y:r,...i}=this._clearTransform();this.attrs.x=n,this.attrs.y=r,this._clearCache(sf);const a=this._getAbsoluteTransform().copy();return a.invert(),a.translate(e.x,e.y),e={x:this.attrs.x+a.getTranslation().x,y:this.attrs.y+a.getTranslation().y},this._setTransform(i),this.setPosition({x:e.x,y:e.y}),this._clearCache(sf),this._clearSelfAndDescendantCache(cc),this}_setTransform(e){let n;for(n in e)this.attrs[n]=e[n]}_clearTransform(){const e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,e}move(e){let n=e.x,r=e.y,i=this.x(),a=this.y();return n!==void 0&&(i+=n),r!==void 0&&(a+=r),this.setPosition({x:i,y:a}),this}_eachAncestorReverse(e,n){let r=[],i=this.getParent(),a,o;if(!(n&&n._id===this._id)){for(r.unshift(this);i&&(!n||i._id!==n._id);)r.unshift(i),i=i.parent;for(a=r.length,o=0;o<a;o++)e(r[o])}}rotate(e){return this.rotation(this.rotation()+e),this}moveToTop(){if(!this.parent)return Ze.warn("Node has no parent. moveToTop function is ignored."),!1;const e=this.index,n=this.parent.getChildren().length;return e<n-1?(this.parent.children.splice(e,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return Ze.warn("Node has no parent. moveUp function is ignored."),!1;const e=this.index,n=this.parent.getChildren().length;return e<n-1?(this.parent.children.splice(e,1),this.parent.children.splice(e+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return Ze.warn("Node has no parent. moveDown function is ignored."),!1;const e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return Ze.warn("Node has no parent. moveToBottom function is ignored."),!1;const e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(e){if(!this.parent)return Ze.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&Ze.warn("Unexpected value "+e+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");const n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(V1,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let e=this.opacity();const n=this.getParent();return n&&!n._isUnderCache&&(e*=n.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){let e=this.getAttrs(),n,r,i,a,o;const s={attrs:{},className:this.getClassName()};for(n in e)r=e[n],o=Ze.isObject(r)&&!Ze._isPlainObject(r)&&!Ze._isArray(r),!o&&(i=typeof this[n]=="function"&&this[n],delete e[n],a=i?i.call(this):null,e[n]=r,a!==r&&(s.attrs[n]=r));return Ze._prepareToStringify(s)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,n,r){const i=[];n&&this._isMatch(e)&&i.push(this);let a=this.parent;for(;a;){if(a===r)return i;a._isMatch(e)&&i.push(a),a=a.parent}return i}isAncestorOf(e){return!1}findAncestor(e,n,r){return this.findAncestors(e,n,r)[0]}_isMatch(e){if(!e)return!1;if(typeof e=="function")return e(this);let n=e.replace(/ /g,"").split(","),r=n.length,i,a;for(i=0;i<r;i++)if(a=n[i],Ze.isValidSelector(a)||(Ze.warn('Selector "'+a+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),Ze.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),Ze.warn("Konva is awesome, right?")),a.charAt(0)==="#"){if(this.id()===a.slice(1))return!0}else if(a.charAt(0)==="."){if(this.hasName(a.slice(1)))return!0}else if(this.className===a||this.nodeType===a)return!0;return!1}getLayer(){const e=this.getParent();return e?e.getLayer():null}getStage(){return this._getCache(z5,this._getStage)}_getStage(){const e=this.getParent();return e?e.getStage():null}fire(e,n={},r){return n.target=n.target||this,r?this._fireAndBubble(e,n):this._fire(e,n),this}getAbsoluteTransform(e){return e?this._getAbsoluteTransform(e):this._getCache(cc,this._getAbsoluteTransform)}_getAbsoluteTransform(e){let n;if(e)return n=new rl,this._eachAncestorReverse(function(r){const i=r.transformsEnabled();i==="all"?n.multiply(r.getTransform()):i==="position"&&n.translate(r.x()-r.offsetX(),r.y()-r.offsetY())},e),n;{n=this._cache.get(cc)||new rl,this.parent?this.parent.getAbsoluteTransform().copyInto(n):n.reset();const r=this.transformsEnabled();if(r==="all")n.multiply(this.getTransform());else if(r==="position"){const i=this.attrs.x||0,a=this.attrs.y||0,o=this.attrs.offsetX||0,s=this.attrs.offsetY||0;n.translate(i-o,a-s)}return n.dirty=!1,n}}getAbsoluteScale(e){let n=this;for(;n;)n._isUnderCache&&(e=n),n=n.getParent();const i=this.getAbsoluteTransform(e).decompose();return{x:i.scaleX,y:i.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(sf,this._getTransform)}_getTransform(){var e,n;const r=this._cache.get(sf)||new rl;r.reset();const i=this.x(),a=this.y(),o=Ot.getAngle(this.rotation()),s=(e=this.attrs.scaleX)!==null&&e!==void 0?e:1,u=(n=this.attrs.scaleY)!==null&&n!==void 0?n:1,h=this.attrs.skewX||0,f=this.attrs.skewY||0,g=this.attrs.offsetX||0,v=this.attrs.offsetY||0;return(i!==0||a!==0)&&r.translate(i,a),o!==0&&r.rotate(o),(h!==0||f!==0)&&r.skew(h,f),(s!==1||u!==1)&&r.scale(s,u),(g!==0||v!==0)&&r.translate(-1*g,-1*v),r.dirty=!1,r}clone(e){let n=Ze.cloneObject(this.attrs),r,i,a,o,s;for(r in e)n[r]=e[r];const u=new this.constructor(n);for(r in this.eventListeners)for(i=this.eventListeners[r],a=i.length,o=0;o<a;o++)s=i[o],s.name.indexOf(jE)<0&&(u.eventListeners[r]||(u.eventListeners[r]=[]),u.eventListeners[r].push(s));return u}_toKonvaCanvas(e){e=e||{};const n=this.getClientRect(),r=this.getStage(),i=e.x!==void 0?e.x:Math.floor(n.x),a=e.y!==void 0?e.y:Math.floor(n.y),o=e.pixelRatio||1,s=new uf({width:e.width||Math.ceil(n.width)||(r?r.width():0),height:e.height||Math.ceil(n.height)||(r?r.height():0),pixelRatio:o}),u=s.getContext(),h=new uf({width:s.width/s.pixelRatio+Math.abs(i),height:s.height/s.pixelRatio+Math.abs(a),pixelRatio:s.pixelRatio});return e.imageSmoothingEnabled===!1&&(u._context.imageSmoothingEnabled=!1),u.save(),(i||a)&&u.translate(-1*i,-1*a),this.drawScene(s,void 0,h),u.restore(),s}toCanvas(e){return this._toKonvaCanvas(e)._canvas}toDataURL(e){e=e||{};const n=e.mimeType||null,r=e.quality||null,i=this._toKonvaCanvas(e).toDataURL(n,r);return e.callback&&e.callback(i),i}toImage(e){return new Promise((n,r)=>{try{const i=e?.callback;i&&delete e.callback,Ze._urlToImage(this.toDataURL(e),function(a){n(a),i?.(a)})}catch(i){r(i)}})}toBlob(e){return new Promise((n,r)=>{try{const i=e?.callback;i&&delete e.callback,this.toCanvas(e).toBlob(a=>{n(a),i?.(a)},e?.mimeType,e?.quality)}catch(i){r(i)}})}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():Ot.dragDistance}_off(e,n,r){let i=this.eventListeners[e],a,o,s;for(a=0;a<i.length;a++)if(o=i[a].name,s=i[a].handler,(o!=="konva"||n==="konva")&&(!n||o===n)&&(!r||r===s)){if(i.splice(a,1),i.length===0){delete this.eventListeners[e];break}a--}}_fireChangeEvent(e,n,r){this._fire(e+ME,{oldVal:n,newVal:r})}addName(e){if(!this.hasName(e)){const n=this.name(),r=n?n+" "+e:e;this.name(r)}return this}hasName(e){if(!e)return!1;const n=this.name();return n?(n||"").split(/\s/g).indexOf(e)!==-1:!1}removeName(e){const n=(this.name()||"").split(/\s/g),r=n.indexOf(e);return r!==-1&&(n.splice(r,1),this.name(n.join(" "))),this}setAttr(e,n){const r=this[F5+Ze._capitalize(e)];return Ze._isFunction(r)?r.call(this,n):this._setAttr(e,n),this}_requestDraw(){if(Ot.autoDrawEnabled){const e=this.getLayer()||this.getStage();e?.batchDraw()}}_setAttr(e,n){const r=this.attrs[e];r===n&&!Ze.isObject(n)||(n==null?delete this.attrs[e]:this.attrs[e]=n,this._shouldFireChangeEvents&&this._fireChangeEvent(e,r,n),this._requestDraw())}_setComponentAttr(e,n,r){let i;r!==void 0&&(i=this.attrs[e],i||(this.attrs[e]=this.getAttr(e)),this.attrs[e][n]=r,this._fireChangeEvent(e,i,r))}_fireAndBubble(e,n,r){n&&this.nodeType===B5&&(n.target=this);const i=[DE,FE,BE,zE,qE,UE];if(!(i.indexOf(e)!==-1&&(r&&(this===r||this.isAncestorOf&&this.isAncestorOf(r))||this.nodeType==="Stage"&&!r))){this._fire(e,n);const o=i.indexOf(e)!==-1&&r&&r.isAncestorOf&&r.isAncestorOf(this)&&!r.isAncestorOf(this.parent);(n&&!n.cancelBubble||!n)&&this.parent&&this.parent.isListening()&&!o&&(r&&r.parent?this._fireAndBubble.call(this.parent,e,n,r):this._fireAndBubble.call(this.parent,e,n))}}_getProtoListeners(e){var n,r,i;const a=(n=this._cache.get(w1))!==null&&n!==void 0?n:{};let o=a?.[e];if(o===void 0){o=[];let s=Object.getPrototypeOf(this);for(;s;){const u=(i=(r=s.eventListeners)===null||r===void 0?void 0:r[e])!==null&&i!==void 0?i:[];o.push(...u),s=Object.getPrototypeOf(s)}a[e]=o,this._cache.set(w1,a)}return o}_fire(e,n){n=n||{},n.currentTarget=this,n.type=e;const r=this._getProtoListeners(e);if(r)for(let a=0;a<r.length;a++)r[a].handler.call(this,n);const i=this.eventListeners[e];if(i)for(let a=0;a<i.length;a++)i[a].handler.call(this,n)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(e){const n=e?e.pointerId:void 0,r=this.getStage(),i=this.getAbsolutePosition();if(!r)return;const a=r._getPointerById(n)||r._changedPointerPositions[0]||i;yr._dragElements.set(this._id,{node:this,startPointerPos:a,offset:{x:a.x-i.x,y:a.y-i.y},dragStatus:"ready",pointerId:n})}startDrag(e,n=!0){yr._dragElements.has(this._id)||this._createDragElement(e);const r=yr._dragElements.get(this._id);r.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:e&&e.evt},n)}_setDragPosition(e,n){const r=this.getStage()._getPointerById(n.pointerId);if(!r)return;let i={x:r.x-n.offset.x,y:r.y-n.offset.y};const a=this.dragBoundFunc();if(a!==void 0){const o=a.call(this,i,e);o?i=o:Ze.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==i.x||this._lastPos.y!==i.y)&&(this.setAbsolutePosition(i),this._requestDraw()),this._lastPos=i}stopDrag(e){const n=yr._dragElements.get(this._id);n&&(n.dragStatus="stopped"),yr._endDragBefore(e),yr._endDragAfter(e)}setDraggable(e){this._setAttr("draggable",e),this._dragChange()}isDragging(){const e=yr._dragElements.get(this._id);return e?e.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(e){if(!(!(e.evt.button!==void 0)||Ot.dragButtons.indexOf(e.evt.button)>=0)||this.isDragging())return;let i=!1;yr._dragElements.forEach(a=>{this.isAncestorOf(a.node)&&(i=!0)}),i||this._createDragElement(e)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const n=yr._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&yr._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-e.x,y:-e.y,width:n.width()+2*e.x,height:n.height()+2*e.y};return Ze.haveIntersection(r,this.getClientRect())}static create(e,n){return Ze._isString(e)&&(e=JSON.parse(e)),this._createNode(e,n)}static _createNode(e,n){let r=im.prototype.getClassName.call(e),i=e.children,a,o,s;n&&(e.attrs.container=n),Ot[r]||(Ze.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const u=Ot[r];if(a=new u(e.attrs),i)for(o=i.length,s=0;s<o;s++)a.add(im._createNode(i[s]));return a}};At.prototype.nodeType="Node";At.prototype._attrsAffectingSize=[];At.prototype.eventListeners={};At.prototype.on.call(At.prototype,$E,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(sf),this._clearSelfAndDescendantCache(cc)});At.prototype.on.call(At.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(rm)});At.prototype.on.call(At.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(nm)});At.prototype.on.call(At.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(V1)});const Xr=je.addGetterSetter;Xr(At,"zIndex");Xr(At,"absolutePosition");Xr(At,"position");Xr(At,"x",0,Et());Xr(At,"y",0,Et());Xr(At,"globalCompositeOperation","source-over",yh());Xr(At,"opacity",1,Et());Xr(At,"name","",yh());Xr(At,"id","",yh());Xr(At,"rotation",0,Et());je.addComponentsGetterSetter(At,"scale",["x","y"]);Xr(At,"scaleX",1,Et());Xr(At,"scaleY",1,Et());je.addComponentsGetterSetter(At,"skew",["x","y"]);Xr(At,"skewX",0,Et());Xr(At,"skewY",0,Et());je.addComponentsGetterSetter(At,"offset",["x","y"]);Xr(At,"offsetX",0,Et());Xr(At,"offsetY",0,Et());Xr(At,"dragDistance",void 0,Et());Xr(At,"width",0,Et());Xr(At,"height",0,Et());Xr(At,"listening",!0,au());Xr(At,"preventDefault",!0,au());Xr(At,"filters",void 0,function(t){return this._filterUpToDate=!1,t});Xr(At,"visible",!0,au());Xr(At,"transformsEnabled","all",yh());Xr(At,"size");Xr(At,"dragBoundFunc");Xr(At,"draggable",!1,au());je.backCompat(At,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});class al extends At{constructor(){super(...arguments),this.children=[]}getChildren(e){const n=this.children||[];return e?n.filter(e):n}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.destroy()}),this.children=[],this._requestDraw(),this}add(...e){if(e.length===0)return this;if(e.length>1){for(let r=0;r<e.length;r++)this.add(e[r]);return this}const n=e[0];return n.getParent()?(n.moveTo(this),this):(this._validateAdd(n),n.index=this.getChildren().length,n.parent=this,n._clearCaches(),this.getChildren().push(n),this._fire("add",{child:n}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(e){return this._generalFind(e,!1)}findOne(e){const n=this._generalFind(e,!0);return n.length>0?n[0]:void 0}_generalFind(e,n){const r=[];return this._descendants(i=>{const a=i._isMatch(e);return a&&r.push(i),!!(a&&n)}),r}_descendants(e){let n=!1;const r=this.getChildren();for(const i of r){if(n=e(i),n)return!0;if(i.hasChildren()&&(n=i._descendants(e),n))return!0}return!1}toObject(){const e=At.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach(n=>{e.children.push(n.toObject())}),e}isAncestorOf(e){let n=e.getParent();for(;n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(e){const n=At.prototype.clone.call(this,e);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(e){const n=[];return this.find("Shape").forEach(r=>{r.isVisible()&&r.intersects(e)&&n.push(r)}),n}_clearSelfAndDescendantCache(e){var n;super._clearSelfAndDescendantCache(e),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;(e=this.children)===null||e===void 0||e.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(e,n,r){const i=this.getLayer(),a=e||i&&i.getCanvas(),o=a&&a.getContext(),s=this._getCanvasCache(),u=s&&s.scene,h=a&&a.isCache;if(!this.isVisible()&&!h)return this;if(u){o.save();const f=this.getAbsoluteTransform(n).getMatrix();o.transform(f[0],f[1],f[2],f[3],f[4],f[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",a,n,r);return this}drawHit(e,n){if(!this.shouldDrawHit(n))return this;const r=this.getLayer(),i=e||r&&r.hitCanvas,a=i&&i.getContext(),o=this._getCanvasCache();if(o&&o.hit){a.save();const u=this.getAbsoluteTransform(n).getMatrix();a.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedHitCanvas(a),a.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(e,n,r,i){var a;const o=n&&n.getContext(),s=this.clipWidth(),u=this.clipHeight(),h=this.clipFunc(),f=typeof s=="number"&&typeof u=="number"||h,g=r===this;if(f){o.save();const p=this.getAbsoluteTransform(r);let y=p.getMatrix();o.transform(y[0],y[1],y[2],y[3],y[4],y[5]),o.beginPath();let _;if(h)_=h.call(this,o,this);else{const x=this.clipX(),b=this.clipY();o.rect(x||0,b||0,s,u)}o.clip.apply(o,_),y=p.copy().invert().getMatrix(),o.transform(y[0],y[1],y[2],y[3],y[4],y[5])}const v=!g&&this.globalCompositeOperation()!=="source-over"&&e==="drawScene";v&&(o.save(),o._applyGlobalCompositeOperation(this)),(a=this.children)===null||a===void 0||a.forEach(function(p){p[e](n,r,i)}),v&&o.restore(),f&&o.restore()}getClientRect(e={}){var n;const r=e.skipTransform,i=e.relativeTo;let a,o,s,u,h={x:1/0,y:1/0,width:0,height:0};const f=this;(n=this.children)===null||n===void 0||n.forEach(function(p){if(!p.visible())return;const y=p.getClientRect({relativeTo:f,skipShadow:e.skipShadow,skipStroke:e.skipStroke});y.width===0&&y.height===0||(a===void 0?(a=y.x,o=y.y,s=y.x+y.width,u=y.y+y.height):(a=Math.min(a,y.x),o=Math.min(o,y.y),s=Math.max(s,y.x+y.width),u=Math.max(u,y.y+y.height)))});const g=this.find("Shape");let v=!1;for(let p=0;p<g.length;p++)if(g[p]._isVisible(this)){v=!0;break}return v&&a!==void 0?h={x:a,y:o,width:s-a,height:u-o}:h={x:0,y:0,width:0,height:0},r?h:this._transformedRect(h,i)}}je.addComponentsGetterSetter(al,"clip",["x","y","width","height"]);je.addGetterSetter(al,"clipX",void 0,Et());je.addGetterSetter(al,"clipY",void 0,Et());je.addGetterSetter(al,"clipWidth",void 0,Et());je.addGetterSetter(al,"clipHeight",void 0,Et());je.addGetterSetter(al,"clipFunc");const mp=new Map,J6=Ot._global.PointerEvent!==void 0;function Ug(t){return mp.get(t)}function Km(t){return{evt:t,pointerId:t.pointerId}}function e8(t,e){return mp.get(t)===e}function t8(t,e){np(t),e.getStage()&&(mp.set(t,e),J6&&e._fire("gotpointercapture",Km(new PointerEvent("gotpointercapture"))))}function np(t,e){const n=mp.get(t);if(!n)return;const r=n.getStage();r&&r.content,mp.delete(t),J6&&n._fire("lostpointercapture",Km(new PointerEvent("lostpointercapture")))}const WE="Stage",VE="string",q5="px",YE="mouseout",n8="mouseleave",r8="mouseover",i8="mouseenter",a8="mousemove",o8="mousedown",s8="mouseup",Wd="pointermove",Vd="pointerdown",rd="pointerup",Yd="pointercancel",XE="lostpointercapture",_1="pointerout",Xd="pointerleave",x1="pointerover",S1="pointerenter",am="contextmenu",l8="touchstart",u8="touchend",c8="touchmove",f8="touchcancel",om="wheel",KE=5,ZE=[[i8,"_pointerenter"],[o8,"_pointerdown"],[a8,"_pointermove"],[s8,"_pointerup"],[n8,"_pointerleave"],[l8,"_pointerdown"],[c8,"_pointermove"],[u8,"_pointerup"],[f8,"_pointercancel"],[r8,"_pointerover"],[om,"_wheel"],[am,"_contextmenu"],[Vd,"_pointerdown"],[Wd,"_pointermove"],[rd,"_pointerup"],[Yd,"_pointercancel"],[Xd,"_pointerleave"],[XE,"_lostpointercapture"]],Hg={mouse:{[_1]:YE,[Xd]:n8,[x1]:r8,[S1]:i8,[Wd]:a8,[Vd]:o8,[rd]:s8,[Yd]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[_1]:"touchout",[Xd]:"touchleave",[x1]:"touchover",[S1]:"touchenter",[Wd]:c8,[Vd]:l8,[rd]:u8,[Yd]:f8,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[_1]:_1,[Xd]:Xd,[x1]:x1,[S1]:S1,[Wd]:Wd,[Vd]:Vd,[rd]:rd,[Yd]:Yd,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},Kd=t=>t.indexOf("pointer")>=0?"pointer":t.indexOf("touch")>=0?"touch":"mouse",Gh=t=>{const e=Kd(t);if(e==="pointer")return Ot.pointerEventsEnabled&&Hg.pointer;if(e==="touch")return Hg.touch;if(e==="mouse")return Hg.mouse};function U5(t={}){return(t.clipFunc||t.clipWidth||t.clipHeight)&&Ze.warn("Stage does not support clipping. Please use clip for Layers or Groups."),t}const QE="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);",rp=[];let q0=class extends al{constructor(e){super(U5(e)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),rp.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{U5(this.attrs)}),this._checkVisibility()}_validateAdd(e){const n=e.getType()==="Layer",r=e.getType()==="FastLayer";n||r||Ze.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const e=this.visible()?"":"none";this.content.style.display=e}setContainer(e){if(typeof e===VE){let n;if(e.charAt(0)==="."){const r=e.slice(1);e=document.getElementsByClassName(r)[0]}else e.charAt(0)!=="#"?n=e:n=e.slice(1),e=document.getElementById(n);if(!e)throw"Can not find container in document with id "+n}return this._setAttr("container",e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const e=this.children,n=e.length;for(let r=0;r<n;r++)e[r].clear();return this}clone(e){return e||(e={}),e.container=typeof document<"u"&&document.createElement("div"),al.prototype.clone.call(this,e)}destroy(){super.destroy();const e=this.content;e&&Ze._isInDocument(e)&&this.container().removeChild(e);const n=rp.indexOf(this);return n>-1&&rp.splice(n,1),Ze.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:(Ze.warn(QE),null)}_getPointerById(e){return this._pointerPositions.find(n=>n.id===e)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(e){e={...e},e.x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();const n=new uf({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),r=n.getContext()._context,i=this.children;return(e.x||e.y)&&r.translate(-1*e.x,-1*e.y),i.forEach(function(a){if(!a.isVisible())return;const o=a._toKonvaCanvas(e);r.drawImage(o._canvas,e.x,e.y,o.getWidth()/o.getPixelRatio(),o.getHeight()/o.getPixelRatio())}),n}getIntersection(e){if(!e)return null;const n=this.children,r=n.length,i=r-1;for(let a=i;a>=0;a--){const o=n[a].getIntersection(e);if(o)return o}return null}_resizeDOM(){const e=this.width(),n=this.height();this.content&&(this.content.style.width=e+q5,this.content.style.height=n+q5),this.bufferCanvas.setSize(e,n),this.bufferHitCanvas.setSize(e,n),this.children.forEach(r=>{r.setSize({width:e,height:n}),r.draw()})}add(e,...n){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.add(arguments[i]);return this}super.add(e);const r=this.children.length;return r>KE&&Ze.warn("The stage has "+r+" 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."),e.setSize({width:this.width(),height:this.height()}),e.draw(),Ot.isBrowser&&this.content.appendChild(e.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(e){return e8(e,this)}setPointerCapture(e){t8(e,this)}releaseCapture(e){np(e)}getLayers(){return this.children}_bindContentEvents(){Ot.isBrowser&&ZE.forEach(([e,n])=>{this.content.addEventListener(e,r=>{this[n](r)},{passive:!1})})}_pointerenter(e){this.setPointersPositions(e);const n=Gh(e.type);n&&this._fire(n.pointerenter,{evt:e,target:this,currentTarget:this})}_pointerover(e){this.setPointersPositions(e);const n=Gh(e.type);n&&this._fire(n.pointerover,{evt:e,target:this,currentTarget:this})}_getTargetShape(e){let n=this[e+"targetShape"];return n&&!n.getStage()&&(n=null),n}_pointerleave(e){const n=Gh(e.type),r=Kd(e.type);if(!n)return;this.setPointersPositions(e);const i=this._getTargetShape(r),a=!(Ot.isDragging()||Ot.isTransforming())||Ot.hitOnDragEnabled;i&&a?(i._fireAndBubble(n.pointerout,{evt:e}),i._fireAndBubble(n.pointerleave,{evt:e}),this._fire(n.pointerleave,{evt:e,target:this,currentTarget:this}),this[r+"targetShape"]=null):a&&(this._fire(n.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(n.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(e){const n=Gh(e.type),r=Kd(e.type);if(!n)return;this.setPointersPositions(e);let i=!1;this._changedPointerPositions.forEach(a=>{const o=this.getIntersection(a);if(yr.justDragged=!1,Ot["_"+r+"ListenClick"]=!0,!o||!o.isListening()){this[r+"ClickStartShape"]=void 0;return}Ot.capturePointerEventsEnabled&&o.setPointerCapture(a.id),this[r+"ClickStartShape"]=o,o._fireAndBubble(n.pointerdown,{evt:e,pointerId:a.id}),i=!0;const s=e.type.indexOf("touch")>=0;o.preventDefault()&&e.cancelable&&s&&e.preventDefault()}),i||this._fire(n.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(e){const n=Gh(e.type),r=Kd(e.type);if(!n)return;const i=e.type.indexOf("touch")>=0||e.pointerType==="touch";if(Ot.isDragging()&&yr.node.preventDefault()&&e.cancelable&&i&&e.preventDefault(),this.setPointersPositions(e),!(!(Ot.isDragging()||Ot.isTransforming())||Ot.hitOnDragEnabled))return;const o={};let s=!1;const u=this._getTargetShape(r);this._changedPointerPositions.forEach(h=>{const f=Ug(h.id)||this.getIntersection(h),g=h.id,v={evt:e,pointerId:g},p=u!==f;if(p&&u&&(u._fireAndBubble(n.pointerout,{...v},f),u._fireAndBubble(n.pointerleave,{...v},f)),f){if(o[f._id])return;o[f._id]=!0}f&&f.isListening()?(s=!0,p&&(f._fireAndBubble(n.pointerover,{...v},u),f._fireAndBubble(n.pointerenter,{...v},u),this[r+"targetShape"]=f),f._fireAndBubble(n.pointermove,{...v})):u&&(this._fire(n.pointerover,{evt:e,target:this,currentTarget:this,pointerId:g}),this[r+"targetShape"]=null)}),s||this._fire(n.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(e){const n=Gh(e.type),r=Kd(e.type);if(!n)return;this.setPointersPositions(e);const i=this[r+"ClickStartShape"],a=this[r+"ClickEndShape"],o={};let s=!1;this._changedPointerPositions.forEach(u=>{const h=Ug(u.id)||this.getIntersection(u);if(h){if(h.releaseCapture(u.id),o[h._id])return;o[h._id]=!0}const f=u.id,g={evt:e,pointerId:f};let v=!1;Ot["_"+r+"InDblClickWindow"]?(v=!0,clearTimeout(this[r+"DblTimeout"])):yr.justDragged||(Ot["_"+r+"InDblClickWindow"]=!0,clearTimeout(this[r+"DblTimeout"])),this[r+"DblTimeout"]=setTimeout(function(){Ot["_"+r+"InDblClickWindow"]=!1},Ot.dblClickWindow),h&&h.isListening()?(s=!0,this[r+"ClickEndShape"]=h,h._fireAndBubble(n.pointerup,{...g}),Ot["_"+r+"ListenClick"]&&i&&i===h&&(h._fireAndBubble(n.pointerclick,{...g}),v&&a&&a===h&&h._fireAndBubble(n.pointerdblclick,{...g}))):(this[r+"ClickEndShape"]=null,s||(this._fire(n.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),s=!0),Ot["_"+r+"ListenClick"]&&this._fire(n.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:f}),v&&this._fire(n.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:f}))}),s||this._fire(n.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),Ot["_"+r+"ListenClick"]=!1,e.cancelable&&r!=="touch"&&r!=="pointer"&&e.preventDefault()}_contextmenu(e){this.setPointersPositions(e);const n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(am,{evt:e}):this._fire(am,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);const n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(om,{evt:e}):this._fire(om,{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);const n=Ug(e.pointerId)||this.getIntersection(this.getPointerPosition());n&&n._fireAndBubble(rd,Km(e)),np(e.pointerId)}_lostpointercapture(e){np(e.pointerId)}setPointersPositions(e){const n=this._getContentPosition();let r=null,i=null;e=e||window.event,e.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,a=>{this._pointerPositions.push({id:a.identifier,x:(a.clientX-n.left)/n.scaleX,y:(a.clientY-n.top)/n.scaleY})}),Array.prototype.forEach.call(e.changedTouches||e.touches,a=>{this._changedPointerPositions.push({id:a.identifier,x:(a.clientX-n.left)/n.scaleX,y:(a.clientY-n.top)/n.scaleY})})):(r=(e.clientX-n.left)/n.scaleX,i=(e.clientY-n.top)/n.scaleY,this.pointerPos={x:r,y:i},this._pointerPositions=[{x:r,y:i,id:Ze._getFirstPointerId(e)}],this._changedPointerPositions=[{x:r,y:i,id:Ze._getFirstPointerId(e)}])}_setPointerPosition(e){Ze.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(e)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const e=this.content.getBoundingClientRect();return{top:e.top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new uf({width:this.width(),height:this.height()}),this.bufferHitCanvas=new Ym({pixelRatio:1,width:this.width(),height:this.height()}),!Ot.isBrowser)return;const e=this.container();if(!e)throw"Stage has no container. A container is required.";e.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"),e.appendChild(this.content),this._resizeDOM()}cache(){return Ze.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(e){e.batchDraw()}),this}};q0.prototype.nodeType=WE;Fi(q0);je.addGetterSetter(q0,"container");Ot.isBrowser&&document.addEventListener("visibilitychange",()=>{rp.forEach(t=>{t.batchDraw()})});const h8="hasShadow",d8="shadowRGBA",p8="patternImage",g8="linearGradient",v8="radialGradient";let E1;function $g(){return E1||(E1=Ze.createCanvasElement().getContext("2d"),E1)}const ip={};function JE(t){const e=this.attrs.fillRule;e?t.fill(e):t.fill()}function ek(t){t.stroke()}function tk(t){const e=this.attrs.fillRule;e?t.fill(e):t.fill()}function nk(t){t.stroke()}function rk(){this._clearCache(h8)}function ik(){this._clearCache(d8)}function ak(){this._clearCache(p8)}function ok(){this._clearCache(g8)}function sk(){this._clearCache(v8)}let mt=class extends At{constructor(e){super(e);let n;for(;n=Ze.getRandomColor(),!(n&&!(n in ip)););this.colorKey=n,ip[n]=this}getContext(){return Ze.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return Ze.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(h8,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(p8,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const n=$g().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(n&&n.setTransform){const r=new rl;r.translate(this.fillPatternX(),this.fillPatternY()),r.rotate(Ot.getAngle(this.fillPatternRotation())),r.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),r.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const i=r.getMatrix(),a=typeof DOMMatrix>"u"?{a:i[0],b:i[1],c:i[2],d:i[3],e:i[4],f:i[5]}:new DOMMatrix(i);n.setTransform(a)}return n}}_getLinearGradient(){return this._getCache(g8,this.__getLinearGradient)}__getLinearGradient(){const e=this.fillLinearGradientColorStops();if(e){const n=$g(),r=this.fillLinearGradientStartPoint(),i=this.fillLinearGradientEndPoint(),a=n.createLinearGradient(r.x,r.y,i.x,i.y);for(let o=0;o<e.length;o+=2)a.addColorStop(e[o],e[o+1]);return a}}_getRadialGradient(){return this._getCache(v8,this.__getRadialGradient)}__getRadialGradient(){const e=this.fillRadialGradientColorStops();if(e){const n=$g(),r=this.fillRadialGradientStartPoint(),i=this.fillRadialGradientEndPoint(),a=n.createRadialGradient(r.x,r.y,this.fillRadialGradientStartRadius(),i.x,i.y,this.fillRadialGradientEndRadius());for(let o=0;o<e.length;o+=2)a.addColorStop(e[o],e[o+1]);return a}}getShadowRGBA(){return this._getCache(d8,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const e=Ze.colorToRGBA(this.shadowColor());if(e)return"rgba("+e.r+","+e.g+","+e.b+","+e.a*(this.shadowOpacity()||1)+")"}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const e=this.hitStrokeWidth();return e==="auto"?this.hasStroke():this.strokeEnabled()&&!!e}intersects(e){const n=this.getStage();if(!n)return!1;const r=n.bufferHitCanvas;return r.getContext().clear(),this.drawHit(r,void 0,!0),r.context.getImageData(Math.round(e.x),Math.round(e.y),1,1).data[3]>0}destroy(){return At.prototype.destroy.call(this),delete ip[this.colorKey],delete this.colorKey,this}_useBufferCanvas(e){var n;if(!((n=this.attrs.perfectDrawEnabled)!==null&&n!==void 0?n:!0))return!1;const i=e||this.hasFill(),a=this.hasStroke(),o=this.getAbsoluteOpacity()!==1;if(i&&a&&o)return!0;const s=this.hasShadow(),u=this.shadowForStrokeEnabled();return!!(i&&a&&s&&u)}setStrokeHitEnabled(e){Ze.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),e?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const e=this.size();return{x:this._centroid?-e.width/2:0,y:this._centroid?-e.height/2:0,width:e.width,height:e.height}}getClientRect(e={}){let n=!1,r=this.getParent();for(;r;){if(r.isCached()){n=!0;break}r=r.getParent()}const i=e.skipTransform,a=e.relativeTo||n&&this.getStage()||void 0,o=this.getSelfRect(),u=!e.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,h=o.width+u,f=o.height+u,g=!e.skipShadow&&this.hasShadow(),v=g?this.shadowOffsetX():0,p=g?this.shadowOffsetY():0,y=h+Math.abs(v),_=f+Math.abs(p),x=g&&this.shadowBlur()||0,b=y+x*2,E=_+x*2,A={width:b,height:E,x:-(u/2+x)+Math.min(v,0)+o.x,y:-(u/2+x)+Math.min(p,0)+o.y};return i?A:this._transformedRect(A,a)}drawScene(e,n,r){const i=this.getLayer(),a=e||i.getCanvas(),o=a.getContext(),s=this._getCanvasCache(),u=this.getSceneFunc(),h=this.hasShadow();let f;const g=n===this;if(!this.isVisible()&&!g)return this;if(s){o.save();const v=this.getAbsoluteTransform(n).getMatrix();return o.transform(v[0],v[1],v[2],v[3],v[4],v[5]),this._drawCachedSceneCanvas(o),o.restore(),this}if(!u)return this;if(o.save(),this._useBufferCanvas()){f=this.getStage();const v=r||f.bufferCanvas,p=v.getContext();p.clear(),p.save(),p._applyLineJoin(this),p._applyMiterLimit(this);const y=this.getAbsoluteTransform(n).getMatrix();p.transform(y[0],y[1],y[2],y[3],y[4],y[5]),u.call(this,p,this),p.restore();const _=v.pixelRatio;h&&o._applyShadow(this),o._applyOpacity(this),o._applyGlobalCompositeOperation(this),o.drawImage(v._canvas,v.x||0,v.y||0,v.width/_,v.height/_)}else{if(o._applyLineJoin(this),o._applyMiterLimit(this),!g){const v=this.getAbsoluteTransform(n).getMatrix();o.transform(v[0],v[1],v[2],v[3],v[4],v[5]),o._applyOpacity(this),o._applyGlobalCompositeOperation(this)}h&&o._applyShadow(this),u.call(this,o,this)}return o.restore(),this}drawHit(e,n,r=!1){if(!this.shouldDrawHit(n,r))return this;const i=this.getLayer(),a=e||i.hitCanvas,o=a&&a.getContext(),s=this.hitFunc()||this.sceneFunc(),u=this._getCanvasCache(),h=u&&u.hit;if(this.colorKey||Ze.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),h){o.save();const g=this.getAbsoluteTransform(n).getMatrix();return o.transform(g[0],g[1],g[2],g[3],g[4],g[5]),this._drawCachedHitCanvas(o),o.restore(),this}if(!s)return this;if(o.save(),o._applyLineJoin(this),o._applyMiterLimit(this),!(this===n)){const g=this.getAbsoluteTransform(n).getMatrix();o.transform(g[0],g[1],g[2],g[3],g[4],g[5])}return s.call(this,o,this),o.restore(),this}drawHitFromCache(e=0){const n=this._getCanvasCache(),r=this._getCachedSceneCanvas(),i=n.hit,a=i.getContext(),o=i.getWidth(),s=i.getHeight();a.clear(),a.drawImage(r._canvas,0,0,o,s);try{const u=a.getImageData(0,0,o,s),h=u.data,f=h.length,g=Ze._hexToRgb(this.colorKey);for(let v=0;v<f;v+=4)h[v+3]>e?(h[v]=g.r,h[v+1]=g.g,h[v+2]=g.b,h[v+3]=255):h[v+3]=0;a.putImageData(u,0,0)}catch(u){Ze.error("Unable to draw hit graph from cached scene canvas. "+u.message)}return this}hasPointerCapture(e){return e8(e,this)}setPointerCapture(e){t8(e,this)}releaseCapture(e){np(e)}};mt.prototype._fillFunc=JE;mt.prototype._strokeFunc=ek;mt.prototype._fillFuncHit=tk;mt.prototype._strokeFuncHit=nk;mt.prototype._centroid=!1;mt.prototype.nodeType="Shape";Fi(mt);mt.prototype.eventListeners={};mt.prototype.on.call(mt.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",rk);mt.prototype.on.call(mt.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",ik);mt.prototype.on.call(mt.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",ak);mt.prototype.on.call(mt.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",ok);mt.prototype.on.call(mt.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",sk);je.addGetterSetter(mt,"stroke",void 0,Q6());je.addGetterSetter(mt,"strokeWidth",2,Et());je.addGetterSetter(mt,"fillAfterStrokeEnabled",!1);je.addGetterSetter(mt,"hitStrokeWidth","auto",Xm());je.addGetterSetter(mt,"strokeHitEnabled",!0,au());je.addGetterSetter(mt,"perfectDrawEnabled",!0,au());je.addGetterSetter(mt,"shadowForStrokeEnabled",!0,au());je.addGetterSetter(mt,"lineJoin");je.addGetterSetter(mt,"lineCap");je.addGetterSetter(mt,"miterLimit");je.addGetterSetter(mt,"sceneFunc");je.addGetterSetter(mt,"hitFunc");je.addGetterSetter(mt,"dash");je.addGetterSetter(mt,"dashOffset",0,Et());je.addGetterSetter(mt,"shadowColor",void 0,yh());je.addGetterSetter(mt,"shadowBlur",0,Et());je.addGetterSetter(mt,"shadowOpacity",1,Et());je.addComponentsGetterSetter(mt,"shadowOffset",["x","y"]);je.addGetterSetter(mt,"shadowOffsetX",0,Et());je.addGetterSetter(mt,"shadowOffsetY",0,Et());je.addGetterSetter(mt,"fillPatternImage");je.addGetterSetter(mt,"fill",void 0,Q6());je.addGetterSetter(mt,"fillPatternX",0,Et());je.addGetterSetter(mt,"fillPatternY",0,Et());je.addGetterSetter(mt,"fillLinearGradientColorStops");je.addGetterSetter(mt,"strokeLinearGradientColorStops");je.addGetterSetter(mt,"fillRadialGradientStartRadius",0);je.addGetterSetter(mt,"fillRadialGradientEndRadius",0);je.addGetterSetter(mt,"fillRadialGradientColorStops");je.addGetterSetter(mt,"fillPatternRepeat","repeat");je.addGetterSetter(mt,"fillEnabled",!0);je.addGetterSetter(mt,"strokeEnabled",!0);je.addGetterSetter(mt,"shadowEnabled",!0);je.addGetterSetter(mt,"dashEnabled",!0);je.addGetterSetter(mt,"strokeScaleEnabled",!0);je.addGetterSetter(mt,"fillPriority","color");je.addComponentsGetterSetter(mt,"fillPatternOffset",["x","y"]);je.addGetterSetter(mt,"fillPatternOffsetX",0,Et());je.addGetterSetter(mt,"fillPatternOffsetY",0,Et());je.addComponentsGetterSetter(mt,"fillPatternScale",["x","y"]);je.addGetterSetter(mt,"fillPatternScaleX",1,Et());je.addGetterSetter(mt,"fillPatternScaleY",1,Et());je.addComponentsGetterSetter(mt,"fillLinearGradientStartPoint",["x","y"]);je.addComponentsGetterSetter(mt,"strokeLinearGradientStartPoint",["x","y"]);je.addGetterSetter(mt,"fillLinearGradientStartPointX",0);je.addGetterSetter(mt,"strokeLinearGradientStartPointX",0);je.addGetterSetter(mt,"fillLinearGradientStartPointY",0);je.addGetterSetter(mt,"strokeLinearGradientStartPointY",0);je.addComponentsGetterSetter(mt,"fillLinearGradientEndPoint",["x","y"]);je.addComponentsGetterSetter(mt,"strokeLinearGradientEndPoint",["x","y"]);je.addGetterSetter(mt,"fillLinearGradientEndPointX",0);je.addGetterSetter(mt,"strokeLinearGradientEndPointX",0);je.addGetterSetter(mt,"fillLinearGradientEndPointY",0);je.addGetterSetter(mt,"strokeLinearGradientEndPointY",0);je.addComponentsGetterSetter(mt,"fillRadialGradientStartPoint",["x","y"]);je.addGetterSetter(mt,"fillRadialGradientStartPointX",0);je.addGetterSetter(mt,"fillRadialGradientStartPointY",0);je.addComponentsGetterSetter(mt,"fillRadialGradientEndPoint",["x","y"]);je.addGetterSetter(mt,"fillRadialGradientEndPointX",0);je.addGetterSetter(mt,"fillRadialGradientEndPointY",0);je.addGetterSetter(mt,"fillPatternRotation",0);je.addGetterSetter(mt,"fillRule",void 0,yh());je.backCompat(mt,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});const lk="#",uk="beforeDraw",ck="draw",m8=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],fk=m8.length;let bh=class extends al{constructor(e){super(e),this.canvas=new uf,this.hitCanvas=new Ym({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);const n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),e<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[e+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){At.prototype.moveToTop.call(this);const e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!At.prototype.moveUp.call(this))return!1;const n=this.getStage();return!n||!n.content?!1:(n.content.removeChild(this.getNativeCanvasElement()),this.index<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[this.index+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(At.prototype.moveDown.call(this)){const e=this.getStage();if(e){const n=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),n[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(At.prototype.moveToBottom.call(this)){const e=this.getStage();if(e){const n=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),n[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const e=this.getNativeCanvasElement();return At.prototype.remove.call(this),e&&e.parentNode&&Ze._isInDocument(e)&&e.parentNode.removeChild(e),this}getStage(){return this.parent}setSize({width:e,height:n}){return this.canvas.setSize(e,n),this.hitCanvas.setSize(e,n),this._setSmoothEnabled(),this}_validateAdd(e){const n=e.getType();n!=="Group"&&n!=="Shape"&&Ze.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(e){return e={...e},e.width=e.width||this.getWidth(),e.height=e.height||this.getHeight(),e.x=e.x!==void 0?e.x:this.x(),e.y=e.y!==void 0?e.y:this.y(),At.prototype._toKonvaCanvas.call(this,e)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){Ze.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){Ze.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,Ze.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;let n=1,r=!1;for(;;){for(let i=0;i<fk;i++){const a=m8[i],o=this._getIntersection({x:e.x+a.x*n,y:e.y+a.y*n}),s=o.shape;if(s)return s;if(r=!!o.antialiased,!o.antialiased)break}if(r)n+=1;else return null}}_getIntersection(e){const n=this.hitCanvas.pixelRatio,r=this.hitCanvas.context.getImageData(Math.round(e.x*n),Math.round(e.y*n),1,1).data,i=r[3];if(i===255){const a=Ze._rgbToHex(r[0],r[1],r[2]),o=ip[lk+a];return o?{shape:o}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(e,n,r){const i=this.getLayer(),a=e||i&&i.getCanvas();return this._fire(uk,{node:this}),this.clearBeforeDraw()&&a.getContext().clear(),al.prototype.drawScene.call(this,a,n,r),this._fire(ck,{node:this}),this}drawHit(e,n){const r=this.getLayer(),i=e||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),al.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){Ze.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return Ze.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const e=this.parent;!!this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}destroy(){return Ze.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};bh.prototype.nodeType="Layer";Fi(bh);je.addGetterSetter(bh,"imageSmoothingEnabled",!0);je.addGetterSetter(bh,"clearBeforeDraw",!0);je.addGetterSetter(bh,"hitGraphEnabled",!0,au());class Zm extends bh{constructor(e){super(e),this.listening(!1),Ze.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}Zm.prototype.nodeType="FastLayer";Fi(Zm);let pd=class extends al{_validateAdd(e){const n=e.getType();n!=="Group"&&n!=="Shape"&&Ze.throw("You may only add groups and shapes to groups.")}};pd.prototype.nodeType="Group";Fi(pd);const Gg=(function(){return Qf.performance&&Qf.performance.now?function(){return Qf.performance.now()}:function(){return new Date().getTime()}})();let _d=class Zh{constructor(e,n){this.id=Zh.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:Gg(),frameRate:0},this.func=e,this.setLayers(n)}setLayers(e){let n=[];return e&&(n=Array.isArray(e)?e:[e]),this.layers=n,this}getLayers(){return this.layers}addLayer(e){const n=this.layers,r=n.length;for(let i=0;i<r;i++)if(n[i]._id===e._id)return!1;return this.layers.push(e),!0}isRunning(){const n=Zh.animations,r=n.length;for(let i=0;i<r;i++)if(n[i].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=Gg(),Zh._addAnimation(this),this}stop(){return Zh._removeAnimation(this),this}_updateFrameObject(e){this.frame.timeDiff=e-this.frame.lastTime,this.frame.lastTime=e,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(e){this.animations.push(e),this._handleAnimation()}static _removeAnimation(e){const n=e.id,r=this.animations,i=r.length;for(let a=0;a<i;a++)if(r[a].id===n){this.animations.splice(a,1);break}}static _runFrames(){const e={},n=this.animations;for(let r=0;r<n.length;r++){const i=n[r],a=i.layers,o=i.func;i._updateFrameObject(Gg());const s=a.length;let u;if(o?u=o.call(i,i.frame)!==!1:u=!0,!!u)for(let h=0;h<s;h++){const f=a[h];f._id!==void 0&&(e[f._id]=f)}}for(const r in e)e.hasOwnProperty(r)&&e[r].batchDraw()}static _animationLoop(){const e=Zh;e.animations.length?(e._runFrames(),Ze.requestAnimFrame(e._animationLoop)):e.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,Ze.requestAnimFrame(this._animationLoop))}};_d.animations=[];_d.animIdCounter=0;_d.animRunning=!1;const hk={node:1,duration:1,easing:1,onFinish:1,yoyo:1},dk=1,H5=2,$5=3,G5=["fill","stroke","shadowColor"];let pk=0;class gk{constructor(e,n,r,i,a,o,s){this.prop=e,this.propFunc=n,this.begin=i,this._pos=i,this.duration=o,this._change=0,this.prevPos=0,this.yoyo=s,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=r,this._change=a-this.begin,this.pause()}fire(e){const n=this[e];n&&n()}setTime(e){e>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}getTime(){return this._time}setPosition(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}getPosition(e){return e===void 0&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}play(){this.state=H5,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=$5,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(e){this.pause(),this._time=e,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 e=this.getTimer()-this._startTime;this.state===H5?this.setTime(e):this.state===$5&&this.setTime(this.duration-e)}pause(){this.state=dk,this.fire("onPause")}getTimer(){return new Date().getTime()}}class ni{constructor(e){const n=this,r=e.node,i=r._id,a=e.easing||ap.Linear,o=!!e.yoyo;let s,u;typeof e.duration>"u"?s=.3:e.duration===0?s=.001:s=e.duration,this.node=r,this._id=pk++;const h=r.getLayer()||(r instanceof Ot.Stage?r.getLayers():null);h||Ze.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new _d(function(){n.tween.onEnterFrame()},h),this.tween=new gk(u,function(f){n._tweenFunc(f)},a,0,1,s*1e3,o),this._addListeners(),ni.attrs[i]||(ni.attrs[i]={}),ni.attrs[i][this._id]||(ni.attrs[i][this._id]={}),ni.tweens[i]||(ni.tweens[i]={});for(u in e)hk[u]===void 0&&this._addAttr(u,e[u]);this.reset(),this.onFinish=e.onFinish,this.onReset=e.onReset,this.onUpdate=e.onUpdate}_addAttr(e,n){const r=this.node,i=r._id;let a,o,s,u,h;const f=ni.tweens[i][e];f&&delete ni.attrs[i][f][e];let g=r.getAttr(e);if(Ze._isArray(n))if(a=[],o=Math.max(n.length,g.length),e==="points"&&n.length!==g.length&&(n.length>g.length?(u=g,g=Ze._prepareArrayForTween(g,n,r.closed())):(s=n,n=Ze._prepareArrayForTween(n,g,r.closed()))),e.indexOf("fill")===0)for(let v=0;v<o;v++)if(v%2===0)a.push(n[v]-g[v]);else{const p=Ze.colorToRGBA(g[v]);h=Ze.colorToRGBA(n[v]),g[v]=p,a.push({r:h.r-p.r,g:h.g-p.g,b:h.b-p.b,a:h.a-p.a})}else for(let v=0;v<o;v++)a.push(n[v]-g[v]);else G5.indexOf(e)!==-1?(g=Ze.colorToRGBA(g),h=Ze.colorToRGBA(n),a={r:h.r-g.r,g:h.g-g.g,b:h.b-g.b,a:h.a-g.a}):a=n-g;ni.attrs[i][this._id][e]={start:g,diff:a,end:n,trueEnd:s,trueStart:u},ni.tweens[i][e]=this._id}_tweenFunc(e){const n=this.node,r=ni.attrs[n._id][this._id];let i,a,o,s,u,h,f,g;for(i in r){if(a=r[i],o=a.start,s=a.diff,g=a.end,Ze._isArray(o))if(u=[],f=Math.max(o.length,g.length),i.indexOf("fill")===0)for(h=0;h<f;h++)h%2===0?u.push((o[h]||0)+s[h]*e):u.push("rgba("+Math.round(o[h].r+s[h].r*e)+","+Math.round(o[h].g+s[h].g*e)+","+Math.round(o[h].b+s[h].b*e)+","+(o[h].a+s[h].a*e)+")");else for(h=0;h<f;h++)u.push((o[h]||0)+s[h]*e);else G5.indexOf(i)!==-1?u="rgba("+Math.round(o.r+s.r*e)+","+Math.round(o.g+s.g*e)+","+Math.round(o.b+s.b*e)+","+(o.a+s.a*e)+")":u=o+s*e;n.setAttr(i,u)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const e=this.node,n=ni.attrs[e._id][this._id];n.points&&n.points.trueEnd&&e.setAttr("points",n.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const e=this.node,n=ni.attrs[e._id][this._id];n.points&&n.points.trueStart&&e.points(n.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(e){return this.tween.seek(e*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const e=this.node._id,n=this._id,r=ni.tweens[e];this.pause(),this.anim&&this.anim.stop();for(const i in r)delete ni.tweens[e][i];delete ni.attrs[e][n],ni.tweens[e]&&(Object.keys(ni.tweens[e]).length===0&&delete ni.tweens[e],Object.keys(ni.attrs[e]).length===0&&delete ni.attrs[e])}}ni.attrs={};ni.tweens={};At.prototype.to=function(t){const e=t.onFinish;t.node=this,t.onFinish=function(){this.destroy(),e&&e()},new ni(t).play()};const ap={BackEaseIn(t,e,n,r){return n*(t/=r)*t*((1.70158+1)*t-1.70158)+e},BackEaseOut(t,e,n,r){return n*((t=t/r-1)*t*((1.70158+1)*t+1.70158)+1)+e},BackEaseInOut(t,e,n,r){let i=1.70158;return(t/=r/2)<1?n/2*(t*t*(((i*=1.525)+1)*t-i))+e:n/2*((t-=2)*t*(((i*=1.525)+1)*t+i)+2)+e},ElasticEaseIn(t,e,n,r,i,a){let o=0;return t===0?e:(t/=r)===1?e+n:(a||(a=r*.3),!i||i<Math.abs(n)?(i=n,o=a/4):o=a/(2*Math.PI)*Math.asin(n/i),-(i*Math.pow(2,10*(t-=1))*Math.sin((t*r-o)*(2*Math.PI)/a))+e)},ElasticEaseOut(t,e,n,r,i,a){let o=0;return t===0?e:(t/=r)===1?e+n:(a||(a=r*.3),!i||i<Math.abs(n)?(i=n,o=a/4):o=a/(2*Math.PI)*Math.asin(n/i),i*Math.pow(2,-10*t)*Math.sin((t*r-o)*(2*Math.PI)/a)+n+e)},ElasticEaseInOut(t,e,n,r,i,a){let o=0;return t===0?e:(t/=r/2)===2?e+n:(a||(a=r*(.3*1.5)),!i||i<Math.abs(n)?(i=n,o=a/4):o=a/(2*Math.PI)*Math.asin(n/i),t<1?-.5*(i*Math.pow(2,10*(t-=1))*Math.sin((t*r-o)*(2*Math.PI)/a))+e:i*Math.pow(2,-10*(t-=1))*Math.sin((t*r-o)*(2*Math.PI)/a)*.5+n+e)},BounceEaseOut(t,e,n,r){return(t/=r)<1/2.75?n*(7.5625*t*t)+e:t<2/2.75?n*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?n*(7.5625*(t-=2.25/2.75)*t+.9375)+e:n*(7.5625*(t-=2.625/2.75)*t+.984375)+e},BounceEaseIn(t,e,n,r){return n-ap.BounceEaseOut(r-t,0,n,r)+e},BounceEaseInOut(t,e,n,r){return t<r/2?ap.BounceEaseIn(t*2,0,n,r)*.5+e:ap.BounceEaseOut(t*2-r,0,n,r)*.5+n*.5+e},EaseIn(t,e,n,r){return n*(t/=r)*t+e},EaseOut(t,e,n,r){return-n*(t/=r)*(t-2)+e},EaseInOut(t,e,n,r){return(t/=r/2)<1?n/2*t*t+e:-n/2*(--t*(t-2)-1)+e},StrongEaseIn(t,e,n,r){return n*(t/=r)*t*t*t*t+e},StrongEaseOut(t,e,n,r){return n*((t=t/r-1)*t*t*t*t+1)+e},StrongEaseInOut(t,e,n,r){return(t/=r/2)<1?n/2*t*t*t*t*t+e:n/2*((t-=2)*t*t*t*t+2)+e},Linear(t,e,n,r){return n*t/r+e}},lh=Ze._assign(Ot,{Util:Ze,Transform:rl,Node:At,Container:al,Stage:q0,stages:rp,Layer:bh,FastLayer:Zm,Group:pd,DD:yr,Shape:mt,shapes:ip,Animation:_d,Tween:ni,Easings:ap,Context:B0,Canvas:Vm});let _c=class extends mt{_sceneFunc(e){const n=Ot.getAngle(this.angle()),r=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,n,r),e.arc(0,0,this.innerRadius(),n,0,!r),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){const e=this.innerRadius(),n=this.outerRadius(),r=this.clockwise(),i=Ot.getAngle(r?360-this.angle():this.angle()),a=Math.cos(Math.min(i,Math.PI)),o=1,s=Math.sin(Math.min(Math.max(Math.PI,i),3*Math.PI/2)),u=Math.sin(Math.min(i,Math.PI/2)),h=a*(a>0?e:n),f=o*n,g=s*(s>0?e:n),v=u*(u>0?n:e);return{x:h,y:r?-1*v:g,width:f-h,height:v-g}}};_c.prototype._centroid=!0;_c.prototype.className="Arc";_c.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"];Fi(_c);je.addGetterSetter(_c,"innerRadius",0,Et());je.addGetterSetter(_c,"outerRadius",0,Et());je.addGetterSetter(_c,"angle",0,Et());je.addGetterSetter(_c,"clockwise",!1,au());function sm(t,e,n,r,i,a,o){const s=Math.sqrt(Math.pow(n-t,2)+Math.pow(r-e,2)),u=Math.sqrt(Math.pow(i-n,2)+Math.pow(a-r,2)),h=o*s/(s+u),f=o*u/(s+u),g=n-h*(i-t),v=r-h*(a-e),p=n+f*(i-t),y=r+f*(a-e);return[g,v,p,y]}function W5(t,e){const n=t.length,r=[];for(let i=2;i<n-2;i+=2){const a=sm(t[i-2],t[i-1],t[i],t[i+1],t[i+2],t[i+3],e);isNaN(a[0])||(r.push(a[0]),r.push(a[1]),r.push(t[i]),r.push(t[i+1]),r.push(a[2]),r.push(a[3]))}return r}let xc=class extends mt{constructor(e){super(e),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(e){const n=this.points(),r=n.length,i=this.tension(),a=this.closed(),o=this.bezier();if(!r)return;let s=0;if(e.beginPath(),e.moveTo(n[0],n[1]),i!==0&&r>4){const u=this.getTensionPoints(),h=u.length;for(s=a?0:4,a||e.quadraticCurveTo(u[0],u[1],u[2],u[3]);s<h-2;)e.bezierCurveTo(u[s++],u[s++],u[s++],u[s++],u[s++],u[s++]);a||e.quadraticCurveTo(u[h-2],u[h-1],n[r-2],n[r-1])}else if(o)for(s=2;s<r;)e.bezierCurveTo(n[s++],n[s++],n[s++],n[s++],n[s++],n[s++]);else for(s=2;s<r;s+=2)e.lineTo(n[s],n[s+1]);a?(e.closePath(),e.fillStrokeShape(this)):e.strokeShape(this)}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():W5(this.points(),this.tension())}_getTensionPointsClosed(){const e=this.points(),n=e.length,r=this.tension(),i=sm(e[n-2],e[n-1],e[0],e[1],e[2],e[3],r),a=sm(e[n-4],e[n-3],e[n-2],e[n-1],e[0],e[1],r),o=W5(e,r);return[i[2],i[3]].concat(o).concat([a[0],a[1],e[n-2],e[n-1],a[2],a[3],i[0],i[1],e[0],e[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let e=this.points();if(e.length<4)return{x:e[0]||0,y:e[1]||0,width:0,height:0};this.tension()!==0?e=[e[0],e[1],...this._getTensionPoints(),e[e.length-2],e[e.length-1]]:e=this.points();let n=e[0],r=e[0],i=e[1],a=e[1],o,s;for(let u=0;u<e.length/2;u++)o=e[u*2],s=e[u*2+1],n=Math.min(n,o),r=Math.max(r,o),i=Math.min(i,s),a=Math.max(a,s);return{x:n,y:i,width:r-n,height:a-i}}};xc.prototype.className="Line";xc.prototype._attrsAffectingSize=["points","bezier","tension"];Fi(xc);je.addGetterSetter(xc,"closed",!1);je.addGetterSetter(xc,"bezier",!1);je.addGetterSetter(xc,"tension",0,Et());je.addGetterSetter(xc,"points",[],NE());const vk=[[],[],[-.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]],mk=[[],[],[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]],yk=[[1],[1,1],[1,2,1],[1,3,3,1]],V5=(t,e,n)=>{let r,i;const o=n/2;r=0;for(let s=0;s<20;s++)i=o*vk[20][s]+o,r+=mk[20][s]*bk(t,e,i);return o*r},Y5=(t,e,n)=>{n===void 0&&(n=1);const r=t[0]-2*t[1]+t[2],i=e[0]-2*e[1]+e[2],a=2*t[1]-2*t[0],o=2*e[1]-2*e[0],s=4*(r*r+i*i),u=4*(r*a+i*o),h=a*a+o*o;if(s===0)return n*Math.sqrt(Math.pow(t[2]-t[0],2)+Math.pow(e[2]-e[0],2));const f=u/(2*s),g=h/s,v=n+f,p=g-f*f,y=v*v+p>0?Math.sqrt(v*v+p):0,_=f*f+p>0?Math.sqrt(f*f+p):0,x=f+Math.sqrt(f*f+p)!==0?p*Math.log(Math.abs((v+y)/(f+_))):0;return Math.sqrt(s)/2*(v*y-f*_+x)};function bk(t,e,n){const r=lm(1,n,t),i=lm(1,n,e),a=r*r+i*i;return Math.sqrt(a)}const lm=(t,e,n)=>{const r=n.length-1;let i,a;if(r===0)return 0;if(t===0){a=0;for(let o=0;o<=r;o++)a+=yk[r][o]*Math.pow(1-e,r-o)*Math.pow(e,o)*n[o];return a}else{i=new Array(r);for(let o=0;o<r;o++)i[o]=r*(n[o+1]-n[o]);return lm(t-1,e,i)}},X5=(t,e,n)=>{let r=1,i=t/e,a=(t-n(i))/e,o=0;for(;r>.001;){const s=n(i+a),u=Math.abs(t-s)/e;if(u<r)r=u,i+=a;else{const h=n(i-a),f=Math.abs(t-h)/e;f<r?(r=f,i-=a):a/=2}if(o++,o>500)break}return i};let Ol=class Ns extends mt{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=Ns.parsePathData(this.data()),this.pathLength=Ns.getPathLength(this.dataArray)}_sceneFunc(e){const n=this.dataArray;e.beginPath();let r=!1;for(let i=0;i<n.length;i++){const a=n[i].command,o=n[i].points;switch(a){case"L":e.lineTo(o[0],o[1]);break;case"M":e.moveTo(o[0],o[1]);break;case"C":e.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"Q":e.quadraticCurveTo(o[0],o[1],o[2],o[3]);break;case"A":const s=o[0],u=o[1],h=o[2],f=o[3],g=o[4],v=o[5],p=o[6],y=o[7],_=h>f?h:f,x=h>f?1:h/f,b=h>f?f/h:1;e.translate(s,u),e.rotate(p),e.scale(x,b),e.arc(0,0,_,g,g+v,1-y),e.scale(1/x,1/b),e.rotate(-p),e.translate(-s,-u);break;case"z":r=!0,e.closePath();break}}!r&&!this.hasFill()?e.strokeShape(this):e.fillStrokeShape(this)}getSelfRect(){let e=[];this.dataArray.forEach(function(u){if(u.command==="A"){const h=u.points[4],f=u.points[5],g=u.points[4]+f;let v=Math.PI/180;if(Math.abs(h-g)<v&&(v=Math.abs(h-g)),f<0)for(let p=h-v;p>g;p-=v){const y=Ns.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],p,0);e.push(y.x,y.y)}else for(let p=h+v;p<g;p+=v){const y=Ns.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],p,0);e.push(y.x,y.y)}}else if(u.command==="C")for(let h=0;h<=1;h+=.01){const f=Ns.getPointOnCubicBezier(h,u.start.x,u.start.y,u.points[0],u.points[1],u.points[2],u.points[3],u.points[4],u.points[5]);e.push(f.x,f.y)}else e=e.concat(u.points)});let n=e[0],r=e[0],i=e[1],a=e[1],o,s;for(let u=0;u<e.length/2;u++)o=e[u*2],s=e[u*2+1],isNaN(o)||(n=Math.min(n,o),r=Math.max(r,o)),isNaN(s)||(i=Math.min(i,s),a=Math.max(a,s));return{x:n,y:i,width:r-n,height:a-i}}getLength(){return this.pathLength}getPointAtLength(e){return Ns.getPointAtLengthOfDataArray(e,this.dataArray)}static getLineLength(e,n,r,i){return Math.sqrt((r-e)*(r-e)+(i-n)*(i-n))}static getPathLength(e){let n=0;for(let r=0;r<e.length;++r)n+=e[r].pathLength;return n}static getPointAtLengthOfDataArray(e,n){let r,i=0,a=n.length;if(!a)return null;for(;i<a&&e>n[i].pathLength;)e-=n[i].pathLength,++i;if(i===a)return r=n[i-1].points.slice(-2),{x:r[0],y:r[1]};if(e<.01)return n[i].command==="M"?(r=n[i].points.slice(0,2),{x:r[0],y:r[1]}):{x:n[i].start.x,y:n[i].start.y};const o=n[i],s=o.points;switch(o.command){case"L":return Ns.getPointOnLine(e,o.start.x,o.start.y,s[0],s[1]);case"C":return Ns.getPointOnCubicBezier(X5(e,Ns.getPathLength(n),_=>V5([o.start.x,s[0],s[2],s[4]],[o.start.y,s[1],s[3],s[5]],_)),o.start.x,o.start.y,s[0],s[1],s[2],s[3],s[4],s[5]);case"Q":return Ns.getPointOnQuadraticBezier(X5(e,Ns.getPathLength(n),_=>Y5([o.start.x,s[0],s[2]],[o.start.y,s[1],s[3]],_)),o.start.x,o.start.y,s[0],s[1],s[2],s[3]);case"A":const u=s[0],h=s[1],f=s[2],g=s[3],v=s[5],p=s[6];let y=s[4];return y+=v*e/o.pathLength,Ns.getPointOnEllipticalArc(u,h,f,g,y,p)}return null}static getPointOnLine(e,n,r,i,a,o,s){o=o??n,s=s??r;const u=this.getLineLength(n,r,i,a);if(u<1e-10)return{x:n,y:r};if(i===n)return{x:o,y:s+(a>r?e:-e)};const h=(a-r)/(i-n),f=Math.sqrt(e*e/(1+h*h))*(i<n?-1:1),g=h*f;if(Math.abs(s-r-h*(o-n))<1e-10)return{x:o+f,y:s+g};const v=((o-n)*(i-n)+(s-r)*(a-r))/(u*u),p=n+v*(i-n),y=r+v*(a-r),_=this.getLineLength(o,s,p,y),x=Math.sqrt(e*e-_*_),b=Math.sqrt(x*x/(1+h*h))*(i<n?-1:1),E=h*b;return{x:p+b,y:y+E}}static getPointOnCubicBezier(e,n,r,i,a,o,s,u,h){function f(x){return x*x*x}function g(x){return 3*x*x*(1-x)}function v(x){return 3*x*(1-x)*(1-x)}function p(x){return(1-x)*(1-x)*(1-x)}const y=u*f(e)+o*g(e)+i*v(e)+n*p(e),_=h*f(e)+s*g(e)+a*v(e)+r*p(e);return{x:y,y:_}}static getPointOnQuadraticBezier(e,n,r,i,a,o,s){function u(p){return p*p}function h(p){return 2*p*(1-p)}function f(p){return(1-p)*(1-p)}const g=o*u(e)+i*h(e)+n*f(e),v=s*u(e)+a*h(e)+r*f(e);return{x:g,y:v}}static getPointOnEllipticalArc(e,n,r,i,a,o){const s=Math.cos(o),u=Math.sin(o),h={x:r*Math.cos(a),y:i*Math.sin(a)};return{x:e+(h.x*s-h.y*u),y:n+(h.x*u+h.y*s)}}static parsePathData(e){if(!e)return[];let n=e;const r=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];n=n.replace(new RegExp(" ","g"),",");for(let g=0;g<r.length;g++)n=n.replace(new RegExp(r[g],"g"),"|"+r[g]);const i=n.split("|"),a=[],o=[];let s=0,u=0;const h=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let f;for(let g=1;g<i.length;g++){let v=i[g],p=v.charAt(0);for(v=v.slice(1),o.length=0;f=h.exec(v);)o.push(f[0]);let y=[],_=p==="A"||p==="a"?0:-1;for(let x=0,b=o.length;x<b;x++){const E=o[x];if(E==="00"){y.push(0,0),_>=0&&(_+=2,_>=7&&(_-=7));continue}if(_>=0){if(_===3){if(/^[01]{2}\d+(?:\.\d+)?$/.test(E)){y.push(parseInt(E[0],10)),y.push(parseInt(E[1],10)),y.push(parseFloat(E.slice(2))),_+=3,_>=7&&(_-=7);continue}if(E==="11"||E==="10"||E==="01"){y.push(parseInt(E[0],10)),y.push(parseInt(E[1],10)),_+=2,_>=7&&(_-=7);continue}if(E==="0"||E==="1"){y.push(parseInt(E,10)),_+=1,_>=7&&(_-=7);continue}}else if(_===4){if(/^[01]\d+(?:\.\d+)?$/.test(E)){y.push(parseInt(E[0],10)),y.push(parseFloat(E.slice(1))),_+=2,_>=7&&(_-=7);continue}if(E==="0"||E==="1"){y.push(parseInt(E,10)),_+=1,_>=7&&(_-=7);continue}}const A=parseFloat(E);isNaN(A)?y.push(0):y.push(A),_+=1,_>=7&&(_-=7)}else{const A=parseFloat(E);isNaN(A)?y.push(0):y.push(A)}}for(;y.length>0&&!isNaN(y[0]);){let x="",b=[];const E=s,A=u;let S,k,I,O,M,F,j,T,L,$;switch(p){case"l":s+=y.shift(),u+=y.shift(),x="L",b.push(s,u);break;case"L":s=y.shift(),u=y.shift(),b.push(s,u);break;case"m":const q=y.shift(),J=y.shift();if(s+=q,u+=J,x="M",a.length>2&&a[a.length-1].command==="z"){for(let ae=a.length-2;ae>=0;ae--)if(a[ae].command==="M"){s=a[ae].points[0]+q,u=a[ae].points[1]+J;break}}b.push(s,u),p="l";break;case"M":s=y.shift(),u=y.shift(),x="M",b.push(s,u),p="L";break;case"h":s+=y.shift(),x="L",b.push(s,u);break;case"H":s=y.shift(),x="L",b.push(s,u);break;case"v":u+=y.shift(),x="L",b.push(s,u);break;case"V":u=y.shift(),x="L",b.push(s,u);break;case"C":b.push(y.shift(),y.shift(),y.shift(),y.shift()),s=y.shift(),u=y.shift(),b.push(s,u);break;case"c":b.push(s+y.shift(),u+y.shift(),s+y.shift(),u+y.shift()),s+=y.shift(),u+=y.shift(),x="C",b.push(s,u);break;case"S":k=s,I=u,S=a[a.length-1],S.command==="C"&&(k=s+(s-S.points[2]),I=u+(u-S.points[3])),b.push(k,I,y.shift(),y.shift()),s=y.shift(),u=y.shift(),x="C",b.push(s,u);break;case"s":k=s,I=u,S=a[a.length-1],S.command==="C"&&(k=s+(s-S.points[2]),I=u+(u-S.points[3])),b.push(k,I,s+y.shift(),u+y.shift()),s+=y.shift(),u+=y.shift(),x="C",b.push(s,u);break;case"Q":b.push(y.shift(),y.shift()),s=y.shift(),u=y.shift(),b.push(s,u);break;case"q":b.push(s+y.shift(),u+y.shift()),s+=y.shift(),u+=y.shift(),x="Q",b.push(s,u);break;case"T":k=s,I=u,S=a[a.length-1],S.command==="Q"&&(k=s+(s-S.points[0]),I=u+(u-S.points[1])),s=y.shift(),u=y.shift(),x="Q",b.push(k,I,s,u);break;case"t":k=s,I=u,S=a[a.length-1],S.command==="Q"&&(k=s+(s-S.points[0]),I=u+(u-S.points[1])),s+=y.shift(),u+=y.shift(),x="Q",b.push(k,I,s,u);break;case"A":O=y.shift(),M=y.shift(),F=y.shift(),j=y.shift(),T=y.shift(),L=s,$=u,s=y.shift(),u=y.shift(),x="A",b=this.convertEndpointToCenterParameterization(L,$,s,u,j,T,O,M,F);break;case"a":O=y.shift(),M=y.shift(),F=y.shift(),j=y.shift(),T=y.shift(),L=s,$=u,s+=y.shift(),u+=y.shift(),x="A",b=this.convertEndpointToCenterParameterization(L,$,s,u,j,T,O,M,F);break}a.push({command:x||p,points:b,start:{x:E,y:A},pathLength:this.calcLength(E,A,x||p,b)})}(p==="z"||p==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(e,n,r,i){let a,o,s,u;const h=Ns;switch(r){case"L":return h.getLineLength(e,n,i[0],i[1]);case"C":return V5([e,i[0],i[2],i[4]],[n,i[1],i[3],i[5]],1);case"Q":return Y5([e,i[0],i[2]],[n,i[1],i[3]],1);case"A":a=0;const f=i[4],g=i[5],v=i[4]+g;let p=Math.PI/180;if(Math.abs(f-v)<p&&(p=Math.abs(f-v)),o=h.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],f,0),g<0)for(u=f-p;u>v;u-=p)s=h.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),a+=h.getLineLength(o.x,o.y,s.x,s.y),o=s;else for(u=f+p;u<v;u+=p)s=h.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),a+=h.getLineLength(o.x,o.y,s.x,s.y),o=s;return s=h.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],v,0),a+=h.getLineLength(o.x,o.y,s.x,s.y),a}return 0}static convertEndpointToCenterParameterization(e,n,r,i,a,o,s,u,h){const f=h*(Math.PI/180),g=Math.cos(f)*(e-r)/2+Math.sin(f)*(n-i)/2,v=-1*Math.sin(f)*(e-r)/2+Math.cos(f)*(n-i)/2,p=g*g/(s*s)+v*v/(u*u);p>1&&(s*=Math.sqrt(p),u*=Math.sqrt(p));let y=Math.sqrt((s*s*(u*u)-s*s*(v*v)-u*u*(g*g))/(s*s*(v*v)+u*u*(g*g)));a===o&&(y*=-1),isNaN(y)&&(y=0);const _=y*s*v/u,x=y*-u*g/s,b=(e+r)/2+Math.cos(f)*_-Math.sin(f)*x,E=(n+i)/2+Math.sin(f)*_+Math.cos(f)*x,A=function(j){return Math.sqrt(j[0]*j[0]+j[1]*j[1])},S=function(j,T){return(j[0]*T[0]+j[1]*T[1])/(A(j)*A(T))},k=function(j,T){return(j[0]*T[1]<j[1]*T[0]?-1:1)*Math.acos(S(j,T))},I=k([1,0],[(g-_)/s,(v-x)/u]),O=[(g-_)/s,(v-x)/u],M=[(-1*g-_)/s,(-1*v-x)/u];let F=k(O,M);return S(O,M)<=-1&&(F=Math.PI),S(O,M)>=1&&(F=0),o===0&&F>0&&(F=F-2*Math.PI),o===1&&F<0&&(F=F+2*Math.PI),[b,E,s,u,I,F,f,o]}};Ol.prototype.className="Path";Ol.prototype._attrsAffectingSize=["data"];Fi(Ol);je.addGetterSetter(Ol,"data");class wh extends xc{_sceneFunc(e){super._sceneFunc(e);const n=Math.PI*2,r=this.points();let i=r;const a=this.tension()!==0&&r.length>4;a&&(i=this.getTensionPoints());const o=this.pointerLength(),s=r.length;let u,h;if(a){const v=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[s-2],r[s-1]],p=Ol.calcLength(i[i.length-4],i[i.length-3],"C",v),y=Ol.getPointOnQuadraticBezier(Math.min(1,1-o/p),v[0],v[1],v[2],v[3],v[4],v[5]);u=r[s-2]-y.x,h=r[s-1]-y.y}else u=r[s-2]-r[s-4],h=r[s-1]-r[s-3];const f=(Math.atan2(h,u)+n)%n,g=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(r[s-2],r[s-1]),e.rotate(f),e.moveTo(0,0),e.lineTo(-o,g/2),e.lineTo(-o,-g/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(r[0],r[1]),a?(u=(i[0]+i[2])/2-r[0],h=(i[1]+i[3])/2-r[1]):(u=r[2]-r[0],h=r[3]-r[1]),e.rotate((Math.atan2(-h,-u)+n)%n),e.moveTo(0,0),e.lineTo(-o,g/2),e.lineTo(-o,-g/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){const n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),n=this.pointerWidth()/2;return{x:e.x,y:e.y-n,width:e.width,height:e.height+n*2}}}wh.prototype.className="Arrow";Fi(wh);je.addGetterSetter(wh,"pointerLength",10,Et());je.addGetterSetter(wh,"pointerWidth",10,Et());je.addGetterSetter(wh,"pointerAtBeginning",!1);je.addGetterSetter(wh,"pointerAtEnding",!0);let xd=class extends mt{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}};xd.prototype._centroid=!0;xd.prototype.className="Circle";xd.prototype._attrsAffectingSize=["radius"];Fi(xd);je.addGetterSetter(xd,"radius",0,Et());class Af extends mt{_sceneFunc(e){const n=this.radiusX(),r=this.radiusY();e.beginPath(),e.save(),n!==r&&e.scale(1,r/n),e.arc(0,0,n,0,Math.PI*2,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}}Af.prototype.className="Ellipse";Af.prototype._centroid=!0;Af.prototype._attrsAffectingSize=["radiusX","radiusY"];Fi(Af);je.addComponentsGetterSetter(Af,"radius",["x","y"]);je.addGetterSetter(Af,"radiusX",0,Et());je.addGetterSetter(Af,"radiusY",0,Et());let $u=class y8 extends mt{constructor(e){super(e),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",n=>{this._removeImageLoad(n.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&e.readyState===4||e&&e.addEventListener&&e.addEventListener("load",this._loadListener)}_removeImageLoad(e){e&&e.removeEventListener&&e.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const e=!!this.cornerRadius(),n=this.hasShadow();return e&&n?!0:super._useBufferCanvas(!0)}_sceneFunc(e){const n=this.getWidth(),r=this.getHeight(),i=this.cornerRadius(),a=this.attrs.image;let o;if(a){const s=this.attrs.cropWidth,u=this.attrs.cropHeight;s&&u?o=[a,this.cropX(),this.cropY(),s,u,0,0,n,r]:o=[a,0,0,n,r]}(this.hasFill()||this.hasStroke()||i)&&(e.beginPath(),i?Ze.drawRoundedRectPath(e,n,r,i):e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)),a&&(i&&e.clip(),e.drawImage.apply(e,o))}_hitFunc(e){const n=this.width(),r=this.height(),i=this.cornerRadius();e.beginPath(),i?Ze.drawRoundedRectPath(e,n,r,i):e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,n;return(e=this.attrs.width)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.width}getHeight(){var e,n;return(e=this.attrs.height)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.height}static fromURL(e,n,r=null){const i=Ze.createImageElement();i.onload=function(){const a=new y8({image:i});n(a)},i.onerror=r,i.crossOrigin="Anonymous",i.src=e}};$u.prototype.className="Image";Fi($u);je.addGetterSetter($u,"cornerRadius",0,z0(4));je.addGetterSetter($u,"image");je.addComponentsGetterSetter($u,"crop",["x","y","width","height"]);je.addGetterSetter($u,"cropX",0,Et());je.addGetterSetter($u,"cropY",0,Et());je.addGetterSetter($u,"cropWidth",0,Et());je.addGetterSetter($u,"cropHeight",0,Et());const b8=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],wk="Change.konva",_k="none",um="up",cm="right",fm="down",hm="left",xk=b8.length;let Qm=class extends pd{constructor(e){super(e),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){let n=this,r;const i=function(){n._sync()};for(r=0;r<xk;r++)e.on(b8[r]+wk,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let e=this.getText(),n=this.getTag(),r,i,a,o,s,u,h;if(e&&n){switch(r=e.width(),i=e.height(),a=n.pointerDirection(),o=n.pointerWidth(),h=n.pointerHeight(),s=0,u=0,a){case um:s=r/2,u=-1*h;break;case cm:s=r+o,u=i/2;break;case fm:s=r/2,u=i+h;break;case hm:s=-1*o,u=i/2;break}n.setAttrs({x:-1*s,y:-1*u,width:r,height:i}),e.setAttrs({x:-1*s,y:-1*u})}}};Qm.prototype.className="Label";Fi(Qm);let _h=class extends mt{_sceneFunc(e){const n=this.width(),r=this.height(),i=this.pointerDirection(),a=this.pointerWidth(),o=this.pointerHeight(),s=this.cornerRadius();let u=0,h=0,f=0,g=0;typeof s=="number"?u=h=f=g=Math.min(s,n/2,r/2):(u=Math.min(s[0]||0,n/2,r/2),h=Math.min(s[1]||0,n/2,r/2),g=Math.min(s[2]||0,n/2,r/2),f=Math.min(s[3]||0,n/2,r/2)),e.beginPath(),e.moveTo(u,0),i===um&&(e.lineTo((n-a)/2,0),e.lineTo(n/2,-1*o),e.lineTo((n+a)/2,0)),e.lineTo(n-h,0),e.arc(n-h,h,h,Math.PI*3/2,0,!1),i===cm&&(e.lineTo(n,(r-o)/2),e.lineTo(n+a,r/2),e.lineTo(n,(r+o)/2)),e.lineTo(n,r-g),e.arc(n-g,r-g,g,0,Math.PI/2,!1),i===fm&&(e.lineTo((n+a)/2,r),e.lineTo(n/2,r+o),e.lineTo((n-a)/2,r)),e.lineTo(f,r),e.arc(f,r-f,f,Math.PI/2,Math.PI,!1),i===hm&&(e.lineTo(0,(r+o)/2),e.lineTo(-1*a,r/2),e.lineTo(0,(r-o)/2)),e.lineTo(0,u),e.arc(u,u,u,Math.PI,Math.PI*3/2,!1),e.closePath(),e.fillStrokeShape(this)}getSelfRect(){let e=0,n=0,r=this.pointerWidth(),i=this.pointerHeight(),a=this.pointerDirection(),o=this.width(),s=this.height();return a===um?(n-=i,s+=i):a===fm?s+=i:a===hm?(e-=r*1.5,o+=r):a===cm&&(o+=r*1.5),{x:e,y:n,width:o,height:s}}};_h.prototype.className="Tag";Fi(_h);je.addGetterSetter(_h,"pointerDirection",_k);je.addGetterSetter(_h,"pointerWidth",0,Et());je.addGetterSetter(_h,"pointerHeight",0,Et());je.addGetterSetter(_h,"cornerRadius",0,z0(4));let Rp=class extends mt{_sceneFunc(e){const n=this.cornerRadius(),r=this.width(),i=this.height();e.beginPath(),n?Ze.drawRoundedRectPath(e,r,i,n):e.rect(0,0,r,i),e.closePath(),e.fillStrokeShape(this)}};Rp.prototype.className="Rect";Fi(Rp);je.addGetterSetter(Rp,"cornerRadius",0,z0(4));class Pf extends mt{_sceneFunc(e){const n=this._getPoints(),r=this.radius(),i=this.sides(),a=this.cornerRadius();if(e.beginPath(),a)Ze.drawRoundedPolygonPath(e,n,i,r,a);else{e.moveTo(n[0].x,n[0].y);for(let o=1;o<n.length;o++)e.lineTo(n[o].x,n[o].y)}e.closePath(),e.fillStrokeShape(this)}_getPoints(){const e=this.attrs.sides,n=this.attrs.radius||0,r=[];for(let i=0;i<e;i++)r.push({x:n*Math.sin(i*2*Math.PI/e),y:-1*n*Math.cos(i*2*Math.PI/e)});return r}getSelfRect(){const e=this._getPoints();let n=e[0].x,r=e[0].y,i=e[0].x,a=e[0].y;return e.forEach(o=>{n=Math.min(n,o.x),r=Math.max(r,o.x),i=Math.min(i,o.y),a=Math.max(a,o.y)}),{x:n,y:i,width:r-n,height:a-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}Pf.prototype.className="RegularPolygon";Pf.prototype._centroid=!0;Pf.prototype._attrsAffectingSize=["radius"];Fi(Pf);je.addGetterSetter(Pf,"radius",0,Et());je.addGetterSetter(Pf,"sides",0,Et());je.addGetterSetter(Pf,"cornerRadius",0,z0(4));const K5=Math.PI*2;class xh extends mt{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,K5,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),K5,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}xh.prototype.className="Ring";xh.prototype._centroid=!0;xh.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Fi(xh);je.addGetterSetter(xh,"innerRadius",0,Et());je.addGetterSetter(xh,"outerRadius",0,Et());class Gu extends mt{constructor(e){super(e),this._updated=!0,this.anim=new _d(()=>{const n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(e){const n=this.animation(),r=this.frameIndex(),i=r*4,a=this.animations()[n],o=this.frameOffsets(),s=a[i+0],u=a[i+1],h=a[i+2],f=a[i+3],g=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,h,f),e.closePath(),e.fillStrokeShape(this)),g)if(o){const v=o[n],p=r*2;e.drawImage(g,s,u,h,f,v[p+0],v[p+1],h,f)}else e.drawImage(g,s,u,h,f,0,0,h,f)}_hitFunc(e){const n=this.animation(),r=this.frameIndex(),i=r*4,a=this.animations()[n],o=this.frameOffsets(),s=a[i+2],u=a[i+3];if(e.beginPath(),o){const h=o[n],f=r*2;e.rect(h[f+0],h[f+1],s,u)}else e.rect(0,0,s,u);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const e=this;this.interval=setInterval(function(){e._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const e=this.frameIndex(),n=this.animation(),r=this.animations(),i=r[n],a=i.length/4;e<a-1?this.frameIndex(e+1):this.frameIndex(0)}}Gu.prototype.className="Sprite";Fi(Gu);je.addGetterSetter(Gu,"animation");je.addGetterSetter(Gu,"animations");je.addGetterSetter(Gu,"frameOffsets");je.addGetterSetter(Gu,"image");je.addGetterSetter(Gu,"frameIndex",0,Et());je.addGetterSetter(Gu,"frameRate",17,Et());je.backCompat(Gu,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});class Of extends mt{_sceneFunc(e){const n=this.innerRadius(),r=this.outerRadius(),i=this.numPoints();e.beginPath(),e.moveTo(0,0-r);for(let a=1;a<i*2;a++){const o=a%2===0?r:n,s=o*Math.sin(a*Math.PI/i),u=-1*o*Math.cos(a*Math.PI/i);e.lineTo(s,u)}e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}Of.prototype.className="Star";Of.prototype._centroid=!0;Of.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Fi(Of);je.addGetterSetter(Of,"numPoints",5,Et());je.addGetterSetter(Of,"innerRadius",0,Et());je.addGetterSetter(Of,"outerRadius",0,Et());function lf(t){return[...t].reduce((e,n,r,i)=>{if(new RegExp("\\p{Emoji}","u").test(n)){const a=i[r+1];a&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(a)?(e.push(n+a),i[r+1]=""):e.push(n)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(n+(i[r+1]||""))?e.push(n+i[r+1]):r>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(n)?e[e.length-1]+=n:n&&e.push(n);return e},[])}const Wh="auto",Sk="center",w8="inherit",Vh="justify",Ek="Change.konva",kk="2d",Z5="-",_8="left",Ak="text",Pk="Text",Ok="top",Ck="bottom",Q5="middle",x8="normal",Lk="px ",k1=" ",Nk="right",J5="rtl",Tk="word",Rk="char",e3="none",Wg="…",S8=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],Mk=S8.length;function Ik(t){return t.split(",").map(e=>{e=e.trim();const n=e.indexOf(" ")>=0,r=e.indexOf('"')>=0||e.indexOf("'")>=0;return n&&!r&&(e=`"${e}"`),e}).join(", ")}let A1;function Vg(){return A1||(A1=Ze.createCanvasElement().getContext(kk),A1)}function jk(t){t.fillText(this._partialText,this._partialTextX,this._partialTextY)}function Dk(t){t.setAttr("miterLimit",2),t.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function Fk(t){return t=t||{},!t.fillLinearGradientColorStops&&!t.fillRadialGradientColorStops&&!t.fillPatternImage&&(t.fill=t.fill||"black"),t}let pi=class extends mt{constructor(e){super(Fk(e)),this._partialTextX=0,this._partialTextY=0;for(let n=0;n<Mk;n++)this.on(S8[n]+Ek,this._setTextData);this._setTextData()}_sceneFunc(e){var n,r;const i=this.textArr,a=i.length;if(!this.text())return;let o=this.padding(),s=this.fontSize(),u=this.lineHeight()*s,h=this.verticalAlign(),f=this.direction(),g=0,v=this.align(),p=this.getWidth(),y=this.letterSpacing(),_=this.charRenderFunc(),x=this.fill(),b=this.textDecoration(),E=b.indexOf("underline")!==-1,A=b.indexOf("line-through")!==-1,S;f=f===w8?e.direction:f;let k=u/2,I=Q5;if(!Ot.legacyTextRendering){const O=this.measureSize("M");I="alphabetic";const M=(n=O.fontBoundingBoxAscent)!==null&&n!==void 0?n:O.actualBoundingBoxAscent,F=(r=O.fontBoundingBoxDescent)!==null&&r!==void 0?r:O.actualBoundingBoxDescent;k=(M-F)/2+u/2}for(f===J5&&e.setAttr("direction",f),e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",I),e.setAttr("textAlign",_8),h===Q5?g=(this.getHeight()-a*u-o*2)/2:h===Ck&&(g=this.getHeight()-a*u-o*2),e.translate(o,g+o),S=0;S<a;S++){let O=0,M=0;const F=i[S],j=F.text,T=F.width,L=F.lastInParagraph;if(e.save(),v===Nk?O+=p-T-o*2:v===Sk&&(O+=(p-T-o*2)/2),E){e.save(),e.beginPath();const $=Ot.legacyTextRendering?Math.round(s/2):Math.round(s/4),q=O,J=k+M+$;e.moveTo(q,J);const ae=v===Vh&&!L?p-o*2:T;e.lineTo(q+Math.round(ae),J),e.lineWidth=s/15;const ie=this._getLinearGradient();e.strokeStyle=ie||x,e.stroke(),e.restore()}if(f!==J5&&(y!==0||v===Vh||_)){const $=j.split(" ").length-1,q=lf(j);for(let J=0;J<q.length;J++){const ae=q[J];if(ae===" "&&!L&&v===Vh&&(O+=(p-o*2-T)/$),this._partialTextX=O,this._partialTextY=k+M,this._partialText=ae,_){e.save();const Z=i.slice(0,S).reduce((V,B)=>V+lf(B.text).length,0),te=J+Z;_({char:ae,index:te,x:O,y:k+M,lineIndex:S,column:J,isLastInLine:L,width:this.measureSize(ae).width,context:e})}e.fillStrokeShape(this),_&&e.restore(),O+=this.measureSize(ae).width+y}}else y!==0&&e.setAttr("letterSpacing",`${y}px`),this._partialTextX=O,this._partialTextY=k+M,this._partialText=j,e.fillStrokeShape(this);if(A){e.save(),e.beginPath();const $=Ot.legacyTextRendering?0:-Math.round(s/4),q=v===Vh?0:O;e.moveTo(q,k+M+$);const J=v===Vh&&!L?p-o*2:T;e.lineTo(q+Math.round(J),k+M+$),e.lineWidth=s/15;const ae=this._getLinearGradient();e.strokeStyle=ae||x,e.stroke(),e.restore()}e.restore(),a>1&&(k+=u)}}_hitFunc(e){const n=this.getWidth(),r=this.getHeight();e.beginPath(),e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)}setText(e){const n=Ze._isString(e)?e:e==null?"":e+"";return this._setAttr(Ak,n),this}getWidth(){return this.attrs.width===Wh||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===Wh||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return Ze.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var n,r,i,a,o,s,u,h,f,g,v;let p=Vg(),y=this.fontSize(),_;p.save(),p.font=this._getContextFont(),_=p.measureText(e),p.restore();const x=y/100;return{actualBoundingBoxAscent:(n=_.actualBoundingBoxAscent)!==null&&n!==void 0?n:71.58203125*x,actualBoundingBoxDescent:(r=_.actualBoundingBoxDescent)!==null&&r!==void 0?r:0,actualBoundingBoxLeft:(i=_.actualBoundingBoxLeft)!==null&&i!==void 0?i:-7.421875*x,actualBoundingBoxRight:(a=_.actualBoundingBoxRight)!==null&&a!==void 0?a:75.732421875*x,alphabeticBaseline:(o=_.alphabeticBaseline)!==null&&o!==void 0?o:0,emHeightAscent:(s=_.emHeightAscent)!==null&&s!==void 0?s:100*x,emHeightDescent:(u=_.emHeightDescent)!==null&&u!==void 0?u:-20*x,fontBoundingBoxAscent:(h=_.fontBoundingBoxAscent)!==null&&h!==void 0?h:91*x,fontBoundingBoxDescent:(f=_.fontBoundingBoxDescent)!==null&&f!==void 0?f:21*x,hangingBaseline:(g=_.hangingBaseline)!==null&&g!==void 0?g:72.80000305175781*x,ideographicBaseline:(v=_.ideographicBaseline)!==null&&v!==void 0?v:-21*x,width:_.width,height:y}}_getContextFont(){return this.fontStyle()+k1+this.fontVariant()+k1+(this.fontSize()+Lk)+Ik(this.fontFamily())}_addTextLine(e){this.align()===Vh&&(e=e.trim());const r=this._getTextWidth(e);return this.textArr.push({text:e,width:r,lastInParagraph:!1})}_getTextWidth(e){const n=this.letterSpacing(),r=e.length;return Vg().measureText(e).width+n*r}_setTextData(){let e=this.text().split(`
56
+ `),n=+this.fontSize(),r=0,i=this.lineHeight()*n,a=this.attrs.width,o=this.attrs.height,s=a!==Wh&&a!==void 0,u=o!==Wh&&o!==void 0,h=this.padding(),f=a-h*2,g=o-h*2,v=0,p=this.wrap(),y=p!==e3,_=p!==Rk&&y,x=this.ellipsis();this.textArr=[],Vg().font=this._getContextFont();const b=x?this._getTextWidth(Wg):0;for(let E=0,A=e.length;E<A;++E){let S=e[E],k=this._getTextWidth(S);if(s&&k>f)for(;S.length>0;){let I=0,O=lf(S).length,M="",F=0;for(;I<O;){const j=I+O>>>1,T=lf(S),L=T.slice(0,j+1).join(""),$=this._getTextWidth(L);(x&&u&&v+i>g?$+b:$)<=f?(I=j+1,M=L,F=$):O=j}if(M){if(_){const L=lf(S),$=lf(M),q=L[$.length],J=q===k1||q===Z5;let ae;if(J&&F<=f)ae=$.length;else{const ie=$.lastIndexOf(k1),Z=$.lastIndexOf(Z5);ae=Math.max(ie,Z)+1}ae>0&&(I=ae,M=L.slice(0,I).join(""),F=this._getTextWidth(M))}if(M=M.trimRight(),this._addTextLine(M),r=Math.max(r,F),v+=i,this._shouldHandleEllipsis(v)){this._tryToAddEllipsisToLastLine();break}if(S=lf(S).slice(I).join("").trimLeft(),S.length>0&&(k=this._getTextWidth(S),k<=f)){this._addTextLine(S),v+=i,r=Math.max(r,k);break}}else break}else this._addTextLine(S),v+=i,r=Math.max(r,k),this._shouldHandleEllipsis(v)&&E<A-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),u&&v+i>g)break}this.textHeight=n,this.textWidth=r}_shouldHandleEllipsis(e){const n=+this.fontSize(),r=this.lineHeight()*n,i=this.attrs.height,a=i!==Wh&&i!==void 0,o=this.padding(),s=i-o*2;return!(this.wrap()!==e3)||a&&e+r>s}_tryToAddEllipsisToLastLine(){const e=this.attrs.width,n=e!==Wh&&e!==void 0,r=this.padding(),i=e-r*2,a=this.ellipsis(),o=this.textArr[this.textArr.length-1];!o||!a||(n&&(this._getTextWidth(o.text+Wg)<i||(o.text=o.text.slice(0,o.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(o.text+Wg))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const e=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,n=this.hasShadow();return e&&n?!0:super._useBufferCanvas()}};pi.prototype._fillFunc=jk;pi.prototype._strokeFunc=Dk;pi.prototype.className=Pk;pi.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];Fi(pi);je.overWriteSetter(pi,"width",Xm());je.overWriteSetter(pi,"height",Xm());je.addGetterSetter(pi,"direction",w8);je.addGetterSetter(pi,"fontFamily","Arial");je.addGetterSetter(pi,"fontSize",12,Et());je.addGetterSetter(pi,"fontStyle",x8);je.addGetterSetter(pi,"fontVariant",x8);je.addGetterSetter(pi,"padding",0,Et());je.addGetterSetter(pi,"align",_8);je.addGetterSetter(pi,"verticalAlign",Ok);je.addGetterSetter(pi,"lineHeight",1,Et());je.addGetterSetter(pi,"wrap",Tk);je.addGetterSetter(pi,"ellipsis",!1,au());je.addGetterSetter(pi,"letterSpacing",0,Et());je.addGetterSetter(pi,"text","",yh());je.addGetterSetter(pi,"textDecoration","");je.addGetterSetter(pi,"charRenderFunc",void 0);const Bk="",E8="normal";function k8(t){t.fillText(this.partialText,0,0)}function A8(t){t.strokeText(this.partialText,0,0)}let Da=class extends mt{constructor(e){super(e),this.dummyCanvas=Ze.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 Ol.getPathLength(this.dataArray)}_getPointAtLength(e){if(!this.attrs.data)return null;const n=this.pathLength;return e>n?null:Ol.getPointAtLengthOfDataArray(e,this.dataArray)}_readDataAttribute(){this.dataArray=Ol.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(e){e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",this.textBaseline()),e.setAttr("textAlign","left"),e.save();const n=this.textDecoration(),r=this.fill(),i=this.fontSize(),a=this.glyphInfo;n==="underline"&&e.beginPath();for(let o=0;o<a.length;o++){e.save();const s=a[o].p0;e.translate(s.x,s.y),e.rotate(a[o].rotation),this.partialText=a[o].text,e.fillStrokeShape(this),n==="underline"&&(o===0&&e.moveTo(0,i/2+1),e.lineTo(i,i/2+1)),e.restore()}n==="underline"&&(e.strokeStyle=r,e.lineWidth=i/20,e.stroke()),e.restore()}_hitFunc(e){e.beginPath();const n=this.glyphInfo;if(n.length>=1){const r=n[0].p0;e.moveTo(r.x,r.y)}for(let r=0;r<n.length;r++){const i=n[r].p1;e.lineTo(i.x,i.y)}e.setAttr("lineWidth",this.fontSize()),e.setAttr("strokeStyle",this.colorKey),e.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return Ze.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(e){return pi.prototype.setText.call(this,e)}_getContextFont(){return pi.prototype._getContextFont.call(this)}_getTextSize(e){const r=this.dummyCanvas.getContext("2d");r.save(),r.font=this._getContextFont();const i=r.measureText(e);return r.restore(),{width:i.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const e=lf(this.text()),n=[];let r=0;for(let g=0;g<e.length;g++)n.push({char:e[g],width:this._getTextSize(e[g]).width}),r+=n[g].width;const{height:i}=this._getTextSize(this.attrs.text);if(this.textWidth=r,this.textHeight=i,this.glyphInfo=[],!this.attrs.data)return null;const a=this.letterSpacing(),o=this.align(),s=this.kerningFunc(),u=Math.max(this.textWidth+((this.attrs.text||"").length-1)*a,0);let h=0;o==="center"&&(h=Math.max(0,this.pathLength/2-u/2)),o==="right"&&(h=Math.max(0,this.pathLength-u));let f=h;for(let g=0;g<n.length;g++){const v=this._getPointAtLength(f);if(!v)return;const p=n[g].char;let y=n[g].width+a;if(p===" "&&o==="justify"){const S=this.text().split(" ").length-1;y+=(this.pathLength-u)/S}const _=this._getPointAtLength(f+y);if(!_)return;const x=Ol.getLineLength(v.x,v.y,_.x,_.y);let b=0;if(s)try{b=s(n[g-1].char,p)*this.fontSize()}catch{b=0}v.x+=b,_.x+=b,this.textWidth+=b;const E=Ol.getPointOnLine(b+x/2,v.x,v.y,_.x,_.y),A=Math.atan2(_.y-v.y,_.x-v.x);this.glyphInfo.push({transposeX:E.x,transposeY:E.y,text:e[g],rotation:A,p0:v,p1:_}),f+=y}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const e=[];this.glyphInfo.forEach(function(h){e.push(h.p0.x),e.push(h.p0.y),e.push(h.p1.x),e.push(h.p1.y)});let n=e[0]||0,r=e[0]||0,i=e[1]||0,a=e[1]||0,o,s;for(let h=0;h<e.length/2;h++)o=e[h*2],s=e[h*2+1],n=Math.min(n,o),r=Math.max(r,o),i=Math.min(i,s),a=Math.max(a,s);const u=this.fontSize();return{x:n-u/2,y:i-u/2,width:r-n+u,height:a-i+u}}destroy(){return Ze.releaseCanvas(this.dummyCanvas),super.destroy()}};Da.prototype._fillFunc=k8;Da.prototype._strokeFunc=A8;Da.prototype._fillFuncHit=k8;Da.prototype._strokeFuncHit=A8;Da.prototype.className="TextPath";Da.prototype._attrsAffectingSize=["text","fontSize","data"];Fi(Da);je.addGetterSetter(Da,"data");je.addGetterSetter(Da,"fontFamily","Arial");je.addGetterSetter(Da,"fontSize",12,Et());je.addGetterSetter(Da,"fontStyle",E8);je.addGetterSetter(Da,"align","left");je.addGetterSetter(Da,"letterSpacing",0,Et());je.addGetterSetter(Da,"textBaseline","middle");je.addGetterSetter(Da,"fontVariant",E8);je.addGetterSetter(Da,"text",Bk);je.addGetterSetter(Da,"textDecoration","");je.addGetterSetter(Da,"kerningFunc",void 0);const P8="tr-konva",zk=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(t=>t+`.${P8}`).join(" "),t3="nodesRect",qk=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange","draggableChange"],Uk={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},Hk="ontouchstart"in Ot._global;function $k(t,e,n){if(t==="rotater")return n;e+=Ze.degToRad(Uk[t]||0);const r=(Ze.radToDeg(e)%360+360)%360;return Ze._inRange(r,315+22.5,360)||Ze._inRange(r,0,22.5)?"ns-resize":Ze._inRange(r,45-22.5,45+22.5)?"nesw-resize":Ze._inRange(r,90-22.5,90+22.5)?"ew-resize":Ze._inRange(r,135-22.5,135+22.5)?"nwse-resize":Ze._inRange(r,180-22.5,180+22.5)?"ns-resize":Ze._inRange(r,225-22.5,225+22.5)?"nesw-resize":Ze._inRange(r,270-22.5,270+22.5)?"ew-resize":Ze._inRange(r,315-22.5,315+22.5)?"nwse-resize":(Ze.error("Transformer has unknown angle for cursor detection: "+r),"pointer")}const g0=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function Gk(t){return{x:t.x+t.width/2*Math.cos(t.rotation)+t.height/2*Math.sin(-t.rotation),y:t.y+t.height/2*Math.cos(t.rotation)+t.width/2*Math.sin(t.rotation)}}function O8(t,e,n){const r=n.x+(t.x-n.x)*Math.cos(e)-(t.y-n.y)*Math.sin(e),i=n.y+(t.x-n.x)*Math.sin(e)+(t.y-n.y)*Math.cos(e);return{...t,rotation:t.rotation+e,x:r,y:i}}function Wk(t,e){const n=Gk(t);return O8(t,e,n)}function Vk(t,e,n){let r=e;for(let i=0;i<t.length;i++){const a=Ot.getAngle(t[i]),o=Math.abs(a-e)%(Math.PI*2);Math.min(o,Math.PI*2-o)<n&&(r=a)}return r}let dm=0,er=class extends pd{constructor(e){super(e),this._movingAnchorName=null,this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(zk,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return Ze.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return P8+this._id}setNodes(e=[]){this._nodes&&this._nodes.length&&this.detach();const n=e.filter(i=>i.isAncestorOf(this)?(Ze.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=e=n,e.length===1&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(i=>{const a=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(i._attrsAffectingSize.length){const o=i._attrsAffectingSize.map(s=>s+"Change."+this._getEventNamespace()).join(" ");i.on(o,a)}i.on(qk.map(o=>o+`.${this._getEventNamespace()}`).join(" "),a),i.on(`absoluteTransformChange.${this._getEventNamespace()}`,a),this._proxyDrag(i)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(e){let n;e.on(`dragstart.${this._getEventNamespace()}`,r=>{n=e.getAbsolutePosition(),!this.isDragging()&&e!==this.findOne(".back")&&this.startDrag(r,!1)}),e.on(`dragmove.${this._getEventNamespace()}`,r=>{if(!n)return;const i=e.getAbsolutePosition(),a=i.x-n.x,o=i.y-n.y;this.nodes().forEach(s=>{if(s===e||s.isDragging())return;const u=s.getAbsolutePosition();s.setAbsolutePosition({x:u.x+a,y:u.y+o}),s.startDrag(r)}),n=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(e=>{e.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(t3),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(t3,this.__getNodeRect)}__getNodeShape(e,n=this.rotation(),r){const i=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),a=e.getAbsoluteScale(r),o=e.getAbsolutePosition(r),s=i.x*a.x-e.offsetX()*a.x,u=i.y*a.y-e.offsetY()*a.y,h=(Ot.getAngle(e.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),f={x:o.x+s*Math.cos(h)+u*Math.sin(-h),y:o.y+u*Math.cos(h)+s*Math.sin(h),width:i.width*a.x,height:i.height*a.y,rotation:h};return O8(f,-Ot.getAngle(n),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const n=[];this.nodes().map(h=>{const f=h.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),g=[{x:f.x,y:f.y},{x:f.x+f.width,y:f.y},{x:f.x+f.width,y:f.y+f.height},{x:f.x,y:f.y+f.height}],v=h.getAbsoluteTransform();g.forEach(function(p){const y=v.point(p);n.push(y)})});const r=new rl;r.rotate(-Ot.getAngle(this.rotation()));let i=1/0,a=1/0,o=-1/0,s=-1/0;n.forEach(function(h){const f=r.point(h);i===void 0&&(i=o=f.x,a=s=f.y),i=Math.min(i,f.x),a=Math.min(a,f.y),o=Math.max(o,f.x),s=Math.max(s,f.y)}),r.invert();const u=r.point({x:i,y:a});return{x:u.x,y:u.y,width:o-i,height:s-a,rotation:Ot.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(),g0.forEach(e=>{this._createAnchor(e)}),this._createAnchor("rotater")}_createAnchor(e){const n=new Rp({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:Hk?10:"auto"}),r=this;n.on("mousedown touchstart",function(i){r._handleMouseDown(i)}),n.on("dragstart",i=>{n.stopDrag(),i.cancelBubble=!0}),n.on("dragend",i=>{i.cancelBubble=!0}),n.on("mouseenter",()=>{const i=Ot.getAngle(this.rotation()),a=this.rotateAnchorCursor(),o=$k(e,i,a);n.getStage().content&&(n.getStage().content.style.cursor=o),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){const e=new mt({name:"back",width:0,height:0,sceneFunc(n,r){const i=r.getParent(),a=i.padding();n.beginPath(),n.rect(-a,-a,r.width()+a*2,r.height()+a*2),n.moveTo(r.width()/2,-a),i.rotateEnabled()&&i.rotateLineVisible()&&n.lineTo(r.width()/2,-i.rotateAnchorOffset()*Ze._sign(r.height())-a),n.fillStrokeShape(r)},hitFunc:(n,r)=>{if(!this.shouldOverdrawWholeArea())return;const i=this.padding();n.beginPath(),n.rect(-i,-i,r.width()+i*2,r.height()+i*2),n.fillStrokeShape(r)}});this.add(e),this._proxyDrag(e),e.on("dragstart",n=>{n.cancelBubble=!0}),e.on("dragmove",n=>{n.cancelBubble=!0}),e.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(e){if(this._transforming)return;this._movingAnchorName=e.target.name().split(" ")[0];const n=this._getNodeRect(),r=n.width,i=n.height,a=Math.sqrt(Math.pow(r,2)+Math.pow(i,2));this.sin=Math.abs(i/a),this.cos=Math.abs(r/a),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;const o=e.target.getAbsolutePosition(),s=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:s.x-o.x,y:s.y-o.y},dm++,this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach(u=>{u._fire("transformstart",{evt:e.evt,target:u})})}_handleMouseMove(e){let n,r,i;const a=this.findOne("."+this._movingAnchorName),o=a.getStage();o.setPointersPositions(e);const s=o.getPointerPosition();let u={x:s.x-this._anchorDragOffset.x,y:s.y-this._anchorDragOffset.y};const h=a.getAbsolutePosition();this.anchorDragBoundFunc()&&(u=this.anchorDragBoundFunc()(h,u,e)),a.setAbsolutePosition(u);const f=a.getAbsolutePosition();if(h.x===f.x&&h.y===f.y)return;if(this._movingAnchorName==="rotater"){const E=this._getNodeRect();n=a.x()-E.width/2,r=-a.y()+E.height/2;let A=Math.atan2(-r,n)+Math.PI/2;E.height<0&&(A-=Math.PI);const k=Ot.getAngle(this.rotation())+A,I=Ot.getAngle(this.rotationSnapTolerance()),M=Vk(this.rotationSnaps(),k,I)-E.rotation,F=Wk(E,M);this._fitNodesInto(F,e);return}const g=this.shiftBehavior();let v;g==="inverted"?v=this.keepRatio()&&!e.shiftKey:g==="none"?v=this.keepRatio():v=this.keepRatio()||e.shiftKey;let p=this.centeredScaling()||e.altKey;if(this._movingAnchorName==="top-left"){if(v){const E=p?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(E.x-a.x(),2)+Math.pow(E.y-a.y(),2));const A=this.findOne(".top-left").x()>E.x?-1:1,S=this.findOne(".top-left").y()>E.y?-1:1;n=i*this.cos*A,r=i*this.sin*S,this.findOne(".top-left").x(E.x-n),this.findOne(".top-left").y(E.y-r)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(a.y());else if(this._movingAnchorName==="top-right"){if(v){const E=p?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(a.x()-E.x,2)+Math.pow(E.y-a.y(),2));const A=this.findOne(".top-right").x()<E.x?-1:1,S=this.findOne(".top-right").y()>E.y?-1:1;n=i*this.cos*A,r=i*this.sin*S,this.findOne(".top-right").x(E.x+n),this.findOne(".top-right").y(E.y-r)}var y=a.position();this.findOne(".top-left").y(y.y),this.findOne(".bottom-right").x(y.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(a.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(a.x());else if(this._movingAnchorName==="bottom-left"){if(v){const E=p?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(E.x-a.x(),2)+Math.pow(a.y()-E.y,2));const A=E.x<a.x()?-1:1,S=a.y()<E.y?-1:1;n=i*this.cos*A,r=i*this.sin*S,a.x(E.x-n),a.y(E.y+r)}y=a.position(),this.findOne(".top-left").x(y.x),this.findOne(".bottom-right").y(y.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(a.y());else if(this._movingAnchorName==="bottom-right"){if(v){const E=p?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};i=Math.sqrt(Math.pow(a.x()-E.x,2)+Math.pow(a.y()-E.y,2));const A=this.findOne(".bottom-right").x()<E.x?-1:1,S=this.findOne(".bottom-right").y()<E.y?-1:1;n=i*this.cos*A,r=i*this.sin*S,this.findOne(".bottom-right").x(E.x+n),this.findOne(".bottom-right").y(E.y+r)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));if(p=this.centeredScaling()||e.altKey,p){const E=this.findOne(".top-left"),A=this.findOne(".bottom-right"),S=E.x(),k=E.y(),I=this.getWidth()-A.x(),O=this.getHeight()-A.y();A.move({x:-S,y:-k}),E.move({x:I,y:O})}const _=this.findOne(".top-left").getAbsolutePosition();n=_.x,r=_.y;const x=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),b=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:n,y:r,width:x,height:b,rotation:Ot.getAngle(this.rotation())},e)}_handleMouseUp(e){this._removeEvents(e)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(e){var n;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));const r=this.getNode();dm--,this._fire("transformend",{evt:e,target:r}),(n=this.getLayer())===null||n===void 0||n.batchDraw(),r&&this._nodes.forEach(i=>{var a;i._fire("transformend",{evt:e,target:i}),(a=i.getLayer())===null||a===void 0||a.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(e,n){const r=this._getNodeRect(),i=1;if(Ze._inRange(e.width,-this.padding()*2-i,i)){this.update();return}if(Ze._inRange(e.height,-this.padding()*2-i,i)){this.update();return}const a=new rl;if(a.rotate(Ot.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){const v=a.point({x:-this.padding()*2,y:0});e.x+=v.x,e.y+=v.y,e.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=v.x,this._anchorDragOffset.y-=v.y}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){const v=a.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=v.x,this._anchorDragOffset.y-=v.y,e.width+=this.padding()*2}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){const v=a.point({x:0,y:-this.padding()*2});e.x+=v.x,e.y+=v.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=v.x,this._anchorDragOffset.y-=v.y,e.height+=this.padding()*2}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const v=a.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=v.x,this._anchorDragOffset.y-=v.y,e.height+=this.padding()*2}if(this.boundBoxFunc()){const v=this.boundBoxFunc()(r,e);v?e=v:Ze.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const o=1e7,s=new rl;s.translate(r.x,r.y),s.rotate(r.rotation),s.scale(r.width/o,r.height/o);const u=new rl,h=e.width/o,f=e.height/o;this.flipEnabled()===!1?(u.translate(e.x,e.y),u.rotate(e.rotation),u.translate(e.width<0?e.width:0,e.height<0?e.height:0),u.scale(Math.abs(h),Math.abs(f))):(u.translate(e.x,e.y),u.rotate(e.rotation),u.scale(h,f));const g=u.multiply(s.invert());this._nodes.forEach(v=>{var p;if(!v.getStage())return;const y=v.getParent().getAbsoluteTransform(),_=v.getTransform().copy();_.translate(v.offsetX(),v.offsetY());const x=new rl;x.multiply(y.copy().invert()).multiply(g).multiply(y).multiply(_);const b=x.decompose();v.setAttrs(b),(p=v.getLayer())===null||p===void 0||p.batchDraw()}),this.rotation(Ze._getRotation(e.rotation)),this._nodes.forEach(v=>{this._fire("transform",{evt:n,target:v}),v._fire("transform",{evt:n,target:v})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,n){this.findOne(e).setAttrs(n)}update(){var e;const n=this._getNodeRect();this.rotation(Ze._getRotation(n.rotation));const r=n.width,i=n.height,a=this.enabledAnchors(),o=this.resizeEnabled(),s=this.padding(),u=this.anchorSize(),h=this.find("._anchor");h.forEach(g=>{g.setAttrs({width:u,height:u,offsetX:u/2,offsetY:u/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:u/2+s,offsetY:u/2+s,visible:o&&a.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:r/2,y:0,offsetY:u/2+s,visible:o&&a.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:r,y:0,offsetX:u/2-s,offsetY:u/2+s,visible:o&&a.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:u/2+s,visible:o&&a.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:r,y:i/2,offsetX:u/2-s,visible:o&&a.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:u/2+s,offsetY:u/2-s,visible:o&&a.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:r/2,y:i,offsetY:u/2-s,visible:o&&a.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:r,y:i,offsetX:u/2-s,offsetY:u/2-s,visible:o&&a.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:r/2,y:-this.rotateAnchorOffset()*Ze._sign(i)-s,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:r,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),draggable:this.nodes().some(g=>g.draggable()),x:0,y:0});const f=this.anchorStyleFunc();f&&h.forEach(g=>{f(g)}),(e=this.getLayer())===null||e===void 0||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const e=this.findOne("."+this._movingAnchorName);e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),pd.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return At.prototype.toObject.call(this)}clone(e){return At.prototype.clone.call(this,e)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};er.isTransforming=()=>dm>0;function Yk(t){return t instanceof Array||Ze.warn("enabledAnchors value should be an array"),t instanceof Array&&t.forEach(function(e){g0.indexOf(e)===-1&&Ze.warn("Unknown anchor name: "+e+". Available names are: "+g0.join(", "))}),t||[]}er.prototype.className="Transformer";Fi(er);je.addGetterSetter(er,"enabledAnchors",g0,Yk);je.addGetterSetter(er,"flipEnabled",!0,au());je.addGetterSetter(er,"resizeEnabled",!0);je.addGetterSetter(er,"anchorSize",10,Et());je.addGetterSetter(er,"rotateEnabled",!0);je.addGetterSetter(er,"rotateLineVisible",!0);je.addGetterSetter(er,"rotationSnaps",[]);je.addGetterSetter(er,"rotateAnchorOffset",50,Et());je.addGetterSetter(er,"rotateAnchorCursor","crosshair");je.addGetterSetter(er,"rotationSnapTolerance",5,Et());je.addGetterSetter(er,"borderEnabled",!0);je.addGetterSetter(er,"anchorStroke","rgb(0, 161, 255)");je.addGetterSetter(er,"anchorStrokeWidth",1,Et());je.addGetterSetter(er,"anchorFill","white");je.addGetterSetter(er,"anchorCornerRadius",0,Et());je.addGetterSetter(er,"borderStroke","rgb(0, 161, 255)");je.addGetterSetter(er,"borderStrokeWidth",1,Et());je.addGetterSetter(er,"borderDash");je.addGetterSetter(er,"keepRatio",!0);je.addGetterSetter(er,"shiftBehavior","default");je.addGetterSetter(er,"centeredScaling",!1);je.addGetterSetter(er,"ignoreStroke",!1);je.addGetterSetter(er,"padding",0,Et());je.addGetterSetter(er,"nodes");je.addGetterSetter(er,"node");je.addGetterSetter(er,"boundBoxFunc");je.addGetterSetter(er,"anchorDragBoundFunc");je.addGetterSetter(er,"anchorStyleFunc");je.addGetterSetter(er,"shouldOverdrawWholeArea",!1);je.addGetterSetter(er,"useSingleNodeRotation",!0);je.backCompat(er,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class Sc extends mt{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,Ot.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}Sc.prototype.className="Wedge";Sc.prototype._centroid=!0;Sc.prototype._attrsAffectingSize=["radius"];Fi(Sc);je.addGetterSetter(Sc,"radius",0,Et());je.addGetterSetter(Sc,"angle",0,Et());je.addGetterSetter(Sc,"clockwise",!1);je.backCompat(Sc,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function n3(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const Xk=[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],Kk=[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 Zk(t,e){const n=t.data,r=t.width,i=t.height;let a,o,s,u,h,f,g,v,p,y,_,x,b,E,A,S,k,I,O,M;const F=e+e+1,j=r-1,T=i-1,L=e+1,$=L*(L+1)/2,q=new n3,J=Xk[e],ae=Kk[e];let ie=null,Z=q,te=null,V=null;for(let B=1;B<F;B++)Z=Z.next=new n3,B===L&&(ie=Z);Z.next=q,s=o=0;for(let B=0;B<i;B++){x=b=E=A=u=h=f=g=0,v=L*(S=n[o]),p=L*(k=n[o+1]),y=L*(I=n[o+2]),_=L*(O=n[o+3]),u+=$*S,h+=$*k,f+=$*I,g+=$*O,Z=q;for(let D=0;D<L;D++)Z.r=S,Z.g=k,Z.b=I,Z.a=O,Z=Z.next;for(let D=1;D<L;D++)a=o+((j<D?j:D)<<2),u+=(Z.r=S=n[a])*(M=L-D),h+=(Z.g=k=n[a+1])*M,f+=(Z.b=I=n[a+2])*M,g+=(Z.a=O=n[a+3])*M,x+=S,b+=k,E+=I,A+=O,Z=Z.next;te=q,V=ie;for(let D=0;D<r;D++)n[o+3]=O=g*J>>ae,O!==0?(O=255/O,n[o]=(u*J>>ae)*O,n[o+1]=(h*J>>ae)*O,n[o+2]=(f*J>>ae)*O):n[o]=n[o+1]=n[o+2]=0,u-=v,h-=p,f-=y,g-=_,v-=te.r,p-=te.g,y-=te.b,_-=te.a,a=s+((a=D+e+1)<j?a:j)<<2,x+=te.r=n[a],b+=te.g=n[a+1],E+=te.b=n[a+2],A+=te.a=n[a+3],u+=x,h+=b,f+=E,g+=A,te=te.next,v+=S=V.r,p+=k=V.g,y+=I=V.b,_+=O=V.a,x-=S,b-=k,E-=I,A-=O,V=V.next,o+=4;s+=r}for(let B=0;B<r;B++){b=E=A=x=h=f=g=u=0,o=B<<2,v=L*(S=n[o]),p=L*(k=n[o+1]),y=L*(I=n[o+2]),_=L*(O=n[o+3]),u+=$*S,h+=$*k,f+=$*I,g+=$*O,Z=q;for(let U=0;U<L;U++)Z.r=S,Z.g=k,Z.b=I,Z.a=O,Z=Z.next;let D=r;for(let U=1;U<=e;U++)o=D+B<<2,u+=(Z.r=S=n[o])*(M=L-U),h+=(Z.g=k=n[o+1])*M,f+=(Z.b=I=n[o+2])*M,g+=(Z.a=O=n[o+3])*M,x+=S,b+=k,E+=I,A+=O,Z=Z.next,U<T&&(D+=r);o=B,te=q,V=ie;for(let U=0;U<i;U++)a=o<<2,n[a+3]=O=g*J>>ae,O>0?(O=255/O,n[a]=(u*J>>ae)*O,n[a+1]=(h*J>>ae)*O,n[a+2]=(f*J>>ae)*O):n[a]=n[a+1]=n[a+2]=0,u-=v,h-=p,f-=y,g-=_,v-=te.r,p-=te.g,y-=te.b,_-=te.a,a=B+((a=U+L)<T?a:T)*r<<2,u+=x+=te.r=n[a],h+=b+=te.g=n[a+1],f+=E+=te.b=n[a+2],g+=A+=te.a=n[a+3],te=te.next,v+=S=V.r,p+=k=V.g,y+=I=V.b,_+=O=V.a,x-=S,b-=k,E-=I,A-=O,V=V.next,o+=r}}const Qk=function(e){const n=Math.round(this.blurRadius());n>0&&Zk(e,n)};je.addGetterSetter(At,"blurRadius",0,Et(),je.afterSetFilter);const Jk=function(t){const e=this.brightness()*255,n=t.data,r=n.length;for(let i=0;i<r;i+=4)n[i]+=e,n[i+1]+=e,n[i+2]+=e};je.addGetterSetter(At,"brightness",0,Et(),je.afterSetFilter);const eA=function(t){const e=this.brightness(),n=t.data,r=n.length;for(let i=0;i<r;i+=4)n[i]=Math.min(255,n[i]*e),n[i+1]=Math.min(255,n[i+1]*e),n[i+2]=Math.min(255,n[i+2]*e)},tA=function(t){const e=Math.pow((this.contrast()+100)/100,2),n=t.data,r=n.length;let i=150,a=150,o=150;for(let s=0;s<r;s+=4)i=n[s],a=n[s+1],o=n[s+2],i/=255,i-=.5,i*=e,i+=.5,i*=255,a/=255,a-=.5,a*=e,a+=.5,a*=255,o/=255,o-=.5,o*=e,o+=.5,o*=255,i=i<0?0:i>255?255:i,a=a<0?0:a>255?255:a,o=o<0?0:o>255?255:o,n[s]=i,n[s+1]=a,n[s+2]=o};je.addGetterSetter(At,"contrast",0,Et(),je.afterSetFilter);const nA=function(t){var e,n,r,i,a,o,s,u,h;const f=t.data,g=t.width,v=t.height,p=Math.min(1,Math.max(0,(n=(e=this.embossStrength)===null||e===void 0?void 0:e.call(this))!==null&&n!==void 0?n:.5)),y=Math.min(1,Math.max(0,(i=(r=this.embossWhiteLevel)===null||r===void 0?void 0:r.call(this))!==null&&i!==void 0?i:.5)),x=(s={"top-left":315,top:270,"top-right":225,right:180,"bottom-right":135,bottom:90,"bottom-left":45,left:0}[(o=(a=this.embossDirection)===null||a===void 0?void 0:a.call(this))!==null&&o!==void 0?o:"top-left"])!==null&&s!==void 0?s:315,b=!!((h=(u=this.embossBlend)===null||u===void 0?void 0:u.call(this))!==null&&h!==void 0&&h),E=p*10,A=y*255,S=x*Math.PI/180,k=Math.cos(S),I=Math.sin(S),O=128/1020*E,M=new Uint8ClampedArray(f),F=new Float32Array(g*v);for(let q=0,J=0;J<f.length;J+=4,q++)F[q]=.2126*M[J]+.7152*M[J+1]+.0722*M[J+2];const j=[-1,0,1,-2,0,2,-1,0,1],T=[-1,-2,-1,0,0,0,1,2,1],L=[-g-1,-g,-g+1,-1,0,1,g-1,g,g+1],$=q=>q<0?0:q>255?255:q;for(let q=1;q<v-1;q++)for(let J=1;J<g-1;J++){const ae=q*g+J;let ie=0,Z=0;ie+=F[ae+L[0]]*j[0],Z+=F[ae+L[0]]*T[0],ie+=F[ae+L[1]]*j[1],Z+=F[ae+L[1]]*T[1],ie+=F[ae+L[2]]*j[2],Z+=F[ae+L[2]]*T[2],ie+=F[ae+L[3]]*j[3],Z+=F[ae+L[3]]*T[3],ie+=F[ae+L[5]]*j[5],Z+=F[ae+L[5]]*T[5],ie+=F[ae+L[6]]*j[6],Z+=F[ae+L[6]]*T[6],ie+=F[ae+L[7]]*j[7],Z+=F[ae+L[7]]*T[7],ie+=F[ae+L[8]]*j[8],Z+=F[ae+L[8]]*T[8];const te=k*ie+I*Z,V=$(A+te*O),B=ae*4;if(b){const D=V-A;f[B]=$(M[B]+D),f[B+1]=$(M[B+1]+D),f[B+2]=$(M[B+2]+D),f[B+3]=M[B+3]}else f[B]=f[B+1]=f[B+2]=V,f[B+3]=M[B+3]}for(let q=0;q<g;q++){let J=q*4,ae=((v-1)*g+q)*4;f[J]=M[J],f[J+1]=M[J+1],f[J+2]=M[J+2],f[J+3]=M[J+3],f[ae]=M[ae],f[ae+1]=M[ae+1],f[ae+2]=M[ae+2],f[ae+3]=M[ae+3]}for(let q=1;q<v-1;q++){let J=q*g*4,ae=(q*g+(g-1))*4;f[J]=M[J],f[J+1]=M[J+1],f[J+2]=M[J+2],f[J+3]=M[J+3],f[ae]=M[ae],f[ae+1]=M[ae+1],f[ae+2]=M[ae+2],f[ae+3]=M[ae+3]}return t};je.addGetterSetter(At,"embossStrength",.5,Et(),je.afterSetFilter);je.addGetterSetter(At,"embossWhiteLevel",.5,Et(),je.afterSetFilter);je.addGetterSetter(At,"embossDirection","top-left",void 0,je.afterSetFilter);je.addGetterSetter(At,"embossBlend",!1,void 0,je.afterSetFilter);function Yg(t,e,n,r,i){const a=n-e,o=i-r;if(a===0)return r+o/2;if(o===0)return r;let s=(t-e)/a;return s=o*s+r,s}const rA=function(t){const e=t.data,n=e.length;let r=e[0],i=r,a,o=e[1],s=o,u,h=e[2],f=h,g;const v=this.enhance();if(v===0)return;for(let A=0;A<n;A+=4)a=e[A+0],a<r?r=a:a>i&&(i=a),u=e[A+1],u<o?o=u:u>s&&(s=u),g=e[A+2],g<h?h=g:g>f&&(f=g);i===r&&(i=255,r=0),s===o&&(s=255,o=0),f===h&&(f=255,h=0);let p,y,_,x,b,E;if(v>0)p=i+v*(255-i),y=r-v*(r-0),_=s+v*(255-s),x=o-v*(o-0),b=f+v*(255-f),E=h-v*(h-0);else{const A=(i+r)*.5;p=i+v*(i-A),y=r+v*(r-A);const S=(s+o)*.5;_=s+v*(s-S),x=o+v*(o-S);const k=(f+h)*.5;b=f+v*(f-k),E=h+v*(h-k)}for(let A=0;A<n;A+=4)e[A+0]=Yg(e[A+0],r,i,y,p),e[A+1]=Yg(e[A+1],o,s,x,_),e[A+2]=Yg(e[A+2],h,f,E,b)};je.addGetterSetter(At,"enhance",0,Et(),je.afterSetFilter);const iA=function(t){const e=t.data,n=e.length;for(let r=0;r<n;r+=4){const i=.34*e[r]+.5*e[r+1]+.16*e[r+2];e[r]=i,e[r+1]=i,e[r+2]=i}};je.addGetterSetter(At,"hue",0,Et(),je.afterSetFilter);je.addGetterSetter(At,"saturation",0,Et(),je.afterSetFilter);je.addGetterSetter(At,"luminance",0,Et(),je.afterSetFilter);const aA=function(t){const e=t.data,n=e.length,r=1,i=Math.pow(2,this.saturation()),a=Math.abs(this.hue()+360)%360,o=this.luminance()*127,s=r*i*Math.cos(a*Math.PI/180),u=r*i*Math.sin(a*Math.PI/180),h=.299*r+.701*s+.167*u,f=.587*r-.587*s+.33*u,g=.114*r-.114*s-.497*u,v=.299*r-.299*s-.328*u,p=.587*r+.413*s+.035*u,y=.114*r-.114*s+.293*u,_=.299*r-.3*s+1.25*u,x=.587*r-.586*s-1.05*u,b=.114*r+.886*s-.2*u;let E,A,S,k;for(let I=0;I<n;I+=4)E=e[I+0],A=e[I+1],S=e[I+2],k=e[I+3],e[I+0]=h*E+f*A+g*S+o,e[I+1]=v*E+p*A+y*S+o,e[I+2]=_*E+x*A+b*S+o,e[I+3]=k},oA=function(t){const e=t.data,n=e.length,r=Math.pow(2,this.value()),i=Math.pow(2,this.saturation()),a=Math.abs(this.hue()+360)%360,o=r*i*Math.cos(a*Math.PI/180),s=r*i*Math.sin(a*Math.PI/180),u=.299*r+.701*o+.167*s,h=.587*r-.587*o+.33*s,f=.114*r-.114*o-.497*s,g=.299*r-.299*o-.328*s,v=.587*r+.413*o+.035*s,p=.114*r-.114*o+.293*s,y=.299*r-.3*o+1.25*s,_=.587*r-.586*o-1.05*s,x=.114*r+.886*o-.2*s;for(let b=0;b<n;b+=4){const E=e[b+0],A=e[b+1],S=e[b+2],k=e[b+3];e[b+0]=u*E+h*A+f*S,e[b+1]=g*E+v*A+p*S,e[b+2]=y*E+_*A+x*S,e[b+3]=k}};je.addGetterSetter(At,"hue",0,Et(),je.afterSetFilter);je.addGetterSetter(At,"saturation",0,Et(),je.afterSetFilter);je.addGetterSetter(At,"value",0,Et(),je.afterSetFilter);const sA=function(t){const e=t.data,n=e.length;for(let r=0;r<n;r+=4)e[r]=255-e[r],e[r+1]=255-e[r+1],e[r+2]=255-e[r+2]},lA=function(t,e,n){const r=t.data,i=e.data,a=t.width,o=t.height,s=n.polarCenterX||a/2,u=n.polarCenterY||o/2;let h=Math.sqrt(s*s+u*u),f=a-s,g=o-u;const v=Math.sqrt(f*f+g*g);h=v>h?v:h;const p=o,y=a,_=360/y*Math.PI/180;for(let x=0;x<y;x+=1){const b=Math.sin(x*_),E=Math.cos(x*_);for(let A=0;A<p;A+=1){f=Math.floor(s+h*A/p*E),g=Math.floor(u+h*A/p*b);let S=(g*a+f)*4;const k=r[S+0],I=r[S+1],O=r[S+2],M=r[S+3];S=(x+A*a)*4,i[S+0]=k,i[S+1]=I,i[S+2]=O,i[S+3]=M}}},uA=function(t,e,n){const r=t.data,i=e.data,a=t.width,o=t.height,s=n.polarCenterX||a/2,u=n.polarCenterY||o/2;let h=Math.sqrt(s*s+u*u),f=a-s,g=o-u;const v=Math.sqrt(f*f+g*g);h=v>h?v:h;const p=o,y=a,_=0;let x,b;for(f=0;f<a;f+=1)for(g=0;g<o;g+=1){const E=f-s,A=g-u,S=Math.sqrt(E*E+A*A)*p/h;let k=(Math.atan2(A,E)*180/Math.PI+360+_)%360;k=k*y/360,x=Math.floor(k),b=Math.floor(S);let I=(b*a+x)*4;const O=r[I+0],M=r[I+1],F=r[I+2],j=r[I+3];I=(g*a+f)*4,i[I+0]=O,i[I+1]=M,i[I+2]=F,i[I+3]=j}},cA=function(t){const e=t.width,n=t.height;let r,i,a,o,s,u,h,f,g,v,p=Math.round(this.kaleidoscopePower());const y=Math.round(this.kaleidoscopeAngle()),_=Math.floor(e*(y%360)/360);if(p<1)return;const x=Ze.createCanvasElement();x.width=e,x.height=n;const b=x.getContext("2d").getImageData(0,0,e,n);Ze.releaseCanvas(x),lA(t,b,{polarCenterX:e/2,polarCenterY:n/2});let E=e/Math.pow(2,p);for(;E<=8;)E=E*2,p-=1;E=Math.ceil(E);let A=E,S=0,k=A,I=1;for(_+E>e&&(S=A,k=0,I=-1),i=0;i<n;i+=1)for(r=S;r!==k;r+=I)a=Math.round(r+_)%e,g=(e*i+a)*4,s=b.data[g+0],u=b.data[g+1],h=b.data[g+2],f=b.data[g+3],v=(e*i+r)*4,b.data[v+0]=s,b.data[v+1]=u,b.data[v+2]=h,b.data[v+3]=f;for(i=0;i<n;i+=1)for(A=Math.floor(E),o=0;o<p;o+=1){for(r=0;r<A+1;r+=1)g=(e*i+r)*4,s=b.data[g+0],u=b.data[g+1],h=b.data[g+2],f=b.data[g+3],v=(e*i+A*2-r-1)*4,b.data[v+0]=s,b.data[v+1]=u,b.data[v+2]=h,b.data[v+3]=f;A*=2}uA(b,t,{})};je.addGetterSetter(At,"kaleidoscopePower",2,Et(),je.afterSetFilter);je.addGetterSetter(At,"kaleidoscopeAngle",0,Et(),je.afterSetFilter);function P1(t,e,n){let r=(n*t.width+e)*4;const i=[];return i.push(t.data[r++],t.data[r++],t.data[r++],t.data[r++]),i}function Bd(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2))}function fA(t){const e=[0,0,0];for(let n=0;n<t.length;n++)e[0]+=t[n][0],e[1]+=t[n][1],e[2]+=t[n][2];return e[0]/=t.length,e[1]/=t.length,e[2]/=t.length,e}function hA(t,e){const n=P1(t,0,0),r=P1(t,t.width-1,0),i=P1(t,0,t.height-1),a=P1(t,t.width-1,t.height-1),o=e||10;if(Bd(n,r)<o&&Bd(r,a)<o&&Bd(a,i)<o&&Bd(i,n)<o){const s=fA([r,n,a,i]),u=[];for(let h=0;h<t.width*t.height;h++){const f=Bd(s,[t.data[h*4],t.data[h*4+1],t.data[h*4+2]]);u[h]=f<o?0:255}return u}}function dA(t,e){for(let n=0;n<t.width*t.height;n++)t.data[4*n+3]=e[n]}function pA(t,e,n){const r=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(r.length)),a=Math.floor(i/2),o=[];for(let s=0;s<n;s++)for(let u=0;u<e;u++){const h=s*e+u;let f=0;for(let g=0;g<i;g++)for(let v=0;v<i;v++){const p=s+g-a,y=u+v-a;if(p>=0&&p<n&&y>=0&&y<e){const _=p*e+y,x=r[g*i+v];f+=t[_]*x}}o[h]=f===2040?255:0}return o}function gA(t,e,n){const r=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(r.length)),a=Math.floor(i/2),o=[];for(let s=0;s<n;s++)for(let u=0;u<e;u++){const h=s*e+u;let f=0;for(let g=0;g<i;g++)for(let v=0;v<i;v++){const p=s+g-a,y=u+v-a;if(p>=0&&p<n&&y>=0&&y<e){const _=p*e+y,x=r[g*i+v];f+=t[_]*x}}o[h]=f>=1020?255:0}return o}function vA(t,e,n){const r=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(r.length)),a=Math.floor(i/2),o=[];for(let s=0;s<n;s++)for(let u=0;u<e;u++){const h=s*e+u;let f=0;for(let g=0;g<i;g++)for(let v=0;v<i;v++){const p=s+g-a,y=u+v-a;if(p>=0&&p<n&&y>=0&&y<e){const _=p*e+y,x=r[g*i+v];f+=t[_]*x}}o[h]=f}return o}const mA=function(t){const e=this.threshold();let n=hA(t,e);return n&&(n=pA(n,t.width,t.height),n=gA(n,t.width,t.height),n=vA(n,t.width,t.height),dA(t,n)),t};je.addGetterSetter(At,"threshold",0,Et(),je.afterSetFilter);const yA=function(t){const e=this.noise()*255,n=t.data,r=n.length,i=e/2;for(let a=0;a<r;a+=4)n[a+0]+=i-2*i*Math.random(),n[a+1]+=i-2*i*Math.random(),n[a+2]+=i-2*i*Math.random()};je.addGetterSetter(At,"noise",.2,Et(),je.afterSetFilter);const bA=function(t){let e=Math.ceil(this.pixelSize()),n=t.width,r=t.height,i=Math.ceil(n/e),a=Math.ceil(r/e),o=t.data;if(e<=0){Ze.error("pixelSize value can not be <= 0");return}for(let s=0;s<i;s+=1)for(let u=0;u<a;u+=1){let h=0,f=0,g=0,v=0;const p=s*e,y=p+e,_=u*e,x=_+e;let b=0;for(let E=p;E<y;E+=1)if(!(E>=n))for(let A=_;A<x;A+=1){if(A>=r)continue;const S=(n*A+E)*4;h+=o[S+0],f+=o[S+1],g+=o[S+2],v+=o[S+3],b+=1}h=h/b,f=f/b,g=g/b,v=v/b;for(let E=p;E<y;E+=1)if(!(E>=n))for(let A=_;A<x;A+=1){if(A>=r)continue;const S=(n*A+E)*4;o[S+0]=h,o[S+1]=f,o[S+2]=g,o[S+3]=v}}};je.addGetterSetter(At,"pixelSize",8,Et(),je.afterSetFilter);const wA=function(t){const e=Math.round(this.levels()*254)+1,n=t.data,r=n.length,i=255/e;for(let a=0;a<r;a+=1)n[a]=Math.floor(n[a]/i)*i};je.addGetterSetter(At,"levels",.5,Et(),je.afterSetFilter);const _A=function(t){const e=t.data,n=e.length,r=this.red(),i=this.green(),a=this.blue();for(let o=0;o<n;o+=4){const s=(.34*e[o]+.5*e[o+1]+.16*e[o+2])/255;e[o]=s*r,e[o+1]=s*i,e[o+2]=s*a,e[o+3]=e[o+3]}};je.addGetterSetter(At,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});je.addGetterSetter(At,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});je.addGetterSetter(At,"blue",0,Z6,je.afterSetFilter);const xA=function(t){const e=t.data,n=e.length,r=this.red(),i=this.green(),a=this.blue(),o=this.alpha();for(let s=0;s<n;s+=4){const u=1-o;e[s]=r*o+e[s]*u,e[s+1]=i*o+e[s+1]*u,e[s+2]=a*o+e[s+2]*u}};je.addGetterSetter(At,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});je.addGetterSetter(At,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});je.addGetterSetter(At,"blue",0,Z6,je.afterSetFilter);je.addGetterSetter(At,"alpha",1,function(t){return this._filterUpToDate=!1,t>1?1:t<0?0:t});const SA=function(t){const e=t.data,n=e.length;for(let r=0;r<n;r+=4){const i=e[r+0],a=e[r+1],o=e[r+2];e[r+0]=Math.min(255,i*.393+a*.769+o*.189),e[r+1]=Math.min(255,i*.349+a*.686+o*.168),e[r+2]=Math.min(255,i*.272+a*.534+o*.131)}},EA=function(t){const n=t.data;for(let r=0;r<n.length;r+=4){const i=n[r],a=n[r+1],o=n[r+2];.2126*i+.7152*a+.0722*o>=128&&(n[r]=255-i,n[r+1]=255-a,n[r+2]=255-o)}return t},kA=function(t){const e=this.threshold()*255,n=t.data,r=n.length;for(let i=0;i<r;i+=1)n[i]=n[i]<e?0:255};je.addGetterSetter(At,"threshold",.5,Et(),je.afterSetFilter);const sn=lh.Util._assign(lh,{Arc:_c,Arrow:wh,Circle:xd,Ellipse:Af,Image:$u,Label:Qm,Tag:_h,Line:xc,Path:Ol,Rect:Rp,RegularPolygon:Pf,Ring:xh,Sprite:Gu,Star:Of,Text:pi,TextPath:Da,Transformer:er,Wedge:Sc,Filters:{Blur:Qk,Brightness:eA,Brighten:Jk,Contrast:tA,Emboss:nA,Enhance:rA,Grayscale:iA,HSL:aA,HSV:oA,Invert:sA,Kaleidoscope:cA,Mask:mA,Noise:yA,Pixelate:bA,Posterize:wA,RGB:_A,RGBA:xA,Sepia:SA,Solarize:EA,Threshold:kA}});var Xg={exports:{}};/**
57
+ * @license React
58
+ * react-reconciler.production.min.js
59
+ *
60
+ * Copyright (c) Facebook, Inc. and its affiliates.
61
+ *
62
+ * This source code is licensed under the MIT license found in the
63
+ * LICENSE file in the root directory of this source tree.
64
+ */var Kg,r3;function AA(){return r3||(r3=1,Kg=function(e){var n={},r=Pp(),i=jm(),a=Object.assign;function o(d){for(var m="https://reactjs.org/docs/error-decoder.html?invariant="+d,C=1;C<arguments.length;C++)m+="&args[]="+encodeURIComponent(arguments[C]);return"Minified React error #"+d+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,u=Symbol.for("react.element"),h=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),p=Symbol.for("react.provider"),y=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),k=Symbol.iterator;function I(d){return d===null||typeof d!="object"?null:(d=k&&d[k]||d["@@iterator"],typeof d=="function"?d:null)}function O(d){if(d==null)return null;if(typeof d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case f:return"Fragment";case h:return"Portal";case v:return"Profiler";case g:return"StrictMode";case x:return"Suspense";case b:return"SuspenseList"}if(typeof d=="object")switch(d.$$typeof){case y:return(d.displayName||"Context")+".Consumer";case p:return(d._context.displayName||"Context")+".Provider";case _:var m=d.render;return d=d.displayName,d||(d=m.displayName||m.name||"",d=d!==""?"ForwardRef("+d+")":"ForwardRef"),d;case E:return m=d.displayName||null,m!==null?m:O(d.type)||"Memo";case A:m=d._payload,d=d._init;try{return O(d(m))}catch{}}return null}function M(d){var m=d.type;switch(d.tag){case 24:return"Cache";case 9:return(m.displayName||"Context")+".Consumer";case 10:return(m._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return d=m.render,d=d.displayName||d.name||"",m.displayName||(d!==""?"ForwardRef("+d+")":"ForwardRef");case 7:return"Fragment";case 5:return m;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return O(m);case 8:return m===g?"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 m=="function")return m.displayName||m.name||null;if(typeof m=="string")return m}return null}function F(d){var m=d,C=d;if(d.alternate)for(;m.return;)m=m.return;else{d=m;do m=d,(m.flags&4098)!==0&&(C=m.return),d=m.return;while(d)}return m.tag===3?C:null}function j(d){if(F(d)!==d)throw Error(o(188))}function T(d){var m=d.alternate;if(!m){if(m=F(d),m===null)throw Error(o(188));return m!==d?null:d}for(var C=d,z=m;;){var W=C.return;if(W===null)break;var re=W.alternate;if(re===null){if(z=W.return,z!==null){C=z;continue}break}if(W.child===re.child){for(re=W.child;re;){if(re===C)return j(W),d;if(re===z)return j(W),m;re=re.sibling}throw Error(o(188))}if(C.return!==z.return)C=W,z=re;else{for(var _e=!1,Ye=W.child;Ye;){if(Ye===C){_e=!0,C=W,z=re;break}if(Ye===z){_e=!0,z=W,C=re;break}Ye=Ye.sibling}if(!_e){for(Ye=re.child;Ye;){if(Ye===C){_e=!0,C=re,z=W;break}if(Ye===z){_e=!0,z=re,C=W;break}Ye=Ye.sibling}if(!_e)throw Error(o(189))}}if(C.alternate!==z)throw Error(o(190))}if(C.tag!==3)throw Error(o(188));return C.stateNode.current===C?d:m}function L(d){return d=T(d),d!==null?$(d):null}function $(d){if(d.tag===5||d.tag===6)return d;for(d=d.child;d!==null;){var m=$(d);if(m!==null)return m;d=d.sibling}return null}function q(d){if(d.tag===5||d.tag===6)return d;for(d=d.child;d!==null;){if(d.tag!==4){var m=q(d);if(m!==null)return m}d=d.sibling}return null}var J=Array.isArray,ae=e.getPublicInstance,ie=e.getRootHostContext,Z=e.getChildHostContext,te=e.prepareForCommit,V=e.resetAfterCommit,B=e.createInstance,D=e.appendInitialChild,U=e.finalizeInitialChildren,X=e.prepareUpdate,ee=e.shouldSetTextContent,K=e.createTextInstance,oe=e.scheduleTimeout,me=e.cancelTimeout,de=e.noTimeout,ye=e.isPrimaryRenderer,Re=e.supportsMutation,Oe=e.supportsPersistence,Me=e.supportsHydration,Ee=e.getInstanceFromNode,ge=e.preparePortalMount,Te=e.getCurrentEventPriority,Be=e.detachDeletedInstance,Ce=e.supportsMicrotasks,fe=e.scheduleMicrotask,Le=e.supportsTestSelectors,Ne=e.findFiberRoot,ue=e.getBoundingRect,Ae=e.getTextContent,Pe=e.isHiddenSubtree,Ue=e.matchAccessibilityRole,st=e.setFocusIfFocusable,dt=e.setupIntersectionObserver,pt=e.appendChild,xt=e.appendChildToContainer,bt=e.commitTextUpdate,kt=e.commitMount,qn=e.commitUpdate,xn=e.insertBefore,It=e.insertInContainerBefore,Jt=e.removeChild,Ve=e.removeChildFromContainer,qe=e.resetTextContent,Nt=e.hideInstance,Ct=e.hideTextInstance,an=e.unhideInstance,Ut=e.unhideTextInstance,Sn=e.clearContainer,en=e.cloneInstance,gn=e.createContainerChildSet,Bi=e.appendChildToContainerChildSet,oi=e.finalizeContainerChildren,Ei=e.replaceContainerChildren,Sr=e.cloneHiddenInstance,Qt=e.cloneHiddenTextInstance,ca=e.canHydrateInstance,Fa=e.canHydrateTextInstance,Kr=e.canHydrateSuspenseInstance,Yi=e.isSuspenseInstancePending,Un=e.isSuspenseInstanceFallback,Er=e.getSuspenseInstanceFallbackErrorDetails,Rr=e.registerSuspenseInstanceRetry,Sa=e.getNextHydratableSibling,Ho=e.getFirstHydratableChild,Ea=e.getFirstHydratableChildWithinContainer,eo=e.getFirstHydratableChildWithinSuspenseInstance,si=e.hydrateInstance,ka=e.hydrateTextInstance,Aa=e.hydrateSuspenseInstance,$o=e.getNextHydratableInstanceAfterSuspenseInstance,zi=e.commitHydratedContainer,to=e.commitHydratedSuspenseInstance,Bs=e.clearSuspenseBoundary,is=e.clearSuspenseBoundaryFromContainer,lu=e.shouldDeleteUnhydratedTailInstances,Tf=e.didNotMatchHydratedContainerTextInstance,kr=e.didNotMatchHydratedTextInstance,uu;function as(d){if(uu===void 0)try{throw Error()}catch(C){var m=C.stack.trim().match(/\n( *(at )?)/);uu=m&&m[1]||""}return`
65
+ `+uu+d}var Pa=!1;function os(d,m){if(!d||Pa)return"";Pa=!0;var C=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(m)if(m=function(){throw Error()},Object.defineProperty(m.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(m,[])}catch(wt){var z=wt}Reflect.construct(d,[],m)}else{try{m.call()}catch(wt){z=wt}d.call(m.prototype)}else{try{throw Error()}catch(wt){z=wt}d()}}catch(wt){if(wt&&z&&typeof wt.stack=="string"){for(var W=wt.stack.split(`
66
+ `),re=z.stack.split(`
67
+ `),_e=W.length-1,Ye=re.length-1;1<=_e&&0<=Ye&&W[_e]!==re[Ye];)Ye--;for(;1<=_e&&0<=Ye;_e--,Ye--)if(W[_e]!==re[Ye]){if(_e!==1||Ye!==1)do if(_e--,Ye--,0>Ye||W[_e]!==re[Ye]){var it=`
68
+ `+W[_e].replace(" at new "," at ");return d.displayName&&it.includes("<anonymous>")&&(it=it.replace("<anonymous>",d.displayName)),it}while(1<=_e&&0<=Ye);break}}}finally{Pa=!1,Error.prepareStackTrace=C}return(d=d?d.displayName||d.name:"")?as(d):""}var kc=Object.prototype.hasOwnProperty,ll=[],_o=-1;function gi(d){return{current:d}}function cr(d){0>_o||(d.current=ll[_o],ll[_o]=null,_o--)}function En(d,m){_o++,ll[_o]=d.current,d.current=m}var ss={},Rn=gi(ss),Xi=gi(!1),no=ss;function Ki(d,m){var C=d.type.contextTypes;if(!C)return ss;var z=d.stateNode;if(z&&z.__reactInternalMemoizedUnmaskedChildContext===m)return z.__reactInternalMemoizedMaskedChildContext;var W={},re;for(re in C)W[re]=m[re];return z&&(d=d.stateNode,d.__reactInternalMemoizedUnmaskedChildContext=m,d.__reactInternalMemoizedMaskedChildContext=W),W}function Mr(d){return d=d.childContextTypes,d!=null}function Zi(){cr(Xi),cr(Rn)}function ul(d,m,C){if(Rn.current!==ss)throw Error(o(168));En(Rn,m),En(Xi,C)}function Zr(d,m,C){var z=d.stateNode;if(m=m.childContextTypes,typeof z.getChildContext!="function")return C;z=z.getChildContext();for(var W in z)if(!(W in m))throw Error(o(108,M(d)||"Unknown",W));return a({},C,z)}function ls(d){return d=(d=d.stateNode)&&d.__reactInternalMemoizedMergedChildContext||ss,no=Rn.current,En(Rn,d),En(Xi,Xi.current),!0}function Vu(d,m,C){var z=d.stateNode;if(!z)throw Error(o(169));C?(d=Zr(d,m,no),z.__reactInternalMemoizedMergedChildContext=d,cr(Xi),cr(Rn),En(Rn,d)):cr(Xi),En(Xi,C)}var Oa=Math.clz32?Math.clz32:cu,Tl=Math.log,us=Math.LN2;function cu(d){return d>>>=0,d===0?32:31-(Tl(d)/us|0)|0}var Mn=64,xo=4194304;function cs(d){switch(d&-d){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 d&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return d&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return d}}function cl(d,m){var C=d.pendingLanes;if(C===0)return 0;var z=0,W=d.suspendedLanes,re=d.pingedLanes,_e=C&268435455;if(_e!==0){var Ye=_e&~W;Ye!==0?z=cs(Ye):(re&=_e,re!==0&&(z=cs(re)))}else _e=C&~W,_e!==0?z=cs(_e):re!==0&&(z=cs(re));if(z===0)return 0;if(m!==0&&m!==z&&(m&W)===0&&(W=z&-z,re=m&-m,W>=re||W===16&&(re&4194240)!==0))return m;if((z&4)!==0&&(z|=C&16),m=d.entangledLanes,m!==0)for(d=d.entanglements,m&=z;0<m;)C=31-Oa(m),W=1<<C,z|=d[C],m&=~W;return z}function Ac(d,m){switch(d){case 1:case 2:case 4:return m+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 m+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 Pc(d,m){for(var C=d.suspendedLanes,z=d.pingedLanes,W=d.expirationTimes,re=d.pendingLanes;0<re;){var _e=31-Oa(re),Ye=1<<_e,it=W[_e];it===-1?((Ye&C)===0||(Ye&z)!==0)&&(W[_e]=Ac(Ye,m)):it<=m&&(d.expiredLanes|=Ye),re&=~Ye}}function fl(d){return d=d.pendingLanes&-1073741825,d!==0?d:d&1073741824?1073741824:0}function fs(){var d=Mn;return Mn<<=1,(Mn&4194240)===0&&(Mn=64),d}function ro(d){for(var m=[],C=0;31>C;C++)m.push(d);return m}function Ba(d,m,C){d.pendingLanes|=m,m!==536870912&&(d.suspendedLanes=0,d.pingedLanes=0),d=d.eventTimes,m=31-Oa(m),d[m]=C}function za(d,m){var C=d.pendingLanes&~m;d.pendingLanes=m,d.suspendedLanes=0,d.pingedLanes=0,d.expiredLanes&=m,d.mutableReadLanes&=m,d.entangledLanes&=m,m=d.entanglements;var z=d.eventTimes;for(d=d.expirationTimes;0<C;){var W=31-Oa(C),re=1<<W;m[W]=0,z[W]=-1,d[W]=-1,C&=~re}}function qa(d,m){var C=d.entangledLanes|=m;for(d=d.entanglements;C;){var z=31-Oa(C),W=1<<z;W&m|d[z]&m&&(d[z]|=m),C&=~W}}var Pt=0;function hl(d){return d&=-d,1<d?4<d?(d&268435455)!==0?16:536870912:4:1}var So=i.unstable_scheduleCallback,Oc=i.unstable_cancelCallback,Cc=i.unstable_shouldYield,io=i.unstable_requestPaint,wr=i.unstable_now,fu=i.unstable_ImmediatePriority,hu=i.unstable_UserBlockingPriority,zs=i.unstable_NormalPriority,Yu=i.unstable_IdlePriority,Ua=null,ki=null;function Go(d){if(ki&&typeof ki.onCommitFiberRoot=="function")try{ki.onCommitFiberRoot(Ua,d,void 0,(d.current.flags&128)===128)}catch{}}function du(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var Ca=typeof Object.is=="function"?Object.is:du,ao=null,Eo=!1,ko=!1;function dl(d){ao===null?ao=[d]:ao.push(d)}function Rl(d){Eo=!0,dl(d)}function li(){if(!ko&&ao!==null){ko=!0;var d=0,m=Pt;try{var C=ao;for(Pt=1;d<C.length;d++){var z=C[d];do z=z(!0);while(z!==null)}ao=null,Eo=!1}catch(W){throw ao!==null&&(ao=ao.slice(d+1)),So(fu,li),W}finally{Pt=m,ko=!1}}return null}var Ha=[],Ao=0,pl=null,La=0,Br=[],fa=0,Qr=null,vi=1,$a="";function H(d,m){Ha[Ao++]=La,Ha[Ao++]=pl,pl=d,La=m}function ce(d,m,C){Br[fa++]=vi,Br[fa++]=$a,Br[fa++]=Qr,Qr=d;var z=vi;d=$a;var W=32-Oa(z)-1;z&=~(1<<W),C+=1;var re=32-Oa(m)+W;if(30<re){var _e=W-W%5;re=(z&(1<<_e)-1).toString(32),z>>=_e,W-=_e,vi=1<<32-Oa(m)+W|C<<W|z,$a=re+d}else vi=1<<re|C<<W|z,$a=d}function ke(d){d.return!==null&&(H(d,1),ce(d,1,0))}function De(d){for(;d===pl;)pl=Ha[--Ao],Ha[Ao]=null,La=Ha[--Ao],Ha[Ao]=null;for(;d===Qr;)Qr=Br[--fa],Br[fa]=null,$a=Br[--fa],Br[fa]=null,vi=Br[--fa],Br[fa]=null}var Ge=null,at=null,ct=!1,Dt=!1,jt=null;function fn(d,m){var C=Jo(5,null,null,0);C.elementType="DELETED",C.stateNode=m,C.return=d,m=d.deletions,m===null?(d.deletions=[C],d.flags|=16):m.push(C)}function hn(d,m){switch(d.tag){case 5:return m=ca(m,d.type,d.pendingProps),m!==null?(d.stateNode=m,Ge=d,at=Ho(m),!0):!1;case 6:return m=Fa(m,d.pendingProps),m!==null?(d.stateNode=m,Ge=d,at=null,!0):!1;case 13:if(m=Kr(m),m!==null){var C=Qr!==null?{id:vi,overflow:$a}:null;return d.memoizedState={dehydrated:m,treeContext:C,retryLane:1073741824},C=Jo(18,null,null,0),C.stateNode=m,C.return=d,d.child=C,Ge=d,at=null,!0}return!1;default:return!1}}function Hn(d){return(d.mode&1)!==0&&(d.flags&128)===0}function Ar(d){if(ct){var m=at;if(m){var C=m;if(!hn(d,m)){if(Hn(d))throw Error(o(418));m=Sa(C);var z=Ge;m&&hn(d,m)?fn(z,C):(d.flags=d.flags&-4097|2,ct=!1,Ge=d)}}else{if(Hn(d))throw Error(o(418));d.flags=d.flags&-4097|2,ct=!1,Ge=d}}}function ui(d){for(d=d.return;d!==null&&d.tag!==5&&d.tag!==3&&d.tag!==13;)d=d.return;Ge=d}function or(d){if(!Me||d!==Ge)return!1;if(!ct)return ui(d),ct=!0,!1;if(d.tag!==3&&(d.tag!==5||lu(d.type)&&!ee(d.type,d.memoizedProps))){var m=at;if(m){if(Hn(d))throw mi(),Error(o(418));for(;m;)fn(d,m),m=Sa(m)}}if(ui(d),d.tag===13){if(!Me)throw Error(o(316));if(d=d.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(o(317));at=$o(d)}else at=Ge?Sa(d.stateNode):null;return!0}function mi(){for(var d=at;d;)d=Sa(d)}function _r(){Me&&(at=Ge=null,Dt=ct=!1)}function Ai(d){jt===null?jt=[d]:jt.push(d)}var Po=s.ReactCurrentBatchConfig;function Qi(d,m){if(Ca(d,m))return!0;if(typeof d!="object"||d===null||typeof m!="object"||m===null)return!1;var C=Object.keys(d),z=Object.keys(m);if(C.length!==z.length)return!1;for(z=0;z<C.length;z++){var W=C[z];if(!kc.call(m,W)||!Ca(d[W],m[W]))return!1}return!0}function Lc(d){switch(d.tag){case 5:return as(d.type);case 16:return as("Lazy");case 13:return as("Suspense");case 19:return as("SuspenseList");case 0:case 2:case 15:return d=os(d.type,!1),d;case 11:return d=os(d.type.render,!1),d;case 1:return d=os(d.type,!0),d;default:return""}}function Oo(d,m,C){if(d=C.ref,d!==null&&typeof d!="function"&&typeof d!="object"){if(C._owner){if(C=C._owner,C){if(C.tag!==1)throw Error(o(309));var z=C.stateNode}if(!z)throw Error(o(147,d));var W=z,re=""+d;return m!==null&&m.ref!==null&&typeof m.ref=="function"&&m.ref._stringRef===re?m.ref:(m=function(_e){var Ye=W.refs;_e===null?delete Ye[re]:Ye[re]=_e},m._stringRef=re,m)}if(typeof d!="string")throw Error(o(284));if(!C._owner)throw Error(o(290,d))}return d}function hs(d,m){throw d=Object.prototype.toString.call(m),Error(o(31,d==="[object Object]"?"object with keys {"+Object.keys(m).join(", ")+"}":d))}function qs(d){var m=d._init;return m(d._payload)}function gl(d){function m(nt,Ke){if(d){var ut=nt.deletions;ut===null?(nt.deletions=[Ke],nt.flags|=16):ut.push(Ke)}}function C(nt,Ke){if(!d)return null;for(;Ke!==null;)m(nt,Ke),Ke=Ke.sibling;return null}function z(nt,Ke){for(nt=new Map;Ke!==null;)Ke.key!==null?nt.set(Ke.key,Ke):nt.set(Ke.index,Ke),Ke=Ke.sibling;return nt}function W(nt,Ke){return nt=Pu(nt,Ke),nt.index=0,nt.sibling=null,nt}function re(nt,Ke,ut){return nt.index=ut,d?(ut=nt.alternate,ut!==null?(ut=ut.index,ut<Ke?(nt.flags|=2,Ke):ut):(nt.flags|=2,Ke)):(nt.flags|=1048576,Ke)}function _e(nt){return d&&nt.alternate===null&&(nt.flags|=2),nt}function Ye(nt,Ke,ut,Rt){return Ke===null||Ke.tag!==6?(Ke=Vc(ut,nt.mode,Rt),Ke.return=nt,Ke):(Ke=W(Ke,ut),Ke.return=nt,Ke)}function it(nt,Ke,ut,Rt){var rn=ut.type;return rn===f?$t(nt,Ke,ut.props.children,Rt,ut.key):Ke!==null&&(Ke.elementType===rn||typeof rn=="object"&&rn!==null&&rn.$$typeof===A&&qs(rn)===Ke.type)?(Rt=W(Ke,ut.props),Rt.ref=Oo(nt,Ke,ut),Rt.return=nt,Rt):(Rt=jh(ut.type,ut.key,ut.props,null,nt.mode,Rt),Rt.ref=Oo(nt,Ke,ut),Rt.return=nt,Rt)}function wt(nt,Ke,ut,Rt){return Ke===null||Ke.tag!==4||Ke.stateNode.containerInfo!==ut.containerInfo||Ke.stateNode.implementation!==ut.implementation?(Ke=Dh(ut,nt.mode,Rt),Ke.return=nt,Ke):(Ke=W(Ke,ut.children||[]),Ke.return=nt,Ke)}function $t(nt,Ke,ut,Rt,rn){return Ke===null||Ke.tag!==7?(Ke=Ma(ut,nt.mode,Rt,rn),Ke.return=nt,Ke):(Ke=W(Ke,ut),Ke.return=nt,Ke)}function wn(nt,Ke,ut){if(typeof Ke=="string"&&Ke!==""||typeof Ke=="number")return Ke=Vc(""+Ke,nt.mode,ut),Ke.return=nt,Ke;if(typeof Ke=="object"&&Ke!==null){switch(Ke.$$typeof){case u:return ut=jh(Ke.type,Ke.key,Ke.props,null,nt.mode,ut),ut.ref=Oo(nt,null,Ke),ut.return=nt,ut;case h:return Ke=Dh(Ke,nt.mode,ut),Ke.return=nt,Ke;case A:var Rt=Ke._init;return wn(nt,Rt(Ke._payload),ut)}if(J(Ke)||I(Ke))return Ke=Ma(Ke,nt.mode,ut,null),Ke.return=nt,Ke;hs(nt,Ke)}return null}function Tt(nt,Ke,ut,Rt){var rn=Ke!==null?Ke.key:null;if(typeof ut=="string"&&ut!==""||typeof ut=="number")return rn!==null?null:Ye(nt,Ke,""+ut,Rt);if(typeof ut=="object"&&ut!==null){switch(ut.$$typeof){case u:return ut.key===rn?it(nt,Ke,ut,Rt):null;case h:return ut.key===rn?wt(nt,Ke,ut,Rt):null;case A:return rn=ut._init,Tt(nt,Ke,rn(ut._payload),Rt)}if(J(ut)||I(ut))return rn!==null?null:$t(nt,Ke,ut,Rt,null);hs(nt,ut)}return null}function Fr(nt,Ke,ut,Rt,rn){if(typeof Rt=="string"&&Rt!==""||typeof Rt=="number")return nt=nt.get(ut)||null,Ye(Ke,nt,""+Rt,rn);if(typeof Rt=="object"&&Rt!==null){switch(Rt.$$typeof){case u:return nt=nt.get(Rt.key===null?ut:Rt.key)||null,it(Ke,nt,Rt,rn);case h:return nt=nt.get(Rt.key===null?ut:Rt.key)||null,wt(Ke,nt,Rt,rn);case A:var Cn=Rt._init;return Fr(nt,Ke,ut,Cn(Rt._payload),rn)}if(J(Rt)||I(Rt))return nt=nt.get(ut)||null,$t(Ke,nt,Rt,rn,null);hs(Ke,Rt)}return null}function mr(nt,Ke,ut,Rt){for(var rn=null,Cn=null,_n=Ke,Xn=Ke=0,ia=null;_n!==null&&Xn<ut.length;Xn++){_n.index>Xn?(ia=_n,_n=null):ia=_n.sibling;var Gn=Tt(nt,_n,ut[Xn],Rt);if(Gn===null){_n===null&&(_n=ia);break}d&&_n&&Gn.alternate===null&&m(nt,_n),Ke=re(Gn,Ke,Xn),Cn===null?rn=Gn:Cn.sibling=Gn,Cn=Gn,_n=ia}if(Xn===ut.length)return C(nt,_n),ct&&H(nt,Xn),rn;if(_n===null){for(;Xn<ut.length;Xn++)_n=wn(nt,ut[Xn],Rt),_n!==null&&(Ke=re(_n,Ke,Xn),Cn===null?rn=_n:Cn.sibling=_n,Cn=_n);return ct&&H(nt,Xn),rn}for(_n=z(nt,_n);Xn<ut.length;Xn++)ia=Fr(_n,nt,Xn,ut[Xn],Rt),ia!==null&&(d&&ia.alternate!==null&&_n.delete(ia.key===null?Xn:ia.key),Ke=re(ia,Ke,Xn),Cn===null?rn=ia:Cn.sibling=ia,Cn=ia);return d&&_n.forEach(function(Ka){return m(nt,Ka)}),ct&&H(nt,Xn),rn}function mo(nt,Ke,ut,Rt){var rn=I(ut);if(typeof rn!="function")throw Error(o(150));if(ut=rn.call(ut),ut==null)throw Error(o(151));for(var Cn=rn=null,_n=Ke,Xn=Ke=0,ia=null,Gn=ut.next();_n!==null&&!Gn.done;Xn++,Gn=ut.next()){_n.index>Xn?(ia=_n,_n=null):ia=_n.sibling;var Ka=Tt(nt,_n,Gn.value,Rt);if(Ka===null){_n===null&&(_n=ia);break}d&&_n&&Ka.alternate===null&&m(nt,_n),Ke=re(Ka,Ke,Xn),Cn===null?rn=Ka:Cn.sibling=Ka,Cn=Ka,_n=ia}if(Gn.done)return C(nt,_n),ct&&H(nt,Xn),rn;if(_n===null){for(;!Gn.done;Xn++,Gn=ut.next())Gn=wn(nt,Gn.value,Rt),Gn!==null&&(Ke=re(Gn,Ke,Xn),Cn===null?rn=Gn:Cn.sibling=Gn,Cn=Gn);return ct&&H(nt,Xn),rn}for(_n=z(nt,_n);!Gn.done;Xn++,Gn=ut.next())Gn=Fr(_n,nt,Xn,Gn.value,Rt),Gn!==null&&(d&&Gn.alternate!==null&&_n.delete(Gn.key===null?Xn:Gn.key),Ke=re(Gn,Ke,Xn),Cn===null?rn=Gn:Cn.sibling=Gn,Cn=Gn);return d&&_n.forEach(function(og){return m(nt,og)}),ct&&H(nt,Xn),rn}function Sl(nt,Ke,ut,Rt){if(typeof ut=="object"&&ut!==null&&ut.type===f&&ut.key===null&&(ut=ut.props.children),typeof ut=="object"&&ut!==null){switch(ut.$$typeof){case u:e:{for(var rn=ut.key,Cn=Ke;Cn!==null;){if(Cn.key===rn){if(rn=ut.type,rn===f){if(Cn.tag===7){C(nt,Cn.sibling),Ke=W(Cn,ut.props.children),Ke.return=nt,nt=Ke;break e}}else if(Cn.elementType===rn||typeof rn=="object"&&rn!==null&&rn.$$typeof===A&&qs(rn)===Cn.type){C(nt,Cn.sibling),Ke=W(Cn,ut.props),Ke.ref=Oo(nt,Cn,ut),Ke.return=nt,nt=Ke;break e}C(nt,Cn);break}else m(nt,Cn);Cn=Cn.sibling}ut.type===f?(Ke=Ma(ut.props.children,nt.mode,Rt,ut.key),Ke.return=nt,nt=Ke):(Rt=jh(ut.type,ut.key,ut.props,null,nt.mode,Rt),Rt.ref=Oo(nt,Ke,ut),Rt.return=nt,nt=Rt)}return _e(nt);case h:e:{for(Cn=ut.key;Ke!==null;){if(Ke.key===Cn)if(Ke.tag===4&&Ke.stateNode.containerInfo===ut.containerInfo&&Ke.stateNode.implementation===ut.implementation){C(nt,Ke.sibling),Ke=W(Ke,ut.children||[]),Ke.return=nt,nt=Ke;break e}else{C(nt,Ke);break}else m(nt,Ke);Ke=Ke.sibling}Ke=Dh(ut,nt.mode,Rt),Ke.return=nt,nt=Ke}return _e(nt);case A:return Cn=ut._init,Sl(nt,Ke,Cn(ut._payload),Rt)}if(J(ut))return mr(nt,Ke,ut,Rt);if(I(ut))return mo(nt,Ke,ut,Rt);hs(nt,ut)}return typeof ut=="string"&&ut!==""||typeof ut=="number"?(ut=""+ut,Ke!==null&&Ke.tag===6?(C(nt,Ke.sibling),Ke=W(Ke,ut),Ke.return=nt,nt=Ke):(C(nt,Ke),Ke=Vc(ut,nt.mode,Rt),Ke.return=nt,nt=Ke),_e(nt)):C(nt,Ke)}return Sl}var oo=gl(!0),vl=gl(!1),Pi=gi(null),ds=null,Co=null,Ml=null;function Il(){Ml=Co=ds=null}function zr(d,m,C){ye?(En(Pi,m._currentValue),m._currentValue=C):(En(Pi,m._currentValue2),m._currentValue2=C)}function so(d){var m=Pi.current;cr(Pi),ye?d._currentValue=m:d._currentValue2=m}function Lo(d,m,C){for(;d!==null;){var z=d.alternate;if((d.childLanes&m)!==m?(d.childLanes|=m,z!==null&&(z.childLanes|=m)):z!==null&&(z.childLanes&m)!==m&&(z.childLanes|=m),d===C)break;d=d.return}}function Us(d,m){ds=d,Ml=Co=null,d=d.dependencies,d!==null&&d.firstContext!==null&&((d.lanes&m)!==0&&(yi=!0),d.firstContext=null)}function Ir(d){var m=ye?d._currentValue:d._currentValue2;if(Ml!==d)if(d={context:d,memoizedValue:m,next:null},Co===null){if(ds===null)throw Error(o(308));Co=d,ds.dependencies={lanes:0,firstContext:d}}else Co=Co.next=d;return m}var Ga=null;function ml(d){Ga===null?Ga=[d]:Ga.push(d)}function jl(d,m,C,z){var W=m.interleaved;return W===null?(C.next=C,ml(m)):(C.next=W.next,W.next=C),m.interleaved=C,qi(d,z)}function qi(d,m){d.lanes|=m;var C=d.alternate;for(C!==null&&(C.lanes|=m),C=d,d=d.return;d!==null;)d.childLanes|=m,C=d.alternate,C!==null&&(C.childLanes|=m),C=d,d=d.return;return C.tag===3?C.stateNode:null}var Oi=!1;function Na(d){d.updateQueue={baseState:d.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Wa(d,m){d=d.updateQueue,m.updateQueue===d&&(m.updateQueue={baseState:d.baseState,firstBaseUpdate:d.firstBaseUpdate,lastBaseUpdate:d.lastBaseUpdate,shared:d.shared,effects:d.effects})}function ha(d,m){return{eventTime:d,lane:m,tag:0,payload:null,callback:null,next:null}}function Ji(d,m,C){var z=d.updateQueue;if(z===null)return null;if(z=z.shared,(ln&2)!==0){var W=z.pending;return W===null?m.next=m:(m.next=W.next,W.next=m),z.pending=m,qi(d,C)}return W=z.interleaved,W===null?(m.next=m,ml(z)):(m.next=W.next,W.next=m),z.interleaved=m,qi(d,C)}function No(d,m,C){if(m=m.updateQueue,m!==null&&(m=m.shared,(C&4194240)!==0)){var z=m.lanes;z&=d.pendingLanes,C|=z,m.lanes=C,qa(d,C)}}function ps(d,m){var C=d.updateQueue,z=d.alternate;if(z!==null&&(z=z.updateQueue,C===z)){var W=null,re=null;if(C=C.firstBaseUpdate,C!==null){do{var _e={eventTime:C.eventTime,lane:C.lane,tag:C.tag,payload:C.payload,callback:C.callback,next:null};re===null?W=re=_e:re=re.next=_e,C=C.next}while(C!==null);re===null?W=re=m:re=re.next=m}else W=re=m;C={baseState:z.baseState,firstBaseUpdate:W,lastBaseUpdate:re,shared:z.shared,effects:z.effects},d.updateQueue=C;return}d=C.lastBaseUpdate,d===null?C.firstBaseUpdate=m:d.next=m,C.lastBaseUpdate=m}function lo(d,m,C,z){var W=d.updateQueue;Oi=!1;var re=W.firstBaseUpdate,_e=W.lastBaseUpdate,Ye=W.shared.pending;if(Ye!==null){W.shared.pending=null;var it=Ye,wt=it.next;it.next=null,_e===null?re=wt:_e.next=wt,_e=it;var $t=d.alternate;$t!==null&&($t=$t.updateQueue,Ye=$t.lastBaseUpdate,Ye!==_e&&(Ye===null?$t.firstBaseUpdate=wt:Ye.next=wt,$t.lastBaseUpdate=it))}if(re!==null){var wn=W.baseState;_e=0,$t=wt=it=null,Ye=re;do{var Tt=Ye.lane,Fr=Ye.eventTime;if((z&Tt)===Tt){$t!==null&&($t=$t.next={eventTime:Fr,lane:0,tag:Ye.tag,payload:Ye.payload,callback:Ye.callback,next:null});e:{var mr=d,mo=Ye;switch(Tt=m,Fr=C,mo.tag){case 1:if(mr=mo.payload,typeof mr=="function"){wn=mr.call(Fr,wn,Tt);break e}wn=mr;break e;case 3:mr.flags=mr.flags&-65537|128;case 0:if(mr=mo.payload,Tt=typeof mr=="function"?mr.call(Fr,wn,Tt):mr,Tt==null)break e;wn=a({},wn,Tt);break e;case 2:Oi=!0}}Ye.callback!==null&&Ye.lane!==0&&(d.flags|=64,Tt=W.effects,Tt===null?W.effects=[Ye]:Tt.push(Ye))}else Fr={eventTime:Fr,lane:Tt,tag:Ye.tag,payload:Ye.payload,callback:Ye.callback,next:null},$t===null?(wt=$t=Fr,it=wn):$t=$t.next=Fr,_e|=Tt;if(Ye=Ye.next,Ye===null){if(Ye=W.shared.pending,Ye===null)break;Tt=Ye,Ye=Tt.next,Tt.next=null,W.lastBaseUpdate=Tt,W.shared.pending=null}}while(!0);if($t===null&&(it=wn),W.baseState=it,W.firstBaseUpdate=wt,W.lastBaseUpdate=$t,m=W.shared.interleaved,m!==null){W=m;do _e|=W.lane,W=W.next;while(W!==m)}else re===null&&(W.shared.lanes=0);Xs|=_e,d.lanes=_e,d.memoizedState=wn}}function Jr(d,m,C){if(d=m.effects,m.effects=null,d!==null)for(m=0;m<d.length;m++){var z=d[m],W=z.callback;if(W!==null){if(z.callback=null,z=C,typeof W!="function")throw Error(o(191,W));W.call(z)}}}var Wo={},ci=gi(Wo),Ta=gi(Wo),To=gi(Wo);function da(d){if(d===Wo)throw Error(o(174));return d}function yl(d,m){En(To,m),En(Ta,d),En(ci,Wo),d=ie(m),cr(ci),En(ci,d)}function Vo(){cr(ci),cr(Ta),cr(To)}function gs(d){var m=da(To.current),C=da(ci.current);m=Z(C,d.type,m),C!==m&&(En(Ta,d),En(ci,m))}function vs(d){Ta.current===d&&(cr(ci),cr(Ta))}var tr=gi(0);function ms(d){for(var m=d;m!==null;){if(m.tag===13){var C=m.memoizedState;if(C!==null&&(C=C.dehydrated,C===null||Yi(C)||Un(C)))return m}else if(m.tag===19&&m.memoizedProps.revealOrder!==void 0){if((m.flags&128)!==0)return m}else if(m.child!==null){m.child.return=m,m=m.child;continue}if(m===d)break;for(;m.sibling===null;){if(m.return===null||m.return===d)return null;m=m.return}m.sibling.return=m.return,m=m.sibling}return null}var ys=[];function Hs(){for(var d=0;d<ys.length;d++){var m=ys[d];ye?m._workInProgressVersionPrimary=null:m._workInProgressVersionSecondary=null}ys.length=0}var Pr=s.ReactCurrentDispatcher,pa=s.ReactCurrentBatchConfig,Ln=0,on=null,kn=null,Nn=null,Va=!1,$s=!1,bs=0,Gs=0;function Ci(){throw Error(o(321))}function bl(d,m){if(m===null)return!1;for(var C=0;C<m.length&&C<d.length;C++)if(!Ca(d[C],m[C]))return!1;return!0}function pu(d,m,C,z,W,re){if(Ln=re,on=m,m.memoizedState=null,m.updateQueue=null,m.lanes=0,Pr.current=d===null||d.memoizedState===null?Ju:Ul,d=C(z,W),$s){re=0;do{if($s=!1,bs=0,25<=re)throw Error(o(301));re+=1,Nn=kn=null,m.updateQueue=null,Pr.current=If,d=C(z,W)}while($s)}if(Pr.current=Vs,m=kn!==null&&kn.next!==null,Ln=0,Nn=kn=on=null,Va=!1,m)throw Error(o(300));return d}function Xu(){var d=bs!==0;return bs=0,d}function Ya(){var d={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nn===null?on.memoizedState=Nn=d:Nn=Nn.next=d,Nn}function Ui(){if(kn===null){var d=on.alternate;d=d!==null?d.memoizedState:null}else d=kn.next;var m=Nn===null?on.memoizedState:Nn.next;if(m!==null)Nn=m,kn=d;else{if(d===null)throw Error(o(310));kn=d,d={memoizedState:kn.memoizedState,baseState:kn.baseState,baseQueue:kn.baseQueue,queue:kn.queue,next:null},Nn===null?on.memoizedState=Nn=d:Nn=Nn.next=d}return Nn}function Yo(d,m){return typeof m=="function"?m(d):m}function Ku(d){var m=Ui(),C=m.queue;if(C===null)throw Error(o(311));C.lastRenderedReducer=d;var z=kn,W=z.baseQueue,re=C.pending;if(re!==null){if(W!==null){var _e=W.next;W.next=re.next,re.next=_e}z.baseQueue=W=re,C.pending=null}if(W!==null){re=W.next,z=z.baseState;var Ye=_e=null,it=null,wt=re;do{var $t=wt.lane;if((Ln&$t)===$t)it!==null&&(it=it.next={lane:0,action:wt.action,hasEagerState:wt.hasEagerState,eagerState:wt.eagerState,next:null}),z=wt.hasEagerState?wt.eagerState:d(z,wt.action);else{var wn={lane:$t,action:wt.action,hasEagerState:wt.hasEagerState,eagerState:wt.eagerState,next:null};it===null?(Ye=it=wn,_e=z):it=it.next=wn,on.lanes|=$t,Xs|=$t}wt=wt.next}while(wt!==null&&wt!==re);it===null?_e=z:it.next=Ye,Ca(z,m.memoizedState)||(yi=!0),m.memoizedState=z,m.baseState=_e,m.baseQueue=it,C.lastRenderedState=z}if(d=C.interleaved,d!==null){W=d;do re=W.lane,on.lanes|=re,Xs|=re,W=W.next;while(W!==d)}else W===null&&(C.lanes=0);return[m.memoizedState,C.dispatch]}function Dl(d){var m=Ui(),C=m.queue;if(C===null)throw Error(o(311));C.lastRenderedReducer=d;var z=C.dispatch,W=C.pending,re=m.memoizedState;if(W!==null){C.pending=null;var _e=W=W.next;do re=d(re,_e.action),_e=_e.next;while(_e!==W);Ca(re,m.memoizedState)||(yi=!0),m.memoizedState=re,m.baseQueue===null&&(m.baseState=re),C.lastRenderedState=re}return[re,z]}function Nc(){}function Tc(d,m){var C=on,z=Ui(),W=m(),re=!Ca(z.memoizedState,W);if(re&&(z.memoizedState=W,yi=!0),z=z.queue,zl(Ic.bind(null,C,z,d),[d]),z.getSnapshot!==m||re||Nn!==null&&Nn.memoizedState.tag&1){if(C.flags|=2048,Li(9,Mc.bind(null,C,z,W,m),void 0,null),jn===null)throw Error(o(349));(Ln&30)!==0||Rc(C,m,W)}return W}function Rc(d,m,C){d.flags|=16384,d={getSnapshot:m,value:C},m=on.updateQueue,m===null?(m={lastEffect:null,stores:null},on.updateQueue=m,m.stores=[d]):(C=m.stores,C===null?m.stores=[d]:C.push(d))}function Mc(d,m,C,z){m.value=C,m.getSnapshot=z,jc(m)&&Xo(d)}function Ic(d,m,C){return C(function(){jc(m)&&Xo(d)})}function jc(d){var m=d.getSnapshot;d=d.value;try{var C=m();return!Ca(d,C)}catch{return!0}}function Xo(d){var m=qi(d,1);m!==null&&_a(m,d,1,-1)}function Fl(d){var m=Ya();return typeof d=="function"&&(d=d()),m.memoizedState=m.baseState=d,d={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Yo,lastRenderedState:d},m.queue=d,d=d.dispatch=Pd.bind(null,on,d),[m.memoizedState,d]}function Li(d,m,C,z){return d={tag:d,create:m,destroy:C,deps:z,next:null},m=on.updateQueue,m===null?(m={lastEffect:null,stores:null},on.updateQueue=m,m.lastEffect=d.next=d):(C=m.lastEffect,C===null?m.lastEffect=d.next=d:(z=C.next,C.next=d,d.next=z,m.lastEffect=d)),d}function uo(){return Ui().memoizedState}function Bl(d,m,C,z){var W=Ya();on.flags|=d,W.memoizedState=Li(1|m,C,void 0,z===void 0?null:z)}function Ko(d,m,C,z){var W=Ui();z=z===void 0?null:z;var re=void 0;if(kn!==null){var _e=kn.memoizedState;if(re=_e.destroy,z!==null&&bl(z,_e.deps)){W.memoizedState=Li(m,C,re,z);return}}on.flags|=d,W.memoizedState=Li(1|m,C,re,z)}function Rf(d,m){return Bl(8390656,8,d,m)}function zl(d,m){return Ko(2048,8,d,m)}function gu(d,m){return Ko(4,2,d,m)}function fr(d,m){return Ko(4,4,d,m)}function Zu(d,m){if(typeof m=="function")return d=d(),m(d),function(){m(null)};if(m!=null)return d=d(),m.current=d,function(){m.current=null}}function ql(d,m,C){return C=C!=null?C.concat([d]):null,Ko(4,4,Zu.bind(null,m,d),C)}function Ws(){}function vu(d,m){var C=Ui();m=m===void 0?null:m;var z=C.memoizedState;return z!==null&&m!==null&&bl(m,z[1])?z[0]:(C.memoizedState=[d,m],d)}function mu(d,m){var C=Ui();m=m===void 0?null:m;var z=C.memoizedState;return z!==null&&m!==null&&bl(m,z[1])?z[0]:(d=d(),C.memoizedState=[d,m],d)}function yu(d,m,C){return(Ln&21)===0?(d.baseState&&(d.baseState=!1,yi=!0),d.memoizedState=C):(Ca(C,m)||(C=fs(),on.lanes|=C,Xs|=C,d.baseState=!0),m)}function Dc(d,m){var C=Pt;Pt=C!==0&&4>C?C:4,d(!0);var z=pa.transition;pa.transition={};try{d(!1),m()}finally{Pt=C,pa.transition=z}}function wl(){return Ui().memoizedState}function Oh(d,m,C){var z=_i(d);if(C={lane:z,action:C,hasEagerState:!1,eagerState:null,next:null},Ch(d))Mf(m,C);else if(C=jl(d,m,C,z),C!==null){var W=xr();_a(C,d,z,W),Qu(C,m,z)}}function Pd(d,m,C){var z=_i(d),W={lane:z,action:C,hasEagerState:!1,eagerState:null,next:null};if(Ch(d))Mf(m,W);else{var re=d.alternate;if(d.lanes===0&&(re===null||re.lanes===0)&&(re=m.lastRenderedReducer,re!==null))try{var _e=m.lastRenderedState,Ye=re(_e,C);if(W.hasEagerState=!0,W.eagerState=Ye,Ca(Ye,_e)){var it=m.interleaved;it===null?(W.next=W,ml(m)):(W.next=it.next,it.next=W),m.interleaved=W;return}}catch{}finally{}C=jl(d,m,W,z),C!==null&&(W=xr(),_a(C,d,z,W),Qu(C,m,z))}}function Ch(d){var m=d.alternate;return d===on||m!==null&&m===on}function Mf(d,m){$s=Va=!0;var C=d.pending;C===null?m.next=m:(m.next=C.next,C.next=m),d.pending=m}function Qu(d,m,C){if((C&4194240)!==0){var z=m.lanes;z&=d.pendingLanes,C|=z,m.lanes=C,qa(d,C)}}var Vs={readContext:Ir,useCallback:Ci,useContext:Ci,useEffect:Ci,useImperativeHandle:Ci,useInsertionEffect:Ci,useLayoutEffect:Ci,useMemo:Ci,useReducer:Ci,useRef:Ci,useState:Ci,useDebugValue:Ci,useDeferredValue:Ci,useTransition:Ci,useMutableSource:Ci,useSyncExternalStore:Ci,useId:Ci,unstable_isNewReconciler:!1},Ju={readContext:Ir,useCallback:function(d,m){return Ya().memoizedState=[d,m===void 0?null:m],d},useContext:Ir,useEffect:Rf,useImperativeHandle:function(d,m,C){return C=C!=null?C.concat([d]):null,Bl(4194308,4,Zu.bind(null,m,d),C)},useLayoutEffect:function(d,m){return Bl(4194308,4,d,m)},useInsertionEffect:function(d,m){return Bl(4,2,d,m)},useMemo:function(d,m){var C=Ya();return m=m===void 0?null:m,d=d(),C.memoizedState=[d,m],d},useReducer:function(d,m,C){var z=Ya();return m=C!==void 0?C(m):m,z.memoizedState=z.baseState=m,d={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:d,lastRenderedState:m},z.queue=d,d=d.dispatch=Oh.bind(null,on,d),[z.memoizedState,d]},useRef:function(d){var m=Ya();return d={current:d},m.memoizedState=d},useState:Fl,useDebugValue:Ws,useDeferredValue:function(d){return Ya().memoizedState=d},useTransition:function(){var d=Fl(!1),m=d[0];return d=Dc.bind(null,d[1]),Ya().memoizedState=d,[m,d]},useMutableSource:function(){},useSyncExternalStore:function(d,m,C){var z=on,W=Ya();if(ct){if(C===void 0)throw Error(o(407));C=C()}else{if(C=m(),jn===null)throw Error(o(349));(Ln&30)!==0||Rc(z,m,C)}W.memoizedState=C;var re={value:C,getSnapshot:m};return W.queue=re,Rf(Ic.bind(null,z,re,d),[d]),z.flags|=2048,Li(9,Mc.bind(null,z,re,C,m),void 0,null),C},useId:function(){var d=Ya(),m=jn.identifierPrefix;if(ct){var C=$a,z=vi;C=(z&~(1<<32-Oa(z)-1)).toString(32)+C,m=":"+m+"R"+C,C=bs++,0<C&&(m+="H"+C.toString(32)),m+=":"}else C=Gs++,m=":"+m+"r"+C.toString(32)+":";return d.memoizedState=m},unstable_isNewReconciler:!1},Ul={readContext:Ir,useCallback:vu,useContext:Ir,useEffect:zl,useImperativeHandle:ql,useInsertionEffect:gu,useLayoutEffect:fr,useMemo:mu,useReducer:Ku,useRef:uo,useState:function(){return Ku(Yo)},useDebugValue:Ws,useDeferredValue:function(d){var m=Ui();return yu(m,kn.memoizedState,d)},useTransition:function(){var d=Ku(Yo)[0],m=Ui().memoizedState;return[d,m]},useMutableSource:Nc,useSyncExternalStore:Tc,useId:wl,unstable_isNewReconciler:!1},If={readContext:Ir,useCallback:vu,useContext:Ir,useEffect:zl,useImperativeHandle:ql,useInsertionEffect:gu,useLayoutEffect:fr,useMemo:mu,useReducer:Dl,useRef:uo,useState:function(){return Dl(Yo)},useDebugValue:Ws,useDeferredValue:function(d){var m=Ui();return kn===null?m.memoizedState=d:yu(m,kn.memoizedState,d)},useTransition:function(){var d=Dl(Yo)[0],m=Ui().memoizedState;return[d,m]},useMutableSource:Nc,useSyncExternalStore:Tc,useId:wl,unstable_isNewReconciler:!1};function co(d,m){if(d&&d.defaultProps){m=a({},m),d=d.defaultProps;for(var C in d)m[C]===void 0&&(m[C]=d[C]);return m}return m}function Fc(d,m,C,z){m=d.memoizedState,C=C(z,m),C=C==null?m:a({},m,C),d.memoizedState=C,d.lanes===0&&(d.updateQueue.baseState=C)}var ec={isMounted:function(d){return(d=d._reactInternals)?F(d)===d:!1},enqueueSetState:function(d,m,C){d=d._reactInternals;var z=xr(),W=_i(d),re=ha(z,W);re.payload=m,C!=null&&(re.callback=C),m=Ji(d,re,W),m!==null&&(_a(m,d,W,z),No(m,d,W))},enqueueReplaceState:function(d,m,C){d=d._reactInternals;var z=xr(),W=_i(d),re=ha(z,W);re.tag=1,re.payload=m,C!=null&&(re.callback=C),m=Ji(d,re,W),m!==null&&(_a(m,d,W,z),No(m,d,W))},enqueueForceUpdate:function(d,m){d=d._reactInternals;var C=xr(),z=_i(d),W=ha(C,z);W.tag=2,m!=null&&(W.callback=m),m=Ji(d,W,z),m!==null&&(_a(m,d,z,C),No(m,d,z))}};function Lh(d,m,C,z,W,re,_e){return d=d.stateNode,typeof d.shouldComponentUpdate=="function"?d.shouldComponentUpdate(z,re,_e):m.prototype&&m.prototype.isPureReactComponent?!Qi(C,z)||!Qi(W,re):!0}function Nh(d,m,C){var z=!1,W=ss,re=m.contextType;return typeof re=="object"&&re!==null?re=Ir(re):(W=Mr(m)?no:Rn.current,z=m.contextTypes,re=(z=z!=null)?Ki(d,W):ss),m=new m(C,re),d.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=ec,d.stateNode=m,m._reactInternals=d,z&&(d=d.stateNode,d.__reactInternalMemoizedUnmaskedChildContext=W,d.__reactInternalMemoizedMaskedChildContext=re),m}function Bc(d,m,C,z){d=m.state,typeof m.componentWillReceiveProps=="function"&&m.componentWillReceiveProps(C,z),typeof m.UNSAFE_componentWillReceiveProps=="function"&&m.UNSAFE_componentWillReceiveProps(C,z),m.state!==d&&ec.enqueueReplaceState(m,m.state,null)}function ea(d,m,C,z){var W=d.stateNode;W.props=C,W.state=d.memoizedState,W.refs={},Na(d);var re=m.contextType;typeof re=="object"&&re!==null?W.context=Ir(re):(re=Mr(m)?no:Rn.current,W.context=Ki(d,re)),W.state=d.memoizedState,re=m.getDerivedStateFromProps,typeof re=="function"&&(Fc(d,m,re,C),W.state=d.memoizedState),typeof m.getDerivedStateFromProps=="function"||typeof W.getSnapshotBeforeUpdate=="function"||typeof W.UNSAFE_componentWillMount!="function"&&typeof W.componentWillMount!="function"||(m=W.state,typeof W.componentWillMount=="function"&&W.componentWillMount(),typeof W.UNSAFE_componentWillMount=="function"&&W.UNSAFE_componentWillMount(),m!==W.state&&ec.enqueueReplaceState(W,W.state,null),lo(d,C,W,z),W.state=d.memoizedState),typeof W.componentDidMount=="function"&&(d.flags|=4194308)}function ta(d,m){try{var C="",z=m;do C+=Lc(z),z=z.return;while(z);var W=C}catch(re){W=`
69
+ Error generating stack: `+re.message+`
70
+ `+re.stack}return{value:d,source:m,stack:W,digest:null}}function ga(d,m,C){return{value:d,source:null,stack:C??null,digest:m??null}}function Ro(d,m){try{console.error(m.value)}catch(C){setTimeout(function(){throw C})}}var bu=typeof WeakMap=="function"?WeakMap:Map;function na(d,m,C){C=ha(-1,C),C.tag=3,C.payload={element:null};var z=m.value;return C.callback=function(){$r||($r=!0,Gr=z),Ro(d,m)},C}function Ra(d,m,C){C=ha(-1,C),C.tag=3;var z=d.type.getDerivedStateFromError;if(typeof z=="function"){var W=m.value;C.payload=function(){return z(W)},C.callback=function(){Ro(d,m)}}var re=d.stateNode;return re!==null&&typeof re.componentDidCatch=="function"&&(C.callback=function(){Ro(d,m),typeof z!="function"&&(ho===null?ho=new Set([this]):ho.add(this));var _e=m.stack;this.componentDidCatch(m.value,{componentStack:_e!==null?_e:""})}),C}function Th(d,m,C){var z=d.pingCache;if(z===null){z=d.pingCache=new bu;var W=new Set;z.set(m,W)}else W=z.get(m),W===void 0&&(W=new Set,z.set(m,W));W.has(C)||(W.add(C),d=Up.bind(null,d,m,C),m.then(d,d))}function Rh(d){do{var m;if((m=d.tag===13)&&(m=d.memoizedState,m=m!==null?m.dehydrated!==null:!0),m)return d;d=d.return}while(d!==null);return null}function Ys(d,m,C,z,W){return(d.mode&1)===0?(d===m?d.flags|=65536:(d.flags|=128,C.flags|=131072,C.flags&=-52805,C.tag===1&&(C.alternate===null?C.tag=17:(m=ha(-1,1),m.tag=2,Ji(C,m,1))),C.lanes|=1),d):(d.flags|=65536,d.lanes=W,d)}var wu=s.ReactCurrentOwner,yi=!1;function Ni(d,m,C,z){m.child=d===null?vl(m,null,C,z):oo(m,d.child,C,z)}function zc(d,m,C,z,W){C=C.render;var re=m.ref;return Us(m,W),z=pu(d,m,C,z,re,W),C=Xu(),d!==null&&!yi?(m.updateQueue=d.updateQueue,m.flags&=-2053,d.lanes&=~W,Y(d,m,W)):(ct&&C&&ke(m),m.flags|=1,Ni(d,m,z,W),m.child)}function ws(d,m,C,z,W){if(d===null){var re=C.type;return typeof re=="function"&&!Gc(re)&&re.defaultProps===void 0&&C.compare===null&&C.defaultProps===void 0?(m.tag=15,m.type=re,Mo(d,m,re,z,W)):(d=jh(C.type,null,z,m,m.mode,W),d.ref=m.ref,d.return=m,m.child=d)}if(re=d.child,(d.lanes&W)===0){var _e=re.memoizedProps;if(C=C.compare,C=C!==null?C:Qi,C(_e,z)&&d.ref===m.ref)return Y(d,m,W)}return m.flags|=1,d=Pu(re,z),d.ref=m.ref,d.return=m,m.child=d}function Mo(d,m,C,z,W){if(d!==null){var re=d.memoizedProps;if(Qi(re,z)&&d.ref===m.ref)if(yi=!1,m.pendingProps=z=re,(d.lanes&W)!==0)(d.flags&131072)!==0&&(yi=!0);else return m.lanes=d.lanes,Y(d,m,W)}return _s(d,m,C,z,W)}function nr(d,m,C){var z=m.pendingProps,W=z.children,re=d!==null?d.memoizedState:null;if(z.mode==="hidden")if((m.mode&1)===0)m.memoizedState={baseLanes:0,cachePool:null,transitions:null},En(Zo,hi),hi|=C;else{if((C&1073741824)===0)return d=re!==null?re.baseLanes|C:C,m.lanes=m.childLanes=1073741824,m.memoizedState={baseLanes:d,cachePool:null,transitions:null},m.updateQueue=null,En(Zo,hi),hi|=d,null;m.memoizedState={baseLanes:0,cachePool:null,transitions:null},z=re!==null?re.baseLanes:C,En(Zo,hi),hi|=z}else re!==null?(z=re.baseLanes|C,m.memoizedState=null):z=C,En(Zo,hi),hi|=z;return Ni(d,m,W,C),m.child}function sr(d,m){var C=m.ref;(d===null&&C!==null||d!==null&&d.ref!==C)&&(m.flags|=512,m.flags|=2097152)}function _s(d,m,C,z,W){var re=Mr(C)?no:Rn.current;return re=Ki(m,re),Us(m,W),C=pu(d,m,C,z,re,W),z=Xu(),d!==null&&!yi?(m.updateQueue=d.updateQueue,m.flags&=-2053,d.lanes&=~W,Y(d,m,W)):(ct&&z&&ke(m),m.flags|=1,Ni(d,m,C,W),m.child)}function Hi(d,m,C,z,W){if(Mr(C)){var re=!0;ls(m)}else re=!1;if(Us(m,W),m.stateNode===null)R(d,m),Nh(m,C,z),ea(m,C,z,W),z=!0;else if(d===null){var _e=m.stateNode,Ye=m.memoizedProps;_e.props=Ye;var it=_e.context,wt=C.contextType;typeof wt=="object"&&wt!==null?wt=Ir(wt):(wt=Mr(C)?no:Rn.current,wt=Ki(m,wt));var $t=C.getDerivedStateFromProps,wn=typeof $t=="function"||typeof _e.getSnapshotBeforeUpdate=="function";wn||typeof _e.UNSAFE_componentWillReceiveProps!="function"&&typeof _e.componentWillReceiveProps!="function"||(Ye!==z||it!==wt)&&Bc(m,_e,z,wt),Oi=!1;var Tt=m.memoizedState;_e.state=Tt,lo(m,z,_e,W),it=m.memoizedState,Ye!==z||Tt!==it||Xi.current||Oi?(typeof $t=="function"&&(Fc(m,C,$t,z),it=m.memoizedState),(Ye=Oi||Lh(m,C,Ye,z,Tt,it,wt))?(wn||typeof _e.UNSAFE_componentWillMount!="function"&&typeof _e.componentWillMount!="function"||(typeof _e.componentWillMount=="function"&&_e.componentWillMount(),typeof _e.UNSAFE_componentWillMount=="function"&&_e.UNSAFE_componentWillMount()),typeof _e.componentDidMount=="function"&&(m.flags|=4194308)):(typeof _e.componentDidMount=="function"&&(m.flags|=4194308),m.memoizedProps=z,m.memoizedState=it),_e.props=z,_e.state=it,_e.context=wt,z=Ye):(typeof _e.componentDidMount=="function"&&(m.flags|=4194308),z=!1)}else{_e=m.stateNode,Wa(d,m),Ye=m.memoizedProps,wt=m.type===m.elementType?Ye:co(m.type,Ye),_e.props=wt,wn=m.pendingProps,Tt=_e.context,it=C.contextType,typeof it=="object"&&it!==null?it=Ir(it):(it=Mr(C)?no:Rn.current,it=Ki(m,it));var Fr=C.getDerivedStateFromProps;($t=typeof Fr=="function"||typeof _e.getSnapshotBeforeUpdate=="function")||typeof _e.UNSAFE_componentWillReceiveProps!="function"&&typeof _e.componentWillReceiveProps!="function"||(Ye!==wn||Tt!==it)&&Bc(m,_e,z,it),Oi=!1,Tt=m.memoizedState,_e.state=Tt,lo(m,z,_e,W);var mr=m.memoizedState;Ye!==wn||Tt!==mr||Xi.current||Oi?(typeof Fr=="function"&&(Fc(m,C,Fr,z),mr=m.memoizedState),(wt=Oi||Lh(m,C,wt,z,Tt,mr,it)||!1)?($t||typeof _e.UNSAFE_componentWillUpdate!="function"&&typeof _e.componentWillUpdate!="function"||(typeof _e.componentWillUpdate=="function"&&_e.componentWillUpdate(z,mr,it),typeof _e.UNSAFE_componentWillUpdate=="function"&&_e.UNSAFE_componentWillUpdate(z,mr,it)),typeof _e.componentDidUpdate=="function"&&(m.flags|=4),typeof _e.getSnapshotBeforeUpdate=="function"&&(m.flags|=1024)):(typeof _e.componentDidUpdate!="function"||Ye===d.memoizedProps&&Tt===d.memoizedState||(m.flags|=4),typeof _e.getSnapshotBeforeUpdate!="function"||Ye===d.memoizedProps&&Tt===d.memoizedState||(m.flags|=1024),m.memoizedProps=z,m.memoizedState=mr),_e.props=z,_e.state=mr,_e.context=it,z=wt):(typeof _e.componentDidUpdate!="function"||Ye===d.memoizedProps&&Tt===d.memoizedState||(m.flags|=4),typeof _e.getSnapshotBeforeUpdate!="function"||Ye===d.memoizedProps&&Tt===d.memoizedState||(m.flags|=1024),z=!1)}return va(d,m,C,z,re,W)}function va(d,m,C,z,W,re){sr(d,m);var _e=(m.flags&128)!==0;if(!z&&!_e)return W&&Vu(m,C,!1),Y(d,m,re);z=m.stateNode,wu.current=m;var Ye=_e&&typeof C.getDerivedStateFromError!="function"?null:z.render();return m.flags|=1,d!==null&&_e?(m.child=oo(m,d.child,null,re),m.child=oo(m,null,Ye,re)):Ni(d,m,Ye,re),m.memoizedState=z.state,W&&Vu(m,C,!0),m.child}function _l(d){var m=d.stateNode;m.pendingContext?ul(d,m.pendingContext,m.pendingContext!==m.context):m.context&&ul(d,m.context,!1),yl(d,m.containerInfo)}function Hl(d,m,C,z,W){return _r(),Ai(W),m.flags|=256,Ni(d,m,C,z),m.child}var ma={dehydrated:null,treeContext:null,retryLane:0};function _u(d){return{baseLanes:d,cachePool:null,transitions:null}}function jf(d,m,C){var z=m.pendingProps,W=tr.current,re=!1,_e=(m.flags&128)!==0,Ye;if((Ye=_e)||(Ye=d!==null&&d.memoizedState===null?!1:(W&2)!==0),Ye?(re=!0,m.flags&=-129):(d===null||d.memoizedState!==null)&&(W|=1),En(tr,W&1),d===null)return Ar(m),d=m.memoizedState,d!==null&&(d=d.dehydrated,d!==null)?((m.mode&1)===0?m.lanes=1:Un(d)?m.lanes=8:m.lanes=1073741824,null):(_e=z.children,d=z.fallback,re?(z=m.mode,re=m.child,_e={mode:"hidden",children:_e},(z&1)===0&&re!==null?(re.childLanes=0,re.pendingProps=_e):re=Wc(_e,z,0,null),d=Ma(d,z,C,null),re.return=m,d.return=m,re.sibling=d,m.child=re,m.child.memoizedState=_u(C),m.memoizedState=ma,d):tc(m,_e));if(W=d.memoizedState,W!==null&&(Ye=W.dehydrated,Ye!==null))return Mh(d,m,_e,z,Ye,W,C);if(re){re=z.fallback,_e=m.mode,W=d.child,Ye=W.sibling;var it={mode:"hidden",children:z.children};return(_e&1)===0&&m.child!==W?(z=m.child,z.childLanes=0,z.pendingProps=it,m.deletions=null):(z=Pu(W,it),z.subtreeFlags=W.subtreeFlags&14680064),Ye!==null?re=Pu(Ye,re):(re=Ma(re,_e,C,null),re.flags|=2),re.return=m,z.return=m,z.sibling=re,m.child=z,z=re,re=m.child,_e=d.child.memoizedState,_e=_e===null?_u(C):{baseLanes:_e.baseLanes|C,cachePool:null,transitions:_e.transitions},re.memoizedState=_e,re.childLanes=d.childLanes&~C,m.memoizedState=ma,z}return re=d.child,d=re.sibling,z=Pu(re,{mode:"visible",children:z.children}),(m.mode&1)===0&&(z.lanes=C),z.return=m,z.sibling=null,d!==null&&(C=m.deletions,C===null?(m.deletions=[d],m.flags|=16):C.push(d)),m.child=z,m.memoizedState=null,z}function tc(d,m){return m=Wc({mode:"visible",children:m},d.mode,0,null),m.return=d,d.child=m}function xs(d,m,C,z){return z!==null&&Ai(z),oo(m,d.child,null,C),d=tc(m,m.pendingProps.children),d.flags|=2,m.memoizedState=null,d}function Mh(d,m,C,z,W,re,_e){if(C)return m.flags&256?(m.flags&=-257,z=ga(Error(o(422))),xs(d,m,_e,z)):m.memoizedState!==null?(m.child=d.child,m.flags|=128,null):(re=z.fallback,W=m.mode,z=Wc({mode:"visible",children:z.children},W,0,null),re=Ma(re,W,_e,null),re.flags|=2,z.return=m,re.return=m,z.sibling=re,m.child=z,(m.mode&1)!==0&&oo(m,d.child,null,_e),m.child.memoizedState=_u(_e),m.memoizedState=ma,re);if((m.mode&1)===0)return xs(d,m,_e,null);if(Un(W))return z=Er(W).digest,re=Error(o(419)),z=ga(re,z,void 0),xs(d,m,_e,z);if(C=(_e&d.childLanes)!==0,yi||C){if(z=jn,z!==null){switch(_e&-_e){case 4:W=2;break;case 16:W=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:W=32;break;case 536870912:W=268435456;break;default:W=0}W=(W&(z.suspendedLanes|_e))!==0?0:W,W!==0&&W!==re.retryLane&&(re.retryLane=W,qi(d,W),_a(z,d,W,-1))}return vo(),z=ga(Error(o(421))),xs(d,m,_e,z)}return Yi(W)?(m.flags|=128,m.child=d.child,m=$p.bind(null,d),Rr(W,m),null):(d=re.treeContext,Me&&(at=eo(W),Ge=m,ct=!0,jt=null,Dt=!1,d!==null&&(Br[fa++]=vi,Br[fa++]=$a,Br[fa++]=Qr,vi=d.id,$a=d.overflow,Qr=m)),m=tc(m,z.children),m.flags|=4096,m)}function Ss(d,m,C){d.lanes|=m;var z=d.alternate;z!==null&&(z.lanes|=m),Lo(d.return,m,C)}function $l(d,m,C,z,W){var re=d.memoizedState;re===null?d.memoizedState={isBackwards:m,rendering:null,renderingStartTime:0,last:z,tail:C,tailMode:W}:(re.isBackwards=m,re.rendering=null,re.renderingStartTime=0,re.last=z,re.tail=C,re.tailMode=W)}function P(d,m,C){var z=m.pendingProps,W=z.revealOrder,re=z.tail;if(Ni(d,m,z.children,C),z=tr.current,(z&2)!==0)z=z&1|2,m.flags|=128;else{if(d!==null&&(d.flags&128)!==0)e:for(d=m.child;d!==null;){if(d.tag===13)d.memoizedState!==null&&Ss(d,C,m);else if(d.tag===19)Ss(d,C,m);else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===m)break e;for(;d.sibling===null;){if(d.return===null||d.return===m)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}z&=1}if(En(tr,z),(m.mode&1)===0)m.memoizedState=null;else switch(W){case"forwards":for(C=m.child,W=null;C!==null;)d=C.alternate,d!==null&&ms(d)===null&&(W=C),C=C.sibling;C=W,C===null?(W=m.child,m.child=null):(W=C.sibling,C.sibling=null),$l(m,!1,W,C,re);break;case"backwards":for(C=null,W=m.child,m.child=null;W!==null;){if(d=W.alternate,d!==null&&ms(d)===null){m.child=W;break}d=W.sibling,W.sibling=C,C=W,W=d}$l(m,!0,C,null,re);break;case"together":$l(m,!1,null,null,void 0);break;default:m.memoizedState=null}return m.child}function R(d,m){(m.mode&1)===0&&d!==null&&(d.alternate=null,m.alternate=null,m.flags|=2)}function Y(d,m,C){if(d!==null&&(m.dependencies=d.dependencies),Xs|=m.lanes,(C&m.childLanes)===0)return null;if(d!==null&&m.child!==d.child)throw Error(o(153));if(m.child!==null){for(d=m.child,C=Pu(d,d.pendingProps),m.child=C,C.return=m;d.sibling!==null;)d=d.sibling,C=C.sibling=Pu(d,d.pendingProps),C.return=m;C.sibling=null}return m.child}function ne(d,m,C){switch(m.tag){case 3:_l(m),_r();break;case 5:gs(m);break;case 1:Mr(m.type)&&ls(m);break;case 4:yl(m,m.stateNode.containerInfo);break;case 10:zr(m,m.type._context,m.memoizedProps.value);break;case 13:var z=m.memoizedState;if(z!==null)return z.dehydrated!==null?(En(tr,tr.current&1),m.flags|=128,null):(C&m.child.childLanes)!==0?jf(d,m,C):(En(tr,tr.current&1),d=Y(d,m,C),d!==null?d.sibling:null);En(tr,tr.current&1);break;case 19:if(z=(C&m.childLanes)!==0,(d.flags&128)!==0){if(z)return P(d,m,C);m.flags|=128}var W=m.memoizedState;if(W!==null&&(W.rendering=null,W.tail=null,W.lastEffect=null),En(tr,tr.current),z)break;return null;case 22:case 23:return m.lanes=0,nr(d,m,C)}return Y(d,m,C)}function le(d){d.flags|=4}function pe(d,m){if(d!==null&&d.child===m.child)return!0;if((m.flags&16)!==0)return!1;for(d=m.child;d!==null;){if((d.flags&12854)!==0||(d.subtreeFlags&12854)!==0)return!1;d=d.sibling}return!0}var ve,be,we,Se;if(Re)ve=function(d,m){for(var C=m.child;C!==null;){if(C.tag===5||C.tag===6)D(d,C.stateNode);else if(C.tag!==4&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===m)break;for(;C.sibling===null;){if(C.return===null||C.return===m)return;C=C.return}C.sibling.return=C.return,C=C.sibling}},be=function(){},we=function(d,m,C,z,W){if(d=d.memoizedProps,d!==z){var re=m.stateNode,_e=da(ci.current);C=X(re,C,d,z,W,_e),(m.updateQueue=C)&&le(m)}},Se=function(d,m,C,z){C!==z&&le(m)};else if(Oe){ve=function(d,m,C,z){for(var W=m.child;W!==null;){if(W.tag===5){var re=W.stateNode;C&&z&&(re=Sr(re,W.type,W.memoizedProps,W)),D(d,re)}else if(W.tag===6)re=W.stateNode,C&&z&&(re=Qt(re,W.memoizedProps,W)),D(d,re);else if(W.tag!==4){if(W.tag===22&&W.memoizedState!==null)re=W.child,re!==null&&(re.return=W),ve(d,W,!0,!0);else if(W.child!==null){W.child.return=W,W=W.child;continue}}if(W===m)break;for(;W.sibling===null;){if(W.return===null||W.return===m)return;W=W.return}W.sibling.return=W.return,W=W.sibling}};var Fe=function(d,m,C,z){for(var W=m.child;W!==null;){if(W.tag===5){var re=W.stateNode;C&&z&&(re=Sr(re,W.type,W.memoizedProps,W)),Bi(d,re)}else if(W.tag===6)re=W.stateNode,C&&z&&(re=Qt(re,W.memoizedProps,W)),Bi(d,re);else if(W.tag!==4){if(W.tag===22&&W.memoizedState!==null)re=W.child,re!==null&&(re.return=W),Fe(d,W,!0,!0);else if(W.child!==null){W.child.return=W,W=W.child;continue}}if(W===m)break;for(;W.sibling===null;){if(W.return===null||W.return===m)return;W=W.return}W.sibling.return=W.return,W=W.sibling}};be=function(d,m){var C=m.stateNode;if(!pe(d,m)){d=C.containerInfo;var z=gn(d);Fe(z,m,!1,!1),C.pendingChildren=z,le(m),oi(d,z)}},we=function(d,m,C,z,W){var re=d.stateNode,_e=d.memoizedProps;if((d=pe(d,m))&&_e===z)m.stateNode=re;else{var Ye=m.stateNode,it=da(ci.current),wt=null;_e!==z&&(wt=X(Ye,C,_e,z,W,it)),d&&wt===null?m.stateNode=re:(re=en(re,wt,C,_e,z,m,d,Ye),U(re,C,z,W,it)&&le(m),m.stateNode=re,d?le(m):ve(re,m,!1,!1))}},Se=function(d,m,C,z){C!==z?(d=da(To.current),C=da(ci.current),m.stateNode=K(z,d,C,m),le(m)):m.stateNode=d.stateNode}}else be=function(){},we=function(){},Se=function(){};function Je(d,m){if(!ct)switch(d.tailMode){case"hidden":m=d.tail;for(var C=null;m!==null;)m.alternate!==null&&(C=m),m=m.sibling;C===null?d.tail=null:C.sibling=null;break;case"collapsed":C=d.tail;for(var z=null;C!==null;)C.alternate!==null&&(z=C),C=C.sibling;z===null?m||d.tail===null?d.tail=null:d.tail.sibling=null:z.sibling=null}}function xe(d){var m=d.alternate!==null&&d.alternate.child===d.child,C=0,z=0;if(m)for(var W=d.child;W!==null;)C|=W.lanes|W.childLanes,z|=W.subtreeFlags&14680064,z|=W.flags&14680064,W.return=d,W=W.sibling;else for(W=d.child;W!==null;)C|=W.lanes|W.childLanes,z|=W.subtreeFlags,z|=W.flags,W.return=d,W=W.sibling;return d.subtreeFlags|=z,d.childLanes=C,m}function $e(d,m,C){var z=m.pendingProps;switch(De(m),m.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xe(m),null;case 1:return Mr(m.type)&&Zi(),xe(m),null;case 3:return C=m.stateNode,Vo(),cr(Xi),cr(Rn),Hs(),C.pendingContext&&(C.context=C.pendingContext,C.pendingContext=null),(d===null||d.child===null)&&(or(m)?le(m):d===null||d.memoizedState.isDehydrated&&(m.flags&256)===0||(m.flags|=1024,jt!==null&&(nc(jt),jt=null))),be(d,m),xe(m),null;case 5:vs(m),C=da(To.current);var W=m.type;if(d!==null&&m.stateNode!=null)we(d,m,W,z,C),d.ref!==m.ref&&(m.flags|=512,m.flags|=2097152);else{if(!z){if(m.stateNode===null)throw Error(o(166));return xe(m),null}if(d=da(ci.current),or(m)){if(!Me)throw Error(o(175));d=si(m.stateNode,m.type,m.memoizedProps,C,d,m,!Dt),m.updateQueue=d,d!==null&&le(m)}else{var re=B(W,z,C,d,m);ve(re,m,!1,!1),m.stateNode=re,U(re,W,z,C,d)&&le(m)}m.ref!==null&&(m.flags|=512,m.flags|=2097152)}return xe(m),null;case 6:if(d&&m.stateNode!=null)Se(d,m,d.memoizedProps,z);else{if(typeof z!="string"&&m.stateNode===null)throw Error(o(166));if(d=da(To.current),C=da(ci.current),or(m)){if(!Me)throw Error(o(176));if(d=m.stateNode,C=m.memoizedProps,(z=ka(d,C,m,!Dt))&&(W=Ge,W!==null))switch(W.tag){case 3:Tf(W.stateNode.containerInfo,d,C,(W.mode&1)!==0);break;case 5:kr(W.type,W.memoizedProps,W.stateNode,d,C,(W.mode&1)!==0)}z&&le(m)}else m.stateNode=K(z,d,C,m)}return xe(m),null;case 13:if(cr(tr),z=m.memoizedState,d===null||d.memoizedState!==null&&d.memoizedState.dehydrated!==null){if(ct&&at!==null&&(m.mode&1)!==0&&(m.flags&128)===0)mi(),_r(),m.flags|=98560,W=!1;else if(W=or(m),z!==null&&z.dehydrated!==null){if(d===null){if(!W)throw Error(o(318));if(!Me)throw Error(o(344));if(W=m.memoizedState,W=W!==null?W.dehydrated:null,!W)throw Error(o(317));Aa(W,m)}else _r(),(m.flags&128)===0&&(m.memoizedState=null),m.flags|=4;xe(m),W=!1}else jt!==null&&(nc(jt),jt=null),W=!0;if(!W)return m.flags&65536?m:null}return(m.flags&128)!==0?(m.lanes=C,m):(C=z!==null,C!==(d!==null&&d.memoizedState!==null)&&C&&(m.child.flags|=8192,(m.mode&1)!==0&&(d===null||(tr.current&1)!==0?hr===0&&(hr=3):vo())),m.updateQueue!==null&&(m.flags|=4),xe(m),null);case 4:return Vo(),be(d,m),d===null&&ge(m.stateNode.containerInfo),xe(m),null;case 10:return so(m.type._context),xe(m),null;case 17:return Mr(m.type)&&Zi(),xe(m),null;case 19:if(cr(tr),W=m.memoizedState,W===null)return xe(m),null;if(z=(m.flags&128)!==0,re=W.rendering,re===null)if(z)Je(W,!1);else{if(hr!==0||d!==null&&(d.flags&128)!==0)for(d=m.child;d!==null;){if(re=ms(d),re!==null){for(m.flags|=128,Je(W,!1),d=re.updateQueue,d!==null&&(m.updateQueue=d,m.flags|=4),m.subtreeFlags=0,d=C,C=m.child;C!==null;)z=C,W=d,z.flags&=14680066,re=z.alternate,re===null?(z.childLanes=0,z.lanes=W,z.child=null,z.subtreeFlags=0,z.memoizedProps=null,z.memoizedState=null,z.updateQueue=null,z.dependencies=null,z.stateNode=null):(z.childLanes=re.childLanes,z.lanes=re.lanes,z.child=re.child,z.subtreeFlags=0,z.deletions=null,z.memoizedProps=re.memoizedProps,z.memoizedState=re.memoizedState,z.updateQueue=re.updateQueue,z.type=re.type,W=re.dependencies,z.dependencies=W===null?null:{lanes:W.lanes,firstContext:W.firstContext}),C=C.sibling;return En(tr,tr.current&1|2),m.child}d=d.sibling}W.tail!==null&&wr()>Eu&&(m.flags|=128,z=!0,Je(W,!1),m.lanes=4194304)}else{if(!z)if(d=ms(re),d!==null){if(m.flags|=128,z=!0,d=d.updateQueue,d!==null&&(m.updateQueue=d,m.flags|=4),Je(W,!0),W.tail===null&&W.tailMode==="hidden"&&!re.alternate&&!ct)return xe(m),null}else 2*wr()-W.renderingStartTime>Eu&&C!==1073741824&&(m.flags|=128,z=!0,Je(W,!1),m.lanes=4194304);W.isBackwards?(re.sibling=m.child,m.child=re):(d=W.last,d!==null?d.sibling=re:m.child=re,W.last=re)}return W.tail!==null?(m=W.tail,W.rendering=m,W.tail=m.sibling,W.renderingStartTime=wr(),m.sibling=null,d=tr.current,En(tr,z?d&1|2:d&1),m):(xe(m),null);case 22:case 23:return Au(),C=m.memoizedState!==null,d!==null&&d.memoizedState!==null!==C&&(m.flags|=8192),C&&(m.mode&1)!==0?(hi&1073741824)!==0&&(xe(m),Re&&m.subtreeFlags&6&&(m.flags|=8192)):xe(m),null;case 24:return null;case 25:return null}throw Error(o(156,m.tag))}function Qe(d,m){switch(De(m),m.tag){case 1:return Mr(m.type)&&Zi(),d=m.flags,d&65536?(m.flags=d&-65537|128,m):null;case 3:return Vo(),cr(Xi),cr(Rn),Hs(),d=m.flags,(d&65536)!==0&&(d&128)===0?(m.flags=d&-65537|128,m):null;case 5:return vs(m),null;case 13:if(cr(tr),d=m.memoizedState,d!==null&&d.dehydrated!==null){if(m.alternate===null)throw Error(o(340));_r()}return d=m.flags,d&65536?(m.flags=d&-65537|128,m):null;case 19:return cr(tr),null;case 4:return Vo(),null;case 10:return so(m.type._context),null;case 22:case 23:return Au(),null;case 24:return null;default:return null}}var lt=!1,Xe=!1,ot=typeof WeakSet=="function"?WeakSet:Set,He=null;function ft(d,m){var C=d.ref;if(C!==null)if(typeof C=="function")try{C(null)}catch(z){Vr(d,m,z)}else C.current=null}function ht(d,m,C){try{C()}catch(z){Vr(d,m,z)}}var Wt=!1;function Bt(d,m){for(te(d.containerInfo),He=m;He!==null;)if(d=He,m=d.child,(d.subtreeFlags&1028)!==0&&m!==null)m.return=d,He=m;else for(;He!==null;){d=He;try{var C=d.alternate;if((d.flags&1024)!==0)switch(d.tag){case 0:case 11:case 15:break;case 1:if(C!==null){var z=C.memoizedProps,W=C.memoizedState,re=d.stateNode,_e=re.getSnapshotBeforeUpdate(d.elementType===d.type?z:co(d.type,z),W);re.__reactInternalSnapshotBeforeUpdate=_e}break;case 3:Re&&Sn(d.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(Ye){Vr(d,d.return,Ye)}if(m=d.sibling,m!==null){m.return=d.return,He=m;break}He=d.return}return C=Wt,Wt=!1,C}function dn(d,m,C){var z=m.updateQueue;if(z=z!==null?z.lastEffect:null,z!==null){var W=z=z.next;do{if((W.tag&d)===d){var re=W.destroy;W.destroy=void 0,re!==void 0&&ht(m,C,re)}W=W.next}while(W!==z)}}function zt(d,m){if(m=m.updateQueue,m=m!==null?m.lastEffect:null,m!==null){var C=m=m.next;do{if((C.tag&d)===d){var z=C.create;C.destroy=z()}C=C.next}while(C!==m)}}function On(d){var m=d.ref;if(m!==null){var C=d.stateNode;switch(d.tag){case 5:d=ae(C);break;default:d=C}typeof m=="function"?m(d):m.current=d}}function qr(d){var m=d.alternate;m!==null&&(d.alternate=null,qr(m)),d.child=null,d.deletions=null,d.sibling=null,d.tag===5&&(m=d.stateNode,m!==null&&Be(m)),d.stateNode=null,d.return=null,d.dependencies=null,d.memoizedProps=null,d.memoizedState=null,d.pendingProps=null,d.stateNode=null,d.updateQueue=null}function mn(d){return d.tag===5||d.tag===3||d.tag===4}function Ft(d){e:for(;;){for(;d.sibling===null;){if(d.return===null||mn(d.return))return null;d=d.return}for(d.sibling.return=d.return,d=d.sibling;d.tag!==5&&d.tag!==6&&d.tag!==18;){if(d.flags&2||d.child===null||d.tag===4)continue e;d.child.return=d,d=d.child}if(!(d.flags&2))return d.stateNode}}function St(d,m,C){var z=d.tag;if(z===5||z===6)d=d.stateNode,m?It(C,d,m):xt(C,d);else if(z!==4&&(d=d.child,d!==null))for(St(d,m,C),d=d.sibling;d!==null;)St(d,m,C),d=d.sibling}function Ur(d,m,C){var z=d.tag;if(z===5||z===6)d=d.stateNode,m?xn(C,d,m):pt(C,d);else if(z!==4&&(d=d.child,d!==null))for(Ur(d,m,C),d=d.sibling;d!==null;)Ur(d,m,C),d=d.sibling}var Ht=null,pn=!1;function In(d,m,C){for(C=C.child;C!==null;)bi(d,m,C),C=C.sibling}function bi(d,m,C){if(ki&&typeof ki.onCommitFiberUnmount=="function")try{ki.onCommitFiberUnmount(Ua,C)}catch{}switch(C.tag){case 5:Xe||ft(C,m);case 6:if(Re){var z=Ht,W=pn;Ht=null,In(d,m,C),Ht=z,pn=W,Ht!==null&&(pn?Ve(Ht,C.stateNode):Jt(Ht,C.stateNode))}else In(d,m,C);break;case 18:Re&&Ht!==null&&(pn?is(Ht,C.stateNode):Bs(Ht,C.stateNode));break;case 4:Re?(z=Ht,W=pn,Ht=C.stateNode.containerInfo,pn=!0,In(d,m,C),Ht=z,pn=W):(Oe&&(z=C.stateNode.containerInfo,W=gn(z),Ei(z,W)),In(d,m,C));break;case 0:case 11:case 14:case 15:if(!Xe&&(z=C.updateQueue,z!==null&&(z=z.lastEffect,z!==null))){W=z=z.next;do{var re=W,_e=re.destroy;re=re.tag,_e!==void 0&&((re&2)!==0||(re&4)!==0)&&ht(C,m,_e),W=W.next}while(W!==z)}In(d,m,C);break;case 1:if(!Xe&&(ft(C,m),z=C.stateNode,typeof z.componentWillUnmount=="function"))try{z.props=C.memoizedProps,z.state=C.memoizedState,z.componentWillUnmount()}catch(Ye){Vr(C,m,Ye)}In(d,m,C);break;case 21:In(d,m,C);break;case 22:C.mode&1?(Xe=(z=Xe)||C.memoizedState!==null,In(d,m,C),Xe=z):In(d,m,C);break;default:In(d,m,C)}}function fi(d){var m=d.updateQueue;if(m!==null){d.updateQueue=null;var C=d.stateNode;C===null&&(C=d.stateNode=new ot),m.forEach(function(z){var W=rg.bind(null,d,z);C.has(z)||(C.add(z),z.then(W,W))})}}function $n(d,m){var C=m.deletions;if(C!==null)for(var z=0;z<C.length;z++){var W=C[z];try{var re=d,_e=m;if(Re){var Ye=_e;e:for(;Ye!==null;){switch(Ye.tag){case 5:Ht=Ye.stateNode,pn=!1;break e;case 3:Ht=Ye.stateNode.containerInfo,pn=!0;break e;case 4:Ht=Ye.stateNode.containerInfo,pn=!0;break e}Ye=Ye.return}if(Ht===null)throw Error(o(160));bi(re,_e,W),Ht=null,pn=!1}else bi(re,_e,W);var it=W.alternate;it!==null&&(it.return=null),W.return=null}catch(wt){Vr(W,m,wt)}}if(m.subtreeFlags&12854)for(m=m.child;m!==null;)wi(m,d),m=m.sibling}function wi(d,m){var C=d.alternate,z=d.flags;switch(d.tag){case 0:case 11:case 14:case 15:if($n(m,d),vr(d),z&4){try{dn(3,d,d.return),zt(3,d)}catch(Tt){Vr(d,d.return,Tt)}try{dn(5,d,d.return)}catch(Tt){Vr(d,d.return,Tt)}}break;case 1:$n(m,d),vr(d),z&512&&C!==null&&ft(C,C.return);break;case 5:if($n(m,d),vr(d),z&512&&C!==null&&ft(C,C.return),Re){if(d.flags&32){var W=d.stateNode;try{qe(W)}catch(Tt){Vr(d,d.return,Tt)}}if(z&4&&(W=d.stateNode,W!=null)){var re=d.memoizedProps;if(C=C!==null?C.memoizedProps:re,z=d.type,m=d.updateQueue,d.updateQueue=null,m!==null)try{qn(W,m,z,C,re,d)}catch(Tt){Vr(d,d.return,Tt)}}}break;case 6:if($n(m,d),vr(d),z&4&&Re){if(d.stateNode===null)throw Error(o(162));W=d.stateNode,re=d.memoizedProps,C=C!==null?C.memoizedProps:re;try{bt(W,C,re)}catch(Tt){Vr(d,d.return,Tt)}}break;case 3:if($n(m,d),vr(d),z&4){if(Re&&Me&&C!==null&&C.memoizedState.isDehydrated)try{zi(m.containerInfo)}catch(Tt){Vr(d,d.return,Tt)}if(Oe){W=m.containerInfo,re=m.pendingChildren;try{Ei(W,re)}catch(Tt){Vr(d,d.return,Tt)}}}break;case 4:if($n(m,d),vr(d),z&4&&Oe){re=d.stateNode,W=re.containerInfo,re=re.pendingChildren;try{Ei(W,re)}catch(Tt){Vr(d,d.return,Tt)}}break;case 13:$n(m,d),vr(d),W=d.child,W.flags&8192&&(re=W.memoizedState!==null,W.stateNode.isHidden=re,!re||W.alternate!==null&&W.alternate.memoizedState!==null||(Su=wr())),z&4&&fi(d);break;case 22:var _e=C!==null&&C.memoizedState!==null;if(d.mode&1?(Xe=(C=Xe)||_e,$n(m,d),Xe=C):$n(m,d),vr(d),z&8192){if(C=d.memoizedState!==null,(d.stateNode.isHidden=C)&&!_e&&(d.mode&1)!==0)for(He=d,z=d.child;z!==null;){for(m=He=z;He!==null;){_e=He;var Ye=_e.child;switch(_e.tag){case 0:case 11:case 14:case 15:dn(4,_e,_e.return);break;case 1:ft(_e,_e.return);var it=_e.stateNode;if(typeof it.componentWillUnmount=="function"){var wt=_e,$t=_e.return;try{var wn=wt;it.props=wn.memoizedProps,it.state=wn.memoizedState,it.componentWillUnmount()}catch(Tt){Vr(wt,$t,Tt)}}break;case 5:ft(_e,_e.return);break;case 22:if(_e.memoizedState!==null){Or(m);continue}}Ye!==null?(Ye.return=_e,He=Ye):Or(m)}z=z.sibling}if(Re){e:if(z=null,Re)for(m=d;;){if(m.tag===5){if(z===null){z=m;try{W=m.stateNode,C?Nt(W):an(m.stateNode,m.memoizedProps)}catch(Tt){Vr(d,d.return,Tt)}}}else if(m.tag===6){if(z===null)try{re=m.stateNode,C?Ct(re):Ut(re,m.memoizedProps)}catch(Tt){Vr(d,d.return,Tt)}}else if((m.tag!==22&&m.tag!==23||m.memoizedState===null||m===d)&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===d)break e;for(;m.sibling===null;){if(m.return===null||m.return===d)break e;z===m&&(z=null),m=m.return}z===m&&(z=null),m.sibling.return=m.return,m=m.sibling}}}break;case 19:$n(m,d),vr(d),z&4&&fi(d);break;case 21:break;default:$n(m,d),vr(d)}}function vr(d){var m=d.flags;if(m&2){try{if(Re){e:{for(var C=d.return;C!==null;){if(mn(C)){var z=C;break e}C=C.return}throw Error(o(160))}switch(z.tag){case 5:var W=z.stateNode;z.flags&32&&(qe(W),z.flags&=-33);var re=Ft(d);Ur(d,re,W);break;case 3:case 4:var _e=z.stateNode.containerInfo,Ye=Ft(d);St(d,Ye,_e);break;default:throw Error(o(161))}}}catch(it){Vr(d,d.return,it)}d.flags&=-3}m&4096&&(d.flags&=-4097)}function jr(d,m,C){He=d,Tn(d)}function Tn(d,m,C){for(var z=(d.mode&1)!==0;He!==null;){var W=He,re=W.child;if(W.tag===22&&z){var _e=W.memoizedState!==null||lt;if(!_e){var Ye=W.alternate,it=Ye!==null&&Ye.memoizedState!==null||Xe;Ye=lt;var wt=Xe;if(lt=_e,(Xe=it)&&!wt)for(He=W;He!==null;)_e=He,it=_e.child,_e.tag===22&&_e.memoizedState!==null?Vn(W):it!==null?(it.return=_e,He=it):Vn(W);for(;re!==null;)He=re,Tn(re),re=re.sibling;He=W,lt=Ye,Xe=wt}Wn(d)}else(W.subtreeFlags&8772)!==0&&re!==null?(re.return=W,He=re):Wn(d)}}function Wn(d){for(;He!==null;){var m=He;if((m.flags&8772)!==0){var C=m.alternate;try{if((m.flags&8772)!==0)switch(m.tag){case 0:case 11:case 15:Xe||zt(5,m);break;case 1:var z=m.stateNode;if(m.flags&4&&!Xe)if(C===null)z.componentDidMount();else{var W=m.elementType===m.type?C.memoizedProps:co(m.type,C.memoizedProps);z.componentDidUpdate(W,C.memoizedState,z.__reactInternalSnapshotBeforeUpdate)}var re=m.updateQueue;re!==null&&Jr(m,re,z);break;case 3:var _e=m.updateQueue;if(_e!==null){if(C=null,m.child!==null)switch(m.child.tag){case 5:C=ae(m.child.stateNode);break;case 1:C=m.child.stateNode}Jr(m,_e,C)}break;case 5:var Ye=m.stateNode;C===null&&m.flags&4&&kt(Ye,m.type,m.memoizedProps,m);break;case 6:break;case 4:break;case 12:break;case 13:if(Me&&m.memoizedState===null){var it=m.alternate;if(it!==null){var wt=it.memoizedState;if(wt!==null){var $t=wt.dehydrated;$t!==null&&to($t)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}Xe||m.flags&512&&On(m)}catch(wn){Vr(m,m.return,wn)}}if(m===d){He=null;break}if(C=m.sibling,C!==null){C.return=m.return,He=C;break}He=m.return}}function Or(d){for(;He!==null;){var m=He;if(m===d){He=null;break}var C=m.sibling;if(C!==null){C.return=m.return,He=C;break}He=m.return}}function Vn(d){for(;He!==null;){var m=He;try{switch(m.tag){case 0:case 11:case 15:var C=m.return;try{zt(4,m)}catch(it){Vr(m,C,it)}break;case 1:var z=m.stateNode;if(typeof z.componentDidMount=="function"){var W=m.return;try{z.componentDidMount()}catch(it){Vr(m,W,it)}}var re=m.return;try{On(m)}catch(it){Vr(m,re,it)}break;case 5:var _e=m.return;try{On(m)}catch(it){Vr(m,_e,it)}}}catch(it){Vr(m,m.return,it)}if(m===d){He=null;break}var Ye=m.sibling;if(Ye!==null){Ye.return=m.return,He=Ye;break}He=m.return}}var Cr=0,Lr=1,rr=2,Ti=3,Zn=4;if(typeof Symbol=="function"&&Symbol.for){var Qn=Symbol.for;Cr=Qn("selector.component"),Lr=Qn("selector.has_pseudo_class"),rr=Qn("selector.role"),Ti=Qn("selector.test_id"),Zn=Qn("selector.text")}function ei(d){var m=Ee(d);if(m!=null){if(typeof m.memoizedProps["data-testname"]!="string")throw Error(o(364));return m}if(d=Ne(d),d===null)throw Error(o(362));return d.stateNode.current}function Ri(d,m){switch(m.$$typeof){case Cr:if(d.type===m.value)return!0;break;case Lr:e:{m=m.value,d=[d,0];for(var C=0;C<d.length;){var z=d[C++],W=d[C++],re=m[W];if(z.tag!==5||!Pe(z)){for(;re!=null&&Ri(z,re);)W++,re=m[W];if(W===m.length){m=!0;break e}else for(z=z.child;z!==null;)d.push(z,W),z=z.sibling}}m=!1}return m;case rr:if(d.tag===5&&Ue(d.stateNode,m.value))return!0;break;case Zn:if((d.tag===5||d.tag===6)&&(d=Ae(d),d!==null&&0<=d.indexOf(m.value)))return!0;break;case Ti:if(d.tag===5&&(d=d.memoizedProps["data-testname"],typeof d=="string"&&d.toLowerCase()===m.value.toLowerCase()))return!0;break;default:throw Error(o(365))}return!1}function ya(d){switch(d.$$typeof){case Cr:return"<"+(O(d.value)||"Unknown")+">";case Lr:return":has("+(ya(d)||"")+")";case rr:return'[role="'+d.value+'"]';case Zn:return'"'+d.value+'"';case Ti:return'[data-testname="'+d.value+'"]';default:throw Error(o(365))}}function ti(d,m){var C=[];d=[d,0];for(var z=0;z<d.length;){var W=d[z++],re=d[z++],_e=m[re];if(W.tag!==5||!Pe(W)){for(;_e!=null&&Ri(W,_e);)re++,_e=m[re];if(re===m.length)C.push(W);else for(W=W.child;W!==null;)d.push(W,re),W=W.sibling}}return C}function Hr(d,m){if(!Le)throw Error(o(363));d=ei(d),d=ti(d,m),m=[],d=Array.from(d);for(var C=0;C<d.length;){var z=d[C++];if(z.tag===5)Pe(z)||m.push(z.stateNode);else for(z=z.child;z!==null;)d.push(z),z=z.sibling}return m}var ba=Math.ceil,ir=s.ReactCurrentDispatcher,$i=s.ReactCurrentOwner,Yn=s.ReactCurrentBatchConfig,ln=0,jn=null,An=null,Dr=0,hi=0,Zo=gi(0),hr=0,xu=null,Xs=0,dr=0,fo=0,Gl=null,wa=null,Su=0,Eu=1/0,Gi=null;function lr(){Eu=wr()+500}var $r=!1,Gr=null,ho=null,Io=!1,po=null,qc=0,Wr=0,ku=null,xl=-1,go=0;function xr(){return(ln&6)!==0?wr():xl!==-1?xl:xl=wr()}function _i(d){return(d.mode&1)===0?1:(ln&2)!==0&&Dr!==0?Dr&-Dr:Po.transition!==null?(go===0&&(go=fs()),go):(d=Pt,d!==0?d:Te())}function _a(d,m,C,z){if(50<Wr)throw Wr=0,ku=null,Error(o(185));Ba(d,C,z),((ln&2)===0||d!==jn)&&(d===jn&&((ln&2)===0&&(dr|=C),hr===4&&Es(d,Dr)),ra(d,z),C===1&&ln===0&&(m.mode&1)===0&&(lr(),Eo&&li()))}function ra(d,m){var C=d.callbackNode;Pc(d,m);var z=cl(d,d===jn?Dr:0);if(z===0)C!==null&&Oc(C),d.callbackNode=null,d.callbackPriority=0;else if(m=z&-z,d.callbackPriority!==m){if(C!=null&&Oc(C),m===1)d.tag===0?Rl(Df.bind(null,d)):dl(Df.bind(null,d)),Ce?fe(function(){(ln&6)===0&&li()}):So(fu,li),C=null;else{switch(hl(z)){case 1:C=fu;break;case 4:C=hu;break;case 16:C=zs;break;case 536870912:C=Yu;break;default:C=zs}C=Cd(C,Ks.bind(null,d))}d.callbackPriority=m,d.callbackNode=C}}function Ks(d,m){if(xl=-1,go=0,(ln&6)!==0)throw Error(o(327));var C=d.callbackNode;if(Vl()&&d.callbackNode!==C)return null;var z=cl(d,d===jn?Dr:0);if(z===0)return null;if((z&30)!==0||(z&d.expiredLanes)!==0||m)m=As(d,z);else{m=z;var W=ln;ln|=2;var re=ks();(jn!==d||Dr!==m)&&(Gi=null,lr(),Qo(d,m));do try{$c();break}catch(Ye){Xa(d,Ye)}while(!0);Il(),ir.current=re,ln=W,An!==null?m=0:(jn=null,Dr=0,m=hr)}if(m!==0){if(m===2&&(W=fl(d),W!==0&&(z=W,m=Uc(d,W))),m===1)throw C=xu,Qo(d,0),Es(d,z),ra(d,wr()),C;if(m===6)Es(d,z);else{if(W=d.current.alternate,(z&30)===0&&!Ih(W)&&(m=As(d,z),m===2&&(re=fl(d),re!==0&&(z=re,m=Uc(d,re))),m===1))throw C=xu,Qo(d,0),Es(d,z),ra(d,wr()),C;switch(d.finishedWork=W,d.finishedLanes=z,m){case 0:case 1:throw Error(o(345));case 2:Ps(d,wa,Gi);break;case 3:if(Es(d,z),(z&130023424)===z&&(m=Su+500-wr(),10<m)){if(cl(d,0)!==0)break;if(W=d.suspendedLanes,(W&z)!==z){xr(),d.pingedLanes|=d.suspendedLanes&W;break}d.timeoutHandle=oe(Ps.bind(null,d,wa,Gi),m);break}Ps(d,wa,Gi);break;case 4:if(Es(d,z),(z&4194240)===z)break;for(m=d.eventTimes,W=-1;0<z;){var _e=31-Oa(z);re=1<<_e,_e=m[_e],_e>W&&(W=_e),z&=~re}if(z=W,z=wr()-z,z=(120>z?120:480>z?480:1080>z?1080:1920>z?1920:3e3>z?3e3:4320>z?4320:1960*ba(z/1960))-z,10<z){d.timeoutHandle=oe(Ps.bind(null,d,wa,Gi),z);break}Ps(d,wa,Gi);break;case 5:Ps(d,wa,Gi);break;default:throw Error(o(329))}}}return ra(d,wr()),d.callbackNode===C?Ks.bind(null,d):null}function Uc(d,m){var C=Gl;return d.current.memoizedState.isDehydrated&&(Qo(d,m).flags|=256),d=As(d,m),d!==2&&(m=wa,wa=C,m!==null&&nc(m)),d}function nc(d){wa===null?wa=d:wa.push.apply(wa,d)}function Ih(d){for(var m=d;;){if(m.flags&16384){var C=m.updateQueue;if(C!==null&&(C=C.stores,C!==null))for(var z=0;z<C.length;z++){var W=C[z],re=W.getSnapshot;W=W.value;try{if(!Ca(re(),W))return!1}catch{return!1}}}if(C=m.child,m.subtreeFlags&16384&&C!==null)C.return=m,m=C;else{if(m===d)break;for(;m.sibling===null;){if(m.return===null||m.return===d)return!0;m=m.return}m.sibling.return=m.return,m=m.sibling}}return!0}function Es(d,m){for(m&=~fo,m&=~dr,d.suspendedLanes|=m,d.pingedLanes&=~m,d=d.expirationTimes;0<m;){var C=31-Oa(m),z=1<<C;d[C]=-1,m&=~z}}function Df(d){if((ln&6)!==0)throw Error(o(327));Vl();var m=cl(d,0);if((m&1)===0)return ra(d,wr()),null;var C=As(d,m);if(d.tag!==0&&C===2){var z=fl(d);z!==0&&(m=z,C=Uc(d,z))}if(C===1)throw C=xu,Qo(d,0),Es(d,m),ra(d,wr()),C;if(C===6)throw Error(o(345));return d.finishedWork=d.current.alternate,d.finishedLanes=m,Ps(d,wa,Gi),ra(d,wr()),null}function Wl(d){po!==null&&po.tag===0&&(ln&6)===0&&Vl();var m=ln;ln|=1;var C=Yn.transition,z=Pt;try{if(Yn.transition=null,Pt=1,d)return d()}finally{Pt=z,Yn.transition=C,ln=m,(ln&6)===0&&li()}}function Au(){hi=Zo.current,cr(Zo)}function Qo(d,m){d.finishedWork=null,d.finishedLanes=0;var C=d.timeoutHandle;if(C!==de&&(d.timeoutHandle=de,me(C)),An!==null)for(C=An.return;C!==null;){var z=C;switch(De(z),z.tag){case 1:z=z.type.childContextTypes,z!=null&&Zi();break;case 3:Vo(),cr(Xi),cr(Rn),Hs();break;case 5:vs(z);break;case 4:Vo();break;case 13:cr(tr);break;case 19:cr(tr);break;case 10:so(z.type._context);break;case 22:case 23:Au()}C=C.return}if(jn=d,An=d=Pu(d.current,null),Dr=hi=m,hr=0,xu=null,fo=dr=Xs=0,wa=Gl=null,Ga!==null){for(m=0;m<Ga.length;m++)if(C=Ga[m],z=C.interleaved,z!==null){C.interleaved=null;var W=z.next,re=C.pending;if(re!==null){var _e=re.next;re.next=W,z.next=_e}C.pending=z}Ga=null}return d}function Xa(d,m){do{var C=An;try{if(Il(),Pr.current=Vs,Va){for(var z=on.memoizedState;z!==null;){var W=z.queue;W!==null&&(W.pending=null),z=z.next}Va=!1}if(Ln=0,Nn=kn=on=null,$s=!1,bs=0,$i.current=null,C===null||C.return===null){hr=1,xu=m,An=null;break}e:{var re=d,_e=C.return,Ye=C,it=m;if(m=Dr,Ye.flags|=32768,it!==null&&typeof it=="object"&&typeof it.then=="function"){var wt=it,$t=Ye,wn=$t.tag;if(($t.mode&1)===0&&(wn===0||wn===11||wn===15)){var Tt=$t.alternate;Tt?($t.updateQueue=Tt.updateQueue,$t.memoizedState=Tt.memoizedState,$t.lanes=Tt.lanes):($t.updateQueue=null,$t.memoizedState=null)}var Fr=Rh(_e);if(Fr!==null){Fr.flags&=-257,Ys(Fr,_e,Ye,re,m),Fr.mode&1&&Th(re,wt,m),m=Fr,it=wt;var mr=m.updateQueue;if(mr===null){var mo=new Set;mo.add(it),m.updateQueue=mo}else mr.add(it);break e}else{if((m&1)===0){Th(re,wt,m),vo();break e}it=Error(o(426))}}else if(ct&&Ye.mode&1){var Sl=Rh(_e);if(Sl!==null){(Sl.flags&65536)===0&&(Sl.flags|=256),Ys(Sl,_e,Ye,re,m),Ai(ta(it,Ye));break e}}re=it=ta(it,Ye),hr!==4&&(hr=2),Gl===null?Gl=[re]:Gl.push(re),re=_e;do{switch(re.tag){case 3:re.flags|=65536,m&=-m,re.lanes|=m;var nt=na(re,it,m);ps(re,nt);break e;case 1:Ye=it;var Ke=re.type,ut=re.stateNode;if((re.flags&128)===0&&(typeof Ke.getDerivedStateFromError=="function"||ut!==null&&typeof ut.componentDidCatch=="function"&&(ho===null||!ho.has(ut)))){re.flags|=65536,m&=-m,re.lanes|=m;var Rt=Ra(re,Ye,m);ps(re,Rt);break e}}re=re.return}while(re!==null)}rc(C)}catch(rn){m=rn,An===C&&C!==null&&(An=C=C.return);continue}break}while(!0)}function ks(){var d=ir.current;return ir.current=Vs,d===null?Vs:d}function vo(){(hr===0||hr===3||hr===2)&&(hr=4),jn===null||(Xs&268435455)===0&&(dr&268435455)===0||Es(jn,Dr)}function As(d,m){var C=ln;ln|=2;var z=ks();(jn!==d||Dr!==m)&&(Gi=null,Qo(d,m));do try{Hc();break}catch(W){Xa(d,W)}while(!0);if(Il(),ln=C,ir.current=z,An!==null)throw Error(o(261));return jn=null,Dr=0,hr}function Hc(){for(;An!==null;)Ff(An)}function $c(){for(;An!==null&&!Cc();)Ff(An)}function Ff(d){var m=Gp(d.alternate,d,hi);d.memoizedProps=d.pendingProps,m===null?rc(d):An=m,$i.current=null}function rc(d){var m=d;do{var C=m.alternate;if(d=m.return,(m.flags&32768)===0){if(C=$e(C,m,hi),C!==null){An=C;return}}else{if(C=Qe(C,m),C!==null){C.flags&=32767,An=C;return}if(d!==null)d.flags|=32768,d.subtreeFlags=0,d.deletions=null;else{hr=6,An=null;return}}if(m=m.sibling,m!==null){An=m;return}An=m=d}while(m!==null);hr===0&&(hr=5)}function Ps(d,m,C){var z=Pt,W=Yn.transition;try{Yn.transition=null,Pt=1,qp(d,m,C,z)}finally{Yn.transition=W,Pt=z}return null}function qp(d,m,C,z){do Vl();while(po!==null);if((ln&6)!==0)throw Error(o(327));C=d.finishedWork;var W=d.finishedLanes;if(C===null)return null;if(d.finishedWork=null,d.finishedLanes=0,C===d.current)throw Error(o(177));d.callbackNode=null,d.callbackPriority=0;var re=C.lanes|C.childLanes;if(za(d,re),d===jn&&(An=jn=null,Dr=0),(C.subtreeFlags&2064)===0&&(C.flags&2064)===0||Io||(Io=!0,Cd(zs,function(){return Vl(),null})),re=(C.flags&15990)!==0,(C.subtreeFlags&15990)!==0||re){re=Yn.transition,Yn.transition=null;var _e=Pt;Pt=1;var Ye=ln;ln|=4,$i.current=null,Bt(d,C),wi(C,d),V(d.containerInfo),d.current=C,jr(C),io(),ln=Ye,Pt=_e,Yn.transition=re}else d.current=C;if(Io&&(Io=!1,po=d,qc=W),re=d.pendingLanes,re===0&&(ho=null),Go(C.stateNode),ra(d,wr()),m!==null)for(z=d.onRecoverableError,C=0;C<m.length;C++)W=m[C],z(W.value,{componentStack:W.stack,digest:W.digest});if($r)throw $r=!1,d=Gr,Gr=null,d;return(qc&1)!==0&&d.tag!==0&&Vl(),re=d.pendingLanes,(re&1)!==0?d===ku?Wr++:(Wr=0,ku=d):Wr=0,li(),null}function Vl(){if(po!==null){var d=hl(qc),m=Yn.transition,C=Pt;try{if(Yn.transition=null,Pt=16>d?16:d,po===null)var z=!1;else{if(d=po,po=null,qc=0,(ln&6)!==0)throw Error(o(331));var W=ln;for(ln|=4,He=d.current;He!==null;){var re=He,_e=re.child;if((He.flags&16)!==0){var Ye=re.deletions;if(Ye!==null){for(var it=0;it<Ye.length;it++){var wt=Ye[it];for(He=wt;He!==null;){var $t=He;switch($t.tag){case 0:case 11:case 15:dn(8,$t,re)}var wn=$t.child;if(wn!==null)wn.return=$t,He=wn;else for(;He!==null;){$t=He;var Tt=$t.sibling,Fr=$t.return;if(qr($t),$t===wt){He=null;break}if(Tt!==null){Tt.return=Fr,He=Tt;break}He=Fr}}}var mr=re.alternate;if(mr!==null){var mo=mr.child;if(mo!==null){mr.child=null;do{var Sl=mo.sibling;mo.sibling=null,mo=Sl}while(mo!==null)}}He=re}}if((re.subtreeFlags&2064)!==0&&_e!==null)_e.return=re,He=_e;else e:for(;He!==null;){if(re=He,(re.flags&2048)!==0)switch(re.tag){case 0:case 11:case 15:dn(9,re,re.return)}var nt=re.sibling;if(nt!==null){nt.return=re.return,He=nt;break e}He=re.return}}var Ke=d.current;for(He=Ke;He!==null;){_e=He;var ut=_e.child;if((_e.subtreeFlags&2064)!==0&&ut!==null)ut.return=_e,He=ut;else e:for(_e=Ke;He!==null;){if(Ye=He,(Ye.flags&2048)!==0)try{switch(Ye.tag){case 0:case 11:case 15:zt(9,Ye)}}catch(rn){Vr(Ye,Ye.return,rn)}if(Ye===_e){He=null;break e}var Rt=Ye.sibling;if(Rt!==null){Rt.return=Ye.return,He=Rt;break e}He=Ye.return}}if(ln=W,li(),ki&&typeof ki.onPostCommitFiberRoot=="function")try{ki.onPostCommitFiberRoot(Ua,d)}catch{}z=!0}return z}finally{Pt=C,Yn.transition=m}}return!1}function Od(d,m,C){m=ta(C,m),m=na(d,m,1),d=Ji(d,m,1),m=xr(),d!==null&&(Ba(d,1,m),ra(d,m))}function Vr(d,m,C){if(d.tag===3)Od(d,d,C);else for(;m!==null;){if(m.tag===3){Od(m,d,C);break}else if(m.tag===1){var z=m.stateNode;if(typeof m.type.getDerivedStateFromError=="function"||typeof z.componentDidCatch=="function"&&(ho===null||!ho.has(z))){d=ta(C,d),d=Ra(m,d,1),m=Ji(m,d,1),d=xr(),m!==null&&(Ba(m,1,d),ra(m,d));break}}m=m.return}}function Up(d,m,C){var z=d.pingCache;z!==null&&z.delete(m),m=xr(),d.pingedLanes|=d.suspendedLanes&C,jn===d&&(Dr&C)===C&&(hr===4||hr===3&&(Dr&130023424)===Dr&&500>wr()-Su?Qo(d,0):fo|=C),ra(d,m)}function Hp(d,m){m===0&&((d.mode&1)===0?m=1:(m=xo,xo<<=1,(xo&130023424)===0&&(xo=4194304)));var C=xr();d=qi(d,m),d!==null&&(Ba(d,m,C),ra(d,C))}function $p(d){var m=d.memoizedState,C=0;m!==null&&(C=m.retryLane),Hp(d,C)}function rg(d,m){var C=0;switch(d.tag){case 13:var z=d.stateNode,W=d.memoizedState;W!==null&&(C=W.retryLane);break;case 19:z=d.stateNode;break;default:throw Error(o(314))}z!==null&&z.delete(m),Hp(d,C)}var Gp;Gp=function(d,m,C){if(d!==null)if(d.memoizedProps!==m.pendingProps||Xi.current)yi=!0;else{if((d.lanes&C)===0&&(m.flags&128)===0)return yi=!1,ne(d,m,C);yi=(d.flags&131072)!==0}else yi=!1,ct&&(m.flags&1048576)!==0&&ce(m,La,m.index);switch(m.lanes=0,m.tag){case 2:var z=m.type;R(d,m),d=m.pendingProps;var W=Ki(m,Rn.current);Us(m,C),W=pu(null,m,z,d,W,C);var re=Xu();return m.flags|=1,typeof W=="object"&&W!==null&&typeof W.render=="function"&&W.$$typeof===void 0?(m.tag=1,m.memoizedState=null,m.updateQueue=null,Mr(z)?(re=!0,ls(m)):re=!1,m.memoizedState=W.state!==null&&W.state!==void 0?W.state:null,Na(m),W.updater=ec,m.stateNode=W,W._reactInternals=m,ea(m,z,d,C),m=va(null,m,z,!0,re,C)):(m.tag=0,ct&&re&&ke(m),Ni(null,m,W,C),m=m.child),m;case 16:z=m.elementType;e:{switch(R(d,m),d=m.pendingProps,W=z._init,z=W(z._payload),m.type=z,W=m.tag=ig(z),d=co(z,d),W){case 0:m=_s(null,m,z,d,C);break e;case 1:m=Hi(null,m,z,d,C);break e;case 11:m=zc(null,m,z,d,C);break e;case 14:m=ws(null,m,z,co(z.type,d),C);break e}throw Error(o(306,z,""))}return m;case 0:return z=m.type,W=m.pendingProps,W=m.elementType===z?W:co(z,W),_s(d,m,z,W,C);case 1:return z=m.type,W=m.pendingProps,W=m.elementType===z?W:co(z,W),Hi(d,m,z,W,C);case 3:e:{if(_l(m),d===null)throw Error(o(387));z=m.pendingProps,re=m.memoizedState,W=re.element,Wa(d,m),lo(m,z,null,C);var _e=m.memoizedState;if(z=_e.element,Me&&re.isDehydrated)if(re={element:z,isDehydrated:!1,cache:_e.cache,pendingSuspenseBoundaries:_e.pendingSuspenseBoundaries,transitions:_e.transitions},m.updateQueue.baseState=re,m.memoizedState=re,m.flags&256){W=ta(Error(o(423)),m),m=Hl(d,m,z,C,W);break e}else if(z!==W){W=ta(Error(o(424)),m),m=Hl(d,m,z,C,W);break e}else for(Me&&(at=Ea(m.stateNode.containerInfo),Ge=m,ct=!0,jt=null,Dt=!1),C=vl(m,null,z,C),m.child=C;C;)C.flags=C.flags&-3|4096,C=C.sibling;else{if(_r(),z===W){m=Y(d,m,C);break e}Ni(d,m,z,C)}m=m.child}return m;case 5:return gs(m),d===null&&Ar(m),z=m.type,W=m.pendingProps,re=d!==null?d.memoizedProps:null,_e=W.children,ee(z,W)?_e=null:re!==null&&ee(z,re)&&(m.flags|=32),sr(d,m),Ni(d,m,_e,C),m.child;case 6:return d===null&&Ar(m),null;case 13:return jf(d,m,C);case 4:return yl(m,m.stateNode.containerInfo),z=m.pendingProps,d===null?m.child=oo(m,null,z,C):Ni(d,m,z,C),m.child;case 11:return z=m.type,W=m.pendingProps,W=m.elementType===z?W:co(z,W),zc(d,m,z,W,C);case 7:return Ni(d,m,m.pendingProps,C),m.child;case 8:return Ni(d,m,m.pendingProps.children,C),m.child;case 12:return Ni(d,m,m.pendingProps.children,C),m.child;case 10:e:{if(z=m.type._context,W=m.pendingProps,re=m.memoizedProps,_e=W.value,zr(m,z,_e),re!==null)if(Ca(re.value,_e)){if(re.children===W.children&&!Xi.current){m=Y(d,m,C);break e}}else for(re=m.child,re!==null&&(re.return=m);re!==null;){var Ye=re.dependencies;if(Ye!==null){_e=re.child;for(var it=Ye.firstContext;it!==null;){if(it.context===z){if(re.tag===1){it=ha(-1,C&-C),it.tag=2;var wt=re.updateQueue;if(wt!==null){wt=wt.shared;var $t=wt.pending;$t===null?it.next=it:(it.next=$t.next,$t.next=it),wt.pending=it}}re.lanes|=C,it=re.alternate,it!==null&&(it.lanes|=C),Lo(re.return,C,m),Ye.lanes|=C;break}it=it.next}}else if(re.tag===10)_e=re.type===m.type?null:re.child;else if(re.tag===18){if(_e=re.return,_e===null)throw Error(o(341));_e.lanes|=C,Ye=_e.alternate,Ye!==null&&(Ye.lanes|=C),Lo(_e,C,m),_e=re.sibling}else _e=re.child;if(_e!==null)_e.return=re;else for(_e=re;_e!==null;){if(_e===m){_e=null;break}if(re=_e.sibling,re!==null){re.return=_e.return,_e=re;break}_e=_e.return}re=_e}Ni(d,m,W.children,C),m=m.child}return m;case 9:return W=m.type,z=m.pendingProps.children,Us(m,C),W=Ir(W),z=z(W),m.flags|=1,Ni(d,m,z,C),m.child;case 14:return z=m.type,W=co(z,m.pendingProps),W=co(z.type,W),ws(d,m,z,W,C);case 15:return Mo(d,m,m.type,m.pendingProps,C);case 17:return z=m.type,W=m.pendingProps,W=m.elementType===z?W:co(z,W),R(d,m),m.tag=1,Mr(z)?(d=!0,ls(m)):d=!1,Us(m,C),Nh(m,z,W),ea(m,z,W,C),va(null,m,z,!0,d,C);case 19:return P(d,m,C);case 22:return nr(d,m,C)}throw Error(o(156,m.tag))};function Cd(d,m){return So(d,m)}function Wp(d,m,C,z){this.tag=d,this.key=C,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=m,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=z,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jo(d,m,C,z){return new Wp(d,m,C,z)}function Gc(d){return d=d.prototype,!(!d||!d.isReactComponent)}function ig(d){if(typeof d=="function")return Gc(d)?1:0;if(d!=null){if(d=d.$$typeof,d===_)return 11;if(d===E)return 14}return 2}function Pu(d,m){var C=d.alternate;return C===null?(C=Jo(d.tag,m,d.key,d.mode),C.elementType=d.elementType,C.type=d.type,C.stateNode=d.stateNode,C.alternate=d,d.alternate=C):(C.pendingProps=m,C.type=d.type,C.flags=0,C.subtreeFlags=0,C.deletions=null),C.flags=d.flags&14680064,C.childLanes=d.childLanes,C.lanes=d.lanes,C.child=d.child,C.memoizedProps=d.memoizedProps,C.memoizedState=d.memoizedState,C.updateQueue=d.updateQueue,m=d.dependencies,C.dependencies=m===null?null:{lanes:m.lanes,firstContext:m.firstContext},C.sibling=d.sibling,C.index=d.index,C.ref=d.ref,C}function jh(d,m,C,z,W,re){var _e=2;if(z=d,typeof d=="function")Gc(d)&&(_e=1);else if(typeof d=="string")_e=5;else e:switch(d){case f:return Ma(C.children,W,re,m);case g:_e=8,W|=8;break;case v:return d=Jo(12,C,m,W|2),d.elementType=v,d.lanes=re,d;case x:return d=Jo(13,C,m,W),d.elementType=x,d.lanes=re,d;case b:return d=Jo(19,C,m,W),d.elementType=b,d.lanes=re,d;case S:return Wc(C,W,re,m);default:if(typeof d=="object"&&d!==null)switch(d.$$typeof){case p:_e=10;break e;case y:_e=9;break e;case _:_e=11;break e;case E:_e=14;break e;case A:_e=16,z=null;break e}throw Error(o(130,d==null?d:typeof d,""))}return m=Jo(_e,C,m,W),m.elementType=d,m.type=z,m.lanes=re,m}function Ma(d,m,C,z){return d=Jo(7,d,z,m),d.lanes=C,d}function Wc(d,m,C,z){return d=Jo(22,d,z,m),d.elementType=S,d.lanes=C,d.stateNode={isHidden:!1},d}function Vc(d,m,C){return d=Jo(6,d,null,m),d.lanes=C,d}function Dh(d,m,C){return m=Jo(4,d.children!==null?d.children:[],d.key,m),m.lanes=C,m.stateNode={containerInfo:d.containerInfo,pendingChildren:null,implementation:d.implementation},m}function Vp(d,m,C,z,W){this.tag=m,this.containerInfo=d,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=de,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ro(0),this.expirationTimes=ro(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ro(0),this.identifierPrefix=z,this.onRecoverableError=W,Me&&(this.mutableSourceEagerHydrationData=null)}function Ld(d,m,C,z,W,re,_e,Ye,it){return d=new Vp(d,m,C,Ye,it),m===1?(m=1,re===!0&&(m|=8)):m=0,re=Jo(3,null,null,m),d.current=re,re.stateNode=d,re.memoizedState={element:z,isDehydrated:C,cache:null,transitions:null,pendingSuspenseBoundaries:null},Na(re),d}function Fh(d){if(!d)return ss;d=d._reactInternals;e:{if(F(d)!==d||d.tag!==1)throw Error(o(170));var m=d;do{switch(m.tag){case 3:m=m.stateNode.context;break e;case 1:if(Mr(m.type)){m=m.stateNode.__reactInternalMemoizedMergedChildContext;break e}}m=m.return}while(m!==null);throw Error(o(171))}if(d.tag===1){var C=d.type;if(Mr(C))return Zr(d,C,m)}return m}function ic(d){var m=d._reactInternals;if(m===void 0)throw typeof d.render=="function"?Error(o(188)):(d=Object.keys(d).join(","),Error(o(268,d)));return d=L(m),d===null?null:d.stateNode}function Bh(d,m){if(d=d.memoizedState,d!==null&&d.dehydrated!==null){var C=d.retryLane;d.retryLane=C!==0&&C<m?C:m}}function Yc(d,m){Bh(d,m),(d=d.alternate)&&Bh(d,m)}function ag(d){return d=L(d),d===null?null:d.stateNode}function Yp(){return null}return n.attemptContinuousHydration=function(d){if(d.tag===13){var m=qi(d,134217728);if(m!==null){var C=xr();_a(m,d,134217728,C)}Yc(d,134217728)}},n.attemptDiscreteHydration=function(d){if(d.tag===13){var m=qi(d,1);if(m!==null){var C=xr();_a(m,d,1,C)}Yc(d,1)}},n.attemptHydrationAtCurrentPriority=function(d){if(d.tag===13){var m=_i(d),C=qi(d,m);if(C!==null){var z=xr();_a(C,d,m,z)}Yc(d,m)}},n.attemptSynchronousHydration=function(d){switch(d.tag){case 3:var m=d.stateNode;if(m.current.memoizedState.isDehydrated){var C=cs(m.pendingLanes);C!==0&&(qa(m,C|1),ra(m,wr()),(ln&6)===0&&(lr(),li()))}break;case 13:Wl(function(){var z=qi(d,1);if(z!==null){var W=xr();_a(z,d,1,W)}}),Yc(d,1)}},n.batchedUpdates=function(d,m){var C=ln;ln|=1;try{return d(m)}finally{ln=C,ln===0&&(lr(),Eo&&li())}},n.createComponentSelector=function(d){return{$$typeof:Cr,value:d}},n.createContainer=function(d,m,C,z,W,re,_e){return Ld(d,m,!1,null,C,z,W,re,_e)},n.createHasPseudoClassSelector=function(d){return{$$typeof:Lr,value:d}},n.createHydrationContainer=function(d,m,C,z,W,re,_e,Ye,it){return d=Ld(C,z,!0,d,W,re,_e,Ye,it),d.context=Fh(null),C=d.current,z=xr(),W=_i(C),re=ha(z,W),re.callback=m??null,Ji(C,re,W),d.current.lanes=W,Ba(d,W,z),ra(d,z),d},n.createPortal=function(d,m,C){var z=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:h,key:z==null?null:""+z,children:d,containerInfo:m,implementation:C}},n.createRoleSelector=function(d){return{$$typeof:rr,value:d}},n.createTestNameSelector=function(d){return{$$typeof:Ti,value:d}},n.createTextSelector=function(d){return{$$typeof:Zn,value:d}},n.deferredUpdates=function(d){var m=Pt,C=Yn.transition;try{return Yn.transition=null,Pt=16,d()}finally{Pt=m,Yn.transition=C}},n.discreteUpdates=function(d,m,C,z,W){var re=Pt,_e=Yn.transition;try{return Yn.transition=null,Pt=1,d(m,C,z,W)}finally{Pt=re,Yn.transition=_e,ln===0&&lr()}},n.findAllNodes=Hr,n.findBoundingRects=function(d,m){if(!Le)throw Error(o(363));m=Hr(d,m),d=[];for(var C=0;C<m.length;C++)d.push(ue(m[C]));for(m=d.length-1;0<m;m--){C=d[m];for(var z=C.x,W=z+C.width,re=C.y,_e=re+C.height,Ye=m-1;0<=Ye;Ye--)if(m!==Ye){var it=d[Ye],wt=it.x,$t=wt+it.width,wn=it.y,Tt=wn+it.height;if(z>=wt&&re>=wn&&W<=$t&&_e<=Tt){d.splice(m,1);break}else if(z!==wt||C.width!==it.width||Tt<re||wn>_e){if(!(re!==wn||C.height!==it.height||$t<z||wt>W)){wt>z&&(it.width+=wt-z,it.x=z),$t<W&&(it.width=W-wt),d.splice(m,1);break}}else{wn>re&&(it.height+=wn-re,it.y=re),Tt<_e&&(it.height=_e-wn),d.splice(m,1);break}}}return d},n.findHostInstance=ic,n.findHostInstanceWithNoPortals=function(d){return d=T(d),d=d!==null?q(d):null,d===null?null:d.stateNode},n.findHostInstanceWithWarning=function(d){return ic(d)},n.flushControlled=function(d){var m=ln;ln|=1;var C=Yn.transition,z=Pt;try{Yn.transition=null,Pt=1,d()}finally{Pt=z,Yn.transition=C,ln=m,ln===0&&(lr(),li())}},n.flushPassiveEffects=Vl,n.flushSync=Wl,n.focusWithin=function(d,m){if(!Le)throw Error(o(363));for(d=ei(d),m=ti(d,m),m=Array.from(m),d=0;d<m.length;){var C=m[d++];if(!Pe(C)){if(C.tag===5&&st(C.stateNode))return!0;for(C=C.child;C!==null;)m.push(C),C=C.sibling}}return!1},n.getCurrentUpdatePriority=function(){return Pt},n.getFindAllNodesFailureDescription=function(d,m){if(!Le)throw Error(o(363));var C=0,z=[];d=[ei(d),0];for(var W=0;W<d.length;){var re=d[W++],_e=d[W++],Ye=m[_e];if((re.tag!==5||!Pe(re))&&(Ri(re,Ye)&&(z.push(ya(Ye)),_e++,_e>C&&(C=_e)),_e<m.length))for(re=re.child;re!==null;)d.push(re,_e),re=re.sibling}if(C<m.length){for(d=[];C<m.length;C++)d.push(ya(m[C]));return`findAllNodes was able to match part of the selector:
71
+ `+(z.join(" > ")+`
72
+
73
+ No matching component was found for:
74
+ `)+d.join(" > ")}return null},n.getPublicRootInstance=function(d){if(d=d.current,!d.child)return null;switch(d.child.tag){case 5:return ae(d.child.stateNode);default:return d.child.stateNode}},n.injectIntoDevTools=function(d){if(d={bundleType:d.bundleType,version:d.version,rendererPackageName:d.rendererPackageName,rendererConfig:d.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:ag,findFiberByHostInstance:d.findFiberByHostInstance||Yp,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")d=!1;else{var m=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(m.isDisabled||!m.supportsFiber)d=!0;else{try{Ua=m.inject(d),ki=m}catch{}d=!!m.checkDCE}}return d},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(d,m,C,z){if(!Le)throw Error(o(363));d=Hr(d,m);var W=dt(d,C,z).disconnect;return{disconnect:function(){W()}}},n.registerMutableSourceForHydration=function(d,m){var C=m._getVersion;C=C(m._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[m,C]:d.mutableSourceEagerHydrationData.push(m,C)},n.runWithPriority=function(d,m){var C=Pt;try{return Pt=d,m()}finally{Pt=C}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(d,m,C,z){var W=m.current,re=xr(),_e=_i(W);return C=Fh(C),m.context===null?m.context=C:m.pendingContext=C,m=ha(re,_e),m.payload={element:d},z=z===void 0?null:z,z!==null&&(m.callback=z),d=Ji(W,m,_e),d!==null&&(_a(d,W,_e,re),No(d,W,_e)),_e},n}),Kg}var i3;function PA(){return i3||(i3=1,Xg.exports=AA()),Xg.exports}var OA=PA();const CA=ph(OA);var Zg={exports:{}},nf={};/**
75
+ * @license React
76
+ * react-reconciler-constants.production.min.js
77
+ *
78
+ * Copyright (c) Facebook, Inc. and its affiliates.
79
+ *
80
+ * This source code is licensed under the MIT license found in the
81
+ * LICENSE file in the root directory of this source tree.
82
+ */var a3;function LA(){return a3||(a3=1,nf.ConcurrentRoot=1,nf.ContinuousEventPriority=4,nf.DefaultEventPriority=16,nf.DiscreteEventPriority=1,nf.IdleEventPriority=536870912,nf.LegacyRoot=0),nf}var o3;function NA(){return o3||(o3=1,Zg.exports=LA()),Zg.exports}var C8=NA();const s3={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let l3=!1,u3=!1;const Jm=".react-konva-event",TA=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
83
+ Position of a node will be changed during drag&drop, so you should update state of the react app as well.
84
+ Consider to add onDragMove or onDragEnd events.
85
+ For more info see: https://github.com/konvajs/react-konva/issues/256
86
+ `,RA=`ReactKonva: You are using "zIndex" attribute for a Konva node.
87
+ react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
88
+ For more info see: https://github.com/konvajs/react-konva/issues/194
89
+ `,MA={};function U0(t,e,n=MA){if(!l3&&"zIndex"in e&&(console.warn(RA),l3=!0),!u3&&e.draggable){var r=e.x!==void 0||e.y!==void 0,i=e.onDragEnd||e.onDragMove;r&&!i&&(console.warn(TA),u3=!0)}for(var a in n)if(!s3[a]){var o=a.slice(0,2)==="on",s=n[a]!==e[a];if(o&&s){var u=a.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),t.off(u,n[a])}var h=!e.hasOwnProperty(a);h&&t.setAttr(a,void 0)}var f=e._useStrictMode,g={},v=!1;const p={};for(var a in e)if(!s3[a]){var o=a.slice(0,2)==="on",y=n[a]!==e[a];if(o&&y){var u=a.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),e[a]&&(p[u]=e[a])}!o&&(e[a]!==n[a]||f&&e[a]!==t.getAttr(a))&&(v=!0,g[a]=e[a])}v&&(t.setAttrs(g),Cf(t));for(var u in p)t.on(u+Jm,p[u])}function Cf(t){if(!Ot.autoDrawEnabled){var e=t.getLayer()||t.getStage();e&&e.batchDraw()}}var Qg=jm();const L8={},IA={};lh.Node.prototype._applyProps=U0;function jA(t,e){if(typeof e=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${e}`);return}t.add(e),Cf(t)}function DA(t,e,n){let r=lh[t];r||(console.error(`Konva has no node with the type ${t}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${t}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),r=lh.Group);const i={},a={};for(var o in e){var s=o.slice(0,2)==="on";s?a[o]=e[o]:i[o]=e[o]}const u=new r(i);return U0(u,a),u}function FA(t,e,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${t}"`)}function BA(t,e,n){return!1}function zA(t){return t}function qA(){return null}function UA(){return null}function HA(t,e,n,r){return IA}function $A(){}function GA(t){}function WA(t,e){return!1}function VA(){return L8}function YA(){return L8}const XA=setTimeout,KA=clearTimeout,ZA=-1;function QA(t,e){return!1}const JA=!1,eP=!0,tP=!0;function nP(t,e){e.parent===t?e.moveToTop():t.add(e),Cf(t)}function rP(t,e){e.parent===t?e.moveToTop():t.add(e),Cf(t)}function N8(t,e,n){e._remove(),t.add(e),e.setZIndex(n.getZIndex()),Cf(t)}function iP(t,e,n){N8(t,e,n)}function aP(t,e){e.destroy(),e.off(Jm),Cf(t)}function oP(t,e){e.destroy(),e.off(Jm),Cf(t)}function sP(t,e,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function lP(t,e,n){}function uP(t,e,n,r,i){U0(t,i,r)}function cP(t){t.hide(),Cf(t)}function fP(t){}function hP(t,e){(e.visible==null||e.visible)&&t.show()}function dP(t,e){}function pP(t){}function gP(){}const vP=()=>C8.DefaultEventPriority,mP=Object.freeze(Object.defineProperty({__proto__:null,appendChild:nP,appendChildToContainer:rP,appendInitialChild:jA,cancelTimeout:KA,clearContainer:pP,commitMount:lP,commitTextUpdate:sP,commitUpdate:uP,createInstance:DA,createTextInstance:FA,detachDeletedInstance:gP,finalizeInitialChildren:BA,getChildHostContext:YA,getCurrentEventPriority:vP,getPublicInstance:zA,getRootHostContext:VA,hideInstance:cP,hideTextInstance:fP,idlePriority:Qg.unstable_IdlePriority,insertBefore:N8,insertInContainerBefore:iP,isPrimaryRenderer:JA,noTimeout:ZA,now:Qg.unstable_now,prepareForCommit:qA,preparePortalMount:UA,prepareUpdate:HA,removeChild:aP,removeChildFromContainer:oP,resetAfterCommit:$A,resetTextContent:GA,run:Qg.unstable_runWithPriority,scheduleTimeout:XA,shouldDeprioritizeSubtree:WA,shouldSetTextContent:QA,supportsMutation:tP,unhideInstance:hP,unhideTextInstance:dP,warnsIfNotActing:eP},Symbol.toStringTag,{value:"Module"}));var yP=Object.defineProperty,bP=Object.defineProperties,wP=Object.getOwnPropertyDescriptors,c3=Object.getOwnPropertySymbols,_P=Object.prototype.hasOwnProperty,xP=Object.prototype.propertyIsEnumerable,f3=(t,e,n)=>e in t?yP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,h3=(t,e)=>{for(var n in e||(e={}))_P.call(e,n)&&f3(t,n,e[n]);if(c3)for(var n of c3(e))xP.call(e,n)&&f3(t,n,e[n]);return t},SP=(t,e)=>bP(t,wP(e)),d3,p3;typeof window<"u"&&((d3=window.document)!=null&&d3.createElement||((p3=window.navigator)==null?void 0:p3.product)==="ReactNative")?ji.useLayoutEffect:ji.useEffect;function T8(t,e,n){if(!t)return;if(n(t)===!0)return t;let r=t.child;for(;r;){const i=T8(r,e,n);if(i)return i;r=r.sibling}}function R8(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const g3=console.error;console.error=function(){const t=[...arguments].join("");if(t?.startsWith("Warning:")&&t.includes("useContext")){console.error=g3;return}return g3.apply(this,arguments)};const ey=R8(ji.createContext(null));class M8 extends ji.Component{render(){return ji.createElement(ey.Provider,{value:this._reactInternals},this.props.children)}}function EP(){const t=ji.useContext(ey);if(t===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=ji.useId();return ji.useMemo(()=>{for(const r of[t,t?.alternate]){if(!r)continue;const i=T8(r,!1,a=>{let o=a.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(i)return i}},[t,e])}function kP(){const t=EP(),[e]=ji.useState(()=>new Map);e.clear();let n=t;for(;n;){if(n.type&&typeof n.type=="object"){const i=n.type._context===void 0&&n.type.Provider===n.type?n.type:n.type._context;i&&i!==ey&&!e.has(i)&&e.set(i,ji.useContext(R8(i)))}n=n.return}return e}function I8(){const t=kP();return ji.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>r=>ji.createElement(e,null,ji.createElement(n.Provider,SP(h3({},r),{value:t.get(n)}))),e=>ji.createElement(M8,h3({},e))),[t])}function AP(t){const e=se.useRef({});return se.useLayoutEffect(()=>{e.current=t}),se.useLayoutEffect(()=>()=>{e.current={}},[]),e.current}const PP=t=>{const e=se.useRef(null),n=se.useRef(null),r=se.useRef(null),i=AP(t),a=I8(),o=s=>{const{forwardedRef:u}=t;u&&(typeof u=="function"?u(s):u.current=s)};return se.useLayoutEffect(()=>(n.current=new lh.Stage({width:t.width,height:t.height,container:e.current}),o(n.current),r.current=Zd.createContainer(n.current,C8.LegacyRoot,!1,null),Zd.updateContainer(se.createElement(a,{},t.children),r.current),()=>{lh.isBrowser&&(o(null),Zd.updateContainer(null,r.current,null),n.current.destroy())}),[]),se.useLayoutEffect(()=>{o(n.current),U0(n.current,t,i),Zd.updateContainer(se.createElement(a,{},t.children),r.current,null)}),se.createElement("div",{ref:e,id:t.id,accessKey:t.accessKey,className:t.className,role:t.role,style:t.style,tabIndex:t.tabIndex,title:t.title})},OP="Layer",br="Group",v0="Label",Tr="Rect",CP="Circle",df="Line",Tu="Image",Fu="Text",LP="TextPath",ty="Arc",m0="Tag",yp="Path",bp="Transformer",Zd=CA(mP);Zd.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:se.version,rendererPackageName:"react-konva"});const NP=se.forwardRef((t,e)=>se.createElement(M8,{},se.createElement(PP,{...t,forwardedRef:e})));var Jg,v3;function TP(){if(v3)return Jg;v3=1;var t=Pp();return Jg=function(n,r,i){const a=t.useRef("loading"),o=t.useRef(),[s,u]=t.useState(0),h=t.useRef(),f=t.useRef(),g=t.useRef();return(h.current!==n||f.current!==r||g.current!==i)&&(a.current="loading",o.current=void 0,h.current=n,f.current=r,g.current=i),t.useLayoutEffect(function(){if(!n)return;var v=document.createElement("img");function p(){v.decode().catch(()=>{}).finally(()=>{a.current="loaded",o.current=v,u(Math.random())})}function y(){a.current="failed",o.current=void 0,u(Math.random())}return v.addEventListener("load",p),v.addEventListener("error",y),r&&(v.crossOrigin=r),i&&(v.referrerPolicy=i),v.src=n,function(){v.removeEventListener("load",p),v.removeEventListener("error",y)}},[n,r,i]),[o.current,a.current]},Jg}var RP=TP();const ny=ph(RP);var MP=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const IP=t=>{const e=window.getComputedStyle(t).position;return!(e==="absolute"||e==="relative")};function jP(t=()=>{}){const e=se.useRef(t);return e.current=t,se.useCallback((...n)=>e.current.apply(null,n),[])}const y0=({children:t,groupProps:e,divProps:n,transform:r,transformFunc:i,parentNodeFunc:a})=>{const o=I8(),s=se.useRef(null),[u]=se.useState(()=>document.createElement("div")),h=se.useMemo(()=>Zw.createRoot(u),[u]),f=r??!0,g=jP(()=>{if(f&&s.current){let x=s.current.getAbsoluteTransform().decompose();i&&(x=i(x)),u.style.position="absolute",u.style.zIndex="10",u.style.top="0px",u.style.left="0px",u.style.transform=`translate(${x.x}px, ${x.y}px) rotate(${x.rotation}deg) scaleX(${x.scaleX}) scaleY(${x.scaleY})`,u.style.transformOrigin="top left"}else u.style.position="",u.style.zIndex="",u.style.top="",u.style.left="",u.style.transform="",u.style.transformOrigin="";const v=n||{},{style:p}=v,y=MP(v,["style"]);Object.assign(u.style,p),Object.assign(u,y)});return se.useLayoutEffect(()=>{var v;const p=s.current;if(!p)return;const y=a?a({stage:p.getStage()}):(v=p.getStage())===null||v===void 0?void 0:v.container();if(y)return y.appendChild(u),f&&IP(y)&&(y.style.position="relative"),p.on("absoluteTransformChange",g),g(),()=>{var _;p.off("absoluteTransformChange",g),(_=u.parentNode)===null||_===void 0||_.removeChild(u)}},[f,a]),se.useLayoutEffect(()=>{g()},[n,i]),se.useLayoutEffect(()=>{queueMicrotask(()=>{X6.flushSync(()=>{h.render(se.createElement(o,null,t))})})}),se.useLayoutEffect(()=>()=>{setTimeout(()=>{h.unmount()})},[]),se.createElement(br,Object.assign({ref:s},e))},ry=({selector:t,enabled:e,children:n})=>{const r=se.useRef(null),i=se.useRef(null),a=se.useRef(null),o=e??!0;return se.useLayoutEffect(()=>{if(!r.current||!i.current)return;a.current=i.current;const u=r.current.getStage().findOne(t);o&&u?i.current.moveTo(u):i.current.moveTo(r.current);const h=r.current.getLayer();if(h&&(h.batchDraw(),u)){const f=u.getLayer();if(!f)return;f.batchDraw()}},[t,o]),se.useEffect(()=>()=>{var s;(s=a.current)===null||s===void 0||s.destroy()},[]),se.createElement(br,{name:"_outer_portal",ref:r},se.createElement(br,{name:"_inner_portal",ref:i},n))};function j8(t,e,n){const r=e-1,i=n[F8(r,n.length)];return i.marker!=="Z"?i:j8(t,r,n)}function D8(t,e,n){const r=e+1,i=n[F8(r,n.length)];return i.marker==="Z"?D8(t,r,n):i}function DP(t,e,n){let r=n[e-1]||{values:{x:0,y:0}};if(t.marker===t.marker.toLowerCase())switch(t.marker=t.marker.toUpperCase(),t.marker){case"M":t.values.x+=r.values.x,t.values.y+=r.values.y;break;case"L":case"A":t.values.x+=r.values.x,t.values.y+=r.values.y;break;case"H":t.marker="L",t.values.x+=r.values.x,t.values.y=r.values.y;break;case"V":t.marker="L",t.values.x=r.values.x,t.values.y+=r.values.y;break;case"C":t.values.x+=r.values.x,t.values.y+=r.values.y,t.values.x1+=r.values.x,t.values.y1+=r.values.y,t.values.x2+=r.values.x,t.values.y2+=r.values.y;break;case"S":t.values.x+=r.values.x,t.values.y+=r.values.y,t.values.x2+=r.values.x,t.values.y2+=r.values.y;break;case"Q":t.values.x+=r.values.x,t.values.y+=r.values.y,t.values.x1+=r.values.x,t.values.y1+=r.values.y;break;case"T":t.values.x+=r.values.x,t.values.y+=r.values.y;break}else if(t.marker===t.marker.toUpperCase())switch(t.marker){case"H":t.marker="L",t.values.y=r.values.y;break;case"V":t.marker="L",t.values.x=r.values.x;break}if(t.marker==="Z"){let i=function(o,s){return o[s].marker==="M"?o[s]:i(o,s-1)},a=i(n,e);t.values.x=a.values.x,t.values.y=a.values.y}return t}function FP(t,e){const n=[];switch(t.toUpperCase()){case"M":for(let r=0;r<e.length;r+=2){let i;t===t.toUpperCase()?i=r===0?"M":"L":i=r===0?"m":"l",n.push({marker:i,values:{x:e[r],y:e[r+1]}})}break;case"L":for(let r=0;r<e.length;r+=2)n.push({marker:t,values:{x:e[r],y:e[r+1]}});break;case"H":for(let r=0;r<e.length;r++)n.push({marker:t,values:{x:e[r],y:0}});break;case"V":for(let r=0;r<e.length;r++)n.push({marker:t,values:{x:0,y:e[r]}});break;case"C":for(let r=0;r<e.length;r+=6)n.push({marker:t,values:{x1:e[r],y1:e[r+1],x2:e[r+2],y2:e[r+3],x:e[r+4],y:e[r+5]}});break;case"S":for(let r=0;r<e.length;r+=4)n.push({marker:t,values:{x2:e[r],y2:e[r+1],x:e[r+2],y:e[r+3]}});break;case"Q":for(let r=0;r<e.length;r+=4)n.push({marker:t,values:{x1:e[r],y1:e[r+1],x:e[r+2],y:e[r+3]}});break;case"T":for(let r=0;r<e.length;r+=2)n.push({marker:t,values:{x:e[r],y:e[r+1]}});break;case"A":for(let r=0;r<e.length;r+=7)n.push({marker:t,values:{radiusX:e[r],radiusY:e[r+1],rotation:e[r+2],largeArc:e[r+3],sweep:e[r+4],x:e[r+5],y:e[r+6]}});break;case"Z":n.push({marker:t,values:{x:0,y:0}});break}return n}function F8(t,e){return(t%e+e)%e}function BP(t,e,n){if(e!==0&&t.marker==="L"){let r=n[e-1];["x","y"].every(a=>Math.round(Math.abs(r.values[a]-t.values[a]))===0)&&(t.overlap=!0)}return t}function pm(t,e){const n=["x","y"].every(r=>Math.round(Math.abs(t[e].values[r]-t[0].values[r]))===0);t[e].marker==="L"&&n&&(t[e].overlap=!0,pm(t,e-1)),t[e].marker==="Z"&&pm(t,e-1)}function zP(t,e,n){const r=y3(t.values,n.values),i=y3(e.values,t.values);return Math.min(i,r)}function m3(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}function y3(t,e){const n=t.x-e.x,r=t.y-e.y;return Math.sqrt(Math.pow(n,2)+Math.pow(r,2))}function b3(t,e){return Math.sin(t)*e}function w3(t,e){return Math.cos(t)*e}function _3(t,e){const n=e/Math.tan(t);return n===1/0||n===-1/0||isNaN(n)?e:n}function qP(t,e){return e*Math.tan(t)}function UP(t,e){let n,r=0,i=t*(180/Math.PI);return i<0&&i>=-180||i>180&&i<360?n=_3(t/2,-e):(n=_3(t/2,e),r=1,n===1/0&&(n=e)),{offset:n,sweepFlag:r}}function HP(t){const e=["radiusX","radiusY","rotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return t.map(n=>{let r="";if(n.marker!=="Z"){const i=Object.keys(n.values);r=e.filter(a=>i.indexOf(a)!==-1).map(a=>n.values[a]).join()}return`${n.marker}${r}`}).join("").trim()}function $P(t){const e=/[MmLlSsQqLlHhVvCcSsQqTtAaZz]/g,n=/-?[0-9]*\.?\d+/g;return[...t.matchAll(e)].map(r=>({marker:r[0],index:r.index})).reduceRight((r,i)=>{const a=t.substring(i.index,r.length?r[r.length-1].index:t.length);return r.concat([{marker:i.marker,index:i.index,chunk:a.length>0?a.substr(1,a.length-1):a}])},[]).reverse().flatMap(r=>{const i=r.chunk.match(n),a=i?i.map(parseFloat):[];return FP(r.marker,a)}).map(DP)}function GP(t,e,n){let r=[],i=[];return t.forEach(a=>{a.marker==="M"&&r.push([]),r[r.length-1].push(a)}),r.forEach(a=>{a.map(BP),pm(a,a.length-1);const o=a[a.length-1].marker=="Z";a.filter(s=>!s.overlap).map((s,u,h)=>{const g=j8(s,u,h),v=D8(s,u,h),p=m3(s.values,g.values),y=m3(s.values,v.values),_=y-p,x=_*(180/Math.PI),b=zP(s,g,v),E=Math.abs(qP(_/2,b/2)),A=Math.min(e,E),S=UP(_,A),k=S.offset,I=S.sweepFlag,O=(u==0||u==h.length-1)&&!o;switch(s.marker){case"M":case"L":const M=[s.values.x+b3(p,k),s.values.y+w3(p,k)],F=[s.values.x+b3(y,k),s.values.y+w3(y,k)];O?i.push({marker:s.marker,values:s.values}):i.push({marker:s.marker,values:{x:parseFloat(M[0].toFixed(3)),y:parseFloat(M[1].toFixed(3))}}),!O&&(v.marker==="L"||v.marker==="M")&&i.push({marker:"A",radius:A,values:{radiusX:parseFloat(A.toFixed(3)),radiusY:parseFloat(A.toFixed(3)),rotation:x,largeArc:0,sweep:I,x:parseFloat(F[0].toFixed(3)),y:parseFloat(F[1].toFixed(3))}});break;case"C":case"S":case"Q":case"T":case"A":case"Z":i.push({marker:s.marker,values:s.values});break}})}),{path:HP(i),commands:i}}var O1={},x3;function WP(){if(x3)return O1;x3=1;var t=t||{};t.stringify=(function(){var e={"visit_linear-gradient":function(n){return e.visit_gradient(n)},"visit_repeating-linear-gradient":function(n){return e.visit_gradient(n)},"visit_radial-gradient":function(n){return e.visit_gradient(n)},"visit_repeating-radial-gradient":function(n){return e.visit_gradient(n)},visit_gradient:function(n){var r=e.visit(n.orientation);return r&&(r+=", "),n.type+"("+r+e.visit(n.colorStops)+")"},visit_shape:function(n){var r=n.value,i=e.visit(n.at),a=e.visit(n.style);return a&&(r+=" "+a),i&&(r+=" at "+i),r},"visit_default-radial":function(n){var r="",i=e.visit(n.at);return i&&(r+=i),r},"visit_extent-keyword":function(n){var r=n.value,i=e.visit(n.at);return i&&(r+=" at "+i),r},"visit_position-keyword":function(n){return n.value},visit_position:function(n){return e.visit(n.value.x)+" "+e.visit(n.value.y)},"visit_%":function(n){return n.value+"%"},visit_em:function(n){return n.value+"em"},visit_px:function(n){return n.value+"px"},visit_calc:function(n){return"calc("+n.value+")"},visit_literal:function(n){return e.visit_color(n.value,n)},visit_hex:function(n){return e.visit_color("#"+n.value,n)},visit_rgb:function(n){return e.visit_color("rgb("+n.value.join(", ")+")",n)},visit_rgba:function(n){return e.visit_color("rgba("+n.value.join(", ")+")",n)},visit_hsl:function(n){return e.visit_color("hsl("+n.value[0]+", "+n.value[1]+"%, "+n.value[2]+"%)",n)},visit_hsla:function(n){return e.visit_color("hsla("+n.value[0]+", "+n.value[1]+"%, "+n.value[2]+"%, "+n.value[3]+")",n)},visit_var:function(n){return e.visit_color("var("+n.value+")",n)},visit_color:function(n,r){var i=n,a=e.visit(r.length);return a&&(i+=" "+a),i},visit_angular:function(n){return n.value+"deg"},visit_directional:function(n){return"to "+n.value},visit_array:function(n){var r="",i=n.length;return n.forEach(function(a,o){r+=e.visit(a),o<i-1&&(r+=", ")}),r},visit_object:function(n){return n.width&&n.height?e.visit(n.width)+" "+e.visit(n.height):""},visit:function(n){if(!n)return"";if(n instanceof Array)return e.visit_array(n);if(typeof n=="object"&&!n.type)return e.visit_object(n);if(n.type){var r=e["visit_"+n.type];if(r)return r(n);throw Error("Missing visitor visit_"+n.type)}else throw Error("Invalid node.")}};return function(n){return e.visit(n)}})();var t=t||{};return t.parse=(function(){var e={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|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/,radianValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))rad/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,varColor:/^var/i,calcValue:/^calc/i,variableName:/^(--[a-zA-Z0-9-,\s\#]+)/,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,hslColor:/^hsl/i,hslaColor:/^hsla/i},n="";function r(U){var X=new Error(n+": "+U);throw X.source=n,X}function i(){var U=a();return n.length>0&&r("Invalid input not EOF"),U}function a(){return S(o)}function o(){return s("linear-gradient",e.linearGradient,h)||s("repeating-linear-gradient",e.repeatingLinearGradient,h)||s("radial-gradient",e.radialGradient,v)||s("repeating-radial-gradient",e.repeatingRadialGradient,v)}function s(U,X,ee){return u(X,function(K){var oe=ee();return oe&&(B(e.comma)||r("Missing comma before color stops")),{type:U,orientation:oe,colorStops:S(k)}})}function u(U,X){var ee=B(U);if(ee){B(e.startCall)||r("Missing (");var K=X(ee);return B(e.endCall)||r("Missing )"),K}}function h(){var U=f();if(U)return U;var X=V("position-keyword",e.positionKeywords,1);return X?{type:"directional",value:X.value}:g()}function f(){return V("directional",e.sideOrCorner,1)}function g(){return V("angular",e.angleValue,1)||V("angular",e.radianValue,1)}function v(){var U,X=p(),ee;return X&&(U=[],U.push(X),ee=n,B(e.comma)&&(X=p(),X?U.push(X):n=ee)),U}function p(){var U=y()||_();if(U)U.at=b();else{var X=x();if(X){U=X;var ee=b();ee&&(U.at=ee)}else{var K=b();if(K)U={type:"default-radial",at:K};else{var oe=E();oe&&(U={type:"default-radial",at:oe})}}}return U}function y(){var U=V("shape",/^(circle)/i,0);return U&&(U.style=te()||x()),U}function _(){var U=V("shape",/^(ellipse)/i,0);return U&&(U.style=E()||ae()||x()),U}function x(){return V("extent-keyword",e.extentKeywords,1)}function b(){if(V("position",/^at/,0)){var U=E();return U||r("Missing positioning value"),U}}function E(){var U=A();if(U.x||U.y)return{type:"position",value:U}}function A(){return{x:ae(),y:ae()}}function S(U){var X=U(),ee=[];if(X)for(ee.push(X);B(e.comma);)X=U(),X?ee.push(X):r("One extra comma");return ee}function k(){var U=I();return U||r("Expected color definition"),U.length=ae(),U}function I(){return M()||$()||L()||j()||F()||T()||O()}function O(){return V("literal",e.literalColor,0)}function M(){return V("hex",e.hexColor,1)}function F(){return u(e.rgbColor,function(){return{type:"rgb",value:S(J)}})}function j(){return u(e.rgbaColor,function(){return{type:"rgba",value:S(J)}})}function T(){return u(e.varColor,function(){return{type:"var",value:q()}})}function L(){return u(e.hslColor,function(){var U=B(e.percentageValue);U&&r("HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage");var X=J();B(e.comma);var ee=B(e.percentageValue),K=ee?ee[1]:null;B(e.comma),ee=B(e.percentageValue);var oe=ee?ee[1]:null;return(!K||!oe)&&r("Expected percentage value for saturation and lightness in HSL"),{type:"hsl",value:[X,K,oe]}})}function $(){return u(e.hslaColor,function(){var U=J();B(e.comma);var X=B(e.percentageValue),ee=X?X[1]:null;B(e.comma),X=B(e.percentageValue);var K=X?X[1]:null;B(e.comma);var oe=J();return(!ee||!K)&&r("Expected percentage value for saturation and lightness in HSLA"),{type:"hsla",value:[U,ee,K,oe]}})}function q(){return B(e.variableName)[1]}function J(){return B(e.number)[1]}function ae(){return V("%",e.percentageValue,1)||ie()||Z()||te()}function ie(){return V("position-keyword",e.positionKeywords,1)}function Z(){return u(e.calcValue,function(){for(var U=1,X=0;U>0&&X<n.length;){var ee=n.charAt(X);ee==="("?U++:ee===")"&&U--,X++}U>0&&r("Missing closing parenthesis in calc() expression");var K=n.substring(0,X-1);return D(X-1),{type:"calc",value:K}})}function te(){return V("px",e.pixelValue,1)||V("em",e.emValue,1)}function V(U,X,ee){var K=B(X);if(K)return{type:U,value:K[ee]}}function B(U){var X,ee;return ee=/^[\n\r\t\s]+/.exec(n),ee&&D(ee[0].length),X=U.exec(n),X&&D(X[0].length),X}function D(U){n=n.substr(U)}return function(U){return n=U.toString().trim(),n.endsWith(";")&&(n=n.slice(0,-1)),i()}})(),O1.parse=t.parse,O1.stringify=t.stringify,O1}var VP=WP();const YP=ph(VP),H0=t=>t.indexOf("linear-gradient")>=0,XP=t=>t.type==="hex"?"#"+t.value:t.type==="literal"?t.value:`${t.type}(${t.value.join(",")})`,B8=t=>{if(!H0(t))return{rotation:0,stops:[{offset:0,color:t},{offset:1,color:t}]};const e=YP.parse(t)[0];return{rotation:parseFloat(e.orientation.value),stops:e.colorStops.map((n,r)=>({color:XP(n),offset:n.length?parseFloat(n.length.value)/100:r/(e.colorStops.length-1)}))}},wf=(t,e=t.fill,n="fill")=>se.useMemo(()=>{if(!H0(e))return{[n]:e};const{stops:r,rotation:i}=B8(e),a=t.a.width/2,o=t.a.height/2,s=(i%180+180)%180,u=s>45&&s<135?t.a.width:t.a.height,h=sn.Util.degToRad(i)-Math.PI/2,f=[];return r.forEach(({offset:g,color:v})=>{f.push(g,v)}),n==="fill"?{fillLinearGradientStartPointX:a-u/2*Math.cos(h),fillLinearGradientStartPointY:o-u/2*Math.sin(h),fillLinearGradientColorStops:f,fillLinearGradientEndPointX:a+u/2*Math.cos(h),fillLinearGradientEndPointY:o+u/2*Math.sin(h),fill:r[1].color,fillPriority:"linear-gradient"}:{strokeLinearGradientStartPointX:a-u/2*Math.cos(h),strokeLinearGradientStartPointY:o-u/2*Math.sin(h),strokeLinearGradientColorStops:f,strokeLinearGradientEndPointX:a+u/2*Math.cos(h),strokeLinearGradientEndPointY:o+u/2*Math.sin(h)}},[e,t.width,t.height]);let b0=!1;const KP=(t=!b0)=>{b0=t},ZP=()=>b0;function Mp(t,e){const n=se.useRef();se.useLayoutEffect(()=>{n.current&&n.current.destroy()},[e]),se.useLayoutEffect(()=>{if(!b0)return;const r=t.current.opacity();return r?(t.current.opacity(0),n.current=new sn.Tween({node:t.current,opacity:r,onFinish:()=>{var i;(i=n.current)===null||i===void 0||i.destroy()}}),n.current.play(),()=>{var i;(i=n.current)===null||i===void 0||i.destroy()}):void 0},[])}let w0=0,gm=[],z8=3e4;const QP=t=>{z8=t};let q8=6e3;const JP=t=>{q8=t},eO=()=>q8;function uh(t){w0+=1;let e=!1,n=!1;const r=setTimeout(()=>{e||(Ip(`Timeout loading asset ${t}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",t),e=!0,S3())},z8);return()=>{n?console.error("Finish called twice! That is not expected. id: ",t):(n=!0,e||(clearTimeout(r),S3()))}}function S3(){w0-=1,w0===0&&(gm.forEach(t=>t()),gm=[])}function tO(){return new Promise(t=>{return e=()=>{ZP()?setTimeout(t,300):t(!0)},void(w0===0?e():gm.push(e));var e})}let U8=[];function nO(t){U8.push(t)}function Ip(t){U8.forEach(e=>e(t))}Kn(["Roboto","Amatic SC","Press Start 2P","Marck Script","Rubik Mono One"]);Kn({value:!1});const iy=Kn([]);function rO(t){iy.push(t)}var vm="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1";let fc;function C1(t,e="sans-serif",n="normal",r="normal"){fc||(fc=document.createElement("canvas"));var i=fc.getContext("2d");return i.font=`${n} ${r} 40px '${t}', ${e}`,i.measureText(vm).width}const op={Arial:!0},E3=t=>Object.keys(op).some(e=>e.startsWith(t+"_"))||!!op[t];async function Qh(t,e,n){var r;const i=`${t}_${e}_${n}`;if(op[i])return;const a=!!(!((r=document.fonts)===null||r===void 0)&&r.load),o=(function(f="normal",g="normal"){fc||(fc=document.createElement("canvas"));var v=fc.getContext("2d");return v.font=`${f} ${g} 40px sans-serif`,v.measureText(vm).width})(e,n);if(a)try{if(await document.fonts.load(`${e} ${n} 16px '${t}'`),o!==C1(t,"sans-serif",e,n))return void(op[i]=!0)}catch{}const s=(function(f="normal",g="normal"){fc||(fc=document.createElement("canvas"));var v=fc.getContext("2d");return v.font=`${f} ${g} 40px serif`,v.measureText(vm).width})(e,n),u=C1(t,"sans-serif",e,n),h=Math.min(6e3,eO())/60;for(let f=0;f<h;f++){const g=C1(t,"sans-serif",e,n),v=C1(t,"serif",e,n);if(g!==u||g!==o||v!==s)return await new Promise(p=>setTimeout(p,60)),void(op[i]=!0);await new Promise(p=>setTimeout(p,60))}console.warn(`Timeout for loading font "${t}". Looks like polotno can't load it. Is it a correct font family?`),Ip(`Timeout for loading font "${t}"`)}const k3={};let H8="400,400italic,700,700italic";function iO(){return H8}function $8(t){return`https://fonts.googleapis.com/css?family=${t.replace(/ /g,"+")}:${H8}`}function G8(t){if(k3[t])return;const e=$8(t),n=document.createElement("link");n.type="text/css",n.href=e,n.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(n),k3[t]=!0}const A3={};let Gf;function W8(t){const e=t.fontFamily;if(A3[e]||!t.url&&!t.styles)return;const n=t.styles||(t.url?[{src:`url("${t.url}")`}]:[]),r=(Gf||(Gf=document.getElementById("polotno-font-style"),Gf||(Gf=document.createElement("style"),Gf.id="polotno-font-style",document.head.appendChild(Gf)),Gf)).sheet;n.forEach(i=>{r.insertRule(`
90
+ @font-face{
91
+ font-family:'${e}';
92
+ src:${i.src};
93
+ font-style:${i.fontStyle||"normal"};
94
+ font-weight:${i.fontWeight||"normal"};
95
+ font-display:swap; /* optional but recommended */
96
+ }`,r.cssRules.length)}),A3[t.fontFamily]=!0}const Si=Kn({imageDownScalingEnabled:!0,removeBackgroundEnabled:!0,htmlRenderEnabled:!1,forceTextFitEnabled:!1,textVerticalResizeEnabled:!1,textOverflow:"resize",textSplitAllowed:!1,animationsEnabled:!1}),aO=Jn(t=>{Si.textVerticalResizeEnabled=t}),oO=Jn(t=>{Si.removeBackgroundEnabled=t}),sO=Jn(t=>{Si.htmlRenderEnabled=t}),lO=Jn(t=>{Si.imageDownScalingEnabled=t});Jn(t=>{console.warn("useDownScaling is deprecated. Use setDownScalingEnabled instead."),lO(t)});Jn(t=>{console.warn("setForceTextFit is deprecated. Use setTextOverflow instead."),Si.textOverflow="change-font-size"});const V8=Jn(t=>{Si.textOverflow=t}),uO=Jn(t=>{Si.textSplitAllowed=t});Jn(t=>{Si.animationsEnabled=t});function rs(t=""){return(t.match(/<\/p>/gi)||[]).length>1&&(t=t.replace(/<\/p>/gi,(e,n,r)=>(r.slice(n+e.length).match(/<\/p>/gi)||[]).length>0?`
97
+ `:e)),t.replace(/(<([^>]+)>)/gi,"")}function cO(t){return t?/<[a-z][a-z0-9]*(\s[^>]*)?>[^<]*<\/[a-z][a-z0-9]*>/i.test(t)?t=(t=t.replace(/<(?![a-z/!])/gi,"&lt;")).replace(/([^a-z0-9"'\s/])>/gi,"$1&gt;"):t.replace(/</g,"&lt;").replace(/>/g,"&gt;"):""}const fO={warm:t=>e=>{const n=e.data;t=Math.max(0,Math.min(1,t));for(let r=0;r<n.length;r+=4)n[r]=Math.min(n[r]+30*t,255),n[r+1]=Math.min(n[r+1]+15*t,255);return e},cold:t=>e=>{const n=e.data;t=Math.max(0,Math.min(1,t));for(let r=0;r<n.length;r+=4)n[r]=Math.min(n[r]-15*t,255),n[r+1]=Math.min(n[r+1]-10*t,255),n[r+2]=Math.min(n[r+2]+15*t,255);return e},natural:t=>e=>{const n=e.data;t=Math.max(0,Math.min(1,t));for(let r=0;r<n.length;r+=4){n[r]=Math.min(n[r]*(1+.1*t),255),n[r+1]=Math.min(n[r+1]*(1+.1*t),255),n[r+2]=Math.min(n[r+2]*(1+.1*t),255);const i=(n[r]+n[r+1]+n[r+2])/3;n[r]=Math.min((n[r]-i)*(1+.2*t)+i,255),n[r+1]=Math.min((n[r+1]-i)*(1+.2*t)+i,255),n[r+2]=Math.min((n[r+2]-i)*(1+.2*t)+i,255)}return e},temperature:t=>e=>{const n=e.data;t=Math.max(-1,Math.min(1,t));for(let r=0;r<n.length;r+=4){const i=n[r],a=(n[r+1],n[r+2]);n[r]=Math.min(Math.max(i+15*t,0),255),n[r+2]=Math.min(Math.max(a-15*t,0),255)}return e},contrast:t=>e=>{const n=e.data,r=100*(t=Math.max(-1,Math.min(1,t))),i=259*(r+255)/(255*(259-r));for(let a=0;a<n.length;a+=4)n[a]=Math.min(Math.max(i*(n[a]-128)+128,0),255),n[a+1]=Math.min(Math.max(i*(n[a+1]-128)+128,0),255),n[a+2]=Math.min(Math.max(i*(n[a+2]-128)+128,0),255);return e},shadows:t=>e=>{const n=e.data;t=Math.max(-1,Math.min(1,t));for(let r=0;r<n.length;r+=4){const i=(n[r]+n[r+1]+n[r+2])/3;if(i<128){const a=1+t*(1-i/128)*2;n[r]=Math.min(Math.max(n[r]*a,0),255),n[r+1]=Math.min(Math.max(n[r+1]*a,0),255),n[r+2]=Math.min(Math.max(n[r+2]*a,0),255)}}return e},white:t=>e=>{const n=e.data;t=Math.max(-1,Math.min(1,t));for(let r=0;r<n.length;r+=4){const i=n[r],a=n[r+1],o=n[r+2],s=(i+a+o)/3;if(s>128){const u=1+t*((s-128)/127);n[r]=Math.min(Math.max(i*u,0),255),n[r+1]=Math.min(Math.max(a*u,0),255),n[r+2]=Math.min(Math.max(o*u,0),255)}}return e},black:t=>e=>{const n=e.data;t=Math.max(-1,Math.min(1,t));for(let r=0;r<n.length;r+=4){const i=n[r],a=n[r+1],o=n[r+2],s=(i+a+o)/3;if(s<128){const u=1+t*((128-s)/128);n[r]=Math.min(Math.max(i*u,0),255),n[r+1]=Math.min(Math.max(a*u,0),255),n[r+2]=Math.min(Math.max(o*u,0),255)}}return e},vibrance:t=>e=>{const n=e.data;t=Math.max(-1,Math.min(1,t));for(let r=0;r<n.length;r+=4){const i=n[r],a=n[r+1],o=n[r+2],s=Math.max(i,a,o),u=t<0?(1-(s===0?0:(s-(i+a+o)/3)/s))*t*1.5:.5*t;n[r]=Math.min(Math.max(i-(s-i)*u,0),255),n[r+1]=Math.min(Math.max(a-(s-a)*u,0),255),n[r+2]=Math.min(Math.max(o-(s-o)*u,0),255)}return e},saturation:t=>e=>{const n=e.data;t=Math.max(-1,Math.min(1,t));for(let r=0;r<n.length;r+=4){const i=n[r],a=n[r+1],o=n[r+2],s=.2126*i+.7152*a+.0722*o;n[r]=Math.min(Math.max(s+(i-s)*(1+t),0),255),n[r+1]=Math.min(Math.max(s+(a-s)*(1+t),0),255),n[r+2]=Math.min(Math.max(s+(o-s)*(1+t),0),255)}return e}};function Ms(t,e){var n;const r={filters:[]},i={};e.brightnessEnabled&&(r.filters.push(sn.Filters.Brighten),r.brightness=e.brightness),e.blurEnabled&&(r.filters.push(sn.Filters.Blur),r.blurRadius=e.blurRadius,e.type==="text"&&e.lineHeight<1&&(i.offset=e.fontSize)),e.sepiaEnabled&&r.filters.push(sn.Filters.Sepia),e.grayscaleEnabled&&r.filters.push(sn.Filters.Grayscale),e.filters.forEach((a,o)=>{const s=fO[o];s&&r.filters.push(s(a.intensity))}),t.setAttrs(r),r.filters.length?t.cache(Object.assign(Object.assign({},i),{pixelRatio:e.store._elementsPixelRatio})):t.clearCache(),(n=t.getLayer())===null||n===void 0||n.batchDraw()}const Lf=()=>"ontouchstart"in window||navigator.maxTouchPoints>0;var P3={},Y8="warn";function hO(t){Y8=t}function dO(){return Y8}var ja;(function(t){t.afterCreate="afterCreate",t.afterAttach="afterAttach",t.afterCreationFinalization="afterCreationFinalization",t.beforeDetach="beforeDetach",t.beforeDestroy="beforeDestroy"})(ja||(ja={}));var mm=function(t,e){return mm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},mm(t,e)};function ai(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");mm(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var Uu=function(){return Uu=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},Uu.apply(this,arguments)};function pO(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function sp(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function _f(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function ch(t,e,n){if(arguments.length===2)for(var r=0,i=e.length,a;r<i;r++)(a||!(r in e))&&(a||(a=Array.prototype.slice.call(e,0,r)),a[r]=e[r]);return t.concat(a||Array.prototype.slice.call(e))}function X8(t){return zn(t).type}function K8(t,e){return zn(t).onSnapshot(e)}function O3(t,e){zn(t).applyPatches(a7(e))}function ym(t,e){return zn(t).applySnapshot(e)}function Ru(t,e){e===void 0&&(e=!0);var n=zn(t);return e?n.snapshot:n.type.getSnapshot(n,!1)}function L1(t,e){for(var n=zn(t).parent;n;){if(e.is(n.storedValue))return!0;n=n.parent}return!1}function Xf(t,e){for(var n=zn(t).parent;n;){if(e.is(n.storedValue))return n.storedValue;n=n.parent}throw new nn("Failed to find the parent of ".concat(zn(t)," of a given type"))}function gO(t){return zn(t).root.storedValue}function vO(t){return zn(t).path}function mO(t,e){var n=FO(zn(t),e);return n?n.value:void 0}function yO(t){return zn(t).identifier}function eh(t){return zn(t).detach(),t}function e2(t){var e=zn(t);e.isRoot?e.die():e.parent.removeChild(e.subpath)}function C3(t){return zn(t).observableIsAlive}var Z8=(function(){function t(e,n,r,i){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_escapedSubpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storedValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"aliveAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_state",{enumerable:!0,configurable:!0,writable:!0,value:wo.INITIALIZING}),Object.defineProperty(this,"_hookSubscribers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.environment=i,this.baseSetParent(n,r)}return Object.defineProperty(t.prototype,"subpath",{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},set:function(e){var n=this.isAlive;this._state=e;var r=this.isAlive;this.aliveAtom&&n!==r&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._hookSubscribers&&this._hookSubscribers.emit(e,this,e)}}),Object.defineProperty(t.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){return this._hookSubscribers||(this._hookSubscribers=new l7),this._hookSubscribers.register(e,n)}}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getReconciliationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(t.prototype,"baseSetParent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){this._parent=e,this._subpath=n,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(t.prototype,"path",{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getEscapedPath",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e&&(this.pathAtom||(this.pathAtom=s0("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?nh(this._subpath):""),this.parent.getEscapedPath(e)+"/"+this._escapedSubpath):""}}),Object.defineProperty(t.prototype,"isRoot",{get:function(){return this.parent===null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAlive",{get:function(){return this.state!==wo.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isDetaching",{get:function(){return this.state===wo.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=s0("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this.state===wo.CREATED){if(this.parent){if(this.parent.state!==wo.FINALIZED)return;this.fireHook(ja.afterAttach)}this.state=wo.FINALIZED,e&&e()}}}),Object.defineProperty(t.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=wo.DEAD}}),Object.defineProperty(t.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(ja.beforeDestroy)}}),t})(),wp=(function(t){ai(e,t);function e(n,r,i,a,o){var s=t.call(this,n,r,i,a)||this;try{s.storedValue=n.createNewInstance(o)}catch(u){throw s.state=wo.DEAD,u}return s.state=wo.CREATED,s.finalizeCreation(),s}return Object.defineProperty(e.prototype,"root",{get:function(){if(!this.parent)throw new nn("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this.parent!==n,a=this.subpath!==r;!i&&!a||(this.environment=void 0,this.baseSetParent(this.parent,r))}}),Object.defineProperty(e.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(e.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=(this.isAlive?this.path:this.pathUponDeath)||"<root>";return"".concat(this.type.name,"@").concat(n).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(e.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===wo.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(e.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(e.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(e.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(e.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.fireInternalHook(n)}}),e})(Z8);wp.prototype.die=Jn(wp.prototype.die);var bO=1,Ql;(function(t){t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.CREATING=1]="CREATING",t[t.CREATED=2]="CREATED"})(Ql||(Ql={}));var Js;(function(t){t.Dispose="dispose",t.Patch="patch",t.Snapshot="snapshot"})(Js||(Js={}));var wO={onError:function(t){throw t}},Is=(function(t){ai(e,t);function e(n,r,i,a,o){var s=t.call(this,n,r,i,a)||this;if(Object.defineProperty(s,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++bO}),Object.defineProperty(s,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"unnormalizedIdentifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"identifierCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"isProtectionEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(s,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"hasSnapshotPostProcessor",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(s,"_applyPatches",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_applySnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_autoUnbox",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(s,"_isRunningAction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(s,"_hasSnapshotReaction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(s,"_observableInstanceState",{enumerable:!0,configurable:!0,writable:!0,value:Ql.UNINITIALIZED}),Object.defineProperty(s,"_childNodes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_initialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_cachedInitialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_cachedInitialSnapshotCreated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(s,"_snapshotComputed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_snapshotUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_internalEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),s._snapshotComputed=gh(function(){return s.getSnapshot()}),s.unbox=s.unbox.bind(s),s._initialSnapshot=o,s.identifierAttribute=n.identifierAttribute,r||(s.identifierCache=new IO),s._childNodes=n.initializeChildNodes(s,s._initialSnapshot),s.identifier=null,s.unnormalizedIdentifier=null,s.identifierAttribute&&s._initialSnapshot){var u=s._initialSnapshot[s.identifierAttribute];if(u===void 0){var h=s._childNodes[s.identifierAttribute];h&&(u=h.value)}if(typeof u!="string"&&typeof u!="number")throw new nn("Instance identifier '".concat(s.identifierAttribute,"' for type '").concat(s.type.name,"' must be a string or a number"));s.identifier=jp(u),s.unnormalizedIdentifier=u}return r?r.root.identifierCache.addNodeToCache(s):s.identifierCache.addNodeToCache(s),s}return Object.defineProperty(e.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.createObservableInstanceIfNeeded(),this._applyPatches(n)}}),Object.defineProperty(e.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.createObservableInstanceIfNeeded(),this._applySnapshot(n)}}),Object.defineProperty(e.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(n){n===void 0&&(n=!0),this._observableInstanceState===Ql.UNINITIALIZED&&this.createObservableInstance(n)}}),Object.defineProperty(e.prototype,"createObservableInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r,i,a,o;n===void 0&&(n=!0),this._observableInstanceState=Ql.CREATING;for(var s=[],u=this.parent;u&&u._observableInstanceState===Ql.UNINITIALIZED;)s.unshift(u),u=u.parent;try{for(var h=sp(s),f=h.next();!f.done;f=h.next()){var g=f.value;g.createObservableInstanceIfNeeded(!1)}}catch(_){r={error:_}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}var v=this.type;try{this.storedValue=v.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,v.finalizeNewInstance(this,this.storedValue)}catch(_){throw this.state=wo.DEAD,_}finally{this._isRunningAction=!1}if(this._observableInstanceState=Ql.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=md,this.state=wo.CREATED,n){this.fireHook(ja.afterCreate),this.finalizeCreation();try{for(var p=sp(s.reverse()),y=p.next();!y.done;y=p.next()){var g=y.value;g.fireHook(ja.afterCreate),g.finalizeCreation()}}catch(_){a={error:_}}finally{try{y&&!y.done&&(o=p.return)&&o.call(p)}finally{if(a)throw a.error}}}}}),Object.defineProperty(e.prototype,"root",{get:function(){var n=this.parent;return n?n.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(ja.beforeDetach);var n=this.state;this.state=wo.DETACHING;var r=this.root,i=r.environment,a=r.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=i,this.identifierCache=a}finally{this.state=n}}}}),Object.defineProperty(e.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=n!==this.parent,a=r!==this.subpath;!i&&!a||(i?(this.environment=void 0,n.root.identifierCache.mergeCache(this),this.baseSetParent(n,r),this.fireHook(ja.afterAttach)):a&&this.baseSetParent(this.parent,r))}}),Object.defineProperty(e.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this;this.fireInternalHook(n);var i=this.storedValue&&typeof this.storedValue=="object"&&this.storedValue[n];typeof i=="function"&&(pc?pc(function(){i.apply(r.storedValue)}):i.apply(this.storedValue))}}),Object.defineProperty(e.prototype,"snapshot",{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===Ql.CREATED?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(e.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(e.prototype,"_getCachedInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var n=this.type,r=this._childNodes,i=this._initialSnapshot;this._cachedInitialSnapshot=n.processInitialSnapshot(r,i),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(e.prototype,"isRunningAction",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(e.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=dO();if(!this.isAlive&&r!=="ignore"){var i=this._getAssertAliveError(n);switch(r){case"error":throw new nn(i);case"warn":YO(i)}}}}),Object.defineProperty(e.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this.getEscapedPath(!1)||this.pathUponDeath||"",i=n.subpath&&nh(n.subpath)||"",a=n.actionContext||SO();a&&a.type!=="action"&&a.parentActionEvent&&(a=a.parentActionEvent);var o="";if(a&&a.name!=null){var s=a&&a.context&&vO(a.context)||r;o="".concat(s,".").concat(a.name,"()")}return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '".concat(this.type.name,"', Path upon death: '").concat(r,"', Subpath: '").concat(i,"', Action: '").concat(o,"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.")}}),Object.defineProperty(e.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.assertAlive({subpath:n}),this._autoUnbox=!1;try{return this._observableInstanceState===Ql.CREATED?this.type.getChildNode(this,n):this._childNodes[n]}finally{this._autoUnbox=!0}}}),Object.defineProperty(e.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(md),this._autoUnbox=!1;try{return this._observableInstanceState===Ql.CREATED?this.type.getChildren(this):r7(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(e.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this.type.getChildType(n)}}),Object.defineProperty(e.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(this.assertAlive(n),!this.isRunningAction()&&this.isProtected)throw new nn("Cannot modify '".concat(this,"', the object is protected and can only be modified by using an action."))}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.type.removeChild(this,n)}}),Object.defineProperty(e.prototype,"unbox",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n&&(this.assertAlive({subpath:n.subpath||n.subpathUponDeath}),this._autoUnbox?n.value:n)}}),Object.defineProperty(e.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=(this.isAlive?this.path:this.pathUponDeath)||"<root>",r=this.identifier?"(id: ".concat(this.identifier,")"):"";return"".concat(this.type.name,"@").concat(n).concat(r).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(e.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=this;this.baseFinalizeCreation(function(){var r,i;try{for(var a=sp(n.getChildren()),o=a.next();!o.done;o=a.next()){var s=o.value;s.finalizeCreation()}}catch(u){r={error:u}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}n.fireInternalHook(ja.afterCreationFinalization)})}}),Object.defineProperty(e.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw new nn("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(e.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=this;this._applyPatches=_p(this.storedValue,"@APPLY_PATCHES",function(r){r.forEach(function(i){if(!i.path){n.type.applySnapshot(n,i.value);return}var a=u7(i.path),o=n7(n,a.slice(0,-1));o.applyPatchLocally(a[a.length-1],i)})}),this._applySnapshot=_p(this.storedValue,"@APPLY_SNAPSHOT",function(r){if(r!==n.snapshot)return n.type.applySnapshot(n,r)}),th(this.storedValue,"$treenode",this),th(this.storedValue,"toJSON",DO)}}),Object.defineProperty(e.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===wo.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(e.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==Ql.UNINITIALIZED&&(this.getChildren().forEach(function(n){n.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit(Js.Dispose),this._internalEventsClear(Js.Dispose))}}),Object.defineProperty(e.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(r){r.finalizeDeath()}),this.root.identifierCache.notifyDied(this);var n=this.snapshot;this._snapshotUponDeath=n,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(e.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._addSnapshotReaction(),this._internalEventsRegister(Js.Snapshot,n)}}),Object.defineProperty(e.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this._internalEventsEmit(Js.Snapshot,n)}}),Object.defineProperty(e.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._internalEventsRegister(Js.Patch,n)}}),Object.defineProperty(e.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){if(this._internalEventsHasSubscribers(Js.Patch)){var i=r.path.substr(this.path.length)+(n.path?"/"+n.path:""),a=$O({},n,{path:i}),o=_f(KO(a),2),s=o[0],u=o[1];this._internalEventsEmit(Js.Patch,s,u)}this.parent&&this.parent.emitPatch(n,r)}}),Object.defineProperty(e.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._internalEventsHas(Js.Dispose,n)}}),Object.defineProperty(e.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(!this.hasDisposer(n)){this._internalEventsRegister(Js.Dispose,n,!0);return}throw new nn("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(e.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(!this._internalEventsHas(Js.Dispose,n))throw new nn("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister(Js.Dispose,n)}}),Object.defineProperty(e.prototype,"removeMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(this.middlewares){var r=this.middlewares.indexOf(n);r>=0&&this.middlewares.splice(r,1)}}}),Object.defineProperty(e.prototype,"addMiddleWare",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this;r===void 0&&(r=!0);var a={handler:n,includeHooks:r};return this.middlewares?this.middlewares.push(a):this.middlewares=[a],function(){i.removeMiddleware(a)}}}),Object.defineProperty(e.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){this.assertWritable({subpath:n}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,n,r)}}),Object.defineProperty(e.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=this;if(!this._hasSnapshotReaction){var r=L6(function(){return n.snapshot},function(i){return n.emitSnapshot(i)},wO);this.addDisposer(r),this._hasSnapshotReaction=!0}}}),Object.defineProperty(e.prototype,"_internalEventsHasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return!!this._internalEvents&&this._internalEvents.hasSubscribers(n)}}),Object.defineProperty(e.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i){return i===void 0&&(i=!1),this._internalEvents||(this._internalEvents=new l7),this._internalEvents.register(n,r,i)}}),Object.defineProperty(e.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return!!this._internalEvents&&this._internalEvents.has(n,r)}}),Object.defineProperty(e.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){this._internalEvents&&this._internalEvents.unregister(n,r)}}),Object.defineProperty(e.prototype,"_internalEventsEmit",{enumerable:!1,configurable:!0,writable:!0,value:function(n){for(var r,i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];this._internalEvents&&(r=this._internalEvents).emit.apply(r,ch([n],_f(i),!1))}}),Object.defineProperty(e.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this._internalEvents&&this._internalEvents.clear(n)}}),Object.defineProperty(e.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),e})(Z8);Is.prototype.createObservableInstance=Jn(Is.prototype.createObservableInstance);Is.prototype.detach=Jn(Is.prototype.detach);Is.prototype.die=Jn(Is.prototype.die);var Q8,ar;(function(t){t[t.String=1]="String",t[t.Number=2]="Number",t[t.Boolean=4]="Boolean",t[t.Date=8]="Date",t[t.Literal=16]="Literal",t[t.Array=32]="Array",t[t.Map=64]="Map",t[t.Object=128]="Object",t[t.Frozen=256]="Frozen",t[t.Optional=512]="Optional",t[t.Reference=1024]="Reference",t[t.Identifier=2048]="Identifier",t[t.Late=4096]="Late",t[t.Refinement=8192]="Refinement",t[t.Union=16384]="Union",t[t.Null=32768]="Null",t[t.Undefined=65536]="Undefined",t[t.Integer=131072]="Integer",t[t.Custom=262144]="Custom",t[t.SnapshotProcessor=524288]="SnapshotProcessor",t[t.Lazy=1048576]="Lazy",t[t.Finite=2097152]="Finite",t[t.Float=4194304]="Float"})(ar||(ar={}));var J8="cannotDetermine",_O=Symbol("$type"),bc=(function(){function t(e){Object.defineProperty(this,Q8,{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=e}return Object.defineProperty(t.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){return yc(this,e),this.instantiate(null,"",n,e).value}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){throw new nn("unimplemented method")}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e===this}}),Object.defineProperty(t.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){var r=t7(e);if(r){var i=X8(e);return this.isAssignableFrom(i)?js():Ds(n,e)}return this.isValidSnapshot(e,n)}}),Object.defineProperty(t.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.validate(e,[{path:"",type:this}]).length===0}}),Object.defineProperty(t.prototype,"Type",{get:function(){throw new nn("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(t.prototype,"TypeWithoutSTN",{get:function(){throw new nn("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(t.prototype,"SnapshotType",{get:function(){throw new nn("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(t.prototype,"CreationType",{get:function(){throw new nn("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}),t})();Q8=_O;bc.prototype.create=Jn(bc.prototype.create);var gd=(function(t){ai(e,t);function e(n){var r=t.call(this,n)||this;return Object.defineProperty(r,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),r}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return n===void 0&&(n=this.getDefaultSnapshot()),t.prototype.create.call(this,n,r)}}),Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.createObservableInstanceIfNeeded(),n.storedValue}}),Object.defineProperty(e.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return!n.identifierAttribute||n.identifier===jp(r[n.identifierAttribute])}}),Object.defineProperty(e.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return n.isDetaching?!1:n.snapshot===r||Di(r)&&zn(r)===n?!0:n.type===this&&o7(r)&&!Di(r)&&this.isMatchingSnapshotId(n,r)?(n.applySnapshot(r),!0):!1}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var o=this.tryToReconcileNode(n,r);if(o)return n.setParent(i,a),n;if(n.die(),Di(r)&&this.isAssignableFrom(X8(r))){var s=zn(r);return s.setParent(i,a),s}return this.instantiate(i,a,void 0,r)}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),e})(bc);gd.prototype.create=Jn(gd.prototype.create);var Sh=(function(t){ai(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n}}),Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.storedValue}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.storedValue}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){if(!n.isDetaching&&n.type===this&&n.storedValue===r)return n;var o=this.instantiate(i,a,void 0,r);return n.die(),o}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),e})(bc);function wc(t){return typeof t=="object"&&t&&t.isType===!0}var xO=1,lp;function SO(){return lp}function EO(){return xO++}function kO(t,e){var n=zn(t.context);t.type==="action"&&n.assertAlive({actionContext:t});var r=n._isRunningAction;n._isRunningAction=!0;var i=lp;lp=t;try{return OO(n,t,e)}finally{lp=i,n._isRunningAction=r}}function AO(t){if(t)return t.type==="action"?t:t.parentActionEvent}function _p(t,e,n){var r=function(){var i=EO(),a=lp,o=AO(a);return kO({type:"action",name:e,id:i,args:VO(arguments),context:t,tree:gO(t),rootId:a?a.rootId:i,parentId:a?a.id:0,allParentIds:a?ch(ch([],_f(a.allParentIds),!1),[a.id],!1):[],parentEvent:a,parentActionEvent:o},n)};return r._isMSTAction=!0,r._isFlowAction=n._isFlowAction,r}var PO=(function(){function t(e,n){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:[]}),n.$mst_middleware&&this.middlewares.push(n.$mst_middleware);for(var r=e;r;)r.middlewares&&this.middlewares.push(r.middlewares),r=r.parent}return Object.defineProperty(t.prototype,"isEmpty",{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getNextMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.middlewares[this.arrayIndex];if(e){var n=e[this.inArrayIndex++];return n||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}}),t})();function OO(t,e,n){var r=new PO(t,n);if(r.isEmpty)return Jn(n).apply(null,e.args);var i=null;function a(o){var s=r.getNextMiddleware(),u=s&&s.handler;if(!u)return Jn(n).apply(null,o.args);if(!s.includeHooks&&ja[o.name])return a(o);function h(g,v){i=a(g),v&&(i=v(i))}function f(g){i=g}return u(o,h,f),i}return a(e)}function CO(t){try{return JSON.stringify(t)}catch(e){return"<Unserializable: ".concat(e,">")}}function e7(t){return typeof t=="function"?"<function".concat(t.name?" "+t.name:"",">"):Di(t)?"<".concat(t,">"):"`".concat(CO(t),"`")}function LO(t){return t.length<280?t:"".concat(t.substring(0,272),"......").concat(t.substring(t.length-8))}function NO(t){var e=t.value,n=t.context[t.context.length-1].type,r=t.context.map(function(s){var u=s.path;return u}).filter(function(s){return s.length>0}).join("/"),i=r.length>0?'at path "/'.concat(r,'" '):"",a=Di(e)?"value of type ".concat(zn(e).type.name,":"):xp(e)?"value":"snapshot",o=n&&Di(e)&&n.is(zn(e).snapshot);return"".concat(i).concat(a," ").concat(e7(e)," is not assignable ").concat(n?"to type: `".concat(n.name,"`"):"")+(t.message?" (".concat(t.message,")"):"")+(n?vC(n)||xp(e)?".":", expected an instance of `".concat(n.name,"` or a snapshot like `").concat(n.describe(),"` instead.")+(o?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function ay(t,e,n){return t.concat([{path:e,type:n}])}function js(){return vd}function Ds(t,e,n){return[{context:t,value:e,message:n}]}function $0(t){return t.reduce(function(e,n){return e.concat(n)},[])}function yc(t,e){XO()&&TO(t,e)}function TO(t,e){var n=t.validate(e,[{path:"",type:t}]);if(n.length>0)throw new nn(RO(t,e,n))}function RO(t,e,n){if(n.length!==0)return"Error while converting ".concat(LO(e7(e))," to `").concat(t.name,`\`:
98
+
99
+ `)+n.map(NO).join(`
100
+ `)}var MO=0,IO=(function(){function t(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:MO++}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:Kn.map()}),Object.defineProperty(this,"lastCacheModificationPerId",{enumerable:!0,configurable:!0,writable:!0,value:Kn.map()})}return Object.defineProperty(t.prototype,"updateLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n=this.lastCacheModificationPerId.get(e);this.lastCacheModificationPerId.set(e,n===void 0?1:n+1)}}),Object.defineProperty(t.prototype,"getLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n=this.lastCacheModificationPerId.get(e)||0;return"".concat(this.cacheId,"-").concat(n)}}),Object.defineProperty(t.prototype,"addNodeToCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){if(n===void 0&&(n=!0),e.identifierAttribute){var r=e.identifier;this.cache.has(r)||this.cache.set(r,Kn.array([],G0));var i=this.cache.get(r);if(i.indexOf(e)!==-1)throw new nn("Already registered");i.push(e),n&&this.updateLastCacheModificationPerId(r)}}}),Object.defineProperty(t.prototype,"mergeCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n=this;D6(e.identifierCache.cache).forEach(function(r){return r.forEach(function(i){n.addNodeToCache(i)})})}}),Object.defineProperty(t.prototype,"notifyDied",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.identifierAttribute){var n=e.identifier,r=this.cache.get(n);r&&(r.remove(e),r.length||this.cache.delete(n),this.updateLastCacheModificationPerId(e.identifier))}}}),Object.defineProperty(t.prototype,"splitCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n=this,r=new t,i=e.path+"/";return wS(this.cache).forEach(function(a){for(var o=_f(a,2),s=o[0],u=o[1],h=!1,f=u.length-1;f>=0;f--){var g=u[f];(g===e||g.path.indexOf(i)===0)&&(r.addNodeToCache(g,!1),u.splice(f,1),u.length||n.cache.delete(s),h=!0)}h&&n.updateLastCacheModificationPerId(s)}),r}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){var r=this.cache.get(n);return r?r.some(function(i){return e.isAssignableFrom(i.type)}):!1}}),Object.defineProperty(t.prototype,"resolve",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){var r=this.cache.get(n);if(!r)return null;var i=r.filter(function(a){return e.isAssignableFrom(a.type)});switch(i.length){case 0:return null;case 1:return i[0];default:throw new nn("Cannot resolve a reference to type '".concat(e.name,"' with id: '").concat(n,"' unambigously, there are multiple candidates: ").concat(i.map(function(a){return a.path}).join(", ")))}}}),t})();function oy(t,e,n,r,i){var a=t7(i);if(a){if(a.parent)throw new nn("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?e.path:"","/").concat(n,"', but it lives already at '").concat(a.path,"'"));return e&&a.setParent(e,n),a}return new Is(t,e,n,r,i)}function Nf(t,e,n,r,i){return new wp(t,e,n,r,i)}function jO(t){return t instanceof wp||t instanceof Is}var wo;(function(t){t[t.INITIALIZING=0]="INITIALIZING",t[t.CREATED=1]="CREATED",t[t.FINALIZED=2]="FINALIZED",t[t.DETACHING=3]="DETACHING",t[t.DEAD=4]="DEAD"})(wo||(wo={}));function Di(t){return!!(t&&t.$treenode)}function zn(t){if(!Di(t))throw new nn("Value ".concat(t," is no MST Node"));return t.$treenode}function t7(t){return t&&t.$treenode||null}function DO(){return zn(this).snapshot}function FO(t,e,n){return n===void 0&&(n=!0),n7(t,u7(e),n)}function n7(t,e,n){n===void 0&&(n=!0);var r=t;try{for(var i=0;i<e.length;i++){var a=e[i];if(a===".."){if(r=r.parent,r)continue}else{if(a===".")continue;if(r){if(r instanceof wp){var o=r.value;Di(o)&&(r=zn(o))}if(r instanceof Is){var s=r.getChildType(a);if(s&&(r=r.getChildNode(a),r))continue}}}throw new nn("Could not resolve '".concat(a,"' in path '").concat(L3(e.slice(0,i))||"/","' while resolving '").concat(L3(e),"'"))}}catch(u){if(!n)return;throw u}return r}function r7(t){if(!t)return vd;var e=Object.keys(t);if(!e.length)return vd;var n=new Array(e.length);return e.forEach(function(r,i){n[i]=t[r]}),n}var BO=Object.toString(),vd=Object.freeze([]),md=Object.freeze({}),G0=W9().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(G0);var nn=(function(t){ai(e,t);function e(n){return n===void 0&&(n="Illegal state"),t.call(this,"[mobx-state-tree] ".concat(n))||this}return e})(Error);function zO(t){return t}var qO=Number.isInteger;function UO(t){return Number(t)===t&&t%1!==0}function HO(t){return Number.isFinite(t)}function i7(t){return Array.isArray(t)||Hu(t)}function a7(t){return t?i7(t)?t:[t]:vd}function $O(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++){var i=e[r];for(var a in i)t[a]=i[a]}return t}function id(t){var e;if(t===null||typeof t!="object")return!1;var n=Object.getPrototypeOf(t);return n==null?!0:((e=n.constructor)===null||e===void 0?void 0:e.toString())===BO}function o7(t){return t!==null&&typeof t=="object"&&!(t instanceof Date)&&!(t instanceof RegExp)}function xp(t,e){return e===void 0&&(e=!0),t==null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"||e&&t instanceof Date}function s7(t){return typeof t!="function"}function GO(t,e,n){iu(t)?B6(t,e,n):Object.defineProperty(t,e,n)}function th(t,e,n){GO(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}var WO=(function(){function t(){Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(t.prototype,"hasSubscribers",{get:function(){return this.handlers.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){var r=this;return n===void 0&&(n=!1),n?this.handlers.unshift(e):this.handlers.push(e),function(){r.unregister(e)}}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.handlers.indexOf(e)>=0}}),Object.defineProperty(t.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n=this.handlers.indexOf(e);n>=0&&this.handlers.splice(n,1)}}),Object.defineProperty(t.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.handlers.length=0}}),Object.defineProperty(t.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=this.handlers.slice();r.forEach(function(i){return i.apply(void 0,ch([],_f(e),!1))})}}),t})(),l7=(function(){function t(){Object.defineProperty(this,"eventHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(t.prototype,"hasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n=this.eventHandlers&&this.eventHandlers[e];return!!n&&n.hasSubscribers}}),Object.defineProperty(t.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n,r){r===void 0&&(r=!1),this.eventHandlers||(this.eventHandlers={});var i=this.eventHandlers[e];return i||(i=this.eventHandlers[e]=new WO),i.register(n,r)}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){var r=this.eventHandlers&&this.eventHandlers[e];return!!r&&r.has(n)}}),Object.defineProperty(t.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n){var r=this.eventHandlers&&this.eventHandlers[e];r&&r.unregister(n)}}),Object.defineProperty(t.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.eventHandlers&&delete this.eventHandlers[e]}}),Object.defineProperty(t.prototype,"clearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.eventHandlers=void 0}}),Object.defineProperty(t.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var n,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var a=this.eventHandlers&&this.eventHandlers[e];a&&(n=a).emit.apply(n,ch([],_f(r),!1))}}),t})();function VO(t){for(var e=new Array(t.length),n=0;n<t.length;n++)e[n]=t[n];return e}function t2(t,e){return t.indexOf(e)===0}function YO(t){console.warn(new Error("[mobx-state-tree] ".concat(t)))}function XO(){return typeof process<"u"&&P3&&P3.ENABLE_TYPE_CHECK==="true"}function KO(t){if(!("oldValue"in t))throw new nn("Patches without `oldValue` field cannot be inversed");return[ZO(t),QO(t)]}function ZO(t){switch(t.op){case"add":return{op:"add",path:t.path,value:t.value};case"remove":return{op:"remove",path:t.path};case"replace":return{op:"replace",path:t.path,value:t.value}}}function QO(t){switch(t.op){case"add":return{op:"remove",path:t.path};case"remove":return{op:"add",path:t.path,value:t.oldValue};case"replace":return{op:"replace",path:t.path,value:t.oldValue}}}function JO(t){return typeof t=="number"}function nh(t){return JO(t)===!0?""+t:t.indexOf("/")===-1&&t.indexOf("~")===-1?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function eC(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function L3(t){if(t.length===0)return"";var e=function(n){return n.map(nh).join("/")};return t[0]==="."||t[0]===".."?e(t):"/"+e(t)}function u7(t){var e=t.split("/").map(eC),n=t===""||t==="."||t===".."||t2(t,"/")||t2(t,"./")||t2(t,"../");if(!n)throw new nn("a json path must be either rooted, empty or relative, but got '".concat(t,"'"));return e[0]===""&&e.shift(),e}var n2=Symbol("$preProcessorFailed"),tC=(function(t){ai(e,t);function e(n,r,i){var a=t.call(this,i||n.name)||this;return Object.defineProperty(a,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"_processors",{enumerable:!0,configurable:!0,writable:!0,value:r}),a}return Object.defineProperty(e.prototype,"flags",{get:function(){return this._subtype.flags|ar.SnapshotProcessor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"snapshotProcessor(".concat(this._subtype.describe(),")")}}),Object.defineProperty(e.prototype,"preProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._processors.preProcessor?this._processors.preProcessor.call(null,n):n}}),Object.defineProperty(e.prototype,"preProcessSnapshotSafe",{enumerable:!1,configurable:!0,writable:!0,value:function(n){try{return this.preProcessSnapshot(n)}catch{return n2}}}),Object.defineProperty(e.prototype,"postProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return this._processors.postProcessor?this._processors.postProcessor.call(null,n,r.storedValue):n}}),Object.defineProperty(e.prototype,"_fixNode",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this;nC(n.type,this,"create"),n instanceof Is&&(n.hasSnapshotPostProcessor=!!this._processors.postProcessor);var i=n.getSnapshot;n.getSnapshot=function(){return r.postProcessSnapshot(i.call(n),n)},xC(this._subtype)||(n.getReconciliationType=function(){return r})}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var o=Di(a)?a:this.preProcessSnapshot(a),s=this._subtype.instantiate(n,r,i,o);return this._fixNode(s),s}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var o=this._subtype.reconcile(n,Di(r)?r:this.preProcessSnapshot(r),i,a);return o!==n&&this._fixNode(o),o}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){r===void 0&&(r=!0);var i=this._subtype.getSnapshot(n);return r?this.postProcessSnapshot(i,n):i}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this.preProcessSnapshotSafe(n);return i===n2?Ds(r,n,"Failed to preprocess value"):this._subtype.validate(i,r)}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=wc(n)?this._subtype:Di(n)?Ru(n,!1):this.preProcessSnapshotSafe(n);return r===n2?!1:this._subtype.validate(r,[{path:"",type:this._subtype}]).length===0}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._subtype.isAssignableFrom(n)}}),Object.defineProperty(e.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){if(!(this._subtype instanceof gd))return!1;var i=this.preProcessSnapshot(r);return this._subtype.isMatchingSnapshotId(n,i)}}),e})(bc);function nC(t,e){for(var n,r,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];try{for(var o=sp(i),s=o.next();!s.done;s=o.next()){var u=s.value;t[u]=e[u].bind(e)}}catch(h){n={error:h}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}function rC(t,e,n){return new tC(t,e,n)}var N3="Map.put can only be used to store complex values that have an identifier type attribute";function c7(t,e){var n,r,i=t.getSubTypes();if(i===J8)return!1;if(i){var a=a7(i);try{for(var o=sp(a),s=o.next();!s.done;s=o.next()){var u=s.value;if(!c7(u,e))return!1}}catch(h){n={error:h}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}return t instanceof Sp&&e.push(t),!0}var cf;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.YES=1]="YES",t[t.NO=2]="NO"})(cf||(cf={}));var iC=(function(t){ai(e,t);function e(n,r){return t.call(this,n,Kn.ref.enhancer,r)||this}return Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return t.prototype.get.call(this,""+n)}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return t.prototype.has.call(this,""+n)}}),Object.defineProperty(e.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return t.prototype.delete.call(this,""+n)}}),Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return t.prototype.set.call(this,""+n,r)}}),Object.defineProperty(e.prototype,"put",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(!n)throw new nn("Map.put cannot be used to set empty values");if(Di(n)){var r=zn(n);if(r.identifier===null)throw new nn(N3);return this.set(r.identifier,n),n}else if(o7(n)){var i=zn(this),a=i.type;if(a.identifierMode!==cf.YES)throw new nn(N3);var o=a.mapIdentifierAttribute,s=n[o];if(!sy(s)){var u=this.put(a.getChildType().create(n,i.environment));return this.put(Ru(u))}var h=jp(s);return this.set(h,n),this.get(h)}else throw new nn("Map.put can only be used to store complex values")}}),e})($m),_0=(function(t){ai(e,t);function e(n,r,i){i===void 0&&(i=[]);var a=t.call(this,n)||this;return Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"identifierMode",{enumerable:!0,configurable:!0,writable:!0,value:cf.UNKNOWN}),Object.defineProperty(a,"mapIdentifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ar.Map}),Object.defineProperty(a,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),a._determineIdentifierMode(),a.hookInitializers=i,a}return Object.defineProperty(e.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this.hookInitializers.length>0?this.hookInitializers.concat(n):[n];return new e(this.name,this._subType,r)}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){return this._determineIdentifierMode(),oy(this,n,r,i,a)}}),Object.defineProperty(e.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===cf.UNKNOWN){var n=[];if(c7(this._subType,n)){var r=n.reduce(function(i,a){if(!a.identifierAttribute)return i;if(i&&i!==a.identifierAttribute)throw new nn("The objects in a map should all have the same identifier attribute, expected '".concat(i,"', but child of type '").concat(a.name,"' declared attribute '").concat(a.identifierAttribute,"' as identifier"));return a.identifierAttribute},void 0);r?(this.identifierMode=cf.YES,this.mapIdentifierAttribute=r):this.identifierMode=cf.NO}}}}),Object.defineProperty(e.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){r===void 0&&(r={});var i=n.type._subType,a={};return Object.keys(r).forEach(function(o){a[o]=i.instantiate(n,o,void 0,r[o])}),a}}),Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return new iC(n,this.name)}}),Object.defineProperty(e.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){I6(r,n.unbox);var i=n.type;i.hookInitializers.forEach(function(a){var o=a(r);Object.keys(o).forEach(function(s){var u=o[s],h=_p(r,s,u);th(r,s,h)})}),qm(r,this.willChange),Um(r,this.didChange)}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return D6(n.storedValue)}}),Object.defineProperty(e.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=n.storedValue.get(""+r);if(!i)throw new nn("Not a child "+r);return i}}),Object.defineProperty(e.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=zn(n.object),i=n.name;r.assertWritable({subpath:i});var a=r.type,o=a._subType;switch(n.type){case"update":{var s=n.newValue,u=n.object.get(i);if(s===u)return null;yc(o,s),n.newValue=o.reconcile(r.getChildNode(i),n.newValue,r,i),a.processIdentifier(i,n.newValue)}break;case"add":yc(o,n.newValue),n.newValue=o.instantiate(r,i,void 0,n.newValue),a.processIdentifier(i,n.newValue);break}return n}}),Object.defineProperty(e.prototype,"processIdentifier",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){if(this.identifierMode===cf.YES&&r instanceof Is){var i=r.identifier;if(i!==n)throw new nn("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '".concat(i,"', but expected: '").concat(n,"'"))}}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r={};return n.getChildren().forEach(function(i){r[i.subpath]=i.snapshot}),r}}),Object.defineProperty(e.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r={};return Object.keys(n).forEach(function(i){r[i]=n[i].getSnapshot()}),r}}),Object.defineProperty(e.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=zn(n.object);switch(n.type){case"update":return void r.emitPatch({op:"replace",path:nh(n.name),value:n.newValue.snapshot,oldValue:n.oldValue?n.oldValue.snapshot:void 0},r);case"add":return void r.emitPatch({op:"add",path:nh(n.name),value:n.newValue.snapshot,oldValue:void 0},r);case"delete":var i=n.oldValue.snapshot;return n.oldValue.die(),void r.emitPatch({op:"remove",path:nh(n.name),oldValue:i},r)}}}),Object.defineProperty(e.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i){var a=n.storedValue;switch(i.op){case"add":case"replace":a.set(r,i.value);break;case"remove":a.delete(r);break}}}),Object.defineProperty(e.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){yc(this,r);var i=n.storedValue,a={};if(Array.from(i.keys()).forEach(function(s){a[s]=!1}),r)for(var o in r)i.set(o,r[o]),a[""+o]=!0;Object.keys(a).forEach(function(s){a[s]===!1&&i.delete(s)})}}),Object.defineProperty(e.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this;return id(n)?$0(Object.keys(n).map(function(a){return i._subType.validate(n[a],ay(r,a,i._subType))})):Ds(r,n,"Value is not a plain object")}}),Object.defineProperty(e.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return md}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){n.storedValue.delete(r)}}),e})(gd);_0.prototype.applySnapshot=Jn(_0.prototype.applySnapshot);function aC(t){return new _0("Map<string, ".concat(t.name,">"),t)}var x0=(function(t){ai(e,t);function e(n,r,i){i===void 0&&(i=[]);var a=t.call(this,n)||this;return Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ar.Array}),Object.defineProperty(a,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),a.hookInitializers=i,a}return Object.defineProperty(e.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this.hookInitializers.length>0?this.hookInitializers.concat(n):[n];return new e(this.name,this._subType,r)}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){return oy(this,n,r,i,a)}}),Object.defineProperty(e.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){r===void 0&&(r=[]);var i=n.type._subType,a={};return r.forEach(function(o,s){var u=""+s;a[u]=i.instantiate(n,u,void 0,o)}),a}}),Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=Uu(Uu({},G0),{name:this.name});return Kn.array(r7(n),r)}}),Object.defineProperty(e.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){qu(r).dehancer=n.unbox;var i=n.type;i.hookInitializers.forEach(function(a){var o=a(r);Object.keys(o).forEach(function(s){var u=o[s],h=_p(r,s,u);th(r,s,h)})}),qm(r,this.willChange),Um(r,this.didChange)}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.storedValue.slice()}}),Object.defineProperty(e.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=Number(r);if(i<n.storedValue.length)return n.storedValue[i];throw new nn("Not a child: "+r)}}),Object.defineProperty(e.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=zn(n.object);r.assertWritable({subpath:""+n.index});var i=r.type._subType,a=r.getChildren();switch(n.type){case"update":{if(n.newValue===n.object[n.index])return null;var o=T3(r,i,[a[n.index]],[n.newValue],[n.index]);if(!o)return null;n.newValue=o[0]}break;case"splice":{var s=n.index,u=n.removedCount,h=n.added,f=T3(r,i,a.slice(s,s+u),h,h.map(function(v,p){return s+p}));if(!f)return null;n.added=f;for(var g=s+u;g<a.length;g++)a[g].setParent(r,""+(g+h.length-u))}break}return n}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.getChildren().map(function(r){return r.snapshot})}}),Object.defineProperty(e.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=[];return Object.keys(n).forEach(function(i){r.push(n[i].getSnapshot())}),r}}),Object.defineProperty(e.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=zn(n.object);switch(n.type){case"update":return void r.emitPatch({op:"replace",path:""+n.index,value:n.newValue.snapshot,oldValue:n.oldValue?n.oldValue.snapshot:void 0},r);case"splice":if(n.removedCount&&n.addedCount===n.object.length)return void r.emitPatch({op:"replace",path:"",value:r.snapshot,oldValue:n.removed.map(function(a){return a.snapshot})},r);for(var i=n.removedCount-1;i>=0;i--)r.emitPatch({op:"remove",path:""+(n.index+i),oldValue:n.removed[i].snapshot},r);for(var i=0;i<n.addedCount;i++)r.emitPatch({op:"add",path:""+(n.index+i),value:n.added[i].snapshot,oldValue:void 0},r);return}}}),Object.defineProperty(e.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i){var a=n.storedValue,o=r==="-"?a.length:Number(r);switch(i.op){case"replace":a[o]=i.value;break;case"add":a.splice(o,0,i.value);break;case"remove":a.splice(o,1);break}}}),Object.defineProperty(e.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){yc(this,r);var i=n.storedValue;i.replace(r)}}),Object.defineProperty(e.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this;return i7(n)?$0(n.map(function(a,o){return i._subType.validate(a,ay(r,""+o,i._subType))})):Ds(r,n,"Value is not an array")}}),Object.defineProperty(e.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return vd}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){n.storedValue.splice(Number(r),1)}}),e})(gd);x0.prototype.applySnapshot=Jn(x0.prototype.applySnapshot);function oC(t){return new x0("".concat(t.name,"[]"),t)}function T3(t,e,n,r,i){for(var a=!0,o=0;;o++){var s=o<=r.length-1,u=n[o],h=s?r[o]:void 0,f=""+i[o];if(jO(h)&&(h=h.storedValue),!u&&!s)break;if(!s)a=!1,n.splice(o,1),u instanceof Is&&u.createObservableInstanceIfNeeded(),u.die(),o--;else if(u)if(R3(u,h))n[o]=r2(e,t,f,h,u);else{for(var v=void 0,p=o;p<n.length;p++)if(R3(n[p],h)){v=n.splice(p,1)[0];break}a=!1;var g=r2(e,t,f,h,v);n.splice(o,0,g)}else{if(Di(h)&&zn(h).parent===t)throw new nn("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(t.path,"/").concat(f,"', but it lives already at '").concat(zn(h).path,"'"));a=!1;var g=r2(e,t,f,h);n.splice(o,0,g)}}return a?null:n}function r2(t,e,n,r,i){yc(t,r);function a(){if(Di(r)){var s=zn(r);if(s.assertAlive(md),s.parent!==null&&s.parent===e)return s.setParent(e,n),s}return i?t.reconcile(i,r,e,n):t.instantiate(e,n,void 0,r)}var o=a();return i&&i!==o&&(i instanceof Is&&i.createObservableInstanceIfNeeded(),i.die()),o}function R3(t,e){if(!t.isAlive)return!1;if(Di(e)){var n=zn(e);return n.isAlive&&n===t}if(t.snapshot===e)return!0;if(!(t instanceof Is))return!1;var r=t.getReconciliationType();return t.identifier!==null&&t.identifierAttribute&&id(e)&&r.is(e)&&r.isMatchingSnapshotId(t,e)}var M3="preProcessSnapshot",I3="postProcessSnapshot";function sC(){return zn(this).toString()}var j3={name:"AnonymousModel",properties:{},initializers:vd};function lC(t){var e=Object.keys(t),n=new Set;return e.forEach(function(r){if(n.has(r))throw new nn("".concat(r," is declared twice in the model. Model should not contain the same keys"));n.add(r)}),e.reduce(function(r,i){if(i in ja)throw new nn("Hook '".concat(i,"' was defined as property. Hooks should be defined as part of the actions"));var a=Object.getOwnPropertyDescriptor(t,i);if("get"in a)throw new nn("Getters are not supported as properties. Please use views instead");var o=a.value;if(o==null)throw new nn("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(xp(o))r[i]=rh(gC(o),o);else if(o instanceof _0)r[i]=rh(o,{});else if(o instanceof x0)r[i]=rh(o,[]);else if(!wc(o))throw new nn("Invalid type definition for property '".concat(i,"', cannot infer a type from a value like '").concat(o,"' (").concat(typeof o,")"));return r},Uu({},t))}var Sp=(function(t){ai(e,t);function e(n){var r=t.call(this,n.name||j3.name)||this;return Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ar.Object}),Object.defineProperty(r,"initializers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"properties",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"preProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"postProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"propertyNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"named",{enumerable:!0,configurable:!0,writable:!0,value:function(i){return r.cloneAndEnhance({name:i})}}),Object.defineProperty(r,"props",{enumerable:!0,configurable:!0,writable:!0,value:function(i){return r.cloneAndEnhance({properties:i})}}),Object.defineProperty(r,"preProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(i){var a=r.preProcessor;return a?r.cloneAndEnhance({preProcessor:function(o){return a(i(o))}}):r.cloneAndEnhance({preProcessor:i})}}),Object.defineProperty(r,"postProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(i){var a=r.postProcessor;return a?r.cloneAndEnhance({postProcessor:function(o){return i(a(o))}}):r.cloneAndEnhance({postProcessor:i})}}),Object.assign(r,j3,n),r.properties=lC(r.properties),r.properties,r.propertyNames=Object.keys(r.properties),r.identifierAttribute=r._getIdentifierAttribute(),r}return Object.defineProperty(e.prototype,"_getIdentifierAttribute",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=void 0;return this.forAllProps(function(r,i){if(i.flags&ar.Identifier){if(n)throw new nn("Cannot define property '".concat(r,"' as object identifier, property '").concat(n,"' is already defined as identifier property"));n=r}}),n}}),Object.defineProperty(e.prototype,"cloneAndEnhance",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return new e({name:n.name||this.name,properties:Object.assign({},this.properties,n.properties),initializers:this.initializers.concat(n.initializers||[]),preProcessor:n.preProcessor||this.preProcessor,postProcessor:n.postProcessor||this.postProcessor})}}),Object.defineProperty(e.prototype,"actions",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this,i=function(a){return r.instantiateActions(a,n(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(e.prototype,"instantiateActions",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){if(!id(r))throw new nn("actions initializer should return a plain object containing actions");Object.keys(r).forEach(function(i){if(i===M3)throw new nn("Cannot define action '".concat(M3,"', it should be defined using 'type.preProcessSnapshot(fn)' instead"));if(i===I3)throw new nn("Cannot define action '".concat(I3,"', it should be defined using 'type.postProcessSnapshot(fn)' instead"));var a=r[i],o=n[i];if(i in ja&&o){var s=a;a=function(){o.apply(null,arguments),s.apply(null,arguments)}}var u=a.$mst_middleware,h=a.bind(r);h._isFlowAction=a._isFlowAction||!1,h.$mst_middleware=u;var f=_p(n,i,h);r[i]=f,th(n,i,f)})}}),Object.defineProperty(e.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this;if(typeof n!="function")throw new nn("You passed an ".concat(typeof n," to volatile state as an argument, when function is expected"));var i=function(a){return r.instantiateVolatileState(a,n(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(e.prototype,"instantiateVolatileState",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){if(!id(r))throw new nn("volatile state initializer should return a plain object containing state");F6(n,r)}}),Object.defineProperty(e.prototype,"extend",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this,i=function(a){var o=n(a),s=o.actions,u=o.views,h=o.state,f=pO(o,["actions","views","state"]);for(var g in f)throw new nn("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '".concat(g,"'"));return h&&r.instantiateVolatileState(a,h),u&&r.instantiateViews(a,u),s&&r.instantiateActions(a,s),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(e.prototype,"views",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this,i=function(a){return r.instantiateViews(a,n(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(e.prototype,"instantiateViews",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){if(!id(r))throw new nn("views initializer should return a plain object containing views");Object.getOwnPropertyNames(r).forEach(function(i){var a,o=Object.getOwnPropertyDescriptor(r,i);if("get"in o)B6(n,i,o),q6(n,(a={},a[i]=gh,a));else if(typeof o.value=="function")th(n,i,o.value);else throw new nn("A view member should either be a function or getter based property")})}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var o=Di(a)?a:this.applySnapshotPreProcessor(a);return oy(this,n,r,i,o)}}),Object.defineProperty(e.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){r===void 0&&(r={});var i=n.type,a={};return i.forAllProps(function(o,s){a[o]=s.instantiate(n,o,void 0,r[o])}),a}}),Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=Uu(Uu({},G0),{name:this.name});return Kn.object(n,md,r)}}),Object.defineProperty(e.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){th(r,"toString",sC),this.forAllProps(function(i){I6(r,i,n.unbox)}),this.initializers.reduce(function(i,a){return a(i)},r),qm(r,this.willChange),Um(r,this.didChange)}}),Object.defineProperty(e.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=n,i=zn(r.object),a=r.name;i.assertWritable({subpath:a});var o=i.type.properties[a];return o&&(yc(o,r.newValue),r.newValue=o.reconcile(i.getChildNode(a),r.newValue,i,a)),r}}),Object.defineProperty(e.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=n,i=zn(r.object),a=i.type.properties[r.name];if(a){var o=r.oldValue?r.oldValue.snapshot:void 0;i.emitPatch({op:"replace",path:nh(r.name),value:r.newValue.snapshot,oldValue:o},i)}}}),Object.defineProperty(e.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this,i=[];return this.forAllProps(function(a){i.push(r.getChildNode(n,a))}),i}}),Object.defineProperty(e.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i;if(!(r in this.properties))throw new nn("Not a value property: "+r);var a=qu(n.storedValue,r),o=(i=a.raw)===null||i===void 0?void 0:i.call(a);if(!o)throw new nn("Node not available for property "+r);return o}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this;r===void 0&&(r=!0);var a={};return this.forAllProps(function(o,s){try{var u=dd(n.storedValue,o);u.reportObserved()}catch{throw new nn("".concat(o," property is declared twice"))}a[o]=i.getChildNode(n,o).snapshot}),r?this.applySnapshotPostProcessor(a):a}}),Object.defineProperty(e.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r={};return Object.keys(n).forEach(function(i){r[i]=n[i].getSnapshot()}),this.applySnapshotPostProcessor(r)}}),Object.defineProperty(e.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i){if(!(i.op==="replace"||i.op==="add"))throw new nn("object does not support operation ".concat(i.op));n.storedValue[r]=i.value}}),Object.defineProperty(e.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){yc(this,r);var i=this.applySnapshotPreProcessor(r);this.forAllProps(function(a){n.storedValue[a]=i[a]})}}),Object.defineProperty(e.prototype,"applySnapshotPreProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this.preProcessor;return r?r.call(null,n):n}}),Object.defineProperty(e.prototype,"applySnapshotPostProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this.postProcessor;return r?r.call(null,n):n}}),Object.defineProperty(e.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this.properties[n]}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this,a=this.applySnapshotPreProcessor(n);return id(a)?$0(this.propertyNames.map(function(o){return i.properties[o].validate(a[o],ay(r,o,i.properties[o]))})):Ds(r,a,"Value is not a plain object")}}),Object.defineProperty(e.prototype,"forAllProps",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this;this.propertyNames.forEach(function(i){return n(i,r.properties[i])})}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=this;return"{ "+this.propertyNames.map(function(r){return r+": "+n.properties[r].describe()}).join("; ")+" }"}}),Object.defineProperty(e.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return md}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){n.storedValue[r]=void 0}}),e})(gd);Sp.prototype.applySnapshot=Jn(Sp.prototype.applySnapshot);function uC(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=typeof t[0]=="string"?t.shift():"AnonymousModel",r=t.shift()||{};return new Sp({name:n,properties:r})}function cC(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=typeof t[0]=="string",r=n?t[0]:"AnonymousModel";return n&&t.shift(),t.reduce(function(i,a){return i.cloneAndEnhance({name:i.name+"_"+a.name,properties:a.properties,initializers:a.initializers,preProcessor:function(o){return a.applySnapshotPreProcessor(i.applySnapshotPreProcessor(o))},postProcessor:function(o){return a.applySnapshotPostProcessor(i.applySnapshotPostProcessor(o))}})}).named(r)}function fC(t){return wc(t)&&(t.flags&ar.Object)>0}var Ec=(function(t){ai(e,t);function e(n,r,i,a){a===void 0&&(a=zO);var o=t.call(this,n)||this;return Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"checker",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"initializer",{enumerable:!0,configurable:!0,writable:!0,value:a}),o.flags=r,o}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){return Nf(this,n,r,i,a)}}),Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this.initializer(n)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){if(xp(n)&&this.checker(n))return js();var i=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return Ds(r,n,"Value is not a ".concat(i))}}),e})(Sh),f7=new Ec("string",ar.String,function(t){return typeof t=="string"}),h7=new Ec("number",ar.Number,function(t){return typeof t=="number"}),hC=new Ec("integer",ar.Integer,function(t){return qO(t)}),dC=new Ec("float",ar.Float,function(t){return UO(t)}),pC=new Ec("finite",ar.Finite,function(t){return HO(t)}),d7=new Ec("boolean",ar.Boolean,function(t){return typeof t=="boolean"}),p7=new Ec("null",ar.Null,function(t){return t===null}),g7=new Ec("undefined",ar.Undefined,function(t){return t===void 0}),v7=new Ec("Date",ar.Date,function(t){return typeof t=="number"||t instanceof Date},function(t){return t instanceof Date?t:new Date(t)});v7.getSnapshot=function(t){return t.storedValue.getTime()};var m7=v7;function gC(t){switch(typeof t){case"string":return f7;case"number":return h7;case"boolean":return d7;case"object":if(t instanceof Date)return m7}throw new nn("Cannot determine primitive type from value "+t)}function vC(t){return wc(t)&&(t.flags&(ar.String|ar.Number|ar.Integer|ar.Boolean|ar.Date))>0}var mC=(function(t){ai(e,t);function e(n){var r=t.call(this,JSON.stringify(n))||this;return Object.defineProperty(r,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ar.Literal}),r.value=n,r}return Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){return Nf(this,n,r,i,a)}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify(this.value)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return xp(n)&&n===this.value?js():Ds(r,n,"Value is not a literal ".concat(JSON.stringify(this.value)))}}),e})(Sh);function y7(t){return new mC(t)}var yC=(function(t){ai(e,t);function e(n,r,i,a){var o=t.call(this,n)||this;return Object.defineProperty(o,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"_predicate",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"_message",{enumerable:!0,configurable:!0,writable:!0,value:a}),o}return Object.defineProperty(e.prototype,"flags",{get:function(){return this._subtype.flags|ar.Refinement},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){return this._subtype.instantiate(n,r,i,a)}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._subtype.isAssignableFrom(n)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this._subtype.validate(n,r);if(i.length>0)return i;var a=Di(n)?zn(n).snapshot:n;return this._predicate(a)?js():Ds(r,n,this._message(n))}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){return this._subtype.reconcile(n,r,i,a)}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),e})(bc);function bC(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=typeof t[0]=="string"?t.shift():wc(t[0])?t[0].name:null,r=t[0],i=t[1],a=t[2]?t[2]:function(o){return"Value does not respect the refinement predicate"};return new yC(n,r,i,a)}function wC(t,e){var n=typeof t=="string"?e:t,r=W0.apply(void 0,ch([],_f(n.map(function(i){return y7(""+i)})),!1));return typeof t=="string"&&(r.name=t),r}var _C=(function(t){ai(e,t);function e(n,r,i){var a=t.call(this,n)||this;return Object.defineProperty(a,"_types",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_dispatcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_eager",{enumerable:!0,configurable:!0,writable:!0,value:!0}),i=Uu({eager:!0,dispatcher:void 0},i),a._dispatcher=i.dispatcher,i.eager||(a._eager=!1),a}return Object.defineProperty(e.prototype,"flags",{get:function(){var n=ar.Union;return this._types.forEach(function(r){n|=r.flags}),n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._types.some(function(r){return r.isAssignableFrom(n)})}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"("+this._types.map(function(n){return n.describe()}).join(" | ")+")"}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var o=this.determineType(a,void 0);if(!o)throw new nn("No matching type for union "+this.describe());return o.instantiate(n,r,i,a)}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var o=this.determineType(r,n.getReconciliationType());if(!o)throw new nn("No matching type for union "+this.describe());return o.reconcile(n,r,i,a)}}),Object.defineProperty(e.prototype,"determineType",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return this._dispatcher?this._dispatcher(n):r?r.is(n)?r:this._types.filter(function(i){return i!==r}).find(function(i){return i.is(n)}):this._types.find(function(i){return i.is(n)})}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){if(this._dispatcher)return this._dispatcher(n).validate(n,r);for(var i=[],a=0,o=0;o<this._types.length;o++){var s=this._types[o],u=s.validate(n,r);if(u.length===0){if(this._eager)return js();a++}else i.push(u)}return a===1?js():Ds(r,n,"No type is applicable for the union").concat($0(i))}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),e})(bc);function W0(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=wc(t)?void 0:t,i=wc(t)?ch([t],_f(e),!1):e,a="("+i.map(function(o){return o.name}).join(" | ")+")";return new _C(a,i,r)}function xC(t){return wc(t)&&(t.flags&ar.Union)>0}var SC=(function(t){ai(e,t);function e(n,r,i){var a=t.call(this,n.name)||this;return Object.defineProperty(a,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"_defaultValue",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"optionalValues",{enumerable:!0,configurable:!0,writable:!0,value:i}),a}return Object.defineProperty(e.prototype,"flags",{get:function(){return this._subtype.flags|ar.Optional},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype.describe()+"?"}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){if(this.optionalValues.indexOf(a)>=0){var o=this.getDefaultInstanceOrSnapshot();return this._subtype.instantiate(n,r,i,o)}return this._subtype.instantiate(n,r,i,a)}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){return this._subtype.reconcile(n,this.optionalValues.indexOf(r)<0&&this._subtype.is(r)?r:this.getDefaultInstanceOrSnapshot(),i,a)}}),Object.defineProperty(e.prototype,"getDefaultInstanceOrSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=typeof this._defaultValue=="function"?this._defaultValue():this._defaultValue;return typeof this._defaultValue=="function"&&yc(this,n),n}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return this.optionalValues.indexOf(n)>=0?js():this._subtype.validate(n,r)}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._subtype.isAssignableFrom(n)}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),e})(bc);function EC(t,e){if(typeof e!="function"&&Di(e))throw new nn("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function rh(t,e,n){return EC(t,e),new SC(t,e,n||kC)}var kC=[void 0],AC=rh(g7,void 0),PC=rh(p7,null);function b7(t){return W0(t,AC)}function OC(t){return W0(t,PC)}var CC=(function(t){ai(e,t);function e(n,r){var i=t.call(this,n)||this;return Object.defineProperty(i,"_definition",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),i}return Object.defineProperty(e.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|ar.Late},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getSubType",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(!this._subType){var r=void 0;try{r=this._definition()}catch(i){if(i instanceof ReferenceError)r=void 0;else throw i}if(n&&r===void 0)throw new nn("Late type seems to be used too early, the definition (still) returns undefined");r&&(this._subType=r)}return this._subType}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){return this.getSubType(!0).instantiate(n,r,i,a)}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){return this.getSubType(!0).reconcile(n,r,i,a)}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=this.getSubType(!1);return n?n.name:"<uknown late type>"}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this.getSubType(!1);return i?i.validate(n,r):js()}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this.getSubType(!1);return r?r.isAssignableFrom(n):!1}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=this.getSubType(!1);return n||J8}}),e})(bc);function LC(t,e){var n=typeof t=="string"?t:"late(".concat(t.toString(),")"),r=typeof t=="string"?e:t;return new CC(n,r)}function NC(t,e){return new TC(t,e)}var TC=(function(t){ai(e,t);function e(n,r){var i=t.call(this,n)||this;return Object.defineProperty(i,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ar.Lazy}),Object.defineProperty(i,"loadedType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"pendingNodeList",{enumerable:!0,configurable:!0,writable:!0,value:Kn.array()}),d5(function(){return i.pendingNodeList.length>0&&i.pendingNodeList.some(function(a){return a.isAlive&&i.options.shouldLoadPredicate(a.parent?a.parent.value:null)})},function(){i.options.loadType().then(Jn(function(a){i.loadedType=a,i.pendingNodeList.forEach(function(o){o.parent&&i.loadedType&&o.parent.applyPatches([{op:"replace",path:"/".concat(o.subpath),value:o.snapshot}])})}))}),i}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<lazy ".concat(this.name,">")}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var o=this;if(this.loadedType)return this.loadedType.instantiate(n,r,i,a);var s=Nf(this,n,r,i,a);return this.pendingNodeList.push(s),d5(function(){return!s.isAlive},function(){return o.pendingNodeList.splice(o.pendingNodeList.indexOf(s),1)}),s}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return this.loadedType?this.loadedType.validate(n,r):s7(n)?js():Ds(r,n,"Value is not serializable and cannot be lazy")}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){return this.loadedType?(n.die(),this.loadedType.instantiate(i,a,i.environment,r)):t.prototype.reconcile.call(this,n,r,i,a)}}),e})(Sh),w7=(function(t){ai(e,t);function e(n){var r=t.call(this,n?"frozen(".concat(n.name,")"):"frozen")||this;return Object.defineProperty(r,"subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ar.Frozen}),r}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<any immutable value>"}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){return Nf(this,n,r,i,a)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return s7(n)?this.subType?this.subType.validate(n,r):js():Ds(r,n,"Value is not serializable and cannot be frozen")}}),e})(Sh),D3=new w7;function RC(t){return arguments.length===0?D3:wc(t)?new w7(t):rh(D3,t)}function MC(t){switch(t){case ja.beforeDestroy:return"destroy";case ja.beforeDetach:return"detach";default:return}}var IC=(function(){function t(e,n){if(Object.defineProperty(this,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:n}),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}),sy(e))this.identifier=e;else if(Di(e)){var r=zn(e);if(!r.identifierAttribute)throw new nn("Can only store references with a defined identifier attribute.");var i=r.unnormalizedIdentifier;if(i==null)throw new nn("Can only store references to tree nodes with a defined identifier.");this.identifier=i}else throw new nn("Can only store references to tree nodes or identifiers, got: '".concat(e,"'"))}return Object.defineProperty(t.prototype,"updateResolvedReference",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n=jp(this.identifier),r=e.root,i=r.identifierCache.getLastCacheModificationPerId(n);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==i){var a=this.targetType,o=r.identifierCache.resolve(a,n);if(!o)throw new jC("[mobx-state-tree] Failed to resolve reference '".concat(this.identifier,"' to type '").concat(this.targetType.name,"' (from node: ").concat(e.path,")"));this.resolvedReference={node:o,lastCacheModification:i}}}}),Object.defineProperty(t.prototype,"resolvedValue",{get:function(){return this.updateResolvedReference(this.node),this.resolvedReference.node.value},enumerable:!1,configurable:!0}),t})(),jC=(function(t){ai(e,t);function e(n){var r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return e})(Error),_7=(function(t){ai(e,t);function e(n,r){var i=t.call(this,"reference(".concat(n.name,")"))||this;return Object.defineProperty(i,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"onInvalidated",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ar.Reference}),i}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this.targetType.isAssignableFrom(n)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return sy(n)?js():Ds(r,n,"Value is not a valid identifier, which is a string or a number")}}),Object.defineProperty(e.prototype,"fireInvalidated",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var o=r.parent;if(!(!o||!o.isAlive)){var s=o.storedValue;s&&this.onInvalidated({cause:n,parent:s,invalidTarget:a?a.storedValue:void 0,invalidId:i,replaceRef:function(u){O3(r.root.storedValue,{op:"replace",value:u,path:r.path})},removeRef:function(){fC(o.type)?this.replaceRef(void 0):O3(r.root.storedValue,{op:"remove",path:r.path})}})}}}),Object.defineProperty(e.prototype,"addTargetNodeWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this,a=this.getValue(n);if(a){var o=zn(a),s=function(f,g){var v=MC(g);v&&i.fireInvalidated(v,n,r,o)},u=o.registerHook(ja.beforeDetach,s),h=o.registerHook(ja.beforeDestroy,s);return function(){u(),h()}}}}),Object.defineProperty(e.prototype,"watchTargetNodeForInvalidations",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i){var a=this;if(this.onInvalidated){var o;n.registerHook(ja.beforeDestroy,function(){o&&o()});var s=function(u){o&&o();var h=n.parent,f=h&&h.storedValue;if(h&&h.isAlive&&f){var g=void 0;i?g=!!i.get(r,f):g=n.root.identifierCache.has(a.targetType,jp(r)),g?o=a.addTargetNodeWatcher(n,r):u||a.fireInvalidated("invalidSnapshotReference",n,r,null)}};n.state===wo.FINALIZED?s(!0):(n.isRoot||n.root.registerHook(ja.afterCreationFinalization,function(){n.parent&&n.parent.createObservableInstanceIfNeeded()}),n.registerHook(ja.afterAttach,function(){s(!1)}))}}}),e})(Sh),DC=(function(t){ai(e,t);function e(n,r){return t.call(this,n,r)||this}return Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(n.isAlive){var r=n.storedValue;return r.resolvedValue}}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=n.storedValue;return r.identifier}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var o=Di(a)?yO(a):a,s=new IC(a,this.targetType),u=Nf(this,n,r,i,s);return s.node=u,this.watchTargetNodeForInvalidations(u,o,void 0),u}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){if(!n.isDetaching&&n.type===this){var o=Di(r),s=n.storedValue;if(!o&&s.identifier===r||o&&s.resolvedValue===r)return n.setParent(i,a),n}var u=this.instantiate(i,a,void 0,r);return n.die(),u}}),e})(_7),FC=(function(t){ai(e,t);function e(n,r,i){var a=t.call(this,n,i)||this;return Object.defineProperty(a,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),a}return Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(n.isAlive){var r=this.options.get(n.storedValue,n.parent?n.parent.storedValue:null);return r}}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.storedValue}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var o=Di(a)?this.options.set(a,n?n.storedValue:null):a,s=Nf(this,n,r,i,o);return this.watchTargetNodeForInvalidations(s,o,this.options),s}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var o=Di(r)?this.options.set(r,n?n.storedValue:null):r;if(!n.isDetaching&&n.type===this&&n.storedValue===o)return n.setParent(i,a),n;var s=this.instantiate(i,a,void 0,o);return n.die(),s}}),e})(_7);function x7(t,e){var n=e||void 0,r=e?e.onInvalidated:void 0;return n&&(n.get||n.set)?new FC(t,{get:n.get,set:n.set},r):new DC(t,r)}function BC(t,e){var n=x7(t,Uu(Uu({},e),{onInvalidated:function(r){e&&e.onInvalidated&&e.onInvalidated(r),r.removeRef()}}));return e&&e.acceptsUndefined===!1?n:b7(n)}var S7=(function(t){ai(e,t);function e(n,r){var i=t.call(this,n)||this;return Object.defineProperty(i,"validType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ar.Identifier}),i}return Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){if(!n||!(n.type instanceof Sp))throw new nn("Identifier types can only be instantiated as direct child of a model type");return Nf(this,n,r,i,a)}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){if(n.storedValue!==r)throw new nn("Tried to change identifier from '".concat(n.storedValue,"' to '").concat(r,"'. Changing identifiers is not allowed."));return n.setParent(i,a),n}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return typeof n!==this.validType?Ds(r,n,"Value is not a valid ".concat(this.describe(),", expected a ").concat(this.validType)):js()}}),e})(Sh),zC=(function(t){ai(e,t);function e(){var n=t.call(this,"identifier","string")||this;return Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ar.Identifier}),n}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),e})(S7),qC=(function(t){ai(e,t);function e(){return t.call(this,"identifierNumber","number")||this}return Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.storedValue}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifierNumber"}}),e})(S7),UC=new zC,HC=new qC;function jp(t){return""+t}function sy(t){return typeof t=="string"||typeof t=="number"}function $C(t){return new GC(t)}var GC=(function(t){ai(e,t);function e(n){var r=t.call(this,n.name)||this;return Object.defineProperty(r,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:ar.Custom}),r}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){if(this.options.isTargetType(n))return js();var i=this.options.getValidationMessage(n);return i?Ds(r,n,"Invalid value for type '".concat(this.name,"': ").concat(i)):js()}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this.options.toSnapshot(n.storedValue)}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var o=this.options.isTargetType(a)?a:this.options.fromSnapshot(a,n&&n.root.environment);return Nf(this,n,r,i,o)}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var o=!this.options.isTargetType(r);if(!n.isDetaching){var s=n.type===this&&(o?r===n.snapshot:r===n.storedValue);if(s)return n.setParent(i,a),n}var u=o?this.options.fromSnapshot(r,i.root.environment):r,h=this.instantiate(i,a,void 0,u);return n.die(),h}}),e})(Sh),Zt={enumeration:wC,model:uC,compose:cC,custom:$C,reference:x7,safeReference:BC,union:W0,optional:rh,literal:y7,maybe:b7,maybeNull:OC,refinement:bC,string:f7,boolean:d7,number:h7,integer:hC,float:dC,finite:pC,Date:m7,map:aC,array:oC,frozen:RC,identifier:UC,identifierNumber:HC,late:LC,lazy:NC,undefined:g7,null:p7,snapshotProcessor:rC};function E7({oldText:t,newText:e,element:n}){if(!(e.length/Math.max(20,t.length)>=4))return n.fontSize;const r=n.width*n.page.computedHeight/e.length,i=1.5*Math.sqrt(r),a=n.fontSize;return Math.min(a,Math.max(5,Math.round(i)))}function F3(t){const{r:e,g:n,b:r}=sn.Util.colorToRGBA(t);return(e*299+n*587+r*114)/1e3}function k7(t){const{outlineSize:e,outlineColor:n}=(function(a){const o=a.strokeWidth||0;return o>0?{outlineSize:o,outlineColor:a.stroke}:{outlineSize:a.shadowEnabled&&a.shadowBlur>0&&a.shadowOpacity>.1?a.shadowBlur*a.shadowOpacity:0,outlineColor:a.shadowColor}})(t);if(e<.001)return t.fill;const r=F3(t.fill),i=F3(n);return Math.abs(r-i)>=50?n:t.fill}let Wf;function WC(){return Wf||(Wf=document.getElementById("polotno-text-style"),Wf||(Wf=document.createElement("style"),Wf.id="polotno-text-style",document.head.appendChild(Wf)),Wf)}sn._fixTextRendering=!0;const B3={border:"none",padding:"0px",overflow:"hidden",background:"none",outline:"none",resize:"none",overflowWrap:"break-word",whiteSpace:"pre-wrap",userSelect:"text",wordBreak:"normal",textTransform:"none"};function VC(t){var e="֑-߿‏‫‮יִ-﷽ﹰ-ﻼ";return new RegExp("^[^"+e+"]*?["+e+"]").test(t)}function YC(t){t=t.replace(/\s/g,"");let e=0;for(var n=0;n<t.length;n++)VC(t[n])&&(e+=1);return e>t.length/2}function V0(t){return YC(t)?"rtl":"ltr"}const XC=ri(({textNodeRef:t,element:e,onBlur:n,selectAll:r,cursorPosition:i})=>{const[a,o]=se.useState(B3),s=t.current;se.useLayoutEffect(()=>{const v={};v.width=s.width()-2*s.padding()+"px",v.height=s.height()-2*s.padding()+s.fontSize()*s.lineHeight()+"px",v.fontSize=s.fontSize()+"px",v.lineHeight=s.lineHeight()+.01,v.fontFamily=s.fontFamily(),v.textAlign=s.align(),v.color=s.fill(),v.fontWeight=e.fontWeight,v.fontStyle=e.fontStyle,v.letterSpacing=e.letterSpacing+"em",v.opacity=Math.max(e.a.opacity,.2),v.textTransform=e.textTransform,v.caretColor=k7(e);const p=`
101
+ .polotno-input::placeholder {
102
+ color: ${a.color};
103
+ opacity: 0.6;
104
+ }
105
+ `,y=WC();y.innerHTML="",y.appendChild(document.createTextNode(p)),JSON.stringify(v)!==JSON.stringify(a)&&o(v)});const u=se.useRef(null);se.useLayoutEffect(()=>{var v;const p=u.current;if(!p)return;(v=u.current)===null||v===void 0||v.focus();const y=i||p.value.length;p.selectionStart=p.selectionEnd=y,r&&(p?.select(),document.execCommand("selectAll",!1,null))},[]),se.useEffect(()=>{window.addEventListener("blur",n);const v=p=>{var y;!((y=u.current)===null||y===void 0)&&y.contains(p.target)||n()};return window.addEventListener("touchstart",v),()=>{window.removeEventListener("blur",n),window.removeEventListener("touchstart",v)}},[]);let h=0;const f=s.textArr.length*s.lineHeight()*s.fontSize();e.verticalAlign==="middle"&&(h=(e.a.height-f)/2),e.verticalAlign==="bottom"&&(h=e.a.height-f);const g=rs(e.text);return se.createElement("textarea",{className:"polotno-input",ref:u,dir:V0(g),style:Object.assign(Object.assign(Object.assign({},B3),a),{paddingTop:h+"px"}),value:g,onChange:v=>{const p=E7({oldText:e.text,newText:v.target.value,element:e});e.set({text:v.target.value,fontSize:p})},placeholder:e.placeholder,onBlur:n})}),KC=t=>se.createElement(y0,null,se.createElement(XC,Object.assign({},t))),A7=(t,e)=>{const[n,r]=se.useReducer(o=>o+1,0),i=se.useRef(E3(e)),a=se.useRef(null);return se.useLayoutEffect(()=>{if(i.current=E3(e),i.current)return;let o=!0;return(async()=>{i.current=!1,r();const s=uh(`text ${e}`);await t.loadFont(e),o?(a.current=s,i.current=!0,r()):s()})(),()=>{a.current&&(a.current(),a.current=null),o=!1}},[e]),se.useEffect(()=>{i.current&&setTimeout(()=>{a.current&&(a.current(),a.current=null)})},[i.current]),[i.current]},P7=({fontLoaded:t,fontFamily:e,fontSize:n,lineHeight:r})=>se.useMemo(()=>{if(typeof r=="number")return r;const i=document.createElement("div");i.style.fontFamily=e,i.style.fontSize=n+"px",i.style.lineHeight=r,i.innerText="Test text",document.body.appendChild(i);const a=i.offsetHeight;return document.body.removeChild(i),a/n},[t,e,n,r]);function O7(t){const e=se.useRef(t),n=se.useRef(t);return se.useMemo(()=>{n.current=e.current,e.current=t},[t]),n.current}function fh(t,e,n,r){const i=Math.max(-.9999,Math.min(.9999,n));if(Math.abs(i)<1e-4)return`M 0 ${e/2} L ${t} ${e/2}`;const a=5*r/(2*Math.abs(i))-r,o=t/2;if(i>0){const s=2*a+r/2;return[`M ${o} ${s}`,`A ${a} ${a} 0 1 1 ${o} ${s-2*a}`,`A ${a} ${a} 0 1 1 ${o} ${s}`].join(" ")}{const s=-(2*a-Math.round(e))-r/2;return[`M ${o} ${s}`,`A ${a} ${a} 0 1 0 ${o} ${s+2*a}`,`A ${a} ${a} 0 1 0 ${o} ${s}`].join(" ")}}const ZC=ri(({element:t,store:e})=>{const n=se.useRef(null),r=se.useRef(null),i=se.useRef(null),{editorEnabled:a,selectAll:o}=(q=>{const[J,ae]=se.useState(!1),ie=se.useRef(!1);return se.useEffect(()=>{var Z=!0;return setTimeout(()=>{Z&&(q._editModeEnabled&&(ie.current=!0),ae(!0),setTimeout(()=>{ie.current=!1},50))},50),()=>{Z=!1}},[]),{editorEnabled:J&&q._editModeEnabled,selectAll:ie.current}})(t),[s,u]=se.useState(!1),h=se.useRef(t.a.height),f=e.selectedShapes.indexOf(t)>=0&&t.selectable,{textVerticalResizeEnabled:g}=Si,v=O7(t.fontFamily),[p,y]=se.useState([]);se.useEffect(()=>{var q,J;const ae=(J=(q=n.current)===null||q===void 0?void 0:q.textArr)!==null&&J!==void 0?J:[];JSON.stringify(ae)!==JSON.stringify(p)&&y(ae)}),se.useEffect(()=>{if(t.a.width)return;const q=n.current;q.width(600),t.set({width:1.4*q.getTextWidth()})},[]),se.useEffect(()=>{f||t.text!==""||!t.removable||t.placeholder||e.deleteElements([t.id])},[f]),se.useLayoutEffect(()=>zu(()=>{const q=n.current;Ms(q,t)}));const[_]=A7(e,t.fontFamily);let x=rs(t.text);t.textTransform==="uppercase"&&(x=x.toUpperCase());const b=()=>{if(t.curveEnabled){const ae=r.current;return ae.getSelfRect().height||ae.fontSize()}const q=n.current.clone({height:void 0}),J=Math.ceil(q.fontSize()*q.lineHeight()*q.textArr.length+1);return q.destroy(),J};se.useLayoutEffect(()=>{if(!_)return;const{textOverflow:q,textSplitAllowed:J}=Si,ae=(ie,...Z)=>{const te=uh(`text ${t.id} before ignore`);e.history.ignore(ie,...Z).then(()=>{te()})};if(!t.a.height){const ie=b();return void ae(()=>{t.set({height:ie})})}if(!e.isPlaying)if(q!=="change-font-size"||s){if(q==="resize"){const ie=b();g&&t.a.height<ie&&!s&&ae(()=>{var Z;C3(t)&&t.set({height:ie}),(Z=n.current)===null||Z===void 0||Z.height(ie)},!1,!0),g||t.a.height===ie||s||ae(()=>{var Z;C3(t)&&t.set({height:ie}),(Z=n.current)===null||Z===void 0||Z.height(ie)},!1,!0)}}else{const ie=(function(te,V,B=!1){const D=te.fontSize(),U=te.height(),X=rs(V.text);let ee=V.a.fontSize;te.height(void 0);const K=Math.round(2*V.a.fontSize)-1;for(let oe=1;oe<K;oe++){const me=V.a.height&&te.height()>V.a.height;let de=X.split(`
106
+ `).join(" ").split(/[\s-]+/).reduce((Oe,Me)=>(Me=Me.toLowerCase(),/[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF\uAC00-\uD7AF]/.test(Me)?Oe.concat(Me.split("")):Oe.concat(Me)),[]),ye=te.textArr.map(Oe=>Oe.text.toLowerCase()).join(";");const Re=de.find(Oe=>!ye.includes(Oe)||(ye=ye.replace(Oe,""),!1));if(!(me||Re&&!B))break;ee-=.5,te.fontSize(ee)}return te.fontSize(D),te.height(U),ee})(n.current,t,J);if(ie!==t.a.fontSize)return void ae(()=>{t.set({fontSize:ie})},!1,!0);const Z=b();t.a.height===Z||g||ae(()=>{t.set({height:Z})},!1,!0)}}),se.useLayoutEffect(()=>{var q;if(_&&t.curveEnabled){const J=(q=r.current)===null||q===void 0?void 0:q.getSelfRect().width;if(J){const ae=J-t.a.width,ie=t.a.rotation*Math.PI/180,Z=-ae/2*Math.cos(ie),te=-ae/2*Math.sin(ie);t.set({width:J,x:t.a.x+Z,y:t.a.y+te})}}},[_,t.curveEnabled,t.curvePower,t.text,t.fontSize,t.fontFamily,t.fontWeight,t.fontStyle,t.letterSpacing]),se.useLayoutEffect(()=>{const q=n.current;q&&(q.width(q.width()+1e-8),q.width(q.width()-1e-8),q._setTextData(),Ms(q,t))},[_]);const E=se.useRef(null),A=se.useRef(0),S=q=>{q.evt.preventDefault(),e.selectedShapes.find(ae=>ae===t)&&t.contentEditable&&(A.current=(function(ae){var ie;const Z=ae.target,te=(function(ee){var K=ee.getAbsoluteTransform().copy();K.invert();var oe=ee.getStage().getPointerPosition();return K.point(oe)})(Z),V=Z.textArr,B=Math.floor(te.y/(Z.fontSize()*Z.lineHeight())),D=V.slice(0,B).reduce((ee,K)=>ee+K.text.length,B),U=(ie=V[B])!==null&&ie!==void 0?ie:V[0];let X=0;return Z.align()==="right"?X=Z.width()-U.width:Z.align()==="center"&&(X=Z.width()/2-U.width/2),D+Math.round((te.x-X)/U.width*U.text.length)})(q),t.toggleEditMode())},k=!x&&t.placeholder?.6:t.a.opacity;Mp(n,k);const I=P7({fontLoaded:_,fontFamily:t.fontFamily,fontSize:t.a.fontSize,lineHeight:t.lineHeight}),O=t.selectable||e.role==="admin",M=wf(t),F=se.useMemo(()=>t.backgroundEnabled?(function({lines:q,lineHeight:J,width:ae,align:ie="left",padding:Z=0,cornerRadius:te=0}){var V;q.forEach((X,ee)=>{X.cx=ae/2,ie==="right"?X.cx=ae-X.width/2:ie==="left"&&(X.cx=X.width/2),ie!=="justify"||X.lastInParagraph||(X.width=ae),ie==="justify"&&(X.cx=X.width/2)});let B=`M ${(V=q[0])===null||V===void 0?void 0:V.cx} ${-Z}`;q.forEach((X,ee)=>{const{cx:K}=X,oe=q[ee-1];oe&&oe.width>X.width?B+=` L ${K+X.width/2+Z} ${ee*J+Z}`:B+=` L ${K+X.width/2+Z} ${ee*J-Z}`;const me=q[ee+1];me&&me.width>X.width?B+=` L ${K+X.width/2+Z} ${(ee+1)*J-Z}`:B+=` L ${K+X.width/2+Z} ${(ee+1)*J+Z}`});for(var D=q.length-1;D>=0;D--){const X=q[D],{cx:ee}=X,K=q[D+1];K&&K.width>X.width?B+=` L ${ee-X.width/2-Z} ${(D+1)*J-Z}`:B+=` L ${ee-X.width/2-Z} ${(D+1)*J+Z}`;const oe=q[D-1];oe&&oe.width>X.width?B+=` L ${ee-X.width/2-Z} ${D*J+Z}`:B+=` L ${ee-X.width/2-Z} ${D*J-Z}`}B+=" Z";const U=$P(B);return GP(U,te).path})({lines:JSON.parse(JSON.stringify(p)),cornerRadius:t.backgroundCornerRadius*(t.a.fontSize*I*.5),lineHeight:I*t.a.fontSize,padding:t.backgroundPadding*(t.a.fontSize*I*.5),width:t.a.width,align:t.align}):"",[t.backgroundEnabled,t.backgroundCornerRadius,t.a.fontSize,I,t.backgroundPadding,t.a.width,t.align,p]),j=Lf();let T=0;t.verticalAlign==="middle"?T=(t.a.height-p.length*I*t.a.fontSize)/2:t.verticalAlign==="bottom"&&(T=t.a.height-p.length*I*t.a.fontSize);const L=t.curveEnabled?fh(t.a.width,t.a.height,t.curvePower,t.a.fontSize):"",$=_?'"'+t.fontFamily+'"':v===t.fontFamily?"Arial":'"'+v+'"';return se.createElement(se.Fragment,null,se.createElement(yp,{ref:i,x:t.a.x,y:t.a.y,rotation:t.a.rotation,hideInExport:!t.showInExport,listening:!1,visible:t.backgroundEnabled,opacity:t.backgroundOpacity*k,data:F,fill:t.backgroundColor,offsetY:-T}),se.createElement(yp,{data:L,stroke:"red",strokeWidth:1,x:t.a.x,y:t.a.y,rotation:t.a.rotation,visible:!1}),se.createElement(LP,Object.assign({ref:r,visible:t.curveEnabled,data:L,text:x||t.placeholder,listening:!1,align:"center",textBaseline:"middle"},M,{stroke:t.stroke,strokeWidth:t.strokeWidth,lineJoin:"round",fillAfterStrokeEnabled:!0,fontSize:t.a.fontSize,fontFamily:`"${t.fontFamily}", "${v}"`,fontStyle:t.fontStyle+" "+t.fontWeight,letterSpacing:t.letterSpacing*t.a.fontSize,x:t.a.x,y:t.a.y,rotation:t.a.rotation,opacity:t._editModeEnabled?.3:k,hideInExport:!t.showInExport,shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur,shadowOffsetX:t.shadowOffsetX,shadowOffsetY:t.shadowOffsetY,shadowColor:t.shadowColor,shadowOpacity:t.shadowOpacity})),se.createElement(Fu,Object.assign({ref:n,id:t.id,name:"element",hideInExport:!t.showInExport,editModeEnabled:t._editModeEnabled,x:t.a.x,y:t.a.y,rotation:t.a.rotation,width:t.a.width,height:t.a.height,text:x||t.placeholder,direction:V0(x)},M,{stroke:t.stroke,lineJoin:"round",strokeWidth:t.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:t.a.fontSize,fontFamily:$,fontStyle:t.fontStyle+" "+t.fontWeight,textDecoration:t.textDecoration,align:t.align,verticalAlign:t.verticalAlign,draggable:j?t.draggable&&f:t.draggable,preventDefault:!j||f,opacity:t.curveEnabled?0:k,visible:!t._editModeEnabled,ellipsis:Si.textOverflow==="ellipsis",shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur,shadowOffsetX:t.shadowOffsetX,shadowOffsetY:t.shadowOffsetY,shadowColor:t.shadowColor,shadowOpacity:t.shadowOpacity,lineHeight:I,letterSpacing:t.letterSpacing*t.a.fontSize,listening:O,onDragMove:q=>{t.set({x:q.target.x(),y:q.target.y()})},onDragEnd:q=>{t.set({x:q.target.x(),y:q.target.y()})},onClick:S,onTap:S,onTransformStart:()=>{u(!0),h.current=n.current.height()},onTransform:q=>{var J,ae,ie;const Z=q.target;(J=i.current)===null||J===void 0||J.setAttrs({x:Z.x(),y:Z.y(),rotation:Z.rotation(),scale:Z.scale()});const te=((ae=Z.getStage())===null||ae===void 0?void 0:ae.findOne("Transformer")).getActiveAnchor();if(te==="middle-left"||te==="middle-right"){const B=Z.scaleX(),D=Z.width()*B,U=t.a.fontSize;let X=D;D<U&&(X=U,E.current&&Z.position(E.current)),Z.width(X),Z.scaleX(1),Z.scaleY(1);const ee=b();if(Si.textOverflow!=="ellipsis"){const oe=Math.max(ee,h.current);Z.height(oe),t.set({height:Z.height()})}const K=Si.textVerticalResizeEnabled?Math.max(ee,h.current):b();t.set({x:Z.x(),width:Z.width(),rotation:Z.rotation(),height:K}),Ms(Z,t)}if(te==="top-center"||te==="bottom-center"){let B=Si.textOverflow==="resize"?b():I*t.a.fontSize;q.target.height(Math.max(B,q.target.height()*q.target.scaleY())),q.target.scaleY(1)}E.current=q.target.position();const V=q.target.scaleX();(ie=i.current)===null||ie===void 0||ie.setAttrs({scaleX:1,scaleY:1}),q.target.scaleX(1),q.target.scaleY(1),t.set({fontSize:t.a.fontSize*V,width:q.target.width()*V,x:q.target.x(),y:q.target.y(),rotation:q.target.rotation(),height:q.target.height()*V,shadowBlur:t.shadowBlur*V,shadowOffsetX:t.shadowOffsetX*V,shadowOffsetY:t.shadowOffsetY*V,strokeWidth:t.strokeWidth*V})},onTransformEnd:q=>{var J;const ae=q.target.scaleX();q.target.scaleX(1),q.target.scaleY(1),t.set({fontSize:Math.round(t.a.fontSize*ae),width:Math.ceil(q.target.width()*ae),x:q.target.x(),y:q.target.y(),rotation:q.target.rotation(),height:q.target.height()*ae,shadowBlur:t.shadowBlur*ae,shadowOffsetX:t.shadowOffsetX*ae,shadowOffsetY:t.shadowOffsetY*ae,strokeWidth:t.strokeWidth*ae}),(J=i.current)===null||J===void 0||J.setAttrs({scaleX:1,scaleY:1}),u(!1)}})),a&&se.createElement(br,{x:t.a.x,y:t.a.y,rotation:t.a.rotation},se.createElement(KC,{textNodeRef:n,element:t,selectAll:o,cursorPosition:A.current,onBlur:()=>{t.toggleEditMode(!1)}})))});var i2={exports:{}},a2={exports:{}},z3;function ly(){return z3||(z3=1,(function(t,e){t.exports=n;function n(i){return r.bind(null,i)}function r(i){var a=[].slice.call(arguments,1);a.unshift("["+i+"]"),process.stderr.write(a.join(" ")+`
107
+ `)}})(a2)),a2.exports}var q3;function C7(){return q3||(q3=1,(function(t,e){ly()("lex"),t.exports=n;function n(r){var i="",a,o=0,s=-1,u=0,h=1,f="before-selector",g=[f],v={},p=[],y=["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 _(){return M(),r[s]}function x(ie){return ie?g[g.length-1-ie]:f}function b(ie){var Z=s+1;return ie===r.slice(Z,Z+ie.length)}function E(ie){var Z=r.slice(s).indexOf(ie);return Z>0?Z:!1}function A(ie){return ie===S(1)}function S(ie){return r[s+(ie||1)]}function k(){var ie=g.pop();return f=g[g.length-1],ie}function I(ie){return f=ie,g.push(f),g.length}function O(ie){var Z=f;return g[g.length-1]=f=ie,Z}function M(ie){if((ie||1)==1)r[s]==`
108
+ `?(h++,o=1):o++,s++;else{var Z=r.slice(s,s+ie).split(`
109
+ `);Z.length>1&&(h+=Z.length-1,o=1),o+=Z[Z.length-1].length,s=s+ie}}function F(){v.end={line:h,col:o},p.push(v),i="",v={}}function j(ie){v={type:ie,start:{line:h,col:o}}}for(;a=_();)switch(a){case" ":switch(x()){case"selector":case"value":case"value-paren":case"at-group":case"at-value":case"comment":case"double-string":case"single-string":i+=a;break}break;case`
110
+ `:case" ":case"\r":case"\f":switch(x()){case"value":case"value-paren":case"at-group":case"comment":case"single-string":case"double-string":case"selector":i+=a;break;case"at-value":a===`
111
+ `&&(v.value=i.trim(),F(),k());break}break;case":":switch(x()){case"name":v.name=i.trim(),i="",O("before-value");break;case"before-selector":i+=a,j("selector"),I("selector");break;case"before-value":O("value"),i+=a;break;default:i+=a;break}break;case";":switch(x()){case"name":case"before-value":case"value":i.trim().length>0&&(v.value=i.trim(),F()),O("before-name");break;case"value-paren":i+=a;break;case"at-value":v.value=i.trim(),F(),k();break;case"before-name":break;default:i+=a;break}break;case"{":switch(x()){case"selector":if(S(-1)==="\\"){i+=a;break}v.text=i.trim(),F(),O("before-name"),u=u+1;break;case"at-group":switch(v.name=i.trim(),v.type){case"font-face":case"viewport":case"page":I("before-name");break;default:I("before-selector")}F(),u=u+1;break;case"name":case"at-rule":v.name=i.trim(),F(),I("before-name"),u=u+1;break;case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":O("value"),i+=a;break}break;case"}":switch(x()){case"before-name":case"name":case"before-value":case"value":i&&(v.value=i.trim()),v.name&&v.value&&F(),j("end"),F(),k(),x()==="at-group"&&(j("at-group-end"),F(),k()),u>0&&(u=u-1);break;case"at-group":case"before-selector":case"selector":if(S(-1)==="\\"){i+=a;break}u>0&&x(1)==="at-group"&&(j("at-group-end"),F()),u>1&&k(),u>0&&(u=u-1);break;case"double-string":case"single-string":case"comment":i+=a;break}break;case'"':case"'":switch(x()){case"double-string":a==='"'&&S(-1)!=="\\"&&k();break;case"single-string":a==="'"&&S(-1)!=="\\"&&k();break;case"before-at-value":O("at-value"),I(a==='"'?"double-string":"single-string");break;case"before-value":O("value"),I(a==='"'?"double-string":"single-string");break;case"comment":break;default:S(-1)!=="\\"&&I(a==='"'?"double-string":"single-string")}i+=a;break;case"/":switch(x()){case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":case"selector":case"name":case"value":if(A("*")){var T=E("*/");T&&M(T+1)}else x()=="before-value"&&O("value"),i+=a;break;default:A("*")?(j("comment"),I("comment"),M()):i+=a;break}break;case"*":switch(x()){case"comment":A("/")?(v.text=i,M(),F(),k()):i+=a;break;case"before-selector":i+=a,j("selector"),I("selector");break;case"before-value":O("value"),i+=a;break;default:i+=a}break;case"@":switch(x()){case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":O("value"),i+=a;break;default:for(var L=!1,$,q,J=0,ae=y.length;!L&&J<ae;++J)q=y[J],$=q.name||q,b($)&&(L=!0,j($),I(q.state||"at-group"),M($.length),q.prefix&&(v.prefix=q.prefix),q.type&&(v.type=q.type));L||(i+=a);break}break;case"(":switch(x()){case"value":I("value-paren");break;case"before-value":O("value");break}i+=a;break;case")":switch(x()){case"value-paren":k();break;case"before-value":O("value");break}i+=a;break;default:switch(x()){case"before-selector":j("selector"),I("selector");break;case"before-name":j("property"),O("name");break;case"before-value":O("value");break;case"before-at-value":O("at-value");break}i+=a;break}return p}})(i2)),i2.exports}var o2={exports:{}},U3;function QC(){return U3||(U3=1,(function(t,e){ly()("parse");var n=C7();t.exports=s;var r,i,a,o;function s(k,I){I||(I={}),r=!!I.comments,a=!!I.position,i=0,o=Array.isArray(k)?k.slice():n(k);for(var O,M=[],F;F=h();)O=b(F),O&&M.push(O);return{type:"stylesheet",stylesheet:{rules:M}}}function u(k,I){I||(I={});for(var O,M=["type","name","value"],F={},j=0;j<M.length;++j)O=M[j],k[O]&&(F[O]=I[O]||k[O]);for(M=Object.keys(I),j=0;j<M.length;++j)O=M[j],F[O]||(F[O]=I[O]);return a&&(F.position={start:k.start,end:k.end}),F}function h(){var k=o.shift();return k}function f(k){i=i+1;var I={};switch(k.type){case"font-face":case"viewport":I.declarations=A();break;case"page":I.prefix=k.prefix,I.declarations=A();break;default:I.prefix=k.prefix,I.rules=S()}return u(k,I)}function g(k){return u(k)}function v(k){return u(k)}function p(k){return u(k,{text:k.text})}function y(k){return u(k)}function _(k){return u(k)}function x(k){function I(O){return O.trim()}return u(k,{type:"rule",selectors:k.text.split(",").map(I),declarations:A()})}function b(k){switch(k.type){case"property":return _(k);case"selector":return x(k);case"at-group-end":i=i-1;return;case"media":case"keyframes":return f(k);case"comment":if(r)return p(k);break;case"charset":return v(k);case"import":return g(k);case"namespace":return y(k);case"font-face":case"supports":case"viewport":case"document":case"page":return f(k)}}function E(k){for(var I,O=[],M;(M=h())&&k&&k(M);)I=b(M),I&&O.push(I);return M&&M.type!=="end"&&o.unshift(M),O}function A(){return E(function(k){return k.type==="property"||k.type==="comment"})}function S(){return E(function(){return i})}})(o2)),o2.exports}var s2={exports:{}},H3;function JC(){return H3||(H3=1,(function(t,e){ly()("stringify");var n,r,i,a,o,s;t.exports=u;function u(S,k){k||(k={}),i=k.indentation||"",r=!!k.compress,n=!!k.comments,a=1,r?o=s="":(o=`
112
+ `,s=" ");var I=y(S.stylesheet.rules,E).join(`
113
+ `).trim();return I}function h(S){if(S){a+=S;return}return r?"":Array(a).join(i||"")}function f(S){return"@"+S.type+" "+S.value+";"+o}function g(S){var k="",I=S.prefix||"";S.name&&(k=" "+S.name);var O=S.type!=="page";return"@"+I+S.type+k+s+_(S,O)+o}function v(S){return n?"/*"+(S.text||"")+"*/"+o:""}function p(S){var k;return S.selectors?k=S.selectors.join(","+o):(k="@"+S.type,k+=S.name?" "+S.name:""),h()+k+s+_(S)+o}function y(S,k){return S.reduce(function(I,O){var M=O.type==="comment"?v(O):k(O);return M&&I.push(M),I},[])}function _(S,k){var I=S.declarations,O=b;return S.rules&&(I=S.rules,O=p),I=x(I,O),I&&(I=o+I+(k?"":o)),"{"+I+h()+"}"}function x(S,k){if(!S)return"";h(1);var I=y(S,k);return h(-1),I.length?I.join(o):""}function b(S){if(S.type==="property")return A(S)}function E(S){switch(S.type){case"rule":return p(S);case"media":case"keyframes":return g(S);case"comment":return v(S);case"import":case"charset":case"namespace":return f(S);case"font-face":case"supports":case"viewport":case"document":case"page":return g(S)}}function A(S){var k=S.name?S.name+":"+s:"";return h()+k+S.value+";"}})(s2)),s2.exports}var l2,$3;function eL(){return $3||($3=1,l2={lex:C7(),parse:QC(),stringify:JC()}),l2}var tL=eL();const nL=ph(tL);function rL(t){for(;t.parentNode;){if(t.nodeName==="defs")return!0;t=t.parentNode}return!1}function iL(t){const e={};return t.querySelectorAll("style").forEach(n=>{const r=nL.parse(n.textContent).stylesheet.rules;for(let i of r)i.selectors&&i.selectors.forEach(a=>{const o=e[a]||{};i.declarations.forEach(s=>{o[s.name]=s.value}),e[a]=o})}),e}function L7(t,e){var n;const r={fill:"",stroke:""},i=((n=t.getAttribute("class"))===null||n===void 0?void 0:n.split(" "))||[],a=t.getAttribute("id");let o={};if(a&&e[`#${a}`]?o=e[`#${a}`]:i.forEach(s=>{e[`.${s}`]&&(o=Object.assign(Object.assign({},o),e[`.${s}`]))}),e[t.nodeName]&&(o=Object.assign(Object.assign({},o),e[t.nodeName])),t.getAttribute("fill")&&t.getAttribute("fill")!=="none"?r.fill=t.getAttribute("fill"):o.fill&&o.fill!=="none"&&(r.fill=o.fill),t.getAttribute("stroke")&&t.getAttribute("stroke")!=="none"?r.stroke=t.getAttribute("stroke"):o.stroke&&o.stroke!=="none"&&(r.stroke=o.stroke),!r.fill&&t.style.fill&&t.style.fill!=="none"&&(r.fill=t.style.fill),!r.stroke&&t.style.stroke&&t.style.stroke!=="none"&&(r.stroke=t.style.stroke),!r.stroke&&!r.fill){const s=t.ownerSVGElement,u=s&&s!==t&&L7(s,e);u?.fill==="currentColor"||u?.stroke==="currentColor"||(r.fill="black")}return r}const aL=["path","rect","circle","line","polygon","polyline","ellipse","text"];function oL(t){for(var e=[],n=t.getElementsByTagName("*"),r=0,i=n.length;r<i;r++){const a=n[r];rL(a)||(a.getAttribute("fill")!==null&&e.push(a),(a.getAttribute("stroke")!==null||a.style&&a.style.fill||aL.indexOf(a.nodeName)>=0)&&e.push(a))}return e}async function G3(t){const e=await fetch(t);return Eh(await e.text())}async function Dp(t){return await(await fetch(t,{mode:"cors"})).text()}function Eh(t){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(t)))}function uy(t){var e=new DOMParser().parseFromString(t,"image/svg+xml");const n=e.documentElement.getAttribute("viewBox"),[r,i,a,o]=n?.split(" ")||[],s=e.documentElement.getAttribute("width");!s&&e.documentElement.setAttribute("width",a+"px");const u=e.documentElement.getAttribute("height");if((!u||u.indexOf("%")>=0)&&e.documentElement.setAttribute("height",o+"px"),s&&s.indexOf("%")>=0&&u&&u.indexOf("%")===-1){const h=parseFloat(u)/parseFloat(o);e.documentElement.setAttribute("width",h*parseFloat(a)+"px")}if(u&&u.indexOf("%")>=0&&s&&s.indexOf("%")===-1){const h=parseFloat(s)/parseFloat(a);e.documentElement.setAttribute("height",h*parseFloat(o)+"px")}return s==="100%"&&u==="100%"&&(e.documentElement.setAttribute("width",a+"px"),e.documentElement.setAttribute("height",o+"px")),new XMLSerializer().serializeToString(e)}const sL=(t,e)=>{if(!t||!e)return!1;if(e==="currentColor"&&t==="black")return!0;const n=sn.Util.colorToRGBA(t),r=sn.Util.colorToRGBA(e);return n&&r?n.r===r.r&&n.g===r.g&&n.b===r.b&&n.a===r.a:void 0};function cy(t,e){var n=new DOMParser().parseFromString(t,"image/svg+xml");const r=oL(n),i=Array.from(e.keys()),a=iL(n);return r.forEach(o=>{const{fill:s,stroke:u}=L7(o,a);[{prop:"fill",color:s},{prop:"stroke",color:u}].forEach(({prop:h,color:f})=>{const g=i.find(v=>sL(v,f));if(g){const v=e.get(g);if(H0(v)){const{rotation:p,stops:y}=B8(v),_=y.map(b=>({offset:100*b.offset+"%","stop-color":b.color})),x="color"+Math.round(1e8*Math.random());(function(b,E,A,S){var k=b.namespaceURI,I=document.createElementNS(k,"linearGradient");const O=sn.Util.degToRad(A+90),M=(Math.cos(O)+1)/2,F=(Math.sin(O)+1)/2,j=(Math.cos(O+Math.PI)+1)/2,T=(Math.sin(O+Math.PI)+1)/2;I.setAttribute("x1",100*M+"%"),I.setAttribute("y1",100*F+"%"),I.setAttribute("x2",100*j+"%"),I.setAttribute("y2",100*T+"%"),I.setAttribute("gradientUnits","userSpaceOnUse"),I.setAttribute("id",E);for(var L=0;L<S.length;L++){var $=S[L],q=document.createElementNS(k,"stop");for(var J in $)$.hasOwnProperty(J)&&q.setAttribute(J,$[J]);I.appendChild(q)}(b.querySelector("defs")||b.insertBefore(document.createElementNS(k,"defs"),b.firstChild)).appendChild(I)})(n.children[0],x,p,_),o.style[h]=null,o.setAttribute(h,`url('#${x}')`)}else o.style[h]=e.get(g)}})}),Eh(new XMLSerializer().serializeToString(n))}const fy=(t,e,n)=>{let r=e,i=n,a=1;for(;r>0&&i>0;){t.width=r,t.height=i;const o=t.getContext("2d");if(!o)return;if(o.fillStyle="rgba(0,0,0,0.1)",o.fillRect(0,0,1,1),o.getImageData(0,0,1,1).data[3]!==0)return void o.clearRect(0,0,t.width,t.height);if(a*=.9,r=Math.floor(e*a),i=Math.floor(n*a),r=Math.max(r,1),i=Math.max(i,1),r<=1&&i<=1)return t.width=1,void(t.height=1)}},bm=(t,e=100,n=!1,r)=>{const i=se.useRef(r??t),[,a]=se.useReducer(u=>u+1,0),o=se.useCallback(u=>{i.current!==u&&(i.current=u,a())},[i]),s=se.useRef(null);return t===n&&(s.current&&(clearTimeout(s.current),s.current=null),i.current=n),se.useEffect(()=>(s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{o(t),s.current=null},e),()=>{s.current&&clearTimeout(s.current)}),[t,e,n]),[i.current,o]};function Jf(){return document.createElement("canvas")}const N7=t=>t.indexOf("data:image/svg+xml")>=0||t.indexOf(".svg")>=0,W3=t=>{const[e,n]=se.useState(t);return se.useEffect(()=>{(async()=>{const r=await(async function(i){if(!N7(i))return i;const a=await Dp(i),o=uy(a);return Eh(o)})(t);r!==e&&n(r)})()},[t]),e};function V3(t,e){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}const lL={boundBoxFunc:(t,e)=>e.width<5||e.height<5?t:e,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2},uL={boundBoxFunc:(t,e)=>e.width<5||e.height<5?t:e,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2},Y3=(t,e,n)=>Math.max(e,Math.min(n,t)),cL=(t,e,n,r,i=0,a=!1,o=!0)=>{const s=Math.floor(Y3(t.a.width*r,1,1e4)),u=Math.floor(Y3(t.a.height*r,1,1e4)),h=Math.min(i*r,s/2,u/2),f=Math.max(t.a.width/n.width,t.a.height/n.height)*r,g=t.page._exportingOrRendering&&Si.imageDownScalingEnabled&&f<1&&!a,v=n.x===0&&n.y===0&&n.width===e?.width&&n.height===e?.height,p=se.useMemo(()=>{if(e&&e.width&&e.height)return v&&h===0&&!g?void 0:Jf()},[e,h,g,v]);return se.useLayoutEffect(()=>{if(!p||!e)return;fy(p,s,u);const y=p.getContext("2d");if(!y)return;h&&(y.beginPath(),y.moveTo(h,0),y.lineTo(s-h,0),y.arc(s-h,h,h,3*Math.PI/2,0,!1),y.lineTo(s,u-h),y.arc(s-h,u-h,h,0,Math.PI/2,!1),y.lineTo(h,u),y.arc(h,u-h,h,Math.PI/2,Math.PI,!1),y.lineTo(0,h),y.arc(h,h,h,Math.PI,3*Math.PI/2,!1),y.clip());const _=g?(function(b,E){var A,S;const k=Jf();k.width=b.width,k.height=b.height;const I=Math.max(1,Math.floor(k.width*E)),O=Math.max(1,Math.floor(k.height*E));(A=k.getContext("2d"))===null||A===void 0||A.drawImage(b,0,0,k.width,k.height);const M=(function(F,j,T,L,$,q,J){for(var ae=new ImageData(j,T),ie=new Int32Array(F.data.buffer),Z=F.width,te=new Int32Array(ae.data.buffer),V=ae.width,B=j/q,D=T/J,U=Math.round(1/B),X=Math.round(1/D),ee=U*X,K=0;K<ae.height;K++)for(var oe=0;oe<V;oe++){for(var me=0+Math.round(oe/B)+(0+Math.round(K/D))*Z,de=0,ye=0,Re=0,Oe=0,Me=0;Me<X;Me++)for(var Ee=0;Ee<U;Ee++){var ge=ie[me+Ee+Me*Z];de+=ge<<24>>>24,ye+=ge<<16>>>24,Re+=ge<<8>>>24,Oe+=ge>>>24}de=Math.round(de/ee),ye=Math.round(ye/ee),Re=Math.round(Re/ee),Oe=Math.round(Oe/ee),te[oe+K*V]=Oe<<24|Re<<16|ye<<8|de}return ae})(k.getContext("2d").getImageData(0,0,k.width,k.height),I,O,0,0,k.width,k.height);return k.width=I,k.height=O,(S=k.getContext("2d"))===null||S===void 0||S.putImageData(M,0,0),k})(e,f):e,x=g?{x:Math.floor(n.x*f),y:Math.floor(n.y*f),width:Math.floor(n.width*f),height:Math.floor(n.height*f)}:n;y.drawImage(_,x.x,x.y,x.width,x.height,0,0,p.width,p.height)},[p,t.a.width,t.a.height,n.x,n.y,n.width,n.height,i,r,a,t.page._exportingOrRendering,g]),se.useEffect(()=>()=>{p&&p.nodeName==="CANVAS"&&sn.Util.releaseCanvas(p)},[p]),p||e},fL=Jf(),hL=ri(({element:t})=>{const e=Math.min(30,t.a.width/4,t.a.height/4),n=se.useRef(null);return se.useEffect(()=>{const r=n.current;if(!r)return;const i=new sn.Animation(a=>{r.rotate((a?.timeDiff||0)/2)},r.getLayer());return i.start(),()=>{i.stop()}}),se.createElement(br,{x:t.x,y:t.y,rotation:t.rotation,listening:!1,opacity:t.a.opacity,hideInExport:!t.showInExport},se.createElement(Tr,{width:t.a.width,height:t.a.height,fill:"rgba(124, 173, 212, 0.8)"}),se.createElement(ty,{ref:n,x:t.a.width/2,y:t.a.height/2,fill:"white",outerRadius:Math.abs(e),innerRadius:Math.max(1,e-5),angle:270}))}),dL=ri(({element:t})=>{const e=Math.max(10,Math.min(30,t.a.width/25));return se.createElement(br,{x:t.x,y:t.y,rotation:t.rotation,listening:!1,opacity:t.a.opacity,hideInExport:!t.showInExport},se.createElement(Tr,{width:t.a.width,height:t.a.height,fill:"rgba(223, 102, 102, 0.8)"}),se.createElement(Fu,{text:"Can not load the image...",fontSize:e,width:t.a.width,height:t.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let u2=ny;const up=(t,e="",n="")=>{const r=se.useRef(),i=()=>{var a;(a=r.current)===null||a===void 0||a.call(r),r.current=void 0};se.useEffect(()=>i,[]),se.useLayoutEffect(()=>{const a=e.slice(0,200),o=`image with id ${n} url: ${a}`;t!=="loading"||r.current||(r.current=uh(o)),t!=="loading"&&i(),t==="failed"&&Ip(o)},[t])},X3=ri(({element:t,store:e})=>{var n;const[r,i]=se.useState(!1),a=se.useRef(null),o=se.useRef(null),s=e.selectedShapes.indexOf(t)>=0&&t.selectable,[u,h]=(Te=>{const[Be,Ce]=se.useReducer(Ae=>Ae+1,0),fe=se.useRef("loading"),Le=se.useRef(Te.src),Ne=se.useRef(Te.src);Ne.current!==Te.src&&(Ne.current=Te.src,fe.current="loading");const ue=se.useMemo(()=>N7(Te.src)||Te.type==="svg",[Te.src,Te.type]);return se.useEffect(()=>{if(!ue||!Te.src)return;let Ae=!1;return(async()=>{fe.current="loading",Ce();const Pe=await Dp(Te.src),Ue=uy(Pe);let st;st=Te.colorsReplace?cy(Ue,Te.colorsReplace||new Map):Eh(Ue),Ae||(Le.current=st,fe.current="loaded",Ce())})(),()=>{Ae=!0}},[Te.src,JSON.stringify(Te.colorsReplace)]),ue?[Le.current,fe.current]:[Te.src,"loaded"]})(t),[f,g]=u2(u,"anonymous"),v=t.type!=="svg"||h==="loaded"?g:"loading";up(v,t.src,t.id);const p=t.page._exportingOrRendering?1:Math.max(1,e.scale),y=e._elementsPixelRatio*p,_=(({image:Te,status:Be,type:Ce})=>{const fe=se.useRef();return se.useEffect(()=>{fe.current=Te||fe.current},[Te]),Be!=="failed"||Be!=="failed"&&Ce==="svg"?fe.current:void 0})({image:f,status:g,type:t.type}),x=((Te,Be,Ce)=>{const fe=se.useMemo(()=>{var Le,Ne;const{flipX:ue,flipY:Ae}=Te,Pe=Te.type==="svg"||Te.src.indexOf("data:image/svg+xml")>=0||Te.src.indexOf(".svg")>=0,Ue=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,st=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||Ue)&&Pe||Te.maskSrc;if(!ue&&!Ae&&!st)return Be;if(!Be||!Be.width||!Be.height)return null;const dt=Jf();let pt=1;Te.type==="svg"&&(pt=Math.max(Te.a.width/Be.width*Ce,Te.a.height/Be.height*Ce)),fy(dt,Math.max(Be.width*pt,1),Math.max(Be.height*pt,1));let xt=ue?-dt.width:0,bt=Ae?-dt.height:0;return(Le=dt.getContext("2d"))===null||Le===void 0||Le.scale(ue?-1:1,Ae?-1:1),(Ne=dt.getContext("2d"))===null||Ne===void 0||Ne.drawImage(Be,xt,bt,dt.width,dt.height),dt},[Te.maskSrc,Te.flipX,Te.flipY,Be,Te.a.width,Te.a.height,Ce]);return se.useEffect(()=>()=>{fe&&fe.nodeName==="CANVAS"&&sn.Util.releaseCanvas(fe)},[fe]),fe})(t,f||_,y),b=((Te,Be)=>{const Ce=W3(Te.maskSrc||""),[fe,Le]=u2(Ce,"anonymous");return up(Ce?Le:"loaded",Ce||"",Te.id),se.useMemo(()=>{if(!fe||!Be||!Be.width||!Be.height)return Be;const Ne=Jf();Ne.width=Math.max(Be.width,1),Ne.height=Math.max(Be.height,1);const ue=Ne.getContext("2d");if(!ue)return Be;ue.drawImage(Be,0,0),ue.globalCompositeOperation="source-in";const Ae=(function(Pe,Ue){const st=Ue.width/Ue.height;let dt,pt;return st>=Pe.width/Pe.height?(dt=Pe.width,pt=Pe.width/st):(dt=Pe.height*st,pt=Pe.height),{x:(Pe.width-dt)/2,y:(Pe.height-pt)/2,width:dt,height:pt}})(fe,Te);return ue.drawImage(fe,Ae.x,Ae.y,Ae.width,Ae.height,0,0,Be.width,Be.height),Ne},[Be,fe,Te.a.width,Te.a.height])})(t,x)||fL;let{cropX:E,cropY:A,cropWidth:S,cropHeight:k}=t.a;g!=="loaded"&&(E=A=0,S=k=1);const I=b.width*S,O=b.height*k,M=t.a.width/t.a.height;let F,j;const T=I/O,L=t.stretchEnabled;L?(F=I,j=O):M>=T?(F=I,j=I/M):(F=O*M,j=O);const $={x:b.width*E,y:b.height*A,width:F,height:j},q=(n=t.cornerRadius)!==null&&n!==void 0?n:0,J=t.page._exportingOrRendering?1:Math.min(2,e.scale),ae=e._elementsPixelRatio*J;let ie=((Te,Be,Ce,fe)=>{const Le=W3(Te.clipSrc||""),[Ne,ue]=u2(Le,"anonymous"),Ae=Te.clipSrc?ue:"loaded";up(Ae,Te.clipSrc,Te.id);const Pe=se.useMemo(()=>{if(Be&&Ne)return Jf()},[Be,Ne]);return se.useLayoutEffect(()=>{var Ue;if(!Ne||!Be||!Be.width||!Be.height||!Ne||!Ne.width||!Ne.height||!Pe)return;const st=Jf(),dt=Math.max(Te.a.width/Ne.width*Ce,Te.a.height/Ne.height*Ce);st.width=Math.max(Ne.width*dt,1),st.height=Math.max(Ne.height*dt,1),(Ue=st.getContext("2d"))===null||Ue===void 0||Ue.drawImage(Ne,0,0,st.width,st.height),Pe.width=Math.max(Be.width,1),Pe.height=Math.max(Be.height,1);const pt=Pe.getContext("2d");pt&&(pt.save(),pt.drawImage(st,0,0,Be.width,Be.height),sn.Util.releaseCanvas(st),pt.globalCompositeOperation="source-in",pt.drawImage(Be,0,0,Pe.width,Pe.height),pt.restore())},[Pe,Be,Ne,Te.a.width,Te.a.height,Ce,...fe]),Te.clipSrc&&Ne?Pe:Be})(t,cL(t,b,$,ae,q,r||t._cropModeEnabled||t.type==="svg",!0),ae,[$,q,ae]);const Z=Math.max(t.a.width/F,t.a.height/j);se.useEffect(()=>{var Te;if(!t._cropModeEnabled)return;const Be=(Te=a.current)===null||Te===void 0?void 0:Te.getStage();function Ce(Le){t._cropModeEnabled&&Le.target!==o.current&&t.toggleCropMode(!1)}function fe(Le){t._cropModeEnabled&&Le.target.parentNode!==Be.content&&t.toggleCropMode(!1)}return document.body.addEventListener("click",fe),Be?.on("click",Ce),Be?.on("tap",Ce),()=>{document.body.removeEventListener("click",fe),document.body.removeEventListener("touchstart",fe),Be?.off("click",Ce),Be?.off("click",Ce)}},[t._cropModeEnabled]),se.useLayoutEffect(()=>{if(!r&&!t._cropModeEnabled)return Ms(a.current,t),zu(()=>{Ms(a.current,t)},{delay:100})},[ie,t.page._exportingOrRendering,r,S,k,t._cropModeEnabled]),se.useLayoutEffect(()=>{var Te;r||t._cropModeEnabled?(Te=a.current)===null||Te===void 0||Te.clearCache():Ms(a.current,t)},[r,t.a.width,t.a.height,t._cropModeEnabled]),se.useEffect(()=>{Ms(a.current,t)},[t.shadowEnabled,t.shadowBlur,t.cornerRadius,t.shadowColor,t.shadowOffsetX,t.shadowOffsetY,t.shadowOpacity]);const te=se.useRef(null),V=se.useRef(null),B=se.useRef(null);se.useLayoutEffect(()=>{t._cropModeEnabled&&(V.current.nodes([te.current]),B.current.nodes([o.current]))},[t._cropModeEnabled]);var D=se.useRef(null),U=se.useRef(0),X=se.useRef(!1);const ee=Te=>{var Be;((Be=Te.evt.touches)===null||Be===void 0?void 0:Be.length)>2&&Te.target.stopDrag(),Math.round(Te.target.x())>0&&(Te.target.x(0),Te.target.scaleX(1)),Math.round(Te.target.y())>0&&(Te.target.y(0),Te.target.scaleY(1));const Ce=Te.target.width()*Te.target.scaleX(),fe=Te.target.height()*Te.target.scaleY(),Le=Math.min(1,F/Ce),Ne=Math.min(1,j/fe),ue=1-Le,Ae=Math.min(ue,Math.max(0,Math.round(-Te.target.x())/Ce)),Pe=1-Ne,Ue=Math.min(Pe,Math.max(0,Math.round(-Te.target.y())/fe));Te.target.setAttrs({x:-Ae*b.width,y:-Ue*b.height,scaleX:1,scaleY:1}),t.set({cropX:Ae,cropY:Ue,cropWidth:Le,cropHeight:Ne})},K=()=>{t.type!=="svg"&&t.contentEditable&&(t.stretchEnabled||setTimeout(()=>{t.toggleCropMode(!0)}))},oe=t.type==="svg"&&_,me=g==="loading"&&!oe,[de]=bm(me,100,!1,!1),ye=g==="failed",Re=!de&&!ye,Oe=se.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Me=Re?t.a.opacity:0;Mp(a,Me);const Ee=t.selectable||e.role==="admin",ge=Lf();return se.createElement(se.Fragment,null,de&&se.createElement(hL,{element:t}),ye&&se.createElement(dL,{element:t}),se.createElement(Tu,{ref:a,name:"element",id:t.id,image:ie,x:t.a.x,y:t.a.y,width:t.a.width||1,height:t.a.height||1,rotation:t.a.rotation,opacity:Me,shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur,shadowOffsetX:t.shadowOffsetX,shadowOffsetY:t.shadowOffsetY,shadowColor:t.shadowColor,shadowOpacity:t.shadowOpacity,customCrop:$,listening:Ee,draggable:ge?t.draggable&&s:t.draggable,preventDefault:!ge||s,hideInExport:!t.showInExport,onDragMove:Te=>{t.set({x:Te.target.x(),y:Te.target.y()})},onDragEnd:Te=>{t.set({x:Te.target.x(),y:Te.target.y()})},onDblClick:K,onDblTap:K,onTransformStart:()=>{i(!0),Oe.current={cropX:t.cropX,cropY:t.cropY,cropWidth:t.cropWidth,cropHeight:t.cropHeight}},onTransform:Te=>{var Be;const Ce=Te.currentTarget,fe=Math.abs(Ce.scaleX()-1)<1e-7?1:Ce.scaleX(),Le=Math.abs(Ce.scaleY()-1)<1e-7?1:Ce.scaleY();Ce.scaleX(1),Ce.scaleY(1);const Ne=(Be=Te.target.getStage())===null||Be===void 0?void 0:Be.findOne("Transformer"),ue=1-F/b.width,Ae=Math.min(ue,Math.max(0,t.cropX)),Pe=1-j/b.height,Ue=Math.min(Pe,Math.max(0,t.cropY)),st=Ne.getActiveAnchor(),dt=!(st.indexOf("middle")>=0||st.indexOf("center")>=0),pt=!dt&&fe<1&&Oe.current.cropHeight>j/b.height;let xt=dt?t.cropWidth:t.cropWidth*fe;pt&&(xt=t.cropWidth);const bt=!dt&&Le<1&&Oe.current.cropWidth>F/b.width;let kt=dt?t.cropHeight:t.cropHeight*Le;bt&&(kt=t.cropHeight),L&&(xt=t.cropWidth,kt=t.cropHeight),t.set({cropX:Ae,cropY:Ue,x:Ce.x(),y:Ce.y(),width:Ce.width()*fe,height:Ce.height()*Le,rotation:Te.target.rotation(),cropWidth:Math.min(xt,1-Ae),cropHeight:Math.min(kt,1-Ue)})},onTransformEnd:Te=>{const Be=Te.currentTarget;t.set({width:Be.width(),height:Be.height(),x:Be.x(),y:Be.y(),rotation:Te.target.rotation(),cropWidth:F/b.width,cropHeight:j/b.height}),i(!1)}}),se.createElement(Tr,{x:t.x,y:t.y,width:Math.max(t.a.width-t.borderSize,0),height:Math.max(t.a.height-t.borderSize,0),opacity:Me,offsetX:-t.borderSize/2,offsetY:-t.borderSize/2,stroke:t.borderColor,strokeWidth:t.borderSize,listening:!1,visible:!!t.borderSize,rotation:t.rotation,cornerRadius:Math.max(0,q-t.borderSize),hideInExport:!t.showInExport}),t._cropModeEnabled&&se.createElement(ry,{selector:".page-abs-container",enabled:!0},se.createElement(Tr,{x:-window.innerWidth/e.scale,y:-window.innerWidth/e.scale,width:window.innerWidth/e.scale*3,height:window.innerWidth/e.scale*3,fill:"rgba(0,0,0,0.3)"}),se.createElement(Tu,{listening:!1,image:ie,x:t.x,y:t.y,width:t.a.width,height:t.a.height,rotation:t.rotation,shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur}),se.createElement(br,{x:t.x,y:t.y,rotation:t.rotation,scaleX:Z,scaleY:Z},se.createElement(Tu,{image:b,ref:o,opacity:.4,draggable:!0,x:-t.cropX*b.width,y:-t.cropY*b.height,onDragMove:ee,onTransform:ee,onTouchMove:Te=>{Te.evt.preventDefault();const Be=Te.target.getStage().getPointersPositions();var Ce=Be[0],fe=Be[1];const Le=Te.target;if(Ce&&!fe&&!Le.isDragging()&&X.current&&(Le.startDrag(),X.current=!1),Ce&&fe){sn.hitOnDragEnabled=!0,Le.isDragging()&&(X.current=!0,Le.stopDrag());const bt=Te.target.getAbsoluteTransform().copy();bt.invert();var Ne={x:Ce.x,y:Ce.y},ue={x:fe.x,y:fe.y};if(!D.current)return void(D.current=V3(Ne,ue));var Ae=V3(Ne,ue),Pe=(function(It,Jt){return Math.sqrt(Math.pow(Jt.x-It.x,2)+Math.pow(Jt.y-It.y,2))})(Ne,ue);U.current||(U.current=Pe);const kt=Le.position();var Ue={x:Ae.x-kt.x,y:Ae.y-kt.y},st=Pe/U.current;Le.scaleX(st),Le.scaleY(st);const qn=bt.point(Ae),xn=bt.point(D.current);var dt=qn.x-xn.x,pt=qn.y-xn.y,xt={x:Math.min(0,Ae.x-Ue.x*st+dt),y:Math.min(0,Ae.y-Ue.y*st+pt)};Le.position(xt),U.current=Pe,D.current=Ae,ee(Te)}},onTouchEnd:Te=>{U.current=0,D.current=null,sn.hitOnDragEnabled=!1}}),se.createElement(bp,Object.assign({ref:B},uL)),se.createElement(Tr,{width:F,height:j,ref:te,listening:!1,onTransform:Te=>{if(t.cropX<Math.abs(Te.target.x()/b.width)&&Te.target.x()<0&&t.cropX>0){const Pe=(t.cropWidth+t.cropX)*b.width;Te.target.scaleX(1),Te.target.width(Pe)}if(t.cropY<Math.abs(Te.target.y()/b.height)&&Te.target.y()<0&&t.cropY>0){const Pe=(t.cropHeight+t.cropY)*b.height;Te.target.scaleY(1),Te.target.height(Pe)}Te.target.x()<-t.cropX*b.width-1e-9&&(Te.target.x(-t.cropX*b.width),Te.target.scaleX(1)),Te.target.y()<-t.cropY*b.height-1e-9&&(Te.target.y(-t.cropY*b.height),Te.target.scaleY(1));const Be=Math.min(1,Math.max(0,t.cropX+Te.target.x()/b.width)),Ce=Math.min(1,Math.max(0,Te.target.y()/b.height+t.cropY)),fe=Te.target.width()*Te.target.scaleX(),Le=Te.target.height()*Te.target.scaleY(),Ne=Math.min(1-Be,fe/b.width),ue=Math.min(1-Ce,Le/b.height),Ae=Te.target.getAbsolutePosition(Te.target.getParent().getParent());Te.target.scale({x:1,y:1}),Te.target.position({x:0,y:0}),t.set({x:Ae.x,y:Ae.y,cropX:Be,cropY:Ce,cropWidth:Ne,cropHeight:ue,width:Math.min(fe*Z,b.width*(1-Be)*Z),height:Math.min(Le*Z,b.height*(1-Ce)*Z)})}}),se.createElement(bp,Object.assign({ref:V},lL,{visible:t.resizable})))))});var X1={exports:{}};/*!
114
+ * Quill Editor v1.3.7
115
+ * https://quilljs.com/
116
+ * Copyright (c) 2014, Jason Chen
117
+ * Copyright (c) 2013, salesforce.com
118
+ */var pL=X1.exports,K3;function gL(){return K3||(K3=1,(function(t,e){(function(r,i){t.exports=i()})(typeof self<"u"?self:pL,function(){return(function(n){var r={};function i(a){if(r[a])return r[a].exports;var o=r[a]={i:a,l:!1,exports:{}};return n[a].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=n,i.c=r,i.d=function(a,o,s){i.o(a,o)||Object.defineProperty(a,o,{configurable:!1,enumerable:!0,get:s})},i.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(o,"a",o),o},i.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)},i.p="",i(i.s=109)})([(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=i(17),o=i(18),s=i(19),u=i(45),h=i(46),f=i(47),g=i(48),v=i(49),p=i(12),y=i(32),_=i(33),x=i(31),b=i(1),E={Scope:b.Scope,create:b.create,find:b.find,query:b.query,register:b.register,Container:a.default,Format:o.default,Leaf:s.default,Embed:g.default,Scroll:u.default,Block:f.default,Inline:h.default,Text:v.default,Attributor:{Attribute:p.default,Class:y.default,Style:_.default,Store:x.default}};r.default=E}),(function(n,r,i){var a=this&&this.__extends||(function(){var x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,E){b.__proto__=E}||function(b,E){for(var A in E)E.hasOwnProperty(A)&&(b[A]=E[A])};return function(b,E){x(b,E);function A(){this.constructor=b}b.prototype=E===null?Object.create(E):(A.prototype=E.prototype,new A)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=(function(x){a(b,x);function b(E){var A=this;return E="[Parchment] "+E,A=x.call(this,E)||this,A.message=E,A.name=A.constructor.name,A}return b})(Error);r.ParchmentError=o;var s={},u={},h={},f={};r.DATA_KEY="__blot";var g;(function(x){x[x.TYPE=3]="TYPE",x[x.LEVEL=12]="LEVEL",x[x.ATTRIBUTE=13]="ATTRIBUTE",x[x.BLOT=14]="BLOT",x[x.INLINE=7]="INLINE",x[x.BLOCK=11]="BLOCK",x[x.BLOCK_BLOT=10]="BLOCK_BLOT",x[x.INLINE_BLOT=6]="INLINE_BLOT",x[x.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",x[x.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",x[x.ANY=15]="ANY"})(g=r.Scope||(r.Scope={}));function v(x,b){var E=y(x);if(E==null)throw new o("Unable to create "+x+" blot");var A=E,S=x instanceof Node||x.nodeType===Node.TEXT_NODE?x:A.create(b);return new A(S,b)}r.create=v;function p(x,b){return b===void 0&&(b=!1),x==null?null:x[r.DATA_KEY]!=null?x[r.DATA_KEY].blot:b?p(x.parentNode,b):null}r.find=p;function y(x,b){b===void 0&&(b=g.ANY);var E;if(typeof x=="string")E=f[x]||s[x];else if(x instanceof Text||x.nodeType===Node.TEXT_NODE)E=f.text;else if(typeof x=="number")x&g.LEVEL&g.BLOCK?E=f.block:x&g.LEVEL&g.INLINE&&(E=f.inline);else if(x instanceof HTMLElement){var A=(x.getAttribute("class")||"").split(/\s+/);for(var S in A)if(E=u[A[S]],E)break;E=E||h[x.tagName]}return E==null?null:b&g.LEVEL&E.scope&&b&g.TYPE&E.scope?E:null}r.query=y;function _(){for(var x=[],b=0;b<arguments.length;b++)x[b]=arguments[b];if(x.length>1)return x.map(function(S){return _(S)});var E=x[0];if(typeof E.blotName!="string"&&typeof E.attrName!="string")throw new o("Invalid definition");if(E.blotName==="abstract")throw new o("Cannot register abstract class");if(f[E.blotName||E.attrName]=E,typeof E.keyName=="string")s[E.keyName]=E;else if(E.className!=null&&(u[E.className]=E),E.tagName!=null){Array.isArray(E.tagName)?E.tagName=E.tagName.map(function(S){return S.toUpperCase()}):E.tagName=E.tagName.toUpperCase();var A=Array.isArray(E.tagName)?E.tagName:[E.tagName];A.forEach(function(S){(h[S]==null||E.className==null)&&(h[S]=E)})}return E}r.register=_}),(function(n,r,i){var a=i(51),o=i(11),s=i(3),u=i(20),h="\0",f=function(g){Array.isArray(g)?this.ops=g:g!=null&&Array.isArray(g.ops)?this.ops=g.ops:this.ops=[]};f.prototype.insert=function(g,v){var p={};return g.length===0?this:(p.insert=g,v!=null&&typeof v=="object"&&Object.keys(v).length>0&&(p.attributes=v),this.push(p))},f.prototype.delete=function(g){return g<=0?this:this.push({delete:g})},f.prototype.retain=function(g,v){if(g<=0)return this;var p={retain:g};return v!=null&&typeof v=="object"&&Object.keys(v).length>0&&(p.attributes=v),this.push(p)},f.prototype.push=function(g){var v=this.ops.length,p=this.ops[v-1];if(g=s(!0,{},g),typeof p=="object"){if(typeof g.delete=="number"&&typeof p.delete=="number")return this.ops[v-1]={delete:p.delete+g.delete},this;if(typeof p.delete=="number"&&g.insert!=null&&(v-=1,p=this.ops[v-1],typeof p!="object"))return this.ops.unshift(g),this;if(o(g.attributes,p.attributes)){if(typeof g.insert=="string"&&typeof p.insert=="string")return this.ops[v-1]={insert:p.insert+g.insert},typeof g.attributes=="object"&&(this.ops[v-1].attributes=g.attributes),this;if(typeof g.retain=="number"&&typeof p.retain=="number")return this.ops[v-1]={retain:p.retain+g.retain},typeof g.attributes=="object"&&(this.ops[v-1].attributes=g.attributes),this}}return v===this.ops.length?this.ops.push(g):this.ops.splice(v,0,g),this},f.prototype.chop=function(){var g=this.ops[this.ops.length-1];return g&&g.retain&&!g.attributes&&this.ops.pop(),this},f.prototype.filter=function(g){return this.ops.filter(g)},f.prototype.forEach=function(g){this.ops.forEach(g)},f.prototype.map=function(g){return this.ops.map(g)},f.prototype.partition=function(g){var v=[],p=[];return this.forEach(function(y){var _=g(y)?v:p;_.push(y)}),[v,p]},f.prototype.reduce=function(g,v){return this.ops.reduce(g,v)},f.prototype.changeLength=function(){return this.reduce(function(g,v){return v.insert?g+u.length(v):v.delete?g-v.delete:g},0)},f.prototype.length=function(){return this.reduce(function(g,v){return g+u.length(v)},0)},f.prototype.slice=function(g,v){g=g||0,typeof v!="number"&&(v=1/0);for(var p=[],y=u.iterator(this.ops),_=0;_<v&&y.hasNext();){var x;_<g?x=y.next(g-_):(x=y.next(v-_),p.push(x)),_+=u.length(x)}return new f(p)},f.prototype.compose=function(g){var v=u.iterator(this.ops),p=u.iterator(g.ops),y=[],_=p.peek();if(_!=null&&typeof _.retain=="number"&&_.attributes==null){for(var x=_.retain;v.peekType()==="insert"&&v.peekLength()<=x;)x-=v.peekLength(),y.push(v.next());_.retain-x>0&&p.next(_.retain-x)}for(var b=new f(y);v.hasNext()||p.hasNext();)if(p.peekType()==="insert")b.push(p.next());else if(v.peekType()==="delete")b.push(v.next());else{var E=Math.min(v.peekLength(),p.peekLength()),A=v.next(E),S=p.next(E);if(typeof S.retain=="number"){var k={};typeof A.retain=="number"?k.retain=E:k.insert=A.insert;var I=u.attributes.compose(A.attributes,S.attributes,typeof A.retain=="number");if(I&&(k.attributes=I),b.push(k),!p.hasNext()&&o(b.ops[b.ops.length-1],k)){var O=new f(v.rest());return b.concat(O).chop()}}else typeof S.delete=="number"&&typeof A.retain=="number"&&b.push(S)}return b.chop()},f.prototype.concat=function(g){var v=new f(this.ops.slice());return g.ops.length>0&&(v.push(g.ops[0]),v.ops=v.ops.concat(g.ops.slice(1))),v},f.prototype.diff=function(g,v){if(this.ops===g.ops)return new f;var p=[this,g].map(function(E){return E.map(function(A){if(A.insert!=null)return typeof A.insert=="string"?A.insert:h;var S=E===g?"on":"with";throw new Error("diff() called "+S+" non-document")}).join("")}),y=new f,_=a(p[0],p[1],v),x=u.iterator(this.ops),b=u.iterator(g.ops);return _.forEach(function(E){for(var A=E[1].length;A>0;){var S=0;switch(E[0]){case a.INSERT:S=Math.min(b.peekLength(),A),y.push(b.next(S));break;case a.DELETE:S=Math.min(A,x.peekLength()),x.next(S),y.delete(S);break;case a.EQUAL:S=Math.min(x.peekLength(),b.peekLength(),A);var k=x.next(S),I=b.next(S);o(k.insert,I.insert)?y.retain(S,u.attributes.diff(k.attributes,I.attributes)):y.push(I).delete(S);break}A-=S}}),y.chop()},f.prototype.eachLine=function(g,v){v=v||`
119
+ `;for(var p=u.iterator(this.ops),y=new f,_=0;p.hasNext();){if(p.peekType()!=="insert")return;var x=p.peek(),b=u.length(x)-p.peekLength(),E=typeof x.insert=="string"?x.insert.indexOf(v,b)-b:-1;if(E<0)y.push(p.next());else if(E>0)y.push(p.next(E));else{if(g(y,p.next(1).attributes||{},_)===!1)return;_+=1,y=new f}}y.length()>0&&g(y,{},_)},f.prototype.transform=function(g,v){if(v=!!v,typeof g=="number")return this.transformPosition(g,v);for(var p=u.iterator(this.ops),y=u.iterator(g.ops),_=new f;p.hasNext()||y.hasNext();)if(p.peekType()==="insert"&&(v||y.peekType()!=="insert"))_.retain(u.length(p.next()));else if(y.peekType()==="insert")_.push(y.next());else{var x=Math.min(p.peekLength(),y.peekLength()),b=p.next(x),E=y.next(x);if(b.delete)continue;E.delete?_.push(E):_.retain(x,u.attributes.transform(b.attributes,E.attributes,v))}return _.chop()},f.prototype.transformPosition=function(g,v){v=!!v;for(var p=u.iterator(this.ops),y=0;p.hasNext()&&y<=g;){var _=p.peekLength(),x=p.peekType();if(p.next(),x==="delete"){g-=Math.min(_,g-y);continue}else x==="insert"&&(y<g||!v)&&(g+=_);y+=_}return g},n.exports=f}),(function(n,r){var i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u=function(p){return typeof Array.isArray=="function"?Array.isArray(p):a.call(p)==="[object Array]"},h=function(p){if(!p||a.call(p)!=="[object Object]")return!1;var y=i.call(p,"constructor"),_=p.constructor&&p.constructor.prototype&&i.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!y&&!_)return!1;var x;for(x in p);return typeof x>"u"||i.call(p,x)},f=function(p,y){o&&y.name==="__proto__"?o(p,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):p[y.name]=y.newValue},g=function(p,y){if(y==="__proto__")if(i.call(p,y)){if(s)return s(p,y).value}else return;return p[y]};n.exports=function v(){var p,y,_,x,b,E,A=arguments[0],S=1,k=arguments.length,I=!1;for(typeof A=="boolean"&&(I=A,A=arguments[1]||{},S=2),(A==null||typeof A!="object"&&typeof A!="function")&&(A={});S<k;++S)if(p=arguments[S],p!=null)for(y in p)_=g(A,y),x=g(p,y),A!==x&&(I&&x&&(h(x)||(b=u(x)))?(b?(b=!1,E=_&&u(_)?_:[]):E=_&&h(_)?_:{},f(A,{name:y,newValue:v(I,E,x)})):typeof x<"u"&&f(A,{name:y,newValue:x}));return A}}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.BlockEmbed=r.bubbleFormats=void 0;var a=(function(){function T(L,$){for(var q=0;q<$.length;q++){var J=$[q];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(L,J.key,J)}}return function(L,$,q){return $&&T(L.prototype,$),q&&T(L,q),L}})(),o=function T(L,$,q){L===null&&(L=Function.prototype);var J=Object.getOwnPropertyDescriptor(L,$);if(J===void 0){var ae=Object.getPrototypeOf(L);return ae===null?void 0:T(ae,$,q)}else{if("value"in J)return J.value;var ie=J.get;return ie===void 0?void 0:ie.call(q)}},s=i(3),u=A(s),h=i(2),f=A(h),g=i(0),v=A(g),p=i(16),y=A(p),_=i(6),x=A(_),b=i(7),E=A(b);function A(T){return T&&T.__esModule?T:{default:T}}function S(T,L){if(!(T instanceof L))throw new TypeError("Cannot call a class as a function")}function k(T,L){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:T}function I(T,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);T.prototype=Object.create(L&&L.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(T,L):T.__proto__=L)}var O=1,M=(function(T){I(L,T);function L(){return S(this,L),k(this,(L.__proto__||Object.getPrototypeOf(L)).apply(this,arguments))}return a(L,[{key:"attach",value:function(){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"attach",this).call(this),this.attributes=new v.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new f.default().insert(this.value(),(0,u.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(q,J){var ae=v.default.query(q,v.default.Scope.BLOCK_ATTRIBUTE);ae!=null&&this.attributes.attribute(ae,J)}},{key:"formatAt",value:function(q,J,ae,ie){this.format(ae,ie)}},{key:"insertAt",value:function(q,J,ae){if(typeof J=="string"&&J.endsWith(`
120
+ `)){var ie=v.default.create(F.blotName);this.parent.insertBefore(ie,q===0?this:this.next),ie.insertAt(0,J.slice(0,-1))}else o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertAt",this).call(this,q,J,ae)}}]),L})(v.default.Embed);M.scope=v.default.Scope.BLOCK_BLOT;var F=(function(T){I(L,T);function L($){S(this,L);var q=k(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,$));return q.cache={},q}return a(L,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(v.default.Leaf).reduce(function(q,J){return J.length()===0?q:q.insert(J.value(),j(J))},new f.default).insert(`
121
+ `,j(this))),this.cache.delta}},{key:"deleteAt",value:function(q,J){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"deleteAt",this).call(this,q,J),this.cache={}}},{key:"formatAt",value:function(q,J,ae,ie){J<=0||(v.default.query(ae,v.default.Scope.BLOCK)?q+J===this.length()&&this.format(ae,ie):o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"formatAt",this).call(this,q,Math.min(J,this.length()-q-1),ae,ie),this.cache={})}},{key:"insertAt",value:function(q,J,ae){if(ae!=null)return o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertAt",this).call(this,q,J,ae);if(J.length!==0){var ie=J.split(`
122
+ `),Z=ie.shift();Z.length>0&&(q<this.length()-1||this.children.tail==null?o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertAt",this).call(this,Math.min(q,this.length()-1),Z):this.children.tail.insertAt(this.children.tail.length(),Z),this.cache={});var te=this;ie.reduce(function(V,B){return te=te.split(V,!0),te.insertAt(0,B),B.length},q+Z.length)}}},{key:"insertBefore",value:function(q,J){var ae=this.children.head;o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertBefore",this).call(this,q,J),ae instanceof y.default&&ae.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"length",this).call(this)+O),this.cache.length}},{key:"moveChildren",value:function(q,J){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"moveChildren",this).call(this,q,J),this.cache={}}},{key:"optimize",value:function(q){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"optimize",this).call(this,q),this.cache={}}},{key:"path",value:function(q){return o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"path",this).call(this,q,!0)}},{key:"removeChild",value:function(q){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"removeChild",this).call(this,q),this.cache={}}},{key:"split",value:function(q){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(J&&(q===0||q>=this.length()-O)){var ae=this.clone();return q===0?(this.parent.insertBefore(ae,this),this):(this.parent.insertBefore(ae,this.next),ae)}else{var ie=o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"split",this).call(this,q,J);return this.cache={},ie}}}]),L})(v.default.Block);F.blotName="block",F.tagName="P",F.defaultChild="break",F.allowedChildren=[x.default,v.default.Embed,E.default];function j(T){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return T==null||(typeof T.formats=="function"&&(L=(0,u.default)(L,T.formats())),T.parent==null||T.parent.blotName=="scroll"||T.parent.statics.scope!==T.statics.scope)?L:j(T.parent,L)}r.bubbleFormats=j,r.BlockEmbed=M,r.default=F}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.overload=r.expandConfig=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(te){return typeof te}:function(te){return te&&typeof Symbol=="function"&&te.constructor===Symbol&&te!==Symbol.prototype?"symbol":typeof te},o=(function(){function te(V,B){var D=[],U=!0,X=!1,ee=void 0;try{for(var K=V[Symbol.iterator](),oe;!(U=(oe=K.next()).done)&&(D.push(oe.value),!(B&&D.length===B));U=!0);}catch(me){X=!0,ee=me}finally{try{!U&&K.return&&K.return()}finally{if(X)throw ee}}return D}return function(V,B){if(Array.isArray(V))return V;if(Symbol.iterator in Object(V))return te(V,B);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),s=(function(){function te(V,B){for(var D=0;D<B.length;D++){var U=B[D];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(V,U.key,U)}}return function(V,B,D){return B&&te(V.prototype,B),D&&te(V,D),V}})();i(50);var u=i(2),h=j(u),f=i(14),g=j(f),v=i(8),p=j(v),y=i(9),_=j(y),x=i(0),b=j(x),E=i(15),A=j(E),S=i(3),k=j(S),I=i(10),O=j(I),M=i(34),F=j(M);function j(te){return te&&te.__esModule?te:{default:te}}function T(te,V,B){return V in te?Object.defineProperty(te,V,{value:B,enumerable:!0,configurable:!0,writable:!0}):te[V]=B,te}function L(te,V){if(!(te instanceof V))throw new TypeError("Cannot call a class as a function")}var $=(0,O.default)("quill"),q=(function(){s(te,null,[{key:"debug",value:function(B){B===!0&&(B="log"),O.default.level(B)}},{key:"find",value:function(B){return B.__quill||b.default.find(B)}},{key:"import",value:function(B){return this.imports[B]==null&&$.error("Cannot import "+B+". Are you sure it was registered?"),this.imports[B]}},{key:"register",value:function(B,D){var U=this,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof B!="string"){var ee=B.attrName||B.blotName;typeof ee=="string"?this.register("formats/"+ee,B,D):Object.keys(B).forEach(function(K){U.register(K,B[K],D)})}else this.imports[B]!=null&&!X&&$.warn("Overwriting "+B+" with",D),this.imports[B]=D,(B.startsWith("blots/")||B.startsWith("formats/"))&&D.blotName!=="abstract"?b.default.register(D):B.startsWith("modules")&&typeof D.register=="function"&&D.register()}}]);function te(V){var B=this,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(L(this,te),this.options=J(V,D),this.container=this.options.container,this.container==null)return $.error("Invalid Quill container",V);this.options.debug&&te.debug(this.options.debug);var U=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new p.default,this.scroll=b.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new g.default(this.scroll),this.selection=new A.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(p.default.events.EDITOR_CHANGE,function(ee){ee===p.default.events.TEXT_CHANGE&&B.root.classList.toggle("ql-blank",B.editor.isBlank())}),this.emitter.on(p.default.events.SCROLL_UPDATE,function(ee,K){var oe=B.selection.lastRange,me=oe&&oe.length===0?oe.index:void 0;ae.call(B,function(){return B.editor.update(null,K,me)},ee)});var X=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+U+"<p><br></p></div>");this.setContents(X),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return s(te,[{key:"addContainer",value:function(B){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof B=="string"){var U=B;B=document.createElement("div"),B.classList.add(U)}return this.container.insertBefore(B,D),B}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(B,D,U){var X=this,ee=ie(B,D,U),K=o(ee,4);return B=K[0],D=K[1],U=K[3],ae.call(this,function(){return X.editor.deleteText(B,D)},U,B,-1*D)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(B),this.container.classList.toggle("ql-disabled",!B)}},{key:"focus",value:function(){var B=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=B,this.scrollIntoView()}},{key:"format",value:function(B,D){var U=this,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:p.default.sources.API;return ae.call(this,function(){var ee=U.getSelection(!0),K=new h.default;if(ee==null)return K;if(b.default.query(B,b.default.Scope.BLOCK))K=U.editor.formatLine(ee.index,ee.length,T({},B,D));else{if(ee.length===0)return U.selection.format(B,D),K;K=U.editor.formatText(ee.index,ee.length,T({},B,D))}return U.setSelection(ee,p.default.sources.SILENT),K},X)}},{key:"formatLine",value:function(B,D,U,X,ee){var K=this,oe=void 0,me=ie(B,D,U,X,ee),de=o(me,4);return B=de[0],D=de[1],oe=de[2],ee=de[3],ae.call(this,function(){return K.editor.formatLine(B,D,oe)},ee,B,0)}},{key:"formatText",value:function(B,D,U,X,ee){var K=this,oe=void 0,me=ie(B,D,U,X,ee),de=o(me,4);return B=de[0],D=de[1],oe=de[2],ee=de[3],ae.call(this,function(){return K.editor.formatText(B,D,oe)},ee,B,0)}},{key:"getBounds",value:function(B){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,U=void 0;typeof B=="number"?U=this.selection.getBounds(B,D):U=this.selection.getBounds(B.index,B.length);var X=this.container.getBoundingClientRect();return{bottom:U.bottom-X.top,height:U.height,left:U.left-X.left,right:U.right-X.left,top:U.top-X.top,width:U.width}}},{key:"getContents",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-B,U=ie(B,D),X=o(U,2);return B=X[0],D=X[1],this.editor.getContents(B,D)}},{key:"getFormat",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof B=="number"?this.editor.getFormat(B,D):this.editor.getFormat(B.index,B.length)}},{key:"getIndex",value:function(B){return B.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(B){return this.scroll.leaf(B)}},{key:"getLine",value:function(B){return this.scroll.line(B)}},{key:"getLines",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof B!="number"?this.scroll.lines(B.index,B.length):this.scroll.lines(B,D)}},{key:"getModule",value:function(B){return this.theme.modules[B]}},{key:"getSelection",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return B&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-B,U=ie(B,D),X=o(U,2);return B=X[0],D=X[1],this.editor.getText(B,D)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(B,D,U){var X=this,ee=arguments.length>3&&arguments[3]!==void 0?arguments[3]:te.sources.API;return ae.call(this,function(){return X.editor.insertEmbed(B,D,U)},ee,B)}},{key:"insertText",value:function(B,D,U,X,ee){var K=this,oe=void 0,me=ie(B,0,U,X,ee),de=o(me,4);return B=de[0],oe=de[2],ee=de[3],ae.call(this,function(){return K.editor.insertText(B,D,oe)},ee,B,D.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(B,D,U){this.clipboard.dangerouslyPasteHTML(B,D,U)}},{key:"removeFormat",value:function(B,D,U){var X=this,ee=ie(B,D,U),K=o(ee,4);return B=K[0],D=K[1],U=K[3],ae.call(this,function(){return X.editor.removeFormat(B,D)},U,B)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(B){var D=this,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API;return ae.call(this,function(){B=new h.default(B);var X=D.getLength(),ee=D.editor.deleteText(0,X),K=D.editor.applyDelta(B),oe=K.ops[K.ops.length-1];oe!=null&&typeof oe.insert=="string"&&oe.insert[oe.insert.length-1]===`
123
+ `&&(D.editor.deleteText(D.getLength()-1,1),K.delete(1));var me=ee.compose(K);return me},U)}},{key:"setSelection",value:function(B,D,U){if(B==null)this.selection.setRange(null,D||te.sources.API);else{var X=ie(B,D,U),ee=o(X,4);B=ee[0],D=ee[1],U=ee[3],this.selection.setRange(new E.Range(B,D),U),U!==p.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(B){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API,U=new h.default().insert(B);return this.setContents(U,D)}},{key:"update",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p.default.sources.USER,D=this.scroll.update(B);return this.selection.update(B),D}},{key:"updateContents",value:function(B){var D=this,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API;return ae.call(this,function(){return B=new h.default(B),D.editor.applyDelta(B,U)},U,!0)}}]),te})();q.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},q.events=p.default.events,q.sources=p.default.sources,q.version="1.3.7",q.imports={delta:h.default,parchment:b.default,"core/module":_.default,"core/theme":F.default};function J(te,V){if(V=(0,k.default)(!0,{container:te,modules:{clipboard:!0,keyboard:!0,history:!0}},V),!V.theme||V.theme===q.DEFAULTS.theme)V.theme=F.default;else if(V.theme=q.import("themes/"+V.theme),V.theme==null)throw new Error("Invalid theme "+V.theme+". Did you register it?");var B=(0,k.default)(!0,{},V.theme.DEFAULTS);[B,V].forEach(function(X){X.modules=X.modules||{},Object.keys(X.modules).forEach(function(ee){X.modules[ee]===!0&&(X.modules[ee]={})})});var D=Object.keys(B.modules).concat(Object.keys(V.modules)),U=D.reduce(function(X,ee){var K=q.import("modules/"+ee);return K==null?$.error("Cannot load "+ee+" module. Are you sure you registered it?"):X[ee]=K.DEFAULTS||{},X},{});return V.modules!=null&&V.modules.toolbar&&V.modules.toolbar.constructor!==Object&&(V.modules.toolbar={container:V.modules.toolbar}),V=(0,k.default)(!0,{},q.DEFAULTS,{modules:U},B,V),["bounds","container","scrollingContainer"].forEach(function(X){typeof V[X]=="string"&&(V[X]=document.querySelector(V[X]))}),V.modules=Object.keys(V.modules).reduce(function(X,ee){return V.modules[ee]&&(X[ee]=V.modules[ee]),X},{}),V}function ae(te,V,B,D){if(this.options.strict&&!this.isEnabled()&&V===p.default.sources.USER)return new h.default;var U=B==null?null:this.getSelection(),X=this.editor.delta,ee=te();if(U!=null&&(B===!0&&(B=U.index),D==null?U=Z(U,ee,V):D!==0&&(U=Z(U,B,D,V)),this.setSelection(U,p.default.sources.SILENT)),ee.length()>0){var K,oe=[p.default.events.TEXT_CHANGE,ee,X,V];if((K=this.emitter).emit.apply(K,[p.default.events.EDITOR_CHANGE].concat(oe)),V!==p.default.sources.SILENT){var me;(me=this.emitter).emit.apply(me,oe)}}return ee}function ie(te,V,B,D,U){var X={};return typeof te.index=="number"&&typeof te.length=="number"?typeof V!="number"?(U=D,D=B,B=V,V=te.length,te=te.index):(V=te.length,te=te.index):typeof V!="number"&&(U=D,D=B,B=V,V=0),(typeof B>"u"?"undefined":a(B))==="object"?(X=B,U=D):typeof B=="string"&&(D!=null?X[B]=D:U=B),U=U||p.default.sources.API,[te,V,X,U]}function Z(te,V,B,D){if(te==null)return null;var U=void 0,X=void 0;if(V instanceof h.default){var ee=[te.index,te.index+te.length].map(function(de){return V.transformPosition(de,D!==p.default.sources.USER)}),K=o(ee,2);U=K[0],X=K[1]}else{var oe=[te.index,te.index+te.length].map(function(de){return de<V||de===V&&D===p.default.sources.USER?de:B>=0?de+B:Math.max(V,de+B)}),me=o(oe,2);U=me[0],X=me[1]}return new E.Range(U,X-U)}r.expandConfig=J,r.overload=ie,r.default=q}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function x(b,E){for(var A=0;A<E.length;A++){var S=E[A];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(b,S.key,S)}}return function(b,E,A){return E&&x(b.prototype,E),A&&x(b,A),b}})(),o=function x(b,E,A){b===null&&(b=Function.prototype);var S=Object.getOwnPropertyDescriptor(b,E);if(S===void 0){var k=Object.getPrototypeOf(b);return k===null?void 0:x(k,E,A)}else{if("value"in S)return S.value;var I=S.get;return I===void 0?void 0:I.call(A)}},s=i(7),u=g(s),h=i(0),f=g(h);function g(x){return x&&x.__esModule?x:{default:x}}function v(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}function p(x,b){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:x}function y(x,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);x.prototype=Object.create(b&&b.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(x,b):x.__proto__=b)}var _=(function(x){y(b,x);function b(){return v(this,b),p(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"formatAt",value:function(A,S,k,I){if(b.compare(this.statics.blotName,k)<0&&f.default.query(k,f.default.Scope.BLOT)){var O=this.isolate(A,S);I&&O.wrap(k,I)}else o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"formatAt",this).call(this,A,S,k,I)}},{key:"optimize",value:function(A){if(o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"optimize",this).call(this,A),this.parent instanceof b&&b.compare(this.statics.blotName,this.parent.statics.blotName)>0){var S=this.parent.isolate(this.offset(),this.length());this.moveChildren(S),S.wrap(this)}}}],[{key:"compare",value:function(A,S){var k=b.order.indexOf(A),I=b.order.indexOf(S);return k>=0||I>=0?k-I:A===S?0:A<S?-1:1}}]),b})(f.default.Inline);_.allowedChildren=[_,f.default.Embed,u.default],_.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],r.default=_}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=i(0),o=s(a);function s(v){return v&&v.__esModule?v:{default:v}}function u(v,p){if(!(v instanceof p))throw new TypeError("Cannot call a class as a function")}function h(v,p){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:v}function f(v,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);v.prototype=Object.create(p&&p.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(v,p):v.__proto__=p)}var g=(function(v){f(p,v);function p(){return u(this,p),h(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p})(o.default.Text);r.default=g}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function E(A,S){for(var k=0;k<S.length;k++){var I=S[k];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(A,I.key,I)}}return function(A,S,k){return S&&E(A.prototype,S),k&&E(A,k),A}})(),o=function E(A,S,k){A===null&&(A=Function.prototype);var I=Object.getOwnPropertyDescriptor(A,S);if(I===void 0){var O=Object.getPrototypeOf(A);return O===null?void 0:E(O,S,k)}else{if("value"in I)return I.value;var M=I.get;return M===void 0?void 0:M.call(k)}},s=i(54),u=g(s),h=i(10),f=g(h);function g(E){return E&&E.__esModule?E:{default:E}}function v(E,A){if(!(E instanceof A))throw new TypeError("Cannot call a class as a function")}function p(E,A){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:E}function y(E,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);E.prototype=Object.create(A&&A.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(E,A):E.__proto__=A)}var _=(0,f.default)("quill:events"),x=["selectionchange","mousedown","mouseup","click"];x.forEach(function(E){document.addEventListener(E,function(){for(var A=arguments.length,S=Array(A),k=0;k<A;k++)S[k]=arguments[k];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(I){if(I.__quill&&I.__quill.emitter){var O;(O=I.__quill.emitter).handleDOM.apply(O,S)}})})});var b=(function(E){y(A,E);function A(){v(this,A);var S=p(this,(A.__proto__||Object.getPrototypeOf(A)).call(this));return S.listeners={},S.on("error",_.error),S}return a(A,[{key:"emit",value:function(){_.log.apply(_,arguments),o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(k){for(var I=arguments.length,O=Array(I>1?I-1:0),M=1;M<I;M++)O[M-1]=arguments[M];(this.listeners[k.type]||[]).forEach(function(F){var j=F.node,T=F.handler;(k.target===j||j.contains(k.target))&&T.apply(void 0,[k].concat(O))})}},{key:"listenDOM",value:function(k,I,O){this.listeners[k]||(this.listeners[k]=[]),this.listeners[k].push({node:I,handler:O})}}]),A})(u.default);b.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},b.sources={API:"api",SILENT:"silent",USER:"user"},r.default=b}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});function a(s,u){if(!(s instanceof u))throw new TypeError("Cannot call a class as a function")}var o=function s(u){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};a(this,s),this.quill=u,this.options=h};o.DEFAULTS={},r.default=o}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=["error","warn","log","info"],o="warn";function s(h){if(a.indexOf(h)<=a.indexOf(o)){for(var f,g=arguments.length,v=Array(g>1?g-1:0),p=1;p<g;p++)v[p-1]=arguments[p];(f=console)[h].apply(f,v)}}function u(h){return a.reduce(function(f,g){return f[g]=s.bind(console,g,h),f},{})}s.level=u.level=function(h){o=h},r.default=u}),(function(n,r,i){var a=Array.prototype.slice,o=i(52),s=i(53),u=n.exports=function(v,p,y){return y||(y={}),v===p?!0:v instanceof Date&&p instanceof Date?v.getTime()===p.getTime():!v||!p||typeof v!="object"&&typeof p!="object"?y.strict?v===p:v==p:g(v,p,y)};function h(v){return v==null}function f(v){return!(!v||typeof v!="object"||typeof v.length!="number"||typeof v.copy!="function"||typeof v.slice!="function"||v.length>0&&typeof v[0]!="number")}function g(v,p,y){var _,x;if(h(v)||h(p)||v.prototype!==p.prototype)return!1;if(s(v))return s(p)?(v=a.call(v),p=a.call(p),u(v,p,y)):!1;if(f(v)){if(!f(p)||v.length!==p.length)return!1;for(_=0;_<v.length;_++)if(v[_]!==p[_])return!1;return!0}try{var b=o(v),E=o(p)}catch{return!1}if(b.length!=E.length)return!1;for(b.sort(),E.sort(),_=b.length-1;_>=0;_--)if(b[_]!=E[_])return!1;for(_=b.length-1;_>=0;_--)if(x=b[_],!u(v[x],p[x],y))return!1;return typeof v==typeof p}}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=i(1),o=(function(){function s(u,h,f){f===void 0&&(f={}),this.attrName=u,this.keyName=h;var g=a.Scope.TYPE&a.Scope.ATTRIBUTE;f.scope!=null?this.scope=f.scope&a.Scope.LEVEL|g:this.scope=a.Scope.ATTRIBUTE,f.whitelist!=null&&(this.whitelist=f.whitelist)}return s.keys=function(u){return[].map.call(u.attributes,function(h){return h.name})},s.prototype.add=function(u,h){return this.canAdd(u,h)?(u.setAttribute(this.keyName,h),!0):!1},s.prototype.canAdd=function(u,h){var f=a.query(u,a.Scope.BLOT&(this.scope|a.Scope.TYPE));return f==null?!1:this.whitelist==null?!0:typeof h=="string"?this.whitelist.indexOf(h.replace(/["']/g,""))>-1:this.whitelist.indexOf(h)>-1},s.prototype.remove=function(u){u.removeAttribute(this.keyName)},s.prototype.value=function(u){var h=u.getAttribute(this.keyName);return this.canAdd(u,h)&&h?h:""},s})();r.default=o}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.Code=void 0;var a=(function(){function M(F,j){var T=[],L=!0,$=!1,q=void 0;try{for(var J=F[Symbol.iterator](),ae;!(L=(ae=J.next()).done)&&(T.push(ae.value),!(j&&T.length===j));L=!0);}catch(ie){$=!0,q=ie}finally{try{!L&&J.return&&J.return()}finally{if($)throw q}}return T}return function(F,j){if(Array.isArray(F))return F;if(Symbol.iterator in Object(F))return M(F,j);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=(function(){function M(F,j){for(var T=0;T<j.length;T++){var L=j[T];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(F,L.key,L)}}return function(F,j,T){return j&&M(F.prototype,j),T&&M(F,T),F}})(),s=function M(F,j,T){F===null&&(F=Function.prototype);var L=Object.getOwnPropertyDescriptor(F,j);if(L===void 0){var $=Object.getPrototypeOf(F);return $===null?void 0:M($,j,T)}else{if("value"in L)return L.value;var q=L.get;return q===void 0?void 0:q.call(T)}},u=i(2),h=E(u),f=i(0),g=E(f),v=i(4),p=E(v),y=i(6),_=E(y),x=i(7),b=E(x);function E(M){return M&&M.__esModule?M:{default:M}}function A(M,F){if(!(M instanceof F))throw new TypeError("Cannot call a class as a function")}function S(M,F){if(!M)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return F&&(typeof F=="object"||typeof F=="function")?F:M}function k(M,F){if(typeof F!="function"&&F!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof F);M.prototype=Object.create(F&&F.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),F&&(Object.setPrototypeOf?Object.setPrototypeOf(M,F):M.__proto__=F)}var I=(function(M){k(F,M);function F(){return A(this,F),S(this,(F.__proto__||Object.getPrototypeOf(F)).apply(this,arguments))}return F})(_.default);I.blotName="code",I.tagName="CODE";var O=(function(M){k(F,M);function F(){return A(this,F),S(this,(F.__proto__||Object.getPrototypeOf(F)).apply(this,arguments))}return o(F,[{key:"delta",value:function(){var T=this,L=this.domNode.textContent;return L.endsWith(`
124
+ `)&&(L=L.slice(0,-1)),L.split(`
125
+ `).reduce(function($,q){return $.insert(q).insert(`
126
+ `,T.formats())},new h.default)}},{key:"format",value:function(T,L){if(!(T===this.statics.blotName&&L)){var $=this.descendant(b.default,this.length()-1),q=a($,1),J=q[0];J?.deleteAt(J.length()-1,1),s(F.prototype.__proto__||Object.getPrototypeOf(F.prototype),"format",this).call(this,T,L)}}},{key:"formatAt",value:function(T,L,$,q){if(L!==0&&!(g.default.query($,g.default.Scope.BLOCK)==null||$===this.statics.blotName&&q===this.statics.formats(this.domNode))){var J=this.newlineIndex(T);if(!(J<0||J>=T+L)){var ae=this.newlineIndex(T,!0)+1,ie=J-ae+1,Z=this.isolate(ae,ie),te=Z.next;Z.format($,q),te instanceof F&&te.formatAt(0,T-ae+L-ie,$,q)}}}},{key:"insertAt",value:function(T,L,$){if($==null){var q=this.descendant(b.default,T),J=a(q,2),ae=J[0],ie=J[1];ae.insertAt(ie,L)}}},{key:"length",value:function(){var T=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
127
+ `)?T:T+1}},{key:"newlineIndex",value:function(T){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(L)return this.domNode.textContent.slice(0,T).lastIndexOf(`
128
+ `);var $=this.domNode.textContent.slice(T).indexOf(`
129
+ `);return $>-1?T+$:-1}},{key:"optimize",value:function(T){this.domNode.textContent.endsWith(`
130
+ `)||this.appendChild(g.default.create("text",`
131
+ `)),s(F.prototype.__proto__||Object.getPrototypeOf(F.prototype),"optimize",this).call(this,T);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(T),L.moveChildren(this),L.remove())}},{key:"replace",value:function(T){s(F.prototype.__proto__||Object.getPrototypeOf(F.prototype),"replace",this).call(this,T),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(L){var $=g.default.find(L);$==null?L.parentNode.removeChild(L):$ instanceof g.default.Embed?$.remove():$.unwrap()})}}],[{key:"create",value:function(T){var L=s(F.__proto__||Object.getPrototypeOf(F),"create",this).call(this,T);return L.setAttribute("spellcheck",!1),L}},{key:"formats",value:function(){return!0}}]),F})(p.default);O.blotName="code-block",O.tagName="PRE",O.TAB=" ",r.Code=I,r.default=O}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(te){return typeof te}:function(te){return te&&typeof Symbol=="function"&&te.constructor===Symbol&&te!==Symbol.prototype?"symbol":typeof te},o=(function(){function te(V,B){var D=[],U=!0,X=!1,ee=void 0;try{for(var K=V[Symbol.iterator](),oe;!(U=(oe=K.next()).done)&&(D.push(oe.value),!(B&&D.length===B));U=!0);}catch(me){X=!0,ee=me}finally{try{!U&&K.return&&K.return()}finally{if(X)throw ee}}return D}return function(V,B){if(Array.isArray(V))return V;if(Symbol.iterator in Object(V))return te(V,B);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),s=(function(){function te(V,B){for(var D=0;D<B.length;D++){var U=B[D];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(V,U.key,U)}}return function(V,B,D){return B&&te(V.prototype,B),D&&te(V,D),V}})(),u=i(2),h=L(u),f=i(20),g=L(f),v=i(0),p=L(v),y=i(13),_=L(y),x=i(24),b=L(x),E=i(4),A=L(E),S=i(16),k=L(S),I=i(21),O=L(I),M=i(11),F=L(M),j=i(3),T=L(j);function L(te){return te&&te.__esModule?te:{default:te}}function $(te,V,B){return V in te?Object.defineProperty(te,V,{value:B,enumerable:!0,configurable:!0,writable:!0}):te[V]=B,te}function q(te,V){if(!(te instanceof V))throw new TypeError("Cannot call a class as a function")}var J=/^[ -~]*$/,ae=(function(){function te(V){q(this,te),this.scroll=V,this.delta=this.getDelta()}return s(te,[{key:"applyDelta",value:function(B){var D=this,U=!1;this.scroll.update();var X=this.scroll.length();return this.scroll.batchStart(),B=Z(B),B.reduce(function(ee,K){var oe=K.retain||K.delete||K.insert.length||1,me=K.attributes||{};if(K.insert!=null){if(typeof K.insert=="string"){var de=K.insert;de.endsWith(`
132
+ `)&&U&&(U=!1,de=de.slice(0,-1)),ee>=X&&!de.endsWith(`
133
+ `)&&(U=!0),D.scroll.insertAt(ee,de);var ye=D.scroll.line(ee),Re=o(ye,2),Oe=Re[0],Me=Re[1],Ee=(0,T.default)({},(0,E.bubbleFormats)(Oe));if(Oe instanceof A.default){var ge=Oe.descendant(p.default.Leaf,Me),Te=o(ge,1),Be=Te[0];Ee=(0,T.default)(Ee,(0,E.bubbleFormats)(Be))}me=g.default.attributes.diff(Ee,me)||{}}else if(a(K.insert)==="object"){var Ce=Object.keys(K.insert)[0];if(Ce==null)return ee;D.scroll.insertAt(ee,Ce,K.insert[Ce])}X+=oe}return Object.keys(me).forEach(function(fe){D.scroll.formatAt(ee,oe,fe,me[fe])}),ee+oe},0),B.reduce(function(ee,K){return typeof K.delete=="number"?(D.scroll.deleteAt(ee,K.delete),ee):ee+(K.retain||K.insert.length||1)},0),this.scroll.batchEnd(),this.update(B)}},{key:"deleteText",value:function(B,D){return this.scroll.deleteAt(B,D),this.update(new h.default().retain(B).delete(D))}},{key:"formatLine",value:function(B,D){var U=this,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(X).forEach(function(ee){if(!(U.scroll.whitelist!=null&&!U.scroll.whitelist[ee])){var K=U.scroll.lines(B,Math.max(D,1)),oe=D;K.forEach(function(me){var de=me.length();if(!(me instanceof _.default))me.format(ee,X[ee]);else{var ye=B-me.offset(U.scroll),Re=me.newlineIndex(ye+oe)-ye+1;me.formatAt(ye,Re,ee,X[ee])}oe-=de})}}),this.scroll.optimize(),this.update(new h.default().retain(B).retain(D,(0,O.default)(X)))}},{key:"formatText",value:function(B,D){var U=this,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(X).forEach(function(ee){U.scroll.formatAt(B,D,ee,X[ee])}),this.update(new h.default().retain(B).retain(D,(0,O.default)(X)))}},{key:"getContents",value:function(B,D){return this.delta.slice(B,B+D)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(B,D){return B.concat(D.delta())},new h.default)}},{key:"getFormat",value:function(B){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,U=[],X=[];D===0?this.scroll.path(B).forEach(function(K){var oe=o(K,1),me=oe[0];me instanceof A.default?U.push(me):me instanceof p.default.Leaf&&X.push(me)}):(U=this.scroll.lines(B,D),X=this.scroll.descendants(p.default.Leaf,B,D));var ee=[U,X].map(function(K){if(K.length===0)return{};for(var oe=(0,E.bubbleFormats)(K.shift());Object.keys(oe).length>0;){var me=K.shift();if(me==null)return oe;oe=ie((0,E.bubbleFormats)(me),oe)}return oe});return T.default.apply(T.default,ee)}},{key:"getText",value:function(B,D){return this.getContents(B,D).filter(function(U){return typeof U.insert=="string"}).map(function(U){return U.insert}).join("")}},{key:"insertEmbed",value:function(B,D,U){return this.scroll.insertAt(B,D,U),this.update(new h.default().retain(B).insert($({},D,U)))}},{key:"insertText",value:function(B,D){var U=this,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return D=D.replace(/\r\n/g,`
134
+ `).replace(/\r/g,`
135
+ `),this.scroll.insertAt(B,D),Object.keys(X).forEach(function(ee){U.scroll.formatAt(B,D.length,ee,X[ee])}),this.update(new h.default().retain(B).insert(D,(0,O.default)(X)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var B=this.scroll.children.head;return B.statics.blotName!==A.default.blotName||B.children.length>1?!1:B.children.head instanceof k.default}},{key:"removeFormat",value:function(B,D){var U=this.getText(B,D),X=this.scroll.line(B+D),ee=o(X,2),K=ee[0],oe=ee[1],me=0,de=new h.default;K!=null&&(K instanceof _.default?me=K.newlineIndex(oe)-oe+1:me=K.length()-oe,de=K.delta().slice(oe,oe+me-1).insert(`
136
+ `));var ye=this.getContents(B,D+me),Re=ye.diff(new h.default().insert(U).concat(de)),Oe=new h.default().retain(B).concat(Re);return this.applyDelta(Oe)}},{key:"update",value:function(B){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,X=this.delta;if(D.length===1&&D[0].type==="characterData"&&D[0].target.data.match(J)&&p.default.find(D[0].target)){var ee=p.default.find(D[0].target),K=(0,E.bubbleFormats)(ee),oe=ee.offset(this.scroll),me=D[0].oldValue.replace(b.default.CONTENTS,""),de=new h.default().insert(me),ye=new h.default().insert(ee.value()),Re=new h.default().retain(oe).concat(de.diff(ye,U));B=Re.reduce(function(Oe,Me){return Me.insert?Oe.insert(Me.insert,K):Oe.push(Me)},new h.default),this.delta=X.compose(B)}else this.delta=this.getDelta(),(!B||!(0,F.default)(X.compose(B),this.delta))&&(B=X.diff(this.delta,U));return B}}]),te})();function ie(te,V){return Object.keys(V).reduce(function(B,D){return te[D]==null||(V[D]===te[D]?B[D]=V[D]:Array.isArray(V[D])?V[D].indexOf(te[D])<0&&(B[D]=V[D].concat([te[D]])):B[D]=[V[D],te[D]]),B},{})}function Z(te){return te.reduce(function(V,B){if(B.insert===1){var D=(0,O.default)(B.attributes);return delete D.image,V.insert({image:B.attributes.image},D)}if(B.attributes!=null&&(B.attributes.list===!0||B.attributes.bullet===!0)&&(B=(0,O.default)(B),B.attributes.list?B.attributes.list="ordered":(B.attributes.list="bullet",delete B.attributes.bullet)),typeof B.insert=="string"){var U=B.insert.replace(/\r\n/g,`
137
+ `).replace(/\r/g,`
138
+ `);return V.insert(U,B.attributes)}return V.push(B)},new h.default)}r.default=ae}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.Range=void 0;var a=(function(){function M(F,j){var T=[],L=!0,$=!1,q=void 0;try{for(var J=F[Symbol.iterator](),ae;!(L=(ae=J.next()).done)&&(T.push(ae.value),!(j&&T.length===j));L=!0);}catch(ie){$=!0,q=ie}finally{try{!L&&J.return&&J.return()}finally{if($)throw q}}return T}return function(F,j){if(Array.isArray(F))return F;if(Symbol.iterator in Object(F))return M(F,j);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=(function(){function M(F,j){for(var T=0;T<j.length;T++){var L=j[T];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(F,L.key,L)}}return function(F,j,T){return j&&M(F.prototype,j),T&&M(F,T),F}})(),s=i(0),u=b(s),h=i(21),f=b(h),g=i(11),v=b(g),p=i(8),y=b(p),_=i(10),x=b(_);function b(M){return M&&M.__esModule?M:{default:M}}function E(M){if(Array.isArray(M)){for(var F=0,j=Array(M.length);F<M.length;F++)j[F]=M[F];return j}else return Array.from(M)}function A(M,F){if(!(M instanceof F))throw new TypeError("Cannot call a class as a function")}var S=(0,x.default)("quill:selection"),k=function M(F){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;A(this,M),this.index=F,this.length=j},I=(function(){function M(F,j){var T=this;A(this,M),this.emitter=j,this.scroll=F,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=u.default.create("cursor",this),this.lastRange=this.savedRange=new k(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){T.mouseDown||setTimeout(T.update.bind(T,y.default.sources.USER),1)}),this.emitter.on(y.default.events.EDITOR_CHANGE,function(L,$){L===y.default.events.TEXT_CHANGE&&$.length()>0&&T.update(y.default.sources.SILENT)}),this.emitter.on(y.default.events.SCROLL_BEFORE_UPDATE,function(){if(T.hasFocus()){var L=T.getNativeRange();L!=null&&L.start.node!==T.cursor.textNode&&T.emitter.once(y.default.events.SCROLL_UPDATE,function(){try{T.setNativeRange(L.start.node,L.start.offset,L.end.node,L.end.offset)}catch{}})}}),this.emitter.on(y.default.events.SCROLL_OPTIMIZE,function(L,$){if($.range){var q=$.range,J=q.startNode,ae=q.startOffset,ie=q.endNode,Z=q.endOffset;T.setNativeRange(J,ae,ie,Z)}}),this.update(y.default.sources.SILENT)}return o(M,[{key:"handleComposition",value:function(){var j=this;this.root.addEventListener("compositionstart",function(){j.composing=!0}),this.root.addEventListener("compositionend",function(){if(j.composing=!1,j.cursor.parent){var T=j.cursor.restore();if(!T)return;setTimeout(function(){j.setNativeRange(T.startNode,T.startOffset,T.endNode,T.endOffset)},1)}})}},{key:"handleDragging",value:function(){var j=this;this.emitter.listenDOM("mousedown",document.body,function(){j.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){j.mouseDown=!1,j.update(y.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(j,T){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[j])){this.scroll.update();var L=this.getNativeRange();if(!(L==null||!L.native.collapsed||u.default.query(j,u.default.Scope.BLOCK))){if(L.start.node!==this.cursor.textNode){var $=u.default.find(L.start.node,!1);if($==null)return;if($ instanceof u.default.Leaf){var q=$.split(L.start.offset);$.parent.insertBefore(this.cursor,q)}else $.insertBefore(this.cursor,L.start.node);this.cursor.attach()}this.cursor.format(j,T),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(j){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,L=this.scroll.length();j=Math.min(j,L-1),T=Math.min(j+T,L-1)-j;var $=void 0,q=this.scroll.leaf(j),J=a(q,2),ae=J[0],ie=J[1];if(ae==null)return null;var Z=ae.position(ie,!0),te=a(Z,2);$=te[0],ie=te[1];var V=document.createRange();if(T>0){V.setStart($,ie);var B=this.scroll.leaf(j+T),D=a(B,2);if(ae=D[0],ie=D[1],ae==null)return null;var U=ae.position(ie,!0),X=a(U,2);return $=X[0],ie=X[1],V.setEnd($,ie),V.getBoundingClientRect()}else{var ee="left",K=void 0;return $ instanceof Text?(ie<$.data.length?(V.setStart($,ie),V.setEnd($,ie+1)):(V.setStart($,ie-1),V.setEnd($,ie),ee="right"),K=V.getBoundingClientRect()):(K=ae.domNode.getBoundingClientRect(),ie>0&&(ee="right")),{bottom:K.top+K.height,height:K.height,left:K[ee],right:K[ee],top:K.top,width:0}}}},{key:"getNativeRange",value:function(){var j=document.getSelection();if(j==null||j.rangeCount<=0)return null;var T=j.getRangeAt(0);if(T==null)return null;var L=this.normalizeNative(T);return S.info("getNativeRange",L),L}},{key:"getRange",value:function(){var j=this.getNativeRange();if(j==null)return[null,null];var T=this.normalizedToRange(j);return[T,j]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(j){var T=this,L=[[j.start.node,j.start.offset]];j.native.collapsed||L.push([j.end.node,j.end.offset]);var $=L.map(function(ae){var ie=a(ae,2),Z=ie[0],te=ie[1],V=u.default.find(Z,!0),B=V.offset(T.scroll);return te===0?B:V instanceof u.default.Container?B+V.length():B+V.index(Z,te)}),q=Math.min(Math.max.apply(Math,E($)),this.scroll.length()-1),J=Math.min.apply(Math,[q].concat(E($)));return new k(J,q-J)}},{key:"normalizeNative",value:function(j){if(!O(this.root,j.startContainer)||!j.collapsed&&!O(this.root,j.endContainer))return null;var T={start:{node:j.startContainer,offset:j.startOffset},end:{node:j.endContainer,offset:j.endOffset},native:j};return[T.start,T.end].forEach(function(L){for(var $=L.node,q=L.offset;!($ instanceof Text)&&$.childNodes.length>0;)if($.childNodes.length>q)$=$.childNodes[q],q=0;else if($.childNodes.length===q)$=$.lastChild,q=$ instanceof Text?$.data.length:$.childNodes.length+1;else break;L.node=$,L.offset=q}),T}},{key:"rangeToNative",value:function(j){var T=this,L=j.collapsed?[j.index]:[j.index,j.index+j.length],$=[],q=this.scroll.length();return L.forEach(function(J,ae){J=Math.min(q-1,J);var ie=void 0,Z=T.scroll.leaf(J),te=a(Z,2),V=te[0],B=te[1],D=V.position(B,ae!==0),U=a(D,2);ie=U[0],B=U[1],$.push(ie,B)}),$.length<2&&($=$.concat($)),$}},{key:"scrollIntoView",value:function(j){var T=this.lastRange;if(T!=null){var L=this.getBounds(T.index,T.length);if(L!=null){var $=this.scroll.length()-1,q=this.scroll.line(Math.min(T.index,$)),J=a(q,1),ae=J[0],ie=ae;if(T.length>0){var Z=this.scroll.line(Math.min(T.index+T.length,$)),te=a(Z,1);ie=te[0]}if(!(ae==null||ie==null)){var V=j.getBoundingClientRect();L.top<V.top?j.scrollTop-=V.top-L.top:L.bottom>V.bottom&&(j.scrollTop+=L.bottom-V.bottom)}}}}},{key:"setNativeRange",value:function(j,T){var L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:j,$=arguments.length>3&&arguments[3]!==void 0?arguments[3]:T,q=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(S.info("setNativeRange",j,T,L,$),!(j!=null&&(this.root.parentNode==null||j.parentNode==null||L.parentNode==null))){var J=document.getSelection();if(J!=null)if(j!=null){this.hasFocus()||this.root.focus();var ae=(this.getNativeRange()||{}).native;if(ae==null||q||j!==ae.startContainer||T!==ae.startOffset||L!==ae.endContainer||$!==ae.endOffset){j.tagName=="BR"&&(T=[].indexOf.call(j.parentNode.childNodes,j),j=j.parentNode),L.tagName=="BR"&&($=[].indexOf.call(L.parentNode.childNodes,L),L=L.parentNode);var ie=document.createRange();ie.setStart(j,T),ie.setEnd(L,$),J.removeAllRanges(),J.addRange(ie)}}else J.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(j){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:y.default.sources.API;if(typeof T=="string"&&(L=T,T=!1),S.info("setRange",j),j!=null){var $=this.rangeToNative(j);this.setNativeRange.apply(this,E($).concat([T]))}else this.setNativeRange(null);this.update(L)}},{key:"update",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y.default.sources.USER,T=this.lastRange,L=this.getRange(),$=a(L,2),q=$[0],J=$[1];if(this.lastRange=q,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,v.default)(T,this.lastRange)){var ae;!this.composing&&J!=null&&J.native.collapsed&&J.start.node!==this.cursor.textNode&&this.cursor.restore();var ie=[y.default.events.SELECTION_CHANGE,(0,f.default)(this.lastRange),(0,f.default)(T),j];if((ae=this.emitter).emit.apply(ae,[y.default.events.EDITOR_CHANGE].concat(ie)),j!==y.default.sources.SILENT){var Z;(Z=this.emitter).emit.apply(Z,ie)}}}}]),M})();function O(M,F){try{F.parentNode}catch{return!1}return F instanceof Text&&(F=F.parentNode),M.contains(F)}r.Range=k,r.default=I}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function y(_,x){for(var b=0;b<x.length;b++){var E=x[b];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(_,E.key,E)}}return function(_,x,b){return x&&y(_.prototype,x),b&&y(_,b),_}})(),o=function y(_,x,b){_===null&&(_=Function.prototype);var E=Object.getOwnPropertyDescriptor(_,x);if(E===void 0){var A=Object.getPrototypeOf(_);return A===null?void 0:y(A,x,b)}else{if("value"in E)return E.value;var S=E.get;return S===void 0?void 0:S.call(b)}},s=i(0),u=h(s);function h(y){return y&&y.__esModule?y:{default:y}}function f(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function g(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function v(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var p=(function(y){v(_,y);function _(){return f(this,_),g(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,[{key:"insertInto",value:function(b,E){b.children.length===0?o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"insertInto",this).call(this,b,E):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),_})(u.default.Embed);p.blotName="break",p.tagName="BR",r.default=p}),(function(n,r,i){var a=this&&this.__extends||(function(){var g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,p){v.__proto__=p}||function(v,p){for(var y in p)p.hasOwnProperty(y)&&(v[y]=p[y])};return function(v,p){g(v,p);function y(){this.constructor=v}v.prototype=p===null?Object.create(p):(y.prototype=p.prototype,new y)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=i(44),s=i(30),u=i(1),h=(function(g){a(v,g);function v(p){var y=g.call(this,p)||this;return y.build(),y}return v.prototype.appendChild=function(p){this.insertBefore(p)},v.prototype.attach=function(){g.prototype.attach.call(this),this.children.forEach(function(p){p.attach()})},v.prototype.build=function(){var p=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(y){try{var _=f(y);p.insertBefore(_,p.children.head||void 0)}catch(x){if(x instanceof u.ParchmentError)return;throw x}})},v.prototype.deleteAt=function(p,y){if(p===0&&y===this.length())return this.remove();this.children.forEachAt(p,y,function(_,x,b){_.deleteAt(x,b)})},v.prototype.descendant=function(p,y){var _=this.children.find(y),x=_[0],b=_[1];return p.blotName==null&&p(x)||p.blotName!=null&&x instanceof p?[x,b]:x instanceof v?x.descendant(p,b):[null,-1]},v.prototype.descendants=function(p,y,_){y===void 0&&(y=0),_===void 0&&(_=Number.MAX_VALUE);var x=[],b=_;return this.children.forEachAt(y,_,function(E,A,S){(p.blotName==null&&p(E)||p.blotName!=null&&E instanceof p)&&x.push(E),E instanceof v&&(x=x.concat(E.descendants(p,A,b))),b-=S}),x},v.prototype.detach=function(){this.children.forEach(function(p){p.detach()}),g.prototype.detach.call(this)},v.prototype.formatAt=function(p,y,_,x){this.children.forEachAt(p,y,function(b,E,A){b.formatAt(E,A,_,x)})},v.prototype.insertAt=function(p,y,_){var x=this.children.find(p),b=x[0],E=x[1];if(b)b.insertAt(E,y,_);else{var A=_==null?u.create("text",y):u.create(y,_);this.appendChild(A)}},v.prototype.insertBefore=function(p,y){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(_){return p instanceof _}))throw new u.ParchmentError("Cannot insert "+p.statics.blotName+" into "+this.statics.blotName);p.insertInto(this,y)},v.prototype.length=function(){return this.children.reduce(function(p,y){return p+y.length()},0)},v.prototype.moveChildren=function(p,y){this.children.forEach(function(_){p.insertBefore(_,y)})},v.prototype.optimize=function(p){if(g.prototype.optimize.call(this,p),this.children.length===0)if(this.statics.defaultChild!=null){var y=u.create(this.statics.defaultChild);this.appendChild(y),y.optimize(p)}else this.remove()},v.prototype.path=function(p,y){y===void 0&&(y=!1);var _=this.children.find(p,y),x=_[0],b=_[1],E=[[this,p]];return x instanceof v?E.concat(x.path(b,y)):(x!=null&&E.push([x,b]),E)},v.prototype.removeChild=function(p){this.children.remove(p)},v.prototype.replace=function(p){p instanceof v&&p.moveChildren(this),g.prototype.replace.call(this,p)},v.prototype.split=function(p,y){if(y===void 0&&(y=!1),!y){if(p===0)return this;if(p===this.length())return this.next}var _=this.clone();return this.parent.insertBefore(_,this.next),this.children.forEachAt(p,this.length(),function(x,b,E){x=x.split(b,y),_.appendChild(x)}),_},v.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},v.prototype.update=function(p,y){var _=this,x=[],b=[];p.forEach(function(E){E.target===_.domNode&&E.type==="childList"&&(x.push.apply(x,E.addedNodes),b.push.apply(b,E.removedNodes))}),b.forEach(function(E){if(!(E.parentNode!=null&&E.tagName!=="IFRAME"&&document.body.compareDocumentPosition(E)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var A=u.find(E);A!=null&&(A.domNode.parentNode==null||A.domNode.parentNode===_.domNode)&&A.detach()}}),x.filter(function(E){return E.parentNode==_.domNode}).sort(function(E,A){return E===A?0:E.compareDocumentPosition(A)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(E){var A=null;E.nextSibling!=null&&(A=u.find(E.nextSibling));var S=f(E);(S.next!=A||S.next==null)&&(S.parent!=null&&S.parent.removeChild(_),_.insertBefore(S,A||void 0))})},v})(s.default);function f(g){var v=u.find(g);if(v==null)try{v=u.create(g)}catch{v=u.create(u.Scope.INLINE),[].slice.call(g.childNodes).forEach(function(y){v.domNode.appendChild(y)}),g.parentNode&&g.parentNode.replaceChild(v.domNode,g),v.attach()}return v}r.default=h}),(function(n,r,i){var a=this&&this.__extends||(function(){var g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,p){v.__proto__=p}||function(v,p){for(var y in p)p.hasOwnProperty(y)&&(v[y]=p[y])};return function(v,p){g(v,p);function y(){this.constructor=v}v.prototype=p===null?Object.create(p):(y.prototype=p.prototype,new y)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=i(12),s=i(31),u=i(17),h=i(1),f=(function(g){a(v,g);function v(p){var y=g.call(this,p)||this;return y.attributes=new s.default(y.domNode),y}return v.formats=function(p){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return p.tagName.toLowerCase()},v.prototype.format=function(p,y){var _=h.query(p);_ instanceof o.default?this.attributes.attribute(_,y):y&&_!=null&&(p!==this.statics.blotName||this.formats()[p]!==y)&&this.replaceWith(p,y)},v.prototype.formats=function(){var p=this.attributes.values(),y=this.statics.formats(this.domNode);return y!=null&&(p[this.statics.blotName]=y),p},v.prototype.replaceWith=function(p,y){var _=g.prototype.replaceWith.call(this,p,y);return this.attributes.copy(_),_},v.prototype.update=function(p,y){var _=this;g.prototype.update.call(this,p,y),p.some(function(x){return x.target===_.domNode&&x.type==="attributes"})&&this.attributes.build()},v.prototype.wrap=function(p,y){var _=g.prototype.wrap.call(this,p,y);return _ instanceof v&&_.statics.scope===this.statics.scope&&this.attributes.move(_),_},v})(u.default);r.default=f}),(function(n,r,i){var a=this&&this.__extends||(function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,g){f.__proto__=g}||function(f,g){for(var v in g)g.hasOwnProperty(v)&&(f[v]=g[v])};return function(f,g){h(f,g);function v(){this.constructor=f}f.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=i(30),s=i(1),u=(function(h){a(f,h);function f(){return h!==null&&h.apply(this,arguments)||this}return f.value=function(g){return!0},f.prototype.index=function(g,v){return this.domNode===g||this.domNode.compareDocumentPosition(g)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(v,1):-1},f.prototype.position=function(g,v){var p=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return g>0&&(p+=1),[this.parent.domNode,p]},f.prototype.value=function(){var g;return g={},g[this.statics.blotName]=this.statics.value(this.domNode)||!0,g},f.scope=s.Scope.INLINE_BLOT,f})(o.default);r.default=u}),(function(n,r,i){var a=i(11),o=i(3),s={attributes:{compose:function(h,f,g){typeof h!="object"&&(h={}),typeof f!="object"&&(f={});var v=o(!0,{},f);g||(v=Object.keys(v).reduce(function(y,_){return v[_]!=null&&(y[_]=v[_]),y},{}));for(var p in h)h[p]!==void 0&&f[p]===void 0&&(v[p]=h[p]);return Object.keys(v).length>0?v:void 0},diff:function(h,f){typeof h!="object"&&(h={}),typeof f!="object"&&(f={});var g=Object.keys(h).concat(Object.keys(f)).reduce(function(v,p){return a(h[p],f[p])||(v[p]=f[p]===void 0?null:f[p]),v},{});return Object.keys(g).length>0?g:void 0},transform:function(h,f,g){if(typeof h!="object")return f;if(typeof f=="object"){if(!g)return f;var v=Object.keys(f).reduce(function(p,y){return h[y]===void 0&&(p[y]=f[y]),p},{});return Object.keys(v).length>0?v:void 0}}},iterator:function(h){return new u(h)},length:function(h){return typeof h.delete=="number"?h.delete:typeof h.retain=="number"?h.retain:typeof h.insert=="string"?h.insert.length:1}};function u(h){this.ops=h,this.index=0,this.offset=0}u.prototype.hasNext=function(){return this.peekLength()<1/0},u.prototype.next=function(h){h||(h=1/0);var f=this.ops[this.index];if(f){var g=this.offset,v=s.length(f);if(h>=v-g?(h=v-g,this.index+=1,this.offset=0):this.offset+=h,typeof f.delete=="number")return{delete:h};var p={};return f.attributes&&(p.attributes=f.attributes),typeof f.retain=="number"?p.retain=h:typeof f.insert=="string"?p.insert=f.insert.substr(g,h):p.insert=f.insert,p}else return{retain:1/0}},u.prototype.peek=function(){return this.ops[this.index]},u.prototype.peekLength=function(){return this.ops[this.index]?s.length(this.ops[this.index])-this.offset:1/0},u.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},u.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var h=this.offset,f=this.index,g=this.next(),v=this.ops.slice(this.index);return this.offset=h,this.index=f,[g].concat(v)}else return[]},n.exports=s}),(function(n,r){var i=(function(){function a(_,x){return x!=null&&_ instanceof x}var o;try{o=Map}catch{o=function(){}}var s;try{s=Set}catch{s=function(){}}var u;try{u=Promise}catch{u=function(){}}function h(_,x,b,E,A){typeof x=="object"&&(b=x.depth,E=x.prototype,A=x.includeNonEnumerable,x=x.circular);var S=[],k=[],I=typeof Buffer<"u";typeof x>"u"&&(x=!0),typeof b>"u"&&(b=1/0);function O(M,F){if(M===null)return null;if(F===0)return M;var j,T;if(typeof M!="object")return M;if(a(M,o))j=new o;else if(a(M,s))j=new s;else if(a(M,u))j=new u(function(V,B){M.then(function(D){V(O(D,F-1))},function(D){B(O(D,F-1))})});else if(h.__isArray(M))j=[];else if(h.__isRegExp(M))j=new RegExp(M.source,y(M)),M.lastIndex&&(j.lastIndex=M.lastIndex);else if(h.__isDate(M))j=new Date(M.getTime());else{if(I&&Buffer.isBuffer(M))return Buffer.allocUnsafe?j=Buffer.allocUnsafe(M.length):j=new Buffer(M.length),M.copy(j),j;a(M,Error)?j=Object.create(M):typeof E>"u"?(T=Object.getPrototypeOf(M),j=Object.create(T)):(j=Object.create(E),T=E)}if(x){var L=S.indexOf(M);if(L!=-1)return k[L];S.push(M),k.push(j)}a(M,o)&&M.forEach(function(V,B){var D=O(B,F-1),U=O(V,F-1);j.set(D,U)}),a(M,s)&&M.forEach(function(V){var B=O(V,F-1);j.add(B)});for(var $ in M){var q;T&&(q=Object.getOwnPropertyDescriptor(T,$)),!(q&&q.set==null)&&(j[$]=O(M[$],F-1))}if(Object.getOwnPropertySymbols)for(var J=Object.getOwnPropertySymbols(M),$=0;$<J.length;$++){var ae=J[$],ie=Object.getOwnPropertyDescriptor(M,ae);ie&&!ie.enumerable&&!A||(j[ae]=O(M[ae],F-1),ie.enumerable||Object.defineProperty(j,ae,{enumerable:!1}))}if(A)for(var Z=Object.getOwnPropertyNames(M),$=0;$<Z.length;$++){var te=Z[$],ie=Object.getOwnPropertyDescriptor(M,te);ie&&ie.enumerable||(j[te]=O(M[te],F-1),Object.defineProperty(j,te,{enumerable:!1}))}return j}return O(_,b)}h.clonePrototype=function(x){if(x===null)return null;var b=function(){};return b.prototype=x,new b};function f(_){return Object.prototype.toString.call(_)}h.__objToStr=f;function g(_){return typeof _=="object"&&f(_)==="[object Date]"}h.__isDate=g;function v(_){return typeof _=="object"&&f(_)==="[object Array]"}h.__isArray=v;function p(_){return typeof _=="object"&&f(_)==="[object RegExp]"}h.__isRegExp=p;function y(_){var x="";return _.global&&(x+="g"),_.ignoreCase&&(x+="i"),_.multiline&&(x+="m"),x}return h.__getRegExpFlags=y,h})();typeof n=="object"&&n.exports&&(n.exports=i)}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function j(T,L){var $=[],q=!0,J=!1,ae=void 0;try{for(var ie=T[Symbol.iterator](),Z;!(q=(Z=ie.next()).done)&&($.push(Z.value),!(L&&$.length===L));q=!0);}catch(te){J=!0,ae=te}finally{try{!q&&ie.return&&ie.return()}finally{if(J)throw ae}}return $}return function(T,L){if(Array.isArray(T))return T;if(Symbol.iterator in Object(T))return j(T,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=(function(){function j(T,L){for(var $=0;$<L.length;$++){var q=L[$];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(T,q.key,q)}}return function(T,L,$){return L&&j(T.prototype,L),$&&j(T,$),T}})(),s=function j(T,L,$){T===null&&(T=Function.prototype);var q=Object.getOwnPropertyDescriptor(T,L);if(q===void 0){var J=Object.getPrototypeOf(T);return J===null?void 0:j(J,L,$)}else{if("value"in q)return q.value;var ae=q.get;return ae===void 0?void 0:ae.call($)}},u=i(0),h=S(u),f=i(8),g=S(f),v=i(4),p=S(v),y=i(16),_=S(y),x=i(13),b=S(x),E=i(25),A=S(E);function S(j){return j&&j.__esModule?j:{default:j}}function k(j,T){if(!(j instanceof T))throw new TypeError("Cannot call a class as a function")}function I(j,T){if(!j)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:j}function O(j,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);j.prototype=Object.create(T&&T.prototype,{constructor:{value:j,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(j,T):j.__proto__=T)}function M(j){return j instanceof p.default||j instanceof v.BlockEmbed}var F=(function(j){O(T,j);function T(L,$){k(this,T);var q=I(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,L));return q.emitter=$.emitter,Array.isArray($.whitelist)&&(q.whitelist=$.whitelist.reduce(function(J,ae){return J[ae]=!0,J},{})),q.domNode.addEventListener("DOMNodeInserted",function(){}),q.optimize(),q.enable(),q}return o(T,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function($,q){var J=this.line($),ae=a(J,2),ie=ae[0],Z=ae[1],te=this.line($+q),V=a(te,1),B=V[0];if(s(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"deleteAt",this).call(this,$,q),B!=null&&ie!==B&&Z>0){if(ie instanceof v.BlockEmbed||B instanceof v.BlockEmbed){this.optimize();return}if(ie instanceof b.default){var D=ie.newlineIndex(ie.length(),!0);if(D>-1&&(ie=ie.split(D+1),ie===B)){this.optimize();return}}else if(B instanceof b.default){var U=B.newlineIndex(0);U>-1&&B.split(U+1)}var X=B.children.head instanceof _.default?null:B.children.head;ie.moveChildren(B,X),ie.remove()}this.optimize()}},{key:"enable",value:function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",$)}},{key:"formatAt",value:function($,q,J,ae){this.whitelist!=null&&!this.whitelist[J]||(s(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"formatAt",this).call(this,$,q,J,ae),this.optimize())}},{key:"insertAt",value:function($,q,J){if(!(J!=null&&this.whitelist!=null&&!this.whitelist[q])){if($>=this.length())if(J==null||h.default.query(q,h.default.Scope.BLOCK)==null){var ae=h.default.create(this.statics.defaultChild);this.appendChild(ae),J==null&&q.endsWith(`
139
+ `)&&(q=q.slice(0,-1)),ae.insertAt(0,q,J)}else{var ie=h.default.create(q,J);this.appendChild(ie)}else s(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"insertAt",this).call(this,$,q,J);this.optimize()}}},{key:"insertBefore",value:function($,q){if($.statics.scope===h.default.Scope.INLINE_BLOT){var J=h.default.create(this.statics.defaultChild);J.appendChild($),$=J}s(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"insertBefore",this).call(this,$,q)}},{key:"leaf",value:function($){return this.path($).pop()||[null,-1]}},{key:"line",value:function($){return $===this.length()?this.line($-1):this.descendant(M,$)}},{key:"lines",value:function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,J=function ae(ie,Z,te){var V=[],B=te;return ie.children.forEachAt(Z,te,function(D,U,X){M(D)?V.push(D):D instanceof h.default.Container&&(V=V.concat(ae(D,U,B))),B-=X}),V};return J(this,$,q)}},{key:"optimize",value:function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(s(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"optimize",this).call(this,$,q),$.length>0&&this.emitter.emit(g.default.events.SCROLL_OPTIMIZE,$,q))}},{key:"path",value:function($){return s(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"path",this).call(this,$).slice(1)}},{key:"update",value:function($){if(this.batch!==!0){var q=g.default.sources.USER;typeof $=="string"&&(q=$),Array.isArray($)||($=this.observer.takeRecords()),$.length>0&&this.emitter.emit(g.default.events.SCROLL_BEFORE_UPDATE,q,$),s(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"update",this).call(this,$.concat([])),$.length>0&&this.emitter.emit(g.default.events.SCROLL_UPDATE,q,$)}}}]),T})(h.default.Scroll);F.blotName="scroll",F.className="ql-editor",F.tagName="DIV",F.defaultChild="block",F.allowedChildren=[p.default,v.BlockEmbed,A.default],r.default=F}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.SHORTKEY=r.default=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(K){return typeof K}:function(K){return K&&typeof Symbol=="function"&&K.constructor===Symbol&&K!==Symbol.prototype?"symbol":typeof K},o=(function(){function K(oe,me){var de=[],ye=!0,Re=!1,Oe=void 0;try{for(var Me=oe[Symbol.iterator](),Ee;!(ye=(Ee=Me.next()).done)&&(de.push(Ee.value),!(me&&de.length===me));ye=!0);}catch(ge){Re=!0,Oe=ge}finally{try{!ye&&Me.return&&Me.return()}finally{if(Re)throw Oe}}return de}return function(oe,me){if(Array.isArray(oe))return oe;if(Symbol.iterator in Object(oe))return K(oe,me);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),s=(function(){function K(oe,me){for(var de=0;de<me.length;de++){var ye=me[de];ye.enumerable=ye.enumerable||!1,ye.configurable=!0,"value"in ye&&(ye.writable=!0),Object.defineProperty(oe,ye.key,ye)}}return function(oe,me,de){return me&&K(oe.prototype,me),de&&K(oe,de),oe}})(),u=i(21),h=j(u),f=i(11),g=j(f),v=i(3),p=j(v),y=i(2),_=j(y),x=i(20),b=j(x),E=i(0),A=j(E),S=i(5),k=j(S),I=i(10),O=j(I),M=i(9),F=j(M);function j(K){return K&&K.__esModule?K:{default:K}}function T(K,oe,me){return oe in K?Object.defineProperty(K,oe,{value:me,enumerable:!0,configurable:!0,writable:!0}):K[oe]=me,K}function L(K,oe){if(!(K instanceof oe))throw new TypeError("Cannot call a class as a function")}function $(K,oe){if(!K)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return oe&&(typeof oe=="object"||typeof oe=="function")?oe:K}function q(K,oe){if(typeof oe!="function"&&oe!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof oe);K.prototype=Object.create(oe&&oe.prototype,{constructor:{value:K,enumerable:!1,writable:!0,configurable:!0}}),oe&&(Object.setPrototypeOf?Object.setPrototypeOf(K,oe):K.__proto__=oe)}var J=(0,O.default)("quill:keyboard"),ae=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",ie=(function(K){q(oe,K),s(oe,null,[{key:"match",value:function(de,ye){return ye=ee(ye),["altKey","ctrlKey","metaKey","shiftKey"].some(function(Re){return!!ye[Re]!==de[Re]&&ye[Re]!==null})?!1:ye.key===(de.which||de.keyCode)}}]);function oe(me,de){L(this,oe);var ye=$(this,(oe.__proto__||Object.getPrototypeOf(oe)).call(this,me,de));return ye.bindings={},Object.keys(ye.options.bindings).forEach(function(Re){Re==="list autofill"&&me.scroll.whitelist!=null&&!me.scroll.whitelist.list||ye.options.bindings[Re]&&ye.addBinding(ye.options.bindings[Re])}),ye.addBinding({key:oe.keys.ENTER,shiftKey:null},D),ye.addBinding({key:oe.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(ye.addBinding({key:oe.keys.BACKSPACE},{collapsed:!0},te),ye.addBinding({key:oe.keys.DELETE},{collapsed:!0},V)):(ye.addBinding({key:oe.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},te),ye.addBinding({key:oe.keys.DELETE},{collapsed:!0,suffix:/^.?$/},V)),ye.addBinding({key:oe.keys.BACKSPACE},{collapsed:!1},B),ye.addBinding({key:oe.keys.DELETE},{collapsed:!1},B),ye.addBinding({key:oe.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},te),ye.listen(),ye}return s(oe,[{key:"addBinding",value:function(de){var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Oe=ee(de);if(Oe==null||Oe.key==null)return J.warn("Attempted to add invalid keyboard binding",Oe);typeof ye=="function"&&(ye={handler:ye}),typeof Re=="function"&&(Re={handler:Re}),Oe=(0,p.default)(Oe,ye,Re),this.bindings[Oe.key]=this.bindings[Oe.key]||[],this.bindings[Oe.key].push(Oe)}},{key:"listen",value:function(){var de=this;this.quill.root.addEventListener("keydown",function(ye){if(!ye.defaultPrevented){var Re=ye.which||ye.keyCode,Oe=(de.bindings[Re]||[]).filter(function(bt){return oe.match(ye,bt)});if(Oe.length!==0){var Me=de.quill.getSelection();if(!(Me==null||!de.quill.hasFocus())){var Ee=de.quill.getLine(Me.index),ge=o(Ee,2),Te=ge[0],Be=ge[1],Ce=de.quill.getLeaf(Me.index),fe=o(Ce,2),Le=fe[0],Ne=fe[1],ue=Me.length===0?[Le,Ne]:de.quill.getLeaf(Me.index+Me.length),Ae=o(ue,2),Pe=Ae[0],Ue=Ae[1],st=Le instanceof A.default.Text?Le.value().slice(0,Ne):"",dt=Pe instanceof A.default.Text?Pe.value().slice(Ue):"",pt={collapsed:Me.length===0,empty:Me.length===0&&Te.length()<=1,format:de.quill.getFormat(Me),offset:Be,prefix:st,suffix:dt},xt=Oe.some(function(bt){if(bt.collapsed!=null&&bt.collapsed!==pt.collapsed||bt.empty!=null&&bt.empty!==pt.empty||bt.offset!=null&&bt.offset!==pt.offset)return!1;if(Array.isArray(bt.format)){if(bt.format.every(function(kt){return pt.format[kt]==null}))return!1}else if(a(bt.format)==="object"&&!Object.keys(bt.format).every(function(kt){return bt.format[kt]===!0?pt.format[kt]!=null:bt.format[kt]===!1?pt.format[kt]==null:(0,g.default)(bt.format[kt],pt.format[kt])}))return!1;return bt.prefix!=null&&!bt.prefix.test(pt.prefix)||bt.suffix!=null&&!bt.suffix.test(pt.suffix)?!1:bt.handler.call(de,Me,pt)!==!0});xt&&ye.preventDefault()}}}})}}]),oe})(F.default);ie.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},ie.DEFAULTS={bindings:{bold:X("bold"),italic:X("italic"),underline:X("underline"),indent:{key:ie.keys.TAB,format:["blockquote","indent","list"],handler:function(oe,me){if(me.collapsed&&me.offset!==0)return!0;this.quill.format("indent","+1",k.default.sources.USER)}},outdent:{key:ie.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(oe,me){if(me.collapsed&&me.offset!==0)return!0;this.quill.format("indent","-1",k.default.sources.USER)}},"outdent backspace":{key:ie.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(oe,me){me.format.indent!=null?this.quill.format("indent","-1",k.default.sources.USER):me.format.list!=null&&this.quill.format("list",!1,k.default.sources.USER)}},"indent code-block":U(!0),"outdent code-block":U(!1),"remove tab":{key:ie.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(oe){this.quill.deleteText(oe.index-1,1,k.default.sources.USER)}},tab:{key:ie.keys.TAB,handler:function(oe){this.quill.history.cutoff();var me=new _.default().retain(oe.index).delete(oe.length).insert(" ");this.quill.updateContents(me,k.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(oe.index+1,k.default.sources.SILENT)}},"list empty enter":{key:ie.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(oe,me){this.quill.format("list",!1,k.default.sources.USER),me.format.indent&&this.quill.format("indent",!1,k.default.sources.USER)}},"checklist enter":{key:ie.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(oe){var me=this.quill.getLine(oe.index),de=o(me,2),ye=de[0],Re=de[1],Oe=(0,p.default)({},ye.formats(),{list:"checked"}),Me=new _.default().retain(oe.index).insert(`
140
+ `,Oe).retain(ye.length()-Re-1).retain(1,{list:"unchecked"});this.quill.updateContents(Me,k.default.sources.USER),this.quill.setSelection(oe.index+1,k.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:ie.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(oe,me){var de=this.quill.getLine(oe.index),ye=o(de,2),Re=ye[0],Oe=ye[1],Me=new _.default().retain(oe.index).insert(`
141
+ `,me.format).retain(Re.length()-Oe-1).retain(1,{header:null});this.quill.updateContents(Me,k.default.sources.USER),this.quill.setSelection(oe.index+1,k.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(oe,me){var de=me.prefix.length,ye=this.quill.getLine(oe.index),Re=o(ye,2),Oe=Re[0],Me=Re[1];if(Me>de)return!0;var Ee=void 0;switch(me.prefix.trim()){case"[]":case"[ ]":Ee="unchecked";break;case"[x]":Ee="checked";break;case"-":case"*":Ee="bullet";break;default:Ee="ordered"}this.quill.insertText(oe.index," ",k.default.sources.USER),this.quill.history.cutoff();var ge=new _.default().retain(oe.index-Me).delete(de+1).retain(Oe.length()-2-Me).retain(1,{list:Ee});this.quill.updateContents(ge,k.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(oe.index-de,k.default.sources.SILENT)}},"code exit":{key:ie.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(oe){var me=this.quill.getLine(oe.index),de=o(me,2),ye=de[0],Re=de[1],Oe=new _.default().retain(oe.index+ye.length()-Re-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(Oe,k.default.sources.USER)}},"embed left":Z(ie.keys.LEFT,!1),"embed left shift":Z(ie.keys.LEFT,!0),"embed right":Z(ie.keys.RIGHT,!1),"embed right shift":Z(ie.keys.RIGHT,!0)}};function Z(K,oe){var me,de=K===ie.keys.LEFT?"prefix":"suffix";return me={key:K,shiftKey:oe,altKey:null},T(me,de,/^$/),T(me,"handler",function(Re){var Oe=Re.index;K===ie.keys.RIGHT&&(Oe+=Re.length+1);var Me=this.quill.getLeaf(Oe),Ee=o(Me,1),ge=Ee[0];return ge instanceof A.default.Embed?(K===ie.keys.LEFT?oe?this.quill.setSelection(Re.index-1,Re.length+1,k.default.sources.USER):this.quill.setSelection(Re.index-1,k.default.sources.USER):oe?this.quill.setSelection(Re.index,Re.length+1,k.default.sources.USER):this.quill.setSelection(Re.index+Re.length+1,k.default.sources.USER),!1):!0}),me}function te(K,oe){if(!(K.index===0||this.quill.getLength()<=1)){var me=this.quill.getLine(K.index),de=o(me,1),ye=de[0],Re={};if(oe.offset===0){var Oe=this.quill.getLine(K.index-1),Me=o(Oe,1),Ee=Me[0];if(Ee!=null&&Ee.length()>1){var ge=ye.formats(),Te=this.quill.getFormat(K.index-1,1);Re=b.default.attributes.diff(ge,Te)||{}}}var Be=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(oe.prefix)?2:1;this.quill.deleteText(K.index-Be,Be,k.default.sources.USER),Object.keys(Re).length>0&&this.quill.formatLine(K.index-Be,Be,Re,k.default.sources.USER),this.quill.focus()}}function V(K,oe){var me=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(oe.suffix)?2:1;if(!(K.index>=this.quill.getLength()-me)){var de={},ye=0,Re=this.quill.getLine(K.index),Oe=o(Re,1),Me=Oe[0];if(oe.offset>=Me.length()-1){var Ee=this.quill.getLine(K.index+1),ge=o(Ee,1),Te=ge[0];if(Te){var Be=Me.formats(),Ce=this.quill.getFormat(K.index,1);de=b.default.attributes.diff(Be,Ce)||{},ye=Te.length()}}this.quill.deleteText(K.index,me,k.default.sources.USER),Object.keys(de).length>0&&this.quill.formatLine(K.index+ye-1,me,de,k.default.sources.USER)}}function B(K){var oe=this.quill.getLines(K),me={};if(oe.length>1){var de=oe[0].formats(),ye=oe[oe.length-1].formats();me=b.default.attributes.diff(ye,de)||{}}this.quill.deleteText(K,k.default.sources.USER),Object.keys(me).length>0&&this.quill.formatLine(K.index,1,me,k.default.sources.USER),this.quill.setSelection(K.index,k.default.sources.SILENT),this.quill.focus()}function D(K,oe){var me=this;K.length>0&&this.quill.scroll.deleteAt(K.index,K.length);var de=Object.keys(oe.format).reduce(function(ye,Re){return A.default.query(Re,A.default.Scope.BLOCK)&&!Array.isArray(oe.format[Re])&&(ye[Re]=oe.format[Re]),ye},{});this.quill.insertText(K.index,`
142
+ `,de,k.default.sources.USER),this.quill.setSelection(K.index+1,k.default.sources.SILENT),this.quill.focus(),Object.keys(oe.format).forEach(function(ye){de[ye]==null&&(Array.isArray(oe.format[ye])||ye!=="link"&&me.quill.format(ye,oe.format[ye],k.default.sources.USER))})}function U(K){return{key:ie.keys.TAB,shiftKey:!K,format:{"code-block":!0},handler:function(me){var de=A.default.query("code-block"),ye=me.index,Re=me.length,Oe=this.quill.scroll.descendant(de,ye),Me=o(Oe,2),Ee=Me[0],ge=Me[1];if(Ee!=null){var Te=this.quill.getIndex(Ee),Be=Ee.newlineIndex(ge,!0)+1,Ce=Ee.newlineIndex(Te+ge+Re),fe=Ee.domNode.textContent.slice(Be,Ce).split(`
143
+ `);ge=0,fe.forEach(function(Le,Ne){K?(Ee.insertAt(Be+ge,de.TAB),ge+=de.TAB.length,Ne===0?ye+=de.TAB.length:Re+=de.TAB.length):Le.startsWith(de.TAB)&&(Ee.deleteAt(Be+ge,de.TAB.length),ge-=de.TAB.length,Ne===0?ye-=de.TAB.length:Re-=de.TAB.length),ge+=Le.length+1}),this.quill.update(k.default.sources.USER),this.quill.setSelection(ye,Re,k.default.sources.SILENT)}}}}function X(K){return{key:K[0].toUpperCase(),shortKey:!0,handler:function(me,de){this.quill.format(K,!de.format[K],k.default.sources.USER)}}}function ee(K){if(typeof K=="string"||typeof K=="number")return ee({key:K});if((typeof K>"u"?"undefined":a(K))==="object"&&(K=(0,h.default)(K,!1)),typeof K.key=="string")if(ie.keys[K.key.toUpperCase()]!=null)K.key=ie.keys[K.key.toUpperCase()];else if(K.key.length===1)K.key=K.key.toUpperCase().charCodeAt(0);else return null;return K.shortKey&&(K[ae]=K.shortKey,delete K.shortKey),K}r.default=ie,r.SHORTKEY=ae}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function b(E,A){var S=[],k=!0,I=!1,O=void 0;try{for(var M=E[Symbol.iterator](),F;!(k=(F=M.next()).done)&&(S.push(F.value),!(A&&S.length===A));k=!0);}catch(j){I=!0,O=j}finally{try{!k&&M.return&&M.return()}finally{if(I)throw O}}return S}return function(E,A){if(Array.isArray(E))return E;if(Symbol.iterator in Object(E))return b(E,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=function b(E,A,S){E===null&&(E=Function.prototype);var k=Object.getOwnPropertyDescriptor(E,A);if(k===void 0){var I=Object.getPrototypeOf(E);return I===null?void 0:b(I,A,S)}else{if("value"in k)return k.value;var O=k.get;return O===void 0?void 0:O.call(S)}},s=(function(){function b(E,A){for(var S=0;S<A.length;S++){var k=A[S];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(E,k.key,k)}}return function(E,A,S){return A&&b(E.prototype,A),S&&b(E,S),E}})(),u=i(0),h=v(u),f=i(7),g=v(f);function v(b){return b&&b.__esModule?b:{default:b}}function p(b,E){if(!(b instanceof E))throw new TypeError("Cannot call a class as a function")}function y(b,E){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:b}function _(b,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);b.prototype=Object.create(E&&E.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(b,E):b.__proto__=E)}var x=(function(b){_(E,b),s(E,null,[{key:"value",value:function(){}}]);function E(A,S){p(this,E);var k=y(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,A));return k.selection=S,k.textNode=document.createTextNode(E.CONTENTS),k.domNode.appendChild(k.textNode),k._length=0,k}return s(E,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(S,k){if(this._length!==0)return o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"format",this).call(this,S,k);for(var I=this,O=0;I!=null&&I.statics.scope!==h.default.Scope.BLOCK_BLOT;)O+=I.offset(I.parent),I=I.parent;I!=null&&(this._length=E.CONTENTS.length,I.optimize(),I.formatAt(O,E.CONTENTS.length,S,k),this._length=0)}},{key:"index",value:function(S,k){return S===this.textNode?0:o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"index",this).call(this,S,k)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var S=this.textNode,k=this.selection.getNativeRange(),I=void 0,O=void 0,M=void 0;if(k!=null&&k.start.node===S&&k.end.node===S){var F=[S,k.start.offset,k.end.offset];I=F[0],O=F[1],M=F[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==E.CONTENTS){var j=this.textNode.data.split(E.CONTENTS).join("");this.next instanceof g.default?(I=this.next.domNode,this.next.insertAt(0,j),this.textNode.data=E.CONTENTS):(this.textNode.data=j,this.parent.insertBefore(h.default.create(this.textNode),this),this.textNode=document.createTextNode(E.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),O!=null){var T=[O,M].map(function($){return Math.max(0,Math.min(I.data.length,$-1))}),L=a(T,2);return O=L[0],M=L[1],{startNode:I,startOffset:O,endNode:I,endOffset:M}}}}},{key:"update",value:function(S,k){var I=this;if(S.some(function(M){return M.type==="characterData"&&M.target===I.textNode})){var O=this.restore();O&&(k.range=O)}}},{key:"value",value:function(){return""}}]),E})(h.default.Embed);x.blotName="cursor",x.className="ql-cursor",x.tagName="span",x.CONTENTS="\uFEFF",r.default=x}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=i(0),o=h(a),s=i(4),u=h(s);function h(y){return y&&y.__esModule?y:{default:y}}function f(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function g(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function v(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var p=(function(y){v(_,y);function _(){return f(this,_),g(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return _})(o.default.Container);p.allowedChildren=[u.default,s.BlockEmbed,p],r.default=p}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.ColorStyle=r.ColorClass=r.ColorAttributor=void 0;var a=(function(){function x(b,E){for(var A=0;A<E.length;A++){var S=E[A];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(b,S.key,S)}}return function(b,E,A){return E&&x(b.prototype,E),A&&x(b,A),b}})(),o=function x(b,E,A){b===null&&(b=Function.prototype);var S=Object.getOwnPropertyDescriptor(b,E);if(S===void 0){var k=Object.getPrototypeOf(b);return k===null?void 0:x(k,E,A)}else{if("value"in S)return S.value;var I=S.get;return I===void 0?void 0:I.call(A)}},s=i(0),u=h(s);function h(x){return x&&x.__esModule?x:{default:x}}function f(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}function g(x,b){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:x}function v(x,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);x.prototype=Object.create(b&&b.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(x,b):x.__proto__=b)}var p=(function(x){v(b,x);function b(){return f(this,b),g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"value",value:function(A){var S=o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"value",this).call(this,A);return S.startsWith("rgb(")?(S=S.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+S.split(",").map(function(k){return("00"+parseInt(k).toString(16)).slice(-2)}).join("")):S}}]),b})(u.default.Attributor.Style),y=new u.default.Attributor.Class("color","ql-color",{scope:u.default.Scope.INLINE}),_=new p("color","color",{scope:u.default.Scope.INLINE});r.ColorAttributor=p,r.ColorClass=y,r.ColorStyle=_}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.sanitize=r.default=void 0;var a=(function(){function _(x,b){for(var E=0;E<b.length;E++){var A=b[E];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(x,A.key,A)}}return function(x,b,E){return b&&_(x.prototype,b),E&&_(x,E),x}})(),o=function _(x,b,E){x===null&&(x=Function.prototype);var A=Object.getOwnPropertyDescriptor(x,b);if(A===void 0){var S=Object.getPrototypeOf(x);return S===null?void 0:_(S,b,E)}else{if("value"in A)return A.value;var k=A.get;return k===void 0?void 0:k.call(E)}},s=i(6),u=h(s);function h(_){return _&&_.__esModule?_:{default:_}}function f(_,x){if(!(_ instanceof x))throw new TypeError("Cannot call a class as a function")}function g(_,x){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:_}function v(_,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);_.prototype=Object.create(x&&x.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(_,x):_.__proto__=x)}var p=(function(_){v(x,_);function x(){return f(this,x),g(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return a(x,[{key:"format",value:function(E,A){if(E!==this.statics.blotName||!A)return o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"format",this).call(this,E,A);A=this.constructor.sanitize(A),this.domNode.setAttribute("href",A)}}],[{key:"create",value:function(E){var A=o(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this,E);return E=this.sanitize(E),A.setAttribute("href",E),A.setAttribute("rel","noopener noreferrer"),A.setAttribute("target","_blank"),A}},{key:"formats",value:function(E){return E.getAttribute("href")}},{key:"sanitize",value:function(E){return y(E,this.PROTOCOL_WHITELIST)?E:this.SANITIZED_URL}}]),x})(u.default);p.blotName="link",p.tagName="A",p.SANITIZED_URL="about:blank",p.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function y(_,x){var b=document.createElement("a");b.href=_;var E=b.href.slice(0,b.href.indexOf(":"));return x.indexOf(E)>-1}r.default=p,r.sanitize=y}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(x){return typeof x}:function(x){return x&&typeof Symbol=="function"&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x},o=(function(){function x(b,E){for(var A=0;A<E.length;A++){var S=E[A];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(b,S.key,S)}}return function(b,E,A){return E&&x(b.prototype,E),A&&x(b,A),b}})(),s=i(23),u=g(s),h=i(107),f=g(h);function g(x){return x&&x.__esModule?x:{default:x}}function v(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}var p=0;function y(x,b){x.setAttribute(b,x.getAttribute(b)!=="true")}var _=(function(){function x(b){var E=this;v(this,x),this.select=b,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){E.togglePicker()}),this.label.addEventListener("keydown",function(A){switch(A.keyCode){case u.default.keys.ENTER:E.togglePicker();break;case u.default.keys.ESCAPE:E.escape(),A.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return o(x,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),y(this.label,"aria-expanded"),y(this.options,"aria-hidden")}},{key:"buildItem",value:function(E){var A=this,S=document.createElement("span");return S.tabIndex="0",S.setAttribute("role","button"),S.classList.add("ql-picker-item"),E.hasAttribute("value")&&S.setAttribute("data-value",E.getAttribute("value")),E.textContent&&S.setAttribute("data-label",E.textContent),S.addEventListener("click",function(){A.selectItem(S,!0)}),S.addEventListener("keydown",function(k){switch(k.keyCode){case u.default.keys.ENTER:A.selectItem(S,!0),k.preventDefault();break;case u.default.keys.ESCAPE:A.escape(),k.preventDefault();break}}),S}},{key:"buildLabel",value:function(){var E=document.createElement("span");return E.classList.add("ql-picker-label"),E.innerHTML=f.default,E.tabIndex="0",E.setAttribute("role","button"),E.setAttribute("aria-expanded","false"),this.container.appendChild(E),E}},{key:"buildOptions",value:function(){var E=this,A=document.createElement("span");A.classList.add("ql-picker-options"),A.setAttribute("aria-hidden","true"),A.tabIndex="-1",A.id="ql-picker-options-"+p,p+=1,this.label.setAttribute("aria-controls",A.id),this.options=A,[].slice.call(this.select.options).forEach(function(S){var k=E.buildItem(S);A.appendChild(k),S.selected===!0&&E.selectItem(k)}),this.container.appendChild(A)}},{key:"buildPicker",value:function(){var E=this;[].slice.call(this.select.attributes).forEach(function(A){E.container.setAttribute(A.name,A.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var E=this;this.close(),setTimeout(function(){return E.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(E){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,S=this.container.querySelector(".ql-selected");if(E!==S&&(S?.classList.remove("ql-selected"),E!=null&&(E.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(E.parentNode.children,E),E.hasAttribute("data-value")?this.label.setAttribute("data-value",E.getAttribute("data-value")):this.label.removeAttribute("data-value"),E.hasAttribute("data-label")?this.label.setAttribute("data-label",E.getAttribute("data-label")):this.label.removeAttribute("data-label"),A))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":a(Event))==="object"){var k=document.createEvent("Event");k.initEvent("change",!0,!0),this.select.dispatchEvent(k)}this.close()}}},{key:"update",value:function(){var E=void 0;if(this.select.selectedIndex>-1){var A=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];E=this.select.options[this.select.selectedIndex],this.selectItem(A)}else this.selectItem(null);var S=E!=null&&E!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",S)}}]),x})();r.default=_}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=i(0),o=J(a),s=i(5),u=J(s),h=i(4),f=J(h),g=i(16),v=J(g),p=i(25),y=J(p),_=i(24),x=J(_),b=i(35),E=J(b),A=i(6),S=J(A),k=i(22),I=J(k),O=i(7),M=J(O),F=i(55),j=J(F),T=i(42),L=J(T),$=i(23),q=J($);function J(ae){return ae&&ae.__esModule?ae:{default:ae}}u.default.register({"blots/block":f.default,"blots/block/embed":h.BlockEmbed,"blots/break":v.default,"blots/container":y.default,"blots/cursor":x.default,"blots/embed":E.default,"blots/inline":S.default,"blots/scroll":I.default,"blots/text":M.default,"modules/clipboard":j.default,"modules/history":L.default,"modules/keyboard":q.default}),o.default.register(f.default,v.default,x.default,S.default,I.default,M.default),r.default=u.default}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=i(1),o=(function(){function s(u){this.domNode=u,this.domNode[a.DATA_KEY]={blot:this}}return Object.defineProperty(s.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),s.create=function(u){if(this.tagName==null)throw new a.ParchmentError("Blot definition missing tagName");var h;return Array.isArray(this.tagName)?(typeof u=="string"&&(u=u.toUpperCase(),parseInt(u).toString()===u&&(u=parseInt(u))),typeof u=="number"?h=document.createElement(this.tagName[u-1]):this.tagName.indexOf(u)>-1?h=document.createElement(u):h=document.createElement(this.tagName[0])):h=document.createElement(this.tagName),this.className&&h.classList.add(this.className),h},s.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},s.prototype.clone=function(){var u=this.domNode.cloneNode(!1);return a.create(u)},s.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[a.DATA_KEY]},s.prototype.deleteAt=function(u,h){var f=this.isolate(u,h);f.remove()},s.prototype.formatAt=function(u,h,f,g){var v=this.isolate(u,h);if(a.query(f,a.Scope.BLOT)!=null&&g)v.wrap(f,g);else if(a.query(f,a.Scope.ATTRIBUTE)!=null){var p=a.create(this.statics.scope);v.wrap(p),p.format(f,g)}},s.prototype.insertAt=function(u,h,f){var g=f==null?a.create("text",h):a.create(h,f),v=this.split(u);this.parent.insertBefore(g,v)},s.prototype.insertInto=function(u,h){h===void 0&&(h=null),this.parent!=null&&this.parent.children.remove(this);var f=null;u.children.insertBefore(this,h),h!=null&&(f=h.domNode),(this.domNode.parentNode!=u.domNode||this.domNode.nextSibling!=f)&&u.domNode.insertBefore(this.domNode,f),this.parent=u,this.attach()},s.prototype.isolate=function(u,h){var f=this.split(u);return f.split(h),f},s.prototype.length=function(){return 1},s.prototype.offset=function(u){return u===void 0&&(u=this.parent),this.parent==null||this==u?0:this.parent.children.offset(this)+this.parent.offset(u)},s.prototype.optimize=function(u){this.domNode[a.DATA_KEY]!=null&&delete this.domNode[a.DATA_KEY].mutations},s.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},s.prototype.replace=function(u){u.parent!=null&&(u.parent.insertBefore(this,u.next),u.remove())},s.prototype.replaceWith=function(u,h){var f=typeof u=="string"?a.create(u,h):u;return f.replace(this),f},s.prototype.split=function(u,h){return u===0?this:this.next},s.prototype.update=function(u,h){},s.prototype.wrap=function(u,h){var f=typeof u=="string"?a.create(u,h):u;return this.parent!=null&&this.parent.insertBefore(f,this.next),f.appendChild(this),f},s.blotName="abstract",s})();r.default=o}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=i(12),o=i(32),s=i(33),u=i(1),h=(function(){function f(g){this.attributes={},this.domNode=g,this.build()}return f.prototype.attribute=function(g,v){v?g.add(this.domNode,v)&&(g.value(this.domNode)!=null?this.attributes[g.attrName]=g:delete this.attributes[g.attrName]):(g.remove(this.domNode),delete this.attributes[g.attrName])},f.prototype.build=function(){var g=this;this.attributes={};var v=a.default.keys(this.domNode),p=o.default.keys(this.domNode),y=s.default.keys(this.domNode);v.concat(p).concat(y).forEach(function(_){var x=u.query(_,u.Scope.ATTRIBUTE);x instanceof a.default&&(g.attributes[x.attrName]=x)})},f.prototype.copy=function(g){var v=this;Object.keys(this.attributes).forEach(function(p){var y=v.attributes[p].value(v.domNode);g.format(p,y)})},f.prototype.move=function(g){var v=this;this.copy(g),Object.keys(this.attributes).forEach(function(p){v.attributes[p].remove(v.domNode)}),this.attributes={}},f.prototype.values=function(){var g=this;return Object.keys(this.attributes).reduce(function(v,p){return v[p]=g.attributes[p].value(g.domNode),v},{})},f})();r.default=h}),(function(n,r,i){var a=this&&this.__extends||(function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,g){f.__proto__=g}||function(f,g){for(var v in g)g.hasOwnProperty(v)&&(f[v]=g[v])};return function(f,g){h(f,g);function v(){this.constructor=f}f.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=i(12);function s(h,f){var g=h.getAttribute("class")||"";return g.split(/\s+/).filter(function(v){return v.indexOf(f+"-")===0})}var u=(function(h){a(f,h);function f(){return h!==null&&h.apply(this,arguments)||this}return f.keys=function(g){return(g.getAttribute("class")||"").split(/\s+/).map(function(v){return v.split("-").slice(0,-1).join("-")})},f.prototype.add=function(g,v){return this.canAdd(g,v)?(this.remove(g),g.classList.add(this.keyName+"-"+v),!0):!1},f.prototype.remove=function(g){var v=s(g,this.keyName);v.forEach(function(p){g.classList.remove(p)}),g.classList.length===0&&g.removeAttribute("class")},f.prototype.value=function(g){var v=s(g,this.keyName)[0]||"",p=v.slice(this.keyName.length+1);return this.canAdd(g,p)?p:""},f})(o.default);r.default=u}),(function(n,r,i){var a=this&&this.__extends||(function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,g){f.__proto__=g}||function(f,g){for(var v in g)g.hasOwnProperty(v)&&(f[v]=g[v])};return function(f,g){h(f,g);function v(){this.constructor=f}f.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=i(12);function s(h){var f=h.split("-"),g=f.slice(1).map(function(v){return v[0].toUpperCase()+v.slice(1)}).join("");return f[0]+g}var u=(function(h){a(f,h);function f(){return h!==null&&h.apply(this,arguments)||this}return f.keys=function(g){return(g.getAttribute("style")||"").split(";").map(function(v){var p=v.split(":");return p[0].trim()})},f.prototype.add=function(g,v){return this.canAdd(g,v)?(g.style[s(this.keyName)]=v,!0):!1},f.prototype.remove=function(g){g.style[s(this.keyName)]="",g.getAttribute("style")||g.removeAttribute("style")},f.prototype.value=function(g){var v=g.style[s(this.keyName)];return this.canAdd(g,v)?v:""},f})(o.default);r.default=u}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function u(h,f){for(var g=0;g<f.length;g++){var v=f[g];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(h,v.key,v)}}return function(h,f,g){return f&&u(h.prototype,f),g&&u(h,g),h}})();function o(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}var s=(function(){function u(h,f){o(this,u),this.quill=h,this.options=f,this.modules={}}return a(u,[{key:"init",value:function(){var f=this;Object.keys(this.options.modules).forEach(function(g){f.modules[g]==null&&f.addModule(g)})}},{key:"addModule",value:function(f){var g=this.quill.constructor.import("modules/"+f);return this.modules[f]=new g(this.quill,this.options.modules[f]||{}),this.modules[f]}}]),u})();s.DEFAULTS={modules:{}},s.themes={default:s},r.default=s}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function b(E,A){for(var S=0;S<A.length;S++){var k=A[S];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(E,k.key,k)}}return function(E,A,S){return A&&b(E.prototype,A),S&&b(E,S),E}})(),o=function b(E,A,S){E===null&&(E=Function.prototype);var k=Object.getOwnPropertyDescriptor(E,A);if(k===void 0){var I=Object.getPrototypeOf(E);return I===null?void 0:b(I,A,S)}else{if("value"in k)return k.value;var O=k.get;return O===void 0?void 0:O.call(S)}},s=i(0),u=g(s),h=i(7),f=g(h);function g(b){return b&&b.__esModule?b:{default:b}}function v(b,E){if(!(b instanceof E))throw new TypeError("Cannot call a class as a function")}function p(b,E){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:b}function y(b,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);b.prototype=Object.create(E&&E.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(b,E):b.__proto__=E)}var _="\uFEFF",x=(function(b){y(E,b);function E(A){v(this,E);var S=p(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,A));return S.contentNode=document.createElement("span"),S.contentNode.setAttribute("contenteditable",!1),[].slice.call(S.domNode.childNodes).forEach(function(k){S.contentNode.appendChild(k)}),S.leftGuard=document.createTextNode(_),S.rightGuard=document.createTextNode(_),S.domNode.appendChild(S.leftGuard),S.domNode.appendChild(S.contentNode),S.domNode.appendChild(S.rightGuard),S}return a(E,[{key:"index",value:function(S,k){return S===this.leftGuard?0:S===this.rightGuard?1:o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"index",this).call(this,S,k)}},{key:"restore",value:function(S){var k=void 0,I=void 0,O=S.data.split(_).join("");if(S===this.leftGuard)if(this.prev instanceof f.default){var M=this.prev.length();this.prev.insertAt(M,O),k={startNode:this.prev.domNode,startOffset:M+O.length}}else I=document.createTextNode(O),this.parent.insertBefore(u.default.create(I),this),k={startNode:I,startOffset:O.length};else S===this.rightGuard&&(this.next instanceof f.default?(this.next.insertAt(0,O),k={startNode:this.next.domNode,startOffset:O.length}):(I=document.createTextNode(O),this.parent.insertBefore(u.default.create(I),this.next),k={startNode:I,startOffset:O.length}));return S.data=_,k}},{key:"update",value:function(S,k){var I=this;S.forEach(function(O){if(O.type==="characterData"&&(O.target===I.leftGuard||O.target===I.rightGuard)){var M=I.restore(O.target);M&&(k.range=M)}})}}]),E})(u.default.Embed);r.default=x}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.AlignStyle=r.AlignClass=r.AlignAttribute=void 0;var a=i(0),o=s(a);function s(v){return v&&v.__esModule?v:{default:v}}var u={scope:o.default.Scope.BLOCK,whitelist:["right","center","justify"]},h=new o.default.Attributor.Attribute("align","align",u),f=new o.default.Attributor.Class("align","ql-align",u),g=new o.default.Attributor.Style("align","text-align",u);r.AlignAttribute=h,r.AlignClass=f,r.AlignStyle=g}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.BackgroundStyle=r.BackgroundClass=void 0;var a=i(0),o=u(a),s=i(26);function u(g){return g&&g.__esModule?g:{default:g}}var h=new o.default.Attributor.Class("background","ql-bg",{scope:o.default.Scope.INLINE}),f=new s.ColorAttributor("background","background-color",{scope:o.default.Scope.INLINE});r.BackgroundClass=h,r.BackgroundStyle=f}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.DirectionStyle=r.DirectionClass=r.DirectionAttribute=void 0;var a=i(0),o=s(a);function s(v){return v&&v.__esModule?v:{default:v}}var u={scope:o.default.Scope.BLOCK,whitelist:["rtl"]},h=new o.default.Attributor.Attribute("direction","dir",u),f=new o.default.Attributor.Class("direction","ql-direction",u),g=new o.default.Attributor.Style("direction","direction",u);r.DirectionAttribute=h,r.DirectionClass=f,r.DirectionStyle=g}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.FontClass=r.FontStyle=void 0;var a=(function(){function b(E,A){for(var S=0;S<A.length;S++){var k=A[S];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(E,k.key,k)}}return function(E,A,S){return A&&b(E.prototype,A),S&&b(E,S),E}})(),o=function b(E,A,S){E===null&&(E=Function.prototype);var k=Object.getOwnPropertyDescriptor(E,A);if(k===void 0){var I=Object.getPrototypeOf(E);return I===null?void 0:b(I,A,S)}else{if("value"in k)return k.value;var O=k.get;return O===void 0?void 0:O.call(S)}},s=i(0),u=h(s);function h(b){return b&&b.__esModule?b:{default:b}}function f(b,E){if(!(b instanceof E))throw new TypeError("Cannot call a class as a function")}function g(b,E){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:b}function v(b,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);b.prototype=Object.create(E&&E.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(b,E):b.__proto__=E)}var p={scope:u.default.Scope.INLINE,whitelist:["serif","monospace"]},y=new u.default.Attributor.Class("font","ql-font",p),_=(function(b){v(E,b);function E(){return f(this,E),g(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return a(E,[{key:"value",value:function(S){return o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"value",this).call(this,S).replace(/["']/g,"")}}]),E})(u.default.Attributor.Style),x=new _("font","font-family",p);r.FontStyle=x,r.FontClass=y}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.SizeStyle=r.SizeClass=void 0;var a=i(0),o=s(a);function s(f){return f&&f.__esModule?f:{default:f}}var u=new o.default.Attributor.Class("size","ql-size",{scope:o.default.Scope.INLINE,whitelist:["small","large","huge"]}),h=new o.default.Attributor.Style("size","font-size",{scope:o.default.Scope.INLINE,whitelist:["10px","18px","32px"]});r.SizeClass=u,r.SizeStyle=h}),(function(n,r,i){n.exports={align:{"":i(76),center:i(77),right:i(78),justify:i(79)},background:i(80),blockquote:i(81),bold:i(82),clean:i(83),code:i(58),"code-block":i(58),color:i(84),direction:{"":i(85),rtl:i(86)},float:{center:i(87),full:i(88),left:i(89),right:i(90)},formula:i(91),header:{1:i(92),2:i(93)},italic:i(94),image:i(95),indent:{"+1":i(96),"-1":i(97)},link:i(98),list:{ordered:i(99),bullet:i(100),check:i(101)},script:{sub:i(102),super:i(103)},strike:i(104),underline:i(105),video:i(106)}}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.getLastChangeIndex=r.default=void 0;var a=(function(){function A(S,k){for(var I=0;I<k.length;I++){var O=k[I];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(S,O.key,O)}}return function(S,k,I){return k&&A(S.prototype,k),I&&A(S,I),S}})(),o=i(0),s=v(o),u=i(5),h=v(u),f=i(9),g=v(f);function v(A){return A&&A.__esModule?A:{default:A}}function p(A,S){if(!(A instanceof S))throw new TypeError("Cannot call a class as a function")}function y(A,S){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:A}function _(A,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);A.prototype=Object.create(S&&S.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(A,S):A.__proto__=S)}var x=(function(A){_(S,A);function S(k,I){p(this,S);var O=y(this,(S.__proto__||Object.getPrototypeOf(S)).call(this,k,I));return O.lastRecorded=0,O.ignoreChange=!1,O.clear(),O.quill.on(h.default.events.EDITOR_CHANGE,function(M,F,j,T){M!==h.default.events.TEXT_CHANGE||O.ignoreChange||(!O.options.userOnly||T===h.default.sources.USER?O.record(F,j):O.transform(F))}),O.quill.keyboard.addBinding({key:"Z",shortKey:!0},O.undo.bind(O)),O.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},O.redo.bind(O)),/Win/i.test(navigator.platform)&&O.quill.keyboard.addBinding({key:"Y",shortKey:!0},O.redo.bind(O)),O}return a(S,[{key:"change",value:function(I,O){if(this.stack[I].length!==0){var M=this.stack[I].pop();this.stack[O].push(M),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(M[I],h.default.sources.USER),this.ignoreChange=!1;var F=E(M[I]);this.quill.setSelection(F)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(I,O){if(I.ops.length!==0){this.stack.redo=[];var M=this.quill.getContents().diff(O),F=Date.now();if(this.lastRecorded+this.options.delay>F&&this.stack.undo.length>0){var j=this.stack.undo.pop();M=M.compose(j.undo),I=j.redo.compose(I)}else this.lastRecorded=F;this.stack.undo.push({redo:I,undo:M}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(I){this.stack.undo.forEach(function(O){O.undo=I.transform(O.undo,!0),O.redo=I.transform(O.redo,!0)}),this.stack.redo.forEach(function(O){O.undo=I.transform(O.undo,!0),O.redo=I.transform(O.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),S})(g.default);x.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function b(A){var S=A.ops[A.ops.length-1];return S==null?!1:S.insert!=null?typeof S.insert=="string"&&S.insert.endsWith(`
144
+ `):S.attributes!=null?Object.keys(S.attributes).some(function(k){return s.default.query(k,s.default.Scope.BLOCK)!=null}):!1}function E(A){var S=A.reduce(function(I,O){return I+=O.delete||0,I},0),k=A.length()-S;return b(A)&&(k-=1),k}r.default=x,r.getLastChangeIndex=E}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.BaseTooltip=void 0;var a=(function(){function D(U,X){for(var ee=0;ee<X.length;ee++){var K=X[ee];K.enumerable=K.enumerable||!1,K.configurable=!0,"value"in K&&(K.writable=!0),Object.defineProperty(U,K.key,K)}}return function(U,X,ee){return X&&D(U.prototype,X),ee&&D(U,ee),U}})(),o=function D(U,X,ee){U===null&&(U=Function.prototype);var K=Object.getOwnPropertyDescriptor(U,X);if(K===void 0){var oe=Object.getPrototypeOf(U);return oe===null?void 0:D(oe,X,ee)}else{if("value"in K)return K.value;var me=K.get;return me===void 0?void 0:me.call(ee)}},s=i(3),u=F(s),h=i(2),f=F(h),g=i(8),v=F(g),p=i(23),y=F(p),_=i(34),x=F(_),b=i(59),E=F(b),A=i(60),S=F(A),k=i(28),I=F(k),O=i(61),M=F(O);function F(D){return D&&D.__esModule?D:{default:D}}function j(D,U){if(!(D instanceof U))throw new TypeError("Cannot call a class as a function")}function T(D,U){if(!D)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return U&&(typeof U=="object"||typeof U=="function")?U:D}function L(D,U){if(typeof U!="function"&&U!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof U);D.prototype=Object.create(U&&U.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),U&&(Object.setPrototypeOf?Object.setPrototypeOf(D,U):D.__proto__=U)}var $=[!1,"center","right","justify"],q=["#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"],J=[!1,"serif","monospace"],ae=["1","2","3",!1],ie=["small",!1,"large","huge"],Z=(function(D){L(U,D);function U(X,ee){j(this,U);var K=T(this,(U.__proto__||Object.getPrototypeOf(U)).call(this,X,ee)),oe=function me(de){if(!document.body.contains(X.root))return document.body.removeEventListener("click",me);K.tooltip!=null&&!K.tooltip.root.contains(de.target)&&document.activeElement!==K.tooltip.textbox&&!K.quill.hasFocus()&&K.tooltip.hide(),K.pickers!=null&&K.pickers.forEach(function(ye){ye.container.contains(de.target)||ye.close()})};return X.emitter.listenDOM("click",document.body,oe),K}return a(U,[{key:"addModule",value:function(ee){var K=o(U.prototype.__proto__||Object.getPrototypeOf(U.prototype),"addModule",this).call(this,ee);return ee==="toolbar"&&this.extendToolbar(K),K}},{key:"buildButtons",value:function(ee,K){ee.forEach(function(oe){var me=oe.getAttribute("class")||"";me.split(/\s+/).forEach(function(de){if(de.startsWith("ql-")&&(de=de.slice(3),K[de]!=null))if(de==="direction")oe.innerHTML=K[de][""]+K[de].rtl;else if(typeof K[de]=="string")oe.innerHTML=K[de];else{var ye=oe.value||"";ye!=null&&K[de][ye]&&(oe.innerHTML=K[de][ye])}})})}},{key:"buildPickers",value:function(ee,K){var oe=this;this.pickers=ee.map(function(de){if(de.classList.contains("ql-align"))return de.querySelector("option")==null&&B(de,$),new S.default(de,K.align);if(de.classList.contains("ql-background")||de.classList.contains("ql-color")){var ye=de.classList.contains("ql-background")?"background":"color";return de.querySelector("option")==null&&B(de,q,ye==="background"?"#ffffff":"#000000"),new E.default(de,K[ye])}else return de.querySelector("option")==null&&(de.classList.contains("ql-font")?B(de,J):de.classList.contains("ql-header")?B(de,ae):de.classList.contains("ql-size")&&B(de,ie)),new I.default(de)});var me=function(){oe.pickers.forEach(function(ye){ye.update()})};this.quill.on(v.default.events.EDITOR_CHANGE,me)}}]),U})(x.default);Z.DEFAULTS=(0,u.default)(!0,{},x.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var U=this,X=this.container.querySelector("input.ql-image[type=file]");X==null&&(X=document.createElement("input"),X.setAttribute("type","file"),X.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),X.classList.add("ql-image"),X.addEventListener("change",function(){if(X.files!=null&&X.files[0]!=null){var ee=new FileReader;ee.onload=function(K){var oe=U.quill.getSelection(!0);U.quill.updateContents(new f.default().retain(oe.index).delete(oe.length).insert({image:K.target.result}),v.default.sources.USER),U.quill.setSelection(oe.index+1,v.default.sources.SILENT),X.value=""},ee.readAsDataURL(X.files[0])}}),this.container.appendChild(X)),X.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var te=(function(D){L(U,D);function U(X,ee){j(this,U);var K=T(this,(U.__proto__||Object.getPrototypeOf(U)).call(this,X,ee));return K.textbox=K.root.querySelector('input[type="text"]'),K.listen(),K}return a(U,[{key:"listen",value:function(){var ee=this;this.textbox.addEventListener("keydown",function(K){y.default.match(K,"enter")?(ee.save(),K.preventDefault()):y.default.match(K,"escape")&&(ee.cancel(),K.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),K!=null?this.textbox.value=K:ee!==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-"+ee)||""),this.root.setAttribute("data-mode",ee)}},{key:"restoreFocus",value:function(){var ee=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=ee}},{key:"save",value:function(){var ee=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var K=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",ee,v.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",ee,v.default.sources.USER)),this.quill.root.scrollTop=K;break}case"video":ee=V(ee);case"formula":{if(!ee)break;var oe=this.quill.getSelection(!0);if(oe!=null){var me=oe.index+oe.length;this.quill.insertEmbed(me,this.root.getAttribute("data-mode"),ee,v.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(me+1," ",v.default.sources.USER),this.quill.setSelection(me+2,v.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),U})(M.default);function V(D){var U=D.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||D.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return U?(U[1]||"https")+"://www.youtube.com/embed/"+U[2]+"?showinfo=0":(U=D.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(U[1]||"https")+"://player.vimeo.com/video/"+U[2]+"/":D}function B(D,U){var X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;U.forEach(function(ee){var K=document.createElement("option");ee===X?K.setAttribute("selected","selected"):K.setAttribute("value",ee),D.appendChild(K)})}r.BaseTooltip=te,r.default=Z}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function o(){this.head=this.tail=null,this.length=0}return o.prototype.append=function(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];this.insertBefore(s[0],null),s.length>1&&this.append.apply(this,s.slice(1))},o.prototype.contains=function(s){for(var u,h=this.iterator();u=h();)if(u===s)return!0;return!1},o.prototype.insertBefore=function(s,u){s&&(s.next=u,u!=null?(s.prev=u.prev,u.prev!=null&&(u.prev.next=s),u.prev=s,u===this.head&&(this.head=s)):this.tail!=null?(this.tail.next=s,s.prev=this.tail,this.tail=s):(s.prev=null,this.head=this.tail=s),this.length+=1)},o.prototype.offset=function(s){for(var u=0,h=this.head;h!=null;){if(h===s)return u;u+=h.length(),h=h.next}return-1},o.prototype.remove=function(s){this.contains(s)&&(s.prev!=null&&(s.prev.next=s.next),s.next!=null&&(s.next.prev=s.prev),s===this.head&&(this.head=s.next),s===this.tail&&(this.tail=s.prev),this.length-=1)},o.prototype.iterator=function(s){return s===void 0&&(s=this.head),function(){var u=s;return s!=null&&(s=s.next),u}},o.prototype.find=function(s,u){u===void 0&&(u=!1);for(var h,f=this.iterator();h=f();){var g=h.length();if(s<g||u&&s===g&&(h.next==null||h.next.length()!==0))return[h,s];s-=g}return[null,0]},o.prototype.forEach=function(s){for(var u,h=this.iterator();u=h();)s(u)},o.prototype.forEachAt=function(s,u,h){if(!(u<=0))for(var f=this.find(s),g=f[0],v=f[1],p,y=s-v,_=this.iterator(g);(p=_())&&y<s+u;){var x=p.length();s>y?h(p,s-y,Math.min(u,y+x-s)):h(p,0,Math.min(x,s+u-y)),y+=x}},o.prototype.map=function(s){return this.reduce(function(u,h){return u.push(s(h)),u},[])},o.prototype.reduce=function(s,u){for(var h,f=this.iterator();h=f();)u=s(u,h);return u},o})();r.default=a}),(function(n,r,i){var a=this&&this.__extends||(function(){var g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,p){v.__proto__=p}||function(v,p){for(var y in p)p.hasOwnProperty(y)&&(v[y]=p[y])};return function(v,p){g(v,p);function y(){this.constructor=v}v.prototype=p===null?Object.create(p):(y.prototype=p.prototype,new y)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=i(17),s=i(1),u={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},h=100,f=(function(g){a(v,g);function v(p){var y=g.call(this,p)||this;return y.scroll=y,y.observer=new MutationObserver(function(_){y.update(_)}),y.observer.observe(y.domNode,u),y.attach(),y}return v.prototype.detach=function(){g.prototype.detach.call(this),this.observer.disconnect()},v.prototype.deleteAt=function(p,y){this.update(),p===0&&y===this.length()?this.children.forEach(function(_){_.remove()}):g.prototype.deleteAt.call(this,p,y)},v.prototype.formatAt=function(p,y,_,x){this.update(),g.prototype.formatAt.call(this,p,y,_,x)},v.prototype.insertAt=function(p,y,_){this.update(),g.prototype.insertAt.call(this,p,y,_)},v.prototype.optimize=function(p,y){var _=this;p===void 0&&(p=[]),y===void 0&&(y={}),g.prototype.optimize.call(this,y);for(var x=[].slice.call(this.observer.takeRecords());x.length>0;)p.push(x.pop());for(var b=function(k,I){I===void 0&&(I=!0),!(k==null||k===_)&&k.domNode.parentNode!=null&&(k.domNode[s.DATA_KEY].mutations==null&&(k.domNode[s.DATA_KEY].mutations=[]),I&&b(k.parent))},E=function(k){k.domNode[s.DATA_KEY]==null||k.domNode[s.DATA_KEY].mutations==null||(k instanceof o.default&&k.children.forEach(E),k.optimize(y))},A=p,S=0;A.length>0;S+=1){if(S>=h)throw new Error("[Parchment] Maximum optimize iterations reached");for(A.forEach(function(k){var I=s.find(k.target,!0);I!=null&&(I.domNode===k.target&&(k.type==="childList"?(b(s.find(k.previousSibling,!1)),[].forEach.call(k.addedNodes,function(O){var M=s.find(O,!1);b(M,!1),M instanceof o.default&&M.children.forEach(function(F){b(F,!1)})})):k.type==="attributes"&&b(I.prev)),b(I))}),this.children.forEach(E),A=[].slice.call(this.observer.takeRecords()),x=A.slice();x.length>0;)p.push(x.pop())}},v.prototype.update=function(p,y){var _=this;y===void 0&&(y={}),p=p||this.observer.takeRecords(),p.map(function(x){var b=s.find(x.target,!0);return b==null?null:b.domNode[s.DATA_KEY].mutations==null?(b.domNode[s.DATA_KEY].mutations=[x],b):(b.domNode[s.DATA_KEY].mutations.push(x),null)}).forEach(function(x){x==null||x===_||x.domNode[s.DATA_KEY]==null||x.update(x.domNode[s.DATA_KEY].mutations||[],y)}),this.domNode[s.DATA_KEY].mutations!=null&&g.prototype.update.call(this,this.domNode[s.DATA_KEY].mutations,y),this.optimize(p,y)},v.blotName="scroll",v.defaultChild="block",v.scope=s.Scope.BLOCK_BLOT,v.tagName="DIV",v})(o.default);r.default=f}),(function(n,r,i){var a=this&&this.__extends||(function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,v){g.__proto__=v}||function(g,v){for(var p in v)v.hasOwnProperty(p)&&(g[p]=v[p])};return function(g,v){f(g,v);function p(){this.constructor=g}g.prototype=v===null?Object.create(v):(p.prototype=v.prototype,new p)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=i(18),s=i(1);function u(f,g){if(Object.keys(f).length!==Object.keys(g).length)return!1;for(var v in f)if(f[v]!==g[v])return!1;return!0}var h=(function(f){a(g,f);function g(){return f!==null&&f.apply(this,arguments)||this}return g.formats=function(v){if(v.tagName!==g.tagName)return f.formats.call(this,v)},g.prototype.format=function(v,p){var y=this;v===this.statics.blotName&&!p?(this.children.forEach(function(_){_ instanceof o.default||(_=_.wrap(g.blotName,!0)),y.attributes.copy(_)}),this.unwrap()):f.prototype.format.call(this,v,p)},g.prototype.formatAt=function(v,p,y,_){if(this.formats()[y]!=null||s.query(y,s.Scope.ATTRIBUTE)){var x=this.isolate(v,p);x.format(y,_)}else f.prototype.formatAt.call(this,v,p,y,_)},g.prototype.optimize=function(v){f.prototype.optimize.call(this,v);var p=this.formats();if(Object.keys(p).length===0)return this.unwrap();var y=this.next;y instanceof g&&y.prev===this&&u(p,y.formats())&&(y.moveChildren(this),y.remove())},g.blotName="inline",g.scope=s.Scope.INLINE_BLOT,g.tagName="SPAN",g})(o.default);r.default=h}),(function(n,r,i){var a=this&&this.__extends||(function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,g){f.__proto__=g}||function(f,g){for(var v in g)g.hasOwnProperty(v)&&(f[v]=g[v])};return function(f,g){h(f,g);function v(){this.constructor=f}f.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=i(18),s=i(1),u=(function(h){a(f,h);function f(){return h!==null&&h.apply(this,arguments)||this}return f.formats=function(g){var v=s.query(f.blotName).tagName;if(g.tagName!==v)return h.formats.call(this,g)},f.prototype.format=function(g,v){s.query(g,s.Scope.BLOCK)!=null&&(g===this.statics.blotName&&!v?this.replaceWith(f.blotName):h.prototype.format.call(this,g,v))},f.prototype.formatAt=function(g,v,p,y){s.query(p,s.Scope.BLOCK)!=null?this.format(p,y):h.prototype.formatAt.call(this,g,v,p,y)},f.prototype.insertAt=function(g,v,p){if(p==null||s.query(v,s.Scope.INLINE)!=null)h.prototype.insertAt.call(this,g,v,p);else{var y=this.split(g),_=s.create(v,p);y.parent.insertBefore(_,y)}},f.prototype.update=function(g,v){navigator.userAgent.match(/Trident/)?this.build():h.prototype.update.call(this,g,v)},f.blotName="block",f.scope=s.Scope.BLOCK_BLOT,f.tagName="P",f})(o.default);r.default=u}),(function(n,r,i){var a=this&&this.__extends||(function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,f){h.__proto__=f}||function(h,f){for(var g in f)f.hasOwnProperty(g)&&(h[g]=f[g])};return function(h,f){u(h,f);function g(){this.constructor=h}h.prototype=f===null?Object.create(f):(g.prototype=f.prototype,new g)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=i(19),s=(function(u){a(h,u);function h(){return u!==null&&u.apply(this,arguments)||this}return h.formats=function(f){},h.prototype.format=function(f,g){u.prototype.formatAt.call(this,0,this.length(),f,g)},h.prototype.formatAt=function(f,g,v,p){f===0&&g===this.length()?this.format(v,p):u.prototype.formatAt.call(this,f,g,v,p)},h.prototype.formats=function(){return this.statics.formats(this.domNode)},h})(o.default);r.default=s}),(function(n,r,i){var a=this&&this.__extends||(function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,g){f.__proto__=g}||function(f,g){for(var v in g)g.hasOwnProperty(v)&&(f[v]=g[v])};return function(f,g){h(f,g);function v(){this.constructor=f}f.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}})();Object.defineProperty(r,"__esModule",{value:!0});var o=i(19),s=i(1),u=(function(h){a(f,h);function f(g){var v=h.call(this,g)||this;return v.text=v.statics.value(v.domNode),v}return f.create=function(g){return document.createTextNode(g)},f.value=function(g){var v=g.data;return v.normalize&&(v=v.normalize()),v},f.prototype.deleteAt=function(g,v){this.domNode.data=this.text=this.text.slice(0,g)+this.text.slice(g+v)},f.prototype.index=function(g,v){return this.domNode===g?v:-1},f.prototype.insertAt=function(g,v,p){p==null?(this.text=this.text.slice(0,g)+v+this.text.slice(g),this.domNode.data=this.text):h.prototype.insertAt.call(this,g,v,p)},f.prototype.length=function(){return this.text.length},f.prototype.optimize=function(g){h.prototype.optimize.call(this,g),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof f&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},f.prototype.position=function(g,v){return[this.domNode,g]},f.prototype.split=function(g,v){if(v===void 0&&(v=!1),!v){if(g===0)return this;if(g===this.length())return this.next}var p=s.create(this.domNode.splitText(g));return this.parent.insertBefore(p,this.next),this.text=this.statics.value(this.domNode),p},f.prototype.update=function(g,v){var p=this;g.some(function(y){return y.type==="characterData"&&y.target===p.domNode})&&(this.text=this.statics.value(this.domNode))},f.prototype.value=function(){return this.text},f.blotName="text",f.scope=s.Scope.INLINE_BLOT,f})(o.default);r.default=u}),(function(n,r,i){var a=document.createElement("div");if(a.classList.toggle("test-class",!1),a.classList.contains("test-class")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(s,u){return arguments.length>1&&!this.contains(s)==!u?u:o.call(this,s)}}String.prototype.startsWith||(String.prototype.startsWith=function(s,u){return u=u||0,this.substr(u,s.length)===s}),String.prototype.endsWith||(String.prototype.endsWith=function(s,u){var h=this.toString();(typeof u!="number"||!isFinite(u)||Math.floor(u)!==u||u>h.length)&&(u=h.length),u-=s.length;var f=h.indexOf(s,u);return f!==-1&&f===u}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(u){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof u!="function")throw new TypeError("predicate must be a function");for(var h=Object(this),f=h.length>>>0,g=arguments[1],v,p=0;p<f;p++)if(v=h[p],u.call(g,v,p,h))return v}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})}),(function(n,r){var i=-1,a=1,o=0;function s(S,k,I){if(S==k)return S?[[o,S]]:[];(I<0||S.length<I)&&(I=null);var O=g(S,k),M=S.substring(0,O);S=S.substring(O),k=k.substring(O),O=v(S,k);var F=S.substring(S.length-O);S=S.substring(0,S.length-O),k=k.substring(0,k.length-O);var j=u(S,k);return M&&j.unshift([o,M]),F&&j.push([o,F]),y(j),I!=null&&(j=b(j,I)),j=E(j),j}function u(S,k){var I;if(!S)return[[a,k]];if(!k)return[[i,S]];var O=S.length>k.length?S:k,M=S.length>k.length?k:S,F=O.indexOf(M);if(F!=-1)return I=[[a,O.substring(0,F)],[o,M],[a,O.substring(F+M.length)]],S.length>k.length&&(I[0][0]=I[2][0]=i),I;if(M.length==1)return[[i,S],[a,k]];var j=p(S,k);if(j){var T=j[0],L=j[1],$=j[2],q=j[3],J=j[4],ae=s(T,$),ie=s(L,q);return ae.concat([[o,J]],ie)}return h(S,k)}function h(S,k){for(var I=S.length,O=k.length,M=Math.ceil((I+O)/2),F=M,j=2*M,T=new Array(j),L=new Array(j),$=0;$<j;$++)T[$]=-1,L[$]=-1;T[F+1]=0,L[F+1]=0;for(var q=I-O,J=q%2!=0,ae=0,ie=0,Z=0,te=0,V=0;V<M;V++){for(var B=-V+ae;B<=V-ie;B+=2){var D=F+B,U;B==-V||B!=V&&T[D-1]<T[D+1]?U=T[D+1]:U=T[D-1]+1;for(var X=U-B;U<I&&X<O&&S.charAt(U)==k.charAt(X);)U++,X++;if(T[D]=U,U>I)ie+=2;else if(X>O)ae+=2;else if(J){var ee=F+q-B;if(ee>=0&&ee<j&&L[ee]!=-1){var K=I-L[ee];if(U>=K)return f(S,k,U,X)}}}for(var oe=-V+Z;oe<=V-te;oe+=2){var ee=F+oe,K;oe==-V||oe!=V&&L[ee-1]<L[ee+1]?K=L[ee+1]:K=L[ee-1]+1;for(var me=K-oe;K<I&&me<O&&S.charAt(I-K-1)==k.charAt(O-me-1);)K++,me++;if(L[ee]=K,K>I)te+=2;else if(me>O)Z+=2;else if(!J){var D=F+q-oe;if(D>=0&&D<j&&T[D]!=-1){var U=T[D],X=F+U-D;if(K=I-K,U>=K)return f(S,k,U,X)}}}}return[[i,S],[a,k]]}function f(S,k,I,O){var M=S.substring(0,I),F=k.substring(0,O),j=S.substring(I),T=k.substring(O),L=s(M,F),$=s(j,T);return L.concat($)}function g(S,k){if(!S||!k||S.charAt(0)!=k.charAt(0))return 0;for(var I=0,O=Math.min(S.length,k.length),M=O,F=0;I<M;)S.substring(F,M)==k.substring(F,M)?(I=M,F=I):O=M,M=Math.floor((O-I)/2+I);return M}function v(S,k){if(!S||!k||S.charAt(S.length-1)!=k.charAt(k.length-1))return 0;for(var I=0,O=Math.min(S.length,k.length),M=O,F=0;I<M;)S.substring(S.length-M,S.length-F)==k.substring(k.length-M,k.length-F)?(I=M,F=I):O=M,M=Math.floor((O-I)/2+I);return M}function p(S,k){var I=S.length>k.length?S:k,O=S.length>k.length?k:S;if(I.length<4||O.length*2<I.length)return null;function M(ie,Z,te){for(var V=ie.substring(te,te+Math.floor(ie.length/4)),B=-1,D="",U,X,ee,K;(B=Z.indexOf(V,B+1))!=-1;){var oe=g(ie.substring(te),Z.substring(B)),me=v(ie.substring(0,te),Z.substring(0,B));D.length<me+oe&&(D=Z.substring(B-me,B)+Z.substring(B,B+oe),U=ie.substring(0,te-me),X=ie.substring(te+oe),ee=Z.substring(0,B-me),K=Z.substring(B+oe))}return D.length*2>=ie.length?[U,X,ee,K,D]:null}var F=M(I,O,Math.ceil(I.length/4)),j=M(I,O,Math.ceil(I.length/2)),T;if(!F&&!j)return null;j?F?T=F[4].length>j[4].length?F:j:T=j:T=F;var L,$,q,J;S.length>k.length?(L=T[0],$=T[1],q=T[2],J=T[3]):(q=T[0],J=T[1],L=T[2],$=T[3]);var ae=T[4];return[L,$,q,J,ae]}function y(S){S.push([o,""]);for(var k=0,I=0,O=0,M="",F="",j;k<S.length;)switch(S[k][0]){case a:O++,F+=S[k][1],k++;break;case i:I++,M+=S[k][1],k++;break;case o:I+O>1?(I!==0&&O!==0&&(j=g(F,M),j!==0&&(k-I-O>0&&S[k-I-O-1][0]==o?S[k-I-O-1][1]+=F.substring(0,j):(S.splice(0,0,[o,F.substring(0,j)]),k++),F=F.substring(j),M=M.substring(j)),j=v(F,M),j!==0&&(S[k][1]=F.substring(F.length-j)+S[k][1],F=F.substring(0,F.length-j),M=M.substring(0,M.length-j))),I===0?S.splice(k-O,I+O,[a,F]):O===0?S.splice(k-I,I+O,[i,M]):S.splice(k-I-O,I+O,[i,M],[a,F]),k=k-I-O+(I?1:0)+(O?1:0)+1):k!==0&&S[k-1][0]==o?(S[k-1][1]+=S[k][1],S.splice(k,1)):k++,O=0,I=0,M="",F="";break}S[S.length-1][1]===""&&S.pop();var T=!1;for(k=1;k<S.length-1;)S[k-1][0]==o&&S[k+1][0]==o&&(S[k][1].substring(S[k][1].length-S[k-1][1].length)==S[k-1][1]?(S[k][1]=S[k-1][1]+S[k][1].substring(0,S[k][1].length-S[k-1][1].length),S[k+1][1]=S[k-1][1]+S[k+1][1],S.splice(k-1,1),T=!0):S[k][1].substring(0,S[k+1][1].length)==S[k+1][1]&&(S[k-1][1]+=S[k+1][1],S[k][1]=S[k][1].substring(S[k+1][1].length)+S[k+1][1],S.splice(k+1,1),T=!0)),k++;T&&y(S)}var _=s;_.INSERT=a,_.DELETE=i,_.EQUAL=o,n.exports=_;function x(S,k){if(k===0)return[o,S];for(var I=0,O=0;O<S.length;O++){var M=S[O];if(M[0]===i||M[0]===o){var F=I+M[1].length;if(k===F)return[O+1,S];if(k<F){S=S.slice();var j=k-I,T=[M[0],M[1].slice(0,j)],L=[M[0],M[1].slice(j)];return S.splice(O,1,T,L),[O+1,S]}else I=F}}throw new Error("cursor_pos is out of bounds!")}function b(S,k){var I=x(S,k),O=I[1],M=I[0],F=O[M],j=O[M+1];if(F==null)return S;if(F[0]!==o)return S;if(j!=null&&F[1]+j[1]===j[1]+F[1])return O.splice(M,2,j,F),A(O,M,2);if(j!=null&&j[1].indexOf(F[1])===0){O.splice(M,2,[j[0],F[1]],[0,F[1]]);var T=j[1].slice(F[1].length);return T.length>0&&O.splice(M+2,0,[j[0],T]),A(O,M,3)}else return S}function E(S){for(var k=!1,I=function(j){return j.charCodeAt(0)>=56320&&j.charCodeAt(0)<=57343},O=function(j){return j.charCodeAt(j.length-1)>=55296&&j.charCodeAt(j.length-1)<=56319},M=2;M<S.length;M+=1)S[M-2][0]===o&&O(S[M-2][1])&&S[M-1][0]===i&&I(S[M-1][1])&&S[M][0]===a&&I(S[M][1])&&(k=!0,S[M-1][1]=S[M-2][1].slice(-1)+S[M-1][1],S[M][1]=S[M-2][1].slice(-1)+S[M][1],S[M-2][1]=S[M-2][1].slice(0,-1));if(!k)return S;for(var F=[],M=0;M<S.length;M+=1)S[M][1].length>0&&F.push(S[M]);return F}function A(S,k,I){for(var O=k+I-1;O>=0&&O>=k-1;O--)if(O+1<S.length){var M=S[O],F=S[O+1];M[0]===F[1]&&S.splice(O,2,[M[0],M[1]+F[1]])}return S}}),(function(n,r){r=n.exports=typeof Object.keys=="function"?Object.keys:i,r.shim=i;function i(a){var o=[];for(var s in a)o.push(s);return o}}),(function(n,r){var i=(function(){return Object.prototype.toString.call(arguments)})()=="[object Arguments]";r=n.exports=i?a:o,r.supported=a;function a(s){return Object.prototype.toString.call(s)=="[object Arguments]"}r.unsupported=o;function o(s){return s&&typeof s=="object"&&typeof s.length=="number"&&Object.prototype.hasOwnProperty.call(s,"callee")&&!Object.prototype.propertyIsEnumerable.call(s,"callee")||!1}}),(function(n,r){var i=Object.prototype.hasOwnProperty,a="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(a=!1));function s(h,f,g){this.fn=h,this.context=f,this.once=g||!1}function u(){this._events=new o,this._eventsCount=0}u.prototype.eventNames=function(){var f=[],g,v;if(this._eventsCount===0)return f;for(v in g=this._events)i.call(g,v)&&f.push(a?v.slice(1):v);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(g)):f},u.prototype.listeners=function(f,g){var v=a?a+f:f,p=this._events[v];if(g)return!!p;if(!p)return[];if(p.fn)return[p.fn];for(var y=0,_=p.length,x=new Array(_);y<_;y++)x[y]=p[y].fn;return x},u.prototype.emit=function(f,g,v,p,y,_){var x=a?a+f:f;if(!this._events[x])return!1;var b=this._events[x],E=arguments.length,A,S;if(b.fn){switch(b.once&&this.removeListener(f,b.fn,void 0,!0),E){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,g),!0;case 3:return b.fn.call(b.context,g,v),!0;case 4:return b.fn.call(b.context,g,v,p),!0;case 5:return b.fn.call(b.context,g,v,p,y),!0;case 6:return b.fn.call(b.context,g,v,p,y,_),!0}for(S=1,A=new Array(E-1);S<E;S++)A[S-1]=arguments[S];b.fn.apply(b.context,A)}else{var k=b.length,I;for(S=0;S<k;S++)switch(b[S].once&&this.removeListener(f,b[S].fn,void 0,!0),E){case 1:b[S].fn.call(b[S].context);break;case 2:b[S].fn.call(b[S].context,g);break;case 3:b[S].fn.call(b[S].context,g,v);break;case 4:b[S].fn.call(b[S].context,g,v,p);break;default:if(!A)for(I=1,A=new Array(E-1);I<E;I++)A[I-1]=arguments[I];b[S].fn.apply(b[S].context,A)}}return!0},u.prototype.on=function(f,g,v){var p=new s(g,v||this),y=a?a+f:f;return this._events[y]?this._events[y].fn?this._events[y]=[this._events[y],p]:this._events[y].push(p):(this._events[y]=p,this._eventsCount++),this},u.prototype.once=function(f,g,v){var p=new s(g,v||this,!0),y=a?a+f:f;return this._events[y]?this._events[y].fn?this._events[y]=[this._events[y],p]:this._events[y].push(p):(this._events[y]=p,this._eventsCount++),this},u.prototype.removeListener=function(f,g,v,p){var y=a?a+f:f;if(!this._events[y])return this;if(!g)return--this._eventsCount===0?this._events=new o:delete this._events[y],this;var _=this._events[y];if(_.fn)_.fn===g&&(!p||_.once)&&(!v||_.context===v)&&(--this._eventsCount===0?this._events=new o:delete this._events[y]);else{for(var x=0,b=[],E=_.length;x<E;x++)(_[x].fn!==g||p&&!_[x].once||v&&_[x].context!==v)&&b.push(_[x]);b.length?this._events[y]=b.length===1?b[0]:b:--this._eventsCount===0?this._events=new o:delete this._events[y]}return this},u.prototype.removeAllListeners=function(f){var g;return f?(g=a?a+f:f,this._events[g]&&(--this._eventsCount===0?this._events=new o:delete this._events[g])):(this._events=new o,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prototype.setMaxListeners=function(){return this},u.prefixed=a,u.EventEmitter=u,typeof n<"u"&&(n.exports=u)}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.matchText=r.matchSpacing=r.matchNewline=r.matchBlot=r.matchAttributor=r.default=void 0;var a=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},o=(function(){function Ce(fe,Le){var Ne=[],ue=!0,Ae=!1,Pe=void 0;try{for(var Ue=fe[Symbol.iterator](),st;!(ue=(st=Ue.next()).done)&&(Ne.push(st.value),!(Le&&Ne.length===Le));ue=!0);}catch(dt){Ae=!0,Pe=dt}finally{try{!ue&&Ue.return&&Ue.return()}finally{if(Ae)throw Pe}}return Ne}return function(fe,Le){if(Array.isArray(fe))return fe;if(Symbol.iterator in Object(fe))return Ce(fe,Le);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),s=(function(){function Ce(fe,Le){for(var Ne=0;Ne<Le.length;Ne++){var ue=Le[Ne];ue.enumerable=ue.enumerable||!1,ue.configurable=!0,"value"in ue&&(ue.writable=!0),Object.defineProperty(fe,ue.key,ue)}}return function(fe,Le,Ne){return Le&&Ce(fe.prototype,Le),Ne&&Ce(fe,Ne),fe}})(),u=i(3),h=L(u),f=i(2),g=L(f),v=i(0),p=L(v),y=i(5),_=L(y),x=i(10),b=L(x),E=i(9),A=L(E),S=i(36),k=i(37),I=i(13),O=L(I),M=i(26),F=i(38),j=i(39),T=i(40);function L(Ce){return Ce&&Ce.__esModule?Ce:{default:Ce}}function $(Ce,fe,Le){return fe in Ce?Object.defineProperty(Ce,fe,{value:Le,enumerable:!0,configurable:!0,writable:!0}):Ce[fe]=Le,Ce}function q(Ce,fe){if(!(Ce instanceof fe))throw new TypeError("Cannot call a class as a function")}function J(Ce,fe){if(!Ce)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return fe&&(typeof fe=="object"||typeof fe=="function")?fe:Ce}function ae(Ce,fe){if(typeof fe!="function"&&fe!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof fe);Ce.prototype=Object.create(fe&&fe.prototype,{constructor:{value:Ce,enumerable:!1,writable:!0,configurable:!0}}),fe&&(Object.setPrototypeOf?Object.setPrototypeOf(Ce,fe):Ce.__proto__=fe)}var ie=(0,b.default)("quill:clipboard"),Z="__ql-matcher",te=[[Node.TEXT_NODE,Be],[Node.TEXT_NODE,Ee],["br",Re],[Node.ELEMENT_NODE,Ee],[Node.ELEMENT_NODE,ye],[Node.ELEMENT_NODE,ge],[Node.ELEMENT_NODE,de],[Node.ELEMENT_NODE,Te],["li",Me],["b",me.bind(me,"bold")],["i",me.bind(me,"italic")],["style",Oe]],V=[S.AlignAttribute,F.DirectionAttribute].reduce(function(Ce,fe){return Ce[fe.keyName]=fe,Ce},{}),B=[S.AlignStyle,k.BackgroundStyle,M.ColorStyle,F.DirectionStyle,j.FontStyle,T.SizeStyle].reduce(function(Ce,fe){return Ce[fe.keyName]=fe,Ce},{}),D=(function(Ce){ae(fe,Ce);function fe(Le,Ne){q(this,fe);var ue=J(this,(fe.__proto__||Object.getPrototypeOf(fe)).call(this,Le,Ne));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=[],te.concat(ue.options.matchers).forEach(function(Ae){var Pe=o(Ae,2),Ue=Pe[0],st=Pe[1];!Ne.matchVisual&&st===ge||ue.addMatcher(Ue,st)}),ue}return s(fe,[{key:"addMatcher",value:function(Ne,ue){this.matchers.push([Ne,ue])}},{key:"convert",value:function(Ne){if(typeof Ne=="string")return this.container.innerHTML=Ne.replace(/\>\r?\n +\</g,"><"),this.convert();var ue=this.quill.getFormat(this.quill.selection.savedRange.index);if(ue[O.default.blotName]){var Ae=this.container.innerText;return this.container.innerHTML="",new g.default().insert(Ae,$({},O.default.blotName,ue[O.default.blotName]))}var Pe=this.prepareMatching(),Ue=o(Pe,2),st=Ue[0],dt=Ue[1],pt=oe(this.container,st,dt);return ee(pt,`
145
+ `)&&pt.ops[pt.ops.length-1].attributes==null&&(pt=pt.compose(new g.default().retain(pt.length()-1).delete(1))),ie.log("convert",this.container.innerHTML,pt),this.container.innerHTML="",pt}},{key:"dangerouslyPasteHTML",value:function(Ne,ue){var Ae=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_.default.sources.API;if(typeof Ne=="string")this.quill.setContents(this.convert(Ne),ue),this.quill.setSelection(0,_.default.sources.SILENT);else{var Pe=this.convert(ue);this.quill.updateContents(new g.default().retain(Ne).concat(Pe),Ae),this.quill.setSelection(Ne+Pe.length(),_.default.sources.SILENT)}}},{key:"onPaste",value:function(Ne){var ue=this;if(!(Ne.defaultPrevented||!this.quill.isEnabled())){var Ae=this.quill.getSelection(),Pe=new g.default().retain(Ae.index),Ue=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(_.default.sources.SILENT),setTimeout(function(){Pe=Pe.concat(ue.convert()).delete(Ae.length),ue.quill.updateContents(Pe,_.default.sources.USER),ue.quill.setSelection(Pe.length()-Ae.length,_.default.sources.SILENT),ue.quill.scrollingContainer.scrollTop=Ue,ue.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var Ne=this,ue=[],Ae=[];return this.matchers.forEach(function(Pe){var Ue=o(Pe,2),st=Ue[0],dt=Ue[1];switch(st){case Node.TEXT_NODE:Ae.push(dt);break;case Node.ELEMENT_NODE:ue.push(dt);break;default:[].forEach.call(Ne.container.querySelectorAll(st),function(pt){pt[Z]=pt[Z]||[],pt[Z].push(dt)});break}}),[ue,Ae]}}]),fe})(A.default);D.DEFAULTS={matchers:[],matchVisual:!0};function U(Ce,fe,Le){return(typeof fe>"u"?"undefined":a(fe))==="object"?Object.keys(fe).reduce(function(Ne,ue){return U(Ne,ue,fe[ue])},Ce):Ce.reduce(function(Ne,ue){return ue.attributes&&ue.attributes[fe]?Ne.push(ue):Ne.insert(ue.insert,(0,h.default)({},$({},fe,Le),ue.attributes))},new g.default)}function X(Ce){if(Ce.nodeType!==Node.ELEMENT_NODE)return{};var fe="__ql-computed-style";return Ce[fe]||(Ce[fe]=window.getComputedStyle(Ce))}function ee(Ce,fe){for(var Le="",Ne=Ce.ops.length-1;Ne>=0&&Le.length<fe.length;--Ne){var ue=Ce.ops[Ne];if(typeof ue.insert!="string")break;Le=ue.insert+Le}return Le.slice(-1*fe.length)===fe}function K(Ce){if(Ce.childNodes.length===0)return!1;var fe=X(Ce);return["block","list-item"].indexOf(fe.display)>-1}function oe(Ce,fe,Le){return Ce.nodeType===Ce.TEXT_NODE?Le.reduce(function(Ne,ue){return ue(Ce,Ne)},new g.default):Ce.nodeType===Ce.ELEMENT_NODE?[].reduce.call(Ce.childNodes||[],function(Ne,ue){var Ae=oe(ue,fe,Le);return ue.nodeType===Ce.ELEMENT_NODE&&(Ae=fe.reduce(function(Pe,Ue){return Ue(ue,Pe)},Ae),Ae=(ue[Z]||[]).reduce(function(Pe,Ue){return Ue(ue,Pe)},Ae)),Ne.concat(Ae)},new g.default):new g.default}function me(Ce,fe,Le){return U(Le,Ce,!0)}function de(Ce,fe){var Le=p.default.Attributor.Attribute.keys(Ce),Ne=p.default.Attributor.Class.keys(Ce),ue=p.default.Attributor.Style.keys(Ce),Ae={};return Le.concat(Ne).concat(ue).forEach(function(Pe){var Ue=p.default.query(Pe,p.default.Scope.ATTRIBUTE);Ue!=null&&(Ae[Ue.attrName]=Ue.value(Ce),Ae[Ue.attrName])||(Ue=V[Pe],Ue!=null&&(Ue.attrName===Pe||Ue.keyName===Pe)&&(Ae[Ue.attrName]=Ue.value(Ce)||void 0),Ue=B[Pe],Ue!=null&&(Ue.attrName===Pe||Ue.keyName===Pe)&&(Ue=B[Pe],Ae[Ue.attrName]=Ue.value(Ce)||void 0))}),Object.keys(Ae).length>0&&(fe=U(fe,Ae)),fe}function ye(Ce,fe){var Le=p.default.query(Ce);if(Le==null)return fe;if(Le.prototype instanceof p.default.Embed){var Ne={},ue=Le.value(Ce);ue!=null&&(Ne[Le.blotName]=ue,fe=new g.default().insert(Ne,Le.formats(Ce)))}else typeof Le.formats=="function"&&(fe=U(fe,Le.blotName,Le.formats(Ce)));return fe}function Re(Ce,fe){return ee(fe,`
146
+ `)||fe.insert(`
147
+ `),fe}function Oe(){return new g.default}function Me(Ce,fe){var Le=p.default.query(Ce);if(Le==null||Le.blotName!=="list-item"||!ee(fe,`
148
+ `))return fe;for(var Ne=-1,ue=Ce.parentNode;!ue.classList.contains("ql-clipboard");)(p.default.query(ue)||{}).blotName==="list"&&(Ne+=1),ue=ue.parentNode;return Ne<=0?fe:fe.compose(new g.default().retain(fe.length()-1).retain(1,{indent:Ne}))}function Ee(Ce,fe){return ee(fe,`
149
+ `)||(K(Ce)||fe.length()>0&&Ce.nextSibling&&K(Ce.nextSibling))&&fe.insert(`
150
+ `),fe}function ge(Ce,fe){if(K(Ce)&&Ce.nextElementSibling!=null&&!ee(fe,`
151
+
152
+ `)){var Le=Ce.offsetHeight+parseFloat(X(Ce).marginTop)+parseFloat(X(Ce).marginBottom);Ce.nextElementSibling.offsetTop>Ce.offsetTop+Le*1.5&&fe.insert(`
153
+ `)}return fe}function Te(Ce,fe){var Le={},Ne=Ce.style||{};return Ne.fontStyle&&X(Ce).fontStyle==="italic"&&(Le.italic=!0),Ne.fontWeight&&(X(Ce).fontWeight.startsWith("bold")||parseInt(X(Ce).fontWeight)>=700)&&(Le.bold=!0),Object.keys(Le).length>0&&(fe=U(fe,Le)),parseFloat(Ne.textIndent||0)>0&&(fe=new g.default().insert(" ").concat(fe)),fe}function Be(Ce,fe){var Le=Ce.data;if(Ce.parentNode.tagName==="O:P")return fe.insert(Le.trim());if(Le.trim().length===0&&Ce.parentNode.classList.contains("ql-clipboard"))return fe;if(!X(Ce.parentNode).whiteSpace.startsWith("pre")){var Ne=function(Ae,Pe){return Pe=Pe.replace(/[^\u00a0]/g,""),Pe.length<1&&Ae?" ":Pe};Le=Le.replace(/\r\n/g," ").replace(/\n/g," "),Le=Le.replace(/\s\s+/g,Ne.bind(Ne,!0)),(Ce.previousSibling==null&&K(Ce.parentNode)||Ce.previousSibling!=null&&K(Ce.previousSibling))&&(Le=Le.replace(/^\s+/,Ne.bind(Ne,!1))),(Ce.nextSibling==null&&K(Ce.parentNode)||Ce.nextSibling!=null&&K(Ce.nextSibling))&&(Le=Le.replace(/\s+$/,Ne.bind(Ne,!1)))}return fe.insert(Le)}r.default=D,r.matchAttributor=de,r.matchBlot=ye,r.matchNewline=Ee,r.matchSpacing=ge,r.matchText=Be}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function y(_,x){for(var b=0;b<x.length;b++){var E=x[b];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(_,E.key,E)}}return function(_,x,b){return x&&y(_.prototype,x),b&&y(_,b),_}})(),o=function y(_,x,b){_===null&&(_=Function.prototype);var E=Object.getOwnPropertyDescriptor(_,x);if(E===void 0){var A=Object.getPrototypeOf(_);return A===null?void 0:y(A,x,b)}else{if("value"in E)return E.value;var S=E.get;return S===void 0?void 0:S.call(b)}},s=i(6),u=h(s);function h(y){return y&&y.__esModule?y:{default:y}}function f(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function g(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function v(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var p=(function(y){v(_,y);function _(){return f(this,_),g(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,[{key:"optimize",value:function(b){o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"optimize",this).call(this,b),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return o(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),_})(u.default);p.blotName="bold",p.tagName=["STRONG","B"],r.default=p}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.addControls=r.default=void 0;var a=(function(){function T(L,$){var q=[],J=!0,ae=!1,ie=void 0;try{for(var Z=L[Symbol.iterator](),te;!(J=(te=Z.next()).done)&&(q.push(te.value),!($&&q.length===$));J=!0);}catch(V){ae=!0,ie=V}finally{try{!J&&Z.return&&Z.return()}finally{if(ae)throw ie}}return q}return function(L,$){if(Array.isArray(L))return L;if(Symbol.iterator in Object(L))return T(L,$);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=(function(){function T(L,$){for(var q=0;q<$.length;q++){var J=$[q];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(L,J.key,J)}}return function(L,$,q){return $&&T(L.prototype,$),q&&T(L,q),L}})(),s=i(2),u=b(s),h=i(0),f=b(h),g=i(5),v=b(g),p=i(10),y=b(p),_=i(9),x=b(_);function b(T){return T&&T.__esModule?T:{default:T}}function E(T,L,$){return L in T?Object.defineProperty(T,L,{value:$,enumerable:!0,configurable:!0,writable:!0}):T[L]=$,T}function A(T,L){if(!(T instanceof L))throw new TypeError("Cannot call a class as a function")}function S(T,L){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:T}function k(T,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);T.prototype=Object.create(L&&L.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(T,L):T.__proto__=L)}var I=(0,y.default)("quill:toolbar"),O=(function(T){k(L,T);function L($,q){A(this,L);var J=S(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,$,q));if(Array.isArray(J.options.container)){var ae=document.createElement("div");F(ae,J.options.container),$.container.parentNode.insertBefore(ae,$.container),J.container=ae}else typeof J.options.container=="string"?J.container=document.querySelector(J.options.container):J.container=J.options.container;if(!(J.container instanceof HTMLElement)){var ie;return ie=I.error("Container required for toolbar",J.options),S(J,ie)}return J.container.classList.add("ql-toolbar"),J.controls=[],J.handlers={},Object.keys(J.options.handlers).forEach(function(Z){J.addHandler(Z,J.options.handlers[Z])}),[].forEach.call(J.container.querySelectorAll("button, select"),function(Z){J.attach(Z)}),J.quill.on(v.default.events.EDITOR_CHANGE,function(Z,te){Z===v.default.events.SELECTION_CHANGE&&J.update(te)}),J.quill.on(v.default.events.SCROLL_OPTIMIZE,function(){var Z=J.quill.selection.getRange(),te=a(Z,1),V=te[0];J.update(V)}),J}return o(L,[{key:"addHandler",value:function(q,J){this.handlers[q]=J}},{key:"attach",value:function(q){var J=this,ae=[].find.call(q.classList,function(Z){return Z.indexOf("ql-")===0});if(ae){if(ae=ae.slice(3),q.tagName==="BUTTON"&&q.setAttribute("type","button"),this.handlers[ae]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[ae]==null){I.warn("ignoring attaching to disabled format",ae,q);return}if(f.default.query(ae)==null){I.warn("ignoring attaching to nonexistent format",ae,q);return}}var ie=q.tagName==="SELECT"?"change":"click";q.addEventListener(ie,function(Z){var te=void 0;if(q.tagName==="SELECT"){if(q.selectedIndex<0)return;var V=q.options[q.selectedIndex];V.hasAttribute("selected")?te=!1:te=V.value||!1}else q.classList.contains("ql-active")?te=!1:te=q.value||!q.hasAttribute("value"),Z.preventDefault();J.quill.focus();var B=J.quill.selection.getRange(),D=a(B,1),U=D[0];if(J.handlers[ae]!=null)J.handlers[ae].call(J,te);else if(f.default.query(ae).prototype instanceof f.default.Embed){if(te=prompt("Enter "+ae),!te)return;J.quill.updateContents(new u.default().retain(U.index).delete(U.length).insert(E({},ae,te)),v.default.sources.USER)}else J.quill.format(ae,te,v.default.sources.USER);J.update(U)}),this.controls.push([ae,q])}}},{key:"update",value:function(q){var J=q==null?{}:this.quill.getFormat(q);this.controls.forEach(function(ae){var ie=a(ae,2),Z=ie[0],te=ie[1];if(te.tagName==="SELECT"){var V=void 0;if(q==null)V=null;else if(J[Z]==null)V=te.querySelector("option[selected]");else if(!Array.isArray(J[Z])){var B=J[Z];typeof B=="string"&&(B=B.replace(/\"/g,'\\"')),V=te.querySelector('option[value="'+B+'"]')}V==null?(te.value="",te.selectedIndex=-1):V.selected=!0}else if(q==null)te.classList.remove("ql-active");else if(te.hasAttribute("value")){var D=J[Z]===te.getAttribute("value")||J[Z]!=null&&J[Z].toString()===te.getAttribute("value")||J[Z]==null&&!te.getAttribute("value");te.classList.toggle("ql-active",D)}else te.classList.toggle("ql-active",J[Z]!=null)})}}]),L})(x.default);O.DEFAULTS={};function M(T,L,$){var q=document.createElement("button");q.setAttribute("type","button"),q.classList.add("ql-"+L),$!=null&&(q.value=$),T.appendChild(q)}function F(T,L){Array.isArray(L[0])||(L=[L]),L.forEach(function($){var q=document.createElement("span");q.classList.add("ql-formats"),$.forEach(function(J){if(typeof J=="string")M(q,J);else{var ae=Object.keys(J)[0],ie=J[ae];Array.isArray(ie)?j(q,ae,ie):M(q,ae,ie)}}),T.appendChild(q)})}function j(T,L,$){var q=document.createElement("select");q.classList.add("ql-"+L),$.forEach(function(J){var ae=document.createElement("option");J!==!1?ae.setAttribute("value",J):ae.setAttribute("selected","selected"),q.appendChild(ae)}),T.appendChild(q)}O.DEFAULTS={container:null,handlers:{clean:function(){var L=this,$=this.quill.getSelection();if($!=null)if($.length==0){var q=this.quill.getFormat();Object.keys(q).forEach(function(J){f.default.query(J,f.default.Scope.INLINE)!=null&&L.quill.format(J,!1)})}else this.quill.removeFormat($,v.default.sources.USER)},direction:function(L){var $=this.quill.getFormat().align;L==="rtl"&&$==null?this.quill.format("align","right",v.default.sources.USER):!L&&$==="right"&&this.quill.format("align",!1,v.default.sources.USER),this.quill.format("direction",L,v.default.sources.USER)},indent:function(L){var $=this.quill.getSelection(),q=this.quill.getFormat($),J=parseInt(q.indent||0);if(L==="+1"||L==="-1"){var ae=L==="+1"?1:-1;q.direction==="rtl"&&(ae*=-1),this.quill.format("indent",J+ae,v.default.sources.USER)}},link:function(L){L===!0&&(L=prompt("Enter link URL:")),this.quill.format("link",L,v.default.sources.USER)},list:function(L){var $=this.quill.getSelection(),q=this.quill.getFormat($);L==="check"?q.list==="checked"||q.list==="unchecked"?this.quill.format("list",!1,v.default.sources.USER):this.quill.format("list","unchecked",v.default.sources.USER):this.quill.format("list",L,v.default.sources.USER)}}},r.default=O,r.addControls=F}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function y(_,x){for(var b=0;b<x.length;b++){var E=x[b];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(_,E.key,E)}}return function(_,x,b){return x&&y(_.prototype,x),b&&y(_,b),_}})(),o=function y(_,x,b){_===null&&(_=Function.prototype);var E=Object.getOwnPropertyDescriptor(_,x);if(E===void 0){var A=Object.getPrototypeOf(_);return A===null?void 0:y(A,x,b)}else{if("value"in E)return E.value;var S=E.get;return S===void 0?void 0:S.call(b)}},s=i(28),u=h(s);function h(y){return y&&y.__esModule?y:{default:y}}function f(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function g(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function v(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var p=(function(y){v(_,y);function _(x,b){f(this,_);var E=g(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,x));return E.label.innerHTML=b,E.container.classList.add("ql-color-picker"),[].slice.call(E.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(A){A.classList.add("ql-primary")}),E}return a(_,[{key:"buildItem",value:function(b){var E=o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"buildItem",this).call(this,b);return E.style.backgroundColor=b.getAttribute("value")||"",E}},{key:"selectItem",value:function(b,E){o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"selectItem",this).call(this,b,E);var A=this.label.querySelector(".ql-color-label"),S=b&&b.getAttribute("data-value")||"";A&&(A.tagName==="line"?A.style.stroke=S:A.style.fill=S)}}]),_})(u.default);r.default=p}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function y(_,x){for(var b=0;b<x.length;b++){var E=x[b];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(_,E.key,E)}}return function(_,x,b){return x&&y(_.prototype,x),b&&y(_,b),_}})(),o=function y(_,x,b){_===null&&(_=Function.prototype);var E=Object.getOwnPropertyDescriptor(_,x);if(E===void 0){var A=Object.getPrototypeOf(_);return A===null?void 0:y(A,x,b)}else{if("value"in E)return E.value;var S=E.get;return S===void 0?void 0:S.call(b)}},s=i(28),u=h(s);function h(y){return y&&y.__esModule?y:{default:y}}function f(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function g(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function v(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var p=(function(y){v(_,y);function _(x,b){f(this,_);var E=g(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,x));return E.container.classList.add("ql-icon-picker"),[].forEach.call(E.container.querySelectorAll(".ql-picker-item"),function(A){A.innerHTML=b[A.getAttribute("data-value")||""]}),E.defaultItem=E.container.querySelector(".ql-selected"),E.selectItem(E.defaultItem),E}return a(_,[{key:"selectItem",value:function(b,E){o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"selectItem",this).call(this,b,E),b=b||this.defaultItem,this.label.innerHTML=b.innerHTML}}]),_})(u.default);r.default=p}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function u(h,f){for(var g=0;g<f.length;g++){var v=f[g];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(h,v.key,v)}}return function(h,f,g){return f&&u(h.prototype,f),g&&u(h,g),h}})();function o(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}var s=(function(){function u(h,f){var g=this;o(this,u),this.quill=h,this.boundsContainer=f||document.body,this.root=h.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){g.root.style.marginTop=-1*g.quill.root.scrollTop+"px"}),this.hide()}return a(u,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(f){var g=f.left+f.width/2-this.root.offsetWidth/2,v=f.bottom+this.quill.root.scrollTop;this.root.style.left=g+"px",this.root.style.top=v+"px",this.root.classList.remove("ql-flip");var p=this.boundsContainer.getBoundingClientRect(),y=this.root.getBoundingClientRect(),_=0;if(y.right>p.right&&(_=p.right-y.right,this.root.style.left=g+_+"px"),y.left<p.left&&(_=p.left-y.left,this.root.style.left=g+_+"px"),y.bottom>p.bottom){var x=y.bottom-y.top,b=f.bottom-f.top+x;this.root.style.top=v-b+"px",this.root.classList.add("ql-flip")}return _}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),u})();r.default=s}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function j(T,L){var $=[],q=!0,J=!1,ae=void 0;try{for(var ie=T[Symbol.iterator](),Z;!(q=(Z=ie.next()).done)&&($.push(Z.value),!(L&&$.length===L));q=!0);}catch(te){J=!0,ae=te}finally{try{!q&&ie.return&&ie.return()}finally{if(J)throw ae}}return $}return function(T,L){if(Array.isArray(T))return T;if(Symbol.iterator in Object(T))return j(T,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=function j(T,L,$){T===null&&(T=Function.prototype);var q=Object.getOwnPropertyDescriptor(T,L);if(q===void 0){var J=Object.getPrototypeOf(T);return J===null?void 0:j(J,L,$)}else{if("value"in q)return q.value;var ae=q.get;return ae===void 0?void 0:ae.call($)}},s=(function(){function j(T,L){for(var $=0;$<L.length;$++){var q=L[$];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(T,q.key,q)}}return function(T,L,$){return L&&j(T.prototype,L),$&&j(T,$),T}})(),u=i(3),h=A(u),f=i(8),g=A(f),v=i(43),p=A(v),y=i(27),_=A(y),x=i(15),b=i(41),E=A(b);function A(j){return j&&j.__esModule?j:{default:j}}function S(j,T){if(!(j instanceof T))throw new TypeError("Cannot call a class as a function")}function k(j,T){if(!j)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:j}function I(j,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);j.prototype=Object.create(T&&T.prototype,{constructor:{value:j,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(j,T):j.__proto__=T)}var O=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],M=(function(j){I(T,j);function T(L,$){S(this,T),$.modules.toolbar!=null&&$.modules.toolbar.container==null&&($.modules.toolbar.container=O);var q=k(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,L,$));return q.quill.container.classList.add("ql-snow"),q}return s(T,[{key:"extendToolbar",value:function($){$.container.classList.add("ql-snow"),this.buildButtons([].slice.call($.container.querySelectorAll("button")),E.default),this.buildPickers([].slice.call($.container.querySelectorAll("select")),E.default),this.tooltip=new F(this.quill,this.options.bounds),$.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(q,J){$.handlers.link.call($,!J.format.link)})}}]),T})(p.default);M.DEFAULTS=(0,h.default)(!0,{},p.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(T){if(T){var L=this.quill.getSelection();if(L==null||L.length==0)return;var $=this.quill.getText(L);/^\S+@\S+\.\S+$/.test($)&&$.indexOf("mailto:")!==0&&($="mailto:"+$);var q=this.quill.theme.tooltip;q.edit("link",$)}else this.quill.format("link",!1)}}}}});var F=(function(j){I(T,j);function T(L,$){S(this,T);var q=k(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,L,$));return q.preview=q.root.querySelector("a.ql-preview"),q}return s(T,[{key:"listen",value:function(){var $=this;o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(q){$.root.classList.contains("ql-editing")?$.save():$.edit("link",$.preview.textContent),q.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(q){if($.linkRange!=null){var J=$.linkRange;$.restoreFocus(),$.quill.formatText(J,"link",!1,g.default.sources.USER),delete $.linkRange}q.preventDefault(),$.hide()}),this.quill.on(g.default.events.SELECTION_CHANGE,function(q,J,ae){if(q!=null){if(q.length===0&&ae===g.default.sources.USER){var ie=$.quill.scroll.descendant(_.default,q.index),Z=a(ie,2),te=Z[0],V=Z[1];if(te!=null){$.linkRange=new x.Range(q.index-V,te.length());var B=_.default.formats(te.domNode);$.preview.textContent=B,$.preview.setAttribute("href",B),$.show(),$.position($.quill.getBounds($.linkRange));return}}else delete $.linkRange;$.hide()}})}},{key:"show",value:function(){o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),T})(v.BaseTooltip);F.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),r.default=M}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=i(29),o=ue(a),s=i(36),u=i(38),h=i(64),f=i(65),g=ue(f),v=i(66),p=ue(v),y=i(67),_=ue(y),x=i(37),b=i(26),E=i(39),A=i(40),S=i(56),k=ue(S),I=i(68),O=ue(I),M=i(27),F=ue(M),j=i(69),T=ue(j),L=i(70),$=ue(L),q=i(71),J=ue(q),ae=i(72),ie=ue(ae),Z=i(73),te=ue(Z),V=i(13),B=ue(V),D=i(74),U=ue(D),X=i(75),ee=ue(X),K=i(57),oe=ue(K),me=i(41),de=ue(me),ye=i(28),Re=ue(ye),Oe=i(59),Me=ue(Oe),Ee=i(60),ge=ue(Ee),Te=i(61),Be=ue(Te),Ce=i(108),fe=ue(Ce),Le=i(62),Ne=ue(Le);function ue(Ae){return Ae&&Ae.__esModule?Ae:{default:Ae}}o.default.register({"attributors/attribute/direction":u.DirectionAttribute,"attributors/class/align":s.AlignClass,"attributors/class/background":x.BackgroundClass,"attributors/class/color":b.ColorClass,"attributors/class/direction":u.DirectionClass,"attributors/class/font":E.FontClass,"attributors/class/size":A.SizeClass,"attributors/style/align":s.AlignStyle,"attributors/style/background":x.BackgroundStyle,"attributors/style/color":b.ColorStyle,"attributors/style/direction":u.DirectionStyle,"attributors/style/font":E.FontStyle,"attributors/style/size":A.SizeStyle},!0),o.default.register({"formats/align":s.AlignClass,"formats/direction":u.DirectionClass,"formats/indent":h.IndentClass,"formats/background":x.BackgroundStyle,"formats/color":b.ColorStyle,"formats/font":E.FontClass,"formats/size":A.SizeClass,"formats/blockquote":g.default,"formats/code-block":B.default,"formats/header":p.default,"formats/list":_.default,"formats/bold":k.default,"formats/code":V.Code,"formats/italic":O.default,"formats/link":F.default,"formats/script":T.default,"formats/strike":$.default,"formats/underline":J.default,"formats/image":ie.default,"formats/video":te.default,"formats/list/item":y.ListItem,"modules/formula":U.default,"modules/syntax":ee.default,"modules/toolbar":oe.default,"themes/bubble":fe.default,"themes/snow":Ne.default,"ui/icons":de.default,"ui/picker":Re.default,"ui/icon-picker":ge.default,"ui/color-picker":Me.default,"ui/tooltip":Be.default},!0),r.default=o.default}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.IndentClass=void 0;var a=(function(){function _(x,b){for(var E=0;E<b.length;E++){var A=b[E];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(x,A.key,A)}}return function(x,b,E){return b&&_(x.prototype,b),E&&_(x,E),x}})(),o=function _(x,b,E){x===null&&(x=Function.prototype);var A=Object.getOwnPropertyDescriptor(x,b);if(A===void 0){var S=Object.getPrototypeOf(x);return S===null?void 0:_(S,b,E)}else{if("value"in A)return A.value;var k=A.get;return k===void 0?void 0:k.call(E)}},s=i(0),u=h(s);function h(_){return _&&_.__esModule?_:{default:_}}function f(_,x){if(!(_ instanceof x))throw new TypeError("Cannot call a class as a function")}function g(_,x){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:_}function v(_,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);_.prototype=Object.create(x&&x.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(_,x):_.__proto__=x)}var p=(function(_){v(x,_);function x(){return f(this,x),g(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return a(x,[{key:"add",value:function(E,A){if(A==="+1"||A==="-1"){var S=this.value(E)||0;A=A==="+1"?S+1:S-1}return A===0?(this.remove(E),!0):o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"add",this).call(this,E,A)}},{key:"canAdd",value:function(E,A){return o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"canAdd",this).call(this,E,A)||o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"canAdd",this).call(this,E,parseInt(A))}},{key:"value",value:function(E){return parseInt(o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"value",this).call(this,E))||void 0}}]),x})(u.default.Attributor.Class),y=new p("indent","ql-indent",{scope:u.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});r.IndentClass=y}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=i(4),o=s(a);function s(v){return v&&v.__esModule?v:{default:v}}function u(v,p){if(!(v instanceof p))throw new TypeError("Cannot call a class as a function")}function h(v,p){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:v}function f(v,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);v.prototype=Object.create(p&&p.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(v,p):v.__proto__=p)}var g=(function(v){f(p,v);function p(){return u(this,p),h(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p})(o.default);g.blotName="blockquote",g.tagName="blockquote",r.default=g}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function p(y,_){for(var x=0;x<_.length;x++){var b=_[x];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(y,b.key,b)}}return function(y,_,x){return _&&p(y.prototype,_),x&&p(y,x),y}})(),o=i(4),s=u(o);function u(p){return p&&p.__esModule?p:{default:p}}function h(p,y){if(!(p instanceof y))throw new TypeError("Cannot call a class as a function")}function f(p,y){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:p}function g(p,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);p.prototype=Object.create(y&&y.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(p,y):p.__proto__=y)}var v=(function(p){g(y,p);function y(){return h(this,y),f(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,null,[{key:"formats",value:function(x){return this.tagName.indexOf(x.tagName)+1}}]),y})(s.default);v.blotName="header",v.tagName=["H1","H2","H3","H4","H5","H6"],r.default=v}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.ListItem=void 0;var a=(function(){function S(k,I){for(var O=0;O<I.length;O++){var M=I[O];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(k,M.key,M)}}return function(k,I,O){return I&&S(k.prototype,I),O&&S(k,O),k}})(),o=function S(k,I,O){k===null&&(k=Function.prototype);var M=Object.getOwnPropertyDescriptor(k,I);if(M===void 0){var F=Object.getPrototypeOf(k);return F===null?void 0:S(F,I,O)}else{if("value"in M)return M.value;var j=M.get;return j===void 0?void 0:j.call(O)}},s=i(0),u=p(s),h=i(4),f=p(h),g=i(25),v=p(g);function p(S){return S&&S.__esModule?S:{default:S}}function y(S,k,I){return k in S?Object.defineProperty(S,k,{value:I,enumerable:!0,configurable:!0,writable:!0}):S[k]=I,S}function _(S,k){if(!(S instanceof k))throw new TypeError("Cannot call a class as a function")}function x(S,k){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:S}function b(S,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);S.prototype=Object.create(k&&k.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(S,k):S.__proto__=k)}var E=(function(S){b(k,S);function k(){return _(this,k),x(this,(k.__proto__||Object.getPrototypeOf(k)).apply(this,arguments))}return a(k,[{key:"format",value:function(O,M){O===A.blotName&&!M?this.replaceWith(u.default.create(this.statics.scope)):o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"format",this).call(this,O,M)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(O,M){return this.parent.isolate(this.offset(this.parent),this.length()),O===this.parent.statics.blotName?(this.parent.replaceWith(O,M),this):(this.parent.unwrap(),o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"replaceWith",this).call(this,O,M))}}],[{key:"formats",value:function(O){return O.tagName===this.tagName?void 0:o(k.__proto__||Object.getPrototypeOf(k),"formats",this).call(this,O)}}]),k})(f.default);E.blotName="list-item",E.tagName="LI";var A=(function(S){b(k,S),a(k,null,[{key:"create",value:function(O){var M=O==="ordered"?"OL":"UL",F=o(k.__proto__||Object.getPrototypeOf(k),"create",this).call(this,M);return(O==="checked"||O==="unchecked")&&F.setAttribute("data-checked",O==="checked"),F}},{key:"formats",value:function(O){if(O.tagName==="OL")return"ordered";if(O.tagName==="UL")return O.hasAttribute("data-checked")?O.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function k(I){_(this,k);var O=x(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,I)),M=function(j){if(j.target.parentNode===I){var T=O.statics.formats(I),L=u.default.find(j.target);T==="checked"?L.format("list","unchecked"):T==="unchecked"&&L.format("list","checked")}};return I.addEventListener("touchstart",M),I.addEventListener("mousedown",M),O}return a(k,[{key:"format",value:function(O,M){this.children.length>0&&this.children.tail.format(O,M)}},{key:"formats",value:function(){return y({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(O,M){if(O instanceof E)o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"insertBefore",this).call(this,O,M);else{var F=M==null?this.length():M.offset(this),j=this.split(F);j.parent.insertBefore(O,j)}}},{key:"optimize",value:function(O){o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"optimize",this).call(this,O);var M=this.next;M!=null&&M.prev===this&&M.statics.blotName===this.statics.blotName&&M.domNode.tagName===this.domNode.tagName&&M.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(M.moveChildren(this),M.remove())}},{key:"replace",value:function(O){if(O.statics.blotName!==this.statics.blotName){var M=u.default.create(this.statics.defaultChild);O.moveChildren(M),this.appendChild(M)}o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"replace",this).call(this,O)}}]),k})(v.default);A.blotName="list",A.scope=u.default.Scope.BLOCK_BLOT,A.tagName=["OL","UL"],A.defaultChild="list-item",A.allowedChildren=[E],r.ListItem=E,r.default=A}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=i(56),o=s(a);function s(v){return v&&v.__esModule?v:{default:v}}function u(v,p){if(!(v instanceof p))throw new TypeError("Cannot call a class as a function")}function h(v,p){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:v}function f(v,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);v.prototype=Object.create(p&&p.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(v,p):v.__proto__=p)}var g=(function(v){f(p,v);function p(){return u(this,p),h(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p})(o.default);g.blotName="italic",g.tagName=["EM","I"],r.default=g}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function y(_,x){for(var b=0;b<x.length;b++){var E=x[b];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(_,E.key,E)}}return function(_,x,b){return x&&y(_.prototype,x),b&&y(_,b),_}})(),o=function y(_,x,b){_===null&&(_=Function.prototype);var E=Object.getOwnPropertyDescriptor(_,x);if(E===void 0){var A=Object.getPrototypeOf(_);return A===null?void 0:y(A,x,b)}else{if("value"in E)return E.value;var S=E.get;return S===void 0?void 0:S.call(b)}},s=i(6),u=h(s);function h(y){return y&&y.__esModule?y:{default:y}}function f(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function g(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function v(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var p=(function(y){v(_,y);function _(){return f(this,_),g(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,null,[{key:"create",value:function(b){return b==="super"?document.createElement("sup"):b==="sub"?document.createElement("sub"):o(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this,b)}},{key:"formats",value:function(b){if(b.tagName==="SUB")return"sub";if(b.tagName==="SUP")return"super"}}]),_})(u.default);p.blotName="script",p.tagName=["SUB","SUP"],r.default=p}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=i(6),o=s(a);function s(v){return v&&v.__esModule?v:{default:v}}function u(v,p){if(!(v instanceof p))throw new TypeError("Cannot call a class as a function")}function h(v,p){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:v}function f(v,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);v.prototype=Object.create(p&&p.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(v,p):v.__proto__=p)}var g=(function(v){f(p,v);function p(){return u(this,p),h(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p})(o.default);g.blotName="strike",g.tagName="S",r.default=g}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=i(6),o=s(a);function s(v){return v&&v.__esModule?v:{default:v}}function u(v,p){if(!(v instanceof p))throw new TypeError("Cannot call a class as a function")}function h(v,p){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:v}function f(v,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);v.prototype=Object.create(p&&p.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(v,p):v.__proto__=p)}var g=(function(v){f(p,v);function p(){return u(this,p),h(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p})(o.default);g.blotName="underline",g.tagName="U",r.default=g}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function x(b,E){for(var A=0;A<E.length;A++){var S=E[A];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(b,S.key,S)}}return function(b,E,A){return E&&x(b.prototype,E),A&&x(b,A),b}})(),o=function x(b,E,A){b===null&&(b=Function.prototype);var S=Object.getOwnPropertyDescriptor(b,E);if(S===void 0){var k=Object.getPrototypeOf(b);return k===null?void 0:x(k,E,A)}else{if("value"in S)return S.value;var I=S.get;return I===void 0?void 0:I.call(A)}},s=i(0),u=f(s),h=i(27);function f(x){return x&&x.__esModule?x:{default:x}}function g(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}function v(x,b){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:x}function p(x,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);x.prototype=Object.create(b&&b.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(x,b):x.__proto__=b)}var y=["alt","height","width"],_=(function(x){p(b,x);function b(){return g(this,b),v(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"format",value:function(A,S){y.indexOf(A)>-1?S?this.domNode.setAttribute(A,S):this.domNode.removeAttribute(A):o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,A,S)}}],[{key:"create",value:function(A){var S=o(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,A);return typeof A=="string"&&S.setAttribute("src",this.sanitize(A)),S}},{key:"formats",value:function(A){return y.reduce(function(S,k){return A.hasAttribute(k)&&(S[k]=A.getAttribute(k)),S},{})}},{key:"match",value:function(A){return/\.(jpe?g|gif|png)$/.test(A)||/^data:image\/.+;base64/.test(A)}},{key:"sanitize",value:function(A){return(0,h.sanitize)(A,["http","https","data"])?A:"//:0"}},{key:"value",value:function(A){return A.getAttribute("src")}}]),b})(u.default.Embed);_.blotName="image",_.tagName="IMG",r.default=_}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0});var a=(function(){function x(b,E){for(var A=0;A<E.length;A++){var S=E[A];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(b,S.key,S)}}return function(b,E,A){return E&&x(b.prototype,E),A&&x(b,A),b}})(),o=function x(b,E,A){b===null&&(b=Function.prototype);var S=Object.getOwnPropertyDescriptor(b,E);if(S===void 0){var k=Object.getPrototypeOf(b);return k===null?void 0:x(k,E,A)}else{if("value"in S)return S.value;var I=S.get;return I===void 0?void 0:I.call(A)}},s=i(4),u=i(27),h=f(u);function f(x){return x&&x.__esModule?x:{default:x}}function g(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}function v(x,b){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:x}function p(x,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);x.prototype=Object.create(b&&b.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(x,b):x.__proto__=b)}var y=["height","width"],_=(function(x){p(b,x);function b(){return g(this,b),v(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"format",value:function(A,S){y.indexOf(A)>-1?S?this.domNode.setAttribute(A,S):this.domNode.removeAttribute(A):o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,A,S)}}],[{key:"create",value:function(A){var S=o(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,A);return S.setAttribute("frameborder","0"),S.setAttribute("allowfullscreen",!0),S.setAttribute("src",this.sanitize(A)),S}},{key:"formats",value:function(A){return y.reduce(function(S,k){return A.hasAttribute(k)&&(S[k]=A.getAttribute(k)),S},{})}},{key:"sanitize",value:function(A){return h.default.sanitize(A)}},{key:"value",value:function(A){return A.getAttribute("src")}}]),b})(s.BlockEmbed);_.blotName="video",_.className="ql-video",_.tagName="IFRAME",r.default=_}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.FormulaBlot=void 0;var a=(function(){function A(S,k){for(var I=0;I<k.length;I++){var O=k[I];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(S,O.key,O)}}return function(S,k,I){return k&&A(S.prototype,k),I&&A(S,I),S}})(),o=function A(S,k,I){S===null&&(S=Function.prototype);var O=Object.getOwnPropertyDescriptor(S,k);if(O===void 0){var M=Object.getPrototypeOf(S);return M===null?void 0:A(M,k,I)}else{if("value"in O)return O.value;var F=O.get;return F===void 0?void 0:F.call(I)}},s=i(35),u=p(s),h=i(5),f=p(h),g=i(9),v=p(g);function p(A){return A&&A.__esModule?A:{default:A}}function y(A,S){if(!(A instanceof S))throw new TypeError("Cannot call a class as a function")}function _(A,S){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:A}function x(A,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);A.prototype=Object.create(S&&S.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(A,S):A.__proto__=S)}var b=(function(A){x(S,A);function S(){return y(this,S),_(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return a(S,null,[{key:"create",value:function(I){var O=o(S.__proto__||Object.getPrototypeOf(S),"create",this).call(this,I);return typeof I=="string"&&(window.katex.render(I,O,{throwOnError:!1,errorColor:"#f00"}),O.setAttribute("data-value",I)),O}},{key:"value",value:function(I){return I.getAttribute("data-value")}}]),S})(u.default);b.blotName="formula",b.className="ql-formula",b.tagName="SPAN";var E=(function(A){x(S,A),a(S,null,[{key:"register",value:function(){f.default.register(b,!0)}}]);function S(){y(this,S);var k=_(this,(S.__proto__||Object.getPrototypeOf(S)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return k}return S})(v.default);r.FormulaBlot=b,r.default=E}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.CodeToken=r.CodeBlock=void 0;var a=(function(){function I(O,M){for(var F=0;F<M.length;F++){var j=M[F];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(O,j.key,j)}}return function(O,M,F){return M&&I(O.prototype,M),F&&I(O,F),O}})(),o=function I(O,M,F){O===null&&(O=Function.prototype);var j=Object.getOwnPropertyDescriptor(O,M);if(j===void 0){var T=Object.getPrototypeOf(O);return T===null?void 0:I(T,M,F)}else{if("value"in j)return j.value;var L=j.get;return L===void 0?void 0:L.call(F)}},s=i(0),u=_(s),h=i(5),f=_(h),g=i(9),v=_(g),p=i(13),y=_(p);function _(I){return I&&I.__esModule?I:{default:I}}function x(I,O){if(!(I instanceof O))throw new TypeError("Cannot call a class as a function")}function b(I,O){if(!I)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:I}function E(I,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);I.prototype=Object.create(O&&O.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(I,O):I.__proto__=O)}var A=(function(I){E(O,I);function O(){return x(this,O),b(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return a(O,[{key:"replaceWith",value:function(F){this.domNode.textContent=this.domNode.textContent,this.attach(),o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"replaceWith",this).call(this,F)}},{key:"highlight",value:function(F){var j=this.domNode.textContent;this.cachedText!==j&&((j.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=F(j),this.domNode.normalize(),this.attach()),this.cachedText=j)}}]),O})(y.default);A.className="ql-syntax";var S=new u.default.Attributor.Class("token","hljs",{scope:u.default.Scope.INLINE}),k=(function(I){E(O,I),a(O,null,[{key:"register",value:function(){f.default.register(S,!0),f.default.register(A,!0)}}]);function O(M,F){x(this,O);var j=b(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,M,F));if(typeof j.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var T=null;return j.quill.on(f.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(T),T=setTimeout(function(){j.highlight(),T=null},j.options.interval)}),j.highlight(),j}return a(O,[{key:"highlight",value:function(){var F=this;if(!this.quill.selection.composing){this.quill.update(f.default.sources.USER);var j=this.quill.getSelection();this.quill.scroll.descendants(A).forEach(function(T){T.highlight(F.options.highlight)}),this.quill.update(f.default.sources.SILENT),j!=null&&this.quill.setSelection(j,f.default.sources.SILENT)}}}]),O})(v.default);k.DEFAULTS={highlight:(function(){return window.hljs==null?null:function(I){var O=window.hljs.highlightAuto(I);return O.value}})(),interval:1e3},r.CodeBlock=A,r.CodeToken=S,r.default=k}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'}),(function(n,r){n.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'}),(function(n,r){n.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'}),(function(n,r){n.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'}),(function(n,r){n.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'}),(function(n,r){n.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'}),(function(n,r,i){Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.BubbleTooltip=void 0;var a=function O(M,F,j){M===null&&(M=Function.prototype);var T=Object.getOwnPropertyDescriptor(M,F);if(T===void 0){var L=Object.getPrototypeOf(M);return L===null?void 0:O(L,F,j)}else{if("value"in T)return T.value;var $=T.get;return $===void 0?void 0:$.call(j)}},o=(function(){function O(M,F){for(var j=0;j<F.length;j++){var T=F[j];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(M,T.key,T)}}return function(M,F,j){return F&&O(M.prototype,F),j&&O(M,j),M}})(),s=i(3),u=x(s),h=i(8),f=x(h),g=i(43),v=x(g),p=i(15),y=i(41),_=x(y);function x(O){return O&&O.__esModule?O:{default:O}}function b(O,M){if(!(O instanceof M))throw new TypeError("Cannot call a class as a function")}function E(O,M){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:O}function A(O,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);O.prototype=Object.create(M&&M.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(O,M):O.__proto__=M)}var S=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],k=(function(O){A(M,O);function M(F,j){b(this,M),j.modules.toolbar!=null&&j.modules.toolbar.container==null&&(j.modules.toolbar.container=S);var T=E(this,(M.__proto__||Object.getPrototypeOf(M)).call(this,F,j));return T.quill.container.classList.add("ql-bubble"),T}return o(M,[{key:"extendToolbar",value:function(j){this.tooltip=new I(this.quill,this.options.bounds),this.tooltip.root.appendChild(j.container),this.buildButtons([].slice.call(j.container.querySelectorAll("button")),_.default),this.buildPickers([].slice.call(j.container.querySelectorAll("select")),_.default)}}]),M})(v.default);k.DEFAULTS=(0,u.default)(!0,{},v.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(M){M?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var I=(function(O){A(M,O);function M(F,j){b(this,M);var T=E(this,(M.__proto__||Object.getPrototypeOf(M)).call(this,F,j));return T.quill.on(f.default.events.EDITOR_CHANGE,function(L,$,q,J){if(L===f.default.events.SELECTION_CHANGE)if($!=null&&$.length>0&&J===f.default.sources.USER){T.show(),T.root.style.left="0px",T.root.style.width="",T.root.style.width=T.root.offsetWidth+"px";var ae=T.quill.getLines($.index,$.length);if(ae.length===1)T.position(T.quill.getBounds($));else{var ie=ae[ae.length-1],Z=T.quill.getIndex(ie),te=Math.min(ie.length()-1,$.index+$.length-Z),V=T.quill.getBounds(new p.Range(Z,te));T.position(V)}}else document.activeElement!==T.textbox&&T.quill.hasFocus()&&T.hide()}),T}return o(M,[{key:"listen",value:function(){var j=this;a(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){j.root.classList.remove("ql-editing")}),this.quill.on(f.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!j.root.classList.contains("ql-hidden")){var T=j.quill.getSelection();T!=null&&j.position(j.quill.getBounds(T))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(j){var T=a(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"position",this).call(this,j),L=this.root.querySelector(".ql-tooltip-arrow");if(L.style.marginLeft="",T===0)return T;L.style.marginLeft=-1*T-L.offsetWidth/2+"px"}}]),M})(g.BaseTooltip);I.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),r.BubbleTooltip=I,r.default=k}),(function(n,r,i){n.exports=i(63)})]).default})})(X1)),X1.exports}var vL=gL();const T7=ph(vL);var K1={exports:{}},Vf={},Qd={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var mL=Qd.exports,Z3;function yL(){return Z3||(Z3=1,(function(t,e){(function(n){var r=e&&!e.nodeType&&e,i=t&&!t.nodeType&&t,a=typeof a0=="object"&&a0;(a.global===a||a.window===a||a.self===a)&&(n=a);var o,s=2147483647,u=36,h=1,f=26,g=38,v=700,p=72,y=128,_="-",x=/^xn--/,b=/[^\x20-\x7E]/,E=/[\x2E\u3002\uFF0E\uFF61]/g,A={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},S=u-h,k=Math.floor,I=String.fromCharCode,O;function M(V){throw new RangeError(A[V])}function F(V,B){for(var D=V.length,U=[];D--;)U[D]=B(V[D]);return U}function j(V,B){var D=V.split("@"),U="";D.length>1&&(U=D[0]+"@",V=D[1]),V=V.replace(E,".");var X=V.split("."),ee=F(X,B).join(".");return U+ee}function T(V){for(var B=[],D=0,U=V.length,X,ee;D<U;)X=V.charCodeAt(D++),X>=55296&&X<=56319&&D<U?(ee=V.charCodeAt(D++),(ee&64512)==56320?B.push(((X&1023)<<10)+(ee&1023)+65536):(B.push(X),D--)):B.push(X);return B}function L(V){return F(V,function(B){var D="";return B>65535&&(B-=65536,D+=I(B>>>10&1023|55296),B=56320|B&1023),D+=I(B),D}).join("")}function $(V){return V-48<10?V-22:V-65<26?V-65:V-97<26?V-97:u}function q(V,B){return V+22+75*(V<26)-((B!=0)<<5)}function J(V,B,D){var U=0;for(V=D?k(V/v):V>>1,V+=k(V/B);V>S*f>>1;U+=u)V=k(V/S);return k(U+(S+1)*V/(V+g))}function ae(V){var B=[],D=V.length,U,X=0,ee=y,K=p,oe,me,de,ye,Re,Oe,Me,Ee,ge;for(oe=V.lastIndexOf(_),oe<0&&(oe=0),me=0;me<oe;++me)V.charCodeAt(me)>=128&&M("not-basic"),B.push(V.charCodeAt(me));for(de=oe>0?oe+1:0;de<D;){for(ye=X,Re=1,Oe=u;de>=D&&M("invalid-input"),Me=$(V.charCodeAt(de++)),(Me>=u||Me>k((s-X)/Re))&&M("overflow"),X+=Me*Re,Ee=Oe<=K?h:Oe>=K+f?f:Oe-K,!(Me<Ee);Oe+=u)ge=u-Ee,Re>k(s/ge)&&M("overflow"),Re*=ge;U=B.length+1,K=J(X-ye,U,ye==0),k(X/U)>s-ee&&M("overflow"),ee+=k(X/U),X%=U,B.splice(X++,0,ee)}return L(B)}function ie(V){var B,D,U,X,ee,K,oe,me,de,ye,Re,Oe=[],Me,Ee,ge,Te;for(V=T(V),Me=V.length,B=y,D=0,ee=p,K=0;K<Me;++K)Re=V[K],Re<128&&Oe.push(I(Re));for(U=X=Oe.length,X&&Oe.push(_);U<Me;){for(oe=s,K=0;K<Me;++K)Re=V[K],Re>=B&&Re<oe&&(oe=Re);for(Ee=U+1,oe-B>k((s-D)/Ee)&&M("overflow"),D+=(oe-B)*Ee,B=oe,K=0;K<Me;++K)if(Re=V[K],Re<B&&++D>s&&M("overflow"),Re==B){for(me=D,de=u;ye=de<=ee?h:de>=ee+f?f:de-ee,!(me<ye);de+=u)Te=me-ye,ge=u-ye,Oe.push(I(q(ye+Te%ge,0))),me=k(Te/ge);Oe.push(I(q(me,0))),ee=J(D,Ee,U==X),D=0,++U}++D,++B}return Oe.join("")}function Z(V){return j(V,function(B){return x.test(B)?ae(B.slice(4).toLowerCase()):B})}function te(V){return j(V,function(B){return b.test(B)?"xn--"+ie(B):B})}if(o={version:"1.4.1",ucs2:{decode:T,encode:L},decode:ae,encode:ie,toASCII:te,toUnicode:Z},r&&i)if(t.exports==r)i.exports=o;else for(O in o)o.hasOwnProperty(O)&&(r[O]=o[O]);else n.punycode=o})(mL)})(Qd,Qd.exports)),Qd.exports}var c2,Q3;function Sd(){return Q3||(Q3=1,c2=TypeError),c2}const bL={},wL=Object.freeze(Object.defineProperty({__proto__:null,default:bL},Symbol.toStringTag,{value:"Module"})),_L=Dx(wL);var f2,J3;function Y0(){if(J3)return f2;J3=1;var t=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&t?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,n=t&&e&&typeof e.get=="function"?e.get:null,r=t&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,a=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,o=i&&a&&typeof a.get=="function"?a.get:null,s=i&&Set.prototype.forEach,u=typeof WeakMap=="function"&&WeakMap.prototype,h=u?WeakMap.prototype.has:null,f=typeof WeakSet=="function"&&WeakSet.prototype,g=f?WeakSet.prototype.has:null,v=typeof WeakRef=="function"&&WeakRef.prototype,p=v?WeakRef.prototype.deref:null,y=Boolean.prototype.valueOf,_=Object.prototype.toString,x=Function.prototype.toString,b=String.prototype.match,E=String.prototype.slice,A=String.prototype.replace,S=String.prototype.toUpperCase,k=String.prototype.toLowerCase,I=RegExp.prototype.test,O=Array.prototype.concat,M=Array.prototype.join,F=Array.prototype.slice,j=Math.floor,T=typeof BigInt=="function"?BigInt.prototype.valueOf:null,L=Object.getOwnPropertySymbols,$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,q=typeof Symbol=="function"&&typeof Symbol.iterator=="object",J=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===q||!0)?Symbol.toStringTag:null,ae=Object.prototype.propertyIsEnumerable,ie=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(Ve){return Ve.__proto__}:null);function Z(Ve,qe){if(Ve===1/0||Ve===-1/0||Ve!==Ve||Ve&&Ve>-1e3&&Ve<1e3||I.call(/e/,qe))return qe;var Nt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof Ve=="number"){var Ct=Ve<0?-j(-Ve):j(Ve);if(Ct!==Ve){var an=String(Ct),Ut=E.call(qe,an.length+1);return A.call(an,Nt,"$&_")+"."+A.call(A.call(Ut,/([0-9]{3})/g,"$&_"),/_$/,"")}}return A.call(qe,Nt,"$&_")}var te=_L,V=te.custom,B=Ee(V)?V:null,D={__proto__:null,double:'"',single:"'"},U={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};f2=function Ve(qe,Nt,Ct,an){var Ut=Nt||{};if(Be(Ut,"quoteStyle")&&!Be(D,Ut.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Be(Ut,"maxStringLength")&&(typeof Ut.maxStringLength=="number"?Ut.maxStringLength<0&&Ut.maxStringLength!==1/0:Ut.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Sn=Be(Ut,"customInspect")?Ut.customInspect:!0;if(typeof Sn!="boolean"&&Sn!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Be(Ut,"indent")&&Ut.indent!==null&&Ut.indent!==" "&&!(parseInt(Ut.indent,10)===Ut.indent&&Ut.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Be(Ut,"numericSeparator")&&typeof Ut.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var en=Ut.numericSeparator;if(typeof qe>"u")return"undefined";if(qe===null)return"null";if(typeof qe=="boolean")return qe?"true":"false";if(typeof qe=="string")return dt(qe,Ut);if(typeof qe=="number"){if(qe===0)return 1/0/qe>0?"0":"-0";var gn=String(qe);return en?Z(qe,gn):gn}if(typeof qe=="bigint"){var Bi=String(qe)+"n";return en?Z(qe,Bi):Bi}var oi=typeof Ut.depth>"u"?5:Ut.depth;if(typeof Ct>"u"&&(Ct=0),Ct>=oi&&oi>0&&typeof qe=="object")return oe(qe)?"[Array]":"[Object]";var Ei=xn(Ut,Ct);if(typeof an>"u")an=[];else if(Le(an,qe)>=0)return"[Circular]";function Sr(zi,to,Bs){if(to&&(an=F.call(an),an.push(to)),Bs){var is={depth:Ut.depth};return Be(Ut,"quoteStyle")&&(is.quoteStyle=Ut.quoteStyle),Ve(zi,is,Ct+1,an)}return Ve(zi,Ut,Ct+1,an)}if(typeof qe=="function"&&!de(qe)){var Qt=fe(qe),ca=Jt(qe,Sr);return"[Function"+(Qt?": "+Qt:" (anonymous)")+"]"+(ca.length>0?" { "+M.call(ca,", ")+" }":"")}if(Ee(qe)){var Fa=q?A.call(String(qe),/^(Symbol\(.*\))_[^)]*$/,"$1"):$.call(qe);return typeof qe=="object"&&!q?xt(Fa):Fa}if(st(qe)){for(var Kr="<"+k.call(String(qe.nodeName)),Yi=qe.attributes||[],Un=0;Un<Yi.length;Un++)Kr+=" "+Yi[Un].name+"="+X(ee(Yi[Un].value),"double",Ut);return Kr+=">",qe.childNodes&&qe.childNodes.length&&(Kr+="..."),Kr+="</"+k.call(String(qe.nodeName))+">",Kr}if(oe(qe)){if(qe.length===0)return"[]";var Er=Jt(qe,Sr);return Ei&&!qn(Er)?"["+It(Er,Ei)+"]":"[ "+M.call(Er,", ")+" ]"}if(ye(qe)){var Rr=Jt(qe,Sr);return!("cause"in Error.prototype)&&"cause"in qe&&!ae.call(qe,"cause")?"{ ["+String(qe)+"] "+M.call(O.call("[cause]: "+Sr(qe.cause),Rr),", ")+" }":Rr.length===0?"["+String(qe)+"]":"{ ["+String(qe)+"] "+M.call(Rr,", ")+" }"}if(typeof qe=="object"&&Sn){if(B&&typeof qe[B]=="function"&&te)return te(qe,{depth:oi-Ct});if(Sn!=="symbol"&&typeof qe.inspect=="function")return qe.inspect()}if(Ne(qe)){var Sa=[];return r&&r.call(qe,function(zi,to){Sa.push(Sr(to,qe,!0)+" => "+Sr(zi,qe))}),kt("Map",n.call(qe),Sa,Ei)}if(Pe(qe)){var Ho=[];return s&&s.call(qe,function(zi){Ho.push(Sr(zi,qe))}),kt("Set",o.call(qe),Ho,Ei)}if(ue(qe))return bt("WeakMap");if(Ue(qe))return bt("WeakSet");if(Ae(qe))return bt("WeakRef");if(Oe(qe))return xt(Sr(Number(qe)));if(ge(qe))return xt(Sr(T.call(qe)));if(Me(qe))return xt(y.call(qe));if(Re(qe))return xt(Sr(String(qe)));if(typeof window<"u"&&qe===window)return"{ [object Window] }";if(typeof globalThis<"u"&&qe===globalThis||typeof a0<"u"&&qe===a0)return"{ [object globalThis] }";if(!me(qe)&&!de(qe)){var Ea=Jt(qe,Sr),eo=ie?ie(qe)===Object.prototype:qe instanceof Object||qe.constructor===Object,si=qe instanceof Object?"":"null prototype",ka=!eo&&J&&Object(qe)===qe&&J in qe?E.call(Ce(qe),8,-1):si?"Object":"",Aa=eo||typeof qe.constructor!="function"?"":qe.constructor.name?qe.constructor.name+" ":"",$o=Aa+(ka||si?"["+M.call(O.call([],ka||[],si||[]),": ")+"] ":"");return Ea.length===0?$o+"{}":Ei?$o+"{"+It(Ea,Ei)+"}":$o+"{ "+M.call(Ea,", ")+" }"}return String(qe)};function X(Ve,qe,Nt){var Ct=Nt.quoteStyle||qe,an=D[Ct];return an+Ve+an}function ee(Ve){return A.call(String(Ve),/"/g,"&quot;")}function K(Ve){return!J||!(typeof Ve=="object"&&(J in Ve||typeof Ve[J]<"u"))}function oe(Ve){return Ce(Ve)==="[object Array]"&&K(Ve)}function me(Ve){return Ce(Ve)==="[object Date]"&&K(Ve)}function de(Ve){return Ce(Ve)==="[object RegExp]"&&K(Ve)}function ye(Ve){return Ce(Ve)==="[object Error]"&&K(Ve)}function Re(Ve){return Ce(Ve)==="[object String]"&&K(Ve)}function Oe(Ve){return Ce(Ve)==="[object Number]"&&K(Ve)}function Me(Ve){return Ce(Ve)==="[object Boolean]"&&K(Ve)}function Ee(Ve){if(q)return Ve&&typeof Ve=="object"&&Ve instanceof Symbol;if(typeof Ve=="symbol")return!0;if(!Ve||typeof Ve!="object"||!$)return!1;try{return $.call(Ve),!0}catch{}return!1}function ge(Ve){if(!Ve||typeof Ve!="object"||!T)return!1;try{return T.call(Ve),!0}catch{}return!1}var Te=Object.prototype.hasOwnProperty||function(Ve){return Ve in this};function Be(Ve,qe){return Te.call(Ve,qe)}function Ce(Ve){return _.call(Ve)}function fe(Ve){if(Ve.name)return Ve.name;var qe=b.call(x.call(Ve),/^function\s*([\w$]+)/);return qe?qe[1]:null}function Le(Ve,qe){if(Ve.indexOf)return Ve.indexOf(qe);for(var Nt=0,Ct=Ve.length;Nt<Ct;Nt++)if(Ve[Nt]===qe)return Nt;return-1}function Ne(Ve){if(!n||!Ve||typeof Ve!="object")return!1;try{n.call(Ve);try{o.call(Ve)}catch{return!0}return Ve instanceof Map}catch{}return!1}function ue(Ve){if(!h||!Ve||typeof Ve!="object")return!1;try{h.call(Ve,h);try{g.call(Ve,g)}catch{return!0}return Ve instanceof WeakMap}catch{}return!1}function Ae(Ve){if(!p||!Ve||typeof Ve!="object")return!1;try{return p.call(Ve),!0}catch{}return!1}function Pe(Ve){if(!o||!Ve||typeof Ve!="object")return!1;try{o.call(Ve);try{n.call(Ve)}catch{return!0}return Ve instanceof Set}catch{}return!1}function Ue(Ve){if(!g||!Ve||typeof Ve!="object")return!1;try{g.call(Ve,g);try{h.call(Ve,h)}catch{return!0}return Ve instanceof WeakSet}catch{}return!1}function st(Ve){return!Ve||typeof Ve!="object"?!1:typeof HTMLElement<"u"&&Ve instanceof HTMLElement?!0:typeof Ve.nodeName=="string"&&typeof Ve.getAttribute=="function"}function dt(Ve,qe){if(Ve.length>qe.maxStringLength){var Nt=Ve.length-qe.maxStringLength,Ct="... "+Nt+" more character"+(Nt>1?"s":"");return dt(E.call(Ve,0,qe.maxStringLength),qe)+Ct}var an=U[qe.quoteStyle||"single"];an.lastIndex=0;var Ut=A.call(A.call(Ve,an,"\\$1"),/[\x00-\x1f]/g,pt);return X(Ut,"single",qe)}function pt(Ve){var qe=Ve.charCodeAt(0),Nt={8:"b",9:"t",10:"n",12:"f",13:"r"}[qe];return Nt?"\\"+Nt:"\\x"+(qe<16?"0":"")+S.call(qe.toString(16))}function xt(Ve){return"Object("+Ve+")"}function bt(Ve){return Ve+" { ? }"}function kt(Ve,qe,Nt,Ct){var an=Ct?It(Nt,Ct):M.call(Nt,", ");return Ve+" ("+qe+") {"+an+"}"}function qn(Ve){for(var qe=0;qe<Ve.length;qe++)if(Le(Ve[qe],`
154
+ `)>=0)return!1;return!0}function xn(Ve,qe){var Nt;if(Ve.indent===" ")Nt=" ";else if(typeof Ve.indent=="number"&&Ve.indent>0)Nt=M.call(Array(Ve.indent+1)," ");else return null;return{base:Nt,prev:M.call(Array(qe+1),Nt)}}function It(Ve,qe){if(Ve.length===0)return"";var Nt=`
155
+ `+qe.prev+qe.base;return Nt+M.call(Ve,","+Nt)+`
156
+ `+qe.prev}function Jt(Ve,qe){var Nt=oe(Ve),Ct=[];if(Nt){Ct.length=Ve.length;for(var an=0;an<Ve.length;an++)Ct[an]=Be(Ve,an)?qe(Ve[an],Ve):""}var Ut=typeof L=="function"?L(Ve):[],Sn;if(q){Sn={};for(var en=0;en<Ut.length;en++)Sn["$"+Ut[en]]=Ut[en]}for(var gn in Ve)Be(Ve,gn)&&(Nt&&String(Number(gn))===gn&&gn<Ve.length||q&&Sn["$"+gn]instanceof Symbol||(I.call(/[^\w$]/,gn)?Ct.push(qe(gn,Ve)+": "+qe(Ve[gn],Ve)):Ct.push(gn+": "+qe(Ve[gn],Ve))));if(typeof L=="function")for(var Bi=0;Bi<Ut.length;Bi++)ae.call(Ve,Ut[Bi])&&Ct.push("["+qe(Ut[Bi])+"]: "+qe(Ve[Ut[Bi]],Ve));return Ct}return f2}var h2,eb;function xL(){if(eb)return h2;eb=1;var t=Y0(),e=Sd(),n=function(s,u,h){for(var f=s,g;(g=f.next)!=null;f=g)if(g.key===u)return f.next=g.next,h||(g.next=s.next,s.next=g),g},r=function(s,u){if(s){var h=n(s,u);return h&&h.value}},i=function(s,u,h){var f=n(s,u);f?f.value=h:s.next={key:u,next:s.next,value:h}},a=function(s,u){return s?!!n(s,u):!1},o=function(s,u){if(s)return n(s,u,!0)};return h2=function(){var u,h={assert:function(f){if(!h.has(f))throw new e("Side channel does not contain "+t(f))},delete:function(f){var g=u&&u.next,v=o(u,f);return v&&g&&g===v&&(u=void 0),!!v},get:function(f){return r(u,f)},has:function(f){return a(u,f)},set:function(f,g){u||(u={next:void 0}),i(u,f,g)}};return h},h2}var d2,tb;function R7(){return tb||(tb=1,d2=Object),d2}var p2,nb;function SL(){return nb||(nb=1,p2=Error),p2}var g2,rb;function EL(){return rb||(rb=1,g2=EvalError),g2}var v2,ib;function kL(){return ib||(ib=1,v2=RangeError),v2}var m2,ab;function AL(){return ab||(ab=1,m2=ReferenceError),m2}var y2,ob;function PL(){return ob||(ob=1,y2=SyntaxError),y2}var b2,sb;function OL(){return sb||(sb=1,b2=URIError),b2}var w2,lb;function CL(){return lb||(lb=1,w2=Math.abs),w2}var _2,ub;function LL(){return ub||(ub=1,_2=Math.floor),_2}var x2,cb;function NL(){return cb||(cb=1,x2=Math.max),x2}var S2,fb;function TL(){return fb||(fb=1,S2=Math.min),S2}var E2,hb;function RL(){return hb||(hb=1,E2=Math.pow),E2}var k2,db;function ML(){return db||(db=1,k2=Math.round),k2}var A2,pb;function IL(){return pb||(pb=1,A2=Number.isNaN||function(e){return e!==e}),A2}var P2,gb;function jL(){if(gb)return P2;gb=1;var t=IL();return P2=function(n){return t(n)||n===0?n:n<0?-1:1},P2}var O2,vb;function DL(){return vb||(vb=1,O2=Object.getOwnPropertyDescriptor),O2}var C2,mb;function M7(){if(mb)return C2;mb=1;var t=DL();if(t)try{t([],"length")}catch{t=null}return C2=t,C2}var L2,yb;function FL(){if(yb)return L2;yb=1;var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return L2=t,L2}var N2,bb;function BL(){return bb||(bb=1,N2=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;e[n]=i;for(var a in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==n||!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,n);if(s.value!==i||s.enumerable!==!0)return!1}return!0}),N2}var T2,wb;function zL(){if(wb)return T2;wb=1;var t=typeof Symbol<"u"&&Symbol,e=BL();return T2=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},T2}var R2,_b;function I7(){return _b||(_b=1,R2=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),R2}var M2,xb;function j7(){if(xb)return M2;xb=1;var t=R7();return M2=t.getPrototypeOf||null,M2}var I2,Sb;function qL(){if(Sb)return I2;Sb=1;var t="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,n=Math.max,r="[object Function]",i=function(u,h){for(var f=[],g=0;g<u.length;g+=1)f[g]=u[g];for(var v=0;v<h.length;v+=1)f[v+u.length]=h[v];return f},a=function(u,h){for(var f=[],g=h,v=0;g<u.length;g+=1,v+=1)f[v]=u[g];return f},o=function(s,u){for(var h="",f=0;f<s.length;f+=1)h+=s[f],f+1<s.length&&(h+=u);return h};return I2=function(u){var h=this;if(typeof h!="function"||e.apply(h)!==r)throw new TypeError(t+h);for(var f=a(arguments,1),g,v=function(){if(this instanceof g){var b=h.apply(this,i(f,arguments));return Object(b)===b?b:this}return h.apply(u,i(f,arguments))},p=n(0,h.length-f.length),y=[],_=0;_<p;_++)y[_]="$"+_;if(g=Function("binder","return function ("+o(y,",")+"){ return binder.apply(this,arguments); }")(v),h.prototype){var x=function(){};x.prototype=h.prototype,g.prototype=new x,x.prototype=null}return g},I2}var j2,Eb;function X0(){if(Eb)return j2;Eb=1;var t=qL();return j2=Function.prototype.bind||t,j2}var D2,kb;function hy(){return kb||(kb=1,D2=Function.prototype.call),D2}var F2,Ab;function D7(){return Ab||(Ab=1,F2=Function.prototype.apply),F2}var B2,Pb;function UL(){return Pb||(Pb=1,B2=typeof Reflect<"u"&&Reflect&&Reflect.apply),B2}var z2,Ob;function HL(){if(Ob)return z2;Ob=1;var t=X0(),e=D7(),n=hy(),r=UL();return z2=r||t.call(n,e),z2}var q2,Cb;function F7(){if(Cb)return q2;Cb=1;var t=X0(),e=Sd(),n=hy(),r=HL();return q2=function(a){if(a.length<1||typeof a[0]!="function")throw new e("a function is required");return r(t,n,a)},q2}var U2,Lb;function $L(){if(Lb)return U2;Lb=1;var t=F7(),e=M7(),n;try{n=[].__proto__===Array.prototype}catch(o){if(!o||typeof o!="object"||!("code"in o)||o.code!=="ERR_PROTO_ACCESS")throw o}var r=!!n&&e&&e(Object.prototype,"__proto__"),i=Object,a=i.getPrototypeOf;return U2=r&&typeof r.get=="function"?t([r.get]):typeof a=="function"?function(s){return a(s==null?s:i(s))}:!1,U2}var H2,Nb;function GL(){if(Nb)return H2;Nb=1;var t=I7(),e=j7(),n=$L();return H2=t?function(i){return t(i)}:e?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return e(i)}:n?function(i){return n(i)}:null,H2}var $2,Tb;function WL(){if(Tb)return $2;Tb=1;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,n=X0();return $2=n.call(t,e),$2}var G2,Rb;function dy(){if(Rb)return G2;Rb=1;var t,e=R7(),n=SL(),r=EL(),i=kL(),a=AL(),o=PL(),s=Sd(),u=OL(),h=CL(),f=LL(),g=NL(),v=TL(),p=RL(),y=ML(),_=jL(),x=Function,b=function(de){try{return x('"use strict"; return ('+de+").constructor;")()}catch{}},E=M7(),A=FL(),S=function(){throw new s},k=E?(function(){try{return arguments.callee,S}catch{try{return E(arguments,"callee").get}catch{return S}}})():S,I=zL()(),O=GL(),M=j7(),F=I7(),j=D7(),T=hy(),L={},$=typeof Uint8Array>"u"||!O?t:O(Uint8Array),q={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":I&&O?O([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":L,"%AsyncGenerator%":L,"%AsyncGeneratorFunction%":L,"%AsyncIteratorPrototype%":L,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":r,"%Float16Array%":typeof Float16Array>"u"?t:Float16Array,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":x,"%GeneratorFunction%":L,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":I&&O?O(O([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!I||!O?t:O(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":E,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":i,"%ReferenceError%":a,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!I||!O?t:O(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":I&&O?O(""[Symbol.iterator]()):t,"%Symbol%":I?Symbol:t,"%SyntaxError%":o,"%ThrowTypeError%":k,"%TypedArray%":$,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet,"%Function.prototype.call%":T,"%Function.prototype.apply%":j,"%Object.defineProperty%":A,"%Object.getPrototypeOf%":M,"%Math.abs%":h,"%Math.floor%":f,"%Math.max%":g,"%Math.min%":v,"%Math.pow%":p,"%Math.round%":y,"%Math.sign%":_,"%Reflect.getPrototypeOf%":F};if(O)try{null.error}catch(de){var J=O(O(de));q["%Error.prototype%"]=J}var ae=function de(ye){var Re;if(ye==="%AsyncFunction%")Re=b("async function () {}");else if(ye==="%GeneratorFunction%")Re=b("function* () {}");else if(ye==="%AsyncGeneratorFunction%")Re=b("async function* () {}");else if(ye==="%AsyncGenerator%"){var Oe=de("%AsyncGeneratorFunction%");Oe&&(Re=Oe.prototype)}else if(ye==="%AsyncIteratorPrototype%"){var Me=de("%AsyncGenerator%");Me&&O&&(Re=O(Me.prototype))}return q[ye]=Re,Re},ie={__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"]},Z=X0(),te=WL(),V=Z.call(T,Array.prototype.concat),B=Z.call(j,Array.prototype.splice),D=Z.call(T,String.prototype.replace),U=Z.call(T,String.prototype.slice),X=Z.call(T,RegExp.prototype.exec),ee=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,K=/\\(\\)?/g,oe=function(ye){var Re=U(ye,0,1),Oe=U(ye,-1);if(Re==="%"&&Oe!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(Oe==="%"&&Re!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var Me=[];return D(ye,ee,function(Ee,ge,Te,Be){Me[Me.length]=Te?D(Be,K,"$1"):ge||Ee}),Me},me=function(ye,Re){var Oe=ye,Me;if(te(ie,Oe)&&(Me=ie[Oe],Oe="%"+Me[0]+"%"),te(q,Oe)){var Ee=q[Oe];if(Ee===L&&(Ee=ae(Oe)),typeof Ee>"u"&&!Re)throw new s("intrinsic "+ye+" exists, but is not available. Please file an issue!");return{alias:Me,name:Oe,value:Ee}}throw new o("intrinsic "+ye+" does not exist!")};return G2=function(ye,Re){if(typeof ye!="string"||ye.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof Re!="boolean")throw new s('"allowMissing" argument must be a boolean');if(X(/^%?[^%]*%?$/,ye)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Oe=oe(ye),Me=Oe.length>0?Oe[0]:"",Ee=me("%"+Me+"%",Re),ge=Ee.name,Te=Ee.value,Be=!1,Ce=Ee.alias;Ce&&(Me=Ce[0],B(Oe,V([0,1],Ce)));for(var fe=1,Le=!0;fe<Oe.length;fe+=1){var Ne=Oe[fe],ue=U(Ne,0,1),Ae=U(Ne,-1);if((ue==='"'||ue==="'"||ue==="`"||Ae==='"'||Ae==="'"||Ae==="`")&&ue!==Ae)throw new o("property names with quotes must have matching quotes");if((Ne==="constructor"||!Le)&&(Be=!0),Me+="."+Ne,ge="%"+Me+"%",te(q,ge))Te=q[ge];else if(Te!=null){if(!(Ne in Te)){if(!Re)throw new s("base intrinsic for "+ye+" exists, but the property is not available.");return}if(E&&fe+1>=Oe.length){var Pe=E(Te,Ne);Le=!!Pe,Le&&"get"in Pe&&!("originalValue"in Pe.get)?Te=Pe.get:Te=Te[Ne]}else Le=te(Te,Ne),Te=Te[Ne];Le&&!Be&&(q[ge]=Te)}}return Te},G2}var W2,Mb;function B7(){if(Mb)return W2;Mb=1;var t=dy(),e=F7(),n=e([t("%String.prototype.indexOf%")]);return W2=function(i,a){var o=t(i,!!a);return typeof o=="function"&&n(i,".prototype.")>-1?e([o]):o},W2}var V2,Ib;function z7(){if(Ib)return V2;Ib=1;var t=dy(),e=B7(),n=Y0(),r=Sd(),i=t("%Map%",!0),a=e("Map.prototype.get",!0),o=e("Map.prototype.set",!0),s=e("Map.prototype.has",!0),u=e("Map.prototype.delete",!0),h=e("Map.prototype.size",!0);return V2=!!i&&function(){var g,v={assert:function(p){if(!v.has(p))throw new r("Side channel does not contain "+n(p))},delete:function(p){if(g){var y=u(g,p);return h(g)===0&&(g=void 0),y}return!1},get:function(p){if(g)return a(g,p)},has:function(p){return g?s(g,p):!1},set:function(p,y){g||(g=new i),o(g,p,y)}};return v},V2}var Y2,jb;function VL(){if(jb)return Y2;jb=1;var t=dy(),e=B7(),n=Y0(),r=z7(),i=Sd(),a=t("%WeakMap%",!0),o=e("WeakMap.prototype.get",!0),s=e("WeakMap.prototype.set",!0),u=e("WeakMap.prototype.has",!0),h=e("WeakMap.prototype.delete",!0);return Y2=a?function(){var g,v,p={assert:function(y){if(!p.has(y))throw new i("Side channel does not contain "+n(y))},delete:function(y){if(a&&y&&(typeof y=="object"||typeof y=="function")){if(g)return h(g,y)}else if(r&&v)return v.delete(y);return!1},get:function(y){return a&&y&&(typeof y=="object"||typeof y=="function")&&g?o(g,y):v&&v.get(y)},has:function(y){return a&&y&&(typeof y=="object"||typeof y=="function")&&g?u(g,y):!!v&&v.has(y)},set:function(y,_){a&&y&&(typeof y=="object"||typeof y=="function")?(g||(g=new a),s(g,y,_)):r&&(v||(v=r()),v.set(y,_))}};return p}:r,Y2}var X2,Db;function YL(){if(Db)return X2;Db=1;var t=Sd(),e=Y0(),n=xL(),r=z7(),i=VL(),a=i||r||n;return X2=function(){var s,u={assert:function(h){if(!u.has(h))throw new t("Side channel does not contain "+e(h))},delete:function(h){return!!s&&s.delete(h)},get:function(h){return s&&s.get(h)},has:function(h){return!!s&&s.has(h)},set:function(h,f){s||(s=a()),s.set(h,f)}};return u},X2}var K2,Fb;function py(){if(Fb)return K2;Fb=1;var t=String.prototype.replace,e=/%20/g,n={RFC1738:"RFC1738",RFC3986:"RFC3986"};return K2={default:n.RFC3986,formatters:{RFC1738:function(r){return t.call(r,e,"+")},RFC3986:function(r){return String(r)}},RFC1738:n.RFC1738,RFC3986:n.RFC3986},K2}var Z2,Bb;function q7(){if(Bb)return Z2;Bb=1;var t=py(),e=Object.prototype.hasOwnProperty,n=Array.isArray,r=(function(){for(var x=[],b=0;b<256;++b)x.push("%"+((b<16?"0":"")+b.toString(16)).toUpperCase());return x})(),i=function(b){for(;b.length>1;){var E=b.pop(),A=E.obj[E.prop];if(n(A)){for(var S=[],k=0;k<A.length;++k)typeof A[k]<"u"&&S.push(A[k]);E.obj[E.prop]=S}}},a=function(b,E){for(var A=E&&E.plainObjects?{__proto__:null}:{},S=0;S<b.length;++S)typeof b[S]<"u"&&(A[S]=b[S]);return A},o=function x(b,E,A){if(!E)return b;if(typeof E!="object"&&typeof E!="function"){if(n(b))b.push(E);else if(b&&typeof b=="object")(A&&(A.plainObjects||A.allowPrototypes)||!e.call(Object.prototype,E))&&(b[E]=!0);else return[b,E];return b}if(!b||typeof b!="object")return[b].concat(E);var S=b;return n(b)&&!n(E)&&(S=a(b,A)),n(b)&&n(E)?(E.forEach(function(k,I){if(e.call(b,I)){var O=b[I];O&&typeof O=="object"&&k&&typeof k=="object"?b[I]=x(O,k,A):b.push(k)}else b[I]=k}),b):Object.keys(E).reduce(function(k,I){var O=E[I];return e.call(k,I)?k[I]=x(k[I],O,A):k[I]=O,k},S)},s=function(b,E){return Object.keys(E).reduce(function(A,S){return A[S]=E[S],A},b)},u=function(x,b,E){var A=x.replace(/\+/g," ");if(E==="iso-8859-1")return A.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(A)}catch{return A}},h=1024,f=function(b,E,A,S,k){if(b.length===0)return b;var I=b;if(typeof b=="symbol"?I=Symbol.prototype.toString.call(b):typeof b!="string"&&(I=String(b)),A==="iso-8859-1")return escape(I).replace(/%u[0-9a-f]{4}/gi,function($){return"%26%23"+parseInt($.slice(2),16)+"%3B"});for(var O="",M=0;M<I.length;M+=h){for(var F=I.length>=h?I.slice(M,M+h):I,j=[],T=0;T<F.length;++T){var L=F.charCodeAt(T);if(L===45||L===46||L===95||L===126||L>=48&&L<=57||L>=65&&L<=90||L>=97&&L<=122||k===t.RFC1738&&(L===40||L===41)){j[j.length]=F.charAt(T);continue}if(L<128){j[j.length]=r[L];continue}if(L<2048){j[j.length]=r[192|L>>6]+r[128|L&63];continue}if(L<55296||L>=57344){j[j.length]=r[224|L>>12]+r[128|L>>6&63]+r[128|L&63];continue}T+=1,L=65536+((L&1023)<<10|F.charCodeAt(T)&1023),j[j.length]=r[240|L>>18]+r[128|L>>12&63]+r[128|L>>6&63]+r[128|L&63]}O+=j.join("")}return O},g=function(b){for(var E=[{obj:{o:b},prop:"o"}],A=[],S=0;S<E.length;++S)for(var k=E[S],I=k.obj[k.prop],O=Object.keys(I),M=0;M<O.length;++M){var F=O[M],j=I[F];typeof j=="object"&&j!==null&&A.indexOf(j)===-1&&(E.push({obj:I,prop:F}),A.push(j))}return i(E),b},v=function(b){return Object.prototype.toString.call(b)==="[object RegExp]"},p=function(b){return!b||typeof b!="object"?!1:!!(b.constructor&&b.constructor.isBuffer&&b.constructor.isBuffer(b))},y=function(b,E){return[].concat(b,E)},_=function(b,E){if(n(b)){for(var A=[],S=0;S<b.length;S+=1)A.push(E(b[S]));return A}return E(b)};return Z2={arrayToObject:a,assign:s,combine:y,compact:g,decode:u,encode:f,isBuffer:p,isRegExp:v,maybeMap:_,merge:o},Z2}var Q2,zb;function XL(){if(zb)return Q2;zb=1;var t=YL(),e=q7(),n=py(),r=Object.prototype.hasOwnProperty,i={brackets:function(x){return x+"[]"},comma:"comma",indices:function(x,b){return x+"["+b+"]"},repeat:function(x){return x}},a=Array.isArray,o=Array.prototype.push,s=function(_,x){o.apply(_,a(x)?x:[x])},u=Date.prototype.toISOString,h=n.default,f={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:e.encode,encodeValuesOnly:!1,filter:void 0,format:h,formatter:n.formatters[h],indices:!1,serializeDate:function(x){return u.call(x)},skipNulls:!1,strictNullHandling:!1},g=function(x){return typeof x=="string"||typeof x=="number"||typeof x=="boolean"||typeof x=="symbol"||typeof x=="bigint"},v={},p=function _(x,b,E,A,S,k,I,O,M,F,j,T,L,$,q,J,ae,ie){for(var Z=x,te=ie,V=0,B=!1;(te=te.get(v))!==void 0&&!B;){var D=te.get(x);if(V+=1,typeof D<"u"){if(D===V)throw new RangeError("Cyclic object value");B=!0}typeof te.get(v)>"u"&&(V=0)}if(typeof F=="function"?Z=F(b,Z):Z instanceof Date?Z=L(Z):E==="comma"&&a(Z)&&(Z=e.maybeMap(Z,function(ge){return ge instanceof Date?L(ge):ge})),Z===null){if(k)return M&&!J?M(b,f.encoder,ae,"key",$):b;Z=""}if(g(Z)||e.isBuffer(Z)){if(M){var U=J?b:M(b,f.encoder,ae,"key",$);return[q(U)+"="+q(M(Z,f.encoder,ae,"value",$))]}return[q(b)+"="+q(String(Z))]}var X=[];if(typeof Z>"u")return X;var ee;if(E==="comma"&&a(Z))J&&M&&(Z=e.maybeMap(Z,M)),ee=[{value:Z.length>0?Z.join(",")||null:void 0}];else if(a(F))ee=F;else{var K=Object.keys(Z);ee=j?K.sort(j):K}var oe=O?String(b).replace(/\./g,"%2E"):String(b),me=A&&a(Z)&&Z.length===1?oe+"[]":oe;if(S&&a(Z)&&Z.length===0)return me+"[]";for(var de=0;de<ee.length;++de){var ye=ee[de],Re=typeof ye=="object"&&ye&&typeof ye.value<"u"?ye.value:Z[ye];if(!(I&&Re===null)){var Oe=T&&O?String(ye).replace(/\./g,"%2E"):String(ye),Me=a(Z)?typeof E=="function"?E(me,Oe):me:me+(T?"."+Oe:"["+Oe+"]");ie.set(x,V);var Ee=t();Ee.set(v,ie),s(X,_(Re,Me,E,A,S,k,I,O,E==="comma"&&J&&a(Z)?null:M,F,j,T,L,$,q,J,ae,Ee))}}return X},y=function(x){if(!x)return f;if(typeof x.allowEmptyArrays<"u"&&typeof x.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof x.encodeDotInKeys<"u"&&typeof x.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(x.encoder!==null&&typeof x.encoder<"u"&&typeof x.encoder!="function")throw new TypeError("Encoder has to be a function.");var b=x.charset||f.charset;if(typeof x.charset<"u"&&x.charset!=="utf-8"&&x.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var E=n.default;if(typeof x.format<"u"){if(!r.call(n.formatters,x.format))throw new TypeError("Unknown format option provided.");E=x.format}var A=n.formatters[E],S=f.filter;(typeof x.filter=="function"||a(x.filter))&&(S=x.filter);var k;if(x.arrayFormat in i?k=x.arrayFormat:"indices"in x?k=x.indices?"indices":"repeat":k=f.arrayFormat,"commaRoundTrip"in x&&typeof x.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var I=typeof x.allowDots>"u"?x.encodeDotInKeys===!0?!0:f.allowDots:!!x.allowDots;return{addQueryPrefix:typeof x.addQueryPrefix=="boolean"?x.addQueryPrefix:f.addQueryPrefix,allowDots:I,allowEmptyArrays:typeof x.allowEmptyArrays=="boolean"?!!x.allowEmptyArrays:f.allowEmptyArrays,arrayFormat:k,charset:b,charsetSentinel:typeof x.charsetSentinel=="boolean"?x.charsetSentinel:f.charsetSentinel,commaRoundTrip:!!x.commaRoundTrip,delimiter:typeof x.delimiter>"u"?f.delimiter:x.delimiter,encode:typeof x.encode=="boolean"?x.encode:f.encode,encodeDotInKeys:typeof x.encodeDotInKeys=="boolean"?x.encodeDotInKeys:f.encodeDotInKeys,encoder:typeof x.encoder=="function"?x.encoder:f.encoder,encodeValuesOnly:typeof x.encodeValuesOnly=="boolean"?x.encodeValuesOnly:f.encodeValuesOnly,filter:S,format:E,formatter:A,serializeDate:typeof x.serializeDate=="function"?x.serializeDate:f.serializeDate,skipNulls:typeof x.skipNulls=="boolean"?x.skipNulls:f.skipNulls,sort:typeof x.sort=="function"?x.sort:null,strictNullHandling:typeof x.strictNullHandling=="boolean"?x.strictNullHandling:f.strictNullHandling}};return Q2=function(_,x){var b=_,E=y(x),A,S;typeof E.filter=="function"?(S=E.filter,b=S("",b)):a(E.filter)&&(S=E.filter,A=S);var k=[];if(typeof b!="object"||b===null)return"";var I=i[E.arrayFormat],O=I==="comma"&&E.commaRoundTrip;A||(A=Object.keys(b)),E.sort&&A.sort(E.sort);for(var M=t(),F=0;F<A.length;++F){var j=A[F],T=b[j];E.skipNulls&&T===null||s(k,p(T,j,I,O,E.allowEmptyArrays,E.strictNullHandling,E.skipNulls,E.encodeDotInKeys,E.encode?E.encoder:null,E.filter,E.sort,E.allowDots,E.serializeDate,E.format,E.formatter,E.encodeValuesOnly,E.charset,M))}var L=k.join(E.delimiter),$=E.addQueryPrefix===!0?"?":"";return E.charsetSentinel&&(E.charset==="iso-8859-1"?$+="utf8=%26%2310003%3B&":$+="utf8=%E2%9C%93&"),L.length>0?$+L:""},Q2}var J2,qb;function KL(){if(qb)return J2;qb=1;var t=q7(),e=Object.prototype.hasOwnProperty,n=Array.isArray,r={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:t.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},i=function(v){return v.replace(/&#(\d+);/g,function(p,y){return String.fromCharCode(parseInt(y,10))})},a=function(v,p,y){if(v&&typeof v=="string"&&p.comma&&v.indexOf(",")>-1)return v.split(",");if(p.throwOnLimitExceeded&&y>=p.arrayLimit)throw new RangeError("Array limit exceeded. Only "+p.arrayLimit+" element"+(p.arrayLimit===1?"":"s")+" allowed in an array.");return v},o="utf8=%26%2310003%3B",s="utf8=%E2%9C%93",u=function(p,y){var _={__proto__:null},x=y.ignoreQueryPrefix?p.replace(/^\?/,""):p;x=x.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var b=y.parameterLimit===1/0?void 0:y.parameterLimit,E=x.split(y.delimiter,y.throwOnLimitExceeded?b+1:b);if(y.throwOnLimitExceeded&&E.length>b)throw new RangeError("Parameter limit exceeded. Only "+b+" parameter"+(b===1?"":"s")+" allowed.");var A=-1,S,k=y.charset;if(y.charsetSentinel)for(S=0;S<E.length;++S)E[S].indexOf("utf8=")===0&&(E[S]===s?k="utf-8":E[S]===o&&(k="iso-8859-1"),A=S,S=E.length);for(S=0;S<E.length;++S)if(S!==A){var I=E[S],O=I.indexOf("]="),M=O===-1?I.indexOf("="):O+1,F,j;M===-1?(F=y.decoder(I,r.decoder,k,"key"),j=y.strictNullHandling?null:""):(F=y.decoder(I.slice(0,M),r.decoder,k,"key"),j=t.maybeMap(a(I.slice(M+1),y,n(_[F])?_[F].length:0),function(L){return y.decoder(L,r.decoder,k,"value")})),j&&y.interpretNumericEntities&&k==="iso-8859-1"&&(j=i(String(j))),I.indexOf("[]=")>-1&&(j=n(j)?[j]:j);var T=e.call(_,F);T&&y.duplicates==="combine"?_[F]=t.combine(_[F],j):(!T||y.duplicates==="last")&&(_[F]=j)}return _},h=function(v,p,y,_){var x=0;if(v.length>0&&v[v.length-1]==="[]"){var b=v.slice(0,-1).join("");x=Array.isArray(p)&&p[b]?p[b].length:0}for(var E=_?p:a(p,y,x),A=v.length-1;A>=0;--A){var S,k=v[A];if(k==="[]"&&y.parseArrays)S=y.allowEmptyArrays&&(E===""||y.strictNullHandling&&E===null)?[]:t.combine([],E);else{S=y.plainObjects?{__proto__:null}:{};var I=k.charAt(0)==="["&&k.charAt(k.length-1)==="]"?k.slice(1,-1):k,O=y.decodeDotInKeys?I.replace(/%2E/g,"."):I,M=parseInt(O,10);!y.parseArrays&&O===""?S={0:E}:!isNaN(M)&&k!==O&&String(M)===O&&M>=0&&y.parseArrays&&M<=y.arrayLimit?(S=[],S[M]=E):O!=="__proto__"&&(S[O]=E)}E=S}return E},f=function(p,y,_,x){if(p){var b=_.allowDots?p.replace(/\.([^.[]+)/g,"[$1]"):p,E=/(\[[^[\]]*])/,A=/(\[[^[\]]*])/g,S=_.depth>0&&E.exec(b),k=S?b.slice(0,S.index):b,I=[];if(k){if(!_.plainObjects&&e.call(Object.prototype,k)&&!_.allowPrototypes)return;I.push(k)}for(var O=0;_.depth>0&&(S=A.exec(b))!==null&&O<_.depth;){if(O+=1,!_.plainObjects&&e.call(Object.prototype,S[1].slice(1,-1))&&!_.allowPrototypes)return;I.push(S[1])}if(S){if(_.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+_.depth+" and strictDepth is true");I.push("["+b.slice(S.index)+"]")}return h(I,y,_,x)}},g=function(p){if(!p)return r;if(typeof p.allowEmptyArrays<"u"&&typeof p.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof p.decodeDotInKeys<"u"&&typeof p.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(p.decoder!==null&&typeof p.decoder<"u"&&typeof p.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof p.charset<"u"&&p.charset!=="utf-8"&&p.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof p.throwOnLimitExceeded<"u"&&typeof p.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var y=typeof p.charset>"u"?r.charset:p.charset,_=typeof p.duplicates>"u"?r.duplicates:p.duplicates;if(_!=="combine"&&_!=="first"&&_!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var x=typeof p.allowDots>"u"?p.decodeDotInKeys===!0?!0:r.allowDots:!!p.allowDots;return{allowDots:x,allowEmptyArrays:typeof p.allowEmptyArrays=="boolean"?!!p.allowEmptyArrays:r.allowEmptyArrays,allowPrototypes:typeof p.allowPrototypes=="boolean"?p.allowPrototypes:r.allowPrototypes,allowSparse:typeof p.allowSparse=="boolean"?p.allowSparse:r.allowSparse,arrayLimit:typeof p.arrayLimit=="number"?p.arrayLimit:r.arrayLimit,charset:y,charsetSentinel:typeof p.charsetSentinel=="boolean"?p.charsetSentinel:r.charsetSentinel,comma:typeof p.comma=="boolean"?p.comma:r.comma,decodeDotInKeys:typeof p.decodeDotInKeys=="boolean"?p.decodeDotInKeys:r.decodeDotInKeys,decoder:typeof p.decoder=="function"?p.decoder:r.decoder,delimiter:typeof p.delimiter=="string"||t.isRegExp(p.delimiter)?p.delimiter:r.delimiter,depth:typeof p.depth=="number"||p.depth===!1?+p.depth:r.depth,duplicates:_,ignoreQueryPrefix:p.ignoreQueryPrefix===!0,interpretNumericEntities:typeof p.interpretNumericEntities=="boolean"?p.interpretNumericEntities:r.interpretNumericEntities,parameterLimit:typeof p.parameterLimit=="number"?p.parameterLimit:r.parameterLimit,parseArrays:p.parseArrays!==!1,plainObjects:typeof p.plainObjects=="boolean"?p.plainObjects:r.plainObjects,strictDepth:typeof p.strictDepth=="boolean"?!!p.strictDepth:r.strictDepth,strictNullHandling:typeof p.strictNullHandling=="boolean"?p.strictNullHandling:r.strictNullHandling,throwOnLimitExceeded:typeof p.throwOnLimitExceeded=="boolean"?p.throwOnLimitExceeded:!1}};return J2=function(v,p){var y=g(p);if(v===""||v===null||typeof v>"u")return y.plainObjects?{__proto__:null}:{};for(var _=typeof v=="string"?u(v,y):v,x=y.plainObjects?{__proto__:null}:{},b=Object.keys(_),E=0;E<b.length;++E){var A=b[E],S=f(A,_[A],y,typeof v=="string");x=t.merge(x,S,y)}return y.allowSparse===!0?x:t.compact(x)},J2}var ev,Ub;function ZL(){if(Ub)return ev;Ub=1;var t=XL(),e=KL(),n=py();return ev={formats:n,parse:e,stringify:t},ev}var Hb;function U7(){if(Hb)return Vf;Hb=1;var t=yL();function e(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var n=/^([a-z0-9.+-]+:)/i,r=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,a=["<",">",'"',"`"," ","\r",`
157
+ `," "],o=["{","}","|","\\","^","`"].concat(a),s=["'"].concat(o),u=["%","/","?",";","#"].concat(s),h=["/","?","#"],f=255,g=/^[+a-z0-9A-Z_-]{0,63}$/,v=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},x=ZL();function b(k,I,O){if(k&&typeof k=="object"&&k instanceof e)return k;var M=new e;return M.parse(k,I,O),M}e.prototype.parse=function(k,I,O){if(typeof k!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof k);var M=k.indexOf("?"),F=M!==-1&&M<k.indexOf("#")?"?":"#",j=k.split(F),T=/\\/g;j[0]=j[0].replace(T,"/"),k=j.join(F);var L=k;if(L=L.trim(),!O&&k.split("#").length===1){var $=i.exec(L);if($)return this.path=L,this.href=L,this.pathname=$[1],$[2]?(this.search=$[2],I?this.query=x.parse(this.search.substr(1)):this.query=this.search.substr(1)):I&&(this.search="",this.query={}),this}var q=n.exec(L);if(q){q=q[0];var J=q.toLowerCase();this.protocol=J,L=L.substr(q.length)}if(O||q||L.match(/^\/\/[^@/]+@[^@/]+/)){var ae=L.substr(0,2)==="//";ae&&!(q&&y[q])&&(L=L.substr(2),this.slashes=!0)}if(!y[q]&&(ae||q&&!_[q])){for(var ie=-1,Z=0;Z<h.length;Z++){var te=L.indexOf(h[Z]);te!==-1&&(ie===-1||te<ie)&&(ie=te)}var V,B;ie===-1?B=L.lastIndexOf("@"):B=L.lastIndexOf("@",ie),B!==-1&&(V=L.slice(0,B),L=L.slice(B+1),this.auth=decodeURIComponent(V)),ie=-1;for(var Z=0;Z<u.length;Z++){var te=L.indexOf(u[Z]);te!==-1&&(ie===-1||te<ie)&&(ie=te)}ie===-1&&(ie=L.length),this.host=L.slice(0,ie),L=L.slice(ie),this.parseHost(),this.hostname=this.hostname||"";var D=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!D)for(var U=this.hostname.split(/\./),Z=0,X=U.length;Z<X;Z++){var ee=U[Z];if(ee&&!ee.match(g)){for(var K="",oe=0,me=ee.length;oe<me;oe++)ee.charCodeAt(oe)>127?K+="x":K+=ee[oe];if(!K.match(g)){var de=U.slice(0,Z),ye=U.slice(Z+1),Re=ee.match(v);Re&&(de.push(Re[1]),ye.unshift(Re[2])),ye.length&&(L="/"+ye.join(".")+L),this.hostname=de.join(".");break}}}this.hostname.length>f?this.hostname="":this.hostname=this.hostname.toLowerCase(),D||(this.hostname=t.toASCII(this.hostname));var Oe=this.port?":"+this.port:"",Me=this.hostname||"";this.host=Me+Oe,this.href+=this.host,D&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),L[0]!=="/"&&(L="/"+L))}if(!p[J])for(var Z=0,X=s.length;Z<X;Z++){var Ee=s[Z];if(L.indexOf(Ee)!==-1){var ge=encodeURIComponent(Ee);ge===Ee&&(ge=escape(Ee)),L=L.split(Ee).join(ge)}}var Te=L.indexOf("#");Te!==-1&&(this.hash=L.substr(Te),L=L.slice(0,Te));var Be=L.indexOf("?");if(Be!==-1?(this.search=L.substr(Be),this.query=L.substr(Be+1),I&&(this.query=x.parse(this.query)),L=L.slice(0,Be)):I&&(this.search="",this.query={}),L&&(this.pathname=L),_[J]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var Oe=this.pathname||"",Ce=this.search||"";this.path=Oe+Ce}return this.href=this.format(),this};function E(k){return typeof k=="string"&&(k=b(k)),k instanceof e?k.format():e.prototype.format.call(k)}e.prototype.format=function(){var k=this.auth||"";k&&(k=encodeURIComponent(k),k=k.replace(/%3A/i,":"),k+="@");var I=this.protocol||"",O=this.pathname||"",M=this.hash||"",F=!1,j="";this.host?F=k+this.host:this.hostname&&(F=k+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(F+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(j=x.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var T=this.search||j&&"?"+j||"";return I&&I.substr(-1)!==":"&&(I+=":"),this.slashes||(!I||_[I])&&F!==!1?(F="//"+(F||""),O&&O.charAt(0)!=="/"&&(O="/"+O)):F||(F=""),M&&M.charAt(0)!=="#"&&(M="#"+M),T&&T.charAt(0)!=="?"&&(T="?"+T),O=O.replace(/[?#]/g,function(L){return encodeURIComponent(L)}),T=T.replace("#","%23"),I+F+O+T+M};function A(k,I){return b(k,!1,!0).resolve(I)}e.prototype.resolve=function(k){return this.resolveObject(b(k,!1,!0)).format()};function S(k,I){return k?b(k,!1,!0).resolveObject(I):I}return e.prototype.resolveObject=function(k){if(typeof k=="string"){var I=new e;I.parse(k,!1,!0),k=I}for(var O=new e,M=Object.keys(this),F=0;F<M.length;F++){var j=M[F];O[j]=this[j]}if(O.hash=k.hash,k.href==="")return O.href=O.format(),O;if(k.slashes&&!k.protocol){for(var T=Object.keys(k),L=0;L<T.length;L++){var $=T[L];$!=="protocol"&&(O[$]=k[$])}return _[O.protocol]&&O.hostname&&!O.pathname&&(O.pathname="/",O.path=O.pathname),O.href=O.format(),O}if(k.protocol&&k.protocol!==O.protocol){if(!_[k.protocol]){for(var q=Object.keys(k),J=0;J<q.length;J++){var ae=q[J];O[ae]=k[ae]}return O.href=O.format(),O}if(O.protocol=k.protocol,!k.host&&!y[k.protocol]){for(var X=(k.pathname||"").split("/");X.length&&!(k.host=X.shift()););k.host||(k.host=""),k.hostname||(k.hostname=""),X[0]!==""&&X.unshift(""),X.length<2&&X.unshift(""),O.pathname=X.join("/")}else O.pathname=k.pathname;if(O.search=k.search,O.query=k.query,O.host=k.host||"",O.auth=k.auth,O.hostname=k.hostname||k.host,O.port=k.port,O.pathname||O.search){var ie=O.pathname||"",Z=O.search||"";O.path=ie+Z}return O.slashes=O.slashes||k.slashes,O.href=O.format(),O}var te=O.pathname&&O.pathname.charAt(0)==="/",V=k.host||k.pathname&&k.pathname.charAt(0)==="/",B=V||te||O.host&&k.pathname,D=B,U=O.pathname&&O.pathname.split("/")||[],X=k.pathname&&k.pathname.split("/")||[],ee=O.protocol&&!_[O.protocol];if(ee&&(O.hostname="",O.port=null,O.host&&(U[0]===""?U[0]=O.host:U.unshift(O.host)),O.host="",k.protocol&&(k.hostname=null,k.port=null,k.host&&(X[0]===""?X[0]=k.host:X.unshift(k.host)),k.host=null),B=B&&(X[0]===""||U[0]==="")),V)O.host=k.host||k.host===""?k.host:O.host,O.hostname=k.hostname||k.hostname===""?k.hostname:O.hostname,O.search=k.search,O.query=k.query,U=X;else if(X.length)U||(U=[]),U.pop(),U=U.concat(X),O.search=k.search,O.query=k.query;else if(k.search!=null){if(ee){O.host=U.shift(),O.hostname=O.host;var K=O.host&&O.host.indexOf("@")>0?O.host.split("@"):!1;K&&(O.auth=K.shift(),O.hostname=K.shift(),O.host=O.hostname)}return O.search=k.search,O.query=k.query,(O.pathname!==null||O.search!==null)&&(O.path=(O.pathname?O.pathname:"")+(O.search?O.search:"")),O.href=O.format(),O}if(!U.length)return O.pathname=null,O.search?O.path="/"+O.search:O.path=null,O.href=O.format(),O;for(var oe=U.slice(-1)[0],me=(O.host||k.host||U.length>1)&&(oe==="."||oe==="..")||oe==="",de=0,ye=U.length;ye>=0;ye--)oe=U[ye],oe==="."?U.splice(ye,1):oe===".."?(U.splice(ye,1),de++):de&&(U.splice(ye,1),de--);if(!B&&!D)for(;de--;de)U.unshift("..");B&&U[0]!==""&&(!U[0]||U[0].charAt(0)!=="/")&&U.unshift(""),me&&U.join("/").substr(-1)!=="/"&&U.push("");var Re=U[0]===""||U[0]&&U[0].charAt(0)==="/";if(ee){O.hostname=Re?"":U.length?U.shift():"",O.host=O.hostname;var K=O.host&&O.host.indexOf("@")>0?O.host.split("@"):!1;K&&(O.auth=K.shift(),O.hostname=K.shift(),O.host=O.hostname)}return B=B||O.host&&U.length,B&&!Re&&U.unshift(""),U.length>0?O.pathname=U.join("/"):(O.pathname=null,O.path=null),(O.pathname!==null||O.search!==null)&&(O.path=(O.pathname?O.pathname:"")+(O.search?O.search:"")),O.auth=k.auth||O.auth,O.slashes=O.slashes||k.slashes,O.href=O.format(),O},e.prototype.parseHost=function(){var k=this.host,I=r.exec(k);I&&(I=I[0],I!==":"&&(this.port=I.substr(1)),k=k.substr(0,k.length-I.length)),k&&(this.hostname=k)},Vf.parse=b,Vf.resolve=A,Vf.resolveObject=S,Vf.format=E,Vf.Url=e,Vf}var Z1={exports:{}},QL=Z1.exports,$b;function JL(){return $b||($b=1,(function(t){(function(e,n){t.exports?t.exports=n():e.xmlserializer=n()})(QL,function(){var e=function(p){return p.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")},n=function(p){return p.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")},r=function(p){return p.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},i=function(p){var y=p.value;return" "+p.name+'="'+n(y)+'"'},a=function(p){var y=p.tagName;return p.namespaceURI==="http://www.w3.org/1999/xhtml"&&(y=y.toLowerCase()),y},o=function(p,y){var _=Array.prototype.map.call(p.attributes||p.attrs,function(x){return x.name}).indexOf("xmlns")>=0;return!_&&(y||p.namespaceURI!==p.parentNode.namespaceURI)?' xmlns="'+p.namespaceURI+'"':""},s=function(p){return Array.prototype.map.call(p.childNodes,function(y){return v(y)}).join("")},u=function(p,y){var _="<"+a(p);return _+=o(p,y),Array.prototype.forEach.call(p.attributes||p.attrs,function(x){_+=i(x)}),p.childNodes.length>0?(_+=">",_+=s(p),_+="</"+a(p)+">"):_+="/>",_},h=function(p){var y=p.nodeValue||p.value||"";return r(y)},f=function(p){return"<!--"+p.data.replace(/-/g,"&#45;")+"-->"},g=function(p){return"<![CDATA["+p.nodeValue+"]]>"},v=function(p,y){var _=y&&y.rootNode;if(p.nodeName==="#document"||p.nodeName==="#document-fragment")return s(p);if(p.tagName)return u(p,_);if(p.nodeName==="#text")return h(p);if(p.nodeName==="#comment")return f(p);if(p.nodeName==="#cdata-section")return g(p)};return{serializeToString:function(p){return e(v(p,{rootNode:!0}))}}})})(Z1)),Z1.exports}var tv={},Gb;function eN(){if(Gb)return tv;Gb=1;var t=function(a){var o=new XMLSerializer;return Array.prototype.map.call(a.childNodes,function(s){return o.serializeToString(s)}).join("")},e=function(a){if(a.documentElement.tagName==="parsererror"&&a.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml")return a.documentElement;if((a.documentElement.tagName==="xml"||a.documentElement.tagName==="html")&&a.documentElement.childNodes&&a.documentElement.childNodes.length>0&&a.documentElement.childNodes[0].nodeName==="parsererror")return a.documentElement.childNodes[0];if(a.documentElement.tagName==="html"&&a.documentElement.childNodes&&a.documentElement.childNodes.length>0&&a.documentElement.childNodes[0].nodeName==="body"&&a.documentElement.childNodes[0].childNodes&&a.documentElement.childNodes[0].childNodes.length&&a.documentElement.childNodes[0].childNodes[0].nodeName==="parsererror")return a.documentElement.childNodes[0].childNodes[0]},n=[new RegExp(`^<h3[^>]*>This page contains the following errors:</h3><div[^>]*>(.+?)
158
+ ?</div>`),new RegExp(`^(.+)
159
+ `)],r=function(a){var o=t(a),s,u;for(s=0;s<n.length;s++)if(u=n[s].exec(o),u)return u[1]},i=function(a){var o;if(a===null)throw new Error("Parse error");var s=e(a);if(s!==void 0)throw o=r(s)||"Parse error",new Error(o)};return tv.failOnParseError=function(a){return i(a),a},tv}var nv={},rv={},Wb;function K0(){return Wb||(Wb=1,(function(t){var e=U7();t.getDocumentBaseUrl=function(s){return s.baseURI!=="about:blank"?s.baseURI:null},t.clone=function(s){var u={},h;for(h in s)s.hasOwnProperty(h)&&(u[h]=s[h]);return u},t.cloneArray=function(s){return Array.prototype.slice.apply(s,[0])},t.joinUrl=function(s,u){return s?e.resolve(s,u):u},t.isDataUri=function(s){return/^data:/.test(s)},t.collectAndReportErrors=function(s){var u=[];return Promise.all(s.map(function(h){return h.catch(function(f){u.push(f)})})).then(function(){return u})};var n=null,r=function(s,u){return u===!1||u==="none"||u==="repeated"?((n===null||u!=="repeated")&&(n=Date.now()),s+"?_="+n):s};t.ajax=function(s,u){return new Promise(function(h,f){var g=new window.XMLHttpRequest,v=t.joinUrl(u.baseUrl,s),p,y=function(){f({msg:"Unable to load url",url:v})};p=r(v,u.cache),g.addEventListener("load",function(){g.status===200||g.status===0?h(g.response):y()},!1),g.addEventListener("error",y,!1);try{g.open("GET",p,!0),g.overrideMimeType(u.mimeType),g.send(null)}catch{y()}})},t.binaryAjax=function(s,u){var h=t.clone(u);return h.mimeType="text/plain; charset=x-user-defined",t.ajax(s,h).then(function(f){for(var g="",v=0;v<f.length;v++)g+=String.fromCharCode(f.charCodeAt(v)&255);return g})};var i=function(s){var u=function(h,f){return h.substring(0,f.length)===f};return u(s,"<?xml")||u(s,"<svg")?"image/svg+xml":"image/png"};t.getDataURIForImageURL=function(s,u){return t.binaryAjax(s,u).then(function(h){var f=btoa(h),g=i(h);return"data:"+g+";base64,"+f})};var a=[],o=function(s){return a.indexOf(s)<0&&a.push(s),a.indexOf(s)};t.memoize=function(s,u,h){if(typeof h!="object")throw new Error("cacheBucket is not an object");return function(){var f=Array.prototype.slice.call(arguments),g=u(f),v=o(s),p;return h[v]&&h[v][g]?h[v][g]:(p=s.apply(null,f),h[v]=h[v]||{},h[v][g]=p,p)}}})(rv)),rv}var iv={},Vb;function tN(){if(Vb)return iv;Vb=1;var t=K0(),e=function(a,o){var s=null;a.hasAttribute("src")?s=a.getAttribute("src"):a.hasAttributeNS("http://www.w3.org/1999/xlink","href")?s=a.getAttributeNS("http://www.w3.org/1999/xlink","href"):a.hasAttribute("href")&&(s=a.getAttribute("href"));var u=t.getDocumentBaseUrl(a.ownerDocument),h=t.clone(o);return!h.baseUrl&&u&&(h.baseUrl=u),t.getDataURIForImageURL(s,h).then(function(f){return f},function(f){throw{resourceType:"image",url:f.url,msg:"Unable to load image "+f.url}})},n=function(a){return a.filter(function(o){var s=null;return o.hasAttribute("src")?s=o.getAttribute("src"):o.hasAttributeNS("http://www.w3.org/1999/xlink","href")?s=o.getAttributeNS("http://www.w3.org/1999/xlink","href"):o.hasAttribute("href")&&(s=o.getAttribute("href")),s!==null&&!t.isDataUri(s)})},r=function(a){return Array.prototype.filter.call(a,function(o){return o.type==="image"})},i=function(a){return Array.prototype.slice.call(a)};return iv.inline=function(a,o){var s=i(a.getElementsByTagName("img")),u=i(a.getElementsByTagName("image")),h=r(a.getElementsByTagName("input"));s=s.concat(u),s=s.concat(h);var f=n(s);return t.collectAndReportErrors(f.map(function(g){return e(g,o).then(function(v){g.attributes.src?g.attributes.src.value=v:g.attributes["xlink:href"]?g.attributes["xlink:href"].value=v:g.attributes.href&&(g.attributes.href.value=v)})}))},iv}var av={},Yb;function nN(){if(Yb)return av;Yb=1;var t=K0(),e=function(a,o){var s=a.attributes.src.value,u=t.getDocumentBaseUrl(a.ownerDocument),h=t.clone(o);return!h.baseUrl&&u&&(h.baseUrl=u),t.ajax(s,h).catch(function(f){throw{resourceType:"script",url:f.url,msg:"Unable to load script "+f.url}})},n=function(a){return a.replace(/<\//g,"<\\/")},r=function(a,o){a.attributes.removeNamedItem("src"),a.textContent=n(o)},i=function(a){var o=a.getElementsByTagName("script");return Array.prototype.filter.call(o,function(s){return!!s.attributes.src})};return av.inline=function(a,o){var s=i(a);return t.collectAndReportErrors(s.map(function(u){return e(u,o).then(function(h){r(u,h)})}))},av}var ov={},sv={},Xb;function gy(){return Xb||(Xb=1,(function(t){t.unquoteString=function(e){var n=/^"(.*)"$/,r=/^'(.*)'$/;return n.test(e)?e.replace(n,"$1"):r.test(e)?e.replace(r,"$1"):e},t.rulesForCssText=function(e){var n=document.implementation.createHTMLDocument(""),r=document.createElement("style"),i;return r.textContent=e,n.body.appendChild(r),i=r.sheet.cssRules,Array.prototype.slice.call(i)},t.cssRulesToText=function(e){return e.reduce(function(n,r){return n+r.cssText},"")},t.exchangeRule=function(e,n,r){var i=e.indexOf(n);e[i]=t.rulesForCssText(r)[0]},t.changeFontFaceRuleSrc=function(e,n,r){var i="@font-face { font-family: "+n.style.getPropertyValue("font-family")+"; ";n.style.getPropertyValue("font-style")&&(i+="font-style: "+n.style.getPropertyValue("font-style")+"; "),n.style.getPropertyValue("font-weight")&&(i+="font-weight: "+n.style.getPropertyValue("font-weight")+"; "),n.style.getPropertyValue("unicode-range")&&(i+="unicode-range: "+n.style.getPropertyValue("unicode-range")+"; "),i+="src: "+r+"}",t.exchangeRule(e,n,i)}})(sv)),sv}var lv={},Kb;function rN(){return Kb||(Kb=1,(function(t){var e=gy(),n=function(a){var o=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return a.replace(o,"$1")};t.extractCssUrl=function(a){var o=/^url\(("[^"]+"|'[^']+'|[^\)]+)\)/,s;if(!o.test(a))throw new Error("Invalid url");return s=o.exec(a)[1],e.unquoteString(n(s))};var r=function(a){var o=`\\s*(?:"[^"]*"|'[^']*'|[^\\(]+)\\s*`,s="(url\\("+o+"\\)|[^,\\s]+)",u="(?:\\s*"+s+")+",h="^\\s*("+u+")(?:\\s*,\\s*("+u+"))*\\s*$",f=new RegExp(u,"g"),g,v=[],p=function(y){var _=new RegExp(s,"g"),x=[],b;for(b=_.exec(y);b;)x.push(b[1]),b=_.exec(y);return x};if(a.match(new RegExp(h))){for(g=f.exec(a);g;)v.push(p(g[0])),g=f.exec(a);return v}return[]},i=function(a){var o,s;for(o=0;o<a.length;o++)try{return s=t.extractCssUrl(a[o]),{url:s,idx:o}}catch{}};t.parse=function(a){var o=r(a);return o.map(function(s){var u=i(s);return u?{preUrl:s.slice(0,u.idx),url:u.url,postUrl:s.slice(u.idx+1)}:{preUrl:s}})},t.serialize=function(a){var o=a.map(function(s){var u=[].concat(s.preUrl);return s.url&&u.push('url("'+s.url+'")'),s.postUrl&&(u=u.concat(s.postUrl)),u.join(" ")});return o.join(", ")}})(lv)),lv}function N1(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var uv={exports:{}},Zb;function iN(){return Zb||(Zb=1,(function(t,e){(function(n){t.exports=n()})(function(){return(function n(r,i,a){function o(h,f){if(!i[h]){if(!r[h]){var g=typeof N1=="function"&&N1;if(!f&&g)return g(h,!0);if(s)return s(h,!0);var v=new Error("Cannot find module '"+h+"'");throw v.code="MODULE_NOT_FOUND",v}var p=i[h]={exports:{}};r[h][0].call(p.exports,function(y){var _=r[h][1][y];return o(_||y)},p,p.exports,n,r,i,a)}return i[h].exports}for(var s=typeof N1=="function"&&N1,u=0;u<a.length;u++)o(a[u]);return o})({1:[function(n,r,i){function a(u,h){function f(){this.constructor=u}f.prototype=h.prototype,u.prototype=new f}function o(u,h,f,g){this.message=u,this.expected=h,this.found=f,this.location=g,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,o)}a(o,Error),o.buildMessage=function(u,h){var f={literal:function(b){return'"'+v(b.text)+'"'},class:function(b){var E="",A;for(A=0;A<b.parts.length;A++)E+=b.parts[A]instanceof Array?p(b.parts[A][0])+"-"+p(b.parts[A][1]):p(b.parts[A]);return"["+(b.inverted?"^":"")+E+"]"},any:function(b){return"any character"},end:function(b){return"end of input"},other:function(b){return b.description}};function g(b){return b.charCodeAt(0).toString(16).toUpperCase()}function v(b){return b.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(E){return"\\x0"+g(E)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(E){return"\\x"+g(E)})}function p(b){return b.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(E){return"\\x0"+g(E)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(E){return"\\x"+g(E)})}function y(b){return f[b.type](b)}function _(b){var E=new Array(b.length),A,S;for(A=0;A<b.length;A++)E[A]=y(b[A]);if(E.sort(),E.length>0){for(A=1,S=1;A<E.length;A++)E[A-1]!==E[A]&&(E[S]=E[A],S++);E.length=S}switch(E.length){case 1:return E[0];case 2:return E[0]+" or "+E[1];default:return E.slice(0,-1).join(", ")+", or "+E[E.length-1]}}function x(b){return b?'"'+v(b)+'"':"end of input"}return"Expected "+_(u)+" but "+x(h)+" found."};function s(u,h){h=h!==void 0?h:{};var f={},g={start:Oe},v=Oe,p="",y=function(){return[]},_=",",x=ee(",",!1),b=function(ue,Ae){return[ue].concat(Ae)},E=function(ue){return[ue]},A=function(ue,Ae){return{url:ue,format:Ae}},S=function(ue){return{url:ue}},k="url(",I=ee("url(",!1),O=")",M=ee(")",!1),F=function(ue){return ue},j="format(",T=ee("format(",!1),L="local(",$=ee("local(",!1),q=function(ue){return{local:ue}},J=/^[^)]/,ae=K([")"],!0,!1),ie=function(ue){return Ne.extractValue(ue.join(""))},Z=/^[ \t\r\n\f]/,te=K([" "," ","\r",`
160
+ `,"\f"],!1,!1),V=0,B=[{line:1,column:1}],D=0,U=[],X;if("startRule"in h){if(!(h.startRule in g))throw new Error(`Can't start parsing from rule "`+h.startRule+'".');v=g[h.startRule]}function ee(ue,Ae){return{type:"literal",text:ue,ignoreCase:Ae}}function K(ue,Ae,Pe){return{type:"class",parts:ue,inverted:Ae,ignoreCase:Pe}}function oe(){return{type:"end"}}function me(ue){var Ae=B[ue],Pe;if(Ae)return Ae;for(Pe=ue-1;!B[Pe];)Pe--;for(Ae=B[Pe],Ae={line:Ae.line,column:Ae.column};Pe<ue;)u.charCodeAt(Pe)===10?(Ae.line++,Ae.column=1):Ae.column++,Pe++;return B[ue]=Ae,Ae}function de(ue,Ae){var Pe=me(ue),Ue=me(Ae);return{start:{offset:ue,line:Pe.line,column:Pe.column},end:{offset:Ae,line:Ue.line,column:Ue.column}}}function ye(ue){V<D||(V>D&&(D=V,U=[]),U.push(ue))}function Re(ue,Ae,Pe){return new o(o.buildMessage(ue,Ae),ue,Ae,Pe)}function Oe(){var ue,Ae;return ue=Me(),ue===f&&(ue=V,Ae=p,Ae!==f&&(Ae=y()),ue=Ae),ue}function Me(){var ue,Ae,Pe,Ue,st,dt;if(ue=V,Ae=Ee(),Ae!==f){for(Pe=[],Ue=Le();Ue!==f;)Pe.push(Ue),Ue=Le();if(Pe!==f)if(u.charCodeAt(V)===44?(Ue=_,V++):(Ue=f,ye(x)),Ue!==f){for(st=[],dt=Le();dt!==f;)st.push(dt),dt=Le();st!==f?(dt=Me(),dt!==f?(Ae=b(Ae,dt),ue=Ae):(V=ue,ue=f)):(V=ue,ue=f)}else V=ue,ue=f;else V=ue,ue=f}else V=ue,ue=f;return ue===f&&(ue=V,Ae=Ee(),Ae!==f&&(Ae=E(Ae)),ue=Ae),ue}function Ee(){var ue;return ue=ge(),ue===f&&(ue=Ce()),ue}function ge(){var ue,Ae,Pe,Ue;if(ue=V,Ae=Te(),Ae!==f){if(Pe=[],Ue=Le(),Ue!==f)for(;Ue!==f;)Pe.push(Ue),Ue=Le();else Pe=f;Pe!==f?(Ue=Be(),Ue!==f?(Ae=A(Ae,Ue),ue=Ae):(V=ue,ue=f)):(V=ue,ue=f)}else V=ue,ue=f;return ue===f&&(ue=V,Ae=Te(),Ae!==f&&(Ae=S(Ae)),ue=Ae),ue}function Te(){var ue,Ae,Pe,Ue;return ue=V,u.substr(V,4)===k?(Ae=k,V+=4):(Ae=f,ye(I)),Ae!==f?(Pe=fe(),Pe!==f?(u.charCodeAt(V)===41?(Ue=O,V++):(Ue=f,ye(M)),Ue!==f?(Ae=F(Pe),ue=Ae):(V=ue,ue=f)):(V=ue,ue=f)):(V=ue,ue=f),ue}function Be(){var ue,Ae,Pe,Ue;return ue=V,u.substr(V,7)===j?(Ae=j,V+=7):(Ae=f,ye(T)),Ae!==f?(Pe=fe(),Pe!==f?(u.charCodeAt(V)===41?(Ue=O,V++):(Ue=f,ye(M)),Ue!==f?(Ae=F(Pe),ue=Ae):(V=ue,ue=f)):(V=ue,ue=f)):(V=ue,ue=f),ue}function Ce(){var ue,Ae,Pe,Ue;return ue=V,u.substr(V,6)===L?(Ae=L,V+=6):(Ae=f,ye($)),Ae!==f?(Pe=fe(),Pe!==f?(u.charCodeAt(V)===41?(Ue=O,V++):(Ue=f,ye(M)),Ue!==f?(Ae=q(Pe),ue=Ae):(V=ue,ue=f)):(V=ue,ue=f)):(V=ue,ue=f),ue}function fe(){var ue,Ae,Pe;if(ue=V,Ae=[],J.test(u.charAt(V))?(Pe=u.charAt(V),V++):(Pe=f,ye(ae)),Pe!==f)for(;Pe!==f;)Ae.push(Pe),J.test(u.charAt(V))?(Pe=u.charAt(V),V++):(Pe=f,ye(ae));else Ae=f;return Ae!==f&&(Ae=ie(Ae)),ue=Ae,ue}function Le(){var ue;return Z.test(u.charAt(V))?(ue=u.charAt(V),V++):(ue=f,ye(te)),ue}var Ne=n("../util");if(X=v(),X!==f&&V===u.length)return X;throw X!==f&&V<u.length&&ye(oe()),Re(U,D<u.length?u.charAt(D):null,D<u.length?de(D,D+1):de(D,D))}r.exports={SyntaxError:o,parse:s}},{"../util":3}],2:[function(n,r,i){var a=n("./grammar");i.SyntaxError=function(o,s){this.message=o,this.offset=s},i.parse=function(o){try{return a.parse(o)}catch(s){throw new i.SyntaxError(s.message,s.offset)}},i.serialize=function(o){return o.map(function(s){var u;return s.url?(u='url("'+s.url+'")',s.format&&(u+=' format("'+s.format+'")')):u='local("'+s.local+'")',u}).join(", ")}},{"./grammar":1}],3:[function(n,r,i){var a=function(s){var u=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return s.replace(u,"$1")},o=function(s){var u=/^"(.*)"$/,h=/^'(.*)'$/;return u.test(s)?s.replace(u,"$1"):h.test(s)?s.replace(h,"$1"):s};i.extractValue=function(s){return o(a(s))}},{}]},{},[2])(2)})})(uv)),uv.exports}var Qb;function aN(){return Qb||(Qb=1,(function(t){var e=K0(),n=gy(),r=rN(),i=iN(),a=function(E,A,S){E.style.setProperty(A,S,E.style.getPropertyPriority(A))},o=function(E){return E.filter(function(A){return A.type===window.CSSRule.STYLE_RULE&&(A.style.getPropertyValue("background-image")||A.style.getPropertyValue("background"))})},s=function(E){var A=[];return E.forEach(function(S){S.style.getPropertyValue("background-image")?A.push({property:"background-image",value:S.style.getPropertyValue("background-image"),rule:S}):S.style.getPropertyValue("background")&&A.push({property:"background",value:S.style.getPropertyValue("background"),rule:S})}),A},u=function(E){return E.filter(function(A){return A.type===window.CSSRule.FONT_FACE_RULE&&A.style.getPropertyValue("src")})},h=function(E){return E.filter(function(A){return A.type===window.CSSRule.IMPORT_RULE&&A.href})},f=function(E){var A=[];return E.forEach(function(S,k){S.url&&!e.isDataUri(S.url)&&A.push(k)}),A},g=function(E){var A=[];return E.forEach(function(S,k){S.url&&!e.isDataUri(S.url)&&A.push(k)}),A};t.adjustPathsOfCssResources=function(E,A){var S=o(A),k=s(S),I=!1;return k.forEach(function(O){var M=r.parse(O.value),F=f(M),j;F.length>0&&(F.forEach(function(T){var L=M[T].url,$=e.joinUrl(E,L);M[T].url=$}),j=r.serialize(M),a(O.rule,O.property,j),I=!0)}),u(A).forEach(function(O){var M=O.style.getPropertyValue("src"),F,j;try{F=i.parse(M)}catch{return}j=g(F),j.length>0&&(j.forEach(function(T){var L=F[T].url,$=e.joinUrl(E,L);F[T].url=$}),n.changeFontFaceRuleSrc(A,O,i.serialize(F)),I=!0)}),h(A).forEach(function(O){var M=O.href,F=e.joinUrl(E,M);n.exchangeRule(A,O,"@import url("+F+");"),I=!0}),I};var v=function(E,A,S){var k=E.indexOf(A);E.splice(k,1),S.forEach(function(I,O){E.splice(k+O,0,I)})},p=function(E,A,S,k){var I=A.href,O;return I=n.unquoteString(I),O=e.joinUrl(k.baseUrl,I),S.indexOf(O)>=0?(v(E,A,[]),Promise.resolve([])):(S.push(O),e.ajax(I,k).then(function(M){var F=n.rulesForCssText(M);return t.loadCSSImportsForRules(F,S,k).then(function(j){return t.adjustPathsOfCssResources(I,F),v(E,A,F),j.errors})},function(M){throw{resourceType:"stylesheet",url:M.url,msg:"Unable to load stylesheet "+M.url}}))};t.loadCSSImportsForRules=function(E,A,S){var k=h(E),I=[],O=!1;return Promise.all(k.map(function(M){return p(E,M,A,S).then(function(F){I=I.concat(F),O=!0},function(F){I.push(F)})})).then(function(){return{hasChanges:O,errors:I}})};var y=function(E,A){var S=r.parse(E),k=f(S),I=!1;return e.collectAndReportErrors(k.map(function(O){var M=S[O].url;return e.getDataURIForImageURL(M,A).then(function(F){S[O].url=F,I=!0},function(F){throw{resourceType:"backgroundImage",url:F.url,msg:"Unable to load background-image "+F.url}})})).then(function(O){return{backgroundValue:r.serialize(S),hasChanges:I,errors:O}})},_=function(E,A){var S=o(E),k=s(S),I=[],O=!1;return Promise.all(k.map(function(M){return y(M.value,A).then(function(F){F.hasChanges&&(a(M.rule,M.property,F.backgroundValue),O=!0),I=I.concat(F.errors)})})).then(function(){return{hasChanges:O,errors:I}})},x=function(E,A){var S=!1,k,I;try{k=i.parse(E)}catch{k=[]}return I=g(k),e.collectAndReportErrors(I.map(function(O){var M=k[O],F=M.format||"woff";return e.binaryAjax(M.url,A).then(function(j){var T=btoa(j);M.url="data:font/"+F+";base64,"+T,S=!0},function(j){throw{resourceType:"fontFace",url:j.url,msg:"Unable to load font-face "+j.url}})})).then(function(O){return{srcDeclarationValue:i.serialize(k),hasChanges:S,errors:O}})},b=function(E,A){var S=u(E),k=[],I=!1;return Promise.all(S.map(function(O){var M=O.style.getPropertyValue("src");return x(M,A).then(function(F){F.hasChanges&&(n.changeFontFaceRuleSrc(E,O,F.srcDeclarationValue),I=!0),k=k.concat(F.errors)})})).then(function(){return{hasChanges:I,errors:k}})};t.loadAndInlineCSSResourcesForRules=function(E,A){var S=!1,k=[];return Promise.all([_,b].map(function(I){return I(E,A).then(function(O){S=S||O.hasChanges,k=k.concat(O.errors)})})).then(function(){return{hasChanges:S,errors:k}})}})(ov)),ov}var Jb;function oN(){return Jb||(Jb=1,(function(t){var e=K0(),n=tN(),r=nN(),i=aN(),a=gy(),o=function(x){return e.joinUrl(x,".")},s=function(x){var b=x.map(function(E,A){return A===x.length-1&&(E={baseUrl:o(E.baseUrl)}),JSON.stringify(E)});return b},u=function(x,b){return b.cache!==!1&&b.cache!=="none"&&b.cacheBucket?e.memoize(x,s,b.cacheBucket):x},h=function(x,b,E){var A=a.rulesForCssText(x);return i.loadCSSImportsForRules(A,b,E).then(function(S){return i.loadAndInlineCSSResourcesForRules(A,E).then(function(k){var I=S.errors.concat(k.errors),O=S.hasChanges||k.hasChanges;return O&&(x=a.cssRulesToText(A)),{hasChanges:O,content:x,errors:I}})})},f=function(x,b,E){var A=x.textContent,S=u(h,b);return S(A,E,b).then(function(k){return k.hasChanges&&(x.childNodes[0].nodeValue=k.content),e.cloneArray(k.errors)})},g=function(x){var b=x.getElementsByTagName("style");return Array.prototype.filter.call(b,function(E){return!E.attributes.type||E.attributes.type.value==="text/css"})};t.loadAndInlineStyles=function(x,b){var E=g(x),A=[],S=[],k;return k=e.clone(b),k.baseUrl=k.baseUrl||e.getDocumentBaseUrl(x),Promise.all(E.map(function(I){return f(I,k,S).then(function(O){A=A.concat(O)})})).then(function(){return A})};var v=function(x,b){var E=x.parentNode,A;b=b.trim(),b&&(A=x.ownerDocument.createElement("style"),A.type="text/css",A.appendChild(x.ownerDocument.createTextNode(b)),E.insertBefore(A,x)),E.removeChild(x)},p=function(x,b){return e.ajax(x,b).then(function(E){var A=a.rulesForCssText(E);return{content:E,cssRules:A}}).then(function(E){var A=i.adjustPathsOfCssResources(x,E.cssRules);return{content:E.content,cssRules:E.cssRules,hasChanges:A}}).then(function(E){return i.loadCSSImportsForRules(E.cssRules,[],b).then(function(A){return{content:E.content,cssRules:E.cssRules,hasChanges:E.hasChanges||A.hasChanges,errors:A.errors}})}).then(function(E){return i.loadAndInlineCSSResourcesForRules(E.cssRules,b).then(function(A){return{content:E.content,cssRules:E.cssRules,hasChanges:E.hasChanges||A.hasChanges,errors:E.errors.concat(A.errors)}})}).then(function(E){var A=E.content;return E.hasChanges&&(A=a.cssRulesToText(E.cssRules)),{content:A,errors:E.errors}})},y=function(x,b){var E=x.attributes.href.value,A=e.getDocumentBaseUrl(x.ownerDocument),S=e.clone(b);!S.baseUrl&&A&&(S.baseUrl=A);var k=u(p,b);return k(E,S).then(function(I){return{content:I.content,errors:e.cloneArray(I.errors)}})},_=function(x){var b=x.getElementsByTagName("link");return Array.prototype.filter.call(b,function(E){return E.attributes.rel&&E.attributes.rel.value==="stylesheet"&&(!E.attributes.type||E.attributes.type.value==="text/css")})};t.loadAndInlineCssLinks=function(x,b){var E=_(x),A=[];return Promise.all(E.map(function(S){return y(S,b).then(function(k){v(S,k.content+`
161
+ `),A=A.concat(k.errors)},function(k){A.push({resourceType:"stylesheet",url:k.url,msg:"Unable to load stylesheet "+k.url})})})).then(function(){return A})},t.loadAndInlineImages=n.inline,t.loadAndInlineScript=r.inline,t.inlineReferences=function(x,b){var E=[],A=[t.loadAndInlineImages,t.loadAndInlineStyles,t.loadAndInlineCssLinks];return b.inlineScripts!==!1&&A.push(t.loadAndInlineScript),Promise.all(A.map(function(S){return S(x,b).then(function(k){E=E.concat(k)})})).then(function(){return E})}})(nv)),nv}/*! rasterizeHTML.js - v1.3.1 - 2022-01-16
162
+ * http://www.github.com/cburgmer/rasterizeHTML.js
163
+ * Copyright (c) 2022 Christoph Burgmer; Licensed MIT */var sN=K1.exports,e4;function lN(){return e4||(e4=1,(function(t){(function(e,n){e===void 0&&window!==void 0&&(e=window),t.exports?t.exports=n(U7(),JL(),eN(),oN()):e.rasterizeHTML=n(e.url,e.xmlserializer,e.sanedomparsererror,e.inlineresources)})(sN,function(e,n,r,i){var a=(function(y){var _={},x=[];_.joinUrl=function(A,S){return A?y.resolve(A,S):S},_.getConstantUniqueIdFor=function(A){return x.indexOf(A)<0&&x.push(A),x.indexOf(A)},_.clone=function(A){var S={},k;for(k in A)A.hasOwnProperty(k)&&(S[k]=A[k]);return S};var b=function(A){return typeof A=="object"&&A!==null},E=function(A){return b(A)&&Object.prototype.toString.apply(A).match(/\[object (Canvas|HTMLCanvasElement)\]/i)};return _.parseOptionalParameters=function(A){var S={canvas:null,options:{}};return A[0]==null||E(A[0])?(S.canvas=A[0]||null,S.options=_.clone(A[1])):S.options=_.clone(A[0]),S},_})(e),o=(function(y){var _={},x=function(b,E,A){var S=b[E];return b[E]=function(){var k=Array.prototype.slice.call(arguments);return A.apply(this,[k,S])},S};return _.baseUrlRespectingXhr=function(b,E){var A=function(){var S=new b;return x(S,"open",function(k,I){var O=k.shift(),M=k.shift(),F=y.joinUrl(E,M);return I.apply(this,[O,F].concat(k))}),S};return A},_.finishNotifyingXhr=function(b){var E=0,A=0,S=!1,k,I=new Promise(function(M){k=function(){var F=E-A;F<=0&&S&&M({totalCount:E})}}),O=function(){var M=new b;return x(M,"send",function(F,j){return E+=1,j.apply(this,arguments)}),M.addEventListener("load",function(){A+=1,k()}),M};return O.waitForRequestsToFinish=function(){return S=!0,k(),I},O},_})(a),s=(function(){var y={},_=function(O){return Array.prototype.slice.call(O)};y.addClassName=function(O,M){O.className+=" "+M},y.addClassNameRecursively=function(O,M){y.addClassName(O,M),O.parentNode!==O.ownerDocument&&y.addClassNameRecursively(O.parentNode,M)};var x=function(O,M){var F=O.parentStyleSheet,j=_(F.cssRules).indexOf(O);F.insertRule(M,j+1),F.deleteRule(j)},b=function(O,M){var F=O.cssText.replace(/^[^\{]+/,""),j=M+" "+F;x(O,j)},E=function(O){return _(O).reduce(function(M,F){return M+F.cssText},"")},A=function(O){O.textContent=E(O.sheet.cssRules)},S=function(O){var M=document.implementation.createHTMLDocument(""),F=document.createElement("style");F.textContent=O.textContent,M.body.appendChild(F),O.sheet=F.sheet},k=function(O){return"((?:^|[^.#:\\w])|(?=\\W))("+O.join("|")+")(?=\\W|$)"},I=function(O,M,F){var j=k(M);_(O.querySelectorAll("style")).forEach(function(T){typeof T.sheet>"u"&&S(T);var L=_(T.sheet.cssRules).filter(function($){return $.selectorText&&new RegExp(j,"i").test($.selectorText)});L.length&&(L.forEach(function($){var q=$.selectorText.replace(new RegExp(j,"gi"),function(J,ae,ie){return ae+F(ie)});q!==$.selectorText&&b($,q)}),A(T))})};return y.rewriteCssSelectorWith=function(O,M,F){I(O,[M],function(){return F})},y.lowercaseCssTypeSelectors=function(O,M){I(O,M,function(F){return F.toLowerCase()})},y.findHtmlOnlyNodeNames=function(O){var M=O.ownerDocument.createTreeWalker(O,NodeFilter.SHOW_ELEMENT),F={},j={},T;do T=M.currentNode.tagName.toLowerCase(),M.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?F[T]=!0:j[T]=!0;while(M.nextNode());return Object.keys(F).filter(function(L){return!j[L]})},y})(),u=(function(y){var _={},x=function(E){return Array.prototype.slice.call(E)},b={active:!0,hover:!0,focus:!1,target:!1};return _.fakeUserAction=function(E,A,S){var k=E.querySelector(A),I=":"+S,O="rasterizehtml"+S;k&&(b[S]?y.addClassNameRecursively(k,O):y.addClassName(k,O),y.rewriteCssSelectorWith(E,I,"."+O))},_.persistInputValues=function(E){var A=E.querySelectorAll("input"),S=E.querySelectorAll("textarea"),k=function(I){return I.type==="checkbox"||I.type==="radio"};x(A).filter(k).forEach(function(I){I.checked?I.setAttribute("checked",""):I.removeAttribute("checked")}),x(A).filter(function(I){return!k(I)}).forEach(function(I){I.setAttribute("value",I.value)}),x(S).forEach(function(I){I.textContent=I.value})},_.rewriteTagNameSelectorsToLowerCase=function(E){y.lowercaseCssTypeSelectors(E,y.findHtmlOnlyNodeNames(E))},_})(s),h=(function(y,_,x,b){var E={},A=function(ie,Z,te,V){var B=ie.createElement(Z);return B.style.visibility="hidden",B.style.width=te+"px",B.style.height=V+"px",B.style.position="absolute",B.style.top=-1e4-V+"px",B.style.left=-1e4-te+"px",ie.getElementsByTagName("body")[0].appendChild(B),B},S=function(ie){return ie>0?new Promise(function(Z){setTimeout(Z,ie)}):Promise.resolve()};E.executeJavascript=function(ie,Z){return new Promise(function(te){var V=A(b.document,"iframe",Z.width,Z.height),B=ie.outerHTML,D=[],U=Z.executeJsTimeout||0,X=function(){b.document.getElementsByTagName("body")[0].removeChild(V)},ee=function(){var de=V.contentDocument;te({document:de,errors:D,cleanUp:X})},K=V.contentWindow.XMLHttpRequest,oe=_.finishNotifyingXhr(K),me=_.baseUrlRespectingXhr(oe,Z.baseUrl);V.onload=function(){S(U).then(oe.waitForRequestsToFinish).then(ee)},V.contentDocument.open(),V.contentWindow.XMLHttpRequest=me,V.contentWindow.onerror=function(de){D.push({resourceType:"scriptExecution",msg:de})},V.contentDocument.write("<!DOCTYPE html>"),V.contentDocument.write(B),V.contentDocument.close()})};var k=function(ie,Z,te){var V=ie.createElement("iframe");return V.style.width=Z+"px",V.style.height=te+"px",V.style.visibility="hidden",V.style.position="absolute",V.style.top=-1e4-te+"px",V.style.left=-1e4-Z+"px",V.style.borderWidth=0,V.sandbox="allow-same-origin",V.scrolling="no",V},I=function(ie,Z,te){var V=Math.floor(ie/te),B=Math.floor(Z/te);return k(b.document,V,B)},O=function(ie,Z,te,V){return{width:Math.max(ie.width*V,Z),height:Math.max(ie.height*V,te)}},M=function(ie,Z){var te=ie.querySelector(Z);if(te)return te;if(ie.ownerDocument.querySelector(Z)===ie)return ie;throw{message:"Clipping selector not found"}},F=function(ie,Z,te,V,B){var D=Math.max(ie.scrollWidth,ie.clientWidth),U=Math.max(ie.scrollHeight,ie.clientHeight),X,ee,K,oe,me,de,ye,Re;return Z?(de=M(ie,Z),ye=de.getBoundingClientRect(),X=ye.top,ee=ye.left,K=ye.width,oe=ye.height):(X=0,ee=0,K=D,oe=U),Re=O({width:K,height:oe},te,V,B),me=b.getComputedStyle(ie.ownerDocument.documentElement).fontSize,{left:ee,top:X,width:Re.width,height:Re.height,viewportWidth:D,viewportHeight:U,rootFontSize:me}},j=function(ie,Z){var te=ie.tagName;return Z.querySelector(te)},T=function(ie){var Z=ie.tagName.toLowerCase();return Z==="html"||Z==="body"?ie.outerHTML:'<body style="margin: 0;">'+ie.outerHTML+"</body>"};E.calculateDocumentContentSize=function(ie,Z){return new Promise(function(te,V){var B=Z.zoom||1,D;D=I(Z.width,Z.height,B),b.document.getElementsByTagName("body")[0].appendChild(D),D.onload=function(){var U=D.contentDocument,X;try{X=F(j(ie,U),Z.clip,Z.width,Z.height,B),te(X)}catch(ee){V(ee)}finally{b.document.getElementsByTagName("body")[0].removeChild(D)}},D.contentDocument.open(),D.contentDocument.write("<!DOCTYPE html>"),D.contentDocument.write(T(ie)),D.contentDocument.close()})},E.parseHtmlFragment=function(ie){var Z=b.document.implementation.createHTMLDocument("");Z.documentElement.innerHTML=ie;var te=Z.querySelector("body").firstChild;if(!te)throw"Invalid source";return te};var L=function(ie,Z){var te=/<html((?:\s+[^>]*)?)>/im.exec(Z),V=b.document.implementation.createHTMLDocument(""),B,D,U,X;if(te)for(B="<div"+te[1]+"></div>",V.documentElement.innerHTML=B,U=V.querySelector("div"),D=0;D<U.attributes.length;D++)X=U.attributes[D],ie.documentElement.setAttribute(X.name,X.value)};E.parseHTML=function(ie){var Z=b.document.implementation.createHTMLDocument("");return Z.documentElement.innerHTML=ie,L(Z,ie),Z};var $=function(ie){try{return x.failOnParseError(ie)}catch(Z){throw{message:"Invalid source",originalError:Z}}};E.validateXHTML=function(ie){var Z=new DOMParser,te=Z.parseFromString(ie,"application/xml");$(te)};var q=null,J=function(ie,Z){return Z==="none"||Z==="repeated"?((q===null||Z!=="repeated")&&(q=Date.now()),ie+"?_="+q):ie},ae=function(ie,Z){return new Promise(function(te,V){var B=new window.XMLHttpRequest,D=y.joinUrl(Z.baseUrl,ie),U=J(D,Z.cache),X=function(ee){V({message:"Unable to load page",originalError:ee})};B.addEventListener("load",function(){B.status===200||B.status===0?te(B.responseXML):X(B.statusText)},!1),B.addEventListener("error",function(ee){X(ee)},!1);try{B.open("GET",U,!0),B.responseType="document",B.send(null)}catch(ee){X(ee)}})};return E.loadDocument=function(ie,Z){return ae(ie,Z).then(function(te){return $(te)})},E})(a,o,r,window),f=(function(y){var _={},x=function(j,T){return T?URL.createObjectURL(new Blob([j],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(j)},b=function(j){j instanceof Blob&&URL.revokeObjectURL(j)},E='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',A=function(j){return new Promise(function(T,L){var $=document.createElement("canvas"),q=new Image;q.onload=function(){var J=$.getContext("2d");try{J.drawImage(q,0,0),$.toDataURL("image/png"),T(!0)}catch{T(!1)}},q.onerror=L,q.src=j})},S=function(){var j=x(E,!0);return A(j).then(function(T){return b(j),T?!1:A(x(E,!1)).then(function(L){return L})},function(){return!1})},k=function(){if(y.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch{}return!1},I=function(){return new Promise(function(j,T){k()&&y.URL?S().then(function(L){j(!L)},function(){T()}):j(!1)})},O,M=function(){return O===void 0&&(O=I()),O},F=function(j){return M().then(function(T){return x(j,T)})};return _.renderSvg=function(j){return new Promise(function(T,L){var $,q,J=function(){q.onload=null,q.onerror=null},ae=function(){$&&b($)};q=new Image,q.onload=function(){J(),ae(),T(q)},q.onerror=function(){ae(),L()},F(j).then(function(ie){$=ie,q.src=$},L)})},_})(window),g=(function(y,_,x,b){var E={},A=function(j,T){var L=T||1,$={width:j.width,height:j.height,"font-size":j.rootFontSize};return L!==1&&($.style="transform:scale("+L+"); transform-origin: 0 0;"),$},S=function(j){var T,L,$,q;T=Math.round(j.viewportWidth),L=Math.round(j.viewportHeight),$=-j.left,q=-j.top;var J={x:$,y:q,width:T,height:L};return J},k=function(j){var T=j.style||"";j.style=T+"float: left;"},I=function(j){j.externalResourcesRequired=!0},O=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},M=function(j){var T=Object.keys(j);return T.length?" "+T.map(function(L){return L+'="'+j[L]+'"'}).join(" "):""},F=function(j,T,L){var $=b.serializeToString(j);_.validateXHTML($);var q=S(T);return k(q),I(q),'<svg xmlns="http://www.w3.org/2000/svg"'+M(A(T,L))+">"+O()+"<foreignObject"+M(q)+">"+$+"</foreignObject></svg>"};return E.getSvgForDocument=function(j,T,L){return x.rewriteTagNameSelectorsToLowerCase(j),F(j,T,L)},E.drawDocumentAsSvg=function(j,T){return["hover","active","focus","target"].forEach(function(L){T[L]&&x.fakeUserAction(j,T[L],L)}),_.calculateDocumentContentSize(j,T).then(function(L){return E.getSvgForDocument(j,L,T.zoom)})},E})(a,h,u,n),v=(function(y,_,x,b,E,A){var S={},k=function(j){return{message:"Error rendering page",originalError:j}},I=function(j){return E.renderSvg(j).then(function(T){return{image:T,svg:j}},function(T){throw k(T)})},O=function(j,T){try{T.getContext("2d").drawImage(j,0,0)}catch(L){throw k(L)}},M=function(j,T,L){return b.drawDocumentAsSvg(j,L).then(I).then(function($){return T&&O($.image,T),$})},F=function(j,T){return _.executeJavascript(j,T).then(function(L){var $=L.document;return x.persistInputValues($),{document:$,errors:L.errors,cleanUp:L.cleanUp}})};return S.rasterize=function(j,T,L){var $;return $=y.clone(L),$.inlineScripts=L.executeJs===!0,A.inlineReferences(j,$).then(function(q){return L.executeJs?F(j,L).then(function(J){return{element:J.document.documentElement,errors:q.concat(J.errors),cleanUp:J.cleanUp}}):{element:j,errors:q,cleanUp:function(){}}}).then(function(q){return M(q.element,T,L).then(function(J){return q.cleanUp(),{image:J.image,svg:J.svg,errors:q.errors}})})},S})(a,h,u,g,f,i),p=(function(y,_,x){var b={},E=function(O,M){var F=300,j=200,T=O?O.width:F,L=O?O.height:j,$=M.width!==void 0?M.width:T,q=M.height!==void 0?M.height:L;return{width:$,height:q}},A=function(O){var M=E(O.canvas,O.options),F;return F=y.clone(O.options),F.width=M.width,F.height=M.height,F};b.drawDocument=function(){var O=arguments[0],M=Array.prototype.slice.call(arguments,1),F=y.parseOptionalParameters(M),j=O.documentElement?O.documentElement:O;return x.rasterize(j,F.canvas,A(F))};var S=function(O,M,F){var j=_.parseHTML(O);return b.drawDocument(j,M,F)};b.drawHTML=function(){var O=arguments[0],M=Array.prototype.slice.call(arguments,1),F=y.parseOptionalParameters(M);return S(O,F.canvas,F.options)};var k=function(O,M,F){var j=document.implementation.createHTMLDocument("");j.replaceChild(O.documentElement,j.documentElement);var T=F?y.clone(F):{};return F.baseUrl||(T.baseUrl=M),{document:j,options:T}},I=function(O,M,F){return _.loadDocument(O,F).then(function(j){var T=k(j,O,F);return b.drawDocument(T.document,M,T.options)})};return b.drawURL=function(){var O=arguments[0],M=Array.prototype.slice.call(arguments,1),F=y.parseOptionalParameters(M);return I(O,F.canvas,F.options)},b})(a,h,v);return p})})(K1)),K1.exports}var uN=lN();function cN(t,e){if(!t.includes("@font-face"))return"";const n=new Set,r=new Set;e&&((e.match(/font-weight:\s*(\d+|bold|normal)/gi)||[]).forEach(h=>{const f=h.split(":")[1].trim();f==="bold"?n.add("700"):f==="normal"?n.add("400"):/^\d+$/.test(f)&&n.add(f)}),(e.match(/font-style:\s*(italic|normal)/gi)||[]).forEach(h=>{h.split(":")[1].trim().toLowerCase()==="italic"&&r.add("italic")}),/<(b|strong)\b/i.test(e)&&n.add("700"),/<(i|em)\b/i.test(e)&&r.add("italic"));const i=rs(e);i&&i.trim()&&n.add("400"),n.size===0&&n.add("400");const a=n,o=r.has("italic"),s=Array.from(new Set(i)).map(h=>h.codePointAt(0)).filter(h=>h!==void 0),u=t.split(/}\s*/).map(h=>h&&h+"}").filter(h=>/@font-face/.test(h)&&(f=>{const g=(f.match(/font-weight:\s*(\d+)/)||[])[1];if(g&&!a.has(g)||/font-style:\s*italic/.test(f)&&!o)return!1;const v=f.match(/unicode-range:\s*([^;]+);/);if(!v)return!0;const p=v[1].split(",").map(y=>{const[_,x=_]=y.replace("U+","").split("-").map(b=>parseInt(b,16));return[_,x]});return s.some(y=>p.some(([_,x])=>y>=_&&y<=x))})(h)).join(`
164
+ `);return u?`<style>${u}</style>`:""}const Z0=`
165
+ p {
166
+ margin: 0;
167
+ padding: 0;
168
+ word-wrap: break-word; /* Required for Firefox */
169
+ /* a text may have several spaces, we need to preserve them */
170
+ white-space: pre-wrap;
171
+ }
172
+
173
+ /* Reset default list styles and setup counters */
174
+ ul, ol {
175
+ list-style: none; /* Remove default markers */
176
+ padding-inline-start: 0; /* Reset padding */
177
+ margin: 0;
178
+ display: block; /* Use block instead of inline-block for better text wrapping */
179
+ width: 100%;
180
+ text-decoration: inherit;
181
+ counter-reset: ol-counter; /* Initialize counter for ol */
182
+ }
183
+
184
+ li {
185
+ position: relative; /* Needed for absolute positioning of ::before */
186
+ padding-inline-start: 2.1em; /* Space for the marker (start side) */
187
+ margin: 0; /* Reset default li margins */
188
+ word-wrap: break-word; /* Required for Firefox text wrapping */
189
+ white-space: pre-wrap; /* Preserve spaces and allow wrapping */
190
+ }
191
+
192
+ li::before {
193
+ content: ''; /* Base content */
194
+ position: absolute;
195
+ /* Use logical properties for positioning */
196
+ inset-inline-start: 0; /* Position marker at the start edge (left in LTR, right in RTL) */
197
+ top: 0; /* Adjust vertical alignment */
198
+ /* Prevent letter-spacing from affecting the marker */
199
+ letter-spacing: normal;
200
+ /* Define width to ensure consistent spacing and alignment */
201
+ display: inline-block;
202
+ width: 2em; /* Width for the marker container */
203
+ /* Align multi-digit numbers to the end (right in LTR, left in RTL) */
204
+ text-align: end;
205
+ /* Space between marker and text (using logical property) */
206
+ margin-inline-end: 0.8em; /* Pushes text away from marker (2.5em total = 1.7em width + 0.8em margin)*/
207
+ /* Prevent marker style from inheriting list item styles */
208
+ font-weight: normal;
209
+ font-style: normal;
210
+ }
211
+
212
+ /* Style for bullet points */
213
+ ul > li::before {
214
+ content: '•'; /* Literal bullet character */
215
+ /* Center the bullet within its allocated width */
216
+ text-align: center; /* Override text-align: end for bullets */
217
+ font-size: 1.2em;
218
+ top: 0em; /* Re-adjust vertical alignment for bullet */
219
+ /* Bullets don't need number alignment, width can be tighter */
220
+ width: 2em;
221
+ /* Adjust margin to maintain overall padding */
222
+ margin-inline-end: 1.5em; /* 2.5em total padding = 1em width + 1.5em margin */
223
+ }
224
+
225
+ /* Style for numbers using counter */
226
+ ol > li {
227
+ counter-increment: ol-counter; /* Increment counter for each li in ol */
228
+ }
229
+
230
+ ol > li::before {
231
+ content: counter(ol-counter) "."; /* Display counter value + dot */
232
+ }
233
+
234
+ .ql-indent-1 {
235
+ margin-inline-start: 0.5em;
236
+ }
237
+ .ql-indent-2 {
238
+ margin-inline-start: 1em;
239
+ }
240
+ .ql-indent-3 {
241
+ margin-inline-start: 1.5em;
242
+ }
243
+ `,fN=`
244
+ <style>
245
+ html, body {
246
+ padding: 0;
247
+ margin: 0;
248
+ }
249
+ ${Z0}
250
+ </style>
251
+ `;let rf;const H7=()=>(rf||(rf=document.createElement("div"),rf.id="polotno-hidden-do-not-touch",rf.style.overflow="hidden",rf.style.position="relative",document.body.appendChild(rf),rf.innerHTML=`<style>#polotno-hidden-do-not-touch {${Z0}}</style>`),rf);navigator.userAgent.includes("Firefox");function hN({html:t}){const e=document.createElement("div");e.innerHTML=t,e.style.display="inline-block",e.style.position="fixed",e.style.top="0px",e.style.left="0px",e.style.zIndex="1000",e.style.whiteSpace="nowrap",e.style.visibility="hidden";const n=H7();n.appendChild(e);const r=e.innerText,i=e.childNodes[0];i.style.whiteSpace="nowrap";const a=r?.split(/\s+/)||[];let o=!1;for(let s=0;s<a.length;s++){const u=a[s];if(i&&(i.textContent=u,o=i.scrollWidth>e.clientWidth,o))break}return n.removeChild(e),o}function t4(t){const e=document.createElement("div");e.innerHTML=t,e.style.display="inline-block",e.style.position="fixed",e.style.top="0px",e.style.left="0px",e.style.zIndex="1000";const n=H7();n.appendChild(e);const r=e.getBoundingClientRect();return n.removeChild(e),{width:r.width,height:r.height}}const dN={},cv={},fv=new Map;async function n4({html:t,width:e,height:n,fontFamily:r,padding:i,font:a,pixelRatio:o}){let s="";if(r!=="Arial"&&!a){const y=iO();s=await(async function(_,x){const b=`${_}|${x}`;if(fv.has(b))return fv.get(b);const E=`https://fonts.googleapis.com/css?family=${_}:${x}&display=swap`,A=await(await fetch(E)).text();return fv.set(b,A),A})(r,y)}if(a){const y=a.styles||(a.url?[{src:`url("${a.url}")`}]:(_=>{if(cv[_])return cv[_];const x=(function(E){const A=[];for(let S=0;S<document.styleSheets.length;S++){const k=document.styleSheets[S];try{const I=k.cssRules;if(I)for(let O=0;O<I.length;O++){const M=I[O];M instanceof CSSFontFaceRule&&M.style.fontFamily.replace(/['"]/g,"")===E&&A.push(M)}}catch(I){console.warn(`Could not access stylesheet: ${k.href}`,I)}}return A})(_),b=x.filter(E=>E.style.fontFamily.replace(/['"]/g,"")===_).map(E=>({src:E.style.getPropertyValue("src"),fontStyle:E.style.getPropertyValue("font-style")||"normal",fontWeight:E.style.getPropertyValue("font-weight")||"normal"}));return cv[_]=b,b})(r));s="",y.forEach(_=>{s+=`
252
+ @font-face {
253
+ font-family: '${r}';
254
+ src: ${_.src};
255
+ font-style: ${_.fontStyle||"normal"};
256
+ font-weight: ${_.fontWeight||"normal"};
257
+ }
258
+ `})}let u="";s&&(u=cN(s,t)),t+=u+fN;const h=e+2*i,f=n+2*i,g=document.createElement("canvas"),v=await uN.drawHTML(`<div style="padding: ${i}px;" dir="auto">${t}</div>`,g,{width:h,height:f,cacheBucket:dN});fy(g,h*o,f*o);const p=g.getContext("2d");return p?.drawImage(v.image,0,0,h,f,0,0,g.width,g.height),g}let pN={data:""},gN=t=>typeof window=="object"?((t?t.querySelector("#_goober"):window._goober)||Object.assign((t||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:t||pN,vN=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,mN=/\/\*[^]*?\*\/|\s\s+|\n/g,ff=(t,e)=>{let n="",r="",i="";for(let a in t){let o=t[a];a[0]=="@"?a[1]=="i"?n=a+" "+o+";":r+=a[1]=="f"?ff(o,a):a+"{"+ff(o,a[1]=="k"?"":e)+"}":typeof o=="object"?r+=ff(o,e?e.replace(/([^,])+/g,s=>a.replace(/(^:.*)|([^,])+/g,u=>/&/.test(u)?u.replace(/&/g,s):s?s+" "+u:u)):a):o!=null&&(a=a.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=ff.p?ff.p(a,o):a+":"+o+";")}return n+(e&&i?e+"{"+i+"}":i)+r},zd={},$7=t=>{if(typeof t=="object"){let e="";for(let n in t)e+=n+$7(t[n]);return e}return t},yN=(t,e,n,r,i)=>{let a=$7(t),o=zd[a]||(zd[a]=(s=>{let u=0,h=11;for(;u<s.length;)h=101*h+s.charCodeAt(u++)>>>0;return"go"+h})(a));if(!zd[o]){let s=a!==t?t:(u=>{let h,f=[{}];for(;h=vN.exec(u.replace(mN,""));)h[4]?f.shift():h[3]?f.unshift(f[0][h[3]]=f[0][h[3]]||{}):f[0][h[1]]=h[2];return f[0]})(t);zd[o]=ff(i?{["@keyframes "+o]:s}:s,n?"":"."+o)}return((s,u,h)=>{u.data.indexOf(s)==-1&&(u.data=h?s+u.data:u.data+s)})(zd[o],e,r),o};function vy(t){let e=this||{},n=t.call?t(e.p):t;return yN(n.unshift?n.raw?((r,i,a)=>r.reduce((o,s,u)=>{let h=i[u];if(h&&h.call){let f=h(a),g=f&&f.props&&f.props.className||/^go/.test(f)&&f;h=g?"."+g:f&&typeof f=="object"?f.props?"":ff(f,""):f===!1?"":f}return o+s+(h??"")},""))(n,[].slice.call(arguments,1),e.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(e.p):i),{}):n,gN(e.target),e.g,e.o,e.k)}let G7,wm,_m;vy.bind({g:1});vy.bind({k:1});function bN(t,e,n,r){ff.p=e,G7=t,wm=n,_m=r}function Ed(t,e){let n=this||{};return function(){let r=arguments;function i(a,o){let s=Object.assign({},a),u=s.className||i.className;n.p=Object.assign({theme:wm&&wm()},s),n.o=/ *go\d+/.test(u),s.className=vy.apply(n,r)+(u?" "+u:""),e&&(s.ref=o);let h=t;return t[0]&&(h=s.as||t,delete s.as),_m&&h[0]&&_m(s),G7(h,s)}return e?e(i):i}}bN(se.createElement);function r4(t){const e=(t||"").trim();if(e==="<p><br></p>"||e==="<p></p>")return"";if(e.startsWith("<p>")&&e.endsWith("</p>")){const n=e.slice(3,-4);if(!/(<\/?(p|div|h[1-6]|ul|ol|li|table|thead|tbody|tr|td|blockquote)\b)/i.test(n))return n}return t}const Yf=Kn({enabled:!1,currentFormat:{},editor:Kn.object({instance:null},{},{deep:!1})}),W7=Ed("div",se.forwardRef)`
259
+ .ql-editor {
260
+ outline: none;
261
+ }
262
+ .ql-clipboard {
263
+ pointer-events: none;
264
+ }
265
+ ${Z0}
266
+ strong {
267
+ font-weight: 700;
268
+ }
269
+ .ql-direction-rtl {
270
+ direction: rtl;
271
+ }
272
+ `;let wN=["bold","color","font","italic","size","strike","underline","indent","list","direction"];const i4=(t,e)=>{var n=t.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+e+"<p><br></p></div>");t.setContents(n),t.history.clear()},_N=({html:t,onBlur:e,onChange:n,element:r,clickCoords:i})=>{const a=se.useRef(null);se.useEffect(()=>{if(!a.current)return;const u=(h=a.current,new T7(h,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:wN}));var h;return pc(()=>{Yf.editor.instance=u}),window.__polotnoQuill=u,u.on("text-change",()=>{u.getSelection()&&pc(()=>{Yf.currentFormat=u.getFormat(u.getSelection())}),setTimeout(()=>{var f;const g=(f=a.current)===null||f===void 0?void 0:f.childNodes[0];if(!g)return;const v=g.innerHTML;n(r4(v))},10)}),i4(u,t),i?EN(u,i):u.setSelection(0,0,"api"),u.on("selection-change",(f,g,v)=>{f&&pc(()=>{Yf.currentFormat=u.getFormat(u.getSelection())})}),a.current.childNodes[0].addEventListener("blur",f=>{var g;if(!((g=f.relatedTarget)===null||g===void 0)&&g.classList.contains("ql-clipboard"))return;(function(p){return!!p&&!!p.closest(".sketch-picker")})(f.relatedTarget)||e()}),()=>{pc(()=>{Yf.editor.instance=null,Yf.currentFormat={}}),delete window.__polotnoQuill}},[]),se.useEffect(()=>L6(()=>r.text,()=>{var u;const h=Yf.editor.instance;if(!h)return;const f=h.getSelection();r4((u=a.current)===null||u===void 0?void 0:u.childNodes[0].innerHTML)===r.text||(i4(h,t),f&&(h.setSelection(f.index,f.length),pc(()=>{Yf.currentFormat=h.getFormat(h.getSelection())})))},{fireImmediately:!0}),[]),se.useEffect(()=>{window.addEventListener("blur",e);const u=h=>{var f;!((f=a.current)===null||f===void 0)&&f.contains(h.target)||e()};return window.addEventListener("touchstart",u),()=>{window.removeEventListener("blur",e),window.removeEventListener("touchstart",u)}},[]);const o={color:r.fill};r.fill.indexOf("gradient")>=0&&(o.backgroundColor=r.fill,o.backgroundImage=r.fill,o.backgroundSize="100% 100%",o.backgroundRepeat="repeat",o.webkitBackgroundClip="text",o.MozBackgroundClip="text",o.WebkitTextFillColor="transparent",o.MozTextFillColor="transparent");const s=k7(r);return se.createElement(W7,{ref:a,style:Object.assign(Object.assign({},o),{fontSize:r.fontSize,fontWeight:r.fontWeight,textTransform:r.textTransform,width:r.a.width,fontFamily:'"'+r.fontFamily+'"',lineHeight:r.lineHeight,letterSpacing:r.letterSpacing*r.fontSize+"px",textAlign:r.align,opacity:Math.max(r.a.opacity,.2),textShadow:r.shadowEnabled?`${r.shadowOffsetX}px ${r.shadowOffsetY}px ${r.shadowBlur}px ${r.shadowColor}`:void 0,caretColor:s}),dir:V0(rs(r.text))})};function xN(t){return!(function(e){const n=e.getContext("2d").getImageData(0,0,e.width,e.height).data;for(let r=0;r<n.length;r+=4)if(n[r+3]!==0)return!0;return!1})(t)}function a4(t,{fontFamily:e="",color:n="black"}={}){let r=`color: ${n||t.fill}`;t.fill.indexOf("gradient")>=0&&(r=`
273
+ background-color: ${n};
274
+ background-image: ${t.fill};
275
+ background-size: 100% 100%;
276
+ background-repeat: repeat;
277
+ -webkit-background-clip: text;
278
+ -moz-background-clip: text;
279
+ -webkit-text-fill-color: transparent;
280
+ -moz-text-fill-color: transparent;
281
+ `);const i=["white-space: pre-wrap","word-break: break-word",`width: ${Math.round(t.width||100)}px`,r,`font-size: ${t.fontSize}px`,`font-family: '${e}'`,`text-align: ${t.align}`,`text-transform: ${t.textTransform}`,t.textDecoration?`text-decoration: ${t.textDecoration}; text-decoration-color: ${n||t.fill}; text-decoration-layer: over`:"",t.lineHeight?`line-height: ${t.lineHeight}`:"",t.letterSpacing?`letter-spacing: ${t.letterSpacing*t.fontSize}px`:"",t.fontStyle?`font-style: ${t.fontStyle}`:"",t.fontWeight?`font-weight: ${t.fontWeight}`:"",t.strokeWidth?`-webkit-text-stroke: ${t.strokeWidth}px ${t.stroke}`:"",t.strokeWidth?"paint-order: stroke fill":""].filter(Boolean).join("; ");if(t.curveEnabled){const a=(function(s){const u=s.a?s.a:s,h=new sn.TextPath({data:fh(u.width,u.height,s.curvePower,u.fontSize),align:"center",textBaseline:"middle",text:rs(s.text),fontSize:u.fontSize,fontFamily:s.fontFamily,fontWeight:s.fontWeight,fontStyle:s.fontStyle,letterSpacing:s.letterSpacing*u.fontSize,fill:s.fill}),f=h.getSelfRect().height;return h.destroy(),f})(t),o=Math.round(t.width||100);return`
282
+ <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${a}">
283
+ <defs><path id="curve" d="${fh(o,a,t.curvePower,t.fontSize)}" fill="none" /></defs>
284
+ <text
285
+ font-family="'${e}'"
286
+ font-size="${t.fontSize}"
287
+ font-weight="${t.fontWeight}"
288
+ font-style="${t.fontStyle}"
289
+ fill="${n}"
290
+ text-anchor="middle"
291
+ dominant-baseline="central"${t.strokeWidth?` stroke="${t.stroke}" stroke-width="${t.strokeWidth}" paint-order="stroke fill"`:""}>
292
+ <textPath href="#curve" startOffset="50%">
293
+ ${rs(t.text).replace(/\\n/g," ")}
294
+ </textPath>
295
+ </text>
296
+ </svg>`}return`<div style="${i}" contentEditable dir="${V0(rs(t.text))}">${cO(t.text).replace(/\n/g,"</br>")}</div>`}const o4=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),SN=ri(({element:t,store:e})=>{const n=se.useRef(null),[r,i]=se.useState(),[a,o]=se.useState(!1),[s,u]=se.useState(!1),h=se.useRef(t.height),f=e.selectedShapes.indexOf(t)>=0&&t.selectable,g=t.fontSize/3,{textVerticalResizeEnabled:v}=Si,p=O7(t.fontFamily),[y]=A7(e,t.fontFamily),_=t._editModeEnabled;Mp(n);const x=y?t.fontFamily:p!==t.fontFamily?p:"Arial",b=wf(t).fill,E=a4(t,{fontFamily:x,color:b});let{width:A,height:S}=(function(te,V,B){return se.useMemo(()=>t4(te),[te,V.width,B])})(E,t,y);se.useEffect(()=>{if(!y)return;if(!t.height)return void e.history.ignore(()=>{t.set({height:S})});const{textOverflow:te}=Si;if(te!=="change-font-size"||a)te==="resize"&&(v&&t.height<S&&!a&&e.history.ignore(()=>{t.set({height:S})}),v||t.height===S||e.history.ignore(()=>{t.set({height:S})}));else{const V=(B=>{let D=B.fontSize;for(let U=1;U<50;U++){const X=a4(Object.assign(Object.assign({},B.toJSON()),{fontSize:D}),{fontFamily:B.fontFamily}),{height:ee}=t4(X);if(!(B.height&&ee>B.height||!Si.textSplitAllowed&&!B.curveEnabled&&hN({html:X})))break;D-=.5}return D})(t);V!==t.fontSize?e.history.ignore(()=>{t.set({fontSize:V})}):t.height!==S&&(v&&t.height<S?e.history.ignore(()=>{t.set({height:S})}):v||e.history.ignore(()=>{t.set({height:S})}))}});const k=se.useMemo(()=>{const te={lastArgs:null,lastResult:null};return async function(V){return te.lastArgs&&te.lastResult&&(B=te.lastArgs,D=V,JSON.stringify(B)===JSON.stringify(D))||(te.lastResult=await n4(V),te.lastArgs=Object.assign({},V)),te.lastResult;var B,D}},[]),I=se.useRef(0),O=se.useRef(null);se.useEffect(()=>{a||_||(async()=>{I.current++;const te=I.current;let V=uh(`text ${t.id} ${te}`);O.current&&O.current(),O.current=V,u(!0);let B=null;const D=o4?5:1;for(let U=0;U<D;U++){const X=U>0?k:n4;try{if(B=await X({skipCache:U>0,html:E,width:t.width||1,height:t.height||S||1,fontFamily:x,padding:g,pixelRatio:e._elementsPixelRatio,font:e.fonts.find(ee=>ee.fontFamily===x)||iy.find(ee=>ee.fontFamily===x)}),te!==I.current)return;if(o4&&xN(B)){await new Promise(ee=>setTimeout(ee,50*(U+1)));continue}break}catch(ee){console.error(ee),Ip(`Error rendering rich text with id ${t.id}`);break}}B?i(B):V?(V(),V=null):console.error("Finish function is called twice!"),u(!1)})()},[E,a,S,_,x,t.height,e._elementsPixelRatio,y]);const[M,F]=bm(s,300),[j]=bm(a,300,!0),T=j||M;se.useEffect(()=>{var te;if(!T)return zu(()=>{const V=n.current;Ms(V,t)});(te=n.current)===null||te===void 0||te.clearCache()},[r,T,t.shadowColor,t.shadowOffsetX,t.shadowOffsetY,t.shadowOpacity]),se.useEffect(()=>{r&&!s&&O.current&&(O.current(),O.current=null)},[r,s]),se.useLayoutEffect(()=>{if(!y||!t.curveEnabled)return;const te=new sn.TextPath({data:fh(t.a.width,t.a.height,t.curvePower,t.a.fontSize),text:rs(t.text),letterSpacing:t.letterSpacing*t.a.fontSize,fontSize:t.a.fontSize,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontStyle:t.fontStyle,align:"center",textBaseline:"middle",fill:t.fill}),V=te.getSelfRect().width;if(V){const B=V-t.a.width,D=t.a.rotation*Math.PI/180,U=-B/2*Math.cos(D),X=-B/2*Math.sin(D);t.set({width:V,x:t.a.x+U,y:t.a.y+X})}te.destroy()},[y,t.curveEnabled,t.curvePower,t.text,t.fontSize,t.fontFamily,t.fontWeight,t.fontStyle,t.letterSpacing]),se.useEffect(()=>()=>{O.current&&O.current()},[]),se.useEffect(()=>{f||rs(t.text)!==""||!t.removable||t.placeholder||e.deleteElements([t.id])},[f]);let L=0;t.verticalAlign==="middle"&&(L=(t.height-S)/2),t.verticalAlign==="bottom"&&(L=t.height-S);const $=P7({fontLoaded:y,fontFamily:t.fontFamily,fontSize:t.fontSize,lineHeight:t.lineHeight}),q=Lf(),J=fh(t.a.width,S,t.curvePower,t.fontSize),ae=se.useRef(null),ie=se.useRef(null),Z=_&&t.strokeWidth>0&&!t.curveEnabled;return se.createElement(se.Fragment,null,se.createElement(Tr,{x:t.a.x,y:t.a.y,offsetX:t.backgroundPadding*(t.fontSize*$*.5),offsetY:t.backgroundPadding*(t.fontSize*$*.5),rotation:t.a.rotation,hideInExport:!t.showInExport,listening:!1,visible:t.backgroundEnabled,opacity:t.backgroundOpacity*t.a.opacity,fill:t.backgroundColor,width:t.a.width+t.backgroundPadding*(t.fontSize*$),height:t.a.height+t.backgroundPadding*(t.fontSize*$),cornerRadius:t.backgroundCornerRadius*(t.fontSize*$*.5)}),se.createElement(yp,{x:t.a.x,y:t.a.y,rotation:t.a.rotation,data:J,stroke:"red",strokeWidth:1,visible:!1}),se.createElement(Tr,{ref:n,name:"element",x:t.a.x,y:t.a.y,listening:t.selectable,rotation:t.a.rotation,width:t.a.width,height:t.a.height,visible:!T,draggable:q?t.draggable&&f:t.draggable,preventDefault:!q||f,opacity:_?0:t.a.opacity,hideInExport:!t.showInExport,onDragMove:te=>{t.set({x:te.target.x(),y:te.target.y()})},onDragEnd:te=>{t.set({x:te.target.x(),y:te.target.y()})},id:t.id,onDblClick:te=>{t.contentEditable&&(ie.current={x:te.evt.clientX,y:te.evt.clientY},t.toggleEditMode(!0))},onDblTap:te=>{var V;if(t.contentEditable){const B=(V=te.evt.changedTouches)===null||V===void 0?void 0:V[0];ie.current=B?{x:B.clientX,y:B.clientY}:null,t.toggleEditMode(!0)}},onTransformStart:te=>{o(!0),h.current=t.height},onTransform:te=>{var V;const B=te.target,D=((V=B.getStage())===null||V===void 0?void 0:V.findOne("Transformer")).getActiveAnchor(),U=D==="middle-left"||D==="middle-right",X=D==="top-center"||D==="bottom-center",ee=B.scaleX();if(U){const K=B.scaleX(),oe=B.width()*K,me=t.fontSize;let de=oe;if(oe<me&&(de=me,ae.current&&B.position(ae.current)),B.width(de),B.scaleX(1),Si.textVerticalResizeEnabled){const ye=Math.max(S,h.current);t.set({height:ye})}t.set({width:B.width(),x:B.x(),y:B.y()})}else if(X){let K=Si.textOverflow==="resize"?S:t.lineHeight*t.fontSize;const oe=Math.max(K,te.target.height()*te.target.scaleY());B.scaleY(1),t.set({x:B.x(),y:B.y(),height:oe,rotation:B.rotation()})}else B.scaleX(1),B.scaleY(1),t.set({fontSize:t.fontSize*ee,letterSpacing:t.letterSpacing,width:B.width()*ee,x:B.x(),y:B.y(),rotation:B.rotation(),height:B.height()*ee});ae.current=te.target.position()},onTransformEnd:te=>{o(!1),u(!0);const V=te.target.scaleX();te.target.scaleX(1),te.target.scaleY(1),t.set({fontSize:t.fontSize*V,width:te.target.width()*V,x:te.target.x(),y:te.target.y(),rotation:te.target.rotation(),shadowBlur:t.shadowBlur*V,shadowOffsetX:t.shadowOffsetX*V,shadowOffsetY:t.shadowOffsetY*V,strokeWidth:t.strokeWidth*V})}}),se.createElement(Tu,{ref:n,image:r,x:t.a.x,y:t.a.y,offsetX:g,offsetY:g-L,listening:!1,rotation:t.a.rotation,width:t.a.width+2*g,height:(t.a.width+2*g)*(r?.height/r?.width||1),visible:!T&&!_,opacity:t.a.opacity,shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur,shadowOffsetX:t.shadowOffsetX,shadowOffsetY:t.shadowOffsetY,shadowColor:t.shadowColor,shadowOpacity:t.shadowOpacity,hideInExport:!t.showInExport,editModeEnabled:t._editModeEnabled||a||T}),(T||Z)&&se.createElement(br,{x:t.a.x,y:t.a.y,rotation:t.a.rotation,offsetY:-L},se.createElement(y0,{divProps:{style:{pointerEvents:"none"}}},se.createElement(W7,{dangerouslySetInnerHTML:{__html:E},style:{pointerEvents:"none",opacity:t.a.opacity,textShadow:t.shadowEnabled?`${t.shadowOffsetX}px ${t.shadowOffsetY}px ${t.shadowBlur}px ${t.shadowColor}`:void 0}}))),_&&se.createElement(br,{x:t.a.x,y:t.a.y,rotation:t.a.rotation,offsetY:-L},se.createElement(y0,null,se.createElement(_N,{html:E,element:t,onChange:te=>{const V=E7({oldText:rs(t.text),newText:rs(te),element:t});t.set({text:te,fontSize:V})},onBlur:te=>{t.toggleEditMode(!1),F(!0)},clickCoords:ie.current}))))});function EN(t,e){if(!t||!e)return;const{x:n,y:r}=e;try{let i=null;if(document.caretRangeFromPoint)i=document.caretRangeFromPoint(n,r);else if(document.caretPositionFromPoint){const a=document.caretPositionFromPoint(n,r);a&&(i=document.createRange(),i.setStart(a.offsetNode,a.offset))}if(i){const a=T7.find(i.startContainer,!0);if(a){const o=a.offset(t.scroll)+i.startOffset;return void t.setSelection(o,0,"api")}}}catch{}t.setSelection(0,0,"api")}function my(t){return t/180*Math.PI}function T1(t,e,n,r,i){const a=Math.sqrt(n*n+r*r);return i+=Math.atan2(r,n),{x:t+a*Math.cos(i),y:e+a*Math.sin(i)}}function kd(t){const{x:e,y:n,width:r,height:i}=t,a=my(t.rotation),o=T1(e,n,0,0,a),s=T1(e,n,r,0,a),u=T1(e,n,r,i,a),h=T1(e,n,0,i,a),f=Math.min(o.x,s.x,u.x,h.x),g=Math.min(o.y,s.y,u.y,h.y),v=Math.max(o.x,s.x,u.x,h.x),p=Math.max(o.y,s.y,u.y,h.y);return{x:f,y:g,width:v-f,height:p-g,minX:f,minY:g,maxX:v,maxY:p}}function Q0(t){const e=t.map(o=>kd(o)),n=Math.min(...e.map(o=>o.minX)),r=Math.min(...e.map(o=>o.minY)),i=Math.max(...e.map(o=>o.maxX)),a=Math.max(...e.map(o=>o.maxY));return{x:n,y:r,width:i-n,height:a-r,minX:n,minY:r,maxX:i,maxY:a}}function kN(t){const e=my(t.rotation||0);return{x:t.x+t.width/2*Math.cos(e)+t.height/2*Math.sin(-e),y:t.y+t.height/2*Math.cos(e)+t.width/2*Math.sin(e)}}function AN(t,e,n){const r=my(e),i=n.x+(t.x-n.x)*Math.cos(r)-(t.y-n.y)*Math.sin(r),a=n.y+(t.x-n.x)*Math.sin(r)+(t.y-n.y)*Math.cos(r);return Object.assign(Object.assign({},t),{rotation:t.rotation+e,x:i,y:a})}function PN(t,e){return AN(t,e,kN(t))}const ts={stroke:"rgb(0, 161, 255)",strokeWidth:1,dash:[4,6]},ON=({stroke:t,strokeWidth:e,dash:n})=>{t!==void 0&&(ts.stroke=t),e!==void 0&&(ts.strokeWidth=e),n!==void 0&&(ts.dash=n)};let s4=({targetKonvaNodes:t,guideKonvaNode:e,distance:n,snapDirection:r})=>n<5;function xm(t,e){var n=[],r=[];t.vertical.forEach(h=>{e.vertical.forEach(f=>{var g=Math.abs(h.offset-f.guide);s4({targetKonvaNodes:f.nodes,guideKonvaNode:h.node,distance:g,snapDirection:h.snap})&&n.push({lineGuide:h.offset,diff:g,snap:f.snap,offset:f.offset})})}),t.horizontal.forEach(h=>{e.horizontal.forEach(f=>{var g=Math.abs(h.offset-f.guide);s4({targetKonvaNodes:f.nodes,guideKonvaNode:h.node,distance:g,snapDirection:h.snap})&&r.push({lineGuide:h.offset,diff:g,snap:f.snap,offset:f.offset})})});var i=[];const a=n.sort((h,f)=>h.diff-f.diff),o=r.sort((h,f)=>h.diff-f.diff);var s=a[0],u=o[0];return s&&a.filter(h=>Math.abs(h.diff-s.diff)<.1).forEach(h=>{i.push(Object.assign({orientation:"V"},h))}),u&&o.filter(h=>Math.abs(h.diff-u.diff)<.1).forEach(h=>{i.push(Object.assign({orientation:"H"},h))}),i}const V7=()=>{if(sn.DD._dragElements.size===0)return;const t=[...sn.DD._dragElements.entries()],e=t.find(([n,r])=>r.node instanceof sn.Transformer);e&&(t.splice(t.indexOf(e),1),t.unshift(e),sn.DD._dragElements.clear(),t.forEach(([n,r])=>{sn.DD._dragElements.set(n,r)}))};function CN(t,e,n){const r=se.useRef(null);ON(n);const i=f=>f.hasName("element")||f.hasName("page-background")||!r.current&&f.hasName("elements-area");function a(f){var g;const v=(g=t.current)===null||g===void 0?void 0:g.getStage(),p=[],y=[];return v.find(i).forEach(_=>{if(!(f.indexOf(_)>=0)){var x=_.getClientRect({skipShadow:!0,skipStroke:!0});p.push({offset:x.x,node:_,snap:"start"},{offset:x.x+x.width,node:_,snap:"end"},{offset:x.x+x.width/2,node:_,snap:"center"}),y.push({offset:x.y,node:_,snap:"start"},{offset:x.y+x.height,node:_,snap:"end"},{offset:x.y+x.height/2,node:_,snap:"center"})}}),{vertical:p,horizontal:y}}function o(f){var g;const v=(g=t.current)===null||g===void 0?void 0:g.getLayer(),p=v?.children.find(y=>y.name()==="line-guides");f.forEach(y=>{if(y.orientation==="H"){var _=new sn.Line({x:-v.getStage().x(),y:-v.getStage().y(),points:[-6e3,y.lineGuide,6e3,y.lineGuide],stroke:ts.stroke,strokeWidth:ts.strokeWidth,name:"guid-line",dash:ts.dash});p?.add(_),v.batchDraw()}else y.orientation==="V"&&(_=new sn.Line({x:-v.getStage().x(),y:-v.getStage().y(),points:[y.lineGuide,-6e3,y.lineGuide,6e3],stroke:ts.stroke,strokeWidth:ts.strokeWidth,name:"guid-line",dash:ts.dash}),p?.add(_))})}const s=f=>{const g=f.target.getLayer().children.find(A=>A.name()==="line-guides");g?.destroyChildren();var v=a(f.target.nodes()),p=(function(A){const S=A.__getNodeRect(),k=kd(Object.assign(Object.assign({},S),{rotation:sn.Util.radToDeg(S.rotation)})),I=A.getAbsolutePosition();return{vertical:[{guide:k.x,offset:I.x-k.x,snap:"start",nodes:A.nodes()},{guide:k.x+k.width/2,offset:I.x-k.x-k.width/2,snap:"center",nodes:A.nodes()},{guide:k.x+k.width,offset:I.x-k.x-k.width,snap:"end",nodes:A.nodes()}],horizontal:[{guide:k.y,offset:I.y-k.y,snap:"start",nodes:A.nodes()},{guide:k.y+k.height/2,offset:I.y-k.y-k.height/2,snap:"center",nodes:A.nodes()},{guide:k.y+k.height,offset:I.y-k.y-k.height,snap:"end",nodes:A.nodes()}]}})(f.target),y=xm(v,p);if(!y.length)return;o(y);const _=f.target.getAbsolutePosition(),x=(f.target.nodes().map(A=>A.getAbsolutePosition()),Object.assign({},_));y.forEach(A=>{switch(A.snap){case"start":case"center":case"end":switch(A.orientation){case"V":x.x=A.lineGuide+A.offset;break;case"H":x.y=A.lineGuide+A.offset}}});const b=x.x-_.x,E=x.y-_.y;f.evt.ctrlKey||f.evt.metaKey||f.target.nodes().forEach(A=>{const S=A.getAbsolutePosition();A.setAbsolutePosition({x:S.x+b,y:S.y+E})})},u=(f,g,v)=>{var p;const y=t.current,_=y.getLayer().children.find(M=>M.name()==="line-guides");if(_?.destroyChildren(),y.getActiveAnchor()==="rotater")return g;const x=y.getActiveAnchor(),b=LN[x],E=(p=y.findOne(`.${b}`))===null||p===void 0?void 0:p.getAbsolutePosition();if(!E)return g;const A={x:f.x-E.x,y:f.y-E.y},S=(function(M,F){const j=u4(M,F)/u4(F,F);return{x:j*F.x,y:j*F.y}})({x:g.x-f.x,y:g.y-f.y},A),k={x:f.x+S.x,y:f.y+S.y};var I=xm(a(y.nodes()),{vertical:[{guide:k.x,offset:0,snap:"start",nodes:y.nodes()}],horizontal:[{guide:k.y,offset:0,snap:"start",nodes:y.nodes()}]});if(!I.length||(o(I),v.ctrlKey||v.metaKey))return g;const O=[];if(I.forEach(M=>{const F=(function(j,T,L){if(L.orientation==="V"){const $=L.lineGuide;if(Math.abs(T.x-j.x)<1e-4)return null;const q=(T.y-j.y)/(T.x-j.x);return{x:$,y:q*$+(j.y-q*j.x)}}{const $=L.lineGuide;if(Math.abs(T.y-j.y)<1e-4)return null;const q=(T.y-j.y)/(T.x-j.x);return{x:($-j.y)/q+j.x,y:$}}})(k,E,{orientation:M.orientation,lineGuide:M.lineGuide});F&&O.push(F)}),O.length>0){let M=O[0],F=Math.sqrt(Math.pow(k.x-M.x,2)+Math.pow(k.y-M.y,2));if(O.forEach(j=>{const T=Math.sqrt(Math.pow(k.x-j.x,2)+Math.pow(k.y-j.y,2));T<F&&(F=T,M=j)}),F<10)return M}return k},h=f=>{if(!f.target)return;const g=f.target.getLayer(),v=g.children.find(p=>p.name()==="line-guides");v?.destroyChildren(),g.batchDraw()};se.useEffect(()=>{t.current&&(t.current.anchorDragBoundFunc(u),t.current.on("dragstart",f=>{setTimeout(()=>{V7()})}),t.current.on("dragmove",s),t.current.on("dragend",h),t.current.on("transformend",h),t.current.on("transform",f=>{var g,v;f.evt.ctrlKey||f.evt.metaKey?(g=t.current)===null||g===void 0||g.rotationSnapTolerance(0):(v=t.current)===null||v===void 0||v.rotationSnapTolerance(5)}))},[])}function l4(t,e,n){const r=o=>o.hasName("element")||o.hasName("line-anchor")||o.hasName("page-background")||o.hasName("elements-area"),i=o=>{const s=o.target.getLayer().children.find(y=>y.name()==="line-guides");s?.destroyChildren();var u,h=xm((function(y){var _;const x=(_=t.current)===null||_===void 0?void 0:_.getStage();var b=[],E=[];return x.find(r).forEach(A=>{if(!(y.indexOf(A)>=0)){var S=A.getClientRect({skipShadow:!0,skipStroke:!0});A.hasName("line-anchor")&&(S={x:A.absolutePosition().x,y:A.absolutePosition().y,width:0,height:0}),b.push({offset:S.x,node:A,snap:"start"},{offset:S.x+S.width,node:A,snap:"end"},{offset:S.x+S.width/2,node:A,snap:"center"}),E.push({offset:S.y,node:A,snap:"start"},{offset:S.y+S.height,node:A,snap:"end"},{offset:S.y+S.height/2,node:A,snap:"center"})}}),{vertical:b,horizontal:E}})([o.target,...e.map(y=>y.current)]),{vertical:[{guide:(u=o.target).absolutePosition().x,offset:0,snap:"center",nodes:[u]}],horizontal:[{guide:u.absolutePosition().y,offset:0,snap:"center",nodes:[u]}]});if(!h.length)return;(function(y){var _;const x=(_=t.current)===null||_===void 0?void 0:_.getLayer(),b=x?.children.find(E=>E.name()==="line-guides");y.forEach(E=>{if(E.orientation==="H"){var A=new sn.Line({points:[-6e3,E.lineGuide,6e3,E.lineGuide],stroke:ts.stroke,strokeWidth:ts.strokeWidth,name:"guid-line",dash:ts.dash});b?.add(A),x.batchDraw()}else E.orientation==="V"&&(A=new sn.Line({points:[E.lineGuide,-6e3,E.lineGuide,6e3],stroke:ts.stroke,strokeWidth:ts.strokeWidth,name:"guid-line",dash:ts.dash}),b?.add(A))})})(h);const f=o.target.getAbsolutePosition(),g=Object.assign({},f);h.forEach(y=>{switch(y.snap){case"start":case"center":case"end":switch(y.orientation){case"V":g.x=y.lineGuide+y.offset;break;case"H":g.y=y.lineGuide+y.offset}}});const v=g.x-f.x,p=g.y-f.y;if(!o.evt.ctrlKey&&!o.evt.metaKey){const y=o.target.getAbsolutePosition();o.target.absolutePosition({x:y.x+v,y:y.y+p})}},a=o=>{if(!o.target)return;const s=o.target.getLayer(),u=s.children.find(h=>h.name()==="line-guides");u?.destroyChildren(),s.batchDraw()};se.useEffect(()=>{t.current&&(t.current.on("dragmove",i),t.current.on("dragend",a))},n)}function u4(t,e){return t.x*e.x+t.y*e.y}const LN={"top-left":"bottom-right","top-center":"bottom-center","top-right":"bottom-left","middle-right":"middle-left","bottom-right":"top-left","bottom-center":"top-center","bottom-left":"top-right","middle-left":"middle-right"};function NN(t){const{x:e,y:n,width:r,height:i,rotation:a}=t.a,o=a*Math.PI/180,s={x:e+i/2*Math.cos(o+Math.PI/2),y:n+i/2*Math.sin(o+Math.PI/2)};return{middleLeft:s,middleRight:{x:s.x+r*Math.cos(o),y:s.y+r*Math.sin(o)}}}function c4(t,e,n){const r=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),i=Math.atan2(e.y-t.y,e.x-t.x),a=180*i/Math.PI;return{x:t.x+Math.cos(i-Math.PI/2)*n/2,y:t.y+Math.sin(i-Math.PI/2)*n/2,width:r,height:n,rotation:a}}const f4=(t,e)=>({offsetX:5/t,offsetY:5/t,width:10/t,height:10/t,fill:"white",stroke:"rgb(0, 161, 255)",strokeWidth:2,strokeScaleEnabled:!1,draggable:!0,dragDistance:0,onMouseEnter:n=>{n.target.getStage().container().style.cursor="crosshair"},onMouseLeave:n=>{n.target.getStage().container().style.cursor=""},onDragStart:n=>{e.history.startTransaction()},onDragEnd:n=>{e.history.endTransaction()}}),h4=ri(({element:t,type:e})=>{const n=wf(t,t.a.color,"fill"),r=wf(t,t.a.color,"stroke"),i=Object.assign(Object.assign(Object.assign({strokeWidth:t.height,lineCap:"round",lineJoin:"round"},r),n),{opacity:t.a.opacity,hideInExport:!t.showInExport});return se.createElement(se.Fragment,null,e==="arrow"&&se.createElement(df,Object.assign({points:[3*t.height,2*-t.height,0,0,3*t.height,2*t.height]},i)),e==="triangle"&&se.createElement(df,Object.assign({points:[3*t.height,2*-t.height,0,0,3*t.height,2*t.height],closed:!0},i)),e==="bar"&&se.createElement(df,Object.assign({points:[0,2*-t.height,0,2*t.height],closed:!0},i)),e==="square"&&se.createElement(df,Object.assign({points:[0,2*-t.height,4*t.height,2*-t.height,4*t.height,2*t.height,0,2*t.height],closed:!0},i)),e==="circle"&&se.createElement(CP,Object.assign({x:2*t.height,y:0,radius:2*t.height},i)))}),TN=ri(({element:t,store:e})=>{const n=se.useRef(null),r=se.useRef(null),i=se.useRef(null),a=t.selectable||e.role==="admin",o=Lf(),s=e.selectedElements.indexOf(t)>=0&&e.selectedElements.length===1,u=e.selectedShapes.indexOf(t)>=0&&t.selectable,{middleLeft:h,middleRight:f}=NN(t);l4(r,[n],[s]),l4(i,[n],[s]);const g=wf(t,t.a.color,"stroke");return se.createElement(se.Fragment,null,se.createElement(df,Object.assign({ref:n,name:"element",id:t.id,x:t.a.x,y:t.a.y,points:[0,0,t.a.width,0],offsetY:-t.a.height/2,strokeWidth:t.a.height,hitStrokeWidth:Math.max(t.a.height,20),dash:t.dash.map(v=>v*t.a.height)},g,{rotation:t.a.rotation,opacity:t.animated("opacity"),shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur,shadowOffsetX:t.shadowOffsetX,shadowOffsetY:t.shadowOffsetY,shadowColor:t.shadowColor,shadowOpacity:t.shadowOpacity,listening:a,draggable:o?t.draggable&&u:t.draggable,preventDefault:!o||u,hideInExport:!t.showInExport,onDragMove:v=>{t.set({x:v.target.x(),y:v.target.y()})},onDragEnd:v=>{t.set({x:v.target.x(),y:v.target.y()})},onTransform:v=>{const p=v.target.scaleX();v.target.scaleX(1),v.target.scaleY(1),t.set({height:t.height*p,width:t.width*p,x:v.target.x(),y:v.target.y(),rotation:v.target.rotation()})}})),se.createElement(br,{x:h.x,y:h.y,rotation:t.rotation,hideInExport:!t.showInExport},se.createElement(h4,{element:t,type:t.startHead})),se.createElement(br,{x:f.x,y:f.y,rotation:t.rotation+180},se.createElement(h4,{element:t,type:t.endHead})),s&&t.resizable&&se.createElement(ry,{selector:".page-abs-container",enabled:!0},se.createElement(br,{visible:s},se.createElement(Tr,Object.assign({x:h.x,y:h.y,ref:r,name:"line-anchor"},f4(e.scale,e),{onDragMove:v=>{const p=c4(v.target.position(),f,t.height);t.set({x:p.x,y:p.y,width:p.width,rotation:p.rotation})}})),se.createElement(Tr,Object.assign({x:f.x,y:f.y,ref:i,name:"line-anchor"},f4(e.scale,e),{onDragMove:v=>{const p=c4(h,v.target.position(),t.height);t.set({x:p.x,y:p.y,width:p.width,rotation:p.rotation})}})))))});function Ep(){return document.createElement("canvas")}const Y7=new window.Image;Y7.src=Eh(`
297
+ <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
298
+ <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"/>
299
+ <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"/>
300
+ </svg>
301
+ `);const X7=new window.Image;X7.src=Eh(`
302
+ <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
303
+ <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"/>
304
+ <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"/>
305
+ <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"/>
306
+ <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"/>
307
+ </svg>
308
+ `);const K7=(t,e,n,r,i=0,a=!1)=>{const o=Math.floor(Math.max(t.width*r,1)),s=Math.floor(Math.max(t.height*r,1)),u=Math.min(i*r,o/2,s/2),h=Math.max(t.width/n.width,t.height/n.height)*r,f=t.page._exportingOrRendering&&Si.imageDownScalingEnabled&&h<1&&!a,g=n.x===0&&n.y===0&&n.width===e?.width&&n.height===e?.height,v=se.useMemo(()=>{if(e&&e.width&&e.height)return g&&u===0&&!f?void 0:Ep()},[e,u,f,g]),p=()=>{if(!v||!e)return;v.width=o,v.height=s;const y=v.getContext("2d");if(!y)return;u&&(y.beginPath(),y.moveTo(u,0),y.lineTo(o-u,0),y.arc(o-u,u,u,3*Math.PI/2,0,!1),y.lineTo(o,s-u),y.arc(o-u,s-u,u,0,Math.PI/2,!1),y.lineTo(u,s),y.arc(u,s-u,u,Math.PI/2,Math.PI,!1),y.lineTo(0,u),y.arc(u,u,u,Math.PI,3*Math.PI/2,!1),y.clip());const _=f?(function(b,E){var A,S;const k=Ep();k.width=b.width,k.height=b.height,(A=k.getContext("2d"))===null||A===void 0||A.drawImage(b,0,0,k.width,k.height);const I=(function(O,M,F,j,T,L,$){for(var q=new ImageData(M,F),J=new Int32Array(O.data.buffer),ae=O.width,ie=new Int32Array(q.data.buffer),Z=q.width,te=M/L,V=F/$,B=Math.round(1/te),D=Math.round(1/V),U=B*D,X=0;X<q.height;X++)for(var ee=0;ee<Z;ee++){for(var K=0+Math.round(ee/te)+(0+Math.round(X/V))*ae,oe=0,me=0,de=0,ye=0,Re=0;Re<D;Re++)for(var Oe=0;Oe<B;Oe++){var Me=J[K+Oe+Re*ae];oe+=Me<<24>>>24,me+=Me<<16>>>24,de+=Me<<8>>>24,ye+=Me>>>24}oe=Math.round(oe/U),me=Math.round(me/U),de=Math.round(de/U),ye=Math.round(ye/U),ie[ee+X*Z]=ye<<24|de<<16|me<<8|oe}return q})(k.getContext("2d").getImageData(0,0,k.width,k.height),Math.floor(k.width*E),Math.floor(k.height*E),0,0,k.width,k.height);return k.width=Math.floor(k.width*E),k.height=Math.floor(k.height*E),(S=k.getContext("2d"))===null||S===void 0||S.putImageData(I,0,0),k})(e,h):e,x=f?{x:Math.floor(n.x*h),y:Math.floor(n.y*h),width:Math.floor(n.width*h),height:Math.floor(n.height*h)}:n;y.drawImage(_,x.x,x.y,x.width,x.height,0,0,v.width,v.height)};return se.useLayoutEffect(()=>{p()},[v,t.width,t.height,n.x,n.y,n.width,n.height,i,r,a,t.page._exportingOrRendering,f]),se.useEffect(()=>()=>{v&&v.nodeName==="CANVAS"&&sn.Util.releaseCanvas(v)},[v]),[v||e,p]},RN=Ep(),MN=ri(({element:t})=>{const e=Math.min(30,t.width/4,t.height/4),n=se.useRef(null);return se.useEffect(()=>{const r=n.current;if(!r)return;const i=new sn.Animation(a=>{r.rotate((a?.timeDiff||0)/2)},r.getLayer());return i.start(),()=>{i.stop()}}),se.createElement(br,{x:t.a.x,y:t.a.y,rotation:t.a.rotation,listening:!1,opacity:t.a.opacity,hideInExport:!t.showInExport},se.createElement(Tr,{width:t.width,height:t.height,fill:"rgba(124, 173, 212, 0.8)"}),se.createElement(ty,{ref:n,x:t.width/2,y:t.height/2,fill:"white",outerRadius:Math.abs(e),innerRadius:Math.max(1,e-5),angle:270}))}),IN=ri(({element:t})=>{const e=Math.max(10,Math.min(30,t.width/25));return se.createElement(br,{x:t.a.x,y:t.a.y,rotation:t.a.rotation,listening:!1,opacity:t.a.opacity,hideInExport:!t.showInExport},se.createElement(Tr,{width:t.width,height:t.height,fill:"rgba(223, 102, 102, 0.8)"}),se.createElement(Fu,{text:"Can not load the video...",fontSize:e,width:t.width,height:t.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let jN=function(t,e,n){const r=se.useRef("loading"),i=se.useRef(null),[a,o]=se.useState(0),s=se.useRef(),u=se.useRef(),h=se.useRef();return s.current===t&&u.current===e&&h.current===n||(r.current="loading",i.current=void 0,s.current=t,u.current=e,h.current=n),se.useLayoutEffect(function(){if(t){var f=document.createElement("video");return f.addEventListener("canplay",g),f.addEventListener("error",v),f.crossOrigin=e,f.src=t,f.load(),function(){f.removeEventListener("canplay",g),f.removeEventListener("error",v)}}function g(){r.current="loaded",i.current=f,i.current.currentTime=0,o(Math.random()),i.current.removeEventListener("canplay",g)}function v(p){var y;const _=f.readyState===4,x=f.buffered&&f.buffered.length>0&&f.buffered.end(f.buffered.length-1)/f.duration*100>=100;if(_&&x)return;const b=p.message||((y=f.error)===null||y===void 0?void 0:y.message)||"Unknown error",E=new Error("Video failed to load: "+b);console.error(E),r.current="failed",i.current=void 0,o(Math.random())}},[t,e,n]),[i.current,r.current]};function d4(t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA}const p4=(t,e,n)=>{const r=se.useRef(),i=()=>{var a;(a=r.current)===null||a===void 0||a.call(r),r.current=void 0};se.useEffect(()=>i,[]),se.useLayoutEffect(()=>{const a=e.slice(0,200),o=`video with id ${n} url: ${a}`;t!=="loading"||r.current||(r.current=uh(o)),t!=="loading"&&i(),t==="failed"&&Ip(o)},[t])},DN=ri(({element:t,store:e})=>{var n;const[r,i]=se.useState(!1),a=se.useRef(null),o=se.useRef(null),s=e.selectedShapes.indexOf(t)>=0&&t.selectable,[u,h]=se.useState(!1),[f,g]=jN(t.src,"anonymous"),[v,p]=se.useState(!1),y=e.activePage===t.page;p4(g,t.src,t.id),f&&(f.width=f.videoWidth,f.height=f.videoHeight,f.playsInline=!0);const _=f||RN;se.useEffect(()=>{f&&e.history.ignore(()=>{t.set({duration:1e3*f.duration})})},[f]),se.useEffect(()=>{var Oe;if(!f)return;const Me=e.animatedElementsIds,Ee=(!Me.length||Me.includes(t.id))&&e.isPlaying,ge=y&&(Ee||u);if(!ge)return void f.pause();ge&&(f.currentTime=t.startTime*f.duration,f.play());const Te=new sn.Animation(()=>{Z()},(Oe=a.current)===null||Oe===void 0?void 0:Oe.getLayer());Te.start();const Be=()=>{h(!1),f.currentTime=t.startTime*f.duration},Ce=()=>{f.currentTime>=t.endTime*f.duration&&(f.pause(),f.currentTime=t.startTime*f.duration,h(!1))};return f.addEventListener("ended",Be),f.addEventListener("timeupdate",Ce),()=>{f.pause(),Te.stop(),f.removeEventListener("ended",Be),f.removeEventListener("timeupdate",Ce)}},[f,u,e.isPlaying,y]),se.useEffect(()=>{f&&(f.volume=t.volume)},[f,t.volume]);const x=se.useRef();se.useEffect(()=>{const Oe=zu(()=>{var Me,Ee;if(f){const ge=e.animatedElementsIds;if(ge.length&&!ge.includes(t.id))return;const Te=t.startTime*f.duration*1e3,Be=f.duration*(t.endTime-t.startTime)*1e3,Ce=((e.currentTime||t.page.startTime)-t.page.startTime)%Be+Te;if(Math.abs(1e3*f.currentTime-Ce)>500||!e.isPlaying){const fe=Ce/1e3;fe!==f.currentTime&&(f.currentTime=fe),!d4(f)&&!e.isPlaying&&!x.current&&(x.current=uh(`video ${t.id}`))}Z(),(Ee=(Me=a.current)===null||Me===void 0?void 0:Me.getLayer())===null||Ee===void 0||Ee.batchDraw()}});return()=>{Oe(),x.current&&(x.current(),x.current=null)}},[e,f]),se.useEffect(()=>{if(!f)return;const Oe=()=>{var Ee,ge;!d4(f)&&t.page._exportingOrRendering||x.current&&(Z(),(ge=(Ee=a.current)===null||Ee===void 0?void 0:Ee.getLayer())===null||ge===void 0||ge.batchDraw(),x.current(),x.current=null)};let Me;return t.page._exportingOrRendering&&(Me=setInterval(Oe,20)),f.addEventListener("timeupdate",Oe),f.addEventListener("canplay",Oe),()=>{clearInterval(Me),f.removeEventListener("timeupdate",Oe),f.removeEventListener("canplay",Oe)}},[t.page._exportingOrRendering,f,t.id,uh]);let{cropX:b,cropY:E,cropWidth:A,cropHeight:S}=t;g!=="loaded"&&(b=E=0,A=S=1);const k=_.width*A,I=_.height*S,O=t.width/t.height;let M,F;const j=k/I,T=t.type==="svg";T?(M=k,F=I):O>=j?(M=k,F=k/O):(M=I*O,F=I);const L={x:_.width*b,y:_.height*E,width:M,height:F},$=(n=t.cornerRadius)!==null&&n!==void 0?n:0,[q,J]=K7(t,_,L,e._elementsPixelRatio,$,r||t._cropModeEnabled||t.type==="svg");let[ae,ie]=((Oe,Me,Ee,ge)=>{const Te=(ue=>{const[Ae,Pe]=se.useState(ue);return se.useEffect(()=>{(async()=>{const Ue=await(async function(st){if(!(st.indexOf("data:image/svg+xml")>=0||st.indexOf(".svg")>=0))return st;const dt=await Dp(st),pt=uy(dt);return Eh(pt)})(ue);Ue!==Ae&&Pe(Ue)})()},[ue]),Ae})(Oe.clipSrc||""),[Be,Ce]=ny(Te,"anonymous"),fe=Oe.clipSrc?Ce:"loaded";p4(fe,Oe.clipSrc,Oe.id);const Le=se.useMemo(()=>{if(Me&&Be)return Ep()},[Me,Be]);function Ne(){var ue;if(!Be||!Me||!Me.width||!Me.height||!Be||!Be.width||!Be.height||!Le)return;const Ae=Ep(),Pe=Math.max(Oe.width/Be.width*Ee,Oe.height/Be.height*Ee);Ae.width=Be.width*Pe,Ae.height=Be.height*Pe,(ue=Ae.getContext("2d"))===null||ue===void 0||ue.drawImage(Be,0,0,Ae.width,Ae.height),Le.width=Math.max(Me.width,1),Le.height=Math.max(Me.height,1);const Ue=Le.getContext("2d");Ue&&(Ue.save(),Ue.drawImage(Ae,0,0,Me.width,Me.height),sn.Util.releaseCanvas(Ae),Ue.globalCompositeOperation="source-in",Ue.drawImage(Me,0,0,Le.width,Le.height),Ue.restore())}return se.useLayoutEffect(()=>{Ne()},[Le,Me,Be,Oe.width,Oe.height,Ee,...ge]),[Oe.clipSrc&&Be?Le:Me,Ne]})(t,q,e._elementsPixelRatio,[L,$,e._elementsPixelRatio]);function Z(){J(),ie()}const te=Math.max(t.width/M,t.height/F);se.useEffect(()=>{var Oe;if(!t._cropModeEnabled)return;const Me=(Oe=a.current)===null||Oe===void 0?void 0:Oe.getStage();function Ee(Te){t._cropModeEnabled&&Te.target!==o.current&&t.toggleCropMode(!1)}function ge(Te){t._cropModeEnabled&&Te.target.parentNode!==Me.content&&t.toggleCropMode(!1)}return document.body.addEventListener("click",ge),Me?.on("click",Ee),Me?.on("tap",Ee),()=>{document.body.removeEventListener("click",ge),document.body.removeEventListener("touchstart",ge),Me?.off("click",Ee),Me?.off("click",Ee)}},[t._cropModeEnabled]),se.useLayoutEffect(()=>{if(!r&&!t._cropModeEnabled)return Ms(a.current,t),zu(()=>{Ms(a.current,t)},{delay:100})},[_,r,A,S,t._cropModeEnabled]),se.useLayoutEffect(()=>{var Oe;r||t._cropModeEnabled?(Oe=a.current)===null||Oe===void 0||Oe.clearCache():Ms(a.current,t)},[r,t.width,t.height,t._cropModeEnabled]),se.useEffect(()=>{Ms(a.current,t)},[t.shadowEnabled,t.shadowBlur,t.cornerRadius,t.shadowColor,t.shadowOffsetX,t.shadowOffsetY,t.shadowOpacity]);const V=se.useRef(null),B=se.useRef(null),D=se.useRef(null);se.useLayoutEffect(()=>{t._cropModeEnabled&&(B.current.nodes([V.current]),D.current.nodes([o.current]))},[t._cropModeEnabled]);const U=Oe=>{Math.round(Oe.target.x())>0&&(Oe.target.x(0),Oe.target.scaleX(1)),Math.round(Oe.target.y())>0&&(Oe.target.y(0),Oe.target.scaleY(1));const Me=Oe.target.width()*Oe.target.scaleX(),Ee=Oe.target.height()*Oe.target.scaleY(),ge=Math.min(1,M/Me),Te=Math.min(1,F/Ee),Be=1-ge,Ce=Math.min(Be,Math.max(0,Math.round(-Oe.target.x())/Me)),fe=1-Te,Le=Math.min(fe,Math.max(0,Math.round(-Oe.target.y())/Ee));Oe.target.setAttrs({x:-Ce*_.width,y:-Le*_.height,scaleX:1,scaleY:1}),t.set({cropX:Ce,cropY:Le,cropWidth:ge,cropHeight:Te})},X=()=>{t.type!=="svg"&&t.contentEditable&&setTimeout(()=>{t.toggleCropMode(!0)})},ee=g==="loading",K=g==="failed",oe=!ee&&!K,me=se.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),de=oe?t.a.opacity:0;Mp(a,de);const ye=t.selectable||e.role==="admin",Re=Lf();return se.createElement(se.Fragment,null,se.createElement(br,{onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1)},ee&&se.createElement(MN,{element:t}),K&&se.createElement(IN,{element:t}),se.createElement(Tu,{ref:a,name:"element",id:t.id,image:ae,x:t.a.x,y:t.a.y,width:t.a.width||1,height:t.a.height||1,rotation:t.a.rotation,opacity:de,shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur,shadowOffsetX:t.shadowOffsetX,shadowOffsetY:t.shadowOffsetY,shadowColor:t.shadowColor,shadowOpacity:t.shadowOpacity,customCrop:L,listening:ye,draggable:Re?t.draggable&&s:t.draggable,preventDefault:!Re||s,hideInExport:!t.showInExport,onDragMove:Oe=>{t.set({x:Oe.target.x(),y:Oe.target.y()})},onDragEnd:Oe=>{t.set({x:Oe.target.x(),y:Oe.target.y()})},onDblClick:X,onDblTap:X,onTransformStart:()=>{i(!0),me.current={cropX:t.cropX,cropY:t.cropY,cropWidth:t.cropWidth,cropHeight:t.cropHeight}},onTransform:Oe=>{var Me;const Ee=Oe.currentTarget,ge=Math.abs(Ee.scaleX()-1)<1e-7?1:Ee.scaleX(),Te=Math.abs(Ee.scaleY()-1)<1e-7?1:Ee.scaleY();Ee.scaleX(1),Ee.scaleY(1);const Be=(Me=Oe.target.getStage())===null||Me===void 0?void 0:Me.findOne("Transformer"),Ce=1-M/_.width,fe=Math.min(Ce,Math.max(0,t.cropX)),Le=1-F/_.height,Ne=Math.min(Le,Math.max(0,t.cropY)),ue=Be.getActiveAnchor(),Ae=!(ue.indexOf("middle")>=0||ue.indexOf("center")>=0),Pe=!Ae&&ge<1&&me.current.cropHeight>F/_.height;let Ue=Ae?t.cropWidth:t.cropWidth*ge;Pe&&(Ue=t.cropWidth);const st=!Ae&&Te<1&&me.current.cropWidth>M/_.width;let dt=Ae?t.cropHeight:t.cropHeight*Te;st&&(dt=t.cropHeight),T&&(Ue=t.cropWidth,dt=t.cropHeight),t.set({cropX:fe,cropY:Ne,x:Ee.x(),y:Ee.y(),width:Ee.width()*ge,height:Ee.height()*Te,rotation:Oe.target.rotation(),cropWidth:Math.min(Ue,1-fe),cropHeight:Math.min(dt,1-Ne)})},onTransformEnd:Oe=>{const Me=Oe.currentTarget;t.set({width:Me.width(),height:Me.height(),x:Me.x(),y:Me.y(),rotation:Oe.target.rotation(),cropWidth:M/_.width,cropHeight:F/_.height}),i(!1)}}),se.createElement(Tr,{x:t.a.x,y:t.a.y,width:Math.max(t.a.width-t.borderSize,0),height:Math.max(t.a.height-t.borderSize,0),opacity:de,offsetX:-t.borderSize/2,offsetY:-t.borderSize/2,stroke:t.borderColor,strokeWidth:t.borderSize,listening:!1,visible:!!t.borderSize,rotation:t.rotation,cornerRadius:Math.max(0,$-t.borderSize),hideInExport:!t.showInExport}),!e.isPlaying&&se.createElement(Tu,{image:u?(v||Re)&&X7:Y7,x:t.a.x,y:t.a.y,offsetX:-t.a.width/2+15/e.scale,offsetY:-t.a.height/2+15/e.scale,rotation:t.a.rotation,width:30/e.scale,height:30/e.scale,hideInExport:!0,onClick:()=>h(!u),onTap:()=>h(!u)}),t._cropModeEnabled&&se.createElement(ry,{selector:".page-abs-container",enabled:!0},se.createElement(Tr,{x:-window.innerWidth/e.scale,y:-window.innerWidth/e.scale,width:window.innerWidth/e.scale*3,height:window.innerWidth/e.scale*3,fill:"rgba(0,0,0,0.3)"}),se.createElement(Tu,{listening:!1,image:ae,x:t.a.x,y:t.a.y,width:t.a.width,height:t.a.height,rotation:t.a.rotation,shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur}),se.createElement(br,{x:t.a.x,y:t.a.y,rotation:t.a.rotation,scaleX:te,scaleY:te},se.createElement(Tu,{image:_,ref:o,opacity:.4,draggable:!0,x:-t.cropX*_.width,y:-t.cropY*_.height,onDragMove:U,onTransform:U}),se.createElement(bp,{ref:D,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Oe,Me)=>Me.width<5||Me.height<5?Oe:Me,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),se.createElement(Tr,{width:M,height:F,ref:V,listening:!1,onTransform:Oe=>{Oe.target.x()<-t.cropX*_.width-1e-9&&(Oe.target.x(-t.cropX*_.width),Oe.target.scaleX(1)),Oe.target.y()<-t.cropY*_.height-1e-9&&(Oe.target.y(-t.cropY*_.height),Oe.target.scaleY(1));const Me=Math.min(1,Math.max(0,t.cropX+Oe.target.x()/_.width)),Ee=Math.min(1,Math.max(0,Oe.target.y()/_.height+t.cropY)),ge=Oe.target.width()*Oe.target.scaleX(),Te=Oe.target.height()*Oe.target.scaleY(),Be=Math.min(1-Me,ge/_.width),Ce=Math.min(1-Ee,Te/_.height),fe=Oe.target.getAbsolutePosition(Oe.target.getParent().getParent());Oe.target.scale({x:1,y:1}),Oe.target.position({x:0,y:0}),t.set({x:fe.x,y:fe.y,cropX:Me,cropY:Ee,cropWidth:Be,cropHeight:Ce,width:Math.min(ge*te,_.width*(1-Me)*te),height:Math.min(Te*te,_.height*(1-Ee)*te)})}}),se.createElement(bp,{ref:B,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Oe,Me)=>Me.width<5||Me.height<5?Oe:Me,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2,visible:t.resizable})))))}),yy=({width:t,height:e,cornerRadius:n})=>{if(n>0){const r=Math.min(n,t/2,e/2);return`M 0 ${r} A ${r} ${r} 0 0 1 ${r} 0 L ${t-r} 0 A ${r} ${r} 0 0 1 ${t} ${r} L ${t} ${e-r} A ${r} ${r} 0 0 1 ${t-r} ${e} L ${r} ${e} A ${r} ${r} 0 0 1 0 ${e-r} Z`}return`M 0 0 L ${t} 0 L ${t} ${e} L 0 ${e} Z`},FN=({width:t,height:e})=>`M ${t/2} 0 L ${t} ${e} L 0 ${e} Z`,BN=({width:t,height:e})=>`M 0 0 L ${t} 0 L 0 ${e} Z`,zN=({width:t,height:e})=>`M ${t/2} ${e/2} m -${t/2}, 0 a ${t/2},${e/2} 0 1,0 ${t},0 a ${t/2},${e/2} 0 1,0 -${t},0`;function qN({width:t,height:e}){const n=t/2,r=e/2,i=t/2,a=e/2,o=i/2,s=a/2;let u="",h=Math.PI/5;for(let f=0;f<10;f++){const g=f%2==0?a:s,v=n+(f%2==0?i:o)*Math.sin(f*h),p=r-g*Math.cos(f*h);f===0?u=`M ${v} ${p}`:u+=` L ${v} ${p}`}return u+" Z"}function UN({width:t,height:e}){const n=t/2,r=e/2;return`M ${n} 0 L ${t} ${r} L ${n} ${e} L 0 ${r} Z`}function HN({width:t,height:e}){const n=t/2,r=e/2,i=t/2,a=e/2;let o="",s=2*Math.PI/5;for(let u=0;u<5;u++){const h=a,f=n+i*Math.sin(u*s),g=r-h*Math.cos(u*s);u===0?o=`M ${f} ${g}`:o+=` L ${f} ${g}`}return o+" Z"}function $N({width:t,height:e}){const n=t/2,r=e/2,i=t/2,a=e/2;let o="",s=2*Math.PI/6;for(let u=0;u<6;u++){const h=a,f=n+i*Math.sin(u*s),g=r-h*Math.cos(u*s);u===0?o=`M ${f} ${g}`:o+=` L ${f} ${g}`}return o+" Z"}function Mt({path:t,aspectRatio:e,width:n,height:r}){return{path:t,scaleX:n/e.width,scaleY:r/e.height}}function GN({width:t,height:e}){const n=.1*Math.min(t,e),r=.2*t,i=.2*e,a=.5*t;let o=`M ${n},0`;return o+=" H "+(t-n),o+=` A ${n},${n} 0 0 1 ${t},${n}`,o+=" V "+(e-n-i),o+=` A ${n},${n} 0 0 1 ${t-n},${e-i}`,o+=` H ${a+r/2}`,o+=` L ${a},${e}`,o+=` L ${a-r/2},${e-i}`,o+=` H ${n}`,o+=` A ${n},${n} 0 0 1 0,${e-n-i}`,o+=` V ${n}`,o+=` A ${n},${n} 0 0 1 ${n},0`,o+=" Z",o}function WN({width:t,height:e}){const n=.3*t,r=.3*e,i=t/2,a=e/2,o=i-n/2,s=i+n/2,u=a-r/2,h=a+r/2;let f=`M ${o},0 `;return f+=`H ${s} `,f+=`V ${u} `,f+=`H ${t} `,f+=`V ${h} `,f+=`H ${s} `,f+=`V ${e} `,f+=`H ${o} `,f+=`V ${h} `,f+="H 0 ",f+=`V ${u} `,f+=`H ${o} `,f+="V 0 ",f+="Z",f}const VN={rect:yy,circle:zN,star:qN,triangle:FN,rightTriangle:BN,diamond:UN,pentagon:HN,hexagon:$N,speechBubble:GN,cross:WN,arc:({width:t,height:e})=>Mt({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:t,height:e}),cloud:({width:t,height:e})=>Mt({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:t,height:e}),rightArrow:({width:t,height:e})=>{const n=.6*t;return`M 0 ${e/4} L ${n} ${e/4} L ${n} 0 L ${t} ${e/2} L ${n} ${e} L ${n} ${.75*e} L 0 ${.75*e} Z`},leftArrow:({width:t,height:e})=>{const n=.4*t;return`M ${t} ${e/4} L ${n} ${e/4} L ${n} 0 L 0 ${e/2} L ${n} ${e} L ${n} ${.75*e} L ${t} ${.75*e} Z`},downArrow:({width:t,height:e})=>{const n=.6*e;return`M ${t/4} 0 L ${t/4} ${n} L 0 ${n} L ${t/2} ${e} L ${t} ${n} L ${.75*t} ${n} L ${.75*t} 0 Z`},upArrow:({width:t,height:e})=>{const n=.4*e;return`M ${t/4} ${e} L ${t/4} ${n} L 0 ${n} L ${t/2} 0 L ${t} ${n} L ${.75*t} ${n} L ${.75*t} ${e} Z`},asterisk1:({width:t,height:e})=>Mt({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:t,height:e}),asterisk2:({width:t,height:e})=>Mt({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:t,height:e}),bookmark:({width:t,height:e})=>Mt({path:"M0 0H199V238L99.5 142.8L0 238V0Z",aspectRatio:{width:199,height:238},width:t,height:e}),butterfly:({width:t,height:e})=>Mt({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:t,height:e}),cylinder:({width:t,height:e})=>Mt({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:t,height:e}),diamond2:({width:t,height:e})=>Mt({path:"M0 55.5L124 185L248 55.5L189.307 0H58.6933L0 55.5Z",aspectRatio:{width:248,height:185},width:t,height:e}),door:({width:t,height:e})=>Mt({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:t,height:e}),drop1:({width:t,height:e})=>Mt({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:t,height:e}),drop2:({width:t,height:e})=>Mt({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:t,height:e}),explosion:({width:t,height:e})=>Mt({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:t,height:e}),flag:({width:t,height:e})=>Mt({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:t,height:e}),flower:({width:t,height:e})=>Mt({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:t,height:e}),frame:({width:t,height:e})=>Mt({path:"M0 0H240L200 88L240 176H0L40 88L0 0Z",aspectRatio:{width:240,height:176},width:t,height:e}),heart1:({width:t,height:e})=>Mt({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:t,height:e}),home:({width:t,height:e})=>Mt({path:"M0 62.143L95.5 0L191 62.143V195H0V62.143Z",aspectRatio:{width:191,height:195},width:t,height:e}),home2:({width:t,height:e})=>Mt({path:"M206 94.076L103 0L0 94.076H31.2377V189H175.607V94.076H206Z",aspectRatio:{width:206,height:189},width:t,height:e}),hourglass:({width:t,height:e})=>Mt({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:t,height:e}),house:({width:t,height:e})=>Mt({path:"M0 92.367L95 0L190 92.367V223H0V92.367Z",aspectRatio:{width:190,height:223},width:t,height:e}),keyhole:({width:t,height:e})=>Mt({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:t,height:e}),kiss:({width:t,height:e})=>Mt({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:t,height:e}),leaf:({width:t,height:e})=>Mt({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:t,height:e}),lightning1:({width:t,height:e})=>Mt({path:"M111.5 0L0 142H51.433L31.5 253L143 111H91.567L111.5 0Z",aspectRatio:{width:143,height:253},width:t,height:e}),lightning2:({width:t,height:e})=>Mt({path:"M126 0H43L0 120.531H36L6 227L110 80.354H73L126 0Z",aspectRatio:{width:126,height:227},width:t,height:e}),magnet:({width:t,height:e})=>Mt({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:t,height:e}),mithosis:({width:t,height:e})=>Mt({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:t,height:e}),orangeRicky:({width:t,height:e})=>Mt({path:"M69 0H0V69V138V207H69H138V138H69V69V0Z",aspectRatio:{width:138,height:207},width:t,height:e}),party:({width:t,height:e})=>Mt({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:t,height:e}),pillow:({width:t,height:e})=>Mt({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:t,height:e}),polygon:({width:t,height:e})=>Mt({path:"M110 0L219.119 63V189L110 252L0.880798 189V63L110 0Z",aspectRatio:{width:220,height:252},width:t,height:e}),rainbow:({width:t,height:e})=>Mt({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:t,height:e}),rhodeIsland:({width:t,height:e})=>Mt({path:"M69 0H0V69V138H69V207H138V138V69H69V0Z",aspectRatio:{width:138,height:207},width:t,height:e}),shell:({width:t,height:e})=>Mt({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:t,height:e}),shield1:({width:t,height:e})=>Mt({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:t,height:e}),shield2:({width:t,height:e})=>Mt({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:t,height:e}),skewedRectangle:({width:t,height:e})=>Mt({path:"M85.9799 0H290L204.02 141H0L85.9799 0Z",aspectRatio:{width:290,height:141},width:t,height:e}),softFlower:({width:t,height:e})=>Mt({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:t,height:e}),softStar:({width:t,height:e})=>Mt({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:t,height:e}),stairs1:({width:t,height:e})=>Mt({path:"M0 0H67.667V67.667H135.333V135.333H203V203H0V0Z",aspectRatio:{width:203,height:203},width:t,height:e}),stairs2:({width:t,height:e})=>Mt({path:"M50 0H0V200H200V150H150V100H100V50H50V0Z",aspectRatio:{width:200,height:200},width:t,height:e}),teewee:({width:t,height:e})=>Mt({path:"M69 0H138V69H207V138H138H69H0V69H69V0Z",aspectRatio:{width:207,height:138},width:t,height:e}),blob1:({width:t,height:e})=>Mt({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:t,height:e}),blob10:({width:t,height:e})=>Mt({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:t,height:e}),blob11:({width:t,height:e})=>Mt({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:t,height:e}),blob12:({width:t,height:e})=>Mt({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:t,height:e}),blob13:({width:t,height:e})=>Mt({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:t,height:e}),blob14:({width:t,height:e})=>Mt({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:t,height:e}),blob15:({width:t,height:e})=>Mt({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:t,height:e}),blob16:({width:t,height:e})=>Mt({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:t,height:e}),blob17:({width:t,height:e})=>Mt({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:t,height:e}),blob18:({width:t,height:e})=>Mt({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:t,height:e}),blob19:({width:t,height:e})=>Mt({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:t,height:e}),blob2:({width:t,height:e})=>Mt({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:t,height:e}),blob20:({width:t,height:e})=>Mt({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:t,height:e}),blob21:({width:t,height:e})=>Mt({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:t,height:e}),blob22:({width:t,height:e})=>Mt({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:t,height:e}),blob23:({width:t,height:e})=>Mt({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:t,height:e}),blob24:({width:t,height:e})=>Mt({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:t,height:e}),blob25:({width:t,height:e})=>Mt({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:t,height:e}),blob26:({width:t,height:e})=>Mt({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:t,height:e}),blob27:({width:t,height:e})=>Mt({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:t,height:e}),blob28:({width:t,height:e})=>Mt({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:t,height:e}),blob29:({width:t,height:e})=>Mt({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:t,height:e}),blob3:({width:t,height:e})=>Mt({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:t,height:e}),blob30:({width:t,height:e})=>Mt({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:t,height:e}),blob31:({width:t,height:e})=>Mt({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:t,height:e}),blob32:({width:t,height:e})=>Mt({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:t,height:e}),blob4:({width:t,height:e})=>Mt({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:t,height:e}),blob5:({width:t,height:e})=>Mt({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:t,height:e}),blob6:({width:t,height:e})=>Mt({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:t,height:e}),blob7:({width:t,height:e})=>Mt({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:t,height:e}),blob8:({width:t,height:e})=>Mt({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:t,height:e}),blob9:({width:t,height:e})=>Mt({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:t,height:e})};function Z7(t){return VN[t]||yy}function Q7(t){const{subType:e}=t,n=Z7(e);return n?(function(r,i){const{width:a,height:o,fill:s,stroke:u,strokeWidth:h,dash:f}=r,g=(f||[]).map(x=>x*h);let v=i(r),p=1,y=1;typeof v!="string"&&(p=v.scaleX,y=v.scaleY,v=v.path);const _=`clip-${r.id||Math.random()}`;return`
309
+ <svg xmlns="http://www.w3.org/2000/svg" width="${a}" height="${o}">
310
+ <defs>
311
+ <clipPath id="${_}">
312
+ <path d="${v}" />
313
+ </clipPath>
314
+ </defs>
315
+
316
+ <!-- Path for the fill -->
317
+ <path d="${v}" fill="${s}" transform="scale(${p}, ${y})"/>
318
+
319
+ <!-- Path for the stroke, clipped by the star path -->
320
+ <path d="${v}" fill="none" stroke="${u}" stroke-width="${2*h}" clip-path="url(#${_})" transform="scale(${p}, ${y})" stroke-dasharray="${g.join(" ")}"/>
321
+ </svg>
322
+ `})(t,n):(console.error(`Polotno error: Can not convert ${t.subType} figure to svg.`),yy(t))}const hv={},YN=ri(({element:t,store:e})=>{const n=t.selectable||e.role==="admin",r=Lf(),i=e.selectedShapes.indexOf(t)>=0&&t.selectable,a=Math.min(t.strokeWidth,t.width/2,t.height/2),o=Math.max(0,Math.min(t.width/2,t.height/2,t.cornerRadius)),s=wf(t,t.a.fill,"fill"),u=Object.assign(Object.assign({width:t.a.width,height:t.a.height},s),{cornerRadius:o,opacity:t.animated("opacity"),shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur,shadowOffsetX:t.shadowOffsetX,shadowOffsetY:t.shadowOffsetY,shadowColor:t.shadowColor,shadowOpacity:t.shadowOpacity,preventDefault:!r||i,hideInExport:!t.showInExport}),h=wf(t,t.stroke,"stroke"),f=Object.assign(Object.assign({visible:a>0,x:a/2,y:a/2,width:t.a.width-a,height:t.a.height-a},h),{strokeWidth:a,cornerRadius:Math.max(0,o-a),dash:t.dash.map(y=>y*a),opacity:t.animated("opacity"),hideInExport:!t.showInExport,listening:!1}),g=(v=t.subType,hv[v]||(hv[v]=(p=Z7(v),ri(({element:y,fillProps:_,strokeProps:x})=>{let b=p({width:y.a.width,height:y.a.height,cornerRadius:y.cornerRadius}),E=1,A=1;typeof b!="string"&&(E=b.scaleX,A=b.scaleY,b=b.path);const S=se.useRef(null);return se.createElement(se.Fragment,null,se.createElement(Tr,{width:y.width,height:y.height,fill:"transparent"}),se.createElement(yp,Object.assign({},_,{ref:S,data:b,scaleX:E,scaleY:A})),se.createElement(br,{clipFunc:k=>{const I=S.current;if(I){var O=I.dataArray;k.beginPath();for(var M=0;M<O.length;M++){var F=O[M].command,j=O[M].points;switch(F){case"L":k.lineTo(j[0],j[1]);break;case"M":k.moveTo(j[0],j[1]);break;case"C":k.bezierCurveTo(j[0],j[1],j[2],j[3],j[4],j[5]);break;case"Q":k.quadraticCurveTo(j[0],j[1],j[2],j[3]);break;case"A":var T=j[0],L=j[1],$=j[2],q=j[3],J=j[4],ae=j[5],ie=j[6],Z=j[7],te=$>q?$:q,V=$>q?1:$/q,B=$>q?q/$:1;k.translate(T,L),k.rotate(ie),k.scale(V,B),k.arc(0,0,te,J,J+ae,1-Z),k.scale(1/V,1/B),k.rotate(-ie),k.translate(-T,-L);break;case"z":k.closePath()}}}},scaleX:E,scaleY:A},se.createElement(yp,Object.assign({},x,{x:0,y:0,data:b,strokeWidth:2*x.strokeWidth,dash:x.dash.map(k=>k)}))))}))),hv[v]||br);var v,p;return se.createElement(se.Fragment,null,se.createElement(br,{id:t.id,x:t.a.x,y:t.a.y,rotation:t.a.rotation,opacity:t.a.opacity,listening:n,draggable:r?t.draggable&&i:t.draggable,name:"element",onDragMove:y=>{t.set({x:y.target.x(),y:y.target.y()})},onDragEnd:y=>{t.set({x:y.target.x(),y:y.target.y()})},onTransform:y=>{const _=y.target.scale();y.target.scaleX(1),y.target.scaleY(1),t.set({width:t.width*_.x,height:t.height*_.y,x:y.target.x(),y:y.target.y(),rotation:y.target.rotation()})}},se.createElement(g,{element:t,fillProps:u,strokeProps:f})))});var oc={},dv={},sc={},g4;function J7(){if(g4)return sc;g4=1,Object.defineProperty(sc,"__esModule",{value:!0}),sc.loop=sc.conditional=sc.parse=void 0;var t=function r(i,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:o;if(Array.isArray(a))a.forEach(function(h){return r(i,h,o,s)});else if(typeof a=="function")a(i,o,s,r);else{var u=Object.keys(a)[0];Array.isArray(a[u])?(s[u]={},r(i,a[u],o,s[u])):s[u]=a[u](i,o,s,r)}return o};sc.parse=t;var e=function(i,a){return function(o,s,u,h){a(o,s,u)&&h(o,i,s,u)}};sc.conditional=e;var n=function(i,a){return function(o,s,u,h){for(var f=[],g=o.pos;a(o,s,u);){var v={};if(h(o,i,s,v),o.pos===g)break;g=o.pos,f.push(v)}return f}};return sc.loop=n,sc}var oa={},v4;function e_(){if(v4)return oa;v4=1,Object.defineProperty(oa,"__esModule",{value:!0}),oa.readBits=oa.readArray=oa.readUnsigned=oa.readString=oa.peekBytes=oa.readBytes=oa.peekByte=oa.readByte=oa.buildStream=void 0;var t=function(g){return{data:g,pos:0}};oa.buildStream=t;var e=function(){return function(g){return g.data[g.pos++]}};oa.readByte=e;var n=function(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(v){return v.data[v.pos+g]}};oa.peekByte=n;var r=function(g){return function(v){return v.data.subarray(v.pos,v.pos+=g)}};oa.readBytes=r;var i=function(g){return function(v){return v.data.subarray(v.pos,v.pos+g)}};oa.peekBytes=i;var a=function(g){return function(v){return Array.from(r(g)(v)).map(function(p){return String.fromCharCode(p)}).join("")}};oa.readString=a;var o=function(g){return function(v){var p=r(2)(v);return g?(p[1]<<8)+p[0]:(p[0]<<8)+p[1]}};oa.readUnsigned=o;var s=function(g,v){return function(p,y,_){for(var x=typeof v=="function"?v(p,y,_):v,b=r(g),E=new Array(x),A=0;A<x;A++)E[A]=b(p);return E}};oa.readArray=s;var u=function(g,v,p){for(var y=0,_=0;_<p;_++)y+=g[v+_]&&Math.pow(2,p-_-1);return y},h=function(g){return function(v){for(var p=e()(v),y=new Array(8),_=0;_<8;_++)y[7-_]=!!(p&1<<_);return Object.keys(g).reduce(function(x,b){var E=g[b];return E.length?x[b]=u(y,E.index,E.length):x[b]=y[E.index],x},{})}};return oa.readBits=h,oa}var m4;function XN(){return m4||(m4=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=J7(),n=e_(),r={blocks:function(v){for(var p=0,y=[],_=v.data.length,x=0,b=(0,n.readByte)()(v);b!==p&&b;b=(0,n.readByte)()(v)){if(v.pos+b>=_){var E=_-v.pos;y.push((0,n.readBytes)(E)(v)),x+=E;break}y.push((0,n.readBytes)(b)(v)),x+=b}for(var A=new Uint8Array(x),S=0,k=0;k<y.length;k++)A.set(y[k],S),S+=y[k].length;return A}},i=(0,e.conditional)({gce:[{codes:(0,n.readBytes)(2)},{byteSize:(0,n.readByte)()},{extras:(0,n.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,n.readUnsigned)(!0)},{transparentColorIndex:(0,n.readByte)()},{terminator:(0,n.readByte)()}]},function(g){var v=(0,n.peekBytes)(2)(g);return v[0]===33&&v[1]===249}),a=(0,e.conditional)({image:[{code:(0,n.readByte)()},{descriptor:[{left:(0,n.readUnsigned)(!0)},{top:(0,n.readUnsigned)(!0)},{width:(0,n.readUnsigned)(!0)},{height:(0,n.readUnsigned)(!0)},{lct:(0,n.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,e.conditional)({lct:(0,n.readArray)(3,function(g,v,p){return Math.pow(2,p.descriptor.lct.size+1)})},function(g,v,p){return p.descriptor.lct.exists}),{data:[{minCodeSize:(0,n.readByte)()},r]}]},function(g){return(0,n.peekByte)()(g)===44}),o=(0,e.conditional)({text:[{codes:(0,n.readBytes)(2)},{blockSize:(0,n.readByte)()},{preData:function(v,p,y){return(0,n.readBytes)(y.text.blockSize)(v)}},r]},function(g){var v=(0,n.peekBytes)(2)(g);return v[0]===33&&v[1]===1}),s=(0,e.conditional)({application:[{codes:(0,n.readBytes)(2)},{blockSize:(0,n.readByte)()},{id:function(v,p,y){return(0,n.readString)(y.blockSize)(v)}},r]},function(g){var v=(0,n.peekBytes)(2)(g);return v[0]===33&&v[1]===255}),u=(0,e.conditional)({comment:[{codes:(0,n.readBytes)(2)},r]},function(g){var v=(0,n.peekBytes)(2)(g);return v[0]===33&&v[1]===254}),h=[{header:[{signature:(0,n.readString)(3)},{version:(0,n.readString)(3)}]},{lsd:[{width:(0,n.readUnsigned)(!0)},{height:(0,n.readUnsigned)(!0)},{gct:(0,n.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,n.readByte)()},{pixelAspectRatio:(0,n.readByte)()}]},(0,e.conditional)({gct:(0,n.readArray)(3,function(g,v){return Math.pow(2,v.lsd.gct.size+1)})},function(g,v){return v.lsd.gct.exists}),{frames:(0,e.loop)([i,s,u,a,o],function(g){var v=(0,n.peekByte)()(g);return v===33||v===44})}],f=h;t.default=f})(dv)),dv}var qd={},y4;function KN(){if(y4)return qd;y4=1,Object.defineProperty(qd,"__esModule",{value:!0}),qd.deinterlace=void 0;var t=function(n,r){for(var i=new Array(n.length),a=n.length/r,o=function(p,y){var _=n.slice(y*r,(y+1)*r);i.splice.apply(i,[p*r,r].concat(_))},s=[0,4,2,1],u=[8,8,4,2],h=0,f=0;f<4;f++)for(var g=s[f];g<a;g+=u[f])o(g,h),h++;return i};return qd.deinterlace=t,qd}var Ud={},b4;function ZN(){if(b4)return Ud;b4=1,Object.defineProperty(Ud,"__esModule",{value:!0}),Ud.lzw=void 0;var t=function(n,r,i){var a=4096,o=-1,s=i,u,h,f,g,v,p,y,O,_,x,I,b,M,F,T,j,E=new Array(i),A=new Array(a),S=new Array(a),k=new Array(a+1);for(b=n,h=1<<b,v=h+1,u=h+2,y=o,g=b+1,f=(1<<g)-1,_=0;_<h;_++)A[_]=0,S[_]=_;var I,O,M,F,j,T;for(I=O=M=F=j=T=0,x=0;x<s;){if(F===0){if(O<g){I+=r[T]<<O,O+=8,T++;continue}if(_=I&f,I>>=g,O-=g,_>u||_==v)break;if(_==h){g=b+1,f=(1<<g)-1,u=h+2,y=o;continue}if(y==o){k[F++]=S[_],y=_,M=_;continue}for(p=_,_==u&&(k[F++]=M,_=y);_>h;)k[F++]=S[_],_=A[_];M=S[_]&255,k[F++]=M,u<a&&(A[u]=y,S[u]=M,u++,(u&f)===0&&u<a&&(g++,f+=u)),y=p}F--,E[j++]=k[F],x++}for(x=j;x<s;x++)E[x]=0;return E};return Ud.lzw=t,Ud}var w4;function QN(){if(w4)return oc;w4=1,Object.defineProperty(oc,"__esModule",{value:!0}),oc.decompressFrames=oc.decompressFrame=oc.parseGIF=void 0;var t=a(XN()),e=J7(),n=e_(),r=KN(),i=ZN();function a(f){return f&&f.__esModule?f:{default:f}}var o=function(g){var v=new Uint8Array(g);return(0,e.parse)((0,n.buildStream)(v),t.default)};oc.parseGIF=o;var s=function(g){for(var v=g.pixels.length,p=new Uint8ClampedArray(v*4),y=0;y<v;y++){var _=y*4,x=g.pixels[y],b=g.colorTable[x]||[0,0,0];p[_]=b[0],p[_+1]=b[1],p[_+2]=b[2],p[_+3]=x!==g.transparentIndex?255:0}return p},u=function(g,v,p){if(!g.image){console.warn("gif frame does not have associated image.");return}var y=g.image,_=y.descriptor.width*y.descriptor.height,x=(0,i.lzw)(y.data.minCodeSize,y.data.blocks,_);y.descriptor.lct.interlaced&&(x=(0,r.deinterlace)(x,y.descriptor.width));var b={pixels:x,dims:{top:g.image.descriptor.top,left:g.image.descriptor.left,width:g.image.descriptor.width,height:g.image.descriptor.height}};return y.descriptor.lct&&y.descriptor.lct.exists?b.colorTable=y.lct:b.colorTable=v,g.gce&&(b.delay=(g.gce.delay||10)*10,b.disposalType=g.gce.extras.disposal,g.gce.extras.transparentColorGiven&&(b.transparentIndex=g.gce.transparentColorIndex)),p&&(b.patch=s(b)),b};oc.decompressFrame=u;var h=function(g,v){return g.frames.filter(function(p){return p.image}).map(function(p){return u(p,g.gct,v)})};return oc.decompressFrames=h,oc}var _4=QN();function pv(t,e,n){const r=e.getContext("2d"),i=n.getContext("2d");if(!r||!i)return;t.disposalType===2&&r.clearRect(0,0,e.width,e.height),n.width=t.width,n.height=t.height;const a=i.createImageData(t.width,t.height);a.data.set(t.patch),i.putImageData(a,0,0),r.drawImage(n,t.left,t.top)}const JN=ri(({element:t})=>{const e=Math.min(30,t.width/4,t.height/4),n=se.useRef(null);return se.useEffect(()=>{const r=n.current;if(!r)return;const i=new sn.Animation(a=>{r.rotate((a?.timeDiff||0)/2)},r.getLayer());return i.start(),()=>{i.stop()}},[]),se.createElement(br,{x:t.a.x,y:t.a.y,rotation:t.a.rotation,listening:!1,opacity:t.a.opacity,hideInExport:!t.showInExport},se.createElement(Tr,{width:t.width,height:t.height,fill:"rgba(124, 173, 212, 0.8)"}),se.createElement(ty,{ref:n,x:t.width/2,y:t.height/2,fill:"white",outerRadius:Math.abs(e),innerRadius:Math.max(1,e-5),angle:270}))}),eT=ri(({element:t})=>{const e=Math.max(10,Math.min(30,t.width/22));return se.createElement(br,{x:t.a.x,y:t.a.y,rotation:t.a.rotation,listening:!1,opacity:t.a.opacity,hideInExport:!t.showInExport},se.createElement(Tr,{width:t.width,height:t.height,fill:"rgba(223, 102, 102, 0.8)"}),se.createElement(Fu,{text:"Cannot load the GIF...",fontSize:e,width:t.width,height:t.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))}),tT=ri(({element:t,store:e})=>{var n;const[r,i]=se.useState(!1),a=e.selectedShapes.indexOf(t)>=0&&t.selectable,o=se.useRef(null),s=se.useRef(),[u,h,f,g]=(function(F){const[j,T]=se.useState([]),[L,$]=se.useState(0),[q,J]=se.useState("loading"),[ae,ie]=se.useState({width:0,height:0});return se.useEffect(()=>{(async()=>{try{const Z=await fetch(F),te=await Z.arrayBuffer(),V=_4.parseGIF(te),B=_4.decompressFrames(V,!0),D=V.lsd.width,U=V.lsd.height;ie({width:D,height:U});const X=B.map(K=>({patch:new Uint8ClampedArray(K.patch),delay:K.delay,width:K.dims.width,height:K.dims.height,left:K.dims.left,top:K.dims.top,disposalType:K.disposalType})),ee=X.reduce((K,oe)=>K+oe.delay,0);T(X),$(ee),J("loaded")}catch(Z){console.error("Failed to load GIF:",Z),J("failed")}})()},[F]),[j,L,ae,q]})(t.src);up(g,t.src,t.id),se.useEffect(()=>(s.current=document.createElement("canvas"),()=>{s.current&&sn.Util.releaseCanvas(s.current)}),[]),se.useEffect(()=>{if(g==="loaded"&&s.current&&(s.current.width=f.width,s.current.height=f.height,u.length>0)){const F=s.current.getContext("2d");if(F){F.clearRect(0,0,f.width,f.height);const j=document.createElement("canvas");pv(u[0],s.current,j)}}},[f,g,u]),se.useEffect(()=>{if(!u.length||!s.current)return;const F=s.current;F.width=f.width,F.height=f.height;const j=document.createElement("canvas"),T=F.getContext("2d");T&&T.clearRect(0,0,F.width,F.height);let L=-1;pv(u[0],F,j),A(),L=0;const $=q=>{const J=(ae=>{const ie=ae%h;let Z=0;for(let te=0;te<u.length;te++)if(Z+=u[te].delay,Z>ie)return te;return 0})(q);J!==L&&(pv(u[J],F,j),A(),o.current.getLayer().draw(),L=J)};if(e.isPlaying||t.page._exportingOrRendering)return zu(()=>{$(e.currentTime-t.page.startTime)});{const q=window.setInterval(()=>{$(e.currentTime||performance.now())},16);return()=>{clearInterval(q)}}},[e.isPlaying,u,h,t.page._exportingOrRendering]),se.useEffect(()=>{h&&e.history.ignore(()=>{t.set({duration:h})})},[h]);let{cropX:v,cropY:p,cropWidth:y,cropHeight:_}=t;g!=="loaded"&&(v=p=0,y=_=1);const x={x:f.width*v,y:f.height*p,width:f.width*y,height:f.height*_},b=(n=t.cornerRadius)!==null&&n!==void 0?n:0,[E,A]=K7(t,s.current,x,e._elementsPixelRatio,b,r||t._cropModeEnabled);se.useLayoutEffect(()=>{if(!r&&!t._cropModeEnabled&&o.current)return Ms(o.current,t),zu(()=>{Ms(o.current,t)},{delay:100})},[s.current,r,y,_,t._cropModeEnabled,f.width,f.height]);const S=g==="loading",k=g==="failed",I=S||k?0:t.a.opacity;Mp(o,I);const O=t.selectable||e.role==="admin",M=Lf();return se.createElement(se.Fragment,null,S&&se.createElement(JN,{element:t}),k&&se.createElement(eT,{element:t}),se.createElement(Tu,{ref:o,name:"element",id:t.id,image:E,x:t.a.x,y:t.a.y,width:t.a.width||1,height:t.a.height||1,rotation:t.a.rotation,opacity:I,shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur,shadowOffsetX:t.shadowOffsetX,shadowOffsetY:t.shadowOffsetY,shadowColor:t.shadowColor,shadowOpacity:t.shadowOpacity,customCrop:x,listening:O,draggable:M?t.draggable&&a:t.draggable,preventDefault:!M||a,hideInExport:!t.showInExport,onDragMove:F=>{t.set({x:F.target.x(),y:F.target.y()})},onDragEnd:F=>{t.set({x:F.target.x(),y:F.target.y()})},onTransformStart:()=>i(!0),onTransform:F=>{const j=F.currentTarget,T=Math.abs(j.scaleX()-1)<1e-7?1:j.scaleX(),L=Math.abs(j.scaleY()-1)<1e-7?1:j.scaleY();j.scaleX(1),j.scaleY(1),t.set({x:j.x(),y:j.y(),width:j.width()*T,height:j.height()*L,rotation:j.rotation()})},onTransformEnd:()=>i(!1)}),se.createElement(Tr,{x:t.a.x,y:t.a.y,width:Math.max(t.a.width-t.borderSize,0),height:Math.max(t.a.height-t.borderSize,0),opacity:I,offsetX:-t.borderSize/2,offsetY:-t.borderSize/2,stroke:t.borderColor,strokeWidth:t.borderSize,listening:!1,visible:!!t.borderSize,rotation:t.rotation,cornerRadius:Math.max(0,b-t.borderSize),hideInExport:!t.showInExport}))}),nT={stroke:"rgb(0, 161, 255)",strokeWidth:2},rT=ri(({element:t})=>se.createElement(Tr,Object.assign({name:"highlighter",x:t.a.x,y:t.a.y,rotation:t.a.rotation,width:t.a.width,height:t.a.height,listening:!1,strokeScaleEnabled:!1},nT)));let Cl=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,n)=>(n&=63,n<36?e+=n.toString(36):n<62?e+=(n-26).toString(36).toUpperCase():n>62?e+="-":e+="_",e),"");const cp=function(t,e){if(t===e)return!0;if(typeof t=="object"&&t!=null&&typeof e=="object"&&e!=null){if(Object.keys(t).length!=Object.keys(e).length)return!1;for(var n in t)if(!e.hasOwnProperty(n)||!cp(t[n],e[n]))return!1;return!0}return!1};Object.assign(Zt);const iT=Zt.model("UndoManager",{history:Zt.array(Zt.frozen()),undoIdx:-1,targetPath:""}).views(t=>({get canUndo(){return t.undoIdx>0},get canRedo(){return t.undoIdx<t.history.length-1}})).actions(t=>{let e,n,r=!1,i=null,a=0,o=0;const s=()=>o>0;function u(){const f=Ru(e);return{pages:f.pages,width:f.width,height:f.height,custom:f.custom,audios:f.audios}}function h(f){const g=e.pages.map(_=>_.id),v=f.pages.map(_=>_.id),p=!cp(g,v),y=!cp(e.custom,f.custom);p?ym(e.pages,f.pages):e.pages.forEach((_,x)=>{ym(_,f.pages[x])}),y&&e.set({custom:f.custom}),e.setSize(f.width,f.height)}return{startTransaction(){o++},endTransaction(f){o--,f||this.requestAddState(u())},async ignore(f,g=!1,v=!1){v&&await new Promise(b=>setTimeout(b,10)),a&&t.addUndoState();let p=s();t.startTransaction();let y=o;try{await f()}catch(b){setTimeout(()=>{throw b})}const _=y!==o,x=!_;t.endTransaction(x),g||p||t.replaceState(),_||(clearTimeout(a),a=0)},async transaction(f){await t.ignore(f,!0),this.addUndoState()},requestAddState(f){i=f,a||s()||(r?r=!1:a=setTimeout(()=>{a=0,clearTimeout(a),s()||this.addUndoState()},100))},addUndoState(){if(r)return void(r=!1);const f=t.history[t.undoIdx];!cp(i,f)&&(clearTimeout(a),a=0,t.history.splice(t.undoIdx+1),t.history.push(i),t.undoIdx=t.history.length-1)},afterCreate(){if(e=mO(t,".."),!e)throw new Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment");n=K8(e,()=>{this.requestAddState(u())}),t.history.length===0&&this.requestAddState(u())},clear(){clearTimeout(a),a=0,t.history.splice(0,t.history.length),t.undoIdx=-1,t.addUndoState(u())},beforeDestroy(){n()},undo(){a&&this.addUndoState(),s()?h(t.history[t.undoIdx]):t.canUndo?(t.undoIdx--,r=!0,h(t.history[t.undoIdx])):console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.")},redo(){a&&this.addUndoState(),t.canRedo?(t.undoIdx++,r=!0,h(t.history[t.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){t.history[t.undoIdx]=u()}}});async function R1(t,e){const n=await(await fetch(t)).blob(),r=document.createElement("a"),i=URL.createObjectURL(n);r.href=i,r.download=e,document.body.appendChild(r),r.click(),setTimeout(function(){document.body.removeChild(r),window.URL.revokeObjectURL(i)},0)}let gv=null;function aT(){var t;return!((t=window.jspdf)===null||t===void 0)&&t.jsPDF?Promise.resolve(window.jspdf.jsPDF):gv||(gv=new Promise(e=>{var n=document.createElement("script");n.onload=function(){e(window.jspdf.jsPDF)},n.src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/3.0.1/jspdf.umd.min.js",document.head.appendChild(n)}),gv)}function oT(){return window.GIF?Promise.resolve(window.GIF):new Promise(t=>{var e=document.createElement("script");e.onload=function(){t(window.GIF)},e.src="https://cdnjs.cloudflare.com/ajax/libs/gif.js/0.2.0/gif.js",document.head.appendChild(e)})}async function sT({width:t,height:e}){return new(await oT())({workers:4,width:t,height:e,workerScript:URL.createObjectURL(new Blob([`// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js
323
+ (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]);
324
+ `],{type:"application/javascript"}))})}const lT="https://api.polotno.com",uT=()=>lT+"/api",t_=Kn({value:!1}),n_=Kn({value:"v1"}),cT=()=>n_.value,fT=()=>t_.value,hT=Jn(()=>{t_.value=!0});let Jd=typeof window<"u"?window.location.origin:"";const dT=typeof navigator<"u"&&navigator.userAgent.indexOf("Headless")>-1,pT=typeof navigator<"u"&&navigator.userAgent.indexOf("Electron")>-1;Jd==="file://"&&dT&&(Jd="headless"),Jd==="file://"&&pT&&(Jd="electron");const gT=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${Jd}" here: https://polotno.com/cabinet`;let vT=fetch;async function mT(t){for(let e=0;e<5;e++)try{const n=await vT(uT()+"/validate-key",{method:"POST",body:JSON.stringify({key:t,site:location.host,skdVersion:"2.29.2"})});if(pc(()=>{n_.value=n.headers.get("x-api-version")}),!t)return console.warn("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"),!1;if(n.status!==200){await new Promise(i=>setTimeout(i,3e3));continue}const r=await n.json();return r.is_valid||console.warn("Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet"),r.is_paid||console.log("%cPolotno Free Version. For development usage only. https://polotno.com/","background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),r.is_domain_valid||console.log(gT,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),oO(r.remove_background_enabled),r.is_paid||!1}catch{await new Promise(r=>setTimeout(r,3e3))}return console.error("Can not validate Polotno API key. Please report to anton@polotno.com immediately."),!0}async function yT(t,e){await mT(t)&&!e||hT()}const J0=({px:t,unit:e="px",dpi:n})=>{switch(e){case"pt":default:return t;case"mm":return t/(n/25.4);case"cm":return t/(n/2.54);case"in":return t/n}},x4=({px:t,precious:e=2,dpi:n=72,unit:r="px"})=>parseFloat(J0({px:t,dpi:n,unit:r}).toFixed(e)),S4=({unitVal:t,dpi:e,unit:n})=>t/J0({px:1,unit:n,dpi:e}),bT=t=>{const e=parseFloat(J0(t).toFixed(1));switch(t.unit){case"pt":return`${Math.round(e)}pt`;case"mm":return`${e}mm`;case"cm":return`${e}cm`;case"in":return`${e}in`;default:return`${Math.round(e)}px`}};async function wT(t){for(let e=0;e<30;e++){const n=await t();if(n)return n;await new Promise(r=>setTimeout(r,50))}}function Fp(t){return new Promise((e,n)=>{const r=document.createElement("img");r.onload=()=>{e(r)},r.onerror=i=>{n(i)},r.crossOrigin="anonymous",r.src=t})}async function _T(t,e){const n=await Fp(t),r=document.createElement("canvas");r.width=2*n.width,r.height=2*n.height,r.getContext("2d").drawImage(n,0,0,r.width,r.height);const i=document.createElement("canvas");i.width=e.width,i.height=e.height;const a=i.getContext("2d");let{cropX:o,cropY:s}=e;const u=r.width*e.cropWidth,h=r.height*e.cropHeight,f=e.width/e.height;let g,v;const p=u/h;return e.type==="svg"?(g=u,v=h):f>=p?(g=u,v=u/f):(g=h*f,v=h),a.drawImage(r,o*r.width,s*r.height,g,v,0,0,i.width,i.height),i.toDataURL("image/png")}function r_(t,e){const{width:n,height:r}=t,i=n/r;let a,o;i>=e.width/e.height?(a=e.width,o=e.width/i):(a=e.height*i,o=e.height);const s=(e.width-a)/2,u=(e.height-o)/2;return{cropX:s/e.width,cropY:u/e.height,cropWidth:a/e.width,cropHeight:o/e.height}}var el;(function(t){t.sepia="sepia",t.grayscale="grayscale",t.natural="natural",t.warm="warm",t.cold="cold",t.temperature="temperature",t.contrast="contrast",t.shadows="shadows",t.white="white",t.black="black",t.vibrance="vibrance",t.saturation="saturation"})(el||(el={}));function i_(t,e){let n={filter:"",html:void 0};switch(t){case el.warm:{const r=Math.max(0,Math.min(1,e??.5)),i=1+.3*r,a=1+.15*r,o=1;return n.filter="url(#warm-filter)",n.html=`
325
+ <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
326
+ <filter id="warm-filter" color-interpolation-filters="sRGB">
327
+ <feColorMatrix type="matrix" values="
328
+ ${i} 0 0 0 0
329
+ 0 ${a} 0 0 0
330
+ 0 0 ${o} 0 0
331
+ 0 0 0 1 0" />
332
+ </filter>
333
+ </svg>`,n}case el.cold:{const r=Math.max(0,Math.min(1,e??.5)),i=1-.15*r,a=1-.1*r,o=1+.15*r;return n.filter="url(#cold-filter)",n.html=`
334
+ <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
335
+ <filter id="cold-filter" color-interpolation-filters="sRGB">
336
+ <feColorMatrix type="matrix" values="
337
+ ${i} 0 0 0 0
338
+ 0 ${a} 0 0 0
339
+ 0 0 ${o} 0 0
340
+ 0 0 0 1 0" />
341
+ </filter>
342
+ </svg>`,n}case"natural":{const r=Math.max(0,Math.min(1,e??.5)),i=1+.1*r,a=1+.3*r,o=1+.2*r;return n.filter=`saturate(${a}) brightness(${i}) contrast(${o})`,n}case el.temperature:{const r=Math.max(-1,Math.min(1,e??0)),i=1+.15*r,a=1,o=1-.15*r;return n.filter="url(#temperature-filter)",n.html=`
343
+ <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
344
+ <filter id="temperature-filter" color-interpolation-filters="sRGB">
345
+ <feColorMatrix type="matrix" values="
346
+ ${i} 0 0 0 0
347
+ 0 ${a} 0 0 0
348
+ 0 0 ${o} 0 0
349
+ 0 0 0 1 0" />
350
+ </filter>
351
+ </svg>
352
+ `,n}case el.contrast:{const r=100*Math.max(-1,Math.min(1,e??0)),i=259*(r+255)/(255*(259-r)),a=.5*(1-i);return n.filter="url(#contrast-filter)",n.html=`
353
+ <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
354
+ <filter id="contrast-filter" color-interpolation-filters="sRGB">
355
+ <feComponentTransfer>
356
+ <feFuncR type="linear" slope="${i}" intercept="${a}" />
357
+ <feFuncG type="linear" slope="${i}" intercept="${a}" />
358
+ <feFuncB type="linear" slope="${i}" intercept="${a}" />
359
+ </feComponentTransfer>
360
+ </filter>
361
+ </svg>
362
+ `,n}case el.shadows:{const r=Math.max(-1,Math.min(1,e??0)),i=Math.min(Math.max(1-.6*r,.4),2.5);return n.filter="url(#shadows-filter)",n.html=`
363
+ <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
364
+ <filter id="shadows-filter" color-interpolation-filters="sRGB">
365
+ <feComponentTransfer>
366
+ <feFuncR type="gamma" amplitude="1" exponent="${i}" offset="0" />
367
+ <feFuncG type="gamma" amplitude="1" exponent="${i}" offset="0" />
368
+ <feFuncB type="gamma" amplitude="1" exponent="${i}" offset="0" />
369
+ </feComponentTransfer>
370
+ </filter>
371
+ </svg>
372
+ `,n}case el.white:case el.black:return null;case el.vibrance:{const r=Math.max(-1,Math.min(1,e??0)),i=.299,a=.587,o=.114;let s;s=r>=0?1+1.5*r:1+r;const u=1-s,h=u*i+s,f=u*a,g=u*o,v=u*i,p=u*a+s,y=u*o,_=u*i,x=u*a,b=u*o+s;return n.filter="url(#vibrance-filter)",n.html=`
373
+ <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
374
+ <filter id="vibrance-filter" color-interpolation-filters="sRGB">
375
+ <feColorMatrix type="matrix" values="
376
+ ${h} ${f} ${g} 0 0
377
+ ${v} ${p} ${y} 0 0
378
+ ${_} ${x} ${b} 0 0
379
+ 0 0 0 1 0" />
380
+ </filter>
381
+ </svg>
382
+ `,n}case el.saturation:{const o=1+Math.max(-1,Math.min(1,e??0)),s=1-o,u=s*.2126+o,h=s*.7152,f=s*.0722,g=s*.2126,v=s*.7152+o,p=s*.0722,y=s*.2126,_=s*.7152,x=s*.0722+o;return n.filter="url(#saturation-filter)",n.html=`
383
+ <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
384
+ <filter id="saturation-filter" color-interpolation-filters="sRGB">
385
+ <feColorMatrix type="matrix" values="
386
+ ${u} ${h} ${f} 0 0
387
+ ${g} ${v} ${p} 0 0
388
+ ${y} ${_} ${x} 0 0
389
+ 0 0 0 1 0" />
390
+ </filter>
391
+ </svg>
392
+ `,n}default:return null}}async function xT(t){return new Promise((e,n)=>{const r=document.createElement("video");r.crossOrigin="anonymous",r.src=t,r.addEventListener("loadedmetadata",()=>{const{videoWidth:i,videoHeight:a}=r;e({width:i,height:a})}),r.addEventListener("error",i=>{const a=t.slice(0,100);n(new Error(`Failed to load video: ${a}`))})})}var ST=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const Mi=(t,e,...n)=>({type:t,props:e,children:n||[]}),Q1=async({element:t,page:e,store:n})=>{let{src:r}=t;if(t.type==="svg"&&Object.keys(t.colorsReplace).length){const S=await Dp(r);r=cy(S,new Map(Object.entries(t.colorsReplace)))}let i="";t.flipX&&(i+="scaleX(-1)"),t.flipY&&(i+="scaleY(-1)"),i||(i="none");const a={};if(t.type==="svg"&&t.maskSrc){const S=await G3(r);a["mask-image"]=`url(${S})`,a["mask-size"]="100% 100%",a["mask-position"]="0 0",a["mask-repeat"]="no-repeat",a["-webkit-mask-image"]=`url(${S})`,a["-webkit-mask-size"]="100% 100%",a["-webkit-mask-position"]="0 0",a["-webkit-mask-repeat"]="no-repeat",r=t.maskSrc}else if(t.clipSrc){const S=t.clipSrc,k=await G3(S);a["mask-image"]=`url(${k})`,a["mask-size"]="100% 100%",a["mask-position"]="0 0",a["mask-repeat"]="no-repeat",a["-webkit-mask-image"]=`url(${k})`,a["-webkit-mask-size"]="100% 100%",a["-webkit-mask-position"]="0 0",a["-webkit-mask-repeat"]="no-repeat"}const o=await Fp(r),s=o.width*t.cropWidth,u=o.height*t.cropHeight,h=t.width/t.height;let f,g;const v=s/u;t.type==="svg"||t.stretchEnabled?(f=s,g=u):h>=v?(f=s,g=s/h):(f=u*h,g=u);const p=f/o.width,y=g/o.height,_=f/g>t.width/t.height?t.height/g:t.width/f,x=f*_/p,b=g*_/y,E=t.cropX*_*o.width,A=t.cropY*_*o.height;return Mi("div",{style:Object.assign(Object.assign({},a),{width:"100%",height:"100%",borderRadius:t.cornerRadius+"px",border:t.borderSize?`${t.borderSize}px solid ${t.borderColor}`:"none",backgroundRepeat:"no-repeat",backgroundImage:`url(${r})`,transform:i,backgroundSize:`${Math.round(x)}px ${Math.round(b)}px`,backgroundPositionX:-Math.round(E)+"px",backgroundPositionY:-Math.round(A)+"px"})})},E4=({element:t,type:e})=>{const n={"stroke-width":t.height,stroke:t.color,"line-cap":"round","stroke-linejoin":"round",opacity:t.opacity};return e==="arrow"||e==="triangle"?Mi("polyline",Object.assign({points:`${3*t.height},${2*-t.height} 0,0 ${3*t.height},${2*t.height}`},n)):e==="bar"?Mi("polyline",Object.assign({points:`0,${2*-t.height} 0,${2*t.height}`},n)):e==="circle"?Mi("circle",Object.assign({r:t.height},n)):e==="square"?Mi("polyline",Object.assign({points:`${-t.height},${-t.height} ${-t.height},${t.height} ${t.height},${t.height} ${t.height},${-t.height}`},n)):null},ET={image:Q1,svg:Q1,text:async({element:t,page:e,store:n})=>{if(t.curveEnabled){const v=fh(t.width,t.height,t.curvePower,t.fontSize),p=rs(t.text).replace(/\n/g," "),y=`
393
+ <svg xmlns="http://www.w3.org/2000/svg" width="${t.width}" height="${t.height}" style="display: block;">
394
+ <defs><path id="curve-${t.id}" d="${v}" fill="none" /></defs>
395
+ <text
396
+ font-family="'${t.fontFamily}'"
397
+ font-size="${t.fontSize}"
398
+ font-weight="${t.fontWeight}"
399
+ font-style="${t.fontStyle}"
400
+ fill="${t.fill}"
401
+ text-anchor="middle"
402
+ dominant-baseline="central"
403
+ letter-spacing="${t.letterSpacing}em"${t.strokeWidth?` stroke="${t.stroke}" stroke-width="${t.strokeWidth}" paint-order="stroke fill"`:""}>
404
+ <textPath href="#curve-${t.id}" startOffset="50%">
405
+ ${p}
406
+ </textPath>
407
+ </text>
408
+ </svg>`;return Mi("div",{style:{width:"100%",height:"100%"},innerHTML:y})}let r={top:0,left:0};t.fill.indexOf("gradient")>=0&&(r=Object.assign(Object.assign({},r),{backgroundColor:t.fill,backgroundImage:t.fill,backgroundSize:"100% 100%",backgroundRepeat:"repeat",backgroundClip:"text",WebkitBackgroundClip:"text",MozBackgroundClip:"text",WebkitTextFillColor:"transparent",MozTextFillColor:"transparent"}));const i=t.backgroundPadding*(t.fontSize*t.lineHeight),a=Mi("div",{style:{position:"absolute",top:-i/2+"px",left:-i/2+"px",display:t.backgroundEnabled?"block":"none",width:t.width+i+"px",height:t.height+i+"px",backgroundColor:t.backgroundColor,borderRadius:t.backgroundCornerRadius*(t.fontSize*t.lineHeight*.5)+"px"}});t.verticalAlign==="middle"?(r.top="50%",r.transform="translateY(-50%)"):t.verticalAlign==="bottom"&&(r.bottom=0);const o=/<[a-z][\s\S]*>/i.test(t.text),s=Object.assign(Object.assign({},r),{position:"absolute",width:t.width+"px",color:t.fill,whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:t.fontSize+"px",textAlign:t.align,fontFamily:`'${t.fontFamily}'`,textDecoration:t.textDecoration||"none",textDecorationColor:t.textDecoration?t.fill:void 0,textTransform:t.textTransform||"none",lineHeight:t.lineHeight,letterSpacing:t.letterSpacing*t.fontSize+"px",fontStyle:t.fontStyle,fontWeight:t.fontWeight,WebkitTextStroke:`${t.strokeWidth}px ${t.stroke}`,textStroke:`${t.strokeWidth}px ${t.stroke}`,paintOrder:t.strokeWidth?"stroke fill":void 0}),u="el-"+t.id,h=o?{id:u}:{},f=`<style>#${u} {${Z0}}</style>`,g=Mi("div",Object.assign(Object.assign({style:s},h),{innerHTML:o?`${f}${t.text}`:t.text.split(`
409
+ `).join("<br />")}));return Mi("div",{style:{position:"relative",width:"100%",height:"100%"}},a,g)},line:async({element:t,page:e,store:n})=>Mi("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},Mi("rect",{x:0,y:0,width:t.width,height:t.height,fill:t.color}),Mi("g",{transform:`translate(0 ${t.height/2})`},E4({element:t,type:t.startHead})),Mi("g",{transform:`translate(${t.width} ${t.height/2}) rotate(180)`},E4({element:t,type:t.endHead}))),figure:async({element:t,page:e,store:n,elementHook:r})=>{const i=Q7(t),a=Mi("div",{innerHTML:i});return r&&r({dom:a,element:t})||a},group:async({element:t,page:e,store:n,elementHook:r})=>{const i=await Promise.all(t.children.map(o=>a_({element:o,page:e,store:n,elementHook:r}))),a=Mi("div",{style:{transformOrigin:"top left",opacity:t.opacity}},...i);return r&&r({dom:a,element:t})||a},video:async({element:t,page:e,store:n,elementHook:r})=>{const{cropX:i,cropY:a,cropWidth:o,cropHeight:s}=t,u=await xT(t.src),h=u.width*o,f=u.height*s,g=t.width/t.height;let v,p;g>=h/f?(v=h,p=h/g):(v=f*g,p=f);const y=v/o,_=p/s,x=i*u.width,b=a*u.height,E=Math.max(t.width/u.width,t.height/u.height),A={position:"absolute",width:`${Math.round(y*E)}px`,height:`${Math.round(_*E)}px`,left:-Math.round(x*E)+"px",top:-Math.round(b*E)+"px",objectFit:"fill"},S=`video-${t.id}`,k=Mi("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",borderRadius:t.cornerRadius+"px",border:t.borderSize?`${t.borderSize}px solid ${t.borderColor}`:"none"}},Mi("video",{id:S,src:t.src,style:A,controls:!0,playsInline:!0,muted:!0,volume:t.volume}));return r&&r({dom:k,element:t})||k},gif:Q1};async function a_({element:t,page:e,store:n,elementHook:r}){let i=await ET[t.type];if(i||(i=()=>Mi("div",{}),console.error(`HTML export does not support ${t.type} type...`)),!t.visible)return null;const a=await i({element:t,page:e,store:n}),o=[],s=[];if(t.blurEnabled&&o.push(`blur(${t.blurRadius/2}px)`),t.brightnessEnabled&&o.push(`brightness(${100*t.brightness+100}%)`),t.sepiaEnabled&&o.push("sepia()"),t.grayscaleEnabled&&o.push("grayscale()"),t.filters)for(const[h,f]of Object.entries(t.filters)){const g=i_(el[h],f.intensity);g&&(o.push(g.filter),g.html&&s.push(g.html))}t.shadowEnabled&&o.push(`drop-shadow(${t.shadowOffsetX}px ${t.shadowOffsetY}px ${t.shadowBlur}px ${t.shadowColor})`);const u=Mi("div",{id:t.id,style:{position:"absolute",left:t.x+"px",top:t.y+"px",width:t.width+"px",height:t.height+"px",transform:`rotate(${t.rotation}deg)`,transformOrigin:"top left",opacity:t.opacity,display:t.visible&&t.showInExport?"block":"none",filter:o.join(" ")||"none"}},a,...s);return r&&r({dom:u,element:t})||u}async function kT({json:t,elementHook:e}){const n=await Promise.all(t.pages.map(a=>(async function({page:o,store:s,elementHook:u}){const h=await Promise.all(o.children.map(p=>a_({element:p,page:o,store:s,elementHook:u}))),f=o.width==="auto"?s.width:o.width,g=o.height==="auto"?s.height:o.height;let v={};if(o.background.indexOf("url")>=0||o.background.indexOf("http")>=0||o.background.indexOf(".jpg")>=0||o.background.indexOf(".png")>=0||o.background.indexOf(".jpeg")>=0){const{width:p,height:y}=await Fp(o.background),_=await Q1({element:Object.assign({x:0,y:0,width:f,height:g,src:o.background,cornerRadius:0},r_({width:f,height:g},{width:p,height:y})),page:o,store:s});h.unshift(_)}else v=Object.assign(Object.assign({},v),{backgroundColor:o.background});return Mi("div",{className:"page",id:o.id,style:Object.assign(Object.assign({},v),{width:f+"px",height:g+"px",overflow:"hidden",position:"relative"})},...h)})({page:a,store:t,elementHook:e}))),r=[];t.pages.forEach(a=>{a.children.forEach(o=>{o.type==="text"&&r.indexOf(o.fontFamily)===-1&&r.push(o.fontFamily)})});const i=r.map(a=>t.fonts.find(o=>o.fontFamily===a)?Mi("style",{},""):Mi("link",{href:$8(a),rel:"stylesheet"}));return Mi("div",{className:"design"},...i,...n)}const o_=({dom:t})=>{if(typeof t=="string")return t;if(!t)return"";const e=t.props,{innerHTML:n}=e,r=ST(e,["innerHTML"]),i=Object.keys(r).map(a=>a==="style"&&typeof r[a]=="object"?`style="${Object.keys(r[a]).map(o=>`${o.replace(/[A-Z]/g,s=>`-${s.toLowerCase()}`)}: ${r[a][o]}`).join("; ")}"`:((o,s)=>typeof s=="object"?`${o}="${Object.keys(s).map(u=>`${u.replace(/-([a-z])/g,h=>h[1].toUpperCase())}:${s[u]};`).join(" ")}"`:`${o}="${s}"`)(a,r[a])).join(" ");return`<${t.type} ${i}>${n||t.children.map(a=>o_({dom:a})).join("")}</${t.type}>`};async function AT({json:t,elementHook:e}){const n=await kT({json:t,elementHook:e});return o_({dom:n})}var PT=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const s_=(t,e)=>{if(t.children)for(const n of t.children){if(e(n)===!0)break;s_(n,e)}},Dn=(t,e,...n)=>({type:t,props:e,children:n||[]}),vv=async t=>{try{const e=await fetch(t);if(typeof Buffer<"u"){const n=await e.arrayBuffer(),r=Buffer.from(n).toString("base64");return`data:${e.headers.get("content-type")||"image/png"};base64,${r}`}{const n=await e.blob();return new Promise((r,i)=>{const a=new FileReader;a.onloadend=()=>r(a.result),a.onerror=i,a.readAsDataURL(n)})}}catch(e){return console.error("Error converting URL to data URL:",e),t}},mv=async({element:t,page:e,store:n})=>{let{src:r}=t;if(t.type==="svg"){const ie=await Dp(r);r=cy(ie,new Map(Object.entries(t.colorsReplace)))}else r=await vv(r);let i,a,o,s,u="";t.flipX&&(u+="scaleX(-1)"),t.flipY&&(u+="scaleY(-1)"),t.clipSrc&&(i=`clip-img-mask-${t.id}`,a=await vv(t.clipSrc)),t.maskSrc&&(o=`mask-img-${t.id}`,s=await vv(t.maskSrc));const h=await Fp(r),f=h.width*t.cropWidth,g=h.height*t.cropHeight,v=t.width/t.height;let p,y;const _=f/g;typeof t.stretchEnabled=="boolean"&&t.stretchEnabled||t.type==="svg"?(p=f,y=g):v>=_?(p=f,y=f/v):(p=g*v,y=g);const x=p/h.width,b=y/h.height,E=p/y>t.width/t.height?t.height/y:t.width/p,A=p*E/x,S=y*E/b,k=t.cropX*h.width*E,I=t.cropY*h.height*E,O=`clip-${t.id}`,M=t.cornerRadius||0,F=r.replace(/&/g,"&amp;"),j={x:-k,y:-I,width:A,height:S,preserveAspectRatio:"none","clip-path":`url(#${O})`},T=[Dn("clipPath",{id:O},Dn("rect",{x:0,y:0,width:t.width,height:t.height,rx:M||void 0,ry:M||void 0}))];i&&a&&T.push(Dn("mask",{id:i,maskUnits:"userSpaceOnUse","mask-type":"alpha"},Dn("image",{href:a.replace(/&/g,"&amp;"),x:0,y:0,width:t.width,height:t.height,preserveAspectRatio:"none"}))),o&&T.push(Dn("mask",{id:o,maskUnits:"userSpaceOnUse","mask-type":"alpha"},Dn("image",Object.assign({href:F},j))));let L=F;const $={};o&&s&&(L=s.replace(/&/g,"&amp;"),$.mask=`url(#${o})`);const q={style:{transform:u}};i&&(q.mask=`url(#${i})`);const J=t.borderSize||0,ae=J>0?Dn("rect",{x:J/2,y:J/2,width:Math.max(0,t.width-J),height:Math.max(0,t.height-J),fill:"none",stroke:t.borderColor,"stroke-width":J,rx:Math.max(0,M-J)||void 0,ry:Math.max(0,M-J)||void 0}):null;return Dn("g",q,Dn("defs",{},...T),Dn("image",Object.assign(Object.assign({href:L},j),$)),ae)},k4=({element:t,type:e})=>{const n={"stroke-width":t.height,stroke:t.color,"line-cap":"round","stroke-linejoin":"round",fill:t.color};return e==="arrow"?Dn("polyline",Object.assign({points:`${3*t.height},${2*-t.height} 0,0 ${3*t.height},${2*t.height}`},n)):e==="triangle"?Dn("polygon",Object.assign({points:`${3*t.height},${2*-t.height} 0,0 ${3*t.height},${2*t.height}`},n)):e==="bar"?Dn("polyline",Object.assign({points:`0,${2*-t.height} 0,${2*t.height}`},n)):e==="circle"?Dn("circle",Object.assign({cx:2*t.height,cy:0,r:2*t.height},n)):e==="square"?Dn("polygon",Object.assign({points:`0,${2*-t.height} ${4*t.height},${2*-t.height} ${4*t.height},${2*t.height} 0,${2*t.height}`},n)):null},OT={image:mv,svg:mv,text:async({element:t,page:e,store:n})=>{if(t.curveEnabled){const p=fh(t.width,t.height,t.curvePower,t.fontSize),y=`curve-path-${t.id}`,_=rs(t.text).replace(/\n/g," ");return Dn("g",{},Dn("defs",{},Dn("path",{id:y,d:p,fill:"none"})),Dn("text",{fill:t.fill,"font-size":t.fontSize+"px","text-anchor":"middle","dominant-baseline":"central","font-family":t.fontFamily,"font-style":t.fontStyle,"font-weight":t.fontWeight,"letter-spacing":t.letterSpacing+"em","stroke-width":t.strokeWidth||void 0,stroke:t.strokeWidth?t.stroke:void 0,"paint-order":t.strokeWidth?"stroke fill":void 0},Dn("textPath",{href:`#${y}`,startOffset:"50%",innerHTML:_})))}const r=(p,y,_,x,b,E=0)=>{const A=document.createElement("canvas").getContext("2d");return A.font=`${b} ${x} ${y}px ${_}`,A.measureText(p).width+Math.max(0,(p?p.length:0)-1)*E*y},i=(p,y,_,x,b,E,A=0)=>{const S=[];return p.split(`
410
+ `).forEach(k=>{const I=k.split(" ");let O="";for(let M=0;M<I.length;M++){const F=O+I[M]+" ";r(F,_,x,b,E,A)>y+.5&&M>0?(S.push(O.trim()),O=I[M]+" "):O=F}S.push(O.trim())}),S};let a=rs(t.text);t.textTransform=="uppercase"&&(a=a.toUpperCase());let o=t.fontSize,s=[];for(;;){s=i(a,t.width,o,t.fontFamily,t.fontWeight,t.fontStyle,t.letterSpacing);const p=Math.max(...s.map(_=>r(_,o,t.fontFamily,t.fontWeight,t.fontStyle,t.letterSpacing))),y=s.length*o*t.lineHeight;if(p<=t.width&&y<=t.height||(o-=1,o<4))break}const u=o*t.lineHeight,h=s.length*u;let f=o;t.verticalAlign==="middle"?f=(t.height-h)/2+o:t.verticalAlign==="bottom"&&(f=t.height-h+o);const g=t.align==="center"?"middle":t.align==="right"?"end":"start",v=s.map((p,y)=>Dn("tspan",{x:t.align==="center"?t.width/2:t.align==="right"?t.width:0,dy:y===0?0:u,innerHTML:p}));return Dn("g",{},Dn("text",{fill:t.fill,y:f,"font-size":o+"px","text-anchor":g,"font-family":t.fontFamily,"font-style":t.fontStyle,"font-weight":t.fontWeight,"text-decoration":t.textDecoration,"line-height":t.lineHeight,"letter-spacing":t.letterSpacing+"em","stroke-width":t.strokeWidth,stroke:t.stroke},...v))},line:async({element:t,page:e,store:n})=>Dn("g",{},Dn("line",{x1:0,y1:t.height/2,x2:t.width,y2:t.height/2,stroke:t.color,"stroke-width":t.height,"stroke-dasharray":t.dash&&t.dash.length?t.dash.map(r=>r*t.height).join(" "):void 0}),Dn("g",{transform:`translate(0 ${t.height/2})`},k4({element:t,type:t.startHead})),Dn("g",{transform:`translate(${t.width} ${t.height/2}) rotate(180)`},k4({element:t,type:t.endHead}))),figure:async({element:t,page:e,store:n,elementHook:r})=>{const i=(function(o){let s=o.replace(/<svg[^>]*>/,"");return s=s.replace(/<\/svg>/,""),s})(Q7(t)),a=Dn("g",{innerHTML:i});return r&&r({dom:a,element:t})||a},group:async({element:t,page:e,store:n,elementHook:r})=>{const i=await Promise.all(t.children.map(o=>l_({element:o,page:e,store:n,elementHook:r}))),a=Dn("g",{style:{"transform-origin":"top left"}},...i);return r&&r({dom:a,element:t})||a},gif:mv};async function l_({element:t,page:e,store:n,elementHook:r}){var i;let a=await OT[t.type];a||(a=()=>Dn("g",{}),console.error(`SVG export does not support ${t.type} type...`));const o=await a({element:t,page:e,store:n}),s=[],u=[];if(t.blurEnabled&&s.push(`blur(${t.blurRadius/2}px)`),t.brightnessEnabled&&s.push(`brightness(${100*t.brightness+100}%)`),t.sepiaEnabled&&s.push("sepia()"),t.grayscaleEnabled&&s.push("grayscale()"),t.shadowEnabled&&s.push(`drop-shadow(${t.shadowOffsetX}px ${t.shadowOffsetY}px ${t.shadowBlur}px ${t.shadowColor})`),t.filters)for(const[f,g]of Object.entries(t.filters)){const v=i_(el[f],g.intensity);if(v&&(s.push(v.filter),v.html)){const p=v.html.replace(/<svg([^>]*)>/,"<g$1>").replace(/<\/svg>/,"</g>");u.push(p)}}const h=Dn("g",{className:"element",id:t.id,transform:t.type!=="group"?`translate(${t.x}, ${t.y}) rotate(${t.rotation})`:void 0,display:(i=t.visible)===null||i===void 0||i?void 0:"none",opacity:t.opacity,style:{"transform-origin":"top left",filter:s.join(" ")}},o,...u);return r&&r({dom:h,element:t})||h}async function A4(t){try{const e=await fetch(t),n=e.headers.get("content-type")||"font/ttf",r=await e.arrayBuffer();return`data:${n};base64,${typeof Buffer<"u"?Buffer.from(r).toString("base64"):(function(i){const a=new Uint8Array(i);let o="";for(let s=0;s<a.length;s+=32768){const u=a.subarray(s,s+32768);o+=String.fromCharCode(...u)}if(typeof btoa<"u")return btoa(o);if(typeof Buffer<"u")return Buffer.from(a).toString("base64");throw new Error("No base64 encoder available in this environment")})(r)}`}catch(e){return console.error("Error embedding font:",e),t}}async function CT({json:t,elementHook:e,fontEmbedding:n="inline"}){const r=[];s_({children:t.pages},o=>{o.type==="text"&&r.indexOf(o.fontFamily)===-1&&r.push(o.fontFamily)});const i=n==="inline"?await(async function(o,s){return await Promise.all(o.map(async u=>{var h,f;if(u==="Arial")return null;const g=s.find(v=>v.fontFamily===u);if(g){W8(g),await Qh(u,"normal","normal"),await Qh(u,"normal","bold"),await Qh(u,"normal","italic"),await Qh(u,"normal","bold-italic");const v=await A4(g.url);return Dn("style",{},`@font-face { font-family: ${u}; src: url(${v}); }`)}{G8(u),await Qh(u,"normal","normal");const v=`https://fonts.googleapis.com/css?family=${u}:bi,normal,i,b`;try{const p=await fetch(v),y=await p.text(),_=(f=(h=y.match(/url\((.*?)\)/g))===null||h===void 0?void 0:h.map(b=>b.replace(/url\((.*?)\)/,"$1")))===null||f===void 0?void 0:f.filter(b=>b.startsWith("https"));if(!_?.length)throw new Error("No font URLs found");const x=await Promise.all(_.map(async b=>{const E=await A4(b),A=y.match(/font-style:\s*(.*?);/),S=y.match(/font-weight:\s*(.*?);/),k=A?A[1]:"normal",I=S?S[1]:"normal";return`@font-face {
411
+ font-family: ${u};
412
+ font-style: ${k};
413
+ font-weight: ${I};
414
+ src: url(${E});
415
+ }`}));return Dn("style",{},x.join(`
416
+ `))}catch(p){return console.error("Error embedding Google Font:",p),Dn("defs",{},Dn("style",{type:"text/css",innerHTML:`@import url('${v}');`.replace(/&/g,"&amp;")}))}}}))})(r,t.fonts):[],a=await Promise.all(t.pages.map(o=>(async function({page:s,store:u,elementHook:h}){const f=await Promise.all(s.children.map(p=>l_({element:p,page:s,store:u,elementHook:h}))),g=s.background.indexOf("url")>=0||s.background.indexOf("http")>=0||s.background.indexOf(".jpg")>=0||s.background.indexOf(".png")>=0||s.background.indexOf(".jpeg")>=0;let v;if(g){const p=await Fp(s.background);v=await _T(s.background,Object.assign({width:u.width,height:u.height,x:0,y:0},r_({width:u.width,height:u.height},{width:p.width,height:p.height})))}return Dn("g",{className:"page",style:{}},g?Dn("image",{"xlink:href":v,x:0,y:0,width:u.width,height:u.height,preserveAspectRatio:"none"}):Dn("rect",{x:0,y:0,width:u.width,height:u.height,fill:g?void 0:s.background}),...f)})({page:o,store:t,elementHook:e})));return Dn("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:`0 0 ${t.width} ${t.height}`,width:t.width,height:t.height},...i,...a)}const u_=({dom:t,nestLevel:e=0})=>{if(typeof t=="string")return t;if(!t)return"";const n=t.props,{innerHTML:r}=n,i=PT(n,["innerHTML"]),a=Object.keys(i).map(s=>((u,h)=>typeof h=="object"?`${u}="${Object.keys(h).map(f=>`${f}:${h[f]};`).join(" ")}"`:h==null||h===""?"":`${u}="${h}"`)(s,i[s])).filter(s=>s&&s.trim().length>0).join(" "),o=" ".repeat(e);return`${o}<${t.type}${a?" "+a:""}>${r||`
417
+ `+t.children.map(s=>u_({dom:s,nestLevel:e+1})).join("")}${o}</${t.type}>
418
+ `};async function LT({json:t,elementHook:e,fontEmbedding:n="inline"}){const r=await CT({json:t,elementHook:e,fontEmbedding:n});return u_({dom:r})}const fp=Zt.model("Page",{id:Zt.identifier,children:Zt.array(Zt.late(()=>m_)),width:Zt.optional(Zt.union(Zt.number,Zt.literal("auto")),"auto"),height:Zt.optional(Zt.union(Zt.number,Zt.literal("auto")),"auto"),background:"white",bleed:0,custom:Zt.frozen(),duration:5e3,_exporting:!1,_rendering:!1,_forceMount:!1}).postProcessSnapshot(t=>{const e=Object.assign({},t),n={};for(var r in e)r[0]!=="_"&&(n[r]=t[r]);return n}).views(t=>({get store(){return Xf(t,ih)}})).views(t=>({get startTime(){let e=0;for(const n of t.store.pages){if(n.id===t.id)return e;e+=n.duration}return e},get _exportingOrRendering(){return t._exporting||t._rendering}})).views(t=>({get computedWidth(){return t.width==="auto"?t.store.width:t.width},get computedHeight(){return t.height==="auto"?t.store.height:t.height}})).actions(t=>({toJSON:()=>JSON.parse(JSON.stringify(Ru(t))),_forEachElementUp(e,n){const r=e.map(i=>({id:i,index:t.children.findIndex(a=>a.id===i)}));r.sort((i,a)=>a.index-i.index);for(const{index:i}of r){if(i==-1)continue;const a=i<t.children.length-1&&t.children[i+1],o=e.indexOf(a?.id)>=0;i===t.children.length-1||o||n(i)}},_forEachElementDown(e,n){const r=e.map(i=>({id:i,index:t.children.findIndex(a=>a.id===i)}));r.sort((i,a)=>i.index-a.index);for(const{index:i}of r){if(i==-1)continue;const a=i>0&&t.children[i-1],o=e.indexOf(a?.id)>=0;i===0||o||n(i)}return!1}})).actions(t=>({clone(e={}){const n=t.toJSON();n.children.forEach(o=>{o.id=Cl(10),Ii(o,s=>{s.id=Cl(10)})});const r=Object.assign(Object.assign(Object.assign({},n),{id:Cl(10)}),e),i=t.store.addPage(r),a=t.store.pages.indexOf(t);return i.setZIndex(a+1),i.select(),i},setZIndex(e){t.store.setPageZIndex(t.id,e)},set(e){Object.assign(t,e)},select(){t.store.selectPage(t.id)},addElement(e,{skipSelect:n=!1}={}){const r=by[e.type];if(!r)return void console.error("Can not find model with type "+e.type);"children"in e&&Array.isArray(e.children)&&Ii(e,o=>{o.id=o.id||Cl(10)});const i=t.children.reduce((o,s)=>{if(s.type==="group"){const u=s.children.reduce((h,f)=>{var g;const v=(g=f.name)===null||g===void 0?void 0:g.match(new RegExp(`${e.type}-(\\d+)`));if(v){const p=parseInt(v[1],10);return Math.max(h,p||0)}},0);return Math.max(o,u||0)}{const u=s.name.match(new RegExp(`${e.type}-(\\d+)`));if(u){const h=parseInt(u[1],10);return Math.max(o,h||0)}}return o},0),a=r.create(Object.assign({id:Cl(10),name:`${e.type}-${i+1}`},e));return t.children.push(a),a.selectable&&!n&&t.store.selectElements([a.id]),a},canMoveElementsUp(e){let n=!1;return t._forEachElementUp(e,()=>{n=n||!0}),n},moveElementsUp(e){t._forEachElementUp(e,n=>{const r=t.children[n];eh(r),t.children.splice(n+1,0,r)})},canMoveElementsTop(e){return this.canMoveElementsUp(e)},moveElementsTop(e){const n=[],r=[];t.children.forEach(i=>{e.indexOf(i.id)>=0?n.push(i):r.push(i)}),t.children.replace(r.concat(n))},canMoveElementsDown(e){let n=!1;return t._forEachElementDown(e,()=>{n=n||!0}),n},moveElementsDown(e){t._forEachElementDown(e,n=>{const r=t.children[n];eh(r),t.children.splice(n-1,0,r)})},canMoveElementsBottom(e){return this.canMoveElementsDown(e)},moveElementsBottom(e){const n=[],r=[];t.children.forEach(i=>{e.indexOf(i.id)>=0?n.push(i):r.push(i)}),t.children.replace(n.concat(r))},setElementZIndex(e,n){const r=t.children.find(i=>i.id===e);r&&(eh(r),t.children.remove(r),t.children.splice(n,0,r))},setSize({width:e,height:n,useMagic:r,softChange:i}){if(r){const a=[],o=I=>I.type==="image"&&I.x<1&&I.y<1&&I.width>=t.computedWidth-2&&I.height>=t.computedHeight-2;Ii(t,I=>{I.type!=="group"&&(o(I)||a.push(I))});const s=a.length?Q0(a):{x:0,y:0,width:t.computedWidth,height:t.computedHeight},u=1/4,h=Math.max(0,Math.min(s.x,t.computedWidth-s.x-s.width)),f=t.computedWidth*u,g=Math.max(0,h-f),v=Math.max(0,Math.min(s.y,t.computedHeight-s.y-s.height)),p=t.computedHeight*u,y=Math.max(0,v-p),_=t.computedWidth-2*g,x=t.computedHeight-2*y,b=e/_,E=n/x,A=Math.min(b,E),S=(e-_*A)/2-g*A,k=(n-x*A)/2-y*A;Ii(t,I=>{I.type!=="group"&&(o(I)?I.set({x:I.x*A,y:I.y*A,width:I.width*b,height:I.height*E,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(I.set({x:S+I.x*A,y:k+I.y*A,width:I.width*A,height:I.height*A}),I.type==="text"?I.set({fontSize:I.fontSize*A}):I.type==="figure"&&I.set({strokeWidth:I.strokeWidth*A})))})}i||(t.width=e),i||(t.height=n)}})).actions(t=>({moveElementUp(e){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),t.moveElementsUp([e])},moveElementDown(e){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),t.moveElementsDown([e])},moveElementTop(e){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),t.moveElementsTop([e])},moveElementBottom(e){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),t.moveElementsBottom([e])},play(){t.store.play({startTime:t.startTime,endTime:t.startTime+t.duration})}})),P4=Zt.model("Audio",{id:Zt.identifier,src:"",duration:0,startTime:0,endTime:1,volume:1,delay:0,custom:Zt.frozen()}).actions(t=>({toJSON:()=>Object.assign({},Ru(t))})).actions(t=>({set(e){Object.assign(t,e)}}));var Hd=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};hO("ignore");const NT=Zt.model("Font",{fontFamily:Zt.string,url:Zt.optional(Zt.string,""),styles:Zt.frozen()}).preProcessSnapshot(t=>Object.assign(Object.assign({},t),{fontFamily:t.fontFamily||t.name})),ih=Zt.model("Store",{role:"",pages:Zt.array(fp),fonts:Zt.array(NT),audios:Zt.array(P4),width:1080,height:1080,currentTime:0,isPlaying:!1,scale:1,scaleToFit:1,unit:"px",dpi:72,schemaVersion:2,bleedVisible:!1,rulesVisible:!1,openedSidePanel:"",previousOpenedSidePanel:"",custom:Zt.frozen(),selectedElementsIds:Zt.array(Zt.string),animatedElementsIds:Zt.array(Zt.string),history:Zt.optional(iT,{targetPath:"../pages"}),_elementsPixelRatio:Math.min(2,typeof window<"u"&&window.devicePixelRatio||1),_activePageId:"",_selectedPagesIds:Zt.array(Zt.string),_forceShowCredit:!1,_key:"",_validated:!1}).views(t=>{const e=gh(()=>{const n={};return Ii({children:t.pages},r=>(n[r.id]=r,!1)),n},{keepAlive:!0});return{get _idsMap(){return e.get()}}}).views(t=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),t.bleedVisible},get selectedElements(){return t.selectedElementsIds.map(e=>{for(const n of t.pages)for(const r of n.children)if(r.id===e)return r}).filter(e=>!!e)},get children(){return t.pages},get selectedShapes(){const e=[];return Ii({children:t.selectedElements},n=>{n.type!=="group"&&e.push(n)}),e},get activePage(){return t.pages.slice().find(e=>e.id===t._activePageId)||(t.pages.length?t.pages[0]:null)},get selectedPages(){return t._selectedPagesIds.map(e=>t.pages.find(n=>n.id===e))},get duration(){let e=0;return t.pages.forEach(n=>{e+=n.duration}),e},get _hasCroppedImages(){return t.find(e=>e.type==="image"&&e._cropModeEnabled)},find(e){let n;return Ii({children:t.pages},r=>{if(!n&&e(r))return n=r,!0}),n},getElementById:e=>t._idsMap[e]})).actions(t=>{let e=0,n=null,r=!1;return{afterCreate(){t.history.canUndo},setCurrentTime(i){t.currentTime=i},_togglePlaying(i=!t.isPlaying){t.isPlaying=i},play({animatedElementsIds:i=[],startTime:a=0,currentTime:o=0,endTime:s=t.duration,repeat:u=!1}={}){o&&(console.warn("currentTime property of store.play() is deprecated. Please use startTime instead."),a=o),t.animatedElementsIds=i,t.currentTime=a,t.isPlaying=!0,e=Date.now(),n=s,r=u,requestAnimationFrame(t.seek)},checkActivePage(){let i=0;for(const a of t.pages){if(t.currentTime>=a.startTime&&t.currentTime<a.startTime+a.duration){t.selectPage(a.id);break}i+=a.duration}},seek(){if(!t.isPlaying)return;const i=Date.now(),a=i-e;e=i,t.currentTime+=a,t.checkActivePage();const o=n||t.duration;t.isPlaying&&t.currentTime<o?requestAnimationFrame(t.seek):t.isPlaying&&r?(t.currentTime=0,requestAnimationFrame(t.seek)):t.stop()},stop(){t.isPlaying=!1,t.currentTime=0,t.animatedElementsIds=[],t.checkActivePage()}}}).actions(t=>({__(){t._validated||(yT(t._key,t._forceShowCredit),t._validated=!0)},set(e){Object.assign(t,e)},setUnit({unit:e,dpi:n}){t.unit=e||t.unit,t.dpi=n||t.dpi},setRole(e){t.role=e},addPage(e){const n=fp.create(Object.assign({id:Cl(10)},e));return t.pages.push(n),t._activePageId=n.id,n},selectPage(e){t._activePageId=e,t._selectedPagesIds.length===1&&(t._selectedPagesIds=[e])},selectPages(e){t._selectedPagesIds=e,t._selectedPagesIds.length===1&&(t._activePageId=t._selectedPagesIds[0])},selectElements(e){const n=e.map(r=>t.getElementById(r)).sort((r,i)=>r.page.children.indexOf(r)-r.page.children.indexOf(i)).filter(r=>!!r).map(r=>r.id);t.selectedElementsIds=n},toggleBleed(e){t.bleedVisible=e??!t.bleedVisible},toggleRulers(e){t.rulesVisible=e??!t.rulesVisible},openSidePanel(e){t.openedSidePanel!==e&&(t.previousOpenedSidePanel=t.openedSidePanel,t.openedSidePanel=e)},setScale(e){t.scale=e},_setScaleToFit(e){t.scaleToFit=e},setElementsPixelRatio(e){t._elementsPixelRatio=e},setSize(e,n,r){t.pages.forEach(i=>{i.setSize({width:e,height:n,useMagic:r,softChange:!0})}),t.width=e,t.height=n},setPageZIndex(e,n){const r=t.pages.find(i=>i.id===e);r&&(eh(r),t.pages.remove(r),t.pages.splice(n,0,r))},deletePages(e){const n=t.pages.indexOf(t.activePage);e.forEach(a=>{const o=t.pages.find(s=>s.id===a);e2(o)});const r=Math.min(t.pages.length-1,n),i=t.pages[r];i&&(t._activePageId=i.id),t.selectedElementsIds=t.selectedElementsIds.filter(a=>t.getElementById(a))},groupElements(e,n={}){const r=e.map(s=>t.getElementById(s)),i=r[0].page;if(r.forEach(s=>{s&&eh(s)}),!r.length)return;const a=i.children.reduce((s,u)=>{if(u.type==="group"){const h=u.name.match(/group-(\d+)/);if(h){const f=parseInt(h[1],10);return Math.max(s,f)}}return s},0),o=Object.assign({id:Cl(10),name:`group-${a+1}`,children:r,type:"group"},n);return i.children.push(o),t.selectedElementsIds=[o.id],i.children.find(s=>s.id===o.id)},ungroupElements(e){const n=e.map(i=>t.getElementById(i)),r=[];n.forEach(i=>{if(i&&i.type==="group"){const a=i.page,o=a.children.indexOf(i);i.children.forEach(s=>{r.push(s.id)}),i.children.forEach(s=>{eh(s),a.children.push(s)}),a.children.splice(o,1)}}),t.selectedElementsIds=r},deleteElements(e){const n=[];t.find(r=>(e.includes(r.id)&&n.push(r),!1)),n.forEach(r=>{e2(r)}),t.selectedElementsIds=t.selectedElementsIds.filter(r=>t.getElementById(r))},on(e,n){if(e==="change"){let r=t.toJSON();return K8(t,i=>{const a=t.toJSON();!cp(r,a)&&(r=a,n(a))})}},async _toCanvas({pixelRatio:e,ignoreBackground:n,pageId:r,mimeType:i,includeBleed:a,_skipTimeout:o,quickMode:s=!1}={}){var u;const h=e||1;r=r||((u=t.pages[0])===null||u===void 0?void 0:u.id);const f=t.pages.find(L=>L.id===r);if(!f)throw new Error(`No page for export with id ${r}`);const g=t._elementsPixelRatio;h>t._elementsPixelRatio&&t.setElementsPixelRatio(h),s?f?.set({_forceMount:!0}):f?.set({_exporting:!0});const v=await wT(()=>{const L=sn.stages.filter($=>$.getAttr("pageId")===r);return L.length===0?null:L});if(!v)throw f?.set({_forceMount:!1,_exporting:!1}),t.setElementsPixelRatio(g),new Error(`Export is failed. Can not find stage for page ${r}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);v.length>1&&console.error(`Polotno error: Detected several canvas elements for page "${r}" in the document. This is not supported and will lead to incorrect export. Make sure to use unique ids for all pages and make sure you unmount <Workspace /> when it is not needed.`);const p=v[0];await t.waitLoading({_skipTimeout:o});const y=p.findOne(".page-container");if(!y)throw t.setElementsPixelRatio(g),f?.set({_forceMount:!1,_exporting:!1}),new Error("Export is failed. Canvas was unmounted.");const _=p.position();p.position({x:0,y:0}),p.find("Transformer").forEach(L=>{L.setAttr("oldVisible",L.visible()),L.visible(!1)}),y.find(".page-background").forEach(L=>L.shadowEnabled(!1)),y.find(".page-background").forEach(L=>L.strokeEnabled(!1)),y.find(".highlighter").forEach(L=>L.visible(!1));const x=y.findOne(".page-background-group"),b=x.clip();x.clip({x:null,y:null,width:null,height:null});const E=y.findOne(".elements-container"),A=E.clip();E.clip({x:null,y:null,width:null,height:null});const S=y.find(L=>!L.visible()&&L.getAttr("editModeEnabled")&&!L.getAttr("hideInExport"));S.forEach(L=>{L.setAttr("oldVisible",L.visible()),L.show()});const k=y.find(L=>L.getAttr("hideInExport"));k.forEach(L=>{L.setAttr("oldVisible",L.visible()),L.hide()}),n&&y.find(".page-background").forEach(L=>L.hide());const I=a?f.bleed:0;let O=I;!t.bleedVisible&&a||(t.bleedVisible||a?t.bleedVisible&&a?O=0:t.bleedVisible&&!a&&(O=-f.bleed):O=0);const M=document.createElement("canvas");M.width=Math.round((f.computedWidth+2*I)*h),M.height=Math.round((f.computedHeight+2*I)*h);const F=M.getContext("2d");i==="image/jpeg"&&(F.fillStyle="white",F.fillRect(0,0,M.width,M.height));const j=y.scale();y.scale({x:1,y:1});const T=y.toCanvas({x:y.x()-O,y:y.y()-O,width:f.computedWidth+2*I,height:f.computedHeight+2*I,pixelRatio:h});return y.scale(j),F.drawImage(T,0,0,M.width,M.height),sn.Util.releaseCanvas(T),n&&y.find(".page-background").forEach(L=>L.show()),k.forEach(L=>{L.visible(L.getAttr("oldVisible"))}),S.forEach(L=>{L.visible(L.getAttr("oldVisible"))}),y.find(".page-background").forEach(L=>L.shadowEnabled(!0)),y.find(".page-background").forEach(L=>L.strokeEnabled(!0)),p.find("Transformer").forEach(L=>{L.visible(L.getAttr("oldVisible"))}),y.find(".highlighter").forEach(L=>L.visible(!0)),x.clip(b),E.clip(A),p.position(_),f?.set({_exporting:!1,_forceMount:!1}),await new Promise(L=>setTimeout(L)),t.setElementsPixelRatio(g),M},async toDataURL(e={}){var{mimeType:n,quality:r}=e,i=Hd(e,["mimeType","quality"]);const a=await t._toCanvas(Object.assign({mimeType:n},i)),o=a.toDataURL(n,r);return sn.Util.releaseCanvas(a),o},async toBlob(e={}){var{mimeType:n,quality:r}=e,i=Hd(e,["mimeType","quality"]);const a=await t._toCanvas(Object.assign({mimeType:n},i)),o=await new Promise(s=>{a.toBlob(s,n,r)});return sn.Util.releaseCanvas(a),o},async saveAsImage(e={}){var{fileName:n}=e,r=Hd(e,["fileName"]);const i=r.mimeType||"image/png",a=i.split("/")[1];R1(await t.toDataURL(r),n||"polotno."+a)},async _toPDF(e){const n=e.dpi||t.dpi,r=e.parallel||1,i=e.unit||(t.unit==="px"?"mm":t.unit),a=e.pixelRatio||1,o=e.pageIds||t.pages.map(A=>A.id),s=t.pages.filter(A=>o.includes(A.id)),u=await aT(),h=A=>J0({px:A,unit:i,dpi:n}),f=e.cropMarkSize||0,g=h(f),v=s[0]||{},p=e.includeBleed?v.bleed:0,y=h(v.computedWidth+2*p+2*g),_=h(v.computedHeight+2*p+2*g);var x=new u({unit:i,orientation:y>_?"landscape":"portrait",format:[y,_],compress:!0,putOnlyUsedFonts:!0});x.deletePage(1);const b=((A,S)=>{for(var k=[],I=0;I<A.length;I+=S)k.push(A.slice(I,I+S));return k})(s,r);let E=0;for(const A of b){const S=A.map(async k=>{const I=e.includeBleed?k.bleed:0,O=k.computedWidth+2*I+2*f,M=k.computedHeight+2*I+2*f,F=h(O),j=h(M);let T=0,L=a;for(;T<10;){T+=1,T===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const $=await t.toDataURL(Object.assign(Object.assign({},e),{pageId:k.id,pixelRatio:L}));if($.length>20)return e.onProgress&&e.onProgress(++E/o.length*.9),{url:$,width:F,height:j,widthPx:O,heightPx:M};L*=.8}});(await Promise.all(S)).forEach(({url:k,width:I,height:O,widthPx:M,heightPx:F})=>{x.addPage([I,O],I>O?"landscape":"portrait");const j=x.getCurrentPageInfo();var T;switch(i){case"pt":T=1;break;case"mm":T=72/25.4;break;case"cm":T=72/2.54;break;case"in":T=72;break;case"px":T=.75;break;case"pc":case"em":T=12;break;case"ex":T=6;break;default:throw"Invalid unit: "+i}if(j.pageContext.cropBox={bottomLeftX:0,bottomLeftY:0,topRightX:I*T,topRightY:O*T},j.pageContext.artBox={bottomLeftX:h(f+p)*T,bottomLeftY:h(f+p)*T,topRightX:h(M-f-p)*T,topRightY:h(F-f-p)*T},j.pageContext.bleedBox={bottomLeftX:h(f+p)*T,bottomLeftY:h(f+p)*T,topRightX:h(M-f-p)*T,topRightY:h(F-f-p)*T},g){x.setLineWidth(h(1));const L=g+h(p);x.line(L,0,L,g),x.line(0,L,g,L),x.line(I-L,0,I-L,g),x.line(I,L,I-g,L),x.line(0,O-L,g,O-L),x.line(L,O,L,O-g),x.line(I,O-L,I-g,O-L),x.line(I-L,O,I-L,O-g)}x.addImage(k,g,g,I-2*g,O-2*g,void 0,"FAST")})}return x},toPDFDataURL:async e=>(await t._toPDF(Object.assign({mimeType:"image/jpeg"},e))).output("datauristring"),async toGIFDataURL(e={}){const n=e.pixelRatio||1,r=await sT({width:t.width*n,height:t.height*n}),i=1e3/(e.fps||10),a=t.duration/i;for(let o=0;o<a-1;o++){const s=o*i||1;t.setCurrentTime(s);let u=0,h="";for(const g of t.pages)if(u+=g.duration,g.set({_rendering:u>s}),u>s){h=g.id;break}const f=await t._toCanvas({pixelRatio:n,pageId:h,_skipTimeout:!0});r.addFrame(f.getContext("2d"),{delay:i,copy:!0})}for(const o of t.pages)o.set({_rendering:!1});return t.stop(),r.render(),new Promise(o=>{r.on("finished",function(s){(function(u,h){var f=new FileReader;f.onload=function(g){h(g.target.result)},f.readAsDataURL(u)})(s,o)})})},async saveAsGIF(e={}){var{fileName:n}=e,r=Hd(e,["fileName"]);const i=await t.toGIFDataURL(r);R1(i,n||"polotno.gif")},async toHTML({elementHook:e}={elementHook:void 0}){const n=t.toJSON();return AT({json:n,elementHook:e})},async saveAsHTML({fileName:e,elementHook:n}={}){const r=await t.toHTML({elementHook:n}),i="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(r)));R1(i,e||"polotno.html")},async toSVG({elementHook:e,pageId:n,fontEmbedding:r="inline"}={fontEmbedding:"inline"}){var i;const a=t.toJSON();n=n||((i=a.pages[0])===null||i===void 0?void 0:i.id);const o=a.pages.find(s=>s.id===n);return LT({json:Object.assign(Object.assign({},a),{pages:o?[o]:[]}),elementHook:e,fontEmbedding:r})},async saveAsSVG({fileName:e,elementHook:n,pageId:r,fontEmbedding:i="inline"}={}){const a=await t.toSVG({elementHook:n,pageId:r,fontEmbedding:i}),o="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(a)));R1(o,e||"polotno.svg")},async saveAsPDF(e={}){var{fileName:n}=e,r=Hd(e,["fileName"]);(await t._toPDF(Object.assign({mimeType:"image/jpeg"},r))).save(n||"polotno.pdf")},async waitLoading({_skipTimeout:e=!1}={}){e||await new Promise(n=>setTimeout(n,50)),await tO()},toJSON:()=>({width:t.width,height:t.height,fonts:Ru(t.fonts),pages:Ru(t.pages),audios:Ru(t.audios),unit:t.unit,dpi:t.dpi,custom:t.custom,schemaVersion:t.schemaVersion}),loadJSON(e,n=!1){var r;const i=JSON.parse(JSON.stringify(e)),a=i.schemaVersion||0;a<1&&Si.htmlRenderEnabled&&Ii({children:i.pages},h=>{if(h.type==="text"){const g=h.letterSpacing*16;h.letterSpacing=g/h.fontSize}}),a<2&&Ii({children:i.pages},h=>{h.filters&&Object.keys(h.filters).forEach(f=>{if(["warm","cold","natural"].includes(f))return;const g=h.filters[f];g&&typeof g.intensity=="number"&&(g.intensity=g.intensity/100)})}),delete i.schemaVersion;const o=t.pages.indexOf(t.activePage);let s=(r=i.pages[o]||i.pages[0])===null||r===void 0?void 0:r.id;i._activePageId=s;const u=Object.assign({},Ru(t));Object.assign(u,i),u.history=n?t.history.toJSON():{history:[],undoIdx:-1},ym(t,u)},clear({keepHistory:e=!1}={}){const n=t.pages.map(r=>r.id);t.deletePages(n),t.custom=null,e||t.history.clear()},addFont(e){t.removeFont(e.fontFamily),t.fonts.push(e),t.loadFont(e.fontFamily)},removeFont(e){t.fonts.filter(n=>n.fontFamily===e).forEach(n=>e2(n))},addAudio(e){const n=P4.create(Object.assign({id:Cl(10)},e));t.audios.push(n)},removeAudio(e){const n=t.audios.find(r=>r.id===e);n&&t.audios.remove(n)},async loadFont(e){const n=t.fonts.find(i=>i.fontFamily===e)||iy.find(i=>i.fontFamily===e);let r=[{fontStyle:"normal",fontWeight:"normal"},{fontStyle:"normal",fontWeight:"bold"}];return n?(n.styles&&(r=n.styles.map(i=>({fontStyle:i.fontStyle||"normal",fontWeight:i.fontWeight||"normal"}))),W8(n)):G8(e),Promise.all(r.map(i=>Qh(e,i.fontStyle,i.fontWeight)))},validate:e=>ih.validate(e,[{path:"",type:ih}]).map(n=>({path:"store"+n.context.map(r=>r.path).join("."),message:n.message}))}));function TT({key:t,showCredit:e}={key:"",showCredit:!1}){return ih.create({_forceShowCredit:e,_key:t})}const c_=Zt.model("Node",{id:Zt.identifier,type:"none",name:"",opacity:1,custom:Zt.frozen(),visible:!0,selectable:!0,removable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(t=>{for(var e in t)t[e]===null&&(t[e]=void 0);return t}).postProcessSnapshot(t=>{const e=Object.assign({},t),n={};for(var r in e)r[0]!=="_"&&(n[r]=t[r]);return n}).views(t=>({get locked(){return!(t.draggable||t.contentEditable||t.styleEditable||t.resizable)},get page(){return Xf(t,fp)},get store(){return Xf(t,ih)},get top(){let e=t;for(;;){if(!L1(e,ad))return e;e=Xf(e,ad)}},get parent(){if(L1(t,ad)){const e=Xf(t,ad);return e&&e.children&&e.children.length,e}if(L1(t,fp)){const e=Xf(t,fp);return e&&e.children&&e.children.length,e}if(L1(t,ih)){const e=Xf(t,ih);return e&&e.pages&&e.pages.length,e}return null},get zIndex(){return t.parent.children.indexOf(t)}})).actions(t=>({toJSON:()=>Object.assign({},Ru(t))})).actions(t=>({clone(e={},{skipSelect:n=!1}={}){const r=JSON.parse(JSON.stringify(t.toJSON()));return e.id=e.id||Cl(10),Ii(r,i=>{i.id=Cl(10)}),Object.assign(r,e),t.page.addElement(r,{skipSelect:n})},set(e){Object.assign(t,e)},moveUp(){t.page.moveElementsUp([t.id])},moveTop(){t.page.moveElementsTop([t.id])},moveDown(){t.page.moveElementsDown([t.id])},moveBottom(){t.page.moveElementsBottom([t.id])},setZIndex(e){t.parent.setElementZIndex(t.id,e)},beforeDestroy(){}})),O4={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}}},C4={right:{cropX:-1},left:{cropX:1},up:{cropY:1},down:{cropY:-1}},RT={fade:({dTime:t,element:e,animation:n})=>{const r=t/n.duration;return n.type==="enter"?{opacity:r*e.opacity}:{opacity:(1-r)*e.opacity}},rotate:({dTime:t,element:e,animation:n})=>{const r=t/n.duration*360;return PN({x:e.x,y:e.y,width:e.width,height:e.height,rotation:e.rotation},r)},blink:({dTime:t,element:e,animation:n})=>{const r=n.duration,i=t%r/(r/2),a=i<=1?i:2-i;return{opacity:e.opacity*a}},bounce:({dTime:t,element:e,animation:n})=>{var r;const i=n.duration,a=i/2,o=(r=n.data.strength)!==null&&r!==void 0?r:1,s={},u={x:e.x+e.width/3*o,y:e.y+e.height/3*o,width:e.width/3*o,height:e.height/3*o,fontSize:e.fontSize/3*o},h={x:e.x,y:e.y,width:e.width,height:e.height,fontSize:e.fontSize},f=t%i/a,g=f<=1?f:2-f;for(let v in u){const p=u[v],y=h[v]-p;s[v]=p+g*y}return s},move:({dTime:t,element:e,animation:n})=>{var r;const i=O4[n.data.direction]||O4.right,a=(r=n.data.strength)!==null&&r!==void 0?r:1,o={};for(var s in i.from){let u=i.from[s],h=i.to[s];n.type==="exit"&&(u=i.to[s],h=-i.from[s]),u*=a,h*=a;const f=e[s]+u,g=e[s]+h-f;o[s]=f+t/n.duration*g}return o},zoom:({dTime:t,element:e,animation:n})=>{var r;const i={},a=1+(((n.data.direction||"in")==="in"?.75:1.25)-1)*((r=n.data.strength)!==null&&r!==void 0?r:1),o=e.rotation*Math.PI/180,s=Math.cos(o),u=Math.sin(o),h=e.width*(1-a),f=e.height*(1-a),g=(h*s-f*u)/2,v=(h*u+f*s)/2,p={x:e.x+g,y:e.y+v,width:e.width*a,height:e.height*a,fontSize:e.fontSize*a},y={x:e.x,y:e.y,width:e.width,height:e.height,fontSize:e.fontSize};for(var _ in p){let x=p[_],b=y[_];if(n.type==="exit"){const A=x;x=b,b=A}const E=b-x;i[_]=x+t/n.duration*E}return i},cameraZoom:({dTime:t,element:e,animation:n})=>{var r,i,a;const o={},s=n.data.direction||"right",u=C4[s]||C4.right,h=(r=n.data.movementStrength)!==null&&r!==void 0?r:.1,f=(i=n.data.shakeStrength)!==null&&i!==void 0?i:.015;a=n.data.zoomStrength;const g=t/n.duration,v=f*(1-g),p=Math.sin(12*g)*v*.7+Math.sin(8*g)*v*.3;n.type==="exit"&&Math.max(e.cropWidth||1,e.cropHeight||1),n.type;const y=1-Math.pow(1-g,2),_=e.cropX||0,x=e.cropY||0,b=e.cropWidth||1,E=e.cropHeight||1,A=b,S=E;let k,I,O=0,M=0;if(u.cropX){const F=u.cropX>0?1-(_+b):_;O=Math.min(F,Math.abs(h))*u.cropX}if(u.cropY){const F=u.cropY>0?1-(x+E):x;M=Math.min(F,Math.abs(h))*u.cropY}return n.type==="enter"?(k=u.cropX?_+O*(1-y):_,I=u.cropY?x+M*(1-y):x):(k=u.cropX?_+O*y:_,I=u.cropY?x+M*y:x),o.cropX=Math.max(0,Math.min(1-A,k+p*A)),o.cropY=Math.max(0,Math.min(1-S,I+p*S)),o.cropWidth=A,o.cropHeight=S,o}},yv=({element:t,dTime:e,animation:n})=>{const r=RT[n.name];return r?r({element:t,dTime:e,animation:n}):(console.error("Can not find animation type: "+n.name),{})},MT=Zt.model("Animation",{delay:0,duration:500,enabled:!0,type:Zt.enumeration("Type",["enter","exit","loop"]),name:"none",data:Zt.frozen({})}),bv=(t,e)=>{const n={};for(const r in e)if(typeof t[r]=="number"&&typeof e[r]=="number"){const i=e[r]-t[r];i!==0&&(n[r]=i)}return n},IT=Zt.model("ShapeFilter",{intensity:1}),L4=["temperature","contrast","highlights","shadows","white","black","saturation","vibrance"],Bp=c_.named("Shape").props({x:0,y:0,width:100,height:100,rotation:0,opacity:1,animations:Zt.array(MT),blurEnabled:!1,blurRadius:10,brightnessEnabled:!1,brightness:0,sepiaEnabled:!1,grayscaleEnabled:!1,filters:Zt.map(IT),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(t=>{const e=Object.assign(Object.assign({},t),{x:t.x||0,y:t.y||0,filters:Array.isArray(t.filters)?{}:t.filters});return"width"in t&&(e.width=e.width||1),"height"in t&&(e.height=e.height||1),t.locked&&(e.draggable=!1,e.contentEditable=!1,e.styleEditable=!1,e.resizable=!1,e.removable=!1),e}).views(t=>{const e=Kn({x:t.x,y:t.y,width:t.width,height:t.height,rotation:t.rotation,opacity:t.opacity,color:t.color,fontSize:t.fontSize}),n=Jn(i=>{Object.assign(e,i)}),r=Jn(i=>{for(const a in i)typeof e[a]=="number"&&(e[a]=e[a]+i[a])});return{get a(){const{currentTime:i}=t.store;if(n({x:t.x,y:t.y,width:t.width,height:t.height,rotation:t.rotation,opacity:t.opacity,color:t.color,fontSize:t.fontSize,cropX:t.cropX,cropY:t.cropY,cropWidth:t.cropWidth,cropHeight:t.cropHeight}),i===0)return e;const a=i-t.page.startTime;if(a>t.page.duration||a<0)return e;const o=t.store.animatedElementsIds;if(o.length&&!o.includes(t.id))return e;const s=t.animations.find(v=>v.type==="enter"),u=s?.enabled&&a<s.delay;u&&n({opacity:0});const h=s?.enabled&&a>=s.delay&&a<=s.delay+s.duration;if(h){const v=a-s.delay,p=yv({element:t,animation:s,dTime:v}),y=bv(t,p);r(y)}const f=t.animations.find(v=>v.type==="exit");if(!u&&!h&&f?.enabled&&a>=t.page.duration-f.duration-f.delay&&a<=t.page.duration-f.delay){const v=a-(t.page.duration-f.duration-f.delay),p=yv({element:t,animation:f,dTime:v}),y=bv(t,p);r(y)}f?.enabled&&a>=t.page.duration-f.delay&&n({opacity:0});const g=t.animations.find(v=>v.type==="loop");if(g?.enabled){const v=yv({element:t,animation:g,dTime:a}),p=bv(t,v);r(p)}return e},animated:i=>t.a[i]}}).actions(t=>({setAnimation(e,n){const r=t.animations.find(i=>i.type===e);r?Object.assign(r,n):t.animations.push(Object.assign({type:e},n))},setFilter(e,n){L4.includes(e)||t.filters.forEach((r,i)=>{L4.includes(i.toString())||t.filters.delete(i.toString())}),n==null?t.filters.delete(e):t.filters.set(e,{intensity:n})}})),f_=Bp.named("Text").props({type:"text",text:"",placeholder:"",fontSize:14,fontFamily:"Roboto",fontStyle:"normal",fontWeight:"normal",textDecoration:"",textTransform:"none",fill:"black",align:"center",width:100,height:0,verticalAlign:"top",strokeWidth:0,stroke:"black",lineHeight:Zt.optional(Zt.union(Zt.number,Zt.string),1.2),letterSpacing:0,_editModeEnabled:!1,backgroundEnabled:!1,backgroundColor:"#7ED321",backgroundOpacity:1,backgroundCornerRadius:.5,backgroundPadding:.5,curveEnabled:!1,curvePower:.5}).preProcessSnapshot(t=>Object.assign({},t)).actions(t=>({toggleEditMode(e){t._editModeEnabled=e??!t._editModeEnabled,t._editModeEnabled?t.store.history.startTransaction():t.store.history.endTransaction()}})),eg=Bp.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,stretchEnabled:!1}).extend(t=>{const e=Kn.box(!1);let n=!1;return{views:{get _cropModeEnabled(){return e.get()}},actions:{toggleCropMode(r){const i=r??!e.get();e.set(i),i&&!n?(t.store.history.startTransaction(),n=!0):!i&&n&&(t.store.history.endTransaction(),n=!1)},beforeDestroy(){n&&(t.store.history.endTransaction(),n=!1)}}}}),h_=eg.named("Video").props({type:"video",duration:0,startTime:0,endTime:1,volume:1}),d_=Bp.named("Line").props({type:"line",width:400,height:10,color:"black",dash:Zt.array(Zt.number),startHead:"",endHead:""}).actions(t=>({})),p_=Bp.named("SVG").props({type:"svg",src:"",maskSrc:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,keepRatio:!0,stretchEnabled:!0,flipX:!1,flipY:!1,width:100,height:100,borderColor:"black",borderSize:0,cornerRadius:0,colorsReplace:Zt.map(Zt.string)}).preProcessSnapshot(t=>Object.assign(Object.assign({},t),{src:t.src||t.svgSource,colorsReplace:Array.isArray(t.colorsReplace)?{}:t.colorsReplace})).actions(t=>({replaceColor(e,n){t.colorsReplace.set(e,n)}})),g_=Bp.named("Figure").props({type:"figure",subType:"rect",fill:"rgb(0, 161, 255)",dash:Zt.array(Zt.number),strokeWidth:0,stroke:"rgba(98, 197, 255, 1)",cornerRadius:0}),v_=eg.named("Gif").props({type:"gif",duration:0,keepRatio:!0});var jT=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const Ii=(t,e)=>{if(t.children)for(const n of t.children){if(e(n)===!0)break;Ii(n,e)}},DT=[...new Array(20)].map((t,e)=>Zt.late(()=>FT[e])),m_=Zt.union({dispatcher:t=>{const e=by[t.type];if(!e)throw new Error(`Unknown element type: "${t.type}"`);return e}},p_,f_,eg,d_,h_,g_,v_,Zt.late(()=>ad),...DT),ad=c_.named("Group").props({type:"group",children:Zt.array(m_)}).views(t=>({get draggable(){let e=!0;return Ii(t,n=>{n.draggable||(e=!1)}),e},get resizable(){let e=!0;return Ii(t,n=>{n.resizable||(e=!1)}),e},get contentEditable(){let e=!0;return Ii(t,n=>{n.contentEditable||(e=!1)}),e},get styleEditable(){let e=!0;return Ii(t,n=>{n.styleEditable||(e=!1)}),e},get locked(){let e=!0;return Ii(t,n=>{n.locked||(e=!1)}),e}})).actions(t=>({set(e){var{draggable:n,contentEditable:r,styleEditable:i,resizable:a}=e,o=jT(e,["draggable","contentEditable","styleEditable","resizable"]);n!==void 0&&Ii(t,s=>{s.set({draggable:n})}),r!==void 0&&Ii(t,s=>{s.set({contentEditable:r})}),i!==void 0&&Ii(t,s=>{s.set({styleEditable:i})}),a!==void 0&&Ii(t,s=>{s.set({resizable:a})}),Object.assign(t,o)},addElement(e,{skipSelect:n=!1}={}){const r=by[e.type];if(!r)return void console.error("Can not find model with type "+e.type);e.children&&e.children.forEach(a=>{a.id=a.id||Cl(10)});const i=r.create(Object.assign({id:Cl(10)},e));return t.children.push(i),i.selectable&&!n&&t.store.selectElements([i.id]),i},setElementZIndex(e,n){const r=t.children.find(i=>i.id===e);r&&(eh(r),t.children.remove(r),t.children.splice(n,0,r))}})),FT=[],by={svg:p_,text:f_,image:eg,group:ad,line:d_,video:h_,figure:g_,gif:v_},BT={text:ZC,image:X3,svg:X3,line:TN,video:DN,figure:YN,group:ri(t=>{const{element:e,store:n}=t,{children:r}=e,i=e.selectable||n.role==="admin";return se.createElement(br,{opacity:e.opacity,listening:i,hideInExport:!e.showInExport},r.map(a=>se.createElement(y_,Object.assign({},t,{key:a.id,store:n,element:a}))))}),gif:tT},zT=(t,e)=>{const n=[];Ii(t,f=>{f.type!=="group"&&n.push(f.a)});const r=[];n.forEach(f=>{const g=[{x:0,y:0},{x:0+f.width,y:0},{x:0+f.width,y:0+f.height},{x:0,y:0+f.height}],v=new sn.Transform;v.translate(f.x,f.y),v.rotate(sn.Util.degToRad(f.rotation)),g.forEach(p=>{const y=v.point(p);r.push(y)})});const i=new sn.Transform;i.rotate(-sn.Util.degToRad(e));let a=1/0,o=1/0,s=-1/0,u=-1/0;r.forEach(f=>{const g=i.point(f);a=Math.min(a,g.x),o=Math.min(o,g.y),s=Math.max(s,g.x),u=Math.max(u,g.y)}),i.invert();const h=i.point({x:a,y:o});return{x:h.x,y:h.y,width:s-a,height:u-o,rotation:e}},y_=ri(t=>{var e;const{element:n,store:r}=t,[i,a]=se.useState(!1),o=r.selectedElements.indexOf(n)>=0&&n.selectable,s=((e=n.parent)===null||e===void 0?void 0:e.type)==="group",u=(g=>{const[v,p]=se.useState(null);return se.useEffect(()=>{const y=setTimeout(()=>{const _=g.page.id,x=sn.stages.find(b=>b.getAttr("pageId")===_);x||console.error("No stage is found for element",g.id),p(x)});return()=>clearTimeout(y)},[g.id]),v})(n),h=u?.findOne("Transformer");se.useEffect(()=>{if(u){const g=p=>{const y=p.target.findAncestor(".element",!0),_=r.getElementById(y?.id()),x=_?.top,b=x?.id;a(b===n.id)};u.on("mouseover",g);const v=()=>{a(!1)};return u.on("mouseleave",v),()=>{u.off("mouseover",g),u.off("mouseleave",v)}}},[u]);let f=BT[t.element.type];return t.element.type==="text"&&Si.htmlRenderEnabled&&(f=SN),t.element.visible?f?se.createElement(se.Fragment,null,se.createElement(f,Object.assign({},t)),(i||o)&&!s&&se.createElement(rT,{element:n.type==="group"?{a:zT(n,h?.rotation()||0)}:n})):(console.error("Can not find component for "+t.element.type),null):null});function qT(t,e,n="scale"){const r=e.width/e.height;let i,a;r>=t.width/t.height?(i=t.width,a=t.width/r):(i=t.height*r,a=t.height);let o=0,s=0;return n==="left-top"?(o=0,s=0):n==="left-middle"?(o=0,s=(t.height-a)/2):n==="left-bottom"?(o=0,s=t.height-a):n==="center-top"?(o=(t.width-i)/2,s=0):n==="center-middle"?(o=(t.width-i)/2,s=(t.height-a)/2):n==="center-bottom"?(o=(t.width-i)/2,s=t.height-a):n==="right-top"?(o=t.width-i,s=0):n==="right-middle"?(o=t.width-i,s=(t.height-a)/2):n==="right-bottom"?(o=t.width-i,s=t.height-a):n==="scale"?(o=0,s=0,i=t.width,a=t.height):console.error(new Error("Unknown clip position property - "+n)),{cropX:o,cropY:s,cropWidth:i,cropHeight:a}}var b_=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const N4=sn.DD._drag;window.removeEventListener("mousemove",N4),sn.DD._drag=function(t){pc(()=>{N4.call(this,t)})},window.addEventListener("mousemove",sn.DD._drag);const Sm=new sn.Group,pf=20;Sm.add(new sn.Rect({width:pf,height:pf,fill:"white"})),Sm.add(new sn.Path({scaleX:pf/24,scaleY:pf/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 UT=Sm.toCanvas({pixelRatio:2,width:pf,height:pf}),wv={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:t=>{t.hasName("rotater")&&t.setAttrs({width:20,height:20,cornerRadius:20/2,offsetX:20/2,offsetY:20/2,fillPatternImage:UT,fillPatternScaleX:20/pf/2,fillPatternScaleY:20/pf/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}},M1={text:{enabledAnchors:["top-left","top-right","middle-left","bottom-left","bottom-right","middle-right"]},svg:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},gif:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},line:{enabledAnchors:[],borderEnabled:!1,rotateEnabled:!1},image:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},many:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},group:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]}},HT=t=>se.createElement(Tr,Object.assign({},t,{preventDefault:!1})),$T=t=>{var{url:e}=t,n=b_(t,["url"]);const[r,i]=ny(e,"anonymous"),a=r?qT(r,{width:n.width,height:n.height},"center-middle"):{};return up(i,e,"page background"),se.createElement(Tu,Object.assign({image:r},n,a))},GT=t=>{const e=wf({fill:t.fill,a:{width:t.width,height:t.height}});return se.createElement(Tr,Object.assign({},t,e))},WT=t=>{const{background:e,scale:n,borderColor:r}=t,i=b_(t,["background","scale","borderColor"]),a=se.useMemo(()=>!!sn.Util.colorToRGBA(e)||H0(e),[e]),o=se.useMemo(()=>{const s=document.createElement("canvas"),u=30;s.width=60,s.height=60;const h=s.getContext("2d");return h&&(h.fillStyle="black",h.fillRect(u,0,u,u),h.fillRect(0,u,u,u)),s},[]);return se.createElement(se.Fragment,null,se.createElement(Tr,Object.assign({fillPatternImage:o},i,{opacity:.1,hideInExport:!0})),a?se.createElement(GT,Object.assign({fill:e},i)):se.createElement($T,Object.assign({url:e},i)))},VT=ri(({selection:t,fill:e="rgba(0, 161, 255, 0.3)",stroke:n="rgb(0, 161, 255)",strokeWidth:r=1})=>t.visible?se.createElement(Tr,{name:"selection",x:Math.min(t.x1,t.x2),y:Math.min(t.y1,t.y2),width:Math.abs(t.x1-t.x2),height:Math.abs(t.y1-t.y2),fill:e,stroke:n,strokeWidth:r}):null),YT=ri(({x:t,y:e,width:n,height:r,rotation:i,anchor:a,store:o,tagFill:s,textFill:u})=>{const h=kd({x:t,y:e,width:n,height:r,rotation:sn.Util.radToDeg(i)});if(a===void 0)return null;const f=(r/2+70)*Math.cos(i-Math.PI/2),g=(r/2+70)*Math.sin(i-Math.PI/2),v=x4({unit:o.unit,dpi:o.dpi,px:n/o.scale,precious:o.unit==="px"?0:1})+" x "+x4({unit:o.unit,dpi:o.dpi,px:r/o.scale,precious:o.unit==="px"?0:1})+(o.unit==="px"?"":" "+o.unit);return se.createElement(se.Fragment,null,se.createElement(v0,{x:(h.minX+h.maxX)/2+f,y:(h.minY+h.maxY)/2+g,offsetX:14,offsetY:14,visible:a==="rotater"},se.createElement(m0,{cornerRadius:5,fill:s||"rgb(0, 161, 255)"}),se.createElement(Fu,{align:"center",verticalAlign:"middle",fill:u||"white",padding:8,text:Math.round(sn.Util.radToDeg(i)).toString()+"°"})),se.createElement(v0,{x:(h.minX+h.maxX)/2,y:h.maxY+20,visible:a!=="rotater"},se.createElement(m0,{cornerRadius:5,fill:s||"rgb(0, 161, 255)",pointerDirection:"up",pointerHeight:0,pointerWidth:0}),se.createElement(Fu,{align:"center",verticalAlign:"middle",fill:u||"white",padding:8,text:v})))}),XT=ri(({elements:t,store:e})=>{const n=t.filter(i=>i.alwaysOnTop),r=t.filter(i=>!i.alwaysOnTop).concat(n);return se.createElement(se.Fragment,null,r.map(i=>se.createElement(y_,{key:i.id,store:e,element:i,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))}),KT=({store:t})=>{const[e,n]=se.useState(!1),[r,i]=se.useState({x:0,y:0});return{open:se.useCallback(o=>{n(!0),i(o)},[]),close:se.useCallback(()=>{n(!1)},[]),props:{isOpen:e,offset:r,setIsOpen:n}}},ZT=atob("UG9sb3RubyBmcmVlIGxpY2Vuc2UgbGltaXRhdGlvbiBleGNlZWRlZCAtIFBsZWFzZSB1cGdyYWRlIHlvdXIgYWNjb3VudC4="),T4=atob("cmVk"),QT=atob("djAuOS4y"),JT=t=>se.createElement(se.Fragment,null,se.createElement(v0,{fill:T4,height:200},se.createElement(m0,{fill:T4}),se.createElement(Fu,Object.assign({},t,{fill:"white",text:ZT,height:void 0,padding:10,fontSize:20})))),eR=ri(({store:t,page:e,width:n,height:r,pageControlsEnabled:i,backColor:a,pageBorderColor:o,activePageBorderColor:s,components:u,bleedColor:h,altCloneEnabled:f,viewportSize:g,selectionRectFill:v,selectionRectStroke:p,selectionRectStrokeWidth:y,snapGuideStroke:_,snapGuideStrokeWidth:x,snapGuideDash:b,transformLabelFill:E,transformLabelTextFill:A,distanceGuideStroke:S,distanceLabelFill:k,distanceLabelTextFill:I})=>{const O=t.bleedVisible?e.bleed:0,M=e.computedWidth+2*O,F=e.computedHeight+2*O,j=(n-M*t.scale)/2,T=(r-F*t.scale)/2,L=se.useRef(null),$=se.useRef(null),q=se.useRef(null),J=i==null||i,[ae,ie]=se.useState(null),[Z,te]=se.useState({}),V=KT({store:t}),B=t.selectedElements.find(fe=>fe._cropModeEnabled),D=t.selectedElements.find(fe=>fe.curveEnabled),U=t.selectedShapes.filter(fe=>!fe.resizable).length>0,X=t.selectedShapes.filter(fe=>!fe.draggable).length>0,ee=t.selectedElements.filter(fe=>!fe.visible).length>0;se.useLayoutEffect(()=>{var fe,Le,Ne;if(!L.current)return;const ue=L.current.getStage(),Ae=t.selectedShapes.map(st=>st._cropModeEnabled?null:ue.findOne("#"+st.id)).filter(st=>st),Pe=t.selectedElements.length===1,Ue=Pe&&((fe=t.selectedElements[0])===null||fe===void 0?void 0:fe.type)||"many";M1[Ue]?(L.current.setAttrs(Object.assign(Object.assign({},wv),M1[Ue])),Ue!=="svg"&&Ue!=="image"&&Ue!=="gif"||t.selectedElements[0].keepRatio||L.current.setAttrs({enabledAnchors:wv.enabledAnchors}),Ue==="text"&&Si.textVerticalResizeEnabled&&L.current.setAttrs({enabledAnchors:(Le=M1.text.enabledAnchors)===null||Le===void 0?void 0:Le.concat(["bottom-center"])}),Ue==="text"&&Pe&&t.selectedElements[0].curveEnabled&&L.current.setAttrs({enabledAnchors:M1.many.enabledAnchors})):L.current.setAttrs(wv),U&&L.current.enabledAnchors([]),X&&L.current.rotateEnabled(!1),Ae.find(st=>st?.isDragging())&&Ae.forEach(st=>{st.isDragging()||st==null||st.startDrag()}),L.current.nodes(Ae),V7(),(Ne=L.current.getLayer())===null||Ne===void 0||Ne.batchDraw()},[t.selectedShapes,B,U,ee,X,D]);const K=tE(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),oe=se.useRef(!1),me=Lf(),de=Jn(fe=>{var Le,Ne,ue,Ae;if(me)return;oe.current=!1;const Pe=fe.target.findAncestor(".elements-container"),Ue=fe.target.findAncestor("Transformer"),st=fe.target.findAncestor(".page-abs-container");if(Pe||Ue||st)return;const dt=(Le=fe.target.getStage())===null||Le===void 0?void 0:Le.getPointerPosition();dt.x-=(Ne=fe.target.getStage())===null||Ne===void 0?void 0:Ne.x(),dt.y-=(ue=fe.target.getStage())===null||ue===void 0?void 0:ue.y(),dt&&(K.visible=!0,K.x1=dt.x,K.y1=dt.y,K.x2=dt.x,K.y2=dt.y,((Ae=fe.target.getStage())===null||Ae===void 0?void 0:Ae.getPointersPositions().length)>=2&&(K.visible=!1))});(({stageRef:fe,containerRef:Le,viewportSize:Ne})=>{se.useEffect(()=>{var ue;const Ae=(ue=Le.current)===null||ue===void 0?void 0:ue.closest(".polotno-workspace-inner");function Pe(){var Ue;if(!fe.current)return;const st=(Ue=Le.current)===null||Ue===void 0?void 0:Ue.getBoundingClientRect(),dt=Ae?.getBoundingClientRect(),pt=Math.max(0,dt.left-st.left-100),xt=Math.max(0,dt.top-st.top-100);fe.current.position({x:-pt,y:-xt}),fe.current.container().style.transform=`translate(${pt}px, ${xt}px)`}return Pe(),Ae.addEventListener("scroll",Pe),()=>{Ae.removeEventListener("scroll",Pe)}},[Ne.width,Ne.height])})({stageRef:$,containerRef:q,viewportSize:g}),se.useEffect(()=>{const fe=Jn(Ne=>{var ue,Ae,Pe,Ue;if(!K.visible)return;(ue=$.current)===null||ue===void 0||ue.setPointersPositions(Ne);let st=(Ae=$.current)===null||Ae===void 0?void 0:Ae.getPointerPosition();st?(st.x-=(Pe=$.current)===null||Pe===void 0?void 0:Pe.x(),st.y-=(Ue=$.current)===null||Ue===void 0?void 0:Ue.y()):st={x:K.x2,y:K.y2},K.x2=st.x,K.y2=st.y}),Le=Jn(()=>{if(!K.visible||!$.current)return;const Ne=$.current.findOne(".selection"),ue=Ne?Ne.getClientRect():{width:0,height:0,x:0,y:0};if(ue.width&&ue.height){const Ae=[];$.current.find(".element").forEach(Ue=>{const st=Ue.getClientRect(),dt=t.getElementById(Ue.id()),pt=dt?.draggable,xt=dt?.selectable;sn.Util.haveIntersection(ue,st)&&pt&&xt&&Ae.push(dt.top.id)});const Pe=[...new Set(Ae)];t.selectElements(Pe)}K.visible=!1,oe.current=!0});return window.addEventListener("mousemove",fe),window.addEventListener("touchmove",fe),window.addEventListener("mouseup",Le),window.addEventListener("touchend",Le),()=>{window.removeEventListener("mousemove",fe),window.removeEventListener("touchmove",fe),window.removeEventListener("mouseup",Le),window.removeEventListener("touchend",Le)}},[]);const ye=se.useRef(!1);se.useEffect(()=>{var fe;let Le;const Ne=(fe=q.current)===null||fe===void 0?void 0:fe.closest(".polotno-workspace-inner"),ue=()=>{ye.current=!0,clearTimeout(Le),Le=setTimeout(()=>{ye.current=!1},300)};return Ne.addEventListener("scroll",ue),()=>{clearTimeout(Le),Ne.removeEventListener("scroll",ue)}},[]);const Re=fe=>{if(t.activePage!==e&&e.select(),ye.current||oe.current)return;const Le=fe.evt.ctrlKey||fe.evt.metaKey||fe.evt.shiftKey,Ne=fe.target.findAncestor(".elements-container"),ue=fe.target.findAncestor(".page-abs-container"),Ae=fe.target.findAncestor("Transformer");if(!(Le||Ne||Ae||ue||K.visible))return void t.selectElements([]);const Pe=fe.target.findAncestor(".element",!0),Ue=t.getElementById(Pe?.id()),st=Ue?.top,dt=st?.id,pt=t.selectedElementsIds.indexOf(dt)>=0,xt=fe.target.findAncestor(".page-container",!0);dt&&Le&&!pt?t.selectElements(t.selectedElementsIds.concat([dt])):dt&&Le&&pt?t.selectElements(t.selectedElementsIds.filter(bt=>bt!==dt)):!dt||Le||pt?xt?t.selectPages([e.id]):t.selectPages([]):t.selectElements([dt])};CN(L,t,{stroke:_,strokeWidth:x,dash:b});const Oe=t.activePage===e,Me=t._selectedPagesIds.includes(e.id),Ee=u?.PageControls,ge=u?.Tooltip,Te=u?.ContextMenu,Be=1/t.scale,Ce=0/t.scale;return se.createElement("div",{ref:q,onDragOver:fe=>fe.preventDefault(),onDrop:fe=>{if(fe.preventDefault(),!$.current)return;$.current.setPointersPositions(fe),$.current.findOne(".elements-container").getRelativePointerPosition();const Le=$.current.getPointerPosition(),Ne=$.current.getAllIntersections(Le).map(Ae=>Ae.findAncestor(".element",!0)).filter(Boolean);[...new Set(Ne.reverse())].map(Ae=>t.getElementById(Ae.id()))[0]},style:{position:"relative",width:n+"px",height:r+"px",overflow:"hidden"},className:"polotno-page-container"+(Oe?" active-page":"")},se.createElement(NP,{ref:$,width:Math.min(n,g.width+200),height:Math.min(g.height+200,r),onClick:Re,onTap:Re,onContextMenu:fe=>{fe.evt.preventDefault();const Le=fe.target.findAncestor(".element",!0),Ne=t.getElementById(Le?.id()),ue=Ne?.top,Ae=ue?.id;Ae?t.selectedElementsIds.indexOf(Ae)>=0||t.selectElements([Ae]):t.selectElements([]),V.open({x:fe.evt.clientX,y:fe.evt.clientY})},onMouseDown:de,onMouseMove:fe=>{if(!fe.evt.altKey&&ae)return void ie(null);if(!fe.evt.altKey)return;const Le=fe.target.findAncestor(".element",!0),Ne=Le?.id();if(!t.selectedElements[0]||t.selectedElementsIds.includes(Ne))return;const ue=Q0(t.selectedShapes),Ae=Ne?t.getElementById(Ne):{x:0,y:0,width:e.computedWidth,height:e.computedHeight,rotation:0},Pe=kd(Ae),Ue=[];ue.minX>Pe.maxX&&Ue.push({distance:ue.minX-Pe.maxX,box1:ue,box2:Pe,points:[{x:ue.minX,y:ue.minY+ue.height/2},{x:Pe.maxX,y:ue.minY+ue.height/2},{x:Pe.maxX,y:Pe.minY+Pe.height/2}]}),ue.maxX<Pe.minX&&Ue.push({distance:Pe.minX-ue.maxX,box1:ue,box2:Pe,points:[{x:ue.maxX,y:ue.minY+ue.height/2},{x:Pe.minX,y:ue.minY+ue.height/2},{x:Pe.minX,y:Pe.minY+Pe.height/2}]}),ue.minY>Pe.maxY&&Ue.push({box1:ue,box2:Pe,distance:ue.minY-Pe.maxY,points:[{x:ue.minX+ue.width/2,y:ue.minY},{x:ue.minX+ue.width/2,y:Pe.maxY},{x:Pe.minX+Pe.width/2,y:Pe.maxY}]}),ue.maxY<Pe.minY&&Ue.push({box1:ue,box2:Pe,distance:Pe.minY-ue.maxY,points:[{x:ue.minX+ue.width/2,y:ue.maxY},{x:ue.minX+ue.width/2,y:Pe.minY},{x:Pe.minX+Pe.width/2,y:Pe.minY}]}),ue.minX>=Pe.minX&&ue.maxX<=Pe.maxX&&ue.minY>=Pe.minY&&ue.maxY<=Pe.maxY&&(Ue.push({distance:ue.minX-Pe.minX,box1:ue,box2:Pe,points:[{x:ue.minX,y:ue.minY+ue.height/2},{x:Pe.minX,y:ue.minY+ue.height/2},{x:Pe.minX,y:Pe.minY+Pe.height/2}]}),Ue.push({distance:Pe.maxX-ue.maxX,box1:ue,box2:Pe,points:[{x:ue.maxX,y:ue.minY+ue.height/2},{x:Pe.maxX,y:ue.minY+ue.height/2},{x:Pe.maxX,y:Pe.minY+Pe.height/2}]}),Ue.push({box1:ue,box2:Pe,distance:ue.minY-Pe.minY,points:[{x:ue.minX+ue.width/2,y:ue.minY},{x:ue.minX+ue.width/2,y:Pe.minY},{x:Pe.minX+Pe.width/2,y:Pe.minY}]}),Ue.push({box1:ue,box2:Pe,distance:Pe.maxY-ue.maxY,points:[{x:ue.minX+ue.width/2,y:ue.maxY},{x:ue.minX+ue.width/2,y:Pe.maxY},{x:Pe.minX+Pe.width/2,y:Pe.maxY}]})),JSON.stringify(ae)!==JSON.stringify(Ue)&&ie(Ue)},onDragStart:fe=>{var Le;const Ne=fe.target.findAncestor(".element",!0);if(Ne){const ue=t.getElementById(Ne?.id()),Ae=ue?.top,Pe=Ae?.id;!(t.selectedElementsIds.indexOf(Pe)>=0)&&Pe&&(t.selectElements([Pe]),fe.target.stopDrag(),fe.target.startDrag(fe),(Le=L.current)===null||Le===void 0||Le.startDrag(fe))}ae&&ie(null)},pageId:e.id,style:{position:"absolute",overflow:"hidden",top:0,left:0}},se.createElement(OP,null,se.createElement(HT,{width:n,height:r,fill:a}),se.createElement(br,{x:j,y:T,scaleX:t.scale,scaleY:t.scale,name:"page-container"},se.createElement(br,{name:"page-container-2"},se.createElement(br,{name:"page-background-group",x:O,y:O},se.createElement(WT,{x:-e.bleed,y:-e.bleed,width:e.computedWidth+2*e.bleed,height:e.computedHeight+2*e.bleed,background:e.background,name:"page-background",preventDefault:!1,scale:t.scale})),se.createElement(br,{x:O,y:O,name:"elements-container",listening:!t.isPlaying},se.createElement(Tr,{name:"elements-area",width:e.computedWidth,height:e.computedHeight,listening:!1}),se.createElement(XT,{elements:e.children,store:t})),se.createElement(Tr,{stroke:h,name:"bleed",strokeWidth:e.bleed,x:e.bleed/2,y:e.bleed/2,width:e.computedWidth+e.bleed,height:e.computedHeight+e.bleed,listening:!1,visible:e.bleed>0&&t.bleedVisible,hideInExport:!0}),cT()===QT&&se.createElement(JT,{name:"hit-detection",x:-Be/2-Ce,y:-Be/2-Ce,width:M+Be+2*Ce,height:F+Be+2*Ce}))),se.createElement(df,{name:"workspace-background",points:[0,0,n,0,n,r,0,r,0,0,j,T,j,r-T,n-j,r-T,n-j,T,j,T],listening:!1,closed:!0,fill:a}),se.createElement(br,{x:j,y:T,scaleX:t.scale,scaleY:t.scale},se.createElement(Tr,{name:"page-highlight",hideInExport:!0,x:-Be/2-Ce,y:-Be/2-Ce,width:M+Be+2*Ce,height:F+Be+2*Ce,stroke:Me?s:o,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),se.createElement(br,{x:j+O*t.scale,y:T+O*t.scale,scaleX:t.scale,scaleY:t.scale,name:"page-abs-container"},se.createElement(bp,{ref:L,onDragStart:fe=>{var Le;!((Le=fe.evt)===null||Le===void 0)&&Le.altKey&&f&&t.selectedElements.forEach(Ne=>{const ue=Ne.clone({},{skipSelect:!0}),Ae=e.children.indexOf(Ne);e.setElementZIndex(ue.id,Ae)}),t.history.startTransaction()},onDragEnd:()=>{t.history.endTransaction()},onTransformStart:()=>{t.history.startTransaction(),ie(null)},boundBoxFunc:(fe,Le)=>{const Ne=Math.abs(Le.width)<1||Math.abs(Le.height)<1,ue=Math.abs(fe.width)<1||Math.abs(fe.height)<1;return Ne&&!ue?fe:Le},onTransform:fe=>{var Le,Ne;const ue=L.current.nodes(),Ae=ue[ue.length-1];if(fe.target!==Ae)return;const Pe=(Le=L.current)===null||Le===void 0?void 0:Le.__getNodeRect(),Ue=(Ne=L.current)===null||Ne===void 0?void 0:Ne.getActiveAnchor();te({anchor:Ue,x:Pe.x,y:Pe.y,rotation:Pe.rotation,width:Pe.width,height:Pe.height})},onTransformEnd:fe=>{te({}),t.history.endTransaction()},visible:!t.isPlaying}),ae&&ae.map(({points:fe,distance:Le,box1:Ne,box2:ue},Ae)=>se.createElement(br,{name:"distances-container",hideInExport:!0,key:Ae,listening:!1},se.createElement(Tr,Object.assign({},Ne,{stroke:S,strokeWidth:1,strokeScaleEnabled:!1})),se.createElement(Tr,Object.assign({},ue,{stroke:S,strokeWidth:1,strokeScaleEnabled:!1})),se.createElement(df,{points:[fe[0].x,fe[0].y,fe[1].x,fe[1].y],stroke:S,strokeWidth:1,strokeScaleEnabled:!1}),se.createElement(df,{points:[fe[1].x,fe[1].y,fe[2].x,fe[2].y],stroke:S,strokeWidth:1,strokeScaleEnabled:!1}),se.createElement(v0,{x:(fe[0].x+fe[1].x)/2,y:(fe[0].y+fe[1].y)/2,offsetY:-10,scaleX:1/t.scale,scaleY:1/t.scale},se.createElement(m0,{cornerRadius:5,fill:k,pointerDirection:"down"}),se.createElement(Fu,{align:"center",verticalAlign:"middle",fill:I,padding:5,text:bT({unit:t.unit,dpi:t.dpi,px:Le})})))),e._rendering&&se.createElement(br,null,se.createElement(Tr,{width:M,height:F,fill:"rgba(255,255,255,0.9)"}),se.createElement(Fu,{text:"Rendering...",fontSize:60,width:M,height:F,align:"center",verticalAlign:"middle"})),ge&&se.createElement(ge,{components:u,store:t,page:e,stageRef:$}),Te&&se.createElement(y0,null,se.createElement(Te,Object.assign({components:u,store:t},V.props)))),se.createElement(YT,Object.assign({},Z,{store:t,tagFill:E,textFill:A})),se.createElement(VT,{selection:K,fill:v,stroke:p,strokeWidth:y}),fT()&&se.createElement(Fu,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:n-170,y:r-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")}}),se.createElement(br,{name:"line-guides"}))),J&&Ee&&se.createElement(Ee,{store:t,page:e,xPadding:j,yPadding:T}))}),tR=Ed("div",se.forwardRef)`
419
+ position: absolute;
420
+ top: 0;
421
+ left: 0;
422
+ pointer-events: none;
423
+ `,nR=Ed("div",se.forwardRef)`
424
+ height: 14px;
425
+ position: sticky;
426
+ font-size: 8px;
427
+ line-height: 14px;
428
+ top: 0;
429
+ left: 0;
430
+ color: grey;
431
+ border-bottom: 1px solid grey;
432
+ background-color: #e8e8e8;
433
+ overflow: hidden;
434
+ `,rR=Ed("div",se.forwardRef)`
435
+ left: 0;
436
+ width: 14px;
437
+ position: sticky;
438
+ font-size: 8px;
439
+ line-height: 14px;
440
+ color: grey;
441
+ border-right: 1px solid grey;
442
+ background-color: #e8e8e8;
443
+ overflow: hidden;
444
+ `,iR=Ed("div",se.forwardRef)`
445
+ position: absolute;
446
+ border-left: 1px solid grey;
447
+ padding-left: 2px;
448
+ `,aR=Ed("div",se.forwardRef)`
449
+ position: absolute;
450
+ left: 14px;
451
+ border-left: 1px solid grey;
452
+ padding-left: 2px;
453
+ transform: rotate(90deg);
454
+ transform-origin: left top;
455
+ overflow: hidden;
456
+ `,oR=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4],sR=ri(({store:t,width:e,height:n})=>{const r=se.useRef(null);if(!t.activePage)return null;const i=t.activePage,a=(t.bleedVisible&&i.bleed,i.computedWidth*t.scale),o=i.computedHeight*t.scale,s=(e-a)/2,u=(h=y=>S4({unitVal:y,dpi:t.dpi,unit:t.unit})*t.scale,oR.find(y=>h(y)>30)||1e4);var h;const f=S4({unitVal:u,dpi:t.dpi,unit:t.unit})*t.scale,g=Math.round(a/f)+1,v=Math.round(o/f)+1,p=Q0(t.selectedShapes);return se.createElement(tR,{ref:r,className:"polotno-rulers"},se.createElement(nR,{style:{width:e+"px"},className:"polotno-x-ruler"},[...Array(g)].map((y,_)=>se.createElement(iR,{key:_,style:{left:s+_*f+"px",width:f+"px"}},t.unit==="px"||u>=1?Math.round(u*_):(u*_).toFixed(1))),!!t.selectedShapes.length&&se.createElement("div",{style:{position:"absolute",left:s+p.x*t.scale+"px",height:"14px",width:p.width*t.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),t.pages.map((y,_)=>{var x;const b=y.computedHeight*t.scale,E=(n-b)/2;return se.createElement(rR,{key:y.id,style:{height:n-14+"px"},className:"polotno-y-ruler"},[...Array(v)].map((A,S)=>se.createElement(aR,{key:S,style:{top:E+S*f-14+"px",width:f+"px"}},t.unit==="px"||u>=1?Math.round(u*S):(u*S).toFixed(1))),((x=t.selectedShapes[0])===null||x===void 0?void 0:x.page)===y&&se.createElement("div",{style:{position:"absolute",top:E+p.y*t.scale-14+"px",width:"14px",height:p.height*t.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))}),lR=ri(({audio:t,store:e})=>{const[n]=(function(r){const[i,a]=se.useState(null),[o,s]=se.useState("loading");return se.useEffect(()=>{const u=new Audio(r),h=()=>{s("loaded"),a(u)},f=()=>{s("failed"),a(null)};return u.addEventListener("canplay",h),u.addEventListener("error",f),()=>{u.removeEventListener("canplay",h),u.removeEventListener("error",f)}},[r]),[i,o]})(t.src);return se.useEffect(()=>{n&&e.history.ignore(()=>{t.set({duration:1e3*n.duration})})},[n,t,e.history]),se.useEffect(()=>{if(!n)return;const r=()=>{n.currentTime=t.startTime*t.duration/1e3},i=()=>{const o=t.endTime*t.duration/1e3;n.currentTime>=o&&(n.pause(),n.currentTime=t.startTime*t.duration/1e3)};n.addEventListener("ended",r),n.addEventListener("timeupdate",i);const a=zu(()=>{const o=e.animatedElementsIds;if(o.length&&!o.includes(t.id))return;const s=e.currentTime-t.delay,u=t.duration*(t.endTime-t.startTime),h=s>=0&&s<u;if(!e.isPlaying||e.animatedElementsIds.length!==0||!h)return void n.pause();n.volume=t.volume,n.paused&&n.play();const f=s%u/1e3+t.startTime*t.duration/1e3,g=n.currentTime;Math.abs(g-f)>.5&&f!==g&&(n.currentTime=f)});return()=>{n.pause(),n.removeEventListener("ended",r),n.removeEventListener("timeupdate",i),a()}},[e.isPlaying,t.startTime,t.endTime,t.volume,n]),null});let w_={data:[],pageId:""};const S0="polotno_clipboard",wy=(t,e)=>{w_={data:JSON.parse(JSON.stringify(t)),pageId:e};try{localStorage.setItem(S0,JSON.stringify(t)),localStorage.setItem(S0+"_page",e)}catch{}},uR=()=>{try{const t=localStorage.getItem(S0),e=localStorage.getItem(S0+"_page");if(t)return{data:JSON.parse(t),pageId:e}}catch{}return w_},cR=t=>{var e;t.selectedElements.length!==0&&wy(t.selectedElements.map(n=>n.toJSON()),(e=t.activePage)===null||e===void 0?void 0:e.id)},fR=t=>{var e;wy(t.selectedElements.map(r=>r.toJSON()),(e=t.activePage)===null||e===void 0?void 0:e.id);let n=t.selectedElements.filter(r=>r.removable).map(r=>r.id);t.deleteElements(n)},hR=t=>{t.history.transaction(()=>{var e,n;let r=0,i=0;const{data:a,pageId:o}=uR();if(o===((e=t.activePage)===null||e===void 0?void 0:e.id))r=t.width/20,i=t.height/20;else{const u=[];Ii({children:a},f=>{f.type!=="group"&&u.push(f)});const h=Q0(u);h.maxX>t.width&&(r=-h.minX),h.maxY>t.height&&(i=-h.minY)}const s=[];Ii({children:a},u=>{delete u.id,u.type!=="group"&&(u.x+=r,u.y+=i)}),a.forEach(u=>{var h;const f=(h=t.activePage)===null||h===void 0?void 0:h.addElement(u);f&&s.push(f.id)}),wy(a,(n=t.activePage)===null||n===void 0?void 0:n.id),t.selectElements(s)})};function dR(t,e){const n=[];t.forEach(r=>{if(r.removable===!1)return;const i=r.clone();r.type==="group"?i.children.forEach(a=>{a.set({x:a.x+50,y:a.y+50})}):i.set({x:r.x+50,y:r.y+50}),n.push(i.id)}),e.selectElements(n)}const Uo=t=>{if(t.type!=="group")return kd(t);let e=1/0,n=1/0,r=-1/0,i=-1/0;return t.children.forEach(a=>{const o=Uo(a);e=Math.min(e,o.x),n=Math.min(n,o.y),r=Math.max(r,o.x+o.width),i=Math.max(i,o.y+o.height)}),{x:e,y:n,width:r-e,height:i-n}},kh=(t,e,n)=>{if(t.type!=="group"){const r=kd(t),i=e-r.x,a=n-r.y;t.set({x:t.x+i,y:t.y+a})}else{const r=e-Uo(t).x,i=n-Uo(t).y;t.children.forEach(a=>{const o=Uo(a);kh(a,o.x+r,o.y+i)})}};function pR(t){var e;let n=(e=t.activePage)===null||e===void 0?void 0:e.computedWidth;t.selectedElements.forEach(r=>{n=Math.min(n,Uo(r).x)}),t.selectedElements.length===1&&(n=0),t.selectedElements.forEach(r=>{const i=Uo(r);kh(r,i.x-i.x+n,i.y)})}function gR(t){var e;let n=0;t.selectedElements.forEach(r=>{const i=Uo(r);n=Math.max(n,i.x+i.width)}),t.selectedElements.length===1&&(n=(e=t.activePage)===null||e===void 0?void 0:e.computedWidth),t.selectedElements.forEach(r=>{const i=Uo(r);kh(r,n-i.width,i.y)})}function vR(t){var e;let n=(e=t.activePage)===null||e===void 0?void 0:e.computedHeight;t.selectedElements.forEach(r=>{n=Math.min(n,Uo(r).y)}),t.selectedElements.length===1&&(n=0),t.selectedElements.forEach(r=>{const i=Uo(r);kh(r,i.x,i.y-i.y+n)})}function mR(t){var e,n;let r=(e=t.activePage)===null||e===void 0?void 0:e.computedHeight,i=0;t.selectedElements.forEach(o=>{const s=Uo(o);r=Math.min(r,s.y),i=Math.max(i,s.y+s.height)});let a=(i+r)/2;t.selectedElements.length===1&&(a=((n=t.activePage)===null||n===void 0?void 0:n.computedHeight)/2),t.selectedElements.forEach(o=>{const s=Uo(o);kh(o,s.x,a-s.height/2)})}function yR(t){var e;let n=0;t.selectedElements.forEach(r=>{const i=Uo(r);n=Math.max(n,i.y+i.height)}),t.selectedElements.length===1&&(n=(e=t.activePage)===null||e===void 0?void 0:e.computedHeight),t.selectedElements.forEach(r=>{const i=Uo(r);kh(r,i.x,n-i.height)})}function bR(t){var e,n;let r=(e=t.activePage)===null||e===void 0?void 0:e.computedWidth,i=0;t.selectedElements.forEach(o=>{const s=Uo(o);r=Math.min(r,s.x),i=Math.max(i,s.x+s.width)});let a=(i+r)/2;t.selectedElements.length===1&&(a=((n=t.activePage)===null||n===void 0?void 0:n.computedWidth)/2),t.selectedElements.forEach(o=>{const s=Uo(o);kh(o,a-s.width/2,s.y)})}const _v="rgba(191, 191, 191, 100)";function wR(t,e){var n,r,i,a;if(((n=document.activeElement)===null||n===void 0?void 0:n.tagName)==="INPUT"||((r=document.activeElement)===null||r===void 0?void 0:r.tagName)==="TEXTAREA"||((i=document.activeElement)===null||i===void 0?void 0:i.contentEditable)==="true")return;const o=document.querySelector(".polotno-workspace-container");if(document.activeElement!==o&&!o?.contains(document.activeElement)){const g=window.getSelection();if(g&&g.toString().length>0)return}const s=e.selectedElements.filter(g=>g.removable).map(g=>g.id);t.keyCode!==46&&t.keyCode!==8||e.deleteElements(s);const u=t.ctrlKey||t.metaKey,h=t.shiftKey,f=t.altKey;if(!u||h||t.key.toLowerCase()!=="z"&&t.key.toLowerCase()!=="y"||(t.preventDefault(),e.history.undo()),u&&h&&(t.key.toLowerCase()==="z"||t.key.toLowerCase()==="y")&&(t.preventDefault(),e.history.redo()),u&&t.code==="KeyA"){t.preventDefault();const g=(a=e.activePage)===null||a===void 0?void 0:a.children.filter(p=>p.selectable),v=g?.map(p=>p.id)||[];e.selectElements(v)}if(u&&t.code==="KeyC"&&(t.preventDefault(),cR(e)),u&&t.code==="KeyX"&&(t.preventDefault(),fR(e)),u&&t.code==="KeyV"&&(t.preventDefault(),hR(e)),t.code==="ArrowDown"&&(t.preventDefault(),e.selectedShapes.forEach(g=>{g.draggable&&g.set({y:g.y+1})})),t.code==="ArrowUp"&&(t.preventDefault(),e.selectedShapes.forEach(g=>{g.draggable&&g.set({y:g.y-1})})),t.code==="ArrowLeft"&&(t.preventDefault(),e.selectedShapes.forEach(g=>{g.draggable&&g.set({x:g.x-1})})),t.code==="ArrowRight"&&(t.preventDefault(),e.selectedShapes.forEach(g=>{g.draggable&&g.set({x:g.x+1})})),u&&t.code==="KeyG"){t.preventDefault();const g=e.selectedElements[0];if(g&&g.type==="group"){const v=g;e.ungroupElements([v.id])}else e.groupElements(e.selectedElements.map(v=>v.id))}if(u&&t.code==="KeyD"&&(t.preventDefault(),dR(e.selectedElements,e)),t.code==="KeyT"&&!u){t.preventDefault();const g=30,v=e.width/2,p=e.width/2-v/2,y=e.height/2-g/2,_=2160,x=(e.width+e.height)/_;e.activePage.addElement({type:"text",x:p,y,width:v,fontSize:g*x,text:"Sample Text",fontFamily:"Roboto"})}if(t.code==="KeyR"&&!u){t.preventDefault();const g={type:"figure",x:e.width/4,y:e.height/4,width:300,height:300,fill:_v,stroke:"#0c0c0c",strokeWidth:0,subType:"rect"};e.activePage.addElement(g)}if(t.code==="KeyL"&&!u){t.preventDefault();const g=e.activePage.computedWidth/3,v={type:"line",x:e.activePage.computedWidth/2-g/2,y:e.activePage.computedHeight/2,width:g,color:_v};e.activePage.addElement(v)}if(t.code==="KeyO"&&!u){t.preventDefault(),t.preventDefault();const g={type:"figure",x:e.width/4,y:e.height/4,width:300,height:300,fill:_v,stroke:"#0c0c0c",strokeWidth:0,subType:"circle"};e.activePage.addElement(g)}u&&t.code==="Equal"&&(t.preventDefault(),e.setScale(e.scale+.1)),u&&t.code==="Minus"&&(t.preventDefault(),e.setScale(e.scale-.1)),f&&(t.code==="KeyA"&&(t.preventDefault(),pR(e)),t.code==="KeyD"&&(t.preventDefault(),gR(e)),t.code==="KeyS"&&(t.preventDefault(),yR(e)),t.code==="KeyW"&&(t.preventDefault(),vR(e)),t.code==="KeyV"&&(t.preventDefault(),mR(e)),t.code==="KeyH"&&(t.preventDefault(),bR(e))),t.code==="BracketRight"&&(t.preventDefault(),u?e.activePage.moveElementsUp(e.selectedElementsIds):e.activePage.moveElementsTop(e.selectedElementsIds)),t.code==="BracketLeft"&&(t.preventDefault(),u?e.activePage.moveElementsDown(e.selectedElementsIds):e.activePage.moveElementsBottom(e.selectedElementsIds))}const Em=Kn({toolbar:{duration:"Duration",opacity:"Opacity",effects:"Effects",blur:"Blur",curvedText:"Curved text",curvePower:"Power",temperature:"Temperature",saturation:"Saturation",contrast:"Contrast",shadows:"Shadows",white:"White",black:"Black",vibrance:"Vibrance",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",uppercase:"Uppercase",position:"Position",layering:"Layering",toForward:"To Front",up:"Forward",down:"Backward",toBottom:"To back",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom",flip:"Flip",flipHorizontally:"Flip horizontally",flipVertically:"Flip vertically",fitToBackground:"Fit to page",removeBackground:"Remove background",removeBackgroundTitle:"Remove background from image",cancelRemoveBackground:"Cancel",confirmRemoveBackground:"Confirm",crop:"Crop",cropDone:"Done",cropCancel:"Cancel",clip:"Apply mask",removeClip:"Remove mask",removeMask:"Remove mask",transparency:"Transparency",lockedDescription:"Object is locked. Unlock it to allow changes from canvas.",unlockedDescription:"Object is unlocked. Lock it to prevent changes from canvas.",removeElements:"Remove elements",duplicateElements:"Duplicate elements",download:"Download",saveAsImage:"Save as image",saveAsPDF:"Save as PDF",lineHeight:"Line height",letterSpacing:"Letter spacing",offsetX:"Offset X",offsetY:"Offset Y",color:"Color",selectable:"Selectable",draggable:"Draggable",removable:"Removable",resizable:"Resizable",contentEditable:"Can change content",styleEditable:"Can change style",alwaysOnTop:"Always on top",showInExport:"Show in export",ungroupElements:"Ungroup",groupElements:"Group",lineSize:"Line size",fade:"Fade",move:"Move",zoom:"Zoom",animate:"Animate",rotate:"Rotate",none:"None",bounce:"Bounce",blink:"Blink",strength:"Strength",spaceEvenly:"Space evenly",horizontalDistribution:"Horizontally",verticalDistribution:"Vertically",strokeWidth:"Stroke Width",colorPicker:{solid:"Solid",linear:"Linear",angle:"Angle"},aiText:{aiWrite:"AI write",rewrite:"Rewrite",shorten:"Shorten",continue:"Continue writing",proofread:"Proofread",tones:"Tones",friendly:"Friendly",professional:"Professional",humorous:"Humorous",formal:"Formal",customPrompt:"Custom prompt",generatedResult:"Generated result",cancel:"Cancel",generate:"Generate",back:"Back",tryAgain:"Try Again",insert:"Insert",promptPlaceholder:"Describe what you want to generate"}},workspace:{noPages:"There are no pages yet...",addPage:"Add page",removePage:"Remove page",duplicatePage:"Duplicate page",moveUp:"Move up",moveDown:"Move down"},scale:{reset:"Reset"},error:{removeBackground:"Ops! Something went wrong. Background can not be removed."},sidePanel:{templates:"Templates",searchTemplatesWithSameSize:"Show templates with the same size",searchPlaceholder:"Search...",otherFormats:"Other formats",noResults:"No results",error:"Loading is failed...",text:"Text",uploadFont:"Upload font",myFonts:"My fonts",photos:"Photos",videos:"Videos",animations:"Animations",effects:"Effects",elements:"Elements",shapes:"Shapes",lines:"Lines",upload:"Upload",uploadImage:"Add file",uploadTip:"Upload your assets",background:"Background",resize:"Resize",layers:"Layers",animate:"Animate",layerTypes:{image:"Image",text:"Text",svg:"SVG",line:"Line",figure:"Figure",group:"Group"},layersTip:"Elements on your active page:",noLayers:"No elements on the page...",namePlaceholder:"Type element name...",useMagicResize:"Use magic resize",clipImage:"Mask image",width:"Width",height:"Height",magicResizeDescription:"Magic resize will automatically resize and move all elements on the canvas",headerText:"Header",createHeader:"Create header",subHeaderText:"Sub Header",createSubHeader:"Create sub header",bodyText:"Body text",createBody:"Create body text"},pagesTimeline:{pages:"Pages",removePage:"Remove page",addPage:"Add page",duplicatePage:"Duplicate page",removeAudio:"Remove audio"},contextMenu:{duplicate:"Duplicate",remove:"Remove",lock:"Lock",unlock:"Unlock",copy:"Copy",paste:"Paste",copyStyle:"Copy style",moveUp:"Move up",moveDown:"Move down",moveBack:"Move back",moveForward:"Move forward"}}),E0=t=>t&&typeof t=="object";function __(t,e){Object.keys(e).forEach(n=>{const r=t[n],i=e[n];E0(i)&&E0(r)?__(r,i):t[n]=i})}function x_(t,e,n=""){Object.keys(e).forEach(r=>{const i=e[r],a=n?`${n}.${r}`:r;E0(i)?E0(t[r])?x_(t[r],i,a):console.warn(`Missing nested translation object at '${a}'`):t[r]===void 0&&console.warn(`Missing translation '${a}'`)})}Jn((t,{validate:e=!1}={})=>{e&&x_(t,Em),__(Em,t)});const R4={},M4=t=>{const e=(function(i,a){var o,s=a.split("."),u=i;for(o=0;o<s.length;++o){if(u[s[o]]==null)return;u=u[s[o]]}return u})(Em,t);if(e!==void 0)return e;R4[t]||(R4[t]=!0,console.warn(`Missing translation '${t}'`));const n=t.split("."),r=n[n.length-1]||" ";return r.charAt(0).toUpperCase()+r.slice(1)},_R=({store:t})=>se.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},se.createElement("p",null,M4("workspace.noPages")),se.createElement("button",{onClick:()=>{t.addPage()}},M4("workspace.addPage"))),xR=({width:t,height:e,xPadding:n,yPadding:r,backgroundColor:i})=>se.createElement("div",{style:{width:t+"px",height:e+"px",backgroundColor:i,paddingLeft:n+"px",paddingRight:n+"px",paddingTop:r+"px",paddingBottom:r+"px"}},se.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}})),SR=[4,6],ER=ri(({store:t,pageControlsEnabled:e,backgroundColor:n,pageBorderColor:r,activePageBorderColor:i,bleedColor:a,snapGuideStroke:o,snapGuideStrokeWidth:s,snapGuideDash:u,selectionRectFill:h,selectionRectStroke:f,selectionRectStrokeWidth:g,transformLabelFill:v,transformLabelTextFill:p,distanceGuideStroke:y,distanceLabelFill:_,distanceLabelTextFill:x,components:b,onKeyDown:E,paddingX:A,paddingY:S,altCloneEnabled:k=!0,visiblePagesOffset:I,renderOnlyActivePage:O})=>{var M;const F=A??20,j=S??55,[T,L]=se.useState({width:100,height:100}),$=se.useRef(T),q=se.useRef(null),J=se.useRef(null),ae=t.bleedVisible?Math.max(0,...t.pages.map(Ee=>Ee.bleed)):0,ie=Math.max(...t.pages.map(Ee=>Ee.computedWidth)),Z=Math.max(...t.pages.map(Ee=>Ee.computedHeight)),te=((M=t.activePage)===null||M===void 0?void 0:M.computedHeight)||0,V=ie+2*ae,B=(O?te:Z)+2*ae,D=async({skipTimeout:Ee}={skipTimeout:!1})=>{if(Ee||await new Promise(ue=>setTimeout(ue,50)),q.current===null)return;const ge=q.current.getBoundingClientRect();ge.width!==0&&ge.height!==0||(console.warn(`Polotno warning: <Workspace /> component can not automatically detect its size.
457
+ Width or height of parent elements is equal 0.
458
+ Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
459
+ For simpler debugging here is the log of the parent element:`),console.log(q.current));const Te=J.current.clientWidth||ge.width,Be={width:Te,height:ge.height};($.current.width!==Be.width||$.current.height!==Be.height)&&(L(Be),$.current=Be);const Ce=(Te-2*F)/V,fe=t.pages.length>1?3.1:2,Le=(ge.height-j*fe)/B,Ne=t.pages.length?Math.max(Math.min(Ce,Le),.01):1;t.scaleToFit!==Ne&&(t.setScale(Ne),t._setScaleToFit(Ne))};se.useLayoutEffect(()=>{D({skipTimeout:!0})},[]),se.useEffect(()=>{D()},[V,B,S,A]),se.useLayoutEffect(()=>{D({skipTimeout:!0})},[t.openedSidePanel]),se.useEffect(()=>{t.__()},[]),se.useEffect(()=>{const Ee=q.current;if(window.ResizeObserver){const ge=new ResizeObserver(()=>{D({skipTimeout:!0})});return ge.observe(Ee),()=>ge.unobserve(Ee)}{const ge=setInterval(()=>{D({skipTimeout:!0})},100);return()=>clearInterval(ge)}},[V,B]);const U=Math.max(F,(T.width-V*t.scale)/2),X=O?1:t.pages.length,ee=B*t.scale*X,K=Math.max(j,(T.height-ee)/X/2);se.useEffect(()=>{const Ee=ge=>{(E||wR)(ge,t)};return window.addEventListener("keydown",Ee),()=>window.removeEventListener("keydown",Ee)},[]),se.useEffect(()=>{var Ee;const ge=Te=>{if(Te.ctrlKey||Te.metaKey){Te.preventDefault();const Le=Math.max(5,t.scaleToFit),Ne=Math.min(.1,t.scaleToFit),ue=.03,Ae=(Be=Te.deltaY<0?t.scale*(1+ue):t.scale/(1+ue),Ce=Ne,fe=Le,Math.max(Ce,Math.min(fe,Be)));return void t.setScale(Ae)}var Be,Ce,fe};return(Ee=J.current)===null||Ee===void 0||Ee.addEventListener("wheel",ge),()=>{var Te;return(Te=J.current)===null||Te===void 0?void 0:Te.removeEventListener("wheel",ge)}},[]);const oe=se.useRef(!1);((Ee,ge,Te,Be,Ce,fe)=>{const Le=se.useRef({width:ge,height:Te}),Ne=se.useRef({top:0,left:0}),ue=se.useRef(!1),Ae=se.useRef(Ce.pages.length);ue.current=Ae.current!==Ce.pages.length,Ae.current=Ce.pages.length,se.useEffect(()=>{const Pe=Ee.current,Ue=st=>{Ne.current={top:Pe.scrollTop,left:Pe.scrollLeft}};return Pe.addEventListener("scroll",Ue),()=>{Pe.removeEventListener("scroll",Ue)}},[]),se.useLayoutEffect(()=>{if(!Ee.current||ue.current)return;const Pe=Ee.current,Ue=(Ne.current.left+Pe.offsetWidth/2)/Le.current.width,st=(Ne.current.top+Pe.offsetHeight/2)/Le.current.height;fe.current=!0,Pe.scrollLeft=Ue*ge-Pe.offsetWidth/2,Pe.scrollTop=st*Te-Pe.offsetHeight/2,Le.current={width:ge,height:Te}},[Be,ge,Te])})(J,V*t.scale+2*U,B*t.scale+2*K,t.scale,t,oe);const{handleScroll:me}=((Ee,ge,Te,Be,Ce,fe)=>{const Le=se.useRef(!1),Ne=se.useRef(null),ue=se.useRef(!1);se.useEffect(()=>{const Pe=Ee.current,Ue=()=>{Ce.current};return Pe.addEventListener("scroll",Ue),()=>{Pe.removeEventListener("scroll",Ue)}},[]);const Ae=Te.pages.indexOf(Te.activePage);return se.useLayoutEffect(()=>{if(fe||!Te.activePage||!Ee.current||Le.current)return;const Pe=Ee.current,Ue=Te.pages.indexOf(Te.activePage)*ge;let st=()=>{};return(Math.abs(Ue-Pe.scrollTop)>.5*ge||ue.current)&&(ue.current=!0,st=(({element:dt,scrollTop:pt=0,duration:xt=300,onFinish:bt=()=>{}})=>{const kt=dt.scrollTop,qn=pt-kt;let xn=0,It=!1;if(xt===0)return dt.scrollTop=pt,()=>{};const Jt=()=>{if(It)return;xn+=20;const qe=Ve(xn,kt,qn,xt);dt.scrollTop=qe,xn<xt?setTimeout(Jt,20):bt()},Ve=(qe,Nt,Ct,an)=>(qe/=an/2)<1?Ct/2*qe*qe+Nt:-Ct/2*(--qe*(qe-2)-1)+Nt;return Jt(),()=>{It=!0}})({element:Pe,scrollTop:Ue,onFinish:()=>{ue.current=!1},duration:Te.isPlaying?0:300})),st},[Te.activePage,Ae,Te.isPlaying,fe]),{handleScroll:Pe=>{if(fe||ue.current)return;Le.current=!0,clearTimeout(Ne.current),Ne.current=setTimeout(()=>{Le.current=!1},300);const Ue=Pe.currentTarget.childNodes[0].offsetHeight,st=Pe.currentTarget.scrollTop,dt=Math.floor((st+Be.height/3)/Ue),pt=Te.pages[dt];pt&&Te.activePage!==pt&&pt.select()}}})(J,B*t.scale+2*K,t,T,oe,O),de=T.width>=V*t.scale+2*U,ye=n||"rgba(232, 232, 232, 0.9)",Re=t.pages.indexOf(t.activePage),Oe=b?.NoPages||_R,Me=I??Math.min(3,Math.max(1,Math.ceil(T.height/2/(B*t.scale))));return se.createElement("div",{ref:q,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:ye,overflow:"hidden"},tabIndex:0,className:"polotno-workspace-container"},se.createElement("div",{ref:J,onScroll:me,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:de?"hidden":"auto"},className:"polotno-workspace-inner"},t.pages.map((Ee,ge)=>{const Te=Ee===t.activePage;if(O&&!Te&&!Ee._exportingOrRendering&&!Ee._forceMount)return null;if(!(Math.abs(ge-Re)<=Me||Ee._exportingOrRendering||Ee._forceMount))return se.createElement(xR,{key:Ee.id,width:V*t.scale+2*U,height:B*t.scale+2*K,backgroundColor:ye,xPadding:U,yPadding:K});const Be=se.createElement(eR,{key:Ee.id,page:Ee,xPadding:U,yPadding:K,width:V*t.scale+2*U,height:B*t.scale+2*K,store:t,pageControlsEnabled:e,backColor:ye,pageBorderColor:r||"lightgrey",activePageBorderColor:i||"rgb(0, 161, 255)",altCloneEnabled:k,bleedColor:a||"rgba(255, 0, 0, 0.1)",selectionRectFill:h,selectionRectStroke:f,selectionRectStrokeWidth:g,snapGuideStroke:o||"rgb(0, 161, 255)",snapGuideStrokeWidth:s||1,snapGuideDash:u||SR,transformLabelFill:v,transformLabelTextFill:p,distanceGuideStroke:y||"rgb(0, 161, 255)",distanceLabelFill:_||"rgb(0, 161, 255)",distanceLabelTextFill:x||"white",components:b,viewportSize:T});return(Ee._exportingOrRendering||Ee._forceMount)&&!Te&&O?se.createElement("div",{style:{display:"none"},key:Ee.id},Be):Be}),t.rulesVisible&&se.createElement(sR,{store:t,xPadding:U,yPadding:K,width:V*t.scale+2*U,height:B*t.scale+2*K}),t.pages.length===0&&se.createElement(Oe,{store:t}),t.audios.map(Ee=>se.createElement(lR,{key:Ee.id,audio:Ee,store:t}))))}),kR="modulepreload",AR=function(t,e){return new URL(t,e).href},I4={},xv=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){let h=function(f){return Promise.all(f.map(g=>Promise.resolve(g).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const o=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),u=s?.nonce||s?.getAttribute("nonce");i=h(n.map(f=>{if(f=AR(f,r),f in I4)return;I4[f]=!0;const g=f.endsWith(".css"),v=g?'[rel="stylesheet"]':"";if(r)for(let y=o.length-1;y>=0;y--){const _=o[y];if(_.href===f&&(!g||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${v}`))return;const p=document.createElement("link");if(p.rel=g?"stylesheet":kR,g||(p.as="script"),p.crossOrigin="",p.href=f,u&&p.setAttribute("nonce",u),document.head.appendChild(p),g)return new Promise((y,_)=>{p.addEventListener("load",y),p.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${f}`)))})}))}function a(o){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o}return i.then(o=>{for(const s of o||[])s.status==="rejected"&&a(s.reason);return e().catch(a)})};function Nr(t){"@babel/helpers - typeof";return Nr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nr(t)}var nu=Uint8Array,il=Uint16Array,_y=Int32Array,xy=new nu([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Sy=new nu([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),j4=new nu([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),S_=function(t,e){for(var n=new il(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];for(var i=new _y(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return{b:n,r:i}},E_=S_(xy,2),PR=E_.b,km=E_.r;PR[28]=258,km[258]=28;var OR=S_(Sy,0),D4=OR.r,Am=new il(32768);for(var di=0;di<32768;++di){var af=(di&43690)>>1|(di&21845)<<1;af=(af&52428)>>2|(af&13107)<<2,af=(af&61680)>>4|(af&3855)<<4,Am[di]=((af&65280)>>8|(af&255)<<8)>>1}var hp=(function(t,e,n){for(var r=t.length,i=0,a=new il(e);i<r;++i)t[i]&&++a[t[i]-1];var o=new il(e);for(i=1;i<e;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(n){s=new il(1<<e);var u=15-e;for(i=0;i<r;++i)if(t[i])for(var h=i<<4|t[i],f=e-t[i],g=o[t[i]-1]++<<f,v=g|(1<<f)-1;g<=v;++g)s[Am[g]>>u]=h}else for(s=new il(r),i=0;i<r;++i)t[i]&&(s[i]=Am[o[t[i]-1]++]>>15-t[i]);return s}),hh=new nu(288);for(var di=0;di<144;++di)hh[di]=8;for(var di=144;di<256;++di)hh[di]=9;for(var di=256;di<280;++di)hh[di]=7;for(var di=280;di<288;++di)hh[di]=8;var k0=new nu(32);for(var di=0;di<32;++di)k0[di]=5;var CR=hp(hh,9,0),LR=hp(k0,5,0),k_=function(t){return(t+7)/8|0},NR=function(t,e,n){return(n==null||n>t.length)&&(n=t.length),new nu(t.subarray(e,n))},lc=function(t,e,n){n<<=e&7;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8},$d=function(t,e,n){n<<=e&7;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8,t[r+2]|=n>>16},Sv=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var i=n.length,a=n.slice();if(!i)return{t:P_,l:0};if(i==1){var o=new nu(n[0].s+1);return o[n[0].s]=1,{t:o,l:1}}n.sort(function(k,I){return k.f-I.f}),n.push({s:-1,f:25001});var s=n[0],u=n[1],h=0,f=1,g=2;for(n[0]={s:-1,f:s.f+u.f,l:s,r:u};f!=i-1;)s=n[n[h].f<n[g].f?h++:g++],u=n[h!=f&&n[h].f<n[g].f?h++:g++],n[f++]={s:-1,f:s.f+u.f,l:s,r:u};for(var v=a[0].s,r=1;r<i;++r)a[r].s>v&&(v=a[r].s);var p=new il(v+1),y=Pm(n[f-1],p,0);if(y>e){var r=0,_=0,x=y-e,b=1<<x;for(a.sort(function(I,O){return p[O.s]-p[I.s]||I.f-O.f});r<i;++r){var E=a[r].s;if(p[E]>e)_+=b-(1<<y-p[E]),p[E]=e;else break}for(_>>=x;_>0;){var A=a[r].s;p[A]<e?_-=1<<e-p[A]++-1:++r}for(;r>=0&&_;--r){var S=a[r].s;p[S]==e&&(--p[S],++_)}y=e}return{t:new nu(p),l:y}},Pm=function(t,e,n){return t.s==-1?Math.max(Pm(t.l,e,n+1),Pm(t.r,e,n+1)):e[t.s]=n},F4=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new il(++e),r=0,i=t[0],a=1,o=function(u){n[r++]=u},s=1;s<=e;++s)if(t[s]==i&&s!=e)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=t[s]}return{c:n.subarray(0,r),n:e}},Gd=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},A_=function(t,e,n){var r=n.length,i=k_(e+2);t[i]=r&255,t[i+1]=r>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var a=0;a<r;++a)t[i+a+4]=n[a];return(i+4+r)*8},B4=function(t,e,n,r,i,a,o,s,u,h,f){lc(e,f++,n),++i[256];for(var g=Sv(i,15),v=g.t,p=g.l,y=Sv(a,15),_=y.t,x=y.l,b=F4(v),E=b.c,A=b.n,S=F4(_),k=S.c,I=S.n,O=new il(19),M=0;M<E.length;++M)++O[E[M]&31];for(var M=0;M<k.length;++M)++O[k[M]&31];for(var F=Sv(O,7),j=F.t,T=F.l,L=19;L>4&&!j[j4[L-1]];--L);var $=h+5<<3,q=Gd(i,hh)+Gd(a,k0)+o,J=Gd(i,v)+Gd(a,_)+o+14+3*L+Gd(O,j)+2*O[16]+3*O[17]+7*O[18];if(u>=0&&$<=q&&$<=J)return A_(e,f,t.subarray(u,u+h));var ae,ie,Z,te;if(lc(e,f,1+(J<q)),f+=2,J<q){ae=hp(v,p,0),ie=v,Z=hp(_,x,0),te=_;var V=hp(j,T,0);lc(e,f,A-257),lc(e,f+5,I-1),lc(e,f+10,L-4),f+=14;for(var M=0;M<L;++M)lc(e,f+3*M,j[j4[M]]);f+=3*L;for(var B=[E,k],D=0;D<2;++D)for(var U=B[D],M=0;M<U.length;++M){var X=U[M]&31;lc(e,f,V[X]),f+=j[X],X>15&&(lc(e,f,U[M]>>5&127),f+=U[M]>>12)}}else ae=CR,ie=hh,Z=LR,te=k0;for(var M=0;M<s;++M){var ee=r[M];if(ee>255){var X=ee>>18&31;$d(e,f,ae[X+257]),f+=ie[X+257],X>7&&(lc(e,f,ee>>23&31),f+=xy[X]);var K=ee&31;$d(e,f,Z[K]),f+=te[K],K>3&&($d(e,f,ee>>5&8191),f+=Sy[K])}else $d(e,f,ae[ee]),f+=ie[ee]}return $d(e,f,ae[256]),f+ie[256]},TR=new _y([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),P_=new nu(0),RR=function(t,e,n,r,i,a){var o=a.z||t.length,s=new nu(r+o+5*(1+Math.ceil(o/7e3))+i),u=s.subarray(r,s.length-i),h=a.l,f=(a.r||0)&7;if(e){f&&(u[0]=a.r>>3);for(var g=TR[e-1],v=g>>13,p=g&8191,y=(1<<n)-1,_=a.p||new il(32768),x=a.h||new il(y+1),b=Math.ceil(n/3),E=2*b,A=function(Ee){return(t[Ee]^t[Ee+1]<<b^t[Ee+2]<<E)&y},S=new _y(25e3),k=new il(288),I=new il(32),O=0,M=0,F=a.i||0,j=0,T=a.w||0,L=0;F+2<o;++F){var $=A(F),q=F&32767,J=x[$];if(_[q]=J,x[$]=q,T<=F){var ae=o-F;if((O>7e3||j>24576)&&(ae>423||!h)){f=B4(t,u,0,S,k,I,M,j,L,F-L,f),j=O=M=0,L=F;for(var ie=0;ie<286;++ie)k[ie]=0;for(var ie=0;ie<30;++ie)I[ie]=0}var Z=2,te=0,V=p,B=q-J&32767;if(ae>2&&$==A(F-B))for(var D=Math.min(v,ae)-1,U=Math.min(32767,F),X=Math.min(258,ae);B<=U&&--V&&q!=J;){if(t[F+Z]==t[F+Z-B]){for(var ee=0;ee<X&&t[F+ee]==t[F+ee-B];++ee);if(ee>Z){if(Z=ee,te=B,ee>D)break;for(var K=Math.min(B,ee-2),oe=0,ie=0;ie<K;++ie){var me=F-B+ie&32767,de=_[me],ye=me-de&32767;ye>oe&&(oe=ye,J=me)}}}q=J,J=_[q],B+=q-J&32767}if(te){S[j++]=268435456|km[Z]<<18|D4[te];var Re=km[Z]&31,Oe=D4[te]&31;M+=xy[Re]+Sy[Oe],++k[257+Re],++I[Oe],T=F+Z,++O}else S[j++]=t[F],++k[t[F]]}}for(F=Math.max(F,T);F<o;++F)S[j++]=t[F],++k[t[F]];f=B4(t,u,h,S,k,I,M,j,L,F-L,f),h||(a.r=f&7|u[f/8|0]<<3,f-=7,a.h=x,a.p=_,a.i=F,a.w=T)}else{for(var F=a.w||0;F<o+h;F+=65535){var Me=F+65535;Me>=o&&(u[f/8|0]=h,Me=o),f=A_(u,f+1,t.subarray(F,Me))}a.i=o}return NR(s,0,r+k_(f)+i)},O_=function(){var t=1,e=0;return{p:function(n){for(var r=t,i=e,a=n.length|0,o=0;o!=a;){for(var s=Math.min(o+2655,a);o<s;++o)i+=r+=n[o];r=(r&65535)+15*(r>>16),i=(i&65535)+15*(i>>16)}t=r,e=i},d:function(){return t%=65521,e%=65521,(t&255)<<24|(t&65280)<<8|(e&255)<<8|e>>8}}},MR=function(t,e,n,r,i){if(!i&&(i={l:1},e.dictionary)){var a=e.dictionary.subarray(-32768),o=new nu(a.length+t.length);o.set(a),o.set(t,a.length),t=o,i.w=a.length}return RR(t,e.level==null?6:e.level,e.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,n,r,i)},C_=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},IR=function(t,e){var n=e.level,r=n==0?0:n<6?1:n==9?3:2;if(t[0]=120,t[1]=r<<6|(e.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,e.dictionary){var i=O_();i.p(e.dictionary),C_(t,2,i.d())}};function Om(t,e){e||(e={});var n=O_();n.p(t);var r=MR(t,e,e.dictionary?6:2,4);return IR(r,e),C_(r,r.length-4,n.d()),r}var jR=typeof TextDecoder<"u"&&new TextDecoder,DR=0;try{jR.decode(P_,{stream:!0}),DR=1}catch{}function FR(t){if(Array.isArray(t))return t}function BR(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,o,s=[],u=!0,h=!1;try{if(a=(n=n.call(t)).next,e!==0)for(;!(u=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(f){h=!0,i=f}finally{try{if(!u&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(h)throw i}}return s}}function z4(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function zR(t,e){if(t){if(typeof t=="string")return z4(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?z4(t,e):void 0}}function qR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
460
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q4(t,e){return FR(t)||BR(t,e)||zR(t,e)||qR()}function U4(t,e="utf8"){return new TextDecoder(e).decode(t)}const UR=new TextEncoder;function HR(t){return UR.encode(t)}const $R=1024*8,GR=(()=>{const t=new Uint8Array(4),e=new Uint32Array(t.buffer);return!((e[0]=1)&t[0])})(),Ev={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class Ey{buffer;byteLength;byteOffset;length;offset;lastWrittenByte;littleEndian;_data;_mark;_marks;constructor(e=$R,n={}){let r=!1;typeof e=="number"?e=new ArrayBuffer(e):(r=!0,this.lastWrittenByte=e.byteLength);const i=n.offset?n.offset>>>0:0,a=e.byteLength-i;let o=i;(ArrayBuffer.isView(e)||e instanceof Ey)&&(e.byteLength!==e.buffer.byteLength&&(o=e.byteOffset+i),e=e.buffer),r?this.lastWrittenByte=a:this.lastWrittenByte=0,this.buffer=e,this.length=a,this.byteLength=a,this.byteOffset=o,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,o,a),this._mark=0,this._marks=[]}available(e=1){return this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(e=1){return this.offset+=e,this}back(e=1){return this.offset-=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const e=this._marks.pop();if(e===void 0)throw new Error("Mark stack empty");return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(e=1){if(!this.available(e)){const r=(this.offset+e)*2,i=new Uint8Array(r);i.set(new Uint8Array(this.buffer)),this.buffer=i.buffer,this.length=r,this.byteLength=r,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(e=1){return this.readArray(e,"uint8")}readArray(e,n){const r=Ev[n].BYTES_PER_ELEMENT*e,i=this.byteOffset+this.offset,a=this.buffer.slice(i,i+r);if(this.littleEndian===GR&&n!=="uint8"&&n!=="int8"){const s=new Uint8Array(this.buffer.slice(i,i+r));s.reverse();const u=new Ev[n](s.buffer);return this.offset+=r,u.reverse(),u}const o=new Ev[n](a);return this.offset+=r,o}readInt16(){const e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}readUint16(){const e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}readInt32(){const e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}readUint32(){const e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat32(){const e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat64(){const e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}readBigInt64(){const e=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,e}readBigUint64(){const e=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,e}readChar(){return String.fromCharCode(this.readInt8())}readChars(e=1){let n="";for(let r=0;r<e;r++)n+=this.readChar();return n}readUtf8(e=1){return U4(this.readBytes(e))}decodeText(e=1,n="utf8"){return U4(this.readBytes(e),n)}writeBoolean(e){return this.writeUint8(e?255:0),this}writeInt8(e){return this.ensureAvailable(1),this._data.setInt8(this.offset++,e),this._updateLastWrittenByte(),this}writeUint8(e){return this.ensureAvailable(1),this._data.setUint8(this.offset++,e),this._updateLastWrittenByte(),this}writeByte(e){return this.writeUint8(e)}writeBytes(e){this.ensureAvailable(e.length);for(let n=0;n<e.length;n++)this._data.setUint8(this.offset++,e[n]);return this._updateLastWrittenByte(),this}writeInt16(e){return this.ensureAvailable(2),this._data.setInt16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(e){return this.ensureAvailable(2),this._data.setUint16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(e){return this.ensureAvailable(4),this._data.setInt32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(e){return this.ensureAvailable(4),this._data.setUint32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(e){return this.ensureAvailable(4),this._data.setFloat32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(e){return this.ensureAvailable(8),this._data.setFloat64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(e){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(e){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(e){return this.writeUint8(e.charCodeAt(0))}writeChars(e){for(let n=0;n<e.length;n++)this.writeUint8(e.charCodeAt(n));return this}writeUtf8(e){return this.writeBytes(HR(e))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}function Ad(t){let e=t.length;for(;--e>=0;)t[e]=0}const WR=3,VR=258,L_=29,YR=256,XR=YR+1+L_,N_=30,KR=512,ZR=new Array((XR+2)*2);Ad(ZR);const QR=new Array(N_*2);Ad(QR);const JR=new Array(KR);Ad(JR);const eM=new Array(VR-WR+1);Ad(eM);const tM=new Array(L_);Ad(tM);const nM=new Array(N_);Ad(nM);const rM=(t,e,n,r)=>{let i=t&65535|0,a=t>>>16&65535|0,o=0;for(;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+e[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0};var Cm=rM;const iM=()=>{let t,e=[];for(var n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=t&1?3988292384^t>>>1:t>>>1;e[n]=t}return e},aM=new Uint32Array(iM()),oM=(t,e,n,r)=>{const i=aM,a=r+n;t^=-1;for(let o=r;o<a;o++)t=t>>>8^i[(t^e[o])&255];return t^-1};var Cu=oM,Lm={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},T_={Z_NO_FLUSH:0,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFLATED:8};const sM=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var lM=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const n=e.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)sM(n,r)&&(t[r]=n[r])}}return t},uM=t=>{let e=0;for(let r=0,i=t.length;r<i;r++)e+=t[r].length;const n=new Uint8Array(e);for(let r=0,i=0,a=t.length;r<a;r++){let o=t[r];n.set(o,i),i+=o.length}return n},R_={assign:lM,flattenChunks:uM};let M_=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{M_=!1}const kp=new Uint8Array(256);for(let t=0;t<256;t++)kp[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;kp[254]=kp[254]=1;var cM=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,n,r,i,a,o=t.length,s=0;for(i=0;i<o;i++)n=t.charCodeAt(i),(n&64512)===55296&&i+1<o&&(r=t.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(e=new Uint8Array(s),a=0,i=0;a<s;i++)n=t.charCodeAt(i),(n&64512)===55296&&i+1<o&&(r=t.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?e[a++]=n:n<2048?(e[a++]=192|n>>>6,e[a++]=128|n&63):n<65536?(e[a++]=224|n>>>12,e[a++]=128|n>>>6&63,e[a++]=128|n&63):(e[a++]=240|n>>>18,e[a++]=128|n>>>12&63,e[a++]=128|n>>>6&63,e[a++]=128|n&63);return e};const fM=(t,e)=>{if(e<65534&&t.subarray&&M_)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let n="";for(let r=0;r<e;r++)n+=String.fromCharCode(t[r]);return n};var hM=(t,e)=>{const n=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let r,i;const a=new Array(n*2);for(i=0,r=0;r<n;){let o=t[r++];if(o<128){a[i++]=o;continue}let s=kp[o];if(s>4){a[i++]=65533,r+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&r<n;)o=o<<6|t[r++]&63,s--;if(s>1){a[i++]=65533;continue}o<65536?a[i++]=o:(o-=65536,a[i++]=55296|o>>10&1023,a[i++]=56320|o&1023)}return fM(a,i)},dM=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let n=e-1;for(;n>=0&&(t[n]&192)===128;)n--;return n<0||n===0?e:n+kp[t[n]]>e?n:e},Nm={string2buf:cM,buf2string:hM,utf8border:dM};function pM(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var gM=pM;const I1=16209,vM=16191;var mM=function(e,n){let r,i,a,o,s,u,h,f,g,v,p,y,_,x,b,E,A,S,k,I,O,M,F,j;const T=e.state;r=e.next_in,F=e.input,i=r+(e.avail_in-5),a=e.next_out,j=e.output,o=a-(n-e.avail_out),s=a+(e.avail_out-257),u=T.dmax,h=T.wsize,f=T.whave,g=T.wnext,v=T.window,p=T.hold,y=T.bits,_=T.lencode,x=T.distcode,b=(1<<T.lenbits)-1,E=(1<<T.distbits)-1;e:do{y<15&&(p+=F[r++]<<y,y+=8,p+=F[r++]<<y,y+=8),A=_[p&b];t:for(;;){if(S=A>>>24,p>>>=S,y-=S,S=A>>>16&255,S===0)j[a++]=A&65535;else if(S&16){k=A&65535,S&=15,S&&(y<S&&(p+=F[r++]<<y,y+=8),k+=p&(1<<S)-1,p>>>=S,y-=S),y<15&&(p+=F[r++]<<y,y+=8,p+=F[r++]<<y,y+=8),A=x[p&E];n:for(;;){if(S=A>>>24,p>>>=S,y-=S,S=A>>>16&255,S&16){if(I=A&65535,S&=15,y<S&&(p+=F[r++]<<y,y+=8,y<S&&(p+=F[r++]<<y,y+=8)),I+=p&(1<<S)-1,I>u){e.msg="invalid distance too far back",T.mode=I1;break e}if(p>>>=S,y-=S,S=a-o,I>S){if(S=I-S,S>f&&T.sane){e.msg="invalid distance too far back",T.mode=I1;break e}if(O=0,M=v,g===0){if(O+=h-S,S<k){k-=S;do j[a++]=v[O++];while(--S);O=a-I,M=j}}else if(g<S){if(O+=h+g-S,S-=g,S<k){k-=S;do j[a++]=v[O++];while(--S);if(O=0,g<k){S=g,k-=S;do j[a++]=v[O++];while(--S);O=a-I,M=j}}}else if(O+=g-S,S<k){k-=S;do j[a++]=v[O++];while(--S);O=a-I,M=j}for(;k>2;)j[a++]=M[O++],j[a++]=M[O++],j[a++]=M[O++],k-=3;k&&(j[a++]=M[O++],k>1&&(j[a++]=M[O++]))}else{O=a-I;do j[a++]=j[O++],j[a++]=j[O++],j[a++]=j[O++],k-=3;while(k>2);k&&(j[a++]=j[O++],k>1&&(j[a++]=j[O++]))}}else if((S&64)===0){A=x[(A&65535)+(p&(1<<S)-1)];continue n}else{e.msg="invalid distance code",T.mode=I1;break e}break}}else if((S&64)===0){A=_[(A&65535)+(p&(1<<S)-1)];continue t}else if(S&32){T.mode=vM;break e}else{e.msg="invalid literal/length code",T.mode=I1;break e}break}}while(r<i&&a<s);k=y>>3,r-=k,y-=k<<3,p&=(1<<y)-1,e.next_in=r,e.next_out=a,e.avail_in=r<i?5+(i-r):5-(r-i),e.avail_out=a<s?257+(s-a):257-(a-s),T.hold=p,T.bits=y};const Yh=15,H4=852,$4=592,G4=0,kv=1,W4=2,yM=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),bM=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),wM=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),_M=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),xM=(t,e,n,r,i,a,o,s)=>{const u=s.bits;let h=0,f=0,g=0,v=0,p=0,y=0,_=0,x=0,b=0,E=0,A,S,k,I,O,M=null,F;const j=new Uint16Array(Yh+1),T=new Uint16Array(Yh+1);let L=null,$,q,J;for(h=0;h<=Yh;h++)j[h]=0;for(f=0;f<r;f++)j[e[n+f]]++;for(p=u,v=Yh;v>=1&&j[v]===0;v--);if(p>v&&(p=v),v===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,s.bits=1,0;for(g=1;g<v&&j[g]===0;g++);for(p<g&&(p=g),x=1,h=1;h<=Yh;h++)if(x<<=1,x-=j[h],x<0)return-1;if(x>0&&(t===G4||v!==1))return-1;for(T[1]=0,h=1;h<Yh;h++)T[h+1]=T[h]+j[h];for(f=0;f<r;f++)e[n+f]!==0&&(o[T[e[n+f]]++]=f);if(t===G4?(M=L=o,F=20):t===kv?(M=yM,L=bM,F=257):(M=wM,L=_M,F=0),E=0,f=0,h=g,O=a,y=p,_=0,k=-1,b=1<<p,I=b-1,t===kv&&b>H4||t===W4&&b>$4)return 1;for(;;){$=h-_,o[f]+1<F?(q=0,J=o[f]):o[f]>=F?(q=L[o[f]-F],J=M[o[f]-F]):(q=96,J=0),A=1<<h-_,S=1<<y,g=S;do S-=A,i[O+(E>>_)+S]=$<<24|q<<16|J|0;while(S!==0);for(A=1<<h-1;E&A;)A>>=1;if(A!==0?(E&=A-1,E+=A):E=0,f++,--j[h]===0){if(h===v)break;h=e[n+o[f]]}if(h>p&&(E&I)!==k){for(_===0&&(_=p),O+=g,y=h-_,x=1<<y;y+_<v&&(x-=j[y+_],!(x<=0));)y++,x<<=1;if(b+=1<<y,t===kv&&b>H4||t===W4&&b>$4)return 1;k=E&I,i[k]=p<<24|y<<16|O-a|0}}return E!==0&&(i[O+E]=h-_<<24|64<<16|0),s.bits=p,0};var dp=xM;const SM=0,I_=1,j_=2,{Z_FINISH:V4,Z_BLOCK:EM,Z_TREES:j1,Z_OK:dh,Z_STREAM_END:kM,Z_NEED_DICT:AM,Z_STREAM_ERROR:Ll,Z_DATA_ERROR:D_,Z_MEM_ERROR:F_,Z_BUF_ERROR:PM,Z_DEFLATED:Y4}=T_,tg=16180,X4=16181,K4=16182,Z4=16183,Q4=16184,J4=16185,ew=16186,tw=16187,nw=16188,rw=16189,A0=16190,uc=16191,Av=16192,iw=16193,Pv=16194,aw=16195,ow=16196,sw=16197,lw=16198,D1=16199,F1=16200,uw=16201,cw=16202,fw=16203,hw=16204,dw=16205,Ov=16206,pw=16207,gw=16208,xi=16209,B_=16210,z_=16211,OM=852,CM=592,LM=15,NM=LM,vw=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function TM(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Ah=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<tg||e.mode>z_?1:0},q_=t=>{if(Ah(t))return Ll;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=tg,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(OM),e.distcode=e.distdyn=new Int32Array(CM),e.sane=1,e.back=-1,dh},U_=t=>{if(Ah(t))return Ll;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,q_(t)},H_=(t,e)=>{let n;if(Ah(t))return Ll;const r=t.state;return e<0?(n=0,e=-e):(n=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Ll:(r.window!==null&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,U_(t))},$_=(t,e)=>{if(!t)return Ll;const n=new TM;t.state=n,n.strm=t,n.window=null,n.mode=tg;const r=H_(t,e);return r!==dh&&(t.state=null),r},RM=t=>$_(t,NM);let mw=!0,Cv,Lv;const MM=t=>{if(mw){Cv=new Int32Array(512),Lv=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(dp(I_,t.lens,0,288,Cv,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;dp(j_,t.lens,0,32,Lv,0,t.work,{bits:5}),mw=!1}t.lencode=Cv,t.lenbits=9,t.distcode=Lv,t.distbits=5},G_=(t,e,n,r)=>{let i;const a=t.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),r>=a.wsize?(a.window.set(e.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>r&&(i=r),a.window.set(e.subarray(n-r,n-r+i),a.wnext),r-=i,r?(a.window.set(e.subarray(n-r,n),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},IM=(t,e)=>{let n,r,i,a,o,s,u,h,f,g,v,p,y,_,x=0,b,E,A,S,k,I,O,M;const F=new Uint8Array(4);let j,T;const L=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Ah(t)||!t.output||!t.input&&t.avail_in!==0)return Ll;n=t.state,n.mode===uc&&(n.mode=Av),o=t.next_out,i=t.output,u=t.avail_out,a=t.next_in,r=t.input,s=t.avail_in,h=n.hold,f=n.bits,g=s,v=u,M=dh;e:for(;;)switch(n.mode){case tg:if(n.wrap===0){n.mode=Av;break}for(;f<16;){if(s===0)break e;s--,h+=r[a++]<<f,f+=8}if(n.wrap&2&&h===35615){n.wbits===0&&(n.wbits=15),n.check=0,F[0]=h&255,F[1]=h>>>8&255,n.check=Cu(n.check,F,2,0),h=0,f=0,n.mode=X4;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((h&255)<<8)+(h>>8))%31){t.msg="incorrect header check",n.mode=xi;break}if((h&15)!==Y4){t.msg="unknown compression method",n.mode=xi;break}if(h>>>=4,f-=4,O=(h&15)+8,n.wbits===0&&(n.wbits=O),O>15||O>n.wbits){t.msg="invalid window size",n.mode=xi;break}n.dmax=1<<n.wbits,n.flags=0,t.adler=n.check=1,n.mode=h&512?rw:uc,h=0,f=0;break;case X4:for(;f<16;){if(s===0)break e;s--,h+=r[a++]<<f,f+=8}if(n.flags=h,(n.flags&255)!==Y4){t.msg="unknown compression method",n.mode=xi;break}if(n.flags&57344){t.msg="unknown header flags set",n.mode=xi;break}n.head&&(n.head.text=h>>8&1),n.flags&512&&n.wrap&4&&(F[0]=h&255,F[1]=h>>>8&255,n.check=Cu(n.check,F,2,0)),h=0,f=0,n.mode=K4;case K4:for(;f<32;){if(s===0)break e;s--,h+=r[a++]<<f,f+=8}n.head&&(n.head.time=h),n.flags&512&&n.wrap&4&&(F[0]=h&255,F[1]=h>>>8&255,F[2]=h>>>16&255,F[3]=h>>>24&255,n.check=Cu(n.check,F,4,0)),h=0,f=0,n.mode=Z4;case Z4:for(;f<16;){if(s===0)break e;s--,h+=r[a++]<<f,f+=8}n.head&&(n.head.xflags=h&255,n.head.os=h>>8),n.flags&512&&n.wrap&4&&(F[0]=h&255,F[1]=h>>>8&255,n.check=Cu(n.check,F,2,0)),h=0,f=0,n.mode=Q4;case Q4:if(n.flags&1024){for(;f<16;){if(s===0)break e;s--,h+=r[a++]<<f,f+=8}n.length=h,n.head&&(n.head.extra_len=h),n.flags&512&&n.wrap&4&&(F[0]=h&255,F[1]=h>>>8&255,n.check=Cu(n.check,F,2,0)),h=0,f=0}else n.head&&(n.head.extra=null);n.mode=J4;case J4:if(n.flags&1024&&(p=n.length,p>s&&(p=s),p&&(n.head&&(O=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(a,a+p),O)),n.flags&512&&n.wrap&4&&(n.check=Cu(n.check,r,p,a)),s-=p,a+=p,n.length-=p),n.length))break e;n.length=0,n.mode=ew;case ew:if(n.flags&2048){if(s===0)break e;p=0;do O=r[a+p++],n.head&&O&&n.length<65536&&(n.head.name+=String.fromCharCode(O));while(O&&p<s);if(n.flags&512&&n.wrap&4&&(n.check=Cu(n.check,r,p,a)),s-=p,a+=p,O)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=tw;case tw:if(n.flags&4096){if(s===0)break e;p=0;do O=r[a+p++],n.head&&O&&n.length<65536&&(n.head.comment+=String.fromCharCode(O));while(O&&p<s);if(n.flags&512&&n.wrap&4&&(n.check=Cu(n.check,r,p,a)),s-=p,a+=p,O)break e}else n.head&&(n.head.comment=null);n.mode=nw;case nw:if(n.flags&512){for(;f<16;){if(s===0)break e;s--,h+=r[a++]<<f,f+=8}if(n.wrap&4&&h!==(n.check&65535)){t.msg="header crc mismatch",n.mode=xi;break}h=0,f=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=uc;break;case rw:for(;f<32;){if(s===0)break e;s--,h+=r[a++]<<f,f+=8}t.adler=n.check=vw(h),h=0,f=0,n.mode=A0;case A0:if(n.havedict===0)return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,n.hold=h,n.bits=f,AM;t.adler=n.check=1,n.mode=uc;case uc:if(e===EM||e===j1)break e;case Av:if(n.last){h>>>=f&7,f-=f&7,n.mode=Ov;break}for(;f<3;){if(s===0)break e;s--,h+=r[a++]<<f,f+=8}switch(n.last=h&1,h>>>=1,f-=1,h&3){case 0:n.mode=iw;break;case 1:if(MM(n),n.mode=D1,e===j1){h>>>=2,f-=2;break e}break;case 2:n.mode=ow;break;case 3:t.msg="invalid block type",n.mode=xi}h>>>=2,f-=2;break;case iw:for(h>>>=f&7,f-=f&7;f<32;){if(s===0)break e;s--,h+=r[a++]<<f,f+=8}if((h&65535)!==(h>>>16^65535)){t.msg="invalid stored block lengths",n.mode=xi;break}if(n.length=h&65535,h=0,f=0,n.mode=Pv,e===j1)break e;case Pv:n.mode=aw;case aw:if(p=n.length,p){if(p>s&&(p=s),p>u&&(p=u),p===0)break e;i.set(r.subarray(a,a+p),o),s-=p,a+=p,u-=p,o+=p,n.length-=p;break}n.mode=uc;break;case ow:for(;f<14;){if(s===0)break e;s--,h+=r[a++]<<f,f+=8}if(n.nlen=(h&31)+257,h>>>=5,f-=5,n.ndist=(h&31)+1,h>>>=5,f-=5,n.ncode=(h&15)+4,h>>>=4,f-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=xi;break}n.have=0,n.mode=sw;case sw:for(;n.have<n.ncode;){for(;f<3;){if(s===0)break e;s--,h+=r[a++]<<f,f+=8}n.lens[L[n.have++]]=h&7,h>>>=3,f-=3}for(;n.have<19;)n.lens[L[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,j={bits:n.lenbits},M=dp(SM,n.lens,0,19,n.lencode,0,n.work,j),n.lenbits=j.bits,M){t.msg="invalid code lengths set",n.mode=xi;break}n.have=0,n.mode=lw;case lw:for(;n.have<n.nlen+n.ndist;){for(;x=n.lencode[h&(1<<n.lenbits)-1],b=x>>>24,E=x>>>16&255,A=x&65535,!(b<=f);){if(s===0)break e;s--,h+=r[a++]<<f,f+=8}if(A<16)h>>>=b,f-=b,n.lens[n.have++]=A;else{if(A===16){for(T=b+2;f<T;){if(s===0)break e;s--,h+=r[a++]<<f,f+=8}if(h>>>=b,f-=b,n.have===0){t.msg="invalid bit length repeat",n.mode=xi;break}O=n.lens[n.have-1],p=3+(h&3),h>>>=2,f-=2}else if(A===17){for(T=b+3;f<T;){if(s===0)break e;s--,h+=r[a++]<<f,f+=8}h>>>=b,f-=b,O=0,p=3+(h&7),h>>>=3,f-=3}else{for(T=b+7;f<T;){if(s===0)break e;s--,h+=r[a++]<<f,f+=8}h>>>=b,f-=b,O=0,p=11+(h&127),h>>>=7,f-=7}if(n.have+p>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=xi;break}for(;p--;)n.lens[n.have++]=O}}if(n.mode===xi)break;if(n.lens[256]===0){t.msg="invalid code -- missing end-of-block",n.mode=xi;break}if(n.lenbits=9,j={bits:n.lenbits},M=dp(I_,n.lens,0,n.nlen,n.lencode,0,n.work,j),n.lenbits=j.bits,M){t.msg="invalid literal/lengths set",n.mode=xi;break}if(n.distbits=6,n.distcode=n.distdyn,j={bits:n.distbits},M=dp(j_,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,j),n.distbits=j.bits,M){t.msg="invalid distances set",n.mode=xi;break}if(n.mode=D1,e===j1)break e;case D1:n.mode=F1;case F1:if(s>=6&&u>=258){t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,n.hold=h,n.bits=f,mM(t,v),o=t.next_out,i=t.output,u=t.avail_out,a=t.next_in,r=t.input,s=t.avail_in,h=n.hold,f=n.bits,n.mode===uc&&(n.back=-1);break}for(n.back=0;x=n.lencode[h&(1<<n.lenbits)-1],b=x>>>24,E=x>>>16&255,A=x&65535,!(b<=f);){if(s===0)break e;s--,h+=r[a++]<<f,f+=8}if(E&&(E&240)===0){for(S=b,k=E,I=A;x=n.lencode[I+((h&(1<<S+k)-1)>>S)],b=x>>>24,E=x>>>16&255,A=x&65535,!(S+b<=f);){if(s===0)break e;s--,h+=r[a++]<<f,f+=8}h>>>=S,f-=S,n.back+=S}if(h>>>=b,f-=b,n.back+=b,n.length=A,E===0){n.mode=dw;break}if(E&32){n.back=-1,n.mode=uc;break}if(E&64){t.msg="invalid literal/length code",n.mode=xi;break}n.extra=E&15,n.mode=uw;case uw:if(n.extra){for(T=n.extra;f<T;){if(s===0)break e;s--,h+=r[a++]<<f,f+=8}n.length+=h&(1<<n.extra)-1,h>>>=n.extra,f-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=cw;case cw:for(;x=n.distcode[h&(1<<n.distbits)-1],b=x>>>24,E=x>>>16&255,A=x&65535,!(b<=f);){if(s===0)break e;s--,h+=r[a++]<<f,f+=8}if((E&240)===0){for(S=b,k=E,I=A;x=n.distcode[I+((h&(1<<S+k)-1)>>S)],b=x>>>24,E=x>>>16&255,A=x&65535,!(S+b<=f);){if(s===0)break e;s--,h+=r[a++]<<f,f+=8}h>>>=S,f-=S,n.back+=S}if(h>>>=b,f-=b,n.back+=b,E&64){t.msg="invalid distance code",n.mode=xi;break}n.offset=A,n.extra=E&15,n.mode=fw;case fw:if(n.extra){for(T=n.extra;f<T;){if(s===0)break e;s--,h+=r[a++]<<f,f+=8}n.offset+=h&(1<<n.extra)-1,h>>>=n.extra,f-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=xi;break}n.mode=hw;case hw:if(u===0)break e;if(p=v-u,n.offset>p){if(p=n.offset-p,p>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=xi;break}p>n.wnext?(p-=n.wnext,y=n.wsize-p):y=n.wnext-p,p>n.length&&(p=n.length),_=n.window}else _=i,y=o-n.offset,p=n.length;p>u&&(p=u),u-=p,n.length-=p;do i[o++]=_[y++];while(--p);n.length===0&&(n.mode=F1);break;case dw:if(u===0)break e;i[o++]=n.length,u--,n.mode=F1;break;case Ov:if(n.wrap){for(;f<32;){if(s===0)break e;s--,h|=r[a++]<<f,f+=8}if(v-=u,t.total_out+=v,n.total+=v,n.wrap&4&&v&&(t.adler=n.check=n.flags?Cu(n.check,i,v,o-v):Cm(n.check,i,v,o-v)),v=u,n.wrap&4&&(n.flags?h:vw(h))!==n.check){t.msg="incorrect data check",n.mode=xi;break}h=0,f=0}n.mode=pw;case pw:if(n.wrap&&n.flags){for(;f<32;){if(s===0)break e;s--,h+=r[a++]<<f,f+=8}if(n.wrap&4&&h!==(n.total&4294967295)){t.msg="incorrect length check",n.mode=xi;break}h=0,f=0}n.mode=gw;case gw:M=kM;break e;case xi:M=D_;break e;case B_:return F_;case z_:default:return Ll}return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,n.hold=h,n.bits=f,(n.wsize||v!==t.avail_out&&n.mode<xi&&(n.mode<Ov||e!==V4))&&G_(t,t.output,t.next_out,v-t.avail_out),g-=t.avail_in,v-=t.avail_out,t.total_in+=g,t.total_out+=v,n.total+=v,n.wrap&4&&v&&(t.adler=n.check=n.flags?Cu(n.check,i,v,t.next_out-v):Cm(n.check,i,v,t.next_out-v)),t.data_type=n.bits+(n.last?64:0)+(n.mode===uc?128:0)+(n.mode===D1||n.mode===Pv?256:0),(g===0&&v===0||e===V4)&&M===dh&&(M=PM),M},jM=t=>{if(Ah(t))return Ll;let e=t.state;return e.window&&(e.window=null),t.state=null,dh},DM=(t,e)=>{if(Ah(t))return Ll;const n=t.state;return(n.wrap&2)===0?Ll:(n.head=e,e.done=!1,dh)},FM=(t,e)=>{const n=e.length;let r,i,a;return Ah(t)||(r=t.state,r.wrap!==0&&r.mode!==A0)?Ll:r.mode===A0&&(i=1,i=Cm(i,e,n,0),i!==r.check)?D_:(a=G_(t,e,n,n),a?(r.mode=B_,F_):(r.havedict=1,dh))};var BM=U_,zM=H_,qM=q_,UM=RM,HM=$_,$M=IM,GM=jM,WM=DM,VM=FM,YM="pako inflate (from Nodeca project)",hc={inflateReset:BM,inflateReset2:zM,inflateResetKeep:qM,inflateInit:UM,inflateInit2:HM,inflate:$M,inflateEnd:GM,inflateGetHeader:WM,inflateSetDictionary:VM,inflateInfo:YM};function XM(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var KM=XM;const W_=Object.prototype.toString,{Z_NO_FLUSH:ZM,Z_FINISH:QM,Z_OK:Ap,Z_STREAM_END:Nv,Z_NEED_DICT:Tv,Z_STREAM_ERROR:JM,Z_DATA_ERROR:yw,Z_MEM_ERROR:eI}=T_;function zp(t){this.options=R_.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new gM,this.strm.avail_out=0;let n=hc.inflateInit2(this.strm,e.windowBits);if(n!==Ap)throw new Error(Lm[n]);if(this.header=new KM,hc.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Nm.string2buf(e.dictionary):W_.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=hc.inflateSetDictionary(this.strm,e.dictionary),n!==Ap)))throw new Error(Lm[n])}zp.prototype.push=function(t,e){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let a,o,s;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?QM:ZM,W_.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),a=hc.inflate(n,o),a===Tv&&i&&(a=hc.inflateSetDictionary(n,i),a===Ap?a=hc.inflate(n,o):a===yw&&(a=Tv));n.avail_in>0&&a===Nv&&n.state.wrap>0&&t[n.next_in]!==0;)hc.inflateReset(n),a=hc.inflate(n,o);switch(a){case JM:case yw:case Tv:case eI:return this.onEnd(a),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(n.avail_out===0||a===Nv))if(this.options.to==="string"){let u=Nm.utf8border(n.output,n.next_out),h=n.next_out-u,f=Nm.buf2string(n.output,u);n.next_out=h,n.avail_out=r-h,h&&n.output.set(n.output.subarray(u,u+h),0),this.onData(f)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(a===Ap&&s===0)){if(a===Nv)return a=hc.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};zp.prototype.onData=function(t){this.chunks.push(t)};zp.prototype.onEnd=function(t){t===Ap&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=R_.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function tI(t,e){const n=new zp(e);if(n.push(t),n.err)throw n.msg||Lm[n.err];return n.result}var nI=zp,rI=tI,iI={Inflate:nI,inflate:rI};const{Inflate:aI,inflate:oI}=iI;var bw=aI,sI=oI;const V_=[];for(let t=0;t<256;t++){let e=t;for(let n=0;n<8;n++)e&1?e=3988292384^e>>>1:e=e>>>1;V_[t]=e}const ww=4294967295;function lI(t,e,n){let r=t;for(let i=0;i<n;i++)r=V_[(r^e[i])&255]^r>>>8;return r}function uI(t,e){return(lI(ww,t,e)^ww)>>>0}function _w(t,e,n){const r=t.readUint32(),i=uI(new Uint8Array(t.buffer,t.byteOffset+t.offset-e-4,e),e);if(i!==r)throw new Error(`CRC mismatch for chunk ${n}. Expected ${r}, found ${i}`)}function Y_(t,e,n){for(let r=0;r<n;r++)e[r]=t[r]}function X_(t,e,n,r){let i=0;for(;i<r;i++)e[i]=t[i];for(;i<n;i++)e[i]=t[i]+e[i-r]&255}function K_(t,e,n,r){let i=0;if(n.length===0)for(;i<r;i++)e[i]=t[i];else for(;i<r;i++)e[i]=t[i]+n[i]&255}function Z_(t,e,n,r,i){let a=0;if(n.length===0){for(;a<i;a++)e[a]=t[a];for(;a<r;a++)e[a]=t[a]+(e[a-i]>>1)&255}else{for(;a<i;a++)e[a]=t[a]+(n[a]>>1)&255;for(;a<r;a++)e[a]=t[a]+(e[a-i]+n[a]>>1)&255}}function Q_(t,e,n,r,i){let a=0;if(n.length===0){for(;a<i;a++)e[a]=t[a];for(;a<r;a++)e[a]=t[a]+e[a-i]&255}else{for(;a<i;a++)e[a]=t[a]+n[a]&255;for(;a<r;a++)e[a]=t[a]+cI(e[a-i],n[a],n[a-i])&255}}function cI(t,e,n){const r=t+e-n,i=Math.abs(r-t),a=Math.abs(r-e),o=Math.abs(r-n);return i<=a&&i<=o?t:a<=o?e:n}function fI(t,e,n,r,i,a){switch(t){case 0:Y_(e,n,i);break;case 1:X_(e,n,i,a);break;case 2:K_(e,n,r,i);break;case 3:Z_(e,n,r,i,a);break;case 4:Q_(e,n,r,i,a);break;default:throw new Error(`Unsupported filter: ${t}`)}}const hI=new Uint16Array([255]),dI=new Uint8Array(hI.buffer),pI=dI[0]===255;function gI(t){const{data:e,width:n,height:r,channels:i,depth:a}=t,o=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],s=Math.ceil(a/8)*i,u=new Uint8Array(r*n*s);let h=0;for(let f=0;f<7;f++){const g=o[f],v=Math.ceil((n-g.x)/g.xStep),p=Math.ceil((r-g.y)/g.yStep);if(v<=0||p<=0)continue;const y=v*s,_=new Uint8Array(y);for(let x=0;x<p;x++){const b=e[h++],E=e.subarray(h,h+y);h+=y;const A=new Uint8Array(y);fI(b,E,A,_,y,s),_.set(A);for(let S=0;S<v;S++){const k=g.x+S*g.xStep,I=g.y+x*g.yStep;if(!(k>=n||I>=r))for(let O=0;O<s;O++)u[(I*n+k)*s+O]=A[S*s+O]}}}if(a===16){const f=new Uint16Array(u.buffer);if(pI)for(let g=0;g<f.length;g++)f[g]=vI(f[g]);return f}else return u}function vI(t){return(t&255)<<8|t>>8&255}const mI=new Uint16Array([255]),yI=new Uint8Array(mI.buffer),bI=yI[0]===255,wI=new Uint8Array(0);function xw(t){const{data:e,width:n,height:r,channels:i,depth:a}=t,o=Math.ceil(a/8)*i,s=Math.ceil(a/8*i*n),u=new Uint8Array(r*s);let h=wI,f=0,g,v;for(let p=0;p<r;p++){switch(g=e.subarray(f+1,f+1+s),v=u.subarray(p*s,(p+1)*s),e[f]){case 0:Y_(g,v,s);break;case 1:X_(g,v,s,o);break;case 2:K_(g,v,h,s);break;case 3:Z_(g,v,h,s,o);break;case 4:Q_(g,v,h,s,o);break;default:throw new Error(`Unsupported filter: ${e[f]}`)}h=v,f+=s+1}if(a===16){const p=new Uint16Array(u.buffer);if(bI)for(let y=0;y<p.length;y++)p[y]=_I(p[y]);return p}else return u}function _I(t){return(t&255)<<8|t>>8&255}const J1=Uint8Array.of(137,80,78,71,13,10,26,10);function Sw(t){if(!xI(t.readBytes(J1.length)))throw new Error("wrong PNG signature")}function xI(t){if(t.length<J1.length)return!1;for(let e=0;e<J1.length;e++)if(t[e]!==J1[e])return!1;return!0}const SI="tEXt",EI=0,J_=new TextDecoder("latin1");function kI(t){if(PI(t),t.length===0||t.length>79)throw new Error("keyword length must be between 1 and 79")}const AI=/^[\u0000-\u00FF]*$/;function PI(t){if(!AI.test(t))throw new Error("invalid latin1 text")}function OI(t,e,n){const r=ex(e);t[r]=CI(e,n-r.length-1)}function ex(t){for(t.mark();t.readByte()!==EI;);const e=t.offset;t.reset();const n=J_.decode(t.readBytes(e-t.offset-1));return t.skip(1),kI(n),n}function CI(t,e){return J_.decode(t.readBytes(e))}const Qs={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},Rv={UNKNOWN:-1,DEFLATE:0},Ew={UNKNOWN:-1,ADAPTIVE:0},Mv={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},B1={NONE:0,BACKGROUND:1,PREVIOUS:2},Iv={SOURCE:0,OVER:1};class LI extends Ey{_checkCrc;_inflator;_png;_apng;_end;_hasPalette;_palette;_hasTransparency;_transparency;_compressionMethod;_filterMethod;_interlaceMethod;_colorType;_isAnimated;_numberOfFrames;_numberOfPlays;_frames;_writingDataChunks;constructor(e,n={}){super(e);const{checkCrc:r=!1}=n;this._checkCrc=r,this._inflator=new bw,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=Rv.UNKNOWN,this._filterMethod=Ew.UNKNOWN,this._interlaceMethod=Mv.UNKNOWN,this._colorType=Qs.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(Sw(this);!this._end;){const e=this.readUint32(),n=this.readChars(4);this.decodeChunk(e,n)}return this.decodeImage(),this._png}decodeApng(){for(Sw(this);!this._end;){const e=this.readUint32(),n=this.readChars(4);this.decodeApngChunk(e,n)}return this.decodeApngImage(),this._apng}decodeChunk(e,n){const r=this.offset;switch(n){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(e);break;case"IDAT":this.decodeIDAT(e);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(e);break;case"iCCP":this.decodeiCCP(e);break;case SI:OI(this._png.text,this,e);break;case"pHYs":this.decodepHYs();break;default:this.skip(e);break}if(this.offset-r!==e)throw new Error(`Length mismatch while decoding chunk ${n}`);this._checkCrc?_w(this,e+4,n):this.skip(4)}decodeApngChunk(e,n){const r=this.offset;switch(n!=="fdAT"&&n!=="IDAT"&&this._writingDataChunks&&this.pushDataToFrame(),n){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(e);break;default:this.decodeChunk(e,n),this.offset=r+e;break}if(this.offset-r!==e)throw new Error(`Length mismatch while decoding chunk ${n}`);this._checkCrc?_w(this,e+4,n):this.skip(4)}decodeIHDR(){const e=this._png;e.width=this.readUint32(),e.height=this.readUint32(),e.depth=NI(this.readUint8());const n=this.readUint8();this._colorType=n;let r;switch(n){case Qs.GREYSCALE:r=1;break;case Qs.TRUECOLOUR:r=3;break;case Qs.INDEXED_COLOUR:r=1;break;case Qs.GREYSCALE_ALPHA:r=2;break;case Qs.TRUECOLOUR_ALPHA:r=4;break;case Qs.UNKNOWN:default:throw new Error(`Unknown color type: ${n}`)}if(this._png.channels=r,this._compressionMethod=this.readUint8(),this._compressionMethod!==Rv.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const e={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(e)}decodePLTE(e){if(e%3!==0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${e}`);const n=e/3;this._hasPalette=!0;const r=[];this._palette=r;for(let i=0;i<n;i++)r.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(e){this._writingDataChunks=!0;const n=e,r=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,r,n)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(e)}decodeFDAT(e){this._writingDataChunks=!0;let n=e,r=this.offset+this.byteOffset;if(r+=4,n-=4,this._inflator.push(new Uint8Array(this.buffer,r,n)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(e)}decodetRNS(e){switch(this._colorType){case Qs.GREYSCALE:case Qs.TRUECOLOUR:{if(e%2!==0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${e}`);if(e/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${e/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(e/2);for(let n=0;n<e/2;n++)this._transparency[n]=this.readUint16();break}case Qs.INDEXED_COLOUR:{if(e>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${e} vs ${this._palette.length})`);let n=0;for(;n<e;n++){const r=this.readByte();this._palette[n].push(r)}for(;n<this._palette.length;n++)this._palette[n].push(255);break}case Qs.UNKNOWN:case Qs.GREYSCALE_ALPHA:case Qs.TRUECOLOUR_ALPHA:default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(e){const n=ex(this),r=this.readUint8();if(r!==Rv.DEFLATE)throw new Error(`Unsupported iCCP compression method: ${r}`);const i=this.readBytes(e-n.length-2);this._png.iccEmbeddedProfile={name:n,profile:sI(i)}}decodepHYs(){const e=this.readUint32(),n=this.readUint32(),r=this.readByte();this._png.resolution={x:e,y:n,unit:r}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let e=0;e<this._numberOfFrames;e++){const n={sequenceNumber:this._frames[e].sequenceNumber,delayNumber:this._frames[e].delayNumber,delayDenominator:this._frames[e].delayDenominator,data:this._apng.depth===8?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},r=this._frames.at(e);if(r){if(r.data=xw({data:r.data,width:r.width,height:r.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),e===0||r.xOffset===0&&r.yOffset===0&&r.width===this._png.width&&r.height===this._png.height)n.data=r.data;else{const i=this._apng.frames.at(e-1);this.disposeFrame(r,i,n),this.addFrameDataToCanvas(n,r)}this._apng.frames.push(n)}}return this._apng}disposeFrame(e,n,r){switch(e.disposeOp){case B1.NONE:break;case B1.BACKGROUND:for(let i=0;i<this._png.height;i++)for(let a=0;a<this._png.width;a++){const o=(i*e.width+a)*this._png.channels;for(let s=0;s<this._png.channels;s++)r.data[o+s]=0}break;case B1.PREVIOUS:r.data.set(n.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(e,n){const r=1<<this._png.depth,i=(a,o)=>{const s=((a+n.yOffset)*this._png.width+n.xOffset+o)*this._png.channels,u=(a*n.width+o)*this._png.channels;return{index:s,frameIndex:u}};switch(n.blendOp){case Iv.SOURCE:for(let a=0;a<n.height;a++)for(let o=0;o<n.width;o++){const{index:s,frameIndex:u}=i(a,o);for(let h=0;h<this._png.channels;h++)e.data[s+h]=n.data[u+h]}break;case Iv.OVER:for(let a=0;a<n.height;a++)for(let o=0;o<n.width;o++){const{index:s,frameIndex:u}=i(a,o);for(let h=0;h<this._png.channels;h++){const f=n.data[u+this._png.channels-1]/r,g=h%(this._png.channels-1)===0?1:n.data[u+h],v=Math.floor(f*g+(1-f)*e.data[s+h]);e.data[s+h]+=v}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const e=this._isAnimated?(this._frames?.at(0)).data:this._inflator.result;if(this._filterMethod!==Ew.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===Mv.NO_INTERLACE)this._png.data=xw({data:e,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else if(this._interlaceMethod===Mv.ADAM7)this._png.data=gI({data:e,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){const e=this._inflator.result,n=this._frames.at(-1);n?n.data=e:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:B1.NONE,blendOp:Iv.SOURCE,data:e}),this._inflator=new bw,this._writingDataChunks=!1}}function NI(t){if(t!==1&&t!==2&&t!==4&&t!==8&&t!==16)throw new Error(`invalid bit depth: ${t}`);return t}var kw;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.METRE=1]="METRE"})(kw||(kw={}));function TI(t,e){return new LI(t,e).decode()}var bn=(function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this})();function jv(){bn.console&&typeof bn.console.log=="function"&&bn.console.log.apply(bn.console,arguments)}var Yr={log:jv,warn:function(t){bn.console&&(typeof bn.console.warn=="function"?bn.console.warn.apply(bn.console,arguments):jv.call(null,arguments))},error:function(t){bn.console&&(typeof bn.console.error=="function"?bn.console.error.apply(bn.console,arguments):jv(t))}};function Dv(t,e,n){var r=new XMLHttpRequest;r.open("GET",t),r.responseType="blob",r.onload=function(){Kf(r.response,e,n)},r.onerror=function(){Yr.error("could not download file")},r.send()}function Aw(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch{}return e.status>=200&&e.status<=299}function z1(t){try{t.dispatchEvent(new MouseEvent("click"))}catch{var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var Kf=bn.saveAs||((typeof window>"u"?"undefined":Nr(window))!=="object"||window!==bn?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(t,e,n){var r=bn.URL||bn.webkitURL,i=document.createElement("a");e=e||t.name||"download",i.download=e,i.rel="noopener",typeof t=="string"?(i.href=t,i.origin!==location.origin?Aw(i.href)?Dv(t,e,n):z1(i,i.target="_blank"):z1(i)):(i.href=r.createObjectURL(t),setTimeout(function(){r.revokeObjectURL(i.href)},4e4),setTimeout(function(){z1(i)},0))}:"msSaveOrOpenBlob"in navigator?function(t,e,n){if(e=e||t.name||"download",typeof t=="string")if(Aw(t))Dv(t,e,n);else{var r=document.createElement("a");r.href=t,r.target="_blank",setTimeout(function(){z1(r)})}else navigator.msSaveOrOpenBlob((function(i,a){return a===void 0?a={autoBom:!1}:Nr(a)!=="object"&&(Yr.warn("Deprecated: Expected third argument to be a object"),a={autoBom:!a}),a.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(i.type)?new Blob(["\uFEFF",i],{type:i.type}):i})(t,n),e)}:function(t,e,n,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),typeof t=="string")return Dv(t,e,n);var i=t.type==="application/octet-stream",a=/constructor/i.test(bn.HTMLElement)||bn.safari,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a)&&(typeof FileReader>"u"?"undefined":Nr(FileReader))==="object"){var s=new FileReader;s.onloadend=function(){var f=s.result;f=o?f:f.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=f:location=f,r=null},s.readAsDataURL(t)}else{var u=bn.URL||bn.webkitURL,h=u.createObjectURL(t);r?r.location=h:location.href=h,r=null,setTimeout(function(){u.revokeObjectURL(h)},4e4)}});/**
461
+ * A class to parse color values
462
+ * @author Stoyan Stefanov <sstoo@gmail.com>
463
+ * {@link http://www.phpied.com/rgb-color-parser-in-javascript/}
464
+ * @license Use it if you like it
465
+ */function tx(t){var e;t=t||"",this.ok=!1,t.charAt(0)=="#"&&(t=t.substr(1,6)),t={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[t=(t=t.replace(/ /g,"")).toLowerCase()]||t;for(var n=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(s){return[parseInt(s[1]),parseInt(s[2]),parseInt(s[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(s){return[parseInt(s[1],16),parseInt(s[2],16),parseInt(s[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(s){return[parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16),parseInt(s[3]+s[3],16)]}}],r=0;r<n.length;r++){var i=n[r].re,a=n[r].process,o=i.exec(t);o&&(e=a(o),this.r=e[0],this.g=e[1],this.b=e[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var s=this.r.toString(16),u=this.g.toString(16),h=this.b.toString(16);return s.length==1&&(s="0"+s),u.length==1&&(u="0"+u),h.length==1&&(h="0"+h),"#"+s+u+h}}var e0=bn.atob.bind(bn),Pw=bn.btoa.bind(bn);/**
466
+ * @license
467
+ * Joseph Myers does not specify a particular license for his work.
468
+ *
469
+ * Author: Joseph Myers
470
+ * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
471
+ *
472
+ * Modified by: Owen Leong
473
+ */function Fv(t,e){var n=t[0],r=t[1],i=t[2],a=t[3];n=Fo(n,r,i,a,e[0],7,-680876936),a=Fo(a,n,r,i,e[1],12,-389564586),i=Fo(i,a,n,r,e[2],17,606105819),r=Fo(r,i,a,n,e[3],22,-1044525330),n=Fo(n,r,i,a,e[4],7,-176418897),a=Fo(a,n,r,i,e[5],12,1200080426),i=Fo(i,a,n,r,e[6],17,-1473231341),r=Fo(r,i,a,n,e[7],22,-45705983),n=Fo(n,r,i,a,e[8],7,1770035416),a=Fo(a,n,r,i,e[9],12,-1958414417),i=Fo(i,a,n,r,e[10],17,-42063),r=Fo(r,i,a,n,e[11],22,-1990404162),n=Fo(n,r,i,a,e[12],7,1804603682),a=Fo(a,n,r,i,e[13],12,-40341101),i=Fo(i,a,n,r,e[14],17,-1502002290),n=Bo(n,r=Fo(r,i,a,n,e[15],22,1236535329),i,a,e[1],5,-165796510),a=Bo(a,n,r,i,e[6],9,-1069501632),i=Bo(i,a,n,r,e[11],14,643717713),r=Bo(r,i,a,n,e[0],20,-373897302),n=Bo(n,r,i,a,e[5],5,-701558691),a=Bo(a,n,r,i,e[10],9,38016083),i=Bo(i,a,n,r,e[15],14,-660478335),r=Bo(r,i,a,n,e[4],20,-405537848),n=Bo(n,r,i,a,e[9],5,568446438),a=Bo(a,n,r,i,e[14],9,-1019803690),i=Bo(i,a,n,r,e[3],14,-187363961),r=Bo(r,i,a,n,e[8],20,1163531501),n=Bo(n,r,i,a,e[13],5,-1444681467),a=Bo(a,n,r,i,e[2],9,-51403784),i=Bo(i,a,n,r,e[7],14,1735328473),n=zo(n,r=Bo(r,i,a,n,e[12],20,-1926607734),i,a,e[5],4,-378558),a=zo(a,n,r,i,e[8],11,-2022574463),i=zo(i,a,n,r,e[11],16,1839030562),r=zo(r,i,a,n,e[14],23,-35309556),n=zo(n,r,i,a,e[1],4,-1530992060),a=zo(a,n,r,i,e[4],11,1272893353),i=zo(i,a,n,r,e[7],16,-155497632),r=zo(r,i,a,n,e[10],23,-1094730640),n=zo(n,r,i,a,e[13],4,681279174),a=zo(a,n,r,i,e[0],11,-358537222),i=zo(i,a,n,r,e[3],16,-722521979),r=zo(r,i,a,n,e[6],23,76029189),n=zo(n,r,i,a,e[9],4,-640364487),a=zo(a,n,r,i,e[12],11,-421815835),i=zo(i,a,n,r,e[15],16,530742520),n=qo(n,r=zo(r,i,a,n,e[2],23,-995338651),i,a,e[0],6,-198630844),a=qo(a,n,r,i,e[7],10,1126891415),i=qo(i,a,n,r,e[14],15,-1416354905),r=qo(r,i,a,n,e[5],21,-57434055),n=qo(n,r,i,a,e[12],6,1700485571),a=qo(a,n,r,i,e[3],10,-1894986606),i=qo(i,a,n,r,e[10],15,-1051523),r=qo(r,i,a,n,e[1],21,-2054922799),n=qo(n,r,i,a,e[8],6,1873313359),a=qo(a,n,r,i,e[15],10,-30611744),i=qo(i,a,n,r,e[6],15,-1560198380),r=qo(r,i,a,n,e[13],21,1309151649),n=qo(n,r,i,a,e[4],6,-145523070),a=qo(a,n,r,i,e[11],10,-1120210379),i=qo(i,a,n,r,e[2],15,718787259),r=qo(r,i,a,n,e[9],21,-343485551),t[0]=gf(n,t[0]),t[1]=gf(r,t[1]),t[2]=gf(i,t[2]),t[3]=gf(a,t[3])}function ng(t,e,n,r,i,a){return e=gf(gf(e,t),gf(r,a)),gf(e<<i|e>>>32-i,n)}function Fo(t,e,n,r,i,a,o){return ng(e&n|~e&r,t,e,i,a,o)}function Bo(t,e,n,r,i,a,o){return ng(e&r|n&~r,t,e,i,a,o)}function zo(t,e,n,r,i,a,o){return ng(e^n^r,t,e,i,a,o)}function qo(t,e,n,r,i,a,o){return ng(n^(e|~r),t,e,i,a,o)}function nx(t){var e,n=t.length,r=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=t.length;e+=64)Fv(r,RI(t.substring(e-64,e)));t=t.substring(e-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<t.length;e++)i[e>>2]|=t.charCodeAt(e)<<(e%4<<3);if(i[e>>2]|=128<<(e%4<<3),e>55)for(Fv(r,i),e=0;e<16;e++)i[e]=0;return i[14]=8*n,Fv(r,i),r}function RI(t){var e,n=[];for(e=0;e<64;e+=4)n[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return n}var Ow="0123456789abcdef".split("");function MI(t){for(var e="",n=0;n<4;n++)e+=Ow[t>>8*n+4&15]+Ow[t>>8*n&15];return e}function II(t){return String.fromCharCode(255&t,(65280&t)>>8,(16711680&t)>>16,(4278190080&t)>>24)}function Tm(t){return nx(t).map(II).join("")}var jI=(function(t){for(var e=0;e<t.length;e++)t[e]=MI(t[e]);return t.join("")})(nx("hello"))!="5d41402abc4b2a76b9719d911017c592";function gf(t,e){if(jI){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}return t+e&4294967295}/**
474
+ * @license
475
+ * FPDF is released under a permissive license: there is no usage restriction.
476
+ * You may embed it freely in your application (commercial or not), with or
477
+ * without modifications.
478
+ *
479
+ * Reference: http://www.fpdf.org/en/script/script37.php
480
+ */function Rm(t,e){var n,r,i,a;if(t!==n){for(var o=(i=t,a=1+(256/t.length|0),new Array(a+1).join(i)),s=[],u=0;u<256;u++)s[u]=u;var h=0;for(u=0;u<256;u++){var f=s[u];h=(h+f+o.charCodeAt(u))%256,s[u]=s[h],s[h]=f}n=t,r=s}else s=r;var g=e.length,v=0,p=0,y="";for(u=0;u<g;u++)p=(p+(f=s[v=(v+1)%256]))%256,s[v]=s[p],s[p]=f,o=s[(s[v]+s[p])%256],y+=String.fromCharCode(e.charCodeAt(u)^o);return y}/**
481
+ * @license
482
+ * Licensed under the MIT License.
483
+ * http://opensource.org/licenses/mit-license
484
+ * Author: Owen Leong (@owenl131)
485
+ * Date: 15 Oct 2020
486
+ * References:
487
+ * https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
488
+ * https://github.com/foliojs/pdfkit/blob/master/lib/security.js
489
+ * http://www.fpdf.org/en/script/script37.php
490
+ */var Cw={print:4,modify:8,copy:16,"annot-forms":32};function Jh(t,e,n,r){this.v=1,this.r=2;var i=192;t.forEach(function(s){if(Cw.perm!==void 0)throw new Error("Invalid permission: "+s);i+=Cw[s]}),this.padding="(¿N^NuŠAd\0NVÿú\b..\0¶Ðh>€/\f©þdSiz";var a=(e+this.padding).substr(0,32),o=(n+this.padding).substr(0,32);this.O=this.processOwnerPassword(a,o),this.P=-(1+(255^i)),this.encryptionKey=Tm(a+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(r)).substr(0,5),this.U=Rm(this.encryptionKey,this.padding)}function ed(t){if(/[^\u0000-\u00ff]/.test(t))throw new Error("Invalid PDF Name Object: "+t+", Only accept ASCII characters.");for(var e="",n=t.length,r=0;r<n;r++){var i=t.charCodeAt(r);e+=i<33||i===35||i===37||i===40||i===41||i===47||i===60||i===62||i===91||i===93||i===123||i===125||i>126?"#"+("0"+i.toString(16)).slice(-2):t[r]}return e}function Lw(t){if(Nr(t)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var e={};this.subscribe=function(n,r,i){if(i=i||!1,typeof n!="string"||typeof r!="function"||typeof i!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");e.hasOwnProperty(n)||(e[n]={});var a=Math.random().toString(35);return e[n][a]=[r,!!i],a},this.unsubscribe=function(n){for(var r in e)if(e[r][n])return delete e[r][n],Object.keys(e[r]).length===0&&delete e[r],!0;return!1},this.publish=function(n){if(e.hasOwnProperty(n)){var r=Array.prototype.slice.call(arguments,1),i=[];for(var a in e[n]){var o=e[n][a];try{o[0].apply(t,r)}catch(s){bn.console&&Yr.error("jsPDF PubSub Error",s.message,s)}o[1]&&i.push(a)}i.length&&i.forEach(this.unsubscribe)}},this.getTopics=function(){return e}}function P0(t){if(!(this instanceof P0))return new P0(t);var e="opacity,stroke-opacity".split(",");for(var n in t)t.hasOwnProperty(n)&&e.indexOf(n)>=0&&(this[n]=t[n]);this.id="",this.objectNumber=-1}function rx(t,e){this.gState=t,this.matrix=e,this.id="",this.objectNumber=-1}function Zf(t,e,n,r,i){if(!(this instanceof Zf))return new Zf(t,e,n,r,i);this.type=t==="axial"?2:3,this.coords=e,this.colors=n,rx.call(this,r,i)}function od(t,e,n,r,i){if(!(this instanceof od))return new od(t,e,n,r,i);this.boundingBox=t,this.xStep=e,this.yStep=n,this.stream="",this.cloneIndex=0,rx.call(this,r,i)}function tn(t){var e,n=typeof arguments[0]=="string"?arguments[0]:"p",r=arguments[1],i=arguments[2],a=arguments[3],o=[],s=1,u=16,h="S",f=null;Nr(t=t||{})==="object"&&(n=t.orientation,r=t.unit||r,i=t.format||i,a=t.compress||t.compressPdf||a,(f=t.encryption||null)!==null&&(f.userPassword=f.userPassword||"",f.ownerPassword=f.ownerPassword||"",f.userPermissions=f.userPermissions||[]),s=typeof t.userUnit=="number"?Math.abs(t.userUnit):1,t.precision!==void 0&&(e=t.precision),t.floatPrecision!==void 0&&(u=t.floatPrecision),h=t.defaultPathOperation||"S"),o=t.filters||(a===!0?["FlateEncode"]:o),r=r||"mm",n=(""+(n||"P")).toLowerCase();var g=t.putOnlyUsedFonts||!1,v={},p={internal:{},__private__:{}};p.__private__.PubSub=Lw;var y="1.3",_=p.__private__.getPdfVersion=function(){return y};p.__private__.setPdfVersion=function(H){y=H};var x={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};p.__private__.getPageFormats=function(){return x};var b=p.__private__.getPageFormat=function(H){return x[H]};i=i||"a4";var E="compat",A="advanced",S=E;function k(){this.saveGraphicsState(),ge(new Qt(bt,0,0,-bt,0,vi()*bt).toString()+" cm"),this.setFontSize(this.getFontSize()/bt),h="n",S=A}function I(){this.restoreGraphicsState(),h="S",S=E}var O=p.__private__.combineFontStyleAndFontWeight=function(H,ce){if(H=="bold"&&ce=="normal"||H=="bold"&&ce==400||H=="normal"&&ce=="italic"||H=="bold"&&ce=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return ce&&(H=ce==400||ce==="normal"?H==="italic"?"italic":"normal":ce!=700&&ce!=="bold"||H!=="normal"?(ce==700?"bold":ce)+""+H:"bold"),H};p.advancedAPI=function(H){var ce=S===E;return ce&&k.call(this),typeof H!="function"||(H(this),ce&&I.call(this)),this},p.compatAPI=function(H){var ce=S===A;return ce&&I.call(this),typeof H!="function"||(H(this),ce&&k.call(this)),this},p.isAdvancedAPI=function(){return S===A};var M,F=function(H){if(S!==A)throw new Error(H+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},j=p.roundToPrecision=p.__private__.roundToPrecision=function(H,ce){var ke=e||ce;if(isNaN(H)||isNaN(ke))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return H.toFixed(ke).replace(/0+$/,"")};M=p.hpf=p.__private__.hpf=typeof u=="number"?function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.hpf");return j(H,u)}:u==="smart"?function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.hpf");return j(H,H>-1&&H<1?16:5)}:function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.hpf");return j(H,16)};var T=p.f2=p.__private__.f2=function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.f2");return j(H,2)},L=p.__private__.f3=function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.f3");return j(H,3)},$=p.scale=p.__private__.scale=function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.scale");return S===E?H*bt:S===A?H:void 0},q=function(H){return $((function(ce){return S===E?vi()-ce:S===A?ce:void 0})(H))};p.__private__.setPrecision=p.setPrecision=function(H){typeof parseInt(H,10)=="number"&&(e=parseInt(H,10))};var J,ae="00000000000000000000000000000000",ie=p.__private__.getFileId=function(){return ae},Z=p.__private__.setFileId=function(H){return ae=H!==void 0&&/^[a-fA-F0-9]{32}$/.test(H)?H.toUpperCase():ae.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),f!==null&&(Zr=new Jh(f.userPermissions,f.userPassword,f.ownerPassword,ae)),ae};p.setFileId=function(H){return Z(H),this},p.getFileId=function(){return ie()};var te=p.__private__.convertDateToPDFDate=function(H){var ce=H.getTimezoneOffset(),ke=ce<0?"+":"-",De=Math.floor(Math.abs(ce/60)),Ge=Math.abs(ce%60),at=[ke,X(De),"'",X(Ge),"'"].join("");return["D:",H.getFullYear(),X(H.getMonth()+1),X(H.getDate()),X(H.getHours()),X(H.getMinutes()),X(H.getSeconds()),at].join("")},V=p.__private__.convertPDFDateToDate=function(H){var ce=parseInt(H.substr(2,4),10),ke=parseInt(H.substr(6,2),10)-1,De=parseInt(H.substr(8,2),10),Ge=parseInt(H.substr(10,2),10),at=parseInt(H.substr(12,2),10),ct=parseInt(H.substr(14,2),10);return new Date(ce,ke,De,Ge,at,ct,0)},B=p.__private__.setCreationDate=function(H){var ce;if(H===void 0&&(H=new Date),H instanceof Date)ce=te(H);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(H))throw new Error("Invalid argument passed to jsPDF.setCreationDate");ce=H}return J=ce},D=p.__private__.getCreationDate=function(H){var ce=J;return H==="jsDate"&&(ce=V(J)),ce};p.setCreationDate=function(H){return B(H),this},p.getCreationDate=function(H){return D(H)};var U,X=p.__private__.padd2=function(H){return("0"+parseInt(H)).slice(-2)},ee=p.__private__.padd2Hex=function(H){return("00"+(H=H.toString())).substr(H.length)},K=0,oe=[],me=[],de=0,ye=[],Re=[],Oe=!1,Me=me;p.__private__.setCustomOutputDestination=function(H){Oe=!0,Me=H};var Ee=function(H){Oe||(Me=H)};p.__private__.resetCustomOutputDestination=function(){Oe=!1,Me=me};var ge=p.__private__.out=function(H){return H=H.toString(),de+=H.length+1,Me.push(H),Me},Te=p.__private__.write=function(H){return ge(arguments.length===1?H.toString():Array.prototype.join.call(arguments," "))},Be=p.__private__.getArrayBuffer=function(H){for(var ce=H.length,ke=new ArrayBuffer(ce),De=new Uint8Array(ke);ce--;)De[ce]=H.charCodeAt(ce);return ke},Ce=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];p.__private__.getStandardFonts=function(){return Ce};var fe=t.fontSize||16;p.__private__.setFontSize=p.setFontSize=function(H){return fe=S===A?H/bt:H,this};var Le,Ne=p.__private__.getFontSize=p.getFontSize=function(){return S===E?fe:fe*bt},ue=t.R2L||!1;p.__private__.setR2L=p.setR2L=function(H){return ue=H,this},p.__private__.getR2L=p.getR2L=function(){return ue};var Ae,Pe=p.__private__.setZoomMode=function(H){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(H))Le=H;else if(isNaN(H)){if([void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(H)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+H+'" is not recognized.');Le=H}else Le=parseInt(H,10)};p.__private__.getZoomMode=function(){return Le};var Ue,st=p.__private__.setPageMode=function(H){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(H)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+H+'" is not recognized.');Ae=H};p.__private__.getPageMode=function(){return Ae};var dt=p.__private__.setLayoutMode=function(H){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(H)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+H+'" is not recognized.');Ue=H};p.__private__.getLayoutMode=function(){return Ue},p.__private__.setDisplayMode=p.setDisplayMode=function(H,ce,ke){return Pe(H),dt(ce),st(ke),this};var pt={title:"",subject:"",author:"",keywords:"",creator:""};p.__private__.getDocumentProperty=function(H){if(Object.keys(pt).indexOf(H)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return pt[H]},p.__private__.getDocumentProperties=function(){return pt},p.__private__.setDocumentProperties=p.setProperties=p.setDocumentProperties=function(H){for(var ce in pt)pt.hasOwnProperty(ce)&&H[ce]&&(pt[ce]=H[ce]);return this},p.__private__.setDocumentProperty=function(H,ce){if(Object.keys(pt).indexOf(H)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return pt[H]=ce};var xt,bt,kt,qn,xn,It={},Jt={},Ve=[],qe={},Nt={},Ct={},an={},Ut=null,Sn=0,en=[],gn=new Lw(p),Bi=t.hotfixes||[],oi={},Ei={},Sr=[],Qt=function H(ce,ke,De,Ge,at,ct){if(!(this instanceof H))return new H(ce,ke,De,Ge,at,ct);isNaN(ce)&&(ce=1),isNaN(ke)&&(ke=0),isNaN(De)&&(De=0),isNaN(Ge)&&(Ge=1),isNaN(at)&&(at=0),isNaN(ct)&&(ct=0),this._matrix=[ce,ke,De,Ge,at,ct]};Object.defineProperty(Qt.prototype,"sx",{get:function(){return this._matrix[0]},set:function(H){this._matrix[0]=H}}),Object.defineProperty(Qt.prototype,"shy",{get:function(){return this._matrix[1]},set:function(H){this._matrix[1]=H}}),Object.defineProperty(Qt.prototype,"shx",{get:function(){return this._matrix[2]},set:function(H){this._matrix[2]=H}}),Object.defineProperty(Qt.prototype,"sy",{get:function(){return this._matrix[3]},set:function(H){this._matrix[3]=H}}),Object.defineProperty(Qt.prototype,"tx",{get:function(){return this._matrix[4]},set:function(H){this._matrix[4]=H}}),Object.defineProperty(Qt.prototype,"ty",{get:function(){return this._matrix[5]},set:function(H){this._matrix[5]=H}}),Object.defineProperty(Qt.prototype,"a",{get:function(){return this._matrix[0]},set:function(H){this._matrix[0]=H}}),Object.defineProperty(Qt.prototype,"b",{get:function(){return this._matrix[1]},set:function(H){this._matrix[1]=H}}),Object.defineProperty(Qt.prototype,"c",{get:function(){return this._matrix[2]},set:function(H){this._matrix[2]=H}}),Object.defineProperty(Qt.prototype,"d",{get:function(){return this._matrix[3]},set:function(H){this._matrix[3]=H}}),Object.defineProperty(Qt.prototype,"e",{get:function(){return this._matrix[4]},set:function(H){this._matrix[4]=H}}),Object.defineProperty(Qt.prototype,"f",{get:function(){return this._matrix[5]},set:function(H){this._matrix[5]=H}}),Object.defineProperty(Qt.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Qt.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Qt.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Qt.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),Qt.prototype.join=function(H){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(M).join(H)},Qt.prototype.multiply=function(H){var ce=H.sx*this.sx+H.shy*this.shx,ke=H.sx*this.shy+H.shy*this.sy,De=H.shx*this.sx+H.sy*this.shx,Ge=H.shx*this.shy+H.sy*this.sy,at=H.tx*this.sx+H.ty*this.shx+this.tx,ct=H.tx*this.shy+H.ty*this.sy+this.ty;return new Qt(ce,ke,De,Ge,at,ct)},Qt.prototype.decompose=function(){var H=this.sx,ce=this.shy,ke=this.shx,De=this.sy,Ge=this.tx,at=this.ty,ct=Math.sqrt(H*H+ce*ce),Dt=(H/=ct)*ke+(ce/=ct)*De;ke-=H*Dt,De-=ce*Dt;var jt=Math.sqrt(ke*ke+De*De);return Dt/=jt,H*(De/=jt)<ce*(ke/=jt)&&(H=-H,ce=-ce,Dt=-Dt,ct=-ct),{scale:new Qt(ct,0,0,jt,0,0),translate:new Qt(1,0,0,1,Ge,at),rotate:new Qt(H,ce,-ce,H,0,0),skew:new Qt(1,0,Dt,1,0,0)}},Qt.prototype.toString=function(H){return this.join(" ")},Qt.prototype.inversed=function(){var H=this.sx,ce=this.shy,ke=this.shx,De=this.sy,Ge=this.tx,at=this.ty,ct=1/(H*De-ce*ke),Dt=De*ct,jt=-ce*ct,fn=-ke*ct,hn=H*ct;return new Qt(Dt,jt,fn,hn,-Dt*Ge-fn*at,-jt*Ge-hn*at)},Qt.prototype.applyToPoint=function(H){var ce=H.x*this.sx+H.y*this.shx+this.tx,ke=H.x*this.shy+H.y*this.sy+this.ty;return new ko(ce,ke)},Qt.prototype.applyToRectangle=function(H){var ce=this.applyToPoint(H),ke=this.applyToPoint(new ko(H.x+H.w,H.y+H.h));return new dl(ce.x,ce.y,ke.x-ce.x,ke.y-ce.y)},Qt.prototype.clone=function(){var H=this.sx,ce=this.shy,ke=this.shx,De=this.sy,Ge=this.tx,at=this.ty;return new Qt(H,ce,ke,De,Ge,at)},p.Matrix=Qt;var ca=p.matrixMult=function(H,ce){return ce.multiply(H)},Fa=new Qt(1,0,0,1,0,0);p.unitMatrix=p.identityMatrix=Fa;var Kr=function(H,ce){if(!Nt[H]){var ke=(ce instanceof Zf?"Sh":"P")+(Object.keys(qe).length+1).toString(10);ce.id=ke,Nt[H]=ke,qe[ke]=ce,gn.publish("addPattern",ce)}};p.ShadingPattern=Zf,p.TilingPattern=od,p.addShadingPattern=function(H,ce){return F("addShadingPattern()"),Kr(H,ce),this},p.beginTilingPattern=function(H){F("beginTilingPattern()"),li(H.boundingBox[0],H.boundingBox[1],H.boundingBox[2]-H.boundingBox[0],H.boundingBox[3]-H.boundingBox[1],H.matrix)},p.endTilingPattern=function(H,ce){F("endTilingPattern()"),ce.stream=Re[U].join(`
491
+ `),Kr(H,ce),gn.publish("endTilingPattern",ce),Sr.pop().restore()};var Yi,Un=p.__private__.newObject=function(){var H=Er();return Rr(H,!0),H},Er=p.__private__.newObjectDeferred=function(){return K++,oe[K]=function(){return de},K},Rr=function(H,ce){return ce=typeof ce=="boolean"&&ce,oe[H]=de,ce&&ge(H+" 0 obj"),H},Sa=p.__private__.newAdditionalObject=function(){var H={objId:Er(),content:""};return ye.push(H),H},Ho=Er(),Ea=Er(),eo=p.__private__.decodeColorString=function(H){var ce=H.split(" ");if(ce.length!==2||ce[1]!=="g"&&ce[1]!=="G")ce.length!==5||ce[4]!=="k"&&ce[4]!=="K"||(ce=[(1-ce[0])*(1-ce[3]),(1-ce[1])*(1-ce[3]),(1-ce[2])*(1-ce[3]),"r"]);else{var ke=parseFloat(ce[0]);ce=[ke,ke,ke,"r"]}for(var De="#",Ge=0;Ge<3;Ge++)De+=("0"+Math.floor(255*parseFloat(ce[Ge])).toString(16)).slice(-2);return De},si=p.__private__.encodeColorString=function(H){var ce;typeof H=="string"&&(H={ch1:H});var ke=H.ch1,De=H.ch2,Ge=H.ch3,at=H.ch4,ct=H.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof ke=="string"&&ke.charAt(0)!=="#"){var Dt=new tx(ke);if(Dt.ok)ke=Dt.toHex();else if(!/^\d*\.?\d*$/.test(ke))throw new Error('Invalid color "'+ke+'" passed to jsPDF.encodeColorString.')}if(typeof ke=="string"&&/^#[0-9A-Fa-f]{3}$/.test(ke)&&(ke="#"+ke[1]+ke[1]+ke[2]+ke[2]+ke[3]+ke[3]),typeof ke=="string"&&/^#[0-9A-Fa-f]{6}$/.test(ke)){var jt=parseInt(ke.substr(1),16);ke=jt>>16&255,De=jt>>8&255,Ge=255&jt}if(De===void 0||at===void 0&&ke===De&&De===Ge)ce=typeof ke=="string"?ke+" "+ct[0]:H.precision===2?T(ke/255)+" "+ct[0]:L(ke/255)+" "+ct[0];else if(at===void 0||Nr(at)==="object"){if(at&&!isNaN(at.a)&&at.a===0)return["1.","1.","1.",ct[1]].join(" ");ce=typeof ke=="string"?[ke,De,Ge,ct[1]].join(" "):H.precision===2?[T(ke/255),T(De/255),T(Ge/255),ct[1]].join(" "):[L(ke/255),L(De/255),L(Ge/255),ct[1]].join(" ")}else ce=typeof ke=="string"?[ke,De,Ge,at,ct[2]].join(" "):H.precision===2?[T(ke),T(De),T(Ge),T(at),ct[2]].join(" "):[L(ke),L(De),L(Ge),L(at),ct[2]].join(" ");return ce},ka=p.__private__.getFilters=function(){return o},Aa=p.__private__.putStream=function(H){var ce=(H=H||{}).data||"",ke=H.filters||ka(),De=H.alreadyAppliedFilters||[],Ge=H.addLength1||!1,at=ce.length,ct=H.objectId,Dt=function(mi){return mi};if(f!==null&&ct===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");f!==null&&(Dt=Zr.encryptor(ct,0));var jt={};ke===!0&&(ke=["FlateEncode"]);var fn=H.additionalKeyValues||[],hn=(jt=tn.API.processDataByFilters!==void 0?tn.API.processDataByFilters(ce,ke):{data:ce,reverseChain:[]}).reverseChain+(Array.isArray(De)?De.join(" "):De.toString());if(jt.data.length!==0&&(fn.push({key:"Length",value:jt.data.length}),Ge===!0&&fn.push({key:"Length1",value:at})),hn.length!=0)if(hn.split("/").length-1==1)fn.push({key:"Filter",value:hn});else{fn.push({key:"Filter",value:"["+hn+"]"});for(var Hn=0;Hn<fn.length;Hn+=1)if(fn[Hn].key==="DecodeParms"){for(var Ar=[],ui=0;ui<jt.reverseChain.split("/").length-1;ui+=1)Ar.push("null");Ar.push(fn[Hn].value),fn[Hn].value="["+Ar.join(" ")+"]"}}ge("<<");for(var or=0;or<fn.length;or++)ge("/"+fn[or].key+" "+fn[or].value);ge(">>"),jt.data.length!==0&&(ge("stream"),ge(Dt(jt.data)),ge("endstream"))},$o=p.__private__.putPage=function(H){var ce=H.number,ke=H.data,De=H.objId,Ge=H.contentsObjId;Rr(De,!0),ge("<</Type /Page"),ge("/Parent "+H.rootDictionaryObjId+" 0 R"),ge("/Resources "+H.resourceDictionaryObjId+" 0 R"),ge("/MediaBox ["+parseFloat(M(H.mediaBox.bottomLeftX))+" "+parseFloat(M(H.mediaBox.bottomLeftY))+" "+M(H.mediaBox.topRightX)+" "+M(H.mediaBox.topRightY)+"]"),H.cropBox!==null&&ge("/CropBox ["+M(H.cropBox.bottomLeftX)+" "+M(H.cropBox.bottomLeftY)+" "+M(H.cropBox.topRightX)+" "+M(H.cropBox.topRightY)+"]"),H.bleedBox!==null&&ge("/BleedBox ["+M(H.bleedBox.bottomLeftX)+" "+M(H.bleedBox.bottomLeftY)+" "+M(H.bleedBox.topRightX)+" "+M(H.bleedBox.topRightY)+"]"),H.trimBox!==null&&ge("/TrimBox ["+M(H.trimBox.bottomLeftX)+" "+M(H.trimBox.bottomLeftY)+" "+M(H.trimBox.topRightX)+" "+M(H.trimBox.topRightY)+"]"),H.artBox!==null&&ge("/ArtBox ["+M(H.artBox.bottomLeftX)+" "+M(H.artBox.bottomLeftY)+" "+M(H.artBox.topRightX)+" "+M(H.artBox.topRightY)+"]"),typeof H.userUnit=="number"&&H.userUnit!==1&&ge("/UserUnit "+H.userUnit),gn.publish("putPage",{objId:De,pageContext:en[ce],pageNumber:ce,page:ke}),ge("/Contents "+Ge+" 0 R"),ge(">>"),ge("endobj");var at=ke.join(`
492
+ `);return S===A&&(at+=`
493
+ Q`),Rr(Ge,!0),Aa({data:at,filters:ka(),objectId:Ge}),ge("endobj"),De},zi=p.__private__.putPages=function(){var H,ce,ke=[];for(H=1;H<=Sn;H++)en[H].objId=Er(),en[H].contentsObjId=Er();for(H=1;H<=Sn;H++)ke.push($o({number:H,data:Re[H],objId:en[H].objId,contentsObjId:en[H].contentsObjId,mediaBox:en[H].mediaBox,cropBox:en[H].cropBox,bleedBox:en[H].bleedBox,trimBox:en[H].trimBox,artBox:en[H].artBox,userUnit:en[H].userUnit,rootDictionaryObjId:Ho,resourceDictionaryObjId:Ea}));Rr(Ho,!0),ge("<</Type /Pages");var De="/Kids [";for(ce=0;ce<Sn;ce++)De+=ke[ce]+" 0 R ";ge(De+"]"),ge("/Count "+Sn),ge(">>"),ge("endobj"),gn.publish("postPutPages")},to=function(H){gn.publish("putFont",{font:H,out:ge,newObject:Un,putStream:Aa}),H.isAlreadyPutted!==!0&&(H.objectNumber=Un(),ge("<<"),ge("/Type /Font"),ge("/BaseFont /"+ed(H.postScriptName)),ge("/Subtype /Type1"),typeof H.encoding=="string"&&ge("/Encoding /"+H.encoding),ge("/FirstChar 32"),ge("/LastChar 255"),ge(">>"),ge("endobj"))},Bs=function(H){H.objectNumber=Un();var ce=[];ce.push({key:"Type",value:"/XObject"}),ce.push({key:"Subtype",value:"/Form"}),ce.push({key:"BBox",value:"["+[M(H.x),M(H.y),M(H.x+H.width),M(H.y+H.height)].join(" ")+"]"}),ce.push({key:"Matrix",value:"["+H.matrix.toString()+"]"});var ke=H.pages[1].join(`
494
+ `);Aa({data:ke,additionalKeyValues:ce,objectId:H.objectNumber}),ge("endobj")},is=function(H,ce){ce||(ce=21);var ke=Un(),De=(function(ct,Dt){var jt,fn=[],hn=1/(Dt-1);for(jt=0;jt<1;jt+=hn)fn.push(jt);if(fn.push(1),ct[0].offset!=0){var Hn={offset:0,color:ct[0].color};ct.unshift(Hn)}if(ct[ct.length-1].offset!=1){var Ar={offset:1,color:ct[ct.length-1].color};ct.push(Ar)}for(var ui="",or=0,mi=0;mi<fn.length;mi++){for(jt=fn[mi];jt>ct[or+1].offset;)or++;var _r=ct[or].offset,Ai=(jt-_r)/(ct[or+1].offset-_r),Po=ct[or].color,Qi=ct[or+1].color;ui+=ee(Math.round((1-Ai)*Po[0]+Ai*Qi[0]).toString(16))+ee(Math.round((1-Ai)*Po[1]+Ai*Qi[1]).toString(16))+ee(Math.round((1-Ai)*Po[2]+Ai*Qi[2]).toString(16))}return ui.trim()})(H.colors,ce),Ge=[];Ge.push({key:"FunctionType",value:"0"}),Ge.push({key:"Domain",value:"[0.0 1.0]"}),Ge.push({key:"Size",value:"["+ce+"]"}),Ge.push({key:"BitsPerSample",value:"8"}),Ge.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Ge.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Aa({data:De,additionalKeyValues:Ge,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:ke}),ge("endobj"),H.objectNumber=Un(),ge("<< /ShadingType "+H.type),ge("/ColorSpace /DeviceRGB");var at="/Coords ["+M(parseFloat(H.coords[0]))+" "+M(parseFloat(H.coords[1]))+" ";H.type===2?at+=M(parseFloat(H.coords[2]))+" "+M(parseFloat(H.coords[3])):at+=M(parseFloat(H.coords[2]))+" "+M(parseFloat(H.coords[3]))+" "+M(parseFloat(H.coords[4]))+" "+M(parseFloat(H.coords[5])),ge(at+="]"),H.matrix&&ge("/Matrix ["+H.matrix.toString()+"]"),ge("/Function "+ke+" 0 R"),ge("/Extend [true true]"),ge(">>"),ge("endobj")},lu=function(H,ce){var ke=Er(),De=Un();ce.push({resourcesOid:ke,objectOid:De}),H.objectNumber=De;var Ge=[];Ge.push({key:"Type",value:"/Pattern"}),Ge.push({key:"PatternType",value:"1"}),Ge.push({key:"PaintType",value:"1"}),Ge.push({key:"TilingType",value:"1"}),Ge.push({key:"BBox",value:"["+H.boundingBox.map(M).join(" ")+"]"}),Ge.push({key:"XStep",value:M(H.xStep)}),Ge.push({key:"YStep",value:M(H.yStep)}),Ge.push({key:"Resources",value:ke+" 0 R"}),H.matrix&&Ge.push({key:"Matrix",value:"["+H.matrix.toString()+"]"}),Aa({data:H.stream,additionalKeyValues:Ge,objectId:H.objectNumber}),ge("endobj")},Tf=function(H){for(var ce in H.objectNumber=Un(),ge("<<"),H)switch(ce){case"opacity":ge("/ca "+T(H[ce]));break;case"stroke-opacity":ge("/CA "+T(H[ce]))}ge(">>"),ge("endobj")},kr=function(H){Rr(H.resourcesOid,!0),ge("<<"),ge("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),(function(){for(var ce in ge("/Font <<"),It)It.hasOwnProperty(ce)&&(g===!1||g===!0&&v.hasOwnProperty(ce))&&ge("/"+ce+" "+It[ce].objectNumber+" 0 R");ge(">>")})(),(function(){if(Object.keys(qe).length>0){for(var ce in ge("/Shading <<"),qe)qe.hasOwnProperty(ce)&&qe[ce]instanceof Zf&&qe[ce].objectNumber>=0&&ge("/"+ce+" "+qe[ce].objectNumber+" 0 R");gn.publish("putShadingPatternDict"),ge(">>")}})(),(function(ce){if(Object.keys(qe).length>0){for(var ke in ge("/Pattern <<"),qe)qe.hasOwnProperty(ke)&&qe[ke]instanceof p.TilingPattern&&qe[ke].objectNumber>=0&&qe[ke].objectNumber<ce&&ge("/"+ke+" "+qe[ke].objectNumber+" 0 R");gn.publish("putTilingPatternDict"),ge(">>")}})(H.objectOid),(function(){if(Object.keys(Ct).length>0){var ce;for(ce in ge("/ExtGState <<"),Ct)Ct.hasOwnProperty(ce)&&Ct[ce].objectNumber>=0&&ge("/"+ce+" "+Ct[ce].objectNumber+" 0 R");gn.publish("putGStateDict"),ge(">>")}})(),(function(){for(var ce in ge("/XObject <<"),oi)oi.hasOwnProperty(ce)&&oi[ce].objectNumber>=0&&ge("/"+ce+" "+oi[ce].objectNumber+" 0 R");gn.publish("putXobjectDict"),ge(">>")})(),ge(">>"),ge("endobj")},uu=function(H){Jt[H.fontName]=Jt[H.fontName]||{},Jt[H.fontName][H.fontStyle]=H.id},as=function(H,ce,ke,De,Ge){var at={id:"F"+(Object.keys(It).length+1).toString(10),postScriptName:H,fontName:ce,fontStyle:ke,encoding:De,isStandardFont:Ge||!1,metadata:{}};return gn.publish("addFont",{font:at,instance:this}),It[at.id]=at,uu(at),at.id},Pa=p.__private__.pdfEscape=p.pdfEscape=function(H,ce){return(function(ke,De){var Ge,at,ct,Dt,jt,fn,hn,Hn,Ar;if(ct=(De=De||{}).sourceEncoding||"Unicode",jt=De.outputEncoding,(De.autoencode||jt)&&It[xt].metadata&&It[xt].metadata[ct]&&It[xt].metadata[ct].encoding&&(Dt=It[xt].metadata[ct].encoding,!jt&&It[xt].encoding&&(jt=It[xt].encoding),!jt&&Dt.codePages&&(jt=Dt.codePages[0]),typeof jt=="string"&&(jt=Dt[jt]),jt)){for(hn=!1,fn=[],Ge=0,at=ke.length;Ge<at;Ge++)(Hn=jt[ke.charCodeAt(Ge)])?fn.push(String.fromCharCode(Hn)):fn.push(ke[Ge]),fn[Ge].charCodeAt(0)>>8&&(hn=!0);ke=fn.join("")}for(Ge=ke.length;hn===void 0&&Ge!==0;)ke.charCodeAt(Ge-1)>>8&&(hn=!0),Ge--;if(!hn)return ke;for(fn=De.noBOM?[]:[254,255],Ge=0,at=ke.length;Ge<at;Ge++){if((Ar=(Hn=ke.charCodeAt(Ge))>>8)>>8)throw new Error("Character at position "+Ge+" of string '"+ke+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");fn.push(Ar),fn.push(Hn-(Ar<<8))}return String.fromCharCode.apply(void 0,fn)})(H,ce).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},os=p.__private__.beginPage=function(H){Re[++Sn]=[],en[Sn]={objId:0,contentsObjId:0,userUnit:Number(s),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(H[0]),topRightY:Number(H[1])}},_o(Sn),Ee(Re[U])},kc=function(H,ce){var ke,De,Ge;switch(n=ce||n,typeof H=="string"&&(ke=b(H.toLowerCase()),Array.isArray(ke)&&(De=ke[0],Ge=ke[1])),Array.isArray(H)&&(De=H[0]*bt,Ge=H[1]*bt),isNaN(De)&&(De=i[0],Ge=i[1]),(De>14400||Ge>14400)&&(Yr.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),De=Math.min(14400,De),Ge=Math.min(14400,Ge)),i=[De,Ge],n.substr(0,1)){case"l":Ge>De&&(i=[Ge,De]);break;case"p":De>Ge&&(i=[Ge,De])}os(i),hl(qa),ge(zs),Ca!==0&&ge(Ca+" J"),ao!==0&&ge(ao+" j"),gn.publish("addPage",{pageNumber:Sn})},ll=function(H){H>0&&H<=Sn&&(Re.splice(H,1),en.splice(H,1),Sn--,U>Sn&&(U=Sn),this.setPage(U))},_o=function(H){H>0&&H<=Sn&&(U=H)},gi=p.__private__.getNumberOfPages=p.getNumberOfPages=function(){return Re.length-1},cr=function(H,ce,ke){var De,Ge=void 0;return ke=ke||{},H=H!==void 0?H:It[xt].fontName,ce=ce!==void 0?ce:It[xt].fontStyle,De=H.toLowerCase(),Jt[De]!==void 0&&Jt[De][ce]!==void 0?Ge=Jt[De][ce]:Jt[H]!==void 0&&Jt[H][ce]!==void 0?Ge=Jt[H][ce]:ke.disableWarning===!1&&Yr.warn("Unable to look up font label for font '"+H+"', '"+ce+"'. Refer to getFontList() for available fonts."),Ge||ke.noFallback||(Ge=Jt.times[ce])==null&&(Ge=Jt.times.normal),Ge},En=p.__private__.putInfo=function(){var H=Un(),ce=function(De){return De};for(var ke in f!==null&&(ce=Zr.encryptor(H,0)),ge("<<"),ge("/Producer ("+Pa(ce("jsPDF "+tn.version))+")"),pt)pt.hasOwnProperty(ke)&&pt[ke]&&ge("/"+ke.substr(0,1).toUpperCase()+ke.substr(1)+" ("+Pa(ce(pt[ke]))+")");ge("/CreationDate ("+Pa(ce(J))+")"),ge(">>"),ge("endobj")},ss=p.__private__.putCatalog=function(H){var ce=(H=H||{}).rootDictionaryObjId||Ho;switch(Un(),ge("<<"),ge("/Type /Catalog"),ge("/Pages "+ce+" 0 R"),Le||(Le="fullwidth"),Le){case"fullwidth":ge("/OpenAction [3 0 R /FitH null]");break;case"fullheight":ge("/OpenAction [3 0 R /FitV null]");break;case"fullpage":ge("/OpenAction [3 0 R /Fit]");break;case"original":ge("/OpenAction [3 0 R /XYZ null null 1]");break;default:var ke=""+Le;ke.substr(ke.length-1)==="%"&&(Le=parseInt(Le)/100),typeof Le=="number"&&ge("/OpenAction [3 0 R /XYZ null null "+T(Le)+"]")}switch(Ue||(Ue="continuous"),Ue){case"continuous":ge("/PageLayout /OneColumn");break;case"single":ge("/PageLayout /SinglePage");break;case"two":case"twoleft":ge("/PageLayout /TwoColumnLeft");break;case"tworight":ge("/PageLayout /TwoColumnRight")}Ae&&ge("/PageMode /"+Ae),gn.publish("putCatalog"),ge(">>"),ge("endobj")},Rn=p.__private__.putTrailer=function(){ge("trailer"),ge("<<"),ge("/Size "+(K+1)),ge("/Root "+K+" 0 R"),ge("/Info "+(K-1)+" 0 R"),f!==null&&ge("/Encrypt "+Zr.oid+" 0 R"),ge("/ID [ <"+ae+"> <"+ae+"> ]"),ge(">>")},Xi=p.__private__.putHeader=function(){ge("%PDF-"+y),ge("%ºß¬à")},no=p.__private__.putXRef=function(){var H="0000000000";ge("xref"),ge("0 "+(K+1)),ge("0000000000 65535 f ");for(var ce=1;ce<=K;ce++)typeof oe[ce]=="function"?ge((H+oe[ce]()).slice(-10)+" 00000 n "):oe[ce]!==void 0?ge((H+oe[ce]).slice(-10)+" 00000 n "):ge("0000000000 00000 n ")},Ki=p.__private__.buildDocument=function(){var H;K=0,de=0,me=[],oe=[],ye=[],Ho=Er(),Ea=Er(),Ee(me),gn.publish("buildDocument"),Xi(),zi(),(function(){gn.publish("putAdditionalObjects");for(var ke=0;ke<ye.length;ke++){var De=ye[ke];Rr(De.objId,!0),ge(De.content),ge("endobj")}gn.publish("postPutAdditionalObjects")})(),H=[],(function(){for(var ke in It)It.hasOwnProperty(ke)&&(g===!1||g===!0&&v.hasOwnProperty(ke))&&to(It[ke])})(),(function(){var ke;for(ke in Ct)Ct.hasOwnProperty(ke)&&Tf(Ct[ke])})(),(function(){for(var ke in oi)oi.hasOwnProperty(ke)&&Bs(oi[ke])})(),(function(ke){var De;for(De in qe)qe.hasOwnProperty(De)&&(qe[De]instanceof Zf?is(qe[De]):qe[De]instanceof od&&lu(qe[De],ke))})(H),gn.publish("putResources"),H.forEach(kr),kr({resourcesOid:Ea,objectOid:Number.MAX_SAFE_INTEGER}),gn.publish("postPutResources"),f!==null&&(Zr.oid=Un(),ge("<<"),ge("/Filter /Standard"),ge("/V "+Zr.v),ge("/R "+Zr.r),ge("/U <"+Zr.toHexString(Zr.U)+">"),ge("/O <"+Zr.toHexString(Zr.O)+">"),ge("/P "+Zr.P),ge(">>"),ge("endobj")),En(),ss();var ce=de;return no(),Rn(),ge("startxref"),ge(""+ce),ge("%%EOF"),Ee(Re[U]),me.join(`
495
+ `)},Mr=p.__private__.getBlob=function(H){return new Blob([Be(H)],{type:"application/pdf"})},Zi=p.output=p.__private__.output=(Yi=function(H,ce){switch(typeof(ce=ce||{})=="string"?ce={filename:ce}:ce.filename=ce.filename||"generated.pdf",H){case void 0:return Ki();case"save":p.save(ce.filename);break;case"arraybuffer":return Be(Ki());case"blob":return Mr(Ki());case"bloburi":case"bloburl":if(bn.URL!==void 0&&typeof bn.URL.createObjectURL=="function")return bn.URL&&bn.URL.createObjectURL(Mr(Ki()))||void 0;Yr.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var ke="",De=Ki();try{ke=Pw(De)}catch{ke=Pw(unescape(encodeURIComponent(De)))}return"data:application/pdf;filename="+ce.filename+";base64,"+ke;case"pdfobjectnewwindow":if(Object.prototype.toString.call(bn)==="[object Window]"){var Ge="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",at=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';ce.pdfObjectUrl&&(Ge=ce.pdfObjectUrl,at="");var ct='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+Ge+'"'+at+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(ce)+");<\/script></body></html>",Dt=bn.open();return Dt!==null&&Dt.document.write(ct),Dt}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(bn)==="[object Window]"){var jt='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="'+(ce.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+ce.filename+'" width="500px" height="400px" /></body></html>',fn=bn.open();if(fn!==null){fn.document.write(jt);var hn=this;fn.document.documentElement.querySelector("#pdfViewer").onload=function(){fn.document.title=ce.filename,fn.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(hn.output("bloburl"))}}return fn}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(bn)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var Hn='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring",ce)+'"></iframe></body></html>',Ar=bn.open();if(Ar!==null&&(Ar.document.write(Hn),Ar.document.title=ce.filename),Ar||typeof safari>"u")return Ar;break;case"datauri":case"dataurl":return bn.document.location.href=this.output("datauristring",ce);default:return null}},Yi.foo=function(){try{return Yi.apply(this,arguments)}catch(ke){var H=ke.stack||"";~H.indexOf(" at ")&&(H=H.split(" at ")[1]);var ce="Error in function "+H.split(`
496
+ `)[0].split("<")[0]+": "+ke.message;if(!bn.console)throw new Error(ce);bn.console.error(ce,ke),bn.alert&&alert(ce)}},Yi.foo.bar=Yi,Yi.foo),ul=function(H){return Array.isArray(Bi)===!0&&Bi.indexOf(H)>-1};switch(r){case"pt":bt=1;break;case"mm":bt=72/25.4;break;case"cm":bt=72/2.54;break;case"in":bt=72;break;case"px":bt=ul("px_scaling")==1?.75:96/72;break;case"pc":case"em":bt=12;break;case"ex":bt=6;break;default:if(typeof r!="number")throw new Error("Invalid unit: "+r);bt=r}var Zr=null;B(),Z();var ls=p.__private__.getPageInfo=p.getPageInfo=function(H){if(isNaN(H)||H%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:en[H].objId,pageNumber:H,pageContext:en[H]}},Vu=p.__private__.getPageInfoByObjId=function(H){if(isNaN(H)||H%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var ce in en)if(en[ce].objId===H)break;return ls(ce)},Oa=p.__private__.getCurrentPageInfo=p.getCurrentPageInfo=function(){return{objId:en[U].objId,pageNumber:U,pageContext:en[U]}};p.addPage=function(){return kc.apply(this,arguments),this},p.setPage=function(){return _o.apply(this,arguments),Ee.call(this,Re[U]),this},p.insertPage=function(H){return this.addPage(),this.movePage(U,H),this},p.movePage=function(H,ce){var ke,De;if(H>ce){ke=Re[H],De=en[H];for(var Ge=H;Ge>ce;Ge--)Re[Ge]=Re[Ge-1],en[Ge]=en[Ge-1];Re[ce]=ke,en[ce]=De,this.setPage(ce)}else if(H<ce){ke=Re[H],De=en[H];for(var at=H;at<ce;at++)Re[at]=Re[at+1],en[at]=en[at+1];Re[ce]=ke,en[ce]=De,this.setPage(ce)}return this},p.deletePage=function(){return ll.apply(this,arguments),this},p.__private__.text=p.text=function(H,ce,ke,De,Ge){var at,ct,Dt,jt,fn,hn,Hn,Ar,ui,or=(De=De||{}).scope||this;if(typeof H=="number"&&typeof ce=="number"&&(typeof ke=="string"||Array.isArray(ke))){var mi=ke;ke=ce,ce=H,H=mi}if(arguments[3]instanceof Qt==0?(Dt=arguments[4],jt=arguments[5],Nr(Hn=arguments[3])==="object"&&Hn!==null||(typeof Dt=="string"&&(jt=Dt,Dt=null),typeof Hn=="string"&&(jt=Hn,Hn=null),typeof Hn=="number"&&(Dt=Hn,Hn=null),De={flags:Hn,angle:Dt,align:jt})):(F("The transform parameter of text() with a Matrix value"),ui=Ge),isNaN(ce)||isNaN(ke)||H==null)throw new Error("Invalid arguments passed to jsPDF.text");if(H.length===0)return or;var _r,Ai="",Po=typeof De.lineHeightFactor=="number"?De.lineHeightFactor:za,Qi=or.internal.scaleFactor;function Lc(Ln){return Ln=Ln.split(" ").join(Array(De.TabLen||9).join(" ")),Pa(Ln,Hn)}function Oo(Ln){for(var on,kn=Ln.concat(),Nn=[],Va=kn.length;Va--;)typeof(on=kn.shift())=="string"?Nn.push(on):Array.isArray(Ln)&&(on.length===1||on[1]===void 0&&on[2]===void 0)?Nn.push(on[0]):Nn.push([on[0],on[1],on[2]]);return Nn}function hs(Ln,on){var kn;if(typeof Ln=="string")kn=on(Ln)[0];else if(Array.isArray(Ln)){for(var Nn,Va,$s=Ln.concat(),bs=[],Gs=$s.length;Gs--;)typeof(Nn=$s.shift())=="string"?bs.push(on(Nn)[0]):Array.isArray(Nn)&&typeof Nn[0]=="string"&&(Va=on(Nn[0],Nn[1],Nn[2]),bs.push([Va[0],Va[1],Va[2]]));kn=bs}return kn}var qs=!1,gl=!0;if(typeof H=="string")qs=!0;else if(Array.isArray(H)){var oo=H.concat();ct=[];for(var vl,Pi=oo.length;Pi--;)(typeof(vl=oo.shift())!="string"||Array.isArray(vl)&&typeof vl[0]!="string")&&(gl=!1);qs=gl}if(qs===!1)throw new Error('Type of text must be string or Array. "'+H+'" is not recognized.');typeof H=="string"&&(H=H.match(/[\r?\n]/)?H.split(/\r\n|\r|\n/g):[H]);var ds=fe/or.internal.scaleFactor,Co=ds*(Po-1);switch(De.baseline){case"bottom":ke-=Co;break;case"top":ke+=ds-Co;break;case"hanging":ke+=ds-2*Co;break;case"middle":ke+=ds/2-Co}if((hn=De.maxWidth||0)>0&&(typeof H=="string"?H=or.splitTextToSize(H,hn):Object.prototype.toString.call(H)==="[object Array]"&&(H=H.reduce(function(Ln,on){return Ln.concat(or.splitTextToSize(on,hn))},[]))),at={text:H,x:ce,y:ke,options:De,mutex:{pdfEscape:Pa,activeFontKey:xt,fonts:It,activeFontSize:fe}},gn.publish("preProcessText",at),H=at.text,Dt=(De=at.options).angle,ui instanceof Qt==0&&Dt&&typeof Dt=="number"){Dt*=Math.PI/180,De.rotationDirection===0&&(Dt=-Dt),S===A&&(Dt=-Dt);var Ml=Math.cos(Dt),Il=Math.sin(Dt);ui=new Qt(Ml,Il,-Il,Ml,0,0)}else Dt&&Dt instanceof Qt&&(ui=Dt);S!==A||ui||(ui=Fa),(fn=De.charSpace||Go)!==void 0&&(Ai+=M($(fn))+` Tc
497
+ `,this.setCharSpace(this.getCharSpace()||0)),(Ar=De.horizontalScale)!==void 0&&(Ai+=M(100*Ar)+` Tz
498
+ `),De.lang;var zr=-1,so=De.renderingMode!==void 0?De.renderingMode:De.stroke,Lo=or.internal.getCurrentPageInfo().pageContext;switch(so){case 0:case!1:case"fill":zr=0;break;case 1:case!0:case"stroke":zr=1;break;case 2:case"fillThenStroke":zr=2;break;case 3:case"invisible":zr=3;break;case 4:case"fillAndAddForClipping":zr=4;break;case 5:case"strokeAndAddPathForClipping":zr=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":zr=6;break;case 7:case"addToPathForClipping":zr=7}var Us=Lo.usedRenderingMode!==void 0?Lo.usedRenderingMode:-1;zr!==-1?Ai+=zr+` Tr
499
+ `:Us!==-1&&(Ai+=`0 Tr
500
+ `),zr!==-1&&(Lo.usedRenderingMode=zr),jt=De.align||"left";var Ir,Ga=fe*Po,ml=or.internal.pageSize.getWidth(),jl=It[xt];fn=De.charSpace||Go,hn=De.maxWidth||0,Hn=Object.assign({autoencode:!0,noBOM:!0},De.flags);var qi=[],Oi=function(Ln){return or.getStringUnitWidth(Ln,{font:jl,charSpace:fn,fontSize:fe,doKerning:!1})*fe/Qi};if(Object.prototype.toString.call(H)==="[object Array]"){var Na;ct=Oo(H),jt!=="left"&&(Ir=ct.map(Oi));var Wa,ha=0;if(jt==="right"){ce-=Ir[0],H=[],Pi=ct.length;for(var Ji=0;Ji<Pi;Ji++)Ji===0?(Wa=io(ce),Na=wr(ke)):(Wa=$(ha-Ir[Ji]),Na=-Ga),H.push([ct[Ji],Wa,Na]),ha=Ir[Ji]}else if(jt==="center"){ce-=Ir[0]/2,H=[],Pi=ct.length;for(var No=0;No<Pi;No++)No===0?(Wa=io(ce),Na=wr(ke)):(Wa=$((ha-Ir[No])/2),Na=-Ga),H.push([ct[No],Wa,Na]),ha=Ir[No]}else if(jt==="left"){H=[],Pi=ct.length;for(var ps=0;ps<Pi;ps++)H.push(ct[ps])}else if(jt==="justify"&&jl.encoding==="Identity-H"){H=[],Pi=ct.length,hn=hn!==0?hn:ml;for(var lo=0,Jr=0;Jr<Pi;Jr++)if(Na=Jr===0?wr(ke):-Ga,Wa=Jr===0?io(ce):lo,Jr<Pi-1){var Wo=$((hn-Ir[Jr])/(ct[Jr].split(" ").length-1)),ci=ct[Jr].split(" ");H.push([ci[0]+" ",Wa,Na]),lo=0;for(var Ta=1;Ta<ci.length;Ta++){var To=(Oi(ci[Ta-1]+" "+ci[Ta])-Oi(ci[Ta]))*Qi+Wo;Ta==ci.length-1?H.push([ci[Ta],To,0]):H.push([ci[Ta]+" ",To,0]),lo-=To}}else H.push([ct[Jr],Wa,Na]);H.push(["",lo,0])}else{if(jt!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(H=[],Pi=ct.length,hn=hn!==0?hn:ml,Jr=0;Jr<Pi;Jr++){Na=Jr===0?wr(ke):-Ga,Wa=Jr===0?io(ce):0;var da=ct[Jr].split(" ").length-1,yl=da>0?(hn-Ir[Jr])/da:0;Jr<Pi-1?qi.push(M($(yl))):qi.push(0),H.push([ct[Jr],Wa,Na])}}}(typeof De.R2L=="boolean"?De.R2L:ue)===!0&&(H=hs(H,function(Ln,on,kn){return[Ln.split("").reverse().join(""),on,kn]})),at={text:H,x:ce,y:ke,options:De,mutex:{pdfEscape:Pa,activeFontKey:xt,fonts:It,activeFontSize:fe}},gn.publish("postProcessText",at),H=at.text,_r=at.mutex.isHex||!1;var Vo=It[xt].encoding;Vo!=="WinAnsiEncoding"&&Vo!=="StandardEncoding"||(H=hs(H,function(Ln,on,kn){return[Lc(Ln),on,kn]})),ct=Oo(H),H=[];for(var gs,vs,tr,ms=Array.isArray(ct[0])?1:0,ys="",Hs=function(Ln,on,kn){var Nn="";return kn instanceof Qt?(kn=typeof De.angle=="number"?ca(kn,new Qt(1,0,0,1,Ln,on)):ca(new Qt(1,0,0,1,Ln,on),kn),S===A&&(kn=ca(new Qt(1,0,0,-1,0,0),kn)),Nn=kn.join(" ")+` Tm
501
+ `):Nn=M(Ln)+" "+M(on)+` Td
502
+ `,Nn},Pr=0;Pr<ct.length;Pr++){switch(ys="",ms){case 1:tr=(_r?"<":"(")+ct[Pr][0]+(_r?">":")"),gs=parseFloat(ct[Pr][1]),vs=parseFloat(ct[Pr][2]);break;case 0:tr=(_r?"<":"(")+ct[Pr]+(_r?">":")"),gs=io(ce),vs=wr(ke)}qi!==void 0&&qi[Pr]!==void 0&&(ys=qi[Pr]+` Tw
503
+ `),Pr===0?H.push(ys+Hs(gs,vs,ui)+tr):ms===0?H.push(ys+tr):ms===1&&H.push(ys+Hs(gs,vs,ui)+tr)}H=ms===0?H.join(` Tj
504
+ T* `):H.join(` Tj
505
+ `),H+=` Tj
506
+ `;var pa=`BT
507
+ /`;return pa+=xt+" "+fe+` Tf
508
+ `,pa+=M(fe*Po)+` TL
509
+ `,pa+=Ua+`
510
+ `,pa+=Ai,pa+=H,ge(pa+="ET"),v[xt]=!0,or};var Tl=p.__private__.clip=p.clip=function(H){return ge(H==="evenodd"?"W*":"W"),this};p.clipEvenOdd=function(){return Tl("evenodd")},p.__private__.discardPath=p.discardPath=function(){return ge("n"),this};var us=p.__private__.isValidStyle=function(H){var ce=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(H)!==-1&&(ce=!0),ce};p.__private__.setDefaultPathOperation=p.setDefaultPathOperation=function(H){return us(H)&&(h=H),this};var cu=p.__private__.getStyle=p.getStyle=function(H){var ce=h;switch(H){case"D":case"S":ce="S";break;case"F":ce="f";break;case"FD":case"DF":ce="B";break;case"f":case"f*":case"B":case"B*":ce=H}return ce},Mn=p.close=function(){return ge("h"),this};p.stroke=function(){return ge("S"),this},p.fill=function(H){return xo("f",H),this},p.fillEvenOdd=function(H){return xo("f*",H),this},p.fillStroke=function(H){return xo("B",H),this},p.fillStrokeEvenOdd=function(H){return xo("B*",H),this};var xo=function(H,ce){Nr(ce)==="object"?Ac(ce,H):ge(H)},cs=function(H){H===null||S===A&&H===void 0||(H=cu(H),ge(H))};function cl(H,ce,ke,De,Ge){var at=new od(ce||this.boundingBox,ke||this.xStep,De||this.yStep,this.gState,Ge||this.matrix);at.stream=this.stream;var ct=H+"$$"+this.cloneIndex+++"$$";return Kr(ct,at),at}var Ac=function(H,ce){var ke=Nt[H.key],De=qe[ke];if(De instanceof Zf)ge("q"),ge(Pc(ce)),De.gState&&p.setGState(De.gState),ge(H.matrix.toString()+" cm"),ge("/"+ke+" sh"),ge("Q");else if(De instanceof od){var Ge=new Qt(1,0,0,-1,0,vi());H.matrix&&(Ge=Ge.multiply(H.matrix||Fa),ke=cl.call(De,H.key,H.boundingBox,H.xStep,H.yStep,Ge).id),ge("q"),ge("/Pattern cs"),ge("/"+ke+" scn"),De.gState&&p.setGState(De.gState),ge(ce),ge("Q")}},Pc=function(H){switch(H){case"f":case"F":case"n":return"W n";case"f*":return"W* n";case"B":case"S":return"W S";case"B*":return"W* S"}},fl=p.moveTo=function(H,ce){return ge(M($(H))+" "+M(q(ce))+" m"),this},fs=p.lineTo=function(H,ce){return ge(M($(H))+" "+M(q(ce))+" l"),this},ro=p.curveTo=function(H,ce,ke,De,Ge,at){return ge([M($(H)),M(q(ce)),M($(ke)),M(q(De)),M($(Ge)),M(q(at)),"c"].join(" ")),this};p.__private__.line=p.line=function(H,ce,ke,De,Ge){if(isNaN(H)||isNaN(ce)||isNaN(ke)||isNaN(De)||!us(Ge))throw new Error("Invalid arguments passed to jsPDF.line");return S===E?this.lines([[ke-H,De-ce]],H,ce,[1,1],Ge||"S"):this.lines([[ke-H,De-ce]],H,ce,[1,1]).stroke()},p.__private__.lines=p.lines=function(H,ce,ke,De,Ge,at){var ct,Dt,jt,fn,hn,Hn,Ar,ui,or,mi,_r,Ai;if(typeof H=="number"&&(Ai=ke,ke=ce,ce=H,H=Ai),De=De||[1,1],at=at||!1,isNaN(ce)||isNaN(ke)||!Array.isArray(H)||!Array.isArray(De)||!us(Ge)||typeof at!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(fl(ce,ke),ct=De[0],Dt=De[1],fn=H.length,mi=ce,_r=ke,jt=0;jt<fn;jt++)(hn=H[jt]).length===2?(mi=hn[0]*ct+mi,_r=hn[1]*Dt+_r,fs(mi,_r)):(Hn=hn[0]*ct+mi,Ar=hn[1]*Dt+_r,ui=hn[2]*ct+mi,or=hn[3]*Dt+_r,mi=hn[4]*ct+mi,_r=hn[5]*Dt+_r,ro(Hn,Ar,ui,or,mi,_r));return at&&Mn(),cs(Ge),this},p.path=function(H){for(var ce=0;ce<H.length;ce++){var ke=H[ce],De=ke.c;switch(ke.op){case"m":fl(De[0],De[1]);break;case"l":fs(De[0],De[1]);break;case"c":ro.apply(this,De);break;case"h":Mn()}}return this},p.__private__.rect=p.rect=function(H,ce,ke,De,Ge){if(isNaN(H)||isNaN(ce)||isNaN(ke)||isNaN(De)||!us(Ge))throw new Error("Invalid arguments passed to jsPDF.rect");return S===E&&(De=-De),ge([M($(H)),M(q(ce)),M($(ke)),M($(De)),"re"].join(" ")),cs(Ge),this},p.__private__.triangle=p.triangle=function(H,ce,ke,De,Ge,at,ct){if(isNaN(H)||isNaN(ce)||isNaN(ke)||isNaN(De)||isNaN(Ge)||isNaN(at)||!us(ct))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[ke-H,De-ce],[Ge-ke,at-De],[H-Ge,ce-at]],H,ce,[1,1],ct,!0),this},p.__private__.roundedRect=p.roundedRect=function(H,ce,ke,De,Ge,at,ct){if(isNaN(H)||isNaN(ce)||isNaN(ke)||isNaN(De)||isNaN(Ge)||isNaN(at)||!us(ct))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var Dt=4/3*(Math.SQRT2-1);return Ge=Math.min(Ge,.5*ke),at=Math.min(at,.5*De),this.lines([[ke-2*Ge,0],[Ge*Dt,0,Ge,at-at*Dt,Ge,at],[0,De-2*at],[0,at*Dt,-Ge*Dt,at,-Ge,at],[2*Ge-ke,0],[-Ge*Dt,0,-Ge,-at*Dt,-Ge,-at],[0,2*at-De],[0,-at*Dt,Ge*Dt,-at,Ge,-at]],H+Ge,ce,[1,1],ct,!0),this},p.__private__.ellipse=p.ellipse=function(H,ce,ke,De,Ge){if(isNaN(H)||isNaN(ce)||isNaN(ke)||isNaN(De)||!us(Ge))throw new Error("Invalid arguments passed to jsPDF.ellipse");var at=4/3*(Math.SQRT2-1)*ke,ct=4/3*(Math.SQRT2-1)*De;return fl(H+ke,ce),ro(H+ke,ce-ct,H+at,ce-De,H,ce-De),ro(H-at,ce-De,H-ke,ce-ct,H-ke,ce),ro(H-ke,ce+ct,H-at,ce+De,H,ce+De),ro(H+at,ce+De,H+ke,ce+ct,H+ke,ce),cs(Ge),this},p.__private__.circle=p.circle=function(H,ce,ke,De){if(isNaN(H)||isNaN(ce)||isNaN(ke)||!us(De))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(H,ce,ke,ke,De)},p.setFont=function(H,ce,ke){return ke&&(ce=O(ce,ke)),xt=cr(H,ce,{disableWarning:!1}),this};var Ba=p.__private__.getFont=p.getFont=function(){return It[cr.apply(p,arguments)]};p.__private__.getFontList=p.getFontList=function(){var H,ce,ke={};for(H in Jt)if(Jt.hasOwnProperty(H))for(ce in ke[H]=[],Jt[H])Jt[H].hasOwnProperty(ce)&&ke[H].push(ce);return ke},p.addFont=function(H,ce,ke,De,Ge){var at=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&at.indexOf(arguments[3])!==-1?Ge=arguments[3]:arguments[3]&&at.indexOf(arguments[3])==-1&&(ke=O(ke,De)),as.call(this,H,ce,ke,Ge=Ge||"Identity-H")};var za,qa=t.lineWidth||.200025,Pt=p.__private__.getLineWidth=p.getLineWidth=function(){return qa},hl=p.__private__.setLineWidth=p.setLineWidth=function(H){return qa=H,ge(M($(H))+" w"),this};p.__private__.setLineDash=tn.API.setLineDash=tn.API.setLineDashPattern=function(H,ce){if(H=H||[],ce=ce||0,isNaN(ce)||!Array.isArray(H))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return H=H.map(function(ke){return M($(ke))}).join(" "),ce=M($(ce)),ge("["+H+"] "+ce+" d"),this};var So=p.__private__.getLineHeight=p.getLineHeight=function(){return fe*za};p.__private__.getLineHeight=p.getLineHeight=function(){return fe*za};var Oc=p.__private__.setLineHeightFactor=p.setLineHeightFactor=function(H){return typeof(H=H||1.15)=="number"&&(za=H),this},Cc=p.__private__.getLineHeightFactor=p.getLineHeightFactor=function(){return za};Oc(t.lineHeight);var io=p.__private__.getHorizontalCoordinate=function(H){return $(H)},wr=p.__private__.getVerticalCoordinate=function(H){return S===A?H:en[U].mediaBox.topRightY-en[U].mediaBox.bottomLeftY-$(H)},fu=p.__private__.getHorizontalCoordinateString=p.getHorizontalCoordinateString=function(H){return M(io(H))},hu=p.__private__.getVerticalCoordinateString=p.getVerticalCoordinateString=function(H){return M(wr(H))},zs=t.strokeColor||"0 G";p.__private__.getStrokeColor=p.getDrawColor=function(){return eo(zs)},p.__private__.setStrokeColor=p.setDrawColor=function(H,ce,ke,De){return zs=si({ch1:H,ch2:ce,ch3:ke,ch4:De,pdfColorType:"draw",precision:2}),ge(zs),this};var Yu=t.fillColor||"0 g";p.__private__.getFillColor=p.getFillColor=function(){return eo(Yu)},p.__private__.setFillColor=p.setFillColor=function(H,ce,ke,De){return Yu=si({ch1:H,ch2:ce,ch3:ke,ch4:De,pdfColorType:"fill",precision:2}),ge(Yu),this};var Ua=t.textColor||"0 g",ki=p.__private__.getTextColor=p.getTextColor=function(){return eo(Ua)};p.__private__.setTextColor=p.setTextColor=function(H,ce,ke,De){return Ua=si({ch1:H,ch2:ce,ch3:ke,ch4:De,pdfColorType:"text",precision:3}),this};var Go=t.charSpace,du=p.__private__.getCharSpace=p.getCharSpace=function(){return parseFloat(Go||0)};p.__private__.setCharSpace=p.setCharSpace=function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return Go=H,this};var Ca=0;p.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},p.__private__.setLineCap=p.setLineCap=function(H){var ce=p.CapJoinStyles[H];if(ce===void 0)throw new Error("Line cap style of '"+H+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Ca=ce,ge(ce+" J"),this};var ao=0;p.__private__.setLineJoin=p.setLineJoin=function(H){var ce=p.CapJoinStyles[H];if(ce===void 0)throw new Error("Line join style of '"+H+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return ao=ce,ge(ce+" j"),this},p.__private__.setLineMiterLimit=p.__private__.setMiterLimit=p.setLineMiterLimit=p.setMiterLimit=function(H){if(H=H||0,isNaN(H))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return ge(M($(H))+" M"),this},p.GState=P0,p.setGState=function(H){(H=typeof H=="string"?Ct[an[H]]:Eo(null,H)).equals(Ut)||(ge("/"+H.id+" gs"),Ut=H)};var Eo=function(H,ce){if(!H||!an[H]){var ke=!1;for(var De in Ct)if(Ct.hasOwnProperty(De)&&Ct[De].equals(ce)){ke=!0;break}if(ke)ce=Ct[De];else{var Ge="GS"+(Object.keys(Ct).length+1).toString(10);Ct[Ge]=ce,ce.id=Ge}return H&&(an[H]=ce.id),gn.publish("addGState",ce),ce}};p.addGState=function(H,ce){return Eo(H,ce),this},p.saveGraphicsState=function(){return ge("q"),Ve.push({key:xt,size:fe,color:Ua}),this},p.restoreGraphicsState=function(){ge("Q");var H=Ve.pop();return xt=H.key,fe=H.size,Ua=H.color,Ut=null,this},p.setCurrentTransformationMatrix=function(H){return ge(H.toString()+" cm"),this},p.comment=function(H){return ge("#"+H),this};var ko=function(H,ce){var ke=H||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return ke},set:function(at){isNaN(at)||(ke=parseFloat(at))}});var De=ce||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return De},set:function(at){isNaN(at)||(De=parseFloat(at))}});var Ge="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return Ge},set:function(at){Ge=at.toString()}}),this},dl=function(H,ce,ke,De){ko.call(this,H,ce),this.type="rect";var Ge=ke||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return Ge},set:function(ct){isNaN(ct)||(Ge=parseFloat(ct))}});var at=De||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return at},set:function(ct){isNaN(ct)||(at=parseFloat(ct))}}),this},Rl=function(){this.page=Sn,this.currentPage=U,this.pages=Re.slice(0),this.pagesContext=en.slice(0),this.x=kt,this.y=qn,this.matrix=xn,this.width=Ao(U),this.height=La(U),this.outputDestination=Me,this.id="",this.objectNumber=-1};Rl.prototype.restore=function(){Sn=this.page,U=this.currentPage,en=this.pagesContext,Re=this.pages,kt=this.x,qn=this.y,xn=this.matrix,pl(U,this.width),Br(U,this.height),Me=this.outputDestination};var li=function(H,ce,ke,De,Ge){Sr.push(new Rl),Sn=U=0,Re=[],kt=H,qn=ce,xn=Ge,os([ke,De])};for(var Ha in p.beginFormObject=function(H,ce,ke,De,Ge){return li(H,ce,ke,De,Ge),this},p.endFormObject=function(H){return(function(ce){if(Ei[ce])Sr.pop().restore();else{var ke=new Rl,De="Xo"+(Object.keys(oi).length+1).toString(10);ke.id=De,Ei[ce]=De,oi[De]=ke,gn.publish("addFormObject",ke),Sr.pop().restore()}})(H),this},p.doFormObject=function(H,ce){var ke=oi[Ei[H]];return ge("q"),ge(ce.toString()+" cm"),ge("/"+ke.id+" Do"),ge("Q"),this},p.getFormObject=function(H){var ce=oi[Ei[H]];return{x:ce.x,y:ce.y,width:ce.width,height:ce.height,matrix:ce.matrix}},p.save=function(H,ce){return H=H||"generated.pdf",(ce=ce||{}).returnPromise=ce.returnPromise||!1,ce.returnPromise===!1?(Kf(Mr(Ki()),H),typeof Kf.unload=="function"&&bn.setTimeout&&setTimeout(Kf.unload,911),this):new Promise(function(ke,De){try{var Ge=Kf(Mr(Ki()),H);typeof Kf.unload=="function"&&bn.setTimeout&&setTimeout(Kf.unload,911),ke(Ge)}catch(at){De(at.message)}})},tn.API)tn.API.hasOwnProperty(Ha)&&(Ha==="events"&&tn.API.events.length?(function(H,ce){var ke,De,Ge;for(Ge=ce.length-1;Ge!==-1;Ge--)ke=ce[Ge][0],De=ce[Ge][1],H.subscribe.apply(H,[ke].concat(typeof De=="function"?[De]:De))})(gn,tn.API.events):p[Ha]=tn.API[Ha]);function Ao(H){return en[H].mediaBox.topRightX-en[H].mediaBox.bottomLeftX}function pl(H,ce){en[H].mediaBox.topRightX=ce+en[H].mediaBox.bottomLeftX}function La(H){return en[H].mediaBox.topRightY-en[H].mediaBox.bottomLeftY}function Br(H,ce){en[H].mediaBox.topRightY=ce+en[H].mediaBox.bottomLeftY}var fa=p.getPageWidth=function(H){return Ao(H=H||U)/bt},Qr=p.setPageWidth=function(H,ce){pl(H,ce*bt)},vi=p.getPageHeight=function(H){return La(H=H||U)/bt},$a=p.setPageHeight=function(H,ce){Br(H,ce*bt)};return p.internal={pdfEscape:Pa,getStyle:cu,getFont:Ba,getFontSize:Ne,getCharSpace:du,getTextColor:ki,getLineHeight:So,getLineHeightFactor:Cc,getLineWidth:Pt,write:Te,getHorizontalCoordinate:io,getVerticalCoordinate:wr,getCoordinateString:fu,getVerticalCoordinateString:hu,collections:{},newObject:Un,newAdditionalObject:Sa,newObjectDeferred:Er,newObjectDeferredBegin:Rr,getFilters:ka,putStream:Aa,events:gn,scaleFactor:bt,pageSize:{getWidth:function(){return fa(U)},setWidth:function(H){Qr(U,H)},getHeight:function(){return vi(U)},setHeight:function(H){$a(U,H)}},encryptionOptions:f,encryption:Zr,getEncryptor:function(H){return f!==null?Zr.encryptor(H,0):function(ce){return ce}},output:Zi,getNumberOfPages:gi,pages:Re,out:ge,f2:T,f3:L,getPageInfo:ls,getPageInfoByObjId:Vu,getCurrentPageInfo:Oa,getPDFVersion:_,Point:ko,Rectangle:dl,Matrix:Qt,hasHotfix:ul},Object.defineProperty(p.internal.pageSize,"width",{get:function(){return fa(U)},set:function(H){Qr(U,H)},enumerable:!0,configurable:!0}),Object.defineProperty(p.internal.pageSize,"height",{get:function(){return vi(U)},set:function(H){$a(U,H)},enumerable:!0,configurable:!0}),(function(H){for(var ce=0,ke=Ce.length;ce<ke;ce++){var De=as.call(this,H[ce][0],H[ce][1],H[ce][2],Ce[ce][3],!0);g===!1&&(v[De]=!0);var Ge=H[ce][0].split("-");uu({id:De,fontName:Ge[0],fontStyle:Ge[1]||""})}gn.publish("addFonts",{fonts:It,dictionary:Jt})}).call(p,Ce),xt="F1",kc(i,n),gn.publish("initialized"),p}Jh.prototype.lsbFirstWord=function(t){return String.fromCharCode(255&t,t>>8&255,t>>16&255,t>>24&255)},Jh.prototype.toHexString=function(t){return t.split("").map(function(e){return("0"+(255&e.charCodeAt(0)).toString(16)).slice(-2)}).join("")},Jh.prototype.hexToBytes=function(t){for(var e=[],n=0;n<t.length;n+=2)e.push(String.fromCharCode(parseInt(t.substr(n,2),16)));return e.join("")},Jh.prototype.processOwnerPassword=function(t,e){return Rm(Tm(e).substr(0,5),t)},Jh.prototype.encryptor=function(t,e){var n=Tm(this.encryptionKey+String.fromCharCode(255&t,t>>8&255,t>>16&255,255&e,e>>8&255)).substr(0,10);return function(r){return Rm(n,r)}},P0.prototype.equals=function(t){var e,n="id,objectNumber,equals";if(!t||Nr(t)!==Nr(this))return!1;var r=0;for(e in this)if(!(n.indexOf(e)>=0)){if(this.hasOwnProperty(e)&&!t.hasOwnProperty(e)||this[e]!==t[e])return!1;r++}for(e in t)t.hasOwnProperty(e)&&n.indexOf(e)<0&&r--;return r===0},tn.API={events:[]},tn.version="3.0.3";var Vi=tn.API,ky=1,Ph=function(t){return t.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Xh=function(t){return t.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},Pn=function(t){return t.toFixed(2)},of=function(t){return t.toFixed(5)};Vi.__acroform__={};var Fs=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t},Nw=function(t){return t*ky},Lu=function(t){var e=new ax,n=Yt.internal.getHeight(t)||0,r=Yt.internal.getWidth(t)||0;return e.BBox=[0,0,Number(Pn(r)),Number(Pn(n))],e},DI=Vi.__acroform__.setBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return t|1<<e},FI=Vi.__acroform__.clearBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return t&~(1<<e)},BI=Vi.__acroform__.getBit=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return t&1<<e?1:0},sa=Vi.__acroform__.getBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return BI(t,e-1)},la=Vi.__acroform__.setBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return DI(t,e-1)},ua=Vi.__acroform__.clearBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return FI(t,e-1)},zI=Vi.__acroform__.calculateCoordinates=function(t,e){var n=e.internal.getHorizontalCoordinate,r=e.internal.getVerticalCoordinate,i=t[0],a=t[1],o=t[2],s=t[3],u={};return u.lowerLeft_X=n(i)||0,u.lowerLeft_Y=r(a+s)||0,u.upperRight_X=n(i+o)||0,u.upperRight_Y=r(a)||0,[Number(Pn(u.lowerLeft_X)),Number(Pn(u.lowerLeft_Y)),Number(Pn(u.upperRight_X)),Number(Pn(u.upperRight_Y))]},qI=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var e=[],n=t._V||t.DV,r=Mm(t,n),i=t.scope.internal.getFont(t.fontName,t.fontStyle).id;e.push("/Tx BMC"),e.push("q"),e.push("BT"),e.push(t.scope.__private__.encodeColorString(t.color)),e.push("/"+i+" "+Pn(r.fontSize)+" Tf"),e.push("1 0 0 1 0 0 Tm"),e.push(r.text),e.push("ET"),e.push("Q"),e.push("EMC");var a=Lu(t);return a.scope=t.scope,a.stream=e.join(`
511
+ `),a}},Mm=function(t,e){var n=t.fontSize===0?t.maxFontSize:t.fontSize,r={text:"",fontSize:""},i=(e=(e=e.substr(0,1)=="("?e.substr(1):e).substr(e.length-1)==")"?e.substr(0,e.length-1):e).split(" ");i=t.multiline?i.map(function(T){return T.split(`
512
+ `)}):i.map(function(T){return[T]});var a=n,o=Yt.internal.getHeight(t)||0;o=o<0?-o:o;var s=Yt.internal.getWidth(t)||0;s=s<0?-s:s;var u=function(T,L,$){if(T+1<i.length){var q=L+" "+i[T+1][0];return q1(q,t,$).width<=s-4}return!1};a++;e:for(;a>0;){e="",a--;var h,f,g=q1("3",t,a).height,v=t.multiline?o-a:(o-g)/2,p=v+=2,y=0,_=0,x=0;if(a<=0){e=`(...) Tj
513
+ `,e+="% Width of Text: "+q1(e,t,a=12).width+", FieldWidth:"+s+`
514
+ `;break}for(var b="",E=0,A=0;A<i.length;A++)if(i.hasOwnProperty(A)){var S=!1;if(i[A].length!==1&&x!==i[A].length-1){if((g+2)*(E+2)+2>o)continue e;b+=i[A][x],S=!0,_=A,A--}else{b=(b+=i[A][x]+" ").substr(b.length-1)==" "?b.substr(0,b.length-1):b;var k=parseInt(A),I=u(k,b,a),O=A>=i.length-1;if(I&&!O){b+=" ",x=0;continue}if(I||O){if(O)_=k;else if(t.multiline&&(g+2)*(E+2)+2>o)continue e}else{if(!t.multiline||(g+2)*(E+2)+2>o)continue e;_=k}}for(var M="",F=y;F<=_;F++){var j=i[F];if(t.multiline){if(F===_){M+=j[x]+" ",x=(x+1)%j.length;continue}if(F===y){M+=j[j.length-1]+" ";continue}}M+=j[0]+" "}switch(M=M.substr(M.length-1)==" "?M.substr(0,M.length-1):M,f=q1(M,t,a).width,t.textAlign){case"right":h=s-f-2;break;case"center":h=(s-f)/2;break;default:h=2}e+=Pn(h)+" "+Pn(p)+` Td
515
+ `,e+="("+Ph(M)+`) Tj
516
+ `,e+=-Pn(h)+` 0 Td
517
+ `,p=-(a+2),f=0,y=S?_:_+1,E++,b=""}break}return r.text=e,r.fontSize=a,r},q1=function(t,e,n){var r=e.scope.internal.getFont(e.fontName,e.fontStyle),i=e.scope.getStringUnitWidth(t,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:e.scope.getStringUnitWidth("3",{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:i}},UI={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},HI=function(t,e){var n={type:"reference",object:t};e.internal.getPageInfo(t.page).pageContext.annotations.find(function(r){return r.type===n.type&&r.object===n.object})===void 0&&e.internal.getPageInfo(t.page).pageContext.annotations.push(n)},$I=function(t,e){if(e.scope=t,t.internal!==void 0&&(t.internal.acroformPlugin===void 0||t.internal.acroformPlugin.isInitialized===!1)){if(ou.FieldNum=0,t.internal.acroformPlugin=JSON.parse(JSON.stringify(UI)),t.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");ky=t.internal.scaleFactor,t.internal.acroformPlugin.acroFormDictionaryRoot=new ox,t.internal.acroformPlugin.acroFormDictionaryRoot.scope=t,t.internal.acroformPlugin.acroFormDictionaryRoot._eventID=t.internal.events.subscribe("postPutResources",function(){(function(n){n.internal.events.unsubscribe(n.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete n.internal.acroformPlugin.acroFormDictionaryRoot._eventID,n.internal.acroformPlugin.printedOut=!0})(t)}),t.internal.events.subscribe("buildDocument",function(){(function(n){n.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var r=n.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var i in r)if(r.hasOwnProperty(i)){var a=r[i];a.objId=void 0,a.hasAnnotation&&HI(a,n)}})(t)}),t.internal.events.subscribe("putCatalog",function(){(function(n){if(n.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw new Error("putCatalogCallback: Root missing.");n.internal.write("/AcroForm "+n.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")})(t)}),t.internal.events.subscribe("postPutPages",function(n){(function(r,i){var a=!r;for(var o in r||(i.internal.newObjectDeferredBegin(i.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),i.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),r=r||i.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(r.hasOwnProperty(o)){var s=r[o],u=[],h=s.Rect;if(s.Rect&&(s.Rect=zI(s.Rect,i)),i.internal.newObjectDeferredBegin(s.objId,!0),s.DA=Yt.createDefaultAppearanceStream(s),Nr(s)==="object"&&typeof s.getKeyValueListForStream=="function"&&(u=s.getKeyValueListForStream()),s.Rect=h,s.hasAppearanceStream&&!s.appearanceStreamContent){var f=qI(s);u.push({key:"AP",value:"<</N "+f+">>"}),i.internal.acroformPlugin.xForms.push(f)}if(s.appearanceStreamContent){var g="";for(var v in s.appearanceStreamContent)if(s.appearanceStreamContent.hasOwnProperty(v)){var p=s.appearanceStreamContent[v];if(g+="/"+v+" ",g+="<<",Object.keys(p).length>=1||Array.isArray(p)){for(var o in p)if(p.hasOwnProperty(o)){var y=p[o];typeof y=="function"&&(y=y.call(i,s)),g+="/"+o+" "+y+" ",i.internal.acroformPlugin.xForms.indexOf(y)>=0||i.internal.acroformPlugin.xForms.push(y)}}else typeof(y=p)=="function"&&(y=y.call(i,s)),g+="/"+o+" "+y,i.internal.acroformPlugin.xForms.indexOf(y)>=0||i.internal.acroformPlugin.xForms.push(y);g+=">>"}u.push({key:"AP",value:`<<
518
+ `+g+">>"})}i.internal.putStream({additionalKeyValues:u,objectId:s.objId}),i.internal.out("endobj")}a&&(function(_,x){for(var b in _)if(_.hasOwnProperty(b)){var E=b,A=_[b];x.internal.newObjectDeferredBegin(A.objId,!0),Nr(A)==="object"&&typeof A.putStream=="function"&&A.putStream(),delete _[E]}})(i.internal.acroformPlugin.xForms,i)})(n,t)}),t.internal.acroformPlugin.isInitialized=!0}},ix=Vi.__acroform__.arrayToPdfArray=function(t,e,n){var r=function(o){return o};if(Array.isArray(t)){for(var i="[",a=0;a<t.length;a++)switch(a!==0&&(i+=" "),Nr(t[a])){case"boolean":case"number":case"object":i+=t[a].toString();break;case"string":t[a].substr(0,1)!=="/"?(e!==void 0&&n&&(r=n.internal.getEncryptor(e)),i+="("+Ph(r(t[a].toString()))+")"):i+=t[a].toString()}return i+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},Bv=function(t,e,n){var r=function(i){return i};return e!==void 0&&n&&(r=n.internal.getEncryptor(e)),(t=t||"").toString(),"("+Ph(r(t))+")"},Mu=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(this._objId===void 0){if(this.scope===void 0)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(t){this._objId=t}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};Mu.prototype.toString=function(){return this.objId+" 0 R"},Mu.prototype.putStream=function(){var t=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:t,objectId:this.objId}),this.scope.internal.out("endobj")},Mu.prototype.getKeyValueListForStream=function(){var t=[],e=Object.getOwnPropertyNames(this).filter(function(a){return a!="content"&&a!="appearanceStreamContent"&&a!="scope"&&a!="objId"&&a.substring(0,1)!="_"});for(var n in e)if(Object.getOwnPropertyDescriptor(this,e[n]).configurable===!1){var r=e[n],i=this[r];i&&(Array.isArray(i)?t.push({key:r,value:ix(i,this.objId,this.scope)}):i instanceof Mu?(i.scope=this.scope,t.push({key:r,value:i.objId+" 0 R"})):typeof i!="function"&&t.push({key:r,value:i}))}return t};var ax=function(){Mu.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var t,e=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return e},set:function(n){e=n}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(n){t=n.trim()},get:function(){return t||null}})};Fs(ax,Mu);var ox=function(){Mu.call(this);var t,e=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return e.length>0?e:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return e}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(t){var n=function(r){return r};return this.scope&&(n=this.scope.internal.getEncryptor(this.objId)),"("+Ph(n(t))+")"}},set:function(n){t=n}})};Fs(ox,Mu);var ou=function t(){Mu.call(this);var e=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return e},set:function(b){if(isNaN(b))throw new Error('Invalid value "'+b+'" for attribute F supplied.');e=b}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!sa(e,3)},set:function(b){b?this.F=la(e,3):this.F=ua(e,3)}});var n=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return n},set:function(b){if(isNaN(b))throw new Error('Invalid value "'+b+'" for attribute Ff supplied.');n=b}});var r=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(r.length!==0)return r},set:function(b){r=b!==void 0?b:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[0])?0:r[0]},set:function(b){r[0]=b}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[1])?0:r[1]},set:function(b){r[1]=b}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[2])?0:r[2]},set:function(b){r[2]=b}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[3])?0:r[3]},set:function(b){r[3]=b}});var i="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return i},set:function(b){switch(b){case"/Btn":case"/Tx":case"/Ch":case"/Sig":i=b;break;default:throw new Error('Invalid value "'+b+'" for attribute FT supplied.')}}});var a=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!a||a.length<1){if(this instanceof O0)return;a="FieldObject"+t.FieldNum++}var b=function(E){return E};return this.scope&&(b=this.scope.internal.getEncryptor(this.objId)),"("+Ph(b(a))+")"},set:function(b){a=b.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return a},set:function(b){a=b}});var o="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return o},set:function(b){o=b}});var s="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return s},set:function(b){s=b}});var u=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return u},set:function(b){u=b}});var h=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return h===void 0?50/ky:h},set:function(b){h=b}});var f="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return f},set:function(b){f=b}});var g="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!g||this instanceof O0||this instanceof ah))return Bv(g,this.objId,this.scope)},set:function(b){b=b.toString(),g=b}});var v=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(v)return this instanceof Ja==0?Bv(v,this.objId,this.scope):v},set:function(b){b=b.toString(),v=this instanceof Ja==0?b.substr(0,1)==="("?Xh(b.substr(1,b.length-2)):Xh(b):b}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof Ja==1?Xh(v.substr(1,v.length-1)):v},set:function(b){b=b.toString(),v=this instanceof Ja==1?"/"+b:b}});var p=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(p)return p},set:function(b){this.V=b}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(p)return this instanceof Ja==0?Bv(p,this.objId,this.scope):p},set:function(b){b=b.toString(),p=this instanceof Ja==0?b.substr(0,1)==="("?Xh(b.substr(1,b.length-2)):Xh(b):b}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof Ja==1?Xh(p.substr(1,p.length-1)):p},set:function(b){b=b.toString(),p=this instanceof Ja==1?"/"+b:b}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var y,_=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return _},set:function(b){b=!!b,_=b}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(y)return y},set:function(b){y=b}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,1)},set:function(b){b?this.Ff=la(this.Ff,1):this.Ff=ua(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,2)},set:function(b){b?this.Ff=la(this.Ff,2):this.Ff=ua(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,3)},set:function(b){b?this.Ff=la(this.Ff,3):this.Ff=ua(this.Ff,3)}});var x=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(x!==null)return x},set:function(b){if([0,1,2].indexOf(b)===-1)throw new Error('Invalid value "'+b+'" for attribute Q supplied.');x=b}}),Object.defineProperty(this,"textAlign",{get:function(){var b;switch(x){case 0:default:b="left";break;case 1:b="center";break;case 2:b="right"}return b},configurable:!0,enumerable:!0,set:function(b){switch(b){case"right":case 2:x=2;break;case"center":case 1:x=1;break;default:x=0}}})};Fs(ou,Mu);var sd=function(){ou.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var t=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return t},set:function(n){t=n}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return t},set:function(n){t=n}});var e=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return ix(e,this.objId,this.scope)},set:function(n){var r,i;i=[],typeof(r=n)=="string"&&(i=(function(a,o,s){s||(s=1);for(var u,h=[];u=o.exec(a);)h.push(u[s]);return h})(r,/\((.*?)\)/g)),e=i}}),this.getOptions=function(){return e},this.setOptions=function(n){e=n,this.sort&&e.sort()},this.addOption=function(n){n=(n=n||"").toString(),e.push(n),this.sort&&e.sort()},this.removeOption=function(n,r){for(r=r||!1,n=(n=n||"").toString();e.indexOf(n)!==-1&&(e.splice(e.indexOf(n),1),r!==!1););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,18)},set:function(n){n?this.Ff=la(this.Ff,18):this.Ff=ua(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,19)},set:function(n){this.combo===!0&&(n?this.Ff=la(this.Ff,19):this.Ff=ua(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,20)},set:function(n){n?(this.Ff=la(this.Ff,20),e.sort()):this.Ff=ua(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,22)},set:function(n){n?this.Ff=la(this.Ff,22):this.Ff=ua(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,23)},set:function(n){n?this.Ff=la(this.Ff,23):this.Ff=ua(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,27)},set:function(n){n?this.Ff=la(this.Ff,27):this.Ff=ua(this.Ff,27)}}),this.hasAppearanceStream=!1};Fs(sd,ou);var ld=function(){sd.call(this),this.fontName="helvetica",this.combo=!1};Fs(ld,sd);var ud=function(){ld.call(this),this.combo=!0};Fs(ud,ld);var t0=function(){ud.call(this),this.edit=!0};Fs(t0,ud);var Ja=function(){ou.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,15)},set:function(n){n?this.Ff=la(this.Ff,15):this.Ff=ua(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,16)},set:function(n){n?this.Ff=la(this.Ff,16):this.Ff=ua(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,17)},set:function(n){n?this.Ff=la(this.Ff,17):this.Ff=ua(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,26)},set:function(n){n?this.Ff=la(this.Ff,26):this.Ff=ua(this.Ff,26)}});var t,e={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var n=function(a){return a};if(this.scope&&(n=this.scope.internal.getEncryptor(this.objId)),Object.keys(e).length!==0){var r,i=[];for(r in i.push("<<"),e)i.push("/"+r+" ("+Ph(n(e[r]))+")");return i.push(">>"),i.join(`
519
+ `)}},set:function(n){Nr(n)==="object"&&(e=n)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return e.CA||""},set:function(n){typeof n=="string"&&(e.CA=n)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(n){t=n}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(n){t="/"+n}})};Fs(Ja,ou);var n0=function(){Ja.call(this),this.pushButton=!0};Fs(n0,Ja);var cd=function(){Ja.call(this),this.radio=!0,this.pushButton=!1;var t=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e!==void 0?e:[]}})};Fs(cd,Ja);var O0=function(){var t,e;ou.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return t},set:function(i){t=i}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return e},set:function(i){e=i}});var n,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var i=function(s){return s};this.scope&&(i=this.scope.internal.getEncryptor(this.objId));var a,o=[];for(a in o.push("<<"),r)o.push("/"+a+" ("+Ph(i(r[a]))+")");return o.push(">>"),o.join(`
520
+ `)},set:function(i){Nr(i)==="object"&&(r=i)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||""},set:function(i){typeof i=="string"&&(r.CA=i)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(i){n=i}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(i){n="/"+i}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=Yt.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};Fs(O0,ou),cd.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t)||!("getCA"in t))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var n=this.Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n.optionName),n.caption=t.getCA()}},cd.prototype.createOption=function(t){var e=new O0;return e.Parent=this,e.optionName=t,this.Kids.push(e),GI.call(this.scope,e),e};var r0=function(){Ja.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=Yt.CheckBox.createAppearanceStream()};Fs(r0,Ja);var ah=function(){ou.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,13)},set:function(e){e?this.Ff=la(this.Ff,13):this.Ff=ua(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,21)},set:function(e){e?this.Ff=la(this.Ff,21):this.Ff=ua(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,23)},set:function(e){e?this.Ff=la(this.Ff,23):this.Ff=ua(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,24)},set:function(e){e?this.Ff=la(this.Ff,24):this.Ff=ua(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,25)},set:function(e){e?this.Ff=la(this.Ff,25):this.Ff=ua(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,26)},set:function(e){e?this.Ff=la(this.Ff,26):this.Ff=ua(this.Ff,26)}});var t=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return t},set:function(e){Number.isInteger(e)&&(t=e)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};Fs(ah,ou);var i0=function(){ah.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,14)},set:function(t){t?this.Ff=la(this.Ff,14):this.Ff=ua(this.Ff,14)}}),this.password=!0};Fs(i0,ah);var Yt={CheckBox:{createAppearanceStream:function(){return{N:{On:Yt.CheckBox.YesNormal},D:{On:Yt.CheckBox.YesPushDown,Off:Yt.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=Lu(t);e.scope=t.scope;var n=[],r=t.scope.internal.getFont(t.fontName,t.fontStyle).id,i=t.scope.__private__.encodeColorString(t.color),a=Mm(t,t.caption);return n.push("0.749023 g"),n.push("0 0 "+Pn(Yt.internal.getWidth(t))+" "+Pn(Yt.internal.getHeight(t))+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+r+" "+Pn(a.fontSize)+" Tf "+i),n.push("BT"),n.push(a.text),n.push("ET"),n.push("Q"),n.push("EMC"),e.stream=n.join(`
521
+ `),e},YesNormal:function(t){var e=Lu(t);e.scope=t.scope;var n=t.scope.internal.getFont(t.fontName,t.fontStyle).id,r=t.scope.__private__.encodeColorString(t.color),i=[],a=Yt.internal.getHeight(t),o=Yt.internal.getWidth(t),s=Mm(t,t.caption);return i.push("1 g"),i.push("0 0 "+Pn(o)+" "+Pn(a)+" re"),i.push("f"),i.push("q"),i.push("0 0 1 rg"),i.push("0 0 "+Pn(o-1)+" "+Pn(a-1)+" re"),i.push("W"),i.push("n"),i.push("0 g"),i.push("BT"),i.push("/"+n+" "+Pn(s.fontSize)+" Tf "+r),i.push(s.text),i.push("ET"),i.push("Q"),e.stream=i.join(`
522
+ `),e},OffPushDown:function(t){var e=Lu(t);e.scope=t.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+Pn(Yt.internal.getWidth(t))+" "+Pn(Yt.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join(`
523
+ `),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:Yt.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=Yt.RadioButton.Circle.YesNormal,e.D[t]=Yt.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(t){var e=Lu(t);e.scope=t.scope;var n=[],r=Yt.internal.getWidth(t)<=Yt.internal.getHeight(t)?Yt.internal.getWidth(t)/4:Yt.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var i=Yt.internal.Bezier_C,a=Number((r*i).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+of(Yt.internal.getWidth(t)/2)+" "+of(Yt.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+a+" "+a+" "+r+" 0 "+r+" c"),n.push("-"+a+" "+r+" -"+r+" "+a+" -"+r+" 0 c"),n.push("-"+r+" -"+a+" -"+a+" -"+r+" 0 -"+r+" c"),n.push(a+" -"+r+" "+r+" -"+a+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join(`
524
+ `),e},YesPushDown:function(t){var e=Lu(t);e.scope=t.scope;var n=[],r=Yt.internal.getWidth(t)<=Yt.internal.getHeight(t)?Yt.internal.getWidth(t)/4:Yt.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),a=Number((i*Yt.internal.Bezier_C).toFixed(5)),o=Number((r*Yt.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+of(Yt.internal.getWidth(t)/2)+" "+of(Yt.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+a+" "+a+" "+i+" 0 "+i+" c"),n.push("-"+a+" "+i+" -"+i+" "+a+" -"+i+" 0 c"),n.push("-"+i+" -"+a+" -"+a+" -"+i+" 0 -"+i+" c"),n.push(a+" -"+i+" "+i+" -"+a+" "+i+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+of(Yt.internal.getWidth(t)/2)+" "+of(Yt.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),n.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),n.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),n.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join(`
525
+ `),e},OffPushDown:function(t){var e=Lu(t);e.scope=t.scope;var n=[],r=Yt.internal.getWidth(t)<=Yt.internal.getHeight(t)?Yt.internal.getWidth(t)/4:Yt.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),a=Number((i*Yt.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+of(Yt.internal.getWidth(t)/2)+" "+of(Yt.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+a+" "+a+" "+i+" 0 "+i+" c"),n.push("-"+a+" "+i+" -"+i+" "+a+" -"+i+" 0 c"),n.push("-"+i+" -"+a+" -"+a+" -"+i+" 0 -"+i+" c"),n.push(a+" -"+i+" "+i+" -"+a+" "+i+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join(`
526
+ `),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:Yt.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=Yt.RadioButton.Cross.YesNormal,e.D[t]=Yt.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(t){var e=Lu(t);e.scope=t.scope;var n=[],r=Yt.internal.calculateCross(t);return n.push("q"),n.push("1 1 "+Pn(Yt.internal.getWidth(t)-2)+" "+Pn(Yt.internal.getHeight(t)-2)+" re"),n.push("W"),n.push("n"),n.push(Pn(r.x1.x)+" "+Pn(r.x1.y)+" m"),n.push(Pn(r.x2.x)+" "+Pn(r.x2.y)+" l"),n.push(Pn(r.x4.x)+" "+Pn(r.x4.y)+" m"),n.push(Pn(r.x3.x)+" "+Pn(r.x3.y)+" l"),n.push("s"),n.push("Q"),e.stream=n.join(`
527
+ `),e},YesPushDown:function(t){var e=Lu(t);e.scope=t.scope;var n=Yt.internal.calculateCross(t),r=[];return r.push("0.749023 g"),r.push("0 0 "+Pn(Yt.internal.getWidth(t))+" "+Pn(Yt.internal.getHeight(t))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+Pn(Yt.internal.getWidth(t)-2)+" "+Pn(Yt.internal.getHeight(t)-2)+" re"),r.push("W"),r.push("n"),r.push(Pn(n.x1.x)+" "+Pn(n.x1.y)+" m"),r.push(Pn(n.x2.x)+" "+Pn(n.x2.y)+" l"),r.push(Pn(n.x4.x)+" "+Pn(n.x4.y)+" m"),r.push(Pn(n.x3.x)+" "+Pn(n.x3.y)+" l"),r.push("s"),r.push("Q"),e.stream=r.join(`
528
+ `),e},OffPushDown:function(t){var e=Lu(t);e.scope=t.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+Pn(Yt.internal.getWidth(t))+" "+Pn(Yt.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join(`
529
+ `),e}}},createDefaultAppearanceStream:function(t){var e=t.scope.internal.getFont(t.fontName,t.fontStyle).id,n=t.scope.__private__.encodeColorString(t.color);return"/"+e+" "+t.fontSize+" Tf "+n}};Yt.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=Yt.internal.getWidth(t),n=Yt.internal.getHeight(t),r=Math.min(e,n);return{x1:{x:(e-r)/2,y:(n-r)/2+r},x2:{x:(e-r)/2+r,y:(n-r)/2},x3:{x:(e-r)/2,y:(n-r)/2},x4:{x:(e-r)/2+r,y:(n-r)/2+r}}}},Yt.internal.getWidth=function(t){var e=0;return Nr(t)==="object"&&(e=Nw(t.Rect[2])),e},Yt.internal.getHeight=function(t){var e=0;return Nr(t)==="object"&&(e=Nw(t.Rect[3])),e};var GI=Vi.addField=function(t){if($I(this,t),!(t instanceof ou))throw new Error("Invalid argument passed to jsPDF.addField.");var e;return(e=t).scope.internal.acroformPlugin.printedOut&&(e.scope.internal.acroformPlugin.printedOut=!1,e.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),e.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(e),t.page=t.scope.internal.getCurrentPageInfo().pageNumber,this};Vi.AcroFormChoiceField=sd,Vi.AcroFormListBox=ld,Vi.AcroFormComboBox=ud,Vi.AcroFormEditBox=t0,Vi.AcroFormButton=Ja,Vi.AcroFormPushButton=n0,Vi.AcroFormRadioButton=cd,Vi.AcroFormCheckBox=r0,Vi.AcroFormTextField=ah,Vi.AcroFormPasswordField=i0,Vi.AcroFormAppearance=Yt,Vi.AcroForm={ChoiceField:sd,ListBox:ld,ComboBox:ud,EditBox:t0,Button:Ja,PushButton:n0,RadioButton:cd,CheckBox:r0,TextField:ah,PasswordField:i0,Appearance:Yt},tn.AcroForm={ChoiceField:sd,ListBox:ld,ComboBox:ud,EditBox:t0,Button:Ja,PushButton:n0,RadioButton:cd,CheckBox:r0,TextField:ah,PasswordField:i0,Appearance:Yt};tn.AcroForm;function sx(t){return t.reduce(function(e,n,r){return e[n]=r,e},{})}(function(t){var e="addImage_";t.__addimage__={};var n="UNKNOWN",r={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},i=t.__addimage__.getImageFileTypeByImageData=function(T,L){var $,q,J,ae,ie,Z=n;if((L=L||n)==="RGBA"||T.data!==void 0&&T.data instanceof Uint8ClampedArray&&"height"in T&&"width"in T)return"RGBA";if(I(T))for(ie in r)for(J=r[ie],$=0;$<J.length;$+=1){for(ae=!0,q=0;q<J[$].length;q+=1)if(J[$][q]!==void 0&&J[$][q]!==T[q]){ae=!1;break}if(ae===!0){Z=ie;break}}else for(ie in r)for(J=r[ie],$=0;$<J.length;$+=1){for(ae=!0,q=0;q<J[$].length;q+=1)if(J[$][q]!==void 0&&J[$][q]!==T.charCodeAt(q)){ae=!1;break}if(ae===!0){Z=ie;break}}return Z===n&&L!==n&&(Z=L),Z},a=function T(L){for(var $=this.internal.write,q=this.internal.putStream,J=(0,this.internal.getFilters)();J.indexOf("FlateEncode")!==-1;)J.splice(J.indexOf("FlateEncode"),1);L.objectId=this.internal.newObject();var ae=[];if(ae.push({key:"Type",value:"/XObject"}),ae.push({key:"Subtype",value:"/Image"}),ae.push({key:"Width",value:L.width}),ae.push({key:"Height",value:L.height}),L.colorSpace===b.INDEXED?ae.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(L.palette.length/3-1)+" "+("sMask"in L&&L.sMask!==void 0?L.objectId+2:L.objectId+1)+" 0 R]"}):(ae.push({key:"ColorSpace",value:"/"+L.colorSpace}),L.colorSpace===b.DEVICE_CMYK&&ae.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),ae.push({key:"BitsPerComponent",value:L.bitsPerComponent}),"decodeParameters"in L&&L.decodeParameters!==void 0&&ae.push({key:"DecodeParms",value:"<<"+L.decodeParameters+">>"}),"transparency"in L&&Array.isArray(L.transparency)&&L.transparency.length>0){for(var ie="",Z=0,te=L.transparency.length;Z<te;Z++)ie+=L.transparency[Z]+" "+L.transparency[Z]+" ";ae.push({key:"Mask",value:"["+ie+"]"})}L.sMask!==void 0&&ae.push({key:"SMask",value:L.objectId+1+" 0 R"});var V=L.filter!==void 0?["/"+L.filter]:void 0;if(q({data:L.data,additionalKeyValues:ae,alreadyAppliedFilters:V,objectId:L.objectId}),$("endobj"),"sMask"in L&&L.sMask!==void 0){var B,D=(B=L.sMaskBitsPerComponent)!==null&&B!==void 0?B:L.bitsPerComponent,U={width:L.width,height:L.height,colorSpace:"DeviceGray",bitsPerComponent:D,data:L.sMask};"filter"in L&&(U.decodeParameters="/Predictor ".concat(L.predictor," /Colors 1 /BitsPerComponent ").concat(D," /Columns ").concat(L.width),U.filter=L.filter),T.call(this,U)}if(L.colorSpace===b.INDEXED){var X=this.internal.newObject();q({data:M(new Uint8Array(L.palette)),objectId:X}),$("endobj")}},o=function(){var T=this.internal.collections[e+"images"];for(var L in T)a.call(this,T[L])},s=function(){var T,L=this.internal.collections[e+"images"],$=this.internal.write;for(var q in L)$("/I"+(T=L[q]).index,T.objectId,"0","R")},u=function(){this.internal.collections[e+"images"]||(this.internal.collections[e+"images"]={},this.internal.events.subscribe("putResources",o),this.internal.events.subscribe("putXobjectDict",s))},h=function(){var T=this.internal.collections[e+"images"];return u.call(this),T},f=function(){return Object.keys(this.internal.collections[e+"images"]).length},g=function(T){return typeof t["process"+T.toUpperCase()]=="function"},v=function(T){return Nr(T)==="object"&&T.nodeType===1},p=function(T,L){if(T.nodeName==="IMG"&&T.hasAttribute("src")){var $=""+T.getAttribute("src");if($.indexOf("data:image/")===0)return e0(unescape($).split("base64,").pop());var q=t.loadFile($,!0);if(q!==void 0)return q}if(T.nodeName==="CANVAS"){if(T.width===0||T.height===0)throw new Error("Given canvas must have data. Canvas width: "+T.width+", height: "+T.height);var J;switch(L){case"PNG":J="image/png";break;case"WEBP":J="image/webp";break;default:J="image/jpeg"}return e0(T.toDataURL(J,1).split("base64,").pop())}},y=function(T){var L=this.internal.collections[e+"images"];if(L){for(var $ in L)if(T===L[$].alias)return L[$]}},_=function(T,L,$){return T||L||(T=-96,L=-96),T<0&&(T=-1*$.width*72/T/this.internal.scaleFactor),L<0&&(L=-1*$.height*72/L/this.internal.scaleFactor),T===0&&(T=L*$.width/$.height),L===0&&(L=T*$.height/$.width),[T,L]},x=function(T,L,$,q,J,ae){var ie=_.call(this,$,q,J),Z=this.internal.getCoordinateString,te=this.internal.getVerticalCoordinateString,V=h.call(this);if($=ie[0],q=ie[1],V[J.index]=J,ae){ae*=Math.PI/180;var B=Math.cos(ae),D=Math.sin(ae),U=function(ee){return ee.toFixed(4)},X=[U(B),U(D),U(-1*D),U(B),0,0,"cm"]}this.internal.write("q"),ae?(this.internal.write([1,"0","0",1,Z(T),te(L+q),"cm"].join(" ")),this.internal.write(X.join(" ")),this.internal.write([Z($),"0","0",Z(q),"0","0","cm"].join(" "))):this.internal.write([Z($),"0","0",Z(q),Z(T),te(L+q),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+J.index+" Do"),this.internal.write("Q")},b=t.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};t.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var E=t.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},A=t.__addimage__.sHashCode=function(T){var L,$,q=0;if(typeof T=="string")for($=T.length,L=0;L<$;L++)q=(q<<5)-q+T.charCodeAt(L),q|=0;else if(I(T))for($=T.byteLength/2,L=0;L<$;L++)q=(q<<5)-q+T[L],q|=0;return q},S=t.__addimage__.validateStringAsBase64=function(T){(T=T||"").toString().trim();var L=!0;return T.length===0&&(L=!1),T.length%4!=0&&(L=!1),/^[A-Za-z0-9+/]+$/.test(T.substr(0,T.length-2))===!1&&(L=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(T.substr(-2))===!1&&(L=!1),L},k=t.__addimage__.extractImageFromDataUrl=function(T){if(T==null||!(T=T.trim()).startsWith("data:"))return null;var L=T.indexOf(",");return L<0?null:T.substring(0,L).trim().endsWith("base64")?T.substring(L+1):null};t.__addimage__.isArrayBuffer=function(T){return T instanceof ArrayBuffer};var I=t.__addimage__.isArrayBufferView=function(T){return T instanceof Int8Array||T instanceof Uint8Array||T instanceof Uint8ClampedArray||T instanceof Int16Array||T instanceof Uint16Array||T instanceof Int32Array||T instanceof Uint32Array||T instanceof Float32Array||T instanceof Float64Array},O=t.__addimage__.binaryStringToUint8Array=function(T){for(var L=T.length,$=new Uint8Array(L),q=0;q<L;q++)$[q]=T.charCodeAt(q);return $},M=t.__addimage__.arrayBufferToBinaryString=function(T){for(var L="",$=I(T)?T:new Uint8Array(T),q=0;q<$.length;q+=8192)L+=String.fromCharCode.apply(null,$.subarray(q,q+8192));return L};t.addImage=function(){var T,L,$,q,J,ae,ie,Z,te;if(typeof arguments[1]=="number"?(L=n,$=arguments[1],q=arguments[2],J=arguments[3],ae=arguments[4],ie=arguments[5],Z=arguments[6],te=arguments[7]):(L=arguments[1],$=arguments[2],q=arguments[3],J=arguments[4],ae=arguments[5],ie=arguments[6],Z=arguments[7],te=arguments[8]),Nr(T=arguments[0])==="object"&&!v(T)&&"imageData"in T){var V=T;T=V.imageData,L=V.format||L||n,$=V.x||$||0,q=V.y||q||0,J=V.w||V.width||J,ae=V.h||V.height||ae,ie=V.alias||ie,Z=V.compression||Z,te=V.rotation||V.angle||te}var B=this.internal.getFilters();if(Z===void 0&&B.indexOf("FlateEncode")!==-1&&(Z="SLOW"),isNaN($)||isNaN(q))throw new Error("Invalid coordinates passed to jsPDF.addImage");u.call(this);var D=F.call(this,T,L,ie,Z);return x.call(this,$,q,J,ae,D,te),this};var F=function(T,L,$,q){var J,ae,ie;if(typeof T=="string"&&i(T)===n){T=unescape(T);var Z=j(T,!1);(Z!==""||(Z=t.loadFile(T,!0))!==void 0)&&(T=Z)}if(v(T)&&(T=p(T,L)),L=i(T,L),!g(L))throw new Error("addImage does not support files of type '"+L+"', please ensure that a plugin for '"+L+"' support is added.");if(((ie=$)==null||ie.length===0)&&($=(function(te){return typeof te=="string"||I(te)?A(te):I(te.data)?A(te.data):null})(T)),(J=y.call(this,$))||(T instanceof Uint8Array||L==="RGBA"||(ae=T,T=O(T)),J=this["process"+L.toUpperCase()](T,f.call(this),$,(function(te){return te&&typeof te=="string"&&(te=te.toUpperCase()),te in t.image_compression?te:E.NONE})(q),ae)),!J)throw new Error("An unknown error occurred whilst processing the image.");return J},j=t.__addimage__.convertBase64ToBinaryString=function(T,L){L=typeof L!="boolean"||L;var $,q="";if(typeof T=="string"){var J;$=(J=k(T))!==null&&J!==void 0?J:T;try{q=e0($)}catch(ae){if(L)throw S($)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+ae.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return q};t.getImageProperties=function(T){var L,$,q="";if(v(T)&&(T=p(T)),typeof T=="string"&&i(T)===n&&((q=j(T,!1))===""&&(q=t.loadFile(T)||""),T=q),$=i(T),!g($))throw new Error("addImage does not support files of type '"+$+"', please ensure that a plugin for '"+$+"' support is added.");if(T instanceof Uint8Array||(T=O(T)),!(L=this["process"+$.toUpperCase()](T)))throw new Error("An unknown error occurred whilst processing the image");return L.fileType=$,L}})(tn.API),(function(t){var e=function(n){if(n!==void 0&&n!="")return!0};tn.API.events.push(["addPage",function(n){this.internal.getPageInfo(n.pageNumber).pageContext.annotations=[]}]),t.events.push(["putPage",function(n){for(var r,i,a,o=this.internal.getCoordinateString,s=this.internal.getVerticalCoordinateString,u=this.internal.getPageInfoByObjId(n.objId),h=n.pageContext.annotations,f=!1,g=0;g<h.length&&!f;g++)switch((r=h[g]).type){case"link":(e(r.options.url)||e(r.options.pageNumber))&&(f=!0);break;case"reference":case"text":case"freetext":f=!0}if(f!=0){this.internal.write("/Annots [");for(var v=0;v<h.length;v++){r=h[v];var p=this.internal.pdfEscape,y=this.internal.getEncryptor(n.objId);switch(r.type){case"reference":this.internal.write(" "+r.object.objId+" 0 R ");break;case"text":var _=this.internal.newAdditionalObject(),x=this.internal.newAdditionalObject(),b=this.internal.getEncryptor(_.objId),E=r.title||"Note";a="<</Type /Annot /Subtype /Text "+(i="/Rect ["+o(r.bounds.x)+" "+s(r.bounds.y+r.bounds.h)+" "+o(r.bounds.x+r.bounds.w)+" "+s(r.bounds.y)+"] ")+"/Contents ("+p(b(r.contents))+")",a+=" /Popup "+x.objId+" 0 R",a+=" /P "+u.objId+" 0 R",a+=" /T ("+p(b(E))+") >>",_.content=a;var A=_.objId+" 0 R";a="<</Type /Annot /Subtype /Popup "+(i="/Rect ["+o(r.bounds.x+30)+" "+s(r.bounds.y+r.bounds.h)+" "+o(r.bounds.x+r.bounds.w+30)+" "+s(r.bounds.y)+"] ")+" /Parent "+A,r.open&&(a+=" /Open true"),a+=" >>",x.content=a,this.internal.write(_.objId,"0 R",x.objId,"0 R");break;case"freetext":i="/Rect ["+o(r.bounds.x)+" "+s(r.bounds.y)+" "+o(r.bounds.x+r.bounds.w)+" "+s(r.bounds.y+r.bounds.h)+"] ";var S=r.color||"#000000";a="<</Type /Annot /Subtype /FreeText "+i+"/Contents ("+p(y(r.contents))+")",a+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+S+")",a+=" /Border [0 0 0]",a+=" >>",this.internal.write(a);break;case"link":if(r.options.name){var k=this.annotations._nameMap[r.options.name];r.options.pageNumber=k.page,r.options.top=k.y}else r.options.top||(r.options.top=0);if(i="/Rect ["+r.finalBounds.x+" "+r.finalBounds.y+" "+r.finalBounds.w+" "+r.finalBounds.h+"] ",a="",r.options.url)a="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /A <</S /URI /URI ("+p(y(r.options.url))+") >>";else if(r.options.pageNumber)switch(a="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(r.options.pageNumber).objId+" 0 R",r.options.magFactor=r.options.magFactor||"XYZ",r.options.magFactor){case"Fit":a+=" /Fit]";break;case"FitH":a+=" /FitH "+r.options.top+"]";break;case"FitV":r.options.left=r.options.left||0,a+=" /FitV "+r.options.left+"]";break;default:var I=s(r.options.top);r.options.left=r.options.left||0,r.options.zoom===void 0&&(r.options.zoom=0),a+=" /XYZ "+r.options.left+" "+I+" "+r.options.zoom+"]"}a!=""&&(a+=" >>",this.internal.write(a))}}this.internal.write("]")}}]),t.createAnnotation=function(n){var r=this.internal.getCurrentPageInfo();switch(n.type){case"link":this.link(n.bounds.x,n.bounds.y,n.bounds.w,n.bounds.h,n);break;case"text":case"freetext":r.pageContext.annotations.push(n)}},t.link=function(n,r,i,a,o){var s=this.internal.getCurrentPageInfo(),u=this.internal.getCoordinateString,h=this.internal.getVerticalCoordinateString;s.pageContext.annotations.push({finalBounds:{x:u(n),y:h(r),w:u(n+i),h:h(r+a)},options:o,type:"link"})},t.textWithLink=function(n,r,i,a){var o,s,u=this.getTextWidth(n),h=this.internal.getLineHeight()/this.internal.scaleFactor;if(a.maxWidth!==void 0){s=a.maxWidth;var f=this.splitTextToSize(n,s).length;o=Math.ceil(h*f)}else s=u,o=h;return this.text(n,r,i,a),i+=.2*h,a.align==="center"&&(r-=u/2),a.align==="right"&&(r-=u),this.link(r,i-h,s,o,a),u},t.getTextWidth=function(n){var r=this.internal.getFontSize();return this.getStringUnitWidth(n)*r/this.internal.scaleFactor}})(tn.API),(function(t){var e={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},n={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},r={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},i=[1570,1571,1573,1575];t.__arabicParser__={};var a=t.__arabicParser__.isInArabicSubstitutionA=function(_){return e[_.charCodeAt(0)]!==void 0},o=t.__arabicParser__.isArabicLetter=function(_){return typeof _=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(_)},s=t.__arabicParser__.isArabicEndLetter=function(_){return o(_)&&a(_)&&e[_.charCodeAt(0)].length<=2},u=t.__arabicParser__.isArabicAlfLetter=function(_){return o(_)&&i.indexOf(_.charCodeAt(0))>=0};t.__arabicParser__.arabicLetterHasIsolatedForm=function(_){return o(_)&&a(_)&&e[_.charCodeAt(0)].length>=1};var h=t.__arabicParser__.arabicLetterHasFinalForm=function(_){return o(_)&&a(_)&&e[_.charCodeAt(0)].length>=2};t.__arabicParser__.arabicLetterHasInitialForm=function(_){return o(_)&&a(_)&&e[_.charCodeAt(0)].length>=3};var f=t.__arabicParser__.arabicLetterHasMedialForm=function(_){return o(_)&&a(_)&&e[_.charCodeAt(0)].length==4},g=t.__arabicParser__.resolveLigatures=function(_){var x=0,b=n,E="",A=0;for(x=0;x<_.length;x+=1)b[_.charCodeAt(x)]!==void 0?(A++,typeof(b=b[_.charCodeAt(x)])=="number"&&(E+=String.fromCharCode(b),b=n,A=0),x===_.length-1&&(b=n,E+=_.charAt(x-(A-1)),x-=A-1,A=0)):(b=n,E+=_.charAt(x-A),x-=A,A=0);return E};t.__arabicParser__.isArabicDiacritic=function(_){return _!==void 0&&r[_.charCodeAt(0)]!==void 0};var v=t.__arabicParser__.getCorrectForm=function(_,x,b){return o(_)?a(_)===!1?-1:!h(_)||!o(x)&&!o(b)||!o(b)&&s(x)||s(_)&&!o(x)||s(_)&&u(x)||s(_)&&s(x)?0:f(_)&&o(x)&&!s(x)&&o(b)&&h(b)?3:s(_)||!o(b)?1:2:-1},p=function(_){var x=0,b=0,E=0,A="",S="",k="",I=(_=_||"").split("\\s+"),O=[];for(x=0;x<I.length;x+=1){for(O.push(""),b=0;b<I[x].length;b+=1)A=I[x][b],S=I[x][b-1],k=I[x][b+1],o(A)?(E=v(A,S,k),O[x]+=E!==-1?String.fromCharCode(e[A.charCodeAt(0)][E]):A):O[x]+=A;O[x]=g(O[x])}return O.join(" ")},y=t.__arabicParser__.processArabic=t.processArabic=function(){var _,x=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,b=[];if(Array.isArray(x)){var E=0;for(b=[],E=0;E<x.length;E+=1)Array.isArray(x[E])?b.push([p(x[E][0]),x[E][1],x[E][2]]):b.push([p(x[E])]);_=b}else _=p(x);return typeof arguments[0]=="string"?_:(arguments[0].text=_,arguments[0])};t.events.push(["preProcessText",y])})(tn.API),tn.API.autoPrint=function(t){var e;return(t=t||{}).variant=t.variant||"non-conform",t.variant==="javascript"?this.addJS("print({});"):(this.internal.events.subscribe("postPutResources",function(){e=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+e+" 0 R")})),this},(function(t){var e=function(){var n=void 0;Object.defineProperty(this,"pdf",{get:function(){return n},set:function(s){n=s}});var r=150;Object.defineProperty(this,"width",{get:function(){return r},set:function(s){r=isNaN(s)||Number.isInteger(s)===!1||s<0?150:s,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=r+1)}});var i=300;Object.defineProperty(this,"height",{get:function(){return i},set:function(s){i=isNaN(s)||Number.isInteger(s)===!1||s<0?300:s,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=i+1)}});var a=[];Object.defineProperty(this,"childNodes",{get:function(){return a},set:function(s){a=s}});var o={};Object.defineProperty(this,"style",{get:function(){return o},set:function(s){o=s}}),Object.defineProperty(this,"parentNode",{})};e.prototype.getContext=function(n,r){var i;if((n=n||"2d")!=="2d")return null;for(i in r)this.pdf.context2d.hasOwnProperty(i)&&(this.pdf.context2d[i]=r[i]);return this.pdf.context2d._canvas=this,this.pdf.context2d},e.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},t.events.push(["initialized",function(){this.canvas=new e,this.canvas.pdf=this}])})(tn.API),(function(t){var e={left:0,top:0,bottom:0,right:0},n=!1,r=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},e),this.internal.__cell__.margins.width=this.getPageWidth(),i.call(this))},i=function(){this.internal.__cell__.lastCell=new a,this.internal.__cell__.pages=1},a=function(){var u=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return u},set:function(_){u=_}});var h=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return h},set:function(_){h=_}});var f=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return f},set:function(_){f=_}});var g=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return g},set:function(_){g=_}});var v=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return v},set:function(_){v=_}});var p=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return p},set:function(_){p=_}});var y=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return y},set:function(_){y=_}}),this};a.prototype.clone=function(){return new a(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},a.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},t.setHeaderFunction=function(u){return r.call(this),this.internal.__cell__.headerFunction=typeof u=="function"?u:void 0,this},t.getTextDimensions=function(u,h){r.call(this);var f=(h=h||{}).fontSize||this.getFontSize(),g=h.font||this.getFont(),v=h.scaleFactor||this.internal.scaleFactor,p=0,y=0,_=0,x=this;if(!Array.isArray(u)&&typeof u!="string"){if(typeof u!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");u=String(u)}var b=h.maxWidth;b>0?typeof u=="string"?u=this.splitTextToSize(u,b):Object.prototype.toString.call(u)==="[object Array]"&&(u=u.reduce(function(A,S){return A.concat(x.splitTextToSize(S,b))},[])):u=Array.isArray(u)?u:[u];for(var E=0;E<u.length;E++)p<(_=this.getStringUnitWidth(u[E],{font:g})*f)&&(p=_);return p!==0&&(y=u.length),{w:p/=v,h:Math.max((y*f*this.getLineHeightFactor()-f*(this.getLineHeightFactor()-1))/v,0)}},t.cellAddPage=function(){r.call(this),this.addPage();var u=this.internal.__cell__.margins||e;return this.internal.__cell__.lastCell=new a(u.left,u.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var o=t.cell=function(){var u;u=arguments[0]instanceof a?arguments[0]:new a(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]),r.call(this);var h=this.internal.__cell__.lastCell,f=this.internal.__cell__.padding,g=this.internal.__cell__.margins||e,v=this.internal.__cell__.tableHeaderRow,p=this.internal.__cell__.printHeaders;return h.lineNumber!==void 0&&(h.lineNumber===u.lineNumber?(u.x=(h.x||0)+(h.width||0),u.y=h.y||0):h.y+h.height+u.height+g.bottom>this.getPageHeight()?(this.cellAddPage(),u.y=g.top,p&&v&&(this.printHeaderRow(u.lineNumber,!0),u.y+=v[0].height)):u.y=h.y+h.height||u.y),u.text[0]!==void 0&&(this.rect(u.x,u.y,u.width,u.height,n===!0?"FD":void 0),u.align==="right"?this.text(u.text,u.x+u.width-f,u.y+f,{align:"right",baseline:"top"}):u.align==="center"?this.text(u.text,u.x+u.width/2,u.y+f,{align:"center",baseline:"top",maxWidth:u.width-f-f}):this.text(u.text,u.x+f,u.y+f,{align:"left",baseline:"top",maxWidth:u.width-f-f})),this.internal.__cell__.lastCell=u,this};t.table=function(u,h,f,g,v){if(r.call(this),!f)throw new Error("No data for PDF table.");var p,y,_,x,b=[],E=[],A=[],S={},k={},I=[],O=[],M=(v=v||{}).autoSize||!1,F=v.printHeaders!==!1,j=v.css&&v.css["font-size"]!==void 0?16*v.css["font-size"]:v.fontSize||12,T=v.margins||Object.assign({width:this.getPageWidth()},e),L=typeof v.padding=="number"?v.padding:3,$=v.headerBackgroundColor||"#c8c8c8",q=v.headerTextColor||"#000";if(i.call(this),this.internal.__cell__.printHeaders=F,this.internal.__cell__.margins=T,this.internal.__cell__.table_font_size=j,this.internal.__cell__.padding=L,this.internal.__cell__.headerBackgroundColor=$,this.internal.__cell__.headerTextColor=q,this.setFontSize(j),g==null)E=b=Object.keys(f[0]),A=b.map(function(){return"left"});else if(Array.isArray(g)&&Nr(g[0])==="object")for(b=g.map(function(V){return V.name}),E=g.map(function(V){return V.prompt||V.name||""}),A=g.map(function(V){return V.align||"left"}),p=0;p<g.length;p+=1)k[g[p].name]=.7499990551181103*g[p].width;else Array.isArray(g)&&typeof g[0]=="string"&&(E=b=g,A=b.map(function(){return"left"}));if(M||Array.isArray(g)&&typeof g[0]=="string")for(p=0;p<b.length;p+=1){for(S[x=b[p]]=f.map(function(V){return V[x]}),this.setFont(void 0,"bold"),I.push(this.getTextDimensions(E[p],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),y=S[x],this.setFont(void 0,"normal"),_=0;_<y.length;_+=1)I.push(this.getTextDimensions(y[_],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);k[x]=Math.max.apply(null,I)+L+L,I=[]}if(F){var J={};for(p=0;p<b.length;p+=1)J[b[p]]={},J[b[p]].text=E[p],J[b[p]].align=A[p];var ae=s.call(this,J,k);O=b.map(function(V){return new a(u,h,k[V],ae,J[V].text,void 0,J[V].align)}),this.setTableHeaderRow(O),this.printHeaderRow(1,!1)}var ie=g.reduce(function(V,B){return V[B.name]=B.align,V},{});for(p=0;p<f.length;p+=1){"rowStart"in v&&v.rowStart instanceof Function&&v.rowStart({row:p,data:f[p]},this);var Z=s.call(this,f[p],k);for(_=0;_<b.length;_+=1){var te=f[p][b[_]];"cellStart"in v&&v.cellStart instanceof Function&&v.cellStart({row:p,col:_,data:te},this),o.call(this,new a(u,h,k[b[_]],Z,te,p+2,ie[b[_]]))}}return this.internal.__cell__.table_x=u,this.internal.__cell__.table_y=h,this};var s=function(u,h){var f=this.internal.__cell__.padding,g=this.internal.__cell__.table_font_size,v=this.internal.scaleFactor;return Object.keys(u).map(function(p){var y=u[p];return this.splitTextToSize(y.hasOwnProperty("text")?y.text:y,h[p]-f-f)},this).map(function(p){return this.getLineHeightFactor()*p.length*g/v+f+f},this).reduce(function(p,y){return Math.max(p,y)},0)};t.setTableHeaderRow=function(u){r.call(this),this.internal.__cell__.tableHeaderRow=u},t.printHeaderRow=function(u,h){if(r.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var f;if(n=!0,typeof this.internal.__cell__.headerFunction=="function"){var g=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new a(g[0],g[1],g[2],g[3],void 0,-1)}this.setFont(void 0,"bold");for(var v=[],p=0;p<this.internal.__cell__.tableHeaderRow.length;p+=1){f=this.internal.__cell__.tableHeaderRow[p].clone(),h&&(f.y=this.internal.__cell__.margins.top||0,v.push(f)),f.lineNumber=u;var y=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),o.call(this,f),this.setTextColor(y)}v.length>0&&this.setTableHeaderRow(v),this.setFont(void 0,"normal"),n=!1}})(tn.API);var lx={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},ux=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],Im=sx(ux),cx=[100,200,300,400,500,600,700,800,900],WI=sx(cx);function zv(t){var e=t.family.replace(/"|'/g,"").toLowerCase(),n=(function(a){return lx[a=a||"normal"]?a:"normal"})(t.style),r=(function(a){return a?typeof a=="number"?a>=100&&a<=900&&a%100==0?a:400:/^\d00$/.test(a)?parseInt(a):a==="bold"?700:400:400})(t.weight),i=(function(a){return typeof Im[a=a||"normal"]=="number"?a:"normal"})(t.stretch);return{family:e,style:n,weight:r,stretch:i,src:t.src||[],ref:t.ref||{name:e,style:[i,n,r].join(" ")}}}function Tw(t,e,n,r){var i;for(i=n;i>=0&&i<e.length;i+=r)if(t[e[i]])return t[e[i]];for(i=n;i>=0&&i<e.length;i-=r)if(t[e[i]])return t[e[i]]}var VI={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},Rw={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function Mw(t){return[t.stretch,t.style,t.weight,t.family].join(" ")}function Iw(t){return t.trimLeft()}function YI(t,e){for(var n=0;n<t.length;){if(t.charAt(n)===e)return[t.substring(0,n),t.substring(n+1)];n+=1}return null}function XI(t){var e=t.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return e===null?null:[e[0],t.substring(e[0].length)]}var U1,jw,Dw,Kh,H1,Fw,Bw,zw,qv=["times"];function qw(t,e,n,r,i){var a=4,o=Hw;switch(i){case tn.API.image_compression.FAST:a=1,o=Uw;break;case tn.API.image_compression.MEDIUM:a=6,o=$w;break;case tn.API.image_compression.SLOW:a=9,o=Gw}t=(function(u,h,f,g){for(var v,p=u.length/h,y=new Uint8Array(u.length+p),_=[KI,Uw,Hw,$w,Gw],x=0;x<p;x+=1){var b=x*h,E=u.subarray(b,b+h);if(g)y.set(g(E,f,v),b+x);else{for(var A=_.length,S=[],k=0;k<A;k+=1)S[k]=_[k](E,f,v);var I=QI(S.concat());y.set(S[I],b+x)}v=E}return y})(t,e,Math.ceil(n*r/8),o);var s=Om(t,{level:a});return tn.API.__addimage__.arrayBufferToBinaryString(s)}function KI(t){var e=Array.apply([],t);return e.unshift(0),e}function Uw(t,e){var n=t.length,r=[];r[0]=1;for(var i=0;i<n;i+=1){var a=t[i-e]||0;r[i+1]=t[i]-a+256&255}return r}function Hw(t,e,n){var r=t.length,i=[];i[0]=2;for(var a=0;a<r;a+=1){var o=n&&n[a]||0;i[a+1]=t[a]-o+256&255}return i}function $w(t,e,n){var r=t.length,i=[];i[0]=3;for(var a=0;a<r;a+=1){var o=t[a-e]||0,s=n&&n[a]||0;i[a+1]=t[a]+256-(o+s>>>1)&255}return i}function Gw(t,e,n){var r=t.length,i=[];i[0]=4;for(var a=0;a<r;a+=1){var o=ZI(t[a-e]||0,n&&n[a]||0,n&&n[a-e]||0);i[a+1]=t[a]-o+256&255}return i}function ZI(t,e,n){if(t===e&&e===n)return t;var r=Math.abs(e-n),i=Math.abs(t-n),a=Math.abs(t+e-n-n);return r<=i&&r<=a?t:i<=a?e:n}function QI(t){var e=t.map(function(n){return n.reduce(function(r,i){return r+Math.abs(i)},0)});return e.indexOf(Math.min.apply(null,e))}function Uv(t,e,n){var r=e*n,i=Math.floor(r/8),a=16-(r-8*i+n),o=(1<<n)-1;return fx(t,i)>>a&o}function Ww(t,e,n,r){var i=n*r,a=Math.floor(i/8),o=16-(i-8*a+r),s=(1<<r)-1,u=(e&s)<<o;(function(h,f,g){if(f+1<h.byteLength)h.setUint16(f,g,!1);else{var v=g>>8&255;h.setUint8(f,v)}})(t,a,fx(t,a)&~(s<<o)&65535|u)}function fx(t,e){return e+1<t.byteLength?t.getUint16(e,!1):t.getUint8(e)<<8}function JI(t){var e=0;if(t[e++]!==71||t[e++]!==73||t[e++]!==70||t[e++]!==56||(t[e++]+1&253)!=56||t[e++]!==97)throw new Error("Invalid GIF 87a/89a header.");var n=t[e++]|t[e++]<<8,r=t[e++]|t[e++]<<8,i=t[e++],a=i>>7,o=1<<1+(7&i);t[e++],t[e++];var s=null,u=null;a&&(s=e,u=o,e+=3*o);var h=!0,f=[],g=0,v=null,p=0,y=null;for(this.width=n,this.height=r;h&&e<t.length;)switch(t[e++]){case 33:switch(t[e++]){case 255:if(t[e]!==11||t[e+1]==78&&t[e+2]==69&&t[e+3]==84&&t[e+4]==83&&t[e+5]==67&&t[e+6]==65&&t[e+7]==80&&t[e+8]==69&&t[e+9]==50&&t[e+10]==46&&t[e+11]==48&&t[e+12]==3&&t[e+13]==1&&t[e+16]==0)e+=14,y=t[e++]|t[e++]<<8,e++;else for(e+=12;;){if(!((T=t[e++])>=0))throw Error("Invalid block size");if(T===0)break;e+=T}break;case 249:if(t[e++]!==4||t[e+4]!==0)throw new Error("Invalid graphics extension block.");var _=t[e++];g=t[e++]|t[e++]<<8,v=t[e++],1&_||(v=null),p=_>>2&7,e++;break;case 254:for(;;){if(!((T=t[e++])>=0))throw Error("Invalid block size");if(T===0)break;e+=T}break;default:throw new Error("Unknown graphic control label: 0x"+t[e-1].toString(16))}break;case 44:var x=t[e++]|t[e++]<<8,b=t[e++]|t[e++]<<8,E=t[e++]|t[e++]<<8,A=t[e++]|t[e++]<<8,S=t[e++],k=S>>6&1,I=1<<1+(7&S),O=s,M=u,F=!1;S>>7&&(F=!0,O=e,M=I,e+=3*I);var j=e;for(e++;;){var T;if(!((T=t[e++])>=0))throw Error("Invalid block size");if(T===0)break;e+=T}f.push({x,y:b,width:E,height:A,has_local_palette:F,palette_offset:O,palette_size:M,data_offset:j,data_length:e-j,transparent_index:v,interlaced:!!k,delay:g,disposal:p});break;case 59:h=!1;break;default:throw new Error("Unknown gif block: 0x"+t[e-1].toString(16))}this.numFrames=function(){return f.length},this.loopCount=function(){return y},this.frameInfo=function(L){if(L<0||L>=f.length)throw new Error("Frame index out of range.");return f[L]},this.decodeAndBlitFrameBGRA=function(L,$){var q=this.frameInfo(L),J=q.width*q.height,ae=new Uint8Array(J);Vw(t,q.data_offset,ae,J);var ie=q.palette_offset,Z=q.transparent_index;Z===null&&(Z=256);var te=q.width,V=n-te,B=te,D=4*(q.y*n+q.x),U=4*((q.y+q.height)*n+q.x),X=D,ee=4*V;q.interlaced===!0&&(ee+=4*n*7);for(var K=8,oe=0,me=ae.length;oe<me;++oe){var de=ae[oe];if(B===0&&(B=te,(X+=ee)>=U&&(ee=4*V+4*n*(K-1),X=D+(te+V)*(K<<1),K>>=1)),de===Z)X+=4;else{var ye=t[ie+3*de],Re=t[ie+3*de+1],Oe=t[ie+3*de+2];$[X++]=Oe,$[X++]=Re,$[X++]=ye,$[X++]=255}--B}},this.decodeAndBlitFrameRGBA=function(L,$){var q=this.frameInfo(L),J=q.width*q.height,ae=new Uint8Array(J);Vw(t,q.data_offset,ae,J);var ie=q.palette_offset,Z=q.transparent_index;Z===null&&(Z=256);var te=q.width,V=n-te,B=te,D=4*(q.y*n+q.x),U=4*((q.y+q.height)*n+q.x),X=D,ee=4*V;q.interlaced===!0&&(ee+=4*n*7);for(var K=8,oe=0,me=ae.length;oe<me;++oe){var de=ae[oe];if(B===0&&(B=te,(X+=ee)>=U&&(ee=4*V+4*n*(K-1),X=D+(te+V)*(K<<1),K>>=1)),de===Z)X+=4;else{var ye=t[ie+3*de],Re=t[ie+3*de+1],Oe=t[ie+3*de+2];$[X++]=ye,$[X++]=Re,$[X++]=Oe,$[X++]=255}--B}}}function Vw(t,e,n,r){for(var i=t[e++],a=1<<i,o=a+1,s=o+1,u=i+1,h=(1<<u)-1,f=0,g=0,v=0,p=t[e++],y=new Int32Array(4096),_=null;;){for(;f<16&&p!==0;)g|=t[e++]<<f,f+=8,p===1?p=t[e++]:--p;if(f<u)break;var x=g&h;if(g>>=u,f-=u,x!==a){if(x===o)break;for(var b=x<s?x:_,E=0,A=b;A>a;)A=y[A]>>8,++E;var S=A;if(v+E+(b!==x?1:0)>r)return void Yr.log("Warning, gif stream longer than expected.");n[v++]=S;var k=v+=E;for(b!==x&&(n[v++]=S),A=b;E--;)A=y[A],n[--k]=255&A,A>>=8;_!==null&&s<4096&&(y[s++]=_<<8|S,s>=h+1&&u<12&&(++u,h=h<<1|1)),_=x}else s=o+1,h=(1<<(u=i+1))-1,_=null}return v!==r&&Yr.log("Warning, gif stream shorter than expected."),n}/**
530
+ * @license
531
+ Copyright (c) 2008, Adobe Systems Incorporated
532
+ All rights reserved.
533
+
534
+ Redistribution and use in source and binary forms, with or without
535
+ modification, are permitted provided that the following conditions are
536
+ met:
537
+
538
+ * Redistributions of source code must retain the above copyright notice,
539
+ this list of conditions and the following disclaimer.
540
+
541
+ * Redistributions in binary form must reproduce the above copyright
542
+ notice, this list of conditions and the following disclaimer in the
543
+ documentation and/or other materials provided with the distribution.
544
+
545
+ * Neither the name of Adobe Systems Incorporated nor the names of its
546
+ contributors may be used to endorse or promote products derived from
547
+ this software without specific prior written permission.
548
+
549
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
550
+ IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
551
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
552
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
553
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
554
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
555
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
556
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
557
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
558
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
559
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
560
+ */function Hv(t){var e,n,r,i,a,o=Math.floor,s=new Array(64),u=new Array(64),h=new Array(64),f=new Array(64),g=new Array(65535),v=new Array(65535),p=new Array(64),y=new Array(64),_=[],x=0,b=7,E=new Array(64),A=new Array(64),S=new Array(64),k=new Array(256),I=new Array(2048),O=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],M=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],F=[0,1,2,3,4,5,6,7,8,9,10,11],j=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],T=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],L=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],$=[0,1,2,3,4,5,6,7,8,9,10,11],q=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],J=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function ae(D,U){for(var X=0,ee=0,K=new Array,oe=1;oe<=16;oe++){for(var me=1;me<=D[oe];me++)K[U[ee]]=[],K[U[ee]][0]=X,K[U[ee]][1]=oe,ee++,X++;X*=2}return K}function ie(D){for(var U=D[0],X=D[1]-1;X>=0;)U&1<<X&&(x|=1<<b),X--,--b<0&&(x==255?(Z(255),Z(0)):Z(x),b=7,x=0)}function Z(D){_.push(D)}function te(D){Z(D>>8&255),Z(255&D)}function V(D,U,X,ee,K){for(var oe,me=K[0],de=K[240],ye=(function(fe,Le){var Ne,ue,Ae,Pe,Ue,st,dt,pt,xt,bt,kt=0;for(xt=0;xt<8;++xt){Ne=fe[kt],ue=fe[kt+1],Ae=fe[kt+2],Pe=fe[kt+3],Ue=fe[kt+4],st=fe[kt+5],dt=fe[kt+6];var qn=Ne+(pt=fe[kt+7]),xn=Ne-pt,It=ue+dt,Jt=ue-dt,Ve=Ae+st,qe=Ae-st,Nt=Pe+Ue,Ct=Pe-Ue,an=qn+Nt,Ut=qn-Nt,Sn=It+Ve,en=It-Ve;fe[kt]=an+Sn,fe[kt+4]=an-Sn;var gn=.707106781*(en+Ut);fe[kt+2]=Ut+gn,fe[kt+6]=Ut-gn;var Bi=.382683433*((an=Ct+qe)-(en=Jt+xn)),oi=.5411961*an+Bi,Ei=1.306562965*en+Bi,Sr=.707106781*(Sn=qe+Jt),Qt=xn+Sr,ca=xn-Sr;fe[kt+5]=ca+oi,fe[kt+3]=ca-oi,fe[kt+1]=Qt+Ei,fe[kt+7]=Qt-Ei,kt+=8}for(kt=0,xt=0;xt<8;++xt){Ne=fe[kt],ue=fe[kt+8],Ae=fe[kt+16],Pe=fe[kt+24],Ue=fe[kt+32],st=fe[kt+40],dt=fe[kt+48];var Fa=Ne+(pt=fe[kt+56]),Kr=Ne-pt,Yi=ue+dt,Un=ue-dt,Er=Ae+st,Rr=Ae-st,Sa=Pe+Ue,Ho=Pe-Ue,Ea=Fa+Sa,eo=Fa-Sa,si=Yi+Er,ka=Yi-Er;fe[kt]=Ea+si,fe[kt+32]=Ea-si;var Aa=.707106781*(ka+eo);fe[kt+16]=eo+Aa,fe[kt+48]=eo-Aa;var $o=.382683433*((Ea=Ho+Rr)-(ka=Un+Kr)),zi=.5411961*Ea+$o,to=1.306562965*ka+$o,Bs=.707106781*(si=Rr+Un),is=Kr+Bs,lu=Kr-Bs;fe[kt+40]=lu+zi,fe[kt+24]=lu-zi,fe[kt+8]=is+to,fe[kt+56]=is-to,kt++}for(xt=0;xt<64;++xt)bt=fe[xt]*Le[xt],p[xt]=bt>0?bt+.5|0:bt-.5|0;return p})(D,U),Re=0;Re<64;++Re)y[O[Re]]=ye[Re];var Oe=y[0]-X;X=y[0],Oe==0?ie(ee[0]):(ie(ee[v[oe=32767+Oe]]),ie(g[oe]));for(var Me=63;Me>0&&y[Me]==0;)Me--;if(Me==0)return ie(me),X;for(var Ee,ge=1;ge<=Me;){for(var Te=ge;y[ge]==0&&ge<=Me;)++ge;var Be=ge-Te;if(Be>=16){Ee=Be>>4;for(var Ce=1;Ce<=Ee;++Ce)ie(de);Be&=15}oe=32767+y[ge],ie(K[(Be<<4)+v[oe]]),ie(g[oe]),ge++}return Me!=63&&ie(me),X}function B(D){D=Math.min(Math.max(D,1),100),a!=D&&((function(U){for(var X=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],ee=0;ee<64;ee++){var K=o((X[ee]*U+50)/100);K=Math.min(Math.max(K,1),255),s[O[ee]]=K}for(var oe=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],me=0;me<64;me++){var de=o((oe[me]*U+50)/100);de=Math.min(Math.max(de,1),255),u[O[me]]=de}for(var ye=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],Re=0,Oe=0;Oe<8;Oe++)for(var Me=0;Me<8;Me++)h[Re]=1/(s[O[Re]]*ye[Oe]*ye[Me]*8),f[Re]=1/(u[O[Re]]*ye[Oe]*ye[Me]*8),Re++})(D<50?Math.floor(5e3/D):Math.floor(200-2*D)),a=D)}this.encode=function(D,U){U&&B(U),_=new Array,x=0,b=7,te(65496),te(65504),te(16),Z(74),Z(70),Z(73),Z(70),Z(0),Z(1),Z(1),Z(0),te(1),te(1),Z(0),Z(0),(function(){te(65499),te(132),Z(0);for(var ue=0;ue<64;ue++)Z(s[ue]);Z(1);for(var Ae=0;Ae<64;Ae++)Z(u[Ae])})(),(function(ue,Ae){te(65472),te(17),Z(8),te(Ae),te(ue),Z(3),Z(1),Z(17),Z(0),Z(2),Z(17),Z(1),Z(3),Z(17),Z(1)})(D.width,D.height),(function(){te(65476),te(418),Z(0);for(var ue=0;ue<16;ue++)Z(M[ue+1]);for(var Ae=0;Ae<=11;Ae++)Z(F[Ae]);Z(16);for(var Pe=0;Pe<16;Pe++)Z(j[Pe+1]);for(var Ue=0;Ue<=161;Ue++)Z(T[Ue]);Z(1);for(var st=0;st<16;st++)Z(L[st+1]);for(var dt=0;dt<=11;dt++)Z($[dt]);Z(17);for(var pt=0;pt<16;pt++)Z(q[pt+1]);for(var xt=0;xt<=161;xt++)Z(J[xt])})(),te(65498),te(12),Z(3),Z(1),Z(0),Z(2),Z(17),Z(3),Z(17),Z(0),Z(63),Z(0);var X=0,ee=0,K=0;x=0,b=7,this.encode.displayName="_encode_";for(var oe,me,de,ye,Re,Oe,Me,Ee,ge,Te=D.data,Be=D.width,Ce=D.height,fe=4*Be,Le=0;Le<Ce;){for(oe=0;oe<fe;){for(Re=fe*Le+oe,Me=-1,Ee=0,ge=0;ge<64;ge++)Oe=Re+(Ee=ge>>3)*fe+(Me=4*(7&ge)),Le+Ee>=Ce&&(Oe-=fe*(Le+1+Ee-Ce)),oe+Me>=fe&&(Oe-=oe+Me-fe+4),me=Te[Oe++],de=Te[Oe++],ye=Te[Oe++],E[ge]=(I[me]+I[de+256|0]+I[ye+512|0]>>16)-128,A[ge]=(I[me+768|0]+I[de+1024|0]+I[ye+1280|0]>>16)-128,S[ge]=(I[me+1280|0]+I[de+1536|0]+I[ye+1792|0]>>16)-128;X=V(E,h,X,e,r),ee=V(A,f,ee,n,i),K=V(S,f,K,n,i),oe+=32}Le+=8}if(b>=0){var Ne=[];Ne[1]=b+1,Ne[0]=(1<<b+1)-1,ie(Ne)}return te(65497),new Uint8Array(_)},t=t||50,(function(){for(var D=String.fromCharCode,U=0;U<256;U++)k[U]=D(U)})(),e=ae(M,F),n=ae(L,$),r=ae(j,T),i=ae(q,J),(function(){for(var D=1,U=2,X=1;X<=15;X++){for(var ee=D;ee<U;ee++)v[32767+ee]=X,g[32767+ee]=[],g[32767+ee][1]=X,g[32767+ee][0]=ee;for(var K=-(U-1);K<=-D;K++)v[32767+K]=X,g[32767+K]=[],g[32767+K][1]=X,g[32767+K][0]=U-1+K;D<<=1,U<<=1}})(),(function(){for(var D=0;D<256;D++)I[D]=19595*D,I[D+256|0]=38470*D,I[D+512|0]=7471*D+32768,I[D+768|0]=-11059*D,I[D+1024|0]=-21709*D,I[D+1280|0]=32768*D+8421375,I[D+1536|0]=-27439*D,I[D+1792|0]=-5329*D})(),B(t)}/**
561
+ * @license
562
+ * Copyright (c) 2017 Aras Abbasi
563
+ *
564
+ * Licensed under the MIT License.
565
+ * http://opensource.org/licenses/mit-license
566
+ */function Zl(t,e){if(this.pos=0,this.buffer=t,this.datav=new DataView(t.buffer),this.is_with_alpha=!!e,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,["BM","BA","CI","CP","IC","PT"].indexOf(this.flag)===-1)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function Yw(t){function e(F){if(!F)throw Error("assert :P")}function n(F,j,T){for(var L=0;4>L;L++)if(F[j+L]!=T.charCodeAt(L))return!0;return!1}function r(F,j,T,L,$){for(var q=0;q<$;q++)F[j+q]=T[L+q]}function i(F,j,T,L){for(var $=0;$<L;$++)F[j+$]=T}function a(F){return new Int32Array(F)}function o(F,j){for(var T=[],L=0;L<F;L++)T.push(new j);return T}function s(F,j){var T=[];return(function L($,q,J){for(var ae=J[q],ie=0;ie<ae&&($.push(J.length>q+1?[]:new j),!(J.length<q+1));ie++)L($[ie],q+1,J)})(T,0,F),T}var u=function(){var F=this;function j(P,R){for(var Y=1<<R-1>>>0;P&Y;)Y>>>=1;return Y?(P&Y-1)+Y:P}function T(P,R,Y,ne,le){e(!(ne%Y));do P[R+(ne-=Y)]=le;while(0<ne)}function L(P,R,Y,ne,le){if(e(2328>=le),512>=le)var pe=a(512);else if((pe=a(le))==null)return 0;return(function(ve,be,we,Se,Fe,Je){var xe,$e,Qe=be,lt=1<<we,Xe=a(16),ot=a(16);for(e(Fe!=0),e(Se!=null),e(ve!=null),e(0<we),$e=0;$e<Fe;++$e){if(15<Se[$e])return 0;++Xe[Se[$e]]}if(Xe[0]==Fe)return 0;for(ot[1]=0,xe=1;15>xe;++xe){if(Xe[xe]>1<<xe)return 0;ot[xe+1]=ot[xe]+Xe[xe]}for($e=0;$e<Fe;++$e)xe=Se[$e],0<Se[$e]&&(Je[ot[xe]++]=$e);if(ot[15]==1)return(Se=new $).g=0,Se.value=Je[0],T(ve,Qe,1,lt,Se),lt;var He,ft=-1,ht=lt-1,Wt=0,Bt=1,dn=1,zt=1<<we;for($e=0,xe=1,Fe=2;xe<=we;++xe,Fe<<=1){if(Bt+=dn<<=1,0>(dn-=Xe[xe]))return 0;for(;0<Xe[xe];--Xe[xe])(Se=new $).g=xe,Se.value=Je[$e++],T(ve,Qe+Wt,Fe,zt,Se),Wt=j(Wt,xe)}for(xe=we+1,Fe=2;15>=xe;++xe,Fe<<=1){if(Bt+=dn<<=1,0>(dn-=Xe[xe]))return 0;for(;0<Xe[xe];--Xe[xe]){if(Se=new $,(Wt&ht)!=ft){for(Qe+=zt,He=1<<(ft=xe)-we;15>ft&&!(0>=(He-=Xe[ft]));)++ft,He<<=1;lt+=zt=1<<(He=ft-we),ve[be+(ft=Wt&ht)].g=He+we,ve[be+ft].value=Qe-be-ft}Se.g=xe-we,Se.value=Je[$e++],T(ve,Qe+(Wt>>we),Fe,zt,Se),Wt=j(Wt,xe)}}return Bt!=2*ot[15]-1?0:lt})(P,R,Y,ne,le,pe)}function $(){this.value=this.g=0}function q(){this.value=this.g=0}function J(){this.G=o(5,$),this.H=a(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=o(Oi,q)}function ae(P,R,Y,ne){e(P!=null),e(R!=null),e(2147483648>ne),P.Ca=254,P.I=0,P.b=-8,P.Ka=0,P.oa=R,P.pa=Y,P.Jd=R,P.Yc=Y+ne,P.Zc=4<=ne?Y+ne-4+1:Y,me(P)}function ie(P,R){for(var Y=0;0<R--;)Y|=ye(P,128)<<R;return Y}function Z(P,R){var Y=ie(P,R);return de(P)?-Y:Y}function te(P,R,Y,ne){var le,pe=0;for(e(P!=null),e(R!=null),e(4294967288>ne),P.Sb=ne,P.Ra=0,P.u=0,P.h=0,4<ne&&(ne=4),le=0;le<ne;++le)pe+=R[Y+le]<<8*le;P.Ra=pe,P.bb=ne,P.oa=R,P.pa=Y}function V(P){for(;8<=P.u&&P.bb<P.Sb;)P.Ra>>>=8,P.Ra+=P.oa[P.pa+P.bb]<<ha-8>>>0,++P.bb,P.u-=8;ee(P)&&(P.h=1,P.u=0)}function B(P,R){if(e(0<=R),!P.h&&R<=Wa){var Y=X(P)&Na[R];return P.u+=R,V(P),Y}return P.h=1,P.u=0}function D(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function U(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function X(P){return P.Ra>>>(P.u&ha-1)>>>0}function ee(P){return e(P.bb<=P.Sb),P.h||P.bb==P.Sb&&P.u>ha}function K(P,R){P.u=R,P.h=ee(P)}function oe(P){P.u>=Ji&&(e(P.u>=Ji),V(P))}function me(P){e(P!=null&&P.oa!=null),P.pa<P.Zc?(P.I=(P.oa[P.pa++]|P.I<<8)>>>0,P.b+=8):(e(P!=null&&P.oa!=null),P.pa<P.Yc?(P.b+=8,P.I=P.oa[P.pa++]|P.I<<8):P.Ka?P.b=0:(P.I<<=8,P.b+=8,P.Ka=1))}function de(P){return ie(P,1)}function ye(P,R){var Y=P.Ca;0>P.b&&me(P);var ne=P.b,le=Y*R>>>8,pe=(P.I>>>ne>le)+0;for(pe?(Y-=le,P.I-=le+1<<ne>>>0):Y=le+1,ne=Y,le=0;256<=ne;)le+=8,ne>>=8;return ne=7^le+No[ne],P.b-=ne,P.Ca=(Y<<ne)-1,pe}function Re(P,R,Y){P[R+0]=Y>>24&255,P[R+1]=Y>>16&255,P[R+2]=Y>>8&255,P[R+3]=255&Y}function Oe(P,R){return P[R+0]|P[R+1]<<8}function Me(P,R){return Oe(P,R)|P[R+2]<<16}function Ee(P,R){return Oe(P,R)|Oe(P,R+2)<<16}function ge(P,R){var Y=1<<R;return e(P!=null),e(0<R),P.X=a(Y),P.X==null?0:(P.Mb=32-R,P.Xa=R,1)}function Te(P,R){e(P!=null),e(R!=null),e(P.Xa==R.Xa),r(R.X,0,P.X,0,1<<R.Xa)}function Be(){this.X=[],this.Xa=this.Mb=0}function Ce(P,R,Y,ne){e(Y!=null),e(ne!=null);var le=Y[0],pe=ne[0];return le==0&&(le=(P*pe+R/2)/R),pe==0&&(pe=(R*le+P/2)/P),0>=le||0>=pe?0:(Y[0]=le,ne[0]=pe,1)}function fe(P,R){return P+(1<<R)-1>>>R}function Le(P,R){return((4278255360&P)+(4278255360&R)>>>0&4278255360)+((16711935&P)+(16711935&R)>>>0&16711935)>>>0}function Ne(P,R){F[R]=function(Y,ne,le,pe,ve,be,we){var Se;for(Se=0;Se<ve;++Se){var Fe=F[P](be[we+Se-1],le,pe+Se);be[we+Se]=Le(Y[ne+Se],Fe)}}}function ue(){this.ud=this.hd=this.jd=0}function Ae(P,R){return((4278124286&(P^R))>>>1)+(P&R)>>>0}function Pe(P){return 0<=P&&256>P?P:0>P?0:255<P?255:void 0}function Ue(P,R){return Pe(P+(P-R+.5>>1))}function st(P,R,Y){return Math.abs(R-Y)-Math.abs(P-Y)}function dt(P,R,Y,ne,le,pe,ve){for(ne=pe[ve-1],Y=0;Y<le;++Y)pe[ve+Y]=ne=Le(P[R+Y],ne)}function pt(P,R,Y,ne,le){var pe;for(pe=0;pe<Y;++pe){var ve=P[R+pe],be=ve>>8&255,we=16711935&(we=(we=16711935&ve)+((be<<16)+be));ne[le+pe]=(4278255360&ve)+we>>>0}}function xt(P,R){R.jd=255&P,R.hd=P>>8&255,R.ud=P>>16&255}function bt(P,R,Y,ne,le,pe){var ve;for(ve=0;ve<ne;++ve){var be=R[Y+ve],we=be>>>8,Se=be,Fe=255&(Fe=(Fe=be>>>16)+((P.jd<<24>>24)*(we<<24>>24)>>>5));Se=255&(Se=(Se+=(P.hd<<24>>24)*(we<<24>>24)>>>5)+((P.ud<<24>>24)*(Fe<<24>>24)>>>5)),le[pe+ve]=(4278255360&be)+(Fe<<16)+Se}}function kt(P,R,Y,ne,le){F[R]=function(pe,ve,be,we,Se,Fe,Je,xe,$e){for(we=Je;we<xe;++we)for(Je=0;Je<$e;++Je)Se[Fe++]=le(be[ne(pe[ve++])])},F[P]=function(pe,ve,be,we,Se,Fe,Je){var xe=8>>pe.b,$e=pe.Ea,Qe=pe.K[0],lt=pe.w;if(8>xe)for(pe=(1<<pe.b)-1,lt=(1<<xe)-1;ve<be;++ve){var Xe,ot=0;for(Xe=0;Xe<$e;++Xe)Xe&pe||(ot=ne(we[Se++])),Fe[Je++]=le(Qe[ot&lt]),ot>>=xe}else F["VP8LMapColor"+Y](we,Se,Qe,lt,Fe,Je,ve,be,$e)}}function qn(P,R,Y,ne,le){for(Y=R+Y;R<Y;){var pe=P[R++];ne[le++]=pe>>16&255,ne[le++]=pe>>8&255,ne[le++]=255&pe}}function xn(P,R,Y,ne,le){for(Y=R+Y;R<Y;){var pe=P[R++];ne[le++]=pe>>16&255,ne[le++]=pe>>8&255,ne[le++]=255&pe,ne[le++]=pe>>24&255}}function It(P,R,Y,ne,le){for(Y=R+Y;R<Y;){var pe=(ve=P[R++])>>16&240|ve>>12&15,ve=240&ve|ve>>28&15;ne[le++]=pe,ne[le++]=ve}}function Jt(P,R,Y,ne,le){for(Y=R+Y;R<Y;){var pe=(ve=P[R++])>>16&248|ve>>13&7,ve=ve>>5&224|ve>>3&31;ne[le++]=pe,ne[le++]=ve}}function Ve(P,R,Y,ne,le){for(Y=R+Y;R<Y;){var pe=P[R++];ne[le++]=255&pe,ne[le++]=pe>>8&255,ne[le++]=pe>>16&255}}function qe(P,R,Y,ne,le,pe){if(pe==0)for(Y=R+Y;R<Y;)Re(ne,((pe=P[R++])[0]>>24|pe[1]>>8&65280|pe[2]<<8&16711680|pe[3]<<24)>>>0),le+=32;else r(ne,le,P,R,Y)}function Nt(P,R){F[R][0]=F[P+"0"],F[R][1]=F[P+"1"],F[R][2]=F[P+"2"],F[R][3]=F[P+"3"],F[R][4]=F[P+"4"],F[R][5]=F[P+"5"],F[R][6]=F[P+"6"],F[R][7]=F[P+"7"],F[R][8]=F[P+"8"],F[R][9]=F[P+"9"],F[R][10]=F[P+"10"],F[R][11]=F[P+"11"],F[R][12]=F[P+"12"],F[R][13]=F[P+"13"],F[R][14]=F[P+"0"],F[R][15]=F[P+"0"]}function Ct(P){return P==ql||P==Ws||P==vu||P==mu}function an(){this.eb=[],this.size=this.A=this.fb=0}function Ut(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function Sn(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new an,this.f.kb=new Ut,this.sd=null}function en(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function gn(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function Bi(P){return alert("todo:WebPSamplerProcessPlane"),P.T}function oi(P,R){var Y=P.T,ne=R.ba.f.RGBA,le=ne.eb,pe=ne.fb+P.ka*ne.A,ve=Ra[R.ba.S],be=P.y,we=P.O,Se=P.f,Fe=P.N,Je=P.ea,xe=P.W,$e=R.cc,Qe=R.dc,lt=R.Mc,Xe=R.Nc,ot=P.ka,He=P.ka+P.T,ft=P.U,ht=ft+1>>1;for(ot==0?ve(be,we,null,null,Se,Fe,Je,xe,Se,Fe,Je,xe,le,pe,null,null,ft):(ve(R.ec,R.fc,be,we,$e,Qe,lt,Xe,Se,Fe,Je,xe,le,pe-ne.A,le,pe,ft),++Y);ot+2<He;ot+=2)$e=Se,Qe=Fe,lt=Je,Xe=xe,Fe+=P.Rc,xe+=P.Rc,pe+=2*ne.A,ve(be,(we+=2*P.fa)-P.fa,be,we,$e,Qe,lt,Xe,Se,Fe,Je,xe,le,pe-ne.A,le,pe,ft);return we+=P.fa,P.j+He<P.o?(r(R.ec,R.fc,be,we,ft),r(R.cc,R.dc,Se,Fe,ht),r(R.Mc,R.Nc,Je,xe,ht),Y--):1&He||ve(be,we,null,null,Se,Fe,Je,xe,Se,Fe,Je,xe,le,pe+ne.A,null,null,ft),Y}function Ei(P,R,Y){var ne=P.F,le=[P.J];if(ne!=null){var pe=P.U,ve=R.ba.S,be=ve==gu||ve==vu;R=R.ba.f.RGBA;var we=[0],Se=P.ka;we[0]=P.T,P.Kb&&(Se==0?--we[0]:(--Se,le[0]-=P.width),P.j+P.ka+P.T==P.o&&(we[0]=P.o-P.j-Se));var Fe=R.eb;Se=R.fb+Se*R.A,P=Dl(ne,le[0],P.width,pe,we,Fe,Se+(be?0:3),R.A),e(Y==we),P&&Ct(ve)&&Yo(Fe,Se,be,pe,we,R.A)}return 0}function Sr(P){var R=P.ma,Y=R.ba.S,ne=11>Y,le=Y==Ko||Y==zl||Y==gu||Y==fr||Y==12||Ct(Y);if(R.memory=null,R.Ib=null,R.Jb=null,R.Nd=null,!ml(R.Oa,P,le?11:12))return 0;if(le&&Ct(Y)&&Lc(),P.da)alert("todo:use_scaling");else{if(ne){if(R.Ib=Bi,P.Kb){if(Y=P.U+1>>1,R.memory=a(P.U+2*Y),R.memory==null)return 0;R.ec=R.memory,R.fc=0,R.cc=R.ec,R.dc=R.fc+P.U,R.Mc=R.cc,R.Nc=R.dc+Y,R.Ib=oi,Lc()}}else alert("todo:EmitYUV");le&&(R.Jb=Ei,ne&&Po())}if(ne&&!Hi){for(P=0;256>P;++P)va[P]=89858*(P-128)+Mo>>ws,ma[P]=-22014*(P-128)+Mo,Hl[P]=-45773*(P-128),_l[P]=113618*(P-128)+Mo>>ws;for(P=nr;P<sr;++P)R=76283*(P-16)+Mo>>ws,_u[P-nr]=zr(R,255),jf[P-nr]=zr(R+8>>4,15);Hi=1}return 1}function Qt(P){var R=P.ma,Y=P.U,ne=P.T;return e(!(1&P.ka)),0>=Y||0>=ne?0:(Y=R.Ib(P,R),R.Jb!=null&&R.Jb(P,R,Y),R.Dc+=Y,1)}function ca(P){P.ma.memory=null}function Fa(P,R,Y,ne){return B(P,8)!=47?0:(R[0]=B(P,14)+1,Y[0]=B(P,14)+1,ne[0]=B(P,1),B(P,3)!=0?0:!P.h)}function Kr(P,R){if(4>P)return P+1;var Y=P-2>>1;return(2+(1&P)<<Y)+B(R,Y)+1}function Yi(P,R){return 120<R?R-120:1<=(Y=((Y=Ch[R-1])>>4)*P+(8-(15&Y)))?Y:1;var Y}function Un(P,R,Y){var ne=X(Y),le=P[R+=255&ne].g-8;return 0<le&&(K(Y,Y.u+8),ne=X(Y),R+=P[R].value,R+=ne&(1<<le)-1),K(Y,Y.u+P[R].g),P[R].value}function Er(P,R,Y){return Y.g+=P.g,Y.value+=P.value<<R>>>0,e(8>=Y.g),P.g}function Rr(P,R,Y){var ne=P.xc;return e((R=ne==0?0:P.vc[P.md*(Y>>ne)+(R>>ne)])<P.Wb),P.Ya[R]}function Sa(P,R,Y,ne){var le=P.ab,pe=P.c*R,ve=P.C;R=ve+R;var be=Y,we=ne;for(ne=P.Ta,Y=P.Ua;0<le--;){var Se=P.gc[le],Fe=ve,Je=R,xe=be,$e=we,Qe=(we=ne,be=Y,Se.Ea);switch(e(Fe<Je),e(Je<=Se.nc),Se.hc){case 2:Jr(xe,$e,(Je-Fe)*Qe,we,be);break;case 0:var lt=Fe,Xe=Je,ot=we,He=be,ft=(zt=Se).Ea;lt==0&&(ps(xe,$e,null,null,1,ot,He),dt(xe,$e+1,0,0,ft-1,ot,He+1),$e+=ft,He+=ft,++lt);for(var ht=1<<zt.b,Wt=ht-1,Bt=fe(ft,zt.b),dn=zt.K,zt=zt.w+(lt>>zt.b)*Bt;lt<Xe;){var On=dn,qr=zt,mn=1;for(lo(xe,$e,ot,He-ft,1,ot,He);mn<ft;){var Ft=(mn&~Wt)+ht;Ft>ft&&(Ft=ft),(0,da[On[qr++]>>8&15])(xe,$e+ +mn,ot,He+mn-ft,Ft-mn,ot,He+mn),mn=Ft}$e+=ft,He+=ft,++lt&Wt||(zt+=Bt)}Je!=Se.nc&&r(we,be-Qe,we,be+(Je-Fe-1)*Qe,Qe);break;case 1:for(Qe=xe,Xe=$e,ft=(xe=Se.Ea)-(He=xe&~(ot=($e=1<<Se.b)-1)),lt=fe(xe,Se.b),ht=Se.K,Se=Se.w+(Fe>>Se.b)*lt;Fe<Je;){for(Wt=ht,Bt=Se,dn=new ue,zt=Xe+He,On=Xe+xe;Xe<zt;)xt(Wt[Bt++],dn),yl(dn,Qe,Xe,$e,we,be),Xe+=$e,be+=$e;Xe<On&&(xt(Wt[Bt++],dn),yl(dn,Qe,Xe,ft,we,be),Xe+=ft,be+=ft),++Fe&ot||(Se+=lt)}break;case 3:if(xe==we&&$e==be&&0<Se.b){for(Xe=we,xe=Qe=be+(Je-Fe)*Qe-(He=(Je-Fe)*fe(Se.Ea,Se.b)),$e=we,ot=be,lt=[],He=(ft=He)-1;0<=He;--He)lt[He]=$e[ot+He];for(He=ft-1;0<=He;--He)Xe[xe+He]=lt[He];Wo(Se,Fe,Je,we,Qe,we,be)}else Wo(Se,Fe,Je,xe,$e,we,be)}be=ne,we=Y}we!=Y&&r(ne,Y,be,we,pe)}function Ho(P,R){var Y=P.V,ne=P.Ba+P.c*P.C,le=R-P.C;if(e(R<=P.l.o),e(16>=le),0<le){var pe=P.l,ve=P.Ta,be=P.Ua,we=pe.width;if(Sa(P,le,Y,ne),le=be=[be],e((Y=P.C)<(ne=R)),e(pe.v<pe.va),ne>pe.o&&(ne=pe.o),Y<pe.j){var Se=pe.j-Y;Y=pe.j,le[0]+=Se*we}if(Y>=ne?Y=0:(le[0]+=4*pe.v,pe.ka=Y-pe.j,pe.U=pe.va-pe.v,pe.T=ne-Y,Y=1),Y){if(be=be[0],11>(Y=P.ca).S){var Fe=Y.f.RGBA,Je=(ne=Y.S,le=pe.U,pe=pe.T,Se=Fe.eb,Fe.A),xe=pe;for(Fe=Fe.fb+P.Ma*Fe.A;0<xe--;){var $e=ve,Qe=be,lt=le,Xe=Se,ot=Fe;switch(ne){case Bl:Vo($e,Qe,lt,Xe,ot);break;case Ko:gs($e,Qe,lt,Xe,ot);break;case ql:gs($e,Qe,lt,Xe,ot),Yo(Xe,ot,0,lt,1,0);break;case Rf:ms($e,Qe,lt,Xe,ot);break;case zl:qe($e,Qe,lt,Xe,ot,1);break;case Ws:qe($e,Qe,lt,Xe,ot,1),Yo(Xe,ot,0,lt,1,0);break;case gu:qe($e,Qe,lt,Xe,ot,0);break;case vu:qe($e,Qe,lt,Xe,ot,0),Yo(Xe,ot,1,lt,1,0);break;case fr:vs($e,Qe,lt,Xe,ot);break;case mu:vs($e,Qe,lt,Xe,ot),Ku(Xe,ot,lt,1,0);break;case Zu:tr($e,Qe,lt,Xe,ot);break;default:e(0)}be+=we,Fe+=Je}P.Ma+=pe}else alert("todo:EmitRescaledRowsYUVA");e(P.Ma<=Y.height)}}P.C=R,e(P.C<=P.i)}function Ea(P){var R;if(0<P.ua)return 0;for(R=0;R<P.Wb;++R){var Y=P.Ya[R].G,ne=P.Ya[R].H;if(0<Y[1][ne[1]+0].g||0<Y[2][ne[2]+0].g||0<Y[3][ne[3]+0].g)return 0}return 1}function eo(P,R,Y,ne,le,pe){if(P.Z!=0){var ve=P.qd,be=P.rd;for(e(na[P.Z]!=null);R<Y;++R)na[P.Z](ve,be,ne,le,ne,le,pe),ve=ne,be=le,le+=pe;P.qd=ve,P.rd=be}}function si(P,R){var Y=P.l.ma,ne=Y.Z==0||Y.Z==1?P.l.j:P.C;if(ne=P.C<ne?ne:P.C,e(R<=P.l.o),R>ne){var le=P.l.width,pe=Y.ca,ve=Y.tb+le*ne,be=P.V,we=P.Ba+P.c*ne,Se=P.gc;e(P.ab==1),e(Se[0].hc==3),Ta(Se[0],ne,R,be,we,pe,ve),eo(Y,ne,R,pe,ve,le)}P.C=P.Ma=R}function ka(P,R,Y,ne,le,pe,ve){var be=P.$/ne,we=P.$%ne,Se=P.m,Fe=P.s,Je=Y+P.$,xe=Je;le=Y+ne*le;var $e=Y+ne*pe,Qe=280+Fe.ua,lt=P.Pb?be:16777216,Xe=0<Fe.ua?Fe.Wa:null,ot=Fe.wc,He=Je<$e?Rr(Fe,we,be):null;e(P.C<pe),e($e<=le);var ft=!1;e:for(;;){for(;ft||Je<$e;){var ht=0;if(be>=lt){var Wt=Je-Y;e((lt=P).Pb),lt.wd=lt.m,lt.xd=Wt,0<lt.s.ua&&Te(lt.s.Wa,lt.s.vb),lt=be+Qu}if(we&ot||(He=Rr(Fe,we,be)),e(He!=null),He.Qb&&(R[Je]=He.qb,ft=!0),!ft)if(oe(Se),He.jc){ht=Se,Wt=R;var Bt=Je,dn=He.pd[X(ht)&Oi-1];e(He.jc),256>dn.g?(K(ht,ht.u+dn.g),Wt[Bt]=dn.value,ht=0):(K(ht,ht.u+dn.g-256),e(256<=dn.value),ht=dn.value),ht==0&&(ft=!0)}else ht=Un(He.G[0],He.H[0],Se);if(Se.h)break;if(ft||256>ht){if(!ft)if(He.nd)R[Je]=(He.qb|ht<<8)>>>0;else{if(oe(Se),ft=Un(He.G[1],He.H[1],Se),oe(Se),Wt=Un(He.G[2],He.H[2],Se),Bt=Un(He.G[3],He.H[3],Se),Se.h)break;R[Je]=(Bt<<24|ft<<16|ht<<8|Wt)>>>0}if(ft=!1,++Je,++we>=ne&&(we=0,++be,ve!=null&&be<=pe&&!(be%16)&&ve(P,be),Xe!=null))for(;xe<Je;)ht=R[xe++],Xe.X[(506832829*ht&4294967295)>>>Xe.Mb]=ht}else if(280>ht){if(ht=Kr(ht-256,Se),Wt=Un(He.G[4],He.H[4],Se),oe(Se),Wt=Yi(ne,Wt=Kr(Wt,Se)),Se.h)break;if(Je-Y<Wt||le-Je<ht)break e;for(Bt=0;Bt<ht;++Bt)R[Je+Bt]=R[Je+Bt-Wt];for(Je+=ht,we+=ht;we>=ne;)we-=ne,++be,ve!=null&&be<=pe&&!(be%16)&&ve(P,be);if(e(Je<=le),we&ot&&(He=Rr(Fe,we,be)),Xe!=null)for(;xe<Je;)ht=R[xe++],Xe.X[(506832829*ht&4294967295)>>>Xe.Mb]=ht}else{if(!(ht<Qe))break e;for(ft=ht-280,e(Xe!=null);xe<Je;)ht=R[xe++],Xe.X[(506832829*ht&4294967295)>>>Xe.Mb]=ht;ht=Je,e(!(ft>>>(Wt=Xe).Xa)),R[ht]=Wt.X[ft],ft=!0}ft||e(Se.h==ee(Se))}if(P.Pb&&Se.h&&Je<le)e(P.m.h),P.a=5,P.m=P.wd,P.$=P.xd,0<P.s.ua&&Te(P.s.vb,P.s.Wa);else{if(Se.h)break e;ve?.(P,be>pe?pe:be),P.a=0,P.$=Je-Y}return 1}return P.a=3,0}function Aa(P){e(P!=null),P.vc=null,P.yc=null,P.Ya=null;var R=P.Wa;R!=null&&(R.X=null),P.vb=null,e(P!=null)}function $o(){var P=new jt;return P==null?null:(P.a=0,P.xb=bu,Nt("Predictor","VP8LPredictors"),Nt("Predictor","VP8LPredictors_C"),Nt("PredictorAdd","VP8LPredictorsAdd"),Nt("PredictorAdd","VP8LPredictorsAdd_C"),Jr=pt,yl=bt,Vo=qn,gs=xn,vs=It,tr=Jt,ms=Ve,F.VP8LMapColor32b=ci,F.VP8LMapColor8b=To,P)}function zi(P,R,Y,ne,le){var pe=1,ve=[P],be=[R],we=ne.m,Se=ne.s,Fe=null,Je=0;e:for(;;){if(Y)for(;pe&&B(we,1);){var xe=ve,$e=be,Qe=ne,lt=1,Xe=Qe.m,ot=Qe.gc[Qe.ab],He=B(Xe,2);if(Qe.Oc&1<<He)pe=0;else{switch(Qe.Oc|=1<<He,ot.hc=He,ot.Ea=xe[0],ot.nc=$e[0],ot.K=[null],++Qe.ab,e(4>=Qe.ab),He){case 0:case 1:ot.b=B(Xe,3)+2,lt=zi(fe(ot.Ea,ot.b),fe(ot.nc,ot.b),0,Qe,ot.K),ot.K=ot.K[0];break;case 3:var ft,ht=B(Xe,8)+1,Wt=16<ht?0:4<ht?1:2<ht?2:3;if(xe[0]=fe(ot.Ea,Wt),ot.b=Wt,ft=lt=zi(ht,1,0,Qe,ot.K)){var Bt,dn=ht,zt=ot,On=1<<(8>>zt.b),qr=a(On);if(qr==null)ft=0;else{var mn=zt.K[0],Ft=zt.w;for(qr[0]=zt.K[0][0],Bt=1;Bt<1*dn;++Bt)qr[Bt]=Le(mn[Ft+Bt],qr[Bt-1]);for(;Bt<4*On;++Bt)qr[Bt]=0;zt.K[0]=null,zt.K[0]=qr,ft=1}}lt=ft;break;case 2:break;default:e(0)}pe=lt}}if(ve=ve[0],be=be[0],pe&&B(we,1)&&!(pe=1<=(Je=B(we,4))&&11>=Je)){ne.a=3;break e}var St;if(St=pe)t:{var Ur,Ht,pn,In=ne,bi=ve,fi=be,$n=Je,wi=Y,vr=In.m,jr=In.s,Tn=[null],Wn=1,Or=0,Vn=Mf[$n];n:for(;;){if(wi&&B(vr,1)){var Cr=B(vr,3)+2,Lr=fe(bi,Cr),rr=fe(fi,Cr),Ti=Lr*rr;if(!zi(Lr,rr,0,In,Tn))break n;for(Tn=Tn[0],jr.xc=Cr,Ur=0;Ur<Ti;++Ur){var Zn=Tn[Ur]>>8&65535;Tn[Ur]=Zn,Zn>=Wn&&(Wn=Zn+1)}}if(vr.h)break n;for(Ht=0;5>Ht;++Ht){var Qn=wl[Ht];!Ht&&0<$n&&(Qn+=1<<$n),Or<Qn&&(Or=Qn)}var ei=o(Wn*Vn,$),Ri=Wn,ya=o(Ri,J);if(ya==null)var ti=null;else e(65536>=Ri),ti=ya;var Hr=a(Or);if(ti==null||Hr==null||ei==null){In.a=1;break n}var ba=ei;for(Ur=pn=0;Ur<Wn;++Ur){var ir=ti[Ur],$i=ir.G,Yn=ir.H,ln=0,jn=1,An=0;for(Ht=0;5>Ht;++Ht){Qn=wl[Ht],$i[Ht]=ba,Yn[Ht]=pn,!Ht&&0<$n&&(Qn+=1<<$n);i:{var Dr,hi=Qn,Zo=In,hr=Hr,xu=ba,Xs=pn,dr=0,fo=Zo.m,Gl=B(fo,1);if(i(hr,0,0,hi),Gl){var wa=B(fo,1)+1,Su=B(fo,1),Eu=B(fo,Su==0?1:8);hr[Eu]=1,wa==2&&(hr[Eu=B(fo,8)]=1);var Gi=1}else{var lr=a(19),$r=B(fo,4)+4;if(19<$r){Zo.a=3;var Gr=0;break i}for(Dr=0;Dr<$r;++Dr)lr[Pd[Dr]]=B(fo,3);var ho=void 0,Io=void 0,po=Zo,qc=lr,Wr=hi,ku=hr,xl=0,go=po.m,xr=8,_i=o(128,$);r:for(;L(_i,0,7,qc,19);){if(B(go,1)){var _a=2+2*B(go,3);if((ho=2+B(go,_a))>Wr)break r}else ho=Wr;for(Io=0;Io<Wr&&ho--;){oe(go);var ra=_i[0+(127&X(go))];K(go,go.u+ra.g);var Ks=ra.value;if(16>Ks)ku[Io++]=Ks,Ks!=0&&(xr=Ks);else{var Uc=Ks==16,nc=Ks-16,Ih=Dc[nc],Es=B(go,yu[nc])+Ih;if(Io+Es>Wr)break r;for(var Df=Uc?xr:0;0<Es--;)ku[Io++]=Df}}xl=1;break r}xl||(po.a=3),Gi=xl}(Gi=Gi&&!fo.h)&&(dr=L(xu,Xs,8,hr,hi)),Gi&&dr!=0?Gr=dr:(Zo.a=3,Gr=0)}if(Gr==0)break n;if(jn&&Oh[Ht]==1&&(jn=ba[pn].g==0),ln+=ba[pn].g,pn+=Gr,3>=Ht){var Wl,Au=Hr[0];for(Wl=1;Wl<Qn;++Wl)Hr[Wl]>Au&&(Au=Hr[Wl]);An+=Au}}if(ir.nd=jn,ir.Qb=0,jn&&(ir.qb=($i[3][Yn[3]+0].value<<24|$i[1][Yn[1]+0].value<<16|$i[2][Yn[2]+0].value)>>>0,ln==0&&256>$i[0][Yn[0]+0].value&&(ir.Qb=1,ir.qb+=$i[0][Yn[0]+0].value<<8)),ir.jc=!ir.Qb&&6>An,ir.jc){var Qo,Xa=ir;for(Qo=0;Qo<Oi;++Qo){var ks=Qo,vo=Xa.pd[ks],As=Xa.G[0][Xa.H[0]+ks];256<=As.value?(vo.g=As.g+256,vo.value=As.value):(vo.g=0,vo.value=0,ks>>=Er(As,8,vo),ks>>=Er(Xa.G[1][Xa.H[1]+ks],16,vo),ks>>=Er(Xa.G[2][Xa.H[2]+ks],0,vo),Er(Xa.G[3][Xa.H[3]+ks],24,vo))}}}jr.vc=Tn,jr.Wb=Wn,jr.Ya=ti,jr.yc=ei,St=1;break t}St=0}if(!(pe=St)){ne.a=3;break e}if(0<Je){if(Se.ua=1<<Je,!ge(Se.Wa,Je)){ne.a=1,pe=0;break e}}else Se.ua=0;var Hc=ne,$c=ve,Ff=be,rc=Hc.s,Ps=rc.xc;if(Hc.c=$c,Hc.i=Ff,rc.md=fe($c,Ps),rc.wc=Ps==0?-1:(1<<Ps)-1,Y){ne.xb=Ro;break e}if((Fe=a(ve*be))==null){ne.a=1,pe=0;break e}pe=(pe=ka(ne,Fe,0,ve,be,be,null))&&!we.h;break e}return pe?(le!=null?le[0]=Fe:(e(Fe==null),e(Y)),ne.$=0,Y||Aa(Se)):Aa(Se),pe}function to(P,R){var Y=P.c*P.i,ne=Y+R+16*R;return e(P.c<=R),P.V=a(ne),P.V==null?(P.Ta=null,P.Ua=0,P.a=1,0):(P.Ta=P.V,P.Ua=P.Ba+Y+R,1)}function Bs(P,R){var Y=P.C,ne=R-Y,le=P.V,pe=P.Ba+P.c*Y;for(e(R<=P.l.o);0<ne;){var ve=16<ne?16:ne,be=P.l.ma,we=P.l.width,Se=we*ve,Fe=be.ca,Je=be.tb+we*Y,xe=P.Ta,$e=P.Ua;Sa(P,ve,le,pe),Nc(xe,$e,Fe,Je,Se),eo(be,Y,Y+ve,Fe,Je,we),ne-=ve,le+=ve*P.c,Y+=ve}e(Y==R),P.C=P.Ma=R}function is(){this.ub=this.yd=this.td=this.Rb=0}function lu(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function Tf(){this.Fb=this.Bb=this.Cb=0,this.Zb=a(4),this.Lb=a(4)}function kr(){this.Yb=(function(){var P=[];return(function R(Y,ne,le){for(var pe=le[ne],ve=0;ve<pe&&(Y.push(le.length>ne+1?[]:0),!(le.length<ne+1));ve++)R(Y[ve],ne+1,le)})(P,0,[3,11]),P})()}function uu(){this.jb=a(3),this.Wc=s([4,8],kr),this.Xc=s([4,17],kr)}function as(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new a(4),this.od=new a(4)}function Pa(){this.ld=this.La=this.dd=this.tc=0}function os(){this.Na=this.la=0}function kc(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function ll(){this.ad=a(384),this.Za=0,this.Ob=a(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function _o(){this.uc=this.M=this.Nb=0,this.wa=Array(new Pa),this.Y=0,this.ya=Array(new ll),this.aa=0,this.l=new En}function gi(){this.y=a(16),this.f=a(8),this.ea=a(8)}function cr(){this.cb=this.a=0,this.sc="",this.m=new D,this.Od=new is,this.Kc=new lu,this.ed=new as,this.Qa=new Tf,this.Ic=this.$c=this.Aa=0,this.D=new _o,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=o(8,D),this.ia=0,this.pb=o(4,kc),this.Pa=new uu,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new gi),this.Hd=0,this.rb=Array(new os),this.sb=0,this.wa=Array(new Pa),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new ll),this.L=this.aa=0,this.gd=s([4,2],Pa),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function En(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function ss(){var P=new cr;return P!=null&&(P.a=0,P.sc="OK",P.cb=0,P.Xb=0,Ul||(Ul=Ki)),P}function Rn(P,R,Y){return P.a==0&&(P.a=R,P.sc=Y,P.cb=0),0}function Xi(P,R,Y){return 3<=Y&&P[R+0]==157&&P[R+1]==1&&P[R+2]==42}function no(P,R){if(P==null)return 0;if(P.a=0,P.sc="OK",R==null)return Rn(P,2,"null VP8Io passed to VP8GetHeaders()");var Y=R.data,ne=R.w,le=R.ha;if(4>le)return Rn(P,7,"Truncated header.");var pe=Y[ne+0]|Y[ne+1]<<8|Y[ne+2]<<16,ve=P.Od;if(ve.Rb=!(1&pe),ve.td=pe>>1&7,ve.yd=pe>>4&1,ve.ub=pe>>5,3<ve.td)return Rn(P,3,"Incorrect keyframe parameters.");if(!ve.yd)return Rn(P,4,"Frame not displayable.");ne+=3,le-=3;var be=P.Kc;if(ve.Rb){if(7>le)return Rn(P,7,"cannot parse picture header");if(!Xi(Y,ne,le))return Rn(P,3,"Bad code word");be.c=16383&(Y[ne+4]<<8|Y[ne+3]),be.Td=Y[ne+4]>>6,be.i=16383&(Y[ne+6]<<8|Y[ne+5]),be.Ud=Y[ne+6]>>6,ne+=7,le-=7,P.za=be.c+15>>4,P.Ub=be.i+15>>4,R.width=be.c,R.height=be.i,R.Da=0,R.j=0,R.v=0,R.va=R.width,R.o=R.height,R.da=0,R.ib=R.width,R.hb=R.height,R.U=R.width,R.T=R.height,i((pe=P.Pa).jb,0,255,pe.jb.length),e((pe=P.Qa)!=null),pe.Cb=0,pe.Bb=0,pe.Fb=1,i(pe.Zb,0,0,pe.Zb.length),i(pe.Lb,0,0,pe.Lb)}if(ve.ub>le)return Rn(P,7,"bad partition length");ae(pe=P.m,Y,ne,ve.ub),ne+=ve.ub,le-=ve.ub,ve.Rb&&(be.Ld=de(pe),be.Kd=de(pe)),be=P.Qa;var we,Se=P.Pa;if(e(pe!=null),e(be!=null),be.Cb=de(pe),be.Cb){if(be.Bb=de(pe),de(pe)){for(be.Fb=de(pe),we=0;4>we;++we)be.Zb[we]=de(pe)?Z(pe,7):0;for(we=0;4>we;++we)be.Lb[we]=de(pe)?Z(pe,6):0}if(be.Bb)for(we=0;3>we;++we)Se.jb[we]=de(pe)?ie(pe,8):255}else be.Bb=0;if(pe.Ka)return Rn(P,3,"cannot parse segment header");if((be=P.ed).zd=de(pe),be.Tb=ie(pe,6),be.wb=ie(pe,3),be.Pc=de(pe),be.Pc&&de(pe)){for(Se=0;4>Se;++Se)de(pe)&&(be.vd[Se]=Z(pe,6));for(Se=0;4>Se;++Se)de(pe)&&(be.od[Se]=Z(pe,6))}if(P.L=be.Tb==0?0:be.zd?1:2,pe.Ka)return Rn(P,3,"cannot parse filter header");var Fe=le;if(le=we=ne,ne=we+Fe,be=Fe,P.Xb=(1<<ie(P.m,2))-1,Fe<3*(Se=P.Xb))Y=7;else{for(we+=3*Se,be-=3*Se,Fe=0;Fe<Se;++Fe){var Je=Y[le+0]|Y[le+1]<<8|Y[le+2]<<16;Je>be&&(Je=be),ae(P.Jc[+Fe],Y,we,Je),we+=Je,be-=Je,le+=3}ae(P.Jc[+Se],Y,we,be),Y=we<ne?0:5}if(Y!=0)return Rn(P,Y,"cannot parse partitions");for(Y=ie(we=P.m,7),le=de(we)?Z(we,4):0,ne=de(we)?Z(we,4):0,be=de(we)?Z(we,4):0,Se=de(we)?Z(we,4):0,we=de(we)?Z(we,4):0,Fe=P.Qa,Je=0;4>Je;++Je){if(Fe.Cb){var xe=Fe.Zb[Je];Fe.Fb||(xe+=Y)}else{if(0<Je){P.pb[Je]=P.pb[0];continue}xe=Y}var $e=P.pb[Je];$e.Sc[0]=Vs[zr(xe+le,127)],$e.Sc[1]=Ju[zr(xe+0,127)],$e.Eb[0]=2*Vs[zr(xe+ne,127)],$e.Eb[1]=101581*Ju[zr(xe+be,127)]>>16,8>$e.Eb[1]&&($e.Eb[1]=8),$e.Qc[0]=Vs[zr(xe+Se,117)],$e.Qc[1]=Ju[zr(xe+we,127)],$e.lc=xe+we}if(!ve.Rb)return Rn(P,4,"Not a key frame.");for(de(pe),ve=P.Pa,Y=0;4>Y;++Y){for(le=0;8>le;++le)for(ne=0;3>ne;++ne)for(be=0;11>be;++be)Se=ye(pe,Nh[Y][le][ne][be])?ie(pe,8):ec[Y][le][ne][be],ve.Wc[Y][le].Yb[ne][be]=Se;for(le=0;17>le;++le)ve.Xc[Y][le]=ve.Wc[Y][Bc[le]]}return P.kc=de(pe),P.kc&&(P.Bd=ie(pe,8)),P.cb=1}function Ki(P,R,Y,ne,le,pe,ve){var be=R[le].Yb[Y];for(Y=0;16>le;++le){if(!ye(P,be[Y+0]))return le;for(;!ye(P,be[Y+1]);)if(be=R[++le].Yb[0],Y=0,le==16)return 16;var we=R[le+1].Yb;if(ye(P,be[Y+2])){var Se=P,Fe=0;if(ye(Se,(xe=be)[(Je=Y)+3]))if(ye(Se,xe[Je+6])){for(be=0,Je=2*(Fe=ye(Se,xe[Je+8]))+(xe=ye(Se,xe[Je+9+Fe])),Fe=0,xe=If[Je];xe[be];++be)Fe+=Fe+ye(Se,xe[be]);Fe+=3+(8<<Je)}else ye(Se,xe[Je+7])?(Fe=7+2*ye(Se,165),Fe+=ye(Se,145)):Fe=5+ye(Se,159);else Fe=ye(Se,xe[Je+4])?3+ye(Se,xe[Je+5]):2;be=we[2]}else Fe=1,be=we[1];we=ve+co[le],0>(Se=P).b&&me(Se);var Je,xe=Se.b,$e=(Je=Se.Ca>>1)-(Se.I>>xe)>>31;--Se.b,Se.Ca+=$e,Se.Ca|=1,Se.I-=(Je+1&$e)<<xe,pe[we]=((Fe^$e)-$e)*ne[(0<le)+0]}return 16}function Mr(P){var R=P.rb[P.sb-1];R.la=0,R.Na=0,i(P.zc,0,0,P.zc.length),P.ja=0}function Zi(P,R,Y,ne,le){le=P[R+Y+32*ne]+(le>>3),P[R+Y+32*ne]=-256&le?0>le?0:255:le}function ul(P,R,Y,ne,le,pe){Zi(P,R,0,Y,ne+le),Zi(P,R,1,Y,ne+pe),Zi(P,R,2,Y,ne-pe),Zi(P,R,3,Y,ne-le)}function Zr(P){return(20091*P>>16)+P}function ls(P,R,Y,ne){var le,pe=0,ve=a(16);for(le=0;4>le;++le){var be=P[R+0]+P[R+8],we=P[R+0]-P[R+8],Se=(35468*P[R+4]>>16)-Zr(P[R+12]),Fe=Zr(P[R+4])+(35468*P[R+12]>>16);ve[pe+0]=be+Fe,ve[pe+1]=we+Se,ve[pe+2]=we-Se,ve[pe+3]=be-Fe,pe+=4,R++}for(le=pe=0;4>le;++le)be=(P=ve[pe+0]+4)+ve[pe+8],we=P-ve[pe+8],Se=(35468*ve[pe+4]>>16)-Zr(ve[pe+12]),Zi(Y,ne,0,0,be+(Fe=Zr(ve[pe+4])+(35468*ve[pe+12]>>16))),Zi(Y,ne,1,0,we+Se),Zi(Y,ne,2,0,we-Se),Zi(Y,ne,3,0,be-Fe),pe++,ne+=32}function Vu(P,R,Y,ne){var le=P[R+0]+4,pe=35468*P[R+4]>>16,ve=Zr(P[R+4]),be=35468*P[R+1]>>16;ul(Y,ne,0,le+ve,P=Zr(P[R+1]),be),ul(Y,ne,1,le+pe,P,be),ul(Y,ne,2,le-pe,P,be),ul(Y,ne,3,le-ve,P,be)}function Oa(P,R,Y,ne,le){ls(P,R,Y,ne),le&&ls(P,R+16,Y,ne+4)}function Tl(P,R,Y,ne){Hs(P,R+0,Y,ne,1),Hs(P,R+32,Y,ne+128,1)}function us(P,R,Y,ne){var le;for(P=P[R+0]+4,le=0;4>le;++le)for(R=0;4>R;++R)Zi(Y,ne,R,le,P)}function cu(P,R,Y,ne){P[R+0]&&Ln(P,R+0,Y,ne),P[R+16]&&Ln(P,R+16,Y,ne+4),P[R+32]&&Ln(P,R+32,Y,ne+128),P[R+48]&&Ln(P,R+48,Y,ne+128+4)}function Mn(P,R,Y,ne){var le,pe=a(16);for(le=0;4>le;++le){var ve=P[R+0+le]+P[R+12+le],be=P[R+4+le]+P[R+8+le],we=P[R+4+le]-P[R+8+le],Se=P[R+0+le]-P[R+12+le];pe[0+le]=ve+be,pe[8+le]=ve-be,pe[4+le]=Se+we,pe[12+le]=Se-we}for(le=0;4>le;++le)ve=(P=pe[0+4*le]+3)+pe[3+4*le],be=pe[1+4*le]+pe[2+4*le],we=pe[1+4*le]-pe[2+4*le],Se=P-pe[3+4*le],Y[ne+0]=ve+be>>3,Y[ne+16]=Se+we>>3,Y[ne+32]=ve-be>>3,Y[ne+48]=Se-we>>3,ne+=64}function xo(P,R,Y){var ne,le=R-32,pe=Li,ve=255-P[le-1];for(ne=0;ne<Y;++ne){var be,we=pe,Se=ve+P[R-1];for(be=0;be<Y;++be)P[R+be]=we[Se+P[le+be]];R+=32}}function cs(P,R){xo(P,R,4)}function cl(P,R){xo(P,R,8)}function Ac(P,R){xo(P,R,16)}function Pc(P,R){var Y;for(Y=0;16>Y;++Y)r(P,R+32*Y,P,R-32,16)}function fl(P,R){var Y;for(Y=16;0<Y;--Y)i(P,R,P[R-1],16),R+=32}function fs(P,R,Y){var ne;for(ne=0;16>ne;++ne)i(R,Y+32*ne,P,16)}function ro(P,R){var Y,ne=16;for(Y=0;16>Y;++Y)ne+=P[R-1+32*Y]+P[R+Y-32];fs(ne>>5,P,R)}function Ba(P,R){var Y,ne=8;for(Y=0;16>Y;++Y)ne+=P[R-1+32*Y];fs(ne>>4,P,R)}function za(P,R){var Y,ne=8;for(Y=0;16>Y;++Y)ne+=P[R+Y-32];fs(ne>>4,P,R)}function qa(P,R){fs(128,P,R)}function Pt(P,R,Y){return P+2*R+Y+2>>2}function hl(P,R){var Y,ne=R-32;for(ne=new Uint8Array([Pt(P[ne-1],P[ne+0],P[ne+1]),Pt(P[ne+0],P[ne+1],P[ne+2]),Pt(P[ne+1],P[ne+2],P[ne+3]),Pt(P[ne+2],P[ne+3],P[ne+4])]),Y=0;4>Y;++Y)r(P,R+32*Y,ne,0,ne.length)}function So(P,R){var Y=P[R-1],ne=P[R-1+32],le=P[R-1+64],pe=P[R-1+96];Re(P,R+0,16843009*Pt(P[R-1-32],Y,ne)),Re(P,R+32,16843009*Pt(Y,ne,le)),Re(P,R+64,16843009*Pt(ne,le,pe)),Re(P,R+96,16843009*Pt(le,pe,pe))}function Oc(P,R){var Y,ne=4;for(Y=0;4>Y;++Y)ne+=P[R+Y-32]+P[R-1+32*Y];for(ne>>=3,Y=0;4>Y;++Y)i(P,R+32*Y,ne,4)}function Cc(P,R){var Y=P[R-1+0],ne=P[R-1+32],le=P[R-1+64],pe=P[R-1-32],ve=P[R+0-32],be=P[R+1-32],we=P[R+2-32],Se=P[R+3-32];P[R+0+96]=Pt(ne,le,P[R-1+96]),P[R+1+96]=P[R+0+64]=Pt(Y,ne,le),P[R+2+96]=P[R+1+64]=P[R+0+32]=Pt(pe,Y,ne),P[R+3+96]=P[R+2+64]=P[R+1+32]=P[R+0+0]=Pt(ve,pe,Y),P[R+3+64]=P[R+2+32]=P[R+1+0]=Pt(be,ve,pe),P[R+3+32]=P[R+2+0]=Pt(we,be,ve),P[R+3+0]=Pt(Se,we,be)}function io(P,R){var Y=P[R+1-32],ne=P[R+2-32],le=P[R+3-32],pe=P[R+4-32],ve=P[R+5-32],be=P[R+6-32],we=P[R+7-32];P[R+0+0]=Pt(P[R+0-32],Y,ne),P[R+1+0]=P[R+0+32]=Pt(Y,ne,le),P[R+2+0]=P[R+1+32]=P[R+0+64]=Pt(ne,le,pe),P[R+3+0]=P[R+2+32]=P[R+1+64]=P[R+0+96]=Pt(le,pe,ve),P[R+3+32]=P[R+2+64]=P[R+1+96]=Pt(pe,ve,be),P[R+3+64]=P[R+2+96]=Pt(ve,be,we),P[R+3+96]=Pt(be,we,we)}function wr(P,R){var Y=P[R-1+0],ne=P[R-1+32],le=P[R-1+64],pe=P[R-1-32],ve=P[R+0-32],be=P[R+1-32],we=P[R+2-32],Se=P[R+3-32];P[R+0+0]=P[R+1+64]=pe+ve+1>>1,P[R+1+0]=P[R+2+64]=ve+be+1>>1,P[R+2+0]=P[R+3+64]=be+we+1>>1,P[R+3+0]=we+Se+1>>1,P[R+0+96]=Pt(le,ne,Y),P[R+0+64]=Pt(ne,Y,pe),P[R+0+32]=P[R+1+96]=Pt(Y,pe,ve),P[R+1+32]=P[R+2+96]=Pt(pe,ve,be),P[R+2+32]=P[R+3+96]=Pt(ve,be,we),P[R+3+32]=Pt(be,we,Se)}function fu(P,R){var Y=P[R+0-32],ne=P[R+1-32],le=P[R+2-32],pe=P[R+3-32],ve=P[R+4-32],be=P[R+5-32],we=P[R+6-32],Se=P[R+7-32];P[R+0+0]=Y+ne+1>>1,P[R+1+0]=P[R+0+64]=ne+le+1>>1,P[R+2+0]=P[R+1+64]=le+pe+1>>1,P[R+3+0]=P[R+2+64]=pe+ve+1>>1,P[R+0+32]=Pt(Y,ne,le),P[R+1+32]=P[R+0+96]=Pt(ne,le,pe),P[R+2+32]=P[R+1+96]=Pt(le,pe,ve),P[R+3+32]=P[R+2+96]=Pt(pe,ve,be),P[R+3+64]=Pt(ve,be,we),P[R+3+96]=Pt(be,we,Se)}function hu(P,R){var Y=P[R-1+0],ne=P[R-1+32],le=P[R-1+64],pe=P[R-1+96];P[R+0+0]=Y+ne+1>>1,P[R+2+0]=P[R+0+32]=ne+le+1>>1,P[R+2+32]=P[R+0+64]=le+pe+1>>1,P[R+1+0]=Pt(Y,ne,le),P[R+3+0]=P[R+1+32]=Pt(ne,le,pe),P[R+3+32]=P[R+1+64]=Pt(le,pe,pe),P[R+3+64]=P[R+2+64]=P[R+0+96]=P[R+1+96]=P[R+2+96]=P[R+3+96]=pe}function zs(P,R){var Y=P[R-1+0],ne=P[R-1+32],le=P[R-1+64],pe=P[R-1+96],ve=P[R-1-32],be=P[R+0-32],we=P[R+1-32],Se=P[R+2-32];P[R+0+0]=P[R+2+32]=Y+ve+1>>1,P[R+0+32]=P[R+2+64]=ne+Y+1>>1,P[R+0+64]=P[R+2+96]=le+ne+1>>1,P[R+0+96]=pe+le+1>>1,P[R+3+0]=Pt(be,we,Se),P[R+2+0]=Pt(ve,be,we),P[R+1+0]=P[R+3+32]=Pt(Y,ve,be),P[R+1+32]=P[R+3+64]=Pt(ne,Y,ve),P[R+1+64]=P[R+3+96]=Pt(le,ne,Y),P[R+1+96]=Pt(pe,le,ne)}function Yu(P,R){var Y;for(Y=0;8>Y;++Y)r(P,R+32*Y,P,R-32,8)}function Ua(P,R){var Y;for(Y=0;8>Y;++Y)i(P,R,P[R-1],8),R+=32}function ki(P,R,Y){var ne;for(ne=0;8>ne;++ne)i(R,Y+32*ne,P,8)}function Go(P,R){var Y,ne=8;for(Y=0;8>Y;++Y)ne+=P[R+Y-32]+P[R-1+32*Y];ki(ne>>4,P,R)}function du(P,R){var Y,ne=4;for(Y=0;8>Y;++Y)ne+=P[R+Y-32];ki(ne>>3,P,R)}function Ca(P,R){var Y,ne=4;for(Y=0;8>Y;++Y)ne+=P[R-1+32*Y];ki(ne>>3,P,R)}function ao(P,R){ki(128,P,R)}function Eo(P,R,Y){var ne=P[R-Y],le=P[R+0],pe=3*(le-ne)+Xo[1020+P[R-2*Y]-P[R+Y]],ve=Fl[112+(pe+4>>3)];P[R-Y]=Li[255+ne+Fl[112+(pe+3>>3)]],P[R+0]=Li[255+le-ve]}function ko(P,R,Y,ne){var le=P[R+0],pe=P[R+Y];return uo[255+P[R-2*Y]-P[R-Y]]>ne||uo[255+pe-le]>ne}function dl(P,R,Y,ne){return 4*uo[255+P[R-Y]-P[R+0]]+uo[255+P[R-2*Y]-P[R+Y]]<=ne}function Rl(P,R,Y,ne,le){var pe=P[R-3*Y],ve=P[R-2*Y],be=P[R-Y],we=P[R+0],Se=P[R+Y],Fe=P[R+2*Y],Je=P[R+3*Y];return 4*uo[255+be-we]+uo[255+ve-Se]>ne?0:uo[255+P[R-4*Y]-pe]<=le&&uo[255+pe-ve]<=le&&uo[255+ve-be]<=le&&uo[255+Je-Fe]<=le&&uo[255+Fe-Se]<=le&&uo[255+Se-we]<=le}function li(P,R,Y,ne){var le=2*ne+1;for(ne=0;16>ne;++ne)dl(P,R+ne,Y,le)&&Eo(P,R+ne,Y)}function Ha(P,R,Y,ne){var le=2*ne+1;for(ne=0;16>ne;++ne)dl(P,R+ne*Y,1,le)&&Eo(P,R+ne*Y,1)}function Ao(P,R,Y,ne){var le;for(le=3;0<le;--le)li(P,R+=4*Y,Y,ne)}function pl(P,R,Y,ne){var le;for(le=3;0<le;--le)Ha(P,R+=4,Y,ne)}function La(P,R,Y,ne,le,pe,ve,be){for(pe=2*pe+1;0<le--;){if(Rl(P,R,Y,pe,ve))if(ko(P,R,Y,be))Eo(P,R,Y);else{var we=P,Se=R,Fe=Y,Je=we[Se-2*Fe],xe=we[Se-Fe],$e=we[Se+0],Qe=we[Se+Fe],lt=we[Se+2*Fe],Xe=27*(He=Xo[1020+3*($e-xe)+Xo[1020+Je-Qe]])+63>>7,ot=18*He+63>>7,He=9*He+63>>7;we[Se-3*Fe]=Li[255+we[Se-3*Fe]+He],we[Se-2*Fe]=Li[255+Je+ot],we[Se-Fe]=Li[255+xe+Xe],we[Se+0]=Li[255+$e-Xe],we[Se+Fe]=Li[255+Qe-ot],we[Se+2*Fe]=Li[255+lt-He]}R+=ne}}function Br(P,R,Y,ne,le,pe,ve,be){for(pe=2*pe+1;0<le--;){if(Rl(P,R,Y,pe,ve))if(ko(P,R,Y,be))Eo(P,R,Y);else{var we=P,Se=R,Fe=Y,Je=we[Se-Fe],xe=we[Se+0],$e=we[Se+Fe],Qe=Fl[112+(4+(lt=3*(xe-Je))>>3)],lt=Fl[112+(lt+3>>3)],Xe=Qe+1>>1;we[Se-2*Fe]=Li[255+we[Se-2*Fe]+Xe],we[Se-Fe]=Li[255+Je+lt],we[Se+0]=Li[255+xe-Qe],we[Se+Fe]=Li[255+$e-Xe]}R+=ne}}function fa(P,R,Y,ne,le,pe){La(P,R,Y,1,16,ne,le,pe)}function Qr(P,R,Y,ne,le,pe){La(P,R,1,Y,16,ne,le,pe)}function vi(P,R,Y,ne,le,pe){var ve;for(ve=3;0<ve;--ve)Br(P,R+=4*Y,Y,1,16,ne,le,pe)}function $a(P,R,Y,ne,le,pe){var ve;for(ve=3;0<ve;--ve)Br(P,R+=4,1,Y,16,ne,le,pe)}function H(P,R,Y,ne,le,pe,ve,be){La(P,R,le,1,8,pe,ve,be),La(Y,ne,le,1,8,pe,ve,be)}function ce(P,R,Y,ne,le,pe,ve,be){La(P,R,1,le,8,pe,ve,be),La(Y,ne,1,le,8,pe,ve,be)}function ke(P,R,Y,ne,le,pe,ve,be){Br(P,R+4*le,le,1,8,pe,ve,be),Br(Y,ne+4*le,le,1,8,pe,ve,be)}function De(P,R,Y,ne,le,pe,ve,be){Br(P,R+4,1,le,8,pe,ve,be),Br(Y,ne+4,1,le,8,pe,ve,be)}function Ge(){this.ba=new Sn,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new gn,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function at(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function ct(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function Dt(){this.ua=0,this.Wa=new Be,this.vb=new Be,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new J,this.yc=new $}function jt(){this.xb=this.a=0,this.l=new En,this.ca=new Sn,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new U,this.Pb=0,this.wd=new U,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new Dt,this.ab=0,this.gc=o(4,ct),this.Oc=0}function fn(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new En,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function hn(P,R,Y,ne,le,pe,ve){for(P=P==null?0:P[R+0],R=0;R<ve;++R)le[pe+R]=P+Y[ne+R]&255,P=le[pe+R]}function Hn(P,R,Y,ne,le,pe,ve){var be;if(P==null)hn(null,null,Y,ne,le,pe,ve);else for(be=0;be<ve;++be)le[pe+be]=P[R+be]+Y[ne+be]&255}function Ar(P,R,Y,ne,le,pe,ve){if(P==null)hn(null,null,Y,ne,le,pe,ve);else{var be,we=P[R+0],Se=we,Fe=we;for(be=0;be<ve;++be)Se=Fe+(we=P[R+be])-Se,Fe=Y[ne+be]+(-256&Se?0>Se?0:255:Se)&255,Se=we,le[pe+be]=Fe}}function ui(P,R,Y,ne){var le=R.width,pe=R.o;if(e(P!=null&&R!=null),0>Y||0>=ne||Y+ne>pe)return null;if(!P.Cc){if(P.ga==null){var ve;if(P.ga=new fn,(ve=P.ga==null)||(ve=R.width*R.o,e(P.Gb.length==0),P.Gb=a(ve),P.Uc=0,P.Gb==null?ve=0:(P.mb=P.Gb,P.nb=P.Uc,P.rc=null,ve=1),ve=!ve),!ve){ve=P.ga;var be=P.Fa,we=P.P,Se=P.qc,Fe=P.mb,Je=P.nb,xe=we+1,$e=Se-1,Qe=ve.l;if(e(be!=null&&Fe!=null&&R!=null),na[0]=null,na[1]=hn,na[2]=Hn,na[3]=Ar,ve.ca=Fe,ve.tb=Je,ve.c=R.width,ve.i=R.height,e(0<ve.c&&0<ve.i),1>=Se)R=0;else if(ve.$a=3&be[we+0],ve.Z=be[we+0]>>2&3,ve.Lc=be[we+0]>>4&3,we=be[we+0]>>6&3,0>ve.$a||1<ve.$a||4<=ve.Z||1<ve.Lc||we)R=0;else if(Qe.put=Qt,Qe.ac=Sr,Qe.bc=ca,Qe.ma=ve,Qe.width=R.width,Qe.height=R.height,Qe.Da=R.Da,Qe.v=R.v,Qe.va=R.va,Qe.j=R.j,Qe.o=R.o,ve.$a)e:{e(ve.$a==1),R=$o();t:for(;;){if(R==null){R=0;break e}if(e(ve!=null),ve.mc=R,R.c=ve.c,R.i=ve.i,R.l=ve.l,R.l.ma=ve,R.l.width=ve.c,R.l.height=ve.i,R.a=0,te(R.m,be,xe,$e),!zi(ve.c,ve.i,1,R,null)||(R.ab==1&&R.gc[0].hc==3&&Ea(R.s)?(ve.ic=1,be=R.c*R.i,R.Ta=null,R.Ua=0,R.V=a(be),R.Ba=0,R.V==null?(R.a=1,R=0):R=1):(ve.ic=0,R=to(R,ve.c)),!R))break t;R=1;break e}ve.mc=null,R=0}else R=$e>=ve.c*ve.i;ve=!R}if(ve)return null;P.ga.Lc!=1?P.Ga=0:ne=pe-Y}e(P.ga!=null),e(Y+ne<=pe);e:{if(R=(be=P.ga).c,pe=be.l.o,be.$a==0){if(xe=P.rc,$e=P.Vc,Qe=P.Fa,we=P.P+1+Y*R,Se=P.mb,Fe=P.nb+Y*R,e(we<=P.P+P.qc),be.Z!=0)for(e(na[be.Z]!=null),ve=0;ve<ne;++ve)na[be.Z](xe,$e,Qe,we,Se,Fe,R),xe=Se,$e=Fe,Fe+=R,we+=R;else for(ve=0;ve<ne;++ve)r(Se,Fe,Qe,we,R),xe=Se,$e=Fe,Fe+=R,we+=R;P.rc=xe,P.Vc=$e}else{if(e(be.mc!=null),R=Y+ne,e((ve=be.mc)!=null),e(R<=ve.i),ve.C>=R)R=1;else if(be.ic||Po(),be.ic){be=ve.V,xe=ve.Ba,$e=ve.c;var lt=ve.i,Xe=(Qe=1,we=ve.$/$e,Se=ve.$%$e,Fe=ve.m,Je=ve.s,ve.$),ot=$e*lt,He=$e*R,ft=Je.wc,ht=Xe<He?Rr(Je,Se,we):null;e(Xe<=ot),e(R<=lt),e(Ea(Je));t:for(;;){for(;!Fe.h&&Xe<He;){if(Se&ft||(ht=Rr(Je,Se,we)),e(ht!=null),oe(Fe),256>(lt=Un(ht.G[0],ht.H[0],Fe)))be[xe+Xe]=lt,++Xe,++Se>=$e&&(Se=0,++we<=R&&!(we%16)&&si(ve,we));else{if(!(280>lt)){Qe=0;break t}lt=Kr(lt-256,Fe);var Wt,Bt=Un(ht.G[4],ht.H[4],Fe);if(oe(Fe),!(Xe>=(Bt=Yi($e,Bt=Kr(Bt,Fe)))&&ot-Xe>=lt)){Qe=0;break t}for(Wt=0;Wt<lt;++Wt)be[xe+Xe+Wt]=be[xe+Xe+Wt-Bt];for(Xe+=lt,Se+=lt;Se>=$e;)Se-=$e,++we<=R&&!(we%16)&&si(ve,we);Xe<He&&Se&ft&&(ht=Rr(Je,Se,we))}e(Fe.h==ee(Fe))}si(ve,we>R?R:we);break t}!Qe||Fe.h&&Xe<ot?(Qe=0,ve.a=Fe.h?5:3):ve.$=Xe,R=Qe}else R=ka(ve,ve.V,ve.Ba,ve.c,ve.i,R,Bs);if(!R){ne=0;break e}}Y+ne>=pe&&(P.Cc=1),ne=1}if(!ne)return null;if(P.Cc&&((ne=P.ga)!=null&&(ne.mc=null),P.ga=null,0<P.Ga))return alert("todo:WebPDequantizeLevels"),null}return P.nb+Y*le}function or(P,R,Y,ne,le,pe){for(;0<le--;){var ve,be=P,we=R+(Y?1:0),Se=P,Fe=R+(Y?0:3);for(ve=0;ve<ne;++ve){var Je=Se[Fe+4*ve];Je!=255&&(Je*=32897,be[we+4*ve+0]=be[we+4*ve+0]*Je>>23,be[we+4*ve+1]=be[we+4*ve+1]*Je>>23,be[we+4*ve+2]=be[we+4*ve+2]*Je>>23)}R+=pe}}function mi(P,R,Y,ne,le){for(;0<ne--;){var pe;for(pe=0;pe<Y;++pe){var ve=P[R+2*pe+0],be=15&(Se=P[R+2*pe+1]),we=4369*be,Se=(240&Se|Se>>4)*we>>16;P[R+2*pe+0]=(240&ve|ve>>4)*we>>16&240|(15&ve|ve<<4)*we>>16>>4&15,P[R+2*pe+1]=240&Se|be}R+=le}}function _r(P,R,Y,ne,le,pe,ve,be){var we,Se,Fe=255;for(Se=0;Se<le;++Se){for(we=0;we<ne;++we){var Je=P[R+we];pe[ve+4*we]=Je,Fe&=Je}R+=Y,ve+=be}return Fe!=255}function Ai(P,R,Y,ne,le){var pe;for(pe=0;pe<le;++pe)Y[ne+pe]=P[R+pe]>>8}function Po(){Yo=or,Ku=mi,Dl=_r,Nc=Ai}function Qi(P,R,Y){F[P]=function(ne,le,pe,ve,be,we,Se,Fe,Je,xe,$e,Qe,lt,Xe,ot,He,ft){var ht,Wt=ft-1>>1,Bt=be[we+0]|Se[Fe+0]<<16,dn=Je[xe+0]|$e[Qe+0]<<16;e(ne!=null);var zt=3*Bt+dn+131074>>2;for(R(ne[le+0],255&zt,zt>>16,lt,Xe),pe!=null&&(zt=3*dn+Bt+131074>>2,R(pe[ve+0],255&zt,zt>>16,ot,He)),ht=1;ht<=Wt;++ht){var On=be[we+ht]|Se[Fe+ht]<<16,qr=Je[xe+ht]|$e[Qe+ht]<<16,mn=Bt+On+dn+qr+524296,Ft=mn+2*(On+dn)>>3;zt=Ft+Bt>>1,Bt=(mn=mn+2*(Bt+qr)>>3)+On>>1,R(ne[le+2*ht-1],255&zt,zt>>16,lt,Xe+(2*ht-1)*Y),R(ne[le+2*ht-0],255&Bt,Bt>>16,lt,Xe+(2*ht-0)*Y),pe!=null&&(zt=mn+dn>>1,Bt=Ft+qr>>1,R(pe[ve+2*ht-1],255&zt,zt>>16,ot,He+(2*ht-1)*Y),R(pe[ve+2*ht+0],255&Bt,Bt>>16,ot,He+(2*ht+0)*Y)),Bt=On,dn=qr}1&ft||(zt=3*Bt+dn+131074>>2,R(ne[le+ft-1],255&zt,zt>>16,lt,Xe+(ft-1)*Y),pe!=null&&(zt=3*dn+Bt+131074>>2,R(pe[ve+ft-1],255&zt,zt>>16,ot,He+(ft-1)*Y)))}}function Lc(){Ra[Bl]=Th,Ra[Ko]=Ys,Ra[Rf]=Rh,Ra[zl]=wu,Ra[gu]=yi,Ra[fr]=Ni,Ra[Zu]=zc,Ra[ql]=Ys,Ra[Ws]=wu,Ra[vu]=yi,Ra[mu]=Ni}function Oo(P){return P&-16384?0>P?0:255:P>>_s}function hs(P,R){return Oo((19077*P>>8)+(26149*R>>8)-14234)}function qs(P,R,Y){return Oo((19077*P>>8)-(6419*R>>8)-(13320*Y>>8)+8708)}function gl(P,R){return Oo((19077*P>>8)+(33050*R>>8)-17685)}function oo(P,R,Y,ne,le){ne[le+0]=hs(P,Y),ne[le+1]=qs(P,R,Y),ne[le+2]=gl(P,R)}function vl(P,R,Y,ne,le){ne[le+0]=gl(P,R),ne[le+1]=qs(P,R,Y),ne[le+2]=hs(P,Y)}function Pi(P,R,Y,ne,le){var pe=qs(P,R,Y);R=pe<<3&224|gl(P,R)>>3,ne[le+0]=248&hs(P,Y)|pe>>5,ne[le+1]=R}function ds(P,R,Y,ne,le){var pe=240&gl(P,R)|15;ne[le+0]=240&hs(P,Y)|qs(P,R,Y)>>4,ne[le+1]=pe}function Co(P,R,Y,ne,le){ne[le+0]=255,oo(P,R,Y,ne,le+1)}function Ml(P,R,Y,ne,le){vl(P,R,Y,ne,le),ne[le+3]=255}function Il(P,R,Y,ne,le){oo(P,R,Y,ne,le),ne[le+3]=255}function zr(P,R){return 0>P?0:P>R?R:P}function so(P,R,Y){F[P]=function(ne,le,pe,ve,be,we,Se,Fe,Je){for(var xe=Fe+(-2&Je)*Y;Fe!=xe;)R(ne[le+0],pe[ve+0],be[we+0],Se,Fe),R(ne[le+1],pe[ve+0],be[we+0],Se,Fe+Y),le+=2,++ve,++we,Fe+=2*Y;1&Je&&R(ne[le+0],pe[ve+0],be[we+0],Se,Fe)}}function Lo(P,R,Y){return Y==0?P==0?R==0?6:5:R==0?4:0:Y}function Us(P,R,Y,ne,le){switch(P>>>30){case 3:Hs(R,Y,ne,le,0);break;case 2:Pr(R,Y,ne,le);break;case 1:Ln(R,Y,ne,le)}}function Ir(P,R){var Y,ne,le=R.M,pe=R.Nb,ve=P.oc,be=P.pc+40,we=P.oc,Se=P.pc+584,Fe=P.oc,Je=P.pc+600;for(Y=0;16>Y;++Y)ve[be+32*Y-1]=129;for(Y=0;8>Y;++Y)we[Se+32*Y-1]=129,Fe[Je+32*Y-1]=129;for(0<le?ve[be-1-32]=we[Se-1-32]=Fe[Je-1-32]=129:(i(ve,be-32-1,127,21),i(we,Se-32-1,127,9),i(Fe,Je-32-1,127,9)),ne=0;ne<P.za;++ne){var xe=R.ya[R.aa+ne];if(0<ne){for(Y=-1;16>Y;++Y)r(ve,be+32*Y-4,ve,be+32*Y+12,4);for(Y=-1;8>Y;++Y)r(we,Se+32*Y-4,we,Se+32*Y+4,4),r(Fe,Je+32*Y-4,Fe,Je+32*Y+4,4)}var $e=P.Gd,Qe=P.Hd+ne,lt=xe.ad,Xe=xe.Hc;if(0<le&&(r(ve,be-32,$e[Qe].y,0,16),r(we,Se-32,$e[Qe].f,0,8),r(Fe,Je-32,$e[Qe].ea,0,8)),xe.Za){var ot=ve,He=be-32+16;for(0<le&&(ne>=P.za-1?i(ot,He,$e[Qe].y[15],4):r(ot,He,$e[Qe+1].y,0,4)),Y=0;4>Y;Y++)ot[He+128+Y]=ot[He+256+Y]=ot[He+384+Y]=ot[He+0+Y];for(Y=0;16>Y;++Y,Xe<<=2)ot=ve,He=be+tc[Y],ta[xe.Ob[Y]](ot,He),Us(Xe,lt,16*+Y,ot,He)}else if(ot=Lo(ne,le,xe.Ob[0]),ea[ot](ve,be),Xe!=0)for(Y=0;16>Y;++Y,Xe<<=2)Us(Xe,lt,16*+Y,ve,be+tc[Y]);for(Y=xe.Gc,ot=Lo(ne,le,xe.Dd),ga[ot](we,Se),ga[ot](Fe,Je),Xe=lt,ot=we,He=Se,255&(xe=0|Y)&&(170&xe?pa(Xe,256,ot,He):on(Xe,256,ot,He)),xe=Fe,Xe=Je,255&(Y>>=8)&&(170&Y?pa(lt,320,xe,Xe):on(lt,320,xe,Xe)),le<P.Ub-1&&(r($e[Qe].y,0,ve,be+480,16),r($e[Qe].f,0,we,Se+224,8),r($e[Qe].ea,0,Fe,Je+224,8)),Y=8*pe*P.B,$e=P.sa,Qe=P.ta+16*ne+16*pe*P.R,lt=P.qa,xe=P.ra+8*ne+Y,Xe=P.Ha,ot=P.Ia+8*ne+Y,Y=0;16>Y;++Y)r($e,Qe+Y*P.R,ve,be+32*Y,16);for(Y=0;8>Y;++Y)r(lt,xe+Y*P.B,we,Se+32*Y,8),r(Xe,ot+Y*P.B,Fe,Je+32*Y,8)}}function Ga(P,R,Y,ne,le,pe,ve,be,we){var Se=[0],Fe=[0],Je=0,xe=we!=null?we.kd:0,$e=we??new at;if(P==null||12>Y)return 7;$e.data=P,$e.w=R,$e.ha=Y,R=[R],Y=[Y],$e.gb=[$e.gb];e:{var Qe=R,lt=Y,Xe=$e.gb;if(e(P!=null),e(lt!=null),e(Xe!=null),Xe[0]=0,12<=lt[0]&&!n(P,Qe[0],"RIFF")){if(n(P,Qe[0]+8,"WEBP")){Xe=3;break e}var ot=Ee(P,Qe[0]+4);if(12>ot||4294967286<ot){Xe=3;break e}if(xe&&ot>lt[0]-8){Xe=7;break e}Xe[0]=ot,Qe[0]+=12,lt[0]-=12}Xe=0}if(Xe!=0)return Xe;for(ot=0<$e.gb[0],Y=Y[0];;){e:{var He=P;lt=R,Xe=Y;var ft=Se,ht=Fe,Wt=Qe=[0];if((zt=Je=[Je])[0]=0,8>Xe[0])Xe=7;else{if(!n(He,lt[0],"VP8X")){if(Ee(He,lt[0]+4)!=10){Xe=3;break e}if(18>Xe[0]){Xe=7;break e}var Bt=Ee(He,lt[0]+8),dn=1+Me(He,lt[0]+12);if(2147483648<=dn*(He=1+Me(He,lt[0]+15))){Xe=3;break e}Wt!=null&&(Wt[0]=Bt),ft!=null&&(ft[0]=dn),ht!=null&&(ht[0]=He),lt[0]+=18,Xe[0]-=18,zt[0]=1}Xe=0}}if(Je=Je[0],Qe=Qe[0],Xe!=0)return Xe;if(lt=!!(2&Qe),!ot&&Je)return 3;if(pe!=null&&(pe[0]=!!(16&Qe)),ve!=null&&(ve[0]=lt),be!=null&&(be[0]=0),ve=Se[0],Qe=Fe[0],Je&&lt&&we==null){Xe=0;break}if(4>Y){Xe=7;break}if(ot&&Je||!ot&&!Je&&!n(P,R[0],"ALPH")){Y=[Y],$e.na=[$e.na],$e.P=[$e.P],$e.Sa=[$e.Sa];e:{Bt=P,Xe=R,ot=Y;var zt=$e.gb;ft=$e.na,ht=$e.P,Wt=$e.Sa,dn=22,e(Bt!=null),e(ot!=null),He=Xe[0];var On=ot[0];for(e(ft!=null),e(Wt!=null),ft[0]=null,ht[0]=null,Wt[0]=0;;){if(Xe[0]=He,ot[0]=On,8>On){Xe=7;break e}var qr=Ee(Bt,He+4);if(4294967286<qr){Xe=3;break e}var mn=8+qr+1&-2;if(dn+=mn,0<zt&&dn>zt){Xe=3;break e}if(!n(Bt,He,"VP8 ")||!n(Bt,He,"VP8L")){Xe=0;break e}if(On[0]<mn){Xe=7;break e}n(Bt,He,"ALPH")||(ft[0]=Bt,ht[0]=He+8,Wt[0]=qr),He+=mn,On-=mn}}if(Y=Y[0],$e.na=$e.na[0],$e.P=$e.P[0],$e.Sa=$e.Sa[0],Xe!=0)break}Y=[Y],$e.Ja=[$e.Ja],$e.xa=[$e.xa];e:if(zt=P,Xe=R,ot=Y,ft=$e.gb[0],ht=$e.Ja,Wt=$e.xa,Bt=Xe[0],He=!n(zt,Bt,"VP8 "),dn=!n(zt,Bt,"VP8L"),e(zt!=null),e(ot!=null),e(ht!=null),e(Wt!=null),8>ot[0])Xe=7;else{if(He||dn){if(zt=Ee(zt,Bt+4),12<=ft&&zt>ft-12){Xe=3;break e}if(xe&&zt>ot[0]-8){Xe=7;break e}ht[0]=zt,Xe[0]+=8,ot[0]-=8,Wt[0]=dn}else Wt[0]=5<=ot[0]&&zt[Bt+0]==47&&!(zt[Bt+4]>>5),ht[0]=ot[0];Xe=0}if(Y=Y[0],$e.Ja=$e.Ja[0],$e.xa=$e.xa[0],R=R[0],Xe!=0)break;if(4294967286<$e.Ja)return 3;if(be==null||lt||(be[0]=$e.xa?2:1),ve=[ve],Qe=[Qe],$e.xa){if(5>Y){Xe=7;break}be=ve,xe=Qe,lt=pe,P==null||5>Y?P=0:5<=Y&&P[R+0]==47&&!(P[R+4]>>5)?(ot=[0],zt=[0],ft=[0],te(ht=new U,P,R,Y),Fa(ht,ot,zt,ft)?(be!=null&&(be[0]=ot[0]),xe!=null&&(xe[0]=zt[0]),lt!=null&&(lt[0]=ft[0]),P=1):P=0):P=0}else{if(10>Y){Xe=7;break}be=Qe,P==null||10>Y||!Xi(P,R+3,Y-3)?P=0:(xe=P[R+0]|P[R+1]<<8|P[R+2]<<16,lt=16383&(P[R+7]<<8|P[R+6]),P=16383&(P[R+9]<<8|P[R+8]),1&xe||3<(xe>>1&7)||!(xe>>4&1)||xe>>5>=$e.Ja||!lt||!P?P=0:(ve&&(ve[0]=lt),be&&(be[0]=P),P=1))}if(!P||(ve=ve[0],Qe=Qe[0],Je&&(Se[0]!=ve||Fe[0]!=Qe)))return 3;we!=null&&(we[0]=$e,we.offset=R-we.w,e(4294967286>R-we.w),e(we.offset==we.ha-Y));break}return Xe==0||Xe==7&&Je&&we==null?(pe!=null&&(pe[0]|=$e.na!=null&&0<$e.na.length),ne!=null&&(ne[0]=ve),le!=null&&(le[0]=Qe),0):Xe}function ml(P,R,Y){var ne=R.width,le=R.height,pe=0,ve=0,be=ne,we=le;if(R.Da=P!=null&&0<P.Da,R.Da&&(be=P.cd,we=P.bd,pe=P.v,ve=P.j,11>Y||(pe&=-2,ve&=-2),0>pe||0>ve||0>=be||0>=we||pe+be>ne||ve+we>le))return 0;if(R.v=pe,R.j=ve,R.va=pe+be,R.o=ve+we,R.U=be,R.T=we,R.da=P!=null&&0<P.da,R.da){if(!Ce(be,we,Y=[P.ib],pe=[P.hb]))return 0;R.ib=Y[0],R.hb=pe[0]}return R.ob=P!=null&&P.ob,R.Kb=P==null||!P.Sd,R.da&&(R.ob=R.ib<3*ne/4&&R.hb<3*le/4,R.Kb=0),1}function jl(P){if(P==null)return 2;if(11>P.S){var R=P.f.RGBA;R.fb+=(P.height-1)*R.A,R.A=-R.A}else R=P.f.kb,P=P.height,R.O+=(P-1)*R.fa,R.fa=-R.fa,R.N+=(P-1>>1)*R.Ab,R.Ab=-R.Ab,R.W+=(P-1>>1)*R.Db,R.Db=-R.Db,R.F!=null&&(R.J+=(P-1)*R.lb,R.lb=-R.lb);return 0}function qi(P,R,Y,ne){if(ne==null||0>=P||0>=R)return 2;if(Y!=null){if(Y.Da){var le=Y.cd,pe=Y.bd,ve=-2&Y.v,be=-2&Y.j;if(0>ve||0>be||0>=le||0>=pe||ve+le>P||be+pe>R)return 2;P=le,R=pe}if(Y.da){if(!Ce(P,R,le=[Y.ib],pe=[Y.hb]))return 2;P=le[0],R=pe[0]}}ne.width=P,ne.height=R;e:{var we=ne.width,Se=ne.height;if(P=ne.S,0>=we||0>=Se||!(P>=Bl&&13>P))P=2;else{if(0>=ne.Rd&&ne.sd==null){ve=pe=le=R=0;var Fe=(be=we*$l[P])*Se;if(11>P||(pe=(Se+1)/2*(R=(we+1)/2),P==12&&(ve=(le=we)*Se)),(Se=a(Fe+2*pe+ve))==null){P=1;break e}ne.sd=Se,11>P?((we=ne.f.RGBA).eb=Se,we.fb=0,we.A=be,we.size=Fe):((we=ne.f.kb).y=Se,we.O=0,we.fa=be,we.Fd=Fe,we.f=Se,we.N=0+Fe,we.Ab=R,we.Cd=pe,we.ea=Se,we.W=0+Fe+pe,we.Db=R,we.Ed=pe,P==12&&(we.F=Se,we.J=0+Fe+2*pe),we.Tc=ve,we.lb=le)}if(R=1,le=ne.S,pe=ne.width,ve=ne.height,le>=Bl&&13>le)if(11>le)P=ne.f.RGBA,R&=(be=Math.abs(P.A))*(ve-1)+pe<=P.size,R&=be>=pe*$l[le],R&=P.eb!=null;else{P=ne.f.kb,be=(pe+1)/2,Fe=(ve+1)/2,we=Math.abs(P.fa),Se=Math.abs(P.Ab);var Je=Math.abs(P.Db),xe=Math.abs(P.lb),$e=xe*(ve-1)+pe;R&=we*(ve-1)+pe<=P.Fd,R&=Se*(Fe-1)+be<=P.Cd,R=(R&=Je*(Fe-1)+be<=P.Ed)&we>=pe&Se>=be&Je>=be,R&=P.y!=null,R&=P.f!=null,R&=P.ea!=null,le==12&&(R&=xe>=pe,R&=$e<=P.Tc,R&=P.F!=null)}else R=0;P=R?0:2}}return P!=0||Y!=null&&Y.fd&&(P=jl(ne)),P}var Oi=64,Na=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],Wa=24,ha=32,Ji=8,No=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];Ne("Predictor0","PredictorAdd0"),F.Predictor0=function(){return 4278190080},F.Predictor1=function(P){return P},F.Predictor2=function(P,R,Y){return R[Y+0]},F.Predictor3=function(P,R,Y){return R[Y+1]},F.Predictor4=function(P,R,Y){return R[Y-1]},F.Predictor5=function(P,R,Y){return Ae(Ae(P,R[Y+1]),R[Y+0])},F.Predictor6=function(P,R,Y){return Ae(P,R[Y-1])},F.Predictor7=function(P,R,Y){return Ae(P,R[Y+0])},F.Predictor8=function(P,R,Y){return Ae(R[Y-1],R[Y+0])},F.Predictor9=function(P,R,Y){return Ae(R[Y+0],R[Y+1])},F.Predictor10=function(P,R,Y){return Ae(Ae(P,R[Y-1]),Ae(R[Y+0],R[Y+1]))},F.Predictor11=function(P,R,Y){var ne=R[Y+0];return 0>=st(ne>>24&255,P>>24&255,(R=R[Y-1])>>24&255)+st(ne>>16&255,P>>16&255,R>>16&255)+st(ne>>8&255,P>>8&255,R>>8&255)+st(255&ne,255&P,255&R)?ne:P},F.Predictor12=function(P,R,Y){var ne=R[Y+0];return(Pe((P>>24&255)+(ne>>24&255)-((R=R[Y-1])>>24&255))<<24|Pe((P>>16&255)+(ne>>16&255)-(R>>16&255))<<16|Pe((P>>8&255)+(ne>>8&255)-(R>>8&255))<<8|Pe((255&P)+(255&ne)-(255&R)))>>>0},F.Predictor13=function(P,R,Y){var ne=R[Y-1];return(Ue((P=Ae(P,R[Y+0]))>>24&255,ne>>24&255)<<24|Ue(P>>16&255,ne>>16&255)<<16|Ue(P>>8&255,ne>>8&255)<<8|Ue(255&P,255&ne))>>>0};var ps=F.PredictorAdd0;F.PredictorAdd1=dt,Ne("Predictor2","PredictorAdd2"),Ne("Predictor3","PredictorAdd3"),Ne("Predictor4","PredictorAdd4"),Ne("Predictor5","PredictorAdd5"),Ne("Predictor6","PredictorAdd6"),Ne("Predictor7","PredictorAdd7"),Ne("Predictor8","PredictorAdd8"),Ne("Predictor9","PredictorAdd9"),Ne("Predictor10","PredictorAdd10"),Ne("Predictor11","PredictorAdd11"),Ne("Predictor12","PredictorAdd12"),Ne("Predictor13","PredictorAdd13");var lo=F.PredictorAdd2;kt("ColorIndexInverseTransform","MapARGB","32b",function(P){return P>>8&255},function(P){return P}),kt("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(P){return P},function(P){return P>>8&255});var Jr,Wo=F.ColorIndexInverseTransform,ci=F.MapARGB,Ta=F.VP8LColorIndexInverseTransformAlpha,To=F.MapAlpha,da=F.VP8LPredictorsAdd=[];da.length=16,(F.VP8LPredictors=[]).length=16,(F.VP8LPredictorsAdd_C=[]).length=16,(F.VP8LPredictors_C=[]).length=16;var yl,Vo,gs,vs,tr,ms,ys,Hs,Pr,pa,Ln,on,kn,Nn,Va,$s,bs,Gs,Ci,bl,pu,Xu,Ya,Ui,Yo,Ku,Dl,Nc,Tc=a(511),Rc=a(2041),Mc=a(225),Ic=a(767),jc=0,Xo=Rc,Fl=Mc,Li=Ic,uo=Tc,Bl=0,Ko=1,Rf=2,zl=3,gu=4,fr=5,Zu=6,ql=7,Ws=8,vu=9,mu=10,yu=[2,3,7],Dc=[3,3,11],wl=[280,256,256,256,40],Oh=[0,1,1,1,0],Pd=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Ch=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],Mf=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],Qu=8,Vs=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],Ju=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],Ul=null,If=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],co=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],Fc=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],ec=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],Lh=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],Nh=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],Bc=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],ea=[],ta=[],ga=[],Ro=1,bu=2,na=[],Ra=[];Qi("UpsampleRgbLinePair",oo,3),Qi("UpsampleBgrLinePair",vl,3),Qi("UpsampleRgbaLinePair",Il,4),Qi("UpsampleBgraLinePair",Ml,4),Qi("UpsampleArgbLinePair",Co,4),Qi("UpsampleRgba4444LinePair",ds,2),Qi("UpsampleRgb565LinePair",Pi,2);var Th=F.UpsampleRgbLinePair,Rh=F.UpsampleBgrLinePair,Ys=F.UpsampleRgbaLinePair,wu=F.UpsampleBgraLinePair,yi=F.UpsampleArgbLinePair,Ni=F.UpsampleRgba4444LinePair,zc=F.UpsampleRgb565LinePair,ws=16,Mo=1<<ws-1,nr=-227,sr=482,_s=6,Hi=0,va=a(256),_l=a(256),Hl=a(256),ma=a(256),_u=a(sr-nr),jf=a(sr-nr);so("YuvToRgbRow",oo,3),so("YuvToBgrRow",vl,3),so("YuvToRgbaRow",Il,4),so("YuvToBgraRow",Ml,4),so("YuvToArgbRow",Co,4),so("YuvToRgba4444Row",ds,2),so("YuvToRgb565Row",Pi,2);var tc=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],xs=[0,2,8],Mh=[8,7,6,4,4,2,2,2,1,1,1,1],Ss=1;this.WebPDecodeRGBA=function(P,R,Y,ne,le){var pe=Ko,ve=new Ge,be=new Sn;ve.ba=be,be.S=pe,be.width=[be.width],be.height=[be.height];var we=be.width,Se=be.height,Fe=new en;if(Fe==null||P==null)var Je=2;else e(Fe!=null),Je=Ga(P,R,Y,Fe.width,Fe.height,Fe.Pd,Fe.Qd,Fe.format,null);if(Je!=0?we=0:(we!=null&&(we[0]=Fe.width[0]),Se!=null&&(Se[0]=Fe.height[0]),we=1),we){be.width=be.width[0],be.height=be.height[0],ne!=null&&(ne[0]=be.width),le!=null&&(le[0]=be.height);e:{if(ne=new En,(le=new at).data=P,le.w=R,le.ha=Y,le.kd=1,R=[0],e(le!=null),((P=Ga(le.data,le.w,le.ha,null,null,null,R,null,le))==0||P==7)&&R[0]&&(P=4),(R=P)==0){if(e(ve!=null),ne.data=le.data,ne.w=le.w+le.offset,ne.ha=le.ha-le.offset,ne.put=Qt,ne.ac=Sr,ne.bc=ca,ne.ma=ve,le.xa){if((P=$o())==null){ve=1;break e}if((function(xe,$e){var Qe=[0],lt=[0],Xe=[0];t:for(;;){if(xe==null)return 0;if($e==null)return xe.a=2,0;if(xe.l=$e,xe.a=0,te(xe.m,$e.data,$e.w,$e.ha),!Fa(xe.m,Qe,lt,Xe)){xe.a=3;break t}if(xe.xb=bu,$e.width=Qe[0],$e.height=lt[0],!zi(Qe[0],lt[0],1,xe,null))break t;return 1}return e(xe.a!=0),0})(P,ne)){if(ne=(R=qi(ne.width,ne.height,ve.Oa,ve.ba))==0){t:{ne=P;n:for(;;){if(ne==null){ne=0;break t}if(e(ne.s.yc!=null),e(ne.s.Ya!=null),e(0<ne.s.Wb),e((Y=ne.l)!=null),e((le=Y.ma)!=null),ne.xb!=0){if(ne.ca=le.ba,ne.tb=le.tb,e(ne.ca!=null),!ml(le.Oa,Y,zl)){ne.a=2;break n}if(!to(ne,Y.width)||Y.da)break n;if((Y.da||Ct(ne.ca.S))&&Po(),11>ne.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),ne.ca.f.kb.F!=null&&Po()),ne.Pb&&0<ne.s.ua&&ne.s.vb.X==null&&!ge(ne.s.vb,ne.s.Wa.Xa)){ne.a=1;break n}ne.xb=0}if(!ka(ne,ne.V,ne.Ba,ne.c,ne.i,Y.o,Ho))break n;le.Dc=ne.Ma,ne=1;break t}e(ne.a!=0),ne=0}ne=!ne}ne&&(R=P.a)}else R=P.a}else{if((P=new ss)==null){ve=1;break e}if(P.Fa=le.na,P.P=le.P,P.qc=le.Sa,no(P,ne)){if((R=qi(ne.width,ne.height,ve.Oa,ve.ba))==0){if(P.Aa=0,Y=ve.Oa,e((le=P)!=null),Y!=null){if(0<(we=0>(we=Y.Md)?0:100<we?255:255*we/100)){for(Se=Fe=0;4>Se;++Se)12>(Je=le.pb[Se]).lc&&(Je.ia=we*Mh[0>Je.lc?0:Je.lc]>>3),Fe|=Je.ia;Fe&&(alert("todo:VP8InitRandom"),le.ia=1)}le.Ga=Y.Id,100<le.Ga?le.Ga=100:0>le.Ga&&(le.Ga=0)}(function(xe,$e){if(xe==null)return 0;if($e==null)return Rn(xe,2,"NULL VP8Io parameter in VP8Decode().");if(!xe.cb&&!no(xe,$e))return 0;if(e(xe.cb),$e.ac==null||$e.ac($e)){$e.ob&&(xe.L=0);var Qe=xs[xe.L];if(xe.L==2?(xe.yb=0,xe.zb=0):(xe.yb=$e.v-Qe>>4,xe.zb=$e.j-Qe>>4,0>xe.yb&&(xe.yb=0),0>xe.zb&&(xe.zb=0)),xe.Va=$e.o+15+Qe>>4,xe.Hb=$e.va+15+Qe>>4,xe.Hb>xe.za&&(xe.Hb=xe.za),xe.Va>xe.Ub&&(xe.Va=xe.Ub),0<xe.L){var lt=xe.ed;for(Qe=0;4>Qe;++Qe){var Xe;if(xe.Qa.Cb){var ot=xe.Qa.Lb[Qe];xe.Qa.Fb||(ot+=lt.Tb)}else ot=lt.Tb;for(Xe=0;1>=Xe;++Xe){var He=xe.gd[Qe][Xe],ft=ot;if(lt.Pc&&(ft+=lt.vd[0],Xe&&(ft+=lt.od[0])),0<(ft=0>ft?0:63<ft?63:ft)){var ht=ft;0<lt.wb&&(ht=4<lt.wb?ht>>2:ht>>1)>9-lt.wb&&(ht=9-lt.wb),1>ht&&(ht=1),He.dd=ht,He.tc=2*ft+ht,He.ld=40<=ft?2:15<=ft?1:0}else He.tc=0;He.La=Xe}}}Qe=0}else Rn(xe,6,"Frame setup failed"),Qe=xe.a;if(Qe=Qe==0){if(Qe){xe.$c=0,0<xe.Aa||(xe.Ic=Ss);t:{Qe=xe.Ic,lt=4*(ht=xe.za);var Wt=32*ht,Bt=ht+1,dn=0<xe.L?ht*(0<xe.Aa?2:1):0,zt=(xe.Aa==2?2:1)*ht;if((He=lt+832+(Xe=3*(16*Qe+xs[xe.L])/2*Wt)+(ot=xe.Fa!=null&&0<xe.Fa.length?xe.Kc.c*xe.Kc.i:0))!=He)Qe=0;else{if(He>xe.Vb){if(xe.Vb=0,xe.Ec=a(He),xe.Fc=0,xe.Ec==null){Qe=Rn(xe,1,"no memory during frame initialization.");break t}xe.Vb=He}He=xe.Ec,ft=xe.Fc,xe.Ac=He,xe.Bc=ft,ft+=lt,xe.Gd=o(Wt,gi),xe.Hd=0,xe.rb=o(Bt+1,os),xe.sb=1,xe.wa=dn?o(dn,Pa):null,xe.Y=0,xe.D.Nb=0,xe.D.wa=xe.wa,xe.D.Y=xe.Y,0<xe.Aa&&(xe.D.Y+=ht),e(!0),xe.oc=He,xe.pc=ft,ft+=832,xe.ya=o(zt,ll),xe.aa=0,xe.D.ya=xe.ya,xe.D.aa=xe.aa,xe.Aa==2&&(xe.D.aa+=ht),xe.R=16*ht,xe.B=8*ht,ht=(Wt=xs[xe.L])*xe.R,Wt=Wt/2*xe.B,xe.sa=He,xe.ta=ft+ht,xe.qa=xe.sa,xe.ra=xe.ta+16*Qe*xe.R+Wt,xe.Ha=xe.qa,xe.Ia=xe.ra+8*Qe*xe.B+Wt,xe.$c=0,ft+=Xe,xe.mb=ot?He:null,xe.nb=ot?ft:null,e(ft+ot<=xe.Fc+xe.Vb),Mr(xe),i(xe.Ac,xe.Bc,0,lt),Qe=1}}if(Qe){if($e.ka=0,$e.y=xe.sa,$e.O=xe.ta,$e.f=xe.qa,$e.N=xe.ra,$e.ea=xe.Ha,$e.Vd=xe.Ia,$e.fa=xe.R,$e.Rc=xe.B,$e.F=null,$e.J=0,!jc){for(Qe=-255;255>=Qe;++Qe)Tc[255+Qe]=0>Qe?-Qe:Qe;for(Qe=-1020;1020>=Qe;++Qe)Rc[1020+Qe]=-128>Qe?-128:127<Qe?127:Qe;for(Qe=-112;112>=Qe;++Qe)Mc[112+Qe]=-16>Qe?-16:15<Qe?15:Qe;for(Qe=-255;510>=Qe;++Qe)Ic[255+Qe]=0>Qe?0:255<Qe?255:Qe;jc=1}ys=Mn,Hs=Oa,pa=Tl,Ln=us,on=cu,Pr=Vu,kn=fa,Nn=Qr,Va=H,$s=ce,bs=vi,Gs=$a,Ci=ke,bl=De,pu=li,Xu=Ha,Ya=Ao,Ui=pl,ta[0]=Oc,ta[1]=cs,ta[2]=hl,ta[3]=So,ta[4]=Cc,ta[5]=wr,ta[6]=io,ta[7]=fu,ta[8]=zs,ta[9]=hu,ea[0]=ro,ea[1]=Ac,ea[2]=Pc,ea[3]=fl,ea[4]=Ba,ea[5]=za,ea[6]=qa,ga[0]=Go,ga[1]=cl,ga[2]=Yu,ga[3]=Ua,ga[4]=Ca,ga[5]=du,ga[6]=ao,Qe=1}else Qe=0}Qe&&(Qe=(function(On,qr){for(On.M=0;On.M<On.Va;++On.M){var mn,Ft=On.Jc[On.M&On.Xb],St=On.m,Ur=On;for(mn=0;mn<Ur.za;++mn){var Ht=St,pn=Ur,In=pn.Ac,bi=pn.Bc+4*mn,fi=pn.zc,$n=pn.ya[pn.aa+mn];if(pn.Qa.Bb?$n.$b=ye(Ht,pn.Pa.jb[0])?2+ye(Ht,pn.Pa.jb[2]):ye(Ht,pn.Pa.jb[1]):$n.$b=0,pn.kc&&($n.Ad=ye(Ht,pn.Bd)),$n.Za=!ye(Ht,145)+0,$n.Za){var wi=$n.Ob,vr=0;for(pn=0;4>pn;++pn){var jr,Tn=fi[0+pn];for(jr=0;4>jr;++jr){Tn=Lh[In[bi+jr]][Tn];for(var Wn=Fc[ye(Ht,Tn[0])];0<Wn;)Wn=Fc[2*Wn+ye(Ht,Tn[Wn])];Tn=-Wn,In[bi+jr]=Tn}r(wi,vr,In,bi,4),vr+=4,fi[0+pn]=Tn}}else Tn=ye(Ht,156)?ye(Ht,128)?1:3:ye(Ht,163)?2:0,$n.Ob[0]=Tn,i(In,bi,Tn,4),i(fi,0,Tn,4);$n.Dd=ye(Ht,142)?ye(Ht,114)?ye(Ht,183)?1:3:2:0}if(Ur.m.Ka)return Rn(On,7,"Premature end-of-partition0 encountered.");for(;On.ja<On.za;++On.ja){if(Ur=Ft,Ht=(St=On).rb[St.sb-1],In=St.rb[St.sb+St.ja],mn=St.ya[St.aa+St.ja],bi=St.kc?mn.Ad:0)Ht.la=In.la=0,mn.Za||(Ht.Na=In.Na=0),mn.Hc=0,mn.Gc=0,mn.ia=0;else{var Or,Vn;if(Ht=In,In=Ur,bi=St.Pa.Xc,fi=St.ya[St.aa+St.ja],$n=St.pb[fi.$b],pn=fi.ad,wi=0,vr=St.rb[St.sb-1],Tn=jr=0,i(pn,wi,0,384),fi.Za)var Cr=0,Lr=bi[3];else{Wn=a(16);var rr=Ht.Na+vr.Na;if(rr=Ul(In,bi[1],rr,$n.Eb,0,Wn,0),Ht.Na=vr.Na=(0<rr)+0,1<rr)ys(Wn,0,pn,wi);else{var Ti=Wn[0]+3>>3;for(Wn=0;256>Wn;Wn+=16)pn[wi+Wn]=Ti}Cr=1,Lr=bi[0]}var Zn=15&Ht.la,Qn=15&vr.la;for(Wn=0;4>Wn;++Wn){var ei=1&Qn;for(Ti=Vn=0;4>Ti;++Ti)Zn=Zn>>1|(ei=(rr=Ul(In,Lr,rr=ei+(1&Zn),$n.Sc,Cr,pn,wi))>Cr)<<7,Vn=Vn<<2|(3<rr?3:1<rr?2:pn[wi+0]!=0),wi+=16;Zn>>=4,Qn=Qn>>1|ei<<7,jr=(jr<<8|Vn)>>>0}for(Lr=Zn,Cr=Qn>>4,Or=0;4>Or;Or+=2){for(Vn=0,Zn=Ht.la>>4+Or,Qn=vr.la>>4+Or,Wn=0;2>Wn;++Wn){for(ei=1&Qn,Ti=0;2>Ti;++Ti)rr=ei+(1&Zn),Zn=Zn>>1|(ei=0<(rr=Ul(In,bi[2],rr,$n.Qc,0,pn,wi)))<<3,Vn=Vn<<2|(3<rr?3:1<rr?2:pn[wi+0]!=0),wi+=16;Zn>>=2,Qn=Qn>>1|ei<<5}Tn|=Vn<<4*Or,Lr|=Zn<<4<<Or,Cr|=(240&Qn)<<Or}Ht.la=Lr,vr.la=Cr,fi.Hc=jr,fi.Gc=Tn,fi.ia=43690&Tn?0:$n.ia,bi=!(jr|Tn)}if(0<St.L&&(St.wa[St.Y+St.ja]=St.gd[mn.$b][mn.Za],St.wa[St.Y+St.ja].La|=!bi),Ur.Ka)return Rn(On,7,"Premature end-of-file encountered.")}if(Mr(On),St=qr,Ur=1,mn=(Ft=On).D,Ht=0<Ft.L&&Ft.M>=Ft.zb&&Ft.M<=Ft.Va,Ft.Aa==0)t:{if(mn.M=Ft.M,mn.uc=Ht,Ir(Ft,mn),Ur=1,mn=(Vn=Ft.D).Nb,Ht=(Tn=xs[Ft.L])*Ft.R,In=Tn/2*Ft.B,Wn=16*mn*Ft.R,Ti=8*mn*Ft.B,bi=Ft.sa,fi=Ft.ta-Ht+Wn,$n=Ft.qa,pn=Ft.ra-In+Ti,wi=Ft.Ha,vr=Ft.Ia-In+Ti,Qn=(Zn=Vn.M)==0,jr=Zn>=Ft.Va-1,Ft.Aa==2&&Ir(Ft,Vn),Vn.uc)for(ei=(rr=Ft).D.M,e(rr.D.uc),Vn=rr.yb;Vn<rr.Hb;++Vn){Cr=Vn,Lr=ei;var Ri=(ya=(An=rr).D).Nb;Or=An.R;var ya=ya.wa[ya.Y+Cr],ti=An.sa,Hr=An.ta+16*Ri*Or+16*Cr,ba=ya.dd,ir=ya.tc;if(ir!=0)if(e(3<=ir),An.L==1)0<Cr&&Xu(ti,Hr,Or,ir+4),ya.La&&Ui(ti,Hr,Or,ir),0<Lr&&pu(ti,Hr,Or,ir+4),ya.La&&Ya(ti,Hr,Or,ir);else{var $i=An.B,Yn=An.qa,ln=An.ra+8*Ri*$i+8*Cr,jn=An.Ha,An=An.Ia+8*Ri*$i+8*Cr;Ri=ya.ld,0<Cr&&(Nn(ti,Hr,Or,ir+4,ba,Ri),$s(Yn,ln,jn,An,$i,ir+4,ba,Ri)),ya.La&&(Gs(ti,Hr,Or,ir,ba,Ri),bl(Yn,ln,jn,An,$i,ir,ba,Ri)),0<Lr&&(kn(ti,Hr,Or,ir+4,ba,Ri),Va(Yn,ln,jn,An,$i,ir+4,ba,Ri)),ya.La&&(bs(ti,Hr,Or,ir,ba,Ri),Ci(Yn,ln,jn,An,$i,ir,ba,Ri))}}if(Ft.ia&&alert("todo:DitherRow"),St.put!=null){if(Vn=16*Zn,Zn=16*(Zn+1),Qn?(St.y=Ft.sa,St.O=Ft.ta+Wn,St.f=Ft.qa,St.N=Ft.ra+Ti,St.ea=Ft.Ha,St.W=Ft.Ia+Ti):(Vn-=Tn,St.y=bi,St.O=fi,St.f=$n,St.N=pn,St.ea=wi,St.W=vr),jr||(Zn-=Tn),Zn>St.o&&(Zn=St.o),St.F=null,St.J=null,Ft.Fa!=null&&0<Ft.Fa.length&&Vn<Zn&&(St.J=ui(Ft,St,Vn,Zn-Vn),St.F=Ft.mb,St.F==null&&St.F.length==0)){Ur=Rn(Ft,3,"Could not decode alpha data.");break t}Vn<St.j&&(Tn=St.j-Vn,Vn=St.j,e(!(1&Tn)),St.O+=Ft.R*Tn,St.N+=Ft.B*(Tn>>1),St.W+=Ft.B*(Tn>>1),St.F!=null&&(St.J+=St.width*Tn)),Vn<Zn&&(St.O+=St.v,St.N+=St.v>>1,St.W+=St.v>>1,St.F!=null&&(St.J+=St.v),St.ka=Vn-St.j,St.U=St.va-St.v,St.T=Zn-Vn,Ur=St.put(St))}mn+1!=Ft.Ic||jr||(r(Ft.sa,Ft.ta-Ht,bi,fi+16*Ft.R,Ht),r(Ft.qa,Ft.ra-In,$n,pn+8*Ft.B,In),r(Ft.Ha,Ft.Ia-In,wi,vr+8*Ft.B,In))}if(!Ur)return Rn(On,6,"Output aborted.")}return 1})(xe,$e)),$e.bc!=null&&$e.bc($e),Qe&=1}return Qe?(xe.cb=0,Qe):0})(P,ne)||(R=P.a)}}else R=P.a}R==0&&ve.Oa!=null&&ve.Oa.fd&&(R=jl(ve.ba))}ve=R}pe=ve!=0?null:11>pe?be.f.RGBA.eb:be.f.kb.y}else pe=null;return pe};var $l=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function h(F,j){for(var T="",L=0;L<4;L++)T+=String.fromCharCode(F[j++]);return T}function f(F,j){return F[j+0]|F[j+1]<<8}function g(F,j){return(F[j+0]|F[j+1]<<8|F[j+2]<<16)>>>0}function v(F,j){return(F[j+0]|F[j+1]<<8|F[j+2]<<16|F[j+3]<<24)>>>0}new u;var p=[0],y=[0],_=[],x=new u,b=t,E=(function(F,j){var T={},L=0,$=!1,q=0,J=0;if(T.frames=[],!(function(D,U){for(var X=0;X<4;X++)if(D[U+X]!="RIFF".charCodeAt(X))return!0;return!1})(F,j)){for(v(F,j+=4),j+=8;j<F.length;){var ae=h(F,j),ie=v(F,j+=4);j+=4;var Z=ie+(1&ie);switch(ae){case"VP8 ":case"VP8L":T.frames[L]===void 0&&(T.frames[L]={}),(B=T.frames[L]).src_off=$?J:j-8,B.src_size=q+ie+8,L++,$&&($=!1,q=0,J=0);break;case"VP8X":(B=T.header={}).feature_flags=F[j];var te=j+4;B.canvas_width=1+g(F,te),te+=3,B.canvas_height=1+g(F,te),te+=3;break;case"ALPH":$=!0,q=Z+8,J=j-8;break;case"ANIM":(B=T.header).bgcolor=v(F,j),te=j+4,B.loop_count=f(F,te),te+=2;break;case"ANMF":var V,B;(B=T.frames[L]={}).offset_x=2*g(F,j),j+=3,B.offset_y=2*g(F,j),j+=3,B.width=1+g(F,j),j+=3,B.height=1+g(F,j),j+=3,B.duration=g(F,j),j+=3,V=F[j++],B.dispose=1&V,B.blend=V>>1&1}ae!="ANMF"&&(j+=Z)}return T}})(b,0);E.response=b,E.rgbaoutput=!0,E.dataurl=!1;var A=E.header?E.header:null,S=E.frames?E.frames:null;if(A){A.loop_counter=A.loop_count,p=[A.canvas_height],y=[A.canvas_width];for(var k=0;k<S.length&&S[k].blend!=0;k++);}var I=S[0],O=x.WebPDecodeRGBA(b,I.src_off,I.src_size,y,p);I.rgba=O,I.imgwidth=y[0],I.imgheight=p[0];for(var M=0;M<y[0]*p[0]*4;M++)_[M]=O[M];return this.width=y,this.height=p,this.data=_,this}(function(t){var e,n,r,i,a,o,s,u,h,f=function(D){return D=D||{},this.isStrokeTransparent=D.isStrokeTransparent||!1,this.strokeOpacity=D.strokeOpacity||1,this.strokeStyle=D.strokeStyle||"#000000",this.fillStyle=D.fillStyle||"#000000",this.isFillTransparent=D.isFillTransparent||!1,this.fillOpacity=D.fillOpacity||1,this.font=D.font||"10px sans-serif",this.textBaseline=D.textBaseline||"alphabetic",this.textAlign=D.textAlign||"left",this.lineWidth=D.lineWidth||1,this.lineJoin=D.lineJoin||"miter",this.lineCap=D.lineCap||"butt",this.path=D.path||[],this.transform=D.transform!==void 0?D.transform.clone():new u,this.globalCompositeOperation=D.globalCompositeOperation||"normal",this.globalAlpha=D.globalAlpha||1,this.clip_path=D.clip_path||[],this.currentPoint=D.currentPoint||new o,this.miterLimit=D.miterLimit||10,this.lastPoint=D.lastPoint||new o,this.lineDashOffset=D.lineDashOffset||0,this.lineDash=D.lineDash||[],this.margin=D.margin||[0,0,0,0],this.prevPageLastElemOffset=D.prevPageLastElemOffset||0,this.ignoreClearRect=typeof D.ignoreClearRect!="boolean"||D.ignoreClearRect,this};t.events.push(["initialized",function(){this.context2d=new g(this),e=this.internal.f2,n=this.internal.getCoordinateString,r=this.internal.getVerticalCoordinateString,i=this.internal.getHorizontalCoordinate,a=this.internal.getVerticalCoordinate,o=this.internal.Point,s=this.internal.Rectangle,u=this.internal.Matrix,h=new f}]);var g=function(D){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var U=D;Object.defineProperty(this,"pdf",{get:function(){return U}});var X=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return X},set:function(Ee){X=!!Ee}});var ee=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return ee},set:function(Ee){ee=!!Ee}});var K=0;Object.defineProperty(this,"posX",{get:function(){return K},set:function(Ee){isNaN(Ee)||(K=Ee)}});var oe=0;Object.defineProperty(this,"posY",{get:function(){return oe},set:function(Ee){isNaN(Ee)||(oe=Ee)}}),Object.defineProperty(this,"margin",{get:function(){return h.margin},set:function(Ee){var ge;typeof Ee=="number"?ge=[Ee,Ee,Ee,Ee]:((ge=new Array(4))[0]=Ee[0],ge[1]=Ee.length>=2?Ee[1]:ge[0],ge[2]=Ee.length>=3?Ee[2]:ge[0],ge[3]=Ee.length>=4?Ee[3]:ge[1]),h.margin=ge}});var me=!1;Object.defineProperty(this,"autoPaging",{get:function(){return me},set:function(Ee){me=Ee}});var de=0;Object.defineProperty(this,"lastBreak",{get:function(){return de},set:function(Ee){de=Ee}});var ye=[];Object.defineProperty(this,"pageBreaks",{get:function(){return ye},set:function(Ee){ye=Ee}}),Object.defineProperty(this,"ctx",{get:function(){return h},set:function(Ee){Ee instanceof f&&(h=Ee)}}),Object.defineProperty(this,"path",{get:function(){return h.path},set:function(Ee){h.path=Ee}});var Re=[];Object.defineProperty(this,"ctxStack",{get:function(){return Re},set:function(Ee){Re=Ee}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(Ee){var ge;ge=v(Ee),this.ctx.fillStyle=ge.style,this.ctx.isFillTransparent=ge.a===0,this.ctx.fillOpacity=ge.a,this.pdf.setFillColor(ge.r,ge.g,ge.b,{a:ge.a}),this.pdf.setTextColor(ge.r,ge.g,ge.b,{a:ge.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(Ee){var ge=v(Ee);this.ctx.strokeStyle=ge.style,this.ctx.isStrokeTransparent=ge.a===0,this.ctx.strokeOpacity=ge.a,ge.a===0?this.pdf.setDrawColor(255,255,255):(ge.a,this.pdf.setDrawColor(ge.r,ge.g,ge.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(Ee){["butt","round","square"].indexOf(Ee)!==-1&&(this.ctx.lineCap=Ee,this.pdf.setLineCap(Ee))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(Ee){isNaN(Ee)||(this.ctx.lineWidth=Ee,this.pdf.setLineWidth(Ee))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(Ee){["bevel","round","miter"].indexOf(Ee)!==-1&&(this.ctx.lineJoin=Ee,this.pdf.setLineJoin(Ee))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(Ee){isNaN(Ee)||(this.ctx.miterLimit=Ee,this.pdf.setMiterLimit(Ee))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(Ee){this.ctx.textBaseline=Ee}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(Ee){["right","end","center","left","start"].indexOf(Ee)!==-1&&(this.ctx.textAlign=Ee)}});var Oe=null,Me=null;Object.defineProperty(this,"fontFaces",{get:function(){return Me},set:function(Ee){Oe=null,Me=Ee}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(Ee){var ge;if(this.ctx.font=Ee,(ge=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i.exec(Ee))!==null){var Te=ge[1];ge[2];var Be=ge[3],Ce=ge[4];ge[5];var fe=ge[6],Le=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(Ce)[2];Ce=Math.floor(Le==="px"?parseFloat(Ce)*this.pdf.internal.scaleFactor:Le==="em"?parseFloat(Ce)*this.pdf.getFontSize():parseFloat(Ce)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(Ce);var Ne=(function(bt){var kt,qn,xn=[],It=bt.trim();if(It==="")return qv;if(It in Rw)return[Rw[It]];for(;It!=="";){switch(qn=null,kt=(It=Iw(It)).charAt(0)){case'"':case"'":qn=YI(It.substring(1),kt);break;default:qn=XI(It)}if(qn===null||(xn.push(qn[0]),(It=Iw(qn[1]))!==""&&It.charAt(0)!==","))return qv;It=It.replace(/^,/,"")}return xn})(fe);if(this.fontFaces){var ue=(function(bt,kt){if(Oe===null){var qn=(function(xn){var It=[];return Object.keys(xn).forEach(function(Jt){xn[Jt].forEach(function(Ve){var qe=null;switch(Ve){case"bold":qe={family:Jt,weight:"bold"};break;case"italic":qe={family:Jt,style:"italic"};break;case"bolditalic":qe={family:Jt,weight:"bold",style:"italic"};break;case"":case"normal":qe={family:Jt}}qe!==null&&(qe.ref={name:Jt,style:Ve},It.push(qe))})}),It})(bt.getFontList());Oe=(function(xn){for(var It={},Jt=0;Jt<xn.length;++Jt){var Ve=zv(xn[Jt]),qe=Ve.family,Nt=Ve.stretch,Ct=Ve.style,an=Ve.weight;It[qe]=It[qe]||{},It[qe][Nt]=It[qe][Nt]||{},It[qe][Nt][Ct]=It[qe][Nt][Ct]||{},It[qe][Nt][Ct][an]=Ve}return It})(qn.concat(kt))}return Oe})(this.pdf,this.fontFaces),Ae=Ne.map(function(bt){return{family:bt,stretch:"normal",weight:Be,style:Te}}),Pe=(function(bt,kt,qn){for(var xn=(qn=qn||{}).defaultFontFamily||"times",It=Object.assign({},VI,qn.genericFontFamilies||{}),Jt=null,Ve=null,qe=0;qe<kt.length;++qe)if(It[(Jt=zv(kt[qe])).family]&&(Jt.family=It[Jt.family]),bt.hasOwnProperty(Jt.family)){Ve=bt[Jt.family];break}if(!(Ve=Ve||bt[xn]))throw new Error("Could not find a font-family for the rule '"+Mw(Jt)+"' and default family '"+xn+"'.");if(Ve=(function(Nt,Ct){if(Ct[Nt])return Ct[Nt];var an=Im[Nt],Ut=an<=Im.normal?-1:1,Sn=Tw(Ct,ux,an,Ut);if(!Sn)throw new Error("Could not find a matching font-stretch value for "+Nt);return Sn})(Jt.stretch,Ve),Ve=(function(Nt,Ct){if(Ct[Nt])return Ct[Nt];for(var an=lx[Nt],Ut=0;Ut<an.length;++Ut)if(Ct[an[Ut]])return Ct[an[Ut]];throw new Error("Could not find a matching font-style for "+Nt)})(Jt.style,Ve),!(Ve=(function(Nt,Ct){if(Ct[Nt])return Ct[Nt];if(Nt===400&&Ct[500])return Ct[500];if(Nt===500&&Ct[400])return Ct[400];var an=WI[Nt],Ut=Tw(Ct,cx,an,Nt<400?-1:1);if(!Ut)throw new Error("Could not find a matching font-weight for value "+Nt);return Ut})(Jt.weight,Ve)))throw new Error("Failed to resolve a font for the rule '"+Mw(Jt)+"'.");return Ve})(ue,Ae);this.pdf.setFont(Pe.ref.name,Pe.ref.style)}else{var Ue="";(Be==="bold"||parseInt(Be,10)>=700||Te==="bold")&&(Ue="bold"),Te==="italic"&&(Ue+="italic"),Ue.length===0&&(Ue="normal");for(var st="",dt={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},pt=0;pt<Ne.length;pt++){if(this.pdf.internal.getFont(Ne[pt],Ue,{noFallback:!0,disableWarning:!0})!==void 0){st=Ne[pt];break}if(Ue==="bolditalic"&&this.pdf.internal.getFont(Ne[pt],"bold",{noFallback:!0,disableWarning:!0})!==void 0)st=Ne[pt],Ue="bold";else if(this.pdf.internal.getFont(Ne[pt],"normal",{noFallback:!0,disableWarning:!0})!==void 0){st=Ne[pt],Ue="normal";break}}if(st===""){for(var xt=0;xt<Ne.length;xt++)if(dt[Ne[xt]]){st=dt[Ne[xt]];break}}st=st===""?"Times":st,this.pdf.setFont(st,Ue)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(Ee){this.ctx.globalCompositeOperation=Ee}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(Ee){this.ctx.globalAlpha=Ee}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(Ee){this.ctx.lineDashOffset=Ee,B.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(Ee){this.ctx.lineDash=Ee,B.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(Ee){this.ctx.ignoreClearRect=!!Ee}})};g.prototype.setLineDash=function(D){this.lineDash=D},g.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},g.prototype.fill=function(){S.call(this,"fill",!1)},g.prototype.stroke=function(){S.call(this,"stroke",!1)},g.prototype.beginPath=function(){this.path=[{type:"begin"}]},g.prototype.moveTo=function(D,U){if(isNaN(D)||isNaN(U))throw Yr.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var X=this.ctx.transform.applyToPoint(new o(D,U));this.path.push({type:"mt",x:X.x,y:X.y}),this.ctx.lastPoint=new o(D,U)},g.prototype.closePath=function(){var D=new o(0,0),U=0;for(U=this.path.length-1;U!==-1;U--)if(this.path[U].type==="begin"&&Nr(this.path[U+1])==="object"&&typeof this.path[U+1].x=="number"){D=new o(this.path[U+1].x,this.path[U+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new o(D.x,D.y)},g.prototype.lineTo=function(D,U){if(isNaN(D)||isNaN(U))throw Yr.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var X=this.ctx.transform.applyToPoint(new o(D,U));this.path.push({type:"lt",x:X.x,y:X.y}),this.ctx.lastPoint=new o(X.x,X.y)},g.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),S.call(this,null,!0)},g.prototype.quadraticCurveTo=function(D,U,X,ee){if(isNaN(X)||isNaN(ee)||isNaN(D)||isNaN(U))throw Yr.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var K=this.ctx.transform.applyToPoint(new o(X,ee)),oe=this.ctx.transform.applyToPoint(new o(D,U));this.path.push({type:"qct",x1:oe.x,y1:oe.y,x:K.x,y:K.y}),this.ctx.lastPoint=new o(K.x,K.y)},g.prototype.bezierCurveTo=function(D,U,X,ee,K,oe){if(isNaN(K)||isNaN(oe)||isNaN(D)||isNaN(U)||isNaN(X)||isNaN(ee))throw Yr.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var me=this.ctx.transform.applyToPoint(new o(K,oe)),de=this.ctx.transform.applyToPoint(new o(D,U)),ye=this.ctx.transform.applyToPoint(new o(X,ee));this.path.push({type:"bct",x1:de.x,y1:de.y,x2:ye.x,y2:ye.y,x:me.x,y:me.y}),this.ctx.lastPoint=new o(me.x,me.y)},g.prototype.arc=function(D,U,X,ee,K,oe){if(isNaN(D)||isNaN(U)||isNaN(X)||isNaN(ee)||isNaN(K))throw Yr.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(oe=!!oe,!this.ctx.transform.isIdentity){var me=this.ctx.transform.applyToPoint(new o(D,U));D=me.x,U=me.y;var de=this.ctx.transform.applyToPoint(new o(0,X)),ye=this.ctx.transform.applyToPoint(new o(0,0));X=Math.sqrt(Math.pow(de.x-ye.x,2)+Math.pow(de.y-ye.y,2))}Math.abs(K-ee)>=2*Math.PI&&(ee=0,K=2*Math.PI),this.path.push({type:"arc",x:D,y:U,radius:X,startAngle:ee,endAngle:K,counterclockwise:oe})},g.prototype.arcTo=function(D,U,X,ee,K){throw new Error("arcTo not implemented.")},g.prototype.rect=function(D,U,X,ee){if(isNaN(D)||isNaN(U)||isNaN(X)||isNaN(ee))throw Yr.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(D,U),this.lineTo(D+X,U),this.lineTo(D+X,U+ee),this.lineTo(D,U+ee),this.lineTo(D,U),this.lineTo(D+X,U),this.lineTo(D,U)},g.prototype.fillRect=function(D,U,X,ee){if(isNaN(D)||isNaN(U)||isNaN(X)||isNaN(ee))throw Yr.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!p.call(this)){var K={};this.lineCap!=="butt"&&(K.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(K.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(D,U,X,ee),this.fill(),K.hasOwnProperty("lineCap")&&(this.lineCap=K.lineCap),K.hasOwnProperty("lineJoin")&&(this.lineJoin=K.lineJoin)}},g.prototype.strokeRect=function(D,U,X,ee){if(isNaN(D)||isNaN(U)||isNaN(X)||isNaN(ee))throw Yr.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");y.call(this)||(this.beginPath(),this.rect(D,U,X,ee),this.stroke())},g.prototype.clearRect=function(D,U,X,ee){if(isNaN(D)||isNaN(U)||isNaN(X)||isNaN(ee))throw Yr.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(D,U,X,ee))},g.prototype.save=function(D){D=typeof D!="boolean"||D;for(var U=this.pdf.internal.getCurrentPageInfo().pageNumber,X=0;X<this.pdf.internal.getNumberOfPages();X++)this.pdf.setPage(X+1),this.pdf.internal.out("q");if(this.pdf.setPage(U),D){this.ctx.fontSize=this.pdf.internal.getFontSize();var ee=new f(this.ctx);this.ctxStack.push(this.ctx),this.ctx=ee}},g.prototype.restore=function(D){D=typeof D!="boolean"||D;for(var U=this.pdf.internal.getCurrentPageInfo().pageNumber,X=0;X<this.pdf.internal.getNumberOfPages();X++)this.pdf.setPage(X+1),this.pdf.internal.out("Q");this.pdf.setPage(U),D&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},g.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var v=function(D){var U,X,ee,K;if(D.isCanvasGradient===!0&&(D=D.getColor()),!D)return{r:0,g:0,b:0,a:0,style:D};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(D))U=0,X=0,ee=0,K=0;else{var oe=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(D);if(oe!==null)U=parseInt(oe[1]),X=parseInt(oe[2]),ee=parseInt(oe[3]),K=1;else if((oe=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(D))!==null)U=parseInt(oe[1]),X=parseInt(oe[2]),ee=parseInt(oe[3]),K=parseFloat(oe[4]);else{if(K=1,typeof D=="string"&&D.charAt(0)!=="#"){var me=new tx(D);D=me.ok?me.toHex():"#000000"}D.length===4?(U=D.substring(1,2),U+=U,X=D.substring(2,3),X+=X,ee=D.substring(3,4),ee+=ee):(U=D.substring(1,3),X=D.substring(3,5),ee=D.substring(5,7)),U=parseInt(U,16),X=parseInt(X,16),ee=parseInt(ee,16)}}return{r:U,g:X,b:ee,a:K,style:D}},p=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},y=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};g.prototype.fillText=function(D,U,X,ee){if(isNaN(U)||isNaN(X)||typeof D!="string")throw Yr.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(ee=isNaN(ee)?void 0:ee,!p.call(this)){var K=Z(this.ctx.transform.rotation),oe=this.ctx.transform.scaleX;L.call(this,{text:D,x:U,y:X,scale:oe,angle:K,align:this.textAlign,maxWidth:ee})}},g.prototype.strokeText=function(D,U,X,ee){if(isNaN(U)||isNaN(X)||typeof D!="string")throw Yr.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!y.call(this)){ee=isNaN(ee)?void 0:ee;var K=Z(this.ctx.transform.rotation),oe=this.ctx.transform.scaleX;L.call(this,{text:D,x:U,y:X,scale:oe,renderingMode:"stroke",angle:K,align:this.textAlign,maxWidth:ee})}},g.prototype.measureText=function(D){if(typeof D!="string")throw Yr.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var U=this.pdf,X=this.pdf.internal.scaleFactor,ee=U.internal.getFontSize(),K=U.getStringUnitWidth(D)*ee/U.internal.scaleFactor;return new function(oe){var me=(oe=oe||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return me}}),this}({width:K*=Math.round(96*X/72*1e4)/1e4})},g.prototype.scale=function(D,U){if(isNaN(D)||isNaN(U))throw Yr.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var X=new u(D,0,0,U,0,0);this.ctx.transform=this.ctx.transform.multiply(X)},g.prototype.rotate=function(D){if(isNaN(D))throw Yr.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var U=new u(Math.cos(D),Math.sin(D),-Math.sin(D),Math.cos(D),0,0);this.ctx.transform=this.ctx.transform.multiply(U)},g.prototype.translate=function(D,U){if(isNaN(D)||isNaN(U))throw Yr.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var X=new u(1,0,0,1,D,U);this.ctx.transform=this.ctx.transform.multiply(X)},g.prototype.transform=function(D,U,X,ee,K,oe){if(isNaN(D)||isNaN(U)||isNaN(X)||isNaN(ee)||isNaN(K)||isNaN(oe))throw Yr.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var me=new u(D,U,X,ee,K,oe);this.ctx.transform=this.ctx.transform.multiply(me)},g.prototype.setTransform=function(D,U,X,ee,K,oe){D=isNaN(D)?1:D,U=isNaN(U)?0:U,X=isNaN(X)?0:X,ee=isNaN(ee)?1:ee,K=isNaN(K)?0:K,oe=isNaN(oe)?0:oe,this.ctx.transform=new u(D,U,X,ee,K,oe)};var _=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};g.prototype.drawImage=function(D,U,X,ee,K,oe,me,de,ye){var Re=this.pdf.getImageProperties(D),Oe=1,Me=1,Ee=1,ge=1;ee!==void 0&&de!==void 0&&(Ee=de/ee,ge=ye/K,Oe=Re.width/ee*de/ee,Me=Re.height/K*ye/K),oe===void 0&&(oe=U,me=X,U=0,X=0),ee!==void 0&&de===void 0&&(de=ee,ye=K),ee===void 0&&de===void 0&&(de=Re.width,ye=Re.height);for(var Te,Be=this.ctx.transform.decompose(),Ce=Z(Be.rotate.shx),fe=new u,Le=(fe=(fe=(fe=fe.multiply(Be.translate)).multiply(Be.skew)).multiply(Be.scale)).applyToRectangle(new s(oe-U*Ee,me-X*ge,ee*Oe,K*Me)),Ne=x.call(this,Le),ue=[],Ae=0;Ae<Ne.length;Ae+=1)ue.indexOf(Ne[Ae])===-1&&ue.push(Ne[Ae]);if(A(ue),this.autoPaging)for(var Pe=ue[0],Ue=ue[ue.length-1],st=Pe;st<Ue+1;st++){this.pdf.setPage(st);var dt=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],pt=st===1?this.posY+this.margin[0]:this.margin[0],xt=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],bt=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],kt=st===1?0:xt+(st-2)*bt;if(this.ctx.clip_path.length!==0){var qn=this.path;Te=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=E(Te,this.posX+this.margin[3],-kt+pt+this.ctx.prevPageLastElemOffset),k.call(this,"fill",!0),this.path=qn}var xn=JSON.parse(JSON.stringify(Le));xn=E([xn],this.posX+this.margin[3],-kt+pt+this.ctx.prevPageLastElemOffset)[0];var It=(st>Pe||st<Ue)&&_.call(this);It&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],dt,bt,null).clip().discardPath()),this.pdf.addImage(D,"JPEG",xn.x,xn.y,xn.w,xn.h,null,null,Ce),It&&this.pdf.restoreGraphicsState()}else this.pdf.addImage(D,"JPEG",Le.x,Le.y,Le.w,Le.h,null,null,Ce)};var x=function(D,U,X){var ee=[];U=U||this.pdf.internal.pageSize.width,X=X||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var K=this.posY+this.ctx.prevPageLastElemOffset;switch(D.type){default:case"mt":case"lt":ee.push(Math.floor((D.y+K)/X)+1);break;case"arc":ee.push(Math.floor((D.y+K-D.radius)/X)+1),ee.push(Math.floor((D.y+K+D.radius)/X)+1);break;case"qct":var oe=te(this.ctx.lastPoint.x,this.ctx.lastPoint.y,D.x1,D.y1,D.x,D.y);ee.push(Math.floor((oe.y+K)/X)+1),ee.push(Math.floor((oe.y+oe.h+K)/X)+1);break;case"bct":var me=V(this.ctx.lastPoint.x,this.ctx.lastPoint.y,D.x1,D.y1,D.x2,D.y2,D.x,D.y);ee.push(Math.floor((me.y+K)/X)+1),ee.push(Math.floor((me.y+me.h+K)/X)+1);break;case"rect":ee.push(Math.floor((D.y+K)/X)+1),ee.push(Math.floor((D.y+D.h+K)/X)+1)}for(var de=0;de<ee.length;de+=1)for(;this.pdf.internal.getNumberOfPages()<ee[de];)b.call(this);return ee},b=function(){var D=this.fillStyle,U=this.strokeStyle,X=this.font,ee=this.lineCap,K=this.lineWidth,oe=this.lineJoin;this.pdf.addPage(),this.fillStyle=D,this.strokeStyle=U,this.font=X,this.lineCap=ee,this.lineWidth=K,this.lineJoin=oe},E=function(D,U,X){for(var ee=0;ee<D.length;ee++)switch(D[ee].type){case"bct":D[ee].x2+=U,D[ee].y2+=X;case"qct":D[ee].x1+=U,D[ee].y1+=X;default:D[ee].x+=U,D[ee].y+=X}return D},A=function(D){return D.sort(function(U,X){return U-X})},S=function(D,U){for(var X,ee,K=this.fillStyle,oe=this.strokeStyle,me=this.lineCap,de=this.lineWidth,ye=Math.abs(de*this.ctx.transform.scaleX),Re=this.lineJoin,Oe=JSON.parse(JSON.stringify(this.path)),Me=JSON.parse(JSON.stringify(this.path)),Ee=[],ge=0;ge<Me.length;ge++)if(Me[ge].x!==void 0)for(var Te=x.call(this,Me[ge]),Be=0;Be<Te.length;Be+=1)Ee.indexOf(Te[Be])===-1&&Ee.push(Te[Be]);for(var Ce=0;Ce<Ee.length;Ce++)for(;this.pdf.internal.getNumberOfPages()<Ee[Ce];)b.call(this);if(A(Ee),this.autoPaging)for(var fe=Ee[0],Le=Ee[Ee.length-1],Ne=fe;Ne<Le+1;Ne++){this.pdf.setPage(Ne),this.fillStyle=K,this.strokeStyle=oe,this.lineCap=me,this.lineWidth=ye,this.lineJoin=Re;var ue=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Ae=Ne===1?this.posY+this.margin[0]:this.margin[0],Pe=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ue=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],st=Ne===1?0:Pe+(Ne-2)*Ue;if(this.ctx.clip_path.length!==0){var dt=this.path;X=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=E(X,this.posX+this.margin[3],-st+Ae+this.ctx.prevPageLastElemOffset),k.call(this,D,!0),this.path=dt}if(ee=JSON.parse(JSON.stringify(Oe)),this.path=E(ee,this.posX+this.margin[3],-st+Ae+this.ctx.prevPageLastElemOffset),U===!1||Ne===0){var pt=(Ne>fe||Ne<Le)&&_.call(this);pt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],ue,Ue,null).clip().discardPath()),k.call(this,D,U),pt&&this.pdf.restoreGraphicsState()}this.lineWidth=de}else this.lineWidth=ye,k.call(this,D,U),this.lineWidth=de;this.path=Oe},k=function(D,U){if((D!=="stroke"||U||!y.call(this))&&(D==="stroke"||U||!p.call(this))){for(var X,ee,K=[],oe=this.path,me=0;me<oe.length;me++){var de=oe[me];switch(de.type){case"begin":K.push({begin:!0});break;case"close":K.push({close:!0});break;case"mt":K.push({start:de,deltas:[],abs:[]});break;case"lt":var ye=K.length;if(oe[me-1]&&!isNaN(oe[me-1].x)&&(X=[de.x-oe[me-1].x,de.y-oe[me-1].y],ye>0)){for(;ye>=0;ye--)if(K[ye-1].close!==!0&&K[ye-1].begin!==!0){K[ye-1].deltas.push(X),K[ye-1].abs.push(de);break}}break;case"bct":X=[de.x1-oe[me-1].x,de.y1-oe[me-1].y,de.x2-oe[me-1].x,de.y2-oe[me-1].y,de.x-oe[me-1].x,de.y-oe[me-1].y],K[K.length-1].deltas.push(X);break;case"qct":var Re=oe[me-1].x+2/3*(de.x1-oe[me-1].x),Oe=oe[me-1].y+2/3*(de.y1-oe[me-1].y),Me=de.x+2/3*(de.x1-de.x),Ee=de.y+2/3*(de.y1-de.y),ge=de.x,Te=de.y;X=[Re-oe[me-1].x,Oe-oe[me-1].y,Me-oe[me-1].x,Ee-oe[me-1].y,ge-oe[me-1].x,Te-oe[me-1].y],K[K.length-1].deltas.push(X);break;case"arc":K.push({deltas:[],abs:[],arc:!0}),Array.isArray(K[K.length-1].abs)&&K[K.length-1].abs.push(de)}}ee=U?null:D==="stroke"?"stroke":"fill";for(var Be=!1,Ce=0;Ce<K.length;Ce++)if(K[Ce].arc)for(var fe=K[Ce].abs,Le=0;Le<fe.length;Le++){var Ne=fe[Le];Ne.type==="arc"?M.call(this,Ne.x,Ne.y,Ne.radius,Ne.startAngle,Ne.endAngle,Ne.counterclockwise,void 0,U,!Be):$.call(this,Ne.x,Ne.y),Be=!0}else if(K[Ce].close===!0)this.pdf.internal.out("h"),Be=!1;else if(K[Ce].begin!==!0){var ue=K[Ce].start.x,Ae=K[Ce].start.y;q.call(this,K[Ce].deltas,ue,Ae),Be=!0}ee&&F.call(this,ee),U&&j.call(this)}},I=function(D){var U=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,X=U*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return D-X;case"top":return D+U-X;case"hanging":return D+U-2*X;case"middle":return D+U/2-X;default:return D}},O=function(D){return D+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};g.prototype.createLinearGradient=function(){var D=function(){};return D.colorStops=[],D.addColorStop=function(U,X){this.colorStops.push([U,X])},D.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},D.isCanvasGradient=!0,D},g.prototype.createPattern=function(){return this.createLinearGradient()},g.prototype.createRadialGradient=function(){return this.createLinearGradient()};var M=function(D,U,X,ee,K,oe,me,de,ye){for(var Re=ae.call(this,X,ee,K,oe),Oe=0;Oe<Re.length;Oe++){var Me=Re[Oe];Oe===0&&(ye?T.call(this,Me.x1+D,Me.y1+U):$.call(this,Me.x1+D,Me.y1+U)),J.call(this,D,U,Me.x2,Me.y2,Me.x3,Me.y3,Me.x4,Me.y4)}de?j.call(this):F.call(this,me)},F=function(D){switch(D){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},j=function(){this.pdf.clip(),this.pdf.discardPath()},T=function(D,U){this.pdf.internal.out(n(D)+" "+r(U)+" m")},L=function(D){var U;switch(D.align){case"right":case"end":U="right";break;case"center":U="center";break;default:U="left"}var X=this.pdf.getTextDimensions(D.text),ee=I.call(this,D.y),K=O.call(this,ee)-X.h,oe=this.ctx.transform.applyToPoint(new o(D.x,ee)),me=this.ctx.transform.decompose(),de=new u;de=(de=(de=de.multiply(me.translate)).multiply(me.skew)).multiply(me.scale);for(var ye,Re,Oe,Me=this.ctx.transform.applyToRectangle(new s(D.x,ee,X.w,X.h)),Ee=de.applyToRectangle(new s(D.x,K,X.w,X.h)),ge=x.call(this,Ee),Te=[],Be=0;Be<ge.length;Be+=1)Te.indexOf(ge[Be])===-1&&Te.push(ge[Be]);if(A(Te),this.autoPaging)for(var Ce=Te[0],fe=Te[Te.length-1],Le=Ce;Le<fe+1;Le++){this.pdf.setPage(Le);var Ne=Le===1?this.posY+this.margin[0]:this.margin[0],ue=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ae=this.pdf.internal.pageSize.height-this.margin[2],Pe=Ae-this.margin[0],Ue=this.pdf.internal.pageSize.width-this.margin[1],st=Ue-this.margin[3],dt=Le===1?0:ue+(Le-2)*Pe;if(this.ctx.clip_path.length!==0){var pt=this.path;ye=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=E(ye,this.posX+this.margin[3],-1*dt+Ne),k.call(this,"fill",!0),this.path=pt}var xt=E([JSON.parse(JSON.stringify(Ee))],this.posX+this.margin[3],-dt+Ne+this.ctx.prevPageLastElemOffset)[0];D.scale>=.01&&(Re=this.pdf.internal.getFontSize(),this.pdf.setFontSize(Re*D.scale),Oe=this.lineWidth,this.lineWidth=Oe*D.scale);var bt=this.autoPaging!=="text";if(bt||xt.y+xt.h<=Ae){if(bt||xt.y>=Ne&&xt.x<=Ue){var kt=bt?D.text:this.pdf.splitTextToSize(D.text,D.maxWidth||Ue-xt.x)[0],qn=E([JSON.parse(JSON.stringify(Me))],this.posX+this.margin[3],-dt+Ne+this.ctx.prevPageLastElemOffset)[0],xn=bt&&(Le>Ce||Le<fe)&&_.call(this);xn&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],st,Pe,null).clip().discardPath()),this.pdf.text(kt,qn.x,qn.y,{angle:D.angle,align:U,renderingMode:D.renderingMode}),xn&&this.pdf.restoreGraphicsState()}}else xt.y<Ae&&(this.ctx.prevPageLastElemOffset+=Ae-xt.y);D.scale>=.01&&(this.pdf.setFontSize(Re),this.lineWidth=Oe)}else D.scale>=.01&&(Re=this.pdf.internal.getFontSize(),this.pdf.setFontSize(Re*D.scale),Oe=this.lineWidth,this.lineWidth=Oe*D.scale),this.pdf.text(D.text,oe.x+this.posX,oe.y+this.posY,{angle:D.angle,align:U,renderingMode:D.renderingMode,maxWidth:D.maxWidth}),D.scale>=.01&&(this.pdf.setFontSize(Re),this.lineWidth=Oe)},$=function(D,U,X,ee){X=X||0,ee=ee||0,this.pdf.internal.out(n(D+X)+" "+r(U+ee)+" l")},q=function(D,U,X){return this.pdf.lines(D,U,X,null,null)},J=function(D,U,X,ee,K,oe,me,de){this.pdf.internal.out([e(i(X+D)),e(a(ee+U)),e(i(K+D)),e(a(oe+U)),e(i(me+D)),e(a(de+U)),"c"].join(" "))},ae=function(D,U,X,ee){for(var K=2*Math.PI,oe=Math.PI/2;U>X;)U-=K;var me=Math.abs(X-U);me<K&&ee&&(me=K-me);for(var de=[],ye=ee?-1:1,Re=U;me>1e-5;){var Oe=Re+ye*Math.min(me,oe);de.push(ie.call(this,D,Re,Oe)),me-=Math.abs(Oe-Re),Re=Oe}return de},ie=function(D,U,X){var ee=(X-U)/2,K=D*Math.cos(ee),oe=D*Math.sin(ee),me=K,de=-oe,ye=me*me+de*de,Re=ye+me*K+de*oe,Oe=4/3*(Math.sqrt(2*ye*Re)-Re)/(me*oe-de*K),Me=me-Oe*de,Ee=de+Oe*me,ge=Me,Te=-Ee,Be=ee+U,Ce=Math.cos(Be),fe=Math.sin(Be);return{x1:D*Math.cos(U),y1:D*Math.sin(U),x2:Me*Ce-Ee*fe,y2:Me*fe+Ee*Ce,x3:ge*Ce-Te*fe,y3:ge*fe+Te*Ce,x4:D*Math.cos(X),y4:D*Math.sin(X)}},Z=function(D){return 180*D/Math.PI},te=function(D,U,X,ee,K,oe){var me=D+.5*(X-D),de=U+.5*(ee-U),ye=K+.5*(X-K),Re=oe+.5*(ee-oe),Oe=Math.min(D,K,me,ye),Me=Math.max(D,K,me,ye),Ee=Math.min(U,oe,de,Re),ge=Math.max(U,oe,de,Re);return new s(Oe,Ee,Me-Oe,ge-Ee)},V=function(D,U,X,ee,K,oe,me,de){var ye,Re,Oe,Me,Ee,ge,Te,Be,Ce,fe,Le,Ne,ue,Ae,Pe=X-D,Ue=ee-U,st=K-X,dt=oe-ee,pt=me-K,xt=de-oe;for(Re=0;Re<41;Re++)Ce=(Te=(Oe=D+(ye=Re/40)*Pe)+ye*((Ee=X+ye*st)-Oe))+ye*(Ee+ye*(K+ye*pt-Ee)-Te),fe=(Be=(Me=U+ye*Ue)+ye*((ge=ee+ye*dt)-Me))+ye*(ge+ye*(oe+ye*xt-ge)-Be),Re==0?(Le=Ce,Ne=fe,ue=Ce,Ae=fe):(Le=Math.min(Le,Ce),Ne=Math.min(Ne,fe),ue=Math.max(ue,Ce),Ae=Math.max(Ae,fe));return new s(Math.round(Le),Math.round(Ne),Math.round(ue-Le),Math.round(Ae-Ne))},B=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var D,U,X=(D=this.ctx.lineDash,U=this.ctx.lineDashOffset,JSON.stringify({lineDash:D,lineDashOffset:U}));this.prevLineDash!==X&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=X)}}})(tn.API),(function(t){var e=function(o){var s,u,h,f,g,v,p,y,_,x;for(u=[],h=0,f=(o+=s="\0\0\0\0".slice(o.length%4||4)).length;f>h;h+=4)(g=(o.charCodeAt(h)<<24)+(o.charCodeAt(h+1)<<16)+(o.charCodeAt(h+2)<<8)+o.charCodeAt(h+3))!==0?(v=(g=((g=((g=((g=(g-(x=g%85))/85)-(_=g%85))/85)-(y=g%85))/85)-(p=g%85))/85)%85,u.push(v+33,p+33,y+33,_+33,x+33)):u.push(122);return(function(b,E){for(var A=E;A>0;A--)b.pop()})(u,s.length),String.fromCharCode.apply(String,u)+"~>"},n=function(o){var s,u,h,f,g,v=String,p="length",y=255,_="charCodeAt",x="slice",b="replace";for(o[x](-2),o=o[x](0,-2)[b](/\s/g,"")[b]("z","!!!!!"),h=[],f=0,g=(o+=s="uuuuu"[x](o[p]%5||5))[p];g>f;f+=5)u=52200625*(o[_](f)-33)+614125*(o[_](f+1)-33)+7225*(o[_](f+2)-33)+85*(o[_](f+3)-33)+(o[_](f+4)-33),h.push(y&u>>24,y&u>>16,y&u>>8,y&u);return(function(E,A){for(var S=A;S>0;S--)E.pop()})(h,s[p]),v.fromCharCode.apply(v,h)},r=function(o){return o.split("").map(function(s){return("0"+s.charCodeAt().toString(16)).slice(-2)}).join("")+">"},i=function(o){var s=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((o=o.replace(/\s/g,"")).indexOf(">")!==-1&&(o=o.substr(0,o.indexOf(">"))),o.length%2&&(o+="0"),s.test(o)===!1)return"";for(var u="",h=0;h<o.length;h+=2)u+=String.fromCharCode("0x"+(o[h]+o[h+1]));return u},a=function(o){for(var s=new Uint8Array(o.length),u=o.length;u--;)s[u]=o.charCodeAt(u);return(s=Om(s)).reduce(function(h,f){return h+String.fromCharCode(f)},"")};t.processDataByFilters=function(o,s){var u=0,h=o||"",f=[];for(typeof(s=s||[])=="string"&&(s=[s]),u=0;u<s.length;u+=1)switch(s[u]){case"ASCII85Decode":case"/ASCII85Decode":h=n(h),f.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":h=e(h),f.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":h=i(h),f.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":h=r(h),f.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":h=a(h),f.push("/FlateDecode");break;default:throw new Error('The filter: "'+s[u]+'" is not implemented')}return{data:h,reverseChain:f.reverse().join(" ")}}})(tn.API),(function(t){t.loadFile=function(e,n,r){return(function(i,a,o){a=a!==!1,o=typeof o=="function"?o:function(){};var s=void 0;try{s=(function(u,h,f){var g=new XMLHttpRequest,v=0,p=function(y){var _=y.length,x=[],b=String.fromCharCode;for(v=0;v<_;v+=1)x.push(b(255&y.charCodeAt(v)));return x.join("")};if(g.open("GET",u,!h),g.overrideMimeType("text/plain; charset=x-user-defined"),h===!1&&(g.onload=function(){g.status===200?f(p(this.responseText)):f(void 0)}),g.send(null),h&&g.status===200)return p(g.responseText)})(i,a,o)}catch{}return s})(e,n,r)},t.loadImageFile=t.loadFile})(tn.API),(function(t){function e(){return(bn.html2canvas?Promise.resolve(bn.html2canvas):xv(()=>import("./html2canvas.esm-B0tyYwQk.js"),[],import.meta.url)).catch(function(s){return Promise.reject(new Error("Could not load html2canvas: "+s))}).then(function(s){return s.default?s.default:s})}function n(){return(bn.DOMPurify?Promise.resolve(bn.DOMPurify):xv(()=>import("./purify.es-B6FQ9oRL.js"),[],import.meta.url)).catch(function(s){return Promise.reject(new Error("Could not load dompurify: "+s))}).then(function(s){return s.default?s.default:s})}var r=function(s){var u=Nr(s);return u==="undefined"?"undefined":u==="string"||s instanceof String?"string":u==="number"||s instanceof Number?"number":u==="function"||s instanceof Function?"function":s&&s.constructor===Array?"array":s&&s.nodeType===1?"element":u==="object"?"object":"unknown"},i=function(s,u){var h=document.createElement(s);for(var f in u.className&&(h.className=u.className),u.innerHTML&&u.dompurify&&(h.innerHTML=u.dompurify.sanitize(u.innerHTML)),u.style)h.style[f]=u.style[f];return h},a=function s(u,h){for(var f=u.nodeType===3?document.createTextNode(u.nodeValue):u.cloneNode(!1),g=u.firstChild;g;g=g.nextSibling)h!==!0&&g.nodeType===1&&g.nodeName==="SCRIPT"||f.appendChild(s(g,h));return u.nodeType===1&&(u.nodeName==="CANVAS"?(f.width=u.width,f.height=u.height,f.getContext("2d").drawImage(u,0,0)):u.nodeName!=="TEXTAREA"&&u.nodeName!=="SELECT"||(f.value=u.value),f.addEventListener("load",function(){f.scrollTop=u.scrollTop,f.scrollLeft=u.scrollLeft},!0)),f},o=function s(u){var h=Object.assign(s.convert(Promise.resolve()),JSON.parse(JSON.stringify(s.template))),f=s.convert(Promise.resolve(),h);return(f=f.setProgress(1,s,1,[s])).set(u)};(o.prototype=Object.create(Promise.prototype)).constructor=o,o.convert=function(s,u){return s.__proto__=u||o.prototype,s},o.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},o.prototype.from=function(s,u){return this.then(function(){switch(u=u||(function(h){switch(r(h)){case"string":return"string";case"element":return h.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}})(s),u){case"string":return this.then(n).then(function(h){return this.set({src:i("div",{innerHTML:s,dompurify:h})})});case"element":return this.set({src:s});case"canvas":return this.set({canvas:s});case"img":return this.set({img:s});default:return this.error("Unknown source type.")}})},o.prototype.to=function(s){switch(s){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},o.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var s={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},u=a(this.prop.src,this.opt.html2canvas.javascriptEnabled);u.tagName==="BODY"&&(s.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=i("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=i("div",{className:"html2pdf__container",style:s}),this.prop.container.appendChild(u),this.prop.container.firstChild.appendChild(i("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},o.prototype.toCanvas=function(){var s=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(s).then(e).then(function(u){var h=Object.assign({},this.opt.html2canvas);return delete h.onrendered,u(this.prop.container,h)}).then(function(u){(this.opt.html2canvas.onrendered||function(){})(u),this.prop.canvas=u,document.body.removeChild(this.prop.overlay)})},o.prototype.toContext2d=function(){var s=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(s).then(e).then(function(u){var h=this.opt.jsPDF,f=this.opt.fontFaces,g=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,v=Object.assign({async:!0,allowTaint:!0,scale:g,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete v.onrendered,h.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,h.context2d.posX=this.opt.x,h.context2d.posY=this.opt.y,h.context2d.margin=this.opt.margin,h.context2d.fontFaces=f,f)for(var p=0;p<f.length;++p){var y=f[p],_=y.src.find(function(x){return x.format==="truetype"});_&&h.addFont(_.url,y.ref.name,y.ref.style)}return v.windowHeight=v.windowHeight||0,v.windowHeight=v.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):v.windowHeight,h.context2d.save(!0),u(this.prop.container,v)}).then(function(u){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(u),this.prop.canvas=u,document.body.removeChild(this.prop.overlay)})},o.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var s=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=s})},o.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},o.prototype.output=function(s,u,h){return(h=h||"pdf").toLowerCase()==="img"||h.toLowerCase()==="image"?this.outputImg(s,u):this.outputPdf(s,u)},o.prototype.outputPdf=function(s,u){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(s,u)})},o.prototype.outputImg=function(s){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(s){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+s+'" is not supported.'}})},o.prototype.save=function(s){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(s?{filename:s}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},o.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},o.prototype.set=function(s){if(r(s)!=="object")return this;var u=Object.keys(s||{}).map(function(h){if(h in o.template.prop)return function(){this.prop[h]=s[h]};switch(h){case"margin":return this.setMargin.bind(this,s.margin);case"jsPDF":return function(){return this.opt.jsPDF=s.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,s.pageSize);default:return function(){this.opt[h]=s[h]}}},this);return this.then(function(){return this.thenList(u)})},o.prototype.get=function(s,u){return this.then(function(){var h=s in o.template.prop?this.prop[s]:this.opt[s];return u?u(h):h})},o.prototype.setMargin=function(s){return this.then(function(){switch(r(s)){case"number":s=[s,s,s,s];case"array":if(s.length===2&&(s=[s[0],s[1],s[0],s[1]]),s.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=s}).then(this.setPageSize)},o.prototype.setPageSize=function(s){function u(h,f){return Math.floor(h*f/72*96)}return this.then(function(){(s=s||tn.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(s.inner={width:s.width-this.opt.margin[1]-this.opt.margin[3],height:s.height-this.opt.margin[0]-this.opt.margin[2]},s.inner.px={width:u(s.inner.width,s.k),height:u(s.inner.height,s.k)},s.inner.ratio=s.inner.height/s.inner.width),this.prop.pageSize=s})},o.prototype.setProgress=function(s,u,h,f){return s!=null&&(this.progress.val=s),u!=null&&(this.progress.state=u),h!=null&&(this.progress.n=h),f!=null&&(this.progress.stack=f),this.progress.ratio=this.progress.val/this.progress.state,this},o.prototype.updateProgress=function(s,u,h,f){return this.setProgress(s?this.progress.val+s:null,u||null,h?this.progress.n+h:null,f?this.progress.stack.concat(f):null)},o.prototype.then=function(s,u){var h=this;return this.thenCore(s,u,function(f,g){return h.updateProgress(null,null,1,[f]),Promise.prototype.then.call(this,function(v){return h.updateProgress(null,f),v}).then(f,g).then(function(v){return h.updateProgress(1),v})})},o.prototype.thenCore=function(s,u,h){h=h||Promise.prototype.then;var f=this;s&&(s=s.bind(f)),u&&(u=u.bind(f));var g=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?f:o.convert(Object.assign({},f),Promise.prototype),v=h.call(g,s,u);return o.convert(v,f.__proto__)},o.prototype.thenExternal=function(s,u){return Promise.prototype.then.call(this,s,u)},o.prototype.thenList=function(s){var u=this;return s.forEach(function(h){u=u.thenCore(h)}),u},o.prototype.catch=function(s){s&&(s=s.bind(this));var u=Promise.prototype.catch.call(this,s);return o.convert(u,this)},o.prototype.catchExternal=function(s){return Promise.prototype.catch.call(this,s)},o.prototype.error=function(s){return this.then(function(){throw new Error(s)})},o.prototype.using=o.prototype.set,o.prototype.saveAs=o.prototype.save,o.prototype.export=o.prototype.output,o.prototype.run=o.prototype.then,tn.getPageSize=function(s,u,h){if(Nr(s)==="object"){var f=s;s=f.orientation,u=f.unit||u,h=f.format||h}u=u||"mm",h=h||"a4",s=(""+(s||"P")).toLowerCase();var g,v=(""+h).toLowerCase(),p={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(u){case"pt":g=1;break;case"mm":g=72/25.4;break;case"cm":g=72/2.54;break;case"in":g=72;break;case"px":g=.75;break;case"pc":case"em":g=12;break;case"ex":g=6;break;default:throw"Invalid unit: "+u}var y,_=0,x=0;if(p.hasOwnProperty(v))_=p[v][1]/g,x=p[v][0]/g;else try{_=h[1],x=h[0]}catch{throw new Error("Invalid format: "+h)}if(s==="p"||s==="portrait")s="p",x>_&&(y=x,x=_,_=y);else{if(s!=="l"&&s!=="landscape")throw"Invalid orientation: "+s;s="l",_>x&&(y=x,x=_,_=y)}return{width:x,height:_,unit:u,k:g,orientation:s}},t.html=function(s,u){(u=u||{}).callback=u.callback||function(){},u.html2canvas=u.html2canvas||{},u.html2canvas.canvas=u.html2canvas.canvas||this.canvas,u.jsPDF=u.jsPDF||this,u.fontFaces=u.fontFaces?u.fontFaces.map(zv):null;var h=new o(u);return u.worker?h:h.from(s).doCallback()}})(tn.API),tn.API.addJS=function(t){return Dw=t,this.internal.events.subscribe("postPutResources",function(){U1=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(U1+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),jw=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+Dw+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){U1!==void 0&&jw!==void 0&&this.internal.out("/Names <</JavaScript "+U1+" 0 R>>")}),this},(function(t){var e;t.events.push(["postPutResources",function(){var n=this,r=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var i=n.outline.render().split(/\r\n/),a=0;a<i.length;a++){var o=i[a],s=r.exec(o);if(s!=null){var u=s[1];n.internal.newObjectDeferredBegin(u,!1)}n.internal.write(o)}if(this.outline.createNamedDestinations){var h=this.internal.pages.length,f=[];for(a=0;a<h;a++){var g=n.internal.newObject();f.push(g);var v=n.internal.getPageInfo(a+1);n.internal.write("<< /D["+v.objId+" 0 R /XYZ null null null]>> endobj")}var p=n.internal.newObject();for(n.internal.write("<< /Names [ "),a=0;a<f.length;a++)n.internal.write("(page_"+(a+1)+")"+f[a]+" 0 R");n.internal.write(" ] >>","endobj"),e=n.internal.newObject(),n.internal.write("<< /Dests "+p+" 0 R"),n.internal.write(">>","endobj")}}]),t.events.push(["putCatalog",function(){var n=this;n.outline.root.children.length>0&&(n.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&n.internal.write("/Names "+e+" 0 R"))}]),t.events.push(["initialized",function(){var n=this;n.outline={createNamedDestinations:!1,root:{children:[]}},n.outline.add=function(r,i,a){var o={title:i,options:a,children:[]};return r==null&&(r=this.root),r.children.push(o),o},n.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=n,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},n.outline.genIds_r=function(r){r.id=n.internal.newObjectDeferred();for(var i=0;i<r.children.length;i++)this.genIds_r(r.children[i])},n.outline.renderRoot=function(r){this.objStart(r),this.line("/Type /Outlines"),r.children.length>0&&(this.line("/First "+this.makeRef(r.children[0])),this.line("/Last "+this.makeRef(r.children[r.children.length-1]))),this.line("/Count "+this.count_r({count:0},r)),this.objEnd()},n.outline.renderItems=function(r){for(var i=this.ctx.pdf.internal.getVerticalCoordinateString,a=0;a<r.children.length;a++){var o=r.children[a];this.objStart(o),this.line("/Title "+this.makeString(o.title)),this.line("/Parent "+this.makeRef(r)),a>0&&this.line("/Prev "+this.makeRef(r.children[a-1])),a<r.children.length-1&&this.line("/Next "+this.makeRef(r.children[a+1])),o.children.length>0&&(this.line("/First "+this.makeRef(o.children[0])),this.line("/Last "+this.makeRef(o.children[o.children.length-1])));var s=this.count=this.count_r({count:0},o);if(s>0&&this.line("/Count "+s),o.options&&o.options.pageNumber){var u=n.internal.getPageInfo(o.options.pageNumber);this.line("/Dest ["+u.objId+" 0 R /XYZ 0 "+i(0)+" 0]")}this.objEnd()}for(var h=0;h<r.children.length;h++)this.renderItems(r.children[h])},n.outline.line=function(r){this.ctx.val+=r+`\r
567
+ `},n.outline.makeRef=function(r){return r.id+" 0 R"},n.outline.makeString=function(r){return"("+n.internal.pdfEscape(r)+")"},n.outline.objStart=function(r){this.ctx.val+=`\r
568
+ `+r.id+` 0 obj\r
569
+ <<\r
570
+ `},n.outline.objEnd=function(){this.ctx.val+=`>> \r
571
+ endobj\r
572
+ `},n.outline.count_r=function(r,i){for(var a=0;a<i.children.length;a++)r.count++,this.count_r(r,i.children[a]);return r.count}}])})(tn.API),(function(t){var e=[192,193,194,195,196,197,198,199];t.processJPEG=function(n,r,i,a,o,s){var u,h=this.decode.DCT_DECODE,f=null;if(typeof n=="string"||this.__addimage__.isArrayBuffer(n)||this.__addimage__.isArrayBufferView(n)){switch(n=o||n,n=this.__addimage__.isArrayBuffer(n)?new Uint8Array(n):n,u=(function(g){for(var v,p=256*g.charCodeAt(4)+g.charCodeAt(5),y=g.length,_={width:0,height:0,numcomponents:1},x=4;x<y;x+=2){if(x+=p,e.indexOf(g.charCodeAt(x+1))!==-1){v=256*g.charCodeAt(x+5)+g.charCodeAt(x+6),_={width:256*g.charCodeAt(x+7)+g.charCodeAt(x+8),height:v,numcomponents:g.charCodeAt(x+9)};break}p=256*g.charCodeAt(x+2)+g.charCodeAt(x+3)}return _})(n=this.__addimage__.isArrayBufferView(n)?this.__addimage__.arrayBufferToBinaryString(n):n),u.numcomponents){case 1:s=this.color_spaces.DEVICE_GRAY;break;case 4:s=this.color_spaces.DEVICE_CMYK;break;case 3:s=this.color_spaces.DEVICE_RGB}f={data:n,width:u.width,height:u.height,colorSpace:s,bitsPerComponent:8,filter:h,index:r,alias:i}}return f}})(tn.API),tn.API.processPNG=function(t,e,n,r){if(this.__addimage__.isArrayBuffer(t)&&(t=new Uint8Array(t)),this.__addimage__.isArrayBufferView(t)){var i,a=TI(t,{checkCrc:!0}),o=a.width,s=a.height,u=a.channels,h=a.palette,f=a.depth;i=h&&u===1?(function(M){for(var F=M.width,j=M.height,T=M.data,L=M.palette,$=M.depth,q=!1,J=[],ae=[],ie=void 0,Z=!1,te=0,V=0;V<L.length;V++){var B=q4(L[V],4),D=B[0],U=B[1],X=B[2],ee=B[3];J.push(D,U,X),ee!=null&&(ee===0?(te++,ae.length<1&&ae.push(V)):ee<255&&(Z=!0))}if(Z||te>1){q=!0,ae=void 0;var K=F*j;ie=new Uint8Array(K);for(var oe=new DataView(T.buffer),me=0;me<K;me++){var de=Uv(oe,me,$),ye=q4(L[de],4)[3];ie[me]=ye}}else te===0&&(ae=void 0);return{colorSpace:"Indexed",colorsPerPixel:1,sMaskBitsPerComponent:q?8:void 0,colorBytes:T,alphaBytes:ie,needSMask:q,palette:J,mask:ae}})(a):u===2||u===4?(function(M){for(var F=M.data,j=M.width,T=M.height,L=M.channels,$=M.depth,q=L===2?"DeviceGray":"DeviceRGB",J=L-1,ae=j*T,ie=J,Z=ae*ie,te=1*ae,V=Math.ceil(Z*$/8),B=Math.ceil(te*$/8),D=new Uint8Array(V),U=new Uint8Array(B),X=new DataView(F.buffer),ee=new DataView(D.buffer),K=new DataView(U.buffer),oe=!1,me=0;me<ae;me++){for(var de=me*L,ye=0;ye<ie;ye++)Ww(ee,Uv(X,de+ye,$),me*ie+ye,$);var Re=Uv(X,de+ie,$);Re<(1<<$)-1&&(oe=!0),Ww(K,Re,1*me,$)}return{colorSpace:q,colorsPerPixel:J,sMaskBitsPerComponent:oe?$:void 0,colorBytes:D,alphaBytes:U,needSMask:oe}})(a):(function(M){var F=M.data,j=M.channels===1?"DeviceGray":"DeviceRGB";return{colorSpace:j,colorsPerPixel:j==="DeviceGray"?1:3,colorBytes:F instanceof Uint16Array?(function(T){for(var L=T.length,$=new Uint8Array(2*L),q=new DataView($.buffer,$.byteOffset,$.byteLength),J=0;J<L;J++)q.setUint16(2*J,T[J],!1);return $})(F):F,needSMask:!1}})(a);var g,v,p,y=i,_=y.colorSpace,x=y.colorsPerPixel,b=y.sMaskBitsPerComponent,E=y.colorBytes,A=y.alphaBytes,S=y.needSMask,k=y.palette,I=y.mask,O=null;return r!==tn.API.image_compression.NONE&&typeof Om=="function"?(O=(function(M){var F;switch(M){case tn.API.image_compression.FAST:F=11;break;case tn.API.image_compression.MEDIUM:F=13;break;case tn.API.image_compression.SLOW:F=14;break;default:F=12}return F})(r),g=this.decode.FLATE_DECODE,v="/Predictor ".concat(O," /Colors ").concat(x," /BitsPerComponent ").concat(f," /Columns ").concat(o),t=qw(E,Math.ceil(o*x*f/8),x,f,r),S&&(p=qw(A,Math.ceil(o*b/8),1,b,r))):(g=void 0,v=void 0,t=E,S&&(p=A)),(this.__addimage__.isArrayBuffer(t)||this.__addimage__.isArrayBufferView(t))&&(t=this.__addimage__.arrayBufferToBinaryString(t)),(p&&this.__addimage__.isArrayBuffer(p)||this.__addimage__.isArrayBufferView(p))&&(p=this.__addimage__.arrayBufferToBinaryString(p)),{alias:n,data:t,index:e,filter:g,decodeParameters:v,transparency:I,palette:k,sMask:p,predictor:O,width:o,height:s,bitsPerComponent:f,sMaskBitsPerComponent:b,colorSpace:_}}},(function(t){t.processGIF89A=function(e,n,r,i){var a=new JI(e),o=a.width,s=a.height,u=[];a.decodeAndBlitFrameRGBA(0,u);var h={data:u,width:o,height:s},f=new Hv(100).encode(h,100);return t.processJPEG.call(this,f,n,r,i)},t.processGIF87A=t.processGIF89A})(tn.API),Zl.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var t=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(t);for(var e=0;e<t;e++){var n=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0);this.palette[e]={red:i,green:r,blue:n,quad:a}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},Zl.prototype.parseBGR=function(){this.pos=this.offset;try{var t="bit"+this.bitPP,e=this.width*this.height*4;this.data=new Uint8Array(e),this[t]()}catch(n){Yr.log("bit decode error:"+n)}},Zl.prototype.bit1=function(){var t,e=Math.ceil(this.width/8),n=e%4;for(t=this.height-1;t>=0;t--){for(var r=this.bottom_up?t:this.height-1-t,i=0;i<e;i++)for(var a=this.datav.getUint8(this.pos++,!0),o=r*this.width*4+8*i*4,s=0;s<8&&8*i+s<this.width;s++){var u=this.palette[a>>7-s&1];this.data[o+4*s]=u.blue,this.data[o+4*s+1]=u.green,this.data[o+4*s+2]=u.red,this.data[o+4*s+3]=255}n!==0&&(this.pos+=4-n)}},Zl.prototype.bit4=function(){for(var t=Math.ceil(this.width/2),e=t%4,n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<t;i++){var a=this.datav.getUint8(this.pos++,!0),o=r*this.width*4+2*i*4,s=a>>4,u=15&a,h=this.palette[s];if(this.data[o]=h.blue,this.data[o+1]=h.green,this.data[o+2]=h.red,this.data[o+3]=255,2*i+1>=this.width)break;h=this.palette[u],this.data[o+4]=h.blue,this.data[o+4+1]=h.green,this.data[o+4+2]=h.red,this.data[o+4+3]=255}e!==0&&(this.pos+=4-e)}},Zl.prototype.bit8=function(){for(var t=this.width%4,e=this.height-1;e>=0;e--){for(var n=this.bottom_up?e:this.height-1-e,r=0;r<this.width;r++){var i=this.datav.getUint8(this.pos++,!0),a=n*this.width*4+4*r;if(i<this.palette.length){var o=this.palette[i];this.data[a]=o.red,this.data[a+1]=o.green,this.data[a+2]=o.blue,this.data[a+3]=255}else this.data[a]=255,this.data[a+1]=255,this.data[a+2]=255,this.data[a+3]=255}t!==0&&(this.pos+=4-t)}},Zl.prototype.bit15=function(){for(var t=this.width%3,e=parseInt("11111",2),n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<this.width;i++){var a=this.datav.getUint16(this.pos,!0);this.pos+=2;var o=(a&e)/e*255|0,s=(a>>5&e)/e*255|0,u=(a>>10&e)/e*255|0,h=a>>15?255:0,f=r*this.width*4+4*i;this.data[f]=u,this.data[f+1]=s,this.data[f+2]=o,this.data[f+3]=h}this.pos+=t}},Zl.prototype.bit16=function(){for(var t=this.width%3,e=parseInt("11111",2),n=parseInt("111111",2),r=this.height-1;r>=0;r--){for(var i=this.bottom_up?r:this.height-1-r,a=0;a<this.width;a++){var o=this.datav.getUint16(this.pos,!0);this.pos+=2;var s=(o&e)/e*255|0,u=(o>>5&n)/n*255|0,h=(o>>11)/e*255|0,f=i*this.width*4+4*a;this.data[f]=h,this.data[f+1]=u,this.data[f+2]=s,this.data[f+3]=255}this.pos+=t}},Zl.prototype.bit24=function(){for(var t=this.height-1;t>=0;t--){for(var e=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),o=e*this.width*4+4*n;this.data[o]=a,this.data[o+1]=i,this.data[o+2]=r,this.data[o+3]=255}this.pos+=this.width%4}},Zl.prototype.bit32=function(){for(var t=this.height-1;t>=0;t--)for(var e=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),s=e*this.width*4+4*n;this.data[s]=a,this.data[s+1]=i,this.data[s+2]=r,this.data[s+3]=o}},Zl.prototype.getData=function(){return this.data},(function(t){t.processBMP=function(e,n,r,i){var a=new Zl(e,!1),o=a.width,s=a.height,u={data:a.getData(),width:o,height:s},h=new Hv(100).encode(u,100);return t.processJPEG.call(this,h,n,r,i)}})(tn.API),Yw.prototype.getData=function(){return this.data},(function(t){t.processWEBP=function(e,n,r,i){var a=new Yw(e),o=a.width,s=a.height,u={data:a.getData(),width:o,height:s},h=new Hv(100).encode(u,100);return t.processJPEG.call(this,h,n,r,i)}})(tn.API),tn.API.processRGBA=function(t,e,n){for(var r=t.data,i=r.length,a=new Uint8Array(i/4*3),o=new Uint8Array(i/4),s=0,u=0,h=0;h<i;h+=4){var f=r[h],g=r[h+1],v=r[h+2],p=r[h+3];a[s++]=f,a[s++]=g,a[s++]=v,o[u++]=p}var y=this.__addimage__.arrayBufferToBinaryString(a);return{alpha:this.__addimage__.arrayBufferToBinaryString(o),data:y,index:e,alias:n,colorSpace:"DeviceRGB",bitsPerComponent:8,width:t.width,height:t.height}},tn.API.setLanguage=function(t){return this.internal.languageSettings===void 0&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),{af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"North Macedonia",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[t]!==void 0&&(this.internal.languageSettings.languageCode=t,this.internal.languageSettings.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},Kh=tn.API,H1=Kh.getCharWidthsArray=function(t,e){var n,r,i=(e=e||{}).font||this.internal.getFont(),a=e.fontSize||this.internal.getFontSize(),o=e.charSpace||this.internal.getCharSpace(),s=e.widths?e.widths:i.metadata.Unicode.widths,u=s.fof?s.fof:1,h=e.kerning?e.kerning:i.metadata.Unicode.kerning,f=h.fof?h.fof:1,g=e.doKerning!==!1,v=0,p=t.length,y=0,_=s[0]||u,x=[];for(n=0;n<p;n++)r=t.charCodeAt(n),typeof i.metadata.widthOfString=="function"?x.push((i.metadata.widthOfGlyph(i.metadata.characterToGlyph(r))+o*(1e3/a)||0)/1e3):(v=g&&Nr(h[r])==="object"&&!isNaN(parseInt(h[r][y],10))?h[r][y]/f:0,x.push((s[r]||_)/u+v)),y=r;return x},Fw=Kh.getStringUnitWidth=function(t,e){var n=(e=e||{}).fontSize||this.internal.getFontSize(),r=e.font||this.internal.getFont(),i=e.charSpace||this.internal.getCharSpace();return Kh.processArabic&&(t=Kh.processArabic(t)),typeof r.metadata.widthOfString=="function"?r.metadata.widthOfString(t,n,i)/n:H1.apply(this,arguments).reduce(function(a,o){return a+o},0)},Bw=function(t,e,n,r){for(var i=[],a=0,o=t.length,s=0;a!==o&&s+e[a]<n;)s+=e[a],a++;i.push(t.slice(0,a));var u=a;for(s=0;a!==o;)s+e[a]>r&&(i.push(t.slice(u,a)),s=0,u=a),s+=e[a],a++;return u!==a&&i.push(t.slice(u,a)),i},zw=function(t,e,n){n||(n={});var r,i,a,o,s,u,h,f=[],g=[f],v=n.textIndent||0,p=0,y=0,_=t.split(" "),x=H1.apply(this,[" ",n])[0];if(u=n.lineIndent===-1?_[0].length+2:n.lineIndent||0){var b=Array(u).join(" "),E=[];_.map(function(S){(S=S.split(/\s*\n/)).length>1?E=E.concat(S.map(function(k,I){return(I&&k.length?`
573
+ `:"")+k})):E.push(S[0])}),_=E,u=Fw.apply(this,[b,n])}for(a=0,o=_.length;a<o;a++){var A=0;if(r=_[a],u&&r[0]==`
574
+ `&&(r=r.substr(1),A=1),v+p+(y=(i=H1.apply(this,[r,n])).reduce(function(S,k){return S+k},0))>e||A){if(y>e){for(s=Bw.apply(this,[r,i,e-(v+p),e]),f.push(s.shift()),f=[s.pop()];s.length;)g.push([s.shift()]);y=i.slice(r.length-(f[0]?f[0].length:0)).reduce(function(S,k){return S+k},0)}else f=[r];g.push(f),v=y+u,p=x}else f.push(r),v+=p+y,p=x}return h=u?function(S,k){return(k?b:"")+S.join(" ")}:function(S){return S.join(" ")},g.map(h)},Kh.splitTextToSize=function(t,e,n){var r,i=(n=n||{}).fontSize||this.internal.getFontSize(),a=(function(f){if(f.widths&&f.kerning)return{widths:f.widths,kerning:f.kerning};var g=this.internal.getFont(f.fontName,f.fontStyle),v="Unicode";return g.metadata[v]?{widths:g.metadata[v].widths||{0:1},kerning:g.metadata[v].kerning||{}}:{font:g.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,n);r=Array.isArray(t)?t:String(t).split(/\r?\n/);var o=1*this.internal.scaleFactor*e/i;a.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/i:0,a.lineIndent=n.lineIndent;var s,u,h=[];for(s=0,u=r.length;s<u;s++)h=h.concat(zw.apply(this,[r[s],o,a]));return h},(function(t){t.__fontmetrics__=t.__fontmetrics__||{};for(var e="0123456789abcdef",n="klmnopqrstuvwxyz",r={},i={},a=0;a<16;a++)r[n[a]]=e[a],i[e[a]]=n[a];var o=function(v){return"0x"+parseInt(v,10).toString(16)},s=t.__fontmetrics__.compress=function(v){var p,y,_,x,b=["{"];for(var E in v){if(p=v[E],isNaN(parseInt(E,10))?y="'"+E+"'":(E=parseInt(E,10),y=(y=o(E).slice(2)).slice(0,-1)+i[y.slice(-1)]),typeof p=="number")p<0?(_=o(p).slice(3),x="-"):(_=o(p).slice(2),x=""),_=x+_.slice(0,-1)+i[_.slice(-1)];else{if(Nr(p)!=="object")throw new Error("Don't know what to do with value type "+Nr(p)+".");_=s(p)}b.push(y+_)}return b.push("}"),b.join("")},u=t.__fontmetrics__.uncompress=function(v){if(typeof v!="string")throw new Error("Invalid argument passed to uncompress.");for(var p,y,_,x,b={},E=1,A=b,S=[],k="",I="",O=v.length-1,M=1;M<O;M+=1)(x=v[M])=="'"?p?(_=p.join(""),p=void 0):p=[]:p?p.push(x):x=="{"?(S.push([A,_]),A={},_=void 0):x=="}"?((y=S.pop())[0][y[1]]=A,_=void 0,A=y[0]):x=="-"?E=-1:_===void 0?r.hasOwnProperty(x)?(k+=r[x],_=parseInt(k,16)*E,E=1,k=""):k+=x:r.hasOwnProperty(x)?(I+=r[x],A[_]=parseInt(I,16)*E,E=1,_=void 0,I=""):I+=x;return b},h={codePages:["WinAnsiEncoding"],WinAnsiEncoding:u("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},f={Unicode:{Courier:h,"Courier-Bold":h,"Courier-BoldOblique":h,"Courier-Oblique":h,Helvetica:h,"Helvetica-Bold":h,"Helvetica-BoldOblique":h,"Helvetica-Oblique":h,"Times-Roman":h,"Times-Bold":h,"Times-BoldItalic":h,"Times-Italic":h}},g={Unicode:{"Courier-Oblique":u("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":u("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":u("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:u("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":u("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":u("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:u("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:u("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":u("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:u("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":u("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":u("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":u("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":u("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};t.events.push(["addFont",function(v){var p=v.font,y=g.Unicode[p.postScriptName];y&&(p.metadata.Unicode={},p.metadata.Unicode.widths=y.widths,p.metadata.Unicode.kerning=y.kerning);var _=f.Unicode[p.postScriptName];_&&(p.metadata.Unicode.encoding=_,p.encoding=_.codePages[0])}])})(tn.API),(function(t){var e=function(n){for(var r=n.length,i=new Uint8Array(r),a=0;a<r;a++)i[a]=n.charCodeAt(a);return i};t.API.events.push(["addFont",function(n){var r=void 0,i=n.font,a=n.instance;if(!i.isStandardFont){if(a===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");if(typeof(r=a.existsFileInVFS(i.postScriptName)===!1?a.loadFile(i.postScriptName):a.getFileFromVFS(i.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");(function(o,s){s=/^\x00\x01\x00\x00/.test(s)?e(s):e(e0(s)),o.metadata=t.API.TTFFont.open(s),o.metadata.Unicode=o.metadata.Unicode||{encoding:{},kerning:{},widths:[]},o.metadata.glyIdsUsed=[0]})(i,r)}}])})(tn),tn.API.addSvgAsImage=function(t,e,n,r,i,a,o,s){if(isNaN(e)||isNaN(n))throw Yr.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(i))throw Yr.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var u=document.createElement("canvas");u.width=r,u.height=i;var h=u.getContext("2d");h.fillStyle="#fff",h.fillRect(0,0,u.width,u.height);var f={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},g=this;return(bn.canvg?Promise.resolve(bn.canvg):xv(()=>import("./index.es-CWfYjgqJ.js"),[],import.meta.url)).catch(function(v){return Promise.reject(new Error("Could not load canvg: "+v))}).then(function(v){return v.default?v.default:v}).then(function(v){return v.fromString(h,t,f)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(v){return v.render(f)}).then(function(){g.addImage(u.toDataURL("image/jpeg",1),e,n,r,i,o,s)})},tn.API.putTotalPages=function(t){var e,n=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(t,"g"),n=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),n=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var i=0;i<this.internal.pages[r].length;i++)this.internal.pages[r][i]=this.internal.pages[r][i].replace(e,n);return this},tn.API.viewerPreferences=function(t,e){var n;t=t||{},e=e||!1;var r,i,a,o={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},s=Object.keys(o),u=[],h=0,f=0,g=0;function v(y,_){var x,b=!1;for(x=0;x<y.length;x+=1)y[x]===_&&(b=!0);return b}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,t==="reset"||e===!0){var p=s.length;for(g=0;g<p;g+=1)n[s[g]].value=n[s[g]].defaultValue,n[s[g]].explicitSet=!1}if(Nr(t)==="object"){for(i in t)if(a=t[i],v(s,i)&&a!==void 0){if(n[i].type==="boolean"&&typeof a=="boolean")n[i].value=a;else if(n[i].type==="name"&&v(n[i].valueSet,a))n[i].value=a;else if(n[i].type==="integer"&&Number.isInteger(a))n[i].value=a;else if(n[i].type==="array"){for(h=0;h<a.length;h+=1)if(r=!0,a[h].length===1&&typeof a[h][0]=="number")u.push(String(a[h]-1));else if(a[h].length>1){for(f=0;f<a[h].length;f+=1)typeof a[h][f]!="number"&&(r=!1);r===!0&&u.push([a[h][0]-1,a[h][1]-1].join(" "))}n[i].value="["+u.join(" ")+"]"}else n[i].value=n[i].defaultValue;n[i].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var y,_=[];for(y in n)n[y].explicitSet===!0&&(n[y].type==="name"?_.push("/"+y+" /"+n[y].value):_.push("/"+y+" "+n[y].value));_.length!==0&&this.internal.write(`/ViewerPreferences
575
+ <<
576
+ `+_.join(`
577
+ `)+`
578
+ >>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},(function(t){var e=function(){var r='<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+this.internal.__metadata__.namespaceuri+'"><jspdf:metadata>',i=unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')),a=unescape(encodeURIComponent(r)),o=unescape(encodeURIComponent(this.internal.__metadata__.metadata)),s=unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")),u=unescape(encodeURIComponent("</x:xmpmeta>")),h=a.length+o.length+s.length+i.length+u.length;this.internal.__metadata__.metadata_object_number=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+h+" >>"),this.internal.write("stream"),this.internal.write(i+a+o+s+u),this.internal.write("endstream"),this.internal.write("endobj")},n=function(){this.internal.__metadata__.metadata_object_number&&this.internal.write("/Metadata "+this.internal.__metadata__.metadata_object_number+" 0 R")};t.addMetadata=function(r,i){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:r,namespaceuri:i||"http://jspdf.default.namespaceuri/"},this.internal.events.subscribe("putCatalog",n),this.internal.events.subscribe("postPutResources",e)),this}})(tn.API),(function(t){var e=t.API,n=e.pdfEscape16=function(a,o){for(var s,u=o.metadata.Unicode.widths,h=["","0","00","000","0000"],f=[""],g=0,v=a.length;g<v;++g){if(s=o.metadata.characterToGlyph(a.charCodeAt(g)),o.metadata.glyIdsUsed.push(s),o.metadata.toUnicode[s]=a.charCodeAt(g),u.indexOf(s)==-1&&(u.push(s),u.push([parseInt(o.metadata.widthOfGlyph(s),10)])),s=="0")return f.join("");s=s.toString(16),f.push(h[4-s.length],s)}return f.join("")},r=function(a){var o,s,u,h,f,g,v;for(f=`/CIDInit /ProcSet findresource begin
579
+ 12 dict begin
580
+ begincmap
581
+ /CIDSystemInfo <<
582
+ /Registry (Adobe)
583
+ /Ordering (UCS)
584
+ /Supplement 0
585
+ >> def
586
+ /CMapName /Adobe-Identity-UCS def
587
+ /CMapType 2 def
588
+ 1 begincodespacerange
589
+ <0000><ffff>
590
+ endcodespacerange`,u=[],g=0,v=(s=Object.keys(a).sort(function(p,y){return p-y})).length;g<v;g++)o=s[g],u.length>=100&&(f+=`
591
+ `+u.length+` beginbfchar
592
+ `+u.join(`
593
+ `)+`
594
+ endbfchar`,u=[]),a[o]!==void 0&&a[o]!==null&&typeof a[o].toString=="function"&&(h=("0000"+a[o].toString(16)).slice(-4),o=("0000"+(+o).toString(16)).slice(-4),u.push("<"+o+"><"+h+">"));return u.length&&(f+=`
595
+ `+u.length+` beginbfchar
596
+ `+u.join(`
597
+ `)+`
598
+ endbfchar
599
+ `),f+`endcmap
600
+ CMapName currentdict /CMap defineresource pop
601
+ end
602
+ end`};e.events.push(["putFont",function(a){(function(o){var s=o.font,u=o.out,h=o.newObject,f=o.putStream;if(s.metadata instanceof t.API.TTFFont&&s.encoding==="Identity-H"){for(var g=s.metadata.Unicode.widths,v=s.metadata.subset.encode(s.metadata.glyIdsUsed,1),p="",y=0;y<v.length;y++)p+=String.fromCharCode(v[y]);var _=h();f({data:p,addLength1:!0,objectId:_}),u("endobj");var x=h();f({data:r(s.metadata.toUnicode),addLength1:!0,objectId:x}),u("endobj");var b=h();u("<<"),u("/Type /FontDescriptor"),u("/FontName /"+ed(s.fontName)),u("/FontFile2 "+_+" 0 R"),u("/FontBBox "+t.API.PDFObject.convert(s.metadata.bbox)),u("/Flags "+s.metadata.flags),u("/StemV "+s.metadata.stemV),u("/ItalicAngle "+s.metadata.italicAngle),u("/Ascent "+s.metadata.ascender),u("/Descent "+s.metadata.decender),u("/CapHeight "+s.metadata.capHeight),u(">>"),u("endobj");var E=h();u("<<"),u("/Type /Font"),u("/BaseFont /"+ed(s.fontName)),u("/FontDescriptor "+b+" 0 R"),u("/W "+t.API.PDFObject.convert(g)),u("/CIDToGIDMap /Identity"),u("/DW 1000"),u("/Subtype /CIDFontType2"),u("/CIDSystemInfo"),u("<<"),u("/Supplement 0"),u("/Registry (Adobe)"),u("/Ordering ("+s.encoding+")"),u(">>"),u(">>"),u("endobj"),s.objectNumber=h(),u("<<"),u("/Type /Font"),u("/Subtype /Type0"),u("/ToUnicode "+x+" 0 R"),u("/BaseFont /"+ed(s.fontName)),u("/Encoding /"+s.encoding),u("/DescendantFonts ["+E+" 0 R]"),u(">>"),u("endobj"),s.isAlreadyPutted=!0}})(a)}]),e.events.push(["putFont",function(a){(function(o){var s=o.font,u=o.out,h=o.newObject,f=o.putStream;if(s.metadata instanceof t.API.TTFFont&&s.encoding==="WinAnsiEncoding"){for(var g=s.metadata.rawData,v="",p=0;p<g.length;p++)v+=String.fromCharCode(g[p]);var y=h();f({data:v,addLength1:!0,objectId:y}),u("endobj");var _=h();f({data:r(s.metadata.toUnicode),addLength1:!0,objectId:_}),u("endobj");var x=h();u("<<"),u("/Descent "+s.metadata.decender),u("/CapHeight "+s.metadata.capHeight),u("/StemV "+s.metadata.stemV),u("/Type /FontDescriptor"),u("/FontFile2 "+y+" 0 R"),u("/Flags 96"),u("/FontBBox "+t.API.PDFObject.convert(s.metadata.bbox)),u("/FontName /"+ed(s.fontName)),u("/ItalicAngle "+s.metadata.italicAngle),u("/Ascent "+s.metadata.ascender),u(">>"),u("endobj"),s.objectNumber=h();for(var b=0;b<s.metadata.hmtx.widths.length;b++)s.metadata.hmtx.widths[b]=parseInt(s.metadata.hmtx.widths[b]*(1e3/s.metadata.head.unitsPerEm));u("<</Subtype/TrueType/Type/Font/ToUnicode "+_+" 0 R/BaseFont/"+ed(s.fontName)+"/FontDescriptor "+x+" 0 R/Encoding/"+s.encoding+" /FirstChar 29 /LastChar 255 /Widths "+t.API.PDFObject.convert(s.metadata.hmtx.widths)+">>"),u("endobj"),s.isAlreadyPutted=!0}})(a)}]);var i=function(a){var o,s=a.text||"",u=a.x,h=a.y,f=a.options||{},g=a.mutex||{},v=g.pdfEscape,p=g.activeFontKey,y=g.fonts,_=p,x="",b=0,E="",A=y[_].encoding;if(y[_].encoding!=="Identity-H")return{text:s,x:u,y:h,options:f,mutex:g};for(E=s,_=p,Array.isArray(s)&&(E=s[0]),b=0;b<E.length;b+=1)y[_].metadata.hasOwnProperty("cmap")&&(o=y[_].metadata.cmap.unicode.codeMap[E[b].charCodeAt(0)]),o||E[b].charCodeAt(0)<256&&y[_].metadata.hasOwnProperty("Unicode")?x+=E[b]:x+="";var S="";return parseInt(_.slice(1))<14||A==="WinAnsiEncoding"?S=v(x,_).split("").map(function(k){return k.charCodeAt(0).toString(16)}).join(""):A==="Identity-H"&&(S=n(x,y[_])),g.isHex=!0,{text:S,x:u,y:h,options:f,mutex:g}};e.events.push(["postProcessText",function(a){var o=a.text||"",s=[],u={text:o,x:a.x,y:a.y,options:a.options,mutex:a.mutex};if(Array.isArray(o)){var h=0;for(h=0;h<o.length;h+=1)Array.isArray(o[h])&&o[h].length===3?s.push([i(Object.assign({},u,{text:o[h][0]})).text,o[h][1],o[h][2]]):s.push(i(Object.assign({},u,{text:o[h]})).text);a.text=s}else a.text=i(Object.assign({},u,{text:o})).text}])})(tn),(function(t){var e=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};t.existsFileInVFS=function(n){return e.call(this),this.internal.vFS[n]!==void 0},t.addFileToVFS=function(n,r){return e.call(this),this.internal.vFS[n]=r,this},t.getFileFromVFS=function(n){return e.call(this),this.internal.vFS[n]!==void 0?this.internal.vFS[n]:null}})(tn.API),(function(t){t.__bidiEngine__=t.prototype.__bidiEngine__=function(r){var i,a,o,s,u,h,f,g=e,v=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],p=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],y={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},_={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},x=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],b=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),E=!1,A=0;this.__bidiEngine__={};var S=function(T){var L=T.charCodeAt(),$=L>>8,q=_[$];return q!==void 0?g[256*q+(255&L)]:$===252||$===253?"AL":b.test($)?"L":$===8?"R":"N"},k=function(T){for(var L,$=0;$<T.length;$++){if((L=S(T.charAt($)))==="L")return!1;if(L==="R")return!0}return!1},I=function(T,L,$,q){var J,ae,ie,Z,te=L[q];switch(te){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":E=!1;break;case"N":case"AN":break;case"EN":E&&(te="AN");break;case"AL":E=!0,te="R";break;case"WS":case"BN":te="N";break;case"CS":q<1||q+1>=L.length||(J=$[q-1])!=="EN"&&J!=="AN"||(ae=L[q+1])!=="EN"&&ae!=="AN"?te="N":E&&(ae="AN"),te=ae===J?ae:"N";break;case"ES":te=(J=q>0?$[q-1]:"B")==="EN"&&q+1<L.length&&L[q+1]==="EN"?"EN":"N";break;case"ET":if(q>0&&$[q-1]==="EN"){te="EN";break}if(E){te="N";break}for(ie=q+1,Z=L.length;ie<Z&&L[ie]==="ET";)ie++;te=ie<Z&&L[ie]==="EN"?"EN":"N";break;case"NSM":if(o&&!s){for(Z=L.length,ie=q+1;ie<Z&&L[ie]==="NSM";)ie++;if(ie<Z){var V=T[q],B=V>=1425&&V<=2303||V===64286;if(J=L[ie],B&&(J==="R"||J==="AL")){te="R";break}}}te=q<1||(J=L[q-1])==="B"?"N":$[q-1];break;case"B":E=!1,i=!0,te=A;break;case"S":a=!0,te="N"}return te},O=function(T,L,$){var q=T.split("");return $&&M(q,$,{hiLevel:A}),q.reverse(),L&&L.reverse(),q.join("")},M=function(T,L,$){var q,J,ae,ie,Z,te=-1,V=T.length,B=0,D=[],U=A?p:v,X=[];for(E=!1,i=!1,a=!1,J=0;J<V;J++)X[J]=S(T[J]);for(ae=0;ae<V;ae++){if(Z=B,D[ae]=I(T,X,D,ae),q=240&(B=U[Z][y[D[ae]]]),B&=15,L[ae]=ie=U[B][5],q>0)if(q===16){for(J=te;J<ae;J++)L[J]=1;te=-1}else te=-1;if(U[B][6])te===-1&&(te=ae);else if(te>-1){for(J=te;J<ae;J++)L[J]=ie;te=-1}X[ae]==="B"&&(L[ae]=0),$.hiLevel|=ie}a&&(function(ee,K,oe){for(var me=0;me<oe;me++)if(ee[me]==="S"){K[me]=A;for(var de=me-1;de>=0&&ee[de]==="WS";de--)K[de]=A}})(X,L,V)},F=function(T,L,$,q,J){if(!(J.hiLevel<T)){if(T===1&&A===1&&!i)return L.reverse(),void($&&$.reverse());for(var ae,ie,Z,te,V=L.length,B=0;B<V;){if(q[B]>=T){for(Z=B+1;Z<V&&q[Z]>=T;)Z++;for(te=B,ie=Z-1;te<ie;te++,ie--)ae=L[te],L[te]=L[ie],L[ie]=ae,$&&(ae=$[te],$[te]=$[ie],$[ie]=ae);B=Z}B++}}},j=function(T,L,$){var q=T.split(""),J={hiLevel:A};return $||($=[]),M(q,$,J),(function(ae,ie,Z){if(Z.hiLevel!==0&&f)for(var te,V=0;V<ae.length;V++)ie[V]===1&&(te=x.indexOf(ae[V]))>=0&&(ae[V]=x[te+1])})(q,$,J),F(2,q,L,$,J),F(1,q,L,$,J),q.join("")};return this.__bidiEngine__.doBidiReorder=function(T,L,$){if((function(J,ae){if(ae)for(var ie=0;ie<J.length;ie++)ae[ie]=ie;s===void 0&&(s=k(J)),h===void 0&&(h=k(J))})(T,L),o||!u||h)if(o&&u&&s^h)A=s?1:0,T=O(T,L,$);else if(!o&&u&&h)A=s?1:0,T=j(T,L,$),T=O(T,L);else if(!o||s||u||h){if(o&&!u&&s^h)T=O(T,L),s?(A=0,T=j(T,L,$)):(A=1,T=j(T,L,$),T=O(T,L));else if(o&&s&&!u&&h)A=1,T=j(T,L,$),T=O(T,L);else if(!o&&!u&&s^h){var q=f;s?(A=1,T=j(T,L,$),A=0,f=!1,T=j(T,L,$),f=q):(A=0,T=j(T,L,$),T=O(T,L),A=1,f=!1,T=j(T,L,$),f=q,T=O(T,L))}}else A=0,T=j(T,L,$);else A=s?1:0,T=j(T,L,$);return T},this.__bidiEngine__.setOptions=function(T){T&&(o=T.isInputVisual,u=T.isOutputVisual,s=T.isInputRtl,h=T.isOutputRtl,f=T.isSymmetricSwapping)},this.__bidiEngine__.setOptions(r),this.__bidiEngine__};var e=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],n=new t.__bidiEngine__({isInputVisual:!0});t.API.events.push(["postProcessText",function(r){var i=r.text;r.x,r.y;var a=r.options||{};r.mutex,a.lang;var o=[];if(a.isInputVisual=typeof a.isInputVisual!="boolean"||a.isInputVisual,n.setOptions(a),Object.prototype.toString.call(i)==="[object Array]"){var s=0;for(o=[],s=0;s<i.length;s+=1)Object.prototype.toString.call(i[s])==="[object Array]"?o.push([n.doBidiReorder(i[s][0]),i[s][1],i[s][2]]):o.push([n.doBidiReorder(i[s])]);r.text=o}else r.text=n.doBidiReorder(i);n.setOptions({isInputVisual:!0})}])})(tn),tn.API.TTFFont=(function(){function t(e){var n;if(this.rawData=e,n=this.contents=new xf(e),this.contents.pos=4,n.readString(4)==="ttcf")throw new Error("TTCF not supported.");n.pos=0,this.parse(),this.subset=new pj(this),this.registerTTF()}return t.open=function(e){return new t(e)},t.prototype.parse=function(){return this.directory=new ej(this.contents),this.head=new nj(this),this.name=new sj(this),this.cmap=new hx(this),this.toUnicode={},this.hhea=new rj(this),this.maxp=new lj(this),this.hmtx=new uj(this),this.post=new aj(this),this.os2=new ij(this),this.loca=new dj(this),this.glyf=new cj(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},t.prototype.registerTTF=function(){var e,n,r,i,a;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=(function(){var o,s,u,h;for(h=[],o=0,s=(u=this.bbox).length;o<s;o++)e=u[o],h.push(Math.round(e*this.scaleFactor));return h}).call(this),this.stemV=0,this.post.exists?(r=255&(i=this.post.italic_angle),32768&(n=i>>16)&&(n=-(1+(65535^n))),this.italicAngle=+(n+"."+r)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=(a=this.familyClass)===1||a===2||a===3||a===4||a===5||a===7,this.isScript=this.familyClass===10,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),this.italicAngle!==0&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},t.prototype.characterToGlyph=function(e){var n;return((n=this.cmap.unicode)!=null?n.codeMap[e]:void 0)||0},t.prototype.widthOfGlyph=function(e){var n;return n=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(e).advance*n},t.prototype.widthOfString=function(e,n,r){var i,a,o,s;for(o=0,a=0,s=(e=""+e).length;0<=s?a<s:a>s;a=0<=s?++a:--a)i=e.charCodeAt(a),o+=this.widthOfGlyph(this.characterToGlyph(i))+r*(1e3/n)||0;return o*(n/1e3)},t.prototype.lineHeight=function(e,n){var r;return n==null&&(n=!1),r=n?this.lineGap:0,(this.ascender+r-this.decender)/1e3*e},t})();var su,xf=(function(){function t(e){this.data=e??[],this.pos=0,this.length=this.data.length}return t.prototype.readByte=function(){return this.data[this.pos++]},t.prototype.writeByte=function(e){return this.data[this.pos++]=e},t.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},t.prototype.writeUInt32=function(e){return this.writeByte(e>>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e)},t.prototype.readInt32=function(){var e;return(e=this.readUInt32())>=2147483648?e-4294967296:e},t.prototype.writeInt32=function(e){return e<0&&(e+=4294967296),this.writeUInt32(e)},t.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},t.prototype.writeUInt16=function(e){return this.writeByte(e>>8&255),this.writeByte(255&e)},t.prototype.readInt16=function(){var e;return(e=this.readUInt16())>=32768?e-65536:e},t.prototype.writeInt16=function(e){return e<0&&(e+=65536),this.writeUInt16(e)},t.prototype.readString=function(e){var n,r;for(r=[],n=0;0<=e?n<e:n>e;n=0<=e?++n:--n)r[n]=String.fromCharCode(this.readByte());return r.join("")},t.prototype.writeString=function(e){var n,r,i;for(i=[],n=0,r=e.length;0<=r?n<r:n>r;n=0<=r?++n:--n)i.push(this.writeByte(e.charCodeAt(n)));return i},t.prototype.readShort=function(){return this.readInt16()},t.prototype.writeShort=function(e){return this.writeInt16(e)},t.prototype.readLongLong=function(){var e,n,r,i,a,o,s,u;return e=this.readByte(),n=this.readByte(),r=this.readByte(),i=this.readByte(),a=this.readByte(),o=this.readByte(),s=this.readByte(),u=this.readByte(),128&e?-1*(72057594037927940*(255^e)+281474976710656*(255^n)+1099511627776*(255^r)+4294967296*(255^i)+16777216*(255^a)+65536*(255^o)+256*(255^s)+(255^u)+1):72057594037927940*e+281474976710656*n+1099511627776*r+4294967296*i+16777216*a+65536*o+256*s+u},t.prototype.writeLongLong=function(e){var n,r;return n=Math.floor(e/4294967296),r=4294967295&e,this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n),this.writeByte(r>>24&255),this.writeByte(r>>16&255),this.writeByte(r>>8&255),this.writeByte(255&r)},t.prototype.readInt=function(){return this.readInt32()},t.prototype.writeInt=function(e){return this.writeInt32(e)},t.prototype.read=function(e){var n,r;for(n=[],r=0;0<=e?r<e:r>e;r=0<=e?++r:--r)n.push(this.readByte());return n},t.prototype.write=function(e){var n,r,i,a;for(a=[],r=0,i=e.length;r<i;r++)n=e[r],a.push(this.writeByte(n));return a},t})(),ej=(function(){var t;function e(n){var r,i,a;for(this.scalarType=n.readInt(),this.tableCount=n.readShort(),this.searchRange=n.readShort(),this.entrySelector=n.readShort(),this.rangeShift=n.readShort(),this.tables={},i=0,a=this.tableCount;0<=a?i<a:i>a;i=0<=a?++i:--i)r={tag:n.readString(4),checksum:n.readInt(),offset:n.readInt(),length:n.readInt()},this.tables[r.tag]=r}return e.prototype.encode=function(n){var r,i,a,o,s,u,h,f,g,v,p,y,_;for(_ in p=Object.keys(n).length,u=Math.log(2),g=16*Math.floor(Math.log(p)/u),o=Math.floor(g/u),f=16*p-g,(i=new xf).writeInt(this.scalarType),i.writeShort(p),i.writeShort(g),i.writeShort(o),i.writeShort(f),a=16*p,h=i.pos+a,s=null,y=[],n)for(v=n[_],i.writeString(_),i.writeInt(t(v)),i.writeInt(h),i.writeInt(v.length),y=y.concat(v),_==="head"&&(s=h),h+=v.length;h%4;)y.push(0),h++;return i.write(y),r=2981146554-t(i.data),i.pos=s+8,i.writeUInt32(r),i.data},t=function(n){var r,i,a,o;for(n=dx.call(n);n.length%4;)n.push(0);for(a=new xf(n),i=0,r=0,o=n.length;r<o;r=r+=4)i+=a.readUInt32();return 4294967295&i},e})(),tj={}.hasOwnProperty,Wu=function(t,e){for(var n in e)tj.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t};su=(function(){function t(e){var n;this.file=e,n=this.file.directory.tables[this.tag],this.exists=!!n,n&&(this.offset=n.offset,this.length=n.length,this.parse(this.file.contents))}return t.prototype.parse=function(){},t.prototype.encode=function(){},t.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},t})();var nj=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Wu(t,su),t.prototype.tag="head",t.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.revision=e.readInt(),this.checkSumAdjustment=e.readInt(),this.magicNumber=e.readInt(),this.flags=e.readShort(),this.unitsPerEm=e.readShort(),this.created=e.readLongLong(),this.modified=e.readLongLong(),this.xMin=e.readShort(),this.yMin=e.readShort(),this.xMax=e.readShort(),this.yMax=e.readShort(),this.macStyle=e.readShort(),this.lowestRecPPEM=e.readShort(),this.fontDirectionHint=e.readShort(),this.indexToLocFormat=e.readShort(),this.glyphDataFormat=e.readShort()},t.prototype.encode=function(e){var n;return(n=new xf).writeInt(this.version),n.writeInt(this.revision),n.writeInt(this.checkSumAdjustment),n.writeInt(this.magicNumber),n.writeShort(this.flags),n.writeShort(this.unitsPerEm),n.writeLongLong(this.created),n.writeLongLong(this.modified),n.writeShort(this.xMin),n.writeShort(this.yMin),n.writeShort(this.xMax),n.writeShort(this.yMax),n.writeShort(this.macStyle),n.writeShort(this.lowestRecPPEM),n.writeShort(this.fontDirectionHint),n.writeShort(e),n.writeShort(this.glyphDataFormat),n.data},t})(),Xw=(function(){function t(e,n){var r,i,a,o,s,u,h,f,g,v,p,y,_,x,b,E,A;switch(this.platformID=e.readUInt16(),this.encodingID=e.readShort(),this.offset=n+e.readInt(),g=e.pos,e.pos=this.offset,this.format=e.readUInt16(),this.length=e.readUInt16(),this.language=e.readUInt16(),this.isUnicode=this.platformID===3&&this.encodingID===1&&this.format===4||this.platformID===0&&this.format===4,this.codeMap={},this.format){case 0:for(u=0;u<256;++u)this.codeMap[u]=e.readByte();break;case 4:for(p=e.readUInt16(),v=p/2,e.pos+=6,a=(function(){var S,k;for(k=[],u=S=0;0<=v?S<v:S>v;u=0<=v?++S:--S)k.push(e.readUInt16());return k})(),e.pos+=2,_=(function(){var S,k;for(k=[],u=S=0;0<=v?S<v:S>v;u=0<=v?++S:--S)k.push(e.readUInt16());return k})(),h=(function(){var S,k;for(k=[],u=S=0;0<=v?S<v:S>v;u=0<=v?++S:--S)k.push(e.readUInt16());return k})(),f=(function(){var S,k;for(k=[],u=S=0;0<=v?S<v:S>v;u=0<=v?++S:--S)k.push(e.readUInt16());return k})(),i=(this.length-e.pos+this.offset)/2,s=(function(){var S,k;for(k=[],u=S=0;0<=i?S<i:S>i;u=0<=i?++S:--S)k.push(e.readUInt16());return k})(),u=b=0,A=a.length;b<A;u=++b)for(x=a[u],r=E=y=_[u];y<=x?E<=x:E>=x;r=y<=x?++E:--E)f[u]===0?o=r+h[u]:(o=s[f[u]/2+(r-y)-(v-u)]||0)!==0&&(o+=h[u]),this.codeMap[r]=65535&o}e.pos=g}return t.encode=function(e,n){var r,i,a,o,s,u,h,f,g,v,p,y,_,x,b,E,A,S,k,I,O,M,F,j,T,L,$,q,J,ae,ie,Z,te,V,B,D,U,X,ee,K,oe,me,de,ye,Re,Oe;switch(q=new xf,o=Object.keys(e).sort(function(Me,Ee){return Me-Ee}),n){case"macroman":for(_=0,x=(function(){var Me=[];for(y=0;y<256;++y)Me.push(0);return Me})(),E={0:0},a={},J=0,te=o.length;J<te;J++)E[de=e[i=o[J]]]==null&&(E[de]=++_),a[i]={old:e[i],new:E[e[i]]},x[i]=E[e[i]];return q.writeUInt16(1),q.writeUInt16(0),q.writeUInt32(12),q.writeUInt16(0),q.writeUInt16(262),q.writeUInt16(0),q.write(x),{charMap:a,subtable:q.data,maxGlyphID:_+1};case"unicode":for(L=[],g=[],A=0,E={},r={},b=h=null,ae=0,V=o.length;ae<V;ae++)E[k=e[i=o[ae]]]==null&&(E[k]=++A),r[i]={old:k,new:E[k]},s=E[k]-i,b!=null&&s===h||(b&&g.push(b),L.push(i),h=s),b=i;for(b&&g.push(b),g.push(65535),L.push(65535),j=2*(F=L.length),M=2*Math.pow(Math.log(F)/Math.LN2,2),v=Math.log(M/2)/Math.LN2,O=2*F-M,u=[],I=[],p=[],y=ie=0,B=L.length;ie<B;y=++ie){if(T=L[y],f=g[y],T===65535){u.push(0),I.push(0);break}if(T-($=r[T].new)>=32768)for(u.push(0),I.push(2*(p.length+F-y)),i=Z=T;T<=f?Z<=f:Z>=f;i=T<=f?++Z:--Z)p.push(r[i].new);else u.push($-T),I.push(0)}for(q.writeUInt16(3),q.writeUInt16(1),q.writeUInt32(12),q.writeUInt16(4),q.writeUInt16(16+8*F+2*p.length),q.writeUInt16(0),q.writeUInt16(j),q.writeUInt16(M),q.writeUInt16(v),q.writeUInt16(O),oe=0,D=g.length;oe<D;oe++)i=g[oe],q.writeUInt16(i);for(q.writeUInt16(0),me=0,U=L.length;me<U;me++)i=L[me],q.writeUInt16(i);for(ye=0,X=u.length;ye<X;ye++)s=u[ye],q.writeUInt16(s);for(Re=0,ee=I.length;Re<ee;Re++)S=I[Re],q.writeUInt16(S);for(Oe=0,K=p.length;Oe<K;Oe++)_=p[Oe],q.writeUInt16(_);return{charMap:r,subtable:q.data,maxGlyphID:A+1}}},t})(),hx=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Wu(t,su),t.prototype.tag="cmap",t.prototype.parse=function(e){var n,r,i;for(e.pos=this.offset,this.version=e.readUInt16(),i=e.readUInt16(),this.tables=[],this.unicode=null,r=0;0<=i?r<i:r>i;r=0<=i?++r:--r)n=new Xw(e,this.offset),this.tables.push(n),n.isUnicode&&this.unicode==null&&(this.unicode=n);return!0},t.encode=function(e,n){var r,i;return n==null&&(n="macroman"),r=Xw.encode(e,n),(i=new xf).writeUInt16(0),i.writeUInt16(1),r.table=i.data.concat(r.subtable),r},t})(),rj=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Wu(t,su),t.prototype.tag="hhea",t.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.ascender=e.readShort(),this.decender=e.readShort(),this.lineGap=e.readShort(),this.advanceWidthMax=e.readShort(),this.minLeftSideBearing=e.readShort(),this.minRightSideBearing=e.readShort(),this.xMaxExtent=e.readShort(),this.caretSlopeRise=e.readShort(),this.caretSlopeRun=e.readShort(),this.caretOffset=e.readShort(),e.pos+=8,this.metricDataFormat=e.readShort(),this.numberOfMetrics=e.readUInt16()},t})(),ij=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Wu(t,su),t.prototype.tag="OS/2",t.prototype.parse=function(e){if(e.pos=this.offset,this.version=e.readUInt16(),this.averageCharWidth=e.readShort(),this.weightClass=e.readUInt16(),this.widthClass=e.readUInt16(),this.type=e.readShort(),this.ySubscriptXSize=e.readShort(),this.ySubscriptYSize=e.readShort(),this.ySubscriptXOffset=e.readShort(),this.ySubscriptYOffset=e.readShort(),this.ySuperscriptXSize=e.readShort(),this.ySuperscriptYSize=e.readShort(),this.ySuperscriptXOffset=e.readShort(),this.ySuperscriptYOffset=e.readShort(),this.yStrikeoutSize=e.readShort(),this.yStrikeoutPosition=e.readShort(),this.familyClass=e.readShort(),this.panose=(function(){var n,r;for(r=[],n=0;n<10;++n)r.push(e.readByte());return r})(),this.charRange=(function(){var n,r;for(r=[],n=0;n<4;++n)r.push(e.readInt());return r})(),this.vendorID=e.readString(4),this.selection=e.readShort(),this.firstCharIndex=e.readShort(),this.lastCharIndex=e.readShort(),this.version>0&&(this.ascent=e.readShort(),this.descent=e.readShort(),this.lineGap=e.readShort(),this.winAscent=e.readShort(),this.winDescent=e.readShort(),this.codePageRange=(function(){var n,r;for(r=[],n=0;n<2;n=++n)r.push(e.readInt());return r})(),this.version>1))return this.xHeight=e.readShort(),this.capHeight=e.readShort(),this.defaultChar=e.readShort(),this.breakChar=e.readShort(),this.maxContext=e.readShort()},t})(),aj=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Wu(t,su),t.prototype.tag="post",t.prototype.parse=function(e){var n,r,i;switch(e.pos=this.offset,this.format=e.readInt(),this.italicAngle=e.readInt(),this.underlinePosition=e.readShort(),this.underlineThickness=e.readShort(),this.isFixedPitch=e.readInt(),this.minMemType42=e.readInt(),this.maxMemType42=e.readInt(),this.minMemType1=e.readInt(),this.maxMemType1=e.readInt(),this.format){case 65536:case 196608:break;case 131072:var a;for(r=e.readUInt16(),this.glyphNameIndex=[],a=0;0<=r?a<r:a>r;a=0<=r?++a:--a)this.glyphNameIndex.push(e.readUInt16());for(this.names=[],i=[];e.pos<this.offset+this.length;)n=e.readByte(),i.push(this.names.push(e.readString(n)));return i;case 151552:return r=e.readUInt16(),this.offsets=e.read(r);case 262144:return this.map=(function(){var o,s,u;for(u=[],a=o=0,s=this.file.maxp.numGlyphs;0<=s?o<s:o>s;a=0<=s?++o:--o)u.push(e.readUInt32());return u}).call(this)}},t})(),oj=function(t,e){this.raw=t,this.length=t.length,this.platformID=e.platformID,this.encodingID=e.encodingID,this.languageID=e.languageID},sj=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Wu(t,su),t.prototype.tag="name",t.prototype.parse=function(e){var n,r,i,a,o,s,u,h,f,g,v;for(e.pos=this.offset,e.readShort(),n=e.readShort(),s=e.readShort(),r=[],a=0;0<=n?a<n:a>n;a=0<=n?++a:--a)r.push({platformID:e.readShort(),encodingID:e.readShort(),languageID:e.readShort(),nameID:e.readShort(),length:e.readShort(),offset:this.offset+s+e.readShort()});for(u={},a=f=0,g=r.length;f<g;a=++f)i=r[a],e.pos=i.offset,h=e.readString(i.length),o=new oj(h,i),u[v=i.nameID]==null&&(u[v]=[]),u[i.nameID].push(o);this.strings=u,this.copyright=u[0],this.fontFamily=u[1],this.fontSubfamily=u[2],this.uniqueSubfamily=u[3],this.fontName=u[4],this.version=u[5];try{this.postscriptName=u[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch{this.postscriptName=u[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=u[7],this.manufacturer=u[8],this.designer=u[9],this.description=u[10],this.vendorUrl=u[11],this.designerUrl=u[12],this.license=u[13],this.licenseUrl=u[14],this.preferredFamily=u[15],this.preferredSubfamily=u[17],this.compatibleFull=u[18],this.sampleText=u[19]},t})(),lj=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Wu(t,su),t.prototype.tag="maxp",t.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.numGlyphs=e.readUInt16(),this.maxPoints=e.readUInt16(),this.maxContours=e.readUInt16(),this.maxCompositePoints=e.readUInt16(),this.maxComponentContours=e.readUInt16(),this.maxZones=e.readUInt16(),this.maxTwilightPoints=e.readUInt16(),this.maxStorage=e.readUInt16(),this.maxFunctionDefs=e.readUInt16(),this.maxInstructionDefs=e.readUInt16(),this.maxStackElements=e.readUInt16(),this.maxSizeOfInstructions=e.readUInt16(),this.maxComponentElements=e.readUInt16(),this.maxComponentDepth=e.readUInt16()},t})(),uj=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Wu(t,su),t.prototype.tag="hmtx",t.prototype.parse=function(e){var n,r,i,a,o,s,u;for(e.pos=this.offset,this.metrics=[],n=0,s=this.file.hhea.numberOfMetrics;0<=s?n<s:n>s;n=0<=s?++n:--n)this.metrics.push({advance:e.readUInt16(),lsb:e.readInt16()});for(i=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=(function(){var h,f;for(f=[],n=h=0;0<=i?h<i:h>i;n=0<=i?++h:--h)f.push(e.readInt16());return f})(),this.widths=(function(){var h,f,g,v;for(v=[],h=0,f=(g=this.metrics).length;h<f;h++)a=g[h],v.push(a.advance);return v}).call(this),r=this.widths[this.widths.length-1],u=[],n=o=0;0<=i?o<i:o>i;n=0<=i?++o:--o)u.push(this.widths.push(r));return u},t.prototype.forGlyph=function(e){return e in this.metrics?this.metrics[e]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[e-this.metrics.length]}},t})(),dx=[].slice,cj=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Wu(t,su),t.prototype.tag="glyf",t.prototype.parse=function(){return this.cache={}},t.prototype.glyphFor=function(e){var n,r,i,a,o,s,u,h,f,g;return e in this.cache?this.cache[e]:(a=this.file.loca,n=this.file.contents,r=a.indexOf(e),(i=a.lengthOf(e))===0?this.cache[e]=null:(n.pos=this.offset+r,o=(s=new xf(n.read(i))).readShort(),h=s.readShort(),g=s.readShort(),u=s.readShort(),f=s.readShort(),this.cache[e]=o===-1?new hj(s,h,g,u,f):new fj(s,o,h,g,u,f),this.cache[e]))},t.prototype.encode=function(e,n,r){var i,a,o,s,u;for(o=[],a=[],s=0,u=n.length;s<u;s++)i=e[n[s]],a.push(o.length),i&&(o=o.concat(i.encode(r)));return a.push(o.length),{table:o,offsets:a}},t})(),fj=(function(){function t(e,n,r,i,a,o){this.raw=e,this.numberOfContours=n,this.xMin=r,this.yMin=i,this.xMax=a,this.yMax=o,this.compound=!1}return t.prototype.encode=function(){return this.raw.data},t})(),hj=(function(){function t(e,n,r,i,a){var o,s;for(this.raw=e,this.xMin=n,this.yMin=r,this.xMax=i,this.yMax=a,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],o=this.raw;s=o.readShort(),this.glyphOffsets.push(o.pos),this.glyphIDs.push(o.readUInt16()),32&s;)o.pos+=1&s?4:2,128&s?o.pos+=8:64&s?o.pos+=4:8&s&&(o.pos+=2)}return t.prototype.encode=function(){var e,n,r;for(n=new xf(dx.call(this.raw.data)),e=0,r=this.glyphIDs.length;e<r;++e)n.pos=this.glyphOffsets[e];return n.data},t})(),dj=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Wu(t,su),t.prototype.tag="loca",t.prototype.parse=function(e){var n,r;return e.pos=this.offset,n=this.file.head.indexToLocFormat,this.offsets=n===0?(function(){var i,a;for(a=[],r=0,i=this.length;r<i;r+=2)a.push(2*e.readUInt16());return a}).call(this):(function(){var i,a;for(a=[],r=0,i=this.length;r<i;r+=4)a.push(e.readUInt32());return a}).call(this)},t.prototype.indexOf=function(e){return this.offsets[e]},t.prototype.lengthOf=function(e){return this.offsets[e+1]-this.offsets[e]},t.prototype.encode=function(e,n){for(var r=new Uint32Array(this.offsets.length),i=0,a=0,o=0;o<r.length;++o)if(r[o]=i,a<n.length&&n[a]==o){++a,r[o]=i;var s=this.offsets[o],u=this.offsets[o+1]-s;u>0&&(i+=u)}for(var h=new Array(4*r.length),f=0;f<r.length;++f)h[4*f+3]=255&r[f],h[4*f+2]=(65280&r[f])>>8,h[4*f+1]=(16711680&r[f])>>16,h[4*f]=(4278190080&r[f])>>24;return h},t})(),pj=(function(){function t(e){this.font=e,this.subset={},this.unicodes={},this.next=33}return t.prototype.generateCmap=function(){var e,n,r,i,a;for(n in i=this.font.cmap.tables[0].codeMap,e={},a=this.subset)r=a[n],e[n]=i[r];return e},t.prototype.glyphsFor=function(e){var n,r,i,a,o,s,u;for(i={},o=0,s=e.length;o<s;o++)i[a=e[o]]=this.font.glyf.glyphFor(a);for(a in n=[],i)(r=i[a])!=null&&r.compound&&n.push.apply(n,r.glyphIDs);if(n.length>0)for(a in u=this.glyphsFor(n))r=u[a],i[a]=r;return i},t.prototype.encode=function(e,n){var r,i,a,o,s,u,h,f,g,v,p,y,_,x,b;for(i in r=hx.encode(this.generateCmap(),"unicode"),o=this.glyphsFor(e),p={0:0},b=r.charMap)p[(u=b[i]).old]=u.new;for(y in v=r.maxGlyphID,o)y in p||(p[y]=v++);return f=(function(E){var A,S;for(A in S={},E)S[E[A]]=A;return S})(p),g=Object.keys(f).sort(function(E,A){return E-A}),_=(function(){var E,A,S;for(S=[],E=0,A=g.length;E<A;E++)s=g[E],S.push(f[s]);return S})(),a=this.font.glyf.encode(o,_,p),h=this.font.loca.encode(a.offsets,_),x={cmap:this.font.cmap.raw(),glyf:a.table,loca:h,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(n)},this.font.os2.exists&&(x["OS/2"]=this.font.os2.raw()),this.font.directory.encode(x)},t})();tn.API.PDFObject=(function(){var t;function e(){}return t=function(n,r){return(Array(r+1).join("0")+n).slice(-r)},e.convert=function(n){var r,i,a,o;if(Array.isArray(n))return"["+(function(){var s,u,h;for(h=[],s=0,u=n.length;s<u;s++)r=n[s],h.push(e.convert(r));return h})().join(" ")+"]";if(typeof n=="string")return"/"+n;if(n?.isString)return"("+n+")";if(n instanceof Date)return"(D:"+t(n.getUTCFullYear(),4)+t(n.getUTCMonth(),2)+t(n.getUTCDate(),2)+t(n.getUTCHours(),2)+t(n.getUTCMinutes(),2)+t(n.getUTCSeconds(),2)+"Z)";if({}.toString.call(n)==="[object Object]"){for(i in a=["<<"],n)o=n[i],a.push("/"+i+" "+e.convert(o));return a.push(">>"),a.join(`
603
+ `)}return""+n},e})();window.jspdf={jsPDF:tn};KP(!1);V8("change-font-size");const gj=new URLSearchParams(location.search).get("key"),px=TT({key:gj});window.store=px;window.config={addGlobalFont:rO,unstable_useHtmlTextRender:sO,unstable_setTextVerticalResizeEnabled:aO,unstable_setTextOverflow:V8,onLoadError:nO,setAssetLoadTimeout:QP,setFontLoadTimeout:JP,unstable_setTextSplitAllowed:uO};const vj=Zw.createRoot(document.getElementById("root"));vj.render(se.createElement(ER,{visiblePagesOffset:0,renderOnlyActivePage:!0,store:px,components:{PageControls:()=>null,Tooltip:()=>null}}));export{Nr as _,a0 as c,ph as g};