sykpcomposer 0.0.22 → 0.0.23

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.
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function($e,L){typeof exports=="object"&&typeof module<"u"?L(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],L):($e=typeof globalThis<"u"?globalThis:$e||self,L($e.ViteButton={},$e.React,$e.ReactDOM))})(this,function($e,L,lr){"use strict";function il(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const Re=il(L);var ar={exports:{}},ut={};/*
1
+ (function($e,L){typeof exports=="object"&&typeof module<"u"?L(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],L):($e=typeof globalThis<"u"?globalThis:$e||self,L($e.ViteButton={},$e.React,$e.ReactDOM))})(this,function($e,L,lr){"use strict";function il(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const Re=il(L);var ar={exports:{}},ft={};/*
2
2
  object-assign
3
3
  (c) Sindre Sorhus
4
4
  @license MIT
@@ -9,34 +9,34 @@ object-assign
9
9
  *
10
10
  * This source code is licensed under the MIT license found in the
11
11
  * LICENSE file in the root directory of this source tree.
12
- */var Ni;function ol(){if(Ni)return ut;Ni=1,ki();var n=L,e=60103;if(ut.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var t=Symbol.for;e=t("react.element"),ut.Fragment=t("react.fragment")}var r=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i=Object.prototype.hasOwnProperty,o={key:!0,ref:!0,__self:!0,__source:!0};function s(l,a,c){var u,d={},f=null,h=null;c!==void 0&&(f=""+c),a.key!==void 0&&(f=""+a.key),a.ref!==void 0&&(h=a.ref);for(u in a)i.call(a,u)&&!o.hasOwnProperty(u)&&(d[u]=a[u]);if(l&&l.defaultProps)for(u in a=l.defaultProps,a)d[u]===void 0&&(d[u]=a[u]);return{$$typeof:e,type:l,key:f,ref:h,props:d,_owner:r.current}}return ut.jsx=s,ut.jsxs=s,ut}var ur={};/** @license React v17.0.2
12
+ */var Ni;function ol(){if(Ni)return ft;Ni=1,ki();var n=L,e=60103;if(ft.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var t=Symbol.for;e=t("react.element"),ft.Fragment=t("react.fragment")}var r=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i=Object.prototype.hasOwnProperty,o={key:!0,ref:!0,__self:!0,__source:!0};function s(l,a,c){var u,d={},f=null,h=null;c!==void 0&&(f=""+c),a.key!==void 0&&(f=""+a.key),a.ref!==void 0&&(h=a.ref);for(u in a)i.call(a,u)&&!o.hasOwnProperty(u)&&(d[u]=a[u]);if(l&&l.defaultProps)for(u in a=l.defaultProps,a)d[u]===void 0&&(d[u]=a[u]);return{$$typeof:e,type:l,key:f,ref:h,props:d,_owner:r.current}}return ft.jsx=s,ft.jsxs=s,ft}var ur={};/** @license React v17.0.2
13
13
  * react-jsx-runtime.development.js
14
14
  *
15
15
  * Copyright (c) Facebook, Inc. and its affiliates.
16
16
  *
17
17
  * This source code is licensed under the MIT license found in the
18
18
  * LICENSE file in the root directory of this source tree.
19
- */var Pi;function sl(){return Pi||(Pi=1,function(n){process.env.NODE_ENV!=="production"&&function(){var e=L,t=ki(),r=60103,i=60106;n.Fragment=60107;var o=60108,s=60114,l=60109,a=60110,c=60112,u=60113,d=60120,f=60115,h=60116,g=60121,m=60122,_=60117,x=60129,v=60131;if(typeof Symbol=="function"&&Symbol.for){var y=Symbol.for;r=y("react.element"),i=y("react.portal"),n.Fragment=y("react.fragment"),o=y("react.strict_mode"),s=y("react.profiler"),l=y("react.provider"),a=y("react.context"),c=y("react.forward_ref"),u=y("react.suspense"),d=y("react.suspense_list"),f=y("react.memo"),h=y("react.lazy"),g=y("react.block"),m=y("react.server.block"),_=y("react.fundamental"),y("react.scope"),y("react.opaque.id"),x=y("react.debug_trace_mode"),y("react.offscreen"),v=y("react.legacy_hidden")}var C=typeof Symbol=="function"&&Symbol.iterator,T="@@iterator";function S(p){if(p===null||typeof p!="object")return null;var N=C&&p[C]||p[T];return typeof N=="function"?N:null}var P=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function k(p){{for(var N=arguments.length,A=new Array(N>1?N-1:0),$=1;$<N;$++)A[$-1]=arguments[$];E("error",p,A)}}function E(p,N,A){{var $=P.ReactDebugCurrentFrame,V=$.getStackAddendum();V!==""&&(N+="%s",A=A.concat([V]));var J=A.map(function(z){return""+z});J.unshift("Warning: "+N),Function.prototype.apply.call(console[p],console,J)}}var M=!1;function R(p){return!!(typeof p=="string"||typeof p=="function"||p===n.Fragment||p===s||p===x||p===o||p===u||p===d||p===v||M||typeof p=="object"&&p!==null&&(p.$$typeof===h||p.$$typeof===f||p.$$typeof===l||p.$$typeof===a||p.$$typeof===c||p.$$typeof===_||p.$$typeof===g||p[0]===m))}function q(p,N,A){var $=N.displayName||N.name||"";return p.displayName||($!==""?A+"("+$+")":A)}function H(p){return p.displayName||"Context"}function W(p){if(p==null)return null;if(typeof p.tag=="number"&&k("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),typeof p=="function")return p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case n.Fragment:return"Fragment";case i:return"Portal";case s:return"Profiler";case o:return"StrictMode";case u:return"Suspense";case d:return"SuspenseList"}if(typeof p=="object")switch(p.$$typeof){case a:var N=p;return H(N)+".Consumer";case l:var A=p;return H(A._context)+".Provider";case c:return q(p,p.render,"ForwardRef");case f:return W(p.type);case g:return W(p._render);case h:{var $=p,V=$._payload,J=$._init;try{return W(J(V))}catch{return null}}}return null}var Y=0,ce,Ie,qe,an,cn,un,Et;function kt(){}kt.__reactDisabledLog=!0;function Nt(){{if(Y===0){ce=console.log,Ie=console.info,qe=console.warn,an=console.error,cn=console.group,un=console.groupCollapsed,Et=console.groupEnd;var p={configurable:!0,enumerable:!0,value:kt,writable:!0};Object.defineProperties(console,{info:p,log:p,warn:p,error:p,group:p,groupCollapsed:p,groupEnd:p})}Y++}}function Pt(){{if(Y--,Y===0){var p={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:t({},p,{value:ce}),info:t({},p,{value:Ie}),warn:t({},p,{value:qe}),error:t({},p,{value:an}),group:t({},p,{value:cn}),groupCollapsed:t({},p,{value:un}),groupEnd:t({},p,{value:Et})})}Y<0&&k("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var pe=P.ReactCurrentDispatcher,at;function Ne(p,N,A){{if(at===void 0)try{throw Error()}catch(V){var $=V.stack.trim().match(/\n( *(at )?)/);at=$&&$[1]||""}return`
20
- `+at+p}}var Ge=!1,ct;{var ou=typeof WeakMap=="function"?WeakMap:Map;ct=new ou}function Vs(p,N){if(!p||Ge)return"";{var A=ct.get(p);if(A!==void 0)return A}var $;Ge=!0;var V=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var J;J=pe.current,pe.current=null,Nt();try{if(N){var z=function(){throw Error()};if(Object.defineProperty(z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(z,[])}catch(Me){$=Me}Reflect.construct(p,[],z)}else{try{z.call()}catch(Me){$=Me}p.call(z.prototype)}}else{try{throw Error()}catch(Me){$=Me}p()}}catch(Me){if(Me&&$&&typeof Me.stack=="string"){for(var B=Me.stack.split(`
19
+ */var Pi;function sl(){return Pi||(Pi=1,function(n){process.env.NODE_ENV!=="production"&&function(){var e=L,t=ki(),r=60103,i=60106;n.Fragment=60107;var o=60108,s=60114,l=60109,a=60110,c=60112,u=60113,d=60120,f=60115,h=60116,g=60121,m=60122,_=60117,x=60129,v=60131;if(typeof Symbol=="function"&&Symbol.for){var y=Symbol.for;r=y("react.element"),i=y("react.portal"),n.Fragment=y("react.fragment"),o=y("react.strict_mode"),s=y("react.profiler"),l=y("react.provider"),a=y("react.context"),c=y("react.forward_ref"),u=y("react.suspense"),d=y("react.suspense_list"),f=y("react.memo"),h=y("react.lazy"),g=y("react.block"),m=y("react.server.block"),_=y("react.fundamental"),y("react.scope"),y("react.opaque.id"),x=y("react.debug_trace_mode"),y("react.offscreen"),v=y("react.legacy_hidden")}var C=typeof Symbol=="function"&&Symbol.iterator,T="@@iterator";function S(p){if(p===null||typeof p!="object")return null;var N=C&&p[C]||p[T];return typeof N=="function"?N:null}var P=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function k(p){{for(var N=arguments.length,A=new Array(N>1?N-1:0),$=1;$<N;$++)A[$-1]=arguments[$];E("error",p,A)}}function E(p,N,A){{var $=P.ReactDebugCurrentFrame,V=$.getStackAddendum();V!==""&&(N+="%s",A=A.concat([V]));var J=A.map(function(W){return""+W});J.unshift("Warning: "+N),Function.prototype.apply.call(console[p],console,J)}}var M=!1;function R(p){return!!(typeof p=="string"||typeof p=="function"||p===n.Fragment||p===s||p===x||p===o||p===u||p===d||p===v||M||typeof p=="object"&&p!==null&&(p.$$typeof===h||p.$$typeof===f||p.$$typeof===l||p.$$typeof===a||p.$$typeof===c||p.$$typeof===_||p.$$typeof===g||p[0]===m))}function q(p,N,A){var $=N.displayName||N.name||"";return p.displayName||($!==""?A+"("+$+")":A)}function H(p){return p.displayName||"Context"}function B(p){if(p==null)return null;if(typeof p.tag=="number"&&k("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),typeof p=="function")return p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case n.Fragment:return"Fragment";case i:return"Portal";case s:return"Profiler";case o:return"StrictMode";case u:return"Suspense";case d:return"SuspenseList"}if(typeof p=="object")switch(p.$$typeof){case a:var N=p;return H(N)+".Consumer";case l:var A=p;return H(A._context)+".Provider";case c:return q(p,p.render,"ForwardRef");case f:return B(p.type);case g:return B(p._render);case h:{var $=p,V=$._payload,J=$._init;try{return B(J(V))}catch{return null}}}return null}var Y=0,ce,Ie,Ge,an,cn,un,Et;function kt(){}kt.__reactDisabledLog=!0;function Nt(){{if(Y===0){ce=console.log,Ie=console.info,Ge=console.warn,an=console.error,cn=console.group,un=console.groupCollapsed,Et=console.groupEnd;var p={configurable:!0,enumerable:!0,value:kt,writable:!0};Object.defineProperties(console,{info:p,log:p,warn:p,error:p,group:p,groupCollapsed:p,groupEnd:p})}Y++}}function Pt(){{if(Y--,Y===0){var p={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:t({},p,{value:ce}),info:t({},p,{value:Ie}),warn:t({},p,{value:Ge}),error:t({},p,{value:an}),group:t({},p,{value:cn}),groupCollapsed:t({},p,{value:un}),groupEnd:t({},p,{value:Et})})}Y<0&&k("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var pe=P.ReactCurrentDispatcher,ct;function Ne(p,N,A){{if(ct===void 0)try{throw Error()}catch(V){var $=V.stack.trim().match(/\n( *(at )?)/);ct=$&&$[1]||""}return`
20
+ `+ct+p}}var Xe=!1,ut;{var lu=typeof WeakMap=="function"?WeakMap:Map;ut=new lu}function Vs(p,N){if(!p||Xe)return"";{var A=ut.get(p);if(A!==void 0)return A}var $;Xe=!0;var V=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var J;J=pe.current,pe.current=null,Nt();try{if(N){var W=function(){throw Error()};if(Object.defineProperty(W.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(W,[])}catch(Me){$=Me}Reflect.construct(p,[],W)}else{try{W.call()}catch(Me){$=Me}p.call(W.prototype)}}else{try{throw Error()}catch(Me){$=Me}p()}}catch(Me){if(Me&&$&&typeof Me.stack=="string"){for(var z=Me.stack.split(`
21
21
  `),ue=$.stack.split(`
22
- `),X=B.length-1,Q=ue.length-1;X>=1&&Q>=0&&B[X]!==ue[Q];)Q--;for(;X>=1&&Q>=0;X--,Q--)if(B[X]!==ue[Q]){if(X!==1||Q!==1)do if(X--,Q--,Q<0||B[X]!==ue[Q]){var Fe=`
23
- `+B[X].replace(" at new "," at ");return typeof p=="function"&&ct.set(p,Fe),Fe}while(X>=1&&Q>=0);break}}}finally{Ge=!1,pe.current=J,Pt(),Error.prepareStackTrace=V}var Dt=p?p.displayName||p.name:"",rl=Dt?Ne(Dt):"";return typeof p=="function"&&ct.set(p,rl),rl}function Js(p,N,A){return Vs(p,!1)}function su(p){var N=p.prototype;return!!(N&&N.isReactComponent)}function or(p,N,A){if(p==null)return"";if(typeof p=="function")return Vs(p,su(p));if(typeof p=="string")return Ne(p);switch(p){case u:return Ne("Suspense");case d:return Ne("SuspenseList")}if(typeof p=="object")switch(p.$$typeof){case c:return Js(p.render);case f:return or(p.type,N,A);case g:return Js(p._render);case h:{var $=p,V=$._payload,J=$._init;try{return or(J(V),N,A)}catch{}}}return""}var Hs={},Ys=P.ReactDebugCurrentFrame;function sr(p){if(p){var N=p._owner,A=or(p.type,p._source,N?N.type:null);Ys.setExtraStackFrame(A)}else Ys.setExtraStackFrame(null)}function lu(p,N,A,$,V){{var J=Function.call.bind(Object.prototype.hasOwnProperty);for(var z in p)if(J(p,z)){var B=void 0;try{if(typeof p[z]!="function"){var ue=Error(($||"React class")+": "+A+" type `"+z+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof p[z]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ue.name="Invariant Violation",ue}B=p[z](N,z,$,A,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(X){B=X}B&&!(B instanceof Error)&&(sr(V),k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",$||"React class",A,z,typeof B),sr(null)),B instanceof Error&&!(B.message in Hs)&&(Hs[B.message]=!0,sr(V),k("Failed %s type: %s",A,B.message),sr(null))}}}var fn=P.ReactCurrentOwner,bi=Object.prototype.hasOwnProperty,au={key:!0,ref:!0,__self:!0,__source:!0},qs,Gs,Ci;Ci={};function cu(p){if(bi.call(p,"ref")){var N=Object.getOwnPropertyDescriptor(p,"ref").get;if(N&&N.isReactWarning)return!1}return p.ref!==void 0}function uu(p){if(bi.call(p,"key")){var N=Object.getOwnPropertyDescriptor(p,"key").get;if(N&&N.isReactWarning)return!1}return p.key!==void 0}function fu(p,N){if(typeof p.ref=="string"&&fn.current&&N&&fn.current.stateNode!==N){var A=W(fn.current.type);Ci[A]||(k('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',W(fn.current.type),p.ref),Ci[A]=!0)}}function du(p,N){{var A=function(){qs||(qs=!0,k("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",N))};A.isReactWarning=!0,Object.defineProperty(p,"key",{get:A,configurable:!0})}}function hu(p,N){{var A=function(){Gs||(Gs=!0,k("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",N))};A.isReactWarning=!0,Object.defineProperty(p,"ref",{get:A,configurable:!0})}}var gu=function(p,N,A,$,V,J,z){var B={$$typeof:r,type:p,key:N,ref:A,props:z,_owner:J};return B._store={},Object.defineProperty(B._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(B,"_self",{configurable:!1,enumerable:!1,writable:!1,value:$}),Object.defineProperty(B,"_source",{configurable:!1,enumerable:!1,writable:!1,value:V}),Object.freeze&&(Object.freeze(B.props),Object.freeze(B)),B};function pu(p,N,A,$,V){{var J,z={},B=null,ue=null;A!==void 0&&(B=""+A),uu(N)&&(B=""+N.key),cu(N)&&(ue=N.ref,fu(N,V));for(J in N)bi.call(N,J)&&!au.hasOwnProperty(J)&&(z[J]=N[J]);if(p&&p.defaultProps){var X=p.defaultProps;for(J in X)z[J]===void 0&&(z[J]=X[J])}if(B||ue){var Q=typeof p=="function"?p.displayName||p.name||"Unknown":p;B&&du(z,Q),ue&&hu(z,Q)}return gu(p,B,ue,V,$,fn.current,z)}}var wi=P.ReactCurrentOwner,Xs=P.ReactDebugCurrentFrame;function Ot(p){if(p){var N=p._owner,A=or(p.type,p._source,N?N.type:null);Xs.setExtraStackFrame(A)}else Xs.setExtraStackFrame(null)}var Si;Si=!1;function Ti(p){return typeof p=="object"&&p!==null&&p.$$typeof===r}function Zs(){{if(wi.current){var p=W(wi.current.type);if(p)return`
22
+ `),X=z.length-1,Q=ue.length-1;X>=1&&Q>=0&&z[X]!==ue[Q];)Q--;for(;X>=1&&Q>=0;X--,Q--)if(z[X]!==ue[Q]){if(X!==1||Q!==1)do if(X--,Q--,Q<0||z[X]!==ue[Q]){var Fe=`
23
+ `+z[X].replace(" at new "," at ");return typeof p=="function"&&ut.set(p,Fe),Fe}while(X>=1&&Q>=0);break}}}finally{Xe=!1,pe.current=J,Pt(),Error.prepareStackTrace=V}var Dt=p?p.displayName||p.name:"",rl=Dt?Ne(Dt):"";return typeof p=="function"&&ut.set(p,rl),rl}function Js(p,N,A){return Vs(p,!1)}function au(p){var N=p.prototype;return!!(N&&N.isReactComponent)}function or(p,N,A){if(p==null)return"";if(typeof p=="function")return Vs(p,au(p));if(typeof p=="string")return Ne(p);switch(p){case u:return Ne("Suspense");case d:return Ne("SuspenseList")}if(typeof p=="object")switch(p.$$typeof){case c:return Js(p.render);case f:return or(p.type,N,A);case g:return Js(p._render);case h:{var $=p,V=$._payload,J=$._init;try{return or(J(V),N,A)}catch{}}}return""}var Hs={},Ys=P.ReactDebugCurrentFrame;function sr(p){if(p){var N=p._owner,A=or(p.type,p._source,N?N.type:null);Ys.setExtraStackFrame(A)}else Ys.setExtraStackFrame(null)}function cu(p,N,A,$,V){{var J=Function.call.bind(Object.prototype.hasOwnProperty);for(var W in p)if(J(p,W)){var z=void 0;try{if(typeof p[W]!="function"){var ue=Error(($||"React class")+": "+A+" type `"+W+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof p[W]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ue.name="Invariant Violation",ue}z=p[W](N,W,$,A,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(X){z=X}z&&!(z instanceof Error)&&(sr(V),k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",$||"React class",A,W,typeof z),sr(null)),z instanceof Error&&!(z.message in Hs)&&(Hs[z.message]=!0,sr(V),k("Failed %s type: %s",A,z.message),sr(null))}}}var fn=P.ReactCurrentOwner,bi=Object.prototype.hasOwnProperty,uu={key:!0,ref:!0,__self:!0,__source:!0},qs,Gs,Ci;Ci={};function fu(p){if(bi.call(p,"ref")){var N=Object.getOwnPropertyDescriptor(p,"ref").get;if(N&&N.isReactWarning)return!1}return p.ref!==void 0}function du(p){if(bi.call(p,"key")){var N=Object.getOwnPropertyDescriptor(p,"key").get;if(N&&N.isReactWarning)return!1}return p.key!==void 0}function hu(p,N){if(typeof p.ref=="string"&&fn.current&&N&&fn.current.stateNode!==N){var A=B(fn.current.type);Ci[A]||(k('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',B(fn.current.type),p.ref),Ci[A]=!0)}}function gu(p,N){{var A=function(){qs||(qs=!0,k("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",N))};A.isReactWarning=!0,Object.defineProperty(p,"key",{get:A,configurable:!0})}}function pu(p,N){{var A=function(){Gs||(Gs=!0,k("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",N))};A.isReactWarning=!0,Object.defineProperty(p,"ref",{get:A,configurable:!0})}}var mu=function(p,N,A,$,V,J,W){var z={$$typeof:r,type:p,key:N,ref:A,props:W,_owner:J};return z._store={},Object.defineProperty(z._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(z,"_self",{configurable:!1,enumerable:!1,writable:!1,value:$}),Object.defineProperty(z,"_source",{configurable:!1,enumerable:!1,writable:!1,value:V}),Object.freeze&&(Object.freeze(z.props),Object.freeze(z)),z};function _u(p,N,A,$,V){{var J,W={},z=null,ue=null;A!==void 0&&(z=""+A),du(N)&&(z=""+N.key),fu(N)&&(ue=N.ref,hu(N,V));for(J in N)bi.call(N,J)&&!uu.hasOwnProperty(J)&&(W[J]=N[J]);if(p&&p.defaultProps){var X=p.defaultProps;for(J in X)W[J]===void 0&&(W[J]=X[J])}if(z||ue){var Q=typeof p=="function"?p.displayName||p.name||"Unknown":p;z&&gu(W,Q),ue&&pu(W,Q)}return mu(p,z,ue,V,$,fn.current,W)}}var wi=P.ReactCurrentOwner,Xs=P.ReactDebugCurrentFrame;function Ot(p){if(p){var N=p._owner,A=or(p.type,p._source,N?N.type:null);Xs.setExtraStackFrame(A)}else Xs.setExtraStackFrame(null)}var Si;Si=!1;function Ti(p){return typeof p=="object"&&p!==null&&p.$$typeof===r}function Zs(){{if(wi.current){var p=B(wi.current.type);if(p)return`
24
24
 
25
- Check the render method of \``+p+"`."}return""}}function mu(p){{if(p!==void 0){var N=p.fileName.replace(/^.*[\\\/]/,""),A=p.lineNumber;return`
25
+ Check the render method of \``+p+"`."}return""}}function yu(p){{if(p!==void 0){var N=p.fileName.replace(/^.*[\\\/]/,""),A=p.lineNumber;return`
26
26
 
27
- Check your code at `+N+":"+A+"."}return""}}var Qs={};function _u(p){{var N=Zs();if(!N){var A=typeof p=="string"?p:p.displayName||p.name;A&&(N=`
27
+ Check your code at `+N+":"+A+"."}return""}}var Qs={};function vu(p){{var N=Zs();if(!N){var A=typeof p=="string"?p:p.displayName||p.name;A&&(N=`
28
28
 
29
- Check the top-level render call using <`+A+">.")}return N}}function el(p,N){{if(!p._store||p._store.validated||p.key!=null)return;p._store.validated=!0;var A=_u(N);if(Qs[A])return;Qs[A]=!0;var $="";p&&p._owner&&p._owner!==wi.current&&($=" It was passed a child from "+W(p._owner.type)+"."),Ot(p),k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',A,$),Ot(null)}}function tl(p,N){{if(typeof p!="object")return;if(Array.isArray(p))for(var A=0;A<p.length;A++){var $=p[A];Ti($)&&el($,N)}else if(Ti(p))p._store&&(p._store.validated=!0);else if(p){var V=S(p);if(typeof V=="function"&&V!==p.entries)for(var J=V.call(p),z;!(z=J.next()).done;)Ti(z.value)&&el(z.value,N)}}}function yu(p){{var N=p.type;if(N==null||typeof N=="string")return;var A;if(typeof N=="function")A=N.propTypes;else if(typeof N=="object"&&(N.$$typeof===c||N.$$typeof===f))A=N.propTypes;else return;if(A){var $=W(N);lu(A,p.props,"prop",$,p)}else if(N.PropTypes!==void 0&&!Si){Si=!0;var V=W(N);k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",V||"Unknown")}typeof N.getDefaultProps=="function"&&!N.getDefaultProps.isReactClassApproved&&k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function vu(p){{for(var N=Object.keys(p.props),A=0;A<N.length;A++){var $=N[A];if($!=="children"&&$!=="key"){Ot(p),k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",$),Ot(null);break}}p.ref!==null&&(Ot(p),k("Invalid attribute `ref` supplied to `React.Fragment`."),Ot(null))}}function nl(p,N,A,$,V,J){{var z=R(p);if(!z){var B="";(p===void 0||typeof p=="object"&&p!==null&&Object.keys(p).length===0)&&(B+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ue=mu(V);ue?B+=ue:B+=Zs();var X;p===null?X="null":Array.isArray(p)?X="array":p!==void 0&&p.$$typeof===r?(X="<"+(W(p.type)||"Unknown")+" />",B=" Did you accidentally export a JSX literal instead of a component?"):X=typeof p,k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",X,B)}var Q=pu(p,N,A,V,J);if(Q==null)return Q;if(z){var Fe=N.children;if(Fe!==void 0)if($)if(Array.isArray(Fe)){for(var Dt=0;Dt<Fe.length;Dt++)tl(Fe[Dt],p);Object.freeze&&Object.freeze(Fe)}else k("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else tl(Fe,p)}return p===n.Fragment?vu(Q):yu(Q),Q}}function xu(p,N,A){return nl(p,N,A,!0)}function bu(p,N,A){return nl(p,N,A,!1)}var Cu=bu,wu=xu;n.jsx=Cu,n.jsxs=wu}()}(ur)),ur}process.env.NODE_ENV==="production"?ar.exports=ol():ar.exports=sl();var w=ar.exports;function ll(n){return{}}const dn={},al={},Oi={},Xe={},ft={},hn={},dt={},fr={},dr={},Lt={},jt={},fe={},gn={},pn={},cl={},Di={},ul={},Li={},fl={},ji={},Ai={},mn={},dl={},Ii={},Fi={},Mi={},hl={},gl={},$i={},hr={},Ri={},me={},Wi={},Bi={},pl={},_n={},gr={},pr={},ml={},_l={},At={},It={},yl={},vl={},xl={},_e=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,bl=_e&&"documentMode"in document?document.documentMode:null,ye=_e&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),We=_e&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),yn=!(!_e||!("InputEvent"in window)||bl)&&"getTargetRanges"in new window.InputEvent("input"),mr=_e&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),vn=_e&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Cl=_e&&/Android/.test(navigator.userAgent),zi=_e&&/^(?=.*Chrome).*/i.test(navigator.userAgent),wl=_e&&Cl&&zi,_r=_e&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!zi,Ft=1,Be=3,Ze=0,Ki=1,ht=2,Sl=0,Tl=1,El=2,xn=4,bn=8,yr=128,kl=112|(3|xn|bn)|yr,vr=1,xr=2,br=3,Cr=4,wr=5,Sr=6,Cn=mr||vn||_r?" ":"​",Pe=`
29
+ Check the top-level render call using <`+A+">.")}return N}}function el(p,N){{if(!p._store||p._store.validated||p.key!=null)return;p._store.validated=!0;var A=vu(N);if(Qs[A])return;Qs[A]=!0;var $="";p&&p._owner&&p._owner!==wi.current&&($=" It was passed a child from "+B(p._owner.type)+"."),Ot(p),k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',A,$),Ot(null)}}function tl(p,N){{if(typeof p!="object")return;if(Array.isArray(p))for(var A=0;A<p.length;A++){var $=p[A];Ti($)&&el($,N)}else if(Ti(p))p._store&&(p._store.validated=!0);else if(p){var V=S(p);if(typeof V=="function"&&V!==p.entries)for(var J=V.call(p),W;!(W=J.next()).done;)Ti(W.value)&&el(W.value,N)}}}function xu(p){{var N=p.type;if(N==null||typeof N=="string")return;var A;if(typeof N=="function")A=N.propTypes;else if(typeof N=="object"&&(N.$$typeof===c||N.$$typeof===f))A=N.propTypes;else return;if(A){var $=B(N);cu(A,p.props,"prop",$,p)}else if(N.PropTypes!==void 0&&!Si){Si=!0;var V=B(N);k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",V||"Unknown")}typeof N.getDefaultProps=="function"&&!N.getDefaultProps.isReactClassApproved&&k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function bu(p){{for(var N=Object.keys(p.props),A=0;A<N.length;A++){var $=N[A];if($!=="children"&&$!=="key"){Ot(p),k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",$),Ot(null);break}}p.ref!==null&&(Ot(p),k("Invalid attribute `ref` supplied to `React.Fragment`."),Ot(null))}}function nl(p,N,A,$,V,J){{var W=R(p);if(!W){var z="";(p===void 0||typeof p=="object"&&p!==null&&Object.keys(p).length===0)&&(z+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ue=yu(V);ue?z+=ue:z+=Zs();var X;p===null?X="null":Array.isArray(p)?X="array":p!==void 0&&p.$$typeof===r?(X="<"+(B(p.type)||"Unknown")+" />",z=" Did you accidentally export a JSX literal instead of a component?"):X=typeof p,k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",X,z)}var Q=_u(p,N,A,V,J);if(Q==null)return Q;if(W){var Fe=N.children;if(Fe!==void 0)if($)if(Array.isArray(Fe)){for(var Dt=0;Dt<Fe.length;Dt++)tl(Fe[Dt],p);Object.freeze&&Object.freeze(Fe)}else k("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else tl(Fe,p)}return p===n.Fragment?bu(Q):xu(Q),Q}}function Cu(p,N,A){return nl(p,N,A,!0)}function wu(p,N,A){return nl(p,N,A,!1)}var Su=wu,Tu=Cu;n.jsx=Su,n.jsxs=Tu}()}(ur)),ur}process.env.NODE_ENV==="production"?ar.exports=ol():ar.exports=sl();var w=ar.exports;function ll(n){return{}}const dn={},al={},Oi={},Ze={},dt={},hn={},ht={},fr={},dr={},Lt={},jt={},fe={},gn={},pn={},cl={},Di={},ul={},Li={},fl={},ji={},Ai={},mn={},dl={},Ii={},Fi={},Mi={},hl={},gl={},$i={},hr={},Ri={},me={},Bi={},zi={},pl={},_n={},gr={},pr={},ml={},_l={},At={},It={},yl={},vl={},xl={},_e=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,bl=_e&&"documentMode"in document?document.documentMode:null,ye=_e&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Be=_e&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),yn=!(!_e||!("InputEvent"in window)||bl)&&"getTargetRanges"in new window.InputEvent("input"),mr=_e&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),vn=_e&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Cl=_e&&/Android/.test(navigator.userAgent),Wi=_e&&/^(?=.*Chrome).*/i.test(navigator.userAgent),wl=_e&&Cl&&Wi,_r=_e&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Wi,Ft=1,ze=3,Qe=0,Ki=1,gt=2,Sl=0,Tl=1,El=2,xn=4,bn=8,yr=128,kl=112|(3|xn|bn)|yr,vr=1,xr=2,br=3,Cr=4,wr=5,Sr=6,Cn=mr||vn||_r?" ":"​",Pe=`
30
30
 
31
- `,Nl=We?" ":Cn,Ui="֑-߿יִ-﷽ﹰ-ﻼ",Vi="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Pl=new RegExp("^[^"+Vi+"]*["+Ui+"]"),Ol=new RegExp("^[^"+Ui+"]*["+Vi+"]"),Oe={bold:1,code:16,highlight:yr,italic:2,strikethrough:xn,subscript:32,superscript:64,underline:bn},Dl={directionless:1,unmergeable:2},Ji={center:xr,end:Sr,justify:Cr,left:vr,right:br,start:wr},Ll={[xr]:"center",[Sr]:"end",[Cr]:"justify",[vr]:"left",[br]:"right",[wr]:"start"},jl={normal:0,segmented:2,token:1},Al={[Sl]:"normal",[El]:"segmented",[Tl]:"token"};function Il(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var j=Il(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function wn(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}const Fl=100;let Tr=!1,Er=0;function Ml(n){Er=n.timeStamp}function kr(n,e,t){return e.__lexicalLineBreak===n||n[`__lexicalKey_${t._key}`]!==void 0}function $l(n,e,t){const r=Se(t._window);let i=null,o=null;r!==null&&r.anchorNode===n&&(i=r.anchorOffset,o=r.focusOffset);const s=n.nodeValue;s!==null&&jr(e,s,i,o,!1)}function Rl(n,e,t){if(O(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return e.nodeType===Be&&t.isAttached()}function Hi(n,e,t){Tr=!0;const r=performance.now()-Er>Fl;try{ge(n,()=>{const i=F()||function(f){return f.getEditorState().read(()=>{const h=F();return h!==null?h.clone():null})}(n),o=new Map,s=n.getRootElement(),l=n._editorState,a=n._blockCursorElement;let c=!1,u="";for(let f=0;f<e.length;f++){const h=e[f],g=h.type,m=h.target;let _=et(m,l);if(!(_===null&&m!==s||U(_))){if(g==="characterData")r&&D(_)&&Rl(i,m,_)&&$l(m,_,n);else if(g==="childList"){c=!0;const x=h.addedNodes;for(let C=0;C<x.length;C++){const T=x[C],S=no(T),P=T.parentNode;if(P!=null&&T!==a&&S===null&&(T.nodeName!=="BR"||!kr(T,P,n))){if(We){const k=T.innerText||T.nodeValue;k&&(u+=k)}P.removeChild(T)}}const v=h.removedNodes,y=v.length;if(y>0){let C=0;for(let T=0;T<y;T++){const S=v[T];(S.nodeName==="BR"&&kr(S,m,n)||a===S)&&(m.appendChild(S),C++)}y!==C&&(m===s&&(_=oo(l)),o.set(m,_))}}}}if(o.size>0)for(const[f,h]of o)if(b(h)){const g=h.getChildrenKeys();let m=f.firstChild;for(let _=0;_<g.length;_++){const x=g[_],v=n.getElementByKey(x);v!==null&&(m==null?(f.appendChild(v),m=v):m!==v&&f.replaceChild(v,m),m=m.nextSibling)}}else D(h)&&h.markDirty();const d=t.takeRecords();if(d.length>0){for(let f=0;f<d.length;f++){const h=d[f],g=h.addedNodes,m=h.target;for(let _=0;_<g.length;_++){const x=g[_],v=x.parentNode;v==null||x.nodeName!=="BR"||kr(x,m,n)||v.removeChild(x)}}t.takeRecords()}i!==null&&(c&&(i.dirty=!0,we(i)),We&&mo(n)&&i.insertRawText(u))})}finally{Tr=!1}}function Yi(n){const e=n._observer;e!==null&&Hi(n,e.takeRecords(),e)}function qi(n){(function(e){Er===0&&On(e).addEventListener("textInput",Ml,!0)})(n),n._observer=new MutationObserver((e,t)=>{Hi(n,e,t)})}function Gi(n,e){const t=n.__mode,r=n.__format,i=n.__style,o=e.__mode,s=e.__format,l=e.__style;return!(t!==null&&t!==o||r!==null&&r!==s||i!==null&&i!==l)}function Xi(n,e){const t=n.mergeWithSibling(e),r=G()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function Zi(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&D(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Gi(e,r)){r=Xi(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&D(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Gi(r,t)){r=Xi(r,t);break}break}t.remove()}}else r.remove()}function Qi(n){return eo(n.anchor),eo(n.focus),n}function eo(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,i;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),i=!0):(r=e.getChildAtIndex(t),i=!1),D(r)){n.set(r.__key,i?r.getTextContentSize():0,"text");break}if(!b(r))break;n.set(r.__key,i?r.getChildrenSize():0,"element")}}let Wl=1;const Bl=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function Nr(n){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return U(et(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&Sn(e)==null)}function Mt(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!Nr(e)&&to(e)===n}catch{return!1}}function Pr(n){return n instanceof Hn}function to(n){let e=n;for(;e!=null;){const t=Sn(e);if(Pr(t))return t;e=Pn(e)}return null}function Sn(n){return n?n.__lexicalEditor:null}function De(n){return n.isToken()||n.isSegmented()}function zl(n){return n.nodeType===Be}function Tn(n){let e=n;for(;e!=null;){if(zl(e))return e;e=e.firstChild}return null}function Or(n,e,t){const r=Oe[e];if(t!==null&&(n&r)==(t&r))return n;let i=n^r;return e==="subscript"?i&=~Oe.superscript:e==="superscript"&&(i&=~Oe.subscript),i}function Kl(n,e){if(e!=null)return void(n.__key=e);he(),es();const t=G(),r=Ae(),i=""+Wl++;r._nodeMap.set(i,n),b(n)?t._dirtyElements.set(i,!0):t._dirtyLeaves.add(i),t._cloneNotNeeded.add(i),t._dirtyType=Ki,n.__key=i}function Qe(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),i=n.getPreviousSibling(),o=n.getNextSibling();if(i===null)if(o!==null){const s=o.getWritable();r.__first=o.__key,s.__prev=null}else r.__first=null;else{const s=i.getWritable();if(o!==null){const l=o.getWritable();l.__prev=s.__key,s.__next=l.__key}else s.__next=null;t.__prev=null}if(o===null)if(i!==null){const s=i.getWritable();r.__last=i.__key,s.__next=null}else r.__last=null;else{const s=o.getWritable();if(i!==null){const l=i.getWritable();l.__next=s.__key,s.__prev=l.__key}else s.__prev=null;t.__next=null}r.__size--,t.__parent=null}}function En(n){es();const e=n.getLatest(),t=e.__parent,r=Ae(),i=G(),o=r._nodeMap,s=i._dirtyElements;t!==null&&function(a,c,u){let d=a;for(;d!==null;){if(u.has(d))return;const f=c.get(d);if(f===void 0)break;u.set(d,!1),d=f.__parent}}(t,o,s);const l=e.__key;i._dirtyType=Ki,b(n)?s.set(l,!0):i._dirtyLeaves.add(l)}function re(n){he();const e=G(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){const r=se(t);r!==null&&r.getWritable()}if(n!==null){const r=se(n);r!==null&&r.getWritable()}}}function ze(){return nn()?null:G()._compositionKey}function se(n,e){const t=(e||Ae())._nodeMap.get(n);return t===void 0?null:t}function no(n,e){const t=n[`__lexicalKey_${G()._key}`];return t!==void 0?se(t,e):null}function et(n,e){let t=n;for(;t!=null;){const r=no(t,e);if(r!==null)return r;t=Pn(t)}return null}function ro(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function io(n){return n.read(()=>Z().getTextContent())}function Z(){return oo(Ae())}function oo(n){return n._nodeMap.get("root")}function we(n){he();const e=Ae();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function gt(n){const e=G(),t=function(r,i){let o=r;for(;o!=null;){const s=o[`__lexicalKey_${i._key}`];if(s!==void 0)return s;o=Pn(o)}return null}(n,e);return t===null?n===e.getRootElement()?se("root"):null:se(t)}function so(n,e){return e?n.getTextContentSize():0}function lo(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function Dr(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function ao(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function co(n){return n.nodeType===Be?n.nodeValue:null}function Lr(n,e,t){const r=Se(e._window);if(r===null)return;const i=r.anchorNode;let{anchorOffset:o,focusOffset:s}=r;if(i!==null){let l=co(i);const a=et(i);if(l!==null&&D(a)){if(l===Cn&&t){const c=t.length;l=t,o=c,s=c}l!==null&&jr(a,l,o,s,n)}}}function jr(n,e,t,r,i){let o=n;if(o.isAttached()&&(i||!o.isDirty())){const s=o.isComposing();let l=e;(s||i)&&e[e.length-1]===Cn&&(l=e.slice(0,-1));const a=o.getTextContent();if(i||l!==a){if(l===""){if(re(null),mr||vn||_r)o.remove();else{const m=G();setTimeout(()=>{m.update(()=>{o.isAttached()&&o.remove()})},20)}return}const c=o.getParent(),u=tn(),d=o.getTextContentSize(),f=ze(),h=o.getKey();if(o.isToken()||f!==null&&h===f&&!s||O(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===n.__key&&u.anchor.offset===0&&!o.canInsertTextBefore()&&!s||u.focus.key===n.__key&&u.focus.offset===d&&!o.canInsertTextAfter()&&!s))return void o.markDirty();const g=F();if(!O(g)||t===null||r===null)return void o.setTextContent(l);if(g.setTextNodeRange(o,t,o,r),o.isSegmented()){const m=ie(o.getTextContent());o.replace(m),o=m}o.setTextContent(l)}}}function Ul(n,e){if(e.isSegmented())return!0;if(!n.isCollapsed())return!1;const t=n.anchor.offset,r=e.getParentOrThrow(),i=e.isToken();return t===0?!e.canInsertTextBefore()||!r.canInsertTextBefore()&&!e.isComposing()||i||function(o){const s=o.getPreviousSibling();return(D(s)||b(s)&&s.isInline())&&!s.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!r.canInsertTextAfter()&&!e.isComposing()||i)}function uo(n){return n==="ArrowLeft"}function fo(n){return n==="ArrowRight"}function $t(n,e){return ye?n:e}function ho(n){return n==="Enter"}function Rt(n){return n==="Backspace"}function Wt(n){return n==="Delete"}function go(n,e,t){return n.toLowerCase()==="a"&&$t(e,t)}function Vl(){const n=Z();we(Qi(n.select(0,n.getChildrenSize())))}function Bt(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});const t=n.__lexicalClassNameCache,r=t[e];if(r!==void 0)return r;const i=n[e];if(typeof i=="string"){const o=wn(i);return t[e]=o,o}return i}function Ar(n,e,t,r,i){if(t.size===0)return;const o=r.__type,s=r.__key,l=e.get(o);l===void 0&&j(33,o);const a=l.klass;let c=n.get(a);c===void 0&&(c=new Map,n.set(a,c));const u=c.get(s),d=u==="destroyed"&&i==="created";(u===void 0||d)&&c.set(s,d?"updated":i)}function po(n,e,t){const r=n.getParent();let i=t,o=n;return r!==null&&(e&&t===0?(i=o.getIndexWithinParent(),o=r):e||t!==o.getChildrenSize()||(i=o.getIndexWithinParent()+1,o=r)),o.getChildAtIndex(e?i-1:i)}function zt(n,e){const t=n.offset;if(n.type==="element")return po(n.getNode(),e,t);{const r=n.getNode();if(e&&t===0||!e&&t===r.getTextContentSize()){const i=e?r.getPreviousSibling():r.getNextSibling();return i===null?po(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):i}}return null}function mo(n){const e=On(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function I(n,e,t){return os(n,e,t)}function kn(n){return!oe(n)&&!n.isLastChild()&&!n.isInline()}function Nn(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&j(75,e),t}function Pn(n){const e=n.assignedSlot||n.parentElement;return e!==null&&e.nodeType===11?e.host:e}function Ir(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function On(n){const e=n._window;return e===null&&j(78),e}function Jl(n){let e=n.getParentOrThrow();for(;e!==null;){if(pt(e))return e;e=e.getParentOrThrow()}return e}function pt(n){return oe(n)||b(n)&&n.isShadowRoot()}function Kt(n){const e=G(),t=n.constructor.getType(),r=e._nodes.get(t);r===void 0&&j(97);const i=r.replace;if(i!==null){const o=i(n);return o instanceof n.constructor||j(98),o}return n}function Fr(n,e){!oe(n.getParent())||b(e)||U(e)||j(99)}function Mr(n){return(U(n)||b(n)&&!n.canBeEmpty())&&!n.isInline()}function $r(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function Hl(n,e,t){let r=n._blockCursorElement;if(O(t)&&t.isCollapsed()&&t.anchor.type==="element"&&e.contains(document.activeElement)){const i=t.anchor,o=i.getNode(),s=i.offset;let l=!1,a=null;if(s===o.getChildrenSize())Mr(o.getChildAtIndex(s-1))&&(l=!0);else{const c=o.getChildAtIndex(s);if(Mr(c)){const u=c.getPreviousSibling();(u===null||Mr(u))&&(l=!0,a=n.getElementByKey(c.__key))}}if(l){const c=n.getElementByKey(o.__key);return r===null&&(n._blockCursorElement=r=function(u){const d=u.theme,f=document.createElement("div");f.contentEditable="false",f.setAttribute("data-lexical-cursor","true");let h=d.blockCursor;if(h!==void 0){if(typeof h=="string"){const g=wn(h);h=d.blockCursor=g}h!==void 0&&f.classList.add(...h)}return f}(n._config)),e.style.caretColor="transparent",void(a===null?c.appendChild(r):c.insertBefore(r,a))}}r!==null&&$r(r,n,e)}function Se(n){return _e?(n||window).getSelection():null}function Yl(n){return Dn(n)&&n.tagName==="A"}function Dn(n){return n.nodeType===1}function Rr(n){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return n.nodeName.match(e)!==null}function Ln(n){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return n.nodeName.match(e)!==null}function mt(n){if(oe(n)||U(n)&&!n.isInline())return!0;if(!b(n)||pt(n))return!1;const e=n.getFirstChild(),t=e===null||Zt(e)||D(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function Wr(n,e){let t=n;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}function ql(){return G()}const _o=new WeakMap,Gl=new Map;function Xl(n){if(!n._readOnly&&n.isEmpty())return Gl;n._readOnly||j(192);let e=_o.get(n);if(!e){e=new Map,_o.set(n,e);for(const[t,r]of n._nodeMap){const i=r.__type;let o=e.get(i);o||(o=new Map,e.set(i,o)),o.set(t,r)}}return e}function Br(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function yo(n,e,t,r,i,o){let s=n.getFirstChild();for(;s!==null;){const l=s.__key;s.__parent===e&&(b(s)&&yo(s,l,t,r,i,o),t.has(l)||o.delete(l),i.push(l)),s=s.getNextSibling()}}let Ke,le,Ut,jn,zr,Kr,tt,ve,Ur,Vt,ee="",ae="",Te=null,xe="",Le="",vo=!1,Jt=!1,An=null;function In(n,e){const t=tt.get(n);if(e!==null){const r=Yr(n);r.parentNode===e&&e.removeChild(r)}if(ve.has(n)||le._keyToDOMMap.delete(n),b(t)){const r=Mn(t,tt);Vr(r,0,r.length-1,null)}t!==void 0&&Ar(Vt,Ut,jn,t,"destroyed")}function Vr(n,e,t,r){let i=e;for(;i<=t;++i){const o=n[i];o!==void 0&&In(o,r)}}function nt(n,e){n.setProperty("text-align",e)}const Zl="40px";function xo(n,e){const t=Ke.theme.indent;if(typeof t=="string"){const i=n.classList.contains(t);e>0&&!i?n.classList.add(t):e<1&&i&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||Zl;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function bo(n,e){const t=n.style;e===0?nt(t,""):e===vr?nt(t,"left"):e===xr?nt(t,"center"):e===br?nt(t,"right"):e===Cr?nt(t,"justify"):e===wr?nt(t,"start"):e===Sr&&nt(t,"end")}function Fn(n,e,t){const r=ve.get(n);r===void 0&&j(60);const i=r.createDOM(Ke,le);if(function(o,s,l){const a=l._keyToDOMMap;s["__lexicalKey_"+l._key]=o,a.set(o,s)}(n,i,le),D(r)?i.setAttribute("data-lexical-text","true"):U(r)&&i.setAttribute("data-lexical-decorator","true"),b(r)){const o=r.__indent,s=r.__size;if(o!==0&&xo(i,o),s!==0){const a=s-1;(function(c,u,d,f){const h=ae;ae="",Jr(c,d,0,u,f,null),So(d,f),ae=h})(Mn(r,ve),a,r,i)}const l=r.__format;l!==0&&bo(i,l),r.isInline()||wo(null,r,i),kn(r)&&(ee+=Pe,Le+=Pe)}else{const o=r.getTextContent();if(U(r)){const s=r.decorate(le,Ke);s!==null&&To(n,s),i.contentEditable="false"}else D(r)&&(r.isDirectionless()||(ae+=o));ee+=o,Le+=o}if(e!==null)if(t!=null)e.insertBefore(i,t);else{const o=e.__lexicalLineBreak;o!=null?e.insertBefore(i,o):e.appendChild(i)}return Ar(Vt,Ut,jn,r,"created"),i}function Jr(n,e,t,r,i,o){const s=ee;ee="";let l=t;for(;l<=r;++l){Fn(n[l],i,o);const a=ve.get(n[l]);a!==null&&D(a)&&(Te===null&&(Te=a.getFormat()),xe===""&&(xe=a.getStyle()))}kn(e)&&(ee+=Pe),i.__lexicalTextContent=ee,ee=s+ee}function Co(n,e){const t=e.get(n);return Zt(t)||U(t)&&t.isInline()}function wo(n,e,t){const r=n!==null&&(n.__size===0||Co(n.__last,tt)),i=e.__size===0||Co(e.__last,ve);if(r){if(!i){const o=t.__lexicalLineBreak;if(o!=null)try{t.removeChild(o)}catch(s){if(typeof s=="object"&&s!=null){const l=`${s.toString()} Parent: ${t.tagName}, child: ${o.tagName}.`;throw new Error(l)}throw s}t.__lexicalLineBreak=null}}else if(i){const o=document.createElement("br");t.__lexicalLineBreak=o,t.appendChild(o)}}function So(n,e){const t=e.__lexicalDirTextContent,r=e.__lexicalDir;if(t!==ae||r!==An){const o=ae==="",s=o?An:(i=ae,Pl.test(i)?"rtl":Ol.test(i)?"ltr":null);if(s!==r){const l=e.classList,a=Ke.theme;let c=r!==null?a[r]:void 0,u=s!==null?a[s]:void 0;if(c!==void 0){if(typeof c=="string"){const d=wn(c);c=a[r]=d}l.remove(...c)}if(s===null||o&&s==="ltr")e.removeAttribute("dir");else{if(u!==void 0){if(typeof u=="string"){const d=wn(u);u=a[s]=d}u!==void 0&&l.add(...u)}e.dir=s}Jt||(n.getWritable().__dir=s)}An=s,e.__lexicalDirTextContent=ae,e.__lexicalDir=s}var i}function Ql(n,e,t){const r=ae;var i;ae="",Te=null,xe="",function(o,s,l){const a=ee,c=o.__size,u=s.__size;if(ee="",c===1&&u===1){const d=o.__first,f=s.__first;if(d===f)Ht(d,l);else{const g=Yr(d),m=Fn(f,null,null);try{l.replaceChild(m,g)}catch(_){if(typeof _=="object"&&_!=null){const x=`${_.toString()} Parent: ${l.tagName}, new child: {tag: ${m.tagName} key: ${f}}, old child: {tag: ${g.tagName}, key: ${d}}.`;throw new Error(x)}throw _}In(d,null)}const h=ve.get(f);D(h)&&(Te===null&&(Te=h.getFormat()),xe===""&&(xe=h.getStyle()))}else{const d=Mn(o,tt),f=Mn(s,ve);if(c===0)u!==0&&Jr(f,s,0,u-1,l,null);else if(u===0){if(c!==0){const h=l.__lexicalLineBreak==null;Vr(d,0,c-1,h?null:l),h&&(l.textContent="")}}else(function(h,g,m,_,x,v){const y=_-1,C=x-1;let T,S,P=(M=v,M.firstChild),k=0,E=0;for(var M;k<=y&&E<=C;){const H=g[k],W=m[E];if(H===W)P=Hr(Ht(W,v)),k++,E++;else{T===void 0&&(T=new Set(g)),S===void 0&&(S=new Set(m));const ce=S.has(H),Ie=T.has(W);if(ce)if(Ie){const qe=Nn(le,W);qe===P?P=Hr(Ht(W,v)):(P!=null?v.insertBefore(qe,P):v.appendChild(qe),Ht(W,v)),k++,E++}else Fn(W,v,P),E++;else P=Hr(Yr(H)),In(H,v),k++}const Y=ve.get(W);Y!==null&&D(Y)&&(Te===null&&(Te=Y.getFormat()),xe===""&&(xe=Y.getStyle()))}const R=k>y,q=E>C;if(R&&!q){const H=m[C+1];Jr(m,h,E,C,v,H===void 0?null:le.getElementByKey(H))}else q&&!R&&Vr(g,k,y,v)})(s,d,f,c,u,l)}kn(s)&&(ee+=Pe),l.__lexicalTextContent=ee,ee=a+ee}(n,e,t),So(e,t),hi(i=e)&&Te!=null&&Te!==i.__textFormat&&!Jt&&(i.setTextFormat(Te),i.setTextStyle(xe)),function(o){hi(o)&&xe!==""&&xe!==o.__textStyle&&!Jt&&o.setTextStyle(xe)}(e),ae=r}function Mn(n,e){const t=[];let r=n.__first;for(;r!==null;){const i=e.get(r);i===void 0&&j(101),t.push(r),r=i.__next}return t}function Ht(n,e){const t=tt.get(n);let r=ve.get(n);t!==void 0&&r!==void 0||j(61);const i=vo||Kr.has(n)||zr.has(n),o=Nn(le,n);if(t===r&&!i){if(b(t)){const s=o.__lexicalTextContent;s!==void 0&&(ee+=s,Le+=s);const l=o.__lexicalDirTextContent;l!==void 0&&(ae+=l)}else{const s=t.getTextContent();D(t)&&!t.isDirectionless()&&(ae+=s),Le+=s,ee+=s}return o}if(t!==r&&i&&Ar(Vt,Ut,jn,r,"updated"),r.updateDOM(t,o,Ke)){const s=Fn(n,null,null);return e===null&&j(62),e.replaceChild(s,o),In(n,null),s}if(b(t)&&b(r)){const s=r.__indent;s!==t.__indent&&xo(o,s);const l=r.__format;l!==t.__format&&bo(o,l),i&&(Ql(t,r,o),oe(r)||r.isInline()||wo(t,r,o)),kn(r)&&(ee+=Pe,Le+=Pe)}else{const s=r.getTextContent();if(U(r)){const l=r.decorate(le,Ke);l!==null&&To(n,l)}else D(r)&&!r.isDirectionless()&&(ae+=s);ee+=s,Le+=s}if(!Jt&&oe(r)&&r.__cachedText!==Le){const s=r.getWritable();s.__cachedText=Le,r=s}return o}function To(n,e){let t=le._pendingDecorators;const r=le._decorators;if(t===null){if(r[n]===e)return;t=ro(le)}t[n]=e}function Hr(n){let e=n.nextSibling;return e!==null&&e===le._blockCursorElement&&(e=e.nextSibling),e}function ea(n,e,t,r,i,o){ee="",Le="",ae="",vo=r===ht,An=null,le=t,Ke=t._config,Ut=t._nodes,jn=le._listeners.mutation,zr=i,Kr=o,tt=n._nodeMap,ve=e._nodeMap,Jt=e._readOnly,Ur=new Map(t._keyToDOMMap);const s=new Map;return Vt=s,Ht("root",null),le=void 0,Ut=void 0,zr=void 0,Kr=void 0,tt=void 0,ve=void 0,Ke=void 0,Ur=void 0,Vt=void 0,s}function Yr(n){const e=Ur.get(n);return e===void 0&&j(75,n),e}const je=Object.freeze({}),qr=30,Gr=[["keydown",function(n,e){if(Yt=n.timeStamp,Eo=n.key,e.isComposing())return;const{key:t,shiftKey:r,ctrlKey:i,metaKey:o,altKey:s}=n;I(e,cl,n)||t!=null&&(function(l,a,c,u){return fo(l)&&!a&&!u&&!c}(t,i,s,o)?I(e,Di,n):function(l,a,c,u,d){return fo(l)&&!u&&!c&&(a||d)}(t,i,r,s,o)?I(e,ul,n):function(l,a,c,u){return uo(l)&&!a&&!u&&!c}(t,i,s,o)?I(e,Li,n):function(l,a,c,u,d){return uo(l)&&!u&&!c&&(a||d)}(t,i,r,s,o)?I(e,fl,n):function(l,a,c){return function(u){return u==="ArrowUp"}(l)&&!a&&!c}(t,i,o)?I(e,ji,n):function(l,a,c){return function(u){return u==="ArrowDown"}(l)&&!a&&!c}(t,i,o)?I(e,Ai,n):function(l,a){return ho(l)&&a}(t,r)?(qt=!0,I(e,mn,n)):function(l){return l===" "}(t)?I(e,dl,n):function(l,a){return ye&&a&&l.toLowerCase()==="o"}(t,i)?(n.preventDefault(),qt=!0,I(e,ft,!0)):function(l,a){return ho(l)&&!a}(t,r)?(qt=!1,I(e,mn,n)):function(l,a,c,u){return ye?!a&&!c&&(Rt(l)||l.toLowerCase()==="h"&&u):!(u||a||c)&&Rt(l)}(t,s,o,i)?Rt(t)?I(e,Ii,n):(n.preventDefault(),I(e,Xe,!0)):function(l){return l==="Escape"}(t)?I(e,Fi,n):function(l,a,c,u,d){return ye?!(c||u||d)&&(Wt(l)||l.toLowerCase()==="d"&&a):!(a||u||d)&&Wt(l)}(t,i,r,s,o)?Wt(t)?I(e,Mi,n):(n.preventDefault(),I(e,Xe,!1)):function(l,a,c){return Rt(l)&&(ye?a:c)}(t,s,i)?(n.preventDefault(),I(e,Lt,!0)):function(l,a,c){return Wt(l)&&(ye?a:c)}(t,s,i)?(n.preventDefault(),I(e,Lt,!1)):function(l,a){return ye&&a&&Rt(l)}(t,o)?(n.preventDefault(),I(e,jt,!0)):function(l,a){return ye&&a&&Wt(l)}(t,o)?(n.preventDefault(),I(e,jt,!1)):function(l,a,c,u){return l.toLowerCase()==="b"&&!a&&$t(c,u)}(t,s,o,i)?(n.preventDefault(),I(e,fe,"bold")):function(l,a,c,u){return l.toLowerCase()==="u"&&!a&&$t(c,u)}(t,s,o,i)?(n.preventDefault(),I(e,fe,"underline")):function(l,a,c,u){return l.toLowerCase()==="i"&&!a&&$t(c,u)}(t,s,o,i)?(n.preventDefault(),I(e,fe,"italic")):function(l,a,c,u){return l==="Tab"&&!a&&!c&&!u}(t,s,i,o)?I(e,hl,n):function(l,a,c,u){return l.toLowerCase()==="z"&&!a&&$t(c,u)}(t,r,o,i)?(n.preventDefault(),I(e,gn,void 0)):function(l,a,c,u){return ye?l.toLowerCase()==="z"&&c&&a:l.toLowerCase()==="y"&&u||l.toLowerCase()==="z"&&u&&a}(t,r,o,i)?(n.preventDefault(),I(e,pn,void 0)):be(e._editorState._selection)?function(l,a,c,u){return!a&&l.toLowerCase()==="c"&&(ye?c:u)}(t,r,o,i)?(n.preventDefault(),I(e,_n,n)):function(l,a,c,u){return!a&&l.toLowerCase()==="x"&&(ye?c:u)}(t,r,o,i)?(n.preventDefault(),I(e,gr,n)):go(t,o,i)&&(n.preventDefault(),I(e,pr,n)):!We&&go(t,o,i)&&(n.preventDefault(),I(e,pr,n)),function(l,a,c,u){return l||a||c||u}(i,r,s,o)&&I(e,xl,n))}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;t instanceof Node&&r!=="touch"&&ge(e,()=>{U(et(t))||(Zr=!0)})}],["compositionstart",function(n,e){ge(e,()=>{const t=F();if(O(t)&&!e.isComposing()){const r=t.anchor,i=t.anchor.getNode();re(r.key),(n.timeStamp<Yt+qr||r.type==="element"||!t.isCollapsed()||i.getFormat()!==t.format||D(i)&&i.getStyle()!==t.style)&&I(e,dt,Nl)}})}],["compositionend",function(n,e){We?Gt=!0:ge(e,()=>{Qr(e,n.data)})}],["input",function(n,e){n.stopPropagation(),ge(e,()=>{const t=F(),r=n.data,i=Lo(n);if(r!=null&&O(t)&&Po(t,i,r,n.timeStamp,!1)){Gt&&(Qr(e,r),Gt=!1);const o=t.anchor.getNode(),s=Se(e._window);if(s===null)return;const l=t.isBackward(),a=l?t.anchor.offset:t.focus.offset,c=l?t.focus.offset:t.anchor.offset;yn&&!t.isCollapsed()&&D(o)&&s.anchorNode!==null&&o.getTextContent().slice(0,a)+r+o.getTextContent().slice(a+c)===co(s.anchorNode)||I(e,dt,r);const u=r.length;We&&u>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),mr||vn||_r||!e.isComposing()||(Yt=0,re(null))}else Lr(!1,e,r!==null?r:void 0),Gt&&(Qr(e,r||void 0),Gt=!1);he(),Yi(G())}),_t=null}],["click",function(n,e){ge(e,()=>{const t=F(),r=Se(e._window),i=tn();if(r){if(O(t)){const o=t.anchor,s=o.getNode();o.type==="element"&&o.offset===0&&t.isCollapsed()&&!oe(s)&&Z().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&i!==null&&t.is(i)?(r.removeAllRanges(),t.dirty=!0):n.detail===3&&!t.isCollapsed()&&s!==t.focus.getNode()&&(b(s)?s.select(0):s.getParentOrThrow().select(0))}else if(n.pointerType==="touch"){const o=r.anchorNode;if(o!==null){const s=o.nodeType;(s===Ft||s===Be)&&we(li(i,r,e,n))}}}I(e,Oi,n)})}],["cut",je],["copy",je],["dragstart",je],["dragover",je],["dragend",je],["paste",je],["focus",je],["blur",je],["drop",je]];yn&&Gr.push(["beforeinput",(n,e)=>function(t,r){const i=t.inputType,o=Lo(t);i==="deleteCompositionText"||We&&mo(r)||i!=="insertCompositionText"&&ge(r,()=>{const s=F();if(i==="deleteContentBackward"){if(s===null){const h=tn();if(!O(h))return;we(h.clone())}if(O(s)){const h=s.anchor.key===s.focus.key;if(l=t.timeStamp,Eo==="MediaLast"&&l<Yt+qr&&r.isComposing()&&h){if(re(null),Yt=0,setTimeout(()=>{ge(r,()=>{re(null)})},qr),O(s)){const g=s.anchor.getNode();g.markDirty(),s.format=g.getFormat(),D(g)||j(142),s.style=g.getStyle()}}else{re(null),t.preventDefault();const g=s.anchor.getNode().getTextContent(),m=s.anchor.offset===0&&s.focus.offset===g.length;wl&&h&&!m||I(r,Xe,!0)}return}}var l;if(!O(s))return;const a=t.data;_t!==null&&Lr(!1,r,_t),s.dirty&&_t===null||!s.isCollapsed()||oe(s.anchor.getNode())||o===null||s.applyDOMRange(o),_t=null;const c=s.anchor,u=s.focus,d=c.getNode(),f=u.getNode();if(i!=="insertText"&&i!=="insertTranspose")switch(t.preventDefault(),i){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":I(r,dt,t);break;case"insertFromComposition":re(null),I(r,dt,t);break;case"insertLineBreak":re(null),I(r,ft,!1);break;case"insertParagraph":re(null),qt&&!vn?(qt=!1,I(r,ft,!1)):I(r,hn,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":I(r,fr,t);break;case"deleteByComposition":(function(h,g){return h!==g||b(h)||b(g)||!h.isToken()||!g.isToken()})(d,f)&&I(r,dr,t);break;case"deleteByDrag":case"deleteByCut":I(r,dr,t);break;case"deleteContent":I(r,Xe,!1);break;case"deleteWordBackward":I(r,Lt,!0);break;case"deleteWordForward":I(r,Lt,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":I(r,jt,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":I(r,jt,!1);break;case"formatStrikeThrough":I(r,fe,"strikethrough");break;case"formatBold":I(r,fe,"bold");break;case"formatItalic":I(r,fe,"italic");break;case"formatUnderline":I(r,fe,"underline");break;case"historyUndo":I(r,gn,void 0);break;case"historyRedo":I(r,pn,void 0)}else{if(a===`
32
- `)t.preventDefault(),I(r,ft,!1);else if(a===Pe)t.preventDefault(),I(r,hn,void 0);else if(a==null&&t.dataTransfer){const h=t.dataTransfer.getData("text/plain");t.preventDefault(),s.insertRawText(h)}else a!=null&&Po(s,o,a,t.timeStamp,!0)?(t.preventDefault(),I(r,dt,a)):_t=a;ko=t.timeStamp}})}(n,e)]);let Yt=0,Eo=null,ko=0,_t=null;const $n=new WeakMap;let Xr=!1,Zr=!1,qt=!1,Gt=!1,No=[0,"",0,"root",0];function Po(n,e,t,r,i){const o=n.anchor,s=n.focus,l=o.getNode(),a=G(),c=Se(a._window),u=c!==null?c.anchorNode:null,d=o.key,f=a.getElementByKey(d),h=t.length;return d!==s.key||!D(l)||(!i&&(!yn||ko<r+50)||l.isDirty()&&h<2||lo(t))&&o.offset!==s.offset&&!l.isComposing()||De(l)||l.isDirty()&&h>1||(i||!yn)&&f!==null&&!l.isComposing()&&u!==Tn(f)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||l.getFormat()!==n.format||l.getStyle()!==n.style||Ul(n,l)}function Oo(n,e){return n!==null&&n.nodeValue!==null&&n.nodeType===Be&&e!==0&&e!==n.nodeValue.length}function Do(n,e,t){const{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}=n;Xr&&(Xr=!1,Oo(r,i)&&Oo(o,s))||ge(e,()=>{if(!t)return void we(null);if(!Mt(e,r,o))return;const l=F();if(O(l)){const a=l.anchor,c=a.getNode();if(l.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(l.dirty=!0);const u=On(e).event,d=u?u.timeStamp:performance.now(),[f,h,g,m,_]=No,x=Z(),v=e.isComposing()===!1&&x.getTextContent()==="";if(d<_+200&&a.offset===g&&a.key===m)l.format=f,l.style=h;else if(a.type==="text")D(c)||j(141),l.format=c.getFormat(),l.style=c.getStyle();else if(a.type==="element"&&!v){const y=a.getNode();l.style="",y instanceof xt&&y.getChildrenSize()===0?(l.format=y.getTextFormat(),l.style=y.getTextStyle()):l.format=0}}else{const u=a.key,d=l.focus.key,f=l.getNodes(),h=f.length,g=l.isBackward(),m=g?s:i,_=g?i:s,x=g?d:u,v=g?u:d;let y=kl,C=!1;for(let T=0;T<h;T++){const S=f[T],P=S.getTextContentSize();if(D(S)&&P!==0&&!(T===0&&S.__key===x&&m===P||T===h-1&&S.__key===v&&_===0)&&(C=!0,y&=S.getFormat(),y===0))break}l.format=C?y:0}}I(e,dn,void 0)})}function Lo(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function Qr(n,e){const t=n._compositionKey;if(re(null),t!==null&&e!=null){if(e===""){const r=se(t),i=Tn(n.getElementByKey(t));return void(i!==null&&i.nodeValue!==null&&D(r)&&jr(r,i.nodeValue,null,null,!0))}if(e[e.length-1]===`
33
- `){const r=F();if(O(r)){const i=r.focus;return r.anchor.set(i.key,i.offset,i.type),void I(n,mn,null)}}}Lr(!0,n,e)}function jo(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}const yt=new Map;function Ao(n){const e=n.target,t=Se(e==null?null:e.nodeType===9?e.defaultView:e.ownerDocument.defaultView);if(t===null)return;const r=to(t.anchorNode);if(r===null)return;Zr&&(Zr=!1,ge(r,()=>{const c=tn(),u=t.anchorNode;if(u===null)return;const d=u.nodeType;d!==Ft&&d!==Be||we(li(c,t,r,n))}));const i=Dr(r),o=i[i.length-1],s=o._key,l=yt.get(s),a=l||o;a!==r&&Do(t,a,!1),Do(t,r,!0),r!==o?yt.set(s,r):l&&yt.delete(s)}function Io(n){n._lexicalHandled=!0}function Fo(n){return n._lexicalHandled===!0}function ta(n){const e=n.ownerDocument,t=$n.get(e);t===void 0&&j(162);const r=t-1;r>=0||j(164),$n.set(e,r),r===0&&e.removeEventListener("selectionchange",Ao);const i=Sn(n);Pr(i)?(function(s){if(s._parentEditor!==null){const l=Dr(s),a=l[l.length-1]._key;yt.get(a)===s&&yt.delete(a)}else yt.delete(s._key)}(i),n.__lexicalEditor=null):i&&j(198);const o=jo(n);for(let s=0;s<o.length;s++)o[s]();n.__lexicalEventHandles=[]}function ei(n,e,t){he();const r=n.__key,i=n.getParent();if(i===null)return;const o=function(l){const a=F();if(!O(a)||!b(l))return a;const{anchor:c,focus:u}=a,d=c.getNode(),f=u.getNode();return Ir(d,l)&&c.set(l.__key,0,"element"),Ir(f,l)&&u.set(l.__key,0,"element"),a}(n);let s=!1;if(O(o)&&e){const l=o.anchor,a=o.focus;l.key===r&&(Un(l,n,i,n.getPreviousSibling(),n.getNextSibling()),s=!0),a.key===r&&(Un(a,n,i,n.getPreviousSibling(),n.getNextSibling()),s=!0)}else be(o)&&e&&n.isSelected()&&n.selectPrevious();if(O(o)&&e&&!s){const l=n.getIndexWithinParent();Qe(n),Kn(o,i,l,-1)}else Qe(n);t||pt(i)||i.canBeEmpty()||!i.isEmpty()||ei(i,e),e&&oe(i)&&i.isEmpty()&&i.selectEnd()}class Rn{static getType(){j(64,this.name)}static clone(e){j(65,this.name)}afterCloneFrom(e){this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Kl(this,e)}getType(){return this.__type}isInline(){j(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;const t=se(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){const t=e||F();if(t==null)return!1;const r=t.getNodes().some(i=>i.__key===this.__key);if(D(this))return r;if(O(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const i=this.getParent();if(U(this)&&this.isInline()&&i){const o=t.isBackward()?t.focus:t.anchor,s=o.getNode();if(o.offset===s.getChildrenSize()&&s.is(i)&&s.getLastChildOrThrow().is(this))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),r=0;for(;t!==null;){if(this.is(t))return r;r++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return e===null?null:se(e)}getParentOrThrow(){const e=this.getParent();return e===null&&j(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(pt(t))return b(e)||e===this&&U(e)||j(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&j(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return e===null?null:se(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(t===null)return e;let r=t.getFirstChild();for(;r!==null&&!r.is(this);)e.push(r),r=r.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return e===null?null:se(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=this.getParents(),r=e.getParents();b(this)&&t.unshift(this),b(e)&&r.unshift(e);const i=t.length,o=r.length;if(i===0||o===0||t[i-1]!==r[o-1])return null;const s=new Set(r);for(let l=0;l<i;l++){const a=t[l];if(s.has(a))return a}return null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){if(this===e)return!1;if(e.isParentOf(this))return!0;if(this.isParentOf(e))return!1;const t=this.getCommonAncestor(e);let r=0,i=0,o=this;for(;;){const s=o.getParentOrThrow();if(s===t){r=o.getIndexWithinParent();break}o=s}for(o=e;;){const s=o.getParentOrThrow();if(s===t){i=o.getIndexWithinParent();break}o=s}return r<i}isParentOf(e){const t=this.__key;if(t===e.__key)return!1;let r=e;for(;r!==null;){if(r.__key===t)return!0;r=r.getParent()}return!1}getNodesBetween(e){const t=this.isBefore(e),r=[],i=new Set;let o=this;for(;o!==null;){const s=o.__key;if(i.has(s)||(i.add(s),r.push(o)),o===e)break;const l=b(o)?t?o.getFirstChild():o.getLastChild():null;if(l!==null){o=l;continue}const a=t?o.getNextSibling():o.getPreviousSibling();if(a!==null){o=a;continue}const c=o.getParentOrThrow();if(i.has(c.__key)||r.push(c),c===e)break;let u=null,d=c;do{if(d===null&&j(68),u=t?d.getNextSibling():d.getPreviousSibling(),d=d.getParent(),d===null)break;u!==null||i.has(d.__key)||r.push(d)}while(u===null);o=u}return t||r.reverse(),r}isDirty(){const e=G()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){const e=se(this.__key);return e===null&&j(113),e}getWritable(){he();const e=Ae(),t=G(),r=e._nodeMap,i=this.__key,o=this.getLatest(),s=t._cloneNotNeeded,l=F();if(l!==null&&l.setCachedNodes(null),s.has(i))return En(o),o;const a=Br(o);return s.add(i),En(a),r.set(i,a),a}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){j(70)}updateDOM(e,t,r){j(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){j(72)}static importJSON(e){j(18,this.name)}static transform(){return null}remove(e){ei(this,!0,e)}replace(e,t){he();let r=F();r!==null&&(r=r.clone()),Fr(this,e);const i=this.getLatest(),o=this.__key,s=e.__key,l=e.getWritable(),a=this.getParentOrThrow().getWritable(),c=a.__size;Qe(l);const u=i.getPreviousSibling(),d=i.getNextSibling(),f=i.__prev,h=i.__next,g=i.__parent;if(ei(i,!1,!0),u===null?a.__first=s:u.getWritable().__next=s,l.__prev=f,d===null?a.__last=s:d.getWritable().__prev=s,l.__next=h,l.__parent=g,a.__size=c,t&&(b(this)&&b(l)||j(139),this.getChildren().forEach(m=>{l.append(m)})),O(r)){we(r);const m=r.anchor,_=r.focus;m.key===o&&zo(m,l),_.key===o&&zo(_,l)}return ze()===o&&re(s),l}insertAfter(e,t=!0){he(),Fr(this,e);const r=this.getWritable(),i=e.getWritable(),o=i.getParent(),s=F();let l=!1,a=!1;if(o!==null){const h=e.getIndexWithinParent();if(Qe(i),O(s)){const g=o.__key,m=s.anchor,_=s.focus;l=m.type==="element"&&m.key===g&&m.offset===h+1,a=_.type==="element"&&_.key===g&&_.offset===h+1}}const c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),d=i.__key,f=r.__next;if(c===null?u.__last=d:c.getWritable().__prev=d,u.__size++,r.__next=d,i.__next=f,i.__prev=r.__key,i.__parent=r.__parent,t&&O(s)){const h=this.getIndexWithinParent();Kn(s,u,h+1);const g=u.__key;l&&s.anchor.set(g,h+2,"element"),a&&s.focus.set(g,h+2,"element")}return e}insertBefore(e,t=!0){he(),Fr(this,e);const r=this.getWritable(),i=e.getWritable(),o=i.__key;Qe(i);const s=this.getPreviousSibling(),l=this.getParentOrThrow().getWritable(),a=r.__prev,c=this.getIndexWithinParent();s===null?l.__first=o:s.getWritable().__next=o,l.__size++,r.__prev=o,i.__prev=a,i.__next=r.__key,i.__parent=r.__parent;const u=F();return t&&O(u)&&Kn(u,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return ke()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){he();const r=this.getPreviousSibling(),i=this.getParentOrThrow();if(r===null)return i.select(0,0);if(b(r))return r.select();if(!D(r)){const o=r.getIndexWithinParent()+1;return i.select(o,o)}return r.select(e,t)}selectNext(e,t){he();const r=this.getNextSibling(),i=this.getParentOrThrow();if(r===null)return i.select();if(b(r))return r.select(0,0);if(!D(r)){const o=r.getIndexWithinParent();return i.select(o,o)}return r.select(e,t)}markDirty(){this.getWritable()}}class Xt extends Rn{static getType(){return"linebreak"}static clone(e){return new Xt(e.__key)}constructor(e){super(e)}getTextContent(){return`
34
- `}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(t){const r=t.parentElement;if(r!==null&&Ln(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&Wn(i)){const o=r.lastChild;if(o===t||o.previousSibling===t&&Wn(o))return!0}}return!1}(e)||function(t){const r=t.parentElement;if(r!==null&&Ln(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&Wn(i))return!1;const o=r.lastChild;if(o===t||o.previousSibling===t&&Wn(o))return!0}return!1}(e)?null:{conversion:na,priority:0}}}static importJSON(e){return rt()}exportJSON(){return{type:"linebreak",version:1}}}function na(n){return{node:rt()}}function rt(){return Kt(new Xt)}function Zt(n){return n instanceof Xt}function Wn(n){return n.nodeType===Be&&/^( |\t|\r?\n)+$/.test(n.textContent||"")}function ti(n,e){return 16&e?"code":e&yr?"mark":32&e?"sub":64&e?"sup":null}function ni(n,e){return 1&e?"strong":2&e?"em":"span"}function Mo(n,e,t,r,i){const o=r.classList;let s=Bt(i,"base");s!==void 0&&o.add(...s),s=Bt(i,"underlineStrikethrough");let l=!1;const a=e&bn&&e&xn;s!==void 0&&(t&bn&&t&xn?(l=!0,a||o.add(...s)):a&&o.remove(...s));for(const c in Oe){const u=Oe[c];if(s=Bt(i,c),s!==void 0)if(t&u){if(l&&(c==="underline"||c==="strikethrough")){e&u&&o.remove(...s);continue}e&u&&(!a||c!=="underline")&&c!=="strikethrough"||o.add(...s)}else e&u&&o.remove(...s)}}function $o(n,e,t){const r=e.firstChild,i=t.isComposing(),o=n+(i?Cn:"");if(r==null)e.textContent=o;else{const s=r.nodeValue;if(s!==o)if(i||We){const[l,a,c]=function(u,d){const f=u.length,h=d.length;let g=0,m=0;for(;g<f&&g<h&&u[g]===d[g];)g++;for(;m+g<f&&m+g<h&&u[f-m-1]===d[h-m-1];)m++;return[g,f-g-m,d.slice(g,h-m)]}(s,o);a!==0&&r.deleteData(l,a),r.insertData(l,c)}else r.nodeValue=o}}function Ro(n,e,t,r,i,o){$o(i,n,e);const s=o.theme.text;s!==void 0&&Mo(0,0,r,n,s)}function Bn(n,e){const t=document.createElement(e);return t.appendChild(n),t}class vt extends Rn{static getType(){return"text"}static clone(e){return new vt(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e,t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return Al[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===ze()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=Oe[e];return!!(this.getFormat()&t)}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return Or(this.getLatest().__format,e,t)}canHaveFormat(){return!0}createDOM(e,t){const r=this.__format,i=ti(0,r),o=ni(0,r),s=i===null?o:i,l=document.createElement(s);let a=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),i!==null&&(a=document.createElement(o),l.appendChild(a)),Ro(a,this,0,r,this.__text,e);const c=this.__style;return c!==""&&(l.style.cssText=c),l}updateDOM(e,t,r){const i=this.__text,o=e.__format,s=this.__format,l=ti(0,o),a=ti(0,s),c=ni(0,o),u=ni(0,s);if((l===null?c:l)!==(a===null?u:a))return!0;if(l===a&&c!==u){const m=t.firstChild;m==null&&j(48);const _=document.createElement(u);return Ro(_,this,0,s,i,r),t.replaceChild(_,m),!1}let d=t;a!==null&&l!==null&&(d=t.firstChild,d==null&&j(49)),$o(i,d,this);const f=r.theme.text;f!==void 0&&o!==s&&Mo(0,o,s,d,f);const h=e.__style,g=this.__style;return h!==g&&(t.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:sa,priority:0}),b:()=>({conversion:ia,priority:0}),code:()=>({conversion:Ue,priority:0}),em:()=>({conversion:Ue,priority:0}),i:()=>({conversion:Ue,priority:0}),s:()=>({conversion:Ue,priority:0}),span:()=>({conversion:ra,priority:0}),strong:()=>({conversion:Ue,priority:0}),sub:()=>({conversion:Ue,priority:0}),sup:()=>({conversion:Ue,priority:0}),u:()=>({conversion:Ue,priority:0})}}static importJSON(e){const t=ie(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){let{element:t}=super.exportDOM(e);return t!==null&&Dn(t)||j(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=Bn(t,"b")),this.hasFormat("italic")&&(t=Bn(t,"i")),this.hasFormat("strikethrough")&&(t=Bn(t,"s")),this.hasFormat("underline")&&(t=Bn(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format=typeof e=="string"?Oe[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail=typeof e=="string"?Dl[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=Or(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=jl[e];if(this.__mode===t)return this;const r=this.getWritable();return r.__mode=t,r}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){he();let r=e,i=t;const o=F(),s=this.getTextContent(),l=this.__key;if(typeof s=="string"){const a=s.length;r===void 0&&(r=a),i===void 0&&(i=a)}else r=0,i=0;if(!O(o))return qo(l,r,l,i,"text","text");{const a=ze();a!==o.anchor.key&&a!==o.focus.key||re(l),o.setTextNodeRange(this,r,this,i)}return o}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,r,i){const o=this.getWritable(),s=o.__text,l=r.length;let a=e;a<0&&(a=l+a,a<0&&(a=0));const c=F();if(i&&O(c)){const d=e+l;c.setTextNodeRange(o,d,o,d)}const u=s.slice(0,a)+r+s.slice(a+t);return o.__text=u,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){he();const t=this.getLatest(),r=t.getTextContent(),i=t.__key,o=ze(),s=new Set(e),l=[],a=r.length;let c="";for(let T=0;T<a;T++)c!==""&&s.has(T)&&(l.push(c),c=""),c+=r[T];c!==""&&l.push(c);const u=l.length;if(u===0)return[];if(l[0]===r)return[t];const d=l[0],f=t.getParent();let h;const g=t.getFormat(),m=t.getStyle(),_=t.__detail;let x=!1;t.isSegmented()?(h=ie(d),h.__format=g,h.__style=m,h.__detail=_,x=!0):(h=t.getWritable(),h.__text=d);const v=F(),y=[h];let C=d.length;for(let T=1;T<u;T++){const S=l[T],P=S.length,k=ie(S).getWritable();k.__format=g,k.__style=m,k.__detail=_;const E=k.__key,M=C+P;if(O(v)){const R=v.anchor,q=v.focus;R.key===i&&R.type==="text"&&R.offset>C&&R.offset<=M&&(R.key=E,R.offset-=C,v.dirty=!0),q.key===i&&q.type==="text"&&q.offset>C&&q.offset<=M&&(q.key=E,q.offset-=C,v.dirty=!0)}o===i&&re(E),C=M,y.push(k)}if(f!==null){(function(P){const k=P.getPreviousSibling(),E=P.getNextSibling();k!==null&&En(k),E!==null&&En(E)})(this);const T=f.getWritable(),S=this.getIndexWithinParent();x?(T.splice(S,0,y),this.remove()):T.splice(S,1,y),O(v)&&Kn(v,f,S,u-1)}return y}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||j(50);const r=this.__key,i=e.__key,o=this.__text,s=o.length;ze()===i&&re(r);const l=F();if(O(l)){const d=l.anchor,f=l.focus;d!==null&&d.key===i&&(Zo(d,t,r,e,s),l.dirty=!0),f!==null&&f.key===i&&(Zo(f,t,r,e,s),l.dirty=!0)}const a=e.__text,c=t?a+o:o+a;this.setTextContent(c);const u=this.getWritable();return e.remove(),u}isTextEntity(){return!1}}function ra(n){return{forChild:ri(n.style),node:null}}function ia(n){const e=n,t=e.style.fontWeight==="normal";return{forChild:ri(e.style,t?void 0:"bold"),node:null}}const Wo=new WeakMap;function oa(n){return n.nodeName==="PRE"||n.nodeType===Ft&&n.style!==void 0&&n.style.whiteSpace!==void 0&&n.style.whiteSpace.startsWith("pre")}function sa(n){const e=n;n.parentElement===null&&j(129);let t=e.textContent||"";if(function(r){let i,o=r.parentNode;const s=[r];for(;o!==null&&(i=Wo.get(o))===void 0&&!oa(o);)s.push(o),o=o.parentNode;const l=i===void 0?o:i;for(let a=0;a<s.length;a++)Wo.set(s[a],l);return l}(e)!==null){const r=t.split(/(\r?\n|\t)/),i=[],o=r.length;for(let s=0;s<o;s++){const l=r[s];l===`
31
+ `,Nl=Be?" ":Cn,Ui="֑-߿יִ-﷽ﹰ-ﻼ",Vi="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Pl=new RegExp("^[^"+Vi+"]*["+Ui+"]"),Ol=new RegExp("^[^"+Ui+"]*["+Vi+"]"),Oe={bold:1,code:16,highlight:yr,italic:2,strikethrough:xn,subscript:32,superscript:64,underline:bn},Dl={directionless:1,unmergeable:2},Ji={center:xr,end:Sr,justify:Cr,left:vr,right:br,start:wr},Ll={[xr]:"center",[Sr]:"end",[Cr]:"justify",[vr]:"left",[br]:"right",[wr]:"start"},jl={normal:0,segmented:2,token:1},Al={[Sl]:"normal",[El]:"segmented",[Tl]:"token"};function Il(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var j=Il(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function wn(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}const Fl=100;let Tr=!1,Er=0;function Ml(n){Er=n.timeStamp}function kr(n,e,t){return e.__lexicalLineBreak===n||n[`__lexicalKey_${t._key}`]!==void 0}function $l(n,e,t){const r=Se(t._window);let i=null,o=null;r!==null&&r.anchorNode===n&&(i=r.anchorOffset,o=r.focusOffset);const s=n.nodeValue;s!==null&&jr(e,s,i,o,!1)}function Rl(n,e,t){if(O(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return e.nodeType===ze&&t.isAttached()}function Hi(n,e,t){Tr=!0;const r=performance.now()-Er>Fl;try{ge(n,()=>{const i=F()||function(f){return f.getEditorState().read(()=>{const h=F();return h!==null?h.clone():null})}(n),o=new Map,s=n.getRootElement(),l=n._editorState,a=n._blockCursorElement;let c=!1,u="";for(let f=0;f<e.length;f++){const h=e[f],g=h.type,m=h.target;let _=tt(m,l);if(!(_===null&&m!==s||U(_))){if(g==="characterData")r&&D(_)&&Rl(i,m,_)&&$l(m,_,n);else if(g==="childList"){c=!0;const x=h.addedNodes;for(let C=0;C<x.length;C++){const T=x[C],S=no(T),P=T.parentNode;if(P!=null&&T!==a&&S===null&&(T.nodeName!=="BR"||!kr(T,P,n))){if(Be){const k=T.innerText||T.nodeValue;k&&(u+=k)}P.removeChild(T)}}const v=h.removedNodes,y=v.length;if(y>0){let C=0;for(let T=0;T<y;T++){const S=v[T];(S.nodeName==="BR"&&kr(S,m,n)||a===S)&&(m.appendChild(S),C++)}y!==C&&(m===s&&(_=oo(l)),o.set(m,_))}}}}if(o.size>0)for(const[f,h]of o)if(b(h)){const g=h.getChildrenKeys();let m=f.firstChild;for(let _=0;_<g.length;_++){const x=g[_],v=n.getElementByKey(x);v!==null&&(m==null?(f.appendChild(v),m=v):m!==v&&f.replaceChild(v,m),m=m.nextSibling)}}else D(h)&&h.markDirty();const d=t.takeRecords();if(d.length>0){for(let f=0;f<d.length;f++){const h=d[f],g=h.addedNodes,m=h.target;for(let _=0;_<g.length;_++){const x=g[_],v=x.parentNode;v==null||x.nodeName!=="BR"||kr(x,m,n)||v.removeChild(x)}}t.takeRecords()}i!==null&&(c&&(i.dirty=!0,we(i)),Be&&mo(n)&&i.insertRawText(u))})}finally{Tr=!1}}function Yi(n){const e=n._observer;e!==null&&Hi(n,e.takeRecords(),e)}function qi(n){(function(e){Er===0&&On(e).addEventListener("textInput",Ml,!0)})(n),n._observer=new MutationObserver((e,t)=>{Hi(n,e,t)})}function Gi(n,e){const t=n.__mode,r=n.__format,i=n.__style,o=e.__mode,s=e.__format,l=e.__style;return!(t!==null&&t!==o||r!==null&&r!==s||i!==null&&i!==l)}function Xi(n,e){const t=n.mergeWithSibling(e),r=G()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function Zi(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&D(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Gi(e,r)){r=Xi(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&D(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Gi(r,t)){r=Xi(r,t);break}break}t.remove()}}else r.remove()}function Qi(n){return eo(n.anchor),eo(n.focus),n}function eo(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,i;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),i=!0):(r=e.getChildAtIndex(t),i=!1),D(r)){n.set(r.__key,i?r.getTextContentSize():0,"text");break}if(!b(r))break;n.set(r.__key,i?r.getChildrenSize():0,"element")}}let Bl=1;const zl=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function Nr(n){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return U(tt(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&Sn(e)==null)}function Mt(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!Nr(e)&&to(e)===n}catch{return!1}}function Pr(n){return n instanceof Hn}function to(n){let e=n;for(;e!=null;){const t=Sn(e);if(Pr(t))return t;e=Pn(e)}return null}function Sn(n){return n?n.__lexicalEditor:null}function De(n){return n.isToken()||n.isSegmented()}function Wl(n){return n.nodeType===ze}function Tn(n){let e=n;for(;e!=null;){if(Wl(e))return e;e=e.firstChild}return null}function Or(n,e,t){const r=Oe[e];if(t!==null&&(n&r)==(t&r))return n;let i=n^r;return e==="subscript"?i&=~Oe.superscript:e==="superscript"&&(i&=~Oe.subscript),i}function Kl(n,e){if(e!=null)return void(n.__key=e);he(),es();const t=G(),r=Ae(),i=""+Bl++;r._nodeMap.set(i,n),b(n)?t._dirtyElements.set(i,!0):t._dirtyLeaves.add(i),t._cloneNotNeeded.add(i),t._dirtyType=Ki,n.__key=i}function et(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),i=n.getPreviousSibling(),o=n.getNextSibling();if(i===null)if(o!==null){const s=o.getWritable();r.__first=o.__key,s.__prev=null}else r.__first=null;else{const s=i.getWritable();if(o!==null){const l=o.getWritable();l.__prev=s.__key,s.__next=l.__key}else s.__next=null;t.__prev=null}if(o===null)if(i!==null){const s=i.getWritable();r.__last=i.__key,s.__next=null}else r.__last=null;else{const s=o.getWritable();if(i!==null){const l=i.getWritable();l.__next=s.__key,s.__prev=l.__key}else s.__prev=null;t.__next=null}r.__size--,t.__parent=null}}function En(n){es();const e=n.getLatest(),t=e.__parent,r=Ae(),i=G(),o=r._nodeMap,s=i._dirtyElements;t!==null&&function(a,c,u){let d=a;for(;d!==null;){if(u.has(d))return;const f=c.get(d);if(f===void 0)break;u.set(d,!1),d=f.__parent}}(t,o,s);const l=e.__key;i._dirtyType=Ki,b(n)?s.set(l,!0):i._dirtyLeaves.add(l)}function re(n){he();const e=G(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){const r=se(t);r!==null&&r.getWritable()}if(n!==null){const r=se(n);r!==null&&r.getWritable()}}}function We(){return nn()?null:G()._compositionKey}function se(n,e){const t=(e||Ae())._nodeMap.get(n);return t===void 0?null:t}function no(n,e){const t=n[`__lexicalKey_${G()._key}`];return t!==void 0?se(t,e):null}function tt(n,e){let t=n;for(;t!=null;){const r=no(t,e);if(r!==null)return r;t=Pn(t)}return null}function ro(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function io(n){return n.read(()=>Z().getTextContent())}function Z(){return oo(Ae())}function oo(n){return n._nodeMap.get("root")}function we(n){he();const e=Ae();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function pt(n){const e=G(),t=function(r,i){let o=r;for(;o!=null;){const s=o[`__lexicalKey_${i._key}`];if(s!==void 0)return s;o=Pn(o)}return null}(n,e);return t===null?n===e.getRootElement()?se("root"):null:se(t)}function so(n,e){return e?n.getTextContentSize():0}function lo(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function Dr(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function ao(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function co(n){return n.nodeType===ze?n.nodeValue:null}function Lr(n,e,t){const r=Se(e._window);if(r===null)return;const i=r.anchorNode;let{anchorOffset:o,focusOffset:s}=r;if(i!==null){let l=co(i);const a=tt(i);if(l!==null&&D(a)){if(l===Cn&&t){const c=t.length;l=t,o=c,s=c}l!==null&&jr(a,l,o,s,n)}}}function jr(n,e,t,r,i){let o=n;if(o.isAttached()&&(i||!o.isDirty())){const s=o.isComposing();let l=e;(s||i)&&e[e.length-1]===Cn&&(l=e.slice(0,-1));const a=o.getTextContent();if(i||l!==a){if(l===""){if(re(null),mr||vn||_r)o.remove();else{const m=G();setTimeout(()=>{m.update(()=>{o.isAttached()&&o.remove()})},20)}return}const c=o.getParent(),u=tn(),d=o.getTextContentSize(),f=We(),h=o.getKey();if(o.isToken()||f!==null&&h===f&&!s||O(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===n.__key&&u.anchor.offset===0&&!o.canInsertTextBefore()&&!s||u.focus.key===n.__key&&u.focus.offset===d&&!o.canInsertTextAfter()&&!s))return void o.markDirty();const g=F();if(!O(g)||t===null||r===null)return void o.setTextContent(l);if(g.setTextNodeRange(o,t,o,r),o.isSegmented()){const m=ie(o.getTextContent());o.replace(m),o=m}o.setTextContent(l)}}}function Ul(n,e){if(e.isSegmented())return!0;if(!n.isCollapsed())return!1;const t=n.anchor.offset,r=e.getParentOrThrow(),i=e.isToken();return t===0?!e.canInsertTextBefore()||!r.canInsertTextBefore()&&!e.isComposing()||i||function(o){const s=o.getPreviousSibling();return(D(s)||b(s)&&s.isInline())&&!s.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!r.canInsertTextAfter()&&!e.isComposing()||i)}function uo(n){return n==="ArrowLeft"}function fo(n){return n==="ArrowRight"}function $t(n,e){return ye?n:e}function ho(n){return n==="Enter"}function Rt(n){return n==="Backspace"}function Bt(n){return n==="Delete"}function go(n,e,t){return n.toLowerCase()==="a"&&$t(e,t)}function Vl(){const n=Z();we(Qi(n.select(0,n.getChildrenSize())))}function zt(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});const t=n.__lexicalClassNameCache,r=t[e];if(r!==void 0)return r;const i=n[e];if(typeof i=="string"){const o=wn(i);return t[e]=o,o}return i}function Ar(n,e,t,r,i){if(t.size===0)return;const o=r.__type,s=r.__key,l=e.get(o);l===void 0&&j(33,o);const a=l.klass;let c=n.get(a);c===void 0&&(c=new Map,n.set(a,c));const u=c.get(s),d=u==="destroyed"&&i==="created";(u===void 0||d)&&c.set(s,d?"updated":i)}function po(n,e,t){const r=n.getParent();let i=t,o=n;return r!==null&&(e&&t===0?(i=o.getIndexWithinParent(),o=r):e||t!==o.getChildrenSize()||(i=o.getIndexWithinParent()+1,o=r)),o.getChildAtIndex(e?i-1:i)}function Wt(n,e){const t=n.offset;if(n.type==="element")return po(n.getNode(),e,t);{const r=n.getNode();if(e&&t===0||!e&&t===r.getTextContentSize()){const i=e?r.getPreviousSibling():r.getNextSibling();return i===null?po(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):i}}return null}function mo(n){const e=On(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function I(n,e,t){return os(n,e,t)}function kn(n){return!oe(n)&&!n.isLastChild()&&!n.isInline()}function Nn(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&j(75,e),t}function Pn(n){const e=n.assignedSlot||n.parentElement;return e!==null&&e.nodeType===11?e.host:e}function Ir(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function On(n){const e=n._window;return e===null&&j(78),e}function Jl(n){let e=n.getParentOrThrow();for(;e!==null;){if(mt(e))return e;e=e.getParentOrThrow()}return e}function mt(n){return oe(n)||b(n)&&n.isShadowRoot()}function Kt(n){const e=G(),t=n.constructor.getType(),r=e._nodes.get(t);r===void 0&&j(97);const i=r.replace;if(i!==null){const o=i(n);return o instanceof n.constructor||j(98),o}return n}function Fr(n,e){!oe(n.getParent())||b(e)||U(e)||j(99)}function Mr(n){return(U(n)||b(n)&&!n.canBeEmpty())&&!n.isInline()}function $r(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function Hl(n,e,t){let r=n._blockCursorElement;if(O(t)&&t.isCollapsed()&&t.anchor.type==="element"&&e.contains(document.activeElement)){const i=t.anchor,o=i.getNode(),s=i.offset;let l=!1,a=null;if(s===o.getChildrenSize())Mr(o.getChildAtIndex(s-1))&&(l=!0);else{const c=o.getChildAtIndex(s);if(Mr(c)){const u=c.getPreviousSibling();(u===null||Mr(u))&&(l=!0,a=n.getElementByKey(c.__key))}}if(l){const c=n.getElementByKey(o.__key);return r===null&&(n._blockCursorElement=r=function(u){const d=u.theme,f=document.createElement("div");f.contentEditable="false",f.setAttribute("data-lexical-cursor","true");let h=d.blockCursor;if(h!==void 0){if(typeof h=="string"){const g=wn(h);h=d.blockCursor=g}h!==void 0&&f.classList.add(...h)}return f}(n._config)),e.style.caretColor="transparent",void(a===null?c.appendChild(r):c.insertBefore(r,a))}}r!==null&&$r(r,n,e)}function Se(n){return _e?(n||window).getSelection():null}function Yl(n){return Dn(n)&&n.tagName==="A"}function Dn(n){return n.nodeType===1}function Rr(n){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return n.nodeName.match(e)!==null}function Ln(n){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return n.nodeName.match(e)!==null}function _t(n){if(oe(n)||U(n)&&!n.isInline())return!0;if(!b(n)||mt(n))return!1;const e=n.getFirstChild(),t=e===null||Zt(e)||D(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function Br(n,e){let t=n;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}function ql(){return G()}const _o=new WeakMap,Gl=new Map;function Xl(n){if(!n._readOnly&&n.isEmpty())return Gl;n._readOnly||j(192);let e=_o.get(n);if(!e){e=new Map,_o.set(n,e);for(const[t,r]of n._nodeMap){const i=r.__type;let o=e.get(i);o||(o=new Map,e.set(i,o)),o.set(t,r)}}return e}function zr(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function yo(n,e,t,r,i,o){let s=n.getFirstChild();for(;s!==null;){const l=s.__key;s.__parent===e&&(b(s)&&yo(s,l,t,r,i,o),t.has(l)||o.delete(l),i.push(l)),s=s.getNextSibling()}}let Ke,le,Ut,jn,Wr,Kr,nt,ve,Ur,Vt,ee="",ae="",Te=null,xe="",Le="",vo=!1,Jt=!1,An=null;function In(n,e){const t=nt.get(n);if(e!==null){const r=Yr(n);r.parentNode===e&&e.removeChild(r)}if(ve.has(n)||le._keyToDOMMap.delete(n),b(t)){const r=Mn(t,nt);Vr(r,0,r.length-1,null)}t!==void 0&&Ar(Vt,Ut,jn,t,"destroyed")}function Vr(n,e,t,r){let i=e;for(;i<=t;++i){const o=n[i];o!==void 0&&In(o,r)}}function rt(n,e){n.setProperty("text-align",e)}const Zl="40px";function xo(n,e){const t=Ke.theme.indent;if(typeof t=="string"){const i=n.classList.contains(t);e>0&&!i?n.classList.add(t):e<1&&i&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||Zl;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function bo(n,e){const t=n.style;e===0?rt(t,""):e===vr?rt(t,"left"):e===xr?rt(t,"center"):e===br?rt(t,"right"):e===Cr?rt(t,"justify"):e===wr?rt(t,"start"):e===Sr&&rt(t,"end")}function Fn(n,e,t){const r=ve.get(n);r===void 0&&j(60);const i=r.createDOM(Ke,le);if(function(o,s,l){const a=l._keyToDOMMap;s["__lexicalKey_"+l._key]=o,a.set(o,s)}(n,i,le),D(r)?i.setAttribute("data-lexical-text","true"):U(r)&&i.setAttribute("data-lexical-decorator","true"),b(r)){const o=r.__indent,s=r.__size;if(o!==0&&xo(i,o),s!==0){const a=s-1;(function(c,u,d,f){const h=ae;ae="",Jr(c,d,0,u,f,null),So(d,f),ae=h})(Mn(r,ve),a,r,i)}const l=r.__format;l!==0&&bo(i,l),r.isInline()||wo(null,r,i),kn(r)&&(ee+=Pe,Le+=Pe)}else{const o=r.getTextContent();if(U(r)){const s=r.decorate(le,Ke);s!==null&&To(n,s),i.contentEditable="false"}else D(r)&&(r.isDirectionless()||(ae+=o));ee+=o,Le+=o}if(e!==null)if(t!=null)e.insertBefore(i,t);else{const o=e.__lexicalLineBreak;o!=null?e.insertBefore(i,o):e.appendChild(i)}return Ar(Vt,Ut,jn,r,"created"),i}function Jr(n,e,t,r,i,o){const s=ee;ee="";let l=t;for(;l<=r;++l){Fn(n[l],i,o);const a=ve.get(n[l]);a!==null&&D(a)&&(Te===null&&(Te=a.getFormat()),xe===""&&(xe=a.getStyle()))}kn(e)&&(ee+=Pe),i.__lexicalTextContent=ee,ee=s+ee}function Co(n,e){const t=e.get(n);return Zt(t)||U(t)&&t.isInline()}function wo(n,e,t){const r=n!==null&&(n.__size===0||Co(n.__last,nt)),i=e.__size===0||Co(e.__last,ve);if(r){if(!i){const o=t.__lexicalLineBreak;if(o!=null)try{t.removeChild(o)}catch(s){if(typeof s=="object"&&s!=null){const l=`${s.toString()} Parent: ${t.tagName}, child: ${o.tagName}.`;throw new Error(l)}throw s}t.__lexicalLineBreak=null}}else if(i){const o=document.createElement("br");t.__lexicalLineBreak=o,t.appendChild(o)}}function So(n,e){const t=e.__lexicalDirTextContent,r=e.__lexicalDir;if(t!==ae||r!==An){const o=ae==="",s=o?An:(i=ae,Pl.test(i)?"rtl":Ol.test(i)?"ltr":null);if(s!==r){const l=e.classList,a=Ke.theme;let c=r!==null?a[r]:void 0,u=s!==null?a[s]:void 0;if(c!==void 0){if(typeof c=="string"){const d=wn(c);c=a[r]=d}l.remove(...c)}if(s===null||o&&s==="ltr")e.removeAttribute("dir");else{if(u!==void 0){if(typeof u=="string"){const d=wn(u);u=a[s]=d}u!==void 0&&l.add(...u)}e.dir=s}Jt||(n.getWritable().__dir=s)}An=s,e.__lexicalDirTextContent=ae,e.__lexicalDir=s}var i}function Ql(n,e,t){const r=ae;var i;ae="",Te=null,xe="",function(o,s,l){const a=ee,c=o.__size,u=s.__size;if(ee="",c===1&&u===1){const d=o.__first,f=s.__first;if(d===f)Ht(d,l);else{const g=Yr(d),m=Fn(f,null,null);try{l.replaceChild(m,g)}catch(_){if(typeof _=="object"&&_!=null){const x=`${_.toString()} Parent: ${l.tagName}, new child: {tag: ${m.tagName} key: ${f}}, old child: {tag: ${g.tagName}, key: ${d}}.`;throw new Error(x)}throw _}In(d,null)}const h=ve.get(f);D(h)&&(Te===null&&(Te=h.getFormat()),xe===""&&(xe=h.getStyle()))}else{const d=Mn(o,nt),f=Mn(s,ve);if(c===0)u!==0&&Jr(f,s,0,u-1,l,null);else if(u===0){if(c!==0){const h=l.__lexicalLineBreak==null;Vr(d,0,c-1,h?null:l),h&&(l.textContent="")}}else(function(h,g,m,_,x,v){const y=_-1,C=x-1;let T,S,P=(M=v,M.firstChild),k=0,E=0;for(var M;k<=y&&E<=C;){const H=g[k],B=m[E];if(H===B)P=Hr(Ht(B,v)),k++,E++;else{T===void 0&&(T=new Set(g)),S===void 0&&(S=new Set(m));const ce=S.has(H),Ie=T.has(B);if(ce)if(Ie){const Ge=Nn(le,B);Ge===P?P=Hr(Ht(B,v)):(P!=null?v.insertBefore(Ge,P):v.appendChild(Ge),Ht(B,v)),k++,E++}else Fn(B,v,P),E++;else P=Hr(Yr(H)),In(H,v),k++}const Y=ve.get(B);Y!==null&&D(Y)&&(Te===null&&(Te=Y.getFormat()),xe===""&&(xe=Y.getStyle()))}const R=k>y,q=E>C;if(R&&!q){const H=m[C+1];Jr(m,h,E,C,v,H===void 0?null:le.getElementByKey(H))}else q&&!R&&Vr(g,k,y,v)})(s,d,f,c,u,l)}kn(s)&&(ee+=Pe),l.__lexicalTextContent=ee,ee=a+ee}(n,e,t),So(e,t),hi(i=e)&&Te!=null&&Te!==i.__textFormat&&!Jt&&(i.setTextFormat(Te),i.setTextStyle(xe)),function(o){hi(o)&&xe!==""&&xe!==o.__textStyle&&!Jt&&o.setTextStyle(xe)}(e),ae=r}function Mn(n,e){const t=[];let r=n.__first;for(;r!==null;){const i=e.get(r);i===void 0&&j(101),t.push(r),r=i.__next}return t}function Ht(n,e){const t=nt.get(n);let r=ve.get(n);t!==void 0&&r!==void 0||j(61);const i=vo||Kr.has(n)||Wr.has(n),o=Nn(le,n);if(t===r&&!i){if(b(t)){const s=o.__lexicalTextContent;s!==void 0&&(ee+=s,Le+=s);const l=o.__lexicalDirTextContent;l!==void 0&&(ae+=l)}else{const s=t.getTextContent();D(t)&&!t.isDirectionless()&&(ae+=s),Le+=s,ee+=s}return o}if(t!==r&&i&&Ar(Vt,Ut,jn,r,"updated"),r.updateDOM(t,o,Ke)){const s=Fn(n,null,null);return e===null&&j(62),e.replaceChild(s,o),In(n,null),s}if(b(t)&&b(r)){const s=r.__indent;s!==t.__indent&&xo(o,s);const l=r.__format;l!==t.__format&&bo(o,l),i&&(Ql(t,r,o),oe(r)||r.isInline()||wo(t,r,o)),kn(r)&&(ee+=Pe,Le+=Pe)}else{const s=r.getTextContent();if(U(r)){const l=r.decorate(le,Ke);l!==null&&To(n,l)}else D(r)&&!r.isDirectionless()&&(ae+=s);ee+=s,Le+=s}if(!Jt&&oe(r)&&r.__cachedText!==Le){const s=r.getWritable();s.__cachedText=Le,r=s}return o}function To(n,e){let t=le._pendingDecorators;const r=le._decorators;if(t===null){if(r[n]===e)return;t=ro(le)}t[n]=e}function Hr(n){let e=n.nextSibling;return e!==null&&e===le._blockCursorElement&&(e=e.nextSibling),e}function ea(n,e,t,r,i,o){ee="",Le="",ae="",vo=r===gt,An=null,le=t,Ke=t._config,Ut=t._nodes,jn=le._listeners.mutation,Wr=i,Kr=o,nt=n._nodeMap,ve=e._nodeMap,Jt=e._readOnly,Ur=new Map(t._keyToDOMMap);const s=new Map;return Vt=s,Ht("root",null),le=void 0,Ut=void 0,Wr=void 0,Kr=void 0,nt=void 0,ve=void 0,Ke=void 0,Ur=void 0,Vt=void 0,s}function Yr(n){const e=Ur.get(n);return e===void 0&&j(75,n),e}const je=Object.freeze({}),qr=30,Gr=[["keydown",function(n,e){if(Yt=n.timeStamp,Eo=n.key,e.isComposing())return;const{key:t,shiftKey:r,ctrlKey:i,metaKey:o,altKey:s}=n;I(e,cl,n)||t!=null&&(function(l,a,c,u){return fo(l)&&!a&&!u&&!c}(t,i,s,o)?I(e,Di,n):function(l,a,c,u,d){return fo(l)&&!u&&!c&&(a||d)}(t,i,r,s,o)?I(e,ul,n):function(l,a,c,u){return uo(l)&&!a&&!u&&!c}(t,i,s,o)?I(e,Li,n):function(l,a,c,u,d){return uo(l)&&!u&&!c&&(a||d)}(t,i,r,s,o)?I(e,fl,n):function(l,a,c){return function(u){return u==="ArrowUp"}(l)&&!a&&!c}(t,i,o)?I(e,ji,n):function(l,a,c){return function(u){return u==="ArrowDown"}(l)&&!a&&!c}(t,i,o)?I(e,Ai,n):function(l,a){return ho(l)&&a}(t,r)?(qt=!0,I(e,mn,n)):function(l){return l===" "}(t)?I(e,dl,n):function(l,a){return ye&&a&&l.toLowerCase()==="o"}(t,i)?(n.preventDefault(),qt=!0,I(e,dt,!0)):function(l,a){return ho(l)&&!a}(t,r)?(qt=!1,I(e,mn,n)):function(l,a,c,u){return ye?!a&&!c&&(Rt(l)||l.toLowerCase()==="h"&&u):!(u||a||c)&&Rt(l)}(t,s,o,i)?Rt(t)?I(e,Ii,n):(n.preventDefault(),I(e,Ze,!0)):function(l){return l==="Escape"}(t)?I(e,Fi,n):function(l,a,c,u,d){return ye?!(c||u||d)&&(Bt(l)||l.toLowerCase()==="d"&&a):!(a||u||d)&&Bt(l)}(t,i,r,s,o)?Bt(t)?I(e,Mi,n):(n.preventDefault(),I(e,Ze,!1)):function(l,a,c){return Rt(l)&&(ye?a:c)}(t,s,i)?(n.preventDefault(),I(e,Lt,!0)):function(l,a,c){return Bt(l)&&(ye?a:c)}(t,s,i)?(n.preventDefault(),I(e,Lt,!1)):function(l,a){return ye&&a&&Rt(l)}(t,o)?(n.preventDefault(),I(e,jt,!0)):function(l,a){return ye&&a&&Bt(l)}(t,o)?(n.preventDefault(),I(e,jt,!1)):function(l,a,c,u){return l.toLowerCase()==="b"&&!a&&$t(c,u)}(t,s,o,i)?(n.preventDefault(),I(e,fe,"bold")):function(l,a,c,u){return l.toLowerCase()==="u"&&!a&&$t(c,u)}(t,s,o,i)?(n.preventDefault(),I(e,fe,"underline")):function(l,a,c,u){return l.toLowerCase()==="i"&&!a&&$t(c,u)}(t,s,o,i)?(n.preventDefault(),I(e,fe,"italic")):function(l,a,c,u){return l==="Tab"&&!a&&!c&&!u}(t,s,i,o)?I(e,hl,n):function(l,a,c,u){return l.toLowerCase()==="z"&&!a&&$t(c,u)}(t,r,o,i)?(n.preventDefault(),I(e,gn,void 0)):function(l,a,c,u){return ye?l.toLowerCase()==="z"&&c&&a:l.toLowerCase()==="y"&&u||l.toLowerCase()==="z"&&u&&a}(t,r,o,i)?(n.preventDefault(),I(e,pn,void 0)):be(e._editorState._selection)?function(l,a,c,u){return!a&&l.toLowerCase()==="c"&&(ye?c:u)}(t,r,o,i)?(n.preventDefault(),I(e,_n,n)):function(l,a,c,u){return!a&&l.toLowerCase()==="x"&&(ye?c:u)}(t,r,o,i)?(n.preventDefault(),I(e,gr,n)):go(t,o,i)&&(n.preventDefault(),I(e,pr,n)):!Be&&go(t,o,i)&&(n.preventDefault(),I(e,pr,n)),function(l,a,c,u){return l||a||c||u}(i,r,s,o)&&I(e,xl,n))}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;t instanceof Node&&r!=="touch"&&ge(e,()=>{U(tt(t))||(Zr=!0)})}],["compositionstart",function(n,e){ge(e,()=>{const t=F();if(O(t)&&!e.isComposing()){const r=t.anchor,i=t.anchor.getNode();re(r.key),(n.timeStamp<Yt+qr||r.type==="element"||!t.isCollapsed()||i.getFormat()!==t.format||D(i)&&i.getStyle()!==t.style)&&I(e,ht,Nl)}})}],["compositionend",function(n,e){Be?Gt=!0:ge(e,()=>{Qr(e,n.data)})}],["input",function(n,e){n.stopPropagation(),ge(e,()=>{const t=F(),r=n.data,i=Lo(n);if(r!=null&&O(t)&&Po(t,i,r,n.timeStamp,!1)){Gt&&(Qr(e,r),Gt=!1);const o=t.anchor.getNode(),s=Se(e._window);if(s===null)return;const l=t.isBackward(),a=l?t.anchor.offset:t.focus.offset,c=l?t.focus.offset:t.anchor.offset;yn&&!t.isCollapsed()&&D(o)&&s.anchorNode!==null&&o.getTextContent().slice(0,a)+r+o.getTextContent().slice(a+c)===co(s.anchorNode)||I(e,ht,r);const u=r.length;Be&&u>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),mr||vn||_r||!e.isComposing()||(Yt=0,re(null))}else Lr(!1,e,r!==null?r:void 0),Gt&&(Qr(e,r||void 0),Gt=!1);he(),Yi(G())}),yt=null}],["click",function(n,e){ge(e,()=>{const t=F(),r=Se(e._window),i=tn();if(r){if(O(t)){const o=t.anchor,s=o.getNode();o.type==="element"&&o.offset===0&&t.isCollapsed()&&!oe(s)&&Z().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&i!==null&&t.is(i)?(r.removeAllRanges(),t.dirty=!0):n.detail===3&&!t.isCollapsed()&&s!==t.focus.getNode()&&(b(s)?s.select(0):s.getParentOrThrow().select(0))}else if(n.pointerType==="touch"){const o=r.anchorNode;if(o!==null){const s=o.nodeType;(s===Ft||s===ze)&&we(li(i,r,e,n))}}}I(e,Oi,n)})}],["cut",je],["copy",je],["dragstart",je],["dragover",je],["dragend",je],["paste",je],["focus",je],["blur",je],["drop",je]];yn&&Gr.push(["beforeinput",(n,e)=>function(t,r){const i=t.inputType,o=Lo(t);i==="deleteCompositionText"||Be&&mo(r)||i!=="insertCompositionText"&&ge(r,()=>{const s=F();if(i==="deleteContentBackward"){if(s===null){const h=tn();if(!O(h))return;we(h.clone())}if(O(s)){const h=s.anchor.key===s.focus.key;if(l=t.timeStamp,Eo==="MediaLast"&&l<Yt+qr&&r.isComposing()&&h){if(re(null),Yt=0,setTimeout(()=>{ge(r,()=>{re(null)})},qr),O(s)){const g=s.anchor.getNode();g.markDirty(),s.format=g.getFormat(),D(g)||j(142),s.style=g.getStyle()}}else{re(null),t.preventDefault();const g=s.anchor.getNode().getTextContent(),m=s.anchor.offset===0&&s.focus.offset===g.length;wl&&h&&!m||I(r,Ze,!0)}return}}var l;if(!O(s))return;const a=t.data;yt!==null&&Lr(!1,r,yt),s.dirty&&yt===null||!s.isCollapsed()||oe(s.anchor.getNode())||o===null||s.applyDOMRange(o),yt=null;const c=s.anchor,u=s.focus,d=c.getNode(),f=u.getNode();if(i!=="insertText"&&i!=="insertTranspose")switch(t.preventDefault(),i){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":I(r,ht,t);break;case"insertFromComposition":re(null),I(r,ht,t);break;case"insertLineBreak":re(null),I(r,dt,!1);break;case"insertParagraph":re(null),qt&&!vn?(qt=!1,I(r,dt,!1)):I(r,hn,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":I(r,fr,t);break;case"deleteByComposition":(function(h,g){return h!==g||b(h)||b(g)||!h.isToken()||!g.isToken()})(d,f)&&I(r,dr,t);break;case"deleteByDrag":case"deleteByCut":I(r,dr,t);break;case"deleteContent":I(r,Ze,!1);break;case"deleteWordBackward":I(r,Lt,!0);break;case"deleteWordForward":I(r,Lt,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":I(r,jt,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":I(r,jt,!1);break;case"formatStrikeThrough":I(r,fe,"strikethrough");break;case"formatBold":I(r,fe,"bold");break;case"formatItalic":I(r,fe,"italic");break;case"formatUnderline":I(r,fe,"underline");break;case"historyUndo":I(r,gn,void 0);break;case"historyRedo":I(r,pn,void 0)}else{if(a===`
32
+ `)t.preventDefault(),I(r,dt,!1);else if(a===Pe)t.preventDefault(),I(r,hn,void 0);else if(a==null&&t.dataTransfer){const h=t.dataTransfer.getData("text/plain");t.preventDefault(),s.insertRawText(h)}else a!=null&&Po(s,o,a,t.timeStamp,!0)?(t.preventDefault(),I(r,ht,a)):yt=a;ko=t.timeStamp}})}(n,e)]);let Yt=0,Eo=null,ko=0,yt=null;const $n=new WeakMap;let Xr=!1,Zr=!1,qt=!1,Gt=!1,No=[0,"",0,"root",0];function Po(n,e,t,r,i){const o=n.anchor,s=n.focus,l=o.getNode(),a=G(),c=Se(a._window),u=c!==null?c.anchorNode:null,d=o.key,f=a.getElementByKey(d),h=t.length;return d!==s.key||!D(l)||(!i&&(!yn||ko<r+50)||l.isDirty()&&h<2||lo(t))&&o.offset!==s.offset&&!l.isComposing()||De(l)||l.isDirty()&&h>1||(i||!yn)&&f!==null&&!l.isComposing()&&u!==Tn(f)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||l.getFormat()!==n.format||l.getStyle()!==n.style||Ul(n,l)}function Oo(n,e){return n!==null&&n.nodeValue!==null&&n.nodeType===ze&&e!==0&&e!==n.nodeValue.length}function Do(n,e,t){const{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}=n;Xr&&(Xr=!1,Oo(r,i)&&Oo(o,s))||ge(e,()=>{if(!t)return void we(null);if(!Mt(e,r,o))return;const l=F();if(O(l)){const a=l.anchor,c=a.getNode();if(l.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(l.dirty=!0);const u=On(e).event,d=u?u.timeStamp:performance.now(),[f,h,g,m,_]=No,x=Z(),v=e.isComposing()===!1&&x.getTextContent()==="";if(d<_+200&&a.offset===g&&a.key===m)l.format=f,l.style=h;else if(a.type==="text")D(c)||j(141),l.format=c.getFormat(),l.style=c.getStyle();else if(a.type==="element"&&!v){const y=a.getNode();l.style="",y instanceof bt&&y.getChildrenSize()===0?(l.format=y.getTextFormat(),l.style=y.getTextStyle()):l.format=0}}else{const u=a.key,d=l.focus.key,f=l.getNodes(),h=f.length,g=l.isBackward(),m=g?s:i,_=g?i:s,x=g?d:u,v=g?u:d;let y=kl,C=!1;for(let T=0;T<h;T++){const S=f[T],P=S.getTextContentSize();if(D(S)&&P!==0&&!(T===0&&S.__key===x&&m===P||T===h-1&&S.__key===v&&_===0)&&(C=!0,y&=S.getFormat(),y===0))break}l.format=C?y:0}}I(e,dn,void 0)})}function Lo(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function Qr(n,e){const t=n._compositionKey;if(re(null),t!==null&&e!=null){if(e===""){const r=se(t),i=Tn(n.getElementByKey(t));return void(i!==null&&i.nodeValue!==null&&D(r)&&jr(r,i.nodeValue,null,null,!0))}if(e[e.length-1]===`
33
+ `){const r=F();if(O(r)){const i=r.focus;return r.anchor.set(i.key,i.offset,i.type),void I(n,mn,null)}}}Lr(!0,n,e)}function jo(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}const vt=new Map;function Ao(n){const e=n.target,t=Se(e==null?null:e.nodeType===9?e.defaultView:e.ownerDocument.defaultView);if(t===null)return;const r=to(t.anchorNode);if(r===null)return;Zr&&(Zr=!1,ge(r,()=>{const c=tn(),u=t.anchorNode;if(u===null)return;const d=u.nodeType;d!==Ft&&d!==ze||we(li(c,t,r,n))}));const i=Dr(r),o=i[i.length-1],s=o._key,l=vt.get(s),a=l||o;a!==r&&Do(t,a,!1),Do(t,r,!0),r!==o?vt.set(s,r):l&&vt.delete(s)}function Io(n){n._lexicalHandled=!0}function Fo(n){return n._lexicalHandled===!0}function ta(n){const e=n.ownerDocument,t=$n.get(e);t===void 0&&j(162);const r=t-1;r>=0||j(164),$n.set(e,r),r===0&&e.removeEventListener("selectionchange",Ao);const i=Sn(n);Pr(i)?(function(s){if(s._parentEditor!==null){const l=Dr(s),a=l[l.length-1]._key;vt.get(a)===s&&vt.delete(a)}else vt.delete(s._key)}(i),n.__lexicalEditor=null):i&&j(198);const o=jo(n);for(let s=0;s<o.length;s++)o[s]();n.__lexicalEventHandles=[]}function ei(n,e,t){he();const r=n.__key,i=n.getParent();if(i===null)return;const o=function(l){const a=F();if(!O(a)||!b(l))return a;const{anchor:c,focus:u}=a,d=c.getNode(),f=u.getNode();return Ir(d,l)&&c.set(l.__key,0,"element"),Ir(f,l)&&u.set(l.__key,0,"element"),a}(n);let s=!1;if(O(o)&&e){const l=o.anchor,a=o.focus;l.key===r&&(Un(l,n,i,n.getPreviousSibling(),n.getNextSibling()),s=!0),a.key===r&&(Un(a,n,i,n.getPreviousSibling(),n.getNextSibling()),s=!0)}else be(o)&&e&&n.isSelected()&&n.selectPrevious();if(O(o)&&e&&!s){const l=n.getIndexWithinParent();et(n),Kn(o,i,l,-1)}else et(n);t||mt(i)||i.canBeEmpty()||!i.isEmpty()||ei(i,e),e&&oe(i)&&i.isEmpty()&&i.selectEnd()}class Rn{static getType(){j(64,this.name)}static clone(e){j(65,this.name)}afterCloneFrom(e){this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Kl(this,e)}getType(){return this.__type}isInline(){j(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;const t=se(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){const t=e||F();if(t==null)return!1;const r=t.getNodes().some(i=>i.__key===this.__key);if(D(this))return r;if(O(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const i=this.getParent();if(U(this)&&this.isInline()&&i){const o=t.isBackward()?t.focus:t.anchor,s=o.getNode();if(o.offset===s.getChildrenSize()&&s.is(i)&&s.getLastChildOrThrow().is(this))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),r=0;for(;t!==null;){if(this.is(t))return r;r++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return e===null?null:se(e)}getParentOrThrow(){const e=this.getParent();return e===null&&j(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(mt(t))return b(e)||e===this&&U(e)||j(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&j(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return e===null?null:se(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(t===null)return e;let r=t.getFirstChild();for(;r!==null&&!r.is(this);)e.push(r),r=r.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return e===null?null:se(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=this.getParents(),r=e.getParents();b(this)&&t.unshift(this),b(e)&&r.unshift(e);const i=t.length,o=r.length;if(i===0||o===0||t[i-1]!==r[o-1])return null;const s=new Set(r);for(let l=0;l<i;l++){const a=t[l];if(s.has(a))return a}return null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){if(this===e)return!1;if(e.isParentOf(this))return!0;if(this.isParentOf(e))return!1;const t=this.getCommonAncestor(e);let r=0,i=0,o=this;for(;;){const s=o.getParentOrThrow();if(s===t){r=o.getIndexWithinParent();break}o=s}for(o=e;;){const s=o.getParentOrThrow();if(s===t){i=o.getIndexWithinParent();break}o=s}return r<i}isParentOf(e){const t=this.__key;if(t===e.__key)return!1;let r=e;for(;r!==null;){if(r.__key===t)return!0;r=r.getParent()}return!1}getNodesBetween(e){const t=this.isBefore(e),r=[],i=new Set;let o=this;for(;o!==null;){const s=o.__key;if(i.has(s)||(i.add(s),r.push(o)),o===e)break;const l=b(o)?t?o.getFirstChild():o.getLastChild():null;if(l!==null){o=l;continue}const a=t?o.getNextSibling():o.getPreviousSibling();if(a!==null){o=a;continue}const c=o.getParentOrThrow();if(i.has(c.__key)||r.push(c),c===e)break;let u=null,d=c;do{if(d===null&&j(68),u=t?d.getNextSibling():d.getPreviousSibling(),d=d.getParent(),d===null)break;u!==null||i.has(d.__key)||r.push(d)}while(u===null);o=u}return t||r.reverse(),r}isDirty(){const e=G()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){const e=se(this.__key);return e===null&&j(113),e}getWritable(){he();const e=Ae(),t=G(),r=e._nodeMap,i=this.__key,o=this.getLatest(),s=t._cloneNotNeeded,l=F();if(l!==null&&l.setCachedNodes(null),s.has(i))return En(o),o;const a=zr(o);return s.add(i),En(a),r.set(i,a),a}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){j(70)}updateDOM(e,t,r){j(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){j(72)}static importJSON(e){j(18,this.name)}static transform(){return null}remove(e){ei(this,!0,e)}replace(e,t){he();let r=F();r!==null&&(r=r.clone()),Fr(this,e);const i=this.getLatest(),o=this.__key,s=e.__key,l=e.getWritable(),a=this.getParentOrThrow().getWritable(),c=a.__size;et(l);const u=i.getPreviousSibling(),d=i.getNextSibling(),f=i.__prev,h=i.__next,g=i.__parent;if(ei(i,!1,!0),u===null?a.__first=s:u.getWritable().__next=s,l.__prev=f,d===null?a.__last=s:d.getWritable().__prev=s,l.__next=h,l.__parent=g,a.__size=c,t&&(b(this)&&b(l)||j(139),this.getChildren().forEach(m=>{l.append(m)})),O(r)){we(r);const m=r.anchor,_=r.focus;m.key===o&&Wo(m,l),_.key===o&&Wo(_,l)}return We()===o&&re(s),l}insertAfter(e,t=!0){he(),Fr(this,e);const r=this.getWritable(),i=e.getWritable(),o=i.getParent(),s=F();let l=!1,a=!1;if(o!==null){const h=e.getIndexWithinParent();if(et(i),O(s)){const g=o.__key,m=s.anchor,_=s.focus;l=m.type==="element"&&m.key===g&&m.offset===h+1,a=_.type==="element"&&_.key===g&&_.offset===h+1}}const c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),d=i.__key,f=r.__next;if(c===null?u.__last=d:c.getWritable().__prev=d,u.__size++,r.__next=d,i.__next=f,i.__prev=r.__key,i.__parent=r.__parent,t&&O(s)){const h=this.getIndexWithinParent();Kn(s,u,h+1);const g=u.__key;l&&s.anchor.set(g,h+2,"element"),a&&s.focus.set(g,h+2,"element")}return e}insertBefore(e,t=!0){he(),Fr(this,e);const r=this.getWritable(),i=e.getWritable(),o=i.__key;et(i);const s=this.getPreviousSibling(),l=this.getParentOrThrow().getWritable(),a=r.__prev,c=this.getIndexWithinParent();s===null?l.__first=o:s.getWritable().__next=o,l.__size++,r.__prev=o,i.__prev=a,i.__next=r.__key,i.__parent=r.__parent;const u=F();return t&&O(u)&&Kn(u,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return ke()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){he();const r=this.getPreviousSibling(),i=this.getParentOrThrow();if(r===null)return i.select(0,0);if(b(r))return r.select();if(!D(r)){const o=r.getIndexWithinParent()+1;return i.select(o,o)}return r.select(e,t)}selectNext(e,t){he();const r=this.getNextSibling(),i=this.getParentOrThrow();if(r===null)return i.select();if(b(r))return r.select(0,0);if(!D(r)){const o=r.getIndexWithinParent();return i.select(o,o)}return r.select(e,t)}markDirty(){this.getWritable()}}class Xt extends Rn{static getType(){return"linebreak"}static clone(e){return new Xt(e.__key)}constructor(e){super(e)}getTextContent(){return`
34
+ `}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(t){const r=t.parentElement;if(r!==null&&Ln(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&Bn(i)){const o=r.lastChild;if(o===t||o.previousSibling===t&&Bn(o))return!0}}return!1}(e)||function(t){const r=t.parentElement;if(r!==null&&Ln(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&Bn(i))return!1;const o=r.lastChild;if(o===t||o.previousSibling===t&&Bn(o))return!0}return!1}(e)?null:{conversion:na,priority:0}}}static importJSON(e){return it()}exportJSON(){return{type:"linebreak",version:1}}}function na(n){return{node:it()}}function it(){return Kt(new Xt)}function Zt(n){return n instanceof Xt}function Bn(n){return n.nodeType===ze&&/^( |\t|\r?\n)+$/.test(n.textContent||"")}function ti(n,e){return 16&e?"code":e&yr?"mark":32&e?"sub":64&e?"sup":null}function ni(n,e){return 1&e?"strong":2&e?"em":"span"}function Mo(n,e,t,r,i){const o=r.classList;let s=zt(i,"base");s!==void 0&&o.add(...s),s=zt(i,"underlineStrikethrough");let l=!1;const a=e&bn&&e&xn;s!==void 0&&(t&bn&&t&xn?(l=!0,a||o.add(...s)):a&&o.remove(...s));for(const c in Oe){const u=Oe[c];if(s=zt(i,c),s!==void 0)if(t&u){if(l&&(c==="underline"||c==="strikethrough")){e&u&&o.remove(...s);continue}e&u&&(!a||c!=="underline")&&c!=="strikethrough"||o.add(...s)}else e&u&&o.remove(...s)}}function $o(n,e,t){const r=e.firstChild,i=t.isComposing(),o=n+(i?Cn:"");if(r==null)e.textContent=o;else{const s=r.nodeValue;if(s!==o)if(i||Be){const[l,a,c]=function(u,d){const f=u.length,h=d.length;let g=0,m=0;for(;g<f&&g<h&&u[g]===d[g];)g++;for(;m+g<f&&m+g<h&&u[f-m-1]===d[h-m-1];)m++;return[g,f-g-m,d.slice(g,h-m)]}(s,o);a!==0&&r.deleteData(l,a),r.insertData(l,c)}else r.nodeValue=o}}function Ro(n,e,t,r,i,o){$o(i,n,e);const s=o.theme.text;s!==void 0&&Mo(0,0,r,n,s)}function zn(n,e){const t=document.createElement(e);return t.appendChild(n),t}class xt extends Rn{static getType(){return"text"}static clone(e){return new xt(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e,t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return Al[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===We()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=Oe[e];return!!(this.getFormat()&t)}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return Or(this.getLatest().__format,e,t)}canHaveFormat(){return!0}createDOM(e,t){const r=this.__format,i=ti(0,r),o=ni(0,r),s=i===null?o:i,l=document.createElement(s);let a=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),i!==null&&(a=document.createElement(o),l.appendChild(a)),Ro(a,this,0,r,this.__text,e);const c=this.__style;return c!==""&&(l.style.cssText=c),l}updateDOM(e,t,r){const i=this.__text,o=e.__format,s=this.__format,l=ti(0,o),a=ti(0,s),c=ni(0,o),u=ni(0,s);if((l===null?c:l)!==(a===null?u:a))return!0;if(l===a&&c!==u){const m=t.firstChild;m==null&&j(48);const _=document.createElement(u);return Ro(_,this,0,s,i,r),t.replaceChild(_,m),!1}let d=t;a!==null&&l!==null&&(d=t.firstChild,d==null&&j(49)),$o(i,d,this);const f=r.theme.text;f!==void 0&&o!==s&&Mo(0,o,s,d,f);const h=e.__style,g=this.__style;return h!==g&&(t.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:sa,priority:0}),b:()=>({conversion:ia,priority:0}),code:()=>({conversion:Ue,priority:0}),em:()=>({conversion:Ue,priority:0}),i:()=>({conversion:Ue,priority:0}),s:()=>({conversion:Ue,priority:0}),span:()=>({conversion:ra,priority:0}),strong:()=>({conversion:Ue,priority:0}),sub:()=>({conversion:Ue,priority:0}),sup:()=>({conversion:Ue,priority:0}),u:()=>({conversion:Ue,priority:0})}}static importJSON(e){const t=ie(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){let{element:t}=super.exportDOM(e);return t!==null&&Dn(t)||j(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=zn(t,"b")),this.hasFormat("italic")&&(t=zn(t,"i")),this.hasFormat("strikethrough")&&(t=zn(t,"s")),this.hasFormat("underline")&&(t=zn(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format=typeof e=="string"?Oe[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail=typeof e=="string"?Dl[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=Or(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=jl[e];if(this.__mode===t)return this;const r=this.getWritable();return r.__mode=t,r}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){he();let r=e,i=t;const o=F(),s=this.getTextContent(),l=this.__key;if(typeof s=="string"){const a=s.length;r===void 0&&(r=a),i===void 0&&(i=a)}else r=0,i=0;if(!O(o))return qo(l,r,l,i,"text","text");{const a=We();a!==o.anchor.key&&a!==o.focus.key||re(l),o.setTextNodeRange(this,r,this,i)}return o}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,r,i){const o=this.getWritable(),s=o.__text,l=r.length;let a=e;a<0&&(a=l+a,a<0&&(a=0));const c=F();if(i&&O(c)){const d=e+l;c.setTextNodeRange(o,d,o,d)}const u=s.slice(0,a)+r+s.slice(a+t);return o.__text=u,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){he();const t=this.getLatest(),r=t.getTextContent(),i=t.__key,o=We(),s=new Set(e),l=[],a=r.length;let c="";for(let T=0;T<a;T++)c!==""&&s.has(T)&&(l.push(c),c=""),c+=r[T];c!==""&&l.push(c);const u=l.length;if(u===0)return[];if(l[0]===r)return[t];const d=l[0],f=t.getParent();let h;const g=t.getFormat(),m=t.getStyle(),_=t.__detail;let x=!1;t.isSegmented()?(h=ie(d),h.__format=g,h.__style=m,h.__detail=_,x=!0):(h=t.getWritable(),h.__text=d);const v=F(),y=[h];let C=d.length;for(let T=1;T<u;T++){const S=l[T],P=S.length,k=ie(S).getWritable();k.__format=g,k.__style=m,k.__detail=_;const E=k.__key,M=C+P;if(O(v)){const R=v.anchor,q=v.focus;R.key===i&&R.type==="text"&&R.offset>C&&R.offset<=M&&(R.key=E,R.offset-=C,v.dirty=!0),q.key===i&&q.type==="text"&&q.offset>C&&q.offset<=M&&(q.key=E,q.offset-=C,v.dirty=!0)}o===i&&re(E),C=M,y.push(k)}if(f!==null){(function(P){const k=P.getPreviousSibling(),E=P.getNextSibling();k!==null&&En(k),E!==null&&En(E)})(this);const T=f.getWritable(),S=this.getIndexWithinParent();x?(T.splice(S,0,y),this.remove()):T.splice(S,1,y),O(v)&&Kn(v,f,S,u-1)}return y}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||j(50);const r=this.__key,i=e.__key,o=this.__text,s=o.length;We()===i&&re(r);const l=F();if(O(l)){const d=l.anchor,f=l.focus;d!==null&&d.key===i&&(Zo(d,t,r,e,s),l.dirty=!0),f!==null&&f.key===i&&(Zo(f,t,r,e,s),l.dirty=!0)}const a=e.__text,c=t?a+o:o+a;this.setTextContent(c);const u=this.getWritable();return e.remove(),u}isTextEntity(){return!1}}function ra(n){return{forChild:ri(n.style),node:null}}function ia(n){const e=n,t=e.style.fontWeight==="normal";return{forChild:ri(e.style,t?void 0:"bold"),node:null}}const Bo=new WeakMap;function oa(n){return n.nodeName==="PRE"||n.nodeType===Ft&&n.style!==void 0&&n.style.whiteSpace!==void 0&&n.style.whiteSpace.startsWith("pre")}function sa(n){const e=n;n.parentElement===null&&j(129);let t=e.textContent||"";if(function(r){let i,o=r.parentNode;const s=[r];for(;o!==null&&(i=Bo.get(o))===void 0&&!oa(o);)s.push(o),o=o.parentNode;const l=i===void 0?o:i;for(let a=0;a<s.length;a++)Bo.set(s[a],l);return l}(e)!==null){const r=t.split(/(\r?\n|\t)/),i=[],o=r.length;for(let s=0;s<o;s++){const l=r[s];l===`
35
35
  `||l===`\r
36
- `?i.push(rt()):l===" "?i.push(en()):l!==""&&i.push(ie(l))}return{node:i}}if(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," "),t==="")return{node:null};if(t[0]===" "){let r=e,i=!0;for(;r!==null&&(r=Bo(r,!1))!==null;){const o=r.textContent||"";if(o.length>0){/[ \t\n]$/.test(o)&&(t=t.slice(1)),i=!1;break}}i&&(t=t.slice(1))}if(t[t.length-1]===" "){let r=e,i=!0;for(;r!==null&&(r=Bo(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){i=!1;break}i&&(t=t.slice(0,t.length-1))}return t===""?{node:null}:{node:ie(t)}}function Bo(n,e){let t=n;for(;;){let r;for(;(r=e?t.nextSibling:t.previousSibling)===null;){const o=t.parentElement;if(o===null)return null;t=o}if(t=r,t.nodeType===Ft){const o=t.style.display;if(o===""&&!Rr(t)||o!==""&&!o.startsWith("inline"))return null}let i=t;for(;(i=e?t.firstChild:t.lastChild)!==null;)t=i;if(t.nodeType===Be)return t;if(t.nodeName==="BR")return null}}const la={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Ue(n){const e=la[n.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:ri(n.style,e),node:null}}function ie(n=""){return Kt(new vt(n))}function D(n){return n instanceof vt}function ri(n,e){const t=n.fontWeight,r=n.textDecoration.split(" "),i=t==="700"||t==="bold",o=r.includes("line-through"),s=n.fontStyle==="italic",l=r.includes("underline"),a=n.verticalAlign;return c=>(D(c)&&(i&&!c.hasFormat("bold")&&c.toggleFormat("bold"),o&&!c.hasFormat("strikethrough")&&c.toggleFormat("strikethrough"),s&&!c.hasFormat("italic")&&c.toggleFormat("italic"),l&&!c.hasFormat("underline")&&c.toggleFormat("underline"),a!=="sub"||c.hasFormat("subscript")||c.toggleFormat("subscript"),a!=="super"||c.hasFormat("superscript")||c.toggleFormat("superscript"),e&&!c.hasFormat(e)&&c.toggleFormat(e)),c)}class Qt extends vt{static getType(){return"tab"}static clone(e){return new Qt(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}static importJSON(e){const t=en();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){j(126)}setDetail(e){j(127)}setMode(e){j(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function en(){return Kt(new Qt)}function aa(n){return n instanceof Qt}class ca{constructor(e,t,r){this._selection=null,this.key=e,this.offset=t,this.type=r}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),r=e.getNode();const i=this.offset,o=e.offset;if(b(t)){const s=t.getDescendantByIndex(i);t=s??t}if(b(r)){const s=r.getDescendantByIndex(o);r=s??r}return t===r?i<o:t.isBefore(r)}getNode(){const e=se(this.key);return e===null&&j(20),e}set(e,t,r){const i=this._selection,o=this.key;this.key=e,this.offset=t,this.type=r,nn()||(ze()===o&&re(e),i!==null&&(i.setCachedNodes(null),i.dirty=!0))}}function Ee(n,e,t){return new ca(n,e,t)}function ii(n,e){let t=e.__key,r=n.offset,i="element";if(D(e)){i="text";const o=e.getTextContentSize();r>o&&(r=o)}else if(!b(e)){const o=e.getNextSibling();if(D(o))t=o.__key,r=0,i="text";else{const s=e.getParent();s&&(t=s.__key,r=e.getIndexWithinParent()+1)}}n.set(t,r,i)}function zo(n,e){if(b(e)){const t=e.getLastDescendant();b(t)||D(t)?ii(n,t):ii(n,e)}else ii(n,e)}function Ve(n,e,t,r){n.key=e,n.offset=t,n.type=r}class zn{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!be(e))return!1;const t=this._nodes,r=e._nodes;return t.size===r.size&&Array.from(t).every(i=>r.has(i))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new zn(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),r=t.length,i=t[r-1];let o;if(D(i))o=i.select();else{const s=i.getIndexWithinParent()+1;o=i.getParentOrThrow().select(s,s)}o.insertNodes(e);for(let s=0;s<r;s++)t[s].remove()}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this._nodes,r=[];for(const i of t){const o=se(i);o!==null&&r.push(o)}return nn()||(this._cachedNodes=r),r}getTextContent(){const e=this.getNodes();let t="";for(let r=0;r<e.length;r++)t+=e[r].getTextContent();return t}}function O(n){return n instanceof Je}class Je{constructor(e,t,r,i){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=r,this.style=i,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!O(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this.anchor,r=this.focus,i=t.isBefore(r),o=i?t:r,s=i?r:t;let l=o.getNode(),a=s.getNode();const c=o.offset,u=s.offset;if(b(l)){const f=l.getDescendantByIndex(c);l=f??l}if(b(a)){let f=a.getDescendantByIndex(u);f!==null&&f!==l&&a.getChildAtIndex(u)===f&&(f=f.getPreviousSibling()),a=f??a}let d;return d=l.is(a)?b(l)&&l.getChildrenSize()>0?[]:[l]:l.getNodesBetween(a),nn()||(this._cachedNodes=d),d}setTextNodeRange(e,t,r,i){Ve(this.anchor,e.__key,t,"text"),Ve(this.focus,r.__key,i,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const e=this.getNodes();if(e.length===0)return"";const t=e[0],r=e[e.length-1],i=this.anchor,o=this.focus,s=i.isBefore(o),[l,a]=oi(this);let c="",u=!0;for(let d=0;d<e.length;d++){const f=e[d];if(b(f)&&!f.isInline())u||(c+=`
36
+ `?i.push(it()):l===" "?i.push(en()):l!==""&&i.push(ie(l))}return{node:i}}if(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," "),t==="")return{node:null};if(t[0]===" "){let r=e,i=!0;for(;r!==null&&(r=zo(r,!1))!==null;){const o=r.textContent||"";if(o.length>0){/[ \t\n]$/.test(o)&&(t=t.slice(1)),i=!1;break}}i&&(t=t.slice(1))}if(t[t.length-1]===" "){let r=e,i=!0;for(;r!==null&&(r=zo(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){i=!1;break}i&&(t=t.slice(0,t.length-1))}return t===""?{node:null}:{node:ie(t)}}function zo(n,e){let t=n;for(;;){let r;for(;(r=e?t.nextSibling:t.previousSibling)===null;){const o=t.parentElement;if(o===null)return null;t=o}if(t=r,t.nodeType===Ft){const o=t.style.display;if(o===""&&!Rr(t)||o!==""&&!o.startsWith("inline"))return null}let i=t;for(;(i=e?t.firstChild:t.lastChild)!==null;)t=i;if(t.nodeType===ze)return t;if(t.nodeName==="BR")return null}}const la={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Ue(n){const e=la[n.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:ri(n.style,e),node:null}}function ie(n=""){return Kt(new xt(n))}function D(n){return n instanceof xt}function ri(n,e){const t=n.fontWeight,r=n.textDecoration.split(" "),i=t==="700"||t==="bold",o=r.includes("line-through"),s=n.fontStyle==="italic",l=r.includes("underline"),a=n.verticalAlign;return c=>(D(c)&&(i&&!c.hasFormat("bold")&&c.toggleFormat("bold"),o&&!c.hasFormat("strikethrough")&&c.toggleFormat("strikethrough"),s&&!c.hasFormat("italic")&&c.toggleFormat("italic"),l&&!c.hasFormat("underline")&&c.toggleFormat("underline"),a!=="sub"||c.hasFormat("subscript")||c.toggleFormat("subscript"),a!=="super"||c.hasFormat("superscript")||c.toggleFormat("superscript"),e&&!c.hasFormat(e)&&c.toggleFormat(e)),c)}class Qt extends xt{static getType(){return"tab"}static clone(e){return new Qt(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}static importJSON(e){const t=en();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){j(126)}setDetail(e){j(127)}setMode(e){j(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function en(){return Kt(new Qt)}function aa(n){return n instanceof Qt}class ca{constructor(e,t,r){this._selection=null,this.key=e,this.offset=t,this.type=r}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),r=e.getNode();const i=this.offset,o=e.offset;if(b(t)){const s=t.getDescendantByIndex(i);t=s??t}if(b(r)){const s=r.getDescendantByIndex(o);r=s??r}return t===r?i<o:t.isBefore(r)}getNode(){const e=se(this.key);return e===null&&j(20),e}set(e,t,r){const i=this._selection,o=this.key;this.key=e,this.offset=t,this.type=r,nn()||(We()===o&&re(e),i!==null&&(i.setCachedNodes(null),i.dirty=!0))}}function Ee(n,e,t){return new ca(n,e,t)}function ii(n,e){let t=e.__key,r=n.offset,i="element";if(D(e)){i="text";const o=e.getTextContentSize();r>o&&(r=o)}else if(!b(e)){const o=e.getNextSibling();if(D(o))t=o.__key,r=0,i="text";else{const s=e.getParent();s&&(t=s.__key,r=e.getIndexWithinParent()+1)}}n.set(t,r,i)}function Wo(n,e){if(b(e)){const t=e.getLastDescendant();b(t)||D(t)?ii(n,t):ii(n,e)}else ii(n,e)}function Ve(n,e,t,r){n.key=e,n.offset=t,n.type=r}class Wn{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!be(e))return!1;const t=this._nodes,r=e._nodes;return t.size===r.size&&Array.from(t).every(i=>r.has(i))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new Wn(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),r=t.length,i=t[r-1];let o;if(D(i))o=i.select();else{const s=i.getIndexWithinParent()+1;o=i.getParentOrThrow().select(s,s)}o.insertNodes(e);for(let s=0;s<r;s++)t[s].remove()}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this._nodes,r=[];for(const i of t){const o=se(i);o!==null&&r.push(o)}return nn()||(this._cachedNodes=r),r}getTextContent(){const e=this.getNodes();let t="";for(let r=0;r<e.length;r++)t+=e[r].getTextContent();return t}}function O(n){return n instanceof Je}class Je{constructor(e,t,r,i){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=r,this.style=i,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!O(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this.anchor,r=this.focus,i=t.isBefore(r),o=i?t:r,s=i?r:t;let l=o.getNode(),a=s.getNode();const c=o.offset,u=s.offset;if(b(l)){const f=l.getDescendantByIndex(c);l=f??l}if(b(a)){let f=a.getDescendantByIndex(u);f!==null&&f!==l&&a.getChildAtIndex(u)===f&&(f=f.getPreviousSibling()),a=f??a}let d;return d=l.is(a)?b(l)&&l.getChildrenSize()>0?[]:[l]:l.getNodesBetween(a),nn()||(this._cachedNodes=d),d}setTextNodeRange(e,t,r,i){Ve(this.anchor,e.__key,t,"text"),Ve(this.focus,r.__key,i,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const e=this.getNodes();if(e.length===0)return"";const t=e[0],r=e[e.length-1],i=this.anchor,o=this.focus,s=i.isBefore(o),[l,a]=oi(this);let c="",u=!0;for(let d=0;d<e.length;d++){const f=e[d];if(b(f)&&!f.isInline())u||(c+=`
37
37
  `),u=!f.isEmpty();else if(u=!1,D(f)){let h=f.getTextContent();f===t?f===r?i.type==="element"&&o.type==="element"&&o.offset!==i.offset||(h=l<a?h.slice(l,a):h.slice(a,l)):h=s?h.slice(l):h.slice(a):f===r&&(h=s?h.slice(0,a):h.slice(0,l)),c+=h}else!U(f)&&!Zt(f)||f===r&&this.isCollapsed()||(c+=f.getTextContent())}return c}applyDOMRange(e){const t=G(),r=t.getEditorState()._selection,i=Yo(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,r);if(i===null)return;const[o,s]=i;Ve(this.anchor,o.key,o.offset,o.type),Ve(this.focus,s.key,s.offset,s.type),this._cachedNodes=null}clone(){const e=this.anchor,t=this.focus;return new Je(Ee(e.key,e.offset,e.type),Ee(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=Or(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=Oe[e];return!!(this.format&t)}insertRawText(e){const t=e.split(/(\r?\n|\t)/),r=[],i=t.length;for(let o=0;o<i;o++){const s=t[o];s===`
38
38
  `||s===`\r
39
- `?r.push(rt()):s===" "?r.push(en()):r.push(ie(s))}this.insertNodes(r)}insertText(e){const t=this.anchor,r=this.focus,i=this.format,o=this.style;let s=t,l=r;!this.isCollapsed()&&r.isBefore(t)&&(s=r,l=t),s.type==="element"&&function(_,x,v,y){const C=_.getNode(),T=C.getChildAtIndex(_.offset),S=ie(),P=oe(C)?ke().append(S):S;S.setFormat(v),S.setStyle(y),T===null?C.append(P):T.insertBefore(P),_.is(x)&&x.set(S.__key,0,"text"),_.set(S.__key,0,"text")}(s,l,i,o);const a=s.offset;let c=l.offset;const u=this.getNodes(),d=u.length;let f=u[0];D(f)||j(26);const h=f.getTextContent().length,g=f.getParentOrThrow();let m=u[d-1];if(d===1&&l.type==="element"&&(c=h,l.set(s.key,c,"text")),this.isCollapsed()&&a===h&&(f.isSegmented()||f.isToken()||!f.canInsertTextAfter()||!g.canInsertTextAfter()&&f.getNextSibling()===null)){let _=f.getNextSibling();if(D(_)&&_.canInsertTextBefore()&&!De(_)||(_=ie(),_.setFormat(i),_.setStyle(o),g.canInsertTextAfter()?f.insertAfter(_):g.insertAfter(_)),_.select(0,0),f=_,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&a===0&&(f.isSegmented()||f.isToken()||!f.canInsertTextBefore()||!g.canInsertTextBefore()&&f.getPreviousSibling()===null)){let _=f.getPreviousSibling();if(D(_)&&!De(_)||(_=ie(),_.setFormat(i),g.canInsertTextBefore()?f.insertBefore(_):g.insertBefore(_)),_.select(),f=_,e!=="")return void this.insertText(e)}else if(f.isSegmented()&&a!==h){const _=ie(f.getTextContent());_.setFormat(i),f.replace(_),f=_}else if(!this.isCollapsed()&&e!==""){const _=m.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||b(_)&&(!_.canInsertTextBefore()||!_.canInsertTextAfter()))return this.insertText(""),Ho(this.anchor,this.focus,null),void this.insertText(e)}if(d===1){if(f.isToken()){const y=ie(e);return y.select(),void f.replace(y)}const _=f.getFormat(),x=f.getStyle();if(a!==c||_===i&&x===o){if(aa(f)){const y=ie(e);return y.setFormat(i),y.setStyle(o),y.select(),void f.replace(y)}}else{if(f.getTextContent()!==""){const y=ie(e);if(y.setFormat(i),y.setStyle(o),y.select(),a===0)f.insertBefore(y,!1);else{const[C]=f.splitText(a);C.insertAfter(y,!1)}return void(y.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}f.setFormat(i),f.setStyle(o)}const v=c-a;f=f.spliceText(a,v,e,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(f.isComposing()?this.anchor.offset-=e.length:(this.format=_,this.style=x))}else{const _=new Set([...f.getParentKeys(),...m.getParentKeys()]),x=b(f)?f:f.getParentOrThrow();let v=b(m)?m:m.getParentOrThrow(),y=m;if(!x.is(v)&&v.isInline())do y=v,v=v.getParentOrThrow();while(v.isInline());if(l.type==="text"&&(c!==0||m.getTextContent()==="")||l.type==="element"&&m.getIndexWithinParent()<c)if(D(m)&&!m.isToken()&&c!==m.getTextContentSize()){if(m.isSegmented()){const k=ie(m.getTextContent());m.replace(k),m=k}oe(l.getNode())||l.type!=="text"||(m=m.spliceText(0,c,"")),_.add(m.__key)}else{const k=m.getParentOrThrow();k.canBeEmpty()||k.getChildrenSize()!==1?m.remove():k.remove()}else _.add(m.__key);const C=v.getChildren(),T=new Set(u),S=x.is(v),P=x.isInline()&&f.getNextSibling()===null?x:f;for(let k=C.length-1;k>=0;k--){const E=C[k];if(E.is(f)||b(E)&&E.isParentOf(f))break;E.isAttached()&&(!T.has(E)||E.is(y)?S||P.insertAfter(E,!1):E.remove())}if(!S){let k=v,E=null;for(;k!==null;){const M=k.getChildren(),R=M.length;(R===0||M[R-1].is(E))&&(_.delete(k.__key),E=k),k=k.getParent()}}if(f.isToken())if(a===h)f.select();else{const k=ie(e);k.select(),f.replace(k)}else f=f.spliceText(a,h-a,e,!0),f.getTextContent()===""?f.remove():f.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);for(let k=1;k<d;k++){const E=u[k],M=E.__key;_.has(M)||E.remove()}}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed())return this.toggleFormat(e),void re(null);const t=this.getNodes(),r=[];for(const v of t)D(v)&&r.push(v);const i=r.length;if(i===0)return this.toggleFormat(e),void re(null);const o=this.anchor,s=this.focus,l=this.isBackward(),a=l?s:o,c=l?o:s;let u=0,d=r[0],f=a.type==="element"?0:a.offset;if(a.type==="text"&&f===d.getTextContentSize()&&(u=1,d=r[1],f=0),d==null)return;const h=d.getFormatFlags(e,null),g=i-1;let m=r[g];const _=c.type==="text"?c.offset:m.getTextContentSize();if(d.is(m)){if(f===_)return;if(De(d)||f===0&&_===d.getTextContentSize())d.setFormat(h);else{const v=d.splitText(f,_),y=f===0?v[0]:v[1];y.setFormat(h),a.type==="text"&&a.set(y.__key,0,"text"),c.type==="text"&&c.set(y.__key,_-f,"text")}return void(this.format=h)}f===0||De(d)||([,d]=d.splitText(f),f=0),d.setFormat(h);const x=m.getFormatFlags(e,h);_>0&&(_===m.getTextContentSize()||De(m)||([m]=m.splitText(_)),m.setFormat(x));for(let v=u+1;v<g;v++){const y=r[v],C=y.getFormatFlags(e,x);y.setFormat(C)}a.type==="text"&&a.set(d.__key,f,"text"),c.type==="text"&&c.set(m.__key,_,"text"),this.format=h|x}insertNodes(e){if(e.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const h=F();return O(h)||j(134),h.insertNodes(e)}const t=Wr((this.isBackward()?this.focus:this.anchor).getNode(),mt),r=e[e.length-1];if("__language"in t&&b(t)){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const h=ai(this);t.splice(h,0,e),r.selectEnd()}return}if(!e.some(h=>(b(h)||U(h))&&!h.isInline())){b(t)||j(135);const h=ai(this);return t.splice(h,0,e),void r.selectEnd()}const i=function(h){const g=ke();let m=null;for(let _=0;_<h.length;_++){const x=h[_],v=Zt(x);if(v||U(x)&&x.isInline()||b(x)&&x.isInline()||D(x)||x.isParentRequired()){if(m===null&&(m=x.createParentElementNode(),g.append(m),v))continue;m!==null&&m.append(x)}else g.append(x),m=null}return g}(e),o=i.getLastDescendant(),s=i.getChildren(),l=!b(t)||!t.isEmpty()?this.insertParagraph():null,a=s[s.length-1];let c=s[0];var u;b(u=c)&&mt(u)&&!u.isEmpty()&&b(t)&&(!t.isEmpty()||t.canMergeWhenEmpty())&&(b(t)||j(135),t.append(...c.getChildren()),c=s[1]),c&&function(h,g,m){const _=g.getParentOrThrow().getLastChild();let x=g;const v=[g];for(;x!==_;)x.getNextSibling()||j(140),x=x.getNextSibling(),v.push(x);let y=h;for(const C of v)y=y.insertAfter(C)}(t,c);const d=Wr(o,mt);l&&b(d)&&(l.canMergeWhenEmpty()||mt(a))&&(d.append(...l.getChildren()),l.remove()),b(t)&&t.isEmpty()&&t.remove(),o.selectEnd();const f=b(t)?t.getLastChild():null;Zt(f)&&d!==t&&f.remove()}insertParagraph(){if(this.anchor.key==="root"){const s=ke();return Z().splice(this.anchor.offset,0,[s]),s.select(),s}const e=ai(this),t=Wr(this.anchor.getNode(),mt);b(t)||j(136);const r=t.getChildAtIndex(e),i=r?[r,...r.getNextSiblings()]:[],o=t.insertNewAfter(this,!1);return o?(o.append(...i),o.selectStart(),o):null}insertLineBreak(e){const t=rt();if(this.insertNodes([t]),e){const r=t.getParentOrThrow(),i=t.getIndexWithinParent();r.select(i,i)}}extract(){const e=this.getNodes(),t=e.length,r=t-1,i=this.anchor,o=this.focus;let s=e[0],l=e[r];const[a,c]=oi(this);if(t===0)return[];if(t===1){if(D(s)&&!this.isCollapsed()){const d=a>c?c:a,f=a>c?a:c,h=s.splitText(d,f),g=d===0?h[0]:h[1];return g!=null?[g]:[]}return[s]}const u=i.isBefore(o);if(D(s)){const d=u?a:c;d===s.getTextContentSize()?e.shift():d!==0&&([,s]=s.splitText(d),e[0]=s)}if(D(l)){const d=l.getTextContent().length,f=u?c:a;f===0?e.pop():f!==d&&([l]=l.splitText(f),e[r]=l)}return e}modify(e,t,r){const i=this.focus,o=this.anchor,s=e==="move",l=zt(i,t);if(U(l)&&!l.isIsolated()){if(s&&l.isKeyboardSelectable()){const h=Go();return h.add(l.__key),void we(h)}const f=t?l.getPreviousSibling():l.getNextSibling();if(D(f)){const h=f.__key,g=t?f.getTextContent().length:0;return i.set(h,g,"text"),void(s&&o.set(h,g,"text"))}{const h=l.getParentOrThrow();let g,m;return b(f)?(m=f.__key,g=t?f.getChildrenSize():0):(g=l.getIndexWithinParent(),m=h.__key,t||g++),i.set(m,g,"element"),void(s&&o.set(m,g,"element"))}}const a=G(),c=Se(a._window);if(!c)return;const u=a._blockCursorElement,d=a._rootElement;if(d===null||u===null||!b(l)||l.isInline()||l.canBeEmpty()||$r(u,a,d),function(f,h,g,m){f.modify(h,g,m)}(c,e,t?"backward":"forward",r),c.rangeCount>0){const f=c.getRangeAt(0),h=this.anchor.getNode(),g=oe(h)?h:Jl(h);if(this.applyDOMRange(f),this.dirty=!0,!s){const m=this.getNodes(),_=[];let x=!1;for(let v=0;v<m.length;v++){const y=m[v];Ir(y,g)?_.push(y):x=!0}if(x&&_.length>0)if(t){const v=_[0];b(v)?v.selectStart():v.getParentOrThrow().selectStart()}else{const v=_[_.length-1];b(v)?v.selectEnd():v.getParentOrThrow().selectEnd()}c.anchorNode===f.startContainer&&c.anchorOffset===f.startOffset||function(v){const y=v.focus,C=v.anchor,T=C.key,S=C.offset,P=C.type;Ve(C,y.key,y.offset,y.type),Ve(y,T,S,P),v._cachedNodes=null}(this)}}}forwardDeletion(e,t,r){if(!r&&(e.type==="element"&&b(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){const i=t.getParent(),o=t.getNextSibling()||(i===null?null:i.getNextSibling());if(b(o)&&o.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let i=r.getNode();if(this.forwardDeletion(r,i,e))return;const o=this.focus,s=zt(o,e);if(U(s)&&!s.isIsolated()){if(s.isKeyboardSelectable()&&b(i)&&i.getChildrenSize()===0){i.remove();const l=Go();l.add(s.__key),we(l)}else s.remove(),G().dispatchCommand(dn,void 0);return}if(!e&&b(s)&&b(i)&&i.isEmpty())return i.remove(),void s.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&r.offset===0&&(r.type==="element"?r.getNode():r.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const l=o.type==="text"?o.getNode():null;if(i=r.type==="text"?r.getNode():null,l!==null&&l.isSegmented()){const a=o.offset,c=l.getTextContentSize();if(l.is(i)||e&&a!==c||!e&&a!==0)return void Uo(l,e,a)}else if(i!==null&&i.isSegmented()){const a=r.offset,c=i.getTextContentSize();if(i.is(l)||e&&a!==0||!e&&a!==c)return void Uo(i,e,a)}(function(a,c){const u=a.anchor,d=a.focus,f=u.getNode(),h=d.getNode();if(f===h&&u.type==="text"&&d.type==="text"){const g=u.offset,m=d.offset,_=g<m,x=_?g:m,v=_?m:g,y=v-1;x!==y&&(lo(f.getTextContent().slice(x,v))||(c?d.offset=y:u.offset=y))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&oe(r.getParent())&&r.getIndexWithinParent()===0&&r.collapseAtStart(this)}}deleteLine(e){if(this.isCollapsed()){const t=this.anchor.type==="element";if(t&&this.insertText(" "),this.modify("extend",e,"lineboundary"),(e?this.focus:this.anchor).offset===0&&this.modify("extend",e,"character"),t){const r=e?this.anchor:this.focus;r.set(r.key,r.offset+1,r.type)}}this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,r=t.getNode();if(this.forwardDeletion(t,r,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function be(n){return n instanceof zn}function Ko(n){const e=n.offset;if(n.type==="text")return e;const t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function oi(n){const e=n.getStartEndPoints();if(e===null)return[0,0];const[t,r]=e;return t.type==="element"&&r.type==="element"&&t.key===r.key&&t.offset===r.offset?[0,0]:[Ko(t),Ko(r)]}function Uo(n,e,t){const r=n,i=r.getTextContent().split(/(?=\s)/g),o=i.length;let s=0,l=0;for(let c=0;c<o;c++){const u=c===o-1;if(l=s,s+=i[c].length,e&&s===t||s>t||u){i.splice(c,1),u&&(l=void 0);break}}const a=i.join("").trim();a===""?r.remove():(r.setTextContent(a),r.select(l,l))}function Vo(n,e,t,r){let i,o=e;if(n.nodeType===Ft){let s=!1;const l=n.childNodes,a=l.length,c=r._blockCursorElement;o===a&&(s=!0,o=a-1);let u=l[o],d=!1;if(u===c)u=l[o+1],d=!0;else if(c!==null){const f=c.parentNode;n===f&&e>Array.prototype.indexOf.call(f.children,c)&&o--}if(i=gt(u),D(i))o=so(i,s);else{let f=gt(n);if(f===null)return null;if(b(f)){o=Math.min(f.getChildrenSize(),o);let h=f.getChildAtIndex(o);if(b(h)&&function(g,m,_){const x=g.getParent();return _===null||x===null||!x.canBeEmpty()||x!==_.getNode()}(h,0,t)){const g=s?h.getLastDescendant():h.getFirstDescendant();g===null?f=h:(h=g,f=b(h)?h:h.getParentOrThrow()),o=0}D(h)?(i=h,f=null,o=so(h,s)):h!==f&&s&&!d&&o++}else{const h=f.getIndexWithinParent();o=e===0&&U(f)&&gt(n)===f?h:h+1,f=f.getParentOrThrow()}if(b(f))return Ee(f.__key,o,"element")}}else i=gt(n);return D(i)?Ee(i.__key,o,"text"):null}function Jo(n,e,t){const r=n.offset,i=n.getNode();if(r===0){const o=i.getPreviousSibling(),s=i.getParent();if(e){if((t||!e)&&o===null&&b(s)&&s.isInline()){const l=s.getPreviousSibling();D(l)&&(n.key=l.__key,n.offset=l.getTextContent().length)}}else b(o)&&!t&&o.isInline()?(n.key=o.__key,n.offset=o.getChildrenSize(),n.type="element"):D(o)&&(n.key=o.__key,n.offset=o.getTextContent().length)}else if(r===i.getTextContent().length){const o=i.getNextSibling(),s=i.getParent();if(e&&b(o)&&o.isInline())n.key=o.__key,n.offset=0,n.type="element";else if((t||e)&&o===null&&b(s)&&s.isInline()&&!s.canInsertTextAfter()){const l=s.getNextSibling();D(l)&&(n.key=l.__key,n.offset=0)}}}function Ho(n,e,t){if(n.type==="text"&&e.type==="text"){const r=n.isBefore(e),i=n.is(e);Jo(n,r,i),Jo(e,!r,i),i&&(e.key=n.key,e.offset=n.offset,e.type=n.type);const o=G();if(o.isComposing()&&o._compositionKey!==n.key&&O(t)){const s=t.anchor,l=t.focus;Ve(n,s.key,s.offset,s.type),Ve(e,l.key,l.offset,l.type)}}}function Yo(n,e,t,r,i,o){if(n===null||t===null||!Mt(i,n,t))return null;const s=Vo(n,e,O(o)?o.anchor:null,i);if(s===null)return null;const l=Vo(t,r,O(o)?o.focus:null,i);if(l===null)return null;if(s.type==="element"&&l.type==="element"){const a=gt(n),c=gt(t);if(U(a)&&U(c))return null}return Ho(s,l,o),[s,l]}function si(n){return b(n)&&!n.isInline()}function qo(n,e,t,r,i,o){const s=Ae(),l=new Je(Ee(n,e,i),Ee(t,r,o),0,"");return l.dirty=!0,s._selection=l,l}function ua(){const n=Ee("root",0,"element"),e=Ee("root",0,"element");return new Je(n,e,0,"")}function Go(){return new zn(new Set)}function li(n,e,t,r){const i=t._window;if(i===null)return null;const o=r||i.event,s=o?o.type:void 0,l=s==="selectionchange",a=!Tr&&(l||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&o&&o.detail===3||s==="drop"||s===void 0);let c,u,d,f;if(O(n)&&!a)return n.clone();if(e===null)return null;if(c=e.anchorNode,u=e.focusNode,d=e.anchorOffset,f=e.focusOffset,l&&O(n)&&!Mt(t,c,u))return n.clone();const h=Yo(c,d,u,f,t,n);if(h===null)return null;const[g,m]=h;return new Je(g,m,O(n)?n.format:0,O(n)?n.style:"")}function F(){return Ae()._selection}function tn(){return G()._editorState._selection}function Kn(n,e,t,r=1){const i=n.anchor,o=n.focus,s=i.getNode(),l=o.getNode();if(!e.is(s)&&!e.is(l))return;const a=e.__key;if(n.isCollapsed()){const c=i.offset;if(t<=c&&r>0||t<c&&r<0){const u=Math.max(0,c+r);i.set(a,u,"element"),o.set(a,u,"element"),Xo(n)}}else{const c=n.isBackward(),u=c?o:i,d=u.getNode(),f=c?i:o,h=f.getNode();if(e.is(d)){const g=u.offset;(t<=g&&r>0||t<g&&r<0)&&u.set(a,Math.max(0,g+r),"element")}if(e.is(h)){const g=f.offset;(t<=g&&r>0||t<g&&r<0)&&f.set(a,Math.max(0,g+r),"element")}}Xo(n)}function Xo(n){const e=n.anchor,t=e.offset,r=n.focus,i=r.offset,o=e.getNode(),s=r.getNode();if(n.isCollapsed()){if(!b(o))return;const l=o.getChildrenSize(),a=t>=l,c=a?o.getChildAtIndex(l-1):o.getChildAtIndex(t);if(D(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text"),r.set(c.__key,u,"text")}}else{if(b(o)){const l=o.getChildrenSize(),a=t>=l,c=a?o.getChildAtIndex(l-1):o.getChildAtIndex(t);if(D(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text")}}if(b(s)){const l=s.getChildrenSize(),a=i>=l,c=a?s.getChildAtIndex(l-1):s.getChildAtIndex(i);if(D(c)){let u=0;a&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}}function Un(n,e,t,r,i){let o=null,s=0,l=null;r!==null?(o=r.__key,D(r)?(s=r.getTextContentSize(),l="text"):b(r)&&(s=r.getChildrenSize(),l="element")):i!==null&&(o=i.__key,D(i)?l="text":b(i)&&(l="element")),o!==null&&l!==null?n.set(o,s,l):(s=e.getIndexWithinParent(),s===-1&&(s=t.getChildrenSize()),n.set(t.__key,s,"element"))}function Zo(n,e,t,r,i){n.type==="text"?(n.key=t,e||(n.offset+=i)):n.offset>r.getIndexWithinParent()&&(n.offset-=1)}function fa(n,e,t,r,i,o,s){const l=r.anchorNode,a=r.focusNode,c=r.anchorOffset,u=r.focusOffset,d=document.activeElement;if(i.has("collaboration")&&d!==o||d!==null&&Nr(d))return;if(!O(e))return void(n!==null&&Mt(t,l,a)&&r.removeAllRanges());const f=e.anchor,h=e.focus,g=f.key,m=h.key,_=Nn(t,g),x=Nn(t,m),v=f.offset,y=h.offset,C=e.format,T=e.style,S=e.isCollapsed();let P=_,k=x,E=!1;if(f.type==="text"){P=Tn(_);const Y=f.getNode();E=Y.getFormat()!==C||Y.getStyle()!==T}else O(n)&&n.anchor.type==="text"&&(E=!0);var M,R,q,H,W;if(h.type==="text"&&(k=Tn(x)),P!==null&&k!==null&&(S&&(n===null||E||O(n)&&(n.format!==C||n.style!==T))&&(M=C,R=T,q=v,H=g,W=performance.now(),No=[M,R,q,H,W]),c!==v||u!==y||l!==P||a!==k||r.type==="Range"&&S||(d!==null&&o.contains(d)||o.focus({preventScroll:!0}),f.type==="element"))){try{r.setBaseAndExtent(P,v,k,y)}catch{}if(!i.has("skip-scroll-into-view")&&e.isCollapsed()&&o!==null&&o===document.activeElement){const Y=e instanceof Je&&e.anchor.type==="element"?P.childNodes[v]||null:r.rangeCount>0?r.getRangeAt(0):null;if(Y!==null){let ce;if(Y instanceof Text){const Ie=document.createRange();Ie.selectNode(Y),ce=Ie.getBoundingClientRect()}else ce=Y.getBoundingClientRect();(function(Ie,qe,an){const cn=an.ownerDocument,un=cn.defaultView;if(un===null)return;let{top:Et,bottom:kt}=qe,Nt=0,Pt=0,pe=an;for(;pe!==null;){const at=pe===cn.body;if(at)Nt=0,Pt=On(Ie).innerHeight;else{const Ge=pe.getBoundingClientRect();Nt=Ge.top,Pt=Ge.bottom}let Ne=0;if(Et<Nt?Ne=-(Nt-Et):kt>Pt&&(Ne=kt-Pt),Ne!==0)if(at)un.scrollBy(0,Ne);else{const Ge=pe.scrollTop;pe.scrollTop+=Ne;const ct=pe.scrollTop-Ge;Et-=ct,kt-=ct}if(at)break;pe=Pn(pe)}})(t,ce,o)}}Xr=!0}}function da(n){let e=F()||tn();e===null&&(e=Z().selectEnd()),e.insertNodes(n)}function ai(n){let e=n;n.isCollapsed()||e.removeText();const t=F();O(t)&&(e=t),O(e)||j(161);const r=e.anchor;let i=r.getNode(),o=r.offset;for(;!mt(i);)[i,o]=ha(i,o);return o}function ha(n,e){const t=n.getParent();if(!t){const i=ke();return Z().append(i),i.select(),[Z(),0]}if(D(n)){const i=n.splitText(e);if(i.length===0)return[t,n.getIndexWithinParent()];const o=e===0?0:1;return[t,i[0].getIndexWithinParent()+o]}if(!b(n)||e===0)return[t,n.getIndexWithinParent()];const r=n.getChildAtIndex(e);if(r){const i=new Je(Ee(n.__key,e,"element"),Ee(n.__key,e,"element"),0,""),o=n.insertNewAfter(i);o&&o.append(r,...r.getNextSiblings())}return[t,n.getIndexWithinParent()+1]}let te=null,ne=null,de=!1,ci=!1,Vn=0;const Qo={characterData:!0,childList:!0,subtree:!0};function nn(){return de||te!==null&&te._readOnly}function he(){de&&j(13)}function es(){Vn>99&&j(14)}function Ae(){return te===null&&j(195,ts()),te}function G(){return ne===null&&j(196,ts()),ne}function ts(){let n=0;const e=new Set,t=Hn.version;if(typeof window<"u")for(const i of document.querySelectorAll("[contenteditable]")){const o=Sn(i);if(Pr(o))n++;else if(o){let s=String(o.constructor.version||"<0.17.1");s===t&&(s+=" (separately built, likely a bundler configuration issue)"),e.add(s)}}let r=` Detected on the page: ${n} compatible editor(s) with version ${t}`;return e.size&&(r+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),r}function ga(){return ne}function ns(n,e,t){const r=e.__type,i=function(l,a){const c=l._nodes.get(a);return c===void 0&&j(30,a),c}(n,r);let o=t.get(r);o===void 0&&(o=Array.from(i.transforms),t.set(r,o));const s=o.length;for(let l=0;l<s&&(o[l](e),e.isAttached());l++);}function rs(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function pa(n){return ui(n,G()._nodes)}function ui(n,e){const t=n.type,r=e.get(t);r===void 0&&j(17,t);const i=r.klass;n.type!==i.getType()&&j(18,i.name);const o=i.importJSON(n),s=n.children;if(b(o)&&Array.isArray(s))for(let l=0;l<s.length;l++){const a=ui(s[l],e);o.append(a)}return o}function is(n,e,t){const r=te,i=de,o=ne;te=e,de=!0,ne=n;try{return t()}finally{te=r,de=i,ne=o}}function He(n,e){const t=n._pendingEditorState,r=n._rootElement,i=n._headless||r===null;if(t===null)return;const o=n._editorState,s=o._selection,l=t._selection,a=n._dirtyType!==Ze,c=te,u=de,d=ne,f=n._updating,h=n._observer;let g=null;if(n._pendingEditorState=null,n._editorState=t,!i&&a&&h!==null){ne=n,te=t,de=!1,n._updating=!0;try{const S=n._dirtyType,P=n._dirtyElements,k=n._dirtyLeaves;h.disconnect(),g=ea(o,t,n,S,P,k)}catch(S){if(S instanceof Error&&n._onError(S),ci)throw S;return us(n,null,r,t),qi(n),n._dirtyType=ht,ci=!0,He(n,o),void(ci=!1)}finally{h.observe(r,Qo),n._updating=f,te=c,de=u,ne=d}}t._readOnly||(t._readOnly=!0);const m=n._dirtyLeaves,_=n._dirtyElements,x=n._normalizedNodes,v=n._updateTags,y=n._deferred;a&&(n._dirtyType=Ze,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),function(S,P){const k=S._decorators;let E=S._pendingDecorators||k;const M=P._nodeMap;let R;for(R in E)M.has(R)||(E===k&&(E=ro(S)),delete E[R])}(n,t);const C=i?null:Se(n._window);if(n._editable&&C!==null&&(a||l===null||l.dirty)){ne=n,te=t;try{if(h!==null&&h.disconnect(),a||l===null||l.dirty){const S=n._blockCursorElement;S!==null&&$r(S,n,r),fa(s,l,n,C,v,r)}Hl(n,r,l),h!==null&&h.observe(r,Qo)}finally{ne=d,te=c}}g!==null&&function(S,P,k,E,M){const R=Array.from(S._listeners.mutation),q=R.length;for(let H=0;H<q;H++){const[W,Y]=R[H],ce=P.get(Y);ce!==void 0&&W(ce,{dirtyLeaves:E,prevEditorState:M,updateTags:k})}}(n,g,v,m,o),O(l)||l===null||s!==null&&s.is(l)||n.dispatchCommand(dn,void 0);const T=n._pendingDecorators;T!==null&&(n._decorators=T,n._pendingDecorators=null,rn("decorator",n,!0,T)),function(S,P,k){const E=io(P),M=io(k);E!==M&&rn("textcontent",S,!0,M)}(n,e||o,t),rn("update",n,!0,{dirtyElements:_,dirtyLeaves:m,editorState:t,normalizedNodes:x,prevEditorState:e||o,tags:v}),function(S,P){if(S._deferred=[],P.length!==0){const k=S._updating;S._updating=!0;try{for(let E=0;E<P.length;E++)P[E]()}finally{S._updating=k}}}(n,y),function(S){const P=S._updates;if(P.length!==0){const k=P.shift();if(k){const[E,M]=k;ls(S,E,M)}}}(n)}function rn(n,e,t,...r){const i=e._updating;e._updating=t;try{const o=Array.from(e._listeners[n]);for(let s=0;s<o.length;s++)o[s].apply(null,r)}finally{e._updating=i}}function os(n,e,t){if(n._updating===!1||ne!==n){let i=!1;return n.update(()=>{i=os(n,e,t)}),i}const r=Dr(n);for(let i=4;i>=0;i--)for(let o=0;o<r.length;o++){const s=r[o]._commands.get(e);if(s!==void 0){const l=s[i];if(l!==void 0){const a=Array.from(l),c=a.length;for(let u=0;u<c;u++)if(a[u](t,n)===!0)return!0}}}return!1}function ss(n,e){const t=n._updates;let r=e||!1;for(;t.length!==0;){const i=t.shift();if(i){const[o,s]=i;let l,a;if(s!==void 0){if(l=s.onUpdate,a=s.tag,s.skipTransforms&&(r=!0),s.discrete){const c=n._pendingEditorState;c===null&&j(191),c._flushSync=!0}l&&n._deferred.push(l),a&&n._updateTags.add(a)}o()}}return r}function ls(n,e,t){const r=n._updateTags;let i,o,s=!1,l=!1;t!==void 0&&(i=t.onUpdate,o=t.tag,o!=null&&r.add(o),s=t.skipTransforms||!1,l=t.discrete||!1),i&&n._deferred.push(i);const a=n._editorState;let c=n._pendingEditorState,u=!1;(c===null||c._readOnly)&&(c=n._pendingEditorState=new Jn(new Map((c||a)._nodeMap)),u=!0),c._flushSync=l;const d=te,f=de,h=ne,g=n._updating;te=c,de=!1,n._updating=!0,ne=n;try{u&&(n._headless?a._selection!==null&&(c._selection=a._selection.clone()):c._selection=function(v){const y=v.getEditorState()._selection,C=Se(v._window);return O(y)||y==null?li(y,C,v,null):y.clone()}(n));const _=n._compositionKey;e(),s=ss(n,s),function(v,y){const C=y.getEditorState()._selection,T=v._selection;if(O(T)){const S=T.anchor,P=T.focus;let k;if(S.type==="text"&&(k=S.getNode(),k.selectionTransform(C,T)),P.type==="text"){const E=P.getNode();k!==E&&E.selectionTransform(C,T)}}}(c,n),n._dirtyType!==Ze&&(s?function(v,y){const C=y._dirtyLeaves,T=v._nodeMap;for(const S of C){const P=T.get(S);D(P)&&P.isAttached()&&P.isSimpleText()&&!P.isUnmergeable()&&Zi(P)}}(c,n):function(v,y){const C=y._dirtyLeaves,T=y._dirtyElements,S=v._nodeMap,P=ze(),k=new Map;let E=C,M=E.size,R=T,q=R.size;for(;M>0||q>0;){if(M>0){y._dirtyLeaves=new Set;for(const H of E){const W=S.get(H);D(W)&&W.isAttached()&&W.isSimpleText()&&!W.isUnmergeable()&&Zi(W),W!==void 0&&rs(W,P)&&ns(y,W,k),C.add(H)}if(E=y._dirtyLeaves,M=E.size,M>0){Vn++;continue}}y._dirtyLeaves=new Set,y._dirtyElements=new Map;for(const H of R){const W=H[0],Y=H[1];if(W!=="root"&&!Y)continue;const ce=S.get(W);ce!==void 0&&rs(ce,P)&&ns(y,ce,k),T.set(W,Y)}E=y._dirtyLeaves,M=E.size,R=y._dirtyElements,q=R.size,Vn++}y._dirtyLeaves=C,y._dirtyElements=T}(c,n),ss(n),function(v,y,C,T){const S=v._nodeMap,P=y._nodeMap,k=[];for(const[E]of T){const M=P.get(E);M!==void 0&&(M.isAttached()||(b(M)&&yo(M,E,S,P,k,T),S.has(E)||T.delete(E),k.push(E)))}for(const E of k)P.delete(E);for(const E of C){const M=P.get(E);M===void 0||M.isAttached()||(S.has(E)||C.delete(E),P.delete(E))}}(a,c,n._dirtyLeaves,n._dirtyElements)),_!==n._compositionKey&&(c._flushSync=!0);const x=c._selection;if(O(x)){const v=c._nodeMap,y=x.anchor.key,C=x.focus.key;v.get(y)!==void 0&&v.get(C)!==void 0||j(19)}else be(x)&&x._nodes.size===0&&(c._selection=null)}catch(_){return _ instanceof Error&&n._onError(_),n._pendingEditorState=a,n._dirtyType=ht,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void He(n)}finally{te=d,de=f,ne=h,n._updating=g,Vn=0}n._dirtyType!==Ze||function(_,x){const v=x.getEditorState()._selection,y=_._selection;if(y!==null){if(y.dirty||!y.is(v))return!0}else if(v!==null)return!0;return!1}(c,n)?c._flushSync?(c._flushSync=!1,He(n)):u&&Bl(()=>{He(n)}):(c._flushSync=!1,u&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function ge(n,e,t){n._updating?n._updates.push([e,t]):ls(n,e,t)}class on extends Rn{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return Ll[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const e=G()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;t!==null;){if(D(t)&&e.push(t),b(t)){const r=t.getAllTextNodes();e.push(...r)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;b(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;b(e);){const t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),r=t.length;if(e>=r){const o=t[r-1];return b(o)&&o.getLastDescendant()||o||null}const i=t[e];return b(i)&&i.getFirstDescendant()||i||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:se(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&j(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:se(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&j(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let r,i;if(e<t/2){for(r=this.getFirstChild(),i=0;r!==null&&i<=e;){if(i===e)return r;r=r.getNextSibling(),i++}return null}for(r=this.getLastChild(),i=t-1;r!==null&&i>=e;){if(i===e)return r;r=r.getPreviousSibling(),i--}return null}getTextContent(){let e="";const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const o=t[i];e+=o.getTextContent(),b(o)&&i!==r-1&&!o.isInline()&&(e+=Pe)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const o=t[i];e+=o.getTextContentSize(),b(o)&&i!==r-1&&!o.isInline()&&(e+=Pe.length)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(e!==""){const t=Ji[e];return!!(this.getFormat()&t)}return!1}select(e,t){he();const r=F();let i=e,o=t;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const a=this.getFirstChild();if(D(a)||b(a))return a.select(0,0)}else if(!(e!==void 0&&e!==s||t!==void 0&&t!==s)){const a=this.getLastChild();if(D(a)||b(a))return a.select()}}i===void 0&&(i=s),o===void 0&&(o=s);const l=this.__key;return O(r)?(r.anchor.set(l,i,"element"),r.focus.set(l,o,"element"),r.dirty=!0,r):qo(l,i,l,o,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach(t=>t.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==""?Ji[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,r){const i=r.length,o=this.getChildrenSize(),s=this.getWritable(),l=s.__key,a=[],c=[],u=this.getChildAtIndex(e+t);let d=null,f=o-t+i;if(e!==0)if(e===o)d=this.getLastChild();else{const g=this.getChildAtIndex(e);g!==null&&(d=g.getPreviousSibling())}if(t>0){let g=d===null?this.getFirstChild():d.getNextSibling();for(let m=0;m<t;m++){g===null&&j(100);const _=g.getNextSibling(),x=g.__key;Qe(g.getWritable()),c.push(x),g=_}}let h=d;for(let g=0;g<i;g++){const m=r[g];h!==null&&m.is(h)&&(d=h=h.getPreviousSibling());const _=m.getWritable();_.__parent===l&&f--,Qe(_);const x=m.__key;if(h===null)s.__first=x,_.__prev=null;else{const v=h.getWritable();v.__next=x,_.__prev=v.__key}m.__key===l&&j(76),_.__parent=l,a.push(x),h=m}if(e+t===o)h!==null&&(h.getWritable().__next=null,s.__last=h.__key);else if(u!==null){const g=u.getWritable();if(h!==null){const m=h.getWritable();g.__prev=h.__key,m.__next=u.__key}else g.__prev=null}if(s.__size=f,c.length){const g=F();if(O(g)){const m=new Set(c),_=new Set(a),{anchor:x,focus:v}=g;as(x,m,_)&&Un(x,x.getNode(),this,d,u),as(v,m,_)&&Un(v,v.getNode(),this,d,u),f!==0||this.canBeEmpty()||pt(this)||this.remove()}}return s}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,r){return!1}canMergeWhenEmpty(){return!1}}function b(n){return n instanceof on}function as(n,e,t){let r=n.getNode();for(;r;){const i=r.__key;if(e.has(i)&&!t.has(i))return!0;r=r.getParent()}return!1}class ma extends Rn{constructor(e){super(e)}decorate(e,t){j(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function U(n){return n instanceof ma}class sn extends on{static getType(){return"root"}static clone(){return new sn}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){j(51)}getTextContent(){const e=this.__cachedText;return!nn()&&G()._dirtyType!==Ze||e===null?super.getTextContent():e}remove(){j(52)}replace(e){j(53)}insertBefore(e){j(54)}insertAfter(e){j(55)}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const r=e[t];b(r)||U(r)||j(56)}return super.append(...e)}static importJSON(e){const t=Z();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function oe(n){return n instanceof sn}function fi(){return new Jn(new Map([["root",new sn]]))}function cs(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&j(130,t.name),b(n)){const r=e.children;Array.isArray(r)||j(59,t.name);const i=n.getChildren();for(let o=0;o<i.length;o++){const s=cs(i[o]);r.push(s)}}return e}class Jn{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return is(t&&t.editor||null,this,e)}clone(e){const t=new Jn(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return is(null,this,()=>({root:cs(Z())}))}}class di extends on{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class xt extends on{constructor(e){super(e),this.__textFormat=0,this.__textStyle=""}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=Oe[e];return!!(this.getTextFormat()&t)}getTextStyle(){return this.getLatest().__textStyle}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}static clone(e){return new xt(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),r=Bt(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:_a,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Dn(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();t.style.textAlign=r;const i=this.getDirection();i&&(t.dir=i);const o=this.getIndent();o>0&&(t.style.textIndent=20*o+"px")}return{element:t}}static importJSON(e){const t=ke();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle(),type:"paragraph",version:1}}insertNewAfter(e,t){const r=ke();r.setTextFormat(e.format),r.setTextStyle(e.style);const i=this.getDirection();return r.setDirection(i),r.setFormat(this.getFormatType()),r.setStyle(this.getTextStyle()),this.insertAfter(r,t),r}collapseAtStart(){const e=this.getChildren();if(e.length===0||D(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function _a(n){const e=ke();if(n.style){e.setFormat(n.style.textAlign);const t=parseInt(n.style.textIndent,10)/20;t>0&&e.setIndent(t)}return{node:e}}function ke(){return Kt(new xt)}function hi(n){return n instanceof xt}const K=0,ya=4;function us(n,e,t,r){const i=n._keyToDOMMap;i.clear(),n._editorState=fi(),n._pendingEditorState=r,n._compositionKey=null,n._dirtyType=Ze,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),n._normalizedNodes=new Set,n._updateTags=new Set,n._updates=[],n._blockCursorElement=null;const o=n._observer;o!==null&&(o.disconnect(),n._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",i.set("root",t))}function va(n){const e=n||{},t=ga(),r=e.theme||{},i=n===void 0?t:e.parentEditor||null,o=e.disableEvents||!1,s=fi(),l=e.namespace||(i!==null?i._config.namespace:ao()),a=e.editorState,c=[sn,vt,Xt,Qt,xt,di,...e.nodes||[]],{onError:u,html:d}=e,f=e.editable===void 0||e.editable;let h;if(n===void 0&&t!==null)h=t._nodes;else{h=new Map;for(let m=0;m<c.length;m++){let _=c[m],x=null,v=null;if(typeof _!="function"){const S=_;_=S.replace,x=S.with,v=S.withKlass||null}const y=_.getType(),C=_.transform(),T=new Set;C!==null&&T.add(C),h.set(y,{exportDOM:d&&d.export?d.export.get(_):void 0,klass:_,replace:x,replaceWithKlass:v,transforms:T})}}const g=new Hn(s,i,h,{disableEvents:o,namespace:l,theme:r},u||console.error,function(m,_){const x=new Map,v=new Set,y=C=>{Object.keys(C).forEach(T=>{let S=x.get(T);S===void 0&&(S=[],x.set(T,S)),S.push(C[T])})};return m.forEach(C=>{const T=C.klass.importDOM;if(T==null||v.has(T))return;v.add(T);const S=T.call(C.klass);S!==null&&y(S)}),_&&y(_),x}(h,d?d.import:void 0),f);return a!==void 0&&(g._pendingEditorState=a,g._dirtyType=ht),g}class Hn{constructor(e,t,r,i,o,s,l){this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=i,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=Ze,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=ao(),this._onError=o,this._htmlConversions=s,this._editable=l,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,r){r===void 0&&j(35);const i=this._commands;i.has(e)||i.set(e,[new Set,new Set,new Set,new Set,new Set]);const o=i.get(e);o===void 0&&j(36,String(e));const s=o[r];return s.add(t),()=>{s.delete(t),o.every(l=>l.size===0)&&i.delete(e)}}registerMutationListener(e,t,r){const i=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,o=this._listeners.mutation;o.set(t,i);const s=r&&r.skipInitialization;return s===void 0||s||this.initializeMutationListener(t,i),()=>{o.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&j(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const r=this._editorState,i=Xl(r).get(t.getType());if(!i)return;const o=new Map;for(const s of i.keys())o.set(s,"created");o.size>0&&e(o,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const r=this.getRegisteredNode(e);return r.transforms.add(t),r}registerNodeTransform(e,t){const r=this.registerNodeTransformToKlass(e,t),i=[r],o=r.replaceWithKlass;if(o!=null){const a=this.registerNodeTransformToKlass(o,t);i.push(a)}var s,l;return s=this,l=e.getType(),ge(s,()=>{const a=Ae();if(a.isEmpty())return;if(l==="root")return void Z().markDirty();const c=a._nodeMap;for(const[,u]of c)u.markDirty()},s._pendingEditorState===null?{tag:"history-merge"}:void 0),()=>{i.forEach(a=>a.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return I(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const r=Bt(this._config.theme,"root"),i=this._pendingEditorState||this._editorState;if(this._rootElement=e,us(this,t,e,i),t!==null&&(this._config.disableEvents||ta(t),r!=null&&t.classList.remove(...r)),e!==null){const o=function(l){const a=l.ownerDocument;return a&&a.defaultView||null}(e),s=e.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=o,this._dirtyType=ht,qi(this),this._updateTags.add("history-merge"),He(this),this._config.disableEvents||function(l,a){const c=l.ownerDocument,u=$n.get(c);(u===void 0||u<1)&&c.addEventListener("selectionchange",Ao),$n.set(c,(u||0)+1),l.__lexicalEditor=a;const d=jo(l);for(let f=0;f<Gr.length;f++){const[h,g]=Gr[f],m=typeof g=="function"?_=>{Fo(_)||(Io(_),(a.isEditable()||h==="click")&&g(_,a))}:_=>{if(Fo(_))return;Io(_);const x=a.isEditable();switch(h){case"cut":return x&&I(a,gr,_);case"copy":return I(a,_n,_);case"paste":return x&&I(a,fr,_);case"dragstart":return x&&I(a,Wi,_);case"dragover":return x&&I(a,Bi,_);case"dragend":return x&&I(a,pl,_);case"focus":return x&&I(a,yl,_);case"blur":return x&&I(a,vl,_);case"drop":return x&&I(a,Ri,_)}};l.addEventListener(h,m),d.push(()=>{l.removeEventListener(h,m)})}}(e,this),r!=null&&e.classList.add(...r)}else this._editorState=i,this._pendingEditorState=null,this._window=null;rn("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&j(38),Yi(this);const r=this._pendingEditorState,i=this._updateTags,o=t!==void 0?t.tag:null;r===null||r.isEmpty()||(o!=null&&i.add(o),He(this)),this._pendingEditorState=e,this._dirtyType=ht,this._dirtyElements.set("root",!1),this._compositionKey=null,o!=null&&i.add(o),He(this)}parseEditorState(e,t){return function(r,i,o){const s=fi(),l=te,a=de,c=ne,u=i._dirtyElements,d=i._dirtyLeaves,f=i._cloneNotNeeded,h=i._dirtyType;i._dirtyElements=new Map,i._dirtyLeaves=new Set,i._cloneNotNeeded=new Set,i._dirtyType=0,te=s,de=!1,ne=i;try{const g=i._nodes;ui(r.root,g),o&&o(),s._readOnly=!0}catch(g){g instanceof Error&&i._onError(g)}finally{i._dirtyElements=u,i._dirtyLeaves=d,i._cloneNotNeeded=f,i._dirtyType=h,te=l,de=a,ne=c}return s}(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return He(this),this.getEditorState().read(e,{editor:this})}update(e,t){ge(this,e,t)}focus(e,t={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),ge(this,()=>{const i=F(),o=Z();i!==null?i.dirty=!0:o.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?o.selectStart():o.selectEnd())},{onUpdate:()=>{r.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=Se(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,rn("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}Hn.version="0.17.1+prod.esm";function xa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ba=xa(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const fs=L.createContext(null);function Ca(n,e){let t=null;return n!=null&&(t=n[1]),{getTheme:function(){return e??(t!=null?t.getTheme():null)}}}function it(){const n=L.useContext(fs);return n==null&&ba(8),n}const ds=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,wa=ds?L.useLayoutEffect:L.useEffect,Yn={tag:"history-merge"};function Sa({initialConfig:n,children:e}){const t=L.useMemo(()=>{const{theme:r,namespace:i,nodes:o,onError:s,editorState:l,html:a}=n,c=Ca(null,r),u=va({editable:n.editable,html:a,namespace:i,nodes:o,onError:d=>s(d,u),theme:r});return function(d,f){if(f!==null){if(f===void 0)d.update(()=>{const h=Z();if(h.isEmpty()){const g=ke();h.append(g);const m=ds?document.activeElement:null;(F()!==null||m!==null&&m===d.getRootElement())&&g.select()}},Yn);else if(f!==null)switch(typeof f){case"string":{const h=d.parseEditorState(f);d.setEditorState(h,Yn);break}case"object":d.setEditorState(f,Yn);break;case"function":d.update(()=>{Z().isEmpty()&&f(d)},Yn)}}}(u,l),[u,c]},[]);return wa(()=>{const r=n.editable,[i]=t;i.setEditable(r===void 0||r)},[]),w.jsx(fs.Provider,{value:t,children:e})}function Ta({defaultSelection:n}){const[e]=it();return L.useEffect(()=>{e.focus(()=>{const t=document.activeElement,r=e.getRootElement();r===null||t!==null&&r.contains(t)||r.focus({preventScroll:!0})},{defaultSelection:n})},[n,e]),null}function Ea(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ka=Ea(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const qn=new Map;function hs(n){const e={},t=n.split(";");for(const r of t)if(r!==""){const[i,o]=r.split(/:([^]+)/);i&&o&&(e[i.trim()]=o.trim())}return e}function gi(n){let e=qn.get(n);return e===void 0&&(e=hs(n),qn.set(n,e)),e}function gs(n,e){const t=n.getStartEndPoints();if(e.isSelected(n)&&!e.isSegmented()&&!e.isToken()&&t!==null){const[r,i]=t,o=n.isBackward(),s=r.getNode(),l=i.getNode(),a=e.is(s),c=e.is(l);if(a||c){const[u,d]=oi(n),f=s.is(l),h=e.is(o?l:s),g=e.is(o?s:l);let m,_=0;return f?(_=u>d?d:u,m=u>d?u:d):h?(_=o?d:u,m=void 0):g&&(_=0,m=o?u:d),e.__text=e.__text.slice(_,m),e}}return e}function ps(n){if(n.type==="text")return n.offset===n.getNode().getTextContentSize();const e=n.getNode();return b(e)||ka(177),n.offset===e.getChildrenSize()}function Na(n){const e=n.getStyle(),t=hs(e);qn.set(e,t)}function bt(n,e){const t=gi("getStyle"in n?n.getStyle():n.style),r=Object.entries(e).reduce((o,[s,l])=>(typeof l=="function"?o[s]=l(t[s],n):l===null?delete o[s]:o[s]=l,o),{...t}),i=function(o){let s="";for(const l in o)l&&(s+=`${l}: ${o[l]};`);return s}(r);n.setStyle(i),qn.set(i,r)}function Pa(n,e){const t=n.getNodes(),r=t.length,i=n.getStartEndPoints();if(i===null)return;const[o,s]=i,l=r-1;let a=t[0],c=t[l];if(n.isCollapsed()&&O(n))return void bt(n,e);const u=a.getTextContent().length,d=s.offset;let f=o.offset;const h=o.isBefore(s);let g=h?f:d,m=h?d:f;const _=h?o.type:s.type,x=h?s.type:o.type,v=h?s.key:o.key;if(D(a)&&g===u){const y=a.getNextSibling();D(y)&&(f=0,g=0,a=y)}if(t.length===1){if(D(a)&&a.canHaveFormat()){if(g=_==="element"?0:f>d?d:f,m=x==="element"?u:f>d?f:d,g===m)return;if(De(a)||g===0&&m===u)bt(a,e),a.select(g,m);else{const y=a.splitText(g,m),C=g===0?y[0]:y[1];bt(C,e),C.select(0,m-g)}}}else{if(D(a)&&g<a.getTextContentSize()&&a.canHaveFormat()&&(g===0||De(a)||(a=a.splitText(g)[1],g=0,h?o.set(a.getKey(),g,"text"):s.set(a.getKey(),g,"text")),bt(a,e)),D(c)&&c.canHaveFormat()){const y=c.getTextContent().length;c.__key!==v&&m!==0&&(m=y),m===y||De(c)||([c]=c.splitText(m)),m===0&&x!=="element"||bt(c,e)}for(let y=1;y<l;y++){const C=t[y],T=C.getKey();D(C)&&C.canHaveFormat()&&T!==a.getKey()&&T!==c.getKey()&&!C.isToken()&&bt(C,e)}}}function ms(n,e){const t=zt(n.focus,e);return U(t)&&!t.isIsolated()||b(t)&&!t.isInline()&&!t.canBeEmpty()}function Oa(n,e,t,r){n.modify(e?"extend":"move",t,r)}function _s(n){const e=n.anchor.getNode();return(oe(e)?e:e.getParentOrThrow()).getDirection()==="rtl"}function ys(n,e,t){const r=_s(n);Oa(n,e,t?!r:r,"character")}function Da(n,e,t){const r=gi(n.getStyle());return r!==null&&r[e]||t}function La(n,e,t=""){let r=null;const i=n.getNodes(),o=n.anchor,s=n.focus,l=n.isBackward(),a=l?s.offset:o.offset,c=l?s.getNode():o.getNode();if(O(n)&&n.isCollapsed()&&n.style!==""){const u=gi(n.style);if(u!==null&&e in u)return u[e]}for(let u=0;u<i.length;u++){const d=i[u];if((u===0||a!==0||!d.is(c))&&D(d)){const f=Da(d,e,t);if(r===null)r=f;else if(r!==f){r="";break}}}return r===null?t:r}function ja(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Aa=ja(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const vs=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Ia=vs&&"documentMode"in document?document.documentMode:null;!(!vs||!("InputEvent"in window)||Ia)&&"getTargetRanges"in new window.InputEvent("input");function Fa(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}function Ct(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}function Ma(n,...e){const t=Fa(...e);t.length>0&&n.classList.add(...t)}function $a(n){const e=Gn(n,t=>b(t)&&!t.isInline());return b(e)||Aa(4,n.__key),e}const Gn=(n,e)=>{let t=n;for(;t!==Z()&&t!=null;){if(e(t))return t;t=t.getParent()}return null};function ot(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}const Xn=0,pi=1,mi=2,Ce=0,Ra=1,xs=2,Wa=3,Ba=4;function za(n,e,t,r,i){if(n===null||t.size===0&&r.size===0&&!i)return Ce;const o=e._selection,s=n._selection;if(i)return Ra;if(!(O(o)&&O(s)&&s.isCollapsed()&&o.isCollapsed()))return Ce;const l=function(x,v,y){const C=x._nodeMap,T=[];for(const S of v){const P=C.get(S);P!==void 0&&T.push(P)}for(const[S,P]of y){if(!P)continue;const k=C.get(S);k===void 0||oe(k)||T.push(k)}return T}(e,t,r);if(l.length===0)return Ce;if(l.length>1){const x=e._nodeMap,v=x.get(o.anchor.key),y=x.get(s.anchor.key);return v&&y&&!n._nodeMap.has(v.__key)&&D(v)&&v.__text.length===1&&o.anchor.offset===1?xs:Ce}const a=l[0],c=n._nodeMap.get(a.__key);if(!D(c)||!D(a)||c.__mode!==a.__mode)return Ce;const u=c.__text,d=a.__text;if(u===d)return Ce;const f=o.anchor,h=s.anchor;if(f.key!==h.key||f.type!=="text")return Ce;const g=f.offset,m=h.offset,_=d.length-u.length;return _===1&&m===g-1?xs:_===-1&&m===g+1?Wa:_===-1&&m===g?Ba:Ce}function Ka(n,e){let t=Date.now(),r=Ce;return(i,o,s,l,a,c)=>{const u=Date.now();if(c.has("historic"))return r=Ce,t=u,mi;const d=za(i,o,l,a,n.isComposing()),f=(()=>{const h=s===null||s.editor===n,g=c.has("history-push");if(!g&&h&&c.has("history-merge"))return Xn;if(i===null)return pi;const m=o._selection;return l.size>0||a.size>0?g===!1&&d!==Ce&&d===r&&u<t+e&&h||l.size===1&&function(_,x,v){const y=x._nodeMap.get(_),C=v._nodeMap.get(_),T=x._selection,S=v._selection;return!(O(T)&&O(S)&&T.anchor.type==="element"&&T.focus.type==="element"&&S.anchor.type==="text"&&S.focus.type==="text"||!D(y)||!D(C)||y.__parent!==C.__parent)&&JSON.stringify(x.read(()=>y.exportJSON()))===JSON.stringify(v.read(()=>C.exportJSON()))}(Array.from(l)[0],i,o)?Xn:pi:m!==null?Xn:mi})();return t=u,r=d,f}}function bs(n){n.undoStack=[],n.redoStack=[],n.current=null}function Ua(n,e,t){const r=Ka(n,t);return Ct(n.registerCommand(gn,()=>(function(o,s){const l=s.redoStack,a=s.undoStack;if(a.length!==0){const c=s.current,u=a.pop();c!==null&&(l.push(c),o.dispatchCommand(At,!0)),a.length===0&&o.dispatchCommand(It,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),K),n.registerCommand(pn,()=>(function(o,s){const l=s.redoStack,a=s.undoStack;if(l.length!==0){const c=s.current;c!==null&&(a.push(c),o.dispatchCommand(It,!0));const u=l.pop();l.length===0&&o.dispatchCommand(At,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),K),n.registerCommand(ml,()=>(bs(e),!1),K),n.registerCommand(_l,()=>(bs(e),n.dispatchCommand(At,!1),n.dispatchCommand(It,!1),!0),K),n.registerUpdateListener(({editorState:o,prevEditorState:s,dirtyLeaves:l,dirtyElements:a,tags:c})=>{const u=e.current,d=e.redoStack,f=e.undoStack,h=u===null?null:u.editorState;if(u!==null&&o===h)return;const g=r(s,o,u,l,a,c);if(g===pi)d.length!==0&&(e.redoStack=[],n.dispatchCommand(At,!1)),u!==null&&(f.push({...u}),n.dispatchCommand(It,!0));else if(g===mi)return;e.current={editor:n,editorState:o}}))}function Va(){return{current:null,redoStack:[],undoStack:[]}}function Ja({delay:n,externalHistoryState:e}){const[t]=it();return function(r,i,o=1e3){const s=L.useMemo(()=>i||Va(),[i]);L.useEffect(()=>Ua(r,s,o),[o,r,s])}(t,e,n),null}const Ha=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?L.useLayoutEffect:L.useEffect;function Ya(n){return{initialValueFn:()=>n.isEditable(),subscribe:e=>n.registerEditableListener(e)}}function qa(){return function(n){const[e]=it(),t=L.useMemo(()=>n(e),[e,n]),r=L.useRef(t.initialValueFn()),[i,o]=L.useState(r.current);return Ha(()=>{const{initialValueFn:s,subscribe:l}=t,a=s();return r.current!==a&&(r.current=a,o(a)),l(c=>{r.current=c,o(c)})},[t,n]),i}(Ya)}function Ga(){return Z().getTextContent()}function Xa(n,e=!0){if(n)return!1;let t=Ga();return e&&(t=t.trim()),t===""}function Za(n){if(!Xa(n,!1))return!1;const e=Z().getChildren(),t=e.length;if(t>1)return!1;for(let r=0;r<t;r++){const i=e[r];if(U(i))return!1;if(b(i)){if(!hi(i)||i.__indent!==0)return!1;const o=i.getChildren(),s=o.length;for(let l=0;l<s;l++){const a=o[r];if(!D(a))return!1}}}return!0}function Cs(n){return()=>Za(n)}function Qa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}Qa(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function ec(n){const e=window.location.origin,t=r=>{if(r.origin!==e)return;const i=n.getRootElement();if(document.activeElement!==i)return;const o=r.data;if(typeof o=="string"){let s;try{s=JSON.parse(o)}catch{return}if(s&&s.protocol==="nuanria_messaging"&&s.type==="request"){const l=s.payload;if(l&&l.functionId==="makeChanges"){const a=l.args;if(a){const[c,u,d,f,h,g]=a;n.update(()=>{const m=F();if(O(m)){const _=m.anchor;let x=_.getNode(),v=0,y=0;if(D(x)&&c>=0&&u>=0&&(v=c,y=c+u,m.setTextNodeRange(x,v,x,y)),v===y&&d===""||(m.insertRawText(d),x=_.getNode()),D(x)){v=f,y=f+h;const C=x.getTextContentSize();v=v>C?C:v,y=y>C?C:y,m.setTextNodeRange(x,v,x,y)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}function tc(n,e){const t=e.body?e.body.childNodes:[];let r=[];const i=[];for(let o=0;o<t.length;o++){const s=t[o];if(!Ss.has(s.nodeName)){const l=Ts(s,n,i,!1);l!==null&&(r=r.concat(l))}}return function(o){for(const s of o)s.getNextSibling()instanceof di&&s.insertAfter(rt());for(const s of o){const l=s.getChildren();for(const a of l)s.insertBefore(a);s.remove()}}(i),r}function nc(n,e){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const t=document.createElement("div"),r=Z().getChildren();for(let i=0;i<r.length;i++)ws(n,r[i],t,e);return t.innerHTML}function ws(n,e,t,r=null){let i=r===null||e.isSelected(r);const o=b(e)&&e.excludeFromCopy("html");let s=e;if(r!==null){let h=Br(e);h=D(h)&&r!==null?gs(r,h):h,s=h}const l=b(s)?s.getChildren():[],a=n._nodes.get(s.getType());let c;c=a&&a.exportDOM!==void 0?a.exportDOM(n,s):s.exportDOM(n);const{element:u,after:d}=c;if(!u)return!1;const f=document.createDocumentFragment();for(let h=0;h<l.length;h++){const g=l[h],m=ws(n,g,f,r);!i&&b(e)&&m&&e.extractWithChild(g,r,"html")&&(i=!0)}if(i&&!o){if(Dn(u)&&u.append(f),t.append(u),d){const h=d.call(s,u);h&&u.replaceWith(h)}}else t.append(f);return i}const Ss=new Set(["STYLE","SCRIPT"]);function Ts(n,e,t,r,i=new Map,o){let s=[];if(Ss.has(n.nodeName))return s;let l=null;const a=function(g,m){const{nodeName:_}=g,x=m._htmlConversions.get(_.toLowerCase());let v=null;if(x!==void 0)for(const y of x){const C=y(g);C!==null&&(v===null||(v.priority||0)<(C.priority||0))&&(v=C)}return v!==null?v.conversion:null}(n,e),c=a?a(n):null;let u=null;if(c!==null){u=c.after;const g=c.node;if(l=Array.isArray(g)?g[g.length-1]:g,l!==null){for(const[,m]of i)if(l=m(l,o),!l)break;l&&s.push(...Array.isArray(g)?g:[l])}c.forChild!=null&&i.set(n.nodeName,c.forChild)}const d=n.childNodes;let f=[];const h=(l==null||!pt(l))&&(l!=null&&si(l)||r);for(let g=0;g<d.length;g++)f.push(...Ts(d[g],e,t,h,new Map(i),l));return u!=null&&(f=u(f)),Ln(n)&&(f=rc(n,f,h?()=>{const g=new di;return t.push(g),g}:ke)),l==null?f.length>0?s=s.concat(f):Ln(n)&&function(g){return g.nextSibling==null||g.previousSibling==null?!1:Rr(g.nextSibling)&&Rr(g.previousSibling)}(n)&&(s=s.concat(rt())):b(l)&&l.append(...f),s}function rc(n,e,t){const r=n.style.textAlign,i=[];let o=[];for(let s=0;s<e.length;s++){const l=e[s];if(si(l))r&&!l.getFormat()&&l.setFormat(r),i.push(l);else if(o.push(l),s===e.length-1||s<e.length-1&&si(e[s+1])){const a=t();a.setFormat(r),a.append(...o),i.push(a),o=[]}}return i}function ic(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Zn=ic(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const oc=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Es=n=>oc?(n||window).getSelection():null;function sc(n,e=F()){return e==null&&Zn(166),O(e)&&e.isCollapsed()||e.getNodes().length===0?"":nc(n,e)}function lc(n,e=F()){return e==null&&Zn(166),O(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(ac(n,e))}function ks(n,e,t){const r=n.getData("application/x-lexical-editor");if(r)try{const s=JSON.parse(r);if(s.namespace===t._config.namespace&&Array.isArray(s.nodes))return Ns(t,cc(s.nodes),e)}catch{}const i=n.getData("text/html");if(i)try{const s=new DOMParser().parseFromString(i,"text/html");return Ns(t,tc(t,s),e)}catch{}const o=n.getData("text/plain")||n.getData("text/uri-list");if(o!=null)if(O(e)){const s=o.split(/(\r?\n|\t)/);s[s.length-1]===""&&s.pop();for(let l=0;l<s.length;l++){const a=F();if(O(a)){const c=s[l];c===`
39
+ `?r.push(it()):s===" "?r.push(en()):r.push(ie(s))}this.insertNodes(r)}insertText(e){const t=this.anchor,r=this.focus,i=this.format,o=this.style;let s=t,l=r;!this.isCollapsed()&&r.isBefore(t)&&(s=r,l=t),s.type==="element"&&function(_,x,v,y){const C=_.getNode(),T=C.getChildAtIndex(_.offset),S=ie(),P=oe(C)?ke().append(S):S;S.setFormat(v),S.setStyle(y),T===null?C.append(P):T.insertBefore(P),_.is(x)&&x.set(S.__key,0,"text"),_.set(S.__key,0,"text")}(s,l,i,o);const a=s.offset;let c=l.offset;const u=this.getNodes(),d=u.length;let f=u[0];D(f)||j(26);const h=f.getTextContent().length,g=f.getParentOrThrow();let m=u[d-1];if(d===1&&l.type==="element"&&(c=h,l.set(s.key,c,"text")),this.isCollapsed()&&a===h&&(f.isSegmented()||f.isToken()||!f.canInsertTextAfter()||!g.canInsertTextAfter()&&f.getNextSibling()===null)){let _=f.getNextSibling();if(D(_)&&_.canInsertTextBefore()&&!De(_)||(_=ie(),_.setFormat(i),_.setStyle(o),g.canInsertTextAfter()?f.insertAfter(_):g.insertAfter(_)),_.select(0,0),f=_,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&a===0&&(f.isSegmented()||f.isToken()||!f.canInsertTextBefore()||!g.canInsertTextBefore()&&f.getPreviousSibling()===null)){let _=f.getPreviousSibling();if(D(_)&&!De(_)||(_=ie(),_.setFormat(i),g.canInsertTextBefore()?f.insertBefore(_):g.insertBefore(_)),_.select(),f=_,e!=="")return void this.insertText(e)}else if(f.isSegmented()&&a!==h){const _=ie(f.getTextContent());_.setFormat(i),f.replace(_),f=_}else if(!this.isCollapsed()&&e!==""){const _=m.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||b(_)&&(!_.canInsertTextBefore()||!_.canInsertTextAfter()))return this.insertText(""),Ho(this.anchor,this.focus,null),void this.insertText(e)}if(d===1){if(f.isToken()){const y=ie(e);return y.select(),void f.replace(y)}const _=f.getFormat(),x=f.getStyle();if(a!==c||_===i&&x===o){if(aa(f)){const y=ie(e);return y.setFormat(i),y.setStyle(o),y.select(),void f.replace(y)}}else{if(f.getTextContent()!==""){const y=ie(e);if(y.setFormat(i),y.setStyle(o),y.select(),a===0)f.insertBefore(y,!1);else{const[C]=f.splitText(a);C.insertAfter(y,!1)}return void(y.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}f.setFormat(i),f.setStyle(o)}const v=c-a;f=f.spliceText(a,v,e,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(f.isComposing()?this.anchor.offset-=e.length:(this.format=_,this.style=x))}else{const _=new Set([...f.getParentKeys(),...m.getParentKeys()]),x=b(f)?f:f.getParentOrThrow();let v=b(m)?m:m.getParentOrThrow(),y=m;if(!x.is(v)&&v.isInline())do y=v,v=v.getParentOrThrow();while(v.isInline());if(l.type==="text"&&(c!==0||m.getTextContent()==="")||l.type==="element"&&m.getIndexWithinParent()<c)if(D(m)&&!m.isToken()&&c!==m.getTextContentSize()){if(m.isSegmented()){const k=ie(m.getTextContent());m.replace(k),m=k}oe(l.getNode())||l.type!=="text"||(m=m.spliceText(0,c,"")),_.add(m.__key)}else{const k=m.getParentOrThrow();k.canBeEmpty()||k.getChildrenSize()!==1?m.remove():k.remove()}else _.add(m.__key);const C=v.getChildren(),T=new Set(u),S=x.is(v),P=x.isInline()&&f.getNextSibling()===null?x:f;for(let k=C.length-1;k>=0;k--){const E=C[k];if(E.is(f)||b(E)&&E.isParentOf(f))break;E.isAttached()&&(!T.has(E)||E.is(y)?S||P.insertAfter(E,!1):E.remove())}if(!S){let k=v,E=null;for(;k!==null;){const M=k.getChildren(),R=M.length;(R===0||M[R-1].is(E))&&(_.delete(k.__key),E=k),k=k.getParent()}}if(f.isToken())if(a===h)f.select();else{const k=ie(e);k.select(),f.replace(k)}else f=f.spliceText(a,h-a,e,!0),f.getTextContent()===""?f.remove():f.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);for(let k=1;k<d;k++){const E=u[k],M=E.__key;_.has(M)||E.remove()}}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed())return this.toggleFormat(e),void re(null);const t=this.getNodes(),r=[];for(const v of t)D(v)&&r.push(v);const i=r.length;if(i===0)return this.toggleFormat(e),void re(null);const o=this.anchor,s=this.focus,l=this.isBackward(),a=l?s:o,c=l?o:s;let u=0,d=r[0],f=a.type==="element"?0:a.offset;if(a.type==="text"&&f===d.getTextContentSize()&&(u=1,d=r[1],f=0),d==null)return;const h=d.getFormatFlags(e,null),g=i-1;let m=r[g];const _=c.type==="text"?c.offset:m.getTextContentSize();if(d.is(m)){if(f===_)return;if(De(d)||f===0&&_===d.getTextContentSize())d.setFormat(h);else{const v=d.splitText(f,_),y=f===0?v[0]:v[1];y.setFormat(h),a.type==="text"&&a.set(y.__key,0,"text"),c.type==="text"&&c.set(y.__key,_-f,"text")}return void(this.format=h)}f===0||De(d)||([,d]=d.splitText(f),f=0),d.setFormat(h);const x=m.getFormatFlags(e,h);_>0&&(_===m.getTextContentSize()||De(m)||([m]=m.splitText(_)),m.setFormat(x));for(let v=u+1;v<g;v++){const y=r[v],C=y.getFormatFlags(e,x);y.setFormat(C)}a.type==="text"&&a.set(d.__key,f,"text"),c.type==="text"&&c.set(m.__key,_,"text"),this.format=h|x}insertNodes(e){if(e.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const h=F();return O(h)||j(134),h.insertNodes(e)}const t=Br((this.isBackward()?this.focus:this.anchor).getNode(),_t),r=e[e.length-1];if("__language"in t&&b(t)){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const h=ai(this);t.splice(h,0,e),r.selectEnd()}return}if(!e.some(h=>(b(h)||U(h))&&!h.isInline())){b(t)||j(135);const h=ai(this);return t.splice(h,0,e),void r.selectEnd()}const i=function(h){const g=ke();let m=null;for(let _=0;_<h.length;_++){const x=h[_],v=Zt(x);if(v||U(x)&&x.isInline()||b(x)&&x.isInline()||D(x)||x.isParentRequired()){if(m===null&&(m=x.createParentElementNode(),g.append(m),v))continue;m!==null&&m.append(x)}else g.append(x),m=null}return g}(e),o=i.getLastDescendant(),s=i.getChildren(),l=!b(t)||!t.isEmpty()?this.insertParagraph():null,a=s[s.length-1];let c=s[0];var u;b(u=c)&&_t(u)&&!u.isEmpty()&&b(t)&&(!t.isEmpty()||t.canMergeWhenEmpty())&&(b(t)||j(135),t.append(...c.getChildren()),c=s[1]),c&&function(h,g,m){const _=g.getParentOrThrow().getLastChild();let x=g;const v=[g];for(;x!==_;)x.getNextSibling()||j(140),x=x.getNextSibling(),v.push(x);let y=h;for(const C of v)y=y.insertAfter(C)}(t,c);const d=Br(o,_t);l&&b(d)&&(l.canMergeWhenEmpty()||_t(a))&&(d.append(...l.getChildren()),l.remove()),b(t)&&t.isEmpty()&&t.remove(),o.selectEnd();const f=b(t)?t.getLastChild():null;Zt(f)&&d!==t&&f.remove()}insertParagraph(){if(this.anchor.key==="root"){const s=ke();return Z().splice(this.anchor.offset,0,[s]),s.select(),s}const e=ai(this),t=Br(this.anchor.getNode(),_t);b(t)||j(136);const r=t.getChildAtIndex(e),i=r?[r,...r.getNextSiblings()]:[],o=t.insertNewAfter(this,!1);return o?(o.append(...i),o.selectStart(),o):null}insertLineBreak(e){const t=it();if(this.insertNodes([t]),e){const r=t.getParentOrThrow(),i=t.getIndexWithinParent();r.select(i,i)}}extract(){const e=this.getNodes(),t=e.length,r=t-1,i=this.anchor,o=this.focus;let s=e[0],l=e[r];const[a,c]=oi(this);if(t===0)return[];if(t===1){if(D(s)&&!this.isCollapsed()){const d=a>c?c:a,f=a>c?a:c,h=s.splitText(d,f),g=d===0?h[0]:h[1];return g!=null?[g]:[]}return[s]}const u=i.isBefore(o);if(D(s)){const d=u?a:c;d===s.getTextContentSize()?e.shift():d!==0&&([,s]=s.splitText(d),e[0]=s)}if(D(l)){const d=l.getTextContent().length,f=u?c:a;f===0?e.pop():f!==d&&([l]=l.splitText(f),e[r]=l)}return e}modify(e,t,r){const i=this.focus,o=this.anchor,s=e==="move",l=Wt(i,t);if(U(l)&&!l.isIsolated()){if(s&&l.isKeyboardSelectable()){const h=Go();return h.add(l.__key),void we(h)}const f=t?l.getPreviousSibling():l.getNextSibling();if(D(f)){const h=f.__key,g=t?f.getTextContent().length:0;return i.set(h,g,"text"),void(s&&o.set(h,g,"text"))}{const h=l.getParentOrThrow();let g,m;return b(f)?(m=f.__key,g=t?f.getChildrenSize():0):(g=l.getIndexWithinParent(),m=h.__key,t||g++),i.set(m,g,"element"),void(s&&o.set(m,g,"element"))}}const a=G(),c=Se(a._window);if(!c)return;const u=a._blockCursorElement,d=a._rootElement;if(d===null||u===null||!b(l)||l.isInline()||l.canBeEmpty()||$r(u,a,d),function(f,h,g,m){f.modify(h,g,m)}(c,e,t?"backward":"forward",r),c.rangeCount>0){const f=c.getRangeAt(0),h=this.anchor.getNode(),g=oe(h)?h:Jl(h);if(this.applyDOMRange(f),this.dirty=!0,!s){const m=this.getNodes(),_=[];let x=!1;for(let v=0;v<m.length;v++){const y=m[v];Ir(y,g)?_.push(y):x=!0}if(x&&_.length>0)if(t){const v=_[0];b(v)?v.selectStart():v.getParentOrThrow().selectStart()}else{const v=_[_.length-1];b(v)?v.selectEnd():v.getParentOrThrow().selectEnd()}c.anchorNode===f.startContainer&&c.anchorOffset===f.startOffset||function(v){const y=v.focus,C=v.anchor,T=C.key,S=C.offset,P=C.type;Ve(C,y.key,y.offset,y.type),Ve(y,T,S,P),v._cachedNodes=null}(this)}}}forwardDeletion(e,t,r){if(!r&&(e.type==="element"&&b(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){const i=t.getParent(),o=t.getNextSibling()||(i===null?null:i.getNextSibling());if(b(o)&&o.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let i=r.getNode();if(this.forwardDeletion(r,i,e))return;const o=this.focus,s=Wt(o,e);if(U(s)&&!s.isIsolated()){if(s.isKeyboardSelectable()&&b(i)&&i.getChildrenSize()===0){i.remove();const l=Go();l.add(s.__key),we(l)}else s.remove(),G().dispatchCommand(dn,void 0);return}if(!e&&b(s)&&b(i)&&i.isEmpty())return i.remove(),void s.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&r.offset===0&&(r.type==="element"?r.getNode():r.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const l=o.type==="text"?o.getNode():null;if(i=r.type==="text"?r.getNode():null,l!==null&&l.isSegmented()){const a=o.offset,c=l.getTextContentSize();if(l.is(i)||e&&a!==c||!e&&a!==0)return void Uo(l,e,a)}else if(i!==null&&i.isSegmented()){const a=r.offset,c=i.getTextContentSize();if(i.is(l)||e&&a!==0||!e&&a!==c)return void Uo(i,e,a)}(function(a,c){const u=a.anchor,d=a.focus,f=u.getNode(),h=d.getNode();if(f===h&&u.type==="text"&&d.type==="text"){const g=u.offset,m=d.offset,_=g<m,x=_?g:m,v=_?m:g,y=v-1;x!==y&&(lo(f.getTextContent().slice(x,v))||(c?d.offset=y:u.offset=y))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&oe(r.getParent())&&r.getIndexWithinParent()===0&&r.collapseAtStart(this)}}deleteLine(e){if(this.isCollapsed()){const t=this.anchor.type==="element";if(t&&this.insertText(" "),this.modify("extend",e,"lineboundary"),(e?this.focus:this.anchor).offset===0&&this.modify("extend",e,"character"),t){const r=e?this.anchor:this.focus;r.set(r.key,r.offset+1,r.type)}}this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,r=t.getNode();if(this.forwardDeletion(t,r,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function be(n){return n instanceof Wn}function Ko(n){const e=n.offset;if(n.type==="text")return e;const t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function oi(n){const e=n.getStartEndPoints();if(e===null)return[0,0];const[t,r]=e;return t.type==="element"&&r.type==="element"&&t.key===r.key&&t.offset===r.offset?[0,0]:[Ko(t),Ko(r)]}function Uo(n,e,t){const r=n,i=r.getTextContent().split(/(?=\s)/g),o=i.length;let s=0,l=0;for(let c=0;c<o;c++){const u=c===o-1;if(l=s,s+=i[c].length,e&&s===t||s>t||u){i.splice(c,1),u&&(l=void 0);break}}const a=i.join("").trim();a===""?r.remove():(r.setTextContent(a),r.select(l,l))}function Vo(n,e,t,r){let i,o=e;if(n.nodeType===Ft){let s=!1;const l=n.childNodes,a=l.length,c=r._blockCursorElement;o===a&&(s=!0,o=a-1);let u=l[o],d=!1;if(u===c)u=l[o+1],d=!0;else if(c!==null){const f=c.parentNode;n===f&&e>Array.prototype.indexOf.call(f.children,c)&&o--}if(i=pt(u),D(i))o=so(i,s);else{let f=pt(n);if(f===null)return null;if(b(f)){o=Math.min(f.getChildrenSize(),o);let h=f.getChildAtIndex(o);if(b(h)&&function(g,m,_){const x=g.getParent();return _===null||x===null||!x.canBeEmpty()||x!==_.getNode()}(h,0,t)){const g=s?h.getLastDescendant():h.getFirstDescendant();g===null?f=h:(h=g,f=b(h)?h:h.getParentOrThrow()),o=0}D(h)?(i=h,f=null,o=so(h,s)):h!==f&&s&&!d&&o++}else{const h=f.getIndexWithinParent();o=e===0&&U(f)&&pt(n)===f?h:h+1,f=f.getParentOrThrow()}if(b(f))return Ee(f.__key,o,"element")}}else i=pt(n);return D(i)?Ee(i.__key,o,"text"):null}function Jo(n,e,t){const r=n.offset,i=n.getNode();if(r===0){const o=i.getPreviousSibling(),s=i.getParent();if(e){if((t||!e)&&o===null&&b(s)&&s.isInline()){const l=s.getPreviousSibling();D(l)&&(n.key=l.__key,n.offset=l.getTextContent().length)}}else b(o)&&!t&&o.isInline()?(n.key=o.__key,n.offset=o.getChildrenSize(),n.type="element"):D(o)&&(n.key=o.__key,n.offset=o.getTextContent().length)}else if(r===i.getTextContent().length){const o=i.getNextSibling(),s=i.getParent();if(e&&b(o)&&o.isInline())n.key=o.__key,n.offset=0,n.type="element";else if((t||e)&&o===null&&b(s)&&s.isInline()&&!s.canInsertTextAfter()){const l=s.getNextSibling();D(l)&&(n.key=l.__key,n.offset=0)}}}function Ho(n,e,t){if(n.type==="text"&&e.type==="text"){const r=n.isBefore(e),i=n.is(e);Jo(n,r,i),Jo(e,!r,i),i&&(e.key=n.key,e.offset=n.offset,e.type=n.type);const o=G();if(o.isComposing()&&o._compositionKey!==n.key&&O(t)){const s=t.anchor,l=t.focus;Ve(n,s.key,s.offset,s.type),Ve(e,l.key,l.offset,l.type)}}}function Yo(n,e,t,r,i,o){if(n===null||t===null||!Mt(i,n,t))return null;const s=Vo(n,e,O(o)?o.anchor:null,i);if(s===null)return null;const l=Vo(t,r,O(o)?o.focus:null,i);if(l===null)return null;if(s.type==="element"&&l.type==="element"){const a=pt(n),c=pt(t);if(U(a)&&U(c))return null}return Ho(s,l,o),[s,l]}function si(n){return b(n)&&!n.isInline()}function qo(n,e,t,r,i,o){const s=Ae(),l=new Je(Ee(n,e,i),Ee(t,r,o),0,"");return l.dirty=!0,s._selection=l,l}function ua(){const n=Ee("root",0,"element"),e=Ee("root",0,"element");return new Je(n,e,0,"")}function Go(){return new Wn(new Set)}function li(n,e,t,r){const i=t._window;if(i===null)return null;const o=r||i.event,s=o?o.type:void 0,l=s==="selectionchange",a=!Tr&&(l||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&o&&o.detail===3||s==="drop"||s===void 0);let c,u,d,f;if(O(n)&&!a)return n.clone();if(e===null)return null;if(c=e.anchorNode,u=e.focusNode,d=e.anchorOffset,f=e.focusOffset,l&&O(n)&&!Mt(t,c,u))return n.clone();const h=Yo(c,d,u,f,t,n);if(h===null)return null;const[g,m]=h;return new Je(g,m,O(n)?n.format:0,O(n)?n.style:"")}function F(){return Ae()._selection}function tn(){return G()._editorState._selection}function Kn(n,e,t,r=1){const i=n.anchor,o=n.focus,s=i.getNode(),l=o.getNode();if(!e.is(s)&&!e.is(l))return;const a=e.__key;if(n.isCollapsed()){const c=i.offset;if(t<=c&&r>0||t<c&&r<0){const u=Math.max(0,c+r);i.set(a,u,"element"),o.set(a,u,"element"),Xo(n)}}else{const c=n.isBackward(),u=c?o:i,d=u.getNode(),f=c?i:o,h=f.getNode();if(e.is(d)){const g=u.offset;(t<=g&&r>0||t<g&&r<0)&&u.set(a,Math.max(0,g+r),"element")}if(e.is(h)){const g=f.offset;(t<=g&&r>0||t<g&&r<0)&&f.set(a,Math.max(0,g+r),"element")}}Xo(n)}function Xo(n){const e=n.anchor,t=e.offset,r=n.focus,i=r.offset,o=e.getNode(),s=r.getNode();if(n.isCollapsed()){if(!b(o))return;const l=o.getChildrenSize(),a=t>=l,c=a?o.getChildAtIndex(l-1):o.getChildAtIndex(t);if(D(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text"),r.set(c.__key,u,"text")}}else{if(b(o)){const l=o.getChildrenSize(),a=t>=l,c=a?o.getChildAtIndex(l-1):o.getChildAtIndex(t);if(D(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text")}}if(b(s)){const l=s.getChildrenSize(),a=i>=l,c=a?s.getChildAtIndex(l-1):s.getChildAtIndex(i);if(D(c)){let u=0;a&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}}function Un(n,e,t,r,i){let o=null,s=0,l=null;r!==null?(o=r.__key,D(r)?(s=r.getTextContentSize(),l="text"):b(r)&&(s=r.getChildrenSize(),l="element")):i!==null&&(o=i.__key,D(i)?l="text":b(i)&&(l="element")),o!==null&&l!==null?n.set(o,s,l):(s=e.getIndexWithinParent(),s===-1&&(s=t.getChildrenSize()),n.set(t.__key,s,"element"))}function Zo(n,e,t,r,i){n.type==="text"?(n.key=t,e||(n.offset+=i)):n.offset>r.getIndexWithinParent()&&(n.offset-=1)}function fa(n,e,t,r,i,o,s){const l=r.anchorNode,a=r.focusNode,c=r.anchorOffset,u=r.focusOffset,d=document.activeElement;if(i.has("collaboration")&&d!==o||d!==null&&Nr(d))return;if(!O(e))return void(n!==null&&Mt(t,l,a)&&r.removeAllRanges());const f=e.anchor,h=e.focus,g=f.key,m=h.key,_=Nn(t,g),x=Nn(t,m),v=f.offset,y=h.offset,C=e.format,T=e.style,S=e.isCollapsed();let P=_,k=x,E=!1;if(f.type==="text"){P=Tn(_);const Y=f.getNode();E=Y.getFormat()!==C||Y.getStyle()!==T}else O(n)&&n.anchor.type==="text"&&(E=!0);var M,R,q,H,B;if(h.type==="text"&&(k=Tn(x)),P!==null&&k!==null&&(S&&(n===null||E||O(n)&&(n.format!==C||n.style!==T))&&(M=C,R=T,q=v,H=g,B=performance.now(),No=[M,R,q,H,B]),c!==v||u!==y||l!==P||a!==k||r.type==="Range"&&S||(d!==null&&o.contains(d)||o.focus({preventScroll:!0}),f.type==="element"))){try{r.setBaseAndExtent(P,v,k,y)}catch{}if(!i.has("skip-scroll-into-view")&&e.isCollapsed()&&o!==null&&o===document.activeElement){const Y=e instanceof Je&&e.anchor.type==="element"?P.childNodes[v]||null:r.rangeCount>0?r.getRangeAt(0):null;if(Y!==null){let ce;if(Y instanceof Text){const Ie=document.createRange();Ie.selectNode(Y),ce=Ie.getBoundingClientRect()}else ce=Y.getBoundingClientRect();(function(Ie,Ge,an){const cn=an.ownerDocument,un=cn.defaultView;if(un===null)return;let{top:Et,bottom:kt}=Ge,Nt=0,Pt=0,pe=an;for(;pe!==null;){const ct=pe===cn.body;if(ct)Nt=0,Pt=On(Ie).innerHeight;else{const Xe=pe.getBoundingClientRect();Nt=Xe.top,Pt=Xe.bottom}let Ne=0;if(Et<Nt?Ne=-(Nt-Et):kt>Pt&&(Ne=kt-Pt),Ne!==0)if(ct)un.scrollBy(0,Ne);else{const Xe=pe.scrollTop;pe.scrollTop+=Ne;const ut=pe.scrollTop-Xe;Et-=ut,kt-=ut}if(ct)break;pe=Pn(pe)}})(t,ce,o)}}Xr=!0}}function da(n){let e=F()||tn();e===null&&(e=Z().selectEnd()),e.insertNodes(n)}function ai(n){let e=n;n.isCollapsed()||e.removeText();const t=F();O(t)&&(e=t),O(e)||j(161);const r=e.anchor;let i=r.getNode(),o=r.offset;for(;!_t(i);)[i,o]=ha(i,o);return o}function ha(n,e){const t=n.getParent();if(!t){const i=ke();return Z().append(i),i.select(),[Z(),0]}if(D(n)){const i=n.splitText(e);if(i.length===0)return[t,n.getIndexWithinParent()];const o=e===0?0:1;return[t,i[0].getIndexWithinParent()+o]}if(!b(n)||e===0)return[t,n.getIndexWithinParent()];const r=n.getChildAtIndex(e);if(r){const i=new Je(Ee(n.__key,e,"element"),Ee(n.__key,e,"element"),0,""),o=n.insertNewAfter(i);o&&o.append(r,...r.getNextSiblings())}return[t,n.getIndexWithinParent()+1]}let te=null,ne=null,de=!1,ci=!1,Vn=0;const Qo={characterData:!0,childList:!0,subtree:!0};function nn(){return de||te!==null&&te._readOnly}function he(){de&&j(13)}function es(){Vn>99&&j(14)}function Ae(){return te===null&&j(195,ts()),te}function G(){return ne===null&&j(196,ts()),ne}function ts(){let n=0;const e=new Set,t=Hn.version;if(typeof window<"u")for(const i of document.querySelectorAll("[contenteditable]")){const o=Sn(i);if(Pr(o))n++;else if(o){let s=String(o.constructor.version||"<0.17.1");s===t&&(s+=" (separately built, likely a bundler configuration issue)"),e.add(s)}}let r=` Detected on the page: ${n} compatible editor(s) with version ${t}`;return e.size&&(r+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),r}function ga(){return ne}function ns(n,e,t){const r=e.__type,i=function(l,a){const c=l._nodes.get(a);return c===void 0&&j(30,a),c}(n,r);let o=t.get(r);o===void 0&&(o=Array.from(i.transforms),t.set(r,o));const s=o.length;for(let l=0;l<s&&(o[l](e),e.isAttached());l++);}function rs(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function pa(n){return ui(n,G()._nodes)}function ui(n,e){const t=n.type,r=e.get(t);r===void 0&&j(17,t);const i=r.klass;n.type!==i.getType()&&j(18,i.name);const o=i.importJSON(n),s=n.children;if(b(o)&&Array.isArray(s))for(let l=0;l<s.length;l++){const a=ui(s[l],e);o.append(a)}return o}function is(n,e,t){const r=te,i=de,o=ne;te=e,de=!0,ne=n;try{return t()}finally{te=r,de=i,ne=o}}function He(n,e){const t=n._pendingEditorState,r=n._rootElement,i=n._headless||r===null;if(t===null)return;const o=n._editorState,s=o._selection,l=t._selection,a=n._dirtyType!==Qe,c=te,u=de,d=ne,f=n._updating,h=n._observer;let g=null;if(n._pendingEditorState=null,n._editorState=t,!i&&a&&h!==null){ne=n,te=t,de=!1,n._updating=!0;try{const S=n._dirtyType,P=n._dirtyElements,k=n._dirtyLeaves;h.disconnect(),g=ea(o,t,n,S,P,k)}catch(S){if(S instanceof Error&&n._onError(S),ci)throw S;return us(n,null,r,t),qi(n),n._dirtyType=gt,ci=!0,He(n,o),void(ci=!1)}finally{h.observe(r,Qo),n._updating=f,te=c,de=u,ne=d}}t._readOnly||(t._readOnly=!0);const m=n._dirtyLeaves,_=n._dirtyElements,x=n._normalizedNodes,v=n._updateTags,y=n._deferred;a&&(n._dirtyType=Qe,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),function(S,P){const k=S._decorators;let E=S._pendingDecorators||k;const M=P._nodeMap;let R;for(R in E)M.has(R)||(E===k&&(E=ro(S)),delete E[R])}(n,t);const C=i?null:Se(n._window);if(n._editable&&C!==null&&(a||l===null||l.dirty)){ne=n,te=t;try{if(h!==null&&h.disconnect(),a||l===null||l.dirty){const S=n._blockCursorElement;S!==null&&$r(S,n,r),fa(s,l,n,C,v,r)}Hl(n,r,l),h!==null&&h.observe(r,Qo)}finally{ne=d,te=c}}g!==null&&function(S,P,k,E,M){const R=Array.from(S._listeners.mutation),q=R.length;for(let H=0;H<q;H++){const[B,Y]=R[H],ce=P.get(Y);ce!==void 0&&B(ce,{dirtyLeaves:E,prevEditorState:M,updateTags:k})}}(n,g,v,m,o),O(l)||l===null||s!==null&&s.is(l)||n.dispatchCommand(dn,void 0);const T=n._pendingDecorators;T!==null&&(n._decorators=T,n._pendingDecorators=null,rn("decorator",n,!0,T)),function(S,P,k){const E=io(P),M=io(k);E!==M&&rn("textcontent",S,!0,M)}(n,e||o,t),rn("update",n,!0,{dirtyElements:_,dirtyLeaves:m,editorState:t,normalizedNodes:x,prevEditorState:e||o,tags:v}),function(S,P){if(S._deferred=[],P.length!==0){const k=S._updating;S._updating=!0;try{for(let E=0;E<P.length;E++)P[E]()}finally{S._updating=k}}}(n,y),function(S){const P=S._updates;if(P.length!==0){const k=P.shift();if(k){const[E,M]=k;ls(S,E,M)}}}(n)}function rn(n,e,t,...r){const i=e._updating;e._updating=t;try{const o=Array.from(e._listeners[n]);for(let s=0;s<o.length;s++)o[s].apply(null,r)}finally{e._updating=i}}function os(n,e,t){if(n._updating===!1||ne!==n){let i=!1;return n.update(()=>{i=os(n,e,t)}),i}const r=Dr(n);for(let i=4;i>=0;i--)for(let o=0;o<r.length;o++){const s=r[o]._commands.get(e);if(s!==void 0){const l=s[i];if(l!==void 0){const a=Array.from(l),c=a.length;for(let u=0;u<c;u++)if(a[u](t,n)===!0)return!0}}}return!1}function ss(n,e){const t=n._updates;let r=e||!1;for(;t.length!==0;){const i=t.shift();if(i){const[o,s]=i;let l,a;if(s!==void 0){if(l=s.onUpdate,a=s.tag,s.skipTransforms&&(r=!0),s.discrete){const c=n._pendingEditorState;c===null&&j(191),c._flushSync=!0}l&&n._deferred.push(l),a&&n._updateTags.add(a)}o()}}return r}function ls(n,e,t){const r=n._updateTags;let i,o,s=!1,l=!1;t!==void 0&&(i=t.onUpdate,o=t.tag,o!=null&&r.add(o),s=t.skipTransforms||!1,l=t.discrete||!1),i&&n._deferred.push(i);const a=n._editorState;let c=n._pendingEditorState,u=!1;(c===null||c._readOnly)&&(c=n._pendingEditorState=new Jn(new Map((c||a)._nodeMap)),u=!0),c._flushSync=l;const d=te,f=de,h=ne,g=n._updating;te=c,de=!1,n._updating=!0,ne=n;try{u&&(n._headless?a._selection!==null&&(c._selection=a._selection.clone()):c._selection=function(v){const y=v.getEditorState()._selection,C=Se(v._window);return O(y)||y==null?li(y,C,v,null):y.clone()}(n));const _=n._compositionKey;e(),s=ss(n,s),function(v,y){const C=y.getEditorState()._selection,T=v._selection;if(O(T)){const S=T.anchor,P=T.focus;let k;if(S.type==="text"&&(k=S.getNode(),k.selectionTransform(C,T)),P.type==="text"){const E=P.getNode();k!==E&&E.selectionTransform(C,T)}}}(c,n),n._dirtyType!==Qe&&(s?function(v,y){const C=y._dirtyLeaves,T=v._nodeMap;for(const S of C){const P=T.get(S);D(P)&&P.isAttached()&&P.isSimpleText()&&!P.isUnmergeable()&&Zi(P)}}(c,n):function(v,y){const C=y._dirtyLeaves,T=y._dirtyElements,S=v._nodeMap,P=We(),k=new Map;let E=C,M=E.size,R=T,q=R.size;for(;M>0||q>0;){if(M>0){y._dirtyLeaves=new Set;for(const H of E){const B=S.get(H);D(B)&&B.isAttached()&&B.isSimpleText()&&!B.isUnmergeable()&&Zi(B),B!==void 0&&rs(B,P)&&ns(y,B,k),C.add(H)}if(E=y._dirtyLeaves,M=E.size,M>0){Vn++;continue}}y._dirtyLeaves=new Set,y._dirtyElements=new Map;for(const H of R){const B=H[0],Y=H[1];if(B!=="root"&&!Y)continue;const ce=S.get(B);ce!==void 0&&rs(ce,P)&&ns(y,ce,k),T.set(B,Y)}E=y._dirtyLeaves,M=E.size,R=y._dirtyElements,q=R.size,Vn++}y._dirtyLeaves=C,y._dirtyElements=T}(c,n),ss(n),function(v,y,C,T){const S=v._nodeMap,P=y._nodeMap,k=[];for(const[E]of T){const M=P.get(E);M!==void 0&&(M.isAttached()||(b(M)&&yo(M,E,S,P,k,T),S.has(E)||T.delete(E),k.push(E)))}for(const E of k)P.delete(E);for(const E of C){const M=P.get(E);M===void 0||M.isAttached()||(S.has(E)||C.delete(E),P.delete(E))}}(a,c,n._dirtyLeaves,n._dirtyElements)),_!==n._compositionKey&&(c._flushSync=!0);const x=c._selection;if(O(x)){const v=c._nodeMap,y=x.anchor.key,C=x.focus.key;v.get(y)!==void 0&&v.get(C)!==void 0||j(19)}else be(x)&&x._nodes.size===0&&(c._selection=null)}catch(_){return _ instanceof Error&&n._onError(_),n._pendingEditorState=a,n._dirtyType=gt,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void He(n)}finally{te=d,de=f,ne=h,n._updating=g,Vn=0}n._dirtyType!==Qe||function(_,x){const v=x.getEditorState()._selection,y=_._selection;if(y!==null){if(y.dirty||!y.is(v))return!0}else if(v!==null)return!0;return!1}(c,n)?c._flushSync?(c._flushSync=!1,He(n)):u&&zl(()=>{He(n)}):(c._flushSync=!1,u&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function ge(n,e,t){n._updating?n._updates.push([e,t]):ls(n,e,t)}class on extends Rn{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return Ll[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const e=G()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;t!==null;){if(D(t)&&e.push(t),b(t)){const r=t.getAllTextNodes();e.push(...r)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;b(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;b(e);){const t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),r=t.length;if(e>=r){const o=t[r-1];return b(o)&&o.getLastDescendant()||o||null}const i=t[e];return b(i)&&i.getFirstDescendant()||i||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:se(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&j(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:se(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&j(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let r,i;if(e<t/2){for(r=this.getFirstChild(),i=0;r!==null&&i<=e;){if(i===e)return r;r=r.getNextSibling(),i++}return null}for(r=this.getLastChild(),i=t-1;r!==null&&i>=e;){if(i===e)return r;r=r.getPreviousSibling(),i--}return null}getTextContent(){let e="";const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const o=t[i];e+=o.getTextContent(),b(o)&&i!==r-1&&!o.isInline()&&(e+=Pe)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const o=t[i];e+=o.getTextContentSize(),b(o)&&i!==r-1&&!o.isInline()&&(e+=Pe.length)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(e!==""){const t=Ji[e];return!!(this.getFormat()&t)}return!1}select(e,t){he();const r=F();let i=e,o=t;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const a=this.getFirstChild();if(D(a)||b(a))return a.select(0,0)}else if(!(e!==void 0&&e!==s||t!==void 0&&t!==s)){const a=this.getLastChild();if(D(a)||b(a))return a.select()}}i===void 0&&(i=s),o===void 0&&(o=s);const l=this.__key;return O(r)?(r.anchor.set(l,i,"element"),r.focus.set(l,o,"element"),r.dirty=!0,r):qo(l,i,l,o,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach(t=>t.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==""?Ji[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,r){const i=r.length,o=this.getChildrenSize(),s=this.getWritable(),l=s.__key,a=[],c=[],u=this.getChildAtIndex(e+t);let d=null,f=o-t+i;if(e!==0)if(e===o)d=this.getLastChild();else{const g=this.getChildAtIndex(e);g!==null&&(d=g.getPreviousSibling())}if(t>0){let g=d===null?this.getFirstChild():d.getNextSibling();for(let m=0;m<t;m++){g===null&&j(100);const _=g.getNextSibling(),x=g.__key;et(g.getWritable()),c.push(x),g=_}}let h=d;for(let g=0;g<i;g++){const m=r[g];h!==null&&m.is(h)&&(d=h=h.getPreviousSibling());const _=m.getWritable();_.__parent===l&&f--,et(_);const x=m.__key;if(h===null)s.__first=x,_.__prev=null;else{const v=h.getWritable();v.__next=x,_.__prev=v.__key}m.__key===l&&j(76),_.__parent=l,a.push(x),h=m}if(e+t===o)h!==null&&(h.getWritable().__next=null,s.__last=h.__key);else if(u!==null){const g=u.getWritable();if(h!==null){const m=h.getWritable();g.__prev=h.__key,m.__next=u.__key}else g.__prev=null}if(s.__size=f,c.length){const g=F();if(O(g)){const m=new Set(c),_=new Set(a),{anchor:x,focus:v}=g;as(x,m,_)&&Un(x,x.getNode(),this,d,u),as(v,m,_)&&Un(v,v.getNode(),this,d,u),f!==0||this.canBeEmpty()||mt(this)||this.remove()}}return s}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,r){return!1}canMergeWhenEmpty(){return!1}}function b(n){return n instanceof on}function as(n,e,t){let r=n.getNode();for(;r;){const i=r.__key;if(e.has(i)&&!t.has(i))return!0;r=r.getParent()}return!1}class ma extends Rn{constructor(e){super(e)}decorate(e,t){j(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function U(n){return n instanceof ma}class sn extends on{static getType(){return"root"}static clone(){return new sn}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){j(51)}getTextContent(){const e=this.__cachedText;return!nn()&&G()._dirtyType!==Qe||e===null?super.getTextContent():e}remove(){j(52)}replace(e){j(53)}insertBefore(e){j(54)}insertAfter(e){j(55)}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const r=e[t];b(r)||U(r)||j(56)}return super.append(...e)}static importJSON(e){const t=Z();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function oe(n){return n instanceof sn}function fi(){return new Jn(new Map([["root",new sn]]))}function cs(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&j(130,t.name),b(n)){const r=e.children;Array.isArray(r)||j(59,t.name);const i=n.getChildren();for(let o=0;o<i.length;o++){const s=cs(i[o]);r.push(s)}}return e}class Jn{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return is(t&&t.editor||null,this,e)}clone(e){const t=new Jn(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return is(null,this,()=>({root:cs(Z())}))}}class di extends on{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class bt extends on{constructor(e){super(e),this.__textFormat=0,this.__textStyle=""}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=Oe[e];return!!(this.getTextFormat()&t)}getTextStyle(){return this.getLatest().__textStyle}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}static clone(e){return new bt(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),r=zt(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:_a,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Dn(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();t.style.textAlign=r;const i=this.getDirection();i&&(t.dir=i);const o=this.getIndent();o>0&&(t.style.textIndent=20*o+"px")}return{element:t}}static importJSON(e){const t=ke();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle(),type:"paragraph",version:1}}insertNewAfter(e,t){const r=ke();r.setTextFormat(e.format),r.setTextStyle(e.style);const i=this.getDirection();return r.setDirection(i),r.setFormat(this.getFormatType()),r.setStyle(this.getTextStyle()),this.insertAfter(r,t),r}collapseAtStart(){const e=this.getChildren();if(e.length===0||D(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function _a(n){const e=ke();if(n.style){e.setFormat(n.style.textAlign);const t=parseInt(n.style.textIndent,10)/20;t>0&&e.setIndent(t)}return{node:e}}function ke(){return Kt(new bt)}function hi(n){return n instanceof bt}const K=0,ya=4;function us(n,e,t,r){const i=n._keyToDOMMap;i.clear(),n._editorState=fi(),n._pendingEditorState=r,n._compositionKey=null,n._dirtyType=Qe,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),n._normalizedNodes=new Set,n._updateTags=new Set,n._updates=[],n._blockCursorElement=null;const o=n._observer;o!==null&&(o.disconnect(),n._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",i.set("root",t))}function va(n){const e=n||{},t=ga(),r=e.theme||{},i=n===void 0?t:e.parentEditor||null,o=e.disableEvents||!1,s=fi(),l=e.namespace||(i!==null?i._config.namespace:ao()),a=e.editorState,c=[sn,xt,Xt,Qt,bt,di,...e.nodes||[]],{onError:u,html:d}=e,f=e.editable===void 0||e.editable;let h;if(n===void 0&&t!==null)h=t._nodes;else{h=new Map;for(let m=0;m<c.length;m++){let _=c[m],x=null,v=null;if(typeof _!="function"){const S=_;_=S.replace,x=S.with,v=S.withKlass||null}const y=_.getType(),C=_.transform(),T=new Set;C!==null&&T.add(C),h.set(y,{exportDOM:d&&d.export?d.export.get(_):void 0,klass:_,replace:x,replaceWithKlass:v,transforms:T})}}const g=new Hn(s,i,h,{disableEvents:o,namespace:l,theme:r},u||console.error,function(m,_){const x=new Map,v=new Set,y=C=>{Object.keys(C).forEach(T=>{let S=x.get(T);S===void 0&&(S=[],x.set(T,S)),S.push(C[T])})};return m.forEach(C=>{const T=C.klass.importDOM;if(T==null||v.has(T))return;v.add(T);const S=T.call(C.klass);S!==null&&y(S)}),_&&y(_),x}(h,d?d.import:void 0),f);return a!==void 0&&(g._pendingEditorState=a,g._dirtyType=gt),g}class Hn{constructor(e,t,r,i,o,s,l){this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=i,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=Qe,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=ao(),this._onError=o,this._htmlConversions=s,this._editable=l,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,r){r===void 0&&j(35);const i=this._commands;i.has(e)||i.set(e,[new Set,new Set,new Set,new Set,new Set]);const o=i.get(e);o===void 0&&j(36,String(e));const s=o[r];return s.add(t),()=>{s.delete(t),o.every(l=>l.size===0)&&i.delete(e)}}registerMutationListener(e,t,r){const i=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,o=this._listeners.mutation;o.set(t,i);const s=r&&r.skipInitialization;return s===void 0||s||this.initializeMutationListener(t,i),()=>{o.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&j(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const r=this._editorState,i=Xl(r).get(t.getType());if(!i)return;const o=new Map;for(const s of i.keys())o.set(s,"created");o.size>0&&e(o,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const r=this.getRegisteredNode(e);return r.transforms.add(t),r}registerNodeTransform(e,t){const r=this.registerNodeTransformToKlass(e,t),i=[r],o=r.replaceWithKlass;if(o!=null){const a=this.registerNodeTransformToKlass(o,t);i.push(a)}var s,l;return s=this,l=e.getType(),ge(s,()=>{const a=Ae();if(a.isEmpty())return;if(l==="root")return void Z().markDirty();const c=a._nodeMap;for(const[,u]of c)u.markDirty()},s._pendingEditorState===null?{tag:"history-merge"}:void 0),()=>{i.forEach(a=>a.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return I(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const r=zt(this._config.theme,"root"),i=this._pendingEditorState||this._editorState;if(this._rootElement=e,us(this,t,e,i),t!==null&&(this._config.disableEvents||ta(t),r!=null&&t.classList.remove(...r)),e!==null){const o=function(l){const a=l.ownerDocument;return a&&a.defaultView||null}(e),s=e.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=o,this._dirtyType=gt,qi(this),this._updateTags.add("history-merge"),He(this),this._config.disableEvents||function(l,a){const c=l.ownerDocument,u=$n.get(c);(u===void 0||u<1)&&c.addEventListener("selectionchange",Ao),$n.set(c,(u||0)+1),l.__lexicalEditor=a;const d=jo(l);for(let f=0;f<Gr.length;f++){const[h,g]=Gr[f],m=typeof g=="function"?_=>{Fo(_)||(Io(_),(a.isEditable()||h==="click")&&g(_,a))}:_=>{if(Fo(_))return;Io(_);const x=a.isEditable();switch(h){case"cut":return x&&I(a,gr,_);case"copy":return I(a,_n,_);case"paste":return x&&I(a,fr,_);case"dragstart":return x&&I(a,Bi,_);case"dragover":return x&&I(a,zi,_);case"dragend":return x&&I(a,pl,_);case"focus":return x&&I(a,yl,_);case"blur":return x&&I(a,vl,_);case"drop":return x&&I(a,Ri,_)}};l.addEventListener(h,m),d.push(()=>{l.removeEventListener(h,m)})}}(e,this),r!=null&&e.classList.add(...r)}else this._editorState=i,this._pendingEditorState=null,this._window=null;rn("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&j(38),Yi(this);const r=this._pendingEditorState,i=this._updateTags,o=t!==void 0?t.tag:null;r===null||r.isEmpty()||(o!=null&&i.add(o),He(this)),this._pendingEditorState=e,this._dirtyType=gt,this._dirtyElements.set("root",!1),this._compositionKey=null,o!=null&&i.add(o),He(this)}parseEditorState(e,t){return function(r,i,o){const s=fi(),l=te,a=de,c=ne,u=i._dirtyElements,d=i._dirtyLeaves,f=i._cloneNotNeeded,h=i._dirtyType;i._dirtyElements=new Map,i._dirtyLeaves=new Set,i._cloneNotNeeded=new Set,i._dirtyType=0,te=s,de=!1,ne=i;try{const g=i._nodes;ui(r.root,g),o&&o(),s._readOnly=!0}catch(g){g instanceof Error&&i._onError(g)}finally{i._dirtyElements=u,i._dirtyLeaves=d,i._cloneNotNeeded=f,i._dirtyType=h,te=l,de=a,ne=c}return s}(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return He(this),this.getEditorState().read(e,{editor:this})}update(e,t){ge(this,e,t)}focus(e,t={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),ge(this,()=>{const i=F(),o=Z();i!==null?i.dirty=!0:o.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?o.selectStart():o.selectEnd())},{onUpdate:()=>{r.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=Se(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,rn("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}Hn.version="0.17.1+prod.esm";function xa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ba=xa(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const fs=L.createContext(null);function Ca(n,e){let t=null;return n!=null&&(t=n[1]),{getTheme:function(){return e??(t!=null?t.getTheme():null)}}}function ot(){const n=L.useContext(fs);return n==null&&ba(8),n}const ds=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,wa=ds?L.useLayoutEffect:L.useEffect,Yn={tag:"history-merge"};function Sa({initialConfig:n,children:e}){const t=L.useMemo(()=>{const{theme:r,namespace:i,nodes:o,onError:s,editorState:l,html:a}=n,c=Ca(null,r),u=va({editable:n.editable,html:a,namespace:i,nodes:o,onError:d=>s(d,u),theme:r});return function(d,f){if(f!==null){if(f===void 0)d.update(()=>{const h=Z();if(h.isEmpty()){const g=ke();h.append(g);const m=ds?document.activeElement:null;(F()!==null||m!==null&&m===d.getRootElement())&&g.select()}},Yn);else if(f!==null)switch(typeof f){case"string":{const h=d.parseEditorState(f);d.setEditorState(h,Yn);break}case"object":d.setEditorState(f,Yn);break;case"function":d.update(()=>{Z().isEmpty()&&f(d)},Yn)}}}(u,l),[u,c]},[]);return wa(()=>{const r=n.editable,[i]=t;i.setEditable(r===void 0||r)},[]),w.jsx(fs.Provider,{value:t,children:e})}function Ta({defaultSelection:n}){const[e]=ot();return L.useEffect(()=>{e.focus(()=>{const t=document.activeElement,r=e.getRootElement();r===null||t!==null&&r.contains(t)||r.focus({preventScroll:!0})},{defaultSelection:n})},[n,e]),null}function Ea(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ka=Ea(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const qn=new Map;function hs(n){const e={},t=n.split(";");for(const r of t)if(r!==""){const[i,o]=r.split(/:([^]+)/);i&&o&&(e[i.trim()]=o.trim())}return e}function gi(n){let e=qn.get(n);return e===void 0&&(e=hs(n),qn.set(n,e)),e}function gs(n,e){const t=n.getStartEndPoints();if(e.isSelected(n)&&!e.isSegmented()&&!e.isToken()&&t!==null){const[r,i]=t,o=n.isBackward(),s=r.getNode(),l=i.getNode(),a=e.is(s),c=e.is(l);if(a||c){const[u,d]=oi(n),f=s.is(l),h=e.is(o?l:s),g=e.is(o?s:l);let m,_=0;return f?(_=u>d?d:u,m=u>d?u:d):h?(_=o?d:u,m=void 0):g&&(_=0,m=o?u:d),e.__text=e.__text.slice(_,m),e}}return e}function ps(n){if(n.type==="text")return n.offset===n.getNode().getTextContentSize();const e=n.getNode();return b(e)||ka(177),n.offset===e.getChildrenSize()}function Na(n){const e=n.getStyle(),t=hs(e);qn.set(e,t)}function Ct(n,e){const t=gi("getStyle"in n?n.getStyle():n.style),r=Object.entries(e).reduce((o,[s,l])=>(typeof l=="function"?o[s]=l(t[s],n):l===null?delete o[s]:o[s]=l,o),{...t}),i=function(o){let s="";for(const l in o)l&&(s+=`${l}: ${o[l]};`);return s}(r);n.setStyle(i),qn.set(i,r)}function Pa(n,e){const t=n.getNodes(),r=t.length,i=n.getStartEndPoints();if(i===null)return;const[o,s]=i,l=r-1;let a=t[0],c=t[l];if(n.isCollapsed()&&O(n))return void Ct(n,e);const u=a.getTextContent().length,d=s.offset;let f=o.offset;const h=o.isBefore(s);let g=h?f:d,m=h?d:f;const _=h?o.type:s.type,x=h?s.type:o.type,v=h?s.key:o.key;if(D(a)&&g===u){const y=a.getNextSibling();D(y)&&(f=0,g=0,a=y)}if(t.length===1){if(D(a)&&a.canHaveFormat()){if(g=_==="element"?0:f>d?d:f,m=x==="element"?u:f>d?f:d,g===m)return;if(De(a)||g===0&&m===u)Ct(a,e),a.select(g,m);else{const y=a.splitText(g,m),C=g===0?y[0]:y[1];Ct(C,e),C.select(0,m-g)}}}else{if(D(a)&&g<a.getTextContentSize()&&a.canHaveFormat()&&(g===0||De(a)||(a=a.splitText(g)[1],g=0,h?o.set(a.getKey(),g,"text"):s.set(a.getKey(),g,"text")),Ct(a,e)),D(c)&&c.canHaveFormat()){const y=c.getTextContent().length;c.__key!==v&&m!==0&&(m=y),m===y||De(c)||([c]=c.splitText(m)),m===0&&x!=="element"||Ct(c,e)}for(let y=1;y<l;y++){const C=t[y],T=C.getKey();D(C)&&C.canHaveFormat()&&T!==a.getKey()&&T!==c.getKey()&&!C.isToken()&&Ct(C,e)}}}function ms(n,e){const t=Wt(n.focus,e);return U(t)&&!t.isIsolated()||b(t)&&!t.isInline()&&!t.canBeEmpty()}function Oa(n,e,t,r){n.modify(e?"extend":"move",t,r)}function _s(n){const e=n.anchor.getNode();return(oe(e)?e:e.getParentOrThrow()).getDirection()==="rtl"}function ys(n,e,t){const r=_s(n);Oa(n,e,t?!r:r,"character")}function Da(n,e,t){const r=gi(n.getStyle());return r!==null&&r[e]||t}function La(n,e,t=""){let r=null;const i=n.getNodes(),o=n.anchor,s=n.focus,l=n.isBackward(),a=l?s.offset:o.offset,c=l?s.getNode():o.getNode();if(O(n)&&n.isCollapsed()&&n.style!==""){const u=gi(n.style);if(u!==null&&e in u)return u[e]}for(let u=0;u<i.length;u++){const d=i[u];if((u===0||a!==0||!d.is(c))&&D(d)){const f=Da(d,e,t);if(r===null)r=f;else if(r!==f){r="";break}}}return r===null?t:r}function ja(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Aa=ja(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const vs=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Ia=vs&&"documentMode"in document?document.documentMode:null;!(!vs||!("InputEvent"in window)||Ia)&&"getTargetRanges"in new window.InputEvent("input");function Fa(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}function wt(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}function Ma(n,...e){const t=Fa(...e);t.length>0&&n.classList.add(...t)}function $a(n){const e=Gn(n,t=>b(t)&&!t.isInline());return b(e)||Aa(4,n.__key),e}const Gn=(n,e)=>{let t=n;for(;t!==Z()&&t!=null;){if(e(t))return t;t=t.getParent()}return null};function st(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}const Xn=0,pi=1,mi=2,Ce=0,Ra=1,xs=2,Ba=3,za=4;function Wa(n,e,t,r,i){if(n===null||t.size===0&&r.size===0&&!i)return Ce;const o=e._selection,s=n._selection;if(i)return Ra;if(!(O(o)&&O(s)&&s.isCollapsed()&&o.isCollapsed()))return Ce;const l=function(x,v,y){const C=x._nodeMap,T=[];for(const S of v){const P=C.get(S);P!==void 0&&T.push(P)}for(const[S,P]of y){if(!P)continue;const k=C.get(S);k===void 0||oe(k)||T.push(k)}return T}(e,t,r);if(l.length===0)return Ce;if(l.length>1){const x=e._nodeMap,v=x.get(o.anchor.key),y=x.get(s.anchor.key);return v&&y&&!n._nodeMap.has(v.__key)&&D(v)&&v.__text.length===1&&o.anchor.offset===1?xs:Ce}const a=l[0],c=n._nodeMap.get(a.__key);if(!D(c)||!D(a)||c.__mode!==a.__mode)return Ce;const u=c.__text,d=a.__text;if(u===d)return Ce;const f=o.anchor,h=s.anchor;if(f.key!==h.key||f.type!=="text")return Ce;const g=f.offset,m=h.offset,_=d.length-u.length;return _===1&&m===g-1?xs:_===-1&&m===g+1?Ba:_===-1&&m===g?za:Ce}function Ka(n,e){let t=Date.now(),r=Ce;return(i,o,s,l,a,c)=>{const u=Date.now();if(c.has("historic"))return r=Ce,t=u,mi;const d=Wa(i,o,l,a,n.isComposing()),f=(()=>{const h=s===null||s.editor===n,g=c.has("history-push");if(!g&&h&&c.has("history-merge"))return Xn;if(i===null)return pi;const m=o._selection;return l.size>0||a.size>0?g===!1&&d!==Ce&&d===r&&u<t+e&&h||l.size===1&&function(_,x,v){const y=x._nodeMap.get(_),C=v._nodeMap.get(_),T=x._selection,S=v._selection;return!(O(T)&&O(S)&&T.anchor.type==="element"&&T.focus.type==="element"&&S.anchor.type==="text"&&S.focus.type==="text"||!D(y)||!D(C)||y.__parent!==C.__parent)&&JSON.stringify(x.read(()=>y.exportJSON()))===JSON.stringify(v.read(()=>C.exportJSON()))}(Array.from(l)[0],i,o)?Xn:pi:m!==null?Xn:mi})();return t=u,r=d,f}}function bs(n){n.undoStack=[],n.redoStack=[],n.current=null}function Ua(n,e,t){const r=Ka(n,t);return wt(n.registerCommand(gn,()=>(function(o,s){const l=s.redoStack,a=s.undoStack;if(a.length!==0){const c=s.current,u=a.pop();c!==null&&(l.push(c),o.dispatchCommand(At,!0)),a.length===0&&o.dispatchCommand(It,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),K),n.registerCommand(pn,()=>(function(o,s){const l=s.redoStack,a=s.undoStack;if(l.length!==0){const c=s.current;c!==null&&(a.push(c),o.dispatchCommand(It,!0));const u=l.pop();l.length===0&&o.dispatchCommand(At,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),K),n.registerCommand(ml,()=>(bs(e),!1),K),n.registerCommand(_l,()=>(bs(e),n.dispatchCommand(At,!1),n.dispatchCommand(It,!1),!0),K),n.registerUpdateListener(({editorState:o,prevEditorState:s,dirtyLeaves:l,dirtyElements:a,tags:c})=>{const u=e.current,d=e.redoStack,f=e.undoStack,h=u===null?null:u.editorState;if(u!==null&&o===h)return;const g=r(s,o,u,l,a,c);if(g===pi)d.length!==0&&(e.redoStack=[],n.dispatchCommand(At,!1)),u!==null&&(f.push({...u}),n.dispatchCommand(It,!0));else if(g===mi)return;e.current={editor:n,editorState:o}}))}function Va(){return{current:null,redoStack:[],undoStack:[]}}function Ja({delay:n,externalHistoryState:e}){const[t]=ot();return function(r,i,o=1e3){const s=L.useMemo(()=>i||Va(),[i]);L.useEffect(()=>Ua(r,s,o),[o,r,s])}(t,e,n),null}const Ha=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?L.useLayoutEffect:L.useEffect;function Ya(n){return{initialValueFn:()=>n.isEditable(),subscribe:e=>n.registerEditableListener(e)}}function qa(){return function(n){const[e]=ot(),t=L.useMemo(()=>n(e),[e,n]),r=L.useRef(t.initialValueFn()),[i,o]=L.useState(r.current);return Ha(()=>{const{initialValueFn:s,subscribe:l}=t,a=s();return r.current!==a&&(r.current=a,o(a)),l(c=>{r.current=c,o(c)})},[t,n]),i}(Ya)}function Ga(){return Z().getTextContent()}function Xa(n,e=!0){if(n)return!1;let t=Ga();return e&&(t=t.trim()),t===""}function Za(n){if(!Xa(n,!1))return!1;const e=Z().getChildren(),t=e.length;if(t>1)return!1;for(let r=0;r<t;r++){const i=e[r];if(U(i))return!1;if(b(i)){if(!hi(i)||i.__indent!==0)return!1;const o=i.getChildren(),s=o.length;for(let l=0;l<s;l++){const a=o[r];if(!D(a))return!1}}}return!0}function Cs(n){return()=>Za(n)}function Qa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}Qa(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function ec(n){const e=window.location.origin,t=r=>{if(r.origin!==e)return;const i=n.getRootElement();if(document.activeElement!==i)return;const o=r.data;if(typeof o=="string"){let s;try{s=JSON.parse(o)}catch{return}if(s&&s.protocol==="nuanria_messaging"&&s.type==="request"){const l=s.payload;if(l&&l.functionId==="makeChanges"){const a=l.args;if(a){const[c,u,d,f,h,g]=a;n.update(()=>{const m=F();if(O(m)){const _=m.anchor;let x=_.getNode(),v=0,y=0;if(D(x)&&c>=0&&u>=0&&(v=c,y=c+u,m.setTextNodeRange(x,v,x,y)),v===y&&d===""||(m.insertRawText(d),x=_.getNode()),D(x)){v=f,y=f+h;const C=x.getTextContentSize();v=v>C?C:v,y=y>C?C:y,m.setTextNodeRange(x,v,x,y)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}function tc(n,e){const t=e.body?e.body.childNodes:[];let r=[];const i=[];for(let o=0;o<t.length;o++){const s=t[o];if(!Ss.has(s.nodeName)){const l=Ts(s,n,i,!1);l!==null&&(r=r.concat(l))}}return function(o){for(const s of o)s.getNextSibling()instanceof di&&s.insertAfter(it());for(const s of o){const l=s.getChildren();for(const a of l)s.insertBefore(a);s.remove()}}(i),r}function nc(n,e){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const t=document.createElement("div"),r=Z().getChildren();for(let i=0;i<r.length;i++)ws(n,r[i],t,e);return t.innerHTML}function ws(n,e,t,r=null){let i=r===null||e.isSelected(r);const o=b(e)&&e.excludeFromCopy("html");let s=e;if(r!==null){let h=zr(e);h=D(h)&&r!==null?gs(r,h):h,s=h}const l=b(s)?s.getChildren():[],a=n._nodes.get(s.getType());let c;c=a&&a.exportDOM!==void 0?a.exportDOM(n,s):s.exportDOM(n);const{element:u,after:d}=c;if(!u)return!1;const f=document.createDocumentFragment();for(let h=0;h<l.length;h++){const g=l[h],m=ws(n,g,f,r);!i&&b(e)&&m&&e.extractWithChild(g,r,"html")&&(i=!0)}if(i&&!o){if(Dn(u)&&u.append(f),t.append(u),d){const h=d.call(s,u);h&&u.replaceWith(h)}}else t.append(f);return i}const Ss=new Set(["STYLE","SCRIPT"]);function Ts(n,e,t,r,i=new Map,o){let s=[];if(Ss.has(n.nodeName))return s;let l=null;const a=function(g,m){const{nodeName:_}=g,x=m._htmlConversions.get(_.toLowerCase());let v=null;if(x!==void 0)for(const y of x){const C=y(g);C!==null&&(v===null||(v.priority||0)<(C.priority||0))&&(v=C)}return v!==null?v.conversion:null}(n,e),c=a?a(n):null;let u=null;if(c!==null){u=c.after;const g=c.node;if(l=Array.isArray(g)?g[g.length-1]:g,l!==null){for(const[,m]of i)if(l=m(l,o),!l)break;l&&s.push(...Array.isArray(g)?g:[l])}c.forChild!=null&&i.set(n.nodeName,c.forChild)}const d=n.childNodes;let f=[];const h=(l==null||!mt(l))&&(l!=null&&si(l)||r);for(let g=0;g<d.length;g++)f.push(...Ts(d[g],e,t,h,new Map(i),l));return u!=null&&(f=u(f)),Ln(n)&&(f=rc(n,f,h?()=>{const g=new di;return t.push(g),g}:ke)),l==null?f.length>0?s=s.concat(f):Ln(n)&&function(g){return g.nextSibling==null||g.previousSibling==null?!1:Rr(g.nextSibling)&&Rr(g.previousSibling)}(n)&&(s=s.concat(it())):b(l)&&l.append(...f),s}function rc(n,e,t){const r=n.style.textAlign,i=[];let o=[];for(let s=0;s<e.length;s++){const l=e[s];if(si(l))r&&!l.getFormat()&&l.setFormat(r),i.push(l);else if(o.push(l),s===e.length-1||s<e.length-1&&si(e[s+1])){const a=t();a.setFormat(r),a.append(...o),i.push(a),o=[]}}return i}function ic(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Zn=ic(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const oc=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Es=n=>oc?(n||window).getSelection():null;function sc(n,e=F()){return e==null&&Zn(166),O(e)&&e.isCollapsed()||e.getNodes().length===0?"":nc(n,e)}function lc(n,e=F()){return e==null&&Zn(166),O(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(ac(n,e))}function ks(n,e,t){const r=n.getData("application/x-lexical-editor");if(r)try{const s=JSON.parse(r);if(s.namespace===t._config.namespace&&Array.isArray(s.nodes))return Ns(t,cc(s.nodes),e)}catch{}const i=n.getData("text/html");if(i)try{const s=new DOMParser().parseFromString(i,"text/html");return Ns(t,tc(t,s),e)}catch{}const o=n.getData("text/plain")||n.getData("text/uri-list");if(o!=null)if(O(e)){const s=o.split(/(\r?\n|\t)/);s[s.length-1]===""&&s.pop();for(let l=0;l<s.length;l++){const a=F();if(O(a)){const c=s[l];c===`
40
40
  `||c===`\r
41
- `?a.insertParagraph():c===" "?a.insertNodes([en()]):a.insertText(c)}}}else e.insertRawText(o)}function Ns(n,e,t){n.dispatchCommand(al,{nodes:e,selection:t})||t.insertNodes(e)}function Ps(n,e,t,r=[]){let i=e===null||t.isSelected(e);const o=b(t)&&t.excludeFromCopy("html");let s=t;if(e!==null){let c=Br(t);c=D(c)&&e!==null?gs(e,c):c,s=c}const l=b(s)?s.getChildren():[],a=function(c){const u=c.exportJSON(),d=c.constructor;if(u.type!==d.getType()&&Zn(58,d.name),b(c)){const f=u.children;Array.isArray(f)||Zn(59,d.name)}return u}(s);if(D(s)){const c=s.__text;c.length>0?a.text=c:i=!1}for(let c=0;c<l.length;c++){const u=l[c],d=Ps(n,e,u,a.children);!i&&b(t)&&d&&t.extractWithChild(u,e,"clone")&&(i=!0)}if(i&&!o)r.push(a);else if(Array.isArray(a.children))for(let c=0;c<a.children.length;c++){const u=a.children[c];r.push(u)}return i}function ac(n,e){const t=[],r=Z().getChildren();for(let i=0;i<r.length;i++)Ps(n,e,r[i],t);return{namespace:n._config.namespace,nodes:t}}function cc(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=pa(r);D(i)&&Na(i),e.push(i)}return e}let wt=null;async function Os(n,e,t){if(wt!==null)return!1;if(e!==null)return new Promise((a,c)=>{n.update(()=>{a(Ds(n,e,t))})});const r=n.getRootElement(),i=n._window==null?window.document:n._window.document,o=Es(n._window);if(r===null||o===null)return!1;const s=i.createElement("span");s.style.cssText="position: fixed; top: -1000px;",s.append(i.createTextNode("#")),r.append(s);const l=new Range;return l.setStart(s,0),l.setEnd(s,1),o.removeAllRanges(),o.addRange(l),new Promise((a,c)=>{const u=n.registerCommand(_n,d=>(ot(d,ClipboardEvent)&&(u(),wt!==null&&(window.clearTimeout(wt),wt=null),a(Ds(n,d,t))),!0),ya);wt=window.setTimeout(()=>{u(),wt=null,a(!1)},50),i.execCommand("copy"),s.remove()})}function Ds(n,e,t){if(t===void 0){const i=Es(n._window);if(!i)return!1;const o=i.anchorNode,s=i.focusNode;if(o!==null&&s!==null&&!Mt(n,o,s))return!1;const l=F();if(l===null)return!1;t=fc(l)}e.preventDefault();const r=e.clipboardData;return r!==null&&(dc(r,t),!0)}const uc=[["text/html",sc],["application/x-lexical-editor",lc]];function fc(n=F()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=ql();for(const[r,i]of uc){const o=i(t,n);o!==null&&(e[r]=o)}}return e}function dc(n,e){for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}function Ls(n,e){if(document.caretRangeFromPoint!==void 0){const t=document.caretRangeFromPoint(n,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const t=document.caretPositionFromPoint(n,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}return null}const St=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,hc=St&&"documentMode"in document?document.documentMode:null,gc=!(!St||!("InputEvent"in window)||hc)&&"getTargetRanges"in new window.InputEvent("input"),pc=St&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),mc=St&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,_c=St&&/^(?=.*Chrome).*/i.test(navigator.userAgent),yc=St&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!_c,js=ll();function Qn(n){let e=null;if(ot(n,DragEvent)?e=n.dataTransfer:ot(n,ClipboardEvent)&&(e=n.clipboardData),e===null)return[!1,[],!1];const t=e.types,r=t.includes("Files"),i=t.includes("text/html")||t.includes("text/plain");return[r,Array.from(e.files),i]}function As(n){const e=F();if(!O(e))return!1;const t=new Set,r=e.getNodes();for(let i=0;i<r.length;i++){const o=r[i],s=o.getKey();if(t.has(s))continue;const l=Gn(o,c=>b(c)&&!c.isInline());if(l===null)continue;const a=l.getKey();l.canIndent()&&!t.has(a)&&(t.add(a),n(l))}return t.size>0}function er(n){const e=et(n);return U(e)}function vc(n){return Ct(n.registerCommand(Oi,e=>{const t=F();return!!be(t)&&(t.clear(),!0)},0),n.registerCommand(Xe,e=>{const t=F();return!!O(t)&&(t.deleteCharacter(e),!0)},K),n.registerCommand(Lt,e=>{const t=F();return!!O(t)&&(t.deleteWord(e),!0)},K),n.registerCommand(jt,e=>{const t=F();return!!O(t)&&(t.deleteLine(e),!0)},K),n.registerCommand(dt,e=>{const t=F();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const r=e.dataTransfer;if(r!=null)ks(r,t,n);else if(O(t)){const i=e.data;return i&&t.insertText(i),!0}}return!0},K),n.registerCommand(dr,()=>{const e=F();return!!O(e)&&(e.removeText(),!0)},K),n.registerCommand(fe,e=>{const t=F();return!!O(t)&&(t.formatText(e),!0)},K),n.registerCommand(me,e=>{const t=F();if(!O(t)&&!be(t))return!1;const r=t.getNodes();for(const i of r){const o=Gn(i,s=>b(s)&&!s.isInline());o!==null&&o.setFormat(e)}return!0},K),n.registerCommand(ft,e=>{const t=F();return!!O(t)&&(t.insertLineBreak(e),!0)},K),n.registerCommand(hn,()=>{const e=F();return!!O(e)&&(e.insertParagraph(),!0)},K),n.registerCommand(gl,()=>(da([en()]),!0),K),n.registerCommand($i,()=>As(e=>{const t=e.getIndent();e.setIndent(t+1)}),K),n.registerCommand(hr,()=>As(e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}),K),n.registerCommand(ji,e=>{const t=F();if(be(t)&&!er(e.target)){const r=t.getNodes();if(r.length>0)return r[0].selectPrevious(),!0}else if(O(t)){const r=zt(t.focus,!0);if(!e.shiftKey&&U(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},K),n.registerCommand(Ai,e=>{const t=F();if(be(t)){const r=t.getNodes();if(r.length>0)return r[0].selectNext(0,0),!0}else if(O(t)){if(function(i){const o=i.focus;return o.key==="root"&&o.offset===Z().getChildrenSize()}(t))return e.preventDefault(),!0;const r=zt(t.focus,!1);if(!e.shiftKey&&U(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},K),n.registerCommand(Li,e=>{const t=F();if(be(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}if(!O(t))return!1;if(ms(t,!0)){const r=e.shiftKey;return e.preventDefault(),ys(t,r,!0),!0}return!1},K),n.registerCommand(Di,e=>{const t=F();if(be(t)&&!er(e.target)){const i=t.getNodes();if(i.length>0)return e.preventDefault(),i[0].selectNext(0,0),!0}if(!O(t))return!1;const r=e.shiftKey;return!!ms(t,!1)&&(e.preventDefault(),ys(t,r,!1),!0)},K),n.registerCommand(Ii,e=>{if(er(e.target))return!1;const t=F();if(!O(t))return!1;e.preventDefault();const{anchor:r}=t,i=r.getNode();return t.isCollapsed()&&r.offset===0&&!oe(i)&&$a(i).getIndent()>0?n.dispatchCommand(hr,void 0):n.dispatchCommand(Xe,!0)},K),n.registerCommand(Mi,e=>{if(er(e.target))return!1;const t=F();return!!O(t)&&(e.preventDefault(),n.dispatchCommand(Xe,!1))},K),n.registerCommand(mn,e=>{const t=F();if(!O(t))return!1;if(e!==null){if((mc||pc||yc)&&gc)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(ft,!1)}return n.dispatchCommand(hn,void 0)},K),n.registerCommand(Fi,()=>{const e=F();return!!O(e)&&(n.blur(),!0)},K),n.registerCommand(Ri,e=>{const[,t]=Qn(e);if(t.length>0){const i=Ls(e.clientX,e.clientY);if(i!==null){const{offset:o,node:s}=i,l=et(s);if(l!==null){const a=ua();if(D(l))a.anchor.set(l.getKey(),o,"text"),a.focus.set(l.getKey(),o,"text");else{const u=l.getParentOrThrow().getKey(),d=l.getIndexWithinParent()+1;a.anchor.set(u,d,"element"),a.focus.set(u,d,"element")}const c=Qi(a);we(c)}n.dispatchCommand(js,t)}return e.preventDefault(),!0}const r=F();return!!O(r)},K),n.registerCommand(Wi,e=>{const[t]=Qn(e),r=F();return!(t&&!O(r))},K),n.registerCommand(Bi,e=>{const[t]=Qn(e),r=F();if(t&&!O(r))return!1;const i=Ls(e.clientX,e.clientY);if(i!==null){const o=et(i.node);U(o)&&e.preventDefault()}return!0},K),n.registerCommand(pr,()=>(Vl(),!0),K),n.registerCommand(_n,e=>(Os(n,ot(e,ClipboardEvent)?e:null),!0),K),n.registerCommand(gr,e=>(async function(t,r){await Os(r,ot(t,ClipboardEvent)?t:null),r.update(()=>{const i=F();O(i)?i.removeText():be(i)&&i.getNodes().forEach(o=>o.remove())})}(e,n),!0),K),n.registerCommand(fr,e=>{const[,t,r]=Qn(e);return t.length>0&&!r?(n.dispatchCommand(js,t),!0):Nr(e.target)?!1:F()!==null&&(function(i,o){i.preventDefault(),o.update(()=>{const s=F(),l=ot(i,InputEvent)||ot(i,KeyboardEvent)?null:i.clipboardData;l!=null&&s!==null&&ks(l,s,o)},{tag:"paste"})}(e,n),!0)},K))}const _i=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?L.useLayoutEffect:L.useEffect;function Is(n){return n.getEditorState().read(Cs(n.isComposing()))}function xc({contentEditable:n,placeholder:e=null,ErrorBoundary:t}){const[r]=it(),i=function(o,s){const[l,a]=L.useState(()=>o.getDecorators());return _i(()=>o.registerDecoratorListener(c=>{lr.flushSync(()=>{a(c)})}),[o]),L.useEffect(()=>{a(o.getDecorators())},[o]),L.useMemo(()=>{const c=[],u=Object.keys(l);for(let d=0;d<u.length;d++){const f=u[d],h=w.jsx(s,{onError:m=>o._onError(m),children:w.jsx(L.Suspense,{fallback:null,children:l[f]})}),g=o.getElementByKey(f);g!==null&&c.push(lr.createPortal(h,g,f))}return c},[s,l,o])}(r,t);return function(o){_i(()=>Ct(vc(o),ec(o)),[o])}(r),w.jsxs(w.Fragment,{children:[n,w.jsx(bc,{content:e}),i]})}function bc({content:n}){const[e]=it(),t=function(i){const[o,s]=L.useState(()=>Is(i));return _i(()=>{function l(){const a=Is(i);s(a)}return l(),Ct(i.registerUpdateListener(()=>{l()}),i.registerEditableListener(()=>{l()}))},[i]),o}(e),r=qa();return t?typeof n=="function"?n(r):n:null}function yi(n,e){return yi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},yi(n,e)}var Fs={error:null},Cc=function(n){var e,t;function r(){for(var o,s=arguments.length,l=new Array(s),a=0;a<s;a++)l[a]=arguments[a];return(o=n.call.apply(n,[this].concat(l))||this).state=Fs,o.resetErrorBoundary=function(){for(var c,u=arguments.length,d=new Array(u),f=0;f<u;f++)d[f]=arguments[f];o.props.onReset==null||(c=o.props).onReset.apply(c,d),o.reset()},o}t=n,(e=r).prototype=Object.create(t.prototype),e.prototype.constructor=e,yi(e,t),r.getDerivedStateFromError=function(o){return{error:o}};var i=r.prototype;return i.reset=function(){this.setState(Fs)},i.componentDidCatch=function(o,s){var l,a;(l=(a=this.props).onError)==null||l.call(a,o,s)},i.componentDidUpdate=function(o,s){var l,a,c,u,d=this.state.error,f=this.props.resetKeys;d!==null&&s.error!==null&&((c=o.resetKeys)===void 0&&(c=[]),(u=f)===void 0&&(u=[]),c.length!==u.length||c.some(function(h,g){return!Object.is(h,u[g])}))&&((l=(a=this.props).onResetKeysChange)==null||l.call(a,o.resetKeys,f),this.reset())},i.render=function(){var o=this.state.error,s=this.props,l=s.fallbackRender,a=s.FallbackComponent,c=s.fallback;if(o!==null){var u={error:o,resetErrorBoundary:this.resetErrorBoundary};if(Re.isValidElement(c))return c;if(typeof l=="function")return l(u);if(a)return Re.createElement(a,u);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},r}(Re.Component);function wc({children:n,onError:e}){return w.jsx(Cc,{fallback:w.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:n})}const Sc=L.createContext({margin:{bottom:"",left:"",right:"",top:""},pageMarginValue:"",updateCustomMargin:(n,e)=>{},updatePageMarginValue:n=>{}}),Tc=()=>L.useContext(Sc),Su="",st=8,lt=72,Ec=16;function kc({selectionFontSize:n,editor:e}){const[t,r]=Re.useState(n),i=(a,c)=>{if(!c)return a;let u=a;switch(c){case 2:switch(!0){case a>lt:u=lt;break;case a>=48:u-=12;break;case a>=24:u-=4;break;case a>=14:u-=2;break;case a>=9:u-=1;break;default:u=st;break}break;case 1:switch(!0){case a<st:u=st;break;case a<12:u+=1;break;case a<20:u+=2;break;case a<36:u+=4;break;case a<=60:u+=12;break;default:u=lt;break}break}return u},o=Re.useCallback((a,c)=>{const u=d=>(d||(d=`${Ec}px`),d=d.slice(0,-2),`${i(Number(d),c)}px`);e.update(()=>{if(e.isEditable()){const d=F();d!==null&&Pa(d,{"font-size":a||u})}})},[e]),s=a=>{const c=Number(t);if(["e","E","+","-"].includes(a.key)||isNaN(c)){a.preventDefault(),r("");return}if(a.key==="Enter"){a.preventDefault();let u=c;c>lt?u=lt:c<st&&(u=st),r(String(u)),o(String(u)+"px",null)}},l=a=>{if(t!==""){const c=i(Number(t),a);o(String(c)+"px",null)}else o(null,a)};return Re.useEffect(()=>{r(n)},[n]),w.jsxs(w.Fragment,{children:[w.jsx("button",{type:"button",disabled:n!==""&&Number(t)<=st,onClick:()=>l(2),className:"toolbar-item font-decrement",children:w.jsx("i",{className:"format minus-icon"})}),w.jsx("input",{type:"number",value:t,className:"toolbar-item font-size-input",min:st,max:lt,onChange:a=>r(a.target.value),onKeyDown:s}),w.jsx("button",{type:"button",disabled:n!==""&&Number(t)>=lt,onClick:()=>l(1),className:"toolbar-item font-increment",children:w.jsx("i",{className:"format add-icon"})})]})}const Nc=new Set(["http:","https:","mailto:","sms:","tel:"]);class tr extends on{static getType(){return"link"}static clone(e){return new tr(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e,t={},r){super(r);const{target:i=null,rel:o=null,title:s=null}=t;this.__url=e,this.__target=i,this.__rel=o,this.__title=s}createDOM(e){const t=document.createElement("a");return t.href=this.sanitizeUrl(this.__url),this.__target!==null&&(t.target=this.__target),this.__rel!==null&&(t.rel=this.__rel),this.__title!==null&&(t.title=this.__title),Ma(t,e.theme.link),t}updateDOM(e,t,r){if(t instanceof HTMLAnchorElement){const i=this.__url,o=this.__target,s=this.__rel,l=this.__title;i!==e.__url&&(t.href=i),o!==e.__target&&(o?t.target=o:t.removeAttribute("target")),s!==e.__rel&&(s?t.rel=s:t.removeAttribute("rel")),l!==e.__title&&(l?t.title=l:t.removeAttribute("title"))}return!1}static importDOM(){return{a:e=>({conversion:Pc,priority:1})}}static importJSON(e){const t=vi(e.url,{rel:e.rel,target:e.target,title:e.title});return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}sanitizeUrl(e){try{const t=new URL(e);if(!Nc.has(t.protocol))return"about:blank"}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(e){this.getWritable().__url=e}getTarget(){return this.getLatest().__target}setTarget(e){this.getWritable().__target=e}getRel(){return this.getLatest().__rel}setRel(e){this.getWritable().__rel=e}getTitle(){return this.getLatest().__title}setTitle(e){this.getWritable().__title=e}insertNewAfter(e,t=!0){const r=vi(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,t),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,r){if(!O(t))return!1;const i=t.anchor.getNode(),o=t.focus.getNode();return this.isParentOf(i)&&this.isParentOf(o)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function Pc(n){let e=null;if(Yl(n)){const t=n.textContent;(t!==null&&t!==""||n.children.length>0)&&(e=vi(n.getAttribute("href")||"",{rel:n.getAttribute("rel"),target:n.getAttribute("target"),title:n.getAttribute("title")}))}return{node:e}}function vi(n,e){return Kt(new tr(n,e))}function Oc(n){return n instanceof tr}function Dc(n){const e=n.anchor,t=n.focus,r=n.anchor.getNode(),i=n.focus.getNode();return r===i?r:n.isBackward()?ps(t)?r:i:ps(e)?r:i}function Lc(){return w.jsx("div",{className:"divider"})}const Ms=Re.createContext(null),$s=4;function Ye({children:n,className:e,onClick:t,title:r}){const i=L.useRef(null),o=Re.useContext(Ms);if(o===null)throw new Error("DropDownItem must be used within a DropDown");const{registerItem:s}=o;return L.useEffect(()=>{i&&i.current&&s(i)},[i,s]),w.jsx("button",{className:e,onClick:t,ref:i,title:r,type:"button",children:n})}function jc({children:n,dropDownRef:e,onClose:t}){const[r,i]=L.useState(),[o,s]=L.useState(),l=L.useCallback(u=>{i(d=>d?[...d,u]:[u])},[i]),a=u=>{if(!r)return;const d=u.key;["Escape","ArrowUp","ArrowDown","Tab"].includes(d)&&u.preventDefault(),d==="Escape"||d==="Tab"?t():d==="ArrowUp"?s(f=>{if(!f)return r[0];const h=r.indexOf(f)-1;return r[h===-1?r.length-1:h]}):d==="ArrowDown"&&s(f=>f?r[r.indexOf(f)+1]:r[0])},c=L.useMemo(()=>({registerItem:l}),[l]);return L.useEffect(()=>{r&&!o&&s(r[0]),o&&o.current&&o.current.focus()},[r,o]),w.jsx(Ms.Provider,{value:c,children:w.jsx("div",{className:"dropdown",ref:e,onKeyDown:a,children:n})})}function Ac({disabled:n=!1,buttonLabel:e,buttonAriaLabel:t,buttonClassName:r,buttonIconClassName:i,children:o,stopCloseOnClickSelf:s}){const l=L.useRef(null),a=L.useRef(null),[c,u]=L.useState(!1),d=()=>{u(!1),a&&a.current&&a.current.focus()};return L.useEffect(()=>{const f=a.current,h=l.current;if(c&&f!==null&&h!==null){const{top:g,left:m}=f.getBoundingClientRect();h.style.top=`${g+f.offsetHeight+$s}px`,h.style.left=`${Math.min(m,window.innerWidth-h.offsetWidth-20)}px`}},[l,a,c]),L.useEffect(()=>{const f=a.current;if(f!==null&&c){const h=g=>{const m=g.target;s&&l.current&&l.current.contains(m)||f.contains(m)||u(!1)};return document.addEventListener("click",h),()=>{document.removeEventListener("click",h)}}},[l,a,c,s]),L.useEffect(()=>{const f=()=>{if(c){const h=a.current,g=l.current;if(h!==null&&g!==null){const{top:m}=h.getBoundingClientRect(),_=m+h.offsetHeight+$s;_!==g.getBoundingClientRect().top&&(g.style.top=`${_}px`)}}};return document.addEventListener("scroll",f),()=>{document.removeEventListener("scroll",f)}},[a,l,c]),w.jsxs(w.Fragment,{children:[w.jsxs("button",{type:"button",disabled:n,"aria-label":t||e,className:r,onClick:()=>u(!c),ref:a,children:[i&&w.jsx("span",{className:i}),e&&w.jsx("span",{className:"text dropdown-button-text",children:e}),w.jsx("i",{className:"chevron-down"})]}),c&&lr.createPortal(w.jsx(jc,{dropDownRef:l,onClose:d,children:o}),document.body)]})}const ln={center:{icon:"center-align",iconRTL:"center-align",name:"Center Align"},end:{icon:"right-align",iconRTL:"left-align",name:"End Align"},justify:{icon:"justify-align",iconRTL:"justify-align",name:"Justify Align"},left:{icon:"left-align",iconRTL:"left-align",name:"Left Align"},right:{icon:"right-align",iconRTL:"right-align",name:"Right Align"},start:{icon:"left-align",iconRTL:"right-align",name:"Start Align"}},Ic=({editor:n,value:e,isRTL:t,disabled:r=!1})=>{const i=ln[e||"left"];return w.jsxs(Ac,{disabled:r,buttonLabel:i.name,buttonIconClassName:`icon ${t?i.iconRTL:i.icon}`,buttonClassName:"toolbar-item spaced alignment",buttonAriaLabel:"Formatting options for text alignment",children:[w.jsxs(Ye,{onClick:()=>{n.dispatchCommand(me,"left")},className:"item",children:[w.jsx("i",{className:"icon left-align"}),w.jsx("span",{className:"text",children:"Left Align"})]}),w.jsxs(Ye,{onClick:()=>{n.dispatchCommand(me,"center")},className:"item",children:[w.jsx("i",{className:"icon center-align"}),w.jsx("span",{className:"text",children:"Center Align"})]}),w.jsxs(Ye,{onClick:()=>{n.dispatchCommand(me,"right")},className:"item",children:[w.jsx("i",{className:"icon right-align"}),w.jsx("span",{className:"text",children:"Right Align"})]}),w.jsxs(Ye,{onClick:()=>{n.dispatchCommand(me,"justify")},className:"item",children:[w.jsx("i",{className:"icon justify-align"}),w.jsx("span",{className:"text",children:"Justify Align"})]}),w.jsxs(Ye,{onClick:()=>{n.dispatchCommand(me,"start")},className:"item",children:[w.jsx("i",{className:`icon ${t?ln.start.iconRTL:ln.start.icon}`}),w.jsx("span",{className:"text",children:"Start Align"})]}),w.jsxs(Ye,{onClick:()=>{n.dispatchCommand(me,"end")},className:"item",children:[w.jsx("i",{className:`icon ${t?ln.end.iconRTL:ln.end.icon}`}),w.jsx("span",{className:"text",children:"End Align"})]}),w.jsx(Lc,{}),w.jsxs(Ye,{onClick:()=>{n.dispatchCommand(hr,void 0)},className:"item",children:[w.jsx("i",{className:"icon "+(t?"indent":"outdent")}),w.jsx("span",{className:"text",children:"Outdent"})]}),w.jsxs(Ye,{onClick:()=>{n.dispatchCommand($i,void 0)},className:"item",children:[w.jsx("i",{className:"icon "+(t?"outdent":"indent")}),w.jsx("span",{className:"text",children:"Indent"})]})]})};var Rs={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Ws=L.createContext&&L.createContext(Rs),Fc=["attr","size","title"];function Mc(n,e){if(n==null)return{};var t=$c(n,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function $c(n,e){if(n==null)return{};var t={};for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){if(e.indexOf(r)>=0)continue;t[r]=n[r]}return t}function nr(){return nr=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},nr.apply(this,arguments)}function Bs(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function rr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Bs(Object(t),!0).forEach(function(r){Rc(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Bs(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Rc(n,e,t){return e=Wc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Wc(n){var e=Bc(n,"string");return typeof e=="symbol"?e:e+""}function Bc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function zs(n){return n&&n.map((e,t)=>L.createElement(e.tag,rr({key:t},e.attr),zs(e.child)))}function Tt(n){return e=>L.createElement(zc,nr({attr:rr({},n.attr)},e),zs(n.child))}function zc(n){var e=t=>{var{attr:r,size:i,title:o}=n,s=Mc(n,Fc),l=i||t.size||"1em",a;return t.className&&(a=t.className),n.className&&(a=(a?a+" ":"")+n.className),L.createElement("svg",nr({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,r,s,{className:a,style:rr(rr({color:n.color||t.color},t.style),n.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),o&&L.createElement("title",null,o),n.children)};return Ws!==void 0?L.createElement(Ws.Consumer,null,t=>e(t)):e(Rs)}function Kc(n){return Tt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"m3.266 12.496.96-2.853H7.76l.96 2.853H10L6.62 3H5.38L2 12.496zm2.748-8.063 1.419 4.23h-2.88l1.426-4.23zm6.132 7.203v-.075c0-.332.234-.618.619-.618.354 0 .618.256.618.58 0 .362-.271.649-.52.898l-1.788 1.832V15h3.59v-.958h-1.923v-.045l.973-1.04c.415-.438.867-.845.867-1.547 0-.8-.701-1.41-1.787-1.41-1.23 0-1.795.8-1.795 1.576v.06z"},child:[]}]})(n)}function Uc(n){return Tt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"m4.266 12.496.96-2.853H8.76l.96 2.853H11L7.62 3H6.38L3 12.496zm2.748-8.063 1.419 4.23h-2.88l1.426-4.23zm5.132-1.797v-.075c0-.332.234-.618.619-.618.354 0 .618.256.618.58 0 .362-.271.649-.52.898l-1.788 1.832V6h3.59v-.958h-1.923v-.045l.973-1.04c.415-.438.867-.845.867-1.547 0-.8-.701-1.41-1.787-1.41C11.565 1 11 1.8 11 2.576v.06z"},child:[]}]})(n)}function Vc(n){return Tt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8.21 13c2.106 0 3.412-1.087 3.412-2.823 0-1.306-.984-2.283-2.324-2.386v-.055a2.176 2.176 0 0 0 1.852-2.14c0-1.51-1.162-2.46-3.014-2.46H3.843V13zM5.908 4.674h1.696c.963 0 1.517.451 1.517 1.244 0 .834-.629 1.32-1.73 1.32H5.908V4.673zm0 6.788V8.598h1.73c1.217 0 1.88.492 1.88 1.415 0 .943-.643 1.449-1.832 1.449H5.907z"},child:[]}]})(n)}function Jc(n){return Tt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M7.991 11.674 9.53 4.455c.123-.595.246-.71 1.347-.807l.11-.52H7.211l-.11.52c1.06.096 1.128.212 1.005.807L6.57 11.674c-.123.595-.246.71-1.346.806l-.11.52h3.774l.11-.52c-1.06-.095-1.129-.211-1.006-.806z"},child:[]}]})(n)}function Hc(n){return Tt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M6.333 5.686c0 .31.083.581.27.814H5.166a2.8 2.8 0 0 1-.099-.76c0-1.627 1.436-2.768 3.48-2.768 1.969 0 3.39 1.175 3.445 2.85h-1.23c-.11-1.08-.964-1.743-2.25-1.743-1.23 0-2.18.602-2.18 1.607zm2.194 7.478c-2.153 0-3.589-1.107-3.705-2.81h1.23c.144 1.06 1.129 1.703 2.544 1.703 1.34 0 2.31-.705 2.31-1.675 0-.827-.547-1.374-1.914-1.675L8.046 8.5H1v-1h14v1h-3.504c.468.437.675.994.675 1.697 0 1.826-1.436 2.967-3.644 2.967"},child:[]}]})(n)}function Yc(n){return Tt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.313 3.136h-1.23V9.54c0 2.105 1.47 3.623 3.917 3.623s3.917-1.518 3.917-3.623V3.136h-1.23v6.323c0 1.49-.978 2.57-2.687 2.57s-2.687-1.08-2.687-2.57zM12.5 15h-9v-1h9z"},child:[]}]})(n)}const xi=1;function ir(){return w.jsx("div",{className:"divider"})}function qc(){const[n]=it(),e=L.useRef(null),[t,r]=L.useState(!1),[i,o]=L.useState(!1),[s,l]=L.useState(!1),[a,c]=L.useState(!1),[u,d]=L.useState(!1),[f,h]=L.useState(!1),[g,m]=L.useState(!1),[_,x]=L.useState(!1),[v,y]=L.useState("14px"),[C,T]=L.useState("left"),[S,P]=L.useState(!1),k=L.useCallback(()=>{const E=F();if(O(E)){const M=Dc(E),R=M.getParent();l(E.hasFormat("bold")),c(E.hasFormat("italic")),d(E.hasFormat("underline")),h(E.hasFormat("strikethrough")),m(E.hasFormat("subscript")),x(E.hasFormat("superscript")),P(_s(E)),y(La(E,"font-size","14px"));let q;Oc(R)&&(q=Gn(M,H=>b(H)&&!H.isInline())),T(b(q)?q.getFormatType():b(M)?M.getFormatType():(R==null?void 0:R.getFormatType())||"left")}},[]);return L.useEffect(()=>Ct(n.registerUpdateListener(({editorState:E})=>{E.read(()=>{k()})}),n.registerCommand(dn,(E,M)=>(k(),!1),xi),n.registerCommand(It,E=>(r(E),!1),xi),n.registerCommand(At,E=>(o(E),!1),xi)),[n,k]),w.jsxs("div",{className:"toolbar",ref:e,children:[w.jsx("button",{disabled:!t,onClick:()=>{n.dispatchCommand(gn,void 0)},className:"toolbar-item spaced","aria-label":"Undo",children:w.jsx("i",{className:"format undo"})}),w.jsx("button",{disabled:!i,onClick:()=>{n.dispatchCommand(pn,void 0)},className:"toolbar-item","aria-label":"Redo",children:w.jsx("i",{className:"format redo"})}),w.jsx(ir,{}),w.jsx(kc,{selectionFontSize:v.slice(0,-2),editor:n}),w.jsx(ir,{}),w.jsx("button",{onClick:()=>{n.dispatchCommand(fe,"bold")},className:"toolbar-item spaced "+(s?"active":""),"aria-label":"Format Bold",children:w.jsx(Vc,{size:18})}),w.jsx("button",{onClick:()=>{n.dispatchCommand(fe,"italic")},className:"toolbar-item spaced "+(a?"active":""),"aria-label":"Format Italics",children:w.jsx(Jc,{size:18})}),w.jsx("button",{onClick:()=>{n.dispatchCommand(fe,"underline")},className:"toolbar-item spaced "+(u?"active":""),"aria-label":"Format Underline",children:w.jsx(Yc,{size:18})}),w.jsx("button",{onClick:()=>{n.dispatchCommand(fe,"strikethrough")},className:"toolbar-item spaced "+(f?"active":""),"aria-label":"Format Strikethrough",children:w.jsx(Hc,{size:18})}),w.jsx("button",{onClick:()=>{n.dispatchCommand(fe,"subscript")},className:"toolbar-item spaced "+(g?"active":""),title:"Subscript","aria-label":"Format text with a subscript",type:"button",children:w.jsx(Kc,{size:18})}),w.jsx("button",{onClick:()=>{n.dispatchCommand(fe,"superscript")},className:"toolbar-item spaced "+(_?"active":""),title:"Superscript","aria-label":"Format text with a superscript",type:"button",children:w.jsx(Uc,{size:18})}),w.jsx(ir,{}),w.jsx("button",{onClick:()=>{n.dispatchCommand(me,"left")},className:"toolbar-item spaced","aria-label":"Left Align",children:w.jsx("i",{className:"format left-align"})}),w.jsx("button",{onClick:()=>{n.dispatchCommand(me,"center")},className:"toolbar-item spaced","aria-label":"Center Align",children:w.jsx("i",{className:"format center-align"})}),w.jsx("button",{onClick:()=>{n.dispatchCommand(me,"right")},className:"toolbar-item spaced","aria-label":"Right Align",children:w.jsx("i",{className:"format right-align"})}),w.jsx("button",{onClick:()=>{n.dispatchCommand(me,"justify")},className:"toolbar-item","aria-label":"Justify Align",children:w.jsx("i",{className:"format justify-align"})})," ",w.jsx(ir,{}),w.jsx(Ic,{value:C,editor:n,isRTL:S})]})}const Tu="",Ks=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?L.useLayoutEffect:L.useEffect;function Gc({editor:n,ariaActiveDescendant:e,ariaAutoComplete:t,ariaControls:r,ariaDescribedBy:i,ariaExpanded:o,ariaLabel:s,ariaLabelledBy:l,ariaMultiline:a,ariaOwns:c,ariaRequired:u,autoCapitalize:d,className:f,id:h,role:g="textbox",spellCheck:m=!0,style:_,tabIndex:x,"data-testid":v,...y},C){const[T,S]=L.useState(n.isEditable()),P=L.useCallback(E=>{E&&E.ownerDocument&&E.ownerDocument.defaultView?n.setRootElement(E):n.setRootElement(null)},[n]),k=L.useMemo(()=>function(...E){return M=>{E.forEach(R=>{typeof R=="function"?R(M):R!=null&&(R.current=M)})}}(C,P),[P,C]);return Ks(()=>(S(n.isEditable()),n.registerEditableListener(E=>{S(E)})),[n]),w.jsx("div",{...y,"aria-activedescendant":T?e:void 0,"aria-autocomplete":T?t:"none","aria-controls":T?r:void 0,"aria-describedby":i,"aria-expanded":T&&g==="combobox"?!!o:void 0,"aria-label":s,"aria-labelledby":l,"aria-multiline":a,"aria-owns":T?c:void 0,"aria-readonly":!T||void 0,"aria-required":u,autoCapitalize:d,className:f,contentEditable:T,"data-testid":v,id:h,ref:k,role:T?g:void 0,spellCheck:m,style:_,tabIndex:x})}const Xc=L.forwardRef(Gc);function Us(n){return n.getEditorState().read(Cs(n.isComposing()))}const Zc=L.forwardRef(Qc);function Qc(n,e){const{placeholder:t,...r}=n,[i]=it();return w.jsxs(w.Fragment,{children:[w.jsx(Xc,{editor:i,...r,ref:e}),t!=null&&w.jsx(eu,{editor:i,content:t})]})}function eu({content:n,editor:e}){const t=function(s){const[l,a]=L.useState(()=>Us(s));return Ks(()=>{function c(){const u=Us(s);a(u)}return c(),Ct(s.registerUpdateListener(()=>{c()}),s.registerEditableListener(()=>{c()}))},[s]),l}(e),[r,i]=L.useState(e.isEditable());if(L.useLayoutEffect(()=>(i(e.isEditable()),e.registerEditableListener(s=>{i(s)})),[e]),!t)return null;let o=null;return typeof n=="function"?o=n(r):n!==null&&(o=n),o===null?null:w.jsx("div",{"aria-hidden":!0,children:o})}function tu({className:n,style:e}){return w.jsx(Zc,{className:n||"ContentEditable__root",style:e})}const nu={};function ru(n){console.error(n)}function iu(){const{pageMarginValue:n}=Tc(),e={namespace:"MyEditor",theme:nu,onError:ru};return w.jsx(Sa,{initialConfig:e,children:w.jsxs("div",{className:"editor-shell",children:[w.jsx(qc,{}),w.jsx("div",{className:"editor-container",children:w.jsxs("div",{className:"editor-inner",children:[w.jsx(xc,{contentEditable:w.jsx("div",{className:"editor-scroller",children:w.jsx("div",{className:"editor",children:w.jsx(tu,{style:{margin:n}})})}),ErrorBoundary:wc}),w.jsx(Ja,{}),w.jsx(Ta,{})]})})]})})}$e.Editor=iu,Object.defineProperty($e,Symbol.toStringTag,{value:"Module"})});
41
+ `?a.insertParagraph():c===" "?a.insertNodes([en()]):a.insertText(c)}}}else e.insertRawText(o)}function Ns(n,e,t){n.dispatchCommand(al,{nodes:e,selection:t})||t.insertNodes(e)}function Ps(n,e,t,r=[]){let i=e===null||t.isSelected(e);const o=b(t)&&t.excludeFromCopy("html");let s=t;if(e!==null){let c=zr(t);c=D(c)&&e!==null?gs(e,c):c,s=c}const l=b(s)?s.getChildren():[],a=function(c){const u=c.exportJSON(),d=c.constructor;if(u.type!==d.getType()&&Zn(58,d.name),b(c)){const f=u.children;Array.isArray(f)||Zn(59,d.name)}return u}(s);if(D(s)){const c=s.__text;c.length>0?a.text=c:i=!1}for(let c=0;c<l.length;c++){const u=l[c],d=Ps(n,e,u,a.children);!i&&b(t)&&d&&t.extractWithChild(u,e,"clone")&&(i=!0)}if(i&&!o)r.push(a);else if(Array.isArray(a.children))for(let c=0;c<a.children.length;c++){const u=a.children[c];r.push(u)}return i}function ac(n,e){const t=[],r=Z().getChildren();for(let i=0;i<r.length;i++)Ps(n,e,r[i],t);return{namespace:n._config.namespace,nodes:t}}function cc(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=pa(r);D(i)&&Na(i),e.push(i)}return e}let St=null;async function Os(n,e,t){if(St!==null)return!1;if(e!==null)return new Promise((a,c)=>{n.update(()=>{a(Ds(n,e,t))})});const r=n.getRootElement(),i=n._window==null?window.document:n._window.document,o=Es(n._window);if(r===null||o===null)return!1;const s=i.createElement("span");s.style.cssText="position: fixed; top: -1000px;",s.append(i.createTextNode("#")),r.append(s);const l=new Range;return l.setStart(s,0),l.setEnd(s,1),o.removeAllRanges(),o.addRange(l),new Promise((a,c)=>{const u=n.registerCommand(_n,d=>(st(d,ClipboardEvent)&&(u(),St!==null&&(window.clearTimeout(St),St=null),a(Ds(n,d,t))),!0),ya);St=window.setTimeout(()=>{u(),St=null,a(!1)},50),i.execCommand("copy"),s.remove()})}function Ds(n,e,t){if(t===void 0){const i=Es(n._window);if(!i)return!1;const o=i.anchorNode,s=i.focusNode;if(o!==null&&s!==null&&!Mt(n,o,s))return!1;const l=F();if(l===null)return!1;t=fc(l)}e.preventDefault();const r=e.clipboardData;return r!==null&&(dc(r,t),!0)}const uc=[["text/html",sc],["application/x-lexical-editor",lc]];function fc(n=F()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=ql();for(const[r,i]of uc){const o=i(t,n);o!==null&&(e[r]=o)}}return e}function dc(n,e){for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}function Ls(n,e){if(document.caretRangeFromPoint!==void 0){const t=document.caretRangeFromPoint(n,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const t=document.caretPositionFromPoint(n,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}return null}const Tt=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,hc=Tt&&"documentMode"in document?document.documentMode:null,gc=!(!Tt||!("InputEvent"in window)||hc)&&"getTargetRanges"in new window.InputEvent("input"),pc=Tt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),mc=Tt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,_c=Tt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),yc=Tt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!_c,js=ll();function Qn(n){let e=null;if(st(n,DragEvent)?e=n.dataTransfer:st(n,ClipboardEvent)&&(e=n.clipboardData),e===null)return[!1,[],!1];const t=e.types,r=t.includes("Files"),i=t.includes("text/html")||t.includes("text/plain");return[r,Array.from(e.files),i]}function As(n){const e=F();if(!O(e))return!1;const t=new Set,r=e.getNodes();for(let i=0;i<r.length;i++){const o=r[i],s=o.getKey();if(t.has(s))continue;const l=Gn(o,c=>b(c)&&!c.isInline());if(l===null)continue;const a=l.getKey();l.canIndent()&&!t.has(a)&&(t.add(a),n(l))}return t.size>0}function er(n){const e=tt(n);return U(e)}function vc(n){return wt(n.registerCommand(Oi,e=>{const t=F();return!!be(t)&&(t.clear(),!0)},0),n.registerCommand(Ze,e=>{const t=F();return!!O(t)&&(t.deleteCharacter(e),!0)},K),n.registerCommand(Lt,e=>{const t=F();return!!O(t)&&(t.deleteWord(e),!0)},K),n.registerCommand(jt,e=>{const t=F();return!!O(t)&&(t.deleteLine(e),!0)},K),n.registerCommand(ht,e=>{const t=F();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const r=e.dataTransfer;if(r!=null)ks(r,t,n);else if(O(t)){const i=e.data;return i&&t.insertText(i),!0}}return!0},K),n.registerCommand(dr,()=>{const e=F();return!!O(e)&&(e.removeText(),!0)},K),n.registerCommand(fe,e=>{const t=F();return!!O(t)&&(t.formatText(e),!0)},K),n.registerCommand(me,e=>{const t=F();if(!O(t)&&!be(t))return!1;const r=t.getNodes();for(const i of r){const o=Gn(i,s=>b(s)&&!s.isInline());o!==null&&o.setFormat(e)}return!0},K),n.registerCommand(dt,e=>{const t=F();return!!O(t)&&(t.insertLineBreak(e),!0)},K),n.registerCommand(hn,()=>{const e=F();return!!O(e)&&(e.insertParagraph(),!0)},K),n.registerCommand(gl,()=>(da([en()]),!0),K),n.registerCommand($i,()=>As(e=>{const t=e.getIndent();e.setIndent(t+1)}),K),n.registerCommand(hr,()=>As(e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}),K),n.registerCommand(ji,e=>{const t=F();if(be(t)&&!er(e.target)){const r=t.getNodes();if(r.length>0)return r[0].selectPrevious(),!0}else if(O(t)){const r=Wt(t.focus,!0);if(!e.shiftKey&&U(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},K),n.registerCommand(Ai,e=>{const t=F();if(be(t)){const r=t.getNodes();if(r.length>0)return r[0].selectNext(0,0),!0}else if(O(t)){if(function(i){const o=i.focus;return o.key==="root"&&o.offset===Z().getChildrenSize()}(t))return e.preventDefault(),!0;const r=Wt(t.focus,!1);if(!e.shiftKey&&U(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},K),n.registerCommand(Li,e=>{const t=F();if(be(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}if(!O(t))return!1;if(ms(t,!0)){const r=e.shiftKey;return e.preventDefault(),ys(t,r,!0),!0}return!1},K),n.registerCommand(Di,e=>{const t=F();if(be(t)&&!er(e.target)){const i=t.getNodes();if(i.length>0)return e.preventDefault(),i[0].selectNext(0,0),!0}if(!O(t))return!1;const r=e.shiftKey;return!!ms(t,!1)&&(e.preventDefault(),ys(t,r,!1),!0)},K),n.registerCommand(Ii,e=>{if(er(e.target))return!1;const t=F();if(!O(t))return!1;e.preventDefault();const{anchor:r}=t,i=r.getNode();return t.isCollapsed()&&r.offset===0&&!oe(i)&&$a(i).getIndent()>0?n.dispatchCommand(hr,void 0):n.dispatchCommand(Ze,!0)},K),n.registerCommand(Mi,e=>{if(er(e.target))return!1;const t=F();return!!O(t)&&(e.preventDefault(),n.dispatchCommand(Ze,!1))},K),n.registerCommand(mn,e=>{const t=F();if(!O(t))return!1;if(e!==null){if((mc||pc||yc)&&gc)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(dt,!1)}return n.dispatchCommand(hn,void 0)},K),n.registerCommand(Fi,()=>{const e=F();return!!O(e)&&(n.blur(),!0)},K),n.registerCommand(Ri,e=>{const[,t]=Qn(e);if(t.length>0){const i=Ls(e.clientX,e.clientY);if(i!==null){const{offset:o,node:s}=i,l=tt(s);if(l!==null){const a=ua();if(D(l))a.anchor.set(l.getKey(),o,"text"),a.focus.set(l.getKey(),o,"text");else{const u=l.getParentOrThrow().getKey(),d=l.getIndexWithinParent()+1;a.anchor.set(u,d,"element"),a.focus.set(u,d,"element")}const c=Qi(a);we(c)}n.dispatchCommand(js,t)}return e.preventDefault(),!0}const r=F();return!!O(r)},K),n.registerCommand(Bi,e=>{const[t]=Qn(e),r=F();return!(t&&!O(r))},K),n.registerCommand(zi,e=>{const[t]=Qn(e),r=F();if(t&&!O(r))return!1;const i=Ls(e.clientX,e.clientY);if(i!==null){const o=tt(i.node);U(o)&&e.preventDefault()}return!0},K),n.registerCommand(pr,()=>(Vl(),!0),K),n.registerCommand(_n,e=>(Os(n,st(e,ClipboardEvent)?e:null),!0),K),n.registerCommand(gr,e=>(async function(t,r){await Os(r,st(t,ClipboardEvent)?t:null),r.update(()=>{const i=F();O(i)?i.removeText():be(i)&&i.getNodes().forEach(o=>o.remove())})}(e,n),!0),K),n.registerCommand(fr,e=>{const[,t,r]=Qn(e);return t.length>0&&!r?(n.dispatchCommand(js,t),!0):Nr(e.target)?!1:F()!==null&&(function(i,o){i.preventDefault(),o.update(()=>{const s=F(),l=st(i,InputEvent)||st(i,KeyboardEvent)?null:i.clipboardData;l!=null&&s!==null&&ks(l,s,o)},{tag:"paste"})}(e,n),!0)},K))}const _i=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?L.useLayoutEffect:L.useEffect;function Is(n){return n.getEditorState().read(Cs(n.isComposing()))}function xc({contentEditable:n,placeholder:e=null,ErrorBoundary:t}){const[r]=ot(),i=function(o,s){const[l,a]=L.useState(()=>o.getDecorators());return _i(()=>o.registerDecoratorListener(c=>{lr.flushSync(()=>{a(c)})}),[o]),L.useEffect(()=>{a(o.getDecorators())},[o]),L.useMemo(()=>{const c=[],u=Object.keys(l);for(let d=0;d<u.length;d++){const f=u[d],h=w.jsx(s,{onError:m=>o._onError(m),children:w.jsx(L.Suspense,{fallback:null,children:l[f]})}),g=o.getElementByKey(f);g!==null&&c.push(lr.createPortal(h,g,f))}return c},[s,l,o])}(r,t);return function(o){_i(()=>wt(vc(o),ec(o)),[o])}(r),w.jsxs(w.Fragment,{children:[n,w.jsx(bc,{content:e}),i]})}function bc({content:n}){const[e]=ot(),t=function(i){const[o,s]=L.useState(()=>Is(i));return _i(()=>{function l(){const a=Is(i);s(a)}return l(),wt(i.registerUpdateListener(()=>{l()}),i.registerEditableListener(()=>{l()}))},[i]),o}(e),r=qa();return t?typeof n=="function"?n(r):n:null}function yi(n,e){return yi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},yi(n,e)}var Fs={error:null},Cc=function(n){var e,t;function r(){for(var o,s=arguments.length,l=new Array(s),a=0;a<s;a++)l[a]=arguments[a];return(o=n.call.apply(n,[this].concat(l))||this).state=Fs,o.resetErrorBoundary=function(){for(var c,u=arguments.length,d=new Array(u),f=0;f<u;f++)d[f]=arguments[f];o.props.onReset==null||(c=o.props).onReset.apply(c,d),o.reset()},o}t=n,(e=r).prototype=Object.create(t.prototype),e.prototype.constructor=e,yi(e,t),r.getDerivedStateFromError=function(o){return{error:o}};var i=r.prototype;return i.reset=function(){this.setState(Fs)},i.componentDidCatch=function(o,s){var l,a;(l=(a=this.props).onError)==null||l.call(a,o,s)},i.componentDidUpdate=function(o,s){var l,a,c,u,d=this.state.error,f=this.props.resetKeys;d!==null&&s.error!==null&&((c=o.resetKeys)===void 0&&(c=[]),(u=f)===void 0&&(u=[]),c.length!==u.length||c.some(function(h,g){return!Object.is(h,u[g])}))&&((l=(a=this.props).onResetKeysChange)==null||l.call(a,o.resetKeys,f),this.reset())},i.render=function(){var o=this.state.error,s=this.props,l=s.fallbackRender,a=s.FallbackComponent,c=s.fallback;if(o!==null){var u={error:o,resetErrorBoundary:this.resetErrorBoundary};if(Re.isValidElement(c))return c;if(typeof l=="function")return l(u);if(a)return Re.createElement(a,u);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},r}(Re.Component);function wc({children:n,onError:e}){return w.jsx(Cc,{fallback:w.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:n})}const Sc=L.createContext({margin:{bottom:"",left:"",right:"",top:""},pageMarginValue:"",updateCustomMargin:(n,e)=>{},updatePageMarginValue:n=>{}}),Tc=()=>L.useContext(Sc),Eu="";var Ms={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},$s=L.createContext&&L.createContext(Ms),Ec=["attr","size","title"];function kc(n,e){if(n==null)return{};var t=Nc(n,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function Nc(n,e){if(n==null)return{};var t={};for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){if(e.indexOf(r)>=0)continue;t[r]=n[r]}return t}function tr(){return tr=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},tr.apply(this,arguments)}function Rs(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function nr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Rs(Object(t),!0).forEach(function(r){Pc(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Rs(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Pc(n,e,t){return e=Oc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Oc(n){var e=Dc(n,"string");return typeof e=="symbol"?e:e+""}function Dc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Bs(n){return n&&n.map((e,t)=>L.createElement(e.tag,nr({key:t},e.attr),Bs(e.child)))}function Ye(n){return e=>L.createElement(Lc,tr({attr:nr({},n.attr)},e),Bs(n.child))}function Lc(n){var e=t=>{var{attr:r,size:i,title:o}=n,s=kc(n,Ec),l=i||t.size||"1em",a;return t.className&&(a=t.className),n.className&&(a=(a?a+" ":"")+n.className),L.createElement("svg",tr({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,r,s,{className:a,style:nr(nr({color:n.color||t.color},t.style),n.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),o&&L.createElement("title",null,o),n.children)};return $s!==void 0?L.createElement($s.Consumer,null,t=>e(t)):e(Ms)}function jc(n){return Ye({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M5 11h14v2H5z"},child:[]}]})(n)}function Ac(n){return Ye({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19 11h-6V5h-2v6H5v2h6v6h2v-6h6z"},child:[]}]})(n)}const lt=8,at=72,Ic=16;function Fc({selectionFontSize:n,editor:e}){const[t,r]=Re.useState(n),i=(a,c)=>{if(!c)return a;let u=a;switch(c){case 2:switch(!0){case a>at:u=at;break;case a>=48:u-=12;break;case a>=24:u-=4;break;case a>=14:u-=2;break;case a>=9:u-=1;break;default:u=lt;break}break;case 1:switch(!0){case a<lt:u=lt;break;case a<12:u+=1;break;case a<20:u+=2;break;case a<36:u+=4;break;case a<=60:u+=12;break;default:u=at;break}break}return u},o=Re.useCallback((a,c)=>{const u=d=>(d||(d=`${Ic}px`),d=d.slice(0,-2),`${i(Number(d),c)}px`);e.update(()=>{if(e.isEditable()){const d=F();d!==null&&Pa(d,{"font-size":a||u})}})},[e]),s=a=>{const c=Number(t);if(["e","E","+","-"].includes(a.key)||isNaN(c)){a.preventDefault(),r("");return}if(a.key==="Enter"){a.preventDefault();let u=c;c>at?u=at:c<lt&&(u=lt),r(String(u)),o(String(u)+"px",null)}},l=a=>{if(t!==""){const c=i(Number(t),a);o(String(c)+"px",null)}else o(null,a)};return Re.useEffect(()=>{r(n)},[n]),w.jsxs(w.Fragment,{children:[w.jsx("button",{type:"button",disabled:n!==""&&Number(t)<=lt,onClick:()=>l(2),className:"toolbar-item font-decrement",children:w.jsx(jc,{size:18})}),w.jsx("input",{type:"number",value:t,className:"toolbar-item font-size-input",min:lt,max:at,onChange:a=>r(a.target.value),onKeyDown:s}),w.jsx("button",{type:"button",disabled:n!==""&&Number(t)>=at,onClick:()=>l(1),className:"toolbar-item font-increment",children:w.jsx(Ac,{size:18})})]})}const Mc=new Set(["http:","https:","mailto:","sms:","tel:"]);class rr extends on{static getType(){return"link"}static clone(e){return new rr(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e,t={},r){super(r);const{target:i=null,rel:o=null,title:s=null}=t;this.__url=e,this.__target=i,this.__rel=o,this.__title=s}createDOM(e){const t=document.createElement("a");return t.href=this.sanitizeUrl(this.__url),this.__target!==null&&(t.target=this.__target),this.__rel!==null&&(t.rel=this.__rel),this.__title!==null&&(t.title=this.__title),Ma(t,e.theme.link),t}updateDOM(e,t,r){if(t instanceof HTMLAnchorElement){const i=this.__url,o=this.__target,s=this.__rel,l=this.__title;i!==e.__url&&(t.href=i),o!==e.__target&&(o?t.target=o:t.removeAttribute("target")),s!==e.__rel&&(s?t.rel=s:t.removeAttribute("rel")),l!==e.__title&&(l?t.title=l:t.removeAttribute("title"))}return!1}static importDOM(){return{a:e=>({conversion:$c,priority:1})}}static importJSON(e){const t=vi(e.url,{rel:e.rel,target:e.target,title:e.title});return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}sanitizeUrl(e){try{const t=new URL(e);if(!Mc.has(t.protocol))return"about:blank"}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(e){this.getWritable().__url=e}getTarget(){return this.getLatest().__target}setTarget(e){this.getWritable().__target=e}getRel(){return this.getLatest().__rel}setRel(e){this.getWritable().__rel=e}getTitle(){return this.getLatest().__title}setTitle(e){this.getWritable().__title=e}insertNewAfter(e,t=!0){const r=vi(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,t),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,r){if(!O(t))return!1;const i=t.anchor.getNode(),o=t.focus.getNode();return this.isParentOf(i)&&this.isParentOf(o)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function $c(n){let e=null;if(Yl(n)){const t=n.textContent;(t!==null&&t!==""||n.children.length>0)&&(e=vi(n.getAttribute("href")||"",{rel:n.getAttribute("rel"),target:n.getAttribute("target"),title:n.getAttribute("title")}))}return{node:e}}function vi(n,e){return Kt(new rr(n,e))}function Rc(n){return n instanceof rr}function Bc(n){const e=n.anchor,t=n.focus,r=n.anchor.getNode(),i=n.focus.getNode();return r===i?r:n.isBackward()?ps(t)?r:i:ps(e)?r:i}function zc(){return w.jsx("div",{className:"divider"})}const zs=Re.createContext(null),Ws=4;function qe({children:n,className:e,onClick:t,title:r}){const i=L.useRef(null),o=Re.useContext(zs);if(o===null)throw new Error("DropDownItem must be used within a DropDown");const{registerItem:s}=o;return L.useEffect(()=>{i&&i.current&&s(i)},[i,s]),w.jsx("button",{className:e,onClick:t,ref:i,title:r,type:"button",children:n})}function Wc({children:n,dropDownRef:e,onClose:t}){const[r,i]=L.useState(),[o,s]=L.useState(),l=L.useCallback(u=>{i(d=>d?[...d,u]:[u])},[i]),a=u=>{if(!r)return;const d=u.key;["Escape","ArrowUp","ArrowDown","Tab"].includes(d)&&u.preventDefault(),d==="Escape"||d==="Tab"?t():d==="ArrowUp"?s(f=>{if(!f)return r[0];const h=r.indexOf(f)-1;return r[h===-1?r.length-1:h]}):d==="ArrowDown"&&s(f=>f?r[r.indexOf(f)+1]:r[0])},c=L.useMemo(()=>({registerItem:l}),[l]);return L.useEffect(()=>{r&&!o&&s(r[0]),o&&o.current&&o.current.focus()},[r,o]),w.jsx(zs.Provider,{value:c,children:w.jsx("div",{className:"dropdown",ref:e,onKeyDown:a,children:n})})}function Kc({disabled:n=!1,buttonLabel:e,buttonAriaLabel:t,buttonClassName:r,buttonIconClassName:i,children:o,stopCloseOnClickSelf:s}){const l=L.useRef(null),a=L.useRef(null),[c,u]=L.useState(!1),d=()=>{u(!1),a&&a.current&&a.current.focus()};return L.useEffect(()=>{const f=a.current,h=l.current;if(c&&f!==null&&h!==null){const{top:g,left:m}=f.getBoundingClientRect();h.style.top=`${g+f.offsetHeight+Ws}px`,h.style.left=`${Math.min(m,window.innerWidth-h.offsetWidth-20)}px`}},[l,a,c]),L.useEffect(()=>{const f=a.current;if(f!==null&&c){const h=g=>{const m=g.target;s&&l.current&&l.current.contains(m)||f.contains(m)||u(!1)};return document.addEventListener("click",h),()=>{document.removeEventListener("click",h)}}},[l,a,c,s]),L.useEffect(()=>{const f=()=>{if(c){const h=a.current,g=l.current;if(h!==null&&g!==null){const{top:m}=h.getBoundingClientRect(),_=m+h.offsetHeight+Ws;_!==g.getBoundingClientRect().top&&(g.style.top=`${_}px`)}}};return document.addEventListener("scroll",f),()=>{document.removeEventListener("scroll",f)}},[a,l,c]),w.jsxs(w.Fragment,{children:[w.jsxs("button",{type:"button",disabled:n,"aria-label":t||e,className:r,onClick:()=>u(!c),ref:a,children:[i&&w.jsx("span",{className:i}),e&&w.jsx("span",{className:"text dropdown-button-text",children:e}),w.jsx("i",{className:"chevron-down"})]}),c&&lr.createPortal(w.jsx(Wc,{dropDownRef:l,onClose:d,children:o}),document.body)]})}const ln={center:{icon:"center-align",iconRTL:"center-align",name:"Center Align"},end:{icon:"right-align",iconRTL:"left-align",name:"End Align"},justify:{icon:"justify-align",iconRTL:"justify-align",name:"Justify Align"},left:{icon:"left-align",iconRTL:"left-align",name:"Left Align"},right:{icon:"right-align",iconRTL:"right-align",name:"Right Align"},start:{icon:"left-align",iconRTL:"right-align",name:"Start Align"}},Uc=({editor:n,value:e,isRTL:t,disabled:r=!1})=>{const i=ln[e||"left"];return w.jsxs(Kc,{disabled:r,buttonLabel:i.name,buttonIconClassName:`icon ${t?i.iconRTL:i.icon}`,buttonClassName:"toolbar-item spaced alignment",buttonAriaLabel:"Formatting options for text alignment",children:[w.jsxs(qe,{onClick:()=>{n.dispatchCommand(me,"left")},className:"item",children:[w.jsx("i",{className:"icon left-align"}),w.jsx("span",{className:"text",children:"Left Align"})]}),w.jsxs(qe,{onClick:()=>{n.dispatchCommand(me,"center")},className:"item",children:[w.jsx("i",{className:"icon center-align"}),w.jsx("span",{className:"text",children:"Center Align"})]}),w.jsxs(qe,{onClick:()=>{n.dispatchCommand(me,"right")},className:"item",children:[w.jsx("i",{className:"icon right-align"}),w.jsx("span",{className:"text",children:"Right Align"})]}),w.jsxs(qe,{onClick:()=>{n.dispatchCommand(me,"justify")},className:"item",children:[w.jsx("i",{className:"icon justify-align"}),w.jsx("span",{className:"text",children:"Justify Align"})]}),w.jsxs(qe,{onClick:()=>{n.dispatchCommand(me,"start")},className:"item",children:[w.jsx("i",{className:`icon ${t?ln.start.iconRTL:ln.start.icon}`}),w.jsx("span",{className:"text",children:"Start Align"})]}),w.jsxs(qe,{onClick:()=>{n.dispatchCommand(me,"end")},className:"item",children:[w.jsx("i",{className:`icon ${t?ln.end.iconRTL:ln.end.icon}`}),w.jsx("span",{className:"text",children:"End Align"})]}),w.jsx(zc,{}),w.jsxs(qe,{onClick:()=>{n.dispatchCommand(hr,void 0)},className:"item",children:[w.jsx("i",{className:"icon "+(t?"indent":"outdent")}),w.jsx("span",{className:"text",children:"Outdent"})]}),w.jsxs(qe,{onClick:()=>{n.dispatchCommand($i,void 0)},className:"item",children:[w.jsx("i",{className:"icon "+(t?"outdent":"indent")}),w.jsx("span",{className:"text",children:"Indent"})]})]})};function Vc(n){return Ye({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"m3.266 12.496.96-2.853H7.76l.96 2.853H10L6.62 3H5.38L2 12.496zm2.748-8.063 1.419 4.23h-2.88l1.426-4.23zm6.132 7.203v-.075c0-.332.234-.618.619-.618.354 0 .618.256.618.58 0 .362-.271.649-.52.898l-1.788 1.832V15h3.59v-.958h-1.923v-.045l.973-1.04c.415-.438.867-.845.867-1.547 0-.8-.701-1.41-1.787-1.41-1.23 0-1.795.8-1.795 1.576v.06z"},child:[]}]})(n)}function Jc(n){return Ye({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"m4.266 12.496.96-2.853H8.76l.96 2.853H11L7.62 3H6.38L3 12.496zm2.748-8.063 1.419 4.23h-2.88l1.426-4.23zm5.132-1.797v-.075c0-.332.234-.618.619-.618.354 0 .618.256.618.58 0 .362-.271.649-.52.898l-1.788 1.832V6h3.59v-.958h-1.923v-.045l.973-1.04c.415-.438.867-.845.867-1.547 0-.8-.701-1.41-1.787-1.41C11.565 1 11 1.8 11 2.576v.06z"},child:[]}]})(n)}function Hc(n){return Ye({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8.21 13c2.106 0 3.412-1.087 3.412-2.823 0-1.306-.984-2.283-2.324-2.386v-.055a2.176 2.176 0 0 0 1.852-2.14c0-1.51-1.162-2.46-3.014-2.46H3.843V13zM5.908 4.674h1.696c.963 0 1.517.451 1.517 1.244 0 .834-.629 1.32-1.73 1.32H5.908V4.673zm0 6.788V8.598h1.73c1.217 0 1.88.492 1.88 1.415 0 .943-.643 1.449-1.832 1.449H5.907z"},child:[]}]})(n)}function Yc(n){return Ye({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M7.991 11.674 9.53 4.455c.123-.595.246-.71 1.347-.807l.11-.52H7.211l-.11.52c1.06.096 1.128.212 1.005.807L6.57 11.674c-.123.595-.246.71-1.346.806l-.11.52h3.774l.11-.52c-1.06-.095-1.129-.211-1.006-.806z"},child:[]}]})(n)}function qc(n){return Ye({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M6.333 5.686c0 .31.083.581.27.814H5.166a2.8 2.8 0 0 1-.099-.76c0-1.627 1.436-2.768 3.48-2.768 1.969 0 3.39 1.175 3.445 2.85h-1.23c-.11-1.08-.964-1.743-2.25-1.743-1.23 0-2.18.602-2.18 1.607zm2.194 7.478c-2.153 0-3.589-1.107-3.705-2.81h1.23c.144 1.06 1.129 1.703 2.544 1.703 1.34 0 2.31-.705 2.31-1.675 0-.827-.547-1.374-1.914-1.675L8.046 8.5H1v-1h14v1h-3.504c.468.437.675.994.675 1.697 0 1.826-1.436 2.967-3.644 2.967"},child:[]}]})(n)}function Gc(n){return Ye({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.313 3.136h-1.23V9.54c0 2.105 1.47 3.623 3.917 3.623s3.917-1.518 3.917-3.623V3.136h-1.23v6.323c0 1.49-.978 2.57-2.687 2.57s-2.687-1.08-2.687-2.57zM12.5 15h-9v-1h9z"},child:[]}]})(n)}const xi=1;function ir(){return w.jsx("div",{className:"divider"})}function Xc(){const[n]=ot(),e=L.useRef(null),[t,r]=L.useState(!1),[i,o]=L.useState(!1),[s,l]=L.useState(!1),[a,c]=L.useState(!1),[u,d]=L.useState(!1),[f,h]=L.useState(!1),[g,m]=L.useState(!1),[_,x]=L.useState(!1),[v,y]=L.useState("11px"),[C,T]=L.useState("left"),[S,P]=L.useState(!1),k=L.useCallback(()=>{const E=F();if(O(E)){const M=Bc(E),R=M.getParent();l(E.hasFormat("bold")),c(E.hasFormat("italic")),d(E.hasFormat("underline")),h(E.hasFormat("strikethrough")),m(E.hasFormat("subscript")),x(E.hasFormat("superscript")),P(_s(E)),y(La(E,"font-size","14px"));let q;Rc(R)&&(q=Gn(M,H=>b(H)&&!H.isInline())),T(b(q)?q.getFormatType():b(M)?M.getFormatType():(R==null?void 0:R.getFormatType())||"left")}},[]);return L.useEffect(()=>wt(n.registerUpdateListener(({editorState:E})=>{E.read(()=>{k()})}),n.registerCommand(dn,(E,M)=>(k(),!1),xi),n.registerCommand(It,E=>(r(E),!1),xi),n.registerCommand(At,E=>(o(E),!1),xi)),[n,k]),w.jsxs("div",{className:"toolbar",ref:e,children:[w.jsx("button",{disabled:!t,onClick:()=>{n.dispatchCommand(gn,void 0)},className:"toolbar-item spaced","aria-label":"Undo",children:w.jsx("i",{className:"format undo"})}),w.jsx("button",{disabled:!i,onClick:()=>{n.dispatchCommand(pn,void 0)},className:"toolbar-item","aria-label":"Redo",children:w.jsx("i",{className:"format redo"})}),w.jsx(ir,{}),w.jsx(Fc,{selectionFontSize:v.slice(0,-2),editor:n}),w.jsx(ir,{}),w.jsx("button",{onClick:()=>{n.dispatchCommand(fe,"bold")},className:"toolbar-item spaced "+(s?"active":""),"aria-label":"Format Bold",children:w.jsx(Hc,{size:18})}),w.jsx("button",{onClick:()=>{n.dispatchCommand(fe,"italic")},className:"toolbar-item spaced "+(a?"active":""),"aria-label":"Format Italics",children:w.jsx(Yc,{size:18})}),w.jsx("button",{onClick:()=>{n.dispatchCommand(fe,"underline")},className:"toolbar-item spaced "+(u?"active":""),"aria-label":"Format Underline",children:w.jsx(Gc,{size:18})}),w.jsx("button",{onClick:()=>{n.dispatchCommand(fe,"strikethrough")},className:"toolbar-item spaced "+(f?"active":""),"aria-label":"Format Strikethrough",children:w.jsx(qc,{size:18})}),w.jsx("button",{onClick:()=>{n.dispatchCommand(fe,"subscript")},className:"toolbar-item spaced "+(g?"active":""),title:"Subscript","aria-label":"Format text with a subscript",type:"button",children:w.jsx(Vc,{size:18})}),w.jsx("button",{onClick:()=>{n.dispatchCommand(fe,"superscript")},className:"toolbar-item spaced "+(_?"active":""),title:"Superscript","aria-label":"Format text with a superscript",type:"button",children:w.jsx(Jc,{size:18})}),w.jsx(ir,{}),w.jsx("button",{onClick:()=>{n.dispatchCommand(me,"left")},className:"toolbar-item spaced","aria-label":"Left Align",children:w.jsx("i",{className:"format left-align"})}),w.jsx("button",{onClick:()=>{n.dispatchCommand(me,"center")},className:"toolbar-item spaced","aria-label":"Center Align",children:w.jsx("i",{className:"format center-align"})}),w.jsx("button",{onClick:()=>{n.dispatchCommand(me,"right")},className:"toolbar-item spaced","aria-label":"Right Align",children:w.jsx("i",{className:"format right-align"})}),w.jsx("button",{onClick:()=>{n.dispatchCommand(me,"justify")},className:"toolbar-item","aria-label":"Justify Align",children:w.jsx("i",{className:"format justify-align"})})," ",w.jsx(ir,{}),w.jsx(Uc,{value:C,editor:n,isRTL:S})]})}const ku="",Ks=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?L.useLayoutEffect:L.useEffect;function Zc({editor:n,ariaActiveDescendant:e,ariaAutoComplete:t,ariaControls:r,ariaDescribedBy:i,ariaExpanded:o,ariaLabel:s,ariaLabelledBy:l,ariaMultiline:a,ariaOwns:c,ariaRequired:u,autoCapitalize:d,className:f,id:h,role:g="textbox",spellCheck:m=!0,style:_,tabIndex:x,"data-testid":v,...y},C){const[T,S]=L.useState(n.isEditable()),P=L.useCallback(E=>{E&&E.ownerDocument&&E.ownerDocument.defaultView?n.setRootElement(E):n.setRootElement(null)},[n]),k=L.useMemo(()=>function(...E){return M=>{E.forEach(R=>{typeof R=="function"?R(M):R!=null&&(R.current=M)})}}(C,P),[P,C]);return Ks(()=>(S(n.isEditable()),n.registerEditableListener(E=>{S(E)})),[n]),w.jsx("div",{...y,"aria-activedescendant":T?e:void 0,"aria-autocomplete":T?t:"none","aria-controls":T?r:void 0,"aria-describedby":i,"aria-expanded":T&&g==="combobox"?!!o:void 0,"aria-label":s,"aria-labelledby":l,"aria-multiline":a,"aria-owns":T?c:void 0,"aria-readonly":!T||void 0,"aria-required":u,autoCapitalize:d,className:f,contentEditable:T,"data-testid":v,id:h,ref:k,role:T?g:void 0,spellCheck:m,style:_,tabIndex:x})}const Qc=L.forwardRef(Zc);function Us(n){return n.getEditorState().read(Cs(n.isComposing()))}const eu=L.forwardRef(tu);function tu(n,e){const{placeholder:t,...r}=n,[i]=ot();return w.jsxs(w.Fragment,{children:[w.jsx(Qc,{editor:i,...r,ref:e}),t!=null&&w.jsx(nu,{editor:i,content:t})]})}function nu({content:n,editor:e}){const t=function(s){const[l,a]=L.useState(()=>Us(s));return Ks(()=>{function c(){const u=Us(s);a(u)}return c(),wt(s.registerUpdateListener(()=>{c()}),s.registerEditableListener(()=>{c()}))},[s]),l}(e),[r,i]=L.useState(e.isEditable());if(L.useLayoutEffect(()=>(i(e.isEditable()),e.registerEditableListener(s=>{i(s)})),[e]),!t)return null;let o=null;return typeof n=="function"?o=n(r):n!==null&&(o=n),o===null?null:w.jsx("div",{"aria-hidden":!0,children:o})}function ru({className:n,style:e}){return w.jsx(eu,{className:n||"ContentEditable__root",style:e})}const iu={};function ou(n){console.error(n)}function su(){Tc();const n={namespace:"MyEditor",theme:iu,onError:ou};return w.jsx(Sa,{initialConfig:n,children:w.jsxs("div",{className:"editor-shell",children:[w.jsx(Xc,{}),w.jsx("div",{className:"editor-container",children:w.jsxs("div",{className:"editor-inner",children:[w.jsx(xc,{contentEditable:w.jsx("div",{className:"editor-scroller",children:w.jsx("div",{className:"editor",children:w.jsx(ru,{style:{margin:"30px"}})})}),ErrorBoundary:wc}),w.jsx(Ja,{}),w.jsx(Ta,{})]})})]})})}$e.Editor=su,Object.defineProperty($e,Symbol.toStringTag,{value:"Module"})});
42
42
  //# sourceMappingURL=index.umd.js.map