sykpcomposer 0.0.27 → 0.0.30
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.es.js +1878 -1856
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +19 -19
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(Pe,P){typeof exports=="object"&&typeof module<"u"?P(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],P):(Pe=typeof globalThis<"u"?globalThis:Pe||self,P(Pe.ViteButton={},Pe.React,Pe.ReactDOM))})(this,function(Pe,P,di){"use strict";function Ps(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 Vn=Ps(P);var Jn={exports:{}},it={};/*
|
|
2
2
|
object-assign
|
|
3
3
|
(c) Sindre Sorhus
|
|
4
4
|
@license MIT
|
|
5
|
-
*/var
|
|
5
|
+
*/var Zn,fi;function gi(){if(fi)return Zn;fi=1;var n=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},l=0;l<10;l++)s["_"+String.fromCharCode(l)]=l;var a=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(a.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Zn=i()?Object.assign:function(o,s){for(var l,a=r(o),c,u=1;u<arguments.length;u++){l=Object(arguments[u]);for(var f in l)e.call(l,f)&&(a[f]=l[f]);if(n){c=n(l);for(var d=0;d<c.length;d++)t.call(l,c[d])&&(a[c[d]]=l[c[d]])}}return a},Zn}/** @license React v17.0.2
|
|
6
6
|
* react-jsx-runtime.production.min.js
|
|
7
7
|
*
|
|
8
8
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
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
|
|
12
|
+
*/var hi;function zs(){if(hi)return it;hi=1,gi();var n=P,e=60103;if(it.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var t=Symbol.for;e=t("react.element"),it.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,f={},d=null,g=null;c!==void 0&&(d=""+c),a.key!==void 0&&(d=""+a.key),a.ref!==void 0&&(g=a.ref);for(u in a)i.call(a,u)&&!o.hasOwnProperty(u)&&(f[u]=a[u]);if(l&&l.defaultProps)for(u in a=l.defaultProps,a)f[u]===void 0&&(f[u]=a[u]);return{$$typeof:e,type:l,key:d,ref:g,props:f,_owner:r.current}}return it.jsx=s,it.jsxs=s,it}var qn={};/** @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
|
|
20
|
-
`+nt+p}}var
|
|
21
|
-
`),ue=
|
|
22
|
-
`),
|
|
23
|
-
`+
|
|
19
|
+
*/var pi;function Rs(){return pi||(pi=1,function(n){process.env.NODE_ENV!=="production"&&function(){var e=P,t=gi(),r=60103,i=60106;n.Fragment=60107;var o=60108,s=60114,l=60109,a=60110,c=60112,u=60113,f=60120,d=60115,g=60116,h=60121,m=60122,_=60117,v=60129,x=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"),f=y("react.suspense_list"),d=y("react.memo"),g=y("react.lazy"),h=y("react.block"),m=y("react.server.block"),_=y("react.fundamental"),y("react.scope"),y("react.opaque.id"),v=y("react.debug_trace_mode"),y("react.offscreen"),x=y("react.legacy_hidden")}var b=typeof Symbol=="function"&&Symbol.iterator,T="@@iterator";function S(p){if(p===null||typeof p!="object")return null;var w=b&&p[b]||p[T];return typeof w=="function"?w:null}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function N(p){{for(var w=arguments.length,I=new Array(w>1?w-1:0),z=1;z<w;z++)I[z-1]=arguments[z];M("error",p,I)}}function M(p,w,I){{var z=E.ReactDebugCurrentFrame,K=z.getStackAddendum();K!==""&&(w+="%s",I=I.concat([K]));var Q=I.map(function(U){return""+U});Q.unshift("Warning: "+w),Function.prototype.apply.call(console[p],console,Q)}}var R=!1;function B(p){return!!(typeof p=="string"||typeof p=="function"||p===n.Fragment||p===s||p===v||p===o||p===u||p===f||p===x||R||typeof p=="object"&&p!==null&&(p.$$typeof===g||p.$$typeof===d||p.$$typeof===l||p.$$typeof===a||p.$$typeof===c||p.$$typeof===_||p.$$typeof===h||p[0]===m))}function ee(p,w,I){var z=w.displayName||w.name||"";return p.displayName||(z!==""?I+"("+z+")":I)}function J(p){return p.displayName||"Context"}function F(p){if(p==null)return null;if(typeof p.tag=="number"&&N("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 f:return"SuspenseList"}if(typeof p=="object")switch(p.$$typeof){case a:var w=p;return J(w)+".Consumer";case l:var I=p;return J(I._context)+".Provider";case c:return ee(p,p.render,"ForwardRef");case d:return F(p.type);case h:return F(p._render);case g:{var z=p,K=z._payload,Q=z._init;try{return F(Q(K))}catch{return null}}}return null}var V=0,ce,De,Ke,Ht,Xt,en,xt;function vt(){}vt.__reactDisabledLog=!0;function Ct(){{if(V===0){ce=console.log,De=console.info,Ke=console.warn,Ht=console.error,Xt=console.group,en=console.groupCollapsed,xt=console.groupEnd;var p={configurable:!0,enumerable:!0,value:vt,writable:!0};Object.defineProperties(console,{info:p,log:p,warn:p,error:p,group:p,groupCollapsed:p,groupEnd:p})}V++}}function St(){{if(V--,V===0){var p={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:t({},p,{value:ce}),info:t({},p,{value:De}),warn:t({},p,{value:Ke}),error:t({},p,{value:Ht}),group:t({},p,{value:Xt}),groupCollapsed:t({},p,{value:en}),groupEnd:t({},p,{value:xt})})}V<0&&N("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var pe=E.ReactCurrentDispatcher,nt;function Me(p,w,I){{if(nt===void 0)try{throw Error()}catch(K){var z=K.stack.trim().match(/\n( *(at )?)/);nt=z&&z[1]||""}return`
|
|
20
|
+
`+nt+p}}var Qe=!1,rt;{var dc=typeof WeakMap=="function"?WeakMap:Map;rt=new dc}function Ts(p,w){if(!p||Qe)return"";{var I=rt.get(p);if(I!==void 0)return I}var z;Qe=!0;var K=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Q;Q=pe.current,pe.current=null,Ct();try{if(w){var U=function(){throw Error()};if(Object.defineProperty(U.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(U,[])}catch(Ae){z=Ae}Reflect.construct(p,[],U)}else{try{U.call()}catch(Ae){z=Ae}p.call(U.prototype)}}else{try{throw Error()}catch(Ae){z=Ae}p()}}catch(Ae){if(Ae&&z&&typeof Ae.stack=="string"){for(var W=Ae.stack.split(`
|
|
21
|
+
`),ue=z.stack.split(`
|
|
22
|
+
`),q=W.length-1,H=ue.length-1;q>=1&&H>=0&&W[q]!==ue[H];)H--;for(;q>=1&&H>=0;q--,H--)if(W[q]!==ue[H]){if(q!==1||H!==1)do if(q--,H--,H<0||W[q]!==ue[H]){var Oe=`
|
|
23
|
+
`+W[q].replace(" at new "," at ");return typeof p=="function"&&rt.set(p,Oe),Oe}while(q>=1&&H>=0);break}}}finally{Qe=!1,pe.current=Q,St(),Error.prepareStackTrace=K}var Nt=p?p.displayName||p.name:"",As=Nt?Me(Nt):"";return typeof p=="function"&&rt.set(p,As),As}function Ns(p,w,I){return Ts(p,!1)}function fc(p){var w=p.prototype;return!!(w&&w.isReactComponent)}function Kn(p,w,I){if(p==null)return"";if(typeof p=="function")return Ts(p,fc(p));if(typeof p=="string")return Me(p);switch(p){case u:return Me("Suspense");case f:return Me("SuspenseList")}if(typeof p=="object")switch(p.$$typeof){case c:return Ns(p.render);case d:return Kn(p.type,w,I);case h:return Ns(p._render);case g:{var z=p,K=z._payload,Q=z._init;try{return Kn(Q(K),w,I)}catch{}}}return""}var bs={},ws=E.ReactDebugCurrentFrame;function Qn(p){if(p){var w=p._owner,I=Kn(p.type,p._source,w?w.type:null);ws.setExtraStackFrame(I)}else ws.setExtraStackFrame(null)}function gc(p,w,I,z,K){{var Q=Function.call.bind(Object.prototype.hasOwnProperty);for(var U in p)if(Q(p,U)){var W=void 0;try{if(typeof p[U]!="function"){var ue=Error((z||"React class")+": "+I+" type `"+U+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof p[U]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ue.name="Invariant Violation",ue}W=p[U](w,U,z,I,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(q){W=q}W&&!(W instanceof Error)&&(Qn(K),N("%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).",z||"React class",I,U,typeof W),Qn(null)),W instanceof Error&&!(W.message in bs)&&(bs[W.message]=!0,Qn(K),N("Failed %s type: %s",I,W.message),Qn(null))}}}var tn=E.ReactCurrentOwner,si=Object.prototype.hasOwnProperty,hc={key:!0,ref:!0,__self:!0,__source:!0},Ms,Es,li;li={};function pc(p){if(si.call(p,"ref")){var w=Object.getOwnPropertyDescriptor(p,"ref").get;if(w&&w.isReactWarning)return!1}return p.ref!==void 0}function _c(p){if(si.call(p,"key")){var w=Object.getOwnPropertyDescriptor(p,"key").get;if(w&&w.isReactWarning)return!1}return p.key!==void 0}function mc(p,w){if(typeof p.ref=="string"&&tn.current&&w&&tn.current.stateNode!==w){var I=F(tn.current.type);li[I]||(N('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',F(tn.current.type),p.ref),li[I]=!0)}}function yc(p,w){{var I=function(){Ms||(Ms=!0,N("%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)",w))};I.isReactWarning=!0,Object.defineProperty(p,"key",{get:I,configurable:!0})}}function xc(p,w){{var I=function(){Es||(Es=!0,N("%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)",w))};I.isReactWarning=!0,Object.defineProperty(p,"ref",{get:I,configurable:!0})}}var vc=function(p,w,I,z,K,Q,U){var W={$$typeof:r,type:p,key:w,ref:I,props:U,_owner:Q};return W._store={},Object.defineProperty(W._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(W,"_self",{configurable:!1,enumerable:!1,writable:!1,value:z}),Object.defineProperty(W,"_source",{configurable:!1,enumerable:!1,writable:!1,value:K}),Object.freeze&&(Object.freeze(W.props),Object.freeze(W)),W};function Cc(p,w,I,z,K){{var Q,U={},W=null,ue=null;I!==void 0&&(W=""+I),_c(w)&&(W=""+w.key),pc(w)&&(ue=w.ref,mc(w,K));for(Q in w)si.call(w,Q)&&!hc.hasOwnProperty(Q)&&(U[Q]=w[Q]);if(p&&p.defaultProps){var q=p.defaultProps;for(Q in q)U[Q]===void 0&&(U[Q]=q[Q])}if(W||ue){var H=typeof p=="function"?p.displayName||p.name||"Unknown":p;W&&yc(U,H),ue&&xc(U,H)}return vc(p,W,ue,K,z,tn.current,U)}}var ai=E.ReactCurrentOwner,ks=E.ReactDebugCurrentFrame;function Tt(p){if(p){var w=p._owner,I=Kn(p.type,p._source,w?w.type:null);ks.setExtraStackFrame(I)}else ks.setExtraStackFrame(null)}var ci;ci=!1;function ui(p){return typeof p=="object"&&p!==null&&p.$$typeof===r}function Ls(){{if(ai.current){var p=F(ai.current.type);if(p)return`
|
|
24
24
|
|
|
25
|
-
Check the render method of \``+p+"`."}return""}}function
|
|
25
|
+
Check the render method of \``+p+"`."}return""}}function Sc(p){{if(p!==void 0){var w=p.fileName.replace(/^.*[\\\/]/,""),I=p.lineNumber;return`
|
|
26
26
|
|
|
27
|
-
Check your code at `+
|
|
27
|
+
Check your code at `+w+":"+I+"."}return""}}var js={};function Tc(p){{var w=Ls();if(!w){var I=typeof p=="string"?p:p.displayName||p.name;I&&(w=`
|
|
28
28
|
|
|
29
|
-
Check the top-level render call using <`+
|
|
29
|
+
Check the top-level render call using <`+I+">.")}return w}}function Is(p,w){{if(!p._store||p._store.validated||p.key!=null)return;p._store.validated=!0;var I=Tc(w);if(js[I])return;js[I]=!0;var z="";p&&p._owner&&p._owner!==ai.current&&(z=" It was passed a child from "+F(p._owner.type)+"."),Tt(p),N('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',I,z),Tt(null)}}function Ds(p,w){{if(typeof p!="object")return;if(Array.isArray(p))for(var I=0;I<p.length;I++){var z=p[I];ui(z)&&Is(z,w)}else if(ui(p))p._store&&(p._store.validated=!0);else if(p){var K=S(p);if(typeof K=="function"&&K!==p.entries)for(var Q=K.call(p),U;!(U=Q.next()).done;)ui(U.value)&&Is(U.value,w)}}}function Nc(p){{var w=p.type;if(w==null||typeof w=="string")return;var I;if(typeof w=="function")I=w.propTypes;else if(typeof w=="object"&&(w.$$typeof===c||w.$$typeof===d))I=w.propTypes;else return;if(I){var z=F(w);gc(I,p.props,"prop",z,p)}else if(w.PropTypes!==void 0&&!ci){ci=!0;var K=F(w);N("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",K||"Unknown")}typeof w.getDefaultProps=="function"&&!w.getDefaultProps.isReactClassApproved&&N("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function bc(p){{for(var w=Object.keys(p.props),I=0;I<w.length;I++){var z=w[I];if(z!=="children"&&z!=="key"){Tt(p),N("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",z),Tt(null);break}}p.ref!==null&&(Tt(p),N("Invalid attribute `ref` supplied to `React.Fragment`."),Tt(null))}}function Os(p,w,I,z,K,Q){{var U=B(p);if(!U){var W="";(p===void 0||typeof p=="object"&&p!==null&&Object.keys(p).length===0)&&(W+=" 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=Sc(K);ue?W+=ue:W+=Ls();var q;p===null?q="null":Array.isArray(p)?q="array":p!==void 0&&p.$$typeof===r?(q="<"+(F(p.type)||"Unknown")+" />",W=" Did you accidentally export a JSX literal instead of a component?"):q=typeof p,N("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",q,W)}var H=Cc(p,w,I,K,Q);if(H==null)return H;if(U){var Oe=w.children;if(Oe!==void 0)if(z)if(Array.isArray(Oe)){for(var Nt=0;Nt<Oe.length;Nt++)Ds(Oe[Nt],p);Object.freeze&&Object.freeze(Oe)}else N("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 Ds(Oe,p)}return p===n.Fragment?bc(H):Nc(H),H}}function wc(p,w,I){return Os(p,w,I,!0)}function Mc(p,w,I){return Os(p,w,I,!1)}var Ec=Mc,kc=wc;n.jsx=Ec,n.jsxs=kc}()}(qn)),qn}process.env.NODE_ENV==="production"?Jn.exports=zs():Jn.exports=Rs();var A=Jn.exports;function Fs(n){return{}}const nn={},Ws={},_i={},Ve={},ot={},rn={},st={},Gn={},Hn={},bt={},wt={},de={},on={},sn={},Bs={},mi={},Us={},yi={},$s={},xi={},vi={},ln={},Ys={},Ci={},Si={},Ti={},Ks={},Qs={},Vs={},Ni={},bi={},Mt={},wi={},Mi={},Js={},an={},Xn={},er={},Zs={},qs={},Et={},kt={},Gs={},Hs={},Xs={},_e=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,el=_e&&"documentMode"in document?document.documentMode:null,me=_e&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ze=_e&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),cn=!(!_e||!("InputEvent"in window)||el)&&"getTargetRanges"in new window.InputEvent("input"),tr=_e&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),un=_e&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,tl=_e&&/Android/.test(navigator.userAgent),Ei=_e&&/^(?=.*Chrome).*/i.test(navigator.userAgent),nl=_e&&tl&&Ei,nr=_e&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ei,Lt=1,Re=3,Je=0,ki=1,lt=2,rl=0,il=1,ol=2,dn=4,fn=8,rr=128,sl=112|(3|dn|fn)|rr,ir=1,or=2,sr=3,lr=4,ar=5,cr=6,gn=tr||un||nr?" ":"",Ee=`
|
|
30
30
|
|
|
31
|
-
`,ll=Me?" ":hn,Oi="֑-߿יִ-﷽ﹰ-ﻼ",Di="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",al=new RegExp("^[^"+Di+"]*["+Oi+"]"),cl=new RegExp("^[^"+Oi+"]*["+Di+"]"),Pe={bold:1,code:16,highlight:rr,italic:2,strikethrough:fn,subscript:32,superscript:64,underline:dn},ul={directionless:1,unmergeable:2},Ri={center:or,end:cr,justify:lr,left:ir,right:sr,start:ar},fl={[or]:"center",[cr]:"end",[lr]:"justify",[ir]:"left",[sr]:"right",[ar]:"start"},dl={normal:0,segmented:2,token:1},hl={[rl]:"normal",[ol]:"segmented",[il]:"token"};function gl(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var O=gl(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 gn(...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 pl=100;let ur=!1,fr=0;function _l(n){fr=n.timeStamp}function dr(n,e,t){return e.__lexicalLineBreak===n||n[`__lexicalKey_${t._key}`]!==void 0}function ml(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&&yr(e,s,i,o,!1)}function yl(n,e,t){if(P(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return e.nodeType===je&&t.isAttached()}function Fi(n,e,t){ur=!0;const r=performance.now()-fr>pl;try{he(n,()=>{const i=I()||function(f){return f.getEditorState().read(()=>{const h=I();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,_=h.target;let m=Ge(_,l);if(!(m===null&&_!==s||U(m))){if(g==="characterData")r&&D(m)&&yl(i,_,m)&&ml(_,m,n);else if(g==="childList"){c=!0;const x=h.addedNodes;for(let T=0;T<x.length;T++){const S=x[T],b=$i(S),N=S.parentNode;if(N!=null&&S!==a&&b===null&&(S.nodeName!=="BR"||!dr(S,N,n))){if(Me){const w=S.innerText||S.nodeValue;w&&(u+=w)}N.removeChild(S)}}const y=h.removedNodes,v=y.length;if(v>0){let T=0;for(let S=0;S<v;S++){const b=y[S];(b.nodeName==="BR"&&dr(b,_,n)||a===b)&&(_.appendChild(b),T++)}v!==T&&(_===s&&(m=Ji(l)),o.set(_,m))}}}}if(o.size>0)for(const[f,h]of o)if(C(h)){const g=h.getChildrenKeys();let _=f.firstChild;for(let m=0;m<g.length;m++){const x=g[m],y=n.getElementByKey(x);y!==null&&(_==null?(f.appendChild(y),_=y):_!==y&&f.replaceChild(y,_),_=_.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,_=h.target;for(let m=0;m<g.length;m++){const x=g[m],y=x.parentNode;y==null||x.nodeName!=="BR"||dr(x,_,n)||y.removeChild(x)}}t.takeRecords()}i!==null&&(c&&(i.dirty=!0,be(i)),Me&&to(n)&&i.insertRawText(u))})}finally{ur=!1}}function Ii(n){const e=n._observer;e!==null&&Fi(n,e.takeRecords(),e)}function Li(n){(function(e){fr===0&&Cn(e).addEventListener("textInput",_l,!0)})(n),n._observer=new MutationObserver((e,t)=>{Fi(n,e,t)})}function Ai(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 Mi(n,e){const t=n.mergeWithSibling(e),r=H()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function ji(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(Ai(e,r)){r=Mi(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&D(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Ai(r,t)){r=Mi(r,t);break}break}t.remove()}}else r.remove()}function Wi(n){return Bi(n.anchor),Bi(n.focus),n}function Bi(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(!C(r))break;n.set(r.__key,i?r.getChildrenSize():0,"element")}}let vl=1;const xl=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function hr(n){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return U(Ge(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&pn(e)==null)}function Dt(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!hr(e)&&zi(e)===n}catch{return!1}}function gr(n){return n instanceof Wn}function zi(n){let e=n;for(;e!=null;){const t=pn(e);if(gr(t))return t;e=xn(e)}return null}function pn(n){return n?n.__lexicalEditor:null}function at(n){return n.isToken()||n.isSegmented()}function Cl(n){return n.nodeType===je}function _n(n){let e=n;for(;e!=null;){if(Cl(e))return e;e=e.firstChild}return null}function pr(n,e,t){const r=Pe[e];if(t!==null&&(n&r)==(t&r))return n;let i=n^r;return e==="subscript"?i&=~Pe.superscript:e==="superscript"&&(i&=~Pe.subscript),i}function bl(n,e){if(e!=null)return void(n.__key=e);de(),Bo();const t=H(),r=Re(),i=""+vl++;r._nodeMap.set(i,n),C(n)?t._dirtyElements.set(i,!0):t._dirtyLeaves.add(i),t._cloneNotNeeded.add(i),t._dirtyType=Pi,n.__key=i}function He(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 mn(n){Bo();const e=n.getLatest(),t=e.__parent,r=Re(),i=H(),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=Pi,C(n)?s.set(l,!0):i._dirtyLeaves.add(l)}function re(n){de();const e=H(),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 Ht()?null:H()._compositionKey}function se(n,e){const t=(e||Re())._nodeMap.get(n);return t===void 0?null:t}function $i(n,e){const t=n[`__lexicalKey_${H()._key}`];return t!==void 0?se(t,e):null}function Ge(n,e){let t=n;for(;t!=null;){const r=$i(t,e);if(r!==null)return r;t=xn(t)}return null}function Ki(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function Ui(n){return n.read(()=>X().getTextContent())}function X(){return Ji(Re())}function Ji(n){return n._nodeMap.get("root")}function be(n){de();const e=Re();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function ct(n){const e=H(),t=function(r,i){let o=r;for(;o!=null;){const s=o[`__lexicalKey_${i._key}`];if(s!==void 0)return s;o=xn(o)}return null}(n,e);return t===null?n===e.getRootElement()?se("root"):null:se(t)}function Vi(n,e){return e?n.getTextContentSize():0}function Yi(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function _r(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function qi(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function Hi(n){return n.nodeType===je?n.nodeValue:null}function mr(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=Hi(i);const a=Ge(i);if(l!==null&&D(a)){if(l===hn&&t){const c=t.length;l=t,o=c,s=c}l!==null&&yr(a,l,o,s,n)}}}function yr(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]===hn&&(l=e.slice(0,-1));const a=o.getTextContent();if(i||l!==a){if(l===""){if(re(null),tr||un||nr)o.remove();else{const _=H();setTimeout(()=>{_.update(()=>{o.isAttached()&&o.remove()})},20)}return}const c=o.getParent(),u=qt(),d=o.getTextContentSize(),f=We(),h=o.getKey();if(o.isToken()||f!==null&&h===f&&!s||P(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=I();if(!P(g)||t===null||r===null)return void o.setTextContent(l);if(g.setTextNodeRange(o,t,o,r),o.isSegmented()){const _=ie(o.getTextContent());o.replace(_),o=_}o.setTextContent(l)}}}function Sl(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)||C(s)&&s.isInline())&&!s.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!r.canInsertTextAfter()&&!e.isComposing()||i)}function Gi(n){return n==="ArrowLeft"}function Xi(n){return n==="ArrowRight"}function Rt(n,e){return me?n:e}function Qi(n){return n==="Enter"}function Ft(n){return n==="Backspace"}function It(n){return n==="Delete"}function Zi(n,e,t){return n.toLowerCase()==="a"&&Rt(e,t)}function wl(){const n=X();be(Wi(n.select(0,n.getChildrenSize())))}function Lt(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=gn(i);return t[e]=o,o}return i}function vr(n,e,t,r,i){if(t.size===0)return;const o=r.__type,s=r.__key,l=e.get(o);l===void 0&&O(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 eo(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 At(n,e){const t=n.offset;if(n.type==="element")return eo(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?eo(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):i}}return null}function to(n){const e=Cn(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function F(n,e,t){return Jo(n,e,t)}function yn(n){return!oe(n)&&!n.isLastChild()&&!n.isInline()}function vn(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&O(75,e),t}function xn(n){const e=n.assignedSlot||n.parentElement;return e!==null&&e.nodeType===11?e.host:e}function xr(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function Cn(n){const e=n._window;return e===null&&O(78),e}function Tl(n){let e=n.getParentOrThrow();for(;e!==null;){if(ut(e))return e;e=e.getParentOrThrow()}return e}function ut(n){return oe(n)||C(n)&&n.isShadowRoot()}function bn(n){const e=H(),t=n.constructor.getType(),r=e._nodes.get(t);r===void 0&&O(97);const i=r.replace;if(i!==null){const o=i(n);return o instanceof n.constructor||O(98),o}return n}function Cr(n,e){!oe(n.getParent())||C(e)||U(e)||O(99)}function br(n){return(U(n)||C(n)&&!n.canBeEmpty())&&!n.isInline()}function Sr(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function kl(n,e,t){let r=n._blockCursorElement;if(P(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())br(o.getChildAtIndex(s-1))&&(l=!0);else{const c=o.getChildAtIndex(s);if(br(c)){const u=c.getPreviousSibling();(u===null||br(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=gn(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&&Sr(r,n,e)}function Se(n){return _e?(n||window).getSelection():null}function wr(n){return n.nodeType===1}function Tr(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 Sn(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 ft(n){if(oe(n)||U(n)&&!n.isInline())return!0;if(!C(n)||ut(n))return!1;const e=n.getFirstChild(),t=e===null||Jt(e)||D(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function kr(n,e){let t=n;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}function El(){return H()}const no=new WeakMap,Nl=new Map;function Pl(n){if(!n._readOnly&&n.isEmpty())return Nl;n._readOnly||O(192);let e=no.get(n);if(!e){e=new Map,no.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 Er(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function ro(n,e,t,r,i,o){let s=n.getFirstChild();for(;s!==null;){const l=s.__key;s.__parent===e&&(C(s)&&ro(s,l,t,r,i,o),t.has(l)||o.delete(l),i.push(l)),s=s.getNextSibling()}}let Be,le,Mt,wn,Nr,Pr,Xe,ye,Or,jt,Z="",ae="",we=null,ve="",Oe="",io=!1,Wt=!1,Tn=null;function kn(n,e){const t=Xe.get(n);if(e!==null){const r=Ir(n);r.parentNode===e&&e.removeChild(r)}if(ye.has(n)||le._keyToDOMMap.delete(n),C(t)){const r=Nn(t,Xe);Dr(r,0,r.length-1,null)}t!==void 0&&vr(jt,Mt,wn,t,"destroyed")}function Dr(n,e,t,r){let i=e;for(;i<=t;++i){const o=n[i];o!==void 0&&kn(o,r)}}function Qe(n,e){n.setProperty("text-align",e)}const Ol="40px";function oo(n,e){const t=Be.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")||Ol;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function so(n,e){const t=n.style;e===0?Qe(t,""):e===ir?Qe(t,"left"):e===or?Qe(t,"center"):e===sr?Qe(t,"right"):e===lr?Qe(t,"justify"):e===ar?Qe(t,"start"):e===cr&&Qe(t,"end")}function En(n,e,t){const r=ye.get(n);r===void 0&&O(60);const i=r.createDOM(Be,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"),C(r)){const o=r.__indent,s=r.__size;if(o!==0&&oo(i,o),s!==0){const a=s-1;(function(c,u,d,f){const h=ae;ae="",Rr(c,d,0,u,f,null),co(d,f),ae=h})(Nn(r,ye),a,r,i)}const l=r.__format;l!==0&&so(i,l),r.isInline()||ao(null,r,i),yn(r)&&(Z+=Ne,Oe+=Ne)}else{const o=r.getTextContent();if(U(r)){const s=r.decorate(le,Be);s!==null&&uo(n,s),i.contentEditable="false"}else D(r)&&(r.isDirectionless()||(ae+=o));Z+=o,Oe+=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 vr(jt,Mt,wn,r,"created"),i}function Rr(n,e,t,r,i,o){const s=Z;Z="";let l=t;for(;l<=r;++l){En(n[l],i,o);const a=ye.get(n[l]);a!==null&&D(a)&&(we===null&&(we=a.getFormat()),ve===""&&(ve=a.getStyle()))}yn(e)&&(Z+=Ne),i.__lexicalTextContent=Z,Z=s+Z}function lo(n,e){const t=e.get(n);return Jt(t)||U(t)&&t.isInline()}function ao(n,e,t){const r=n!==null&&(n.__size===0||lo(n.__last,Xe)),i=e.__size===0||lo(e.__last,ye);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 co(n,e){const t=e.__lexicalDirTextContent,r=e.__lexicalDir;if(t!==ae||r!==Tn){const o=ae==="",s=o?Tn:(i=ae,al.test(i)?"rtl":cl.test(i)?"ltr":null);if(s!==r){const l=e.classList,a=Be.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=gn(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=gn(u);u=a[s]=d}u!==void 0&&l.add(...u)}e.dir=s}Wt||(n.getWritable().__dir=s)}Tn=s,e.__lexicalDirTextContent=ae,e.__lexicalDir=s}var i}function Dl(n,e,t){const r=ae;var i;ae="",we=null,ve="",function(o,s,l){const a=Z,c=o.__size,u=s.__size;if(Z="",c===1&&u===1){const d=o.__first,f=s.__first;if(d===f)Bt(d,l);else{const g=Ir(d),_=En(f,null,null);try{l.replaceChild(_,g)}catch(m){if(typeof m=="object"&&m!=null){const x=`${m.toString()} Parent: ${l.tagName}, new child: {tag: ${_.tagName} key: ${f}}, old child: {tag: ${g.tagName}, key: ${d}}.`;throw new Error(x)}throw m}kn(d,null)}const h=ye.get(f);D(h)&&(we===null&&(we=h.getFormat()),ve===""&&(ve=h.getStyle()))}else{const d=Nn(o,Xe),f=Nn(s,ye);if(c===0)u!==0&&Rr(f,s,0,u-1,l,null);else if(u===0){if(c!==0){const h=l.__lexicalLineBreak==null;Dr(d,0,c-1,h?null:l),h&&(l.textContent="")}}else(function(h,g,_,m,x,y){const v=m-1,T=x-1;let S,b,N=(j=y,j.firstChild),w=0,E=0;for(var j;w<=v&&E<=T;){const q=g[w],W=_[E];if(q===W)N=Fr(Bt(W,y)),w++,E++;else{S===void 0&&(S=new Set(g)),b===void 0&&(b=new Set(_));const ce=b.has(q),Fe=S.has(W);if(ce)if(Fe){const Je=vn(le,W);Je===N?N=Fr(Bt(W,y)):(N!=null?y.insertBefore(Je,N):y.appendChild(Je),Bt(W,y)),w++,E++}else En(W,y,N),E++;else N=Fr(Ir(q)),kn(q,y),w++}const Y=ye.get(W);Y!==null&&D(Y)&&(we===null&&(we=Y.getFormat()),ve===""&&(ve=Y.getStyle()))}const z=w>v,ee=E>T;if(z&&!ee){const q=_[T+1];Rr(_,h,E,T,y,q===void 0?null:le.getElementByKey(q))}else ee&&!z&&Dr(g,w,v,y)})(s,d,f,c,u,l)}yn(s)&&(Z+=Ne),l.__lexicalTextContent=Z,Z=a+Z}(n,e,t),co(e,t),Zr(i=e)&&we!=null&&we!==i.__textFormat&&!Wt&&(i.setTextFormat(we),i.setTextStyle(ve)),function(o){Zr(o)&&ve!==""&&ve!==o.__textStyle&&!Wt&&o.setTextStyle(ve)}(e),ae=r}function Nn(n,e){const t=[];let r=n.__first;for(;r!==null;){const i=e.get(r);i===void 0&&O(101),t.push(r),r=i.__next}return t}function Bt(n,e){const t=Xe.get(n);let r=ye.get(n);t!==void 0&&r!==void 0||O(61);const i=io||Pr.has(n)||Nr.has(n),o=vn(le,n);if(t===r&&!i){if(C(t)){const s=o.__lexicalTextContent;s!==void 0&&(Z+=s,Oe+=s);const l=o.__lexicalDirTextContent;l!==void 0&&(ae+=l)}else{const s=t.getTextContent();D(t)&&!t.isDirectionless()&&(ae+=s),Oe+=s,Z+=s}return o}if(t!==r&&i&&vr(jt,Mt,wn,r,"updated"),r.updateDOM(t,o,Be)){const s=En(n,null,null);return e===null&&O(62),e.replaceChild(s,o),kn(n,null),s}if(C(t)&&C(r)){const s=r.__indent;s!==t.__indent&&oo(o,s);const l=r.__format;l!==t.__format&&so(o,l),i&&(Dl(t,r,o),oe(r)||r.isInline()||ao(t,r,o)),yn(r)&&(Z+=Ne,Oe+=Ne)}else{const s=r.getTextContent();if(U(r)){const l=r.decorate(le,Be);l!==null&&uo(n,l)}else D(r)&&!r.isDirectionless()&&(ae+=s);Z+=s,Oe+=s}if(!Wt&&oe(r)&&r.__cachedText!==Oe){const s=r.getWritable();s.__cachedText=Oe,r=s}return o}function uo(n,e){let t=le._pendingDecorators;const r=le._decorators;if(t===null){if(r[n]===e)return;t=Ki(le)}t[n]=e}function Fr(n){let e=n.nextSibling;return e!==null&&e===le._blockCursorElement&&(e=e.nextSibling),e}function Rl(n,e,t,r,i,o){Z="",Oe="",ae="",io=r===lt,Tn=null,le=t,Be=t._config,Mt=t._nodes,wn=le._listeners.mutation,Nr=i,Pr=o,Xe=n._nodeMap,ye=e._nodeMap,Wt=e._readOnly,Or=new Map(t._keyToDOMMap);const s=new Map;return jt=s,Bt("root",null),le=void 0,Mt=void 0,Nr=void 0,Pr=void 0,Xe=void 0,ye=void 0,Be=void 0,Or=void 0,jt=void 0,s}function Ir(n){const e=Or.get(n);return e===void 0&&O(75,n),e}const De=Object.freeze({}),Lr=30,Ar=[["keydown",function(n,e){if(zt=n.timeStamp,fo=n.key,e.isComposing())return;const{key:t,shiftKey:r,ctrlKey:i,metaKey:o,altKey:s}=n;F(e,zs,n)||t!=null&&(function(l,a,c,u){return Xi(l)&&!a&&!u&&!c}(t,i,s,o)?F(e,mi,n):function(l,a,c,u,d){return Xi(l)&&!u&&!c&&(a||d)}(t,i,r,s,o)?F(e,$s,n):function(l,a,c,u){return Gi(l)&&!a&&!u&&!c}(t,i,s,o)?F(e,yi,n):function(l,a,c,u,d){return Gi(l)&&!u&&!c&&(a||d)}(t,i,r,s,o)?F(e,Ks,n):function(l,a,c){return function(u){return u==="ArrowUp"}(l)&&!a&&!c}(t,i,o)?F(e,vi,n):function(l,a,c){return function(u){return u==="ArrowDown"}(l)&&!a&&!c}(t,i,o)?F(e,xi,n):function(l,a){return Qi(l)&&a}(t,r)?($t=!0,F(e,ln,n)):function(l){return l===" "}(t)?F(e,Us,n):function(l,a){return me&&a&&l.toLowerCase()==="o"}(t,i)?(n.preventDefault(),$t=!0,F(e,ot,!0)):function(l,a){return Qi(l)&&!a}(t,r)?($t=!1,F(e,ln,n)):function(l,a,c,u){return me?!a&&!c&&(Ft(l)||l.toLowerCase()==="h"&&u):!(u||a||c)&&Ft(l)}(t,s,o,i)?Ft(t)?F(e,Ci,n):(n.preventDefault(),F(e,Ye,!0)):function(l){return l==="Escape"}(t)?F(e,bi,n):function(l,a,c,u,d){return me?!(c||u||d)&&(It(l)||l.toLowerCase()==="d"&&a):!(a||u||d)&&It(l)}(t,i,r,s,o)?It(t)?F(e,Si,n):(n.preventDefault(),F(e,Ye,!1)):function(l,a,c){return Ft(l)&&(me?a:c)}(t,s,i)?(n.preventDefault(),F(e,Tt,!0)):function(l,a,c){return It(l)&&(me?a:c)}(t,s,i)?(n.preventDefault(),F(e,Tt,!1)):function(l,a){return me&&a&&Ft(l)}(t,o)?(n.preventDefault(),F(e,kt,!0)):function(l,a){return me&&a&&It(l)}(t,o)?(n.preventDefault(),F(e,kt,!1)):function(l,a,c,u){return l.toLowerCase()==="b"&&!a&&Rt(c,u)}(t,s,o,i)?(n.preventDefault(),F(e,ge,"bold")):function(l,a,c,u){return l.toLowerCase()==="u"&&!a&&Rt(c,u)}(t,s,o,i)?(n.preventDefault(),F(e,ge,"underline")):function(l,a,c,u){return l.toLowerCase()==="i"&&!a&&Rt(c,u)}(t,s,o,i)?(n.preventDefault(),F(e,ge,"italic")):function(l,a,c,u){return l==="Tab"&&!a&&!c&&!u}(t,s,i,o)?F(e,Js,n):function(l,a,c,u){return l.toLowerCase()==="z"&&!a&&Rt(c,u)}(t,r,o,i)?(n.preventDefault(),F(e,on,void 0)):function(l,a,c,u){return me?l.toLowerCase()==="z"&&c&&a:l.toLowerCase()==="y"&&u||l.toLowerCase()==="z"&&u&&a}(t,r,o,i)?(n.preventDefault(),F(e,sn,void 0)):xe(e._editorState._selection)?function(l,a,c,u){return!a&&l.toLowerCase()==="c"&&(me?c:u)}(t,r,o,i)?(n.preventDefault(),F(e,an,n)):function(l,a,c,u){return!a&&l.toLowerCase()==="x"&&(me?c:u)}(t,r,o,i)?(n.preventDefault(),F(e,Zn,n)):Zi(t,o,i)&&(n.preventDefault(),F(e,er,n)):!Me&&Zi(t,o,i)&&(n.preventDefault(),F(e,er,n)),function(l,a,c,u){return l||a||c||u}(i,r,s,o)&&F(e,Zs,n))}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;t instanceof Node&&r!=="touch"&&he(e,()=>{U(Ge(t))||(jr=!0)})}],["compositionstart",function(n,e){he(e,()=>{const t=I();if(P(t)&&!e.isComposing()){const r=t.anchor,i=t.anchor.getNode();re(r.key),(n.timeStamp<zt+Lr||r.type==="element"||!t.isCollapsed()||i.getFormat()!==t.format||D(i)&&i.getStyle()!==t.style)&&F(e,st,ll)}})}],["compositionend",function(n,e){Me?Kt=!0:he(e,()=>{Wr(e,n.data)})}],["input",function(n,e){n.stopPropagation(),he(e,()=>{const t=I(),r=n.data,i=yo(n);if(r!=null&&P(t)&&po(t,i,r,n.timeStamp,!1)){Kt&&(Wr(e,r),Kt=!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;cn&&!t.isCollapsed()&&D(o)&&s.anchorNode!==null&&o.getTextContent().slice(0,a)+r+o.getTextContent().slice(a+c)===Hi(s.anchorNode)||F(e,st,r);const u=r.length;Me&&u>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),tr||un||nr||!e.isComposing()||(zt=0,re(null))}else mr(!1,e,r!==null?r:void 0),Kt&&(Wr(e,r||void 0),Kt=!1);de(),Ii(H())}),dt=null}],["click",function(n,e){he(e,()=>{const t=I(),r=Se(e._window),i=qt();if(r){if(P(t)){const o=t.anchor,s=o.getNode();o.type==="element"&&o.offset===0&&t.isCollapsed()&&!oe(s)&&X().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&i!==null&&t.is(i)?(r.removeAllRanges(),t.dirty=!0):n.detail===3&&!t.isCollapsed()&&s!==t.focus.getNode()&&(C(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===Ot||s===je)&&be(Yr(i,r,e,n))}}}F(e,_i,n)})}],["cut",De],["copy",De],["dragstart",De],["dragover",De],["dragend",De],["paste",De],["focus",De],["blur",De],["drop",De]];cn&&Ar.push(["beforeinput",(n,e)=>function(t,r){const i=t.inputType,o=yo(t);i==="deleteCompositionText"||Me&&to(r)||i!=="insertCompositionText"&&he(r,()=>{const s=I();if(i==="deleteContentBackward"){if(s===null){const h=qt();if(!P(h))return;be(h.clone())}if(P(s)){const h=s.anchor.key===s.focus.key;if(l=t.timeStamp,fo==="MediaLast"&&l<zt+Lr&&r.isComposing()&&h){if(re(null),zt=0,setTimeout(()=>{he(r,()=>{re(null)})},Lr),P(s)){const g=s.anchor.getNode();g.markDirty(),s.format=g.getFormat(),D(g)||O(142),s.style=g.getStyle()}}else{re(null),t.preventDefault();const g=s.anchor.getNode().getTextContent(),_=s.anchor.offset===0&&s.focus.offset===g.length;nl&&h&&!_||F(r,Ye,!0)}return}}var l;if(!P(s))return;const a=t.data;dt!==null&&mr(!1,r,dt),s.dirty&&dt===null||!s.isCollapsed()||oe(s.anchor.getNode())||o===null||s.applyDOMRange(o),dt=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":F(r,st,t);break;case"insertFromComposition":re(null),F(r,st,t);break;case"insertLineBreak":re(null),F(r,ot,!1);break;case"insertParagraph":re(null),$t&&!un?($t=!1,F(r,ot,!1)):F(r,rn,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":F(r,Xn,t);break;case"deleteByComposition":(function(h,g){return h!==g||C(h)||C(g)||!h.isToken()||!g.isToken()})(d,f)&&F(r,Qn,t);break;case"deleteByDrag":case"deleteByCut":F(r,Qn,t);break;case"deleteContent":F(r,Ye,!1);break;case"deleteWordBackward":F(r,Tt,!0);break;case"deleteWordForward":F(r,Tt,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":F(r,kt,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":F(r,kt,!1);break;case"formatStrikeThrough":F(r,ge,"strikethrough");break;case"formatBold":F(r,ge,"bold");break;case"formatItalic":F(r,ge,"italic");break;case"formatUnderline":F(r,ge,"underline");break;case"historyUndo":F(r,on,void 0);break;case"historyRedo":F(r,sn,void 0)}else{if(a===`
|
|
32
|
-
`)t.preventDefault(),
|
|
33
|
-
`){const r=
|
|
34
|
-
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(t){const r=t.parentElement;if(r!==null&&
|
|
31
|
+
`,ll=ze?" ":gn,Li="֑-߿יִ-﷽ﹰ-ﻼ",ji="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",al=new RegExp("^[^"+ji+"]*["+Li+"]"),cl=new RegExp("^[^"+Li+"]*["+ji+"]"),ke={bold:1,code:16,highlight:rr,italic:2,strikethrough:dn,subscript:32,superscript:64,underline:fn},ul={directionless:1,unmergeable:2},Ii={center:or,end:cr,justify:lr,left:ir,right:sr,start:ar},dl={[or]:"center",[cr]:"end",[lr]:"justify",[ir]:"left",[sr]:"right",[ar]:"start"},fl={normal:0,segmented:2,token:1},gl={[rl]:"normal",[ol]:"segmented",[il]:"token"};function hl(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var L=hl(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 hn(...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 pl=100;let ur=!1,dr=0;function _l(n){dr=n.timeStamp}function fr(n,e,t){return e.__lexicalLineBreak===n||n[`__lexicalKey_${t._key}`]!==void 0}function ml(n,e,t){const r=Te(t._window);let i=null,o=null;r!==null&&r.anchorNode===n&&(i=r.anchorOffset,o=r.focusOffset);const s=n.nodeValue;s!==null&&yr(e,s,i,o,!1)}function yl(n,e,t){if(k(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return e.nodeType===Re&&t.isAttached()}function Di(n,e,t){ur=!0;const r=performance.now()-dr>pl;try{he(n,()=>{const i=O()||function(d){return d.getEditorState().read(()=>{const g=O();return g!==null?g.clone():null})}(n),o=new Map,s=n.getRootElement(),l=n._editorState,a=n._blockCursorElement;let c=!1,u="";for(let d=0;d<e.length;d++){const g=e[d],h=g.type,m=g.target;let _=qe(m,l);if(!(_===null&&m!==s||Y(_))){if(h==="characterData")r&&j(_)&&yl(i,m,_)&&ml(m,_,n);else if(h==="childList"){c=!0;const v=g.addedNodes;for(let b=0;b<v.length;b++){const T=v[b],S=Ui(T),E=T.parentNode;if(E!=null&&T!==a&&S===null&&(T.nodeName!=="BR"||!fr(T,E,n))){if(ze){const N=T.innerText||T.nodeValue;N&&(u+=N)}E.removeChild(T)}}const x=g.removedNodes,y=x.length;if(y>0){let b=0;for(let T=0;T<y;T++){const S=x[T];(S.nodeName==="BR"&&fr(S,m,n)||a===S)&&(m.appendChild(S),b++)}y!==b&&(m===s&&(_=Ki(l)),o.set(m,_))}}}}if(o.size>0)for(const[d,g]of o)if(C(g)){const h=g.getChildrenKeys();let m=d.firstChild;for(let _=0;_<h.length;_++){const v=h[_],x=n.getElementByKey(v);x!==null&&(m==null?(d.appendChild(x),m=x):m!==x&&d.replaceChild(x,m),m=m.nextSibling)}}else j(g)&&g.markDirty();const f=t.takeRecords();if(f.length>0){for(let d=0;d<f.length;d++){const g=f[d],h=g.addedNodes,m=g.target;for(let _=0;_<h.length;_++){const v=h[_],x=v.parentNode;x==null||v.nodeName!=="BR"||fr(v,m,n)||x.removeChild(v)}}t.takeRecords()}i!==null&&(c&&(i.dirty=!0,Se(i)),ze&&to(n)&&i.insertRawText(u))})}finally{ur=!1}}function Oi(n){const e=n._observer;e!==null&&Di(n,e.takeRecords(),e)}function Ai(n){(function(e){dr===0&&Cn(e).addEventListener("textInput",_l,!0)})(n),n._observer=new MutationObserver((e,t)=>{Di(n,e,t)})}function Pi(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 zi(n,e){const t=n.mergeWithSibling(e),r=Z()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function Ri(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&j(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Pi(e,r)){r=zi(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&j(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Pi(r,t)){r=zi(r,t);break}break}t.remove()}}else r.remove()}function Fi(n){return Wi(n.anchor),Wi(n.focus),n}function Wi(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),j(r)){n.set(r.__key,i?r.getTextContentSize():0,"text");break}if(!C(r))break;n.set(r.__key,i?r.getChildrenSize():0,"element")}}let xl=1;const vl=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function gr(n){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return Y(qe(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&pn(e)==null)}function jt(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!gr(e)&&Bi(e)===n}catch{return!1}}function hr(n){return n instanceof Fn}function Bi(n){let e=n;for(;e!=null;){const t=pn(e);if(hr(t))return t;e=vn(e)}return null}function pn(n){return n?n.__lexicalEditor:null}function at(n){return n.isToken()||n.isSegmented()}function Cl(n){return n.nodeType===Re}function _n(n){let e=n;for(;e!=null;){if(Cl(e))return e;e=e.firstChild}return null}function pr(n,e,t){const r=ke[e];if(t!==null&&(n&r)==(t&r))return n;let i=n^r;return e==="subscript"?i&=~ke.superscript:e==="superscript"&&(i&=~ke.subscript),i}function Sl(n,e){if(e!=null)return void(n.__key=e);ge(),Wo();const t=Z(),r=Ie(),i=""+xl++;r._nodeMap.set(i,n),C(n)?t._dirtyElements.set(i,!0):t._dirtyLeaves.add(i),t._cloneNotNeeded.add(i),t._dirtyType=ki,n.__key=i}function Ze(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 mn(n){Wo();const e=n.getLatest(),t=e.__parent,r=Ie(),i=Z(),o=r._nodeMap,s=i._dirtyElements;t!==null&&function(a,c,u){let f=a;for(;f!==null;){if(u.has(f))return;const d=c.get(f);if(d===void 0)break;u.set(f,!1),f=d.__parent}}(t,o,s);const l=e.__key;i._dirtyType=ki,C(n)?s.set(l,!0):i._dirtyLeaves.add(l)}function re(n){ge();const e=Z(),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 Fe(){return Zt()?null:Z()._compositionKey}function se(n,e){const t=(e||Ie())._nodeMap.get(n);return t===void 0?null:t}function Ui(n,e){const t=n[`__lexicalKey_${Z()._key}`];return t!==void 0?se(t,e):null}function qe(n,e){let t=n;for(;t!=null;){const r=Ui(t,e);if(r!==null)return r;t=vn(t)}return null}function $i(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function Yi(n){return n.read(()=>G().getTextContent())}function G(){return Ki(Ie())}function Ki(n){return n._nodeMap.get("root")}function Se(n){ge();const e=Ie();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function ct(n){const e=Z(),t=function(r,i){let o=r;for(;o!=null;){const s=o[`__lexicalKey_${i._key}`];if(s!==void 0)return s;o=vn(o)}return null}(n,e);return t===null?n===e.getRootElement()?se("root"):null:se(t)}function Qi(n,e){return e?n.getTextContentSize():0}function Vi(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function _r(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function Ji(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function Zi(n){return n.nodeType===Re?n.nodeValue:null}function mr(n,e,t){const r=Te(e._window);if(r===null)return;const i=r.anchorNode;let{anchorOffset:o,focusOffset:s}=r;if(i!==null){let l=Zi(i);const a=qe(i);if(l!==null&&j(a)){if(l===gn&&t){const c=t.length;l=t,o=c,s=c}l!==null&&yr(a,l,o,s,n)}}}function yr(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]===gn&&(l=e.slice(0,-1));const a=o.getTextContent();if(i||l!==a){if(l===""){if(re(null),tr||un||nr)o.remove();else{const m=Z();setTimeout(()=>{m.update(()=>{o.isAttached()&&o.remove()})},20)}return}const c=o.getParent(),u=Jt(),f=o.getTextContentSize(),d=Fe(),g=o.getKey();if(o.isToken()||d!==null&&g===d&&!s||k(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===f&&!o.canInsertTextAfter()&&!s))return void o.markDirty();const h=O();if(!k(h)||t===null||r===null)return void o.setTextContent(l);if(h.setTextNodeRange(o,t,o,r),o.isSegmented()){const m=ie(o.getTextContent());o.replace(m),o=m}o.setTextContent(l)}}}function Tl(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(j(s)||C(s)&&s.isInline())&&!s.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!r.canInsertTextAfter()&&!e.isComposing()||i)}function qi(n){return n==="ArrowLeft"}function Gi(n){return n==="ArrowRight"}function It(n,e){return me?n:e}function Hi(n){return n==="Enter"}function Dt(n){return n==="Backspace"}function Ot(n){return n==="Delete"}function Xi(n,e,t){return n.toLowerCase()==="a"&&It(e,t)}function Nl(){const n=G();Se(Fi(n.select(0,n.getChildrenSize())))}function At(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=hn(i);return t[e]=o,o}return i}function xr(n,e,t,r,i){if(t.size===0)return;const o=r.__type,s=r.__key,l=e.get(o);l===void 0&&L(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),f=u==="destroyed"&&i==="created";(u===void 0||f)&&c.set(s,f?"updated":i)}function eo(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 Pt(n,e){const t=n.offset;if(n.type==="element")return eo(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?eo(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):i}}return null}function to(n){const e=Cn(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function D(n,e,t){return Ko(n,e,t)}function yn(n){return!oe(n)&&!n.isLastChild()&&!n.isInline()}function xn(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&L(75,e),t}function vn(n){const e=n.assignedSlot||n.parentElement;return e!==null&&e.nodeType===11?e.host:e}function vr(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function Cn(n){const e=n._window;return e===null&&L(78),e}function bl(n){let e=n.getParentOrThrow();for(;e!==null;){if(ut(e))return e;e=e.getParentOrThrow()}return e}function ut(n){return oe(n)||C(n)&&n.isShadowRoot()}function Sn(n){const e=Z(),t=n.constructor.getType(),r=e._nodes.get(t);r===void 0&&L(97);const i=r.replace;if(i!==null){const o=i(n);return o instanceof n.constructor||L(98),o}return n}function Cr(n,e){!oe(n.getParent())||C(e)||Y(e)||L(99)}function Sr(n){return(Y(n)||C(n)&&!n.canBeEmpty())&&!n.isInline()}function Tr(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function wl(n,e,t){let r=n._blockCursorElement;if(k(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())Sr(o.getChildAtIndex(s-1))&&(l=!0);else{const c=o.getChildAtIndex(s);if(Sr(c)){const u=c.getPreviousSibling();(u===null||Sr(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 f=u.theme,d=document.createElement("div");d.contentEditable="false",d.setAttribute("data-lexical-cursor","true");let g=f.blockCursor;if(g!==void 0){if(typeof g=="string"){const h=hn(g);g=f.blockCursor=h}g!==void 0&&d.classList.add(...g)}return d}(n._config)),e.style.caretColor="transparent",void(a===null?c.appendChild(r):c.insertBefore(r,a))}}r!==null&&Tr(r,n,e)}function Te(n){return _e?(n||window).getSelection():null}function Nr(n){return n.nodeType===1}function br(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 Tn(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 dt(n){if(oe(n)||Y(n)&&!n.isInline())return!0;if(!C(n)||ut(n))return!1;const e=n.getFirstChild(),t=e===null||Kt(e)||j(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 Ml(){return Z()}const no=new WeakMap,El=new Map;function kl(n){if(!n._readOnly&&n.isEmpty())return El;n._readOnly||L(192);let e=no.get(n);if(!e){e=new Map,no.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 Mr(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function ro(n,e,t,r,i,o){let s=n.getFirstChild();for(;s!==null;){const l=s.__key;s.__parent===e&&(C(s)&&ro(s,l,t,r,i,o),t.has(l)||o.delete(l),i.push(l)),s=s.getNextSibling()}}let We,le,zt,Nn,Er,kr,Ge,ye,Lr,Rt,X="",ae="",Ne=null,xe="",Le="",io=!1,Ft=!1,bn=null;function wn(n,e){const t=Ge.get(n);if(e!==null){const r=Or(n);r.parentNode===e&&e.removeChild(r)}if(ye.has(n)||le._keyToDOMMap.delete(n),C(t)){const r=En(t,Ge);jr(r,0,r.length-1,null)}t!==void 0&&xr(Rt,zt,Nn,t,"destroyed")}function jr(n,e,t,r){let i=e;for(;i<=t;++i){const o=n[i];o!==void 0&&wn(o,r)}}function He(n,e){n.setProperty("text-align",e)}const Ll="40px";function oo(n,e){const t=We.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")||Ll;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function so(n,e){const t=n.style;e===0?He(t,""):e===ir?He(t,"left"):e===or?He(t,"center"):e===sr?He(t,"right"):e===lr?He(t,"justify"):e===ar?He(t,"start"):e===cr&&He(t,"end")}function Mn(n,e,t){const r=ye.get(n);r===void 0&&L(60);const i=r.createDOM(We,le);if(function(o,s,l){const a=l._keyToDOMMap;s["__lexicalKey_"+l._key]=o,a.set(o,s)}(n,i,le),j(r)?i.setAttribute("data-lexical-text","true"):Y(r)&&i.setAttribute("data-lexical-decorator","true"),C(r)){const o=r.__indent,s=r.__size;if(o!==0&&oo(i,o),s!==0){const a=s-1;(function(c,u,f,d){const g=ae;ae="",Ir(c,f,0,u,d,null),co(f,d),ae=g})(En(r,ye),a,r,i)}const l=r.__format;l!==0&&so(i,l),r.isInline()||ao(null,r,i),yn(r)&&(X+=Ee,Le+=Ee)}else{const o=r.getTextContent();if(Y(r)){const s=r.decorate(le,We);s!==null&&uo(n,s),i.contentEditable="false"}else j(r)&&(r.isDirectionless()||(ae+=o));X+=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 xr(Rt,zt,Nn,r,"created"),i}function Ir(n,e,t,r,i,o){const s=X;X="";let l=t;for(;l<=r;++l){Mn(n[l],i,o);const a=ye.get(n[l]);a!==null&&j(a)&&(Ne===null&&(Ne=a.getFormat()),xe===""&&(xe=a.getStyle()))}yn(e)&&(X+=Ee),i.__lexicalTextContent=X,X=s+X}function lo(n,e){const t=e.get(n);return Kt(t)||Y(t)&&t.isInline()}function ao(n,e,t){const r=n!==null&&(n.__size===0||lo(n.__last,Ge)),i=e.__size===0||lo(e.__last,ye);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 co(n,e){const t=e.__lexicalDirTextContent,r=e.__lexicalDir;if(t!==ae||r!==bn){const o=ae==="",s=o?bn:(i=ae,al.test(i)?"rtl":cl.test(i)?"ltr":null);if(s!==r){const l=e.classList,a=We.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 f=hn(c);c=a[r]=f}l.remove(...c)}if(s===null||o&&s==="ltr")e.removeAttribute("dir");else{if(u!==void 0){if(typeof u=="string"){const f=hn(u);u=a[s]=f}u!==void 0&&l.add(...u)}e.dir=s}Ft||(n.getWritable().__dir=s)}bn=s,e.__lexicalDirTextContent=ae,e.__lexicalDir=s}var i}function jl(n,e,t){const r=ae;var i;ae="",Ne=null,xe="",function(o,s,l){const a=X,c=o.__size,u=s.__size;if(X="",c===1&&u===1){const f=o.__first,d=s.__first;if(f===d)Wt(f,l);else{const h=Or(f),m=Mn(d,null,null);try{l.replaceChild(m,h)}catch(_){if(typeof _=="object"&&_!=null){const v=`${_.toString()} Parent: ${l.tagName}, new child: {tag: ${m.tagName} key: ${d}}, old child: {tag: ${h.tagName}, key: ${f}}.`;throw new Error(v)}throw _}wn(f,null)}const g=ye.get(d);j(g)&&(Ne===null&&(Ne=g.getFormat()),xe===""&&(xe=g.getStyle()))}else{const f=En(o,Ge),d=En(s,ye);if(c===0)u!==0&&Ir(d,s,0,u-1,l,null);else if(u===0){if(c!==0){const g=l.__lexicalLineBreak==null;jr(f,0,c-1,g?null:l),g&&(l.textContent="")}}else(function(g,h,m,_,v,x){const y=_-1,b=v-1;let T,S,E=(R=x,R.firstChild),N=0,M=0;for(var R;N<=y&&M<=b;){const J=h[N],F=m[M];if(J===F)E=Dr(Wt(F,x)),N++,M++;else{T===void 0&&(T=new Set(h)),S===void 0&&(S=new Set(m));const ce=S.has(J),De=T.has(F);if(ce)if(De){const Ke=xn(le,F);Ke===E?E=Dr(Wt(F,x)):(E!=null?x.insertBefore(Ke,E):x.appendChild(Ke),Wt(F,x)),N++,M++}else Mn(F,x,E),M++;else E=Dr(Or(J)),wn(J,x),N++}const V=ye.get(F);V!==null&&j(V)&&(Ne===null&&(Ne=V.getFormat()),xe===""&&(xe=V.getStyle()))}const B=N>y,ee=M>b;if(B&&!ee){const J=m[b+1];Ir(m,g,M,b,x,J===void 0?null:le.getElementByKey(J))}else ee&&!B&&jr(h,N,y,x)})(s,f,d,c,u,l)}yn(s)&&(X+=Ee),l.__lexicalTextContent=X,X=a+X}(n,e,t),co(e,t),Xr(i=e)&&Ne!=null&&Ne!==i.__textFormat&&!Ft&&(i.setTextFormat(Ne),i.setTextStyle(xe)),function(o){Xr(o)&&xe!==""&&xe!==o.__textStyle&&!Ft&&o.setTextStyle(xe)}(e),ae=r}function En(n,e){const t=[];let r=n.__first;for(;r!==null;){const i=e.get(r);i===void 0&&L(101),t.push(r),r=i.__next}return t}function Wt(n,e){const t=Ge.get(n);let r=ye.get(n);t!==void 0&&r!==void 0||L(61);const i=io||kr.has(n)||Er.has(n),o=xn(le,n);if(t===r&&!i){if(C(t)){const s=o.__lexicalTextContent;s!==void 0&&(X+=s,Le+=s);const l=o.__lexicalDirTextContent;l!==void 0&&(ae+=l)}else{const s=t.getTextContent();j(t)&&!t.isDirectionless()&&(ae+=s),Le+=s,X+=s}return o}if(t!==r&&i&&xr(Rt,zt,Nn,r,"updated"),r.updateDOM(t,o,We)){const s=Mn(n,null,null);return e===null&&L(62),e.replaceChild(s,o),wn(n,null),s}if(C(t)&&C(r)){const s=r.__indent;s!==t.__indent&&oo(o,s);const l=r.__format;l!==t.__format&&so(o,l),i&&(jl(t,r,o),oe(r)||r.isInline()||ao(t,r,o)),yn(r)&&(X+=Ee,Le+=Ee)}else{const s=r.getTextContent();if(Y(r)){const l=r.decorate(le,We);l!==null&&uo(n,l)}else j(r)&&!r.isDirectionless()&&(ae+=s);X+=s,Le+=s}if(!Ft&&oe(r)&&r.__cachedText!==Le){const s=r.getWritable();s.__cachedText=Le,r=s}return o}function uo(n,e){let t=le._pendingDecorators;const r=le._decorators;if(t===null){if(r[n]===e)return;t=$i(le)}t[n]=e}function Dr(n){let e=n.nextSibling;return e!==null&&e===le._blockCursorElement&&(e=e.nextSibling),e}function Il(n,e,t,r,i,o){X="",Le="",ae="",io=r===lt,bn=null,le=t,We=t._config,zt=t._nodes,Nn=le._listeners.mutation,Er=i,kr=o,Ge=n._nodeMap,ye=e._nodeMap,Ft=e._readOnly,Lr=new Map(t._keyToDOMMap);const s=new Map;return Rt=s,Wt("root",null),le=void 0,zt=void 0,Er=void 0,kr=void 0,Ge=void 0,ye=void 0,We=void 0,Lr=void 0,Rt=void 0,s}function Or(n){const e=Lr.get(n);return e===void 0&&L(75,n),e}const je=Object.freeze({}),Ar=30,Pr=[["keydown",function(n,e){if(Bt=n.timeStamp,fo=n.key,e.isComposing())return;const{key:t,shiftKey:r,ctrlKey:i,metaKey:o,altKey:s}=n;D(e,Bs,n)||t!=null&&(function(l,a,c,u){return Gi(l)&&!a&&!u&&!c}(t,i,s,o)?D(e,mi,n):function(l,a,c,u,f){return Gi(l)&&!u&&!c&&(a||f)}(t,i,r,s,o)?D(e,Us,n):function(l,a,c,u){return qi(l)&&!a&&!u&&!c}(t,i,s,o)?D(e,yi,n):function(l,a,c,u,f){return qi(l)&&!u&&!c&&(a||f)}(t,i,r,s,o)?D(e,$s,n):function(l,a,c){return function(u){return u==="ArrowUp"}(l)&&!a&&!c}(t,i,o)?D(e,xi,n):function(l,a,c){return function(u){return u==="ArrowDown"}(l)&&!a&&!c}(t,i,o)?D(e,vi,n):function(l,a){return Hi(l)&&a}(t,r)?(Ut=!0,D(e,ln,n)):function(l){return l===" "}(t)?D(e,Ys,n):function(l,a){return me&&a&&l.toLowerCase()==="o"}(t,i)?(n.preventDefault(),Ut=!0,D(e,ot,!0)):function(l,a){return Hi(l)&&!a}(t,r)?(Ut=!1,D(e,ln,n)):function(l,a,c,u){return me?!a&&!c&&(Dt(l)||l.toLowerCase()==="h"&&u):!(u||a||c)&&Dt(l)}(t,s,o,i)?Dt(t)?D(e,Ci,n):(n.preventDefault(),D(e,Ve,!0)):function(l){return l==="Escape"}(t)?D(e,Si,n):function(l,a,c,u,f){return me?!(c||u||f)&&(Ot(l)||l.toLowerCase()==="d"&&a):!(a||u||f)&&Ot(l)}(t,i,r,s,o)?Ot(t)?D(e,Ti,n):(n.preventDefault(),D(e,Ve,!1)):function(l,a,c){return Dt(l)&&(me?a:c)}(t,s,i)?(n.preventDefault(),D(e,bt,!0)):function(l,a,c){return Ot(l)&&(me?a:c)}(t,s,i)?(n.preventDefault(),D(e,bt,!1)):function(l,a){return me&&a&&Dt(l)}(t,o)?(n.preventDefault(),D(e,wt,!0)):function(l,a){return me&&a&&Ot(l)}(t,o)?(n.preventDefault(),D(e,wt,!1)):function(l,a,c,u){return l.toLowerCase()==="b"&&!a&&It(c,u)}(t,s,o,i)?(n.preventDefault(),D(e,de,"bold")):function(l,a,c,u){return l.toLowerCase()==="u"&&!a&&It(c,u)}(t,s,o,i)?(n.preventDefault(),D(e,de,"underline")):function(l,a,c,u){return l.toLowerCase()==="i"&&!a&&It(c,u)}(t,s,o,i)?(n.preventDefault(),D(e,de,"italic")):function(l,a,c,u){return l==="Tab"&&!a&&!c&&!u}(t,s,i,o)?D(e,Ks,n):function(l,a,c,u){return l.toLowerCase()==="z"&&!a&&It(c,u)}(t,r,o,i)?(n.preventDefault(),D(e,on,void 0)):function(l,a,c,u){return me?l.toLowerCase()==="z"&&c&&a:l.toLowerCase()==="y"&&u||l.toLowerCase()==="z"&&u&&a}(t,r,o,i)?(n.preventDefault(),D(e,sn,void 0)):ve(e._editorState._selection)?function(l,a,c,u){return!a&&l.toLowerCase()==="c"&&(me?c:u)}(t,r,o,i)?(n.preventDefault(),D(e,an,n)):function(l,a,c,u){return!a&&l.toLowerCase()==="x"&&(me?c:u)}(t,r,o,i)?(n.preventDefault(),D(e,Xn,n)):Xi(t,o,i)&&(n.preventDefault(),D(e,er,n)):!ze&&Xi(t,o,i)&&(n.preventDefault(),D(e,er,n)),function(l,a,c,u){return l||a||c||u}(i,r,s,o)&&D(e,Xs,n))}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;t instanceof Node&&r!=="touch"&&he(e,()=>{Y(qe(t))||(Rr=!0)})}],["compositionstart",function(n,e){he(e,()=>{const t=O();if(k(t)&&!e.isComposing()){const r=t.anchor,i=t.anchor.getNode();re(r.key),(n.timeStamp<Bt+Ar||r.type==="element"||!t.isCollapsed()||i.getFormat()!==t.format||j(i)&&i.getStyle()!==t.style)&&D(e,st,ll)}})}],["compositionend",function(n,e){ze?$t=!0:he(e,()=>{Fr(e,n.data)})}],["input",function(n,e){n.stopPropagation(),he(e,()=>{const t=O(),r=n.data,i=yo(n);if(r!=null&&k(t)&&po(t,i,r,n.timeStamp,!1)){$t&&(Fr(e,r),$t=!1);const o=t.anchor.getNode(),s=Te(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;cn&&!t.isCollapsed()&&j(o)&&s.anchorNode!==null&&o.getTextContent().slice(0,a)+r+o.getTextContent().slice(a+c)===Zi(s.anchorNode)||D(e,st,r);const u=r.length;ze&&u>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),tr||un||nr||!e.isComposing()||(Bt=0,re(null))}else mr(!1,e,r!==null?r:void 0),$t&&(Fr(e,r||void 0),$t=!1);ge(),Oi(Z())}),ft=null}],["click",function(n,e){he(e,()=>{const t=O(),r=Te(e._window),i=Jt();if(r){if(k(t)){const o=t.anchor,s=o.getNode();o.type==="element"&&o.offset===0&&t.isCollapsed()&&!oe(s)&&G().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&i!==null&&t.is(i)?(r.removeAllRanges(),t.dirty=!0):n.detail===3&&!t.isCollapsed()&&s!==t.focus.getNode()&&(C(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===Lt||s===Re)&&Se(Vr(i,r,e,n))}}}D(e,_i,n)})}],["cut",je],["copy",je],["dragstart",je],["dragover",je],["dragend",je],["paste",je],["focus",je],["blur",je],["drop",je]];cn&&Pr.push(["beforeinput",(n,e)=>function(t,r){const i=t.inputType,o=yo(t);i==="deleteCompositionText"||ze&&to(r)||i!=="insertCompositionText"&&he(r,()=>{const s=O();if(i==="deleteContentBackward"){if(s===null){const g=Jt();if(!k(g))return;Se(g.clone())}if(k(s)){const g=s.anchor.key===s.focus.key;if(l=t.timeStamp,fo==="MediaLast"&&l<Bt+Ar&&r.isComposing()&&g){if(re(null),Bt=0,setTimeout(()=>{he(r,()=>{re(null)})},Ar),k(s)){const h=s.anchor.getNode();h.markDirty(),s.format=h.getFormat(),j(h)||L(142),s.style=h.getStyle()}}else{re(null),t.preventDefault();const h=s.anchor.getNode().getTextContent(),m=s.anchor.offset===0&&s.focus.offset===h.length;nl&&g&&!m||D(r,Ve,!0)}return}}var l;if(!k(s))return;const a=t.data;ft!==null&&mr(!1,r,ft),s.dirty&&ft===null||!s.isCollapsed()||oe(s.anchor.getNode())||o===null||s.applyDOMRange(o),ft=null;const c=s.anchor,u=s.focus,f=c.getNode(),d=u.getNode();if(i!=="insertText"&&i!=="insertTranspose")switch(t.preventDefault(),i){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":D(r,st,t);break;case"insertFromComposition":re(null),D(r,st,t);break;case"insertLineBreak":re(null),D(r,ot,!1);break;case"insertParagraph":re(null),Ut&&!un?(Ut=!1,D(r,ot,!1)):D(r,rn,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":D(r,Gn,t);break;case"deleteByComposition":(function(g,h){return g!==h||C(g)||C(h)||!g.isToken()||!h.isToken()})(f,d)&&D(r,Hn,t);break;case"deleteByDrag":case"deleteByCut":D(r,Hn,t);break;case"deleteContent":D(r,Ve,!1);break;case"deleteWordBackward":D(r,bt,!0);break;case"deleteWordForward":D(r,bt,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":D(r,wt,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":D(r,wt,!1);break;case"formatStrikeThrough":D(r,de,"strikethrough");break;case"formatBold":D(r,de,"bold");break;case"formatItalic":D(r,de,"italic");break;case"formatUnderline":D(r,de,"underline");break;case"historyUndo":D(r,on,void 0);break;case"historyRedo":D(r,sn,void 0)}else{if(a===`
|
|
32
|
+
`)t.preventDefault(),D(r,ot,!1);else if(a===Ee)t.preventDefault(),D(r,rn,void 0);else if(a==null&&t.dataTransfer){const g=t.dataTransfer.getData("text/plain");t.preventDefault(),s.insertRawText(g)}else a!=null&&po(s,o,a,t.timeStamp,!0)?(t.preventDefault(),D(r,st,a)):ft=a;go=t.timeStamp}})}(n,e)]);let Bt=0,fo=null,go=0,ft=null;const kn=new WeakMap;let zr=!1,Rr=!1,Ut=!1,$t=!1,ho=[0,"",0,"root",0];function po(n,e,t,r,i){const o=n.anchor,s=n.focus,l=o.getNode(),a=Z(),c=Te(a._window),u=c!==null?c.anchorNode:null,f=o.key,d=a.getElementByKey(f),g=t.length;return f!==s.key||!j(l)||(!i&&(!cn||go<r+50)||l.isDirty()&&g<2||Vi(t))&&o.offset!==s.offset&&!l.isComposing()||at(l)||l.isDirty()&&g>1||(i||!cn)&&d!==null&&!l.isComposing()&&u!==_n(d)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||l.getFormat()!==n.format||l.getStyle()!==n.style||Tl(n,l)}function _o(n,e){return n!==null&&n.nodeValue!==null&&n.nodeType===Re&&e!==0&&e!==n.nodeValue.length}function mo(n,e,t){const{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}=n;zr&&(zr=!1,_o(r,i)&&_o(o,s))||he(e,()=>{if(!t)return void Se(null);if(!jt(e,r,o))return;const l=O();if(k(l)){const a=l.anchor,c=a.getNode();if(l.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(l.dirty=!0);const u=Cn(e).event,f=u?u.timeStamp:performance.now(),[d,g,h,m,_]=ho,v=G(),x=e.isComposing()===!1&&v.getTextContent()==="";if(f<_+200&&a.offset===h&&a.key===m)l.format=d,l.style=g;else if(a.type==="text")j(c)||L(141),l.format=c.getFormat(),l.style=c.getStyle();else if(a.type==="element"&&!x){const y=a.getNode();l.style="",y instanceof pt&&y.getChildrenSize()===0?(l.format=y.getTextFormat(),l.style=y.getTextStyle()):l.format=0}}else{const u=a.key,f=l.focus.key,d=l.getNodes(),g=d.length,h=l.isBackward(),m=h?s:i,_=h?i:s,v=h?f:u,x=h?u:f;let y=sl,b=!1;for(let T=0;T<g;T++){const S=d[T],E=S.getTextContentSize();if(j(S)&&E!==0&&!(T===0&&S.__key===v&&m===E||T===g-1&&S.__key===x&&_===0)&&(b=!0,y&=S.getFormat(),y===0))break}l.format=b?y:0}}D(e,nn,void 0)})}function yo(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function Fr(n,e){const t=n._compositionKey;if(re(null),t!==null&&e!=null){if(e===""){const r=se(t),i=_n(n.getElementByKey(t));return void(i!==null&&i.nodeValue!==null&&j(r)&&yr(r,i.nodeValue,null,null,!0))}if(e[e.length-1]===`
|
|
33
|
+
`){const r=O();if(k(r)){const i=r.focus;return r.anchor.set(i.key,i.offset,i.type),void D(n,ln,null)}}}mr(!0,n,e)}function xo(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}const gt=new Map;function vo(n){const e=n.target,t=Te(e==null?null:e.nodeType===9?e.defaultView:e.ownerDocument.defaultView);if(t===null)return;const r=Bi(t.anchorNode);if(r===null)return;Rr&&(Rr=!1,he(r,()=>{const c=Jt(),u=t.anchorNode;if(u===null)return;const f=u.nodeType;f!==Lt&&f!==Re||Se(Vr(c,t,r,n))}));const i=_r(r),o=i[i.length-1],s=o._key,l=gt.get(s),a=l||o;a!==r&&mo(t,a,!1),mo(t,r,!0),r!==o?gt.set(s,r):l&>.delete(s)}function Co(n){n._lexicalHandled=!0}function So(n){return n._lexicalHandled===!0}function Dl(n){const e=n.ownerDocument,t=kn.get(e);t===void 0&&L(162);const r=t-1;r>=0||L(164),kn.set(e,r),r===0&&e.removeEventListener("selectionchange",vo);const i=pn(n);hr(i)?(function(s){if(s._parentEditor!==null){const l=_r(s),a=l[l.length-1]._key;gt.get(a)===s&>.delete(a)}else gt.delete(s._key)}(i),n.__lexicalEditor=null):i&&L(198);const o=xo(n);for(let s=0;s<o.length;s++)o[s]();n.__lexicalEventHandles=[]}function Wr(n,e,t){ge();const r=n.__key,i=n.getParent();if(i===null)return;const o=function(l){const a=O();if(!k(a)||!C(l))return a;const{anchor:c,focus:u}=a,f=c.getNode(),d=u.getNode();return vr(f,l)&&c.set(l.__key,0,"element"),vr(d,l)&&u.set(l.__key,0,"element"),a}(n);let s=!1;if(k(o)&&e){const l=o.anchor,a=o.focus;l.key===r&&(An(l,n,i,n.getPreviousSibling(),n.getNextSibling()),s=!0),a.key===r&&(An(a,n,i,n.getPreviousSibling(),n.getNextSibling()),s=!0)}else ve(o)&&e&&n.isSelected()&&n.selectPrevious();if(k(o)&&e&&!s){const l=n.getIndexWithinParent();Ze(n),On(o,i,l,-1)}else Ze(n);t||ut(i)||i.canBeEmpty()||!i.isEmpty()||Wr(i,e),e&&oe(i)&&i.isEmpty()&&i.selectEnd()}class Ln{static getType(){L(64,this.name)}static clone(e){L(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,Sl(this,e)}getType(){return this.__type}isInline(){L(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||O();if(t==null)return!1;const r=t.getNodes().some(i=>i.__key===this.__key);if(j(this))return r;if(k(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const i=this.getParent();if(Y(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&&L(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(ut(t))return C(e)||e===this&&Y(e)||L(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&L(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();C(this)&&t.unshift(this),C(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=C(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,f=c;do{if(f===null&&L(68),u=t?f.getNextSibling():f.getPreviousSibling(),f=f.getParent(),f===null)break;u!==null||i.has(f.__key)||r.push(f)}while(u===null);o=u}return t||r.reverse(),r}isDirty(){const e=Z()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){const e=se(this.__key);return e===null&&L(113),e}getWritable(){ge();const e=Ie(),t=Z(),r=e._nodeMap,i=this.__key,o=this.getLatest(),s=t._cloneNotNeeded,l=O();if(l!==null&&l.setCachedNodes(null),s.has(i))return mn(o),o;const a=Mr(o);return s.add(i),mn(a),r.set(i,a),a}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){L(70)}updateDOM(e,t,r){L(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){L(72)}static importJSON(e){L(18,this.name)}static transform(){return null}remove(e){Wr(this,!0,e)}replace(e,t){ge();let r=O();r!==null&&(r=r.clone()),Cr(this,e);const i=this.getLatest(),o=this.__key,s=e.__key,l=e.getWritable(),a=this.getParentOrThrow().getWritable(),c=a.__size;Ze(l);const u=i.getPreviousSibling(),f=i.getNextSibling(),d=i.__prev,g=i.__next,h=i.__parent;if(Wr(i,!1,!0),u===null?a.__first=s:u.getWritable().__next=s,l.__prev=d,f===null?a.__last=s:f.getWritable().__prev=s,l.__next=g,l.__parent=h,a.__size=c,t&&(C(this)&&C(l)||L(139),this.getChildren().forEach(m=>{l.append(m)})),k(r)){Se(r);const m=r.anchor,_=r.focus;m.key===o&&Eo(m,l),_.key===o&&Eo(_,l)}return Fe()===o&&re(s),l}insertAfter(e,t=!0){ge(),Cr(this,e);const r=this.getWritable(),i=e.getWritable(),o=i.getParent(),s=O();let l=!1,a=!1;if(o!==null){const g=e.getIndexWithinParent();if(Ze(i),k(s)){const h=o.__key,m=s.anchor,_=s.focus;l=m.type==="element"&&m.key===h&&m.offset===g+1,a=_.type==="element"&&_.key===h&&_.offset===g+1}}const c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),f=i.__key,d=r.__next;if(c===null?u.__last=f:c.getWritable().__prev=f,u.__size++,r.__next=f,i.__next=d,i.__prev=r.__key,i.__parent=r.__parent,t&&k(s)){const g=this.getIndexWithinParent();On(s,u,g+1);const h=u.__key;l&&s.anchor.set(h,g+2,"element"),a&&s.focus.set(h,g+2,"element")}return e}insertBefore(e,t=!0){ge(),Cr(this,e);const r=this.getWritable(),i=e.getWritable(),o=i.__key;Ze(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=O();return t&&k(u)&&On(u,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return we()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){ge();const r=this.getPreviousSibling(),i=this.getParentOrThrow();if(r===null)return i.select(0,0);if(C(r))return r.select();if(!j(r)){const o=r.getIndexWithinParent()+1;return i.select(o,o)}return r.select(e,t)}selectNext(e,t){ge();const r=this.getNextSibling(),i=this.getParentOrThrow();if(r===null)return i.select();if(C(r))return r.select(0,0);if(!j(r)){const o=r.getIndexWithinParent();return i.select(o,o)}return r.select(e,t)}markDirty(){this.getWritable()}}class Yt extends Ln{static getType(){return"linebreak"}static clone(e){return new Yt(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&&Tn(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&jn(i)){const o=r.lastChild;if(o===t||o.previousSibling===t&&jn(o))return!0}}return!1}(e)||function(t){const r=t.parentElement;if(r!==null&&Tn(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&jn(i))return!1;const o=r.lastChild;if(o===t||o.previousSibling===t&&jn(o))return!0}return!1}(e)?null:{conversion:Ol,priority:0}}}static importJSON(e){return Xe()}exportJSON(){return{type:"linebreak",version:1}}}function Ol(n){return{node:Xe()}}function Xe(){return Sn(new Yt)}function Kt(n){return n instanceof Yt}function jn(n){return n.nodeType===Re&&/^( |\t|\r?\n)+$/.test(n.textContent||"")}function Br(n,e){return 16&e?"code":e&rr?"mark":32&e?"sub":64&e?"sup":null}function Ur(n,e){return 1&e?"strong":2&e?"em":"span"}function To(n,e,t,r,i){const o=r.classList;let s=At(i,"base");s!==void 0&&o.add(...s),s=At(i,"underlineStrikethrough");let l=!1;const a=e&fn&&e&dn;s!==void 0&&(t&fn&&t&dn?(l=!0,a||o.add(...s)):a&&o.remove(...s));for(const c in ke){const u=ke[c];if(s=At(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 No(n,e,t){const r=e.firstChild,i=t.isComposing(),o=n+(i?gn:"");if(r==null)e.textContent=o;else{const s=r.nodeValue;if(s!==o)if(i||ze){const[l,a,c]=function(u,f){const d=u.length,g=f.length;let h=0,m=0;for(;h<d&&h<g&&u[h]===f[h];)h++;for(;m+h<d&&m+h<g&&u[d-m-1]===f[g-m-1];)m++;return[h,d-h-m,f.slice(h,g-m)]}(s,o);a!==0&&r.deleteData(l,a),r.insertData(l,c)}else r.nodeValue=o}}function bo(n,e,t,r,i,o){No(i,n,e);const s=o.theme.text;s!==void 0&&To(0,0,r,n,s)}function In(n,e){const t=document.createElement(e);return t.appendChild(n),t}class ht extends Ln{static getType(){return"text"}static clone(e){return new ht(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 gl[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Fe()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=ke[e];return!!(this.getFormat()&t)}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return pr(this.getLatest().__format,e,t)}canHaveFormat(){return!0}createDOM(e,t){const r=this.__format,i=Br(0,r),o=Ur(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)),bo(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=Br(0,o),a=Br(0,s),c=Ur(0,o),u=Ur(0,s);if((l===null?c:l)!==(a===null?u:a))return!0;if(l===a&&c!==u){const m=t.firstChild;m==null&&L(48);const _=document.createElement(u);return bo(_,this,0,s,i,r),t.replaceChild(_,m),!1}let f=t;a!==null&&l!==null&&(f=t.firstChild,f==null&&L(49)),No(i,f,this);const d=r.theme.text;d!==void 0&&o!==s&&To(0,o,s,f,d);const g=e.__style,h=this.__style;return g!==h&&(t.style.cssText=h),!1}static importDOM(){return{"#text":()=>({conversion:Rl,priority:0}),b:()=>({conversion:Pl,priority:0}),code:()=>({conversion:Be,priority:0}),em:()=>({conversion:Be,priority:0}),i:()=>({conversion:Be,priority:0}),s:()=>({conversion:Be,priority:0}),span:()=>({conversion:Al,priority:0}),strong:()=>({conversion:Be,priority:0}),sub:()=>({conversion:Be,priority:0}),sup:()=>({conversion:Be,priority:0}),u:()=>({conversion:Be,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&&Nr(t)||L(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=In(t,"b")),this.hasFormat("italic")&&(t=In(t,"i")),this.hasFormat("strikethrough")&&(t=In(t,"s")),this.hasFormat("underline")&&(t=In(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"?ke[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail=typeof e=="string"?ul[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=pr(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=fl[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){ge();let r=e,i=t;const o=O(),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(!k(o))return Ao(l,r,l,i,"text","text");{const a=Fe();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=O();if(i&&k(c)){const f=e+l;c.setTextNodeRange(o,f,o,f)}const u=s.slice(0,a)+r+s.slice(a+t);return o.__text=u,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){ge();const t=this.getLatest(),r=t.getTextContent(),i=t.__key,o=Fe(),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 f=l[0],d=t.getParent();let g;const h=t.getFormat(),m=t.getStyle(),_=t.__detail;let v=!1;t.isSegmented()?(g=ie(f),g.__format=h,g.__style=m,g.__detail=_,v=!0):(g=t.getWritable(),g.__text=f);const x=O(),y=[g];let b=f.length;for(let T=1;T<u;T++){const S=l[T],E=S.length,N=ie(S).getWritable();N.__format=h,N.__style=m,N.__detail=_;const M=N.__key,R=b+E;if(k(x)){const B=x.anchor,ee=x.focus;B.key===i&&B.type==="text"&&B.offset>b&&B.offset<=R&&(B.key=M,B.offset-=b,x.dirty=!0),ee.key===i&&ee.type==="text"&&ee.offset>b&&ee.offset<=R&&(ee.key=M,ee.offset-=b,x.dirty=!0)}o===i&&re(M),b=R,y.push(N)}if(d!==null){(function(E){const N=E.getPreviousSibling(),M=E.getNextSibling();N!==null&&mn(N),M!==null&&mn(M)})(this);const T=d.getWritable(),S=this.getIndexWithinParent();v?(T.splice(S,0,y),this.remove()):T.splice(S,1,y),k(x)&&On(x,d,S,u-1)}return y}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||L(50);const r=this.__key,i=e.__key,o=this.__text,s=o.length;Fe()===i&&re(r);const l=O();if(k(l)){const f=l.anchor,d=l.focus;f!==null&&f.key===i&&(Ro(f,t,r,e,s),l.dirty=!0),d!==null&&d.key===i&&(Ro(d,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 Al(n){return{forChild:$r(n.style),node:null}}function Pl(n){const e=n,t=e.style.fontWeight==="normal";return{forChild:$r(e.style,t?void 0:"bold"),node:null}}const wo=new WeakMap;function zl(n){return n.nodeName==="PRE"||n.nodeType===Lt&&n.style!==void 0&&n.style.whiteSpace!==void 0&&n.style.whiteSpace.startsWith("pre")}function Rl(n){const e=n;n.parentElement===null&&L(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&&!zl(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===`
|
|
35
35
|
`||l===`\r
|
|
36
|
-
`?i.push(
|
|
37
|
-
`),u=!
|
|
36
|
+
`?i.push(Xe()):l===" "?i.push(Vt()):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=Mo(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=Mo(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 Mo(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===Lt){const o=t.style.display;if(o===""&&!br(t)||o!==""&&!o.startsWith("inline"))return null}let i=t;for(;(i=e?t.firstChild:t.lastChild)!==null;)t=i;if(t.nodeType===Re)return t;if(t.nodeName==="BR")return null}}const Fl={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Be(n){const e=Fl[n.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:$r(n.style,e),node:null}}function ie(n=""){return Sn(new ht(n))}function j(n){return n instanceof ht}function $r(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=>(j(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 ht{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=Vt();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){L(126)}setDetail(e){L(127)}setMode(e){L(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Vt(){return Sn(new Qt)}function Wl(n){return n instanceof Qt}class Bl{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(C(t)){const s=t.getDescendantByIndex(i);t=s??t}if(C(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&&L(20),e}set(e,t,r){const i=this._selection,o=this.key;this.key=e,this.offset=t,this.type=r,Zt()||(Fe()===o&&re(e),i!==null&&(i.setCachedNodes(null),i.dirty=!0))}}function be(n,e,t){return new Bl(n,e,t)}function Yr(n,e){let t=e.__key,r=n.offset,i="element";if(j(e)){i="text";const o=e.getTextContentSize();r>o&&(r=o)}else if(!C(e)){const o=e.getNextSibling();if(j(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 Eo(n,e){if(C(e)){const t=e.getLastDescendant();C(t)||j(t)?Yr(n,t):Yr(n,e)}else Yr(n,e)}function Ue(n,e,t,r){n.key=e,n.offset=t,n.type=r}class Dn{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!ve(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 Dn(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(j(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 Zt()||(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 k(n){return n instanceof $e}class $e{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!!k(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(C(l)){const d=l.getDescendantByIndex(c);l=d??l}if(C(a)){let d=a.getDescendantByIndex(u);d!==null&&d!==l&&a.getChildAtIndex(u)===d&&(d=d.getPreviousSibling()),a=d??a}let f;return f=l.is(a)?C(l)&&l.getChildrenSize()>0?[]:[l]:l.getNodesBetween(a),Zt()||(this._cachedNodes=f),f}setTextNodeRange(e,t,r,i){Ue(this.anchor,e.__key,t,"text"),Ue(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]=Kr(this);let c="",u=!0;for(let f=0;f<e.length;f++){const d=e[f];if(C(d)&&!d.isInline())u||(c+=`
|
|
37
|
+
`),u=!d.isEmpty();else if(u=!1,j(d)){let g=d.getTextContent();d===t?d===r?i.type==="element"&&o.type==="element"&&o.offset!==i.offset||(g=l<a?g.slice(l,a):g.slice(a,l)):g=s?g.slice(l):g.slice(a):d===r&&(g=s?g.slice(0,a):g.slice(0,l)),c+=g}else!Y(d)&&!Kt(d)||d===r&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(e){const t=Z(),r=t.getEditorState()._selection,i=Oo(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,r);if(i===null)return;const[o,s]=i;Ue(this.anchor,o.key,o.offset,o.type),Ue(this.focus,s.key,s.offset,s.type),this._cachedNodes=null}clone(){const e=this.anchor,t=this.focus;return new $e(be(e.key,e.offset,e.type),be(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=pr(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=ke[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(Ze()):s===" "?r.push(Yt()):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(m,x,y,v){const T=m.getNode(),S=T.getChildAtIndex(m.offset),b=ie(),N=oe(T)?ke().append(b):b;b.setFormat(y),b.setStyle(v),S===null?T.append(N):S.insertBefore(N),m.is(x)&&x.set(b.__key,0,"text"),m.set(b.__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)||O(26);const h=f.getTextContent().length,g=f.getParentOrThrow();let _=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 m=f.getNextSibling();if(D(m)&&m.canInsertTextBefore()&&!at(m)||(m=ie(),m.setFormat(i),m.setStyle(o),g.canInsertTextAfter()?f.insertAfter(m):g.insertAfter(m)),m.select(0,0),f=m,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&a===0&&(f.isSegmented()||f.isToken()||!f.canInsertTextBefore()||!g.canInsertTextBefore()&&f.getPreviousSibling()===null)){let m=f.getPreviousSibling();if(D(m)&&!at(m)||(m=ie(),m.setFormat(i),g.canInsertTextBefore()?f.insertBefore(m):g.insertBefore(m)),m.select(),f=m,e!=="")return void this.insertText(e)}else if(f.isSegmented()&&a!==h){const m=ie(f.getTextContent());m.setFormat(i),f.replace(m),f=m}else if(!this.isCollapsed()&&e!==""){const m=_.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||C(m)&&(!m.canInsertTextBefore()||!m.canInsertTextAfter()))return this.insertText(""),Fo(this.anchor,this.focus,null),void this.insertText(e)}if(d===1){if(f.isToken()){const v=ie(e);return v.select(),void f.replace(v)}const m=f.getFormat(),x=f.getStyle();if(a!==c||m===i&&x===o){if(Bl(f)){const v=ie(e);return v.setFormat(i),v.setStyle(o),v.select(),void f.replace(v)}}else{if(f.getTextContent()!==""){const v=ie(e);if(v.setFormat(i),v.setStyle(o),v.select(),a===0)f.insertBefore(v,!1);else{const[T]=f.splitText(a);T.insertAfter(v,!1)}return void(v.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}f.setFormat(i),f.setStyle(o)}const y=c-a;f=f.spliceText(a,y,e,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(f.isComposing()?this.anchor.offset-=e.length:(this.format=m,this.style=x))}else{const m=new Set([...f.getParentKeys(),..._.getParentKeys()]),x=C(f)?f:f.getParentOrThrow();let y=C(_)?_:_.getParentOrThrow(),v=_;if(!x.is(y)&&y.isInline())do v=y,y=y.getParentOrThrow();while(y.isInline());if(l.type==="text"&&(c!==0||_.getTextContent()==="")||l.type==="element"&&_.getIndexWithinParent()<c)if(D(_)&&!_.isToken()&&c!==_.getTextContentSize()){if(_.isSegmented()){const w=ie(_.getTextContent());_.replace(w),_=w}oe(l.getNode())||l.type!=="text"||(_=_.spliceText(0,c,"")),m.add(_.__key)}else{const w=_.getParentOrThrow();w.canBeEmpty()||w.getChildrenSize()!==1?_.remove():w.remove()}else m.add(_.__key);const T=y.getChildren(),S=new Set(u),b=x.is(y),N=x.isInline()&&f.getNextSibling()===null?x:f;for(let w=T.length-1;w>=0;w--){const E=T[w];if(E.is(f)||C(E)&&E.isParentOf(f))break;E.isAttached()&&(!S.has(E)||E.is(v)?b||N.insertAfter(E,!1):E.remove())}if(!b){let w=y,E=null;for(;w!==null;){const j=w.getChildren(),z=j.length;(z===0||j[z-1].is(E))&&(m.delete(w.__key),E=w),w=w.getParent()}}if(f.isToken())if(a===h)f.select();else{const w=ie(e);w.select(),f.replace(w)}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 w=1;w<d;w++){const E=u[w],j=E.__key;m.has(j)||E.remove()}}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed())return this.toggleFormat(e),void re(null);const t=this.getNodes(),r=[];for(const y of t)D(y)&&r.push(y);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 _=r[g];const m=c.type==="text"?c.offset:_.getTextContentSize();if(d.is(_)){if(f===m)return;if(at(d)||f===0&&m===d.getTextContentSize())d.setFormat(h);else{const y=d.splitText(f,m),v=f===0?y[0]:y[1];v.setFormat(h),a.type==="text"&&a.set(v.__key,0,"text"),c.type==="text"&&c.set(v.__key,m-f,"text")}return void(this.format=h)}f===0||at(d)||([,d]=d.splitText(f),f=0),d.setFormat(h);const x=_.getFormatFlags(e,h);m>0&&(m===_.getTextContentSize()||at(_)||([_]=_.splitText(m)),_.setFormat(x));for(let y=u+1;y<g;y++){const v=r[y],T=v.getFormatFlags(e,x);v.setFormat(T)}a.type==="text"&&a.set(d.__key,f,"text"),c.type==="text"&&c.set(_.__key,m,"text"),this.format=h|x}insertNodes(e){if(e.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const h=I();return P(h)||O(134),h.insertNodes(e)}const t=kr((this.isBackward()?this.focus:this.anchor).getNode(),ft),r=e[e.length-1];if("__language"in t&&C(t)){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const h=qr(this);t.splice(h,0,e),r.selectEnd()}return}if(!e.some(h=>(C(h)||U(h))&&!h.isInline())){C(t)||O(135);const h=qr(this);return t.splice(h,0,e),void r.selectEnd()}const i=function(h){const g=ke();let _=null;for(let m=0;m<h.length;m++){const x=h[m],y=Jt(x);if(y||U(x)&&x.isInline()||C(x)&&x.isInline()||D(x)||x.isParentRequired()){if(_===null&&(_=x.createParentElementNode(),g.append(_),y))continue;_!==null&&_.append(x)}else g.append(x),_=null}return g}(e),o=i.getLastDescendant(),s=i.getChildren(),l=!C(t)||!t.isEmpty()?this.insertParagraph():null,a=s[s.length-1];let c=s[0];var u;C(u=c)&&ft(u)&&!u.isEmpty()&&C(t)&&(!t.isEmpty()||t.canMergeWhenEmpty())&&(C(t)||O(135),t.append(...c.getChildren()),c=s[1]),c&&function(h,g,_){const m=g.getParentOrThrow().getLastChild();let x=g;const y=[g];for(;x!==m;)x.getNextSibling()||O(140),x=x.getNextSibling(),y.push(x);let v=h;for(const T of y)v=v.insertAfter(T)}(t,c);const d=kr(o,ft);l&&C(d)&&(l.canMergeWhenEmpty()||ft(a))&&(d.append(...l.getChildren()),l.remove()),C(t)&&t.isEmpty()&&t.remove(),o.selectEnd();const f=C(t)?t.getLastChild():null;Jt(f)&&d!==t&&f.remove()}insertParagraph(){if(this.anchor.key==="root"){const s=ke();return X().splice(this.anchor.offset,0,[s]),s.select(),s}const e=qr(this),t=kr(this.anchor.getNode(),ft);C(t)||O(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=Ze();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]=Jr(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=At(i,t);if(U(l)&&!l.isIsolated()){if(s&&l.isKeyboardSelectable()){const h=Ao();return h.add(l.__key),void be(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,_;return C(f)?(_=f.__key,g=t?f.getChildrenSize():0):(g=l.getIndexWithinParent(),_=h.__key,t||g++),i.set(_,g,"element"),void(s&&o.set(_,g,"element"))}}const a=H(),c=Se(a._window);if(!c)return;const u=a._blockCursorElement,d=a._rootElement;if(d===null||u===null||!C(l)||l.isInline()||l.canBeEmpty()||Sr(u,a,d),function(f,h,g,_){f.modify(h,g,_)}(c,e,t?"backward":"forward",r),c.rangeCount>0){const f=c.getRangeAt(0),h=this.anchor.getNode(),g=oe(h)?h:Tl(h);if(this.applyDOMRange(f),this.dirty=!0,!s){const _=this.getNodes(),m=[];let x=!1;for(let y=0;y<_.length;y++){const v=_[y];xr(v,g)?m.push(v):x=!0}if(x&&m.length>0)if(t){const y=m[0];C(y)?y.selectStart():y.getParentOrThrow().selectStart()}else{const y=m[m.length-1];C(y)?y.selectEnd():y.getParentOrThrow().selectEnd()}c.anchorNode===f.startContainer&&c.anchorOffset===f.startOffset||function(y){const v=y.focus,T=y.anchor,S=T.key,b=T.offset,N=T.type;$e(T,v.key,v.offset,v.type),$e(v,S,b,N),y._cachedNodes=null}(this)}}}forwardDeletion(e,t,r){if(!r&&(e.type==="element"&&C(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(C(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=At(o,e);if(U(s)&&!s.isIsolated()){if(s.isKeyboardSelectable()&&C(i)&&i.getChildrenSize()===0){i.remove();const l=Ao();l.add(s.__key),be(l)}else s.remove(),H().dispatchCommand(nn,void 0);return}if(!e&&C(s)&&C(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 Oo(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 Oo(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,_=d.offset,m=g<_,x=m?g:_,y=m?_:g,v=y-1;x!==v&&(Yi(f.getTextContent().slice(x,y))||(c?d.offset=v:u.offset=v))}})(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 xe(n){return n instanceof Fn}function Po(n){const e=n.offset;if(n.type==="text")return e;const t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function Jr(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]:[Po(t),Po(r)]}function Oo(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 Do(n,e,t,r){let i,o=e;if(n.nodeType===Ot){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=ct(u),D(i))o=Vi(i,s);else{let f=ct(n);if(f===null)return null;if(C(f)){o=Math.min(f.getChildrenSize(),o);let h=f.getChildAtIndex(o);if(C(h)&&function(g,_,m){const x=g.getParent();return m===null||x===null||!x.canBeEmpty()||x!==m.getNode()}(h,0,t)){const g=s?h.getLastDescendant():h.getFirstDescendant();g===null?f=h:(h=g,f=C(h)?h:h.getParentOrThrow()),o=0}D(h)?(i=h,f=null,o=Vi(h,s)):h!==f&&s&&!d&&o++}else{const h=f.getIndexWithinParent();o=e===0&&U(f)&&ct(n)===f?h:h+1,f=f.getParentOrThrow()}if(C(f))return Te(f.__key,o,"element")}}else i=ct(n);return D(i)?Te(i.__key,o,"text"):null}function Ro(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&&C(s)&&s.isInline()){const l=s.getPreviousSibling();D(l)&&(n.key=l.__key,n.offset=l.getTextContent().length)}}else C(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&&C(o)&&o.isInline())n.key=o.__key,n.offset=0,n.type="element";else if((t||e)&&o===null&&C(s)&&s.isInline()&&!s.canInsertTextAfter()){const l=s.getNextSibling();D(l)&&(n.key=l.__key,n.offset=0)}}}function Fo(n,e,t){if(n.type==="text"&&e.type==="text"){const r=n.isBefore(e),i=n.is(e);Ro(n,r,i),Ro(e,!r,i),i&&(e.key=n.key,e.offset=n.offset,e.type=n.type);const o=H();if(o.isComposing()&&o._compositionKey!==n.key&&P(t)){const s=t.anchor,l=t.focus;$e(n,s.key,s.offset,s.type),$e(e,l.key,l.offset,l.type)}}}function Io(n,e,t,r,i,o){if(n===null||t===null||!Dt(i,n,t))return null;const s=Do(n,e,P(o)?o.anchor:null,i);if(s===null)return null;const l=Do(t,r,P(o)?o.focus:null,i);if(l===null)return null;if(s.type==="element"&&l.type==="element"){const a=ct(n),c=ct(t);if(U(a)&&U(c))return null}return Fo(s,l,o),[s,l]}function Vr(n){return C(n)&&!n.isInline()}function Lo(n,e,t,r,i,o){const s=Re(),l=new Ke(Te(n,e,i),Te(t,r,o),0,"");return l.dirty=!0,s._selection=l,l}function $l(){const n=Te("root",0,"element"),e=Te("root",0,"element");return new Ke(n,e,0,"")}function Ao(){return new Fn(new Set)}function Yr(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=!ur&&(l||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&o&&o.detail===3||s==="drop"||s===void 0);let c,u,d,f;if(P(n)&&!a)return n.clone();if(e===null)return null;if(c=e.anchorNode,u=e.focusNode,d=e.anchorOffset,f=e.focusOffset,l&&P(n)&&!Dt(t,c,u))return n.clone();const h=Io(c,d,u,f,t,n);if(h===null)return null;const[g,_]=h;return new Ke(g,_,P(n)?n.format:0,P(n)?n.style:"")}function I(){return Re()._selection}function qt(){return H()._editorState._selection}function In(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"),Mo(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")}}Mo(n)}function Mo(n){const e=n.anchor,t=e.offset,r=n.focus,i=r.offset,o=e.getNode(),s=r.getNode();if(n.isCollapsed()){if(!C(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(C(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(C(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 Ln(n,e,t,r,i){let o=null,s=0,l=null;r!==null?(o=r.__key,D(r)?(s=r.getTextContentSize(),l="text"):C(r)&&(s=r.getChildrenSize(),l="element")):i!==null&&(o=i.__key,D(i)?l="text":C(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 jo(n,e,t,r,i){n.type==="text"?(n.key=t,e||(n.offset+=i)):n.offset>r.getIndexWithinParent()&&(n.offset-=1)}function Kl(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&&hr(d))return;if(!P(e))return void(n!==null&&Dt(t,l,a)&&r.removeAllRanges());const f=e.anchor,h=e.focus,g=f.key,_=h.key,m=vn(t,g),x=vn(t,_),y=f.offset,v=h.offset,T=e.format,S=e.style,b=e.isCollapsed();let N=m,w=x,E=!1;if(f.type==="text"){N=_n(m);const Y=f.getNode();E=Y.getFormat()!==T||Y.getStyle()!==S}else P(n)&&n.anchor.type==="text"&&(E=!0);var j,z,ee,q,W;if(h.type==="text"&&(w=_n(x)),N!==null&&w!==null&&(b&&(n===null||E||P(n)&&(n.format!==T||n.style!==S))&&(j=T,z=S,ee=y,q=g,W=performance.now(),go=[j,z,ee,q,W]),c!==y||u!==v||l!==N||a!==w||r.type==="Range"&&b||(d!==null&&o.contains(d)||o.focus({preventScroll:!0}),f.type==="element"))){try{r.setBaseAndExtent(N,y,w,v)}catch{}if(!i.has("skip-scroll-into-view")&&e.isCollapsed()&&o!==null&&o===document.activeElement){const Y=e instanceof Ke&&e.anchor.type==="element"?N.childNodes[y]||null:r.rangeCount>0?r.getRangeAt(0):null;if(Y!==null){let ce;if(Y instanceof Text){const Fe=document.createRange();Fe.selectNode(Y),ce=Fe.getBoundingClientRect()}else ce=Y.getBoundingClientRect();(function(Fe,Je,Qt){const Zt=Qt.ownerDocument,en=Zt.defaultView;if(en===null)return;let{top:vt,bottom:xt}=Je,Ct=0,bt=0,pe=Qt;for(;pe!==null;){const nt=pe===Zt.body;if(nt)Ct=0,bt=Cn(Fe).innerHeight;else{const Ve=pe.getBoundingClientRect();Ct=Ve.top,bt=Ve.bottom}let Ee=0;if(vt<Ct?Ee=-(Ct-vt):xt>bt&&(Ee=xt-bt),Ee!==0)if(nt)en.scrollBy(0,Ee);else{const Ve=pe.scrollTop;pe.scrollTop+=Ee;const rt=pe.scrollTop-Ve;vt-=rt,xt-=rt}if(nt)break;pe=xn(pe)}})(t,ce,o)}}Mr=!0}}function Ul(n){let e=I()||qt();e===null&&(e=X().selectEnd()),e.insertNodes(n)}function qr(n){let e=n;n.isCollapsed()||e.removeText();const t=I();P(t)&&(e=t),P(e)||O(161);const r=e.anchor;let i=r.getNode(),o=r.offset;for(;!ft(i);)[i,o]=Jl(i,o);return o}function Jl(n,e){const t=n.getParent();if(!t){const i=ke();return X().append(i),i.select(),[X(),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(!C(n)||e===0)return[t,n.getIndexWithinParent()];const r=n.getChildAtIndex(e);if(r){const i=new Ke(Te(n.__key,e,"element"),Te(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,fe=!1,Hr=!1,An=0;const Wo={characterData:!0,childList:!0,subtree:!0};function Ht(){return fe||te!==null&&te._readOnly}function de(){fe&&O(13)}function Bo(){An>99&&O(14)}function Re(){return te===null&&O(195,zo()),te}function H(){return ne===null&&O(196,zo()),ne}function zo(){let n=0;const e=new Set,t=Wn.version;if(typeof window<"u")for(const i of document.querySelectorAll("[contenteditable]")){const o=pn(i);if(gr(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 Vl(){return ne}function $o(n,e,t){const r=e.__type,i=function(l,a){const c=l._nodes.get(a);return c===void 0&&O(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 Ko(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function Yl(n){return Gr(n,H()._nodes)}function Gr(n,e){const t=n.type,r=e.get(t);r===void 0&&O(17,t);const i=r.klass;n.type!==i.getType()&&O(18,i.name);const o=i.importJSON(n),s=n.children;if(C(o)&&Array.isArray(s))for(let l=0;l<s.length;l++){const a=Gr(s[l],e);o.append(a)}return o}function Uo(n,e,t){const r=te,i=fe,o=ne;te=e,fe=!0,ne=n;try{return t()}finally{te=r,fe=i,ne=o}}function Ue(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=fe,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,fe=!1,n._updating=!0;try{const b=n._dirtyType,N=n._dirtyElements,w=n._dirtyLeaves;h.disconnect(),g=Rl(o,t,n,b,N,w)}catch(b){if(b instanceof Error&&n._onError(b),Hr)throw b;return Go(n,null,r,t),Li(n),n._dirtyType=lt,Hr=!0,Ue(n,o),void(Hr=!1)}finally{h.observe(r,Wo),n._updating=f,te=c,fe=u,ne=d}}t._readOnly||(t._readOnly=!0);const _=n._dirtyLeaves,m=n._dirtyElements,x=n._normalizedNodes,y=n._updateTags,v=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(b,N){const w=b._decorators;let E=b._pendingDecorators||w;const j=N._nodeMap;let z;for(z in E)j.has(z)||(E===w&&(E=Ki(b)),delete E[z])}(n,t);const T=i?null:Se(n._window);if(n._editable&&T!==null&&(a||l===null||l.dirty)){ne=n,te=t;try{if(h!==null&&h.disconnect(),a||l===null||l.dirty){const b=n._blockCursorElement;b!==null&&Sr(b,n,r),Kl(s,l,n,T,y,r)}kl(n,r,l),h!==null&&h.observe(r,Wo)}finally{ne=d,te=c}}g!==null&&function(b,N,w,E,j){const z=Array.from(b._listeners.mutation),ee=z.length;for(let q=0;q<ee;q++){const[W,Y]=z[q],ce=N.get(Y);ce!==void 0&&W(ce,{dirtyLeaves:E,prevEditorState:j,updateTags:w})}}(n,g,y,_,o),P(l)||l===null||s!==null&&s.is(l)||n.dispatchCommand(nn,void 0);const S=n._pendingDecorators;S!==null&&(n._decorators=S,n._pendingDecorators=null,Gt("decorator",n,!0,S)),function(b,N,w){const E=Ui(N),j=Ui(w);E!==j&&Gt("textcontent",b,!0,j)}(n,e||o,t),Gt("update",n,!0,{dirtyElements:m,dirtyLeaves:_,editorState:t,normalizedNodes:x,prevEditorState:e||o,tags:y}),function(b,N){if(b._deferred=[],N.length!==0){const w=b._updating;b._updating=!0;try{for(let E=0;E<N.length;E++)N[E]()}finally{b._updating=w}}}(n,v),function(b){const N=b._updates;if(N.length!==0){const w=N.shift();if(w){const[E,j]=w;Yo(b,E,j)}}}(n)}function Gt(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 Jo(n,e,t){if(n._updating===!1||ne!==n){let i=!1;return n.update(()=>{i=Jo(n,e,t)}),i}const r=_r(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 Vo(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&&O(191),c._flushSync=!0}l&&n._deferred.push(l),a&&n._updateTags.add(a)}o()}}return r}function Yo(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=fe,h=ne,g=n._updating;te=c,fe=!1,n._updating=!0,ne=n;try{u&&(n._headless?a._selection!==null&&(c._selection=a._selection.clone()):c._selection=function(y){const v=y.getEditorState()._selection,T=Se(y._window);return P(v)||v==null?Yr(v,T,y,null):v.clone()}(n));const m=n._compositionKey;e(),s=Vo(n,s),function(y,v){const T=v.getEditorState()._selection,S=y._selection;if(P(S)){const b=S.anchor,N=S.focus;let w;if(b.type==="text"&&(w=b.getNode(),w.selectionTransform(T,S)),N.type==="text"){const E=N.getNode();w!==E&&E.selectionTransform(T,S)}}}(c,n),n._dirtyType!==qe&&(s?function(y,v){const T=v._dirtyLeaves,S=y._nodeMap;for(const b of T){const N=S.get(b);D(N)&&N.isAttached()&&N.isSimpleText()&&!N.isUnmergeable()&&ji(N)}}(c,n):function(y,v){const T=v._dirtyLeaves,S=v._dirtyElements,b=y._nodeMap,N=We(),w=new Map;let E=T,j=E.size,z=S,ee=z.size;for(;j>0||ee>0;){if(j>0){v._dirtyLeaves=new Set;for(const q of E){const W=b.get(q);D(W)&&W.isAttached()&&W.isSimpleText()&&!W.isUnmergeable()&&ji(W),W!==void 0&&Ko(W,N)&&$o(v,W,w),T.add(q)}if(E=v._dirtyLeaves,j=E.size,j>0){An++;continue}}v._dirtyLeaves=new Set,v._dirtyElements=new Map;for(const q of z){const W=q[0],Y=q[1];if(W!=="root"&&!Y)continue;const ce=b.get(W);ce!==void 0&&Ko(ce,N)&&$o(v,ce,w),S.set(W,Y)}E=v._dirtyLeaves,j=E.size,z=v._dirtyElements,ee=z.size,An++}v._dirtyLeaves=T,v._dirtyElements=S}(c,n),Vo(n),function(y,v,T,S){const b=y._nodeMap,N=v._nodeMap,w=[];for(const[E]of S){const j=N.get(E);j!==void 0&&(j.isAttached()||(C(j)&&ro(j,E,b,N,w,S),b.has(E)||S.delete(E),w.push(E)))}for(const E of w)N.delete(E);for(const E of T){const j=N.get(E);j===void 0||j.isAttached()||(b.has(E)||T.delete(E),N.delete(E))}}(a,c,n._dirtyLeaves,n._dirtyElements)),m!==n._compositionKey&&(c._flushSync=!0);const x=c._selection;if(P(x)){const y=c._nodeMap,v=x.anchor.key,T=x.focus.key;y.get(v)!==void 0&&y.get(T)!==void 0||O(19)}else xe(x)&&x._nodes.size===0&&(c._selection=null)}catch(m){return m instanceof Error&&n._onError(m),n._pendingEditorState=a,n._dirtyType=lt,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void Ue(n)}finally{te=d,fe=f,ne=h,n._updating=g,An=0}n._dirtyType!==qe||function(m,x){const y=x.getEditorState()._selection,v=m._selection;if(v!==null){if(v.dirty||!v.is(y))return!0}else if(y!==null)return!0;return!1}(c,n)?c._flushSync?(c._flushSync=!1,Ue(n)):u&&xl(()=>{Ue(n)}):(c._flushSync=!1,u&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function he(n,e,t){n._updating?n._updates.push([e,t]):Yo(n,e,t)}class Mn extends On{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 fl[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=H()._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),C(t)){const r=t.getAllTextNodes();e.push(...r)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;C(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;C(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 C(o)&&o.getLastDescendant()||o||null}const i=t[e];return C(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&&O(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:se(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&O(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(),C(o)&&i!==r-1&&!o.isInline()&&(e+=Ne)}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(),C(o)&&i!==r-1&&!o.isInline()&&(e+=Ne.length)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(e!==""){const t=Ri[e];return!!(this.getFormat()&t)}return!1}select(e,t){de();const r=I();let i=e,o=t;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const a=this.getFirstChild();if(D(a)||C(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)||C(a))return a.select()}}i===void 0&&(i=s),o===void 0&&(o=s);const l=this.__key;return P(r)?(r.anchor.set(l,i,"element"),r.focus.set(l,o,"element"),r.dirty=!0,r):Lo(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!==""?Ri[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 _=0;_<t;_++){g===null&&O(100);const m=g.getNextSibling(),x=g.__key;He(g.getWritable()),c.push(x),g=m}}let h=d;for(let g=0;g<i;g++){const _=r[g];h!==null&&_.is(h)&&(d=h=h.getPreviousSibling());const m=_.getWritable();m.__parent===l&&f--,He(m);const x=_.__key;if(h===null)s.__first=x,m.__prev=null;else{const y=h.getWritable();y.__next=x,m.__prev=y.__key}_.__key===l&&O(76),m.__parent=l,a.push(x),h=_}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 _=h.getWritable();g.__prev=h.__key,_.__next=u.__key}else g.__prev=null}if(s.__size=f,c.length){const g=I();if(P(g)){const _=new Set(c),m=new Set(a),{anchor:x,focus:y}=g;qo(x,_,m)&&Ln(x,x.getNode(),this,d,u),qo(y,_,m)&&Ln(y,y.getNode(),this,d,u),f!==0||this.canBeEmpty()||ut(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 C(n){return n instanceof Mn}function qo(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 ql extends On{constructor(e){super(e)}decorate(e,t){O(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function U(n){return n instanceof ql}class Xt extends Mn{static getType(){return"root"}static clone(){return new Xt}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){O(51)}getTextContent(){const e=this.__cachedText;return!Ht()&&H()._dirtyType!==qe||e===null?super.getTextContent():e}remove(){O(52)}replace(e){O(53)}insertBefore(e){O(54)}insertAfter(e){O(55)}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const r=e[t];C(r)||U(r)||O(56)}return super.append(...e)}static importJSON(e){const t=X();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 Xt}function Xr(){return new jn(new Map([["root",new Xt]]))}function Ho(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&O(130,t.name),C(n)){const r=e.children;Array.isArray(r)||O(59,t.name);const i=n.getChildren();for(let o=0;o<i.length;o++){const s=Ho(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 Uo(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 Uo(null,this,()=>({root:Ho(X())}))}}class Qr extends Mn{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class pt extends Mn{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=Pe[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 pt(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),r=Lt(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:Hl,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&wr(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 Hl(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 bn(new pt)}function Zr(n){return n instanceof pt}const K=0,Gl=4;function Go(n,e,t,r){const i=n._keyToDOMMap;i.clear(),n._editorState=Xr(),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 Xl(n){const e=n||{},t=Vl(),r=e.theme||{},i=n===void 0?t:e.parentEditor||null,o=e.disableEvents||!1,s=Xr(),l=e.namespace||(i!==null?i._config.namespace:qi()),a=e.editorState,c=[Xt,gt,Ut,Vt,pt,Qr,...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 _=0;_<c.length;_++){let m=c[_],x=null,y=null;if(typeof m!="function"){const b=m;m=b.replace,x=b.with,y=b.withKlass||null}const v=m.getType(),T=m.transform(),S=new Set;T!==null&&S.add(T),h.set(v,{exportDOM:d&&d.export?d.export.get(m):void 0,klass:m,replace:x,replaceWithKlass:y,transforms:S})}}const g=new Wn(s,i,h,{disableEvents:o,namespace:l,theme:r},u||console.error,function(_,m){const x=new Map,y=new Set,v=T=>{Object.keys(T).forEach(S=>{let b=x.get(S);b===void 0&&(b=[],x.set(S,b)),b.push(T[S])})};return _.forEach(T=>{const S=T.klass.importDOM;if(S==null||y.has(S))return;y.add(S);const b=S.call(T.klass);b!==null&&v(b)}),m&&v(m),x}(h,d?d.import:void 0),f);return a!==void 0&&(g._pendingEditorState=a,g._dirtyType=lt),g}class Wn{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=qi(),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&&O(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&&O(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&&O(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const r=this._editorState,i=Pl(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(),he(s,()=>{const a=Re();if(a.isEmpty())return;if(l==="root")return void X().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 F(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=Lt(this._config.theme,"root"),i=this._pendingEditorState||this._editorState;if(this._rootElement=e,Go(this,t,e,i),t!==null&&(this._config.disableEvents||Fl(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=lt,Li(this),this._updateTags.add("history-merge"),Ue(this),this._config.disableEvents||function(l,a){const c=l.ownerDocument,u=Pn.get(c);(u===void 0||u<1)&&c.addEventListener("selectionchange",xo),Pn.set(c,(u||0)+1),l.__lexicalEditor=a;const d=vo(l);for(let f=0;f<Ar.length;f++){const[h,g]=Ar[f],_=typeof g=="function"?m=>{bo(m)||(Co(m),(a.isEditable()||h==="click")&&g(m,a))}:m=>{if(bo(m))return;Co(m);const x=a.isEditable();switch(h){case"cut":return x&&F(a,Zn,m);case"copy":return F(a,an,m);case"paste":return x&&F(a,Xn,m);case"dragstart":return x&&F(a,ki,m);case"dragover":return x&&F(a,Ei,m);case"dragend":return x&&F(a,qs,m);case"focus":return x&&F(a,Xs,m);case"blur":return x&&F(a,Qs,m);case"drop":return x&&F(a,Ti,m)}};l.addEventListener(h,_),d.push(()=>{l.removeEventListener(h,_)})}}(e,this),r!=null&&e.classList.add(...r)}else this._editorState=i,this._pendingEditorState=null,this._window=null;Gt("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&O(38),Ii(this);const r=this._pendingEditorState,i=this._updateTags,o=t!==void 0?t.tag:null;r===null||r.isEmpty()||(o!=null&&i.add(o),Ue(this)),this._pendingEditorState=e,this._dirtyType=lt,this._dirtyElements.set("root",!1),this._compositionKey=null,o!=null&&i.add(o),Ue(this)}parseEditorState(e,t){return function(r,i,o){const s=Xr(),l=te,a=fe,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,fe=!1,ne=i;try{const g=i._nodes;Gr(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,fe=a,ne=c}return s}(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return Ue(this),this.getEditorState().read(e,{editor:this})}update(e,t){he(this,e,t)}focus(e,t={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),he(this,()=>{const i=I(),o=X();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,Gt("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}Wn.version="0.17.1+prod.esm";const Nc="";function Ql(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Zl=Ql(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 Xo=A.createContext(null);function ea(n,e){let t=null;return n!=null&&(t=n[1]),{getTheme:function(){return e??(t!=null?t.getTheme():null)}}}function et(){const n=A.useContext(Xo);return n==null&&Zl(8),n}const Qo=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ta=Qo?A.useLayoutEffect:A.useEffect,Bn={tag:"history-merge"};function na({initialConfig:n,children:e}){const t=A.useMemo(()=>{const{theme:r,namespace:i,nodes:o,onError:s,editorState:l,html:a}=n,c=ea(null,r),u=Xl({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=X();if(h.isEmpty()){const g=ke();h.append(g);const _=Qo?document.activeElement:null;(I()!==null||_!==null&&_===d.getRootElement())&&g.select()}},Bn);else if(f!==null)switch(typeof f){case"string":{const h=d.parseEditorState(f);d.setEditorState(h,Bn);break}case"object":d.setEditorState(f,Bn);break;case"function":d.update(()=>{X().isEmpty()&&f(d)},Bn)}}}(u,l),[u,c]},[]);return ta(()=>{const r=n.editable,[i]=t;i.setEditable(r===void 0||r)},[]),L.jsx(Xo.Provider,{value:t,children:e})}function ra({defaultSelection:n}){const[e]=et();return A.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 ia(){return X().getTextContent()}function oa(n,e=!0){if(n)return!1;let t=ia();return e&&(t=t.trim()),t===""}function sa(n){if(!oa(n,!1))return!1;const e=X().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(C(i)){if(!Zr(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 Zo(n){return()=>sa(n)}function la(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}la(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 aa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}aa(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 ca=new Map;function ua(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 es(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]=Jr(n),f=s.is(l),h=e.is(o?l:s),g=e.is(o?s:l);let _,m=0;return f?(m=u>d?d:u,_=u>d?u:d):h?(m=o?d:u,_=void 0):g&&(m=0,_=o?u:d),e.__text=e.__text.slice(m,_),e}}return e}function fa(n){const e=n.getStyle(),t=ua(e);ca.set(e,t)}function ts(n,e){const t=At(n.focus,e);return U(t)&&!t.isIsolated()||C(t)&&!t.isInline()&&!t.canBeEmpty()}function da(n,e,t,r){n.modify(e?"extend":"move",t,r)}function ha(n){const e=n.anchor.getNode();return(oe(e)?e:e.getParentOrThrow()).getDirection()==="rtl"}function ns(n,e,t){const r=ha(n);da(n,e,t?!r:r,"character")}function ga(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var pa=ga(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 rs=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,_a=rs&&"documentMode"in document?document.documentMode:null;!(!rs||!("InputEvent"in window)||_a)&&"getTargetRanges"in new window.InputEvent("input");function _t(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}function ma(n){const e=ei(n,t=>C(t)&&!t.isInline());return C(e)||pa(4,n.__key),e}const ei=(n,e)=>{let t=n;for(;t!==X()&&t!=null;){if(e(t))return t;t=t.getParent()}return null};function tt(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}const is=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?A.useLayoutEffect:A.useEffect;function ya({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:_=!0,style:m,tabIndex:x,"data-testid":y,...v},T){const[S,b]=A.useState(n.isEditable()),N=A.useCallback(E=>{E&&E.ownerDocument&&E.ownerDocument.defaultView?n.setRootElement(E):n.setRootElement(null)},[n]),w=A.useMemo(()=>function(...E){return j=>{E.forEach(z=>{typeof z=="function"?z(j):z!=null&&(z.current=j)})}}(T,N),[N,T]);return is(()=>(b(n.isEditable()),n.registerEditableListener(E=>{b(E)})),[n]),L.jsx("div",{...v,"aria-activedescendant":S?e:void 0,"aria-autocomplete":S?t:"none","aria-controls":S?r:void 0,"aria-describedby":i,"aria-expanded":S&&g==="combobox"?!!o:void 0,"aria-label":s,"aria-labelledby":l,"aria-multiline":a,"aria-owns":S?c:void 0,"aria-readonly":!S||void 0,"aria-required":u,autoCapitalize:d,className:f,contentEditable:S,"data-testid":y,id:h,ref:w,role:S?g:void 0,spellCheck:_,style:m,tabIndex:x})}const va=A.forwardRef(ya);function os(n){return n.getEditorState().read(Zo(n.isComposing()))}const xa=A.forwardRef(Ca);function Ca(n,e){const{placeholder:t,...r}=n,[i]=et();return L.jsxs(L.Fragment,{children:[L.jsx(va,{editor:i,...r,ref:e}),t!=null&&L.jsx(ba,{editor:i,content:t})]})}function ba({content:n,editor:e}){const t=function(s){const[l,a]=A.useState(()=>os(s));return is(()=>{function c(){const u=os(s);a(u)}return c(),_t(s.registerUpdateListener(()=>{c()}),s.registerEditableListener(()=>{c()}))},[s]),l}(e),[r,i]=A.useState(e.isEditable());if(A.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:L.jsx("div",{"aria-hidden":!0,children:o})}const zn=0,ti=1,ni=2,Ce=0,Sa=1,ss=2,wa=3,Ta=4;function ka(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 Sa;if(!(P(o)&&P(s)&&s.isCollapsed()&&o.isCollapsed()))return Ce;const l=function(x,y,v){const T=x._nodeMap,S=[];for(const b of y){const N=T.get(b);N!==void 0&&S.push(N)}for(const[b,N]of v){if(!N)continue;const w=T.get(b);w===void 0||oe(w)||S.push(w)}return S}(e,t,r);if(l.length===0)return Ce;if(l.length>1){const x=e._nodeMap,y=x.get(o.anchor.key),v=x.get(s.anchor.key);return y&&v&&!n._nodeMap.has(y.__key)&&D(y)&&y.__text.length===1&&o.anchor.offset===1?ss: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,_=h.offset,m=d.length-u.length;return m===1&&_===g-1?ss:m===-1&&_===g+1?wa:m===-1&&_===g?Ta:Ce}function Ea(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,ni;const d=ka(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 zn;if(i===null)return ti;const _=o._selection;return l.size>0||a.size>0?g===!1&&d!==Ce&&d===r&&u<t+e&&h||l.size===1&&function(m,x,y){const v=x._nodeMap.get(m),T=y._nodeMap.get(m),S=x._selection,b=y._selection;return!(P(S)&&P(b)&&S.anchor.type==="element"&&S.focus.type==="element"&&b.anchor.type==="text"&&b.focus.type==="text"||!D(v)||!D(T)||v.__parent!==T.__parent)&&JSON.stringify(x.read(()=>v.exportJSON()))===JSON.stringify(y.read(()=>T.exportJSON()))}(Array.from(l)[0],i,o)?zn:ti:_!==null?zn:ni})();return t=u,r=d,f}}function ls(n){n.undoStack=[],n.redoStack=[],n.current=null}function Na(n,e,t){const r=Ea(n,t);return _t(n.registerCommand(on,()=>(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(Nt,!0)),a.length===0&&o.dispatchCommand(Pt,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),K),n.registerCommand(sn,()=>(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(Pt,!0));const u=l.pop();l.length===0&&o.dispatchCommand(Nt,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),K),n.registerCommand(Hs,()=>(ls(e),!1),K),n.registerCommand(Gs,()=>(ls(e),n.dispatchCommand(Nt,!1),n.dispatchCommand(Pt,!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===ti)d.length!==0&&(e.redoStack=[],n.dispatchCommand(Nt,!1)),u!==null&&(f.push({...u}),n.dispatchCommand(Pt,!0));else if(g===ni)return;e.current={editor:n,editorState:o}}))}function Pa(){return{current:null,redoStack:[],undoStack:[]}}function Oa({delay:n,externalHistoryState:e}){const[t]=et();return function(r,i,o=1e3){const s=A.useMemo(()=>i||Pa(),[i]);A.useEffect(()=>Na(r,s,o),[o,r,s])}(t,e,n),null}const Da=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?A.useLayoutEffect:A.useEffect;function Ra(n){return{initialValueFn:()=>n.isEditable(),subscribe:e=>n.registerEditableListener(e)}}function Fa(){return function(n){const[e]=et(),t=A.useMemo(()=>n(e),[e,n]),r=A.useRef(t.initialValueFn()),[i,o]=A.useState(r.current);return Da(()=>{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}(Ra)}function Ia(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 _=I();if(P(_)){const m=_.anchor;let x=m.getNode(),y=0,v=0;if(D(x)&&c>=0&&u>=0&&(y=c,v=c+u,_.setTextNodeRange(x,y,x,v)),y===v&&d===""||(_.insertRawText(d),x=m.getNode()),D(x)){y=f,v=f+h;const T=x.getTextContentSize();y=y>T?T:y,v=v>T?T:v,_.setTextNodeRange(x,y,x,v)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}function La(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(!cs.has(s.nodeName)){const l=us(s,n,i,!1);l!==null&&(r=r.concat(l))}}return function(o){for(const s of o)s.getNextSibling()instanceof Qr&&s.insertAfter(Ze());for(const s of o){const l=s.getChildren();for(const a of l)s.insertBefore(a);s.remove()}}(i),r}function Aa(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=X().getChildren();for(let i=0;i<r.length;i++)as(n,r[i],t,e);return t.innerHTML}function as(n,e,t,r=null){let i=r===null||e.isSelected(r);const o=C(e)&&e.excludeFromCopy("html");let s=e;if(r!==null){let h=Er(e);h=D(h)&&r!==null?es(r,h):h,s=h}const l=C(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],_=as(n,g,f,r);!i&&C(e)&&_&&e.extractWithChild(g,r,"html")&&(i=!0)}if(i&&!o){if(wr(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 cs=new Set(["STYLE","SCRIPT"]);function us(n,e,t,r,i=new Map,o){let s=[];if(cs.has(n.nodeName))return s;let l=null;const a=function(g,_){const{nodeName:m}=g,x=_._htmlConversions.get(m.toLowerCase());let y=null;if(x!==void 0)for(const v of x){const T=v(g);T!==null&&(y===null||(y.priority||0)<(T.priority||0))&&(y=T)}return y!==null?y.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[,_]of i)if(l=_(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||!ut(l))&&(l!=null&&Vr(l)||r);for(let g=0;g<d.length;g++)f.push(...us(d[g],e,t,h,new Map(i),l));return u!=null&&(f=u(f)),Sn(n)&&(f=Ma(n,f,h?()=>{const g=new Qr;return t.push(g),g}:ke)),l==null?f.length>0?s=s.concat(f):Sn(n)&&function(g){return g.nextSibling==null||g.previousSibling==null?!1:Tr(g.nextSibling)&&Tr(g.previousSibling)}(n)&&(s=s.concat(Ze())):C(l)&&l.append(...f),s}function Ma(n,e,t){const r=n.style.textAlign,i=[];let o=[];for(let s=0;s<e.length;s++){const l=e[s];if(Vr(l))r&&!l.getFormat()&&l.setFormat(r),i.push(l);else if(o.push(l),s===e.length-1||s<e.length-1&&Vr(e[s+1])){const a=t();a.setFormat(r),a.append(...o),i.push(a),o=[]}}return i}function ja(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var $n=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 Wa=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,fs=n=>Wa?(n||window).getSelection():null;function Ba(n,e=I()){return e==null&&$n(166),P(e)&&e.isCollapsed()||e.getNodes().length===0?"":Aa(n,e)}function za(n,e=I()){return e==null&&$n(166),P(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify($a(n,e))}function ds(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 hs(t,Ka(s.nodes),e)}catch{}const i=n.getData("text/html");if(i)try{const s=new DOMParser().parseFromString(i,"text/html");return hs(t,La(t,s),e)}catch{}const o=n.getData("text/plain")||n.getData("text/uri-list");if(o!=null)if(P(e)){const s=o.split(/(\r?\n|\t)/);s[s.length-1]===""&&s.pop();for(let l=0;l<s.length;l++){const a=I();if(P(a)){const c=s[l];c===`
|
|
39
|
+
`?r.push(Xe()):s===" "?r.push(Vt()):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(_,v,x,y){const b=_.getNode(),T=b.getChildAtIndex(_.offset),S=ie(),E=oe(b)?we().append(S):S;S.setFormat(x),S.setStyle(y),T===null?b.append(E):T.insertBefore(E),_.is(v)&&v.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(),f=u.length;let d=u[0];j(d)||L(26);const g=d.getTextContent().length,h=d.getParentOrThrow();let m=u[f-1];if(f===1&&l.type==="element"&&(c=g,l.set(s.key,c,"text")),this.isCollapsed()&&a===g&&(d.isSegmented()||d.isToken()||!d.canInsertTextAfter()||!h.canInsertTextAfter()&&d.getNextSibling()===null)){let _=d.getNextSibling();if(j(_)&&_.canInsertTextBefore()&&!at(_)||(_=ie(),_.setFormat(i),_.setStyle(o),h.canInsertTextAfter()?d.insertAfter(_):h.insertAfter(_)),_.select(0,0),d=_,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&a===0&&(d.isSegmented()||d.isToken()||!d.canInsertTextBefore()||!h.canInsertTextBefore()&&d.getPreviousSibling()===null)){let _=d.getPreviousSibling();if(j(_)&&!at(_)||(_=ie(),_.setFormat(i),h.canInsertTextBefore()?d.insertBefore(_):h.insertBefore(_)),_.select(),d=_,e!=="")return void this.insertText(e)}else if(d.isSegmented()&&a!==g){const _=ie(d.getTextContent());_.setFormat(i),d.replace(_),d=_}else if(!this.isCollapsed()&&e!==""){const _=m.getParent();if(!h.canInsertTextBefore()||!h.canInsertTextAfter()||C(_)&&(!_.canInsertTextBefore()||!_.canInsertTextAfter()))return this.insertText(""),Do(this.anchor,this.focus,null),void this.insertText(e)}if(f===1){if(d.isToken()){const y=ie(e);return y.select(),void d.replace(y)}const _=d.getFormat(),v=d.getStyle();if(a!==c||_===i&&v===o){if(Wl(d)){const y=ie(e);return y.setFormat(i),y.setStyle(o),y.select(),void d.replace(y)}}else{if(d.getTextContent()!==""){const y=ie(e);if(y.setFormat(i),y.setStyle(o),y.select(),a===0)d.insertBefore(y,!1);else{const[b]=d.splitText(a);b.insertAfter(y,!1)}return void(y.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}d.setFormat(i),d.setStyle(o)}const x=c-a;d=d.spliceText(a,x,e,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(d.isComposing()?this.anchor.offset-=e.length:(this.format=_,this.style=v))}else{const _=new Set([...d.getParentKeys(),...m.getParentKeys()]),v=C(d)?d:d.getParentOrThrow();let x=C(m)?m:m.getParentOrThrow(),y=m;if(!v.is(x)&&x.isInline())do y=x,x=x.getParentOrThrow();while(x.isInline());if(l.type==="text"&&(c!==0||m.getTextContent()==="")||l.type==="element"&&m.getIndexWithinParent()<c)if(j(m)&&!m.isToken()&&c!==m.getTextContentSize()){if(m.isSegmented()){const N=ie(m.getTextContent());m.replace(N),m=N}oe(l.getNode())||l.type!=="text"||(m=m.spliceText(0,c,"")),_.add(m.__key)}else{const N=m.getParentOrThrow();N.canBeEmpty()||N.getChildrenSize()!==1?m.remove():N.remove()}else _.add(m.__key);const b=x.getChildren(),T=new Set(u),S=v.is(x),E=v.isInline()&&d.getNextSibling()===null?v:d;for(let N=b.length-1;N>=0;N--){const M=b[N];if(M.is(d)||C(M)&&M.isParentOf(d))break;M.isAttached()&&(!T.has(M)||M.is(y)?S||E.insertAfter(M,!1):M.remove())}if(!S){let N=x,M=null;for(;N!==null;){const R=N.getChildren(),B=R.length;(B===0||R[B-1].is(M))&&(_.delete(N.__key),M=N),N=N.getParent()}}if(d.isToken())if(a===g)d.select();else{const N=ie(e);N.select(),d.replace(N)}else d=d.spliceText(a,g-a,e,!0),d.getTextContent()===""?d.remove():d.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);for(let N=1;N<f;N++){const M=u[N],R=M.__key;_.has(R)||M.remove()}}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed())return this.toggleFormat(e),void re(null);const t=this.getNodes(),r=[];for(const x of t)j(x)&&r.push(x);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,f=r[0],d=a.type==="element"?0:a.offset;if(a.type==="text"&&d===f.getTextContentSize()&&(u=1,f=r[1],d=0),f==null)return;const g=f.getFormatFlags(e,null),h=i-1;let m=r[h];const _=c.type==="text"?c.offset:m.getTextContentSize();if(f.is(m)){if(d===_)return;if(at(f)||d===0&&_===f.getTextContentSize())f.setFormat(g);else{const x=f.splitText(d,_),y=d===0?x[0]:x[1];y.setFormat(g),a.type==="text"&&a.set(y.__key,0,"text"),c.type==="text"&&c.set(y.__key,_-d,"text")}return void(this.format=g)}d===0||at(f)||([,f]=f.splitText(d),d=0),f.setFormat(g);const v=m.getFormatFlags(e,g);_>0&&(_===m.getTextContentSize()||at(m)||([m]=m.splitText(_)),m.setFormat(v));for(let x=u+1;x<h;x++){const y=r[x],b=y.getFormatFlags(e,v);y.setFormat(b)}a.type==="text"&&a.set(f.__key,d,"text"),c.type==="text"&&c.set(m.__key,_,"text"),this.format=g|v}insertNodes(e){if(e.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const g=O();return k(g)||L(134),g.insertNodes(e)}const t=wr((this.isBackward()?this.focus:this.anchor).getNode(),dt),r=e[e.length-1];if("__language"in t&&C(t)){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const g=Jr(this);t.splice(g,0,e),r.selectEnd()}return}if(!e.some(g=>(C(g)||Y(g))&&!g.isInline())){C(t)||L(135);const g=Jr(this);return t.splice(g,0,e),void r.selectEnd()}const i=function(g){const h=we();let m=null;for(let _=0;_<g.length;_++){const v=g[_],x=Kt(v);if(x||Y(v)&&v.isInline()||C(v)&&v.isInline()||j(v)||v.isParentRequired()){if(m===null&&(m=v.createParentElementNode(),h.append(m),x))continue;m!==null&&m.append(v)}else h.append(v),m=null}return h}(e),o=i.getLastDescendant(),s=i.getChildren(),l=!C(t)||!t.isEmpty()?this.insertParagraph():null,a=s[s.length-1];let c=s[0];var u;C(u=c)&&dt(u)&&!u.isEmpty()&&C(t)&&(!t.isEmpty()||t.canMergeWhenEmpty())&&(C(t)||L(135),t.append(...c.getChildren()),c=s[1]),c&&function(g,h,m){const _=h.getParentOrThrow().getLastChild();let v=h;const x=[h];for(;v!==_;)v.getNextSibling()||L(140),v=v.getNextSibling(),x.push(v);let y=g;for(const b of x)y=y.insertAfter(b)}(t,c);const f=wr(o,dt);l&&C(f)&&(l.canMergeWhenEmpty()||dt(a))&&(f.append(...l.getChildren()),l.remove()),C(t)&&t.isEmpty()&&t.remove(),o.selectEnd();const d=C(t)?t.getLastChild():null;Kt(d)&&f!==t&&d.remove()}insertParagraph(){if(this.anchor.key==="root"){const s=we();return G().splice(this.anchor.offset,0,[s]),s.select(),s}const e=Jr(this),t=wr(this.anchor.getNode(),dt);C(t)||L(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=Xe();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]=Kr(this);if(t===0)return[];if(t===1){if(j(s)&&!this.isCollapsed()){const f=a>c?c:a,d=a>c?a:c,g=s.splitText(f,d),h=f===0?g[0]:g[1];return h!=null?[h]:[]}return[s]}const u=i.isBefore(o);if(j(s)){const f=u?a:c;f===s.getTextContentSize()?e.shift():f!==0&&([,s]=s.splitText(f),e[0]=s)}if(j(l)){const f=l.getTextContent().length,d=u?c:a;d===0?e.pop():d!==f&&([l]=l.splitText(d),e[r]=l)}return e}modify(e,t,r){const i=this.focus,o=this.anchor,s=e==="move",l=Pt(i,t);if(Y(l)&&!l.isIsolated()){if(s&&l.isKeyboardSelectable()){const g=Po();return g.add(l.__key),void Se(g)}const d=t?l.getPreviousSibling():l.getNextSibling();if(j(d)){const g=d.__key,h=t?d.getTextContent().length:0;return i.set(g,h,"text"),void(s&&o.set(g,h,"text"))}{const g=l.getParentOrThrow();let h,m;return C(d)?(m=d.__key,h=t?d.getChildrenSize():0):(h=l.getIndexWithinParent(),m=g.__key,t||h++),i.set(m,h,"element"),void(s&&o.set(m,h,"element"))}}const a=Z(),c=Te(a._window);if(!c)return;const u=a._blockCursorElement,f=a._rootElement;if(f===null||u===null||!C(l)||l.isInline()||l.canBeEmpty()||Tr(u,a,f),function(d,g,h,m){d.modify(g,h,m)}(c,e,t?"backward":"forward",r),c.rangeCount>0){const d=c.getRangeAt(0),g=this.anchor.getNode(),h=oe(g)?g:bl(g);if(this.applyDOMRange(d),this.dirty=!0,!s){const m=this.getNodes(),_=[];let v=!1;for(let x=0;x<m.length;x++){const y=m[x];vr(y,h)?_.push(y):v=!0}if(v&&_.length>0)if(t){const x=_[0];C(x)?x.selectStart():x.getParentOrThrow().selectStart()}else{const x=_[_.length-1];C(x)?x.selectEnd():x.getParentOrThrow().selectEnd()}c.anchorNode===d.startContainer&&c.anchorOffset===d.startOffset||function(x){const y=x.focus,b=x.anchor,T=b.key,S=b.offset,E=b.type;Ue(b,y.key,y.offset,y.type),Ue(y,T,S,E),x._cachedNodes=null}(this)}}}forwardDeletion(e,t,r){if(!r&&(e.type==="element"&&C(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(C(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=Pt(o,e);if(Y(s)&&!s.isIsolated()){if(s.isKeyboardSelectable()&&C(i)&&i.getChildrenSize()===0){i.remove();const l=Po();l.add(s.__key),Se(l)}else s.remove(),Z().dispatchCommand(nn,void 0);return}if(!e&&C(s)&&C(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 Lo(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 Lo(i,e,a)}(function(a,c){const u=a.anchor,f=a.focus,d=u.getNode(),g=f.getNode();if(d===g&&u.type==="text"&&f.type==="text"){const h=u.offset,m=f.offset,_=h<m,v=_?h:m,x=_?m:h,y=x-1;v!==y&&(Vi(d.getTextContent().slice(v,x))||(c?f.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 ve(n){return n instanceof Dn}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 Kr(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 Lo(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 jo(n,e,t,r){let i,o=e;if(n.nodeType===Lt){let s=!1;const l=n.childNodes,a=l.length,c=r._blockCursorElement;o===a&&(s=!0,o=a-1);let u=l[o],f=!1;if(u===c)u=l[o+1],f=!0;else if(c!==null){const d=c.parentNode;n===d&&e>Array.prototype.indexOf.call(d.children,c)&&o--}if(i=ct(u),j(i))o=Qi(i,s);else{let d=ct(n);if(d===null)return null;if(C(d)){o=Math.min(d.getChildrenSize(),o);let g=d.getChildAtIndex(o);if(C(g)&&function(h,m,_){const v=h.getParent();return _===null||v===null||!v.canBeEmpty()||v!==_.getNode()}(g,0,t)){const h=s?g.getLastDescendant():g.getFirstDescendant();h===null?d=g:(g=h,d=C(g)?g:g.getParentOrThrow()),o=0}j(g)?(i=g,d=null,o=Qi(g,s)):g!==d&&s&&!f&&o++}else{const g=d.getIndexWithinParent();o=e===0&&Y(d)&&ct(n)===d?g:g+1,d=d.getParentOrThrow()}if(C(d))return be(d.__key,o,"element")}}else i=ct(n);return j(i)?be(i.__key,o,"text"):null}function Io(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&&C(s)&&s.isInline()){const l=s.getPreviousSibling();j(l)&&(n.key=l.__key,n.offset=l.getTextContent().length)}}else C(o)&&!t&&o.isInline()?(n.key=o.__key,n.offset=o.getChildrenSize(),n.type="element"):j(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&&C(o)&&o.isInline())n.key=o.__key,n.offset=0,n.type="element";else if((t||e)&&o===null&&C(s)&&s.isInline()&&!s.canInsertTextAfter()){const l=s.getNextSibling();j(l)&&(n.key=l.__key,n.offset=0)}}}function Do(n,e,t){if(n.type==="text"&&e.type==="text"){const r=n.isBefore(e),i=n.is(e);Io(n,r,i),Io(e,!r,i),i&&(e.key=n.key,e.offset=n.offset,e.type=n.type);const o=Z();if(o.isComposing()&&o._compositionKey!==n.key&&k(t)){const s=t.anchor,l=t.focus;Ue(n,s.key,s.offset,s.type),Ue(e,l.key,l.offset,l.type)}}}function Oo(n,e,t,r,i,o){if(n===null||t===null||!jt(i,n,t))return null;const s=jo(n,e,k(o)?o.anchor:null,i);if(s===null)return null;const l=jo(t,r,k(o)?o.focus:null,i);if(l===null)return null;if(s.type==="element"&&l.type==="element"){const a=ct(n),c=ct(t);if(Y(a)&&Y(c))return null}return Do(s,l,o),[s,l]}function Qr(n){return C(n)&&!n.isInline()}function Ao(n,e,t,r,i,o){const s=Ie(),l=new $e(be(n,e,i),be(t,r,o),0,"");return l.dirty=!0,s._selection=l,l}function Ul(){const n=be("root",0,"element"),e=be("root",0,"element");return new $e(n,e,0,"")}function Po(){return new Dn(new Set)}function Vr(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=!ur&&(l||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&o&&o.detail===3||s==="drop"||s===void 0);let c,u,f,d;if(k(n)&&!a)return n.clone();if(e===null)return null;if(c=e.anchorNode,u=e.focusNode,f=e.anchorOffset,d=e.focusOffset,l&&k(n)&&!jt(t,c,u))return n.clone();const g=Oo(c,f,u,d,t,n);if(g===null)return null;const[h,m]=g;return new $e(h,m,k(n)?n.format:0,k(n)?n.style:"")}function O(){return Ie()._selection}function Jt(){return Z()._editorState._selection}function On(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"),zo(n)}}else{const c=n.isBackward(),u=c?o:i,f=u.getNode(),d=c?i:o,g=d.getNode();if(e.is(f)){const h=u.offset;(t<=h&&r>0||t<h&&r<0)&&u.set(a,Math.max(0,h+r),"element")}if(e.is(g)){const h=d.offset;(t<=h&&r>0||t<h&&r<0)&&d.set(a,Math.max(0,h+r),"element")}}zo(n)}function zo(n){const e=n.anchor,t=e.offset,r=n.focus,i=r.offset,o=e.getNode(),s=r.getNode();if(n.isCollapsed()){if(!C(o))return;const l=o.getChildrenSize(),a=t>=l,c=a?o.getChildAtIndex(l-1):o.getChildAtIndex(t);if(j(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text"),r.set(c.__key,u,"text")}}else{if(C(o)){const l=o.getChildrenSize(),a=t>=l,c=a?o.getChildAtIndex(l-1):o.getChildAtIndex(t);if(j(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text")}}if(C(s)){const l=s.getChildrenSize(),a=i>=l,c=a?s.getChildAtIndex(l-1):s.getChildAtIndex(i);if(j(c)){let u=0;a&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}}function An(n,e,t,r,i){let o=null,s=0,l=null;r!==null?(o=r.__key,j(r)?(s=r.getTextContentSize(),l="text"):C(r)&&(s=r.getChildrenSize(),l="element")):i!==null&&(o=i.__key,j(i)?l="text":C(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 Ro(n,e,t,r,i){n.type==="text"?(n.key=t,e||(n.offset+=i)):n.offset>r.getIndexWithinParent()&&(n.offset-=1)}function $l(n,e,t,r,i,o,s){const l=r.anchorNode,a=r.focusNode,c=r.anchorOffset,u=r.focusOffset,f=document.activeElement;if(i.has("collaboration")&&f!==o||f!==null&&gr(f))return;if(!k(e))return void(n!==null&&jt(t,l,a)&&r.removeAllRanges());const d=e.anchor,g=e.focus,h=d.key,m=g.key,_=xn(t,h),v=xn(t,m),x=d.offset,y=g.offset,b=e.format,T=e.style,S=e.isCollapsed();let E=_,N=v,M=!1;if(d.type==="text"){E=_n(_);const V=d.getNode();M=V.getFormat()!==b||V.getStyle()!==T}else k(n)&&n.anchor.type==="text"&&(M=!0);var R,B,ee,J,F;if(g.type==="text"&&(N=_n(v)),E!==null&&N!==null&&(S&&(n===null||M||k(n)&&(n.format!==b||n.style!==T))&&(R=b,B=T,ee=x,J=h,F=performance.now(),ho=[R,B,ee,J,F]),c!==x||u!==y||l!==E||a!==N||r.type==="Range"&&S||(f!==null&&o.contains(f)||o.focus({preventScroll:!0}),d.type==="element"))){try{r.setBaseAndExtent(E,x,N,y)}catch{}if(!i.has("skip-scroll-into-view")&&e.isCollapsed()&&o!==null&&o===document.activeElement){const V=e instanceof $e&&e.anchor.type==="element"?E.childNodes[x]||null:r.rangeCount>0?r.getRangeAt(0):null;if(V!==null){let ce;if(V instanceof Text){const De=document.createRange();De.selectNode(V),ce=De.getBoundingClientRect()}else ce=V.getBoundingClientRect();(function(De,Ke,Ht){const Xt=Ht.ownerDocument,en=Xt.defaultView;if(en===null)return;let{top:xt,bottom:vt}=Ke,Ct=0,St=0,pe=Ht;for(;pe!==null;){const nt=pe===Xt.body;if(nt)Ct=0,St=Cn(De).innerHeight;else{const Qe=pe.getBoundingClientRect();Ct=Qe.top,St=Qe.bottom}let Me=0;if(xt<Ct?Me=-(Ct-xt):vt>St&&(Me=vt-St),Me!==0)if(nt)en.scrollBy(0,Me);else{const Qe=pe.scrollTop;pe.scrollTop+=Me;const rt=pe.scrollTop-Qe;xt-=rt,vt-=rt}if(nt)break;pe=vn(pe)}})(t,ce,o)}}zr=!0}}function Yl(n){let e=O()||Jt();e===null&&(e=G().selectEnd()),e.insertNodes(n)}function Jr(n){let e=n;n.isCollapsed()||e.removeText();const t=O();k(t)&&(e=t),k(e)||L(161);const r=e.anchor;let i=r.getNode(),o=r.offset;for(;!dt(i);)[i,o]=Kl(i,o);return o}function Kl(n,e){const t=n.getParent();if(!t){const i=we();return G().append(i),i.select(),[G(),0]}if(j(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(!C(n)||e===0)return[t,n.getIndexWithinParent()];const r=n.getChildAtIndex(e);if(r){const i=new $e(be(n.__key,e,"element"),be(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,fe=!1,Zr=!1,Pn=0;const Fo={characterData:!0,childList:!0,subtree:!0};function Zt(){return fe||te!==null&&te._readOnly}function ge(){fe&&L(13)}function Wo(){Pn>99&&L(14)}function Ie(){return te===null&&L(195,Bo()),te}function Z(){return ne===null&&L(196,Bo()),ne}function Bo(){let n=0;const e=new Set,t=Fn.version;if(typeof window<"u")for(const i of document.querySelectorAll("[contenteditable]")){const o=pn(i);if(hr(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 Ql(){return ne}function Uo(n,e,t){const r=e.__type,i=function(l,a){const c=l._nodes.get(a);return c===void 0&&L(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 $o(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function Vl(n){return qr(n,Z()._nodes)}function qr(n,e){const t=n.type,r=e.get(t);r===void 0&&L(17,t);const i=r.klass;n.type!==i.getType()&&L(18,i.name);const o=i.importJSON(n),s=n.children;if(C(o)&&Array.isArray(s))for(let l=0;l<s.length;l++){const a=qr(s[l],e);o.append(a)}return o}function Yo(n,e,t){const r=te,i=fe,o=ne;te=e,fe=!0,ne=n;try{return t()}finally{te=r,fe=i,ne=o}}function Ye(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!==Je,c=te,u=fe,f=ne,d=n._updating,g=n._observer;let h=null;if(n._pendingEditorState=null,n._editorState=t,!i&&a&&g!==null){ne=n,te=t,fe=!1,n._updating=!0;try{const S=n._dirtyType,E=n._dirtyElements,N=n._dirtyLeaves;g.disconnect(),h=Il(o,t,n,S,E,N)}catch(S){if(S instanceof Error&&n._onError(S),Zr)throw S;return qo(n,null,r,t),Ai(n),n._dirtyType=lt,Zr=!0,Ye(n,o),void(Zr=!1)}finally{g.observe(r,Fo),n._updating=d,te=c,fe=u,ne=f}}t._readOnly||(t._readOnly=!0);const m=n._dirtyLeaves,_=n._dirtyElements,v=n._normalizedNodes,x=n._updateTags,y=n._deferred;a&&(n._dirtyType=Je,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),function(S,E){const N=S._decorators;let M=S._pendingDecorators||N;const R=E._nodeMap;let B;for(B in M)R.has(B)||(M===N&&(M=$i(S)),delete M[B])}(n,t);const b=i?null:Te(n._window);if(n._editable&&b!==null&&(a||l===null||l.dirty)){ne=n,te=t;try{if(g!==null&&g.disconnect(),a||l===null||l.dirty){const S=n._blockCursorElement;S!==null&&Tr(S,n,r),$l(s,l,n,b,x,r)}wl(n,r,l),g!==null&&g.observe(r,Fo)}finally{ne=f,te=c}}h!==null&&function(S,E,N,M,R){const B=Array.from(S._listeners.mutation),ee=B.length;for(let J=0;J<ee;J++){const[F,V]=B[J],ce=E.get(V);ce!==void 0&&F(ce,{dirtyLeaves:M,prevEditorState:R,updateTags:N})}}(n,h,x,m,o),k(l)||l===null||s!==null&&s.is(l)||n.dispatchCommand(nn,void 0);const T=n._pendingDecorators;T!==null&&(n._decorators=T,n._pendingDecorators=null,qt("decorator",n,!0,T)),function(S,E,N){const M=Yi(E),R=Yi(N);M!==R&&qt("textcontent",S,!0,R)}(n,e||o,t),qt("update",n,!0,{dirtyElements:_,dirtyLeaves:m,editorState:t,normalizedNodes:v,prevEditorState:e||o,tags:x}),function(S,E){if(S._deferred=[],E.length!==0){const N=S._updating;S._updating=!0;try{for(let M=0;M<E.length;M++)E[M]()}finally{S._updating=N}}}(n,y),function(S){const E=S._updates;if(E.length!==0){const N=E.shift();if(N){const[M,R]=N;Vo(S,M,R)}}}(n)}function qt(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 Ko(n,e,t){if(n._updating===!1||ne!==n){let i=!1;return n.update(()=>{i=Ko(n,e,t)}),i}const r=_r(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 Qo(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&&L(191),c._flushSync=!0}l&&n._deferred.push(l),a&&n._updateTags.add(a)}o()}}return r}function Vo(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 Rn(new Map((c||a)._nodeMap)),u=!0),c._flushSync=l;const f=te,d=fe,g=ne,h=n._updating;te=c,fe=!1,n._updating=!0,ne=n;try{u&&(n._headless?a._selection!==null&&(c._selection=a._selection.clone()):c._selection=function(x){const y=x.getEditorState()._selection,b=Te(x._window);return k(y)||y==null?Vr(y,b,x,null):y.clone()}(n));const _=n._compositionKey;e(),s=Qo(n,s),function(x,y){const b=y.getEditorState()._selection,T=x._selection;if(k(T)){const S=T.anchor,E=T.focus;let N;if(S.type==="text"&&(N=S.getNode(),N.selectionTransform(b,T)),E.type==="text"){const M=E.getNode();N!==M&&M.selectionTransform(b,T)}}}(c,n),n._dirtyType!==Je&&(s?function(x,y){const b=y._dirtyLeaves,T=x._nodeMap;for(const S of b){const E=T.get(S);j(E)&&E.isAttached()&&E.isSimpleText()&&!E.isUnmergeable()&&Ri(E)}}(c,n):function(x,y){const b=y._dirtyLeaves,T=y._dirtyElements,S=x._nodeMap,E=Fe(),N=new Map;let M=b,R=M.size,B=T,ee=B.size;for(;R>0||ee>0;){if(R>0){y._dirtyLeaves=new Set;for(const J of M){const F=S.get(J);j(F)&&F.isAttached()&&F.isSimpleText()&&!F.isUnmergeable()&&Ri(F),F!==void 0&&$o(F,E)&&Uo(y,F,N),b.add(J)}if(M=y._dirtyLeaves,R=M.size,R>0){Pn++;continue}}y._dirtyLeaves=new Set,y._dirtyElements=new Map;for(const J of B){const F=J[0],V=J[1];if(F!=="root"&&!V)continue;const ce=S.get(F);ce!==void 0&&$o(ce,E)&&Uo(y,ce,N),T.set(F,V)}M=y._dirtyLeaves,R=M.size,B=y._dirtyElements,ee=B.size,Pn++}y._dirtyLeaves=b,y._dirtyElements=T}(c,n),Qo(n),function(x,y,b,T){const S=x._nodeMap,E=y._nodeMap,N=[];for(const[M]of T){const R=E.get(M);R!==void 0&&(R.isAttached()||(C(R)&&ro(R,M,S,E,N,T),S.has(M)||T.delete(M),N.push(M)))}for(const M of N)E.delete(M);for(const M of b){const R=E.get(M);R===void 0||R.isAttached()||(S.has(M)||b.delete(M),E.delete(M))}}(a,c,n._dirtyLeaves,n._dirtyElements)),_!==n._compositionKey&&(c._flushSync=!0);const v=c._selection;if(k(v)){const x=c._nodeMap,y=v.anchor.key,b=v.focus.key;x.get(y)!==void 0&&x.get(b)!==void 0||L(19)}else ve(v)&&v._nodes.size===0&&(c._selection=null)}catch(_){return _ instanceof Error&&n._onError(_),n._pendingEditorState=a,n._dirtyType=lt,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void Ye(n)}finally{te=f,fe=d,ne=g,n._updating=h,Pn=0}n._dirtyType!==Je||function(_,v){const x=v.getEditorState()._selection,y=_._selection;if(y!==null){if(y.dirty||!y.is(x))return!0}else if(x!==null)return!0;return!1}(c,n)?c._flushSync?(c._flushSync=!1,Ye(n)):u&&vl(()=>{Ye(n)}):(c._flushSync=!1,u&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function he(n,e,t){n._updating?n._updates.push([e,t]):Vo(n,e,t)}class zn extends Ln{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 dl[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=Z()._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(j(t)&&e.push(t),C(t)){const r=t.getAllTextNodes();e.push(...r)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;C(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;C(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 C(o)&&o.getLastDescendant()||o||null}const i=t[e];return C(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&&L(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:se(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&L(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(),C(o)&&i!==r-1&&!o.isInline()&&(e+=Ee)}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(),C(o)&&i!==r-1&&!o.isInline()&&(e+=Ee.length)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(e!==""){const t=Ii[e];return!!(this.getFormat()&t)}return!1}select(e,t){ge();const r=O();let i=e,o=t;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const a=this.getFirstChild();if(j(a)||C(a))return a.select(0,0)}else if(!(e!==void 0&&e!==s||t!==void 0&&t!==s)){const a=this.getLastChild();if(j(a)||C(a))return a.select()}}i===void 0&&(i=s),o===void 0&&(o=s);const l=this.__key;return k(r)?(r.anchor.set(l,i,"element"),r.focus.set(l,o,"element"),r.dirty=!0,r):Ao(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!==""?Ii[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 f=null,d=o-t+i;if(e!==0)if(e===o)f=this.getLastChild();else{const h=this.getChildAtIndex(e);h!==null&&(f=h.getPreviousSibling())}if(t>0){let h=f===null?this.getFirstChild():f.getNextSibling();for(let m=0;m<t;m++){h===null&&L(100);const _=h.getNextSibling(),v=h.__key;Ze(h.getWritable()),c.push(v),h=_}}let g=f;for(let h=0;h<i;h++){const m=r[h];g!==null&&m.is(g)&&(f=g=g.getPreviousSibling());const _=m.getWritable();_.__parent===l&&d--,Ze(_);const v=m.__key;if(g===null)s.__first=v,_.__prev=null;else{const x=g.getWritable();x.__next=v,_.__prev=x.__key}m.__key===l&&L(76),_.__parent=l,a.push(v),g=m}if(e+t===o)g!==null&&(g.getWritable().__next=null,s.__last=g.__key);else if(u!==null){const h=u.getWritable();if(g!==null){const m=g.getWritable();h.__prev=g.__key,m.__next=u.__key}else h.__prev=null}if(s.__size=d,c.length){const h=O();if(k(h)){const m=new Set(c),_=new Set(a),{anchor:v,focus:x}=h;Jo(v,m,_)&&An(v,v.getNode(),this,f,u),Jo(x,m,_)&&An(x,x.getNode(),this,f,u),d!==0||this.canBeEmpty()||ut(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 C(n){return n instanceof zn}function Jo(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 Jl extends Ln{constructor(e){super(e)}decorate(e,t){L(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Y(n){return n instanceof Jl}class Gt extends zn{static getType(){return"root"}static clone(){return new Gt}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){L(51)}getTextContent(){const e=this.__cachedText;return!Zt()&&Z()._dirtyType!==Je||e===null?super.getTextContent():e}remove(){L(52)}replace(e){L(53)}insertBefore(e){L(54)}insertAfter(e){L(55)}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const r=e[t];C(r)||Y(r)||L(56)}return super.append(...e)}static importJSON(e){const t=G();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 Gt}function Gr(){return new Rn(new Map([["root",new Gt]]))}function Zo(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&L(130,t.name),C(n)){const r=e.children;Array.isArray(r)||L(59,t.name);const i=n.getChildren();for(let o=0;o<i.length;o++){const s=Zo(i[o]);r.push(s)}}return e}class Rn{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 Yo(t&&t.editor||null,this,e)}clone(e){const t=new Rn(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return Yo(null,this,()=>({root:Zo(G())}))}}class Hr extends zn{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class pt extends zn{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=ke[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 pt(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),r=At(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:Zl,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Nr(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=we();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=we();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||j(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 Zl(n){const e=we();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 we(){return Sn(new pt)}function Xr(n){return n instanceof pt}const $=0,ql=4;function qo(n,e,t,r){const i=n._keyToDOMMap;i.clear(),n._editorState=Gr(),n._pendingEditorState=r,n._compositionKey=null,n._dirtyType=Je,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 Gl(n){const e=n||{},t=Ql(),r=e.theme||{},i=n===void 0?t:e.parentEditor||null,o=e.disableEvents||!1,s=Gr(),l=e.namespace||(i!==null?i._config.namespace:Ji()),a=e.editorState,c=[Gt,ht,Yt,Qt,pt,Hr,...e.nodes||[]],{onError:u,html:f}=e,d=e.editable===void 0||e.editable;let g;if(n===void 0&&t!==null)g=t._nodes;else{g=new Map;for(let m=0;m<c.length;m++){let _=c[m],v=null,x=null;if(typeof _!="function"){const S=_;_=S.replace,v=S.with,x=S.withKlass||null}const y=_.getType(),b=_.transform(),T=new Set;b!==null&&T.add(b),g.set(y,{exportDOM:f&&f.export?f.export.get(_):void 0,klass:_,replace:v,replaceWithKlass:x,transforms:T})}}const h=new Fn(s,i,g,{disableEvents:o,namespace:l,theme:r},u||console.error,function(m,_){const v=new Map,x=new Set,y=b=>{Object.keys(b).forEach(T=>{let S=v.get(T);S===void 0&&(S=[],v.set(T,S)),S.push(b[T])})};return m.forEach(b=>{const T=b.klass.importDOM;if(T==null||x.has(T))return;x.add(T);const S=T.call(b.klass);S!==null&&y(S)}),_&&y(_),v}(g,f?f.import:void 0),d);return a!==void 0&&(h._pendingEditorState=a,h._dirtyType=lt),h}class Fn{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=Je,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=Ji(),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&&L(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&&L(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&&L(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const r=this._editorState,i=kl(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(),he(s,()=>{const a=Ie();if(a.isEmpty())return;if(l==="root")return void G().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 D(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=At(this._config.theme,"root"),i=this._pendingEditorState||this._editorState;if(this._rootElement=e,qo(this,t,e,i),t!==null&&(this._config.disableEvents||Dl(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=lt,Ai(this),this._updateTags.add("history-merge"),Ye(this),this._config.disableEvents||function(l,a){const c=l.ownerDocument,u=kn.get(c);(u===void 0||u<1)&&c.addEventListener("selectionchange",vo),kn.set(c,(u||0)+1),l.__lexicalEditor=a;const f=xo(l);for(let d=0;d<Pr.length;d++){const[g,h]=Pr[d],m=typeof h=="function"?_=>{So(_)||(Co(_),(a.isEditable()||g==="click")&&h(_,a))}:_=>{if(So(_))return;Co(_);const v=a.isEditable();switch(g){case"cut":return v&&D(a,Xn,_);case"copy":return D(a,an,_);case"paste":return v&&D(a,Gn,_);case"dragstart":return v&&D(a,wi,_);case"dragover":return v&&D(a,Mi,_);case"dragend":return v&&D(a,Js,_);case"focus":return v&&D(a,Gs,_);case"blur":return v&&D(a,Hs,_);case"drop":return v&&D(a,bi,_)}};l.addEventListener(g,m),f.push(()=>{l.removeEventListener(g,m)})}}(e,this),r!=null&&e.classList.add(...r)}else this._editorState=i,this._pendingEditorState=null,this._window=null;qt("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&L(38),Oi(this);const r=this._pendingEditorState,i=this._updateTags,o=t!==void 0?t.tag:null;r===null||r.isEmpty()||(o!=null&&i.add(o),Ye(this)),this._pendingEditorState=e,this._dirtyType=lt,this._dirtyElements.set("root",!1),this._compositionKey=null,o!=null&&i.add(o),Ye(this)}parseEditorState(e,t){return function(r,i,o){const s=Gr(),l=te,a=fe,c=ne,u=i._dirtyElements,f=i._dirtyLeaves,d=i._cloneNotNeeded,g=i._dirtyType;i._dirtyElements=new Map,i._dirtyLeaves=new Set,i._cloneNotNeeded=new Set,i._dirtyType=0,te=s,fe=!1,ne=i;try{const h=i._nodes;qr(r.root,h),o&&o(),s._readOnly=!0}catch(h){h instanceof Error&&i._onError(h)}finally{i._dirtyElements=u,i._dirtyLeaves=f,i._cloneNotNeeded=d,i._dirtyType=g,te=l,fe=a,ne=c}return s}(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return Ye(this),this.getEditorState().read(e,{editor:this})}update(e,t){he(this,e,t)}focus(e,t={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),he(this,()=>{const i=O(),o=G();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=Te(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,qt("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}Fn.version="0.17.1+prod.esm";const Lc="";function Hl(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Xl=Hl(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 Go=P.createContext(null);function ea(n,e){let t=null;return n!=null&&(t=n[1]),{getTheme:function(){return e??(t!=null?t.getTheme():null)}}}function et(){const n=P.useContext(Go);return n==null&&Xl(8),n}const Ho=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ta=Ho?P.useLayoutEffect:P.useEffect,Wn={tag:"history-merge"};function na({initialConfig:n,children:e}){const t=P.useMemo(()=>{const{theme:r,namespace:i,nodes:o,onError:s,editorState:l,html:a}=n,c=ea(null,r),u=Gl({editable:n.editable,html:a,namespace:i,nodes:o,onError:f=>s(f,u),theme:r});return function(f,d){if(d!==null){if(d===void 0)f.update(()=>{const g=G();if(g.isEmpty()){const h=we();g.append(h);const m=Ho?document.activeElement:null;(O()!==null||m!==null&&m===f.getRootElement())&&h.select()}},Wn);else if(d!==null)switch(typeof d){case"string":{const g=f.parseEditorState(d);f.setEditorState(g,Wn);break}case"object":f.setEditorState(d,Wn);break;case"function":f.update(()=>{G().isEmpty()&&d(f)},Wn)}}}(u,l),[u,c]},[]);return ta(()=>{const r=n.editable,[i]=t;i.setEditable(r===void 0||r)},[]),A.jsx(Go.Provider,{value:t,children:e})}function ra({defaultSelection:n}){const[e]=et();return P.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 ia(){return G().getTextContent()}function oa(n,e=!0){if(n)return!1;let t=ia();return e&&(t=t.trim()),t===""}function sa(n){if(!oa(n,!1))return!1;const e=G().getChildren(),t=e.length;if(t>1)return!1;for(let r=0;r<t;r++){const i=e[r];if(Y(i))return!1;if(C(i)){if(!Xr(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(!j(a))return!1}}}return!0}function Xo(n){return()=>sa(n)}function la(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}la(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 aa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}aa(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 ca=new Map;function ua(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 es(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,f]=Kr(n),d=s.is(l),g=e.is(o?l:s),h=e.is(o?s:l);let m,_=0;return d?(_=u>f?f:u,m=u>f?u:f):g?(_=o?f:u,m=void 0):h&&(_=0,m=o?u:f),e.__text=e.__text.slice(_,m),e}}return e}function da(n){const e=n.getStyle(),t=ua(e);ca.set(e,t)}function ts(n,e){const t=Pt(n.focus,e);return Y(t)&&!t.isIsolated()||C(t)&&!t.isInline()&&!t.canBeEmpty()}function fa(n,e,t,r){n.modify(e?"extend":"move",t,r)}function ga(n){const e=n.anchor.getNode();return(oe(e)?e:e.getParentOrThrow()).getDirection()==="rtl"}function ns(n,e,t){const r=ga(n);fa(n,e,t?!r:r,"character")}function ha(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var pa=ha(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 rs=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,_a=rs&&"documentMode"in document?document.documentMode:null;!(!rs||!("InputEvent"in window)||_a)&&"getTargetRanges"in new window.InputEvent("input");function _t(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}function ma(n){const e=ei(n,t=>C(t)&&!t.isInline());return C(e)||pa(4,n.__key),e}const ei=(n,e)=>{let t=n;for(;t!==G()&&t!=null;){if(e(t))return t;t=t.getParent()}return null};function tt(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}const is=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?P.useLayoutEffect:P.useEffect;function ya({editor:n,ariaActiveDescendant:e,ariaAutoComplete:t,ariaControls:r,ariaDescribedBy:i,ariaExpanded:o,ariaLabel:s,ariaLabelledBy:l,ariaMultiline:a,ariaOwns:c,ariaRequired:u,autoCapitalize:f,className:d,id:g,role:h="textbox",spellCheck:m=!0,style:_,tabIndex:v,"data-testid":x,...y},b){const[T,S]=P.useState(n.isEditable()),E=P.useCallback(M=>{M&&M.ownerDocument&&M.ownerDocument.defaultView?n.setRootElement(M):n.setRootElement(null)},[n]),N=P.useMemo(()=>function(...M){return R=>{M.forEach(B=>{typeof B=="function"?B(R):B!=null&&(B.current=R)})}}(b,E),[E,b]);return is(()=>(S(n.isEditable()),n.registerEditableListener(M=>{S(M)})),[n]),A.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&&h==="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:f,className:d,contentEditable:T,"data-testid":x,id:g,ref:N,role:T?h:void 0,spellCheck:m,style:_,tabIndex:v})}const xa=P.forwardRef(ya);function os(n){return n.getEditorState().read(Xo(n.isComposing()))}const va=P.forwardRef(Ca);function Ca(n,e){const{placeholder:t,...r}=n,[i]=et();return A.jsxs(A.Fragment,{children:[A.jsx(xa,{editor:i,...r,ref:e}),t!=null&&A.jsx(Sa,{editor:i,content:t})]})}function Sa({content:n,editor:e}){const t=function(s){const[l,a]=P.useState(()=>os(s));return is(()=>{function c(){const u=os(s);a(u)}return c(),_t(s.registerUpdateListener(()=>{c()}),s.registerEditableListener(()=>{c()}))},[s]),l}(e),[r,i]=P.useState(e.isEditable());if(P.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:A.jsx("div",{"aria-hidden":!0,children:o})}const Bn=0,ti=1,ni=2,Ce=0,Ta=1,ss=2,Na=3,ba=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 Ta;if(!(k(o)&&k(s)&&s.isCollapsed()&&o.isCollapsed()))return Ce;const l=function(v,x,y){const b=v._nodeMap,T=[];for(const S of x){const E=b.get(S);E!==void 0&&T.push(E)}for(const[S,E]of y){if(!E)continue;const N=b.get(S);N===void 0||oe(N)||T.push(N)}return T}(e,t,r);if(l.length===0)return Ce;if(l.length>1){const v=e._nodeMap,x=v.get(o.anchor.key),y=v.get(s.anchor.key);return x&&y&&!n._nodeMap.has(x.__key)&&j(x)&&x.__text.length===1&&o.anchor.offset===1?ss:Ce}const a=l[0],c=n._nodeMap.get(a.__key);if(!j(c)||!j(a)||c.__mode!==a.__mode)return Ce;const u=c.__text,f=a.__text;if(u===f)return Ce;const d=o.anchor,g=s.anchor;if(d.key!==g.key||d.type!=="text")return Ce;const h=d.offset,m=g.offset,_=f.length-u.length;return _===1&&m===h-1?ss:_===-1&&m===h+1?Na:_===-1&&m===h?ba:Ce}function Ma(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,ni;const f=wa(i,o,l,a,n.isComposing()),d=(()=>{const g=s===null||s.editor===n,h=c.has("history-push");if(!h&&g&&c.has("history-merge"))return Bn;if(i===null)return ti;const m=o._selection;return l.size>0||a.size>0?h===!1&&f!==Ce&&f===r&&u<t+e&&g||l.size===1&&function(_,v,x){const y=v._nodeMap.get(_),b=x._nodeMap.get(_),T=v._selection,S=x._selection;return!(k(T)&&k(S)&&T.anchor.type==="element"&&T.focus.type==="element"&&S.anchor.type==="text"&&S.focus.type==="text"||!j(y)||!j(b)||y.__parent!==b.__parent)&&JSON.stringify(v.read(()=>y.exportJSON()))===JSON.stringify(x.read(()=>b.exportJSON()))}(Array.from(l)[0],i,o)?Bn:ti:m!==null?Bn:ni})();return t=u,r=f,d}}function ls(n){n.undoStack=[],n.redoStack=[],n.current=null}function Ea(n,e,t){const r=Ma(n,t);return _t(n.registerCommand(on,()=>(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(Et,!0)),a.length===0&&o.dispatchCommand(kt,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),$),n.registerCommand(sn,()=>(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(kt,!0));const u=l.pop();l.length===0&&o.dispatchCommand(Et,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),$),n.registerCommand(Zs,()=>(ls(e),!1),$),n.registerCommand(qs,()=>(ls(e),n.dispatchCommand(Et,!1),n.dispatchCommand(kt,!1),!0),$),n.registerUpdateListener(({editorState:o,prevEditorState:s,dirtyLeaves:l,dirtyElements:a,tags:c})=>{const u=e.current,f=e.redoStack,d=e.undoStack,g=u===null?null:u.editorState;if(u!==null&&o===g)return;const h=r(s,o,u,l,a,c);if(h===ti)f.length!==0&&(e.redoStack=[],n.dispatchCommand(Et,!1)),u!==null&&(d.push({...u}),n.dispatchCommand(kt,!0));else if(h===ni)return;e.current={editor:n,editorState:o}}))}function ka(){return{current:null,redoStack:[],undoStack:[]}}function La({delay:n,externalHistoryState:e}){const[t]=et();return function(r,i,o=1e3){const s=P.useMemo(()=>i||ka(),[i]);P.useEffect(()=>Ea(r,s,o),[o,r,s])}(t,e,n),null}const ja=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?P.useLayoutEffect:P.useEffect;function Ia(n){return{initialValueFn:()=>n.isEditable(),subscribe:e=>n.registerEditableListener(e)}}function Da(){return function(n){const[e]=et(),t=P.useMemo(()=>n(e),[e,n]),r=P.useRef(t.initialValueFn()),[i,o]=P.useState(r.current);return ja(()=>{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}(Ia)}function Oa(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,f,d,g,h]=a;n.update(()=>{const m=O();if(k(m)){const _=m.anchor;let v=_.getNode(),x=0,y=0;if(j(v)&&c>=0&&u>=0&&(x=c,y=c+u,m.setTextNodeRange(v,x,v,y)),x===y&&f===""||(m.insertRawText(f),v=_.getNode()),j(v)){x=d,y=d+g;const b=v.getTextContentSize();x=x>b?b:x,y=y>b?b:y,m.setTextNodeRange(v,x,v,y)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}function Aa(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(!cs.has(s.nodeName)){const l=us(s,n,i,!1);l!==null&&(r=r.concat(l))}}return function(o){for(const s of o)s.getNextSibling()instanceof Hr&&s.insertAfter(Xe());for(const s of o){const l=s.getChildren();for(const a of l)s.insertBefore(a);s.remove()}}(i),r}function Pa(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=G().getChildren();for(let i=0;i<r.length;i++)as(n,r[i],t,e);return t.innerHTML}function as(n,e,t,r=null){let i=r===null||e.isSelected(r);const o=C(e)&&e.excludeFromCopy("html");let s=e;if(r!==null){let g=Mr(e);g=j(g)&&r!==null?es(r,g):g,s=g}const l=C(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:f}=c;if(!u)return!1;const d=document.createDocumentFragment();for(let g=0;g<l.length;g++){const h=l[g],m=as(n,h,d,r);!i&&C(e)&&m&&e.extractWithChild(h,r,"html")&&(i=!0)}if(i&&!o){if(Nr(u)&&u.append(d),t.append(u),f){const g=f.call(s,u);g&&u.replaceWith(g)}}else t.append(d);return i}const cs=new Set(["STYLE","SCRIPT"]);function us(n,e,t,r,i=new Map,o){let s=[];if(cs.has(n.nodeName))return s;let l=null;const a=function(h,m){const{nodeName:_}=h,v=m._htmlConversions.get(_.toLowerCase());let x=null;if(v!==void 0)for(const y of v){const b=y(h);b!==null&&(x===null||(x.priority||0)<(b.priority||0))&&(x=b)}return x!==null?x.conversion:null}(n,e),c=a?a(n):null;let u=null;if(c!==null){u=c.after;const h=c.node;if(l=Array.isArray(h)?h[h.length-1]:h,l!==null){for(const[,m]of i)if(l=m(l,o),!l)break;l&&s.push(...Array.isArray(h)?h:[l])}c.forChild!=null&&i.set(n.nodeName,c.forChild)}const f=n.childNodes;let d=[];const g=(l==null||!ut(l))&&(l!=null&&Qr(l)||r);for(let h=0;h<f.length;h++)d.push(...us(f[h],e,t,g,new Map(i),l));return u!=null&&(d=u(d)),Tn(n)&&(d=za(n,d,g?()=>{const h=new Hr;return t.push(h),h}:we)),l==null?d.length>0?s=s.concat(d):Tn(n)&&function(h){return h.nextSibling==null||h.previousSibling==null?!1:br(h.nextSibling)&&br(h.previousSibling)}(n)&&(s=s.concat(Xe())):C(l)&&l.append(...d),s}function za(n,e,t){const r=n.style.textAlign,i=[];let o=[];for(let s=0;s<e.length;s++){const l=e[s];if(Qr(l))r&&!l.getFormat()&&l.setFormat(r),i.push(l);else if(o.push(l),s===e.length-1||s<e.length-1&&Qr(e[s+1])){const a=t();a.setFormat(r),a.append(...o),i.push(a),o=[]}}return i}function Ra(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Un=Ra(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 Fa=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ds=n=>Fa?(n||window).getSelection():null;function Wa(n,e=O()){return e==null&&Un(166),k(e)&&e.isCollapsed()||e.getNodes().length===0?"":Pa(n,e)}function Ba(n,e=O()){return e==null&&Un(166),k(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(Ua(n,e))}function fs(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 gs(t,$a(s.nodes),e)}catch{}const i=n.getData("text/html");if(i)try{const s=new DOMParser().parseFromString(i,"text/html");return gs(t,Aa(t,s),e)}catch{}const o=n.getData("text/plain")||n.getData("text/uri-list");if(o!=null)if(k(e)){const s=o.split(/(\r?\n|\t)/);s[s.length-1]===""&&s.pop();for(let l=0;l<s.length;l++){const a=O();if(k(a)){const c=s[l];c===`
|
|
40
40
|
`||c===`\r
|
|
41
|
-
`?a.insertParagraph():c===" "?a.insertNodes([Yt()]):a.insertText(c)}}}else e.insertRawText(o)}function hs(n,e,t){n.dispatchCommand(Bs,{nodes:e,selection:t})||t.insertNodes(e)}function gs(n,e,t,r=[]){let i=e===null||t.isSelected(e);const o=C(t)&&t.excludeFromCopy("html");let s=t;if(e!==null){let c=Er(t);c=D(c)&&e!==null?es(e,c):c,s=c}const l=C(s)?s.getChildren():[],a=function(c){const u=c.exportJSON(),d=c.constructor;if(u.type!==d.getType()&&$n(58,d.name),C(c)){const f=u.children;Array.isArray(f)||$n(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=gs(n,e,u,a.children);!i&&C(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 $a(n,e){const t=[],r=X().getChildren();for(let i=0;i<r.length;i++)gs(n,e,r[i],t);return{namespace:n._config.namespace,nodes:t}}function Ka(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=Yl(r);D(i)&&fa(i),e.push(i)}return e}let mt=null;async function ps(n,e,t){if(mt!==null)return!1;if(e!==null)return new Promise((a,c)=>{n.update(()=>{a(_s(n,e,t))})});const r=n.getRootElement(),i=n._window==null?window.document:n._window.document,o=fs(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(an,d=>(tt(d,ClipboardEvent)&&(u(),mt!==null&&(window.clearTimeout(mt),mt=null),a(_s(n,d,t))),!0),Gl);mt=window.setTimeout(()=>{u(),mt=null,a(!1)},50),i.execCommand("copy"),s.remove()})}function _s(n,e,t){if(t===void 0){const i=fs(n._window);if(!i)return!1;const o=i.anchorNode,s=i.focusNode;if(o!==null&&s!==null&&!Dt(n,o,s))return!1;const l=I();if(l===null)return!1;t=Ja(l)}e.preventDefault();const r=e.clipboardData;return r!==null&&(Va(r,t),!0)}const Ua=[["text/html",Ba],["application/x-lexical-editor",za]];function Ja(n=I()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=El();for(const[r,i]of Ua){const o=i(t,n);o!==null&&(e[r]=o)}}return e}function Va(n,e){for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}function ms(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 yt=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Ya=yt&&"documentMode"in document?document.documentMode:null,qa=!(!yt||!("InputEvent"in window)||Ya)&&"getTargetRanges"in new window.InputEvent("input"),Ha=yt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Ga=yt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Xa=yt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Qa=yt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Xa,ys=Ws();function Kn(n){let e=null;if(tt(n,DragEvent)?e=n.dataTransfer:tt(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 vs(n){const e=I();if(!P(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=ei(o,c=>C(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 Un(n){const e=Ge(n);return U(e)}function Za(n){return _t(n.registerCommand(_i,e=>{const t=I();return!!xe(t)&&(t.clear(),!0)},0),n.registerCommand(Ye,e=>{const t=I();return!!P(t)&&(t.deleteCharacter(e),!0)},K),n.registerCommand(Tt,e=>{const t=I();return!!P(t)&&(t.deleteWord(e),!0)},K),n.registerCommand(kt,e=>{const t=I();return!!P(t)&&(t.deleteLine(e),!0)},K),n.registerCommand(st,e=>{const t=I();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const r=e.dataTransfer;if(r!=null)ds(r,t,n);else if(P(t)){const i=e.data;return i&&t.insertText(i),!0}}return!0},K),n.registerCommand(Qn,()=>{const e=I();return!!P(e)&&(e.removeText(),!0)},K),n.registerCommand(ge,e=>{const t=I();return!!P(t)&&(t.formatText(e),!0)},K),n.registerCommand(Et,e=>{const t=I();if(!P(t)&&!xe(t))return!1;const r=t.getNodes();for(const i of r){const o=ei(i,s=>C(s)&&!s.isInline());o!==null&&o.setFormat(e)}return!0},K),n.registerCommand(ot,e=>{const t=I();return!!P(t)&&(t.insertLineBreak(e),!0)},K),n.registerCommand(rn,()=>{const e=I();return!!P(e)&&(e.insertParagraph(),!0)},K),n.registerCommand(Vs,()=>(Ul([Yt()]),!0),K),n.registerCommand(Ys,()=>vs(e=>{const t=e.getIndent();e.setIndent(t+1)}),K),n.registerCommand(wi,()=>vs(e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}),K),n.registerCommand(vi,e=>{const t=I();if(xe(t)&&!Un(e.target)){const r=t.getNodes();if(r.length>0)return r[0].selectPrevious(),!0}else if(P(t)){const r=At(t.focus,!0);if(!e.shiftKey&&U(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},K),n.registerCommand(xi,e=>{const t=I();if(xe(t)){const r=t.getNodes();if(r.length>0)return r[0].selectNext(0,0),!0}else if(P(t)){if(function(i){const o=i.focus;return o.key==="root"&&o.offset===X().getChildrenSize()}(t))return e.preventDefault(),!0;const r=At(t.focus,!1);if(!e.shiftKey&&U(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},K),n.registerCommand(yi,e=>{const t=I();if(xe(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}if(!P(t))return!1;if(ts(t,!0)){const r=e.shiftKey;return e.preventDefault(),ns(t,r,!0),!0}return!1},K),n.registerCommand(mi,e=>{const t=I();if(xe(t)&&!Un(e.target)){const i=t.getNodes();if(i.length>0)return e.preventDefault(),i[0].selectNext(0,0),!0}if(!P(t))return!1;const r=e.shiftKey;return!!ts(t,!1)&&(e.preventDefault(),ns(t,r,!1),!0)},K),n.registerCommand(Ci,e=>{if(Un(e.target))return!1;const t=I();if(!P(t))return!1;e.preventDefault();const{anchor:r}=t,i=r.getNode();return t.isCollapsed()&&r.offset===0&&!oe(i)&&ma(i).getIndent()>0?n.dispatchCommand(wi,void 0):n.dispatchCommand(Ye,!0)},K),n.registerCommand(Si,e=>{if(Un(e.target))return!1;const t=I();return!!P(t)&&(e.preventDefault(),n.dispatchCommand(Ye,!1))},K),n.registerCommand(ln,e=>{const t=I();if(!P(t))return!1;if(e!==null){if((Ga||Ha||Qa)&&qa)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(ot,!1)}return n.dispatchCommand(rn,void 0)},K),n.registerCommand(bi,()=>{const e=I();return!!P(e)&&(n.blur(),!0)},K),n.registerCommand(Ti,e=>{const[,t]=Kn(e);if(t.length>0){const i=ms(e.clientX,e.clientY);if(i!==null){const{offset:o,node:s}=i,l=Ge(s);if(l!==null){const a=$l();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=Wi(a);be(c)}n.dispatchCommand(ys,t)}return e.preventDefault(),!0}const r=I();return!!P(r)},K),n.registerCommand(ki,e=>{const[t]=Kn(e),r=I();return!(t&&!P(r))},K),n.registerCommand(Ei,e=>{const[t]=Kn(e),r=I();if(t&&!P(r))return!1;const i=ms(e.clientX,e.clientY);if(i!==null){const o=Ge(i.node);U(o)&&e.preventDefault()}return!0},K),n.registerCommand(er,()=>(wl(),!0),K),n.registerCommand(an,e=>(ps(n,tt(e,ClipboardEvent)?e:null),!0),K),n.registerCommand(Zn,e=>(async function(t,r){await ps(r,tt(t,ClipboardEvent)?t:null),r.update(()=>{const i=I();P(i)?i.removeText():xe(i)&&i.getNodes().forEach(o=>o.remove())})}(e,n),!0),K),n.registerCommand(Xn,e=>{const[,t,r]=Kn(e);return t.length>0&&!r?(n.dispatchCommand(ys,t),!0):hr(e.target)?!1:I()!==null&&(function(i,o){i.preventDefault(),o.update(()=>{const s=I(),l=tt(i,InputEvent)||tt(i,KeyboardEvent)?null:i.clipboardData;l!=null&&s!==null&&ds(l,s,o)},{tag:"paste"})}(e,n),!0)},K))}const ri=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?A.useLayoutEffect:A.useEffect;function xs(n){return n.getEditorState().read(Zo(n.isComposing()))}function ec({contentEditable:n,placeholder:e=null,ErrorBoundary:t}){const[r]=et(),i=function(o,s){const[l,a]=A.useState(()=>o.getDecorators());return ri(()=>o.registerDecoratorListener(c=>{fi.flushSync(()=>{a(c)})}),[o]),A.useEffect(()=>{a(o.getDecorators())},[o]),A.useMemo(()=>{const c=[],u=Object.keys(l);for(let d=0;d<u.length;d++){const f=u[d],h=L.jsx(s,{onError:_=>o._onError(_),children:L.jsx(A.Suspense,{fallback:null,children:l[f]})}),g=o.getElementByKey(f);g!==null&&c.push(fi.createPortal(h,g,f))}return c},[s,l,o])}(r,t);return function(o){ri(()=>_t(Za(o),Ia(o)),[o])}(r),L.jsxs(L.Fragment,{children:[n,L.jsx(tc,{content:e}),i]})}function tc({content:n}){const[e]=et(),t=function(i){const[o,s]=A.useState(()=>xs(i));return ri(()=>{function l(){const a=xs(i);s(a)}return l(),_t(i.registerUpdateListener(()=>{l()}),i.registerEditableListener(()=>{l()}))},[i]),o}(e),r=Fa();return t?typeof n=="function"?n(r):n:null}function ii(n,e){return ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},ii(n,e)}var Cs={error:null},nc=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=Cs,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,ii(e,t),r.getDerivedStateFromError=function(o){return{error:o}};var i=r.prototype;return i.reset=function(){this.setState(Cs)},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(Yn.isValidElement(c))return c;if(typeof l=="function")return l(u);if(a)return Yn.createElement(a,u);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},r}(Yn.Component);function rc({children:n,onError:e}){return L.jsx(nc,{fallback:L.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:n})}const ic={code:"editor-code",heading:{h1:"editor-heading-h1",h2:"editor-heading-h2",h3:"editor-heading-h3",h4:"editor-heading-h4",h5:"editor-heading-h5"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"editor-list-ol",ul:"editor-list-ul"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough",underline:"editor-text-underline",underlineStrikethrough:"editor-text-underlineStrikethrough"}},oi=1;function bs(){return L.jsx("div",{className:"divider"})}function oc(){const[n]=et(),e=A.useRef(null),[t,r]=A.useState(!1),[i,o]=A.useState(!1),[s,l]=A.useState(!1),[a,c]=A.useState(!1),[u,d]=A.useState(!1),[f,h]=A.useState(!1),g=A.useCallback(()=>{const _=I();P(_)&&(l(_.hasFormat("bold")),c(_.hasFormat("italic")),d(_.hasFormat("underline")),h(_.hasFormat("strikethrough")))},[]);return A.useEffect(()=>_t(n.registerUpdateListener(({editorState:_})=>{_.read(()=>{g()})}),n.registerCommand(nn,(_,m)=>(g(),!1),oi),n.registerCommand(Pt,_=>(r(_),!1),oi),n.registerCommand(Nt,_=>(o(_),!1),oi)),[n,g]),L.jsxs("div",{className:"toolbar",ref:e,children:[L.jsx("button",{disabled:!t,onClick:()=>{n.dispatchCommand(on,void 0)},className:"toolbar-item spaced","aria-label":"Undo",children:L.jsx("i",{className:"format undo"})}),L.jsx("button",{disabled:!i,onClick:()=>{n.dispatchCommand(sn,void 0)},className:"toolbar-item","aria-label":"Redo",children:L.jsx("i",{className:"format redo"})}),L.jsx(bs,{}),L.jsx("button",{onClick:()=>{n.dispatchCommand(ge,"bold")},className:"toolbar-item spaced "+(s?"active":""),"aria-label":"Format Bold",children:L.jsx("i",{className:"format bold"})}),L.jsx("button",{onClick:()=>{n.dispatchCommand(ge,"italic")},className:"toolbar-item spaced "+(a?"active":""),"aria-label":"Format Italics",children:L.jsx("i",{className:"format italic"})}),L.jsx("button",{onClick:()=>{n.dispatchCommand(ge,"underline")},className:"toolbar-item spaced "+(u?"active":""),"aria-label":"Format Underline",children:L.jsx("i",{className:"format underline"})}),L.jsx("button",{onClick:()=>{n.dispatchCommand(ge,"strikethrough")},className:"toolbar-item spaced "+(f?"active":""),"aria-label":"Format Strikethrough",children:L.jsx("i",{className:"format strikethrough"})}),L.jsx(bs,{}),L.jsx("button",{onClick:()=>{n.dispatchCommand(Et,"left")},className:"toolbar-item spaced","aria-label":"Left Align",children:L.jsx("i",{className:"format left-align"})}),L.jsx("button",{onClick:()=>{n.dispatchCommand(Et,"center")},className:"toolbar-item spaced","aria-label":"Center Align",children:L.jsx("i",{className:"format center-align"})}),L.jsx("button",{onClick:()=>{n.dispatchCommand(Et,"right")},className:"toolbar-item spaced","aria-label":"Right Align",children:L.jsx("i",{className:"format right-align"})}),L.jsx("button",{onClick:()=>{n.dispatchCommand(Et,"justify")},className:"toolbar-item","aria-label":"Justify Align",children:L.jsx("i",{className:"format justify-align"})})," "]})}function sc(){return L.jsx("div",{className:"editor-placeholder",children:"Enter some rich text..."})}const lc={namespace:"React.js Demo",nodes:[],onError(n){throw n},theme:ic};function ac(){return L.jsx(na,{initialConfig:lc,children:L.jsxs("div",{className:"editor-container",children:[L.jsx(oc,{}),L.jsxs("div",{className:"editor-inner",children:[L.jsx(ec,{contentEditable:L.jsx(xa,{className:"editor-input"}),placeholder:L.jsx(sc,{}),ErrorBoundary:rc}),L.jsx(Oa,{}),L.jsx(ra,{})]})]})})}Ae.Editor=ac,Object.defineProperty(Ae,Symbol.toStringTag,{value:"Module"})});
|
|
41
|
+
`?a.insertParagraph():c===" "?a.insertNodes([Vt()]):a.insertText(c)}}}else e.insertRawText(o)}function gs(n,e,t){n.dispatchCommand(Ws,{nodes:e,selection:t})||t.insertNodes(e)}function hs(n,e,t,r=[]){let i=e===null||t.isSelected(e);const o=C(t)&&t.excludeFromCopy("html");let s=t;if(e!==null){let c=Mr(t);c=j(c)&&e!==null?es(e,c):c,s=c}const l=C(s)?s.getChildren():[],a=function(c){const u=c.exportJSON(),f=c.constructor;if(u.type!==f.getType()&&Un(58,f.name),C(c)){const d=u.children;Array.isArray(d)||Un(59,f.name)}return u}(s);if(j(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],f=hs(n,e,u,a.children);!i&&C(t)&&f&&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 Ua(n,e){const t=[],r=G().getChildren();for(let i=0;i<r.length;i++)hs(n,e,r[i],t);return{namespace:n._config.namespace,nodes:t}}function $a(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=Vl(r);j(i)&&da(i),e.push(i)}return e}let mt=null;async function ps(n,e,t){if(mt!==null)return!1;if(e!==null)return new Promise((a,c)=>{n.update(()=>{a(_s(n,e,t))})});const r=n.getRootElement(),i=n._window==null?window.document:n._window.document,o=ds(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(an,f=>(tt(f,ClipboardEvent)&&(u(),mt!==null&&(window.clearTimeout(mt),mt=null),a(_s(n,f,t))),!0),ql);mt=window.setTimeout(()=>{u(),mt=null,a(!1)},50),i.execCommand("copy"),s.remove()})}function _s(n,e,t){if(t===void 0){const i=ds(n._window);if(!i)return!1;const o=i.anchorNode,s=i.focusNode;if(o!==null&&s!==null&&!jt(n,o,s))return!1;const l=O();if(l===null)return!1;t=Ka(l)}e.preventDefault();const r=e.clipboardData;return r!==null&&(Qa(r,t),!0)}const Ya=[["text/html",Wa],["application/x-lexical-editor",Ba]];function Ka(n=O()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=Ml();for(const[r,i]of Ya){const o=i(t,n);o!==null&&(e[r]=o)}}return e}function Qa(n,e){for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}function ms(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 yt=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Va=yt&&"documentMode"in document?document.documentMode:null,Ja=!(!yt||!("InputEvent"in window)||Va)&&"getTargetRanges"in new window.InputEvent("input"),Za=yt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),qa=yt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Ga=yt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Ha=yt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ga,ys=Fs();function $n(n){let e=null;if(tt(n,DragEvent)?e=n.dataTransfer:tt(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 xs(n){const e=O();if(!k(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=ei(o,c=>C(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 Yn(n){const e=qe(n);return Y(e)}function Xa(n){return _t(n.registerCommand(_i,e=>{const t=O();return!!ve(t)&&(t.clear(),!0)},0),n.registerCommand(Ve,e=>{const t=O();return!!k(t)&&(t.deleteCharacter(e),!0)},$),n.registerCommand(bt,e=>{const t=O();return!!k(t)&&(t.deleteWord(e),!0)},$),n.registerCommand(wt,e=>{const t=O();return!!k(t)&&(t.deleteLine(e),!0)},$),n.registerCommand(st,e=>{const t=O();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const r=e.dataTransfer;if(r!=null)fs(r,t,n);else if(k(t)){const i=e.data;return i&&t.insertText(i),!0}}return!0},$),n.registerCommand(Hn,()=>{const e=O();return!!k(e)&&(e.removeText(),!0)},$),n.registerCommand(de,e=>{const t=O();return!!k(t)&&(t.formatText(e),!0)},$),n.registerCommand(Mt,e=>{const t=O();if(!k(t)&&!ve(t))return!1;const r=t.getNodes();for(const i of r){const o=ei(i,s=>C(s)&&!s.isInline());o!==null&&o.setFormat(e)}return!0},$),n.registerCommand(ot,e=>{const t=O();return!!k(t)&&(t.insertLineBreak(e),!0)},$),n.registerCommand(rn,()=>{const e=O();return!!k(e)&&(e.insertParagraph(),!0)},$),n.registerCommand(Qs,()=>(Yl([Vt()]),!0),$),n.registerCommand(Vs,()=>xs(e=>{const t=e.getIndent();e.setIndent(t+1)}),$),n.registerCommand(Ni,()=>xs(e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}),$),n.registerCommand(xi,e=>{const t=O();if(ve(t)&&!Yn(e.target)){const r=t.getNodes();if(r.length>0)return r[0].selectPrevious(),!0}else if(k(t)){const r=Pt(t.focus,!0);if(!e.shiftKey&&Y(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},$),n.registerCommand(vi,e=>{const t=O();if(ve(t)){const r=t.getNodes();if(r.length>0)return r[0].selectNext(0,0),!0}else if(k(t)){if(function(i){const o=i.focus;return o.key==="root"&&o.offset===G().getChildrenSize()}(t))return e.preventDefault(),!0;const r=Pt(t.focus,!1);if(!e.shiftKey&&Y(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},$),n.registerCommand(yi,e=>{const t=O();if(ve(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}if(!k(t))return!1;if(ts(t,!0)){const r=e.shiftKey;return e.preventDefault(),ns(t,r,!0),!0}return!1},$),n.registerCommand(mi,e=>{const t=O();if(ve(t)&&!Yn(e.target)){const i=t.getNodes();if(i.length>0)return e.preventDefault(),i[0].selectNext(0,0),!0}if(!k(t))return!1;const r=e.shiftKey;return!!ts(t,!1)&&(e.preventDefault(),ns(t,r,!1),!0)},$),n.registerCommand(Ci,e=>{if(Yn(e.target))return!1;const t=O();if(!k(t))return!1;e.preventDefault();const{anchor:r}=t,i=r.getNode();return t.isCollapsed()&&r.offset===0&&!oe(i)&&ma(i).getIndent()>0?n.dispatchCommand(Ni,void 0):n.dispatchCommand(Ve,!0)},$),n.registerCommand(Ti,e=>{if(Yn(e.target))return!1;const t=O();return!!k(t)&&(e.preventDefault(),n.dispatchCommand(Ve,!1))},$),n.registerCommand(ln,e=>{const t=O();if(!k(t))return!1;if(e!==null){if((qa||Za||Ha)&&Ja)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(ot,!1)}return n.dispatchCommand(rn,void 0)},$),n.registerCommand(Si,()=>{const e=O();return!!k(e)&&(n.blur(),!0)},$),n.registerCommand(bi,e=>{const[,t]=$n(e);if(t.length>0){const i=ms(e.clientX,e.clientY);if(i!==null){const{offset:o,node:s}=i,l=qe(s);if(l!==null){const a=Ul();if(j(l))a.anchor.set(l.getKey(),o,"text"),a.focus.set(l.getKey(),o,"text");else{const u=l.getParentOrThrow().getKey(),f=l.getIndexWithinParent()+1;a.anchor.set(u,f,"element"),a.focus.set(u,f,"element")}const c=Fi(a);Se(c)}n.dispatchCommand(ys,t)}return e.preventDefault(),!0}const r=O();return!!k(r)},$),n.registerCommand(wi,e=>{const[t]=$n(e),r=O();return!(t&&!k(r))},$),n.registerCommand(Mi,e=>{const[t]=$n(e),r=O();if(t&&!k(r))return!1;const i=ms(e.clientX,e.clientY);if(i!==null){const o=qe(i.node);Y(o)&&e.preventDefault()}return!0},$),n.registerCommand(er,()=>(Nl(),!0),$),n.registerCommand(an,e=>(ps(n,tt(e,ClipboardEvent)?e:null),!0),$),n.registerCommand(Xn,e=>(async function(t,r){await ps(r,tt(t,ClipboardEvent)?t:null),r.update(()=>{const i=O();k(i)?i.removeText():ve(i)&&i.getNodes().forEach(o=>o.remove())})}(e,n),!0),$),n.registerCommand(Gn,e=>{const[,t,r]=$n(e);return t.length>0&&!r?(n.dispatchCommand(ys,t),!0):gr(e.target)?!1:O()!==null&&(function(i,o){i.preventDefault(),o.update(()=>{const s=O(),l=tt(i,InputEvent)||tt(i,KeyboardEvent)?null:i.clipboardData;l!=null&&s!==null&&fs(l,s,o)},{tag:"paste"})}(e,n),!0)},$))}const ri=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?P.useLayoutEffect:P.useEffect;function vs(n){return n.getEditorState().read(Xo(n.isComposing()))}function ec({contentEditable:n,placeholder:e=null,ErrorBoundary:t}){const[r]=et(),i=function(o,s){const[l,a]=P.useState(()=>o.getDecorators());return ri(()=>o.registerDecoratorListener(c=>{di.flushSync(()=>{a(c)})}),[o]),P.useEffect(()=>{a(o.getDecorators())},[o]),P.useMemo(()=>{const c=[],u=Object.keys(l);for(let f=0;f<u.length;f++){const d=u[f],g=A.jsx(s,{onError:m=>o._onError(m),children:A.jsx(P.Suspense,{fallback:null,children:l[d]})}),h=o.getElementByKey(d);h!==null&&c.push(di.createPortal(g,h,d))}return c},[s,l,o])}(r,t);return function(o){ri(()=>_t(Xa(o),Oa(o)),[o])}(r),A.jsxs(A.Fragment,{children:[n,A.jsx(tc,{content:e}),i]})}function tc({content:n}){const[e]=et(),t=function(i){const[o,s]=P.useState(()=>vs(i));return ri(()=>{function l(){const a=vs(i);s(a)}return l(),_t(i.registerUpdateListener(()=>{l()}),i.registerEditableListener(()=>{l()}))},[i]),o}(e),r=Da();return t?typeof n=="function"?n(r):n:null}function ii(n,e){return ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},ii(n,e)}var Cs={error:null},nc=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=Cs,o.resetErrorBoundary=function(){for(var c,u=arguments.length,f=new Array(u),d=0;d<u;d++)f[d]=arguments[d];o.props.onReset==null||(c=o.props).onReset.apply(c,f),o.reset()},o}t=n,(e=r).prototype=Object.create(t.prototype),e.prototype.constructor=e,ii(e,t),r.getDerivedStateFromError=function(o){return{error:o}};var i=r.prototype;return i.reset=function(){this.setState(Cs)},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,f=this.state.error,d=this.props.resetKeys;f!==null&&s.error!==null&&((c=o.resetKeys)===void 0&&(c=[]),(u=d)===void 0&&(u=[]),c.length!==u.length||c.some(function(g,h){return!Object.is(g,u[h])}))&&((l=(a=this.props).onResetKeysChange)==null||l.call(a,o.resetKeys,d),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(Vn.isValidElement(c))return c;if(typeof l=="function")return l(u);if(a)return Vn.createElement(a,u);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},r}(Vn.Component);function rc({children:n,onError:e}){return A.jsx(nc,{fallback:A.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:n})}const ic={code:"editor-code",heading:{h1:"editor-heading-h1",h2:"editor-heading-h2",h3:"editor-heading-h3",h4:"editor-heading-h4",h5:"editor-heading-h5"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"editor-list-ol",ul:"editor-list-ul"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough",underline:"editor-text-underline",underlineStrikethrough:"editor-text-underlineStrikethrough"}},oc="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiB0ZXh0LXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiBpbWFnZS1yZW5kZXJpbmc9Im9wdGltaXplUXVhbGl0eSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIHZpZXdCb3g9IjAgMCA1MTIgNDI2Ljg1Ij48cGF0aCBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik0xNzQuMiAxMjUuMyAyNjYuNzQgMGg3Ni42NUwyMTIuODggMTczLjk5bDEzNS45IDE4MC40NUgyNzJsLTk3Ljg0LTEzMS44LTk3LjUyIDEzMS44SDBMMTM1Ljg4IDE3NCA1LjA3IDBoNzcuMDRsOTIuMDkgMTI1LjN6bTMyMi4zOCAzMDEuNTVIMzczLjV2LTI0LjE0bDIuNDMtNi40M2M1LjQ1LTYuMyA2MC4zNC02OS40OCA2MC4zNC02OS42MyAyLjk0LTMuMzggNS40NC02LjM0IDcuNDctOC44NyAyLjI1LTIuNzggNC4zNS01LjUxIDYuMy04LjE3IDEuOTUtMi42NSAzLjY0LTUuMSA1LjA4LTcuMzEgMS40OC0yLjI5IDIuNzctNC40MyAzLjg0LTYuMzkuOTgtMS44MSAxLjg5LTMuNjYgMi42OS01LjUzLjc0LTEuNzMgMS4zNC0zLjQgMS44LTQuOTYuNC0xLjM4LjcyLTIuODMuOTUtNC4zMi4yLTEuMzIuMzEtMi42My4zMS0zLjkxIDAtNC43OS0uNTktOC44Ni0xLjc3LTEyLjIyLTEuMDUtMy0yLjYxLTUuNTUtNC42Ni03LjYzLS45LS44OS0xLjk3LTEuNzMtMy4yMS0yLjQ5di0uMDVjLTEuMjUtLjc3LTIuNjQtMS40Mi00LjEzLTEuOTQtMS43Ny0uNTgtMy43NC0xLjA0LTUuOTItMS4zNi0yLjIyLS4zMy00LjcyLS40OS03LjUtLjQ5LTIuOTcgMC01LjYyLjE5LTcuOTIuNTYtMi4yNy4zNy00LjM3LjkyLTYuMjkgMS42NC0xLjc0LjY2LTMuMzcgMS40OS00Ljg0IDIuNDZoLS4wNGMtMS4zNy45LTIuNjcgMi4wMS0zLjkxIDMuMzFhMjkuMzI4IDI5LjMyOCAwIDAgMC0zLjQ1IDQuNTMgMjguMTQ1IDI4LjE0NSAwIDAgMC0yLjQ3IDUuMWMtLjY3IDEuODktMS4xOSAzLjk1LTEuNTUgNi4xNi0uMzQgMi4xNS0uNTIgNC42Mi0uNTIgNy4zOXYxNS40MmgtMzIuNDRsLTIuNDktOC4zOWMtMS42LTUuNDMtMi4wMi0xMC45Ny0xLjU5LTE2LjM5LjQ2LTUuODEgMS45My0xMS41OSAzLjk0LTE2Ljk4IDEuNS00LjAzIDMuNDMtNy45MiA1Ljc4LTExLjY3di0uMDRjMi4zMS0zLjY4IDUtNy4xNSA4LjA1LTEwLjQgMy4xNi0zLjM4IDYuNjItNi4zNyAxMC4zNi04LjkzIDMuNjctMi41MSA3LjY4LTQuNjQgMTIuMDMtNi4zN2E2Ny4yNiA2Ny4yNiAwIDAgMSAxMy4xNy0zLjczdi0uMDVjNC41Mi0uOCA5LjI1LTEuMjEgMTQuMTgtMS4yMSA0LjM4IDAgOC43NS4zNCAxMy4wNyAxLjAzIDQuMzMuNjkgOC40IDEuNzEgMTIuMTkgMy4wNSAzLjkgMS4zOCA3LjY1IDMuMTggMTEuMjQgNS4zNmguMDVjMy41MSAyLjEzIDYuNzggNC42MyA5Ljc5IDcuNDYgMy4xIDIuOSA1Ljg1IDYuMTQgOC4yMiA5LjY5IDIuNCAzLjU4IDQuMzYgNy4zNyA1Ljg4IDExLjM0IDEuNDYgMy44NiAyLjU4IDguMDIgMy4zMyAxMi40NS43MiA0LjMzIDEuMDkgOC44IDEuMDkgMTMuMzkgMCAzLjExLS4yOCA2LjM5LS44NCA5LjgzLS41MiAzLjIyLTEuMzEgNi41LTIuMzUgOS44LS45NCAzLjA4LTIuMjEgNi4yOC0zLjc0IDkuNTVhOTIuNjQ0IDkyLjY0NCAwIDAgMS01LjEyIDkuNDNsLS4wNS4wOWMtMS45NyAzLjEzLTMuOTEgNi4wOS01LjgyIDguODQtMi4wMiAyLjktNC4yNiA1Ljk4LTYuNyA5LjItMi4xNSAyLjgzLTQuNzEgNi4wOC03LjY3IDkuNzMtMi43NyAzLjQyLTUuNjMgNi44NS04LjU3IDEwLjI2bC0zMC4zMSAzNS40Mkg1MTJ2MzcuNTFoLTE1LjQyeiIvPjwvc3ZnPg==",sc="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiB0ZXh0LXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiBpbWFnZS1yZW5kZXJpbmc9Im9wdGltaXplUXVhbGl0eSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIHZpZXdCb3g9IjAgMCA1MDQgNTEyLjM2Ij48cGF0aCBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik00OTkuNDMgMjMxLjM2SDM2OC40Yy0yLjUzIDAtNC41OC0yLjA1LTQuNTgtNC41N3YtOC4xMWMwLTEuMjYuNTItMi40IDEuMzQtMy4yMmw3MS41Ny04Mi41M2M2LjczLTcuNzUgMTIuNTctMTQuOTcgMTcuNDgtMjEuNjggNC44OC02LjY0IDguODMtMTIuNzQgMTEuODUtMTguMjggMi45Ny01LjQzIDUuMTgtMTAuNjEgNi42NC0xNS41NSAxLjQyLTQuODUgMi4xMy05LjUzIDIuMTMtMTQgMC0xNC42OC0zLjk4LTI2LjA1LTExLjkyLTM0LjA5LTMuOTItMy45Ni04Ljc1LTYuOTMtMTQuNDktOC45Mi01Ljk1LTIuMDMtMTIuOTEtMy4wNS0yMC44Ny0zLjA1LTguNDUgMC0xNS44OCAxLjIxLTIyLjI5IDMuNjItNi4yNyAyLjM2LTExLjYzIDUuOTItMTYuMDcgMTAuNjNhNDcuODg0IDQ3Ljg4NCAwIDAgMC0xMC4xNCAxNi42Yy0yLjI3IDYuMjktMy40MSAxMy4zOS0zLjQxIDIxLjI2IDAgMi41Mi0yLjA1IDQuNTctNC41NyA0LjU3aC02Ljg5Yy0yLjA1IDAtMy44LTEuMzYtNC4zNy0zLjI0bC0uMjctLjgyYy0uMTgtLjU2LS4yNS0xLjEzLS4yMi0xLjY3LS4yMy05LjMyIDEuMTQtMTcuOTkgNC4xMi0yNS45NyAzLjAyLTguMTMgNy42OC0xNS41NCAxMy45NC0yMi4xOSA2LjI2LTYuNyAxMy42My0xMS43NiAyMi4xLTE1LjEzQzQwNy44NCAxLjY4IDQxNy4yIDAgNDI3LjU1IDBjOS41OSAwIDE4LjI2IDEuMzggMjYuMDMgNC4xMyA3Ljg2IDIuNzkgMTQuNzcgNyAyMC43MiAxMi42MSA2LjAyIDUuNjMgMTAuNTUgMTIuNCAxMy41NSAyMC4yOCAyLjk2IDcuNzUgNC40NSAxNi41NiA0LjQ1IDI2LjQgMCA2LjUtMS4wNyAxMy4wOC0zLjE3IDE5LjY5bC0uMTQuMzhjLTIuMDkgNi40Ni01LjE3IDEyLjk3LTkuMiAxOS40OWwtLjE0LjIxYy00LjA4IDYuNTEtOC45IDEzLjQzLTE0LjQzIDIwLjc0LTUuNTYgNy4zMy0xMS45NiAxNS4yMy0xOS4yMiAyMy42N2wtNTYuOTEgNjYuNTFoMTEwLjM0YzIuNTIgMCA0LjU3IDIuMDUgNC41NyA0LjU3djguMTFjMCAyLjUyLTIuMDUgNC41Ny00LjU3IDQuNTd6bS0zMjcuMjUgNjguNzUgMTM3Ljk2LTE2Ny43NmMuODktMS4wNyAyLjMtMS42NSAzLjc0LTEuNjVsMjAuMTMtLjAyYzIuNTIgMCA0LjU3IDEuNzQgNC41NyAzLjg4IDAgLjkxLS4zNyAxLjc1LS45OCAyLjQxTDE4OC4zMiAzMTcuNjYgMzQ0LjEgNTA2LjI0YzEuNDUgMS43NS45NSA0LjE3LTEuMSA1LjQtLjguNDgtMS43Mi43MS0yLjYzLjcxbC0yMC4xMy4wMWMtMS43IDAtMy4xOC0uNzktMy45Ny0xLjk2bC0xNDQuMS0xNzUuMkwyOC4yMyA1MTAuNjljLS44OCAxLjA3LTIuMyAxLjY0LTMuNzMgMS42NWwtMTkuOTMuMDJjLTIuNTIgMC00LjU3LTEuNzQtNC41Ny0zLjg5IDAtLjkuMzctMS43NC45OC0yLjRsMTU1LjY1LTE4OC40TDYuOSAxMzYuOGMtMS40NS0xLjc1LS45NS00LjE4IDEuMTEtNS40MS43OS0uNDcgMS43MS0uNyAyLjYyLS43bDIwLjQ0LS4wMWMxLjYzIDAgMy4wNi43MiAzLjg3IDEuODFsMTM3LjI0IDE2Ny42MnoiLz48L3N2Zz4=",oi=1;function Ss(){return A.jsx("div",{className:"divider"})}function lc(){const[n]=et(),e=P.useRef(null),[t,r]=P.useState(!1),[i,o]=P.useState(!1),[s,l]=P.useState(!1),[a,c]=P.useState(!1),[u,f]=P.useState(!1),[d,g]=P.useState(!1),[h,m]=P.useState(!1),[_,v]=P.useState(!1),x=P.useCallback(()=>{const y=O();k(y)&&(l(y.hasFormat("bold")),c(y.hasFormat("italic")),f(y.hasFormat("underline")),g(y.hasFormat("strikethrough")),m(y.hasFormat("subscript")),v(y.hasFormat("superscript")))},[]);return P.useEffect(()=>_t(n.registerUpdateListener(({editorState:y})=>{y.read(()=>{x()})}),n.registerCommand(nn,(y,b)=>(x(),!1),oi),n.registerCommand(kt,y=>(r(y),!1),oi),n.registerCommand(Et,y=>(o(y),!1),oi)),[n,x]),A.jsxs("div",{className:"toolbar",ref:e,children:[A.jsx("button",{disabled:!t,onClick:()=>{n.dispatchCommand(on,void 0)},className:"toolbar-item spaced","aria-label":"Undo",children:A.jsx("i",{className:"format undo"})}),A.jsx("button",{disabled:!i,onClick:()=>{n.dispatchCommand(sn,void 0)},className:"toolbar-item","aria-label":"Redo",children:A.jsx("i",{className:"format redo"})}),A.jsx(Ss,{}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"bold")},className:"toolbar-item spaced "+(s?"active":""),"aria-label":"Format Bold",children:A.jsx("i",{className:"format bold"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"italic")},className:"toolbar-item spaced "+(a?"active":""),"aria-label":"Format Italics",children:A.jsx("i",{className:"format italic"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"underline")},className:"toolbar-item spaced "+(u?"active":""),"aria-label":"Format Underline",children:A.jsx("i",{className:"format underline"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"strikethrough")},className:"toolbar-item spaced "+(d?"active":""),"aria-label":"Format Strikethrough",children:A.jsx("i",{className:"format strikethrough"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"superscript")},className:"toolbar-item spaced "+(h?"active":""),"aria-label":"Format Subscript",children:A.jsx("img",{src:sc,height:16,width:16,style:{marginTop:"1px"}})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"subscript")},className:"toolbar-item spaced "+(_?"active":""),"aria-label":"Format Superscript",children:A.jsx("img",{src:oc,height:16,width:16,style:{marginTop:"5px"}})}),A.jsx(Ss,{}),A.jsx("button",{onClick:()=>{n.dispatchCommand(Mt,"left")},className:"toolbar-item spaced","aria-label":"Left Align",children:A.jsx("i",{className:"format left-align"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(Mt,"center")},className:"toolbar-item spaced","aria-label":"Center Align",children:A.jsx("i",{className:"format center-align"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(Mt,"right")},className:"toolbar-item spaced","aria-label":"Right Align",children:A.jsx("i",{className:"format right-align"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(Mt,"justify")},className:"toolbar-item","aria-label":"Justify Align",children:A.jsx("i",{className:"format justify-align"})})," "]})}function ac(){return A.jsx("div",{className:"editor-placeholder",style:{padding:"20px"},children:"Enter some rich text..."})}const cc={namespace:"React.js Demo",nodes:[],onError(n){throw n},theme:ic};function uc(){return A.jsx(na,{initialConfig:cc,children:A.jsxs("div",{className:"editor-container",children:[A.jsx(lc,{}),A.jsxs("div",{className:"editor-inner",children:[A.jsx(ec,{contentEditable:A.jsx(va,{className:"editor-input"}),placeholder:A.jsx(ac,{}),ErrorBoundary:rc}),A.jsx(La,{}),A.jsx(ra,{})]})]})})}Pe.Editor=uc,Object.defineProperty(Pe,Symbol.toStringTag,{value:"Module"})});
|
|
42
42
|
//# sourceMappingURL=index.umd.js.map
|