FileMaster
Search
Toggle Dark Mode
Home
/
.
/
wp-content
/
plugins
/
surerank
/
build
/
vendor-7d0314d1
Edit File: index.js
"use strict";(globalThis.webpackChunksurerank=globalThis.webpackChunksurerank||[]).push([[938],{12532(t,e,n){n.d(e,{x:()=>o});var r=n(94439),i=n(51609);function o({defaultSelection:t}){const[e]=(0,r.DF)();return(0,i.useEffect)(()=>{e.focus(()=>{const t=document.activeElement,n=e.getRootElement();null===n||null!==t&&n.contains(t)||n.focus({preventScroll:!0})},{defaultSelection:t})},[t,e]),null}},6246(t,e,n){n.d(e,{n:()=>u});var r=n(94439),i=n(48832),o=n(51609),s=n(74848);const l="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,c=l?o.useLayoutEffect:o.useEffect,a={tag:i.T40};function u({initialConfig:t,children:e}){const n=(0,o.useMemo)(()=>{const{theme:e,namespace:n,nodes:o,onError:s,editorState:c,html:u}=t,d=(0,r.Mx)(null,e),f=(0,i.ieJ)({editable:t.editable,html:u,namespace:n,nodes:o,onError:t=>s(t,f),theme:e});return function(t,e){if(null!==e)if(void 0===e)t.update(()=>{const e=(0,i.NiT)();if(e.isEmpty()){const n=(0,i.lJ7)();e.append(n);const r=l?document.activeElement:null;(null!==(0,i.vJq)()||null!==r&&r===t.getRootElement())&&n.select()}},a);else if(null!==e)switch(typeof e){case"string":{const n=t.parseEditorState(e);t.setEditorState(n,a);break}case"object":t.setEditorState(e,a);break;case"function":t.update(()=>{(0,i.NiT)().isEmpty()&&e(t)},a)}}(f,c),[f,d]},[]);return c(()=>{const e=t.editable,[r]=n;r.setEditable(void 0===e||e)},[]),(0,s.jsx)(r.Gu.Provider,{value:n,children:e})}},94439(t,e,n){n.d(e,{DF:()=>s,Gu:()=>i,Mx:()=>o});var r=n(51609);const i=(0,r.createContext)(null);function o(t,e){let n=null;return null!=t&&(n=t[1]),{getTheme:function(){return null!=e?e:null!=n?n.getTheme():null}}}function s(){const t=(0,r.useContext)(i);return null==t&&function(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const i of e)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),t}},60083(t,e,n){n.d(e,{a:()=>d});var r=n(94439),i=n(51609),o=n(74848),s=n(85745),l=n(73105);const c="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?i.useLayoutEffect:i.useEffect,a=(0,i.forwardRef)(function({editor:t,ariaActiveDescendant:e,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:s,ariaErrorMessage:l,ariaExpanded:a,ariaInvalid:u,ariaLabel:d,ariaLabelledBy:f,ariaMultiline:h,ariaOwns:g,ariaRequired:p,autoCapitalize:_,className:m,id:y,role:x="textbox",spellCheck:v=!0,style:C,tabIndex:S,"data-testid":b,...k},T){const[w,E]=(0,i.useState)(t.isEditable()),N=(0,i.useCallback)(e=>{t.setRootElement(e&&e.ownerDocument&&e.ownerDocument.defaultView?e:null)},[t]),M=(0,i.useMemo)(()=>function(...t){return e=>{t.forEach(t=>{"function"==typeof t?t(e):null!=t&&(t.current=e)})}}(T,N),[N,T]);return c(()=>(E(t.isEditable()),t.registerEditableListener(t=>{E(t)})),[t]),(0,o.jsx)("div",{"aria-activedescendant":w?e:void 0,"aria-autocomplete":w?n:"none","aria-controls":w?r:void 0,"aria-describedby":s,...null!=l?{"aria-errormessage":l}:{},"aria-expanded":w&&"combobox"===x?!!a:void 0,...null!=u?{"aria-invalid":u}:{},"aria-label":d,"aria-labelledby":f,"aria-multiline":h,"aria-owns":w?g:void 0,"aria-readonly":!w||void 0,"aria-required":p,autoCapitalize:_,className:m,contentEditable:w,"data-testid":b,id:y,ref:M,role:w?x:void 0,spellCheck:v,style:C,tabIndex:S,...k})});function u(t){return t.getEditorState().read((0,s.yl)(t.isComposing()))}const d=(0,i.forwardRef)(function(t,e){const{placeholder:n,...i}=t,[s]=(0,r.DF)();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(a,{editor:s,...i,ref:e}),null!=n&&(0,o.jsx)(f,{editor:s,content:n})]})});function f({content:t,editor:e}){const n=function(t){const[e,n]=(0,i.useState)(()=>u(t));return c(()=>{function e(){const e=u(t);n(e)}return e(),(0,l.Sd)(t.registerUpdateListener(()=>{e()}),t.registerEditableListener(()=>{e()}))},[t]),e}(e),[r,s]=(0,i.useState)(e.isEditable());if((0,i.useLayoutEffect)(()=>(s(e.isEditable()),e.registerEditableListener(t=>{s(t)})),[e]),!n)return null;let a=null;return"function"==typeof t?a=t(r):null!==t&&(a=t),null===a?null:(0,o.jsx)("div",{"aria-hidden":!0,children:a})}},16191(t,e,n){n.d(e,{G:()=>o});var r=n(94439),i=n(51609);function o({editorRef:t}){const[e]=(0,r.DF)();return i.useEffect(()=>{"function"==typeof t?t(e):"object"==typeof t&&(t.current=e)},[e]),null}},59798(t,e,n){n.d(e,{R:()=>c});var r=n(51609),i=n(74848);function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}var s={error:null},l=function(t){var e,n;function i(){for(var e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).state=s,e.resetErrorBoundary=function(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];null==e.props.onReset||(t=e.props).onReset.apply(t,r),e.reset()},e}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,o(e,n),i.getDerivedStateFromError=function(t){return{error:t}};var l=i.prototype;return l.reset=function(){this.setState(s)},l.componentDidCatch=function(t,e){var n,r;null==(n=(r=this.props).onError)||n.call(r,t,e)},l.componentDidUpdate=function(t,e){var n,r,i,o,s=this.props.resetKeys;null!==this.state.error&&null!==e.error&&(void 0===(i=t.resetKeys)&&(i=[]),void 0===(o=s)&&(o=[]),i.length!==o.length||i.some(function(t,e){return!Object.is(t,o[e])}))&&(null==(n=(r=this.props).onResetKeysChange)||n.call(r,t.resetKeys,s),this.reset())},l.render=function(){var t=this.state.error,e=this.props,n=e.fallbackRender,i=e.FallbackComponent,o=e.fallback;if(null!==t){var s={error:t,resetErrorBoundary:this.resetErrorBoundary};if(r.isValidElement(o))return o;if("function"==typeof n)return n(s);if(i)return r.createElement(i,s);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},i}(r.Component);function c({children:t,onError:e}){return(0,i.jsx)(l,{fallback:(0,i.jsx)("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:t})}},40290(t,e,n){n.d(e,{G:()=>c});var r=n(94439),i=n(73105),o=n(48832);function s(t){t.undoStack=[],t.redoStack=[],t.current=null}var l=n(51609);function c({delay:t,externalHistoryState:e}){const[n]=(0,r.DF)();return function(t,e,n=1e3){const r=(0,l.useMemo)(()=>e||{current:null,redoStack:[],undoStack:[]},[e]);(0,l.useEffect)(()=>function(t,e,n){const r=function(t,e){let n=Date.now(),r=0;return(i,s,l,c,a,u)=>{const d=Date.now();if(u.has(o.n0X))return r=0,n=d,2;const f=function(t,e,n,r,i){if(null===t||0===n.size&&0===r.size&&!i)return 0;const s=e._selection,l=t._selection;if(i)return 1;if(!((0,o.I2P)(s)&&(0,o.I2P)(l)&&l.isCollapsed()&&s.isCollapsed()))return 0;const c=function(t,e,n){const r=t._nodeMap,i=[];for(const o of e){const t=r.get(o);void 0!==t&&i.push(t)}for(const[s,l]of n){if(!l)continue;const t=r.get(s);void 0===t||(0,o.hVZ)(t)||i.push(t)}return i}(e,n,r);if(0===c.length)return 0;if(c.length>1){const n=e._nodeMap,r=n.get(s.anchor.key),i=n.get(l.anchor.key);return r&&i&&!t._nodeMap.has(r.__key)&&(0,o.kFe)(r)&&1===r.__text.length&&1===s.anchor.offset?2:0}const a=c[0],u=t._nodeMap.get(a.__key);if(!(0,o.kFe)(u)||!(0,o.kFe)(a)||u.__mode!==a.__mode)return 0;const d=u.__text,f=a.__text;if(d===f)return 0;const h=s.anchor,g=l.anchor;if(h.key!==g.key||"text"!==h.type)return 0;const p=h.offset,_=g.offset,m=f.length-d.length;return 1===m&&_===p-1?2:-1===m&&_===p+1?3:-1===m&&_===p?4:0}(i,s,c,a,t.isComposing()),h=(()=>{const h=null===l||l.editor===t,g=u.has(o.bMH);if(!g&&h&&u.has(o.T40))return 0;if(null===i)return 1;const p=s._selection;return c.size>0||a.size>0?!1===g&&0!==f&&f===r&&d<n+e&&h||1===c.size&&function(t,e,n){const r=e._nodeMap.get(t),i=n._nodeMap.get(t),s=e._selection,l=n._selection;return!((0,o.I2P)(s)&&(0,o.I2P)(l)&&"element"===s.anchor.type&&"element"===s.focus.type&&"text"===l.anchor.type&&"text"===l.focus.type||!(0,o.kFe)(r)||!(0,o.kFe)(i)||r.__parent!==i.__parent)&&JSON.stringify(e.read(()=>r.exportJSON()))===JSON.stringify(n.read(()=>i.exportJSON()))}(Array.from(c)[0],i,s)?0:1:null!==p?0:2})();return n=d,r=f,h}}(t,n),l=(0,i.Sd)(t.registerCommand(o.ZKf,()=>(function(t,e){const n=e.redoStack,r=e.undoStack;if(0!==r.length){const i=e.current,s=r.pop();null!==i&&(n.push(i),t.dispatchCommand(o.WWb,!0)),0===r.length&&t.dispatchCommand(o.KfJ,!1),e.current=s||null,s&&s.editor.setEditorState(s.editorState,{tag:o.n0X})}}(t,e),!0),o.jZM),t.registerCommand(o.V30,()=>(function(t,e){const n=e.redoStack;if(0!==n.length){const r=e.current;null!==r&&(e.undoStack.push(r),t.dispatchCommand(o.KfJ,!0));const i=n.pop();0===n.length&&t.dispatchCommand(o.WWb,!1),e.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:o.n0X})}}(t,e),!0),o.jZM),t.registerCommand(o.SKc,()=>(s(e),!1),o.jZM),t.registerCommand(o.t5V,()=>(s(e),t.dispatchCommand(o.WWb,!1),t.dispatchCommand(o.KfJ,!1),!0),o.jZM),t.registerUpdateListener(({editorState:n,prevEditorState:i,dirtyLeaves:s,dirtyElements:l,tags:c})=>{const a=e.current,u=e.redoStack,d=e.undoStack;if(null!==a&&n===(null===a?null:a.editorState))return;const f=r(i,n,a,s,l,c);if(1===f)0!==u.length&&(e.redoStack=[],t.dispatchCommand(o.WWb,!1)),null!==a&&(d.push({...a}),t.dispatchCommand(o.KfJ,!0));else if(2===f)return;e.current={editor:t,editorState:n}}));return l}(t,r,n),[n,t,r])}(n,e,t),null}},45838(t,e,n){n.d(e,{D:()=>l});var r=n(94439),i=n(48832),o=n(51609);const s="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect;function l({ignoreHistoryMergeTagChange:t=!0,ignoreSelectionChange:e=!1,onChange:n}){const[o]=(0,r.DF)();return s(()=>{if(n)return o.registerUpdateListener(({editorState:r,dirtyElements:s,dirtyLeaves:l,prevEditorState:c,tags:a})=>{e&&0===s.size&&0===l.size||t&&a.has(i.T40)||c.isEmpty()||n(r,o,a)})},[o,t,e,n]),null}},69923(t,e,n){n.d(e,{h:()=>T});var r=n(94439),i=n(51609);const o="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?i.useLayoutEffect:i.useEffect;function s(t){return{initialValueFn:()=>t.isEditable(),subscribe:e=>t.registerEditableListener(e)}}var l=n(85745),c=n(73105),a=n(75795),u=n(74848),d=n(48832),f=n(27639);function h(t,e,n,r=null){let i=null===r||e.isSelected(r);const o=(0,d.ff4)(e)&&e.excludeFromCopy("html");let s=e;if(null!==r){let t=(0,d.BEs)(e);t=(0,d.kFe)(t)&&null!==r?(0,f.SD)(r,t):t,s=t}const l=(0,d.ff4)(s)?s.getChildren():[],c=t._nodes.get(s.getType());let a;a=c&&void 0!==c.exportDOM?c.exportDOM(t,s):s.exportDOM(t);const{element:u,after:g}=a;if(!u)return!1;const p=document.createDocumentFragment();for(let f=0;f<l.length;f++){const n=l[f],o=h(t,n,p,r);!i&&(0,d.ff4)(e)&&o&&e.extractWithChild(n,r,"html")&&(i=!0)}if(i&&!o){if(((0,d.sby)(u)||(0,d.K8K)(u))&&u.append(p),n.append(u),g){const t=g.call(s,u);t&&((0,d.K8K)(u)?u.replaceChildren(t):u.replaceWith(t))}}else n.append(p);return i}function g(t,e){const n=t.getData("text/plain")||t.getData("text/uri-list");null!=n&&e.insertRawText(n)}new Set(["STYLE","SCRIPT"]);const p="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,_=p&&"documentMode"in document?document.documentMode:null,m=!(!p||!("InputEvent"in window)||_)&&"getTargetRanges"in new window.InputEvent("input"),y=p&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),x=p&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,v=p&&/^(?=.*Chrome).*/i.test(navigator.userAgent),C=p&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!v;function S(t,e){e.update(()=>{if(null!==t){const n=(0,c.xj)(t,KeyboardEvent)?null:t.clipboardData,r=(0,d.vJq)();if(null!==r&&null!=n){t.preventDefault();const i=function(t,e=(0,d.vJq)()){return null==e&&function(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const i of e)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(166),(0,d.I2P)(e)&&e.isCollapsed()||0===e.getNodes().length?"":function(t,e){if("undefined"==typeof document||"undefined"==typeof window&&void 0===globalThis.window)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const n=document.createElement("div"),r=(0,d.NiT)().getChildren();for(let i=0;i<r.length;i++)h(t,r[i],n,e);return n.innerHTML}(t,e)}(e);null!==i&&n.setData("text/html",i),n.setData("text/plain",r.getTextContent())}}})}const b="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?i.useLayoutEffect:i.useEffect;function k(t){return t.getEditorState().read((0,l.yl)(t.isComposing()))}function T({contentEditable:t,placeholder:e=null,ErrorBoundary:n}){const[o]=(0,r.DF)(),s=function(t,e){const[n,r]=(0,i.useState)(()=>t.getDecorators());return b(()=>t.registerDecoratorListener(t=>{(0,a.flushSync)(()=>{r(t)})}),[t]),(0,i.useEffect)(()=>{r(t.getDecorators())},[t]),(0,i.useMemo)(()=>{const r=[],o=Object.keys(n);for(let s=0;s<o.length;s++){const l=o[s],c=(0,u.jsx)(e,{onError:e=>t._onError(e),children:(0,u.jsx)(i.Suspense,{fallback:null,children:n[l]})}),d=t.getElementByKey(l);null!==d&&r.push((0,a.createPortal)(c,d,l))}return r},[e,n,t])}(o,n);return b(()=>(0,c.Sd)(function(t){return(0,c.Sd)(t.registerCommand(d.WuB,t=>{const e=(0,d.vJq)();return!!(0,d.I2P)(e)&&(e.deleteCharacter(t),!0)},d.jZM),t.registerCommand(d.hi0,t=>{const e=(0,d.vJq)();return!!(0,d.I2P)(e)&&(e.deleteWord(t),!0)},d.jZM),t.registerCommand(d.viC,t=>{const e=(0,d.vJq)();return!!(0,d.I2P)(e)&&(e.deleteLine(t),!0)},d.jZM),t.registerCommand(d.bM3,t=>{const e=(0,d.vJq)();if(!(0,d.I2P)(e))return!1;if("string"==typeof t)e.insertText(t);else{const n=t.dataTransfer;if(null!=n)g(n,e);else{const n=t.data;n&&e.insertText(n)}}return!0},d.jZM),t.registerCommand(d.$ey,()=>{const t=(0,d.vJq)();return!!(0,d.I2P)(t)&&(t.removeText(),!0)},d.jZM),t.registerCommand(d.FEN,t=>{const e=(0,d.vJq)();return!!(0,d.I2P)(e)&&(e.insertLineBreak(t),!0)},d.jZM),t.registerCommand(d.XKQ,()=>{const t=(0,d.vJq)();return!!(0,d.I2P)(t)&&(t.insertLineBreak(),!0)},d.jZM),t.registerCommand(d.AX0,t=>{const e=(0,d.vJq)();if(!(0,d.I2P)(e))return!1;const n=t,r=n.shiftKey;return!!(0,f.Cb)(e,!0)&&(n.preventDefault(),(0,f.Rk)(e,r,!0),!0)},d.jZM),t.registerCommand(d.JM3,t=>{const e=(0,d.vJq)();if(!(0,d.I2P)(e))return!1;const n=t,r=n.shiftKey;return!!(0,f.Cb)(e,!1)&&(n.preventDefault(),(0,f.Rk)(e,r,!1),!0)},d.jZM),t.registerCommand(d.gCZ,e=>{const n=(0,d.vJq)();return!!(0,d.I2P)(n)&&(!x||"ko-KR"!==navigator.language)&&(e.preventDefault(),t.dispatchCommand(d.WuB,!0))},d.jZM),t.registerCommand(d.w$Z,e=>{const n=(0,d.vJq)();return!!(0,d.I2P)(n)&&(e.preventDefault(),t.dispatchCommand(d.WuB,!1))},d.jZM),t.registerCommand(d.RTo,e=>{const n=(0,d.vJq)();if(!(0,d.I2P)(n))return!1;if(null!==e){if((x||y||C)&&m)return!1;e.preventDefault()}return t.dispatchCommand(d.FEN,!1)},d.jZM),t.registerCommand(d.HYn,()=>((0,d.e1k)(),!0),d.jZM),t.registerCommand(d.u5G,e=>{const n=(0,d.vJq)();return!!(0,d.I2P)(n)&&(S(e,t),!0)},d.jZM),t.registerCommand(d.VSO,e=>{const n=(0,d.vJq)();return!!(0,d.I2P)(n)&&(function(t,e){S(t,e),e.update(()=>{const t=(0,d.vJq)();(0,d.I2P)(t)&&t.removeText()})}(e,t),!0)},d.jZM),t.registerCommand(d.waI,e=>{const n=(0,d.vJq)();return!!(0,d.I2P)(n)&&(function(t,e){t.preventDefault(),e.update(()=>{const e=(0,d.vJq)(),n=(0,c.xj)(t,ClipboardEvent)?t.clipboardData:null;null!=n&&(0,d.I2P)(e)&&g(n,e)},{tag:d.fwY})}(e,t),!0)},d.jZM),t.registerCommand(d.Sr4,t=>{const e=(0,d.vJq)();return!!(0,d.I2P)(e)&&(t.preventDefault(),!0)},d.jZM),t.registerCommand(d.TgX,t=>{const e=(0,d.vJq)();return!!(0,d.I2P)(e)&&(t.preventDefault(),!0)},d.jZM))}(l),function(e){const n=window.location.origin,r=r=>{if(r.origin!==n)return;const i=e.getRootElement();if(document.activeElement!==i)return;const o=r.data;if("string"==typeof o){let n;try{n=JSON.parse(o)}catch(t){return}if(n&&"nuanria_messaging"===n.protocol&&"request"===n.type){const t=n.payload;if(t&&"makeChanges"===t.functionId){const n=t.args;if(n){const[t,i,o,s,l,c]=n;e.update(()=>{const e=(0,d.vJq)();if((0,d.I2P)(e)){const n=e.anchor;let c=n.getNode(),a=0,u=0;if((0,d.kFe)(c)&&t>=0&&i>=0&&(a=t,u=t+i,e.setTextNodeRange(c,a,c,u)),a===u&&""===o||(e.insertRawText(o),c=n.getNode()),(0,d.kFe)(c)){a=s,u=s+l;const t=c.getTextContentSize();a=a>t?t:a,u=u>t?t:u,e.setTextNodeRange(c,a,c,u)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",r,!0),()=>{window.removeEventListener("message",r,!0)}}(l)),[l=o]),(0,u.jsxs)(u.Fragment,{children:[t,(0,u.jsx)(w,{content:e}),s]});var l}function w({content:t}){const[e]=(0,r.DF)(),n=function(t){const[e,n]=(0,i.useState)(()=>k(t));return b(()=>{function e(){const e=k(t);n(e)}return e(),(0,c.Sd)(t.registerUpdateListener(()=>{e()}),t.registerEditableListener(()=>{e()}))},[t]),e}(e),l=function(t){const[e]=(0,r.DF)(),n=(0,i.useMemo)(()=>t(e),[e,t]),[s,l]=(0,i.useState)(()=>n.initialValueFn()),c=(0,i.useRef)(s);return o(()=>{const{initialValueFn:t,subscribe:e}=n,r=t();return c.current!==r&&(c.current=r,l(r)),e(t=>{c.current=t,l(t)})},[n,t]),s}(s);return n?"function"==typeof t?t(l):t:null}},95591(t,e,n){n.d(e,{QP:()=>m});var r=n(94439),i=n(48832),o=n(51609),s=n(73105),l=n(74848);const c="startTransition",a="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,u=a?o.useLayoutEffect:o.useEffect,d=t=>{const e=document.getElementById("typeahead-menu");if(!e)return;const n=e.getBoundingClientRect();n.top+n.height>window.innerHeight&&e.scrollIntoView({block:"center"}),n.top<0&&e.scrollIntoView({block:"center"}),t.scrollIntoView({block:"nearest"})};function f(t,e){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top>r.top&&n.top<r.bottom}function h(t,e,n,i){const[s]=(0,r.DF)();(0,o.useEffect)(()=>{if(null!=e&&null!=t){const t=s.getRootElement(),r=null!=t?function(t){let e=getComputedStyle(t);const n="absolute"===e.position,r=/(auto|scroll)/;if("fixed"===e.position)return document.body;for(let i=t;i=i.parentElement;)if(e=getComputedStyle(i),(!n||"static"!==e.position)&&r.test(e.overflow+e.overflowY+e.overflowX))return i;return document.body}(t):document.body;let o=!1,l=f(e,r);const c=function(){o||(window.requestAnimationFrame(function(){n(),o=!1}),o=!0);const t=f(e,r);t!==l&&(l=t,null!=i&&i(t))},a=new ResizeObserver(n);return window.addEventListener("resize",n),document.addEventListener("scroll",c,{capture:!0,passive:!0}),a.observe(e),()=>{a.unobserve(e),window.removeEventListener("resize",n),document.removeEventListener("scroll",c,!0)}}},[e,s,i,n,t])}const g=(0,i.guI)("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");function p({close:t,editor:e,anchorElementRef:n,resolution:r,options:l,menuRenderFn:c,onSelectOption:a,shouldSplitNodeWithQuery:f=!1,commandPriority:h=i.AcJ,preselectFirstItem:p=!0}){const[_,m]=(0,o.useState)(null);(0,o.useEffect)(()=>{p&&m(0)},[r.match&&r.match.matchingString,p]);const y=(0,o.useCallback)(n=>{e.update(()=>{const e=null!=r.match&&f?function(t){const e=(0,i.vJq)();if(!(0,i.I2P)(e)||!e.isCollapsed())return null;const n=e.anchor;if("text"!==n.type)return null;const r=n.getNode();if(!r.isSimpleText())return null;const o=n.offset,s=o-function(t,e,n){let r=n;for(let i=r;i<=e.length;i++)t.slice(-i)===e.substring(0,i)&&(r=i);return r}(r.getTextContent().slice(0,o),t.matchingString,t.replaceableString.length);if(s<0)return null;let l;return 0===s?[l]=r.splitText(o):[,l]=r.splitText(s,o),l}(r.match):null;a(n,e,t,r.match?r.match.matchingString:"")})},[e,f,r.match,a,t]),x=(0,o.useCallback)(t=>{const n=e.getRootElement();null!==n&&(n.setAttribute("aria-activedescendant","typeahead-item-"+t),m(t))},[e]);return(0,o.useEffect)(()=>()=>{const t=e.getRootElement();null!==t&&t.removeAttribute("aria-activedescendant")},[e]),u(()=>{null===l?m(null):null===_&&p&&x(0)},[l,_,x,p]),(0,o.useEffect)(()=>(0,s.Sd)(e.registerCommand(g,({option:t})=>!(!t.ref||null==t.ref.current)&&(d(t.ref.current),!0),h)),[e,x,h]),(0,o.useEffect)(()=>(0,s.Sd)(e.registerCommand(i.bbF,t=>{const n=t;if(null!==l&&l.length){const t=null===_?0:_!==l.length-1?_+1:0;x(t);const r=l[t];null!=r.ref&&r.ref.current&&e.dispatchCommand(g,{index:t,option:r}),n.preventDefault(),n.stopImmediatePropagation()}return!0},h),e.registerCommand(i.UDz,t=>{const e=t;if(null!==l&&l.length){const t=null===_?l.length-1:0!==_?_-1:l.length-1;x(t);const n=l[t];null!=n.ref&&n.ref.current&&d(n.ref.current),e.preventDefault(),e.stopImmediatePropagation()}return!0},h),e.registerCommand(i.Q$N,e=>{const n=e;return n.preventDefault(),n.stopImmediatePropagation(),t(),!0},h),e.registerCommand(i.OXk,t=>{const e=t;return null!==l&&null!==_&&null!=l[_]&&(e.preventDefault(),e.stopImmediatePropagation(),y(l[_]),!0)},h),e.registerCommand(i.RTo,t=>null!==l&&null!==_&&null!=l[_]&&(null!==t&&(t.preventDefault(),t.stopImmediatePropagation()),y(l[_]),!0),h)),[y,t,e,l,_,x,h]),c(n,(0,o.useMemo)(()=>({options:l,selectOptionAndCleanUp:y,selectedIndex:_,setHighlightedIndex:m}),[y,_,l]),r.match?r.match.matchingString:"")}function _(t,e){null!=e&&(t.className=e),t.setAttribute("aria-label","Typeahead menu"),t.setAttribute("role","listbox"),t.style.display="block",t.style.position="absolute"}function m({options:t,onQueryChange:e,onSelectOption:n,onOpen:s,onClose:u,menuRenderFn:d,triggerFn:f,anchorClassName:g,commandPriority:m=i.AcJ,parent:y,preselectFirstItem:x=!0,ignoreEntityBoundary:v=!1}){const[C]=(0,r.DF)(),[S,b]=(0,o.useState)(null),k=function(t,e,n,i=(a?document.body:void 0),s=!0){const[l]=(0,r.DF)(),c=(0,o.useRef)(a?document.createElement("div"):null),u=(0,o.useCallback)(()=>{if(null===c.current||void 0===i)return;c.current.style.top=c.current.style.bottom;const e=l.getRootElement(),r=c.current,o=r.firstChild;if(null!==e&&null!==t){const{left:l,top:a,width:u,height:d}=t.getRect();if(r.style.top=`${a+c.current.offsetHeight+3+(s?window.pageYOffset:0)}px`,r.style.left=`${l+window.pageXOffset}px`,r.style.height=`${d}px`,r.style.width=`${u}px`,null!==o){o.style.top=`${a}`;const t=o.getBoundingClientRect(),n=t.height,i=t.width,c=e.getBoundingClientRect();l+i>c.right&&(r.style.left=`${c.right-i+window.pageXOffset}px`),(a+n>window.innerHeight||a+n>c.bottom)&&a-c.top>n+d&&(r.style.top=`${a-n-d+(s?window.pageYOffset:0)}px`)}r.isConnected||(_(r,n),i.append(r)),r.setAttribute("id","typeahead-menu"),c.current=r,e.setAttribute("aria-controls","typeahead-menu")}},[l,t,s,n,i]);(0,o.useEffect)(()=>{const e=l.getRootElement();return null!==t&&u(),()=>{null!==e&&e.removeAttribute("aria-controls");const t=c.current;null!==t&&t.isConnected&&(t.remove(),t.removeAttribute("id"))}},[l,u,t]);const d=(0,o.useCallback)(n=>{null!==t&&(n||e(null))},[t,e]);h(t,c.current,u,d);const f=c.current;return null!=f&&(_(f,n),null!=i&&i.append(f)),c}(S,b,g,y),T=(0,o.useCallback)(()=>{b(null),null!=u&&null!==S&&u()},[u,S]),w=(0,o.useCallback)(t=>{b(t),null!=s&&null===S&&s(t)},[s,S]);return(0,o.useEffect)(()=>{const t=C.registerUpdateListener(()=>{C.getEditorState().read(()=>{if(!C.isEditable())return void T();const t=C._window||window,n=t.document.createRange(),r=(0,i.vJq)(),s=function(t){let e=null;return t.getEditorState().read(()=>{const t=(0,i.vJq)();(0,i.I2P)(t)&&(e=function(t){const e=t.anchor;if("text"!==e.type)return null;const n=e.getNode();if(!n.isSimpleText())return null;const r=e.offset;return n.getTextContent().slice(0,r)}(t))}),e}(C);if(!(0,i.I2P)(r)||!r.isCollapsed()||null===s||null===n)return void T();const l=f(s,C);if(e(l?l.matchingString:null),null!==l&&(v||!function(t,e){return 0===e&&t.getEditorState().read(()=>{const t=(0,i.vJq)();if((0,i.I2P)(t)){const e=t.anchor.getNode().getPreviousSibling();return(0,i.kFe)(e)&&e.isTextEntity()}return!1})}(C,l.leadOffset))){const e=function(t,e,n){const r=(0,i.peL)(n);if(null===r||!r.isCollapsed)return!1;const o=r.anchorNode,s=t,l=r.anchorOffset;if(null==o||null==l)return!1;try{e.setStart(o,s),e.setEnd(o,l)}catch(t){return!1}return!0}(l.leadOffset,n,t);if(null!==e)return a=()=>w({getRect:()=>n.getBoundingClientRect(),match:l}),void(c in o?o[c](a):a())}var a;T()})});return()=>{t()}},[C,f,e,S,T,w,v]),(0,o.useEffect)(()=>C.registerEditableListener(t=>{t||T()}),[C,T]),null===S||null===C||null===k.current?null:(0,l.jsx)(p,{close:T,resolution:S,editor:C,anchorElementRef:k,options:t,menuRenderFn:d,shouldSplitNodeWithQuery:!0,onSelectOption:n,commandPriority:m,preselectFirstItem:x})}(0,i.guI)("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND")},27639(t,e,n){n.d(e,{Cb:()=>l,Rk:()=>c,SD:()=>i,_A:()=>o});var r=n(48832);function i(t,e){const n=t.getStartEndPoints();if(e.isSelected(t)&&!e.isSegmented()&&!e.isToken()&&null!==n){const[i,o]=n,s=t.isBackward(),l=i.getNode(),c=o.getNode(),a=e.is(l),u=e.is(c);if(a||u){const[n,i]=(0,r.Cku)(t),o=l.is(c),a=e.is(s?c:l),u=e.is(s?l:c);let d,f=0;return o?(f=n>i?i:n,d=n>i?n:i):a?(f=s?i:n,d=void 0):u&&(f=0,d=s?n:i),e.__text=e.__text.slice(f,d),e}}return e}function o(t,e,n){let i=e.getNode(),o=n;if((0,r.ff4)(i)){const t=i.getDescendantByIndex(e.offset);null!==t&&(i=t)}for(;o>0&&null!==i;){if((0,r.ff4)(i)){const t=i.getLastDescendant();null!==t&&(i=t)}let n=i.getPreviousSibling(),s=0;if(null===n){let t=i.getParentOrThrow(),e=t.getPreviousSibling();for(;null===e;){if(t=t.getParent(),null===t){n=null;break}e=t.getPreviousSibling()}null!==t&&(s=t.isInline()?0:2,n=e)}let l=i.getTextContent();""===l&&(0,r.ff4)(i)&&!i.isInline()&&(l="\n\n");const c=l.length;if(!(0,r.kFe)(i)||o>=c){const t=i.getParent();i.remove(),null==t||0!==t.getChildrenSize()||(0,r.hVZ)(t)||t.remove(),o-=c+s,i=n}else{const n=i.getKey(),s=t.getEditorState().read(()=>{const t=(0,r.nsf)(n);return(0,r.kFe)(t)&&t.isSimpleText()?t.getTextContent():null}),a=c-o,u=l.slice(0,a);if(null!==s&&s!==l){const t=(0,r.S1w)();let e=i;if(i.isSimpleText())i.setTextContent(s);else{const t=(0,r.sTu)(s);i.replace(t),e=t}if((0,r.I2P)(t)&&t.isCollapsed()){const n=t.anchor.offset;e.select(n,n)}}else if(i.isSimpleText()){const t=e.key===n;let r=e.offset;r<o&&(r=c);const s=t?r-o:0,l=t?r:a;if(t&&0===s){const[t]=i.splitText(s,l);t.remove()}else{const[,t]=i.splitText(s,l);t.remove()}}else{const t=(0,r.sTu)(u);i.replace(t)}o=0}}}function s(t){const e=t.anchor.getNode(),n=(0,r.hVZ)(e)?e:e.getParentOrThrow(),i=(0,r.i0_)().getElementByKey(n.getKey());if(null===i)return!1;const o=i.ownerDocument.defaultView;return null!==o&&"vertical-rl"===o.getComputedStyle(i).writingMode}function l(t,e){const n=s(t)?!e:e,i=(0,r.Ave)(t.focus,n?"previous":"next");if((0,r.pGK)(i))return!1;for(const o of(0,r.mWO)(i)){if((0,r.cmH)(o))return!o.origin.isInline();if(!(0,r.ff4)(o.origin)){if((0,r.Cyw)(o.origin))return!0;break}}return!1}function c(t,e,n){const i=function(t){const e=t.anchor.getNode();return"rtl"===((0,r.hVZ)(e)?e:e.getParentOrThrow()).getDirection()}(t);let o;o=s(t)||i?!n:n,function(t,e,n){t.modify(e?"extend":"move",n,"character")}(t,e,o)}new Map},85745(t,e,n){n.d(e,{yl:()=>i});var r=n(48832);function i(t){return()=>function(t){if(!function(t,e=!0){if(t)return!1;let n=(0,r.NiT)().getTextContent();return e&&(n=n.trim()),""===n}(t,!1))return!1;const e=(0,r.NiT)().getChildren(),n=e.length;if(n>1)return!1;for(let i=0;i<n;i++){const t=e[i];if((0,r.Cyw)(t))return!1;if((0,r.ff4)(t)){if(!(0,r.bSg)(t))return!1;if(0!==t.__indent)return!1;const e=t.getChildren(),n=e.length;for(let t=0;t<n;t++)if(!(0,r.kFe)(e[i]))return!1}}return!0}(t)}},73105(t,e,n){n.d(e,{Sd:()=>s,Xq:()=>l,xj:()=>c});var r=n(48832);const i="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,o=i&&"documentMode"in document?document.documentMode:null;function s(...t){return()=>{for(let e=t.length-1;e>=0;e--)t[e]();t.length=0}}function l(t,e){const n=new Map,i=t._pendingEditorState;for(const[s,l]of e._nodeMap)n.set(s,(0,r.BEs)(l));i&&(i._nodeMap=n),t._dirtyType=2;const o=e._selection;(0,r.n1P)(null===o?null:o.clone())}function c(t,e){return null!==t&&Object.getPrototypeOf(t).constructor.name===e.name}i&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),i&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),!(!i||!("InputEvent"in window)||o)&&new window.InputEvent("input"),i&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),i&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window,i&&/Android/.test(navigator.userAgent),i&&/^(?=.*Chrome).*/i.test(navigator.userAgent),i&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)},48832(t,e,n){function r(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const i of e)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}n.d(e,{$7r:()=>Ce,$ey:()=>qt,AX0:()=>te,AcJ:()=>Yr,Ave:()=>Zo,BEs:()=>_o,Cku:()=>Ln,Cyw:()=>Or,FEN:()=>Wt,HYn:()=>_e,I2P:()=>An,JM3:()=>Gt,K8K:()=>so,KfJ:()=>ve,Kp7:()=>Mr,NiT:()=>Si,OXk:()=>ae,Q$N:()=>le,R18:()=>Xt,RTo:()=>ie,S1w:()=>$n,SKc:()=>me,Sr4:()=>ue,T40:()=>Br,TgX:()=>de,UDz:()=>ne,V30:()=>Yt,VSO:()=>pe,WWb:()=>xe,WuB:()=>zt,XKQ:()=>Jt,ZKf:()=>Ht,bM3:()=>jt,bMH:()=>Kr,bSg:()=>Zr,bbF:()=>re,cmH:()=>No,e1k:()=>Bi,ff4:()=>Er,fwY:()=>zr,gCZ:()=>se,guI:()=>Rt,hVZ:()=>Pr,haT:()=>Ar,hi0:()=>Ut,i0_:()=>fo,ieJ:()=>Gr,jZM:()=>Hr,kFe:()=>Sn,lJ7:()=>$r,mWO:()=>zo,n0X:()=>Rr,n1P:()=>ki,nsf:()=>_i,pGK:()=>rs,peL:()=>ro,sTu:()=>Cn,sby:()=>io,t5V:()=>ye,u5G:()=>ge,vJq:()=>Un,viC:()=>$t,w$Z:()=>ce,waI:()=>Vt});const i="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,o=i&&"documentMode"in document?document.documentMode:null,s=i&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),l=i&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),c=!(!i||!("InputEvent"in window)||o)&&"getTargetRanges"in new window.InputEvent("input"),a=i&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),u=i&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,d=i&&/Android/.test(navigator.userAgent),f=i&&/^(?=.*Chrome).*/i.test(navigator.userAgent),h=i&&d&&f,g=i&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!f;function p(...t){const e=[];for(const n of t)if(n&&"string"==typeof n)for(const[t]of n.matchAll(/\S+/g))e.push(t);return e}const _=0,m=1,y=2,x=1,v=2,C=3,S=4,b=5,k=6,T=a||u||g?"\xa0":"\u200b",w="\n\n",E=l?"\xa0":T,N="\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc",M="A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff",O=new RegExp("^[^"+M+"]*["+N+"]"),A=new RegExp("^[^"+N+"]*["+M+"]"),P={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},D={directionless:1,unmergeable:2},F={center:2,end:6,justify:4,left:1,right:3,start:5},L={[v]:"center",[k]:"end",[S]:"justify",[x]:"left",[C]:"right",[b]:"start"},I={normal:0,segmented:2,token:1},R={[_]:"normal",[y]:"segmented",[m]:"token"},K="$";function B(t,e,n,r,i,o){let s=t.getFirstChild();for(;null!==s;){const t=s.__key;s.__parent===e&&(Er(s)&&B(s,t,n,r,i,o),n.has(t)||o.delete(t),i.push(t)),s=s.getNextSibling()}}let z=!1,W=0;function J(t){W=t.timeStamp}function j(t,e,n){const r="BR"===t.nodeName,i=e.__lexicalLineBreak;return i&&(t===i||r&&t.previousSibling===i)||r&&void 0!==yi(t,n)}function V(t,e,n){const r=ro(Xi(n));let i=null,o=null;null!==r&&r.anchorNode===t&&(i=r.anchorOffset,o=r.focusOffset);const s=t.nodeValue;null!==s&&Pi(e,s,i,o,!1)}function q(t,e,n){if(An(t)){const e=t.anchor.getNode();if(e.is(n)&&t.format!==e.getFormat())return!1}return ai(e)&&n.isAttached()}function U(t,e,n,r){for(let i=t;i&&!mo(i);i=$i(i)){const t=yi(i,e);if(void 0!==t){const e=_i(t,n);if(e)return Or(e)||!io(i)?void 0:[i,e]}else if(i===r)return[r,bi(n)]}}function $(t,e,n){z=!0;const r=performance.now()-W>100;try{br(t,()=>{const i=Un()||function(t){return t.getEditorState().read(()=>{const t=Un();return null!==t?t.clone():null})}(t),o=new Map,s=t.getRootElement(),c=t._editorState,a=t._blockCursorElement;let u=!1,d="";for(let n=0;n<e.length;n++){const f=e[n],h=f.type,g=f.target,p=U(g,t,c,s);if(!p)continue;const[_,m]=p;if("characterData"===h)r&&Sn(m)&&ai(g)&&q(i,g,m)&&V(g,m,t);else if("childList"===h){u=!0;const e=f.addedNodes;for(let i=0;i<e.length;i++){const n=e[i],r=mi(n),o=n.parentNode;if(null!=o&&n!==a&&null===r&&!j(n,o,t)){if(l){const t=(io(n)?n.innerText:null)||n.nodeValue;t&&(d+=t)}o.removeChild(n)}}const n=f.removedNodes,r=n.length;if(r>0){let e=0;for(let i=0;i<r;i++){const r=n[i];(j(r,g,t)||a===r)&&(g.appendChild(r),e++)}r!==e&&o.set(_,m)}}}if(o.size>0)for(const[e,n]of o)n.reconcileObservedMutation(e,t);const f=n.takeRecords();if(f.length>0){for(let e=0;e<f.length;e++){const n=f[e],r=n.addedNodes,i=n.target;for(let e=0;e<r.length;e++){const n=r[e],o=n.parentNode;null==o||"BR"!==n.nodeName||j(n,i,t)||o.removeChild(n)}}n.takeRecords()}null!==i&&(u&&ki(i),l&&ji(t)&&i.insertRawText(d))})}finally{z=!1}}function Z(t){const e=t._observer;null!==e&&$(t,e.takeRecords(),e)}function H(t){!function(t){0===W&&Xi(t).addEventListener("textInput",J,!0)}(t),t._observer=new MutationObserver((e,n)=>{$(t,e,n)})}class Y{constructor(t,e=new Map,n=void 0,r=new Map,i=void 0){this.node=t,this.sharedConfigMap=e,this.unknownState=n,this.knownState=r;const o=void 0!==i?i:function(t,e,n){let r=n.size;if(e)for(const i in e){const e=t.get(i);e&&n.has(e)||r++}return r}(e,n,r);this.size=o}getValue(t){const e=this.knownState.get(t);if(void 0!==e)return e;this.sharedConfigMap.set(t.key,t);let n=t.defaultValue;if(this.unknownState&&t.key in this.unknownState){const e=this.unknownState[t.key];void 0!==e&&(n=t.parse(e)),this.updateFromKnown(t,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const t={...this.unknownState};for(const[e,n]of this.knownState)e.isEqual(n,e.defaultValue)?delete t[e.key]:t[e.key]=e.unparse(n);return X(t)?{[K]:t}:{}}getWritable(t){if(this.node===t)return this;const e=new Map(this.knownState),n=X(r=this.unknownState)&&{...r};var r;if(n)for(const i of e.keys())delete n[i.key];return new Y(t,this.sharedConfigMap,X(n),e,this.size)}updateFromKnown(t,e){const n=t.key;this.sharedConfigMap.set(n,t);const{knownState:r,unknownState:i}=this;r.has(t)||i&&n in i||this.size++,r.set(t,e)}updateFromUnknown(t,e){const n=this.sharedConfigMap.get(t);n?this.updateFromKnown(n,n.parse(e)):(this.unknownState=this.unknownState||{},t in this.unknownState||this.size++,this.unknownState[t]=e)}updateFromJSON(t){const{knownState:e}=this;for(const n of e.keys())e.set(n,n.defaultValue);if(this.size=e.size,this.unknownState={},t)for(const[n,r]of Object.entries(t))this.updateFromUnknown(n,r);this.unknownState=X(this.unknownState)}}function X(t){if(t)for(const e in t)return t}function G(t,e){const n=t.__mode,r=t.__format,i=t.__style,o=t.__state,s=e.__state;return(null===n||n===e.__mode)&&(null===r||r===e.__format)&&(null===i||i===e.__style)&&(null===t.__state||o===s||function(t,e){if(t===e)return!0;if(t&&e&&t.size!==e.size)return!1;const n=new Set,r=(t,e)=>{for(const[r,i]of t.knownState){if(n.has(r.key))continue;n.add(r.key);const t=e?e.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1},i=(t,e)=>{const{unknownState:r}=t,i=e?e.unknownState:void 0;if(r)for(const[o,s]of Object.entries(r))if(!n.has(o)&&(n.add(o),s!==(i?i[o]:void 0)))return!0;return!1};return!(t&&r(t,e)||e&&r(e,t)||t&&i(t,e)||e&&i(e,t))}(o,s))}function Q(t,e){const n=t.mergeWithSibling(e),r=fr()._normalizedNodes;return r.add(t.__key),r.add(e.__key),n}function tt(t){let e,n,r=t;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(e=r.getPreviousSibling())&&Sn(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(""!==e.__text){if(G(e,r)){r=Q(e,r);break}break}e.remove()}for(;null!==(n=r.getNextSibling())&&Sn(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(G(r,n)){r=Q(r,n);break}break}n.remove()}}else r.remove()}function et(t){return nt(t.anchor),nt(t.focus),t}function nt(t){for(;"element"===t.type;){const e=t.getNode(),n=t.offset;let r,i;if(n===e.getChildrenSize()?(r=e.getChildAtIndex(n-1),i=!0):(r=e.getChildAtIndex(n),i=!1),Sn(r)){t.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!Er(r))break;t.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}let rt,it,ot,st,lt,ct,at,ut,dt,ft,ht="",gt="",pt=null,_t="",mt="",yt=!1,xt=!1,vt=null;function Ct(t,e){const n=at.get(t);if(null!==e){const n=It(t);n.parentNode===e&&e.removeChild(n)}if(ut.has(t)||it._keyToDOMMap.delete(t),Er(n)){const t=Pt(n,at);St(t,0,t.length-1,null)}void 0!==n&&Wi(ft,ot,st,n,"destroyed")}function St(t,e,n,r){let i=e;for(;i<=n;++i){const e=t[i];void 0!==e&&Ct(e,r)}}function bt(t,e){t.setProperty("text-align",e)}function kt(t,e){const n=rt.theme.indent;if("string"==typeof n){const r=t.classList.contains(n);e>0&&!r?t.classList.add(n):e<1&&r&&t.classList.remove(n)}const r=getComputedStyle(t).getPropertyValue("--lexical-indent-base-value")||"40px";t.style.setProperty("padding-inline-start",0===e?"":`calc(${e} * ${r})`)}function Tt(t,e){const n=t.style;0===e?bt(n,""):1===e?bt(n,"left"):2===e?bt(n,"center"):3===e?bt(n,"right"):4===e?bt(n,"justify"):5===e?bt(n,"start"):6===e&&bt(n,"end")}function wt(t,e){const n=ut.get(t);void 0===n&&r(60);const i=n.createDOM(rt,it);if(function(t,e,n){const r=n._keyToDOMMap;(function(t,e,n){t[`__lexicalKey_${e._key}`]=n})(e,n,t),r.set(t,e)}(t,i,it),Sn(n)?i.setAttribute("data-lexical-text","true"):Or(n)&&i.setAttribute("data-lexical-decorator","true"),Er(n)){const t=n.__indent,e=n.__size;if(0!==t&&kt(i,t),0!==e){const t=e-1;!function(t,e,n,r){const i=gt;gt="",Et(t,n,0,e,n.getDOMSlot(r)),Ot(n,r),gt=i}(Pt(n,ut),t,n,i)}const r=n.__format;0!==r&&Tt(i,r),n.isInline()||Mt(null,n,i),qi(n)&&(ht+=w,mt+=w)}else{const e=n.getTextContent();if(Or(n)){const e=n.decorate(it,rt);null!==e&&Ft(t,e),i.contentEditable="false"}else Sn(n)&&(n.isDirectionless()||(gt+=e));ht+=e,mt+=e}return null!==e&&e.insertChild(i),Wi(ft,ot,st,n,"created"),i}function Et(t,e,n,r,i){const o=ht;ht="";let s=n;for(;s<=r;++s){wt(t[s],i);const e=ut.get(t[s]);null!==e&&Sn(e)&&(null===pt&&(pt=e.getFormat()),""===_t&&(_t=e.getStyle()))}qi(e)&&(ht+=w),i.element.__lexicalTextContent=ht,ht=o+ht}function Nt(t,e){if(t){const n=t.__last;if(n){const t=e.get(n);if(t)return rn(t)?"line-break":Or(t)&&t.isInline()?"decorator":null}return"empty"}return null}function Mt(t,e,n){const r=Nt(t,at),i=Nt(e,ut);r!==i&&e.getDOMSlot(n).setManagedLineBreak(i)}function Ot(t,e){const n=e.__lexicalDir||"";if((e.__lexicalDirTextContent||"")!==gt||n!==vt){const r=""===gt,i=r?vt:function(t){return O.test(t)?"rtl":A.test(t)?"ltr":null}(gt);if(i!==n){const o=e.classList,s=rt.theme;let l=null!==n?s[n]:void 0,c=null!==i?s[i]:void 0;if(void 0!==l){if("string"==typeof l){const t=p(l);l=s[n]=t}o.remove(...l)}if(null===i||r&&"ltr"===i)e.removeAttribute("dir");else{if(void 0!==c){if("string"==typeof c){const t=p(c);c=s[i]=t}void 0!==c&&o.add(...c)}e.dir=i}xt||(t.getWritable().__dir=i)}vt=i,e.__lexicalDirTextContent=gt,e.__lexicalDir=i}}function At(t,e,n){const i=gt;var o;gt="",pt=null,_t="",function(t,e,n){const i=ht,o=t.__size,s=e.__size;ht="";const l=n.element;if(1===o&&1===s){const n=t.__first,r=e.__first;if(n===r)Dt(n,l);else{const t=It(n),e=wt(r,null);try{l.replaceChild(e,t)}catch(i){if("object"==typeof i&&null!=i){const o=`${i.toString()} Parent: ${l.tagName}, new child: {tag: ${e.tagName} key: ${r}}, old child: {tag: ${t.tagName}, key: ${n}}.`;throw new Error(o)}throw i}Ct(n,null)}const o=ut.get(r);Sn(o)&&(null===pt&&(pt=o.getFormat()),""===_t&&(_t=o.getStyle()))}else{const i=Pt(t,at),c=Pt(e,ut);if(i.length!==o&&r(227),c.length!==s&&r(228),0===o)0!==s&&Et(c,e,0,s-1,n);else if(0===s){if(0!==o){const t=null==n.after&&null==n.before&&null==n.element.__lexicalLineBreak;St(i,0,o-1,t?null:l),t&&(l.textContent="")}}else!function(t,e,n,r,i,o){const s=r-1,l=i-1;let c,a,u=o.getFirstChild(),d=0,f=0;for(;d<=s&&f<=l;){const t=e[d],r=n[f];if(t===r)u=Lt(Dt(r,o.element)),d++,f++;else{void 0===c&&(c=new Set(e)),void 0===a&&(a=new Set(n));const i=a.has(t),s=c.has(r);if(i)if(s){const t=Ui(it,r);t===u?u=Lt(Dt(r,o.element)):(o.withBefore(u).insertChild(t),Dt(r,o.element)),d++,f++}else wt(r,o.withBefore(u)),f++;else u=Lt(It(t)),Ct(t,o.element),d++}const i=ut.get(r);null!==i&&Sn(i)&&(null===pt&&(pt=i.getFormat()),""===_t&&(_t=i.getStyle()))}const h=d>s,g=f>l;if(h&&!g){const e=n[l+1],r=void 0===e?null:it.getElementByKey(e);Et(n,t,f,l,o.withBefore(r))}else g&&!h&&St(e,d,s,o.element)}(e,i,c,o,s,n)}qi(e)&&(ht+=w),l.__lexicalTextContent=ht,ht=i+ht}(t,e,e.getDOMSlot(n)),Ot(e,n),o=e,null==pt||pt===o.__textFormat||xt||o.setTextFormat(pt),function(t){""===_t||_t===t.__textStyle||xt||t.setTextStyle(_t)}(e),gt=i}function Pt(t,e){const n=[];let i=t.__first;for(;null!==i;){const t=e.get(i);void 0===t&&r(101),n.push(i),i=t.__next}return n}function Dt(t,e){const n=at.get(t);let i=ut.get(t);void 0!==n&&void 0!==i||r(61);const o=yt||ct.has(t)||lt.has(t),s=Ui(it,t);if(n===i&&!o){if(Er(n)){const t=s.__lexicalTextContent;void 0!==t&&(ht+=t,mt+=t);const e=s.__lexicalDirTextContent;void 0!==e&&(gt+=e)}else{const t=n.getTextContent();Sn(n)&&!n.isDirectionless()&&(gt+=t),mt+=t,ht+=t}return s}if(n!==i&&o&&Wi(ft,ot,st,i,"updated"),i.updateDOM(n,s,rt)){const n=wt(t,null);return null===e&&r(62),e.replaceChild(n,s),Ct(t,null),n}if(Er(n)&&Er(i)){const t=i.__indent;t!==n.__indent&&kt(s,t);const e=i.__format;e!==n.__format&&Tt(s,e),o&&(At(n,i,s),Pr(i)||i.isInline()||Mt(n,i,s)),qi(i)&&(ht+=w,mt+=w)}else{const e=i.getTextContent();if(Or(i)){const e=i.decorate(it,rt);null!==e&&Ft(t,e)}else Sn(i)&&!i.isDirectionless()&&(gt+=e);ht+=e,mt+=e}if(!xt&&Pr(i)&&i.__cachedText!==mt){const t=i.getWritable();t.__cachedText=mt,i=t}return s}function Ft(t,e){let n=it._pendingDecorators;if(null===n){if(it._decorators[t]===e)return;n=vi(it)}n[t]=e}function Lt(t){let e=t.nextSibling;return null!==e&&e===it._blockCursorElement&&(e=e.nextSibling),e}function It(t){const e=dt.get(t);return void 0===e&&r(75,t),e}function Rt(t){return{type:t}}const Kt=Rt("SELECTION_CHANGE_COMMAND"),Bt=(Rt("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Rt("CLICK_COMMAND")),zt=Rt("DELETE_CHARACTER_COMMAND"),Wt=Rt("INSERT_LINE_BREAK_COMMAND"),Jt=Rt("INSERT_PARAGRAPH_COMMAND"),jt=Rt("CONTROLLED_TEXT_INSERTION_COMMAND"),Vt=Rt("PASTE_COMMAND"),qt=Rt("REMOVE_TEXT_COMMAND"),Ut=Rt("DELETE_WORD_COMMAND"),$t=Rt("DELETE_LINE_COMMAND"),Zt=Rt("FORMAT_TEXT_COMMAND"),Ht=Rt("UNDO_COMMAND"),Yt=Rt("REDO_COMMAND"),Xt=Rt("KEYDOWN_COMMAND"),Gt=Rt("KEY_ARROW_RIGHT_COMMAND"),Qt=Rt("MOVE_TO_END"),te=Rt("KEY_ARROW_LEFT_COMMAND"),ee=Rt("MOVE_TO_START"),ne=Rt("KEY_ARROW_UP_COMMAND"),re=Rt("KEY_ARROW_DOWN_COMMAND"),ie=Rt("KEY_ENTER_COMMAND"),oe=Rt("KEY_SPACE_COMMAND"),se=Rt("KEY_BACKSPACE_COMMAND"),le=Rt("KEY_ESCAPE_COMMAND"),ce=Rt("KEY_DELETE_COMMAND"),ae=Rt("KEY_TAB_COMMAND"),ue=(Rt("INSERT_TAB_COMMAND"),Rt("INDENT_CONTENT_COMMAND"),Rt("OUTDENT_CONTENT_COMMAND"),Rt("DROP_COMMAND")),de=(Rt("FORMAT_ELEMENT_COMMAND"),Rt("DRAGSTART_COMMAND")),fe=Rt("DRAGOVER_COMMAND"),he=Rt("DRAGEND_COMMAND"),ge=Rt("COPY_COMMAND"),pe=Rt("CUT_COMMAND"),_e=Rt("SELECT_ALL_COMMAND"),me=Rt("CLEAR_EDITOR_COMMAND"),ye=Rt("CLEAR_HISTORY_COMMAND"),xe=Rt("CAN_REDO_COMMAND"),ve=Rt("CAN_UNDO_COMMAND"),Ce=Rt("FOCUS_COMMAND"),Se=Rt("BLUR_COMMAND"),be=Rt("KEY_MODIFIER_COMMAND"),ke=Object.freeze({}),Te=[["keydown",function(t,e){if(we=t.timeStamp,Ee=t.key,!e.isComposing()&&!Vi(e,Xt,t)&&null!=t.key){if(Le&&Ri(t))return br(e,()=>{qe(e,Ie)}),Le=!1,void(Ie="");if(function(t){return Fi(t,"ArrowRight",{shiftKey:"any"})}(t))Vi(e,Gt,t);else if(function(t){return Fi(t,"ArrowRight",Li)}(t))Vi(e,Qt,t);else if(function(t){return Fi(t,"ArrowLeft",{shiftKey:"any"})}(t))Vi(e,te,t);else if(function(t){return Fi(t,"ArrowLeft",Li)}(t))Vi(e,ee,t);else if(function(t){return Fi(t,"ArrowUp",{altKey:"any",shiftKey:"any"})}(t))Vi(e,ne,t);else if(function(t){return Fi(t,"ArrowDown",{altKey:"any",shiftKey:"any"})}(t))Vi(e,re,t);else if(function(t){return Fi(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})}(t))De=!0,Vi(e,ie,t);else if(function(t){return" "===t.key}(t))Vi(e,oe,t);else if(function(t){return s&&Fi(t,"o",{ctrlKey:!0})}(t))t.preventDefault(),De=!0,Vi(e,Wt,!0);else if(function(t){return Fi(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})}(t))De=!1,Vi(e,ie,t);else if(function(t){return Fi(t,"Backspace",{shiftKey:"any"})||s&&Fi(t,"h",{ctrlKey:!0})}(t))Ri(t)?Vi(e,se,t):(t.preventDefault(),Vi(e,zt,!0));else if(function(t){return"Escape"===t.key}(t))Vi(e,le,t);else if(function(t){return Fi(t,"Delete",{})||s&&Fi(t,"d",{ctrlKey:!0})}(t))!function(t){return"Delete"===t.key}(t)?(t.preventDefault(),Vi(e,zt,!1)):Vi(e,ce,t);else if(function(t){return Fi(t,"Backspace",Ii)}(t))t.preventDefault(),Vi(e,Ut,!0);else if(function(t){return Fi(t,"Delete",Ii)}(t))t.preventDefault(),Vi(e,Ut,!1);else if(function(t){return s&&Fi(t,"Backspace",{metaKey:!0})}(t))t.preventDefault(),Vi(e,$t,!0);else if(function(t){return s&&(Fi(t,"Delete",{metaKey:!0})||Fi(t,"k",{ctrlKey:!0}))}(t))t.preventDefault(),Vi(e,$t,!1);else if(function(t){return Fi(t,"b",Li)}(t))t.preventDefault(),Vi(e,Zt,"bold");else if(function(t){return Fi(t,"u",Li)}(t))t.preventDefault(),Vi(e,Zt,"underline");else if(function(t){return Fi(t,"i",Li)}(t))t.preventDefault(),Vi(e,Zt,"italic");else if(function(t){return Fi(t,"Tab",{shiftKey:"any"})}(t))Vi(e,ae,t);else if(function(t){return Fi(t,"z",Li)}(t))t.preventDefault(),Vi(e,Ht,void 0);else if(function(t){return s?Fi(t,"z",{metaKey:!0,shiftKey:!0}):Fi(t,"y",{ctrlKey:!0})||Fi(t,"z",{ctrlKey:!0,shiftKey:!0})}(t))t.preventDefault(),Vi(e,Yt,void 0);else{const n=e._editorState._selection;null===n||An(n)?!l&&Ki(t)&&(t.preventDefault(),Vi(e,_e,t)):function(t){return Fi(t,"c",Li)}(t)?(t.preventDefault(),Vi(e,ge,t)):function(t){return Fi(t,"x",Li)}(t)?(t.preventDefault(),Vi(e,pe,t)):Ki(t)&&(t.preventDefault(),Vi(e,_e,t))}(function(t){return t.ctrlKey||t.shiftKey||t.altKey||t.metaKey})(t)&&Vi(e,be,t)}}],["pointerdown",function(t,e){const n=t.target,r=t.pointerType;oo(n)&&"touch"!==r&&0===t.button&&br(e,()=>{ni(n)||(Pe=!0)})}],["compositionstart",function(t,e){br(e,()=>{const n=Un();if(An(n)&&!e.isComposing()){const r=n.anchor,i=n.anchor.getNode();gi(r.key),(t.timeStamp<we+30||"element"===r.type||!n.isCollapsed()||i.getFormat()!==n.format||Sn(i)&&i.getStyle()!==n.style)&&Vi(e,jt,E)}})}],["compositionend",function(t,e){l?Fe=!0:u||!a&&!g?br(e,()=>{qe(e,t.data)}):(Le=!0,Ie=t.data)}],["input",function(t,e){t.stopPropagation(),br(e,()=>{if(io(t.target)&&ni(t.target))return;const n=Un(),r=t.data,i=Ve(t);if(null!=r&&An(n)&&Be(n,i,r,t.timeStamp,!1)){Fe&&(qe(e,r),Fe=!1);const i=n.anchor.getNode(),o=ro(Xi(e));if(null===o)return;const s=n.isBackward(),d=s?n.anchor.offset:n.focus.offset,f=s?n.focus.offset:n.anchor.offset;c&&!n.isCollapsed()&&Sn(i)&&null!==o.anchorNode&&i.getTextContent().slice(0,d)+r+i.getTextContent().slice(d+f)===Oi(o.anchorNode)||Vi(e,jt,r);const h=r.length;l&&h>1&&"insertCompositionText"===t.inputType&&!e.isComposing()&&(n.anchor.offset-=h),a||u||g||!e.isComposing()||(we=0,gi(null))}else Ai(!1,e,null!==r?r:void 0),Fe&&(qe(e,r||void 0),Fe=!1);ar(),Z(fr())},{event:t}),Me=null}],["click",function(t,e){br(e,()=>{const n=Un(),r=ro(Xi(e)),i=$n();if(r)if(An(n)){const e=n.anchor,o=e.getNode();if("element"===e.type&&0===e.offset&&n.isCollapsed()&&!Pr(o)&&1===Si().getChildrenSize()&&o.getTopLevelElementOrThrow().isEmpty()&&null!==i&&n.is(i))r.removeAllRanges(),n.dirty=!0;else if(3===t.detail&&!n.isCollapsed()&&o!==n.focus.getNode()){const t=function(t,e){let n=t;for(;n!==Si()&&null!=n;){if(e(n))return n;n=n.getParent()}return null}(o,t=>Er(t)&&!t.isInline());Er(t)&&t.select(0)}}else if("touch"===t.pointerType){const n=r.anchorNode;(io(n)||ai(n))&&ki(qn(i,r,e,t))}Vi(e,Bt,t)})}],["cut",ke],["copy",ke],["dragstart",ke],["dragover",ke],["dragend",ke],["paste",ke],["focus",ke],["blur",ke],["drop",ke]];c&&Te.push(["beforeinput",(t,e)=>function(t,e){const n=t.inputType,i=Ve(t);"deleteCompositionText"===n||l&&ji(e)||"insertCompositionText"!==n&&br(e,()=>{const o=Un();if("deleteContentBackward"===n){if(null===o){const t=$n();if(!An(t))return;ki(t.clone())}if(An(o)){const n=o.anchor.key===o.focus.key;if("MediaLast"===Ee&&t.timeStamp<we+30&&e.isComposing()&&n){if(gi(null),we=0,setTimeout(()=>{br(e,()=>{gi(null)})},30),An(o)){const t=o.anchor.getNode();t.markDirty(),Sn(t)||r(142),je(o,t)}}else{gi(null),t.preventDefault();const r=o.anchor.getNode(),i=r.getTextContent(),s=r.canInsertTextAfter();let l=h&&n&&!(0===o.anchor.offset&&o.focus.offset===i.length)&&s;if(l&&o.isCollapsed()&&(l=!Or(function(t,e){const n=t.offset;if("element"===t.type)return Ji(t.getNode(),e,n);{const r=t.getNode();if(0===n){const t=r.getPreviousSibling();return null===t?Ji(r.getParentOrThrow(),e,r.getIndexWithinParent()+0):t}}return null}(o.anchor,!0))),!l){Vi(e,zt,!0);const t=Un();h&&An(t)&&t.isCollapsed()&&(Re=t,setTimeout(()=>Re=null))}}return}}if(!An(o))return;const s=t.data;null!==Me&&Ai(!1,e,Me),o.dirty&&null===Me||!o.isCollapsed()||Pr(o.anchor.getNode())||null===i||o.applyDOMRange(i),Me=null;const l=o.focus,c=o.anchor.getNode(),a=l.getNode();if("insertText"!==n&&"insertTranspose"!==n)switch(t.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":Vi(e,jt,t);break;case"insertFromComposition":gi(null),Vi(e,jt,t);break;case"insertLineBreak":gi(null),Vi(e,Wt,!1);break;case"insertParagraph":gi(null),De&&!u?(De=!1,Vi(e,Wt,!1)):Vi(e,Jt,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":Vi(e,Vt,t);break;case"deleteByComposition":(function(t,e){return t!==e||Er(t)||Er(e)||!t.isToken()||!e.isToken()})(c,a)&&Vi(e,qt,t);break;case"deleteByDrag":case"deleteByCut":Vi(e,qt,t);break;case"deleteContent":Vi(e,zt,!1);break;case"deleteWordBackward":Vi(e,Ut,!0);break;case"deleteWordForward":Vi(e,Ut,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":Vi(e,$t,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":Vi(e,$t,!1);break;case"formatStrikeThrough":Vi(e,Zt,"strikethrough");break;case"formatBold":Vi(e,Zt,"bold");break;case"formatItalic":Vi(e,Zt,"italic");break;case"formatUnderline":Vi(e,Zt,"underline");break;case"historyUndo":Vi(e,Ht,void 0);break;case"historyRedo":Vi(e,Yt,void 0)}else{if("\n"===s)t.preventDefault(),Vi(e,Wt,!1);else if(s===w)t.preventDefault(),Vi(e,Jt,void 0);else if(null==s&&t.dataTransfer){const e=t.dataTransfer.getData("text/plain");t.preventDefault(),o.insertRawText(e)}else null!=s&&Be(o,i,s,t.timeStamp,!0)?(t.preventDefault(),Vi(e,jt,s)):Me=s;Ne=t.timeStamp}})}(t,e)]);let we=0,Ee=null,Ne=0,Me=null;const Oe=new WeakMap;let Ae=!1,Pe=!1,De=!1,Fe=!1,Le=!1,Ie="",Re=null,Ke=[0,"",0,"root",0];function Be(t,e,n,r,i){const o=t.anchor,s=t.focus,l=o.getNode(),a=fr(),u=ro(Xi(a)),d=null!==u?u.anchorNode:null,f=o.key,h=a.getElementByKey(f),g=n.length;return f!==s.key||!Sn(l)||(!i&&(!c||Ne<r+50)||l.isDirty()&&g<2||Ei(n))&&o.offset!==s.offset&&!l.isComposing()||ci(l)||l.isDirty()&&g>1||(i||!c)&&null!==h&&!l.isComposing()&&d!==ui(h)||null!==u&&null!==e&&(!e.collapsed||e.startContainer!==u.anchorNode||e.startOffset!==u.anchorOffset)||l.getFormat()!==t.format||l.getStyle()!==t.style||function(t,e){if(e.isSegmented())return!0;if(!t.isCollapsed())return!1;const n=t.anchor.offset,r=e.getParentOrThrow(),i=e.isToken();return 0===n?!e.canInsertTextBefore()||!r.canInsertTextBefore()&&!e.isComposing()||i||function(t){const e=t.getPreviousSibling();return(Sn(e)||Er(e)&&e.isInline())&&!e.canInsertTextAfter()}(e):n===e.getTextContentSize()&&(!e.canInsertTextAfter()||!r.canInsertTextAfter()&&!e.isComposing()||i)}(t,l)}function ze(t,e){return ai(t)&&null!==t.nodeValue&&0!==e&&e!==t.nodeValue.length}function We(t,e,n){const{anchorNode:i,anchorOffset:o,focusNode:s,focusOffset:l}=t;Ae&&(Ae=!1,ze(i,o)&&ze(s,l)&&!Re)||br(e,()=>{if(!n)return void ki(null);if(!ii(e,i,s))return;let c=Un();if(Re&&An(c)&&c.isCollapsed()){const t=c.anchor,e=Re.anchor;(t.key===e.key&&t.offset===e.offset+1||1===t.offset&&e.getNode().is(t.getNode().getPreviousSibling()))&&(c=Re.clone(),ki(c))}if(Re=null,An(c)){const n=c.anchor,i=n.getNode();if(c.isCollapsed()){"Range"===t.type&&t.anchorNode===t.focusNode&&(c.dirty=!0);const o=Xi(e).event,s=o?o.timeStamp:performance.now(),[l,a,u,d,f]=Ke,h=Si(),g=!1===e.isComposing()&&""===h.getTextContent();if(s<f+200&&n.offset===u&&n.key===d)Je(c,l,a);else if("text"===n.type)Sn(i)||r(141),je(c,i);else if("element"===n.type&&!g){Er(i)||r(259);const t=n.getNode();t.isEmpty()?function(t,e){Je(t,e.getTextFormat(),e.getTextStyle())}(c,t):Je(c,0,"")}}else{const t=n.key,e=c.focus.key,r=c.getNodes(),i=r.length,s=c.isBackward(),a=s?l:o,u=s?o:l,d=s?e:t,f=s?t:e;let h=2047,g=!1;for(let n=0;n<i;n++){const t=r[n],e=t.getTextContentSize();if(Sn(t)&&0!==e&&!(0===n&&t.__key===d&&a===e||n===i-1&&t.__key===f&&0===u)&&(g=!0,h&=t.getFormat(),0===h))break}c.format=g?h:0}}Vi(e,Kt,void 0)})}function Je(t,e,n){t.format===e&&t.style===n||(t.format=e,t.style=n,t.dirty=!0)}function je(t,e){Je(t,e.getFormat(),e.getStyle())}function Ve(t){if(!t.getTargetRanges)return null;const e=t.getTargetRanges();return 0===e.length?null:e[0]}function qe(t,e){const n=t._compositionKey;if(gi(null),null!==n&&null!=e){if(""===e){const e=_i(n),r=ui(t.getElementByKey(n));return void(null!==r&&null!==r.nodeValue&&Sn(e)&&Pi(e,r.nodeValue,null,null,!0))}if("\n"===e[e.length-1]){const e=Un();if(An(e)){const n=e.focus;return e.anchor.set(n.key,n.offset,n.type),void Vi(t,ie,null)}}}Ai(!0,t,e)}function Ue(t){let e=t.__lexicalEventHandles;return void 0===e&&(e=[],t.__lexicalEventHandles=e),e}const $e=new Map;function Ze(t){const e=function(t){const e=Yi(t);return e?e.getSelection():null}(t.target);if(null===e)return;const n=si(e.anchorNode);if(null===n)return;Pe&&(Pe=!1,br(n,()=>{const r=$n(),i=e.anchorNode;(io(i)||ai(i))&&ki(qn(r,e,n,t))}));const r=Ni(n),i=r[r.length-1],o=i._key,s=$e.get(o),l=s||i;l!==n&&We(e,l,!1),We(e,n,!0),n!==i?$e.set(o,n):s&&$e.delete(o)}function He(t){t._lexicalHandled=!0}function Ye(t){return!0===t._lexicalHandled}function Xe(t){const e=t.ownerDocument,n=Oe.get(e);if(void 0===n)return;const i=n-1;i>=0||r(164),Oe.set(e,i),0===i&&e.removeEventListener("selectionchange",Ze);const o=li(t);oi(o)?(function(t){if(null!==t._parentEditor){const e=Ni(t),n=e[e.length-1]._key;$e.get(n)===t&&$e.delete(n)}else $e.delete(t._key)}(o),t.__lexicalEditor=null):o&&r(198);const s=Ue(t);for(let r=0;r<s.length;r++)s[r]();t.__lexicalEventHandles=[]}function Ge(t,e,n){ar();const r=t.__key,i=t.getParent();if(null===i)return;const o=function(t){const e=Un();if(!An(e)||!Er(t))return e;const{anchor:n,focus:r}=e,i=n.getNode(),o=r.getNode();return Hi(i,t)&&n.set(t.__key,0,"element"),Hi(o,t)&&r.set(t.__key,0,"element"),e}(t);let s=!1;if(An(o)&&e){const e=o.anchor,n=o.focus;e.key===r&&(Yn(e,t,i,t.getPreviousSibling(),t.getNextSibling()),s=!0),n.key===r&&(Yn(n,t,i,t.getPreviousSibling(),t.getNextSibling()),s=!0)}else Dn(o)&&e&&t.isSelected()&&t.selectPrevious();if(An(o)&&e&&!s){const e=t.getIndexWithinParent();fi(t),Zn(o,i,e,-1)}else fi(t);n||Gi(i)||i.canBeEmpty()||!i.isEmpty()||Ge(i,e),e&&o&&Pr(i)&&i.isEmpty()&&i.selectEnd()}class Qe{static getType(){r(64,this.name)}static clone(t){r(65,this.name)}afterCloneFrom(t){this.__parent=t.__parent,this.__next=t.__next,this.__prev=t.__prev,this.__state=t.__state}constructor(t){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),function(t,e){if(null!=e)return void(t.__key=e);ar(),ur();const n=fr(),r=dr(),i=""+ti++;r._nodeMap.set(i,t),Er(t)?n._dirtyElements.set(i,!0):n._dirtyLeaves.add(i),n._cloneNotNeeded.add(i),n._dirtyType=1,t.__key=i}(this,t)}getType(){return this.__type}isInline(){r(137,this.constructor.name)}isAttached(){let t=this.__key;for(;null!==t;){if("root"===t)return!0;const e=_i(t);if(null===e)break;t=e.__parent}return!1}isSelected(t){const e=t||Un();if(null==e)return!1;const n=e.getNodes().some(t=>t.__key===this.__key);if(Sn(this))return n;if(An(e)&&"element"===e.anchor.type&&"element"===e.focus.type){if(e.isCollapsed())return!1;const t=this.getParent();if(Or(this)&&this.isInline()&&t){const n=e.isBackward()?e.focus:e.anchor;if(t.is(n.getNode())&&n.offset===t.getChildrenSize()&&this.is(t.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){const t=this.getParent();if(null===t)return-1;let e=t.getFirstChild(),n=0;for(;null!==e;){if(this.is(e))return n;n++,e=e.getNextSibling()}return-1}getParent(){const t=this.getLatest().__parent;return null===t?null:_i(t)}getParentOrThrow(){const t=this.getParent();return null===t&&r(66,this.__key),t}getTopLevelElement(){let t=this;for(;null!==t;){const e=t.getParent();if(Gi(e))return Er(t)||t===this&&Or(t)||r(194),t;t=e}return null}getTopLevelElementOrThrow(){const t=this.getTopLevelElement();return null===t&&r(67,this.__key),t}getParents(){const t=[];let e=this.getParent();for(;null!==e;)t.push(e),e=e.getParent();return t}getParentKeys(){const t=[];let e=this.getParent();for(;null!==e;)t.push(e.__key),e=e.getParent();return t}getPreviousSibling(){const t=this.getLatest().__prev;return null===t?null:_i(t)}getPreviousSiblings(){const t=[],e=this.getParent();if(null===e)return t;let n=e.getFirstChild();for(;null!==n&&!n.is(this);)t.push(n),n=n.getNextSibling();return t}getNextSibling(){const t=this.getLatest().__next;return null===t?null:_i(t)}getNextSiblings(){const t=[];let e=this.getNextSibling();for(;null!==e;)t.push(e),e=e.getNextSibling();return t}getCommonAncestor(t){const e=Er(this)?this:this.getParent(),n=Er(t)?t:t.getParent(),r=e&&n?$o(e,n):null;return r?r.commonAncestor:null}is(t){return null!=t&&this.__key===t.__key}isBefore(t){const e=$o(this,t);return null!==e&&("descendant"===e.type||("branch"===e.type?-1===Vo(e):("same"!==e.type&&"ancestor"!==e.type&&r(279),!1)))}isParentOf(t){const e=$o(this,t);return null!==e&&"ancestor"===e.type}getNodesBetween(t){const e=this.isBefore(t),n=[],i=new Set;let o=this;for(;null!==o;){const s=o.__key;if(i.has(s)||(i.add(s),n.push(o)),o===t)break;const l=Er(o)?e?o.getFirstChild():o.getLastChild():null;if(null!==l){o=l;continue}const c=e?o.getNextSibling():o.getPreviousSibling();if(null!==c){o=c;continue}const a=o.getParentOrThrow();if(i.has(a.__key)||n.push(a),a===t)break;let u=null,d=a;do{if(null===d&&r(68),u=e?d.getNextSibling():d.getPreviousSibling(),d=d.getParent(),null===d)break;null!==u||i.has(d.__key)||n.push(d)}while(null===u);o=u}return e||n.reverse(),n}isDirty(){const t=fr()._dirtyLeaves;return null!==t&&t.has(this.__key)}getLatest(){const t=_i(this.__key);return null===t&&r(113),t}getWritable(){ar();const t=dr(),e=fr(),n=t._nodeMap,r=this.__key,i=this.getLatest(),o=e._cloneNotNeeded,s=Un();if(null!==s&&s.setCachedNodes(null),o.has(r))return hi(i),i;const l=_o(i);return o.add(r),hi(l),n.set(r,l),l}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(t,e){r(70)}updateDOM(t,e,n){r(71)}exportDOM(t){return{element:this.createDOM(t._config,t)}}exportJSON(){const t=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...t}}static importJSON(t){r(18,this.name)}updateFromJSON(t){return function(t,e){const n=t.getWritable();return(e||n.__state)&&function(t){const e=t.getWritable(),n=e.__state?e.__state.getWritable(e):new Y(e);return e.__state=n,n}(t).updateFromJSON(e),n}(this,t.$)}static transform(){return null}remove(t){Ge(this,!0,t)}replace(t,e){ar();let n=Un();null!==n&&(n=n.clone()),to(this,t);const i=this.getLatest(),o=this.__key,s=t.__key,l=t.getWritable(),c=this.getParentOrThrow().getWritable(),a=c.__size;fi(l);const u=i.getPreviousSibling(),d=i.getNextSibling(),f=i.__prev,h=i.__next,g=i.__parent;if(Ge(i,!1,!0),null===u?c.__first=s:u.getWritable().__next=s,l.__prev=f,null===d?c.__last=s:d.getWritable().__prev=s,l.__next=h,l.__parent=g,c.__size=a,e&&(Er(this)&&Er(l)||r(139),this.getChildren().forEach(t=>{l.append(t)})),An(n)){ki(n);const t=n.anchor,e=n.focus;t.key===o&&Mn(t,l),e.key===o&&Mn(e,l)}return pi()===o&&gi(s),l}insertAfter(t,e=!0){ar(),to(this,t);const n=this.getWritable(),r=t.getWritable(),i=r.getParent(),o=Un();let s=!1,l=!1;if(null!==i){const e=t.getIndexWithinParent();if(fi(r),An(o)){const t=i.__key,n=o.anchor,r=o.focus;s="element"===n.type&&n.key===t&&n.offset===e+1,l="element"===r.type&&r.key===t&&r.offset===e+1}}const c=this.getNextSibling(),a=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(null===c?a.__last=u:c.getWritable().__prev=u,a.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,e&&An(o)){const t=this.getIndexWithinParent();Zn(o,a,t+1);const e=a.__key;s&&o.anchor.set(e,t+2,"element"),l&&o.focus.set(e,t+2,"element")}return t}insertBefore(t,e=!0){ar(),to(this,t);const n=this.getWritable(),r=t.getWritable(),i=r.__key;fi(r);const o=this.getPreviousSibling(),s=this.getParentOrThrow().getWritable(),l=n.__prev,c=this.getIndexWithinParent();null===o?s.__first=i:o.getWritable().__next=i,s.__size++,n.__prev=i,r.__prev=l,r.__next=n.__key,r.__parent=n.__parent;const a=Un();return e&&An(a)&&Zn(a,this.getParentOrThrow(),c),t}isParentRequired(){return!1}createParentElementNode(){return $r()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(t,e){ar();const n=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===n)return r.select(0,0);if(Er(n))return n.select();if(!Sn(n)){const t=n.getIndexWithinParent()+1;return r.select(t,t)}return n.select(t,e)}selectNext(t,e){ar();const n=this.getNextSibling(),r=this.getParentOrThrow();if(null===n)return r.select();if(Er(n))return n.select(0,0);if(!Sn(n)){const t=n.getIndexWithinParent();return r.select(t,t)}return n.select(t,e)}markDirty(){this.getWritable()}reconcileObservedMutation(t,e){this.markDirty()}}class tn extends Qe{static getType(){return"linebreak"}static clone(t){return new tn(t.__key)}constructor(t){super(t)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:t=>function(t){const e=t.parentElement;if(null!==e&&co(e)){const n=e.firstChild;if(n===t||n.nextSibling===t&&on(n)){const n=e.lastChild;if(n===t||n.previousSibling===t&&on(n))return!0}}return!1}(t)||function(t){const e=t.parentElement;if(null!==e&&co(e)){const n=e.firstChild;if(n===t||n.nextSibling===t&&on(n))return!1;const r=e.lastChild;if(r===t||r.previousSibling===t&&on(r))return!0}return!1}(t)?null:{conversion:en,priority:0}}}static importJSON(t){return nn().updateFromJSON(t)}}function en(t){return{node:nn()}}function nn(){return Qi(new tn)}function rn(t){return t instanceof tn}function on(t){return ai(t)&&/^( |\t|\r?\n)+$/.test(t.textContent||"")}function sn(t,e){return 16&e?"code":128&e?"mark":32&e?"sub":64&e?"sup":null}function ln(t,e){return 1&e?"strong":2&e?"em":"span"}function cn(t,e,n,r,i){const o=r.classList;let s=zi(i,"base");void 0!==s&&o.add(...s),s=zi(i,"underlineStrikethrough");let l=!1;const c=8&e&&4&e;void 0!==s&&(8&n&&4&n?(l=!0,c||o.add(...s)):c&&o.remove(...s));for(const a in P){const t=P[a];if(s=zi(i,a),void 0!==s)if(n&t){if(l&&("underline"===a||"strikethrough"===a)){e&t&&o.remove(...s);continue}e&t&&(!c||"underline"!==a)&&"strikethrough"!==a||o.add(...s)}else e&t&&o.remove(...s)}}function an(t,e,n){const r=e.firstChild,i=n.isComposing(),o=t+(i?T:"");if(null==r)e.textContent=o;else{const t=r.nodeValue;if(t!==o)if(i||l){const[e,n,i]=function(t,e){const n=t.length,r=e.length;let i=0,o=0;for(;i<n&&i<r&&t[i]===e[i];)i++;for(;o+i<n&&o+i<r&&t[n-o-1]===e[r-o-1];)o++;return[i,n-i-o,e.slice(i,r-o)]}(t,o);0!==n&&r.deleteData(e,n),r.insertData(e,i)}else r.nodeValue=o}}function un(t,e,n,r,i,o){an(i,t,e);const s=o.theme.text;void 0!==s&&cn(0,0,r,t,s)}function dn(t,e){const n=document.createElement(e);return n.appendChild(t),n}class fn extends Qe{static getType(){return"text"}static clone(t){return new fn(t.__text,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__text=t.__text,this.__format=t.__format,this.__style=t.__style,this.__mode=t.__mode,this.__detail=t.__detail}constructor(t="",e){super(e),this.__text=t,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const t=this.getLatest();return R[t.__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===pi()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(t){const e=P[t];return!!(this.getFormat()&e)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(t,e){return di(this.getLatest().__format,t,e)}canHaveFormat(){return!0}isInline(){return!0}createDOM(t,e){const n=this.__format,r=sn(0,n),i=ln(0,n),o=document.createElement(null===r?i:r);let s=o;this.hasFormat("code")&&o.setAttribute("spellcheck","false"),null!==r&&(s=document.createElement(i),o.appendChild(s)),un(s,this,0,n,this.__text,t);const l=this.__style;return""!==l&&(o.style.cssText=l),o}updateDOM(t,e,n){const i=this.__text,o=t.__format,s=this.__format,l=sn(0,o),c=sn(0,s),a=ln(0,o),u=ln(0,s);if((null===l?a:l)!==(null===c?u:c))return!0;if(l===c&&a!==u){const t=e.firstChild;null==t&&r(48);const o=document.createElement(u);return un(o,this,0,s,i,n),e.replaceChild(o,t),!1}let d=e;null!==c&&null!==l&&(d=e.firstChild,null==d&&r(49)),an(i,d,this);const f=n.theme.text;void 0!==f&&o!==s&&cn(0,o,s,d,f);const h=this.__style;return t.__style!==h&&(e.style.cssText=h),!1}static importDOM(){return{"#text":()=>({conversion:mn,priority:0}),b:()=>({conversion:gn,priority:0}),code:()=>({conversion:vn,priority:0}),em:()=>({conversion:vn,priority:0}),i:()=>({conversion:vn,priority:0}),mark:()=>({conversion:vn,priority:0}),s:()=>({conversion:vn,priority:0}),span:()=>({conversion:hn,priority:0}),strong:()=>({conversion:vn,priority:0}),sub:()=>({conversion:vn,priority:0}),sup:()=>({conversion:vn,priority:0}),u:()=>({conversion:vn,priority:0})}}static importJSON(t){return Cn().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTextContent(t.text).setFormat(t.format).setDetail(t.detail).setMode(t.mode).setStyle(t.style)}exportDOM(t){let{element:e}=super.exportDOM(t);return io(e)||r(132),e.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?e.style.textTransform="lowercase":this.hasFormat("uppercase")?e.style.textTransform="uppercase":this.hasFormat("capitalize")&&(e.style.textTransform="capitalize"),this.hasFormat("bold")&&(e=dn(e,"b")),this.hasFormat("italic")&&(e=dn(e,"i")),this.hasFormat("strikethrough")&&(e=dn(e,"s")),this.hasFormat("underline")&&(e=dn(e,"u")),{element:e}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(t,e){}setFormat(t){const e=this.getWritable();return e.__format="string"==typeof t?P[t]:t,e}setDetail(t){const e=this.getWritable();return e.__detail="string"==typeof t?D[t]:t,e}setStyle(t){const e=this.getWritable();return e.__style=t,e}toggleFormat(t){const e=di(this.getFormat(),t,null);return this.setFormat(e)}toggleDirectionless(){const t=this.getWritable();return t.__detail^=1,t}toggleUnmergeable(){const t=this.getWritable();return t.__detail^=2,t}setMode(t){const e=I[t];if(this.__mode===e)return this;const n=this.getWritable();return n.__mode=e,n}setTextContent(t){if(this.__text===t)return this;const e=this.getWritable();return e.__text=t,e}select(t,e){ar();let n=t,r=e;const i=Un(),o=this.getTextContent(),s=this.__key;if("string"==typeof o){const t=o.length;void 0===n&&(n=t),void 0===r&&(r=t)}else n=0,r=0;if(!An(i))return jn(s,n,s,r,"text","text");{const t=pi();t!==i.anchor.key&&t!==i.focus.key||gi(s),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){const t=this.getTextContentSize();return this.select(t,t)}spliceText(t,e,n,r){const i=this.getWritable(),o=i.__text,s=n.length;let l=t;l<0&&(l=s+l,l<0&&(l=0));const c=Un();if(r&&An(c)){const e=t+s;c.setTextNodeRange(i,e,i,e)}const a=o.slice(0,l)+n+o.slice(l+e);return i.__text=a,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...t){ar();const e=this.getLatest(),n=e.getTextContent();if(""===n)return[];const r=e.__key,i=pi(),o=n.length;t.sort((t,e)=>t-e),t.push(o);const s=[],l=t.length;for(let b=0,k=0;b<o&&k<=l;k++){const e=t[k];e>b&&(s.push(n.slice(b,e)),b=e)}const c=s.length;if(1===c)return[e];const a=s[0],u=e.getParent();let d;const f=e.getFormat(),h=e.getStyle(),g=e.__detail;let p=!1,_=null,m=null;const y=Un();if(An(y)){const[t,e]=y.isBackward()?[y.focus,y.anchor]:[y.anchor,y.focus];"text"===t.type&&t.key===r&&(_=t),"text"===e.type&&e.key===r&&(m=e)}e.isSegmented()?(d=Cn(a),d.__format=f,d.__style=h,d.__detail=g,p=!0):(d=e.getWritable(),d.__text=a);const x=[d];for(let b=1;b<c;b++){const t=Cn(s[b]);t.__format=f,t.__style=h,t.__detail=g,i===r&&gi(t.__key),x.push(t)}const v=_?_.offset:null,C=m?m.offset:null;let S=0;for(const b of x){if(!_&&!m)break;const t=S+b.getTextContentSize();if(null!==_&&null!==v&&v<=t&&v>=S&&(_.set(b.getKey(),v-S,"text"),v<t&&(_=null)),null!==m&&null!==C&&C<=t&&C>=S){m.set(b.getKey(),C-S,"text");break}S=t}if(null!==u){!function(t){const e=t.getPreviousSibling(),n=t.getNextSibling();null!==e&&hi(e),null!==n&&hi(n)}(this);const t=u.getWritable(),e=this.getIndexWithinParent();p?(t.splice(e,0,x),this.remove()):t.splice(e,1,x),An(y)&&Zn(y,u,e,c-1)}return x}mergeWithSibling(t){const e=t===this.getPreviousSibling();e||t===this.getNextSibling()||r(50);const n=this.__key,i=t.__key,o=this.__text,s=o.length;pi()===i&&gi(n);const l=Un();if(An(l)){const r=l.anchor,o=l.focus;null!==r&&r.key===i&&Xn(r,e,n,t,s),null!==o&&o.key===i&&Xn(o,e,n,t,s)}const c=t.__text;this.setTextContent(e?c+o:o+c);const a=this.getWritable();return t.remove(),a}isTextEntity(){return!1}}function hn(t){return{forChild:bn(t.style),node:null}}function gn(t){return{forChild:bn(t.style,"normal"===t.style.fontWeight?void 0:"bold"),node:null}}const pn=new WeakMap;function _n(t){if(!io(t))return!1;if("PRE"===t.nodeName)return!0;const e=t.style.whiteSpace;return"string"==typeof e&&e.startsWith("pre")}function mn(t){const e=t;null===t.parentElement&&r(129);let n=e.textContent||"";if(null!==function(t){let e,n=t.parentNode;const r=[t];for(;null!==n&&void 0===(e=pn.get(n))&&!_n(n);)r.push(n),n=n.parentNode;const i=void 0===e?n:e;for(let o=0;o<r.length;o++)pn.set(r[o],i);return i}(e)){const t=n.split(/(\r?\n|\t)/),e=[],r=t.length;for(let n=0;n<r;n++){const r=t[n];"\n"===r||"\r\n"===r?e.push(nn()):"\t"===r?e.push(Tn()):""!==r&&e.push(Cn(r))}return{node:e}}if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),""===n)return{node:null};if(" "===n[0]){let t=e,r=!0;for(;null!==t&&null!==(t=yn(t,!1));){const e=t.textContent||"";if(e.length>0){/[ \t\n]$/.test(e)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(" "===n[n.length-1]){let t=e,r=!0;for(;null!==t&&null!==(t=yn(t,!0));)if((t.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return""===n?{node:null}:{node:Cn(n)}}function yn(t,e){let n=t;for(;;){let t;for(;null===(t=e?n.nextSibling:n.previousSibling);){const t=n.parentElement;if(null===t)return null;n=t}if(n=t,io(n)){const t=n.style.display;if(""===t&&!lo(n)||""!==t&&!t.startsWith("inline"))return null}let r=n;for(;null!==(r=e?n.firstChild:n.lastChild);)n=r;if(ai(n))return n;if("BR"===n.nodeName)return null}}const xn={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function vn(t){const e=xn[t.nodeName.toLowerCase()];return void 0===e?{node:null}:{forChild:bn(t.style,e),node:null}}function Cn(t=""){return Qi(new fn(t))}function Sn(t){return t instanceof fn}function bn(t,e){const n=t.fontWeight,r=t.textDecoration.split(" "),i="700"===n||"bold"===n,o=r.includes("line-through"),s="italic"===t.fontStyle,l=r.includes("underline"),c=t.verticalAlign;return t=>Sn(t)?(i&&!t.hasFormat("bold")&&t.toggleFormat("bold"),o&&!t.hasFormat("strikethrough")&&t.toggleFormat("strikethrough"),s&&!t.hasFormat("italic")&&t.toggleFormat("italic"),l&&!t.hasFormat("underline")&&t.toggleFormat("underline"),"sub"!==c||t.hasFormat("subscript")||t.toggleFormat("subscript"),"super"!==c||t.hasFormat("superscript")||t.toggleFormat("superscript"),e&&!t.hasFormat(e)&&t.toggleFormat(e),t):t}class kn extends fn{static getType(){return"tab"}static clone(t){return new kn(t.__key)}constructor(t){super("\t",t),this.__detail=2}static importDOM(){return null}createDOM(t){const e=super.createDOM(t),n=zi(t.theme,"tab");return void 0!==n&&e.classList.add(...n),e}static importJSON(t){return Tn().updateFromJSON(t)}setTextContent(t){return"\t"!==t&&""!==t&&r(126),super.setTextContent(t)}setDetail(t){return 2!==t&&r(127),this}setMode(t){return"normal"!==t&&r(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Tn(){return Qi(new kn)}class wn{constructor(t,e,n){this._selection=null,this.key=t,this.offset=e,this.type=n}is(t){return this.key===t.key&&this.offset===t.offset&&this.type===t.type}isBefore(t){return this.key===t.key?this.offset<t.offset:jo(ns(Zo(this,"next")),ns(Zo(t,"next")))<0}getNode(){const t=_i(this.key);return null===t&&r(20),t}set(t,e,n,r){const i=this._selection,o=this.key;r&&this.key===t&&this.offset===e&&this.type===n||(this.key=t,this.offset=e,this.type=n,cr()||(pi()===o&&gi(t),null!==i&&(i.setCachedNodes(null),i.dirty=!0)))}}function En(t,e,n){return new wn(t,e,n)}function Nn(t,e){let n=e.__key,r=t.offset,i="element";if(Sn(e)){i="text";const t=e.getTextContentSize();r>t&&(r=t)}else if(!Er(e)){const t=e.getNextSibling();if(Sn(t))n=t.__key,r=0,i="text";else{const t=e.getParent();t&&(n=t.__key,r=e.getIndexWithinParent()+1)}}t.set(n,r,i)}function Mn(t,e){if(Er(e)){const n=e.getLastDescendant();Er(n)||Sn(n)?Nn(t,n):Nn(t,e)}else Nn(t,e)}class On{constructor(t){this._cachedNodes=null,this._nodes=t,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){if(!Dn(t))return!1;const e=this._nodes,n=t._nodes;return e.size===n.size&&Array.from(e).every(t=>n.has(t))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(t){this.dirty=!0,this._nodes.add(t),this._cachedNodes=null}delete(t){this.dirty=!0,this._nodes.delete(t),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(t){return this._nodes.has(t)}clone(){return new On(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){const e=this.getNodes(),n=e.length,r=e[n-1];let i;if(Sn(r))i=r.select();else{const t=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(t,t)}i.insertNodes(t);for(let o=0;o<n;o++)e[o].remove()}getNodes(){const t=this._cachedNodes;if(null!==t)return t;const e=this._nodes,n=[];for(const r of e){const t=_i(r);null!==t&&n.push(t)}return cr()||(this._cachedNodes=n),n}getTextContent(){const t=this.getNodes();let e="";for(let n=0;n<t.length;n++)e+=t[n].getTextContent();return e}deleteNodes(){const t=this.getNodes();if((Un()||$n())===this&&t[0]){const e=Po(t[0],"next");!function(t){const e=Un(),n=An(e)?e:function(){const t=En("root",0,"element"),e=En("root",0,"element");return new Pn(t,e,0,"")}();Yo(n,t),ki(n)}(Wo(e,e))}for(const e of t)e.remove()}}function An(t){return t instanceof Pn}class Pn{constructor(t,e,n,r){this.anchor=t,this.focus=e,t._selection=this,e._selection=this,this._cachedNodes=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return!!An(t)&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)&&this.format===t.format&&this.style===t.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const t=this._cachedNodes;if(null!==t)return t;const e=function(t){const e=[],[n,r]=t.getTextSlices();n&&e.push(n.caret.origin);const i=new Set,o=new Set;for(const s of t)if(No(s)){const{origin:t}=s;0===e.length?i.add(t):(o.add(t),e.push(t))}else{const{origin:t}=s;Er(t)&&o.has(t)||e.push(t)}if(r&&e.push(r.caret.origin),Eo(t.focus)&&Er(t.focus.origin)&&null===t.focus.getNodeAtCaret())for(let s=Io(t.focus.origin,"previous");No(s)&&i.has(s.origin)&&!s.origin.isEmpty()&&s.origin.is(e[e.length-1]);s=Ro(s))i.delete(s.origin),e.pop();for(;e.length>1;){const t=e[e.length-1];if(!Er(t)||o.has(t)||t.isEmpty()||i.has(t))break;e.pop()}if(0===e.length&&t.isCollapsed()){const n=ns(t.anchor),r=ns(t.anchor.getFlipped()),i=t=>wo(t)?t.origin:t.getNodeAtCaret(),o=i(n)||i(r)||(t.anchor.getNodeAtCaret()?n.origin:r.origin);e.push(o)}return e}(os(Xo(this),"next"));return cr()||(this._cachedNodes=e),e}setTextNodeRange(t,e,n,r){this.anchor.set(t.__key,e,"text"),this.focus.set(n.__key,r,"text")}getTextContent(){const t=this.getNodes();if(0===t.length)return"";const e=t[0],n=t[t.length-1],r=this.anchor,i=this.focus,o=r.isBefore(i),[s,l]=Ln(this);let c="",a=!0;for(let u=0;u<t.length;u++){const d=t[u];if(Er(d)&&!d.isInline())a||(c+="\n"),a=!d.isEmpty();else if(a=!1,Sn(d)){let t=d.getTextContent();d===e?d===n?"element"===r.type&&"element"===i.type&&i.offset!==r.offset||(t=s<l?t.slice(s,l):t.slice(l,s)):t=t.slice(o?s:l):d===n&&(t=t.slice(0,o?l:s)),c+=t}else!Or(d)&&!rn(d)||d===n&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(t){const e=fr(),n=e.getEditorState()._selection,r=Jn(t.startContainer,t.startOffset,t.endContainer,t.endOffset,e,n);if(null===r)return;const[i,o]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(o.key,o.offset,o.type,!0),et(this)}clone(){const t=this.anchor,e=this.focus;return new Pn(En(t.key,t.offset,t.type),En(e.key,e.offset,e.type),this.format,this.style)}toggleFormat(t){this.format=di(this.format,t,null),this.dirty=!0}setStyle(t){this.style=t,this.dirty=!0}hasFormat(t){return!!(this.format&P[t])}insertRawText(t){const e=t.split(/(\r?\n|\t)/),n=[],r=e.length;for(let i=0;i<r;i++){const t=e[i];n.push("\n"===t||"\r\n"===t?nn():"\t"===t?Tn():Cn(t))}this.insertNodes(n)}insertText(t){const e=this.anchor,n=this.focus,i=this.format,o=this.style;let s=e,l=n;!this.isCollapsed()&&n.isBefore(e)&&(s=n,l=e),"element"===s.type&&function(t,e,n,r){const i=t.getNode(),o=i.getChildAtIndex(t.offset),s=Cn(),l=Pr(i)?$r().append(s):s;s.setFormat(n),s.setStyle(r),null===o?i.append(l):o.insertBefore(l),t.is(e)&&e.set(s.__key,0,"text"),t.set(s.__key,0,"text")}(s,l,i,o),"element"===l.type&&Ho(l,ns(Zo(l,"next")));const c=s.offset;let a=l.offset;const u=this.getNodes(),d=u.length;let f=u[0];Sn(f)||r(26);const h=f.getTextContent().length,g=f.getParentOrThrow();let p=u[d-1];if(1===d&&"element"===l.type&&(a=h,l.set(s.key,a,"text")),this.isCollapsed()&&c===h&&(f.isSegmented()||f.isToken()||!f.canInsertTextAfter()||!g.canInsertTextAfter()&&null===f.getNextSibling())){let e=f.getNextSibling();if(Sn(e)&&e.canInsertTextBefore()&&!ci(e)||(e=Cn(),e.setFormat(i),e.setStyle(o),g.canInsertTextAfter()?f.insertAfter(e):g.insertAfter(e)),e.select(0,0),f=e,""!==t)return void this.insertText(t)}else if(this.isCollapsed()&&0===c&&(f.isSegmented()||f.isToken()||!f.canInsertTextBefore()||!g.canInsertTextBefore()&&null===f.getPreviousSibling())){let e=f.getPreviousSibling();if(Sn(e)&&!ci(e)||(e=Cn(),e.setFormat(i),g.canInsertTextBefore()?f.insertBefore(e):g.insertBefore(e)),e.select(),f=e,""!==t)return void this.insertText(t)}else if(f.isSegmented()&&c!==h){const t=Cn(f.getTextContent());t.setFormat(i),f.replace(t),f=t}else if(!this.isCollapsed()&&""!==t){const e=p.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||Er(e)&&(!e.canInsertTextBefore()||!e.canInsertTextAfter()))return this.insertText(""),Wn(this.anchor,this.focus,null),void this.insertText(t)}if(1===d){if(f.isToken()){const e=Cn(t);return e.select(),void f.replace(e)}const e=f.getFormat(),n=f.getStyle();if(c!==a||e===i&&n===o){if(function(t){return t instanceof kn}(f)){const e=Cn(t);return e.setFormat(i),e.setStyle(o),e.select(),void f.replace(e)}}else{if(""!==f.getTextContent()){const e=Cn(t);if(e.setFormat(i),e.setStyle(o),e.select(),0===c)f.insertBefore(e,!1);else{const[t]=f.splitText(c);t.insertAfter(e,!1)}return void(e.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=t.length))}f.setFormat(i),f.setStyle(o)}f=f.spliceText(c,a-c,t,!0),""===f.getTextContent()?f.remove():"text"===this.anchor.type&&(f.isComposing()?this.anchor.offset-=t.length:(this.format=e,this.style=n))}else{const e=new Set([...f.getParentKeys(),...p.getParentKeys()]),n=Er(f)?f:f.getParentOrThrow();let r=Er(p)?p:p.getParentOrThrow(),i=p;if(!n.is(r)&&r.isInline())do{i=r,r=r.getParentOrThrow()}while(r.isInline());if("text"===l.type&&(0!==a||""===p.getTextContent())||"element"===l.type&&p.getIndexWithinParent()<a)if(Sn(p)&&!p.isToken()&&a!==p.getTextContentSize()){if(p.isSegmented()){const t=Cn(p.getTextContent());p.replace(t),p=t}Pr(l.getNode())||"text"!==l.type||(p=p.spliceText(0,a,"")),e.add(p.__key)}else{const t=p.getParentOrThrow();t.canBeEmpty()||1!==t.getChildrenSize()?p.remove():t.remove()}else e.add(p.__key);const o=r.getChildren(),s=new Set(u),g=n.is(r),_=n.isInline()&&null===f.getNextSibling()?n:f;for(let t=o.length-1;t>=0;t--){const e=o[t];if(e.is(f)||Er(e)&&e.isParentOf(f))break;e.isAttached()&&(!s.has(e)||e.is(i)?g||_.insertAfter(e,!1):e.remove())}if(!g){let t=r,n=null;for(;null!==t;){const r=t.getChildren(),i=r.length;(0===i||r[i-1].is(n))&&(e.delete(t.__key),n=t),t=t.getParent()}}if(f.isToken())if(c===h)f.select();else{const e=Cn(t);e.select(),f.replace(e)}else f=f.spliceText(c,h-c,t,!0),""===f.getTextContent()?f.remove():f.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=t.length);for(let t=1;t<d;t++){const n=u[t];e.has(n.__key)||n.remove()}}}removeText(){const t=Un()===this;Yo(this,es(Xo(this))),t&&Un()!==this&&ki(this)}formatText(t,e=null){if(this.isCollapsed())return this.toggleFormat(t),void gi(null);const n=this.getNodes(),r=[];for(const x of n)Sn(x)&&r.push(x);const i=e=>{n.forEach(n=>{if(Er(n)){const r=n.getFormatFlags(t,e);n.setTextFormat(r)}})},o=r.length;if(0===o)return this.toggleFormat(t),gi(null),void i(e);const s=this.anchor,l=this.focus,c=this.isBackward(),a=c?l:s,u=c?s:l;let d=0,f=r[0],h="element"===a.type?0:a.offset;if("text"===a.type&&h===f.getTextContentSize()&&(d=1,f=r[1],h=0),null==f)return;const g=f.getFormatFlags(t,e);i(g);const p=o-1;let _=r[p];const m="text"===u.type?u.offset:_.getTextContentSize();if(f.is(_)){if(h===m)return;if(ci(f)||0===h&&m===f.getTextContentSize())f.setFormat(g);else{const t=f.splitText(h,m),e=0===h?t[0]:t[1];e.setFormat(g),"text"===a.type&&a.set(e.__key,0,"text"),"text"===u.type&&u.set(e.__key,m-h,"text")}return void(this.format=g)}0===h||ci(f)||([,f]=f.splitText(h),h=0),f.setFormat(g);const y=_.getFormatFlags(t,g);m>0&&(m===_.getTextContentSize()||ci(_)||([_]=_.splitText(m)),_.setFormat(y));for(let x=d+1;x<p;x++){const e=r[x],n=e.getFormatFlags(t,y);e.setFormat(n)}"text"===a.type&&a.set(f.__key,h,"text"),"text"===u.type&&u.set(_.__key,m,"text"),this.format=g|y}insertNodes(t){if(0===t.length)return;if(this.isCollapsed()||this.removeText(),"root"===this.anchor.key){this.insertParagraph();const e=Un();return An(e)||r(134),e.insertNodes(t)}const e=(this.isBackward()?this.focus:this.anchor).getNode(),n=uo(e,ao),i=t[t.length-1];if(Er(n)&&"__language"in n){if("__language"in t[0])this.insertText(t[0].getTextContent());else{const e=Qn(this);n.splice(e,0,t),i.selectEnd()}return}if(!t.some(t=>(Er(t)||Or(t))&&!t.isInline())){Er(n)||r(211,e.constructor.name,e.getType());const o=Qn(this);return n.splice(o,0,t),void i.selectEnd()}const o=function(t){const e=$r();let n=null;for(let r=0;r<t.length;r++){const i=t[r],o=rn(i);if(o||Or(i)&&i.isInline()||Er(i)&&i.isInline()||Sn(i)||i.isParentRequired()){if(null===n&&(n=i.createParentElementNode(),e.append(n),o))continue;null!==n&&n.append(i)}else e.append(i),n=null}return e}(t),s=o.getLastDescendant(),l=o.getChildren(),c=Er(n)&&n.isEmpty()?null:this.insertParagraph(),a=l[l.length-1];let u=l[0];var d;Er(d=u)&&ao(d)&&!d.isEmpty()&&Er(n)&&(!n.isEmpty()||n.canMergeWhenEmpty())&&(Er(n)||r(211,e.constructor.name,e.getType()),n.append(...u.getChildren()),u=l[1]),u&&(null===n&&r(212,e.constructor.name,e.getType()),function(t,e){const n=e.getParentOrThrow().getLastChild();let i=e;const o=[e];for(;i!==n;)i.getNextSibling()||r(140),i=i.getNextSibling(),o.push(i);let s=t;for(const r of o)s=s.insertAfter(r)}(n,u));const f=uo(s,ao);c&&Er(f)&&(c.canMergeWhenEmpty()||ao(a))&&(f.append(...c.getChildren()),c.remove()),Er(n)&&n.isEmpty()&&n.remove(),s.selectEnd();const h=Er(n)?n.getLastChild():null;rn(h)&&f!==n&&h.remove()}insertParagraph(){if("root"===this.anchor.key){const t=$r();return Si().splice(this.anchor.offset,0,[t]),t.select(),t}const t=Qn(this),e=uo(this.anchor.getNode(),ao);Er(e)||r(213);const n=e.getChildAtIndex(t),i=n?[n,...n.getNextSiblings()]:[],o=e.insertNewAfter(this,!1);return o?(o.append(...i),o.selectStart(),o):null}insertLineBreak(t){const e=nn();if(this.insertNodes([e]),t){const t=e.getParentOrThrow(),n=e.getIndexWithinParent();t.select(n,n)}}extract(){const t=this.getNodes(),e=t.length,n=e-1,r=this.anchor,i=this.focus;let o=t[0],s=t[n];const[l,c]=Ln(this);if(0===e)return[];if(1===e){if(Sn(o)&&!this.isCollapsed()){const t=l>c?c:l,e=o.splitText(t,l>c?l:c),n=0===t?e[0]:e[1];return null!=n?[n]:[]}return[o]}const a=r.isBefore(i);if(Sn(o)){const e=a?l:c;e===o.getTextContentSize()?t.shift():0!==e&&([,o]=o.splitText(e),t[0]=o)}if(Sn(s)){const e=s.getTextContent().length,r=a?c:l;0===r?t.pop():r!==e&&([s]=s.splitText(r),t[n]=s)}return t}modify(t,e,n){if(er(this,t,e,n))return;const r="move"===t,i=fr(),o=ro(Xi(i));if(!o)return;const s=i._blockCursorElement,l=i._rootElement,c=this.focus.getNode();if(null===l||null===s||!Er(c)||c.isInline()||c.canBeEmpty()||no(s,i,l),this.dirty){let t=Ui(i,this.anchor.key),e=Ui(i,this.focus.key);"text"===this.anchor.type&&(t=ui(t)),"text"===this.focus.type&&(e=ui(e)),t&&e&&Gn(o,t,this.anchor.offset,e,this.focus.offset)}if(function(t,e,n,r){t.modify(e,n,r)}(o,t,e?"backward":"forward",n),o.rangeCount>0){const t=o.getRangeAt(0),n=this.anchor.getNode(),i=Pr(n)?n:function(t){let e=t.getParentOrThrow();for(;null!==e;){if(Gi(e))return e;e=e.getParentOrThrow()}return e}(n);if(this.applyDOMRange(t),this.dirty=!0,!r){const n=this.getNodes(),r=[];let s=!1;for(let t=0;t<n.length;t++){const e=n[t];Hi(e,i)?r.push(e):s=!0}if(s&&r.length>0)if(e){const t=r[0];Er(t)?t.selectStart():t.getParentOrThrow().selectStart()}else{const t=r[r.length-1];Er(t)?t.selectEnd():t.getParentOrThrow().selectEnd()}o.anchorNode===t.startContainer&&o.anchorOffset===t.startOffset||function(t){const e=t.focus,n=t.anchor,r=n.key,i=n.offset,o=n.type;n.set(e.key,e.offset,e.type,!0),e.set(r,i,o,!0)}(this)}}"lineboundary"===n&&er(this,t,e,n,"decorators")}forwardDeletion(t,e,n){if(!n&&("element"===t.type&&Er(e)&&t.offset===e.getChildrenSize()||"text"===t.type&&t.offset===e.getTextContentSize())){const t=e.getParent(),n=e.getNextSibling()||(null===t?null:t.getNextSibling());if(Er(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(t){const e=this.isCollapsed();if(this.isCollapsed()){const e=this.anchor;let n=e.getNode();if(this.forwardDeletion(e,n,t))return;const r=zo(Zo(e,t?"previous":"next"));if(r.getTextSlices().every(t=>null===t||0===t.distance)){let t={type:"initial"};for(const e of r.iterNodeCarets("shadowRoot"))if(No(e))if(e.origin.isInline());else{if(e.origin.isShadowRoot()){if("merge-block"===t.type)break;if(Er(r.anchor.origin)&&r.anchor.origin.isEmpty()){const t=ns(e);Yo(this,Wo(t,t)),r.anchor.origin.remove()}return}"merge-next-block"!==t.type&&"merge-block"!==t.type||(t={block:t.block,caret:e,type:"merge-block"})}else{if("merge-block"===t.type)break;if(Eo(e)){if(Er(e.origin)){if(e.origin.isInline()){if(!e.origin.isParentOf(r.anchor.origin))break}else t={block:e.origin,type:"merge-next-block"};continue}if(Or(e.origin)){if(e.origin.isIsolated());else if("merge-next-block"===t.type&&(e.origin.isKeyboardSelectable()||!e.origin.isInline())&&Er(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();const t=Vn();t.add(e.origin.getKey()),ki(t)}else e.origin.remove();return}break}}if("merge-block"===t.type){const{caret:e,block:n}=t;return Yo(this,Wo(!e.origin.isEmpty()&&n.isEmpty()?Go(Po(n,e.direction)):r.anchor,e)),this.removeText()}}const i=this.focus;if(this.modify("extend",t,"character"),this.isCollapsed()){if(t&&0===e.offset&&In(this,e.getNode()))return}else{const r="text"===i.type?i.getNode():null;if(n="text"===e.type?e.getNode():null,null!==r&&r.isSegmented()){const e=i.offset,o=r.getTextContentSize();if(r.is(n)||t&&e!==o||!t&&0!==e)return void Kn(r,t,e)}else if(null!==n&&n.isSegmented()){const i=e.offset,o=n.getTextContentSize();if(n.is(r)||t&&0!==i||!t&&i!==o)return void Kn(n,t,i)}!function(t,e){const n=t.anchor,r=t.focus,i=n.getNode();if(i===r.getNode()&&"text"===n.type&&"text"===r.type){const t=n.offset,o=r.offset,s=t<o,l=s?t:o,c=s?o:t,a=c-1;l!==a&&function(t){return!(Ei(t)||Rn(t))}(i.getTextContent().slice(l,c))&&(e?r.set(r.key,a,r.type):n.set(n.key,a,n.type))}}(this,t)}}if(this.removeText(),t&&!e&&this.isCollapsed()&&"element"===this.anchor.type&&0===this.anchor.offset){const t=this.anchor.getNode();t.isEmpty()&&Pr(t.getParent())&&null===t.getPreviousSibling()&&In(this,t)}}deleteLine(t){this.isCollapsed()&&this.modify("extend",t,"lineboundary"),this.isCollapsed()?this.deleteCharacter(t):this.removeText()}deleteWord(t){if(this.isCollapsed()){const e=this.anchor,n=e.getNode();if(this.forwardDeletion(e,n,t))return;this.modify("extend",t,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function Dn(t){return t instanceof On}function Fn(t){const e=t.offset;if("text"===t.type)return e;const n=t.getNode();return e===n.getChildrenSize()?n.getTextContent().length:0}function Ln(t){const e=t.getStartEndPoints();if(null===e)return[0,0];const[n,r]=e;return"element"===n.type&&"element"===r.type&&n.key===r.key&&n.offset===r.offset?[0,0]:[Fn(n),Fn(r)]}function In(t,e){for(let n=e;n;n=n.getParent()){if(Er(n)){if(n.collapseAtStart(t))return!0;if(Gi(n))break}if(n.getPreviousSibling())break}return!1}const Rn=(()=>{try{const t=new RegExp("\\p{Emoji}","u"),e=t.test.bind(t);if(e("\u2764\ufe0f")&&e("#\ufe0f\u20e3")&&e("\ud83d\udc4d"))return e}catch(r){}return()=>!1})();function Kn(t,e,n){const r=t,i=r.getTextContent().split(/(?=\s)/g),o=i.length;let s=0,l=0;for(let a=0;a<o;a++){const t=a===o-1;if(l=s,s+=i[a].length,e&&s===n||s>n||t){i.splice(a,1),t&&(l=void 0);break}}const c=i.join("").trim();""===c?r.remove():(r.setTextContent(c),r.select(l,l))}function Bn(t,e,n,i){let o,s=e;if(io(t)){let l=!1;const c=t.childNodes,a=c.length,u=i._blockCursorElement;s===a&&(l=!0,s=a-1);let d=c[s],f=!1;if(d===u)d=c[s+1],f=!0;else if(null!==u){const n=u.parentNode;t===n&&e>Array.prototype.indexOf.call(n.children,u)&&s--}if(o=Ti(d),Sn(o))s=wi(o,l);else{let c=Ti(t);if(null===c)return null;if(Er(c)){const a=i.getElementByKey(c.getKey());null===a&&r(214);const u=c.getDOMSlot(a);[c,s]=u.resolveChildIndex(c,a,t,e),Er(c)||r(215),l&&s>=c.getChildrenSize()&&(s=Math.max(0,c.getChildrenSize()-1));let d=c.getChildAtIndex(s);if(Er(d)&&function(t,e,n){const r=t.getParent();return null===n||null===r||!r.canBeEmpty()||r!==n.getNode()}(d,0,n)){const t=l?d.getLastDescendant():d.getFirstDescendant();null===t?c=d:(d=t,c=Er(d)?d:d.getParentOrThrow()),s=0}Sn(d)?(o=d,c=null,s=wi(d,l)):d!==c&&l&&!f&&(Er(c)||r(216),s=Math.min(c.getChildrenSize(),s+1))}else{const n=c.getIndexWithinParent();s=0===e&&Or(c)&&Ti(t)===c?n:n+1,c=c.getParentOrThrow()}if(Er(c))return En(c.__key,s,"element")}}else o=Ti(t);return Sn(o)?En(o.__key,s,"text"):null}function zn(t,e,n){const r=t.offset,i=t.getNode();if(0===r){const r=i.getPreviousSibling(),o=i.getParent();if(e){if((n||!e)&&null===r&&Er(o)&&o.isInline()){const e=o.getPreviousSibling();Sn(e)&&t.set(e.__key,e.getTextContent().length,"text")}}else Er(r)&&!n&&r.isInline()?t.set(r.__key,r.getChildrenSize(),"element"):Sn(r)&&t.set(r.__key,r.getTextContent().length,"text")}else if(r===i.getTextContent().length){const r=i.getNextSibling(),o=i.getParent();if(e&&Er(r)&&r.isInline())t.set(r.__key,0,"element");else if((n||e)&&null===r&&Er(o)&&o.isInline()&&!o.canInsertTextAfter()){const e=o.getNextSibling();Sn(e)&&t.set(e.__key,0,"text")}}}function Wn(t,e,n){if("text"===t.type&&"text"===e.type){const r=t.isBefore(e),i=t.is(e);zn(t,r,i),zn(e,!r,i),i&&e.set(t.key,t.offset,t.type);const o=fr();if(o.isComposing()&&o._compositionKey!==t.key&&An(n)){const r=n.anchor,i=n.focus;t.set(r.key,r.offset,r.type,!0),e.set(i.key,i.offset,i.type,!0)}}}function Jn(t,e,n,r,i,o){if(null===t||null===n||!ii(i,t,n))return null;const s=Bn(t,e,An(o)?o.anchor:null,i);if(null===s)return null;const l=Bn(n,r,An(o)?o.focus:null,i);if(null===l)return null;if("element"===s.type&&"element"===l.type){const e=Ti(t),r=Ti(n);if(Or(e)&&Or(r))return null}return Wn(s,l,o),[s,l]}function jn(t,e,n,r,i,o){const s=dr(),l=new Pn(En(t,e,i),En(n,r,o),0,"");return l.dirty=!0,s._selection=l,l}function Vn(){return new On(new Set)}function qn(t,e,n,r){const i=n._window;if(null===i)return null;const o=r||i.event,s=o?o.type:void 0,l="selectionchange"===s,c=!z&&(l||"beforeinput"===s||"compositionstart"===s||"compositionend"===s||"click"===s&&o&&3===o.detail||"drop"===s||void 0===s);let a,u,d,f;if(An(t)&&!c)return t.clone();if(null===e)return null;if(a=e.anchorNode,u=e.focusNode,d=e.anchorOffset,f=e.focusOffset,l&&An(t)&&!ii(n,a,u))return t.clone();const h=Jn(a,d,u,f,n,t);if(null===h)return null;const[g,p]=h;return new Pn(g,p,An(t)?t.format:0,An(t)?t.style:"")}function Un(){return dr()._selection}function $n(){return fr()._editorState._selection}function Zn(t,e,n,r=1){const i=t.anchor,o=t.focus,s=i.getNode(),l=o.getNode();if(!e.is(s)&&!e.is(l))return;const c=e.__key;if(t.isCollapsed()){const e=i.offset;if(n<=e&&r>0||n<e&&r<0){const n=Math.max(0,e+r);i.set(c,n,"element"),o.set(c,n,"element"),Hn(t)}}else{const s=t.isBackward(),l=s?o:i,a=l.getNode(),u=s?i:o,d=u.getNode();if(e.is(a)){const t=l.offset;(n<=t&&r>0||n<t&&r<0)&&l.set(c,Math.max(0,t+r),"element")}if(e.is(d)){const t=u.offset;(n<=t&&r>0||n<t&&r<0)&&u.set(c,Math.max(0,t+r),"element")}}Hn(t)}function Hn(t){const e=t.anchor,n=e.offset,r=t.focus,i=r.offset,o=e.getNode(),s=r.getNode();if(t.isCollapsed()){if(!Er(o))return;const t=o.getChildrenSize(),i=n>=t,s=o.getChildAtIndex(i?t-1:n);if(Sn(s)){let t=0;i&&(t=s.getTextContentSize()),e.set(s.__key,t,"text"),r.set(s.__key,t,"text")}}else{if(Er(o)){const t=o.getChildrenSize(),r=n>=t,i=o.getChildAtIndex(r?t-1:n);if(Sn(i)){let t=0;r&&(t=i.getTextContentSize()),e.set(i.__key,t,"text")}}if(Er(s)){const t=s.getChildrenSize(),e=i>=t,n=s.getChildAtIndex(e?t-1:i);if(Sn(n)){let t=0;e&&(t=n.getTextContentSize()),r.set(n.__key,t,"text")}}}}function Yn(t,e,n,r,i){let o=null,s=0,l=null;null!==r?(o=r.__key,Sn(r)?(s=r.getTextContentSize(),l="text"):Er(r)&&(s=r.getChildrenSize(),l="element")):null!==i&&(o=i.__key,Sn(i)?l="text":Er(i)&&(l="element")),null!==o&&null!==l?t.set(o,s,l):(s=e.getIndexWithinParent(),-1===s&&(s=n.getChildrenSize()),t.set(n.__key,s,"element"))}function Xn(t,e,n,r,i){"text"===t.type?t.set(n,t.offset+(e?0:i),"text"):t.offset>r.getIndexWithinParent()&&t.set(t.key,t.offset-1,"element")}function Gn(t,e,n,r,i){try{t.setBaseAndExtent(e,n,r,i)}catch(t){}}function Qn(t){let e=t;t.isCollapsed()||e.removeText();const n=Un();An(n)&&(e=n),An(e)||r(161);const i=e.anchor;let o=i.getNode(),s=i.offset;for(;!ao(o);){const t=o;if([o,s]=tr(o,s),t.is(o))break}return s}function tr(t,e){const n=t.getParent();if(!n){const t=$r();return Si().append(t),t.select(),[Si(),0]}if(Sn(t)){const r=t.splitText(e);if(0===r.length)return[n,t.getIndexWithinParent()];const i=0===e?0:1;return[n,r[0].getIndexWithinParent()+i]}if(!Er(t)||0===e)return[n,t.getIndexWithinParent()];const r=t.getChildAtIndex(e);if(r){const n=new Pn(En(t.__key,e,"element"),En(t.__key,e,"element"),0,""),i=t.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,t.getIndexWithinParent()+1]}function er(t,e,n,r,i="decorators-and-blocks"){if("move"===e&&"character"===r&&!t.isCollapsed()){const[e,r]=n===t.isBackward()?[t.focus,t.anchor]:[t.anchor,t.focus];return r.set(e.key,e.offset,e.type),!0}const o=Zo(t.focus,n?"previous":"next"),s="lineboundary"===r,l="move"===e;let c=o,a="decorators-and-blocks"===i;if(!rs(c)){for(const t of c){a=!1;const{origin:e}=t;if(!Or(e)||e.isIsolated()||(c=t,!s||!e.isInline()))break}if(a)for(const t of zo(o).iterNodeCarets("extend"===e?"shadowRoot":"root")){if(No(t))t.origin.isInline()||(c=t);else{if(Er(t.origin))continue;Or(t.origin)&&!t.origin.isInline()&&(c=t)}break}}if(c===o)return!1;if(l&&!s&&Or(c.origin)&&c.origin.isKeyboardSelectable()){const t=Vn();return t.add(c.origin.getKey()),ki(t),!0}return c=ns(c),l&&Ho(t.anchor,c),Ho(t.focus,c),a||!s}let nr=null,rr=null,ir=!1,or=!1,sr=0;const lr={characterData:!0,childList:!0,subtree:!0};function cr(){return ir||null!==nr&&nr._readOnly}function ar(){ir&&r(13)}function ur(){sr>99&&r(14)}function dr(){return null===nr&&r(195,hr()),nr}function fr(){return null===rr&&r(196,hr()),rr}function hr(){let t=0;const e=new Set,n=Qr.version;if("undefined"!=typeof window)for(const i of document.querySelectorAll("[contenteditable]")){const r=li(i);if(oi(r))t++;else if(r){let t=String(r.constructor.version||"<0.17.1");t===n&&(t+=" (separately built, likely a bundler configuration issue)"),e.add(t)}}let r=` Detected on the page: ${t} compatible editor(s) with version ${n}`;return e.size&&(r+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),r}function gr(t,e,n){const i=e.__type,o=function(t,e){const n=t._nodes.get(e);return void 0===n&&r(30,e),n}(t,i);let s=n.get(i);void 0===s&&(s=Array.from(o.transforms),n.set(i,s));const l=s.length;for(let r=0;r<l&&(s[r](e),e.isAttached());r++);}function pr(t,e){return void 0!==t&&t.__key!==e&&t.isAttached()}function _r(t,e){if(!e)return;const n=t._updateTags;let r=e;Array.isArray(e)||(r=[e]);for(const i of r)n.add(i)}function mr(t,e){const n=t.type,i=e.get(n);void 0===i&&r(17,n);const o=i.klass;t.type!==o.getType()&&r(18,o.name);const s=o.importJSON(t),l=t.children;if(Er(s)&&Array.isArray(l))for(let r=0;r<l.length;r++){const t=mr(l[r],e);s.append(t)}return s}function yr(t,e,n){const r=nr,i=ir,o=rr;nr=e,ir=!0,rr=t;try{return n()}finally{nr=r,ir=i,rr=o}}function xr(t,e){const n=t._pendingEditorState,r=t._rootElement,i=t._headless||null===r;if(null===n)return;const o=t._editorState,s=o._selection,l=n._selection,c=0!==t._dirtyType,a=nr,u=ir,d=rr,f=t._updating,h=t._observer;let g=null;if(t._pendingEditorState=null,t._editorState=n,!i&&c&&null!==h){rr=t,nr=n,ir=!1,t._updating=!0;try{const e=t._dirtyType,r=t._dirtyElements,i=t._dirtyLeaves;h.disconnect(),g=function(t,e,n,r,i,o){ht="",mt="",gt="",yt=2===r,vt=null,it=n,rt=n._config,ot=n._nodes,st=it._listeners.mutation,lt=i,ct=o,at=t._nodeMap,ut=e._nodeMap,xt=e._readOnly,dt=new Map(n._keyToDOMMap);const s=new Map;return ft=s,Dt("root",null),it=void 0,ot=void 0,lt=void 0,ct=void 0,at=void 0,ut=void 0,rt=void 0,dt=void 0,ft=void 0,s}(o,n,t,e,r,i)}catch(e){if(e instanceof Error&&t._onError(e),or)throw e;return Xr(t,null,r,n),H(t),t._dirtyType=2,or=!0,xr(t,o),void(or=!1)}finally{h.observe(r,lr),t._updating=f,nr=a,ir=u,rr=d}}n._readOnly||(n._readOnly=!0);const _=t._dirtyLeaves,m=t._dirtyElements,y=t._normalizedNodes,x=t._updateTags,v=t._deferred;c&&(t._dirtyType=0,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements=new Map,t._normalizedNodes=new Set,t._updateTags=new Set),function(t,e){const n=t._decorators;let r=t._pendingDecorators||n;const i=e._nodeMap;let o;for(o in r)i.has(o)||(r===n&&(r=vi(t)),delete r[o])}(t,n);const C=i?null:ro(Xi(t));if(t._editable&&null!==C&&(c||null===l||l.dirty)&&null!==r&&!x.has(jr)){rr=t,nr=n;try{if(null!==h&&h.disconnect(),c||null===l||l.dirty){const e=t._blockCursorElement;null!==e&&no(e,t,r),function(t,e,n,r,i,o){const s=r.anchorNode,l=r.focusNode,c=r.anchorOffset,a=r.focusOffset,u=document.activeElement;if(i.has(Wr)&&u!==o||null!==u&&ri(u))return;if(!An(e))return void(null!==t&&ii(n,s,l)&&r.removeAllRanges());const d=e.anchor,f=e.focus,h=d.key,g=f.key,p=Ui(n,h),_=Ui(n,g),m=d.offset,y=f.offset,x=e.format,v=e.style,C=e.isCollapsed();let S=p,b=_,k=!1;if("text"===d.type){S=ui(p);const t=d.getNode();k=t.getFormat()!==x||t.getStyle()!==v}else An(t)&&"text"===t.anchor.type&&(k=!0);var T,w,E,N,M;if("text"===f.type&&(b=ui(_)),null!==S&&null!==b&&(C&&(null===t||k||An(t)&&(t.format!==x||t.style!==v))&&(T=x,w=v,E=m,N=h,M=performance.now(),Ke=[T,w,E,N,M]),c!==m||a!==y||s!==S||l!==b||"Range"===r.type&&C||(null!==u&&o.contains(u)||o.focus({preventScroll:!0}),"element"===d.type))){if(Gn(r,S,m,b,y),!i.has(Jr)&&e.isCollapsed()&&null!==o&&o===document.activeElement){const t=An(e)&&"element"===e.anchor.type?S.childNodes[m]||null:r.rangeCount>0?r.getRangeAt(0):null;if(null!==t){let e;if(t instanceof Text){const n=document.createRange();n.selectNode(t),e=n.getBoundingClientRect()}else e=t.getBoundingClientRect();!function(t,e,n){const r=Zi(n),i=Yi(r);if(null===r||null===i)return;let{top:o,bottom:s}=e,l=0,c=0,a=n;for(;null!==a;){const e=a===r.body;if(e)l=0,c=Xi(t).innerHeight;else{const t=a.getBoundingClientRect();l=t.top,c=t.bottom}let n=0;if(o<l?n=-(l-o):s>c&&(n=s-c),0!==n)if(e)i.scrollBy(0,n);else{const t=a.scrollTop;a.scrollTop+=n;const e=a.scrollTop-t;o-=e,s-=e}if(e)break;a=$i(a)}}(n,e,o)}}Ae=!0}}(s,l,t,C,x,r)}!function(t,e,n){let r=t._blockCursorElement;if(An(n)&&n.isCollapsed()&&"element"===n.anchor.type&&e.contains(document.activeElement)){const i=n.anchor,o=i.getNode(),s=i.offset;let l=!1,c=null;if(s===o.getChildrenSize())eo(o.getChildAtIndex(s-1))&&(l=!0);else{const e=o.getChildAtIndex(s);if(null!==e&&eo(e)){const n=e.getPreviousSibling();(null===n||eo(n))&&(l=!0,c=t.getElementByKey(e.__key))}}if(l){const n=t.getElementByKey(o.__key);return null===r&&(t._blockCursorElement=r=function(t){const e=t.theme,n=document.createElement("div");n.contentEditable="false",n.setAttribute("data-lexical-cursor","true");let r=e.blockCursor;if(void 0!==r){if("string"==typeof r){const t=p(r);r=e.blockCursor=t}void 0!==r&&n.classList.add(...r)}return n}(t._config)),e.style.caretColor="transparent",void(null===c?n.appendChild(r):n.insertBefore(r,c))}}null!==r&&no(r,t,e)}(t,r,l)}finally{null!==h&&h.observe(r,lr),rr=d,nr=a}}null!==g&&function(t,e,n,r,i){const o=Array.from(t._listeners.mutation),s=o.length;for(let l=0;l<s;l++){const[t,s]=o[l],c=e.get(s);void 0!==c&&t(c,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}(t,g,x,_,o),An(l)||null===l||null!==s&&s.is(l)||t.dispatchCommand(Kt,void 0);const S=t._pendingDecorators;null!==S&&(t._decorators=S,t._pendingDecorators=null,vr("decorator",t,!0,S)),function(t,e,n){const r=Ci(e),i=Ci(n);r!==i&&vr("textcontent",t,!0,i)}(t,e||o,n),vr("update",t,!0,{dirtyElements:m,dirtyLeaves:_,editorState:n,mutatedNodes:g,normalizedNodes:y,prevEditorState:e||o,tags:x}),function(t,e){if(t._deferred=[],0!==e.length){const n=t._updating;t._updating=!0;try{for(let t=0;t<e.length;t++)e[t]()}finally{t._updating=n}}}(t,v),function(t){const e=t._updates;if(0!==e.length){const n=e.shift();if(n){const[e,r]=n;Sr(t,e,r)}}}(t)}function vr(t,e,n,...r){const i=e._updating;e._updating=n;try{const n=Array.from(e._listeners[t]);for(let t=0;t<n.length;t++)n[t].apply(null,r)}finally{e._updating=i}}function Cr(t,e){const n=t._updates;let i=e||!1;for(;0!==n.length;){const e=n.shift();if(e){const[n,o]=e;let s;if(void 0!==o){if(s=o.onUpdate,o.skipTransforms&&(i=!0),o.discrete){const e=t._pendingEditorState;null===e&&r(191),e._flushSync=!0}s&&t._deferred.push(s),_r(t,o.tag)}n()}}return i}function Sr(t,e,n){const i=t._updateTags;let o,s=!1,l=!1;void 0!==n&&(o=n.onUpdate,_r(t,n.tag),s=n.skipTransforms||!1,l=n.discrete||!1),o&&t._deferred.push(o);const c=t._editorState;let a=t._pendingEditorState,u=!1;(null===a||a._readOnly)&&(a=t._pendingEditorState=Dr(a||c),u=!0),a._flushSync=l;const d=nr,f=ir,h=rr,g=t._updating;nr=a,ir=!1,t._updating=!0,rr=t;const p=t._headless||null===t.getRootElement();try{u&&(p?null!==c._selection&&(a._selection=c._selection.clone()):a._selection=function(t,e){const n=t.getEditorState()._selection,r=ro(Xi(t));return An(n)||null==n?qn(n,r,t,e):n.clone()}(t,n&&n.event||null));const i=t._compositionKey;e(),s=Cr(t,s),function(t,e){const n=e.getEditorState()._selection,r=t._selection;if(An(r)){const t=r.anchor,e=r.focus;let i;if("text"===t.type&&(i=t.getNode(),i.selectionTransform(n,r)),"text"===e.type){const t=e.getNode();i!==t&&t.selectionTransform(n,r)}}}(a,t),0!==t._dirtyType&&(s?function(t,e){const n=e._dirtyLeaves,r=t._nodeMap;for(const i of n){const t=r.get(i);Sn(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&tt(t)}}(a,t):function(t,e){const n=e._dirtyLeaves,r=e._dirtyElements,i=t._nodeMap,o=pi(),s=new Map;let l=n,c=l.size,a=r,u=a.size;for(;c>0||u>0;){if(c>0){e._dirtyLeaves=new Set;for(const t of l){const r=i.get(t);Sn(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&tt(r),void 0!==r&&pr(r,o)&&gr(e,r,s),n.add(t)}if(l=e._dirtyLeaves,c=l.size,c>0){sr++;continue}}e._dirtyLeaves=new Set,e._dirtyElements=new Map,a.delete("root")&&a.set("root",!0);for(const t of a){const n=t[0],l=t[1];if(r.set(n,l),!l)continue;const c=i.get(n);void 0!==c&&pr(c,o)&&gr(e,c,s)}l=e._dirtyLeaves,c=l.size,a=e._dirtyElements,u=a.size,sr++}e._dirtyLeaves=n,e._dirtyElements=r}(a,t),Cr(t),function(t,e,n,r){const i=t._nodeMap,o=e._nodeMap,s=[];for(const[l]of r){const t=o.get(l);void 0!==t&&(t.isAttached()||(Er(t)&&B(t,l,i,o,s,r),i.has(l)||r.delete(l),s.push(l)))}for(const l of s)o.delete(l);for(const l of n){const t=o.get(l);void 0===t||t.isAttached()||(i.has(l)||n.delete(l),o.delete(l))}}(c,a,t._dirtyLeaves,t._dirtyElements)),i!==t._compositionKey&&(a._flushSync=!0);const o=a._selection;if(An(o)){const t=a._nodeMap,e=o.focus.key;void 0!==t.get(o.anchor.key)&&void 0!==t.get(e)||r(19)}else Dn(o)&&0===o._nodes.size&&(a._selection=null)}catch(r){return r instanceof Error&&t._onError(r),t._pendingEditorState=c,t._dirtyType=2,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements.clear(),void xr(t)}finally{nr=d,ir=f,rr=h,t._updating=g,sr=0}const _=0!==t._dirtyType||t._deferred.length>0||function(t,e){const n=e.getEditorState()._selection,r=t._selection;if(null!==r){if(r.dirty||!r.is(n))return!0}else if(null!==n)return!0;return!1}(a,t);_?a._flushSync?(a._flushSync=!1,xr(t)):u&&ei(()=>{xr(t)}):(a._flushSync=!1,u&&(i.clear(),t._deferred=[],t._pendingEditorState=null))}function br(t,e,n){rr===t&&void 0===n?e():Sr(t,e,n)}class kr{constructor(t,e,n){this.element=t,this.before=e||null,this.after=n||null}withBefore(t){return new kr(this.element,t,this.after)}withAfter(t){return new kr(this.element,this.before,t)}withElement(t){return this.element===t?this:new kr(t,this.before,this.after)}insertChild(t){const e=this.before||this.getManagedLineBreak();return null!==e&&e.parentElement!==this.element&&r(222),this.element.insertBefore(t,e),this}removeChild(t){return t.parentElement!==this.element&&r(223),this.element.removeChild(t),this}replaceChild(t,e){return e.parentElement!==this.element&&r(224),this.element.replaceChild(t,e),this}getFirstChild(){const t=this.after?this.after.nextSibling:this.element.firstChild;return t===this.before||t===this.getManagedLineBreak()?null:t}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(t){null===t?this.removeManagedLineBreak():this.insertManagedLineBreak("decorator"===t&&(u||a))}removeManagedLineBreak(){const t=this.getManagedLineBreak();if(t){const e=this.element,n="IMG"===t.nodeName?t.nextSibling:null;n&&e.removeChild(n),e.removeChild(t),e.__lexicalLineBreak=void 0}}insertManagedLineBreak(t){const e=this.getManagedLineBreak();if(e){if(t===("IMG"===e.nodeName))return;this.removeManagedLineBreak()}const n=this.element,r=this.before,i=document.createElement("br");if(n.insertBefore(i,r),t){const t=document.createElement("img");t.setAttribute("data-lexical-linebreak","true"),t.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",t.alt="",n.insertBefore(t,i),n.__lexicalLineBreak=t}else n.__lexicalLineBreak=i}getFirstChildOffset(){let t=0;for(let e=this.after;null!==e;e=e.previousSibling)t++;return t}resolveChildIndex(t,e,n,r){if(n===this.element){const e=this.getFirstChildOffset();return[t,Math.min(e+t.getChildrenSize(),Math.max(e,r))]}const i=Tr(e,n);i.push(r);const o=Tr(e,this.element);let s=t.getIndexWithinParent();for(let l=0;l<o.length;l++){const t=i[l],e=o[l];if(void 0===t||t<e)break;if(t>e){s+=1;break}}return[t.getParentOrThrow(),s]}}function Tr(t,e){const n=[];let i=e;for(;i!==t&&null!==i;i=i.parentNode){let t=0;for(let e=i.previousSibling;null!==e;e=e.previousSibling)t++;n.push(t)}return i!==t&&r(225),n.reverse()}class wr extends Qe{constructor(t){super(t),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(t){super.afterCloneFrom(t),this.__first=t.__first,this.__last=t.__last,this.__size=t.__size,this.__indent=t.__indent,this.__format=t.__format,this.__style=t.__style,this.__dir=t.__dir,this.__textFormat=t.__textFormat,this.__textStyle=t.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const t=this.getFormat();return L[t]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const t=[];let e=this.getFirstChild();for(;null!==e;)t.push(e),e=e.getNextSibling();return t}getChildrenKeys(){const t=[];let e=this.getFirstChild();for(;null!==e;)t.push(e.__key),e=e.getNextSibling();return t}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()}isDirty(){const t=fr()._dirtyElements;return null!==t&&t.has(this.__key)}isLastChild(){const t=this.getLatest(),e=this.getParentOrThrow().getLastChild();return null!==e&&e.is(t)}getAllTextNodes(){const t=[];let e=this.getFirstChild();for(;null!==e;){if(Sn(e)&&t.push(e),Er(e)){const n=e.getAllTextNodes();t.push(...n)}e=e.getNextSibling()}return t}getFirstDescendant(){let t=this.getFirstChild();for(;Er(t);){const e=t.getFirstChild();if(null===e)break;t=e}return t}getLastDescendant(){let t=this.getLastChild();for(;Er(t);){const e=t.getLastChild();if(null===e)break;t=e}return t}getDescendantByIndex(t){const e=this.getChildren(),n=e.length;if(t>=n){const t=e[n-1];return Er(t)&&t.getLastDescendant()||t||null}const r=e[t];return Er(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const t=this.getLatest().__first;return null===t?null:_i(t)}getFirstChildOrThrow(){const t=this.getFirstChild();return null===t&&r(45,this.__key),t}getLastChild(){const t=this.getLatest().__last;return null===t?null:_i(t)}getLastChildOrThrow(){const t=this.getLastChild();return null===t&&r(96,this.__key),t}getChildAtIndex(t){const e=this.getChildrenSize();let n,r;if(t<e/2){for(n=this.getFirstChild(),r=0;null!==n&&r<=t;){if(r===t)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=e-1;null!==n&&r>=t;){if(r===t)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let t="";const e=this.getChildren(),n=e.length;for(let r=0;r<n;r++){const i=e[r];t+=i.getTextContent(),Er(i)&&r!==n-1&&!i.isInline()&&(t+=w)}return t}getTextContentSize(){let t=0;const e=this.getChildren(),n=e.length;for(let r=0;r<n;r++){const i=e[r];t+=i.getTextContentSize(),Er(i)&&r!==n-1&&!i.isInline()&&(t+=2)}return t}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(t){if(""!==t){const e=F[t];return!!(this.getFormat()&e)}return!1}hasTextFormat(t){const e=P[t];return!!(this.getTextFormat()&e)}getFormatFlags(t,e){return di(this.getLatest().__textFormat,t,e)}getTextStyle(){return this.getLatest().__textStyle}select(t,e){ar();const n=Un();let r=t,i=e;const o=this.getChildrenSize();if(!this.canBeEmpty())if(0===t&&0===e){const t=this.getFirstChild();if(Sn(t)||Er(t))return t.select(0,0)}else if(!(void 0!==t&&t!==o||void 0!==e&&e!==o)){const t=this.getLastChild();if(Sn(t)||Er(t))return t.select()}void 0===r&&(r=o),void 0===i&&(i=o);const s=this.__key;return An(n)?(n.anchor.set(s,r,"element"),n.focus.set(s,i,"element"),n.dirty=!0,n):jn(s,r,s,i,"element","element")}selectStart(){const t=this.getFirstDescendant();return t?t.selectStart():this.select()}selectEnd(){const t=this.getLastDescendant();return t?t.selectEnd():this.select()}clear(){const t=this.getWritable();return this.getChildren().forEach(t=>t.remove()),t}append(...t){return this.splice(this.getChildrenSize(),0,t)}setDirection(t){const e=this.getWritable();return e.__dir=t,e}setFormat(t){return this.getWritable().__format=""!==t?F[t]:0,this}setStyle(t){return this.getWritable().__style=t||"",this}setTextFormat(t){const e=this.getWritable();return e.__textFormat=t,e}setTextStyle(t){const e=this.getWritable();return e.__textStyle=t,e}setIndent(t){return this.getWritable().__indent=t,this}splice(t,e,n){const i=n.length,o=this.getChildrenSize(),s=this.getWritable();t+e<=o||r(226,String(t),String(e),String(o));const l=s.__key,c=[],a=[],u=this.getChildAtIndex(t+e);let d=null,f=o-e+i;if(0!==t)if(t===o)d=this.getLastChild();else{const e=this.getChildAtIndex(t);null!==e&&(d=e.getPreviousSibling())}if(e>0){let t=null===d?this.getFirstChild():d.getNextSibling();for(let n=0;n<e;n++){null===t&&r(100);const e=t.getNextSibling(),n=t.__key;fi(t.getWritable()),a.push(n),t=e}}let h=d;for(let g=0;g<i;g++){const t=n[g];null!==h&&t.is(h)&&(d=h=h.getPreviousSibling());const e=t.getWritable();e.__parent===l&&f--,fi(e);const i=t.__key;if(null===h)s.__first=i,e.__prev=null;else{const t=h.getWritable();t.__next=i,e.__prev=t.__key}t.__key===l&&r(76),e.__parent=l,c.push(i),h=t}if(t+e===o)null!==h&&(h.getWritable().__next=null,s.__last=h.__key);else if(null!==u){const t=u.getWritable();if(null!==h){const e=h.getWritable();t.__prev=h.__key,e.__next=u.__key}else t.__prev=null}if(s.__size=f,a.length){const t=Un();if(An(t)){const e=new Set(a),n=new Set(c),{anchor:r,focus:i}=t;Nr(r,e,n)&&Yn(r,r.getNode(),this,d,u),Nr(i,e,n)&&Yn(i,i.getNode(),this,d,u),0!==f||this.canBeEmpty()||Gi(this)||this.remove()}}return s}getDOMSlot(t){return new kr(t)}exportDOM(t){const{element:e}=super.exportDOM(t);if(io(e)){const t=this.getIndent();t>0&&(e.style.paddingInlineStart=40*t+"px");const n=this.getDirection();n&&(e.dir=n)}return{element:e}}exportJSON(){const t={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},e=this.getTextFormat(),n=this.getTextStyle();return 0!==e&&(t.textFormat=e),""!==n&&(t.textStyle=n),t}updateFromJSON(t){return super.updateFromJSON(t).setFormat(t.format).setIndent(t.indent).setDirection(t.direction).setTextFormat(t.textFormat||0).setTextStyle(t.textStyle||"")}insertNewAfter(t,e){return null}canIndent(){return!0}collapseAtStart(t){return!1}excludeFromCopy(t){return!1}canReplaceWith(t){return!0}canInsertAfter(t){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(t){return!1}extractWithChild(t,e,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(t,e){const n=this.getDOMSlot(t);let r=n.getFirstChild();for(let i=this.getFirstChild();i;i=i.getNextSibling()){const t=e.getElementByKey(i.getKey());null!==t&&(null==r?(n.insertChild(t),r=t):r!==t&&n.replaceChild(t,r),r=r.nextSibling)}}}function Er(t){return t instanceof wr}function Nr(t,e,n){let r=t.getNode();for(;r;){const t=r.__key;if(e.has(t)&&!n.has(t))return!0;r=r.getParent()}return!1}class Mr extends Qe{decorate(t,e){r(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Or(t){return t instanceof Mr}class Ar extends wr{static getType(){return"root"}static clone(){return new Ar}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){r(51)}getTextContent(){const t=this.__cachedText;return!cr()&&0!==fr()._dirtyType||null===t?super.getTextContent():t}remove(){r(52)}replace(t){r(53)}insertBefore(t){r(54)}insertAfter(t){r(55)}updateDOM(t,e){return!1}splice(t,e,n){for(const i of n)Er(i)||Or(i)||r(282);return super.splice(t,e,n)}static importJSON(t){return Si().updateFromJSON(t)}collapseAtStart(){return!0}}function Pr(t){return t instanceof Ar}function Dr(t){return new Ir(new Map(t._nodeMap))}function Fr(){return new Ir(new Map([["root",new Ar]]))}function Lr(t){const e=t.exportJSON(),n=t.constructor;if(e.type!==n.getType()&&r(130,n.name),Er(t)){const i=e.children;Array.isArray(i)||r(59,n.name);const o=t.getChildren();for(let t=0;t<o.length;t++){const e=Lr(o[t]);i.push(e)}}return e}class Ir{constructor(t,e){this._nodeMap=t,this._selection=e||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return 1===this._nodeMap.size&&null===this._selection}read(t,e){return yr(e&&e.editor||null,this,t)}clone(t){const e=new Ir(this._nodeMap,void 0===t?this._selection:t);return e._readOnly=!0,e}toJSON(){return yr(null,this,()=>({root:Lr(Si())}))}}const Rr="historic",Kr="history-push",Br="history-merge",zr="paste",Wr="collaboration",Jr="skip-scroll-into-view",jr="skip-dom-selection";class Vr extends wr{static getType(){return"artificial"}createDOM(t){return document.createElement("div")}}class qr extends wr{static getType(){return"paragraph"}static clone(t){return new qr(t.__key)}createDOM(t){const e=document.createElement("p"),n=zi(t.theme,"paragraph");return void 0!==n&&e.classList.add(...n),e}updateDOM(t,e,n){return!1}static importDOM(){return{p:t=>({conversion:Ur,priority:0})}}exportDOM(t){const{element:e}=super.exportDOM(t);if(io(e)){this.isEmpty()&&e.append(document.createElement("br"));const t=this.getFormatType();t&&(e.style.textAlign=t)}return{element:e}}static importJSON(t){return $r().updateFromJSON(t)}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle()}}insertNewAfter(t,e){const n=$r();n.setTextFormat(t.format),n.setTextStyle(t.style);const r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,e),n}collapseAtStart(){const t=this.getChildren();if(0===t.length||Sn(t[0])&&""===t[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function Ur(t){const e=$r();return t.style&&(e.setFormat(t.style.textAlign),function(t,e){const n=parseInt(t.style.paddingInlineStart,10)||0,r=Math.round(n/40);e.setIndent(r)}(t,e)),{node:e}}function $r(){return Qi(new qr)}function Zr(t){return t instanceof qr}const Hr=0,Yr=1;function Xr(t,e,n,r){const i=t._keyToDOMMap;i.clear(),t._editorState=Fr(),t._pendingEditorState=r,t._compositionKey=null,t._dirtyType=0,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements.clear(),t._normalizedNodes=new Set,t._updateTags=new Set,t._updates=[],t._blockCursorElement=null;const o=t._observer;null!==o&&(o.disconnect(),t._observer=null),null!==e&&(e.textContent=""),null!==n&&(n.textContent="",i.set("root",n))}function Gr(t){const e=t||{},n=rr,r=e.theme||{},i=void 0===t?n:e.parentEditor||null,o=e.disableEvents||!1,s=Fr(),l=e.namespace||(null!==i?i._config.namespace:Mi()),c=e.editorState,a=[Ar,fn,tn,kn,qr,Vr,...e.nodes||[]],{onError:u,html:d}=e,f=void 0===e.editable||e.editable;let h;if(void 0===t&&null!==n)h=n._nodes;else{h=new Map;for(let t=0;t<a.length;t++){let e=a[t],n=null,r=null;if("function"!=typeof e){const t=e;e=t.replace,n=t.with,r=t.withKlass||null}const i=e.getType(),o=e.transform(),s=new Set;null!==o&&s.add(o),h.set(i,{exportDOM:d&&d.export?d.export.get(e):void 0,klass:e,replace:n,replaceWithKlass:r,transforms:s})}}const g=new Qr(s,i,h,{disableEvents:o,namespace:l,theme:r},u||console.error,function(t,e){const n=new Map,r=new Set,i=t=>{Object.keys(t).forEach(e=>{let r=n.get(e);void 0===r&&(r=[],n.set(e,r)),r.push(t[e])})};return t.forEach(t=>{const e=t.klass.importDOM;if(null==e||r.has(e))return;r.add(e);const n=e.call(t.klass);null!==n&&i(n)}),e&&i(e),n}(h,d?d.import:void 0),f,t);return void 0!==c&&(g._pendingEditorState=c,g._dirtyType=2),g}class Qr{constructor(t,e,n,r,i,o,s,l){this._createEditorArgs=l,this._parentEditor=e,this._rootElement=null,this._editorState=t,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=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,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=Mi(),this._onError=i,this._htmlConversions=o,this._editable=s,this._headless=null!==e&&e._headless,this._window=null,this._blockCursorElement=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(t){const e=this._listeners.update;return e.add(t),()=>{e.delete(t)}}registerEditableListener(t){const e=this._listeners.editable;return e.add(t),()=>{e.delete(t)}}registerDecoratorListener(t){const e=this._listeners.decorator;return e.add(t),()=>{e.delete(t)}}registerTextContentListener(t){const e=this._listeners.textcontent;return e.add(t),()=>{e.delete(t)}}registerRootListener(t){const e=this._listeners.root;return t(this._rootElement,null),e.add(t),()=>{t(null,this._rootElement),e.delete(t)}}registerCommand(t,e,n){void 0===n&&r(35);const i=this._commands;i.has(t)||i.set(t,[new Set,new Set,new Set,new Set,new Set]);const o=i.get(t);void 0===o&&r(36,String(t));const s=o[n];return s.add(e),()=>{s.delete(e),o.every(t=>0===t.size)&&i.delete(t)}}registerMutationListener(t,e,n){const r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(t)).klass,i=this._listeners.mutation;i.set(e,r);const o=n&&n.skipInitialization;return void 0!==o&&o||this.initializeMutationListener(e,r),()=>{i.delete(e)}}getRegisteredNode(t){const e=this._nodes.get(t.getType());return void 0===e&&r(37,t.name),e}resolveRegisteredNodeAfterReplacements(t){for(;t.replaceWithKlass;)t=this.getRegisteredNode(t.replaceWithKlass);return t}initializeMutationListener(t,e){const n=this._editorState,r=po(n).get(e.getType());if(!r)return;const i=new Map;for(const o of r.keys())i.set(o,"created");i.size>0&&t(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(t,e){const n=this.getRegisteredNode(t);return n.transforms.add(e),n}registerNodeTransform(t,e){const n=this.registerNodeTransformToKlass(t,e),r=[n],i=n.replaceWithKlass;if(null!=i){const t=this.registerNodeTransformToKlass(i,e);r.push(t)}return function(t,e){const n=po(t.getEditorState()),r=[];for(const i of e){const t=n.get(i);t&&r.push(t)}0!==r.length&&t.update(()=>{for(const t of r)for(const e of t.keys()){const t=_i(e);t&&t.markDirty()}},null===t._pendingEditorState?{tag:Br}:void 0)}(this,r.map(t=>t.klass.getType())),()=>{r.forEach(t=>t.transforms.delete(e))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,e){return Vi(this,t,e)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){const e=this._rootElement;if(t!==e){const n=zi(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=t,Xr(this,e,t,r),null!==e&&(this._config.disableEvents||Xe(e),null!=n&&e.classList.remove(...n)),null!==t){const e=Yi(t),r=t.style;r.userSelect="text",r.whiteSpace="pre-wrap",r.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=e,this._dirtyType=2,H(this),this._updateTags.add(Br),xr(this),this._config.disableEvents||function(t,e){const n=t.ownerDocument,r=Oe.get(n);(void 0===r||r<1)&&n.addEventListener("selectionchange",Ze),Oe.set(n,(r||0)+1),t.__lexicalEditor=e;const i=Ue(t);for(let o=0;o<Te.length;o++){const[n,r]=Te[o],s="function"==typeof r?t=>{Ye(t)||(He(t),(e.isEditable()||"click"===n)&&r(t,e))}:t=>{if(Ye(t))return;He(t);const r=e.isEditable();switch(n){case"cut":return r&&Vi(e,pe,t);case"copy":return Vi(e,ge,t);case"paste":return r&&Vi(e,Vt,t);case"dragstart":return r&&Vi(e,de,t);case"dragover":return r&&Vi(e,fe,t);case"dragend":return r&&Vi(e,he,t);case"focus":return r&&Vi(e,Ce,t);case"blur":return r&&Vi(e,Se,t);case"drop":return r&&Vi(e,ue,t)}};t.addEventListener(n,s),i.push(()=>{t.removeEventListener(n,s)})}}(t,this),null!=n&&t.classList.add(...n)}else this._window=null,this._updateTags.add(Br),xr(this);vr("root",this,!1,t,e)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,e){t.isEmpty()&&r(38);let n=t;n._readOnly&&(n=Dr(t),n._selection=t._selection?t._selection.clone():null),Z(this);const i=this._pendingEditorState,o=this._updateTags,s=void 0!==e?e.tag:null;null===i||i.isEmpty()||(null!=s&&o.add(s),xr(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=s&&o.add(s),this._updating||xr(this)}parseEditorState(t,e){return function(t,e,n){const r=Fr(),i=nr,o=ir,s=rr,l=e._dirtyElements,c=e._dirtyLeaves,a=e._cloneNotNeeded,u=e._dirtyType;e._dirtyElements=new Map,e._dirtyLeaves=new Set,e._cloneNotNeeded=new Set,e._dirtyType=0,nr=r,ir=!1,rr=e;try{mr(t.root,e._nodes),n&&n(),r._readOnly=!0}catch(t){t instanceof Error&&e._onError(t)}finally{e._dirtyElements=l,e._dirtyLeaves=c,e._cloneNotNeeded=a,e._dirtyType=u,nr=i,ir=o,rr=s}return r}("string"==typeof t?JSON.parse(t):t,this,e)}read(t){return xr(this),this.getEditorState().read(t,{editor:this})}update(t,e){!function(t,e,n){t._updating?t._updates.push([e,n]):Sr(t,e,n)}(this,t,e)}focus(t,e={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),br(this,()=>{const r=Un(),i=Si();null!==r?r.dirty||ki(r.clone()):0!==i.getChildrenSize()&&("rootStart"===e.defaultSelection?i.selectStart():i.selectEnd()),ar(),fr()._updateTags.add("focus"),function(t){ar(),fr()._deferred.push(t)}(()=>{n.removeAttribute("autocapitalize"),t&&t()})}),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){const t=this._rootElement;null!==t&&t.blur();const e=ro(this._window);null!==e&&e.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,vr("editable",this,!0,t))}toJSON(){return{editorState:this._editorState.toJSON()}}}Qr.version="0.31.2+prod.esm";let ti=1;const ei="function"==typeof queueMicrotask?queueMicrotask:t=>{Promise.resolve().then(t)};function ni(t){return Or(xi(t))}function ri(t){const e=document.activeElement;if(!io(e))return!1;const n=e.nodeName;return Or(xi(t))&&("INPUT"===n||"TEXTAREA"===n||"true"===e.contentEditable&&null==li(e))}function ii(t,e,n){const r=t.getRootElement();try{return null!==r&&r.contains(e)&&r.contains(n)&&null!==e&&!ri(e)&&si(e)===t}catch(t){return!1}}function oi(t){return t instanceof Qr}function si(t){let e=t;for(;null!=e;){const t=li(e);if(oi(t))return t;e=$i(e)}return null}function li(t){return t?t.__lexicalEditor:null}function ci(t){return t.isToken()||t.isSegmented()}function ai(t){return oo(t)&&3===t.nodeType}function ui(t){let e=t;for(;null!=e;){if(ai(e))return e;e=e.firstChild}return null}function di(t,e,n){const r=P[e];if(null!==n&&(t&r)==(n&r))return t;let i=t^r;return"subscript"===e?i&=~P.superscript:"superscript"===e?i&=~P.subscript:"lowercase"===e?(i&=~P.uppercase,i&=~P.capitalize):"uppercase"===e?(i&=~P.lowercase,i&=~P.capitalize):"capitalize"===e&&(i&=~P.lowercase,i&=~P.uppercase),i}function fi(t){const e=t.getParent();if(null!==e){const n=t.getWritable(),r=e.getWritable(),i=t.getPreviousSibling(),o=t.getNextSibling(),s=null!==o?o.__key:null,l=null!==i?i.__key:null,c=null!==i?i.getWritable():null,a=null!==o?o.getWritable():null;null===i&&(r.__first=s),null===o&&(r.__last=l),null!==c&&(c.__next=s),null!==a&&(a.__prev=l),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function hi(t){ur();const e=t.getLatest(),n=e.__parent,r=dr(),i=fr(),o=i._dirtyElements;null!==n&&function(t,e,n){let r=t;for(;null!==r;){if(n.has(r))return;const t=e.get(r);if(void 0===t)break;n.set(r,!1),r=t.__parent}}(n,r._nodeMap,o);const s=e.__key;i._dirtyType=1,Er(t)?o.set(s,!0):i._dirtyLeaves.add(s)}function gi(t){ar();const e=fr(),n=e._compositionKey;if(t!==n){if(e._compositionKey=t,null!==n){const t=_i(n);null!==t&&t.getWritable()}if(null!==t){const e=_i(t);null!==e&&e.getWritable()}}}function pi(){return cr()?null:fr()._compositionKey}function _i(t,e){const n=(e||dr())._nodeMap.get(t);return void 0===n?null:n}function mi(t,e){const n=yi(t,fr());return void 0!==n?_i(n,e):null}function yi(t,e){return t[`__lexicalKey_${e._key}`]}function xi(t,e){let n=t;for(;null!=n;){const t=mi(n,e);if(null!==t)return t;n=$i(n)}return null}function vi(t){const e=Object.assign({},t._decorators);return t._pendingDecorators=e,e}function Ci(t){return t.read(()=>Si().getTextContent())}function Si(){return bi(dr())}function bi(t){return t._nodeMap.get("root")}function ki(t){ar();const e=dr();null!==t&&(t.dirty=!0,t.setCachedNodes(null)),e._selection=t}function Ti(t){const e=fr(),n=function(t,e){let n=t;for(;null!=n;){const t=yi(n,e);if(void 0!==t)return t;n=$i(n)}return null}(t,e);return null===n?t===e.getRootElement()?_i("root"):null:_i(n)}function wi(t,e){return e?t.getTextContentSize():0}function Ei(t){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(t)}function Ni(t){const e=[];let n=t;for(;null!==n;)e.push(n),n=n._parentEditor;return e}function Mi(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function Oi(t){return ai(t)?t.nodeValue:null}function Ai(t,e,n){const r=ro(Xi(e));if(null===r)return;const i=r.anchorNode;let{anchorOffset:o,focusOffset:s}=r;if(null!==i){let e=Oi(i);const r=xi(i);if(null!==e&&Sn(r)){if(e===T&&n){const t=n.length;e=n,o=t,s=t}null!==e&&Pi(r,e,o,s,t)}}}function Pi(t,e,n,r,i){let o=t;if(o.isAttached()&&(i||!o.isDirty())){const s=o.isComposing();let l=e;(s||i)&&e[e.length-1]===T&&(l=e.slice(0,-1));const c=o.getTextContent();if(i||l!==c){if(""===l){if(gi(null),a||u||g)o.remove();else{const t=fr();setTimeout(()=>{t.update(()=>{o.isAttached()&&o.remove()})},20)}return}const e=o.getParent(),i=$n(),c=o.getTextContentSize(),d=pi(),f=o.getKey();if(o.isToken()||null!==d&&f===d&&!s||An(i)&&(null!==e&&!e.canInsertTextBefore()&&0===i.anchor.offset||i.anchor.key===t.__key&&0===i.anchor.offset&&!o.canInsertTextBefore()&&!s||i.focus.key===t.__key&&i.focus.offset===c&&!o.canInsertTextAfter()&&!s))return void o.markDirty();const h=Un();if(!An(h)||null===n||null===r)return void o.setTextContent(l);if(h.setTextNodeRange(o,n,o,r),o.isSegmented()){const t=Cn(o.getTextContent());o.replace(t),o=t}o.setTextContent(l)}}}function Di(t,e,n){const r=e[n]||!1;return"any"===r||r===t[n]}function Fi(t,e,n){return function(t,e){return Di(t,e,"altKey")&&Di(t,e,"ctrlKey")&&Di(t,e,"shiftKey")&&Di(t,e,"metaKey")}(t,n)&&t.key.toLowerCase()===e.toLowerCase()}const Li={ctrlKey:!s,metaKey:s},Ii={altKey:s,ctrlKey:!s};function Ri(t){return"Backspace"===t.key}function Ki(t){return Fi(t,"a",Li)}function Bi(t){const e=Si();if(An(t)){const e=t.anchor,n=t.focus,r=e.getNode().getTopLevelElementOrThrow().getParentOrThrow();return e.set(r.getKey(),0,"element"),n.set(r.getKey(),r.getChildrenSize(),"element"),et(t),t}{const t=e.select(0,e.getChildrenSize());return ki(et(t)),t}}function zi(t,e){void 0===t.__lexicalClassNameCache&&(t.__lexicalClassNameCache={});const n=t.__lexicalClassNameCache,r=n[e];if(void 0!==r)return r;const i=t[e];if("string"==typeof i){const t=p(i);return n[e]=t,t}return i}function Wi(t,e,n,i,o){if(0===n.size)return;const s=i.__type,l=i.__key,c=e.get(s);void 0===c&&r(33,s);const a=c.klass;let u=t.get(a);void 0===u&&(u=new Map,t.set(a,u));const d=u.get(l),f="destroyed"===d&&"created"===o;(void 0===d||f)&&u.set(l,f?"updated":o)}function Ji(t,e,n){const r=t.getParent();let i=n,o=t;return null!==r&&(e&&0===n?(i=o.getIndexWithinParent(),o=r):e||n!==o.getChildrenSize()||(i=o.getIndexWithinParent()+1,o=r)),o.getChildAtIndex(e?i-1:i)}function ji(t){const e=Xi(t).event,n=e&&e.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function Vi(t,e,n){return function(t,e,n){const r=Ni(t);for(let i=4;i>=0;i--)for(let o=0;o<r.length;o++){const s=r[o],l=s._commands.get(e);if(void 0!==l){const e=l[i];if(void 0!==e){const r=Array.from(e),i=r.length;let o=!1;if(br(s,()=>{for(let e=0;e<i;e++)if(r[e](n,t))return void(o=!0)}),o)return o}}}return!1}(t,e,n)}function qi(t){return!Pr(t)&&!t.isLastChild()&&!t.isInline()}function Ui(t,e){const n=t._keyToDOMMap.get(e);return void 0===n&&r(75,e),n}function $i(t){const e=t.assignedSlot||t.parentElement;return so(e)?e.host:e}function Zi(t){return function(t){return oo(t)&&9===t.nodeType}(t)?t:io(t)?t.ownerDocument:null}function Hi(t,e){let n=t.getParent();for(;null!==n;){if(n.is(e))return!0;n=n.getParent()}return!1}function Yi(t){const e=Zi(t);return e?e.defaultView:null}function Xi(t){const e=t._window;return null===e&&r(78),e}function Gi(t){return Pr(t)||Er(t)&&t.isShadowRoot()}function Qi(t){const e=fr(),n=t.constructor.getType(),i=e._nodes.get(n);void 0===i&&r(200,t.constructor.name,n);const{replace:o,replaceWithKlass:s}=i;if(null!==o){const e=o(t),i=e.constructor;return null!==s?e instanceof s||r(201,s.name,s.getType(),i.name,i.getType(),t.constructor.name,n):e instanceof t.constructor&&i!==t.constructor||r(202,i.name,i.getType(),t.constructor.name,n),e.__key===t.__key&&r(203,t.constructor.name,n,i.name,i.getType()),e}return t}function to(t,e){!Pr(t.getParent())||Er(e)||Or(e)||r(99)}function eo(t){return(Or(t)||Er(t)&&!t.canBeEmpty())&&!t.isInline()}function no(t,e,n){n.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=t.parentElement;null!==r&&r.removeChild(t)}function ro(t){return i?(t||window).getSelection():null}function io(t){return oo(t)&&1===t.nodeType}function oo(t){return"object"==typeof t&&null!==t&&"nodeType"in t&&"number"==typeof t.nodeType}function so(t){return oo(t)&&11===t.nodeType}function lo(t){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return null!==t.nodeName.match(e)}function co(t){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 null!==t.nodeName.match(e)}function ao(t){if(Or(t)&&!t.isInline())return!0;if(!Er(t)||Gi(t))return!1;const e=t.getFirstChild(),n=null===e||rn(e)||Sn(e)||e.isInline();return!t.isInline()&&!1!==t.canBeEmpty()&&n}function uo(t,e){let n=t;for(;null!==n&&null!==n.getParent()&&!e(n);)n=n.getParentOrThrow();return e(n)?n:null}function fo(){return fr()}const ho=new WeakMap,go=new Map;function po(t){if(!t._readOnly&&t.isEmpty())return go;t._readOnly||r(192);let e=ho.get(t);return e||(e=function(t){const e=new Map;for(const[n,r]of t._nodeMap){const t=r.__type;let i=e.get(t);i||(i=new Map,e.set(t,i)),i.set(n,r)}return e}(t),ho.set(t,e)),e}function _o(t){const e=t.constructor.clone(t);return e.afterCloneFrom(t),e}function mo(t){return!0===t.__lexicalUnmanaged}const yo={next:"previous",previous:"next"};class xo{constructor(t){this.origin=t}[Symbol.iterator](){return Jo({hasNext:Eo,initial:this.getAdjacentCaret(),map:t=>t,step:t=>t.getAdjacentCaret()})}getAdjacentCaret(){return Po(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Po(this.origin,this.direction)}remove(){const t=this.getNodeAtCaret();return t&&t.remove(),this}replaceOrInsert(t,e){const n=this.getNodeAtCaret();return t.is(this.origin)||t.is(n)||(null===n?this.insert(t):n.replace(t,e)),this}splice(t,e,n="next"){const i=n===this.direction?e:Array.from(e).reverse();let o=this;const s=this.getParentAtCaret(),l=new Map;for(let r=o.getAdjacentCaret();null!==r&&l.size<t;r=r.getAdjacentCaret()){const t=r.origin.getWritable();l.set(t.getKey(),t)}for(const c of i){if(l.size>0){const t=o.getNodeAtCaret();if(t)if(l.delete(t.getKey()),l.delete(c.getKey()),t.is(c)||o.origin.is(c));else{const e=c.getParent();e&&e.is(s)&&c.remove(),t.replace(c)}else null===t&&r(263,Array.from(l).join(" "))}else o.insert(c);o=Po(c,this.direction)}for(const r of l.values())r.remove();return this}}class vo extends xo{type="child";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:Io(t,this.direction)}getParentCaret(t="root"){return Po(bo(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=So(this.direction);return Po(this.getNodeAtCaret(),t)||Io(this.origin,t)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof vo&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(t){return this.isSameNodeCaret(t)}}const Co={root:Pr,shadowRoot:Gi};function So(t){return yo[t]}function bo(t,e="root"){return Co[e](t)?null:t}class ko extends xo{type="sibling";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:Po(t,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return Er(this.origin)?Io(this.origin,this.direction):null}getParentCaret(t="root"){return Po(bo(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=So(this.direction);return Po(this.getNodeAtCaret(),t)||Io(this.origin.getParentOrThrow(),t)}isSamePointCaret(t){return t instanceof ko&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof ko||t instanceof To)&&this.direction===t.direction&&this.origin.is(t.origin)}}class To extends xo{type="text";constructor(t,e){super(t),this.offset=e}getLatest(){const t=this.origin.getLatest();return t===this.origin?this:Do(t,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(t="root"){return Po(bo(this.getParentAtCaret(),t),this.direction)}getFlipped(){return Do(this.origin,So(this.direction),this.offset)}isSamePointCaret(t){return t instanceof To&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof ko||t instanceof To)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return Po(this.origin,this.direction)}}function wo(t){return t instanceof To}function Eo(t){return t instanceof ko}function No(t){return t instanceof vo}const Mo={next:class extends To{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(t){return this.origin.insertAfter(t),this}},previous:class extends To{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t){return this.origin.insertBefore(t),this}}},Oo={next:class extends ko{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(t){return this.origin.insertAfter(t),this}},previous:class extends ko{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t){return this.origin.insertBefore(t),this}}},Ao={next:class extends vo{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(t){return this.origin.splice(0,0,[t]),this}},previous:class extends vo{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(t){return this.origin.splice(this.origin.getChildrenSize(),0,[t]),this}}};function Po(t,e){return t?new Oo[e](t):null}function Do(t,e,n){return t?new Mo[e](t,Fo(t,n)):null}function Fo(t,e){const n=t.getTextContentSize();let r="next"===e?n:"previous"===e?0:e;return(r<0||r>n)&&(function(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const i of e)r.append("v",i);n.search=r.toString()}(284,String(e),String(n),t.getKey()),r=r<0?0:n),r}function Lo(t,e){return new Bo(t,e)}function Io(t,e){return Er(t)?new Ao[e](t):null}function Ro(t){return t&&function(t){return t&&t.getChildCaret()||t}(t.getAdjacentCaret())}class Ko{type="node-caret-range";constructor(t,e,n){this.anchor=t,this.focus=e,this.direction=n}getLatest(){const t=this.anchor.getLatest(),e=this.focus.getLatest();return t===this.anchor&&e===this.focus?this:new Ko(t,e,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const t=t=>{const e=this[t].getLatest();return wo(e)?function(t,e){const{direction:n,origin:r}=t;return Lo(t,Fo(r,"focus"===e?So(n):n)-t.offset)}(e,t):null},e=t("anchor"),n=t("focus");if(e&&n){const{caret:t}=e,{caret:r}=n;if(t.isSameNodeCaret(r))return[Lo(t,r.offset-t.offset),null]}return[e,n]}iterNodeCarets(t="root"){const e=wo(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=wo(n),i=e=>e.isSameNodeCaret(n)?null:Ro(e)||e.getParentCaret(t);return Jo({hasNext:t=>null!==t&&!(r&&n.isSameNodeCaret(t)),initial:e.isSameNodeCaret(n)?null:i(e),map:t=>t,step:i})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class Bo{type="slice";constructor(t,e){this.caret=t,this.distance=e}getSliceIndices(){const{distance:t,caret:{offset:e}}=this,n=e+t;return n<e?[n,e]:[e,n]}getTextContent(){const[t,e]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(t,e)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:t,direction:e}}=this,[n,r]=this.getSliceIndices(),i=t.getTextContent();return Do(t.setTextContent(i.slice(0,n)+i.slice(r)),e,n)}}function zo(t){return Wo(t,Po(Si(),t.direction))}function Wo(t,e){return t.direction!==e.direction&&r(265),new Ko(t,e,t.direction)}function Jo(t){const{initial:e,hasNext:n,step:r,map:i}=t;let o=e;return{[Symbol.iterator](){return this},next(){if(!n(o))return{done:!0,value:void 0};const t={done:!1,value:i(o)};return o=r(o),t}}}function jo(t,e){const n=$o(t.origin,e.origin);switch(null===n&&r(275,t.origin.getKey(),e.origin.getKey()),n.type){case"same":{const n="text"===t.type,r="text"===e.type;return n&&r?function(t,e){return Math.sign(t-e)}(t.offset,e.offset):t.type===e.type?0:n?-1:r?1:"child"===t.type?-1:1}case"ancestor":return"child"===t.type?-1:1;case"descendant":return"child"===e.type?1:-1;case"branch":return Vo(n)}}function Vo(t){const{a:e,b:n}=t,r=e.__key,i=n.__key;let o=e,s=n;for(;o&&s;o=o.getNextSibling(),s=s.getNextSibling()){if(o.__key===i)return-1;if(s.__key===r)return 1}return null===o?1:-1}function qo(t,e){return e.is(t)}function Uo(t){return Er(t)?[t.getLatest(),null]:[t.getParent(),t.getLatest()]}function $o(t,e){if(t.is(e))return{commonAncestor:t,type:"same"};const n=new Map;for(let[r,i]=Uo(t);r;i=r,r=r.getParent())n.set(r,i);for(let[i,o]=Uo(e);i;o=i,i=i.getParent()){const s=n.get(i);if(void 0!==s)return null===s?(qo(t,i)||r(276),{commonAncestor:i,type:"ancestor"}):null===o?(qo(e,i)||r(277),{commonAncestor:i,type:"descendant"}):((Er(s)||qo(t,s))&&(Er(o)||qo(e,o))&&i.is(s.getParent())&&i.is(o.getParent())||r(278),{a:s,b:o,commonAncestor:i,type:"branch"})}return null}function Zo(t,e){const{type:n,key:i,offset:o}=t,s=function(t){const e=_i(t);return null===e&&r(63,t),e}(t.key);return"text"===n?(Sn(s)||r(266,s.getType(),i),Do(s,e,o)):(Er(s)||r(267,s.getType(),i),function(t,e,n){let r=Io(t,"next");for(let i=0;i<e;i++){const t=r.getAdjacentCaret();if(null===t)break;r=t}return is(r,n)}(s,t.offset,e))}function Ho(t,e){const{origin:n,direction:i}=e,o="next"===i;wo(e)?t.set(n.getKey(),e.offset,"text"):Eo(e)?Sn(n)?t.set(n.getKey(),Fo(n,i),"text"):t.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(o?1:0),"element"):(No(e)&&Er(n)||r(268),t.set(n.getKey(),o?0:n.getChildrenSize(),"element"))}function Yo(t,e){Ho(t.anchor,e.anchor),Ho(t.focus,e.focus)}function Xo(t){const{anchor:e,focus:n}=t,r=Zo(e,"next"),i=Zo(n,"next"),o=jo(r,i)<=0?"next":"previous";return Wo(is(r,o),is(i,o))}function Go(t){const{direction:e,origin:n}=t,r=Po(n,So(e)).getNodeAtCaret();return r?Po(r,e):Io(n.getParentOrThrow(),e)}function Qo(t,e="root"){const n=[t];for(let r=No(t)?t.getParentCaret(e):t.getSiblingCaret();null!==r;r=r.getParentCaret(e))n.push(Go(r));return n}function ts(t){return!!t&&t.origin.isAttached()}function es(t,e="removeEmptySlices"){if(t.isCollapsed())return t;const n="root",i="next";let o=e;const s=os(t,i),l=Qo(s.anchor,n),c=Qo(s.focus.getFlipped(),n),a=new Set,u=[];for(const r of s.iterNodeCarets(n))if(No(r))a.add(r.origin.getKey());else if(Eo(r)){const{origin:t}=r;Er(t)&&!a.has(t.getKey())||u.push(t)}for(const r of u)r.remove();for(const r of s.getTextSlices()){if(!r)continue;const{origin:t}=r.caret,e=t.getTextContentSize(),n=Go(Po(t,i)),s=t.getMode();if(Math.abs(r.distance)===e&&"removeEmptySlices"===o||"token"===s&&0!==r.distance)n.remove();else if(0!==r.distance){o="removeEmptySlices";let t=r.removeTextSlice();const e=r.caret.origin;if("segmented"===s){const e=t.origin,r=Cn(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());n.replaceOrInsert(r),t=Do(r,i,t.offset)}e.is(l[0].origin)&&(l[0]=t),e.is(c[0].origin)&&(c[0]=t.getFlipped())}}let d,f;for(const r of l)if(ts(r)){d=ns(r);break}for(const r of c)if(ts(r)){f=ns(r);break}const h=function(t,e,n){if(!t||!e)return null;const r=t.getParentAtCaret(),i=e.getParentAtCaret();if(!r||!i)return null;const o=r.getParents().reverse();o.push(r);const s=i.getParents().reverse();s.push(i);const l=Math.min(o.length,s.length);let c;for(c=0;c<l&&o[c]===s[c];c++);const a=(t,e)=>{let n;for(let r=c;r<t.length;r++){const i=t[r];if(Gi(i))return;!n&&e(i)&&(n=i)}return n},u=a(o,ao),d=u&&a(s,t=>n.has(t.getKey())&&ao(t));return u&&d?[u,d]:null}(d,f,a);if(h){const[t,e]=h;Io(t,"previous").splice(0,e.getChildren()),e.remove()}const g=[d,f,...l,...c].find(ts);if(g)return function(t){return Wo(t,t)}(is(ns(g),t.direction));r(269,JSON.stringify(l.map(t=>t.origin.__key)))}function ns(t){const e=function(t){let e=t;for(;No(e);){const t=Ro(e);if(!No(t))break;e=t}return e}(t.getLatest()),{direction:n}=e;if(Sn(e.origin))return wo(e)?e:Do(e.origin,n,n);const r=e.getAdjacentCaret();return Eo(r)&&Sn(r.origin)?Do(r.origin,n,So(n)):e}function rs(t){return wo(t)&&t.offset!==Fo(t.origin,t.direction)}function is(t,e){return t.direction===e?t:t.getFlipped()}function os(t,e){return t.direction===e?t:Wo(is(t.focus,e),is(t.anchor,e))}}}]);
Save
Back