1"use strict";(globalThis.webpackChunkpod001_frontend=globalThis.webpackChunkpod001_frontend||[]).push([[7236],{59917:(t,e,n)=>{n.d(e,{HY:()=>H,P_:()=>w,cE:()=>E,dC:()=>l,pN:()=>J,qL:()=>q,x5:()=>U});var r=n(61084),i=n(18824);const o=Symbol.for("preact-signals");function s(){if(d>1)return void d--;let t,e=!1;for(;void 0!==a;){let n=a;for(a=void 0,f++;void 0!==n;){const r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&_(n))try{n.c()}catch(n){e||(t=n,e=!0)}n=r}}if(f=0,d--,e)throw t}function l(t){if(d>0)return t();d++;try{return t()}finally{s()}}let c,a;function u(t){const e=c;c=void 0;try{return t()}finally{c=e}}let d=0,f=0,h=0;function g(t){if(void 0===c)return;let e=t.n;return void 0===e||e.t!==c?(e={i:0,S:t,p:c.s,n:void 0,t:c,e:void 0,x:void 0,r:e},void 0!==c.s&&(c.s.n=e),c.s=e,t.n=e,32&c.f&&t.S(e),e):-1===e.i?(e.i=0,void 0!==e.n&&(e.n.p=e.p,void 0!==e.p&&(e.p.n=e.n),e.p=c.s,e.n=void 0,c.s.n=e,c.s=e),e):void 0}function p(t,e){this.v=t,this.i=0,this.n=void 0,this.t=void 0,this.W=null==e?void 0:e.watched,this.Z=null==e?void 0:e.unwatched,this.name=null==e?void 0:e.name}function m(t,e){return new p(t,e)}function _(t){for(let e=t.s;void 0!==e;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function y(t){for(let e=t.s;void 0!==e;e=e.n){const n=e.S.n;if(void 0!==n&&(e.r=n),e.S.n=e,e.i=-1,void 0===e.n){t.s=e;break}}}function x(t){let e,n=t.s;for(;void 0!==n;){const t=n.p;-1===n.i?(n.S.U(n),void 0!==t&&(t.n=n.n),void 0!==n.n&&(n.n.p=t)):e=n,n.S.n=n.r,void 0!==n.r&&(n.r=void 0),n=t}t.s=e}function v(t,e){p.call(this,void 0),this.x=t,this.s=void 0,this.g=h-1,this.f=4,this.W=null==e?void 0:e.watched,this.Z=null==e?void 0:e.unwatched,this.name=null==e?void 0:e.name}function S(t){const e=t.u;if(t.u=void 0,"function"==typeof e){d++;const n=c;c=void 0;try{e()}catch(e){throw t.f&=-2,t.f|=8,C(t),e}finally{c=n,s()}}}function C(t){for(let e=t.s;void 0!==e;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,S(t)}function b(t){if(c!==this)throw new Error("Out-of-order effect");x(this),c=t,this.f&=-2,8&this.f&&C(this),s()}function N(t,e){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=null==e?void 0:e.name}function E(t,e){const n=new N(t,e);try{n.c()}catch(t){throw n.d(),t}const r=n.d.bind(n);return r[Symbol.dispose]=r,r}function w(t,e={}){const n={};for(const r in t){const i=e[r],o=m(void 0===i?t[r]:i);n[r]=o}return n}function k(){const t=(0,r.GvG)(),e=(0,r.dL7)(),n=(0,r.BEw)();t.clear(),t.append(n),null!==e&&n.select(),(0,r.OPZ)(e)&&(e.format=0)}function T(t){return("function"==typeof t.nodes?t.nodes():t.nodes)||[]}function O(t,e){let n;return m(t(),{unwatched(){n&&(n(),n=void 0)},watched(){this.value=t(),n=e(this)}})}p.prototype.brand=o,p.prototype.h=function(){return!0},p.prototype.S=function(t){const e=this.t;e!==t&&void 0===t.e&&(t.x=e,this.t=t,void 0!==e?e.e=t:u(()=>{var t;null==(t=this.W)||t.call(this)}))},p.prototype.U=function(t){if(void 0!==this.t){const e=t.e,n=t.x;void 0!==e&&(e.x=n,t.e=void 0),void 0!==n&&(n.e=e,t.x=void 0),t===this.t&&(this.t=n,void 0===n&&u(()=>{var t;null==(t=this.Z)||t.call(this)}))}},p.prototype.subscribe=function(t){return E(()=>{const e=this.value,n=c;c=void 0;try{t(e)}finally{c=n}},{name:"sub"})},p.prototype.valueOf=function(){return this.value},p.prototype.toString=function(){return this.value+""},p.prototype.toJSON=function(){return this.value},p.prototype.peek=function(){const t=c;c=void 0;try{return this.value}finally{c=t}},Object.defineProperty(p.prototype,"value",{get(){const t=g(this);return void 0!==t&&(t.i=this.i),this.v},set(t){if(t!==this.v){if(f>100)throw new Error("Cycle detected");this.v=t,this.i++,h++,d++;try{for(let t=this.t;void 0!==t;t=t.x)t.t.N()}finally{s()}}}}),v.prototype=new p,v.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===h)return!0;if(this.g=h,this.f|=1,this.i>0&&!_(this))return this.f&=-2,!0;const t=c;try{y(this),c=this;const t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return c=t,x(this),this.f&=-2,!0},v.prototype.S=function(t){if(void 0===this.t){this.f|=36;for(let t=this.s;void 0!==t;t=t.n)t.S.S(t)}p.prototype.S.call(this,t)},v.prototype.U=function(t){if(void 0!==this.t&&(p.prototype.U.call(this,t),void 0===this.t)){this.f&=-33;for(let t=this.s;void 0!==t;t=t.n)t.S.U(t)}},v.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let t=this.t;void 0!==t;t=t.x)t.t.N()}}
1,Object.defineProperty(v.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const t=g(this);if(this.h(),void 0!==t&&(t.i=this.i),16&this.f)throw this.v;return this.v}}),N.prototype.c=function(){const t=this.S();try{if(8&this.f)return;if(void 0===this.x)return;const t=this.x();"function"==typeof t&&(this.u=t)}finally{t()}},N.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,S(this),y(this),d++;const t=c;return c=this,b.bind(this,t)},N.prototype.N=function(){2&this.f||(this.f|=2,this.o=a,a=this)},N.prototype.d=function(){this.f|=8,1&this.f||C(this)},N.prototype.dispose=function(){this.d()},(0,r.qry)({build:(t,e,n)=>w(e),config:(0,r.AyS)({defaultSelection:"rootEnd",disabled:!1}),name:"@lexical/extension/AutoFocus",register(t,e,n){const r=n.getOutput();return E(()=>r.disabled.value?void 0:t.registerRootListener(e=>{t.focus(()=>{const t=document.activeElement;null===e||null!==t&&e.contains(t)||e.focus({preventScroll:!0})},{defaultSelection:r.defaultSelection.peek()})}))}}),(0,r.qry)({build:(t,e,n)=>w(e),config:(0,r.AyS)({$onClear:k}),name:"@lexical/extension/ClearEditor",register(t,e,n){const{$onClear:i}=n.getOutput();return E(()=>function(t,e=k){return t.registerCommand(r.BM6,n=>(t.update(e),!0),r.VNZ)}(t,i.value))}});const M=(0,r.qry)({build:t=>O(()=>t.getEditorState(),e=>t.registerUpdateListener(t=>{e.value=t.editorState})),name:"@lexical/extension/EditorState"});function P(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const t of e)r.append("v",t);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.`)}function A(t,e){if(t&&e&&!Array.isArray(e)&&"object"==typeof t&&"object"==typeof e){const n=t,r=e;for(const t in r)n[t]=A(n[t],r[t]);return t}return e}function L(t){return 0===t.id}function D(t){return 2===t.id}const F=new Set;class I{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(t,e){this.builder=t,this.extension=e,this.configs=new Set,this.state={id:0}}mergeConfigs(){let t=this.extension.config||{};const e=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):r.Psm;for(const n of this.configs)t=e(t,n);return t}init(t){const e=this.state;D(e)||P(306,String(e.id));const n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=function(t,e,n){return Object.assign(t,{config:e,id:3,registerState:n})}(e,this.mergeConfigs(),n);let o;this.state=i,this.extension.init&&(o=this.extension.init(t,i.config,n)),this.state=function(t,e,n){return Object.assign(t,{id:4,initResult:e,registerState:n})}(i,o,r)}build(t){const e=this.state;let n;4!==e.id&&P(307,String(e.id),String(5)),this.extension.build&&(n=this.extension.build(t,e.config,e.registerState));const r={...e.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(t,e,n){return Object.assign(t,{id:5,output:e,registerState:n})}(e,n,r)}register(t,e){this._signal=e;const n=this.state;5!==n.id&&P(308,String(n.id),String(5));const r=this.extension.register&&this.extension.register(t,n.config,n.registerState);return this.state=function(t){return Object.assign(t,{id:6})}(n),()=>{const t=this.state;7!==t.id&&P(309,String(n.id),String(7)),this.state=function(t){return Object.assign(t,{id:5})}(t),r&&r()}}afterRegistration(t){const e=this.state;let n;return 6!==e.id&&P(310,String(e.id),String(6)),this.extension.afterRegistration&&(n=this.extension.afterRegistration(t,e.config,e.registerState)),this.state=function(t){return Object.assign(t,{id:7})}(e),n}getSignal(){return void 0===this._signal&&P(311),this._signal}getInitResult(){void 0===this.extension.init&&P(312,this.extension.name);const t=this.state;return function(t){return t.id>=4}(t)||P(313,String(t.id),String(4)),t.initResult}getInitPeer(t){const e=this.builder.extensionNameMap.get(t);return e?e.getExtensionInitDependency():void 0}getExtensionInitDependency(){const t=this.state;return function(t){return t.id>=3}(t)||P(314,String(t.id),String(3)),{config:t.config}}getPeer(t){const e=this.builder.extensionNameMap.get(t);return e?e.getExtensionDependency():void 0}getInitDependency(t){const e=this.builder.getExtensionRep(t);return void 0===e&&P(315,this.extension.name,t.name),e.getExtensionInitDependency()}getDependency(t){const e=this.builder.getExtensionRep(t);return void 0===e&&P(315,this.extension.name,t.name),e.getExtensionDependency()}getState(){const t=this.state;return function(t){return t.id>=7}(t)||P(316,String(t.id),String(7)),t}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||F}getPeerNameSet(){let t=this._peerNameSet;
1return t||(t=new Set((this.extension.peerDependencies||[]).map(([t])=>t)),this._peerNameSet=t),t}getExtensionDependency(){if(!this._dependency){const t=this.state;(function(t){return t.id>=5})(t)||P(317,this.extension.name),this._dependency={config:t.config,init:t.initResult,output:t.output}}return this._dependency}}const R={tag:r.K3p};function K(){const t=(0,r.GvG)();t.isEmpty()&&t.append((0,r.BEw)())}const B=(0,r.qry)({config:(0,r.AyS)({setOptions:R,updateOptions:R}),init:({$initialEditorState:t=K})=>({$initialEditorState:t,initialized:!1}),afterRegistration(t,{updateOptions:e,setOptions:n},i){const o=i.getInitResult();if(!o.initialized){o.initialized=!0;const{$initialEditorState:i}=o;if((0,r.LJl)(i))t.setEditorState(i,n);else if("function"==typeof i)t.update(()=>{i(t)},e);else if(i&&("string"==typeof i||"object"==typeof i)){const e=t.parseEditorState(i);t.setEditorState(e,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[r.Zr1,r.R2r,r.wsJ,r.B9u,r.CKy]}),z=Symbol.for("@lexical/extension/LexicalBuilder");function W(){}function Z(t){throw t}function V(t){return Array.isArray(t)?t:[t]}const $="0.39.0+prod.esm";class J{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(t){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=$,this.roots=t;for(const e of t)this.addExtension(e)}static fromExtensions(t){const e=[V(B)];for(const n of t)e.push(V(n));return new J(e)}static maybeFromEditor(t){const e=t[z];return e&&(e.PACKAGE_VERSION!==$&&P(292,e.PACKAGE_VERSION,$),e instanceof J||P(293)),e}static fromEditor(t){const e=J.maybeFromEditor(t);return void 0===e&&P(294),e}constructEditor(){const{$initialEditorState:t,onError:e,...n}=this.buildCreateEditorArgs(),i=Object.assign((0,r.JhQ)({...n,...e?{onError:t=>{e(t,i)}}:{}}),{[z]:this});for(const t of this.sortedExtensionReps())t.build(i);return i}buildEditor(){let t=W;function e(){try{t()}finally{t=W}}const n=Object.assign(this.constructEditor(),{dispose:e,[Symbol.dispose]:e});
1return t=(0,i.qV)(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(t){return this.extensionNameMap.has(t)}getExtensionRep(t){const e=this.extensionNameMap.get(t.name);if(e)return e.extension!==t&&P(295,t.name),e}addEdge(t,e,n){const r=this.outgoingConfigEdges.get(t);r?r.set(e,n):this.outgoingConfigEdges.set(t,new Map([[e,n]]));const i=this.incomingEdges.get(e);i?i.add(t):this.incomingEdges.set(e,new Set([t]))}addExtension(t){void 0!==this._sortedExtensionReps&&P(296);const e=V(t),[n]=e;"string"!=typeof n.name&&P(297,typeof n.name);let r=this.extensionNameMap.get(n.name);if(void 0!==r&&r.extension!==n&&P(298,n.name),!r){r=new I(this,n),this.extensionNameMap.set(n.name,r);const t=this.conflicts.get(n.name);"string"==typeof t&&P(299,n.name,t);for(const t of n.conflictsWith||[])this.extensionNameMap.has(t)&&P(299,n.name,t),this.conflicts.set(t,n.name);for(const t of n.dependencies||[]){const e=V(t);this.addEdge(n.name,e[0].name,e.slice(1)),this.addExtension(e)}for(const[t,e]of n.peerDependencies||[])this.addEdge(n.name,t,e?[e]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const t=[],e=(n,r)=>{let i=n.state;if(D(i))return;const o=n.extension.name;var s;L(i)||P(300,o,r||"[unknown]"),L(s=i)||P(304,String(s.id),String(0)),i=Object.assign(s,{id:1}),n.state=i;const l=this.outgoingConfigEdges.get(o);if(l)for(const t of l.keys()){const n=this.extensionNameMap.get(t);n&&e(n,o)}i=function(t){return function(t){return 1===t.id}(t)||P(305,String(t.id),String(1)),Object.assign(t,{id:2})}(i),n.state=i,t.push(n)};for(const t of this.extensionNameMap.values())L(t.state)&&e(t);for(const e of t)for(const[t,n]of this.outgoingConfigEdges.get(e.extension.name)||[])if(n.length>0){const e=this.extensionNameMap.get(t);if(e)for(const t of n)e.configs.add(t)}for(const[t,...e]of this.roots)if(e.length>0){const n=this.extensionNameMap.get(t.name);void 0===n&&P(301,t.name);for(const t of e)n.configs.add(t)}return this._sortedExtensionReps=t,this._sortedExtensionReps}registerEditor(t){const e=this.sortedExtensionReps(),n=new AbortController,r=[()=>n.abort()],o=n.signal;for(const n of e){const e=n.register(t,o);e&&r.push(e)}for(const n of e){const e=n.afterRegistration(t);e&&r.push(e)}return(0,i.qV)(...r)}buildCreateEditorArgs(){const t={},e=new Set,n=new Map,r=new Map,i={},o={},s=this.sortedExtensionReps();for(const l of s){const{extension:s}=l;if(void 0!==s.onError&&(t.onError=s.onError),void 0!==s.disableEvents&&(t.disableEvents=s.disableEvents),void 0!==s.parentEditor&&(t.parentEditor=s.parentEditor),void 0!==s.editable&&(t.editable=s.editable),void 0!==s.namespace&&(t.namespace=s.namespace),void 0!==s.$initialEditorState&&(t.$initialEditorState=s.$initialEditorState),s.nodes)for(const t of T(s)){if("function"!=typeof t){const e=n.get(t.replace);e&&P(302,s.name,t.replace.name,e.extension.name),n.set(t.replace,l)}e.add(t)}if(s.html){if(s.html.export)for(const[t,e]of s.html.export.entries())r.set(t,e);s.html.import&&Object.assign(i,s.html.import)}s.theme&&A(o,s.theme)}Object.keys(o).length>0&&(t.theme=o),e.size&&(t.nodes=[...e]);const l=Object.keys(i).length>0,c=r.size>0;(l||c)&&(t.html={},l&&(t.html.import=i),c&&(t.html.export=r));for(const e of s)e.init(t);return t.onError||(t.onError=Z),t}}function U(t,e){const n=J.fromEditor(t).extensionNameMap.get(e);return n?n.getExtensionDependency():void 0}const j=new Set,G=(0,r.qry)({build(t,e,n){const i=n.getDependency(M).output,o=m({watchedNodeKeys:new Map}),s=O(()=>{},()=>E(()=>{const t=s.peek(),{watchedNodeKeys:e}=o.value;let n,l=!1;i.value.read(()=>{if((0,r.dL7)())for(const[i,o]of e.entries()){if(0===o.size){e.delete(i);continue}const s=(0,r.gID)(i),c=s&&s.isSelected()||!1;l=l||c!==(!!t&&t.has(i)),c&&(n=n||new Set,n.add(i))}}),!l&&n&&t&&n.size===t.size||(s.value=n)}));
1return{watchNodeKey:function(t){const e=function(t){return new v(t,void 0)}(()=>(s.value||j).has(t)),{watchedNodeKeys:n}=o.peek();let r=n.get(t);const i=void 0!==r;return r=r||new Set,r.add(e),i||(n.set(t,r),o.value={watchedNodeKeys:n}),e}}},dependencies:[M],name:"@lexical/extension/NodeSelection"}),q=(0,r.fAf)("INSERT_HORIZONTAL_RULE_COMMAND");class H extends r.Ijf{static getType(){return"horizontalrule"}static clone(t){return new H(t.__key)}static importJSON(t){return Y().updateFromJSON(t)}static importDOM(){return{hr:()=>({conversion:X,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(t){const e=document.createElement("hr");return(0,i.Yo)(e,t.theme.hr),e}getTextContent(){return"\n"}isInline(){return!1}updateDOM(){return!1}}function X(){return{node:Y()}}function Y(){return(0,r.dM9)(H)}(0,r.qry)({dependencies:[M,G],name:"@lexical/extension/HorizontalRule",nodes:()=>[H],register(t,e,n){const{watchNodeKey:o}=n.getDependency(G).output,s=m({nodeSelections:new Map}),c=t._config.theme.hrSelected??"selected";return(0,i.qV)(t.registerCommand(r.Kr$,t=>{if((0,r.uFG)(t.target)){const e=(0,r.Qqf)(t.target);if(function(t){return t instanceof H}(e))return function(t,e=!1){const n=(0,r.dL7)(),i=t.isSelected(),o=t.getKey();let s;e&&(0,r.iOo)(n)?s=n:(s=(0,r.h5h)(),(0,r.oqs)(s)),i?s.delete(o):s.add(o)}(e,t.shiftKey),!0}return!1},r.KB),t.registerMutationListener(H,(e,n)=>{l(()=>{let n=!1;const{nodeSelections:r}=s.peek();for(const[i,s]of e.entries())if("destroyed"===s)r.delete(i),n=!0;else{const e=r.get(i),s=t.getElementByKey(i);e?e.domNode.value=s:(n=!0,r.set(i,{domNode:m(s),selectedSignal:o(i)}))}n&&(s.value={nodeSelections:r})})}),E(()=>{const t=[];for(const{domNode:e,selectedSignal:n}of s.value.nodeSelections.values())t.push(E(()=>{const t=e.value;t&&(n.value?(0,i.Yo)(t,c):(0,i.PS)(t,c))}));return(0,i.qV)(...t)}))}}),(0,r.qry)({build:(t,e,n)=>w(e),config:(0,r.AyS)({disabled:!1,maxIndent:null}),name:"@lexical/extension/TabIndentation",register(t,e,n){const{disabled:o,maxIndent:s}=n.getOutput();return E(()=>{if(!o.value)return function(t,e){return(0,i.qV)(t.registerCommand(r.dB,e=>{const n=(0,r.dL7)();if(!(0,r.OPZ)(n))return!1;e.preventDefault();const o=function(t){const e=t.getNodes();if((0,i.Or)(e,t=>(0,r.ekx)(t)&&t.canIndent()?t:null).length>0)return!0;const n=t.anchor,o=t.focus,s=o.isBefore(n)?o:n,l=s.getNode(),c=(0,i.f8)(l);if(c.canIndent()){const t=c.getKey();let e=(0,r.vNz)();if(e.anchor.set(t,0,"element"),e.focus.set(t,0,"element"),e=(0,r.S9_)(e),e.anchor.is(s))return!0}return!1}(n)?e.shiftKey?r.czB:r.PUH:r.cAC;return t.dispatchCommand(o,void 0)},r.VNZ),t.registerCommand(r.PUH,()=>{const t="number"==typeof e?e:e?e.peek():null;if(null==t)return!1;const n=(0,r.dL7)();if(!(0,r.OPZ)(n))return!1;const o=n.getNodes().map(t=>(0,i.f8)(t).getIndent());return Math.max(...o)+1>=t},r.jwz))}(t,s)})}})},70573:(t,e,n)=>{n.d(e,{S:()=>s,s:()=>o});var r=n(10261),i=n(61084);function o(t,e){const n=(0,i.xHj)(e)?e.body.childNodes:e.childNodes;let r=[];const o=[];for(const e of n)if(!c.has(e.nodeName)){const n=a(e,t,o,!1);null!==n&&(r=r.concat(n))}return function(t){for(const e of t)e.getNextSibling()instanceof i.RGD&&e.insertAfter((0,i.Tav)());for(const e of t){const t=e.getChildren();for(const n of t)e.insertBefore(n);e.remove()}}(o),r}function s(t,e){if("undefined"==typeof document||"undefined"==typeof window&&void 0===global.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,i.GvG)().getChildren();for(let i=0;i<r.length;i++)l(t,r[i],n,e);return n.innerHTML}function l(t,e,n,o=null){let s=null===o||e.isSelected(o);const c=(0,i.F7b)(e)&&e.excludeFromCopy("html");let a=e;null!==o&&(0,i.Gg4)(e)&&(a=(0,r.bA)(o,e,"clone"));const u=(0,i.F7b)(a)?a.getChildren():[],d=(0,i.aAG)(t,a.getType());let f;f=d&&void 0!==d.exportDOM?d.exportDOM(t,a):a.exportDOM(t);const{element:h,after:g}=f;if(!h)return!1;const p=document.createDocumentFragment();for(let n=0;n<u.length;n++){const r=u[n],c=l(t,r,p,o);!s&&(0,i.F7b)(e)&&c&&e.extractWithChild(r,o,"html")&&(s=!0)}if(s&&!c){if(((0,i.Ret)(h)||(0,i.ULs)(h))&&h.append(p),n.append(h),g){const t=g.call(a,h);t&&((0,i.ULs)(h)?h.replaceChildren(t):h.replaceWith(t))}}else n.append(p);return s}const c=new Set(["STYLE","SCRIPT"]);function a(t,e,n,r,o=new Map,s){let l=[];
1if(c.has(t.nodeName))return l;let u=null;const d=function(t,e){const{nodeName:n}=t,r=e._htmlConversions.get(n.toLowerCase());let i=null;if(void 0!==r)for(const e of r){const n=e(t);null!==n&&(null===i||(i.priority||0)<=(n.priority||0))&&(i=n)}return null!==i?i.conversion:null}(t,e),f=d?d(t):null;let h=null;if(null!==f){h=f.after;const e=f.node;if(u=Array.isArray(e)?e[e.length-1]:e,null!==u){for(const[,t]of o)if(u=t(u,s),!u)break;u&&l.push(...Array.isArray(e)?e:[u])}null!=f.forChild&&o.set(t.nodeName,f.forChild)}const g=t.childNodes;let p=[];const m=(null==u||!(0,i._vQ)(u))&&(null!=u&&(0,i.ekx)(u)||r);for(let t=0;t<g.length;t++)p.push(...a(g[t],e,n,m,new Map(o),u));return null!=h&&(p=h(p)),(0,i.lvZ)(t)&&(p=function(t,e,n){const r=t.style.textAlign,o=[];let s=[];for(let t=0;t<e.length;t++){const l=e[t];if((0,i.ekx)(l))r&&!l.getFormat()&&l.setFormat(r),o.push(l);else if(s.push(l),t===e.length-1||t<e.length-1&&(0,i.ekx)(e[t+1])){const t=n();t.setFormat(r),t.append(...s),o.push(t),s=[]}}return o}(t,p,m?()=>{const t=new i.RGD;return n.push(t),t}:i.BEw)),null==u?p.length>0?l=l.concat(p):(0,i.lvZ)(t)&&function(t){return null!=t.nextSibling&&null!=t.previousSibling&&(0,i.u8R)(t.nextSibling)&&(0,i.u8R)(t.previousSibling)}(t)&&(l=l.concat((0,i.Tav)())):(0,i.F7b)(u)&&u.append(...p),l}},88560:(t,e,n)=>{n.d(e,{EG:()=>k,NK:()=>C,To:()=>J,dA:()=>$});var r=n(59917),i=n(18824),o=n(61084),s=n(10261);function l(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const t of e)r.append("v",t);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.`)}function c(t){let e=1,n=t.getParent();for(;null!=n;){if(w(n)){const t=n.getParent();if(L(t)){e++,n=t.getParent();continue}l(40)}return e}return e}function a(t){let e=t.getParent();L(e)||l(40);let n=e;for(;null!==n;)n=n.getParent(),L(n)&&(e=n);return e}function u(t){let e=[];const n=t.getChildren().filter(w);for(let t=0;t<n.length;t++){const r=n[t],i=r.getFirstChild();L(i)?e=e.concat(u(i)):e.push(r)}return e}function d(t){return w(t)&&L(t.getFirstChild())}function f(t){return E().append(t)}function h(t,e){return w(t)&&(0===e.length||1===e.length&&t.is(e[0])&&0===t.getChildrenSize())}function g(t){const e=(0,o.dL7)();if(null!==e){let n=e.getNodes();if((0,o.OPZ)(e)){const r=e.getStartEndPoints();null===r&&l(143);const[i]=r,s=i.getNode(),c=s.getParent();if((0,o._vQ)(s)){const t=s.getFirstChild();if(t)n=t.selectStart().getNodes();else{const t=(0,o.BEw)();s.append(t),n=t.select().getNodes()}}else if(h(s,n)){const e=A(t);if((0,o._vQ)(c)){s.replace(e);const t=E();(0,o.F7b)(s)&&(t.setFormat(s.getFormatType()),t.setIndent(s.getIndent())),e.append(t)}else if(w(s)){const t=s.getParentOrThrow();p(e,t.getChildren()),t.replace(e)}return}}const r=new Set;for(let e=0;e<n.length;e++){const i=n[e];if((0,o.F7b)(i)&&i.isEmpty()&&!w(i)&&!r.has(i.getKey())){m(i,t);continue}let s=(0,o.H2R)(i)?i.getParent():w(i)&&i.isEmpty()?i:null;for(;null!=s;){const e=s.getKey();if(L(s)){if(!r.has(e)){const n=A(t);p(n,s.getChildren()),s.replace(n),r.add(e)}break}{const n=s.getParent();if((0,o._vQ)(n)&&!r.has(e)){r.add(e),m(s,t);break}s=n}}}}}function p(t,e){t.splice(t.getChildrenSize(),0,e)}function m(t,e){if(L(t))return t;const n=t.getPreviousSibling(),r=t.getNextSibling(),i=E();let o;if(p(i,t.getChildren()),L(n)&&e===n.getListType())n.append(i),L(r)&&e===r.getListType()&&(p(n,r.getChildren()),r.remove()),o=n;else if(L(r)&&e===r.getListType())r.getFirstChildOrThrow().insertBefore(i),o=r;else{const n=A(e);n.append(i),t.replace(n),o=n}return i.setFormat(t.getFormatType()),i.setIndent(t.getIndent()),t.remove(),o}function _(t,e){const n=t.getLastChild(),r=e.getFirstChild();n&&r&&d(n)&&d(r)&&(_(n.getFirstChild(),r.getFirstChild()),r.remove());const i=e.getChildren();i.length>0&&t.append(...i),e.remove()}function y(t){const e="check"!==t.getListType();let n=t.getStart();for(const r of t.getChildren())w(r)&&(r.getValue()!==n&&r.setValue(n),e&&null!=r.getLatest().__checked&&r.setChecked(void 0),L(r.getFirstChild())||n++)}function x(t){const e=new Set;if(d(t)||e.has(t.getKey()))return;const n=t.getParent(),r=t.getNextSibling(),i=t.getPreviousSibling();if(d(r)&&d(i)){const n=i.getFirstChild();if(L(n)){n.append(t);const i=r.getFirstChild();L(i)&&(p(n,i.getChildren()),r.remove(),e.add(r.getKey()))}}else if(d(r)){const e=r.getFirstChild();if(L(e)){const n=e.getFirstChild();null!==n&&n.insertBefore(t)}}else if(d(i)){const e=i.getFirstChild();
1L(e)&&e.append(t)}else if(L(n)){const e=E().setTextFormat(t.getTextFormat()).setTextStyle(t.getTextStyle()),o=A(n.getListType()).setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle());e.append(o),o.append(t),i?i.insertAfter(e):r?r.insertBefore(e):n.append(e)}}function v(t){if(d(t))return;const e=t.getParent(),n=e?e.getParent():void 0;if(L(n?n.getParent():void 0)&&w(n)&&L(e)){const r=e?e.getFirstChild():void 0,i=e?e.getLastChild():void 0;if(t.is(r))n.insertBefore(t),e.isEmpty()&&n.remove();else if(t.is(i))n.insertAfter(t),e.isEmpty()&&n.remove();else{const r=e.getListType(),i=E(),o=A(r);i.append(o),t.getPreviousSiblings().forEach(t=>o.append(t));const s=E(),l=A(r);s.append(l),p(l,t.getNextSiblings()),n.insertBefore(i),n.insertAfter(s),n.replace(t)}}}function S(...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}class C extends o.HX${__value;__checked;$config(){return this.config("listitem",{$transform:t=>{if(null==t.__checked)return;const e=t.getParent();L(e)&&"check"!==e.getListType()&&null!=t.getChecked()&&t.setChecked(void 0)},extends:o.HX$,importDOM:(0,o.tM8)({li:()=>({conversion:b,priority:0})})})}constructor(t=1,e=void 0,n){super(n),this.__value=void 0===t?1:t,this.__checked=e}afterCloneFrom(t){super.afterCloneFrom(t),this.__value=t.__value,this.__checked=t.__checked}createDOM(t){const e=document.createElement("li");return this.updateListItemDOM(null,e,t),e}updateListItemDOM(t,e,n){!function(t,e,n){const r=e.getParent();!L(r)||"check"!==r.getListType()||L(e.getFirstChild())?(t.removeAttribute("role"),t.removeAttribute("tabIndex"),t.removeAttribute("aria-checked")):(t.setAttribute("role","checkbox"),t.setAttribute("tabIndex","-1"),n&&e.__checked===n.__checked||t.setAttribute("aria-checked",e.getChecked()?"true":"false"))}(e,this,t),e.value=this.__value,function(t,e,n){const r=[],o=[],s=e.list,l=s?s.listitem:void 0;let c;if(s&&s.nested&&(c=s.nested.listitem),void 0!==l&&r.push(...S(l)),s){const t=n.getParent(),e=L(t)&&"check"===t.getListType(),i=n.getChecked();e&&!i||o.push(s.listitemUnchecked),e&&i||o.push(s.listitemChecked),e&&r.push(i?s.listitemChecked:s.listitemUnchecked)}if(void 0!==c){const t=S(c);n.getChildren().some(t=>L(t))?r.push(...t):o.push(...t)}o.length>0&&(0,i.PS)(t,...o),r.length>0&&(0,i.Yo)(t,...r)}(e,n.theme,this);const r=t?t.__style:"",o=this.__style;r!==o&&(""===o?e.removeAttribute("style"):e.style.cssText=o),function(t,e,n){const r=(0,s.c1)(e.__textStyle);for(const e in r)t.style.setProperty(`--listitem-marker-${e}`,r[e]);if(n)for(const e in(0,s.c1)(n.__textStyle))e in r||t.style.removeProperty(`--listitem-marker-${e}`)}(e,this,t)}updateDOM(t,e,n){const r=e;return this.updateListItemDOM(t,r,n),!1}updateFromJSON(t){return super.updateFromJSON(t).setValue(t.value).setChecked(t.checked)}exportDOM(t){const e=this.createDOM(t._config),n=this.getFormatType();n&&(e.style.textAlign=n);const r=this.getDirection();return r&&(e.dir=r),{element:e}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...t){for(let e=0;e<t.length;e++){const n=t[e];if((0,o.F7b)(n)&&this.canMergeWith(n)){const t=n.getChildren();this.append(...t),n.remove()}else super.append(n)}return this}replace(t,e){if(w(t))return super.replace(t);this.setIndent(0);const n=this.getParentOrThrow();if(!L(n))return t;if(n.__first===this.getKey())n.insertBefore(t);else if(n.__last===this.getKey())n.insertAfter(t);else{const e=A(n.getListType());let r=this.getNextSibling();for(;r;){const t=r;r=r.getNextSibling(),e.append(t)}n.insertAfter(t),t.insertAfter(e)}
1return e&&((0,o.F7b)(t)||l(139),this.getChildren().forEach(e=>{t.append(e)})),this.remove(),0===n.getChildrenSize()&&n.remove(),t}insertAfter(t,e=!0){const n=this.getParentOrThrow();if(L(n)||l(39),w(t))return super.insertAfter(t,e);const r=this.getNextSiblings();if(n.insertAfter(t,e),0!==r.length){const i=A(n.getListType());r.forEach(t=>i.append(t)),t.insertAfter(i,e)}return t}remove(t){const e=this.getPreviousSibling(),n=this.getNextSibling();super.remove(t),e&&n&&d(e)&&d(n)&&(_(e.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(t,e=!0){const n=E().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(n,e),n}collapseAtStart(t){const e=(0,o.BEw)();this.getChildren().forEach(t=>e.append(t));const n=this.getParentOrThrow(),r=n.getParentOrThrow(),i=w(r);if(1===n.getChildrenSize())if(i)n.remove(),r.select();else{n.insertBefore(e),n.remove();const r=t.anchor,i=t.focus,o=e.getKey();"element"===r.type&&r.getNode().is(this)&&r.set(o,r.offset,"element"),"element"===i.type&&i.getNode().is(this)&&i.set(o,i.offset,"element")}else n.insertBefore(e),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(t){const e=this.getWritable();return e.__value=t,e}getChecked(){const t=this.getLatest();let e;const n=this.getParent();return L(n)&&(e=n.getListType()),"check"===e?Boolean(t.__checked):void 0}setChecked(t){const e=this.getWritable();return e.__checked=t,e}toggleChecked(){const t=this.getWritable();return t.setChecked(!t.__checked)}getIndent(){const t=this.getParent();if(null===t||!this.isAttached())return this.getLatest().__indent;let e=t.getParentOrThrow(),n=0;for(;w(e);)e=e.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(t){"number"!=typeof t&&l(117),(t=Math.floor(t))>=0||l(199);let e=this.getIndent();for(;e!==t;)e<t?(x(this),e++):(v(this),e--);return this}canInsertAfter(t){return w(t)}canReplaceWith(t){return w(t)}canMergeWith(t){return w(t)||(0,o.Rlh)(t)}extractWithChild(t,e){if(!(0,o.OPZ)(e))return!1;const n=e.anchor.getNode(),r=e.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&this.getTextContent().length===e.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return A("bullet")}canMergeWhenEmpty(){return!0}}function b(t){if(t.classList.contains("task-list-item"))for(const e of t.children)if("INPUT"===e.tagName)return N(e);if(t.classList.contains("joplin-checkbox"))for(const e of t.children)if(e.classList.contains("checkbox-wrapper")&&e.children.length>0&&"INPUT"===e.children[0].tagName)return N(e.children[0]);const e=t.getAttribute("aria-checked");return{node:E("true"===e||"false"!==e&&void 0)}}function N(t){return"checkbox"!==t.getAttribute("type")?{node:null}:{node:E(t.hasAttribute("checked"))}}function E(t){return(0,o.U2B)(new C(void 0,t))}function w(t){return t instanceof C}class k extends o.HX${__tag;__start;__listType;$config(){return this.config("list",{$transform:t=>{!function(t){const e=t.getNextSibling();L(e)&&t.getListType()===e.getListType()&&_(t,e)}(t),y(t)},extends:o.HX$,importDOM:(0,o.tM8)({ol:()=>({conversion:M,priority:0}),ul:()=>({conversion:M,priority:0})})})}constructor(t="number",e=1,n){super(n);const r=P[t]||t;this.__listType=r,this.__tag="number"===r?"ol":"ul",this.__start=e}afterCloneFrom(t){super.afterCloneFrom(t),this.__listType=t.__listType,this.__tag=t.__tag,this.__start=t.__start}getTag(){return this.getLatest().__tag}setListType(t){const e=this.getWritable();return e.__listType=t,e.__tag="number"===t?"ol":"ul",e}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(t){const e=this.getWritable();return e.__start=t,e}createDOM(t,e){const n=this.__tag,r=document.createElement(n);return 1!==this.__start&&r.setAttribute("start",String(this.__start)),r.__lexicalListType=this.__listType,T(r,t.theme,this),r}updateDOM(t,e,n){return t.__tag!==this.__tag||t.__listType!==this.__listType||(T(e,n.theme,this),!1)}updateFromJSON(t){return super.updateFromJSON(t).setListType(t.listType).setStart(t.start)}exportDOM(t){const e=this.createDOM(t._config,t);return(0,o.Ret)(e)&&(1!==this.__start&&e.setAttribute("start",String(this.__start)),"check"===this.__listType&&e.setAttribute("__lexicalListType","check")),{element:e}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(t,e,n){let r=n;for(let t=0;t<n.length;t++){const e=n[t];w(e)||(r===n&&(r=[...n]),r[t]=E().append(!(0,o.F7b)(e)||L(e)||e.isInline()?e:(0,o.MXo)(e.getTextContent())))}return super.splice(t,e,r)}extractWithChild(t){return w(t)}}function T(t,e,n){const r=[],o=[],s=e.list;if(void 0!==s){const t=s[`${n.__tag}Depth`]||[],e=c(n)-1,i=e%t.length,l=t[i],a=s[n.__tag];let u;const d=s.nested,f=s.checklist;if(void 0!==d&&d.list&&(u=d.list),void 0!==a&&r.push(a),void 0!==f&&"check"===n.__listType&&r.push(f),void 0!==l){r.push(...S(l));for(let e=0;e<t.length;e++)e!==i&&o.push(n.__tag+e)}if(void 0!==u){const t=S(u);e>1?r.push(...t):o.push(...t)}}o.length>0&&(0,i.PS)(t,...o),r.length>0&&(0,i.Yo)(t,...r)}function O(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n];if(w(r)){e.push(r);const t=r.getChildren();t.length>1&&t.forEach(t=>{L(t)&&e.push(f(t))})}else e.push(f(r))}return e}function M(t){const e=t.nodeName.toLowerCase();let n=null;return"ol"===e?n=A("number",t.start):"ul"===e&&(n=function(t){if("check"===t.getAttribute("__lexicallisttype")||t.classList.contains("contains-task-list")||"1"===t.getAttribute("data-is-checklist"))return!0;for(const e of t.childNodes)if((0,o.Ret)(e)&&e.hasAttribute("aria-checked"))return!0;return!1}(t)?A("check"):A("bullet")),{after:O,node:n}}const P={ol:"number",ul:"bullet"};function A(t="number",e=1){return(0,o.U2B)(new k(t,e))}function L(t){return t instanceof k}const D=(0,o.fAf)("INSERT_CHECK_LIST_COMMAND");function F(t,e){const n=t.target;if(!(0,o.Ret)(n))return;const r=n.firstChild;if((0,o.Ret)(r)&&("UL"===r.tagName||"OL"===r.tagName))return;const s=n.parentNode;if(!s||"check"!==s.__lexicalListType)return;const l=n.getBoundingClientRect(),c=(0,i.MZ)(n),a=t.clientX/c,u=window.getComputedStyle?window.getComputedStyle(n,"::before"):{width:"0px"},d=parseFloat(u.width),f="touch"===t.pointerType?32:0;("rtl"===n.dir?a<l.right+f&&a>l.right-d-f:a>l.left-f&&a<l.left+d+f)&&e()}function I(t){F(t,()=>{if((0,o.Ret)(t.target)){const e=t.target,n=(0,o.mry)(e);null!=n&&n.isEditable()&&n.update(()=>{const t=(0,o.Xod)(e);w(t)&&(e.focus(),t.toggleChecked())})}})}function R(t){F(t,()=>{t.preventDefault()})}function K(){const t=document.activeElement;return(0,o.Ret)(t)&&"LI"===t.tagName&&null!=t.parentNode&&"check"===t.parentNode.__lexicalListType?t:null}function B(t,e,n){const r=K();return null!=r&&e.update(()=>{const i=(0,o.Xod)(r);if(!w(i))return;const s=function(t,e){let n=e?t.getPreviousSibling():t.getNextSibling(),r=t;for(;null==n&&w(r);)r=r.getParentOrThrow().getParent(),null!=r&&(n=e?r.getPreviousSibling():r.getNextSibling());for(;w(n);){const t=e?n.getLastChild():n.getFirstChild();if(!L(t))return n;n=e?t.getLastChild():t.getFirstChild()}return null}(i,n);if(null!=s){s.selectStart();const n=e.getElementByKey(s.__key);null!=n&&(t.preventDefault(),setTimeout(()=>{n.focus()},0))}}),!1}const z=(0,o.fAf)("UPDATE_LIST_START_COMMAND"),W=(0,o.fAf)("INSERT_UNORDERED_LIST_COMMAND"),Z=(0,o.fAf)("INSERT_ORDERED_LIST_COMMAND"),V=(0,o.fAf)("REMOVE_LIST_COMMAND");function $(t){return(0,i.qV)(t.registerCommand(Z,()=>(g("number"),!0),o.KB),t.registerCommand(z,t=>{const{listNodeKey:e,newStart:n}=t,r=(0,o.gID)(e);return!!L(r)&&("number"===r.getListType()&&(r.setStart(n),y(r)),!0)},o.KB),t.registerCommand(W,()=>(g("bullet"),!0),o.KB),t.registerCommand(V,()=>(function(){const t=(0,o.dL7)();if((0,o.OPZ)(t)){const e=new Set,n=t.getNodes(),r=t.anchor.getNode();if(h(r,n))e.add(a(r));else for(let t=0;t<n.length;t++){const r=n[t];if((0,o.H2R)(r)){const t=(0,i.yD)(r,C);null!=t&&e.add(a(t))}}for(const n of e){let e=n;const r=u(n);for(const n of r){const r=(0,o.BEw)().setTextStyle(t.style).setTextFormat(t.format);
1p(r,n.getChildren()),e.insertAfter(r),e=r,n.__key===t.anchor.key&&(0,o.qnv)(t.anchor,(0,o.LN)((0,o.CFn)(r,"next"))),n.__key===t.focus.key&&(0,o.qnv)(t.focus,(0,o.LN)((0,o.CFn)(r,"next"))),n.remove()}n.remove()}}}(),!0),o.KB),t.registerCommand(o.K0p,()=>function(){const t=(0,o.dL7)();if(!(0,o.OPZ)(t)||!t.isCollapsed())return!1;const e=t.anchor.getNode();if(!w(e)||0!==e.getChildrenSize())return!1;const n=a(e),r=e.getParent();L(r)||l(40);const i=r.getParent();let s;if((0,o._vQ)(i))s=(0,o.BEw)(),n.insertAfter(s);else{if(!w(i))return!1;s=E(),i.insertAfter(s)}s.setTextStyle(t.style).setTextFormat(t.format).select();const c=e.getNextSiblings();if(c.length>0){const t=A(r.getListType());if(w(s)){const e=E();e.append(t),s.insertAfter(e)}else s.insertAfter(t);t.append(...c)}return function(t){let e=t;for(;null==e.getNextSibling()&&null==e.getPreviousSibling();){const t=e.getParent();if(null==t||!w(t)&&!L(t))break;e=t}e.remove()}(e),!0}(),o.KB),t.registerNodeTransform(C,t=>{const e=t.getFirstChild();if(e){if((0,o.Gg4)(e)){const n=e.getStyle(),r=e.getFormat();t.getTextStyle()!==n&&t.setTextStyle(n),t.getTextFormat()!==r&&t.setTextFormat(r)}}else{const e=(0,o.dL7)();(0,o.OPZ)(e)&&(e.style!==t.getTextStyle()||e.format!==t.getTextFormat())&&e.isCollapsed()&&t.is(e.anchor.getNode())&&t.setTextStyle(e.style).setTextFormat(e.format)}}),t.registerNodeTransform(o.R2r,t=>{const e=t.getParent();if(w(e)&&t.is(e.getFirstChild())){const n=t.getStyle(),r=t.getFormat();n===e.getTextStyle()&&r===e.getTextFormat()||e.setTextStyle(n).setTextFormat(r)}}))}function J(t){const e=t=>{const e=t.getParent();if(L(t.getFirstChild())||!L(e))return;const n=(0,o.$sg)(t,t=>w(t)&&L(t.getParent())&&w(t.getPreviousSibling()));if(null===n&&t.getIndent()>0)t.setIndent(0);else if(w(n)){const r=n.getPreviousSibling();if(w(r)){const n=function(t){let e=t,n=e.getFirstChild();for(;L(n);){const t=n.getLastChild();if(!w(t))break;e=t,n=e.getFirstChild()}return e}(r),i=n.getParent();if(L(i)){const n=c(i);n+1<c(e)&&t.setIndent(n)}}}};return t.registerNodeTransform(k,t=>{const n=[t];for(;n.length>0;){const t=n.shift();if(L(t))for(const r of t.getChildren())if(w(r)){e(r);const t=r.getFirstChild();L(t)&&n.push(t)}}})}const U=(0,o.qry)({build:(t,e,n)=>(0,r.P_)(e),config:(0,o.AyS)({hasStrictIndent:!1}),name:"@lexical/list/List",nodes:()=>[k,C],register(t,e,n){const o=n.getOutput();return(0,i.qV)($(t),(0,r.cE)(()=>o.hasStrictIndent.value?J(t):void 0))}});(0,o.qry)({dependencies:[U],name:"@lexical/list/CheckList",register:function(t){return(0,i.qV)(t.registerCommand(D,()=>(g("check"),!0),o.KB),t.registerCommand(o.Zbz,e=>B(e,t,!1),o.KB),t.registerCommand(o._0$,e=>B(e,t,!0),o.KB),t.registerCommand(o.ZqX,()=>{if(null!=K()){const e=t.getRootElement();return null!=e&&e.focus(),!0}return!1},o.KB),t.registerCommand(o.Y7p,e=>{const n=K();return!(null==n||!t.isEditable()||(t.update(()=>{const t=(0,o.Xod)(n);w(t)&&(e.preventDefault(),t.toggleChecked())}),0))},o.KB),t.registerCommand(o.u$Z,e=>t.getEditorState().read(()=>{const n=(0,o.dL7)();if((0,o.OPZ)(n)&&n.isCollapsed()){const{anchor:r}=n,i="element"===r.type;if(i||0===r.offset){const n=r.getNode(),s=(0,o.$sg)(n,t=>(0,o.F7b)(t)&&!t.isInline());if(w(s)){const r=s.getParent();if(L(r)&&"check"===r.getListType()&&(i||s.getFirstDescendant()===n)){const n=t.getElementByKey(s.__key);if(null!=n&&document.activeElement!==n)return n.focus(),e.preventDefault(),!0}}}}return!1}),o.KB),t.registerRootListener((t,e)=>{null!==t&&(t.addEventListener("click",I),t.addEventListener("pointerdown",R)),null!==e&&(e.removeEventListener("click",I),e.removeEventListener("pointerdown",R))}))}})},21041:(t,e,n)=>{n.d(e,{C:()=>o});var r=n(46895),i=n(67294);function o({defaultSelection:t}){const[e]=(0,r.g)();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}},40999:(t,e,n)=>{n.d(e,{R:()=>u});var r=n(46895),i=n(61084),o=n(67294),s=n(85893);const l="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,c=l?o.useLayoutEffect:o.useEffect,a={tag:i.K3p};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.LI)(null,e),f=(0,i.JhQ)({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.GvG)();if(e.isEmpty()){const n=(0,i.BEw)();e.append(n);const r=l?document.activeElement:null;(null!==(0,i.dL7)()||null!==r&&r===t.getRootElement())&&n.select()}},a);else if(null!==e)switch(typeof e){case"string":{const n=t.parseEditorState(e);
1t.setEditorState(n,a);break}case"object":t.setEditorState(e,a);break;case"function":t.update(()=>{(0,i.GvG)().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.YK.Provider,{value:n,children:e})}},46895:(t,e,n)=>{n.d(e,{LI:()=>o,YK:()=>i,g:()=>s});var r=n(67294);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 t of e)r.append("v",t);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}},16177:(t,e,n)=>{n.d(e,{f:()=>d});var r=n(46895),i=n(67294),o=n(85893),s=n(5487),l=n(18824);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:m,className:_,id:y,role:x="textbox",spellCheck:v=!0,style:S,tabIndex:C,"data-testid":b,...N},E){const[w,k]=(0,i.useState)(t.isEditable()),T=(0,i.useCallback)(e=>{e&&e.ownerDocument&&e.ownerDocument.defaultView?t.setRootElement(e):t.setRootElement(null)},[t]),O=(0,i.useMemo)(()=>function(...t){return e=>{for(const n of t)"function"==typeof n?n(e):null!=n&&(n.current=e)}}(E,T),[T,E]);return c(()=>(k(t.isEditable()),t.registerEditableListener(t=>{k(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:m,className:_,contentEditable:w,"data-testid":b,id:y,ref:O,role:x,spellCheck:v,style:S,tabIndex:C,...N})});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.g)();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.qV)(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})}},89357:(t,e,n)=>{n.d(e,{g:()=>o});var r=n(79427),i=n(85893);function o({children:t,onError:e}){return(0,i.jsx)(r.SV,{fallback:(0,i.jsx)("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:t})}},51385:(t,e,n)=>{n.d(e,{e:()=>d});var r=n(46895),i=n(59917),o=n(18824),s=n(61084);function l(t){t.undoStack=[],t.redoStack=[],t.current=null}function c(t,e,n){const r=function(t,e){let n=Date.now(),r=0;return(i,o,l,c,a,u)=>{const d=Date.now();if(u.has(s.ON8))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 o=e._selection,l=t._selection;if(i)return 1;if(!((0,s.OPZ)(o)&&(0,s.OPZ)(l)&&l.isCollapsed()&&o.isCollapsed()))return 0;const c=function(t,e,n){const r=t._nodeMap,i=[];for(const t of e){const e=r.get(t);void 0!==e&&i.push(e)}for(const[t,e]of n){if(!e)continue;const n=r.get(t);void 0===n||(0,s.wdB)(n)||i.push(n)}return i}(e,n,r);if(0===c.length)return 0;if(c.length>1){const n=e._nodeMap,r=n.get(o.anchor.key),i=n.get(l.anchor.key);
1return r&&i&&!t._nodeMap.has(r.__key)&&(0,s.Gg4)(r)&&1===r.__text.length&&1===o.anchor.offset?2:0}const a=c[0],u=t._nodeMap.get(a.__key);if(!(0,s.Gg4)(u)||!(0,s.Gg4)(a)||u.__mode!==a.__mode)return 0;const d=u.__text,f=a.__text;if(d===f)return 0;const h=o.anchor,g=l.anchor;if(h.key!==g.key||"text"!==h.type)return 0;const p=h.offset,m=g.offset,_=f.length-d.length;return 1===_&&m===p-1?2:-1===_&&m===p+1?3:-1===_&&m===p?4:0}(i,o,c,a,t.isComposing()),h=(()=>{const h=null===l||l.editor===t,g=u.has(s.D7_);if(!g&&h&&u.has(s.K3p))return 0;if(null===i)return 1;const p=o._selection;if(!(c.size>0||a.size>0))return null!==p?0:2;const m="number"==typeof e?e:e.peek();return!1===g&&0!==f&&f===r&&d<n+m&&h||1===c.size&&function(t,e,n){const r=e._nodeMap.get(t),i=n._nodeMap.get(t),o=e._selection,l=n._selection;return!((0,s.OPZ)(o)&&(0,s.OPZ)(l)&&"element"===o.anchor.type&&"element"===o.focus.type&&"text"===l.anchor.type&&"text"===l.focus.type||!(0,s.Gg4)(r)||!(0,s.Gg4)(i)||r.__parent!==i.__parent)&&JSON.stringify(e.read(()=>r.exportJSON()))===JSON.stringify(n.read(()=>i.exportJSON()))}(Array.from(c)[0],i,o)?0:1})();return n=d,r=f,h}}(t,n),i=(0,o.qV)(t.registerCommand(s.$le,()=>(function(t,e){const n=e.redoStack,r=e.undoStack;if(0!==r.length){const i=e.current,o=r.pop();null!==i&&(n.push(i),t.dispatchCommand(s.r04,!0)),0===r.length&&t.dispatchCommand(s.ynn,!1),e.current=o||null,o&&o.editor.setEditorState(o.editorState,{tag:s.ON8})}}(t,e),!0),s.VNZ),t.registerCommand(s.zqW,()=>(function(t,e){const n=e.redoStack,r=e.undoStack;if(0!==n.length){const i=e.current;null!==i&&(r.push(i),t.dispatchCommand(s.ynn,!0));const o=n.pop();0===n.length&&t.dispatchCommand(s.r04,!1),e.current=o||null,o&&o.editor.setEditorState(o.editorState,{tag:s.ON8})}}(t,e),!0),s.VNZ),t.registerCommand(s.BM6,()=>(l(e),!1),s.VNZ),t.registerCommand(s.Nrv,()=>(l(e),t.dispatchCommand(s.r04,!1),t.dispatchCommand(s.ynn,!1),!0),s.VNZ),t.registerUpdateListener(({editorState:n,prevEditorState:i,dirtyLeaves:o,dirtyElements:l,tags:c})=>{const a=e.current,u=e.redoStack,d=e.undoStack,f=null===a?null:a.editorState;if(null!==a&&n===f)return;const h=r(i,n,a,o,l,c);if(1===h)0!==u.length&&(e.redoStack=[],t.dispatchCommand(s.r04,!1)),null!==a&&(d.push({...a}),t.dispatchCommand(s.ynn,!0));else if(2===h)return;e.current={editor:t,editorState:n}}));return i}const a=(0,s.qry)({build:(t,{delay:e,createInitialHistoryState:n,disabled:r})=>(0,i.P_)({delay:e,disabled:r,historyState:n(t)}),config:(0,s.AyS)({createInitialHistoryState:function(){return{current:null,redoStack:[],undoStack:[]}},delay:300,disabled:"undefined"==typeof window}),name:"@lexical/history/History",register:(t,e,n)=>{const r=n.getOutput();return(0,i.cE)(()=>r.disabled.value?void 0:c(t,r.historyState.value,r.delay))}});(0,s.qry)({dependencies:[(0,s.UDx)(a,{createInitialHistoryState:()=>{throw new Error("SharedHistory did not inherit parent history")},disabled:!0})],name:"@lexical/history/SharedHistory",register(t,e,n){const{output:r}=n.getDependency(a),o=function(t){return t?(0,i.x5)(t,a.name):null}(t._parentEditor);if(!o)return()=>{};const s=o.output;return(0,i.cE)(()=>(0,i.dC)(()=>{r.delay.value=s.delay.value,r.historyState.value=s.historyState.value,r.disabled.value=s.disabled.value}))}});var u=n(67294);function d({delay:t,externalHistoryState:e}){const[n]=(0,r.g)();return function(t,e,n=1e3){const r=(0,u.useMemo)(()=>e||{current:null,redoStack:[],undoStack:[]},[e]);(0,u.useEffect)(()=>c(t,r,n),[n,t,r])}(n,e,t),null}},59875:(t,e,n)=>{n.d(e,{f:()=>g});var r=n(46895),i=n(59917),o=n(61084),s=n(67294);function l(t,e){return t.getEditorState().read(()=>{const t=(0,o.gID)(e);return null!==t&&t.isSelected()})}var c=n(18824),a=n(85893);function u({nodeKey:t}){const[e]=(0,r.g)(),[n,i,a]=function(t){const[e]=(0,r.g)(),[n,i]=(0,s.useState)(()=>l(e,t));return(0,s.useEffect)(()=>{let n=!0;const r=e.registerUpdateListener(()=>{n&&i(l(e,t))});return()=>{n=!1,r()}},[e,t]),[n,(0,s.useCallback)(n=>{e.update(()=>{let e=(0,o.dL7)();(0,o.iOo)(e)||(e=(0,o.h5h)(),(0,o.oqs)(e)),(0,o.iOo)(e)&&(n?e.add(t):e.delete(t))})},[e,t]),(0,s.useCallback)(()=>{e.update(()=>{const t=(0,o.dL7)();(0,o.iOo)(t)&&t.clear()})},[e])]}(t);return(0,s.useEffect)(()=>(0,c.qV)(e.registerCommand(o.Kr$,r=>{const o=e.getElementByKey(t);return r.target===o&&(r.shiftKey||a(),i(!n),!0)},o.KB)),[a,e,n,t,i]),(0,s.useEffect)(()=>{const r=e.getElementByKey(t),i=e._config.theme.hrSelected??"selected";null!==r&&(n?(0,c.Yo)(r,i):(0,c.PS)(r,i))},[e,n,t]),null}class d extends i.HY{static getType(){return"horizontalrule"}static clone(t){return new d(t.__key)}static importJSON(t){return h().updateFromJSON(t)}static importDOM(){return{hr:()=>({conversion:f,priority:0})}}decorate(){return(0,a.jsx)(u,{nodeKey:this.__key})}}function f(){return{node:h()}}function h(){return(0,o.U2B)(new d)}function g(){const[t]=(0,r.g)();return(0,s.useEffect)(()=>t.registerCommand(i.qL,t=>{const e=(0,o.dL7)();if(!(0,o.OPZ)(e))return!1;if(null!==e.focus.getNode()){const t=h();(0,c.z8)(t)}return!0},o.VNZ),[t]),null}},12242:(t,e,n)=>{n.d(e,{B:()=>s});var r=n(88560),i=n(46895),o=n(67294);function s({hasStrictIndent:t=!1}){const[e]=(0,i.g)();return(0,o.useEffect)(()=>
1{if(!e.hasNodes([r.EG,r.NK]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[e]),(0,o.useEffect)(()=>{if(t)return(0,r.To)(e)},[e,t]),n=e,(0,o.useEffect)(()=>(0,r.dA)(n),[n]),null;var n}},28635:(t,e,n)=>{n.d(e,{$:()=>l});var r=n(46895),i=n(61084),o=n(67294);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.g)();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.K3p)||c.isEmpty()||n(r,o,a)})},[o,t,e,n]),null}},39855:(t,e,n)=>{n.d(e,{B:()=>Q});var r=n(46895),i=n(67294);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(59917),c=n(61084);const a=(0,c.qry)({name:"@lexical/react/ReactProvider"});var u=n(73935),d=n(85893),f=n(5487),h=n(18824);function g(t){const e=window.location.origin,n=n=>{if(n.origin!==e)return;const r=t.getRootElement();if(document.activeElement!==r)return;const i=n.data;if("string"==typeof i){let e;try{e=JSON.parse(i)}catch(t){return}if(e&&"nuanria_messaging"===e.protocol&&"request"===e.type){const r=e.payload;if(r&&"makeChanges"===r.functionId){const e=r.args;if(e){const[r,i,o,s,l]=e;t.update(()=>{const t=(0,c.dL7)();if((0,c.OPZ)(t)){const e=t.anchor;let a=e.getNode(),u=0,d=0;if((0,c.Gg4)(a)&&r>=0&&i>=0&&(u=r,d=r+i,t.setTextNodeRange(a,u,a,d)),u===d&&""===o||(t.insertRawText(o),a=e.getNode()),(0,c.Gg4)(a)){u=s,d=s+l;const e=a.getTextContentSize();u=u>e?e:u,d=d>e?e:d,t.setTextNodeRange(a,u,a,d)}n.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}const p=(0,c.qry)({build:(t,e,n)=>(0,l.P_)(e),config:(0,c.AyS)({disabled:"undefined"==typeof window}),name:"@lexical/dragon",register:(t,e,n)=>(0,l.cE)(()=>n.getOutput().disabled.value?void 0:g(t))});var m=n(70573),_=n(10261);function y(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const t of e)r.append("v",t);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.`)}function x(t,e,n){const r=t.getData("application/x-lexical-editor");if(r)try{const t=JSON.parse(r);if(t.namespace===n._config.namespace&&Array.isArray(t.nodes))return v(n,function(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n],i=(0,c.oCe)(r);(0,c.Gg4)(i)&&(0,_.vV)(i),e.push(i)}return e}(t.nodes),e)}catch(t){console.error(t)}const i=t.getData("text/html"),o=t.getData("text/plain");if(i&&o!==i)try{const t=(new DOMParser).parseFromString(function(t){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:t=>t}).createHTML(t):t}(i),"text/html");return v(n,(0,m.s)(n,t),e)}catch(t){console.error(t)}const s=o||t.getData("text/uri-list");if(null!=s)if((0,c.OPZ)(e)){const t=s.split(/(\r?\n|\t)/);""===t[t.length-1]&&t.pop();for(let e=0;e<t.length;e++){const n=(0,c.dL7)();if((0,c.OPZ)(n)){const r=t[e];"\n"===r||"\r\n"===r?n.insertParagraph():"\t"===r?n.insertNodes([(0,c.S3L)()]):n.insertText(r)}}}else e.insertRawText(s)}function v(t,e,n){t.dispatchCommand(c.zrb,{nodes:e,selection:n})||(n.insertNodes(e),function(t){if((0,c.OPZ)(t)&&t.isCollapsed()){const e=t.anchor;let n=null;const r=(0,c.vJ0)(e,"previous");if(r)if((0,c.eQ9)(r))n=r.origin;else{const t=(0,c.Zok)(r,(0,c.CFn)((0,c.GvG)(),"next").getFlipped());for(const e of t){if((0,c.Gg4)(e.origin)){n=e.origin;break}if((0,c.F7b)(e.origin)&&!e.origin.isInline())break}}if(n&&(0,c.Gg4)(n)){const e=n.getFormat(),r=n.getStyle();t.format===e&&t.style===r||(t.format=e,t.style=r,t.dirty=!0)}}}(n))}function S(t,e,n,r=[]){let i=null===e||n.isSelected(e);const o=(0,c.F7b)(n)&&n.excludeFromCopy("html");let s=n;null!==e&&(0,c.Gg4)(s)&&(s=(0,_.bA)(e,s,"clone"));const l=(0,c.F7b)(s)?s.getChildren():[],a=function(t){const e=t.exportJSON(),n=t.constructor;if(e.type!==n.getType()&&y(58,n.name),(0,c.F7b)(t)){const t=e.children;Array.isArray(t)||y(59,n.name)}return e}(s);(0,c.Gg4)(s)&&0===s.getTextContentSize()&&(i=!1);for(let r=0;r<l.length;r++){const o=l[r],s=S(t,e,o,a.children);!i&&(0,c.F7b)(n)&&s&&n.extractWithChild(o,e,"clone")&&(i=!0)}if(i&&!o)r.push(a);else if(Array.isArray(a.children))for(let t=0;t<a.children.length;t++){const e=a.children[t];r.push(e)}return i}let C=null;async function b(t,e,n){if(null!==C)return!1;if(null!==e)return new Promise((r,i)=>{t.update(()=>{r(N(t,e,n))})});const r=t.getRootElement(),i=t._window||window,o=i.document,s=(0,c.Inp)(i);if(null===r||null===s)return!1;const l=o.createElement("span");l.style.cssText="position: fixed; top: -1000px;",l.append(o.createTextNode("#")),r.append(l);const a=new Range;return a.setStart(l,0),a.setEnd(l,1),s.removeAllRanges(),s.addRange(a),new Promise((e,r)=>{const s=t.registerCommand(c.LVk,r=>((0,h.nh)(r,ClipboardEvent)&&(s(),null!==C&&(i.clearTimeout(C),C=null),e(N(t,r,n))),!0),c.jwz);C=i.setTimeout(()=>{s(),C=null,e(!1)},50),o.execCommand("copy"),l.remove()})}function N(t,e,n){if(void 0===n){const e=(0,c.Inp)(t._window),r=(0,c.dL7)();if(!r||r.isCollapsed())return!1;if(!e)return!1;const i=e.anchorNode,o=e.focusNode;if(null!==i&&null!==o&&!(0,c.aff)(t,i,o))return!1;n=function(t=(0,c.dL7)()){const e={"text/plain":t?t.getTextContent():""};if(t){const n=(0,c.mJV)();for(const[r,i]of E){const o=i(n,t);null!==o&&(e[r]=o)}}return e}(r)}e.preventDefault();const r=e.clipboardData;return null!==r&&(function(t,e){for(const[n]of E)void 0===e[n]&&t.setData(n,"");for(const n in e){const r=e[n];void 0!==r&&t.setData(n,r)}}(r,n),!0)}const E=[["text/html",function(t,e=(0,c.dL7)()){return null==e&&y(166),(0,c.OPZ)(e)&&e.isCollapsed()||0===e.getNodes().length?"":(0,m.S)(t,e)}],["application/x-lexical-editor",function(t,e=(0,c.dL7)()){return null==e&&y(166),(0,c.OPZ)(e)&&e.isCollapsed()||0===e.getNodes().length?null:JSON.stringify(function(t,e){const n=[],r=(0,c.GvG)().getChildren();for(let i=0;i<r.length;i++)S(t,e,r[i],n);return{namespace:t._config.namespace,nodes:n}}(t,e))}]];function w(t,e){if(void 0!==document.caretRangeFromPoint){const n=document.caretRangeFromPoint(t,e);return null===n?null:{node:n.startContainer,offset:n.startOffset}}if("undefined"!==document.caretPositionFromPoint){const n=document.caretPositionFromPoint(t,e);return null===n?null:{node:n.offsetNode,offset:n.offset}}return null}const k="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,T=k&&"documentMode"in document?document.documentMode:null,O=k&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),M=!(!k||!("InputEvent"in window)||T)&&"getTargetRanges"in new window.InputEvent("input"),P=k&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),A=k&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,L=k&&/^(?=.*Chrome).*/i.test(navigator.userAgent),D=k&&/AppleWeb
1Kit\/[\d.]+/.test(navigator.userAgent)&&O&&!L,F=(0,c.fAf)("DRAG_DROP_PASTE_FILE");class I extends c.HX${static getType(){return"quote"}static clone(t){return new I(t.__key)}createDOM(t){const e=document.createElement("blockquote");return(0,h.Yo)(e,t.theme.quote),e}updateDOM(t,e){return!1}static importDOM(){return{blockquote:t=>({conversion:W,priority:0})}}exportDOM(t){const{element:e}=super.exportDOM(t);if((0,c.Ret)(e)){this.isEmpty()&&e.append(document.createElement("br"));const t=this.getFormatType();t&&(e.style.textAlign=t);const n=this.getDirection();n&&(e.dir=n)}return{element:e}}static importJSON(t){return R().updateFromJSON(t)}insertNewAfter(t,e){const n=(0,c.BEw)(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,e),n}collapseAtStart(){const t=(0,c.BEw)();return this.getChildren().forEach(e=>t.append(e)),this.replace(t),!0}canMergeWhenEmpty(){return!0}}function R(){return(0,c.U2B)(new I)}class K extends c.HX${__tag;static getType(){return"heading"}static clone(t){return new K(t.__tag,t.__key)}constructor(t,e){super(e),this.__tag=t}getTag(){return this.__tag}setTag(t){const e=this.getWritable();return this.__tag=t,e}createDOM(t){const e=this.__tag,n=document.createElement(e),r=t.theme.heading;if(void 0!==r){const t=r[e];(0,h.Yo)(n,t)}return n}updateDOM(t,e,n){return t.__tag!==this.__tag}static importDOM(){return{h1:t=>({conversion:z,priority:0}),h2:t=>({conversion:z,priority:0}),h3:t=>({conversion:z,priority:0}),h4:t=>({conversion:z,priority:0}),h5:t=>({conversion:z,priority:0}),h6:t=>({conversion:z,priority:0}),p:t=>{const e=t.firstChild;return null!==e&&B(e)?{conversion:()=>({node:null}),priority:3}:null},span:t=>B(t)?{conversion:t=>({node:Z("h1")}),priority:3}:null}}exportDOM(t){const{element:e}=super.exportDOM(t);if((0,c.Ret)(e)){this.isEmpty()&&e.append(document.createElement("br"));const t=this.getFormatType();t&&(e.style.textAlign=t);const n=this.getDirection();n&&(e.dir=n)}return{element:e}}static importJSON(t){return Z(t.tag).updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTag(t.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(t,e=!0){const n=t?t.anchor.offset:0,r=this.getLastDescendant(),i=!r||t&&t.anchor.key===r.getKey()&&n===r.getTextContentSize()||!t?(0,c.BEw)():Z(this.getTag()),o=this.getDirection();if(i.setDirection(o),this.insertAfter(i,e),0===n&&!this.isEmpty()&&t){const t=(0,c.BEw)();t.select(),this.replace(t,!0)}return i}collapseAtStart(){const t=this.isEmpty()?(0,c.BEw)():Z(this.getTag());
1return this.getChildren().forEach(e=>t.append(e)),this.replace(t),!0}extractWithChild(){return!0}}function B(t){return"span"===t.nodeName.toLowerCase()&&"26pt"===t.style.fontSize}function z(t){const e=t.nodeName.toLowerCase();let n=null;return"h1"!==e&&"h2"!==e&&"h3"!==e&&"h4"!==e&&"h5"!==e&&"h6"!==e||(n=Z(e),null!==t.style&&((0,c.WAA)(t,n),n.setFormat(t.style.textAlign))),{node:n}}function W(t){const e=R();return null!==t.style&&(e.setFormat(t.style.textAlign),(0,c.WAA)(t,e)),{node:e}}function Z(t="h1"){return(0,c.U2B)(new K(t))}function V(t){let e=null;if((0,h.nh)(t,DragEvent)?e=t.dataTransfer:(0,h.nh)(t,ClipboardEvent)&&(e=t.clipboardData),null===e)return[!1,[],!1];const n=e.types,r=n.includes("Files"),i=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(e.files),i]}function $(t){const e=(0,c.dL7)();if(!(0,c.OPZ)(e))return!1;const n=new Set,r=e.getNodes();for(let e=0;e<r.length;e++){const i=r[e],o=i.getKey();if(n.has(o))continue;const s=(0,c.$sg)(i,t=>(0,c.F7b)(t)&&!t.isInline());if(null===s)continue;const l=s.getKey();s.canIndent()&&!n.has(l)&&(n.add(l),t(s))}return n.size>0}function J(t){const e=(0,c.Xod)(t);return(0,c.k$I)(e)}function U(t){for(const e of["lowercase","uppercase","capitalize"])t.hasFormat(e)&&t.toggleFormat(e)}function j(t){return(0,h.qV)(t.registerCommand(c.Kr$,t=>{const e=(0,c.dL7)();return!!(0,c.iOo)(e)&&(e.clear(),!0)},c.VNZ),t.registerCommand(c.MtH,t=>{const e=(0,c.dL7)();return(0,c.OPZ)(e)?(e.deleteCharacter(t),!0):!!(0,c.iOo)(e)&&(e.deleteNodes(),!0)},c.VNZ),t.registerCommand(c.cj1,t=>{const e=(0,c.dL7)();return!!(0,c.OPZ)(e)&&(e.deleteWord(t),!0)},c.VNZ),t.registerCommand(c.n23,t=>{const e=(0,c.dL7)();return!!(0,c.OPZ)(e)&&(e.deleteLine(t),!0)},c.VNZ),t.registerCommand(c.yFl,e=>{const n=(0,c.dL7)();if("string"==typeof e)null!==n&&n.insertText(e);else{if(null===n)return!1;const r=e.dataTransfer;if(null!=r)x(r,n,t);else if((0,c.OPZ)(n)){const t=e.data;return t&&n.insertText(t),!0}}return!0},c.VNZ),t.registerCommand(c.RJi,()=>{const t=(0,c.dL7)();return!!(0,c.OPZ)(t)&&(t.removeText(),!0)},c.VNZ),t.registerCommand(c.Ewg,t=>{const e=(0,c.dL7)();return!!(0,c.OPZ)(e)&&(e.formatText(t),!0)},c.VNZ),t.registerCommand(c.ROy,t=>{const e=(0,c.dL7)();if(!(0,c.OPZ)(e)&&!(0,c.iOo)(e))return!1;const n=e.getNodes();for(const e of n){const n=(0,c.$sg)(e,t=>(0,c.F7b)(t)&&!t.isInline());null!==n&&n.setFormat(t)}return!0},c.VNZ),t.registerCommand(c.WHp,t=>{const e=(0,c.dL7)();return!!(0,c.OPZ)(e)&&(e.insertLineBreak(t),!0)},c.VNZ),t.registerCommand(c.K0p,()=>{const t=(0,c.dL7)();return!!(0,c.OPZ)(t)&&(t.insertParagraph(),!0)},c.VNZ),t.registerCommand(c.cAC,()=>((0,c.odo)([(0,c.S3L)()]),!0),c.VNZ),t.registerCommand(c.PUH,()=>$(t=>{const e=t.getIndent();t.setIndent(e+1)}),c.VNZ),t.registerCommand(c.czB,()=>$(t=>{const e=t.getIndent();e>0&&t.setIndent(Math.max(0,e-1))}),c.VNZ),t.registerCommand(c._0$,t=>{const e=(0,c.dL7)();if((0,c.iOo)(e)){const n=e.getNodes();if(n.length>0)return t.preventDefault(),n[0].selectPrevious(),!0}else if((0,c.OPZ)(e)){const n=(0,c.fLx)(e.focus,!0);if(!t.shiftKey&&(0,c.k$I)(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),t.preventDefault(),!0}return!1},c.VNZ),t.registerCommand(c.Zbz,t=>{const e=(0,c.dL7)();if((0,c.iOo)(e)){const n=e.getNodes();if(n.length>0)return t.preventDefault(),n[0].selectNext(0,0),!0}else if((0,c.OPZ)(e)){if(function(t){const e=t.focus;return"root"===e.key&&e.offset===(0,c.GvG)().getChildrenSize()}(e))return t.preventDefault(),!0;const n=(0,c.fLx)(e.focus,!1);if(!t.shiftKey&&(0,c.k$I)(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),t.preventDefault(),!0}return!1},c.VNZ),t.registerCommand(c.u$Z,t=>{const e=(0,c.dL7)();if((0,c.iOo)(e)){const n=e.getNodes();if(n.length>0)return t.preventDefault(),(0,_.bz)(n[0])?n[0].selectNext(0,0):n[0].selectPrevious(),!0}if(!(0,c.OPZ)(e))return!1;if((0,_.pi)(e,!0)){const n=t.shiftKey;return t.preventDefault(),(0,_.i0)(e,n,!0),!0}return!1},c.VNZ),t.registerCommand(c.NmO,t=>{const e=(0,c.dL7)();if((0,c.iOo)(e)){const n=e.getNodes();if(n.length>0)return t.preventDefault(),(0,_.bz)(n[0])?n[0].selectPrevious():n[0].selectNext(0,0),!0}if(!(0,c.OPZ)(e))return!1;const n=t.shiftKey;return!!(0,_.pi)(e,!1)&&(t.preventDefault(),(0,_.i0)(e,n,!1),!0)},c.VNZ),t.registerCommand(c.aRb,e=>{if(J(e.target))return!1;const n=(0,c.dL7)();if((0,c.OPZ)(n)){if(function(t){if(!t.isCollapsed())return!1;const{anchor:e}=t;if(0!==e.offset)return!1;const n=e.getNode();if((0,c.wdB)(n))return!1;const r=(0,h.f8)(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}
1(n))return e.preventDefault(),t.dispatchCommand(c.czB,void 0);if(A&&"ko-KR"===navigator.language)return!1}else if(!(0,c.iOo)(n))return!1;return e.preventDefault(),t.dispatchCommand(c.MtH,!0)},c.VNZ),t.registerCommand(c.MKI,e=>{if(J(e.target))return!1;const n=(0,c.dL7)();return!(!(0,c.OPZ)(n)&&!(0,c.iOo)(n))&&(e.preventDefault(),t.dispatchCommand(c.MtH,!1))},c.VNZ),t.registerCommand(c.XN4,e=>{const n=(0,c.dL7)();if(!(0,c.OPZ)(n))return!1;if(U(n),null!==e){if((A||P||D)&&M)return!1;if(e.preventDefault(),e.shiftKey)return t.dispatchCommand(c.WHp,!1)}return t.dispatchCommand(c.K0p,void 0)},c.VNZ),t.registerCommand(c.ZqX,()=>{const e=(0,c.dL7)();return!!(0,c.OPZ)(e)&&(t.blur(),!0)},c.VNZ),t.registerCommand(c.zDz,e=>{const[,n]=V(e);if(n.length>0){const r=w(e.clientX,e.clientY);if(null!==r){const{offset:e,node:i}=r,o=(0,c.Xod)(i);if(null!==o){const t=(0,c.vNz)();if((0,c.Gg4)(o))t.anchor.set(o.getKey(),e,"text"),t.focus.set(o.getKey(),e,"text");else{const e=o.getParentOrThrow().getKey(),n=o.getIndexWithinParent()+1;t.anchor.set(e,n,"element"),t.focus.set(e,n,"element")}const n=(0,c.S9_)(t);(0,c.oqs)(n)}t.dispatchCommand(F,n)}return e.preventDefault(),!0}const r=(0,c.dL7)();return!!(0,c.OPZ)(r)},c.VNZ),t.registerCommand(c.XIO,t=>{const[e]=V(t),n=(0,c.dL7)();return!(e&&!(0,c.OPZ)(n))},c.VNZ),t.registerCommand(c.kEj,t=>{const[e]=V(t),n=(0,c.dL7)();if(e&&!(0,c.OPZ)(n))return!1;const r=w(t.clientX,t.clientY);if(null!==r){const e=(0,c.Xod)(r.node);(0,c.k$I)(e)&&t.preventDefault()}return!0},c.VNZ),t.registerCommand(c.HrV,()=>((0,c.ULO)(),!0),c.VNZ),t.registerCommand(c.LVk,e=>(b(t,(0,h.nh)(e,ClipboardEvent)?e:null),!0),c.VNZ),t.registerCommand(c.dR_,e=>(async function(t,e){await b(e,(0,h.nh)(t,ClipboardEvent)?t:null),e.update(()=>{const t=(0,c.dL7)();(0,c.OPZ)(t)?t.removeText():(0,c.iOo)(t)&&t.getNodes().forEach(t=>t.remove())})}(e,t),!0),c.VNZ),t.registerCommand(c.A1,e=>{const[,n,r]=V(e);return n.length>0&&!r?(t.dispatchCommand(F,n),!0):!((0,c.uFG)(e.target)&&(0,c.GAf)(e.target)||null===(0,c.dL7)()||(function(t,e){t.preventDefault(),e.update(()=>{const n=(0,c.dL7)(),r=(0,h.nh)(t,InputEvent)||(0,h.nh)(t,KeyboardEvent)?null:t.clipboardData;null!=r&&null!==n&&x(r,n,e)},{tag:c.QHN})}(e,t),0))},c.VNZ),t.registerCommand(c.Y7p,t=>{const e=(0,c.dL7)();return(0,c.OPZ)(e)&&U(e),!1},c.VNZ),t.registerCommand(c.dB,t=>{const e=(0,c.dL7)();return(0,c.OPZ)(e)&&U(e),!1},c.VNZ))}function G(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const t of e)r.append("v",t);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.`)}(0,c.qry)({conflictsWith:["@lexical/plain-text"],dependencies:[p],name:"@lexical/rich-text",nodes:()=>[K,I],register:j});const q="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?i.useLayoutEffect:i.useEffect;function H({editor:t,ErrorBoundary:e}){return function(t,e){const[n,r]=(0,i.useState)(()=>t.getDecorators());return q(()=>t.registerDecoratorListener(t=>{(0,u.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,d.jsx)(e,{onError:e=>t._onError(e),children:(0,d.jsx)(i.Suspense,{fallback:null,children:n[l]})}),a=t.getElementByKey(l);null!==a&&r.push((0,u.createPortal)(c,a,l))}return r},[e,n,t])}(t,e)}function X({editor:t,ErrorBoundary:e}){return function(t){const e=l.pN.maybeFromEditor(t);if(e&&e.hasExtensionByName(a.name)){for(const t of["@lexical/plain-text","@lexical/rich-text"])e.hasExtensionByName(t)&&G(320,t);return!0}return!1}(t)?null:(0,d.jsx)(H,{editor:t,ErrorBoundary:e})}function Y(t){return t.getEditorState().read((0,f.yL)(t.isComposing()))}function Q({contentEditable:t,placeholder:e=null,ErrorBoundary:n}){const[i]=(0,r.g)();return q(()=>(0,h.qV)(j(o),g(o)),[o=i]),(0,d.jsxs)(d.Fragment,{children:[t,(0,d.jsx)(tt,{content:e}),(0,d.jsx)(X,{editor:i,ErrorBoundary:n})]});var o}function tt({content:t}){const[e]=(0,r.g)(),n=function(t){const[e,n]=(0,i.useState)(()=>Y(t));return q(()=>{function e(){const e=Y(t);n(e)}return e(),(0,h.qV)(t.registerUpdateListener(()=>{e()}
1),t.registerEditableListener(()=>{e()}))},[t]),e}(e),l=function(t){const[e]=(0,r.g)(),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}},10261:(t,e,n)=>{n.d(e,{bA:()=>u,bz:()=>a,c1:()=>s,i0:()=>m,pi:()=>g,vV:()=>d});var r=n(61084);const i=new Map;function o(t){const e={};if(!t)return e;const n=t.split(";");for(const t of n)if(""!==t){const[n,r]=t.split(/:([^]+)/);n&&r&&(e[n.trim()]=r.trim())}return e}function s(t){let e=i.get(t);return void 0===e&&(e=o(t),i.set(t,e)),e}function l(t){const e=(0,r.mJV)().getElementByKey(t.getKey());if(null===e)return null;const n=e.ownerDocument.defaultView;return null===n?null:n.getComputedStyle(e)}function c(t){return l((0,r.wdB)(t)?t:t.getParentOrThrow())}function a(t){const e=c(t);return null!==e&&"rtl"===e.direction}function u(t,e,n="self"){const i=t.getStartEndPoints();if(e.isSelected(t)&&!(0,r.tOR)(e)&&null!==i){const[o,s]=i,l=t.isBackward(),c=o.getNode(),a=s.getNode(),u=e.is(c),d=e.is(a);if(u||d){const[i,o]=(0,r.cs7)(t),s=c.is(a),u=e.is(l?a:c),d=e.is(l?c:a);let f,h=0;s?(h=i>o?o:i,f=i>o?i:o):u?(h=l?o:i,f=void 0):d&&(h=0,f=l?i:o);const g=e.__text.slice(h,f);g!==e.__text&&("clone"===n&&(e=(0,r.v0y)(e)),e.__text=g)}}return e}function d(t){const e=t.getStyle(),n=o(e);i.set(e,n)}function f(t){const e=h(t);return null!==e&&"vertical-rl"===e.writingMode}function h(t){const e=t.anchor.getNode();return(0,r.F7b)(e)?l(e):c(e)}function g(t,e){let n=f(t)?!e:e;p(t)&&(n=!n);const i=(0,r.vJ0)(t.focus,n?"previous":"next");if((0,r.GdB)(i))return!1;for(const t of(0,r.MkX)(i)){if((0,r.v0F)(t))return!t.origin.isInline();if(!(0,r.F7b)(t.origin)){if((0,r.k$I)(t.origin))return!0;break}}return!1}function p(t){const e=h(t);return null!==e&&"rtl"===e.direction}function m(t,e,n){const r=p(t);let i;i=f(t)||r?!n:n,function(t,e,n){t.modify(e?"extend":"move",n,"character")}(t,e,i)}},5487:(t,e,n)=>{n.d(e,{yL:()=>i});var r=n(61084);function i(t){return()=>function(t){if(!function(t,e=!0){if(t)return!1;let n=(0,r.GvG)().getTextContent();return e&&(n=n.trim()),""===n}(t,!1))return!1;const e=(0,r.GvG)().getChildren(),n=e.length;if(n>1)return!1;for(let t=0;t<n;t++){const n=e[t];if((0,r.k$I)(n))return!1;if((0,r.F7b)(n)){if(!(0,r.Rlh)(n))return!1;if(0!==n.__indent)return!1;const e=n.getChildren(),i=e.length;for(let n=0;n<i;n++){const n=e[t];if(!(0,r.Gg4)(n))return!1}}}return!0}(t)}},18824:(t,e,n)=>{n.d(e,{MZ:()=>y,Or:()=>m,PS:()=>d,Yo:()=>u,f8:()=>h,nh:()=>p,qV:()=>a,yD:()=>f,z8:()=>g});var r=n(61084);function i(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const t of e)r.append("v",t);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.`)}const o="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,s=o&&"documentMode"in document?document.documentMode:null,l=(o&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),o&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent));!(!o||!("InputEvent"in window)||s)&&new window.InputEvent("input"),o&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),o&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window.MSStream,o&&/Android/.test(navigator.userAgent),o&&/^(?=.*Chrome).*/i.test(navigator.userAgent);function c(...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}function a(...t){return()=>{for(let e=t.length-1;e>=0;e--)t[e]();t.length=0}}function u(t,...e){const n=c(...e);n.length>0&&t.classList.add(...n)}function d(t,...e){const n=c(...e);n.length>0&&t.classList.remove(...n)}function f(t,e){let n=t;for(;null!=n;){if(n instanceof e)return n;n=n.getParent()}return null}function h(t){const e=(0,r.$sg)(t,t=>(0,r.F7b)(t)&&!t.isInline());return(0,r.F7b)(e)||i(4,t.__key),e}function g(t){const e=(0,r.dL7)()||(0,r.DNT)();let n;if((0,r.OPZ)(e))n=(0,r.vJ0)(e.focus,"next");else{if(null!=e){const t=e.getNodes(),i=t[t.length-1];i&&(n=(0,r.UW)(i,"next"))}n=n||(0,r.CFn)((0,r.GvG)(),"previous").getFlipped().insert((0,r.BEw)())}const o=function(t,e){let n=(0,r.kyV)(e,"next");for(let t=n;t;t=(0,r.exr)(t,undefined))n=t;return(0,r.eQ9)(n)&&i(283),n.insert(t.isInline()?(0,r.BEw)().append(t):t),(0,r.kyV)((0,r.UW)(t.getLatest(),"next"),e.direction)}(t,n),s=(0,r.grI)(o),l=(0,r.v0F)(s)?(0,r.LN)(s):o;return(0,r.rZX)((0,r.R_O)(l)),t.getLatest()}function p(t,e){return null!==t&&Object.getPrototypeOf(t).constructor.name===e.name}function m(t,e){const n=[];for(let r=0;r<t.length;r++){const i=e(t[r]);null!==i&&n.push(i)}return n}
1o&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent);let _=!(l||!o)&&void 0;function y(t){let e=1;if(function(){if(void 0===_){const t=document.createElement("div");t.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(t);const e=t.getBoundingClientRect();t.style.setProperty("zoom","2"),_=t.getBoundingClientRect().width===e.width,document.body.removeChild(t)}return _}())for(;t;)e*=Number(window.getComputedStyle(t).getPropertyValue("zoom")),t=t.parentElement;return e}},61084:(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 t of e)r.append("v",t);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.`)}function i(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const t of e)r.append("v",t);n.search=r.toString(),console.warn(`Minified Lexical warning #${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,{$le:()=>re,$sg:()=>as,A1:()=>Yt,A3A:()=>Ln,AyS:()=>ol,B9u:()=>Qn,BEw:()=>Si,BM6:()=>Oe,CFn:()=>Ts,CKy:()=>xi,D7_:()=>bn,DNT:()=>Er,Eot:()=>Ei,Ewg:()=>ne,F7b:()=>li,GAf:()=>Ki,GdB:()=>Xs,Gg4:()=>Xn,GvG:()=>lo,H2R:()=>qi,HX$:()=>si,HrV:()=>Te,Ijf:()=>ai,Inp:()=>Jo,JhQ:()=>Oi,K0p:()=>Ht,K3p:()=>Nn,KB:()=>Ni,Kr$:()=>Vt,LJl:()=>mi,LN:()=>Hs,LVk:()=>we,MKI:()=>me,MXo:()=>Hn,MkX:()=>As,MtH:()=>Gt,NmO:()=>se,Nrv:()=>Me,ON8:()=>Cn,OPZ:()=>lr,PUH:()=>xe,Psm:()=>sl,QHN:()=>En,Qqf:()=>no,R2r:()=>Wn,RGD:()=>yi,RJi:()=>Qt,ROy:()=>Ce,R_O:()=>Ls,Ret:()=>Uo,Rlh:()=>Ci,S3L:()=>tr,S9_:()=>ot,Tav:()=>An,U2B:()=>Wo,UDx:()=>il,ULO:()=>Eo,ULs:()=>Go,UW:()=>Ns,VNZ:()=>bi,WAA:()=>is,WHp:()=>qt,XIO:()=>be,XN4:()=>fe,Xod:()=>io,Y7p:()=>he,Zbz:()=>de,Zok:()=>Ds,ZqX:()=>pe,Zr1:()=>di,_0$:()=>ue,_vQ:()=>Bo,aAG:()=>Fi,aRb:()=>ge,aff:()=>Bi,cAC:()=>ye,cj1:()=>te,cs7:()=>dr,czB:()=>ve,dB:()=>_e,dL7:()=>Nr,dM9:()=>cs,dR_:()=>ke,eQ9:()=>ys,ekx:()=>xr,exr:()=>nl,fAf:()=>zt,fLx:()=>Oo,gID:()=>eo,grI:()=>Os,h5h:()=>Cr,iOo:()=>ar,jwz:()=>wi,k$I:()=>ui,kEj:()=>Ne,kyV:()=>Ys,lvZ:()=>Ho,mJV:()=>Yo,mry:()=>Wi,n23:()=>ee,oCe:()=>Hr,odo:()=>Pr,ojF:()=>Wt,oqs:()=>ao,qnv:()=>Zs,qry:()=>rl,r04:()=>Pe,rZX:()=>Vs,tM8:()=>yn,tOR:()=>$i,u$Z:()=>ce,u8R:()=>qo,uFG:()=>jo,v0F:()=>vs,v0y:()=>rs,vJ0:()=>Ws,vNz:()=>Sr,wdB:()=>fi,wsJ:()=>Mn,xHj:()=>Ui,yFl:()=>Xt,ynn:()=>Ae,zDz:()=>Se,zqW:()=>ie,zrb:()=>Zt});const o="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,s=o&&"documentMode"in document?document.documentMode:null,l=o&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),c=o&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),a=!(!o||!("InputEvent"in window)||s)&&"getTargetRanges"in new window.InputEvent("input"),u=o&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),d=o&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,f=o&&/Android/.test(navigator.userAgent),h=o&&/^(?=.*Chrome).*/i.test(navigator.userAgent),g=o&&f&&h,p=o&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&l&&!h;function m(...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,y=1,x=2,v=1,S=2,C=3,b=4,N=5,E=6,w=u||d||p?" ":"â",k="\n\n",T=c?" ":w,O="Ö-ß¿ï¬-﷽ﹰ-ﻼ",M="A-Za-zÃ-ÃÃ-öø-ʸÌ-Öà -á¿¿ââ°-ï¬ï¸-﹯﻽-ï¿¿",P=(new RegExp("^[^"+M+"]*["+O+"]"),new RegExp("^[^"+O+"]*["+M+"]"),{bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512}),A={directionless:1,unmergeable:2},L={center:2,end:6,justify:4,left:1,right:3,start:5},D={[S]:"center",[E]:"end",[b]:"justify",[v]:"left",[C]:"right",[N]:"start"},F={normal:0,segmented:2,token:1},I={[_]:"normal",[x]:"segmented",[y]:"token"},R="$config";function K(t,e,n,r,i,o){let s=t.getFirstChild();for(;null!==s;){const t=s.__key;s.__parent===e&&(li(s)&&K(s,t,n,r,i,o),n.has(t)||o.delete(t),i.push(t)),s=s.getNextSibling()}}let B=!1,z=0;function W(t){z=t.timeStamp}function Z(t,e,n){const r="BR"===t.nodeName,i=e.__lexicalLineBreak;return i&&(t===i||r&&t.previousSibling===i)||r&&void 0!==ro(t,n)}function V(t,e,n){const r=Jo(Ko(n));let i=null,o=null;null!==r&&r.anchorNode===t&&(i=r.anchorOffset,o=r.focusOffset);const s=t.nodeValue;null!==s&&_o(e,s,i,o,!1)}function $(t,e,n){if(lr(t)){const e=t.anchor.getNode();if(e.is(n)&&t.format!==e.getFormat())return!1}return Ji(e)&&n.isAttached()}function J(t,e,n,r){for(let i=t;i&&!os(i);i=Do(i)){const t=ro(i,e);if(void 0!==t){const e=eo(t,n);if(e)return ui(e)||!Uo(i)?void 0:[i,e]}else if(i===r)return[r,co(n)]}}function U(t,e,n){B=!0;const r=performance.now()-z>100;try{ri(t,()=>{const i=Nr()||function(t){return t.getEditorState().read(()=>{const t=Nr();return null!==t?t.clone():null})}(t),o=new Map,s=t.getRootElement(),l=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=J(g,t,l,s);if(!p)continue;const[m,_]=p;if("characterData"===h)r&&Xn(_)&&Ji(g)&&$(i,g,_)&&V(g,_,t);else if("childList"===h){u=!0;const e=f.addedNodes;for(let n=0;n<e.length;n++){const r=e[n],i=no(r),o=r.parentNode;if(null!=o&&r!==a&&null===i&&!Z(r,o,t)){if(c){const t=(Uo(r)?r.innerText:null)||r.nodeValue;t&&(d+=t)}o.removeChild(r)}}const n=f.removedNodes,r=n.length;if(r>0){let e=0;for(let i=0;i<r;i++){const r=n[i];(Z(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||Z(n,i,t)||o.removeChild(n)}}n.takeRecords()}null!==i&&(u&&ao(i),c&&Mo(t)&&i.insertRawText(d))})}finally{B=!1}}function j(t){const e=t._observer;null!==e&&U(t,e.takeRecords(),e)}function G(t){!function(t){0===z&&Ko(t).addEventListener("textInput",W,!0)}(t),t._observer=new MutationObserver((e,n)=>{U(t,e,n)})}function q(t){const e=new Map,n=new Set;for(let r="function"==typeof t?t:t.replace;r.prototype&&void 0!==r.prototype.getType;r=Object.getPrototypeOf(r)){const{ownNodeConfig:t}=ls(r);if(t&&t.stateConfigs)for(const r of t.stateConfigs){let t;"stateConfig"in r?(t=r.stateConfig,r.flat&&n.add(t.key)):t=r,e.set(t.key,t)}}return{flatKeys:n,sharedConfigMap:e}}class H{node;knownState;unknownState;sharedNodeState;size;constructor(t,e,n=void 0,r=new Map,i=void 0){this.node=t,this.sharedNodeState=e,this.unknownState=n,this.knownState=r;const{sharedConfigMap:o}=this.sharedNodeState,s=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}(o,n,r);this.size=s}getValue(t){const e=this.knownState.get(t);if(void 0!==e)return e;this.sharedNodeState.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},e={};for(const[e,n]of this.knownState)e.isEqual(n,e.defaultValue)?delete t[e.key]:t[e.key]=e.unparse(n);for(const n of this.sharedNodeState.flatKeys)n in t&&(e[n]=t[n],delete t[n]);return Y(t)&&(e.$=t),e}getWritable(t){if(this.node===t)return this;const{sharedNodeState:e,unknownState:n}=this,r=new Map(this.knownState);return new H(t,e,function(t,e,n){let r;if(n)for(const[i,o]of Object.entries(n)){const n=t.get(i);n?e.has(n)||e.set(n,n.parse(o)):(r=r||{},r[i]=o)}return r}(e.sharedConfigMap,r,n),r,this.size)}updateFromKnown(t,e){const n=t.key;this.sharedNodeState.sharedConfigMap.set(n,t);const{knownState:r,unknownState:i}=this;r.has(t)||i&&n in i||(i&&(delete i[n],this.unknownState=Y(i)),this.size++),r.set(t,e)}updateFromUnknown(t,e){const n=this.sharedNodeState.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 t of e.keys())e.set(t,t.defaultValue);if(this.size=e.size,this.unknownState=void 0,t)for(const[e,n]of Object.entries(t))this.updateFromUnknown(e,n)}}function X(t){return t.__state?t.__state.sharedNodeState:Di(Yo(),t.getType()).sharedNodeState}function Y(t){if(t)for(const e in t)return t}function Q(t,e,n){for(const[r,i]of e.knownState){if(t.has(r.key))continue;t.add(r.key);const e=n?n.getValue(r):r.defaultValue;
1if(e!==i&&!r.isEqual(e,i))return!0}return!1}function tt(t,e,n){const{unknownState:r}=e,i=n?n.unknownState:void 0;if(r)for(const[e,n]of Object.entries(r))if(!t.has(e)&&(t.add(e),n!==(i?i[e]:void 0)))return!0;return!1}function et(t,e){const n=t.__state;return n&&n.node===t?n.getWritable(e):n}function nt(t,e){const n=t.__mode,r=t.__format,i=t.__style,o=e.__mode,s=e.__format,l=e.__style,c=t.__state,a=e.__state;return(null===n||n===o)&&(null===r||r===s)&&(null===i||i===l)&&(null===t.__state||c===a||function(t,e){if(t===e)return!0;if(t&&e&&t.size!==e.size)return!1;const n=new Set;return!(t&&Q(n,t,e)||e&&Q(n,e,t)||t&&tt(n,t,e)||e&&tt(n,e,t))}(c,a))}function rt(t,e){const n=t.mergeWithSibling(e),r=Jr()._normalizedNodes;return r.add(t.__key),r.add(e.__key),n}function it(t){let e,n,r=t;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(e=r.getPreviousSibling())&&Xn(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(""!==e.__text){if(nt(e,r)){r=rt(e,r);break}break}e.remove()}for(;null!==(n=r.getNextSibling())&&Xn(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(nt(r,n)){r=rt(r,n);break}break}n.remove()}}else r.remove()}function ot(t){return st(t.anchor),st(t.focus),t}function st(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),Xn(r)){t.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!li(r))break;t.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}let lt,ct,at,ut,dt,ft,ht,gt,pt,mt,_t="",yt=null,xt=null,vt="",St=!1,Ct=!1;function bt(t,e){const n=ht.get(t);
1if(null!==e){const n=Bt(t);n.parentNode===e&&e.removeChild(n)}if(gt.has(t)||ct._keyToDOMMap.delete(t),li(n)){const t=Ft(n,ht);Nt(t,0,t.length-1,null)}void 0!==n&&ko(mt,at,ut,n,"destroyed")}function Nt(t,e,n,r){let i=e;for(;i<=n;++i){const e=t[i];void 0!==e&&bt(e,r)}}function Et(t,e){t.setProperty("text-align",e)}const wt="40px";function kt(t,e){const n=lt.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")||wt;t.style.setProperty("padding-inline-start",0===e?"":`calc(${e} * ${r})`)}function Tt(t,e){const n=t.style;0===e?Et(n,""):1===e?Et(n,"left"):2===e?Et(n,"center"):3===e?Et(n,"right"):4===e?Et(n,"justify"):5===e?Et(n,"start"):6===e&&Et(n,"end")}function Ot(t,e){const n=function(t){const e=t.__dir;if(null!==e)return e;if(fi(t))return null;const n=t.getParentOrThrow();return fi(n)&&null===n.__dir?"auto":null}(e);null!==n?t.dir=n:t.removeAttribute("dir")}function Mt(t,e){const n=gt.get(t);void 0===n&&r(60);const i=n.createDOM(lt,ct);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,ct),Xn(n)?i.setAttribute("data-lexical-text","true"):ui(n)&&i.setAttribute("data-lexical-decorator","true"),li(n)){const t=n.__indent,e=n.__size;if(Ot(i,n),0!==t&&kt(i,t),0!==e){const t=e-1;Pt(Ft(n,gt),n,0,t,n.getDOMSlot(i))}const r=n.__format;0!==r&&Tt(i,r),n.isInline()||Lt(null,n,i),Ao(n)&&(_t+=k,vt+=k)}else{const e=n.getTextContent();if(ui(n)){const e=n.decorate(ct,lt);null!==e&&Rt(t,e),i.contentEditable="false"}_t+=e,vt+=e}return null!==e&&e.insertChild(i),ko(mt,at,ut,n,"created"),i}function Pt(t,e,n,r,i){const o=_t;_t="";let s=n;for(;s<=r;++s){Mt(t[s],i);const e=gt.get(t[s]);null!==e&&Xn(e)&&null===yt&&(yt=e.getFormat(),xt=e.getStyle())}Ao(e)&&(_t+=k),i.element.__lexicalTextContent=_t,_t=o+_t}function At(t,e){if(t){const n=t.__last;if(n){const t=e.get(n);if(t)return Ln(t)?"line-break":ui(t)&&t.isInline()?"decorator":null}return"empty"}return null}function Lt(t,e,n){const r=At(t,ht),i=At(e,gt);r!==i&&e.getDOMSlot(n).setManagedLineBreak(i)}function Dt(t,e,n){var i;yt=null,xt=null,function(t,e,n){const i=_t,o=t.__size,s=e.__size;_t="";const l=n.element;if(1===o&&1===s){const n=t.__first,r=e.__first;if(n===r)It(n,l);else{const t=Bt(n),e=Mt(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}bt(n,null)}const o=gt.get(r);Xn(o)&&null===yt&&(yt=o.getFormat(),xt=o.getStyle())}else{const i=Ft(t,ht),c=Ft(e,gt);if(i.length!==o&&r(227),c.length!==s&&r(228),0===o)0!==s&&Pt(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;Nt(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=Kt(It(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=Lo(ct,r);t===u?u=Kt(It(r,o.element)):(o.withBefore(u).insertChild(t),It(r,o.element)),d++,f++}else Mt(r,o.withBefore(u)),f++;else u=Kt(Bt(t)),bt(t,o.element),d++}const i=gt.get(r);null!==i&&Xn(i)&&null===yt&&(yt=i.getFormat(),xt=i.getStyle())}const h=d>s,g=f>l;if(h&&!g){const e=n[l+1],r=void 0===e?null:ct.getElementByKey(e);Pt(n,t,f,l,o.withBefore(r))}else g&&!h&&Nt(e,d,s,o.element)}(e,i,c,o,s,n)}Ao(e)&&(_t+=k),l.__lexicalTextContent=_t,_t=i+_t}(t,e,e.getDOMSlot(n)),i=e,null==yt||yt===i.__textFormat||Ct||i.setTextFormat(yt),function(t){null==xt||xt===t.__textStyle||Ct||t.setTextStyle(xt)}(e)}function Ft(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 It(t,e){const n=ht.get(t);let i=gt.get(t);void 0!==n&&void 0!==i||r(61);const o=St||ft.has(t)||dt.has(t),s=Lo(ct,t);if(n===i&&!o){if(li(n)){const t=s.__lexicalTextContent;void 0!==t&&(_t+=t,vt+=t)}else{const t=n.getTextContent();vt+=t,_t+=t}return s}if(n!==i&&o&&ko(mt,at,ut,i,"updated"),i.updateDOM(n,s,lt)){const n=Mt(t,null);return null===e&&r(62),e.replaceChild(n,s),bt(t,null),n}if(li(n)&&li(i)){const t=i.__indent;(St||t!==n.__indent)&&kt(s,t);const e=i.__format;if((St||e!==n.__format)&&Tt(s,e),o&&(Dt(n,i,s),fi(i)||i.isInline()||Lt(n,i,s)),Ao(i)&&(_t+=k,vt+=k),(St||i.__dir!==n.__dir)&&(Ot(s,i),fi(i)&&!St))for(const t of i.getChildren())li(t)&&Ot(Lo(ct,t.getKey()),t)}else{const e=i.getTextContent();if(ui(i)){const e=i.decorate(ct,lt);null!==e&&Rt(t,e)}_t+=e,vt+=e}if(!Ct&&fi(i)&&i.__cachedText!==vt){const t=i.getWritable();t.__cachedText=vt,i=t}return s}function Rt(t,e){let n=ct._pendingDecorators;const r=ct._decorators;if(null===n){if(r[t]===e)return;n=oo(ct)}n[t]=e}function Kt(t){let e=t.nextSibling;return null!==e&&e===ct._blockCursorElement&&(e=e.nextSibling),e}function Bt(t){const e=pt.get(t);return void 0===e&&r(75,t),e}function zt(t){return{type:t}}const Wt=zt("SELECTION_CHANGE_COMMAND"),Zt=zt("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Vt=zt("CLICK_COMMAND"),$t=zt("BEFORE_INPUT_COMMAND"),Jt=zt("INPUT_COMMAND"),Ut=zt("COMPOSITION_START_COMMAND"),jt=zt("COMPOSITION_END_COMMAND"),Gt=zt("DELETE_CHARACTER_COMMAND"),qt=zt("INSERT_LINE_BREAK_COMMAND"),Ht=zt("INSERT_PARAGRAPH_COMMAND"),Xt=zt("CONTROLLED_TEXT_INSERTION_COMMAND"),Yt=zt("PASTE_COMMAND"),Qt=zt("REMOVE_TEXT_COMMAND"),te=zt("DELETE_WORD_COMMAND"),ee=zt("DELETE_LINE_COMMAND"),ne=zt("FORMAT_TEXT_COMMAND"),re=zt("UNDO_COMMAND"),ie=zt("REDO_COMMAND"),oe=zt("KEYDOWN_COMMAND"),se=zt("KEY_ARROW_RIGHT_COMMAND"),le=zt("MOVE_TO_END"),ce=zt("KEY_ARROW_LEFT_COMMAND"),ae=zt("MOVE_TO_START"),ue=zt("KEY_ARROW_UP_COMMAND"),de=zt("KEY_ARROW_DOWN_COMMAND"),fe=zt("KEY_ENTER_COMMAND"),he=zt("KEY_SPACE_COMMAND"),ge=zt("KEY_BACKSPACE_COMMAND"),pe=zt("KEY_ESCAPE_COMMAND"),me=zt("KEY_DELETE_COMMAND"),_e=zt("KEY_TAB_COMMAND"),ye=zt("INSERT_TAB_COMMAND"),xe=zt("INDENT_CONTENT_COMMAND"),ve=zt("OUTDENT_CONTENT_COMMAND"),Se=zt("DROP_COMMAND"),Ce=zt("FORMAT_ELEMENT_COMMAND"),be=zt("DRAGSTART_COMMAND"),Ne=zt("DRAGOVER_COMMAND"),Ee=zt("DRAGEND_COMMAND"),we=zt("COPY_COMMAND"),ke=zt("CUT_COMMAND"),Te=zt("SELECT_ALL_COMMAND"),Oe=zt("CLEAR_EDITOR_COMMAND"),Me=zt("CLEAR_HISTORY_COMMAND"),Pe=zt("CAN_REDO_COMMAND"),Ae=zt("CAN_
1UNDO_COMMAND"),Le=zt("FOCUS_COMMAND"),De=zt("BLUR_COMMAND"),Fe=zt("KEY_MODIFIER_COMMAND"),Ie=Object.freeze({}),Re=[["keydown",function(t,e){Ke=t.timeStamp,Be=t.key,e.isComposing()||Po(e,oe,t)}],["pointerdown",function(t,e){const n=t.target,r=t.pointerType;jo(n)&&"touch"!==r&&"pen"!==r&&0===t.button&&ri(e,()=>{Ri(n)||(Je=!0)})}],["compositionstart",function(t,e){Po(e,Ut,t)}],["compositionend",function(t,e){c?je=!0:d||!u&&!p?Po(e,jt,t):(Ge=!0,qe=t.data)}],["input",function(t,e){t.stopPropagation(),ri(e,()=>{e.dispatchCommand(Jt,t)},{event:t}),We=null}],["click",function(t,e){ri(e,()=>{const n=Nr(),r=Jo(Ko(e)),i=Er();if(r)if(lr(n)){const e=n.anchor,o=e.getNode();if("element"===e.type&&0===e.offset&&n.isCollapsed()&&!fi(o)&&1===lo().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=as(o,t=>li(t)&&!t.isInline());li(t)&&t.select(0)}}else if("touch"===t.pointerType||"pen"===t.pointerType){const n=r.anchorNode;(Uo(n)||Ji(n))&&ao(br(i,r,e,t))}Po(e,Vt,t)})}],["cut",Ie],["copy",Ie],["dragstart",Ie],["dragover",Ie],["dragend",Ie],["paste",Ie],["focus",Ie],["blur",Ie],["drop",Ie]];a&&Re.push(["beforeinput",(t,e)=>function(t,e){const n=t.inputType;"deleteCompositionText"===n||c&&Mo(e)||"insertCompositionText"!==n&&Po(e,$t,t)}(t,e)]);let Ke=0,Be=null,ze=0,We=null;const Ze=new WeakMap,Ve=new WeakMap;let $e=!1,Je=!1,Ue=!1,je=!1,Ge=!1,qe="",He=null,Xe=[0,"",0,"root",0];function Ye(t,e,n,r,i){const o=t.anchor,s=t.focus,l=o.getNode(),c=Jr(),u=Jo(Ko(c)),d=null!==u?u.anchorNode:null,f=o.key,h=c.getElementByKey(f),g=n.length;return f!==s.key||!Xn(l)||(!i&&(!a||ze<r+50)||l.isDirty()&&g<2||fo(n))&&o.offset!==s.offset&&!l.isComposing()||$i(l)||l.isDirty()&&g>1||(i||!a)&&null!==h&&!l.isComposing()&&d!==ji(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=Vi(e);return 0===n?!e.canInsertTextBefore()||!r.canInsertTextBefore()&&!e.isComposing()||i||function(t){const e=t.getPreviousSibling();return(Xn(e)||li(e)&&e.isInline())&&!e.canInsertTextAfter()}(e):n===e.getTextContentSize()&&(!e.canInsertTextAfter()||!r.canInsertTextAfter()&&!e.isComposing()||i)}(t,l)}function Qe(t,e){return Ji(t)&&null!==t.nodeValue&&0!==e&&e!==t.nodeValue.length}function tn(t,e,n){const{anchorNode:i,anchorOffset:o,focusNode:s,focusOffset:l}=t;$e&&($e=!1,Qe(i,o)&&Qe(s,l)&&!He)||ri(e,()=>{if(!n)return void ao(null);if(!Bi(e,i,s))return;let c=Nr();if(He&&lr(c)&&c.isCollapsed()){const t=c.anchor,e=He.anchor;(t.key===e.key&&t.offset===e.offset+1||1===t.offset&&e.getNode().is(t.getNode().getPreviousSibling()))&&(c=He.clone(),ao(c))}if(He=null,lr(c)){const n=c.anchor,i=n.getNode();if(c.isCollapsed()){"Range"===t.type&&t.anchorNode===t.focusNode&&(c.dirty=!0);const o=Ko(e).event,s=o?o.timeStamp:performance.now(),[l,a,u,d,f]=Xe,h=lo(),g=!1===e.isComposing()&&""===h.getTextContent();if(s<f+200&&n.offset===u&&n.key===d)en(c,l,a);else if("text"===n.type)Xn(i)||r(141),nn(c,i);else if("element"===n.type&&!g){li(i)||r(259);const t=n.getNode();t.isEmpty()?function(t,e){en(t,e.getTextFormat(),e.getTextStyle())}(c,t):en(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 t=0;t<i;t++){const e=r[t],n=e.getTextContentSize();if(Xn(e)&&0!==n&&!(0===t&&e.__key===d&&a===n||t===i-1&&e.__key===f&&0===u)&&(g=!0,h&=e.getFormat(),0===h))break}c.format=g?h:0}}Po(e,Wt,void 0)})}function en(t,e,n){t.format===e&&t.style===n||(t.format=e,t.style=n,t.dirty=!0)}function nn(t,e){en(t,e.getFormat(),e.getStyle())}function rn(t){if(!t.getTargetRanges)return null;const e=t.getTargetRanges();return 0===e.length?null:e[0]}function on(t){const e=t.inputType,n=rn(t),i=Jr(),o=Nr();if("deleteContentBackward"===e){if(null===o){const t=Er();if(!lr(t))return!0;ao(t.clone())}if(lr(o)){const e=o.anchor.key===o.focus.key;if(s=t.timeStamp,"MediaLast"===Be&&s<Ke+30&&i.isComposing()&&e){if(Qi(null),Ke=0,setTimeout(()=>{ri(i,()=>{Qi(null)})},30),lr(o)){const t=o.anchor.getNode();t.markDirty(),Xn(t)||r(142),nn(o,t)}}else{Qi(null),t.preventDefault();const n=o.anchor.getNode(),r=n.getTextContent(),s=n.canInsertTextAfter(),l=0===o.anchor.offset&&o.focus.offset===r.length;let c=g&&e&&!l&&s;if(c&&o.isCollapsed()&&(c=!ui(Oo(o.anchor,!0))),!c){Po(i,Gt,!0);const t=Nr();g&&lr(t)&&t.isCollapsed()&&(He=t,setTimeout(()=>He=null))}}return!0}}var s;if(!lr(o))return!0;const l=t.data;null!==We&&mo(!1,i,We),o.dirty&&null===We||!o.isCollapsed()||fi(o.anchor.getNode())||null===n||o.applyDOMRange(n),We=null;const c=o.anchor,a=o.focus,u=c.getNode(),f=a.getNode();if("insertText"===e||"insertTranspose"===e){if("\n"===l)t.preventDefault(),Po(i,qt,!1);else if(l===k)t.preventDefault(),Po(i,Ht,void 0);else if(null==l&&t.dataTransfer){const e=t.dataTransfer.getData("text/plain");t.preventDefault(),o.insertRawText(e)}else null!=l&&Ye(o,n,l,t.timeStamp,!0)?(t.preventDefault(),Po(i,Xt,l)):We=l;return ze=t.timeStamp,!0}switch(t.preventDefault(),e){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":Po(i,Xt,t);break;case"insertFromComposition":Qi(null),Po(i,Xt,t);break;case"insertLineBreak":Qi(null),Po(i,qt,!1);break;case"insertParagraph":Qi(null),Ue&&!d?(Ue=!1,Po(i,qt,!1)):Po(i,Ht,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":Po(i,Yt,t);break;case"deleteByComposition":(function(t,e){return t!==e||li(t)||li(e)||!Vi(t)||!Vi(e)})(u,f)&&Po(i,Qt,t);break;case"deleteByDrag":case"deleteByCut":Po(i,Qt,t);break;case"deleteContent":Po(i,Gt,!1);break;case"deleteWordBackward":Po(i,te,!0);break;
1case"deleteWordForward":Po(i,te,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":Po(i,ee,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":Po(i,ee,!1);break;case"formatStrikeThrough":Po(i,ne,"strikethrough");break;case"formatBold":Po(i,ne,"bold");break;case"formatItalic":Po(i,ne,"italic");break;case"formatUnderline":Po(i,ne,"underline");break;case"historyUndo":Po(i,re,void 0);break;case"historyRedo":Po(i,ie,void 0)}return!0}function sn(t){if(Uo(t.target)&&Ri(t.target))return!0;const e=Jr(),n=Nr(),r=t.data,i=rn(t);if(null!=r&&lr(n)&&Ye(n,i,r,t.timeStamp,!1)){je&&(an(e,r),je=!1);const i=n.anchor.getNode(),o=Jo(Ko(e));if(null===o)return!0;const s=n.isBackward(),l=s?n.anchor.offset:n.focus.offset,f=s?n.focus.offset:n.anchor.offset;a&&!n.isCollapsed()&&Xn(i)&&null!==o.anchorNode&&i.getTextContent().slice(0,l)+r+i.getTextContent().slice(l+f)===po(o.anchorNode)||Po(e,Xt,r);const h=r.length;c&&h>1&&"insertCompositionText"===t.inputType&&!e.isComposing()&&(n.anchor.offset-=h),u||d||p||!e.isComposing()||(Ke=0,Qi(null))}else mo(!1,e,null!==r?r:void 0),je&&(an(e,r||void 0),je=!1);return Zr(),j(Jr()),!0}function ln(t){const e=Jr(),n=Nr();if(lr(n)&&!e.isComposing()){const r=n.anchor,i=n.anchor.getNode();Qi(r.key),(t.timeStamp<Ke+30||"element"===r.type||!n.isCollapsed()||i.getFormat()!==n.format||Xn(i)&&i.getStyle()!==n.style)&&Po(e,Xt,T)}return!0}function cn(t){return an(Jr(),t.data),!0}function an(t,e){const n=t._compositionKey;if(Qi(null),null!==n&&null!=e){if(""===e){const e=eo(n),r=ji(t.getElementByKey(n));return void(null!==r&&null!==r.nodeValue&&Xn(e)&&_o(e,r.nodeValue,null,null,!0))}if("\n"===e[e.length-1]){const e=Nr();if(lr(e)){const n=e.focus;return e.anchor.set(n.key,n.offset,n.type),void Po(t,fe,null)}}}mo(!0,t,e)}function un(t){const e=Jr();if(null==t.key)return!0;if(Ge&&bo(t))return ri(e,()=>{an(e,qe)}),Ge=!1,qe="",!0;if(function(t){return vo(t,"ArrowRight",{shiftKey:"any"})}(t))Po(e,se,t);else if(function(t){return vo(t,"ArrowRight",So)}(t))Po(e,le,t);else if(function(t){return vo(t,"ArrowLeft",{shiftKey:"any"})}(t))Po(e,ce,t);else if(function(t){return vo(t,"ArrowLeft",So)}(t))Po(e,ae,t);else if(function(t){return vo(t,"ArrowUp",{altKey:"any",shiftKey:"any"})}(t))Po(e,ue,t);else if(function(t){return vo(t,"ArrowDown",{altKey:"any",shiftKey:"any"})}(t))Po(e,de,t);else if(function(t){return vo(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})}(t))Ue=!0,Po(e,fe,t);else if(function(t){return" "===t.key}(t))Po(e,he,t);else if(function(t){return l&&vo(t,"o",{ctrlKey:!0})}(t))t.preventDefault(),Ue=!0,Po(e,qt,!0);else if(function(t){return vo(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})}(t))Ue=!1,Po(e,fe,t);else if(function(t){return vo(t,"Backspace",{shiftKey:"any"})||l&&vo(t,"h",{ctrlKey:!0})}(t))bo(t)?Po(e,ge,t):(t.preventDefault(),Po(e,Gt,!0));else if(function(t){return"Escape"===t.key}(t))Po(e,pe,t);else if(function(t){return vo(t,"Delete",{})||l&&vo(t,"d",{ctrlKey:!0})}(t))!function(t){return"Delete"===t.key}(t)?(t.preventDefault(),Po(e,Gt,!1)):Po(e,me,t);else if(function(t){return vo(t,"Backspace",Co)}(t))t.preventDefault(),Po(e,te,!0);else if(function(t){return vo(t,"Delete",Co)}(t))t.preventDefault(),Po(e,te,!1);else if(function(t){return l&&vo(t,"Backspace",{metaKey:!0})}(t))t.preventDefault(),Po(e,ee,!0);else if(function(t){return l&&(vo(t,"Delete",{metaKey:!0})||vo(t,"k",{ctrlKey:!0}))}(t))t.preventDefault(),Po(e,ee,!1);else if(function(t){return vo(t,"b",So)}(t))t.preventDefault(),Po(e,ne,"bold");else if(function(t){return vo(t,"u",So)}(t))t.preventDefault(),Po(e,ne,"underline");else if(function(t){return vo(t,"i",So)}(t))t.preventDefault(),Po(e,ne,"italic");else if(function(t){return vo(t,"Tab",{shiftKey:"any"})}(t))Po(e,_e,t);else if(function(t){return vo(t,"z",So)}(t))t.preventDefault(),Po(e,re,void 0);else if(function(t){return l?vo(t,"z",{metaKey:!0,shiftKey:!0}):vo(t,"y",{ctrlKey:!0})||vo(t,"z",{ctrlKey:!0,shiftKey:!0})}(t))t.preventDefault(),Po(e,ie,void 0);else{const n=e._editorState._selection;null===n||lr(n)?No(t)&&(t.preventDefault(),Po(e,Te,t)):function(t){return vo(t,"c",So)}(t)?(t.preventDefault(),Po(e,we,t)):function(t){return vo(t,"x",So)}(t)?(t.preventDefault(),Po(e,ke,t)):No(t)&&(t.preventDefault(),Po(e,Te,t))}return function(t){return t.ctrlKey||t.shiftKey||t.altKey||t.metaKey}(t)&&e.dispatchCommand(Fe,t),!0}function dn(t){let e=t.__lexicalEventHandles;return void 0===e&&(e=[],t.__lexicalEventHandles=e),e}const fn=new Map;function hn(t){const e=function(t){const e=Ro(t);return e?e.getSelection():null}(t.target);if(null===e)return;const n=Wi(e.anchorNode);
1if(null===n)return;Je&&(Je=!1,ri(n,()=>{const r=Er(),i=e.anchorNode;(Uo(i)||Ji(i))&&ao(br(r,e,n,t))}));const r=ho(n),i=r[r.length-1],o=i._key,s=fn.get(o),l=s||i;l!==n&&tn(e,l,!1),tn(e,n,!0),n!==i?fn.set(o,n):s&&fn.delete(o)}function gn(t){t._lexicalHandled=!0}function pn(t){return!0===t._lexicalHandled}function mn(t){const e=Ze.get(t);if(void 0===e)return;const n=Ve.get(e);if(void 0===n)return;const i=n-1;i>=0||r(164),Ze.delete(t),Ve.set(e,i),0===i&&e.removeEventListener("selectionchange",hn);const o=Zi(t);zi(o)?(function(t){if(null!==t._parentEditor){const e=ho(t),n=e[e.length-1]._key;fn.get(n)===t&&fn.delete(n)}else fn.delete(t._key)}(o),t.__lexicalEditor=null):o&&r(198);const s=dn(t);for(let t=0;t<s.length;t++)s[t]();t.__lexicalEventHandles=[]}function _n(t,e,n){Zr();const r=t.__key,i=t.getParent();if(null===i)return;const o=function(t){const e=Nr();if(!lr(e)||!li(t))return e;const{anchor:n,focus:r}=e,i=n.getNode(),o=r.getNode();return Io(i,t)&&n.set(t.__key,0,"element"),Io(o,t)&&r.set(t.__key,0,"element"),e}(t);let s=!1;if(lr(o)&&e){const e=o.anchor,n=o.focus;e.key===r&&(Tr(e,t,i,t.getPreviousSibling(),t.getNextSibling()),s=!0),n.key===r&&(Tr(n,t,i,t.getPreviousSibling(),t.getNextSibling()),s=!0)}else ar(o)&&e&&t.isSelected()&&t.selectPrevious();if(lr(o)&&e&&!s){const e=t.getIndexWithinParent();Xi(t),wr(o,i,e,-1)}else Xi(t);n||Bo(i)||i.canBeEmpty()||!i.isEmpty()||_n(i,e),e&&o&&fi(i)&&i.isEmpty()&&i.selectEnd()}function yn(t){return t}const xn=Symbol.for("ephemeral");function vn(t){return t[xn]||!1}class Sn{__type;__key;__parent;__prev;__next;__state;static getType(){const{ownNodeType:t}=ls(this);return void 0===t&&r(64,this.name),t}static clone(t){r(65,this.name)}$config(){return{}}config(t,e){const n=e.extends||Object.getPrototypeOf(this.constructor);return Object.assign(e,{extends:n,type:t}),{[t]:e}}afterCloneFrom(t){this.__key===t.__key?(this.__parent=t.__parent,this.__next=t.__next,this.__prev=t.__prev,this.__state=t.__state):t.__state&&(this.__state=t.__state.getWritable(this))}static importDOM;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}),Hi(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=eo(t);if(null===e)break;t=e.__parent}return!1}isSelected(t){const e=t||Nr();if(null==e)return!1;const n=e.getNodes().some(t=>t.__key===this.__key);if(Xn(this))return n;if(lr(e)&&"element"===e.anchor.type&&"element"===e.focus.type){if(e.isCollapsed())return!1;const t=this.getParent();if(ui(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:eo(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(Bo(e))return li(t)||t===this&&ui(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:eo(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:eo(t)}getNextSiblings(){const t=[];let e=this.getNextSibling();for(;null!==e;)t.push(e),e=e.getNextSibling();return t}getCommonAncestor(t){const e=li(this)?this:this.getParent(),n=li(t)?t:t.getParent(),r=e&&n?zs(e,n):null;return r?r.commonAncestor:null}is(t){return null!=t&&this.__key===t.__key}isBefore(t){const e=zs(this,t);return null!==e&&("descendant"===e.type||("branch"===e.type?-1===Rs(e):("same"!==e.type&&"ancestor"!==e.type&&r(279),!1)))}isParentOf(t){const e=zs(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=li(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=Jr()._dirtyLeaves;return null!==t&&t.has(this.__key)}getLatest(){if(vn(this))return this;const t=eo(this.__key);return null===t&&r(113),t}getWritable(){if(vn(this))return this;Zr();const t=$r(),e=Jr(),n=t._nodeMap,r=this.__key,i=this.getLatest(),o=e._cloneNotNeeded,s=Nr();if(null!==s&&s.setCachedNodes(null),o.has(r))return Yi(i),i;const l=ns(i);return o.add(r),Yi(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(),r=e.$;let i=r;for(const t of X(n).flatKeys)t in e&&(void 0!==i&&i!==r||(i={...r}),i[t]=e[t]);return(n.__state||i)&&function(t){const e=t.getWritable(),n=e.__state?e.__state.getWritable(e):new H(e,X(e));return e.__state=n,n}(t).updateFromJSON(i),n}(this,t)}static transform(){return null}remove(t){_n(this,!0,t)}replace(t,e){Zr();let n=Nr();null!==n&&(n=n.clone()),Zo(this,t);const i=this.getLatest(),o=this.__key,s=t.__key,l=t.getWritable(),c=this.getParentOrThrow().getWritable(),a=c.__size;Xi(l);const u=i.getPreviousSibling(),d=i.getNextSibling(),f=i.__prev,h=i.__next,g=i.__parent;if(_n(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&&(li(this)&&li(l)||r(139),this.getChildren().forEac
1h(t=>{l.append(t)})),lr(n)){ao(n);const t=n.anchor,e=n.focus;t.key===o&&or(t,l),e.key===o&&or(e,l)}return to()===o&&Qi(s),l}insertAfter(t,e=!0){Zr(),Zo(this,t);const n=this.getWritable(),r=t.getWritable(),i=r.getParent(),o=Nr();let s=!1,l=!1;if(null!==i){const e=t.getIndexWithinParent();if(Xi(r),lr(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&&lr(o)){const t=this.getIndexWithinParent();wr(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){Zr(),Zo(this,t);const n=this.getWritable(),r=t.getWritable(),i=r.__key;Xi(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=Nr();return e&&lr(a)&&wr(a,this.getParentOrThrow(),c),t}isParentRequired(){return!1}createParentElementNode(){return Si()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(t,e){Zr();const n=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===n)return r.select(0,0);if(li(n))return n.select();if(!Xn(n)){const t=n.getIndexWithinParent()+1;return r.select(t,t)}return n.select(t,e)}selectNext(t,e){Zr();const n=this.getNextSibling(),r=this.getParentOrThrow();if(null===n)return r.select();if(li(n))return n.select(0,0);if(!Xn(n)){const t=n.getIndexWithinParent();return r.select(t,t)}return n.select(t,e)}markDirty(){this.getWritable()}reconcileObservedMutation(t,e){this.markDirty()}}const Cn="historic",bn="history-push",Nn="history-merge",En="paste",wn="collaboration",kn="skip-scroll-into-view",Tn="skip-dom-selection",On="skip-selection-focus";class Mn extends Sn{static getType(){return"linebreak"}static clone(t){return new Mn(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&&Ho(e)){const n=e.firstChild;if(n===t||n.nextSibling===t&&Dn(n)){const n=e.lastChild;if(n===t||n.previousSibling===t&&Dn(n))return!0}}return!1}(t)||function(t){const e=t.parentElement;if(null!==e&&Ho(e)){const n=e.firstChild;if(n===t||n.nextSibling===t&&Dn(n))return!1;const r=e.lastChild;if(r===t||r.previousSibling===t&&Dn(r))return!0}return!1}(t)?null:{conversion:Pn,priority:0}}}static importJSON(t){return An().updateFromJSON(t)}}function Pn(t){return{node:An()}}function An(){return Wo(new Mn)}function Ln(t){return t instanceof Mn}function Dn(t){return Ji(t)&&/^( |\t|\r?\n)+$/.test(t.textContent||"")}function Fn(t,e){return 16&e?"code":128&e?"mark":32&e?"sub":64&e?"sup":null}function In(t,e){return 1&e?"strong":2&e?"em":"span"}function Rn(t,e,n,r,i){const o=r.classList;let s=wo(i,"base");void 0!==s&&o.add(...s),s=wo(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 t in P){const r=P[t];if(s=wo(i,t),void 0!==s)if(n&r){if(l&&("underline"===t||"strikethrough"===t)){e&r&&o.remove(...s);continue}(0===(e&r)||c&&"underline"===t||"strikethrough"===t)&&o.add(...s)}else e&r&&o.remove(...s)}}function Kn(t,e,n){const r=e.firstChild,i=n.isComposing(),o=t+(i?w:"");if(null==r)e.textContent=o;else{const t=r.nodeValue;if(t!==o)if(i||c){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 Bn(t,e,n,r,i,o){Kn(i,t,e);const s=o.theme.text;void 0!==s&&Rn(0,0,r,t,s)}function zn(t,e){const n=document.createElement(e);return n.appendChild(t),n}class Wn extends Sn{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(t){return new Wn(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 I[t.__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===to()}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 0!==(this.getFormat()&e)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(t,e){return Gi(this.getLatest().__format,t,e)}canHaveFormat(){return!0}isInline(){return!0}createDOM(t,e){const n=this.__format,r=Fn(0,n),i=In(0,n),o=null===r?i:r,s=document.createElement(o);let l=s;
1this.hasFormat("code")&&s.setAttribute("spellcheck","false"),null!==r&&(l=document.createElement(i),s.appendChild(l)),Bn(l,this,0,n,this.__text,t);const c=this.__style;return""!==c&&(s.style.cssText=c),s}updateDOM(t,e,n){const i=this.__text,o=t.__format,s=this.__format,l=Fn(0,o),c=Fn(0,s),a=In(0,o),u=In(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 Bn(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)),Kn(i,d,this);const f=n.theme.text;void 0!==f&&o!==s&&Rn(0,o,s,d,f);const h=t.__style,g=this.__style;return h!==g&&(e.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:Un,priority:0}),b:()=>({conversion:Vn,priority:0}),code:()=>({conversion:qn,priority:0}),em:()=>({conversion:qn,priority:0}),i:()=>({conversion:qn,priority:0}),mark:()=>({conversion:qn,priority:0}),s:()=>({conversion:qn,priority:0}),span:()=>({conversion:Zn,priority:0}),strong:()=>({conversion:qn,priority:0}),sub:()=>({conversion:qn,priority:0}),sup:()=>({conversion:qn,priority:0}),u:()=>({conversion:qn,priority:0})}}static importJSON(t){return Hn().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 Uo(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=zn(e,"b")),this.hasFormat("italic")&&(e=zn(e,"i")),this.hasFormat("strikethrough")&&(e=zn(e,"s")),this.hasFormat("underline")&&(e=zn(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?A[t]:t,e}setStyle(t){const e=this.getWritable();return e.__style=t,e}toggleFormat(t){const e=Gi(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=F[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){Zr();let n=t,r=e;const i=Nr(),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(!lr(i))return vr(s,n,s,r,"text","text");{const t=to();t!==i.anchor.key&&t!==i.focus.key||Qi(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=Nr();if(r&&lr(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){Zr();const e=this.getLatest(),n=e.getTextContent();if(""===n)return[];const r=e.__key,i=to(),o=n.length;t.sort((t,e)=>t-e),t.push(o);const s=[],l=t.length;for(let e=0,r=0;e<o&&r<=l;r++){const i=t[r];i>e&&(s.push(n.slice(e,i)),e=i)}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,m=null,_=null;const y=Nr();if(lr(y)){const[t,e]=y.isBackward()?[y.focus,y.anchor]:[y.anchor,y.focus];"text"===t.type&&t.key===r&&(m=t),"text"===e.type&&e.key===r&&(_=e)}e.isSegmented()?(d=Hn(a),d.__format=f,d.__style=h,d.__detail=g,d.__state=et(e,d),p=!0):d=e.setTextContent(a);const x=[d];for(let t=1;t<c;t++){const n=Hn(s[t]);n.__format=f,n.__style=h,n.__detail=g,n.__state=et(e,n);const o=n.__key;i===r&&Qi(o),x.push(n)}const v=m?m.offset:null,S=_?_.offset:null;let C=0;for(const t of x){if(!m&&!_)break;const e=C+t.getTextContentSize();if(null!==m&&null!==v&&v<=e&&v>=C&&(m.set(t.getKey(),v-C,"text"),v<e&&(m=null)),null!==_&&null!==S&&S<=e&&S>=C){_.set(t.getKey(),S-C,"text");break}C=e}if(null!==u){!function(t){const e=t.getPreviousSibling(),n=t.getNextSibling();null!==e&&Yi(e),null!==n&&Yi(n)}(this);const t=u.getWritable(),e=this.getIndexWithinParent();p?(t.splice(e,0,x),this.remove()):t.splice(e,1,x),lr(y)&&wr(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;to()===i&&Qi(n);const l=Nr();if(lr(l)){const r=l.anchor,o=l.focus;
1null!==r&&r.key===i&&Or(r,e,n,t,s),null!==o&&o.key===i&&Or(o,e,n,t,s)}const c=t.__text,a=e?c+o:o+c;this.setTextContent(a);const u=this.getWritable();return t.remove(),u}isTextEntity(){return!1}}function Zn(t){return{forChild:Yn(t.style),node:null}}function Vn(t){const e=t,n="normal"===e.style.fontWeight;return{forChild:Yn(e.style,n?void 0:"bold"),node:null}}const $n=new WeakMap;function Jn(t){if(!Uo(t))return!1;if("PRE"===t.nodeName)return!0;const e=t.style.whiteSpace;return"string"==typeof e&&e.startsWith("pre")}function Un(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=$n.get(n))&&!Jn(n);)r.push(n),n=n.parentNode;const i=void 0===e?n:e;for(let t=0;t<r.length;t++)$n.set(r[t],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(An()):"\t"===r?e.push(tr()):""!==r&&e.push(Hn(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=jn(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=jn(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:Hn(n)}}function jn(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,Uo(n)){const t=n.style.display;if(""===t&&!qo(n)||""!==t&&!t.startsWith("inline"))return null}let r=n;for(;null!==(r=e?n.firstChild:n.lastChild);)n=r;if(Ji(n))return n;if("BR"===n.nodeName)return null}}const Gn={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function qn(t){const e=Gn[t.nodeName.toLowerCase()];return void 0===e?{node:null}:{forChild:Yn(t.style,e),node:null}}function Hn(t=""){return Wo(new Wn(t))}function Xn(t){return t instanceof Wn}function Yn(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=>Xn(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 Qn extends Wn{static getType(){return"tab"}static clone(t){return new Qn(t.__key)}constructor(t){super("\t",t),this.__detail=2}static importDOM(){return null}createDOM(t){const e=super.createDOM(t),n=wo(t.theme,"tab");return void 0!==n&&e.classList.add(...n),e}static importJSON(t){return tr().updateFromJSON(t)}setTextContent(t){return"\t"!==t&&""!==t&&i(126),super.setTextContent("\t")}spliceText(t,e,n,i){return""===n&&0===e||"\t"===n&&1===e||r(286),this}setDetail(t){return 2!==t&&r(127),this}setMode(t){return"normal"!==t&&r(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function tr(){return Wo(new Qn)}function er(t){return t instanceof Qn}class nr{key;offset;type;_selection;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:Is(Hs(Ws(this,"next")),Hs(Ws(t,"next")))<0}getNode(){const t=eo(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,Wr()||(to()===o&&Qi(t),null!==i&&(i.setCachedNodes(null),i.dirty=!0)))}}function rr(t,e,n){return new nr(t,e,n)}function ir(t,e){let n=e.__key,r=t.offset,i="element";if(Xn(e)){i="text";const t=e.getTextContentSize();r>t&&(r=t)}else if(!li(e)){const t=e.getNextSibling();if(Xn(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 or(t,e){if(li(e)){const n=e.getLastDescendant();li(n)||Xn(n)?ir(t,n):ir(t,e)}else ir(t,e)}class sr{_nodes;_cachedNodes;dirty;constructor(t){this._cachedNodes=null,this._nodes=t,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){if(!ar(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 sr(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(Xn(r))i=r.select();else{const t=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(t,t)}i.insertNodes(t);for(let t=0;t<n;t++)e[t].remove()}getNodes(){const t=this._cachedNodes;if(null!==t)return t;const e=this._nodes,n=[];for(const t of e){const e=eo(t);null!==e&&n.push(e)}return Wr()||(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((Nr()||Er())===this&&t[0]){const e=Ns(t[0],"next");Vs(Ds(e,e))}for(const e of t)e.remove()}}function lr(t){return t instanceof cr}class cr{format;style;anchor;focus;_cachedNodes;dirty;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!!lr(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 n of t)if(vs(n)){const{origin:t}=n;
10===e.length?i.add(t):(o.add(t),e.push(t))}else{const{origin:t}=n;li(t)&&o.has(t)||e.push(t)}if(r&&e.push(r.caret.origin),xs(t.focus)&&li(t.focus.origin)&&null===t.focus.getNodeAtCaret())for(let n=Ts(t.focus.origin,"previous");vs(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(e[e.length-1]);n=Os(n))i.delete(n.origin),e.pop();for(;e.length>1;){const t=e[e.length-1];if(!li(t)||o.has(t)||t.isEmpty()||i.has(t))break;e.pop()}if(0===e.length&&t.isCollapsed()){const n=Hs(t.anchor),r=Hs(t.anchor.getFlipped()),i=t=>ys(t)?t.origin:t.getNodeAtCaret(),o=i(n)||i(r)||(t.anchor.getNodeAtCaret()?n.origin:r.origin);e.push(o)}return e}(Qs(Js(this),"next"));return Wr()||(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]=dr(this);let c="",a=!0;for(let u=0;u<t.length;u++){const d=t[u];if(li(d)&&!d.isInline())a||(c+="\n"),a=!d.isEmpty();else if(a=!1,Xn(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=o?t.slice(s):t.slice(l):d===n&&(t=o?t.slice(0,l):t.slice(0,s)),c+=t}else!ui(d)&&!Ln(d)||d===n&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(t){const e=Jr(),n=e.getEditorState()._selection,r=yr(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),ot(this)}clone(){const t=this.anchor,e=this.focus;return new cr(rr(t.key,t.offset,t.type),rr(e.key,e.offset,e.type),this.format,this.style)}toggleFormat(t){this.format=Gi(this.format,t,null),this.dirty=!0}setFormat(t){this.format=t,this.dirty=!0}setStyle(t){this.style=t,this.dirty=!0}hasFormat(t){const e=P[t];return 0!==(this.format&e)}insertRawText(t){const e=t.split(/(\r?\n|\t)/),n=[],r=e.length;for(let t=0;t<r;t++){const r=e[t];"\n"===r||"\r\n"===r?n.push(An()):"\t"===r?n.push(tr()):n.push(Hn(r))}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=Hn();if(s.setFormat(n),s.setStyle(r),Ci(o))o.splice(0,0,[s]);else{const t=fi(i)?Si().append(s):s;null===o?i.append(t):o.insertBefore(t)}t.is(e)&&e.set(s.__key,0,"text"),t.set(s.__key,0,"text")}(s,l,i,o),"element"===l.type&&Zs(l,Hs(Ws(l,"next")));const c=s.offset;let a=l.offset;const u=this.getNodes(),d=u.length;let f=u[0];Xn(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&&($i(f)||!f.canInsertTextAfter()||!g.canInsertTextAfter()&&null===f.getNextSibling())){let e=f.getNextSibling();if(Xn(e)&&e.canInsertTextBefore()&&!$i(e)||(e=Hn(),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&&($i(f)||!f.canInsertTextBefore()||!g.canInsertTextBefore()&&null===f.getPreviousSibling())){let e=f.getPreviousSibling();if(Xn(e)&&!$i(e)||(e=Hn(),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=Hn(f.getTextContent());t.setFormat(i),f.replace(t),f=t}else if(!this.isCollapsed()&&""!==t){const e=p.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||li(e)&&(!e.canInsertTextBefore()||!e.canInsertTextAfter()))return this.insertText(""),_r(this.anchor,this.focus,null),void this.insertText(t)}if(1===d){if(Vi(f)){const e=Hn(t);return e.select(),void f.replace(e)}const e=f.getFormat(),n=f.getStyle();if(c!==a||e===i&&n===o){if(er(f)){const e=Hn(t);return e.setFormat(i),e.setStyle(o),e.select(),void f.replace(e)}}else{if(""!==f.getTextContent()){const e=Hn(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)}const r=a-c;f=f.spliceText(c,r,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=li(f)?f:f.getParentOrThrow();let r=li(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(Xn(p)&&!Vi(p)&&a!==p.getTextContentSize()){if(p.isSegmented()){const t=Hn(p.getTextContent());p.replace(t),p=t}fi(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),m=n.isInline()&&null===f.getNextSibling()?n:f;for(let t=o.length-1;t>=0;t--){const e=o[t];
1if(e.is(f)||li(e)&&e.isParentOf(f))break;e.isAttached()&&(!s.has(e)||e.is(i)?g||m.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(Vi(f))if(c===h)f.select();else{const e=Hn(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],r=n.__key;e.has(r)||n.remove()}}}removeText(){const t=Nr()===this;$s(this,qs(Js(this))),t&&Nr()!==this&&ao(this)}formatText(t,e=null){if(this.isCollapsed())return this.toggleFormat(t),void Qi(null);const n=this.getNodes(),r=[];for(const t of n)Xn(t)&&r.push(t);const i=e=>{n.forEach(n=>{if(li(n)){const r=n.getFormatFlags(t,e);n.setTextFormat(r)}})},o=r.length;if(0===o)return this.toggleFormat(t),Qi(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 m=r[p];const _="text"===u.type?u.offset:m.getTextContentSize();if(f.is(m)){if(h===_)return;if($i(f)||0===h&&_===f.getTextContentSize())f.setFormat(g);else{const t=f.splitText(h,_),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,_-h,"text")}return void(this.format=g)}0===h||$i(f)||([,f]=f.splitText(h),h=0),f.setFormat(g);const y=m.getFormatFlags(t,g);_>0&&(_===m.getTextContentSize()||$i(m)||([m]=m.splitText(_)),m.setFormat(y));for(let e=d+1;e<p;e++){const n=r[e],i=n.getFormatFlags(t,y);n.setFormat(i)}"text"===a.type&&a.set(f.__key,h,"text"),"text"===u.type&&u.set(m.__key,_,"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=Nr();return lr(e)||r(134),e.insertNodes(t)}const e=(this.isBackward()?this.focus:this.anchor).getNode(),n=as(e,Xo),i=t[t.length-1];if(li(n)&&"__language"in n){if("__language"in t[0])this.insertText(t[0].getTextContent());else{const e=Ar(this);n.splice(e,0,t),i.selectEnd()}return}if(!t.some(t=>(li(t)||ui(t))&&!t.isInline())){li(n)||r(211,e.constructor.name,e.getType());const o=Ar(this);return n.splice(o,0,t),void i.selectEnd()}const o=function(t){const e=Si();let n=null;for(let r=0;r<t.length;r++){const i=t[r],o=Ln(i);if(o||ui(i)&&i.isInline()||li(i)&&i.isInline()||Xn(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=li(n)&&n.isEmpty()?null:this.insertParagraph(),a=l[l.length-1];let u=l[0];var d;li(d=u)&&Xo(d)&&!d.isEmpty()&&li(n)&&(!n.isEmpty()||n.canMergeWhenEmpty())&&(li(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 t of o)s=s.insertAfter(t)}(n,u));const f=as(s,Xo);c&&li(f)&&(c.canMergeWhenEmpty()||Xo(a))&&(f.append(...c.getChildren()),c.remove()),li(n)&&n.isEmpty()&&n.remove(),s.selectEnd();const h=li(n)?n.getLastChild():null;Ln(h)&&f!==n&&h.remove()}insertParagraph(){if("root"===this.anchor.key){const t=Si();return lo().splice(this.anchor.offset,0,[t]),t.select(),t}const t=Ar(this),e=as(this.anchor.getNode(),Xo);li(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=An();if(this.insertNodes([e]),t){const t=e.getParentOrThrow(),n=e.getIndexWithinParent();t.select(n,n)}}extract(){const t=[...this.getNodes()],e=t.length;let n=t[0],r=t[e-1];const[i,o]=dr(this),s=this.isBackward(),[l,c]=s?[this.focus,this.anchor]:[this.anchor,this.focus],[a,u]=s?[o,i]:[i,o];if(0===e)return[];if(1===e){if(Xn(n)&&!this.isCollapsed()){const t=n.splitText(a,u),e=0===a?t[0]:t[1];return e?(l.set(e.getKey(),0,"text"),c.set(e.getKey(),e.getTextContentSize(),"text"),[e]):[]}return[n]}if(Xn(n)&&(a===n.getTextContentSize()?t.shift():0!==a&&([,n]=n.splitText(a),t[0]=n,l.set(n.getKey(),0,"text"))),Xn(r)){const e=r.getTextContent().length;0===u?t.pop():u!==e&&([r]=r.splitText(u),t[t.length-1]=r,c.set(r.getKey(),r.getTextContentSize(),"text"))}return t}modify(t,e,n){if(Dr(this,t,e,n))return;const r="move"===t,i=Jr(),o=Jo(Ko(i));if(!o)return;const s=i._blockCursorElement,l=i._rootElement,c=this.focus.getNode();if(null===l||null===s||!li(c)||c.isInline()||c.canBeEmpty()||$o(s,i,l),this.dirty){let t=Lo(i,this.anchor.key),e=Lo(i,this.focus.key);"text"===this.anchor.type&&(t=ji(t)),"text"===this.focus.type&&(e=ji(e)),t&&e&&Mr(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=fi(n)?n:function(t){let e=t.getParentOrThrow();for(;null!==e;){if(Bo(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];Io(e,i)?r.push(e):s=!0}if(s&&r.length>0)if(e){const t=r[0];li(t)?t.selectStart():t.getParentOrThrow().selectStart()}else{const t=r[r.length-1];li(t)?t.selectEnd():t.getParentOrThrow().selectEnd()}
1o.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&&Dr(this,t,e,n,"decorators")}forwardDeletion(t,e,n){if(!n&&("element"===t.type&&li(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(li(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=As(Ws(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(vs(e))if(e.origin.isInline());else{if(e.origin.isShadowRoot()){if("merge-block"===t.type)break;if(li(r.anchor.origin)&&r.anchor.origin.isEmpty()){const t=Hs(e);$s(this,Ds(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(xs(e)){if(li(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(ui(e.origin)){if(e.origin.isIsolated());else if("merge-next-block"===t.type&&(e.origin.isKeyboardSelectable()||!e.origin.isInline())&&li(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();const t=Cr();t.add(e.origin.getKey()),ao(t)}else e.origin.remove();return}break}}if("merge-block"===t.type){const{caret:e,block:n}=t;return $s(this,Ds(!e.origin.isEmpty()&&n.isEmpty()?Us(Ns(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&&fr(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 gr(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 gr(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!(fo(t)||hr(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()&&fi(t.getParent())&&null===t.getPreviousSibling()&&fr(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 ar(t){return t instanceof sr}function ur(t){const e=t.offset;if("text"===t.type)return e;const n=t.getNode();return e===n.getChildrenSize()?n.getTextContent().length:0}function dr(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]:[ur(n),ur(r)]}function fr(t,e){for(let n=e;n;n=n.getParent()){if(li(n)){if(n.collapseAtStart(t))return!0;if(Bo(n))break}if(n.getPreviousSibling())break}return!1}const hr=(()=>{try{const t=new RegExp("\\p{Emoji}","u"),e=t.test.bind(t);if(e("â¤ï¸")&&e("#ï¸â£")&&e("ð"))return e}catch(t){}return()=>!1})();function gr(t,e,n){const r=t,i=r.getTextContent().split(/(?=\s)/g),o=i.length;let s=0,l=0;for(let t=0;t<o;t++){const r=t===o-1;if(l=s,s+=i[t].length,e&&s===n||s>n||r){i.splice(t,1),r&&(l=void 0);break}}const c=i.join("").trim();""===c?r.remove():(r.setTextContent(c),r.select(l,l))}function pr(t,e,n,i){let o,s=e;if(Uo(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=uo(d),Xn(o))s=ws(o,l?"next":"previous");else{let c=uo(t);if(null===c)return null;if(li(c)){const a=i.getElementByKey(c.getKey());null===a&&r(214);const u=c.getDOMSlot(a);
1[c,s]=u.resolveChildIndex(c,a,t,e),li(c)||r(215),l&&s>=c.getChildrenSize()&&(s=Math.max(0,c.getChildrenSize()-1));let d=c.getChildAtIndex(s);if(li(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=li(d)?d:d.getParentOrThrow()),s=0}Xn(d)?(o=d,c=null,s=ws(d,l?"next":"previous")):d!==c&&l&&!f&&(li(c)||r(216),s=Math.min(c.getChildrenSize(),s+1))}else{const n=c.getIndexWithinParent();s=0===e&&ui(c)&&uo(t)===c?n:n+1,c=c.getParentOrThrow()}if(li(c))return rr(c.__key,s,"element")}}else o=uo(t);return Xn(o)?rr(o.__key,ws(o,s,"clamp"),"text"):null}function mr(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&&li(o)&&o.isInline()){const e=o.getPreviousSibling();Xn(e)&&t.set(e.__key,e.getTextContent().length,"text")}}else li(r)&&!n&&r.isInline()?t.set(r.__key,r.getChildrenSize(),"element"):Xn(r)&&t.set(r.__key,r.getTextContent().length,"text")}else if(r===i.getTextContent().length){const r=i.getNextSibling(),o=i.getParent();if(e&&li(r)&&r.isInline())t.set(r.__key,0,"element");else if((n||e)&&null===r&&li(o)&&o.isInline()&&!o.canInsertTextAfter()){const e=o.getNextSibling();Xn(e)&&t.set(e.__key,0,"text")}}}function _r(t,e,n){if("text"===t.type&&"text"===e.type){const r=t.isBefore(e),i=t.is(e);mr(t,r,i),mr(e,!r,i),i&&e.set(t.key,t.offset,t.type);const o=Jr();if(o.isComposing()&&o._compositionKey!==t.key&&lr(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 yr(t,e,n,r,i,o){if(null===t||null===n||!Bi(i,t,n))return null;const s=pr(t,e,lr(o)?o.anchor:null,i);if(null===s)return null;const l=pr(n,r,lr(o)?o.focus:null,i);if(null===l)return null;if("element"===s.type&&"element"===l.type){const e=uo(t),r=uo(n);if(ui(e)&&ui(r))return null}return _r(s,l,o),[s,l]}function xr(t){return li(t)&&!t.isInline()}function vr(t,e,n,r,i,o){const s=$r(),l=new cr(rr(t,e,i),rr(n,r,o),0,"");return l.dirty=!0,s._selection=l,l}function Sr(){const t=rr("root",0,"element"),e=rr("root",0,"element");return new cr(t,e,0,"")}function Cr(){return new sr(new Set)}function br(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=!B&&(l||"beforeinput"===s||"compositionstart"===s||"compositionend"===s||"click"===s&&o&&3===o.detail||"drop"===s||void 0===s);let a,u,d,f;if(lr(t)&&!c)return t.clone();if(null===e)return null;if(a=e.anchorNode,u=e.focusNode,d=e.anchorOffset,f=e.focusOffset,(l||void 0===s)&&lr(t)&&!Bi(n,a,u))return t.clone();const h=yr(a,d,u,f,n,t);if(null===h)return null;const[g,p]=h;return new cr(g,p,lr(t)?t.format:0,lr(t)?t.style:"")}function Nr(){return $r()._selection}function Er(){return Jr()._editorState._selection}function wr(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"),kr(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")}}kr(t)}function kr(t){const e=t.anchor,n=e.offset,r=t.focus,i=r.offset,o=e.getNode(),s=r.getNode();if(t.isCollapsed()){if(!li(o))return;const t=o.getChildrenSize(),i=n>=t,s=i?o.getChildAtIndex(t-1):o.getChildAtIndex(n);if(Xn(s)){let t=0;i&&(t=s.getTextContentSize()),e.set(s.__key,t,"text"),r.set(s.__key,t,"text")}return}if(li(o)){const t=o.getChildrenSize(),r=n>=t,i=r?o.getChildAtIndex(t-1):o.getChildAtIndex(n);if(Xn(i)){let t=0;r&&(t=i.getTextContentSize()),e.set(i.__key,t,"text")}}if(li(s)){const t=s.getChildrenSize(),e=i>=t,n=e?s.getChildAtIndex(t-1):s.getChildAtIndex(i);if(Xn(n)){let t=0;e&&(t=n.getTextContentSize()),r.set(n.__key,t,"text")}}}function Tr(t,e,n,r,i){let o=null,s=0,l=null;null!==r?(o=r.__key,Xn(r)?(s=r.getTextContentSize(),l="text"):li(r)&&(s=r.getChildrenSize(),l="element")):null!==i&&(o=i.__key,Xn(i)?l="text":li(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 Or(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 Mr(t,e,n,r,i){try{t.setBaseAndExtent(e,n,r,i)}catch(t){}}function Pr(t){let e=Nr()||Er();
1null===e&&(e=lo().selectEnd()),e.insertNodes(t)}function Ar(t){let e=t;t.isCollapsed()||e.removeText();const n=Nr();lr(n)&&(e=n),lr(e)||r(161);const i=e.anchor;let o=i.getNode(),s=i.offset;for(;!Xo(o);){const t=o;if([o,s]=Lr(o,s),t.is(o))break}return s}function Lr(t,e){const n=t.getParent();if(!n){const t=Si();return lo().append(t),t.select(),[lo(),0]}if(Xn(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(!li(t)||0===e)return[n,t.getIndexWithinParent()];const r=t.getChildAtIndex(e);if(r){const n=new cr(rr(t.__key,e,"element"),rr(t.__key,e,"element"),0,""),i=t.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,t.getIndexWithinParent()+1]}function Dr(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=Ws(t.focus,n?"previous":"next"),s="lineboundary"===r,l="move"===e;let c=o,a="decorators-and-blocks"===i;if(!Xs(c)){for(const t of c){a=!1;const{origin:e}=t;if(!ui(e)||e.isIsolated()||(c=t,!s||!e.isInline()))break}if(a)for(const t of As(o).iterNodeCarets("extend"===e?"shadowRoot":"root")){if(vs(t))t.origin.isInline()||(c=t);else{if(li(t.origin))continue;ui(t.origin)&&!t.origin.isInline()&&(c=t)}break}}if(c===o)return!1;if(l&&!s&&ui(c.origin)&&c.origin.isKeyboardSelectable()){const t=Cr();return t.add(c.origin.getKey()),ao(t),!0}return c=Hs(c),l&&Zs(t.anchor,c),Zs(t.focus,c),a||!s}let Fr=null,Ir=null,Rr=!1,Kr=!1,Br=0;const zr={characterData:!0,childList:!0,subtree:!0};function Wr(){return Rr||null!==Fr&&Fr._readOnly}function Zr(){Rr&&r(13)}function Vr(){Br>99&&r(14)}function $r(){return null===Fr&&r(195,Ur()),Fr}function Jr(){return null===Ir&&r(196,Ur()),Ir}function Ur(){let t=0;const e=new Set,n=Mi.version;if("undefined"!=typeof window)for(const r of document.querySelectorAll("[contenteditable]")){const i=Zi(r);if(zi(i))t++;else if(i){let t=String(i.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 jr(t,e,n){const r=e.__type,i=Di(t,r);let o=n.get(r);void 0===o&&(o=Array.from(i.transforms),n.set(r,o));const s=o.length;for(let t=0;t<s&&(o[t](e),e.isAttached());t++);}function Gr(t,e){return void 0!==t&&t.__key!==e&&t.isAttached()}function qr(t,e){if(!e)return;const n=t._updateTags;let r=e;Array.isArray(e)||(r=[e]);for(const t of r)n.add(t)}function Hr(t){return Xr(t,Jr()._nodes)}function Xr(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(li(s)&&Array.isArray(l))for(let t=0;t<l.length;t++){const n=Xr(l[t],e);s.append(n)}return s}function Yr(t,e,n){const r=Fr,i=Rr,o=Ir;Fr=e,Rr=!0,Ir=t;try{return n()}finally{Fr=r,Rr=i,Ir=o}}function Qr(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=Fr,u=Rr,d=Ir,f=t._updating,h=t._observer;let g=null;if(t._pendingEditorState=null,t._editorState=n,!i&&c&&null!==h){Ir=t,Fr=n,Rr=!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){_t="",vt="",St=2===r,ct=n,lt=n._config,at=n._nodes,ut=ct._listeners.mutation,dt=i,ft=o,ht=t._nodeMap,gt=e._nodeMap,Ct=e._readOnly,pt=new Map(n._keyToDOMMap);const s=new Map;return mt=s,It("root",null),ct=void 0,at=void 0,dt=void 0,ft=void 0,ht=void 0,gt=void 0,lt=void 0,pt=void 0,mt=void 0,s}(o,n,t,e,r,i)}catch(e){if(e instanceof Error&&t._onError(e),Kr)throw e;return ki(t,null,r,n),G(t),t._dirtyType=2,Kr=!0,Qr(t,o),void(Kr=!1)}finally{h.observe(r,zr),t._updating=f,Fr=a,Rr=u,Ir=d}}n._readOnly||(n._readOnly=!0);const p=t._dirtyLeaves,_=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;
1for(o in r)i.has(o)||(r===n&&(r=oo(t)),delete r[o])}(t,n);const S=i?null:Jo(Ko(t));if(t._editable&&null!==S&&(c||null===l||l.dirty||!l.is(s))&&null!==r&&!x.has(Tn)){Ir=t,Fr=n;try{if(null!==h&&h.disconnect(),c||null===l||l.dirty){const e=t._blockCursorElement;null!==e&&$o(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(wn)&&u!==o||null!==u&&Ki(u))return;if(!lr(e))return void(null!==t&&Bi(n,s,l)&&r.removeAllRanges());const d=e.anchor,f=e.focus,h=d.key,g=f.key,p=Lo(n,h),m=Lo(n,g),_=d.offset,y=f.offset,x=e.format,v=e.style,S=e.isCollapsed();let C=p,b=m,N=!1;if("text"===d.type){C=ji(p);const t=d.getNode();N=t.getFormat()!==x||t.getStyle()!==v}else lr(t)&&"text"===t.anchor.type&&(N=!0);var E,w,k,T,O;if("text"===f.type&&(b=ji(m)),null!==C&&null!==b&&(S&&(null===t||N||lr(t)&&(t.format!==x||t.style!==v))&&(E=x,w=v,k=_,T=h,O=performance.now(),Xe=[E,w,k,T,O]),c!==_||a!==y||s!==C||l!==b||"Range"===r.type&&S||(null!==u&&o.contains(u)||i.has(On)||o.focus({preventScroll:!0}),"element"===d.type))){if(Mr(r,C,_,b,y),!i.has(kn)&&e.isCollapsed()&&null!==o&&o===document.activeElement){const t=lr(e)&&"element"===e.anchor.type?C.childNodes[_]||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=Fo(n),i=Ro(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=Ko(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=Do(a)}}(n,e,o)}}$e=!0}}(s,l,t,S,x,r)}!function(t,e,n){let r=t._blockCursorElement;if(lr(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())Vo(o.getChildAtIndex(s-1))&&(l=!0);else{const e=o.getChildAtIndex(s);if(null!==e&&Vo(e)){const n=e.getPreviousSibling();(null===n||Vo(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=m(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&&$o(r,t,e)}(t,r,l)}finally{null!==h&&h.observe(r,zr),Ir=d,Fr=a}}null!==g&&function(t,e,n,r,i){const o=Array.from(t._listeners.mutation),s=o.length;for(let t=0;t<s;t++){const[s,l]=o[t];for(const t of l){const o=e.get(t);void 0!==o&&s(o,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}}(t,g,x,p,o),lr(l)||null===l||null!==s&&s.is(l)||t.dispatchCommand(Wt,void 0);const C=t._pendingDecorators;null!==C&&(t._decorators=C,t._pendingDecorators=null,ti("decorator",t,!0,C)),function(t,e,n){const r=so(e),i=so(n);r!==i&&ti("textcontent",t,!0,i)}(t,e||o,n),ti("update",t,!0,{dirtyElements:_,dirtyLeaves:p,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;ni(t,e,r)}}}(t)}function ti(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 ei(t,e){const n=t._updates;let i=e||!1;for(;0!==n.length;){const e=n.shift();if(e){const[n,o]=e,s=t._pendingEditorState;let l;void 0!==o&&(l=o.onUpdate,o.skipTransforms&&(i=!0),o.discrete&&(null===s&&r(191),s._flushSync=!0),l&&t._deferred.push(l),qr(t,o.tag)),null==s?ni(t,n,o):n()}}return i}function ni(t,e,n){const i=t._updateTags;let o,s=!1,l=!1;
1void 0!==n&&(o=n.onUpdate,qr(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=hi(a||c),u=!0),a._flushSync=l;const d=Fr,f=Rr,h=Ir,g=t._updating;Fr=a,Rr=!1,t._updating=!0,Ir=t;const p=t._headless||null===t.getRootElement();Ai(null);try{u&&(p?null!==c._selection&&(a._selection=c._selection.clone()):a._selection=function(t,e){const n=t.getEditorState()._selection,r=Jo(Ko(t));return lr(n)||null==n?br(n,r,t,e):n.clone()}(t,n&&n.event||null));const i=t._compositionKey;e(),s=ei(t,s),function(t,e){const n=e.getEditorState()._selection,r=t._selection;if(lr(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 t of n){const e=r.get(t);Xn(e)&&e.isAttached()&&e.isSimpleText()&&!e.isUnmergeable()&&it(e)}}(a,t):function(t,e){const n=e._dirtyLeaves,r=e._dirtyElements,i=t._nodeMap,o=to(),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);Xn(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&it(r),void 0!==r&&Gr(r,o)&&jr(e,r,s),n.add(t)}if(l=e._dirtyLeaves,c=l.size,c>0){Br++;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&&Gr(c,o)&&jr(e,c,s)}l=e._dirtyLeaves,c=l.size,a=e._dirtyElements,u=a.size,Br++}e._dirtyLeaves=n,e._dirtyElements=r}(a,t),ei(t),function(t,e,n,r){const i=t._nodeMap,o=e._nodeMap,s=[];for(const[t]of r){const e=o.get(t);void 0!==e&&(e.isAttached()||(li(e)&&K(e,t,i,o,s,r),i.has(t)||r.delete(t),s.push(t)))}for(const t of s)o.delete(t);for(const t of n){const e=o.get(t);void 0===e||e.isAttached()||(i.has(t)||n.delete(t),o.delete(t))}}(c,a,t._dirtyLeaves,t._dirtyElements)),i!==t._compositionKey&&(a._flushSync=!0);const o=a._selection;if(lr(o)){const t=a._nodeMap,e=o.anchor.key,n=o.focus.key;void 0!==t.get(e)&&void 0!==t.get(n)||r(19)}else ar(o)&&0===o._nodes.size&&(a._selection=null)}catch(e){return e instanceof Error&&t._onError(e),t._pendingEditorState=c,t._dirtyType=2,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements.clear(),void Qr(t)}finally{Fr=d,Rr=f,Ir=h,t._updating=g,Br=0}const m=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);m?a._flushSync?(a._flushSync=!1,Qr(t)):u&&Ii(()=>{Qr(t)}):(a._flushSync=!1,u&&(i.clear(),t._deferred=[],t._pendingEditorState=null))}function ri(t,e,n){Ir===t&&void 0===n?e():ni(t,e,n)}class ii{element;before;after;constructor(t,e,n){this.element=t,this.before=e||null,this.after=n||null}withBefore(t){return new ii(this.element,t,this.after)}withAfter(t){return new ii(this.element,this.before,t)}withElement(t){return this.element===t?this:new ii(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){if(null===t)this.removeManagedLineBreak();else{const e="decorator"===t&&(p||d||u);this.insertManagedLineBreak(e)}}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=oi(e,n);i.push(r);const o=oi(e,this.element);let s=t.getIndexWithinParent();for(let t=0;t<o.length;t++){const e=i[t],n=o[t];if(void 0===e||e<n)break;if(e>n){s+=1;break}}return[t.getParentOrThrow(),s]}}function oi(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 si extends Sn{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;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.__key===t.__key&&(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 D[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=Jr()._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(Xn(e)&&t.push(e),li(e)){const n=e.getAllTextNodes();t.push(...n)}e=e.getNextSibling()}return t}getFirstDescendant(){let t=this.getFirstChild();for(;li(t);){const e=t.getFirstChild();if(null===e)break;t=e}return t}getLastDescendant(){let t=this.getLastChild();for(;li(t);){const e=t.getLastChild();if(null===e)break;t=e}return t}getDescendantByIndex(t){const e=this.getChildren(),n=e.length;if(t>
vendor: 2,088 bytes, line 1
1=n){const t=e[n-1];return li(t)&&t.getLastDescendant()||t||null}const r=e[t];return li(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const t=this.getLatest().__first;return null===t?null:eo(t)}getFirstChildOrThrow(){const t=this.getFirstChild();return null===t&&r(45,this.__key),t}getLastChild(){const t=this.getLatest().__last;return null===t?null:eo(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(),li(i)&&r!==n-1&&!i.isInline()&&(t+=k)}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(),li(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=L[t];return 0!==(this.getFormat()&e)}return!1}hasTextFormat(t){const e=P[t];return 0!==(this.getTextFormat()&e)}getFormatFlags(t,e){return Gi(this.getLatest().__textFormat,t,e)}getTextStyle(){return this.getLatest().__textStyle}select(t,e){Zr();const n=Nr();let r=t,i=e;const o=this.getChildrenSize();if(!this.canBeEmpty())if(0===t&&0===e){const t=this.getFirstChild();if(Xn(t)||li(t))return t.select(0,0)}else if(!(void 0!==t&&t!==o||void 0!==e&&e!==o)){const t=this.getLastChild();if(Xn(t)||li(t))return t.select()}void 0===r&&(r=o),void 0===i&&(i=o);const s=this.__key;return lr(n)?(n.anchor.set(s,r,"element"),n.focus.set(s,i,"element"),n.dirty=!0,n):vr(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();
1return 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?L[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){vn(this)&&r(324,this.__key,this.__type);const i=this.getChildrenSize(),o=this.getWritable();t+e<=i||r(226,String(t),String(e),String(i));const s=o.__key,l=[],c=[],a=this.getChildAtIndex(t+e);let u=null,d=i-e+n.length;if(0!==t)if(t===i)u=this.getLastChild();else{const e=this.getChildAtIndex(t);null!==e&&(u=e.getPreviousSibling())}if(e>0){let t=null===u?this.getFirstChild():u.getNextSibling();for(let n=0;n<e;n++){null===t&&r(100);const e=t.getNextSibling(),n=t.__key;Xi(t.getWritable()),c.push(n),t=e}}let f=u;for(const t of n){null!==f&&t.is(f)&&(u=f=f.getPreviousSibling());const e=t.getWritable();e.__parent===s&&d--,Xi(e);const n=t.__key;if(null===f)o.__first=n,e.__prev=null;else{const t=f.getWritable();t.__next=n,e.__prev=t.__key}t.__key===s&&r(76),e.__parent=s,l.push(n),f=t}if(t+e===i)null!==f&&(f.getWritable().__next=null,o.__last=f.__key);else if(null!==a){const t=a.getWritable();if(null!==f){const e=f.getWritable();t.__prev=f.__key,e.__next=a.__key}else t.__prev=null}if(o.__size=d,c.length){const t=Nr();if(lr(t)){const e=new Set(c),n=new Set(l),{anchor:r,focus:i}=t;ci(r,e,n)&&Tr(r,r.getNode(),this,u,a),ci(i,e,n)&&Tr(i,i.getNode(),this,u,a),0!==d||this.canBeEmpty()||Bo(this)||this.remove()}}return o}getDOMSlot(t){return new ii(t)}exportDOM(t){const{element:e}=super.exportDOM(t);if(Uo(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&&""===n||Bo(this)||this.getChildren().some(Xn)||(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 t=this.getFirstChild();t;t=t.getNextSibling()){const i=e.getElementByKey(t.getKey());null!==i&&(null==r?(n.insertChild(i),r=i):r!==i&&n.replaceChild(i,r),r=r.nextSibling)}}}function li(t){return t instanceof si}function ci(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 ai extends Sn{decorate(t,e){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function ui(t){return t instanceof ai}class di extends si{__cachedText;static getType(){return"root"}static clone(){return new di}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){r(51)}getTextContent(){const t=this.__cachedText;return!Wr()&&0!==Jr()._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 t of n)li(t)||ui(t)||r(282);return super.splice(t,e,n)}static importJSON(t){return lo().updateFromJSON(t)}collapseAtStart(){return!0}}function fi(t){return t instanceof di}function hi(t){return new _i(new Map(t._nodeMap))}function gi(){return new _i(new Map([["root",new di]]))}function pi(t){const e=t.exportJSON(),n=t.constructor;if(e.type!==n.getType()&&r(130,n.name),li(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=pi(o[t]);i.push(e)}}return e}function mi(t){return t instanceof _i}class _i{_nodeMap;_selection;_flushSync;_readOnly;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 _i(this._nodeMap,void 0===t?this._selection:t);return e._readOnly=!0,e}toJSON(){return Yr(null,this,()=>({root:pi(lo())}))}}class yi extends si{static getType(){return"artificial"}createDOM(t){return document.createElement("div")}}class xi extends si{static getType(){return"paragraph"}static clone(t){return new xi(t.__key)}createDOM(t){const e=document.createElement("p"),n=wo(t.theme,"paragraph");return void 0!==n&&e.classList.add(...n),e}updateDOM(t,e,n){return!1}static importDOM(){return{p:t=>({conversion:vi,priority:0})}}exportDOM(t){const{element:e}=super.exportDOM(t);if(Uo(e)){this.isEmpty()&&e.append(document.createElement("br"));const t=this.getFormatType();t&&(e.style.textAlign=t)}return{element:e}}static importJSON(t){return Si().updateFromJSON(t)}exportJSON(){const t=super.exportJSON();if(void 0===t.textFormat||void 0===t.textStyle){const e=this.getChildren().find(Xn);e?(t.textFormat=e.getFormat(),t.textStyle=e.getStyle()):(t.textFormat=this.getTextFormat(),t.textStyle=this.getTextStyle())}return t}insertNewAfter(t,e){const n=Si();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||Xn(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 vi(t){const e=Si();return t.style&&(e.setFormat(t.style.textAlign),is(t,e)),{node:e}}function Si(){return Wo(new xi)}function Ci(t){return t instanceof xi}const bi=0,Ni=1,Ei=3,wi=4;function ki(t,e,n,r){const i=t._keyToDOMMap;i.clear(),t._editorState=gi(),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 Ti(t){const e=new Set,n=new Set;let r=t;for(;r;){const{ownNodeConfig:t}=ls(r),i=r.transform;if(!n.has(i)){n.add(i);const t=r.transform();t&&e.add(t)}if(t){const n=t.$transform;n&&e.add(n),r=t.extends}else{const t=Object.getPrototypeOf(r);r=t.prototype instanceof Sn&&t!==Sn?t:void 0}}return e}function Oi(t){const e=t||{},n=Ir,r=e.theme||{},i=void 0===t?n:e.parentEditor||null,o=e.disableEvents||!1,s=gi(),l=e.namespace||(null!==i?i._config.namespace:go()),c=e.editorState,a=[di,Wn,Mn,Qn,xi,yi,...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}ls(e);const i=e.getType(),o=Ti(e);h.set(i,{exportDOM:d&&d.export?d.export.get(e):void 0,klass:e,replace:n,replaceWithKlass:r,sharedNodeState:q(a[t]),transforms:o})}}const g=new Mi(s,i,h,{disableEvents:o,namespace:l,theme:r},u||console.error,function(t,e){const n=new Map,r=new Set,i=t=>
1{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),function(t){t.registerCommand($t,on,bi),t.registerCommand(Jt,sn,bi),t.registerCommand(Ut,ln,bi),t.registerCommand(jt,cn,bi),t.registerCommand(oe,un,bi)}(g),g}class Mi{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;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=go(),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;let o=i.get(e);void 0===o&&(o=new Set,i.set(e,o)),o.add(r);const s=n&&n.skipInitialization;return void 0!==s&&s||this.initializeMutationListener(e,r),()=>{o.delete(r),0===o.size&&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=es(n).get(e.getType());if(!r)return;const i=new Map;for(const t of r.keys())i.set(t,"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=es(t.getEditorState()),r=[];for(const t of e){const e=n.get(t);e&&r.push(e)}0!==r.length&&t.update(()=>{for(const t of r)for(const e of t.keys()){const t=eo(e);t&&t.markDirty()}},null===t._pendingEditorState?{tag:Nn}: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 Po(this,t,e)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){const e=this._rootElement;
1if(t!==e){const n=wo(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=t,ki(this,e,t,r),null!==e&&(this._config.disableEvents||mn(e),null!=n&&e.classList.remove(...n)),null!==t){const e=Ro(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,G(this),this._updateTags.add(Nn),Qr(this),this._config.disableEvents||function(t,e){const n=t.ownerDocument;Ze.set(t,n);const r=Ve.get(n)??0;r<1&&n.addEventListener("selectionchange",hn),Ve.set(n,r+1),t.__lexicalEditor=e;const i=dn(t);for(let n=0;n<Re.length;n++){const[r,o]=Re[n],s="function"==typeof o?t=>{pn(t)||(gn(t),(e.isEditable()||"click"===r)&&o(t,e))}:t=>{if(pn(t))return;gn(t);const n=e.isEditable();switch(r){case"cut":return n&&Po(e,ke,t);case"copy":return Po(e,we,t);case"paste":return n&&Po(e,Yt,t);case"dragstart":return n&&Po(e,be,t);case"dragover":return n&&Po(e,Ne,t);case"dragend":return n&&Po(e,Ee,t);case"focus":return n&&Po(e,Le,t);case"blur":return n&&Po(e,De,t);case"drop":return n&&Po(e,Se,t)}};t.addEventListener(r,s),i.push(()=>{t.removeEventListener(r,s)})}}(t,this),null!=n&&t.classList.add(...n)}else this._window=null,this._updateTags.add(Nn),Qr(this);ti("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=hi(t),n._selection=t._selection?t._selection.clone():null),j(this);const i=this._pendingEditorState,o=this._updateTags,s=void 0!==e?e.tag:null;null===i||i.isEmpty()||(null!=s&&o.add(s),Qr(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=s&&o.add(s),this._updating||Qr(this)}parseEditorState(t,e){return function(t,e,n){const r=gi(),i=Fr,o=Rr,s=Ir,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,Fr=r,Rr=!1,Ir=e,Ai(null);try{const i=e._nodes;Xr(t.root,i),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,Fr=i,Rr=o,Ir=s}return r}("string"==typeof t?JSON.parse(t):t,this,e)}read(t){return Qr(this),this.getEditorState().read(t,{editor:this})}update(t,e){!function(t,e,n){t._updating?t._updates.push([e,n]):ni(t,e,n)}(this,t,e)}focus(t,e={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),ri(this,()=>{const r=Nr(),i=lo();null!==r?r.dirty||ao(r.clone()):0!==i.getChildrenSize()&&("rootStart"===e.defaultSelection?i.selectStart():i.selectEnd()),Zr(),Jr()._updateTags.add("focus"),function(t){Zr(),Jr()._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=Jo(this._window);null!==e&&e.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,ti("editable",this,!0,t))}toJSON(){return{editorState:this._editorState.toJSON()}}}Mi.version="0.39.0+prod.esm";let Pi=null;function Ai(t){Pi=t}let Li=1;function Di(t,e){const n=Fi(t,e);return void 0===n&&r(30,e),n}function Fi(t,e){return t._nodes.get(e)}const Ii="function"==typeof queueMicrotask?queueMicrotask:t=>{Promise.resolve().then(t)};function Ri(t){return ui(io(t))}function Ki(t){const e=document.activeElement;if(!Uo(e))return!1;const n=e.nodeName;return ui(io(t))&&("INPUT"===n||"TEXTAREA"===n||"true"===e.contentEditable&&null==Zi(e))}function Bi(t,e,n){const r=t.getRootElement();try{return null!==r&&r.contains(e)&&r.contains(n)&&null!==e&&!Ki(e)&&Wi(e)===t}catch(t){return!1}}function zi(t){return t instanceof Mi}function Wi(t){let e=t;for(;null!=e;){const t=Zi(e);if(zi(t))return t;e=Do(e)}return null}function Zi(t){return t?t.__lexicalEditor:null}function Vi(t){return er(t)||t.isToken()}function $i(t){return Vi(t)||t.isSegmented()}function Ji(t){return jo(t)&&3===t.nodeType}function Ui(t){return jo(t)&&9===t.nodeType}function ji(t){let e=t;for(;null!=e;){if(Ji(e))return e;e=e.firstChild}return null}function Gi(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 qi(t){return Xn(t)||Ln(t)||ui(t)}function Hi(t,e){const n=function(){const t=Pi;return Pi=null,t}();if(null!=(e=e||n&&n.__key))return void(t.__key=e);Zr(),Vr();const r=Jr(),i=$r(),o=""+Li++;i._nodeMap.set(o,t),li(t)?r._dirtyElements.set(o,!0):r._dirtyLeaves.add(o),r._cloneNotNeeded.add(o),r._dirtyType=1,t.__key=o}function Xi(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 Yi(t){Vr(),vn(t)&&r(323,t.__key,t.__type);const e=t.getLatest(),n=e.__parent,i=$r(),o=Jr(),s=i._nodeMap,l=o._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,s,l);const c=e.__key;o._dirtyType=1,li(t)?l.set(c,!0):o._dirtyLeaves.add(c)}function Qi(t){Zr();const e=Jr(),n=e._compositionKey;if(t!==n){if(e._compositionKey=t,null!==n){const t=eo(n);null!==t&&t.getWritable()}if(null!==t){const e=eo(t);null!==e&&e.getWritable()}}}function to(){return Wr()?null:Jr()._compositionKey}function eo(t,e){const n=(e||$r())._nodeMap.get(t);return void 0===n?null:n}function no(t,e){const n=ro(t,Jr());return void 0!==n?eo(n,e):null}function ro(t,e){return t[`__lexicalKey_${e._key}`]}function io(t,e){let n=t;for(;null!=n;){const t=no(n,e);if(null!==t)return t;n=Do(n)}return null}function oo(t){const e=t._decorators,n=Object.assign({},e);return t._pendingDecorators=n,n}function so(t){return t.read(()=>lo().getTextContent())}function lo(){return co($r())}function co(t){return t._nodeMap.get("root")}function ao(t){Zr();const e=$r();null!==t&&(t.dirty=!0,t.setCachedNodes(null)),e._selection=t}function uo(t){const e=Jr(),n=function(t,e){let n=t;for(;null!=n;){const t=ro(n,e);if(void 0!==t)return t;n=Do(n)}return null}(t,e);return null===n?t===e.getRootElement()?eo("root"):null:eo(n)}function fo(t){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(t)}function ho(t){const e=[];let n=t;for(;null!==n;)e.push(n),n=n._parentEditor;return e}function go(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function po(t){return Ji(t)?t.nodeValue:null}function mo(t,e,n){const r=Jo(Ko(e));if(null===r)return;const i=r.anchorNode;let{anchorOffset:o,focusOffset:s}=r;if(null!==i){let e=po(i);const r=io(i);if(null!==e&&Xn(r)){if(e===w&&n){const t=n.length;e=n,o=t,s=t}null!==e&&_o(r,e,o,s,t)}}}function _o(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]===w&&(l=e.slice(0,-1));const c=o.getTextContent();if(i||l!==c){if(""===l){if(Qi(null),u||d||p)o.remove();else{const t=Jr();setTimeout(()=>{t.update(()=>{o.isAttached()&&o.remove()})},20)}return}const e=o.getParent(),i=Er(),c=o.getTextContentSize(),a=to(),f=o.getKey();if(o.isToken()||null!==a&&f===a&&!s||lr(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=Nr();if(!lr(h)||null===n||null===r)return void yo(o,l,h);if(h.setTextNodeRange(o,n,o,r),o.isSegmented()){const t=Hn(o.getTextContent());o.replace(t),o=t}yo(o,l,h)}}}function yo(t,e,n){if(t.setTextContent(e),lr(n)){const e=t.getKey();for(const r of["anchor","focus"]){const i=n[r];"text"===i.type&&i.key===e&&(i.offset=ws(t,i.offset,"clamp"))}}}function xo(t,e,n){const r=e[n]||!1;return"any"===r||r===t[n]}function vo(t,e,n){return function(t,e){return xo(t,e,"altKey")&&xo(t,e,"ctrlKey")&&xo(t,e,"shiftKey")&&xo(t,e,"metaKey")}(t,n)&&t.key.toLowerCase()===e.toLowerCase()}const So={ctrlKey:!l,metaKey:l},Co={altKey:l,ctrlKey:!l};function bo(t){return"Backspace"===t.key}function No(t){return vo(t,"a",So)}function Eo(t){const e=lo();if(lr(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"),ot(t),t}{const t=e.select(0,e.getChildrenSize());return ao(ot(t)),t}}
1function wo(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=m(i);return n[e]=t,t}return i}function ko(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 To(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 Oo(t,e){const n=t.offset;if("element"===t.type)return To(t.getNode(),e,n);{const r=t.getNode();if(e&&0===n||!e&&n===r.getTextContentSize()){const t=e?r.getPreviousSibling():r.getNextSibling();return null===t?To(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):t}}return null}function Mo(t){const e=Ko(t).event,n=e&&e.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function Po(t,e,n){return function(t,e,n){const r=ho(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(ri(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 Ao(t){return!fi(t)&&!t.isLastChild()&&!t.isInline()}function Lo(t,e){const n=t._keyToDOMMap.get(e);return void 0===n&&r(75,e),n}function Do(t){const e=t.assignedSlot||t.parentElement;return Go(e)?e.host:e}function Fo(t){return Ui(t)?t:Uo(t)?t.ownerDocument:null}function Io(t,e){let n=t.getParent();for(;null!==n;){if(n.is(e))return!0;n=n.getParent()}return!1}function Ro(t){const e=Fo(t);return e?e.defaultView:null}function Ko(t){const e=t._window;return null===e&&r(78),e}function Bo(t){return fi(t)||li(t)&&t.isShadowRoot()}function zo(t){const e=t.constructor.clone(t);return Hi(e,null),e.afterCloneFrom(t),e}function Wo(t){const e=Jr(),n=t.getType(),i=Fi(e,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 Zo(t,e){!fi(t.getParent())||li(e)||ui(e)||r(99)}function Vo(t){return(ui(t)||li(t)&&!t.canBeEmpty())&&!t.isInline()}function $o(t,e,n){n.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=t.parentElement;null!==r&&r.removeChild(t)}function Jo(t){return o?(t||window).getSelection():null}function Uo(t){return jo(t)&&1===t.nodeType}function jo(t){return"object"==typeof t&&null!==t&&"nodeType"in t&&"number"==typeof t.nodeType}function Go(t){return jo(t)&&11===t.nodeType}function qo(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 Ho(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 Xo(t){if(ui(t)&&!t.isInline())return!0;if(!li(t)||Bo(t))return!1;const e=t.getFirstChild(),n=null===e||Ln(e)||Xn(e)||e.isInline();return!t.isInline()&&!1!==t.canBeEmpty()&&n}function Yo(){return Jr()}const Qo=new WeakMap,ts=new Map;function es(t){if(!t._readOnly&&t.isEmpty())return ts;t._readOnly||r(192);let e=Qo.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),Qo.set(t,e)),e}function ns(t){const e=t.constructor.clone(t);return e.afterCloneFrom(t),e}function rs(t){return(e=ns(t))[xn]=!0,e;var e}function is(t,e){const n=parseInt(t.style.paddingInlineStart,10)||0,r=Math.round(n/40);e.setIndent(r)}function os(t){return!0===t.__lexicalUnmanaged}function ss(t,e){return function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}(t,e)&&t[e]!==Sn[e]}function ls(t){const e=R in t.prototype?t.prototype[R]():void 0,n=function(t){if(!(t===Sn||t.prototype instanceof Sn)){let e="<unknown>",n="<unknown>";try{e=t.getType()}catch(t){}try{Mi.version&&(n=JSON.parse(Mi.version))}catch(t){}r(290,t.name,e,n)}return t===ai||t===si||t===Sn}(t),i=!n&&ss(t,"getType")?t.getType():void 0;let o,s=i;if(e)if(i)o=e[i];else for(const[t,n]of Object.entries(e))s=t,o=n;if(!n&&s&&(ss(t,"getType")||(t.getType=()=>s),ss(t,"clone")||(t.clone=e=>(Ai(e),new t)),ss(t,"importJSON")||(t.importJSON=o&&o.$importJSON||(e=>(new t).updateFromJSON(e))),!ss(t,"importDOM")&&o)){const{importDOM:e}=o;e&&(t.importDOM=()=>e)}return{ownNodeConfig:o,ownNodeType:s}}function cs(t){const e=Yo();return Zr(),new(e.resolveRegisteredNodeAfterReplacements(e.getRegisteredNode(t)).klass)}const as=(t,e)=>{let n=t;for(;null!=n&&!fi(n);){if(e(n))return n;n=n.getParent()}return null},us={next:"previous",previous:"next"};class ds{origin;constructor(t){this.origin=t}[Symbol.iterator](){return Fs({hasNext:xs,initial:this.getAdjacentCaret(),map:t=>t,step:t=>t.getAdjacentCaret()})}getAdjacentCaret(){return Ns(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Ns(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 e=o.getAdjacentCaret();null!==e&&l.size<t;e=e.getAdjacentCaret()){const t=e.origin.getWritable();l.set(t.getKey(),t)}for(const t of i){if(l.size>0){const e=o.getNodeAtCaret();if(e)if(l.delete(e.getKey()),l.delete(t.getKey()),e.is(t)||o.origin.is(t));else{const n=t.getParent();n&&n.is(s)&&t.remove(),e.replace(t)}else null===e&&r(263,Array.from(l).join(" "))}else o.insert(t);o=Ns(t,this.direction)}for(const t of l.values())t.remove();return this}}class fs extends ds{type="child";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:Ts(t,this.direction)}getParentCaret(t="root"){return Ns(ps(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=gs(this.direction);return Ns(this.getNodeAtCaret(),t)||Ts(this.origin,t)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof fs&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(t){return this.isSameNodeCaret(t)}}const hs={root:fi,shadowRoot:Bo};function gs(t){return us[t]}function ps(t,e="root"){return hs[e](t)?null:t}class ms extends ds{type="sibling";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:Ns(t,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return li(this.origin)?Ts(this.origin,this.direction):null}getParentCaret(t="root"){return Ns(ps(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=gs(this.direction);return Ns(this.getNodeAtCaret(),t)||Ts(this.origin.getParentOrThrow(),t)}isSamePointCaret(t){return t instanceof ms&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof ms||t instanceof _s)&&this.direction===t.direction&&this.origin.is(t.origin)}}class _s extends ds{type="text";offset;constructor(t,e){super(t),this.offset=e}getLatest(){const t=this.origin.getLatest();return t===this.origin?this:Es(t,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(t="root"){return Ns(ps(this.getParentAtCaret(),t),this.direction)}getFlipped(){return Es(this.origin,gs(this.direction),this.offset)}isSamePointCaret(t){return t instanceof _s&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof ms||t instanceof _s)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return Ns(this.origin,this.direction)}}function ys(t){return t instanceof _s}function xs(t){return t instanceof ms}function vs(t){return t instanceof fs}const Ss={next:class extends _s{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(t){return this.origin.insertAfter(t),this}},previous:class extends _s{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t){return this.origin.insertBefore(t),this}}},Cs={next:class extends ms{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(t){return this.origin.insertAfter(t),this}},previous:class extends ms{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t){return this.origin.insertBefore(t),this}}},bs={next:class extends fs{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(t){return this.origin.splice(0,0,[t]),this}},previous:class extends fs{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(t){return this.origin.splice(this.origin.getChildrenSize(),0,[t]),this}}};function Ns(t,e){return t?new Cs[e](t):null}function Es(t,e,n){return t?new Ss[e](t,ws(t,n)):null}function ws(t,e,n="error"){const r=t.getTextContentSize();let o="next"===e?r:"previous"===e?0:e;return(o<0||o>r)&&("clamp"!==n&&i(284,String(e),String(r),t.getKey()),o=o<0?0:r),o}function ks(t,e){return new Ps(t,e)}function Ts(t,e){return li(t)?new bs[e](t):null}function Os(t){return t&&function(t){return t&&t.getChildCaret()||t}(t.getAdjacentCaret())}class Ms{type="node-caret-range";direction;anchor;focus;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 Ms(t,e,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const t=t=>{const e=this[t].getLatest();return ys(e)?function(t,e){const{direction:n,origin:r}=t;return ks(t,ws(r,"focus"===e?gs(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[ks(t,r.offset-t.offset),null]}return[e,n]}
vendor: 4,903 bytes, line 1
1iterNodeCarets(t="root"){const e=ys(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=ys(n),i=e=>e.isSameNodeCaret(n)?null:Os(e)||e.getParentCaret(t);return Fs({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 Ps{type="slice";caret;distance;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 Es(t.setTextContent(i.slice(0,n)+i.slice(r)),e,n)}}function As(t){return Ds(t,Ns(lo(),t.direction))}function Ls(t){return Ds(t,t)}function Ds(t,e){return t.direction!==e.direction&&r(265),new Ms(t,e,t.direction)}function Fs(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 Is(t,e){const n=zs(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 Rs(n)}}function Rs(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 Ks(t,e){return e.is(t)}function Bs(t){return li(t)?[t.getLatest(),null]:[t.getParent(),t.getLatest()]}function zs(t,e){if(t.is(e))return{commonAncestor:t,type:"same"};const n=new Map;for(let[e,r]=Bs(t);e;r=e,e=e.getParent())n.set(e,r);for(let[i,o]=Bs(e);i;o=i,i=i.getParent()){const s=n.get(i);if(void 0!==s)return null===s?(Ks(t,i)||r(276),{commonAncestor:i,type:"ancestor"}):null===o?(Ks(e,i)||r(277),{commonAncestor:i,type:"descendant"}):((li(s)||Ks(t,s))&&(li(o)||Ks(e,o))&&i.is(s.getParent())&&i.is(o.getParent())||r(278),{a:s,b:o,commonAncestor:i,type:"branch"})}return null}function Ws(t,e){const{type:n,key:i,offset:o}=t,s=function(t){const e=eo(t);return null===e&&r(63,t),e}(t.key);return"text"===n?(Xn(s)||r(266,s.getType(),i),Es(s,e,o)):(li(s)||r(267,s.getType(),i),function(t,e,n){let r=Ts(t,"next");for(let t=0;t<e;t++){const t=r.getAdjacentCaret();if(null===t)break;r=t}return Ys(r,n)}(s,t.offset,e))}function Zs(t,e){const{origin:n,direction:i}=e,o="next"===i;ys(e)?t.set(n.getKey(),e.offset,"text"):xs(e)?Xn(n)?t.set(n.getKey(),ws(n,i),"text"):t.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(o?1:0),"element"):(vs(e)&&li(n)||r(268),t.set(n.getKey(),o?0:n.getChildrenSize(),"element"))}function Vs(t){const e=Nr(),n=lr(e)?e:Sr();return $s(n,t),ao(n),n}function $s(t,e){Zs(t.anchor,e.anchor),Zs(t.focus,e.focus)}function Js(t){const{anchor:e,focus:n}=t,r=Ws(e,"next"),i=Ws(n,"next"),o=Is(r,i)<=0?"next":"previous";return Ds(Ys(r,o),Ys(i,o))}function Us(t){const{direction:e,origin:n}=t,r=Ns(n,gs(e)).getNodeAtCaret();return r?Ns(r,e):Ts(n.getParentOrThrow(),e)}function js(t,e="root"){const n=[t];for(let r=vs(t)?t.getParentCaret(e):t.getSiblingCaret();null!==r;r=r.getParentCaret(e))n.push(Us(r));return n}function Gs(t){return!!t&&t.origin.isAttached()}function qs(t,e="removeEmptySlices"){if(t.isCollapsed())return t;const n="root",i="next";let o=e;const s=Qs(t,i),l=js(s.anchor,n),c=js(s.focus.getFlipped(),n),a=new Set,u=[];for(const t of s.iterNodeCarets(n))if(vs(t))a.add(t.origin.getKey());else if(xs(t)){const{origin:e}=t;li(e)&&!a.has(e.getKey())||u.push(e)}for(const t of u)t.remove();for(const t of s.getTextSlices()){if(!t)continue;const{origin:e}=t.caret,n=e.getTextContentSize(),r=Us(Ns(e,i)),s=e.getMode();if(Math.abs(t.distance)===n&&"removeEmptySlices"===o||"token"===s&&0!==t.distance)r.remove();else if(0!==t.distance){o="removeEmptySlices";let e=t.removeTextSlice();const n=t.caret.origin;if("segmented"===s){const t=e.origin,n=Hn(t.getTextContent()).setStyle(t.getStyle()).setFormat(t.getFormat());r.replaceOrInsert(n),e=Es(n,i,e.offset)}n.is(l[0].origin)&&(l[0]=e),n.is(c[0].origin)&&(c[0]=e.getFlipped())}}let d,f;for(const t of l)if(Gs(t)){d=Hs(t);break}for(const t of c)if(Gs(t)){f=Hs(t);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];
1if(Bo(i))return;!n&&e(i)&&(n=i)}return n},u=a(o,Xo),d=u&&a(s,t=>n.has(t.getKey())&&Xo(t));return u&&d?[u,d]:null}(d,f,a);if(h){const[t,e]=h;Ts(t,"previous").splice(0,e.getChildren()),e.remove()}const g=[d,f,...l,...c].find(Gs);if(g)return Ls(Ys(Hs(g),t.direction));r(269,JSON.stringify(l.map(t=>t.origin.__key)))}function Hs(t){const e=function(t){let e=t;for(;vs(e);){const t=Os(e);if(!vs(t))break;e=t}return e}(t.getLatest()),{direction:n}=e;if(Xn(e.origin))return ys(e)?e:Es(e.origin,n,n);const r=e.getAdjacentCaret();return xs(r)&&Xn(r.origin)?Es(r.origin,n,gs(n)):e}function Xs(t){return ys(t)&&t.offset!==ws(t.origin,t.direction)}function Ys(t,e){return t.direction===e?t:t.getFlipped()}function Qs(t,e){return t.direction===e?t:Ds(Ys(t.focus,e),Ys(t.anchor,e))}function tl(t){const{origin:e,offset:n,direction:i}=t;if(n===ws(e,i))return t.getSiblingCaret();if(n===ws(e,gs(i)))return Us(t.getSiblingCaret());const[o]=e.splitText(n);return Xn(o)||r(281),Ys(Ns(o,"next"),i)}function el(t,e){return!0}function nl(t,{$copyElementNode:e=zo,$splitTextPointCaretNext:n=tl,rootMode:r="shadowRoot",$shouldSplit:i=el}={}){if(ys(t))return n(t);const o=t.getParentCaret(r);if(o){const{origin:n}=o;if(vs(t)&&(!n.canBeEmpty()||!i(n,"first")))return Us(o);const r=function(t){const e=[];for(let n=t.getAdjacentCaret();n;n=n.getAdjacentCaret())e.push(n.origin);return e}(t);(r.length>0||n.canBeEmpty()&&i(n,"last"))&&o.insert(e(n).splice(0,0,r))}return o}function rl(t){return t}function il(...t){return t}function ol(t){return t}function sl(t,e){if(!e||t===e)return t;for(const n in e)if(t[n]!==e[n])return{...t,...e};return t}}}]); 2//# sourceMappingURL=npm.lexical.1a4b6130f129f88dc6af.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.